Built motion from commit 5fcd269f5146f10cf3129722d518881dfac64576. Version 3.0.0...
[motion-next.git] / server / services / routing / lib / rule-engine.js
index 53b79a7..186095b 100644 (file)
@@ -1 +1 @@
-const a1163_0x54a5=['noop','priority','push','exports','matchPath','isArray','matches','sync','condition','index_','filter','isString','prototype','toJSON','isNil','ignoreFactChanges','restart','ruleRef','rules','prioritize','isObject','EventEmitter','call','parse','toString','length','object','next','lodash','init','findRules','inherits','register','activeRules','clone','nextTick','result','map','consequence','turn','isEqual','fromJSON','asc'];(function(_0x37b7cc,_0x54a51a){const _0x821010=function(_0x5209b7){while(--_0x5209b7){_0x37b7cc['push'](_0x37b7cc['shift']());}};_0x821010(++_0x54a51a);}(a1163_0x54a5,0x17c));const a1163_0x8210=function(_0x37b7cc,_0x54a51a){_0x37b7cc=_0x37b7cc-0x0;let _0x821010=a1163_0x54a5[_0x37b7cc];return _0x821010;};const _0x4ccd47=a1163_0x8210;'use strict';const _=require(_0x4ccd47('0x23')),util=require('util'),EventEmitter=require('events')[_0x4ccd47('0x1c')];function RuleEngine(_0x5209b7,_0x1239d0){const _0x33ebf5=_0x4ccd47;return this[_0x33ebf5('0x24')](),!_[_0x33ebf5('0x15')](_0x5209b7)&&this[_0x33ebf5('0x27')](_0x5209b7),_0x1239d0&&(this['ignoreFactChanges']=_0x1239d0[_0x33ebf5('0x16')]),this;}util[_0x4ccd47('0x26')](RuleEngine,EventEmitter),RuleEngine[_0x4ccd47('0x13')]['init']=function(){const _0x51ad94=_0x4ccd47;this[_0x51ad94('0x19')]=[],this[_0x51ad94('0x28')]=[];},RuleEngine['prototype'][_0x4ccd47('0x27')]=function(_0x401a10){const _0x341b30=_0x4ccd47;if(Array[_0x341b30('0xc')](_0x401a10))this[_0x341b30('0x19')]=this[_0x341b30('0x19')]['concat'](_0x401a10);else _0x401a10!==null&&_[_0x341b30('0x1b')](_0x401a10)&&this['rules'][_0x341b30('0x9')](_0x401a10);this[_0x341b30('0xe')]();},RuleEngine[_0x4ccd47('0x13')][_0x4ccd47('0xe')]=function(){const _0x598216=_0x4ccd47;this[_0x598216('0x28')]=this[_0x598216('0x19')][_0x598216('0x11')](function(_0x52b356){_['isNil'](_0x52b356['on'])&&(_0x52b356['on']=!![]);if(_0x52b356['on']===!![])return _0x52b356;}),this[_0x598216('0x28')]=_['orderBy'](this['activeRules'],['p'],[_0x598216('0x6')]);},RuleEngine['prototype']['execute']=function(_0x394a39,_0x1167f9){const _0x4f5c4d=_0x4ccd47;let _0x5cacaa=![];_0x394a39[_0x4f5c4d('0x0')]=!![];const _0x3ca879=_[_0x4f5c4d('0x29')](_0x394a39);let _0x1d6e24=_[_0x4f5c4d('0x29')](_0x394a39);const _0x3b48c7=this[_0x4f5c4d('0x28')],_0x32d115=[],_0x5e7800=this[_0x4f5c4d('0x16')];(function _0xcdaf58(_0x2e91c9){const _0x14a659=_0x4f5c4d,_0x8e804f={'rules':function(){return _0x3b48c7;},'rule':function(){return _0x3b48c7[_0x2e91c9];},'when':function(_0x45a1f8){const _0x5a63b0=a1163_0x8210;if(_0x45a1f8){const _0x31eabf=_0x3b48c7[_0x2e91c9][_0x5a63b0('0x2')];_0x31eabf[_0x5a63b0('0x18')]=_0x3b48c7[_0x2e91c9]['id']||_0x3b48c7[_0x2e91c9]['name']||_0x5a63b0('0x10')+_0x2e91c9,process[_0x5a63b0('0x2a')](function(){const _0x3f70ef=_0x5a63b0;_0x32d115[_0x3f70ef('0x9')](_0x31eabf[_0x3f70ef('0x18')]),_0x31eabf[_0x3f70ef('0x1d')](_0x3ca879,_0x8e804f);});}else process['nextTick'](function(){const _0x8871c9=_0x5a63b0;_0x8e804f[_0x8871c9('0x22')]();});},'restart':function(){return _0xcdaf58(0x0);},'stop':function(){return _0x5cacaa=!![],_0xcdaf58(0x0);},'next':function(_0xcdc565){const _0x5443ec=a1163_0x8210;!_0x5e7800&&!_[_0x5443ec('0x4')](_0x1d6e24,_0x3ca879)?(_0x1d6e24=_[_0x5443ec('0x29')](_0x3ca879),process[_0x5443ec('0x2a')](function(){const _0x52cb00=_0x5443ec;_0x8e804f[_0x52cb00('0x17')]();})):process[_0x5443ec('0x2a')](function(){return _['isNil'](_0xcdc565)?_0xcdaf58(_0x2e91c9+0x1):_0xcdaf58(_0xcdc565);});}};if(_0x2e91c9<_0x3b48c7[_0x14a659('0x20')]&&_0x5cacaa===![]){const _0x4ed22f=_0x3b48c7[_0x2e91c9][_0x14a659('0xf')];_0x4ed22f[_0x14a659('0x1d')](_0x3ca879,_0x8e804f);}else process[_0x14a659('0x2a')](function(){const _0x124847=_0x14a659;return _0x3ca879[_0x124847('0xb')]=_0x32d115,_0x1167f9?_0x1167f9(_0x3ca879):_[_0x124847('0x7')]();});}(0x0));},RuleEngine[_0x4ccd47('0x13')][_0x4ccd47('0x25')]=function(_0xf221e7){const _0x59a67c=_0x4ccd47;if(_[_0x59a67c('0x15')](_0xf221e7))return this['rules'];else{const _0x216fdc=_[_0x59a67c('0xd')](_0xf221e7);return _[_0x59a67c('0x11')](this[_0x59a67c('0x19')],_0x216fdc);}},RuleEngine[_0x4ccd47('0x13')][_0x4ccd47('0x3')]=function(_0x481208,_0x3283ea){const _0x101479=_0x4ccd47,_0x4f5e73=_0x481208==='on'||_0x481208==='ON'?!![]:![],_0x12f03a=this[_0x101479('0x25')](_0x3283ea);for(let _0x4ef9d0=0x0,_0x37bb0e=_0x12f03a[_0x101479('0x20')];_0x4ef9d0<_0x37bb0e;_0x4ef9d0+=0x1){_0x12f03a[_0x4ef9d0]['on']=_0x4f5e73;}this['sync']();},RuleEngine[_0x4ccd47('0x13')][_0x4ccd47('0x1a')]=function(_0x43fc23,_0x5ed2f7){const _0x583f8a=_0x4ccd47;_0x43fc23=parseInt(_0x43fc23,0xa);const _0x2c935e=this[_0x583f8a('0x25')](_0x5ed2f7);for(let _0x2ce971=0x0,_0x3beab1=_0x2c935e[_0x583f8a('0x20')];_0x2ce971<_0x3beab1;_0x2ce971+=0x1){_0x2c935e[_0x2ce971][_0x583f8a('0x8')]=_0x43fc23;}this[_0x583f8a('0xe')]();},RuleEngine[_0x4ccd47('0x13')][_0x4ccd47('0x14')]=function(){const _0x2be7f7=_0x4ccd47;let _0x26af82=this[_0x2be7f7('0x19')];if(_0x26af82 instanceof Array)_0x26af82=_0x26af82['map'](function(_0x3eba9a){const _0x34825e=_0x2be7f7;return _0x3eba9a['condition']=_0x3eba9a[_0x34825e('0xf')][_0x34825e('0x1f')](),_0x3eba9a[_0x34825e('0x2')]=_0x3eba9a[_0x34825e('0x2')][_0x34825e('0x1f')](),_0x3eba9a;});else!_['isNil'](_0x26af82)&&(_0x26af82[_0x2be7f7('0xf')]=_0x26af82[_0x2be7f7('0xf')][_0x2be7f7('0x1f')](),_0x26af82[_0x2be7f7('0x2')]=_0x26af82[_0x2be7f7('0x2')]['toString']());return _0x26af82;},RuleEngine[_0x4ccd47('0x13')][_0x4ccd47('0x5')]=function(_0x3789ab){const _0x4b0dc6=_0x4ccd47;this[_0x4b0dc6('0x24')]();_[_0x4b0dc6('0x12')](_0x3789ab)&&(_0x3789ab=JSON[_0x4b0dc6('0x1e')](_0x3789ab));if(_0x3789ab instanceof Array)_0x3789ab=_0x3789ab[_0x4b0dc6('0x1')](function(_0xe4d9ff){const _0x521f9a=_0x4b0dc6;return _0xe4d9ff[_0x521f9a('0xf')]=eval('('+_0xe4d9ff['condition']+')'),_0xe4d9ff[_0x521f9a('0x2')]=eval('('+_0xe4d9ff[_0x521f9a('0x2')]+')'),_0xe4d9ff;});else _0x3789ab!==null&&typeof _0x3789ab==_0x4b0dc6('0x21')&&(_0x3789ab[_0x4b0dc6('0xf')]=eval('('+_0x3789ab[_0x4b0dc6('0xf')]+')'),_0x3789ab[_0x4b0dc6('0x2')]=eval('('+_0x3789ab['consequence']+')'));this[_0x4b0dc6('0x27')](_0x3789ab);},module[_0x4ccd47('0xa')]=RuleEngine;
\ No newline at end of file
+const a1163_0x3698=['ignoreFactChanges','inherits','rules','toString','orderBy','result','name','findRules','call','condition','matchPath','prototype','prioritize','consequence','isString','noop','isNil','execute','matches','sync','ruleRef','next','clone','nextTick','asc','filter','init','map','push','object','EventEmitter','priority','exports','register','lodash','isObject','turn','activeRules','length','toJSON'];(function(_0x820e61,_0x3698fd){const _0x5f3eac=function(_0x2a4b9e){while(--_0x2a4b9e){_0x820e61['push'](_0x820e61['shift']());}};_0x5f3eac(++_0x3698fd);}(a1163_0x3698,0x170));const a1163_0x5f3e=function(_0x820e61,_0x3698fd){_0x820e61=_0x820e61-0x0;let _0x5f3eac=a1163_0x3698[_0x820e61];return _0x5f3eac;};const _0x2e7698=a1163_0x5f3e;'use strict';const _=require(_0x2e7698('0x1a')),util=require('util'),EventEmitter=require('events')[_0x2e7698('0x16')];function RuleEngine(_0x2a4b9e,_0x355b11){const _0x1731cb=_0x2e7698;return this['init'](),!_[_0x1731cb('0x8')](_0x2a4b9e)&&this[_0x1731cb('0x19')](_0x2a4b9e),_0x355b11&&(this[_0x1731cb('0x20')]=_0x355b11['ignoreFactChanges']),this;}util[_0x2e7698('0x21')](RuleEngine,EventEmitter),RuleEngine[_0x2e7698('0x3')]['init']=function(){const _0x26a650=_0x2e7698;this[_0x26a650('0x22')]=[],this['activeRules']=[];},RuleEngine[_0x2e7698('0x3')][_0x2e7698('0x19')]=function(_0x1b5d5f){const _0x4028b1=_0x2e7698;if(Array['isArray'](_0x1b5d5f))this[_0x4028b1('0x22')]=this['rules']['concat'](_0x1b5d5f);else _0x1b5d5f!==null&&_[_0x4028b1('0x1b')](_0x1b5d5f)&&this[_0x4028b1('0x22')][_0x4028b1('0x14')](_0x1b5d5f);this[_0x4028b1('0xb')]();},RuleEngine[_0x2e7698('0x3')][_0x2e7698('0xb')]=function(){const _0x2b1463=_0x2e7698;this[_0x2b1463('0x1d')]=this[_0x2b1463('0x22')][_0x2b1463('0x11')](function(_0xf45b17){_['isNil'](_0xf45b17['on'])&&(_0xf45b17['on']=!![]);if(_0xf45b17['on']===!![])return _0xf45b17;}),this[_0x2b1463('0x1d')]=_[_0x2b1463('0x24')](this['activeRules'],['p'],[_0x2b1463('0x10')]);},RuleEngine[_0x2e7698('0x3')][_0x2e7698('0x9')]=function(_0x1cc397,_0x41fa17){const _0x4bddfb=_0x2e7698;let _0x1e5586=![];_0x1cc397[_0x4bddfb('0x25')]=!![];const _0x446009=_[_0x4bddfb('0xe')](_0x1cc397);let _0xdee694=_[_0x4bddfb('0xe')](_0x1cc397);const _0x1d38b8=this[_0x4bddfb('0x1d')],_0xbfff68=[],_0x28d462=this[_0x4bddfb('0x20')];(function _0x7d7c99(_0xed5850){const _0x18ea05=_0x4bddfb,_0x5405d1={'rules':function(){return _0x1d38b8;},'rule':function(){return _0x1d38b8[_0xed5850];},'when':function(_0x2bdf40){const _0x181957=a1163_0x5f3e;if(_0x2bdf40){const _0x1f6a93=_0x1d38b8[_0xed5850][_0x181957('0x5')];_0x1f6a93[_0x181957('0xc')]=_0x1d38b8[_0xed5850]['id']||_0x1d38b8[_0xed5850][_0x181957('0x26')]||'index_'+_0xed5850,process[_0x181957('0xf')](function(){const _0x5a8b76=_0x181957;_0xbfff68[_0x5a8b76('0x14')](_0x1f6a93[_0x5a8b76('0xc')]),_0x1f6a93[_0x5a8b76('0x0')](_0x446009,_0x5405d1);});}else process[_0x181957('0xf')](function(){const _0x4dd164=_0x181957;_0x5405d1[_0x4dd164('0xd')]();});},'restart':function(){return _0x7d7c99(0x0);},'stop':function(){return _0x1e5586=!![],_0x7d7c99(0x0);},'next':function(_0x5b9efa){const _0x3240a8=a1163_0x5f3e;!_0x28d462&&!_['isEqual'](_0xdee694,_0x446009)?(_0xdee694=_[_0x3240a8('0xe')](_0x446009),process[_0x3240a8('0xf')](function(){_0x5405d1['restart']();})):process[_0x3240a8('0xf')](function(){const _0x5ce685=_0x3240a8;return _[_0x5ce685('0x8')](_0x5b9efa)?_0x7d7c99(_0xed5850+0x1):_0x7d7c99(_0x5b9efa);});}};if(_0xed5850<_0x1d38b8['length']&&_0x1e5586===![]){const _0x3f0bb0=_0x1d38b8[_0xed5850][_0x18ea05('0x1')];_0x3f0bb0[_0x18ea05('0x0')](_0x446009,_0x5405d1);}else process[_0x18ea05('0xf')](function(){const _0x1328ba=_0x18ea05;return _0x446009[_0x1328ba('0x2')]=_0xbfff68,_0x41fa17?_0x41fa17(_0x446009):_[_0x1328ba('0x7')]();});}(0x0));},RuleEngine[_0x2e7698('0x3')][_0x2e7698('0x27')]=function(_0x51c67e){const _0x2535bf=_0x2e7698;if(_[_0x2535bf('0x8')](_0x51c67e))return this[_0x2535bf('0x22')];else{const _0xf49009=_[_0x2535bf('0xa')](_0x51c67e);return _[_0x2535bf('0x11')](this['rules'],_0xf49009);}},RuleEngine[_0x2e7698('0x3')][_0x2e7698('0x1c')]=function(_0x228b51,_0x5a1dad){const _0x285d9f=_0x2e7698,_0x107e2f=_0x228b51==='on'||_0x228b51==='ON'?!![]:![],_0x4dca4c=this['findRules'](_0x5a1dad);for(let _0x21cacb=0x0,_0x4f0f80=_0x4dca4c[_0x285d9f('0x1e')];_0x21cacb<_0x4f0f80;_0x21cacb+=0x1){_0x4dca4c[_0x21cacb]['on']=_0x107e2f;}this[_0x285d9f('0xb')]();},RuleEngine['prototype'][_0x2e7698('0x4')]=function(_0x42419d,_0x2a16ef){const _0x6ad79f=_0x2e7698;_0x42419d=parseInt(_0x42419d,0xa);const _0xf54df1=this[_0x6ad79f('0x27')](_0x2a16ef);for(let _0x28fcec=0x0,_0x4d3aec=_0xf54df1[_0x6ad79f('0x1e')];_0x28fcec<_0x4d3aec;_0x28fcec+=0x1){_0xf54df1[_0x28fcec][_0x6ad79f('0x17')]=_0x42419d;}this[_0x6ad79f('0xb')]();},RuleEngine[_0x2e7698('0x3')][_0x2e7698('0x1f')]=function(){const _0x221d8f=_0x2e7698;let _0xfc96d1=this[_0x221d8f('0x22')];if(_0xfc96d1 instanceof Array)_0xfc96d1=_0xfc96d1[_0x221d8f('0x13')](function(_0x323cb6){const _0x4309b8=_0x221d8f;return _0x323cb6[_0x4309b8('0x1')]=_0x323cb6[_0x4309b8('0x1')][_0x4309b8('0x23')](),_0x323cb6[_0x4309b8('0x5')]=_0x323cb6['consequence'][_0x4309b8('0x23')](),_0x323cb6;});else!_[_0x221d8f('0x8')](_0xfc96d1)&&(_0xfc96d1[_0x221d8f('0x1')]=_0xfc96d1[_0x221d8f('0x1')][_0x221d8f('0x23')](),_0xfc96d1[_0x221d8f('0x5')]=_0xfc96d1[_0x221d8f('0x5')][_0x221d8f('0x23')]());return _0xfc96d1;},RuleEngine['prototype']['fromJSON']=function(_0x4fbeee){const _0x3994e0=_0x2e7698;this[_0x3994e0('0x12')]();_[_0x3994e0('0x6')](_0x4fbeee)&&(_0x4fbeee=JSON['parse'](_0x4fbeee));if(_0x4fbeee instanceof Array)_0x4fbeee=_0x4fbeee[_0x3994e0('0x13')](function(_0x3162ba){const _0x245b70=_0x3994e0;return _0x3162ba['condition']=eval('('+_0x3162ba[_0x245b70('0x1')]+')'),_0x3162ba[_0x245b70('0x5')]=eval('('+_0x3162ba[_0x245b70('0x5')]+')'),_0x3162ba;});else _0x4fbeee!==null&&typeof _0x4fbeee==_0x3994e0('0x15')&&(_0x4fbeee[_0x3994e0('0x1')]=eval('('+_0x4fbeee[_0x3994e0('0x1')]+')'),_0x4fbeee[_0x3994e0('0x5')]=eval('('+_0x4fbeee[_0x3994e0('0x5')]+')'));this[_0x3994e0('0x19')](_0x4fbeee);},module[_0x2e7698('0x18')]=RuleEngine;
\ No newline at end of file