Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / api / voiceQueue / voiceQueue.controller.js
index 46b2c8b..df72357 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f16=['update','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','name','UserProfileResource','end','error','send','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','merge','VIRTUAL','options','VoiceQueue','includeAll','findAll','rows','catch','show','params','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','getHoppers','findOne','CmHopper','rawAttributes','hasOwnProperty','sort','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueue','isNil','SIP/%s','emit','removeTeams','ids','select','tq.TeamId','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','union','isEmpty','UserVoiceQueueRt','userVoiceQueue:remove','addAgents','spread','userVoiceQueue:save','push','format','removeAgents','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','field','phone','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','CmListId','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','ContactId','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','./voiceQueue.socket','register','sendStatus','status','count','offset','limit','set','apply','reject','save'];(function(_0x3f3f06,_0x581e5b){var _0x140feb=function(_0x4cc383){while(--_0x4cc383){_0x3f3f06['push'](_0x3f3f06['shift']());}};_0x140feb(++_0x581e5b);}(_0x2f16,0x148));var _0x62f1=function(_0x494b37,_0x3129da){_0x494b37=_0x494b37-0x0;var _0x2a306c=_0x2f16[_0x494b37];return _0x2a306c;};'use strict';var pdf=require(_0x62f1('0x0'));var emlformat=require(_0x62f1('0x1'));var rimraf=require(_0x62f1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x62f1('0x3'));var rp=require(_0x62f1('0x4'));var moment=require(_0x62f1('0x5'));var BPromise=require(_0x62f1('0x6'));var Mustache=require(_0x62f1('0x7'));var util=require(_0x62f1('0x8'));var path=require(_0x62f1('0x9'));var sox=require(_0x62f1('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x62f1('0xb'));var squel=require(_0x62f1('0xc'));var crypto=require('crypto');var jsforce=require(_0x62f1('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x62f1('0xe'));var querystring=require(_0x62f1('0xf'));var Papa=require(_0x62f1('0x10'));var Redis=require(_0x62f1('0x11'));var authService=require(_0x62f1('0x12'));var qs=require(_0x62f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x62f1('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x62f1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x62f1('0x16'))['db'];config[_0x62f1('0x17')]=_['defaults'](config[_0x62f1('0x17')],{'host':_0x62f1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62f1('0x17')]));require(_0x62f1('0x19'))[_0x62f1('0x1a')](socket);function respondWithStatusCode(_0x6dbb62,_0xb83758){_0xb83758=_0xb83758||0xcc;return function(_0x5f1d8d){if(_0x5f1d8d){return _0x6dbb62[_0x62f1('0x1b')](_0xb83758);}return _0x6dbb62[_0x62f1('0x1c')](_0xb83758)['end']();};}function respondWithResult(_0x40c062,_0x21a54e){_0x21a54e=_0x21a54e||0xc8;return function(_0x1f30da){if(_0x1f30da){return _0x40c062['status'](_0x21a54e)['json'](_0x1f30da);}};}function respondWithFilteredResult(_0x536889,_0x5d37d1){return function(_0x3db3dd){if(_0x3db3dd){var _0x11d3c4=_0x3db3dd[_0x62f1('0x1d')],_0x208e40=_0x5d37d1[_0x62f1('0x1e')],_0x1505ba=_0x5d37d1[_0x62f1('0x1e')]+_0x5d37d1[_0x62f1('0x1f')],_0xa468dd;if(_0x1505ba>=_0x11d3c4){_0x1505ba=_0x11d3c4;_0xa468dd=0xc8;}else{_0xa468dd=0xce;}_0x536889[_0x62f1('0x1c')](_0xa468dd);return _0x536889[_0x62f1('0x20')]('Content-Range',_0x208e40+'-'+_0x1505ba+'/'+_0x11d3c4)['json'](_0x3db3dd);}return null;};}function patchUpdates(_0x5479f2){return function(_0x20b00a){try{jsonpatch[_0x62f1('0x21')](_0x20b00a,_0x5479f2,!![]);}catch(_0x56b777){return BPromise[_0x62f1('0x22')](_0x56b777);}return _0x20b00a[_0x62f1('0x23')]();};}function saveUpdates(_0x4d5483,_0x3e720f){return function(_0x3b4343){if(_0x3b4343){return _0x3b4343[_0x62f1('0x24')](_0x4d5483)[_0x62f1('0x25')](function(_0x1f587e){return _0x1f587e;});}return null;};}function removeEntity(_0x43f789,_0x302c32){return function(_0x4c3843){if(_0x4c3843){return _0x4c3843[_0x62f1('0x26')]()[_0x62f1('0x25')](function(){var _0x2ba025=_0x4c3843['get']({'plain':!![]});var _0x5884eb=[{'name':_0x62f1('0x27'),'value':_0x62f1('0x28'),'ignore':![]},{'name':_0x62f1('0x29'),'value':_0x62f1('0x2a'),'ignore':![]}];var _0x265502=_(_0x5884eb)[_0x62f1('0x2b')](_0x62f1('0x2c'))[_0x62f1('0x2d')]('value')[_0x62f1('0x2e')]();if(_[_0x62f1('0x2f')](_0x265502,_0x2ba025['type'])){return;}var _0x372173=_['find'](_0x5884eb,[_0x62f1('0x2e'),_0x2ba025[_0x62f1('0x30')]])[_0x62f1('0x31')];return db[_0x62f1('0x32')][_0x62f1('0x26')]({'where':{'type':_0x372173,'resourceId':_0x2ba025['id']}})[_0x62f1('0x25')](function(){return _0x4c3843;});})[_0x62f1('0x25')](function(){_0x43f789[_0x62f1('0x1c')](0xcc)[_0x62f1('0x33')]();});}};}function handleEntityNotFound(_0x4f58eb,_0x2c519e){return function(_0x10ed85){if(!_0x10ed85){_0x4f58eb['sendStatus'](0x194);}return _0x10ed85;};}function handleError(_0x5d6c1c,_0x315b2a){_0x315b2a=_0x315b2a||0x1f4;return function(_0xafd3e2){logger[_0x62f1('0x34')](_0xafd3e2['stack']);if(_0xafd3e2['name']){delete _0xafd3e2[_0x62f1('0x31')];}_0x5d6c1c[_0x62f1('0x1c')](_0x315b2a)[_0x62f1('0x35')](_0xafd3e2);};}exports['index']=function(_0x5cc18a,_0x55779f){var _0x3113a6={},_0x158fb1={},_0x369ac9={'count':0x0,'rows':[]};var _0x57f7f1=_['map'](db['VoiceQueue']['rawAttributes'],function(_0x2a1cf0){return{'name':_0x2a1cf0[_0x62f1('0x36')],'type':_0x2a1cf0[_0x62f1('0x30')][_0x62f1('0x37')]};});_0x158fb1['model']=_['map'](_0x57f7f1,_0x62f1('0x31'));_0x158fb1[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x5cc18a[_0x62f1('0x38')]);_0x158fb1[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x158fb1[_0x62f1('0x3c')],_0x158fb1['query']);_0x3113a6[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x158fb1['model'],qs[_0x62f1('0x3e')](_0x5cc18a[_0x62f1('0x38')][_0x62f1('0x3e')]));_0x3113a6[_0x62f1('0x3d')]=_0x3113a6[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0x3113a6[_0x62f1('0x3d')]:_0x158fb1[_0x62f1('0x3c')];if(!_0x5cc18a[_0x62f1('0x38')]['hasOwnProperty'](_0x62f1('0x40'))){_0x3113a6[_0x62f1('0x1f')]=qs[_0x62f1('0x1f')](_0x5cc18a[_0x62f1('0x38')][_0x62f1('0x1f')]);_0x3113a6[_0x62f1('0x1e')]=qs[_0x62f1('0x1e')](_0x5cc18a['query'][_0x62f1('0x1e')]);}_0x3113a6[_0x62f1('0x41')]=qs['sort'](_0x5cc18a[_0x62f1('0x38')]['sort']);_0x3113a6[_0x62f1('0x42')]=qs[_0x62f1('0x3a')](_['pick'](_0x5cc18a[_0x62f1('0x38')],_0x158fb1[_0x62f1('0x3a')]),_0x57f7f1);if(_0x5cc18a[_0x62f1('0x38')][_0x62f1('0x2b')]){_0x3113a6[_0x62f1('0x42')]=_[_0x62f1('0x43')](_0x3113a6[_0x62f1('0x42')],{'$or':_['map'](_0x57f7f1,function(_0x41c72c){if(_0x41c72c[_0x62f1('0x30')]!==_0x62f1('0x44')){var _0x4d3d89={};_0x4d3d89[_0x41c72c[_0x62f1('0x31')]]={'$like':'%'+_0x5cc18a[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x4d3d89;}})});}_0x3113a6=_[_0x62f1('0x43')]({},_0x3113a6,_0x5cc18a[_0x62f1('0x45')]);var _0x4a9344={'where':_0x3113a6[_0x62f1('0x42')]};return db[_0x62f1('0x46')][_0x62f1('0x1d')](_0x4a9344)[_0x62f1('0x25')](function(_0x4a80a7){_0x369ac9[_0x62f1('0x1d')]=_0x4a80a7;if(_0x5cc18a[_0x62f1('0x38')][_0x62f1('0x47')]){_0x3113a6['include']=[{'all':!![]}];}return db[_0x62f1('0x46')][_0x62f1('0x48')](_0x3113a6);})[_0x62f1('0x25')](function(_0x36de0e){_0x369ac9[_0x62f1('0x49')]=_0x36de0e;return _0x369ac9;})[_0x62f1('0x25')](respondWithFilteredResult(_0x55779f,_0x3113a6))[_0x62f1('0x4a')](handleError(_0x55779f,null));};exports[_0x62f1('0x4b')]=function(_0x313c53,_0x33d967){var _0x573002={'raw':![],'where':{'id':_0x313c53[_0x62f1('0x4c')]['id']}},_0x516d17={};_0x516d17[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db[_0x62f1('0x46')]['rawAttributes']);_0x516d17[_0x62f1('0x38')]=_['keys'](_0x313c53['query']);_0x516d17[_0x62f1('0x3a')]=_['intersection'](_0x516d17[_0x62f1('0x3c')],_0x516d17[_0x62f1('0x38')]);_0x573002[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x516d17['model'],qs[_0x62f1('0x3e')](_0x313c53[_0x62f1('0x38')][_0x62f1('0x3e')]));_0x573002[_0x62f1('0x3d')]=_0x573002['attributes'][_0x62f1('0x3f')]?_0x573002[_0x62f1('0x3d')]:_0x516d17['model'];if(_0x313c53[_0x62f1('0x38')][_0x62f1('0x47')]){_0x573002[_0x62f1('0x4d')]=[{'all':!![]}];}_0x573002=_[_0x62f1('0x43')]({},_0x573002,_0x313c53[_0x62f1('0x45')]);return db[_0x62f1('0x46')][_0x62f1('0x4e')](_0x573002)[_0x62f1('0x25')](handleEntityNotFound(_0x33d967,null))['then'](respondWithResult(_0x33d967,null))['catch'](handleError(_0x33d967,null));};exports[_0x62f1('0x4f')]=function(_0x19dfbb,_0x181aa4){return db[_0x62f1('0x46')][_0x62f1('0x4f')](_0x19dfbb[_0x62f1('0x50')],{})[_0x62f1('0x25')](function(_0x2efee9){var _0x30cb5f=_0x19dfbb[_0x62f1('0x51')][_0x62f1('0x52')]({'plain':!![]});if(!_0x30cb5f)throw new Error(_0x62f1('0x53'));if(_0x30cb5f[_0x62f1('0x54')]===_0x62f1('0x51')){var _0x5f01f3=_0x2efee9[_0x62f1('0x52')]({'plain':!![]});var _0xf24f22=[{'name':_0x62f1('0x27'),'value':_0x62f1('0x28')},{'name':_0x62f1('0x29'),'value':_0x62f1('0x2a')}];var _0x1823d6=_[_0x62f1('0x4e')](_0xf24f22,[_0x62f1('0x2e'),_0x5f01f3[_0x62f1('0x30')]])['name'];return db[_0x62f1('0x55')]['find']({'where':{'name':_0x1823d6,'userProfileId':_0x30cb5f[_0x62f1('0x56')]},'raw':!![]})[_0x62f1('0x25')](function(_0xbd7020){if(_0xbd7020&&_0xbd7020['autoAssociation']===0x0){return db[_0x62f1('0x32')][_0x62f1('0x4f')]({'name':_0x5f01f3['name'],'resourceId':_0x5f01f3['id'],'type':_0xbd7020['name'],'sectionId':_0xbd7020['id']},{})[_0x62f1('0x25')](function(){return _0x2efee9;});}else{return _0x2efee9;}})[_0x62f1('0x4a')](function(_0x4f98fa){logger['error'](_0x62f1('0x57'),_0x4f98fa);throw _0x4f98fa;});}return _0x2efee9;})[_0x62f1('0x25')](respondWithResult(_0x181aa4,0xc9))['catch'](handleError(_0x181aa4,null));};exports[_0x62f1('0x58')]=function(_0xbcb451,_0x26f5c3){var _0x171bd4={'where':{'id':_0xbcb451['params']['id']}},_0x29035b={};_0x29035b[_0x62f1('0x3c')]=_['keys'](db[_0x62f1('0x46')]['rawAttributes']);_0x171bd4[_0x62f1('0x3d')]=_['intersection'](_0x29035b[_0x62f1('0x3c')],qs[_0x62f1('0x3e')](_0xbcb451[_0x62f1('0x38')][_0x62f1('0x3e')]));_0x171bd4[_0x62f1('0x3d')]=_0x171bd4['attributes'][_0x62f1('0x3f')]?_0x171bd4[_0x62f1('0x3d')]:_0x29035b[_0x62f1('0x3c')];if(_0xbcb451[_0x62f1('0x38')][_0x62f1('0x47')]){_0x171bd4['include']=[{'all':!![]}];}_0x171bd4=_[_0x62f1('0x43')]({},_0x171bd4,_0xbcb451[_0x62f1('0x45')]);return db[_0x62f1('0x46')][_0x62f1('0x4e')](_0x171bd4)[_0x62f1('0x25')](handleEntityNotFound(_0x26f5c3,null))[_0x62f1('0x25')](function(_0x25e6a3){if(_0x25e6a3){var _0x15c846=_0x25e6a3[_0x62f1('0x52')]({'plain':!![]});_0x15c846=qs[_0x62f1('0x59')](_0x15c846,['id','createdAt',_0x62f1('0x5a')]);_0xbcb451[_0x62f1('0x50')]=_[_0x62f1('0x59')](_0xbcb451[_0x62f1('0x50')],['id',_0x62f1('0x5b'),'updatedAt']);return db[_0x62f1('0x46')][_0x62f1('0x4f')](_[_0x62f1('0x43')](_0x15c846,_0xbcb451['body']),{'include':_0xbcb451['query'][_0x62f1('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3f21){var _0x46f0c9=_0xbcb451['user'][_0x62f1('0x52')]({'plain':!![]});if(!_0x46f0c9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x46f0c9[_0x62f1('0x54')]===_0x62f1('0x51')){var _0x3deb0f=_0x3b3f21[_0x62f1('0x52')]({'plain':!![]});var _0x1bae1c=[{'name':_0x62f1('0x27'),'value':_0x62f1('0x28')},{'name':_0x62f1('0x29'),'value':_0x62f1('0x2a')}];var _0x3f19b9=_[_0x62f1('0x4e')](_0x1bae1c,['value',_0x3deb0f[_0x62f1('0x30')]])[_0x62f1('0x31')];return db[_0x62f1('0x55')][_0x62f1('0x4e')]({'where':{'name':_0x3f19b9,'userProfileId':_0x46f0c9[_0x62f1('0x56')]},'raw':!![]})['then'](function(_0x9e6c04){if(_0x9e6c04&&_0x9e6c04[_0x62f1('0x5c')]===0x0){return db[_0x62f1('0x32')]['create']({'name':_0x3deb0f[_0x62f1('0x31')],'resourceId':_0x3deb0f['id'],'type':_0x9e6c04[_0x62f1('0x31')],'sectionId':_0x9e6c04['id']},{})[_0x62f1('0x25')](function(){return _0x3b3f21;});}else{return _0x3b3f21;}})[_0x62f1('0x4a')](function(_0x5b2d62){logger['error'](_0x62f1('0x57'),_0x5b2d62);throw _0x5b2d62;});}return _0x3b3f21;});}})['then'](respondWithResult(_0x26f5c3,0xc9))['catch'](handleError(_0x26f5c3,null));};exports[_0x62f1('0x24')]=function(_0x2bae1b,_0xa354ff){if(_0x2bae1b['body']['id']){delete _0x2bae1b['body']['id'];}return db[_0x62f1('0x46')][_0x62f1('0x4e')]({'where':{'id':_0x2bae1b[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0xa354ff,null))[_0x62f1('0x25')](saveUpdates(_0x2bae1b['body'],null))[_0x62f1('0x25')](respondWithResult(_0xa354ff,null))[_0x62f1('0x4a')](handleError(_0xa354ff,null));};exports['destroy']=function(_0x560b66,_0x5cc2d7){return db[_0x62f1('0x46')][_0x62f1('0x4e')]({'where':{'id':_0x560b66[_0x62f1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5cc2d7,null))[_0x62f1('0x25')](removeEntity(_0x5cc2d7,null))['catch'](handleError(_0x5cc2d7,null));};exports[_0x62f1('0x5d')]=function(_0x5ab8a0,_0x5cc846,_0x37c4d6){var _0x1016fd={'raw':![],'where':{}};var _0x41a58f={};var _0x353cf9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x62f1('0x5e')]({'where':{'id':_0x5ab8a0['params']['id']}})['then'](handleEntityNotFound(_0x5cc846,null))['then'](function(_0x5b2904){if(_0x5b2904){_0x41a58f[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db[_0x62f1('0x5f')][_0x62f1('0x60')]);_0x41a58f['query']=_[_0x62f1('0x39')](_0x5ab8a0[_0x62f1('0x38')]);_0x41a58f[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x41a58f[_0x62f1('0x3c')],_0x41a58f[_0x62f1('0x38')]);_0x1016fd['attributes']=_['intersection'](_0x41a58f[_0x62f1('0x3c')],qs['fields'](_0x5ab8a0[_0x62f1('0x38')][_0x62f1('0x3e')]));_0x1016fd[_0x62f1('0x3d')]=_0x1016fd[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0x1016fd['attributes']:_0x41a58f['model'];if(!_0x5ab8a0[_0x62f1('0x38')][_0x62f1('0x61')](_0x62f1('0x40'))){_0x1016fd[_0x62f1('0x1f')]=qs[_0x62f1('0x1f')](_0x5ab8a0[_0x62f1('0x38')]['limit']);_0x1016fd[_0x62f1('0x1e')]=qs[_0x62f1('0x1e')](_0x5ab8a0[_0x62f1('0x38')]['offset']);}_0x1016fd['order']=qs['sort'](_0x5ab8a0[_0x62f1('0x38')][_0x62f1('0x62')]);_0x1016fd['where']=qs['filters'](_[_0x62f1('0x63')](_0x5ab8a0[_0x62f1('0x38')],_0x41a58f[_0x62f1('0x3a')]));_0x1016fd['where'][_0x62f1('0x64')]=_0x5b2904['id'];if(_0x5ab8a0['query'][_0x62f1('0x2b')]){_0x1016fd[_0x62f1('0x42')]=_['merge'](_0x1016fd[_0x62f1('0x42')],{'$or':_['map'](_0x1016fd[_0x62f1('0x3d')],function(_0xc5f74a){var _0x4f9549={};_0x4f9549[_0xc5f74a]={'$like':'%'+_0x5ab8a0[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x4f9549;})});}_0x1016fd=_[_0x62f1('0x43')]({},_0x1016fd,_0x5ab8a0[_0x62f1('0x45')]);return db[_0x62f1('0x5f')][_0x62f1('0x1d')]({'where':_0x1016fd['where']})[_0x62f1('0x25')](function(_0x38069e){_0x353cf9['count']=_0x38069e;if(_0x5ab8a0[_0x62f1('0x38')][_0x62f1('0x47')]){_0x1016fd['include']=[{'all':!![]}];}return db[_0x62f1('0x5f')][_0x62f1('0x48')](_0x1016fd);})['then'](function(_0x23a5ef){_0x353cf9[_0x62f1('0x49')]=_0x23a5ef;return _0x353cf9;});}})['then'](respondWithFilteredResult(_0x5cc846,_0x1016fd))[_0x62f1('0x4a')](handleError(_0x5cc846,null));};exports[_0x62f1('0x65')]=function(_0x133c20,_0x353564,_0x724182){var _0x31a1f4={'raw':!![],'where':{}};var _0x10710b={};var _0x3177a9={'count':0x0,'rows':[]};return db[_0x62f1('0x46')][_0x62f1('0x5e')]({'where':{'id':_0x133c20['params']['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x353564,null))[_0x62f1('0x25')](function(_0x377eb8){if(_0x377eb8){_0x10710b[_0x62f1('0x3c')]=_['keys'](db[_0x62f1('0x66')][_0x62f1('0x60')]);_0x10710b['query']=_['keys'](_0x133c20[_0x62f1('0x38')]);_0x10710b[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x10710b[_0x62f1('0x3c')],_0x10710b[_0x62f1('0x38')]);_0x31a1f4[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x10710b['model'],qs[_0x62f1('0x3e')](_0x133c20[_0x62f1('0x38')][_0x62f1('0x3e')]));_0x31a1f4['attributes']=_0x31a1f4[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0x31a1f4[_0x62f1('0x3d')]:_0x10710b[_0x62f1('0x3c')];if(!_0x133c20[_0x62f1('0x38')][_0x62f1('0x61')](_0x62f1('0x40'))){_0x31a1f4[_0x62f1('0x1f')]=qs['limit'](_0x133c20[_0x62f1('0x38')]['limit']);_0x31a1f4[_0x62f1('0x1e')]=qs['offset'](_0x133c20[_0x62f1('0x38')]['offset']);}_0x31a1f4[_0x62f1('0x41')]=qs[_0x62f1('0x62')](_0x133c20['query']['sort']);_0x31a1f4[_0x62f1('0x42')]=qs[_0x62f1('0x3a')](_[_0x62f1('0x63')](_0x133c20[_0x62f1('0x38')],_0x10710b[_0x62f1('0x3a')]));_0x31a1f4[_0x62f1('0x42')][_0x62f1('0x64')]=_0x377eb8['id'];if(_0x133c20[_0x62f1('0x38')][_0x62f1('0x2b')]){_0x31a1f4[_0x62f1('0x42')]=_['merge'](_0x31a1f4[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0x31a1f4[_0x62f1('0x3d')],function(_0x351b74){var _0x5ce250={};_0x5ce250[_0x351b74]={'$like':'%'+_0x133c20[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x5ce250;})});}_0x31a1f4=_[_0x62f1('0x43')]({},_0x31a1f4,_0x133c20[_0x62f1('0x45')]);return db['CmHopperHistory'][_0x62f1('0x1d')]({'where':_0x31a1f4[_0x62f1('0x42')]})[_0x62f1('0x25')](function(_0x39f966){_0x3177a9['count']=_0x39f966;if(_0x133c20[_0x62f1('0x38')][_0x62f1('0x47')]){_0x31a1f4[_0x62f1('0x4d')]=[{'all':!![]}];}return db[_0x62f1('0x66')][_0x62f1('0x48')](_0x31a1f4);})[_0x62f1('0x25')](function(_0x2e1f57){_0x3177a9[_0x62f1('0x49')]=_0x2e1f57;return _0x3177a9;});}})[_0x62f1('0x25')](respondWithFilteredResult(_0x353564,_0x31a1f4))['catch'](handleError(_0x353564,null));};exports['getHopperFinals']=function(_0x5e9b2d,_0x195368,_0x18c302){var _0x610274={'raw':!![],'where':{}};var _0x4f4267={};var _0x415cc0={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x62f1('0x5e')]({'where':{'id':_0x5e9b2d[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x195368,null))[_0x62f1('0x25')](function(_0xf2986b){if(_0xf2986b){_0x4f4267[_0x62f1('0x3c')]=_['keys'](db['CmHopperFinal'][_0x62f1('0x60')]);_0x4f4267[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x5e9b2d[_0x62f1('0x38')]);_0x4f4267[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x4f4267[_0x62f1('0x3c')],_0x4f4267['query']);_0x610274[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x4f4267['model'],qs['fields'](_0x5e9b2d[_0x62f1('0x38')]['fields']));_0x610274[_0x62f1('0x3d')]=_0x610274['attributes'][_0x62f1('0x3f')]?_0x610274[_0x62f1('0x3d')]:_0x4f4267['model'];if(!_0x5e9b2d[_0x62f1('0x38')][_0x62f1('0x61')]('nolimit')){_0x610274['limit']=qs[_0x62f1('0x1f')](_0x5e9b2d[_0x62f1('0x38')][_0x62f1('0x1f')]);_0x610274[_0x62f1('0x1e')]=qs[_0x62f1('0x1e')](_0x5e9b2d['query']['offset']);}_0x610274[_0x62f1('0x41')]=qs[_0x62f1('0x62')](_0x5e9b2d[_0x62f1('0x38')][_0x62f1('0x62')]);_0x610274[_0x62f1('0x42')]=qs['filters'](_[_0x62f1('0x63')](_0x5e9b2d[_0x62f1('0x38')],_0x4f4267[_0x62f1('0x3a')]));_0x610274['where'][_0x62f1('0x64')]=_0xf2986b['id'];if(_0x5e9b2d[_0x62f1('0x38')][_0x62f1('0x2b')]){_0x610274[_0x62f1('0x42')]=_[_0x62f1('0x43')](_0x610274[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0x610274[_0x62f1('0x3d')],function(_0x4fa63b){var _0x13f992={};_0x13f992[_0x4fa63b]={'$like':'%'+_0x5e9b2d['query'][_0x62f1('0x2b')]+'%'};return _0x13f992;})});}_0x610274=_['merge']({},_0x610274,_0x5e9b2d[_0x62f1('0x45')]);return db[_0x62f1('0x67')][_0x62f1('0x1d')]({'where':_0x610274[_0x62f1('0x42')]})[_0x62f1('0x25')](function(_0x3a9d75){_0x415cc0[_0x62f1('0x1d')]=_0x3a9d75;if(_0x5e9b2d['query'][_0x62f1('0x47')]){_0x610274[_0x62f1('0x4d')]=[{'all':!![]}];}return db[_0x62f1('0x67')][_0x62f1('0x48')](_0x610274);})[_0x62f1('0x25')](function(_0x11f952){_0x415cc0[_0x62f1('0x49')]=_0x11f952;return _0x415cc0;});}})['then'](respondWithFilteredResult(_0x195368,_0x610274))[_0x62f1('0x4a')](handleError(_0x195368,null));};exports[_0x62f1('0x68')]=function(_0x12578e,_0x3d1ef4,_0x49a01b){var _0x3803e1={'raw':!![],'where':{}};var _0x300f73={};var _0x935a54={'count':0x0,'rows':[]};return db[_0x62f1('0x46')][_0x62f1('0x5e')]({'where':{'id':_0x12578e[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x3d1ef4,null))[_0x62f1('0x25')](function(_0x5a14a5){if(_0x5a14a5){_0x300f73[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db[_0x62f1('0x69')][_0x62f1('0x60')]);_0x300f73[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x12578e[_0x62f1('0x38')]);_0x300f73[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x300f73[_0x62f1('0x3c')],_0x300f73[_0x62f1('0x38')]);_0x3803e1[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x300f73[_0x62f1('0x3c')],qs[_0x62f1('0x3e')](_0x12578e[_0x62f1('0x38')]['fields']));_0x3803e1[_0x62f1('0x3d')]=_0x3803e1['attributes'][_0x62f1('0x3f')]?_0x3803e1[_0x62f1('0x3d')]:_0x300f73[_0x62f1('0x3c')];if(!_0x12578e[_0x62f1('0x38')][_0x62f1('0x61')]('nolimit')){_0x3803e1[_0x62f1('0x1f')]=qs['limit'](_0x12578e['query'][_0x62f1('0x1f')]);_0x3803e1[_0x62f1('0x1e')]=qs['offset'](_0x12578e[_0x62f1('0x38')]['offset']);}_0x3803e1[_0x62f1('0x41')]=qs[_0x62f1('0x62')](_0x12578e[_0x62f1('0x38')][_0x62f1('0x62')]);_0x3803e1[_0x62f1('0x42')]=qs[_0x62f1('0x3a')](_['pick'](_0x12578e[_0x62f1('0x38')],_0x300f73[_0x62f1('0x3a')]));_0x3803e1[_0x62f1('0x42')][_0x62f1('0x64')]=_0x5a14a5['id'];if(_0x12578e[_0x62f1('0x38')][_0x62f1('0x2b')]){_0x3803e1[_0x62f1('0x42')]=_[_0x62f1('0x43')](_0x3803e1[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0x3803e1[_0x62f1('0x3d')],function(_0x4964f0){var _0x5126d2={};_0x5126d2[_0x4964f0]={'$like':'%'+_0x12578e['query'][_0x62f1('0x2b')]+'%'};return _0x5126d2;})});}_0x3803e1=_[_0x62f1('0x43')]({},_0x3803e1,_0x12578e['options']);return db[_0x62f1('0x69')]['count']({'where':_0x3803e1[_0x62f1('0x42')]})['then'](function(_0x42da9b){_0x935a54[_0x62f1('0x1d')]=_0x42da9b;if(_0x12578e['query'][_0x62f1('0x47')]){_0x3803e1[_0x62f1('0x4d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x62f1('0x48')](_0x3803e1);})[_0x62f1('0x25')](function(_0x2102fa){_0x935a54[_0x62f1('0x49')]=_0x2102fa;return _0x935a54;});}})[_0x62f1('0x25')](respondWithFilteredResult(_0x3d1ef4,_0x3803e1))[_0x62f1('0x4a')](handleError(_0x3d1ef4,null));};exports['getTeams']=function(_0x1d2b44,_0x3a2f9b,_0x37600b){var _0x2ef508={};var _0x348ffa={};var _0x393120;var _0x52d1c6;return db['VoiceQueue'][_0x62f1('0x5e')]({'where':{'id':_0x1d2b44[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x3a2f9b,null))['then'](function(_0x260191){if(_0x260191){_0x393120=_0x260191;_0x348ffa[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db[_0x62f1('0x6a')]['rawAttributes']);_0x348ffa[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x1d2b44[_0x62f1('0x38')]);_0x348ffa[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x348ffa['model'],_0x348ffa[_0x62f1('0x38')]);_0x2ef508['attributes']=_[_0x62f1('0x3b')](_0x348ffa[_0x62f1('0x3c')],qs[_0x62f1('0x3e')](_0x1d2b44[_0x62f1('0x38')][_0x62f1('0x3e')]));_0x2ef508[_0x62f1('0x3d')]=_0x2ef508[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0x2ef508[_0x62f1('0x3d')]:_0x348ffa[_0x62f1('0x3c')];_0x2ef508[_0x62f1('0x41')]=qs['sort'](_0x1d2b44[_0x62f1('0x38')][_0x62f1('0x62')]);_0x2ef508[_0x62f1('0x42')]=qs['filters'](_['pick'](_0x1d2b44[_0x62f1('0x38')],_0x348ffa[_0x62f1('0x3a')]));if(_0x1d2b44['query'][_0x62f1('0x2b')]){_0x2ef508[_0x62f1('0x42')]=_[_0x62f1('0x43')](_0x2ef508[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0x2ef508[_0x62f1('0x3d')],function(_0x16a784){var _0x5deb31={};_0x5deb31[_0x16a784]={'$like':'%'+_0x1d2b44[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x5deb31;})});}_0x2ef508=_['merge']({},_0x2ef508,_0x1d2b44[_0x62f1('0x45')]);return _0x393120[_0x62f1('0x6b')](_0x2ef508);}})[_0x62f1('0x25')](function(_0xeddb6a){if(_0xeddb6a){_0x52d1c6=_0xeddb6a[_0x62f1('0x3f')];if(!_0x1d2b44[_0x62f1('0x38')]['hasOwnProperty'](_0x62f1('0x40'))){_0x2ef508[_0x62f1('0x1f')]=qs['limit'](_0x1d2b44[_0x62f1('0x38')]['limit']);_0x2ef508['offset']=qs['offset'](_0x1d2b44['query'][_0x62f1('0x1e')]);}return _0x393120['getTeams'](_0x2ef508);}})[_0x62f1('0x25')](function(_0x3c9721){if(_0x3c9721){return _0x3c9721?{'count':_0x52d1c6,'rows':_0x3c9721}:null;}})[_0x62f1('0x25')](respondWithResult(_0x3a2f9b,null))['catch'](handleError(_0x3a2f9b,null));};exports[_0x62f1('0x6c')]=function(_0x43cee9,_0x2211eb,_0x5f45ab){var _0x1f422d=_0x43cee9[_0x62f1('0x50')][_0x62f1('0x6d')];var _0xa120a6=_[_0x62f1('0x2d')](_0x1f422d,'id');return db[_0x62f1('0x6a')][_0x62f1('0x48')]({'where':{'id':_0xa120a6},'attributes':['id'],'include':[{'model':db[_0x62f1('0x6e')],'as':_0x62f1('0x6f'),'attributes':['id',_0x62f1('0x31'),_0x62f1('0x70'),_0x62f1('0x71'),_0x62f1('0x72')],'raw':!![]}]})[_0x62f1('0x25')](function(_0x2c454e){if(_0x2c454e){var _0x5a5c4c=_['flatMap'](_0x2c454e,function(_0x2ca5f0){var _0x3476d2=_0x2ca5f0[_0x62f1('0x52')]({'plain':!![]});_0x3476d2['Agents'][_0x62f1('0x73')](function(_0x314e0a){_0x314e0a[_0x62f1('0x74')]=_['find'](_0x1f422d,{'id':_0x3476d2['id']})[_0x62f1('0x74')];});return _0x3476d2[_0x62f1('0x6f')];});return db['VoiceQueue'][_0x62f1('0x4e')]({'where':{'id':_0x43cee9[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](function(_0x52a590){return db[_0x62f1('0x75')][_0x62f1('0x76')](function(_0xe0e907){return _0x52a590[_0x62f1('0x6c')](_0xa120a6,{'transaction':_0xe0e907})[_0x62f1('0x25')](function(){return BPromise['each'](_0x1f422d,function(_0x130496){return db[_0x62f1('0x77')][_0x62f1('0x78')]({'TeamId':_0x130496['id'],'VoiceQueueId':_0x43cee9['params']['id'],'penalty':_0x130496[_0x62f1('0x74')]},{'transaction':_0xe0e907});});})[_0x62f1('0x25')](function(){return BPromise[_0x62f1('0x79')](_0x5a5c4c,function(_0x9afc5b){return db[_0x62f1('0x7a')]['findOrCreate']({'where':{'UserId':_0x9afc5b['id'],'VoiceQueueId':_0x43cee9['params']['id']},'defaults':{'penalty':_0x9afc5b[_0x62f1('0x74')]},'transaction':_0xe0e907});});})[_0x62f1('0x25')](function(){return BPromise[_0x62f1('0x79')](_[_0x62f1('0x2b')](_0x5a5c4c,{'online':!![]}),function(_0x96baf9){return db['UserVoiceQueueRt'][_0x62f1('0x78')]({'membername':_0x96baf9[_0x62f1('0x31')],'UserId':_0x96baf9['id'],'queue_name':_0x52a590[_0x62f1('0x31')],'VoiceQueueId':_0x52a590['id'],'interface':_[_0x62f1('0x7b')](_0x96baf9[_0x62f1('0x72')])?util['format'](_0x62f1('0x7c'),_0x96baf9['name']):_0x96baf9[_0x62f1('0x72')],'paused':_0x96baf9['voicePause']||![],'penalty':_0x96baf9[_0x62f1('0x74')]},{'transaction':_0xe0e907});});})[_0x62f1('0x25')](function(){_0x5a5c4c[_0x62f1('0x73')](function(_0x110fe3){socket[_0x62f1('0x7d')]('userVoiceQueue:save',{'UserId':_0x110fe3['id'],'VoiceQueueId':_0x52a590['id']});});});});});}})[_0x62f1('0x25')](respondWithStatusCode(_0x2211eb,null))['catch'](handleError(_0x2211eb,null));};exports[_0x62f1('0x7e')]=function(_0x3afb4c,_0xa720fc,_0x247f69){return db[_0x62f1('0x6a')][_0x62f1('0x48')]({'where':{'id':_0x3afb4c[_0x62f1('0x38')][_0x62f1('0x7f')]},'attributes':['id'],'include':[{'model':db[_0x62f1('0x6e')],'as':_0x62f1('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x62f1('0x25')](handleEntityNotFound(_0xa720fc,null))['then'](function(_0x300ea0){var _0x290b30=_[_0x62f1('0x2d')](_0x300ea0,'id');var _0x1aada2=[];var _0x2aaba0=[];var _0x53df67=squel[_0x62f1('0x80')]();_0x53df67['field'](_0x62f1('0x81'))['from'](_0x62f1('0x82'),'tq')[_0x62f1('0x83')](_0x62f1('0x84'),'ut',_0x62f1('0x85'))[_0x62f1('0x42')](_0x62f1('0x86'),_0x3afb4c[_0x62f1('0x4c')]['id']);for(var _0x1244dc=0x0;_0x1244dc<_0x300ea0[_0x62f1('0x3f')];_0x1244dc+=0x1){let _0x40134d=_0x300ea0[_0x1244dc];for(var _0xc3c7bc=0x0;_0xc3c7bc<_0x40134d[_0x62f1('0x6f')][_0x62f1('0x3f')];_0xc3c7bc+=0x1){let _0x26d649=_0x40134d[_0x62f1('0x6f')][_0xc3c7bc];var _0x32fcc5=_0x53df67['clone']();_0x32fcc5[_0x62f1('0x42')](_0x62f1('0x87'),_0x26d649['id']);_0x2aaba0['push'](db[_0x62f1('0x75')][_0x62f1('0x38')](_0x32fcc5[_0x62f1('0x88')](),{'type':db[_0x62f1('0x75')][_0x62f1('0x89')][_0x62f1('0x8a')]})[_0x62f1('0x25')](function(_0x1ab62e){if(_0x1ab62e['length']===0x1){return _0x26d649['id'];}else{var _0x256ec4=_[_0x62f1('0x8b')](_['map'](_0x1ab62e,'TeamId'),function(_0x1e64b9){return _[_0x62f1('0x2f')](_0x290b30,_0x1e64b9);});if(_0x256ec4){return _0x26d649['id'];}}}));}}return BPromise[_0x62f1('0x8c')](_0x2aaba0)[_0x62f1('0x25')](function(_0x4d0089){_0x1aada2=_(_0x1aada2)[_0x62f1('0x8d')](_0x4d0089)['compact']()[_0x62f1('0x2e')]();return db[_0x62f1('0x46')][_0x62f1('0x4e')]({'where':{'id':_0x3afb4c[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](function(_0xf7ce52){return db[_0x62f1('0x75')][_0x62f1('0x76')](function(_0x2defe0){return _0xf7ce52[_0x62f1('0x7e')](_0x3afb4c[_0x62f1('0x38')][_0x62f1('0x7f')],{'transaction':_0x2defe0})[_0x62f1('0x25')](function(){if(!_[_0x62f1('0x8e')](_0x1aada2)){return _0xf7ce52['removeAgents'](_0x1aada2,{'transaction':_0x2defe0})[_0x62f1('0x25')](function(){return db[_0x62f1('0x8f')]['destroy']({'where':{'VoiceQueueId':_0x3afb4c[_0x62f1('0x4c')]['id'],'UserId':_0x1aada2},'transaction':_0x2defe0});});}})['then'](function(){_0x1aada2[_0x62f1('0x73')](function(_0x23fd74){socket[_0x62f1('0x7d')](_0x62f1('0x90'),{'UserId':_0x23fd74,'VoiceQueueId':_0xf7ce52['id']});});});});});});})[_0x62f1('0x25')](respondWithStatusCode(_0xa720fc,null))[_0x62f1('0x4a')](handleError(_0xa720fc,null));};exports[_0x62f1('0x91')]=function(_0x28cfbd,_0x2aaef8,_0x54a0d5){var _0x368764,_0x35ee84;return db[_0x62f1('0x46')][_0x62f1('0x4e')]({'where':{'id':_0x28cfbd[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x2aaef8,null))[_0x62f1('0x25')](function(_0x415ac9){if(_0x415ac9){_0x35ee84=_0x415ac9;return _0x415ac9[_0x62f1('0x91')](_0x28cfbd[_0x62f1('0x50')][_0x62f1('0x7f')],_[_0x62f1('0x59')](_0x28cfbd['body'],[_0x62f1('0x7f'),'id'])||{})[_0x62f1('0x92')](function(_0x413309){for(var _0xd5fee4=0x0;_0xd5fee4<_0x28cfbd[_0x62f1('0x50')]['ids'][_0x62f1('0x3f')];_0xd5fee4+=0x1){socket[_0x62f1('0x7d')](_0x62f1('0x93'),{'UserId':_0x28cfbd['body']['ids'][_0xd5fee4],'VoiceQueueId':_0x28cfbd[_0x62f1('0x4c')]['id']});}return _0x413309;});}})[_0x62f1('0x25')](function(_0x232537){_0x368764=_0x232537||[];if(_0x35ee84){return db['User'][_0x62f1('0x48')]({'where':{'id':_0x28cfbd[_0x62f1('0x50')][_0x62f1('0x7f')]},'attributes':['id',_0x62f1('0x31'),_0x62f1('0x70'),'voicePause',_0x62f1('0x72')],'raw':!![]});}})[_0x62f1('0x25')](function(_0x37b3a9){if(!_[_0x62f1('0x8e')](_0x37b3a9)){var _0x1d75c2=[];for(var _0x9c5536=0x0;_0x9c5536<_0x37b3a9[_0x62f1('0x3f')];_0x9c5536++){if(_0x37b3a9[_0x9c5536][_0x62f1('0x70')]){_0x1d75c2[_0x62f1('0x94')](db[_0x62f1('0x8f')]['upsert']({'membername':_0x37b3a9[_0x9c5536][_0x62f1('0x31')],'UserId':_0x37b3a9[_0x9c5536]['id'],'queue_name':_0x35ee84[_0x62f1('0x31')],'VoiceQueueId':_0x35ee84['id'],'interface':_[_0x62f1('0x7b')](_0x37b3a9[_0x9c5536]['interface'])?util[_0x62f1('0x95')]('SIP/%s',_0x37b3a9[_0x9c5536]['name']):_0x37b3a9[_0x9c5536][_0x62f1('0x72')],'paused':_0x37b3a9[_0x9c5536][_0x62f1('0x71')]||![],'penalty':_0x28cfbd['body']['penalty']||0x0}));}}return BPromise['all'](_0x1d75c2);}})[_0x62f1('0x25')](function(){return _0x368764;})[_0x62f1('0x25')](respondWithResult(_0x2aaef8,null))[_0x62f1('0x4a')](handleError(_0x2aaef8,null));};exports[_0x62f1('0x96')]=function(_0x248eac,_0x7c2702,_0x561a1c){return db[_0x62f1('0x46')]['find']({'where':{'id':_0x248eac['params']['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x7c2702,null))['then'](function(_0x4bcb5e){if(_0x4bcb5e){return _0x4bcb5e[_0x62f1('0x96')](_0x248eac[_0x62f1('0x38')][_0x62f1('0x7f')])['then'](function(){if(_[_0x62f1('0x97')](_0x248eac['query'][_0x62f1('0x7f')])){for(var _0x50baee=0x0;_0x50baee<_0x248eac['query'][_0x62f1('0x7f')][_0x62f1('0x3f')];_0x50baee+=0x1){socket['emit'](_0x62f1('0x90'),{'UserId':Number(_0x248eac[_0x62f1('0x38')][_0x62f1('0x7f')][_0x50baee]),'VoiceQueueId':Number(_0x248eac[_0x62f1('0x4c')]['id'])});}}else{socket[_0x62f1('0x7d')](_0x62f1('0x90'),{'UserId':Number(_0x248eac[_0x62f1('0x38')][_0x62f1('0x7f')]),'VoiceQueueId':Number(_0x248eac[_0x62f1('0x4c')]['id'])});}});}})['then'](function(_0x2dd17c){return db['UserVoiceQueueRt'][_0x62f1('0x26')]({'where':{'VoiceQueueId':_0x248eac[_0x62f1('0x4c')]['id'],'UserId':_0x248eac[_0x62f1('0x38')][_0x62f1('0x7f')]}})[_0x62f1('0x25')](function(){return _0x2dd17c;});})[_0x62f1('0x25')](respondWithStatusCode(_0x7c2702,null))[_0x62f1('0x4a')](handleError(_0x7c2702,null));};exports[_0x62f1('0x98')]=function(_0x57055d,_0x122a3a,_0xcf9a4b){var _0x1f6bd4={};var _0x399329={};var _0x23c51b;var _0x3a2c82;return db[_0x62f1('0x46')][_0x62f1('0x5e')]({'where':{'id':_0x57055d['params']['id']}})['then'](handleEntityNotFound(_0x122a3a,null))[_0x62f1('0x25')](function(_0x39d33d){if(_0x39d33d){_0x23c51b=_0x39d33d;_0x399329[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db[_0x62f1('0x6e')][_0x62f1('0x60')]);_0x399329[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x57055d[_0x62f1('0x38')]);_0x399329['filters']=_[_0x62f1('0x3b')](_0x399329['model'],_0x399329[_0x62f1('0x38')]);_0x1f6bd4[_0x62f1('0x3d')]=_['intersection'](_0x399329[_0x62f1('0x3c')],qs[_0x62f1('0x3e')](_0x57055d[_0x62f1('0x38')]['fields']));_0x1f6bd4[_0x62f1('0x3d')]=_0x1f6bd4[_0x62f1('0x3d')]['length']?_0x1f6bd4['attributes']:_0x399329[_0x62f1('0x3c')];_0x1f6bd4[_0x62f1('0x41')]=qs['sort'](_0x57055d[_0x62f1('0x38')][_0x62f1('0x62')]);_0x1f6bd4['where']=qs['filters'](_['pick'](_0x57055d[_0x62f1('0x38')],_0x399329[_0x62f1('0x3a')]));if(_0x57055d[_0x62f1('0x38')]['filter']){_0x1f6bd4[_0x62f1('0x42')]=_[_0x62f1('0x43')](_0x1f6bd4[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0x1f6bd4[_0x62f1('0x3d')],function(_0x52b7ec){var _0x1c503c={};_0x1c503c[_0x52b7ec]={'$like':'%'+_0x57055d[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x1c503c;})});}_0x1f6bd4=_[_0x62f1('0x43')]({},_0x1f6bd4,_0x57055d[_0x62f1('0x45')]);return _0x23c51b['getAgents'](_0x1f6bd4);}})[_0x62f1('0x25')](function(_0x21645e){if(_0x21645e){_0x3a2c82=_0x21645e['length'];if(!_0x57055d[_0x62f1('0x38')]['hasOwnProperty']('nolimit')){_0x1f6bd4[_0x62f1('0x1f')]=qs[_0x62f1('0x1f')](_0x57055d[_0x62f1('0x38')][_0x62f1('0x1f')]);_0x1f6bd4[_0x62f1('0x1e')]=qs[_0x62f1('0x1e')](_0x57055d[_0x62f1('0x38')][_0x62f1('0x1e')]);}return _0x23c51b[_0x62f1('0x98')](_0x1f6bd4);}})[_0x62f1('0x25')](function(_0x280716){if(_0x280716){return _0x280716?{'count':_0x3a2c82,'rows':_0x280716}:null;}})[_0x62f1('0x25')](respondWithResult(_0x122a3a,null))[_0x62f1('0x4a')](handleError(_0x122a3a,null));};exports[_0x62f1('0x99')]=function(_0x2d521c,_0x4acc2f,_0x1d8a0f){var _0xc1d3a8={};var _0x46ad1a={};var _0x44851;var _0x51a34b;return db['VoiceQueue'][_0x62f1('0x5e')]({'where':{'id':_0x2d521c[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x4acc2f,null))['then'](function(_0x4bca5b){if(_0x4bca5b){_0x44851=_0x4bca5b;_0x46ad1a[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db['UserVoiceQueueRt'][_0x62f1('0x60')]);_0x46ad1a[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x2d521c[_0x62f1('0x38')]);_0x46ad1a[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x46ad1a[_0x62f1('0x3c')],_0x46ad1a[_0x62f1('0x38')]);_0xc1d3a8[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x46ad1a['model'],qs[_0x62f1('0x3e')](_0x2d521c[_0x62f1('0x38')][_0x62f1('0x3e')]));_0xc1d3a8[_0x62f1('0x3d')]=_0xc1d3a8[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0xc1d3a8[_0x62f1('0x3d')]:_0x46ad1a[_0x62f1('0x3c')];_0xc1d3a8[_0x62f1('0x41')]=qs[_0x62f1('0x62')](_0x2d521c['query'][_0x62f1('0x62')]);_0xc1d3a8[_0x62f1('0x42')]=qs['filters'](_['pick'](_0x2d521c[_0x62f1('0x38')],_0x46ad1a[_0x62f1('0x3a')]));if(_0x2d521c[_0x62f1('0x38')]['filter']){_0xc1d3a8['where']=_['merge'](_0xc1d3a8[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0xc1d3a8[_0x62f1('0x3d')],function(_0x4d3569){var _0xafafc0={};_0xafafc0[_0x4d3569]={'$like':'%'+_0x2d521c[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0xafafc0;})});}_0xc1d3a8=_[_0x62f1('0x43')]({},_0xc1d3a8,_0x2d521c[_0x62f1('0x45')]);return _0x44851[_0x62f1('0x99')](_0xc1d3a8);}})[_0x62f1('0x25')](function(_0x2b694d){if(_0x2b694d){_0x51a34b=_0x2b694d[_0x62f1('0x3f')];if(!_0x2d521c[_0x62f1('0x38')]['hasOwnProperty']('nolimit')){_0xc1d3a8[_0x62f1('0x1f')]=qs[_0x62f1('0x1f')](_0x2d521c[_0x62f1('0x38')][_0x62f1('0x1f')]);_0xc1d3a8[_0x62f1('0x1e')]=qs[_0x62f1('0x1e')](_0x2d521c[_0x62f1('0x38')][_0x62f1('0x1e')]);}return _0x44851[_0x62f1('0x99')](_0xc1d3a8);}})[_0x62f1('0x25')](function(_0x5d29c7){return _0x5d29c7?{'count':_0x51a34b,'rows':_0x5d29c7}:null;})['then'](respondWithResult(_0x4acc2f,null))[_0x62f1('0x4a')](handleError(_0x4acc2f,null));};exports[_0x62f1('0x9a')]=function(_0xdb55ea,_0x35b661,_0x433439){var _0xdd5b58={};var _0x21377b={};var _0x47e081;var _0x13658c;return db[_0x62f1('0x46')][_0x62f1('0x5e')]({'where':{'id':_0xdb55ea[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x35b661,null))['then'](function(_0x2abebb){if(_0x2abebb){_0x47e081=_0x2abebb;_0x21377b[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db[_0x62f1('0x9b')][_0x62f1('0x60')]);_0x21377b[_0x62f1('0x38')]=_['keys'](_0xdb55ea[_0x62f1('0x38')]);_0x21377b[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x21377b[_0x62f1('0x3c')],_0x21377b[_0x62f1('0x38')]);_0xdd5b58[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x21377b['model'],qs[_0x62f1('0x3e')](_0xdb55ea['query'][_0x62f1('0x3e')]));_0xdd5b58[_0x62f1('0x3d')]=_0xdd5b58[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0xdd5b58[_0x62f1('0x3d')]:_0x21377b['model'];_0xdd5b58[_0x62f1('0x41')]=qs[_0x62f1('0x62')](_0xdb55ea[_0x62f1('0x38')][_0x62f1('0x62')]);_0xdd5b58['where']=qs[_0x62f1('0x3a')](_[_0x62f1('0x63')](_0xdb55ea[_0x62f1('0x38')],_0x21377b['filters']));if(_0xdb55ea['query'][_0x62f1('0x2b')]){_0xdd5b58[_0x62f1('0x42')]=_['merge'](_0xdd5b58['where'],{'$or':_['map'](_0xdd5b58[_0x62f1('0x3d')],function(_0x3132bd){var _0x2e7a96={};_0x2e7a96[_0x3132bd]={'$like':'%'+_0xdb55ea[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x2e7a96;})});}_0xdd5b58=_[_0x62f1('0x43')]({},_0xdd5b58,_0xdb55ea[_0x62f1('0x45')]);return _0x47e081[_0x62f1('0x9a')](_0xdd5b58);}})['then'](function(_0x9b9788){if(_0x9b9788){_0x13658c=_0x9b9788['length'];if(!_0xdb55ea[_0x62f1('0x38')][_0x62f1('0x61')]('nolimit')){_0xdd5b58[_0x62f1('0x1f')]=qs['limit'](_0xdb55ea[_0x62f1('0x38')][_0x62f1('0x1f')]);_0xdd5b58[_0x62f1('0x1e')]=qs['offset'](_0xdb55ea[_0x62f1('0x38')][_0x62f1('0x1e')]);}return _0x47e081[_0x62f1('0x9a')](_0xdd5b58);}})['then'](function(_0x333e44){if(_0x333e44){return _0x333e44?{'count':_0x13658c,'rows':_0x333e44}:null;}})[_0x62f1('0x25')](respondWithResult(_0x35b661,null))['catch'](handleError(_0x35b661,null));};exports[_0x62f1('0x9c')]=function(_0xfbc86b,_0x23d8c9,_0x52821e){var _0x4927da,_0x45bfaf;return db['VoiceQueue'][_0x62f1('0x4e')]({'where':{'id':_0xfbc86b['params']['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x23d8c9,null))[_0x62f1('0x25')](function(_0x2dafe2){if(_0x2dafe2){_0x45bfaf=_0x2dafe2;return _0x2dafe2[_0x62f1('0x9c')](_0xfbc86b[_0x62f1('0x50')][_0x62f1('0x7f')],_[_0x62f1('0x59')](_0xfbc86b[_0x62f1('0x50')],[_0x62f1('0x7f'),'id'])||{});}return null;})[_0x62f1('0x92')](function(_0x32d109){var _0x954134;_0x4927da=_0x32d109||[];var _0x256010=[];if(_0x32d109){for(var _0x2f8148=0x0;_0x2f8148<_0x32d109[_0x62f1('0x3f')];_0x2f8148+=0x1){var _0x562fae=_0x32d109[_0x2f8148][_0x62f1('0x52')]({'plain':!![]});_0x45bfaf[_0x62f1('0x9d')]=_0xfbc86b[_0x62f1('0x50')][_0x62f1('0x9d')]?_0xfbc86b[_0x62f1('0x50')][_0x62f1('0x9d')]:_0x45bfaf[_0x62f1('0x9d')];switch(_0x45bfaf[_0x62f1('0x9d')]){case'always':_0x954134=squel[_0x62f1('0x9e')]()[_0x62f1('0x9f')](_0x62f1('0xa0'))[_0x62f1('0xa1')](['phone',_0x62f1('0xa2'),'ContactId',_0x62f1('0xa3'),_0x62f1('0x64'),_0x62f1('0x5b'),_0x62f1('0x5a')],squel['select']()[_0x62f1('0xa4')](_0x62f1('0xa5'),'phone')[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0xa2'))[_0x62f1('0xa4')]('id','ContactId')[_0x62f1('0xa4')](_0x562fae['CmListId'][_0x62f1('0x88')](),_0x62f1('0xa3'))[_0x62f1('0xa4')](_0xfbc86b[_0x62f1('0x4c')]['id']['toString'](),_0x62f1('0x64'))[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0x5b'))[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0x5a'))[_0x62f1('0xa7')](_0x62f1('0xa8'))['where'](_0x62f1('0xa9'))[_0x62f1('0x42')]('ListId\x20=\x20?',_0x562fae[_0x62f1('0xaa')][_0x62f1('0x88')]())[_0x62f1('0x42')]('phone\x20IS\x20NOT\x20NULL')[_0x62f1('0x42')](_0x62f1('0xab'),squel[_0x62f1('0x80')]()['field'](_0x62f1('0xac'))[_0x62f1('0xa7')](_0x62f1('0xad'))[_0x62f1('0x42')](_0x62f1('0x86'),_0xfbc86b['params']['id'][_0x62f1('0x88')]()))[_0x62f1('0x42')](_0x62f1('0xab'),squel[_0x62f1('0x80')]()[_0x62f1('0xa4')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where'](_0x62f1('0x86'),_0xfbc86b['params']['id'][_0x62f1('0x88')]())))['toString']();break;case'onlyIfOpen':_0x954134=squel[_0x62f1('0x9e')]()['into']('cm_hopper')[_0x62f1('0xa1')]([_0x62f1('0xa5'),_0x62f1('0xa2'),_0x62f1('0xae'),_0x62f1('0xa3'),_0x62f1('0x64'),_0x62f1('0x5b'),_0x62f1('0x5a')],squel[_0x62f1('0x80')]()[_0x62f1('0xa4')](_0x62f1('0xa5'),_0x62f1('0xa5'))[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0xa2'))[_0x62f1('0xa4')]('id',_0x62f1('0xae'))[_0x62f1('0xa4')](_0x562fae['CmListId'][_0x62f1('0x88')](),_0x62f1('0xa3'))[_0x62f1('0xa4')](_0xfbc86b[_0x62f1('0x4c')]['id'][_0x62f1('0x88')](),'VoiceQueueId')['field'](_0x62f1('0xa6'),'createdAt')['field'](_0x62f1('0xa6'),'updatedAt')[_0x62f1('0xa7')](_0x62f1('0xa8'))[_0x62f1('0x42')](_0x62f1('0xa9'))[_0x62f1('0x42')](_0x62f1('0xaf'),_0x562fae['CmListId']['toString']())[_0x62f1('0x42')](_0x62f1('0xb0'))[_0x62f1('0x42')](_0x62f1('0xab'),squel[_0x62f1('0x80')]()[_0x62f1('0xa4')](_0x62f1('0xb1'))['from'](_0x62f1('0xa0'))[_0x62f1('0x42')]('VoiceQueueId\x20=\x20?',_0xfbc86b[_0x62f1('0x4c')]['id'][_0x62f1('0x88')]())))[_0x62f1('0x88')]();break;default:_0x954134=squel[_0x62f1('0x9e')]()[_0x62f1('0x9f')](_0x62f1('0xa0'))[_0x62f1('0xa1')]([_0x62f1('0xa5'),_0x62f1('0xa2'),'ContactId',_0x62f1('0xa3'),_0x62f1('0x64'),_0x62f1('0x5b'),_0x62f1('0x5a')],squel[_0x62f1('0x80')]()[_0x62f1('0xa4')](_0x62f1('0xa5'),'phone')[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0xa2'))[_0x62f1('0xa4')]('id','ContactId')[_0x62f1('0xa4')](_0x562fae['CmListId']['toString'](),_0x62f1('0xa3'))['field'](_0xfbc86b['params']['id'][_0x62f1('0x88')](),_0x62f1('0x64'))[_0x62f1('0xa4')]('NOW()',_0x62f1('0x5b'))[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0x5a'))[_0x62f1('0xa7')]('cm_contacts')['where'](_0x62f1('0xa9'))[_0x62f1('0x42')](_0x62f1('0xaf'),_0x562fae[_0x62f1('0xaa')]['toString']())[_0x62f1('0x42')](_0x62f1('0xb0')))[_0x62f1('0x88')]();}_0x256010[_0x62f1('0x94')](db[_0x62f1('0x75')][_0x62f1('0x38')](_0x954134));}return BPromise[_0x62f1('0x8c')](_0x256010);}})['then'](function(){return _0x4927da;})['then'](respondWithResult(_0x23d8c9,null))[_0x62f1('0x4a')](handleError(_0x23d8c9,null));};exports['removeLists']=function(_0x15088c,_0x30ef27,_0x3ccacf){return db[_0x62f1('0x46')]['find']({'where':{'id':_0x15088c['params']['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x30ef27,null))[_0x62f1('0x25')](function(_0x57485e){if(_0x57485e){return _0x57485e['removeLists'](_0x15088c['query']['ids']);}})[_0x62f1('0x25')](function(_0x4d1ea0){if(_0x4d1ea0){return db['CmHopper']['destroy']({'where':{'ListId':_0x15088c[_0x62f1('0x38')][_0x62f1('0x7f')],'VoiceQueueId':_0x15088c['params']['id']}})['then'](function(){return _0x4d1ea0;});}})[_0x62f1('0x25')](respondWithStatusCode(_0x30ef27,null))[_0x62f1('0x4a')](handleError(_0x30ef27,null));};exports[_0x62f1('0xb2')]=function(_0x4796e9,_0x384241,_0x48d22a){var _0x38712e={};var _0x6addb5={};var _0x205609;var _0x1f198c;return db[_0x62f1('0x46')][_0x62f1('0x5e')]({'where':{'id':_0x4796e9[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x384241,null))[_0x62f1('0x25')](function(_0x1cb91c){if(_0x1cb91c){_0x205609=_0x1cb91c;_0x6addb5[_0x62f1('0x3c')]=_[_0x62f1('0x39')](db['CmList'][_0x62f1('0x60')]);_0x6addb5[_0x62f1('0x38')]=_[_0x62f1('0x39')](_0x4796e9[_0x62f1('0x38')]);_0x6addb5[_0x62f1('0x3a')]=_[_0x62f1('0x3b')](_0x6addb5[_0x62f1('0x3c')],_0x6addb5[_0x62f1('0x38')]);_0x38712e[_0x62f1('0x3d')]=_[_0x62f1('0x3b')](_0x6addb5[_0x62f1('0x3c')],qs[_0x62f1('0x3e')](_0x4796e9['query'][_0x62f1('0x3e')]));_0x38712e['attributes']=_0x38712e[_0x62f1('0x3d')][_0x62f1('0x3f')]?_0x38712e[_0x62f1('0x3d')]:_0x6addb5[_0x62f1('0x3c')];_0x38712e[_0x62f1('0x41')]=qs[_0x62f1('0x62')](_0x4796e9[_0x62f1('0x38')][_0x62f1('0x62')]);_0x38712e[_0x62f1('0x42')]=qs[_0x62f1('0x3a')](_[_0x62f1('0x63')](_0x4796e9[_0x62f1('0x38')],_0x6addb5[_0x62f1('0x3a')]));if(_0x4796e9[_0x62f1('0x38')][_0x62f1('0x2b')]){_0x38712e['where']=_[_0x62f1('0x43')](_0x38712e[_0x62f1('0x42')],{'$or':_[_0x62f1('0x2d')](_0x38712e[_0x62f1('0x3d')],function(_0x104027){var _0x254528={};_0x254528[_0x104027]={'$like':'%'+_0x4796e9[_0x62f1('0x38')][_0x62f1('0x2b')]+'%'};return _0x254528;})});}_0x38712e=_[_0x62f1('0x43')]({},_0x38712e,_0x4796e9[_0x62f1('0x45')]);return _0x205609[_0x62f1('0xb2')](_0x38712e);}})['then'](function(_0x2f2c58){if(_0x2f2c58){_0x1f198c=_0x2f2c58[_0x62f1('0x3f')];if(!_0x4796e9[_0x62f1('0x38')][_0x62f1('0x61')](_0x62f1('0x40'))){_0x38712e[_0x62f1('0x1f')]=qs[_0x62f1('0x1f')](_0x4796e9[_0x62f1('0x38')][_0x62f1('0x1f')]);_0x38712e[_0x62f1('0x1e')]=qs['offset'](_0x4796e9[_0x62f1('0x38')][_0x62f1('0x1e')]);}return _0x205609[_0x62f1('0xb2')](_0x38712e);}})[_0x62f1('0x25')](function(_0x34e936){if(_0x34e936){return _0x34e936?{'count':_0x1f198c,'rows':_0x34e936}:null;}})[_0x62f1('0x25')](respondWithResult(_0x384241,null))[_0x62f1('0x4a')](handleError(_0x384241,null));};exports[_0x62f1('0xb3')]=function(_0x4db5b9,_0x49aa0c,_0x5c86d3){var _0x18686b,_0x4e78e9;return db[_0x62f1('0x46')][_0x62f1('0x4e')]({'where':{'id':_0x4db5b9[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](handleEntityNotFound(_0x49aa0c,null))[_0x62f1('0x25')](function(_0x13105d){if(_0x13105d){_0x4e78e9=_0x13105d;return _0x13105d[_0x62f1('0xb3')](_0x4db5b9[_0x62f1('0x50')][_0x62f1('0x7f')],_[_0x62f1('0x59')](_0x4db5b9[_0x62f1('0x50')],[_0x62f1('0x7f'),'id'])||{});}return null;})[_0x62f1('0x92')](function(_0x47b815){var _0x173cd;_0x18686b=_0x47b815||[];var _0x122625=[];if(_0x47b815){for(var _0x7d2d07=0x0;_0x7d2d07<_0x47b815[_0x62f1('0x3f')];_0x7d2d07+=0x1){var _0x5c684c=_0x47b815[_0x7d2d07][_0x62f1('0x52')]({'plain':!![]});_0x173cd=squel[_0x62f1('0x9e')]()[_0x62f1('0x9f')](_0x62f1('0xb4'))[_0x62f1('0xa1')]([_0x62f1('0xa5'),_0x62f1('0xae'),_0x62f1('0xa3'),'VoiceQueueId',_0x62f1('0x5b'),_0x62f1('0x5a')],squel[_0x62f1('0x80')]()['field']('phone',_0x62f1('0xa5'))['field']('id',_0x62f1('0xae'))[_0x62f1('0xa4')](_0x5c684c[_0x62f1('0xaa')][_0x62f1('0x88')](),'ListId')['field'](_0x4db5b9['params']['id'][_0x62f1('0x88')](),_0x62f1('0x64'))[_0x62f1('0xa4')](_0x62f1('0xa6'),_0x62f1('0x5b'))['field'](_0x62f1('0xa6'),_0x62f1('0x5a'))[_0x62f1('0xa7')](_0x62f1('0xa8'))['where']('deletedAt\x20IS\x20NULL')[_0x62f1('0x42')](_0x62f1('0xaf'),_0x5c684c['CmListId']['toString']())['where'](_0x62f1('0xb0')))[_0x62f1('0x88')]();_0x122625[_0x62f1('0x94')](db['sequelize'][_0x62f1('0x38')](_0x173cd));}return BPromise[_0x62f1('0x8c')](_0x122625);}})[_0x62f1('0x25')](function(){return _0x18686b;})['then'](respondWithResult(_0x49aa0c,null))[_0x62f1('0x4a')](handleError(_0x49aa0c,null));};exports[_0x62f1('0xb5')]=function(_0xe745ab,_0x1bc788,_0x46db40){return db[_0x62f1('0x46')][_0x62f1('0x4e')]({'where':{'id':_0xe745ab[_0x62f1('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1bc788,null))[_0x62f1('0x25')](function(_0x597851){if(_0x597851){return _0x597851[_0x62f1('0xb5')](_0xe745ab['query'][_0x62f1('0x7f')]);}})[_0x62f1('0x25')](function(_0x73b526){if(_0x73b526){return db[_0x62f1('0x69')]['destroy']({'where':{'ListId':_0xe745ab[_0x62f1('0x38')][_0x62f1('0x7f')],'VoiceQueueId':_0xe745ab[_0x62f1('0x4c')]['id']}})[_0x62f1('0x25')](function(){return _0x73b526;});}})['then'](respondWithStatusCode(_0x1bc788,null))[_0x62f1('0x4a')](handleError(_0x1bc788,null));};
\ No newline at end of file
+var _0x4757=['NOW()','ContactId','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','select','ListId\x20=\x20?','removeLists','getBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','outbound','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','send','index','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','fields','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','updatedAt','body','omit','QueueCampaigns','UserProfileSection','userProfileId','findOne','CmHopper','rawAttributes','pick','VoiceQueueId','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','length','Team','getTeams','addTeams','User','voicePause','flatMap','Agents','forEach','penalty','each','UserVoiceQueue','UserVoiceQueueRt','isNil','format','SIP/%s','userVoiceQueue:save','removeTeams','ids','field','from','team_has_voice_queues','join','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','all','sequelize','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','emit','online','interface','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','scheduledAt','ListId','phone'];(function(_0x20b0ef,_0x20e8c8){var _0x1f32c8=function(_0x3c42c5){while(--_0x3c42c5){_0x20b0ef['push'](_0x20b0ef['shift']());}};_0x1f32c8(++_0x20e8c8);}(_0x4757,0xc9));var _0x7475=function(_0x41cfd4,_0x1ed2cc){_0x41cfd4=_0x41cfd4-0x0;var _0x190f48=_0x4757[_0x41cfd4];return _0x190f48;};'use strict';var emlformat=require(_0x7475('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7475('0x1'));var jsonpatch=require(_0x7475('0x2'));var rp=require(_0x7475('0x3'));var moment=require(_0x7475('0x4'));var BPromise=require(_0x7475('0x5'));var Mustache=require(_0x7475('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7475('0x7'));var ejs=require(_0x7475('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7475('0x9'));var squel=require(_0x7475('0xa'));var crypto=require(_0x7475('0xb'));var jsforce=require(_0x7475('0xc'));var deskjs=require(_0x7475('0xd'));var toCsv=require(_0x7475('0x7'));var querystring=require(_0x7475('0xe'));var Papa=require(_0x7475('0xf'));var Redis=require(_0x7475('0x10'));var authService=require(_0x7475('0x11'));var qs=require(_0x7475('0x12'));var as=require(_0x7475('0x13'));var hardwareService=require(_0x7475('0x14'));var logger=require(_0x7475('0x15'))(_0x7475('0x16'));var utils=require(_0x7475('0x17'));var config=require(_0x7475('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7475('0x19'))['db'];config[_0x7475('0x1a')]=_[_0x7475('0x1b')](config[_0x7475('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x7475('0x1c'))(new Redis(config['redis']));require(_0x7475('0x1d'))[_0x7475('0x1e')](socket);function respondWithStatusCode(_0x1113f3,_0x2d4116){_0x2d4116=_0x2d4116||0xcc;return function(_0x1e8490){if(_0x1e8490){return _0x1113f3[_0x7475('0x1f')](_0x2d4116);}return _0x1113f3['status'](_0x2d4116)[_0x7475('0x20')]();};}function respondWithResult(_0x1f427f,_0x2d5596){_0x2d5596=_0x2d5596||0xc8;return function(_0x363971){if(_0x363971){return _0x1f427f[_0x7475('0x21')](_0x2d5596)[_0x7475('0x22')](_0x363971);}};}function respondWithFilteredResult(_0x56edf1,_0x3b03e9){return function(_0x4509c4){if(_0x4509c4){var _0x5d65cd=typeof _0x3b03e9['offset']===_0x7475('0x23')&&typeof _0x3b03e9[_0x7475('0x24')]===_0x7475('0x23');var _0x3d9ee1=_0x4509c4['count'];var _0x371bf9=_0x5d65cd?0x0:_0x3b03e9[_0x7475('0x25')];var _0x3ecd64=_0x5d65cd?_0x4509c4[_0x7475('0x26')]:_0x3b03e9[_0x7475('0x25')]+_0x3b03e9[_0x7475('0x24')];var _0x20c0a5;if(_0x3ecd64>=_0x3d9ee1){_0x3ecd64=_0x3d9ee1;_0x20c0a5=0xc8;}else{_0x20c0a5=0xce;}_0x56edf1[_0x7475('0x21')](_0x20c0a5);return _0x56edf1[_0x7475('0x27')](_0x7475('0x28'),_0x371bf9+'-'+_0x3ecd64+'/'+_0x3d9ee1)[_0x7475('0x22')](_0x4509c4);}return null;};}function patchUpdates(_0x2300ef){return function(_0x67ca7){try{jsonpatch[_0x7475('0x29')](_0x67ca7,_0x2300ef,!![]);}catch(_0x5176ab){return BPromise[_0x7475('0x2a')](_0x5176ab);}return _0x67ca7[_0x7475('0x2b')]();};}function saveUpdates(_0x31c2b8,_0x27c379){return function(_0x7423fc){if(_0x7423fc){return _0x7423fc[_0x7475('0x2c')](_0x31c2b8)[_0x7475('0x2d')](function(_0x36eb84){return _0x36eb84;});}return null;};}function removeEntity(_0x5eaf18,_0x4e645a){return function(_0x17a45a){if(_0x17a45a){return _0x17a45a[_0x7475('0x2e')]()[_0x7475('0x2d')](function(){var _0x172a74=_0x17a45a[_0x7475('0x2f')]({'plain':!![]});var _0x12ad54=[{'name':_0x7475('0x30'),'value':'inbound','ignore':![]},{'name':'QueueCampaigns','value':_0x7475('0x31'),'ignore':![]}];var _0x16164b=_(_0x12ad54)[_0x7475('0x32')](_0x7475('0x33'))[_0x7475('0x34')](_0x7475('0x35'))[_0x7475('0x35')]();if(_[_0x7475('0x36')](_0x16164b,_0x172a74['type'])){return;}var _0x54c3b4=_[_0x7475('0x37')](_0x12ad54,['value',_0x172a74[_0x7475('0x38')]])[_0x7475('0x39')];return db[_0x7475('0x3a')][_0x7475('0x2e')]({'where':{'type':_0x54c3b4,'resourceId':_0x172a74['id']}})['then'](function(){return _0x17a45a;});})[_0x7475('0x2d')](function(){_0x5eaf18[_0x7475('0x21')](0xcc)[_0x7475('0x20')]();});}};}function handleEntityNotFound(_0x2b7383,_0x1ed2e9){return function(_0x4c95a4){if(!_0x4c95a4){_0x2b7383[_0x7475('0x1f')](0x194);}return _0x4c95a4;};}function handleError(_0x22ef00,_0x234e25){_0x234e25=_0x234e25||0x1f4;return function(_0x487f4b){logger[_0x7475('0x3b')](_0x487f4b['stack']);if(_0x487f4b[_0x7475('0x39')]){delete _0x487f4b['name'];}_0x22ef00[_0x7475('0x21')](_0x234e25)[_0x7475('0x3c')](_0x487f4b);};}exports[_0x7475('0x3d')]=function(_0x271f02,_0x16cee9){var _0xa57dab={},_0x31abd0={},_0x353d81={'count':0x0,'rows':[]};var _0xc6e128=_['map'](db[_0x7475('0x3e')]['rawAttributes'],function(_0x293afd){return{'name':_0x293afd[_0x7475('0x3f')],'type':_0x293afd[_0x7475('0x38')][_0x7475('0x40')]};});_0x31abd0[_0x7475('0x41')]=_['map'](_0xc6e128,'name');_0x31abd0[_0x7475('0x42')]=_[_0x7475('0x43')](_0x271f02['query']);_0x31abd0[_0x7475('0x44')]=_[_0x7475('0x45')](_0x31abd0[_0x7475('0x41')],_0x31abd0[_0x7475('0x42')]);_0xa57dab[_0x7475('0x46')]=_[_0x7475('0x45')](_0x31abd0['model'],qs['fields'](_0x271f02[_0x7475('0x42')]['fields']));_0xa57dab[_0x7475('0x46')]=_0xa57dab['attributes']['length']?_0xa57dab[_0x7475('0x46')]:_0x31abd0[_0x7475('0x41')];if(!_0x271f02['query'][_0x7475('0x47')](_0x7475('0x48'))){_0xa57dab['limit']=qs[_0x7475('0x24')](_0x271f02[_0x7475('0x42')][_0x7475('0x24')]);_0xa57dab[_0x7475('0x25')]=qs[_0x7475('0x25')](_0x271f02[_0x7475('0x42')][_0x7475('0x25')]);}_0xa57dab[_0x7475('0x49')]=qs['sort'](_0x271f02['query'][_0x7475('0x4a')]);_0xa57dab[_0x7475('0x4b')]=qs[_0x7475('0x44')](_['pick'](_0x271f02['query'],_0x31abd0['filters']),_0xc6e128);if(_0x271f02[_0x7475('0x42')][_0x7475('0x32')]){_0xa57dab['where']=_[_0x7475('0x4c')](_0xa57dab[_0x7475('0x4b')],{'$or':_['map'](_0xc6e128,function(_0x33db0d){if(_0x33db0d[_0x7475('0x38')]!==_0x7475('0x4d')){var _0x356e58={};_0x356e58[_0x33db0d[_0x7475('0x39')]]={'$like':'%'+_0x271f02[_0x7475('0x42')]['filter']+'%'};return _0x356e58;}})});}_0xa57dab=_[_0x7475('0x4c')]({},_0xa57dab,_0x271f02[_0x7475('0x4e')]);var _0x2636ee={'where':_0xa57dab['where']};return db[_0x7475('0x3e')][_0x7475('0x26')](_0x2636ee)[_0x7475('0x2d')](function(_0x5c4524){_0x353d81[_0x7475('0x26')]=_0x5c4524;if(_0x271f02[_0x7475('0x42')][_0x7475('0x4f')]){_0xa57dab['include']=[{'all':!![]}];}return db[_0x7475('0x3e')][_0x7475('0x50')](_0xa57dab);})[_0x7475('0x2d')](function(_0x1348ee){_0x353d81[_0x7475('0x51')]=_0x1348ee;return _0x353d81;})[_0x7475('0x2d')](respondWithFilteredResult(_0x16cee9,_0xa57dab))[_0x7475('0x52')](handleError(_0x16cee9,null));};exports[_0x7475('0x53')]=function(_0x4f34a3,_0x5b84fb){var _0x1287df={'raw':![],'where':{'id':_0x4f34a3['params']['id']}},_0x1765b5={};_0x1765b5[_0x7475('0x41')]=_[_0x7475('0x43')](db['VoiceQueue']['rawAttributes']);_0x1765b5['query']=_[_0x7475('0x43')](_0x4f34a3[_0x7475('0x42')]);_0x1765b5[_0x7475('0x44')]=_[_0x7475('0x45')](_0x1765b5[_0x7475('0x41')],_0x1765b5[_0x7475('0x42')]);_0x1287df['attributes']=_[_0x7475('0x45')](_0x1765b5[_0x7475('0x41')],qs[_0x7475('0x54')](_0x4f34a3['query'][_0x7475('0x54')]));_0x1287df['attributes']=_0x1287df[_0x7475('0x46')]['length']?_0x1287df['attributes']:_0x1765b5['model'];if(_0x4f34a3[_0x7475('0x42')][_0x7475('0x4f')]){_0x1287df[_0x7475('0x55')]=[{'all':!![]}];}_0x1287df=_[_0x7475('0x4c')]({},_0x1287df,_0x4f34a3[_0x7475('0x4e')]);return db[_0x7475('0x3e')][_0x7475('0x37')](_0x1287df)[_0x7475('0x2d')](handleEntityNotFound(_0x5b84fb,null))[_0x7475('0x2d')](respondWithResult(_0x5b84fb,null))[_0x7475('0x52')](handleError(_0x5b84fb,null));};exports[_0x7475('0x56')]=function(_0x53bce1,_0x5ce37f){return db[_0x7475('0x3e')][_0x7475('0x56')](_0x53bce1['body'],{})[_0x7475('0x2d')](function(_0x298087){var _0x5e7ae9=_0x53bce1[_0x7475('0x57')][_0x7475('0x2f')]({'plain':!![]});if(!_0x5e7ae9)throw new Error(_0x7475('0x58'));if(_0x5e7ae9[_0x7475('0x59')]===_0x7475('0x57')){var _0x202e19=_0x298087[_0x7475('0x2f')]({'plain':!![]});var _0x458306=[{'name':_0x7475('0x30'),'value':_0x7475('0x5a')},{'name':'QueueCampaigns','value':_0x7475('0x31')}];var _0x1555e8=_['find'](_0x458306,['value',_0x202e19[_0x7475('0x38')]])[_0x7475('0x39')];return db['UserProfileSection'][_0x7475('0x37')]({'where':{'name':_0x1555e8,'userProfileId':_0x5e7ae9['userProfileId']},'raw':!![]})[_0x7475('0x2d')](function(_0x4d28c9){if(_0x4d28c9&&_0x4d28c9[_0x7475('0x5b')]===0x0){return db[_0x7475('0x3a')][_0x7475('0x56')]({'name':_0x202e19[_0x7475('0x39')],'resourceId':_0x202e19['id'],'type':_0x4d28c9[_0x7475('0x39')],'sectionId':_0x4d28c9['id']},{})[_0x7475('0x2d')](function(){return _0x298087;});}else{return _0x298087;}})[_0x7475('0x52')](function(_0x2c2a0d){logger[_0x7475('0x3b')](_0x7475('0x5c'),_0x2c2a0d);throw _0x2c2a0d;});}return _0x298087;})[_0x7475('0x2d')](respondWithResult(_0x5ce37f,0xc9))[_0x7475('0x52')](handleError(_0x5ce37f,null));};exports[_0x7475('0x5d')]=function(_0x27a48c,_0x1675d2){var _0x3b9c2c={'where':{'id':_0x27a48c[_0x7475('0x5e')]['id']}},_0x20b64a={};_0x20b64a[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x3e')]['rawAttributes']);_0x3b9c2c[_0x7475('0x46')]=_[_0x7475('0x45')](_0x20b64a['model'],qs[_0x7475('0x54')](_0x27a48c[_0x7475('0x42')]['fields']));_0x3b9c2c[_0x7475('0x46')]=_0x3b9c2c[_0x7475('0x46')]['length']?_0x3b9c2c['attributes']:_0x20b64a[_0x7475('0x41')];if(_0x27a48c['query'][_0x7475('0x4f')]){_0x3b9c2c[_0x7475('0x55')]=[{'all':!![]}];}_0x3b9c2c=_[_0x7475('0x4c')]({},_0x3b9c2c,_0x27a48c['options']);return db['VoiceQueue'][_0x7475('0x37')](_0x3b9c2c)[_0x7475('0x2d')](handleEntityNotFound(_0x1675d2,null))[_0x7475('0x2d')](function(_0x3cf44a){if(_0x3cf44a){var _0x21c5af=_0x3cf44a['get']({'plain':!![]});_0x21c5af=qs['omit'](_0x21c5af,['id',_0x7475('0x5f'),_0x7475('0x60')]);_0x27a48c[_0x7475('0x61')]=_[_0x7475('0x62')](_0x27a48c[_0x7475('0x61')],['id',_0x7475('0x5f'),_0x7475('0x60')]);return db['VoiceQueue'][_0x7475('0x56')](_[_0x7475('0x4c')](_0x21c5af,_0x27a48c[_0x7475('0x61')]),{'include':_0x27a48c['query']['includeAll']?[{'all':!![]}]:undefined})[_0x7475('0x2d')](function(_0x317aff){var _0x19283d=_0x27a48c[_0x7475('0x57')]['get']({'plain':!![]});if(!_0x19283d)throw new Error(_0x7475('0x58'));if(_0x19283d[_0x7475('0x59')]===_0x7475('0x57')){var _0x52d170=_0x317aff['get']({'plain':!![]});var _0x4e89a2=[{'name':_0x7475('0x30'),'value':_0x7475('0x5a')},{'name':_0x7475('0x63'),'value':_0x7475('0x31')}];var _0x5ecd9a=_[_0x7475('0x37')](_0x4e89a2,[_0x7475('0x35'),_0x52d170[_0x7475('0x38')]])[_0x7475('0x39')];return db[_0x7475('0x64')][_0x7475('0x37')]({'where':{'name':_0x5ecd9a,'userProfileId':_0x19283d[_0x7475('0x65')]},'raw':!![]})['then'](function(_0xa44927){if(_0xa44927&&_0xa44927[_0x7475('0x5b')]===0x0){return db[_0x7475('0x3a')][_0x7475('0x56')]({'name':_0x52d170[_0x7475('0x39')],'resourceId':_0x52d170['id'],'type':_0xa44927[_0x7475('0x39')],'sectionId':_0xa44927['id']},{})['then'](function(){return _0x317aff;});}else{return _0x317aff;}})[_0x7475('0x52')](function(_0x266ffb){logger[_0x7475('0x3b')](_0x7475('0x5c'),_0x266ffb);throw _0x266ffb;});}return _0x317aff;});}})[_0x7475('0x2d')](respondWithResult(_0x1675d2,0xc9))[_0x7475('0x52')](handleError(_0x1675d2,null));};exports[_0x7475('0x2c')]=function(_0xc5fce5,_0x1526da){if(_0xc5fce5[_0x7475('0x61')]['id']){delete _0xc5fce5[_0x7475('0x61')]['id'];}return db['VoiceQueue']['find']({'where':{'id':_0xc5fce5[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x1526da,null))[_0x7475('0x2d')](saveUpdates(_0xc5fce5[_0x7475('0x61')],null))[_0x7475('0x2d')](respondWithResult(_0x1526da,null))[_0x7475('0x52')](handleError(_0x1526da,null));};exports['destroy']=function(_0x1720f1,_0x49c74b){return db[_0x7475('0x3e')][_0x7475('0x37')]({'where':{'id':_0x1720f1[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x49c74b,null))[_0x7475('0x2d')](removeEntity(_0x49c74b,null))[_0x7475('0x52')](handleError(_0x49c74b,null));};exports['getHoppers']=function(_0x2a8bee,_0x51974d,_0x14e1dc){var _0x578b3b={'raw':![],'where':{}};var _0xc1df01={};var _0x56f0a1={'count':0x0,'rows':[]};return db[_0x7475('0x3e')][_0x7475('0x66')]({'where':{'id':_0x2a8bee[_0x7475('0x5e')]['id']}})['then'](handleEntityNotFound(_0x51974d,null))['then'](function(_0x1f59cb){if(_0x1f59cb){_0xc1df01[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x67')][_0x7475('0x68')]);_0xc1df01[_0x7475('0x42')]=_[_0x7475('0x43')](_0x2a8bee[_0x7475('0x42')]);_0xc1df01['filters']=_[_0x7475('0x45')](_0xc1df01['model'],_0xc1df01[_0x7475('0x42')]);_0x578b3b[_0x7475('0x46')]=_[_0x7475('0x45')](_0xc1df01[_0x7475('0x41')],qs['fields'](_0x2a8bee[_0x7475('0x42')][_0x7475('0x54')]));_0x578b3b['attributes']=_0x578b3b['attributes']['length']?_0x578b3b[_0x7475('0x46')]:_0xc1df01[_0x7475('0x41')];if(!_0x2a8bee[_0x7475('0x42')]['hasOwnProperty'](_0x7475('0x48'))){_0x578b3b['limit']=qs[_0x7475('0x24')](_0x2a8bee[_0x7475('0x42')][_0x7475('0x24')]);_0x578b3b[_0x7475('0x25')]=qs['offset'](_0x2a8bee[_0x7475('0x42')][_0x7475('0x25')]);}_0x578b3b[_0x7475('0x49')]=qs[_0x7475('0x4a')](_0x2a8bee[_0x7475('0x42')][_0x7475('0x4a')]);_0x578b3b['where']=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x2a8bee[_0x7475('0x42')],_0xc1df01['filters']));_0x578b3b['where'][_0x7475('0x6a')]=_0x1f59cb['id'];if(_0x2a8bee[_0x7475('0x42')]['filter']){_0x578b3b[_0x7475('0x4b')]=_[_0x7475('0x4c')](_0x578b3b[_0x7475('0x4b')],{'$or':_[_0x7475('0x34')](_0x578b3b[_0x7475('0x46')],function(_0x29fb59){var _0x471821={};_0x471821[_0x29fb59]={'$like':'%'+_0x2a8bee[_0x7475('0x42')][_0x7475('0x32')]+'%'};return _0x471821;})});}_0x578b3b=_[_0x7475('0x4c')]({},_0x578b3b,_0x2a8bee[_0x7475('0x4e')]);return db['CmHopper'][_0x7475('0x26')]({'where':_0x578b3b[_0x7475('0x4b')]})[_0x7475('0x2d')](function(_0x33585b){_0x56f0a1['count']=_0x33585b;if(_0x2a8bee[_0x7475('0x42')][_0x7475('0x4f')]){_0x578b3b[_0x7475('0x55')]=[{'all':!![]}];}return db[_0x7475('0x67')][_0x7475('0x50')](_0x578b3b);})[_0x7475('0x2d')](function(_0x126623){_0x56f0a1[_0x7475('0x51')]=_0x126623;return _0x56f0a1;});}})[_0x7475('0x2d')](respondWithFilteredResult(_0x51974d,_0x578b3b))[_0x7475('0x52')](handleError(_0x51974d,null));};exports['getHopperHistories']=function(_0x557b37,_0x4f5b1e,_0x14b465){var _0x3835b9={'raw':!![],'where':{}};var _0x1e1454={};var _0x25a0ce={'count':0x0,'rows':[]};return db[_0x7475('0x3e')][_0x7475('0x66')]({'where':{'id':_0x557b37[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x4f5b1e,null))['then'](function(_0x406bbb){if(_0x406bbb){_0x1e1454[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x6b')][_0x7475('0x68')]);_0x1e1454[_0x7475('0x42')]=_[_0x7475('0x43')](_0x557b37[_0x7475('0x42')]);_0x1e1454[_0x7475('0x44')]=_[_0x7475('0x45')](_0x1e1454[_0x7475('0x41')],_0x1e1454[_0x7475('0x42')]);_0x3835b9[_0x7475('0x46')]=_['intersection'](_0x1e1454[_0x7475('0x41')],qs[_0x7475('0x54')](_0x557b37[_0x7475('0x42')][_0x7475('0x54')]));_0x3835b9[_0x7475('0x46')]=_0x3835b9[_0x7475('0x46')]['length']?_0x3835b9[_0x7475('0x46')]:_0x1e1454['model'];if(!_0x557b37[_0x7475('0x42')][_0x7475('0x47')](_0x7475('0x48'))){_0x3835b9[_0x7475('0x24')]=qs[_0x7475('0x24')](_0x557b37['query'][_0x7475('0x24')]);_0x3835b9[_0x7475('0x25')]=qs['offset'](_0x557b37['query'][_0x7475('0x25')]);}_0x3835b9[_0x7475('0x49')]=qs[_0x7475('0x4a')](_0x557b37[_0x7475('0x42')]['sort']);_0x3835b9[_0x7475('0x4b')]=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x557b37[_0x7475('0x42')],_0x1e1454[_0x7475('0x44')]));_0x3835b9[_0x7475('0x4b')][_0x7475('0x6a')]=_0x406bbb['id'];if(_0x557b37[_0x7475('0x42')][_0x7475('0x32')]){_0x3835b9['where']=_['merge'](_0x3835b9[_0x7475('0x4b')],{'$or':_[_0x7475('0x34')](_0x3835b9[_0x7475('0x46')],function(_0x70f89c){var _0x245e59={};_0x245e59[_0x70f89c]={'$like':'%'+_0x557b37['query']['filter']+'%'};return _0x245e59;})});}_0x3835b9=_[_0x7475('0x4c')]({},_0x3835b9,_0x557b37[_0x7475('0x4e')]);return db[_0x7475('0x6b')]['count']({'where':_0x3835b9['where']})[_0x7475('0x2d')](function(_0x19df41){_0x25a0ce[_0x7475('0x26')]=_0x19df41;if(_0x557b37[_0x7475('0x42')][_0x7475('0x4f')]){_0x3835b9[_0x7475('0x55')]=[{'all':!![]}];}return db[_0x7475('0x6b')][_0x7475('0x50')](_0x3835b9);})[_0x7475('0x2d')](function(_0x4b50f8){_0x25a0ce['rows']=_0x4b50f8;return _0x25a0ce;});}})['then'](respondWithFilteredResult(_0x4f5b1e,_0x3835b9))[_0x7475('0x52')](handleError(_0x4f5b1e,null));};exports['getHopperFinals']=function(_0x5b7886,_0x4b8b6c,_0x5edef4){var _0x56fd58={'raw':!![],'where':{}};var _0x5a085d={};var _0x4aa122={'count':0x0,'rows':[]};return db[_0x7475('0x3e')][_0x7475('0x66')]({'where':{'id':_0x5b7886[_0x7475('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4b8b6c,null))['then'](function(_0x561f5c){if(_0x561f5c){_0x5a085d['model']=_[_0x7475('0x43')](db['CmHopperFinal'][_0x7475('0x68')]);_0x5a085d[_0x7475('0x42')]=_['keys'](_0x5b7886[_0x7475('0x42')]);_0x5a085d[_0x7475('0x44')]=_[_0x7475('0x45')](_0x5a085d[_0x7475('0x41')],_0x5a085d[_0x7475('0x42')]);_0x56fd58[_0x7475('0x46')]=_['intersection'](_0x5a085d['model'],qs[_0x7475('0x54')](_0x5b7886[_0x7475('0x42')]['fields']));_0x56fd58[_0x7475('0x46')]=_0x56fd58['attributes']['length']?_0x56fd58[_0x7475('0x46')]:_0x5a085d[_0x7475('0x41')];if(!_0x5b7886[_0x7475('0x42')][_0x7475('0x47')](_0x7475('0x48'))){_0x56fd58[_0x7475('0x24')]=qs[_0x7475('0x24')](_0x5b7886[_0x7475('0x42')][_0x7475('0x24')]);_0x56fd58[_0x7475('0x25')]=qs[_0x7475('0x25')](_0x5b7886[_0x7475('0x42')][_0x7475('0x25')]);}_0x56fd58[_0x7475('0x49')]=qs[_0x7475('0x4a')](_0x5b7886[_0x7475('0x42')][_0x7475('0x4a')]);_0x56fd58[_0x7475('0x4b')]=qs[_0x7475('0x44')](_['pick'](_0x5b7886[_0x7475('0x42')],_0x5a085d['filters']));_0x56fd58['where']['VoiceQueueId']=_0x561f5c['id'];if(_0x5b7886[_0x7475('0x42')][_0x7475('0x32')]){_0x56fd58[_0x7475('0x4b')]=_[_0x7475('0x4c')](_0x56fd58[_0x7475('0x4b')],{'$or':_['map'](_0x56fd58[_0x7475('0x46')],function(_0x1d3712){var _0x35858c={};_0x35858c[_0x1d3712]={'$like':'%'+_0x5b7886[_0x7475('0x42')][_0x7475('0x32')]+'%'};return _0x35858c;})});}_0x56fd58=_['merge']({},_0x56fd58,_0x5b7886[_0x7475('0x4e')]);return db[_0x7475('0x6c')][_0x7475('0x26')]({'where':_0x56fd58[_0x7475('0x4b')]})[_0x7475('0x2d')](function(_0x26fd43){_0x4aa122[_0x7475('0x26')]=_0x26fd43;if(_0x5b7886[_0x7475('0x42')][_0x7475('0x4f')]){_0x56fd58[_0x7475('0x55')]=[{'all':!![]}];}return db[_0x7475('0x6c')][_0x7475('0x50')](_0x56fd58);})[_0x7475('0x2d')](function(_0x51c247){_0x4aa122[_0x7475('0x51')]=_0x51c247;return _0x4aa122;});}})[_0x7475('0x2d')](respondWithFilteredResult(_0x4b8b6c,_0x56fd58))['catch'](handleError(_0x4b8b6c,null));};exports[_0x7475('0x6d')]=function(_0x13a851,_0x422569,_0x31f074){var _0x526d84={'raw':!![],'where':{}};var _0x2da4d1={};var _0x3b6def={'count':0x0,'rows':[]};return db[_0x7475('0x3e')]['findOne']({'where':{'id':_0x13a851[_0x7475('0x5e')]['id']}})['then'](handleEntityNotFound(_0x422569,null))[_0x7475('0x2d')](function(_0x4ff1f0){if(_0x4ff1f0){_0x2da4d1[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x6e')]['rawAttributes']);_0x2da4d1['query']=_[_0x7475('0x43')](_0x13a851[_0x7475('0x42')]);_0x2da4d1[_0x7475('0x44')]=_[_0x7475('0x45')](_0x2da4d1[_0x7475('0x41')],_0x2da4d1[_0x7475('0x42')]);_0x526d84[_0x7475('0x46')]=_[_0x7475('0x45')](_0x2da4d1[_0x7475('0x41')],qs[_0x7475('0x54')](_0x13a851[_0x7475('0x42')][_0x7475('0x54')]));_0x526d84[_0x7475('0x46')]=_0x526d84[_0x7475('0x46')][_0x7475('0x6f')]?_0x526d84[_0x7475('0x46')]:_0x2da4d1[_0x7475('0x41')];if(!_0x13a851[_0x7475('0x42')][_0x7475('0x47')]('nolimit')){_0x526d84['limit']=qs[_0x7475('0x24')](_0x13a851['query'][_0x7475('0x24')]);_0x526d84['offset']=qs['offset'](_0x13a851['query'][_0x7475('0x25')]);}_0x526d84['order']=qs['sort'](_0x13a851[_0x7475('0x42')][_0x7475('0x4a')]);_0x526d84[_0x7475('0x4b')]=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x13a851[_0x7475('0x42')],_0x2da4d1['filters']));_0x526d84[_0x7475('0x4b')][_0x7475('0x6a')]=_0x4ff1f0['id'];if(_0x13a851['query'][_0x7475('0x32')]){_0x526d84[_0x7475('0x4b')]=_[_0x7475('0x4c')](_0x526d84['where'],{'$or':_[_0x7475('0x34')](_0x526d84[_0x7475('0x46')],function(_0x22e1bd){var _0x2517bf={};_0x2517bf[_0x22e1bd]={'$like':'%'+_0x13a851['query']['filter']+'%'};return _0x2517bf;})});}_0x526d84=_[_0x7475('0x4c')]({},_0x526d84,_0x13a851[_0x7475('0x4e')]);return db[_0x7475('0x6e')][_0x7475('0x26')]({'where':_0x526d84[_0x7475('0x4b')]})[_0x7475('0x2d')](function(_0x1a7860){_0x3b6def['count']=_0x1a7860;if(_0x13a851[_0x7475('0x42')][_0x7475('0x4f')]){_0x526d84[_0x7475('0x55')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x7475('0x50')](_0x526d84);})['then'](function(_0x134e28){_0x3b6def[_0x7475('0x51')]=_0x134e28;return _0x3b6def;});}})['then'](respondWithFilteredResult(_0x422569,_0x526d84))['catch'](handleError(_0x422569,null));};exports['getTeams']=function(_0x5a1904,_0x22f00c,_0x2483c2){var _0x511ad2={};var _0x1e4d18={};var _0x5ab645;var _0xd179ff;return db[_0x7475('0x3e')]['findOne']({'where':{'id':_0x5a1904[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x22f00c,null))[_0x7475('0x2d')](function(_0x488f2a){if(_0x488f2a){_0x5ab645=_0x488f2a;_0x1e4d18[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x70')][_0x7475('0x68')]);_0x1e4d18[_0x7475('0x42')]=_['keys'](_0x5a1904[_0x7475('0x42')]);_0x1e4d18['filters']=_['intersection'](_0x1e4d18[_0x7475('0x41')],_0x1e4d18[_0x7475('0x42')]);_0x511ad2[_0x7475('0x46')]=_[_0x7475('0x45')](_0x1e4d18[_0x7475('0x41')],qs[_0x7475('0x54')](_0x5a1904[_0x7475('0x42')][_0x7475('0x54')]));_0x511ad2[_0x7475('0x46')]=_0x511ad2[_0x7475('0x46')][_0x7475('0x6f')]?_0x511ad2['attributes']:_0x1e4d18['model'];_0x511ad2[_0x7475('0x49')]=qs[_0x7475('0x4a')](_0x5a1904[_0x7475('0x42')]['sort']);_0x511ad2[_0x7475('0x4b')]=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x5a1904[_0x7475('0x42')],_0x1e4d18['filters']));if(_0x5a1904[_0x7475('0x42')][_0x7475('0x32')]){_0x511ad2[_0x7475('0x4b')]=_['merge'](_0x511ad2['where'],{'$or':_['map'](_0x511ad2[_0x7475('0x46')],function(_0x5d00aa){var _0x212853={};_0x212853[_0x5d00aa]={'$like':'%'+_0x5a1904[_0x7475('0x42')]['filter']+'%'};return _0x212853;})});}_0x511ad2=_[_0x7475('0x4c')]({},_0x511ad2,_0x5a1904[_0x7475('0x4e')]);return _0x5ab645[_0x7475('0x71')](_0x511ad2);}})[_0x7475('0x2d')](function(_0x4ba0b7){if(_0x4ba0b7){_0xd179ff=_0x4ba0b7['length'];if(!_0x5a1904[_0x7475('0x42')]['hasOwnProperty'](_0x7475('0x48'))){_0x511ad2['limit']=qs[_0x7475('0x24')](_0x5a1904[_0x7475('0x42')]['limit']);_0x511ad2[_0x7475('0x25')]=qs[_0x7475('0x25')](_0x5a1904[_0x7475('0x42')][_0x7475('0x25')]);}return _0x5ab645[_0x7475('0x71')](_0x511ad2);}})[_0x7475('0x2d')](function(_0x251ac1){if(_0x251ac1){return _0x251ac1?{'count':_0xd179ff,'rows':_0x251ac1}:null;}})[_0x7475('0x2d')](respondWithResult(_0x22f00c,null))['catch'](handleError(_0x22f00c,null));};exports[_0x7475('0x72')]=function(_0x4897ab,_0x356fe8,_0x4603a3){var _0x3973d2=_0x4897ab[_0x7475('0x61')]['teams'];var _0x2651e4=_[_0x7475('0x34')](_0x3973d2,'id');return db[_0x7475('0x70')][_0x7475('0x50')]({'where':{'id':_0x2651e4},'attributes':['id'],'include':[{'model':db[_0x7475('0x73')],'as':'Agents','attributes':['id',_0x7475('0x39'),'online',_0x7475('0x74'),'interface'],'raw':!![]}]})['then'](function(_0x35d719){if(_0x35d719){var _0x51695c=_[_0x7475('0x75')](_0x35d719,function(_0x1ea07f){var _0x47aa75=_0x1ea07f[_0x7475('0x2f')]({'plain':!![]});_0x47aa75[_0x7475('0x76')][_0x7475('0x77')](function(_0x298791){_0x298791[_0x7475('0x78')]=_['find'](_0x3973d2,{'id':_0x47aa75['id']})['penalty'];});return _0x47aa75[_0x7475('0x76')];});return db[_0x7475('0x3e')][_0x7475('0x37')]({'where':{'id':_0x4897ab[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](function(_0x17f461){return db['sequelize']['transaction'](function(_0x1043e4){return _0x17f461['addTeams'](_0x2651e4,{'transaction':_0x1043e4})['then'](function(){return BPromise[_0x7475('0x79')](_0x3973d2,function(_0x52585d){return db['TeamVoiceQueue']['upsert']({'TeamId':_0x52585d['id'],'VoiceQueueId':_0x4897ab[_0x7475('0x5e')]['id'],'penalty':_0x52585d['penalty']},{'transaction':_0x1043e4});});})[_0x7475('0x2d')](function(){return BPromise[_0x7475('0x79')](_0x51695c,function(_0x331ba5){return db[_0x7475('0x7a')]['findOrCreate']({'where':{'UserId':_0x331ba5['id'],'VoiceQueueId':_0x4897ab[_0x7475('0x5e')]['id']},'defaults':{'penalty':_0x331ba5[_0x7475('0x78')]},'transaction':_0x1043e4});});})[_0x7475('0x2d')](function(){return BPromise[_0x7475('0x79')](_[_0x7475('0x32')](_0x51695c,{'online':!![]}),function(_0x14696c){return db[_0x7475('0x7b')]['upsert']({'membername':_0x14696c[_0x7475('0x39')],'UserId':_0x14696c['id'],'queue_name':_0x17f461['name'],'VoiceQueueId':_0x17f461['id'],'interface':_[_0x7475('0x7c')](_0x14696c['interface'])?util[_0x7475('0x7d')](_0x7475('0x7e'),_0x14696c[_0x7475('0x39')]):_0x14696c['interface'],'paused':_0x14696c['voicePause']||![],'penalty':_0x14696c[_0x7475('0x78')]},{'transaction':_0x1043e4});});})[_0x7475('0x2d')](function(){_0x51695c['forEach'](function(_0x287aae){socket['emit'](_0x7475('0x7f'),{'UserId':_0x287aae['id'],'VoiceQueueId':_0x17f461['id']});});});});});}})[_0x7475('0x2d')](respondWithStatusCode(_0x356fe8,null))[_0x7475('0x52')](handleError(_0x356fe8,null));};exports[_0x7475('0x80')]=function(_0x17e67,_0x2feba6,_0x49143b){return db[_0x7475('0x70')][_0x7475('0x50')]({'where':{'id':_0x17e67['query'][_0x7475('0x81')]},'attributes':['id'],'include':[{'model':db[_0x7475('0x73')],'as':_0x7475('0x76'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2feba6,null))[_0x7475('0x2d')](function(_0x4b8001){var _0x5b164b=_[_0x7475('0x34')](_0x4b8001,'id');var _0x446e71=[];var _0x192fdb=[];var _0x186d31=squel['select']();_0x186d31[_0x7475('0x82')]('tq.TeamId')[_0x7475('0x83')](_0x7475('0x84'),'tq')[_0x7475('0x85')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x7475('0x4b')]('VoiceQueueId\x20=\x20?',_0x17e67['params']['id']);for(var _0x3aa4db=0x0;_0x3aa4db<_0x4b8001[_0x7475('0x6f')];_0x3aa4db+=0x1){let _0x554974=_0x4b8001[_0x3aa4db];for(var _0x156d4b=0x0;_0x156d4b<_0x554974['Agents'][_0x7475('0x6f')];_0x156d4b+=0x1){let _0x1deb69=_0x554974['Agents'][_0x156d4b];var _0x19e13a=_0x186d31[_0x7475('0x5d')]();_0x19e13a[_0x7475('0x4b')](_0x7475('0x86'),_0x1deb69['id']);_0x192fdb[_0x7475('0x87')](db['sequelize'][_0x7475('0x42')](_0x19e13a[_0x7475('0x88')](),{'type':db['sequelize'][_0x7475('0x89')][_0x7475('0x8a')]})['then'](function(_0x3cd60e){if(_0x3cd60e[_0x7475('0x6f')]===0x1){return _0x1deb69['id'];}else{var _0x3e0967=_['every'](_[_0x7475('0x34')](_0x3cd60e,_0x7475('0x8b')),function(_0x44bdc8){return _['includes'](_0x5b164b,_0x44bdc8);});if(_0x3e0967){return _0x1deb69['id'];}}}));}}return BPromise[_0x7475('0x8c')](_0x192fdb)['then'](function(_0x156220){_0x446e71=_(_0x446e71)['union'](_0x156220)['compact']()[_0x7475('0x35')]();return db[_0x7475('0x3e')]['find']({'where':{'id':_0x17e67[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](function(_0xcf2c45){return db[_0x7475('0x8d')]['transaction'](function(_0x2acc0a){return _0xcf2c45['removeTeams'](_0x17e67[_0x7475('0x42')][_0x7475('0x81')],{'transaction':_0x2acc0a})[_0x7475('0x2d')](function(){if(!_[_0x7475('0x8e')](_0x446e71)){return _0xcf2c45[_0x7475('0x8f')](_0x446e71,{'transaction':_0x2acc0a})['then'](function(){return db[_0x7475('0x7b')]['destroy']({'where':{'VoiceQueueId':_0x17e67['params']['id'],'UserId':_0x446e71},'transaction':_0x2acc0a});});}})[_0x7475('0x2d')](function(){_0x446e71[_0x7475('0x77')](function(_0x5cf75c){socket['emit'](_0x7475('0x90'),{'UserId':_0x5cf75c,'VoiceQueueId':_0xcf2c45['id']});});});});});});})['then'](respondWithStatusCode(_0x2feba6,null))['catch'](handleError(_0x2feba6,null));};exports[_0x7475('0x91')]=function(_0x1f297f,_0x58b3d6,_0x1592e4){var _0x1573b1,_0x58fa0b;return db[_0x7475('0x3e')][_0x7475('0x37')]({'where':{'id':_0x1f297f['params']['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x58b3d6,null))[_0x7475('0x2d')](function(_0x24740e){if(_0x24740e){_0x58fa0b=_0x24740e;return _0x24740e[_0x7475('0x91')](_0x1f297f[_0x7475('0x61')][_0x7475('0x81')],_[_0x7475('0x62')](_0x1f297f['body'],['ids','id'])||{})[_0x7475('0x92')](function(_0x2f3a6f){for(var _0x4eb59d=0x0;_0x4eb59d<_0x1f297f[_0x7475('0x61')][_0x7475('0x81')][_0x7475('0x6f')];_0x4eb59d+=0x1){socket[_0x7475('0x93')]('userVoiceQueue:save',{'UserId':Number(_0x1f297f['body'][_0x7475('0x81')][_0x4eb59d]),'VoiceQueueId':Number(_0x1f297f[_0x7475('0x5e')]['id'])});}return _0x2f3a6f;});}})[_0x7475('0x2d')](function(_0x5ea563){_0x1573b1=_0x5ea563||[];if(_0x58fa0b){return db['User'][_0x7475('0x50')]({'where':{'id':_0x1f297f[_0x7475('0x61')]['ids']},'attributes':['id',_0x7475('0x39'),_0x7475('0x94'),'voicePause',_0x7475('0x95')],'raw':!![]});}})['then'](function(_0x2b57f7){if(!_[_0x7475('0x8e')](_0x2b57f7)){var _0x1dd666=[];for(var _0x4c10ba=0x0;_0x4c10ba<_0x2b57f7['length'];_0x4c10ba++){if(_0x2b57f7[_0x4c10ba][_0x7475('0x94')]){_0x1dd666['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x2b57f7[_0x4c10ba][_0x7475('0x39')],'UserId':_0x2b57f7[_0x4c10ba]['id'],'queue_name':_0x58fa0b[_0x7475('0x39')],'VoiceQueueId':_0x58fa0b['id'],'interface':_[_0x7475('0x7c')](_0x2b57f7[_0x4c10ba]['interface'])?util[_0x7475('0x7d')](_0x7475('0x7e'),_0x2b57f7[_0x4c10ba]['name']):_0x2b57f7[_0x4c10ba][_0x7475('0x95')],'paused':_0x2b57f7[_0x4c10ba][_0x7475('0x74')]||![],'penalty':_0x1f297f[_0x7475('0x61')][_0x7475('0x78')]||0x0}));}}return BPromise[_0x7475('0x8c')](_0x1dd666);}})[_0x7475('0x2d')](function(){return _0x1573b1;})[_0x7475('0x2d')](respondWithResult(_0x58b3d6,null))[_0x7475('0x52')](handleError(_0x58b3d6,null));};exports[_0x7475('0x8f')]=function(_0x4fb6e0,_0x58c1ed,_0x495176){return db[_0x7475('0x3e')]['find']({'where':{'id':_0x4fb6e0[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x58c1ed,null))[_0x7475('0x2d')](function(_0x2e8f50){if(_0x2e8f50){return _0x2e8f50[_0x7475('0x8f')](_0x4fb6e0[_0x7475('0x42')][_0x7475('0x81')])[_0x7475('0x2d')](function(){if(_[_0x7475('0x96')](_0x4fb6e0[_0x7475('0x42')][_0x7475('0x81')])){for(var _0xacc1e3=0x0;_0xacc1e3<_0x4fb6e0[_0x7475('0x42')][_0x7475('0x81')][_0x7475('0x6f')];_0xacc1e3+=0x1){socket['emit'](_0x7475('0x90'),{'UserId':Number(_0x4fb6e0[_0x7475('0x42')]['ids'][_0xacc1e3]),'VoiceQueueId':Number(_0x4fb6e0[_0x7475('0x5e')]['id'])});}}else{socket[_0x7475('0x93')](_0x7475('0x90'),{'UserId':Number(_0x4fb6e0[_0x7475('0x42')][_0x7475('0x81')]),'VoiceQueueId':Number(_0x4fb6e0[_0x7475('0x5e')]['id'])});}});}})['then'](function(_0x11f19f){return db['UserVoiceQueueRt'][_0x7475('0x2e')]({'where':{'VoiceQueueId':_0x4fb6e0['params']['id'],'UserId':_0x4fb6e0['query'][_0x7475('0x81')]}})[_0x7475('0x2d')](function(){return _0x11f19f;});})[_0x7475('0x2d')](respondWithStatusCode(_0x58c1ed,null))['catch'](handleError(_0x58c1ed,null));};exports['getAgents']=function(_0x2e97d4,_0x3315ae,_0x241e77){var _0x3f1599={};var _0x40c912={};var _0x16bc13;var _0x4e2428;return db[_0x7475('0x3e')][_0x7475('0x66')]({'where':{'id':_0x2e97d4['params']['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x3315ae,null))[_0x7475('0x2d')](function(_0x2a6321){if(_0x2a6321){_0x16bc13=_0x2a6321;_0x40c912[_0x7475('0x41')]=_[_0x7475('0x43')](db['User'][_0x7475('0x68')]);_0x40c912['query']=_['keys'](_0x2e97d4[_0x7475('0x42')]);_0x40c912[_0x7475('0x44')]=_['intersection'](_0x40c912[_0x7475('0x41')],_0x40c912[_0x7475('0x42')]);_0x3f1599['attributes']=_[_0x7475('0x45')](_0x40c912['model'],qs[_0x7475('0x54')](_0x2e97d4[_0x7475('0x42')]['fields']));_0x3f1599[_0x7475('0x46')]=_0x3f1599[_0x7475('0x46')]['length']?_0x3f1599[_0x7475('0x46')]:_0x40c912['model'];_0x3f1599[_0x7475('0x49')]=qs[_0x7475('0x4a')](_0x2e97d4[_0x7475('0x42')][_0x7475('0x4a')]);_0x3f1599['where']=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x2e97d4[_0x7475('0x42')],_0x40c912[_0x7475('0x44')]));if(_0x2e97d4['query'][_0x7475('0x32')]){_0x3f1599['where']=_[_0x7475('0x4c')](_0x3f1599[_0x7475('0x4b')],{'$or':_[_0x7475('0x34')](_0x3f1599[_0x7475('0x46')],function(_0x191ff0){var _0x21d17f={};_0x21d17f[_0x191ff0]={'$like':'%'+_0x2e97d4['query'][_0x7475('0x32')]+'%'};return _0x21d17f;})});}_0x3f1599=_[_0x7475('0x4c')]({},_0x3f1599,_0x2e97d4[_0x7475('0x4e')]);return _0x16bc13[_0x7475('0x97')](_0x3f1599);}})['then'](function(_0x56d9b3){if(_0x56d9b3){_0x4e2428=_0x56d9b3['length'];if(!_0x2e97d4[_0x7475('0x42')][_0x7475('0x47')](_0x7475('0x48'))){_0x3f1599[_0x7475('0x24')]=qs[_0x7475('0x24')](_0x2e97d4[_0x7475('0x42')]['limit']);_0x3f1599[_0x7475('0x25')]=qs[_0x7475('0x25')](_0x2e97d4['query'][_0x7475('0x25')]);}return _0x16bc13[_0x7475('0x97')](_0x3f1599);}})[_0x7475('0x2d')](function(_0xf00160){if(_0xf00160){return _0xf00160?{'count':_0x4e2428,'rows':_0xf00160}:null;}})[_0x7475('0x2d')](respondWithResult(_0x3315ae,null))[_0x7475('0x52')](handleError(_0x3315ae,null));};exports[_0x7475('0x98')]=function(_0x1e8373,_0x4c1820,_0x4e7dc6){var _0x402969={};var _0x3066f9={};var _0x4b346d;var _0x3416ad;return db[_0x7475('0x3e')][_0x7475('0x66')]({'where':{'id':_0x1e8373['params']['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x4c1820,null))[_0x7475('0x2d')](function(_0x446c0b){if(_0x446c0b){_0x4b346d=_0x446c0b;_0x3066f9[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x7b')][_0x7475('0x68')]);_0x3066f9[_0x7475('0x42')]=_[_0x7475('0x43')](_0x1e8373[_0x7475('0x42')]);_0x3066f9['filters']=_[_0x7475('0x45')](_0x3066f9[_0x7475('0x41')],_0x3066f9['query']);_0x402969[_0x7475('0x46')]=_[_0x7475('0x45')](_0x3066f9[_0x7475('0x41')],qs[_0x7475('0x54')](_0x1e8373[_0x7475('0x42')][_0x7475('0x54')]));_0x402969[_0x7475('0x46')]=_0x402969[_0x7475('0x46')]['length']?_0x402969[_0x7475('0x46')]:_0x3066f9[_0x7475('0x41')];_0x402969[_0x7475('0x49')]=qs['sort'](_0x1e8373['query'][_0x7475('0x4a')]);_0x402969[_0x7475('0x4b')]=qs['filters'](_[_0x7475('0x69')](_0x1e8373[_0x7475('0x42')],_0x3066f9[_0x7475('0x44')]));if(_0x1e8373[_0x7475('0x42')][_0x7475('0x32')]){_0x402969[_0x7475('0x4b')]=_[_0x7475('0x4c')](_0x402969[_0x7475('0x4b')],{'$or':_[_0x7475('0x34')](_0x402969['attributes'],function(_0x25dc71){var _0x12b484={};_0x12b484[_0x25dc71]={'$like':'%'+_0x1e8373[_0x7475('0x42')][_0x7475('0x32')]+'%'};return _0x12b484;})});}_0x402969=_['merge']({},_0x402969,_0x1e8373[_0x7475('0x4e')]);return _0x4b346d[_0x7475('0x98')](_0x402969);}})['then'](function(_0x12e5ef){if(_0x12e5ef){_0x3416ad=_0x12e5ef[_0x7475('0x6f')];if(!_0x1e8373[_0x7475('0x42')]['hasOwnProperty']('nolimit')){_0x402969[_0x7475('0x24')]=qs['limit'](_0x1e8373[_0x7475('0x42')]['limit']);_0x402969[_0x7475('0x25')]=qs['offset'](_0x1e8373[_0x7475('0x42')][_0x7475('0x25')]);}return _0x4b346d['getMembers'](_0x402969);}})[_0x7475('0x2d')](function(_0xa19a08){return _0xa19a08?{'count':_0x3416ad,'rows':_0xa19a08}:null;})[_0x7475('0x2d')](respondWithResult(_0x4c1820,null))[_0x7475('0x52')](handleError(_0x4c1820,null));};exports[_0x7475('0x99')]=function(_0x39fae9,_0x2cb0fa,_0x16336b){var _0x4c1fa6={};var _0x8cf006={};var _0x22d479;var _0x2acd7c;return db[_0x7475('0x3e')]['findOne']({'where':{'id':_0x39fae9[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x2cb0fa,null))[_0x7475('0x2d')](function(_0x384cd1){if(_0x384cd1){_0x22d479=_0x384cd1;_0x8cf006[_0x7475('0x41')]=_[_0x7475('0x43')](db[_0x7475('0x9a')][_0x7475('0x68')]);_0x8cf006[_0x7475('0x42')]=_[_0x7475('0x43')](_0x39fae9[_0x7475('0x42')]);_0x8cf006[_0x7475('0x44')]=_[_0x7475('0x45')](_0x8cf006[_0x7475('0x41')],_0x8cf006['query']);_0x4c1fa6[_0x7475('0x46')]=_[_0x7475('0x45')](_0x8cf006[_0x7475('0x41')],qs[_0x7475('0x54')](_0x39fae9['query'][_0x7475('0x54')]));_0x4c1fa6[_0x7475('0x46')]=_0x4c1fa6[_0x7475('0x46')][_0x7475('0x6f')]?_0x4c1fa6[_0x7475('0x46')]:_0x8cf006[_0x7475('0x41')];_0x4c1fa6[_0x7475('0x49')]=qs[_0x7475('0x4a')](_0x39fae9['query'][_0x7475('0x4a')]);_0x4c1fa6[_0x7475('0x4b')]=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x39fae9[_0x7475('0x42')],_0x8cf006['filters']));if(_0x39fae9[_0x7475('0x42')][_0x7475('0x32')]){_0x4c1fa6[_0x7475('0x4b')]=_[_0x7475('0x4c')](_0x4c1fa6[_0x7475('0x4b')],{'$or':_['map'](_0x4c1fa6[_0x7475('0x46')],function(_0x5c2d77){var _0x1c919f={};_0x1c919f[_0x5c2d77]={'$like':'%'+_0x39fae9['query']['filter']+'%'};return _0x1c919f;})});}_0x4c1fa6=_[_0x7475('0x4c')]({},_0x4c1fa6,_0x39fae9['options']);return _0x22d479[_0x7475('0x99')](_0x4c1fa6);}})['then'](function(_0xcd1d31){if(_0xcd1d31){_0x2acd7c=_0xcd1d31[_0x7475('0x6f')];if(!_0x39fae9['query'][_0x7475('0x47')]('nolimit')){_0x4c1fa6['limit']=qs[_0x7475('0x24')](_0x39fae9[_0x7475('0x42')][_0x7475('0x24')]);_0x4c1fa6[_0x7475('0x25')]=qs[_0x7475('0x25')](_0x39fae9['query'][_0x7475('0x25')]);}return _0x22d479['getLists'](_0x4c1fa6);}})[_0x7475('0x2d')](function(_0x3d003c){if(_0x3d003c){return _0x3d003c?{'count':_0x2acd7c,'rows':_0x3d003c}:null;}})['then'](respondWithResult(_0x2cb0fa,null))[_0x7475('0x52')](handleError(_0x2cb0fa,null));};exports[_0x7475('0x9b')]=function(_0x345fda,_0x877652,_0x5d5e0e){var _0x391325,_0x3a3a83;return db['VoiceQueue'][_0x7475('0x37')]({'where':{'id':_0x345fda[_0x7475('0x5e')]['id']}})['then'](handleEntityNotFound(_0x877652,null))[_0x7475('0x2d')](function(_0x53e086){if(_0x53e086){_0x3a3a83=_0x53e086;return _0x53e086['addLists'](_0x345fda[_0x7475('0x61')][_0x7475('0x81')],_[_0x7475('0x62')](_0x345fda['body'],[_0x7475('0x81'),'id'])||{});}return null;})[_0x7475('0x92')](function(_0x291719){var _0x17226b;_0x391325=_0x291719||[];var _0x261cb8=[];if(_0x291719){for(var _0x3b767c=0x0;_0x3b767c<_0x291719[_0x7475('0x6f')];_0x3b767c+=0x1){var _0x270901=_0x291719[_0x3b767c]['get']({'plain':!![]});_0x3a3a83['dialCheckDuplicateType']=_0x345fda[_0x7475('0x61')][_0x7475('0x9c')]?_0x345fda[_0x7475('0x61')][_0x7475('0x9c')]:_0x3a3a83[_0x7475('0x9c')];switch(_0x3a3a83[_0x7475('0x9c')]){case'always':_0x17226b=squel[_0x7475('0x9d')]()[_0x7475('0x9e')](_0x7475('0x9f'))['fromQuery'](['phone',_0x7475('0xa0'),'ContactId',_0x7475('0xa1'),'VoiceQueueId',_0x7475('0x5f'),'updatedAt'],squel['select']()[_0x7475('0x82')](_0x7475('0xa2'),_0x7475('0xa2'))['field'](_0x7475('0xa3'),_0x7475('0xa0'))[_0x7475('0x82')]('id',_0x7475('0xa4'))[_0x7475('0x82')](_0x270901[_0x7475('0xa5')][_0x7475('0x88')](),_0x7475('0xa1'))['field'](_0x345fda[_0x7475('0x5e')]['id'][_0x7475('0x88')](),_0x7475('0x6a'))[_0x7475('0x82')]('NOW()',_0x7475('0x5f'))['field']('NOW()',_0x7475('0x60'))[_0x7475('0x83')](_0x7475('0xa6'))[_0x7475('0x4b')](_0x7475('0xa7'))[_0x7475('0x4b')]('ListId\x20=\x20?',_0x270901[_0x7475('0xa5')]['toString']())['where'](_0x7475('0xa8'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x7475('0x82')](_0x7475('0xa9'))[_0x7475('0x83')](_0x7475('0xaa'))[_0x7475('0x4b')](_0x7475('0xab'),_0x345fda[_0x7475('0x5e')]['id'][_0x7475('0x88')]()))[_0x7475('0x4b')](_0x7475('0xac'),squel['select']()[_0x7475('0x82')](_0x7475('0xad'))[_0x7475('0x83')](_0x7475('0x9f'))[_0x7475('0x4b')]('VoiceQueueId\x20=\x20?',_0x345fda['params']['id'][_0x7475('0x88')]())))[_0x7475('0x88')]();break;case _0x7475('0xae'):_0x17226b=squel[_0x7475('0x9d')]()[_0x7475('0x9e')](_0x7475('0x9f'))[_0x7475('0xaf')]([_0x7475('0xa2'),_0x7475('0xa0'),'ContactId',_0x7475('0xa1'),_0x7475('0x6a'),'createdAt','updatedAt'],squel[_0x7475('0xb0')]()[_0x7475('0x82')](_0x7475('0xa2'),'phone')[_0x7475('0x82')]('NOW()',_0x7475('0xa0'))['field']('id',_0x7475('0xa4'))['field'](_0x270901[_0x7475('0xa5')][_0x7475('0x88')](),_0x7475('0xa1'))[_0x7475('0x82')](_0x345fda['params']['id'][_0x7475('0x88')](),_0x7475('0x6a'))[_0x7475('0x82')]('NOW()',_0x7475('0x5f'))['field'](_0x7475('0xa3'),_0x7475('0x60'))['from'](_0x7475('0xa6'))[_0x7475('0x4b')]('deletedAt\x20IS\x20NULL')[_0x7475('0x4b')](_0x7475('0xb1'),_0x270901[_0x7475('0xa5')][_0x7475('0x88')]())[_0x7475('0x4b')](_0x7475('0xa8'))[_0x7475('0x4b')](_0x7475('0xac'),squel[_0x7475('0xb0')]()[_0x7475('0x82')](_0x7475('0xad'))['from'](_0x7475('0x9f'))['where'](_0x7475('0xab'),_0x345fda[_0x7475('0x5e')]['id']['toString']())))[_0x7475('0x88')]();break;default:_0x17226b=squel[_0x7475('0x9d')]()[_0x7475('0x9e')]('cm_hopper')[_0x7475('0xaf')](['phone',_0x7475('0xa0'),_0x7475('0xa4'),'ListId','VoiceQueueId',_0x7475('0x5f'),'updatedAt'],squel[_0x7475('0xb0')]()[_0x7475('0x82')](_0x7475('0xa2'),_0x7475('0xa2'))[_0x7475('0x82')]('NOW()',_0x7475('0xa0'))[_0x7475('0x82')]('id',_0x7475('0xa4'))[_0x7475('0x82')](_0x270901[_0x7475('0xa5')][_0x7475('0x88')](),_0x7475('0xa1'))['field'](_0x345fda[_0x7475('0x5e')]['id'][_0x7475('0x88')](),_0x7475('0x6a'))['field'](_0x7475('0xa3'),_0x7475('0x5f'))[_0x7475('0x82')](_0x7475('0xa3'),_0x7475('0x60'))[_0x7475('0x83')](_0x7475('0xa6'))[_0x7475('0x4b')](_0x7475('0xa7'))['where'](_0x7475('0xb1'),_0x270901[_0x7475('0xa5')]['toString']())[_0x7475('0x4b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x261cb8['push'](db[_0x7475('0x8d')][_0x7475('0x42')](_0x17226b));}return BPromise[_0x7475('0x8c')](_0x261cb8);}})[_0x7475('0x2d')](function(){return _0x391325;})['then'](respondWithResult(_0x877652,null))[_0x7475('0x52')](handleError(_0x877652,null));};exports['removeLists']=function(_0x4c84f9,_0x2d9dd6,_0x4ea087){return db[_0x7475('0x3e')][_0x7475('0x37')]({'where':{'id':_0x4c84f9[_0x7475('0x5e')]['id']}})['then'](handleEntityNotFound(_0x2d9dd6,null))[_0x7475('0x2d')](function(_0x4e76c2){if(_0x4e76c2){return _0x4e76c2[_0x7475('0xb2')](_0x4c84f9[_0x7475('0x42')][_0x7475('0x81')]);}})[_0x7475('0x2d')](function(_0x22b853){if(_0x22b853){return db['CmHopper'][_0x7475('0x2e')]({'where':{'ListId':_0x4c84f9[_0x7475('0x42')]['ids'],'VoiceQueueId':_0x4c84f9[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](function(){return _0x22b853;});}})[_0x7475('0x2d')](respondWithStatusCode(_0x2d9dd6,null))[_0x7475('0x52')](handleError(_0x2d9dd6,null));};exports[_0x7475('0xb3')]=function(_0x369f9f,_0x5354a4,_0x177cc8){var _0x144acc={};var _0x5213d4={};var _0x3408c0;var _0x17db9e;return db[_0x7475('0x3e')][_0x7475('0x66')]({'where':{'id':_0x369f9f[_0x7475('0x5e')]['id']}})['then'](handleEntityNotFound(_0x5354a4,null))[_0x7475('0x2d')](function(_0x27a701){if(_0x27a701){_0x3408c0=_0x27a701;_0x5213d4['model']=_[_0x7475('0x43')](db[_0x7475('0x9a')][_0x7475('0x68')]);_0x5213d4[_0x7475('0x42')]=_[_0x7475('0x43')](_0x369f9f[_0x7475('0x42')]);_0x5213d4['filters']=_[_0x7475('0x45')](_0x5213d4['model'],_0x5213d4['query']);_0x144acc[_0x7475('0x46')]=_['intersection'](_0x5213d4[_0x7475('0x41')],qs[_0x7475('0x54')](_0x369f9f[_0x7475('0x42')][_0x7475('0x54')]));_0x144acc['attributes']=_0x144acc[_0x7475('0x46')][_0x7475('0x6f')]?_0x144acc[_0x7475('0x46')]:_0x5213d4['model'];_0x144acc[_0x7475('0x49')]=qs['sort'](_0x369f9f[_0x7475('0x42')]['sort']);_0x144acc[_0x7475('0x4b')]=qs[_0x7475('0x44')](_[_0x7475('0x69')](_0x369f9f[_0x7475('0x42')],_0x5213d4[_0x7475('0x44')]));if(_0x369f9f[_0x7475('0x42')][_0x7475('0x32')]){_0x144acc[_0x7475('0x4b')]=_[_0x7475('0x4c')](_0x144acc['where'],{'$or':_[_0x7475('0x34')](_0x144acc['attributes'],function(_0x3ece0b){var _0x42e6c8={};_0x42e6c8[_0x3ece0b]={'$like':'%'+_0x369f9f[_0x7475('0x42')][_0x7475('0x32')]+'%'};return _0x42e6c8;})});}_0x144acc=_['merge']({},_0x144acc,_0x369f9f[_0x7475('0x4e')]);return _0x3408c0[_0x7475('0xb3')](_0x144acc);}})[_0x7475('0x2d')](function(_0x24d499){if(_0x24d499){_0x17db9e=_0x24d499['length'];if(!_0x369f9f['query'][_0x7475('0x47')](_0x7475('0x48'))){_0x144acc[_0x7475('0x24')]=qs['limit'](_0x369f9f[_0x7475('0x42')][_0x7475('0x24')]);_0x144acc[_0x7475('0x25')]=qs['offset'](_0x369f9f[_0x7475('0x42')][_0x7475('0x25')]);}return _0x3408c0['getBlackLists'](_0x144acc);}})[_0x7475('0x2d')](function(_0x3ea69c){if(_0x3ea69c){return _0x3ea69c?{'count':_0x17db9e,'rows':_0x3ea69c}:null;}})[_0x7475('0x2d')](respondWithResult(_0x5354a4,null))['catch'](handleError(_0x5354a4,null));};exports['addBlackLists']=function(_0x480931,_0x5e131d,_0x18fcd1){var _0xb506fc,_0x5aba46;return db[_0x7475('0x3e')]['find']({'where':{'id':_0x480931[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x5e131d,null))[_0x7475('0x2d')](function(_0x12512e){if(_0x12512e){_0x5aba46=_0x12512e;return _0x12512e['addBlackLists'](_0x480931[_0x7475('0x61')][_0x7475('0x81')],_[_0x7475('0x62')](_0x480931['body'],[_0x7475('0x81'),'id'])||{});}return null;})[_0x7475('0x92')](function(_0x15e19e){var _0xfc9d9c;_0xb506fc=_0x15e19e||[];var _0x3df6a=[];if(_0x15e19e){for(var _0x28cffe=0x0;_0x28cffe<_0x15e19e[_0x7475('0x6f')];_0x28cffe+=0x1){var _0x5ecd0e=_0x15e19e[_0x28cffe][_0x7475('0x2f')]({'plain':!![]});_0xfc9d9c=squel['insert']()[_0x7475('0x9e')](_0x7475('0xb4'))[_0x7475('0xaf')](['phone',_0x7475('0xa4'),_0x7475('0xa1'),_0x7475('0x6a'),_0x7475('0x5f'),_0x7475('0x60')],squel[_0x7475('0xb0')]()['field'](_0x7475('0xa2'),'phone')[_0x7475('0x82')]('id',_0x7475('0xa4'))[_0x7475('0x82')](_0x5ecd0e[_0x7475('0xa5')]['toString'](),_0x7475('0xa1'))[_0x7475('0x82')](_0x480931[_0x7475('0x5e')]['id'][_0x7475('0x88')](),_0x7475('0x6a'))[_0x7475('0x82')](_0x7475('0xa3'),_0x7475('0x5f'))[_0x7475('0x82')]('NOW()',_0x7475('0x60'))['from'](_0x7475('0xa6'))[_0x7475('0x4b')](_0x7475('0xa7'))['where'](_0x7475('0xb1'),_0x5ecd0e[_0x7475('0xa5')][_0x7475('0x88')]())[_0x7475('0x4b')](_0x7475('0xa8')))[_0x7475('0x88')]();_0x3df6a[_0x7475('0x87')](db[_0x7475('0x8d')]['query'](_0xfc9d9c));}return BPromise[_0x7475('0x8c')](_0x3df6a);}})[_0x7475('0x2d')](function(){return _0xb506fc;})[_0x7475('0x2d')](respondWithResult(_0x5e131d,null))['catch'](handleError(_0x5e131d,null));};exports[_0x7475('0xb5')]=function(_0x5b6276,_0x3c63c5,_0x14544a){return db[_0x7475('0x3e')][_0x7475('0x37')]({'where':{'id':_0x5b6276[_0x7475('0x5e')]['id']}})[_0x7475('0x2d')](handleEntityNotFound(_0x3c63c5,null))[_0x7475('0x2d')](function(_0x4e7fbb){if(_0x4e7fbb){return _0x4e7fbb[_0x7475('0xb5')](_0x5b6276[_0x7475('0x42')][_0x7475('0x81')]);}})[_0x7475('0x2d')](function(_0x5599df){if(_0x5599df){return db[_0x7475('0x6e')]['destroy']({'where':{'ListId':_0x5b6276[_0x7475('0x42')][_0x7475('0x81')],'VoiceQueueId':_0x5b6276[_0x7475('0x5e')]['id']}})['then'](function(){return _0x5599df;});}})[_0x7475('0x2d')](respondWithStatusCode(_0x3c63c5,null))[_0x7475('0x52')](handleError(_0x3c63c5,null));};
\ No newline at end of file