Built motion from commit e493b9a4954b50a8ee6d0034ba3601cd210d989d. Version 3.0.0...
[motion-next.git] / server / api / voiceQueue / voiceQueue.controller.js
1 'use strict';const a903_0xa10f=['VoiceQueueId','@mysqldb','219233svueVU','ListId','UserProfileSection','addLists','name','penalty','CmHopperHistory','@rediscache','VoiceQueueId\x20=\x20?','QueueCampaigns','cm_hopper','dialCheckDuplicateType','api','User','addTeams','emit','cm_contacts','into','./voiceQueue.socket','CmListId','forEach','undefined','userVoiceQueue:remove','getAgents','user','userProfileId','set','findOne','order','129206BGwlnp','removeLists','fields','value','Unable\x20to\x20retrieve\x20the\x20current\x20user','Content-Range','json','phone\x20IS\x20NOT\x20NULL','Agents','limit','updatedAt','rawAttributes','CmHopper','ut.TeamId\x20=\x20tq.TeamId','includes','voicePause','CmHopperFinal','userVoiceQueue:save','373OuwbvG','type','getHoppers','onlyIfOpen','from','isEmpty','autoAssociation','cm_hopper_final','@utils/filter-attributes','where','update','1kVVYlV','then','phone\x20NOT\x20IN\x20(?)','@components/parsers/qs','interface','merge','325882uKATmX','COALESCE(phone,\x27\x27)','VoiceQueues','user_has_teams','COALESCE(calleridnum,\x27\x27)','length','getHopperBlacks','nolimit','includeAll','insert','intersection','280400RYombJ','keys','removeBlackLists','online','filters','attributes','destroy','catch','outbound','transaction','key','filter','2lXlkCR','216333DRDqsB','rows','error','741Buqhhm','get','fromQuery','UserVoiceQueueRt','map','addAgents','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Team','removeAgents','ignore','query','sort','model','NOW()','tq.TeamId','offset','CmHopperBlack','options','create','VoiceQueue','index','body','getBlackLists','addBlackLists','TeamId','team_has_voice_queues','pick','ListId\x20=\x20?','findOrCreate','ContactId','role','toString','removeTeams','getMembers','teams','sendStatus','include','getTeams','field','params','ids','push','39268MrPslq','scheduledAt','union','omit','UserVoiceQueue','phone','UserProfileResource','format','every','status','findAll','@config/logger','upsert','ut.UserId\x20=\x20?','end','SIP/%s','deletedAt\x20IS\x20NULL','all','createdAt','count','clone','find','CmList','getHopperFinals','getLists','sequelize','show','inbound','select'];const a903_0x3b6d=function(_0x104db0,_0x10c547){_0x104db0=_0x104db0-0xdd;let _0xa10fdf=a903_0xa10f[_0x104db0];return _0xa10fdf;};const a903_0x4bc928=a903_0x3b6d;(function(_0x490dc7,_0x1adf65){const _0x56c9c1=a903_0x3b6d;while(!![]){try{const _0x1d0e32=parseInt(_0x56c9c1(0xe8))*-parseInt(_0x56c9c1(0x133))+-parseInt(_0x56c9c1(0xf9))+-parseInt(_0x56c9c1(0x109))*parseInt(_0x56c9c1(0xdd))+-parseInt(_0x56c9c1(0x16f))+parseInt(_0x56c9c1(0x106))*parseInt(_0x56c9c1(0x105))+parseInt(_0x56c9c1(0x152))+parseInt(_0x56c9c1(0xee));if(_0x1d0e32===_0x1adf65)break;else _0x490dc7['push'](_0x490dc7['shift']());}catch(_0x48a4f2){_0x490dc7['push'](_0x490dc7['shift']());}}}(a903_0xa10f,0x3da62));const util=require('util'),_=require('lodash'),squel=require('squel'),qs=require(a903_0x4bc928(0xeb)),logger=require(a903_0x4bc928(0x13e))(a903_0x4bc928(0x15e)),{getSocket}=require(a903_0x4bc928(0x159)),socket=getSocket(),{db}=require(a903_0x4bc928(0x151)),{QueryTypes}=require(a903_0x4bc928(0x14c)),{filterAttributes}=require(a903_0x4bc928(0xe5));require(a903_0x4bc928(0x164))['register'](socket);function respondWithStatusCode(_0x253161,_0x3c4fa9){return _0x3c4fa9=_0x3c4fa9||0xcc,function(_0x5094a6){const _0x14b0f0=a903_0x3b6d;if(_0x5094a6)return _0x253161['sendStatus'](_0x3c4fa9);return _0x253161[_0x14b0f0(0x13c)](_0x3c4fa9)['end']();};}function respondWithResult(_0x6af066,_0x35716b){return _0x35716b=_0x35716b||0xc8,function(_0x430907){const _0x43f35e=a903_0x3b6d;if(_0x430907)return _0x6af066[_0x43f35e(0x13c)](_0x35716b)[_0x43f35e(0x175)](_0x430907);};}function respondWithFilteredResult(_0x4037bf,_0x100afa){return function(_0xe89ad8){const _0x1b852c=a903_0x3b6d;if(_0xe89ad8){const _0x29e233=_0xe89ad8[_0x1b852c(0x146)],_0x7f3226=_0x100afa[_0x1b852c(0x118)];let _0x5e7e9b=_0x100afa[_0x1b852c(0x118)]+_0x100afa['limit'],_0x503df1;return _0x5e7e9b>=_0x29e233?(_0x5e7e9b=_0x29e233,_0x503df1=0xc8):_0x503df1=0xce,_0x4037bf[_0x1b852c(0x13c)](_0x503df1),_0x4037bf[_0x1b852c(0x16c)](_0x1b852c(0x174),_0x7f3226+'-'+_0x5e7e9b+'/'+_0x29e233)[_0x1b852c(0x175)](_0xe89ad8);}return null;};}function saveUpdates(_0x5f534b){return function(_0x28b86c){const _0x2d1f15=a903_0x3b6d;if(_0x28b86c)return _0x28b86c[_0x2d1f15(0xe7)](_0x5f534b)['then'](function(_0x24253f){return _0x24253f;});return null;};}function removeEntity(_0x245b59){return function(_0x24f194){const _0x38c227=a903_0x3b6d;if(_0x24f194)return _0x24f194['destroy']()[_0x38c227(0xe9)](function(){const _0x3e85a1=_0x38c227,_0x37a85b=_0x24f194[_0x3e85a1(0x10a)]({'plain':!![]}),_0x18ff3d=[{'name':_0x3e85a1(0xf0),'value':'inbound','ignore':![]},{'name':_0x3e85a1(0x15b),'value':_0x3e85a1(0x101),'ignore':![]}],_0x171022=_(_0x18ff3d)[_0x3e85a1(0x104)](_0x3e85a1(0x112))[_0x3e85a1(0x10d)](_0x3e85a1(0x172))['value']();if(_[_0x3e85a1(0x17d)](_0x171022,_0x37a85b[_0x3e85a1(0xde)]))return;const _0x34bac8=_[_0x3e85a1(0x148)](_0x18ff3d,[_0x3e85a1(0x172),_0x37a85b[_0x3e85a1(0xde)]])[_0x3e85a1(0x156)];return db[_0x3e85a1(0x139)][_0x3e85a1(0xff)]({'where':{'type':_0x34bac8,'resourceId':_0x37a85b['id']}})[_0x3e85a1(0xe9)](function(){return _0x24f194;});})[_0x38c227(0xe9)](function(){const _0x864f14=_0x38c227;_0x245b59[_0x864f14(0x13c)](0xcc)[_0x864f14(0x141)]();});};}function handleEntityNotFound(_0x4a81c5){return function(_0x36a2ce){const _0x56e812=a903_0x3b6d;return!_0x36a2ce&&_0x4a81c5[_0x56e812(0x12c)](0x194),_0x36a2ce;};}function handleError(_0x474625,_0x2576e0){return _0x2576e0=_0x2576e0||0x1f4,function(_0x564417){const _0x1d1181=a903_0x3b6d;logger[_0x1d1181(0x108)](_0x564417['stack']),_0x564417[_0x1d1181(0x156)]&&delete _0x564417[_0x1d1181(0x156)],_0x474625['status'](_0x2576e0)['send'](_0x564417);};}exports[a903_0x4bc928(0x11d)]=function(_0x23f4c2,_0x493aee){const _0x261c36=a903_0x4bc928;let _0xc06c47={};const _0x2d2c86={},_0x2eb557={'count':0x0,'rows':[]},_0x4f0f2d=_[_0x261c36(0x10d)](db['VoiceQueue'][_0x261c36(0x17a)],function(_0x2650a0){const _0x1f8f0c=_0x261c36;return{'name':_0x2650a0['fieldName'],'type':_0x2650a0[_0x1f8f0c(0xde)][_0x1f8f0c(0x103)]};});_0x2d2c86[_0x261c36(0x115)]=_[_0x261c36(0x10d)](_0x4f0f2d,_0x261c36(0x156)),_0x2d2c86[_0x261c36(0x113)]=_['keys'](_0x23f4c2['query']),_0x2d2c86[_0x261c36(0xfd)]=_[_0x261c36(0xf8)](_0x2d2c86[_0x261c36(0x115)],_0x2d2c86['query']),_0xc06c47['attributes']=_[_0x261c36(0xf8)](_0x2d2c86[_0x261c36(0x115)],qs[_0x261c36(0x171)](_0x23f4c2[_0x261c36(0x113)][_0x261c36(0x171)])),_0xc06c47[_0x261c36(0xfe)]=_0xc06c47[_0x261c36(0xfe)][_0x261c36(0xf3)]?_0xc06c47[_0x261c36(0xfe)]:_0x2d2c86[_0x261c36(0x115)];typeof _0x23f4c2['query']['nolimit']==='undefined'&&(_0xc06c47['limit']=qs[_0x261c36(0x178)](_0x23f4c2[_0x261c36(0x113)][_0x261c36(0x178)]),_0xc06c47[_0x261c36(0x118)]=qs[_0x261c36(0x118)](_0x23f4c2[_0x261c36(0x113)][_0x261c36(0x118)]));_0xc06c47[_0x261c36(0x16e)]=qs['sort'](_0x23f4c2[_0x261c36(0x113)][_0x261c36(0x114)]),_0xc06c47[_0x261c36(0xe6)]=qs['filters'](_[_0x261c36(0x123)](_0x23f4c2[_0x261c36(0x113)],_0x2d2c86[_0x261c36(0xfd)]),_0x4f0f2d),_0xc06c47=filterAttributes(_0xc06c47,_0x23f4c2[_0x261c36(0x113)][_0x261c36(0x104)],_0x4f0f2d,_0x23f4c2[_0x261c36(0x11a)]);const _0x3c622e={'where':_0xc06c47[_0x261c36(0xe6)]};return db[_0x261c36(0x11c)]['count'](_0x3c622e)[_0x261c36(0xe9)](function(_0x329b4a){const _0x18cbaa=_0x261c36;return _0x2eb557[_0x18cbaa(0x146)]=_0x329b4a,_0x23f4c2[_0x18cbaa(0x113)][_0x18cbaa(0xf6)]&&(_0xc06c47[_0x18cbaa(0x12d)]=[{'all':!![]}]),db['VoiceQueue'][_0x18cbaa(0x13d)](_0xc06c47);})[_0x261c36(0xe9)](function(_0x4a4082){const _0xb3d418=_0x261c36;return _0x2eb557[_0xb3d418(0x107)]=_0x4a4082,_0x2eb557;})[_0x261c36(0xe9)](respondWithFilteredResult(_0x493aee,_0xc06c47))[_0x261c36(0x100)](handleError(_0x493aee,null));},exports[a903_0x4bc928(0x14d)]=function(_0x365592,_0x3aef8c){const _0x457ac9=a903_0x4bc928;let _0x551217={'raw':![],'where':{'id':_0x365592[_0x457ac9(0x130)]['id']}};const _0x148b0f={};return _0x148b0f[_0x457ac9(0x115)]=_[_0x457ac9(0xfa)](db['VoiceQueue'][_0x457ac9(0x17a)]),_0x148b0f[_0x457ac9(0x113)]=_[_0x457ac9(0xfa)](_0x365592['query']),_0x148b0f['filters']=_[_0x457ac9(0xf8)](_0x148b0f[_0x457ac9(0x115)],_0x148b0f[_0x457ac9(0x113)]),_0x551217[_0x457ac9(0xfe)]=_[_0x457ac9(0xf8)](_0x148b0f[_0x457ac9(0x115)],qs['fields'](_0x365592[_0x457ac9(0x113)][_0x457ac9(0x171)])),_0x551217[_0x457ac9(0xfe)]=_0x551217[_0x457ac9(0xfe)][_0x457ac9(0xf3)]?_0x551217[_0x457ac9(0xfe)]:_0x148b0f[_0x457ac9(0x115)],_0x365592[_0x457ac9(0x113)]['includeAll']&&(_0x551217[_0x457ac9(0x12d)]=[{'all':!![]}]),_0x551217=_[_0x457ac9(0xed)]({},_0x551217,_0x365592[_0x457ac9(0x11a)]),db[_0x457ac9(0x11c)][_0x457ac9(0x16d)](_0x551217)[_0x457ac9(0xe9)](handleEntityNotFound(_0x3aef8c,null))['then'](respondWithResult(_0x3aef8c,null))['catch'](handleError(_0x3aef8c,null));},exports[a903_0x4bc928(0x11b)]=function(_0x2d40d7,_0x70ef0d){const _0x35eb69=a903_0x4bc928;return db[_0x35eb69(0x11c)]['create'](_0x2d40d7[_0x35eb69(0x11e)],{})[_0x35eb69(0xe9)](function(_0x57929f){const _0x5cf801=_0x35eb69,_0x41e4c9=_0x2d40d7[_0x5cf801(0x16a)][_0x5cf801(0x10a)]({'plain':!![]});if(!_0x41e4c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x41e4c9[_0x5cf801(0x127)]===_0x5cf801(0x16a)){const _0x151ecc=_0x57929f[_0x5cf801(0x10a)]({'plain':!![]}),_0x460cb8=[{'name':'VoiceQueues','value':_0x5cf801(0x14e)},{'name':_0x5cf801(0x15b),'value':_0x5cf801(0x101)}],_0x1d2541=_[_0x5cf801(0x148)](_0x460cb8,[_0x5cf801(0x172),_0x151ecc[_0x5cf801(0xde)]])[_0x5cf801(0x156)];return db[_0x5cf801(0x154)]['findOne']({'where':{'name':_0x1d2541,'userProfileId':_0x41e4c9['userProfileId']},'raw':!![]})[_0x5cf801(0xe9)](function(_0x56f47c){const _0x5c6fa7=_0x5cf801;return _0x56f47c&&_0x56f47c[_0x5c6fa7(0xe3)]===0x0?db[_0x5c6fa7(0x139)][_0x5c6fa7(0x11b)]({'name':_0x151ecc[_0x5c6fa7(0x156)],'resourceId':_0x151ecc['id'],'type':_0x56f47c['name'],'sectionId':_0x56f47c['id']},{})[_0x5c6fa7(0xe9)](function(){return _0x57929f;}):_0x57929f;})['catch'](function(_0x4f9189){const _0x617e73=_0x5cf801;logger[_0x617e73(0x108)](_0x617e73(0x10f),_0x4f9189);throw _0x4f9189;});}return _0x57929f;})[_0x35eb69(0xe9)](respondWithResult(_0x70ef0d,0xc9))[_0x35eb69(0x100)](handleError(_0x70ef0d,null));},exports[a903_0x4bc928(0x147)]=function(_0x38c62f,_0x1cc7ed){const _0x2f313f=a903_0x4bc928;let _0x30fdd6={'where':{'id':_0x38c62f[_0x2f313f(0x130)]['id']}};const _0x4f5f3c={};return _0x4f5f3c[_0x2f313f(0x115)]=_[_0x2f313f(0xfa)](db['VoiceQueue'][_0x2f313f(0x17a)]),_0x30fdd6['attributes']=_[_0x2f313f(0xf8)](_0x4f5f3c[_0x2f313f(0x115)],qs[_0x2f313f(0x171)](_0x38c62f[_0x2f313f(0x113)][_0x2f313f(0x171)])),_0x30fdd6[_0x2f313f(0xfe)]=_0x30fdd6[_0x2f313f(0xfe)][_0x2f313f(0xf3)]?_0x30fdd6[_0x2f313f(0xfe)]:_0x4f5f3c[_0x2f313f(0x115)],_0x38c62f['query']['includeAll']&&(_0x30fdd6[_0x2f313f(0x12d)]=[{'all':!![]}]),_0x30fdd6=_['merge']({},_0x30fdd6,_0x38c62f['options']),db[_0x2f313f(0x11c)][_0x2f313f(0x16d)](_0x30fdd6)[_0x2f313f(0xe9)](handleEntityNotFound(_0x1cc7ed,null))[_0x2f313f(0xe9)](function(_0x1f3dff){const _0x9d4220=_0x2f313f;if(_0x1f3dff){let _0x13c17a=_0x1f3dff[_0x9d4220(0x10a)]({'plain':!![]});return _0x13c17a=qs[_0x9d4220(0x136)](_0x13c17a,['id',_0x9d4220(0x145),'updatedAt']),_0x38c62f[_0x9d4220(0x11e)]=_[_0x9d4220(0x136)](_0x38c62f['body'],['id',_0x9d4220(0x145),_0x9d4220(0x179)]),db[_0x9d4220(0x11c)][_0x9d4220(0x11b)](_[_0x9d4220(0xed)](_0x13c17a,_0x38c62f[_0x9d4220(0x11e)]),{'include':_0x38c62f[_0x9d4220(0x113)][_0x9d4220(0xf6)]?[{'all':!![]}]:undefined})[_0x9d4220(0xe9)](function(_0x4fd441){const _0x1b46c7=_0x9d4220,_0xf57ee4=_0x38c62f[_0x1b46c7(0x16a)][_0x1b46c7(0x10a)]({'plain':!![]});if(!_0xf57ee4)throw new Error(_0x1b46c7(0x173));if(_0xf57ee4[_0x1b46c7(0x127)]===_0x1b46c7(0x16a)){const _0x5bfe55=_0x4fd441['get']({'plain':!![]}),_0x48d01f=[{'name':_0x1b46c7(0xf0),'value':_0x1b46c7(0x14e)},{'name':'QueueCampaigns','value':_0x1b46c7(0x101)}],_0x725a12=_[_0x1b46c7(0x148)](_0x48d01f,[_0x1b46c7(0x172),_0x5bfe55[_0x1b46c7(0xde)]])[_0x1b46c7(0x156)];return db['UserProfileSection'][_0x1b46c7(0x16d)]({'where':{'name':_0x725a12,'userProfileId':_0xf57ee4[_0x1b46c7(0x16b)]},'raw':!![]})[_0x1b46c7(0xe9)](function(_0x1681b7){const _0x14b13d=_0x1b46c7;return _0x1681b7&&_0x1681b7[_0x14b13d(0xe3)]===0x0?db[_0x14b13d(0x139)][_0x14b13d(0x11b)]({'name':_0x5bfe55[_0x14b13d(0x156)],'resourceId':_0x5bfe55['id'],'type':_0x1681b7[_0x14b13d(0x156)],'sectionId':_0x1681b7['id']},{})['then'](function(){return _0x4fd441;}):_0x4fd441;})[_0x1b46c7(0x100)](function(_0x49a591){const _0x1be878=_0x1b46c7;logger[_0x1be878(0x108)](_0x1be878(0x10f),_0x49a591);throw _0x49a591;});}return _0x4fd441;});}})[_0x2f313f(0xe9)](respondWithResult(_0x1cc7ed,0xc9))['catch'](handleError(_0x1cc7ed,null));},exports[a903_0x4bc928(0xe7)]=function(_0x133f58,_0x3025e2){const _0x4bbc99=a903_0x4bc928;return _0x133f58[_0x4bbc99(0x11e)]['id']&&delete _0x133f58['body']['id'],db[_0x4bbc99(0x11c)][_0x4bbc99(0x16d)]({'where':{'id':_0x133f58[_0x4bbc99(0x130)]['id']}})[_0x4bbc99(0xe9)](handleEntityNotFound(_0x3025e2,null))['then'](saveUpdates(_0x133f58[_0x4bbc99(0x11e)],null))[_0x4bbc99(0xe9)](respondWithResult(_0x3025e2,null))[_0x4bbc99(0x100)](handleError(_0x3025e2,null));},exports[a903_0x4bc928(0xff)]=function(_0x6e370,_0x29398d){const _0x38326b=a903_0x4bc928;return db[_0x38326b(0x11c)][_0x38326b(0x16d)]({'where':{'id':_0x6e370['params']['id']}})[_0x38326b(0xe9)](handleEntityNotFound(_0x29398d,null))[_0x38326b(0xe9)](removeEntity(_0x29398d,null))['catch'](handleError(_0x29398d,null));},exports[a903_0x4bc928(0xdf)]=function(_0x278735,_0x38eb07){const _0x4babd0=a903_0x4bc928;let _0x47cb1b={'raw':![],'where':{}};const _0x56762e={},_0x32bfc5={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x4babd0(0x16d)]({'where':{'id':_0x278735[_0x4babd0(0x130)]['id']}})[_0x4babd0(0xe9)](handleEntityNotFound(_0x38eb07,null))[_0x4babd0(0xe9)](function(_0x2dd0aa){const _0x138b06=_0x4babd0;if(_0x2dd0aa)return _0x56762e['model']=_[_0x138b06(0xfa)](db[_0x138b06(0x17b)][_0x138b06(0x17a)]),_0x56762e[_0x138b06(0x113)]=_[_0x138b06(0xfa)](_0x278735[_0x138b06(0x113)]),_0x56762e['filters']=_[_0x138b06(0xf8)](_0x56762e[_0x138b06(0x115)],_0x56762e['query']),_0x47cb1b[_0x138b06(0xfe)]=_['intersection'](_0x56762e[_0x138b06(0x115)],qs[_0x138b06(0x171)](_0x278735[_0x138b06(0x113)]['fields'])),_0x47cb1b[_0x138b06(0xfe)]=_0x47cb1b[_0x138b06(0xfe)]['length']?_0x47cb1b[_0x138b06(0xfe)]:_0x56762e['model'],typeof _0x278735[_0x138b06(0x113)]['nolimit']===_0x138b06(0x167)&&(_0x47cb1b[_0x138b06(0x178)]=qs[_0x138b06(0x178)](_0x278735['query']['limit']),_0x47cb1b[_0x138b06(0x118)]=qs[_0x138b06(0x118)](_0x278735[_0x138b06(0x113)][_0x138b06(0x118)])),_0x47cb1b[_0x138b06(0x16e)]=qs[_0x138b06(0x114)](_0x278735[_0x138b06(0x113)][_0x138b06(0x114)]),_0x47cb1b[_0x138b06(0xe6)]=qs[_0x138b06(0xfd)](_[_0x138b06(0x123)](_0x278735[_0x138b06(0x113)],_0x56762e[_0x138b06(0xfd)])),_0x47cb1b[_0x138b06(0xe6)][_0x138b06(0x150)]=_0x2dd0aa['id'],_0x47cb1b=filterAttributes(_0x47cb1b,_0x278735[_0x138b06(0x113)][_0x138b06(0x104)],_0x47cb1b[_0x138b06(0xfe)],_0x278735[_0x138b06(0x11a)],![]),db[_0x138b06(0x17b)][_0x138b06(0x146)]({'where':_0x47cb1b[_0x138b06(0xe6)]})[_0x138b06(0xe9)](function(_0x1b6f21){const _0xdc34cb=_0x138b06;return _0x32bfc5[_0xdc34cb(0x146)]=_0x1b6f21,_0x278735[_0xdc34cb(0x113)][_0xdc34cb(0xf6)]&&(_0x47cb1b['include']=[{'all':!![]}]),db[_0xdc34cb(0x17b)]['findAll'](_0x47cb1b);})[_0x138b06(0xe9)](function(_0x28481b){const _0x377a4b=_0x138b06;return _0x32bfc5[_0x377a4b(0x107)]=_0x28481b,_0x32bfc5;});})[_0x4babd0(0xe9)](respondWithFilteredResult(_0x38eb07,_0x47cb1b))[_0x4babd0(0x100)](handleError(_0x38eb07,null));},exports['getHopperHistories']=function(_0x4cc61d,_0x181beb){const _0x56da6d=a903_0x4bc928;let _0x5e8cf4={'raw':!![],'where':{}};const _0x157598={},_0x480f3e={'count':0x0,'rows':[]};return db[_0x56da6d(0x11c)][_0x56da6d(0x16d)]({'where':{'id':_0x4cc61d[_0x56da6d(0x130)]['id']}})['then'](handleEntityNotFound(_0x181beb,null))[_0x56da6d(0xe9)](function(_0x22591c){const _0xe28cd2=_0x56da6d;if(_0x22591c)return _0x157598[_0xe28cd2(0x115)]=_[_0xe28cd2(0xfa)](db['CmHopperHistory'][_0xe28cd2(0x17a)]),_0x157598[_0xe28cd2(0x113)]=_[_0xe28cd2(0xfa)](_0x4cc61d['query']),_0x157598[_0xe28cd2(0xfd)]=_['intersection'](_0x157598[_0xe28cd2(0x115)],_0x157598[_0xe28cd2(0x113)]),_0x5e8cf4['attributes']=_['intersection'](_0x157598[_0xe28cd2(0x115)],qs['fields'](_0x4cc61d[_0xe28cd2(0x113)]['fields'])),_0x5e8cf4[_0xe28cd2(0xfe)]=_0x5e8cf4['attributes']['length']?_0x5e8cf4[_0xe28cd2(0xfe)]:_0x157598[_0xe28cd2(0x115)],typeof _0x4cc61d[_0xe28cd2(0x113)][_0xe28cd2(0xf5)]===_0xe28cd2(0x167)&&(_0x5e8cf4['limit']=qs[_0xe28cd2(0x178)](_0x4cc61d[_0xe28cd2(0x113)][_0xe28cd2(0x178)]),_0x5e8cf4[_0xe28cd2(0x118)]=qs[_0xe28cd2(0x118)](_0x4cc61d[_0xe28cd2(0x113)][_0xe28cd2(0x118)])),_0x5e8cf4[_0xe28cd2(0x16e)]=qs['sort'](_0x4cc61d[_0xe28cd2(0x113)][_0xe28cd2(0x114)]),_0x5e8cf4[_0xe28cd2(0xe6)]=qs[_0xe28cd2(0xfd)](_[_0xe28cd2(0x123)](_0x4cc61d[_0xe28cd2(0x113)],_0x157598[_0xe28cd2(0xfd)])),_0x5e8cf4['where'][_0xe28cd2(0x150)]=_0x22591c['id'],_0x5e8cf4=filterAttributes(_0x5e8cf4,_0x4cc61d['query'][_0xe28cd2(0x104)],_0x5e8cf4[_0xe28cd2(0xfe)],_0x4cc61d[_0xe28cd2(0x11a)],![]),db['CmHopperHistory'][_0xe28cd2(0x146)]({'where':_0x5e8cf4[_0xe28cd2(0xe6)]})[_0xe28cd2(0xe9)](function(_0xda3a84){const _0x2aa385=_0xe28cd2;return _0x480f3e[_0x2aa385(0x146)]=_0xda3a84,_0x4cc61d[_0x2aa385(0x113)][_0x2aa385(0xf6)]&&(_0x5e8cf4['include']=[{'all':!![]}]),db[_0x2aa385(0x158)]['findAll'](_0x5e8cf4);})[_0xe28cd2(0xe9)](function(_0x54fdea){const _0x23e338=_0xe28cd2;return _0x480f3e[_0x23e338(0x107)]=_0x54fdea,_0x480f3e;});})[_0x56da6d(0xe9)](respondWithFilteredResult(_0x181beb,_0x5e8cf4))['catch'](handleError(_0x181beb,null));},exports[a903_0x4bc928(0x14a)]=function(_0x4219cf,_0x53b7d1){const _0x3f496f=a903_0x4bc928;let _0x20e1c3={'raw':!![],'where':{}};const _0x2e393a={},_0x54f2ef={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x3f496f(0x16d)]({'where':{'id':_0x4219cf[_0x3f496f(0x130)]['id']}})[_0x3f496f(0xe9)](handleEntityNotFound(_0x53b7d1,null))[_0x3f496f(0xe9)](function(_0x44b4d3){const _0x27fc6c=_0x3f496f;if(_0x44b4d3)return _0x2e393a[_0x27fc6c(0x115)]=_[_0x27fc6c(0xfa)](db[_0x27fc6c(0x17f)][_0x27fc6c(0x17a)]),_0x2e393a[_0x27fc6c(0x113)]=_[_0x27fc6c(0xfa)](_0x4219cf[_0x27fc6c(0x113)]),_0x2e393a[_0x27fc6c(0xfd)]=_[_0x27fc6c(0xf8)](_0x2e393a['model'],_0x2e393a[_0x27fc6c(0x113)]),_0x20e1c3[_0x27fc6c(0xfe)]=_[_0x27fc6c(0xf8)](_0x2e393a[_0x27fc6c(0x115)],qs[_0x27fc6c(0x171)](_0x4219cf[_0x27fc6c(0x113)][_0x27fc6c(0x171)])),_0x20e1c3[_0x27fc6c(0xfe)]=_0x20e1c3[_0x27fc6c(0xfe)][_0x27fc6c(0xf3)]?_0x20e1c3[_0x27fc6c(0xfe)]:_0x2e393a[_0x27fc6c(0x115)],typeof _0x4219cf[_0x27fc6c(0x113)][_0x27fc6c(0xf5)]===_0x27fc6c(0x167)&&(_0x20e1c3[_0x27fc6c(0x178)]=qs['limit'](_0x4219cf['query'][_0x27fc6c(0x178)]),_0x20e1c3[_0x27fc6c(0x118)]=qs[_0x27fc6c(0x118)](_0x4219cf[_0x27fc6c(0x113)][_0x27fc6c(0x118)])),_0x20e1c3[_0x27fc6c(0x16e)]=qs[_0x27fc6c(0x114)](_0x4219cf[_0x27fc6c(0x113)][_0x27fc6c(0x114)]),_0x20e1c3[_0x27fc6c(0xe6)]=qs[_0x27fc6c(0xfd)](_[_0x27fc6c(0x123)](_0x4219cf[_0x27fc6c(0x113)],_0x2e393a['filters'])),_0x20e1c3['where'][_0x27fc6c(0x150)]=_0x44b4d3['id'],_0x20e1c3=filterAttributes(_0x20e1c3,_0x4219cf[_0x27fc6c(0x113)][_0x27fc6c(0x104)],_0x20e1c3[_0x27fc6c(0xfe)],_0x4219cf[_0x27fc6c(0x11a)],![]),db['CmHopperFinal'][_0x27fc6c(0x146)]({'where':_0x20e1c3[_0x27fc6c(0xe6)]})[_0x27fc6c(0xe9)](function(_0x3b1fe8){const _0x4dc038=_0x27fc6c;return _0x54f2ef['count']=_0x3b1fe8,_0x4219cf[_0x4dc038(0x113)][_0x4dc038(0xf6)]&&(_0x20e1c3[_0x4dc038(0x12d)]=[{'all':!![]}]),db[_0x4dc038(0x17f)][_0x4dc038(0x13d)](_0x20e1c3);})[_0x27fc6c(0xe9)](function(_0x2ef7a9){const _0x2706cb=_0x27fc6c;return _0x54f2ef[_0x2706cb(0x107)]=_0x2ef7a9,_0x54f2ef;});})[_0x3f496f(0xe9)](respondWithFilteredResult(_0x53b7d1,_0x20e1c3))[_0x3f496f(0x100)](handleError(_0x53b7d1,null));},exports[a903_0x4bc928(0xf4)]=function(_0x3be592,_0x4e6000){const _0x575e40=a903_0x4bc928;let _0x2b59a4={'raw':!![],'where':{}};const _0x75b980={},_0x18fa4e={'count':0x0,'rows':[]};return db[_0x575e40(0x11c)][_0x575e40(0x16d)]({'where':{'id':_0x3be592[_0x575e40(0x130)]['id']}})[_0x575e40(0xe9)](handleEntityNotFound(_0x4e6000,null))[_0x575e40(0xe9)](function(_0x1d5c06){const _0x17b81a=_0x575e40;if(_0x1d5c06)return _0x75b980['model']=_[_0x17b81a(0xfa)](db['CmHopperBlack'][_0x17b81a(0x17a)]),_0x75b980[_0x17b81a(0x113)]=_[_0x17b81a(0xfa)](_0x3be592[_0x17b81a(0x113)]),_0x75b980['filters']=_[_0x17b81a(0xf8)](_0x75b980[_0x17b81a(0x115)],_0x75b980[_0x17b81a(0x113)]),_0x2b59a4[_0x17b81a(0xfe)]=_[_0x17b81a(0xf8)](_0x75b980['model'],qs[_0x17b81a(0x171)](_0x3be592[_0x17b81a(0x113)][_0x17b81a(0x171)])),_0x2b59a4[_0x17b81a(0xfe)]=_0x2b59a4[_0x17b81a(0xfe)][_0x17b81a(0xf3)]?_0x2b59a4['attributes']:_0x75b980['model'],typeof _0x3be592[_0x17b81a(0x113)]['nolimit']===_0x17b81a(0x167)&&(_0x2b59a4['limit']=qs[_0x17b81a(0x178)](_0x3be592[_0x17b81a(0x113)][_0x17b81a(0x178)]),_0x2b59a4[_0x17b81a(0x118)]=qs['offset'](_0x3be592[_0x17b81a(0x113)][_0x17b81a(0x118)])),_0x2b59a4[_0x17b81a(0x16e)]=qs[_0x17b81a(0x114)](_0x3be592[_0x17b81a(0x113)]['sort']),_0x2b59a4['where']=qs[_0x17b81a(0xfd)](_['pick'](_0x3be592[_0x17b81a(0x113)],_0x75b980[_0x17b81a(0xfd)])),_0x2b59a4[_0x17b81a(0xe6)][_0x17b81a(0x150)]=_0x1d5c06['id'],_0x2b59a4=filterAttributes(_0x2b59a4,_0x3be592[_0x17b81a(0x113)][_0x17b81a(0x104)],_0x2b59a4['attributes'],_0x3be592['options'],![]),db[_0x17b81a(0x119)][_0x17b81a(0x146)]({'where':_0x2b59a4[_0x17b81a(0xe6)]})['then'](function(_0x15ecce){const _0x5108a1=_0x17b81a;return _0x18fa4e[_0x5108a1(0x146)]=_0x15ecce,_0x3be592[_0x5108a1(0x113)][_0x5108a1(0xf6)]&&(_0x2b59a4[_0x5108a1(0x12d)]=[{'all':!![]}]),db[_0x5108a1(0x119)][_0x5108a1(0x13d)](_0x2b59a4);})['then'](function(_0xa8c95c){const _0x381d8a=_0x17b81a;return _0x18fa4e[_0x381d8a(0x107)]=_0xa8c95c,_0x18fa4e;});})['then'](respondWithFilteredResult(_0x4e6000,_0x2b59a4))[_0x575e40(0x100)](handleError(_0x4e6000,null));},exports[a903_0x4bc928(0x12e)]=function(_0x569450,_0x22857b){const _0xe8d153=a903_0x4bc928;let _0xfc55e={};const _0x3f3770={};let _0x30b706,_0x28dd37;return db['VoiceQueue'][_0xe8d153(0x16d)]({'where':{'id':_0x569450[_0xe8d153(0x130)]['id']}})['then'](handleEntityNotFound(_0x22857b,null))[_0xe8d153(0xe9)](function(_0xbf9135){const _0x9228bc=_0xe8d153;if(_0xbf9135)return _0x30b706=_0xbf9135,_0x3f3770[_0x9228bc(0x115)]=_[_0x9228bc(0xfa)](db[_0x9228bc(0x110)][_0x9228bc(0x17a)]),_0x3f3770[_0x9228bc(0x113)]=_['keys'](_0x569450[_0x9228bc(0x113)]),_0x3f3770[_0x9228bc(0xfd)]=_['intersection'](_0x3f3770[_0x9228bc(0x115)],_0x3f3770['query']),_0xfc55e[_0x9228bc(0xfe)]=_['intersection'](_0x3f3770[_0x9228bc(0x115)],qs[_0x9228bc(0x171)](_0x569450[_0x9228bc(0x113)]['fields'])),_0xfc55e['attributes']=_0xfc55e[_0x9228bc(0xfe)]['length']?_0xfc55e[_0x9228bc(0xfe)]:_0x3f3770[_0x9228bc(0x115)],_0xfc55e[_0x9228bc(0x16e)]=qs['sort'](_0x569450[_0x9228bc(0x113)][_0x9228bc(0x114)]),_0xfc55e['where']=qs[_0x9228bc(0xfd)](_[_0x9228bc(0x123)](_0x569450['query'],_0x3f3770[_0x9228bc(0xfd)])),_0xfc55e=filterAttributes(_0xfc55e,_0x569450[_0x9228bc(0x113)][_0x9228bc(0x104)],_0xfc55e[_0x9228bc(0xfe)],_0x569450[_0x9228bc(0x11a)],![]),_0x30b706['getTeams'](_0xfc55e);})[_0xe8d153(0xe9)](function(_0x361f8e){const _0x12fb49=_0xe8d153;if(_0x361f8e)return _0x28dd37=_0x361f8e[_0x12fb49(0xf3)],typeof _0x569450[_0x12fb49(0x113)]['nolimit']===_0x12fb49(0x167)&&(_0xfc55e[_0x12fb49(0x178)]=qs['limit'](_0x569450[_0x12fb49(0x113)][_0x12fb49(0x178)]),_0xfc55e['offset']=qs['offset'](_0x569450[_0x12fb49(0x113)][_0x12fb49(0x118)])),_0x30b706['getTeams'](_0xfc55e);})[_0xe8d153(0xe9)](function(_0x1ccd23){if(_0x1ccd23)return _0x1ccd23?{'count':_0x28dd37,'rows':_0x1ccd23}:null;})[_0xe8d153(0xe9)](respondWithResult(_0x22857b,null))['catch'](handleError(_0x22857b,null));},exports[a903_0x4bc928(0x160)]=function(_0x2939ae,_0x5744a6){const _0x4ead61=a903_0x4bc928,_0x53ace8=_0x2939ae[_0x4ead61(0x11e)][_0x4ead61(0x12b)],_0x3af1da=_[_0x4ead61(0x10d)](_0x53ace8,'id');return db[_0x4ead61(0x110)][_0x4ead61(0x13d)]({'where':{'id':_0x3af1da},'attributes':['id'],'include':[{'model':db[_0x4ead61(0x15f)],'as':_0x4ead61(0x177),'attributes':['id','name',_0x4ead61(0xfc),'voicePause',_0x4ead61(0xec)],'raw':!![]}]})[_0x4ead61(0xe9)](function(_0x13fd46){const _0x5abc9f=_0x4ead61;if(_0x13fd46){const _0x111689=_['flatMap'](_0x13fd46,function(_0x109646){const _0x3622d7=a903_0x3b6d,_0xcdf3bb=_0x109646['get']({'plain':!![]});return _0xcdf3bb[_0x3622d7(0x177)][_0x3622d7(0x166)](function(_0x32c8bd){const _0x3e3f18=_0x3622d7;_0x32c8bd[_0x3e3f18(0x157)]=_[_0x3e3f18(0x148)](_0x53ace8,{'id':_0xcdf3bb['id']})[_0x3e3f18(0x157)];}),_0xcdf3bb[_0x3622d7(0x177)];});return db['VoiceQueue'][_0x5abc9f(0x16d)]({'where':{'id':_0x2939ae[_0x5abc9f(0x130)]['id']}})[_0x5abc9f(0xe9)](function(_0x220bf0){const _0x45aaf9=_0x5abc9f;return db[_0x45aaf9(0x14c)][_0x45aaf9(0x102)](function(_0x5bc6e0){const _0x2c20b8=_0x45aaf9;return _0x220bf0[_0x2c20b8(0x160)](_0x3af1da,{'transaction':_0x5bc6e0})[_0x2c20b8(0xe9)](function(){const _0x1a40c6=_0x2c20b8,_0x28cf29=_0x111689['map'](_0x3510bf=>{const _0x12f415=a903_0x3b6d;return db[_0x12f415(0x137)][_0x12f415(0x125)]({'where':{'UserId':_0x3510bf['id'],'VoiceQueueId':_0x2939ae[_0x12f415(0x130)]['id']},'defaults':{'penalty':_0x3510bf['penalty']},'transaction':_0x5bc6e0});});return Promise[_0x1a40c6(0x144)](_0x28cf29);})[_0x2c20b8(0xe9)](function(){const _0xcce9f=_0x2c20b8,_0x19ed03=_[_0xcce9f(0x104)](_0x111689,{'online':!![]}),_0x34dc1d=_0x19ed03['map'](_0x4a8372=>{const _0x4fd4b0=_0xcce9f;return db[_0x4fd4b0(0x10c)][_0x4fd4b0(0x13f)]({'membername':_0x4a8372[_0x4fd4b0(0x156)],'UserId':_0x4a8372['id'],'queue_name':_0x220bf0[_0x4fd4b0(0x156)],'VoiceQueueId':_0x220bf0['id'],'interface':_['isNil'](_0x4a8372[_0x4fd4b0(0xec)])?util[_0x4fd4b0(0x13a)]('SIP/%s',_0x4a8372[_0x4fd4b0(0x156)]):_0x4a8372[_0x4fd4b0(0xec)],'paused':_0x4a8372[_0x4fd4b0(0x17e)]||![],'penalty':_0x4a8372[_0x4fd4b0(0x157)]},{'transaction':_0x5bc6e0});});return Promise[_0xcce9f(0x144)](_0x34dc1d);})[_0x2c20b8(0xe9)](function(){const _0x5775bf=_0x2c20b8;_0x111689[_0x5775bf(0x166)](function(_0x1c01d3){const _0x3ec99a=_0x5775bf;socket[_0x3ec99a(0x161)](_0x3ec99a(0x180),{'UserId':_0x1c01d3['id'],'VoiceQueueId':_0x220bf0['id']});});});});});}})[_0x4ead61(0xe9)](respondWithStatusCode(_0x5744a6,null))[_0x4ead61(0x100)](handleError(_0x5744a6,null));},exports[a903_0x4bc928(0x129)]=function(_0x14c0d3,_0x562fc6){const _0x3a8261=a903_0x4bc928;return db[_0x3a8261(0x110)][_0x3a8261(0x13d)]({'where':{'id':_0x14c0d3[_0x3a8261(0x113)][_0x3a8261(0x131)]},'attributes':['id'],'include':[{'model':db[_0x3a8261(0x15f)],'as':_0x3a8261(0x177),'attributes':['id'],'raw':!![]}]})[_0x3a8261(0xe9)](handleEntityNotFound(_0x562fc6,null))['then'](function(_0x4b11b9){const _0x5b0d78=_0x3a8261,_0x3413e6=_['map'](_0x4b11b9,'id');let _0x538ab1=[];const _0x32a715=[],_0x1f088b=squel[_0x5b0d78(0x14f)]();_0x1f088b['field'](_0x5b0d78(0x117))[_0x5b0d78(0xe1)](_0x5b0d78(0x122),'tq')['join'](_0x5b0d78(0xf1),'ut',_0x5b0d78(0x17c))['where'](_0x5b0d78(0x15a),_0x14c0d3[_0x5b0d78(0x130)]['id']);for(let _0x4f9ae2=0x0;_0x4f9ae2<_0x4b11b9[_0x5b0d78(0xf3)];_0x4f9ae2+=0x1){const _0x566185=_0x4b11b9[_0x4f9ae2];for(let _0x2c47cc=0x0;_0x2c47cc<_0x566185[_0x5b0d78(0x177)][_0x5b0d78(0xf3)];_0x2c47cc+=0x1){const _0x36003a=_0x566185[_0x5b0d78(0x177)][_0x2c47cc],_0x2bf5ba=_0x1f088b[_0x5b0d78(0x147)]();_0x2bf5ba[_0x5b0d78(0xe6)](_0x5b0d78(0x140),_0x36003a['id']),_0x32a715[_0x5b0d78(0x132)](db[_0x5b0d78(0x14c)][_0x5b0d78(0x113)](_0x2bf5ba[_0x5b0d78(0x128)](),{'type':QueryTypes['SELECT']})[_0x5b0d78(0xe9)](function(_0x205131){const _0x426fb5=_0x5b0d78;if(_0x205131[_0x426fb5(0xf3)]===0x1)return _0x36003a['id'];else{const _0x481b9a=_[_0x426fb5(0x13b)](_[_0x426fb5(0x10d)](_0x205131,_0x426fb5(0x121)),function(_0x226981){const _0xac730f=_0x426fb5;return _[_0xac730f(0x17d)](_0x3413e6,_0x226981);});if(_0x481b9a)return _0x36003a['id'];}}));}}return Promise['all'](_0x32a715)[_0x5b0d78(0xe9)](function(_0x250331){const _0x476908=_0x5b0d78;return _0x538ab1=_(_0x538ab1)[_0x476908(0x135)](_0x250331)['compact']()['value'](),db[_0x476908(0x11c)][_0x476908(0x16d)]({'where':{'id':_0x14c0d3[_0x476908(0x130)]['id']}})[_0x476908(0xe9)](function(_0xd0d115){const _0x7d4adb=_0x476908;return db[_0x7d4adb(0x14c)][_0x7d4adb(0x102)](function(_0x169b12){const _0x379de8=_0x7d4adb;return _0xd0d115[_0x379de8(0x129)](_0x14c0d3['query'][_0x379de8(0x131)],{'transaction':_0x169b12})['then'](function(){const _0x330e6f=_0x379de8;if(!_[_0x330e6f(0xe2)](_0x538ab1))return _0xd0d115[_0x330e6f(0x111)](_0x538ab1,{'transaction':_0x169b12})[_0x330e6f(0xe9)](function(){const _0x70b14b=_0x330e6f;return db['UserVoiceQueueRt'][_0x70b14b(0xff)]({'where':{'VoiceQueueId':_0x14c0d3[_0x70b14b(0x130)]['id'],'UserId':_0x538ab1},'transaction':_0x169b12});});})[_0x379de8(0xe9)](function(){_0x538ab1['forEach'](function(_0x4ca042){const _0x169b94=a903_0x3b6d;socket[_0x169b94(0x161)]('userVoiceQueue:remove',{'UserId':_0x4ca042,'VoiceQueueId':_0xd0d115['id']});});});});});});})['then'](respondWithStatusCode(_0x562fc6,null))[_0x3a8261(0x100)](handleError(_0x562fc6,null));},exports[a903_0x4bc928(0x10e)]=function(_0x27bd27,_0x284c8b){const _0x39cca6=a903_0x4bc928;let _0x2abec4,_0x5927f0;return db['VoiceQueue'][_0x39cca6(0x16d)]({'where':{'id':_0x27bd27[_0x39cca6(0x130)]['id']}})[_0x39cca6(0xe9)](function(_0x5b363d){const _0x24875a=_0x39cca6;if(_0x5b363d)return _0x5927f0=_0x5b363d,_0x5b363d['addAgents'](_0x27bd27[_0x24875a(0x11e)][_0x24875a(0x131)],{'through':_['omit'](_0x27bd27[_0x24875a(0x11e)],[_0x24875a(0x131),'id'])})['then'](function(_0x1ff25a){const _0x2a8bd8=_0x24875a;for(let _0x47d1f3=0x0;_0x47d1f3<_0x27bd27[_0x2a8bd8(0x11e)][_0x2a8bd8(0x131)]['length'];_0x47d1f3+=0x1){socket[_0x2a8bd8(0x161)](_0x2a8bd8(0x180),{'UserId':_0x27bd27[_0x2a8bd8(0x11e)][_0x2a8bd8(0x131)][_0x47d1f3],'VoiceQueueId':_0x27bd27[_0x2a8bd8(0x130)]['id']});}return _0x1ff25a;});})[_0x39cca6(0xe9)](function(_0x29e1c0){const _0x577dec=_0x39cca6;_0x2abec4=_0x29e1c0||[];if(_0x5927f0)return db[_0x577dec(0x15f)][_0x577dec(0x13d)]({'where':{'id':_0x27bd27[_0x577dec(0x11e)][_0x577dec(0x131)]},'attributes':['id',_0x577dec(0x156),_0x577dec(0xfc),_0x577dec(0x17e),_0x577dec(0xec)],'raw':!![]});})[_0x39cca6(0xe9)](function(_0x3a5d04){const _0x4056cf=_0x39cca6;if(!_[_0x4056cf(0xe2)](_0x3a5d04)){const _0xc40d1b=[];for(let _0x5930c7=0x0;_0x5930c7<_0x3a5d04[_0x4056cf(0xf3)];_0x5930c7++){_0x3a5d04[_0x5930c7][_0x4056cf(0xfc)]&&_0xc40d1b[_0x4056cf(0x132)](db['UserVoiceQueueRt'][_0x4056cf(0x13f)]({'membername':_0x3a5d04[_0x5930c7][_0x4056cf(0x156)],'UserId':_0x3a5d04[_0x5930c7]['id'],'queue_name':_0x5927f0[_0x4056cf(0x156)],'VoiceQueueId':_0x5927f0['id'],'interface':_['isNil'](_0x3a5d04[_0x5930c7][_0x4056cf(0xec)])?util[_0x4056cf(0x13a)](_0x4056cf(0x142),_0x3a5d04[_0x5930c7][_0x4056cf(0x156)]):_0x3a5d04[_0x5930c7][_0x4056cf(0xec)],'paused':_0x3a5d04[_0x5930c7][_0x4056cf(0x17e)]||![],'penalty':_0x27bd27[_0x4056cf(0x11e)]['penalty']||0x0}));}return Promise[_0x4056cf(0x144)](_0xc40d1b);}})[_0x39cca6(0xe9)](function(){return _0x2abec4;})['then'](respondWithResult(_0x284c8b,null))[_0x39cca6(0x100)](handleError(_0x284c8b,null));},exports['removeAgents']=function(_0x32dca5,_0x41f405){const _0x56a8be=a903_0x4bc928;return db[_0x56a8be(0x11c)][_0x56a8be(0x16d)]({'where':{'id':_0x32dca5[_0x56a8be(0x130)]['id']}})[_0x56a8be(0xe9)](handleEntityNotFound(_0x41f405,null))[_0x56a8be(0xe9)](function(_0x312af5){const _0x363016=_0x56a8be;if(_0x312af5)return _0x312af5['removeAgents'](_0x32dca5['query']['ids'])[_0x363016(0xe9)](function(){const _0x366ab1=_0x363016;if(_['isArray'](_0x32dca5[_0x366ab1(0x113)][_0x366ab1(0x131)]))for(let _0x3072b9=0x0;_0x3072b9<_0x32dca5[_0x366ab1(0x113)]['ids'][_0x366ab1(0xf3)];_0x3072b9+=0x1){socket[_0x366ab1(0x161)](_0x366ab1(0x168),{'UserId':Number(_0x32dca5[_0x366ab1(0x113)][_0x366ab1(0x131)][_0x3072b9]),'VoiceQueueId':Number(_0x32dca5[_0x366ab1(0x130)]['id'])});}else socket[_0x366ab1(0x161)](_0x366ab1(0x168),{'UserId':Number(_0x32dca5['query'][_0x366ab1(0x131)]),'VoiceQueueId':Number(_0x32dca5['params']['id'])});});})['then'](function(_0x4bbf13){const _0x48d170=_0x56a8be;return db[_0x48d170(0x10c)][_0x48d170(0xff)]({'where':{'VoiceQueueId':_0x32dca5[_0x48d170(0x130)]['id'],'UserId':_0x32dca5[_0x48d170(0x113)][_0x48d170(0x131)]}})['then'](function(){return _0x4bbf13;});})[_0x56a8be(0xe9)](respondWithStatusCode(_0x41f405,null))[_0x56a8be(0x100)](handleError(_0x41f405,null));},exports[a903_0x4bc928(0x169)]=function(_0xf0bf69,_0x2817a){const _0x45b3fc=a903_0x4bc928;let _0x69d053={};const _0x455d75={};let _0x2dbf69,_0x96083c;return db['VoiceQueue'][_0x45b3fc(0x16d)]({'where':{'id':_0xf0bf69[_0x45b3fc(0x130)]['id']}})[_0x45b3fc(0xe9)](handleEntityNotFound(_0x2817a,null))[_0x45b3fc(0xe9)](function(_0x33a7c7){const _0xfff06e=_0x45b3fc;if(_0x33a7c7)return _0x2dbf69=_0x33a7c7,_0x455d75['model']=_[_0xfff06e(0xfa)](db[_0xfff06e(0x15f)][_0xfff06e(0x17a)]),_0x455d75['query']=_[_0xfff06e(0xfa)](_0xf0bf69[_0xfff06e(0x113)]),_0x455d75[_0xfff06e(0xfd)]=_[_0xfff06e(0xf8)](_0x455d75[_0xfff06e(0x115)],_0x455d75['query']),_0x69d053[_0xfff06e(0xfe)]=_[_0xfff06e(0xf8)](_0x455d75[_0xfff06e(0x115)],qs[_0xfff06e(0x171)](_0xf0bf69[_0xfff06e(0x113)][_0xfff06e(0x171)])),_0x69d053[_0xfff06e(0xfe)]=_0x69d053[_0xfff06e(0xfe)][_0xfff06e(0xf3)]?_0x69d053['attributes']:_0x455d75['model'],_0x69d053[_0xfff06e(0x16e)]=qs[_0xfff06e(0x114)](_0xf0bf69[_0xfff06e(0x113)][_0xfff06e(0x114)]),_0x69d053[_0xfff06e(0xe6)]=qs['filters'](_[_0xfff06e(0x123)](_0xf0bf69['query'],_0x455d75[_0xfff06e(0xfd)])),_0x69d053=filterAttributes(_0x69d053,_0xf0bf69['query']['filter'],_0x69d053[_0xfff06e(0xfe)],_0xf0bf69[_0xfff06e(0x11a)],![]),_0x2dbf69[_0xfff06e(0x169)](_0x69d053);})[_0x45b3fc(0xe9)](function(_0xf4f535){const _0x387c24=_0x45b3fc;if(_0xf4f535)return _0x96083c=_0xf4f535[_0x387c24(0xf3)],typeof _0xf0bf69['query'][_0x387c24(0xf5)]===_0x387c24(0x167)&&(_0x69d053[_0x387c24(0x178)]=qs['limit'](_0xf0bf69[_0x387c24(0x113)][_0x387c24(0x178)]),_0x69d053[_0x387c24(0x118)]=qs[_0x387c24(0x118)](_0xf0bf69['query']['offset'])),_0x2dbf69['getAgents'](_0x69d053);})['then'](function(_0x798f0d){if(_0x798f0d)return _0x798f0d?{'count':_0x96083c,'rows':_0x798f0d}:null;})[_0x45b3fc(0xe9)](respondWithResult(_0x2817a,null))[_0x45b3fc(0x100)](handleError(_0x2817a,null));},exports['getMembers']=function(_0xe0a336,_0x551bef){const _0x2ac655=a903_0x4bc928;let _0x8e2d69={};const _0x403c7e={};let _0x5c831c,_0x4f1d10;return db[_0x2ac655(0x11c)][_0x2ac655(0x16d)]({'where':{'id':_0xe0a336['params']['id']}})[_0x2ac655(0xe9)](handleEntityNotFound(_0x551bef,null))[_0x2ac655(0xe9)](function(_0x2f705b){const _0xe9e5e8=_0x2ac655;if(_0x2f705b)return _0x5c831c=_0x2f705b,_0x403c7e[_0xe9e5e8(0x115)]=_[_0xe9e5e8(0xfa)](db['UserVoiceQueueRt']['rawAttributes']),_0x403c7e['query']=_[_0xe9e5e8(0xfa)](_0xe0a336[_0xe9e5e8(0x113)]),_0x403c7e[_0xe9e5e8(0xfd)]=_[_0xe9e5e8(0xf8)](_0x403c7e[_0xe9e5e8(0x115)],_0x403c7e[_0xe9e5e8(0x113)]),_0x8e2d69[_0xe9e5e8(0xfe)]=_[_0xe9e5e8(0xf8)](_0x403c7e[_0xe9e5e8(0x115)],qs[_0xe9e5e8(0x171)](_0xe0a336[_0xe9e5e8(0x113)]['fields'])),_0x8e2d69[_0xe9e5e8(0xfe)]=_0x8e2d69[_0xe9e5e8(0xfe)][_0xe9e5e8(0xf3)]?_0x8e2d69[_0xe9e5e8(0xfe)]:_0x403c7e[_0xe9e5e8(0x115)],_0x8e2d69[_0xe9e5e8(0x16e)]=qs[_0xe9e5e8(0x114)](_0xe0a336[_0xe9e5e8(0x113)][_0xe9e5e8(0x114)]),_0x8e2d69[_0xe9e5e8(0xe6)]=qs[_0xe9e5e8(0xfd)](_[_0xe9e5e8(0x123)](_0xe0a336[_0xe9e5e8(0x113)],_0x403c7e['filters'])),_0x8e2d69=filterAttributes(_0x8e2d69,_0xe0a336[_0xe9e5e8(0x113)][_0xe9e5e8(0x104)],_0x8e2d69['attributes'],_0xe0a336[_0xe9e5e8(0x11a)],![]),_0x5c831c[_0xe9e5e8(0x12a)](_0x8e2d69);})['then'](function(_0x25ee60){const _0xb00988=_0x2ac655;if(_0x25ee60)return _0x4f1d10=_0x25ee60[_0xb00988(0xf3)],typeof _0xe0a336[_0xb00988(0x113)]['nolimit']===_0xb00988(0x167)&&(_0x8e2d69[_0xb00988(0x178)]=qs[_0xb00988(0x178)](_0xe0a336[_0xb00988(0x113)][_0xb00988(0x178)]),_0x8e2d69[_0xb00988(0x118)]=qs[_0xb00988(0x118)](_0xe0a336[_0xb00988(0x113)][_0xb00988(0x118)])),_0x5c831c[_0xb00988(0x12a)](_0x8e2d69);})[_0x2ac655(0xe9)](function(_0x3038bc){return _0x3038bc?{'count':_0x4f1d10,'rows':_0x3038bc}:null;})[_0x2ac655(0xe9)](respondWithResult(_0x551bef,null))[_0x2ac655(0x100)](handleError(_0x551bef,null));},exports['getLists']=function(_0xfaebd7,_0x6df00e){const _0x13584f=a903_0x4bc928;let _0x1d2a97={};const _0x49f014={};let _0x1110a4,_0x135d61;return db[_0x13584f(0x11c)][_0x13584f(0x16d)]({'where':{'id':_0xfaebd7['params']['id']}})[_0x13584f(0xe9)](handleEntityNotFound(_0x6df00e,null))[_0x13584f(0xe9)](function(_0x50b505){const _0x3bfd0f=_0x13584f;if(_0x50b505)return _0x1110a4=_0x50b505,_0x49f014[_0x3bfd0f(0x115)]=_[_0x3bfd0f(0xfa)](db[_0x3bfd0f(0x149)][_0x3bfd0f(0x17a)]),_0x49f014[_0x3bfd0f(0x113)]=_[_0x3bfd0f(0xfa)](_0xfaebd7[_0x3bfd0f(0x113)]),_0x49f014[_0x3bfd0f(0xfd)]=_[_0x3bfd0f(0xf8)](_0x49f014[_0x3bfd0f(0x115)],_0x49f014['query']),_0x1d2a97['attributes']=_[_0x3bfd0f(0xf8)](_0x49f014['model'],qs[_0x3bfd0f(0x171)](_0xfaebd7[_0x3bfd0f(0x113)]['fields'])),_0x1d2a97[_0x3bfd0f(0xfe)]=_0x1d2a97[_0x3bfd0f(0xfe)]['length']?_0x1d2a97['attributes']:_0x49f014['model'],_0x1d2a97[_0x3bfd0f(0x16e)]=qs['sort'](_0xfaebd7[_0x3bfd0f(0x113)][_0x3bfd0f(0x114)]),_0x1d2a97[_0x3bfd0f(0xe6)]=qs['filters'](_['pick'](_0xfaebd7[_0x3bfd0f(0x113)],_0x49f014[_0x3bfd0f(0xfd)])),_0x1d2a97=filterAttributes(_0x1d2a97,_0xfaebd7['query'][_0x3bfd0f(0x104)],_0x1d2a97[_0x3bfd0f(0xfe)],_0xfaebd7['options'],![]),_0x1110a4[_0x3bfd0f(0x14b)](_0x1d2a97);})[_0x13584f(0xe9)](function(_0x17366a){const _0x35af5e=_0x13584f;if(_0x17366a)return _0x135d61=_0x17366a[_0x35af5e(0xf3)],typeof _0xfaebd7['query'][_0x35af5e(0xf5)]===_0x35af5e(0x167)&&(_0x1d2a97[_0x35af5e(0x178)]=qs[_0x35af5e(0x178)](_0xfaebd7[_0x35af5e(0x113)][_0x35af5e(0x178)]),_0x1d2a97['offset']=qs['offset'](_0xfaebd7[_0x35af5e(0x113)][_0x35af5e(0x118)])),_0x1110a4[_0x35af5e(0x14b)](_0x1d2a97);})[_0x13584f(0xe9)](function(_0x5e6f3d){if(_0x5e6f3d)return _0x5e6f3d?{'count':_0x135d61,'rows':_0x5e6f3d}:null;})['then'](respondWithResult(_0x6df00e,null))['catch'](handleError(_0x6df00e,null));},exports[a903_0x4bc928(0x155)]=function(_0x21bd9a,_0x43bd13){const _0x3a2bb7=a903_0x4bc928;let _0x2fe0c5,_0x5f56bd;return db[_0x3a2bb7(0x11c)][_0x3a2bb7(0x16d)]({'where':{'id':_0x21bd9a[_0x3a2bb7(0x130)]['id']}})[_0x3a2bb7(0xe9)](handleEntityNotFound(_0x43bd13,null))[_0x3a2bb7(0xe9)](function(_0x5509b7){const _0x27cb65=_0x3a2bb7;if(_0x5509b7)return _0x5f56bd=_0x5509b7,_0x5509b7[_0x27cb65(0x155)](_0x21bd9a[_0x27cb65(0x11e)]['ids'],{'through':_['omit'](_0x21bd9a[_0x27cb65(0x11e)],['ids','id'])});return null;})[_0x3a2bb7(0xe9)](function(_0x96c720){const _0x3f0661=_0x3a2bb7;let _0x723be8;_0x2fe0c5=_0x96c720||[];const _0x4e9a2e=[];if(_0x96c720){for(let _0x29c048=0x0;_0x29c048<_0x96c720['length'];_0x29c048+=0x1){const _0x5c332d=_0x96c720[_0x29c048][_0x3f0661(0x10a)]({'plain':!![]});_0x5f56bd[_0x3f0661(0x15d)]=_0x21bd9a[_0x3f0661(0x11e)][_0x3f0661(0x15d)]?_0x21bd9a[_0x3f0661(0x11e)][_0x3f0661(0x15d)]:_0x5f56bd[_0x3f0661(0x15d)];switch(_0x5f56bd[_0x3f0661(0x15d)]){case'always':_0x723be8=squel['insert']()[_0x3f0661(0x163)]('cm_hopper')[_0x3f0661(0x10b)]([_0x3f0661(0x138),'scheduledAt',_0x3f0661(0x126),_0x3f0661(0x153),_0x3f0661(0x150),_0x3f0661(0x145),_0x3f0661(0x179)],squel['select']()[_0x3f0661(0x12f)](_0x3f0661(0x138),_0x3f0661(0x138))['field']('NOW()',_0x3f0661(0x134))[_0x3f0661(0x12f)]('id',_0x3f0661(0x126))[_0x3f0661(0x12f)](_0x5c332d[_0x3f0661(0x165)][_0x3f0661(0x128)](),'ListId')[_0x3f0661(0x12f)](_0x21bd9a[_0x3f0661(0x130)]['id']['toString'](),_0x3f0661(0x150))['field'](_0x3f0661(0x116),_0x3f0661(0x145))[_0x3f0661(0x12f)]('NOW()',_0x3f0661(0x179))[_0x3f0661(0xe1)](_0x3f0661(0x162))[_0x3f0661(0xe6)]('deletedAt\x20IS\x20NULL')[_0x3f0661(0xe6)](_0x3f0661(0x124),_0x5c332d['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x3f0661(0xe6)](_0x3f0661(0xea),squel[_0x3f0661(0x14f)]()['field'](_0x3f0661(0xf2))[_0x3f0661(0xe1)](_0x3f0661(0xe4))[_0x3f0661(0xe6)](_0x3f0661(0x15a),_0x21bd9a[_0x3f0661(0x130)]['id'][_0x3f0661(0x128)]()))[_0x3f0661(0xe6)](_0x3f0661(0xea),squel[_0x3f0661(0x14f)]()[_0x3f0661(0x12f)](_0x3f0661(0xef))[_0x3f0661(0xe1)](_0x3f0661(0x15c))['where'](_0x3f0661(0x15a),_0x21bd9a[_0x3f0661(0x130)]['id']['toString']())))[_0x3f0661(0x128)]();break;case _0x3f0661(0xe0):_0x723be8=squel['insert']()[_0x3f0661(0x163)](_0x3f0661(0x15c))['fromQuery']([_0x3f0661(0x138),_0x3f0661(0x134),_0x3f0661(0x126),'ListId',_0x3f0661(0x150),_0x3f0661(0x145),_0x3f0661(0x179)],squel[_0x3f0661(0x14f)]()[_0x3f0661(0x12f)](_0x3f0661(0x138),_0x3f0661(0x138))['field'](_0x3f0661(0x116),'scheduledAt')[_0x3f0661(0x12f)]('id','ContactId')[_0x3f0661(0x12f)](_0x5c332d[_0x3f0661(0x165)][_0x3f0661(0x128)](),'ListId')[_0x3f0661(0x12f)](_0x21bd9a[_0x3f0661(0x130)]['id'][_0x3f0661(0x128)](),'VoiceQueueId')[_0x3f0661(0x12f)](_0x3f0661(0x116),'createdAt')[_0x3f0661(0x12f)]('NOW()',_0x3f0661(0x179))[_0x3f0661(0xe1)]('cm_contacts')[_0x3f0661(0xe6)](_0x3f0661(0x143))['where'](_0x3f0661(0x124),_0x5c332d[_0x3f0661(0x165)]['toString']())[_0x3f0661(0xe6)](_0x3f0661(0x176))[_0x3f0661(0xe6)]('phone\x20NOT\x20IN\x20(?)',squel[_0x3f0661(0x14f)]()['field'](_0x3f0661(0xef))[_0x3f0661(0xe1)]('cm_hopper')[_0x3f0661(0xe6)](_0x3f0661(0x15a),_0x21bd9a[_0x3f0661(0x130)]['id']['toString']())))[_0x3f0661(0x128)]();break;default:_0x723be8=squel[_0x3f0661(0xf7)]()[_0x3f0661(0x163)](_0x3f0661(0x15c))['fromQuery']([_0x3f0661(0x138),'scheduledAt',_0x3f0661(0x126),'ListId',_0x3f0661(0x150),_0x3f0661(0x145),_0x3f0661(0x179)],squel['select']()[_0x3f0661(0x12f)]('phone',_0x3f0661(0x138))['field']('NOW()',_0x3f0661(0x134))[_0x3f0661(0x12f)]('id',_0x3f0661(0x126))[_0x3f0661(0x12f)](_0x5c332d[_0x3f0661(0x165)][_0x3f0661(0x128)](),'ListId')[_0x3f0661(0x12f)](_0x21bd9a[_0x3f0661(0x130)]['id'][_0x3f0661(0x128)](),_0x3f0661(0x150))[_0x3f0661(0x12f)]('NOW()',_0x3f0661(0x145))[_0x3f0661(0x12f)]('NOW()',_0x3f0661(0x179))[_0x3f0661(0xe1)](_0x3f0661(0x162))[_0x3f0661(0xe6)](_0x3f0661(0x143))['where'](_0x3f0661(0x124),_0x5c332d[_0x3f0661(0x165)][_0x3f0661(0x128)]())[_0x3f0661(0xe6)]('phone\x20IS\x20NOT\x20NULL'))[_0x3f0661(0x128)]();}_0x4e9a2e[_0x3f0661(0x132)](db[_0x3f0661(0x14c)][_0x3f0661(0x113)](_0x723be8));}return Promise['all'](_0x4e9a2e);}})[_0x3a2bb7(0xe9)](function(){return _0x2fe0c5;})[_0x3a2bb7(0xe9)](respondWithResult(_0x43bd13,null))[_0x3a2bb7(0x100)](handleError(_0x43bd13,null));},exports['removeLists']=function(_0x4f9e4e,_0x5a0fb8){const _0x21692d=a903_0x4bc928;return db[_0x21692d(0x11c)]['findOne']({'where':{'id':_0x4f9e4e['params']['id']}})[_0x21692d(0xe9)](handleEntityNotFound(_0x5a0fb8,null))[_0x21692d(0xe9)](function(_0x5bfe0b){const _0x3f94a4=_0x21692d;if(_0x5bfe0b)return _0x5bfe0b[_0x3f94a4(0x170)](_0x4f9e4e[_0x3f94a4(0x113)][_0x3f94a4(0x131)]);})['then'](function(_0x26f231){const _0x4661f1=_0x21692d;if(_0x26f231)return db[_0x4661f1(0x17b)][_0x4661f1(0xff)]({'where':{'ListId':_0x4f9e4e[_0x4661f1(0x113)]['ids'],'VoiceQueueId':_0x4f9e4e['params']['id']}})[_0x4661f1(0xe9)](function(){return _0x26f231;});})['then'](respondWithStatusCode(_0x5a0fb8,null))[_0x21692d(0x100)](handleError(_0x5a0fb8,null));},exports[a903_0x4bc928(0x11f)]=function(_0x36946d,_0x4b030a){const _0x3aff26=a903_0x4bc928;let _0x48387d={};const _0xddb76={};let _0x3712ea,_0x3d4c56;return db['VoiceQueue'][_0x3aff26(0x16d)]({'where':{'id':_0x36946d[_0x3aff26(0x130)]['id']}})[_0x3aff26(0xe9)](handleEntityNotFound(_0x4b030a,null))['then'](function(_0x3e0a90){const _0x475395=_0x3aff26;if(_0x3e0a90)return _0x3712ea=_0x3e0a90,_0xddb76['model']=_['keys'](db['CmList'][_0x475395(0x17a)]),_0xddb76[_0x475395(0x113)]=_[_0x475395(0xfa)](_0x36946d[_0x475395(0x113)]),_0xddb76[_0x475395(0xfd)]=_[_0x475395(0xf8)](_0xddb76[_0x475395(0x115)],_0xddb76['query']),_0x48387d['attributes']=_[_0x475395(0xf8)](_0xddb76['model'],qs[_0x475395(0x171)](_0x36946d[_0x475395(0x113)][_0x475395(0x171)])),_0x48387d[_0x475395(0xfe)]=_0x48387d['attributes']['length']?_0x48387d['attributes']:_0xddb76[_0x475395(0x115)],_0x48387d['order']=qs[_0x475395(0x114)](_0x36946d[_0x475395(0x113)][_0x475395(0x114)]),_0x48387d[_0x475395(0xe6)]=qs['filters'](_[_0x475395(0x123)](_0x36946d['query'],_0xddb76['filters'])),_0x48387d=filterAttributes(_0x48387d,_0x36946d[_0x475395(0x113)][_0x475395(0x104)],_0x48387d[_0x475395(0xfe)],_0x36946d[_0x475395(0x11a)],![]),_0x3712ea[_0x475395(0x11f)](_0x48387d);})[_0x3aff26(0xe9)](function(_0x3e6e2b){const _0x5d4e4d=_0x3aff26;if(_0x3e6e2b)return _0x3d4c56=_0x3e6e2b[_0x5d4e4d(0xf3)],typeof _0x36946d[_0x5d4e4d(0x113)][_0x5d4e4d(0xf5)]==='undefined'&&(_0x48387d[_0x5d4e4d(0x178)]=qs[_0x5d4e4d(0x178)](_0x36946d[_0x5d4e4d(0x113)][_0x5d4e4d(0x178)]),_0x48387d[_0x5d4e4d(0x118)]=qs['offset'](_0x36946d[_0x5d4e4d(0x113)][_0x5d4e4d(0x118)])),_0x3712ea[_0x5d4e4d(0x11f)](_0x48387d);})[_0x3aff26(0xe9)](function(_0x21bd35){if(_0x21bd35)return _0x21bd35?{'count':_0x3d4c56,'rows':_0x21bd35}:null;})[_0x3aff26(0xe9)](respondWithResult(_0x4b030a,null))[_0x3aff26(0x100)](handleError(_0x4b030a,null));},exports[a903_0x4bc928(0x120)]=function(_0x598216,_0x3bea0f){const _0x4218b4=a903_0x4bc928;let _0x14e15c;return db[_0x4218b4(0x11c)][_0x4218b4(0x16d)]({'where':{'id':_0x598216['params']['id']}})['then'](handleEntityNotFound(_0x3bea0f,null))[_0x4218b4(0xe9)](function(_0x25b7e3){const _0x32b869=_0x4218b4;if(_0x25b7e3)return _0x25b7e3[_0x32b869(0x120)](_0x598216[_0x32b869(0x11e)][_0x32b869(0x131)],{'through':_['omit'](_0x598216[_0x32b869(0x11e)],[_0x32b869(0x131),'id'])});return null;})[_0x4218b4(0xe9)](function(_0x224caf){const _0x2644d6=_0x4218b4;let _0xd2fe;_0x14e15c=_0x224caf||[];const _0x2fe960=[];if(_0x224caf){for(let _0x5e8bc6=0x0;_0x5e8bc6<_0x224caf['length'];_0x5e8bc6+=0x1){const _0x599c8b=_0x224caf[_0x5e8bc6][_0x2644d6(0x10a)]({'plain':!![]});_0xd2fe=squel[_0x2644d6(0xf7)]()['into']('cm_hopper_black')[_0x2644d6(0x10b)]([_0x2644d6(0x138),_0x2644d6(0x126),_0x2644d6(0x153),_0x2644d6(0x150),_0x2644d6(0x145),_0x2644d6(0x179)],squel[_0x2644d6(0x14f)]()['field']('phone','phone')[_0x2644d6(0x12f)]('id','ContactId')['field'](_0x599c8b[_0x2644d6(0x165)][_0x2644d6(0x128)](),_0x2644d6(0x153))['field'](_0x598216[_0x2644d6(0x130)]['id'][_0x2644d6(0x128)](),_0x2644d6(0x150))['field'](_0x2644d6(0x116),_0x2644d6(0x145))[_0x2644d6(0x12f)](_0x2644d6(0x116),_0x2644d6(0x179))['from'](_0x2644d6(0x162))[_0x2644d6(0xe6)](_0x2644d6(0x143))[_0x2644d6(0xe6)]('ListId\x20=\x20?',_0x599c8b[_0x2644d6(0x165)][_0x2644d6(0x128)]())['where'](_0x2644d6(0x176)))['toString'](),_0x2fe960['push'](db[_0x2644d6(0x14c)][_0x2644d6(0x113)](_0xd2fe));}return Promise[_0x2644d6(0x144)](_0x2fe960);}})[_0x4218b4(0xe9)](function(){return _0x14e15c;})[_0x4218b4(0xe9)](respondWithResult(_0x3bea0f,null))[_0x4218b4(0x100)](handleError(_0x3bea0f,null));},exports['removeBlackLists']=function(_0x5b2f29,_0xc4fe0){const _0xbd207=a903_0x4bc928;return db[_0xbd207(0x11c)][_0xbd207(0x16d)]({'where':{'id':_0x5b2f29['params']['id']}})[_0xbd207(0xe9)](handleEntityNotFound(_0xc4fe0,null))[_0xbd207(0xe9)](function(_0xc5bf7a){const _0x4f2b61=_0xbd207;if(_0xc5bf7a)return _0xc5bf7a[_0x4f2b61(0xfb)](_0x5b2f29[_0x4f2b61(0x113)][_0x4f2b61(0x131)]);})[_0xbd207(0xe9)](function(_0x26936d){const _0x34863b=_0xbd207;if(_0x26936d)return db[_0x34863b(0x119)][_0x34863b(0xff)]({'where':{'ListId':_0x5b2f29['query']['ids'],'VoiceQueueId':_0x5b2f29[_0x34863b(0x130)]['id']}})['then'](function(){return _0x26936d;});})[_0xbd207(0xe9)](respondWithStatusCode(_0xc4fe0,null))[_0xbd207(0x100)](handleError(_0xc4fe0,null));};