Built motion from commit b18b7a808.|1.0.23
[motion.git] / server / api / chat_room / chat_room.controller.js
index 7bf30ad..71923a1 100644 (file)
@@ -1 +1 @@
-var _0x7f54=["\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\x57\x48\x45\x52\x45\x20\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3E\x3D\x20\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\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","\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","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","","\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"];_0x7f54[0];var _=require(_0x7f54[1]);var md5=require(_0x7f54[2]);var moment=require(_0x7f54[3]);var csv=require(_0x7f54[4]);var util=require(_0x7f54[5]);var logger=require(_0x7f54[7])(_0x7f54[6]);var Util=require(_0x7f54[8]);var sequelize=require(_0x7f54[10])[_0x7f54[9]];var User=require(_0x7f54[10])[_0x7f54[11]];var Agent=require(_0x7f54[10])[_0x7f54[11]];var ChatRoom=require(_0x7f54[10])[_0x7f54[12]];var ChatMessage=require(_0x7f54[10])[_0x7f54[13]];var ChatWebsite=require(_0x7f54[10])[_0x7f54[14]];var ChatApplication=require(_0x7f54[10])[_0x7f54[15]];var ChatQueue=require(_0x7f54[10])[_0x7f54[16]];var ChatVisitor=require(_0x7f54[10])[_0x7f54[17]];var List=require(_0x7f54[10])[_0x7f54[18]];var UserHasChatRoom=require(_0x7f54[10])[_0x7f54[19]];exports[_0x7f54[20]]= function(_0x8db3x13,_0x8db3x14){return sequelize[_0x7f54[36]](util[_0x7f54[31]](_0x7f54[29],moment()[_0x7f54[33]](_0x7f54[32])[_0x7f54[31]](_0x7f54[30])),{type:sequelize[_0x7f54[35]][_0x7f54[34]]})[_0x7f54[28]](function(_0x8db3x16){var _0x8db3x17=_[_0x7f54[26]]({new:0,open:0,closed:0,abandon:0,unmanaged:0},_[_0x7f54[25]](_[_0x7f54[23]](_0x8db3x16,_0x7f54[22]),_0x7f54[24]));return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x17)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[37]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){return ChatRoom[_0x7f54[45]](_[_0x7f54[26]](Util[_0x7f54[38]](_0x8db3x13[_0x7f54[36]]),{include:[{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[42],_0x7f54[43],_0x7f54[44]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x7f54[28]](function(_0x8db3x19){_0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x19)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[46]]= function(_0x8db3x13,_0x8db3x14){return ChatRoom[_0x7f54[46]]()[_0x7f54[28]](function(_0x8db3x1a){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x1a)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};function getChatQueues(_0x8db3x1c){return function(){switch(_0x8db3x1c[_0x7f54[43]]){case _0x7f54[50]:return User[_0x7f54[49]](_0x8db3x1c[_0x7f54[39]],{attributes:[_0x7f54[39]]})[_0x7f54[28]](Util[_0x7f54[48]]({},{attributes:[_0x7f54[39]]}))[_0x7f54[28]](function(_0x8db3x1d){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0x7f54[47]](_0x8db3x1d,_0x7f54[39])}}}}}});default:return {}}}}exports[_0x7f54[51]]= function(_0x8db3x13,_0x8db3x14){return Promise[_0x7f54[53]]([])[_0x7f54[28]](getChatQueues(_0x8db3x13[_0x7f54[50]]))[_0x7f54[28]](function(_0x8db3x1f){return ChatRoom[_0x7f54[24]](_[_0x7f54[26]](Util[_0x7f54[38]](_0x8db3x13[_0x7f54[36]],{status:_0x7f54[52],updatedAt:{$gte:moment()[_0x7f54[33]](_0x7f54[32])}}),_0x8db3x1f))})[_0x7f54[28]](function(_0x8db3x1e){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]]({value:_0x8db3x1e})})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[54]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){var _0x8db3x20={tags:_0x8db3x13[_0x7f54[56]][_0x7f54[55]]};var _0x8db3x21={where:{id:_0x8db3x13[_0x7f54[59]][_0x7f54[39]][_0x7f54[58]](_0x7f54[57])}};return ChatRoom[_0x7f54[61]](_0x8db3x20,_0x8db3x21)[_0x7f54[28]](function(_0x8db3x22){if(!_0x8db3x22){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x22})[_0x7f54[28]](function(_0x8db3x22){return _0x8db3x14[_0x7f54[60]](200)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};function checkTags(_0x8db3x24){if(_0x8db3x24){if(_0x8db3x24[_0x7f54[55]]){_0x8db3x24[_0x7f54[62]]= [];if(_[_0x7f54[63]](_0x8db3x24[_0x7f54[55]])){for(var _0x8db3x25=0;_0x8db3x25< _0x8db3x24[_0x7f54[55]][_0x7f54[64]];_0x8db3x25++){_0x8db3x24[_0x7f54[62]][_0x7f54[67]]({tags:{$like:_0x7f54[65]+ _0x8db3x24[_0x7f54[55]][_0x8db3x25]+ _0x7f54[66]}})}}else {_0x8db3x24[_0x7f54[62]][_0x7f54[67]]({tags:{$like:_0x7f54[65]+ _0x8db3x24[_0x7f54[55]]+ _0x7f54[66]}})};delete _0x8db3x24[_0x7f54[55]]}}}exports[_0x7f54[68]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){switch(_0x8db3x13[_0x7f54[50]][_0x7f54[43]]){case _0x7f54[50]:return User[_0x7f54[49]](_0x8db3x13[_0x7f54[50]][_0x7f54[39]],{attributes:[_0x7f54[39]],where:{id:{$ne:_0x8db3x13[_0x7f54[50]][_0x7f54[39]]},online:true}})[_0x7f54[28]](Util[_0x7f54[69]](_[_0x7f54[26]](_0x8db3x13[_0x7f54[36]],{id:{$ne:_0x8db3x13[_0x7f54[50]][_0x7f54[39]]}})))[_0x7f54[28]](function(_0x8db3x19){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x19)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)});default:return User[_0x7f54[70]](_0x7f54[53])[_0x7f54[45]](_[_0x7f54[26]](Util[_0x7f54[38]](_0x8db3x13[_0x7f54[36]]),{where:{id:{$ne:_0x8db3x13[_0x7f54[50]][_0x7f54[39]]},online:true}}))[_0x7f54[28]](function(_0x8db3x19){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x19)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})}};exports[_0x7f54[71]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){checkTags(_0x8db3x13[_0x7f54[36]]);var _0x8db3x26={where:_[_0x7f54[26]]({type:_0x7f54[72]},_0x8db3x13[_0x7f54[36]])};switch(_0x8db3x13[_0x7f54[50]][_0x7f54[43]]){case _0x7f54[73]:_[_0x7f54[26]](_0x8db3x26,{include:[{model:User,attributes:[_0x7f54[39]],where:{id:_0x8db3x13[_0x7f54[50]][_0x7f54[39]]}}]});break;default:};return ChatRoom[_0x7f54[75]](_0x8db3x26)[_0x7f54[28]](function(_0x8db3x22){return ChatRoom[_0x7f54[75]]({where:{id:{$in:_[_0x7f54[47]](_0x8db3x22,_0x7f54[39])}},include:[{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[43],_0x7f54[74]]},{model:ChatVisitor}]})})[_0x7f54[28]](function(_0x8db3x22){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]]({rows:_0x8db3x22,count:_0x8db3x22[_0x7f54[64]]})})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[76]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){checkTags(_0x8db3x13[_0x7f54[36]]);var _0x8db3x26={where:_[_0x7f54[26]]({type:_0x7f54[77]},_0x8db3x13[_0x7f54[36]]),include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[41]]}]};switch(_0x8db3x13[_0x7f54[50]][_0x7f54[43]]){case _0x7f54[73]:_0x8db3x26[_0x7f54[78]][_0x7f54[67]]({model:User,attributes:[_0x7f54[39],_0x7f54[41]],where:{id:_0x8db3x13[_0x7f54[50]][_0x7f54[39]]}});break;default:_0x8db3x26[_0x7f54[78]][_0x7f54[67]]({model:User,attributes:[_0x7f54[39],_0x7f54[41]]})};return ChatRoom[_0x7f54[75]](_0x8db3x26)[_0x7f54[28]](function(_0x8db3x22){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]]({rows:_0x8db3x22,count:_0x8db3x22[_0x7f54[64]]})})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[79]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){return User[_0x7f54[70]](_0x7f54[53])[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x19){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x19)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[80]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){return ChatRoom[_0x7f54[70]](_0x7f54[81])[_0x7f54[45]](_[_0x7f54[26]](Util[_0x7f54[38]](_0x8db3x13[_0x7f54[36]]),{include:[{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[42],_0x7f54[43],_0x7f54[44]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0x7f54[28]](function(_0x8db3x19){_0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x19)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[82]]= function(_0x8db3x13,_0x8db3x14){return User[_0x7f54[49]](_0x8db3x13[_0x7f54[50]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x1c){return _0x8db3x1c[_0x7f54[83]]({include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[41],_0x7f54[42]]},{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[42],_0x7f54[43],_0x7f54[44]]}]})})[_0x7f54[28]](function(_0x8db3x22){if(!_0x8db3x22){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x14[_0x7f54[27]](_0x8db3x22)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[84]]= function(_0x8db3x13,_0x8db3x14){return ChatRoom[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[42],_0x7f54[41]]},{model:User,attributes:[_0x7f54[39],_0x7f54[42],_0x7f54[40],_0x7f54[41],_0x7f54[74],_0x7f54[43],_0x7f54[44]]}]},{model:User,attributes:[_0x7f54[39],_0x7f54[42],_0x7f54[40],_0x7f54[41],_0x7f54[74],_0x7f54[43],_0x7f54[44]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[85]],include:[List]}],order:[[ChatMessage,_0x7f54[39]]]})[_0x7f54[28]](function(_0x8db3x27){if(!_0x8db3x27){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x14[_0x7f54[27]](_0x8db3x27)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[86]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){var _0x8db3x28;return ChatRoom[_0x7f54[96]]({where:{token:md5(JSON[_0x7f54[94]](_0x8db3x13[_0x7f54[36]][_0x7f54[89]][_0x7f54[93]]())).toString(_0x7f54[92])},defaults:{type:_0x7f54[44],token:md5(JSON[_0x7f54[94]](_0x8db3x13[_0x7f54[36]][_0x7f54[89]][_0x7f54[93]]())).toString(_0x7f54[92]),status:_0x7f54[95]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[42],_0x7f54[41]]},{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[42],_0x7f54[43],_0x7f54[44]]}]},{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[42],_0x7f54[43],_0x7f54[44]]}]})[_0x7f54[91]](function(_0x8db3x27,_0x8db3x2a){_0x8db3x28= _0x8db3x27;if(_0x8db3x2a){return _0x8db3x28[_0x7f54[90]](_0x8db3x13[_0x7f54[36]][_0x7f54[89]])}})[_0x7f54[28]](function(){return _0x8db3x28[_0x7f54[88]]()})[_0x7f54[28]](function(_0x8db3x29){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_[_0x7f54[26]](_0x8db3x28[_0x7f54[87]],{Users:_0x8db3x29}))})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[97]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){var _0x8db3x28;return ChatRoom[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x27){_0x8db3x28= _0x8db3x27;if(!_0x8db3x28){return _0x8db3x14[_0x7f54[60]](404)}})[_0x7f54[28]](function(){return ChatMessage[_0x7f54[99]](_[_0x7f54[26]](_0x8db3x13[_0x7f54[56]],{type:_0x8db3x28[_0x7f54[98]],ChatRoomId:_0x8db3x13[_0x7f54[59]][_0x7f54[39]],UserId:_0x8db3x13[_0x7f54[50]][_0x7f54[39]]}))})[_0x7f54[28]](function(_0x8db3x2b){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x2b)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[100]]= function(_0x8db3x13,_0x8db3x14,_0x8db3x18){return ChatRoom[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[41]]},{model:User,attributes:[_0x7f54[39],_0x7f54[41]]}]}]})[_0x7f54[28]](function(_0x8db3x27){var _0x8db3x2c=[];if(_0x8db3x27[_0x7f54[101]]&& _0x8db3x27[_0x7f54[101]][_0x7f54[64]]> 0){_0x8db3x27[_0x7f54[101]][_0x7f54[105]](function(_0x8db3x2b){_0x8db3x2c[_0x7f54[67]]({name:_0x8db3x2b[_0x7f54[11]]?_0x8db3x2b[_0x7f54[11]][_0x7f54[41]]:_0x8db3x2b[_0x7f54[17]][_0x7f54[41]],text:_0x8db3x2b[_0x7f54[56]][_0x7f54[103]](/(\r\n|\n|\r)/gm,_0x7f54[102]),date:_0x8db3x2b[_0x7f54[104]]})})}else {_0x8db3x2c[_0x7f54[67]]({name:_0x7f54[106],text:_0x7f54[106],date:_0x7f54[106]})};var _0x8db3x2d=csv(_0x8db3x2c);_0x8db3x14[_0x7f54[98]](_0x7f54[107])[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x2d)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[108]]= function(_0x8db3x13,_0x8db3x14){return User[_0x7f54[49]](_0x8db3x13[_0x7f54[50]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x1c){return _0x8db3x1c[_0x7f54[83]]({where:{type:_0x8db3x13[_0x7f54[59]][_0x7f54[98]]},include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[41],_0x7f54[42]]}]})})[_0x7f54[28]](function(_0x8db3x22){if(!_0x8db3x22){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x14[_0x7f54[27]](_0x8db3x22)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[109]]= function(_0x8db3x13,_0x8db3x14){return User[_0x7f54[49]](_0x8db3x13[_0x7f54[50]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x1c){return _0x8db3x1c[_0x7f54[83]]({include:[{model:ChatVisitor,attributes:[_0x7f54[39],_0x7f54[41],_0x7f54[42]]},{model:User,attributes:[_0x7f54[39],_0x7f54[40],_0x7f54[41],_0x7f54[42],_0x7f54[43],_0x7f54[44]]}]})})[_0x7f54[28]](function(_0x8db3x22){if(!_0x8db3x22){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x14[_0x7f54[27]](_0x8db3x22)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[99]]= function(_0x8db3x13,_0x8db3x14){};exports[_0x7f54[61]]= function(_0x8db3x13,_0x8db3x14){if(_0x8db3x13[_0x7f54[56]][_0x7f54[39]]){delete _0x8db3x13[_0x7f54[56]][_0x7f54[39]]};return ChatRoom[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x27){if(!_0x8db3x27){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x27[_0x7f54[61]](_0x8db3x13[_0x7f54[56]])})[_0x7f54[28]](function(_0x8db3x27){return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x27)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[110]]= function(_0x8db3x13,_0x8db3x14){var _0x8db3x28;if(_0x8db3x13[_0x7f54[56]][_0x7f54[39]]){delete _0x8db3x13[_0x7f54[56]][_0x7f54[39]]};return ChatRoom[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x27){if(!_0x8db3x27||  !_0x8db3x13[_0x7f54[56]][_0x7f54[89]]){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x27})[_0x7f54[28]](function(_0x8db3x27){return _0x8db3x27[_0x7f54[61]]({type:_0x7f54[72],token:md5(JSON[_0x7f54[94]](_0x8db3x13[_0x7f54[56]][_0x7f54[89]][_0x7f54[93]]())).toString(_0x7f54[92])})})[_0x7f54[28]](function(_0x8db3x27){_0x8db3x28= _0x8db3x27;return _0x8db3x27[_0x7f54[90]](_0x8db3x13[_0x7f54[56]][_0x7f54[89]][_0x7f54[93]](),{individualHooks:true})})[_0x7f54[28]](function(){return _0x8db3x28[_0x7f54[88]]()})[_0x7f54[28]](function(_0x8db3x29){_[_0x7f54[26]](_0x8db3x28[_0x7f54[87]],{Users:_0x8db3x29});return _0x8db3x14[_0x7f54[22]](200)[_0x7f54[27]](_0x8db3x28)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};exports[_0x7f54[111]]= function(_0x8db3x13,_0x8db3x14){return ChatRoom[_0x7f54[49]](_0x8db3x13[_0x7f54[59]][_0x7f54[39]])[_0x7f54[28]](function(_0x8db3x27){if(!_0x8db3x27){return _0x8db3x14[_0x7f54[60]](404)};return _0x8db3x27[_0x7f54[111]]()})[_0x7f54[28]](function(){return _0x8db3x14[_0x7f54[60]](204)})[_0x7f54[21]](function(_0x8db3x15){return handleError(_0x8db3x14,_0x8db3x15)})};function handleError(_0x8db3x14,_0x8db3x15){logger[_0x7f54[113]](_0x8db3x15[_0x7f54[112]]);return _0x8db3x14[_0x7f54[22]](500)[_0x7f54[27]](_0x8db3x15)}
\ No newline at end of file
+var _0xe8dc=["\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\x57\x48\x45\x52\x45\x20\x63\x72\x65\x61\x74\x65\x64\x41\x74\x20\x3E\x3D\x20\x27\x25\x73\x27\x20\x47\x52\x4F\x55\x50\x20\x42\x59\x20\x73\x74\x61\x74\x75\x73","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\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","\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","\x43\x68\x61\x74\x4D\x65\x73\x73\x61\x67\x65\x73","\x20","\x72\x65\x70\x6C\x61\x63\x65","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x66\x6F\x72\x45\x61\x63\x68","","\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"];_0xe8dc[0];var _=require(_0xe8dc[1]);var md5=require(_0xe8dc[2]);var moment=require(_0xe8dc[3]);var csv=require(_0xe8dc[4]);var util=require(_0xe8dc[5]);var logger=require(_0xe8dc[7])(_0xe8dc[6]);var Util=require(_0xe8dc[8]);var sequelize=require(_0xe8dc[10])[_0xe8dc[9]];var User=require(_0xe8dc[10])[_0xe8dc[11]];var Agent=require(_0xe8dc[10])[_0xe8dc[11]];var ChatRoom=require(_0xe8dc[10])[_0xe8dc[12]];var ChatMessage=require(_0xe8dc[10])[_0xe8dc[13]];var ChatWebsite=require(_0xe8dc[10])[_0xe8dc[14]];var ChatApplication=require(_0xe8dc[10])[_0xe8dc[15]];var ChatQueue=require(_0xe8dc[10])[_0xe8dc[16]];var ChatVisitor=require(_0xe8dc[10])[_0xe8dc[17]];var List=require(_0xe8dc[10])[_0xe8dc[18]];var UserHasChatRoom=require(_0xe8dc[10])[_0xe8dc[19]];exports[_0xe8dc[20]]= function(_0x527ex13,_0x527ex14){return sequelize[_0xe8dc[36]](util[_0xe8dc[31]](_0xe8dc[29],moment()[_0xe8dc[33]](_0xe8dc[32])[_0xe8dc[31]](_0xe8dc[30])),{type:sequelize[_0xe8dc[35]][_0xe8dc[34]]})[_0xe8dc[28]](function(_0x527ex16){var _0x527ex17=_[_0xe8dc[26]]({new:0,open:0,closed:0,abandon:0,unmanaged:0},_[_0xe8dc[25]](_[_0xe8dc[23]](_0x527ex16,_0xe8dc[22]),_0xe8dc[24]));return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex17)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[37]]= function(_0x527ex13,_0x527ex14,_0x527ex18){return ChatRoom[_0xe8dc[45]](_[_0xe8dc[26]](Util[_0xe8dc[38]](_0x527ex13[_0xe8dc[36]]),{include:[{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[42],_0xe8dc[43],_0xe8dc[44]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0xe8dc[28]](function(_0x527ex19){_0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex19)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[46]]= function(_0x527ex13,_0x527ex14){return ChatRoom[_0xe8dc[46]]()[_0xe8dc[28]](function(_0x527ex1a){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex1a)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};function getChatQueues(_0x527ex1c){return function(){switch(_0x527ex1c[_0xe8dc[43]]){case _0xe8dc[50]:return User[_0xe8dc[49]](_0x527ex1c[_0xe8dc[39]],{attributes:[_0xe8dc[39]]})[_0xe8dc[28]](Util[_0xe8dc[48]]({},{attributes:[_0xe8dc[39]]}))[_0xe8dc[28]](function(_0x527ex1d){return {include:{model:ChatWebsite,include:{model:ChatApplication,include:{model:ChatQueue,where:{id:_[_0xe8dc[47]](_0x527ex1d,_0xe8dc[39])}}}}}});default:return {}}}}exports[_0xe8dc[51]]= function(_0x527ex13,_0x527ex14){return Promise[_0xe8dc[53]]([])[_0xe8dc[28]](getChatQueues(_0x527ex13[_0xe8dc[50]]))[_0xe8dc[28]](function(_0x527ex1f){return ChatRoom[_0xe8dc[24]](_[_0xe8dc[26]](Util[_0xe8dc[38]](_0x527ex13[_0xe8dc[36]],{status:_0xe8dc[52],updatedAt:{$gte:moment()[_0xe8dc[33]](_0xe8dc[32])}}),_0x527ex1f))})[_0xe8dc[28]](function(_0x527ex1e){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]]({value:_0x527ex1e})})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[54]]= function(_0x527ex13,_0x527ex14,_0x527ex18){var _0x527ex20={tags:_0x527ex13[_0xe8dc[56]][_0xe8dc[55]]};var _0x527ex21={where:{id:_0x527ex13[_0xe8dc[59]][_0xe8dc[39]][_0xe8dc[58]](_0xe8dc[57])}};return ChatRoom[_0xe8dc[61]](_0x527ex20,_0x527ex21)[_0xe8dc[28]](function(_0x527ex22){if(!_0x527ex22){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex22})[_0xe8dc[28]](function(_0x527ex22){return _0x527ex14[_0xe8dc[60]](200)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};function checkTags(_0x527ex24){if(_0x527ex24){if(_0x527ex24[_0xe8dc[55]]){_0x527ex24[_0xe8dc[62]]= [];if(_[_0xe8dc[63]](_0x527ex24[_0xe8dc[55]])){for(var _0x527ex25=0;_0x527ex25< _0x527ex24[_0xe8dc[55]][_0xe8dc[64]];_0x527ex25++){_0x527ex24[_0xe8dc[62]][_0xe8dc[67]]({tags:{$like:_0xe8dc[65]+ _0x527ex24[_0xe8dc[55]][_0x527ex25]+ _0xe8dc[66]}})}}else {_0x527ex24[_0xe8dc[62]][_0xe8dc[67]]({tags:{$like:_0xe8dc[65]+ _0x527ex24[_0xe8dc[55]]+ _0xe8dc[66]}})};delete _0x527ex24[_0xe8dc[55]]}}}exports[_0xe8dc[68]]= function(_0x527ex13,_0x527ex14,_0x527ex18){switch(_0x527ex13[_0xe8dc[50]][_0xe8dc[43]]){case _0xe8dc[50]:return User[_0xe8dc[49]](_0x527ex13[_0xe8dc[50]][_0xe8dc[39]],{attributes:[_0xe8dc[39]],where:{id:{$ne:_0x527ex13[_0xe8dc[50]][_0xe8dc[39]]},online:true}})[_0xe8dc[28]](Util[_0xe8dc[69]](_[_0xe8dc[26]](_0x527ex13[_0xe8dc[36]],{id:{$ne:_0x527ex13[_0xe8dc[50]][_0xe8dc[39]]}})))[_0xe8dc[28]](function(_0x527ex19){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex19)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)});default:return User[_0xe8dc[70]](_0xe8dc[53])[_0xe8dc[45]](_[_0xe8dc[26]](Util[_0xe8dc[38]](_0x527ex13[_0xe8dc[36]]),{where:{id:{$ne:_0x527ex13[_0xe8dc[50]][_0xe8dc[39]]},online:true}}))[_0xe8dc[28]](function(_0x527ex19){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex19)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})}};exports[_0xe8dc[71]]= function(_0x527ex13,_0x527ex14,_0x527ex18){checkTags(_0x527ex13[_0xe8dc[36]]);var _0x527ex26={where:_[_0xe8dc[26]]({type:_0xe8dc[72]},_0x527ex13[_0xe8dc[36]])};switch(_0x527ex13[_0xe8dc[50]][_0xe8dc[43]]){case _0xe8dc[73]:_[_0xe8dc[26]](_0x527ex26,{include:[{model:User,attributes:[_0xe8dc[39]],where:{id:_0x527ex13[_0xe8dc[50]][_0xe8dc[39]]}}]});break;default:};return ChatRoom[_0xe8dc[75]](_0x527ex26)[_0xe8dc[28]](function(_0x527ex22){return ChatRoom[_0xe8dc[75]]({where:{id:{$in:_[_0xe8dc[47]](_0x527ex22,_0xe8dc[39])}},include:[{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[43],_0xe8dc[74]]},{model:ChatVisitor}]})})[_0xe8dc[28]](function(_0x527ex22){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]]({rows:_0x527ex22,count:_0x527ex22[_0xe8dc[64]]})})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[76]]= function(_0x527ex13,_0x527ex14,_0x527ex18){checkTags(_0x527ex13[_0xe8dc[36]]);var _0x527ex26={where:_[_0xe8dc[26]]({type:_0xe8dc[77]},_0x527ex13[_0xe8dc[36]]),include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[41]]}]};switch(_0x527ex13[_0xe8dc[50]][_0xe8dc[43]]){case _0xe8dc[73]:_0x527ex26[_0xe8dc[78]][_0xe8dc[67]]({model:User,attributes:[_0xe8dc[39],_0xe8dc[41]],where:{id:_0x527ex13[_0xe8dc[50]][_0xe8dc[39]]}});break;default:_0x527ex26[_0xe8dc[78]][_0xe8dc[67]]({model:User,attributes:[_0xe8dc[39],_0xe8dc[41]]})};return ChatRoom[_0xe8dc[75]](_0x527ex26)[_0xe8dc[28]](function(_0x527ex22){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]]({rows:_0x527ex22,count:_0x527ex22[_0xe8dc[64]]})})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[79]]= function(_0x527ex13,_0x527ex14,_0x527ex18){return User[_0xe8dc[70]](_0xe8dc[53])[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex19){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex19)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[80]]= function(_0x527ex13,_0x527ex14,_0x527ex18){return ChatRoom[_0xe8dc[70]](_0xe8dc[81])[_0xe8dc[45]](_[_0xe8dc[26]](Util[_0xe8dc[38]](_0x527ex13[_0xe8dc[36]]),{include:[{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[42],_0xe8dc[43],_0xe8dc[44]]},{model:ChatMessage},{model:ChatVisitor}]}))[_0xe8dc[28]](function(_0x527ex19){_0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex19)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[82]]= function(_0x527ex13,_0x527ex14){return User[_0xe8dc[49]](_0x527ex13[_0xe8dc[50]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex1c){return _0x527ex1c[_0xe8dc[83]]({include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[41],_0xe8dc[42]]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[42],_0xe8dc[43],_0xe8dc[44]]}]})})[_0xe8dc[28]](function(_0x527ex22){if(!_0x527ex22){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex14[_0xe8dc[27]](_0x527ex22)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[84]]= function(_0x527ex13,_0x527ex14){return ChatRoom[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[42],_0xe8dc[41]]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[42],_0xe8dc[40],_0xe8dc[41],_0xe8dc[74],_0xe8dc[43],_0xe8dc[44]]}]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[42],_0xe8dc[40],_0xe8dc[41],_0xe8dc[74],_0xe8dc[43],_0xe8dc[44]]},{model:ChatVisitor},{model:ChatWebsite,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[85]],include:[List]}],order:[[ChatMessage,_0xe8dc[39]]]})[_0xe8dc[28]](function(_0x527ex27){if(!_0x527ex27){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex14[_0xe8dc[27]](_0x527ex27)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[86]]= function(_0x527ex13,_0x527ex14,_0x527ex18){var _0x527ex28;return ChatRoom[_0xe8dc[96]]({where:{token:md5(JSON[_0xe8dc[94]](_0x527ex13[_0xe8dc[36]][_0xe8dc[89]][_0xe8dc[93]]())).toString(_0xe8dc[92])},defaults:{type:_0xe8dc[44],token:md5(JSON[_0xe8dc[94]](_0x527ex13[_0xe8dc[36]][_0xe8dc[89]][_0xe8dc[93]]())).toString(_0xe8dc[92]),status:_0xe8dc[95]},include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[42],_0xe8dc[41]]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[42],_0xe8dc[43],_0xe8dc[44]]}]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[42],_0xe8dc[43],_0xe8dc[44]]}]})[_0xe8dc[91]](function(_0x527ex27,_0x527ex2a){_0x527ex28= _0x527ex27;if(_0x527ex2a){return _0x527ex28[_0xe8dc[90]](_0x527ex13[_0xe8dc[36]][_0xe8dc[89]])}})[_0xe8dc[28]](function(){return _0x527ex28[_0xe8dc[88]]()})[_0xe8dc[28]](function(_0x527ex29){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_[_0xe8dc[26]](_0x527ex28[_0xe8dc[87]],{Users:_0x527ex29}))})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[97]]= function(_0x527ex13,_0x527ex14,_0x527ex18){var _0x527ex28;return ChatRoom[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex27){_0x527ex28= _0x527ex27;if(!_0x527ex28){return _0x527ex14[_0xe8dc[60]](404)}})[_0xe8dc[28]](function(){return ChatMessage[_0xe8dc[99]](_[_0xe8dc[26]](_0x527ex13[_0xe8dc[56]],{type:_0x527ex28[_0xe8dc[98]],ChatRoomId:_0x527ex13[_0xe8dc[59]][_0xe8dc[39]],UserId:_0x527ex13[_0xe8dc[50]][_0xe8dc[39]]}))})[_0xe8dc[28]](function(_0x527ex2b){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex2b)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[100]]= function(_0x527ex13,_0x527ex14,_0x527ex18){return ChatRoom[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]],{include:[{model:ChatMessage,include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[41]]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[41]]}]}]})[_0xe8dc[28]](function(_0x527ex27){var _0x527ex2c=[];if(_0x527ex27[_0xe8dc[101]]&& _0x527ex27[_0xe8dc[101]][_0xe8dc[64]]> 0){_0x527ex27[_0xe8dc[101]][_0xe8dc[105]](function(_0x527ex2b){_0x527ex2c[_0xe8dc[67]]({name:_0x527ex2b[_0xe8dc[11]]?_0x527ex2b[_0xe8dc[11]][_0xe8dc[41]]:_0x527ex2b[_0xe8dc[17]][_0xe8dc[41]],text:_0x527ex2b[_0xe8dc[56]][_0xe8dc[103]](/(\r\n|\n|\r)/gm,_0xe8dc[102]),date:_0x527ex2b[_0xe8dc[104]]})})}else {_0x527ex2c[_0xe8dc[67]]({name:_0xe8dc[106],text:_0xe8dc[106],date:_0xe8dc[106]})};var _0x527ex2d=csv(_0x527ex2c);_0x527ex14[_0xe8dc[98]](_0xe8dc[107])[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex2d)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[108]]= function(_0x527ex13,_0x527ex14){return User[_0xe8dc[49]](_0x527ex13[_0xe8dc[50]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex1c){return _0x527ex1c[_0xe8dc[83]]({where:{type:_0x527ex13[_0xe8dc[59]][_0xe8dc[98]]},include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[41],_0xe8dc[42]]}]})})[_0xe8dc[28]](function(_0x527ex22){if(!_0x527ex22){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex14[_0xe8dc[27]](_0x527ex22)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[109]]= function(_0x527ex13,_0x527ex14){return User[_0xe8dc[49]](_0x527ex13[_0xe8dc[50]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex1c){return _0x527ex1c[_0xe8dc[83]]({include:[{model:ChatVisitor,attributes:[_0xe8dc[39],_0xe8dc[41],_0xe8dc[42]]},{model:User,attributes:[_0xe8dc[39],_0xe8dc[40],_0xe8dc[41],_0xe8dc[42],_0xe8dc[43],_0xe8dc[44]]}]})})[_0xe8dc[28]](function(_0x527ex22){if(!_0x527ex22){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex14[_0xe8dc[27]](_0x527ex22)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[99]]= function(_0x527ex13,_0x527ex14){};exports[_0xe8dc[61]]= function(_0x527ex13,_0x527ex14){if(_0x527ex13[_0xe8dc[56]][_0xe8dc[39]]){delete _0x527ex13[_0xe8dc[56]][_0xe8dc[39]]};return ChatRoom[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex27){if(!_0x527ex27){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex27[_0xe8dc[61]](_0x527ex13[_0xe8dc[56]])})[_0xe8dc[28]](function(_0x527ex27){return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex27)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[110]]= function(_0x527ex13,_0x527ex14){var _0x527ex28;if(_0x527ex13[_0xe8dc[56]][_0xe8dc[39]]){delete _0x527ex13[_0xe8dc[56]][_0xe8dc[39]]};return ChatRoom[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex27){if(!_0x527ex27||  !_0x527ex13[_0xe8dc[56]][_0xe8dc[89]]){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex27})[_0xe8dc[28]](function(_0x527ex27){return _0x527ex27[_0xe8dc[61]]({type:_0xe8dc[72],token:md5(JSON[_0xe8dc[94]](_0x527ex13[_0xe8dc[56]][_0xe8dc[89]][_0xe8dc[93]]())).toString(_0xe8dc[92])})})[_0xe8dc[28]](function(_0x527ex27){_0x527ex28= _0x527ex27;return _0x527ex27[_0xe8dc[90]](_0x527ex13[_0xe8dc[56]][_0xe8dc[89]][_0xe8dc[93]](),{individualHooks:true})})[_0xe8dc[28]](function(){return _0x527ex28[_0xe8dc[88]]()})[_0xe8dc[28]](function(_0x527ex29){_[_0xe8dc[26]](_0x527ex28[_0xe8dc[87]],{Users:_0x527ex29});return _0x527ex14[_0xe8dc[22]](200)[_0xe8dc[27]](_0x527ex28)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};exports[_0xe8dc[111]]= function(_0x527ex13,_0x527ex14){return ChatRoom[_0xe8dc[49]](_0x527ex13[_0xe8dc[59]][_0xe8dc[39]])[_0xe8dc[28]](function(_0x527ex27){if(!_0x527ex27){return _0x527ex14[_0xe8dc[60]](404)};return _0x527ex27[_0xe8dc[111]]()})[_0xe8dc[28]](function(){return _0x527ex14[_0xe8dc[60]](204)})[_0xe8dc[21]](function(_0x527ex15){return handleError(_0x527ex14,_0x527ex15)})};function handleError(_0x527ex14,_0x527ex15){logger[_0xe8dc[113]](_0x527ex15[_0xe8dc[112]]);return _0x527ex14[_0xe8dc[22]](500)[_0xe8dc[27]](_0x527ex15)}
\ No newline at end of file