Built motion from commit d13e3c905.|1.0.24
[motion.git] / server / api / report_queue / report_queue.controller.js
1 var _0xb552=["\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"];_0xb552[0];var _=require(_0xb552[1]);var moment=require(_0xb552[2]);var sequelize=require(_0xb552[4])[_0xb552[3]];var Agent=require(_0xb552[4])[_0xb552[5]];var ReportQueue=require(_0xb552[4])[_0xb552[6]];var VoiceQueue=require(_0xb552[4])[_0xb552[7]];var ReportQueueHistory=require(_0xb552[4])[_0xb552[9]][_0xb552[8]];var Util=require(_0xb552[10]);var Promise=require(_0xb552[11]);var logger=require(_0xb552[13])(_0xb552[12]);exports[_0xb552[14]]= function(_0x49cfxb,_0x49cfxc,_0x49cfxd){return ReportQueue[_0xb552[21]](Util[_0xb552[20]](_0x49cfxb[_0xb552[19]]))[_0xb552[18]](function(_0x49cfxf){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]](_0x49cfxf)})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[22]]= function(_0x49cfxb,_0x49cfxc){return ReportQueue[_0xb552[29]](_0x49cfxb[_0xb552[28]][_0xb552[27]])[_0xb552[18]](function(_0x49cfx10){if(!_0x49cfx10){return _0x49cfxc[_0xb552[23]](404)};var _0x49cfx11=_[_0xb552[25]](_0x49cfx10,_0x49cfxb[_0xb552[24]]);return _0x49cfx11[_0xb552[26]]()})[_0xb552[18]](function(_0x49cfx10){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]](_0x49cfx10)})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[30]]= function(_0x49cfxb,_0x49cfxc){return ReportQueueHistory[_0xb552[30]]()[_0xb552[18]](function(_0x49cfx12){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]](_0x49cfx12)})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[31]]= function(_0x49cfxb,_0x49cfxc){var _0x49cfx13,_0x49cfx14={};return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){_0x49cfx13= _0x49cfx17;return ReportQueue[_0xb552[47]]({where:{queuecallerleaveAt:null,queuecallerexit:false,queue:_0x49cfx13,createdAt:{$gte:moment()[_0xb552[44]](_0xb552[43])}}})})[_0xb552[18]](function(_0x49cfx15){_0x49cfx14[_0xb552[49]]= _0x49cfx15;return ReportQueue[_0xb552[47]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x49cfx13,createdAt:{$gte:moment()[_0xb552[44]](_0xb552[43])}}})})[_0xb552[18]](function(_0x49cfx15){_0x49cfx14[_0xb552[48]]= _0x49cfx15;return ReportQueue[_0xb552[47]]({where:{queuecallerabandon:true,queue:_0x49cfx13,createdAt:{$gte:moment()[_0xb552[44]](_0xb552[43])}}})})[_0xb552[18]](function(_0x49cfx15){_0x49cfx14[_0xb552[46]]= _0x49cfx15;return ReportQueue[_0xb552[47]]({where:{queuecallerexit:true,queue:_0x49cfx13,createdAt:{$gte:moment()[_0xb552[44]](_0xb552[43])}}})})[_0xb552[18]](function(_0x49cfx15){_0x49cfx14[_0xb552[42]]= _0x49cfx15;return ReportQueue[_0xb552[45]]({where:{queuecallercomplete:true,queue:_0x49cfx13,createdAt:{$gte:moment()[_0xb552[44]](_0xb552[43])}},raw:true})})[_0xb552[18]](function(_0x49cfx15){_0x49cfx14[_0xb552[32]]= _0x49cfx15[_0xb552[33]];_0x49cfx14[_0xb552[34]]= _[_0xb552[36]](_[_0xb552[35]](_0x49cfx15,_0xb552[34]));_0x49cfx14[_0xb552[37]]= 0;_[_0xb552[41]](_0x49cfx15,function(_0x49cfx16){_0x49cfx14[_0xb552[37]]+= moment(_0x49cfx16[_0xb552[39]])[_0xb552[38]]()- moment(_0x49cfx16[_0xb552[40]])[_0xb552[38]]()});return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]](_0x49cfx14)})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[49]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[47]]({where:{queuecallerleaveAt:null,queuecallerexit:false,queue:_0x49cfx17}})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};function getVoiceQueues(_0x49cfx19){return function(){switch(_0x49cfx19[_0xb552[58]]){case _0xb552[50]:return Agent[_0xb552[29]](_0x49cfx19[_0xb552[27]],{attributes:[_0xb552[27]]})[_0xb552[18]](Util[_0xb552[55]]())[_0xb552[18]](function(_0x49cfx17){return _[_0xb552[54]](_0x49cfx17[_0xb552[52]],_0xb552[53])});case _0xb552[57]:return Agent[_0xb552[29]](_0x49cfx19[_0xb552[27]])[_0xb552[18]](function(_0x49cfx1a){return _0x49cfx1a[_0xb552[56]]({attributes:[_0xb552[53]]})})[_0xb552[18]](function(_0x49cfx17){return _[_0xb552[54]](_0x49cfx17,_0xb552[53])});default:return VoiceQueue[_0xb552[45]]()[_0xb552[18]](function(_0x49cfx1b){return {rows:_0x49cfx1b}})[_0xb552[18]](function(_0x49cfx17){return _[_0xb552[54]](_0x49cfx17[_0xb552[52]],_0xb552[53])})}}}exports[_0xb552[59]]= function(_0x49cfxb,_0x49cfxc){var _0x49cfx1c={_limit:_0x49cfxb[_0xb552[19]][_0xb552[60]]?_0x49cfxb[_0xb552[19]][_0xb552[60]]:null,_offset:_0x49cfxb[_0xb552[19]][_0xb552[61]]?_0x49cfxb[_0xb552[19]][_0xb552[61]]:0,_name:_0x49cfxb[_0xb552[19]][_0xb552[53]]|| undefined,_answeredFrom:_0x49cfxb[_0xb552[19]][_0xb552[62]]|| _0x49cfxb[_0xb552[19]][_0xb552[62]]=== 0?_0x49cfxb[_0xb552[19]][_0xb552[62]]:undefined,_answeredTo:_0x49cfxb[_0xb552[19]][_0xb552[63]]|| _0x49cfxb[_0xb552[19]][_0xb552[63]]=== 0?_0x49cfxb[_0xb552[19]][_0xb552[63]]:undefined,_abandonedFrom:_0x49cfxb[_0xb552[19]][_0xb552[64]]|| _0x49cfxb[_0xb552[19]][_0xb552[64]]=== 0?_0x49cfxb[_0xb552[19]][_0xb552[64]]:undefined,_abandonedTo:_0x49cfxb[_0xb552[19]][_0xb552[65]]|| _0x49cfxb[_0xb552[19]][_0xb552[65]]=== 0?_0x49cfxb[_0xb552[19]][_0xb552[65]]:undefined,_unmanagedFrom:_0x49cfxb[_0xb552[19]][_0xb552[66]]|| _0x49cfxb[_0xb552[19]][_0xb552[66]]=== 0?_0x49cfxb[_0xb552[19]][_0xb552[66]]:undefined,_unmanagedTo:_0x49cfxb[_0xb552[19]][_0xb552[67]]|| _0x49cfxb[_0xb552[19]][_0xb552[67]]=== 0?_0x49cfxb[_0xb552[19]][_0xb552[67]]:undefined};var _0x49cfx1d,_0x49cfx13,_0x49cfx1e,_0x49cfx1f;delete _0x49cfxb[_0xb552[19]][_0xb552[60]];delete _0x49cfxb[_0xb552[19]][_0xb552[61]];delete _0x49cfxb[_0xb552[19]][_0xb552[62]];delete _0x49cfxb[_0xb552[19]][_0xb552[63]];delete _0x49cfxb[_0xb552[19]][_0xb552[64]];delete _0x49cfxb[_0xb552[19]][_0xb552[65]];delete _0x49cfxb[_0xb552[19]][_0xb552[66]];delete _0x49cfxb[_0xb552[19]][_0xb552[67]];return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){_0x49cfx13= _0x49cfx17;_0x49cfx1d= _[_0xb552[54]](_0x49cfx17,function(_0x49cfx23){return {name:_0x49cfx23}});return ReportQueue[_0xb552[45]]({where:{queuecallerleaveAt:null,queue:_0x49cfx13},group:_0xb552[97],attributes:[[_0xb552[97],_0xb552[53]],[sequelize[_0xb552[100]](_0xb552[98],sequelize[_0xb552[99]](_0xb552[27])),_0xb552[49]]]})})[_0xb552[18]](function(_0x49cfx35){_0x49cfx35= _[_0xb552[54]](_0x49cfx35,_0xb552[95]);_0x49cfx1d[_0xb552[41]](function(_0x49cfx23,_0x49cfx36){var _0x49cfx24=_[_0xb552[69]](_0x49cfx35,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[49]]= _0x49cfx24?_0x49cfx24[_0xb552[49]]:0});return ReportQueue[_0xb552[45]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x49cfx13},group:_0xb552[97],attributes:[[_0xb552[97],_0xb552[53]],[sequelize[_0xb552[100]](_0xb552[98],sequelize[_0xb552[99]](_0xb552[27])),_0xb552[48]]]})})[_0xb552[18]](function(_0x49cfx34){_0x49cfx34= _[_0xb552[54]](_0x49cfx34,_0xb552[95]);_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx34,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[48]]= _0x49cfx24?_0x49cfx24[_0xb552[48]]:0});return ReportQueue[_0xb552[45]]({where:{queuecallercomplete:true,queue:_0x49cfx13},group:_0xb552[97],attributes:[[_0xb552[97],_0xb552[53]],[sequelize[_0xb552[100]](_0xb552[98],sequelize[_0xb552[99]](_0xb552[27])),_0xb552[72]]]})})[_0xb552[18]](function(_0x49cfx33){_0x49cfx33= _[_0xb552[54]](_0x49cfx33,_0xb552[95]);_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx33,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[72]]= _0x49cfx24?_0x49cfx24[_0xb552[72]]:0});return ReportQueue[_0xb552[45]]({where:{queuecallerabandon:true,queue:_0x49cfx13},group:_0xb552[97],attributes:[[_0xb552[97],_0xb552[53]],[sequelize[_0xb552[100]](_0xb552[98],sequelize[_0xb552[99]](_0xb552[27])),_0xb552[75]]]})})[_0xb552[18]](function(_0x49cfx32){_0x49cfx32= _[_0xb552[54]](_0x49cfx32,_0xb552[95]);_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx32,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[75]]= _0x49cfx24?_0x49cfx24[_0xb552[75]]:0});return ReportQueue[_0xb552[45]]({where:{queuecallerexit:true,queue:_0x49cfx13},group:_0xb552[97],attributes:[[_0xb552[97],_0xb552[53]],[sequelize[_0xb552[100]](_0xb552[98],sequelize[_0xb552[99]](_0xb552[27])),_0xb552[42]]]})})[_0xb552[18]](function(_0x49cfx31){_0x49cfx31= _[_0xb552[54]](_0x49cfx31,_0xb552[95]);_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx31,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[42]]= _0x49cfx24?_0x49cfx24[_0xb552[42]]:0});return sequelize[_0xb552[19]](_0xb552[96]+ _0x49cfx13[_0xb552[90]](_0xb552[89])+ _0xb552[91],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx30){_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx30,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[34]]= _0x49cfx24?_0x49cfx24[_0xb552[34]]:_0xb552[87]});return sequelize[_0xb552[19]](_0xb552[94]+ _0x49cfx13[_0xb552[90]](_0xb552[89])+ _0xb552[91],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx2f){_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx2f,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[37]]= _0x49cfx24?_0x49cfx24[_0xb552[37]]:_0xb552[87]});return sequelize[_0xb552[19]](_0xb552[88]+ _0x49cfx13[_0xb552[90]](_0xb552[89])+ _0xb552[91],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx22){_0x49cfx1d[_0xb552[41]](function(_0x49cfx23){var _0x49cfx24=_[_0xb552[69]](_0x49cfx22,{name:_0x49cfx23[_0xb552[53]]});_0x49cfx23[_0xb552[70]]= _0x49cfx24?_0x49cfx24[_0xb552[70]]:0});var _0x49cfx25=_(_[_0xb552[82]](_0x49cfx1d,function(_0x49cfx23){var _0x49cfx26=_0x49cfx1c[_0xb552[71]]?(_0x49cfx23[_0xb552[72]]>= Number(_0x49cfx1c._answeredFrom)):true;var _0x49cfx27=_0x49cfx1c[_0xb552[73]]?(_0x49cfx23[_0xb552[72]]<= Number(_0x49cfx1c._answeredTo)):true;var _0x49cfx28=_0x49cfx1c[_0xb552[74]]?(_0x49cfx23[_0xb552[75]]>= Number(_0x49cfx1c._abandonedFrom)):true;var _0x49cfx29=_0x49cfx1c[_0xb552[76]]?(_0x49cfx23[_0xb552[75]]<= Number(_0x49cfx1c._abandonedTo)):true;var _0x49cfx2a=_0x49cfx1c[_0xb552[77]]?(_0x49cfx23[_0xb552[42]]>= Number(_0x49cfx1c._unmanagedFrom)):true;var _0x49cfx2b=_0x49cfx1c[_0xb552[78]]?(_0x49cfx23[_0xb552[42]]<= Number(_0x49cfx1c._unmanagedTo)):true;var _0x49cfx2c=_0x49cfx1c[_0xb552[79]]?_[_0xb552[80]](_0x49cfx23[_0xb552[53]],_0x49cfx1c._name):true;return _[_0xb552[81]]([_0x49cfx26,_0x49cfx27,_0x49cfx28,_0x49cfx29,_0x49cfx2a,_0x49cfx2b,_0x49cfx2c],function(_0x49cfx2d,_0x49cfx2e){return _0x49cfx2d&& _0x49cfx2e})}));if(_0x49cfx1c[_0xb552[83]]){_0x49cfx25= _0x49cfx25[_0xb552[86]](_0x49cfx1c._offset)[_0xb552[85]](_0x49cfx1c._limit)[_0xb552[84]]()};return [_0x49cfx1d[_0xb552[33]],_0x49cfx25]})[_0xb552[68]](function(_0x49cfx20,_0x49cfx21){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({rows:_0x49cfx21,count:_0x49cfx20})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[101]]= function(_0x49cfxb,_0x49cfxc){var _0x49cfx37={};return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[103]](_0xb552[49],{method:[_0xb552[102],_0x49cfx17]})[_0xb552[45]](Util[_0xb552[20]](_0x49cfxb[_0xb552[19]],_0x49cfx37))})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({rows:_0x49cfx15,count:_0x49cfx15[_0xb552[33]]})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[48]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[47]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_0x49cfx17}})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[72]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[47]]({where:{queuecallercomplete:true,queue:_0x49cfx17}})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[75]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[47]]({where:{queuecallerabandon:true,queue:_0x49cfx17}})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[104]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return sequelize[_0xb552[19]](_0xb552[105]+ _0x49cfx17[_0xb552[90]](_0xb552[89])+ _0xb552[106],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15[0][_0xb552[84]]})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[107]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return sequelize[_0xb552[19]](_0xb552[108]+ _0x49cfx17[_0xb552[90]](_0xb552[89])+ _0xb552[106],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15[0][_0xb552[84]]})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[109]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return sequelize[_0xb552[19]](_0xb552[110]+ _0x49cfx17[_0xb552[90]](_0xb552[89])+ _0xb552[106],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15[0][_0xb552[84]]})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[111]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return sequelize[_0xb552[19]](_0xb552[112]+ _0x49cfx17[_0xb552[90]](_0xb552[89])+ _0xb552[106],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15[0][_0xb552[84]]})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[113]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return sequelize[_0xb552[19]](_0xb552[114]+ _0x49cfx17[_0xb552[90]](_0xb552[89])+ _0xb552[106],{type:sequelize[_0xb552[93]][_0xb552[92]]})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15[0][_0xb552[84]]})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[42]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[47]]({where:{queuecallerexit:true,queue:_0x49cfx17}})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]]({value:_0x49cfx15})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[115]]= function(_0x49cfxb,_0x49cfxc){return Promise[_0xb552[51]]([])[_0xb552[18]](getVoiceQueues(_0x49cfxb[_0xb552[50]]))[_0xb552[18]](function(_0x49cfx17){return ReportQueue[_0xb552[21]]({where:{queuecallerabandon:true,queue:_0x49cfx17}})})[_0xb552[18]](function(_0x49cfx15){return _0x49cfxc[_0xb552[17]](200)[_0xb552[16]](_0x49cfx15)})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};exports[_0xb552[116]]= function(_0x49cfxb,_0x49cfxc){return ReportQueue[_0xb552[45]]({where:{queue:_0x49cfxb[_0xb552[28]][_0xb552[97]]}})[_0xb552[18]](function(_0x49cfx38){if(!_0x49cfx38){return _0x49cfxc[_0xb552[23]](404)};return _0x49cfxc[_0xb552[16]]({count:_0x49cfx38[_0xb552[33]],rows:_0x49cfx38})})[_0xb552[15]](function(_0x49cfxe){return handleError(_0x49cfxc,_0x49cfxe)})};function handleError(_0x49cfxc,_0x49cfxe){logger[_0xb552[118]](_0x49cfxe[_0xb552[117]]);return _0x49cfxc[_0xb552[17]](500)[_0xb552[16]](_0x49cfxe)}