Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / userProfile / userProfile.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x611f=['vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','intervals','Pause','scheduler','sounds','Sound','templates','Template','triggers','Trigger','trunks','plugins','Reports','metrics','AnalyticMetric','WhatsappAccount','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','UserProfile','findAll','rows','catch','show','params','includeAll','create','body','clone','include','get','omit','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','createdAt','userProfileId','Resources','find','addSections','each','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','Dashboard','forEach','resourceId','Plugin','addResources','removeResources','getResources','section','undefined','Unknown\x20section','mergeResources','childModel','Sequelize','ValidationError','Invalid\x20section\x20\x27','parentSections','findOne','all','union','field','AnalyticExtractedReport','foreignKey','associatedResources','default','DefaultReports','reportId','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','lists','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','QueueCampaigns','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','teams','voicequeues','telephones','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount'];(function(_0x2f121d,_0x19969f){var _0x5dae6f=function(_0xa2ece8){while(--_0xa2ece8){_0x2f121d['push'](_0x2f121d['shift']());}};_0x5dae6f(++_0x19969f);}(_0x611f,0xff));var _0xf611=function(_0x21bfaf,_0x32fd3e){_0x21bfaf=_0x21bfaf-0x0;var _0x1f2eef=_0x611f[_0x21bfaf];return _0x1f2eef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf611('0x0'));var rimraf=require(_0xf611('0x1'));var zipdir=require(_0xf611('0x2'));var jsonpatch=require(_0xf611('0x3'));var rp=require('request-promise');var moment=require(_0xf611('0x4'));var BPromise=require(_0xf611('0x5'));var Mustache=require(_0xf611('0x6'));var util=require(_0xf611('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf611('0x8'));var ejs=require(_0xf611('0x9'));var fs=require('fs');var _=require(_0xf611('0xa'));var squel=require('squel');var crypto=require(_0xf611('0xb'));var jsforce=require(_0xf611('0xc'));var deskjs=require(_0xf611('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf611('0xe'));var Papa=require(_0xf611('0xf'));var Redis=require('ioredis');var authService=require(_0xf611('0x10'));var qs=require(_0xf611('0x11'));var as=require(_0xf611('0x12'));var hardwareService=require(_0xf611('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xf611('0x14'));var config=require('../../config/environment');var db=require(_0xf611('0x15'))['db'];config[_0xf611('0x16')]=_[_0xf611('0x17')](config[_0xf611('0x16')],{'host':_0xf611('0x18'),'port':0x18eb});var socket=require(_0xf611('0x19'))(new Redis(config[_0xf611('0x16')]));require('./userProfile.socket')[_0xf611('0x1a')](socket);function respondWithStatusCode(_0xbca647,_0x858dda){_0x858dda=_0x858dda||0xcc;return function(_0x72a566){if(_0x72a566){return _0xbca647[_0xf611('0x1b')](_0x858dda);}return _0xbca647[_0xf611('0x1c')](_0x858dda)[_0xf611('0x1d')]();};}function respondWithResult(_0x36e14c,_0x40853f){_0x40853f=_0x40853f||0xc8;return function(_0x55a92a){if(_0x55a92a){return _0x36e14c[_0xf611('0x1c')](_0x40853f)[_0xf611('0x1e')](_0x55a92a);}};}function respondWithFilteredResult(_0x49bd08,_0x3ea15a){return function(_0x255044){if(_0x255044){var _0x1ce76b=_0x255044[_0xf611('0x1f')],_0x1146d4=_0x3ea15a[_0xf611('0x20')],_0x229fc2=_0x3ea15a[_0xf611('0x20')]+_0x3ea15a[_0xf611('0x21')],_0x5db45e;if(_0x229fc2>=_0x1ce76b){_0x229fc2=_0x1ce76b;_0x5db45e=0xc8;}else{_0x5db45e=0xce;}_0x49bd08[_0xf611('0x1c')](_0x5db45e);return _0x49bd08['set'](_0xf611('0x22'),_0x1146d4+'-'+_0x229fc2+'/'+_0x1ce76b)[_0xf611('0x1e')](_0x255044);}return null;};}function patchUpdates(_0x3cdad9){return function(_0x2db338){try{jsonpatch[_0xf611('0x23')](_0x2db338,_0x3cdad9,!![]);}catch(_0x368e09){return BPromise[_0xf611('0x24')](_0x368e09);}return _0x2db338[_0xf611('0x25')]();};}function saveUpdates(_0x4cdba1,_0x2fd47){return function(_0x2486ad){if(_0x2486ad){return _0x2486ad[_0xf611('0x26')](_0x4cdba1)[_0xf611('0x27')](function(_0x487b4e){return _0x487b4e;});}return null;};}function removeEntity(_0xd76ac6,_0x39ab0c){return function(_0x49aa44){if(_0x49aa44){return _0x49aa44[_0xf611('0x28')]()[_0xf611('0x27')](function(){_0xd76ac6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x18396f,_0x3b3dba){return function(_0x5c40b9){if(!_0x5c40b9){_0x18396f[_0xf611('0x1b')](0x194);}return _0x5c40b9;};}function handleError(_0x41b58d,_0xc22f3a){_0xc22f3a=_0xc22f3a||0x1f4;return function(_0x103a53){logger[_0xf611('0x29')](_0x103a53[_0xf611('0x2a')]);if(_0x103a53[_0xf611('0x2b')]){delete _0x103a53[_0xf611('0x2b')];}_0x41b58d['status'](_0xc22f3a)[_0xf611('0x2c')](_0x103a53);};}exports[_0xf611('0x2d')]=function(_0x4b7da0,_0x172c23){var _0x29f4fd={},_0x400214={},_0x24bf30={'count':0x0,'rows':[]};var _0x38eb1c=_[_0xf611('0x2e')](db['UserProfile'][_0xf611('0x2f')],function(_0xb52699){return{'name':_0xb52699[_0xf611('0x30')],'type':_0xb52699[_0xf611('0x31')][_0xf611('0x32')]};});_0x400214[_0xf611('0x33')]=_[_0xf611('0x2e')](_0x38eb1c,_0xf611('0x2b'));_0x400214[_0xf611('0x34')]=_[_0xf611('0x35')](_0x4b7da0[_0xf611('0x34')]);_0x400214[_0xf611('0x36')]=_[_0xf611('0x37')](_0x400214[_0xf611('0x33')],_0x400214['query']);_0x29f4fd[_0xf611('0x38')]=_[_0xf611('0x37')](_0x400214[_0xf611('0x33')],qs[_0xf611('0x39')](_0x4b7da0[_0xf611('0x34')]['fields']));_0x29f4fd[_0xf611('0x38')]=_0x29f4fd['attributes'][_0xf611('0x3a')]?_0x29f4fd['attributes']:_0x400214[_0xf611('0x33')];if(!_0x4b7da0['query'][_0xf611('0x3b')](_0xf611('0x3c'))){_0x29f4fd[_0xf611('0x21')]=qs['limit'](_0x4b7da0['query']['limit']);_0x29f4fd['offset']=qs[_0xf611('0x20')](_0x4b7da0[_0xf611('0x34')]['offset']);}_0x29f4fd[_0xf611('0x3d')]=qs[_0xf611('0x3e')](_0x4b7da0[_0xf611('0x34')][_0xf611('0x3e')]);_0x29f4fd[_0xf611('0x3f')]=qs['filters'](_[_0xf611('0x40')](_0x4b7da0[_0xf611('0x34')],_0x400214[_0xf611('0x36')]),_0x38eb1c);if(_0x4b7da0[_0xf611('0x34')][_0xf611('0x41')]){_0x29f4fd[_0xf611('0x3f')]=_[_0xf611('0x42')](_0x29f4fd[_0xf611('0x3f')],{'$or':_[_0xf611('0x2e')](_0x38eb1c,function(_0x21e138){if(_0x21e138[_0xf611('0x31')]!==_0xf611('0x43')){var _0x5d0706={};_0x5d0706[_0x21e138[_0xf611('0x2b')]]={'$like':'%'+_0x4b7da0['query'][_0xf611('0x41')]+'%'};return _0x5d0706;}})});}_0x29f4fd=_[_0xf611('0x42')]({},_0x29f4fd,_0x4b7da0[_0xf611('0x44')]);var _0x576f63={'where':_0x29f4fd[_0xf611('0x3f')]};return db['UserProfile']['count'](_0x576f63)['then'](function(_0x650f17){_0x24bf30[_0xf611('0x1f')]=_0x650f17;if(_0x4b7da0[_0xf611('0x34')]['includeAll']){_0x29f4fd['include']=[{'all':!![]}];}return db[_0xf611('0x45')][_0xf611('0x46')](_0x29f4fd);})[_0xf611('0x27')](function(_0x4440b9){_0x24bf30[_0xf611('0x47')]=_0x4440b9;return _0x24bf30;})[_0xf611('0x27')](respondWithFilteredResult(_0x172c23,_0x29f4fd))[_0xf611('0x48')](handleError(_0x172c23,null));};exports[_0xf611('0x49')]=function(_0x5314b6,_0x565dd4){var _0x2d3896={'raw':![],'where':{'id':_0x5314b6[_0xf611('0x4a')]['id']}},_0x5c9616={};_0x5c9616[_0xf611('0x33')]=_[_0xf611('0x35')](db[_0xf611('0x45')][_0xf611('0x2f')]);_0x5c9616['query']=_[_0xf611('0x35')](_0x5314b6[_0xf611('0x34')]);_0x5c9616[_0xf611('0x36')]=_[_0xf611('0x37')](_0x5c9616[_0xf611('0x33')],_0x5c9616[_0xf611('0x34')]);_0x2d3896[_0xf611('0x38')]=_[_0xf611('0x37')](_0x5c9616['model'],qs[_0xf611('0x39')](_0x5314b6[_0xf611('0x34')][_0xf611('0x39')]));_0x2d3896[_0xf611('0x38')]=_0x2d3896[_0xf611('0x38')][_0xf611('0x3a')]?_0x2d3896['attributes']:_0x5c9616['model'];if(_0x5314b6[_0xf611('0x34')][_0xf611('0x4b')]){_0x2d3896['include']=[{'all':!![]}];}_0x2d3896=_[_0xf611('0x42')]({},_0x2d3896,_0x5314b6[_0xf611('0x44')]);return db[_0xf611('0x45')]['find'](_0x2d3896)[_0xf611('0x27')](handleEntityNotFound(_0x565dd4,null))[_0xf611('0x27')](respondWithResult(_0x565dd4,null))[_0xf611('0x48')](handleError(_0x565dd4,null));};exports[_0xf611('0x4c')]=function(_0x1dd6b3,_0x4c3564){return db[_0xf611('0x45')][_0xf611('0x4c')](_0x1dd6b3[_0xf611('0x4d')],{})['then'](respondWithResult(_0x4c3564,0xc9))[_0xf611('0x48')](handleError(_0x4c3564,null));};exports[_0xf611('0x4e')]=function(_0x3b4ab1,_0x11d86f){var _0xef0a6a={'where':{'id':_0x3b4ab1['params']['id']}},_0x237112={};_0x237112[_0xf611('0x33')]=_[_0xf611('0x35')](db[_0xf611('0x45')]['rawAttributes']);_0xef0a6a[_0xf611('0x38')]=_['intersection'](_0x237112['model'],qs[_0xf611('0x39')](_0x3b4ab1[_0xf611('0x34')][_0xf611('0x39')]));_0xef0a6a['attributes']=_0xef0a6a['attributes'][_0xf611('0x3a')]?_0xef0a6a[_0xf611('0x38')]:_0x237112['model'];if(_0x3b4ab1[_0xf611('0x34')][_0xf611('0x4b')]){_0xef0a6a[_0xf611('0x4f')]=[{'all':!![]}];}_0xef0a6a=_[_0xf611('0x42')]({},_0xef0a6a,_0x3b4ab1['options']);return db[_0xf611('0x45')]['find'](_0xef0a6a)[_0xf611('0x27')](handleEntityNotFound(_0x11d86f,null))[_0xf611('0x27')](function(_0x3dc403){if(_0x3dc403){var _0x16b21a=_0x3dc403[_0xf611('0x50')]({'plain':!![]});_0x16b21a=qs[_0xf611('0x51')](_0x16b21a,['id','createdAt',_0xf611('0x52'),_0xf611('0x53')]);_0x3b4ab1['body']=_[_0xf611('0x51')](_0x3b4ab1[_0xf611('0x4d')],['id','createdAt',_0xf611('0x52')]);return db[_0xf611('0x54')][_0xf611('0x55')](function(_0x46b2cf){return db[_0xf611('0x45')][_0xf611('0x4c')](_[_0xf611('0x42')](_0x16b21a,_0x3b4ab1[_0xf611('0x4d')]),{'include':_0x3b4ab1[_0xf611('0x34')][_0xf611('0x4b')]?[{'all':!![]}]:undefined,'transaction':_0x46b2cf})[_0xf611('0x27')](function(_0x43b286){var _0x454f2f=_0x43b286[_0xf611('0x50')]({'plain':!![]});return db[_0xf611('0x56')][_0xf611('0x46')]({'where':{'userProfileId':_0x3b4ab1['params']['id']},'raw':!![]})[_0xf611('0x27')](function(_0x3af839){if(_0x3af839){return BPromise['each'](_0x3af839,function(_0x1bbdda){return new BPromise(function(_0x4a0301,_0x1d9a0a){if(_0x1bbdda[_0xf611('0x57')]===null||_0x1bbdda[_0xf611('0x57')]===0x1)_0x4a0301(null);return db[_0xf611('0x58')][_0xf611('0x46')]({'where':{'sectionId':_0x1bbdda['id']},'raw':!![]})[_0xf611('0x27')](function(_0x82ce38){var _0x28f990=_[_0xf611('0x2e')](_0x82ce38,function(_0xd21ed0){return qs[_0xf611('0x51')](_0xd21ed0,['id','createdAt',_0xf611('0x52'),_0xf611('0x59')]);});_0x4a0301(_0x28f990);})[_0xf611('0x48')](function(_0x173a83){_0x1d9a0a(_0x173a83);});})[_0xf611('0x27')](function(_0x4f7774){var _0x26d251=qs[_0xf611('0x51')](_0x1bbdda,['id',_0xf611('0x5a'),'updatedAt']);_0x26d251[_0xf611('0x5b')]=_0x454f2f['id'];if(_0x4f7774)_0x26d251[_0xf611('0x5c')]=_0x4f7774;return _0x26d251;})[_0xf611('0x27')](function(_0x3e12d0){return db['UserProfileSection']['create'](_0x3e12d0,{'include':[{'model':db['UserProfileResource'],'as':_0xf611('0x5c')}],'raw':!![],'transaction':_0x46b2cf});});})['then'](function(){return _0x454f2f;});}});});});}})[_0xf611('0x27')](respondWithResult(_0x11d86f,0xc9))[_0xf611('0x48')](handleError(_0x11d86f,null));};exports[_0xf611('0x26')]=function(_0x5ec3d4,_0x2daf72){if(_0x5ec3d4[_0xf611('0x4d')]['id']){delete _0x5ec3d4[_0xf611('0x4d')]['id'];}return db['UserProfile'][_0xf611('0x5d')]({'where':{'id':_0x5ec3d4[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x2daf72,null))[_0xf611('0x27')](saveUpdates(_0x5ec3d4[_0xf611('0x4d')],null))[_0xf611('0x27')](respondWithResult(_0x2daf72,null))[_0xf611('0x48')](handleError(_0x2daf72,null));};exports['destroy']=function(_0x3812db,_0x175e5d){return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x3812db[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x175e5d,null))[_0xf611('0x27')](removeEntity(_0x175e5d,null))['catch'](handleError(_0x175e5d,null));};exports['describe']=function(_0x5d6faa,_0x2a4c1c){return db['UserProfile']['describe']()['then'](respondWithResult(_0x2a4c1c,null))[_0xf611('0x48')](handleError(_0x2a4c1c,null));};exports[_0xf611('0x5e')]=function(_0x4b2b52,_0xe17982){var _0x39b351=_0x4b2b52[_0xf611('0x4d')];return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x4b2b52['params']['id']}})['then'](handleEntityNotFound(_0xe17982,null))[_0xf611('0x27')](function(_0x11cac0){if(_0x11cac0){return db[_0xf611('0x54')][_0xf611('0x55')](function(_0x439887){return db[_0xf611('0x56')]['destroy']({'where':{'userProfileId':_0x4b2b52[_0xf611('0x4a')]['id'],'sectionId':_['map'](_0x39b351,function(_0x133c2a){return _0x133c2a[_0xf611('0x59')];})},'transaction':_0x439887})[_0xf611('0x27')](function(){var _0x732842=_[_0xf611('0x2e')](_0x39b351,function(_0x295b13){_0x295b13[_0xf611('0x5b')]=_0x4b2b52[_0xf611('0x4a')]['id'];return _0x295b13;});var _0x23d118=[];return BPromise[_0xf611('0x5f')](_0x732842,function(_0x7414a2){return db['UserProfileSection'][_0xf611('0x4c')](_0x7414a2,{'include':[{'model':db['UserProfileResource'],'as':_0xf611('0x5c')}],'raw':!![],'transaction':_0x439887})['then'](function(_0xcb261e){_0x23d118[_0xf611('0x60')](_0xcb261e[_0xf611('0x50')]({'plain':!![]}));});})[_0xf611('0x27')](function(){return _0x23d118;});});});}})[_0xf611('0x27')](function(_0x5410c1){return _0x5410c1;})[_0xf611('0x27')](respondWithResult(_0xe17982,null))['catch'](handleError(_0xe17982,null));};exports[_0xf611('0x61')]=function(_0x3e8e4c,_0x164547){var _0x5ef962;return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x3e8e4c['params']['id']},'attributes':['id',_0xf611('0x2b')]})[_0xf611('0x27')](handleEntityNotFound(_0x164547,null))['then'](function(_0xa0a665){if(_0xa0a665){_0x5ef962=_0xa0a665;return db[_0xf611('0x56')][_0xf611('0x28')]({'where':{'userProfileId':_0x3e8e4c[_0xf611('0x4a')]['id'],'sectionId':_0x3e8e4c[_0xf611('0x34')][_0xf611('0x62')]}});}})['then'](function(){return _0x5ef962;})[_0xf611('0x27')](respondWithStatusCode(_0x164547,null))[_0xf611('0x48')](handleError(_0x164547,null));};exports[_0xf611('0x63')]=function(_0x33bac5,_0x1f4507){var _0x1ced65=[];var _0x5b9eb7=[];return db[_0xf611('0x56')]['findAll']({'where':{'userProfileId':_0x33bac5[_0xf611('0x4a')]['id']},'raw':!![]})[_0xf611('0x27')](function(_0x45089b){_0x1ced65=_['filter'](_0x45089b,function(_0x407eff){return _0x407eff[_0xf611('0x64')]===0x1||_['includes']([0x3eb,0x709],_0x407eff[_0xf611('0x59')]);});if(!_[_0xf611('0x65')](_0x1ced65)){return _[_0xf611('0x2e')](_0x1ced65,function(_0x3fee9b){return _0x3fee9b[_0xf611('0x59')];});}else{return;}})['then'](function(_0x6e7fc3){if(_0x6e7fc3)_0x5b9eb7=_0x6e7fc3;if(_[_0xf611('0x66')](_0x5b9eb7,0x64)){var _0x3bacc2=_[_0xf611('0x5d')](_0x1ced65,{'sectionId':0x64});return hasDefaultDashboard(_0x3bacc2)[_0xf611('0x27')](function(_0x42da75){return _[_0xf611('0x2e')](_0x1ced65,function(_0x567418){if(_0x567418['sectionId']===0x64){_0x567418[_0xf611('0x67')]=_0x42da75;}return _0x567418;});});}else{return;}})[_0xf611('0x27')](function(_0x30856d){if(_0x30856d)_0x1ced65=_0x30856d;if(_[_0xf611('0x66')](_0x5b9eb7,0x3eb)){var _0x2e3ffb=_[_0xf611('0x5d')](_0x1ced65,{'sectionId':0x3eb});return getCustomDashboards(_0x2e3ffb)['then'](function(_0x2ff506){return _['map'](_0x1ced65,function(_0x131705){if(_0x2e3ffb[_0xf611('0x64')]){if(_0x131705[_0xf611('0x59')]===0x3eb){_0x131705[_0xf611('0x67')]=_0x2ff506;}}else{if(_0x131705[_0xf611('0x59')]===0x64){_0x131705[_0xf611('0x67')]=_0x2ff506;}}return _0x131705;});});}else{return;}})[_0xf611('0x27')](function(_0x372216){if(_0x372216)_0x1ced65=_0x372216;if(_[_0xf611('0x66')](_0x5b9eb7,0x709)){var _0x34348f=_[_0xf611('0x5d')](_0x1ced65,{'sectionId':0x709});return getPlugins(_0x34348f)[_0xf611('0x27')](function(_0x5d4cd7){if(_0x34348f[_0xf611('0x64')]){return _[_0xf611('0x2e')](_0x1ced65,function(_0x1267ab){if(_0x1267ab[_0xf611('0x59')]===0x709){_0x1267ab[_0xf611('0x67')]=_0x5d4cd7;}return _0x1267ab;});}else{var _0x3c32c4={'sectionId':0x76c,'enabled':0x1,'subsections':_0x5d4cd7};var _0xacd514=_[_0xf611('0x2e')](_0x1ced65);_0xacd514['push'](_0x3c32c4);return _0xacd514;}});}else{return;}})[_0xf611('0x27')](function(_0x358941){if(_0x358941)_0x1ced65=_0x358941;return _[_0xf611('0x41')](_0x1ced65,['enabled',0x1]);})['then'](respondWithResult(_0x1f4507,null))[_0xf611('0x48')](handleError(_0x1f4507,null));};function hasDefaultDashboard(_0x4b86ef){var _0x4729b9=[0x65];return new BPromise(function(_0x4a45c2,_0xa04b99){try{if(_0x4b86ef[_0xf611('0x57')]){_0x4a45c2(_0x4729b9);}else{return db[_0xf611('0x58')]['findOne']({'where':{'sectionId':_0x4b86ef['id']},'raw':!![]})['then'](function(_0x336e0f){_0x336e0f?_0x4a45c2(_0x4729b9):_0x4a45c2();});}}catch(_0xf34d9a){_0xa04b99(_0xf34d9a);}});}function getCustomDashboards(_0x297009){var _0x354539=[];return new BPromise(function(_0x510159,_0x2f2a01){try{if(_0x297009[_0xf611('0x57')]){return db[_0xf611('0x68')][_0xf611('0x46')]({'raw':!![]})['then'](function(_0x464df3){_0x464df3[_0xf611('0x69')](function(_0x466f1a){_0x354539['push'](_0x466f1a['id']+0x1869f);});_0x510159(_0x354539);});}else{return db[_0xf611('0x58')]['findAll']({'where':{'sectionId':_0x297009['id']},'raw':!![]})[_0xf611('0x27')](function(_0x3d9636){_0x3d9636[_0xf611('0x69')](function(_0x44fe21){_0x354539['push'](_0x44fe21[_0xf611('0x6a')]+0x1869f);});_0x510159(_0x354539);});}}catch(_0x395aef){_0x2f2a01(_0x395aef);}});}function getPlugins(_0x1146be){var _0x3b0f6e=[];return new BPromise(function(_0x486979,_0x2bb62e){try{if(_0x1146be[_0xf611('0x57')]){return db[_0xf611('0x6b')][_0xf611('0x46')]({'raw':!![]})[_0xf611('0x27')](function(_0x3a7259){_0x3a7259[_0xf611('0x69')](function(_0x2bd964){_0x3b0f6e[_0xf611('0x60')](_0x2bd964['id']+0x15b38);});_0x486979(_0x3b0f6e);});}else{return db[_0xf611('0x58')][_0xf611('0x46')]({'where':{'sectionId':_0x1146be['id']},'raw':!![]})[_0xf611('0x27')](function(_0x16b170){_0x16b170[_0xf611('0x69')](function(_0x5316e7){_0x3b0f6e[_0xf611('0x60')](_0x5316e7[_0xf611('0x6a')]+0x15b38);});_0x486979(_0x3b0f6e);});}}catch(_0x218ad0){_0x2bb62e(_0x218ad0);}});}exports[_0xf611('0x6c')]=function(_0xd6dfd0,_0x341abf){return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0xd6dfd0[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x341abf,null))[_0xf611('0x27')](function(_0x307901){if(_0x307901){return db[_0xf611('0x54')][_0xf611('0x55')](function(_0x2fc6f0){return db[_0xf611('0x56')]['findAll']({'where':{'userProfileId':_0xd6dfd0[_0xf611('0x4a')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2a7990){if(_0x2a7990){return db['UserProfileSection'][_0xf611('0x28')]({'where':{'userProfileId':_0xd6dfd0['params']['id'],'id':_[_0xf611('0x2e')](_0x2a7990,function(_0x32169d){return _0x32169d['id'];})},'transaction':_0x2fc6f0});}})[_0xf611('0x27')](function(_0x1c5123){var _0x1eba56=_[_0xf611('0x2e')](_0xd6dfd0[_0xf611('0x4d')],function(_0x132822){_0x132822[_0xf611('0x5b')]=_0xd6dfd0[_0xf611('0x4a')]['id'];return _0x132822;});return db[_0xf611('0x56')]['bulkCreate'](_0x1eba56,{'raw':!![],'transaction':_0x2fc6f0});})[_0xf611('0x27')](function(_0x5963a6){var _0x31edc1=_['filter'](_['map'](_0x5963a6,function(_0x222034){return _0x222034[_0xf611('0x50')]({'plain':!![]});}),{'includeAll':![]});if(_0x31edc1){return db[_0xf611('0x56')][_0xf611('0x46')]({'where':{'userProfileId':_0xd6dfd0[_0xf611('0x4a')]['id'],'sectionId':_[_0xf611('0x2e')](_0x31edc1,function(_0x148097){return _0x148097[_0xf611('0x59')];})},'attributes':['id',_0xf611('0x59')],'raw':!![]})[_0xf611('0x27')](function(_0x317474){var _0x40f667=_['map'](_0xd6dfd0[_0xf611('0x4d')],function(_0x527dc4){_0x527dc4[_0xf611('0x5b')]=_0xd6dfd0[_0xf611('0x4a')]['id'];return _0x527dc4;});return db[_0xf611('0x58')]['bulkCreate'](_0x40f667,{'raw':!![],'transaction':_0x2fc6f0});});}})['catch'](handleError(_0x341abf,null));});}})[_0xf611('0x27')](function(_0x1e9ba2){var _0x3715c5=_[_0xf611('0x2e')](_0x1e9ba2,function(_0x3a86e5){return _0x3a86e5[_0xf611('0x50')]({'plain':!![]});});})[_0xf611('0x27')](respondWithResult(_0x341abf,null))['catch'](handleError(_0x341abf,null));};exports[_0xf611('0x6d')]=function(_0x460462,_0x401009,_0x5bf4d5){return db[_0xf611('0x45')][_0xf611('0x5d')]({'where':{'id':_0x460462['params']['id']}})['then'](handleEntityNotFound(_0x401009,null))[_0xf611('0x27')](function(_0x487534){if(_0x487534){return _0x487534[_0xf611('0x6d')](_0x460462[_0xf611('0x34')][_0xf611('0x62')]);}})['then'](respondWithStatusCode(_0x401009,null))['catch'](handleError(_0x401009,null));};exports[_0xf611('0x6e')]=function(_0x4bb84d,_0x3179fa){var _0x1b3f0b={'raw':![],'where':{}};var _0x4e6549={};var _0x571b16={'count':0x0,'rows':[]};var _0x4e3be5=_0x4bb84d[_0xf611('0x34')][_0xf611('0x6f')];if(typeof _0x4e3be5===_0xf611('0x70')){throw new db['Sequelize']['ValidationError'](_0xf611('0x71'));}var _0xd73487=_0x4bb84d[_0xf611('0x34')][_0xf611('0x72')]||![];var _0x20e9f9=getQueryModels(_0x4e3be5,_0xd73487);if(typeof _0x20e9f9[_0xf611('0x73')]===_0xf611('0x70')){throw new db[(_0xf611('0x74'))][(_0xf611('0x75'))](_0xf611('0x76')+_0x4e3be5+'\x27');}var _0x5749ce=[];if(!_[_0xf611('0x65')](_0x20e9f9[_0xf611('0x77')])){_0x5749ce=_0x20e9f9['parentSections'];}else{_0x5749ce=[{'name':_0x4e3be5}];}return db['UserProfile'][_0xf611('0x78')]({'where':{'id':_0x4bb84d[_0xf611('0x4a')]['id']}})[_0xf611('0x27')](handleEntityNotFound(_0x3179fa,null))[_0xf611('0x27')](function(_0x190977){if(_0x190977){var _0x22767d=[];for(var _0x85a4a=0x0;_0x85a4a<_0x5749ce[_0xf611('0x3a')];_0x85a4a++){_0x22767d['push'](db[_0xf611('0x56')][_0xf611('0x78')]({'where':{'userProfileId':_0x190977['id'],'name':_0x5749ce[_0x85a4a]['name']},'raw':!![]}));}return BPromise[_0xf611('0x79')](_0x22767d);}})['then'](function(_0x281b5e){var _0x6d336a=_[_0xf611('0x41')](_0x281b5e,function(_0x270a45){return _0x270a45?_0x270a45:undefined;});var _0x2a1250=_['filter'](_0x5749ce,['ignore',!![]]);var _0x518a2f=_[_0xf611('0x65')](_0x6d336a)&&_[_0xf611('0x65')](_0x2a1250)?null:_[_0xf611('0x7a')](_0x2a1250,_0x6d336a);if(_0x518a2f){var _0x73cf6a=[];for(var _0x2a767f=0x0;_0x2a767f<_0x518a2f['length'];_0x2a767f++){var _0x115b2e=_[_0xf611('0x5d')](_0x5749ce,function(_0x277bc1){return _0x518a2f[_0x2a767f]?_0x277bc1[_0xf611('0x2b')]===_0x518a2f[_0x2a767f][_0xf611('0x2b')]:null;});if(_0x115b2e){if(_0x518a2f[_0x2a767f]['ignore']){_0x73cf6a[_0xf611('0x60')](getAllResources(_0x20e9f9[_0xf611('0x73')],_0x518a2f[_0x2a767f]));}else{if(!_0x518a2f[_0x2a767f]['autoAssociation']){_0x73cf6a['push'](getAllowedResources(_0x115b2e,_0x518a2f[_0x2a767f],_0x20e9f9[_0xf611('0x73')]));}else{if(_0x115b2e['model']){_0x73cf6a['push'](getAllFilteredResources(_0x115b2e,_0x518a2f[_0x2a767f]));}}}}}return BPromise[_0xf611('0x79')](_0x73cf6a);}else{return null;}})[_0xf611('0x27')](function(_0x318e58){var _0x3ce6d6=_0x318e58;var _0x37362f=null;if(_0x3ce6d6){_0x37362f=_0x3ce6d6[_0xf611('0x3a')]===0x1?_0x3ce6d6[0x0]:null;}if(_0x37362f||_0x3ce6d6){var _0x53825c=db[_0x20e9f9[_0xf611('0x73')]]['rawAttributes'];_0x4e6549[_0xf611('0x33')]=_['keys'](_0x53825c);_0x4e6549[_0xf611('0x34')]=_[_0xf611('0x35')](_0x4bb84d['query']);_0x4e6549[_0xf611('0x36')]=_[_0xf611('0x37')](_0x4e6549['model'],_0x4e6549[_0xf611('0x34')]);_0x1b3f0b['attributes']=_[_0xf611('0x37')](_0x4e6549[_0xf611('0x33')],qs['fields'](_0x4bb84d[_0xf611('0x34')][_0xf611('0x39')]));_0x1b3f0b[_0xf611('0x38')]=_0x1b3f0b['attributes'][_0xf611('0x3a')]?_0x1b3f0b[_0xf611('0x38')]:_0x4e6549[_0xf611('0x33')];if(!_0x4bb84d[_0xf611('0x34')][_0xf611('0x3b')](_0xf611('0x3c'))){_0x1b3f0b['limit']=qs[_0xf611('0x21')](_0x4bb84d[_0xf611('0x34')][_0xf611('0x21')]);_0x1b3f0b[_0xf611('0x20')]=qs['offset'](_0x4bb84d[_0xf611('0x34')][_0xf611('0x20')]);}_0x1b3f0b[_0xf611('0x3d')]=qs[_0xf611('0x3e')](_0x4bb84d[_0xf611('0x34')][_0xf611('0x3e')]);_0x1b3f0b['where']=qs[_0xf611('0x36')](_['pick'](_0x4bb84d[_0xf611('0x34')],_0x4e6549[_0xf611('0x36')]));if(_0x4bb84d[_0xf611('0x34')][_0xf611('0x41')]){_0x1b3f0b['where']=_[_0xf611('0x42')](_0x1b3f0b['where'],{'$or':_[_0xf611('0x2e')](_0x53825c,function(_0xa2a2e9){if(_0xa2a2e9['type'][_0xf611('0x32')]!==_0xf611('0x43')){var _0x31a541={};_0x31a541[_0xa2a2e9[_0xf611('0x7b')]]={'$like':'%'+_0x4bb84d[_0xf611('0x34')][_0xf611('0x41')]+'%'};return _0x31a541;}})});}var _0x12b8d5=[];if(_0x37362f){var _0x7556ed=_[_0xf611('0x5d')](_0x5749ce,[_0xf611('0x2b'),_0x37362f[_0xf611('0x2b')]]);if(_0x7556ed[_0xf611('0x7b')]){var _0x50fb23={};if(_0x20e9f9[_0xf611('0x73')]===_0xf611('0x7c')){_0x50fb23[_0x7556ed[_0xf611('0x7d')]]=_[_0xf611('0x2e')](_0x37362f[_0xf611('0x7e')],'id');}else{_0x50fb23[_0x7556ed[_0xf611('0x7d')]]=_0x37362f[_0xf611('0x7e')];}_0x12b8d5[_0xf611('0x60')](_0x50fb23);}else{_0x1b3f0b[_0xf611('0x3f')]['id']=_0x37362f[_0xf611('0x7e')];}}else{for(var _0x253f83=0x0;_0x253f83<_0x3ce6d6[_0xf611('0x3a')];_0x253f83++){var _0x7556ed=_[_0xf611('0x5d')](_0x5749ce,[_0xf611('0x2b'),_0x3ce6d6[_0x253f83][_0xf611('0x2b')]]);if(_0x7556ed['field']){var _0x50fb23={};_0x50fb23[_0x7556ed['foreignKey']]=_0x3ce6d6[_0x253f83][_0xf611('0x7e')];_0x12b8d5['push'](_0x50fb23);}else{if(!_0x1b3f0b['where']['id'])_0x1b3f0b[_0xf611('0x3f')]['id']=[];_0x3ce6d6[_0x253f83][_0xf611('0x7e')][_0xf611('0x69')](function(_0x53edc8){_0x1b3f0b[_0xf611('0x3f')]['id'][_0xf611('0x60')](_0x53edc8);});}}}if(!_['isEmpty'](_0x12b8d5)){_0x1b3f0b[_0xf611('0x3f')]=_[_0xf611('0x42')](_0x1b3f0b[_0xf611('0x3f')],{'$and':{'$or':_0x12b8d5}});}_0x1b3f0b=_['merge']({},_0x1b3f0b,_0x4bb84d[_0xf611('0x44')]);if(_0x37362f&&!_0x37362f['autoAssociation']&&_0x20e9f9[_0xf611('0x73')]===_0xf611('0x7c')){if(_0x4bb84d[_0xf611('0x34')][_0xf611('0x4b')]){_0x1b3f0b['include']=[{'all':!![]}];}return db[_0x20e9f9[_0xf611('0x73')]][_0xf611('0x46')](_0x1b3f0b)[_0xf611('0x27')](function(_0x3365fa){var _0x1bde94=[];_0x3365fa[_0xf611('0x69')](function(_0x49cfb0){var _0x2926bc;switch(_0x49cfb0['reportType']){case _0xf611('0x7f'):_0x2926bc=_[_0xf611('0x5d')](_0x37362f['associatedResources'],function(_0x4b00ae){return _0x4b00ae['id']===_0x49cfb0['reportId']&&_0x4b00ae[_0xf611('0x31')]===_0xf611('0x80');});break;case'custom':_0x2926bc=_[_0xf611('0x5d')](_0x37362f[_0xf611('0x7e')],function(_0x29e7b4){return _0x29e7b4['id']===_0x49cfb0[_0xf611('0x81')]&&_0x29e7b4[_0xf611('0x31')]===_0xf611('0x82');});break;}if(_0x2926bc)_0x1bde94[_0xf611('0x60')](_0x49cfb0);});_0x571b16[_0xf611('0x1f')]=_0x1bde94['length'];_0x571b16[_0xf611('0x47')]=_0x1bde94;return _0x571b16;});}else{return db[_0x20e9f9[_0xf611('0x73')]][_0xf611('0x1f')]({'where':_0x1b3f0b[_0xf611('0x3f')]})[_0xf611('0x27')](function(_0x21a5f8){_0x571b16[_0xf611('0x1f')]=_0x21a5f8;if(_0x4bb84d[_0xf611('0x34')][_0xf611('0x4b')]){if(_0x20e9f9[_0xf611('0x73')]===_0xf611('0x83')){_0x1b3f0b[_0xf611('0x4f')]=[{'model':db[_0xf611('0x84')],'as':_0xf611('0x85'),'attributes':['id',_0xf611('0x2b'),_0xf611('0x86')],'required':_0x4bb84d['query'][_0xf611('0x87')]?!![]:![]},{'model':db[_0xf611('0x84')],'as':_0xf611('0x88'),'attributes':['id',_0xf611('0x2b'),_0xf611('0x86')],'through':_0x4bb84d[_0xf611('0x34')]['tag']?{'attributes':[],'where':{'TagId':_0x4bb84d[_0xf611('0x34')]['tag']||undefined}}:{},'required':_0x4bb84d[_0xf611('0x34')]['tag']?!![]:![]}];}else{_0x1b3f0b[_0xf611('0x4f')]=[{'all':!![]}];}}return db[_0x20e9f9[_0xf611('0x73')]][_0xf611('0x46')](_0x1b3f0b);})['then'](function(_0x9792b){_0x571b16[_0xf611('0x47')]=_0x9792b;return _0x571b16;});}}else{return _0x571b16;}})[_0xf611('0x27')](respondWithFilteredResult(_0x3179fa,_0x1b3f0b))[_0xf611('0x48')](handleError(_0x3179fa,null));};function getAllResources(_0x16022e,_0x499d00){return new BPromise(function(_0x5a67e8,_0x46823f){if(_0x499d00){var _0x345f27=_0x499d00[_0xf611('0x41')]?{[_0x499d00[_0xf611('0x41')][_0xf611('0x7b')]]:_0x499d00[_0xf611('0x41')][_0xf611('0x89')]}:undefined;return db[_0x16022e]['findAll']({'where':_0x345f27,'raw':!![]})[_0xf611('0x27')](function(_0x518b89){_0x499d00[_0xf611('0x7e')]=_[_0xf611('0x2e')](_0x518b89,'id');_0x5a67e8(_0x499d00);})[_0xf611('0x48')](function(_0x1f3feb){_0x46823f(_0x1f3feb);});}else{_0x5a67e8(null);}});}function getAllFilteredResources(_0x4cf62f,_0x2b5b67){return new BPromise(function(_0xe387d1,_0x16a063){var _0x821f55=_0x4cf62f[_0xf611('0x41')]?{[_0x4cf62f['filter'][_0xf611('0x7b')]]:_0x4cf62f[_0xf611('0x41')]['value']}:undefined;return db[_0x4cf62f[_0xf611('0x33')]][_0xf611('0x46')]({'where':_0x821f55,'raw':!![]})[_0xf611('0x27')](function(_0x789ae8){_0x2b5b67[_0xf611('0x7e')]=_[_0xf611('0x2e')](_0x789ae8,function(_0x45d2ec){return _0x45d2ec[_0xf611('0x2b')];});_0xe387d1(_0x2b5b67);})['catch'](function(_0xba28bc){_0x16a063(_0xba28bc);});});}function getAllowedResources(_0x56ab88,_0x239c15,_0x4754eb){return new BPromise(function(_0x5b88e,_0x40094c){if(_0x239c15){return db['UserProfileResource'][_0xf611('0x46')]({'where':{'sectionId':_0x239c15['id']},'raw':!![]})['then'](function(_0x352e5e){if(_0x56ab88[_0xf611('0x7b')]&&_0x56ab88[_0xf611('0x7b')]!=='id'){_0x239c15[_0xf611('0x7e')]=_['map'](_0x352e5e,function(_0x114b00){return _0x114b00[_0x56ab88[_0xf611('0x7b')]];});}else{if(_0x4754eb===_0xf611('0x7c')){_0x239c15[_0xf611('0x7e')]=_['map'](_0x352e5e,function(_0x456736){return{'id':_0x456736['resourceId'],'type':_0x456736['type']};});}else{_0x239c15[_0xf611('0x7e')]=_[_0xf611('0x2e')](_0x352e5e,function(_0x5c95ea){return _0x5c95ea['resourceId'];});}}_0x5b88e(_0x239c15);})[_0xf611('0x48')](function(_0x242e4a){_0x40094c(_0x242e4a);});}else{_0x5b88e(null);}});}function getQueryModels(_0x1df263,_0x4b9095){var _0x2976ab=_0x1df263[_0xf611('0x8a')]();var _0x4e6a19={'childModel':undefined,'parentSections':[]};switch(_0x2976ab){case _0xf611('0x8b'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x8c');break;case _0xf611('0x8d'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x8e');break;case'squarerecordings':_0x4e6a19['childModel']=_0xf611('0x8f');_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0x90'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0x91')}];break;case _0xf611('0x92'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x93');break;case _0xf611('0x94'):_0x4e6a19[_0xf611('0x73')]='CmContact';_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0x95'),'field':'id','foreignKey':_0xf611('0x96')}];break;case _0xf611('0x97'):_0x4e6a19[_0xf611('0x73')]='CmList';break;case _0xf611('0x98'):_0x4e6a19['childModel']='CmCompany';break;case _0xf611('0x99'):_0x4e6a19['childModel']=_0xf611('0x9a');break;case _0xf611('0x9b'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x9c');break;case _0xf611('0x9d'):_0x4e6a19[_0xf611('0x73')]='ChatWebsite';break;case'faxqueues':_0x4e6a19['childModel']=_0xf611('0x9e');break;case _0xf611('0x9f'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xa0');break;case _0xf611('0xa1'):case _0xf611('0xa2'):case _0xf611('0xa3'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xa4');break;case _0xf611('0xa5'):_0x4e6a19[_0xf611('0x73')]='VoiceContext';break;case _0xf611('0xa6'):_0x4e6a19[_0xf611('0x73')]='VoiceMail';break;case'voicerecordings':_0x4e6a19['childModel']='VoiceRecording';_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0xa7'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0xa8'),'model':_0xf611('0xa9'),'filter':{'field':_0xf611('0xaa'),'value':[_0xf611('0xab')]}},{'name':_0xf611('0xac'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0xa8'),'model':_0xf611('0xa9'),'filter':{'field':_0xf611('0xaa'),'value':[_0xf611('0xad')]}},{'name':_0xf611('0xae'),'field':_0xf611('0x2b'),'foreignKey':_0xf611('0xaf'),'model':_0xf611('0xb0'),'filter':{'field':'type','value':['inbound']}},{'name':_0xf611('0xb1'),'field':'name','foreignKey':_0xf611('0xaf'),'model':'VoiceQueue','filter':{'field':_0xf611('0x31'),'value':['outbound']}}];break;case _0xf611('0xb2'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xb3');break;case _0xf611('0xb4'):_0x4e6a19[_0xf611('0x73')]='VoiceChanSpy';break;case _0xf611('0xb5'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xb6');break;case _0xf611('0xb7'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xb8');break;case _0xf611('0xb9'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xba');break;case'mailaccounts':_0x4e6a19[_0xf611('0x73')]=_0xf611('0xbb');break;case _0xf611('0xbc'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xbd');break;case _0xf611('0xbe'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xbf');break;case _0xf611('0xc0'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xc1');break;case _0xf611('0xc2'):_0x4e6a19[_0xf611('0x73')]='SmsQueue';break;case _0xf611('0xc3'):_0x4e6a19['childModel']=_0xf611('0xc4');break;case _0xf611('0xc5'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xc6');break;case _0xf611('0xc7'):_0x4e6a19[_0xf611('0x73')]='WhatsappAccount';break;case _0xf611('0xc8'):_0x4e6a19[_0xf611('0x73')]='Team';break;case _0xf611('0xc9'):case'queuecampaigns':_0x4e6a19[_0xf611('0x73')]='VoiceQueue';if(_0x4b9095){_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0xae')},{'name':_0xf611('0xb1')}];}break;case'users':case'agents':case _0xf611('0xca'):_0x4e6a19['childModel']=_0xf611('0xa9');if(_0x4b9095){_0x4e6a19[_0xf611('0x77')]=[{'name':'Users','filter':{'field':_0xf611('0xaa'),'value':[_0xf611('0xcb'),_0xf611('0xcc')]},'ignore':!![]},{'name':'Agents'},{'name':_0xf611('0xac')}];}break;case _0xf611('0xcd'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xce');break;case _0xf611('0xcf'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xd0');break;case _0xf611('0xd1'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xd2');break;case _0xf611('0xd3'):_0x4e6a19['childModel']=_0xf611('0xd4');break;case _0xf611('0xd5'):_0x4e6a19['childModel']=_0xf611('0xd6');break;case _0xf611('0xd7'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xd8');break;case _0xf611('0xd9'):_0x4e6a19['childModel']=_0xf611('0xa9');break;case _0xf611('0xda'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xdb');break;case'dispositions':_0x4e6a19['childModel']='Disposition';break;case _0xf611('0xdc'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x68');break;case _0xf611('0xdd'):_0x4e6a19[_0xf611('0x73')]='Interval';break;case'pauses':_0x4e6a19['childModel']=_0xf611('0xde');break;case _0xf611('0xdf'):_0x4e6a19[_0xf611('0x73')]='Schedule';break;case _0xf611('0xe0'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xe1');break;case'tags':_0x4e6a19[_0xf611('0x73')]=_0xf611('0x84');break;case _0xf611('0xe2'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xe3');break;case _0xf611('0xe4'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xe5');break;case _0xf611('0xe6'):_0x4e6a19[_0xf611('0x73')]='Trunk';break;case'variables':_0x4e6a19[_0xf611('0x73')]='Variable';break;case _0xf611('0xe7'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0x6b');break;case'extractedreports':_0x4e6a19[_0xf611('0x73')]=_0xf611('0x7c');_0x4e6a19[_0xf611('0x77')]=[{'name':_0xf611('0xe8'),'field':'id','foreignKey':_0xf611('0x81')}];break;case _0xf611('0xe9'):_0x4e6a19[_0xf611('0x73')]=_0xf611('0xea');break;case _0xf611('0xc7'):_0x4e6a19['childModel']=_0xf611('0xeb');break;default:return _0x4e6a19;}return _0x4e6a19;}