Built motion from commit 654a660.|0.0.150
[motion.git] / server / api / contact_manager / contact_manager.controller.js
index 330578c..631e02a 100644 (file)
@@ -1 +1 @@
-var _0xbc81=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74\x50\x68\x6F\x6E\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x43\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x4C\x69\x73\x74","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x54\x61\x67","\x73\x74\x72\x65\x61\x6D","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x69\x6E\x64\x65\x78","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x69\x64","\x6D\x61\x70","\x71\x75\x65\x72\x79","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x4C\x69\x73\x74\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x64\x65\x73\x63\x72\x69\x62\x65","\x67\x65\x74\x4C\x6F\x67","\x64\x65\x74\x61\x69\x6C","\x67\x65\x6E\x65\x72\x61\x6C","\x73\x68\x6F\x77","\x70\x68\x6F\x6E\x65","\x6C\x6F\x67\x54\x79\x70\x65","\x6A\x6F\x75\x72\x6E\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x6D\x6F\x62\x69\x6C\x65","\x73\x6F\x75\x72\x63\x65","\x66\x72\x6F\x6D","\x65\x6D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x76\x69\x73\x69\x74\x6F\x72\x65\x6D\x61\x69\x6C","\x63\x68\x61\x74","\x66\x61\x78","\x73\x6D\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73","\x6E\x75\x6C\x6C","\x66\x6F\x72\x45\x61\x63\x68","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x6D\x65\x72\x67\x65","\x6C\x65\x6E\x67\x74\x68","\x2C","\x6A\x6F\x69\x6E","\x6E\x61\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x4C\x69\x73\x74\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x76\x65\x6E\x74\x43\x6F\x6E\x74\x61\x63\x74\x73","\x76\x6F\x69\x63\x65","\x6D\x61\x69\x6C","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x63\x72\x65\x61\x74\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x62\x6F\x64\x79","\x25\x73\x3D\x27\x25\x73\x27","\x70\x75\x73\x68","\x55\x50\x44\x41\x54\x45\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x53\x45\x54\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x55\x73\x65\x72\x49\x64","\x61\x6C\x6C","\x74\x61\x67\x73","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x63\x6F\x6E\x74\x61\x63\x74\x73","\x6B\x6F","\x6F\x6B","\x66\x6F\x72\x45\x61\x63\x68\x4F\x66","\x75\x6E\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0xbc81[0];var _=require(_0xbc81[1]);var moment=require(_0xbc81[2]);var Contact=require(_0xbc81[4])[_0xbc81[3]];var User=require(_0xbc81[4])[_0xbc81[5]];var ContactPhone=require(_0xbc81[4])[_0xbc81[6]];var ContactEmail=require(_0xbc81[4])[_0xbc81[7]];var CustomField=require(_0xbc81[4])[_0xbc81[8]];var ReportCall=require(_0xbc81[4])[_0xbc81[9]];var ReportQueue=require(_0xbc81[4])[_0xbc81[10]];var ReportQueueHistory=require(_0xbc81[4])[_0xbc81[12]][_0xbc81[11]];var ReportChatRoom=require(_0xbc81[4])[_0xbc81[13]];var ReportChatRoomHistory=require(_0xbc81[4])[_0xbc81[12]][_0xbc81[14]];var FaxRoom=require(_0xbc81[4])[_0xbc81[15]];var SmsRoom=require(_0xbc81[4])[_0xbc81[16]];var ReportIntegration=require(_0xbc81[4])[_0xbc81[17]];var List=require(_0xbc81[4])[_0xbc81[18]];var ReportCallHistory=require(_0xbc81[4])[_0xbc81[12]][_0xbc81[19]];var ReportMailSession=require(_0xbc81[4])[_0xbc81[20]];var MailRoom=require(_0xbc81[4])[_0xbc81[21]];var ReportMailSessionHistory=require(_0xbc81[4])[_0xbc81[12]][_0xbc81[22]];var Tag=require(_0xbc81[4])[_0xbc81[23]];var stream=require(_0xbc81[24]);var sequelize=require(_0xbc81[4])[_0xbc81[25]];var util=require(_0xbc81[26]);var Util=require(_0xbc81[27]);var Async=require(_0xbc81[28]);exports[_0xbc81[29]]= function(_0x2f39x1b,_0x2f39x1c,_0x2f39x1d){switch(_0x2f39x1b[_0xbc81[45]][_0xbc81[48]]){case _0xbc81[47]:return User[_0xbc81[46]](_0x2f39x1b[_0xbc81[45]][_0xbc81[35]])[_0xbc81[34]](function(_0x2f39x22){return _0x2f39x22[_0xbc81[44]]()})[_0xbc81[34]](function(_0x2f39x20){var _0x2f39x21=_[_0xbc81[36]](_0x2f39x20,_0xbc81[35]);return Contact[_0xbc81[43]](_0xbc81[40],_0xbc81[41],{method:[_0xbc81[42],_0x2f39x1b[_0xbc81[37]]]})[_0xbc81[39]](Util[_0xbc81[38]](_0x2f39x1b[_0xbc81[37]],{ListId:{$in:_0x2f39x21}}))})[_0xbc81[34]](function(_0x2f39x1f){_0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x1f)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return handleError(_0x2f39x1c,_0x2f39x1e)});default:return Contact[_0xbc81[43]](_0xbc81[40],_0xbc81[41],{method:[_0xbc81[42],_0x2f39x1b[_0xbc81[37]]]})[_0xbc81[39]](Util[_0xbc81[38]](_0x2f39x1b[_0xbc81[37]]))[_0xbc81[34]](function(_0x2f39x1f){_0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x1f)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return handleError(_0x2f39x1c,_0x2f39x1e)})}};exports[_0xbc81[49]]= function(_0x2f39x1b,_0x2f39x1c){return Contact[_0xbc81[49]]()[_0xbc81[34]](function(_0x2f39x23){return _0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x23)})[_0xbc81[31]](function(_0x2f39x1e){return handleError(_0x2f39x1c,_0x2f39x1e)})};exports[_0xbc81[50]]= function(_0x2f39x1b,_0x2f39x1c,_0x2f39x1d){_0x2f39x1b[_0xbc81[37]][_0xbc81[51]]= _0x2f39x1b[_0xbc81[37]][_0xbc81[51]]|| _0xbc81[52];_0x2f39x1b[_0xbc81[37]][_0xbc81[53]]= _0x2f39x1b[_0xbc81[37]][_0xbc81[53]]|| _0xbc81[54];_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]= _0x2f39x1b[_0xbc81[37]][_0xbc81[55]]|| _0xbc81[56];_0x2f39x1b[_0xbc81[37]][_0xbc81[57]]= _0x2f39x1b[_0xbc81[37]][_0xbc81[57]]|| _0xbc81[58];var _0x2f39x24,_0x2f39x25={};return Contact[_0xbc81[46]](_0x2f39x1b[_0xbc81[75]][_0xbc81[35]])[_0xbc81[34]](function(_0x2f39x26){if(!_0x2f39x26){return _0x2f39x1c[_0xbc81[59]](404)};switch(_0x2f39x1b[_0xbc81[37]][_0xbc81[51]]){case _0xbc81[52]:switch(_0x2f39x1b[_0xbc81[37]][_0xbc81[53]]){case _0xbc81[54]:_0x2f39x24= (_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12])?ReportCallHistory:ReportCall;if(_0x2f39x1b[_0xbc81[37]][_0xbc81[57]]=== _0xbc81[60]){_0x2f39x25[_0xbc81[61]]= [_0x2f39x26[_0xbc81[54]],_0x2f39x26[_0xbc81[62]]]}else {_0x2f39x25[_0xbc81[63]]= [_0x2f39x26[_0xbc81[54]],_0x2f39x26[_0xbc81[62]]]};break;case _0xbc81[65]:_0x2f39x24= MailRoom;_0x2f39x25[_0xbc81[64]]= _0x2f39x26[_0xbc81[65]];if(_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12]){_0x2f39x25[_0xbc81[66]]= {$lt:moment()[_0xbc81[68]](_0xbc81[67])}}else {_0x2f39x25[_0xbc81[66]]= {$gte:moment()[_0xbc81[68]](_0xbc81[67])}};break;case _0xbc81[70]:_0x2f39x24= (_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12])?ReportChatRoomHistory:ReportChatRoom;_0x2f39x25[_0xbc81[69]]= _0x2f39x26[_0xbc81[65]];break;case _0xbc81[71]:_0x2f39x24= FaxRoom;_0x2f39x25[_0xbc81[64]]= _0x2f39x26[_0xbc81[71]];if(_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12]){_0x2f39x25[_0xbc81[66]]= {$lt:moment()[_0xbc81[68]](_0xbc81[67])}}else {_0x2f39x25[_0xbc81[66]]= {$gte:moment()[_0xbc81[68]](_0xbc81[67])}};break;case _0xbc81[72]:_0x2f39x24= SmsRoom;_0x2f39x25[_0xbc81[64]]= [_0x2f39x26[_0xbc81[54]],_0x2f39x26[_0xbc81[62]]];if(_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12]){_0x2f39x25[_0xbc81[66]]= {$lt:moment()[_0xbc81[68]](_0xbc81[67])}}else {_0x2f39x25[_0xbc81[66]]= {$gte:moment()[_0xbc81[68]](_0xbc81[67])}};break;default:_0x2f39x24= (_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12])?ReportCallHistory:ReportCall};break;case _0xbc81[74]:switch(_0x2f39x1b[_0xbc81[37]][_0xbc81[53]]){case _0xbc81[54]:_0x2f39x24= (_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12])?ReportQueueHistory:ReportQueue;_0x2f39x25[_0xbc81[73]]= [_0x2f39x26[_0xbc81[54]],_0x2f39x26[_0xbc81[62]]];break;case _0xbc81[65]:return _0x2f39x1c[_0xbc81[59]](404);default:_0x2f39x24= (_0x2f39x1b[_0xbc81[37]][_0xbc81[55]]=== _0xbc81[12])?ReportQueueHistory:ReportQueue};break;default:_0x2f39x24= ReportCall};delete _0x2f39x1b[_0xbc81[37]][_0xbc81[51]];delete _0x2f39x1b[_0xbc81[37]][_0xbc81[53]];delete _0x2f39x1b[_0xbc81[37]][_0xbc81[55]];delete _0x2f39x1b[_0xbc81[37]][_0xbc81[57]];return _0x2f39x24[_0xbc81[39]](Util[_0xbc81[38]](_0x2f39x1b[_0xbc81[37]],_0x2f39x25))})[_0xbc81[34]](function(_0x2f39x1f){_0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x1f)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return handleError(_0x2f39x1c,_0x2f39x1e)})};exports[_0xbc81[53]]= function(_0x2f39x1b,_0x2f39x1c){var _0x2f39x27;return Contact[_0xbc81[43]](_0xbc81[40],_0xbc81[45],_0xbc81[41])[_0xbc81[46]](_0x2f39x1b[_0xbc81[75]][_0xbc81[35]])[_0xbc81[34]](function(_0x2f39x2e){if(!_0x2f39x2e){return _0x2f39x1c[_0xbc81[59]](404)};_0x2f39x27= _0x2f39x2e;return CustomField[_0xbc81[89]]({where:{ListId:_0x2f39x27[_0xbc81[88]]}})})[_0xbc81[34]](function(_0x2f39x2c){if(_0x2f39x2c[_0xbc81[80]]){var _0x2f39x2d=_[_0xbc81[36]](_0x2f39x2c,_0xbc81[83])[_0xbc81[82]](_0xbc81[81]);return sequelize[_0xbc81[37]](util[_0xbc81[85]](_0xbc81[84],_0x2f39x2d,_0x2f39x1b[_0xbc81[75]][_0xbc81[35]]),{type:sequelize[_0xbc81[87]][_0xbc81[86]]})}})[_0xbc81[34]](function(_0x2f39x28){if(_0x2f39x28){_[_0xbc81[77]](_0x2f39x28[0],function(_0x2f39x29,_0x2f39x2a,_0x2f39x2b){if(_0x2f39x29=== _0xbc81[76]){_0x2f39x2b[_0x2f39x2a]= null}});_[_0xbc81[79]](_0x2f39x27[_0xbc81[78]],_0x2f39x28[0])}})[_0xbc81[34]](function(){return _0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x27)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return handleError(_0x2f39x1c,_0x2f39x1e)})};exports[_0xbc81[90]]= function(_0x2f39x1b,_0x2f39x1c){return ReportIntegration[_0xbc81[46]](_0x2f39x1b[_0xbc81[75]][_0xbc81[35]])[_0xbc81[34]](function(_0x2f39x30){var _0x2f39x25={};switch(_0x2f39x30[_0xbc81[93]]){case _0xbc81[91]:_0x2f39x25= {$or:{phone:_0x2f39x30[_0xbc81[73]],mobile:_0x2f39x30[_0xbc81[73]]}};break;case _0xbc81[92]:_0x2f39x25= {email:_0x2f39x30[_0xbc81[64]]};break;default:_0x2f39x25= {}};return Contact[_0xbc81[39]]({where:_0x2f39x25,include:[{model:List,where:{id:_[_0xbc81[36]](_[_0xbc81[36]](_0x2f39x1b[_0xbc81[45]].Lists,_0xbc81[78]),_0xbc81[35])}}]})})[_0xbc81[34]](function(_0x2f39x2f){return _0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x2f)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return handleError(_0x2f39x1c,_0x2f39x1e)})};exports[_0xbc81[94]]= function(_0x2f39x1b,_0x2f39x1c,_0x2f39x1d){var _0x2f39x27;return Tag[_0xbc81[89]]()[_0xbc81[34]](function(_0x2f39x32){var _0x2f39x33=[];var _0x2f39x34=_[_0xbc81[36]](_[_0xbc81[36]](_0x2f39x32,_0xbc81[78]),_0xbc81[83]);if(_0x2f39x1b[_0xbc81[96]][_0xbc81[102]]){_0x2f39x1b[_0xbc81[96]][_0xbc81[102]][_0xbc81[77]](function(_0x2f39x31){if(!_[_0xbc81[103]](_0x2f39x34,_0x2f39x31)){_0x2f39x33[_0xbc81[98]](Tag[_0xbc81[94]]({name:_0x2f39x31}))}})};return _0x2f39x33})[_0xbc81[101]]()[_0xbc81[34]](function(){_0x2f39x1b[_0xbc81[96]][_0xbc81[100]]= _0x2f39x1b[_0xbc81[45]][_0xbc81[35]];return Contact[_0xbc81[94]](_0x2f39x1b[_0xbc81[96]])})[_0xbc81[34]](function(_0x2f39x26){_0x2f39x27= _0x2f39x26;return CustomField[_0xbc81[89]]({where:{ListId:_0x2f39x27[_0xbc81[88]]}})})[_0xbc81[34]](function(_0x2f39x2c){if(_0x2f39x2c[_0xbc81[80]]){var _0x2f39x2d=[];_0x2f39x2c[_0xbc81[77]](function(_0x2f39x31){if(_0x2f39x1b[_0xbc81[96]][_0xbc81[95]](_0x2f39x31[_0xbc81[83]])){_0x2f39x2d[_0xbc81[98]](util[_0xbc81[85]](_0xbc81[97],_0x2f39x31[_0xbc81[83]],_0x2f39x1b[_0xbc81[96]][_0x2f39x31[_0xbc81[83]]]))}});if(_0x2f39x2d[_0xbc81[80]]){_0x2f39x2d= _0x2f39x2d[_0xbc81[82]](_0xbc81[81]);return sequelize[_0xbc81[37]](util[_0xbc81[85]](_0xbc81[99],_0x2f39x2d,_0x2f39x27[_0xbc81[35]]))}}})[_0xbc81[34]](function(){return _0x2f39x1c[_0xbc81[33]](201)[_0xbc81[32]](_0x2f39x27)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return _0x2f39x1d(_0x2f39x1e)})};exports[_0xbc81[104]]= function(_0x2f39x1b,_0x2f39x1c,_0x2f39x1d){var _0x2f39x35=[];var _0x2f39x36={ok:0,ko:0};return Tag[_0xbc81[89]]()[_0xbc81[34]](function(_0x2f39x32){var _0x2f39x33=[],_0x2f39x39=[];var _0x2f39x34=_[_0xbc81[36]](_[_0xbc81[36]](_0x2f39x32,_0xbc81[78]),_0xbc81[83]);_0x2f39x1b[_0xbc81[96]][_0xbc81[105]][_0xbc81[77]](function(_0x2f39x26){if(_0x2f39x26[_0xbc81[102]]){_0x2f39x39= _[_0xbc81[109]](_0x2f39x39,_0x2f39x26[_0xbc81[102]])}});_0x2f39x39[_0xbc81[77]](function(_0x2f39x31){if(!_[_0xbc81[103]](_0x2f39x34,_0x2f39x31)){_0x2f39x33[_0xbc81[98]](Tag[_0xbc81[94]]({name:_0x2f39x31}))}});return _0x2f39x33})[_0xbc81[101]]()[_0xbc81[34]](function(){var _0x2f39x38=[];Async[_0xbc81[108]](_0x2f39x1b[_0xbc81[96]][_0xbc81[105]],function(_0x2f39x26){_0x2f39x26[_0xbc81[100]]= _0x2f39x1b[_0xbc81[45]][_0xbc81[35]];_0x2f39x38[_0xbc81[98]](Contact[_0xbc81[94]](_0x2f39x26)[_0xbc81[34]](function(_0x2f39x26){_0x2f39x35[_0xbc81[98]](_0x2f39x26);_0x2f39x36[_0xbc81[107]]++})[_0xbc81[31]](function(_0x2f39x1e){_0x2f39x36[_0xbc81[106]]++}))});return _0x2f39x38})[_0xbc81[101]]()[_0xbc81[34]](function(){return CustomField[_0xbc81[89]]({where:{ListId:{$in:_[_0xbc81[36]](_0x2f39x1b[_0xbc81[96]][_0xbc81[105]],_0xbc81[88])}}})})[_0xbc81[34]](function(_0x2f39x2c){var _0x2f39x37=[];if(_0x2f39x2c[_0xbc81[80]]){var _0x2f39x2d=[];_0x2f39x35[_0xbc81[77]](function(_0x2f39x26){_0x2f39x2d= [];_0x2f39x2c[_0xbc81[77]](function(_0x2f39x31){if(_0x2f39x26[_0xbc81[95]](_0x2f39x31[_0xbc81[83]])){_0x2f39x2d[_0xbc81[98]](util[_0xbc81[85]](_0xbc81[97],_0x2f39x31[_0xbc81[83]],_0x2f39x1b[_0xbc81[96]][_0x2f39x31[_0xbc81[83]]]))}});if(_0x2f39x2d[_0xbc81[80]]){_0x2f39x2d= _0x2f39x2d[_0xbc81[82]](_0xbc81[81]);_0x2f39x37[_0xbc81[98]](sequelize[_0xbc81[37]](util[_0xbc81[85]](_0xbc81[99],_0x2f39x2d,_0x2f39x26[_0xbc81[35]])))}})};return _0x2f39x37})[_0xbc81[101]]()[_0xbc81[34]](function(){return _0x2f39x1c[_0xbc81[33]](201)[_0xbc81[32]](_0x2f39x36)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return _0x2f39x1d(_0x2f39x1e)})};exports[_0xbc81[110]]= function(_0x2f39x1b,_0x2f39x1c,_0x2f39x1d){var _0x2f39x27;return Tag[_0xbc81[89]]()[_0xbc81[34]](function(_0x2f39x32){var _0x2f39x33=[];var _0x2f39x34=_[_0xbc81[36]](_[_0xbc81[36]](_0x2f39x32,_0xbc81[78]),_0xbc81[83]);if(_0x2f39x1b[_0xbc81[96]][_0xbc81[102]]){_0x2f39x1b[_0xbc81[96]][_0xbc81[102]][_0xbc81[77]](function(_0x2f39x31){if(!_[_0xbc81[103]](_0x2f39x34,_0x2f39x31)){_0x2f39x33[_0xbc81[98]](Tag[_0xbc81[94]]({name:_0x2f39x31}))}})};return _0x2f39x33})[_0xbc81[34]](function(){return Contact[_0xbc81[46]](_0x2f39x1b[_0xbc81[75]][_0xbc81[35]])})[_0xbc81[34]](function(_0x2f39x26){delete _0x2f39x1b[_0xbc81[96]][_0xbc81[35]];return _0x2f39x26[_0xbc81[111]](_0x2f39x1b[_0xbc81[96]])})[_0xbc81[34]](function(_0x2f39x26){_0x2f39x27= _0x2f39x26;return CustomField[_0xbc81[89]]({where:{ListId:_0x2f39x27[_0xbc81[88]]}})})[_0xbc81[34]](function(_0x2f39x2c){if(_0x2f39x2c[_0xbc81[80]]){var _0x2f39x2d=[];_0x2f39x2c[_0xbc81[77]](function(_0x2f39x31){if(_0x2f39x1b[_0xbc81[96]][_0xbc81[95]](_0x2f39x31[_0xbc81[83]])){_0x2f39x2d[_0xbc81[98]](util[_0xbc81[85]](_0xbc81[97],_0x2f39x31[_0xbc81[83]],_0x2f39x1b[_0xbc81[96]][_0x2f39x31[_0xbc81[83]]]))}});if(_0x2f39x2d[_0xbc81[80]]){_0x2f39x2d= _0x2f39x2d[_0xbc81[82]](_0xbc81[81]);return sequelize[_0xbc81[37]](util[_0xbc81[85]](_0xbc81[99],_0x2f39x2d,_0x2f39x27[_0xbc81[35]]))}}})[_0xbc81[34]](function(){return _0x2f39x1c[_0xbc81[33]](200)[_0xbc81[32]](_0x2f39x27)})[_0xbc81[31]](function(_0x2f39x1e){console[_0xbc81[30]](_0x2f39x1e);return handleError(_0x2f39x1c,_0x2f39x1e)})};exports[_0xbc81[112]]= function(_0x2f39x1b,_0x2f39x1c){return Contact[_0xbc81[46]](_0x2f39x1b[_0xbc81[75]][_0xbc81[35]])[_0xbc81[34]](function(_0x2f39x2e){if(!_0x2f39x2e){return _0x2f39x1c[_0xbc81[59]](404)};return _0x2f39x2e[_0xbc81[112]]()})[_0xbc81[34]](function(){return _0x2f39x1c[_0xbc81[59]](204)})[_0xbc81[31]](function(_0x2f39x1e){return handleError(_0x2f39x1c,_0x2f39x1e)})};exports[_0xbc81[113]]= function(_0x2f39x1b,_0x2f39x1c){return Contact[_0xbc81[112]]({where:{id:_0x2f39x1b[_0xbc81[37]][_0xbc81[114]]},individualHooks:true})[_0xbc81[34]](function(){return _0x2f39x1c[_0xbc81[59]](204)})[_0xbc81[31]](function(_0x2f39x1e){return handleError(_0x2f39x1c,_0x2f39x1e)})};function handleError(_0x2f39x1c,_0x2f39x1e){return _0x2f39x1c[_0xbc81[33]](500)[_0xbc81[32]](_0x2f39x1e)}
\ No newline at end of file
+var _0x5aac=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74\x50\x68\x6F\x6E\x65","\x43\x6F\x6E\x74\x61\x63\x74\x45\x6D\x61\x69\x6C","\x43\x75\x73\x74\x6F\x6D\x46\x69\x65\x6C\x64","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x48\x69\x73\x74\x6F\x72\x79","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x6D\x73\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x49\x6E\x74\x65\x67\x72\x61\x74\x69\x6F\x6E","\x4C\x69\x73\x74","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E\x48\x69\x73\x74\x6F\x72\x79","\x54\x61\x67","\x73\x74\x72\x65\x61\x6D","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x61\x73\x79\x6E\x63","\x69\x6E\x64\x65\x78","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x72\x6F\x77\x73","\x6D\x65\x72\x67\x65","\x6C\x65\x6E\x67\x74\x68","\x2C","\x6A\x6F\x69\x6E","\x6E\x61\x6D\x65","\x6D\x61\x70","\x53\x45\x4C\x45\x43\x54\x20\x69\x64\x2C\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x69\x64","\x27\x29","\x66\x6F\x72\x6D\x61\x74","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x71\x75\x65\x72\x79","\x6B\x65\x79\x73","\x63\x66\x5F","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x69\x6C\x74\x65\x72","\x66\x69\x6E\x64\x41\x6C\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x43\x6F\x6D\x70\x61\x6E\x79\x49\x64","\x4C\x69\x73\x74\x49\x64","\x63\x6F\x6E\x63\x61\x74","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x6C\x69\x73\x74","\x63\x6F\x6D\x70\x61\x6E\x79","\x63\x6F\x6D\x70\x61\x6E\x79\x5F\x6C\x69\x73\x74\x5F\x66\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x4C\x69\x73\x74\x73","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x67\x65\x6E\x74","\x66\x69\x6E\x64","\x66\x6F\x72\x45\x61\x63\x68","\x63\x6F\x75\x6E\x74","\x72\x6F\x6C\x65","\x67\x65\x74\x4C\x6F\x67","\x64\x65\x74\x61\x69\x6C","\x67\x65\x6E\x65\x72\x61\x6C","\x73\x68\x6F\x77","\x70\x68\x6F\x6E\x65","\x6C\x6F\x67\x54\x79\x70\x65","\x6A\x6F\x75\x72\x6E\x61\x6C","\x74\x79\x70\x65","\x69\x6E\x62\x6F\x75\x6E\x64","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x65\x73\x74\x69\x6E\x61\x74\x69\x6F\x6E","\x6D\x6F\x62\x69\x6C\x65","\x73\x6F\x75\x72\x63\x65","\x66\x72\x6F\x6D","\x65\x6D\x61\x69\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x6E\x74\x61\x63\x74","\x63\x68\x61\x74","\x66\x61\x78","\x73\x6D\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x71\x75\x65\x75\x65","\x70\x61\x72\x61\x6D\x73","\x6E\x75\x6C\x6C","\x53\x45\x4C\x45\x43\x54\x20\x25\x73\x20\x46\x52\x4F\x4D\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x67\x65\x74\x43\x6F\x6E\x74\x61\x63\x74\x73","\x62\x6F\x64\x79","\x76\x6F\x69\x63\x65","\x6D\x61\x69\x6C","\x65\x76\x65\x6E\x74\x43\x68\x61\x6E\x6E\x65\x6C","\x63\x72\x65\x61\x74\x65","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x25\x73\x3D\x27\x25\x73\x27","\x70\x75\x73\x68","\x55\x50\x44\x41\x54\x45\x20\x63\x6D\x5F\x63\x6F\x6E\x74\x61\x63\x74\x73\x20\x53\x45\x54\x20\x25\x73\x20\x57\x48\x45\x52\x45\x20\x69\x64\x3D\x25\x73","\x55\x73\x65\x72\x49\x64","\x61\x6C\x6C","\x74\x61\x67\x73","\x63\x6F\x70\x79","\x66\x6F\x72\x4F\x77\x6E","\x63\x6C\x6F\x6E\x65","\x3B","\x73\x70\x6C\x69\x74","\x70\x6F\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x63\x6F\x6E\x74\x61\x63\x74\x73","\x6B\x6F","\x6F\x6B","\x66\x6F\x72\x45\x61\x63\x68\x4F\x66","\x75\x6E\x69\x6F\x6E","\x75\x70\x64\x61\x74\x65","\x6F\x6C\x64\x43\x6F\x6E\x74\x61\x63\x74","\x64\x65\x73\x74\x72\x6F\x79","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x69\x64\x73"];_0x5aac[0];var _=require(_0x5aac[1]);var moment=require(_0x5aac[2]);var Contact=require(_0x5aac[4])[_0x5aac[3]];var User=require(_0x5aac[4])[_0x5aac[5]];var ContactPhone=require(_0x5aac[4])[_0x5aac[6]];var ContactEmail=require(_0x5aac[4])[_0x5aac[7]];var CustomField=require(_0x5aac[4])[_0x5aac[8]];var ReportCall=require(_0x5aac[4])[_0x5aac[9]];var ReportQueue=require(_0x5aac[4])[_0x5aac[10]];var ReportQueueHistory=require(_0x5aac[4])[_0x5aac[12]][_0x5aac[11]];var ReportChatRoom=require(_0x5aac[4])[_0x5aac[13]];var ReportChatRoomHistory=require(_0x5aac[4])[_0x5aac[12]][_0x5aac[14]];var ChatRoom=require(_0x5aac[4])[_0x5aac[15]];var FaxRoom=require(_0x5aac[4])[_0x5aac[16]];var SmsRoom=require(_0x5aac[4])[_0x5aac[17]];var ReportIntegration=require(_0x5aac[4])[_0x5aac[18]];var List=require(_0x5aac[4])[_0x5aac[19]];var ReportCallHistory=require(_0x5aac[4])[_0x5aac[12]][_0x5aac[20]];var ReportMailSession=require(_0x5aac[4])[_0x5aac[21]];var MailRoom=require(_0x5aac[4])[_0x5aac[22]];var ReportMailSessionHistory=require(_0x5aac[4])[_0x5aac[12]][_0x5aac[23]];var Tag=require(_0x5aac[4])[_0x5aac[24]];var stream=require(_0x5aac[25]);var sequelize=require(_0x5aac[4])[_0x5aac[26]];var util=require(_0x5aac[27]);var Util=require(_0x5aac[28]);var Async=require(_0x5aac[29]);exports[_0x5aac[30]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){var _0x35a3x1f,_0x35a3x20;switch(_0x35a3x1c[_0x5aac[68]][_0x5aac[74]]){case _0x5aac[70]:return User[_0x5aac[69]](_0x35a3x1c[_0x5aac[68]][_0x5aac[45]])[_0x5aac[35]](function(_0x35a3x2c){return _0x35a3x2c[_0x5aac[67]]()})[_0x5aac[35]](function(_0x35a3x2b){_0x35a3x20= _[_0x5aac[42]](_0x35a3x2b,_0x5aac[45]);return List[_0x5aac[55]]({where:{defaultEntry:true},attributes:[_0x5aac[45]]})})[_0x5aac[35]](function(_0x35a3x29){var _0x35a3x2a={CompanyId:_0x35a3x1c[_0x5aac[50]][_0x5aac[58]]|| null,ListId:_0x35a3x1c[_0x5aac[50]][_0x5aac[59]]|| null};delete _0x35a3x1c[_0x5aac[50]][_0x5aac[58]];delete _0x35a3x1c[_0x5aac[50]][_0x5aac[59]];console[_0x5aac[31]](Util[_0x5aac[61]](_0x35a3x1c[_0x5aac[50]],_0x35a3x2a[_0x5aac[59]]?{}:{ListId:{$in:_0x35a3x20[_0x5aac[60]](_[_0x5aac[42]](_0x35a3x29,_0x5aac[45]))}}));return Contact[_0x5aac[66]](_0x5aac[63],_0x5aac[64],{method:[_0x5aac[65],_0x35a3x2a]})[_0x5aac[62]](Util[_0x5aac[61]](_0x35a3x1c[_0x5aac[50]],_0x35a3x2a[_0x5aac[59]]?{}:{ListId:{$in:_0x35a3x20[_0x5aac[60]](_[_0x5aac[42]](_0x35a3x29,_0x5aac[45]))}}))})[_0x5aac[35]](function(_0x35a3x28){_0x35a3x1f= {rows:_[_0x5aac[42]](_0x35a3x28[_0x5aac[36]],_0x5aac[56]),count:_0x35a3x28[_0x5aac[36]]};return Contact[_0x5aac[57]]()})[_0x5aac[35]](function(_0x35a3x26){_0x35a3x26= _[_0x5aac[54]](_[_0x5aac[51]](_0x35a3x26),function(_0x35a3x27){return _[_0x5aac[53]](_0x35a3x27,_0x5aac[52])});return CustomField[_0x5aac[55]]({where:{name:_0x35a3x26}})})[_0x5aac[35]](function(_0x35a3x24){if(_0x35a3x24[_0x5aac[38]]){var _0x35a3x25=_[_0x5aac[42]](_0x35a3x24,_0x5aac[41])[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[43]+ _[_0x5aac[42]](_0x35a3x1f[_0x5aac[36]],_0x5aac[45])[_0x5aac[40]](_0x5aac[44])+ _0x5aac[46],_0x35a3x25),{type:sequelize[_0x5aac[49]][_0x5aac[48]]})}})[_0x5aac[35]](function(_0x35a3x23){_[_0x5aac[37]](_0x35a3x1f[_0x5aac[36]],_0x35a3x23);return _0x35a3x1f})[_0x5aac[35]](function(_0x35a3x22){_0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x22)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)});default:var _0x35a3x2a={CompanyId:_0x35a3x1c[_0x5aac[50]][_0x5aac[58]]|| null,ListId:_0x35a3x1c[_0x5aac[50]][_0x5aac[59]]|| null};delete _0x35a3x1c[_0x5aac[50]][_0x5aac[58]];delete _0x35a3x1c[_0x5aac[50]][_0x5aac[59]];return Contact[_0x5aac[66]](_0x5aac[63],_0x5aac[64],{method:[_0x5aac[65],_0x35a3x2a]})[_0x5aac[62]](Util[_0x5aac[61]](_0x35a3x1c[_0x5aac[50]]))[_0x5aac[35]](function(_0x35a3x28){_0x35a3x1f= {rows:_[_0x5aac[42]](_0x35a3x28[_0x5aac[36]],_0x5aac[56]),count:_0x35a3x28[_0x5aac[73]]};return Contact[_0x5aac[57]]()})[_0x5aac[35]](function(_0x35a3x26){_0x35a3x26= _[_0x5aac[54]](_[_0x5aac[51]](_0x35a3x26),function(_0x35a3x27){return _[_0x5aac[53]](_0x35a3x27,_0x5aac[52])});return CustomField[_0x5aac[55]]({where:{name:_0x35a3x26}})})[_0x5aac[35]](function(_0x35a3x24){if(_0x35a3x1f[_0x5aac[36]][_0x5aac[38]]&& _0x35a3x24[_0x5aac[38]]){var _0x35a3x25=_[_0x5aac[42]](_0x35a3x24,_0x5aac[41])[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[43]+ _[_0x5aac[42]](_0x35a3x1f[_0x5aac[36]],_0x5aac[45])[_0x5aac[40]](_0x5aac[44])+ _0x5aac[46],_0x35a3x25),{type:sequelize[_0x5aac[49]][_0x5aac[48]]})}})[_0x5aac[35]](function(_0x35a3x23){var _0x35a3x2d;_[_0x5aac[72]](_0x35a3x1f[_0x5aac[36]],function(_0x35a3x2e){_0x35a3x2d= _[_0x5aac[71]](_0x35a3x23,{id:_0x35a3x2e[_0x5aac[45]]});if(_0x35a3x2d){_[_0x5aac[37]](_0x35a3x2e,_0x35a3x2d)}});return _0x35a3x1f})[_0x5aac[35]](function(_0x35a3x22){_0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x22)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)})}};exports[_0x5aac[57]]= function(_0x35a3x1c,_0x35a3x1d){return Contact[_0x5aac[57]]()[_0x5aac[35]](function(_0x35a3x26){return _0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x26)})[_0x5aac[32]](function(_0x35a3x21){return handleError(_0x35a3x1d,_0x35a3x21)})};exports[_0x5aac[75]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){_0x35a3x1c[_0x5aac[50]][_0x5aac[76]]= _0x35a3x1c[_0x5aac[50]][_0x5aac[76]]|| _0x5aac[77];_0x35a3x1c[_0x5aac[50]][_0x5aac[78]]= _0x35a3x1c[_0x5aac[50]][_0x5aac[78]]|| _0x5aac[79];_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]= _0x35a3x1c[_0x5aac[50]][_0x5aac[80]]|| _0x5aac[81];_0x35a3x1c[_0x5aac[50]][_0x5aac[82]]= _0x35a3x1c[_0x5aac[50]][_0x5aac[82]]|| _0x5aac[83];var _0x35a3x2f,_0x35a3x30={};return Contact[_0x5aac[69]](_0x35a3x1c[_0x5aac[100]][_0x5aac[45]])[_0x5aac[35]](function(_0x35a3x31){if(!_0x35a3x31){return _0x35a3x1d[_0x5aac[84]](404)};switch(_0x35a3x1c[_0x5aac[50]][_0x5aac[76]]){case _0x5aac[77]:switch(_0x35a3x1c[_0x5aac[50]][_0x5aac[78]]){case _0x5aac[79]:_0x35a3x2f= (_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12])?ReportCallHistory:ReportCall;if(_0x35a3x1c[_0x5aac[50]][_0x5aac[82]]=== _0x5aac[85]){_0x35a3x30[_0x5aac[86]]= [_0x35a3x31[_0x5aac[79]],_0x35a3x31[_0x5aac[87]]]}else {_0x35a3x30[_0x5aac[88]]= [_0x35a3x31[_0x5aac[79]],_0x35a3x31[_0x5aac[87]]]};break;case _0x5aac[90]:_0x35a3x2f= MailRoom;_0x35a3x30[_0x5aac[89]]= _0x35a3x31[_0x5aac[90]];if(_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12]){_0x35a3x30[_0x5aac[91]]= {$lt:moment()[_0x5aac[93]](_0x5aac[92])}}else {_0x35a3x30[_0x5aac[91]]= {$gte:moment()[_0x5aac[93]](_0x5aac[92])}};break;case _0x5aac[95]:_0x35a3x2f= ChatRoom;_0x35a3x30[_0x5aac[94]]= _0x35a3x31[_0x5aac[90]];if(_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12]){_0x35a3x30[_0x5aac[91]]= {$lt:moment()[_0x5aac[93]](_0x5aac[92])}}else {_0x35a3x30[_0x5aac[91]]= {$gte:moment()[_0x5aac[93]](_0x5aac[92])}};break;case _0x5aac[96]:_0x35a3x2f= FaxRoom;_0x35a3x30[_0x5aac[94]]= _0x35a3x31[_0x5aac[96]];if(_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12]){_0x35a3x30[_0x5aac[91]]= {$lt:moment()[_0x5aac[93]](_0x5aac[92])}}else {_0x35a3x30[_0x5aac[91]]= {$gte:moment()[_0x5aac[93]](_0x5aac[92])}};break;case _0x5aac[97]:_0x35a3x2f= SmsRoom;_0x35a3x30[_0x5aac[94]]= [_0x35a3x31[_0x5aac[79]],_0x35a3x31[_0x5aac[87]]];if(_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12]){_0x35a3x30[_0x5aac[91]]= {$lt:moment()[_0x5aac[93]](_0x5aac[92])}}else {_0x35a3x30[_0x5aac[91]]= {$gte:moment()[_0x5aac[93]](_0x5aac[92])}};break;default:_0x35a3x2f= (_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12])?ReportCallHistory:ReportCall};break;case _0x5aac[99]:switch(_0x35a3x1c[_0x5aac[50]][_0x5aac[78]]){case _0x5aac[79]:_0x35a3x2f= (_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12])?ReportQueueHistory:ReportQueue;_0x35a3x30[_0x5aac[98]]= [_0x35a3x31[_0x5aac[79]],_0x35a3x31[_0x5aac[87]]];break;case _0x5aac[90]:return _0x35a3x1d[_0x5aac[84]](404);default:_0x35a3x2f= (_0x35a3x1c[_0x5aac[50]][_0x5aac[80]]=== _0x5aac[12])?ReportQueueHistory:ReportQueue};break;default:_0x35a3x2f= ReportCall};delete _0x35a3x1c[_0x5aac[50]][_0x5aac[76]];delete _0x35a3x1c[_0x5aac[50]][_0x5aac[78]];delete _0x35a3x1c[_0x5aac[50]][_0x5aac[80]];delete _0x35a3x1c[_0x5aac[50]][_0x5aac[82]];return _0x35a3x2f[_0x5aac[62]](Util[_0x5aac[61]](_0x35a3x1c[_0x5aac[50]],_0x35a3x30))})[_0x5aac[35]](function(_0x35a3x22){_0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x22)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)})};exports[_0x5aac[78]]= function(_0x35a3x1c,_0x35a3x1d){var _0x35a3x32;return Contact[_0x5aac[66]](_0x5aac[63],_0x5aac[68],_0x5aac[64])[_0x5aac[69]](_0x35a3x1c[_0x5aac[100]][_0x5aac[45]])[_0x5aac[35]](function(_0x35a3x37){if(!_0x35a3x37){return _0x35a3x1d[_0x5aac[84]](404)};_0x35a3x32= _0x35a3x37;return CustomField[_0x5aac[55]]({where:{ListId:_0x35a3x32[_0x5aac[59]]}})})[_0x5aac[35]](function(_0x35a3x24){if(_0x35a3x24[_0x5aac[38]]){var _0x35a3x25=_[_0x5aac[42]](_0x35a3x24,_0x5aac[41])[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[102],_0x35a3x25,_0x35a3x1c[_0x5aac[100]][_0x5aac[45]]),{type:sequelize[_0x5aac[49]][_0x5aac[48]]})}})[_0x5aac[35]](function(_0x35a3x33){if(_0x35a3x33){_[_0x5aac[72]](_0x35a3x33[0],function(_0x35a3x34,_0x35a3x35,_0x35a3x36){if(_0x35a3x34=== _0x5aac[101]){_0x35a3x36[_0x35a3x35]= null}});_[_0x5aac[37]](_0x35a3x32[_0x5aac[56]],_0x35a3x33[0])}})[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x32)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)})};exports[_0x5aac[103]]= function(_0x35a3x1c,_0x35a3x1d){var _0x35a3x30={};switch(_0x35a3x1c[_0x5aac[104]][_0x5aac[107]]){case _0x5aac[105]:_0x35a3x30= {$or:{phone:_0x35a3x1c[_0x5aac[104]][_0x5aac[98]],mobile:_0x35a3x1c[_0x5aac[104]][_0x5aac[98]]}};break;case _0x5aac[106]:_0x35a3x30= {email:_0x35a3x1c[_0x5aac[104]][_0x5aac[89]]};break;default:_0x35a3x30= {}};return Contact[_0x5aac[62]]({where:_0x35a3x30,include:[{model:List,where:{$or:{id:_[_0x5aac[42]](_[_0x5aac[42]](_0x35a3x1c[_0x5aac[68]].Lists,_0x5aac[56]),_0x5aac[45]),defaultEntry:true}}}]})[_0x5aac[35]](function(_0x35a3x28){return _0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x28)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)})};exports[_0x5aac[108]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){var _0x35a3x32;return Tag[_0x5aac[55]]()[_0x5aac[35]](function(_0x35a3x38){var _0x35a3x39=[];var _0x35a3x3a=_[_0x5aac[42]](_[_0x5aac[42]](_0x35a3x38,_0x5aac[56]),_0x5aac[41]);if(_0x35a3x1c[_0x5aac[104]][_0x5aac[115]]){_0x35a3x1c[_0x5aac[104]][_0x5aac[115]][_0x5aac[72]](function(_0x35a3x27){if(!_[_0x5aac[53]](_0x35a3x3a,_0x35a3x27)){_0x35a3x39[_0x5aac[111]](Tag[_0x5aac[108]]({name:_0x35a3x27}))}})};return _0x35a3x39})[_0x5aac[114]]()[_0x5aac[35]](function(){_0x35a3x1c[_0x5aac[104]][_0x5aac[113]]= _0x35a3x1c[_0x5aac[68]][_0x5aac[45]];return Contact[_0x5aac[108]](_0x35a3x1c[_0x5aac[104]])})[_0x5aac[35]](function(_0x35a3x31){_0x35a3x32= _0x35a3x31;return CustomField[_0x5aac[55]]({where:{ListId:_0x35a3x32[_0x5aac[59]]}})})[_0x5aac[35]](function(_0x35a3x24){if(_0x35a3x24[_0x5aac[38]]){var _0x35a3x25=[];_0x35a3x24[_0x5aac[72]](function(_0x35a3x27){if(_0x35a3x1c[_0x5aac[104]][_0x5aac[109]](_0x35a3x27[_0x5aac[41]])){_0x35a3x25[_0x5aac[111]](util[_0x5aac[47]](_0x5aac[110],_0x35a3x27[_0x5aac[41]],_0x35a3x1c[_0x5aac[104]][_0x35a3x27[_0x5aac[41]]]))}});if(_0x35a3x25[_0x5aac[38]]){_0x35a3x25= _0x35a3x25[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[112],_0x35a3x25,_0x35a3x32[_0x5aac[45]]))}}})[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[34]](201)[_0x5aac[33]](_0x35a3x32)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return _0x35a3x1e(_0x35a3x21)})};exports[_0x5aac[116]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){var _0x35a3x32,_0x35a3x3b;return Contact[_0x5aac[69]](_0x35a3x1c[_0x5aac[100]][_0x5aac[45]])[_0x5aac[35]](function(_0x35a3x31){_0x35a3x32= _0x35a3x31[_0x5aac[56]];_0x35a3x3b= _[_0x5aac[118]](_0x35a3x31[_0x5aac[56]]);delete _0x35a3x3b[_0x5aac[45]];_0x35a3x3b[_0x5aac[113]]= _0x35a3x1c[_0x5aac[68]][_0x5aac[45]];_0x35a3x3b[_0x5aac[59]]= _0x35a3x1c[_0x5aac[104]][_0x5aac[59]];_0x35a3x3b[_0x5aac[115]]= _0x35a3x3b[_0x5aac[115]]?_0x35a3x3b[_0x5aac[115]][_0x5aac[120]](_0x5aac[119]):[];if(_0x35a3x3b[_0x5aac[115]][_0x5aac[38]]> 1){_0x35a3x3b[_0x5aac[115]][_0x5aac[121]]()};return Contact[_0x5aac[108]](_0x35a3x3b)})[_0x5aac[35]](function(_0x35a3x3c){_0x35a3x3b= _0x35a3x3c;if(_0x35a3x32[_0x5aac[59]]=== _0x35a3x1c[_0x5aac[104]][_0x5aac[59]]){return CustomField[_0x5aac[55]]({where:{ListId:_0x35a3x32[_0x5aac[59]]}})}})[_0x5aac[35]](function(_0x35a3x24){if(_0x35a3x24&& _0x35a3x24[_0x5aac[38]]){var _0x35a3x25=_[_0x5aac[42]](_0x35a3x24,_0x5aac[41])[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[102],_0x35a3x25,_0x35a3x32[_0x5aac[45]]),{type:sequelize[_0x5aac[49]][_0x5aac[48]]})}})[_0x5aac[35]](function(_0x35a3x33){if(_0x35a3x33){var _0x35a3x25=[];_[_0x5aac[117]](_0x35a3x33[0],function(_0x35a3x34,_0x35a3x35){_0x35a3x25[_0x5aac[111]](util[_0x5aac[47]](_0x5aac[110],_0x35a3x35,_0x35a3x34))});if(_0x35a3x25[_0x5aac[38]]){_0x35a3x25= _0x35a3x25[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[112],_0x35a3x25,_0x35a3x3b[_0x5aac[45]]))}}})[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[34]](201)[_0x5aac[33]](_0x35a3x3b)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return _0x35a3x1e(_0x35a3x21)})};exports[_0x5aac[122]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){var _0x35a3x3d=[];var _0x35a3x3e={ok:0,ko:0};return Tag[_0x5aac[55]]()[_0x5aac[35]](function(_0x35a3x38){var _0x35a3x39=[],_0x35a3x41=[];var _0x35a3x3a=_[_0x5aac[42]](_[_0x5aac[42]](_0x35a3x38,_0x5aac[56]),_0x5aac[41]);_0x35a3x1c[_0x5aac[104]][_0x5aac[123]][_0x5aac[72]](function(_0x35a3x31){if(_0x35a3x31[_0x5aac[115]]){_0x35a3x41= _[_0x5aac[127]](_0x35a3x41,_0x35a3x31[_0x5aac[115]])}});_0x35a3x41[_0x5aac[72]](function(_0x35a3x27){if(!_[_0x5aac[53]](_0x35a3x3a,_0x35a3x27)){_0x35a3x39[_0x5aac[111]](Tag[_0x5aac[108]]({name:_0x35a3x27}))}});return _0x35a3x39})[_0x5aac[114]]()[_0x5aac[35]](function(){var _0x35a3x40=[];Async[_0x5aac[126]](_0x35a3x1c[_0x5aac[104]][_0x5aac[123]],function(_0x35a3x31){_0x35a3x31[_0x5aac[113]]= _0x35a3x1c[_0x5aac[68]][_0x5aac[45]];_0x35a3x40[_0x5aac[111]](Contact[_0x5aac[108]](_0x35a3x31)[_0x5aac[35]](function(_0x35a3x31){_0x35a3x3d[_0x5aac[111]](_0x35a3x31);_0x35a3x3e[_0x5aac[125]]++})[_0x5aac[32]](function(_0x35a3x21){_0x35a3x3e[_0x5aac[124]]++}))});return _0x35a3x40})[_0x5aac[114]]()[_0x5aac[35]](function(){return CustomField[_0x5aac[55]]({where:{ListId:{$in:_[_0x5aac[42]](_0x35a3x1c[_0x5aac[104]][_0x5aac[123]],_0x5aac[59])}}})})[_0x5aac[35]](function(_0x35a3x24){var _0x35a3x3f=[];if(_0x35a3x24[_0x5aac[38]]){var _0x35a3x25=[];_0x35a3x3d[_0x5aac[72]](function(_0x35a3x31){_0x35a3x25= [];_0x35a3x24[_0x5aac[72]](function(_0x35a3x27){if(_0x35a3x31[_0x5aac[109]](_0x35a3x27[_0x5aac[41]])){_0x35a3x25[_0x5aac[111]](util[_0x5aac[47]](_0x5aac[110],_0x35a3x27[_0x5aac[41]],_0x35a3x1c[_0x5aac[104]][_0x35a3x27[_0x5aac[41]]]))}});if(_0x35a3x25[_0x5aac[38]]){_0x35a3x25= _0x35a3x25[_0x5aac[40]](_0x5aac[39]);_0x35a3x3f[_0x5aac[111]](sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[112],_0x35a3x25,_0x35a3x31[_0x5aac[45]])))}})};return _0x35a3x3f})[_0x5aac[114]]()[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[34]](201)[_0x5aac[33]](_0x35a3x3e)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return _0x35a3x1e(_0x35a3x21)})};exports[_0x5aac[128]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){return Promise[_0x5aac[114]]([])[_0x5aac[35]](updateContact(_0x35a3x1c,_0x35a3x1d))[_0x5aac[35]](function(_0x35a3x31){return _0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x31)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)})};exports[_0x5aac[37]]= function(_0x35a3x1c,_0x35a3x1d,_0x35a3x1e){var _0x35a3x32;return Promise[_0x5aac[114]]([])[_0x5aac[35]](updateContact(_0x35a3x1c,_0x35a3x1d))[_0x5aac[35]](function(_0x35a3x31){_0x35a3x32= _0x35a3x31;if(_0x35a3x1c[_0x5aac[104]][_0x5aac[129]]){return Contact[_0x5aac[130]]({where:{id:_0x35a3x1c[_0x5aac[104]][_0x5aac[129]]},individualHooks:true})}})[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[34]](200)[_0x5aac[33]](_0x35a3x32)})[_0x5aac[32]](function(_0x35a3x21){console[_0x5aac[31]](_0x35a3x21);return handleError(_0x35a3x1d,_0x35a3x21)})};function updateContact(_0x35a3x1c,_0x35a3x1d){return function(){var _0x35a3x32;return Tag[_0x5aac[55]]()[_0x5aac[35]](function(_0x35a3x38){var _0x35a3x39=[];var _0x35a3x3a=_[_0x5aac[42]](_[_0x5aac[42]](_0x35a3x38,_0x5aac[56]),_0x5aac[41]);if(_0x35a3x1c[_0x5aac[104]][_0x5aac[115]]){_0x35a3x1c[_0x5aac[104]][_0x5aac[115]][_0x5aac[72]](function(_0x35a3x27){if(!_[_0x5aac[53]](_0x35a3x3a,_0x35a3x27)){_0x35a3x39[_0x5aac[111]](Tag[_0x5aac[108]]({name:_0x35a3x27}))}})};return _0x35a3x39})[_0x5aac[35]](function(){return Contact[_0x5aac[69]](_0x35a3x1c[_0x5aac[100]][_0x5aac[45]])})[_0x5aac[35]](function(_0x35a3x31){if(!_0x35a3x31){return _0x35a3x1d[_0x5aac[84]](404)};delete _0x35a3x1c[_0x5aac[104]][_0x5aac[45]];return _0x35a3x31[_0x5aac[131]](_0x35a3x1c[_0x5aac[104]])})[_0x5aac[35]](function(_0x35a3x31){_0x35a3x32= _0x35a3x31;return CustomField[_0x5aac[55]]({where:{ListId:_0x35a3x32[_0x5aac[59]]}})})[_0x5aac[35]](function(_0x35a3x24){if(_0x35a3x24[_0x5aac[38]]){var _0x35a3x25=[];_0x35a3x24[_0x5aac[72]](function(_0x35a3x27){if(_0x35a3x1c[_0x5aac[104]][_0x5aac[109]](_0x35a3x27[_0x5aac[41]])){_0x35a3x25[_0x5aac[111]](util[_0x5aac[47]](_0x5aac[110],_0x35a3x27[_0x5aac[41]],_0x35a3x1c[_0x5aac[104]][_0x35a3x27[_0x5aac[41]]]))}});if(_0x35a3x25[_0x5aac[38]]){_0x35a3x25= _0x35a3x25[_0x5aac[40]](_0x5aac[39]);return sequelize[_0x5aac[50]](util[_0x5aac[47]](_0x5aac[112],_0x35a3x25,_0x35a3x32[_0x5aac[45]]))}}})[_0x5aac[35]](function(){return _0x35a3x32})}}exports[_0x5aac[130]]= function(_0x35a3x1c,_0x35a3x1d){return Contact[_0x5aac[69]](_0x35a3x1c[_0x5aac[100]][_0x5aac[45]])[_0x5aac[35]](function(_0x35a3x37){if(!_0x35a3x37){return _0x35a3x1d[_0x5aac[84]](404)};return _0x35a3x37[_0x5aac[130]]()})[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[84]](204)})[_0x5aac[32]](function(_0x35a3x21){return handleError(_0x35a3x1d,_0x35a3x21)})};exports[_0x5aac[132]]= function(_0x35a3x1c,_0x35a3x1d){return Contact[_0x5aac[130]]({where:{id:_0x35a3x1c[_0x5aac[50]][_0x5aac[133]]},individualHooks:true})[_0x5aac[35]](function(){return _0x35a3x1d[_0x5aac[84]](204)})[_0x5aac[32]](function(_0x35a3x21){return handleError(_0x35a3x1d,_0x35a3x21)})};function handleError(_0x35a3x1d,_0x35a3x21){return _0x35a3x1d[_0x5aac[34]](500)[_0x5aac[33]](_0x35a3x21)}
\ No newline at end of file