Built motion from commit d69f4380.|2.6.29
[motion2.git] / server / api / userProfile / userProfile.model.js
index bb48da9..ab3078a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf417=['tags','Tag','templates','Template','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','where','ui.UserId\x20=\x20?','sequelize','query','OpenTabs','UserProfile','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','UserProfileSection','find','params','all','ignore','length','autoAssociation','push','rawAttributes','keys','filters','attributes','intersection','fields','nolimit','limit','offset','sort','pick','merge','key','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','includeAll','include','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','order','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','fax','mail','openchannel','whatsapp','lodash','./userProfile.attributes','squel','models','filter','findAll','then','associatedResources','map','catch','value','model','name','resolve','UserProfileResource','field','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','faxaccounts','inboundroutes','internalroutes','outboundroutes','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','queue','inbound','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','Users','admin','user','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound'];(function(_0x4dae23,_0x1d2011){var _0x44bd79=function(_0x450c29){while(--_0x450c29){_0x4dae23['push'](_0x4dae23['shift']());}};_0x44bd79(++_0x1d2011);}(_0xf417,0x1d9));var _0x7f41=function(_0x2ea857,_0x466b31){_0x2ea857=_0x2ea857-0x0;var _0x20429a=_0xf417[_0x2ea857];return _0x20429a;};'use strict';var _=require(_0x7f41('0x0'));var attributes=require(_0x7f41('0x1'));var squel=require(_0x7f41('0x2'));module['exports']=function(_0x164855){var _0x329a6a=_0x164855[_0x7f41('0x3')];function _0xda29dd(_0x49a6ee,_0x549570){return new Promise(function(_0x467f61,_0x4a7a33){if(!_0x549570)return _0x467f61(null);var _0x3065a9=_0x549570['filter']?{[_0x549570[_0x7f41('0x4')]['field']]:_0x549570[_0x7f41('0x4')]['value']}:undefined;return _0x329a6a[_0x49a6ee][_0x7f41('0x5')]({'where':_0x3065a9,'raw':!![]})[_0x7f41('0x6')](function(_0x2eae9c){_0x549570[_0x7f41('0x7')]=_[_0x7f41('0x8')](_0x2eae9c,'id');_0x467f61(_0x549570);})[_0x7f41('0x9')](function(_0x5a39c4){_0x4a7a33(_0x5a39c4);});});}function _0x46fff9(_0x20486a,_0x998dc8){return new Promise(function(_0x1173ff,_0x183f8d){var _0x35d5b7=_0x20486a[_0x7f41('0x4')]?{[_0x20486a[_0x7f41('0x4')]['field']]:_0x20486a[_0x7f41('0x4')][_0x7f41('0xa')]}:undefined;return _0x329a6a[_0x20486a[_0x7f41('0xb')]][_0x7f41('0x5')]({'where':_0x35d5b7,'raw':!![]})[_0x7f41('0x6')](function(_0x22fb9c){_0x998dc8[_0x7f41('0x7')]=_['map'](_0x22fb9c,function(_0x21b4fc){return _0x21b4fc[_0x7f41('0xc')];});_0x1173ff(_0x998dc8);})[_0x7f41('0x9')](function(_0x20d9e3){_0x183f8d(_0x20d9e3);});});}function _0x4cd962(_0x3b0638,_0xbd8f1f,_0x1d68d){if(!_0xbd8f1f)return Promise[_0x7f41('0xd')](null);return new Promise(function(_0x42cee5,_0x43ee42){return _0x329a6a[_0x7f41('0xe')]['findAll']({'where':{'sectionId':_0xbd8f1f['id']},'raw':!![]})['then'](function(_0x26dec4){if(_0x3b0638[_0x7f41('0xf')]&&_0x3b0638['field']!=='id'){_0xbd8f1f[_0x7f41('0x7')]=_[_0x7f41('0x8')](_0x26dec4,function(_0x23f225){return _0x23f225[_0x3b0638[_0x7f41('0xf')]];});}else{if(_0x1d68d==='AnalyticExtractedReport'){_0xbd8f1f[_0x7f41('0x7')]=_[_0x7f41('0x8')](_0x26dec4,function(_0x12f200){return{'id':_0x12f200[_0x7f41('0x10')],'type':_0x12f200[_0x7f41('0x11')]};});}else{_0xbd8f1f[_0x7f41('0x7')]=_[_0x7f41('0x8')](_0x26dec4,function(_0x448525){return _0x448525[_0x7f41('0x10')];});}}_0x42cee5(_0xbd8f1f);})['catch'](function(_0x2db40d){_0x43ee42(_0x2db40d);});});}function _0x482878(_0x386ae6,_0x4e2c96){var _0x340f1a={'parentSections':[]};switch(_0x386ae6[_0x7f41('0x12')]()){case _0x7f41('0x13'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x15');break;case _0x7f41('0x16'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x17');break;case _0x7f41('0x18'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x19');_0x340f1a[_0x7f41('0x1a')]=[{'name':_0x7f41('0x1b'),'field':_0x7f41('0xc'),'foreignKey':_0x7f41('0x1c')}];break;case'projects':_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x1d');break;case _0x7f41('0x1e'):_0x340f1a['childModel']=_0x7f41('0x1f');_0x340f1a[_0x7f41('0x1a')]=[{'name':_0x7f41('0x20'),'field':'id','foreignKey':'ListId'}];break;case _0x7f41('0x21'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x22');break;case _0x7f41('0x23'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x24');break;case _0x7f41('0x25'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x26');break;case _0x7f41('0x27'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x28');break;case _0x7f41('0x29'):_0x340f1a[_0x7f41('0x14')]='ChatWebsite';break;case _0x7f41('0x2a'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x2b');break;case _0x7f41('0x2c'):_0x340f1a[_0x7f41('0x14')]='FaxAccount';break;case _0x7f41('0x2d'):case _0x7f41('0x2e'):case _0x7f41('0x2f'):_0x340f1a[_0x7f41('0x14')]='VoiceExtension';break;case'contexts':_0x340f1a['childModel']=_0x7f41('0x30');break;case'voicemails':_0x340f1a['childModel']=_0x7f41('0x31');break;case'voicerecordings':_0x340f1a['childModel']=_0x7f41('0x32');_0x340f1a[_0x7f41('0x1a')]=[{'name':_0x7f41('0x33'),'field':_0x7f41('0xc'),'foreignKey':_0x7f41('0x34'),'model':_0x7f41('0x35'),'filter':{'field':_0x7f41('0x36'),'value':[_0x7f41('0x37')]}},{'name':_0x7f41('0x38'),'field':_0x7f41('0xc'),'foreignKey':_0x7f41('0x34'),'model':'User','filter':{'field':_0x7f41('0x36'),'value':[_0x7f41('0x39')]}},{'name':'VoiceQueues','field':_0x7f41('0xc'),'foreignKey':_0x7f41('0x3a'),'model':'VoiceQueue','filter':{'field':_0x7f41('0x11'),'value':[_0x7f41('0x3b')]}},{'name':'QueueCampaigns','field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x7f41('0x11'),'value':[_0x7f41('0x3c')]}}];break;case _0x7f41('0x3d'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x3e');break;case _0x7f41('0x3f'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x40');break;case'voiceprefixes':_0x340f1a[_0x7f41('0x14')]='VoicePrefix';break;case'ivrcampaigns':_0x340f1a['childModel']=_0x7f41('0x41');break;case _0x7f41('0x42'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x43');break;case _0x7f41('0x44'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x45');break;case _0x7f41('0x46'):_0x340f1a[_0x7f41('0x14')]='MailSubstatus';break;case'openchannelqueues':_0x340f1a[_0x7f41('0x14')]='OpenchannelQueue';break;case'openchannelaccounts':_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x47');break;case _0x7f41('0x48'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x49');break;case _0x7f41('0x4a'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x4b');break;case _0x7f41('0x4c'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x4d');break;case _0x7f41('0x4e'):_0x340f1a[_0x7f41('0x14')]='WhatsappAccount';break;case'teams':_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x4f');break;case _0x7f41('0x50'):case _0x7f41('0x51'):_0x340f1a[_0x7f41('0x14')]='VoiceQueue';if(_0x4e2c96){_0x340f1a[_0x7f41('0x1a')]=[{'name':'VoiceQueues'},{'name':_0x7f41('0x52')}];}break;case _0x7f41('0x53'):case _0x7f41('0x54'):case'telephones':_0x340f1a['childModel']=_0x7f41('0x35');if(_0x4e2c96){_0x340f1a[_0x7f41('0x1a')]=[{'name':_0x7f41('0x55'),'filter':{'field':_0x7f41('0x36'),'value':[_0x7f41('0x56'),_0x7f41('0x57')]},'ignore':!![]},{'name':_0x7f41('0x33')},{'name':_0x7f41('0x38')}];}break;case'zendeskaccounts':_0x340f1a[_0x7f41('0x14')]='ZendeskAccount';break;case'salesforceaccounts':_0x340f1a['childModel']=_0x7f41('0x58');break;case _0x7f41('0x59'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x5a');break;case _0x7f41('0x5b'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x5c');break;case _0x7f41('0x5d'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x5e');break;case _0x7f41('0x5f'):_0x340f1a['childModel']=_0x7f41('0x60');break;case _0x7f41('0x61'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x35');break;case _0x7f41('0x62'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x63');break;case _0x7f41('0x64'):_0x340f1a['childModel']=_0x7f41('0x65');break;case'customdashboards':_0x340f1a[_0x7f41('0x14')]='Dashboard';break;case'intervals':_0x340f1a['childModel']=_0x7f41('0x66');break;case _0x7f41('0x67'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x68');break;case _0x7f41('0x69'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x6a');break;case _0x7f41('0x6b'):_0x340f1a['childModel']=_0x7f41('0x6c');break;case _0x7f41('0x6d'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x6e');break;case _0x7f41('0x6f'):_0x340f1a['childModel']=_0x7f41('0x70');break;case'triggers':_0x340f1a[_0x7f41('0x14')]='Trigger';break;case _0x7f41('0x71'):_0x340f1a[_0x7f41('0x14')]='Trunk';break;case _0x7f41('0x72'):_0x340f1a['childModel']=_0x7f41('0x73');break;case _0x7f41('0x74'):_0x340f1a[_0x7f41('0x14')]=_0x7f41('0x75');break;case _0x7f41('0x76'):_0x340f1a['childModel']='AnalyticExtractedReport';_0x340f1a[_0x7f41('0x1a')]=[{'name':_0x7f41('0x77'),'field':'id','foreignKey':_0x7f41('0x78')}];break;case'metrics':_0x340f1a['childModel']=_0x7f41('0x79');break;}return _0x340f1a;}function _0xa27d59(_0x3e844a,_0xa51b1c){var _0x4d3fa8=_0x3e844a['charAt'](0x0)[_0x7f41('0x7a')]()+_0x3e844a[_0x7f41('0x7b')](0x1);var _0x17622b={'type':_0x329a6a[_0x7f41('0x7c')][_0x7f41('0x7d')][_0x7f41('0x7e')],'raw':!![]};return new Promise(function(_0x561ffa,_0x326815){var _0xf8f09a=squel[_0x7f41('0x7f')]()[_0x7f41('0xf')](_0x7f41('0x80')+_0x4d3fa8+_0x7f41('0x81'),'id')['field'](_0x7f41('0x82'))[_0x7f41('0x83')](_0x7f41('0x84')+_0x3e844a+'_interactions','ui')[_0x7f41('0x85')](_0x7f41('0x86'),_0xa51b1c['id']);return _0x329a6a[_0x7f41('0x87')][_0x7f41('0x88')](_0xf8f09a['toString'](),_0x17622b)[_0x7f41('0x6')](function(_0x4f64b1){_0xa51b1c[_0x4d3fa8+_0x7f41('0x89')]=_0x4f64b1;_0x561ffa(_0x4f64b1);})[_0x7f41('0x9')](function(_0x5cf308){_0x326815(_0x5cf308);});});}return _0x164855['define'](_0x7f41('0x8a'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3d7a77){var _0x1957bb=require(_0x7f41('0x8b'));var _0x41fae6={'raw':_0x3d7a77[_0x7f41('0x88')][_0x7f41('0x8c')],'where':{}};var _0x3eb2af={};var _0x15f4e5={'count':0x0,'rows':[]};var _0x5a8c9e=_0x3d7a77[_0x7f41('0x88')][_0x7f41('0x8d')];var _0x269b07=_0x3d7a77[_0x7f41('0x88')][_0x7f41('0x8e')]||![];var _0x35edf7=_0x482878(_0x5a8c9e,_0x269b07);if(!_0x35edf7[_0x7f41('0x14')])throw new Error(_0x7f41('0x8f')+_0x5a8c9e+'\x27');var _0x36cd10=[{'name':_0x5a8c9e}];if(!_[_0x7f41('0x90')](_0x35edf7['parentSections']))_0x36cd10=_0x35edf7['parentSections'];var _0x39bf40=[];for(var _0x16cc0d=0x0;_0x16cc0d<_0x36cd10['length'];_0x16cc0d++){_0x39bf40['push'](_0x329a6a[_0x7f41('0x91')][_0x7f41('0x92')]({'where':{'userProfileId':_0x3d7a77[_0x7f41('0x93')]['id'],'name':_0x36cd10[_0x16cc0d]['name']},'raw':!![]}));}return Promise[_0x7f41('0x94')](_0x39bf40)[_0x7f41('0x6')](function(_0x435289){var _0x3c7169=_[_0x7f41('0x4')](_0x435289,function(_0x582350){return _0x582350?_0x582350:undefined;});var _0x48b8e8=_[_0x7f41('0x4')](_0x36cd10,[_0x7f41('0x95'),!![]]);var _0x29d6d5=_[_0x7f41('0x90')](_0x3c7169)&&_[_0x7f41('0x90')](_0x48b8e8)?null:_['union'](_0x48b8e8,_0x3c7169);if(!_0x29d6d5)return null;var _0x70d4e9=[];for(var _0x89d198=0x0;_0x89d198<_0x29d6d5[_0x7f41('0x96')];_0x89d198++){var _0x681e0=_[_0x7f41('0x92')](_0x36cd10,function(_0x1b0375){return _0x29d6d5[_0x89d198]?_0x1b0375[_0x7f41('0xc')]===_0x29d6d5[_0x89d198][_0x7f41('0xc')]:null;});if(_0x681e0){if(_0x29d6d5[_0x89d198][_0x7f41('0x95')]){_0x70d4e9['push'](_0xda29dd(_0x35edf7['childModel'],_0x29d6d5[_0x89d198]));}else{if(!_0x29d6d5[_0x89d198][_0x7f41('0x97')]){_0x70d4e9[_0x7f41('0x98')](_0x4cd962(_0x681e0,_0x29d6d5[_0x89d198],_0x35edf7[_0x7f41('0x14')]));}else{if(_0x681e0[_0x7f41('0xb')]){_0x70d4e9[_0x7f41('0x98')](_0x46fff9(_0x681e0,_0x29d6d5[_0x89d198]));}}}}}return Promise['all'](_0x70d4e9);})[_0x7f41('0x6')](function(_0x3b4be9){var _0x784d7f=_0x3b4be9;var _0x105d0a=null;if(_0x784d7f){_0x105d0a=_0x784d7f['length']===0x1?_0x784d7f[0x0]:null;}if(!_0x105d0a&&!_0x784d7f)return _0x15f4e5;var _0x89b75b=_0x329a6a[_0x35edf7[_0x7f41('0x14')]][_0x7f41('0x99')];_0x3eb2af[_0x7f41('0xb')]=_[_0x7f41('0x9a')](_0x89b75b);_0x3eb2af[_0x7f41('0x88')]=_[_0x7f41('0x9a')](_0x3d7a77[_0x7f41('0x88')]);_0x3eb2af[_0x7f41('0x9b')]=_['intersection'](_0x3eb2af[_0x7f41('0xb')],_0x3eb2af['query']);_0x41fae6[_0x7f41('0x9c')]=_[_0x7f41('0x9d')](_0x3eb2af['model'],_0x1957bb['fields'](_0x3d7a77[_0x7f41('0x88')][_0x7f41('0x9e')]));_0x41fae6[_0x7f41('0x9c')]=_0x41fae6['attributes'][_0x7f41('0x96')]?_0x41fae6['attributes']:_0x3eb2af[_0x7f41('0xb')];if(!_0x3d7a77[_0x7f41('0x88')]['hasOwnProperty'](_0x7f41('0x9f'))){_0x41fae6[_0x7f41('0xa0')]=_0x1957bb['limit'](_0x3d7a77[_0x7f41('0x88')]['limit']);_0x41fae6[_0x7f41('0xa1')]=_0x1957bb['offset'](_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xa1')]);}_0x41fae6['order']=_0x1957bb[_0x7f41('0xa2')](_0x3d7a77[_0x7f41('0x88')]['sort']);_0x41fae6['where']=_0x1957bb[_0x7f41('0x9b')](_[_0x7f41('0xa3')](_0x3d7a77[_0x7f41('0x88')],_0x3eb2af['filters']));if(_0x3d7a77[_0x7f41('0x88')][_0x7f41('0x4')]){_0x41fae6[_0x7f41('0x85')]=_[_0x7f41('0xa4')](_0x41fae6[_0x7f41('0x85')],{'$or':_[_0x7f41('0x8')](_0x89b75b,function(_0x157730){if(_0x157730[_0x7f41('0x11')][_0x7f41('0xa5')]!==_0x7f41('0xa6')){var _0x410f84={};_0x410f84[_0x157730[_0x7f41('0xf')]]={'$like':'%'+_0x3d7a77['query'][_0x7f41('0x4')]+'%'};return _0x410f84;}})});}var _0x840a0b=[];var _0x1e8c7c=null;var _0x32f4cb={};if(_0x105d0a){_0x1e8c7c=_[_0x7f41('0x92')](_0x36cd10,['name',_0x105d0a[_0x7f41('0xc')]]);if(_0x1e8c7c['field']){_0x32f4cb={};if(_0x35edf7['childModel']===_0x7f41('0xa7')){_0x32f4cb[_0x1e8c7c['foreignKey']]=_[_0x7f41('0x8')](_0x105d0a['associatedResources'],'id');}else{_0x32f4cb[_0x1e8c7c[_0x7f41('0xa8')]]=_0x105d0a[_0x7f41('0x7')];}_0x840a0b['push'](_0x32f4cb);}else{_0x41fae6['where']['id']=_0x105d0a[_0x7f41('0x7')];}}else{for(var _0x3ec4cb=0x0;_0x3ec4cb<_0x784d7f['length'];_0x3ec4cb++){_0x1e8c7c=_['find'](_0x36cd10,['name',_0x784d7f[_0x3ec4cb][_0x7f41('0xc')]]);if(_0x1e8c7c[_0x7f41('0xf')]){_0x32f4cb={};_0x32f4cb[_0x1e8c7c[_0x7f41('0xa8')]]=_0x784d7f[_0x3ec4cb][_0x7f41('0x7')];_0x840a0b[_0x7f41('0x98')](_0x32f4cb);}else{if(!_0x41fae6[_0x7f41('0x85')]['id'])_0x41fae6[_0x7f41('0x85')]['id']=[];_0x784d7f[_0x3ec4cb][_0x7f41('0x7')][_0x7f41('0xa9')](function(_0x58854d){_0x41fae6[_0x7f41('0x85')]['id'][_0x7f41('0x98')](_0x58854d);});}}}if(!_[_0x7f41('0x90')](_0x840a0b)){_0x41fae6[_0x7f41('0x85')]=_[_0x7f41('0xa4')](_0x41fae6[_0x7f41('0x85')],{'$and':{'$or':_0x840a0b}});}_0x41fae6=_['merge']({},_0x41fae6,_0x3d7a77['options']);if(_0x105d0a&&!_0x105d0a[_0x7f41('0x97')]&&_0x35edf7[_0x7f41('0x14')]===_0x7f41('0xa7')){if(_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xaa')]){_0x41fae6[_0x7f41('0xab')]=[{'all':!![]}];}return _0x329a6a[_0x35edf7['childModel']]['findAll'](_0x41fae6)[_0x7f41('0x6')](function(_0x2ad62c){var _0x3f80d7=[];_0x2ad62c[_0x7f41('0xa9')](function(_0x3e850a){var _0x1a24cc;switch(_0x3e850a['reportType']){case _0x7f41('0xac'):_0x1a24cc=_[_0x7f41('0x92')](_0x105d0a['associatedResources'],function(_0x20fa73){return _0x20fa73['id']===_0x3e850a[_0x7f41('0x78')]&&_0x20fa73[_0x7f41('0x11')]===_0x7f41('0xad');});break;case _0x7f41('0xae'):_0x1a24cc=_[_0x7f41('0x92')](_0x105d0a[_0x7f41('0x7')],function(_0x938aad){return _0x938aad['id']===_0x3e850a[_0x7f41('0x78')]&&_0x938aad[_0x7f41('0x11')]===_0x7f41('0xaf');});break;}if(_0x1a24cc)_0x3f80d7[_0x7f41('0x98')](_0x3e850a);});_0x15f4e5[_0x7f41('0xb0')]=_0x3f80d7[_0x7f41('0x96')];_0x15f4e5[_0x7f41('0xb1')]=_0x3f80d7;return _0x15f4e5;});}else{if(!_[_0x7f41('0x90')](_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb2')])){_0x41fae6[_0x7f41('0x85')]['id']=_0x41fae6[_0x7f41('0x85')]['id']?_[_0x7f41('0x9d')](_0x41fae6[_0x7f41('0x85')]['id'],_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb2')]):_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb2')];if(_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb3')]){_0x41fae6[_0x7f41('0xb4')]=_0x3d7a77[_0x7f41('0x88')]['customSorting'];}}if(_0x3d7a77['query']['extraQueryConditions']){_0x41fae6[_0x7f41('0x85')]=_['merge'](_0x41fae6[_0x7f41('0x85')],{'$and':_0x3d7a77[_0x7f41('0x88')]['extraQueryConditions']});}return _0x329a6a[_0x35edf7[_0x7f41('0x14')]][_0x7f41('0xb0')]({'where':_0x41fae6['where']})[_0x7f41('0x6')](function(_0x4750a8){_0x15f4e5[_0x7f41('0xb0')]=_0x4750a8;if(_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xaa')]){if(_0x35edf7[_0x7f41('0x14')]===_0x7f41('0x1f')){_0x41fae6[_0x7f41('0xab')]=[{'model':_0x329a6a[_0x7f41('0x6e')],'as':_0x7f41('0xb5'),'attributes':['id',_0x7f41('0xc'),_0x7f41('0xb6')],'required':_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb7')]?!![]:![]},{'model':_0x329a6a[_0x7f41('0x6e')],'as':_0x7f41('0xb8'),'attributes':['id',_0x7f41('0xc'),_0x7f41('0xb6')],'through':_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb7')]?{'attributes':[],'where':{'TagId':_0x3d7a77['query'][_0x7f41('0xb7')]||undefined}}:{},'required':_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb7')]?!![]:![]}];}else{_0x41fae6[_0x7f41('0xab')]=[{'all':!![]}];}}return _0x329a6a[_0x35edf7[_0x7f41('0x14')]][_0x7f41('0x5')](_0x41fae6);})['then'](function(_0x512c67){_0x15f4e5[_0x7f41('0xb1')]=_0x512c67;if(_0x5a8c9e===_0x7f41('0x33')&&_0x3d7a77[_0x7f41('0x88')][_0x7f41('0xb9')]===_0x7f41('0xba')){var _0x4e3b3b=[];for(var _0x4033e5=0x0;_0x4033e5<_0x15f4e5[_0x7f41('0xb1')][_0x7f41('0x96')];_0x4033e5++){_0x4e3b3b[_0x7f41('0x98')](_0xa27d59(_0x7f41('0xbb'),_0x15f4e5[_0x7f41('0xb1')][_0x4033e5][_0x7f41('0xbc')]));_0x4e3b3b[_0x7f41('0x98')](_0xa27d59(_0x7f41('0xbd'),_0x15f4e5[_0x7f41('0xb1')][_0x4033e5]['dataValues']));_0x4e3b3b[_0x7f41('0x98')](_0xa27d59(_0x7f41('0xbe'),_0x15f4e5['rows'][_0x4033e5][_0x7f41('0xbc')]));_0x4e3b3b[_0x7f41('0x98')](_0xa27d59(_0x7f41('0xbf'),_0x15f4e5[_0x7f41('0xb1')][_0x4033e5][_0x7f41('0xbc')]));_0x4e3b3b[_0x7f41('0x98')](_0xa27d59(_0x7f41('0xc0'),_0x15f4e5[_0x7f41('0xb1')][_0x4033e5][_0x7f41('0xbc')]));_0x4e3b3b['push'](_0xa27d59(_0x7f41('0xc1'),_0x15f4e5[_0x7f41('0xb1')][_0x4033e5][_0x7f41('0xbc')]));}return Promise[_0x7f41('0x94')](_0x4e3b3b)[_0x7f41('0x6')](function(){return _0x15f4e5;});}return _0x15f4e5;});}});}}});};
\ No newline at end of file
+var _0x9169=['voicequeues','users','telephones','Users','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','ZohoAccount','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','select','ui.','InteractionId','from','user_has_','_interactions','ui.UserId\x20=\x20?','query','toString','OpenTabs','UserProfile','user_profiles','../../components/parsers/qs','raw','section','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','params','all','isEmpty','union','ignore','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','pick','where','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','CustomReports','rows','ids','customSorting','order','extraQueryConditions','Tags','color','tag','ThroughTags','true','dataValues','sms','mail','openchannel','whatsapp','./userProfile.attributes','filter','value','findAll','map','catch','field','model','name','resolve','UserProfileResource','then','associatedResources','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projects','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxAccount','inboundroutes','internalroutes','contexts','VoiceContext','voicemails','VoiceRecording','Agents','membername','User','role','agent','Telephones','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','WhatsappAccount','teams'];(function(_0x18ca32,_0x136bd4){var _0x23761a=function(_0x409e09){while(--_0x409e09){_0x18ca32['push'](_0x18ca32['shift']());}};_0x23761a(++_0x136bd4);}(_0x9169,0x12d));var _0x9916=function(_0x4550e3,_0x1148a5){_0x4550e3=_0x4550e3-0x0;var _0x1809f0=_0x9169[_0x4550e3];return _0x1809f0;};'use strict';var _=require('lodash');var attributes=require(_0x9916('0x0'));var squel=require('squel');module['exports']=function(_0x555625){var _0x3a0c0d=_0x555625['models'];function _0x220552(_0x3a9975,_0x3ab0ab){return new Promise(function(_0x15033c,_0x1b679f){if(!_0x3ab0ab)return _0x15033c(null);var _0x48f937=_0x3ab0ab[_0x9916('0x1')]?{[_0x3ab0ab[_0x9916('0x1')]['field']]:_0x3ab0ab[_0x9916('0x1')][_0x9916('0x2')]}:undefined;return _0x3a0c0d[_0x3a9975][_0x9916('0x3')]({'where':_0x48f937,'raw':!![]})['then'](function(_0x489879){_0x3ab0ab['associatedResources']=_[_0x9916('0x4')](_0x489879,'id');_0x15033c(_0x3ab0ab);})[_0x9916('0x5')](function(_0x4d76bc){_0x1b679f(_0x4d76bc);});});}function _0x24916c(_0x2416fa,_0x30e2e8){return new Promise(function(_0x3de9e4,_0x46f423){var _0x16d5fb=_0x2416fa[_0x9916('0x1')]?{[_0x2416fa[_0x9916('0x1')][_0x9916('0x6')]]:_0x2416fa[_0x9916('0x1')][_0x9916('0x2')]}:undefined;return _0x3a0c0d[_0x2416fa[_0x9916('0x7')]][_0x9916('0x3')]({'where':_0x16d5fb,'raw':!![]})['then'](function(_0x5c112f){_0x30e2e8['associatedResources']=_[_0x9916('0x4')](_0x5c112f,function(_0x420353){return _0x420353[_0x9916('0x8')];});_0x3de9e4(_0x30e2e8);})['catch'](function(_0x531468){_0x46f423(_0x531468);});});}function _0xaf4527(_0xe21fb0,_0x1e38bb,_0x2d2938){if(!_0x1e38bb)return Promise[_0x9916('0x9')](null);return new Promise(function(_0x1745a9,_0x1fdf53){return _0x3a0c0d[_0x9916('0xa')][_0x9916('0x3')]({'where':{'sectionId':_0x1e38bb['id']},'raw':!![]})[_0x9916('0xb')](function(_0xec1e0a){if(_0xe21fb0[_0x9916('0x6')]&&_0xe21fb0[_0x9916('0x6')]!=='id'){_0x1e38bb[_0x9916('0xc')]=_[_0x9916('0x4')](_0xec1e0a,function(_0x1e4ded){return _0x1e4ded[_0xe21fb0[_0x9916('0x6')]];});}else{if(_0x2d2938===_0x9916('0xd')){_0x1e38bb['associatedResources']=_[_0x9916('0x4')](_0xec1e0a,function(_0x4aa99c){return{'id':_0x4aa99c[_0x9916('0xe')],'type':_0x4aa99c[_0x9916('0xf')]};});}else{_0x1e38bb['associatedResources']=_[_0x9916('0x4')](_0xec1e0a,function(_0x8b251e){return _0x8b251e[_0x9916('0xe')];});}}_0x1745a9(_0x1e38bb);})[_0x9916('0x5')](function(_0x16bf3f){_0x1fdf53(_0x16bf3f);});});}function _0x3511ce(_0x3da638,_0x52bec6){var _0x2598bf={'parentSections':[]};switch(_0x3da638[_0x9916('0x10')]()){case _0x9916('0x11'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x13');break;case _0x9916('0x14'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x15');break;case _0x9916('0x16'):_0x2598bf['childModel']='SquareRecording';_0x2598bf[_0x9916('0x17')]=[{'name':_0x9916('0x18'),'field':_0x9916('0x8'),'foreignKey':'projectName'}];break;case _0x9916('0x19'):_0x2598bf[_0x9916('0x12')]='JscriptyProject';break;case _0x9916('0x1a'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x1b');_0x2598bf['parentSections']=[{'name':_0x9916('0x1c'),'field':'id','foreignKey':_0x9916('0x1d')}];break;case _0x9916('0x1e'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x1f');break;case _0x9916('0x20'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x21');break;case _0x9916('0x22'):_0x2598bf[_0x9916('0x12')]='CmCustomField';break;case _0x9916('0x23'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x24');break;case _0x9916('0x25'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x26');break;case _0x9916('0x27'):_0x2598bf[_0x9916('0x12')]='FaxQueue';break;case'faxaccounts':_0x2598bf[_0x9916('0x12')]=_0x9916('0x28');break;case _0x9916('0x29'):case _0x9916('0x2a'):case'outboundroutes':_0x2598bf[_0x9916('0x12')]='VoiceExtension';break;case _0x9916('0x2b'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x2c');break;case _0x9916('0x2d'):_0x2598bf[_0x9916('0x12')]='VoiceMail';break;case'voicerecordings':_0x2598bf[_0x9916('0x12')]=_0x9916('0x2e');_0x2598bf[_0x9916('0x17')]=[{'name':_0x9916('0x2f'),'field':_0x9916('0x8'),'foreignKey':_0x9916('0x30'),'model':_0x9916('0x31'),'filter':{'field':_0x9916('0x32'),'value':[_0x9916('0x33')]}},{'name':_0x9916('0x34'),'field':_0x9916('0x8'),'foreignKey':_0x9916('0x30'),'model':_0x9916('0x31'),'filter':{'field':'role','value':[_0x9916('0x35')]}},{'name':_0x9916('0x36'),'field':'name','foreignKey':_0x9916('0x37'),'model':_0x9916('0x38'),'filter':{'field':_0x9916('0xf'),'value':[_0x9916('0x39')]}},{'name':_0x9916('0x3a'),'field':_0x9916('0x8'),'foreignKey':_0x9916('0x37'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x9916('0x3b')]}}];break;case _0x9916('0x3c'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x3d');break;case _0x9916('0x3e'):_0x2598bf['childModel']=_0x9916('0x3f');break;case _0x9916('0x40'):_0x2598bf[_0x9916('0x12')]='VoicePrefix';break;case _0x9916('0x41'):_0x2598bf[_0x9916('0x12')]='Campaign';break;case _0x9916('0x42'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x43');break;case _0x9916('0x44'):_0x2598bf['childModel']=_0x9916('0x45');break;case'mailsubstatuses':_0x2598bf[_0x9916('0x12')]=_0x9916('0x46');break;case _0x9916('0x47'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x48');break;case _0x9916('0x49'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x4a');break;case _0x9916('0x4b'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x4c');break;case _0x9916('0x4d'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x4e');break;case _0x9916('0x4f'):_0x2598bf['childModel']='WhatsappQueue';break;case _0x9916('0x50'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x51');break;case _0x9916('0x52'):_0x2598bf[_0x9916('0x12')]='Team';break;case _0x9916('0x53'):case'queuecampaigns':_0x2598bf[_0x9916('0x12')]=_0x9916('0x38');if(_0x52bec6){_0x2598bf['parentSections']=[{'name':_0x9916('0x36')},{'name':_0x9916('0x3a')}];}break;case _0x9916('0x54'):case'agents':case _0x9916('0x55'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x31');if(_0x52bec6){_0x2598bf['parentSections']=[{'name':_0x9916('0x56'),'filter':{'field':_0x9916('0x32'),'value':['admin','user']},'ignore':!![]},{'name':_0x9916('0x2f')},{'name':'Telephones'}];}break;case _0x9916('0x57'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x58');break;case _0x9916('0x59'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x5a');break;case'freshdeskaccounts':_0x2598bf['childModel']=_0x9916('0x5b');break;case _0x9916('0x5c'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x5d');break;case'deskaccounts':_0x2598bf[_0x9916('0x12')]=_0x9916('0x5e');break;case _0x9916('0x5f'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x60');break;case'vtigeraccounts':_0x2598bf[_0x9916('0x12')]='User';break;case'cannedanswers':_0x2598bf[_0x9916('0x12')]=_0x9916('0x61');break;case'dispositions':_0x2598bf[_0x9916('0x12')]=_0x9916('0x62');break;case _0x9916('0x63'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x64');break;case _0x9916('0x65'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x66');break;case _0x9916('0x67'):_0x2598bf[_0x9916('0x12')]='Pause';break;case'scheduler':_0x2598bf[_0x9916('0x12')]='Schedule';break;case'sounds':_0x2598bf['childModel']=_0x9916('0x68');break;case _0x9916('0x69'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x6a');break;case _0x9916('0x6b'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x6c');break;case _0x9916('0x6d'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x6e');break;case _0x9916('0x6f'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x70');break;case _0x9916('0x71'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x72');break;case'plugins':_0x2598bf[_0x9916('0x12')]=_0x9916('0x73');break;case _0x9916('0x74'):_0x2598bf[_0x9916('0x12')]=_0x9916('0xd');_0x2598bf['parentSections']=[{'name':_0x9916('0x75'),'field':'id','foreignKey':_0x9916('0x76')}];break;case _0x9916('0x77'):_0x2598bf[_0x9916('0x12')]=_0x9916('0x78');break;}return _0x2598bf;}function _0x5adf6f(_0x46766a,_0x356183){var _0x586cb0=_0x46766a[_0x9916('0x79')](0x0)[_0x9916('0x7a')]()+_0x46766a[_0x9916('0x7b')](0x1);var _0x195854={'type':_0x3a0c0d[_0x9916('0x7c')][_0x9916('0x7d')]['SELECT'],'raw':!![]};return new Promise(function(_0x3e658a,_0x4d045c){var _0x1963cf=squel[_0x9916('0x7e')]()[_0x9916('0x6')](_0x9916('0x7f')+_0x586cb0+_0x9916('0x80'),'id')[_0x9916('0x6')]('ui.createdAt')[_0x9916('0x81')](_0x9916('0x82')+_0x46766a+_0x9916('0x83'),'ui')['where'](_0x9916('0x84'),_0x356183['id']);return _0x3a0c0d['sequelize'][_0x9916('0x85')](_0x1963cf[_0x9916('0x86')](),_0x195854)[_0x9916('0xb')](function(_0x1a4414){_0x356183[_0x586cb0+_0x9916('0x87')]=_0x1a4414;_0x3e658a(_0x1a4414);})[_0x9916('0x5')](function(_0x49af21){_0x4d045c(_0x49af21);});});}return _0x555625['define'](_0x9916('0x88'),attributes,{'tableName':_0x9916('0x89'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0xe46f9d){var _0x4a02ee=require(_0x9916('0x8a'));var _0x2f9c94={'raw':_0xe46f9d[_0x9916('0x85')][_0x9916('0x8b')],'where':{}};var _0x56091f={};var _0x28436f={'count':0x0,'rows':[]};var _0x46f015=_0xe46f9d['query'][_0x9916('0x8c')];var _0x45e8c9=_0xe46f9d[_0x9916('0x85')]['mergeResources']||![];var _0x5d5034=_0x3511ce(_0x46f015,_0x45e8c9);if(!_0x5d5034[_0x9916('0x12')])throw new Error(_0x9916('0x8d')+_0x46f015+'\x27');var _0x472ced=[{'name':_0x46f015}];if(!_['isEmpty'](_0x5d5034['parentSections']))_0x472ced=_0x5d5034[_0x9916('0x17')];var _0x2cf9c5=[];for(var _0x11597a=0x0;_0x11597a<_0x472ced[_0x9916('0x8e')];_0x11597a++){_0x2cf9c5[_0x9916('0x8f')](_0x3a0c0d[_0x9916('0x90')][_0x9916('0x91')]({'where':{'userProfileId':_0xe46f9d[_0x9916('0x92')]['id'],'name':_0x472ced[_0x11597a][_0x9916('0x8')]},'raw':!![]}));}return Promise[_0x9916('0x93')](_0x2cf9c5)[_0x9916('0xb')](function(_0x34bd42){var _0xee146d=_[_0x9916('0x1')](_0x34bd42,function(_0x473940){return _0x473940?_0x473940:undefined;});var _0x59a507=_[_0x9916('0x1')](_0x472ced,['ignore',!![]]);var _0x46e03e=_['isEmpty'](_0xee146d)&&_[_0x9916('0x94')](_0x59a507)?null:_[_0x9916('0x95')](_0x59a507,_0xee146d);if(!_0x46e03e)return null;var _0xc9dba7=[];for(var _0x2310d9=0x0;_0x2310d9<_0x46e03e[_0x9916('0x8e')];_0x2310d9++){var _0x169d81=_['find'](_0x472ced,function(_0x1d5644){return _0x46e03e[_0x2310d9]?_0x1d5644[_0x9916('0x8')]===_0x46e03e[_0x2310d9][_0x9916('0x8')]:null;});if(_0x169d81){if(_0x46e03e[_0x2310d9][_0x9916('0x96')]){_0xc9dba7['push'](_0x220552(_0x5d5034[_0x9916('0x12')],_0x46e03e[_0x2310d9]));}else{if(!_0x46e03e[_0x2310d9][_0x9916('0x97')]){_0xc9dba7[_0x9916('0x8f')](_0xaf4527(_0x169d81,_0x46e03e[_0x2310d9],_0x5d5034[_0x9916('0x12')]));}else{if(_0x169d81[_0x9916('0x7')]){_0xc9dba7[_0x9916('0x8f')](_0x24916c(_0x169d81,_0x46e03e[_0x2310d9]));}}}}}return Promise['all'](_0xc9dba7);})[_0x9916('0xb')](function(_0x1920b1){var _0x4eef57=_0x1920b1;var _0x47a513=null;if(_0x4eef57){_0x47a513=_0x4eef57[_0x9916('0x8e')]===0x1?_0x4eef57[0x0]:null;}if(!_0x47a513&&!_0x4eef57)return _0x28436f;var _0xc81f58=_0x3a0c0d[_0x5d5034['childModel']][_0x9916('0x98')];_0x56091f[_0x9916('0x7')]=_[_0x9916('0x99')](_0xc81f58);_0x56091f['query']=_[_0x9916('0x99')](_0xe46f9d[_0x9916('0x85')]);_0x56091f[_0x9916('0x9a')]=_[_0x9916('0x9b')](_0x56091f['model'],_0x56091f[_0x9916('0x85')]);_0x2f9c94[_0x9916('0x9c')]=_[_0x9916('0x9b')](_0x56091f[_0x9916('0x7')],_0x4a02ee[_0x9916('0x9d')](_0xe46f9d[_0x9916('0x85')]['fields']));_0x2f9c94[_0x9916('0x9c')]=_0x2f9c94['attributes'][_0x9916('0x8e')]?_0x2f9c94[_0x9916('0x9c')]:_0x56091f['model'];if(!_0xe46f9d[_0x9916('0x85')][_0x9916('0x9e')](_0x9916('0x9f'))){_0x2f9c94[_0x9916('0xa0')]=_0x4a02ee[_0x9916('0xa0')](_0xe46f9d[_0x9916('0x85')][_0x9916('0xa0')]);_0x2f9c94['offset']=_0x4a02ee[_0x9916('0xa1')](_0xe46f9d[_0x9916('0x85')][_0x9916('0xa1')]);}_0x2f9c94['order']=_0x4a02ee[_0x9916('0xa2')](_0xe46f9d[_0x9916('0x85')][_0x9916('0xa2')]);_0x2f9c94['where']=_0x4a02ee[_0x9916('0x9a')](_[_0x9916('0xa3')](_0xe46f9d[_0x9916('0x85')],_0x56091f[_0x9916('0x9a')]));if(_0xe46f9d[_0x9916('0x85')][_0x9916('0x1')]){_0x2f9c94[_0x9916('0xa4')]=_[_0x9916('0xa5')](_0x2f9c94[_0x9916('0xa4')],{'$or':_[_0x9916('0x4')](_0xc81f58,function(_0x514415){if(_0x514415[_0x9916('0xf')][_0x9916('0xa6')]!==_0x9916('0xa7')){var _0x499a61={};_0x499a61[_0x514415[_0x9916('0x6')]]={'$like':'%'+_0xe46f9d[_0x9916('0x85')]['filter']+'%'};return _0x499a61;}})});}var _0x4298f6=[];var _0x5e7d52=null;var _0x45f171={};if(_0x47a513){_0x5e7d52=_[_0x9916('0x91')](_0x472ced,[_0x9916('0x8'),_0x47a513[_0x9916('0x8')]]);if(_0x5e7d52[_0x9916('0x6')]){_0x45f171={};if(_0x5d5034[_0x9916('0x12')]===_0x9916('0xd')){_0x45f171[_0x5e7d52['foreignKey']]=_[_0x9916('0x4')](_0x47a513['associatedResources'],'id');}else{_0x45f171[_0x5e7d52[_0x9916('0xa8')]]=_0x47a513[_0x9916('0xc')];}_0x4298f6[_0x9916('0x8f')](_0x45f171);}else{_0x2f9c94[_0x9916('0xa4')]['id']=_0x47a513[_0x9916('0xc')];}}else{for(var _0x184de4=0x0;_0x184de4<_0x4eef57['length'];_0x184de4++){_0x5e7d52=_[_0x9916('0x91')](_0x472ced,['name',_0x4eef57[_0x184de4][_0x9916('0x8')]]);if(_0x5e7d52[_0x9916('0x6')]){_0x45f171={};_0x45f171[_0x5e7d52[_0x9916('0xa8')]]=_0x4eef57[_0x184de4][_0x9916('0xc')];_0x4298f6[_0x9916('0x8f')](_0x45f171);}else{if(!_0x2f9c94['where']['id'])_0x2f9c94[_0x9916('0xa4')]['id']=[];_0x4eef57[_0x184de4][_0x9916('0xc')][_0x9916('0xa9')](function(_0x46732a){_0x2f9c94[_0x9916('0xa4')]['id'][_0x9916('0x8f')](_0x46732a);});}}}if(!_['isEmpty'](_0x4298f6)){_0x2f9c94[_0x9916('0xa4')]=_[_0x9916('0xa5')](_0x2f9c94[_0x9916('0xa4')],{'$and':{'$or':_0x4298f6}});}_0x2f9c94=_[_0x9916('0xa5')]({},_0x2f9c94,_0xe46f9d[_0x9916('0xaa')]);if(_0x47a513&&!_0x47a513[_0x9916('0x97')]&&_0x5d5034[_0x9916('0x12')]==='AnalyticExtractedReport'){if(_0xe46f9d[_0x9916('0x85')][_0x9916('0xab')]){_0x2f9c94[_0x9916('0xac')]=[{'all':!![]}];}return _0x3a0c0d[_0x5d5034[_0x9916('0x12')]][_0x9916('0x3')](_0x2f9c94)[_0x9916('0xb')](function(_0x43a9c2){var _0x4ad73e=[];_0x43a9c2[_0x9916('0xa9')](function(_0x482653){var _0x42958f;switch(_0x482653[_0x9916('0xad')]){case _0x9916('0xae'):_0x42958f=_['find'](_0x47a513[_0x9916('0xc')],function(_0x2c6487){return _0x2c6487['id']===_0x482653[_0x9916('0x76')]&&_0x2c6487[_0x9916('0xf')]===_0x9916('0xaf');});break;case'custom':_0x42958f=_['find'](_0x47a513['associatedResources'],function(_0x5417cc){return _0x5417cc['id']===_0x482653[_0x9916('0x76')]&&_0x5417cc[_0x9916('0xf')]===_0x9916('0xb0');});break;}if(_0x42958f)_0x4ad73e[_0x9916('0x8f')](_0x482653);});_0x28436f['count']=_0x4ad73e[_0x9916('0x8e')];_0x28436f[_0x9916('0xb1')]=_0x4ad73e;return _0x28436f;});}else{if(!_[_0x9916('0x94')](_0xe46f9d['query'][_0x9916('0xb2')])){_0x2f9c94[_0x9916('0xa4')]['id']=_0x2f9c94[_0x9916('0xa4')]['id']?_['intersection'](_0x2f9c94[_0x9916('0xa4')]['id'],_0xe46f9d[_0x9916('0x85')][_0x9916('0xb2')]):_0xe46f9d['query']['ids'];if(_0xe46f9d[_0x9916('0x85')][_0x9916('0xb3')]){_0x2f9c94[_0x9916('0xb4')]=_0xe46f9d[_0x9916('0x85')][_0x9916('0xb3')];}}if(_0xe46f9d['query'][_0x9916('0xb5')]){_0x2f9c94[_0x9916('0xa4')]=_[_0x9916('0xa5')](_0x2f9c94['where'],{'$and':_0xe46f9d['query']['extraQueryConditions']});}return _0x3a0c0d[_0x5d5034['childModel']]['count']({'where':_0x2f9c94[_0x9916('0xa4')]})['then'](function(_0x28eb77){_0x28436f['count']=_0x28eb77;if(_0xe46f9d[_0x9916('0x85')][_0x9916('0xab')]){if(_0x5d5034['childModel']===_0x9916('0x1b')){_0x2f9c94[_0x9916('0xac')]=[{'model':_0x3a0c0d['Tag'],'as':_0x9916('0xb6'),'attributes':['id',_0x9916('0x8'),_0x9916('0xb7')],'required':_0xe46f9d[_0x9916('0x85')][_0x9916('0xb8')]?!![]:![]},{'model':_0x3a0c0d[_0x9916('0x6a')],'as':_0x9916('0xb9'),'attributes':['id','name',_0x9916('0xb7')],'through':_0xe46f9d[_0x9916('0x85')][_0x9916('0xb8')]?{'attributes':[],'where':{'TagId':_0xe46f9d[_0x9916('0x85')][_0x9916('0xb8')]||undefined}}:{},'required':_0xe46f9d['query'][_0x9916('0xb8')]?!![]:![]}];}else{_0x2f9c94[_0x9916('0xac')]=[{'all':!![]}];}}return _0x3a0c0d[_0x5d5034['childModel']][_0x9916('0x3')](_0x2f9c94);})[_0x9916('0xb')](function(_0x17ce51){_0x28436f[_0x9916('0xb1')]=_0x17ce51;if(_0x46f015===_0x9916('0x2f')&&_0xe46f9d[_0x9916('0x85')]['openTabs']===_0x9916('0xba')){var _0x3d8180=[];for(var _0x5f2dc0=0x0;_0x5f2dc0<_0x28436f[_0x9916('0xb1')]['length'];_0x5f2dc0++){_0x3d8180[_0x9916('0x8f')](_0x5adf6f('chat',_0x28436f[_0x9916('0xb1')][_0x5f2dc0][_0x9916('0xbb')]));_0x3d8180['push'](_0x5adf6f(_0x9916('0xbc'),_0x28436f[_0x9916('0xb1')][_0x5f2dc0]['dataValues']));_0x3d8180['push'](_0x5adf6f('fax',_0x28436f[_0x9916('0xb1')][_0x5f2dc0][_0x9916('0xbb')]));_0x3d8180[_0x9916('0x8f')](_0x5adf6f(_0x9916('0xbd'),_0x28436f[_0x9916('0xb1')][_0x5f2dc0][_0x9916('0xbb')]));_0x3d8180[_0x9916('0x8f')](_0x5adf6f(_0x9916('0xbe'),_0x28436f[_0x9916('0xb1')][_0x5f2dc0][_0x9916('0xbb')]));_0x3d8180['push'](_0x5adf6f(_0x9916('0xbf'),_0x28436f['rows'][_0x5f2dc0][_0x9916('0xbb')]));}return Promise[_0x9916('0x93')](_0x3d8180)[_0x9916('0xb')](function(){return _0x28436f;});}return _0x28436f;});}});}}});};
\ No newline at end of file