Built motion from commit be44e1e4d16f8b29d243415b03d27262d8601e0e. Version 3.0.0...
[motion-next.git] / server / api / userProfile / userProfile.controller.js
1 const a667_0x4a6a=['SquareOdbc','customdashboards','pick','role','key','lodash','transaction','childModel','destroy','Dashboard','faxqueues','VIRTUAL','include','user','ignore','length','color','like','tag','OpenchannelQueue','custom','attributes','agent','Resources','findOne','DefaultReports','findAll','Agents','companies','count','rows','ValidationError','addResources','sendStatus','UserProfileSection','get','body','freshdeskaccounts','teams','bulkCreate','query','QueueCampaigns','section','ZendeskAccount','sequelize','../../rediscache','associatedResources','map','keys','order','Tags','Users','SquareRecording','outbound','where','updatedAt','CannedAnswer','VoiceContext','cannedanswers','deskaccounts','value','../../components/parsers/qs','queuecampaigns','enabled','ZohoAccount','chatwebsites','chanspies','MailQueue','projectName','type','field','Tag','WhatsappAccount','rawAttributes','salesforceaccounts','params','ivrcampaigns','User','Invalid\x20section\x20\x27','Interval','autoAssociation','voicemails','./userProfile.socket','Sound','VoiceRecording','intervals','ChatWebsite','../../config/logger','union','resourceId','trunks','FreshdeskAccount','SquareProject','SmsQueue','foreignKey','squareprojects','includeAll','reportId','Reports','parentSections','fields','clone','CustomReports','CmContact','default','internalroutes','CmCustomField','each','intersection','ChatQueue','set','metrics','membername','merge','FaxQueue','inboundroutes','sectionId','tags','AnalyticExtractedReport','includes','forEach','catch','WhatsappQueue','MailSubstatus','MailAccount','and','plugins','json','../../mysqldb','Pause','sort','register','mergeResources','templates','Lists','openchannelqueues','Plugin','VoiceExtension','limit','index','Disposition','ids','undefined','voiceprefixes','describe','odbc','SmsAccount','admin','subsections','show','ThroughTags','mailqueues','nolimit','openchannelaccounts','createdAt','addSections','Trigger','SugarcrmAccount','VoicePrefix','removeSections','sounds','extractedreports','musiconholds','variables','chatqueues','options','crudPermissions','globalcustomfields','agents','status','voicequeues','toLowerCase','update','name','end','offset','userProfileId','filters','filter','CmList','voicerecordings','omit','then','zendeskaccounts','UserProfile','create','isEmpty','triggers','VoiceChanSpy','model','Telephones','Content-Range','queue','smsaccounts','all','find','DeskAccount','Schedule','push','Template','VoiceQueues','dispositions','VoiceMail','UserProfileResource'];(function(_0x287b4a,_0x4a6af9){const _0x304a2e=function(_0x9fa650){while(--_0x9fa650){_0x287b4a['push'](_0x287b4a['shift']());}};_0x304a2e(++_0x4a6af9);}(a667_0x4a6a,0x153));const a667_0x304a=function(_0x287b4a,_0x4a6af9){_0x287b4a=_0x287b4a-0x0;let _0x304a2e=a667_0x4a6a[_0x287b4a];return _0x304a2e;};const _0x3a22bd=a667_0x304a;'use strict';const _=require(_0x3a22bd('0x4a')),qs=require(_0x3a22bd('0x82')),logger=require(_0x3a22bd('0x9c'))('api'),{getSocket}=require(_0x3a22bd('0x72')),socket=getSocket(),db=require(_0x3a22bd('0xc5'))['db'],{Op}=require(_0x3a22bd('0x71'));require(_0x3a22bd('0x97'))[_0x3a22bd('0xc8')](socket);function respondWithStatusCode(_0x9fa650,_0x39bd37){return _0x39bd37=_0x39bd37||0xcc,function(_0x273ad1){const _0x13039a=a667_0x304a;if(_0x273ad1)return _0x9fa650[_0x13039a('0x66')](_0x39bd37);return _0x9fa650[_0x13039a('0x22')](_0x39bd37)[_0x13039a('0x27')]();};}function respondWithResult(_0x1741ea,_0x486d23){return _0x486d23=_0x486d23||0xc8,function(_0x2210ba){const _0x2e9b89=a667_0x304a;if(_0x2210ba)return _0x1741ea[_0x2e9b89('0x22')](_0x486d23)[_0x2e9b89('0xc4')](_0x2210ba);};}function respondWithFilteredResult(_0x4a6e28,_0x36a6a8){return function(_0x6634c6){const _0x5dac3e=a667_0x304a;if(_0x6634c6){const _0x54e350=_0x6634c6[_0x5dac3e('0x62')],_0x5139ee=_0x36a6a8[_0x5dac3e('0x28')];let _0xa25f9f=_0x36a6a8[_0x5dac3e('0x28')]+_0x36a6a8[_0x5dac3e('0x3')],_0x32f818;return _0xa25f9f>=_0x54e350?(_0xa25f9f=_0x54e350,_0x32f818=0xc8):_0x32f818=0xce,_0x4a6e28[_0x5dac3e('0x22')](_0x32f818),_0x4a6e28[_0x5dac3e('0xb3')](_0x5dac3e('0x38'),_0x5139ee+'-'+_0xa25f9f+'/'+_0x54e350)[_0x5dac3e('0xc4')](_0x6634c6);}return null;};}function saveUpdates(_0x40acdf){return function(_0x515800){const _0x24a478=a667_0x304a;if(_0x515800)return _0x515800[_0x24a478('0x25')](_0x40acdf)[_0x24a478('0x2f')](function(_0x51c485){return _0x51c485;});return null;};}function removeEntity(_0x1a4c95){return function(_0xdc3771){const _0x38a3c7=a667_0x304a;if(_0xdc3771)return _0xdc3771[_0x38a3c7('0x4d')]()['then'](function(){const _0x243afa=_0x38a3c7;_0x1a4c95['status'](0xcc)[_0x243afa('0x27')]();});};}function handleEntityNotFound(_0x44407e){return function(_0xc604ff){const _0x47d03c=a667_0x304a;return!_0xc604ff&&_0x44407e[_0x47d03c('0x66')](0x194),_0xc604ff;};}function handleError(_0x1ba8a4,_0x189d66){return _0x189d66=_0x189d66||0x1f4,function(_0xbf794e){const _0x50dad2=a667_0x304a;logger['error'](_0xbf794e['stack']),_0xbf794e[_0x50dad2('0x26')]&&delete _0xbf794e[_0x50dad2('0x26')],_0x1ba8a4[_0x50dad2('0x22')](_0x189d66)['send'](_0xbf794e);};}exports[_0x3a22bd('0x4')]=function(_0x1c2971,_0x24ea01){const _0x257ee6=_0x3a22bd;let _0x81dd68={};const _0xf63d22={},_0x117f03={'count':0x0,'rows':[]},_0x40bba5=_[_0x257ee6('0x74')](db[_0x257ee6('0x31')][_0x257ee6('0x8e')],function(_0x486200){const _0x31fe53=_0x257ee6;return{'name':_0x486200['fieldName'],'type':_0x486200[_0x31fe53('0x8a')][_0x31fe53('0x49')]};});_0xf63d22[_0x257ee6('0x36')]=_[_0x257ee6('0x74')](_0x40bba5,'name'),_0xf63d22[_0x257ee6('0x6d')]=_[_0x257ee6('0x75')](_0x1c2971[_0x257ee6('0x6d')]),_0xf63d22['filters']=_[_0x257ee6('0xb1')](_0xf63d22[_0x257ee6('0x36')],_0xf63d22[_0x257ee6('0x6d')]),_0x81dd68['attributes']=_[_0x257ee6('0xb1')](_0xf63d22[_0x257ee6('0x36')],qs['fields'](_0x1c2971[_0x257ee6('0x6d')][_0x257ee6('0xa9')])),_0x81dd68[_0x257ee6('0x5a')]=_0x81dd68['attributes'][_0x257ee6('0x54')]?_0x81dd68['attributes']:_0xf63d22[_0x257ee6('0x36')];typeof _0x1c2971[_0x257ee6('0x6d')][_0x257ee6('0x11')]===_0x257ee6('0x7')&&(_0x81dd68[_0x257ee6('0x3')]=qs['limit'](_0x1c2971[_0x257ee6('0x6d')][_0x257ee6('0x3')]),_0x81dd68[_0x257ee6('0x28')]=qs['offset'](_0x1c2971[_0x257ee6('0x6d')][_0x257ee6('0x28')]));_0x81dd68[_0x257ee6('0x76')]=qs['sort'](_0x1c2971[_0x257ee6('0x6d')][_0x257ee6('0xc7')]),_0x81dd68[_0x257ee6('0x7b')]=qs['filters'](_[_0x257ee6('0x47')](_0x1c2971['query'],_0xf63d22[_0x257ee6('0x2a')]),_0x40bba5);_0x1c2971['query'][_0x257ee6('0x2b')]&&(_0x81dd68[_0x257ee6('0x7b')]=_['merge'](_0x81dd68['where'],{[Op['or']]:_[_0x257ee6('0x74')](_0x40bba5,function(_0x19305e){const _0x4aaf4e=_0x257ee6;if(_0x19305e[_0x4aaf4e('0x8a')]!=='VIRTUAL'){const _0x186665={};return _0x186665[_0x19305e[_0x4aaf4e('0x26')]]={[Op[_0x4aaf4e('0x56')]]:'%'+_0x1c2971[_0x4aaf4e('0x6d')][_0x4aaf4e('0x2b')]+'%'},_0x186665;}})}));_0x81dd68=_[_0x257ee6('0xb6')]({},_0x81dd68,_0x1c2971[_0x257ee6('0x1e')]);const _0x53fe2e={'where':_0x81dd68[_0x257ee6('0x7b')]};return db['UserProfile'][_0x257ee6('0x62')](_0x53fe2e)[_0x257ee6('0x2f')](function(_0x1775e1){const _0x1f6b2b=_0x257ee6;return _0x117f03[_0x1f6b2b('0x62')]=_0x1775e1,_0x1c2971[_0x1f6b2b('0x6d')][_0x1f6b2b('0xa5')]&&(_0x81dd68['include']=[{'all':!![]}]),db[_0x1f6b2b('0x31')][_0x1f6b2b('0x5f')](_0x81dd68);})[_0x257ee6('0x2f')](function(_0x55cad2){return _0x117f03['rows']=_0x55cad2,_0x117f03;})[_0x257ee6('0x2f')](respondWithFilteredResult(_0x24ea01,_0x81dd68))['catch'](handleError(_0x24ea01,null));},exports[_0x3a22bd('0xe')]=function(_0x274caf,_0x3f02ee){const _0x3bfc99=_0x3a22bd;let _0x8df51a={'raw':![],'where':{'id':_0x274caf[_0x3bfc99('0x90')]['id']}};const _0x5c0fe3={};return _0x5c0fe3[_0x3bfc99('0x36')]=_[_0x3bfc99('0x75')](db[_0x3bfc99('0x31')][_0x3bfc99('0x8e')]),_0x5c0fe3[_0x3bfc99('0x6d')]=_[_0x3bfc99('0x75')](_0x274caf[_0x3bfc99('0x6d')]),_0x5c0fe3[_0x3bfc99('0x2a')]=_[_0x3bfc99('0xb1')](_0x5c0fe3[_0x3bfc99('0x36')],_0x5c0fe3[_0x3bfc99('0x6d')]),_0x8df51a[_0x3bfc99('0x5a')]=_[_0x3bfc99('0xb1')](_0x5c0fe3[_0x3bfc99('0x36')],qs[_0x3bfc99('0xa9')](_0x274caf[_0x3bfc99('0x6d')][_0x3bfc99('0xa9')])),_0x8df51a[_0x3bfc99('0x5a')]=_0x8df51a[_0x3bfc99('0x5a')][_0x3bfc99('0x54')]?_0x8df51a[_0x3bfc99('0x5a')]:_0x5c0fe3['model'],_0x274caf[_0x3bfc99('0x6d')][_0x3bfc99('0xa5')]&&(_0x8df51a['include']=[{'all':!![]}]),_0x8df51a=_['merge']({},_0x8df51a,_0x274caf[_0x3bfc99('0x1e')]),db['UserProfile']['findOne'](_0x8df51a)[_0x3bfc99('0x2f')](handleEntityNotFound(_0x3f02ee))[_0x3bfc99('0x2f')](respondWithResult(_0x3f02ee,null))[_0x3bfc99('0xbe')](handleError(_0x3f02ee,null));},exports[_0x3a22bd('0x32')]=function(_0x2d182f,_0xa41e8a){const _0x3498fe=_0x3a22bd;return db[_0x3498fe('0x31')][_0x3498fe('0x32')](_0x2d182f[_0x3498fe('0x69')],{})['then'](respondWithResult(_0xa41e8a,0xc9))[_0x3498fe('0xbe')](handleError(_0xa41e8a,null));},exports[_0x3a22bd('0xaa')]=function(_0x381a39,_0x1f9fda){const _0x1a581b=_0x3a22bd;let _0xdf83cc={'where':{'id':_0x381a39[_0x1a581b('0x90')]['id']}};const _0x5b9a0e={};return _0x5b9a0e[_0x1a581b('0x36')]=_[_0x1a581b('0x75')](db[_0x1a581b('0x31')][_0x1a581b('0x8e')]),_0xdf83cc[_0x1a581b('0x5a')]=_[_0x1a581b('0xb1')](_0x5b9a0e[_0x1a581b('0x36')],qs[_0x1a581b('0xa9')](_0x381a39['query'][_0x1a581b('0xa9')])),_0xdf83cc[_0x1a581b('0x5a')]=_0xdf83cc['attributes'][_0x1a581b('0x54')]?_0xdf83cc['attributes']:_0x5b9a0e['model'],_0x381a39['query'][_0x1a581b('0xa5')]&&(_0xdf83cc[_0x1a581b('0x51')]=[{'all':!![]}]),_0xdf83cc=_['merge']({},_0xdf83cc,_0x381a39['options']),db['UserProfile'][_0x1a581b('0x5d')](_0xdf83cc)[_0x1a581b('0x2f')](handleEntityNotFound(_0x1f9fda))[_0x1a581b('0x2f')](function(_0x59efcc){const _0x22e3e1=_0x1a581b;if(_0x59efcc){let _0x2134af=_0x59efcc[_0x22e3e1('0x68')]({'plain':!![]});return _0x2134af=qs['omit'](_0x2134af,['id','createdAt','updatedAt',_0x22e3e1('0x1f')]),_0x381a39[_0x22e3e1('0x69')]=_['omit'](_0x381a39['body'],['id',_0x22e3e1('0x13'),_0x22e3e1('0x7c')]),db[_0x22e3e1('0x71')]['transaction'](function(_0x56f850){const _0x13d45d=_0x22e3e1;return db[_0x13d45d('0x31')]['create'](_['merge'](_0x2134af,_0x381a39[_0x13d45d('0x69')]),{'include':_0x381a39[_0x13d45d('0x6d')][_0x13d45d('0xa5')]?[{'all':!![]}]:undefined,'transaction':_0x56f850})[_0x13d45d('0x2f')](function(_0x178a5c){const _0x5c8080=_0x13d45d,_0x546241=_0x178a5c[_0x5c8080('0x68')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x381a39[_0x5c8080('0x90')]['id']},'raw':!![]})[_0x5c8080('0x2f')](function(_0xbeb7d8){const _0x34df74=_0x5c8080;if(_0xbeb7d8)return Promise[_0x34df74('0xb0')](_0xbeb7d8,function(_0x55b9e9){const _0x31966a=_0x34df74;return new Promise(function(_0x3147da,_0x2585ba){const _0x2ce649=a667_0x304a;if(_0x55b9e9[_0x2ce649('0x95')]===null||_0x55b9e9[_0x2ce649('0x95')]===0x1)_0x3147da(null);return db[_0x2ce649('0x44')]['findAll']({'where':{'sectionId':_0x55b9e9['id']},'raw':!![]})[_0x2ce649('0x2f')](function(_0x1a1009){const _0x306a3b=_0x2ce649,_0x305c1a=_[_0x306a3b('0x74')](_0x1a1009,function(_0x2db6da){const _0x532eed=_0x306a3b;return qs[_0x532eed('0x2e')](_0x2db6da,['id','createdAt',_0x532eed('0x7c'),_0x532eed('0xb9')]);});_0x3147da(_0x305c1a);})[_0x2ce649('0xbe')](function(_0x574ea4){_0x2585ba(_0x574ea4);});})[_0x31966a('0x2f')](function(_0x18ef07){const _0x563653=_0x31966a,_0x42a7d7=qs['omit'](_0x55b9e9,['id','createdAt','updatedAt']);_0x42a7d7[_0x563653('0x29')]=_0x546241['id'];if(_0x18ef07)_0x42a7d7[_0x563653('0x5c')]=_0x18ef07;return _0x42a7d7;})[_0x31966a('0x2f')](function(_0x53f789){const _0x62f541=_0x31966a;return db[_0x62f541('0x67')][_0x62f541('0x32')](_0x53f789,{'include':[{'model':db[_0x62f541('0x44')],'as':_0x62f541('0x5c')}],'raw':!![],'transaction':_0x56f850});});})[_0x34df74('0x2f')](function(){return _0x546241;});});});});}})[_0x1a581b('0x2f')](respondWithResult(_0x1f9fda,0xc9))['catch'](handleError(_0x1f9fda,null));},exports['update']=function(_0x5c406d,_0xdd71dd){const _0x4995a3=_0x3a22bd;return _0x5c406d[_0x4995a3('0x69')]['id']&&delete _0x5c406d[_0x4995a3('0x69')]['id'],db[_0x4995a3('0x31')][_0x4995a3('0x5d')]({'where':{'id':_0x5c406d[_0x4995a3('0x90')]['id']}})[_0x4995a3('0x2f')](handleEntityNotFound(_0xdd71dd))[_0x4995a3('0x2f')](saveUpdates(_0x5c406d['body'],null))[_0x4995a3('0x2f')](respondWithResult(_0xdd71dd,null))[_0x4995a3('0xbe')](handleError(_0xdd71dd,null));},exports[_0x3a22bd('0x4d')]=function(_0x3de603,_0x234223){const _0x3039dd=_0x3a22bd;return db[_0x3039dd('0x31')][_0x3039dd('0x5d')]({'where':{'id':_0x3de603[_0x3039dd('0x90')]['id']}})['then'](handleEntityNotFound(_0x234223))[_0x3039dd('0x2f')](removeEntity(_0x234223,null))['catch'](handleError(_0x234223,null));},exports[_0x3a22bd('0x9')]=function(_0x16a35b,_0x4aeca7){const _0x2cf2c9=_0x3a22bd;return db[_0x2cf2c9('0x31')]['describe']()[_0x2cf2c9('0x2f')](respondWithResult(_0x4aeca7,null))[_0x2cf2c9('0xbe')](handleError(_0x4aeca7,null));},exports[_0x3a22bd('0x14')]=function(_0x42658c,_0x3ec812){const _0x4be41c=_0x3a22bd,_0x495418=_0x42658c['body'];return db['UserProfile'][_0x4be41c('0x5d')]({'where':{'id':_0x42658c['params']['id']}})[_0x4be41c('0x2f')](handleEntityNotFound(_0x3ec812))[_0x4be41c('0x2f')](function(_0x1d05b){const _0x16c9ed=_0x4be41c;if(_0x1d05b)return db[_0x16c9ed('0x71')][_0x16c9ed('0x4b')](function(_0x2c6208){const _0x1f7338=_0x16c9ed;return db[_0x1f7338('0x67')]['destroy']({'where':{'userProfileId':_0x42658c[_0x1f7338('0x90')]['id'],'sectionId':_[_0x1f7338('0x74')](_0x495418,function(_0x181f36){const _0x3a15ac=_0x1f7338;return _0x181f36[_0x3a15ac('0xb9')];})},'transaction':_0x2c6208})[_0x1f7338('0x2f')](function(){const _0xbaef7a=_0x1f7338,_0x53be81=_['map'](_0x495418,function(_0x2f5c9){const _0x4d477d=a667_0x304a;return _0x2f5c9[_0x4d477d('0x29')]=_0x42658c[_0x4d477d('0x90')]['id'],_0x2f5c9;}),_0x7f9d44=[];return Promise[_0xbaef7a('0xb0')](_0x53be81,function(_0x5f1c97){const _0x30c206=_0xbaef7a;return db['UserProfileSection'][_0x30c206('0x32')](_0x5f1c97,{'include':[{'model':db[_0x30c206('0x44')],'as':'Resources'}],'raw':!![],'transaction':_0x2c6208})['then'](function(_0x27b50a){const _0x480cff=_0x30c206;_0x7f9d44[_0x480cff('0x3f')](_0x27b50a['get']({'plain':!![]}));});})[_0xbaef7a('0x2f')](function(){return _0x7f9d44;});});});})['then'](function(_0x101730){return _0x101730;})[_0x4be41c('0x2f')](respondWithResult(_0x3ec812,null))[_0x4be41c('0xbe')](handleError(_0x3ec812,null));},exports[_0x3a22bd('0x18')]=function(_0x4d6fa8,_0x160a4e){const _0x122b64=_0x3a22bd;let _0x4fce4a;return db[_0x122b64('0x31')][_0x122b64('0x5d')]({'where':{'id':_0x4d6fa8[_0x122b64('0x90')]['id']},'attributes':['id','name']})['then'](handleEntityNotFound(_0x160a4e))[_0x122b64('0x2f')](function(_0xe0b9e2){const _0x440ad0=_0x122b64;if(_0xe0b9e2)return _0x4fce4a=_0xe0b9e2,db[_0x440ad0('0x67')][_0x440ad0('0x4d')]({'where':{'userProfileId':_0x4d6fa8[_0x440ad0('0x90')]['id'],'sectionId':_0x4d6fa8[_0x440ad0('0x6d')][_0x440ad0('0x6')]}});})['then'](function(){return _0x4fce4a;})[_0x122b64('0x2f')](respondWithStatusCode(_0x160a4e,null))[_0x122b64('0xbe')](handleError(_0x160a4e,null));},exports['getSections']=function(_0x3f7778,_0x85db16){const _0x54ceee=_0x3a22bd;let _0x2bb773=[],_0x4d3023=[];return db['UserProfileSection'][_0x54ceee('0x5f')]({'where':{'userProfileId':_0x3f7778['params']['id']},'raw':!![]})[_0x54ceee('0x2f')](function(_0x5eab88){const _0x370612=_0x54ceee;_0x2bb773=_[_0x370612('0x2b')](_0x5eab88,function(_0x445c07){const _0x448d8c=_0x370612;return _0x445c07['enabled']===0x1||_[_0x448d8c('0xbc')]([0x3eb,0x709],_0x445c07[_0x448d8c('0xb9')]);});if(!_[_0x370612('0x33')](_0x2bb773))return _[_0x370612('0x74')](_0x2bb773,function(_0x4c7d26){const _0xdb0f1d=_0x370612;return _0x4c7d26[_0xdb0f1d('0xb9')];});else return;})[_0x54ceee('0x2f')](function(_0x26ac7d){const _0xb2b083=_0x54ceee;if(_0x26ac7d)_0x4d3023=_0x26ac7d;if(_['includes'](_0x4d3023,0x64)){const _0x4fe917=_[_0xb2b083('0x3c')](_0x2bb773,{'sectionId':0x64});return hasDefaultDashboard(_0x4fe917)['then'](function(_0x111a47){const _0x749184=_0xb2b083;return _[_0x749184('0x74')](_0x2bb773,function(_0xd1035f){const _0x418f13=_0x749184;return _0xd1035f[_0x418f13('0xb9')]===0x64&&(_0xd1035f['subsections']=_0x111a47),_0xd1035f;});});}else return;})[_0x54ceee('0x2f')](function(_0x50f73d){const _0xd84ae5=_0x54ceee;if(_0x50f73d)_0x2bb773=_0x50f73d;if(_[_0xd84ae5('0xbc')](_0x4d3023,0x3eb)){const _0x494849=_['find'](_0x2bb773,{'sectionId':0x3eb});return getCustomDashboards(_0x494849)['then'](function(_0x5bc204){const _0x1fe7ba=_0xd84ae5;return _[_0x1fe7ba('0x74')](_0x2bb773,function(_0x4c08f4){const _0x4d4511=_0x1fe7ba;return _0x494849['enabled']?_0x4c08f4['sectionId']===0x3eb&&(_0x4c08f4['subsections']=_0x5bc204):_0x4c08f4[_0x4d4511('0xb9')]===0x64&&(_0x4c08f4[_0x4d4511('0xd')]=_0x5bc204),_0x4c08f4;});});}else return;})[_0x54ceee('0x2f')](function(_0xe075ff){const _0x1983d5=_0x54ceee;if(_0xe075ff)_0x2bb773=_0xe075ff;if(_[_0x1983d5('0xbc')](_0x4d3023,0x709)){const _0x368681=_[_0x1983d5('0x3c')](_0x2bb773,{'sectionId':0x709});return getPlugins(_0x368681)[_0x1983d5('0x2f')](function(_0x35bdcc){const _0x2f9f31=_0x1983d5;if(_0x368681[_0x2f9f31('0x84')])return _[_0x2f9f31('0x74')](_0x2bb773,function(_0x3b321d){const _0x4bca62=_0x2f9f31;return _0x3b321d[_0x4bca62('0xb9')]===0x709&&(_0x3b321d[_0x4bca62('0xd')]=_0x35bdcc),_0x3b321d;});else{const _0x49db45={'sectionId':0x76c,'enabled':0x1,'subsections':_0x35bdcc},_0x2b3014=_[_0x2f9f31('0x74')](_0x2bb773);return _0x2b3014[_0x2f9f31('0x3f')](_0x49db45),_0x2b3014;}});}else return;})[_0x54ceee('0x2f')](function(_0x17a8b2){const _0x7ef152=_0x54ceee;if(_0x17a8b2)_0x2bb773=_0x17a8b2;return _[_0x7ef152('0x2b')](_0x2bb773,[_0x7ef152('0x84'),0x1]);})['then'](respondWithResult(_0x85db16,null))[_0x54ceee('0xbe')](handleError(_0x85db16,null));};function hasDefaultDashboard(_0x2934b1){const _0xb3d466=[0x65];return new Promise(function(_0x285777,_0x54cd83){const _0x3a20ff=a667_0x304a;try{if(_0x2934b1['autoAssociation'])_0x285777(_0xb3d466);else return db[_0x3a20ff('0x44')][_0x3a20ff('0x5d')]({'where':{'sectionId':_0x2934b1['id']},'raw':!![]})[_0x3a20ff('0x2f')](function(_0x5c5e5c){_0x5c5e5c?_0x285777(_0xb3d466):_0x285777();});}catch(_0x452e13){_0x54cd83(_0x452e13);}});}function getCustomDashboards(_0x5984e8){const _0x3d73a1=[];return new Promise(function(_0x4c1cba,_0x29d978){const _0x4a6c09=a667_0x304a;try{return _0x5984e8[_0x4a6c09('0x95')]?db[_0x4a6c09('0x4e')][_0x4a6c09('0x5f')]({'raw':!![]})[_0x4a6c09('0x2f')](function(_0x5409df){_0x5409df['forEach'](function(_0x314462){const _0x4270b0=a667_0x304a;_0x3d73a1[_0x4270b0('0x3f')](_0x314462['id']+0x1869f);}),_0x4c1cba(_0x3d73a1);}):db[_0x4a6c09('0x44')][_0x4a6c09('0x5f')]({'where':{'sectionId':_0x5984e8['id']},'raw':!![]})[_0x4a6c09('0x2f')](function(_0x3c2163){const _0x5cca26=_0x4a6c09;_0x3c2163[_0x5cca26('0xbd')](function(_0x5a2779){const _0x651897=_0x5cca26;_0x3d73a1[_0x651897('0x3f')](_0x5a2779[_0x651897('0x9e')]+0x1869f);}),_0x4c1cba(_0x3d73a1);});}catch(_0x5e6c9d){_0x29d978(_0x5e6c9d);}});}function getPlugins(_0x4e6b53){const _0x4ccd6e=[];return new Promise(function(_0x1b9c1c,_0x2ca907){const _0x3134d4=a667_0x304a;try{return _0x4e6b53[_0x3134d4('0x95')]?db[_0x3134d4('0x1')][_0x3134d4('0x5f')]({'raw':!![]})[_0x3134d4('0x2f')](function(_0x32a79e){const _0x2485ae=_0x3134d4;_0x32a79e[_0x2485ae('0xbd')](function(_0x1aed00){const _0x455722=_0x2485ae;_0x4ccd6e[_0x455722('0x3f')](_0x1aed00['id']+0x15b38);}),_0x1b9c1c(_0x4ccd6e);}):db[_0x3134d4('0x44')]['findAll']({'where':{'sectionId':_0x4e6b53['id']},'raw':!![]})[_0x3134d4('0x2f')](function(_0xf83e72){_0xf83e72['forEach'](function(_0x366b6d){const _0x4819eb=a667_0x304a;_0x4ccd6e[_0x4819eb('0x3f')](_0x366b6d[_0x4819eb('0x9e')]+0x15b38);}),_0x1b9c1c(_0x4ccd6e);});}catch(_0x11b0cf){_0x2ca907(_0x11b0cf);}});}exports[_0x3a22bd('0x65')]=function(_0xa1dbee,_0x49c6c3){const _0x3eb6e9=_0x3a22bd;return db['UserProfile'][_0x3eb6e9('0x5d')]({'where':{'id':_0xa1dbee['params']['id']}})[_0x3eb6e9('0x2f')](handleEntityNotFound(_0x49c6c3))[_0x3eb6e9('0x2f')](function(_0x3bc9f2){const _0x167866=_0x3eb6e9;if(_0x3bc9f2)return db[_0x167866('0x71')][_0x167866('0x4b')](function(_0x2ad46a){const _0x5bc14d=_0x167866;return db[_0x5bc14d('0x67')][_0x5bc14d('0x5f')]({'where':{'userProfileId':_0xa1dbee[_0x5bc14d('0x90')]['id']},'attributes':['id'],'raw':!![]})[_0x5bc14d('0x2f')](function(_0x3766a3){const _0x1990fe=_0x5bc14d;if(_0x3766a3)return db[_0x1990fe('0x67')][_0x1990fe('0x4d')]({'where':{'userProfileId':_0xa1dbee[_0x1990fe('0x90')]['id'],'id':_[_0x1990fe('0x74')](_0x3766a3,function(_0x551529){return _0x551529['id'];})},'transaction':_0x2ad46a});})[_0x5bc14d('0x2f')](function(){const _0x54fb2e=_0x5bc14d,_0x46fd61=_['map'](_0xa1dbee[_0x54fb2e('0x69')],function(_0x4d994c){const _0x5c0121=_0x54fb2e;return _0x4d994c[_0x5c0121('0x29')]=_0xa1dbee['params']['id'],_0x4d994c;});return db['UserProfileSection'][_0x54fb2e('0x6c')](_0x46fd61,{'raw':!![],'transaction':_0x2ad46a});})['then'](function(_0x1302b6){const _0x5e7412=_0x5bc14d,_0x10e76c=_[_0x5e7412('0x2b')](_['map'](_0x1302b6,function(_0x21d533){const _0x2539b6=_0x5e7412;return _0x21d533[_0x2539b6('0x68')]({'plain':!![]});}),{'includeAll':![]});if(_0x10e76c)return db[_0x5e7412('0x67')]['findAll']({'where':{'userProfileId':_0xa1dbee[_0x5e7412('0x90')]['id'],'sectionId':_[_0x5e7412('0x74')](_0x10e76c,function(_0x65bd34){const _0x3cca4d=_0x5e7412;return _0x65bd34[_0x3cca4d('0xb9')];})},'attributes':['id',_0x5e7412('0xb9')],'raw':!![]})[_0x5e7412('0x2f')](function(){const _0x2b06ee=_0x5e7412,_0x115e2a=_['map'](_0xa1dbee['body'],function(_0x21403d){const _0x1c5c4a=a667_0x304a;return _0x21403d['userProfileId']=_0xa1dbee[_0x1c5c4a('0x90')]['id'],_0x21403d;});return db[_0x2b06ee('0x44')]['bulkCreate'](_0x115e2a,{'raw':!![],'transaction':_0x2ad46a});});})[_0x5bc14d('0xbe')](handleError(_0x49c6c3,null));});})['then'](function(){})[_0x3eb6e9('0x2f')](respondWithResult(_0x49c6c3,null))['catch'](handleError(_0x49c6c3,null));},exports['removeResources']=function(_0xf1d71f,_0x51f553){const _0x36df87=_0x3a22bd;return db['UserProfile'][_0x36df87('0x5d')]({'where':{'id':_0xf1d71f[_0x36df87('0x90')]['id']}})['then'](handleEntityNotFound(_0x51f553))[_0x36df87('0x2f')](function(_0x27dd6e){const _0x19c99a=_0x36df87;if(_0x27dd6e)return _0x27dd6e['removeResources'](_0xf1d71f[_0x19c99a('0x6d')][_0x19c99a('0x6')]);})[_0x36df87('0x2f')](respondWithStatusCode(_0x51f553,null))['catch'](handleError(_0x51f553,null));},exports['getResources']=function(_0x2d3ea3,_0x215e0f){const _0x5577bb=_0x3a22bd;let _0x89ef5f={'raw':![],'where':{}};const _0x2c2ef9={},_0x5e7bc3={'count':0x0,'rows':[]},_0x1e8bc9=_0x2d3ea3[_0x5577bb('0x6d')][_0x5577bb('0x6f')];if(typeof _0x1e8bc9===_0x5577bb('0x7'))throw new db['Sequelize'][(_0x5577bb('0x64'))]('Unknown\x20section');const _0x4c0575=_0x2d3ea3[_0x5577bb('0x6d')][_0x5577bb('0xc9')]||![],_0x380ff4=getQueryModels(_0x1e8bc9,_0x4c0575);if(typeof _0x380ff4[_0x5577bb('0x4c')]===_0x5577bb('0x7'))throw new db['Sequelize'][(_0x5577bb('0x64'))](_0x5577bb('0x93')+_0x1e8bc9+'\x27');let _0x12cb75=[];return!_[_0x5577bb('0x33')](_0x380ff4[_0x5577bb('0xa8')])?_0x12cb75=_0x380ff4[_0x5577bb('0xa8')]:_0x12cb75=[{'name':_0x1e8bc9}],db[_0x5577bb('0x31')][_0x5577bb('0x5d')]({'where':{'id':_0x2d3ea3[_0x5577bb('0x90')]['id']}})[_0x5577bb('0x2f')](handleEntityNotFound(_0x215e0f))[_0x5577bb('0x2f')](function(_0x4091c9){const _0x518bec=_0x5577bb;if(_0x4091c9){const _0x523e2a=[];for(let _0x4908ea=0x0;_0x4908ea<_0x12cb75['length'];_0x4908ea++){_0x523e2a[_0x518bec('0x3f')](db[_0x518bec('0x67')][_0x518bec('0x5d')]({'where':{'userProfileId':_0x4091c9['id'],'name':_0x12cb75[_0x4908ea][_0x518bec('0x26')]},'raw':!![]}));}return Promise[_0x518bec('0x3b')](_0x523e2a);}})[_0x5577bb('0x2f')](function(_0x3735f3){const _0x530700=_0x5577bb,_0x428559=_[_0x530700('0x2b')](_0x3735f3,function(_0x5352e4){return _0x5352e4?_0x5352e4:undefined;}),_0x116756=_['filter'](_0x12cb75,['ignore',!![]]),_0x48a0b6=_[_0x530700('0x33')](_0x428559)&&_[_0x530700('0x33')](_0x116756)?null:_[_0x530700('0x9d')](_0x116756,_0x428559);if(_0x48a0b6){const _0x188f6e=[];for(let _0xc8027a=0x0;_0xc8027a<_0x48a0b6[_0x530700('0x54')];_0xc8027a++){const _0x129129=_[_0x530700('0x3c')](_0x12cb75,function(_0x54dac6){const _0x2f25f3=_0x530700;return _0x48a0b6[_0xc8027a]?_0x54dac6[_0x2f25f3('0x26')]===_0x48a0b6[_0xc8027a][_0x2f25f3('0x26')]:null;});_0x129129&&(_0x48a0b6[_0xc8027a][_0x530700('0x53')]?_0x188f6e[_0x530700('0x3f')](getAllResources(_0x380ff4[_0x530700('0x4c')],_0x48a0b6[_0xc8027a])):!_0x48a0b6[_0xc8027a][_0x530700('0x95')]?_0x188f6e[_0x530700('0x3f')](getAllowedResources(_0x129129,_0x48a0b6[_0xc8027a],_0x380ff4['childModel'])):_0x129129[_0x530700('0x36')]&&_0x188f6e[_0x530700('0x3f')](getAllFilteredResources(_0x129129,_0x48a0b6[_0xc8027a])));}return Promise[_0x530700('0x3b')](_0x188f6e);}else return null;})['then'](function(_0x4ff0d6){const _0x2a2d2a=_0x5577bb,_0x11bf90=_0x4ff0d6;let _0x3aa352=null;_0x11bf90&&(_0x3aa352=_0x11bf90[_0x2a2d2a('0x54')]===0x1?_0x11bf90[0x0]:null);if(_0x3aa352||_0x11bf90){const _0x50f50f=db[_0x380ff4[_0x2a2d2a('0x4c')]][_0x2a2d2a('0x8e')];_0x2c2ef9[_0x2a2d2a('0x36')]=_['keys'](_0x50f50f),_0x2c2ef9[_0x2a2d2a('0x6d')]=_[_0x2a2d2a('0x75')](_0x2d3ea3[_0x2a2d2a('0x6d')]),_0x2c2ef9[_0x2a2d2a('0x2a')]=_[_0x2a2d2a('0xb1')](_0x2c2ef9[_0x2a2d2a('0x36')],_0x2c2ef9[_0x2a2d2a('0x6d')]),_0x89ef5f[_0x2a2d2a('0x5a')]=_['intersection'](_0x2c2ef9[_0x2a2d2a('0x36')],qs[_0x2a2d2a('0xa9')](_0x2d3ea3['query'][_0x2a2d2a('0xa9')])),_0x89ef5f['attributes']=_0x89ef5f[_0x2a2d2a('0x5a')][_0x2a2d2a('0x54')]?_0x89ef5f[_0x2a2d2a('0x5a')]:_0x2c2ef9['model'];typeof _0x2d3ea3[_0x2a2d2a('0x6d')][_0x2a2d2a('0x11')]===_0x2a2d2a('0x7')&&(_0x89ef5f[_0x2a2d2a('0x3')]=qs[_0x2a2d2a('0x3')](_0x2d3ea3[_0x2a2d2a('0x6d')][_0x2a2d2a('0x3')]),_0x89ef5f[_0x2a2d2a('0x28')]=qs[_0x2a2d2a('0x28')](_0x2d3ea3[_0x2a2d2a('0x6d')][_0x2a2d2a('0x28')]));_0x89ef5f[_0x2a2d2a('0x76')]=qs[_0x2a2d2a('0xc7')](_0x2d3ea3[_0x2a2d2a('0x6d')]['sort']),_0x89ef5f[_0x2a2d2a('0x7b')]=qs['filters'](_[_0x2a2d2a('0x47')](_0x2d3ea3[_0x2a2d2a('0x6d')],_0x2c2ef9[_0x2a2d2a('0x2a')]));_0x2d3ea3[_0x2a2d2a('0x6d')][_0x2a2d2a('0x2b')]&&(_0x89ef5f[_0x2a2d2a('0x7b')]=_[_0x2a2d2a('0xb6')](_0x89ef5f[_0x2a2d2a('0x7b')],{[Op['or']]:_[_0x2a2d2a('0x74')](_0x50f50f,function(_0x29cf97){const _0x2c3daa=_0x2a2d2a;if(_0x29cf97['type'][_0x2c3daa('0x49')]!==_0x2c3daa('0x50')){const _0x1c38bc={};return _0x1c38bc[_0x29cf97[_0x2c3daa('0x8b')]]={[Op[_0x2c3daa('0x56')]]:'%'+_0x2d3ea3['query']['filter']+'%'},_0x1c38bc;}})}));const _0x102472=[];if(_0x3aa352){const _0x51b5c4=_['find'](_0x12cb75,[_0x2a2d2a('0x26'),_0x3aa352['name']]);if(_0x51b5c4[_0x2a2d2a('0x8b')]){const _0x4d93ed={};_0x380ff4[_0x2a2d2a('0x4c')]==='AnalyticExtractedReport'?_0x4d93ed[_0x51b5c4['foreignKey']]=_[_0x2a2d2a('0x74')](_0x3aa352[_0x2a2d2a('0x73')],'id'):_0x4d93ed[_0x51b5c4[_0x2a2d2a('0xa3')]]=_0x3aa352['associatedResources'],_0x102472['push'](_0x4d93ed);}else _0x89ef5f[_0x2a2d2a('0x7b')]['id']=_0x3aa352[_0x2a2d2a('0x73')];}else for(let _0x3d39db=0x0;_0x3d39db<_0x11bf90[_0x2a2d2a('0x54')];_0x3d39db++){const _0x5a0ee6=_['find'](_0x12cb75,[_0x2a2d2a('0x26'),_0x11bf90[_0x3d39db][_0x2a2d2a('0x26')]]);if(_0x5a0ee6[_0x2a2d2a('0x8b')]){const _0x48785a={};_0x48785a[_0x5a0ee6[_0x2a2d2a('0xa3')]]=_0x11bf90[_0x3d39db][_0x2a2d2a('0x73')],_0x102472[_0x2a2d2a('0x3f')](_0x48785a);}else{if(!_0x89ef5f['where']['id'])_0x89ef5f[_0x2a2d2a('0x7b')]['id']=[];_0x11bf90[_0x3d39db]['associatedResources'][_0x2a2d2a('0xbd')](function(_0x49ea37){const _0x198d17=_0x2a2d2a;_0x89ef5f[_0x198d17('0x7b')]['id'][_0x198d17('0x3f')](_0x49ea37);});}}return!_[_0x2a2d2a('0x33')](_0x102472)&&(_0x89ef5f[_0x2a2d2a('0x7b')]=_['merge'](_0x89ef5f['where'],{[Op[_0x2a2d2a('0xc2')]]:{[Op['or']]:_0x102472}})),_0x89ef5f=_[_0x2a2d2a('0xb6')]({},_0x89ef5f,_0x2d3ea3[_0x2a2d2a('0x1e')]),_0x3aa352&&!_0x3aa352[_0x2a2d2a('0x95')]&&_0x380ff4['childModel']===_0x2a2d2a('0xbb')?(_0x2d3ea3[_0x2a2d2a('0x6d')][_0x2a2d2a('0xa5')]&&(_0x89ef5f[_0x2a2d2a('0x51')]=[{'all':!![]}]),db[_0x380ff4['childModel']][_0x2a2d2a('0x5f')](_0x89ef5f)[_0x2a2d2a('0x2f')](function(_0xa3a38b){const _0x23972e=_0x2a2d2a,_0x2a8285=[];return _0xa3a38b[_0x23972e('0xbd')](function(_0x8d0748){const _0x21720d=_0x23972e;let _0x164db4;switch(_0x8d0748['reportType']){case _0x21720d('0xad'):_0x164db4=_[_0x21720d('0x3c')](_0x3aa352[_0x21720d('0x73')],function(_0x4fc8c1){const _0x1d4396=_0x21720d;return _0x4fc8c1['id']===_0x8d0748['reportId']&&_0x4fc8c1[_0x1d4396('0x8a')]===_0x1d4396('0x5e');});break;case _0x21720d('0x59'):_0x164db4=_[_0x21720d('0x3c')](_0x3aa352[_0x21720d('0x73')],function(_0x51afdb){const _0x36d11f=_0x21720d;return _0x51afdb['id']===_0x8d0748[_0x36d11f('0xa6')]&&_0x51afdb[_0x36d11f('0x8a')]===_0x36d11f('0xab');});break;}if(_0x164db4)_0x2a8285[_0x21720d('0x3f')](_0x8d0748);}),_0x5e7bc3[_0x23972e('0x62')]=_0x2a8285[_0x23972e('0x54')],_0x5e7bc3[_0x23972e('0x63')]=_0x2a8285,_0x5e7bc3;})):db[_0x380ff4[_0x2a2d2a('0x4c')]][_0x2a2d2a('0x62')]({'where':_0x89ef5f['where']})[_0x2a2d2a('0x2f')](function(_0x3cd68f){const _0x314ed3=_0x2a2d2a;return _0x5e7bc3['count']=_0x3cd68f,_0x2d3ea3[_0x314ed3('0x6d')][_0x314ed3('0xa5')]&&(_0x380ff4[_0x314ed3('0x4c')]===_0x314ed3('0xac')?_0x89ef5f[_0x314ed3('0x51')]=[{'model':db[_0x314ed3('0x8c')],'as':_0x314ed3('0x77'),'attributes':['id',_0x314ed3('0x26'),_0x314ed3('0x55')],'required':_0x2d3ea3[_0x314ed3('0x6d')][_0x314ed3('0x57')]?!![]:![]},{'model':db[_0x314ed3('0x8c')],'as':_0x314ed3('0xf'),'attributes':['id',_0x314ed3('0x26'),_0x314ed3('0x55')],'through':_0x2d3ea3[_0x314ed3('0x6d')][_0x314ed3('0x57')]?{'attributes':[],'where':{'TagId':_0x2d3ea3[_0x314ed3('0x6d')][_0x314ed3('0x57')]||undefined}}:{},'required':_0x2d3ea3[_0x314ed3('0x6d')][_0x314ed3('0x57')]?!![]:![]}]:_0x89ef5f['include']=[{'all':!![]}]),db[_0x380ff4['childModel']]['findAll'](_0x89ef5f);})[_0x2a2d2a('0x2f')](function(_0x31b4f4){const _0x499440=_0x2a2d2a;return _0x5e7bc3[_0x499440('0x63')]=_0x31b4f4,_0x5e7bc3;});}else return _0x5e7bc3;})[_0x5577bb('0x2f')](respondWithFilteredResult(_0x215e0f,_0x89ef5f))['catch'](handleError(_0x215e0f,null));};function getAllResources(_0x484399,_0x5608b3){return new Promise(function(_0x459dc1,_0x26358f){const _0x287a53=a667_0x304a;if(_0x5608b3){const _0x598371=_0x5608b3[_0x287a53('0x2b')]?{[_0x5608b3[_0x287a53('0x2b')]['field']]:_0x5608b3[_0x287a53('0x2b')][_0x287a53('0x81')]}:undefined;return db[_0x484399][_0x287a53('0x5f')]({'where':_0x598371,'raw':!![]})[_0x287a53('0x2f')](function(_0x56ed51){const _0x95317f=_0x287a53;_0x5608b3[_0x95317f('0x73')]=_[_0x95317f('0x74')](_0x56ed51,'id'),_0x459dc1(_0x5608b3);})[_0x287a53('0xbe')](function(_0x139eba){_0x26358f(_0x139eba);});}else _0x459dc1(null);});}function getAllFilteredResources(_0x25314b,_0x13abad){return new Promise(function(_0x3e236b,_0x2b3736){const _0x145007=a667_0x304a,_0x66a96e=_0x25314b[_0x145007('0x2b')]?{[_0x25314b[_0x145007('0x2b')][_0x145007('0x8b')]]:_0x25314b['filter'][_0x145007('0x81')]}:undefined;return db[_0x25314b[_0x145007('0x36')]][_0x145007('0x5f')]({'where':_0x66a96e,'raw':!![]})[_0x145007('0x2f')](function(_0x50d601){const _0x65dd5d=_0x145007;_0x13abad['associatedResources']=_[_0x65dd5d('0x74')](_0x50d601,function(_0x1467e7){return _0x1467e7['name'];}),_0x3e236b(_0x13abad);})['catch'](function(_0xf9da64){_0x2b3736(_0xf9da64);});});}function getAllowedResources(_0x3e969d,_0x72d627,_0x3aeaeb){return new Promise(function(_0x3a3f8e,_0xb0c910){const _0x5a401d=a667_0x304a;if(_0x72d627)return db[_0x5a401d('0x44')][_0x5a401d('0x5f')]({'where':{'sectionId':_0x72d627['id']},'raw':!![]})[_0x5a401d('0x2f')](function(_0x415d83){const _0x42d1e1=_0x5a401d;_0x3e969d[_0x42d1e1('0x8b')]&&_0x3e969d[_0x42d1e1('0x8b')]!=='id'?_0x72d627[_0x42d1e1('0x73')]=_['map'](_0x415d83,function(_0x274300){return _0x274300[_0x3e969d['field']];}):_0x3aeaeb===_0x42d1e1('0xbb')?_0x72d627['associatedResources']=_['map'](_0x415d83,function(_0x4a4486){const _0x463939=_0x42d1e1;return{'id':_0x4a4486[_0x463939('0x9e')],'type':_0x4a4486[_0x463939('0x8a')]};}):_0x72d627[_0x42d1e1('0x73')]=_['map'](_0x415d83,function(_0x17178c){return _0x17178c['resourceId'];}),_0x3a3f8e(_0x72d627);})[_0x5a401d('0xbe')](function(_0x3968e7){_0xb0c910(_0x3968e7);});else _0x3a3f8e(null);});}function getQueryModels(_0x57478a,_0x26ac47){const _0x32e271=_0x3a22bd,_0x4d8a92=_0x57478a[_0x32e271('0x24')](),_0x1ae99b={'childModel':undefined,'parentSections':[]};switch(_0x4d8a92){case _0x32e271('0xa4'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xa1');break;case _0x32e271('0xa'):_0x1ae99b['childModel']=_0x32e271('0x45');break;case'squarerecordings':_0x1ae99b['childModel']=_0x32e271('0x79'),_0x1ae99b[_0x32e271('0xa8')]=[{'name':'SquareProjects','field':_0x32e271('0x26'),'foreignKey':_0x32e271('0x89')}];break;case'projects':_0x1ae99b[_0x32e271('0x4c')]='JscriptyProject';break;case'contacts':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xac'),_0x1ae99b['parentSections']=[{'name':_0x32e271('0xcb'),'field':'id','foreignKey':'ListId'}];break;case'lists':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x2c');break;case _0x32e271('0x61'):_0x1ae99b[_0x32e271('0x4c')]='CmCompany';break;case _0x32e271('0x20'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xaf');break;case _0x32e271('0x1d'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xb2');break;case _0x32e271('0x86'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x9b');break;case _0x32e271('0x4f'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xb7');break;case'faxaccounts':_0x1ae99b[_0x32e271('0x4c')]='FaxAccount';break;case _0x32e271('0xb8'):case _0x32e271('0xae'):case'outboundroutes':_0x1ae99b['childModel']=_0x32e271('0x2');break;case'contexts':_0x1ae99b['childModel']=_0x32e271('0x7e');break;case _0x32e271('0x96'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x43');break;case _0x32e271('0x2d'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x99'),_0x1ae99b[_0x32e271('0xa8')]=[{'name':_0x32e271('0x60'),'field':_0x32e271('0x26'),'foreignKey':_0x32e271('0xb5'),'model':_0x32e271('0x92'),'filter':{'field':_0x32e271('0x48'),'value':[_0x32e271('0x5b')]}},{'name':'Telephones','field':_0x32e271('0x26'),'foreignKey':_0x32e271('0xb5'),'model':'User','filter':{'field':'role','value':['telephone']}},{'name':'VoiceQueues','field':_0x32e271('0x26'),'foreignKey':_0x32e271('0x39'),'model':'VoiceQueue','filter':{'field':_0x32e271('0x8a'),'value':['inbound']}},{'name':_0x32e271('0x6e'),'field':_0x32e271('0x26'),'foreignKey':_0x32e271('0x39'),'model':'VoiceQueue','filter':{'field':_0x32e271('0x8a'),'value':[_0x32e271('0x7a')]}}];break;case _0x32e271('0x1b'):_0x1ae99b[_0x32e271('0x4c')]='VoiceMusicOnHold';break;case _0x32e271('0x87'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x35');break;case _0x32e271('0x8'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x17');break;case _0x32e271('0x91'):_0x1ae99b[_0x32e271('0x4c')]='Campaign';break;case _0x32e271('0x10'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x88');break;case'mailaccounts':_0x1ae99b['childModel']=_0x32e271('0xc1');break;case'mailsubstatuses':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xc0');break;case _0x32e271('0x0'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x58');break;case _0x32e271('0x12'):_0x1ae99b[_0x32e271('0x4c')]='OpenchannelAccount';break;case'smsqueues':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xa2');break;case _0x32e271('0x3a'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xb');break;case'whatsappqueues':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xbf');break;case'whatsappaccounts':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x8d');break;case _0x32e271('0x6b'):_0x1ae99b['childModel']='Team';break;case _0x32e271('0x23'):case _0x32e271('0x83'):_0x1ae99b['childModel']='VoiceQueue';_0x26ac47&&(_0x1ae99b[_0x32e271('0xa8')]=[{'name':_0x32e271('0x41')},{'name':_0x32e271('0x6e')}]);break;case'users':case _0x32e271('0x21'):case'telephones':_0x1ae99b['childModel']=_0x32e271('0x92');_0x26ac47&&(_0x1ae99b[_0x32e271('0xa8')]=[{'name':_0x32e271('0x78'),'filter':{'field':_0x32e271('0x48'),'value':[_0x32e271('0xc'),_0x32e271('0x52')]},'ignore':!![]},{'name':_0x32e271('0x60')},{'name':_0x32e271('0x37')}]);break;case _0x32e271('0x30'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x70');break;case _0x32e271('0x8f'):_0x1ae99b[_0x32e271('0x4c')]='SalesforceAccount';break;case _0x32e271('0x6a'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xa0');break;case'sugarcrmaccounts':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x16');break;case _0x32e271('0x80'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x3d');break;case'zohoaccounts':_0x1ae99b['childModel']=_0x32e271('0x85');break;case'vtigeraccounts':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x92');break;case _0x32e271('0x7f'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x7d');break;case _0x32e271('0x42'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x5');break;case _0x32e271('0x46'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x4e');break;case _0x32e271('0x9a'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x94');break;case'pauses':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0xc6');break;case'scheduler':_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x3e');break;case _0x32e271('0x19'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x98');break;case _0x32e271('0xba'):_0x1ae99b[_0x32e271('0x4c')]='Tag';break;case _0x32e271('0xca'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x40');break;case _0x32e271('0x34'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x15');break;case _0x32e271('0x9f'):_0x1ae99b[_0x32e271('0x4c')]='Trunk';break;case _0x32e271('0x1c'):_0x1ae99b[_0x32e271('0x4c')]='Variable';break;case _0x32e271('0xc3'):_0x1ae99b[_0x32e271('0x4c')]=_0x32e271('0x1');break;case _0x32e271('0x1a'):_0x1ae99b[_0x32e271('0x4c')]='AnalyticExtractedReport',_0x1ae99b[_0x32e271('0xa8')]=[{'name':_0x32e271('0xa7'),'field':'id','foreignKey':_0x32e271('0xa6')}];break;case _0x32e271('0xb4'):_0x1ae99b[_0x32e271('0x4c')]='AnalyticMetric';break;default:return _0x1ae99b;}return _0x1ae99b;}