plugin.js 11 KB

1
  1. const _0x50e8=['getServicePluginInfo','textContent','csProtocol','prototype','delete','default','csPlugin','pluginExists','getServiceHomePath','deleteCache',':detail','detail','fs-extra','string','removeAllListeners','package_download_url','has','_loadServicePlugin','unloadServicePlugin','template','keys','insertServicePluginInfo','registerI18n','path','require','methods','__setModuleDefault','item','service-','csEvent','style','stringify','contents','reloadPlugin','__createBinding','type','insertBefore','csUtil','__esModule','join','bind','pluginMap','../../utils','main','defineProperty','nextSibling','setAttribute','pluginInfoMap','plugin:','create','forEach','../assets/creator.css','csFile','call','readdirSync','load','clear','set','shift','csEditor','getVersionDesc','replace','loadServicePlugin','querySelector','unload','insertServicePlugin','push','../assets/panel.css','readFile','createElement','get','innerHTML','.zip',':item','__importStar','name','_unloadServicePlugin'];(function(_0x2d64ff,_0x3afe03){const _0x50e8ce=function(_0x4421f5){while(--_0x4421f5){_0x2d64ff['push'](_0x2d64ff['shift']());}};_0x50e8ce(++_0x3afe03);}(_0x50e8,0xc4));const _0x4421=function(_0x2d64ff,_0x3afe03){_0x2d64ff=_0x2d64ff-0x120;let _0x50e8ce=_0x50e8[_0x2d64ff];return _0x50e8ce;};const _0x570f68=_0x4421,_0x9024=[_0x570f68(0x132),_0x570f68(0x14a),'load',_0x570f68(0x143),'remove',_0x570f68(0x13c),_0x570f68(0x12c),'split',_0x570f68(0x142),_0x570f68(0x149),_0x570f68(0x120),'hasOwnProperty',_0x570f68(0x13e),_0x570f68(0x151),_0x570f68(0x152),_0x570f68(0x128),_0x570f68(0x150),_0x570f68(0x135),_0x570f68(0x154),_0x570f68(0x14f),'parse',_0x570f68(0x137),_0x570f68(0x12e),_0x570f68(0x16a),_0x570f68(0x124),'../../builtin',_0x570f68(0x145),'type',_0x570f68(0x134),_0x570f68(0x131),_0x570f68(0x13d),_0x570f68(0x167),_0x570f68(0x146),_0x570f68(0x123),_0x570f68(0x15a),_0x570f68(0x157),'text/css',_0x570f68(0x15e),_0x570f68(0x16c),_0x570f68(0x159),_0x570f68(0x155),_0x570f68(0x153),_0x570f68(0x12f),_0x570f68(0x165),'service-','main','length',_0x570f68(0x122),_0x570f68(0x14d),_0x570f68(0x12a),_0x570f68(0x161),_0x570f68(0x158),_0x570f68(0x140),_0x570f68(0x168),_0x570f68(0x141),_0x570f68(0x125),_0x570f68(0x169),_0x570f68(0x13a),_0x570f68(0x163),_0x570f68(0x14c),_0x570f68(0x148),_0x570f68(0x15b),_0x570f68(0x126),_0x570f68(0x14b),'methods','values',_0x570f68(0x160),_0x570f68(0x14e),_0x570f68(0x164),'firstChild',_0x570f68(0x147),_0x570f68(0x144),_0x570f68(0x133),_0x570f68(0x127),'installPlugin',_0x570f68(0x129),_0x570f68(0x15d)];(function(_0x4b34d5,_0xe3feba){const _0x5c6739=function(_0x194183){const _0x5a9b8a=_0x4421;while(--_0x194183){_0x4b34d5[_0x5a9b8a(0x138)](_0x4b34d5[_0x5a9b8a(0x130)]());}};_0x5c6739(++_0xe3feba);}(_0x9024,0x19b));const _0x2ae0=function(_0x45a314,_0x2809d4){_0x45a314=_0x45a314-0x90;let _0x2f6d2b=_0x9024[_0x45a314];return _0x2f6d2b;},_0xa94b46=_0x2ae0;'use\x20strict';var __createBinding=this&&this[_0xa94b46(0xa1)]||(Object[_0x570f68(0x127)]?function(_0x1dc0a1,_0x2af52c,_0x291aa2,_0x2f0dad){const _0x2863a4=_0xa94b46;void 0x0===_0x2f0dad&&(_0x2f0dad=_0x291aa2),Object[_0x2863a4(0xa5)](_0x1dc0a1,_0x2f0dad,{'enumerable':!0x0,'get':function(){return _0x2af52c[_0x291aa2];}});}:function(_0x38f507,_0x4e60ad,_0x5aed6c,_0x4fd210){void 0x0===_0x4fd210&&(_0x4fd210=_0x5aed6c),_0x38f507[_0x4fd210]=_0x4e60ad[_0x5aed6c];}),__setModuleDefault=this&&this[_0xa94b46(0xc2)]||(Object[_0xa94b46(0xbf)]?function(_0x1a0673,_0x569ad2){const _0x2a05a7=_0x570f68,_0x440e2a=_0xa94b46;Object[_0x440e2a(0xa5)](_0x1a0673,_0x2a05a7(0x148),{'enumerable':!0x0,'value':_0x569ad2});}:function(_0x3479f6,_0x4b253f){const _0x4fcc37=_0x570f68;_0x3479f6[_0x4fcc37(0x148)]=_0x4b253f;}),__importStar=this&&this[_0xa94b46(0xaa)]||function(_0x3e6eac){const _0x400830=_0x570f68,_0x2b7e75=_0xa94b46;if(_0x3e6eac&&_0x3e6eac[_0x2b7e75(0xae)])return _0x3e6eac;var _0x2ee2e7={};if(null!=_0x3e6eac)for(var _0x3714b6 in _0x3e6eac)_0x2b7e75(0xb2)!==_0x3714b6&&Object[_0x2b7e75(0x96)][_0x2b7e75(0xce)][_0x400830(0x12b)](_0x3e6eac,_0x3714b6)&&__createBinding(_0x2ee2e7,_0x3e6eac,_0x3714b6);return __setModuleDefault(_0x2ee2e7,_0x3e6eac),_0x2ee2e7;};Object['defineProperty'](exports,_0x570f68(0x169),{'value':!0x0});const fs_extra_1=require(_0xa94b46(0xd6)),path_1=require(_0xa94b46(0x98)),utils_1=__importStar(require(_0xa94b46(0xcd)));exports['default']={'pluginInfoMap':new Map(),'pluginMap':new Map(),'isInstall':!0x1,'isUpdate':!0x1,'scanfServicePluginInfos':function(){const _0x31cdd3=_0x570f68,_0x343530=_0xa94b46;let _0x545175=utils_1[_0x31cdd3(0x131)][_0x343530(0xb5)]();if(!fs_extra_1['existsSync'](_0x545175))return;this[_0x31cdd3(0x125)][_0x31cdd3(0x12e)](),fs_extra_1[_0x343530(0xc9)](_0x545175)[_0x343530(0xd2)](_0x262308=>{this['insertServicePluginInfo'](_0x262308);});let _0x592f89=path_1[_0x343530(0xda)](__dirname,_0x343530(0xdc));fs_extra_1[_0x343530(0xc9)](_0x592f89)[_0x31cdd3(0x128)](_0x5a2df5=>{const _0xcc0ae9=_0x343530;this[_0xcc0ae9(0xa9)](_0x5a2df5);});},'insertServicePluginInfo':function(_0x2bdce2){const _0x1743c2=_0x570f68,_0x4b63ed=_0xa94b46;let _0x523f7b=utils_1[_0x1743c2(0x149)][_0x4b63ed(0xc6)](_0x2bdce2);void 0x0!==_0x523f7b&&this[_0x4b63ed(0xad)][_0x4b63ed(0xa0)](_0x523f7b[_0x4b63ed(0xac)],_0x523f7b);},'getServicePluginInfo':function(_0x349a53){const _0x49f18b=_0x570f68,_0x5712a6=_0xa94b46;return!this[_0x49f18b(0x125)][_0x5712a6(0x9f)](_0x349a53)&&utils_1[_0x5712a6(0xcc)][_0x5712a6(0xc4)](_0x349a53)&&this[_0x5712a6(0xa9)](_0x349a53),this[_0x5712a6(0xad)][_0x5712a6(0xc8)](_0x349a53);},'scanfServicePlugins':function(){const _0x4f89df=_0xa94b46;this[_0x4f89df(0x9c)][_0x4f89df(0xd9)]();for(let _0x17c7b7 of this['pluginInfoMap'][_0x4f89df(0xb7)]())this[_0x4f89df(0xd8)](_0x17c7b7);},'insertServicePlugin':function(_0x436da7){const _0x2867d8=_0x570f68,_0x56c671=_0xa94b46;void 0x0!==_0x436da7&&void 0x0!==_0x436da7[_0x56c671(0xb0)]&&null!==typeof _0x436da7[_0x56c671(0xb0)]&&(_0x436da7[_0x56c671(0xb0)][_0x56c671(0xb9)]&&this['pluginMap'][_0x56c671(0xa0)](_0x436da7[_0x56c671(0xac)]+_0x56c671(0xa6),utils_1['csUtil'][_0x56c671(0xb3)](_0x436da7[_0x56c671(0x98)],_0x436da7[_0x56c671(0xb0)][_0x56c671(0xb9)][_0x2867d8(0x121)])),_0x436da7[_0x56c671(0xb0)][_0x56c671(0x9b)]&&this[_0x56c671(0x9c)][_0x56c671(0xa0)](_0x436da7['name']+_0x2867d8(0x13f),utils_1[_0x56c671(0xab)]['require'](_0x436da7[_0x2867d8(0x15a)],_0x436da7[_0x56c671(0xb0)][_0x56c671(0x9b)][_0x56c671(0xa3)])));},'getServicePlugin':function(_0x3d0236,_0x54684d){const _0xe01c0b=_0x570f68,_0x4b7a2b=_0xa94b46;return this[_0x4b7a2b(0xad)][_0x4b7a2b(0x9f)](_0x3d0236)||this[_0xe01c0b(0x16c)][_0xe01c0b(0x153)](_0x3d0236+':'+_0x54684d)||this[_0x4b7a2b(0xba)](_0x3d0236),this[_0x4b7a2b(0x9c)][_0x4b7a2b(0xc8)](_0x3d0236+':'+_0x54684d);},'loadAllServicePlugins':async function(){const _0x3c6199=_0xa94b46;for(let _0x82a024 of this['pluginInfoMap'][_0x3c6199(0x99)]())await this[_0x3c6199(0x92)](_0x82a024);},'loadServicePlugin':async function(_0x2f3d79){const _0x914014=_0xa94b46;this[_0x914014(0x9d)](_0x2f3d79);for(let [_0xef46d9,_0x19bbbc]of this[_0x914014(0x9c)])_0x2f3d79===_0xef46d9[_0x914014(0xca)](':')[0x0]&&(await this[_0x914014(0xd5)](_0xef46d9,_0x19bbbc),this[_0x914014(0x9c)]['set'](_0xef46d9,_0x19bbbc));},'_loadServicePlugin':async function(_0xc5a2c7,_0x58d91c){const _0x42497e=_0x570f68,_0x153909=_0xa94b46;if(_0x58d91c[_0x153909(0xc5)]&&await _0x58d91c[_0x42497e(0x12d)](utils_1[_0x153909(0xb2)]),_0x58d91c[_0x42497e(0x15c)])for(let _0x2c885d in _0x58d91c[_0x153909(0xb6)])utils_1['csEvent']['on'](_0x153909(0xb4)+_0xc5a2c7+':'+_0x2c885d,_0x58d91c[_0x153909(0xb6)][_0x2c885d][_0x42497e(0x16b)](_0x58d91c));},'createInnterHTML':function(_0x83d8ed,_0x31ad50,_0xa363ff,_0x30c2ec){const _0xcd4ee=_0x570f68,_0x175e47=_0xa94b46;_0x31ad50[_0x175e47(0x94)]=_0x83d8ed[_0xcd4ee(0x156)];let _0x56e56a=document[_0xcd4ee(0x13b)](_0x175e47(0xa8));if(_0x56e56a[_0x175e47(0xdb)](_0xcd4ee(0x166),_0x175e47(0x9a)),_0x56e56a[_0x175e47(0xbd)]=utils_1[_0xcd4ee(0x12a)][_0x175e47(0xaf)](__dirname,_0x175e47(0xc1))+utils_1[_0x175e47(0xa7)][_0x175e47(0xaf)](__dirname,_0xcd4ee(0x139)),_0x31ad50[_0x175e47(0x95)](_0x56e56a,_0x31ad50[_0x175e47(0xbb)]),_0x83d8ed[_0x175e47(0xa8)]){let _0x5e394e=document[_0xcd4ee(0x13b)](_0xcd4ee(0x161));_0x5e394e[_0x175e47(0xdb)](_0x175e47(0x91),_0x175e47(0x9a)),_0x5e394e[_0x175e47(0xbd)]=_0x83d8ed[_0x175e47(0xa8)],_0x31ad50[_0x175e47(0x95)](_0x5e394e,_0x56e56a[_0x175e47(0x97)]);}if(_0x83d8ed['$']){let _0x3793c1=JSON[_0x175e47(0xd7)](JSON[_0xcd4ee(0x162)](_0x83d8ed['$']));for(let _0x1cd932 of Object[_0x175e47(0x99)](_0x3793c1)){if(_0x175e47(0xd3)!=typeof _0x83d8ed['$'][_0x1cd932])return;_0x83d8ed['$'][_0x1cd932]=_0x31ad50[_0x175e47(0xd4)](_0x3793c1[_0x1cd932]);}}this[_0xcd4ee(0x16c)][_0x175e47(0xa0)](_0xa363ff+':'+_0x30c2ec,_0x83d8ed);},'unloadAllServicePlugins':async function(){const _0x3da9b9=_0x570f68,_0x2c8226=_0xa94b46;for(let _0x1e378c of this[_0x3da9b9(0x125)]['keys']())await this[_0x2c8226(0x9e)](_0x1e378c);},'unloadServicePlugin':async function(_0x532740){const _0x16c877=_0x570f68,_0x138a11=_0xa94b46;for(let [_0x4a2481,_0x34c4b5]of this[_0x138a11(0x9c)])_0x532740===_0x4a2481['split'](':')[0x0]&&await this[_0x138a11(0xcb)](_0x4a2481,_0x34c4b5);this[_0x138a11(0xad)][_0x138a11(0x9f)](_0x532740)&&this[_0x138a11(0xad)][_0x16c877(0x147)](_0x532740);},'_unloadServicePlugin':async function(_0x468cfc,_0x417652){const _0x18780f=_0x570f68,_0x2ebf16=_0xa94b46;if(_0x417652[_0x18780f(0x136)]&&await _0x417652['unload'](),_0x417652[_0x18780f(0x15c)])for(let _0x12c5f5 in _0x417652[_0x2ebf16(0xb6)])utils_1[_0x2ebf16(0xb8)][_0x2ebf16(0xd0)](_0x2ebf16(0xb4)+_0x468cfc+':'+_0x12c5f5);this[_0x2ebf16(0x9c)][_0x2ebf16(0xbc)](_0x468cfc);},'registerI18n':function(_0x317de5){const _0x1af7a4=_0xa94b46;utils_1[_0x1af7a4(0xcc)][_0x1af7a4(0x9d)](_0x317de5);},'pluginExists':function(_0xbc5673){const _0x4327ad=_0xa94b46;return this[_0x4327ad(0xad)][_0x4327ad(0x9f)](_0xbc5673);},'uninstallPlugin':async function(_0x598fc1){const _0x4bc3ac=_0x570f68,_0x144295=_0xa94b46;await this[_0x144295(0x9e)](_0x598fc1),this[_0x144295(0xad)][_0x144295(0xbc)](_0x598fc1),utils_1[_0x144295(0xa7)][_0x144295(0xc7)](path_1[_0x144295(0xda)](utils_1[_0x144295(0x93)][_0x144295(0xb5)](),_0x598fc1[_0x144295(0xbe)](_0x4bc3ac(0x15f),'')));},'installPlugin':function(_0x411d4a,_0x4887b8,_0x5cf7c2){const _0x310240=_0xa94b46;return utils_1[_0x310240(0xcc)][_0x310240(0xc0)](_0x411d4a,_0x4887b8,_0x5cf7c2);},'reloadPlugin':async function(_0x3b0745){const _0x33b0dc=_0x570f68,_0x120f15=_0xa94b46;await this[_0x120f15(0x9e)](_0x3b0745);let _0x7b07ac=path_1[_0x120f15(0xda)](utils_1[_0x120f15(0x93)][_0x120f15(0xb5)](),_0x3b0745[_0x120f15(0xbe)](_0x120f15(0xa2),''));utils_1[_0x120f15(0xab)][_0x120f15(0xb1)](_0x7b07ac),this[_0x120f15(0xa9)](_0x7b07ac);let _0x1a5bce=this['getServicePluginInfo'](_0x3b0745);void 0x0!==_0x1a5bce&&(this[_0x120f15(0xd8)](_0x1a5bce),await this[_0x33b0dc(0x134)](_0x3b0745));},'getPluginVerByURL':function(_0x32936e){const _0x36bf67=_0xa94b46;if(''!==_0x32936e){let _0x3b5001=_0x32936e[_0x36bf67(0xca)]('/');return _0x3b5001[_0x3b5001[_0x36bf67(0xa4)]-0x1][_0x36bf67(0xbe)](_0x36bf67(0xcf),'');}return'';},'getPluginUrlByVer':async function(_0x5ef16c,_0x44cc42){const _0x5f44ba=_0xa94b46;return(await utils_1[_0x5f44ba(0x90)][_0x5f44ba(0xc3)](_0x5ef16c,_0x44cc42))[_0x5f44ba(0xd1)];}};