Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / services / ami / trigger / index.js
index 8b8b519..155aa1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x309c=['event','queue','membername','lastevent','exports','util','lodash','url','mustache','ioredis','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','redis','defaults','localhost','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','zendeskAccounts','dynamics365Accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','prototype','clone','checkTriggers','interface','hasOwnProperty','checkTrigger','merge','variables','Actions','length','action','contactmanager','motionbar','browser','data1','data2','html','render','uri','isNil','data4','location','uriLocation','windowWidth','data5','800','windowHeight','data6','600','winArguments','data3','format','user:%s','name','trigger:%s:%s','toLowerCase','trigger:%s','integration','exec','routeId','script','buildUri','parse','search','replace','AllConditions','every','checkConditions','AnyConditions','channel','account','chat','value','ChatWebsiteId','upperFirst','AccountId','operator'];(function(_0x11ff55,_0x313baf){var _0x25afdd=function(_0x386058){while(--_0x386058){_0x11ff55['push'](_0x11ff55['shift']());}};_0x25afdd(++_0x313baf);}(_0x309c,0x1d9));var _0xc309=function(_0x4fe802,_0x37754b){_0x4fe802=_0x4fe802-0x0;var _0xe4433c=_0x309c[_0x4fe802];return _0xe4433c;};'use strict';var util=require(_0xc309('0x0'));var _=require(_0xc309('0x1'));var url=require(_0xc309('0x2'));var Mustache=require(_0xc309('0x3'));var Redis=require(_0xc309('0x4'));var urlforward=require(_0xc309('0x5'));var integration=require(_0xc309('0x6'));var cmContact=require(_0xc309('0x7'));var script=require(_0xc309('0x8'));var config=require(_0xc309('0x9'));var logger=require(_0xc309('0xa'))('trigger');var ami=require('../ami');config[_0xc309('0xb')]=_[_0xc309('0xc')](config[_0xc309('0xb')],{'host':_0xc309('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc309('0xb')]));var operators={'equals':function(_0x123f2d,_0xe14372){return _0x123f2d==_0xe14372;},'not_equals':function(_0x140ae7,_0x1e0f3f){return _0x140ae7!=_0x1e0f3f;}};var barAndWebActions=[_0xc309('0xe'),_0xc309('0x2'),_0xc309('0xf')];function Trigger(_0x6c9f37){this['triggers']=_0x6c9f37[_0xc309('0x10')];this[_0xc309('0x11')]=_0x6c9f37[_0xc309('0x11')];this[_0xc309('0x12')]=_0x6c9f37['voiceQueues'];this[_0xc309('0x13')]=_0x6c9f37[_0xc309('0x13')];this[_0xc309('0x14')]=_0x6c9f37[_0xc309('0x14')];this['zendeskAccounts']=_0x6c9f37['zendeskAccounts'];this[_0xc309('0x15')]=_0x6c9f37['freshdeskAccounts'];this[_0xc309('0x16')]=_0x6c9f37[_0xc309('0x16')];this['sugarcrmAccounts']=_0x6c9f37[_0xc309('0x17')];this[_0xc309('0x18')]=_0x6c9f37[_0xc309('0x18')];this['deskAccounts']=_0x6c9f37[_0xc309('0x19')];this[_0xc309('0x1a')]=_0x6c9f37['vtigerAccounts'];this[_0xc309('0x1b')]=_0x6c9f37[_0xc309('0x1b')];this['dynamics365Accounts']=_0x6c9f37['dynamics365Accounts'];this[_0xc309('0x1c')]=_0x6c9f37[_0xc309('0x1c')];this[_0xc309('0x1d')]={'zendesk':this[_0xc309('0x1e')],'salesforce':this[_0xc309('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0xc309('0x17')],'zoho':this[_0xc309('0x18')],'desk':this[_0xc309('0x19')],'vtiger':this[_0xc309('0x1a')],'dynamics365':this[_0xc309('0x1f')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xc309('0x1b')]};ami['on'](_0xc309('0x20'),this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on'](_0xc309('0x23'),this[_0xc309('0x21')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on']('custom:agentcomplete',this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on'](_0xc309('0x24'),this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on'](_0xc309('0x25'),this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on']('custom:agentbusy',this[_0xc309('0x21')]['bind'](this));ami['on'](_0xc309('0x26'),this['syncCustomEvent'][_0xc309('0x22')](this));ami['on'](_0xc309('0x27'),this[_0xc309('0x21')]['bind'](this));ami['on'](_0xc309('0x28'),this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on'](_0xc309('0x29'),this['syncCustomEvent'][_0xc309('0x22')](this));ami['on'](_0xc309('0x2a'),this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on'](_0xc309('0x2b'),this[_0xc309('0x2c')]['bind'](this));ami['on'](_0xc309('0x2d'),this[_0xc309('0x2c')][_0xc309('0x22')](this));ami['on'](_0xc309('0x2e'),this[_0xc309('0x2c')][_0xc309('0x22')](this));ami['on'](_0xc309('0x2f'),this['syncCustomEvent'][_0xc309('0x22')](this));ami['on'](_0xc309('0x30'),this['syncCustomEvent'][_0xc309('0x22')](this));ami['on'](_0xc309('0x31'),this['syncCustomEvent']['bind'](this));ami['on']('custom:outgoingmessage',this[_0xc309('0x21')][_0xc309('0x22')](this));ami['on'](_0xc309('0x32'),this[_0xc309('0x21')]['bind'](this));ami['on'](_0xc309('0x33'),this[_0xc309('0x21')][_0xc309('0x22')](this));}Trigger['prototype'][_0xc309('0x34')]=function(_0x35c4ad,_0x26ad62,_0x4450ef){logger[_0xc309('0x35')](_0x35c4ad,_0x26ad62,JSON[_0xc309('0x36')](_0x4450ef));io['to'](_0x35c4ad)['emit'](_0x26ad62,_0x4450ef);};Trigger[_0xc309('0x37')][_0xc309('0x21')]=function(_0x438892){var _0x5cd664=_[_0xc309('0x38')](_0x438892);this[_0xc309('0x39')](_0x5cd664);};Trigger[_0xc309('0x37')]['syncAgentDial']=function(_0x4980fa){if(this[_0xc309('0x11')][_0x4980fa[_0xc309('0x3a')]]){this[_0xc309('0x21')](_0x4980fa);}};Trigger[_0xc309('0x37')]['checkTriggers']=function(_0x40e47f){var _0x3c38f6;for(var _0x3932d2 in this[_0xc309('0x10')]){if(this['triggers'][_0xc309('0x3b')](_0x3932d2)){if(this[_0xc309('0x10')][_0x3932d2]['status']){_0x3c38f6=this[_0xc309('0x3c')](this[_0xc309('0x10')][_0x3932d2],_0x40e47f);if(_0x3c38f6){_[_0xc309('0x3d')](_0x40e47f,_0x40e47f[_0xc309('0x3e')]);for(var _0x5751f4=0x0,_0x4e51cb,_0x31879b,_0x22f039;_0x5751f4<this[_0xc309('0x10')][_0x3932d2][_0xc309('0x3f')][_0xc309('0x40')];_0x5751f4+=0x1){_0x4e51cb=this[_0xc309('0x10')][_0x3932d2][_0xc309('0x3f')][_0x5751f4];if(this[_0xc309('0x11')][_0x40e47f[_0xc309('0x3a')]]){switch(_0x4e51cb[_0xc309('0x41')]['toLowerCase']()){case _0xc309('0x42'):break;case _0xc309('0x43'):case _0xc309('0x44'):var _0x3a5535={};switch(barAndWebActions[_0x4e51cb[_0xc309('0x45')]]){case'popup':_0x3a5535['TemplateId']=_0x4e51cb[_0xc309('0x46')];_0x3a5535[_0xc309('0x47')]=this['templates'][_0x4e51cb['data2']]?Mustache[_0xc309('0x48')](this[_0xc309('0x13')][_0x4e51cb[_0xc309('0x46')]][_0xc309('0x47')],_0x40e47f):'template\x20not\x20found';break;case'url':_0x3a5535[_0xc309('0x49')]=this['buildUri'](_0x4e51cb[_0xc309('0x46')],_0x40e47f,_[_0xc309('0x4a')](_0x4e51cb['data3'])?!![]:parseInt(_0x4e51cb['data3'],0xa));if(_[_0xc309('0x4a')](_0x4e51cb[_0xc309('0x4b')])){_0x3a5535[_0xc309('0x4c')]='0';}else{_0x3a5535[_0xc309('0x4d')]=_0x4e51cb[_0xc309('0x4b')];_0x3a5535[_0xc309('0x4e')]=_[_0xc309('0x4a')](_0x4e51cb[_0xc309('0x4f')])?_0xc309('0x50'):_0x4e51cb[_0xc309('0x4f')];_0x3a5535[_0xc309('0x51')]=_['isNil'](_0x4e51cb[_0xc309('0x52')])?_0xc309('0x53'):_0x4e51cb[_0xc309('0x52')];}break;case _0xc309('0xf'):_0x3a5535['winApplication']=_0x4e51cb[_0xc309('0x46')]?Mustache[_0xc309('0x48')](_0x4e51cb[_0xc309('0x46')],_0x40e47f):'';_0x3a5535[_0xc309('0x54')]=_0x4e51cb[_0xc309('0x55')]?Mustache[_0xc309('0x48')](_0x4e51cb['data3'],_0x40e47f):'';break;}this[_0xc309('0x34')](util[_0xc309('0x56')](_0xc309('0x57'),this[_0xc309('0x11')][_0x40e47f[_0xc309('0x3a')]][_0xc309('0x58')]),util[_0xc309('0x56')](_0xc309('0x59'),_0x4e51cb[_0xc309('0x41')][_0xc309('0x5a')](),barAndWebActions[_0x4e51cb[_0xc309('0x45')]]),_[_0xc309('0x3d')](_0x3a5535,_0x40e47f));break;case'jscripty':this[_0xc309('0x34')](util[_0xc309('0x56')](_0xc309('0x57'),this[_0xc309('0x11')][_0x40e47f[_0xc309('0x3a')]]['name']),util[_0xc309('0x56')](_0xc309('0x5b'),_0x4e51cb['action'][_0xc309('0x5a')]()),_['merge']({'ProjectId':parseInt(_0x4e51cb[_0xc309('0x45')],0xa)},_0x40e47f));break;default:this[_0xc309('0x34')](util[_0xc309('0x56')](_0xc309('0x57'),this['agents'][_0x40e47f[_0xc309('0x3a')]]['name']),util[_0xc309('0x56')](_0xc309('0x5b'),_0x4e51cb['action']['toLowerCase']()),_[_0xc309('0x3d')]({},_0x4e51cb,_0x40e47f));}}switch(_0x4e51cb[_0xc309('0x41')]['toLowerCase']()){case'contactmanager':cmContact['exec'](this[_0xc309('0x11')][_0x40e47f[_0xc309('0x3a')]],this[_0xc309('0x10')][_0x3932d2],_0x4e51cb,_0x40e47f);break;case _0xc309('0x5c'):integration[_0xc309('0x5d')](_0x4e51cb,_0x40e47f,this[_0xc309('0x1d')],this[_0xc309('0x11')][_0x40e47f['interface']],this[_0xc309('0x12')][_0x40e47f['queue']],this['voiceExtensions'][_0x40e47f[_0xc309('0x5e')]]);break;case'urlforward':urlforward[_0xc309('0x5d')](_0x4e51cb,_0x40e47f);break;case _0xc309('0x5f'):script[_0xc309('0x5d')](_0x4e51cb,_0x40e47f);break;}}}}}}};Trigger[_0xc309('0x37')][_0xc309('0x60')]=function(_0x297a63,_0x1e92c5,_0x31b81d){var _0x261b99=url[_0xc309('0x61')](Mustache['render'](_0x297a63,_0x1e92c5),!![]);if(_0x31b81d){_[_0xc309('0x3d')](_0x261b99['query'],_0x1e92c5);}delete _0x261b99[_0xc309('0x62')];var _0x3f05bf=url[_0xc309('0x56')](_0x261b99);_0x3f05bf=_0x3f05bf[_0xc309('0x63')](/\/\?/g,'?');return _0x3f05bf;};Trigger['prototype'][_0xc309('0x3c')]=function(_0xa5df07,_0x36eb99){var _0xfeb540=!![],_0x533ead=!![];if(_0xa5df07[_0xc309('0x64')]['length']){_0xfeb540=_[_0xc309('0x65')](_0xa5df07[_0xc309('0x64')],this[_0xc309('0x66')](_0x36eb99,_0xa5df07['channel']));}if(_0xa5df07[_0xc309('0x67')][_0xc309('0x40')]){_0x533ead=_['some'](_0xa5df07[_0xc309('0x67')],this[_0xc309('0x66')](_0x36eb99,_0xa5df07[_0xc309('0x68')]));}return _0xfeb540&&_0x533ead;};Trigger[_0xc309('0x37')][_0xc309('0x66')]=function(_0x16a6d5,_0x1a9d78){return function(_0x1e0838){switch(_0x1e0838['field']){case _0xc309('0x69'):if(_0x16a6d5[_0xc309('0x68')]===_0x1a9d78){if(_0x1a9d78===_0xc309('0x6a')){return _0x16a6d5['ChatWebsiteId']?operators[_0x1e0838['operator']](Number(_0x1e0838[_0xc309('0x6b')]),_0x16a6d5[_0xc309('0x6c')]):![];}else{return _0x16a6d5[_[_0xc309('0x6d')](_0x1a9d78)+_0xc309('0x6e')]?operators[_0x1e0838[_0xc309('0x6f')]](Number(_0x1e0838[_0xc309('0x6b')]),_0x16a6d5[_['upperFirst'](_0x1a9d78)+_0xc309('0x6e')]):![];}}break;case'interaction':case'message':if(_0x16a6d5['channel']===_0x1a9d78){return _0x16a6d5['event']?operators[_0x1e0838[_0xc309('0x6f')]](_0x1e0838[_0xc309('0x6b')],_0x16a6d5[_0xc309('0x70')]):![];}break;case'queue':return _0x16a6d5['queue']?operators[_0x1e0838[_0xc309('0x6f')]](_0x1e0838[_0xc309('0x6b')],_0x16a6d5[_0xc309('0x71')]):![];case'agent':return _0x16a6d5[_0xc309('0x72')]?operators[_0x1e0838[_0xc309('0x6f')]](_0x1e0838[_0xc309('0x6b')],_0x16a6d5[_0xc309('0x72')]):![];case _0xc309('0x73'):return _0x16a6d5[_0xc309('0x73')]?operators[_0x1e0838[_0xc309('0x6f')]](_0x1e0838[_0xc309('0x6b')],_0x16a6d5[_0xc309('0x73')]):![];case'routeId':return _0x16a6d5[_0xc309('0x5e')]?operators[_0x1e0838[_0xc309('0x6f')]](_0x1e0838[_0xc309('0x6b')],_0x16a6d5[_0xc309('0x5e')]):![];}return![];};};module[_0xc309('0x74')]=Trigger;
\ No newline at end of file
+var _0x9289=['voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','zendeskAccounts','dynamics365Accounts','custom:agentcalled','custom:agentconnect','syncCustomEvent','custom:agentringnoanswer','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','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','interface','checkTriggers','status','checkTrigger','merge','variables','Actions','length','action','contactmanager','browser','data1','TemplateId','data2','html','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','winApplication','render','winArguments','emit','format','user:%s','name','trigger:%s:%s','toLowerCase','jscripty','trigger:%s','exec','integration','accounts','queue','routeId','urlforward','script','parse','query','search','replace','AllConditions','every','checkConditions','channel','AnyConditions','some','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','util','lodash','url','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates'];(function(_0x1beb62,_0x5cdc6f){var _0x3eed3a=function(_0x1bfa41){while(--_0x1bfa41){_0x1beb62['push'](_0x1beb62['shift']());}};_0x3eed3a(++_0x5cdc6f);}(_0x9289,0x67));var _0x9928=function(_0x521616,_0x9ad1e7){_0x521616=_0x521616-0x0;var _0x27e8d2=_0x9289[_0x521616];return _0x27e8d2;};'use strict';var util=require(_0x9928('0x0'));var _=require(_0x9928('0x1'));var url=require(_0x9928('0x2'));var Mustache=require(_0x9928('0x3'));var Redis=require('ioredis');var urlforward=require(_0x9928('0x4'));var integration=require(_0x9928('0x5'));var cmContact=require(_0x9928('0x6'));var script=require(_0x9928('0x7'));var config=require(_0x9928('0x8'));var logger=require(_0x9928('0x9'))('trigger');var ami=require('../ami');config['redis']=_[_0x9928('0xa')](config[_0x9928('0xb')],{'host':_0x9928('0xc'),'port':0x18eb});var io=require(_0x9928('0xd'))(new Redis(config[_0x9928('0xb')]));var operators={'equals':function(_0x446e4d,_0x4554e5){return _0x446e4d==_0x4554e5;},'not_equals':function(_0x670aa4,_0x209905){return _0x670aa4!=_0x209905;}};var barAndWebActions=[_0x9928('0xe'),_0x9928('0x2'),_0x9928('0xf')];function Trigger(_0x1686d7){this[_0x9928('0x10')]=_0x1686d7[_0x9928('0x10')];this[_0x9928('0x11')]=_0x1686d7[_0x9928('0x11')];this[_0x9928('0x12')]=_0x1686d7[_0x9928('0x12')];this[_0x9928('0x13')]=_0x1686d7[_0x9928('0x13')];this[_0x9928('0x14')]=_0x1686d7['voiceExtensions'];this['zendeskAccounts']=_0x1686d7['zendeskAccounts'];this[_0x9928('0x15')]=_0x1686d7['freshdeskAccounts'];this[_0x9928('0x16')]=_0x1686d7[_0x9928('0x16')];this[_0x9928('0x17')]=_0x1686d7['sugarcrmAccounts'];this[_0x9928('0x18')]=_0x1686d7[_0x9928('0x18')];this['deskAccounts']=_0x1686d7[_0x9928('0x19')];this['vtigerAccounts']=_0x1686d7[_0x9928('0x1a')];this[_0x9928('0x1b')]=_0x1686d7[_0x9928('0x1b')];this['dynamics365Accounts']=_0x1686d7['dynamics365Accounts'];this['freshsalesAccounts']=_0x1686d7[_0x9928('0x1c')];this['accounts']={'zendesk':this[_0x9928('0x1d')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x9928('0x15')],'sugarcrm':this[_0x9928('0x17')],'zoho':this[_0x9928('0x18')],'desk':this[_0x9928('0x19')],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0x9928('0x1e')],'freshsales':this[_0x9928('0x1c')],'servicenow':this[_0x9928('0x1b')]};ami['on'](_0x9928('0x1f'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9928('0x20'),this[_0x9928('0x21')]['bind'](this));ami['on'](_0x9928('0x22'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x24'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x25'),this[_0x9928('0x21')]['bind'](this));ami['on'](_0x9928('0x26'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x9928('0x28'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x29'),this['syncCustomEvent'][_0x9928('0x23')](this));ami['on'](_0x9928('0x2a'),this['syncCustomEvent'][_0x9928('0x23')](this));ami['on'](_0x9928('0x2b'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x2c'),this[_0x9928('0x21')]['bind'](this));ami['on'](_0x9928('0x2d'),this[_0x9928('0x2e')][_0x9928('0x23')](this));ami['on'](_0x9928('0x2f'),this['syncAgentDial'][_0x9928('0x23')](this));ami['on'](_0x9928('0x30'),this[_0x9928('0x2e')][_0x9928('0x23')](this));ami['on'](_0x9928('0x31'),this[_0x9928('0x21')]['bind'](this));ami['on'](_0x9928('0x32'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x33'),this['syncCustomEvent'][_0x9928('0x23')](this));ami['on'](_0x9928('0x34'),this[_0x9928('0x21')]['bind'](this));ami['on'](_0x9928('0x35'),this[_0x9928('0x21')][_0x9928('0x23')](this));ami['on'](_0x9928('0x36'),this['syncCustomEvent'][_0x9928('0x23')](this));}Trigger[_0x9928('0x37')]['emit']=function(_0x55d25d,_0x267c57,_0xb86919){logger['info'](_0x55d25d,_0x267c57,JSON['stringify'](_0xb86919));io['to'](_0x55d25d)['emit'](_0x267c57,_0xb86919);};Trigger[_0x9928('0x37')][_0x9928('0x21')]=function(_0x5b2f85){var _0x525d9a=_['clone'](_0x5b2f85);this['checkTriggers'](_0x525d9a);};Trigger[_0x9928('0x37')][_0x9928('0x2e')]=function(_0x3de8ed){if(this['agents'][_0x3de8ed[_0x9928('0x38')]]){this[_0x9928('0x21')](_0x3de8ed);}};Trigger[_0x9928('0x37')][_0x9928('0x39')]=function(_0x5928b3){var _0xc3b16d;for(var _0x40aaed in this[_0x9928('0x10')]){if(this[_0x9928('0x10')]['hasOwnProperty'](_0x40aaed)){if(this[_0x9928('0x10')][_0x40aaed][_0x9928('0x3a')]){_0xc3b16d=this[_0x9928('0x3b')](this[_0x9928('0x10')][_0x40aaed],_0x5928b3);if(_0xc3b16d){_[_0x9928('0x3c')](_0x5928b3,_0x5928b3[_0x9928('0x3d')]);for(var _0x46eb1f=0x0,_0x1da776,_0x43a8bc,_0xd739fb;_0x46eb1f<this[_0x9928('0x10')][_0x40aaed][_0x9928('0x3e')][_0x9928('0x3f')];_0x46eb1f+=0x1){_0x1da776=this[_0x9928('0x10')][_0x40aaed][_0x9928('0x3e')][_0x46eb1f];if(this['agents'][_0x5928b3['interface']]){switch(_0x1da776[_0x9928('0x40')]['toLowerCase']()){case _0x9928('0x41'):break;case'motionbar':case _0x9928('0x42'):var _0x25c153={};switch(barAndWebActions[_0x1da776[_0x9928('0x43')]]){case _0x9928('0xe'):_0x25c153[_0x9928('0x44')]=_0x1da776[_0x9928('0x45')];_0x25c153['html']=this[_0x9928('0x13')][_0x1da776[_0x9928('0x45')]]?Mustache['render'](this[_0x9928('0x13')][_0x1da776[_0x9928('0x45')]][_0x9928('0x46')],_0x5928b3):'template\x20not\x20found';break;case'url':_0x25c153[_0x9928('0x47')]=this[_0x9928('0x48')](_0x1da776[_0x9928('0x45')],_0x5928b3,_[_0x9928('0x49')](_0x1da776['data3'])?!![]:parseInt(_0x1da776[_0x9928('0x4a')],0xa));if(_[_0x9928('0x49')](_0x1da776[_0x9928('0x4b')])){_0x25c153[_0x9928('0x4c')]='0';}else{_0x25c153[_0x9928('0x4d')]=_0x1da776['data4'];_0x25c153['windowWidth']=_[_0x9928('0x49')](_0x1da776[_0x9928('0x4e')])?_0x9928('0x4f'):_0x1da776['data5'];_0x25c153[_0x9928('0x50')]=_[_0x9928('0x49')](_0x1da776[_0x9928('0x51')])?'600':_0x1da776[_0x9928('0x51')];}break;case _0x9928('0xf'):_0x25c153[_0x9928('0x52')]=_0x1da776['data2']?Mustache[_0x9928('0x53')](_0x1da776[_0x9928('0x45')],_0x5928b3):'';_0x25c153[_0x9928('0x54')]=_0x1da776[_0x9928('0x4a')]?Mustache[_0x9928('0x53')](_0x1da776['data3'],_0x5928b3):'';break;}this[_0x9928('0x55')](util[_0x9928('0x56')](_0x9928('0x57'),this[_0x9928('0x11')][_0x5928b3[_0x9928('0x38')]][_0x9928('0x58')]),util[_0x9928('0x56')](_0x9928('0x59'),_0x1da776[_0x9928('0x40')][_0x9928('0x5a')](),barAndWebActions[_0x1da776[_0x9928('0x43')]]),_[_0x9928('0x3c')](_0x25c153,_0x5928b3));break;case _0x9928('0x5b'):this[_0x9928('0x55')](util['format'](_0x9928('0x57'),this['agents'][_0x5928b3[_0x9928('0x38')]]['name']),util['format'](_0x9928('0x5c'),_0x1da776[_0x9928('0x40')][_0x9928('0x5a')]()),_[_0x9928('0x3c')]({'ProjectId':parseInt(_0x1da776[_0x9928('0x43')],0xa)},_0x5928b3));break;default:this['emit'](util[_0x9928('0x56')](_0x9928('0x57'),this[_0x9928('0x11')][_0x5928b3['interface']]['name']),util[_0x9928('0x56')](_0x9928('0x5c'),_0x1da776['action']['toLowerCase']()),_[_0x9928('0x3c')]({},_0x1da776,_0x5928b3));}}switch(_0x1da776[_0x9928('0x40')][_0x9928('0x5a')]()){case _0x9928('0x41'):cmContact[_0x9928('0x5d')](this[_0x9928('0x11')][_0x5928b3['interface']],this[_0x9928('0x10')][_0x40aaed],_0x1da776,_0x5928b3);break;case _0x9928('0x5e'):integration[_0x9928('0x5d')](_0x1da776,_0x5928b3,this[_0x9928('0x5f')],this[_0x9928('0x11')][_0x5928b3[_0x9928('0x38')]],this['voiceQueues'][_0x5928b3[_0x9928('0x60')]],this[_0x9928('0x14')][_0x5928b3[_0x9928('0x61')]]);break;case _0x9928('0x62'):urlforward['exec'](_0x1da776,_0x5928b3);break;case _0x9928('0x63'):script[_0x9928('0x5d')](_0x1da776,_0x5928b3);break;}}}}}}};Trigger[_0x9928('0x37')][_0x9928('0x48')]=function(_0x354b0b,_0x40e6e4,_0xf4ee14){var _0xcc07=url[_0x9928('0x64')](Mustache['render'](_0x354b0b,_0x40e6e4),!![]);if(_0xf4ee14){_[_0x9928('0x3c')](_0xcc07[_0x9928('0x65')],_0x40e6e4);}delete _0xcc07[_0x9928('0x66')];var _0xc3bbe8=url[_0x9928('0x56')](_0xcc07);_0xc3bbe8=_0xc3bbe8[_0x9928('0x67')](/\/\?/g,'?');return _0xc3bbe8;};Trigger[_0x9928('0x37')]['checkTrigger']=function(_0x2cb6be,_0x113171){var _0x3d9727=!![],_0x168443=!![];if(_0x2cb6be[_0x9928('0x68')]['length']){_0x3d9727=_[_0x9928('0x69')](_0x2cb6be[_0x9928('0x68')],this[_0x9928('0x6a')](_0x113171,_0x2cb6be[_0x9928('0x6b')]));}if(_0x2cb6be[_0x9928('0x6c')][_0x9928('0x3f')]){_0x168443=_[_0x9928('0x6d')](_0x2cb6be[_0x9928('0x6c')],this[_0x9928('0x6a')](_0x113171,_0x2cb6be[_0x9928('0x6b')]));}return _0x3d9727&&_0x168443;};Trigger['prototype'][_0x9928('0x6a')]=function(_0x22e092,_0x406855){return function(_0x9e464b){switch(_0x9e464b[_0x9928('0x6e')]){case _0x9928('0x6f'):if(_0x22e092['channel']===_0x406855){if(_0x406855===_0x9928('0x70')){return _0x22e092[_0x9928('0x71')]?operators[_0x9e464b[_0x9928('0x72')]](Number(_0x9e464b[_0x9928('0x73')]),_0x22e092[_0x9928('0x71')]):![];}else{return _0x22e092[_[_0x9928('0x74')](_0x406855)+'AccountId']?operators[_0x9e464b[_0x9928('0x72')]](Number(_0x9e464b[_0x9928('0x73')]),_0x22e092[_['upperFirst'](_0x406855)+_0x9928('0x75')]):![];}}break;case _0x9928('0x76'):case _0x9928('0x77'):if(_0x22e092[_0x9928('0x6b')]===_0x406855){return _0x22e092[_0x9928('0x78')]?operators[_0x9e464b[_0x9928('0x72')]](_0x9e464b[_0x9928('0x73')],_0x22e092[_0x9928('0x78')]):![];}break;case _0x9928('0x60'):return _0x22e092['queue']?operators[_0x9e464b[_0x9928('0x72')]](_0x9e464b['value'],_0x22e092[_0x9928('0x60')]):![];case'agent':return _0x22e092[_0x9928('0x79')]?operators[_0x9e464b[_0x9928('0x72')]](_0x9e464b[_0x9928('0x73')],_0x22e092[_0x9928('0x79')]):![];case _0x9928('0x7a'):return _0x22e092[_0x9928('0x7a')]?operators[_0x9e464b['operator']](_0x9e464b['value'],_0x22e092['lastevent']):![];case'routeId':return _0x22e092[_0x9928('0x61')]?operators[_0x9e464b[_0x9928('0x72')]](_0x9e464b['value'],_0x22e092['routeId']):![];}return![];};};module['exports']=Trigger;
\ No newline at end of file