Built motion from commit 8dca541896b0ff92bb88a36cc13f4f385b593b4b. Version 3.0.0...
[motion-next.git] / server / services / agi / graph / index.js
1 const a1028_0x5c64=['includes','traverseBFS','stop\x20traverse','no\x20vertex\x20found','lodash','invalid','numberOfEdges','condition\x20not\x20found','vertices','vswitch','default\x20on\x20switch\x20not\x20found','info','agicommand','addVertex','addEdge','target','relations','size','edges','split','max\x20retry\x20reach','condition','getdigits','exports','no\x20edge/s\x20available','menu','length','prototype','push'];(function(_0x186a97,_0x5c6443){const _0x55db1b=function(_0x53e201){while(--_0x53e201){_0x186a97['push'](_0x186a97['shift']());}};_0x55db1b(++_0x5c6443);}(a1028_0x5c64,0xc5));const a1028_0x55db=function(_0x186a97,_0x5c6443){_0x186a97=_0x186a97-0x0;let _0x55db1b=a1028_0x5c64[_0x186a97];return _0x55db1b;};const _0x32e331=a1028_0x55db;'use strict';const _=require(_0x32e331('0xa')),logger=require('../../../config/logger')('agi'),verticesWithRetry=['menu',_0x32e331('0x1c'),'getsecretdigits'],Graph=function(){const _0x27e80b=_0x32e331;this[_0x27e80b('0xe')]={},this[_0x27e80b('0x18')]={},this['numberOfEdges']=0x0;};Graph[_0x32e331('0x4')][_0x32e331('0x13')]=function(_0x53e201){const _0x44876a=_0x32e331;this[_0x44876a('0xe')][_0x53e201['id']]=_0x53e201,this[_0x44876a('0x18')][_0x53e201['id']]=[];},Graph['prototype'][_0x32e331('0x14')]=function(_0x41739d,_0x16477d,_0x57171e){const _0x200466=_0x32e331;this[_0x200466('0x18')][_0x41739d][_0x200466('0x5')]({'target':_0x16477d,'condition':_0x57171e}),this[_0x200466('0xc')]+=0x1;},Graph[_0x32e331('0x4')][_0x32e331('0x17')]=function(){const _0x5b9cce=_0x32e331;return _['size'](this[_0x5b9cce('0xe')]);},Graph[_0x32e331('0x4')][_0x32e331('0x16')]=function(){const _0x6cbb39=_0x32e331;return this[_0x6cbb39('0xc')];},Graph['prototype']['getVertex']=function(_0x5449f0){const _0x299234=_0x32e331;return this[_0x299234('0xe')][_0x5449f0];},Graph['prototype'][_0x32e331('0x7')]=function(_0x18d60c,_0x1e25f2){const _0x52e4aa=_0x32e331;if(!this[_0x52e4aa('0xe')][_0x18d60c])return logger[_0x52e4aa('0x11')](_0x52e4aa('0x9'));const _0x57b06b=_0x1e25f2(this[_0x52e4aa('0xe')][_0x18d60c]);if(!_0x57b06b)return logger[_0x52e4aa('0x11')](_0x52e4aa('0x8'));if(this['edges'][_0x18d60c]['length']===0x0)return logger[_0x52e4aa('0x11')](_0x52e4aa('0x1'));const _0x5c7610=![],_0x2e0444=[];for(let _0x2cf0da=0x0,_0x4b59b6=[],_0x5518f0=![];_0x2cf0da<this[_0x52e4aa('0x18')][_0x18d60c][_0x52e4aa('0x3')];_0x2cf0da+=0x1){if(this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da][_0x52e4aa('0x1b')]){_0x4b59b6=this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da][_0x52e4aa('0x1b')][_0x52e4aa('0x19')](',');for(let _0x1d2ad1=0x0;_0x1d2ad1<_0x4b59b6[_0x52e4aa('0x3')];_0x1d2ad1+=0x1){if(this['vertices'][_0x18d60c]['agicommand']===_0x52e4aa('0xf')&&_0x4b59b6[_0x1d2ad1]==='-')_0x5518f0=this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da][_0x52e4aa('0x15')],logger[_0x52e4aa('0x11')]('default',_0x5518f0,_0x4b59b6[_0x1d2ad1],this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da]['target']);else this[_0x52e4aa('0xe')][_0x18d60c][_0x52e4aa('0x12')]===_0x52e4aa('0x2')&&_0x4b59b6[_0x1d2ad1]==='i'&&(_0x5518f0=this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da][_0x52e4aa('0x15')],logger[_0x52e4aa('0x11')](_0x52e4aa('0xb'),_0x5518f0,_0x4b59b6[_0x1d2ad1],this['edges'][_0x18d60c][_0x2cf0da]['target']));if(_0x4b59b6[_0x1d2ad1]===_0x57b06b)return this[_0x52e4aa('0x7')](this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da][_0x52e4aa('0x15')],_0x1e25f2);}}else return this[_0x52e4aa('0x7')](this[_0x52e4aa('0x18')][_0x18d60c][_0x2cf0da]['target'],_0x1e25f2);}if(_0x2e0444[_0x52e4aa('0x3')]){if(this['vertices'][_0x18d60c][_0x52e4aa('0x12')]===_0x52e4aa('0xf')){if(_0x5c7610)return this['traverseBFS'](_0x5c7610,_0x1e25f2);return logger[_0x52e4aa('0x11')](_0x52e4aa('0x10'));}else{if(_[_0x52e4aa('0x6')](verticesWithRetry,this[_0x52e4aa('0xe')][_0x18d60c][_0x52e4aa('0x12')])){if(_0x57b06b==='-')return logger[_0x52e4aa('0x11')](_0x52e4aa('0x1a'));if(_0x5c7610&&_0x57b06b!=='t')return this['traverseBFS'](_0x5c7610,_0x1e25f2);return this[_0x52e4aa('0x7')](_0x18d60c,_0x1e25f2);}}return logger[_0x52e4aa('0x11')](_0x52e4aa('0xd'));}},module[_0x32e331('0x0')]=Graph;