Built motion from commit bfc7a72f7045b27461c9a5d1f71c1a658cfd0b8b. Version 3.0.0...
[motion-next.git] / server / services / ami / realtime / index.js
index 7019020..b4b28e2 100644 (file)
@@ -1 +1 @@
-const a1092_0x5077=['mapKeys','billableseconds','initFaxAccounts','total','SquareProject','zohoAccounts','isEmpty','outboundNoSuchCallsDay','format','dialQueueProject','../model/freshdeskAccount','uniqueid','isUndefined','../model/vtigerAccount','outboundRejectCallsDay','diff','merge','vtigerAccounts','lodash','util','initTriggers','sumDuration','../model/dynamics365Account','voiceQueues','length','exports','queuecallercompleteAt','../model/deskAccount','outboundCongestionCallsDay','freshdeskAccounts','agents','prototype','sugarcrmAccounts','deskAccounts','salesforceAccounts','../model/trigger','queueChannels','freshsalesAccounts','initCampaigns','isNil','undefined','outboundAnswerAgiCallsDay','queuecallerjoinAt','initFreshsalesAccounts','initVoiceQueues','triggers','dynamics365Accounts','initCampaignHopperHistory','queue','../model/template','initServicenowAccounts','ivrTotalCallsDays','sumBillable','../model/voiceExtension','sumHoldTime','templates','queuecallerabandonAt','ivrAnswerCallsDay','initVoiceQueueHopperHistory','groupBy','initVoiceQueueReports','initZendeskAccounts','interface','initVtigerAccounts','initTemplates','../model/zohoAccount','abandoned','SIP/%s','answered','outbound','servicenowAccounts','../model/freshsalesAccount','ANSWERED','initDeskAccounts','timers','outboundDropCallsDayCallersExit','name','campaigns','../model/servicenowAccount','telephones','mergeFromDatabase','zendeskAccounts','initVoiceExtensions','seconds','faxAccounts','voiceExtensions','initVoiceCallReports','outboundChannels','duration','../model/zendeskAccount','outboundBlacklistCallsDay','queuecallerleaveAt','trunks'];(function(_0xe4ffe3,_0x507777){const _0x5f1d1e=function(_0x1f4f62){while(--_0x1f4f62){_0xe4ffe3['push'](_0xe4ffe3['shift']());}};_0x5f1d1e(++_0x507777);}(a1092_0x5077,0x1b0));const a1092_0x5f1d=function(_0xe4ffe3,_0x507777){_0xe4ffe3=_0xe4ffe3-0x0;let _0x5f1d1e=a1092_0x5077[_0xe4ffe3];return _0x5f1d1e;};const _0x2e61c0=a1092_0x5f1d;'use strict';const util=require(_0x2e61c0('0x34')),_=require(_0x2e61c0('0x33')),moment=require('moment'),Agent=require('../model/agent'),Telephone=require('../model/telephone'),Trunk=require('../model/trunk'),VoiceQueue=require('../model/voiceQueue'),Trigger=require(_0x2e61c0('0x44')),Template=require(_0x2e61c0('0x52')),Campaign=require('../model/campaign'),VoiceExtension=require(_0x2e61c0('0x56')),ZendeskAccount=require(_0x2e61c0('0x1d')),SalesforceAccount=require('../model/salesforceAccount'),FreshdeskAccount=require(_0x2e61c0('0x2b')),SugarcrmAccount=require('../model/sugarcrmAccount'),ZohoAccount=require(_0x2e61c0('0x5')),DeskAccount=require(_0x2e61c0('0x3c')),VtigerAccount=require(_0x2e61c0('0x2e')),ServicenowAccount=require(_0x2e61c0('0x12')),Dynamics365Account=require(_0x2e61c0('0x37')),FreshsalesAccount=require(_0x2e61c0('0xb')),FaxAccount=require('../model/faxAccount'),Realtime=function(){const _0x219800=_0x2e61c0;this[_0x219800('0x3f')]={},this['telephones']={},this[_0x219800('0x20')]={},this[_0x219800('0x38')]={},this[_0x219800('0x4e')]={},this[_0x219800('0x11')]={},this[_0x219800('0x58')]={},this[_0x219800('0x9')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0},this[_0x219800('0x19')]={},this['channels']={},this[_0x219800('0x45')]={},this[_0x219800('0x1b')]={},this[_0x219800('0xe')]={},this[_0x219800('0x15')]={},this[_0x219800('0x43')]={},this[_0x219800('0x41')]={},this['freshdeskAccounts']={},this[_0x219800('0x26')]={},this['deskAccounts']={},this[_0x219800('0x32')]={},this[_0x219800('0xa')]={},this['dynamics365Accounts']={},this[_0x219800('0x46')]={},this[_0x219800('0x18')]={};};function freeIsNotKey(_0x1f4f62,_0x51dcab,_0x39fe59){const _0x17351d=_0x2e61c0,_0x21b88a=_[_0x17351d('0x21')](_0x1f4f62,function(_0x371a09){return _0x371a09[_0x39fe59];});for(const _0x19d6d5 in _0x51dcab){typeof _0x51dcab[_0x19d6d5]!==_0x17351d('0x49')&&(!_0x21b88a[_0x19d6d5]&&delete _0x51dcab[_0x19d6d5]);}}function freeIsNotKeySip(_0x21547f,_0x3bb001){const _0x2f9641=_0x2e61c0,_0x522a7b=_[_0x2f9641('0x21')](_0x21547f,function(_0x20774c){const _0x4dc0b4=_0x2f9641;return util[_0x4dc0b4('0x29')]('SIP/%s',_0x20774c['name']);});for(const _0x18d93c in _0x3bb001){typeof _0x3bb001[_0x18d93c]!==_0x2f9641('0x49')&&(!_0x522a7b[_0x18d93c]&&delete _0x3bb001[_0x18d93c]);}}function freeIsNotKeyAgent(_0x30708f,_0x2613ea){const _0x31a8b7=_0x2e61c0,_0x1cce12=_['mapKeys'](_0x30708f,function(_0x3409bf){const _0x24c3ff=a1092_0x5f1d,_0x386194=_[_0x24c3ff('0x48')](_0x3409bf['interface'])?util[_0x24c3ff('0x29')](_0x24c3ff('0x7'),_0x3409bf[_0x24c3ff('0x10')]):_0x3409bf[_0x24c3ff('0x2')];return _0x386194;});for(const _0xd08a4f in _0x2613ea){typeof _0x2613ea[_0xd08a4f]!==_0x31a8b7('0x49')&&(!_0x1cce12[_0xd08a4f]&&delete _0x2613ea[_0xd08a4f]);}}function clearVoiceCallReports(_0x537036){const _0x51db3c=_0x2e61c0;_0x537036['total']=0x0,_0x537036[_0x51db3c('0x8')]=0x0,_0x537036[_0x51db3c('0x57')]=0x0,_0x537036[_0x51db3c('0x36')]=0x0,_0x537036[_0x51db3c('0x55')]=0x0;}function clearCampaigns(_0x49b2a2){const _0x2f55b5=_0x2e61c0;if(!_['isEmpty'](_0x49b2a2))for(const _0x345c48 in _0x49b2a2){typeof _0x49b2a2[_0x345c48]!==_0x2f55b5('0x49')&&(_0x49b2a2[_0x345c48][_0x2f55b5('0x54')]=0x0,_0x49b2a2[_0x345c48][_0x2f55b5('0x5a')]=0x0);}}function clearVoiceQueues(_0x5d0e1f){const _0x3ba1a3=_0x2e61c0;if(!_[_0x3ba1a3('0x27')](_0x5d0e1f))for(const _0x5e455d in _0x5d0e1f){typeof _0x5d0e1f[_0x5e455d]!==_0x3ba1a3('0x49')&&(_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x24')]=0x0,_0x5d0e1f[_0x5e455d]['answered']=0x0,_0x5d0e1f[_0x5e455d]['unmanaged']=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x6')]=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x57')]=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x36')]=0x0,_0x5d0e1f[_0x5e455d]['sumBillable']=0x0,_0x5d0e1f[_0x5e455d]['outboundAnswerAgiCallsDay']=0x0,_0x5d0e1f[_0x5e455d]['outboundNoAnswerCallsDay']=0x0,_0x5d0e1f[_0x5e455d]['outboundBusyCallsDay']=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x3d')]=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x28')]=0x0,_0x5d0e1f[_0x5e455d]['outboundUnknownCallsDay']=0x0,_0x5d0e1f[_0x5e455d]['outboundDropCallsDayTimeout']=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0xf')]=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x1e')]=0x0,_0x5d0e1f[_0x5e455d]['outboundOriginateFailureCallsDay']=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x2f')]=0x0,_0x5d0e1f[_0x5e455d]['outboundReCallsDay']=0x0,_0x5d0e1f[_0x5e455d][_0x3ba1a3('0x4a')]=0x0,_0x5d0e1f[_0x5e455d]['outboundAnswerCallsDay']=0x0,_0x5d0e1f[_0x5e455d]['queueStatusComplete']=!![]);}}Realtime[_0x2e61c0('0x40')]['mergeFromDatabase']=function(_0x5a83fe,_0x5c757d){const _0x4db167=_0x2e61c0;for(const _0x5a2af5 in _0x5c757d){typeof _0x5a83fe[_0x5a2af5]!==_0x4db167('0x49')&&(_0x5a83fe[_0x5a2af5]=_0x5c757d[_0x5a2af5]);}},Realtime[_0x2e61c0('0x40')]['initAgents']=function(){const _0x240aee=this;return function(_0x286be9){const _0x27cb39=a1092_0x5f1d;if(_0x286be9){freeIsNotKeyAgent(_0x286be9,_0x240aee[_0x27cb39('0x3f')]);for(let _0x356bac=0x0,_0x306a64={};_0x356bac<_0x286be9[_0x27cb39('0x39')];_0x356bac+=0x1){_0x306a64=_0x286be9[_0x356bac];const _0xf06116=_[_0x27cb39('0x48')](_0x306a64[_0x27cb39('0x2')])?util[_0x27cb39('0x29')](_0x27cb39('0x7'),_0x306a64[_0x27cb39('0x10')]):_0x306a64[_0x27cb39('0x2')];_[_0x27cb39('0x2d')](_0x240aee[_0x27cb39('0x3f')][_0xf06116])?_0x240aee[_0x27cb39('0x3f')][_0xf06116]=new Agent(_0x306a64):_0x240aee[_0x27cb39('0x14')](_0x240aee[_0x27cb39('0x3f')][_0xf06116],_0x306a64);}}return _0x240aee[_0x27cb39('0x3f')];};},Realtime[_0x2e61c0('0x40')]['initTelephones']=function(){const _0x1cffaa=this;return function(_0x120c24){const _0x55c213=a1092_0x5f1d;if(_0x120c24){freeIsNotKeySip(_0x120c24,_0x1cffaa[_0x55c213('0x13')]);for(let _0xbcd517=0x0,_0x506b67={};_0xbcd517<_0x120c24[_0x55c213('0x39')];_0xbcd517+=0x1){_0x506b67=_0x120c24[_0xbcd517],_[_0x55c213('0x2d')](_0x1cffaa['telephones'][util['format'](_0x55c213('0x7'),_0x506b67[_0x55c213('0x10')])])?_0x1cffaa[_0x55c213('0x13')][util[_0x55c213('0x29')](_0x55c213('0x7'),_0x506b67[_0x55c213('0x10')])]=new Telephone(_0x506b67):_0x1cffaa[_0x55c213('0x14')](_0x1cffaa[_0x55c213('0x13')][util['format'](_0x55c213('0x7'),_0x506b67[_0x55c213('0x10')])],_0x506b67);}}return _0x1cffaa['telephones'];};},Realtime['prototype']['initTrunks']=function(){const _0xc3e83d=this;return function(_0x173d6f){const _0x5bf255=a1092_0x5f1d;if(_0x173d6f){freeIsNotKeySip(_0x173d6f,_0xc3e83d[_0x5bf255('0x20')]);for(let _0x12d1e8=0x0,_0xaeccff={};_0x12d1e8<_0x173d6f[_0x5bf255('0x39')];_0x12d1e8+=0x1){_0xaeccff=_0x173d6f[_0x12d1e8],_[_0x5bf255('0x2d')](_0xc3e83d['trunks'][util[_0x5bf255('0x29')]('SIP/%s',_0xaeccff['name'])])?_0xc3e83d[_0x5bf255('0x20')][util[_0x5bf255('0x29')](_0x5bf255('0x7'),_0xaeccff['name'])]=new Trunk(_0xaeccff):_0xc3e83d[_0x5bf255('0x14')](_0xc3e83d[_0x5bf255('0x20')][util['format'](_0x5bf255('0x7'),_0xaeccff[_0x5bf255('0x10')])],_0xaeccff);}}return _0xc3e83d[_0x5bf255('0x20')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x4d')]=function(){const _0x79c050=this;return function(_0x141645){const _0x38f047=a1092_0x5f1d;if(_0x141645){freeIsNotKey(_0x141645,_0x79c050[_0x38f047('0x38')],_0x38f047('0x10'));for(let _0x252e5d=0x0,_0x537b5d={};_0x252e5d<_0x141645[_0x38f047('0x39')];_0x252e5d+=0x1){_0x537b5d=_0x141645[_0x252e5d],_['isUndefined'](_0x79c050[_0x38f047('0x38')][_0x537b5d[_0x38f047('0x10')]])?_0x79c050[_0x38f047('0x38')][_0x537b5d[_0x38f047('0x10')]]=new VoiceQueue(_0x537b5d):_0x79c050[_0x38f047('0x14')](_0x79c050[_0x38f047('0x38')][_0x537b5d['name']],_0x537b5d);}}return _0x79c050[_0x38f047('0x38')];};},Realtime['prototype'][_0x2e61c0('0x35')]=function(){const _0x272b4c=this;return function(_0x551d07){const _0x2e571f=a1092_0x5f1d;if(_0x551d07){freeIsNotKey(_0x551d07,_0x272b4c[_0x2e571f('0x4e')],'id');for(let _0x22abbc=0x0,_0x51b829={};_0x22abbc<_0x551d07[_0x2e571f('0x39')];_0x22abbc+=0x1){_0x51b829=_0x551d07[_0x22abbc],_[_0x2e571f('0x2d')](_0x272b4c[_0x2e571f('0x4e')][_0x51b829['id']])?_0x272b4c[_0x2e571f('0x4e')][_0x51b829['id']]=new Trigger(_0x51b829):_0x272b4c[_0x2e571f('0x14')](_0x272b4c['triggers'][_0x51b829['id']],_0x51b829);}}return _0x272b4c['triggers'];};},Realtime['prototype'][_0x2e61c0('0x4')]=function(){const _0x20a9d4=this;return function(_0x26d350){const _0x377d2a=a1092_0x5f1d;if(_0x26d350){freeIsNotKey(_0x26d350,_0x20a9d4[_0x377d2a('0x58')],'id');for(let _0x16b919=0x0,_0x5ece3a={};_0x16b919<_0x26d350['length'];_0x16b919+=0x1){_0x5ece3a=_0x26d350[_0x16b919],_[_0x377d2a('0x2d')](_0x20a9d4['templates'][_0x5ece3a['id']])?_0x20a9d4[_0x377d2a('0x58')][_0x5ece3a['id']]=new Template(_0x5ece3a):_0x20a9d4['mergeFromDatabase'](_0x20a9d4[_0x377d2a('0x58')][_0x5ece3a['id']],_0x5ece3a);}}return _0x20a9d4[_0x377d2a('0x58')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x1')]=function(){const _0x46b3fd=this;return function(_0x592219){const _0x1f7c51=a1092_0x5f1d;if(_0x592219){freeIsNotKey(_0x592219,_0x46b3fd[_0x1f7c51('0x15')],'id');for(let _0x36c40a=0x0,_0x1d4488={};_0x36c40a<_0x592219[_0x1f7c51('0x39')];_0x36c40a+=0x1){_0x1d4488=_0x592219[_0x36c40a],_['isUndefined'](_0x46b3fd[_0x1f7c51('0x15')][_0x1d4488['id']])?_0x46b3fd[_0x1f7c51('0x15')][_0x1d4488['id']]=new ZendeskAccount(_0x1d4488):_0x46b3fd['mergeFromDatabase'](_0x46b3fd['zendeskAccounts'][_0x1d4488['id']],_0x1d4488);}}return _0x46b3fd[_0x1f7c51('0x15')];};},Realtime[_0x2e61c0('0x40')]['initSalesforceAccounts']=function(){const _0x5d8855=this;return function(_0x7553f5){const _0xfbb004=a1092_0x5f1d;if(_0x7553f5){freeIsNotKey(_0x7553f5,_0x5d8855[_0xfbb004('0x43')],'id');for(let _0x5c10ef=0x0,_0x527836={};_0x5c10ef<_0x7553f5['length'];_0x5c10ef+=0x1){_0x527836=_0x7553f5[_0x5c10ef],_[_0xfbb004('0x2d')](_0x5d8855[_0xfbb004('0x43')][_0x527836['id']])?_0x5d8855[_0xfbb004('0x43')][_0x527836['id']]=new SalesforceAccount(_0x527836):_0x5d8855['mergeFromDatabase'](_0x5d8855[_0xfbb004('0x43')][_0x527836['id']],_0x527836);}}return _0x5d8855[_0xfbb004('0x43')];};},Realtime[_0x2e61c0('0x40')]['initFreshdeskAccounts']=function(){const _0x30f3c1=this;return function(_0x25d1b4){const _0x4511b2=a1092_0x5f1d;if(_0x25d1b4){freeIsNotKey(_0x25d1b4,_0x30f3c1[_0x4511b2('0x3e')],'id');for(let _0x1f7715=0x0,_0x3aade7={};_0x1f7715<_0x25d1b4['length'];_0x1f7715+=0x1){_0x3aade7=_0x25d1b4[_0x1f7715],_[_0x4511b2('0x2d')](_0x30f3c1['freshdeskAccounts'][_0x3aade7['id']])?_0x30f3c1[_0x4511b2('0x3e')][_0x3aade7['id']]=new FreshdeskAccount(_0x3aade7):_0x30f3c1['mergeFromDatabase'](_0x30f3c1[_0x4511b2('0x3e')][_0x3aade7['id']],_0x3aade7);}}return _0x30f3c1['freshdeskAccounts'];};},Realtime['prototype']['initZohoAccounts']=function(){const _0x39564f=this;return function(_0x9ce97c){const _0x27498f=a1092_0x5f1d;if(_0x9ce97c){freeIsNotKey(_0x9ce97c,_0x39564f[_0x27498f('0x26')],'id');for(let _0xe4fe57=0x0,_0x1244de={};_0xe4fe57<_0x9ce97c['length'];_0xe4fe57+=0x1){_0x1244de=_0x9ce97c[_0xe4fe57],_['isUndefined'](_0x39564f[_0x27498f('0x26')][_0x1244de['id']])?_0x39564f[_0x27498f('0x26')][_0x1244de['id']]=new ZohoAccount(_0x1244de):_0x39564f[_0x27498f('0x14')](_0x39564f['zohoAccounts'][_0x1244de['id']],_0x1244de);}}return _0x39564f['zohoAccounts'];};},Realtime['prototype'][_0x2e61c0('0xd')]=function(){const _0x29b927=this;return function(_0x4ac7ce){const _0x1e8340=a1092_0x5f1d;if(_0x4ac7ce){freeIsNotKey(_0x4ac7ce,_0x29b927[_0x1e8340('0x42')],'id');for(let _0x45d4ef=0x0,_0x38d202={};_0x45d4ef<_0x4ac7ce['length'];_0x45d4ef+=0x1){_0x38d202=_0x4ac7ce[_0x45d4ef],_[_0x1e8340('0x2d')](_0x29b927[_0x1e8340('0x42')][_0x38d202['id']])?_0x29b927[_0x1e8340('0x42')][_0x38d202['id']]=new DeskAccount(_0x38d202):_0x29b927[_0x1e8340('0x14')](_0x29b927[_0x1e8340('0x42')][_0x38d202['id']],_0x38d202);}}return _0x29b927['deskAccounts'];};},Realtime['prototype']['initSugarcrmAccounts']=function(){const _0x4f7b63=this;return function(_0x8ba5fc){const _0x2c2082=a1092_0x5f1d;if(_0x8ba5fc){freeIsNotKey(_0x8ba5fc,_0x4f7b63[_0x2c2082('0x41')],'id');for(let _0x22025b=0x0,_0x402b83={};_0x22025b<_0x8ba5fc[_0x2c2082('0x39')];_0x22025b+=0x1){_0x402b83=_0x8ba5fc[_0x22025b],_[_0x2c2082('0x2d')](_0x4f7b63[_0x2c2082('0x41')][_0x402b83['id']])?_0x4f7b63[_0x2c2082('0x41')][_0x402b83['id']]=new SugarcrmAccount(_0x402b83):_0x4f7b63[_0x2c2082('0x14')](_0x4f7b63[_0x2c2082('0x41')][_0x402b83['id']],_0x402b83);}}return _0x4f7b63[_0x2c2082('0x41')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x3')]=function(){const _0x5dd710=this;return function(_0x27326a){const _0xdcf6ea=a1092_0x5f1d;if(_0x27326a){freeIsNotKey(_0x27326a,_0x5dd710[_0xdcf6ea('0x32')],'id');for(let _0x355bc9=0x0,_0x496de7={};_0x355bc9<_0x27326a[_0xdcf6ea('0x39')];_0x355bc9+=0x1){_0x496de7=_0x27326a[_0x355bc9],_[_0xdcf6ea('0x2d')](_0x5dd710['vtigerAccounts'][_0x496de7['id']])?_0x5dd710['vtigerAccounts'][_0x496de7['id']]=new VtigerAccount(_0x496de7):_0x5dd710[_0xdcf6ea('0x14')](_0x5dd710[_0xdcf6ea('0x32')][_0x496de7['id']],_0x496de7);}}return _0x5dd710[_0xdcf6ea('0x32')];};},Realtime['prototype'][_0x2e61c0('0x53')]=function(){const _0x4c974b=this;return function(_0x2c70bf){const _0x1103e7=a1092_0x5f1d;if(_0x2c70bf){freeIsNotKey(_0x2c70bf,_0x4c974b[_0x1103e7('0xa')],'id');for(let _0x592078=0x0,_0x321fc2={};_0x592078<_0x2c70bf[_0x1103e7('0x39')];_0x592078+=0x1){_0x321fc2=_0x2c70bf[_0x592078],_[_0x1103e7('0x2d')](_0x4c974b[_0x1103e7('0xa')][_0x321fc2['id']])?_0x4c974b[_0x1103e7('0xa')][_0x321fc2['id']]=new ServicenowAccount(_0x321fc2):_0x4c974b[_0x1103e7('0x14')](_0x4c974b[_0x1103e7('0xa')][_0x321fc2['id']],_0x321fc2);}}return _0x4c974b['servicenowAccounts'];};},Realtime['prototype']['initDynamics365Accounts']=function(){const _0x4e9128=this;return function(_0x136ab9){const _0x343aaa=a1092_0x5f1d;if(_0x136ab9){freeIsNotKey(_0x136ab9,_0x4e9128[_0x343aaa('0x4f')],'id');for(let _0x4fef87=0x0,_0x33dff2={};_0x4fef87<_0x136ab9[_0x343aaa('0x39')];_0x4fef87+=0x1){_0x33dff2=_0x136ab9[_0x4fef87],_[_0x343aaa('0x2d')](_0x4e9128[_0x343aaa('0x4f')][_0x33dff2['id']])?_0x4e9128['dynamics365Accounts'][_0x33dff2['id']]=new Dynamics365Account(_0x33dff2):_0x4e9128[_0x343aaa('0x14')](_0x4e9128['dynamics365Accounts'][_0x33dff2['id']],_0x33dff2);}}return _0x4e9128[_0x343aaa('0x4f')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x4c')]=function(){const _0x41cf7b=this;return function(_0x5aa4ec){const _0x574f89=a1092_0x5f1d;if(_0x5aa4ec){freeIsNotKey(_0x5aa4ec,_0x41cf7b[_0x574f89('0x46')],'id');for(let _0x4e09bc=0x0,_0x545815={};_0x4e09bc<_0x5aa4ec[_0x574f89('0x39')];_0x4e09bc+=0x1){_0x545815=_0x5aa4ec[_0x4e09bc],_[_0x574f89('0x2d')](_0x41cf7b['freshsalesAccounts'][_0x545815['id']])?_0x41cf7b[_0x574f89('0x46')][_0x545815['id']]=new FreshsalesAccount(_0x545815):_0x41cf7b[_0x574f89('0x14')](_0x41cf7b[_0x574f89('0x46')][_0x545815['id']],_0x545815);}}return _0x41cf7b[_0x574f89('0x46')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x5b')]=function(){const _0x35d3da=this;return function(_0x184ae0){const _0x2f6239=a1092_0x5f1d;for(let _0x361a8b=0x0;_0x361a8b<_0x184ae0[_0x2f6239('0x39')];_0x361a8b+=0x1){_['merge'](_0x35d3da['voiceQueues'][_0x184ae0[_0x361a8b][_0x2f6239('0x10')]],_0x184ae0[_0x361a8b]);}return _0x35d3da[_0x2f6239('0x38')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x0')]=function(){const _0x226ce8=this;return function(_0x265d42){const _0x1c8058=a1092_0x5f1d;clearVoiceQueues(_0x226ce8['voiceQueues']);if(_0x265d42){_0x265d42=_[_0x1c8058('0x5c')](_0x265d42,_0x1c8058('0x2c'));for(const _0x39f7bd in _0x265d42){if(typeof _0x265d42[_0x39f7bd]!=='undefined')for(let _0x2e5521=0x0;_0x2e5521<_0x265d42[_0x39f7bd][_0x1c8058('0x39')];_0x2e5521+=0x1){const _0x526675=_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x51')];_0x226ce8['voiceQueues'][_0x526675]&&(_0x265d42[_0x39f7bd][_0x2e5521]['queuecallerexit']&&(_0x226ce8[_0x1c8058('0x38')][_0x526675]['unmanaged']+=0x1),_0x265d42[_0x39f7bd][_0x2e5521]['queuecallerabandon']&&(_0x226ce8[_0x1c8058('0x38')][_0x526675]['abandoned']+=0x1),_0x226ce8['voiceQueues'][_0x526675][_0x1c8058('0x57')]+=moment(_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x1f')])[_0x1c8058('0x30')](moment(_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x4b')]),_0x1c8058('0x17'))||0x0,_0x2e5521===_0x265d42[_0x39f7bd][_0x1c8058('0x39')]-0x1?(_0x226ce8[_0x1c8058('0x38')][_0x526675]['sumDuration']+=moment(_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x3b')]||_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x59')]||_0x265d42[_0x39f7bd][_0x2e5521]['queuecallerexitAt'])[_0x1c8058('0x30')](moment(_0x265d42[_0x39f7bd][_0x2e5521]['queuecallerjoinAt']),_0x1c8058('0x17'))||0x0,_0x226ce8[_0x1c8058('0x38')][_0x526675]['total']+=0x1,_0x265d42[_0x39f7bd][_0x2e5521]['queuecallercomplete']&&(_0x226ce8[_0x1c8058('0x38')][_0x526675][_0x1c8058('0x8')]+=0x1,_0x226ce8[_0x1c8058('0x38')][_0x526675][_0x1c8058('0x55')]+=moment(_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x3b')])[_0x1c8058('0x30')](moment(_0x265d42[_0x39f7bd][_0x2e5521][_0x1c8058('0x1f')]),_0x1c8058('0x17'))||0x0)):_0x226ce8[_0x1c8058('0x38')][_0x526675][_0x1c8058('0x36')]+=_0x226ce8[_0x1c8058('0x38')][_0x526675][_0x1c8058('0x57')]||0x0);}}}return _0x226ce8[_0x1c8058('0x38')];};},Realtime['prototype'][_0x2e61c0('0x1a')]=function(){const _0x58ee0b=this;return function(_0x11e059){const _0x19bbf6=a1092_0x5f1d;clearVoiceCallReports(_0x58ee0b[_0x19bbf6('0x9')]);if(_0x11e059)for(let _0x283521=0x0;_0x283521<_0x11e059[_0x19bbf6('0x39')];_0x283521+=0x1){_0x58ee0b[_0x19bbf6('0x9')][_0x19bbf6('0x24')]+=0x1,_0x58ee0b[_0x19bbf6('0x9')][_0x19bbf6('0x36')]+=_0x11e059[_0x283521][_0x19bbf6('0x1c')],_0x11e059[_0x283521]['disposition']===_0x19bbf6('0xc')&&(_0x58ee0b[_0x19bbf6('0x9')][_0x19bbf6('0x8')]+=0x1,_0x58ee0b[_0x19bbf6('0x9')][_0x19bbf6('0x57')]+=_0x11e059[_0x283521][_0x19bbf6('0x1c')]-_0x11e059[_0x283521]['billableseconds']||0x0,_0x58ee0b[_0x19bbf6('0x9')][_0x19bbf6('0x55')]+=_0x11e059[_0x283521][_0x19bbf6('0x22')]);}return _0x58ee0b[_0x19bbf6('0x9')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x47')]=function(){const _0x5425da=this;return function(_0x394be3){const _0x3176b7=a1092_0x5f1d;if(_0x394be3){freeIsNotKey(_0x394be3,_0x5425da[_0x3176b7('0x11')],_0x3176b7('0x10'));for(let _0x85e908=0x0,_0x162aa1={};_0x85e908<_0x394be3['length'];_0x85e908+=0x1){_0x162aa1=_0x394be3[_0x85e908],_[_0x3176b7('0x2d')](_0x5425da[_0x3176b7('0x11')][_0x162aa1[_0x3176b7('0x10')]])?_0x5425da[_0x3176b7('0x11')][_0x162aa1['name']]=new Campaign(_0x162aa1):(_0x5425da['mergeFromDatabase'](_0x5425da[_0x3176b7('0x11')][_0x162aa1[_0x3176b7('0x10')]],_0x162aa1),_0x5425da[_0x3176b7('0x11')][_0x162aa1[_0x3176b7('0x10')]][_0x3176b7('0x2a')]=_0x162aa1[_0x3176b7('0x25')]?_0x162aa1['SquareProject'][_0x3176b7('0x10')]:undefined);}}return _0x5425da[_0x3176b7('0x11')];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x16')]=function(){const _0x542989=this;return function(_0x5a2465){const _0x26be44=a1092_0x5f1d;if(_0x5a2465){freeIsNotKey(_0x5a2465,_0x542989['voiceExtensions'],'id');for(let _0x4fdcfe=0x0,_0x2e0796={};_0x4fdcfe<_0x5a2465[_0x26be44('0x39')];_0x4fdcfe+=0x1){_0x2e0796=_0x5a2465[_0x4fdcfe],_[_0x26be44('0x2d')](_0x542989[_0x26be44('0x19')][_0x2e0796['id']])?_0x542989[_0x26be44('0x19')][_0x2e0796['id']]=new VoiceExtension(_0x2e0796):_0x542989[_0x26be44('0x14')](_0x542989[_0x26be44('0x19')][_0x2e0796['id']],_0x2e0796);}}return _0x542989['voiceExtensions'];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x50')]=function(){const _0x2ed598=this;return function(_0x2dba38){const _0xddba36=a1092_0x5f1d;clearCampaigns(_0x2ed598[_0xddba36('0x11')]);for(let _0x44363e=0x0;_0x44363e<_0x2dba38[_0xddba36('0x39')];_0x44363e+=0x1){_[_0xddba36('0x31')](_0x2ed598[_0xddba36('0x11')][_0x2dba38[_0x44363e]['name']],_0x2dba38[_0x44363e]);}return _0x2ed598['campaigns'];};},Realtime[_0x2e61c0('0x40')][_0x2e61c0('0x23')]=function(){const _0x3d2976=this;return function(_0x2a5823){const _0x224ab9=a1092_0x5f1d;if(_0x2a5823){freeIsNotKey(_0x2a5823,_0x3d2976['faxAccounts'],'id');for(let _0x484848=0x0,_0x48c39b={};_0x484848<_0x2a5823[_0x224ab9('0x39')];_0x484848+=0x1){_0x48c39b=_0x2a5823[_0x484848],_[_0x224ab9('0x2d')](_0x3d2976[_0x224ab9('0x18')][_0x48c39b['id']])?_0x3d2976[_0x224ab9('0x18')][_0x48c39b['id']]=new FaxAccount(_0x48c39b):_0x3d2976[_0x224ab9('0x14')](_0x3d2976[_0x224ab9('0x18')][_0x48c39b['id']],_0x48c39b);}}return _0x3d2976[_0x224ab9('0x18')];};},module[_0x2e61c0('0x3a')]=Realtime;
\ No newline at end of file
+const a1092_0x5705=['queuecallercompleteAt','interface','outboundRejectCallsDay','voiceQueues','outboundDropCallsDayTimeout','isNil','servicenowAccounts','sumBillable','queuecallerexit','../model/telephone','timers','queuecallerabandonAt','moment','../model/freshsalesAccount','templates','undefined','initDynamics365Accounts','initServicenowAccounts','initZendeskAccounts','queuecallercomplete','isUndefined','isEmpty','name','initTriggers','seconds','vtigerAccounts','outboundReCallsDay','outboundCongestionCallsDay','prototype','deskAccounts','initDeskAccounts','initTemplates','initZohoAccounts','faxAccounts','triggers','unmanaged','telephones','../model/salesforceAccount','freshsalesAccounts','outboundUnknownCallsDay','sumHoldTime','exports','agents','SIP/%s','mapKeys','sugarcrmAccounts','../model/trunk','campaigns','outboundBusyCallsDay','salesforceAccounts','outboundBlacklistCallsDay','queuecallerabandon','initCampaigns','../model/sugarcrmAccount','mergeFromDatabase','initVtigerAccounts','length','uniqueid','../model/freshdeskAccount','outboundChannels','initVoiceCallReports','../model/faxAccount','queueChannels','dynamics365Accounts','../model/deskAccount','trunks','../model/voiceExtension','format','outboundDropCallsDayCallersExit','zendeskAccounts','queuecallerleaveAt','merge','billableseconds','../model/trigger','../model/servicenowAccount','answered','voiceExtensions','dialQueueProject','../model/voiceQueue','initSalesforceAccounts','../model/campaign','../model/dynamics365Account','outboundAnswerAgiCallsDay','queuecallerjoinAt','total','initSugarcrmAccounts','initFreshdeskAccounts','initTelephones','../model/zohoAccount','zohoAccounts','util','diff','outboundOriginateFailureCallsDay','ivrAnswerCallsDay','initVoiceQueues','channels','initVoiceQueueHopperHistory','sumDuration','outbound','freshdeskAccounts'];(function(_0x26b315,_0x570520){const _0x3d6aa0=function(_0x18d0e5){while(--_0x18d0e5){_0x26b315['push'](_0x26b315['shift']());}};_0x3d6aa0(++_0x570520);}(a1092_0x5705,0x1dc));const a1092_0x3d6a=function(_0x26b315,_0x570520){_0x26b315=_0x26b315-0x0;let _0x3d6aa0=a1092_0x5705[_0x26b315];return _0x3d6aa0;};const _0xc498d=a1092_0x3d6a;'use strict';const util=require(_0xc498d('0xe')),_=require('lodash'),moment=require(_0xc498d('0x24')),Agent=require('../model/agent'),Telephone=require(_0xc498d('0x21')),Trunk=require(_0xc498d('0x46')),VoiceQueue=require(_0xc498d('0x2')),Trigger=require(_0xc498d('0x61')),Template=require('../model/template'),Campaign=require(_0xc498d('0x4')),VoiceExtension=require(_0xc498d('0x5a')),ZendeskAccount=require('../model/zendeskAccount'),SalesforceAccount=require(_0xc498d('0x3d')),FreshdeskAccount=require(_0xc498d('0x52')),SugarcrmAccount=require(_0xc498d('0x4d')),ZohoAccount=require(_0xc498d('0xc')),DeskAccount=require(_0xc498d('0x58')),VtigerAccount=require('../model/vtigerAccount'),ServicenowAccount=require(_0xc498d('0x62')),Dynamics365Account=require(_0xc498d('0x5')),FreshsalesAccount=require(_0xc498d('0x25')),FaxAccount=require(_0xc498d('0x55')),Realtime=function(){const _0xacc11b=_0xc498d;this[_0xacc11b('0x42')]={},this[_0xacc11b('0x3c')]={},this['trunks']={},this[_0xacc11b('0x1b')]={},this[_0xacc11b('0x3a')]={},this[_0xacc11b('0x47')]={},this[_0xacc11b('0x26')]={},this[_0xacc11b('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0},this[_0xacc11b('0x0')]={},this[_0xacc11b('0x13')]={},this[_0xacc11b('0x56')]={},this[_0xacc11b('0x53')]={},this[_0xacc11b('0x22')]={},this[_0xacc11b('0x5d')]={},this[_0xacc11b('0x49')]={},this['sugarcrmAccounts']={},this[_0xacc11b('0x17')]={},this[_0xacc11b('0xd')]={},this[_0xacc11b('0x35')]={},this[_0xacc11b('0x31')]={},this[_0xacc11b('0x1e')]={},this['dynamics365Accounts']={},this[_0xacc11b('0x3e')]={},this[_0xacc11b('0x39')]={};};function freeIsNotKey(_0x18d0e5,_0x4703db,_0x12989e){const _0x32b186=_0xc498d,_0x420976=_[_0x32b186('0x44')](_0x18d0e5,function(_0x5a4c55){return _0x5a4c55[_0x12989e];});for(const _0x415b46 in _0x4703db){typeof _0x4703db[_0x415b46]!=='undefined'&&(!_0x420976[_0x415b46]&&delete _0x4703db[_0x415b46]);}}function freeIsNotKeySip(_0x5480d0,_0x3162e0){const _0x5a4261=_0xc498d,_0x2cf759=_[_0x5a4261('0x44')](_0x5480d0,function(_0x44310f){const _0x3d0601=_0x5a4261;return util[_0x3d0601('0x5b')](_0x3d0601('0x43'),_0x44310f[_0x3d0601('0x2e')]);});for(const _0xa4139b in _0x3162e0){typeof _0x3162e0[_0xa4139b]!==_0x5a4261('0x27')&&(!_0x2cf759[_0xa4139b]&&delete _0x3162e0[_0xa4139b]);}}function freeIsNotKeyAgent(_0x52d71f,_0x1d645a){const _0x492b16=_0xc498d,_0xb98e44=_[_0x492b16('0x44')](_0x52d71f,function(_0x6cc96e){const _0x52c189=_0x492b16,_0xc77d4c=_[_0x52c189('0x1d')](_0x6cc96e[_0x52c189('0x19')])?util[_0x52c189('0x5b')](_0x52c189('0x43'),_0x6cc96e['name']):_0x6cc96e[_0x52c189('0x19')];return _0xc77d4c;});for(const _0x539eef in _0x1d645a){typeof _0x1d645a[_0x539eef]!==_0x492b16('0x27')&&(!_0xb98e44[_0x539eef]&&delete _0x1d645a[_0x539eef]);}}function clearVoiceCallReports(_0x1bab5b){const _0x4c8b2d=_0xc498d;_0x1bab5b[_0x4c8b2d('0x8')]=0x0,_0x1bab5b[_0x4c8b2d('0x63')]=0x0,_0x1bab5b['sumHoldTime']=0x0,_0x1bab5b[_0x4c8b2d('0x15')]=0x0,_0x1bab5b[_0x4c8b2d('0x1f')]=0x0;}function clearCampaigns(_0x7f73c5){const _0x5e0291=_0xc498d;if(!_[_0x5e0291('0x2d')](_0x7f73c5))for(const _0x238bb5 in _0x7f73c5){typeof _0x7f73c5[_0x238bb5]!==_0x5e0291('0x27')&&(_0x7f73c5[_0x238bb5]['ivrTotalCallsDays']=0x0,_0x7f73c5[_0x238bb5][_0x5e0291('0x11')]=0x0);}}function clearVoiceQueues(_0x185838){const _0x132507=_0xc498d;if(!_[_0x132507('0x2d')](_0x185838))for(const _0x11f8fa in _0x185838){typeof _0x185838[_0x11f8fa]!==_0x132507('0x27')&&(_0x185838[_0x11f8fa]['total']=0x0,_0x185838[_0x11f8fa]['answered']=0x0,_0x185838[_0x11f8fa][_0x132507('0x3b')]=0x0,_0x185838[_0x11f8fa]['abandoned']=0x0,_0x185838[_0x11f8fa][_0x132507('0x40')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x15')]=0x0,_0x185838[_0x11f8fa]['sumBillable']=0x0,_0x185838[_0x11f8fa][_0x132507('0x6')]=0x0,_0x185838[_0x11f8fa]['outboundNoAnswerCallsDay']=0x0,_0x185838[_0x11f8fa][_0x132507('0x48')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x33')]=0x0,_0x185838[_0x11f8fa]['outboundNoSuchCallsDay']=0x0,_0x185838[_0x11f8fa][_0x132507('0x3f')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x1c')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x5c')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x4a')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x10')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x1a')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x32')]=0x0,_0x185838[_0x11f8fa][_0x132507('0x6')]=0x0,_0x185838[_0x11f8fa]['outboundAnswerCallsDay']=0x0,_0x185838[_0x11f8fa]['queueStatusComplete']=!![]);}}Realtime[_0xc498d('0x34')][_0xc498d('0x4e')]=function(_0x47a139,_0xbfa0f8){const _0x150049=_0xc498d;for(const _0x3a1be7 in _0xbfa0f8){typeof _0x47a139[_0x3a1be7]!==_0x150049('0x27')&&(_0x47a139[_0x3a1be7]=_0xbfa0f8[_0x3a1be7]);}},Realtime[_0xc498d('0x34')]['initAgents']=function(){const _0x15d766=this;return function(_0x2513b9){const _0xe2986=a1092_0x3d6a;if(_0x2513b9){freeIsNotKeyAgent(_0x2513b9,_0x15d766['agents']);for(let _0x1d5e37=0x0,_0x26564c={};_0x1d5e37<_0x2513b9['length'];_0x1d5e37+=0x1){_0x26564c=_0x2513b9[_0x1d5e37];const _0x2183e0=_[_0xe2986('0x1d')](_0x26564c['interface'])?util[_0xe2986('0x5b')](_0xe2986('0x43'),_0x26564c[_0xe2986('0x2e')]):_0x26564c[_0xe2986('0x19')];_[_0xe2986('0x2c')](_0x15d766['agents'][_0x2183e0])?_0x15d766[_0xe2986('0x42')][_0x2183e0]=new Agent(_0x26564c):_0x15d766[_0xe2986('0x4e')](_0x15d766[_0xe2986('0x42')][_0x2183e0],_0x26564c);}}return _0x15d766[_0xe2986('0x42')];};},Realtime[_0xc498d('0x34')][_0xc498d('0xb')]=function(){const _0xa97928=this;return function(_0x552024){const _0x41f9bf=a1092_0x3d6a;if(_0x552024){freeIsNotKeySip(_0x552024,_0xa97928[_0x41f9bf('0x3c')]);for(let _0x435706=0x0,_0x3df1f7={};_0x435706<_0x552024['length'];_0x435706+=0x1){_0x3df1f7=_0x552024[_0x435706],_['isUndefined'](_0xa97928['telephones'][util[_0x41f9bf('0x5b')]('SIP/%s',_0x3df1f7[_0x41f9bf('0x2e')])])?_0xa97928[_0x41f9bf('0x3c')][util['format']('SIP/%s',_0x3df1f7[_0x41f9bf('0x2e')])]=new Telephone(_0x3df1f7):_0xa97928[_0x41f9bf('0x4e')](_0xa97928[_0x41f9bf('0x3c')][util[_0x41f9bf('0x5b')](_0x41f9bf('0x43'),_0x3df1f7[_0x41f9bf('0x2e')])],_0x3df1f7);}}return _0xa97928[_0x41f9bf('0x3c')];};},Realtime[_0xc498d('0x34')]['initTrunks']=function(){const _0x105c80=this;return function(_0xf17f34){const _0x110dfa=a1092_0x3d6a;if(_0xf17f34){freeIsNotKeySip(_0xf17f34,_0x105c80['trunks']);for(let _0x279cd5=0x0,_0x27cc93={};_0x279cd5<_0xf17f34['length'];_0x279cd5+=0x1){_0x27cc93=_0xf17f34[_0x279cd5],_['isUndefined'](_0x105c80[_0x110dfa('0x59')][util[_0x110dfa('0x5b')](_0x110dfa('0x43'),_0x27cc93[_0x110dfa('0x2e')])])?_0x105c80[_0x110dfa('0x59')][util['format'](_0x110dfa('0x43'),_0x27cc93[_0x110dfa('0x2e')])]=new Trunk(_0x27cc93):_0x105c80['mergeFromDatabase'](_0x105c80[_0x110dfa('0x59')][util['format'](_0x110dfa('0x43'),_0x27cc93[_0x110dfa('0x2e')])],_0x27cc93);}}return _0x105c80['trunks'];};},Realtime[_0xc498d('0x34')][_0xc498d('0x12')]=function(){const _0x1c6fb4=this;return function(_0x1e8fbb){const _0x18c396=a1092_0x3d6a;if(_0x1e8fbb){freeIsNotKey(_0x1e8fbb,_0x1c6fb4[_0x18c396('0x1b')],_0x18c396('0x2e'));for(let _0x4adbe9=0x0,_0x4bf685={};_0x4adbe9<_0x1e8fbb[_0x18c396('0x50')];_0x4adbe9+=0x1){_0x4bf685=_0x1e8fbb[_0x4adbe9],_[_0x18c396('0x2c')](_0x1c6fb4['voiceQueues'][_0x4bf685[_0x18c396('0x2e')]])?_0x1c6fb4[_0x18c396('0x1b')][_0x4bf685[_0x18c396('0x2e')]]=new VoiceQueue(_0x4bf685):_0x1c6fb4[_0x18c396('0x4e')](_0x1c6fb4['voiceQueues'][_0x4bf685['name']],_0x4bf685);}}return _0x1c6fb4[_0x18c396('0x1b')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x2f')]=function(){const _0x5ed8c8=this;return function(_0x3e52c3){const _0x486972=a1092_0x3d6a;if(_0x3e52c3){freeIsNotKey(_0x3e52c3,_0x5ed8c8[_0x486972('0x3a')],'id');for(let _0x52d72b=0x0,_0x1c4ad6={};_0x52d72b<_0x3e52c3['length'];_0x52d72b+=0x1){_0x1c4ad6=_0x3e52c3[_0x52d72b],_[_0x486972('0x2c')](_0x5ed8c8['triggers'][_0x1c4ad6['id']])?_0x5ed8c8[_0x486972('0x3a')][_0x1c4ad6['id']]=new Trigger(_0x1c4ad6):_0x5ed8c8[_0x486972('0x4e')](_0x5ed8c8['triggers'][_0x1c4ad6['id']],_0x1c4ad6);}}return _0x5ed8c8[_0x486972('0x3a')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x37')]=function(){const _0x2863b6=this;return function(_0x478104){const _0x148bc8=a1092_0x3d6a;if(_0x478104){freeIsNotKey(_0x478104,_0x2863b6[_0x148bc8('0x26')],'id');for(let _0x25d29d=0x0,_0x5c8bea={};_0x25d29d<_0x478104[_0x148bc8('0x50')];_0x25d29d+=0x1){_0x5c8bea=_0x478104[_0x25d29d],_[_0x148bc8('0x2c')](_0x2863b6[_0x148bc8('0x26')][_0x5c8bea['id']])?_0x2863b6[_0x148bc8('0x26')][_0x5c8bea['id']]=new Template(_0x5c8bea):_0x2863b6['mergeFromDatabase'](_0x2863b6[_0x148bc8('0x26')][_0x5c8bea['id']],_0x5c8bea);}}return _0x2863b6[_0x148bc8('0x26')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x2a')]=function(){const _0x1d41b8=this;return function(_0x3965c9){const _0x203f16=a1092_0x3d6a;if(_0x3965c9){freeIsNotKey(_0x3965c9,_0x1d41b8['zendeskAccounts'],'id');for(let _0x371a3d=0x0,_0x5331cc={};_0x371a3d<_0x3965c9['length'];_0x371a3d+=0x1){_0x5331cc=_0x3965c9[_0x371a3d],_[_0x203f16('0x2c')](_0x1d41b8[_0x203f16('0x5d')][_0x5331cc['id']])?_0x1d41b8[_0x203f16('0x5d')][_0x5331cc['id']]=new ZendeskAccount(_0x5331cc):_0x1d41b8[_0x203f16('0x4e')](_0x1d41b8[_0x203f16('0x5d')][_0x5331cc['id']],_0x5331cc);}}return _0x1d41b8[_0x203f16('0x5d')];};},Realtime['prototype'][_0xc498d('0x3')]=function(){const _0x22e6fc=this;return function(_0xc6c9a4){const _0x2d8a66=a1092_0x3d6a;if(_0xc6c9a4){freeIsNotKey(_0xc6c9a4,_0x22e6fc['salesforceAccounts'],'id');for(let _0x23bc1c=0x0,_0x3dedba={};_0x23bc1c<_0xc6c9a4[_0x2d8a66('0x50')];_0x23bc1c+=0x1){_0x3dedba=_0xc6c9a4[_0x23bc1c],_[_0x2d8a66('0x2c')](_0x22e6fc[_0x2d8a66('0x49')][_0x3dedba['id']])?_0x22e6fc[_0x2d8a66('0x49')][_0x3dedba['id']]=new SalesforceAccount(_0x3dedba):_0x22e6fc['mergeFromDatabase'](_0x22e6fc[_0x2d8a66('0x49')][_0x3dedba['id']],_0x3dedba);}}return _0x22e6fc[_0x2d8a66('0x49')];};},Realtime[_0xc498d('0x34')][_0xc498d('0xa')]=function(){const _0x336842=this;return function(_0xe28b1d){const _0x752b11=a1092_0x3d6a;if(_0xe28b1d){freeIsNotKey(_0xe28b1d,_0x336842[_0x752b11('0x17')],'id');for(let _0x5c9548=0x0,_0x4af6bb={};_0x5c9548<_0xe28b1d[_0x752b11('0x50')];_0x5c9548+=0x1){_0x4af6bb=_0xe28b1d[_0x5c9548],_[_0x752b11('0x2c')](_0x336842[_0x752b11('0x17')][_0x4af6bb['id']])?_0x336842[_0x752b11('0x17')][_0x4af6bb['id']]=new FreshdeskAccount(_0x4af6bb):_0x336842[_0x752b11('0x4e')](_0x336842[_0x752b11('0x17')][_0x4af6bb['id']],_0x4af6bb);}}return _0x336842['freshdeskAccounts'];};},Realtime[_0xc498d('0x34')][_0xc498d('0x38')]=function(){const _0x1bfc07=this;return function(_0x42f59e){const _0x613742=a1092_0x3d6a;if(_0x42f59e){freeIsNotKey(_0x42f59e,_0x1bfc07[_0x613742('0xd')],'id');for(let _0x384ff0=0x0,_0x321bf8={};_0x384ff0<_0x42f59e[_0x613742('0x50')];_0x384ff0+=0x1){_0x321bf8=_0x42f59e[_0x384ff0],_[_0x613742('0x2c')](_0x1bfc07['zohoAccounts'][_0x321bf8['id']])?_0x1bfc07[_0x613742('0xd')][_0x321bf8['id']]=new ZohoAccount(_0x321bf8):_0x1bfc07[_0x613742('0x4e')](_0x1bfc07[_0x613742('0xd')][_0x321bf8['id']],_0x321bf8);}}return _0x1bfc07[_0x613742('0xd')];};},Realtime['prototype'][_0xc498d('0x36')]=function(){const _0x2249b0=this;return function(_0x4872a6){const _0xe26a04=a1092_0x3d6a;if(_0x4872a6){freeIsNotKey(_0x4872a6,_0x2249b0[_0xe26a04('0x35')],'id');for(let _0xfd14b2=0x0,_0x5ee79d={};_0xfd14b2<_0x4872a6[_0xe26a04('0x50')];_0xfd14b2+=0x1){_0x5ee79d=_0x4872a6[_0xfd14b2],_[_0xe26a04('0x2c')](_0x2249b0[_0xe26a04('0x35')][_0x5ee79d['id']])?_0x2249b0[_0xe26a04('0x35')][_0x5ee79d['id']]=new DeskAccount(_0x5ee79d):_0x2249b0[_0xe26a04('0x4e')](_0x2249b0['deskAccounts'][_0x5ee79d['id']],_0x5ee79d);}}return _0x2249b0[_0xe26a04('0x35')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x9')]=function(){const _0x2879ee=this;return function(_0x4992b5){const _0x5c01db=a1092_0x3d6a;if(_0x4992b5){freeIsNotKey(_0x4992b5,_0x2879ee[_0x5c01db('0x45')],'id');for(let _0x443189=0x0,_0x1a777d={};_0x443189<_0x4992b5['length'];_0x443189+=0x1){_0x1a777d=_0x4992b5[_0x443189],_[_0x5c01db('0x2c')](_0x2879ee[_0x5c01db('0x45')][_0x1a777d['id']])?_0x2879ee[_0x5c01db('0x45')][_0x1a777d['id']]=new SugarcrmAccount(_0x1a777d):_0x2879ee[_0x5c01db('0x4e')](_0x2879ee[_0x5c01db('0x45')][_0x1a777d['id']],_0x1a777d);}}return _0x2879ee[_0x5c01db('0x45')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x4f')]=function(){const _0x12c15f=this;return function(_0x5198c6){const _0x22fe43=a1092_0x3d6a;if(_0x5198c6){freeIsNotKey(_0x5198c6,_0x12c15f[_0x22fe43('0x31')],'id');for(let _0x2901dc=0x0,_0x5eddc5={};_0x2901dc<_0x5198c6[_0x22fe43('0x50')];_0x2901dc+=0x1){_0x5eddc5=_0x5198c6[_0x2901dc],_['isUndefined'](_0x12c15f[_0x22fe43('0x31')][_0x5eddc5['id']])?_0x12c15f[_0x22fe43('0x31')][_0x5eddc5['id']]=new VtigerAccount(_0x5eddc5):_0x12c15f['mergeFromDatabase'](_0x12c15f[_0x22fe43('0x31')][_0x5eddc5['id']],_0x5eddc5);}}return _0x12c15f['vtigerAccounts'];};},Realtime[_0xc498d('0x34')][_0xc498d('0x29')]=function(){const _0x3f7783=this;return function(_0x1a0cad){const _0x1635f6=a1092_0x3d6a;if(_0x1a0cad){freeIsNotKey(_0x1a0cad,_0x3f7783['servicenowAccounts'],'id');for(let _0x5720e0=0x0,_0xe3a71={};_0x5720e0<_0x1a0cad[_0x1635f6('0x50')];_0x5720e0+=0x1){_0xe3a71=_0x1a0cad[_0x5720e0],_['isUndefined'](_0x3f7783[_0x1635f6('0x1e')][_0xe3a71['id']])?_0x3f7783[_0x1635f6('0x1e')][_0xe3a71['id']]=new ServicenowAccount(_0xe3a71):_0x3f7783[_0x1635f6('0x4e')](_0x3f7783[_0x1635f6('0x1e')][_0xe3a71['id']],_0xe3a71);}}return _0x3f7783[_0x1635f6('0x1e')];};},Realtime['prototype'][_0xc498d('0x28')]=function(){const _0x213bae=this;return function(_0x53370a){const _0x56bcd5=a1092_0x3d6a;if(_0x53370a){freeIsNotKey(_0x53370a,_0x213bae[_0x56bcd5('0x57')],'id');for(let _0x428fed=0x0,_0x4d20a4={};_0x428fed<_0x53370a[_0x56bcd5('0x50')];_0x428fed+=0x1){_0x4d20a4=_0x53370a[_0x428fed],_[_0x56bcd5('0x2c')](_0x213bae[_0x56bcd5('0x57')][_0x4d20a4['id']])?_0x213bae[_0x56bcd5('0x57')][_0x4d20a4['id']]=new Dynamics365Account(_0x4d20a4):_0x213bae[_0x56bcd5('0x4e')](_0x213bae[_0x56bcd5('0x57')][_0x4d20a4['id']],_0x4d20a4);}}return _0x213bae[_0x56bcd5('0x57')];};},Realtime[_0xc498d('0x34')]['initFreshsalesAccounts']=function(){const _0x1e6a22=this;return function(_0x5f00e1){const _0x579042=a1092_0x3d6a;if(_0x5f00e1){freeIsNotKey(_0x5f00e1,_0x1e6a22[_0x579042('0x3e')],'id');for(let _0x53a2d6=0x0,_0x152808={};_0x53a2d6<_0x5f00e1['length'];_0x53a2d6+=0x1){_0x152808=_0x5f00e1[_0x53a2d6],_[_0x579042('0x2c')](_0x1e6a22[_0x579042('0x3e')][_0x152808['id']])?_0x1e6a22[_0x579042('0x3e')][_0x152808['id']]=new FreshsalesAccount(_0x152808):_0x1e6a22[_0x579042('0x4e')](_0x1e6a22[_0x579042('0x3e')][_0x152808['id']],_0x152808);}}return _0x1e6a22[_0x579042('0x3e')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x14')]=function(){const _0x2f4efb=this;return function(_0xecdf4b){const _0x43ca58=a1092_0x3d6a;for(let _0x522c6b=0x0;_0x522c6b<_0xecdf4b['length'];_0x522c6b+=0x1){_[_0x43ca58('0x5f')](_0x2f4efb['voiceQueues'][_0xecdf4b[_0x522c6b][_0x43ca58('0x2e')]],_0xecdf4b[_0x522c6b]);}return _0x2f4efb[_0x43ca58('0x1b')];};},Realtime['prototype']['initVoiceQueueReports']=function(){const _0x3ce29b=this;return function(_0x4c7391){const _0x135aca=a1092_0x3d6a;clearVoiceQueues(_0x3ce29b[_0x135aca('0x1b')]);if(_0x4c7391){_0x4c7391=_['groupBy'](_0x4c7391,_0x135aca('0x51'));for(const _0x29a2e2 in _0x4c7391){if(typeof _0x4c7391[_0x29a2e2]!==_0x135aca('0x27'))for(let _0x209ba8=0x0;_0x209ba8<_0x4c7391[_0x29a2e2]['length'];_0x209ba8+=0x1){const _0x190e74=_0x4c7391[_0x29a2e2][_0x209ba8]['queue'];_0x3ce29b[_0x135aca('0x1b')][_0x190e74]&&(_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x20')]&&(_0x3ce29b[_0x135aca('0x1b')][_0x190e74][_0x135aca('0x3b')]+=0x1),_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x4b')]&&(_0x3ce29b['voiceQueues'][_0x190e74]['abandoned']+=0x1),_0x3ce29b['voiceQueues'][_0x190e74][_0x135aca('0x40')]+=moment(_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x5e')])[_0x135aca('0xf')](moment(_0x4c7391[_0x29a2e2][_0x209ba8]['queuecallerjoinAt']),_0x135aca('0x30'))||0x0,_0x209ba8===_0x4c7391[_0x29a2e2][_0x135aca('0x50')]-0x1?(_0x3ce29b[_0x135aca('0x1b')][_0x190e74][_0x135aca('0x15')]+=moment(_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x18')]||_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x23')]||_0x4c7391[_0x29a2e2][_0x209ba8]['queuecallerexitAt'])[_0x135aca('0xf')](moment(_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x7')]),'seconds')||0x0,_0x3ce29b[_0x135aca('0x1b')][_0x190e74][_0x135aca('0x8')]+=0x1,_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x2b')]&&(_0x3ce29b[_0x135aca('0x1b')][_0x190e74]['answered']+=0x1,_0x3ce29b[_0x135aca('0x1b')][_0x190e74][_0x135aca('0x1f')]+=moment(_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x18')])[_0x135aca('0xf')](moment(_0x4c7391[_0x29a2e2][_0x209ba8][_0x135aca('0x5e')]),'seconds')||0x0)):_0x3ce29b[_0x135aca('0x1b')][_0x190e74][_0x135aca('0x15')]+=_0x3ce29b[_0x135aca('0x1b')][_0x190e74][_0x135aca('0x40')]||0x0);}}}return _0x3ce29b[_0x135aca('0x1b')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x54')]=function(){const _0x4dd177=this;return function(_0x22934b){const _0x58e85c=a1092_0x3d6a;clearVoiceCallReports(_0x4dd177[_0x58e85c('0x16')]);if(_0x22934b)for(let _0x59c176=0x0;_0x59c176<_0x22934b[_0x58e85c('0x50')];_0x59c176+=0x1){_0x4dd177[_0x58e85c('0x16')][_0x58e85c('0x8')]+=0x1,_0x4dd177[_0x58e85c('0x16')][_0x58e85c('0x15')]+=_0x22934b[_0x59c176]['duration'],_0x22934b[_0x59c176]['disposition']==='ANSWERED'&&(_0x4dd177[_0x58e85c('0x16')]['answered']+=0x1,_0x4dd177[_0x58e85c('0x16')][_0x58e85c('0x40')]+=_0x22934b[_0x59c176]['duration']-_0x22934b[_0x59c176][_0x58e85c('0x60')]||0x0,_0x4dd177['outbound']['sumBillable']+=_0x22934b[_0x59c176][_0x58e85c('0x60')]);}return _0x4dd177[_0x58e85c('0x16')];};},Realtime[_0xc498d('0x34')][_0xc498d('0x4c')]=function(){const _0x2127f1=this;return function(_0x48f697){const _0x568392=a1092_0x3d6a;if(_0x48f697){freeIsNotKey(_0x48f697,_0x2127f1['campaigns'],_0x568392('0x2e'));for(let _0x519077=0x0,_0x111039={};_0x519077<_0x48f697[_0x568392('0x50')];_0x519077+=0x1){_0x111039=_0x48f697[_0x519077],_[_0x568392('0x2c')](_0x2127f1[_0x568392('0x47')][_0x111039[_0x568392('0x2e')]])?_0x2127f1[_0x568392('0x47')][_0x111039[_0x568392('0x2e')]]=new Campaign(_0x111039):(_0x2127f1['mergeFromDatabase'](_0x2127f1[_0x568392('0x47')][_0x111039['name']],_0x111039),_0x2127f1[_0x568392('0x47')][_0x111039[_0x568392('0x2e')]][_0x568392('0x1')]=_0x111039['SquareProject']?_0x111039['SquareProject'][_0x568392('0x2e')]:undefined);}}return _0x2127f1[_0x568392('0x47')];};},Realtime[_0xc498d('0x34')]['initVoiceExtensions']=function(){const _0x243e9d=this;return function(_0x142061){const _0x570a0e=a1092_0x3d6a;if(_0x142061){freeIsNotKey(_0x142061,_0x243e9d[_0x570a0e('0x0')],'id');for(let _0x41b45c=0x0,_0x3e7e63={};_0x41b45c<_0x142061[_0x570a0e('0x50')];_0x41b45c+=0x1){_0x3e7e63=_0x142061[_0x41b45c],_[_0x570a0e('0x2c')](_0x243e9d[_0x570a0e('0x0')][_0x3e7e63['id']])?_0x243e9d[_0x570a0e('0x0')][_0x3e7e63['id']]=new VoiceExtension(_0x3e7e63):_0x243e9d[_0x570a0e('0x4e')](_0x243e9d[_0x570a0e('0x0')][_0x3e7e63['id']],_0x3e7e63);}}return _0x243e9d['voiceExtensions'];};},Realtime[_0xc498d('0x34')]['initCampaignHopperHistory']=function(){const _0x4db257=this;return function(_0x22acb1){const _0x59151c=a1092_0x3d6a;clearCampaigns(_0x4db257['campaigns']);for(let _0x579141=0x0;_0x579141<_0x22acb1[_0x59151c('0x50')];_0x579141+=0x1){_[_0x59151c('0x5f')](_0x4db257[_0x59151c('0x47')][_0x22acb1[_0x579141][_0x59151c('0x2e')]],_0x22acb1[_0x579141]);}return _0x4db257[_0x59151c('0x47')];};},Realtime[_0xc498d('0x34')]['initFaxAccounts']=function(){const _0x54d8c1=this;return function(_0x44f673){const _0xe86680=a1092_0x3d6a;if(_0x44f673){freeIsNotKey(_0x44f673,_0x54d8c1[_0xe86680('0x39')],'id');for(let _0xdba8ab=0x0,_0x5630d5={};_0xdba8ab<_0x44f673[_0xe86680('0x50')];_0xdba8ab+=0x1){_0x5630d5=_0x44f673[_0xdba8ab],_[_0xe86680('0x2c')](_0x54d8c1[_0xe86680('0x39')][_0x5630d5['id']])?_0x54d8c1['faxAccounts'][_0x5630d5['id']]=new FaxAccount(_0x5630d5):_0x54d8c1[_0xe86680('0x4e')](_0x54d8c1[_0xe86680('0x39')][_0x5630d5['id']],_0x5630d5);}}return _0x54d8c1[_0xe86680('0x39')];};},module[_0xc498d('0x41')]=Realtime;
\ No newline at end of file