Built motion from commit 0555bc41.|2.5.41
[motion2.git] / server / services / ami / trigger / index.js
index 8828e2e..1cdadc3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8a21=['./script','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentcongestion','custom:agentreject','custom:amd','custom:dialbegin','syncAgentDial','custom:dialend','custom:closedinteraction','custom:substatus','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','custom:offlineMessage','prototype','info','emit','clone','motionChannel','undefined','voice','checkTriggers','interface','status','merge','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','data6','winApplication','winArguments','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','accounts','queue','urlforward','script','query','search','checkTrigger','length','checkConditions','channel','AnyConditions','some','ChatWebsiteId','operator','upperFirst','AccountId','value','interaction','event','membername','lastevent','routeId','mailSubstatus','null','substatus','offlineMessage','equals','util','mustache','ioredis','./urlforward'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a21,0x1d8));var _0x18a2=function(_0x3a081b,_0x516437){_0x3a081b=_0x3a081b-0x0;var _0xb166c4=_0x8a21[_0x3a081b];return _0xb166c4;};'use strict';var util=require(_0x18a2('0x0'));var _=require('lodash');var url=require('url');var Mustache=require(_0x18a2('0x1'));var Redis=require(_0x18a2('0x2'));var urlforward=require(_0x18a2('0x3'));var integration=require('./integration');var cmContact=require('./cmContact');var script=require(_0x18a2('0x4'));var config=require(_0x18a2('0x5'));var logger=require(_0x18a2('0x6'))(_0x18a2('0x7'));var ami=require(_0x18a2('0x8'));config[_0x18a2('0x9')]=_[_0x18a2('0xa')](config[_0x18a2('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x18a2('0xb'))(new Redis(config[_0x18a2('0x9')]));var operators={'equals':function(_0x29a54d,_0x5597f5){return _0x29a54d==_0x5597f5;},'not_equals':function(_0x29031a,_0x3e9df9){return _0x29031a!=_0x3e9df9;}};var barAndWebActions=[_0x18a2('0xc'),_0x18a2('0xd'),_0x18a2('0xe')];function Trigger(_0x54ce08){this[_0x18a2('0xf')]=_0x54ce08[_0x18a2('0xf')];this['agents']=_0x54ce08[_0x18a2('0x10')];this[_0x18a2('0x11')]=_0x54ce08['voiceQueues'];this[_0x18a2('0x12')]=_0x54ce08[_0x18a2('0x12')];this['voiceExtensions']=_0x54ce08[_0x18a2('0x13')];this[_0x18a2('0x14')]=_0x54ce08[_0x18a2('0x14')];this[_0x18a2('0x15')]=_0x54ce08['freshdeskAccounts'];this['salesforceAccounts']=_0x54ce08[_0x18a2('0x16')];this['sugarcrmAccounts']=_0x54ce08[_0x18a2('0x17')];this['zohoAccounts']=_0x54ce08[_0x18a2('0x18')];this[_0x18a2('0x19')]=_0x54ce08[_0x18a2('0x19')];this['vtigerAccounts']=_0x54ce08[_0x18a2('0x1a')];this[_0x18a2('0x1b')]=_0x54ce08[_0x18a2('0x1b')];this[_0x18a2('0x1c')]=_0x54ce08[_0x18a2('0x1c')];this['freshsalesAccounts']=_0x54ce08[_0x18a2('0x1d')];this['accounts']={'zendesk':this[_0x18a2('0x14')],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x18a2('0x15')],'sugarcrm':this[_0x18a2('0x17')],'zoho':this[_0x18a2('0x18')],'desk':this[_0x18a2('0x19')],'vtiger':this[_0x18a2('0x1a')],'dynamics365':this[_0x18a2('0x1c')],'freshsales':this[_0x18a2('0x1d')],'servicenow':this[_0x18a2('0x1b')]};ami['on'](_0x18a2('0x1e'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x21'),this['syncCustomEvent'][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x22'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x23'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentnosuchnumber',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:agentnoanswer',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:agentbusy',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x24'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x25'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x26'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on']('custom:timeout',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x27'),this[_0x18a2('0x28')][_0x18a2('0x20')](this));ami['on']('custom:dialconnect',this[_0x18a2('0x28')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x29'),this[_0x18a2('0x28')][_0x18a2('0x20')](this));ami['on']('custom:newinteraction',this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2a'),this[_0x18a2('0x1f')]['bind'](this));ami['on'](_0x18a2('0x2b'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2c'),this['syncCustomEvent'][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2d'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x2e'),this[_0x18a2('0x1f')]['bind'](this));ami['on'](_0x18a2('0x2f'),this[_0x18a2('0x1f')][_0x18a2('0x20')](this));ami['on'](_0x18a2('0x30'),this[_0x18a2('0x1f')]['bind'](this));}Trigger[_0x18a2('0x31')]['emit']=function(_0x1a9437,_0x9b20c1,_0x42a851){logger[_0x18a2('0x32')](_0x1a9437,_0x9b20c1,JSON['stringify'](_0x42a851));io['to'](_0x1a9437)[_0x18a2('0x33')](_0x9b20c1,_0x42a851);};Trigger[_0x18a2('0x31')]['syncCustomEvent']=function(_0x430a03){var _0x13e882=_[_0x18a2('0x34')](_0x430a03);if(typeof _0x13e882[_0x18a2('0x35')]===_0x18a2('0x36')){_0x13e882['motionChannel']=_0x18a2('0x37');}this[_0x18a2('0x38')](_0x13e882);};Trigger[_0x18a2('0x31')][_0x18a2('0x28')]=function(_0x5aad75){if(this['agents'][_0x5aad75[_0x18a2('0x39')]]){this['syncCustomEvent'](_0x5aad75);}};Trigger[_0x18a2('0x31')][_0x18a2('0x38')]=function(_0x9e6946){var _0x3a6a45;for(var _0x2345eb in this[_0x18a2('0xf')]){if(this[_0x18a2('0xf')]['hasOwnProperty'](_0x2345eb)){if(this[_0x18a2('0xf')][_0x2345eb][_0x18a2('0x3a')]){_0x3a6a45=this['checkTrigger'](this[_0x18a2('0xf')][_0x2345eb],_0x9e6946);if(_0x3a6a45){_[_0x18a2('0x3b')](_0x9e6946,_0x9e6946['variables']);for(var _0x30d37c=0x0,_0x392626,_0x3a5b6d,_0x200080;_0x30d37c<this['triggers'][_0x2345eb][_0x18a2('0x3c')]['length'];_0x30d37c+=0x1){_0x392626=this[_0x18a2('0xf')][_0x2345eb][_0x18a2('0x3c')][_0x30d37c];if(this[_0x18a2('0x10')][_0x9e6946[_0x18a2('0x39')]]){switch(_0x392626[_0x18a2('0x3d')][_0x18a2('0x3e')]()){case _0x18a2('0x3f'):break;case _0x18a2('0x40'):case _0x18a2('0x41'):var _0x2d55fd={};switch(barAndWebActions[_0x392626[_0x18a2('0x42')]]){case'popup':_0x2d55fd['TemplateId']=_0x392626[_0x18a2('0x43')];_0x2d55fd[_0x18a2('0x44')]=this[_0x18a2('0x12')][_0x392626['data2']]?Mustache[_0x18a2('0x45')](this[_0x18a2('0x12')][_0x392626[_0x18a2('0x43')]][_0x18a2('0x44')],_0x9e6946):_0x18a2('0x46');break;case _0x18a2('0xd'):_0x2d55fd[_0x18a2('0x47')]=this[_0x18a2('0x48')](_0x392626[_0x18a2('0x43')],_0x9e6946,_[_0x18a2('0x49')](_0x392626[_0x18a2('0x4a')])?!![]:parseInt(_0x392626[_0x18a2('0x4a')],0xa));if(_[_0x18a2('0x49')](_0x392626[_0x18a2('0x4b')])){_0x2d55fd[_0x18a2('0x4c')]='0';}else{_0x2d55fd[_0x18a2('0x4d')]=_0x392626[_0x18a2('0x4b')];_0x2d55fd[_0x18a2('0x4e')]=_[_0x18a2('0x49')](_0x392626[_0x18a2('0x4f')])?_0x18a2('0x50'):_0x392626['data5'];_0x2d55fd['windowHeight']=_[_0x18a2('0x49')](_0x392626['data6'])?'600':_0x392626[_0x18a2('0x51')];}break;case _0x18a2('0xe'):_0x2d55fd[_0x18a2('0x52')]=_0x392626['data2']?Mustache[_0x18a2('0x45')](_0x392626[_0x18a2('0x43')],_0x9e6946):'';_0x2d55fd[_0x18a2('0x53')]=_0x392626['data3']?Mustache[_0x18a2('0x45')](_0x392626['data3'],_0x9e6946):'';break;}this[_0x18a2('0x33')](util[_0x18a2('0x54')](_0x18a2('0x55'),this[_0x18a2('0x10')][_0x9e6946[_0x18a2('0x39')]][_0x18a2('0x56')]),util[_0x18a2('0x54')](_0x18a2('0x57'),_0x392626[_0x18a2('0x3d')][_0x18a2('0x3e')](),barAndWebActions[_0x392626['data1']]),_[_0x18a2('0x3b')](_0x2d55fd,_0x9e6946));break;case _0x18a2('0x58'):this['emit'](util[_0x18a2('0x54')](_0x18a2('0x55'),this[_0x18a2('0x10')][_0x9e6946[_0x18a2('0x39')]][_0x18a2('0x56')]),util[_0x18a2('0x54')](_0x18a2('0x59'),_0x392626[_0x18a2('0x3d')][_0x18a2('0x3e')]()),_[_0x18a2('0x3b')]({'ProjectId':parseInt(_0x392626[_0x18a2('0x42')],0xa)},_0x9e6946));break;default:this[_0x18a2('0x33')](util[_0x18a2('0x54')](_0x18a2('0x55'),this[_0x18a2('0x10')][_0x9e6946[_0x18a2('0x39')]][_0x18a2('0x56')]),util[_0x18a2('0x54')](_0x18a2('0x59'),_0x392626[_0x18a2('0x3d')][_0x18a2('0x3e')]()),_[_0x18a2('0x3b')]({},_0x392626,_0x9e6946));}}switch(_0x392626[_0x18a2('0x3d')][_0x18a2('0x3e')]()){case _0x18a2('0x3f'):cmContact[_0x18a2('0x5a')](this[_0x18a2('0x10')][_0x9e6946['interface']],this['triggers'][_0x2345eb],_0x392626,_0x9e6946);break;case _0x18a2('0x5b'):integration['exec'](_0x392626,_0x9e6946,this[_0x18a2('0x5c')],this[_0x18a2('0x10')][_0x9e6946[_0x18a2('0x39')]],this[_0x18a2('0x11')][_0x9e6946[_0x18a2('0x5d')]],this[_0x18a2('0x13')][_0x9e6946['routeId']]);break;case _0x18a2('0x5e'):urlforward[_0x18a2('0x5a')](_0x392626,_0x9e6946);break;case _0x18a2('0x5f'):script[_0x18a2('0x5a')](_0x392626,_0x9e6946);break;}}}}}}};Trigger[_0x18a2('0x31')][_0x18a2('0x48')]=function(_0x2eadbe,_0xd9bbab,_0x28391e){var _0x282076=url['parse'](Mustache[_0x18a2('0x45')](_0x2eadbe,_0xd9bbab),!![]);if(_0x28391e){_[_0x18a2('0x3b')](_0x282076[_0x18a2('0x60')],_0xd9bbab);}delete _0x282076[_0x18a2('0x61')];var _0x17681b=url[_0x18a2('0x54')](_0x282076);_0x17681b=_0x17681b['replace'](/\/\?/g,'?');return _0x17681b;};Trigger[_0x18a2('0x31')][_0x18a2('0x62')]=function(_0x2fe76f,_0x4a3b96){var _0x2509e0=!![];var _0x580dec=!![];var _0x8640b0=![];if(_0x2fe76f['channel']===_0x4a3b96[_0x18a2('0x35')]){_0x8640b0=!![];}if(_0x2fe76f['AllConditions'][_0x18a2('0x63')]){_0x2509e0=_['every'](_0x2fe76f['AllConditions'],this[_0x18a2('0x64')](_0x4a3b96,_0x2fe76f[_0x18a2('0x65')]));}if(_0x2fe76f[_0x18a2('0x66')]['length']){_0x580dec=_[_0x18a2('0x67')](_0x2fe76f[_0x18a2('0x66')],this[_0x18a2('0x64')](_0x4a3b96,_0x2fe76f[_0x18a2('0x65')]));}return _0x8640b0&&_0x2509e0&&_0x580dec;};Trigger['prototype'][_0x18a2('0x64')]=function(_0x22ae13,_0x47666b){return function(_0x4be723){switch(_0x4be723['field']){case'account':if(_0x22ae13[_0x18a2('0x65')]===_0x47666b){if(_0x47666b==='chat'){return _0x22ae13[_0x18a2('0x68')]?operators[_0x4be723[_0x18a2('0x69')]](Number(_0x4be723['value']),_0x22ae13['ChatWebsiteId']):![];}else{return _0x22ae13[_[_0x18a2('0x6a')](_0x47666b)+_0x18a2('0x6b')]?operators[_0x4be723[_0x18a2('0x69')]](Number(_0x4be723[_0x18a2('0x6c')]),_0x22ae13[_[_0x18a2('0x6a')](_0x47666b)+'AccountId']):![];}}break;case _0x18a2('0x6d'):case'message':if(_0x22ae13[_0x18a2('0x65')]===_0x47666b){return _0x22ae13['event']?operators[_0x4be723[_0x18a2('0x69')]](_0x4be723['value'],_0x22ae13[_0x18a2('0x6e')]):![];}break;case _0x18a2('0x5d'):return _0x22ae13[_0x18a2('0x5d')]?operators[_0x4be723[_0x18a2('0x69')]](_0x4be723['value'],_0x22ae13[_0x18a2('0x5d')]):![];case'agent':return _0x22ae13[_0x18a2('0x6f')]?operators[_0x4be723[_0x18a2('0x69')]](_0x4be723[_0x18a2('0x6c')],_0x22ae13['membername']):![];case _0x18a2('0x70'):return _0x22ae13[_0x18a2('0x70')]?operators[_0x4be723[_0x18a2('0x69')]](_0x4be723[_0x18a2('0x6c')],_0x22ae13['lastevent']):![];case _0x18a2('0x71'):return _0x22ae13[_0x18a2('0x71')]?operators[_0x4be723[_0x18a2('0x69')]](_0x4be723[_0x18a2('0x6c')],_0x22ae13[_0x18a2('0x71')]):![];case _0x18a2('0x72'):if(_0x4be723[_0x18a2('0x6c')]===_0x18a2('0x73'))_0x4be723[_0x18a2('0x6c')]=null;return typeof _0x22ae13['substatus']!==_0x18a2('0x36')?operators[_0x4be723[_0x18a2('0x69')]](_0x4be723[_0x18a2('0x6c')],_0x22ae13[_0x18a2('0x74')]):![];case _0x18a2('0x75'):if(_0x22ae13['channel']===_0x47666b){return _0x4be723['value']==='created'&&_0x4be723[_0x18a2('0x69')]===_0x18a2('0x76')?!![]:![];}break;}return![];};};module['exports']=Trigger;
\ No newline at end of file
+var _0x6237=['clone','motionChannel','interface','checkTriggers','checkTrigger','merge','variables','Actions','action','toLowerCase','browser','data1','TemplateId','html','data2','render','template\x20not\x20found','uri','buildUri','data3','data4','location','uriLocation','windowWidth','isNil','data5','800','windowHeight','data6','winapp','winApplication','winArguments','user:%s','name','format','trigger:%s:%s','jscripty','trigger:%s','exec','routeId','urlforward','parse','query','search','replace','channel','AllConditions','length','every','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','operator','value','AccountId','upperFirst','interaction','event','queue','agent','membername','lastevent','null','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./urlforward','./cmContact','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','zendeskAccounts','zohoAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentcomplete','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','custom:rejectmessage','prototype','emit','info','stringify'];(function(_0x53377b,_0x3d7d54){var _0x43c921=function(_0xa46a1b){while(--_0xa46a1b){_0x53377b['push'](_0x53377b['shift']());}};_0x43c921(++_0x3d7d54);}(_0x6237,0xc4));var _0x7623=function(_0x3ae812,_0x57767f){_0x3ae812=_0x3ae812-0x0;var _0x3f6639=_0x6237[_0x3ae812];return _0x3f6639;};'use strict';var util=require(_0x7623('0x0'));var _=require(_0x7623('0x1'));var url=require(_0x7623('0x2'));var Mustache=require(_0x7623('0x3'));var Redis=require(_0x7623('0x4'));var urlforward=require(_0x7623('0x5'));var integration=require('./integration');var cmContact=require(_0x7623('0x6'));var script=require(_0x7623('0x7'));var config=require(_0x7623('0x8'));var logger=require('../../../config/logger')(_0x7623('0x9'));var ami=require(_0x7623('0xa'));config[_0x7623('0xb')]=_[_0x7623('0xc')](config['redis'],{'host':_0x7623('0xd'),'port':0x18eb});var io=require(_0x7623('0xe'))(new Redis(config[_0x7623('0xb')]));var operators={'equals':function(_0x5709fe,_0x352439){return _0x5709fe==_0x352439;},'not_equals':function(_0xb98922,_0x807b5e){return _0xb98922!=_0x807b5e;}};var barAndWebActions=[_0x7623('0xf'),_0x7623('0x2'),'winapp'];function Trigger(_0x1fd6f3){this['triggers']=_0x1fd6f3[_0x7623('0x10')];this[_0x7623('0x11')]=_0x1fd6f3[_0x7623('0x11')];this[_0x7623('0x12')]=_0x1fd6f3[_0x7623('0x12')];this[_0x7623('0x13')]=_0x1fd6f3['templates'];this[_0x7623('0x14')]=_0x1fd6f3[_0x7623('0x14')];this['zendeskAccounts']=_0x1fd6f3['zendeskAccounts'];this[_0x7623('0x15')]=_0x1fd6f3['freshdeskAccounts'];this['salesforceAccounts']=_0x1fd6f3[_0x7623('0x16')];this[_0x7623('0x17')]=_0x1fd6f3[_0x7623('0x17')];this['zohoAccounts']=_0x1fd6f3['zohoAccounts'];this[_0x7623('0x18')]=_0x1fd6f3[_0x7623('0x18')];this[_0x7623('0x19')]=_0x1fd6f3[_0x7623('0x19')];this[_0x7623('0x1a')]=_0x1fd6f3[_0x7623('0x1a')];this['dynamics365Accounts']=_0x1fd6f3['dynamics365Accounts'];this[_0x7623('0x1b')]=_0x1fd6f3[_0x7623('0x1b')];this[_0x7623('0x1c')]={'zendesk':this[_0x7623('0x1d')],'salesforce':this[_0x7623('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x7623('0x17')],'zoho':this[_0x7623('0x1e')],'desk':this[_0x7623('0x18')],'vtiger':this[_0x7623('0x19')],'dynamics365':this['dynamics365Accounts'],'freshsales':this[_0x7623('0x1b')],'servicenow':this['servicenowAccounts']};ami['on'](_0x7623('0x1f'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x22'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x23'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x24'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x25'),this[_0x7623('0x20')]['bind'](this));ami['on']('custom:agentnoanswer',this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x26'),this[_0x7623('0x20')]['bind'](this));ami['on'](_0x7623('0x27'),this['syncCustomEvent']['bind'](this));ami['on'](_0x7623('0x28'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x29'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on']('custom:queuecallerabandon',this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x2a'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x2b'),this[_0x7623('0x2c')][_0x7623('0x21')](this));ami['on'](_0x7623('0x2d'),this['syncAgentDial'][_0x7623('0x21')](this));ami['on']('custom:dialend',this['syncAgentDial'][_0x7623('0x21')](this));ami['on'](_0x7623('0x2e'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x2f'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on']('custom:substatus',this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on']('custom:incomingmessage',this[_0x7623('0x20')]['bind'](this));ami['on'](_0x7623('0x30'),this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on']('custom:acceptmessage',this[_0x7623('0x20')][_0x7623('0x21')](this));ami['on'](_0x7623('0x31'),this[_0x7623('0x20')]['bind'](this));ami['on']('custom:offlineMessage',this[_0x7623('0x20')][_0x7623('0x21')](this));}Trigger[_0x7623('0x32')][_0x7623('0x33')]=function(_0x4896f6,_0x23b0b3,_0x23f02a){logger[_0x7623('0x34')](_0x4896f6,_0x23b0b3,JSON[_0x7623('0x35')](_0x23f02a));io['to'](_0x4896f6)['emit'](_0x23b0b3,_0x23f02a);};Trigger[_0x7623('0x32')]['syncCustomEvent']=function(_0x4abc84){var _0xa666a6=_[_0x7623('0x36')](_0x4abc84);if(typeof _0xa666a6[_0x7623('0x37')]==='undefined'){_0xa666a6['motionChannel']='voice';}this['checkTriggers'](_0xa666a6);};Trigger['prototype'][_0x7623('0x2c')]=function(_0x127a70){if(this[_0x7623('0x11')][_0x127a70[_0x7623('0x38')]]){this[_0x7623('0x20')](_0x127a70);}};Trigger['prototype'][_0x7623('0x39')]=function(_0xf4af37){var _0x2e11b4;for(var _0x3d88b7 in this['triggers']){if(this['triggers']['hasOwnProperty'](_0x3d88b7)){if(this[_0x7623('0x10')][_0x3d88b7]['status']){_0x2e11b4=this[_0x7623('0x3a')](this['triggers'][_0x3d88b7],_0xf4af37);if(_0x2e11b4){_[_0x7623('0x3b')](_0xf4af37,_0xf4af37[_0x7623('0x3c')]);for(var _0x243fc5=0x0,_0x3f718b,_0x287367,_0x40f6f4;_0x243fc5<this[_0x7623('0x10')][_0x3d88b7][_0x7623('0x3d')]['length'];_0x243fc5+=0x1){_0x3f718b=this[_0x7623('0x10')][_0x3d88b7][_0x7623('0x3d')][_0x243fc5];if(this[_0x7623('0x11')][_0xf4af37['interface']]){switch(_0x3f718b[_0x7623('0x3e')][_0x7623('0x3f')]()){case'contactmanager':break;case'motionbar':case _0x7623('0x40'):var _0x14fe40={};switch(barAndWebActions[_0x3f718b[_0x7623('0x41')]]){case _0x7623('0xf'):_0x14fe40[_0x7623('0x42')]=_0x3f718b['data2'];_0x14fe40[_0x7623('0x43')]=this[_0x7623('0x13')][_0x3f718b[_0x7623('0x44')]]?Mustache[_0x7623('0x45')](this[_0x7623('0x13')][_0x3f718b[_0x7623('0x44')]][_0x7623('0x43')],_0xf4af37):_0x7623('0x46');break;case'url':_0x14fe40[_0x7623('0x47')]=this[_0x7623('0x48')](_0x3f718b[_0x7623('0x44')],_0xf4af37,_['isNil'](_0x3f718b[_0x7623('0x49')])?!![]:parseInt(_0x3f718b['data3'],0xa));if(_['isNil'](_0x3f718b[_0x7623('0x4a')])){_0x14fe40[_0x7623('0x4b')]='0';}else{_0x14fe40[_0x7623('0x4c')]=_0x3f718b['data4'];_0x14fe40[_0x7623('0x4d')]=_[_0x7623('0x4e')](_0x3f718b[_0x7623('0x4f')])?_0x7623('0x50'):_0x3f718b['data5'];_0x14fe40[_0x7623('0x51')]=_[_0x7623('0x4e')](_0x3f718b[_0x7623('0x52')])?'600':_0x3f718b['data6'];}break;case _0x7623('0x53'):_0x14fe40[_0x7623('0x54')]=_0x3f718b['data2']?Mustache['render'](_0x3f718b[_0x7623('0x44')],_0xf4af37):'';_0x14fe40[_0x7623('0x55')]=_0x3f718b[_0x7623('0x49')]?Mustache[_0x7623('0x45')](_0x3f718b[_0x7623('0x49')],_0xf4af37):'';break;}this[_0x7623('0x33')](util['format'](_0x7623('0x56'),this['agents'][_0xf4af37[_0x7623('0x38')]][_0x7623('0x57')]),util[_0x7623('0x58')](_0x7623('0x59'),_0x3f718b[_0x7623('0x3e')][_0x7623('0x3f')](),barAndWebActions[_0x3f718b['data1']]),_[_0x7623('0x3b')](_0x14fe40,_0xf4af37));break;case _0x7623('0x5a'):this[_0x7623('0x33')](util['format'](_0x7623('0x56'),this[_0x7623('0x11')][_0xf4af37[_0x7623('0x38')]][_0x7623('0x57')]),util[_0x7623('0x58')](_0x7623('0x5b'),_0x3f718b[_0x7623('0x3e')][_0x7623('0x3f')]()),_[_0x7623('0x3b')]({'ProjectId':parseInt(_0x3f718b[_0x7623('0x41')],0xa)},_0xf4af37));break;default:this[_0x7623('0x33')](util[_0x7623('0x58')](_0x7623('0x56'),this['agents'][_0xf4af37[_0x7623('0x38')]][_0x7623('0x57')]),util['format'](_0x7623('0x5b'),_0x3f718b[_0x7623('0x3e')]['toLowerCase']()),_['merge']({},_0x3f718b,_0xf4af37));}}switch(_0x3f718b['action'][_0x7623('0x3f')]()){case'contactmanager':cmContact[_0x7623('0x5c')](this[_0x7623('0x11')][_0xf4af37[_0x7623('0x38')]],this[_0x7623('0x10')][_0x3d88b7],_0x3f718b,_0xf4af37);break;case'integration':integration['exec'](_0x3f718b,_0xf4af37,this[_0x7623('0x1c')],this[_0x7623('0x11')][_0xf4af37[_0x7623('0x38')]],this[_0x7623('0x12')][_0xf4af37['queue']],this[_0x7623('0x14')][_0xf4af37[_0x7623('0x5d')]]);break;case _0x7623('0x5e'):urlforward[_0x7623('0x5c')](_0x3f718b,_0xf4af37);break;case'script':script[_0x7623('0x5c')](_0x3f718b,_0xf4af37);break;}}}}}}};Trigger[_0x7623('0x32')][_0x7623('0x48')]=function(_0x5d1ad2,_0x330be,_0xaa2756){var _0x2f7496=url[_0x7623('0x5f')](Mustache['render'](_0x5d1ad2,_0x330be),!![]);if(_0xaa2756){_[_0x7623('0x3b')](_0x2f7496[_0x7623('0x60')],_0x330be);}delete _0x2f7496[_0x7623('0x61')];var _0xd68563=url['format'](_0x2f7496);_0xd68563=_0xd68563[_0x7623('0x62')](/\/\?/g,'?');return _0xd68563;};Trigger[_0x7623('0x32')][_0x7623('0x3a')]=function(_0x139e0e,_0x344728){var _0x2a3654=!![];var _0xa53eae=!![];var _0x389b11=![];if(_0x139e0e[_0x7623('0x63')]===_0x344728[_0x7623('0x37')]){_0x389b11=!![];}if(_0x139e0e[_0x7623('0x64')][_0x7623('0x65')]){_0x2a3654=_[_0x7623('0x66')](_0x139e0e[_0x7623('0x64')],this[_0x7623('0x67')](_0x344728,_0x139e0e['channel']));}if(_0x139e0e[_0x7623('0x68')][_0x7623('0x65')]){_0xa53eae=_[_0x7623('0x69')](_0x139e0e[_0x7623('0x68')],this['checkConditions'](_0x344728,_0x139e0e[_0x7623('0x63')]));}return _0x389b11&&_0x2a3654&&_0xa53eae;};Trigger[_0x7623('0x32')]['checkConditions']=function(_0x41b61b,_0x2fe7c2){return function(_0x2b9b0b){switch(_0x2b9b0b[_0x7623('0x6a')]){case'account':if(_0x41b61b[_0x7623('0x63')]===_0x2fe7c2){if(_0x2fe7c2===_0x7623('0x6b')){return _0x41b61b[_0x7623('0x6c')]?operators[_0x2b9b0b[_0x7623('0x6d')]](Number(_0x2b9b0b[_0x7623('0x6e')]),_0x41b61b[_0x7623('0x6c')]):![];}else{return _0x41b61b[_['upperFirst'](_0x2fe7c2)+_0x7623('0x6f')]?operators[_0x2b9b0b[_0x7623('0x6d')]](Number(_0x2b9b0b[_0x7623('0x6e')]),_0x41b61b[_[_0x7623('0x70')](_0x2fe7c2)+_0x7623('0x6f')]):![];}}break;case _0x7623('0x71'):case'message':if(_0x41b61b['channel']===_0x2fe7c2){return _0x41b61b[_0x7623('0x72')]?operators[_0x2b9b0b[_0x7623('0x6d')]](_0x2b9b0b[_0x7623('0x6e')],_0x41b61b[_0x7623('0x72')]):![];}break;case _0x7623('0x73'):return _0x41b61b[_0x7623('0x73')]?operators[_0x2b9b0b[_0x7623('0x6d')]](_0x2b9b0b[_0x7623('0x6e')],_0x41b61b[_0x7623('0x73')]):![];case _0x7623('0x74'):return _0x41b61b[_0x7623('0x75')]?operators[_0x2b9b0b['operator']](_0x2b9b0b[_0x7623('0x6e')],_0x41b61b[_0x7623('0x75')]):![];case _0x7623('0x76'):return _0x41b61b[_0x7623('0x76')]?operators[_0x2b9b0b[_0x7623('0x6d')]](_0x2b9b0b[_0x7623('0x6e')],_0x41b61b[_0x7623('0x76')]):![];case _0x7623('0x5d'):return _0x41b61b[_0x7623('0x5d')]?operators[_0x2b9b0b[_0x7623('0x6d')]](_0x2b9b0b['value'],_0x41b61b[_0x7623('0x5d')]):![];case'mailSubstatus':if(_0x2b9b0b[_0x7623('0x6e')]===_0x7623('0x77'))_0x2b9b0b['value']=null;return typeof _0x41b61b[_0x7623('0x78')]!=='undefined'?operators[_0x2b9b0b['operator']](_0x2b9b0b[_0x7623('0x6e')],_0x41b61b[_0x7623('0x78')]):![];case _0x7623('0x79'):if(_0x41b61b[_0x7623('0x63')]===_0x2fe7c2){return _0x2b9b0b[_0x7623('0x6e')]===_0x7623('0x7a')&&_0x2b9b0b[_0x7623('0x6d')]===_0x7623('0x7b')?!![]:![];}break;}return![];};};module[_0x7623('0x7c')]=Trigger;
\ No newline at end of file