Built motion from commit a3effcce5.|1.0.34
[motion.git] / server / api / report_queue / report_queue.controller.js
1 var _0xfc02=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x62\x6C\x75\x65\x62\x69\x72\x64","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\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","\x75\x70\x64\x61\x74\x65","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x62\x6F\x64\x79","\x6D\x65\x72\x67\x65","\x73\x61\x76\x65","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x64\x65\x73\x63\x72\x69\x62\x65","\x64\x61\x73\x68\x62\x6F\x61\x72\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x6C\x65\x6E\x67\x74\x68","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x73\x75\x6D\x42\x79","\x72\x6F\x75\x6E\x64","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x75\x6E\x69\x78","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x62\x61\x6E\x64\x6F\x6E","\x63\x6F\x75\x6E\x74","\x61\x63\x74\x69\x76\x65","\x77\x61\x69\x74\x69\x6E\x67","\x75\x73\x65\x72","\x61\x6C\x6C","\x72\x6F\x77\x73","\x6E\x61\x6D\x65","\x6D\x61\x70","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x61\x67\x65\x6E\x74","\x72\x6F\x6C\x65","\x71\x75\x65\x75\x65\x50\x61\x72\x61\x6D\x65\x74\x65\x72\x73","\x6C\x69\x6D\x69\x74","\x6F\x66\x66\x73\x65\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x75\x69\x54\x6F","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x5F\x75\x69\x54\x6F","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x5F\x75\x69\x46\x72\x6F\x6D","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x5F\x75\x69\x54\x6F","\x73\x70\x72\x65\x61\x64","\x66\x69\x6E\x64","\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73","\x5F\x61\x6E\x73\x77\x65\x72\x65\x64\x46\x72\x6F\x6D","\x61\x6E\x73\x77\x65\x72\x65\x64","\x5F\x61\x6E\x73\x77\x65\x72\x65\x64\x54\x6F","\x5F\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x46\x72\x6F\x6D","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x5F\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x54\x6F","\x5F\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x46\x72\x6F\x6D","\x5F\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64\x54\x6F","\x5F\x6E\x61\x6D\x65","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x72\x65\x64\x75\x63\x65","\x66\x69\x6C\x74\x65\x72","\x5F\x6C\x69\x6D\x69\x74","\x76\x61\x6C\x75\x65","\x74\x61\x6B\x65","\x73\x6C\x69\x63\x65","\x30\x30\x3A\x30\x30\x3A\x30\x30","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x74\x6F\x74\x61\x6C\x63\x61\x6C\x6C\x73\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x27\x2C\x27","\x6A\x6F\x69\x6E","\x27\x29\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x74\x61\x6C\x6B\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x53\x45\x4C\x45\x43\x54\x20\x71\x75\x65\x75\x65\x20\x41\x53\x20\x27\x6E\x61\x6D\x65\x27\x2C\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x68\x6F\x6C\x64\x74\x69\x6D\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x71\x75\x65\x75\x65","\x43\x4F\x55\x4E\x54","\x63\x6F\x6C","\x66\x6E","\x77\x61\x69\x74\x69\x6E\x67\x43\x61\x6C\x6C\x73","\x71\x75\x65\x75\x65\x46\x69\x6C\x74\x65\x72","\x73\x63\x6F\x70\x65","\x61\x76\x67\x61\x6E\x73\x77\x65\x72\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x68\x6F\x6C\x64\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x27\x29","\x61\x76\x67\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x74\x61\x6C\x6B\x74\x69\x6D\x65\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x20\x57\x48\x45\x52\x45\x20\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x3D\x20\x31\x20\x41\x4E\x44\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x6E\x73\x77\x65\x72\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x62\x61\x6E\x64\x6F\x6E\x72\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x20\x2F\x20\x28\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x29\x20\x2B\x20\x53\x55\x4D\x28\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E\x29\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x74\x6F\x74\x61\x6C\x6F\x66\x66\x65\x72\x65\x64","\x53\x45\x4C\x45\x43\x54\x20\x43\x4F\x55\x4E\x54\x28\x64\x69\x73\x74\x69\x6E\x63\x74\x20\x75\x6E\x69\x71\x75\x65\x69\x64\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x20\x57\x48\x45\x52\x45\x20\x71\x75\x65\x75\x65\x20\x49\x4E\x20\x28\x27","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0xfc02[0];var _=require(_0xfc02[1]);var moment=require(_0xfc02[2]);var sequelize=require(_0xfc02[4])[_0xfc02[3]];var Agent=require(_0xfc02[4])[_0xfc02[5]];var ReportQueue=require(_0xfc02[4])[_0xfc02[6]];var VoiceQueue=require(_0xfc02[4])[_0xfc02[7]];var ReportQueueHistory=require(_0xfc02[4])[_0xfc02[9]][_0xfc02[8]];var Util=require(_0xfc02[10]);var Promise=require(_0xfc02[11]);var logger=require(_0xfc02[13])(_0xfc02[12]);exports[_0xfc02[14]]= function(_0x1992xb,_0x1992xc,_0x1992xd){return ReportQueue[_0xfc02[21]](Util[_0xfc02[20]](_0x1992xb[_0xfc02[19]]))[_0xfc02[18]](function(_0x1992xf){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]](_0x1992xf)})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[22]]= function(_0x1992xb,_0x1992xc){return ReportQueue[_0xfc02[29]](_0x1992xb[_0xfc02[28]][_0xfc02[27]])[_0xfc02[18]](function(_0x1992x10){if(!_0x1992x10){return _0x1992xc[_0xfc02[23]](404)};var _0x1992x11=_[_0xfc02[25]](_0x1992x10,_0x1992xb[_0xfc02[24]]);return _0x1992x11[_0xfc02[26]]()})[_0xfc02[18]](function(_0x1992x10){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]](_0x1992x10)})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[30]]= function(_0x1992xb,_0x1992xc){return ReportQueueHistory[_0xfc02[30]]()[_0xfc02[18]](function(_0x1992x12){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]](_0x1992x12)})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[31]]= function(_0x1992xb,_0x1992xc){var _0x1992x13,_0x1992x14={};return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){_0x1992x13= _0x1992x17;return ReportQueue[_0xfc02[47]]({where:{queuecallerleaveAt:null,queuecallerexit:false,queue:_0x1992x13,createdAt:{$gte:moment()[_0xfc02[44]](_0xfc02[43])}}})})[_0xfc02[18]](function(_0x1992x15){_0x1992x14[_0xfc02[49]]= _0x1992x15;return ReportQueue[_0xfc02[47]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x1992x13,createdAt:{$gte:moment()[_0xfc02[44]](_0xfc02[43])}}})})[_0xfc02[18]](function(_0x1992x15){_0x1992x14[_0xfc02[48]]= _0x1992x15;return ReportQueue[_0xfc02[47]]({where:{queuecallerabandon:true,queue:_0x1992x13,createdAt:{$gte:moment()[_0xfc02[44]](_0xfc02[43])}}})})[_0xfc02[18]](function(_0x1992x15){_0x1992x14[_0xfc02[46]]= _0x1992x15;return ReportQueue[_0xfc02[47]]({where:{queuecallerexit:true,queue:_0x1992x13,createdAt:{$gte:moment()[_0xfc02[44]](_0xfc02[43])}}})})[_0xfc02[18]](function(_0x1992x15){_0x1992x14[_0xfc02[42]]= _0x1992x15;return ReportQueue[_0xfc02[45]]({where:{queuecallercomplete:true,queue:_0x1992x13,createdAt:{$gte:moment()[_0xfc02[44]](_0xfc02[43])}},raw:true})})[_0xfc02[18]](function(_0x1992x15){_0x1992x14[_0xfc02[32]]= _0x1992x15[_0xfc02[33]];_0x1992x14[_0xfc02[34]]= _[_0xfc02[36]](_[_0xfc02[35]](_0x1992x15,_0xfc02[34]));_0x1992x14[_0xfc02[37]]= 0;_[_0xfc02[41]](_0x1992x15,function(_0x1992x16){_0x1992x14[_0xfc02[37]]+= moment(_0x1992x16[_0xfc02[39]])[_0xfc02[38]]()- moment(_0x1992x16[_0xfc02[40]])[_0xfc02[38]]()});return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]](_0x1992x14)})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[49]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[47]]({where:{queuecallerleaveAt:null,queuecallerexit:false,queue:_0x1992x17}})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};function getVoiceQueues(_0x1992x19){return function(){switch(_0x1992x19[_0xfc02[58]]){case _0xfc02[50]:return Agent[_0xfc02[29]](_0x1992x19[_0xfc02[27]],{attributes:[_0xfc02[27]]})[_0xfc02[18]](Util[_0xfc02[55]]())[_0xfc02[18]](function(_0x1992x17){return _[_0xfc02[54]](_0x1992x17[_0xfc02[52]],_0xfc02[53])});case _0xfc02[57]:return Agent[_0xfc02[29]](_0x1992x19[_0xfc02[27]])[_0xfc02[18]](function(_0x1992x1a){return _0x1992x1a[_0xfc02[56]]({attributes:[_0xfc02[53]]})})[_0xfc02[18]](function(_0x1992x17){return _[_0xfc02[54]](_0x1992x17,_0xfc02[53])});default:return VoiceQueue[_0xfc02[45]]()[_0xfc02[18]](function(_0x1992x1b){return {rows:_0x1992x1b}})[_0xfc02[18]](function(_0x1992x17){return _[_0xfc02[54]](_0x1992x17[_0xfc02[52]],_0xfc02[53])})}}}exports[_0xfc02[59]]= function(_0x1992xb,_0x1992xc){var _0x1992x1c={_limit:_0x1992xb[_0xfc02[19]][_0xfc02[60]]?_0x1992xb[_0xfc02[19]][_0xfc02[60]]:null,_offset:_0x1992xb[_0xfc02[19]][_0xfc02[61]]?_0x1992xb[_0xfc02[19]][_0xfc02[61]]:0,_name:_0x1992xb[_0xfc02[19]][_0xfc02[53]]|| undefined,_answeredFrom:_0x1992xb[_0xfc02[19]][_0xfc02[62]]|| _0x1992xb[_0xfc02[19]][_0xfc02[62]]=== 0?_0x1992xb[_0xfc02[19]][_0xfc02[62]]:undefined,_answeredTo:_0x1992xb[_0xfc02[19]][_0xfc02[63]]|| _0x1992xb[_0xfc02[19]][_0xfc02[63]]=== 0?_0x1992xb[_0xfc02[19]][_0xfc02[63]]:undefined,_abandonedFrom:_0x1992xb[_0xfc02[19]][_0xfc02[64]]|| _0x1992xb[_0xfc02[19]][_0xfc02[64]]=== 0?_0x1992xb[_0xfc02[19]][_0xfc02[64]]:undefined,_abandonedTo:_0x1992xb[_0xfc02[19]][_0xfc02[65]]|| _0x1992xb[_0xfc02[19]][_0xfc02[65]]=== 0?_0x1992xb[_0xfc02[19]][_0xfc02[65]]:undefined,_unmanagedFrom:_0x1992xb[_0xfc02[19]][_0xfc02[66]]|| _0x1992xb[_0xfc02[19]][_0xfc02[66]]=== 0?_0x1992xb[_0xfc02[19]][_0xfc02[66]]:undefined,_unmanagedTo:_0x1992xb[_0xfc02[19]][_0xfc02[67]]|| _0x1992xb[_0xfc02[19]][_0xfc02[67]]=== 0?_0x1992xb[_0xfc02[19]][_0xfc02[67]]:undefined};var _0x1992x1d,_0x1992x13,_0x1992x1e,_0x1992x1f;delete _0x1992xb[_0xfc02[19]][_0xfc02[60]];delete _0x1992xb[_0xfc02[19]][_0xfc02[61]];delete _0x1992xb[_0xfc02[19]][_0xfc02[62]];delete _0x1992xb[_0xfc02[19]][_0xfc02[63]];delete _0x1992xb[_0xfc02[19]][_0xfc02[64]];delete _0x1992xb[_0xfc02[19]][_0xfc02[65]];delete _0x1992xb[_0xfc02[19]][_0xfc02[66]];delete _0x1992xb[_0xfc02[19]][_0xfc02[67]];return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){_0x1992x13= _0x1992x17;_0x1992x1d= _[_0xfc02[54]](_0x1992x17,function(_0x1992x23){return {name:_0x1992x23}});return ReportQueue[_0xfc02[45]]({where:{queuecallerleaveAt:null,queue:_0x1992x13},group:_0xfc02[97],attributes:[[_0xfc02[97],_0xfc02[53]],[sequelize[_0xfc02[100]](_0xfc02[98],sequelize[_0xfc02[99]](_0xfc02[27])),_0xfc02[49]]]})})[_0xfc02[18]](function(_0x1992x35){_0x1992x35= _[_0xfc02[54]](_0x1992x35,_0xfc02[95]);_0x1992x1d[_0xfc02[41]](function(_0x1992x23,_0x1992x36){var _0x1992x24=_[_0xfc02[69]](_0x1992x35,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[49]]= _0x1992x24?_0x1992x24[_0xfc02[49]]:0});return ReportQueue[_0xfc02[45]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x1992x13},group:_0xfc02[97],attributes:[[_0xfc02[97],_0xfc02[53]],[sequelize[_0xfc02[100]](_0xfc02[98],sequelize[_0xfc02[99]](_0xfc02[27])),_0xfc02[48]]]})})[_0xfc02[18]](function(_0x1992x34){_0x1992x34= _[_0xfc02[54]](_0x1992x34,_0xfc02[95]);_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x34,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[48]]= _0x1992x24?_0x1992x24[_0xfc02[48]]:0});return ReportQueue[_0xfc02[45]]({where:{queuecallercomplete:true,queue:_0x1992x13},group:_0xfc02[97],attributes:[[_0xfc02[97],_0xfc02[53]],[sequelize[_0xfc02[100]](_0xfc02[98],sequelize[_0xfc02[99]](_0xfc02[27])),_0xfc02[72]]]})})[_0xfc02[18]](function(_0x1992x33){_0x1992x33= _[_0xfc02[54]](_0x1992x33,_0xfc02[95]);_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x33,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[72]]= _0x1992x24?_0x1992x24[_0xfc02[72]]:0});return ReportQueue[_0xfc02[45]]({where:{queuecallerabandon:true,queue:_0x1992x13},group:_0xfc02[97],attributes:[[_0xfc02[97],_0xfc02[53]],[sequelize[_0xfc02[100]](_0xfc02[98],sequelize[_0xfc02[99]](_0xfc02[27])),_0xfc02[75]]]})})[_0xfc02[18]](function(_0x1992x32){_0x1992x32= _[_0xfc02[54]](_0x1992x32,_0xfc02[95]);_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x32,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[75]]= _0x1992x24?_0x1992x24[_0xfc02[75]]:0});return ReportQueue[_0xfc02[45]]({where:{queuecallerexit:true,queue:_0x1992x13},group:_0xfc02[97],attributes:[[_0xfc02[97],_0xfc02[53]],[sequelize[_0xfc02[100]](_0xfc02[98],sequelize[_0xfc02[99]](_0xfc02[27])),_0xfc02[42]]]})})[_0xfc02[18]](function(_0x1992x31){_0x1992x31= _[_0xfc02[54]](_0x1992x31,_0xfc02[95]);_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x31,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[42]]= _0x1992x24?_0x1992x24[_0xfc02[42]]:0});return sequelize[_0xfc02[19]](_0xfc02[96]+ _0x1992x13[_0xfc02[90]](_0xfc02[89])+ _0xfc02[91],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x30){_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x30,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[34]]= _0x1992x24?_0x1992x24[_0xfc02[34]]:_0xfc02[87]});return sequelize[_0xfc02[19]](_0xfc02[94]+ _0x1992x13[_0xfc02[90]](_0xfc02[89])+ _0xfc02[91],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x2f){_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x2f,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[37]]= _0x1992x24?_0x1992x24[_0xfc02[37]]:_0xfc02[87]});return sequelize[_0xfc02[19]](_0xfc02[88]+ _0x1992x13[_0xfc02[90]](_0xfc02[89])+ _0xfc02[91],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x22){_0x1992x1d[_0xfc02[41]](function(_0x1992x23){var _0x1992x24=_[_0xfc02[69]](_0x1992x22,{name:_0x1992x23[_0xfc02[53]]});_0x1992x23[_0xfc02[70]]= _0x1992x24?_0x1992x24[_0xfc02[70]]:0});var _0x1992x25=_(_[_0xfc02[82]](_0x1992x1d,function(_0x1992x23){var _0x1992x26=_0x1992x1c[_0xfc02[71]]?(_0x1992x23[_0xfc02[72]]>= Number(_0x1992x1c._answeredFrom)):true;var _0x1992x27=_0x1992x1c[_0xfc02[73]]?(_0x1992x23[_0xfc02[72]]<= Number(_0x1992x1c._answeredTo)):true;var _0x1992x28=_0x1992x1c[_0xfc02[74]]?(_0x1992x23[_0xfc02[75]]>= Number(_0x1992x1c._abandonedFrom)):true;var _0x1992x29=_0x1992x1c[_0xfc02[76]]?(_0x1992x23[_0xfc02[75]]<= Number(_0x1992x1c._abandonedTo)):true;var _0x1992x2a=_0x1992x1c[_0xfc02[77]]?(_0x1992x23[_0xfc02[42]]>= Number(_0x1992x1c._unmanagedFrom)):true;var _0x1992x2b=_0x1992x1c[_0xfc02[78]]?(_0x1992x23[_0xfc02[42]]<= Number(_0x1992x1c._unmanagedTo)):true;var _0x1992x2c=_0x1992x1c[_0xfc02[79]]?_[_0xfc02[80]](_0x1992x23[_0xfc02[53]],_0x1992x1c._name):true;return _[_0xfc02[81]]([_0x1992x26,_0x1992x27,_0x1992x28,_0x1992x29,_0x1992x2a,_0x1992x2b,_0x1992x2c],function(_0x1992x2d,_0x1992x2e){return _0x1992x2d&& _0x1992x2e})}));if(_0x1992x1c[_0xfc02[83]]){_0x1992x25= _0x1992x25[_0xfc02[86]](_0x1992x1c._offset)[_0xfc02[85]](_0x1992x1c._limit)[_0xfc02[84]]()};return [_0x1992x1d[_0xfc02[33]],_0x1992x25]})[_0xfc02[68]](function(_0x1992x20,_0x1992x21){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({rows:_0x1992x21,count:_0x1992x20})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[101]]= function(_0x1992xb,_0x1992xc){var _0x1992x37={};return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[103]](_0xfc02[49],{method:[_0xfc02[102],_0x1992x17]})[_0xfc02[45]](Util[_0xfc02[20]](_0x1992xb[_0xfc02[19]],_0x1992x37))})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({rows:_0x1992x15,count:_0x1992x15[_0xfc02[33]]})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[48]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[47]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x1992x17}})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[72]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[47]]({where:{queuecallercomplete:true,queue:_0x1992x17}})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[75]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[47]]({where:{queuecallerabandon:true,queue:_0x1992x17}})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[104]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return sequelize[_0xfc02[19]](_0xfc02[105]+ _0x1992x17[_0xfc02[90]](_0xfc02[89])+ _0xfc02[106],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15[0][_0xfc02[84]]})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[107]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return sequelize[_0xfc02[19]](_0xfc02[108]+ _0x1992x17[_0xfc02[90]](_0xfc02[89])+ _0xfc02[106],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15[0][_0xfc02[84]]})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[109]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return sequelize[_0xfc02[19]](_0xfc02[110]+ _0x1992x17[_0xfc02[90]](_0xfc02[89])+ _0xfc02[106],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15[0][_0xfc02[84]]})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[111]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return sequelize[_0xfc02[19]](_0xfc02[112]+ _0x1992x17[_0xfc02[90]](_0xfc02[89])+ _0xfc02[106],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15[0][_0xfc02[84]]})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[113]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return sequelize[_0xfc02[19]](_0xfc02[114]+ _0x1992x17[_0xfc02[90]](_0xfc02[89])+ _0xfc02[106],{type:sequelize[_0xfc02[93]][_0xfc02[92]]})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15[0][_0xfc02[84]]})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[42]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[47]]({where:{queuecallerexit:true,queue:_0x1992x17}})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]]({value:_0x1992x15})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[115]]= function(_0x1992xb,_0x1992xc){return Promise[_0xfc02[51]]([])[_0xfc02[18]](getVoiceQueues(_0x1992xb[_0xfc02[50]]))[_0xfc02[18]](function(_0x1992x17){return ReportQueue[_0xfc02[21]]({where:{queuecallerabandon:true,queue:_0x1992x17}})})[_0xfc02[18]](function(_0x1992x15){return _0x1992xc[_0xfc02[17]](200)[_0xfc02[16]](_0x1992x15)})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};exports[_0xfc02[116]]= function(_0x1992xb,_0x1992xc){return ReportQueue[_0xfc02[45]]({where:{queue:_0x1992xb[_0xfc02[28]][_0xfc02[97]]}})[_0xfc02[18]](function(_0x1992x38){if(!_0x1992x38){return _0x1992xc[_0xfc02[23]](404)};return _0x1992xc[_0xfc02[16]]({count:_0x1992x38[_0xfc02[33]],rows:_0x1992x38})})[_0xfc02[15]](function(_0x1992xe){return handleError(_0x1992xc,_0x1992xe)})};function handleError(_0x1992xc,_0x1992xe){logger[_0xfc02[118]](_0x1992xe[_0xfc02[117]]);return _0x1992xc[_0xfc02[17]](500)[_0xfc02[16]](_0x1992xe)}