1 var _0xcf92=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x61\x69\x6C\x53\x65\x73\x73\x69\x6F\x6E","\x65\x78\x70\x6F\x72\x74\x73","\x6D\x65\x73\x73\x61\x67\x65","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x63\x68\x61\x6E\x6E\x65\x6C","\x41\x50\x50\x20\x51\x55\x45\x55\x45\x2C\x20\x51\x55\x45\x55\x45\x3A","\x6E\x61\x6D\x65","\x53\x54\x52\x41\x54\x45\x47\x59\x3A","\x73\x74\x72\x61\x74\x65\x67\x79","\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x75\x6E\x69\x71\x75\x65\x69\x64","\x41\x47\x45\x4E\x54","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x52\x45\x4A\x45\x43\x54\x45\x44","\x69\x6E\x66\x6F","\x69\x64","\x70\x75\x73\x68","\x72\x65\x6A\x65\x63\x74","\x74\x79\x70\x65","\x6F\x6E","\x66\x69\x6E\x64","\x74\x69\x6D\x65\x6F\x75\x74","\x6D\x61\x70","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x61\x69\x6C\x50\x61\x75\x73\x65","\x46\x49\x45\x4C\x44\x28\x55\x73\x65\x72\x2E\x69\x64\x2C\x25\x73\x29","\x6A\x6F\x69\x6E","\x66\x6F\x72\x6D\x61\x74","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x64","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x74\x6F","\x73\x68\x69\x66\x74","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74","\x71\x75\x65\x75\x65","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x6D\x65\x72\x67\x65","\x63\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x6D\x61\x69\x6C\x5F\x73\x65\x73\x73\x69\x6F\x6E\x3A\x73\x61\x76\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x45\x4E\x44\x20\x28\x4E\x4F\x20\x41\x4E\x53\x57\x45\x52\x20\x42\x59\x20\x41\x47\x45\x4E\x54\x53\x29","\x75\x70\x64\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65","\x63\x6C\x6F\x6E\x65","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x45\x52\x52\x4F\x52","\x55\x73\x65\x72\x48\x61\x73\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x2E\x70\x65\x6E\x61\x6C\x74\x79","\x67\x72\x6F\x75\x70\x42\x79","\x76\x61\x6C\x75\x65\x73","\x62\x65\x65\x70\x61\x6C\x6C","\x55\x73\x65\x72\x73","\x72\x6F\x75\x6E\x64\x72\x6F\x62\x69\x6E","\x72\x72\x6D\x65\x6D\x6F\x72\x79","\x6D\x61\x69\x6C\x5F\x72\x6F\x6F\x6D\x3A\x73\x61\x76\x65","\x72\x6F\x6F\x6D\x69\x64","\x66\x69\x6E\x64\x42\x79\x49\x64","\x54\x49\x4D\x45\x4F\x55\x54","\x53\x45\x43","\x6C\x61\x73\x74\x41\x67\x65\x6E\x74","\x70\x65\x6E\x61\x6C\x74\x79","\x41\x53\x43"];_0xcf92[0];var _=require(_0xcf92[1]);var util=require(_0xcf92[2]);var moment=require(_0xcf92[3]);var Agent=require(_0xcf92[5])[_0xcf92[4]];var Room=require(_0xcf92[5])[_0xcf92[6]];var Queue=require(_0xcf92[5])[_0xcf92[7]];var Report=require(_0xcf92[5])[_0xcf92[8]];var Session=require(_0xcf92[5])[_0xcf92[9]];module[_0xcf92[10]]= function(_0x9a0bx9,_0x9a0bxa,_0x9a0bxb,_0x9a0bxc,_0x9a0bxd){var _0x9a0bxe=[];var _0x9a0bxf;var _0x9a0bx10;var _0x9a0bx11;var _0x9a0bx12=0;process[_0xcf92[28]](_0xcf92[11],function(_0x9a0bxb){switch(_0x9a0bxb[_0xcf92[27]]){case _0xcf92[26]:console[_0xcf92[23]](_0x9a0bxa[_0xcf92[13]][_0xcf92[12]](),_0xcf92[14],_0x9a0bx11[_0xcf92[15]][_0xcf92[12]](),_0xcf92[16],_0x9a0bx11[_0xcf92[17]],_0xcf92[18],_0x9a0bxa[_0xcf92[19]],_0xcf92[20],_0x9a0bxb[_0xcf92[21]],_0xcf92[22]);_0x9a0bxe[_0xcf92[25]]({id:_0x9a0bxb[_0xcf92[24]]});break;default:}});function _0x9a0bx13(_0x9a0bx14){var _0x9a0bx15=_[_0xcf92[29]](_0x9a0bxe,{id:_0x9a0bx14[_0xcf92[24]]});return _0x9a0bx15?true:false}function _0x9a0bx16(){var _0x9a0bx17=((_0x9a0bx9[_0xcf92[30]]- _0x9a0bx12)> _0x9a0bx11[_0xcf92[30]])?_0x9a0bx11[_0xcf92[30]]:(_0x9a0bx9[_0xcf92[30]]- _0x9a0bx12);if(_0x9a0bx17> 0){var _0x9a0bx18={where:{id:{$in:_[_0xcf92[31]](_0x9a0bx10,_0xcf92[24])}},include:[{model:Room,attributes:[_0xcf92[24]],raw:true}],attributes:[_0xcf92[24],_0xcf92[15],_0xcf92[32],_0xcf92[33],_0xcf92[34]],order:[[{raw:util[_0xcf92[37]](_0xcf92[35],_[_0xcf92[31]](_0x9a0bx10,_0xcf92[24])[_0xcf92[36]]())}]]};Agent[_0xcf92[53]](_0x9a0bx18)[_0xcf92[40]](function(_0x9a0bx1b){if(_0x9a0bx1b[_0xcf92[47]]){_0x9a0bx10= _0x9a0bx1b;for(var _0x9a0bx1c=0;_0x9a0bx1c< _0x9a0bx10[_0xcf92[47]];_0x9a0bx1c++){var _0x9a0bx1d=_0x9a0bx10[0][_0xcf92[48]]({plain:true});if(!_0x9a0bx13(_0x9a0bx1d)){return Report[_0xcf92[52]](_[_0xcf92[51]](_0x9a0bxa,{timeslot:_0x9a0bx17,application:_0xcf92[49],membername:_0x9a0bx1d[_0xcf92[15]],memberid:_0x9a0bx1d[_0xcf92[24]],queue:_0x9a0bx11[_0xcf92[24]],queuename:_0x9a0bx11[_0xcf92[15]],calledAt:moment()[_0xcf92[37]](_0xcf92[50])}))}else {var _0x9a0bx14=_0x9a0bx10[_0xcf92[46]]();_0x9a0bx10[_0xcf92[25]](_0x9a0bx14)}}}})[_0xcf92[40]](function(_0x9a0bx1a){if(_0x9a0bx1a){_0x9a0bxc[_0xcf92[45]](util[_0xcf92[37]](_0xcf92[43],_0x9a0bx1a[_0xcf92[44]]))[_0xcf92[42]](_0xcf92[41],_0x9a0bx1a)};var _0x9a0bx14=_0x9a0bx10[_0xcf92[46]]();_0x9a0bx10[_0xcf92[25]](_0x9a0bx14)})[_0xcf92[40]](function(){_0x9a0bxf= setTimeout(function(){_0x9a0bx12+= _0x9a0bx11[_0xcf92[30]];_0x9a0bx16()},_0x9a0bx17* 1000)})[_0xcf92[39]](function(_0x9a0bx19){console[_0xcf92[38]](_0x9a0bx19)})}else {return Session[_0xcf92[58]]({leaveAt:moment()[_0xcf92[37]](_0xcf92[50]),timeout:true},{where:{uniqueid:_0x9a0bxa[_0xcf92[19]],leaveAt:null},individualHooks:true})[_0xcf92[40]](function(_0x9a0bx1e){if(_0x9a0bx1e&& _0x9a0bx1e[_0xcf92[47]]&& _0x9a0bx1e[1][_0xcf92[47]]){for(var _0x9a0bx1c=0;_0x9a0bx1c< _0x9a0bx1e[1][_0xcf92[47]];_0x9a0bx1c++){var _0x9a0bx1f=_0x9a0bx1e[1][_0x9a0bx1c][_0xcf92[48]]({plain:true});_0x9a0bxc[_0xcf92[45]](_0xcf92[55])[_0xcf92[42]](_0xcf92[54],_0x9a0bx1f);_0x9a0bxc[_0xcf92[45]](_0xcf92[56])[_0xcf92[42]](_0xcf92[54],_0x9a0bx1f)}};console[_0xcf92[23]](_0x9a0bxa[_0xcf92[13]][_0xcf92[12]](),_0xcf92[14],_0x9a0bx11[_0xcf92[15]][_0xcf92[12]](),_0xcf92[16],_0x9a0bx11[_0xcf92[17]],_0xcf92[18],_0x9a0bxa[_0xcf92[19]],_0xcf92[57]);clearTimeout(_0x9a0bxf);_0x9a0bxd()})}}function _0x9a0bx20(){var _0x9a0bx21=_0x9a0bx10[_0xcf92[46]]();_0x9a0bx10[_0xcf92[25]](_0x9a0bx21);var _0x9a0bx17=((_0x9a0bx9[_0xcf92[30]]- _0x9a0bx12)> _0x9a0bx11[_0xcf92[30]])?_0x9a0bx11[_0xcf92[30]]:(_0x9a0bx9[_0xcf92[30]]- _0x9a0bx12);if(_0x9a0bx17> 0){Agent[_0xcf92[53]]({where:{id:{$in:_[_0xcf92[31]](_0x9a0bx21,_0xcf92[24])},online:true,mailPause:false},raw:true,attributes:[_0xcf92[24],_0xcf92[15],_0xcf92[32],_0xcf92[33],_0xcf92[34]]})[_0xcf92[40]](function(_0x9a0bx1b){_[_0xcf92[59]](_0x9a0bx1b,function(_0x9a0bx14){return _0x9a0bx13(_0x9a0bx14)});var _0x9a0bx23=_[_0xcf92[31]](_0x9a0bx1b,function(_0x9a0bx14){return _[_0xcf92[60]](_[_0xcf92[51]](_0x9a0bxa,{timeslot:_0x9a0bx17,application:_0xcf92[49],membername:_0x9a0bx14[_0xcf92[15]],memberid:_0x9a0bx14[_0xcf92[24]],queue:_0x9a0bx11[_0xcf92[24]],queuename:_0x9a0bx11[_0xcf92[15]],calledAt:moment()[_0xcf92[37]](_0xcf92[50])}))});return Report[_0xcf92[61]](_0x9a0bx23,{individualHooks:true})})[_0xcf92[40]](function(_0x9a0bx22){if(_0x9a0bx22&& _0x9a0bx22[_0xcf92[47]]){for(var _0x9a0bx1c=0;_0x9a0bx1c< _0x9a0bx22[_0xcf92[47]];_0x9a0bx1c++){var _0x9a0bx1a=_0x9a0bx22[_0x9a0bx1c][_0xcf92[48]]({plain:true});_0x9a0bxc[_0xcf92[45]](util[_0xcf92[37]](_0xcf92[43],_0x9a0bx1a[_0xcf92[44]]))[_0xcf92[42]](_0xcf92[41],_0x9a0bx1a)}};_0x9a0bxf= setTimeout(function(){_0x9a0bx12+= _0x9a0bx11[_0xcf92[30]];_0x9a0bx20()},_0x9a0bx17* 1000)})}else {return Session[_0xcf92[58]]({leaveAt:moment()[_0xcf92[37]](_0xcf92[50]),timeout:true},{where:{uniqueid:_0x9a0bxa[_0xcf92[19]],leaveAt:null},individualHooks:true})[_0xcf92[40]](function(_0x9a0bx1e){if(_0x9a0bx1e&& _0x9a0bx1e[_0xcf92[47]]&& _0x9a0bx1e[1][_0xcf92[47]]){for(var _0x9a0bx1c=0;_0x9a0bx1c< _0x9a0bx1e[1][_0xcf92[47]];_0x9a0bx1c++){var _0x9a0bx1f=_0x9a0bx1e[1][_0x9a0bx1c][_0xcf92[48]]({plain:true});_0x9a0bxc[_0xcf92[45]](_0xcf92[55])[_0xcf92[42]](_0xcf92[54],_0x9a0bx1f);_0x9a0bxc[_0xcf92[45]](_0xcf92[56])[_0xcf92[42]](_0xcf92[54],_0x9a0bx1f)}};console[_0xcf92[23]](_0x9a0bxa[_0xcf92[13]][_0xcf92[12]](),_0xcf92[14],_0x9a0bx11[_0xcf92[15]][_0xcf92[12]](),_0xcf92[16],_0x9a0bx11[_0xcf92[17]],_0xcf92[18],_0x9a0bxa[_0xcf92[19]],_0xcf92[57]);clearTimeout(_0x9a0bxf);_0x9a0bxd()})}}return Queue[_0xcf92[72]](_0x9a0bx9.MailQueueId,{attributes:[_0xcf92[24],_0xcf92[15],_0xcf92[30],_0xcf92[17],_0xcf92[75]],include:[{model:Agent,attributes:[_0xcf92[24]],raw:true,order:[[_0xcf92[76],_0xcf92[77]]]}]})[_0xcf92[40]](function(_0x9a0bx25){_0x9a0bx11= _0x9a0bx25[_0xcf92[48]]({plain:true});console[_0xcf92[23]](_0x9a0bxa[_0xcf92[13]][_0xcf92[12]](),_0xcf92[14],_0x9a0bx11[_0xcf92[15]][_0xcf92[12]](),_0xcf92[16],_0x9a0bx11[_0xcf92[17]],_0xcf92[18],_0x9a0bxa[_0xcf92[19]],_0xcf92[73],_0x9a0bx9[_0xcf92[30]],_0xcf92[74]);return Session[_0xcf92[52]](_[_0xcf92[51]](_0x9a0bxa,{timeslot:_0x9a0bx9[_0xcf92[30]],application:_0xcf92[49],queue:_0x9a0bx25[_0xcf92[24]],queuename:_0x9a0bx25[_0xcf92[15]],calledAt:moment()[_0xcf92[37]](_0xcf92[50]),joinAt:moment()[_0xcf92[37]](_0xcf92[50]),membername:null,memberid:null}))})[_0xcf92[40]](function(_0x9a0bx1f){_0x9a0bxc[_0xcf92[45]](_0xcf92[55])[_0xcf92[42]](_0xcf92[54],_0x9a0bx1f);_0x9a0bxc[_0xcf92[45]](_0xcf92[56])[_0xcf92[42]](_0xcf92[54],_0x9a0bx1f);return Room[_0xcf92[72]](_0x9a0bxa[_0xcf92[71]])})[_0xcf92[40]](function(_0x9a0bx24){if(_0x9a0bx24){return _0x9a0bx24[_0xcf92[58]]({waiting:true})}})[_0xcf92[40]](function(_0x9a0bx24){if(_0x9a0bx24){_0x9a0bxc[_0xcf92[42]](_0xcf92[70],_0x9a0bx24[_0xcf92[48]]({plain:true}))}})[_0xcf92[40]](function(_0x9a0bx24){switch(_0x9a0bx11[_0xcf92[17]]){case _0xcf92[66]:_0x9a0bx10= _[_0xcf92[65]](_[_0xcf92[64]](_0x9a0bx11.Users,_0xcf92[63]));_0x9a0bx20();break;case _0xcf92[68]:_0x9a0bx10= _0x9a0bx11[_0xcf92[67]];_0x9a0bx16();break;case _0xcf92[69]:_0x9a0bx10= _0x9a0bx11[_0xcf92[67]];_0x9a0bx16();break;default:}})[_0xcf92[39]](function(_0x9a0bx19){console[_0xcf92[38]](_0x9a0bxa[_0xcf92[13]][_0xcf92[12]](),_0xcf92[14],_0x9a0bx11[_0xcf92[15]][_0xcf92[12]](),_0xcf92[16],_0x9a0bx11[_0xcf92[17]],_0xcf92[18],_0x9a0bxa[_0xcf92[19]],_0xcf92[62]);console[_0xcf92[38]](_0x9a0bx19);_0x9a0bxd(_0x9a0bx19)})}