Built motion from commit 15a6d846f.|1.0.20
[motion.git] / server / api / chat_room / chat_room.controller.js
index 273e2f3..debd918 100644 (file)
@@ -1 +1 @@
-var _0x4649=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x74\x6F\x2D\x63\x73\x76","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4C\x69\x73\x74","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x69\x6E\x64\x65\x78","\x6C\x6F\x67","\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","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x6D\x65\x72\x67\x65","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x63\x6F\x75\x6E\x74","\x61\x6C\x6C","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x62\x6F\x64\x79","\x2C","\x73\x70\x6C\x69\x74","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x24\x61\x6E\x64","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x25","\x3B\x25","\x70\x75\x73\x68","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x47\x72\x6F\x75\x70\x73","\x67\x72\x6F\x75\x70","\x61\x67\x65\x6E\x74","\x75\x73\x65\x72\x70\x69\x63","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x78\x74\x65\x72\x6E\x61\x6C\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x67\x65\x74\x41\x67\x65\x6E\x74","\x67\x65\x74\x4F\x6E\x6C\x69\x6E\x65\x52\x6F\x6F\x6D","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x65","\x65\x72\x72\x6F\x72","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x73\x68\x6F\x77","\x61\x64\x64\x72\x65\x73\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79"];_0x4649[0];var _=require(_0x4649[1]);var md5=require(_0x4649[2]);var moment=require(_0x4649[3]);var csv=require(_0x4649[4]);var util=require(_0x4649[5]);var Util=require(_0x4649[6]);var User=require(_0x4649[8])[_0x4649[7]];var Agent=require(_0x4649[8])[_0x4649[7]];var ChatRoom=require(_0x4649[8])[_0x4649[9]];var ChatMessage=require(_0x4649[8])[_0x4649[10]];var ChatWebsite=require(_0x4649[8])[_0x4649[11]];var ChatApplication=require(_0x4649[8])[_0x4649[12]];var ChatQueue=require(_0x4649[8])[_0x4649[13]];var ChatVisitor=require(_0x4649[8])[_0x4649[14]];var List=require(_0x4649[8])[_0x4649[15]];var UserHasChatRoom=require(_0x4649[8])[_0x4649[16]];exports[_0x4649[17]]= function(_0x9044x11,_0x9044x12,_0x9044x13){return ChatRoom[_0x4649[32]](_[_0x4649[31]](Util[_0x4649[24]](_0x9044x11[_0x4649[23]]),{include:[{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[28],_0x4649[29],_0x4649[30]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x4649[22]](function(_0x9044x15){_0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x15)})[_0x4649[19]](function(_0x9044x14){console[_0x4649[18]](_0x9044x14);return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[33]]= function(_0x9044x11,_0x9044x12){return ChatRoom[_0x4649[33]]()[_0x4649[22]](function(_0x9044x16){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x16)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};function getChatQueues(_0x9044x18){return function(){switch(_0x9044x18[_0x4649[29]]){case _0x4649[37]:return User[_0x4649[36]](_0x9044x18[_0x4649[25]],{attributes:[_0x4649[25]]})[_0x4649[22]](Util[_0x4649[35]]({},{attributes:[_0x4649[25]]}))[_0x4649[22]](function(_0x9044x19){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0x4649[34]](_0x9044x19,_0x4649[25])}}}}}});default:return {}}}}exports[_0x4649[38]]= function(_0x9044x11,_0x9044x12){return Promise[_0x4649[43]]([])[_0x4649[22]](getChatQueues(_0x9044x11[_0x4649[37]]))[_0x4649[22]](function(_0x9044x1b){return ChatRoom[_0x4649[42]](_[_0x4649[31]](Util[_0x4649[24]](_0x9044x11[_0x4649[23]],{status:_0x4649[39],updatedAt:{$gte:moment()[_0x4649[41]](_0x4649[40])}}),_0x9044x1b))})[_0x4649[22]](function(_0x9044x1a){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]]({value:_0x9044x1a})})[_0x4649[19]](function(_0x9044x14){console[_0x4649[18]](_0x9044x14);return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[44]]= function(_0x9044x11,_0x9044x12,_0x9044x13){var _0x9044x1c={tags:_0x9044x11[_0x4649[46]][_0x4649[45]]};var _0x9044x1d={where:{id:_0x9044x11[_0x4649[49]][_0x4649[25]][_0x4649[48]](_0x4649[47])}};return ChatRoom[_0x4649[51]](_0x9044x1c,_0x9044x1d)[_0x4649[22]](function(_0x9044x1e){if(!_0x9044x1e){return _0x9044x12[_0x4649[50]](404)};return _0x9044x1e})[_0x4649[22]](function(_0x9044x1e){return _0x9044x12[_0x4649[50]](200)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};function checkTags(_0x9044x20){if(_0x9044x20){if(_0x9044x20[_0x4649[45]]){_0x9044x20[_0x4649[52]]= [];if(_[_0x4649[53]](_0x9044x20[_0x4649[45]])){for(var _0x9044x21=0;_0x9044x21< _0x9044x20[_0x4649[45]][_0x4649[54]];_0x9044x21++){_0x9044x20[_0x4649[52]][_0x4649[57]]({tags:{$like:_0x4649[55]+ _0x9044x20[_0x4649[45]][_0x9044x21]+ _0x4649[56]}})}}else {_0x9044x20[_0x4649[52]][_0x4649[57]]({tags:{$like:_0x4649[55]+ _0x9044x20[_0x4649[45]]+ _0x4649[56]}})};delete _0x9044x20[_0x4649[45]]}}}exports[_0x4649[58]]= function(_0x9044x11,_0x9044x12,_0x9044x13){switch(_0x9044x11[_0x4649[37]][_0x4649[29]]){case _0x4649[37]:return User[_0x4649[36]](_0x9044x11[_0x4649[37]][_0x4649[25]],{attributes:[_0x4649[25]],where:{id:{$ne:_0x9044x11[_0x4649[37]][_0x4649[25]]},online:true}})[_0x4649[22]](Util[_0x4649[59]](_[_0x4649[31]](_0x9044x11[_0x4649[23]],{id:{$ne:_0x9044x11[_0x4649[37]][_0x4649[25]]}})))[_0x4649[22]](function(_0x9044x15){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x15)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)});default:return User[_0x4649[60]](_0x4649[43])[_0x4649[32]](_[_0x4649[31]](Util[_0x4649[24]](_0x9044x11[_0x4649[23]]),{where:{id:{$ne:_0x9044x11[_0x4649[37]][_0x4649[25]]},online:true}}))[_0x4649[22]](function(_0x9044x15){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x15)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})}};exports[_0x4649[61]]= function(_0x9044x11,_0x9044x12,_0x9044x13){checkTags(_0x9044x11[_0x4649[23]]);var _0x9044x22={where:_[_0x4649[31]]({type:_0x4649[62]},_0x9044x11[_0x4649[23]])};switch(_0x9044x11[_0x4649[37]][_0x4649[29]]){case _0x4649[63]:_[_0x4649[31]](_0x9044x22,{include:[{model:User,attributes:[_0x4649[25]],where:{id:_0x9044x11[_0x4649[37]][_0x4649[25]]}}]});break;default:};return ChatRoom[_0x4649[65]](_0x9044x22)[_0x4649[22]](function(_0x9044x1e){return ChatRoom[_0x4649[65]]({where:{id:{$in:_[_0x4649[34]](_0x9044x1e,_0x4649[25])}},include:[{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[29],_0x4649[64]]},{model:ChatVisitor}]})})[_0x4649[22]](function(_0x9044x1e){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]]({rows:_0x9044x1e,count:_0x9044x1e[_0x4649[54]]})})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[66]]= function(_0x9044x11,_0x9044x12,_0x9044x13){checkTags(_0x9044x11[_0x4649[23]]);var _0x9044x22={where:_[_0x4649[31]]({type:_0x4649[67]},_0x9044x11[_0x4649[23]]),include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[27]]}]};switch(_0x9044x11[_0x4649[37]][_0x4649[29]]){case _0x4649[63]:_0x9044x22[_0x4649[68]][_0x4649[57]]({model:User,attributes:[_0x4649[25]],where:{id:_0x9044x11[_0x4649[37]][_0x4649[25]]}});break;default:};return ChatRoom[_0x4649[65]](_0x9044x22)[_0x4649[22]](function(_0x9044x1e){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]]({rows:_0x9044x1e,count:_0x9044x1e[_0x4649[54]]})})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[69]]= function(_0x9044x11,_0x9044x12,_0x9044x13){return User[_0x4649[60]](_0x4649[43])[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]])[_0x4649[22]](function(_0x9044x15){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x15)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[70]]= function(_0x9044x11,_0x9044x12,_0x9044x13){return ChatRoom[_0x4649[60]](_0x4649[71])[_0x4649[32]](_[_0x4649[31]](Util[_0x4649[24]](_0x9044x11[_0x4649[23]]),{include:[{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[28],_0x4649[29],_0x4649[30]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x4649[22]](function(_0x9044x15){_0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x15)})[_0x4649[19]](function(_0x9044x14){console[_0x4649[18]](_0x9044x14);return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[72]]= function(_0x9044x11,_0x9044x12){return User[_0x4649[36]](_0x9044x11[_0x4649[37]][_0x4649[25]])[_0x4649[22]](function(_0x9044x18){return _0x9044x18[_0x4649[74]]({include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[27],_0x4649[28]]},{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[28],_0x4649[29],_0x4649[30]]}]})})[_0x4649[22]](function(_0x9044x1e){if(!_0x9044x1e){return _0x9044x12[_0x4649[50]](404)};return _0x9044x12[_0x4649[20]](_0x9044x1e)})[_0x4649[19]](function(_0x9044x14){console[_0x4649[73]](_0x9044x14);return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[75]]= function(_0x9044x11,_0x9044x12){return ChatRoom[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[28],_0x4649[27]]},{model:User,attributes:[_0x4649[25],_0x4649[28],_0x4649[26],_0x4649[27],_0x4649[64],_0x4649[29],_0x4649[30]]}]},{model:User,attributes:[_0x4649[25],_0x4649[28],_0x4649[26],_0x4649[27],_0x4649[64],_0x4649[29],_0x4649[30]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0x4649[25],_0x4649[26],_0x4649[76]],include:[List]}],order:[[ChatMessage,_0x4649[25]]]})[_0x4649[22]](function(_0x9044x23){if(!_0x9044x23){return _0x9044x12[_0x4649[50]](404)};return _0x9044x12[_0x4649[20]](_0x9044x23)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[77]]= function(_0x9044x11,_0x9044x12,_0x9044x13){var _0x9044x24;return ChatRoom[_0x4649[87]]({where:{token:md5(JSON[_0x4649[85]](_0x9044x11[_0x4649[23]][_0x4649[80]][_0x4649[84]]())).toString(_0x4649[83])},defaults:{type:_0x4649[30],token:md5(JSON[_0x4649[85]](_0x9044x11[_0x4649[23]][_0x4649[80]][_0x4649[84]]())).toString(_0x4649[83]),status:_0x4649[86]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[28],_0x4649[27]]},{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[28],_0x4649[29],_0x4649[30]]}]},{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[28],_0x4649[29],_0x4649[30]]}]})[_0x4649[82]](function(_0x9044x23,_0x9044x26){_0x9044x24= _0x9044x23;if(_0x9044x26){return _0x9044x24[_0x4649[81]](_0x9044x11[_0x4649[23]][_0x4649[80]])}})[_0x4649[22]](function(){return _0x9044x24[_0x4649[79]]()})[_0x4649[22]](function(_0x9044x25){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_[_0x4649[31]](_0x9044x24[_0x4649[78]],{Users:_0x9044x25}))})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[88]]= function(_0x9044x11,_0x9044x12,_0x9044x13){var _0x9044x24;return ChatRoom[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]])[_0x4649[22]](function(_0x9044x23){_0x9044x24= _0x9044x23;if(!_0x9044x24){return _0x9044x12[_0x4649[50]](404)}})[_0x4649[22]](function(){return ChatMessage[_0x4649[90]](_[_0x4649[31]](_0x9044x11[_0x4649[46]],{type:_0x9044x24[_0x4649[89]],ChatRoomId:_0x9044x11[_0x4649[49]][_0x4649[25]],UserId:_0x9044x11[_0x4649[37]][_0x4649[25]]}))})[_0x4649[22]](function(_0x9044x27){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x27)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[91]]= function(_0x9044x11,_0x9044x12,_0x9044x13){return ChatRoom[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[27]]},{model:User,attributes:[_0x4649[25],_0x4649[27]]}]}]})[_0x4649[22]](function(_0x9044x23){var _0x9044x28=[];_0x9044x23[_0x4649[96]][_0x4649[95]](function(_0x9044x27){_0x9044x28[_0x4649[57]]({name:_0x9044x27[_0x4649[7]]?_0x9044x27[_0x4649[7]][_0x4649[27]]:_0x9044x27[_0x4649[14]][_0x4649[27]],text:_0x9044x27[_0x4649[46]][_0x4649[93]](/(\r\n|\n|\r)/gm,_0x4649[92]),date:_0x9044x27[_0x4649[94]]})});return _0x9044x12[_0x4649[89]](_0x4649[97])[_0x4649[21]](200)[_0x4649[20]](csv(_0x9044x28))})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[98]]= function(_0x9044x11,_0x9044x12){return User[_0x4649[36]](_0x9044x11[_0x4649[37]][_0x4649[25]])[_0x4649[22]](function(_0x9044x18){return _0x9044x18[_0x4649[74]]({where:{type:_0x9044x11[_0x4649[49]][_0x4649[89]]},include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[27],_0x4649[28]]}]})})[_0x4649[22]](function(_0x9044x1e){if(!_0x9044x1e){return _0x9044x12[_0x4649[50]](404)};return _0x9044x12[_0x4649[20]](_0x9044x1e)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[99]]= function(_0x9044x11,_0x9044x12){return User[_0x4649[36]](_0x9044x11[_0x4649[37]][_0x4649[25]])[_0x4649[22]](function(_0x9044x18){return _0x9044x18[_0x4649[74]]({include:[{model:ChatVisitor,attributes:[_0x4649[25],_0x4649[27],_0x4649[28]]},{model:User,attributes:[_0x4649[25],_0x4649[26],_0x4649[27],_0x4649[28],_0x4649[29],_0x4649[30]]}]})})[_0x4649[22]](function(_0x9044x1e){if(!_0x9044x1e){return _0x9044x12[_0x4649[50]](404)};return _0x9044x12[_0x4649[20]](_0x9044x1e)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[90]]= function(_0x9044x11,_0x9044x12){};exports[_0x4649[51]]= function(_0x9044x11,_0x9044x12){if(_0x9044x11[_0x4649[46]][_0x4649[25]]){delete _0x9044x11[_0x4649[46]][_0x4649[25]]};return ChatRoom[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]])[_0x4649[22]](function(_0x9044x23){if(!_0x9044x23){return _0x9044x12[_0x4649[50]](404)};return _0x9044x23[_0x4649[51]](_0x9044x11[_0x4649[46]])})[_0x4649[22]](function(_0x9044x23){return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x23)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[100]]= function(_0x9044x11,_0x9044x12){var _0x9044x24;if(_0x9044x11[_0x4649[46]][_0x4649[25]]){delete _0x9044x11[_0x4649[46]][_0x4649[25]]};return ChatRoom[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]])[_0x4649[22]](function(_0x9044x23){if(!_0x9044x23|| !_0x9044x11[_0x4649[46]][_0x4649[80]]){return _0x9044x12[_0x4649[50]](404)};return _0x9044x23})[_0x4649[22]](function(_0x9044x23){return _0x9044x23[_0x4649[51]]({type:_0x4649[62],token:md5(JSON[_0x4649[85]](_0x9044x11[_0x4649[46]][_0x4649[80]][_0x4649[84]]())).toString(_0x4649[83])})})[_0x4649[22]](function(_0x9044x23){_0x9044x24= _0x9044x23;return _0x9044x23[_0x4649[81]](_0x9044x11[_0x4649[46]][_0x4649[80]][_0x4649[84]](),{individualHooks:true})})[_0x4649[22]](function(){return _0x9044x24[_0x4649[79]]()})[_0x4649[22]](function(_0x9044x25){_[_0x4649[31]](_0x9044x24[_0x4649[78]],{Users:_0x9044x25});return _0x9044x12[_0x4649[21]](200)[_0x4649[20]](_0x9044x24)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};exports[_0x4649[101]]= function(_0x9044x11,_0x9044x12){return ChatRoom[_0x4649[36]](_0x9044x11[_0x4649[49]][_0x4649[25]])[_0x4649[22]](function(_0x9044x23){if(!_0x9044x23){return _0x9044x12[_0x4649[50]](404)};return _0x9044x23[_0x4649[101]]()})[_0x4649[22]](function(){return _0x9044x12[_0x4649[50]](204)})[_0x4649[19]](function(_0x9044x14){return handleError(_0x9044x12,_0x9044x14)})};function handleError(_0x9044x12,_0x9044x14){console[_0x4649[18]](_0x9044x14);return _0x9044x12[_0x4649[21]](500)[_0x4649[20]](_0x9044x14)}
\ No newline at end of file
+var _0x8851=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x6D\x64\x35","\x6D\x6F\x6D\x65\x6E\x74","\x74\x6F\x2D\x63\x73\x76","\x75\x74\x69\x6C","\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","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\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","\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65","\x43\x68\x61\x74\x57\x65\x62\x73\x69\x74\x65","\x43\x68\x61\x74\x41\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x56\x69\x73\x69\x74\x6F\x72","\x4C\x69\x73\x74","\x55\x73\x65\x72\x48\x61\x73\x43\x68\x61\x74\x52\x6F\x6F\x6D","\x67\x65\x74\x44\x61\x73\x68\x62\x6F\x61\x72\x64\x56\x61\x6C\x75\x65\x73","\x63\x61\x74\x63\x68","\x73\x74\x61\x74\x75\x73","\x6B\x65\x79\x42\x79","\x63\x6F\x75\x6E\x74","\x6D\x61\x70\x56\x61\x6C\x75\x65\x73","\x6D\x65\x72\x67\x65","\x73\x65\x6E\x64","\x74\x68\x65\x6E","\x53\x45\x4C\x45\x43\x54\x20\x4C\x4F\x57\x45\x52\x28\x73\x74\x61\x74\x75\x73\x29\x20\x41\x53\x20\x73\x74\x61\x74\x75\x73\x2C\x20\x43\x4F\x55\x4E\x54\x28\x69\x64\x29\x20\x41\x53\x20\x63\x6F\x75\x6E\x74\x20\x46\x52\x4F\x4D\x20\x63\x68\x61\x74\x5F\x72\x6F\x6F\x6D\x73\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x71\x75\x65\x72\x79","\x69\x6E\x64\x65\x78","\x67\x65\x74\x51\x75\x65\x72\x79","\x69\x64","\x6E\x61\x6D\x65","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x72\x6F\x6C\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x64\x65\x73\x63\x72\x69\x62\x65","\x6D\x61\x70","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x75\x73\x65\x72","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x55\x4E\x4D\x41\x4E\x41\x47\x45\x44","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x61\x6C\x6C","\x75\x70\x64\x61\x74\x65\x50\x61\x74\x63\x68","\x74\x61\x67\x73","\x62\x6F\x64\x79","\x2C","\x73\x70\x6C\x69\x74","\x70\x61\x72\x61\x6D\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x24\x61\x6E\x64","\x69\x73\x41\x72\x72\x61\x79","\x6C\x65\x6E\x67\x74\x68","\x25","\x3B\x25","\x70\x75\x73\x68","\x67\x65\x74\x41\x67\x65\x6E\x74\x73","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x63\x6F\x70\x65","\x67\x65\x74\x47\x72\x6F\x75\x70\x73","\x67\x72\x6F\x75\x70","\x61\x67\x65\x6E\x74","\x75\x73\x65\x72\x70\x69\x63","\x66\x69\x6E\x64\x41\x6C\x6C","\x67\x65\x74\x45\x78\x74\x65\x72\x6E\x61\x6C\x73","\x65\x78\x74\x65\x72\x6E\x61\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x67\x65\x74\x41\x67\x65\x6E\x74","\x67\x65\x74\x4F\x6E\x6C\x69\x6E\x65\x52\x6F\x6F\x6D","\x6F\x6E\x6C\x69\x6E\x65","\x6D\x65","\x67\x65\x74\x43\x68\x61\x74\x52\x6F\x6F\x6D\x73","\x73\x68\x6F\x77","\x61\x64\x64\x72\x65\x73\x73","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x55\x73\x65\x72\x73","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x67\x65\x74\x55\x73\x65\x72\x73","\x75\x73\x65\x72\x73","\x73\x65\x74\x55\x73\x65\x72\x73","\x73\x70\x72\x65\x61\x64","\x62\x61\x73\x65\x36\x34","\x73\x6F\x72\x74","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x4F\x50\x45\x4E","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x63\x72\x65\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\x74\x79\x70\x65","\x63\x72\x65\x61\x74\x65","\x65\x78\x70\x6F\x72\x74","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x74\x65\x78\x74\x2F\x63\x73\x76","\x67\x65\x74\x52\x6F\x6F\x6D\x42\x79\x54\x79\x70\x65","\x67\x65\x74\x52\x6F\x6F\x6D\x47\x72\x6F\x75\x70\x73","\x75\x70\x64\x61\x74\x65\x55\x73\x65\x72\x73","\x64\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x8851[0];var _=require(_0x8851[1]);var md5=require(_0x8851[2]);var moment=require(_0x8851[3]);var csv=require(_0x8851[4]);var util=require(_0x8851[5]);var logger=require(_0x8851[7])(_0x8851[6]);var Util=require(_0x8851[8]);var sequelize=require(_0x8851[10])[_0x8851[9]];var User=require(_0x8851[10])[_0x8851[11]];var Agent=require(_0x8851[10])[_0x8851[11]];var ChatRoom=require(_0x8851[10])[_0x8851[12]];var ChatMessage=require(_0x8851[10])[_0x8851[13]];var ChatWebsite=require(_0x8851[10])[_0x8851[14]];var ChatApplication=require(_0x8851[10])[_0x8851[15]];var ChatQueue=require(_0x8851[10])[_0x8851[16]];var ChatVisitor=require(_0x8851[10])[_0x8851[17]];var List=require(_0x8851[10])[_0x8851[18]];var UserHasChatRoom=require(_0x8851[10])[_0x8851[19]];exports[_0x8851[20]]= function(_0xdb17x13,_0xdb17x14){return sequelize[_0x8851[32]](_0x8851[29],{type:sequelize[_0x8851[31]][_0x8851[30]]})[_0x8851[28]](function(_0xdb17x16){var _0xdb17x17=_[_0x8851[26]]({new:0,open:0,closed:0,abandon:0,unmanaged:0},_[_0x8851[25]](_[_0x8851[23]](_0xdb17x16,_0x8851[22]),_0x8851[24]));return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x17)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[33]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return ChatRoom[_0x8851[41]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]]),{include:[{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x8851[28]](function(_0xdb17x19){_0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[42]]= function(_0xdb17x13,_0xdb17x14){return ChatRoom[_0x8851[42]]()[_0x8851[28]](function(_0xdb17x1a){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x1a)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};function getChatQueues(_0xdb17x1c){return function(){switch(_0xdb17x1c[_0x8851[39]]){case _0x8851[46]:return User[_0x8851[45]](_0xdb17x1c[_0x8851[35]],{attributes:[_0x8851[35]]})[_0x8851[28]](Util[_0x8851[44]]({},{attributes:[_0x8851[35]]}))[_0x8851[28]](function(_0xdb17x1d){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0x8851[43]](_0xdb17x1d,_0x8851[35])}}}}}});default:return {}}}}exports[_0x8851[47]]= function(_0xdb17x13,_0xdb17x14){return Promise[_0x8851[51]]([])[_0x8851[28]](getChatQueues(_0xdb17x13[_0x8851[46]]))[_0x8851[28]](function(_0xdb17x1f){return ChatRoom[_0x8851[24]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]],{status:_0x8851[48],updatedAt:{$gte:moment()[_0x8851[50]](_0x8851[49])}}),_0xdb17x1f))})[_0x8851[28]](function(_0xdb17x1e){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]]({value:_0xdb17x1e})})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[52]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){var _0xdb17x20={tags:_0xdb17x13[_0x8851[54]][_0x8851[53]]};var _0xdb17x21={where:{id:_0xdb17x13[_0x8851[57]][_0x8851[35]][_0x8851[56]](_0x8851[55])}};return ChatRoom[_0x8851[59]](_0xdb17x20,_0xdb17x21)[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x22})[_0x8851[28]](function(_0xdb17x22){return _0xdb17x14[_0x8851[58]](200)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};function checkTags(_0xdb17x24){if(_0xdb17x24){if(_0xdb17x24[_0x8851[53]]){_0xdb17x24[_0x8851[60]]= [];if(_[_0x8851[61]](_0xdb17x24[_0x8851[53]])){for(var _0xdb17x25=0;_0xdb17x25< _0xdb17x24[_0x8851[53]][_0x8851[62]];_0xdb17x25++){_0xdb17x24[_0x8851[60]][_0x8851[65]]({tags:{$like:_0x8851[63]+ _0xdb17x24[_0x8851[53]][_0xdb17x25]+ _0x8851[64]}})}}else {_0xdb17x24[_0x8851[60]][_0x8851[65]]({tags:{$like:_0x8851[63]+ _0xdb17x24[_0x8851[53]]+ _0x8851[64]}})};delete _0xdb17x24[_0x8851[53]]}}}exports[_0x8851[66]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){switch(_0xdb17x13[_0x8851[46]][_0x8851[39]]){case _0x8851[46]:return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]],{attributes:[_0x8851[35]],where:{id:{$ne:_0xdb17x13[_0x8851[46]][_0x8851[35]]},online:true}})[_0x8851[28]](Util[_0x8851[67]](_[_0x8851[26]](_0xdb17x13[_0x8851[32]],{id:{$ne:_0xdb17x13[_0x8851[46]][_0x8851[35]]}})))[_0x8851[28]](function(_0xdb17x19){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)});default:return User[_0x8851[68]](_0x8851[51])[_0x8851[41]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]]),{where:{id:{$ne:_0xdb17x13[_0x8851[46]][_0x8851[35]]},online:true}}))[_0x8851[28]](function(_0xdb17x19){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})}};exports[_0x8851[69]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){checkTags(_0xdb17x13[_0x8851[32]]);var _0xdb17x26={where:_[_0x8851[26]]({type:_0x8851[70]},_0xdb17x13[_0x8851[32]])};switch(_0xdb17x13[_0x8851[46]][_0x8851[39]]){case _0x8851[71]:_[_0x8851[26]](_0xdb17x26,{include:[{model:User,attributes:[_0x8851[35]],where:{id:_0xdb17x13[_0x8851[46]][_0x8851[35]]}}]});break;default:};return ChatRoom[_0x8851[73]](_0xdb17x26)[_0x8851[28]](function(_0xdb17x22){return ChatRoom[_0x8851[73]]({where:{id:{$in:_[_0x8851[43]](_0xdb17x22,_0x8851[35])}},include:[{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[39],_0x8851[72]]},{model:ChatVisitor}]})})[_0x8851[28]](function(_0xdb17x22){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]]({rows:_0xdb17x22,count:_0xdb17x22[_0x8851[62]]})})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[74]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){checkTags(_0xdb17x13[_0x8851[32]]);var _0xdb17x26={where:_[_0x8851[26]]({type:_0x8851[75]},_0xdb17x13[_0x8851[32]]),include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37]]}]};switch(_0xdb17x13[_0x8851[46]][_0x8851[39]]){case _0x8851[71]:_0xdb17x26[_0x8851[76]][_0x8851[65]]({model:User,attributes:[_0x8851[35]],where:{id:_0xdb17x13[_0x8851[46]][_0x8851[35]]}});break;default:};return ChatRoom[_0x8851[73]](_0xdb17x26)[_0x8851[28]](function(_0xdb17x22){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]]({rows:_0xdb17x22,count:_0xdb17x22[_0x8851[62]]})})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[77]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return User[_0x8851[68]](_0x8851[51])[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x19){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[78]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return ChatRoom[_0x8851[68]](_0x8851[79])[_0x8851[41]](_[_0x8851[26]](Util[_0x8851[34]](_0xdb17x13[_0x8851[32]]),{include:[{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x8851[28]](function(_0xdb17x19){_0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x19)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[80]]= function(_0xdb17x13,_0xdb17x14){return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x1c){return _0xdb17x1c[_0x8851[81]]({include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37],_0x8851[38]]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]})})[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x22)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[82]]= function(_0xdb17x13,_0xdb17x14){return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[38],_0x8851[37]]},{model:User,attributes:[_0x8851[35],_0x8851[38],_0x8851[36],_0x8851[37],_0x8851[72],_0x8851[39],_0x8851[40]]}]},{model:User,attributes:[_0x8851[35],_0x8851[38],_0x8851[36],_0x8851[37],_0x8851[72],_0x8851[39],_0x8851[40]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0x8851[35],_0x8851[36],_0x8851[83]],include:[List]}],order:[[ChatMessage,_0x8851[35]]]})[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x27)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[84]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){var _0xdb17x28;return ChatRoom[_0x8851[94]]({where:{token:md5(JSON[_0x8851[92]](_0xdb17x13[_0x8851[32]][_0x8851[87]][_0x8851[91]]())).toString(_0x8851[90])},defaults:{type:_0x8851[40],token:md5(JSON[_0x8851[92]](_0xdb17x13[_0x8851[32]][_0x8851[87]][_0x8851[91]]())).toString(_0x8851[90]),status:_0x8851[93]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[38],_0x8851[37]]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]})[_0x8851[89]](function(_0xdb17x27,_0xdb17x2a){_0xdb17x28= _0xdb17x27;if(_0xdb17x2a){return _0xdb17x28[_0x8851[88]](_0xdb17x13[_0x8851[32]][_0x8851[87]])}})[_0x8851[28]](function(){return _0xdb17x28[_0x8851[86]]()})[_0x8851[28]](function(_0xdb17x29){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_[_0x8851[26]](_0xdb17x28[_0x8851[85]],{Users:_0xdb17x29}))})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[95]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){var _0xdb17x28;return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){_0xdb17x28= _0xdb17x27;if(!_0xdb17x28){return _0xdb17x14[_0x8851[58]](404)}})[_0x8851[28]](function(){return ChatMessage[_0x8851[97]](_[_0x8851[26]](_0xdb17x13[_0x8851[54]],{type:_0xdb17x28[_0x8851[96]],ChatRoomId:_0xdb17x13[_0x8851[57]][_0x8851[35]],UserId:_0xdb17x13[_0x8851[46]][_0x8851[35]]}))})[_0x8851[28]](function(_0xdb17x2b){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x2b)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[98]]= function(_0xdb17x13,_0xdb17x14,_0xdb17x18){return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37]]},{model:User,attributes:[_0x8851[35],_0x8851[37]]}]}]})[_0x8851[28]](function(_0xdb17x27){var _0xdb17x2c=[];_0xdb17x27[_0x8851[103]][_0x8851[102]](function(_0xdb17x2b){_0xdb17x2c[_0x8851[65]]({name:_0xdb17x2b[_0x8851[11]]?_0xdb17x2b[_0x8851[11]][_0x8851[37]]:_0xdb17x2b[_0x8851[17]][_0x8851[37]],text:_0xdb17x2b[_0x8851[54]][_0x8851[100]](/(\r\n|\n|\r)/gm,_0x8851[99]),date:_0xdb17x2b[_0x8851[101]]})});return _0xdb17x14[_0x8851[96]](_0x8851[104])[_0x8851[22]](200)[_0x8851[27]](csv(_0xdb17x2c))})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[105]]= function(_0xdb17x13,_0xdb17x14){return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x1c){return _0xdb17x1c[_0x8851[81]]({where:{type:_0xdb17x13[_0x8851[57]][_0x8851[96]]},include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37],_0x8851[38]]}]})})[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x22)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[106]]= function(_0xdb17x13,_0xdb17x14){return User[_0x8851[45]](_0xdb17x13[_0x8851[46]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x1c){return _0xdb17x1c[_0x8851[81]]({include:[{model:ChatVisitor,attributes:[_0x8851[35],_0x8851[37],_0x8851[38]]},{model:User,attributes:[_0x8851[35],_0x8851[36],_0x8851[37],_0x8851[38],_0x8851[39],_0x8851[40]]}]})})[_0x8851[28]](function(_0xdb17x22){if(!_0xdb17x22){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x14[_0x8851[27]](_0xdb17x22)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[97]]= function(_0xdb17x13,_0xdb17x14){};exports[_0x8851[59]]= function(_0xdb17x13,_0xdb17x14){if(_0xdb17x13[_0x8851[54]][_0x8851[35]]){delete _0xdb17x13[_0x8851[54]][_0x8851[35]]};return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x27[_0x8851[59]](_0xdb17x13[_0x8851[54]])})[_0x8851[28]](function(_0xdb17x27){return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x27)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[107]]= function(_0xdb17x13,_0xdb17x14){var _0xdb17x28;if(_0xdb17x13[_0x8851[54]][_0x8851[35]]){delete _0xdb17x13[_0x8851[54]][_0x8851[35]]};return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27||  !_0xdb17x13[_0x8851[54]][_0x8851[87]]){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x27})[_0x8851[28]](function(_0xdb17x27){return _0xdb17x27[_0x8851[59]]({type:_0x8851[70],token:md5(JSON[_0x8851[92]](_0xdb17x13[_0x8851[54]][_0x8851[87]][_0x8851[91]]())).toString(_0x8851[90])})})[_0x8851[28]](function(_0xdb17x27){_0xdb17x28= _0xdb17x27;return _0xdb17x27[_0x8851[88]](_0xdb17x13[_0x8851[54]][_0x8851[87]][_0x8851[91]](),{individualHooks:true})})[_0x8851[28]](function(){return _0xdb17x28[_0x8851[86]]()})[_0x8851[28]](function(_0xdb17x29){_[_0x8851[26]](_0xdb17x28[_0x8851[85]],{Users:_0xdb17x29});return _0xdb17x14[_0x8851[22]](200)[_0x8851[27]](_0xdb17x28)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};exports[_0x8851[108]]= function(_0xdb17x13,_0xdb17x14){return ChatRoom[_0x8851[45]](_0xdb17x13[_0x8851[57]][_0x8851[35]])[_0x8851[28]](function(_0xdb17x27){if(!_0xdb17x27){return _0xdb17x14[_0x8851[58]](404)};return _0xdb17x27[_0x8851[108]]()})[_0x8851[28]](function(){return _0xdb17x14[_0x8851[58]](204)})[_0x8851[21]](function(_0xdb17x15){return handleError(_0xdb17x14,_0xdb17x15)})};function handleError(_0xdb17x14,_0xdb17x15){logger[_0x8851[110]](_0xdb17x15[_0x8851[109]]);return _0xdb17x14[_0x8851[22]](500)[_0x8851[27]](_0xdb17x15)}
\ No newline at end of file