2400d899a3b33f874e3122e075c08c0d2091ce0a
[motion.git] / server / config / util / index.js
1 var _0xea4d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x66\x73\x2D\x65\x78\x74\x72\x61","\x6D\x6F\x74\x69\x6F\x6E","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x41\x63\x74\x69\x6F\x6E","\x2C","\x73\x70\x6C\x69\x74","\x2A","\x2D","\x74\x5F\x66\x72\x6F\x6D","\x48\x48\x3A\x6D\x6D","\x74\x5F\x74\x6F","\x77\x64\x5F\x66\x72\x6F\x6D","\x77\x64\x5F\x74\x6F","\x6D\x64\x5F\x66\x72\x6F\x6D","\x6D\x64\x5F\x74\x6F","\x6D\x5F\x66\x72\x6F\x6D","\x6D\x5F\x74\x6F","\x66\x6F\x72\x45\x61\x63\x68","\x66\x6F\x72\x6D\x61\x74","\x45","\x44","\x4D","\x70\x75\x73\x68","\x69\x73\x41\x66\x74\x65\x72","\x5B\x5D","\x69\x73\x42\x65\x74\x77\x65\x65\x6E","\x66\x69\x6C\x74\x65\x72","\x69\x6E\x64\x65\x78\x4F\x66","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D","\x69\x73\x56\x61\x6C\x69\x64","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x64\x61\x79\x53\x74\x61\x72\x74","\x65\x6E\x64\x4F\x66","\x64\x61\x79\x45\x6E\x64","\x5F\x75\x69\x46\x72\x6F\x6D","\x69\x6E\x63\x6C\x75\x64\x65\x73","","\x72\x65\x70\x6C\x61\x63\x65","\x5F\x75\x69\x54\x6F","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x6F\x72\x64\x65\x72","\x74\x79\x70\x65","\x70\x61\x72\x65\x6E\x74","\x25","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x50\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x64\x65\x66\x61\x75\x6C\x74","\x73\x63\x6F\x70\x65","\x69\x64","\x67\x65\x74\x50\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x50\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x75\x6E\x69\x6F\x6E","\x73\x75\x62\x73\x74\x72","\x2F","\x6C\x65\x6E\x67\x74\x68","\x5E\x5C\x2F\x7C\x5C\x2F\x24","\x67","\x63\x61\x6C\x6C","\x73\x6C\x69\x63\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x6A\x6F\x69\x6E","\x47\x45\x54","\x50\x4F\x53\x54","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x4D\x65\x74\x68\x6F\x64","\x65\x72\x72\x6F\x72","\x41\x63\x74\x69\x6F\x6E\x20\x46\x61\x69\x6C\x65\x64","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x41\x63\x74\x69\x6F\x6E\x20\x53\x75\x63\x63\x65\x73\x73\x66\x75\x6C","\x64\x65\x62\x75\x67","\x61\x63\x74\x69\x6F\x6E","\x44\x45\x46\x41\x55\x4C\x54\x20\x50\x41\x55\x53\x45","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x41\x63\x74\x69\x6F\x6E","\x73\x74\x61\x74\x53\x79\x6E\x63","\x73\x69\x7A\x65","\x65\x78\x70\x6F\x72\x74\x73","\x2E\x2F\x65\x72\x72\x6F\x72"];_0xea4d[0];var _=require(_0xea4d[1]);var moment=require(_0xea4d[2]);var request=require(_0xea4d[3]);var fs=require(_0xea4d[4]);var logger=require(_0xea4d[6])(_0xea4d[5]);var User=require(_0xea4d[8])[_0xea4d[7]];var VoiceQueue=require(_0xea4d[8])[_0xea4d[9]];var ChatQueue=require(_0xea4d[8])[_0xea4d[10]];var MailQueue=require(_0xea4d[8])[_0xea4d[11]];var FaxQueue=require(_0xea4d[8])[_0xea4d[12]];var SmsQueue=require(_0xea4d[8])[_0xea4d[13]];var OpenchannelQueue=require(_0xea4d[8])[_0xea4d[14]];var Action=require(_0xea4d[8])[_0xea4d[15]];var weekDaysCollection={mon:1,tue:2,wed:3,thu:4,fri:5,sat:6,sun:7};var monthsCollection={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};function splitInterval(_0x3f97x11){var _0x3f97x12={};var _0x3f97x13=_0x3f97x11[_0xea4d[17]](_0xea4d[16]);var _0x3f97x14;_0x3f97x13[_0xea4d[29]](function(_0x3f97x15,_0x3f97x16){switch(_0x3f97x16){case 0:if(_0x3f97x15!== _0xea4d[18]){_0x3f97x14= _0x3f97x15[_0xea4d[17]](_0xea4d[19]);_0x3f97x12[_0xea4d[20]]= moment(_0x3f97x14[0],_0xea4d[21]);_0x3f97x12[_0xea4d[22]]= moment(_0x3f97x14[1],_0xea4d[21])}else {_0x3f97x12[_0xea4d[20]]= null;_0x3f97x12[_0xea4d[22]]= null};break;case 1:if(_0x3f97x15!== _0xea4d[18]){_0x3f97x14= _0x3f97x15[_0xea4d[17]](_0xea4d[19]);_0x3f97x12[_0xea4d[23]]= Number(weekDaysCollection[_0x3f97x14[0]]);_0x3f97x12[_0xea4d[24]]= _0x3f97x14[1]?Number(weekDaysCollection[_0x3f97x14[1]]):null}else {_0x3f97x12[_0xea4d[23]]= null;_0x3f97x12[_0xea4d[24]]= null};break;case 2:if(_0x3f97x15!== _0xea4d[18]){_0x3f97x14= _0x3f97x15[_0xea4d[17]](_0xea4d[19]);_0x3f97x12[_0xea4d[25]]= Number(_0x3f97x14[0]);_0x3f97x12[_0xea4d[26]]= _0x3f97x14[1]?Number(_0x3f97x14[1]):null}else {_0x3f97x12[_0xea4d[25]]= null;_0x3f97x12[_0xea4d[26]]= null};break;case 3:if(_0x3f97x15!== _0xea4d[18]){_0x3f97x14= _0x3f97x15[_0xea4d[17]](_0xea4d[19]);_0x3f97x12[_0xea4d[27]]= Number(monthsCollection[_0x3f97x14[0]]);_0x3f97x12[_0xea4d[28]]= _0x3f97x14[1]?Number(monthsCollection[_0x3f97x14[1]]):null}else {_0x3f97x12[_0xea4d[27]]= null;_0x3f97x12[_0xea4d[28]]= null};break;default:}});return _0x3f97x12}function isIntervalValid(_0x3f97x11){var _0x3f97x18=moment()[_0xea4d[30]](_0xea4d[21]);var _0x3f97x19=moment()[_0xea4d[30]](_0xea4d[31]);var _0x3f97x1a=moment()[_0xea4d[30]](_0xea4d[32]);var _0x3f97x1b=moment()[_0xea4d[30]](_0xea4d[33]);var _0x3f97x1c,_0x3f97x1d,_0x3f97x1e,_0x3f97x1f;var _0x3f97x20=[1,2,3,4,5,6,7,8,9,10,11,12];var _0x3f97x21=[1,2,3,4,5,6,7];var _0x3f97x22=[];for(var _0x3f97x23=1;_0x3f97x23<= 31;_0x3f97x23++){_0x3f97x22[_0xea4d[34]](_0x3f97x23)};if(_0x3f97x11[_0xea4d[20]]&& _0x3f97x11[_0xea4d[22]]){if(_0x3f97x11[_0xea4d[22]][_0xea4d[35]](_0x3f97x11[_0xea4d[20]])){_0x3f97x1c= moment(_0x3f97x18,_0xea4d[21])[_0xea4d[37]](_0x3f97x11[_0xea4d[20]],_0x3f97x11[_0xea4d[22]],null,_0xea4d[36])}else {_0x3f97x1c=  !moment(_0x3f97x18,_0xea4d[21])[_0xea4d[37]](_0x3f97x11[_0xea4d[22]],_0x3f97x11[_0xea4d[20]],null,_0xea4d[36])}}else {_0x3f97x1c= true};if(_0x3f97x11[_0xea4d[23]]){if(_0x3f97x11[_0xea4d[24]]&& _0x3f97x11[_0xea4d[24]]!== _0x3f97x11[_0xea4d[23]]){var _0x3f97x24=_[_0xea4d[38]](_0x3f97x21,function(_0x3f97x25){if(_0x3f97x11[_0xea4d[23]]< _0x3f97x11[_0xea4d[24]]){return (_0x3f97x25>= _0x3f97x11[_0xea4d[23]])&& (_0x3f97x25<= _0x3f97x11[_0xea4d[24]])}else {return (1<= _0x3f97x25&& _0x3f97x25<= _0x3f97x11[_0xea4d[24]])|| (_0x3f97x11[_0xea4d[23]]<= _0x3f97x25&& _0x3f97x25<= 7)}});_0x3f97x1d= (_0x3f97x24[_0xea4d[39]](parseInt(_0x3f97x19))!==  -1)?true:false}else {_0x3f97x1d= (parseInt(_0x3f97x19)=== _0x3f97x11[_0xea4d[23]])?true:false}}else {_0x3f97x1d= true};if(_0x3f97x11[_0xea4d[25]]){if(_0x3f97x11[_0xea4d[26]]&& _0x3f97x11[_0xea4d[26]]!== _0x3f97x11[_0xea4d[25]]){var _0x3f97x26=_[_0xea4d[38]](_0x3f97x22,function(_0x3f97x25){if(_0x3f97x11[_0xea4d[25]]< _0x3f97x11[_0xea4d[26]]){return (_0x3f97x25>= _0x3f97x11[_0xea4d[25]])&& (_0x3f97x25<= _0x3f97x11[_0xea4d[26]])}else {return (1<= _0x3f97x25&& _0x3f97x25<= _0x3f97x11[_0xea4d[26]])|| (_0x3f97x11[_0xea4d[25]]<= _0x3f97x25&& _0x3f97x25<= 7)}});_0x3f97x1e= (_0x3f97x26[_0xea4d[39]](parseInt(_0x3f97x1a))!==  -1)?true:false}else {_0x3f97x1e= (parseInt(_0x3f97x1a)=== _0x3f97x11[_0xea4d[25]])?true:false}}else {_0x3f97x1e= true};if(_0x3f97x11[_0xea4d[27]]){if(_0x3f97x11[_0xea4d[28]]&& _0x3f97x11[_0xea4d[28]]!== _0x3f97x11[_0xea4d[27]]){var _0x3f97x27=_[_0xea4d[38]](_0x3f97x20,function(_0x3f97x25){if(_0x3f97x11[_0xea4d[27]]< _0x3f97x11[_0xea4d[28]]){return (_0x3f97x25>= _0x3f97x11[_0xea4d[27]])&& (_0x3f97x25<= _0x3f97x11[_0xea4d[28]])}else {return (1<= _0x3f97x25&& _0x3f97x25<= _0x3f97x11[_0xea4d[28]])|| (_0x3f97x11[_0xea4d[27]]<= _0x3f97x25&& _0x3f97x25<= 7)}});_0x3f97x1f= (_0x3f97x27[_0xea4d[39]](parseInt(_0x3f97x1b))!==  -1)?true:false}else {_0x3f97x1f= (parseInt(_0x3f97x1b)=== _0x3f97x11[_0xea4d[27]])?true:false}}else {_0x3f97x1f= true};return _0x3f97x1c&& _0x3f97x1d&& _0x3f97x1e&& _0x3f97x1f}var getDate=function(_0x3f97x29,_0x3f97x2a){var _0x3f97x2b=_0xea4d[40];if(moment(_0x3f97x29,_0x3f97x2b,true)[_0xea4d[41]]()){return moment(_0x3f97x29)}else {switch(_0x3f97x2a){case _0xea4d[44]:return moment(_0x3f97x29)[_0xea4d[43]](_0xea4d[42]);case _0xea4d[46]:return moment(_0x3f97x29)[_0xea4d[45]](_0xea4d[42]);default:return moment(_0x3f97x29)}}};var getQuery=function(_0x3f97x2d,_0x3f97x2e,_0x3f97x2f){var _0x3f97x30={where:{}};if(_0x3f97x2d){var _0x3f97x31,_0x3f97x32={};for(var _0x3f97x33 in _0x3f97x2d){if(_[_0xea4d[48]](_0x3f97x33,_0xea4d[47])){_0x3f97x31= _0x3f97x33[_0xea4d[50]](_0xea4d[47],_0xea4d[49]);if(_0x3f97x2d[_0x3f97x31+ _0xea4d[51]]){_0x3f97x30[_0xea4d[53]][_0xea4d[52]]= _0x3f97x30[_0xea4d[53]][_0xea4d[52]]|| [];_0x3f97x32= {};_0x3f97x32[_0x3f97x31]= {$gte:getDate(_0x3f97x2d[_0x3f97x33],_0xea4d[44])};_0x3f97x30[_0xea4d[53]][_0xea4d[52]][_0xea4d[34]](_0x3f97x32);_0x3f97x32= {};_0x3f97x32[_0x3f97x31]= {$lte:getDate(_0x3f97x2d[_0x3f97x31+ _0xea4d[51]],_0xea4d[46])};_0x3f97x30[_0xea4d[53]][_0xea4d[52]][_0xea4d[34]](_0x3f97x32);delete _0x3f97x2d[_0x3f97x31+ _0xea4d[51]]}else {_0x3f97x30[_0xea4d[53]][_0x3f97x33[_0xea4d[50]](_0xea4d[47],_0xea4d[49])]= {$gte:getDate(_0x3f97x2d[_0x3f97x33],_0xea4d[44])}};delete _0x3f97x2d[_0x3f97x33]}else {if(_[_0xea4d[48]](_0x3f97x33,_0xea4d[51])){_0x3f97x31= _0x3f97x33[_0xea4d[50]](_0xea4d[51],_0xea4d[49]);if(_0x3f97x2d[_0x3f97x31+ _0xea4d[47]]){_0x3f97x30[_0xea4d[53]][_0xea4d[52]]= _0x3f97x30[_0xea4d[53]][_0xea4d[52]]|| [];_0x3f97x32= {};_0x3f97x32[_0x3f97x31]= {$lte:getDate(_0x3f97x2d[_0x3f97x33],_0xea4d[46])};_0x3f97x30[_0xea4d[53]][_0xea4d[52]][_0xea4d[34]](_0x3f97x32);_0x3f97x32[_0x3f97x31]= {$gte:getDate(_0x3f97x2d[_0x3f97x31+ _0xea4d[47]],_0xea4d[44])};_0x3f97x30[_0xea4d[53]][_0xea4d[52]][_0xea4d[34]](_0x3f97x32);delete _0x3f97x2d[_0x3f97x31+ _0xea4d[47]]}else {_0x3f97x30[_0xea4d[53]][_0x3f97x33[_0xea4d[50]](_0xea4d[51],_0xea4d[49])]= {$lte:getDate(_0x3f97x2d[_0x3f97x33],_0xea4d[46])}};delete _0x3f97x2d[_0x3f97x33]}}};_[_0xea4d[29]](_0x3f97x2d,function(_0x3f97x34,_0x3f97x33){switch(_0x3f97x33){case _0xea4d[54]:;case _0xea4d[55]:_0x3f97x30[_0x3f97x33]= Number(_0x3f97x34);break;case _0xea4d[56]:_0x3f97x30[_0x3f97x33]= _0x3f97x34;break;case _0xea4d[57]:;case _0xea4d[58]:_0x3f97x30[_0xea4d[53]][_0x3f97x33]= _0x3f97x34;break;default:_0x3f97x30[_0xea4d[53]][_0x3f97x33]= {$like:_0xea4d[59]+ _0x3f97x34+ _0xea4d[59]}}})};if(_0x3f97x2e){_[_0xea4d[60]](_0x3f97x30[_0xea4d[53]],_0x3f97x2e)};if(_0x3f97x2f){_[_0xea4d[60]](_0x3f97x30,_0x3f97x2f)};return _0x3f97x30};var getVoiceQueuesIdByUser=function(_0x3f97x2d,_0x3f97x2f){return function(_0x3f97x36){var _0x3f97x37=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x39=_0x3f97x2f|| {};return _0x3f97x38[_0xea4d[65]]({attributes:[_0xea4d[63]]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x37= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[63])})[_0xea4d[62]](function(){return VoiceQueue[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x2d,{name:{$in:_0x3f97x37}}),_0x3f97x39))})}};var getChatQueuesIdByUser=function(_0x3f97x2d,_0x3f97x2f){return function(_0x3f97x36){var _0x3f97x37=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x39=_[_0xea4d[60]](_0x3f97x2f|| {},{distinct:true});return _0x3f97x38[_0xea4d[69]]({attributes:[_0xea4d[68]]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x37= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68])})[_0xea4d[62]](function(){return ChatQueue[_0xea4d[67]](_0xea4d[66])[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x30,{id:{$in:_0x3f97x37}}),_0x3f97x39))})}};var getMailQueuesIdByUser=function(_0x3f97x2d,_0x3f97x2f){return function(_0x3f97x36){var _0x3f97x37=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x39=_[_0xea4d[60]](_0x3f97x2f|| {},{distinct:true});return _0x3f97x38[_0xea4d[70]]({attributes:[_0xea4d[68]]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x37= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68])})[_0xea4d[62]](function(){return MailQueue[_0xea4d[67]](_0xea4d[66])[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x30,{id:{$in:_0x3f97x37}}),_0x3f97x39))})}};var getSmsQueuesIdByUser=function(_0x3f97x2d,_0x3f97x2f){return function(_0x3f97x36){var _0x3f97x37=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x39=_[_0xea4d[60]](_0x3f97x2f|| {},{distinct:true});return _0x3f97x38[_0xea4d[71]]({attributes:[_0xea4d[68]]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x37= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68])})[_0xea4d[62]](function(){return SmsQueue[_0xea4d[67]](_0xea4d[66])[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x30,{id:{$in:_0x3f97x37}}),_0x3f97x39))})}};var getFaxQueuesIdByUser=function(_0x3f97x2d,_0x3f97x2f){return function(_0x3f97x36){var _0x3f97x37=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x39=_[_0xea4d[60]](_0x3f97x2f|| {},{distinct:true});return _0x3f97x38[_0xea4d[72]]({attributes:[_0xea4d[68]]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x37= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68])})[_0xea4d[62]](function(){return FaxQueue[_0xea4d[67]](_0xea4d[66])[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x30,{id:{$in:_0x3f97x37}}),_0x3f97x39))})}};var getOpenchannelQueuesIdByUser=function(_0x3f97x2d,_0x3f97x2f){return function(_0x3f97x36){var _0x3f97x37=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x39=_[_0xea4d[60]](_0x3f97x2f|| {},{distinct:true});return _0x3f97x38[_0xea4d[73]]({attributes:[_0xea4d[68]]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x37= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68])})[_0xea4d[62]](function(){return OpenchannelQueue[_0xea4d[67]](_0xea4d[66])[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x30,{id:{$in:_0x3f97x37}}),_0x3f97x39))})}};var getAgentsIdByUser=function(_0x3f97x2d){return function(_0x3f97x36){var _0x3f97x41=[];var _0x3f97x38=_0x3f97x36;var _0x3f97x30=_0x3f97x2d|| {};var _0x3f97x42=[],_0x3f97x43=[],_0x3f97x44=[],_0x3f97x45=[],_0x3f97x46=[],_0x3f97x47=[];return _0x3f97x38[_0xea4d[65]]({attributes:[_0xea4d[63]],include:[{raw:true,model:User,attributes:[_0xea4d[68]]}]})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x42= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[63]);_0x3f97x3a[_0xea4d[29]](function(_0x3f97x48){_0x3f97x41= _[_0xea4d[79]](_0x3f97x41,_[_0xea4d[64]](_0x3f97x48.Users,_0xea4d[68]))})})[_0xea4d[62]](function(){return _0x3f97x38[_0xea4d[69]]({attributes:[_0xea4d[68]],include:[{raw:true,model:User,attributes:[_0xea4d[68]]}]})})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x43= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68]);_0x3f97x3a[_0xea4d[29]](function(_0x3f97x48){_0x3f97x41= _[_0xea4d[79]](_0x3f97x41,_[_0xea4d[64]](_0x3f97x48.Users,_0xea4d[68]))})})[_0xea4d[62]](function(){return _0x3f97x38[_0xea4d[70]]({attributes:[_0xea4d[68]],include:[{raw:true,model:User,attributes:[_0xea4d[68]]}]})})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x44= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68]);_0x3f97x3a[_0xea4d[29]](function(_0x3f97x48){_0x3f97x41= _[_0xea4d[79]](_0x3f97x41,_[_0xea4d[64]](_0x3f97x48.Users,_0xea4d[68]))})})[_0xea4d[62]](function(){return _0x3f97x38[_0xea4d[72]]({attributes:[_0xea4d[68]],include:[{raw:true,model:User,attributes:[_0xea4d[68]]}]})})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x45= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68]);_0x3f97x3a[_0xea4d[29]](function(_0x3f97x48){_0x3f97x41= _[_0xea4d[79]](_0x3f97x41,_[_0xea4d[64]](_0x3f97x48.Users,_0xea4d[68]))})})[_0xea4d[62]](function(){return _0x3f97x38[_0xea4d[71]]({attributes:[_0xea4d[68]],include:[{raw:true,model:User,attributes:[_0xea4d[68]]}]})})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x47= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68]);_0x3f97x3a[_0xea4d[29]](function(_0x3f97x48){_0x3f97x41= _[_0xea4d[79]](_0x3f97x41,_[_0xea4d[64]](_0x3f97x48.Users,_0xea4d[68]))})})[_0xea4d[62]](function(){return _0x3f97x38[_0xea4d[73]]({attributes:[_0xea4d[68]],include:[{raw:true,model:User,attributes:[_0xea4d[68]]}]})})[_0xea4d[62]](function(_0x3f97x3a){_0x3f97x46= _[_0xea4d[64]](_0x3f97x3a,_0xea4d[68]);_0x3f97x3a[_0xea4d[29]](function(_0x3f97x48){_0x3f97x41= _[_0xea4d[79]](_0x3f97x41,_[_0xea4d[64]](_0x3f97x48.Users,_0xea4d[68]))})})[_0xea4d[62]](function(){return User[_0xea4d[67]](_0xea4d[74],{method:[_0xea4d[75],_0x3f97x30]},{method:[_0xea4d[76],_0x3f97x30]},{method:[_0xea4d[77],_0x3f97x30]},{method:[_0xea4d[78],_0x3f97x30]})[_0xea4d[61]](_[_0xea4d[60]](getQuery(_0x3f97x30,{id:{$in:_0x3f97x41}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x3f97x42}},required:false},{model:ChatQueue,where:{id:{$in:_0x3f97x43}},required:false},{model:MailQueue,where:{id:{$in:_0x3f97x44}},required:false},{model:FaxQueue,where:{id:{$in:_0x3f97x45}},required:false},{model:SmsQueue,where:{id:{$in:_0x3f97x47}},required:false},{model:OpenchannelQueue,where:{id:{$in:_0x3f97x46}},required:false}]}))})}};var stripTrailingSlash=function(_0x3f97x4a){if(_0x3f97x4a[_0xea4d[80]](-1) === _0xea4d[81]){return _0x3f97x4a[_0xea4d[80]](0,_0x3f97x4a[_0xea4d[82]]- 1)};return _0x3f97x4a};var join_url=function(){var _0x3f97x4c= new RegExp(_0xea4d[83],_0xea4d[84]);var _0x3f97x4d=Array[_0xea4d[87]][_0xea4d[86]][_0xea4d[85]](arguments);return _0x3f97x4d[_0xea4d[64]](function(_0x3f97x15){return _0x3f97x15[_0xea4d[50]](_0x3f97x4c,_0xea4d[49])})[_0xea4d[88]](_0xea4d[81])};var sendRequest=function(_0x3f97x4f,_0x3f97x50,_0x3f97x51){if(_0x3f97x50== _0xea4d[89]){return request({method:_0x3f97x50,uri:_0x3f97x51,qs:_0x3f97x4f,json:true})}else {if(_0x3f97x50== _0xea4d[90]){return request({method:_0x3f97x50,uri:_0x3f97x51,body:_0x3f97x4f,json:true})}else {logger[_0xea4d[92]](_0xea4d[91])}}};var execAction=function(_0x3f97x53,_0x3f97x4f){switch(_0x3f97x53[_0xea4d[98]]){case _0xea4d[102]:Action[_0xea4d[101]]({name:_0x3f97x53[_0xea4d[98]],data4:_0x3f97x53[_0xea4d[57]]|| _0xea4d[99]},{body:{name:_0x3f97x53[_0xea4d[98]],agent:_0x3f97x4f[_0xea4d[100]],type:_0x3f97x53[_0xea4d[57]]|| _0xea4d[99]}})[_0xea4d[62]](function(){logger[_0xea4d[97]](_0xea4d[96])})[_0xea4d[95]](function(_0x3f97x54){logger[_0xea4d[92]](_0xea4d[93],_0x3f97x54[_0xea4d[94]])});break;default:logger[_0xea4d[92]](_0xea4d[103])}};var getFilesizeInBytes=function(_0x3f97x56){try{var _0x3f97x57=fs[_0xea4d[104]](_0x3f97x56);var _0x3f97x58=_0x3f97x57[_0xea4d[105]];return _0x3f97x58}catch(err){return 0}};module[_0xea4d[106]]= {getQuery:getQuery,getVoiceQueuesIdByUser:getVoiceQueuesIdByUser,getChatQueuesIdByUser:getChatQueuesIdByUser,getMailQueuesIdByUser:getMailQueuesIdByUser,getFaxQueuesIdByUser:getFaxQueuesIdByUser,getSmsQueuesIdByUser:getSmsQueuesIdByUser,getOpenchannelQueuesIdByUser:getOpenchannelQueuesIdByUser,getAgentsIdByUser:getAgentsIdByUser,stripTrailingSlash:stripTrailingSlash,join_url:join_url,splitInterval:splitInterval,isValidInterval:isIntervalValid,sendRequest:sendRequest,execAction:execAction,errorManager:require(_0xea4d[107]),getFileSize:getFilesizeInBytes}