OverviewFilesCommitsIssuesDocsReleasesPeers

holepunchto-deps / @holepunchto / keet-store / store / network / network.saga.js

1 lines · javascript ref:
(function(_0x1b7483,_0x1f6c87){const _0x4103d7={_0x4a18c6:0x37b,_0x5cc926:0x378,_0xdda575:0x37c,_0x45f9c:0x144,_0x23706a:0x37b,_0x5c1e77:0x36c,_0xadf530:0x366,_0x4a826d:0x379,_0x189fdd:0x367,_0x329745:0x164,_0x5588ff:0x15c,_0x1548d6:0x150,_0x28725f:0x153,_0x27c967:0x143,_0x516161:0x144,_0x1dba1e:0x140,_0x8bd505:0x148,_0x19cf1f:0x370,_0x5f4426:0x37f,_0x4b1db7:0x15e,_0x3a3928:0x14a,_0x2c3228:0x14f,_0x5dc81c:0x14f,_0x3df31b:0x152,_0x114613:0x360,_0x4df761:0x37e,_0x517e9b:0x36f,_0xe975e4:0x375},_0x163ac0={_0x959bec:0x7e},_0x397719={_0x43c5ae:0x1a5},_0x4b0c53=_0x1b7483();function _0x3f7e1e(_0x263842,_0x33fd48,_0x573909,_0x26c1a6){return _0x3770(_0x573909-_0x397719._0x43c5ae,_0x263842);}function _0x1cd8e4(_0x18dc9d,_0x39669b,_0x25935c,_0x56751d){return _0x3770(_0x56751d- -_0x163ac0._0x959bec,_0x25935c);}while(!![]){try{const _0x5b6560=parseInt(_0x3f7e1e(_0x4103d7._0x4a18c6,_0x4103d7._0x5cc926,0x370,_0x4103d7._0xdda575))/(0xd*-0x65+-0x58a+0xaac*0x1)*(parseInt(_0x1cd8e4(0x144,_0x4103d7._0x45f9c,0x144,0x144))/(0x2612+-0xa*0x149+-0x1936))+parseInt(_0x3f7e1e(0x35b,_0x4103d7._0x23706a,_0x4103d7._0x5c1e77,_0x4103d7._0xadf530))/(-0x2189+0xb08+-0xb*-0x20c)+parseInt(_0x3f7e1e(_0x4103d7._0x4a826d,_0x4103d7._0x189fdd,0x375,0x380))/(-0xe6e+0x1253*-0x1+-0x1*-0x20c5)+-parseInt(_0x1cd8e4(_0x4103d7._0x329745,_0x4103d7._0x5588ff,_0x4103d7._0x1548d6,_0x4103d7._0x28725f))/(-0x14e5+0x169f*0x1+-0x1*0x1b5)*(parseInt(_0x1cd8e4(_0x4103d7._0x27c967,_0x4103d7._0x516161,_0x4103d7._0x1dba1e,_0x4103d7._0x8bd505))/(0x2d4+0x1b17+-0x1de5))+parseInt(_0x3f7e1e(_0x4103d7._0x19cf1f,0x36b,0x371,_0x4103d7._0x5f4426))/(-0x1*-0xecd+-0x181*-0x17+-0x1*0x315d)+parseInt(_0x1cd8e4(_0x4103d7._0x4b1db7,_0x4103d7._0x3a3928,_0x4103d7._0x2c3228,_0x4103d7._0x5dc81c))/(-0x431+0x251*-0x3+0xb2c)*(parseInt(_0x1cd8e4(_0x4103d7._0x8bd505,_0x4103d7._0x8bd505,_0x4103d7._0x3df31b,_0x4103d7._0x1548d6))/(-0x1a3f*-0x1+0x2c*0x66+-0x2bbe))+-parseInt(_0x3f7e1e(_0x4103d7._0x114613,_0x4103d7._0x4df761,_0x4103d7._0x517e9b,_0x4103d7._0xe975e4))/(-0x9*-0x30c+-0xbdb*-0x2+-0x3318);if(_0x5b6560===_0x1f6c87)break;else _0x4b0c53['push'](_0x4b0c53['shift']());}catch(_0x2e9614){_0x4b0c53['push'](_0x4b0c53['shift']());}}}(_0x5736,0x1*-0x4604+0x1dc1*-0x27+0x7c80a));function _0x3770(_0x1686b3,_0x4c7094){const _0x22e7d8=_0x5736();return _0x3770=function(_0x4b9c46,_0x2d2f80){_0x4b9c46=_0x4b9c46-(0x32*0x1e+-0x23f1+0x1*0x1fcf);let _0x3a5e5c=_0x22e7d8[_0x4b9c46];return _0x3a5e5c;},_0x3770(_0x1686b3,_0x4c7094);}const _0x26cb57=(function(){let _0x40252b=!![];return function(_0x1a5b89,_0x1557ff){const _0x2ed057={_0x5dc1ad:0x435,_0x37c003:0x43a},_0x499bac=_0x40252b?function(){const _0x340bf5={_0x120e11:0x25c};function _0x138968(_0x2a8cae,_0x46db20,_0x47e16d,_0x5624ad){return _0x3770(_0x46db20-_0x340bf5._0x120e11,_0x47e16d);}if(_0x1557ff){const _0x38f426=_0x1557ff[_0x138968(0x441,_0x2ed057._0x5dc1ad,_0x2ed057._0x5dc1ad,_0x2ed057._0x37c003)](_0x1a5b89,arguments);return _0x1557ff=null,_0x38f426;}}:function(){};return _0x40252b=![],_0x499bac;};}()),_0x482084=_0x26cb57(this,function(){const _0x4505c2={_0x1bb028:0x2cc,_0x1f3986:0x2bb,_0x3c2bb5:0x2c2,_0x28974a:0x2b2,_0x437d0b:0x2c2,_0x26038b:0x2bf,_0xc9d554:0x2cf,_0x429e69:0x1f5,_0x160130:0x1ed,_0x5e0d58:0x1ed,_0x3e9351:0x1e9,_0x47e543:0x1e4,_0x3db0cc:0x1d9,_0x4e0b8e:0x1f6},_0x4b2519={_0x547831:0x3bf},_0x3ba56b={_0x1ae1c6:0x105};function _0x1525a8(_0x1c3c98,_0x2dfa9e,_0x4bf816,_0x311e09){return _0x3770(_0x2dfa9e-_0x3ba56b._0x1ae1c6,_0x4bf816);}function _0x6a2ca5(_0x22262f,_0x36f101,_0x1a03a8,_0x49e714){return _0x3770(_0x22262f- -_0x4b2519._0x547831,_0x49e714);}return _0x482084[_0x1525a8(0x2e0,0x2d9,_0x4505c2._0x1bb028,0x2e5)]()[_0x1525a8(_0x4505c2._0x1f3986,_0x4505c2._0x3c2bb5,_0x4505c2._0x28974a,_0x4505c2._0x437d0b)](_0x1525a8(_0x4505c2._0x437d0b,_0x4505c2._0x26038b,0x2cd,_0x4505c2._0xc9d554)+'+$')[_0x6a2ca5(-0x1eb,-_0x4505c2._0x429e69,-_0x4505c2._0x160130,-_0x4505c2._0x5e0d58)]()[_0x6a2ca5(-_0x4505c2._0x3e9351,-_0x4505c2._0x47e543,-_0x4505c2._0x3db0cc,-_0x4505c2._0x4e0b8e)+'r'](_0x482084)['search']('(((.+)+)+)'+'+$');});_0x482084();import{fork,cancel,delay,spawn,put,select,takeLeading,getContext}from'redux-saga/effects';import{getCoreBackend,getNetworkBackend}from'../../backend';import{apiCall}from'../../api/core';import{APP_CONTEXT_KEY}from'../constants';import{apiSubscribeSaga}from'../lib';import{taskErrorSaga}from'../error';import{setNetworkData,setNetworkSettings,setNetworkSettingsDefault,loadNetworkSettings,updateNetworkSettings,getNetworkConfig,getNetworkStatusState}from'./network.reducer';import{calcNetworkStatus,isNetworkStatusChanged}from'./network.model';import{userInfoNotification}from'../notification';function*networkSettingsLoadSaga(){const _0x10dbcf={_0x4ea0dd:0x4b7,_0xb53e6:0x4c3,_0x19f562:0xb3,_0xb69718:0xa4,_0x142bd8:0xaa},_0x3feb58={_0xc2f6c1:0x26f},_0x157056={_0x43549d:0x2e5},{network:_0x5cadd9}=yield getContext(APP_CONTEXT_KEY);function _0x519b15(_0x5caab0,_0x57ea26,_0x465e19,_0x1a8577){return _0x3770(_0x1a8577-_0x157056._0x43549d,_0x57ea26);}yield put(setNetworkSettingsDefault(_0x5cadd9[_0x519b15(0x4af,_0x10dbcf._0x4ea0dd,_0x10dbcf._0xb53e6,_0x10dbcf._0x4ea0dd)+'s']));const _0x1bc098=getCoreBackend();function _0x151f01(_0x1e40fc,_0x5309c4,_0x501f28,_0x27da74){return _0x3770(_0x1e40fc- -_0x3feb58._0xc2f6c1,_0x5309c4);}const _0x37c7a6=yield apiCall(_0x1bc098[_0x151f01(-0xb0,-_0x10dbcf._0x19f562,-_0x10dbcf._0xb69718,-_0x10dbcf._0x142bd8)+'ings']);yield put(setNetworkSettings(_0x37c7a6));}function _0x5736(){const _0x337d35=['apply','concurrenc','(((.+)+)+)','\x20Keet\x20is\x20r','KeepAlive','search','query','getDHTSett','\x20only\x20in\x20e','networkSta','12EBZLqx','maxWindow','tusSaga','now','6bBIeyA','1020294vebKym','updateDHTS','connection','7610950MjVGPm','38723liZUuF','1551879vCosjj','2205816QTrQSP','9Wqzpzu','ffect\x20when','647164PcXxpQ','1377905nFsKRm','dhtSetting','hInterval','toString','isRunning','constructo','networkSet','ettings'];_0x5736=function(){return _0x337d35;};return _0x5736();}function*networkSettingsUpdateSaga({payload:_0x290275}){const _0x408a9e={_0x46ffb7:0x35c,_0x52c77c:0x35e,_0x29731a:0x358,_0x2a5d88:0x36c,_0xbf9c87:0x362,_0x39c487:0x36c,_0x5ac6fa:0x372,_0x43d145:0x585,_0x2dd1f9:0x584,_0x375eaa:0x59f,_0x53cef7:0x5b0,_0x54b5a1:0x5a4,_0x48e898:0x594,_0x541942:0x357,_0x528eba:0x35a,_0x5927c0:0x34e,_0x25caba:0x355,_0xa510d:0x372,_0x57a1d6:0x371,_0x1d5528:0x366,_0x292c9f:0x35d,_0x2696ad:0x356,_0x2c1be9:0x5ae,_0x276d70:0x591,_0x5dd1db:0x595,_0x567403:0x590,_0x324861:0x350,_0x6e1c36:0x360,_0x136dd9:0x352,_0x38ab5e:0x582,_0x31e389:0x58c,_0x44cb8a:0x597,_0x2eb2d6:0x363,_0x23427c:0x36a,_0x7be88a:0x364,_0x429728:0x373,_0x58f26b:0x598,_0xaf338:0x587,_0x4240af:0x592,_0x11fb0e:0x57d,_0x359ae8:0x5a3,_0x43bedd:0x5a1},_0x1aca38={_0x385738:0x3cc};function _0x18176d(_0x517527,_0x1190e2,_0x591e69,_0x43e2ca){return _0x3770(_0x1190e2-_0x1aca38._0x385738,_0x43e2ca);}function _0x5270ec(_0xbd5701,_0x1d6200,_0x2c63f4,_0xf20cdc){return _0x3770(_0xbd5701-0x194,_0xf20cdc);}try{const {concurrency:_0x52bacc,maxWindow:_0x45ea4b,randomPunchInterval:_0x93f948,connectionKeepAlive:_0xd794c2}=_0x290275,_0x423bcb=getCoreBackend();yield apiCall(_0x423bcb[_0x5270ec(_0x408a9e._0x46ffb7,_0x408a9e._0x52c77c,_0x408a9e._0x29731a,0x36b)+_0x5270ec(_0x408a9e._0x2a5d88,0x35e,_0x408a9e._0xbf9c87,_0x408a9e._0x39c487)],_0x5270ec(0x36e,_0x408a9e._0x5ac6fa,0x366,_0x408a9e._0x39c487)+'y',_0x52bacc),yield apiCall(_0x423bcb[_0x18176d(_0x408a9e._0x43d145,0x594,_0x408a9e._0x2dd1f9,_0x408a9e._0x375eaa)+_0x18176d(_0x408a9e._0x53cef7,_0x408a9e._0x54b5a1,_0x408a9e._0x48e898,_0x408a9e._0x375eaa)],_0x5270ec(_0x408a9e._0x541942,_0x408a9e._0x528eba,_0x408a9e._0x5927c0,_0x408a9e._0x528eba),_0x45ea4b),yield apiCall(_0x423bcb[_0x5270ec(_0x408a9e._0x46ffb7,_0x408a9e._0x25caba,_0x408a9e._0x39c487,0x364)+'ettings'],'randomPunc'+_0x5270ec(0x367,_0x408a9e._0xa510d,_0x408a9e._0x57a1d6,_0x408a9e._0x1d5528),_0x93f948),yield apiCall(_0x423bcb[_0x5270ec(0x35c,_0x408a9e._0x292c9f,_0x408a9e._0x2696ad,0x367)+_0x18176d(_0x408a9e._0x54b5a1,0x5a4,0x59a,_0x408a9e._0x2c1be9)],_0x18176d(_0x408a9e._0x276d70,_0x408a9e._0x5dd1db,0x58e,_0x408a9e._0x567403)+_0x5270ec(_0x408a9e._0x324861,_0x408a9e._0x6e1c36,0x352,_0x408a9e._0x136dd9),_0xd794c2),yield put(userInfoNotification({'message':'New\x20values'+_0x18176d(_0x408a9e._0x38ab5e,_0x408a9e._0x31e389,0x589,_0x408a9e._0x44cb8a)+_0x5270ec(_0x408a9e._0x2eb2d6,_0x408a9e._0x23427c,_0x408a9e._0x7be88a,_0x408a9e._0x429728)+_0x18176d(_0x408a9e._0x58f26b,_0x408a9e._0xaf338,_0x408a9e._0x4240af,_0x408a9e._0x11fb0e)+'estarted'}));}catch(_0x1479d3){yield taskErrorSaga(_0x18176d(0x598,_0x408a9e._0x359ae8,_0x408a9e._0x43bedd,0x59b)+'tingsUpdat'+'eSaga',_0x1479d3);}}export function*networkStatusSaga(){const _0x54639b={_0x60a282:0x394,_0x1caf83:0x393,_0x1235fa:0x38d,_0x8a29db:0x382},_0x5a329b={_0x3b82d0:0x32b,_0x5cbb7c:0x330,_0x5ecf04:0x323,_0x5140cd:0x33c,_0x5855f0:0x143,_0x41ecac:0x149},_0x438939={_0x3b55f4:0x15b},_0x3041a3={_0x433fa9:0x198,_0x112f6f:0x19c},_0x5750e3={_0x15f125:0x36b},_0x2f71ce={_0x49578a:0x1cd},_0x3bd220={_0x422bd0:0x206,_0x597cbb:0x1fe},_0x435c85=getNetworkBackend();function _0x417dab(){const _0x48dc3c={_0x1505aa:0x3c0};function _0x49aea2(_0x70a9be,_0x40c9e6,_0x342cad,_0xd8f07c){return _0x3770(_0x40c9e6- -_0x48dc3c._0x1505aa,_0xd8f07c);}return _0x435c85[_0x49aea2(-0x20f,-0x202,-_0x3bd220._0x422bd0,-_0x3bd220._0x597cbb)]();}let _0x1a69d1=yield apiCall(_0x417dab);function _0x93463(_0x31ddbd,_0x40f52a,_0x3e1afd,_0x590d97){return _0x3770(_0x40f52a-0x1be,_0x3e1afd);}yield put(setNetworkData(_0x1a69d1));let _0x43442a=-0xc15+-0x126d+0x1e82;function _0x373fc4(_0x54a31c,_0x4fd714,_0x4ecc59,_0x3598f0){return _0x3770(_0x54a31c-_0x2f71ce._0x49578a,_0x3598f0);}let _0x389650=null;function*_0x77674e(){const _0x8bfdd4=yield select(getNetworkStatusState);function _0x3c04d3(_0x4ff163,_0x4f7e51,_0x3a629c,_0x18651e){return _0x3770(_0x3a629c- -_0x5750e3._0x15f125,_0x18651e);}isNetworkStatusChanged(_0x8bfdd4,_0x1a69d1)&&(yield put(setNetworkData(_0x1a69d1)),_0x43442a=Date[_0x3c04d3(-_0x3041a3._0x433fa9,-_0x3041a3._0x112f6f,-0x1a6,-0x1a9)]());}function _0x27fae1(){return _0x435c85['subscribe']();}try{yield apiSubscribeSaga([_0x27fae1],function*_0x436a4e(_0x244359){function _0xfe9c43(_0x1f0333,_0x2307d1,_0x368792,_0x299d92){return _0x3770(_0x2307d1-_0x438939._0x3b55f4,_0x368792);}_0x1a69d1=_0x244359;const _0x1ec36a=yield select(getNetworkStatusState),_0x57ccbc=calcNetworkStatus(_0x1ec36a)!==calcNetworkStatus(_0x1a69d1);if(_0x57ccbc){_0x389650?.[_0xfe9c43(_0x5a329b._0x3b82d0,_0x5a329b._0x5cbb7c,_0x5a329b._0x5ecf04,_0x5a329b._0x5140cd)]()&&(yield cancel(_0x389650));yield _0x77674e();return;}if(_0x389650?.[_0x5aa4a9(0x145,0x136,_0x5a329b._0x5855f0,_0x5a329b._0x41ecac)]())return;function _0x5aa4a9(_0x2b9925,_0x3a18ca,_0x263e05,_0x57e692){return _0x3770(_0x2b9925- -0x90,_0x263e05);}_0x389650=yield spawn(function*_0x18dc18(){const {NETWORK_UPDATE_DURATION:_0x386cbf}=yield select(getNetworkConfig),_0xcd2ecf=_0x43442a+_0x386cbf-Date['now']();_0xcd2ecf>0x6a+0x1*-0x17b1+-0x65*-0x3b&&(yield delay(_0xcd2ecf)),yield _0x77674e();});},{'onError':_0x58e035=>taskErrorSaga(_0x93463(0x372,0x37f,0x38e,0x385)+_0x373fc4(0x391,0x398,0x389,0x387),_0x58e035)});}finally{_0x389650?.[_0x93463(_0x54639b._0x60a282,_0x54639b._0x1caf83,_0x54639b._0x1235fa,_0x54639b._0x8a29db)]()&&(yield cancel(_0x389650));}}export function*networkSaga(){yield fork(networkStatusSaga),yield takeLeading(loadNetworkSettings,networkSettingsLoadSaga),yield takeLeading(updateNetworkSettings,networkSettingsUpdateSaga);}