1 var _0x32dd=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\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","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x72\x65\x67\x69\x73\x74\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x63\x68\x61\x6E\x67\x65\x64","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x74\x68\x65\x6E","\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x55\x73\x65\x72","\x75\x73\x65\x72","\x66\x69\x6E\x64\x41\x6C\x6C","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x57\x41\x49\x54\x49\x4E\x47\x20\x45\x52\x52\x4F\x52","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x71\x75\x65\x75\x65","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x70\x61\x72\x61\x6D\x65\x74\x65\x72\x73","\x65\x6D\x69\x74","\x72\x6F\x77\x73","\x66\x69\x6E\x64","\x6E\x61\x6D\x65","\x43\x4F\x55\x4E\x54","\x63\x6F\x6C","\x66\x6E","\x77\x61\x69\x74\x69\x6E\x67","\x75\x73\x65\x72\x49\x64","\x72\x6F\x6C\x65","\x61\x6C\x6C","\x41\x43\x54\x49\x56\x45\x20\x45\x52\x52\x4F\x52","\x61\x63\x74\x69\x76\x65","\x41\x42\x41\x4E\x44\x4F\x4E\x45\x44\x20\x45\x52\x52\x4F\x52","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44\x20\x45\x52\x52\x4F\x52","\x61\x6E\x73\x77\x65\x72\x65\x64","\x48\x4F\x4C\x44\x54\x49\x4D\x45\x20\x45\x52\x52\x4F\x52","\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\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\x3D\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\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","\x54\x41\x4C\x4B\x54\x49\x4D\x45\x20\x45\x52\x52\x4F\x52","\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\x3D\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x54\x4F\x54\x41\x4C\x43\x41\x4C\x4C\x53\x20\x45\x52\x52\x4F\x52","\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\x3D\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x71\x75\x65\x75\x65","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44\x20\x45\x52\x52\x4F\x52","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64"];_0x32dd[0];var sequelize=require(_0x32dd[2])[_0x32dd[1]];var models=require(_0x32dd[2]);var Util=require(_0x32dd[3]);var Promise=require(_0x32dd[4]);var _=require(_0x32dd[5]);var util=require(_0x32dd[6]);exports[_0x32dd[7]]= function(_0x407cx7){models[_0x32dd[9]][_0x32dd[8]](function(_0x407cx8){onWaiting(_0x407cx7,_0x407cx8)});models[_0x32dd[9]][_0x32dd[12]](function(_0x407cx8){if(_0x407cx8[_0x32dd[11]](_0x32dd[10])){onWaiting(_0x407cx7,_0x407cx8);onActive(_0x407cx7,_0x407cx8)}});models[_0x32dd[9]][_0x32dd[12]](function(_0x407cx8){if(_0x407cx8[_0x32dd[11]](_0x32dd[13])|| _0x407cx8[_0x32dd[11]](_0x32dd[14])){onAbandon(_0x407cx7,_0x407cx8);onComplete(_0x407cx7,_0x407cx8);onActive(_0x407cx7,_0x407cx8);onAvgAnswerTime(_0x407cx7,_0x407cx8);onAvgTalkTime(_0x407cx7,_0x407cx8);onTotalOffered(_0x407cx7,_0x407cx8);onUnmanaged(_0x407cx7,_0x407cx8)}})};function getQueues(_0x407cxa,_0x407cxb){return function(){switch(_0x407cxb){case _0x32dd[20]:return models[_0x32dd[19]][_0x32dd[18]](_0x407cxa,{attributes:[_0x32dd[17]]})[_0x32dd[16]](Util[_0x32dd[15]]());default:return models[_0x32dd[22]][_0x32dd[21]]()[_0x32dd[16]](function(_0x407cxc){return {rows:_0x407cxc}})}}}function onWaiting(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){return models[_0x32dd[9]][_0x32dd[21]]({where:{queuecallerleaveAt:null,queue:_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:[]},group:_0x32dd[28],attributes:[[_0x32dd[28],_0x32dd[33]],[sequelize[_0x32dd[36]](_0x32dd[34],sequelize[_0x32dd[35]](_0x32dd[17])),_0x32dd[37]]]})};return null})[_0x32dd[16]](function(_0x407cxf){if(_0x407cxf){var _0x407cx10;if(_0x407cxf[_0x32dd[26]]){_0x407cx10= _0x407cxf[0][_0x32dd[27]]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],waiting:0}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[23],_0x407cxe)})}function onActive(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){return models[_0x32dd[9]][_0x32dd[21]]({where:{queuecallerexit:false,queuecallerabandon:false,queuecallercomplete:false,queuecallerleaveAt:{$ne:null},queue:_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:[]},group:_0x32dd[28],attributes:[[_0x32dd[28],_0x32dd[33]],[sequelize[_0x32dd[36]](_0x32dd[34],sequelize[_0x32dd[35]](_0x32dd[17])),_0x32dd[42]]]})};return null})[_0x32dd[16]](function(_0x407cx13){if(_0x407cx13){var _0x407cx10;if(_0x407cx13[_0x32dd[26]]){_0x407cx10= _0x407cx13[0][_0x32dd[27]]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],active:0}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[41],_0x407cxe)})}function onAbandon(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){return models[_0x32dd[9]][_0x32dd[21]]({where:{queuecallerabandon:true,queue:_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:[]},group:_0x32dd[28],attributes:[[_0x32dd[28],_0x32dd[33]],[sequelize[_0x32dd[36]](_0x32dd[34],sequelize[_0x32dd[35]](_0x32dd[17])),_0x32dd[44]]]})};return null})[_0x32dd[16]](function(_0x407cx15){if(_0x407cx15){var _0x407cx10;if(_0x407cx15[_0x32dd[26]]){_0x407cx10= _0x407cx15[0][_0x32dd[27]]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],abandoned:0}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[43],_0x407cxe)})}function onComplete(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){return models[_0x32dd[9]][_0x32dd[21]]({where:{queuecallercomplete:true,queue:_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:[]},group:_0x32dd[28],attributes:[[_0x32dd[28],_0x32dd[33]],[sequelize[_0x32dd[36]](_0x32dd[34],sequelize[_0x32dd[35]](_0x32dd[17])),_0x32dd[46]]]})};return null})[_0x32dd[16]](function(_0x407cx17){if(_0x407cx17){var _0x407cx10;if(_0x407cx17[_0x32dd[26]]){_0x407cx10= _0x407cx17[0][_0x32dd[27]]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],answered:0}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[45],_0x407cxe)})}function onAvgAnswerTime(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){var _0x407cx1a=_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:_0x32dd[49];var _0x407cx1b=util[_0x32dd[51]](_0x32dd[50],_0x407cx1a);return sequelize[_0x32dd[54]](_0x407cx1b,{type:sequelize[_0x32dd[53]][_0x32dd[52]]})};return null})[_0x32dd[16]](function(_0x407cx19){if(_0x407cx19){var _0x407cx10;if(_0x407cx19[_0x32dd[26]]){_0x407cx10= _0x407cx19[0]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],holdtime:_0x32dd[48]}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[47],_0x407cxe)})}function onAvgTalkTime(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){var _0x407cx1a=_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:_0x32dd[49];return sequelize[_0x32dd[54]](util[_0x32dd[51]](_0x32dd[56],_0x407cx1a),{type:sequelize[_0x32dd[53]][_0x32dd[52]]})};return null})[_0x32dd[16]](function(_0x407cx1d){if(_0x407cx1d){var _0x407cx10;if(_0x407cx1d[_0x32dd[26]]){_0x407cx10= _0x407cx1d[0]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],talktime:_0x32dd[48]}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[55],_0x407cxe)})}function onTotalOffered(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){var _0x407cx1a=_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:_0x32dd[49];return sequelize[_0x32dd[54]](util[_0x32dd[51]](_0x32dd[58],_0x407cx1a),{type:sequelize[_0x32dd[53]][_0x32dd[52]]})};return null})[_0x32dd[16]](function(_0x407cx1f){if(_0x407cx1f){var _0x407cx10;if(_0x407cx1f[_0x32dd[26]]){_0x407cx10= _0x407cx1f[0]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],totalcalls:0}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[57],_0x407cxe)})}function onUnmanaged(_0x407cx7,_0x407cx8){return Promise[_0x32dd[40]]([])[_0x32dd[16]](getQueues(_0x407cx7[_0x32dd[38]],_0x407cx7[_0x32dd[39]]))[_0x32dd[16]](function(_0x407cx11){if(_0x407cx11[_0x32dd[31]][_0x32dd[26]]){return models[_0x32dd[9]][_0x32dd[21]]({where:{queuecallerexit:true,queue:_[_0x32dd[32]](_0x407cx11[_0x32dd[31]],{name:_0x407cx8[_0x32dd[28]]})?_0x407cx8[_0x32dd[28]]:[]},group:_0x32dd[28],attributes:[[_0x32dd[28],_0x32dd[33]],[sequelize[_0x32dd[36]](_0x32dd[34],sequelize[_0x32dd[35]](_0x32dd[17])),_0x32dd[60]]]})};return null})[_0x32dd[16]](function(_0x407cx21){if(_0x407cx21){var _0x407cx10;if(_0x407cx21[_0x32dd[26]]){_0x407cx10= _0x407cx21[0][_0x32dd[27]]}else {_0x407cx10= {name:_0x407cx8[_0x32dd[28]],_parameters:0}};_0x407cx7[_0x32dd[30]](_0x32dd[29],_0x407cx10)}})[_0x32dd[25]](function(_0x407cxe){console[_0x32dd[24]](_0x32dd[59],_0x407cxe)})}