Built motion from commit (unavailable).|2.5.11
[motion2.git] / server / api / userProfile / userProfile.controller.js
index 1e5e10a..a97a5b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x903b=['model','map','query','filters','intersection','fields','attributes','length','limit','order','sort','where','filter','merge','VIRTUAL','options','UserProfile','includeAll','rows','catch','show','params','keys','include','find','create','body','clone','get','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','each','autoAssociation','findAll','sectionId','userProfileId','update','describe','addSections','sequelize','UserProfileResource','Resources','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','all','ignore','union','hasOwnProperty','type','field','AnalyticExtractedReport','foreignKey','associatedResources','default','reportId','custom','CustomReports','CmContact','Tag','Tags','tag','ThroughTags','value','toLowerCase','odbc','SquareOdbc','squarerecordings','SquareProjects','projectName','JscriptyProject','Lists','ListId','lists','CmList','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueue','QueueCampaigns','queue','VoiceMusicOnHold','chanspies','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','WhatsappQueue','WhatsappAccount','Team','voicequeues','VoiceQueues','users','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','intervals','Interval','Pause','scheduler','sounds','Sound','triggers','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userProfile.socket','end','status','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','index','rawAttributes','fieldName','key'];(function(_0x3bb9da,_0x502962){var _0x17eef7=function(_0x94c254){while(--_0x94c254){_0x3bb9da['push'](_0x3bb9da['shift']());}};_0x17eef7(++_0x502962);}(_0x903b,0x19d));var _0xb903=function(_0x4f966a,_0x22d73b){_0x4f966a=_0x4f966a-0x0;var _0x31993d=_0x903b[_0x4f966a];return _0x31993d;};'use strict';var pdf=require(_0xb903('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb903('0x1'));var jsonpatch=require(_0xb903('0x2'));var rp=require(_0xb903('0x3'));var moment=require('moment');var BPromise=require(_0xb903('0x4'));var Mustache=require(_0xb903('0x5'));var util=require('util');var path=require(_0xb903('0x6'));var sox=require(_0xb903('0x7'));var csv=require(_0xb903('0x8'));var ejs=require(_0xb903('0x9'));var fs=require('fs');var _=require(_0xb903('0xa'));var squel=require(_0xb903('0xb'));var crypto=require(_0xb903('0xc'));var jsforce=require(_0xb903('0xd'));var deskjs=require(_0xb903('0xe'));var toCsv=require(_0xb903('0x8'));var querystring=require(_0xb903('0xf'));var Papa=require('papaparse');var Redis=require(_0xb903('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb903('0x11'));var as=require(_0xb903('0x12'));var hardwareService=require(_0xb903('0x13'));var logger=require(_0xb903('0x14'))(_0xb903('0x15'));var utils=require(_0xb903('0x16'));var config=require(_0xb903('0x17'));var licenseUtil=require(_0xb903('0x18'));var db=require(_0xb903('0x19'))['db'];config[_0xb903('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb903('0x1b'))(new Redis(config[_0xb903('0x1a')]));require(_0xb903('0x1c'))['register'](socket);function respondWithStatusCode(_0x51c260,_0x44129b){_0x44129b=_0x44129b||0xcc;return function(_0x1ae72d){if(_0x1ae72d){return _0x51c260['sendStatus'](_0x44129b);}return _0x51c260['status'](_0x44129b)[_0xb903('0x1d')]();};}function respondWithResult(_0x3c4666,_0x46d0e1){_0x46d0e1=_0x46d0e1||0xc8;return function(_0x16c505){if(_0x16c505){return _0x3c4666[_0xb903('0x1e')](_0x46d0e1)['json'](_0x16c505);}};}function respondWithFilteredResult(_0x47db7,_0x1a3ead){return function(_0x35620d){if(_0x35620d){var _0x1f6f13=_0x35620d[_0xb903('0x1f')],_0xf065f8=_0x1a3ead[_0xb903('0x20')],_0x331471=_0x1a3ead[_0xb903('0x20')]+_0x1a3ead['limit'],_0x407660;if(_0x331471>=_0x1f6f13){_0x331471=_0x1f6f13;_0x407660=0xc8;}else{_0x407660=0xce;}_0x47db7[_0xb903('0x1e')](_0x407660);return _0x47db7[_0xb903('0x21')](_0xb903('0x22'),_0xf065f8+'-'+_0x331471+'/'+_0x1f6f13)[_0xb903('0x23')](_0x35620d);}return null;};}function patchUpdates(_0x43b0c8){return function(_0x5878dd){try{jsonpatch[_0xb903('0x24')](_0x5878dd,_0x43b0c8,!![]);}catch(_0x447b71){return BPromise[_0xb903('0x25')](_0x447b71);}return _0x5878dd[_0xb903('0x26')]();};}function saveUpdates(_0x457cbf,_0x24f812){return function(_0x2495d9){if(_0x2495d9){return _0x2495d9['update'](_0x457cbf)[_0xb903('0x27')](function(_0x412110){return _0x412110;});}return null;};}function removeEntity(_0x1da009,_0x102f9d){return function(_0x1ced64){if(_0x1ced64){return _0x1ced64[_0xb903('0x28')]()[_0xb903('0x27')](function(){_0x1da009[_0xb903('0x1e')](0xcc)[_0xb903('0x1d')]();});}};}function handleEntityNotFound(_0x390ec3,_0x51a723){return function(_0xe180b7){if(!_0xe180b7){_0x390ec3[_0xb903('0x29')](0x194);}return _0xe180b7;};}function handleError(_0x44832f,_0xc138c3){_0xc138c3=_0xc138c3||0x1f4;return function(_0x383ca2){logger[_0xb903('0x2a')](_0x383ca2[_0xb903('0x2b')]);if(_0x383ca2[_0xb903('0x2c')]){delete _0x383ca2[_0xb903('0x2c')];}_0x44832f[_0xb903('0x1e')](_0xc138c3)['send'](_0x383ca2);};}exports[_0xb903('0x2d')]=function(_0x1ea7c5,_0x49a83b){var _0x50e384={},_0x4ef46c={},_0x420e03={'count':0x0,'rows':[]};var _0x71fd1e=_['map'](db['UserProfile'][_0xb903('0x2e')],function(_0xac22cd){return{'name':_0xac22cd[_0xb903('0x2f')],'type':_0xac22cd['type'][_0xb903('0x30')]};});_0x4ef46c[_0xb903('0x31')]=_[_0xb903('0x32')](_0x71fd1e,_0xb903('0x2c'));_0x4ef46c[_0xb903('0x33')]=_['keys'](_0x1ea7c5['query']);_0x4ef46c[_0xb903('0x34')]=_[_0xb903('0x35')](_0x4ef46c[_0xb903('0x31')],_0x4ef46c['query']);_0x50e384['attributes']=_[_0xb903('0x35')](_0x4ef46c[_0xb903('0x31')],qs[_0xb903('0x36')](_0x1ea7c5[_0xb903('0x33')][_0xb903('0x36')]));_0x50e384[_0xb903('0x37')]=_0x50e384[_0xb903('0x37')][_0xb903('0x38')]?_0x50e384[_0xb903('0x37')]:_0x4ef46c['model'];if(!_0x1ea7c5[_0xb903('0x33')]['hasOwnProperty']('nolimit')){_0x50e384[_0xb903('0x39')]=qs[_0xb903('0x39')](_0x1ea7c5[_0xb903('0x33')][_0xb903('0x39')]);_0x50e384['offset']=qs['offset'](_0x1ea7c5[_0xb903('0x33')]['offset']);}_0x50e384[_0xb903('0x3a')]=qs['sort'](_0x1ea7c5['query'][_0xb903('0x3b')]);_0x50e384[_0xb903('0x3c')]=qs[_0xb903('0x34')](_['pick'](_0x1ea7c5[_0xb903('0x33')],_0x4ef46c[_0xb903('0x34')]),_0x71fd1e);if(_0x1ea7c5[_0xb903('0x33')][_0xb903('0x3d')]){_0x50e384[_0xb903('0x3c')]=_[_0xb903('0x3e')](_0x50e384[_0xb903('0x3c')],{'$or':_[_0xb903('0x32')](_0x71fd1e,function(_0x4c3232){if(_0x4c3232['type']!==_0xb903('0x3f')){var _0x369cb7={};_0x369cb7[_0x4c3232['name']]={'$like':'%'+_0x1ea7c5[_0xb903('0x33')][_0xb903('0x3d')]+'%'};return _0x369cb7;}})});}_0x50e384=_[_0xb903('0x3e')]({},_0x50e384,_0x1ea7c5[_0xb903('0x40')]);var _0x29f3cf={'where':_0x50e384[_0xb903('0x3c')]};return db[_0xb903('0x41')][_0xb903('0x1f')](_0x29f3cf)['then'](function(_0x27bebf){_0x420e03[_0xb903('0x1f')]=_0x27bebf;if(_0x1ea7c5[_0xb903('0x33')][_0xb903('0x42')]){_0x50e384['include']=[{'all':!![]}];}return db[_0xb903('0x41')]['findAll'](_0x50e384);})[_0xb903('0x27')](function(_0xed3a95){_0x420e03[_0xb903('0x43')]=_0xed3a95;return _0x420e03;})[_0xb903('0x27')](respondWithFilteredResult(_0x49a83b,_0x50e384))[_0xb903('0x44')](handleError(_0x49a83b,null));};exports[_0xb903('0x45')]=function(_0x413a71,_0x82c81d){var _0x146b52={'raw':![],'where':{'id':_0x413a71[_0xb903('0x46')]['id']}},_0x2789e6={};_0x2789e6[_0xb903('0x31')]=_[_0xb903('0x47')](db['UserProfile'][_0xb903('0x2e')]);_0x2789e6[_0xb903('0x33')]=_[_0xb903('0x47')](_0x413a71[_0xb903('0x33')]);_0x2789e6[_0xb903('0x34')]=_[_0xb903('0x35')](_0x2789e6[_0xb903('0x31')],_0x2789e6[_0xb903('0x33')]);_0x146b52[_0xb903('0x37')]=_[_0xb903('0x35')](_0x2789e6[_0xb903('0x31')],qs[_0xb903('0x36')](_0x413a71['query'][_0xb903('0x36')]));_0x146b52[_0xb903('0x37')]=_0x146b52[_0xb903('0x37')][_0xb903('0x38')]?_0x146b52['attributes']:_0x2789e6[_0xb903('0x31')];if(_0x413a71['query'][_0xb903('0x42')]){_0x146b52[_0xb903('0x48')]=[{'all':!![]}];}_0x146b52=_['merge']({},_0x146b52,_0x413a71['options']);return db['UserProfile'][_0xb903('0x49')](_0x146b52)[_0xb903('0x27')](handleEntityNotFound(_0x82c81d,null))['then'](respondWithResult(_0x82c81d,null))[_0xb903('0x44')](handleError(_0x82c81d,null));};exports['create']=function(_0x5f0d29,_0x3ce02c){return db[_0xb903('0x41')][_0xb903('0x4a')](_0x5f0d29[_0xb903('0x4b')],{})['then'](respondWithResult(_0x3ce02c,0xc9))[_0xb903('0x44')](handleError(_0x3ce02c,null));};exports[_0xb903('0x4c')]=function(_0x5a2e00,_0x2b52ba){var _0x191245={'where':{'id':_0x5a2e00[_0xb903('0x46')]['id']}},_0x52ab03={};_0x52ab03[_0xb903('0x31')]=_[_0xb903('0x47')](db['UserProfile'][_0xb903('0x2e')]);_0x191245[_0xb903('0x37')]=_[_0xb903('0x35')](_0x52ab03['model'],qs[_0xb903('0x36')](_0x5a2e00['query']['fields']));_0x191245[_0xb903('0x37')]=_0x191245[_0xb903('0x37')][_0xb903('0x38')]?_0x191245[_0xb903('0x37')]:_0x52ab03[_0xb903('0x31')];if(_0x5a2e00[_0xb903('0x33')][_0xb903('0x42')]){_0x191245[_0xb903('0x48')]=[{'all':!![]}];}_0x191245=_[_0xb903('0x3e')]({},_0x191245,_0x5a2e00[_0xb903('0x40')]);return db['UserProfile'][_0xb903('0x49')](_0x191245)[_0xb903('0x27')](handleEntityNotFound(_0x2b52ba,null))['then'](function(_0xb6b973){if(_0xb6b973){var _0x525de2=_0xb6b973[_0xb903('0x4d')]({'plain':!![]});_0x525de2=qs[_0xb903('0x4e')](_0x525de2,['id','createdAt',_0xb903('0x4f'),_0xb903('0x50')]);_0x5a2e00[_0xb903('0x4b')]=_['omit'](_0x5a2e00[_0xb903('0x4b')],['id',_0xb903('0x51'),_0xb903('0x4f')]);return db['sequelize'][_0xb903('0x52')](function(_0x370d9f){return db[_0xb903('0x41')][_0xb903('0x4a')](_[_0xb903('0x3e')](_0x525de2,_0x5a2e00[_0xb903('0x4b')]),{'include':_0x5a2e00[_0xb903('0x33')][_0xb903('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x370d9f})[_0xb903('0x27')](function(_0x22b4b0){var _0x5d077a=_0x22b4b0[_0xb903('0x4d')]({'plain':!![]});return db[_0xb903('0x53')]['findAll']({'where':{'userProfileId':_0x5a2e00['params']['id']},'raw':!![]})[_0xb903('0x27')](function(_0x13e58e){if(_0x13e58e){return BPromise[_0xb903('0x54')](_0x13e58e,function(_0x2976df){return new BPromise(function(_0xbf3fd1,_0x17f8b5){if(_0x2976df[_0xb903('0x55')]===null||_0x2976df['autoAssociation']===0x1)_0xbf3fd1(null);return db['UserProfileResource'][_0xb903('0x56')]({'where':{'sectionId':_0x2976df['id']},'raw':!![]})[_0xb903('0x27')](function(_0x3ff8b0){var _0x5a2de6=_['map'](_0x3ff8b0,function(_0x41d109){return qs[_0xb903('0x4e')](_0x41d109,['id',_0xb903('0x51'),'updatedAt',_0xb903('0x57')]);});_0xbf3fd1(_0x5a2de6);})['catch'](function(_0x5deccd){_0x17f8b5(_0x5deccd);});})['then'](function(_0x463b62){var _0x51ba76=qs[_0xb903('0x4e')](_0x2976df,['id','createdAt','updatedAt']);_0x51ba76[_0xb903('0x58')]=_0x5d077a['id'];if(_0x463b62)_0x51ba76['Resources']=_0x463b62;return _0x51ba76;})[_0xb903('0x27')](function(_0x1eba62){return db[_0xb903('0x53')][_0xb903('0x4a')](_0x1eba62,{'include':[{'model':db['UserProfileResource'],'as':'Resources'}],'raw':!![],'transaction':_0x370d9f});});})['then'](function(){return _0x5d077a;});}});});});}})[_0xb903('0x27')](respondWithResult(_0x2b52ba,0xc9))[_0xb903('0x44')](handleError(_0x2b52ba,null));};exports[_0xb903('0x59')]=function(_0x5d863e,_0x1ebb7a){if(_0x5d863e[_0xb903('0x4b')]['id']){delete _0x5d863e['body']['id'];}return db[_0xb903('0x41')][_0xb903('0x49')]({'where':{'id':_0x5d863e[_0xb903('0x46')]['id']}})[_0xb903('0x27')](handleEntityNotFound(_0x1ebb7a,null))[_0xb903('0x27')](saveUpdates(_0x5d863e['body'],null))['then'](respondWithResult(_0x1ebb7a,null))[_0xb903('0x44')](handleError(_0x1ebb7a,null));};exports[_0xb903('0x28')]=function(_0x5da914,_0x518e77){return db[_0xb903('0x41')][_0xb903('0x49')]({'where':{'id':_0x5da914[_0xb903('0x46')]['id']}})['then'](handleEntityNotFound(_0x518e77,null))[_0xb903('0x27')](removeEntity(_0x518e77,null))[_0xb903('0x44')](handleError(_0x518e77,null));};exports[_0xb903('0x5a')]=function(_0x39eea5,_0x27ac0f){return db[_0xb903('0x41')][_0xb903('0x5a')]()['then'](respondWithResult(_0x27ac0f,null))['catch'](handleError(_0x27ac0f,null));};exports[_0xb903('0x5b')]=function(_0x24b30d,_0xa8ff01){var _0x1adbd6=_0x24b30d[_0xb903('0x4b')];return db[_0xb903('0x41')][_0xb903('0x49')]({'where':{'id':_0x24b30d['params']['id']}})['then'](handleEntityNotFound(_0xa8ff01,null))['then'](function(_0x12b2b3){if(_0x12b2b3){return db[_0xb903('0x5c')][_0xb903('0x52')](function(_0x1061a7){return db[_0xb903('0x53')]['destroy']({'where':{'userProfileId':_0x24b30d['params']['id'],'sectionId':_[_0xb903('0x32')](_0x1adbd6,function(_0x554dca){return _0x554dca[_0xb903('0x57')];})},'transaction':_0x1061a7})['then'](function(){var _0x42f002=_[_0xb903('0x32')](_0x1adbd6,function(_0x56e1ca){_0x56e1ca[_0xb903('0x58')]=_0x24b30d['params']['id'];return _0x56e1ca;});var _0x58f68b=[];return BPromise['each'](_0x42f002,function(_0x31ff86){return db[_0xb903('0x53')][_0xb903('0x4a')](_0x31ff86,{'include':[{'model':db[_0xb903('0x5d')],'as':_0xb903('0x5e')}],'raw':!![],'transaction':_0x1061a7})[_0xb903('0x27')](function(_0x58285d){_0x58f68b['push'](_0x58285d[_0xb903('0x4d')]({'plain':!![]}));});})[_0xb903('0x27')](function(){return _0x58f68b;});});});}})[_0xb903('0x27')](function(_0x14dfd9){return _0x14dfd9;})[_0xb903('0x27')](respondWithResult(_0xa8ff01,null))['catch'](handleError(_0xa8ff01,null));};exports[_0xb903('0x5f')]=function(_0x1cf03f,_0x81413a){var _0x2d00cd;return db[_0xb903('0x41')]['find']({'where':{'id':_0x1cf03f[_0xb903('0x46')]['id']},'attributes':['id',_0xb903('0x2c')]})[_0xb903('0x27')](handleEntityNotFound(_0x81413a,null))[_0xb903('0x27')](function(_0x578d0c){if(_0x578d0c){_0x2d00cd=_0x578d0c;return db[_0xb903('0x53')]['destroy']({'where':{'userProfileId':_0x1cf03f[_0xb903('0x46')]['id'],'sectionId':_0x1cf03f[_0xb903('0x33')][_0xb903('0x60')]}});}})[_0xb903('0x27')](function(){return _0x2d00cd;})[_0xb903('0x27')](respondWithStatusCode(_0x81413a,null))[_0xb903('0x44')](handleError(_0x81413a,null));};exports[_0xb903('0x61')]=function(_0x7a21e3,_0x324945){var _0x2911b9=[];var _0x44974e=[];return db[_0xb903('0x53')][_0xb903('0x56')]({'where':{'userProfileId':_0x7a21e3[_0xb903('0x46')]['id']},'raw':!![]})['then'](function(_0x18e2d6){_0x2911b9=_['filter'](_0x18e2d6,function(_0x605016){return _0x605016[_0xb903('0x62')]===0x1||_['includes']([0x3eb,0x709],_0x605016[_0xb903('0x57')]);});if(!_[_0xb903('0x63')](_0x2911b9)){return _['map'](_0x2911b9,function(_0x3cae79){return _0x3cae79[_0xb903('0x57')];});}else{return;}})[_0xb903('0x27')](function(_0x110d0a){if(_0x110d0a)_0x44974e=_0x110d0a;if(_[_0xb903('0x64')](_0x44974e,0x64)){var _0x2c4276=_[_0xb903('0x49')](_0x2911b9,{'sectionId':0x64});return hasDefaultDashboard(_0x2c4276)['then'](function(_0x1b3e52){return _[_0xb903('0x32')](_0x2911b9,function(_0x49aa0b){if(_0x49aa0b[_0xb903('0x57')]===0x64){_0x49aa0b['subsections']=_0x1b3e52;}return _0x49aa0b;});});}else{return;}})[_0xb903('0x27')](function(_0x5bab41){if(_0x5bab41)_0x2911b9=_0x5bab41;if(_[_0xb903('0x64')](_0x44974e,0x3eb)){var _0x595694=_[_0xb903('0x49')](_0x2911b9,{'sectionId':0x3eb});return getCustomDashboards(_0x595694)[_0xb903('0x27')](function(_0x516da1){return _[_0xb903('0x32')](_0x2911b9,function(_0x143356){if(_0x595694[_0xb903('0x62')]){if(_0x143356[_0xb903('0x57')]===0x3eb){_0x143356[_0xb903('0x65')]=_0x516da1;}}else{if(_0x143356[_0xb903('0x57')]===0x64){_0x143356[_0xb903('0x65')]=_0x516da1;}}return _0x143356;});});}else{return;}})['then'](function(_0xe7653){if(_0xe7653)_0x2911b9=_0xe7653;if(_[_0xb903('0x64')](_0x44974e,0x709)){var _0x3fa319=_[_0xb903('0x49')](_0x2911b9,{'sectionId':0x709});return getPlugins(_0x3fa319)[_0xb903('0x27')](function(_0x4bfd52){if(_0x3fa319[_0xb903('0x62')]){return _['map'](_0x2911b9,function(_0x246042){if(_0x246042['sectionId']===0x709){_0x246042[_0xb903('0x65')]=_0x4bfd52;}return _0x246042;});}else{var _0x2bea5e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4bfd52};var _0x4f01c3=_['map'](_0x2911b9);_0x4f01c3[_0xb903('0x66')](_0x2bea5e);return _0x4f01c3;}});}else{return;}})['then'](function(_0x5c0866){if(_0x5c0866)_0x2911b9=_0x5c0866;return _[_0xb903('0x3d')](_0x2911b9,[_0xb903('0x62'),0x1]);})[_0xb903('0x27')](respondWithResult(_0x324945,null))[_0xb903('0x44')](handleError(_0x324945,null));};function hasDefaultDashboard(_0x3ea500){var _0x575931=[0x65];return new BPromise(function(_0x3ac47a,_0x43a062){try{if(_0x3ea500[_0xb903('0x55')]){_0x3ac47a(_0x575931);}else{return db[_0xb903('0x5d')][_0xb903('0x67')]({'where':{'sectionId':_0x3ea500['id']},'raw':!![]})[_0xb903('0x27')](function(_0x3dcda3){_0x3dcda3?_0x3ac47a(_0x575931):_0x3ac47a();});}}catch(_0x2ad614){_0x43a062(_0x2ad614);}});}function getCustomDashboards(_0x5ac87a){var _0x4f86a8=[];return new BPromise(function(_0x2ca068,_0x1e5553){try{if(_0x5ac87a[_0xb903('0x55')]){return db[_0xb903('0x68')][_0xb903('0x56')]({'raw':!![]})['then'](function(_0x54499a){_0x54499a[_0xb903('0x69')](function(_0x4415c6){_0x4f86a8[_0xb903('0x66')](_0x4415c6['id']+0x1869f);});_0x2ca068(_0x4f86a8);});}else{return db[_0xb903('0x5d')][_0xb903('0x56')]({'where':{'sectionId':_0x5ac87a['id']},'raw':!![]})[_0xb903('0x27')](function(_0x41c2c1){_0x41c2c1[_0xb903('0x69')](function(_0x4c1f0e){_0x4f86a8[_0xb903('0x66')](_0x4c1f0e[_0xb903('0x6a')]+0x1869f);});_0x2ca068(_0x4f86a8);});}}catch(_0x157bd5){_0x1e5553(_0x157bd5);}});}function getPlugins(_0x3a9368){var _0x22c9ef=[];return new BPromise(function(_0x14984f,_0xcdca58){try{if(_0x3a9368[_0xb903('0x55')]){return db[_0xb903('0x6b')][_0xb903('0x56')]({'raw':!![]})[_0xb903('0x27')](function(_0x4b8468){_0x4b8468['forEach'](function(_0x3a33c2){_0x22c9ef[_0xb903('0x66')](_0x3a33c2['id']+0x15b38);});_0x14984f(_0x22c9ef);});}else{return db[_0xb903('0x5d')]['findAll']({'where':{'sectionId':_0x3a9368['id']},'raw':!![]})['then'](function(_0x46dc54){_0x46dc54[_0xb903('0x69')](function(_0x4c72c1){_0x22c9ef[_0xb903('0x66')](_0x4c72c1[_0xb903('0x6a')]+0x15b38);});_0x14984f(_0x22c9ef);});}}catch(_0xf00b65){_0xcdca58(_0xf00b65);}});}exports[_0xb903('0x6c')]=function(_0x4d56bf,_0x560d5a){return db[_0xb903('0x41')]['find']({'where':{'id':_0x4d56bf['params']['id']}})[_0xb903('0x27')](handleEntityNotFound(_0x560d5a,null))[_0xb903('0x27')](function(_0x485a1a){if(_0x485a1a){return db[_0xb903('0x5c')][_0xb903('0x52')](function(_0x278d8d){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x4d56bf[_0xb903('0x46')]['id']},'attributes':['id'],'raw':!![]})[_0xb903('0x27')](function(_0x3afe3d){if(_0x3afe3d){return db['UserProfileSection'][_0xb903('0x28')]({'where':{'userProfileId':_0x4d56bf['params']['id'],'id':_['map'](_0x3afe3d,function(_0x2f67d7){return _0x2f67d7['id'];})},'transaction':_0x278d8d});}})[_0xb903('0x27')](function(_0x34683f){var _0x34b1d4=_['map'](_0x4d56bf['body'],function(_0x4155e3){_0x4155e3[_0xb903('0x58')]=_0x4d56bf['params']['id'];return _0x4155e3;});return db[_0xb903('0x53')][_0xb903('0x6d')](_0x34b1d4,{'raw':!![],'transaction':_0x278d8d});})[_0xb903('0x27')](function(_0x4038c5){var _0x18c225=_[_0xb903('0x3d')](_[_0xb903('0x32')](_0x4038c5,function(_0xed83c8){return _0xed83c8[_0xb903('0x4d')]({'plain':!![]});}),{'includeAll':![]});if(_0x18c225){return db[_0xb903('0x53')][_0xb903('0x56')]({'where':{'userProfileId':_0x4d56bf[_0xb903('0x46')]['id'],'sectionId':_[_0xb903('0x32')](_0x18c225,function(_0xe23da2){return _0xe23da2['sectionId'];})},'attributes':['id',_0xb903('0x57')],'raw':!![]})[_0xb903('0x27')](function(_0x421cfc){var _0x25208e=_[_0xb903('0x32')](_0x4d56bf[_0xb903('0x4b')],function(_0x1e8528){_0x1e8528[_0xb903('0x58')]=_0x4d56bf['params']['id'];return _0x1e8528;});return db[_0xb903('0x5d')][_0xb903('0x6d')](_0x25208e,{'raw':!![],'transaction':_0x278d8d});});}})[_0xb903('0x44')](handleError(_0x560d5a,null));});}})[_0xb903('0x27')](function(_0xc2d2bf){var _0x28176f=_[_0xb903('0x32')](_0xc2d2bf,function(_0x203da2){return _0x203da2['get']({'plain':!![]});});})['then'](respondWithResult(_0x560d5a,null))[_0xb903('0x44')](handleError(_0x560d5a,null));};exports[_0xb903('0x6e')]=function(_0x35801c,_0x24fea5,_0x3470e3){return db['UserProfile'][_0xb903('0x49')]({'where':{'id':_0x35801c[_0xb903('0x46')]['id']}})[_0xb903('0x27')](handleEntityNotFound(_0x24fea5,null))[_0xb903('0x27')](function(_0x30011d){if(_0x30011d){return _0x30011d[_0xb903('0x6e')](_0x35801c['query'][_0xb903('0x60')]);}})[_0xb903('0x27')](respondWithStatusCode(_0x24fea5,null))['catch'](handleError(_0x24fea5,null));};exports['getResources']=function(_0x4664f7,_0x4845f5){var _0x326bc3={'raw':![],'where':{}};var _0x451a01={};var _0x4644cd={'count':0x0,'rows':[]};var _0x44cc4d=_0x4664f7[_0xb903('0x33')][_0xb903('0x6f')];if(typeof _0x44cc4d===_0xb903('0x70')){throw new db[(_0xb903('0x71'))][(_0xb903('0x72'))](_0xb903('0x73'));}var _0x490e16=_0x4664f7[_0xb903('0x33')][_0xb903('0x74')]||![];var _0x50c45b=getQueryModels(_0x44cc4d,_0x490e16);if(typeof _0x50c45b[_0xb903('0x75')]===_0xb903('0x70')){throw new db[(_0xb903('0x71'))][(_0xb903('0x72'))](_0xb903('0x76')+_0x44cc4d+'\x27');}var _0x2a7b75=[];if(!_['isEmpty'](_0x50c45b[_0xb903('0x77')])){_0x2a7b75=_0x50c45b[_0xb903('0x77')];}else{_0x2a7b75=[{'name':_0x44cc4d}];}return db['UserProfile'][_0xb903('0x67')]({'where':{'id':_0x4664f7[_0xb903('0x46')]['id']}})['then'](handleEntityNotFound(_0x4845f5,null))[_0xb903('0x27')](function(_0x3e5b11){if(_0x3e5b11){var _0x4da2a5=[];for(var _0x3a8651=0x0;_0x3a8651<_0x2a7b75['length'];_0x3a8651++){_0x4da2a5[_0xb903('0x66')](db[_0xb903('0x53')][_0xb903('0x67')]({'where':{'userProfileId':_0x3e5b11['id'],'name':_0x2a7b75[_0x3a8651][_0xb903('0x2c')]},'raw':!![]}));}return BPromise[_0xb903('0x78')](_0x4da2a5);}})[_0xb903('0x27')](function(_0x37fb73){var _0x4b964c=_[_0xb903('0x3d')](_0x37fb73,function(_0x4b3adc){return _0x4b3adc?_0x4b3adc:undefined;});var _0x413ec8=_['filter'](_0x2a7b75,[_0xb903('0x79'),!![]]);var _0x6554c0=_['isEmpty'](_0x4b964c)&&_['isEmpty'](_0x413ec8)?null:_[_0xb903('0x7a')](_0x413ec8,_0x4b964c);if(_0x6554c0){var _0x2f0de3=[];for(var _0x2143dc=0x0;_0x2143dc<_0x6554c0['length'];_0x2143dc++){var _0x5eeb00=_[_0xb903('0x49')](_0x2a7b75,function(_0x5c1b54){return _0x6554c0[_0x2143dc]?_0x5c1b54[_0xb903('0x2c')]===_0x6554c0[_0x2143dc][_0xb903('0x2c')]:null;});if(_0x5eeb00){if(_0x6554c0[_0x2143dc][_0xb903('0x79')]){_0x2f0de3[_0xb903('0x66')](getAllResources(_0x50c45b[_0xb903('0x75')],_0x6554c0[_0x2143dc]));}else{if(!_0x6554c0[_0x2143dc][_0xb903('0x55')]){_0x2f0de3[_0xb903('0x66')](getAllowedResources(_0x5eeb00,_0x6554c0[_0x2143dc],_0x50c45b[_0xb903('0x75')]));}else{if(_0x5eeb00[_0xb903('0x31')]){_0x2f0de3[_0xb903('0x66')](getAllFilteredResources(_0x5eeb00,_0x6554c0[_0x2143dc]));}}}}}return BPromise[_0xb903('0x78')](_0x2f0de3);}else{return null;}})[_0xb903('0x27')](function(_0x3637d6){var _0x1aac64=_0x3637d6;var _0x4b2c70=null;if(_0x1aac64){_0x4b2c70=_0x1aac64[_0xb903('0x38')]===0x1?_0x1aac64[0x0]:null;}if(_0x4b2c70||_0x1aac64){var _0x1afba5=db[_0x50c45b[_0xb903('0x75')]][_0xb903('0x2e')];_0x451a01['model']=_[_0xb903('0x47')](_0x1afba5);_0x451a01[_0xb903('0x33')]=_[_0xb903('0x47')](_0x4664f7[_0xb903('0x33')]);_0x451a01['filters']=_[_0xb903('0x35')](_0x451a01[_0xb903('0x31')],_0x451a01[_0xb903('0x33')]);_0x326bc3[_0xb903('0x37')]=_['intersection'](_0x451a01[_0xb903('0x31')],qs[_0xb903('0x36')](_0x4664f7[_0xb903('0x33')]['fields']));_0x326bc3['attributes']=_0x326bc3[_0xb903('0x37')]['length']?_0x326bc3[_0xb903('0x37')]:_0x451a01['model'];if(!_0x4664f7['query'][_0xb903('0x7b')]('nolimit')){_0x326bc3[_0xb903('0x39')]=qs['limit'](_0x4664f7[_0xb903('0x33')][_0xb903('0x39')]);_0x326bc3['offset']=qs[_0xb903('0x20')](_0x4664f7[_0xb903('0x33')][_0xb903('0x20')]);}_0x326bc3[_0xb903('0x3a')]=qs['sort'](_0x4664f7[_0xb903('0x33')][_0xb903('0x3b')]);_0x326bc3[_0xb903('0x3c')]=qs[_0xb903('0x34')](_['pick'](_0x4664f7[_0xb903('0x33')],_0x451a01[_0xb903('0x34')]));if(_0x4664f7[_0xb903('0x33')][_0xb903('0x3d')]){_0x326bc3[_0xb903('0x3c')]=_[_0xb903('0x3e')](_0x326bc3[_0xb903('0x3c')],{'$or':_[_0xb903('0x32')](_0x1afba5,function(_0x223407){if(_0x223407[_0xb903('0x7c')][_0xb903('0x30')]!==_0xb903('0x3f')){var _0x46918c={};_0x46918c[_0x223407[_0xb903('0x7d')]]={'$like':'%'+_0x4664f7[_0xb903('0x33')]['filter']+'%'};return _0x46918c;}})});}var _0x115df9=[];if(_0x4b2c70){var _0x46ecb5=_['find'](_0x2a7b75,[_0xb903('0x2c'),_0x4b2c70[_0xb903('0x2c')]]);if(_0x46ecb5['field']){var _0x5e3955={};if(_0x50c45b['childModel']===_0xb903('0x7e')){_0x5e3955[_0x46ecb5[_0xb903('0x7f')]]=_[_0xb903('0x32')](_0x4b2c70[_0xb903('0x80')],'id');}else{_0x5e3955[_0x46ecb5[_0xb903('0x7f')]]=_0x4b2c70[_0xb903('0x80')];}_0x115df9['push'](_0x5e3955);}else{_0x326bc3['where']['id']=_0x4b2c70[_0xb903('0x80')];}}else{for(var _0x347dcd=0x0;_0x347dcd<_0x1aac64[_0xb903('0x38')];_0x347dcd++){var _0x46ecb5=_[_0xb903('0x49')](_0x2a7b75,[_0xb903('0x2c'),_0x1aac64[_0x347dcd][_0xb903('0x2c')]]);if(_0x46ecb5[_0xb903('0x7d')]){var _0x5e3955={};_0x5e3955[_0x46ecb5[_0xb903('0x7f')]]=_0x1aac64[_0x347dcd][_0xb903('0x80')];_0x115df9['push'](_0x5e3955);}else{if(!_0x326bc3[_0xb903('0x3c')]['id'])_0x326bc3['where']['id']=[];_0x1aac64[_0x347dcd][_0xb903('0x80')][_0xb903('0x69')](function(_0x136389){_0x326bc3[_0xb903('0x3c')]['id'][_0xb903('0x66')](_0x136389);});}}}if(!_['isEmpty'](_0x115df9)){_0x326bc3[_0xb903('0x3c')]=_['merge'](_0x326bc3[_0xb903('0x3c')],{'$and':{'$or':_0x115df9}});}_0x326bc3=_[_0xb903('0x3e')]({},_0x326bc3,_0x4664f7[_0xb903('0x40')]);if(_0x4b2c70&&!_0x4b2c70['autoAssociation']&&_0x50c45b[_0xb903('0x75')]==='AnalyticExtractedReport'){if(_0x4664f7[_0xb903('0x33')][_0xb903('0x42')]){_0x326bc3[_0xb903('0x48')]=[{'all':!![]}];}return db[_0x50c45b[_0xb903('0x75')]][_0xb903('0x56')](_0x326bc3)[_0xb903('0x27')](function(_0x45948f){var _0x10976e=[];_0x45948f[_0xb903('0x69')](function(_0x3ee156){var _0x170bbc;switch(_0x3ee156['reportType']){case _0xb903('0x81'):_0x170bbc=_[_0xb903('0x49')](_0x4b2c70[_0xb903('0x80')],function(_0x5756c5){return _0x5756c5['id']===_0x3ee156[_0xb903('0x82')]&&_0x5756c5[_0xb903('0x7c')]==='DefaultReports';});break;case _0xb903('0x83'):_0x170bbc=_['find'](_0x4b2c70[_0xb903('0x80')],function(_0x28ab60){return _0x28ab60['id']===_0x3ee156['reportId']&&_0x28ab60['type']===_0xb903('0x84');});break;}if(_0x170bbc)_0x10976e[_0xb903('0x66')](_0x3ee156);});_0x4644cd[_0xb903('0x1f')]=_0x10976e['length'];_0x4644cd[_0xb903('0x43')]=_0x10976e;return _0x4644cd;});}else{return db[_0x50c45b[_0xb903('0x75')]][_0xb903('0x1f')]({'where':_0x326bc3[_0xb903('0x3c')]})[_0xb903('0x27')](function(_0x4fad0e){_0x4644cd[_0xb903('0x1f')]=_0x4fad0e;if(_0x4664f7[_0xb903('0x33')][_0xb903('0x42')]){if(_0x50c45b[_0xb903('0x75')]===_0xb903('0x85')){_0x326bc3['include']=[{'model':db[_0xb903('0x86')],'as':_0xb903('0x87'),'attributes':['id',_0xb903('0x2c'),'color'],'required':_0x4664f7['query'][_0xb903('0x88')]?!![]:![]},{'model':db['Tag'],'as':_0xb903('0x89'),'attributes':['id','name','color'],'through':_0x4664f7['query']['tag']?{'attributes':[],'where':{'TagId':_0x4664f7[_0xb903('0x33')][_0xb903('0x88')]||undefined}}:{},'required':_0x4664f7['query']['tag']?!![]:![]}];}else{_0x326bc3[_0xb903('0x48')]=[{'all':!![]}];}}return db[_0x50c45b[_0xb903('0x75')]][_0xb903('0x56')](_0x326bc3);})['then'](function(_0x1f8f9d){_0x4644cd['rows']=_0x1f8f9d;return _0x4644cd;});}}else{return _0x4644cd;}})[_0xb903('0x27')](respondWithFilteredResult(_0x4845f5,_0x326bc3))[_0xb903('0x44')](handleError(_0x4845f5,null));};function getAllResources(_0x56351a,_0x4177e5){return new BPromise(function(_0x5e5fc0,_0x6875ee){if(_0x4177e5){var _0x9bed52=_0x4177e5[_0xb903('0x3d')]?{[_0x4177e5['filter'][_0xb903('0x7d')]]:_0x4177e5[_0xb903('0x3d')][_0xb903('0x8a')]}:undefined;return db[_0x56351a]['findAll']({'where':_0x9bed52,'raw':!![]})[_0xb903('0x27')](function(_0x42bcf4){_0x4177e5[_0xb903('0x80')]=_[_0xb903('0x32')](_0x42bcf4,'id');_0x5e5fc0(_0x4177e5);})[_0xb903('0x44')](function(_0x2a629e){_0x6875ee(_0x2a629e);});}else{_0x5e5fc0(null);}});}function getAllFilteredResources(_0x19bf2d,_0x57e421){return new BPromise(function(_0x2025e4,_0x50288b){var _0x3da7e4=_0x19bf2d['filter']?{[_0x19bf2d[_0xb903('0x3d')][_0xb903('0x7d')]]:_0x19bf2d[_0xb903('0x3d')][_0xb903('0x8a')]}:undefined;return db[_0x19bf2d[_0xb903('0x31')]]['findAll']({'where':_0x3da7e4,'raw':!![]})['then'](function(_0x552190){_0x57e421[_0xb903('0x80')]=_[_0xb903('0x32')](_0x552190,function(_0x323975){return _0x323975[_0xb903('0x2c')];});_0x2025e4(_0x57e421);})['catch'](function(_0x54b9b6){_0x50288b(_0x54b9b6);});});}function getAllowedResources(_0x47dbe9,_0x5a9906,_0x5e849a){return new BPromise(function(_0x307c6b,_0x3adf66){if(_0x5a9906){return db[_0xb903('0x5d')][_0xb903('0x56')]({'where':{'sectionId':_0x5a9906['id']},'raw':!![]})[_0xb903('0x27')](function(_0x1b09ab){if(_0x47dbe9[_0xb903('0x7d')]&&_0x47dbe9[_0xb903('0x7d')]!=='id'){_0x5a9906[_0xb903('0x80')]=_[_0xb903('0x32')](_0x1b09ab,function(_0x559321){return _0x559321[_0x47dbe9[_0xb903('0x7d')]];});}else{if(_0x5e849a===_0xb903('0x7e')){_0x5a9906['associatedResources']=_[_0xb903('0x32')](_0x1b09ab,function(_0x1c3e45){return{'id':_0x1c3e45['resourceId'],'type':_0x1c3e45[_0xb903('0x7c')]};});}else{_0x5a9906['associatedResources']=_['map'](_0x1b09ab,function(_0x3b8fdc){return _0x3b8fdc[_0xb903('0x6a')];});}}_0x307c6b(_0x5a9906);})['catch'](function(_0x423e89){_0x3adf66(_0x423e89);});}else{_0x307c6b(null);}});}function getQueryModels(_0x2f0750,_0x4c3f11){var _0x2bae68=_0x2f0750[_0xb903('0x8b')]();var _0x29734a={'childModel':undefined,'parentSections':[]};switch(_0x2bae68){case'squareprojects':_0x29734a[_0xb903('0x75')]='SquareProject';break;case _0xb903('0x8c'):_0x29734a[_0xb903('0x75')]=_0xb903('0x8d');break;case _0xb903('0x8e'):_0x29734a[_0xb903('0x75')]='SquareRecording';_0x29734a[_0xb903('0x77')]=[{'name':_0xb903('0x8f'),'field':_0xb903('0x2c'),'foreignKey':_0xb903('0x90')}];break;case'projects':_0x29734a[_0xb903('0x75')]=_0xb903('0x91');break;case'contacts':_0x29734a[_0xb903('0x75')]=_0xb903('0x85');_0x29734a[_0xb903('0x77')]=[{'name':_0xb903('0x92'),'field':'id','foreignKey':_0xb903('0x93')}];break;case _0xb903('0x94'):_0x29734a[_0xb903('0x75')]=_0xb903('0x95');break;case _0xb903('0x96'):_0x29734a[_0xb903('0x75')]=_0xb903('0x97');break;case'globalcustomfields':_0x29734a[_0xb903('0x75')]='CmCustomField';break;case _0xb903('0x98'):_0x29734a[_0xb903('0x75')]=_0xb903('0x99');break;case _0xb903('0x9a'):_0x29734a['childModel']='ChatWebsite';break;case _0xb903('0x9b'):_0x29734a[_0xb903('0x75')]=_0xb903('0x9c');break;case _0xb903('0x9d'):_0x29734a[_0xb903('0x75')]=_0xb903('0x9e');break;case _0xb903('0x9f'):case _0xb903('0xa0'):case'outboundroutes':_0x29734a[_0xb903('0x75')]=_0xb903('0xa1');break;case _0xb903('0xa2'):_0x29734a[_0xb903('0x75')]=_0xb903('0xa3');break;case _0xb903('0xa4'):_0x29734a[_0xb903('0x75')]=_0xb903('0xa5');break;case _0xb903('0xa6'):_0x29734a[_0xb903('0x75')]=_0xb903('0xa7');_0x29734a[_0xb903('0x77')]=[{'name':_0xb903('0xa8'),'field':_0xb903('0x2c'),'foreignKey':_0xb903('0xa9'),'model':_0xb903('0xaa'),'filter':{'field':_0xb903('0xab'),'value':[_0xb903('0xac')]}},{'name':_0xb903('0xad'),'field':_0xb903('0x2c'),'foreignKey':_0xb903('0xa9'),'model':_0xb903('0xaa'),'filter':{'field':_0xb903('0xab'),'value':[_0xb903('0xae')]}},{'name':'VoiceQueues','field':_0xb903('0x2c'),'foreignKey':'queue','model':_0xb903('0xaf'),'filter':{'field':'type','value':['inbound']}},{'name':_0xb903('0xb0'),'field':'name','foreignKey':_0xb903('0xb1'),'model':'VoiceQueue','filter':{'field':_0xb903('0x7c'),'value':['outbound']}}];break;case'musiconholds':_0x29734a[_0xb903('0x75')]=_0xb903('0xb2');break;case _0xb903('0xb3'):_0x29734a['childModel']='VoiceChanSpy';break;case'voiceprefixes':_0x29734a[_0xb903('0x75')]=_0xb903('0xb4');break;case _0xb903('0xb5'):_0x29734a[_0xb903('0x75')]=_0xb903('0xb6');break;case _0xb903('0xb7'):_0x29734a[_0xb903('0x75')]=_0xb903('0xb8');break;case _0xb903('0xb9'):_0x29734a[_0xb903('0x75')]=_0xb903('0xba');break;case'mailsubstatuses':_0x29734a[_0xb903('0x75')]=_0xb903('0xbb');break;case _0xb903('0xbc'):_0x29734a[_0xb903('0x75')]='OpenchannelQueue';break;case _0xb903('0xbd'):_0x29734a[_0xb903('0x75')]=_0xb903('0xbe');break;case _0xb903('0xbf'):_0x29734a['childModel']=_0xb903('0xc0');break;case _0xb903('0xc1'):_0x29734a[_0xb903('0x75')]='SmsAccount';break;case'whatsappqueues':_0x29734a[_0xb903('0x75')]=_0xb903('0xc2');break;case'whatsappaccounts':_0x29734a[_0xb903('0x75')]=_0xb903('0xc3');break;case'teams':_0x29734a[_0xb903('0x75')]=_0xb903('0xc4');break;case _0xb903('0xc5'):case'queuecampaigns':_0x29734a['childModel']=_0xb903('0xaf');if(_0x4c3f11){_0x29734a[_0xb903('0x77')]=[{'name':_0xb903('0xc6')},{'name':'QueueCampaigns'}];}break;case _0xb903('0xc7'):case'agents':case'telephones':_0x29734a[_0xb903('0x75')]='User';if(_0x4c3f11){_0x29734a['parentSections']=[{'name':_0xb903('0xc8'),'filter':{'field':_0xb903('0xab'),'value':[_0xb903('0xc9'),'user']},'ignore':!![]},{'name':_0xb903('0xa8')},{'name':_0xb903('0xad')}];}break;case _0xb903('0xca'):_0x29734a[_0xb903('0x75')]=_0xb903('0xcb');break;case _0xb903('0xcc'):_0x29734a[_0xb903('0x75')]=_0xb903('0xcd');break;case _0xb903('0xce'):_0x29734a[_0xb903('0x75')]=_0xb903('0xcf');break;case'sugarcrmaccounts':_0x29734a['childModel']='SugarcrmAccount';break;case _0xb903('0xd0'):_0x29734a[_0xb903('0x75')]='DeskAccount';break;case _0xb903('0xd1'):_0x29734a[_0xb903('0x75')]='ZohoAccount';break;case _0xb903('0xd2'):_0x29734a[_0xb903('0x75')]=_0xb903('0xaa');break;case _0xb903('0xd3'):_0x29734a[_0xb903('0x75')]=_0xb903('0xd4');break;case _0xb903('0xd5'):_0x29734a['childModel']=_0xb903('0xd6');break;case'customdashboards':_0x29734a[_0xb903('0x75')]=_0xb903('0x68');break;case _0xb903('0xd7'):_0x29734a[_0xb903('0x75')]=_0xb903('0xd8');break;case'pauses':_0x29734a[_0xb903('0x75')]=_0xb903('0xd9');break;case _0xb903('0xda'):_0x29734a[_0xb903('0x75')]='Schedule';break;case _0xb903('0xdb'):_0x29734a[_0xb903('0x75')]=_0xb903('0xdc');break;case'tags':_0x29734a['childModel']=_0xb903('0x86');break;case'templates':_0x29734a[_0xb903('0x75')]='Template';break;case _0xb903('0xdd'):_0x29734a[_0xb903('0x75')]='Trigger';break;case _0xb903('0xde'):_0x29734a[_0xb903('0x75')]=_0xb903('0xdf');break;case _0xb903('0xe0'):_0x29734a[_0xb903('0x75')]=_0xb903('0xe1');break;case _0xb903('0xe2'):_0x29734a[_0xb903('0x75')]='Plugin';break;case _0xb903('0xe3'):_0x29734a[_0xb903('0x75')]=_0xb903('0x7e');_0x29734a[_0xb903('0x77')]=[{'name':_0xb903('0xe4'),'field':'id','foreignKey':_0xb903('0x82')}];break;case _0xb903('0xe5'):_0x29734a['childModel']=_0xb903('0xe6');break;case'whatsappaccounts':_0x29734a['childModel']=_0xb903('0xc3');break;default:return _0x29734a;}return _0x29734a;}
\ No newline at end of file
+var _0xc86f=['length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','clone','omit','updatedAt','crudPermissions','createdAt','transaction','UserProfileSection','each','autoAssociation','sectionId','userProfileId','Resources','UserProfileResource','update','describe','sequelize','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','push','findOne','forEach','resourceId','Plugin','addResources','bulkCreate','get','removeResources','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','Invalid\x20section\x20\x27','parentSections','all','ignore','union','childModel','pick','type','VIRTUAL','field','associatedResources','foreignKey','reportType','default','reportId','rows','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareProject','odbc','squarerecordings','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','CmCustomField','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','internalroutes','VoiceExtension','contexts','VoiceContext','VoiceMail','VoiceRecording','Agents','User','role','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','teams','Team','voicequeues','users','agents','admin','user','ZendeskAccount','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','SugarcrmAccount','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','tags','templates','triggers','variables','Variable','plugins','extractedreports','AnalyticExtractedReport','metrics','AnalyticMetric','whatsappaccounts','WhatsappAccount','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','apply','save','then','destroy','error','stack','UserProfile','rawAttributes','key','model','map','name','query','keys','filters','intersection','attributes','fields'];(function(_0x3ecd68,_0x4930c4){var _0x1a39cc=function(_0x549817){while(--_0x549817){_0x3ecd68['push'](_0x3ecd68['shift']());}};_0x1a39cc(++_0x4930c4);}(_0xc86f,0xb3));var _0xfc86=function(_0x2713f5,_0x382adb){_0x2713f5=_0x2713f5-0x0;var _0x4e6249=_0xc86f[_0x2713f5];return _0x4e6249;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc86('0x0'));var rimraf=require(_0xfc86('0x1'));var zipdir=require(_0xfc86('0x2'));var jsonpatch=require(_0xfc86('0x3'));var rp=require(_0xfc86('0x4'));var moment=require('moment');var BPromise=require(_0xfc86('0x5'));var Mustache=require('mustache');var util=require(_0xfc86('0x6'));var path=require('path');var sox=require(_0xfc86('0x7'));var csv=require(_0xfc86('0x8'));var ejs=require(_0xfc86('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfc86('0xa'));var crypto=require(_0xfc86('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfc86('0xc'));var toCsv=require(_0xfc86('0x8'));var querystring=require('querystring');var Papa=require(_0xfc86('0xd'));var Redis=require(_0xfc86('0xe'));var authService=require(_0xfc86('0xf'));var qs=require(_0xfc86('0x10'));var as=require(_0xfc86('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfc86('0x12'))(_0xfc86('0x13'));var utils=require('../../config/utils');var config=require(_0xfc86('0x14'));var licenseUtil=require(_0xfc86('0x15'));var db=require(_0xfc86('0x16'))['db'];config[_0xfc86('0x17')]=_['defaults'](config[_0xfc86('0x17')],{'host':_0xfc86('0x18'),'port':0x18eb});var socket=require(_0xfc86('0x19'))(new Redis(config[_0xfc86('0x17')]));require('./userProfile.socket')[_0xfc86('0x1a')](socket);function respondWithStatusCode(_0x1098c3,_0x3085f7){_0x3085f7=_0x3085f7||0xcc;return function(_0x49d0ca){if(_0x49d0ca){return _0x1098c3[_0xfc86('0x1b')](_0x3085f7);}return _0x1098c3[_0xfc86('0x1c')](_0x3085f7)[_0xfc86('0x1d')]();};}function respondWithResult(_0x1a31e8,_0x18ee80){_0x18ee80=_0x18ee80||0xc8;return function(_0x1f1a5c){if(_0x1f1a5c){return _0x1a31e8['status'](_0x18ee80)[_0xfc86('0x1e')](_0x1f1a5c);}};}function respondWithFilteredResult(_0x653a36,_0x347d00){return function(_0x9d3f03){if(_0x9d3f03){var _0x917206=_0x9d3f03[_0xfc86('0x1f')],_0x2e3167=_0x347d00[_0xfc86('0x20')],_0xaa96f1=_0x347d00[_0xfc86('0x20')]+_0x347d00['limit'],_0x117004;if(_0xaa96f1>=_0x917206){_0xaa96f1=_0x917206;_0x117004=0xc8;}else{_0x117004=0xce;}_0x653a36[_0xfc86('0x1c')](_0x117004);return _0x653a36['set']('Content-Range',_0x2e3167+'-'+_0xaa96f1+'/'+_0x917206)[_0xfc86('0x1e')](_0x9d3f03);}return null;};}function patchUpdates(_0x44c867){return function(_0x5439de){try{jsonpatch[_0xfc86('0x21')](_0x5439de,_0x44c867,!![]);}catch(_0xea65d9){return BPromise['reject'](_0xea65d9);}return _0x5439de[_0xfc86('0x22')]();};}function saveUpdates(_0x1a7cc6,_0x11238a){return function(_0x55e81a){if(_0x55e81a){return _0x55e81a['update'](_0x1a7cc6)[_0xfc86('0x23')](function(_0x386b16){return _0x386b16;});}return null;};}function removeEntity(_0x1cec62,_0x579d8e){return function(_0x912a3d){if(_0x912a3d){return _0x912a3d[_0xfc86('0x24')]()[_0xfc86('0x23')](function(){_0x1cec62['status'](0xcc)[_0xfc86('0x1d')]();});}};}function handleEntityNotFound(_0xa3322f,_0x20d90f){return function(_0x33b875){if(!_0x33b875){_0xa3322f[_0xfc86('0x1b')](0x194);}return _0x33b875;};}function handleError(_0xa590fa,_0x579497){_0x579497=_0x579497||0x1f4;return function(_0x3131a8){logger[_0xfc86('0x25')](_0x3131a8[_0xfc86('0x26')]);if(_0x3131a8['name']){delete _0x3131a8['name'];}_0xa590fa[_0xfc86('0x1c')](_0x579497)['send'](_0x3131a8);};}exports['index']=function(_0xf914cf,_0x3ccfcc){var _0x200be0={},_0x3a8ed4={},_0x29e60a={'count':0x0,'rows':[]};var _0x926029=_['map'](db[_0xfc86('0x27')][_0xfc86('0x28')],function(_0x12b693){return{'name':_0x12b693['fieldName'],'type':_0x12b693['type'][_0xfc86('0x29')]};});_0x3a8ed4[_0xfc86('0x2a')]=_[_0xfc86('0x2b')](_0x926029,_0xfc86('0x2c'));_0x3a8ed4[_0xfc86('0x2d')]=_[_0xfc86('0x2e')](_0xf914cf['query']);_0x3a8ed4[_0xfc86('0x2f')]=_[_0xfc86('0x30')](_0x3a8ed4[_0xfc86('0x2a')],_0x3a8ed4[_0xfc86('0x2d')]);_0x200be0[_0xfc86('0x31')]=_['intersection'](_0x3a8ed4[_0xfc86('0x2a')],qs['fields'](_0xf914cf[_0xfc86('0x2d')][_0xfc86('0x32')]));_0x200be0['attributes']=_0x200be0['attributes'][_0xfc86('0x33')]?_0x200be0[_0xfc86('0x31')]:_0x3a8ed4[_0xfc86('0x2a')];if(!_0xf914cf[_0xfc86('0x2d')][_0xfc86('0x34')](_0xfc86('0x35'))){_0x200be0[_0xfc86('0x36')]=qs['limit'](_0xf914cf['query']['limit']);_0x200be0[_0xfc86('0x20')]=qs['offset'](_0xf914cf['query'][_0xfc86('0x20')]);}_0x200be0[_0xfc86('0x37')]=qs[_0xfc86('0x38')](_0xf914cf['query'][_0xfc86('0x38')]);_0x200be0['where']=qs[_0xfc86('0x2f')](_['pick'](_0xf914cf[_0xfc86('0x2d')],_0x3a8ed4['filters']),_0x926029);if(_0xf914cf[_0xfc86('0x2d')][_0xfc86('0x39')]){_0x200be0[_0xfc86('0x3a')]=_[_0xfc86('0x3b')](_0x200be0[_0xfc86('0x3a')],{'$or':_['map'](_0x926029,function(_0x27d8e9){if(_0x27d8e9['type']!=='VIRTUAL'){var _0x1cbdca={};_0x1cbdca[_0x27d8e9[_0xfc86('0x2c')]]={'$like':'%'+_0xf914cf[_0xfc86('0x2d')][_0xfc86('0x39')]+'%'};return _0x1cbdca;}})});}_0x200be0=_['merge']({},_0x200be0,_0xf914cf[_0xfc86('0x3c')]);var _0x20da03={'where':_0x200be0[_0xfc86('0x3a')]};return db[_0xfc86('0x27')][_0xfc86('0x1f')](_0x20da03)['then'](function(_0x4a2cbf){_0x29e60a[_0xfc86('0x1f')]=_0x4a2cbf;if(_0xf914cf[_0xfc86('0x2d')][_0xfc86('0x3d')]){_0x200be0[_0xfc86('0x3e')]=[{'all':!![]}];}return db[_0xfc86('0x27')][_0xfc86('0x3f')](_0x200be0);})['then'](function(_0x4971eb){_0x29e60a['rows']=_0x4971eb;return _0x29e60a;})['then'](respondWithFilteredResult(_0x3ccfcc,_0x200be0))['catch'](handleError(_0x3ccfcc,null));};exports[_0xfc86('0x40')]=function(_0x4074d9,_0x4c5463){var _0x45f069={'raw':![],'where':{'id':_0x4074d9[_0xfc86('0x41')]['id']}},_0x4c6616={};_0x4c6616['model']=_[_0xfc86('0x2e')](db[_0xfc86('0x27')][_0xfc86('0x28')]);_0x4c6616['query']=_[_0xfc86('0x2e')](_0x4074d9[_0xfc86('0x2d')]);_0x4c6616[_0xfc86('0x2f')]=_[_0xfc86('0x30')](_0x4c6616[_0xfc86('0x2a')],_0x4c6616['query']);_0x45f069[_0xfc86('0x31')]=_[_0xfc86('0x30')](_0x4c6616[_0xfc86('0x2a')],qs[_0xfc86('0x32')](_0x4074d9[_0xfc86('0x2d')][_0xfc86('0x32')]));_0x45f069[_0xfc86('0x31')]=_0x45f069[_0xfc86('0x31')][_0xfc86('0x33')]?_0x45f069[_0xfc86('0x31')]:_0x4c6616['model'];if(_0x4074d9[_0xfc86('0x2d')][_0xfc86('0x3d')]){_0x45f069[_0xfc86('0x3e')]=[{'all':!![]}];}_0x45f069=_[_0xfc86('0x3b')]({},_0x45f069,_0x4074d9[_0xfc86('0x3c')]);return db[_0xfc86('0x27')][_0xfc86('0x42')](_0x45f069)[_0xfc86('0x23')](handleEntityNotFound(_0x4c5463,null))[_0xfc86('0x23')](respondWithResult(_0x4c5463,null))[_0xfc86('0x43')](handleError(_0x4c5463,null));};exports[_0xfc86('0x44')]=function(_0x3c4f3d,_0xd880e0){return db[_0xfc86('0x27')]['create'](_0x3c4f3d[_0xfc86('0x45')],{})[_0xfc86('0x23')](respondWithResult(_0xd880e0,0xc9))[_0xfc86('0x43')](handleError(_0xd880e0,null));};exports[_0xfc86('0x46')]=function(_0x39a2e,_0x26b236){var _0x26e602={'where':{'id':_0x39a2e['params']['id']}},_0x1f6911={};_0x1f6911[_0xfc86('0x2a')]=_[_0xfc86('0x2e')](db['UserProfile']['rawAttributes']);_0x26e602[_0xfc86('0x31')]=_[_0xfc86('0x30')](_0x1f6911[_0xfc86('0x2a')],qs[_0xfc86('0x32')](_0x39a2e['query'][_0xfc86('0x32')]));_0x26e602[_0xfc86('0x31')]=_0x26e602[_0xfc86('0x31')][_0xfc86('0x33')]?_0x26e602['attributes']:_0x1f6911[_0xfc86('0x2a')];if(_0x39a2e['query'][_0xfc86('0x3d')]){_0x26e602[_0xfc86('0x3e')]=[{'all':!![]}];}_0x26e602=_[_0xfc86('0x3b')]({},_0x26e602,_0x39a2e['options']);return db[_0xfc86('0x27')][_0xfc86('0x42')](_0x26e602)['then'](handleEntityNotFound(_0x26b236,null))['then'](function(_0x30a07e){if(_0x30a07e){var _0x5ee6fe=_0x30a07e['get']({'plain':!![]});_0x5ee6fe=qs[_0xfc86('0x47')](_0x5ee6fe,['id','createdAt',_0xfc86('0x48'),_0xfc86('0x49')]);_0x39a2e[_0xfc86('0x45')]=_[_0xfc86('0x47')](_0x39a2e[_0xfc86('0x45')],['id',_0xfc86('0x4a'),_0xfc86('0x48')]);return db['sequelize'][_0xfc86('0x4b')](function(_0xbfa740){return db[_0xfc86('0x27')][_0xfc86('0x44')](_[_0xfc86('0x3b')](_0x5ee6fe,_0x39a2e[_0xfc86('0x45')]),{'include':_0x39a2e['query'][_0xfc86('0x3d')]?[{'all':!![]}]:undefined,'transaction':_0xbfa740})[_0xfc86('0x23')](function(_0x2570fc){var _0x5382e5=_0x2570fc['get']({'plain':!![]});return db[_0xfc86('0x4c')][_0xfc86('0x3f')]({'where':{'userProfileId':_0x39a2e[_0xfc86('0x41')]['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x54b1f0){if(_0x54b1f0){return BPromise[_0xfc86('0x4d')](_0x54b1f0,function(_0x2acb34){return new BPromise(function(_0x43b6f6,_0x506ad7){if(_0x2acb34[_0xfc86('0x4e')]===null||_0x2acb34[_0xfc86('0x4e')]===0x1)_0x43b6f6(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2acb34['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x20f8d6){var _0x161a59=_[_0xfc86('0x2b')](_0x20f8d6,function(_0x49035c){return qs[_0xfc86('0x47')](_0x49035c,['id',_0xfc86('0x4a'),_0xfc86('0x48'),_0xfc86('0x4f')]);});_0x43b6f6(_0x161a59);})[_0xfc86('0x43')](function(_0x4ccf3c){_0x506ad7(_0x4ccf3c);});})['then'](function(_0x45e5ad){var _0x46f5c5=qs[_0xfc86('0x47')](_0x2acb34,['id',_0xfc86('0x4a'),'updatedAt']);_0x46f5c5[_0xfc86('0x50')]=_0x5382e5['id'];if(_0x45e5ad)_0x46f5c5[_0xfc86('0x51')]=_0x45e5ad;return _0x46f5c5;})[_0xfc86('0x23')](function(_0x2ce8e3){return db[_0xfc86('0x4c')]['create'](_0x2ce8e3,{'include':[{'model':db[_0xfc86('0x52')],'as':_0xfc86('0x51')}],'raw':!![],'transaction':_0xbfa740});});})[_0xfc86('0x23')](function(){return _0x5382e5;});}});});});}})[_0xfc86('0x23')](respondWithResult(_0x26b236,0xc9))[_0xfc86('0x43')](handleError(_0x26b236,null));};exports[_0xfc86('0x53')]=function(_0x252ecd,_0x3368ce){if(_0x252ecd[_0xfc86('0x45')]['id']){delete _0x252ecd[_0xfc86('0x45')]['id'];}return db[_0xfc86('0x27')][_0xfc86('0x42')]({'where':{'id':_0x252ecd['params']['id']}})[_0xfc86('0x23')](handleEntityNotFound(_0x3368ce,null))['then'](saveUpdates(_0x252ecd[_0xfc86('0x45')],null))[_0xfc86('0x23')](respondWithResult(_0x3368ce,null))['catch'](handleError(_0x3368ce,null));};exports['destroy']=function(_0x12ccf8,_0x3b76f4){return db['UserProfile'][_0xfc86('0x42')]({'where':{'id':_0x12ccf8[_0xfc86('0x41')]['id']}})[_0xfc86('0x23')](handleEntityNotFound(_0x3b76f4,null))[_0xfc86('0x23')](removeEntity(_0x3b76f4,null))[_0xfc86('0x43')](handleError(_0x3b76f4,null));};exports[_0xfc86('0x54')]=function(_0x511685,_0x2825aa){return db[_0xfc86('0x27')][_0xfc86('0x54')]()[_0xfc86('0x23')](respondWithResult(_0x2825aa,null))[_0xfc86('0x43')](handleError(_0x2825aa,null));};exports['addSections']=function(_0x200c88,_0x3bcb42){var _0x16188d=_0x200c88[_0xfc86('0x45')];return db[_0xfc86('0x27')][_0xfc86('0x42')]({'where':{'id':_0x200c88['params']['id']}})[_0xfc86('0x23')](handleEntityNotFound(_0x3bcb42,null))[_0xfc86('0x23')](function(_0x42a726){if(_0x42a726){return db[_0xfc86('0x55')]['transaction'](function(_0x3ff6ef){return db[_0xfc86('0x4c')][_0xfc86('0x24')]({'where':{'userProfileId':_0x200c88[_0xfc86('0x41')]['id'],'sectionId':_[_0xfc86('0x2b')](_0x16188d,function(_0x51d989){return _0x51d989[_0xfc86('0x4f')];})},'transaction':_0x3ff6ef})[_0xfc86('0x23')](function(){var _0x20292f=_['map'](_0x16188d,function(_0x396dfd){_0x396dfd[_0xfc86('0x50')]=_0x200c88[_0xfc86('0x41')]['id'];return _0x396dfd;});var _0x32c0b5=[];return BPromise[_0xfc86('0x4d')](_0x20292f,function(_0x505e34){return db[_0xfc86('0x4c')]['create'](_0x505e34,{'include':[{'model':db[_0xfc86('0x52')],'as':_0xfc86('0x51')}],'raw':!![],'transaction':_0x3ff6ef})[_0xfc86('0x23')](function(_0x4a9fd5){_0x32c0b5['push'](_0x4a9fd5['get']({'plain':!![]}));});})[_0xfc86('0x23')](function(){return _0x32c0b5;});});});}})[_0xfc86('0x23')](function(_0xbccff3){return _0xbccff3;})['then'](respondWithResult(_0x3bcb42,null))[_0xfc86('0x43')](handleError(_0x3bcb42,null));};exports[_0xfc86('0x56')]=function(_0x586a88,_0x27c2d2){var _0x20b96c;return db[_0xfc86('0x27')][_0xfc86('0x42')]({'where':{'id':_0x586a88[_0xfc86('0x41')]['id']},'attributes':['id',_0xfc86('0x2c')]})[_0xfc86('0x23')](handleEntityNotFound(_0x27c2d2,null))[_0xfc86('0x23')](function(_0x821fbc){if(_0x821fbc){_0x20b96c=_0x821fbc;return db[_0xfc86('0x4c')][_0xfc86('0x24')]({'where':{'userProfileId':_0x586a88[_0xfc86('0x41')]['id'],'sectionId':_0x586a88[_0xfc86('0x2d')][_0xfc86('0x57')]}});}})[_0xfc86('0x23')](function(){return _0x20b96c;})['then'](respondWithStatusCode(_0x27c2d2,null))[_0xfc86('0x43')](handleError(_0x27c2d2,null));};exports[_0xfc86('0x58')]=function(_0xedcfc3,_0x19d2a1){var _0x473694=[];var _0x12735e=[];return db['UserProfileSection'][_0xfc86('0x3f')]({'where':{'userProfileId':_0xedcfc3[_0xfc86('0x41')]['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x1d2aff){_0x473694=_[_0xfc86('0x39')](_0x1d2aff,function(_0x3b0cf4){return _0x3b0cf4[_0xfc86('0x59')]===0x1||_['includes']([0x3eb,0x709],_0x3b0cf4[_0xfc86('0x4f')]);});if(!_[_0xfc86('0x5a')](_0x473694)){return _[_0xfc86('0x2b')](_0x473694,function(_0xc840ad){return _0xc840ad[_0xfc86('0x4f')];});}else{return;}})['then'](function(_0x2aeafc){if(_0x2aeafc)_0x12735e=_0x2aeafc;if(_[_0xfc86('0x5b')](_0x12735e,0x64)){var _0x103c31=_[_0xfc86('0x42')](_0x473694,{'sectionId':0x64});return hasDefaultDashboard(_0x103c31)[_0xfc86('0x23')](function(_0x2cb602){return _[_0xfc86('0x2b')](_0x473694,function(_0x364107){if(_0x364107[_0xfc86('0x4f')]===0x64){_0x364107[_0xfc86('0x5c')]=_0x2cb602;}return _0x364107;});});}else{return;}})[_0xfc86('0x23')](function(_0x118a91){if(_0x118a91)_0x473694=_0x118a91;if(_['includes'](_0x12735e,0x3eb)){var _0x4a41fa=_['find'](_0x473694,{'sectionId':0x3eb});return getCustomDashboards(_0x4a41fa)[_0xfc86('0x23')](function(_0x25dca6){return _[_0xfc86('0x2b')](_0x473694,function(_0x4348cb){if(_0x4a41fa[_0xfc86('0x59')]){if(_0x4348cb[_0xfc86('0x4f')]===0x3eb){_0x4348cb[_0xfc86('0x5c')]=_0x25dca6;}}else{if(_0x4348cb[_0xfc86('0x4f')]===0x64){_0x4348cb[_0xfc86('0x5c')]=_0x25dca6;}}return _0x4348cb;});});}else{return;}})[_0xfc86('0x23')](function(_0x3a0b03){if(_0x3a0b03)_0x473694=_0x3a0b03;if(_[_0xfc86('0x5b')](_0x12735e,0x709)){var _0x470420=_[_0xfc86('0x42')](_0x473694,{'sectionId':0x709});return getPlugins(_0x470420)[_0xfc86('0x23')](function(_0x31a4be){if(_0x470420[_0xfc86('0x59')]){return _[_0xfc86('0x2b')](_0x473694,function(_0x3d875a){if(_0x3d875a[_0xfc86('0x4f')]===0x709){_0x3d875a[_0xfc86('0x5c')]=_0x31a4be;}return _0x3d875a;});}else{var _0x2c629b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x31a4be};var _0x16392f=_['map'](_0x473694);_0x16392f[_0xfc86('0x5d')](_0x2c629b);return _0x16392f;}});}else{return;}})[_0xfc86('0x23')](function(_0x1a31bb){if(_0x1a31bb)_0x473694=_0x1a31bb;return _[_0xfc86('0x39')](_0x473694,['enabled',0x1]);})['then'](respondWithResult(_0x19d2a1,null))[_0xfc86('0x43')](handleError(_0x19d2a1,null));};function hasDefaultDashboard(_0x38a363){var _0x21fe8c=[0x65];return new BPromise(function(_0x3158ed,_0x5f1078){try{if(_0x38a363[_0xfc86('0x4e')]){_0x3158ed(_0x21fe8c);}else{return db['UserProfileResource'][_0xfc86('0x5e')]({'where':{'sectionId':_0x38a363['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x2ef5c5){_0x2ef5c5?_0x3158ed(_0x21fe8c):_0x3158ed();});}}catch(_0x27833d){_0x5f1078(_0x27833d);}});}function getCustomDashboards(_0x436052){var _0x377e37=[];return new BPromise(function(_0x5c8cff,_0x289f20){try{if(_0x436052[_0xfc86('0x4e')]){return db['Dashboard'][_0xfc86('0x3f')]({'raw':!![]})[_0xfc86('0x23')](function(_0x5ec156){_0x5ec156[_0xfc86('0x5f')](function(_0x57ec9b){_0x377e37[_0xfc86('0x5d')](_0x57ec9b['id']+0x1869f);});_0x5c8cff(_0x377e37);});}else{return db[_0xfc86('0x52')][_0xfc86('0x3f')]({'where':{'sectionId':_0x436052['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x2035a5){_0x2035a5['forEach'](function(_0x1b8b71){_0x377e37[_0xfc86('0x5d')](_0x1b8b71[_0xfc86('0x60')]+0x1869f);});_0x5c8cff(_0x377e37);});}}catch(_0x31b90a){_0x289f20(_0x31b90a);}});}function getPlugins(_0x278046){var _0x35f4a5=[];return new BPromise(function(_0x7dfbc,_0x2a644a){try{if(_0x278046['autoAssociation']){return db[_0xfc86('0x61')][_0xfc86('0x3f')]({'raw':!![]})[_0xfc86('0x23')](function(_0x20a2ed){_0x20a2ed['forEach'](function(_0x3d6dfe){_0x35f4a5[_0xfc86('0x5d')](_0x3d6dfe['id']+0x15b38);});_0x7dfbc(_0x35f4a5);});}else{return db[_0xfc86('0x52')][_0xfc86('0x3f')]({'where':{'sectionId':_0x278046['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x3f910f){_0x3f910f['forEach'](function(_0x1ee07e){_0x35f4a5[_0xfc86('0x5d')](_0x1ee07e[_0xfc86('0x60')]+0x15b38);});_0x7dfbc(_0x35f4a5);});}}catch(_0xf4b6f9){_0x2a644a(_0xf4b6f9);}});}exports[_0xfc86('0x62')]=function(_0x1149ee,_0x6b19e1){return db[_0xfc86('0x27')]['find']({'where':{'id':_0x1149ee[_0xfc86('0x41')]['id']}})[_0xfc86('0x23')](handleEntityNotFound(_0x6b19e1,null))[_0xfc86('0x23')](function(_0x7501d3){if(_0x7501d3){return db['sequelize'][_0xfc86('0x4b')](function(_0x4a082b){return db['UserProfileSection'][_0xfc86('0x3f')]({'where':{'userProfileId':_0x1149ee[_0xfc86('0x41')]['id']},'attributes':['id'],'raw':!![]})[_0xfc86('0x23')](function(_0xe02640){if(_0xe02640){return db[_0xfc86('0x4c')][_0xfc86('0x24')]({'where':{'userProfileId':_0x1149ee[_0xfc86('0x41')]['id'],'id':_[_0xfc86('0x2b')](_0xe02640,function(_0x209e0a){return _0x209e0a['id'];})},'transaction':_0x4a082b});}})['then'](function(_0x137c17){var _0x2c7dbb=_['map'](_0x1149ee[_0xfc86('0x45')],function(_0x1a7e5d){_0x1a7e5d[_0xfc86('0x50')]=_0x1149ee[_0xfc86('0x41')]['id'];return _0x1a7e5d;});return db[_0xfc86('0x4c')][_0xfc86('0x63')](_0x2c7dbb,{'raw':!![],'transaction':_0x4a082b});})[_0xfc86('0x23')](function(_0x1d24cc){var _0x59f1a6=_[_0xfc86('0x39')](_[_0xfc86('0x2b')](_0x1d24cc,function(_0x386988){return _0x386988['get']({'plain':!![]});}),{'includeAll':![]});if(_0x59f1a6){return db[_0xfc86('0x4c')][_0xfc86('0x3f')]({'where':{'userProfileId':_0x1149ee[_0xfc86('0x41')]['id'],'sectionId':_[_0xfc86('0x2b')](_0x59f1a6,function(_0x5a18eb){return _0x5a18eb[_0xfc86('0x4f')];})},'attributes':['id',_0xfc86('0x4f')],'raw':!![]})[_0xfc86('0x23')](function(_0x40482e){var _0x1b04c=_['map'](_0x1149ee[_0xfc86('0x45')],function(_0x5d429a){_0x5d429a['userProfileId']=_0x1149ee[_0xfc86('0x41')]['id'];return _0x5d429a;});return db[_0xfc86('0x52')][_0xfc86('0x63')](_0x1b04c,{'raw':!![],'transaction':_0x4a082b});});}})[_0xfc86('0x43')](handleError(_0x6b19e1,null));});}})[_0xfc86('0x23')](function(_0x4aac1e){var _0x35ec80=_[_0xfc86('0x2b')](_0x4aac1e,function(_0x31a244){return _0x31a244[_0xfc86('0x64')]({'plain':!![]});});})[_0xfc86('0x23')](respondWithResult(_0x6b19e1,null))[_0xfc86('0x43')](handleError(_0x6b19e1,null));};exports[_0xfc86('0x65')]=function(_0xb5d911,_0x355887,_0x58f41f){return db[_0xfc86('0x27')][_0xfc86('0x42')]({'where':{'id':_0xb5d911[_0xfc86('0x41')]['id']}})['then'](handleEntityNotFound(_0x355887,null))[_0xfc86('0x23')](function(_0x26639b){if(_0x26639b){return _0x26639b['removeResources'](_0xb5d911[_0xfc86('0x2d')][_0xfc86('0x57')]);}})[_0xfc86('0x23')](respondWithStatusCode(_0x355887,null))['catch'](handleError(_0x355887,null));};exports[_0xfc86('0x66')]=function(_0x5999de,_0xfa1a08){var _0x5a723d={'raw':![],'where':{}};var _0x1e3fab={};var _0x332444={'count':0x0,'rows':[]};var _0x4738d6=_0x5999de[_0xfc86('0x2d')][_0xfc86('0x67')];if(typeof _0x4738d6===_0xfc86('0x68')){throw new db[(_0xfc86('0x69'))][(_0xfc86('0x6a'))](_0xfc86('0x6b'));}var _0x3a7868=_0x5999de['query'][_0xfc86('0x6c')]||![];var _0x3cdbb2=getQueryModels(_0x4738d6,_0x3a7868);if(typeof _0x3cdbb2['childModel']==='undefined'){throw new db['Sequelize']['ValidationError'](_0xfc86('0x6d')+_0x4738d6+'\x27');}var _0x259e50=[];if(!_['isEmpty'](_0x3cdbb2[_0xfc86('0x6e')])){_0x259e50=_0x3cdbb2[_0xfc86('0x6e')];}else{_0x259e50=[{'name':_0x4738d6}];}return db['UserProfile'][_0xfc86('0x5e')]({'where':{'id':_0x5999de[_0xfc86('0x41')]['id']}})['then'](handleEntityNotFound(_0xfa1a08,null))[_0xfc86('0x23')](function(_0x1ad19d){if(_0x1ad19d){var _0x5e411e=[];for(var _0x22c8c3=0x0;_0x22c8c3<_0x259e50[_0xfc86('0x33')];_0x22c8c3++){_0x5e411e[_0xfc86('0x5d')](db['UserProfileSection'][_0xfc86('0x5e')]({'where':{'userProfileId':_0x1ad19d['id'],'name':_0x259e50[_0x22c8c3][_0xfc86('0x2c')]},'raw':!![]}));}return BPromise[_0xfc86('0x6f')](_0x5e411e);}})['then'](function(_0x9e1b68){var _0x5add7b=_[_0xfc86('0x39')](_0x9e1b68,function(_0x2e4af0){return _0x2e4af0?_0x2e4af0:undefined;});var _0x5c9b05=_['filter'](_0x259e50,[_0xfc86('0x70'),!![]]);var _0x494267=_[_0xfc86('0x5a')](_0x5add7b)&&_['isEmpty'](_0x5c9b05)?null:_[_0xfc86('0x71')](_0x5c9b05,_0x5add7b);if(_0x494267){var _0x6a4373=[];for(var _0x986ce7=0x0;_0x986ce7<_0x494267[_0xfc86('0x33')];_0x986ce7++){var _0x40f995=_[_0xfc86('0x42')](_0x259e50,function(_0x2a884d){return _0x494267[_0x986ce7]?_0x2a884d[_0xfc86('0x2c')]===_0x494267[_0x986ce7][_0xfc86('0x2c')]:null;});if(_0x40f995){if(_0x494267[_0x986ce7][_0xfc86('0x70')]){_0x6a4373['push'](getAllResources(_0x3cdbb2[_0xfc86('0x72')],_0x494267[_0x986ce7]));}else{if(!_0x494267[_0x986ce7]['autoAssociation']){_0x6a4373[_0xfc86('0x5d')](getAllowedResources(_0x40f995,_0x494267[_0x986ce7],_0x3cdbb2[_0xfc86('0x72')]));}else{if(_0x40f995[_0xfc86('0x2a')]){_0x6a4373['push'](getAllFilteredResources(_0x40f995,_0x494267[_0x986ce7]));}}}}}return BPromise['all'](_0x6a4373);}else{return null;}})[_0xfc86('0x23')](function(_0x57233b){var _0x450bac=_0x57233b;var _0x1b4b11=null;if(_0x450bac){_0x1b4b11=_0x450bac[_0xfc86('0x33')]===0x1?_0x450bac[0x0]:null;}if(_0x1b4b11||_0x450bac){var _0x13d6c5=db[_0x3cdbb2[_0xfc86('0x72')]][_0xfc86('0x28')];_0x1e3fab[_0xfc86('0x2a')]=_[_0xfc86('0x2e')](_0x13d6c5);_0x1e3fab['query']=_[_0xfc86('0x2e')](_0x5999de[_0xfc86('0x2d')]);_0x1e3fab['filters']=_[_0xfc86('0x30')](_0x1e3fab[_0xfc86('0x2a')],_0x1e3fab[_0xfc86('0x2d')]);_0x5a723d[_0xfc86('0x31')]=_['intersection'](_0x1e3fab[_0xfc86('0x2a')],qs[_0xfc86('0x32')](_0x5999de['query'][_0xfc86('0x32')]));_0x5a723d['attributes']=_0x5a723d['attributes'][_0xfc86('0x33')]?_0x5a723d['attributes']:_0x1e3fab['model'];if(!_0x5999de[_0xfc86('0x2d')][_0xfc86('0x34')]('nolimit')){_0x5a723d['limit']=qs[_0xfc86('0x36')](_0x5999de[_0xfc86('0x2d')]['limit']);_0x5a723d[_0xfc86('0x20')]=qs[_0xfc86('0x20')](_0x5999de[_0xfc86('0x2d')][_0xfc86('0x20')]);}_0x5a723d[_0xfc86('0x37')]=qs['sort'](_0x5999de[_0xfc86('0x2d')][_0xfc86('0x38')]);_0x5a723d[_0xfc86('0x3a')]=qs[_0xfc86('0x2f')](_[_0xfc86('0x73')](_0x5999de[_0xfc86('0x2d')],_0x1e3fab['filters']));if(_0x5999de['query']['filter']){_0x5a723d[_0xfc86('0x3a')]=_[_0xfc86('0x3b')](_0x5a723d[_0xfc86('0x3a')],{'$or':_['map'](_0x13d6c5,function(_0x4a5ef0){if(_0x4a5ef0[_0xfc86('0x74')][_0xfc86('0x29')]!==_0xfc86('0x75')){var _0x44abfc={};_0x44abfc[_0x4a5ef0[_0xfc86('0x76')]]={'$like':'%'+_0x5999de[_0xfc86('0x2d')][_0xfc86('0x39')]+'%'};return _0x44abfc;}})});}var _0x46d9b6=[];if(_0x1b4b11){var _0x48452c=_[_0xfc86('0x42')](_0x259e50,[_0xfc86('0x2c'),_0x1b4b11['name']]);if(_0x48452c['field']){var _0x28bad9={};if(_0x3cdbb2[_0xfc86('0x72')]==='AnalyticExtractedReport'){_0x28bad9[_0x48452c['foreignKey']]=_[_0xfc86('0x2b')](_0x1b4b11[_0xfc86('0x77')],'id');}else{_0x28bad9[_0x48452c['foreignKey']]=_0x1b4b11[_0xfc86('0x77')];}_0x46d9b6[_0xfc86('0x5d')](_0x28bad9);}else{_0x5a723d[_0xfc86('0x3a')]['id']=_0x1b4b11[_0xfc86('0x77')];}}else{for(var _0x310728=0x0;_0x310728<_0x450bac[_0xfc86('0x33')];_0x310728++){var _0x48452c=_[_0xfc86('0x42')](_0x259e50,['name',_0x450bac[_0x310728][_0xfc86('0x2c')]]);if(_0x48452c[_0xfc86('0x76')]){var _0x28bad9={};_0x28bad9[_0x48452c[_0xfc86('0x78')]]=_0x450bac[_0x310728]['associatedResources'];_0x46d9b6[_0xfc86('0x5d')](_0x28bad9);}else{if(!_0x5a723d[_0xfc86('0x3a')]['id'])_0x5a723d[_0xfc86('0x3a')]['id']=[];_0x450bac[_0x310728]['associatedResources']['forEach'](function(_0x3b837f){_0x5a723d[_0xfc86('0x3a')]['id'][_0xfc86('0x5d')](_0x3b837f);});}}}if(!_['isEmpty'](_0x46d9b6)){_0x5a723d[_0xfc86('0x3a')]=_[_0xfc86('0x3b')](_0x5a723d[_0xfc86('0x3a')],{'$and':{'$or':_0x46d9b6}});}_0x5a723d=_[_0xfc86('0x3b')]({},_0x5a723d,_0x5999de[_0xfc86('0x3c')]);if(_0x1b4b11&&!_0x1b4b11[_0xfc86('0x4e')]&&_0x3cdbb2[_0xfc86('0x72')]==='AnalyticExtractedReport'){if(_0x5999de['query'][_0xfc86('0x3d')]){_0x5a723d[_0xfc86('0x3e')]=[{'all':!![]}];}return db[_0x3cdbb2['childModel']][_0xfc86('0x3f')](_0x5a723d)[_0xfc86('0x23')](function(_0x1751ac){var _0x50d07a=[];_0x1751ac[_0xfc86('0x5f')](function(_0x338a47){var _0x38baf7;switch(_0x338a47[_0xfc86('0x79')]){case _0xfc86('0x7a'):_0x38baf7=_['find'](_0x1b4b11['associatedResources'],function(_0x414aaa){return _0x414aaa['id']===_0x338a47[_0xfc86('0x7b')]&&_0x414aaa[_0xfc86('0x74')]==='DefaultReports';});break;case'custom':_0x38baf7=_[_0xfc86('0x42')](_0x1b4b11[_0xfc86('0x77')],function(_0x451630){return _0x451630['id']===_0x338a47[_0xfc86('0x7b')]&&_0x451630[_0xfc86('0x74')]==='CustomReports';});break;}if(_0x38baf7)_0x50d07a[_0xfc86('0x5d')](_0x338a47);});_0x332444[_0xfc86('0x1f')]=_0x50d07a['length'];_0x332444[_0xfc86('0x7c')]=_0x50d07a;return _0x332444;});}else{return db[_0x3cdbb2[_0xfc86('0x72')]][_0xfc86('0x1f')]({'where':_0x5a723d[_0xfc86('0x3a')]})[_0xfc86('0x23')](function(_0x415601){_0x332444[_0xfc86('0x1f')]=_0x415601;if(_0x5999de[_0xfc86('0x2d')]['includeAll']){if(_0x3cdbb2[_0xfc86('0x72')]==='CmContact'){_0x5a723d[_0xfc86('0x3e')]=[{'model':db[_0xfc86('0x7d')],'as':_0xfc86('0x7e'),'attributes':['id',_0xfc86('0x2c'),_0xfc86('0x7f')],'required':_0x5999de[_0xfc86('0x2d')][_0xfc86('0x80')]?!![]:![]},{'model':db[_0xfc86('0x7d')],'as':_0xfc86('0x81'),'attributes':['id','name',_0xfc86('0x7f')],'through':_0x5999de[_0xfc86('0x2d')][_0xfc86('0x80')]?{'attributes':[],'where':{'TagId':_0x5999de[_0xfc86('0x2d')]['tag']||undefined}}:{},'required':_0x5999de[_0xfc86('0x2d')][_0xfc86('0x80')]?!![]:![]}];}else{_0x5a723d[_0xfc86('0x3e')]=[{'all':!![]}];}}return db[_0x3cdbb2[_0xfc86('0x72')]]['findAll'](_0x5a723d);})[_0xfc86('0x23')](function(_0x26352a){_0x332444[_0xfc86('0x7c')]=_0x26352a;return _0x332444;});}}else{return _0x332444;}})['then'](respondWithFilteredResult(_0xfa1a08,_0x5a723d))[_0xfc86('0x43')](handleError(_0xfa1a08,null));};function getAllResources(_0x325d0c,_0x55a15c){return new BPromise(function(_0xd647cb,_0x29dc1c){if(_0x55a15c){var _0x2c3708=_0x55a15c[_0xfc86('0x39')]?{[_0x55a15c['filter'][_0xfc86('0x76')]]:_0x55a15c[_0xfc86('0x39')][_0xfc86('0x82')]}:undefined;return db[_0x325d0c]['findAll']({'where':_0x2c3708,'raw':!![]})['then'](function(_0xd409bc){_0x55a15c['associatedResources']=_[_0xfc86('0x2b')](_0xd409bc,'id');_0xd647cb(_0x55a15c);})[_0xfc86('0x43')](function(_0x3a8d02){_0x29dc1c(_0x3a8d02);});}else{_0xd647cb(null);}});}function getAllFilteredResources(_0x1df586,_0x4d5f53){return new BPromise(function(_0x3f3fe0,_0xb2983b){var _0x26cea8=_0x1df586[_0xfc86('0x39')]?{[_0x1df586['filter'][_0xfc86('0x76')]]:_0x1df586[_0xfc86('0x39')][_0xfc86('0x82')]}:undefined;return db[_0x1df586[_0xfc86('0x2a')]][_0xfc86('0x3f')]({'where':_0x26cea8,'raw':!![]})[_0xfc86('0x23')](function(_0x3e8a10){_0x4d5f53[_0xfc86('0x77')]=_[_0xfc86('0x2b')](_0x3e8a10,function(_0x34b84f){return _0x34b84f[_0xfc86('0x2c')];});_0x3f3fe0(_0x4d5f53);})['catch'](function(_0x57b607){_0xb2983b(_0x57b607);});});}function getAllowedResources(_0x153b7d,_0x3d0399,_0x18a618){return new BPromise(function(_0x1eea63,_0x159405){if(_0x3d0399){return db[_0xfc86('0x52')]['findAll']({'where':{'sectionId':_0x3d0399['id']},'raw':!![]})[_0xfc86('0x23')](function(_0x44d6ff){if(_0x153b7d[_0xfc86('0x76')]&&_0x153b7d[_0xfc86('0x76')]!=='id'){_0x3d0399[_0xfc86('0x77')]=_['map'](_0x44d6ff,function(_0x796a48){return _0x796a48[_0x153b7d[_0xfc86('0x76')]];});}else{if(_0x18a618==='AnalyticExtractedReport'){_0x3d0399['associatedResources']=_[_0xfc86('0x2b')](_0x44d6ff,function(_0x996da8){return{'id':_0x996da8[_0xfc86('0x60')],'type':_0x996da8[_0xfc86('0x74')]};});}else{_0x3d0399['associatedResources']=_[_0xfc86('0x2b')](_0x44d6ff,function(_0x56c7bc){return _0x56c7bc[_0xfc86('0x60')];});}}_0x1eea63(_0x3d0399);})[_0xfc86('0x43')](function(_0x2cc39b){_0x159405(_0x2cc39b);});}else{_0x1eea63(null);}});}function getQueryModels(_0x1312fd,_0x4f79e1){var _0x4a5b51=_0x1312fd[_0xfc86('0x83')]();var _0x1fd847={'childModel':undefined,'parentSections':[]};switch(_0x4a5b51){case _0xfc86('0x84'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x85');break;case _0xfc86('0x86'):_0x1fd847[_0xfc86('0x72')]='SquareOdbc';break;case _0xfc86('0x87'):_0x1fd847[_0xfc86('0x72')]='SquareRecording';_0x1fd847['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':_0xfc86('0x88')}];break;case'projects':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x89');break;case _0xfc86('0x8a'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x8b');_0x1fd847[_0xfc86('0x6e')]=[{'name':_0xfc86('0x8c'),'field':'id','foreignKey':_0xfc86('0x8d')}];break;case _0xfc86('0x8e'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x8f');break;case _0xfc86('0x90'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x91');break;case'globalcustomfields':_0x1fd847['childModel']=_0xfc86('0x92');break;case'chatqueues':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x93');break;case _0xfc86('0x94'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x95');break;case _0xfc86('0x96'):_0x1fd847[_0xfc86('0x72')]='FaxQueue';break;case _0xfc86('0x97'):_0x1fd847['childModel']='FaxAccount';break;case'inboundroutes':case _0xfc86('0x98'):case'outboundroutes':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x99');break;case _0xfc86('0x9a'):_0x1fd847['childModel']=_0xfc86('0x9b');break;case'voicemails':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0x9c');break;case'voicerecordings':_0x1fd847['childModel']=_0xfc86('0x9d');_0x1fd847[_0xfc86('0x6e')]=[{'name':_0xfc86('0x9e'),'field':'name','foreignKey':'membername','model':_0xfc86('0x9f'),'filter':{'field':_0xfc86('0xa0'),'value':['agent']}},{'name':_0xfc86('0xa1'),'field':_0xfc86('0x2c'),'foreignKey':_0xfc86('0xa2'),'model':'User','filter':{'field':_0xfc86('0xa0'),'value':[_0xfc86('0xa3')]}},{'name':_0xfc86('0xa4'),'field':'name','foreignKey':_0xfc86('0xa5'),'model':_0xfc86('0xa6'),'filter':{'field':_0xfc86('0x74'),'value':[_0xfc86('0xa7')]}},{'name':_0xfc86('0xa8'),'field':_0xfc86('0x2c'),'foreignKey':_0xfc86('0xa5'),'model':'VoiceQueue','filter':{'field':_0xfc86('0x74'),'value':[_0xfc86('0xa9')]}}];break;case'musiconholds':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xaa');break;case _0xfc86('0xab'):_0x1fd847['childModel']=_0xfc86('0xac');break;case _0xfc86('0xad'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xae');break;case _0xfc86('0xaf'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xb0');break;case _0xfc86('0xb1'):_0x1fd847['childModel']=_0xfc86('0xb2');break;case'mailaccounts':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xb3');break;case _0xfc86('0xb4'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xb5');break;case _0xfc86('0xb6'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xb7');break;case _0xfc86('0xb8'):_0x1fd847[_0xfc86('0x72')]='OpenchannelAccount';break;case'smsqueues':_0x1fd847['childModel']=_0xfc86('0xb9');break;case _0xfc86('0xba'):_0x1fd847['childModel']=_0xfc86('0xbb');break;case _0xfc86('0xbc'):_0x1fd847[_0xfc86('0x72')]='WhatsappQueue';break;case'whatsappaccounts':_0x1fd847[_0xfc86('0x72')]='WhatsappAccount';break;case _0xfc86('0xbd'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xbe');break;case _0xfc86('0xbf'):case'queuecampaigns':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xa6');if(_0x4f79e1){_0x1fd847[_0xfc86('0x6e')]=[{'name':_0xfc86('0xa4')},{'name':_0xfc86('0xa8')}];}break;case _0xfc86('0xc0'):case _0xfc86('0xc1'):case'telephones':_0x1fd847['childModel']=_0xfc86('0x9f');if(_0x4f79e1){_0x1fd847[_0xfc86('0x6e')]=[{'name':'Users','filter':{'field':_0xfc86('0xa0'),'value':[_0xfc86('0xc2'),_0xfc86('0xc3')]},'ignore':!![]},{'name':_0xfc86('0x9e')},{'name':'Telephones'}];}break;case'zendeskaccounts':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xc4');break;case _0xfc86('0xc5'):_0x1fd847[_0xfc86('0x72')]='SalesforceAccount';break;case _0xfc86('0xc6'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xc7');break;case'sugarcrmaccounts':_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xc8');break;case _0xfc86('0xc9'):_0x1fd847[_0xfc86('0x72')]='DeskAccount';break;case _0xfc86('0xca'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xcb');break;case _0xfc86('0xcc'):_0x1fd847['childModel']=_0xfc86('0x9f');break;case'cannedanswers':_0x1fd847['childModel']=_0xfc86('0xcd');break;case _0xfc86('0xce'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xcf');break;case _0xfc86('0xd0'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xd1');break;case _0xfc86('0xd2'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xd3');break;case _0xfc86('0xd4'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xd5');break;case _0xfc86('0xd6'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xd7');break;case _0xfc86('0xd8'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xd9');break;case _0xfc86('0xda'):_0x1fd847[_0xfc86('0x72')]='Tag';break;case _0xfc86('0xdb'):_0x1fd847[_0xfc86('0x72')]='Template';break;case _0xfc86('0xdc'):_0x1fd847[_0xfc86('0x72')]='Trigger';break;case'trunks':_0x1fd847[_0xfc86('0x72')]='Trunk';break;case _0xfc86('0xdd'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xde');break;case _0xfc86('0xdf'):_0x1fd847['childModel']=_0xfc86('0x61');break;case _0xfc86('0xe0'):_0x1fd847['childModel']=_0xfc86('0xe1');_0x1fd847['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0xfc86('0x7b')}];break;case _0xfc86('0xe2'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xe3');break;case _0xfc86('0xe4'):_0x1fd847[_0xfc86('0x72')]=_0xfc86('0xe5');break;default:return _0x1fd847;}return _0x1fd847;}
\ No newline at end of file