@lovrabet/cli 1.2.1-beta.4 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +33 -17
  2. package/lib/add-page/input-page-router.js +1 -1
  3. package/lib/add-page/main.js +1 -1
  4. package/lib/add-page/select-page-template.js +1 -1
  5. package/lib/api/api-doc-ui.js +1 -1
  6. package/lib/api/api-doc.js +1 -1
  7. package/lib/api/api-pull-ui.js +1 -1
  8. package/lib/api/fetch-model-list.js +1 -1
  9. package/lib/api/generate-api-file.js +1 -1
  10. package/lib/api/main.js +1 -1
  11. package/lib/api/pull-silent.js +1 -1
  12. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  13. package/lib/app-menu/create-menu.js +1 -1
  14. package/lib/app-menu/get-local-pages.js +1 -1
  15. package/lib/app-menu/get-online-menu-list.js +1 -1
  16. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  17. package/lib/app-menu/utils.js +1 -1
  18. package/lib/app-menu/valid-url.js +1 -1
  19. package/lib/app-menu-update-cdn/current-content.js +1 -1
  20. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  21. package/lib/app-menu-update-cdn/main.js +1 -1
  22. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  23. package/lib/auth/auth-server-ui.js +1 -1
  24. package/lib/auth/auth-server.js +1 -1
  25. package/lib/auth/constant.js +1 -1
  26. package/lib/auth/get-cookie.js +1 -1
  27. package/lib/auth/is-session-valid.js +1 -1
  28. package/lib/auth/logout.js +1 -1
  29. package/lib/cli.js +1 -1
  30. package/lib/cmd/build-watch.js +1 -1
  31. package/lib/cmd/build.js +1 -1
  32. package/lib/cmd/logs.js +1 -1
  33. package/lib/cmd/preview.js +1 -1
  34. package/lib/cmd/start.js +1 -1
  35. package/lib/config/config-help.js +1 -1
  36. package/lib/config/main.js +1 -1
  37. package/lib/constant/domain.js +1 -1
  38. package/lib/constant/env.js +1 -1
  39. package/lib/create-app/enhanced-guided-create.js +1 -1
  40. package/lib/create-app/format-elapsed.js +1 -1
  41. package/lib/create-app/main.js +1 -1
  42. package/lib/create-app/task-finished.js +1 -1
  43. package/lib/create-app/task-loading.js +1 -1
  44. package/lib/create-app/task-running.js +1 -1
  45. package/lib/create-app/task-time.js +1 -1
  46. package/lib/create-app/use-copy-project-template.js +1 -1
  47. package/lib/create-app/use-format-code.js +1 -1
  48. package/lib/create-app/use-install-dependencies.js +1 -1
  49. package/lib/help.js +1 -1
  50. package/lib/init/main.js +1 -1
  51. package/lib/mcp/cursor.js +1 -1
  52. package/lib/mcp/main.js +1 -1
  53. package/lib/utils/check-sdk-version.js +1 -1
  54. package/lib/utils/config.js +1 -1
  55. package/lib/utils/copy-directory.js +1 -1
  56. package/lib/utils/http-client.js +1 -1
  57. package/lib/utils/logger.js +1 -1
  58. package/lib/utils/router-updater.js +1 -1
  59. package/lib/utils/sleep.js +1 -1
  60. package/lib/utils/template-replacer.js +1 -1
  61. package/package.json +3 -3
  62. package/templates/projects/sub-app-react-demo/package.json +2 -2
  63. package/templates/projects/sub-app-react-demo/src/api/api.ts +42 -25
  64. package/templates/projects/sub-app-react-demo/src/api/client.ts +11 -10
  65. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +72 -19
  66. package/templates/projects/sub-app-react-demo/package-lock.json +0 -4062
