Built motion from commit c0cdc9d8.|2.6.28
[motion2.git] / server / services / routing / server / applications / gotoif.js
index 785ae2b..e6a8324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x716f=['[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','info'];(function(_0x50915f,_0x56e705){var _0xe3927=function(_0x34126c){while(--_0x34126c){_0x50915f['push'](_0x50915f['shift']());}};_0xe3927(++_0x56e705);}(_0x716f,0x1f4));var _0xf716=function(_0x54edc9,_0x345f01){_0x54edc9=_0x54edc9-0x0;var _0x2ae7a9=_0x716f[_0x54edc9];return _0x2ae7a9;};'use strict';var schema=require(_0xf716('0x0'));var _=require(_0xf716('0x1'));var htmlToText=require('html-to-text');var utils=require(_0xf716('0x2'));var logger=require(_0xf716('0x3'))(_0xf716('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xf716('0x5')},'priorityTrue':{'type':'number','message':_0xf716('0x6')},'priorityFalse':{'type':_0xf716('0x7'),'message':'priority\x20false\x20is\x20a\x20number'}});exports['consequence']=function(_0x24f9dc,_0x3b9596){return function(_0x487275){try{var _0x1c1047={'condition':htmlToText[_0xf716('0x8')](utils[_0xf716('0x9')](_0x3b9596[0x0],this),{'wordwrap':![]})[_0xf716('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3b9596[0x1],'priorityFalse':_0x3b9596[0x2]};var _0x325a77=gotoif[_0xf716('0x0')](_0x1c1047,{'typecast':!![]});if(_0x325a77[_0xf716('0xb')]){logger[_0xf716('0xc')](_0xf716('0xd'),_0x24f9dc,_[_0xf716('0xe')](_0x325a77,_0xf716('0xf'))[_0xf716('0x10')](',\x20'));_0x487275[_0xf716('0x11')]();}else{try{var _0x5a0302=eval('('+_0x1c1047[_0xf716('0x12')]+')');var _0x3e5b8d=_0x5a0302?_0x1c1047[_0xf716('0x13')]:_0x1c1047[_0xf716('0x14')];logger[_0xf716('0x15')](_0xf716('0x16'),_0x24f9dc,_0x1c1047[_0xf716('0x12')],_0x5a0302,_0x3e5b8d||_0xf716('0x17'));if(_0x3e5b8d){var _0x1a799b=_[_0xf716('0x18')](_0x487275[_0xf716('0x19')](),{'p':_0x3e5b8d});if(_0x1a799b>=0x0){logger[_0xf716('0x15')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x24f9dc,_0x3e5b8d||_0xf716('0x17'),_0x1a799b);_0x487275[_0xf716('0x17')](_0x1a799b);}else{logger[_0xf716('0x15')](_0xf716('0x1a'),_0x24f9dc,_0x3e5b8d||_0xf716('0x17'));_0x487275['stop']();}}else{_0x487275[_0xf716('0x17')]();}}catch(_0x450f11){logger[_0xf716('0xc')](_0xf716('0x1b'),_0x24f9dc,_0x450f11[_0xf716('0xf')]);_0x487275[_0xf716('0x11')]();}}}catch(_0x59a073){logger[_0xf716('0xc')](_0xf716('0xd'),_0x24f9dc,JSON[_0xf716('0x1c')](_0x59a073));_0x487275[_0xf716('0x11')]();}};};
\ No newline at end of file
+var _0x2c45=['rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','message','stringify','validate','lodash','html-to-text','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','fromString','replace','length','error','[%s][GOTOIF]\x20%s','map','stop','condition','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x2c45,0x1ae));var _0x52c4=function(_0x2c9f61,_0x1863df){_0x2c9f61=_0x2c9f61-0x0;var _0x25f1a3=_0x2c45[_0x2c9f61];return _0x25f1a3;};'use strict';var schema=require(_0x52c4('0x0'));var _=require(_0x52c4('0x1'));var htmlToText=require(_0x52c4('0x2'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x52c4('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x52c4('0x4')},'priorityTrue':{'type':_0x52c4('0x5'),'message':_0x52c4('0x6')},'priorityFalse':{'type':_0x52c4('0x5'),'message':_0x52c4('0x7')}});exports['consequence']=function(_0x530906,_0x2a51e8){return function(_0x5cce57){try{var _0x381949={'condition':htmlToText[_0x52c4('0x8')](utils['getMustacheRender'](_0x2a51e8[0x0],this),{'wordwrap':![]})[_0x52c4('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2a51e8[0x1],'priorityFalse':_0x2a51e8[0x2]};var _0x4d29c0=gotoif[_0x52c4('0x0')](_0x381949,{'typecast':!![]});if(_0x4d29c0[_0x52c4('0xa')]){logger[_0x52c4('0xb')](_0x52c4('0xc'),_0x530906,_[_0x52c4('0xd')](_0x4d29c0,'message')['join'](',\x20'));_0x5cce57[_0x52c4('0xe')]();}else{try{var _0x4080f5=eval('('+_0x381949[_0x52c4('0xf')]+')');var _0x2f4637=_0x4080f5?_0x381949['priorityTrue']:_0x381949[_0x52c4('0x10')];logger[_0x52c4('0x11')](_0x52c4('0x12'),_0x530906,_0x381949['condition'],_0x4080f5,_0x2f4637||_0x52c4('0x13'));if(_0x2f4637){var _0x1e33ae=_['findIndex'](_0x5cce57[_0x52c4('0x14')](),{'p':_0x2f4637});if(_0x1e33ae>=0x0){logger[_0x52c4('0x11')](_0x52c4('0x15'),_0x530906,_0x2f4637||_0x52c4('0x13'),_0x1e33ae);_0x5cce57[_0x52c4('0x13')](_0x1e33ae);}else{logger['info'](_0x52c4('0x16'),_0x530906,_0x2f4637||_0x52c4('0x13'));_0x5cce57[_0x52c4('0xe')]();}}else{_0x5cce57[_0x52c4('0x13')]();}}catch(_0x40350e){logger[_0x52c4('0xb')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x530906,_0x40350e[_0x52c4('0x17')]);_0x5cce57[_0x52c4('0xe')]();}}}catch(_0x3dac76){logger[_0x52c4('0xb')](_0x52c4('0xc'),_0x530906,JSON[_0x52c4('0x18')](_0x3dac76));_0x5cce57['stop']();}};};
\ No newline at end of file