Built motion from commit (unavailable).|2.5.3
[motion2.git] / server / api / chatQueue / chatQueue.controller.js
index 574dbe4..8d6dc73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff11=['params','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','nolimit','ChatQueueId','UserChatQueue','User','findAndCountAll','UserId','agent','chatPause','updatedAt','format','%s/%s','SIP','createdAt','addTeams','ids','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','Team','tq.TeamId','from','team_has_chat_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','redis','./chatQueue.socket','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','stack','name','index','ChatQueue','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows'];(function(_0x15cd65,_0x541c02){var _0x2edb84=function(_0x1334d6){while(--_0x1334d6){_0x15cd65['push'](_0x15cd65['shift']());}};_0x2edb84(++_0x541c02);}(_0xff11,0xd8));var _0x1ff1=function(_0x52fc85,_0x963a91){_0x52fc85=_0x52fc85-0x0;var _0x18c3d9=_0xff11[_0x52fc85];return _0x18c3d9;};'use strict';var pdf=require(_0x1ff1('0x0'));var emlformat=require(_0x1ff1('0x1'));var rimraf=require(_0x1ff1('0x2'));var zipdir=require(_0x1ff1('0x3'));var jsonpatch=require(_0x1ff1('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1ff1('0x5'));var sox=require(_0x1ff1('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ff1('0x7'));var squel=require(_0x1ff1('0x8'));var crypto=require(_0x1ff1('0x9'));var jsforce=require(_0x1ff1('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1ff1('0xb'));var querystring=require(_0x1ff1('0xc'));var Papa=require('papaparse');var Redis=require(_0x1ff1('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x1ff1('0xe'));var as=require(_0x1ff1('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1ff1('0x10'))(_0x1ff1('0x11'));var utils=require(_0x1ff1('0x12'));var config=require('../../config/environment');var db=require(_0x1ff1('0x13'))['db'];config['redis']=_[_0x1ff1('0x14')](config['redis'],{'host':_0x1ff1('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ff1('0x16')]));require(_0x1ff1('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x1ff1('0x18')]({'port':0x232a});function checkPasswordPattern(_0x15a866,_0x35e04f,_0x27d354){if(_0x27d354){var _0x4fcc63=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4fcc63[_0x1ff1('0x19')](_0x35e04f)){return _0x15a866;}else{throw new db['Sequelize'][(_0x1ff1('0x1a'))](_0x1ff1('0x1b'));}}else{return _0x15a866;}}function respondWithRpcPromise(_0xfebb9d,_0x1e0c2d,_0x223bd7,_0x4cf5c1){return new BPromise(function(_0x50cffb,_0x4e895f){var _0x2d5243=_0x4cf5c1||client;return _0x2d5243[_0x1ff1('0x1c')](_0xfebb9d,_0x223bd7)[_0x1ff1('0x1d')](function(_0x10422d){logger[_0x1ff1('0x1e')](_0x1ff1('0x1f'),_0x1e0c2d,'request\x20sent');logger[_0x1ff1('0x20')](_0x1ff1('0x21'),_0x1e0c2d,_0x1ff1('0x22'),JSON[_0x1ff1('0x23')](_0x10422d));if(_0x10422d[_0x1ff1('0x24')]){if(_0x10422d[_0x1ff1('0x24')][_0x1ff1('0x25')]===0x1f4){logger[_0x1ff1('0x24')](_0x1ff1('0x1f'),_0x1e0c2d,_0x10422d[_0x1ff1('0x24')][_0x1ff1('0x26')]);return _0x4e895f(_0x10422d['error'][_0x1ff1('0x26')]);}logger[_0x1ff1('0x24')](_0x1ff1('0x1f'),_0x1e0c2d,_0x10422d[_0x1ff1('0x24')][_0x1ff1('0x26')]);return _0x50cffb(_0x10422d[_0x1ff1('0x24')]['message']);}else{logger[_0x1ff1('0x1e')](_0x1ff1('0x1f'),_0x1e0c2d,_0x1ff1('0x22'));_0x50cffb(_0x10422d[_0x1ff1('0x27')][_0x1ff1('0x26')]);}})[_0x1ff1('0x28')](function(_0x15fc5e){logger[_0x1ff1('0x24')](_0x1ff1('0x1f'),_0x1e0c2d,_0x15fc5e);_0x4e895f(_0x15fc5e);});});}function respondWithStatusCode(_0x1733d3,_0x550f02){_0x550f02=_0x550f02||0xcc;return function(_0x4af290){if(_0x4af290){return _0x1733d3[_0x1ff1('0x29')](_0x550f02);}return _0x1733d3[_0x1ff1('0x2a')](_0x550f02)[_0x1ff1('0x2b')]();};}function respondWithResult(_0x2c6580,_0x493709){_0x493709=_0x493709||0xc8;return function(_0xb481e5){if(_0xb481e5){return _0x2c6580[_0x1ff1('0x2a')](_0x493709)[_0x1ff1('0x2c')](_0xb481e5);}};}function respondWithFilteredResult(_0xc9b39b,_0x29b784){return function(_0x185bc3){if(_0x185bc3){var _0x39cb0c=_0x185bc3[_0x1ff1('0x2d')],_0x5c1c25=_0x29b784[_0x1ff1('0x2e')],_0x37956a=_0x29b784[_0x1ff1('0x2e')]+_0x29b784[_0x1ff1('0x2f')],_0xaabec9;if(_0x37956a>=_0x39cb0c){_0x37956a=_0x39cb0c;_0xaabec9=0xc8;}else{_0xaabec9=0xce;}_0xc9b39b[_0x1ff1('0x2a')](_0xaabec9);return _0xc9b39b[_0x1ff1('0x30')](_0x1ff1('0x31'),_0x5c1c25+'-'+_0x37956a+'/'+_0x39cb0c)['json'](_0x185bc3);}return null;};}function patchUpdates(_0x50fc53){return function(_0x590872){try{jsonpatch[_0x1ff1('0x32')](_0x590872,_0x50fc53,!![]);}catch(_0x278bd6){return BPromise[_0x1ff1('0x33')](_0x278bd6);}return _0x590872[_0x1ff1('0x34')]();};}function saveUpdates(_0x57df8e,_0x3d83b5){return function(_0xf92dab){if(_0xf92dab){return _0xf92dab[_0x1ff1('0x35')](_0x57df8e)[_0x1ff1('0x1d')](function(_0x5b6648){return _0x5b6648;});}return null;};}function removeEntity(_0x2915de,_0x32c294){return function(_0x2d4a98){if(_0x2d4a98){return _0x2d4a98[_0x1ff1('0x36')]()[_0x1ff1('0x1d')](function(){var _0x285b79=_0x2d4a98['get']({'plain':!![]});var _0x3e170f=_0x1ff1('0x37');return db[_0x1ff1('0x38')][_0x1ff1('0x36')]({'where':{'type':_0x3e170f,'resourceId':_0x285b79['id']}})['then'](function(){return _0x2d4a98;});})['then'](function(){_0x2915de[_0x1ff1('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e8631,_0x5b13ae){return function(_0x3440a1){if(!_0x3440a1){_0x2e8631[_0x1ff1('0x29')](0x194);}return _0x3440a1;};}function handleError(_0x253940,_0x1b44fa){_0x1b44fa=_0x1b44fa||0x1f4;return function(_0x54b62c){logger[_0x1ff1('0x24')](_0x54b62c[_0x1ff1('0x39')]);if(_0x54b62c[_0x1ff1('0x3a')]){delete _0x54b62c['name'];}_0x253940[_0x1ff1('0x2a')](_0x1b44fa)['send'](_0x54b62c);};}exports[_0x1ff1('0x3b')]=function(_0x5adeff,_0x348225){var _0x3b4ab6={},_0x83cd8={},_0x3f9eb9={'count':0x0,'rows':[]};var _0xf3d391=_['map'](db[_0x1ff1('0x3c')][_0x1ff1('0x3d')],function(_0x5bf1fe){return{'name':_0x5bf1fe['fieldName'],'type':_0x5bf1fe['type']['key']};});_0x83cd8[_0x1ff1('0x3e')]=_[_0x1ff1('0x3f')](_0xf3d391,_0x1ff1('0x3a'));_0x83cd8[_0x1ff1('0x40')]=_[_0x1ff1('0x41')](_0x5adeff[_0x1ff1('0x40')]);_0x83cd8[_0x1ff1('0x42')]=_[_0x1ff1('0x43')](_0x83cd8[_0x1ff1('0x3e')],_0x83cd8[_0x1ff1('0x40')]);_0x3b4ab6[_0x1ff1('0x44')]=_[_0x1ff1('0x43')](_0x83cd8[_0x1ff1('0x3e')],qs[_0x1ff1('0x45')](_0x5adeff[_0x1ff1('0x40')]['fields']));_0x3b4ab6[_0x1ff1('0x44')]=_0x3b4ab6[_0x1ff1('0x44')][_0x1ff1('0x46')]?_0x3b4ab6[_0x1ff1('0x44')]:_0x83cd8[_0x1ff1('0x3e')];if(!_0x5adeff['query'][_0x1ff1('0x47')]('nolimit')){_0x3b4ab6[_0x1ff1('0x2f')]=qs[_0x1ff1('0x2f')](_0x5adeff[_0x1ff1('0x40')]['limit']);_0x3b4ab6[_0x1ff1('0x2e')]=qs['offset'](_0x5adeff['query'][_0x1ff1('0x2e')]);}_0x3b4ab6[_0x1ff1('0x48')]=qs[_0x1ff1('0x49')](_0x5adeff['query'][_0x1ff1('0x49')]);_0x3b4ab6[_0x1ff1('0x4a')]=qs[_0x1ff1('0x42')](_[_0x1ff1('0x4b')](_0x5adeff['query'],_0x83cd8[_0x1ff1('0x42')]),_0xf3d391);if(_0x5adeff['query'][_0x1ff1('0x4c')]){_0x3b4ab6[_0x1ff1('0x4a')]=_['merge'](_0x3b4ab6['where'],{'$or':_[_0x1ff1('0x3f')](_0xf3d391,function(_0x32a218){if(_0x32a218[_0x1ff1('0x4d')]!==_0x1ff1('0x4e')){var _0x4a1929={};_0x4a1929[_0x32a218[_0x1ff1('0x3a')]]={'$like':'%'+_0x5adeff[_0x1ff1('0x40')][_0x1ff1('0x4c')]+'%'};return _0x4a1929;}})});}_0x3b4ab6=_[_0x1ff1('0x4f')]({},_0x3b4ab6,_0x5adeff[_0x1ff1('0x50')]);var _0x2bb3f9={'where':_0x3b4ab6[_0x1ff1('0x4a')]};return db[_0x1ff1('0x3c')]['count'](_0x2bb3f9)['then'](function(_0x5c303a){_0x3f9eb9[_0x1ff1('0x2d')]=_0x5c303a;if(_0x5adeff[_0x1ff1('0x40')]['includeAll']){_0x3b4ab6[_0x1ff1('0x51')]=[{'all':!![]}];}return db[_0x1ff1('0x3c')][_0x1ff1('0x52')](_0x3b4ab6);})[_0x1ff1('0x1d')](function(_0x523583){_0x3f9eb9[_0x1ff1('0x53')]=_0x523583;return _0x3f9eb9;})[_0x1ff1('0x1d')](respondWithFilteredResult(_0x348225,_0x3b4ab6))['catch'](handleError(_0x348225,null));};exports['show']=function(_0x1856ab,_0x5ebb36){var _0x5b4acf={'raw':!![],'where':{'id':_0x1856ab[_0x1ff1('0x54')]['id']}},_0x5192c8={};_0x5192c8[_0x1ff1('0x3e')]=_[_0x1ff1('0x41')](db['ChatQueue']['rawAttributes']);_0x5192c8[_0x1ff1('0x40')]=_['keys'](_0x1856ab[_0x1ff1('0x40')]);_0x5192c8[_0x1ff1('0x42')]=_[_0x1ff1('0x43')](_0x5192c8[_0x1ff1('0x3e')],_0x5192c8['query']);_0x5b4acf[_0x1ff1('0x44')]=_[_0x1ff1('0x43')](_0x5192c8['model'],qs[_0x1ff1('0x45')](_0x1856ab[_0x1ff1('0x40')][_0x1ff1('0x45')]));_0x5b4acf[_0x1ff1('0x44')]=_0x5b4acf[_0x1ff1('0x44')][_0x1ff1('0x46')]?_0x5b4acf[_0x1ff1('0x44')]:_0x5192c8[_0x1ff1('0x3e')];if(_0x1856ab[_0x1ff1('0x40')][_0x1ff1('0x55')]){_0x5b4acf[_0x1ff1('0x51')]=[{'all':!![]}];}_0x5b4acf=_[_0x1ff1('0x4f')]({},_0x5b4acf,_0x1856ab['options']);return db[_0x1ff1('0x3c')][_0x1ff1('0x56')](_0x5b4acf)[_0x1ff1('0x1d')](handleEntityNotFound(_0x5ebb36,null))[_0x1ff1('0x1d')](respondWithResult(_0x5ebb36,null))[_0x1ff1('0x28')](handleError(_0x5ebb36,null));};exports[_0x1ff1('0x57')]=function(_0x1467fe,_0x24996f){return db[_0x1ff1('0x3c')][_0x1ff1('0x57')](_0x1467fe[_0x1ff1('0x58')],{})[_0x1ff1('0x1d')](function(_0x35eb5b){var _0xf04d7e=_0x1467fe[_0x1ff1('0x59')][_0x1ff1('0x5a')]({'plain':!![]});if(!_0xf04d7e)throw new Error(_0x1ff1('0x5b'));if(_0xf04d7e[_0x1ff1('0x5c')]===_0x1ff1('0x59')){var _0x44422b=_0x35eb5b[_0x1ff1('0x5a')]({'plain':!![]});var _0x377004=_0x1ff1('0x37');return db[_0x1ff1('0x5d')][_0x1ff1('0x56')]({'where':{'name':_0x377004,'userProfileId':_0xf04d7e[_0x1ff1('0x5e')]},'raw':!![]})[_0x1ff1('0x1d')](function(_0x104b6e){if(_0x104b6e&&_0x104b6e[_0x1ff1('0x5f')]===0x0){return db[_0x1ff1('0x38')][_0x1ff1('0x57')]({'name':_0x44422b['name'],'resourceId':_0x44422b['id'],'type':_0x104b6e[_0x1ff1('0x3a')],'sectionId':_0x104b6e['id']},{})[_0x1ff1('0x1d')](function(){return _0x35eb5b;});}else{return _0x35eb5b;}})[_0x1ff1('0x28')](function(_0x4030b8){logger[_0x1ff1('0x24')](_0x1ff1('0x60'),_0x4030b8);throw _0x4030b8;});}return _0x35eb5b;})[_0x1ff1('0x1d')](respondWithResult(_0x24996f,0xc9))[_0x1ff1('0x28')](handleError(_0x24996f,null));};exports[_0x1ff1('0x35')]=function(_0x3b3003,_0xe2a11a){if(_0x3b3003[_0x1ff1('0x58')]['id']){delete _0x3b3003[_0x1ff1('0x58')]['id'];}return db['ChatQueue'][_0x1ff1('0x56')]({'where':{'id':_0x3b3003['params']['id']}})[_0x1ff1('0x1d')](handleEntityNotFound(_0xe2a11a,null))[_0x1ff1('0x1d')](saveUpdates(_0x3b3003[_0x1ff1('0x58')],null))[_0x1ff1('0x1d')](respondWithResult(_0xe2a11a,null))[_0x1ff1('0x28')](handleError(_0xe2a11a,null));};exports[_0x1ff1('0x36')]=function(_0x323db3,_0x5b2339){return db[_0x1ff1('0x3c')][_0x1ff1('0x56')]({'where':{'id':_0x323db3[_0x1ff1('0x54')]['id']}})['then'](handleEntityNotFound(_0x5b2339,null))[_0x1ff1('0x1d')](removeEntity(_0x5b2339,null))[_0x1ff1('0x28')](handleError(_0x5b2339,null));};exports[_0x1ff1('0x61')]=function(_0x43cfc3,_0xd38579){return db[_0x1ff1('0x3c')]['describe']()[_0x1ff1('0x1d')](respondWithResult(_0xd38579,null))['catch'](handleError(_0xd38579,null));};exports[_0x1ff1('0x62')]=function(_0x82d87f,_0x2a7b57,_0x19391e){var _0x3bb582={'raw':!![],'where':{}},_0xc5d87c={},_0x42582d;return db['ChatQueue'][_0x1ff1('0x63')]({'where':{'id':_0x82d87f['params']['id']}})[_0x1ff1('0x1d')](handleEntityNotFound(_0x2a7b57,null))['then'](function(_0x3ae5ac){if(_0x3ae5ac){_0x42582d=_0x3ae5ac[_0x1ff1('0x5a')]({'plain':!![]});_0xc5d87c['model']=_['keys'](db['UserChatQueue']['rawAttributes']);_0xc5d87c[_0x1ff1('0x40')]=_[_0x1ff1('0x41')](_0x82d87f[_0x1ff1('0x40')]);_0xc5d87c[_0x1ff1('0x42')]=_[_0x1ff1('0x43')](_0xc5d87c[_0x1ff1('0x3e')],_0xc5d87c[_0x1ff1('0x40')]);_0x3bb582['attributes']=_[_0x1ff1('0x43')](_0xc5d87c['model'],qs[_0x1ff1('0x45')](_0x82d87f[_0x1ff1('0x40')]['fields']));_0x3bb582[_0x1ff1('0x44')]=_0x3bb582[_0x1ff1('0x44')][_0x1ff1('0x46')]?_0x3bb582[_0x1ff1('0x44')]:_0xc5d87c[_0x1ff1('0x3e')];if(!_0x82d87f[_0x1ff1('0x40')]['hasOwnProperty'](_0x1ff1('0x64'))){_0x3bb582['limit']=qs[_0x1ff1('0x2f')](_0x82d87f[_0x1ff1('0x40')]['limit']);_0x3bb582[_0x1ff1('0x2e')]=qs[_0x1ff1('0x2e')](_0x82d87f[_0x1ff1('0x40')][_0x1ff1('0x2e')]);}_0x3bb582['order']=qs[_0x1ff1('0x49')](_0x82d87f[_0x1ff1('0x40')][_0x1ff1('0x49')]);_0x3bb582[_0x1ff1('0x4a')]=qs[_0x1ff1('0x42')](_[_0x1ff1('0x4b')](_0x82d87f[_0x1ff1('0x40')],_0xc5d87c[_0x1ff1('0x42')]));_0x3bb582['where'][_0x1ff1('0x65')]=_0x3ae5ac['id'];if(_0x82d87f[_0x1ff1('0x40')][_0x1ff1('0x4c')]){_0x3bb582['where']=_[_0x1ff1('0x4f')](_0x3bb582[_0x1ff1('0x4a')],{'$or':_[_0x1ff1('0x3f')](_0x3bb582[_0x1ff1('0x44')],function(_0x57f254){var _0x5c22cf={};_0x5c22cf[_0x57f254]={'$like':'%'+_0x82d87f['query'][_0x1ff1('0x4c')]+'%'};return _0x5c22cf;})});}_0x3bb582=_['merge']({},_0x3bb582,_0x82d87f[_0x1ff1('0x50')]);return db[_0x1ff1('0x66')][_0x1ff1('0x52')](_0x3bb582);}})['then'](function(_0x4f59d9){if(_0x4f59d9){return db[_0x1ff1('0x67')][_0x1ff1('0x68')]({'where':{'id':_[_0x1ff1('0x3f')](_0x4f59d9,_0x1ff1('0x69')),'role':_0x1ff1('0x6a')},'attributes':['id',_0x1ff1('0x3a'),_0x1ff1('0x6b'),_0x1ff1('0x6c'),'createdAt']});}})[_0x1ff1('0x1d')](function(_0x283d4c){if(_0x283d4c){return{'count':_0x283d4c['count'],'rows':_['map'](_0x283d4c[_0x1ff1('0x53')],function(_0x48e98c){return{'membername':_0x48e98c['name'],'UserId':_0x48e98c['id'],'queue_name':_0x42582d[_0x1ff1('0x3a')],'ChatQueueId':_0x42582d['id'],'interface':util[_0x1ff1('0x6d')](_0x1ff1('0x6e'),_0x1ff1('0x6f'),_0x48e98c[_0x1ff1('0x3a')]),'penalty':0x0,'paused':_0x48e98c[_0x1ff1('0x6b')],'createdAt':_0x48e98c[_0x1ff1('0x70')],'updatedAt':_0x48e98c[_0x1ff1('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1ff1('0x1d')](respondWithFilteredResult(_0x2a7b57,_0x3bb582))[_0x1ff1('0x28')](handleError(_0x2a7b57,null));};exports['getTeams']=function(_0x2d97bb,_0x26a565,_0x10b7b1){var _0x2804e5={};var _0x45817c={};var _0x589548;var _0xf1fcf2;return db[_0x1ff1('0x3c')][_0x1ff1('0x63')]({'where':{'id':_0x2d97bb[_0x1ff1('0x54')]['id']}})[_0x1ff1('0x1d')](handleEntityNotFound(_0x26a565,null))['then'](function(_0x9c8bcb){if(_0x9c8bcb){_0x589548=_0x9c8bcb;_0x45817c[_0x1ff1('0x3e')]=_[_0x1ff1('0x41')](db['Team']['rawAttributes']);_0x45817c[_0x1ff1('0x40')]=_[_0x1ff1('0x41')](_0x2d97bb[_0x1ff1('0x40')]);_0x45817c['filters']=_[_0x1ff1('0x43')](_0x45817c[_0x1ff1('0x3e')],_0x45817c['query']);_0x2804e5[_0x1ff1('0x44')]=_['intersection'](_0x45817c['model'],qs[_0x1ff1('0x45')](_0x2d97bb[_0x1ff1('0x40')][_0x1ff1('0x45')]));_0x2804e5[_0x1ff1('0x44')]=_0x2804e5['attributes'][_0x1ff1('0x46')]?_0x2804e5['attributes']:_0x45817c[_0x1ff1('0x3e')];_0x2804e5[_0x1ff1('0x48')]=qs[_0x1ff1('0x49')](_0x2d97bb[_0x1ff1('0x40')]['sort']);_0x2804e5[_0x1ff1('0x4a')]=qs[_0x1ff1('0x42')](_['pick'](_0x2d97bb[_0x1ff1('0x40')],_0x45817c[_0x1ff1('0x42')]));if(_0x2d97bb[_0x1ff1('0x40')][_0x1ff1('0x4c')]){_0x2804e5[_0x1ff1('0x4a')]=_[_0x1ff1('0x4f')](_0x2804e5[_0x1ff1('0x4a')],{'$or':_[_0x1ff1('0x3f')](_0x2804e5[_0x1ff1('0x44')],function(_0x2b956f){var _0x2e6cb0={};_0x2e6cb0[_0x2b956f]={'$like':'%'+_0x2d97bb[_0x1ff1('0x40')][_0x1ff1('0x4c')]+'%'};return _0x2e6cb0;})});}_0x2804e5=_['merge']({},_0x2804e5,_0x2d97bb[_0x1ff1('0x50')]);return _0x589548['getTeams'](_0x2804e5);}})[_0x1ff1('0x1d')](function(_0x1d59e6){if(_0x1d59e6){_0xf1fcf2=_0x1d59e6[_0x1ff1('0x46')];if(!_0x2d97bb['query'][_0x1ff1('0x47')](_0x1ff1('0x64'))){_0x2804e5[_0x1ff1('0x2f')]=qs[_0x1ff1('0x2f')](_0x2d97bb[_0x1ff1('0x40')]['limit']);_0x2804e5[_0x1ff1('0x2e')]=qs['offset'](_0x2d97bb[_0x1ff1('0x40')]['offset']);}return _0x589548['getTeams'](_0x2804e5);}})['then'](function(_0x2557ed){if(_0x2557ed){return _0x2557ed?{'count':_0xf1fcf2,'rows':_0x2557ed}:null;}})[_0x1ff1('0x1d')](respondWithResult(_0x26a565,null))[_0x1ff1('0x28')](handleError(_0x26a565,null));};exports[_0x1ff1('0x71')]=function(_0x4f7a65,_0x1717aa,_0x5adc80){var _0x52c03f=_0x4f7a65['body'][_0x1ff1('0x72')];return db['Team'][_0x1ff1('0x52')]({'where':{'id':_0x52c03f},'attributes':['id'],'include':[{'model':db[_0x1ff1('0x67')],'as':'Agents','attributes':['id','name','online',_0x1ff1('0x73'),_0x1ff1('0x74')],'raw':!![]}]})[_0x1ff1('0x1d')](function(_0x2ebed4){if(_0x2ebed4){var _0x1f59b7=_[_0x1ff1('0x75')](_0x2ebed4,function(_0x451468){var _0x3d0847=_0x451468[_0x1ff1('0x5a')]({'plain':!![]});return _0x3d0847[_0x1ff1('0x76')];});return db[_0x1ff1('0x3c')][_0x1ff1('0x56')]({'where':{'id':_0x4f7a65['params']['id']}})['then'](function(_0x1274d1){return db['sequelize'][_0x1ff1('0x77')](function(_0x71a637){return _0x1274d1[_0x1ff1('0x71')](_0x52c03f,{'transaction':_0x71a637})[_0x1ff1('0x1d')](function(){return BPromise[_0x1ff1('0x78')](_0x1f59b7,function(_0xdf312a){return db['UserChatQueue'][_0x1ff1('0x79')]({'where':{'UserId':_0xdf312a['id'],'ChatQueueId':_0x4f7a65[_0x1ff1('0x54')]['id']},'transaction':_0x71a637});});})['then'](function(){_0x1f59b7['forEach'](function(_0x21287e){socket[_0x1ff1('0x7a')](_0x1ff1('0x7b'),{'UserId':_0x21287e['id'],'ChatQueueId':_0x1274d1['id']});});});});});}})[_0x1ff1('0x1d')](respondWithStatusCode(_0x1717aa,null))[_0x1ff1('0x28')](handleError(_0x1717aa,null));};exports[_0x1ff1('0x7c')]=function(_0x4ad9f3,_0x3713bf,_0x399d99){return db[_0x1ff1('0x7d')][_0x1ff1('0x52')]({'where':{'id':_0x4ad9f3[_0x1ff1('0x40')][_0x1ff1('0x72')]},'attributes':['id'],'include':[{'model':db[_0x1ff1('0x67')],'as':_0x1ff1('0x76'),'attributes':['id'],'raw':!![]}]})[_0x1ff1('0x1d')](handleEntityNotFound(_0x3713bf,null))[_0x1ff1('0x1d')](function(_0x5a0dc6){var _0x33a074=_['map'](_0x5a0dc6,'id');var _0x29a19a=[];var _0x3a664=[];var _0x19ef34=squel['select']();_0x19ef34['field'](_0x1ff1('0x7e'))[_0x1ff1('0x7f')](_0x1ff1('0x80'),'tq')['join'](_0x1ff1('0x81'),'ut',_0x1ff1('0x82'))['where'](_0x1ff1('0x83'),_0x4ad9f3[_0x1ff1('0x54')]['id']);for(var _0x4302b4=0x0;_0x4302b4<_0x5a0dc6['length'];_0x4302b4+=0x1){let _0x45cb8a=_0x5a0dc6[_0x4302b4];for(var _0x31c890=0x0;_0x31c890<_0x45cb8a[_0x1ff1('0x76')]['length'];_0x31c890+=0x1){let _0x8a9a4b=_0x45cb8a[_0x1ff1('0x76')][_0x31c890];var _0x2785ad=_0x19ef34[_0x1ff1('0x84')]();_0x2785ad[_0x1ff1('0x4a')](_0x1ff1('0x85'),_0x8a9a4b['id']);_0x3a664[_0x1ff1('0x86')](db[_0x1ff1('0x87')][_0x1ff1('0x40')](_0x2785ad[_0x1ff1('0x88')](),{'type':db[_0x1ff1('0x87')][_0x1ff1('0x89')][_0x1ff1('0x8a')]})['then'](function(_0x92bc20){if(_0x92bc20['length']===0x1){return _0x8a9a4b['id'];}else{var _0x11c444=_[_0x1ff1('0x8b')](_[_0x1ff1('0x3f')](_0x92bc20,_0x1ff1('0x8c')),function(_0x3fc7ae){return _[_0x1ff1('0x8d')](_0x33a074,_0x3fc7ae);});if(_0x11c444){return _0x8a9a4b['id'];}}}));}}return BPromise['all'](_0x3a664)['then'](function(_0x2966c5){_0x29a19a=_(_0x29a19a)['union'](_0x2966c5)['compact']()[_0x1ff1('0x8e')]();return db[_0x1ff1('0x3c')]['find']({'where':{'id':_0x4ad9f3[_0x1ff1('0x54')]['id']}})[_0x1ff1('0x1d')](function(_0x12b20b){return db[_0x1ff1('0x87')][_0x1ff1('0x77')](function(_0x35d902){return _0x12b20b[_0x1ff1('0x7c')](_0x4ad9f3[_0x1ff1('0x40')]['ids'],{'transaction':_0x35d902})[_0x1ff1('0x1d')](function(){if(!_[_0x1ff1('0x8f')](_0x29a19a)){return _0x12b20b[_0x1ff1('0x90')](_0x29a19a,{'transaction':_0x35d902});}})['then'](function(){_0x29a19a['forEach'](function(_0x6c1d15){socket[_0x1ff1('0x7a')](_0x1ff1('0x91'),{'UserId':_0x6c1d15,'ChatQueueId':_0x12b20b['id']});});});});});});})[_0x1ff1('0x1d')](respondWithStatusCode(_0x3713bf,null))[_0x1ff1('0x28')](handleError(_0x3713bf,null));};exports[_0x1ff1('0x92')]=function(_0x32b032,_0x127517,_0x2709f6){return db[_0x1ff1('0x3c')][_0x1ff1('0x56')]({'where':{'id':_0x32b032[_0x1ff1('0x54')]['id']}})[_0x1ff1('0x1d')](handleEntityNotFound(_0x127517,null))[_0x1ff1('0x1d')](function(_0x229c02){if(_0x229c02){return _0x229c02['addAgents'](_0x32b032[_0x1ff1('0x58')][_0x1ff1('0x72')],_['omit'](_0x32b032[_0x1ff1('0x58')],['ids','id'])||{})[_0x1ff1('0x93')](function(_0x117a23){for(var _0x2f0217=0x0;_0x2f0217<_0x32b032[_0x1ff1('0x58')][_0x1ff1('0x72')][_0x1ff1('0x46')];_0x2f0217+=0x1){socket[_0x1ff1('0x7a')](_0x1ff1('0x7b'),{'UserId':_0x32b032[_0x1ff1('0x58')][_0x1ff1('0x72')][_0x2f0217],'ChatQueueId':_0x32b032[_0x1ff1('0x54')]['id']});}return _0x117a23;});}})[_0x1ff1('0x1d')](respondWithResult(_0x127517,null))[_0x1ff1('0x28')](handleError(_0x127517,null));};exports[_0x1ff1('0x90')]=function(_0x174898,_0x2d8fa7,_0x3c40e4){return db['ChatQueue'][_0x1ff1('0x56')]({'where':{'id':_0x174898[_0x1ff1('0x54')]['id']}})[_0x1ff1('0x1d')](handleEntityNotFound(_0x2d8fa7,null))[_0x1ff1('0x1d')](function(_0x59c525){if(_0x59c525){return _0x59c525[_0x1ff1('0x90')](_0x174898[_0x1ff1('0x40')][_0x1ff1('0x72')])[_0x1ff1('0x1d')](function(){if(_[_0x1ff1('0x94')](_0x174898[_0x1ff1('0x40')]['ids'])){for(var _0x39d827=0x0;_0x39d827<_0x174898[_0x1ff1('0x40')][_0x1ff1('0x72')][_0x1ff1('0x46')];_0x39d827+=0x1){socket['emit'](_0x1ff1('0x91'),{'UserId':Number(_0x174898[_0x1ff1('0x40')][_0x1ff1('0x72')][_0x39d827]),'ChatQueueId':Number(_0x174898[_0x1ff1('0x54')]['id'])});}}else{socket[_0x1ff1('0x7a')](_0x1ff1('0x91'),{'UserId':Number(_0x174898[_0x1ff1('0x40')][_0x1ff1('0x72')]),'ChatQueueId':Number(_0x174898[_0x1ff1('0x54')]['id'])});}});}})[_0x1ff1('0x1d')](respondWithStatusCode(_0x2d8fa7,null))[_0x1ff1('0x28')](handleError(_0x2d8fa7,null));};exports['getAgents']=function(_0x31e98d,_0x2fc48d,_0x1df2a1){var _0x56b01b={};var _0x2201ec={};var _0x580a62;var _0x4318d4;return db[_0x1ff1('0x3c')][_0x1ff1('0x63')]({'where':{'id':_0x31e98d[_0x1ff1('0x54')]['id']}})['then'](handleEntityNotFound(_0x2fc48d,null))['then'](function(_0xbcdf3){if(_0xbcdf3){_0x580a62=_0xbcdf3;_0x2201ec[_0x1ff1('0x3e')]=_['keys'](db[_0x1ff1('0x67')]['rawAttributes']);_0x2201ec['query']=_['keys'](_0x31e98d[_0x1ff1('0x40')]);_0x2201ec[_0x1ff1('0x42')]=_['intersection'](_0x2201ec[_0x1ff1('0x3e')],_0x2201ec[_0x1ff1('0x40')]);_0x56b01b[_0x1ff1('0x44')]=_[_0x1ff1('0x43')](_0x2201ec[_0x1ff1('0x3e')],qs[_0x1ff1('0x45')](_0x31e98d['query'][_0x1ff1('0x45')]));_0x56b01b[_0x1ff1('0x44')]=_0x56b01b[_0x1ff1('0x44')]['length']?_0x56b01b[_0x1ff1('0x44')]:_0x2201ec['model'];_0x56b01b['order']=qs['sort'](_0x31e98d[_0x1ff1('0x40')][_0x1ff1('0x49')]);_0x56b01b[_0x1ff1('0x4a')]=qs['filters'](_[_0x1ff1('0x4b')](_0x31e98d['query'],_0x2201ec[_0x1ff1('0x42')]));if(_0x31e98d[_0x1ff1('0x40')][_0x1ff1('0x4c')]){_0x56b01b['where']=_['merge'](_0x56b01b[_0x1ff1('0x4a')],{'$or':_['map'](_0x56b01b[_0x1ff1('0x44')],function(_0xa0ccde){var _0x46773a={};_0x46773a[_0xa0ccde]={'$like':'%'+_0x31e98d[_0x1ff1('0x40')][_0x1ff1('0x4c')]+'%'};return _0x46773a;})});}_0x56b01b=_[_0x1ff1('0x4f')]({},_0x56b01b,_0x31e98d[_0x1ff1('0x50')]);return _0x580a62[_0x1ff1('0x95')](_0x56b01b);}})[_0x1ff1('0x1d')](function(_0x13a16f){if(_0x13a16f){_0x4318d4=_0x13a16f[_0x1ff1('0x46')];if(!_0x31e98d[_0x1ff1('0x40')][_0x1ff1('0x47')](_0x1ff1('0x64'))){_0x56b01b[_0x1ff1('0x2f')]=qs[_0x1ff1('0x2f')](_0x31e98d[_0x1ff1('0x40')][_0x1ff1('0x2f')]);_0x56b01b[_0x1ff1('0x2e')]=qs[_0x1ff1('0x2e')](_0x31e98d[_0x1ff1('0x40')][_0x1ff1('0x2e')]);}return _0x580a62[_0x1ff1('0x95')](_0x56b01b);}})['then'](function(_0x14cfe5){if(_0x14cfe5){return _0x14cfe5?{'count':_0x4318d4,'rows':_0x14cfe5}:null;}})[_0x1ff1('0x1d')](respondWithResult(_0x2fc48d,null))[_0x1ff1('0x28')](handleError(_0x2fc48d,null));};
\ No newline at end of file
+var _0x15f7=['ut.UserId\x20=\x20?','push','sequelize','QueryTypes','every','includes','all','union','compact','value','isEmpty','removeAgents','emit','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','get','UserProfileResource','destroy','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','includeAll','include','findAll','show','params','length','options','create','body','user','ChatQueues','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','nolimit','UserChatQueue','User','findAndCountAll','UserId','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','userChatQueue:save','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone'];(function(_0xbd3b9c,_0x398223){var _0x33520f=function(_0x4cfa1a){while(--_0x4cfa1a){_0xbd3b9c['push'](_0xbd3b9c['shift']());}};_0x33520f(++_0x398223);}(_0x15f7,0xb0));var _0x715f=function(_0x5c43e1,_0x4c1705){_0x5c43e1=_0x5c43e1-0x0;var _0x397fa7=_0x15f7[_0x5c43e1];return _0x397fa7;};'use strict';var pdf=require(_0x715f('0x0'));var emlformat=require(_0x715f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x715f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x715f('0x3'));var moment=require(_0x715f('0x4'));var BPromise=require(_0x715f('0x5'));var Mustache=require(_0x715f('0x6'));var util=require(_0x715f('0x7'));var path=require('path');var sox=require(_0x715f('0x8'));var csv=require(_0x715f('0x9'));var ejs=require(_0x715f('0xa'));var fs=require('fs');var _=require(_0x715f('0xb'));var squel=require(_0x715f('0xc'));var crypto=require(_0x715f('0xd'));var jsforce=require(_0x715f('0xe'));var deskjs=require(_0x715f('0xf'));var toCsv=require(_0x715f('0x9'));var querystring=require('querystring');var Papa=require(_0x715f('0x10'));var Redis=require(_0x715f('0x11'));var authService=require(_0x715f('0x12'));var qs=require(_0x715f('0x13'));var as=require(_0x715f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x715f('0x15'))(_0x715f('0x16'));var utils=require(_0x715f('0x17'));var config=require(_0x715f('0x18'));var db=require(_0x715f('0x19'))['db'];config['redis']=_[_0x715f('0x1a')](config[_0x715f('0x1b')],{'host':_0x715f('0x1c'),'port':0x18eb});var socket=require(_0x715f('0x1d'))(new Redis(config[_0x715f('0x1b')]));require('./chatQueue.socket')[_0x715f('0x1e')](socket);var jayson=require(_0x715f('0x1f'));var client=jayson[_0x715f('0x20')][_0x715f('0x21')]({'port':0x232a});function checkPasswordPattern(_0x15587c,_0x1fdb8f,_0x5d5949){if(_0x5d5949){var _0x4280df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4280df[_0x715f('0x22')](_0x1fdb8f)){return _0x15587c;}else{throw new db['Sequelize']['ValidationError'](_0x715f('0x23'));}}else{return _0x15587c;}}function respondWithRpcPromise(_0x524722,_0x52901e,_0x5cd6c4,_0x3f1c3d){return new BPromise(function(_0x1c6e65,_0x5855f3){var _0x1e3a7e=_0x3f1c3d||client;return _0x1e3a7e[_0x715f('0x24')](_0x524722,_0x5cd6c4)[_0x715f('0x25')](function(_0x5e3875){logger[_0x715f('0x26')](_0x715f('0x27'),_0x52901e,_0x715f('0x28'));logger[_0x715f('0x29')](_0x715f('0x2a'),_0x52901e,_0x715f('0x28'),JSON[_0x715f('0x2b')](_0x5e3875));if(_0x5e3875[_0x715f('0x2c')]){if(_0x5e3875[_0x715f('0x2c')]['code']===0x1f4){logger[_0x715f('0x2c')]('ChatQueue,\x20%s,\x20%s',_0x52901e,_0x5e3875[_0x715f('0x2c')][_0x715f('0x2d')]);return _0x5855f3(_0x5e3875[_0x715f('0x2c')][_0x715f('0x2d')]);}logger['error'](_0x715f('0x27'),_0x52901e,_0x5e3875['error']['message']);return _0x1c6e65(_0x5e3875[_0x715f('0x2c')][_0x715f('0x2d')]);}else{logger['info'](_0x715f('0x27'),_0x52901e,'request\x20sent');_0x1c6e65(_0x5e3875[_0x715f('0x2e')]['message']);}})[_0x715f('0x2f')](function(_0x2d677b){logger['error'](_0x715f('0x27'),_0x52901e,_0x2d677b);_0x5855f3(_0x2d677b);});});}function respondWithStatusCode(_0x5c0c75,_0x44cc7c){_0x44cc7c=_0x44cc7c||0xcc;return function(_0x468860){if(_0x468860){return _0x5c0c75[_0x715f('0x30')](_0x44cc7c);}return _0x5c0c75[_0x715f('0x31')](_0x44cc7c)[_0x715f('0x32')]();};}function respondWithResult(_0x49f70c,_0xf53d71){_0xf53d71=_0xf53d71||0xc8;return function(_0x1485a1){if(_0x1485a1){return _0x49f70c[_0x715f('0x31')](_0xf53d71)[_0x715f('0x33')](_0x1485a1);}};}function respondWithFilteredResult(_0x379481,_0x44f836){return function(_0x562c83){if(_0x562c83){var _0x9efa40=_0x562c83[_0x715f('0x34')],_0x37d7db=_0x44f836[_0x715f('0x35')],_0x9617a2=_0x44f836[_0x715f('0x35')]+_0x44f836[_0x715f('0x36')],_0x4ea738;if(_0x9617a2>=_0x9efa40){_0x9617a2=_0x9efa40;_0x4ea738=0xc8;}else{_0x4ea738=0xce;}_0x379481[_0x715f('0x31')](_0x4ea738);return _0x379481[_0x715f('0x37')](_0x715f('0x38'),_0x37d7db+'-'+_0x9617a2+'/'+_0x9efa40)[_0x715f('0x33')](_0x562c83);}return null;};}function patchUpdates(_0x473f55){return function(_0x1bb285){try{jsonpatch[_0x715f('0x39')](_0x1bb285,_0x473f55,!![]);}catch(_0x1db452){return BPromise[_0x715f('0x3a')](_0x1db452);}return _0x1bb285[_0x715f('0x3b')]();};}function saveUpdates(_0x38d16e,_0x38572a){return function(_0x1c97ec){if(_0x1c97ec){return _0x1c97ec['update'](_0x38d16e)[_0x715f('0x25')](function(_0x3935be){return _0x3935be;});}return null;};}function removeEntity(_0x49334b,_0x488077){return function(_0x56bd41){if(_0x56bd41){return _0x56bd41['destroy']()[_0x715f('0x25')](function(){var _0x432a8b=_0x56bd41[_0x715f('0x3c')]({'plain':!![]});var _0x3570c9='ChatQueues';return db[_0x715f('0x3d')][_0x715f('0x3e')]({'where':{'type':_0x3570c9,'resourceId':_0x432a8b['id']}})['then'](function(){return _0x56bd41;});})[_0x715f('0x25')](function(){_0x49334b[_0x715f('0x31')](0xcc)[_0x715f('0x32')]();});}};}function handleEntityNotFound(_0x39fe33,_0x3a1287){return function(_0x6f7b8f){if(!_0x6f7b8f){_0x39fe33[_0x715f('0x30')](0x194);}return _0x6f7b8f;};}function handleError(_0x437325,_0x503f12){_0x503f12=_0x503f12||0x1f4;return function(_0x5d3d99){logger[_0x715f('0x2c')](_0x5d3d99['stack']);if(_0x5d3d99[_0x715f('0x3f')]){delete _0x5d3d99[_0x715f('0x3f')];}_0x437325[_0x715f('0x31')](_0x503f12)[_0x715f('0x40')](_0x5d3d99);};}exports[_0x715f('0x41')]=function(_0x3a5fa9,_0x50861f){var _0x2f95f2={},_0x4adb78={},_0x4e79aa={'count':0x0,'rows':[]};var _0x138b79=_[_0x715f('0x42')](db[_0x715f('0x43')][_0x715f('0x44')],function(_0x1bd8d5){return{'name':_0x1bd8d5[_0x715f('0x45')],'type':_0x1bd8d5[_0x715f('0x46')][_0x715f('0x47')]};});_0x4adb78[_0x715f('0x48')]=_[_0x715f('0x42')](_0x138b79,'name');_0x4adb78[_0x715f('0x49')]=_[_0x715f('0x4a')](_0x3a5fa9[_0x715f('0x49')]);_0x4adb78[_0x715f('0x4b')]=_[_0x715f('0x4c')](_0x4adb78[_0x715f('0x48')],_0x4adb78[_0x715f('0x49')]);_0x2f95f2[_0x715f('0x4d')]=_[_0x715f('0x4c')](_0x4adb78[_0x715f('0x48')],qs['fields'](_0x3a5fa9['query'][_0x715f('0x4e')]));_0x2f95f2[_0x715f('0x4d')]=_0x2f95f2[_0x715f('0x4d')]['length']?_0x2f95f2[_0x715f('0x4d')]:_0x4adb78['model'];if(!_0x3a5fa9['query'][_0x715f('0x4f')]('nolimit')){_0x2f95f2[_0x715f('0x36')]=qs[_0x715f('0x36')](_0x3a5fa9[_0x715f('0x49')]['limit']);_0x2f95f2['offset']=qs['offset'](_0x3a5fa9[_0x715f('0x49')][_0x715f('0x35')]);}_0x2f95f2[_0x715f('0x50')]=qs[_0x715f('0x51')](_0x3a5fa9[_0x715f('0x49')][_0x715f('0x51')]);_0x2f95f2[_0x715f('0x52')]=qs[_0x715f('0x4b')](_[_0x715f('0x53')](_0x3a5fa9[_0x715f('0x49')],_0x4adb78[_0x715f('0x4b')]),_0x138b79);if(_0x3a5fa9[_0x715f('0x49')][_0x715f('0x54')]){_0x2f95f2[_0x715f('0x52')]=_[_0x715f('0x55')](_0x2f95f2[_0x715f('0x52')],{'$or':_[_0x715f('0x42')](_0x138b79,function(_0x3b5ebc){if(_0x3b5ebc['type']!=='VIRTUAL'){var _0x1fdf96={};_0x1fdf96[_0x3b5ebc[_0x715f('0x3f')]]={'$like':'%'+_0x3a5fa9['query'][_0x715f('0x54')]+'%'};return _0x1fdf96;}})});}_0x2f95f2=_[_0x715f('0x55')]({},_0x2f95f2,_0x3a5fa9['options']);var _0x92dd58={'where':_0x2f95f2[_0x715f('0x52')]};return db[_0x715f('0x43')][_0x715f('0x34')](_0x92dd58)['then'](function(_0xfdb65b){_0x4e79aa[_0x715f('0x34')]=_0xfdb65b;if(_0x3a5fa9['query'][_0x715f('0x56')]){_0x2f95f2[_0x715f('0x57')]=[{'all':!![]}];}return db[_0x715f('0x43')][_0x715f('0x58')](_0x2f95f2);})[_0x715f('0x25')](function(_0x36a7ca){_0x4e79aa['rows']=_0x36a7ca;return _0x4e79aa;})[_0x715f('0x25')](respondWithFilteredResult(_0x50861f,_0x2f95f2))[_0x715f('0x2f')](handleError(_0x50861f,null));};exports[_0x715f('0x59')]=function(_0x843135,_0x352ca5){var _0x74178e={'raw':!![],'where':{'id':_0x843135[_0x715f('0x5a')]['id']}},_0x556f05={};_0x556f05[_0x715f('0x48')]=_['keys'](db['ChatQueue'][_0x715f('0x44')]);_0x556f05[_0x715f('0x49')]=_['keys'](_0x843135['query']);_0x556f05[_0x715f('0x4b')]=_['intersection'](_0x556f05[_0x715f('0x48')],_0x556f05[_0x715f('0x49')]);_0x74178e[_0x715f('0x4d')]=_[_0x715f('0x4c')](_0x556f05[_0x715f('0x48')],qs[_0x715f('0x4e')](_0x843135[_0x715f('0x49')][_0x715f('0x4e')]));_0x74178e[_0x715f('0x4d')]=_0x74178e[_0x715f('0x4d')][_0x715f('0x5b')]?_0x74178e[_0x715f('0x4d')]:_0x556f05[_0x715f('0x48')];if(_0x843135[_0x715f('0x49')][_0x715f('0x56')]){_0x74178e['include']=[{'all':!![]}];}_0x74178e=_['merge']({},_0x74178e,_0x843135[_0x715f('0x5c')]);return db[_0x715f('0x43')]['find'](_0x74178e)[_0x715f('0x25')](handleEntityNotFound(_0x352ca5,null))[_0x715f('0x25')](respondWithResult(_0x352ca5,null))[_0x715f('0x2f')](handleError(_0x352ca5,null));};exports['create']=function(_0x1a3c25,_0x535365){return db['ChatQueue'][_0x715f('0x5d')](_0x1a3c25[_0x715f('0x5e')],{})[_0x715f('0x25')](function(_0x2c9075){var _0x1b069e=_0x1a3c25[_0x715f('0x5f')]['get']({'plain':!![]});if(!_0x1b069e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b069e['role']===_0x715f('0x5f')){var _0x48aabf=_0x2c9075[_0x715f('0x3c')]({'plain':!![]});var _0x158485=_0x715f('0x60');return db[_0x715f('0x61')][_0x715f('0x62')]({'where':{'name':_0x158485,'userProfileId':_0x1b069e[_0x715f('0x63')]},'raw':!![]})[_0x715f('0x25')](function(_0x5c630e){if(_0x5c630e&&_0x5c630e[_0x715f('0x64')]===0x0){return db[_0x715f('0x3d')]['create']({'name':_0x48aabf[_0x715f('0x3f')],'resourceId':_0x48aabf['id'],'type':_0x5c630e[_0x715f('0x3f')],'sectionId':_0x5c630e['id']},{})['then'](function(){return _0x2c9075;});}else{return _0x2c9075;}})[_0x715f('0x2f')](function(_0x58e077){logger[_0x715f('0x2c')](_0x715f('0x65'),_0x58e077);throw _0x58e077;});}return _0x2c9075;})[_0x715f('0x25')](respondWithResult(_0x535365,0xc9))[_0x715f('0x2f')](handleError(_0x535365,null));};exports[_0x715f('0x66')]=function(_0x176a1f,_0x5287e5){if(_0x176a1f[_0x715f('0x5e')]['id']){delete _0x176a1f[_0x715f('0x5e')]['id'];}return db[_0x715f('0x43')]['find']({'where':{'id':_0x176a1f['params']['id']}})[_0x715f('0x25')](handleEntityNotFound(_0x5287e5,null))['then'](saveUpdates(_0x176a1f[_0x715f('0x5e')],null))[_0x715f('0x25')](respondWithResult(_0x5287e5,null))[_0x715f('0x2f')](handleError(_0x5287e5,null));};exports[_0x715f('0x3e')]=function(_0x57180d,_0x21ee82){return db[_0x715f('0x43')][_0x715f('0x62')]({'where':{'id':_0x57180d[_0x715f('0x5a')]['id']}})[_0x715f('0x25')](handleEntityNotFound(_0x21ee82,null))[_0x715f('0x25')](removeEntity(_0x21ee82,null))[_0x715f('0x2f')](handleError(_0x21ee82,null));};exports[_0x715f('0x67')]=function(_0x4495e3,_0x4cfefe){return db[_0x715f('0x43')]['describe']()['then'](respondWithResult(_0x4cfefe,null))[_0x715f('0x2f')](handleError(_0x4cfefe,null));};exports[_0x715f('0x68')]=function(_0x136325,_0x363ce0,_0x40c4fd){var _0x50cb61={'raw':!![],'where':{}},_0x317c47={},_0x323325;return db[_0x715f('0x43')][_0x715f('0x69')]({'where':{'id':_0x136325[_0x715f('0x5a')]['id']}})[_0x715f('0x25')](handleEntityNotFound(_0x363ce0,null))[_0x715f('0x25')](function(_0x20b1e1){if(_0x20b1e1){_0x323325=_0x20b1e1['get']({'plain':!![]});_0x317c47['model']=_[_0x715f('0x4a')](db['UserChatQueue'][_0x715f('0x44')]);_0x317c47[_0x715f('0x49')]=_['keys'](_0x136325[_0x715f('0x49')]);_0x317c47['filters']=_['intersection'](_0x317c47[_0x715f('0x48')],_0x317c47[_0x715f('0x49')]);_0x50cb61[_0x715f('0x4d')]=_[_0x715f('0x4c')](_0x317c47[_0x715f('0x48')],qs[_0x715f('0x4e')](_0x136325[_0x715f('0x49')]['fields']));_0x50cb61[_0x715f('0x4d')]=_0x50cb61[_0x715f('0x4d')]['length']?_0x50cb61[_0x715f('0x4d')]:_0x317c47[_0x715f('0x48')];if(!_0x136325[_0x715f('0x49')][_0x715f('0x4f')](_0x715f('0x6a'))){_0x50cb61['limit']=qs['limit'](_0x136325[_0x715f('0x49')]['limit']);_0x50cb61['offset']=qs[_0x715f('0x35')](_0x136325[_0x715f('0x49')][_0x715f('0x35')]);}_0x50cb61['order']=qs[_0x715f('0x51')](_0x136325[_0x715f('0x49')][_0x715f('0x51')]);_0x50cb61[_0x715f('0x52')]=qs[_0x715f('0x4b')](_[_0x715f('0x53')](_0x136325[_0x715f('0x49')],_0x317c47['filters']));_0x50cb61['where']['ChatQueueId']=_0x20b1e1['id'];if(_0x136325[_0x715f('0x49')]['filter']){_0x50cb61[_0x715f('0x52')]=_[_0x715f('0x55')](_0x50cb61[_0x715f('0x52')],{'$or':_[_0x715f('0x42')](_0x50cb61['attributes'],function(_0x504336){var _0x4d83dc={};_0x4d83dc[_0x504336]={'$like':'%'+_0x136325[_0x715f('0x49')][_0x715f('0x54')]+'%'};return _0x4d83dc;})});}_0x50cb61=_[_0x715f('0x55')]({},_0x50cb61,_0x136325[_0x715f('0x5c')]);return db[_0x715f('0x6b')][_0x715f('0x58')](_0x50cb61);}})['then'](function(_0x534b71){if(_0x534b71){return db[_0x715f('0x6c')][_0x715f('0x6d')]({'where':{'id':_[_0x715f('0x42')](_0x534b71,_0x715f('0x6e')),'role':'agent'},'attributes':['id',_0x715f('0x3f'),'chatPause',_0x715f('0x6f'),_0x715f('0x70')]});}})['then'](function(_0xbb315c){if(_0xbb315c){return{'count':_0xbb315c[_0x715f('0x34')],'rows':_[_0x715f('0x42')](_0xbb315c[_0x715f('0x71')],function(_0x1579dd){return{'membername':_0x1579dd['name'],'UserId':_0x1579dd['id'],'queue_name':_0x323325[_0x715f('0x3f')],'ChatQueueId':_0x323325['id'],'interface':util[_0x715f('0x72')](_0x715f('0x73'),_0x715f('0x74'),_0x1579dd['name']),'penalty':0x0,'paused':_0x1579dd['chatPause'],'createdAt':_0x1579dd[_0x715f('0x70')],'updatedAt':_0x1579dd['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x715f('0x25')](respondWithFilteredResult(_0x363ce0,_0x50cb61))[_0x715f('0x2f')](handleError(_0x363ce0,null));};exports[_0x715f('0x75')]=function(_0x561a37,_0x3d6a02,_0x120927){var _0x524795={};var _0x48f79a={};var _0x250269;var _0x48af7f;return db[_0x715f('0x43')][_0x715f('0x69')]({'where':{'id':_0x561a37['params']['id']}})['then'](handleEntityNotFound(_0x3d6a02,null))[_0x715f('0x25')](function(_0x5b55c6){if(_0x5b55c6){_0x250269=_0x5b55c6;_0x48f79a['model']=_[_0x715f('0x4a')](db[_0x715f('0x76')][_0x715f('0x44')]);_0x48f79a[_0x715f('0x49')]=_[_0x715f('0x4a')](_0x561a37['query']);_0x48f79a[_0x715f('0x4b')]=_[_0x715f('0x4c')](_0x48f79a[_0x715f('0x48')],_0x48f79a['query']);_0x524795[_0x715f('0x4d')]=_[_0x715f('0x4c')](_0x48f79a['model'],qs[_0x715f('0x4e')](_0x561a37[_0x715f('0x49')][_0x715f('0x4e')]));_0x524795[_0x715f('0x4d')]=_0x524795['attributes'][_0x715f('0x5b')]?_0x524795[_0x715f('0x4d')]:_0x48f79a[_0x715f('0x48')];_0x524795[_0x715f('0x50')]=qs[_0x715f('0x51')](_0x561a37[_0x715f('0x49')]['sort']);_0x524795[_0x715f('0x52')]=qs[_0x715f('0x4b')](_[_0x715f('0x53')](_0x561a37[_0x715f('0x49')],_0x48f79a[_0x715f('0x4b')]));if(_0x561a37[_0x715f('0x49')][_0x715f('0x54')]){_0x524795['where']=_[_0x715f('0x55')](_0x524795[_0x715f('0x52')],{'$or':_[_0x715f('0x42')](_0x524795[_0x715f('0x4d')],function(_0x3e602b){var _0x5c62aa={};_0x5c62aa[_0x3e602b]={'$like':'%'+_0x561a37[_0x715f('0x49')][_0x715f('0x54')]+'%'};return _0x5c62aa;})});}_0x524795=_[_0x715f('0x55')]({},_0x524795,_0x561a37['options']);return _0x250269['getTeams'](_0x524795);}})['then'](function(_0x29b8d1){if(_0x29b8d1){_0x48af7f=_0x29b8d1[_0x715f('0x5b')];if(!_0x561a37[_0x715f('0x49')][_0x715f('0x4f')]('nolimit')){_0x524795[_0x715f('0x36')]=qs[_0x715f('0x36')](_0x561a37[_0x715f('0x49')][_0x715f('0x36')]);_0x524795[_0x715f('0x35')]=qs[_0x715f('0x35')](_0x561a37[_0x715f('0x49')]['offset']);}return _0x250269[_0x715f('0x75')](_0x524795);}})[_0x715f('0x25')](function(_0x558818){if(_0x558818){return _0x558818?{'count':_0x48af7f,'rows':_0x558818}:null;}})['then'](respondWithResult(_0x3d6a02,null))[_0x715f('0x2f')](handleError(_0x3d6a02,null));};exports[_0x715f('0x77')]=function(_0x51d3b6,_0x1b80ff,_0x5ad9f9){var _0x4d43b6=_0x51d3b6[_0x715f('0x5e')][_0x715f('0x78')];return db[_0x715f('0x76')][_0x715f('0x58')]({'where':{'id':_0x4d43b6},'attributes':['id'],'include':[{'model':db[_0x715f('0x6c')],'as':'Agents','attributes':['id',_0x715f('0x3f'),_0x715f('0x79'),_0x715f('0x7a'),_0x715f('0x7b')],'raw':!![]}]})['then'](function(_0x5c3518){if(_0x5c3518){var _0xd5511c=_[_0x715f('0x7c')](_0x5c3518,function(_0x14c697){var _0x75acce=_0x14c697[_0x715f('0x3c')]({'plain':!![]});return _0x75acce[_0x715f('0x7d')];});return db['ChatQueue']['find']({'where':{'id':_0x51d3b6[_0x715f('0x5a')]['id']}})[_0x715f('0x25')](function(_0x68d8){return db['sequelize'][_0x715f('0x7e')](function(_0x3b2792){return _0x68d8[_0x715f('0x77')](_0x4d43b6,{'transaction':_0x3b2792})[_0x715f('0x25')](function(){return BPromise[_0x715f('0x7f')](_0xd5511c,function(_0x32984c){return db[_0x715f('0x6b')][_0x715f('0x80')]({'where':{'UserId':_0x32984c['id'],'ChatQueueId':_0x51d3b6['params']['id']},'transaction':_0x3b2792});});})[_0x715f('0x25')](function(){_0xd5511c[_0x715f('0x81')](function(_0x3651f0){socket['emit'](_0x715f('0x82'),{'UserId':_0x3651f0['id'],'ChatQueueId':_0x68d8['id']});});});});});}})[_0x715f('0x25')](respondWithStatusCode(_0x1b80ff,null))[_0x715f('0x2f')](handleError(_0x1b80ff,null));};exports['removeTeams']=function(_0x4099e5,_0x5c5b33,_0x3d114b){return db[_0x715f('0x76')][_0x715f('0x58')]({'where':{'id':_0x4099e5[_0x715f('0x49')][_0x715f('0x78')]},'attributes':['id'],'include':[{'model':db[_0x715f('0x6c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x715f('0x25')](handleEntityNotFound(_0x5c5b33,null))['then'](function(_0x2f2149){var _0x5a2830=_[_0x715f('0x42')](_0x2f2149,'id');var _0x1d3ab3=[];var _0x3f68b7=[];var _0x89609e=squel['select']();_0x89609e[_0x715f('0x83')](_0x715f('0x84'))[_0x715f('0x85')]('team_has_chat_queues','tq')[_0x715f('0x86')]('user_has_teams','ut',_0x715f('0x87'))[_0x715f('0x52')](_0x715f('0x88'),_0x4099e5[_0x715f('0x5a')]['id']);for(var _0x25fc36=0x0;_0x25fc36<_0x2f2149[_0x715f('0x5b')];_0x25fc36+=0x1){let _0x3fda11=_0x2f2149[_0x25fc36];for(var _0x49a801=0x0;_0x49a801<_0x3fda11[_0x715f('0x7d')][_0x715f('0x5b')];_0x49a801+=0x1){let _0x51dad7=_0x3fda11['Agents'][_0x49a801];var _0x41bfc3=_0x89609e[_0x715f('0x89')]();_0x41bfc3[_0x715f('0x52')](_0x715f('0x8a'),_0x51dad7['id']);_0x3f68b7[_0x715f('0x8b')](db[_0x715f('0x8c')][_0x715f('0x49')](_0x41bfc3['toString'](),{'type':db['sequelize'][_0x715f('0x8d')]['SELECT']})[_0x715f('0x25')](function(_0xbf7d65){if(_0xbf7d65[_0x715f('0x5b')]===0x1){return _0x51dad7['id'];}else{var _0x301c8f=_[_0x715f('0x8e')](_[_0x715f('0x42')](_0xbf7d65,'TeamId'),function(_0x305c42){return _[_0x715f('0x8f')](_0x5a2830,_0x305c42);});if(_0x301c8f){return _0x51dad7['id'];}}}));}}return BPromise[_0x715f('0x90')](_0x3f68b7)['then'](function(_0x44bba0){_0x1d3ab3=_(_0x1d3ab3)[_0x715f('0x91')](_0x44bba0)[_0x715f('0x92')]()[_0x715f('0x93')]();return db[_0x715f('0x43')][_0x715f('0x62')]({'where':{'id':_0x4099e5['params']['id']}})[_0x715f('0x25')](function(_0x4b7b07){return db[_0x715f('0x8c')][_0x715f('0x7e')](function(_0x36e557){return _0x4b7b07['removeTeams'](_0x4099e5[_0x715f('0x49')][_0x715f('0x78')],{'transaction':_0x36e557})[_0x715f('0x25')](function(){if(!_[_0x715f('0x94')](_0x1d3ab3)){return _0x4b7b07[_0x715f('0x95')](_0x1d3ab3,{'transaction':_0x36e557});}})[_0x715f('0x25')](function(){_0x1d3ab3[_0x715f('0x81')](function(_0x316cbd){socket[_0x715f('0x96')]('userChatQueue:remove',{'UserId':_0x316cbd,'ChatQueueId':_0x4b7b07['id']});});});});});});})['then'](respondWithStatusCode(_0x5c5b33,null))[_0x715f('0x2f')](handleError(_0x5c5b33,null));};exports['addAgents']=function(_0x27ffef,_0x1d9d3e,_0x5e2c79){return db[_0x715f('0x43')][_0x715f('0x62')]({'where':{'id':_0x27ffef[_0x715f('0x5a')]['id']}})[_0x715f('0x25')](handleEntityNotFound(_0x1d9d3e,null))[_0x715f('0x25')](function(_0x1d9352){if(_0x1d9352){return _0x1d9352[_0x715f('0x97')](_0x27ffef[_0x715f('0x5e')][_0x715f('0x78')],_[_0x715f('0x98')](_0x27ffef[_0x715f('0x5e')],[_0x715f('0x78'),'id'])||{})[_0x715f('0x99')](function(_0x506fe9){for(var _0x2d4f7e=0x0;_0x2d4f7e<_0x27ffef[_0x715f('0x5e')]['ids']['length'];_0x2d4f7e+=0x1){socket[_0x715f('0x96')](_0x715f('0x82'),{'UserId':_0x27ffef[_0x715f('0x5e')][_0x715f('0x78')][_0x2d4f7e],'ChatQueueId':_0x27ffef[_0x715f('0x5a')]['id']});}return _0x506fe9;});}})['then'](respondWithResult(_0x1d9d3e,null))[_0x715f('0x2f')](handleError(_0x1d9d3e,null));};exports['removeAgents']=function(_0x17560e,_0x572011,_0x8bb7a3){return db[_0x715f('0x43')][_0x715f('0x62')]({'where':{'id':_0x17560e[_0x715f('0x5a')]['id']}})[_0x715f('0x25')](handleEntityNotFound(_0x572011,null))[_0x715f('0x25')](function(_0x589a6c){if(_0x589a6c){return _0x589a6c['removeAgents'](_0x17560e[_0x715f('0x49')][_0x715f('0x78')])[_0x715f('0x25')](function(){if(_[_0x715f('0x9a')](_0x17560e[_0x715f('0x49')][_0x715f('0x78')])){for(var _0x1dcb4e=0x0;_0x1dcb4e<_0x17560e['query'][_0x715f('0x78')][_0x715f('0x5b')];_0x1dcb4e+=0x1){socket[_0x715f('0x96')](_0x715f('0x9b'),{'UserId':Number(_0x17560e[_0x715f('0x49')][_0x715f('0x78')][_0x1dcb4e]),'ChatQueueId':Number(_0x17560e[_0x715f('0x5a')]['id'])});}}else{socket[_0x715f('0x96')](_0x715f('0x9b'),{'UserId':Number(_0x17560e[_0x715f('0x49')]['ids']),'ChatQueueId':Number(_0x17560e[_0x715f('0x5a')]['id'])});}});}})[_0x715f('0x25')](respondWithStatusCode(_0x572011,null))[_0x715f('0x2f')](handleError(_0x572011,null));};exports[_0x715f('0x9c')]=function(_0x7214b4,_0x251487,_0x1698ac){var _0x53655d={};var _0x4968f7={};var _0x13dc88;var _0x44a9cb;return db[_0x715f('0x43')]['findOne']({'where':{'id':_0x7214b4[_0x715f('0x5a')]['id']}})[_0x715f('0x25')](handleEntityNotFound(_0x251487,null))[_0x715f('0x25')](function(_0x2d75f7){if(_0x2d75f7){_0x13dc88=_0x2d75f7;_0x4968f7['model']=_[_0x715f('0x4a')](db['User'][_0x715f('0x44')]);_0x4968f7[_0x715f('0x49')]=_['keys'](_0x7214b4[_0x715f('0x49')]);_0x4968f7['filters']=_[_0x715f('0x4c')](_0x4968f7[_0x715f('0x48')],_0x4968f7[_0x715f('0x49')]);_0x53655d[_0x715f('0x4d')]=_[_0x715f('0x4c')](_0x4968f7[_0x715f('0x48')],qs[_0x715f('0x4e')](_0x7214b4['query'][_0x715f('0x4e')]));_0x53655d['attributes']=_0x53655d['attributes'][_0x715f('0x5b')]?_0x53655d[_0x715f('0x4d')]:_0x4968f7[_0x715f('0x48')];_0x53655d[_0x715f('0x50')]=qs[_0x715f('0x51')](_0x7214b4['query']['sort']);_0x53655d[_0x715f('0x52')]=qs[_0x715f('0x4b')](_[_0x715f('0x53')](_0x7214b4[_0x715f('0x49')],_0x4968f7[_0x715f('0x4b')]));if(_0x7214b4['query'][_0x715f('0x54')]){_0x53655d['where']=_[_0x715f('0x55')](_0x53655d['where'],{'$or':_[_0x715f('0x42')](_0x53655d[_0x715f('0x4d')],function(_0x439fa7){var _0x32b53b={};_0x32b53b[_0x439fa7]={'$like':'%'+_0x7214b4[_0x715f('0x49')][_0x715f('0x54')]+'%'};return _0x32b53b;})});}_0x53655d=_[_0x715f('0x55')]({},_0x53655d,_0x7214b4[_0x715f('0x5c')]);return _0x13dc88[_0x715f('0x9c')](_0x53655d);}})[_0x715f('0x25')](function(_0x1e3b58){if(_0x1e3b58){_0x44a9cb=_0x1e3b58['length'];if(!_0x7214b4[_0x715f('0x49')][_0x715f('0x4f')](_0x715f('0x6a'))){_0x53655d[_0x715f('0x36')]=qs['limit'](_0x7214b4['query'][_0x715f('0x36')]);_0x53655d['offset']=qs['offset'](_0x7214b4[_0x715f('0x49')][_0x715f('0x35')]);}return _0x13dc88[_0x715f('0x9c')](_0x53655d);}})[_0x715f('0x25')](function(_0x29bfb9){if(_0x29bfb9){return _0x29bfb9?{'count':_0x44a9cb,'rows':_0x29bfb9}:null;}})[_0x715f('0x25')](respondWithResult(_0x251487,null))[_0x715f('0x2f')](handleError(_0x251487,null));};
\ No newline at end of file