@@ -1 +1 @@
1
- function a10_0xe239(){const _0x3e9497=['message','36qsqLsM','*\x20正在创建菜单...','delete','trim','[\x20]','JS\x20链接','*\x20请选择要同步的菜单:','done','fill','30kzqHvb','*\x20同步菜单到\x20Lovrabet\x20平台','CSS\x20链接','*\x20CSS\x20链接:\x20','2315336GubmbT','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','gray','then','filter','path','提示:使用\x20','Lovrabet平台','JS\x20链接无法访问','12666vBciqn','[✓]','!\x20未找到本地页面,请先创建页面','\x20命令重新登录','请输入有效的\x20JS\x20https\x20链接','map','\x20正在获取线上菜单列表...','backspace','blue','yellow','slice','white','2992678EKDHPI','return','27913413qHwLSy','online','join','1279679inxpdN','已选择菜单','local','add','35IQdHrk','249565bmryFY','lovrabet\x20auth','size','includes','creating','red','input-js','11643678CgSEgz','column','max','√\x20菜单创建完成','844gEGQeU','input-css','CSS\x20链接无法访问','创建菜单失败','\x20←\x20','dots','catch','\x20输入项目的\x20CSS\x20资源链接(https://...)','green','菜单名称','repeat','has','downArrow','cyan','length','*\x20JS\x20链接:\x20','selecting','value','label'];a10_0xe239=function(){return _0x3e9497;};return a10_0xe239();}(function(_0x4a9c6d,_0x48d416){const _0x1e0c41=a10_0x529e,_0x4d90c3=_0x4a9c6d();while(!![]){try{const _0x2aed1b=-parseInt(_0x1e0c41(0x125))/0x1+-parseInt(_0x1e0c41(0x120))/0x2+parseInt(_0x1e0c41(0x114))/0x3*(-parseInt(_0x1e0c41(0xea))/0x4)+parseInt(_0x1e0c41(0x12a))/0x5*(-parseInt(_0x1e0c41(0xfe))/0x6)+parseInt(_0x1e0c41(0x129))/0x7*(-parseInt(_0x1e0c41(0x10b))/0x8)+-parseInt(_0x1e0c41(0xe6))/0x9+-parseInt(_0x1e0c41(0x107))/0xa*(-parseInt(_0x1e0c41(0x122))/0xb);if(_0x2aed1b===_0x48d416)break;else _0x4d90c3['push'](_0x4d90c3['shift']());}catch(_0x1e23d7){_0x4d90c3['push'](_0x4d90c3['shift']());}}}(a10_0xe239,0xdd170));function a10_0x529e(_0x4c8605,_0x16b06b){_0x4c8605=_0x4c8605-0xe2;const _0xe239f8=a10_0xe239();let _0x529ea1=_0xe239f8[_0x4c8605];return _0x529ea1;}import{jsx as a10_0x46b81e,jsxs as a10_0x16ef84,Fragment as a10_0x4db1d4}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a10_0x22f389 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x46b81e(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x57789a=a10_0x529e,{exit:_0x32598e}=useApp(),{loading:_0x80ec1b,menuList:_0x3ee33b,error:_0x2fc116}=useGetOnlineMenuList(),_0x3d3b91=getLocalPages(),_0x2b8f22=_0x3ee33b[_0x57789a(0x119)](_0x1604f1=>_0x1604f1[_0x57789a(0x110)]),_0x345b73=['菜单名称',..._0x3d3b91[_0x57789a(0x119)](_0x517f98=>_0x517f98['label'])],_0x3cb708=getStringWidth(getMaxWidth(_0x345b73,0x4)),_0x164fe7=getStringWidth(getMaxWidth([_0x57789a(0xf3)])),[_0x420a4b,_0x44a935]=useState('selecting'),[_0x339b3a,_0x577d22]=useState(new Set()),[_0x170912,_0xeb205c]=useState(0x0),[_0x2bd400,_0x213db6]=useState(''),[_0x250555,_0x5d7f1e]=useState(''),[_0x10a5c7,_0x4f0e82]=useState(''),[_0x5d2334,_0x4599e1]=useState(''),[_0x5a5640,_0x1ec8e9]=useState([]),_0x52d11f=_0x3d3b91[_0x57789a(0x119)](_0x3695c5=>({'label':_0x3695c5['label'],'path':_0x3695c5[_0x57789a(0x110)],'local':!![],'online':_0x2b8f22['includes'](_0x3695c5[_0x57789a(0x110)])})),_0xea870e=_0x3d3b91[_0x57789a(0x10f)](_0x42c0d1=>{const _0x46f64f=_0x57789a;return!_0x2b8f22[_0x46f64f(0xe2)](_0x42c0d1[_0x46f64f(0x110)]);});useEffect(()=>{const _0xd6780f=_0x57789a;if(!_0x80ec1b&&_0x3d3b91[_0xd6780f(0xf8)]>0x0&&_0x339b3a[_0xd6780f(0x12c)]===0x0){const _0x43ba7b=new Set(_0x3d3b91[_0xd6780f(0x119)]((_0x1b1b8e,_0xccfb23)=>({'page':_0x1b1b8e,'index':_0xccfb23}))['filter'](({page:_0x525ebc})=>!_0x2b8f22[_0xd6780f(0xe2)](_0x525ebc['path']))[_0xd6780f(0x119)](({index:_0x542f5c})=>_0x542f5c));_0x577d22(_0x43ba7b);}},[_0x80ec1b,_0x3d3b91[_0x57789a(0xf8)],_0x2b8f22['length']]),useInput(async(_0x401e6f,_0x10acbc)=>{const _0x497e2b=_0x57789a;if(_0x420a4b==='selecting'){if(_0x10acbc['upArrow']){_0xeb205c(_0xe8cff8=>_0xe8cff8>0x0?_0xe8cff8-0x1:_0x3d3b91[_0x497e2b(0xf8)]-0x1);return;}if(_0x10acbc[_0x497e2b(0xf6)]){_0xeb205c(_0x52a1b0=>_0x52a1b0<_0x3d3b91['length']-0x1?_0x52a1b0+0x1:0x0);return;}if(_0x401e6f==='\x20'){_0x577d22(_0x52cc4a=>{const _0x3abf9a=_0x497e2b,_0x5f2892=new Set(_0x52cc4a);return _0x5f2892[_0x3abf9a(0xf5)](_0x170912)?_0x5f2892['delete'](_0x170912):_0x5f2892['add'](_0x170912),_0x5f2892;});return;}if(_0x401e6f==='a'||_0x401e6f==='A'){const _0x26fa24=new Set(_0x3d3b91[_0x497e2b(0x119)]((_0x336091,_0x4a9474)=>_0x4a9474));_0x577d22(_0x26fa24);return;}if(_0x401e6f==='i'||_0x401e6f==='I'||_0x401e6f==='r'||_0x401e6f==='R'){_0x577d22(_0x534b5d=>{const _0x375cf5=_0x497e2b,_0x2ea407=new Set();for(let _0x3e18a2=0x0;_0x3e18a2<_0x3d3b91[_0x375cf5(0xf8)];_0x3e18a2++){!_0x534b5d[_0x375cf5(0xf5)](_0x3e18a2)&&_0x2ea407[_0x375cf5(0x128)](_0x3e18a2);}return _0x2ea407;});return;}if(_0x401e6f==='q'||_0x401e6f==='Q'){_0x32598e();return;}if(_0x10acbc[_0x497e2b(0x121)]){if(_0x339b3a[_0x497e2b(0x12c)]===0x0){_0x4599e1('请至少选择一个菜单');return;}const _0x277f45=_0x3d3b91[_0x497e2b(0x10f)]((_0x315acb,_0x164ef1)=>_0x339b3a['has'](_0x164ef1)),_0x40e5f5=_0x277f45[_0x497e2b(0x119)](_0x2e4ec6=>_0x2e4ec6[_0x497e2b(0xfc)])[_0x497e2b(0x124)](',\x20');_0x1ec8e9([{'label':_0x497e2b(0x126),'value':_0x339b3a['size']+'\x20个'}]),_0x4599e1(''),_0x44a935('input-js');return;}return;}if(_0x420a4b===_0x497e2b(0xe5)){if(_0x10acbc[_0x497e2b(0x121)]){const _0x4df648=_0x10a5c7[_0x497e2b(0x101)]();if(_0x4df648==='')return;if(!isValidJsHttpsUrl(_0x4df648)){_0x4599e1(_0x497e2b(0x118));return;}if(!await isUrlReachable(_0x4df648)){_0x4599e1(_0x497e2b(0x113));return;}_0x213db6(_0x4df648),_0x1ec8e9(_0x385ab2=>[..._0x385ab2,{'label':_0x497e2b(0x103),'value':_0x4df648}]),_0x4f0e82(''),_0x4599e1(''),_0x44a935(_0x497e2b(0xeb));return;}if(_0x10acbc[_0x497e2b(0x11b)]||_0x10acbc[_0x497e2b(0x100)]){_0x4f0e82(_0x45f3a9=>_0x45f3a9[_0x497e2b(0x11e)](0x0,-0x1)),_0x4599e1('');return;}_0x4f0e82(_0x2c4c19=>_0x2c4c19+_0x401e6f);return;}if(_0x420a4b==='input-css'){if(_0x10acbc[_0x497e2b(0x121)]){const _0x5c7983=_0x10a5c7[_0x497e2b(0x101)]();if(_0x5c7983==='')return;if(!isValidCssHttpsUrl(_0x5c7983)){_0x4599e1('请输入有效的\x20CSS\x20https\x20链接');return;}if(!await isUrlReachable(_0x5c7983)){_0x4599e1(_0x497e2b(0xec));return;}_0x5d7f1e(_0x5c7983),_0x1ec8e9(_0x474c58=>[..._0x474c58,{'label':_0x497e2b(0x109),'value':_0x5c7983}]),_0x4f0e82(''),_0x4599e1(''),_0x44a935(_0x497e2b(0xe3));const _0x11807e=_0x3d3b91['filter']((_0x497f58,_0xdd358b)=>_0x339b3a[_0x497e2b(0xf5)](_0xdd358b));createMenus(_0x11807e,[_0x2bd400,_0x5c7983])[_0x497e2b(0x10e)](()=>{const _0x2eba37=_0x497e2b;_0x44a935(_0x2eba37(0x105)),setTimeout(()=>{_0x32598e();},0x3e8);})[_0x497e2b(0xf0)](_0x34cf83=>{const _0x4f73c9=_0x497e2b;_0x4599e1(_0x34cf83[_0x4f73c9(0xfd)]||_0x4f73c9(0xed)),_0x44a935('selecting');});return;}if(_0x10acbc[_0x497e2b(0x11b)]||_0x10acbc['delete']){_0x4f0e82(_0x4f7f69=>_0x4f7f69['slice'](0x0,-0x1)),_0x4599e1('');return;}_0x4f0e82(_0x16d577=>_0x16d577+_0x401e6f);return;}});if(_0x80ec1b)return a10_0x16ef84(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x46b81e(Text,{'children':'\x20\x20'}),a10_0x46b81e(a10_0x22f389,{'type':_0x57789a(0xef)}),a10_0x46b81e(Text,{'children':_0x57789a(0x11a)})]});if(_0x2fc116)return a10_0x16ef84(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':['✗\x20',_0x2fc116]}),a10_0x16ef84(Box,{'marginTop':0x1,'children':[a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':_0x57789a(0x111)}),a10_0x46b81e(Text,{'color':'cyan','children':_0x57789a(0x12b)}),a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':_0x57789a(0x117)})]})]});if(_0x3d3b91[_0x57789a(0xf8)]===0x0)return a10_0x46b81e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x46b81e(Text,{'color':_0x57789a(0x11d),'children':_0x57789a(0x116)})});return a10_0x16ef84(Box,{'flexDirection':_0x57789a(0xe7),'marginTop':0x1,'marginBottom':0x1,'children':[_0x420a4b===_0x57789a(0xfa)&&a10_0x16ef84(a10_0x4db1d4,{'children':[a10_0x16ef84(Box,{'children':[a10_0x16ef84(Text,{'bold':!![],'children':['\x20\x20',_0x57789a(0xf3),getRemainingSpaces(_0x3cb708,'菜单名称')]}),a10_0x16ef84(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x164fe7,_0x57789a(0xf3))]}),a10_0x16ef84(Text,{'bold':!![],'children':[_0x57789a(0x112),getRemainingSpaces(_0x164fe7,_0x57789a(0xf3))]})]}),_0x52d11f[_0x57789a(0x119)](_0x2d43a1=>a10_0x16ef84(Box,{'children':[a10_0x16ef84(Text,{'children':['\x20\x20',_0x2d43a1['label'],getRemainingSpaces(_0x3cb708,_0x2d43a1[_0x57789a(0xfc)])]}),a10_0x16ef84(Text,{'color':_0x57789a(0xf2),'children':[_0x2d43a1[_0x57789a(0x127)]?'✓':'✗',getRemainingSpaces(_0x164fe7,'✓')]}),a10_0x16ef84(Text,{'color':_0x2d43a1[_0x57789a(0x123)]?_0x57789a(0xf2):_0x57789a(0xe4),'children':[_0x2d43a1[_0x57789a(0x123)]?'✓':'✗',getRemainingSpaces(_0x164fe7,'✓')]})]},_0x2d43a1[_0x57789a(0x110)]))]}),_0x420a4b==='selecting'&&_0x5a5640[_0x57789a(0xf8)]===0x0&&a10_0x46b81e(Box,{'marginTop':0x1,'children':a10_0x46b81e(Text,{'color':_0x57789a(0xf7),'children':_0x57789a(0x108)})}),_0x5a5640[_0x57789a(0x119)]((_0x201e07,_0x12c935)=>a10_0x16ef84(Box,{'children':[a10_0x16ef84(Text,{'color':'green','children':['√\x20',_0x201e07[_0x57789a(0xfc)],':\x20']}),a10_0x46b81e(Text,{'color':_0x57789a(0xf7),'children':_0x201e07[_0x57789a(0xfb)]})]},_0x12c935)),_0x5d2334&&_0x420a4b===_0x57789a(0xfa)&&a10_0x46b81e(Box,{'marginTop':0x1,'children':a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':['✗\x20',_0x5d2334]})}),_0x420a4b===_0x57789a(0xfa)&&a10_0x46b81e(a10_0x4db1d4,{'children':a10_0x16ef84(Box,{'marginTop':_0x5a5640[_0x57789a(0xf8)]>0x0||_0x5d2334?0x1:0x0,'flexDirection':_0x57789a(0xe7),'children':[a10_0x46b81e(Text,{'bold':!![],'children':_0x57789a(0x104)}),_0x3d3b91[_0x57789a(0x119)]((_0x4104b2,_0x3ebaeb)=>{const _0x83dd8e=_0x57789a,_0x2d57fa=_0x170912===_0x3ebaeb,_0x111e33=_0x339b3a[_0x83dd8e(0xf5)](_0x3ebaeb),_0x48e9fa=_0x2b8f22[_0x83dd8e(0xe2)](_0x4104b2['path']),_0xbfefe3=_0x48e9fa?'更新':'新建';return a10_0x46b81e(Box,{'children':a10_0x16ef84(Text,{'backgroundColor':_0x2d57fa?_0x83dd8e(0x11c):undefined,'color':_0x2d57fa?_0x83dd8e(0x11f):undefined,'children':['\x20\x20',_0x111e33?_0x83dd8e(0x115):_0x83dd8e(0x102),'\x20',_0x4104b2[_0x83dd8e(0xfc)]]})},_0x4104b2[_0x83dd8e(0x110)]);}),a10_0x46b81e(Box,{'marginTop':0x1,'children':a10_0x16ef84(Text,{'color':_0x57789a(0x10d),'children':['\x20',_0x57789a(0x10c)]})})]})}),_0x420a4b===_0x57789a(0xe5)&&a10_0x16ef84(a10_0x4db1d4,{'children':[a10_0x16ef84(Box,{'children':[a10_0x46b81e(Text,{'children':_0x57789a(0xf9)}),a10_0x46b81e(Text,{'color':'green','children':_0x10a5c7}),_0x5d2334&&a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':['\x20←\x20',_0x5d2334]})]}),!_0x5d2334&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':'\x20输入项目的\x20JS\x20资源链接(https://...)'})})]}),_0x420a4b===_0x57789a(0xeb)&&a10_0x16ef84(a10_0x4db1d4,{'children':[a10_0x16ef84(Box,{'children':[a10_0x46b81e(Text,{'children':_0x57789a(0x10a)}),a10_0x46b81e(Text,{'color':_0x57789a(0xf2),'children':_0x10a5c7}),_0x5d2334&&a10_0x16ef84(Text,{'color':_0x57789a(0xe4),'children':[_0x57789a(0xee),_0x5d2334]})]}),!_0x5d2334&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'color':_0x57789a(0x10d),'children':_0x57789a(0xf1)})})]}),_0x420a4b==='creating'&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'children':_0x57789a(0xff)})}),_0x420a4b==='done'&&a10_0x46b81e(Box,{'children':a10_0x46b81e(Text,{'color':_0x57789a(0xf2),'children':_0x57789a(0xe9)})})]});}function getStringWidth(_0x120bf3){let _0x505166=0x0;for(const _0x58a973 of _0x120bf3){/[\u4e00-\u9fa5]/['test'](_0x58a973)?_0x505166+=0x2:_0x505166+=0x1;}return _0x505166;}function getRemainingSpaces(_0x419ed0,_0x5dff6e){const _0x26374a=a10_0x529e,_0x5f5beb=getStringWidth(_0x5dff6e);return Array(Math[_0x26374a(0xe8)](0x0,_0x419ed0-_0x5f5beb))[_0x26374a(0x106)]('\x20')[_0x26374a(0x124)]('');}function getMaxWidth(_0x189170,_0x1a4ac7=0x2){const _0x10628c=a10_0x529e;let _0x5403ab='',_0x2aaa08=0x0;for(const _0x309098 of _0x189170){const _0x4851b9=getStringWidth(_0x309098);_0x4851b9>_0x2aaa08&&(_0x2aaa08=_0x4851b9,_0x5403ab=_0x309098);}return _0x5403ab+'\x20'[_0x10628c(0xf4)](_0x1a4ac7);}
1
+ (function(_0x1b30b2,_0x3730cd){const _0x34ae5a=a10_0x59b8,_0x3fba6f=_0x1b30b2();while(!![]){try{const _0x45d338=parseInt(_0x34ae5a(0x156))/0x1*(parseInt(_0x34ae5a(0x138))/0x2)+parseInt(_0x34ae5a(0x166))/0x3*(-parseInt(_0x34ae5a(0x15c))/0x4)+-parseInt(_0x34ae5a(0x14b))/0x5+-parseInt(_0x34ae5a(0x14e))/0x6*(parseInt(_0x34ae5a(0x169))/0x7)+-parseInt(_0x34ae5a(0x137))/0x8+parseInt(_0x34ae5a(0x172))/0x9*(-parseInt(_0x34ae5a(0x154))/0xa)+parseInt(_0x34ae5a(0x144))/0xb;if(_0x45d338===_0x3730cd)break;else _0x3fba6f['push'](_0x3fba6f['shift']());}catch(_0x4ce67e){_0x3fba6f['push'](_0x3fba6f['shift']());}}}(a10_0x1209,0x61a46));import{jsx as a10_0x4f5594,jsxs as a10_0x253778,Fragment as a10_0x19f710}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';function a10_0x1209(){const _0x5b1711=['!\x20未找到本地页面,请先创建页面','backspace','value','join','test','[✓]','upArrow','63537KYwwUt','菜单名称','\x20命令重新登录','259EWavCj','catch','\x20←\x20','map','red','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认','add','column','请至少选择一个菜单','9TIOvjd','then','path','trim','label','[\x20]','cyan','*\x20CSS\x20链接:\x20','green','已选择菜单','selecting','429416zXtKle','4034cHfeuW','√\x20菜单创建完成','slice','size','max','input-css','Lovrabet平台','*\x20正在创建菜单...','length','gray','delete','blue','10814826nZVGRu','*\x20JS\x20链接:\x20','JS\x20链接无法访问','return','\x20正在获取线上菜单列表...','\x20输入项目的\x20JS\x20资源链接(https://...)','*\x20请选择要同步的菜单:','18910FieHwc','white','CSS\x20链接无法访问','50394EScHRT','done','includes','JS\x20链接','creating','has','566510ZvNpuY','CSS\x20链接','268gzIqOr','online','*\x20同步菜单到\x20Lovrabet\x20平台','filter','请输入有效的\x20CSS\x20https\x20链接','提示:使用\x20','132NPuJWi','lovrabet\x20auth','input-js'];a10_0x1209=function(){return _0x5b1711;};return a10_0x1209();}import{useEffect,useState}from'react';import a10_0x52f011 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';function a10_0x59b8(_0x1ad8a9,_0x46a7ac){_0x1ad8a9=_0x1ad8a9-0x133;const _0x1209e9=a10_0x1209();let _0x59b860=_0x1209e9[_0x1ad8a9];return _0x59b860;}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a10_0x4f5594(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x1a2dbf=a10_0x59b8,{exit:_0xf11be4}=useApp(),{loading:_0x49ef88,menuList:_0x536730,error:_0x426462}=useGetOnlineMenuList(),_0xce9d67=getLocalPages(),_0xd15365=_0x536730['map'](_0x2c79ef=>_0x2c79ef['path']),_0xb376e7=[_0x1a2dbf(0x167),..._0xce9d67[_0x1a2dbf(0x16c)](_0x1c68e8=>_0x1c68e8[_0x1a2dbf(0x176)])],_0x133ccd=getStringWidth(getMaxWidth(_0xb376e7,0x4)),_0x2aca5e=getStringWidth(getMaxWidth([_0x1a2dbf(0x167)])),[_0x2c9083,_0xee22e8]=useState('selecting'),[_0xb4fdb7,_0x322d82]=useState(new Set()),[_0x196301,_0x39df6b]=useState(0x0),[_0x28b781,_0x33867a]=useState(''),[_0x19cb66,_0x10feec]=useState(''),[_0x57ac81,_0x35553b]=useState(''),[_0x4cc3c4,_0x46ed9c]=useState(''),[_0x576d87,_0x4c7be0]=useState([]),_0x1badd0=_0xce9d67[_0x1a2dbf(0x16c)](_0x4bd5ba=>({'label':_0x4bd5ba[_0x1a2dbf(0x176)],'path':_0x4bd5ba[_0x1a2dbf(0x174)],'local':!![],'online':_0xd15365[_0x1a2dbf(0x150)](_0x4bd5ba[_0x1a2dbf(0x174)])})),_0x41dada=_0xce9d67[_0x1a2dbf(0x159)](_0x4ac7c1=>{const _0x45cf27=_0x1a2dbf;return!_0xd15365[_0x45cf27(0x150)](_0x4ac7c1[_0x45cf27(0x174)]);});useEffect(()=>{const _0x26ae3a=_0x1a2dbf;if(!_0x49ef88&&_0xce9d67[_0x26ae3a(0x140)]>0x0&&_0xb4fdb7[_0x26ae3a(0x13b)]===0x0){const _0x35a030=new Set(_0xce9d67[_0x26ae3a(0x16c)]((_0x493620,_0x499818)=>({'page':_0x493620,'index':_0x499818}))[_0x26ae3a(0x159)](({page:_0x26ff33})=>!_0xd15365[_0x26ae3a(0x150)](_0x26ff33[_0x26ae3a(0x174)]))['map'](({index:_0x3829a8})=>_0x3829a8));_0x322d82(_0x35a030);}},[_0x49ef88,_0xce9d67[_0x1a2dbf(0x140)],_0xd15365[_0x1a2dbf(0x140)]]),useInput(async(_0x5c292c,_0x2269ff)=>{const _0x477854=_0x1a2dbf;if(_0x2c9083===_0x477854(0x136)){if(_0x2269ff[_0x477854(0x165)]){_0x39df6b(_0x5aae42=>_0x5aae42>0x0?_0x5aae42-0x1:_0xce9d67[_0x477854(0x140)]-0x1);return;}if(_0x2269ff['downArrow']){_0x39df6b(_0x190a22=>_0x190a22<_0xce9d67['length']-0x1?_0x190a22+0x1:0x0);return;}if(_0x5c292c==='\x20'){_0x322d82(_0x1bf185=>{const _0xa92c3f=_0x477854,_0x1af2ed=new Set(_0x1bf185);return _0x1af2ed[_0xa92c3f(0x153)](_0x196301)?_0x1af2ed['delete'](_0x196301):_0x1af2ed[_0xa92c3f(0x16f)](_0x196301),_0x1af2ed;});return;}if(_0x5c292c==='a'||_0x5c292c==='A'){const _0xb27517=new Set(_0xce9d67[_0x477854(0x16c)]((_0x13a87c,_0x1497eb)=>_0x1497eb));_0x322d82(_0xb27517);return;}if(_0x5c292c==='i'||_0x5c292c==='I'||_0x5c292c==='r'||_0x5c292c==='R'){_0x322d82(_0xb3fef8=>{const _0x18d244=_0x477854,_0x172147=new Set();for(let _0x13fdb8=0x0;_0x13fdb8<_0xce9d67[_0x18d244(0x140)];_0x13fdb8++){!_0xb3fef8['has'](_0x13fdb8)&&_0x172147[_0x18d244(0x16f)](_0x13fdb8);}return _0x172147;});return;}if(_0x5c292c==='q'||_0x5c292c==='Q'){_0xf11be4();return;}if(_0x2269ff[_0x477854(0x147)]){if(_0xb4fdb7[_0x477854(0x13b)]===0x0){_0x46ed9c(_0x477854(0x171));return;}const _0x38e0c2=_0xce9d67[_0x477854(0x159)]((_0x46439d,_0x49461f)=>_0xb4fdb7['has'](_0x49461f)),_0x4bfdef=_0x38e0c2[_0x477854(0x16c)](_0x18e327=>_0x18e327['label'])[_0x477854(0x162)](',\x20');_0x4c7be0([{'label':_0x477854(0x135),'value':_0xb4fdb7[_0x477854(0x13b)]+'\x20个'}]),_0x46ed9c(''),_0xee22e8(_0x477854(0x15e));return;}return;}if(_0x2c9083===_0x477854(0x15e)){if(_0x2269ff[_0x477854(0x147)]){const _0x4e40ba=_0x57ac81[_0x477854(0x175)]();if(_0x4e40ba==='')return;if(!isValidJsHttpsUrl(_0x4e40ba)){_0x46ed9c('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x4e40ba)){_0x46ed9c(_0x477854(0x146));return;}_0x33867a(_0x4e40ba),_0x4c7be0(_0x526a56=>[..._0x526a56,{'label':_0x477854(0x151),'value':_0x4e40ba}]),_0x35553b(''),_0x46ed9c(''),_0xee22e8(_0x477854(0x13d));return;}if(_0x2269ff[_0x477854(0x160)]||_0x2269ff[_0x477854(0x142)]){_0x35553b(_0x3683bc=>_0x3683bc[_0x477854(0x13a)](0x0,-0x1)),_0x46ed9c('');return;}_0x35553b(_0xd77f72=>_0xd77f72+_0x5c292c);return;}if(_0x2c9083===_0x477854(0x13d)){if(_0x2269ff[_0x477854(0x147)]){const _0x2ccba3=_0x57ac81[_0x477854(0x175)]();if(_0x2ccba3==='')return;if(!isValidCssHttpsUrl(_0x2ccba3)){_0x46ed9c(_0x477854(0x15a));return;}if(!await isUrlReachable(_0x2ccba3)){_0x46ed9c(_0x477854(0x14d));return;}_0x10feec(_0x2ccba3),_0x4c7be0(_0x3b5ea1=>[..._0x3b5ea1,{'label':_0x477854(0x155),'value':_0x2ccba3}]),_0x35553b(''),_0x46ed9c(''),_0xee22e8('creating');const _0x2cdac7=_0xce9d67[_0x477854(0x159)]((_0x45e973,_0x4d8893)=>_0xb4fdb7[_0x477854(0x153)](_0x4d8893));createMenus(_0x2cdac7,[_0x28b781,_0x2ccba3])[_0x477854(0x173)](()=>{_0xee22e8('done'),setTimeout(()=>{_0xf11be4();},0x3e8);})[_0x477854(0x16a)](_0x7dd831=>{_0x46ed9c(_0x7dd831['message']||'创建菜单失败'),_0xee22e8('selecting');});return;}if(_0x2269ff['backspace']||_0x2269ff[_0x477854(0x142)]){_0x35553b(_0x224c9e=>_0x224c9e['slice'](0x0,-0x1)),_0x46ed9c('');return;}_0x35553b(_0x19201f=>_0x19201f+_0x5c292c);return;}});if(_0x49ef88)return a10_0x253778(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a10_0x4f5594(Text,{'children':'\x20\x20'}),a10_0x4f5594(a10_0x52f011,{'type':'dots'}),a10_0x4f5594(Text,{'children':_0x1a2dbf(0x148)})]});if(_0x426462)return a10_0x253778(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a10_0x253778(Text,{'color':_0x1a2dbf(0x16d),'children':['✗\x20',_0x426462]}),a10_0x253778(Box,{'marginTop':0x1,'children':[a10_0x4f5594(Text,{'color':_0x1a2dbf(0x141),'children':_0x1a2dbf(0x15b)}),a10_0x4f5594(Text,{'color':_0x1a2dbf(0x178),'children':_0x1a2dbf(0x15d)}),a10_0x4f5594(Text,{'color':_0x1a2dbf(0x141),'children':_0x1a2dbf(0x168)})]})]});if(_0xce9d67[_0x1a2dbf(0x140)]===0x0)return a10_0x4f5594(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a10_0x4f5594(Text,{'color':'yellow','children':_0x1a2dbf(0x15f)})});return a10_0x253778(Box,{'flexDirection':_0x1a2dbf(0x170),'marginTop':0x1,'marginBottom':0x1,'children':[_0x2c9083===_0x1a2dbf(0x136)&&a10_0x253778(a10_0x19f710,{'children':[a10_0x253778(Box,{'children':[a10_0x253778(Text,{'bold':!![],'children':['\x20\x20',_0x1a2dbf(0x167),getRemainingSpaces(_0x133ccd,'菜单名称')]}),a10_0x253778(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x2aca5e,_0x1a2dbf(0x167))]}),a10_0x253778(Text,{'bold':!![],'children':[_0x1a2dbf(0x13e),getRemainingSpaces(_0x2aca5e,_0x1a2dbf(0x167))]})]}),_0x1badd0[_0x1a2dbf(0x16c)](_0x28c80a=>a10_0x253778(Box,{'children':[a10_0x253778(Text,{'children':['\x20\x20',_0x28c80a['label'],getRemainingSpaces(_0x133ccd,_0x28c80a[_0x1a2dbf(0x176)])]}),a10_0x253778(Text,{'color':_0x1a2dbf(0x134),'children':[_0x28c80a['local']?'✓':'✗',getRemainingSpaces(_0x2aca5e,'✓')]}),a10_0x253778(Text,{'color':_0x28c80a[_0x1a2dbf(0x157)]?_0x1a2dbf(0x134):'red','children':[_0x28c80a[_0x1a2dbf(0x157)]?'✓':'✗',getRemainingSpaces(_0x2aca5e,'✓')]})]},_0x28c80a[_0x1a2dbf(0x174)]))]}),_0x2c9083==='selecting'&&_0x576d87[_0x1a2dbf(0x140)]===0x0&&a10_0x4f5594(Box,{'marginTop':0x1,'children':a10_0x4f5594(Text,{'color':'cyan','children':_0x1a2dbf(0x158)})}),_0x576d87[_0x1a2dbf(0x16c)]((_0x20c2ca,_0x50c19c)=>a10_0x253778(Box,{'children':[a10_0x253778(Text,{'color':_0x1a2dbf(0x134),'children':['√\x20',_0x20c2ca[_0x1a2dbf(0x176)],':\x20']}),a10_0x4f5594(Text,{'color':'cyan','children':_0x20c2ca[_0x1a2dbf(0x161)]})]},_0x50c19c)),_0x4cc3c4&&_0x2c9083===_0x1a2dbf(0x136)&&a10_0x4f5594(Box,{'marginTop':0x1,'children':a10_0x253778(Text,{'color':'red','children':['✗\x20',_0x4cc3c4]})}),_0x2c9083===_0x1a2dbf(0x136)&&a10_0x4f5594(a10_0x19f710,{'children':a10_0x253778(Box,{'marginTop':_0x576d87[_0x1a2dbf(0x140)]>0x0||_0x4cc3c4?0x1:0x0,'flexDirection':'column','children':[a10_0x4f5594(Text,{'bold':!![],'children':_0x1a2dbf(0x14a)}),_0xce9d67[_0x1a2dbf(0x16c)]((_0x35ef51,_0x1d0157)=>{const _0x4c6138=_0x1a2dbf,_0x3cc8d1=_0x196301===_0x1d0157,_0x16cd46=_0xb4fdb7['has'](_0x1d0157),_0x42fbbf=_0xd15365[_0x4c6138(0x150)](_0x35ef51[_0x4c6138(0x174)]),_0x4b3002=_0x42fbbf?'更新':'新建';return a10_0x4f5594(Box,{'children':a10_0x253778(Text,{'backgroundColor':_0x3cc8d1?_0x4c6138(0x143):undefined,'color':_0x3cc8d1?_0x4c6138(0x14c):undefined,'children':['\x20\x20',_0x16cd46?_0x4c6138(0x164):_0x4c6138(0x177),'\x20',_0x35ef51[_0x4c6138(0x176)]]})},_0x35ef51[_0x4c6138(0x174)]);}),a10_0x4f5594(Box,{'marginTop':0x1,'children':a10_0x253778(Text,{'color':_0x1a2dbf(0x141),'children':['\x20',_0x1a2dbf(0x16e)]})})]})}),_0x2c9083===_0x1a2dbf(0x15e)&&a10_0x253778(a10_0x19f710,{'children':[a10_0x253778(Box,{'children':[a10_0x4f5594(Text,{'children':_0x1a2dbf(0x145)}),a10_0x4f5594(Text,{'color':_0x1a2dbf(0x134),'children':_0x57ac81}),_0x4cc3c4&&a10_0x253778(Text,{'color':_0x1a2dbf(0x16d),'children':[_0x1a2dbf(0x16b),_0x4cc3c4]})]}),!_0x4cc3c4&&a10_0x4f5594(Box,{'children':a10_0x4f5594(Text,{'color':_0x1a2dbf(0x141),'children':_0x1a2dbf(0x149)})})]}),_0x2c9083===_0x1a2dbf(0x13d)&&a10_0x253778(a10_0x19f710,{'children':[a10_0x253778(Box,{'children':[a10_0x4f5594(Text,{'children':_0x1a2dbf(0x133)}),a10_0x4f5594(Text,{'color':_0x1a2dbf(0x134),'children':_0x57ac81}),_0x4cc3c4&&a10_0x253778(Text,{'color':_0x1a2dbf(0x16d),'children':[_0x1a2dbf(0x16b),_0x4cc3c4]})]}),!_0x4cc3c4&&a10_0x4f5594(Box,{'children':a10_0x4f5594(Text,{'color':_0x1a2dbf(0x141),'children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0x2c9083===_0x1a2dbf(0x152)&&a10_0x4f5594(Box,{'children':a10_0x4f5594(Text,{'children':_0x1a2dbf(0x13f)})}),_0x2c9083===_0x1a2dbf(0x14f)&&a10_0x4f5594(Box,{'children':a10_0x4f5594(Text,{'color':'green','children':_0x1a2dbf(0x139)})})]});}function getStringWidth(_0x43eb8e){const _0x1624d0=a10_0x59b8;let _0x2c1cd7=0x0;for(const _0x31e05c of _0x43eb8e){/[\u4e00-\u9fa5]/[_0x1624d0(0x163)](_0x31e05c)?_0x2c1cd7+=0x2:_0x2c1cd7+=0x1;}return _0x2c1cd7;}function getRemainingSpaces(_0x3f0d7f,_0x2136b4){const _0x35084c=a10_0x59b8,_0x752bc4=getStringWidth(_0x2136b4);return Array(Math[_0x35084c(0x13c)](0x0,_0x3f0d7f-_0x752bc4))['fill']('\x20')[_0x35084c(0x162)]('');}function getMaxWidth(_0x510fdf,_0x4f4c1e=0x2){let _0x3f09ed='',_0x534c6b=0x0;for(const _0x26b99a of _0x510fdf){const _0x3391bb=getStringWidth(_0x26b99a);_0x3391bb>_0x534c6b&&(_0x534c6b=_0x3391bb,_0x3f09ed=_0x26b99a);}return _0x3f09ed+'\x20'['repeat'](_0x4f4c1e);}
@@ -1 +1 @@
1
- (function(_0x4fe00a,_0x168336){const _0x771b51=a11_0x24a3,_0xc5b8ca=_0x4fe00a();while(!![]){try{const _0x544593=parseInt(_0x771b51(0x222))/0x1+-parseInt(_0x771b51(0x1f4))/0x2+parseInt(_0x771b51(0x214))/0x3+parseInt(_0x771b51(0x1fb))/0x4*(parseInt(_0x771b51(0x20a))/0x5)+parseInt(_0x771b51(0x20f))/0x6*(-parseInt(_0x771b51(0x201))/0x7)+-parseInt(_0x771b51(0x212))/0x8+parseInt(_0x771b51(0x1fc))/0x9*(parseInt(_0x771b51(0x216))/0xa);if(_0x544593===_0x168336)break;else _0xc5b8ca['push'](_0xc5b8ca['shift']());}catch(_0x2b465c){_0xc5b8ca['push'](_0xc5b8ca['shift']());}}}(a11_0x1f2a,0xbe104));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a11_0x1f2a(){const _0x55a73e=['path','14AGbSkC','length','create-menu','errorMsg','菜单创建成功:\x20','status','stringify','error','create-menus','35vfvslU','info','未知错误','success','data','4163142upKBDQ','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','创建菜单失败:\x20','1170896qbGhPq','开始批量创建菜单,共\x20','590592UbnImp','json','1115260bNjxMo','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','all','appcode','import','label','POST','正在创建菜单:\x20','!\x20请使用以下方式之一:','application/json','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','procode','656858XDBERW','includes','1505166agcDZu','0011','创建菜单失败,HTTP状态码:\x20','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','/smartapi/menu/create','批量创建菜单完成,共\x20','errorCode','690116AvxpDl','81TNshIp','log','resources','未提供应用AppCode,且配置中也没有默认值'];a11_0x1f2a=function(){return _0x55a73e;};return a11_0x1f2a();}import{logger}from'../utils/logger.js';function a11_0x24a3(_0xb272a0,_0x4021c9){_0xb272a0=_0xb272a0-0x1f3;const _0x1f2a1f=a11_0x1f2a();let _0x24a337=_0x1f2a1f[_0xb272a0];return _0x24a337;}const config=readConfig();export async function createMenu(_0x3913af){const _0x53f27d=a11_0x24a3,_0x22e8c8=config?.[_0x53f27d(0x219)];if(!_0x22e8c8){const _0x4e479d=_0x53f27d(0x1ff);logger[_0x53f27d(0x208)]('create-menu',_0x4e479d),console[_0x53f27d(0x208)]('×\x20'+_0x4e479d),console['log'](_0x53f27d(0x21e)),console[_0x53f27d(0x1fd)](_0x53f27d(0x210)),console[_0x53f27d(0x1fd)](_0x53f27d(0x1f7));return;}logger[_0x53f27d(0x20b)](_0x53f27d(0x203),_0x53f27d(0x21d)+_0x3913af[_0x53f27d(0x21b)]+'\x20('+_0x3913af[_0x53f27d(0x200)]+')');const _0x27cced={'appCode':_0x22e8c8,'type':_0x53f27d(0x221),'sort':0x0,'extend':{'loadScriptMode':_0x53f27d(0x21a),'resources':_0x3913af[_0x53f27d(0x1fe)]?JSON[_0x53f27d(0x207)](_0x3913af[_0x53f27d(0x1fe)]):undefined},..._0x3913af},_0x5974df=await fetch(getApiDomain()+_0x53f27d(0x1f8),{'method':_0x53f27d(0x21c),'body':JSON['stringify'](_0x27cced),'headers':{'Content-Type':_0x53f27d(0x21f),'Cookie':getCookie()}});if(!_0x5974df['ok']){if(_0x5974df[_0x53f27d(0x206)]===0x191){const _0x31f5eb=_0x53f27d(0x220);logger[_0x53f27d(0x208)]('create-menu',_0x31f5eb,{'status':_0x5974df[_0x53f27d(0x206)],'menu':_0x3913af[_0x53f27d(0x21b)]});throw new Error(_0x31f5eb);}const _0x55ad28=_0x53f27d(0x1f6)+_0x5974df[_0x53f27d(0x206)];logger['error']('create-menu',_0x55ad28,{'menu':_0x3913af[_0x53f27d(0x21b)]});throw new Error(_0x55ad28);}const _0x5dda69=await _0x5974df[_0x53f27d(0x215)]();if(!_0x5dda69[_0x53f27d(0x20d)]){const _0x57adab=_0x53f27d(0x211)+(_0x5dda69['errorMsg']||'未知错误');logger[_0x53f27d(0x208)](_0x53f27d(0x203),_0x57adab,{'errorCode':_0x5dda69[_0x53f27d(0x1fa)],'errorMsg':_0x5dda69[_0x53f27d(0x204)],'menu':_0x3913af['label']});throw new Error(_0x57adab);}logger['info'](_0x53f27d(0x203),_0x53f27d(0x205)+_0x3913af[_0x53f27d(0x21b)],_0x5dda69[_0x53f27d(0x20e)]),console['log']('创建菜单成功:',_0x5dda69[_0x53f27d(0x20e)]);}async function _createMenu(_0x199ccf,_0x29661b){const _0x5e5b19=a11_0x24a3,_0x2f5c85=config?.[_0x5e5b19(0x219)];if(!_0x2f5c85){const _0xe2f9f9=_0x5e5b19(0x1ff);logger[_0x5e5b19(0x208)](_0x5e5b19(0x203),_0xe2f9f9),console[_0x5e5b19(0x208)]('×\x20'+_0xe2f9f9),console['log'](_0x5e5b19(0x21e)),console[_0x5e5b19(0x1fd)]('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x5e5b19(0x1fd)](_0x5e5b19(0x1f7));return;}const _0x1d3d71={'appCode':_0x2f5c85,'type':_0x5e5b19(0x221),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0x29661b?JSON[_0x5e5b19(0x207)](_0x29661b):undefined},'label':_0x199ccf[_0x5e5b19(0x21b)],'path':_0x199ccf['path']},_0x4a05f1=await fetch(getApiDomain()+_0x5e5b19(0x1f8),{'method':_0x5e5b19(0x21c),'body':JSON[_0x5e5b19(0x207)](_0x1d3d71),'headers':{'Content-Type':_0x5e5b19(0x21f),'Cookie':getCookie()}});if(!_0x4a05f1['ok']){if(_0x4a05f1['status']===0x191){const _0x4c4959=_0x5e5b19(0x220);logger[_0x5e5b19(0x208)](_0x5e5b19(0x203),_0x4c4959,{'status':_0x4a05f1[_0x5e5b19(0x206)],'menu':_0x199ccf['label']});throw new Error(_0x4c4959);}const _0x2fd324=_0x5e5b19(0x1f6)+_0x4a05f1[_0x5e5b19(0x206)];logger[_0x5e5b19(0x208)](_0x5e5b19(0x203),_0x2fd324,{'menu':_0x199ccf['label']});throw new Error(_0x2fd324);}const _0x2c0859=await _0x4a05f1[_0x5e5b19(0x215)]();if(!_0x2c0859[_0x5e5b19(0x20d)]){if(_0x2c0859[_0x5e5b19(0x1fa)]===_0x5e5b19(0x1f5)||_0x2c0859[_0x5e5b19(0x204)]?.[_0x5e5b19(0x1f3)]('登录')){const _0x415213=_0x5e5b19(0x217);logger[_0x5e5b19(0x208)](_0x5e5b19(0x203),_0x415213,{'errorCode':_0x2c0859[_0x5e5b19(0x1fa)],'errorMsg':_0x2c0859[_0x5e5b19(0x204)],'menu':_0x199ccf[_0x5e5b19(0x21b)]});throw new Error(_0x415213);}const _0x7a04df=_0x5e5b19(0x211)+(_0x2c0859['errorMsg']||_0x5e5b19(0x20c));logger[_0x5e5b19(0x208)](_0x5e5b19(0x203),_0x7a04df,{'errorCode':_0x2c0859[_0x5e5b19(0x1fa)],'errorMsg':_0x2c0859[_0x5e5b19(0x204)],'menu':_0x199ccf['label']});throw new Error(_0x7a04df);}logger[_0x5e5b19(0x20b)](_0x5e5b19(0x203),_0x5e5b19(0x205)+_0x199ccf[_0x5e5b19(0x21b)]);}export async function createMenus(_0x8be5d3,_0x4c762c){const _0x2f3812=a11_0x24a3;logger[_0x2f3812(0x20b)](_0x2f3812(0x209),_0x2f3812(0x213)+_0x8be5d3[_0x2f3812(0x202)]+'\x20个'),await Promise[_0x2f3812(0x218)](_0x8be5d3['map'](async _0x524871=>{await _createMenu(_0x524871,_0x4c762c);})),logger[_0x2f3812(0x20b)](_0x2f3812(0x209),_0x2f3812(0x1f9)+_0x8be5d3[_0x2f3812(0x202)]+'\x20个');}
1
+ (function(_0x1488d4,_0x340713){const _0x584309=a11_0x2c9a,_0x54d4f1=_0x1488d4();while(!![]){try{const _0x6b3aa9=parseInt(_0x584309(0x126))/0x1+parseInt(_0x584309(0x118))/0x2+-parseInt(_0x584309(0x128))/0x3*(parseInt(_0x584309(0x11d))/0x4)+parseInt(_0x584309(0x10f))/0x5*(parseInt(_0x584309(0x10d))/0x6)+parseInt(_0x584309(0x11f))/0x7*(-parseInt(_0x584309(0x109))/0x8)+parseInt(_0x584309(0xfe))/0x9+parseInt(_0x584309(0x123))/0xa;if(_0x6b3aa9===_0x340713)break;else _0x54d4f1['push'](_0x54d4f1['shift']());}catch(_0x6d8251){_0x54d4f1['push'](_0x54d4f1['shift']());}}}(a11_0x478e,0x1ebbb));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a11_0x478e(){const _0x3add2e=['25583CCEHXx','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','27YvRjTb','正在创建菜单:\x20','登录态校验失败,请使用\x20lovrabet\x20auth\x20重新登录','resources','info','13149hqpOkP','all','create-menu','status','path','未提供应用AppCode,且配置中也没有默认值','0011','import','label','errorCode','创建菜单成功:','1186936GeLasX','开始批量创建菜单,共\x20','创建菜单失败:\x20','未知错误','525558drLkYz','errorMsg','5vMgDqU','error','procode','POST','length','create-menus','/smartapi/menu/create','success','appcode','79800ORmRFu','application/json','!\x20请使用以下方式之一:','创建菜单失败,HTTP状态码:\x20','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','97892QGvJIG','log','7nkkVAf','stringify','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','map','3399700YkDlIo','includes','批量创建菜单完成,共\x20'];a11_0x478e=function(){return _0x3add2e;};return a11_0x478e();}const config=readConfig();function a11_0x2c9a(_0x32c1cc,_0xa84e1f){_0x32c1cc=_0x32c1cc-0xfa;const _0x478e4e=a11_0x478e();let _0x2c9a61=_0x478e4e[_0x32c1cc];return _0x2c9a61;}export async function createMenu(_0xdcfb5c){const _0x341759=a11_0x2c9a,_0x2541ad=config?.['appcode'];if(!_0x2541ad){const _0x222cb1='未提供应用AppCode,且配置中也没有默认值';logger['error']('create-menu',_0x222cb1),console[_0x341759(0x110)]('×\x20'+_0x222cb1),console[_0x341759(0x11e)](_0x341759(0x11a)),console[_0x341759(0x11e)](_0x341759(0x127)),console[_0x341759(0x11e)](_0x341759(0x121));return;}logger[_0x341759(0xfd)](_0x341759(0x100),_0x341759(0xfa)+_0xdcfb5c[_0x341759(0x106)]+'\x20('+_0xdcfb5c[_0x341759(0x102)]+')');const _0x2fbdc8={'appCode':_0x2541ad,'type':_0x341759(0x111),'sort':0x0,'extend':{'loadScriptMode':'import','resources':_0xdcfb5c[_0x341759(0xfc)]?JSON[_0x341759(0x120)](_0xdcfb5c[_0x341759(0xfc)]):undefined},..._0xdcfb5c},_0x2450bf=await fetch(getApiDomain()+_0x341759(0x115),{'method':_0x341759(0x112),'body':JSON[_0x341759(0x120)](_0x2fbdc8),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x2450bf['ok']){if(_0x2450bf[_0x341759(0x101)]===0x191){const _0x1f129b=_0x341759(0x11c);logger['error'](_0x341759(0x100),_0x1f129b,{'status':_0x2450bf[_0x341759(0x101)],'menu':_0xdcfb5c[_0x341759(0x106)]});throw new Error(_0x1f129b);}const _0x44bb61=_0x341759(0x11b)+_0x2450bf[_0x341759(0x101)];logger['error'](_0x341759(0x100),_0x44bb61,{'menu':_0xdcfb5c[_0x341759(0x106)]});throw new Error(_0x44bb61);}const _0x74a837=await _0x2450bf['json']();if(!_0x74a837['success']){const _0x48b256=_0x341759(0x10b)+(_0x74a837[_0x341759(0x10e)]||_0x341759(0x10c));logger[_0x341759(0x110)](_0x341759(0x100),_0x48b256,{'errorCode':_0x74a837[_0x341759(0x107)],'errorMsg':_0x74a837['errorMsg'],'menu':_0xdcfb5c[_0x341759(0x106)]});throw new Error(_0x48b256);}logger[_0x341759(0xfd)](_0x341759(0x100),'菜单创建成功:\x20'+_0xdcfb5c[_0x341759(0x106)],_0x74a837['data']),console[_0x341759(0x11e)](_0x341759(0x108),_0x74a837['data']);}async function _createMenu(_0x2e8bdb,_0x107bf5){const _0x127384=a11_0x2c9a,_0x54baba=config?.[_0x127384(0x117)];if(!_0x54baba){const _0x15f0e2=_0x127384(0x103);logger[_0x127384(0x110)](_0x127384(0x100),_0x15f0e2),console[_0x127384(0x110)]('×\x20'+_0x15f0e2),console[_0x127384(0x11e)](_0x127384(0x11a)),console[_0x127384(0x11e)]('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console[_0x127384(0x11e)](_0x127384(0x121));return;}const _0x42438f={'appCode':_0x54baba,'type':'procode','sort':0x0,'extend':{'loadScriptMode':_0x127384(0x105),'resources':_0x107bf5?JSON[_0x127384(0x120)](_0x107bf5):undefined},'label':_0x2e8bdb[_0x127384(0x106)],'path':_0x2e8bdb[_0x127384(0x102)]},_0x289840=await fetch(getApiDomain()+_0x127384(0x115),{'method':_0x127384(0x112),'body':JSON['stringify'](_0x42438f),'headers':{'Content-Type':_0x127384(0x119),'Cookie':getCookie()}});if(!_0x289840['ok']){if(_0x289840[_0x127384(0x101)]===0x191){const _0xd77c81=_0x127384(0x11c);logger['error'](_0x127384(0x100),_0xd77c81,{'status':_0x289840['status'],'menu':_0x2e8bdb[_0x127384(0x106)]});throw new Error(_0xd77c81);}const _0x51eddf=_0x127384(0x11b)+_0x289840[_0x127384(0x101)];logger[_0x127384(0x110)](_0x127384(0x100),_0x51eddf,{'menu':_0x2e8bdb[_0x127384(0x106)]});throw new Error(_0x51eddf);}const _0x51770f=await _0x289840['json']();if(!_0x51770f[_0x127384(0x116)]){if(_0x51770f[_0x127384(0x107)]===_0x127384(0x104)||_0x51770f[_0x127384(0x10e)]?.[_0x127384(0x124)]('登录')){const _0x82640=_0x127384(0xfb);logger[_0x127384(0x110)](_0x127384(0x100),_0x82640,{'errorCode':_0x51770f[_0x127384(0x107)],'errorMsg':_0x51770f[_0x127384(0x10e)],'menu':_0x2e8bdb[_0x127384(0x106)]});throw new Error(_0x82640);}const _0x13e914=_0x127384(0x10b)+(_0x51770f[_0x127384(0x10e)]||_0x127384(0x10c));logger['error'](_0x127384(0x100),_0x13e914,{'errorCode':_0x51770f[_0x127384(0x107)],'errorMsg':_0x51770f[_0x127384(0x10e)],'menu':_0x2e8bdb['label']});throw new Error(_0x13e914);}logger['info'](_0x127384(0x100),'菜单创建成功:\x20'+_0x2e8bdb[_0x127384(0x106)]);}export async function createMenus(_0xd31e3d,_0x484fca){const _0x1dda34=a11_0x2c9a;logger['info']('create-menus',_0x1dda34(0x10a)+_0xd31e3d['length']+'\x20个'),await Promise[_0x1dda34(0xff)](_0xd31e3d[_0x1dda34(0x122)](async _0x495abf=>{await _createMenu(_0x495abf,_0x484fca);})),logger['info'](_0x1dda34(0x114),_0x1dda34(0x125)+_0xd31e3d[_0x1dda34(0x113)]+'\x20个');}
@@ -1 +1 @@
1
- (function(_0x458d1e,_0x4ad5f2){const _0x253b29=a12_0x9f52,_0x8d7f15=_0x458d1e();while(!![]){try{const _0x425777=-parseInt(_0x253b29(0x1b4))/0x1*(parseInt(_0x253b29(0x1c5))/0x2)+parseInt(_0x253b29(0x1c2))/0x3+parseInt(_0x253b29(0x1b7))/0x4+parseInt(_0x253b29(0x1b8))/0x5+-parseInt(_0x253b29(0x1b6))/0x6*(-parseInt(_0x253b29(0x1bd))/0x7)+parseInt(_0x253b29(0x1bf))/0x8+parseInt(_0x253b29(0x1ba))/0x9*(-parseInt(_0x253b29(0x1b5))/0xa);if(_0x425777===_0x4ad5f2)break;else _0x8d7f15['push'](_0x8d7f15['shift']());}catch(_0x28a6c0){_0x8d7f15['push'](_0x8d7f15['shift']());}}}(a12_0x3b62,0xe791d));function a12_0x3b62(){const _0x22ca92=['1070xKlzkD','7098MjZlMl','7320496RBTrUr','4140885yNypcs','match','373077cEOQQK','filter','forEach','7357AYjqzY','isDirectory','10737808ZaCUkm','path','index.tsx','4116549QfyxVn','endsWith','replace','74CAjIvE','trim','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','utf-8','slice','push','33299fsOspl'];a12_0x3b62=function(){return _0x22ca92;};return a12_0x3b62();}import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';const pagesDir=resolve(process['cwd'](),'src/pages');function a12_0x9f52(_0x397003,_0x2c89a2){_0x397003=_0x397003-0x1b0;const _0x3b6272=a12_0x3b62();let _0x9f529c=_0x3b6272[_0x397003];return _0x9f529c;}export function extractTitleFromComment(_0x50a6d2){const _0x13d468=a12_0x9f52;try{const _0x40b27d=readFileSync(_0x50a6d2,_0x13d468(0x1b1)),_0xccc19c=_0x40b27d[_0x13d468(0x1b9)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0xccc19c&&_0xccc19c[0x1]){const _0x36beec=_0xccc19c[0x1],_0xf9709c=_0x36beec['match'](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0xf9709c&&_0xf9709c[0x1])return _0xf9709c[0x1][_0x13d468(0x1c6)]();}let _0x3f0522=null;const _0x37274d=_0x40b27d['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x37274d&&_0x37274d[0x1]&&(_0x3f0522=_0x37274d[0x1]);if(!_0x3f0522){const _0x12380d=_0x40b27d[_0x13d468(0x1b9)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x12380d&&_0x12380d[0x1]&&(_0x3f0522=_0x12380d[0x1]);}if(_0x3f0522){const _0x119527=new RegExp('\x5cb'+_0x3f0522+_0x13d468(0x1b0)),_0x1c488f=_0x40b27d[_0x13d468(0x1b9)](_0x119527);if(_0x1c488f&&_0x1c488f[0x1])return _0x1c488f[0x1];return _0x3f0522;}return null;}catch(_0x5c8adc){return null;}}export function getLocalPages(_0x1f4230=pagesDir,_0x2e4536=pagesDir){const _0x34c8dd=a12_0x9f52;let _0x13e2ae=[];const _0x32b2c9=readdirSync(_0x1f4230);return _0x32b2c9[_0x34c8dd(0x1bc)](_0x2986b2=>{const _0x38f192=_0x34c8dd,_0x4738ce=join(_0x1f4230,_0x2986b2),_0xa4ff37=statSync(_0x4738ce);if(_0xa4ff37&&_0xa4ff37[_0x38f192(0x1be)]())_0x13e2ae=_0x13e2ae['concat'](getLocalPages(_0x4738ce,_0x2e4536));else{if(_0x2986b2[_0x38f192(0x1c3)]('.tsx')){let _0x3e9613=relative(_0x2e4536,_0x4738ce);_0x3e9613[_0x38f192(0x1c3)](_0x38f192(0x1c1))?_0x3e9613=_0x3e9613['replace'](/index\.tsx$/,''):_0x3e9613=_0x3e9613[_0x38f192(0x1c4)](/\.tsx$/,'');_0x3e9613[_0x38f192(0x1c3)]('/')&&(_0x3e9613=_0x3e9613[_0x38f192(0x1b2)](0x0,-0x1));const _0x4e1381=extractTitleFromComment(_0x4738ce),_0x8c36a6=_0x4e1381||_0x3e9613;_0x13e2ae[_0x38f192(0x1b3)]({'path':_0x3e9613['replaceAll']('$',':'),'label':_0x8c36a6});}}}),_0x13e2ae[_0x34c8dd(0x1bb)](_0x4216e3=>_0x4216e3[_0x34c8dd(0x1c0)]!=='');}
1
+ const a12_0x33e185=a12_0x5049;(function(_0x5cb19f,_0x2c19f5){const _0x5754b0=a12_0x5049,_0x2df60e=_0x5cb19f();while(!![]){try{const _0x30a567=-parseInt(_0x5754b0(0x12b))/0x1*(-parseInt(_0x5754b0(0x128))/0x2)+-parseInt(_0x5754b0(0x125))/0x3+parseInt(_0x5754b0(0x129))/0x4+-parseInt(_0x5754b0(0x11f))/0x5*(-parseInt(_0x5754b0(0x12e))/0x6)+-parseInt(_0x5754b0(0x121))/0x7+-parseInt(_0x5754b0(0x12d))/0x8*(parseInt(_0x5754b0(0x122))/0x9)+parseInt(_0x5754b0(0x12a))/0xa;if(_0x30a567===_0x2c19f5)break;else _0x2df60e['push'](_0x2df60e['shift']());}catch(_0x350a5e){_0x2df60e['push'](_0x2df60e['shift']());}}}(a12_0x3137,0xbd478));import{readdirSync,statSync,readFileSync}from'fs';function a12_0x5049(_0x1c0d6a,_0x25522b){_0x1c0d6a=_0x1c0d6a-0x118;const _0x313769=a12_0x3137();let _0x50495f=_0x313769[_0x1c0d6a];return _0x50495f;}import{join,relative,resolve}from'path';const pagesDir=resolve(process[a12_0x33e185(0x124)](),'src/pages');export function extractTitleFromComment(_0x1b1748){const _0x53f8ec=a12_0x33e185;try{const _0x4b2019=readFileSync(_0x1b1748,_0x53f8ec(0x11b)),_0x458c8f=_0x4b2019[_0x53f8ec(0x11a)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x458c8f&&_0x458c8f[0x1]){const _0x3a5a02=_0x458c8f[0x1],_0x5e0410=_0x3a5a02[_0x53f8ec(0x11a)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x5e0410&&_0x5e0410[0x1])return _0x5e0410[0x1][_0x53f8ec(0x12c)]();}let _0x1ad592=null;const _0x186af4=_0x4b2019[_0x53f8ec(0x11a)](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x186af4&&_0x186af4[0x1]&&(_0x1ad592=_0x186af4[0x1]);if(!_0x1ad592){const _0x6817d2=_0x4b2019[_0x53f8ec(0x11a)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x6817d2&&_0x6817d2[0x1]&&(_0x1ad592=_0x6817d2[0x1]);}if(_0x1ad592){const _0xc7c190=new RegExp('\x5cb'+_0x1ad592+_0x53f8ec(0x119)),_0x3d9338=_0x4b2019['match'](_0xc7c190);if(_0x3d9338&&_0x3d9338[0x1])return _0x3d9338[0x1];return _0x1ad592;}return null;}catch(_0x2713f9){return null;}}export function getLocalPages(_0x117701=pagesDir,_0x35a520=pagesDir){const _0x2cfd14=a12_0x33e185;let _0x327342=[];const _0x215222=readdirSync(_0x117701);return _0x215222['forEach'](_0x2c0abf=>{const _0x1c994a=a12_0x5049,_0x5897c6=join(_0x117701,_0x2c0abf),_0x615eac=statSync(_0x5897c6);if(_0x615eac&&_0x615eac[_0x1c994a(0x11e)]())_0x327342=_0x327342['concat'](getLocalPages(_0x5897c6,_0x35a520));else{if(_0x2c0abf[_0x1c994a(0x11c)](_0x1c994a(0x126))){let _0x33dfbe=relative(_0x35a520,_0x5897c6);_0x33dfbe['endsWith'](_0x1c994a(0x123))?_0x33dfbe=_0x33dfbe[_0x1c994a(0x12f)](/index\.tsx$/,''):_0x33dfbe=_0x33dfbe['replace'](/\.tsx$/,'');_0x33dfbe['endsWith']('/')&&(_0x33dfbe=_0x33dfbe[_0x1c994a(0x127)](0x0,-0x1));const _0x5c4d62=extractTitleFromComment(_0x5897c6),_0x53cb04=_0x5c4d62||_0x33dfbe;_0x327342['push']({'path':_0x33dfbe[_0x1c994a(0x118)]('$',':'),'label':_0x53cb04});}}}),_0x327342[_0x2cfd14(0x120)](_0x41beeb=>_0x41beeb[_0x2cfd14(0x11d)]!=='');}function a12_0x3137(){const _0x56376d=['.tsx','slice','2KYkCjr','3711428bknkhK','18883550sLsjyQ','90354LQUwgB','trim','616rCqAFA','12uQjdBq','replace','replaceAll','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','match','utf-8','endsWith','path','isDirectory','717905TVOYLU','filter','3049529mLwULk','167355SwadLD','index.tsx','cwd','1652934NCQzyy'];a12_0x3137=function(){return _0x56376d;};return a12_0x3137();}
@@ -1 +1 @@
1
- (function(_0x4a7462,_0xa43f3a){const _0x237151=a13_0xa332,_0x586f22=_0x4a7462();while(!![]){try{const _0x49fcce=-parseInt(_0x237151(0x180))/0x1*(parseInt(_0x237151(0x1a5))/0x2)+-parseInt(_0x237151(0x187))/0x3*(parseInt(_0x237151(0x198))/0x4)+parseInt(_0x237151(0x19b))/0x5*(parseInt(_0x237151(0x1a1))/0x6)+parseInt(_0x237151(0x1a0))/0x7+parseInt(_0x237151(0x195))/0x8*(-parseInt(_0x237151(0x18d))/0x9)+parseInt(_0x237151(0x19d))/0xa+parseInt(_0x237151(0x1a4))/0xb;if(_0x49fcce===_0xa43f3a)break;else _0x586f22['push'](_0x586f22['shift']());}catch(_0x51b3d0){_0x586f22['push'](_0x586f22['shift']());}}}(a13_0x50cb,0x77fb7));import{getCookie}from'../auth/get-cookie.js';function a13_0x50cb(){const _0x5e8fc0=['status','4769358AIYhrQ','868nfxUnZ','/smartapi/menu/find?appCode=','appcode','\x20个线上菜单','error','1292VzdpAZ','resources','parse','正在获取线上菜单列表...\x20(appCode:\x20','info','!\x20请使用以下方式之一:','extend','2766tesvRW','errorCode','success','log','flat','json','110673QzYQlW','application/json','children','服务端返回空菜单列表','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','get-online-menu-list','path','获取菜单列表失败:\x20','592kwBIJf','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','errorMsg','2396GVeSRm','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','获取菜单列表失败,HTTP状态码:\x20','2227970KvvMyL','GET','4860330jfuvXC','未知错误','成功获取\x20','4925424mvhZgP','12NzEhHR','isArray'];a13_0x50cb=function(){return _0x5e8fc0;};return a13_0x50cb();}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();function a13_0xa332(_0x255a7f,_0x152a67){_0x255a7f=_0x255a7f-0x17e;const _0x50cb59=a13_0x50cb();let _0xa3325a=_0x50cb59[_0x255a7f];return _0xa3325a;}export async function getOnlineMenuList(){const _0x5e14f0=a13_0xa332,_0x4b8cc1=config?.[_0x5e14f0(0x1a7)];if(!_0x4b8cc1){const _0x25ae9b='未提供应用AppCode,且配置中也没有默认值';return logger[_0x5e14f0(0x17f)](_0x5e14f0(0x192),_0x25ae9b),console['error']('×\x20'+_0x25ae9b),console[_0x5e14f0(0x18a)](_0x5e14f0(0x185)),console[_0x5e14f0(0x18a)](_0x5e14f0(0x199)),console[_0x5e14f0(0x18a)](_0x5e14f0(0x191)),[];}logger[_0x5e14f0(0x184)](_0x5e14f0(0x192),_0x5e14f0(0x183)+_0x4b8cc1+')');const _0x112035=await fetch(getApiDomain()+_0x5e14f0(0x1a6)+_0x4b8cc1,{'method':_0x5e14f0(0x19c),'headers':{'Content-Type':_0x5e14f0(0x18e),'Cookie':getCookie()}});if(!_0x112035['ok']){if(_0x112035[_0x5e14f0(0x1a3)]===0x191){const _0xc4ee1e=_0x5e14f0(0x196);logger[_0x5e14f0(0x17f)](_0x5e14f0(0x192),_0xc4ee1e,{'status':_0x112035[_0x5e14f0(0x1a3)]});throw new Error(_0xc4ee1e);}const _0x36ca45=_0x5e14f0(0x19a)+_0x112035[_0x5e14f0(0x1a3)];logger['error'](_0x5e14f0(0x192),_0x36ca45);throw new Error(_0x36ca45);}const _0x49e3b7=await _0x112035[_0x5e14f0(0x18c)]();if(!_0x49e3b7[_0x5e14f0(0x189)]){const _0x27a58f=_0x5e14f0(0x194)+(_0x49e3b7['errorMsg']||_0x5e14f0(0x19e));logger[_0x5e14f0(0x17f)](_0x5e14f0(0x192),_0x27a58f,{'errorCode':_0x49e3b7[_0x5e14f0(0x188)],'errorMsg':_0x49e3b7[_0x5e14f0(0x197)]});throw new Error(_0x27a58f);}if(!_0x49e3b7['data'])return logger[_0x5e14f0(0x184)](_0x5e14f0(0x192),_0x5e14f0(0x190)),[];return logger['info']('get-online-menu-list',_0x5e14f0(0x19f)+_0x49e3b7['data']['length']+_0x5e14f0(0x17e)),_0x49e3b7['data']['map'](formatMenuList)[_0x5e14f0(0x18b)]();}function formatMenuList(_0x115c6a){const _0x203fc0=a13_0xa332;let _0x5893d2=[];try{if(_0x115c6a[_0x203fc0(0x186)]?.[_0x203fc0(0x181)]){const _0x250e51=JSON[_0x203fc0(0x182)](_0x115c6a[_0x203fc0(0x186)][_0x203fc0(0x181)]);Array[_0x203fc0(0x1a2)](_0x250e51)&&(_0x5893d2=_0x250e51);}}catch(_0x16ed3e){}const _0x33b3dd=[{'id':_0x115c6a['id'],'path':_0x115c6a[_0x203fc0(0x193)],'label':_0x115c6a['label'],'resources':_0x5893d2}];if(_0x115c6a[_0x203fc0(0x18f)]&&_0x115c6a[_0x203fc0(0x18f)]['length']>0x0)for(const _0x29bfc6 of _0x115c6a[_0x203fc0(0x18f)]){_0x33b3dd['push'](...formatMenuList(_0x29bfc6));}return _0x33b3dd;}
1
+ function a13_0x5b3d(_0x36d70c,_0x53bf40){_0x36d70c=_0x36d70c-0x1d0;const _0xb324a7=a13_0xb324();let _0x5b3d55=_0xb324a7[_0x36d70c];return _0x5b3d55;}(function(_0x40165e,_0xad9d04){const _0x47f826=a13_0x5b3d,_0x5b591e=_0x40165e();while(!![]){try{const _0x2de45e=parseInt(_0x47f826(0x1db))/0x1+-parseInt(_0x47f826(0x1dd))/0x2*(parseInt(_0x47f826(0x1e6))/0x3)+-parseInt(_0x47f826(0x1dc))/0x4*(parseInt(_0x47f826(0x1f4))/0x5)+parseInt(_0x47f826(0x1da))/0x6*(parseInt(_0x47f826(0x1ea))/0x7)+-parseInt(_0x47f826(0x1d5))/0x8*(-parseInt(_0x47f826(0x1d0))/0x9)+-parseInt(_0x47f826(0x1f7))/0xa*(parseInt(_0x47f826(0x1f0))/0xb)+parseInt(_0x47f826(0x1eb))/0xc;if(_0x2de45e===_0xad9d04)break;else _0x5b591e['push'](_0x5b591e['shift']());}catch(_0x2a54ae){_0x5b591e['push'](_0x5b591e['shift']());}}}(a13_0xb324,0x464f0));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a13_0xb324(){const _0x59be40=['GET','99brRZrG','errorMsg','!\x20请使用以下方式之一:','push','189920WwPGax','children','label','568810zIIPgb','extend','info','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','2331JndJqG','status','parse','path','data','12784qEZcxZ','成功获取\x20','get-online-menu-list','获取菜单列表失败,HTTP状态码:\x20','isArray','3678EIZQlp','212314zZYsDU','12lpDupR','4cexrpR','resources','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','application/json','success','\x20个线上菜单','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','log','服务端返回空菜单列表','508674lEmnyF','正在获取线上菜单列表...\x20(appCode:\x20','flat','error','5859cEXYnq','1364448zFDMiM','length','map','未知错误'];a13_0xb324=function(){return _0x59be40;};return a13_0xb324();}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';const config=readConfig();export async function getOnlineMenuList(){const _0x1ca3a3=a13_0x5b3d,_0x32138b=config?.['appcode'];if(!_0x32138b){const _0x4427dd='未提供应用AppCode,且配置中也没有默认值';return logger[_0x1ca3a3(0x1e9)](_0x1ca3a3(0x1d7),_0x4427dd),console[_0x1ca3a3(0x1e9)]('×\x20'+_0x4427dd),console[_0x1ca3a3(0x1e4)](_0x1ca3a3(0x1f2)),console[_0x1ca3a3(0x1e4)](_0x1ca3a3(0x1df)),console['log'](_0x1ca3a3(0x1e3)),[];}logger[_0x1ca3a3(0x1f9)]('get-online-menu-list',_0x1ca3a3(0x1e7)+_0x32138b+')');const _0x569ed0=await fetch(getApiDomain()+'/smartapi/menu/find?appCode='+_0x32138b,{'method':_0x1ca3a3(0x1ef),'headers':{'Content-Type':_0x1ca3a3(0x1e0),'Cookie':getCookie()}});if(!_0x569ed0['ok']){if(_0x569ed0[_0x1ca3a3(0x1d1)]===0x191){const _0x5d4903=_0x1ca3a3(0x1fa);logger[_0x1ca3a3(0x1e9)]('get-online-menu-list',_0x5d4903,{'status':_0x569ed0[_0x1ca3a3(0x1d1)]});throw new Error(_0x5d4903);}const _0x7959f1=_0x1ca3a3(0x1d8)+_0x569ed0[_0x1ca3a3(0x1d1)];logger[_0x1ca3a3(0x1e9)]('get-online-menu-list',_0x7959f1);throw new Error(_0x7959f1);}const _0x2f3036=await _0x569ed0['json']();if(!_0x2f3036[_0x1ca3a3(0x1e1)]){const _0x102be4='获取菜单列表失败:\x20'+(_0x2f3036[_0x1ca3a3(0x1f1)]||_0x1ca3a3(0x1ee));logger[_0x1ca3a3(0x1e9)](_0x1ca3a3(0x1d7),_0x102be4,{'errorCode':_0x2f3036['errorCode'],'errorMsg':_0x2f3036[_0x1ca3a3(0x1f1)]});throw new Error(_0x102be4);}if(!_0x2f3036[_0x1ca3a3(0x1d4)])return logger[_0x1ca3a3(0x1f9)](_0x1ca3a3(0x1d7),_0x1ca3a3(0x1e5)),[];return logger['info'](_0x1ca3a3(0x1d7),_0x1ca3a3(0x1d6)+_0x2f3036[_0x1ca3a3(0x1d4)][_0x1ca3a3(0x1ec)]+_0x1ca3a3(0x1e2)),_0x2f3036['data'][_0x1ca3a3(0x1ed)](formatMenuList)[_0x1ca3a3(0x1e8)]();}function formatMenuList(_0x2df56a){const _0x23bacc=a13_0x5b3d;let _0x42b00e=[];try{if(_0x2df56a[_0x23bacc(0x1f8)]?.[_0x23bacc(0x1de)]){const _0x55c4d6=JSON[_0x23bacc(0x1d2)](_0x2df56a['extend']['resources']);Array[_0x23bacc(0x1d9)](_0x55c4d6)&&(_0x42b00e=_0x55c4d6);}}catch(_0x15ab7e){}const _0x12b33d=[{'id':_0x2df56a['id'],'path':_0x2df56a[_0x23bacc(0x1d3)],'label':_0x2df56a[_0x23bacc(0x1f6)],'resources':_0x42b00e}];if(_0x2df56a[_0x23bacc(0x1f5)]&&_0x2df56a[_0x23bacc(0x1f5)][_0x23bacc(0x1ec)]>0x0)for(const _0x423693 of _0x2df56a[_0x23bacc(0x1f5)]){_0x12b33d[_0x23bacc(0x1f3)](...formatMenuList(_0x423693));}return _0x12b33d;}
@@ -1 +1 @@
1
- function a15_0x3663(_0x597e90,_0x177aef){_0x597e90=_0x597e90-0x8a;const _0x5e4cf2=a15_0x5e4c();let _0x366394=_0x5e4cf2[_0x597e90];return _0x366394;}(function(_0x2d53a1,_0x146870){const _0x1be349=a15_0x3663,_0x3a22b5=_0x2d53a1();while(!![]){try{const _0x184fcf=parseInt(_0x1be349(0x95))/0x1*(-parseInt(_0x1be349(0x8f))/0x2)+-parseInt(_0x1be349(0x96))/0x3+parseInt(_0x1be349(0x8b))/0x4+parseInt(_0x1be349(0x94))/0x5+parseInt(_0x1be349(0x8e))/0x6*(parseInt(_0x1be349(0x90))/0x7)+-parseInt(_0x1be349(0x8d))/0x8*(-parseInt(_0x1be349(0x98))/0x9)+parseInt(_0x1be349(0x92))/0xa*(-parseInt(_0x1be349(0x93))/0xb);if(_0x184fcf===_0x146870)break;else _0x3a22b5['push'](_0x3a22b5['shift']());}catch(_0x393c10){_0x3a22b5['push'](_0x3a22b5['shift']());}}}(a15_0x5e4c,0x7b843));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';function a15_0x5e4c(){const _0xd93ccc=['7OXfoxB','finally','5077590dXfsOL','33achvVP','1388965kZYIlL','7MWLfkd','392511SISBmF','catch','8070939FuGWTo','then','3023564FiGLAt','message','8ESkqPb','5566278MnMBHB','199466FXzkmj'];a15_0x5e4c=function(){return _0xd93ccc;};return a15_0x5e4c();}export function useGetOnlineMenuList(){const [_0x23f12c,_0x38dbc0]=useState([]),[_0x1b38d6,_0x4f9b32]=useState(!![]),[_0x28006b,_0x53459d]=useState('');return useEffect(()=>{const _0x51ac5f=a15_0x3663;_0x4f9b32(!![]),_0x53459d(''),getOnlineMenuList()[_0x51ac5f(0x8a)](_0x38dbc0)[_0x51ac5f(0x97)](_0x2e5054=>{const _0x59d95c=_0x51ac5f;_0x53459d(_0x2e5054[_0x59d95c(0x8c)]||'获取菜单列表失败');})[_0x51ac5f(0x91)](()=>_0x4f9b32(![]));},[]),{'menuList':_0x23f12c,'loading':_0x1b38d6,'error':_0x28006b};}
1
+ function a15_0x8281(){const _0x3d137a=['337eZrjIb','1562199OMTKmI','获取菜单列表失败','3415689LPoOwy','8vJizLS','6007666xzocVZ','70543dgrZTp','1593510HnuBgm','then','message','470eFzgSh','879975TrAcbh','5658asjbzd','4OzELri'];a15_0x8281=function(){return _0x3d137a;};return a15_0x8281();}(function(_0x539eea,_0x4eb372){const _0x5149c8=a15_0x4b6b,_0x1ce1b1=_0x539eea();while(!![]){try{const _0x6b1469=parseInt(_0x5149c8(0xc8))/0x1*(-parseInt(_0x5149c8(0xc6))/0x2)+-parseInt(_0x5149c8(0xc9))/0x3*(-parseInt(_0x5149c8(0xc7))/0x4)+-parseInt(_0x5149c8(0xc5))/0x5+parseInt(_0x5149c8(0xcf))/0x6+-parseInt(_0x5149c8(0xcd))/0x7*(-parseInt(_0x5149c8(0xcc))/0x8)+parseInt(_0x5149c8(0xcb))/0x9+parseInt(_0x5149c8(0xc4))/0xa*(-parseInt(_0x5149c8(0xce))/0xb);if(_0x6b1469===_0x4eb372)break;else _0x1ce1b1['push'](_0x1ce1b1['shift']());}catch(_0x42ecc8){_0x1ce1b1['push'](_0x1ce1b1['shift']());}}}(a15_0x8281,0x90d92));import{useEffect,useState}from'react';function a15_0x4b6b(_0x36f959,_0x1b164c){_0x36f959=_0x36f959-0xc2;const _0x828193=a15_0x8281();let _0x4b6bce=_0x828193[_0x36f959];return _0x4b6bce;}import{getOnlineMenuList}from'./get-online-menu-list.js';export function useGetOnlineMenuList(){const [_0x5a01eb,_0x5cc821]=useState([]),[_0x3c6fb3,_0x116748]=useState(!![]),[_0x3b34eb,_0x1faf02]=useState('');return useEffect(()=>{const _0x30d15a=a15_0x4b6b;_0x116748(!![]),_0x1faf02(''),getOnlineMenuList()[_0x30d15a(0xc2)](_0x5cc821)['catch'](_0x134f12=>{const _0x1c516d=_0x30d15a;_0x1faf02(_0x134f12[_0x1c516d(0xc3)]||_0x1c516d(0xca));})['finally'](()=>_0x116748(![]));},[]),{'menuList':_0x5a01eb,'loading':_0x3c6fb3,'error':_0x3b34eb};}
@@ -1 +1 @@
1
- (function(_0x56cc7c,_0x3b6745){const _0x4ed6bd=a16_0xe94b,_0x37e15d=_0x56cc7c();while(!![]){try{const _0x4a8b6c=-parseInt(_0x4ed6bd(0x16a))/0x1+-parseInt(_0x4ed6bd(0x16e))/0x2*(parseInt(_0x4ed6bd(0x168))/0x3)+parseInt(_0x4ed6bd(0x16c))/0x4*(parseInt(_0x4ed6bd(0x167))/0x5)+parseInt(_0x4ed6bd(0x169))/0x6*(-parseInt(_0x4ed6bd(0x16b))/0x7)+-parseInt(_0x4ed6bd(0x165))/0x8*(-parseInt(_0x4ed6bd(0x161))/0x9)+parseInt(_0x4ed6bd(0x16d))/0xa+parseInt(_0x4ed6bd(0x162))/0xb;if(_0x4a8b6c===_0x3b6745)break;else _0x37e15d['push'](_0x37e15d['shift']());}catch(_0x2d6872){_0x37e15d['push'](_0x37e15d['shift']());}}}(a16_0x24ff,0x7b9c1));export function getRemainingSpaces(_0x17049a,_0x3fe73a){const _0x4f251a=a16_0xe94b,_0x2f0b48=getStringWidth(_0x3fe73a);return Array(Math[_0x4f251a(0x170)](0x0,_0x17049a-_0x2f0b48))[_0x4f251a(0x163)]('\x20')[_0x4f251a(0x164)]('');}function a16_0x24ff(){const _0xdf5c6a=['max','4023oxSSAI','11252989XUthZp','fill','join','14296tTLmil','repeat','205BlIHYy','1486371YQSmQt','665052UYGVPQ','694383sqImdN','56PDeMHR','28276pnsvVC','4712640AcYQKH','2nlqfFv','test'];a16_0x24ff=function(){return _0xdf5c6a;};return a16_0x24ff();}export function getMaxWidth(_0x36af4c,_0x4473d5=0x2){const _0xbaa068=a16_0xe94b;let _0x46396e='',_0x3aa12f=0x0;for(const _0x29afcf of _0x36af4c){const _0x504349=getStringWidth(_0x29afcf);_0x504349>_0x3aa12f&&(_0x3aa12f=_0x504349,_0x46396e=_0x29afcf);}return _0x46396e+'\x20'[_0xbaa068(0x166)](_0x4473d5);}function a16_0xe94b(_0xbfcdc2,_0x40c010){_0xbfcdc2=_0xbfcdc2-0x161;const _0x24ffd1=a16_0x24ff();let _0xe94b56=_0x24ffd1[_0xbfcdc2];return _0xe94b56;}export function getStringWidth(_0x90357c){const _0x2595b4=a16_0xe94b;let _0x24bb4a=0x0;for(const _0x4d471a of _0x90357c){/[\u4e00-\u9fa5]/[_0x2595b4(0x16f)](_0x4d471a)?_0x24bb4a+=0x2:_0x24bb4a+=0x1;}return _0x24bb4a;}
1
+ (function(_0x52ea8a,_0x2d234d){const _0x2c8be2=a16_0x2b50,_0x3f7711=_0x52ea8a();while(!![]){try{const _0x2a3e97=parseInt(_0x2c8be2(0x1e0))/0x1+-parseInt(_0x2c8be2(0x1d9))/0x2*(-parseInt(_0x2c8be2(0x1dd))/0x3)+-parseInt(_0x2c8be2(0x1d8))/0x4+parseInt(_0x2c8be2(0x1df))/0x5+parseInt(_0x2c8be2(0x1da))/0x6+parseInt(_0x2c8be2(0x1dc))/0x7*(-parseInt(_0x2c8be2(0x1d7))/0x8)+parseInt(_0x2c8be2(0x1de))/0x9;if(_0x2a3e97===_0x2d234d)break;else _0x3f7711['push'](_0x3f7711['shift']());}catch(_0x61262a){_0x3f7711['push'](_0x3f7711['shift']());}}}(a16_0x1e0d,0xd1053));function a16_0x1e0d(){const _0x7607d1=['4jEqaJr','1341378GzjaRw','fill','2212pBzAcW','1490145CHytUY','8514936RgohQJ','689575QCMRKb','379952CZwXEh','join','7536WTCBoj','6108580lptVCb'];a16_0x1e0d=function(){return _0x7607d1;};return a16_0x1e0d();}export function getRemainingSpaces(_0x2a35e5,_0x283bd4){const _0x88e31d=a16_0x2b50,_0x4d9d92=getStringWidth(_0x283bd4);return Array(Math['max'](0x0,_0x2a35e5-_0x4d9d92))[_0x88e31d(0x1db)]('\x20')[_0x88e31d(0x1d6)]('');}function a16_0x2b50(_0x114011,_0x2e3d1e){_0x114011=_0x114011-0x1d6;const _0x1e0db1=a16_0x1e0d();let _0x2b5088=_0x1e0db1[_0x114011];return _0x2b5088;}export function getMaxWidth(_0xd28780,_0x565c12=0x2){let _0x1976a3='',_0x2cc6cf=0x0;for(const _0x3730d7 of _0xd28780){const _0x599073=getStringWidth(_0x3730d7);_0x599073>_0x2cc6cf&&(_0x2cc6cf=_0x599073,_0x1976a3=_0x3730d7);}return _0x1976a3+'\x20'['repeat'](_0x565c12);}export function getStringWidth(_0x454975){let _0x2f8c22=0x0;for(const _0x2ea74a of _0x454975){/[\u4e00-\u9fa5]/['test'](_0x2ea74a)?_0x2f8c22+=0x2:_0x2f8c22+=0x1;}return _0x2f8c22;}
@@ -1 +1 @@
1
- (function(_0x1b4886,_0x15f041){const _0x1dc15c=a17_0xed43,_0x4bc291=_0x1b4886();while(!![]){try{const _0x1cf6e0=parseInt(_0x1dc15c(0xd0))/0x1*(parseInt(_0x1dc15c(0xdd))/0x2)+-parseInt(_0x1dc15c(0xd3))/0x3+-parseInt(_0x1dc15c(0xd4))/0x4+parseInt(_0x1dc15c(0xd6))/0x5*(-parseInt(_0x1dc15c(0xdb))/0x6)+-parseInt(_0x1dc15c(0xd8))/0x7*(-parseInt(_0x1dc15c(0xcf))/0x8)+-parseInt(_0x1dc15c(0xda))/0x9*(-parseInt(_0x1dc15c(0xd9))/0xa)+parseInt(_0x1dc15c(0xd2))/0xb*(parseInt(_0x1dc15c(0xd7))/0xc);if(_0x1cf6e0===_0x15f041)break;else _0x4bc291['push'](_0x4bc291['shift']());}catch(_0x4ad414){_0x4bc291['push'](_0x4bc291['shift']());}}}(a17_0x176b,0xd6eb4));export function isValidJsHttpsUrl(_0x312f9a){const _0x5e84b5=a17_0xed43;return/^https:\/\/.+\.js(\?.*)?$/[_0x5e84b5(0xdc)](_0x312f9a[_0x5e84b5(0xd1)]());}export function isValidCssHttpsUrl(_0x41e3e3){const _0x57ca41=a17_0xed43;return/^https:\/\/.+\.css(\?.*)?$/[_0x57ca41(0xdc)](_0x41e3e3[_0x57ca41(0xd1)]());}export async function isUrlReachable(_0x4e8e79){const _0x16e28f=a17_0xed43;try{const _0x273c4d=await fetch(_0x4e8e79,{'method':_0x16e28f(0xd5)});return _0x273c4d['ok'];}catch{return![];}}function a17_0xed43(_0x3c5c27,_0x94d53){_0x3c5c27=_0x3c5c27-0xcf;const _0x176bd1=a17_0x176b();let _0xed436d=_0x176bd1[_0x3c5c27];return _0xed436d;}function a17_0x176b(){const _0x26778f=['532XqFonO','4390SLZiul','21753vrgFbL','30auQcjd','test','257874knZRQB','62240KFPMHA','12EYqKiE','trim','14894oAAldt','874815IsEIWI','4568352gAAWza','HEAD','934330GpCqXc','432HFaqoC'];a17_0x176b=function(){return _0x26778f;};return a17_0x176b();}
1
+ function a17_0x5d71(_0x14bf22,_0x2debcf){_0x14bf22=_0x14bf22-0x73;const _0x84de4f=a17_0x84de();let _0x5d714a=_0x84de4f[_0x14bf22];return _0x5d714a;}(function(_0x32eea9,_0x8ecf72){const _0x3b4037=a17_0x5d71,_0xfc721d=_0x32eea9();while(!![]){try{const _0x5c2ab3=parseInt(_0x3b4037(0x79))/0x1*(-parseInt(_0x3b4037(0x78))/0x2)+parseInt(_0x3b4037(0x77))/0x3+parseInt(_0x3b4037(0x73))/0x4*(parseInt(_0x3b4037(0x75))/0x5)+-parseInt(_0x3b4037(0x74))/0x6+parseInt(_0x3b4037(0x7a))/0x7+parseInt(_0x3b4037(0x7c))/0x8+-parseInt(_0x3b4037(0x7d))/0x9;if(_0x5c2ab3===_0x8ecf72)break;else _0xfc721d['push'](_0xfc721d['shift']());}catch(_0x48f3c6){_0xfc721d['push'](_0xfc721d['shift']());}}}(a17_0x84de,0xdea14));export function isValidJsHttpsUrl(_0x35cce0){const _0x152bf3=a17_0x5d71;return/^https:\/\/.+\.js(\?.*)?$/[_0x152bf3(0x7b)](_0x35cce0[_0x152bf3(0x7e)]());}export function isValidCssHttpsUrl(_0x4a4514){const _0x456a18=a17_0x5d71;return/^https:\/\/.+\.css(\?.*)?$/[_0x456a18(0x7b)](_0x4a4514[_0x456a18(0x7e)]());}function a17_0x84de(){const _0x1c39f3=['test','1238336snEBAB','4751469LAeznB','trim','4432SwpSiV','7380366wsBVRg','7775PYNyJV','HEAD','581136NdXoPu','2ocQRWI','1206517oHKxGH','12634769FTqLjy'];a17_0x84de=function(){return _0x1c39f3;};return a17_0x84de();}export async function isUrlReachable(_0x1ea5d0){const _0x9d4a72=a17_0x5d71;try{const _0x27b5d1=await fetch(_0x1ea5d0,{'method':_0x9d4a72(0x76)});return _0x27b5d1['ok'];}catch{return![];}}
@@ -1 +1 @@
1
- function a18_0x10a0(_0x40a8d7,_0x1185a6){_0x40a8d7=_0x40a8d7-0x155;const _0x491f99=a18_0x491f();let _0x10a0e3=_0x491f99[_0x40a8d7];return _0x10a0e3;}(function(_0x43319a,_0x537488){const _0x3d8f5c=a18_0x10a0,_0x346ad9=_0x43319a();while(!![]){try{const _0x313372=-parseInt(_0x3d8f5c(0x15d))/0x1*(-parseInt(_0x3d8f5c(0x160))/0x2)+-parseInt(_0x3d8f5c(0x162))/0x3+parseInt(_0x3d8f5c(0x15a))/0x4+-parseInt(_0x3d8f5c(0x163))/0x5*(parseInt(_0x3d8f5c(0x161))/0x6)+parseInt(_0x3d8f5c(0x15e))/0x7+parseInt(_0x3d8f5c(0x15c))/0x8*(-parseInt(_0x3d8f5c(0x158))/0x9)+parseInt(_0x3d8f5c(0x159))/0xa;if(_0x313372===_0x537488)break;else _0x346ad9['push'](_0x346ad9['shift']());}catch(_0x454a81){_0x346ad9['push'](_0x346ad9['shift']());}}}(a18_0x491f,0x8b10a));function a18_0x491f(){const _0x1d24c4=['filter','待更新的资源链接:','length','map','from','195417JCRUmC','5454350HRUryj','1994388tzQtkI','column','232OLKbwz','1014CComRG','1586151kxFmcX','cyan','1446LmkINR','234JpVilE','791877LZPLIJ','69295DnZXNp'];a18_0x491f=function(){return _0x1d24c4;};return a18_0x491f();}import{jsx as a18_0x550396,jsxs as a18_0x252bb5}from'react/jsx-runtime';import{Text,Box}from'ink';export function CurrentMenuCdnContent(_0x493595){const _0x500dd4=a18_0x10a0,{menuList:_0x1d9203}=_0x493595,_0x33be16=_0x1d9203[_0x500dd4(0x164)](_0x1ed69b=>_0x1ed69b['resources'][_0x500dd4(0x155)]),_0x4f4760=Array[_0x500dd4(0x157)](new Set(_0x1d9203[_0x500dd4(0x156)](_0x2b90c0=>_0x2b90c0['resources'])['flat']()));return a18_0x252bb5(Box,{'flexDirection':_0x500dd4(0x15b),'children':[a18_0x550396(Text,{'color':_0x500dd4(0x15f),'children':'*\x20待更新的菜单&资源链接'}),a18_0x252bb5(Box,{'marginTop':0x1,'flexDirection':'column','children':[a18_0x252bb5(Text,{'bold':!![],'children':['\x20\x20','待更新的菜单列表:']}),a18_0x252bb5(Text,{'children':['\x20\x20',_0x33be16[_0x500dd4(0x156)](_0x3b0f16=>_0x3b0f16['label'])['join'](',\x20')]})]}),a18_0x550396(Box,{'marginTop':0x1,'children':a18_0x252bb5(Text,{'bold':!![],'children':['\x20\x20',_0x500dd4(0x165)]})}),_0x4f4760[_0x500dd4(0x156)](_0x2c4672=>a18_0x550396(Box,{'children':a18_0x252bb5(Text,{'children':['\x20\x20',_0x2c4672]})},_0x2c4672))]});}
1
+ (function(_0x533432,_0x2aee56){const _0x1987d5=a18_0x1890,_0x1b0921=_0x533432();while(!![]){try{const _0xded2c4=parseInt(_0x1987d5(0x1fa))/0x1*(parseInt(_0x1987d5(0x1f2))/0x2)+-parseInt(_0x1987d5(0x1eb))/0x3*(-parseInt(_0x1987d5(0x1f8))/0x4)+-parseInt(_0x1987d5(0x1f3))/0x5*(parseInt(_0x1987d5(0x1ed))/0x6)+parseInt(_0x1987d5(0x1e8))/0x7+parseInt(_0x1987d5(0x1ee))/0x8*(parseInt(_0x1987d5(0x1e6))/0x9)+-parseInt(_0x1987d5(0x1f6))/0xa*(parseInt(_0x1987d5(0x1f0))/0xb)+parseInt(_0x1987d5(0x1ec))/0xc*(-parseInt(_0x1987d5(0x1e9))/0xd);if(_0xded2c4===_0x2aee56)break;else _0x1b0921['push'](_0x1b0921['shift']());}catch(_0x450368){_0x1b0921['push'](_0x1b0921['shift']());}}}(a18_0x492d,0xde4ad));import{jsx as a18_0x51d52c,jsxs as a18_0x239b17}from'react/jsx-runtime';import{Text,Box}from'ink';function a18_0x492d(){const _0x167f20=['join','1glDZzZ','18CWmOah','待更新的菜单列表:','3436972ZsYpml','5219565ITmLHP','filter','3ZmHOXN','60RsCckZ','211836CPwfYo','5963472hwCAEU','flat','33RRlXSx','*\x20待更新的菜单&资源链接','2639932ffIgBq','115pYExrP','map','待更新的资源链接:','3141620gROKUo','length','5482912VQwDVW'];a18_0x492d=function(){return _0x167f20;};return a18_0x492d();}function a18_0x1890(_0x592f6c,_0x41cbb1){_0x592f6c=_0x592f6c-0x1e6;const _0x492d7e=a18_0x492d();let _0x1890fb=_0x492d7e[_0x592f6c];return _0x1890fb;}export function CurrentMenuCdnContent(_0x5d4330){const _0x3c1bec=a18_0x1890,{menuList:_0x4628b3}=_0x5d4330,_0x3468e1=_0x4628b3[_0x3c1bec(0x1ea)](_0x5a7e1c=>_0x5a7e1c['resources'][_0x3c1bec(0x1f7)]),_0x531a6b=Array['from'](new Set(_0x4628b3[_0x3c1bec(0x1f4)](_0x581877=>_0x581877['resources'])[_0x3c1bec(0x1ef)]()));return a18_0x239b17(Box,{'flexDirection':'column','children':[a18_0x51d52c(Text,{'color':'cyan','children':_0x3c1bec(0x1f1)}),a18_0x239b17(Box,{'marginTop':0x1,'flexDirection':'column','children':[a18_0x239b17(Text,{'bold':!![],'children':['\x20\x20',_0x3c1bec(0x1e7)]}),a18_0x239b17(Text,{'children':['\x20\x20',_0x3468e1[_0x3c1bec(0x1f4)](_0x8529b6=>_0x8529b6['label'])[_0x3c1bec(0x1f9)](',\x20')]})]}),a18_0x51d52c(Box,{'marginTop':0x1,'children':a18_0x239b17(Text,{'bold':!![],'children':['\x20\x20',_0x3c1bec(0x1f5)]})}),_0x531a6b['map'](_0x41b86c=>a18_0x51d52c(Box,{'children':a18_0x239b17(Text,{'children':['\x20\x20',_0x41b86c]})},_0x41b86c))]});}
@@ -1 +1 @@
1
- (function(_0x3b01ee,_0x5a50d5){const _0x40785f=a19_0x21ae,_0x1da1f4=_0x3b01ee();while(!![]){try{const _0x306cbd=-parseInt(_0x40785f(0x9e))/0x1+parseInt(_0x40785f(0x9b))/0x2+-parseInt(_0x40785f(0xa0))/0x3+parseInt(_0x40785f(0xa3))/0x4+parseInt(_0x40785f(0xa4))/0x5+parseInt(_0x40785f(0xa2))/0x6*(-parseInt(_0x40785f(0xa5))/0x7)+parseInt(_0x40785f(0x9c))/0x8;if(_0x306cbd===_0x5a50d5)break;else _0x1da1f4['push'](_0x1da1f4['shift']());}catch(_0x336c20){_0x1da1f4['push'](_0x1da1f4['shift']());}}}(a19_0x14e2,0x80ff0));import{jsx as a19_0x19ce01,jsxs as a19_0x505524}from'react/jsx-runtime';function a19_0x21ae(_0x15ad3d,_0x1e2e76){_0x15ad3d=_0x15ad3d-0x9b;const _0x14e244=a19_0x14e2();let _0x21ae94=_0x14e244[_0x15ad3d];return _0x21ae94;}import{Text,Box}from'ink';function a19_0x14e2(){const _0xed93d5=['green','498790bpyzsA','cyan','1655298IIiRJB','*\x20已输入的资源资源','1577448bkrlYq','1202308HZzViN','1813490ITAPJy','7aRxlTK','column','1186678hczoWm','4681744hDwfVr'];a19_0x14e2=function(){return _0xed93d5;};return a19_0x14e2();}export function InputCdnAsset(_0x387654){const _0x3b73e9=a19_0x21ae,{jsCdnUrl:_0x59ef0f,cssCdnUrl:_0x11f664}=_0x387654;return a19_0x505524(Box,{'flexDirection':_0x3b73e9(0xa6),'marginTop':0x1,'children':[a19_0x19ce01(Text,{'color':_0x3b73e9(0x9f),'children':_0x3b73e9(0xa1)}),a19_0x505524(Box,{'children':[a19_0x505524(Text,{'children':['\x20\x20','JS\x20链接:\x20']}),a19_0x19ce01(Text,{'color':'green','children':_0x59ef0f})]}),a19_0x505524(Box,{'children':[a19_0x505524(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a19_0x19ce01(Text,{'color':_0x3b73e9(0x9d),'children':_0x11f664})]})]});}
1
+ (function(_0x19d3d1,_0x3e2642){const _0x1c09f0=a19_0x6746,_0x4115a2=_0x19d3d1();while(!![]){try{const _0x123db5=parseInt(_0x1c09f0(0x1e8))/0x1*(-parseInt(_0x1c09f0(0x1e4))/0x2)+parseInt(_0x1c09f0(0x1e9))/0x3*(parseInt(_0x1c09f0(0x1df))/0x4)+-parseInt(_0x1c09f0(0x1e5))/0x5+parseInt(_0x1c09f0(0x1e0))/0x6+-parseInt(_0x1c09f0(0x1e1))/0x7*(parseInt(_0x1c09f0(0x1ea))/0x8)+-parseInt(_0x1c09f0(0x1e2))/0x9*(parseInt(_0x1c09f0(0x1ee))/0xa)+parseInt(_0x1c09f0(0x1ed))/0xb;if(_0x123db5===_0x3e2642)break;else _0x4115a2['push'](_0x4115a2['shift']());}catch(_0x4ce816){_0x4115a2['push'](_0x4115a2['shift']());}}}(a19_0x173f,0xe2b15));import{jsx as a19_0x1e273e,jsxs as a19_0x29db34}from'react/jsx-runtime';import{Text,Box}from'ink';function a19_0x173f(){const _0x4ce561=['41316clmhAR','9523626gzYRxm','2961497MBPRCi','63iRevKi','green','6XBFMua','383770gIbaMr','CSS\x20链接:\x20','column','604259lvWNyL','246IKiOKE','32bmqWke','JS\x20链接:\x20','cyan','40738588LZQtYF','2324870ZlHTZq'];a19_0x173f=function(){return _0x4ce561;};return a19_0x173f();}function a19_0x6746(_0x2d010d,_0x5c03a5){_0x2d010d=_0x2d010d-0x1df;const _0x173f46=a19_0x173f();let _0x674691=_0x173f46[_0x2d010d];return _0x674691;}export function InputCdnAsset(_0x35bcc7){const _0x44dd1e=a19_0x6746,{jsCdnUrl:_0x4ec8fa,cssCdnUrl:_0x931fc4}=_0x35bcc7;return a19_0x29db34(Box,{'flexDirection':_0x44dd1e(0x1e7),'marginTop':0x1,'children':[a19_0x1e273e(Text,{'color':_0x44dd1e(0x1ec),'children':'*\x20已输入的资源资源'}),a19_0x29db34(Box,{'children':[a19_0x29db34(Text,{'children':['\x20\x20',_0x44dd1e(0x1eb)]}),a19_0x1e273e(Text,{'color':_0x44dd1e(0x1e3),'children':_0x4ec8fa})]}),a19_0x29db34(Box,{'children':[a19_0x29db34(Text,{'children':['\x20\x20',_0x44dd1e(0x1e6)]}),a19_0x1e273e(Text,{'color':_0x44dd1e(0x1e3),'children':_0x931fc4})]})]});}
@@ -1 +1 @@
1
- (function(_0x564812,_0x1b3489){const _0x4d74fe=a20_0x1aa3,_0x47d434=_0x564812();while(!![]){try{const _0x475f39=parseInt(_0x4d74fe(0xe6))/0x1+parseInt(_0x4d74fe(0xdf))/0x2+-parseInt(_0x4d74fe(0xde))/0x3+parseInt(_0x4d74fe(0xce))/0x4*(-parseInt(_0x4d74fe(0xbb))/0x5)+parseInt(_0x4d74fe(0xcf))/0x6+-parseInt(_0x4d74fe(0xc6))/0x7*(-parseInt(_0x4d74fe(0xbe))/0x8)+parseInt(_0x4d74fe(0xcc))/0x9;if(_0x475f39===_0x1b3489)break;else _0x47d434['push'](_0x47d434['shift']());}catch(_0x30d814){_0x47d434['push'](_0x47d434['shift']());}}}(a20_0x8f17,0x61128));import{jsx as a20_0x23c910,jsxs as a20_0x1e3dc7,Fragment as a20_0x16f527}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a20_0x46144b from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';function a20_0x8f17(){const _0x4c0d0b=['JS\x20链接:\x20','green','\x20正在获取线上菜单资源链接...','CSS\x20链接无法访问','\x20←\x20','\x20命令重新登录','need-confirm','676389pDMcMq','column','map','\x20资源正在同步中...','rightArrow','dots','6066036VqfvdT','backspace','3316wbDuIw','1013466BJkvTy','*\x20请输入新的资源链接','red','gray','请输入有效的\x20JS\x20https\x20链接','√\x20更新成功','yellow','input-js','return','creating','请输入有效的\x20CSS\x20https\x20链接','resolve','CSS\x20链接:\x20','input-css','提示:使用\x20','2238255IDuTeD','998448VMqZDy','!\x20未找到菜单资源链接','输入项目的\x20CSS\x20资源链接(https://...)','length','delete','label','trim','461804hsNWxU','继续更新','cancel','updated','all','downArrow','cyan','输入项目的\x20JS\x20资源链接(https://...)','leftArrow','resources','slice','4565EKwNQF','value','flat','8PdrhqB'];a20_0x8f17=function(){return _0x4c0d0b;};return a20_0x8f17();}import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';function a20_0x1aa3(_0x1679f5,_0x28448d){_0x1679f5=_0x1679f5-0xb5;const _0x8f17e3=a20_0x8f17();let _0x1aa3d7=_0x8f17e3[_0x1679f5];return _0x1aa3d7;}import.meta.main&&render(a20_0x23c910(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x49208e=a20_0x1aa3,{exit:_0x353397}=useApp(),{loading:_0x5f456b,menuList:_0x4901b5,error:_0x411b7d}=useGetOnlineMenuList(),[_0x3e0fbe,_0x8d63a]=useState('ok'),[_0x1b2fd8,_0x34849b]=useState(_0x49208e(0xd6)),[_0x23b0ef,_0x18a040]=useState(''),[_0x13cd80,_0x5ba7cc]=useState(''),[_0x2b857a,_0x1a2f84]=useState(''),[_0x401e4a,_0x199c83]=useState(''),_0x5800da=Array['from'](new Set(_0x4901b5[_0x49208e(0xc8)](_0x321455=>_0x321455['resources'])[_0x49208e(0xbd)]()));useEffect(()=>{const _0x3efcc6=_0x49208e;_0x1b2fd8===_0x3efcc6(0xe9)&&setTimeout(_0x353397,0x32);},[_0x1b2fd8]),useInput(async(_0x4ebc83,_0x54e488)=>{const _0x134670=_0x49208e;if(_0x1b2fd8==='input-js'){if(_0x54e488[_0x134670(0xd7)]){const _0x3f14b8=_0x2b857a[_0x134670(0xe5)]();if(_0x3f14b8==='')return;if(!isValidJsHttpsUrl(_0x3f14b8)){_0x199c83(_0x134670(0xd3));return;}if(!await isUrlReachable(_0x3f14b8)){_0x199c83('JS\x20链接无法访问');return;}_0x18a040(_0x3f14b8),_0x1a2f84(''),_0x199c83(''),_0x34849b(_0x134670(0xdc));return;}if(_0x54e488['backspace']||_0x54e488[_0x134670(0xe3)]){_0x1a2f84(_0x46360d=>_0x46360d[_0x134670(0xba)](0x0,-0x1)),_0x199c83('');return;}_0x1a2f84(_0x184006=>_0x184006+_0x4ebc83);return;}if(_0x1b2fd8===_0x134670(0xdc)){if(_0x54e488[_0x134670(0xd7)]){const _0x44e5ca=_0x2b857a[_0x134670(0xe5)]();if(_0x44e5ca==='')return;if(!isValidCssHttpsUrl(_0x44e5ca)){_0x199c83(_0x134670(0xd9));return;}if(!await isUrlReachable(_0x44e5ca)){_0x199c83(_0x134670(0xc2));return;}_0x5ba7cc(_0x44e5ca),_0x1a2f84(''),_0x199c83(''),_0x34849b(_0x134670(0xc5));return;}if(_0x54e488[_0x134670(0xcd)]||_0x54e488[_0x134670(0xe3)]){_0x1a2f84(_0x2134ef=>_0x2134ef[_0x134670(0xba)](0x0,-0x1)),_0x199c83('');return;}_0x1a2f84(_0xd9b026=>_0xd9b026+_0x4ebc83);return;}if(_0x1b2fd8===_0x134670(0xc5)){(_0x54e488['upArrow']||_0x54e488[_0x134670(0xb5)]||_0x54e488[_0x134670(0xb8)]||_0x54e488[_0x134670(0xca)])&&_0x8d63a(_0x4788a0=>_0x4788a0==='ok'?_0x134670(0xe8):'ok');if(_0x54e488[_0x134670(0xd7)]){_0x34849b(_0x134670(0xd8));if(_0x3e0fbe==='ok')await Promise[_0x134670(0xea)](_0x4901b5[_0x134670(0xc8)](_0x20d7ba=>{const _0x5cb984=_0x134670,_0xb793b={'id':_0x20d7ba['id'],'label':_0x20d7ba['label'],'path':_0x20d7ba['path'],'resources':[_0x23b0ef,_0x13cd80]};if(_0x20d7ba[_0x5cb984(0xb9)][_0x5cb984(0xe2)]===0x0)return Promise[_0x5cb984(0xda)]();return updateMenuCdnUrl(_0xb793b);})),await new Promise(_0x153b08=>setTimeout(_0x153b08,0x3e8)),_0x34849b(_0x134670(0xe9));else _0x3e0fbe==='cancel'&&_0x353397();}}});if(_0x5f456b)return a20_0x1e3dc7(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x23c910(Text,{}),a20_0x23c910(a20_0x46144b,{'type':'dots'}),a20_0x23c910(Text,{'children':_0x49208e(0xc1)})]});if(_0x411b7d)return a20_0x1e3dc7(Box,{'flexDirection':_0x49208e(0xc7),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x1e3dc7(Text,{'color':_0x49208e(0xd1),'children':['✗\x20',_0x411b7d]}),a20_0x1e3dc7(Box,{'marginTop':0x1,'children':[a20_0x23c910(Text,{'color':'gray','children':_0x49208e(0xdd)}),a20_0x23c910(Text,{'color':_0x49208e(0xb6),'children':'lovrabet\x20auth'}),a20_0x23c910(Text,{'color':_0x49208e(0xd2),'children':_0x49208e(0xc4)})]})]});if(_0x5800da[_0x49208e(0xe2)]===0x0)return a20_0x23c910(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a20_0x23c910(Text,{'color':_0x49208e(0xd5),'children':_0x49208e(0xe0)})});if(_0x1b2fd8===_0x49208e(0xc5))return a20_0x1e3dc7(Box,{'flexDirection':_0x49208e(0xc7),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x23c910(CurrentMenuCdnContent,{'menuList':_0x4901b5}),a20_0x23c910(InputCdnAsset,{'jsCdnUrl':_0x23b0ef,'cssCdnUrl':_0x13cd80}),a20_0x23c910(Box,{'marginTop':0x1,'flexDirection':_0x49208e(0xc7),'children':[{'label':_0x49208e(0xe7),'value':'ok'},{'label':'取消更新','value':_0x49208e(0xe8)}]['map'](_0x42abc4=>a20_0x1e3dc7(Text,{'color':_0x3e0fbe===_0x42abc4['value']?_0x49208e(0xd5):undefined,'children':[_0x3e0fbe===_0x42abc4[_0x49208e(0xbc)]?'>\x20':'\x20\x20',_0x42abc4[_0x49208e(0xe4)]]},_0x42abc4[_0x49208e(0xbc)]))})]});if(_0x1b2fd8===_0x49208e(0xd8))return a20_0x1e3dc7(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a20_0x23c910(CurrentMenuCdnContent,{'menuList':_0x4901b5}),a20_0x23c910(InputCdnAsset,{'jsCdnUrl':_0x23b0ef,'cssCdnUrl':_0x13cd80}),a20_0x1e3dc7(Box,{'marginTop':0x1,'children':[a20_0x23c910(a20_0x46144b,{'type':_0x49208e(0xcb)}),a20_0x23c910(Text,{'children':_0x49208e(0xc9)})]})]});if(_0x1b2fd8===_0x49208e(0xe9))return a20_0x1e3dc7(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a20_0x23c910(CurrentMenuCdnContent,{'menuList':_0x4901b5}),a20_0x23c910(InputCdnAsset,{'jsCdnUrl':_0x23b0ef,'cssCdnUrl':_0x13cd80}),a20_0x23c910(Box,{'marginTop':0x1,'children':a20_0x23c910(Text,{'color':_0x49208e(0xc0),'children':_0x49208e(0xd4)})})]});return a20_0x1e3dc7(Box,{'flexDirection':_0x49208e(0xc7),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x23c910(CurrentMenuCdnContent,{'menuList':_0x4901b5}),a20_0x1e3dc7(Box,{'marginTop':0x1,'flexDirection':_0x49208e(0xc7),'children':[a20_0x23c910(Text,{'color':_0x49208e(0xb6),'children':_0x49208e(0xd0)}),_0x23b0ef?a20_0x1e3dc7(Box,{'children':[a20_0x1e3dc7(Text,{'color':_0x49208e(0xd2),'children':['\x20\x20','JS\x20链接:\x20']}),a20_0x23c910(Text,{'color':_0x49208e(0xc0),'children':_0x23b0ef})]}):_0x1b2fd8===_0x49208e(0xd6)&&a20_0x1e3dc7(a20_0x16f527,{'children':[a20_0x1e3dc7(Box,{'children':[a20_0x1e3dc7(Text,{'children':['\x20\x20',_0x49208e(0xbf)]}),a20_0x23c910(Text,{'color':'green','children':_0x2b857a}),_0x401e4a&&a20_0x1e3dc7(Text,{'color':_0x49208e(0xd1),'children':[_0x49208e(0xc3),_0x401e4a]})]}),!_0x401e4a&&a20_0x23c910(Box,{'children':a20_0x1e3dc7(Text,{'color':_0x49208e(0xd2),'children':['\x20\x20',_0x49208e(0xb7)]})})]}),_0x13cd80?a20_0x1e3dc7(Box,{'children':[a20_0x1e3dc7(Text,{'children':['\x20\x20',_0x49208e(0xdb)]}),a20_0x23c910(Text,{'color':'green','children':_0x13cd80})]}):_0x1b2fd8==='input-css'&&a20_0x1e3dc7(a20_0x16f527,{'children':[a20_0x1e3dc7(Box,{'children':[a20_0x1e3dc7(Text,{'children':['\x20\x20',_0x49208e(0xdb)]}),a20_0x23c910(Text,{'color':_0x49208e(0xc0),'children':_0x2b857a}),_0x401e4a&&a20_0x1e3dc7(Text,{'color':'red','children':[_0x49208e(0xc3),_0x401e4a]})]}),!_0x401e4a&&a20_0x23c910(Box,{'children':a20_0x1e3dc7(Text,{'color':_0x49208e(0xd2),'children':['\x20\x20',_0x49208e(0xe1)]})})]})]})]});}
1
+ (function(_0x3c1213,_0x12f091){const _0x283d9c=a20_0x246c,_0x57e792=_0x3c1213();while(!![]){try{const _0x723b7b=-parseInt(_0x283d9c(0x169))/0x1*(parseInt(_0x283d9c(0x175))/0x2)+parseInt(_0x283d9c(0x191))/0x3+-parseInt(_0x283d9c(0x172))/0x4*(parseInt(_0x283d9c(0x174))/0x5)+parseInt(_0x283d9c(0x193))/0x6*(parseInt(_0x283d9c(0x173))/0x7)+-parseInt(_0x283d9c(0x16c))/0x8+parseInt(_0x283d9c(0x194))/0x9*(-parseInt(_0x283d9c(0x18d))/0xa)+-parseInt(_0x283d9c(0x17e))/0xb*(-parseInt(_0x283d9c(0x16a))/0xc);if(_0x723b7b===_0x12f091)break;else _0x57e792['push'](_0x57e792['shift']());}catch(_0x37c641){_0x57e792['push'](_0x57e792['shift']());}}}(a20_0x4e2d,0x8e753));import{jsx as a20_0x323aa1,jsxs as a20_0x28277c,Fragment as a20_0x453577}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a20_0x4520bb from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';function a20_0x246c(_0x1a596f,_0x4922fe){_0x1a596f=_0x1a596f-0x167;const _0x4e2d69=a20_0x4e2d();let _0x246cdb=_0x4e2d69[_0x1a596f];return _0x246cdb;}import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import.meta.main&&render(a20_0x323aa1(AppMenuUpdateCdn,{}));function a20_0x4e2d(){const _0x544db6=['gray','input-css','lovrabet\x20auth','!\x20未找到菜单资源链接','input-js','10qkgjaK','map','green','red','330447NCVZVH','JS\x20链接无法访问','1154472LnWLqE','6604308lazBJI','value','backspace','creating','√\x20更新成功','142zrbkuT','1011324jkcaEJ','trim','389960hgsNsJ','dots','\x20资源正在同步中...','length','\x20←\x20','all','45932eDHGBb','28JiNjzj','165TVPYGE','4432TCHxiL','leftArrow','\x20正在获取线上菜单资源链接...','path','updated','CSS\x20链接无法访问','upArrow','resources','CSS\x20链接:\x20','154EXYQqp','downArrow','slice','need-confirm','column','请输入有效的\x20CSS\x20https\x20链接','label','cancel','return','提示:使用\x20'];a20_0x4e2d=function(){return _0x544db6;};return a20_0x4e2d();}export function AppMenuUpdateCdn(){const _0x1cf917=a20_0x246c,{exit:_0x6b2e06}=useApp(),{loading:_0x21bd5d,menuList:_0x4f5235,error:_0x155f27}=useGetOnlineMenuList(),[_0x4f6077,_0x1bc964]=useState('ok'),[_0x5d75c4,_0x5e78de]=useState(_0x1cf917(0x18c)),[_0x215099,_0x5592ef]=useState(''),[_0x48d3ae,_0x1b0695]=useState(''),[_0x1e28ab,_0x90a324]=useState(''),[_0x193bfd,_0x3021da]=useState(''),_0x2c51d9=Array['from'](new Set(_0x4f5235[_0x1cf917(0x18e)](_0x2f1125=>_0x2f1125[_0x1cf917(0x17c)])['flat']()));useEffect(()=>{const _0x121bf3=_0x1cf917;_0x5d75c4===_0x121bf3(0x179)&&setTimeout(_0x6b2e06,0x32);},[_0x5d75c4]),useInput(async(_0x1660d1,_0x2b70e3)=>{const _0x4259ee=_0x1cf917;if(_0x5d75c4==='input-js'){if(_0x2b70e3['return']){const _0x305fc9=_0x1e28ab[_0x4259ee(0x16b)]();if(_0x305fc9==='')return;if(!isValidJsHttpsUrl(_0x305fc9)){_0x3021da('请输入有效的\x20JS\x20https\x20链接');return;}if(!await isUrlReachable(_0x305fc9)){_0x3021da(_0x4259ee(0x192));return;}_0x5592ef(_0x305fc9),_0x90a324(''),_0x3021da(''),_0x5e78de(_0x4259ee(0x189));return;}if(_0x2b70e3[_0x4259ee(0x196)]||_0x2b70e3['delete']){_0x90a324(_0x558da3=>_0x558da3[_0x4259ee(0x180)](0x0,-0x1)),_0x3021da('');return;}_0x90a324(_0x5a5829=>_0x5a5829+_0x1660d1);return;}if(_0x5d75c4===_0x4259ee(0x189)){if(_0x2b70e3[_0x4259ee(0x186)]){const _0x4d5f5c=_0x1e28ab['trim']();if(_0x4d5f5c==='')return;if(!isValidCssHttpsUrl(_0x4d5f5c)){_0x3021da(_0x4259ee(0x183));return;}if(!await isUrlReachable(_0x4d5f5c)){_0x3021da(_0x4259ee(0x17a));return;}_0x1b0695(_0x4d5f5c),_0x90a324(''),_0x3021da(''),_0x5e78de('need-confirm');return;}if(_0x2b70e3['backspace']||_0x2b70e3['delete']){_0x90a324(_0x5b60b5=>_0x5b60b5[_0x4259ee(0x180)](0x0,-0x1)),_0x3021da('');return;}_0x90a324(_0x23758e=>_0x23758e+_0x1660d1);return;}if(_0x5d75c4===_0x4259ee(0x181)){(_0x2b70e3[_0x4259ee(0x17b)]||_0x2b70e3[_0x4259ee(0x17f)]||_0x2b70e3[_0x4259ee(0x176)]||_0x2b70e3['rightArrow'])&&_0x1bc964(_0x4bff2d=>_0x4bff2d==='ok'?_0x4259ee(0x185):'ok');if(_0x2b70e3[_0x4259ee(0x186)]){_0x5e78de(_0x4259ee(0x167));if(_0x4f6077==='ok')await Promise[_0x4259ee(0x171)](_0x4f5235[_0x4259ee(0x18e)](_0x3f9ac4=>{const _0x30bda8=_0x4259ee,_0x4761f1={'id':_0x3f9ac4['id'],'label':_0x3f9ac4[_0x30bda8(0x184)],'path':_0x3f9ac4[_0x30bda8(0x178)],'resources':[_0x215099,_0x48d3ae]};if(_0x3f9ac4[_0x30bda8(0x17c)][_0x30bda8(0x16f)]===0x0)return Promise['resolve']();return updateMenuCdnUrl(_0x4761f1);})),await new Promise(_0x597c8a=>setTimeout(_0x597c8a,0x3e8)),_0x5e78de('updated');else _0x4f6077===_0x4259ee(0x185)&&_0x6b2e06();}}});if(_0x21bd5d)return a20_0x28277c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x323aa1(Text,{}),a20_0x323aa1(a20_0x4520bb,{'type':_0x1cf917(0x16d)}),a20_0x323aa1(Text,{'children':_0x1cf917(0x177)})]});if(_0x155f27)return a20_0x28277c(Box,{'flexDirection':_0x1cf917(0x182),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x28277c(Text,{'color':_0x1cf917(0x190),'children':['✗\x20',_0x155f27]}),a20_0x28277c(Box,{'marginTop':0x1,'children':[a20_0x323aa1(Text,{'color':_0x1cf917(0x188),'children':_0x1cf917(0x187)}),a20_0x323aa1(Text,{'color':'cyan','children':_0x1cf917(0x18a)}),a20_0x323aa1(Text,{'color':'gray','children':'\x20命令重新登录'})]})]});if(_0x2c51d9[_0x1cf917(0x16f)]===0x0)return a20_0x323aa1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a20_0x323aa1(Text,{'color':'yellow','children':_0x1cf917(0x18b)})});if(_0x5d75c4===_0x1cf917(0x181))return a20_0x28277c(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a20_0x323aa1(CurrentMenuCdnContent,{'menuList':_0x4f5235}),a20_0x323aa1(InputCdnAsset,{'jsCdnUrl':_0x215099,'cssCdnUrl':_0x48d3ae}),a20_0x323aa1(Box,{'marginTop':0x1,'flexDirection':_0x1cf917(0x182),'children':[{'label':'继续更新','value':'ok'},{'label':'取消更新','value':'cancel'}][_0x1cf917(0x18e)](_0x163d82=>a20_0x28277c(Text,{'color':_0x4f6077===_0x163d82[_0x1cf917(0x195)]?'yellow':undefined,'children':[_0x4f6077===_0x163d82['value']?'>\x20':'\x20\x20',_0x163d82[_0x1cf917(0x184)]]},_0x163d82[_0x1cf917(0x195)]))})]});if(_0x5d75c4===_0x1cf917(0x167))return a20_0x28277c(Box,{'flexDirection':_0x1cf917(0x182),'marginTop':0x1,'marginBottom':0x1,'children':[a20_0x323aa1(CurrentMenuCdnContent,{'menuList':_0x4f5235}),a20_0x323aa1(InputCdnAsset,{'jsCdnUrl':_0x215099,'cssCdnUrl':_0x48d3ae}),a20_0x28277c(Box,{'marginTop':0x1,'children':[a20_0x323aa1(a20_0x4520bb,{'type':'dots'}),a20_0x323aa1(Text,{'children':_0x1cf917(0x16e)})]})]});if(_0x5d75c4==='updated')return a20_0x28277c(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a20_0x323aa1(CurrentMenuCdnContent,{'menuList':_0x4f5235}),a20_0x323aa1(InputCdnAsset,{'jsCdnUrl':_0x215099,'cssCdnUrl':_0x48d3ae}),a20_0x323aa1(Box,{'marginTop':0x1,'children':a20_0x323aa1(Text,{'color':_0x1cf917(0x18f),'children':_0x1cf917(0x168)})})]});return a20_0x28277c(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a20_0x323aa1(CurrentMenuCdnContent,{'menuList':_0x4f5235}),a20_0x28277c(Box,{'marginTop':0x1,'flexDirection':'column','children':[a20_0x323aa1(Text,{'color':'cyan','children':'*\x20请输入新的资源链接'}),_0x215099?a20_0x28277c(Box,{'children':[a20_0x28277c(Text,{'color':_0x1cf917(0x188),'children':['\x20\x20','JS\x20链接:\x20']}),a20_0x323aa1(Text,{'color':'green','children':_0x215099})]}):_0x5d75c4===_0x1cf917(0x18c)&&a20_0x28277c(a20_0x453577,{'children':[a20_0x28277c(Box,{'children':[a20_0x28277c(Text,{'children':['\x20\x20','JS\x20链接:\x20']}),a20_0x323aa1(Text,{'color':_0x1cf917(0x18f),'children':_0x1e28ab}),_0x193bfd&&a20_0x28277c(Text,{'color':_0x1cf917(0x190),'children':['\x20←\x20',_0x193bfd]})]}),!_0x193bfd&&a20_0x323aa1(Box,{'children':a20_0x28277c(Text,{'color':_0x1cf917(0x188),'children':['\x20\x20','输入项目的\x20JS\x20资源链接(https://...)']})})]}),_0x48d3ae?a20_0x28277c(Box,{'children':[a20_0x28277c(Text,{'children':['\x20\x20','CSS\x20链接:\x20']}),a20_0x323aa1(Text,{'color':_0x1cf917(0x18f),'children':_0x48d3ae})]}):_0x5d75c4===_0x1cf917(0x189)&&a20_0x28277c(a20_0x453577,{'children':[a20_0x28277c(Box,{'children':[a20_0x28277c(Text,{'children':['\x20\x20',_0x1cf917(0x17d)]}),a20_0x323aa1(Text,{'color':_0x1cf917(0x18f),'children':_0x1e28ab}),_0x193bfd&&a20_0x28277c(Text,{'color':_0x1cf917(0x190),'children':[_0x1cf917(0x170),_0x193bfd]})]}),!_0x193bfd&&a20_0x323aa1(Box,{'children':a20_0x28277c(Text,{'color':_0x1cf917(0x188),'children':['\x20\x20','输入项目的\x20CSS\x20资源链接(https://...)']})})]})]})]});}
@@ -1 +1 @@
1
- const a22_0x2f79ef=a22_0x1440;(function(_0x81abee,_0x341a8b){const _0x15c37a=a22_0x1440,_0x104b73=_0x81abee();while(!![]){try{const _0x35339e=-parseInt(_0x15c37a(0x161))/0x1+-parseInt(_0x15c37a(0x16e))/0x2*(parseInt(_0x15c37a(0x170))/0x3)+parseInt(_0x15c37a(0x178))/0x4*(parseInt(_0x15c37a(0x163))/0x5)+-parseInt(_0x15c37a(0x167))/0x6+-parseInt(_0x15c37a(0x162))/0x7*(parseInt(_0x15c37a(0x17f))/0x8)+-parseInt(_0x15c37a(0x16b))/0x9+-parseInt(_0x15c37a(0x16c))/0xa*(-parseInt(_0x15c37a(0x177))/0xb);if(_0x35339e===_0x341a8b)break;else _0x104b73['push'](_0x104b73['shift']());}catch(_0xfce9d0){_0x104b73['push'](_0x104b73['shift']());}}}(a22_0x2a21,0xe0c3e));import{getCookie}from'../auth/get-cookie.js';function a22_0x2a21(){const _0x57f0e1=['45484692KcxHnb','8YfVfnO','error','菜单资源同步成功:\x20','label','stringify','SdkDemo1','application/json','3778176yXxoCY','未知错误','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','更新菜单资源失败:\x20','POST','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','未提供应用AppCode,且配置中也没有默认值','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','errorCode','532760uMXPzi','14PBWqNB','3087705EyIhJg','status','json','resources','797934OsNayr','data','import','正在更新菜单资源链接:\x20','13601241DfFWpl','10fSAhEx','update-menu-cdn-url','1327874CIljnU','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','6clwvOi','sdk-demo','/smartapi/menu/update','success','log','!\x20请使用以下方式之一:','info'];a22_0x2a21=function(){return _0x57f0e1;};return a22_0x2a21();}import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a22_0x1440(_0x25b561,_0x4c8d34){_0x25b561=_0x25b561-0x160;const _0x2a2167=a22_0x2a21();let _0x1440c3=_0x2a2167[_0x25b561];return _0x1440c3;}const config=readConfig(),logLabel=a22_0x2f79ef(0x16d);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a22_0x2f79ef(0x17d),'path':a22_0x2f79ef(0x171),'resources':[a22_0x2f79ef(0x185),a22_0x2f79ef(0x187)]});export async function updateMenuCdnUrl(_0x36f74f){const _0x1d552b=a22_0x2f79ef,_0x2aa41a=config?.['appcode'];if(!_0x2aa41a){const _0x1bb9ac=_0x1d552b(0x186);logger[_0x1d552b(0x179)](logLabel,_0x1bb9ac),console[_0x1d552b(0x179)]('×\x20'+_0x1bb9ac),console[_0x1d552b(0x174)](_0x1d552b(0x175)),console[_0x1d552b(0x174)](_0x1d552b(0x181)),console[_0x1d552b(0x174)](_0x1d552b(0x182));return;}logger['info'](logLabel,_0x1d552b(0x16a)+_0x36f74f[_0x1d552b(0x17b)]+'\x20('+_0x36f74f['path']+')');const _0x1d19b3={'id':_0x36f74f['id'],'appCode':_0x2aa41a,'extend':{'loadScriptMode':_0x1d552b(0x169),'resources':_0x36f74f['resources']?JSON[_0x1d552b(0x17c)](_0x36f74f[_0x1d552b(0x166)]):undefined}},_0x6fc0b3=await fetch(getApiDomain()+_0x1d552b(0x172),{'method':_0x1d552b(0x184),'body':JSON['stringify'](_0x1d19b3),'headers':{'Content-Type':_0x1d552b(0x17e),'Cookie':getCookie()}});if(!_0x6fc0b3['ok']){if(_0x6fc0b3[_0x1d552b(0x164)]===0x191){const _0x37f932=_0x1d552b(0x16f);logger[_0x1d552b(0x179)](logLabel,_0x37f932,{'status':_0x6fc0b3[_0x1d552b(0x164)],'menu':_0x36f74f[_0x1d552b(0x17b)]});throw new Error(_0x37f932);}const _0x590b54='创建菜单失败,HTTP状态码:\x20'+_0x6fc0b3[_0x1d552b(0x164)];logger[_0x1d552b(0x179)](logLabel,_0x590b54,{'menu':_0x36f74f['label']});throw new Error(_0x590b54);}const _0x314933=await _0x6fc0b3[_0x1d552b(0x165)]();if(!_0x314933[_0x1d552b(0x173)]){const _0x36e8ab=_0x1d552b(0x183)+(_0x314933['errorMsg']||_0x1d552b(0x180));logger[_0x1d552b(0x179)](logLabel,_0x36e8ab,{'errorCode':_0x314933[_0x1d552b(0x160)],'errorMsg':_0x314933['errorMsg'],'menu':_0x36f74f['label']});throw new Error(_0x36e8ab);}logger[_0x1d552b(0x176)](logLabel,_0x1d552b(0x17a)+_0x36f74f['label'],_0x314933[_0x1d552b(0x168)]);}
1
+ const a22_0x4a61e0=a22_0x51c8;(function(_0x66e1ac,_0x1062f1){const _0x3611c4=a22_0x51c8,_0x38c0b5=_0x66e1ac();while(!![]){try{const _0x28e46d=-parseInt(_0x3611c4(0x9b))/0x1*(parseInt(_0x3611c4(0x98))/0x2)+parseInt(_0x3611c4(0xa9))/0x3*(parseInt(_0x3611c4(0x96))/0x4)+parseInt(_0x3611c4(0xb4))/0x5*(parseInt(_0x3611c4(0xa4))/0x6)+parseInt(_0x3611c4(0xb2))/0x7+parseInt(_0x3611c4(0x9d))/0x8+-parseInt(_0x3611c4(0xaa))/0x9*(-parseInt(_0x3611c4(0x9c))/0xa)+-parseInt(_0x3611c4(0x94))/0xb;if(_0x28e46d===_0x1062f1)break;else _0x38c0b5['push'](_0x38c0b5['shift']());}catch(_0x32baf3){_0x38c0b5['push'](_0x38c0b5['shift']());}}}(a22_0x35b8,0xc082b));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';function a22_0x51c8(_0x15a6a2,_0x559fc2){_0x15a6a2=_0x15a6a2-0x8f;const _0x35b8fb=a22_0x35b8();let _0x51c8c4=_0x35b8fb[_0x15a6a2];return _0x51c8c4;}function a22_0x35b8(){const _0x36b236=['import','error','!\x20请使用以下方式之一:','update-menu-cdn-url','14287823xYyggN','创建菜单失败,HTTP状态码:\x20','7708NnZPaM','errorMsg','4530nIXUAv','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','data','445GRGXxx','40wHEXyt','9665184jtphYa','log','info','status','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','stringify','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css','114YzUjcI','resources','errorCode','POST','/smartapi/menu/update','843OlANOo','815355TvPKup','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','未知错误','json','success','更新菜单资源失败:\x20','SdkDemo1','path','4151861kYaAfk','appcode','102685JAhSWJ','label','未提供应用AppCode,且配置中也没有默认值'];a22_0x35b8=function(){return _0x36b236;};return a22_0x35b8();}const config=readConfig(),logLabel=a22_0x4a61e0(0x93);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':a22_0x4a61e0(0xb0),'path':'sdk-demo','resources':[a22_0x4a61e0(0xa1),a22_0x4a61e0(0xa3)]});export async function updateMenuCdnUrl(_0x2b531a){const _0x5151a4=a22_0x4a61e0,_0x3e0404=config?.[_0x5151a4(0xb3)];if(!_0x3e0404){const _0x395bb9=_0x5151a4(0x8f);logger[_0x5151a4(0x91)](logLabel,_0x395bb9),console[_0x5151a4(0x91)]('×\x20'+_0x395bb9),console[_0x5151a4(0x9e)](_0x5151a4(0x92)),console[_0x5151a4(0x9e)]('\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>'),console['log'](_0x5151a4(0xab));return;}logger[_0x5151a4(0x9f)](logLabel,'正在更新菜单资源链接:\x20'+_0x2b531a[_0x5151a4(0xb5)]+'\x20('+_0x2b531a[_0x5151a4(0xb1)]+')');const _0x7115cf={'id':_0x2b531a['id'],'appCode':_0x3e0404,'extend':{'loadScriptMode':_0x5151a4(0x90),'resources':_0x2b531a[_0x5151a4(0xa5)]?JSON[_0x5151a4(0xa2)](_0x2b531a[_0x5151a4(0xa5)]):undefined}},_0x3af99a=await fetch(getApiDomain()+_0x5151a4(0xa8),{'method':_0x5151a4(0xa7),'body':JSON['stringify'](_0x7115cf),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x3af99a['ok']){if(_0x3af99a[_0x5151a4(0xa0)]===0x191){const _0x22025f=_0x5151a4(0x99);logger[_0x5151a4(0x91)](logLabel,_0x22025f,{'status':_0x3af99a[_0x5151a4(0xa0)],'menu':_0x2b531a[_0x5151a4(0xb5)]});throw new Error(_0x22025f);}const _0x293c63=_0x5151a4(0x95)+_0x3af99a['status'];logger[_0x5151a4(0x91)](logLabel,_0x293c63,{'menu':_0x2b531a[_0x5151a4(0xb5)]});throw new Error(_0x293c63);}const _0x4952f5=await _0x3af99a[_0x5151a4(0xad)]();if(!_0x4952f5[_0x5151a4(0xae)]){const _0xd31e32=_0x5151a4(0xaf)+(_0x4952f5[_0x5151a4(0x97)]||_0x5151a4(0xac));logger[_0x5151a4(0x91)](logLabel,_0xd31e32,{'errorCode':_0x4952f5[_0x5151a4(0xa6)],'errorMsg':_0x4952f5[_0x5151a4(0x97)],'menu':_0x2b531a['label']});throw new Error(_0xd31e32);}logger[_0x5151a4(0x9f)](logLabel,'菜单资源同步成功:\x20'+_0x2b531a[_0x5151a4(0xb5)],_0x4952f5[_0x5151a4(0x9a)]);}
@@ -1 +1 @@
1
- (function(_0x5e3d69,_0x45c9b3){const _0x48761e=a23_0x44ad,_0x352ac9=_0x5e3d69();while(!![]){try{const _0x469bf5=parseInt(_0x48761e(0x176))/0x1+-parseInt(_0x48761e(0x168))/0x2+-parseInt(_0x48761e(0x169))/0x3+parseInt(_0x48761e(0x16f))/0x4+-parseInt(_0x48761e(0x167))/0x5+-parseInt(_0x48761e(0x172))/0x6+-parseInt(_0x48761e(0x16a))/0x7*(-parseInt(_0x48761e(0x175))/0x8);if(_0x469bf5===_0x45c9b3)break;else _0x352ac9['push'](_0x352ac9['shift']());}catch(_0x590fe0){_0x352ac9['push'](_0x352ac9['shift']());}}}(a23_0x4358,0x74a4f));function a23_0x44ad(_0x71d1b1,_0x146f37){_0x71d1b1=_0x71d1b1-0x163;const _0x4358f0=a23_0x4358();let _0x44ad99=_0x4358f0[_0x71d1b1];return _0x44ad99;}import{jsx as a23_0x156884,jsxs as a23_0x401365}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a23_0x5a6d37 from'ink-spinner';export function AuthServer(){const _0x3c4949=a23_0x44ad,{exit:_0x87d32e}=useApp(),[_0x56bb61,_0x3b3e92]=useState(![]),[_0x1813ed,_0x28d85f]=useState(!![]),[_0x3cb6df,_0x395309]=useState(![]),[_0x1636d9,_0x209520]=useState(![]);useEffect(()=>{const _0x35d4aa=a23_0x44ad;getIsSessionValid()[_0x35d4aa(0x16e)](_0x3b3e92)[_0x35d4aa(0x170)](()=>_0x28d85f(![]));},[]),useEffect(()=>{!_0x1813ed&&_0x56bb61&&(console['log']('√\x20当前为有效会话,无需重新登录。'),_0x87d32e());},[_0x1813ed,_0x56bb61,_0x87d32e]),useEffect(()=>{const _0x3fcb8a=a23_0x44ad;_0x1636d9&&(console[_0x3fcb8a(0x173)](_0x3fcb8a(0x166)),_0x87d32e());},[_0x1636d9,_0x87d32e]),useInput((_0x354a25,_0x3e4716)=>{const _0x15d7b1=a23_0x44ad;_0x3e4716[_0x15d7b1(0x163)]&&(_0x395309(!![]),authServer({'silent':!![]})[_0x15d7b1(0x16e)](_0x5f0b6a=>{_0x209520(_0x5f0b6a);})),_0x354a25==='q'&&_0x87d32e();});if(_0x1813ed)return null;if(_0x56bb61||_0x1636d9)return null;return a23_0x156884(Box,{'flexDirection':_0x3c4949(0x171),'marginTop':0x1,'marginBottom':0x1,'children':_0x3cb6df?a23_0x401365(Box,{'children':[a23_0x156884(Box,{'width':'1'}),a23_0x401365(Text,{'color':_0x3c4949(0x174),'children':[a23_0x156884(a23_0x5a6d37,{'type':_0x3c4949(0x16c)}),'\x20\x20']}),a23_0x156884(Text,{'children':_0x3c4949(0x165)}),a23_0x156884(Text,{'color':'gray','children':_0x3c4949(0x164)})]}):a23_0x401365(Box,{'children':[a23_0x156884(Box,{'width':'1'}),a23_0x156884(Text,{'children':_0x3c4949(0x16b)}),a23_0x156884(Text,{'color':_0x3c4949(0x16d),'children':'按\x20“q”\x20退出。'})]})});}function a23_0x4358(){const _0x111676=['9289uyAcVG','*\x20按回车开始登录。','dots','gray','then','2833280iDUOIJ','finally','column','4270524tcBkZW','log','green','7960EWJNCa','744401jNWmvY','return','请前往浏览器完成登录。','正在登录...\x20','*\x20登录成功!','4661440URPgHI','80088TNcCii','1833675xYJuZa'];a23_0x4358=function(){return _0x111676;};return a23_0x4358();}
1
+ (function(_0xe1a180,_0x2b8e9){const _0x13151a=a23_0x2a64,_0x1a06b8=_0xe1a180();while(!![]){try{const _0x2c1630=-parseInt(_0x13151a(0xff))/0x1+parseInt(_0x13151a(0x100))/0x2+-parseInt(_0x13151a(0x105))/0x3+parseInt(_0x13151a(0x106))/0x4+parseInt(_0x13151a(0xf9))/0x5*(-parseInt(_0x13151a(0x101))/0x6)+-parseInt(_0x13151a(0x10b))/0x7+parseInt(_0x13151a(0x109))/0x8;if(_0x2c1630===_0x2b8e9)break;else _0x1a06b8['push'](_0x1a06b8['shift']());}catch(_0x9f41c7){_0x1a06b8['push'](_0x1a06b8['shift']());}}}(a23_0x2ab7,0x5d7ab));import{jsx as a23_0x31db44,jsxs as a23_0x24aa13}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';function a23_0x2ab7(){const _0x2e932e=['gray','dots','正在登录...\x20','390128ADxhgH','371858ozYjLV','391212iuKgcK','then','按\x20“q”\x20退出。','请前往浏览器完成登录。','187701MAXXIV','109768cNHNEz','column','√\x20当前为有效会话,无需重新登录。','14782672ZpiTZk','*\x20登录成功!','4015193KcrmiI','50oavoVQ','finally','log'];a23_0x2ab7=function(){return _0x2e932e;};return a23_0x2ab7();}function a23_0x2a64(_0x1fc746,_0x588e5f){_0x1fc746=_0x1fc746-0xf9;const _0x2ab7d0=a23_0x2ab7();let _0x2a6465=_0x2ab7d0[_0x1fc746];return _0x2a6465;}import a23_0x45d3e9 from'ink-spinner';export function AuthServer(){const _0x5881f0=a23_0x2a64,{exit:_0x32ff1f}=useApp(),[_0x3df225,_0xcf1edb]=useState(![]),[_0x5852d3,_0x36856f]=useState(!![]),[_0x230b3b,_0x29189b]=useState(![]),[_0x3275b5,_0x28401b]=useState(![]);useEffect(()=>{const _0x2647ef=a23_0x2a64;getIsSessionValid()[_0x2647ef(0x102)](_0xcf1edb)[_0x2647ef(0xfa)](()=>_0x36856f(![]));},[]),useEffect(()=>{const _0xf9b42b=a23_0x2a64;!_0x5852d3&&_0x3df225&&(console[_0xf9b42b(0xfb)](_0xf9b42b(0x108)),_0x32ff1f());},[_0x5852d3,_0x3df225,_0x32ff1f]),useEffect(()=>{const _0x4eb996=a23_0x2a64;_0x3275b5&&(console[_0x4eb996(0xfb)](_0x4eb996(0x10a)),_0x32ff1f());},[_0x3275b5,_0x32ff1f]),useInput((_0x3bbe9c,_0x344e15)=>{_0x344e15['return']&&(_0x29189b(!![]),authServer({'silent':!![]})['then'](_0x2f1b77=>{_0x28401b(_0x2f1b77);})),_0x3bbe9c==='q'&&_0x32ff1f();});if(_0x5852d3)return null;if(_0x3df225||_0x3275b5)return null;return a23_0x31db44(Box,{'flexDirection':_0x5881f0(0x107),'marginTop':0x1,'marginBottom':0x1,'children':_0x230b3b?a23_0x24aa13(Box,{'children':[a23_0x31db44(Box,{'width':'1'}),a23_0x24aa13(Text,{'color':'green','children':[a23_0x31db44(a23_0x45d3e9,{'type':_0x5881f0(0xfd)}),'\x20\x20']}),a23_0x31db44(Text,{'children':_0x5881f0(0xfe)}),a23_0x31db44(Text,{'color':'gray','children':_0x5881f0(0x104)})]}):a23_0x24aa13(Box,{'children':[a23_0x31db44(Box,{'width':'1'}),a23_0x31db44(Text,{'children':'*\x20按回车开始登录。'}),a23_0x31db44(Text,{'color':_0x5881f0(0xfc),'children':_0x5881f0(0x103)})]})});}
@@ -1 +1 @@
1
- const a24_0x552666=a24_0x5c21;(function(_0x58d7,_0x14842e){const _0x523536=a24_0x5c21,_0x4788ab=_0x58d7();while(!![]){try{const _0x31655b=-parseInt(_0x523536(0x1b0))/0x1*(-parseInt(_0x523536(0x1c3))/0x2)+parseInt(_0x523536(0x1b7))/0x3*(-parseInt(_0x523536(0x1a0))/0x4)+-parseInt(_0x523536(0x19b))/0x5+-parseInt(_0x523536(0x1a5))/0x6*(parseInt(_0x523536(0x1a9))/0x7)+-parseInt(_0x523536(0x19f))/0x8*(parseInt(_0x523536(0x1ac))/0x9)+parseInt(_0x523536(0x1a4))/0xa*(-parseInt(_0x523536(0x1a7))/0xb)+-parseInt(_0x523536(0x1c1))/0xc*(-parseInt(_0x523536(0x1be))/0xd);if(_0x31655b===_0x14842e)break;else _0x4788ab['push'](_0x4788ab['shift']());}catch(_0x4f39e6){_0x4788ab['push'](_0x4788ab['shift']());}}}(a24_0x3d9a,0x69f7b));import{writeFileSync}from'node:fs';import a24_0x1172cf from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';function a24_0x5c21(_0x41e63b,_0x550471){_0x41e63b=_0x41e63b-0x197;const _0x3d9a00=a24_0x3d9a();let _0x5c21cd=_0x3d9a00[_0x41e63b];return _0x5c21cd;}function a24_0x3d9a(){const _0x3be272=['close','120jPFAvB','✅\x20浏览器已自动打开,请在浏览器中完成登录','error','isAuth','silent','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','Auth\x20server\x20error:','27755bzEiRq','⚠️\x20\x20无法自动打开浏览器','json','5436UJhkfR','writeHead','1209722ilhPQw','🌐\x20正在尝试自动打开浏览器...','then','address','127.0.0.1','cookie','450850ZpDObO','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','xdg-open\x20\x22','open\x20\x22','27512sNlIOE','50472eYBcEo','session','https://dev.lovrabet.com:','text/html;\x20charset=utf-8','827710KbudwE','60mnEyrY','object','33DoJcWe','🔐\x20正在启动登录服务...','13755guDbmD','📍\x20登录地址:','🔗\x20请手动复制登录地址到浏览器:','720zYSZYw','end','log','/api/auth/get-session','1yodwUM','utf-8','win32','darwin','start\x20\x22\x22\x20\x22','https://g.yuntooai.com/cert/lovrabet-dev.json'];a24_0x3d9a=function(){return _0x3be272;};return a24_0x3d9a();}export async function authServer(_0x370db6){const _0x1d017c=a24_0x5c21,_0x4c67d7=_0x370db6?.[_0x1d017c(0x1bb)]||![];if(await getIsSessionValid())return!![];const _0x17c883=await(await fetch(_0x1d017c(0x1b5)))[_0x1d017c(0x1c0)]();return new Promise(async(_0x4275b6,_0x4d98a6)=>{const _0x3592be=_0x1d017c;let _0x55cf7c=0x0;const _0x5b75ad=a24_0x1172cf['createServer'](_0x17c883,async(_0x566592,_0x1706ae)=>{const _0x12177a=a24_0x5c21,_0x7dc3b5=getUserDomain(),_0x1d0598=_0x566592['headers'][_0x12177a(0x19a)]||'',_0xe804f7=await fetch(_0x7dc3b5+_0x12177a(0x1af),{'headers':{'cookie':_0x1d0598}})['then'](_0x3129dd=>_0x3129dd[_0x12177a(0x1c0)]()),_0x103d4c=_0xe804f7&&_0xe804f7[_0x12177a(0x1a1)]&&_0xe804f7['user'];if(_0x103d4c){writeFileSync(cookieFile,_0x1d0598,_0x12177a(0x1b1)),_0x4275b6(!![]);const _0x3604b3=_0x12177a(0x1bc);_0x1706ae[_0x12177a(0x1c2)](0xc8,{'Content-Type':_0x12177a(0x1a3)}),_0x1706ae[_0x12177a(0x1ad)](_0x3604b3),_0x5b75ad[_0x12177a(0x1b6)]();}else{const _0x5a4763=''+encodeURIComponent(_0x12177a(0x1a2)+_0x55cf7c);_0x1706ae[_0x12177a(0x1c2)](0x12e,{'location':_0x7dc3b5+'/sign-in?redirect='+_0x5a4763}),_0x1706ae[_0x12177a(0x1ad)]();return;}});_0x5b75ad['listen'](0x0,_0x3592be(0x199),()=>{const _0x4b60c6=_0x3592be,_0x44db82=_0x5b75ad[_0x4b60c6(0x198)]();_0x55cf7c=typeof _0x44db82===_0x4b60c6(0x1a6)&&_0x44db82?_0x44db82['port']:Number(_0x44db82);const _0x208de9='https://dev.lovrabet.com:'+_0x55cf7c;!_0x4c67d7&&(console[_0x4b60c6(0x1ae)](_0x4b60c6(0x1a8)),console[_0x4b60c6(0x1ae)](_0x4b60c6(0x1aa),_0x208de9),console[_0x4b60c6(0x1ae)](_0x4b60c6(0x1c4)),console[_0x4b60c6(0x1ae)](''),console['log'](_0x4b60c6(0x19c)),console['log']('')),openInBrowser(_0x208de9)[_0x4b60c6(0x197)](_0x49fadc=>{const _0x24507f=_0x4b60c6;!_0x4c67d7&&(_0x49fadc?console[_0x24507f(0x1ae)](_0x24507f(0x1b8)):(console[_0x24507f(0x1ae)](_0x24507f(0x1bf)),console['log']('🔗\x20请手动复制登录地址到浏览器:',_0x208de9)),console['log'](''));})['catch'](()=>{const _0x24df1c=_0x4b60c6;!_0x4c67d7&&(console[_0x24df1c(0x1ae)](_0x24df1c(0x1bf)),console[_0x24df1c(0x1ae)](_0x24df1c(0x1ab),_0x208de9),console[_0x24df1c(0x1ae)](''));});}),_0x5b75ad['on'](_0x3592be(0x1b9),_0x1c2511=>{const _0xff65f=_0x3592be;!_0x4c67d7&&console[_0xff65f(0x1b9)](_0xff65f(0x1bd),_0x1c2511),_0x4d98a6(_0x1c2511);});});}function openInBrowser(_0x40b442){return new Promise(_0x54f1db=>{const _0x157608=a24_0x5c21,_0x4f0e8f=process['platform'];let _0x1ce5f5;if(_0x4f0e8f===_0x157608(0x1b2))_0x1ce5f5=_0x157608(0x1b4)+_0x40b442+'\x22';else _0x4f0e8f===_0x157608(0x1b3)?_0x1ce5f5=_0x157608(0x19e)+_0x40b442+'\x22':_0x1ce5f5=_0x157608(0x19d)+_0x40b442+'\x22';exec(_0x1ce5f5,_0x191db7=>{_0x191db7?_0x54f1db(![]):_0x54f1db(!![]);});});}if(import.meta.main){const isAuth=await authServer();console['log'](a24_0x552666(0x1ba),isAuth);}
1
+ const a24_0x5102b0=a24_0x349e;(function(_0x134d23,_0x24460d){const _0x160a22=a24_0x349e,_0x55ca97=_0x134d23();while(!![]){try{const _0x5afaf0=parseInt(_0x160a22(0x11f))/0x1+-parseInt(_0x160a22(0x121))/0x2+-parseInt(_0x160a22(0x136))/0x3*(parseInt(_0x160a22(0x123))/0x4)+parseInt(_0x160a22(0x122))/0x5+-parseInt(_0x160a22(0x11b))/0x6+-parseInt(_0x160a22(0x12d))/0x7*(-parseInt(_0x160a22(0x13f))/0x8)+parseInt(_0x160a22(0x117))/0x9;if(_0x5afaf0===_0x24460d)break;else _0x55ca97['push'](_0x55ca97['shift']());}catch(_0x25c441){_0x55ca97['push'](_0x55ca97['shift']());}}}(a24_0x2ee9,0xa2eff));import{writeFileSync}from'node:fs';import a24_0xc10d88 from'node:https';import{getUserDomain}from'../constant/domain.js';function a24_0x349e(_0x18cf47,_0x23ed61){_0x18cf47=_0x18cf47-0x116;const _0x2ee985=a24_0x2ee9();let _0x349e03=_0x2ee985[_0x18cf47];return _0x349e03;}import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x3c1fae){const _0x2f93ff=a24_0x349e,_0x90635d=_0x3c1fae?.['silent']||![];if(await getIsSessionValid())return!![];const _0x74a299=await(await fetch(_0x2f93ff(0x135)))[_0x2f93ff(0x129)]();return new Promise(async(_0x5bf13c,_0x585580)=>{const _0x1e92aa=_0x2f93ff;let _0xdedd83=0x0;const _0x3cf8ca=a24_0xc10d88[_0x1e92aa(0x137)](_0x74a299,async(_0x3c903b,_0x3eca78)=>{const _0x3978ba=_0x1e92aa,_0x20d3c1=getUserDomain(),_0x4044b0=_0x3c903b[_0x3978ba(0x139)][_0x3978ba(0x12e)]||'',_0x129a0b=await fetch(_0x20d3c1+_0x3978ba(0x12c),{'headers':{'cookie':_0x4044b0}})[_0x3978ba(0x11c)](_0x3c6eba=>_0x3c6eba[_0x3978ba(0x129)]()),_0x7777ad=_0x129a0b&&_0x129a0b[_0x3978ba(0x120)]&&_0x129a0b[_0x3978ba(0x13c)];if(_0x7777ad){writeFileSync(cookieFile,_0x4044b0,_0x3978ba(0x131)),_0x5bf13c(!![]);const _0x105eb5=_0x3978ba(0x128);_0x3eca78[_0x3978ba(0x140)](0xc8,{'Content-Type':_0x3978ba(0x138)}),_0x3eca78[_0x3978ba(0x13b)](_0x105eb5),_0x3cf8ca['close']();}else{const _0x3090d9=''+encodeURIComponent(_0x3978ba(0x12a)+_0xdedd83);_0x3eca78[_0x3978ba(0x140)](0x12e,{'location':_0x20d3c1+_0x3978ba(0x142)+_0x3090d9}),_0x3eca78['end']();return;}});_0x3cf8ca[_0x1e92aa(0x118)](0x0,'127.0.0.1',()=>{const _0xcce8be=_0x1e92aa,_0x1bfd43=_0x3cf8ca[_0xcce8be(0x134)]();_0xdedd83=typeof _0x1bfd43===_0xcce8be(0x132)&&_0x1bfd43?_0x1bfd43[_0xcce8be(0x126)]:Number(_0x1bfd43);const _0x1ea5c4=_0xcce8be(0x12a)+_0xdedd83;!_0x90635d&&(console['log'](_0xcce8be(0x12f)),console[_0xcce8be(0x12b)](_0xcce8be(0x119),_0x1ea5c4),console[_0xcce8be(0x12b)](_0xcce8be(0x11e)),console[_0xcce8be(0x12b)](''),console[_0xcce8be(0x12b)](_0xcce8be(0x125)),console[_0xcce8be(0x12b)]('')),openInBrowser(_0x1ea5c4)[_0xcce8be(0x11c)](_0x4d6f73=>{const _0x5ae4ff=_0xcce8be;!_0x90635d&&(_0x4d6f73?console['log'](_0x5ae4ff(0x11a)):(console[_0x5ae4ff(0x12b)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x5ae4ff(0x12b)]('🔗\x20请手动复制登录地址到浏览器:',_0x1ea5c4)),console['log'](''));})[_0xcce8be(0x116)](()=>{const _0x3f70b2=_0xcce8be;!_0x90635d&&(console[_0x3f70b2(0x12b)](_0x3f70b2(0x141)),console[_0x3f70b2(0x12b)](_0x3f70b2(0x13d),_0x1ea5c4),console[_0x3f70b2(0x12b)](''));});}),_0x3cf8ca['on'](_0x1e92aa(0x127),_0x2f6669=>{const _0x4e77c3=_0x1e92aa;!_0x90635d&&console[_0x4e77c3(0x127)]('Auth\x20server\x20error:',_0x2f6669),_0x585580(_0x2f6669);});});}function openInBrowser(_0x50a3f4){return new Promise(_0x50969f=>{const _0x513032=a24_0x349e,_0x227668=process[_0x513032(0x133)];let _0x3e391b;if(_0x227668===_0x513032(0x13e))_0x3e391b=_0x513032(0x130)+_0x50a3f4+'\x22';else _0x227668===_0x513032(0x11d)?_0x3e391b=_0x513032(0x13a)+_0x50a3f4+'\x22':_0x3e391b=_0x513032(0x124)+_0x50a3f4+'\x22';exec(_0x3e391b,_0xa42ae8=>{_0xa42ae8?_0x50969f(![]):_0x50969f(!![]);});});}if(import.meta.main){const isAuth=await authServer();console[a24_0x5102b0(0x12b)]('isAuth',isAuth);}function a24_0x2ee9(){const _0x8806c0=['json','https://dev.lovrabet.com:','log','/api/auth/get-session','1547VGLgTC','cookie','🔐\x20正在启动登录服务...','start\x20\x22\x22\x20\x22','utf-8','object','platform','address','https://g.yuntooai.com/cert/lovrabet-dev.json','107442WwCFEt','createServer','text/html;\x20charset=utf-8','headers','open\x20\x22','end','user','🔗\x20请手动复制登录地址到浏览器:','win32','464KuXiiz','writeHead','⚠️\x20\x20无法自动打开浏览器','/sign-in?redirect=','catch','8697195LAZXOU','listen','📍\x20登录地址:','✅\x20浏览器已自动打开,请在浏览器中完成登录','1314684YXPcDw','then','darwin','🌐\x20正在尝试自动打开浏览器...','755888gkyFYk','session','1899136poVrWt','4444600Dukftf','88qIIPgp','xdg-open\x20\x22','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','port','error','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>'];a24_0x2ee9=function(){return _0x8806c0;};return a24_0x2ee9();}
@@ -1 +1 @@
1
- (function(_0x458612,_0xc5948a){const _0x3ef9ee=a25_0x11ce,_0x258ab6=_0x458612();while(!![]){try{const _0x1aa3b3=-parseInt(_0x3ef9ee(0x7a))/0x1+parseInt(_0x3ef9ee(0x72))/0x2*(parseInt(_0x3ef9ee(0x77))/0x3)+parseInt(_0x3ef9ee(0x7c))/0x4*(-parseInt(_0x3ef9ee(0x7b))/0x5)+parseInt(_0x3ef9ee(0x70))/0x6*(-parseInt(_0x3ef9ee(0x75))/0x7)+-parseInt(_0x3ef9ee(0x73))/0x8*(-parseInt(_0x3ef9ee(0x79))/0x9)+parseInt(_0x3ef9ee(0x71))/0xa*(-parseInt(_0x3ef9ee(0x74))/0xb)+parseInt(_0x3ef9ee(0x78))/0xc*(parseInt(_0x3ef9ee(0x76))/0xd);if(_0x1aa3b3===_0xc5948a)break;else _0x258ab6['push'](_0x258ab6['shift']());}catch(_0x17b2c5){_0x258ab6['push'](_0x258ab6['shift']());}}}(a25_0x5e55,0xf254e));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+'/.lovrabet';function a25_0x5e55(){const _0x48ea57=['7960neJGrk','4025022wkfhxV','19461580NikLDK','288RwJimy','872VqbLbP','11kRMWXE','7iCbAVO','91oUUocA','5124YHJXRD','10341132tAuEkn','26649YTndcg','1208403GEbhYh','4480oiwiGV'];a25_0x5e55=function(){return _0x48ea57;};return a25_0x5e55();}function a25_0x11ce(_0x1b24e6,_0x3f0a97){_0x1b24e6=_0x1b24e6-0x70;const _0x5e55d2=a25_0x5e55();let _0x11cef2=_0x5e55d2[_0x1b24e6];return _0x11cef2;}export const cookieFile=configDir+'/cookie';mkdirSync(configDir,{'recursive':!![]});
1
+ const a25_0x121c34=a25_0x38c7;(function(_0x1b505b,_0x317552){const _0x2ce073=a25_0x38c7,_0x4cd1d7=_0x1b505b();while(!![]){try{const _0x978fad=-parseInt(_0x2ce073(0x1f0))/0x1*(parseInt(_0x2ce073(0x1f5))/0x2)+-parseInt(_0x2ce073(0x1f2))/0x3+parseInt(_0x2ce073(0x1eb))/0x4+-parseInt(_0x2ce073(0x1f4))/0x5+-parseInt(_0x2ce073(0x1f1))/0x6*(-parseInt(_0x2ce073(0x1ed))/0x7)+-parseInt(_0x2ce073(0x1ee))/0x8*(-parseInt(_0x2ce073(0x1ec))/0x9)+parseInt(_0x2ce073(0x1f3))/0xa*(parseInt(_0x2ce073(0x1ea))/0xb);if(_0x978fad===_0x317552)break;else _0x4cd1d7['push'](_0x4cd1d7['shift']());}catch(_0x5d57a3){_0x4cd1d7['push'](_0x4cd1d7['shift']());}}}(a25_0x30c1,0xef4f8));import{mkdirSync}from'node:fs';import{homedir}from'node:os';function a25_0x30c1(){const _0x38d416=['1353nJUqSA','205364PtUnNO','333ODySVj','266dvcXdq','190504zIGzow','/.lovrabet','7eCusXm','1626qkAckF','320898XECpvf','159910JfNeQV','8065760ETguuT','59794aeoRfA'];a25_0x30c1=function(){return _0x38d416;};return a25_0x30c1();}function a25_0x38c7(_0x3d97ce,_0x535a6e){_0x3d97ce=_0x3d97ce-0x1ea;const _0x30c17c=a25_0x30c1();let _0x38c7c0=_0x30c17c[_0x3d97ce];return _0x38c7c0;}export const configDir=homedir()+a25_0x121c34(0x1ef);export const cookieFile=configDir+'/cookie';mkdirSync(configDir,{'recursive':!![]});
@@ -1 +1 @@
1
- function a26_0x1c3c(_0x2f8008,_0xb1c440){_0x2f8008=_0x2f8008-0x1cf;var _0x3c5d41=a26_0x3c5d();var _0x1c3ca9=_0x3c5d41[_0x2f8008];return _0x1c3ca9;}function a26_0x3c5d(){var _0x572d4f=['utf-8','17379432ccTmnL','4872553ssJPgQ','5uMbNXj','496380ogKBxF','808744IIoJFs','2140eFmOSF','4968846NvnZeI','1LmHUEw','233697ZmDzmH','18238trJMBZ','8DYcaTD','6qPLDHX'];a26_0x3c5d=function(){return _0x572d4f;};return a26_0x3c5d();}(function(_0x20a681,_0x932b76){var _0x49fbf8=a26_0x1c3c,_0x4c396a=_0x20a681();while(!![]){try{var _0x174d15=-parseInt(_0x49fbf8(0x1d8))/0x1*(parseInt(_0x49fbf8(0x1d4))/0x2)+-parseInt(_0x49fbf8(0x1d9))/0x3+-parseInt(_0x49fbf8(0x1d5))/0x4*(parseInt(_0x49fbf8(0x1d3))/0x5)+parseInt(_0x49fbf8(0x1cf))/0x6*(-parseInt(_0x49fbf8(0x1d2))/0x7)+-parseInt(_0x49fbf8(0x1db))/0x8*(-parseInt(_0x49fbf8(0x1d7))/0x9)+parseInt(_0x49fbf8(0x1d6))/0xa*(-parseInt(_0x49fbf8(0x1da))/0xb)+parseInt(_0x49fbf8(0x1d1))/0xc;if(_0x174d15===_0x932b76)break;else _0x4c396a['push'](_0x4c396a['shift']());}catch(_0x2096df){_0x4c396a['push'](_0x4c396a['shift']());}}}(a26_0x3c5d,0x66d5e));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){var _0x4ed411=a26_0x1c3c;try{return readFileSync(cookieFile,_0x4ed411(0x1d0));}catch{}return'';}
1
+ function a26_0x1f91(){var _0x52d7ab=['4069152qBpxlz','39097zmEGfV','4389688VKdmbD','76ZPDkla','853353LmdEkz','101240HJaxZc','8YzKsMt','5036124kyPyFq','9416603DDMaQP','250ygaZFc'];a26_0x1f91=function(){return _0x52d7ab;};return a26_0x1f91();}(function(_0x1ade7c,_0x587ed7){var _0x5769da=a26_0x25dc,_0x38cf10=_0x1ade7c();while(!![]){try{var _0x19c435=-parseInt(_0x5769da(0x11d))/0x1*(-parseInt(_0x5769da(0x118))/0x2)+-parseInt(_0x5769da(0x11c))/0x3+-parseInt(_0x5769da(0x11f))/0x4*(parseInt(_0x5769da(0x121))/0x5)+parseInt(_0x5769da(0x119))/0x6+-parseInt(_0x5769da(0x11a))/0x7+parseInt(_0x5769da(0x11e))/0x8+parseInt(_0x5769da(0x120))/0x9*(parseInt(_0x5769da(0x11b))/0xa);if(_0x19c435===_0x587ed7)break;else _0x38cf10['push'](_0x38cf10['shift']());}catch(_0x34a16b){_0x38cf10['push'](_0x38cf10['shift']());}}}(a26_0x1f91,0xca489));function a26_0x25dc(_0x501206,_0x5c9dd2){_0x501206=_0x501206-0x118;var _0x1f915b=a26_0x1f91();var _0x25dca5=_0x1f915b[_0x501206];return _0x25dca5;}import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';export function getCookie(){try{return readFileSync(cookieFile,'utf-8');}catch{}return'';}
@@ -1 +1 @@
1
- (function(_0x216939,_0xbe9ed5){const _0x49a4ea=a27_0x3e11,_0x336e8a=_0x216939();while(!![]){try{const _0xec320c=parseInt(_0x49a4ea(0x13c))/0x1*(-parseInt(_0x49a4ea(0x145))/0x2)+parseInt(_0x49a4ea(0x142))/0x3*(parseInt(_0x49a4ea(0x13e))/0x4)+-parseInt(_0x49a4ea(0x13f))/0x5*(parseInt(_0x49a4ea(0x13b))/0x6)+-parseInt(_0x49a4ea(0x143))/0x7+parseInt(_0x49a4ea(0x141))/0x8*(parseInt(_0x49a4ea(0x140))/0x9)+parseInt(_0x49a4ea(0x138))/0xa+parseInt(_0x49a4ea(0x144))/0xb*(parseInt(_0x49a4ea(0x13d))/0xc);if(_0xec320c===_0xbe9ed5)break;else _0x336e8a['push'](_0x336e8a['shift']());}catch(_0x320297){_0x336e8a['push'](_0x336e8a['shift']());}}}(a27_0x3f89,0x527b6));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';function a27_0x3f89(){const _0x49b309=['802688MfUxOw','20778AHZsBp','3392032hfbFka','46717GSdTqG','14JNSgfM','2522040rLyROb','utf-8','user','24betVqo','92738pNYBOe','4344WRovkR','148FMBgsA','843285mgdrZL','9meFAWS'];a27_0x3f89=function(){return _0x49b309;};return a27_0x3f89();}import{cookieFile}from'./constant.js';function a27_0x3e11(_0x3bc24c,_0x1ec1ef){_0x3bc24c=_0x3bc24c-0x138;const _0x3f8986=a27_0x3f89();let _0x3e1156=_0x3f8986[_0x3bc24c];return _0x3e1156;}export async function getIsSessionValid(){const _0x298286=a27_0x3e11;try{if(!existsSync(cookieFile))return![];const _0xe60291=readFileSync(cookieFile,_0x298286(0x139)),_0x49a787=await fetch(getUserDomain()+'/api/auth/get-session',{'headers':{'cookie':_0xe60291}})['then'](_0x21f00b=>_0x21f00b['json']());return _0x49a787&&_0x49a787['session']&&_0x49a787[_0x298286(0x13a)];}catch{}return![];}
1
+ (function(_0x411f53,_0x3ba205){const _0x370164=a27_0x1c8b,_0x5c9ac4=_0x411f53();while(!![]){try{const _0x5e4abc=parseInt(_0x370164(0x104))/0x1*(parseInt(_0x370164(0x108))/0x2)+parseInt(_0x370164(0x10d))/0x3*(-parseInt(_0x370164(0x107))/0x4)+parseInt(_0x370164(0x105))/0x5+-parseInt(_0x370164(0x106))/0x6*(-parseInt(_0x370164(0x109))/0x7)+parseInt(_0x370164(0x10e))/0x8+-parseInt(_0x370164(0x103))/0x9+-parseInt(_0x370164(0x10f))/0xa;if(_0x5e4abc===_0x3ba205)break;else _0x5c9ac4['push'](_0x5c9ac4['shift']());}catch(_0x4630b2){_0x5c9ac4['push'](_0x5c9ac4['shift']());}}}(a27_0x2e1a,0x5c52d));function a27_0x2e1a(){const _0xda7525=['utf-8','/api/auth/get-session','3606930vArFnF','731HpxQZf','3151705HmbjjM','12akXhbu','8PmEbYz','1312qKeHWV','531398MbLYiH','user','session','json','530034gBIGsu','2089432TZDENq','3906010wEaWek'];a27_0x2e1a=function(){return _0xda7525;};return a27_0x2e1a();}import{existsSync,readFileSync}from'node:fs';function a27_0x1c8b(_0x4eb1a5,_0x54e35c){_0x4eb1a5=_0x4eb1a5-0x102;const _0x2e1a23=a27_0x2e1a();let _0x1c8ba7=_0x2e1a23[_0x4eb1a5];return _0x1c8ba7;}import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x4e72fb=a27_0x1c8b;try{if(!existsSync(cookieFile))return![];const _0x50b223=readFileSync(cookieFile,_0x4e72fb(0x110)),_0x1f0518=await fetch(getUserDomain()+_0x4e72fb(0x102),{'headers':{'cookie':_0x50b223}})['then'](_0x326854=>_0x326854[_0x4e72fb(0x10c)]());return _0x1f0518&&_0x1f0518[_0x4e72fb(0x10b)]&&_0x1f0518[_0x4e72fb(0x10a)];}catch{}return![];}
@@ -1 +1 @@
1
- (function(_0x1a9b95,_0x11edce){var _0x449b0=a28_0x17d3,_0x5cac76=_0x1a9b95();while(!![]){try{var _0x2d048e=-parseInt(_0x449b0(0x159))/0x1+parseInt(_0x449b0(0x155))/0x2*(-parseInt(_0x449b0(0x151))/0x3)+parseInt(_0x449b0(0x152))/0x4+parseInt(_0x449b0(0x150))/0x5+-parseInt(_0x449b0(0x157))/0x6*(-parseInt(_0x449b0(0x14f))/0x7)+parseInt(_0x449b0(0x154))/0x8+-parseInt(_0x449b0(0x156))/0x9;if(_0x2d048e===_0x11edce)break;else _0x5cac76['push'](_0x5cac76['shift']());}catch(_0x32ac92){_0x5cac76['push'](_0x5cac76['shift']());}}}(a28_0x45e6,0x73cd3));function a28_0x17d3(_0x9736a9,_0x2b9c8f){_0x9736a9=_0x9736a9-0x14e;var _0x45e6f3=a28_0x45e6();var _0x17d322=_0x45e6f3[_0x9736a9];return _0x17d322;}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x8e6a20=a28_0x17d3;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x8e6a20(0x153)](_0x8e6a20(0x14e))):console[_0x8e6a20(0x153)](_0x8e6a20(0x158));}function a28_0x45e6(){var _0x1ad745=['2JkMYnK','7917768RuKZLY','1068312BBaoll','!\x20当前未登录','593123xUBzar','✓\x20已退出登录','28zfOUxE','2357985Xtlfle','334452zeTeCs','2933036lvJrFU','log','1132944xrvVKu'];a28_0x45e6=function(){return _0x1ad745;};return a28_0x45e6();}
1
+ (function(_0x57d1f5,_0x1f860f){var _0x4f06a4=a28_0x4562,_0x2b8abf=_0x57d1f5();while(!![]){try{var _0x41d4c2=parseInt(_0x4f06a4(0x1d2))/0x1+-parseInt(_0x4f06a4(0x1d8))/0x2+parseInt(_0x4f06a4(0x1d7))/0x3*(-parseInt(_0x4f06a4(0x1d5))/0x4)+-parseInt(_0x4f06a4(0x1d9))/0x5+-parseInt(_0x4f06a4(0x1d6))/0x6+-parseInt(_0x4f06a4(0x1db))/0x7*(-parseInt(_0x4f06a4(0x1d1))/0x8)+parseInt(_0x4f06a4(0x1d0))/0x9*(parseInt(_0x4f06a4(0x1da))/0xa);if(_0x41d4c2===_0x1f860f)break;else _0x2b8abf['push'](_0x2b8abf['shift']());}catch(_0x330fc8){_0x2b8abf['push'](_0x2b8abf['shift']());}}}(a28_0x3687,0x5efa6));function a28_0x4562(_0x1910b6,_0xfff372){_0x1910b6=_0x1910b6-0x1cf;var _0x368736=a28_0x3687();var _0x4562dc=_0x368736[_0x1910b6];return _0x4562dc;}function a28_0x3687(){var _0x257e9b=['log','!\x20当前未登录','4ibEjnG','3068004DPUyka','1795959tanhYB','473090aMSzod','380480gkpBTI','1090lGlEIv','7VltTmB','✓\x20已退出登录','53442MJQRBx','3295224EtAkQT','752513NiUUZY'];a28_0x3687=function(){return _0x257e9b;};return a28_0x3687();}import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x50463c=a28_0x4562;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x50463c(0x1d3)](_0x50463c(0x1cf))):console['log'](_0x50463c(0x1d4));}