Built motion from commit 8613b0174.|1.0.22
[motion.git] / server / api / agent / agent.controller.js
1 var _0x8def=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x62\x6C\x75\x65\x62\x69\x72\x64","\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x74\x6F\x6F\x6C\x73\x2F\x75\x73\x65\x72","\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","\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x46\x61\x78\x51\x75\x65\x75\x65","\x53\x6D\x73\x51\x75\x65\x75\x65","\x4D\x61\x69\x6C\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67","\x55\x73\x65\x72","\x54\x65\x61\x6D","\x4C\x69\x73\x74","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x74\x68\x65\x6E","\x71\x75\x65\x72\x79","\x67\x65\x74\x41\x67\x65\x6E\x74\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x69\x64","\x75\x73\x65\x72","\x66\x69\x6E\x64\x42\x79\x49\x64","\x67\x65\x74\x51\x75\x65\x72\x79","\x66\x69\x6E\x64\x41\x6E\x64\x43\x6F\x75\x6E\x74\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x72\x6F\x6C\x65","\x61\x64\x64\x51\x75\x65\x75\x65\x73","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x76\x61\x6C\x75\x65\x73","\x62\x6F\x64\x79","\x53\x49\x50\x2F\x25\x73","\x6E\x61\x6D\x65","\x66\x6F\x72\x6D\x61\x74","\x70\x65\x6E\x61\x6C\x74\x79","\x61\x64\x64\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x76\x6F\x69\x63\x65","\x61\x64\x64\x43\x68\x61\x74\x51\x75\x65\x75\x65","\x70\x75\x73\x68","\x66\x6F\x72\x45\x61\x63\x68","\x61\x6C\x6C","\x66\x69\x6E\x64\x41\x6C\x6C","\x63\x68\x61\x74","\x61\x64\x64\x4D\x61\x69\x6C\x51\x75\x65\x75\x65","\x6D\x61\x69\x6C","\x61\x64\x64\x46\x61\x78\x51\x75\x65\x75\x65","\x66\x61\x78","\x61\x64\x64\x53\x6D\x73\x51\x75\x65\x75\x65","\x73\x6D\x73","\x61\x64\x64\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65","\x6F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x6E\x6E\x65\x6C","\x70\x61\x72\x61\x6D\x73","\x72\x65\x6D\x6F\x76\x65\x51\x75\x65\x75\x65\x73","\x69\x64\x73","\x72\x65\x6D\x6F\x76\x65\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x72\x65\x6D\x6F\x76\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x49\x6E\x64\x65\x78","\x63\x68\x65\x63\x6B\x50\x61\x75\x73\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x51\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x4F\x6E\x6C\x69\x6E\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x65\x63\x6B\x53\x69\x70\x53\x74\x61\x74\x75\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x56\x6F\x69\x63\x65\x49\x6E\x64\x65\x78","\x72\x6F\x77\x73","\x6D\x61\x70","\x75\x6E\x69\x6F\x6E","\x6D\x65\x72\x67\x65","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x43\x68\x61\x74\x49\x6E\x64\x65\x78","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x71\x75\x65\x75\x65\x73","\x72\x65\x61\x6C\x74\x69\x6D\x65\x4D\x61\x69\x6C\x49\x6E\x64\x65\x78","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x46\x61\x78\x49\x6E\x64\x65\x78","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x53\x6D\x73\x49\x6E\x64\x65\x78","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x72\x65\x61\x6C\x74\x69\x6D\x65\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x49\x6E\x64\x65\x78","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73\x49\x64\x42\x79\x55\x73\x65\x72","\x73\x68\x6F\x77","\x73\x68\x6F\x77\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x6C\x65\x6E\x67\x74\x68","\x67\x65\x74\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x43\x68\x61\x74\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x4D\x61\x69\x6C\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x46\x61\x78\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x53\x6D\x73\x51\x75\x65\x75\x65\x73","\x73\x68\x6F\x77\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x67\x65\x74\x4F\x70\x65\x6E\x63\x68\x61\x6E\x6E\x65\x6C\x51\x75\x65\x75\x65\x73","\x63\x72\x65\x61\x74\x65","\x68\x61\x6E\x64\x6C\x65\x55\x6E\x69\x71\x75\x65\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x65\x72\x72\x6F\x72\x4D\x61\x6E\x61\x67\x65\x72","\x61\x64\x64\x55\x73\x65\x72","\x66\x69\x6E\x64\x4F\x6E\x65","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x70\x61\x73\x73\x77\x6F\x72\x64","\x73\x65\x63\x75\x72\x65\x50\x61\x73\x73\x77\x6F\x72\x64","\x74\x65\x73\x74","\x57\x72\x6F\x6E\x67\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x66\x6F\x72\x6D\x61\x74\x21","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x61\x64\x64\x55\x73\x65\x72\x73","\x49\x6E\x76\x61\x6C\x69\x64\x20\x70\x61\x73\x73\x77\x6F\x72\x64\x20\x70\x61\x74\x74\x65\x72\x6E","\x73\x74\x61\x72\x74\x49\x6E\x64\x65\x78","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x69\x73\x4E\x75\x6D\x62\x65\x72","\x6D\x69\x6E\x49\x6E\x74\x65\x72\x6E\x61\x6C","\x61\x6D\x6F\x75\x6E\x74","\x63\x6C\x6F\x6E\x65","\x69\x6E\x74\x65\x72\x6E\x61\x6C","\x66\x75\x6C\x6C\x6E\x61\x6D\x65","\x65\x6D\x61\x69\x6C","\x40","\x73\x70\x6C\x69\x74","\x4E\x6F\x20\x61\x67\x65\x6E\x74\x73\x20\x61\x6D\x6F\x75\x6E\x74\x20\x73\x70\x65\x63\x69\x66\x69\x65\x64\x21","\x75\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x73\x61\x76\x65","\x64\x65\x73\x74\x72\x6F\x79","\x68\x61\x6E\x64\x6C\x65\x46\x6F\x72\x65\x69\x67\x6E\x4B\x65\x79\x43\x6F\x6E\x73\x74\x72\x61\x69\x6E\x74\x45\x72\x72\x6F\x72","\x62\x75\x6C\x6B\x44\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72"];_0x8def[0];var _=require(_0x8def[1]);var sequelize=require(_0x8def[3])[_0x8def[2]];var BPromise=require(_0x8def[4]);var util=require(_0x8def[5]);var Util=require(_0x8def[6]);var userTools=require(_0x8def[7]);var logger=require(_0x8def[9])(_0x8def[8]);var OpenchannelQueue=require(_0x8def[3])[_0x8def[10]];var VoiceQueue=require(_0x8def[3])[_0x8def[11]];var ChatQueue=require(_0x8def[3])[_0x8def[12]];var MailQueue=require(_0x8def[3])[_0x8def[13]];var FaxQueue=require(_0x8def[3])[_0x8def[14]];var SmsQueue=require(_0x8def[3])[_0x8def[15]];var MailRoom=require(_0x8def[3])[_0x8def[16]];var Setting=require(_0x8def[3])[_0x8def[17]];var Agent=require(_0x8def[3])[_0x8def[18]];var User=require(_0x8def[3])[_0x8def[18]];var Team=require(_0x8def[3])[_0x8def[19]];var List=require(_0x8def[3])[_0x8def[20]];exports[_0x8def[21]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[27]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33])[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[36]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){return Agent[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]],{attributes:[_0x8def[28],_0x8def[41]]})[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](401)};switch(_0x7abcx14[_0x8def[61]][_0x8def[60]]){case _0x8def[45]:return _0x7abcx1a[_0x8def[44]](_0x7abcx14[_0x8def[39]][_0x8def[38]],{interface:util[_0x8def[42]](_0x8def[40],_0x7abcx1a[_0x8def[41]]),stateinterface:util[_0x8def[42]](_0x8def[40],_0x7abcx1a[_0x8def[41]]),membername:_0x7abcx1a[_0x8def[41]],UserId:_0x7abcx1a[_0x8def[28]],penalty:_0x7abcx14[_0x8def[39]][_0x8def[43]]});case _0x8def[51]:return ChatQueue[_0x8def[50]]({where:{id:_0x7abcx14[_0x8def[39]][_0x8def[38]]},attributes:[_0x8def[28],_0x8def[41]],raw:true})[_0x8def[25]](function(_0x7abcx19){if(_0x7abcx19){var _0x7abcx1b=[];_[_0x8def[48]](_0x7abcx19,function(_0x7abcx1c){_0x7abcx1b[_0x8def[47]](_0x7abcx1a[_0x8def[46]](_0x7abcx1c[_0x8def[28]],{queue:_0x7abcx1c[_0x8def[41]],penalty:_0x7abcx14[_0x8def[39]][_0x8def[43]]}))});return BPromise[_0x8def[49]](_0x7abcx1b)}});case _0x8def[53]:return MailQueue[_0x8def[50]]({where:{id:_0x7abcx14[_0x8def[39]][_0x8def[38]]},attributes:[_0x8def[28],_0x8def[41]],raw:true})[_0x8def[25]](function(_0x7abcx19){if(_0x7abcx19){var _0x7abcx1b=[];_[_0x8def[48]](_0x7abcx19,function(_0x7abcx1c){_0x7abcx1b[_0x8def[47]](_0x7abcx1a[_0x8def[52]](_0x7abcx1c[_0x8def[28]],{queue:_0x7abcx1c[_0x8def[41]],penalty:_0x7abcx14[_0x8def[39]][_0x8def[43]]}))});return BPromise[_0x8def[49]](_0x7abcx1b)}});case _0x8def[55]:return FaxQueue[_0x8def[50]]({where:{id:_0x7abcx14[_0x8def[39]][_0x8def[38]]},attributes:[_0x8def[28],_0x8def[41]],raw:true})[_0x8def[25]](function(_0x7abcx19){if(_0x7abcx19){var _0x7abcx1b=[];_[_0x8def[48]](_0x7abcx19,function(_0x7abcx1c){_0x7abcx1b[_0x8def[47]](_0x7abcx1a[_0x8def[54]](_0x7abcx1c[_0x8def[28]],{queue:_0x7abcx1c[_0x8def[41]],penalty:_0x7abcx14[_0x8def[39]][_0x8def[43]]}))});return BPromise[_0x8def[49]](_0x7abcx1b)}});case _0x8def[57]:return SmsQueue[_0x8def[50]]({where:{id:_0x7abcx14[_0x8def[39]][_0x8def[38]]},attributes:[_0x8def[28],_0x8def[41]],raw:true})[_0x8def[25]](function(_0x7abcx19){if(_0x7abcx19){var _0x7abcx1b=[];_[_0x8def[48]](_0x7abcx19,function(_0x7abcx1c){_0x7abcx1b[_0x8def[47]](_0x7abcx1a[_0x8def[56]](_0x7abcx1c[_0x8def[28]],{queue:_0x7abcx1c[_0x8def[41]],penalty:_0x7abcx14[_0x8def[39]][_0x8def[43]]}))});return BPromise[_0x8def[49]](_0x7abcx1b)}});case _0x8def[59]:return OpenchannelQueue[_0x8def[50]]({where:{id:_0x7abcx14[_0x8def[39]][_0x8def[38]]},attributes:[_0x8def[28],_0x8def[41]],raw:true})[_0x8def[25]](function(_0x7abcx19){if(_0x7abcx19){var _0x7abcx1b=[];_[_0x8def[48]](_0x7abcx19,function(_0x7abcx1c){_0x7abcx1b[_0x8def[47]](_0x7abcx1a[_0x8def[58]](_0x7abcx1c[_0x8def[28]],{queue:_0x7abcx1c[_0x8def[41]],penalty:_0x7abcx14[_0x8def[39]][_0x8def[43]]}))});return BPromise[_0x8def[49]](_0x7abcx1b)}});default:return null}})[_0x8def[25]](function(_0x7abcx19){return _0x7abcx15[_0x8def[37]](_0x7abcx19?200:401)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[62]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){return Agent[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](401)};switch(_0x7abcx14[_0x8def[61]][_0x8def[60]]){case _0x8def[45]:return _0x7abcx1a[_0x8def[64]](_0x7abcx14[_0x8def[26]][_0x8def[63]]);case _0x8def[51]:return _0x7abcx1a[_0x8def[65]](_0x7abcx14[_0x8def[26]][_0x8def[63]]);case _0x8def[53]:return _0x7abcx1a[_0x8def[66]](_0x7abcx14[_0x8def[26]][_0x8def[63]]);case _0x8def[57]:return _0x7abcx1a[_0x8def[67]](_0x7abcx14[_0x8def[26]][_0x8def[63]]);case _0x8def[55]:return _0x7abcx1a[_0x8def[68]](_0x7abcx14[_0x8def[26]][_0x8def[63]]);case _0x8def[59]:return _0x7abcx1a[_0x8def[69]](_0x7abcx14[_0x8def[26]][_0x8def[63]]);default:return null}})[_0x8def[25]](function(_0x7abcx19){return _0x7abcx15[_0x8def[37]](_0x7abcx19?200:401)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[70]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[27]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[75]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:var _0x7abcx1d=[];return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[80]]({},{attributes:[_0x8def[41]],include:[{raw:true,model:User,attributes:[_0x8def[28]]}]}))[_0x8def[25]](function(_0x7abcx19){var _0x7abcx1e=_[_0x8def[77]](_0x7abcx19[_0x8def[76]],_0x8def[41]);_0x7abcx19[_0x8def[76]][_0x8def[48]](function(_0x7abcx1c){_0x7abcx1d= _[_0x8def[78]](_0x7abcx1d,_[_0x8def[77]](_0x7abcx1c.Users,_0x8def[28]))});return User[_0x8def[34]](_0x8def[33],{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](_[_0x8def[79]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]],{id:{$in:_0x7abcx1d}}),{include:[{model:VoiceQueue,where:{name:{$in:_0x7abcx1e}},required:false}]}))})[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[81]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:var _0x7abcx1d=[];return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[82]]({},{attributes:[_0x8def[28]],include:[{raw:true,model:User,attributes:[_0x8def[28]]}]}))[_0x8def[25]](function(_0x7abcx19){var _0x7abcx1f=_[_0x8def[77]](_0x7abcx19[_0x8def[76]],_0x8def[28]);_0x7abcx19[_0x8def[76]][_0x8def[48]](function(_0x7abcx1c){_0x7abcx1d= _[_0x8def[78]](_0x7abcx1d,_[_0x8def[77]](_0x7abcx1c.Users,_0x8def[28]))});return User[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](_[_0x8def[79]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]],{id:{$in:_0x7abcx1d}}),{include:[{model:ChatQueue,where:{id:{$in:_0x7abcx1f}},required:false}]}))})[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]},_0x8def[83])[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[84]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:var _0x7abcx1d=[];return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[85]]({},{attributes:[_0x8def[28]],include:[{raw:true,model:User,attributes:[_0x8def[28]]}]}))[_0x8def[25]](function(_0x7abcx19){var _0x7abcx20=_[_0x8def[77]](_0x7abcx19[_0x8def[76]],_0x8def[28]);_0x7abcx19[_0x8def[76]][_0x8def[48]](function(_0x7abcx1c){_0x7abcx1d= _[_0x8def[78]](_0x7abcx1d,_[_0x8def[77]](_0x7abcx1c.Users,_0x8def[28]))});return User[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](_[_0x8def[79]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]],{id:{$in:_0x7abcx1d}}),{include:[{model:MailQueue,where:{id:{$in:_0x7abcx20}},required:false}]}))})[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]},_0x8def[83])[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[86]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:var _0x7abcx1d=[];return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[87]]({},{attributes:[_0x8def[28]],include:[{raw:true,model:User,attributes:[_0x8def[28]]}]}))[_0x8def[25]](function(_0x7abcx19){var _0x7abcx21=_[_0x8def[77]](_0x7abcx19[_0x8def[76]],_0x8def[28]);_0x7abcx19[_0x8def[76]][_0x8def[48]](function(_0x7abcx1c){_0x7abcx1d= _[_0x8def[78]](_0x7abcx1d,_[_0x8def[77]](_0x7abcx1c.Users,_0x8def[28]))});return User[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](_[_0x8def[79]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]],{id:{$in:_0x7abcx1d}}),{include:[{model:FaxQueue,where:{id:{$in:_0x7abcx21}},required:false}]}))})[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]},_0x8def[83])[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[88]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:var _0x7abcx1d=[];return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[89]]({},{attributes:[_0x8def[28]],include:[{raw:true,model:User,attributes:[_0x8def[28]]}]}))[_0x8def[25]](function(_0x7abcx19){var _0x7abcx22=_[_0x8def[77]](_0x7abcx19[_0x8def[76]],_0x8def[28]);_0x7abcx19[_0x8def[76]][_0x8def[48]](function(_0x7abcx1c){_0x7abcx1d= _[_0x8def[78]](_0x7abcx1d,_[_0x8def[77]](_0x7abcx1c.Users,_0x8def[28]))});return User[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](_[_0x8def[79]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]],{id:{$in:_0x7abcx1d}}),{include:[{model:SmsQueue,where:{id:{$in:_0x7abcx22}},required:false}]}))})[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]},_0x8def[83])[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[90]]= function(_0x7abcx14,_0x7abcx15,_0x7abcx16){switch(_0x7abcx14[_0x8def[29]][_0x8def[35]]){case _0x8def[29]:var _0x7abcx1d=[];return User[_0x8def[30]](_0x7abcx14[_0x8def[29]][_0x8def[28]],{attributes:[_0x8def[28]]})[_0x8def[25]](Util[_0x8def[91]]({},{attributes:[_0x8def[28]],include:[{raw:true,model:User,attributes:[_0x8def[28]]}]}))[_0x8def[25]](function(_0x7abcx19){var _0x7abcx23=_[_0x8def[77]](_0x7abcx19[_0x8def[76]],_0x8def[28]);_0x7abcx19[_0x8def[76]][_0x8def[48]](function(_0x7abcx1c){_0x7abcx1d= _[_0x8def[78]](_0x7abcx1d,_[_0x8def[77]](_0x7abcx1c.Users,_0x8def[28]))});return User[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]})[_0x8def[32]](_[_0x8def[79]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]],{id:{$in:_0x7abcx1d}}),{include:[{model:OpenchannelQueue,where:{id:{$in:_0x7abcx23}},required:false}]}))})[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)});default:return Agent[_0x8def[34]](_0x8def[33],{method:[_0x8def[71],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[72],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[73],_0x7abcx14[_0x8def[26]]]},{method:[_0x8def[74],_0x7abcx14[_0x8def[26]]]},_0x8def[83])[_0x8def[32]](Util[_0x8def[31]](_0x7abcx14[_0x8def[26]]))[_0x8def[25]](function(_0x7abcx18){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx18)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})}};exports[_0x8def[92]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx15[_0x8def[23]](_0x7abcx1a)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[93]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[95]]({attributes:[_0x8def[41]]})})[_0x8def[25]](function(_0x7abcx1e){return _0x7abcx15[_0x8def[23]]({count:_0x7abcx1e[_0x8def[94]],rows:_0x7abcx1e})})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[96]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[97]]({attributes:[_0x8def[28]]})})[_0x8def[25]](function(_0x7abcx1f){return _0x7abcx15[_0x8def[23]]({count:_0x7abcx1f[_0x8def[94]],rows:_0x7abcx1f})})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[98]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[99]]({attributes:[_0x8def[28]]})})[_0x8def[25]](function(_0x7abcx20){return _0x7abcx15[_0x8def[23]]({count:_0x7abcx20[_0x8def[94]],rows:_0x7abcx20})})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[100]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[101]]({attributes:[_0x8def[28]]})})[_0x8def[25]](function(_0x7abcx21){return _0x7abcx15[_0x8def[23]]({count:_0x7abcx21[_0x8def[94]],rows:_0x7abcx21})})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[102]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[103]]({attributes:[_0x8def[28]]})})[_0x8def[25]](function(_0x7abcx22){return _0x7abcx15[_0x8def[23]]({count:_0x7abcx22[_0x8def[94]],rows:_0x7abcx22})})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[104]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[34]](_0x8def[33])[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[105]]({attributes:[_0x8def[28]]})})[_0x8def[25]](function(_0x7abcx24){return _0x7abcx15[_0x8def[23]]({count:_0x7abcx24[_0x8def[94]],rows:_0x7abcx24})})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[106]]= function(_0x7abcx14,_0x7abcx15){var _0x7abcx25;_0x7abcx14[_0x8def[39]][_0x8def[35]]= _0x8def[33];return sequelize[_0x8def[116]](function(_0x7abcx26){return Setting[_0x8def[30]](1)[_0x8def[25]](function(_0x7abcx28){var _0x7abcx29=String(_0x7abcx14[_0x8def[39]][_0x8def[112]]);var _0x7abcx2a=_0x7abcx28[_0x8def[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^.{6,}$/;if(!_0x7abcx2a[_0x8def[114]](_0x7abcx29)){throw  new Error(_0x8def[115])};return Agent[_0x8def[34]](_0x8def[33])[_0x8def[106]](_0x7abcx14[_0x8def[39]],{transaction:_0x7abcx26})})[_0x8def[25]](userTools[_0x8def[111]]({transaction:_0x7abcx26}))[_0x8def[25]](function(_0x7abcx1a){_0x7abcx25= _0x7abcx1a;return Team[_0x8def[110]]({where:{defaultEntry:true}})})[_0x8def[25]](function(_0x7abcx27){return _0x7abcx27[_0x8def[109]](_0x7abcx25[_0x8def[28]],{transaction:_0x7abcx26})})})[_0x8def[25]](function(){return _0x7abcx15[_0x8def[24]](201)[_0x8def[23]](_0x7abcx25)})[_0x8def[22]](sequelize.UniqueConstraintError,function(_0x7abcx17){return Util[_0x8def[108]][_0x8def[107]](_0x7abcx15,_0x7abcx17)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[117]]= function(_0x7abcx14,_0x7abcx15){var _0x7abcx2b;var _0x7abcx2c;var _0x7abcx2d=[];var _0x7abcx29=String(_0x7abcx14[_0x8def[39]][_0x8def[112]]);return sequelize[_0x8def[116]](function(_0x7abcx26){return Setting[_0x8def[30]](1)[_0x8def[25]](function(_0x7abcx28){_0x7abcx2c= _0x7abcx28;var _0x7abcx2a=_0x7abcx2c[_0x8def[113]]?/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[~!@#$%^&\-_=+\[\{\]\}.])[0-9a-zA-Z~!@#$%^&\-_=+\[\{\]\}.]{8,}$/:/^[a-zA-Z0-9]{6,}$/;if(!_0x7abcx2a[_0x8def[114]](_0x7abcx29)){throw  new Error(_0x8def[119])};var _0x7abcx2e=0;if(_0x7abcx14[_0x8def[39]][_0x8def[121]](_0x8def[120])&& _[_0x8def[122]](_0x7abcx14[_0x8def[39]][_0x8def[120]])&& _0x7abcx14[_0x8def[39]][_0x8def[120]]>= 0){_0x7abcx2e= _0x7abcx14[_0x8def[39]][_0x8def[120]];delete _0x7abcx14[_0x8def[39]][_0x8def[120]]};var _0x7abcx2f=_0x7abcx14[_0x8def[39]][_0x8def[123]];delete _0x7abcx14[_0x8def[39]][_0x8def[123]];if(_0x7abcx14[_0x8def[39]][_0x8def[124]]){_0x7abcx14[_0x8def[39]][_0x8def[35]]= _0x8def[33];for(var _0x7abcx30=_0x7abcx2e;_0x7abcx30< _0x7abcx14[_0x8def[39]][_0x8def[124]]+ _0x7abcx2e;_0x7abcx30++,_0x7abcx2f++){var _0x7abcx31=_[_0x8def[125]](_0x7abcx14[_0x8def[39]]);_0x7abcx31[_0x8def[126]]= _0x7abcx2f;_0x7abcx31[_0x8def[41]]= _0x7abcx31[_0x8def[41]]+ _0x7abcx30;_0x7abcx31[_0x8def[127]]= _0x7abcx31[_0x8def[127]]+ _0x7abcx30;_0x7abcx31[_0x8def[128]]= _0x7abcx31[_0x8def[128]][_0x8def[130]](_0x8def[129])[0]+ _0x7abcx30+ _0x8def[129]+ _0x7abcx31[_0x8def[128]][_0x8def[130]](_0x8def[129])[1];_0x7abcx2d[_0x8def[47]](_0x7abcx31)}}else {throw  new Error(_0x8def[131])};return Agent[_0x8def[117]](_0x7abcx2d,{transaction:_0x7abcx26,individualHooks:true})})[_0x8def[25]](function(_0x7abcx1d){_0x7abcx2b= _0x7abcx1d;return Team[_0x8def[110]]({where:{defaultEntry:true}})})[_0x8def[25]](function(_0x7abcx27){return _0x7abcx27[_0x8def[118]](_[_0x8def[77]](_0x7abcx2b,_0x8def[28]),{transaction:_0x7abcx26})})})[_0x8def[25]](function(){return _0x7abcx15[_0x8def[37]](201)})[_0x8def[22]](sequelize.UniqueConstraintError,function(_0x7abcx17){return Util[_0x8def[108]][_0x8def[107]](_0x7abcx15,_0x7abcx17)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[132]]= function(_0x7abcx14,_0x7abcx15){if(_0x7abcx14[_0x8def[39]][_0x8def[28]]){delete _0x7abcx14[_0x8def[39]][_0x8def[28]]};delete _0x7abcx14[_0x8def[39]][_0x8def[126]];delete _0x7abcx14[_0x8def[39]][_0x8def[35]];delete _0x7abcx14[_0x8def[39]][_0x8def[41]];delete _0x7abcx14[_0x8def[39]][_0x8def[112]];var _0x7abcx25;return sequelize[_0x8def[116]](function(_0x7abcx26){return Agent[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};var _0x7abcx32=_[_0x8def[79]](_0x7abcx1a,_0x7abcx14[_0x8def[39]]);return _0x7abcx32[_0x8def[134]]({transaction:_0x7abcx26})})[_0x8def[25]](function(_0x7abcx1a){_0x7abcx25= _0x7abcx1a;return _0x7abcx1a})[_0x8def[25]](userTools[_0x8def[133]]({transaction:_0x7abcx26}))[_0x8def[25]](function(){return _0x7abcx15[_0x8def[24]](200)[_0x8def[23]](_0x7abcx25)})})[_0x8def[22]](sequelize.UniqueConstraintError,function(_0x7abcx17){return Util[_0x8def[108]][_0x8def[107]](_0x7abcx15,_0x7abcx17)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[135]]= function(_0x7abcx14,_0x7abcx15){var _0x7abcx25;return Agent[_0x8def[30]](_0x7abcx14[_0x8def[61]][_0x8def[28]])[_0x8def[25]](function(_0x7abcx1a){_0x7abcx25= _0x7abcx1a;if(!_0x7abcx1a){return _0x7abcx15[_0x8def[37]](404)};return _0x7abcx1a[_0x8def[135]]()})[_0x8def[25]](function(){return _0x7abcx15[_0x8def[37]](204)})[_0x8def[22]](sequelize.ForeignKeyConstraintError,function(_0x7abcx17){return Util[_0x8def[108]][_0x8def[136]](_0x7abcx15,_0x8def[33],_0x7abcx25[_0x8def[41]],_0x7abcx17)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};exports[_0x8def[137]]= function(_0x7abcx14,_0x7abcx15){return Agent[_0x8def[135]]({where:{id:_0x7abcx14[_0x8def[26]][_0x8def[63]]},individualHooks:true})[_0x8def[25]](function(){return _0x7abcx15[_0x8def[37]](204)})[_0x8def[22]](function(_0x7abcx17){return handleError(_0x7abcx15,_0x7abcx17)})};function handleError(_0x7abcx15,_0x7abcx17){logger[_0x8def[139]](_0x7abcx17[_0x8def[138]]);return _0x7abcx15[_0x8def[24]](500)[_0x8def[23]](_0x7abcx17)}