Built motion from commit 6a92c2cd.|2.6.29
[motion2.git] / server / services / ami / trigger / index.js
index 88acd7f..fa594bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33b9=['Actions','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','uri','buildUri','isNil','data3','data4','location','windowWidth','data5','800','data6','600','winapp','winApplication','format','user:%s','name','trigger:%s:%s','merge','jscripty','trigger:%s','exec','integration','queue','urlforward','script','search','replace','AllConditions','channel','AnyConditions','some','checkTrigger:\x20trigger','field','account','chat','ChatWebsiteId','operator','value','upperFirst','event','agent','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','exports','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','redis','localhost','popup','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','freshdeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentcongestion','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','stringify','emit','clone','motionChannel','undefined','voice','debug','inspect','checkTriggers','checkTrigger','variables','length'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x33b9,0x138));var _0x933b=function(_0xad0505,_0x208f4f){_0xad0505=_0xad0505-0x0;var _0x4b4338=_0x33b9[_0xad0505];return _0x4b4338;};'use strict';var util=require('util');var _=require(_0x933b('0x0'));var url=require(_0x933b('0x1'));var Mustache=require(_0x933b('0x2'));var Redis=require(_0x933b('0x3'));var urlforward=require(_0x933b('0x4'));var integration=require(_0x933b('0x5'));var cmContact=require(_0x933b('0x6'));var script=require(_0x933b('0x7'));var config=require(_0x933b('0x8'));var logger=require('../../../config/logger')(_0x933b('0x9'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x933b('0xa')],{'host':_0x933b('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x933b('0xa')]));var operators={'equals':function(_0x4e7ea8,_0x187b40){return _0x4e7ea8==_0x187b40;},'not_equals':function(_0x1d0824,_0x52a81d){return _0x1d0824!=_0x52a81d;}};var barAndWebActions=[_0x933b('0xc'),_0x933b('0x1'),'winapp'];function Trigger(_0x3571dc){this[_0x933b('0xd')]=_0x3571dc[_0x933b('0xd')];this[_0x933b('0xe')]=_0x3571dc[_0x933b('0xe')];this[_0x933b('0xf')]=_0x3571dc['voiceQueues'];this[_0x933b('0x10')]=_0x3571dc[_0x933b('0x10')];this[_0x933b('0x11')]=_0x3571dc[_0x933b('0x11')];this[_0x933b('0x12')]=_0x3571dc[_0x933b('0x12')];this['freshdeskAccounts']=_0x3571dc['freshdeskAccounts'];this[_0x933b('0x13')]=_0x3571dc[_0x933b('0x13')];this[_0x933b('0x14')]=_0x3571dc[_0x933b('0x14')];this[_0x933b('0x15')]=_0x3571dc[_0x933b('0x15')];this[_0x933b('0x16')]=_0x3571dc[_0x933b('0x16')];this[_0x933b('0x17')]=_0x3571dc[_0x933b('0x17')];this[_0x933b('0x18')]=_0x3571dc[_0x933b('0x18')];this[_0x933b('0x19')]=_0x3571dc[_0x933b('0x19')];this['freshsalesAccounts']=_0x3571dc[_0x933b('0x1a')];this[_0x933b('0x1b')]={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x933b('0x1c')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x933b('0x15')],'desk':this[_0x933b('0x16')],'vtiger':this[_0x933b('0x17')],'dynamics365':this[_0x933b('0x19')],'freshsales':this[_0x933b('0x1a')],'servicenow':this[_0x933b('0x18')]};ami['on'](_0x933b('0x1d'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x20'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x21'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x22'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x23'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on']('custom:agentbusy',this['syncCustomEvent'][_0x933b('0x1f')](this));ami['on'](_0x933b('0x24'),this['syncCustomEvent'][_0x933b('0x1f')](this));ami['on']('custom:agentreject',this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x25'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x26'),this[_0x933b('0x1e')]['bind'](this));ami['on'](_0x933b('0x27'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x28'),this[_0x933b('0x29')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2a'),this['syncAgentDial'][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2b'),this[_0x933b('0x29')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2c'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2d'),this['syncCustomEvent']['bind'](this));ami['on'](_0x933b('0x2e'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x2f'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x30'),this[_0x933b('0x1e')]['bind'](this));ami['on'](_0x933b('0x31'),this['syncCustomEvent']['bind'](this));ami['on'](_0x933b('0x32'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));ami['on'](_0x933b('0x33'),this[_0x933b('0x1e')][_0x933b('0x1f')](this));}Trigger[_0x933b('0x34')]['emit']=function(_0x2c75c3,_0x562092,_0x210e0c){logger[_0x933b('0x35')](_0x2c75c3,_0x562092,JSON[_0x933b('0x36')](_0x210e0c));io['to'](_0x2c75c3)[_0x933b('0x37')](_0x562092,_0x210e0c);};Trigger[_0x933b('0x34')][_0x933b('0x1e')]=function(_0x1b968d){var _0x160682=_[_0x933b('0x38')](_0x1b968d);if(typeof _0x160682[_0x933b('0x39')]===_0x933b('0x3a')){_0x160682[_0x933b('0x39')]=_0x933b('0x3b');}logger[_0x933b('0x3c')]('syncCustomEvent',util[_0x933b('0x3d')](_0x160682,{'showHidden':!![],'depth':null}));this['checkTriggers'](_0x160682);};Trigger[_0x933b('0x34')]['syncAgentDial']=function(_0x1cc6ce){if(this[_0x933b('0xe')][_0x1cc6ce['interface']]){this[_0x933b('0x1e')](_0x1cc6ce);}};Trigger[_0x933b('0x34')][_0x933b('0x3e')]=function(_0x2d0a28){var _0x25e235;for(var _0x14fc07 in this[_0x933b('0xd')]){if(this[_0x933b('0xd')]['hasOwnProperty'](_0x14fc07)){if(this[_0x933b('0xd')][_0x14fc07]['status']){_0x25e235=this[_0x933b('0x3f')](this[_0x933b('0xd')][_0x14fc07],_0x2d0a28);if(_0x25e235){_['merge'](_0x2d0a28,_0x2d0a28[_0x933b('0x40')]);for(var _0xcc9e74=0x0,_0x33256a,_0x5393aa,_0xe0b074;_0xcc9e74<this['triggers'][_0x14fc07]['Actions'][_0x933b('0x41')];_0xcc9e74+=0x1){_0x33256a=this[_0x933b('0xd')][_0x14fc07][_0x933b('0x42')][_0xcc9e74];if(this[_0x933b('0xe')][_0x2d0a28[_0x933b('0x43')]]){switch(_0x33256a[_0x933b('0x44')][_0x933b('0x45')]()){case _0x933b('0x46'):break;case _0x933b('0x47'):case _0x933b('0x48'):var _0x1e35f9={};switch(barAndWebActions[_0x33256a[_0x933b('0x49')]]){case _0x933b('0xc'):_0x1e35f9[_0x933b('0x4a')]=_0x33256a['data2'];_0x1e35f9['html']=this[_0x933b('0x10')][_0x33256a[_0x933b('0x4b')]]?Mustache[_0x933b('0x4c')](this[_0x933b('0x10')][_0x33256a['data2']][_0x933b('0x4d')],_0x2d0a28):'template\x20not\x20found';break;case'url':_0x1e35f9[_0x933b('0x4e')]=this[_0x933b('0x4f')](_0x33256a['data2'],_0x2d0a28,_[_0x933b('0x50')](_0x33256a['data3'])?!![]:parseInt(_0x33256a[_0x933b('0x51')],0xa));if(_['isNil'](_0x33256a[_0x933b('0x52')])){_0x1e35f9[_0x933b('0x53')]='0';}else{_0x1e35f9['uriLocation']=_0x33256a[_0x933b('0x52')];_0x1e35f9[_0x933b('0x54')]=_[_0x933b('0x50')](_0x33256a[_0x933b('0x55')])?_0x933b('0x56'):_0x33256a[_0x933b('0x55')];_0x1e35f9['windowHeight']=_[_0x933b('0x50')](_0x33256a[_0x933b('0x57')])?_0x933b('0x58'):_0x33256a[_0x933b('0x57')];}break;case _0x933b('0x59'):_0x1e35f9[_0x933b('0x5a')]=_0x33256a[_0x933b('0x4b')]?Mustache[_0x933b('0x4c')](_0x33256a['data2'],_0x2d0a28):'';_0x1e35f9['winArguments']=_0x33256a['data3']?Mustache['render'](_0x33256a[_0x933b('0x51')],_0x2d0a28):'';break;}this['emit'](util[_0x933b('0x5b')](_0x933b('0x5c'),this[_0x933b('0xe')][_0x2d0a28[_0x933b('0x43')]][_0x933b('0x5d')]),util[_0x933b('0x5b')](_0x933b('0x5e'),_0x33256a[_0x933b('0x44')][_0x933b('0x45')](),barAndWebActions[_0x33256a[_0x933b('0x49')]]),_[_0x933b('0x5f')](_0x1e35f9,_0x2d0a28));break;case _0x933b('0x60'):this[_0x933b('0x37')](util['format']('user:%s',this[_0x933b('0xe')][_0x2d0a28['interface']][_0x933b('0x5d')]),util['format'](_0x933b('0x61'),_0x33256a[_0x933b('0x44')]['toLowerCase']()),_[_0x933b('0x5f')]({'ProjectId':parseInt(_0x33256a[_0x933b('0x49')],0xa)},_0x2d0a28));break;default:this[_0x933b('0x37')](util[_0x933b('0x5b')](_0x933b('0x5c'),this[_0x933b('0xe')][_0x2d0a28['interface']]['name']),util[_0x933b('0x5b')]('trigger:%s',_0x33256a[_0x933b('0x44')]['toLowerCase']()),_[_0x933b('0x5f')]({},_0x33256a,_0x2d0a28));}}switch(_0x33256a[_0x933b('0x44')][_0x933b('0x45')]()){case _0x933b('0x46'):cmContact[_0x933b('0x62')](this[_0x933b('0xe')][_0x2d0a28[_0x933b('0x43')]],this[_0x933b('0xd')][_0x14fc07],_0x33256a,_0x2d0a28);break;case _0x933b('0x63'):integration[_0x933b('0x62')](_0x33256a,_0x2d0a28,this[_0x933b('0x1b')],this[_0x933b('0xe')][_0x2d0a28[_0x933b('0x43')]],this[_0x933b('0xf')][_0x2d0a28[_0x933b('0x64')]],this['voiceExtensions'][_0x2d0a28['routeId']]);break;case _0x933b('0x65'):urlforward['exec'](_0x33256a,_0x2d0a28);break;case _0x933b('0x66'):script[_0x933b('0x62')](_0x33256a,_0x2d0a28);break;}}}}}}};Trigger['prototype'][_0x933b('0x4f')]=function(_0x5152e8,_0x772a45,_0x680873){var _0x1c492f=url['parse'](Mustache[_0x933b('0x4c')](_0x5152e8,_0x772a45),!![]);if(_0x680873){_['merge'](_0x1c492f['query'],_0x772a45);}delete _0x1c492f[_0x933b('0x67')];var _0x494795=url[_0x933b('0x5b')](_0x1c492f);_0x494795=_0x494795[_0x933b('0x68')](/\/\?/g,'?');return _0x494795;};Trigger[_0x933b('0x34')][_0x933b('0x3f')]=function(_0x3fadbe,_0x1e85ce){var _0x517fb7=!![];var _0x4fad0c=!![];var _0x5016f1=![];if(_0x3fadbe['channel']===_0x1e85ce[_0x933b('0x39')]){_0x5016f1=!![];}if(_0x3fadbe[_0x933b('0x69')][_0x933b('0x41')]){_0x517fb7=_['every'](_0x3fadbe[_0x933b('0x69')],this['checkConditions'](_0x1e85ce,_0x3fadbe[_0x933b('0x6a')]));}if(_0x3fadbe[_0x933b('0x6b')][_0x933b('0x41')]){_0x4fad0c=_[_0x933b('0x6c')](_0x3fadbe[_0x933b('0x6b')],this['checkConditions'](_0x1e85ce,_0x3fadbe[_0x933b('0x6a')]));}var _0x1ca5fc=_0x5016f1&&_0x517fb7&&_0x4fad0c;logger['debug'](_0x933b('0x6d'),util['inspect'](_0x3fadbe,{'showHidden':!![],'depth':null}),'evt',util[_0x933b('0x3d')](_0x1e85ce,{'showHidden':!![],'depth':null}),_0x5016f1,_0x517fb7,_0x4fad0c);return _0x1ca5fc;};Trigger['prototype']['checkConditions']=function(_0x451aed,_0x41d2db){return function(_0x34119b){switch(_0x34119b[_0x933b('0x6e')]){case _0x933b('0x6f'):if(_0x451aed[_0x933b('0x6a')]===_0x41d2db){if(_0x41d2db===_0x933b('0x70')){return _0x451aed[_0x933b('0x71')]?operators[_0x34119b[_0x933b('0x72')]](Number(_0x34119b[_0x933b('0x73')]),_0x451aed['ChatWebsiteId']):![];}else{return _0x451aed[_[_0x933b('0x74')](_0x41d2db)+'AccountId']?operators[_0x34119b[_0x933b('0x72')]](Number(_0x34119b[_0x933b('0x73')]),_0x451aed[_[_0x933b('0x74')](_0x41d2db)+'AccountId']):![];}}break;case'interaction':case'message':if(_0x451aed[_0x933b('0x6a')]===_0x41d2db){return _0x451aed['event']?operators[_0x34119b[_0x933b('0x72')]](_0x34119b[_0x933b('0x73')],_0x451aed[_0x933b('0x75')]):![];}break;case'queue':return _0x451aed['queue']?operators[_0x34119b[_0x933b('0x72')]](_0x34119b[_0x933b('0x73')],_0x451aed[_0x933b('0x64')]):![];case _0x933b('0x76'):return _0x451aed['membername']?operators[_0x34119b[_0x933b('0x72')]](_0x34119b['value'],_0x451aed['membername']):![];case _0x933b('0x77'):return _0x451aed[_0x933b('0x77')]?operators[_0x34119b['operator']](_0x34119b[_0x933b('0x73')],_0x451aed[_0x933b('0x77')]):![];case'routeId':return _0x451aed[_0x933b('0x78')]?operators[_0x34119b[_0x933b('0x72')]](_0x34119b['value'],_0x451aed[_0x933b('0x78')]):![];case _0x933b('0x79'):if(_0x34119b['value']===_0x933b('0x7a'))_0x34119b[_0x933b('0x73')]=null;return typeof _0x451aed[_0x933b('0x7b')]!==_0x933b('0x3a')?operators[_0x34119b['operator']](_0x34119b[_0x933b('0x73')],_0x451aed['substatus']):![];case _0x933b('0x7c'):if(_0x451aed[_0x933b('0x6a')]===_0x41d2db){return _0x34119b[_0x933b('0x73')]==='created'&&_0x34119b['operator']==='equals'?!![]:![];}break;}return![];};};module[_0x933b('0x7d')]=Trigger;
\ No newline at end of file
+var _0xdaff=['custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','prototype','clone','motionChannel','undefined','voice','debug','checkTriggers','interface','hasOwnProperty','checkTrigger','variables','Actions','length','agents','action','toLowerCase','motionbar','browser','data1','popup','TemplateId','data2','html','render','uri','buildUri','isNil','data3','data4','uriLocation','windowWidth','data5','windowHeight','600','data6','winapp','winArguments','name','trigger:%s:%s','merge','jscripty','format','user:%s','trigger:%s','contactmanager','exec','integration','queue','urlforward','script','parse','search','replace','channel','AllConditions','every','AnyConditions','some','checkConditions','checkTrigger:\x20trigger','inspect','evt','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','message','event','agent','lastevent','routeId','mailSubstatus','null','substatus','created','exports','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','triggers','voiceQueues','templates','voiceExtensions','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','freshdeskAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdaff,0xdb));var _0xfdaf=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdaff[_0x2641f9];return _0x585741;};'use strict';var util=require('util');var _=require(_0xfdaf('0x0'));var url=require(_0xfdaf('0x1'));var Mustache=require(_0xfdaf('0x2'));var Redis=require(_0xfdaf('0x3'));var urlforward=require('./urlforward');var integration=require(_0xfdaf('0x4'));var cmContact=require(_0xfdaf('0x5'));var script=require(_0xfdaf('0x6'));var config=require(_0xfdaf('0x7'));var logger=require('../../../config/logger')(_0xfdaf('0x8'));var ami=require(_0xfdaf('0x9'));config[_0xfdaf('0xa')]=_[_0xfdaf('0xb')](config[_0xfdaf('0xa')],{'host':_0xfdaf('0xc'),'port':0x18eb});var io=require(_0xfdaf('0xd'))(new Redis(config[_0xfdaf('0xa')]));var operators={'equals':function(_0x44c854,_0x33aa3f){return _0x44c854==_0x33aa3f;},'not_equals':function(_0x3363cb,_0x2ef641){return _0x3363cb!=_0x2ef641;}};var barAndWebActions=['popup',_0xfdaf('0x1'),'winapp'];function Trigger(_0x453067){this[_0xfdaf('0xe')]=_0x453067[_0xfdaf('0xe')];this['agents']=_0x453067['agents'];this[_0xfdaf('0xf')]=_0x453067[_0xfdaf('0xf')];this[_0xfdaf('0x10')]=_0x453067[_0xfdaf('0x10')];this[_0xfdaf('0x11')]=_0x453067[_0xfdaf('0x11')];this[_0xfdaf('0x12')]=_0x453067['zendeskAccounts'];this['freshdeskAccounts']=_0x453067['freshdeskAccounts'];this[_0xfdaf('0x13')]=_0x453067[_0xfdaf('0x13')];this[_0xfdaf('0x14')]=_0x453067[_0xfdaf('0x14')];this['zohoAccounts']=_0x453067[_0xfdaf('0x15')];this[_0xfdaf('0x16')]=_0x453067[_0xfdaf('0x16')];this[_0xfdaf('0x17')]=_0x453067[_0xfdaf('0x17')];this[_0xfdaf('0x18')]=_0x453067['servicenowAccounts'];this[_0xfdaf('0x19')]=_0x453067[_0xfdaf('0x19')];this[_0xfdaf('0x1a')]=_0x453067[_0xfdaf('0x1a')];this[_0xfdaf('0x1b')]={'zendesk':this[_0xfdaf('0x12')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0xfdaf('0x1c')],'sugarcrm':this[_0xfdaf('0x14')],'zoho':this[_0xfdaf('0x15')],'desk':this[_0xfdaf('0x16')],'vtiger':this[_0xfdaf('0x17')],'dynamics365':this[_0xfdaf('0x19')],'freshsales':this[_0xfdaf('0x1a')],'servicenow':this[_0xfdaf('0x18')]};ami['on'](_0xfdaf('0x1d'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xfdaf('0x1f')](this));ami['on']('custom:agentringnoanswer',this['syncCustomEvent'][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x20'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x21'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x22'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x23'),this[_0xfdaf('0x1e')]['bind'](this));ami['on'](_0xfdaf('0x24'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x25'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x26'),this[_0xfdaf('0x1e')]['bind'](this));ami['on'](_0xfdaf('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0xfdaf('0x28'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x29'),this[_0xfdaf('0x2a')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x2b'),this['syncAgentDial'][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x2c'),this[_0xfdaf('0x2a')][_0xfdaf('0x1f')](this));ami['on']('custom:newinteraction',this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x2d'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x2e'),this[_0xfdaf('0x1e')]['bind'](this));ami['on'](_0xfdaf('0x2f'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on']('custom:outgoingmessage',this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x30'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on'](_0xfdaf('0x31'),this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));ami['on']('custom:offlineMessage',this[_0xfdaf('0x1e')][_0xfdaf('0x1f')](this));}Trigger['prototype'][_0xfdaf('0x32')]=function(_0x24f413,_0x343161,_0x8e045e){logger[_0xfdaf('0x33')](_0x24f413,_0x343161,JSON[_0xfdaf('0x34')](_0x8e045e));io['to'](_0x24f413)[_0xfdaf('0x32')](_0x343161,_0x8e045e);};Trigger[_0xfdaf('0x35')][_0xfdaf('0x1e')]=function(_0x4ab97c){var _0x5ca127=_[_0xfdaf('0x36')](_0x4ab97c);if(typeof _0x5ca127[_0xfdaf('0x37')]===_0xfdaf('0x38')){_0x5ca127['motionChannel']=_0xfdaf('0x39');}logger[_0xfdaf('0x3a')]('syncCustomEvent',util['inspect'](_0x5ca127,{'showHidden':!![],'depth':null}));this[_0xfdaf('0x3b')](_0x5ca127);};Trigger[_0xfdaf('0x35')][_0xfdaf('0x2a')]=function(_0x255419){if(this['agents'][_0x255419[_0xfdaf('0x3c')]]){this[_0xfdaf('0x1e')](_0x255419);}};Trigger[_0xfdaf('0x35')]['checkTriggers']=function(_0x40ffe4){var _0x1c6626;for(var _0x1226fe in this[_0xfdaf('0xe')]){if(this[_0xfdaf('0xe')][_0xfdaf('0x3d')](_0x1226fe)){if(this[_0xfdaf('0xe')][_0x1226fe]['status']){_0x1c6626=this[_0xfdaf('0x3e')](this[_0xfdaf('0xe')][_0x1226fe],_0x40ffe4);if(_0x1c6626){_['merge'](_0x40ffe4,_0x40ffe4[_0xfdaf('0x3f')]);for(var _0x372def=0x0,_0x417f19,_0x2d4efa,_0x554b65;_0x372def<this[_0xfdaf('0xe')][_0x1226fe][_0xfdaf('0x40')][_0xfdaf('0x41')];_0x372def+=0x1){_0x417f19=this['triggers'][_0x1226fe]['Actions'][_0x372def];if(this[_0xfdaf('0x42')][_0x40ffe4[_0xfdaf('0x3c')]]){switch(_0x417f19[_0xfdaf('0x43')][_0xfdaf('0x44')]()){case'contactmanager':break;case _0xfdaf('0x45'):case _0xfdaf('0x46'):var _0x210ee6={};switch(barAndWebActions[_0x417f19[_0xfdaf('0x47')]]){case _0xfdaf('0x48'):_0x210ee6[_0xfdaf('0x49')]=_0x417f19[_0xfdaf('0x4a')];_0x210ee6[_0xfdaf('0x4b')]=this[_0xfdaf('0x10')][_0x417f19[_0xfdaf('0x4a')]]?Mustache[_0xfdaf('0x4c')](this['templates'][_0x417f19[_0xfdaf('0x4a')]]['html'],_0x40ffe4):'template\x20not\x20found';break;case _0xfdaf('0x1'):_0x210ee6[_0xfdaf('0x4d')]=this[_0xfdaf('0x4e')](_0x417f19[_0xfdaf('0x4a')],_0x40ffe4,_[_0xfdaf('0x4f')](_0x417f19[_0xfdaf('0x50')])?!![]:parseInt(_0x417f19['data3'],0xa));if(_[_0xfdaf('0x4f')](_0x417f19[_0xfdaf('0x51')])){_0x210ee6['location']='0';}else{_0x210ee6[_0xfdaf('0x52')]=_0x417f19['data4'];_0x210ee6[_0xfdaf('0x53')]=_[_0xfdaf('0x4f')](_0x417f19['data5'])?'800':_0x417f19[_0xfdaf('0x54')];_0x210ee6[_0xfdaf('0x55')]=_['isNil'](_0x417f19['data6'])?_0xfdaf('0x56'):_0x417f19[_0xfdaf('0x57')];}break;case _0xfdaf('0x58'):_0x210ee6['winApplication']=_0x417f19['data2']?Mustache[_0xfdaf('0x4c')](_0x417f19[_0xfdaf('0x4a')],_0x40ffe4):'';_0x210ee6[_0xfdaf('0x59')]=_0x417f19[_0xfdaf('0x50')]?Mustache[_0xfdaf('0x4c')](_0x417f19[_0xfdaf('0x50')],_0x40ffe4):'';break;}this[_0xfdaf('0x32')](util['format']('user:%s',this[_0xfdaf('0x42')][_0x40ffe4['interface']][_0xfdaf('0x5a')]),util['format'](_0xfdaf('0x5b'),_0x417f19[_0xfdaf('0x43')][_0xfdaf('0x44')](),barAndWebActions[_0x417f19[_0xfdaf('0x47')]]),_[_0xfdaf('0x5c')](_0x210ee6,_0x40ffe4));break;case _0xfdaf('0x5d'):this[_0xfdaf('0x32')](util[_0xfdaf('0x5e')](_0xfdaf('0x5f'),this[_0xfdaf('0x42')][_0x40ffe4[_0xfdaf('0x3c')]]['name']),util[_0xfdaf('0x5e')](_0xfdaf('0x60'),_0x417f19[_0xfdaf('0x43')][_0xfdaf('0x44')]()),_[_0xfdaf('0x5c')]({'ProjectId':parseInt(_0x417f19[_0xfdaf('0x47')],0xa)},_0x40ffe4));break;default:this['emit'](util[_0xfdaf('0x5e')](_0xfdaf('0x5f'),this[_0xfdaf('0x42')][_0x40ffe4[_0xfdaf('0x3c')]][_0xfdaf('0x5a')]),util[_0xfdaf('0x5e')](_0xfdaf('0x60'),_0x417f19['action']['toLowerCase']()),_[_0xfdaf('0x5c')]({},_0x417f19,_0x40ffe4));}}switch(_0x417f19[_0xfdaf('0x43')][_0xfdaf('0x44')]()){case _0xfdaf('0x61'):cmContact[_0xfdaf('0x62')](this[_0xfdaf('0x42')][_0x40ffe4[_0xfdaf('0x3c')]],this[_0xfdaf('0xe')][_0x1226fe],_0x417f19,_0x40ffe4);break;case _0xfdaf('0x63'):integration[_0xfdaf('0x62')](_0x417f19,_0x40ffe4,this[_0xfdaf('0x1b')],this[_0xfdaf('0x42')][_0x40ffe4[_0xfdaf('0x3c')]],this['voiceQueues'][_0x40ffe4[_0xfdaf('0x64')]],this[_0xfdaf('0x11')][_0x40ffe4['routeId']]);break;case _0xfdaf('0x65'):urlforward[_0xfdaf('0x62')](_0x417f19,_0x40ffe4);break;case _0xfdaf('0x66'):script['exec'](_0x417f19,_0x40ffe4);break;}}}}}}};Trigger['prototype'][_0xfdaf('0x4e')]=function(_0x5661a3,_0x56c2c8,_0x4cc581){var _0x1e2373=url[_0xfdaf('0x67')](Mustache[_0xfdaf('0x4c')](_0x5661a3,_0x56c2c8),!![]);if(_0x4cc581){_[_0xfdaf('0x5c')](_0x1e2373['query'],_0x56c2c8);}delete _0x1e2373[_0xfdaf('0x68')];var _0x4fd219=url[_0xfdaf('0x5e')](_0x1e2373);_0x4fd219=_0x4fd219[_0xfdaf('0x69')](/\/\?/g,'?');return _0x4fd219;};Trigger[_0xfdaf('0x35')][_0xfdaf('0x3e')]=function(_0x1225f9,_0x446416){var _0x361c47=!![];var _0x54bcd1=!![];var _0x2545cb=![];if(_0x1225f9[_0xfdaf('0x6a')]===_0x446416['motionChannel']){_0x2545cb=!![];}if(_0x1225f9[_0xfdaf('0x6b')][_0xfdaf('0x41')]){_0x361c47=_[_0xfdaf('0x6c')](_0x1225f9[_0xfdaf('0x6b')],this['checkConditions'](_0x446416,_0x1225f9['channel']));}if(_0x1225f9[_0xfdaf('0x6d')][_0xfdaf('0x41')]){_0x54bcd1=_[_0xfdaf('0x6e')](_0x1225f9[_0xfdaf('0x6d')],this[_0xfdaf('0x6f')](_0x446416,_0x1225f9[_0xfdaf('0x6a')]));}var _0xb28de2=_0x2545cb&&_0x361c47&&_0x54bcd1;logger['debug'](_0xfdaf('0x70'),util[_0xfdaf('0x71')](_0x1225f9,{'showHidden':!![],'depth':null}),_0xfdaf('0x72'),util[_0xfdaf('0x71')](_0x446416,{'showHidden':!![],'depth':null}),_0x2545cb,_0x361c47,_0x54bcd1);return _0xb28de2;};Trigger[_0xfdaf('0x35')][_0xfdaf('0x6f')]=function(_0x2ba8c5,_0x2017aa){return function(_0x24e30f){switch(_0x24e30f['field']){case _0xfdaf('0x73'):if(_0x2ba8c5[_0xfdaf('0x6a')]===_0x2017aa){if(_0x2017aa===_0xfdaf('0x74')){return _0x2ba8c5[_0xfdaf('0x75')]?operators[_0x24e30f[_0xfdaf('0x76')]](Number(_0x24e30f[_0xfdaf('0x77')]),_0x2ba8c5[_0xfdaf('0x75')]):![];}else{return _0x2ba8c5[_[_0xfdaf('0x78')](_0x2017aa)+_0xfdaf('0x79')]?operators[_0x24e30f['operator']](Number(_0x24e30f['value']),_0x2ba8c5[_['upperFirst'](_0x2017aa)+_0xfdaf('0x79')]):![];}}break;case'interaction':case _0xfdaf('0x7a'):if(_0x2ba8c5[_0xfdaf('0x6a')]===_0x2017aa){return _0x2ba8c5[_0xfdaf('0x7b')]?operators[_0x24e30f[_0xfdaf('0x76')]](_0x24e30f[_0xfdaf('0x77')],_0x2ba8c5[_0xfdaf('0x7b')]):![];}break;case _0xfdaf('0x64'):return _0x2ba8c5[_0xfdaf('0x64')]?operators[_0x24e30f[_0xfdaf('0x76')]](_0x24e30f[_0xfdaf('0x77')],_0x2ba8c5['queue']):![];case _0xfdaf('0x7c'):return _0x2ba8c5['membername']?operators[_0x24e30f['operator']](_0x24e30f[_0xfdaf('0x77')],_0x2ba8c5['membername']):![];case _0xfdaf('0x7d'):return _0x2ba8c5[_0xfdaf('0x7d')]?operators[_0x24e30f[_0xfdaf('0x76')]](_0x24e30f[_0xfdaf('0x77')],_0x2ba8c5[_0xfdaf('0x7d')]):![];case _0xfdaf('0x7e'):return _0x2ba8c5[_0xfdaf('0x7e')]?operators[_0x24e30f[_0xfdaf('0x76')]](_0x24e30f[_0xfdaf('0x77')],_0x2ba8c5['routeId']):![];case _0xfdaf('0x7f'):if(_0x24e30f[_0xfdaf('0x77')]===_0xfdaf('0x80'))_0x24e30f[_0xfdaf('0x77')]=null;return typeof _0x2ba8c5[_0xfdaf('0x81')]!==_0xfdaf('0x38')?operators[_0x24e30f[_0xfdaf('0x76')]](_0x24e30f[_0xfdaf('0x77')],_0x2ba8c5[_0xfdaf('0x81')]):![];case'offlineMessage':if(_0x2ba8c5['channel']===_0x2017aa){return _0x24e30f[_0xfdaf('0x77')]===_0xfdaf('0x82')&&_0x24e30f[_0xfdaf('0x76')]==='equals'?!![]:![];}break;}return![];};};module[_0xfdaf('0x83')]=Trigger;
\ No newline at end of file