@lovrabet/cli 1.2.5-beta.1 → 1.2.5-beta.2

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/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/api/api-doc-ui.js +1 -1
  5. package/lib/api/api-doc.js +1 -1
  6. package/lib/api/api-pull-ui.js +1 -1
  7. package/lib/api/fetch-model-list.js +1 -1
  8. package/lib/api/generate-api-file.js +1 -1
  9. package/lib/api/main.js +1 -1
  10. package/lib/api/pull-silent.js +1 -1
  11. package/lib/app-menu/app-menu-sync-ui.js +1 -1
  12. package/lib/app-menu/create-menu.js +1 -1
  13. package/lib/app-menu/get-local-pages.js +1 -1
  14. package/lib/app-menu/get-online-menu-list.js +1 -1
  15. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  16. package/lib/app-menu/utils.js +1 -1
  17. package/lib/app-menu/valid-url.js +1 -1
  18. package/lib/app-menu-update-cdn/current-content.js +1 -1
  19. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  20. package/lib/app-menu-update-cdn/main.js +1 -1
  21. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  22. package/lib/auth/auth-server-ui.js +1 -1
  23. package/lib/auth/auth-server.js +1 -1
  24. package/lib/auth/constant.js +1 -1
  25. package/lib/auth/get-cookie.js +1 -1
  26. package/lib/auth/is-session-valid.js +1 -1
  27. package/lib/auth/logout.js +1 -1
  28. package/lib/cli.js +1 -1
  29. package/lib/cmd/build-watch.js +1 -1
  30. package/lib/cmd/build.js +1 -1
  31. package/lib/cmd/logs.js +1 -1
  32. package/lib/cmd/preview.js +1 -1
  33. package/lib/cmd/start.js +1 -1
  34. package/lib/config/config-help.js +1 -1
  35. package/lib/config/main.js +1 -1
  36. package/lib/constant/domain.js +1 -1
  37. package/lib/constant/env.js +1 -1
  38. package/lib/create-app/enhanced-guided-create.js +1 -1
  39. package/lib/create-app/format-elapsed.js +1 -1
  40. package/lib/create-app/main.js +1 -1
  41. package/lib/create-app/task-finished.js +1 -1
  42. package/lib/create-app/task-loading.js +1 -1
  43. package/lib/create-app/task-running.js +1 -1
  44. package/lib/create-app/task-time.js +1 -1
  45. package/lib/create-app/use-copy-project-template.js +1 -1
  46. package/lib/create-app/use-format-code.js +1 -1
  47. package/lib/create-app/use-install-dependencies.js +1 -1
  48. package/lib/help.js +1 -1
  49. package/lib/init/main.js +1 -1
  50. package/lib/mcp/claude.js +1 -1
  51. package/lib/mcp/cursor.js +1 -1
  52. package/lib/mcp/main.js +1 -1
  53. package/lib/skills/main.js +1 -1
  54. package/lib/utils/check-sdk-version.js +1 -1
  55. package/lib/utils/config.js +1 -1
  56. package/lib/utils/copy-directory.js +1 -1
  57. package/lib/utils/http-client.js +1 -1
  58. package/lib/utils/logger.js +1 -1
  59. package/lib/utils/router-updater.js +1 -1
  60. package/lib/utils/sleep.js +1 -1
  61. package/lib/utils/template-replacer.js +1 -1
  62. package/package.json +1 -1
  63. package/templates/skills/.claude/skills/lovrabet/SKILL.md +1 -0
  64. package/templates/skills/.cursor/commands/lovrabet.md +1 -0
  65. package/templates/skills/.shared/guides/07-backend-function/guide.md +679 -0
  66. package/templates/skills/.windsurf/workflows/lovrabet.md +1 -0
package/lib/cmd/logs.js CHANGED
@@ -1 +1 @@
1
- (function(_0x41463c,_0x1d7faf){const _0x1c09ba=a32_0x2bad,_0x4429ba=_0x41463c();while(!![]){try{const _0x58ae3c=parseInt(_0x1c09ba(0x1a4))/0x1*(parseInt(_0x1c09ba(0x1a5))/0x2)+-parseInt(_0x1c09ba(0x196))/0x3+-parseInt(_0x1c09ba(0x1a0))/0x4*(-parseInt(_0x1c09ba(0x19b))/0x5)+-parseInt(_0x1c09ba(0x19a))/0x6+-parseInt(_0x1c09ba(0x19f))/0x7*(parseInt(_0x1c09ba(0x1ac))/0x8)+-parseInt(_0x1c09ba(0x1a9))/0x9+parseInt(_0x1c09ba(0x1af))/0xa;if(_0x58ae3c===_0x1d7faf)break;else _0x4429ba['push'](_0x4429ba['shift']());}catch(_0x4150a7){_0x4429ba['push'](_0x4429ba['shift']());}}}(a32_0x2aa2,0xd1bef));function a32_0x2bad(_0x2db67c,_0x2738e8){_0x2db67c=_0x2db67c-0x193;const _0x2aa232=a32_0x2aa2();let _0x2bad6f=_0x2aa232[_0x2db67c];return _0x2bad6f;}import{logger}from'../utils/logger.js';export function showLogs(){const _0x2e75a7=a32_0x2bad;logger['setLogPath'](process[_0x2e75a7(0x1b0)]());const _0x497ddf=logger['readLogs']();if(_0x497ddf['length']===0x0){console[_0x2e75a7(0x1a2)](_0x2e75a7(0x1aa));return;}console[_0x2e75a7(0x1a2)](_0x2e75a7(0x194)),_0x497ddf[_0x2e75a7(0x1ad)]((_0x362980,_0x48dcf0)=>{const _0x58b4a3=_0x2e75a7,_0x2771a0=new Date(_0x362980[_0x58b4a3(0x1a8)])[_0x58b4a3(0x1a3)]('zh-CN'),_0x24d24e=_0x362980[_0x58b4a3(0x1ae)]===_0x58b4a3(0x19c)?'√':_0x362980[_0x58b4a3(0x1ae)]==='error'?'×':_0x362980[_0x58b4a3(0x1ae)]==='warn'?'!':'i';console[_0x58b4a3(0x1a2)](_0x48dcf0+0x1+'.\x20'+_0x24d24e+'\x20['+_0x362980['command']+']\x20'+_0x362980[_0x58b4a3(0x1a6)]),console[_0x58b4a3(0x1a2)](_0x58b4a3(0x193)+_0x2771a0),_0x362980[_0x58b4a3(0x1a1)]&&console[_0x58b4a3(0x1a2)](_0x58b4a3(0x1a7)+_0x362980['duration']+'ms'),_0x362980[_0x58b4a3(0x19d)]&&Object[_0x58b4a3(0x197)](_0x362980['details'])[_0x58b4a3(0x19e)]>0x0&&console[_0x58b4a3(0x1a2)](_0x58b4a3(0x195)+JSON[_0x58b4a3(0x1ab)](_0x362980[_0x58b4a3(0x19d)],null,0x2)),console['log']('');});}export function clearLogs(){const _0x1d29d3=a32_0x2bad;logger[_0x1d29d3(0x199)](process[_0x1d29d3(0x1b0)]()),logger[_0x1d29d3(0x198)](),console[_0x1d29d3(0x1a2)]('*\x20日志已清空');}function a32_0x2aa2(){const _0x3eb406=['14662260evmpek','cwd','\x20\x20\x20时间:\x20','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','\x20\x20\x20详情:\x20','2570118enKfDY','keys','clearLogs','setLogPath','2452428QNuYBV','4106805dsTUZM','success','details','length','21OVyNHX','8jjsaFk','duration','log','toLocaleString','67434ppIzJl','30rUlces','message','\x20\x20\x20耗时:\x20','timestamp','3318552gspuHa','*\x20暂无日志记录','stringify','4339112tMLIhl','forEach','level'];a32_0x2aa2=function(){return _0x3eb406;};return a32_0x2aa2();}
1
+ function a32_0x4a60(){const _0x1457bf=['46hOyRzt','2399520ErWpOo','length','4aCjtfW','command','168111MsHyTO','clearLogs','24646qWQaXv','998385DoqILg','\x20\x20\x20耗时:\x20','keys','\x20\x20\x20时间:\x20','level','readLogs','cwd','warn','log','setLogPath','12732WcTtDl','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','56sDrTfN','details','toLocaleString','*\x20日志已清空','error','*\x20暂无日志记录','zh-CN','90412oqynMM','9805301UZojTk','515NjYhNg','\x20\x20\x20详情:\x20','success'];a32_0x4a60=function(){return _0x1457bf;};return a32_0x4a60();}(function(_0x24c59c,_0x4e950c){const _0x27b826=a32_0x184b,_0x37e3fa=_0x24c59c();while(!![]){try{const _0x9b242b=-parseInt(_0x27b826(0x158))/0x1*(parseInt(_0x27b826(0x171))/0x2)+-parseInt(_0x27b826(0x159))/0x3*(parseInt(_0x27b826(0x174))/0x4)+parseInt(_0x27b826(0x16e))/0x5*(parseInt(_0x27b826(0x163))/0x6)+-parseInt(_0x27b826(0x16c))/0x7*(parseInt(_0x27b826(0x165))/0x8)+parseInt(_0x27b826(0x176))/0x9+parseInt(_0x27b826(0x172))/0xa+parseInt(_0x27b826(0x16d))/0xb;if(_0x9b242b===_0x4e950c)break;else _0x37e3fa['push'](_0x37e3fa['shift']());}catch(_0x4624bb){_0x37e3fa['push'](_0x37e3fa['shift']());}}}(a32_0x4a60,0x5c69b));import{logger}from'../utils/logger.js';export function showLogs(){const _0x496bd3=a32_0x184b;logger[_0x496bd3(0x162)](process[_0x496bd3(0x15f)]());const _0x5e7526=logger[_0x496bd3(0x15e)]();if(_0x5e7526[_0x496bd3(0x173)]===0x0){console[_0x496bd3(0x161)](_0x496bd3(0x16a));return;}console[_0x496bd3(0x161)](_0x496bd3(0x164)),_0x5e7526['forEach']((_0x3838b4,_0x595790)=>{const _0x4929fe=_0x496bd3,_0x17f60a=new Date(_0x3838b4['timestamp'])[_0x4929fe(0x167)](_0x4929fe(0x16b)),_0x5307c1=_0x3838b4[_0x4929fe(0x15d)]===_0x4929fe(0x170)?'√':_0x3838b4[_0x4929fe(0x15d)]===_0x4929fe(0x169)?'×':_0x3838b4[_0x4929fe(0x15d)]===_0x4929fe(0x160)?'!':'i';console[_0x4929fe(0x161)](_0x595790+0x1+'.\x20'+_0x5307c1+'\x20['+_0x3838b4[_0x4929fe(0x175)]+']\x20'+_0x3838b4['message']),console[_0x4929fe(0x161)](_0x4929fe(0x15c)+_0x17f60a),_0x3838b4['duration']&&console['log'](_0x4929fe(0x15a)+_0x3838b4['duration']+'ms'),_0x3838b4[_0x4929fe(0x166)]&&Object[_0x4929fe(0x15b)](_0x3838b4['details'])[_0x4929fe(0x173)]>0x0&&console[_0x4929fe(0x161)](_0x4929fe(0x16f)+JSON['stringify'](_0x3838b4['details'],null,0x2)),console[_0x4929fe(0x161)]('');});}function a32_0x184b(_0x132145,_0x2cd027){_0x132145=_0x132145-0x157;const _0x4a600d=a32_0x4a60();let _0x184bfb=_0x4a600d[_0x132145];return _0x184bfb;}export function clearLogs(){const _0xe25eb5=a32_0x184b;logger['setLogPath'](process[_0xe25eb5(0x15f)]()),logger[_0xe25eb5(0x157)](),console['log'](_0xe25eb5(0x168));}
@@ -1 +1 @@
1
- (function(_0x406255,_0x9e5661){const _0x38557d=a33_0xa797,_0x4be167=_0x406255();while(!![]){try{const _0x579718=-parseInt(_0x38557d(0x1da))/0x1*(parseInt(_0x38557d(0x1f3))/0x2)+parseInt(_0x38557d(0x1df))/0x3*(parseInt(_0x38557d(0x1ee))/0x4)+-parseInt(_0x38557d(0x1dc))/0x5+-parseInt(_0x38557d(0x1e1))/0x6+-parseInt(_0x38557d(0x1e7))/0x7*(parseInt(_0x38557d(0x1de))/0x8)+parseInt(_0x38557d(0x1f2))/0x9*(parseInt(_0x38557d(0x1dd))/0xa)+parseInt(_0x38557d(0x1eb))/0xb*(parseInt(_0x38557d(0x1ed))/0xc);if(_0x579718===_0x9e5661)break;else _0x4be167['push'](_0x4be167['shift']());}catch(_0x1c8339){_0x4be167['push'](_0x4be167['shift']());}}}(a33_0x4fb2,0xf2130));import{delimiter,join}from'node:path';function a33_0xa797(_0x737a2e,_0xf022aa){_0x737a2e=_0x737a2e-0x1d8;const _0x4fb28e=a33_0x4fb2();let _0xa7971d=_0x4fb28e[_0x737a2e];return _0xa7971d;}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x5965a3,_0x342cad)=>{const _0x33cb38=a33_0xa797,_0x1d76c4=Date['now']();logger[_0x33cb38(0x1f0)](_0x33cb38(0x1ef),_0x33cb38(0x1f5),{'command':_0x33cb38(0x1db)});let _0x2ca1ff='';const _0x512c9f=spawn('vite',[_0x33cb38(0x1ef)],{'stdio':[_0x33cb38(0x1e2),_0x33cb38(0x1e2),_0x33cb38(0x1d9)],'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x33cb38(0x1f6)](),'node_modules',_0x33cb38(0x1e5))+delimiter+process['env'][_0x33cb38(0x1e8)]}});_0x512c9f[_0x33cb38(0x1f4)]?.['on'](_0x33cb38(0x1e3),_0x373175=>{const _0x33a92e=_0x33cb38;_0x2ca1ff+=_0x373175[_0x33a92e(0x1ec)]();}),_0x512c9f['on']('close',_0x4dd59f=>{const _0x597b55=_0x33cb38,_0x478d44=Date[_0x597b55(0x1e0)]()-_0x1d76c4;if(_0x4dd59f===0x0||_0x4dd59f===null)logger[_0x597b55(0x1e6)](_0x597b55(0x1ef),_0x597b55(0x1ea),_0x478d44),_0x5965a3();else{const _0x2be0e5={'exitCode':_0x4dd59f,'duration':_0x478d44,'command':'vite\x20preview','cwd':process[_0x597b55(0x1f6)]()};_0x2ca1ff[_0x597b55(0x1e4)]()&&(_0x2be0e5[_0x597b55(0x1f4)]=_0x2ca1ff['trim']()),logger[_0x597b55(0x1e9)](_0x597b55(0x1ef),'预览服务器启动失败',_0x2be0e5),_0x342cad(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x4dd59f));}}),_0x512c9f['on'](_0x33cb38(0x1e9),_0x1ddc6d=>{const _0x24f326=_0x33cb38,_0x4a645e=Date['now']()-_0x1d76c4;logger['error']('preview',_0x24f326(0x1f1),{'error':_0x1ddc6d[_0x24f326(0x1d8)],'duration':_0x4a645e,'stderr':_0x2ca1ff[_0x24f326(0x1e4)]()||undefined}),_0x342cad(_0x1ddc6d);});});}function a33_0x4fb2(){const _0x43c993=['8aPPSbR','preview','info','预览服务器启动出错','21699MVLOOv','4892vBsRxn','stderr','启动预览服务器','cwd','message','pipe','570HwYAra','vite\x20preview','1828025AUuTtL','1110ZVbmsA','9904kNmRfN','2808453cBkXTq','now','2189904WrTWTH','inherit','data','trim','.bin','success','4928dchwrs','PATH','error','预览服务器启动成功','11UbFbMH','toString','22175688dJHnvt'];a33_0x4fb2=function(){return _0x43c993;};return a33_0x4fb2();}
1
+ function a33_0x4739(_0xe26e32,_0x2c586b){_0xe26e32=_0xe26e32-0x10e;const _0x79c12f=a33_0x79c1();let _0x473992=_0x79c12f[_0xe26e32];return _0x473992;}function a33_0x79c1(){const _0x48b7ad=['104913ODppFg','data','vite\x20preview','pipe','error','now','421638xviLKC','预览服务器启动成功','stderr','预览服务器启动失败','vite\x20preview\x20exited\x20with\x20code\x20','14HwGyCw','1736600BHXwAR','vite','close','预览服务器启动出错','cwd','node_modules','2336505XMDMRv','preview','399393TzeUbC','180dGtdrW','.bin','env','trim','toString','info','207808MVQWii','4493768PCDIqg','80kzzxYg','inherit'];a33_0x79c1=function(){return _0x48b7ad;};return a33_0x79c1();}(function(_0x1986a2,_0x2587bd){const _0x33ac85=a33_0x4739,_0x45039f=_0x1986a2();while(!![]){try{const _0x54c7f2=parseInt(_0x33ac85(0x121))/0x1+-parseInt(_0x33ac85(0x112))/0x2+-parseInt(_0x33ac85(0x125))/0x3*(-parseInt(_0x33ac85(0x123))/0x4)+parseInt(_0x33ac85(0x118))/0x5+-parseInt(_0x33ac85(0x12b))/0x6*(parseInt(_0x33ac85(0x111))/0x7)+-parseInt(_0x33ac85(0x122))/0x8+parseInt(_0x33ac85(0x11a))/0x9*(parseInt(_0x33ac85(0x11b))/0xa);if(_0x54c7f2===_0x2587bd)break;else _0x45039f['push'](_0x45039f['shift']());}catch(_0x515b33){_0x45039f['push'](_0x45039f['shift']());}}}(a33_0x79c1,0x9327c));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x2e56b3,_0x2af7b8)=>{const _0x16db89=a33_0x4739,_0x17032c=Date['now']();logger[_0x16db89(0x120)](_0x16db89(0x119),'启动预览服务器',{'command':_0x16db89(0x127)});let _0x2e4c91='';const _0x4a19a9=spawn(_0x16db89(0x113),[_0x16db89(0x119)],{'stdio':[_0x16db89(0x124),_0x16db89(0x124),_0x16db89(0x128)],'shell':!![],'env':{...process[_0x16db89(0x11d)],'PATH':''+join(process['cwd'](),_0x16db89(0x117),_0x16db89(0x11c))+delimiter+process[_0x16db89(0x11d)]['PATH']}});_0x4a19a9['stderr']?.['on'](_0x16db89(0x126),_0x4db4a2=>{const _0x2df4c5=_0x16db89;_0x2e4c91+=_0x4db4a2[_0x2df4c5(0x11f)]();}),_0x4a19a9['on'](_0x16db89(0x114),_0x378da6=>{const _0x48683f=_0x16db89,_0x329a2f=Date[_0x48683f(0x12a)]()-_0x17032c;if(_0x378da6===0x0||_0x378da6===null)logger['success'](_0x48683f(0x119),_0x48683f(0x12c),_0x329a2f),_0x2e56b3();else{const _0x5e356b={'exitCode':_0x378da6,'duration':_0x329a2f,'command':_0x48683f(0x127),'cwd':process[_0x48683f(0x116)]()};_0x2e4c91[_0x48683f(0x11e)]()&&(_0x5e356b[_0x48683f(0x10e)]=_0x2e4c91['trim']()),logger[_0x48683f(0x129)](_0x48683f(0x119),_0x48683f(0x10f),_0x5e356b),_0x2af7b8(new Error(_0x48683f(0x110)+_0x378da6));}}),_0x4a19a9['on']('error',_0x412b0c=>{const _0x32d816=_0x16db89,_0x5be057=Date[_0x32d816(0x12a)]()-_0x17032c;logger[_0x32d816(0x129)](_0x32d816(0x119),_0x32d816(0x115),{'error':_0x412b0c['message'],'duration':_0x5be057,'stderr':_0x2e4c91[_0x32d816(0x11e)]()||undefined}),_0x2af7b8(_0x412b0c);});});}
package/lib/cmd/start.js CHANGED
@@ -1 +1 @@
1
- (function(_0x31f3d9,_0x14266a){const _0x5829c1=a34_0x183d,_0x11e7d5=_0x31f3d9();while(!![]){try{const _0x113d06=parseInt(_0x5829c1(0x14a))/0x1+parseInt(_0x5829c1(0x12c))/0x2+-parseInt(_0x5829c1(0x13d))/0x3*(-parseInt(_0x5829c1(0x142))/0x4)+-parseInt(_0x5829c1(0x139))/0x5+-parseInt(_0x5829c1(0x136))/0x6*(parseInt(_0x5829c1(0x148))/0x7)+-parseInt(_0x5829c1(0x146))/0x8*(-parseInt(_0x5829c1(0x145))/0x9)+-parseInt(_0x5829c1(0x138))/0xa;if(_0x113d06===_0x14266a)break;else _0x11e7d5['push'](_0x11e7d5['shift']());}catch(_0x4e3f5e){_0x11e7d5['push'](_0x11e7d5['shift']());}}}(a34_0x3b37,0x7ca31));function a34_0x183d(_0x52e61c,_0x325836){_0x52e61c=_0x52e61c-0x129;const _0x3b3744=a34_0x3b37();let _0x183d4c=_0x3b3744[_0x52e61c];return _0x183d4c;}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';function a34_0x3b37(){const _0x3ca07b=['开发服务器启动出错','626706FJuYcg','write','now','start','1210328SXBdye','error','trim','version','success','env','info','启动开发服务器','data','warn','246gvLLqV','vite\x20exited\x20with\x20code\x20','1445040CFQDbJ','2005370elpuEC','PATH','pipe','vite','179727tEehZp','message','stderr','toString','close','8eNwfSl','inherit','.bin','1622367JoqeMj','16YZioQd','needsUpgrade','112021xBIdqL'];a34_0x3b37=function(){return _0x3ca07b;};return a34_0x3b37();}import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';export function runStart(_0x3bfb74){return new Promise((_0x127580,_0x1fcf20)=>{const _0x5d5d65=a34_0x183d,_0x871c81=Date['now'](),_0x457178=_0x3bfb74||process['cwd'](),_0x348490=checkSdkVersion(_0x457178);_0x348490[_0x5d5d65(0x147)]&&(printSdkUpgradeWarning(_0x348490),logger[_0x5d5d65(0x135)]('start','SDK\x20版本低于推荐版本',{'currentVersion':_0x348490[_0x5d5d65(0x12f)],'minVersion':_0x348490['minVersion']}));logger[_0x5d5d65(0x132)](_0x5d5d65(0x12b),_0x5d5d65(0x133),{'command':_0x5d5d65(0x13c),'cwd':_0x457178});let _0x17f0e7='';const _0x14ba52=spawn('vite',{'stdio':['inherit',_0x5d5d65(0x143),_0x5d5d65(0x13b)],'shell':!![],'cwd':_0x457178,'env':{...process[_0x5d5d65(0x131)],'PATH':''+join(_0x457178,'node_modules',_0x5d5d65(0x144))+delimiter+process[_0x5d5d65(0x131)][_0x5d5d65(0x13a)]}});_0x14ba52[_0x5d5d65(0x13f)]?.['on'](_0x5d5d65(0x134),_0x1f799a=>{const _0x271913=_0x5d5d65,_0x9f76cb=_0x1f799a[_0x271913(0x140)]();_0x17f0e7+=_0x9f76cb,process[_0x271913(0x13f)][_0x271913(0x129)](_0x9f76cb);}),_0x14ba52['on'](_0x5d5d65(0x141),_0x2618ff=>{const _0x298faf=_0x5d5d65,_0x215f27=Date[_0x298faf(0x12a)]()-_0x871c81;if(_0x2618ff===0x0||_0x2618ff===null)logger[_0x298faf(0x130)](_0x298faf(0x12b),'开发服务器启动成功',_0x215f27),_0x127580();else{const _0x2021d9={'exitCode':_0x2618ff,'duration':_0x215f27,'command':_0x298faf(0x13c),'cwd':_0x457178};_0x17f0e7[_0x298faf(0x12e)]()&&(_0x2021d9[_0x298faf(0x13f)]=_0x17f0e7[_0x298faf(0x12e)]()),logger[_0x298faf(0x12d)](_0x298faf(0x12b),'开发服务器启动失败',_0x2021d9),_0x1fcf20(new Error(_0x298faf(0x137)+_0x2618ff));}}),_0x14ba52['on'](_0x5d5d65(0x12d),_0x11ecd3=>{const _0x11b955=_0x5d5d65,_0x1df17f=Date[_0x11b955(0x12a)]()-_0x871c81,_0x5aff67={'error':_0x11ecd3[_0x11b955(0x13e)],'duration':_0x1df17f,'command':_0x11b955(0x13c),'cwd':_0x457178};_0x17f0e7[_0x11b955(0x12e)]()&&(_0x5aff67[_0x11b955(0x13f)]=_0x17f0e7[_0x11b955(0x12e)]()),logger[_0x11b955(0x12d)](_0x11b955(0x12b),_0x11b955(0x149),_0x5aff67),_0x1fcf20(_0x11ecd3);});});}
1
+ (function(_0x2cb49d,_0x3567bc){const _0x3c4a4d=a34_0x294c,_0x11a551=_0x2cb49d();while(!![]){try{const _0x2534b2=parseInt(_0x3c4a4d(0x170))/0x1+-parseInt(_0x3c4a4d(0x18b))/0x2+parseInt(_0x3c4a4d(0x18e))/0x3+parseInt(_0x3c4a4d(0x18d))/0x4*(-parseInt(_0x3c4a4d(0x18f))/0x5)+-parseInt(_0x3c4a4d(0x17d))/0x6+parseInt(_0x3c4a4d(0x183))/0x7*(parseInt(_0x3c4a4d(0x176))/0x8)+-parseInt(_0x3c4a4d(0x17c))/0x9;if(_0x2534b2===_0x3567bc)break;else _0x11a551['push'](_0x11a551['shift']());}catch(_0x49ba47){_0x11a551['push'](_0x11a551['shift']());}}}(a34_0x58b8,0x1edac));import{delimiter,join}from'node:path';function a34_0x294c(_0x593038,_0x54beb9){_0x593038=_0x593038-0x16d;const _0x58b888=a34_0x58b8();let _0x294c2d=_0x58b888[_0x593038];return _0x294c2d;}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';export function runStart(_0x1a2591){return new Promise((_0x5dc587,_0x131f8c)=>{const _0xe3a5f2=a34_0x294c,_0x4246e8=Date[_0xe3a5f2(0x182)](),_0x1e1ae3=_0x1a2591||process[_0xe3a5f2(0x189)](),_0x5d6b89=checkSdkVersion(_0x1e1ae3);_0x5d6b89['needsUpgrade']&&(printSdkUpgradeWarning(_0x5d6b89),logger[_0xe3a5f2(0x175)]('start',_0xe3a5f2(0x187),{'currentVersion':_0x5d6b89[_0xe3a5f2(0x171)],'minVersion':_0x5d6b89[_0xe3a5f2(0x184)]}));logger[_0xe3a5f2(0x17f)](_0xe3a5f2(0x17b),_0xe3a5f2(0x178),{'command':'vite','cwd':_0x1e1ae3});let _0x1063af='';const _0x59d599=spawn('vite',{'stdio':[_0xe3a5f2(0x186),'inherit',_0xe3a5f2(0x17a)],'shell':!![],'cwd':_0x1e1ae3,'env':{...process[_0xe3a5f2(0x16f)],'PATH':''+join(_0x1e1ae3,'node_modules','.bin')+delimiter+process[_0xe3a5f2(0x16f)][_0xe3a5f2(0x18a)]}});_0x59d599['stderr']?.['on']('data',_0x2852dc=>{const _0xc3dfb0=_0xe3a5f2,_0x2e5271=_0x2852dc[_0xc3dfb0(0x172)]();_0x1063af+=_0x2e5271,process[_0xc3dfb0(0x177)][_0xc3dfb0(0x188)](_0x2e5271);}),_0x59d599['on'](_0xe3a5f2(0x16d),_0x925649=>{const _0x310561=_0xe3a5f2,_0x365c63=Date[_0x310561(0x182)]()-_0x4246e8;if(_0x925649===0x0||_0x925649===null)logger[_0x310561(0x185)](_0x310561(0x17b),_0x310561(0x173),_0x365c63),_0x5dc587();else{const _0x869d20={'exitCode':_0x925649,'duration':_0x365c63,'command':_0x310561(0x17e),'cwd':_0x1e1ae3};_0x1063af[_0x310561(0x18c)]()&&(_0x869d20[_0x310561(0x177)]=_0x1063af[_0x310561(0x18c)]()),logger[_0x310561(0x16e)](_0x310561(0x17b),_0x310561(0x179),_0x869d20),_0x131f8c(new Error(_0x310561(0x181)+_0x925649));}}),_0x59d599['on'](_0xe3a5f2(0x16e),_0x10ad31=>{const _0x4b3d09=_0xe3a5f2,_0x526158=Date[_0x4b3d09(0x182)]()-_0x4246e8,_0xd228b6={'error':_0x10ad31[_0x4b3d09(0x180)],'duration':_0x526158,'command':_0x4b3d09(0x17e),'cwd':_0x1e1ae3};_0x1063af[_0x4b3d09(0x18c)]()&&(_0xd228b6[_0x4b3d09(0x177)]=_0x1063af[_0x4b3d09(0x18c)]()),logger[_0x4b3d09(0x16e)](_0x4b3d09(0x17b),_0x4b3d09(0x174),_0xd228b6),_0x131f8c(_0x10ad31);});});}function a34_0x58b8(){const _0x32e755=['minVersion','success','inherit','SDK\x20版本低于推荐版本','write','cwd','PATH','16052gMQNEa','trim','134340HjOSWR','456204PGSSRc','5rlqIba','close','error','env','219828nTqVVM','version','toString','开发服务器启动成功','开发服务器启动出错','warn','51200lmQGGs','stderr','启动开发服务器','开发服务器启动失败','pipe','start','1776690gTBPxF','1152570BZastx','vite','info','message','vite\x20exited\x20with\x20code\x20','now','203lowdzC'];a34_0x58b8=function(){return _0x32e755;};return a34_0x58b8();}
@@ -1 +1 @@
1
- function a35_0x23ad(_0x5da8ea,_0x4d825d){_0x5da8ea=_0x5da8ea-0x15a;const _0x407dc4=a35_0x407d();let _0x23adb6=_0x407dc4[_0x5da8ea];return _0x23adb6;}(function(_0x261044,_0x1e45e8){const _0x1eef6f=a35_0x23ad,_0x27b283=_0x261044();while(!![]){try{const _0x478b85=-parseInt(_0x1eef6f(0x16b))/0x1*(parseInt(_0x1eef6f(0x15e))/0x2)+parseInt(_0x1eef6f(0x16d))/0x3+-parseInt(_0x1eef6f(0x15f))/0x4+parseInt(_0x1eef6f(0x167))/0x5+-parseInt(_0x1eef6f(0x169))/0x6*(-parseInt(_0x1eef6f(0x172))/0x7)+parseInt(_0x1eef6f(0x15c))/0x8*(parseInt(_0x1eef6f(0x161))/0x9)+parseInt(_0x1eef6f(0x15d))/0xa*(-parseInt(_0x1eef6f(0x171))/0xb);if(_0x478b85===_0x1e45e8)break;else _0x27b283['push'](_0x27b283['shift']());}catch(_0x9b9af8){_0x27b283['push'](_0x27b283['shift']());}}}(a35_0x407d,0xa1cc0));import{jsxs as a35_0x44f631,jsx as a35_0x243e1f}from'react/jsx-runtime';function a35_0x407d(){const _0x3c819a=['列出所有配置项','配置当前项目的\x20App\x20Code','178893TfwRMf','32774ycPBza','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','gray','8WwNCSR','690vMnWDX','27072rjsQak','3765896VbmGyp','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','6567948VLbZNl','获取配置项','\x20*\x20配置示例:','\x20\x20\x20\x20','description','column','5493340KrXztt','设置环境\x20(online/daily)','678IIyvvW','无效的命令,可用命令如下:','6odsnvp','map','1350153WkSYIh','command'];a35_0x407d=function(){return _0x3c819a;};return a35_0x407d();}import{Box,Text}from'ink';export function ConfigHelp(){const _0x653ebb=a35_0x23ad,_0x2f5e73=[{'command':_0x653ebb(0x160),'description':'设置配置项'},{'command':'lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':_0x653ebb(0x162)},{'command':'lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':_0x653ebb(0x16f)}],_0xb84658=[{'command':_0x653ebb(0x15a),'description':_0x653ebb(0x170)},{'command':'lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','description':_0x653ebb(0x168)}];return a35_0x44f631(Box,{'flexDirection':_0x653ebb(0x166),'marginTop':0x1,'marginBottom':0x1,'children':[a35_0x243e1f(Box,{'marginBottom':0x1,'children':a35_0x44f631(Text,{'color':'gray','children':['\x20!','\x20\x20',_0x653ebb(0x16a)]})}),_0x2f5e73[_0x653ebb(0x16c)](_0x1e80a3=>a35_0x44f631(Box,{'children':[a35_0x44f631(Text,{'children':[_0x653ebb(0x164),_0x1e80a3['command']]}),a35_0x243e1f(Text,{'color':_0x653ebb(0x15b),'children':_0x1e80a3['description']})]},_0x1e80a3[_0x653ebb(0x16e)])),a35_0x243e1f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a35_0x243e1f(Text,{'color':'gray','children':_0x653ebb(0x163)})}),_0xb84658[_0x653ebb(0x16c)](_0x531f97=>a35_0x44f631(Box,{'children':[a35_0x44f631(Text,{'children':[_0x653ebb(0x164),_0x531f97[_0x653ebb(0x16e)]]}),a35_0x243e1f(Text,{'color':_0x653ebb(0x15b),'children':_0x531f97[_0x653ebb(0x165)]})]},_0x531f97[_0x653ebb(0x16e)]))]});}
1
+ (function(_0x57a9fd,_0x301bc8){const _0x1f4e94=a35_0x409b,_0x465d4e=_0x57a9fd();while(!![]){try{const _0x35d63f=parseInt(_0x1f4e94(0xa2))/0x1*(parseInt(_0x1f4e94(0xa5))/0x2)+parseInt(_0x1f4e94(0xa6))/0x3*(-parseInt(_0x1f4e94(0xb5))/0x4)+-parseInt(_0x1f4e94(0xa0))/0x5+-parseInt(_0x1f4e94(0xa9))/0x6+-parseInt(_0x1f4e94(0xb3))/0x7*(parseInt(_0x1f4e94(0xb7))/0x8)+parseInt(_0x1f4e94(0xa7))/0x9*(-parseInt(_0x1f4e94(0xb9))/0xa)+parseInt(_0x1f4e94(0xae))/0xb*(parseInt(_0x1f4e94(0xb8))/0xc);if(_0x35d63f===_0x301bc8)break;else _0x465d4e['push'](_0x465d4e['shift']());}catch(_0x3b303c){_0x465d4e['push'](_0x465d4e['shift']());}}}(a35_0x5154,0x8892c));import{jsxs as a35_0x238309,jsx as a35_0x37a20c}from'react/jsx-runtime';function a35_0x409b(_0x41d7ff,_0x3c3264){_0x41d7ff=_0x41d7ff-0xa0;const _0x5154c6=a35_0x5154();let _0x409bd2=_0x5154c6[_0x41d7ff];return _0x409bd2;}import{Box,Text}from'ink';function a35_0x5154(){const _0x37fae6=['command','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','列出所有配置项','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','133sxkils','gray','1469708VBKAXu','获取配置项','16984chAXFf','4428NEiRZV','2570jlGxeJ','3369895AmhISb','\x20*\x20配置示例:','860290cfgkNv','map','\x20\x20\x20\x20','2kSqLia','9AVTAJb','27315CqNKuv','设置环境\x20(online/daily)','3689796FYApoJ','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','description','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','86768ZcDdhr'];a35_0x5154=function(){return _0x37fae6;};return a35_0x5154();}export function ConfigHelp(){const _0x278471=a35_0x409b,_0x493ae1=[{'command':_0x278471(0xad),'description':'设置配置项'},{'command':_0x278471(0xb2),'description':_0x278471(0xb6)},{'command':_0x278471(0xb0),'description':_0x278471(0xb1)}],_0x2b4a41=[{'command':_0x278471(0xab),'description':'配置当前项目的\x20App\x20Code'},{'command':_0x278471(0xaa),'description':_0x278471(0xa8)}];return a35_0x238309(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a35_0x37a20c(Box,{'marginBottom':0x1,'children':a35_0x238309(Text,{'color':_0x278471(0xb4),'children':['\x20!','\x20\x20','无效的命令,可用命令如下:']})}),_0x493ae1[_0x278471(0xa3)](_0x1a52d9=>a35_0x238309(Box,{'children':[a35_0x238309(Text,{'children':[_0x278471(0xa4),_0x1a52d9[_0x278471(0xaf)]]}),a35_0x37a20c(Text,{'color':_0x278471(0xb4),'children':_0x1a52d9['description']})]},_0x1a52d9[_0x278471(0xaf)])),a35_0x37a20c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a35_0x37a20c(Text,{'color':_0x278471(0xb4),'children':_0x278471(0xa1)})}),_0x2b4a41[_0x278471(0xa3)](_0x1df669=>a35_0x238309(Box,{'children':[a35_0x238309(Text,{'children':['\x20\x20\x20\x20',_0x1df669[_0x278471(0xaf)]]}),a35_0x37a20c(Text,{'color':_0x278471(0xb4),'children':_0x1df669[_0x278471(0xac)]})]},_0x1df669[_0x278471(0xaf)]))]});}
@@ -1 +1 @@
1
- (function(_0x4620ce,_0x620369){const _0x1da581=a36_0xc9f6,_0x2a574e=_0x4620ce();while(!![]){try{const _0x52f1a2=-parseInt(_0x1da581(0x1bc))/0x1+-parseInt(_0x1da581(0x1b3))/0x2*(parseInt(_0x1da581(0x1c4))/0x3)+-parseInt(_0x1da581(0x1cb))/0x4*(-parseInt(_0x1da581(0x1c8))/0x5)+parseInt(_0x1da581(0x1c3))/0x6+-parseInt(_0x1da581(0x1be))/0x7*(-parseInt(_0x1da581(0x1c2))/0x8)+parseInt(_0x1da581(0x1bd))/0x9+-parseInt(_0x1da581(0x1ce))/0xa*(parseInt(_0x1da581(0x1ad))/0xb);if(_0x52f1a2===_0x620369)break;else _0x2a574e['push'](_0x2a574e['shift']());}catch(_0x3c861c){_0x2a574e['push'](_0x2a574e['shift']());}}}(a36_0x24dc,0x87555));import{jsx as a36_0x4fdbc5,jsxs as a36_0x3f08cc}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a36_0x1e7420 from'node:fs';function a36_0xc9f6(_0x8c627,_0x4b2c85){_0x8c627=_0x8c627-0x1a8;const _0x24dc5b=a36_0x24dc();let _0xc9f650=_0x24dc5b[_0x8c627];return _0xc9f650;}function a36_0x24dc(){const _0x332e16=['undefined','mkdirSync','input','496486IrnwXr','config','online','help','stringify','配置值无效或过长','appcode','保存配置失败','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','34690rBqlVA','8589132VrJMrt','289625wInhnN','未提供配置值','app','flags','40UIJRNV','4721454UqgaZa','3kKBUCs','includes','dirname','message','2584355qbxLiS','env','string','8FFuOlA','set','red','10723080qZouBM','utf8','daily','length','.tmp','get','log','--help','parse','环境配置已设置为:\x20','22XAdAMm','renameSync','error'];a36_0x24dc=function(){return _0x332e16;};return a36_0x24dc();}import a36_0x3b8e7e from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x11438f){const _0x13a729=a36_0xc9f6,{cli:_0x34a5a0}=_0x11438f,_0x5e5be1=_0x34a5a0['input'][0x1],_0x5f0a4f=_0x34a5a0['input'][0x2],_0x481d8f=[_0x13a729(0x1cc),'get'][_0x13a729(0x1c5)](_0x5e5be1||''),_0x4ae147=_0x34a5a0[_0x13a729(0x1b2)][_0x13a729(0x1d1)]>=0x3;if(_0x5f0a4f===_0x13a729(0x1aa)||_0x34a5a0[_0x13a729(0x1c1)][_0x13a729(0x1b6)])return a36_0x4fdbc5(ConfigHelp,{});const _0x98ba6d=readConfig();if(_0x5e5be1===_0x13a729(0x1cc)){if(_0x5f0a4f){const _0x15173f=_0x34a5a0['input'][0x3];if(typeof _0x15173f!=='undefined'){if(_0x5f0a4f==='env'&&![_0x13a729(0x1b5),_0x13a729(0x1d0)]['includes'](_0x15173f))return a36_0x4fdbc5(Box,{'children':a36_0x4fdbc5(Text,{'color':'red','children':_0x13a729(0x1bb)})});const _0xdcd054=isInProject(),_0x3939ea=_0xdcd054?projectConfigPath:globalConfigPath;let _0x25fd78={};try{if(existsSync(_0x3939ea)){const _0x3bda8f=readFileSync(_0x3939ea,{'encoding':_0x13a729(0x1cf)});_0x3bda8f&&(_0x25fd78=JSON[_0x13a729(0x1ab)](_0x3bda8f));}}catch(_0x106bb2){}if(typeof _0x15173f!==_0x13a729(0x1ca)||_0x15173f['length']>0x1f4)return a36_0x4fdbc5(Box,{'children':a36_0x4fdbc5(Text,{'color':_0x13a729(0x1cd),'children':_0x13a729(0x1b8)})});let _0x3b5d6c=_0x5f0a4f;_0x5f0a4f===_0x13a729(0x1c0)&&(_0x3b5d6c=_0x13a729(0x1b9),delete _0x25fd78['app']);_0x5f0a4f===_0x13a729(0x1b9)&&delete _0x25fd78[_0x13a729(0x1c0)];_0x25fd78[_0x3b5d6c]=_0x15173f;try{const _0x2bd1b1=a36_0x3b8e7e[_0x13a729(0x1c6)](_0x3939ea);!existsSync(_0x2bd1b1)&&a36_0x1e7420[_0x13a729(0x1b1)](_0x2bd1b1,{'recursive':!![]});const _0x9846c1=_0x3939ea+_0x13a729(0x1d2);writeFileSync(_0x9846c1,JSON[_0x13a729(0x1b7)](_0x25fd78,null,0x2),{'encoding':'utf8','mode':0x180}),a36_0x1e7420[_0x13a729(0x1ae)](_0x9846c1,_0x3939ea);if(_0x5f0a4f===_0x13a729(0x1c9)){const _0x2ee694=_0xdcd054?'项目':'全局';console[_0x13a729(0x1a9)]('✓\x20'+_0x2ee694+_0x13a729(0x1ac)+_0x15173f);}}catch(_0x5a3a6c){const _0x303b58=_0x3939ea+'.tmp';try{existsSync(_0x303b58)&&a36_0x1e7420['unlinkSync'](_0x303b58);}catch(_0x393242){}return logger[_0x13a729(0x1af)](_0x13a729(0x1b4),_0x13a729(0x1ba),{'error':_0x5a3a6c instanceof Error?_0x5a3a6c[_0x13a729(0x1c7)]:String(_0x5a3a6c),'configKey':_0x5f0a4f,'configValue':_0x15173f,'targetConfigPath':_0x3939ea}),a36_0x4fdbc5(Box,{'children':a36_0x3f08cc(Text,{'color':_0x13a729(0x1cd),'children':['保存配置失败:\x20',_0x5a3a6c instanceof Error?_0x5a3a6c['message']:String(_0x5a3a6c)]})});}return null;}return a36_0x4fdbc5(Box,{'children':a36_0x4fdbc5(Text,{'color':'red','children':_0x13a729(0x1bf)})});}}if(_0x5e5be1===_0x13a729(0x1a8)){if(_0x5f0a4f){let _0x4fc982=_0x5f0a4f;return _0x5f0a4f===_0x13a729(0x1c0)&&(_0x4fc982=_0x13a729(0x1b9)),console['log'](_0x98ba6d[_0x4fc982]||_0x13a729(0x1b0)),null;}return null;}if(_0x5e5be1==='list')return console[_0x13a729(0x1a9)](JSON[_0x13a729(0x1b7)](_0x98ba6d,null,0x2)),null;if(!_0x481d8f||!_0x4ae147)return a36_0x4fdbc5(ConfigHelp,{});return null;}
1
+ function a36_0x45df(){const _0x29cb04=['parse','stringify','67388AIejbT','red','config','input','length','utf8','message','log','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','dirname','help','unlinkSync','60YotCJM','3575142gOuzLj','mkdirSync','get','133oUELjF','56400pECUqe','undefined','168352zKbtnw','flags','.tmp','includes','183akJdDw','962883dbslpL','app','appcode','online','1837910pMseNV','error','env','未提供配置值','953622yYWJrT','--help'];a36_0x45df=function(){return _0x29cb04;};return a36_0x45df();}function a36_0x2ec2(_0x162d86,_0xffdfde){_0x162d86=_0x162d86-0x76;const _0x45df58=a36_0x45df();let _0x2ec2d7=_0x45df58[_0x162d86];return _0x2ec2d7;}(function(_0x56fe20,_0x4486bb){const _0x2f0bfb=a36_0x2ec2,_0x582e6d=_0x56fe20();while(!![]){try{const _0x170a6a=parseInt(_0x2f0bfb(0x77))/0x1+-parseInt(_0x2f0bfb(0x86))/0x2+parseInt(_0x2f0bfb(0x7d))/0x3*(parseInt(_0x2f0bfb(0x8a))/0x4)+parseInt(_0x2f0bfb(0x82))/0x5+parseInt(_0x2f0bfb(0x97))/0x6+-parseInt(_0x2f0bfb(0x76))/0x7*(parseInt(_0x2f0bfb(0x79))/0x8)+parseInt(_0x2f0bfb(0x7e))/0x9*(-parseInt(_0x2f0bfb(0x96))/0xa);if(_0x170a6a===_0x4486bb)break;else _0x582e6d['push'](_0x582e6d['shift']());}catch(_0x82cc1e){_0x582e6d['push'](_0x582e6d['shift']());}}}(a36_0x45df,0x81229));import{jsx as a36_0x2a5367,jsxs as a36_0x199041}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a36_0x271b3d from'node:fs';import a36_0x42f66a from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x26be6e){const _0x5ac656=a36_0x2ec2,{cli:_0x1d8bc7}=_0x26be6e,_0x18ac51=_0x1d8bc7[_0x5ac656(0x8d)][0x1],_0xd86b87=_0x1d8bc7[_0x5ac656(0x8d)][0x2],_0x170815=['set',_0x5ac656(0x99)][_0x5ac656(0x7c)](_0x18ac51||''),_0x5138ac=_0x1d8bc7[_0x5ac656(0x8d)][_0x5ac656(0x8e)]>=0x3;if(_0xd86b87===_0x5ac656(0x87)||_0x1d8bc7[_0x5ac656(0x7a)][_0x5ac656(0x94)])return a36_0x2a5367(ConfigHelp,{});const _0x46ac08=readConfig();if(_0x18ac51==='set'){if(_0xd86b87){const _0x5b28b5=_0x1d8bc7[_0x5ac656(0x8d)][0x3];if(typeof _0x5b28b5!==_0x5ac656(0x78)){if(_0xd86b87==='env'&&![_0x5ac656(0x81),'daily'][_0x5ac656(0x7c)](_0x5b28b5))return a36_0x2a5367(Box,{'children':a36_0x2a5367(Text,{'color':_0x5ac656(0x8b),'children':_0x5ac656(0x92)})});const _0x130235=isInProject(),_0x3a12c0=_0x130235?projectConfigPath:globalConfigPath;let _0x34af44={};try{if(existsSync(_0x3a12c0)){const _0x17db0c=readFileSync(_0x3a12c0,{'encoding':'utf8'});_0x17db0c&&(_0x34af44=JSON[_0x5ac656(0x88)](_0x17db0c));}}catch(_0xd554ca){}if(typeof _0x5b28b5!=='string'||_0x5b28b5[_0x5ac656(0x8e)]>0x1f4)return a36_0x2a5367(Box,{'children':a36_0x2a5367(Text,{'color':_0x5ac656(0x8b),'children':'配置值无效或过长'})});let _0x51d7c6=_0xd86b87;_0xd86b87===_0x5ac656(0x7f)&&(_0x51d7c6=_0x5ac656(0x80),delete _0x34af44['app']);_0xd86b87===_0x5ac656(0x80)&&delete _0x34af44['app'];_0x34af44[_0x51d7c6]=_0x5b28b5;try{const _0x65679=a36_0x42f66a[_0x5ac656(0x93)](_0x3a12c0);!existsSync(_0x65679)&&a36_0x271b3d[_0x5ac656(0x98)](_0x65679,{'recursive':!![]});const _0xc355cc=_0x3a12c0+_0x5ac656(0x7b);writeFileSync(_0xc355cc,JSON[_0x5ac656(0x89)](_0x34af44,null,0x2),{'encoding':_0x5ac656(0x8f),'mode':0x180}),a36_0x271b3d['renameSync'](_0xc355cc,_0x3a12c0);if(_0xd86b87===_0x5ac656(0x84)){const _0x1424c8=_0x130235?'项目':'全局';console['log']('✓\x20'+_0x1424c8+'环境配置已设置为:\x20'+_0x5b28b5);}}catch(_0x5cd04c){const _0x30fb7e=_0x3a12c0+_0x5ac656(0x7b);try{existsSync(_0x30fb7e)&&a36_0x271b3d[_0x5ac656(0x95)](_0x30fb7e);}catch(_0x4ed257){}return logger[_0x5ac656(0x83)](_0x5ac656(0x8c),'保存配置失败',{'error':_0x5cd04c instanceof Error?_0x5cd04c['message']:String(_0x5cd04c),'configKey':_0xd86b87,'configValue':_0x5b28b5,'targetConfigPath':_0x3a12c0}),a36_0x2a5367(Box,{'children':a36_0x199041(Text,{'color':_0x5ac656(0x8b),'children':['保存配置失败:\x20',_0x5cd04c instanceof Error?_0x5cd04c[_0x5ac656(0x90)]:String(_0x5cd04c)]})});}return null;}return a36_0x2a5367(Box,{'children':a36_0x2a5367(Text,{'color':_0x5ac656(0x8b),'children':_0x5ac656(0x85)})});}}if(_0x18ac51===_0x5ac656(0x99)){if(_0xd86b87){let _0x117bf4=_0xd86b87;return _0xd86b87===_0x5ac656(0x7f)&&(_0x117bf4=_0x5ac656(0x80)),console[_0x5ac656(0x91)](_0x46ac08[_0x117bf4]||_0x5ac656(0x78)),null;}return null;}if(_0x18ac51==='list')return console[_0x5ac656(0x91)](JSON['stringify'](_0x46ac08,null,0x2)),null;if(!_0x170815||!_0x5138ac)return a36_0x2a5367(ConfigHelp,{});return null;}
@@ -1 +1 @@
1
- const a37_0x56e973=a37_0x1056;function a37_0x1056(_0x516617,_0x157641){_0x516617=_0x516617-0x6a;const _0x127d0e=a37_0x127d();let _0x105611=_0x127d0e[_0x516617];return _0x105611;}function a37_0x127d(){const _0x56b9f3=['804858OoLdbS','https://api.lovrabet.com','389gsjFkv','330010CBkIvq','https://user-daily.lovrabet.com','online','https://user.lovrabet.com','1082uNQTEB','3950597KKAkRJ','6miuUjC','36HiCKvr','2397970Ogfyuu','https://daily-api.lovrabet.com','493228xsxnhq','6552136xxpadq'];a37_0x127d=function(){return _0x56b9f3;};return a37_0x127d();}(function(_0x32a10f,_0x3506bc){const _0x355b6d=a37_0x1056,_0x1cc41c=_0x32a10f();while(!![]){try{const _0xd6103=parseInt(_0x355b6d(0x78))/0x1*(-parseInt(_0x355b6d(0x6e))/0x2)+-parseInt(_0x355b6d(0x76))/0x3+-parseInt(_0x355b6d(0x74))/0x4+-parseInt(_0x355b6d(0x72))/0x5+parseInt(_0x355b6d(0x70))/0x6*(parseInt(_0x355b6d(0x6f))/0x7)+parseInt(_0x355b6d(0x75))/0x8+-parseInt(_0x355b6d(0x71))/0x9*(-parseInt(_0x355b6d(0x6a))/0xa);if(_0xd6103===_0x3506bc)break;else _0x1cc41c['push'](_0x1cc41c['shift']());}catch(_0x44fecd){_0x1cc41c['push'](_0x1cc41c['shift']());}}}(a37_0x127d,0x69e5c));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a37_0x56e973(0x6c)?a37_0x56e973(0x6d):a37_0x56e973(0x6b);export const getApiDomain=()=>getEnv()==='online'?a37_0x56e973(0x77):a37_0x56e973(0x73);
1
+ const a37_0x301bd4=a37_0x57bc;(function(_0x386ec8,_0x35e2db){const _0x5ed620=a37_0x57bc,_0x468a19=_0x386ec8();while(!![]){try{const _0x326c8e=-parseInt(_0x5ed620(0xdd))/0x1+-parseInt(_0x5ed620(0xd0))/0x2*(-parseInt(_0x5ed620(0xda))/0x3)+-parseInt(_0x5ed620(0xce))/0x4+-parseInt(_0x5ed620(0xd4))/0x5*(-parseInt(_0x5ed620(0xdc))/0x6)+parseInt(_0x5ed620(0xdb))/0x7+parseInt(_0x5ed620(0xd7))/0x8*(parseInt(_0x5ed620(0xd8))/0x9)+parseInt(_0x5ed620(0xcf))/0xa*(-parseInt(_0x5ed620(0xd6))/0xb);if(_0x326c8e===_0x35e2db)break;else _0x468a19['push'](_0x468a19['shift']());}catch(_0x562b21){_0x468a19['push'](_0x468a19['shift']());}}}(a37_0x3055,0xbdd87));import{getEnv}from'./env.js';function a37_0x57bc(_0xa3e13f,_0x13c287){_0xa3e13f=_0xa3e13f-0xce;const _0x30550f=a37_0x3055();let _0x57bc98=_0x30550f[_0xa3e13f];return _0x57bc98;}export const getUserDomain=()=>getEnv()===a37_0x301bd4(0xd1)?a37_0x301bd4(0xd5):a37_0x301bd4(0xd9);export const getApiDomain=()=>getEnv()===a37_0x301bd4(0xd1)?a37_0x301bd4(0xd3):a37_0x301bd4(0xd2);function a37_0x3055(){const _0x246c46=['https://api.lovrabet.com','7349435riGMOp','https://user.lovrabet.com','1727YWkbUf','139784KPtNca','279ZxzgZX','https://user-daily.lovrabet.com','1002417ZpKhwS','6576787sDTxPp','6bspxdI','1441821bWSkrH','2611112bwYAgG','47590EMYGNN','4qaCEYg','online','https://daily-api.lovrabet.com'];a37_0x3055=function(){return _0x246c46;};return a37_0x3055();}
@@ -1 +1 @@
1
- function a38_0x1e7d(){const _0x4b2ca4=['272EjFGUm','2610mVkLLL','61457BqWesx','4910710cXSpJD','10622538YOrJPe','346515OmlJFt','297633dbNhlP','2274570YlZpEw','124011RydrDu','6laPdJL','env','online','12tHxvga'];a38_0x1e7d=function(){return _0x4b2ca4;};return a38_0x1e7d();}const a38_0xe993c5=a38_0x4bf1;(function(_0x59f167,_0x1bd475){const _0x169cbf=a38_0x4bf1,_0xb2cf2f=_0x59f167();while(!![]){try{const _0x3903c4=-parseInt(_0x169cbf(0x14b))/0x1+parseInt(_0x169cbf(0x14d))/0x2+parseInt(_0x169cbf(0x14e))/0x3*(-parseInt(_0x169cbf(0x145))/0x4)+parseInt(_0x169cbf(0x149))/0x5*(-parseInt(_0x169cbf(0x14f))/0x6)+parseInt(_0x169cbf(0x14c))/0x7*(-parseInt(_0x169cbf(0x146))/0x8)+parseInt(_0x169cbf(0x14a))/0x9+-parseInt(_0x169cbf(0x147))/0xa*(-parseInt(_0x169cbf(0x148))/0xb);if(_0x3903c4===_0x1bd475)break;else _0xb2cf2f['push'](_0xb2cf2f['shift']());}catch(_0x5f5cb9){_0xb2cf2f['push'](_0xb2cf2f['shift']());}}}(a38_0x1e7d,0xd6394));let env=process[a38_0xe993c5(0x150)]['LOVRABET_ENV']||a38_0xe993c5(0x151);function a38_0x4bf1(_0x436b01,_0x3c0991){_0x436b01=_0x436b01-0x145;const _0x1e7dad=a38_0x1e7d();let _0x4bf18d=_0x1e7dad[_0x436b01];return _0x4bf18d;}export function getEnv(){return env;}export function initEnv(_0x4f9a0a){env=_0x4f9a0a;}
1
+ const a38_0x251d50=a38_0x3281;(function(_0x2a4833,_0x39ba9b){const _0x29adc1=a38_0x3281,_0x38599b=_0x2a4833();while(!![]){try{const _0x57ddd2=parseInt(_0x29adc1(0x1fa))/0x1+parseInt(_0x29adc1(0x1ed))/0x2+parseInt(_0x29adc1(0x1f2))/0x3*(parseInt(_0x29adc1(0x1f9))/0x4)+-parseInt(_0x29adc1(0x1f7))/0x5*(-parseInt(_0x29adc1(0x1ef))/0x6)+parseInt(_0x29adc1(0x1f8))/0x7*(-parseInt(_0x29adc1(0x1f4))/0x8)+-parseInt(_0x29adc1(0x1f5))/0x9+-parseInt(_0x29adc1(0x1f6))/0xa*(parseInt(_0x29adc1(0x1f3))/0xb);if(_0x57ddd2===_0x39ba9b)break;else _0x38599b['push'](_0x38599b['shift']());}catch(_0x4d6551){_0x38599b['push'](_0x38599b['shift']());}}}(a38_0x4443,0x197e4));let env=process[a38_0x251d50(0x1f0)][a38_0x251d50(0x1f1)]||a38_0x251d50(0x1ee);export function getEnv(){return env;}function a38_0x3281(_0x246aed,_0x350638){_0x246aed=_0x246aed-0x1ed;const _0x444303=a38_0x4443();let _0x328185=_0x444303[_0x246aed];return _0x328185;}function a38_0x4443(){const _0x42c588=['63GkDQhb','4tmLEDl','37205CiSuEp','273702WusCGh','online','10734BMgiYy','env','LOVRABET_ENV','421251MkzdBg','12518TJZsGq','28232lRhOWI','1801062dJjXmS','720tekAJt','290lXOEfS'];a38_0x4443=function(){return _0x42c588;};return a38_0x4443();}export function initEnv(_0x6d9cc5){env=_0x6d9cc5;}
@@ -1 +1 @@
1
- (function(_0x36f6b0,_0x175cc1){const _0x1adba2=a39_0x2362,_0x3f613a=_0x36f6b0();while(!![]){try{const _0x59835f=-parseInt(_0x1adba2(0x164))/0x1+-parseInt(_0x1adba2(0x181))/0x2*(parseInt(_0x1adba2(0x16e))/0x3)+-parseInt(_0x1adba2(0x16f))/0x4*(-parseInt(_0x1adba2(0x16d))/0x5)+-parseInt(_0x1adba2(0x197))/0x6+parseInt(_0x1adba2(0x169))/0x7+parseInt(_0x1adba2(0x19c))/0x8*(-parseInt(_0x1adba2(0x18b))/0x9)+-parseInt(_0x1adba2(0x182))/0xa*(-parseInt(_0x1adba2(0x16c))/0xb);if(_0x59835f===_0x175cc1)break;else _0x3f613a['push'](_0x3f613a['shift']());}catch(_0x4d383b){_0x3f613a['push'](_0x3f613a['shift']());}}}(a39_0x28ce,0x48736));import{jsx as a39_0xd0ae6a,jsxs as a39_0x302da6,Fragment as a39_0x325f7f}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';function a39_0x2362(_0x2910af,_0x53d6db){_0x2910af=_0x2910af-0x160;const _0x28ce4b=a39_0x28ce();let _0x236239=_0x28ce4b[_0x2910af];return _0x236239;}export function EnhancedGuidedCreate(_0x525266){const _0x358ad7=a39_0x2362,{onCreate:_0x141d0d,env:_0x117ed0}=_0x525266,[_0x256d46,_0x30e139]=useState('project-name'),[_0x2e1efb,_0x1524b1]=useState(''),[_0x264cda,_0x27f0d5]=useState(''),[_0x573ef2,_0x48c312]=useState(''),[_0x3a9ab5,_0x1c0efc]=useState(''),[_0x34e7bb,_0x299ae7]=useState([]),[_0x18a3f5,_0x42d623]=useState(null),[_0x2125c1,_0x553d6a]=useState(![]),[_0x19d0fa,_0x4c98aa]=useState(![]),[_0x1a592a,_0xad3361]=useState(![]),[_0x2c62ea,_0x2c5f92]=useState(0x0),[_0x350dad,_0x539f87]=useState(0x0),_0x5a8e64=_0x358ad7(0x189),_0xb6cf5f=readConfig(),_0x59a6c8=typeof _0xb6cf5f['env']===_0x358ad7(0x180)?_0xb6cf5f[_0x358ad7(0x166)]:undefined;function _0x5686ee(_0x547c6b){const _0x342424=_0x358ad7;if(_0x547c6b[_0x342424(0x1a0)]>0x32)return{'valid':![],'message':_0x342424(0x170)};const _0x12e5e5=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x547c6b?.[_0x342424(0x165)]()&&!_0x12e5e5[_0x342424(0x193)](_0x547c6b))return{'valid':![],'message':_0x342424(0x173)};return{'valid':!![]};}function _0x3154af(_0x241b16){const _0x1ea7d8=_0x358ad7;if(!_0x241b16[_0x1ea7d8(0x165)]())return{'valid':!![]};if(_0x241b16[_0x1ea7d8(0x1a0)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0x18c0aa=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x18c0aa['test'](_0x241b16))return{'valid':![],'message':_0x1ea7d8(0x178)};return{'valid':!![]};}async function _0x333496(){_0x553d6a(!![]);try{const _0x105509=await getIsSessionValid();return _0x42d623(_0x105509),_0x105509;}catch(_0x54de14){return _0x42d623(![]),![];}finally{_0x553d6a(![]);}}async function _0x2de975(){_0x4c98aa(!![]);try{const _0x3f62d8=await authServer({'silent':!![]});return _0x42d623(_0x3f62d8),_0x3f62d8;}catch(_0x2214ba){return _0x42d623(![]),![];}finally{_0x4c98aa(![]);}}return useInput(async(_0x25d718,_0x965ef4)=>{const _0x360aab=_0x358ad7;if(_0x965ef4[_0x360aab(0x172)]||_0x965ef4[_0x360aab(0x184)]){if(_0x256d46===_0x360aab(0x185)){_0x2c5f92(_0xa64628=>_0xa64628===0x0?0x1:0x0);return;}if(_0x256d46===_0x360aab(0x17b)){_0x539f87(_0x47e165=>_0x47e165===0x0?0x1:0x0);return;}}if(_0x965ef4[_0x360aab(0x187)]){if(_0x256d46===_0x360aab(0x196)){const _0x2d6f60=_0x573ef2[_0x360aab(0x165)]()||_0x5a8e64;if(_0x3a9ab5)return;_0x1524b1(_0x2d6f60),_0x299ae7([{'step':'project-name','label':_0x360aab(0x16b),'value':_0x2d6f60}]),_0x48c312(''),_0x1c0efc(''),_0x30e139(_0x360aab(0x191));return;}if(_0x256d46===_0x360aab(0x191)){if(_0x3a9ab5)return;const _0x2ad1d8=_0x573ef2[_0x360aab(0x165)]();_0x27f0d5(_0x2ad1d8),_0x299ae7(_0x4ec75e=>[..._0x4ec75e,{'step':'app-code','label':'应用AppCode','value':_0x2ad1d8||_0x360aab(0x17a)}]),_0x48c312(''),_0x1c0efc('');if(_0x2ad1d8){_0x30e139(_0x360aab(0x163));const _0x360a2b=await _0x333496();_0x360a2b?_0x30e139('confirm-api-pull'):_0x30e139(_0x360aab(0x17b));}else{const _0x3665f4=_0x117ed0||_0x59a6c8||_0x360aab(0x18d);_0x141d0d({'projectName':_0x2e1efb,'appCode':undefined,'pullApi':![],'env':_0x3665f4}),_0x30e139(_0x360aab(0x160));}return;}if(_0x256d46===_0x360aab(0x185)){const _0x1bcebb=_0x2c62ea===0x0;_0xad3361(_0x1bcebb),_0x299ae7(_0x254a04=>[..._0x254a04,{'step':_0x360aab(0x188),'label':'拉取API配置','value':_0x1bcebb?'是':'否'}]);const _0x29b0b9=_0x117ed0||_0x59a6c8||_0x360aab(0x18d);_0x141d0d({'projectName':_0x2e1efb,'appCode':_0x264cda,'pullApi':_0x1bcebb,'env':_0x29b0b9}),_0x30e139(_0x360aab(0x160));return;}if(_0x256d46===_0x360aab(0x17b)){const _0x2af4bf=_0x350dad===0x0;if(_0x2af4bf){_0x30e139('login-process');const _0xfd9fce=await _0x2de975();if(_0xfd9fce)_0x299ae7(_0x51e6fd=>[..._0x51e6fd,{'step':'login','label':_0x360aab(0x176),'value':_0x360aab(0x17e)}]),_0x30e139(_0x360aab(0x185));else{_0x299ae7(_0x4ab934=>[..._0x4ab934,{'step':_0x360aab(0x194),'label':'登录状态','value':_0x360aab(0x16a)}]);const _0x3041c4=_0x117ed0||_0x59a6c8||_0x360aab(0x18d);_0x141d0d({'projectName':_0x2e1efb,'appCode':_0x264cda,'pullApi':![],'env':_0x3041c4}),_0x30e139('creating');}}else{_0x299ae7(_0x3f894b=>[..._0x3f894b,{'step':_0x360aab(0x194),'label':_0x360aab(0x176),'value':_0x360aab(0x19a)}]);const _0x16cb70=_0x117ed0||_0x59a6c8||_0x360aab(0x18d);_0x141d0d({'projectName':_0x2e1efb,'appCode':_0x264cda,'pullApi':![],'env':_0x16cb70}),_0x30e139(_0x360aab(0x160));}return;}}if(_0x965ef4['backspace']||_0x965ef4[_0x360aab(0x17f)]){_0x48c312(_0x147b77=>{const _0x14cb53=_0x360aab,_0x966ffc=_0x147b77[_0x14cb53(0x19d)](0x0,-0x1);if(_0x256d46==='project-name'){const {valid:_0x4b4da5,message:_0x2bf87f}=_0x5686ee(_0x966ffc);_0x1c0efc(_0x4b4da5?'':_0x2bf87f||'项目名不合法');}else{if(_0x256d46===_0x14cb53(0x191)){const {valid:_0x4aebca,message:_0x32ef73}=_0x3154af(_0x966ffc);_0x1c0efc(_0x4aebca?'':_0x32ef73||_0x14cb53(0x190));}}return _0x966ffc;});return;}if(['creating',_0x360aab(0x163),_0x360aab(0x171)][_0x360aab(0x18c)](_0x256d46))return;if(_0x256d46===_0x360aab(0x185)||_0x256d46===_0x360aab(0x17b))return;_0x48c312(_0x12b31b=>{const _0x802c5e=_0x360aab,_0x1d0d56=_0x12b31b+_0x25d718;if(_0x256d46===_0x802c5e(0x196)){const {valid:_0x42629f,message:_0x2619fe}=_0x5686ee(_0x1d0d56);_0x1c0efc(_0x42629f?'':_0x2619fe||_0x802c5e(0x174));}else{if(_0x256d46==='app-code'){const {valid:_0x4dd2aa,message:_0x540703}=_0x3154af(_0x1d0d56);_0x1c0efc(_0x4dd2aa?'':_0x540703||_0x802c5e(0x190));}}return _0x1d0d56;});}),a39_0x302da6(Box,{'flexDirection':_0x358ad7(0x19e),'marginTop':0x1,'children':[_0x34e7bb[_0x358ad7(0x1a0)]===0x0&&a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':'cyan','children':'*\x20创建新项目'})}),_0x34e7bb[_0x358ad7(0x17d)](_0x16dfe4=>a39_0x302da6(Box,{'children':[a39_0x302da6(Text,{'color':_0x358ad7(0x19f),'children':['√\x20',_0x16dfe4['label'],':\x20']}),a39_0xd0ae6a(Text,{'color':_0x358ad7(0x168),'children':_0x16dfe4[_0x358ad7(0x179)]})]},_0x16dfe4['step'])),_0x256d46===_0x358ad7(0x196)&&a39_0x302da6(a39_0x325f7f,{'children':[a39_0x302da6(Box,{'children':[a39_0xd0ae6a(Text,{'children':_0x358ad7(0x17c)}),_0x573ef2?a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19f),'children':_0x573ef2}):a39_0xd0ae6a(Text,{'color':'gray','children':_0x5a8e64}),_0x3a9ab5&&a39_0x302da6(Text,{'color':_0x358ad7(0x192),'children':[_0x358ad7(0x167),_0x3a9ab5]})]}),!_0x3a9ab5&&!_0x573ef2&&a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19b),'children':'\x20直接回车确认,或输入自定义名称'})})]}),_0x256d46===_0x358ad7(0x191)&&a39_0x302da6(a39_0x325f7f,{'children':[a39_0x302da6(Box,{'children':[a39_0xd0ae6a(Text,{'children':'*\x20应用AppCode\x20'}),a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19b),'children':_0x358ad7(0x161)}),a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19f),'children':_0x573ef2}),_0x3a9ab5&&a39_0x302da6(Text,{'color':'red','children':[_0x358ad7(0x167),_0x3a9ab5]})]}),!_0x3a9ab5&&a39_0xd0ae6a(Box,{'children':a39_0x302da6(Text,{'color':_0x358ad7(0x19b),'children':['\x20',_0x358ad7(0x162)]})})]}),_0x256d46==='login-check'&&a39_0x302da6(Box,{'children':[a39_0xd0ae6a(Text,{'children':_0x358ad7(0x198)}),_0x2125c1&&a39_0xd0ae6a(Text,{'color':'gray','children':_0x358ad7(0x199)})]}),_0x256d46===_0x358ad7(0x185)&&a39_0x302da6(a39_0x325f7f,{'children':[a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19f),'children':'√\x20检测到有效登录状态'})}),a39_0xd0ae6a(Box,{'marginTop':0x1,'children':a39_0xd0ae6a(Text,{'children':_0x358ad7(0x177)})}),a39_0x302da6(Box,{'marginLeft':0x2,'children':[a39_0x302da6(Text,{'color':_0x2c62ea===0x0?_0x358ad7(0x19f):'gray','children':[_0x2c62ea===0x0?'▶\x20':'\x20\x20','Yes']}),a39_0xd0ae6a(Text,{'children':'\x20'}),a39_0x302da6(Text,{'color':_0x2c62ea===0x1?_0x358ad7(0x19f):'gray','children':[_0x2c62ea===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19b),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':_0x358ad7(0x195),'children':_0x358ad7(0x175)})})]}),_0x256d46===_0x358ad7(0x17b)&&a39_0x302da6(a39_0x325f7f,{'children':[a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':'yellow','children':_0x358ad7(0x18e)})}),a39_0xd0ae6a(Box,{'marginTop':0x1,'children':a39_0xd0ae6a(Text,{'children':_0x358ad7(0x186)})}),a39_0x302da6(Box,{'marginLeft':0x2,'children':[a39_0x302da6(Text,{'color':_0x350dad===0x0?_0x358ad7(0x19f):_0x358ad7(0x19b),'children':[_0x350dad===0x0?'▶\x20':'\x20\x20',_0x358ad7(0x183)]}),a39_0xd0ae6a(Text,{'children':'\x20'}),a39_0x302da6(Text,{'color':_0x350dad===0x1?'green':'gray','children':[_0x350dad===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':_0x358ad7(0x19b),'children':_0x358ad7(0x18f)})}),a39_0xd0ae6a(Box,{'children':a39_0xd0ae6a(Text,{'color':_0x358ad7(0x195),'children':'\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口'})})]}),_0x256d46===_0x358ad7(0x171)&&a39_0x302da6(Box,{'children':[a39_0xd0ae6a(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x19d0fa&&a39_0xd0ae6a(Text,{'color':'gray','children':_0x358ad7(0x18a)})]})]});}function a39_0x28ce(){const _0x12b046=['app-code','red','test','login','yellow','project-name','128088avGHIi','*\x20正在检查登录状态...','\x20检查中...','跳过登录','gray','40lRoVbt','slice','column','green','length','creating','[可选]:\x20','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','login-check','391426MfwQPv','trim','env','\x20←\x20','cyan','1106588GihfOZ','登录失败','项目名','11eZajAG','10205puJQmY','1599HezTmy','68gmAwYw','项目名长度不能超过\x2050\x20个字符','login-process','leftArrow','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','项目名不合法','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','登录状态','*\x20是否要自动拉取\x20API\x20配置?','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','value','未设置','login-prompt','*\x20项目名:\x20','map','已登录','delete','string','360xaAhCF','11441210jepdCb','Yes','rightArrow','confirm-api-pull','*\x20是否要先登录以便拉取\x20API\x20配置?','return','api-pull','my-app','\x20登录中...','956574wMpSAw','includes','online','!\x20未检测到有效登录','\x20\x20使用\x20←→\x20选择,回车确认','应用AppCode不合法'];a39_0x28ce=function(){return _0x12b046;};return a39_0x28ce();}
1
+ (function(_0x472108,_0x35edbe){const _0x2db40c=a39_0x44d9,_0x4115f1=_0x472108();while(!![]){try{const _0x2f5d50=-parseInt(_0x2db40c(0xb5))/0x1*(parseInt(_0x2db40c(0xd4))/0x2)+parseInt(_0x2db40c(0x9d))/0x3+-parseInt(_0x2db40c(0xa3))/0x4*(parseInt(_0x2db40c(0xc6))/0x5)+-parseInt(_0x2db40c(0xb3))/0x6*(parseInt(_0x2db40c(0xbd))/0x7)+-parseInt(_0x2db40c(0xa2))/0x8*(-parseInt(_0x2db40c(0xca))/0x9)+parseInt(_0x2db40c(0xa4))/0xa*(-parseInt(_0x2db40c(0xac))/0xb)+-parseInt(_0x2db40c(0xaf))/0xc*(-parseInt(_0x2db40c(0xb9))/0xd);if(_0x2f5d50===_0x35edbe)break;else _0x4115f1['push'](_0x4115f1['shift']());}catch(_0x2fb62e){_0x4115f1['push'](_0x4115f1['shift']());}}}(a39_0x5c52,0x8b0e1));import{jsx as a39_0x32d6a5,jsxs as a39_0x496abd,Fragment as a39_0x240090}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';function a39_0x44d9(_0x472c9b,_0x2a22a7){_0x472c9b=_0x472c9b-0x94;const _0x5c5271=a39_0x5c52();let _0x44d93d=_0x5c5271[_0x472c9b];return _0x44d93d;}export function EnhancedGuidedCreate(_0x204e1d){const _0x1bbebd=a39_0x44d9,{onCreate:_0x5ae06b,env:_0x293e96}=_0x204e1d,[_0x5bb9ee,_0x27967c]=useState(_0x1bbebd(0xad)),[_0x3b580e,_0x31bad5]=useState(''),[_0x1ff132,_0x508c7d]=useState(''),[_0x36d0bb,_0x5213e1]=useState(''),[_0x4a521a,_0x56bce5]=useState(''),[_0x45f9ae,_0x167259]=useState([]),[_0x53e8f1,_0x21d57c]=useState(null),[_0x4843e9,_0x9fc1f2]=useState(![]),[_0x5d9e5c,_0x9b8f22]=useState(![]),[_0x5e6ee0,_0x44b827]=useState(![]),[_0x113598,_0x2af0fd]=useState(0x0),[_0x32df56,_0x62190a]=useState(0x0),_0x363360='my-app',_0x4a070b=readConfig(),_0xc43d5f=typeof _0x4a070b['env']===_0x1bbebd(0xa7)?_0x4a070b[_0x1bbebd(0xa6)]:undefined;function _0x558662(_0x17380c){const _0x2a393d=_0x1bbebd;if(_0x17380c['length']>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x4106e1=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x17380c?.['trim']()&&!_0x4106e1[_0x2a393d(0xa9)](_0x17380c))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x4baed5(_0x34e146){const _0x263687=_0x1bbebd;if(!_0x34e146['trim']())return{'valid':!![]};if(_0x34e146[_0x263687(0xab)]>0x64)return{'valid':![],'message':_0x263687(0xae)};const _0x37508f=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x37508f[_0x263687(0xa9)](_0x34e146))return{'valid':![],'message':_0x263687(0x95)};return{'valid':!![]};}async function _0x3fc4f8(){_0x9fc1f2(!![]);try{const _0x58236c=await getIsSessionValid();return _0x21d57c(_0x58236c),_0x58236c;}catch(_0x26c4c0){return _0x21d57c(![]),![];}finally{_0x9fc1f2(![]);}}async function _0x21b1b2(){_0x9b8f22(!![]);try{const _0x3c9039=await authServer({'silent':!![]});return _0x21d57c(_0x3c9039),_0x3c9039;}catch(_0x10797e){return _0x21d57c(![]),![];}finally{_0x9b8f22(![]);}}return useInput(async(_0x3988f7,_0x524e43)=>{const _0x55a815=_0x1bbebd;if(_0x524e43[_0x55a815(0xd1)]||_0x524e43[_0x55a815(0xc3)]){if(_0x5bb9ee===_0x55a815(0xcb)){_0x2af0fd(_0xd1007c=>_0xd1007c===0x0?0x1:0x0);return;}if(_0x5bb9ee===_0x55a815(0xb1)){_0x62190a(_0xf1a298=>_0xf1a298===0x0?0x1:0x0);return;}}if(_0x524e43[_0x55a815(0x96)]){if(_0x5bb9ee===_0x55a815(0xad)){const _0x4c84a4=_0x36d0bb['trim']()||_0x363360;if(_0x4a521a)return;_0x31bad5(_0x4c84a4),_0x167259([{'step':'project-name','label':'项目名','value':_0x4c84a4}]),_0x5213e1(''),_0x56bce5(''),_0x27967c('app-code');return;}if(_0x5bb9ee==='app-code'){if(_0x4a521a)return;const _0x4cf2ef=_0x36d0bb['trim']();_0x508c7d(_0x4cf2ef),_0x167259(_0x1bd9b1=>[..._0x1bd9b1,{'step':_0x55a815(0x97),'label':'应用AppCode','value':_0x4cf2ef||_0x55a815(0xa0)}]),_0x5213e1(''),_0x56bce5('');if(_0x4cf2ef){_0x27967c(_0x55a815(0xbb));const _0xd49ae0=await _0x3fc4f8();_0xd49ae0?_0x27967c(_0x55a815(0xcb)):_0x27967c(_0x55a815(0xb1));}else{const _0x391a09=_0x293e96||_0xc43d5f||'online';_0x5ae06b({'projectName':_0x3b580e,'appCode':undefined,'pullApi':![],'env':_0x391a09}),_0x27967c('creating');}return;}if(_0x5bb9ee===_0x55a815(0xcb)){const _0x59472b=_0x113598===0x0;_0x44b827(_0x59472b),_0x167259(_0x528229=>[..._0x528229,{'step':_0x55a815(0xa8),'label':_0x55a815(0xbf),'value':_0x59472b?'是':'否'}]);const _0x539a45=_0x293e96||_0xc43d5f||_0x55a815(0xc9);_0x5ae06b({'projectName':_0x3b580e,'appCode':_0x1ff132,'pullApi':_0x59472b,'env':_0x539a45}),_0x27967c(_0x55a815(0xc1));return;}if(_0x5bb9ee===_0x55a815(0xb1)){const _0x47da93=_0x32df56===0x0;if(_0x47da93){_0x27967c(_0x55a815(0xd3));const _0x4046a9=await _0x21b1b2();if(_0x4046a9)_0x167259(_0x23167b=>[..._0x23167b,{'step':_0x55a815(0x94),'label':_0x55a815(0xc5),'value':_0x55a815(0xb7)}]),_0x27967c(_0x55a815(0xcb));else{_0x167259(_0x187ac5=>[..._0x187ac5,{'step':_0x55a815(0x94),'label':_0x55a815(0xc5),'value':_0x55a815(0xc7)}]);const _0x1dbf7b=_0x293e96||_0xc43d5f||_0x55a815(0xc9);_0x5ae06b({'projectName':_0x3b580e,'appCode':_0x1ff132,'pullApi':![],'env':_0x1dbf7b}),_0x27967c('creating');}}else{_0x167259(_0x78f8da=>[..._0x78f8da,{'step':'login','label':_0x55a815(0xc5),'value':_0x55a815(0xcc)}]);const _0x290cab=_0x293e96||_0xc43d5f||_0x55a815(0xc9);_0x5ae06b({'projectName':_0x3b580e,'appCode':_0x1ff132,'pullApi':![],'env':_0x290cab}),_0x27967c(_0x55a815(0xc1));}return;}}if(_0x524e43['backspace']||_0x524e43[_0x55a815(0xd0)]){_0x5213e1(_0x1ce194=>{const _0x19d5cb=_0x55a815,_0x41015f=_0x1ce194['slice'](0x0,-0x1);if(_0x5bb9ee===_0x19d5cb(0xad)){const {valid:_0x6381ad,message:_0x50c915}=_0x558662(_0x41015f);_0x56bce5(_0x6381ad?'':_0x50c915||_0x19d5cb(0x9e));}else{if(_0x5bb9ee===_0x19d5cb(0x97)){const {valid:_0x23037b,message:_0x4537e1}=_0x4baed5(_0x41015f);_0x56bce5(_0x23037b?'':_0x4537e1||_0x19d5cb(0xbe));}}return _0x41015f;});return;}if(['creating','login-check','login-process'][_0x55a815(0x98)](_0x5bb9ee))return;if(_0x5bb9ee===_0x55a815(0xcb)||_0x5bb9ee==='login-prompt')return;_0x5213e1(_0x377225=>{const _0x5b5008=_0x55a815,_0x533bc1=_0x377225+_0x3988f7;if(_0x5bb9ee==='project-name'){const {valid:_0x3e4421,message:_0xd50da4}=_0x558662(_0x533bc1);_0x56bce5(_0x3e4421?'':_0xd50da4||_0x5b5008(0x9e));}else{if(_0x5bb9ee===_0x5b5008(0x97)){const {valid:_0x2e3faa,message:_0xb6c8c6}=_0x4baed5(_0x533bc1);_0x56bce5(_0x2e3faa?'':_0xb6c8c6||_0x5b5008(0xbe));}}return _0x533bc1;});}),a39_0x496abd(Box,{'flexDirection':_0x1bbebd(0xce),'marginTop':0x1,'children':[_0x45f9ae['length']===0x0&&a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0x9a),'children':_0x1bbebd(0xb2)})}),_0x45f9ae[_0x1bbebd(0xb6)](_0x47801b=>a39_0x496abd(Box,{'children':[a39_0x496abd(Text,{'color':'green','children':['√\x20',_0x47801b[_0x1bbebd(0xc0)],':\x20']}),a39_0x32d6a5(Text,{'color':_0x1bbebd(0x9a),'children':_0x47801b[_0x1bbebd(0xaa)]})]},_0x47801b['step'])),_0x5bb9ee==='project-name'&&a39_0x496abd(a39_0x240090,{'children':[a39_0x496abd(Box,{'children':[a39_0x32d6a5(Text,{'children':_0x1bbebd(0xb4)}),_0x36d0bb?a39_0x32d6a5(Text,{'color':'green','children':_0x36d0bb}):a39_0x32d6a5(Text,{'color':'gray','children':_0x363360}),_0x4a521a&&a39_0x496abd(Text,{'color':_0x1bbebd(0xbc),'children':[_0x1bbebd(0x9f),_0x4a521a]})]}),!_0x4a521a&&!_0x36d0bb&&a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0xa1),'children':_0x1bbebd(0xb0)})})]}),_0x5bb9ee==='app-code'&&a39_0x496abd(a39_0x240090,{'children':[a39_0x496abd(Box,{'children':[a39_0x32d6a5(Text,{'children':'*\x20应用AppCode\x20'}),a39_0x32d6a5(Text,{'color':'gray','children':'[可选]:\x20'}),a39_0x32d6a5(Text,{'color':_0x1bbebd(0xc4),'children':_0x36d0bb}),_0x4a521a&&a39_0x496abd(Text,{'color':'red','children':['\x20←\x20',_0x4a521a]})]}),!_0x4a521a&&a39_0x32d6a5(Box,{'children':a39_0x496abd(Text,{'color':_0x1bbebd(0xa1),'children':['\x20',_0x1bbebd(0xa5)]})})]}),_0x5bb9ee===_0x1bbebd(0xbb)&&a39_0x496abd(Box,{'children':[a39_0x32d6a5(Text,{'children':'*\x20正在检查登录状态...'}),_0x4843e9&&a39_0x32d6a5(Text,{'color':'gray','children':_0x1bbebd(0xcf)})]}),_0x5bb9ee===_0x1bbebd(0xcb)&&a39_0x496abd(a39_0x240090,{'children':[a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0xc4),'children':'√\x20检测到有效登录状态'})}),a39_0x32d6a5(Box,{'marginTop':0x1,'children':a39_0x32d6a5(Text,{'children':_0x1bbebd(0xd2)})}),a39_0x496abd(Box,{'marginLeft':0x2,'children':[a39_0x496abd(Text,{'color':_0x113598===0x0?'green':_0x1bbebd(0xa1),'children':[_0x113598===0x0?'▶\x20':'\x20\x20',_0x1bbebd(0xba)]}),a39_0x32d6a5(Text,{'children':'\x20'}),a39_0x496abd(Text,{'color':_0x113598===0x1?_0x1bbebd(0xc4):_0x1bbebd(0xa1),'children':[_0x113598===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0xa1),'children':_0x1bbebd(0x9b)})}),a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0x9c),'children':_0x1bbebd(0x99)})})]}),_0x5bb9ee==='login-prompt'&&a39_0x496abd(a39_0x240090,{'children':[a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0x9c),'children':_0x1bbebd(0xc8)})}),a39_0x32d6a5(Box,{'marginTop':0x1,'children':a39_0x32d6a5(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a39_0x496abd(Box,{'marginLeft':0x2,'children':[a39_0x496abd(Text,{'color':_0x32df56===0x0?_0x1bbebd(0xc4):_0x1bbebd(0xa1),'children':[_0x32df56===0x0?'▶\x20':'\x20\x20',_0x1bbebd(0xba)]}),a39_0x32d6a5(Text,{'children':'\x20'}),a39_0x496abd(Text,{'color':_0x32df56===0x1?_0x1bbebd(0xc4):_0x1bbebd(0xa1),'children':[_0x32df56===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0xa1),'children':_0x1bbebd(0x9b)})}),a39_0x32d6a5(Box,{'children':a39_0x32d6a5(Text,{'color':_0x1bbebd(0x9c),'children':_0x1bbebd(0xb8)})})]}),_0x5bb9ee==='login-process'&&a39_0x496abd(Box,{'children':[a39_0x32d6a5(Text,{'children':_0x1bbebd(0xcd)}),_0x5d9e5c&&a39_0x32d6a5(Text,{'color':'gray','children':_0x1bbebd(0xc2)})]})]});}function a39_0x5c52(){const _0x469005=['cyan','\x20\x20使用\x20←→\x20选择,回车确认','yellow','3198747QSSpox','项目名不合法','\x20←\x20','未设置','gray','1696sWWpzc','4TKmOjQ','20sbTcJX','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','env','string','api-pull','test','value','length','3855005YkeYGv','project-name','应用AppCode长度不能超过\x20100\x20个字符','305736shZuaV','\x20直接回车确认,或输入自定义名称','login-prompt','*\x20创建新项目','82074hmwbup','*\x20项目名:\x20','79873FbBGgO','map','已登录','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','403pMEDGE','Yes','login-check','red','329SxJpPr','应用AppCode不合法','拉取API配置','label','creating','\x20登录中...','rightArrow','green','登录状态','711265OririW','登录失败','!\x20未检测到有效登录','online','42381eUdlyy','confirm-api-pull','跳过登录','*\x20正在登录,请前往浏览器完成登录...','column','\x20检查中...','delete','leftArrow','*\x20是否要自动拉取\x20API\x20配置?','login-process','20IRIROk','login','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','return','app-code','includes','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'];a39_0x5c52=function(){return _0x469005;};return a39_0x5c52();}
@@ -1 +1 @@
1
- function a40_0x4780(_0x3133b0,_0x13afb1){_0x3133b0=_0x3133b0-0x184;const _0xe3fb36=a40_0xe3fb();let _0x47800c=_0xe3fb36[_0x3133b0];return _0x47800c;}function a40_0xe3fb(){const _0x35cd8c=['16070VgBkdQ','7553154RHeeiz','3529946AZRiFY','280GVwRyh','1228JOxDct','222728umEMje','13427325GcTmxj','3141453fFHzSl','now','199832YzlHmT','16FYALWd','15YBOChH'];a40_0xe3fb=function(){return _0x35cd8c;};return a40_0xe3fb();}(function(_0x5d7fe1,_0x511f66){const _0x41ba31=a40_0x4780,_0x54f035=_0x5d7fe1();while(!![]){try{const _0x603930=-parseInt(_0x41ba31(0x189))/0x1*(parseInt(_0x41ba31(0x187))/0x2)+parseInt(_0x41ba31(0x185))/0x3+parseInt(_0x41ba31(0x18e))/0x4*(-parseInt(_0x41ba31(0x18a))/0x5)+parseInt(_0x41ba31(0x18b))/0x6+-parseInt(_0x41ba31(0x18c))/0x7*(parseInt(_0x41ba31(0x188))/0x8)+parseInt(_0x41ba31(0x184))/0x9+-parseInt(_0x41ba31(0x18d))/0xa*(-parseInt(_0x41ba31(0x18f))/0xb);if(_0x603930===_0x511f66)break;else _0x54f035['push'](_0x54f035['shift']());}catch(_0x28487a){_0x54f035['push'](_0x54f035['shift']());}}}(a40_0xe3fb,0xd49e5));export function formatElapsed(_0x12dba3){const _0x3ab710=a40_0x4780,_0x524482=Date[_0x3ab710(0x186)]()-_0x12dba3;if(_0x524482<0x3e8)return _0x524482+'ms';const _0x422396=(_0x524482/0x3e8)['toFixed'](0x2),_0x588869=_0x422396['replace'](/\.?0+$/u,'');return _0x588869+'s';}
1
+ function a40_0x22e6(){const _0x570121=['417eNAvOh','574dxduiC','85088OmrBeA','1024040qsUJuq','1308vgSmPV','36eGClcv','2635FEQLSH','54PNMucf','replace','894MEsGmy','1342792WJfVSG','793793HhXqrq','now','toFixed'];a40_0x22e6=function(){return _0x570121;};return a40_0x22e6();}(function(_0x5a65f5,_0x415568){const _0x307eed=a40_0x4cc8,_0x1a6ee0=_0x5a65f5();while(!![]){try{const _0x110633=parseInt(_0x307eed(0x127))/0x1*(parseInt(_0x307eed(0x128))/0x2)+-parseInt(_0x307eed(0x120))/0x3*(parseInt(_0x307eed(0x12b))/0x4)+-parseInt(_0x307eed(0x12d))/0x5*(-parseInt(_0x307eed(0x122))/0x6)+parseInt(_0x307eed(0x124))/0x7+parseInt(_0x307eed(0x129))/0x8*(parseInt(_0x307eed(0x12c))/0x9)+-parseInt(_0x307eed(0x12a))/0xa+-parseInt(_0x307eed(0x123))/0xb;if(_0x110633===_0x415568)break;else _0x1a6ee0['push'](_0x1a6ee0['shift']());}catch(_0x132f26){_0x1a6ee0['push'](_0x1a6ee0['shift']());}}}(a40_0x22e6,0x1e387));function a40_0x4cc8(_0x588b7a,_0x2dbdd6){_0x588b7a=_0x588b7a-0x120;const _0x22e627=a40_0x22e6();let _0x4cc895=_0x22e627[_0x588b7a];return _0x4cc895;}export function formatElapsed(_0x1a0ae4){const _0x605624=a40_0x4cc8,_0x495f32=Date[_0x605624(0x125)]()-_0x1a0ae4;if(_0x495f32<0x3e8)return _0x495f32+'ms';const _0x315c1a=(_0x495f32/0x3e8)[_0x605624(0x126)](0x2),_0x4891a4=_0x315c1a[_0x605624(0x121)](/\.?0+$/u,'');return _0x4891a4+'s';}
@@ -1 +1 @@
1
- (function(_0x241f71,_0x3f6243){const _0x354cd0=a41_0xefb4,_0x59fa15=_0x241f71();while(!![]){try{const _0x2ae1cc=-parseInt(_0x354cd0(0x1d3))/0x1+-parseInt(_0x354cd0(0x217))/0x2*(parseInt(_0x354cd0(0x200))/0x3)+parseInt(_0x354cd0(0x212))/0x4+-parseInt(_0x354cd0(0x213))/0x5+parseInt(_0x354cd0(0x1d8))/0x6+-parseInt(_0x354cd0(0x219))/0x7*(parseInt(_0x354cd0(0x216))/0x8)+parseInt(_0x354cd0(0x1ee))/0x9;if(_0x2ae1cc===_0x3f6243)break;else _0x59fa15['push'](_0x59fa15['shift']());}catch(_0x350d64){_0x59fa15['push'](_0x59fa15['shift']());}}}(a41_0x490c,0xc60d3));import{jsx as a41_0x4ac8cf,Fragment as a41_0x174646,jsxs as a41_0x3d46d3}from'react/jsx-runtime';import a41_0x103edc from'node:path';import a41_0x181adc from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';function a41_0xefb4(_0x239a30,_0xe4a59c){_0x239a30=_0x239a30-0x1ce;const _0x490c24=a41_0x490c();let _0xefb4b4=_0x490c24[_0x239a30];return _0xefb4b4;}import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';function a41_0x490c(){const _0xd8a772=['1544732uMHNqr','yellow','配置AppCode:\x20','package.json','lovrabet\x20api\x20pull','API\x20配置拉取异常:\x20','white','*\x20正在为项目\x20','projectCode','2.\x20','启动项目:\x20',',\x20description=','×\x20无法在当前目录创建项目,请检查目录权限','已自动拉取\x20✓','projectName','√\x20API\x20配置拉取完成','1.\x20','appCode','dirname','toLocaleString','🎉\x20项目创建成功!','配置应用AppCode失败:\x20','527408GbBwDt','info','writeFileSync','utf8','resolve','9657090yrjzqN','*\x20正在拉取\x20API\x20配置...','column','cwd','env','description','×\x20项目目录\x20','📁\x20项目名称:\x20','\x20√\x20','更新\x20package.json\x20name\x20和\x20description\x20字段','doTask','*\x20配置文件路径:\x20','\x20Generated\x20by\x20lovrabet\x20cli\x20','*\x20清理失败的项目目录:\x20','🔗\x20应用AppCode:\x20','拉取API配置:\x20','\x20已存在,请使用其他项目名','项目名称:\x20','\x20配置应用AppCode:\x20','accessSync','parse','warn','18311067rmmglG','×\x20项目创建失败:\x20','error','readFileSync','rmSync','stringify','cyan','gray','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','\x20&&\x20lovrabet\x20start','配置应用AppCode:\x20','📦\x20API配置:\x20','\x20|\x20应用AppCode:\x20','更新\x20package.json\x20失败:\x20','√\x20package.json\x20已更新:\x20name=','×\x20项目名过长,最多支持\x20100\x20个字符','pullApi','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','1004511WadNNK','../..','green','trim','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','existsSync','项目创建失败:\x20','W_OK','message','log','API\x20配置拉取失败:\x20','name','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','未配置','repeat','join','.lovrabetrc','constants','610392khNfRv','3957550suevcT','create','cd\x20','24obOBja','6tLxLUt','1.0.0'];a41_0x490c=function(){return _0xd8a772;};return a41_0x490c();}import{logger}from'../utils/logger.js';export function CreateApp(_0x2284ea){const _0x326bb9=a41_0xefb4,[_0x119ba1,_0x38e77a]=useState(![]),[_0x594577,_0x58b307]=useState(![]),[_0x556714,_0x6bed8f]=useState(null),_0x11006d=useCopyProjectTemplate(),_0x528914=useInstallDependencies(),_0x494562=useFormatCode(),_0x27455e=async _0x231836=>{const _0x3ecaa9=a41_0xefb4;if(!_0x231836[_0x3ecaa9(0x227)]||_0x231836[_0x3ecaa9(0x227)][_0x3ecaa9(0x203)]()===''){console[_0x3ecaa9(0x1f0)]('×\x20项目名不能为空');return;}const _0x1ff816=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1ff816['test'](_0x231836[_0x3ecaa9(0x227)])){console['error'](_0x3ecaa9(0x1ff));return;}if(_0x231836['projectName']['length']>0x64){console[_0x3ecaa9(0x1f0)](_0x3ecaa9(0x1fd));return;}const _0x1b49ac=a41_0x103edc['resolve'](process[_0x3ecaa9(0x1db)](),_0x231836[_0x3ecaa9(0x227)]);if(a41_0x181adc[_0x3ecaa9(0x205)](_0x1b49ac)){console[_0x3ecaa9(0x1f0)](_0x3ecaa9(0x1de)+_0x231836[_0x3ecaa9(0x227)]+_0x3ecaa9(0x1e8));return;}try{const _0x166cb6=a41_0x103edc[_0x3ecaa9(0x1cf)](_0x1b49ac);a41_0x181adc[_0x3ecaa9(0x1eb)](_0x166cb6,a41_0x181adc[_0x3ecaa9(0x211)][_0x3ecaa9(0x207)]);}catch(_0x530e30){console[_0x3ecaa9(0x1f0)](_0x3ecaa9(0x225));return;}_0x6bed8f(_0x231836),_0x38e77a(!![]),logger['setLogPath'](_0x1b49ac),logger[_0x3ecaa9(0x1d4)]('create','开始创建项目:\x20'+_0x231836[_0x3ecaa9(0x227)],{'projectDir':_0x1b49ac,'appCode':_0x231836[_0x3ecaa9(0x1ce)]});try{await _0x11006d[_0x3ecaa9(0x1e2)](_0x231836[_0x3ecaa9(0x227)]),await _0x2bb1f4(_0x231836[_0x3ecaa9(0x227)]),await _0x528914[_0x3ecaa9(0x1e2)](_0x231836['projectName']),await _0x494562['doTask'](_0x231836[_0x3ecaa9(0x227)]),await _0x81f6a0(_0x231836[_0x3ecaa9(0x227)],_0x231836['appCode']||'',_0x231836['env']);if(_0x231836[_0x3ecaa9(0x1fe)]&&_0x231836['appCode']){console[_0x3ecaa9(0x209)](_0x3ecaa9(0x1d9));try{const _0x551f7e=await pullApiSilent(_0x231836['appCode'],undefined,_0x1b49ac,_0x231836['env']);_0x551f7e?(console[_0x3ecaa9(0x209)](_0x3ecaa9(0x228)),logger[_0x3ecaa9(0x1d4)](_0x3ecaa9(0x214),'API\x20配置拉取成功:\x20'+_0x231836[_0x3ecaa9(0x1ce)],{'projectDir':_0x1b49ac,'appCode':_0x231836[_0x3ecaa9(0x1ce)],'env':_0x231836[_0x3ecaa9(0x1dc)]})):(console['log'](_0x3ecaa9(0x204)),logger[_0x3ecaa9(0x1ed)](_0x3ecaa9(0x214),_0x3ecaa9(0x20a)+_0x231836[_0x3ecaa9(0x1ce)],{'projectDir':_0x1b49ac,'appCode':_0x231836['appCode'],'env':_0x231836['env']}));}catch(_0x55c12b){console[_0x3ecaa9(0x209)](_0x3ecaa9(0x20c)),logger[_0x3ecaa9(0x1ed)]('create',_0x3ecaa9(0x21e)+_0x231836['appCode'],{'projectDir':_0x1b49ac,'appCode':_0x231836[_0x3ecaa9(0x1ce)],'env':_0x231836[_0x3ecaa9(0x1dc)],'error':_0x55c12b instanceof Error?_0x55c12b[_0x3ecaa9(0x208)]:String(_0x55c12b)});}}logger['success']('create','项目创建完成:\x20'+_0x231836[_0x3ecaa9(0x227)]),_0x58b307(!![]),_0x38e77a(![]);}catch(_0x285235){logger['error'](_0x3ecaa9(0x214),_0x3ecaa9(0x206)+_0x231836[_0x3ecaa9(0x227)],{'error':_0x285235 instanceof Error?_0x285235[_0x3ecaa9(0x208)]:String(_0x285235)});try{a41_0x181adc[_0x3ecaa9(0x205)](_0x1b49ac)&&(console[_0x3ecaa9(0x209)](_0x3ecaa9(0x1e5)+_0x1b49ac),a41_0x181adc[_0x3ecaa9(0x1f2)](_0x1b49ac,{'recursive':!![],'force':!![]}));}catch(_0x3fa0de){logger[_0x3ecaa9(0x1ed)](_0x3ecaa9(0x214),'清理项目目录失败:\x20'+_0x1b49ac,{'error':_0x3fa0de instanceof Error?_0x3fa0de['message']:String(_0x3fa0de)});}_0x38e77a(![]),console['error'](_0x3ecaa9(0x1ef)+(_0x285235 instanceof Error?_0x285235['message']:String(_0x285235)));}},_0x2e40e9=async _0x204d2b=>{const _0x158234=a41_0xefb4;await _0x27455e({'projectName':_0x204d2b,'env':_0x2284ea[_0x158234(0x1dc)]});},_0x2bb1f4=async _0x2a294e=>{const _0x66deb5=a41_0xefb4,_0x15b5ea=a41_0x103edc[_0x66deb5(0x1d7)](process[_0x66deb5(0x1db)](),_0x2a294e),_0x50fa5b=a41_0x103edc['join'](_0x15b5ea,_0x66deb5(0x21c));try{console[_0x66deb5(0x209)]('*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段');const _0x34ccef=fileURLToPath(import.meta.url),_0x33ef35=a41_0x103edc[_0x66deb5(0x1d7)](a41_0x103edc['dirname'](_0x34ccef),_0x66deb5(0x201)),_0x58da95=a41_0x103edc[_0x66deb5(0x20f)](_0x33ef35,_0x66deb5(0x21c));let _0x3668ae='1.0.0';try{const _0x305415=JSON['parse'](a41_0x181adc[_0x66deb5(0x1f1)](_0x58da95,'utf8'));_0x3668ae=_0x305415['version']||_0x66deb5(0x218);}catch(_0x25e20f){}const _0x4f4dbe=a41_0x181adc[_0x66deb5(0x1f1)](_0x50fa5b,_0x66deb5(0x1d6)),_0x45e2ef=JSON[_0x66deb5(0x1ec)](_0x4f4dbe);_0x45e2ef[_0x66deb5(0x20b)]=_0x2a294e,_0x45e2ef[_0x66deb5(0x1dd)]=_0x2a294e+_0x66deb5(0x1e4)+_0x3668ae,a41_0x181adc['writeFileSync'](_0x50fa5b,JSON[_0x66deb5(0x1f3)](_0x45e2ef,null,0x2)+'\x0a',_0x66deb5(0x1d6)),console['log'](_0x66deb5(0x1fc)+_0x2a294e+_0x66deb5(0x224)+_0x45e2ef[_0x66deb5(0x1dd)]),logger[_0x66deb5(0x1d4)](_0x66deb5(0x214),_0x66deb5(0x1e1),{'projectName':_0x2a294e,'description':_0x45e2ef[_0x66deb5(0x1dd)],'cliVersion':_0x3668ae,'packageJsonPath':'package.json'});}catch(_0x7e3129){logger[_0x66deb5(0x1f0)]('create',_0x66deb5(0x1fb)+_0x2a294e,{'projectName':_0x2a294e,'error':_0x7e3129 instanceof Error?_0x7e3129[_0x66deb5(0x208)]:String(_0x7e3129)});throw _0x7e3129;}},_0x81f6a0=async(_0x3b3dff,_0x2d11da,_0x35e596)=>{const _0x420276=a41_0xefb4,_0x444e69=a41_0x103edc[_0x420276(0x1d7)](process['cwd'](),_0x3b3dff),_0x27e0f1=a41_0x103edc[_0x420276(0x20f)](_0x444e69,_0x420276(0x210));try{_0x2d11da?console[_0x420276(0x209)](_0x420276(0x220)+_0x3b3dff+_0x420276(0x1ea)+_0x2d11da):console[_0x420276(0x209)]('*\x20正在为项目\x20'+_0x3b3dff+'\x20创建配置文件');console[_0x420276(0x209)](_0x420276(0x1e3)+_0x27e0f1);const _0x47c08d=fileURLToPath(import.meta.url),_0x2b3cec=a41_0x103edc[_0x420276(0x1d7)](a41_0x103edc[_0x420276(0x1cf)](_0x47c08d),_0x420276(0x201)),_0x2c7112=a41_0x103edc[_0x420276(0x20f)](_0x2b3cec,'package.json');let _0x143138='1.0.0';try{const _0x264ec5=JSON[_0x420276(0x1ec)](a41_0x181adc[_0x420276(0x1f1)](_0x2c7112,_0x420276(0x1d6)));_0x143138=_0x264ec5['version']||'1.0.0';}catch(_0x2375e9){}const _0x4c76eb=readConfig(),_0x2d2203=typeof _0x4c76eb[_0x420276(0x1dc)]==='string'?_0x4c76eb['env']:undefined,{app:_0xcc599b,appcode:_0x715cc6,..._0xa6c177}=_0x4c76eb,_0x3a1819={..._0xa6c177,'appcode':_0x2d11da||'','env':_0x35e596||_0x2d2203||'online','createdAt':new Date()[_0x420276(0x1d0)](),'version':_0x143138};a41_0x181adc[_0x420276(0x1d5)](_0x27e0f1,JSON[_0x420276(0x1f3)](_0x3a1819,null,0x2),_0x420276(0x1d6)),_0x2d11da?console[_0x420276(0x209)]('√\x20配置文件已创建,应用AppCode:\x20'+_0x2d11da):console[_0x420276(0x209)](_0x420276(0x1f6)),logger[_0x420276(0x1d4)](_0x420276(0x214),_0x420276(0x1f8)+_0x2d11da,{'projectName':_0x3b3dff,'configFile':'.lovrabetrc'});}catch(_0x27931d){logger['error'](_0x420276(0x214),_0x420276(0x1d2)+_0x2d11da,{'projectName':_0x3b3dff,'error':_0x27931d instanceof Error?_0x27931d[_0x420276(0x208)]:String(_0x27931d)});}};useEffect(()=>{const _0x5473bc=a41_0xefb4;_0x2284ea['projectCode']&&_0x2e40e9(_0x2284ea[_0x5473bc(0x221)]);},[_0x2284ea[_0x326bb9(0x221)]]);if(!_0x119ba1&&!_0x594577&&!_0x2284ea[_0x326bb9(0x221)])return a41_0x4ac8cf(EnhancedGuidedCreate,{'onCreate':_0x27455e,'env':_0x2284ea[_0x326bb9(0x1dc)]});if(_0x119ba1)return a41_0x3d46d3(a41_0x174646,{'children':[a41_0x3d46d3(Box,{'marginTop':0x1,'children':[a41_0x4ac8cf(Box,{'width':'1'}),a41_0x4ac8cf(Text,{'color':'green','children':_0x326bb9(0x1e0)}),a41_0x4ac8cf(Text,{'children':_0x326bb9(0x1e9)}),a41_0x4ac8cf(Text,{'color':'green','children':_0x556714?.[_0x326bb9(0x227)]}),_0x556714?.['appCode']&&a41_0x3d46d3(a41_0x174646,{'children':[a41_0x4ac8cf(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'children':_0x556714['appCode']})]})]}),a41_0x4ac8cf(TaskRunning,{..._0x11006d}),a41_0x4ac8cf(TaskRunning,{..._0x528914}),a41_0x4ac8cf(TaskRunning,{..._0x494562})]});if(_0x594577)return a41_0x3d46d3(a41_0x174646,{'children':[a41_0x3d46d3(Box,{'marginTop':0x1,'children':[a41_0x4ac8cf(Box,{'width':'1'}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x202),'children':_0x326bb9(0x1e0)}),a41_0x4ac8cf(Text,{'children':'项目名称:\x20'}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x202),'children':_0x556714?.[_0x326bb9(0x227)]}),_0x556714?.[_0x326bb9(0x1ce)]&&a41_0x3d46d3(a41_0x174646,{'children':[a41_0x4ac8cf(Text,{'children':_0x326bb9(0x1fa)}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'children':_0x556714[_0x326bb9(0x1ce)]})]})]}),a41_0x4ac8cf(TaskFinished,{..._0x11006d}),a41_0x4ac8cf(TaskFinished,{..._0x528914}),a41_0x4ac8cf(TaskFinished,{..._0x494562}),a41_0x4ac8cf(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x4ac8cf(Text,{'color':'green','children':'─'[_0x326bb9(0x20e)](0x3c)})}),a41_0x4ac8cf(Box,{'children':a41_0x4ac8cf(Text,{'color':_0x326bb9(0x202),'bold':!![],'children':_0x326bb9(0x1d1)})}),a41_0x3d46d3(Box,{'marginTop':0x1,'flexDirection':_0x326bb9(0x1da),'children':[a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':'cyan','children':_0x326bb9(0x1df)}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x21f),'bold':!![],'children':_0x556714?.[_0x326bb9(0x227)]})]}),_0x556714?.[_0x326bb9(0x1ce)]&&a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'children':_0x326bb9(0x1e6)}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x21f),'bold':!![],'children':_0x556714[_0x326bb9(0x1ce)]})]}),a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'children':_0x326bb9(0x1f9)}),_0x556714?.['pullApi']?a41_0x4ac8cf(Text,{'color':_0x326bb9(0x202),'bold':!![],'children':_0x326bb9(0x226)}):_0x556714?.[_0x326bb9(0x1ce)]?a41_0x4ac8cf(Text,{'color':_0x326bb9(0x21a),'bold':!![],'children':'需手动拉取'}):a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f5),'bold':!![],'children':_0x326bb9(0x20d)})]})]}),a41_0x4ac8cf(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x4ac8cf(Text,{'color':'cyan','bold':!![],'children':'🚀\x20接下来可以:'})}),a41_0x3d46d3(Box,{'marginLeft':0x2,'flexDirection':_0x326bb9(0x1da),'children':[a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':_0x326bb9(0x202),'children':_0x326bb9(0x229)}),a41_0x4ac8cf(Text,{'color':'white','children':_0x326bb9(0x223)}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'bold':!![],'children':_0x326bb9(0x215)+_0x556714?.[_0x326bb9(0x227)]+_0x326bb9(0x1f7)})]}),_0x556714?.[_0x326bb9(0x1ce)]&&!_0x556714?.[_0x326bb9(0x1fe)]&&a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':_0x326bb9(0x21a),'children':_0x326bb9(0x222)}),a41_0x4ac8cf(Text,{'color':'white','children':'拉取API配置:\x20'}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'bold':!![],'children':_0x326bb9(0x21d)})]}),!_0x556714?.['appCode']&&a41_0x3d46d3(a41_0x174646,{'children':[a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f5),'children':'2.\x20'}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x21f),'children':_0x326bb9(0x21b)}),a41_0x4ac8cf(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a41_0x3d46d3(Box,{'children':[a41_0x4ac8cf(Text,{'color':'gray','children':'3.\x20'}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x21f),'children':_0x326bb9(0x1e7)}),a41_0x4ac8cf(Text,{'color':_0x326bb9(0x1f4),'bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a41_0x4ac8cf(Box,{'marginTop':0x1,'children':a41_0x4ac8cf(Text,{'color':_0x326bb9(0x202),'children':'─'[_0x326bb9(0x20e)](0x3c)})})]});return null;}
1
+ (function(_0x4c0ece,_0x183c31){const _0x184791=a41_0x2369,_0x235071=_0x4c0ece();while(!![]){try{const _0x3a8583=parseInt(_0x184791(0x1e8))/0x1*(-parseInt(_0x184791(0x1de))/0x2)+parseInt(_0x184791(0x209))/0x3*(parseInt(_0x184791(0x1f6))/0x4)+-parseInt(_0x184791(0x1c1))/0x5+-parseInt(_0x184791(0x1e3))/0x6+-parseInt(_0x184791(0x1f2))/0x7+parseInt(_0x184791(0x211))/0x8*(-parseInt(_0x184791(0x1c9))/0x9)+parseInt(_0x184791(0x202))/0xa;if(_0x3a8583===_0x183c31)break;else _0x235071['push'](_0x235071['shift']());}catch(_0x3578cf){_0x235071['push'](_0x235071['shift']());}}}(a41_0x1785,0x7320b));import{jsx as a41_0x1646a5,Fragment as a41_0x594702,jsxs as a41_0x3c97c0}from'react/jsx-runtime';import a41_0x1cd9d2 from'node:path';import a41_0x22c07f from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';function a41_0x1785(){const _0xd5b08e=['version','toLocaleString','success','error','lovrabet\x20config\x20set\x20appcode\x20[app-code]','trim','accessSync','×\x20项目目录\x20','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','gray','*\x20正在拉取\x20API\x20配置...','×\x20无法在当前目录创建项目,请检查目录权限','.lovrabetrc','existsSync','W_OK','2991630AQdEex','info','\x20已存在,请使用其他项目名','parse','dirname','1.0.0','项目创建完成:\x20','name','180nEGznm','拉取API配置:\x20','rmSync','env','√\x20API\x20配置拉取完成','配置应用AppCode失败:\x20','2.\x20','🎉\x20项目创建成功!','3.\x20','utf8','1.\x20','description','cd\x20','开始创建项目:\x20','white','API\x20配置拉取成功:\x20','\x20&&\x20lovrabet\x20start','writeFileSync','string','\x20|\x20应用AppCode:\x20','resolve','26wKEEkf',',\x20description=','pullApi','appCode','配置AppCode:\x20','4453296BHyotW','create','未配置','已自动拉取\x20✓','readFileSync','27281kSGRtJ','join','repeat','*\x20清理失败的项目目录:\x20','\x20创建配置文件','lovrabet\x20api\x20pull','更新\x20package.json\x20失败:\x20','message','warn','\x20Generated\x20by\x20lovrabet\x20cli\x20','4808258zcflrZ','doTask','stringify','projectName','2228wufyao','cyan','×\x20项目名不能为空','API\x20配置拉取失败:\x20','\x20配置应用AppCode:\x20','../..','projectCode','*\x20配置文件路径:\x20','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','√\x20package.json\x20已更新:\x20name=','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','\x20√\x20','22007670cAxeNt','cwd','column','green','×\x20项目名过长,最多支持\x20100\x20个字符','online','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','3555GbgYkL','yellow','constants','🔗\x20应用AppCode:\x20','log','清理项目目录失败:\x20','项目名称:\x20','API\x20配置拉取异常:\x20','2864JwGRml','length','*\x20正在为项目\x20','package.json'];a41_0x1785=function(){return _0xd5b08e;};return a41_0x1785();}import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';function a41_0x2369(_0x374b99,_0x4e4b7d){_0x374b99=_0x374b99-0x1b9;const _0x17850e=a41_0x1785();let _0x236969=_0x17850e[_0x374b99];return _0x236969;}import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x263e32){const _0x15c5d2=a41_0x2369,[_0x5d0635,_0x2e8ca5]=useState(![]),[_0xe75f4f,_0xddb28c]=useState(![]),[_0x4ddf89,_0x3aeb4a]=useState(null),_0x3e0fd0=useCopyProjectTemplate(),_0xdd00bf=useInstallDependencies(),_0x92a824=useFormatCode(),_0x58aabd=async _0x425222=>{const _0x21095f=a41_0x2369;if(!_0x425222[_0x21095f(0x1f5)]||_0x425222[_0x21095f(0x1f5)][_0x21095f(0x21a)]()===''){console[_0x21095f(0x218)](_0x21095f(0x1f8));return;}const _0x460a07=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x460a07['test'](_0x425222['projectName'])){console[_0x21095f(0x218)](_0x21095f(0x208));return;}if(_0x425222[_0x21095f(0x1f5)][_0x21095f(0x212)]>0x64){console[_0x21095f(0x218)](_0x21095f(0x206));return;}const _0x151dda=a41_0x1cd9d2[_0x21095f(0x1dd)](process[_0x21095f(0x203)](),_0x425222[_0x21095f(0x1f5)]);if(a41_0x22c07f[_0x21095f(0x1bf)](_0x151dda)){console[_0x21095f(0x218)](_0x21095f(0x1b9)+_0x425222['projectName']+_0x21095f(0x1c3));return;}try{const _0x1bf69c=a41_0x1cd9d2[_0x21095f(0x1c5)](_0x151dda);a41_0x22c07f[_0x21095f(0x21b)](_0x1bf69c,a41_0x22c07f[_0x21095f(0x20b)][_0x21095f(0x1c0)]);}catch(_0x29aeb2){console[_0x21095f(0x218)](_0x21095f(0x1bd));return;}_0x3aeb4a(_0x425222),_0x2e8ca5(!![]),logger['setLogPath'](_0x151dda),logger[_0x21095f(0x1c2)](_0x21095f(0x1e4),_0x21095f(0x1d6)+_0x425222[_0x21095f(0x1f5)],{'projectDir':_0x151dda,'appCode':_0x425222[_0x21095f(0x1e1)]});try{await _0x3e0fd0[_0x21095f(0x1f3)](_0x425222[_0x21095f(0x1f5)]),await _0x193aa5(_0x425222['projectName']),await _0xdd00bf[_0x21095f(0x1f3)](_0x425222['projectName']),await _0x92a824['doTask'](_0x425222['projectName']),await _0x5003d8(_0x425222[_0x21095f(0x1f5)],_0x425222['appCode']||'',_0x425222[_0x21095f(0x1cc)]);if(_0x425222[_0x21095f(0x1e0)]&&_0x425222[_0x21095f(0x1e1)]){console[_0x21095f(0x20d)](_0x21095f(0x1bc));try{const _0x36acdc=await pullApiSilent(_0x425222[_0x21095f(0x1e1)],undefined,_0x151dda,_0x425222[_0x21095f(0x1cc)]);_0x36acdc?(console[_0x21095f(0x20d)](_0x21095f(0x1cd)),logger[_0x21095f(0x1c2)](_0x21095f(0x1e4),_0x21095f(0x1d8)+_0x425222['appCode'],{'projectDir':_0x151dda,'appCode':_0x425222[_0x21095f(0x1e1)],'env':_0x425222[_0x21095f(0x1cc)]})):(console[_0x21095f(0x20d)](_0x21095f(0x1fe)),logger[_0x21095f(0x1f0)](_0x21095f(0x1e4),_0x21095f(0x1f9)+_0x425222[_0x21095f(0x1e1)],{'projectDir':_0x151dda,'appCode':_0x425222[_0x21095f(0x1e1)],'env':_0x425222[_0x21095f(0x1cc)]}));}catch(_0x44b8e2){console[_0x21095f(0x20d)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger['warn'](_0x21095f(0x1e4),_0x21095f(0x210)+_0x425222[_0x21095f(0x1e1)],{'projectDir':_0x151dda,'appCode':_0x425222['appCode'],'env':_0x425222['env'],'error':_0x44b8e2 instanceof Error?_0x44b8e2[_0x21095f(0x1ef)]:String(_0x44b8e2)});}}logger[_0x21095f(0x217)](_0x21095f(0x1e4),_0x21095f(0x1c7)+_0x425222['projectName']),_0xddb28c(!![]),_0x2e8ca5(![]);}catch(_0x4a21d5){logger['error']('create','项目创建失败:\x20'+_0x425222[_0x21095f(0x1f5)],{'error':_0x4a21d5 instanceof Error?_0x4a21d5[_0x21095f(0x1ef)]:String(_0x4a21d5)});try{a41_0x22c07f[_0x21095f(0x1bf)](_0x151dda)&&(console[_0x21095f(0x20d)](_0x21095f(0x1eb)+_0x151dda),a41_0x22c07f[_0x21095f(0x1cb)](_0x151dda,{'recursive':!![],'force':!![]}));}catch(_0x17ceac){logger[_0x21095f(0x1f0)](_0x21095f(0x1e4),_0x21095f(0x20e)+_0x151dda,{'error':_0x17ceac instanceof Error?_0x17ceac[_0x21095f(0x1ef)]:String(_0x17ceac)});}_0x2e8ca5(![]),console['error']('×\x20项目创建失败:\x20'+(_0x4a21d5 instanceof Error?_0x4a21d5[_0x21095f(0x1ef)]:String(_0x4a21d5)));}},_0x390123=async _0x20fbf9=>{const _0x71d8ae=a41_0x2369;await _0x58aabd({'projectName':_0x20fbf9,'env':_0x263e32[_0x71d8ae(0x1cc)]});},_0x193aa5=async _0x4dfb96=>{const _0x78a318=a41_0x2369,_0x41db76=a41_0x1cd9d2[_0x78a318(0x1dd)](process[_0x78a318(0x203)](),_0x4dfb96),_0x5ea98e=a41_0x1cd9d2[_0x78a318(0x1e9)](_0x41db76,_0x78a318(0x214));try{console[_0x78a318(0x20d)](_0x78a318(0x200));const _0x17dec4=fileURLToPath(import.meta.url),_0x3eac31=a41_0x1cd9d2['resolve'](a41_0x1cd9d2['dirname'](_0x17dec4),_0x78a318(0x1fb)),_0x53beca=a41_0x1cd9d2[_0x78a318(0x1e9)](_0x3eac31,_0x78a318(0x214));let _0x3acfe0='1.0.0';try{const _0xfc0546=JSON[_0x78a318(0x1c4)](a41_0x22c07f[_0x78a318(0x1e7)](_0x53beca,'utf8'));_0x3acfe0=_0xfc0546[_0x78a318(0x215)]||_0x78a318(0x1c6);}catch(_0x4ed2b3){}const _0x5a6df9=a41_0x22c07f[_0x78a318(0x1e7)](_0x5ea98e,_0x78a318(0x1d2)),_0x2c64e1=JSON[_0x78a318(0x1c4)](_0x5a6df9);_0x2c64e1[_0x78a318(0x1c8)]=_0x4dfb96,_0x2c64e1[_0x78a318(0x1d4)]=_0x4dfb96+_0x78a318(0x1f1)+_0x3acfe0,a41_0x22c07f[_0x78a318(0x1da)](_0x5ea98e,JSON[_0x78a318(0x1f4)](_0x2c64e1,null,0x2)+'\x0a','utf8'),console[_0x78a318(0x20d)](_0x78a318(0x1ff)+_0x4dfb96+_0x78a318(0x1df)+_0x2c64e1[_0x78a318(0x1d4)]),logger[_0x78a318(0x1c2)](_0x78a318(0x1e4),'更新\x20package.json\x20name\x20和\x20description\x20字段',{'projectName':_0x4dfb96,'description':_0x2c64e1['description'],'cliVersion':_0x3acfe0,'packageJsonPath':_0x78a318(0x214)});}catch(_0x2f3f4a){logger[_0x78a318(0x218)]('create',_0x78a318(0x1ee)+_0x4dfb96,{'projectName':_0x4dfb96,'error':_0x2f3f4a instanceof Error?_0x2f3f4a[_0x78a318(0x1ef)]:String(_0x2f3f4a)});throw _0x2f3f4a;}},_0x5003d8=async(_0x39209c,_0xd63ef5,_0x89f1b0)=>{const _0x319902=a41_0x2369,_0x5612f2=a41_0x1cd9d2['resolve'](process[_0x319902(0x203)](),_0x39209c),_0xf9b607=a41_0x1cd9d2[_0x319902(0x1e9)](_0x5612f2,_0x319902(0x1be));try{_0xd63ef5?console[_0x319902(0x20d)](_0x319902(0x213)+_0x39209c+_0x319902(0x1fa)+_0xd63ef5):console['log'](_0x319902(0x213)+_0x39209c+_0x319902(0x1ec));console['log'](_0x319902(0x1fd)+_0xf9b607);const _0x588850=fileURLToPath(import.meta.url),_0x3d159b=a41_0x1cd9d2[_0x319902(0x1dd)](a41_0x1cd9d2[_0x319902(0x1c5)](_0x588850),_0x319902(0x1fb)),_0xeefeaf=a41_0x1cd9d2['join'](_0x3d159b,_0x319902(0x214));let _0xab71b2='1.0.0';try{const _0xa1df68=JSON[_0x319902(0x1c4)](a41_0x22c07f[_0x319902(0x1e7)](_0xeefeaf,_0x319902(0x1d2)));_0xab71b2=_0xa1df68['version']||'1.0.0';}catch(_0x153553){}const _0x58c374=readConfig(),_0x1f2c56=typeof _0x58c374[_0x319902(0x1cc)]===_0x319902(0x1db)?_0x58c374[_0x319902(0x1cc)]:undefined,{app:_0x804845,appcode:_0x489c6a,..._0x140708}=_0x58c374,_0x538569={..._0x140708,'appcode':_0xd63ef5||'','env':_0x89f1b0||_0x1f2c56||_0x319902(0x207),'createdAt':new Date()[_0x319902(0x216)](),'version':_0xab71b2};a41_0x22c07f['writeFileSync'](_0xf9b607,JSON['stringify'](_0x538569,null,0x2),_0x319902(0x1d2)),_0xd63ef5?console[_0x319902(0x20d)]('√\x20配置文件已创建,应用AppCode:\x20'+_0xd63ef5):console[_0x319902(0x20d)]('√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置'),logger[_0x319902(0x1c2)](_0x319902(0x1e4),'配置应用AppCode:\x20'+_0xd63ef5,{'projectName':_0x39209c,'configFile':_0x319902(0x1be)});}catch(_0x2f4d26){logger[_0x319902(0x218)]('create',_0x319902(0x1ce)+_0xd63ef5,{'projectName':_0x39209c,'error':_0x2f4d26 instanceof Error?_0x2f4d26[_0x319902(0x1ef)]:String(_0x2f4d26)});}};useEffect(()=>{const _0x19d0cc=a41_0x2369;_0x263e32[_0x19d0cc(0x1fc)]&&_0x390123(_0x263e32[_0x19d0cc(0x1fc)]);},[_0x263e32['projectCode']]);if(!_0x5d0635&&!_0xe75f4f&&!_0x263e32[_0x15c5d2(0x1fc)])return a41_0x1646a5(EnhancedGuidedCreate,{'onCreate':_0x58aabd,'env':_0x263e32[_0x15c5d2(0x1cc)]});if(_0x5d0635)return a41_0x3c97c0(a41_0x594702,{'children':[a41_0x3c97c0(Box,{'marginTop':0x1,'children':[a41_0x1646a5(Box,{'width':'1'}),a41_0x1646a5(Text,{'color':'green','children':'\x20√\x20'}),a41_0x1646a5(Text,{'children':_0x15c5d2(0x20f)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'children':_0x4ddf89?.[_0x15c5d2(0x1f5)]}),_0x4ddf89?.[_0x15c5d2(0x1e1)]&&a41_0x3c97c0(a41_0x594702,{'children':[a41_0x1646a5(Text,{'children':_0x15c5d2(0x1dc)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'children':_0x4ddf89[_0x15c5d2(0x1e1)]})]})]}),a41_0x1646a5(TaskRunning,{..._0x3e0fd0}),a41_0x1646a5(TaskRunning,{..._0xdd00bf}),a41_0x1646a5(TaskRunning,{..._0x92a824})]});if(_0xe75f4f)return a41_0x3c97c0(a41_0x594702,{'children':[a41_0x3c97c0(Box,{'marginTop':0x1,'children':[a41_0x1646a5(Box,{'width':'1'}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'children':_0x15c5d2(0x201)}),a41_0x1646a5(Text,{'children':_0x15c5d2(0x20f)}),a41_0x1646a5(Text,{'color':'green','children':_0x4ddf89?.[_0x15c5d2(0x1f5)]}),_0x4ddf89?.['appCode']&&a41_0x3c97c0(a41_0x594702,{'children':[a41_0x1646a5(Text,{'children':_0x15c5d2(0x1dc)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'children':_0x4ddf89[_0x15c5d2(0x1e1)]})]})]}),a41_0x1646a5(TaskFinished,{..._0x3e0fd0}),a41_0x1646a5(TaskFinished,{..._0xdd00bf}),a41_0x1646a5(TaskFinished,{..._0x92a824}),a41_0x1646a5(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'children':'─'[_0x15c5d2(0x1ea)](0x3c)})}),a41_0x1646a5(Box,{'children':a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'bold':!![],'children':_0x15c5d2(0x1d0)})}),a41_0x3c97c0(Box,{'marginTop':0x1,'flexDirection':_0x15c5d2(0x204),'children':[a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'children':'📁\x20项目名称:\x20'}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1d7),'bold':!![],'children':_0x4ddf89?.[_0x15c5d2(0x1f5)]})]}),_0x4ddf89?.['appCode']&&a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':'cyan','children':_0x15c5d2(0x20c)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1d7),'bold':!![],'children':_0x4ddf89[_0x15c5d2(0x1e1)]})]}),a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'children':'📦\x20API配置:\x20'}),_0x4ddf89?.[_0x15c5d2(0x1e0)]?a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'bold':!![],'children':_0x15c5d2(0x1e6)}):_0x4ddf89?.[_0x15c5d2(0x1e1)]?a41_0x1646a5(Text,{'color':_0x15c5d2(0x20a),'bold':!![],'children':'需手动拉取'}):a41_0x1646a5(Text,{'color':'gray','bold':!![],'children':_0x15c5d2(0x1e5)})]})]}),a41_0x1646a5(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'bold':!![],'children':'🚀\x20接下来可以:'})}),a41_0x3c97c0(Box,{'marginLeft':0x2,'flexDirection':_0x15c5d2(0x204),'children':[a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'children':_0x15c5d2(0x1d3)}),a41_0x1646a5(Text,{'color':'white','children':'启动项目:\x20'}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'bold':!![],'children':_0x15c5d2(0x1d5)+_0x4ddf89?.[_0x15c5d2(0x1f5)]+_0x15c5d2(0x1d9)})]}),_0x4ddf89?.['appCode']&&!_0x4ddf89?.['pullApi']&&a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':_0x15c5d2(0x20a),'children':_0x15c5d2(0x1cf)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1d7),'children':_0x15c5d2(0x1ca)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'bold':!![],'children':_0x15c5d2(0x1ed)})]}),!_0x4ddf89?.['appCode']&&a41_0x3c97c0(a41_0x594702,{'children':[a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':_0x15c5d2(0x1bb),'children':_0x15c5d2(0x1cf)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1d7),'children':_0x15c5d2(0x1e2)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1f7),'bold':!![],'children':_0x15c5d2(0x219)})]}),a41_0x3c97c0(Box,{'children':[a41_0x1646a5(Text,{'color':_0x15c5d2(0x1bb),'children':_0x15c5d2(0x1d1)}),a41_0x1646a5(Text,{'color':_0x15c5d2(0x1d7),'children':_0x15c5d2(0x1ca)}),a41_0x1646a5(Text,{'color':'cyan','bold':!![],'children':_0x15c5d2(0x1ba)})]})]})]}),a41_0x1646a5(Box,{'marginTop':0x1,'children':a41_0x1646a5(Text,{'color':_0x15c5d2(0x205),'children':'─'[_0x15c5d2(0x1ea)](0x3c)})})]});return null;}
@@ -1 +1 @@
1
- (function(_0x1adc20,_0x47ae29){var _0x155e3e=a42_0x38ab,_0x51f0c1=_0x1adc20();while(!![]){try{var _0x3bedd4=-parseInt(_0x155e3e(0xce))/0x1+parseInt(_0x155e3e(0xd0))/0x2*(-parseInt(_0x155e3e(0xcf))/0x3)+parseInt(_0x155e3e(0xd6))/0x4+-parseInt(_0x155e3e(0xc9))/0x5*(-parseInt(_0x155e3e(0xd4))/0x6)+-parseInt(_0x155e3e(0xcc))/0x7*(parseInt(_0x155e3e(0xd5))/0x8)+parseInt(_0x155e3e(0xcb))/0x9+parseInt(_0x155e3e(0xd3))/0xa*(parseInt(_0x155e3e(0xd1))/0xb);if(_0x3bedd4===_0x47ae29)break;else _0x51f0c1['push'](_0x51f0c1['shift']());}catch(_0x250ad4){_0x51f0c1['push'](_0x51f0c1['shift']());}}}(a42_0x69b3,0x28f35));import{jsx as a42_0x27c136,jsxs as a42_0x555e25}from'react/jsx-runtime';function a42_0x38ab(_0x29fcf2,_0x292b02){_0x29fcf2=_0x29fcf2-0xc9;var _0x69b37f=a42_0x69b3();var _0x38ab18=_0x69b37f[_0x29fcf2];return _0x38ab18;}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';function a42_0x69b3(){var _0x30244c=['572891DRTRAx','\x20√\x20','10fLkgTC','444768DylvtV','40yKHOBo','650548cnrAjl','10soqMbI','elapsed','2011212EsPvDL','435442vwXSPg','taskName','85672tmfkmG','177RoaufH','746wAAJot'];a42_0x69b3=function(){return _0x30244c;};return a42_0x69b3();}export function TaskFinished(_0x4c83b8){var _0x5261be=a42_0x38ab;return a42_0x555e25(Box,{'children':[a42_0x27c136(Box,{'width':'1'}),a42_0x27c136(Text,{'color':'green','children':_0x5261be(0xd2)}),a42_0x27c136(Text,{'children':_0x4c83b8[_0x5261be(0xcd)]}),a42_0x27c136(TaskTime,{'elapsed':_0x4c83b8[_0x5261be(0xca)]})]});}
1
+ (function(_0x26c5e4,_0x94d591){var _0x294732=a42_0x4bd5,_0x32a236=_0x26c5e4();while(!![]){try{var _0x461971=parseInt(_0x294732(0x1e8))/0x1*(-parseInt(_0x294732(0x1f2))/0x2)+parseInt(_0x294732(0x1ec))/0x3+-parseInt(_0x294732(0x1ed))/0x4*(-parseInt(_0x294732(0x1ee))/0x5)+-parseInt(_0x294732(0x1ea))/0x6*(parseInt(_0x294732(0x1eb))/0x7)+-parseInt(_0x294732(0x1e7))/0x8*(-parseInt(_0x294732(0x1f1))/0x9)+-parseInt(_0x294732(0x1f0))/0xa*(parseInt(_0x294732(0x1e5))/0xb)+parseInt(_0x294732(0x1ef))/0xc*(-parseInt(_0x294732(0x1e9))/0xd);if(_0x461971===_0x94d591)break;else _0x32a236['push'](_0x32a236['shift']());}catch(_0x11b161){_0x32a236['push'](_0x32a236['shift']());}}}(a42_0x3091,0xc12d7));import{jsx as a42_0xc9dd8d,jsxs as a42_0x23dafb}from'react/jsx-runtime';function a42_0x4bd5(_0x3d71a6,_0x4e1311){_0x3d71a6=_0x3d71a6-0x1e5;var _0x309162=a42_0x3091();var _0x4bd58b=_0x309162[_0x3d71a6];return _0x4bd58b;}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x3252cb){var _0xc477b9=a42_0x4bd5;return a42_0x23dafb(Box,{'children':[a42_0xc9dd8d(Box,{'width':'1'}),a42_0xc9dd8d(Text,{'color':'green','children':'\x20√\x20'}),a42_0xc9dd8d(Text,{'children':_0x3252cb['taskName']}),a42_0xc9dd8d(TaskTime,{'elapsed':_0x3252cb[_0xc477b9(0x1e6)]})]});}function a42_0x3091(){var _0x3f74e4=['6874280azfLfG','12qIuYuk','90140PeIHFo','126wlWQAu','25478sIzRJA','66bGxHdi','elapsed','524416InreOb','43MprsrS','5721885yvPXcH','2072502onEMqp','21iBnbUf','1730784hStgWh','4RLChAi'];a42_0x3091=function(){return _0x3f74e4;};return a42_0x3091();}
@@ -1 +1 @@
1
- (function(_0x57db1e,_0x5d3b1f){var _0x38a0f4=a43_0x2726,_0x3a396a=_0x57db1e();while(!![]){try{var _0x4fc563=-parseInt(_0x38a0f4(0x1ae))/0x1*(parseInt(_0x38a0f4(0x1a5))/0x2)+parseInt(_0x38a0f4(0x1aa))/0x3+-parseInt(_0x38a0f4(0x1a9))/0x4*(parseInt(_0x38a0f4(0x1a4))/0x5)+parseInt(_0x38a0f4(0x1a2))/0x6+parseInt(_0x38a0f4(0x1ac))/0x7+-parseInt(_0x38a0f4(0x1ad))/0x8+-parseInt(_0x38a0f4(0x1a0))/0x9*(parseInt(_0x38a0f4(0x1ab))/0xa);if(_0x4fc563===_0x5d3b1f)break;else _0x3a396a['push'](_0x3a396a['shift']());}catch(_0x224c15){_0x3a396a['push'](_0x3a396a['shift']());}}}(a43_0x215f,0x82771));import{jsx as a43_0x11ea1a,jsxs as a43_0x110940}from'react/jsx-runtime';function a43_0x2726(_0x333117,_0x41d0e8){_0x333117=_0x333117-0x1a0;var _0x215fff=a43_0x215f();var _0x27266d=_0x215fff[_0x333117];return _0x27266d;}import{Text}from'ink';import a43_0x2afa1f from'ink-spinner';export function TaskLoading(_0x5eda31){var _0x130951=a43_0x2726;if(_0x5eda31[_0x130951(0x1a6)])return a43_0x11ea1a(Text,{'color':_0x130951(0x1a7),'children':'\x20√\x20'});if(_0x5eda31[_0x130951(0x1a1)])return a43_0x110940(Text,{'color':'green','children':['\x20',a43_0x11ea1a(a43_0x2afa1f,{'type':_0x130951(0x1a8)}),'\x20']});return a43_0x11ea1a(Text,{'children':_0x130951(0x1a3)});}function a43_0x215f(){var _0x436dc6=['5312832mIJEJQ','\x20\x20\x20','75565tzfgAO','350GByhle','finished','green','dots','148XOKIKr','1502418quPBpu','137570KpBnDR','3107566ZFqefV','1305152WFtSFj','683SoRNyy','297ZaeHBJ','loading'];a43_0x215f=function(){return _0x436dc6;};return a43_0x215f();}
1
+ function a43_0x46bc(_0x36164f,_0x4cd049){_0x36164f=_0x36164f-0xea;var _0x311ff8=a43_0x311f();var _0x46bcb4=_0x311ff8[_0x36164f];return _0x46bcb4;}(function(_0xb3de1e,_0x459b45){var _0x4e425c=a43_0x46bc,_0x5b79a4=_0xb3de1e();while(!![]){try{var _0x2796b7=parseInt(_0x4e425c(0xf6))/0x1+-parseInt(_0x4e425c(0xea))/0x2+-parseInt(_0x4e425c(0xf7))/0x3*(parseInt(_0x4e425c(0xec))/0x4)+parseInt(_0x4e425c(0xf3))/0x5+-parseInt(_0x4e425c(0xed))/0x6*(-parseInt(_0x4e425c(0xf8))/0x7)+-parseInt(_0x4e425c(0xf5))/0x8*(parseInt(_0x4e425c(0xef))/0x9)+-parseInt(_0x4e425c(0xf2))/0xa*(parseInt(_0x4e425c(0xf1))/0xb);if(_0x2796b7===_0x459b45)break;else _0x5b79a4['push'](_0x5b79a4['shift']());}catch(_0x52b861){_0x5b79a4['push'](_0x5b79a4['shift']());}}}(a43_0x311f,0x2a698));import{jsx as a43_0x3d1c08,jsxs as a43_0x3a9fb5}from'react/jsx-runtime';import{Text}from'ink';function a43_0x311f(){var _0x30af4d=['1229688xHNwEK','323938hUcMPX','2073uEfUMu','91hQqGxO','98368woAYKP','\x20√\x20','600RtxrcX','143562GEECpN','finished','9XgSPfW','green','99kHFHAh','501710alrChu','1484075KokVMA','\x20\x20\x20'];a43_0x311f=function(){return _0x30af4d;};return a43_0x311f();}import a43_0x23707a from'ink-spinner';export function TaskLoading(_0x51f613){var _0x14f4bd=a43_0x46bc;if(_0x51f613[_0x14f4bd(0xee)])return a43_0x3d1c08(Text,{'color':_0x14f4bd(0xf0),'children':_0x14f4bd(0xeb)});if(_0x51f613['loading'])return a43_0x3a9fb5(Text,{'color':_0x14f4bd(0xf0),'children':['\x20',a43_0x3d1c08(a43_0x23707a,{'type':'dots'}),'\x20']});return a43_0x3d1c08(Text,{'children':_0x14f4bd(0xf4)});}
@@ -1 +1 @@
1
- (function(_0x27ccfb,_0x590bc8){var _0x24db06=a44_0x130a,_0x190f3a=_0x27ccfb();while(!![]){try{var _0x2cf208=-parseInt(_0x24db06(0x1e3))/0x1+parseInt(_0x24db06(0x1ec))/0x2*(-parseInt(_0x24db06(0x1e2))/0x3)+-parseInt(_0x24db06(0x1eb))/0x4*(parseInt(_0x24db06(0x1e5))/0x5)+-parseInt(_0x24db06(0x1e8))/0x6*(parseInt(_0x24db06(0x1e6))/0x7)+-parseInt(_0x24db06(0x1e4))/0x8*(parseInt(_0x24db06(0x1ed))/0x9)+-parseInt(_0x24db06(0x1ea))/0xa+parseInt(_0x24db06(0x1e7))/0xb*(parseInt(_0x24db06(0x1e1))/0xc);if(_0x2cf208===_0x590bc8)break;else _0x190f3a['push'](_0x190f3a['shift']());}catch(_0x2c94d6){_0x190f3a['push'](_0x190f3a['shift']());}}}(a44_0x13d2,0x66f1b));function a44_0x130a(_0x3ac8d7,_0x1060ab){_0x3ac8d7=_0x3ac8d7-0x1e1;var _0x13d2f9=a44_0x13d2();var _0x130acb=_0x13d2f9[_0x3ac8d7];return _0x130acb;}import{jsx as a44_0x267739,jsxs as a44_0x1ecfa1}from'react/jsx-runtime';import{Box,Text}from'ink';function a44_0x13d2(){var _0x381fcd=['1144CzuznX','5iuXjZw','511tdAkxZ','10233751haEzWP','34962EepoKV','elapsed','5421690rudwXi','898604RuGlIx','41082rBSNlq','48753EpiERS','36SXSqZU','18AgFuTg','279296fqeYoe'];a44_0x13d2=function(){return _0x381fcd;};return a44_0x13d2();}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x13a3e2){var _0x155cdb=a44_0x130a;return a44_0x1ecfa1(Box,{'children':[a44_0x267739(Box,{'width':'1'}),a44_0x267739(TaskLoading,{..._0x13a3e2}),a44_0x267739(Text,{'children':_0x13a3e2['taskName']}),a44_0x267739(TaskTime,{'elapsed':_0x13a3e2[_0x155cdb(0x1e9)]})]});}
1
+ function a44_0x3907(_0x2397e5,_0x3e6706){_0x2397e5=_0x2397e5-0x153;var _0x3db328=a44_0x3db3();var _0x390794=_0x3db328[_0x2397e5];return _0x390794;}(function(_0x30aaee,_0x569ffa){var _0x44c005=a44_0x3907,_0x45ee69=_0x30aaee();while(!![]){try{var _0xa48fc8=parseInt(_0x44c005(0x157))/0x1+parseInt(_0x44c005(0x15a))/0x2+-parseInt(_0x44c005(0x158))/0x3+-parseInt(_0x44c005(0x153))/0x4+-parseInt(_0x44c005(0x156))/0x5+parseInt(_0x44c005(0x154))/0x6*(parseInt(_0x44c005(0x155))/0x7)+parseInt(_0x44c005(0x15b))/0x8;if(_0xa48fc8===_0x569ffa)break;else _0x45ee69['push'](_0x45ee69['shift']());}catch(_0x458af0){_0x45ee69['push'](_0x45ee69['shift']());}}}(a44_0x3db3,0x85fd5));import{jsx as a44_0x455ebd,jsxs as a44_0x5ab15e}from'react/jsx-runtime';import{Box,Text}from'ink';function a44_0x3db3(){var _0x42b118=['5238985glBdTs','362724DuoROJ','1956420PdDlnR','taskName','784834EMEyMI','14510768WHcbZu','3311236lSiBJi','30RUWiAU','710612LfIwsE'];a44_0x3db3=function(){return _0x42b118;};return a44_0x3db3();}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x241cc1){var _0xb865ea=a44_0x3907;return a44_0x5ab15e(Box,{'children':[a44_0x455ebd(Box,{'width':'1'}),a44_0x455ebd(TaskLoading,{..._0x241cc1}),a44_0x455ebd(Text,{'children':_0x241cc1[_0xb865ea(0x159)]}),a44_0x455ebd(TaskTime,{'elapsed':_0x241cc1['elapsed']})]});}
@@ -1 +1 @@
1
- function a45_0xc004(_0x3432ff,_0x37c7fd){_0x3432ff=_0x3432ff-0x92;var _0x28ba59=a45_0x28ba();var _0xc0042f=_0x28ba59[_0x3432ff];return _0xc0042f;}(function(_0x47992e,_0x387b98){var _0x57cba4=a45_0xc004,_0x3cb408=_0x47992e();while(!![]){try{var _0x3d6eea=-parseInt(_0x57cba4(0x9b))/0x1*(parseInt(_0x57cba4(0x99))/0x2)+-parseInt(_0x57cba4(0x98))/0x3*(parseInt(_0x57cba4(0x9d))/0x4)+parseInt(_0x57cba4(0x97))/0x5+parseInt(_0x57cba4(0x92))/0x6+parseInt(_0x57cba4(0x96))/0x7*(-parseInt(_0x57cba4(0x9c))/0x8)+parseInt(_0x57cba4(0x94))/0x9+-parseInt(_0x57cba4(0x9e))/0xa*(-parseInt(_0x57cba4(0x93))/0xb);if(_0x3d6eea===_0x387b98)break;else _0x3cb408['push'](_0x3cb408['shift']());}catch(_0x491c07){_0x3cb408['push'](_0x3cb408['shift']());}}}(a45_0x28ba,0x84666));import{jsx as a45_0x373afe,Fragment as a45_0x2b3b6a,jsxs as a45_0x18c1e3}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x5041c4){var _0x38b506=a45_0xc004;if(_0x5041c4[_0x38b506(0x9a)])return a45_0x18c1e3(a45_0x2b3b6a,{'children':[a45_0x373afe(Text,{'color':'gray','children':'\x20['}),a45_0x373afe(Text,{'color':_0x38b506(0x95),'bold':!![],'children':_0x5041c4[_0x38b506(0x9a)]}),a45_0x373afe(Text,{'color':_0x38b506(0x95),'children':']'})]});return null;}function a45_0x28ba(){var _0x5b0b0f=['2445368mvswGt','12sagdei','606810epnbCp','2544930rghUyg','121hUzmDs','6676884TOCiZC','gray','14uVfQUP','3391095Qhjsyi','983805QTpjlx','2VoeCJw','elapsed','374284eolpuT'];a45_0x28ba=function(){return _0x5b0b0f;};return a45_0x28ba();}
1
+ function a45_0x1a15(){var _0x2f8f79=['2371890WNytzR','6670596VPWPKK','elapsed','9736MaFFas','1785ihqnDp','3445960TsZwTA','4118968GLvSUu','122824yobbvQ','3MRyYGi','14082309eJWhnE','gray'];a45_0x1a15=function(){return _0x2f8f79;};return a45_0x1a15();}function a45_0x284b(_0x36fcca,_0x54230d){_0x36fcca=_0x36fcca-0xb7;var _0x1a1558=a45_0x1a15();var _0x284ba8=_0x1a1558[_0x36fcca];return _0x284ba8;}(function(_0xcde3ec,_0x41f113){var _0x4483cc=a45_0x284b,_0x230f20=_0xcde3ec();while(!![]){try{var _0x24465b=-parseInt(_0x4483cc(0xc0))/0x1+-parseInt(_0x4483cc(0xb9))/0x2*(-parseInt(_0x4483cc(0xc1))/0x3)+-parseInt(_0x4483cc(0xbc))/0x4*(parseInt(_0x4483cc(0xbd))/0x5)+-parseInt(_0x4483cc(0xba))/0x6+-parseInt(_0x4483cc(0xbe))/0x7+parseInt(_0x4483cc(0xbf))/0x8+parseInt(_0x4483cc(0xb7))/0x9;if(_0x24465b===_0x41f113)break;else _0x230f20['push'](_0x230f20['shift']());}catch(_0x3126e6){_0x230f20['push'](_0x230f20['shift']());}}}(a45_0x1a15,0xa380d));import{jsx as a45_0x5efec1,Fragment as a45_0x5ad3a7,jsxs as a45_0x3f6e6c}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x1ed666){var _0x229ac7=a45_0x284b;if(_0x1ed666[_0x229ac7(0xbb)])return a45_0x3f6e6c(a45_0x5ad3a7,{'children':[a45_0x5efec1(Text,{'color':_0x229ac7(0xb8),'children':'\x20['}),a45_0x5efec1(Text,{'color':_0x229ac7(0xb8),'bold':!![],'children':_0x1ed666[_0x229ac7(0xbb)]}),a45_0x5efec1(Text,{'color':'gray','children':']'})]});return null;}
@@ -1 +1 @@
1
- const a46_0x578a88=a46_0x41d6;function a46_0x3233(){const _0x16de52=['now','3224649syPOkQ','message','29216ywRcNH','copy','4058978NcxWZL','12664496mgfabB','50gVglnx','复制项目文件','1027918gniTQU','开始复制项目模板','1419040vKmTNB','项目模板复制失败','resolve','info','success','343290ibvQCj','项目模板复制完成','../../templates/projects/sub-app-react-demo'];a46_0x3233=function(){return _0x16de52;};return a46_0x3233();}(function(_0x1f06b7,_0x6568c9){const _0x27a144=a46_0x41d6,_0x28d84d=_0x1f06b7();while(!![]){try{const _0x373826=parseInt(_0x27a144(0xe1))/0x1+parseInt(_0x27a144(0xdf))/0x2+parseInt(_0x27a144(0xea))/0x3+parseInt(_0x27a144(0xec))/0x4*(parseInt(_0x27a144(0xdd))/0x5)+-parseInt(_0x27a144(0xe6))/0x6+-parseInt(_0x27a144(0xdb))/0x7+-parseInt(_0x27a144(0xdc))/0x8;if(_0x373826===_0x6568c9)break;else _0x28d84d['push'](_0x28d84d['shift']());}catch(_0x1332f1){_0x28d84d['push'](_0x28d84d['shift']());}}}(a46_0x3233,0xd2277));import a46_0x75aae from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';function a46_0x41d6(_0x3f2826,_0x5f3936){_0x3f2826=_0x3f2826-0xdb;const _0x32333b=a46_0x3233();let _0x41d60a=_0x32333b[_0x3f2826];return _0x41d60a;}import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a46_0x75aae['dirname'](fileURLToPath(import.meta.url)),templateDir=a46_0x75aae[a46_0x578a88(0xe3)](__dirname,a46_0x578a88(0xe8));export function useCopyProjectTemplate(){const _0x2d3a5d=a46_0x578a88,[_0x1c406c,_0x6db95f]=useState(![]),[_0x419865,_0x27f718]=useState(![]),[_0x56f544,_0x3cf3b3]=useState(''),_0x5e47c7=useCallback(async _0x6f5133=>{const _0x1fe45b=a46_0x41d6,_0x15d83c=Date['now'](),_0xd52e9c=a46_0x75aae[_0x1fe45b(0xe3)](process['cwd'](),_0x6f5133);_0x6db95f(!![]);try{logger[_0x1fe45b(0xe4)](_0x1fe45b(0xed),_0x1fe45b(0xe0),{'projectCode':_0x6f5133,'templateDir':templateDir}),await copyDirectory(templateDir,_0xd52e9c);const _0x43cf74=Date[_0x1fe45b(0xe9)]()-_0x15d83c;logger[_0x1fe45b(0xe5)](_0x1fe45b(0xed),_0x1fe45b(0xe7),_0x43cf74,{'projectCode':_0x6f5133});}catch(_0x9b7f1d){const _0x1b89a4=Date['now']()-_0x15d83c;logger['error'](_0x1fe45b(0xed),_0x1fe45b(0xe2),{'projectCode':_0x6f5133,'error':_0x9b7f1d instanceof Error?_0x9b7f1d[_0x1fe45b(0xeb)]:String(_0x9b7f1d),'duration':_0x1b89a4});throw _0x9b7f1d;}finally{_0x6db95f(![]),_0x27f718(!![]),_0x3cf3b3(formatElapsed(_0x15d83c));}},[]);return{'taskName':_0x2d3a5d(0xde),'finished':_0x419865,'loading':_0x1c406c,'elapsed':_0x56f544,'doTask':_0x5e47c7};}
1
+ function a46_0x4bf4(_0x17d0bc,_0x1df18e){_0x17d0bc=_0x17d0bc-0x10b;const _0x1a4a9c=a46_0x1a4a();let _0x4bf4f6=_0x1a4a9c[_0x17d0bc];return _0x4bf4f6;}const a46_0x10938d=a46_0x4bf4;(function(_0x1c248d,_0x43ac74){const _0x171c39=a46_0x4bf4,_0x32ae10=_0x1c248d();while(!![]){try{const _0x300d02=parseInt(_0x171c39(0x117))/0x1*(-parseInt(_0x171c39(0x10f))/0x2)+-parseInt(_0x171c39(0x114))/0x3*(-parseInt(_0x171c39(0x11c))/0x4)+-parseInt(_0x171c39(0x119))/0x5+-parseInt(_0x171c39(0x10d))/0x6*(parseInt(_0x171c39(0x11e))/0x7)+-parseInt(_0x171c39(0x10e))/0x8*(parseInt(_0x171c39(0x11b))/0x9)+parseInt(_0x171c39(0x115))/0xa+parseInt(_0x171c39(0x10b))/0xb;if(_0x300d02===_0x43ac74)break;else _0x32ae10['push'](_0x32ae10['shift']());}catch(_0x1e5512){_0x32ae10['push'](_0x32ae10['shift']());}}}(a46_0x1a4a,0x6b0b0));function a46_0x1a4a(){const _0x17cbf4=['开始复制项目模板','resolve','error','message','17389911UydpNC','copy','30jOaDMF','8oDJSol','183230EeWPVY','dirname','info','success','项目模板复制失败','60ndFGIv','2889540CjFVsv','cwd','4VQvHkr','../../templates/projects/sub-app-react-demo','1984660DfUgxc','now','4507605RPmFQT','11412UodztZ','复制项目文件','313922mwQNWi'];a46_0x1a4a=function(){return _0x17cbf4;};return a46_0x1a4a();}import a46_0x1de3bf from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a46_0x1de3bf[a46_0x10938d(0x110)](fileURLToPath(import.meta.url)),templateDir=a46_0x1de3bf[a46_0x10938d(0x120)](__dirname,a46_0x10938d(0x118));export function useCopyProjectTemplate(){const _0x6777df=a46_0x10938d,[_0x1cf885,_0xef2ad3]=useState(![]),[_0x3a096e,_0x1b3a9c]=useState(![]),[_0x3f14b9,_0x1d7c40]=useState(''),_0x3ee31a=useCallback(async _0x371d94=>{const _0x2d4ffa=a46_0x4bf4,_0x4fe2ad=Date[_0x2d4ffa(0x11a)](),_0x5b6c70=a46_0x1de3bf[_0x2d4ffa(0x120)](process[_0x2d4ffa(0x116)](),_0x371d94);_0xef2ad3(!![]);try{logger[_0x2d4ffa(0x111)]('copy',_0x2d4ffa(0x11f),{'projectCode':_0x371d94,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5b6c70);const _0x581713=Date[_0x2d4ffa(0x11a)]()-_0x4fe2ad;logger[_0x2d4ffa(0x112)](_0x2d4ffa(0x10c),'项目模板复制完成',_0x581713,{'projectCode':_0x371d94});}catch(_0x25cc55){const _0x4fbffe=Date['now']()-_0x4fe2ad;logger[_0x2d4ffa(0x121)](_0x2d4ffa(0x10c),_0x2d4ffa(0x113),{'projectCode':_0x371d94,'error':_0x25cc55 instanceof Error?_0x25cc55[_0x2d4ffa(0x122)]:String(_0x25cc55),'duration':_0x4fbffe});throw _0x25cc55;}finally{_0xef2ad3(![]),_0x1b3a9c(!![]),_0x1d7c40(formatElapsed(_0x4fe2ad));}},[]);return{'taskName':_0x6777df(0x11d),'finished':_0x3a096e,'loading':_0x1cf885,'elapsed':_0x3f14b9,'doTask':_0x3ee31a};}
@@ -1 +1 @@
1
- (function(_0x52f54f,_0x53c5b2){const _0x398ef6=a47_0x5096,_0x469e00=_0x52f54f();while(!![]){try{const _0x357345=parseInt(_0x398ef6(0x10e))/0x1*(-parseInt(_0x398ef6(0x10b))/0x2)+-parseInt(_0x398ef6(0x113))/0x3*(-parseInt(_0x398ef6(0x108))/0x4)+parseInt(_0x398ef6(0x119))/0x5+parseInt(_0x398ef6(0x10f))/0x6*(-parseInt(_0x398ef6(0x107))/0x7)+parseInt(_0x398ef6(0x109))/0x8*(-parseInt(_0x398ef6(0x11b))/0x9)+parseInt(_0x398ef6(0x114))/0xa+parseInt(_0x398ef6(0x10d))/0xb;if(_0x357345===_0x53c5b2)break;else _0x469e00['push'](_0x469e00['shift']());}catch(_0x5a25a6){_0x469e00['push'](_0x469e00['shift']());}}}(a47_0x1b97,0xdf8c8));import a47_0x1a6787 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a47_0x1b97(){const _0x1d5d4c=['8778qQkStL','message','开始格式化代码','prettier','127215khndIR','3638590EmHFtI','npx','success','cwd','now','3272240PsxfPo','resolve','5957613Vaxwhs','--write','代码格式化失败','error','format','5810MjnAxa','100KqKTAA','8NgVEEW','info','2258FGOhEe','格式化代码','25048496LodrBV','1385YBVxIe'];a47_0x1b97=function(){return _0x1d5d4c;};return a47_0x1b97();}function a47_0x5096(_0xd692aa,_0x5ea60b){_0xd692aa=_0xd692aa-0x106;const _0x1b9765=a47_0x1b97();let _0x509671=_0x1b9765[_0xd692aa];return _0x509671;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0xe70e3d=a47_0x5096,[_0x443bb9,_0x2516ff]=useState(![]),[_0x3af2c5,_0x20c355]=useState(![]),[_0x17295f,_0x20232f]=useState(''),_0x1c4208=useCallback(async _0xcc2248=>{const _0x17ea71=a47_0x5096,_0x188c8a=Date[_0x17ea71(0x118)](),_0x5136fb=a47_0x1a6787[_0x17ea71(0x11a)](process[_0x17ea71(0x117)](),_0xcc2248);_0x2516ff(!![]);try{logger[_0x17ea71(0x10a)](_0x17ea71(0x106),_0x17ea71(0x111),{'projectCode':_0xcc2248}),await execa(_0x17ea71(0x115),[_0x17ea71(0x112),_0x17ea71(0x11c),'.'],{'cwd':_0x5136fb});const _0x5306df=Date[_0x17ea71(0x118)]()-_0x188c8a;logger[_0x17ea71(0x116)]('format','代码格式化完成',_0x5306df,{'projectCode':_0xcc2248});}catch(_0x101476){const _0x27253c=Date['now']()-_0x188c8a;logger[_0x17ea71(0x11e)](_0x17ea71(0x106),_0x17ea71(0x11d),{'projectCode':_0xcc2248,'error':_0x101476 instanceof Error?_0x101476[_0x17ea71(0x110)]:String(_0x101476),'duration':_0x27253c});throw _0x101476;}finally{_0x2516ff(![]),_0x20c355(!![]),_0x20232f(formatElapsed(_0x188c8a));}},[]);return{'taskName':_0xe70e3d(0x10c),'finished':_0x3af2c5,'loading':_0x443bb9,'elapsed':_0x17295f,'doTask':_0x1c4208};}
1
+ function a47_0xee89(){const _0x3af258=['4109328yeUlZo','message','cwd','59682lvYnIc','551030EMDutr','代码格式化完成','info','now','--write','format','908612iohuIy','resolve','3696875dLSpCX','329xGiiOr','代码格式化失败','success','418952PJAmfs','prettier','开始格式化代码','1576452iEhKdJ'];a47_0xee89=function(){return _0x3af258;};return a47_0xee89();}(function(_0x505453,_0x141c6b){const _0x6b0eba=a47_0x82bc,_0x19399b=_0x505453();while(!![]){try{const _0x2fa2ea=parseInt(_0x6b0eba(0x198))/0x1+-parseInt(_0x6b0eba(0x199))/0x2+-parseInt(_0x6b0eba(0x194))/0x3+parseInt(_0x6b0eba(0x18b))/0x4+-parseInt(_0x6b0eba(0x18d))/0x5+-parseInt(_0x6b0eba(0x195))/0x6+-parseInt(_0x6b0eba(0x18e))/0x7*(-parseInt(_0x6b0eba(0x191))/0x8);if(_0x2fa2ea===_0x141c6b)break;else _0x19399b['push'](_0x19399b['shift']());}catch(_0x571ac8){_0x19399b['push'](_0x19399b['shift']());}}}(a47_0xee89,0x7faa4));import a47_0x3ec57d from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a47_0x82bc(_0x4dc3d8,_0x1e6ef1){_0x4dc3d8=_0x4dc3d8-0x18b;const _0xee893d=a47_0xee89();let _0x82bc3c=_0xee893d[_0x4dc3d8];return _0x82bc3c;}import{logger}from'../utils/logger.js';export function useFormatCode(){const [_0x57a9ce,_0x8ab1b0]=useState(![]),[_0x2ba668,_0x5abac1]=useState(![]),[_0x48abf9,_0x25bfe5]=useState(''),_0x260dda=useCallback(async _0x5a0d8e=>{const _0x1bf3ea=a47_0x82bc,_0x4d79c7=Date['now'](),_0x5bdeab=a47_0x3ec57d[_0x1bf3ea(0x18c)](process[_0x1bf3ea(0x197)](),_0x5a0d8e);_0x8ab1b0(!![]);try{logger[_0x1bf3ea(0x19b)](_0x1bf3ea(0x19e),_0x1bf3ea(0x193),{'projectCode':_0x5a0d8e}),await execa('npx',[_0x1bf3ea(0x192),_0x1bf3ea(0x19d),'.'],{'cwd':_0x5bdeab});const _0x37dc8f=Date[_0x1bf3ea(0x19c)]()-_0x4d79c7;logger[_0x1bf3ea(0x190)]('format',_0x1bf3ea(0x19a),_0x37dc8f,{'projectCode':_0x5a0d8e});}catch(_0x41ceb2){const _0x1781a5=Date[_0x1bf3ea(0x19c)]()-_0x4d79c7;logger['error']('format',_0x1bf3ea(0x18f),{'projectCode':_0x5a0d8e,'error':_0x41ceb2 instanceof Error?_0x41ceb2[_0x1bf3ea(0x196)]:String(_0x41ceb2),'duration':_0x1781a5});throw _0x41ceb2;}finally{_0x8ab1b0(![]),_0x5abac1(!![]),_0x25bfe5(formatElapsed(_0x4d79c7));}},[]);return{'taskName':'格式化代码','finished':_0x2ba668,'loading':_0x57a9ce,'elapsed':_0x48abf9,'doTask':_0x260dda};}
@@ -1 +1 @@
1
- (function(_0x52dcdd,_0x1d89d8){const _0x4cc6c5=a48_0xccf7,_0x13cce5=_0x52dcdd();while(!![]){try{const _0x4ac923=parseInt(_0x4cc6c5(0x1b4))/0x1+parseInt(_0x4cc6c5(0x1b0))/0x2*(-parseInt(_0x4cc6c5(0x1af))/0x3)+parseInt(_0x4cc6c5(0x1a4))/0x4*(-parseInt(_0x4cc6c5(0x1a5))/0x5)+parseInt(_0x4cc6c5(0x1a6))/0x6*(parseInt(_0x4cc6c5(0x1aa))/0x7)+parseInt(_0x4cc6c5(0x1a2))/0x8+parseInt(_0x4cc6c5(0x1b2))/0x9*(parseInt(_0x4cc6c5(0x1a1))/0xa)+parseInt(_0x4cc6c5(0x1ae))/0xb*(-parseInt(_0x4cc6c5(0x1b5))/0xc);if(_0x4ac923===_0x1d89d8)break;else _0x13cce5['push'](_0x13cce5['shift']());}catch(_0x44e8a1){_0x13cce5['push'](_0x13cce5['shift']());}}}(a48_0x51ff,0xda0ee));import a48_0x43ae5d from'node:path';import{useCallback,useState}from'react';function a48_0x51ff(){const _0x1cd3ac=['npm','resolve','140eLmGjs','13172960hiDamR','安装依赖','1656cvGanu','19325skkwsu','1316118ZZfSOw','依赖安装失败','https://registry.npmmirror.com','install','56VgUtui','info','now','--registry','24753069CTDDTX','793857gRnMpj','6WSrFfh','message','535239ZslfSv','依赖安装完成','1303374lFooYW','12frOQvT','cwd','error'];a48_0x51ff=function(){return _0x1cd3ac;};return a48_0x51ff();}import{execa}from'execa';function a48_0xccf7(_0x5a231f,_0x4f80fe){_0x5a231f=_0x5a231f-0x19f;const _0x51ff80=a48_0x51ff();let _0xccf7bd=_0x51ff80[_0x5a231f];return _0xccf7bd;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x585428=a48_0xccf7,[_0x514835,_0x1d7f06]=useState(![]),[_0x1d88ee,_0x5c2d2b]=useState(![]),[_0x3da556,_0x104a20]=useState(''),_0x25bca8=useCallback(async _0xcef933=>{const _0x436822=a48_0xccf7,_0x3c602e=Date[_0x436822(0x1ac)](),_0x3258b2=a48_0x43ae5d[_0x436822(0x1a0)](process[_0x436822(0x1b6)](),_0xcef933);_0x1d7f06(!![]),_0x5c2d2b(![]);const _0x2316e0=async(_0xf1a88c,_0x337e5b)=>{await execa(_0xf1a88c,_0x337e5b,{'cwd':_0x3258b2});};try{logger[_0x436822(0x1ab)](_0x436822(0x1a9),'开始安装依赖',{'projectCode':_0xcef933,'registry':_0x436822(0x1a8)}),await _0x2316e0(_0x436822(0x19f),[_0x436822(0x1a9),_0x436822(0x1ad),_0x436822(0x1a8)]);const _0x22cd3d=Date[_0x436822(0x1ac)]()-_0x3c602e;logger['success'](_0x436822(0x1a9),_0x436822(0x1b3),_0x22cd3d,{'projectCode':_0xcef933});}catch(_0x33cdf5){const _0x172342=Date[_0x436822(0x1ac)]()-_0x3c602e;logger[_0x436822(0x1b7)](_0x436822(0x1a9),_0x436822(0x1a7),{'projectCode':_0xcef933,'error':_0x33cdf5 instanceof Error?_0x33cdf5[_0x436822(0x1b1)]:String(_0x33cdf5),'duration':_0x172342});throw _0x33cdf5;}finally{_0x1d7f06(![]),_0x5c2d2b(!![]),_0x104a20(formatElapsed(_0x3c602e));}},[]);return{'taskName':_0x585428(0x1a3),'finished':_0x1d88ee,'loading':_0x514835,'elapsed':_0x3da556,'doTask':_0x25bca8};}
1
+ (function(_0x4ff563,_0x1eed1c){const _0x23cec3=a48_0x41f9,_0x1ccf63=_0x4ff563();while(!![]){try{const _0x42b60a=parseInt(_0x23cec3(0x170))/0x1+-parseInt(_0x23cec3(0x169))/0x2+-parseInt(_0x23cec3(0x16b))/0x3*(-parseInt(_0x23cec3(0x175))/0x4)+parseInt(_0x23cec3(0x178))/0x5+parseInt(_0x23cec3(0x177))/0x6*(parseInt(_0x23cec3(0x16c))/0x7)+parseInt(_0x23cec3(0x179))/0x8+parseInt(_0x23cec3(0x16f))/0x9*(-parseInt(_0x23cec3(0x17b))/0xa);if(_0x42b60a===_0x1eed1c)break;else _0x1ccf63['push'](_0x1ccf63['shift']());}catch(_0x47aad8){_0x1ccf63['push'](_0x1ccf63['shift']());}}}(a48_0x4cff,0x8d2d9));function a48_0x4cff(){const _0x33b9d5=['安装依赖','3784652IstmTp','npm','50412xvIJob','4691810uTCAAV','8043088oLTgnv','cwd','1413470KEvVLb','message','install','2148890oEyKJC','resolve','3jJNSxe','679lqVvyQ','error','info','189QfDyAI','916092XipWHh','开始安装依赖','now','https://registry.npmmirror.com'];a48_0x4cff=function(){return _0x33b9d5;};return a48_0x4cff();}import a48_0x2e4176 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a48_0x41f9(_0x241aa8,_0x2cc364){_0x241aa8=_0x241aa8-0x167;const _0x4cff54=a48_0x4cff();let _0x41f90f=_0x4cff54[_0x241aa8];return _0x41f90f;}export function useInstallDependencies(){const _0x4efc64=a48_0x41f9,[_0x444368,_0x225c34]=useState(![]),[_0x5d052a,_0x41df4b]=useState(![]),[_0x22a0ab,_0x29a451]=useState(''),_0x1e01a0=useCallback(async _0x102779=>{const _0x38c7cb=a48_0x41f9,_0x474ed8=Date[_0x38c7cb(0x172)](),_0x5453ee=a48_0x2e4176[_0x38c7cb(0x16a)](process[_0x38c7cb(0x17a)](),_0x102779);_0x225c34(!![]),_0x41df4b(![]);const _0x9bc011=async(_0x3b6969,_0x148662)=>{await execa(_0x3b6969,_0x148662,{'cwd':_0x5453ee});};try{logger[_0x38c7cb(0x16e)](_0x38c7cb(0x168),_0x38c7cb(0x171),{'projectCode':_0x102779,'registry':'https://registry.npmmirror.com'}),await _0x9bc011(_0x38c7cb(0x176),[_0x38c7cb(0x168),'--registry',_0x38c7cb(0x173)]);const _0x41db3d=Date[_0x38c7cb(0x172)]()-_0x474ed8;logger['success'](_0x38c7cb(0x168),'依赖安装完成',_0x41db3d,{'projectCode':_0x102779});}catch(_0x33cbdc){const _0x4b0c01=Date[_0x38c7cb(0x172)]()-_0x474ed8;logger[_0x38c7cb(0x16d)](_0x38c7cb(0x168),'依赖安装失败',{'projectCode':_0x102779,'error':_0x33cbdc instanceof Error?_0x33cbdc[_0x38c7cb(0x167)]:String(_0x33cbdc),'duration':_0x4b0c01});throw _0x33cbdc;}finally{_0x225c34(![]),_0x41df4b(!![]),_0x29a451(formatElapsed(_0x474ed8));}},[]);return{'taskName':_0x4efc64(0x174),'finished':_0x5d052a,'loading':_0x444368,'elapsed':_0x22a0ab,'doTask':_0x1e01a0};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- function a49_0x1ace(){var _0x32a4fa=['1019007qpOYQx','20850HMDYnD','column','green','13755ZJPmMN','180824WfLIQy','312CyElun','查看可用命令。','121918jvKMwv','!\x20请指定一个有效的命令。','310248HbsdMJ','175JdxIqy','34195giCiNI'];a49_0x1ace=function(){return _0x32a4fa;};return a49_0x1ace();}(function(_0x476816,_0xe6de9c){var _0x1da622=a49_0x205b,_0x4fa3a9=_0x476816();while(!![]){try{var _0x1b0e2e=parseInt(_0x1da622(0x1bc))/0x1+parseInt(_0x1da622(0x1be))/0x2+-parseInt(_0x1da622(0x1b8))/0x3+parseInt(_0x1da622(0x1b9))/0x4+parseInt(_0x1da622(0x1bf))/0x5*(-parseInt(_0x1da622(0x1b5))/0x6)+-parseInt(_0x1da622(0x1c0))/0x7*(parseInt(_0x1da622(0x1ba))/0x8)+parseInt(_0x1da622(0x1b4))/0x9;if(_0x1b0e2e===_0xe6de9c)break;else _0x4fa3a9['push'](_0x4fa3a9['shift']());}catch(_0x1a83b0){_0x4fa3a9['push'](_0x4fa3a9['shift']());}}}(a49_0x1ace,0x1cfda));function a49_0x205b(_0x57986e,_0x42a739){_0x57986e=_0x57986e-0x1b4;var _0x1ace73=a49_0x1ace();var _0x205b52=_0x1ace73[_0x57986e];return _0x205b52;}import{jsx as a49_0x1dfd37,jsxs as a49_0x505200}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x2de393=a49_0x205b;return a49_0x505200(Box,{'flexDirection':_0x2de393(0x1b6),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x505200(Box,{'children':[a49_0x1dfd37(Box,{'width':'1'}),a49_0x1dfd37(Text,{'children':_0x2de393(0x1bd)})]}),a49_0x505200(Box,{'marginTop':0x1,'children':[a49_0x1dfd37(Box,{'width':'1'}),a49_0x505200(Text,{'children':['\x20\x20','使用']}),a49_0x505200(Text,{'bold':!![],'color':_0x2de393(0x1b7),'children':['\x20','lovrabet\x20--help','\x20']}),a49_0x1dfd37(Text,{'children':_0x2de393(0x1bb)})]})]});}
1
+ function a49_0x2f2e(){var _0xf51c33=['7ZJTjuA','10670yaJXSG','green','10kUGSHJ','200286rGewBW','查看可用命令。','46336ybRXym','267mMxphA','15273GrFVxS','1304AioYqg','12iaKyTG','1453182SbYQcf','2687971OXhXfV','lovrabet\x20--help','1321120ufLQJU','!\x20请指定一个有效的命令。'];a49_0x2f2e=function(){return _0xf51c33;};return a49_0x2f2e();}(function(_0x572544,_0x4191dd){var _0x1fb549=a49_0x1418,_0x579a09=_0x572544();while(!![]){try{var _0x2e59e=parseInt(_0x1fb549(0xc8))/0x1+-parseInt(_0x1fb549(0xc5))/0x2*(-parseInt(_0x1fb549(0xcb))/0x3)+-parseInt(_0x1fb549(0xca))/0x4*(parseInt(_0x1fb549(0xc7))/0x5)+parseInt(_0x1fb549(0xcf))/0x6*(parseInt(_0x1fb549(0xd4))/0x7)+parseInt(_0x1fb549(0xcd))/0x8*(-parseInt(_0x1fb549(0xcc))/0x9)+-parseInt(_0x1fb549(0xd2))/0xa+parseInt(_0x1fb549(0xd0))/0xb*(-parseInt(_0x1fb549(0xce))/0xc);if(_0x2e59e===_0x4191dd)break;else _0x579a09['push'](_0x579a09['shift']());}catch(_0x3fe9e7){_0x579a09['push'](_0x579a09['shift']());}}}(a49_0x2f2e,0x3ad96));import{jsx as a49_0x17d992,jsxs as a49_0x3610e6}from'react/jsx-runtime';function a49_0x1418(_0x4d6711,_0x279dde){_0x4d6711=_0x4d6711-0xc5;var _0x2f2e30=a49_0x2f2e();var _0x1418ee=_0x2f2e30[_0x4d6711];return _0x1418ee;}import{Box,Text}from'ink';export function Help(){var _0x40fa4d=a49_0x1418;return a49_0x3610e6(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a49_0x3610e6(Box,{'children':[a49_0x17d992(Box,{'width':'1'}),a49_0x17d992(Text,{'children':_0x40fa4d(0xd3)})]}),a49_0x3610e6(Box,{'marginTop':0x1,'children':[a49_0x17d992(Box,{'width':'1'}),a49_0x3610e6(Text,{'children':['\x20\x20','使用']}),a49_0x3610e6(Text,{'bold':!![],'color':_0x40fa4d(0xc6),'children':['\x20',_0x40fa4d(0xd1),'\x20']}),a49_0x17d992(Text,{'children':_0x40fa4d(0xc9)})]})]});}
package/lib/init/main.js CHANGED
@@ -1 +1 @@
1
- (function(_0x41c373,_0x17e9a4){const _0x156235=a50_0x1c4f,_0x2de3da=_0x41c373();while(!![]){try{const _0x1e53ac=parseInt(_0x156235(0xe1))/0x1+parseInt(_0x156235(0xd4))/0x2+-parseInt(_0x156235(0xec))/0x3*(-parseInt(_0x156235(0xfa))/0x4)+-parseInt(_0x156235(0xed))/0x5*(-parseInt(_0x156235(0xd8))/0x6)+-parseInt(_0x156235(0xd5))/0x7+-parseInt(_0x156235(0xfb))/0x8*(-parseInt(_0x156235(0xe6))/0x9)+-parseInt(_0x156235(0xe5))/0xa;if(_0x1e53ac===_0x17e9a4)break;else _0x2de3da['push'](_0x2de3da['shift']());}catch(_0x32d5a4){_0x2de3da['push'](_0x2de3da['shift']());}}}(a50_0xe11a,0x62586));import{jsxs as a50_0x592919,jsx as a50_0x4a9b44}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';function a50_0x1c4f(_0x3a5679,_0x5f192b){_0x3a5679=_0x3a5679-0xd2;const _0xe11aca=a50_0xe11a();let _0x1c4fa0=_0xe11aca[_0x3a5679];return _0x1c4fa0;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a50_0xe11a(){const _0x46c022=['当前目录已存在\x20.lovrabetrc\x20文件','stringify','893328liPcPT','3194660BEsyeV','gray','创建配置文件失败:\x20','144588FNuwZK','delete','column','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','\x20←\x20','../..','green','cwd','AppCode:\x20','396690dfRMUo','backspace','setLogPath','error','11559140pkcwCm','72ZBmtHt','请输入应用代码\x20(AppCode):\x20','应用代码长度不能超过\x20100\x20个字符','.lovrabetrc','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','red','732flsXDf','115sRQybR','version','正在初始化配置文件...','init','env','return','length','string','应用代码不合法','slice','exit','1.0.0','应用代码只能包含字母、数字、-\x20和\x20_','7764dYqWGI','143904CVhAAG','utf8','message','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','trim','cyan','应用代码不能为空','创建配置文件失败','初始化项目配置文件成功','parse','ctrl'];a50_0xe11a=function(){return _0x46c022;};return a50_0xe11a();}export function Init({appcode:_0x555ae2,env:_0x1af77a}){const _0x5c870d=a50_0x1c4f,[_0x257101,_0x49e1b9]=useState(null),[_0x59022e,_0x1633e4]=useState(![]),[_0x1d947b,_0x4497d7]=useState(!_0x555ae2),[_0x135e99,_0x3e52a4]=useState(''),[_0x503653,_0x5750e3]=useState(''),[_0x45b86d,_0x481d19]=useState(_0x555ae2||''),[_0x20a8a0]=useState(_0x1af77a);function _0x4af332(_0x383c90){const _0x50671d=a50_0x1c4f;if(_0x383c90[_0x50671d(0xf3)]===0x0)return{'valid':![],'message':''};if(_0x383c90['length']>0x64)return{'valid':![],'message':_0x50671d(0xe8)};const _0x2ee9ba=/^[A-Za-z0-9_-]+$/;if(!_0x2ee9ba['test'](_0x383c90))return{'valid':![],'message':_0x50671d(0xf9)};return{'valid':!![]};}useInput((_0x39c248,_0x52329e)=>{const _0x2c101d=a50_0x1c4f;if(!_0x1d947b)return;if(_0x52329e[_0x2c101d(0xf2)]){if(_0x503653||!_0x135e99[_0x2c101d(0xff)]()){_0x5750e3(_0x2c101d(0x101));return;}const _0x254735=_0x135e99[_0x2c101d(0xff)](),{valid:_0x168a63,message:_0x4384c5}=_0x4af332(_0x254735);if(!_0x168a63){_0x5750e3(_0x4384c5||_0x2c101d(0xf5));return;}_0x481d19(_0x254735),_0x4497d7(![]);}else{if(_0x52329e[_0x2c101d(0xe2)]||_0x52329e[_0x2c101d(0xd9)])_0x3e52a4(_0x56084c=>{const _0x351ad7=_0x2c101d,_0x20956c=_0x56084c[_0x351ad7(0xf6)](0x0,-0x1);if(_0x20956c[_0x351ad7(0xf3)]===0x0)_0x5750e3('');else{const {valid:_0x546129,message:_0xc98727}=_0x4af332(_0x20956c);_0x5750e3(_0x546129?'':_0xc98727||_0x351ad7(0xf5));}return _0x20956c;});else _0x52329e[_0x2c101d(0x105)]&&_0x39c248==='c'?process['exit'](0x0):_0x3e52a4(_0x2c035a=>{const _0x25c42c=_0x2c035a+_0x39c248,{valid:_0x59b87c,message:_0x759b73}=_0x4af332(_0x25c42c);return _0x5750e3(_0x59b87c?'':_0x759b73||'应用代码不合法'),_0x25c42c;});}},{'isActive':_0x1d947b}),useEffect(()=>{const _0x56c904=a50_0x1c4f;if(!_0x45b86d||_0x1d947b)return;const _0xe58eb8=resolve(process[_0x56c904(0xdf)](),_0x56c904(0xe9));if(existsSync(_0xe58eb8)){_0x49e1b9(_0x56c904(0xd2)),setTimeout(()=>process[_0x56c904(0xf7)](0x1),0x64);return;}try{const _0x177181=fileURLToPath(import.meta.url),_0x56f697=resolve(dirname(_0x177181),_0x56c904(0xdd)),_0x446c7d=join(_0x56f697,'package.json');let _0x300ebd=_0x56c904(0xf8);try{const _0x545fac=JSON[_0x56c904(0x104)](readFileSync(_0x446c7d,_0x56c904(0xfc)));_0x300ebd=_0x545fac[_0x56c904(0xee)]||_0x56c904(0xf8);}catch(_0x172335){}const _0x332882=readConfig(),_0x1aeeb5=typeof _0x332882[_0x56c904(0xf1)]===_0x56c904(0xf4)?_0x332882['env']:undefined,{app:_0x45e5fe,appcode:_0x2a0f4c,..._0x561c89}=_0x332882,_0x5964a7={..._0x561c89,'appcode':_0x45b86d,'env':_0x20a8a0||_0x1aeeb5||'online','createdAt':new Date()['toLocaleString'](),'version':_0x300ebd};writeFileSync(_0xe58eb8,JSON[_0x56c904(0xd3)](_0x5964a7,null,0x2),{'encoding':_0x56c904(0xfc),'mode':0x180}),logger[_0x56c904(0xe3)](process[_0x56c904(0xdf)]()),logger['info'](_0x56c904(0xf0),_0x56c904(0x103),{'appcode':_0x45b86d,'env':_0x5964a7[_0x56c904(0xf1)],'version':_0x5964a7[_0x56c904(0xee)],'configPath':_0xe58eb8}),_0x1633e4(!![]),setTimeout(()=>process[_0x56c904(0xf7)](0x0),0x64);}catch(_0x2eea2f){logger[_0x56c904(0xe4)](_0x56c904(0xf0),_0x56c904(0x102),{'error':_0x2eea2f instanceof Error?_0x2eea2f['message']:String(_0x2eea2f)}),_0x49e1b9(_0x56c904(0xd7)+(_0x2eea2f instanceof Error?_0x2eea2f[_0x56c904(0xfd)]:String(_0x2eea2f))),setTimeout(()=>process[_0x56c904(0xf7)](0x1),0x64);}},[_0x45b86d,_0x1d947b,_0x20a8a0]);if(_0x257101)return a50_0x4a9b44(Box,{'flexDirection':_0x5c870d(0xda),'children':a50_0x592919(Text,{'color':_0x5c870d(0xeb),'children':['✗\x20',_0x257101]})});if(_0x1d947b)return a50_0x592919(Box,{'flexDirection':_0x5c870d(0xda),'children':[a50_0x592919(Box,{'children':[a50_0x4a9b44(Text,{'color':_0x5c870d(0x100),'children':_0x5c870d(0xe7)}),_0x135e99?a50_0x4a9b44(Text,{'color':_0x5c870d(0xde),'children':_0x135e99}):a50_0x4a9b44(Text,{'color':_0x5c870d(0xd6),'children':'_'}),_0x503653&&a50_0x592919(Text,{'color':_0x5c870d(0xeb),'children':[_0x5c870d(0xdc),_0x503653]})]}),!_0x503653&&!_0x135e99&&a50_0x4a9b44(Box,{'children':a50_0x4a9b44(Text,{'color':_0x5c870d(0xd6),'children':_0x5c870d(0xea)})})]});if(_0x59022e)return a50_0x592919(Box,{'flexDirection':_0x5c870d(0xda),'children':[a50_0x4a9b44(Text,{'color':_0x5c870d(0xde),'children':_0x5c870d(0xfe)}),a50_0x592919(Text,{'color':_0x5c870d(0x100),'children':[_0x5c870d(0xe0),_0x45b86d]}),a50_0x4a9b44(Text,{'children':_0x5c870d(0xdb)})]});return a50_0x4a9b44(Box,{'children':a50_0x4a9b44(Text,{'children':_0x5c870d(0xef)})});}
1
+ function a50_0x26ca(){const _0x2ce860=['slice','247910pfArJd','创建配置文件失败','ctrl','7IIUrlr','应用代码只能包含字母、数字、-\x20和\x20_','stringify','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','package.json','red','test','311754YfbqJj','\x20←\x20','当前目录已存在\x20.lovrabetrc\x20文件','52ngZEAW','green','version','cwd','请输入应用代码\x20(AppCode):\x20','online','gray','AppCode:\x20','应用代码不合法','348567mjgMpk','cyan','3040776dABNIv','1161120bPjTWc','应用代码长度不能超过\x20100\x20个字符','string','return','utf8','message','11614392EILmtx','error','890000onuyvv','exit','应用代码不能为空','parse','初始化项目配置文件成功','init','length','创建配置文件失败:\x20','setLogPath','delete','toLocaleString','column','env','1.0.0'];a50_0x26ca=function(){return _0x2ce860;};return a50_0x26ca();}(function(_0x2d4518,_0xeec401){const _0x1e72fe=a50_0x192d,_0x52b515=_0x2d4518();while(!![]){try{const _0x30ef96=parseInt(_0x1e72fe(0xbe))/0x1+parseInt(_0x1e72fe(0xc6))/0x2+parseInt(_0x1e72fe(0xbb))/0x3+-parseInt(_0x1e72fe(0xe2))/0x4*(-parseInt(_0x1e72fe(0xd5))/0x5)+-parseInt(_0x1e72fe(0xdf))/0x6*(parseInt(_0x1e72fe(0xd8))/0x7)+-parseInt(_0x1e72fe(0xbd))/0x8+-parseInt(_0x1e72fe(0xc4))/0x9;if(_0x30ef96===_0xeec401)break;else _0x52b515['push'](_0x52b515['shift']());}catch(_0x47b698){_0x52b515['push'](_0x52b515['shift']());}}}(a50_0x26ca,0x9d4eb));function a50_0x192d(_0x361fc1,_0x34a3cf){_0x361fc1=_0x361fc1-0xb4;const _0x26caae=a50_0x26ca();let _0x192d88=_0x26caae[_0x361fc1];return _0x192d88;}import{jsxs as a50_0x12b968,jsx as a50_0x3559c8}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x4bce66,env:_0x27cfe4}){const _0x22a362=a50_0x192d,[_0x5a46c8,_0x3ffe3a]=useState(null),[_0x1e8e62,_0xf19e00]=useState(![]),[_0xa82fb7,_0x585e72]=useState(!_0x4bce66),[_0x3b5d32,_0x25dbc8]=useState(''),[_0x368bf0,_0x319703]=useState(''),[_0x2acca9,_0xba5edc]=useState(_0x4bce66||''),[_0x2e7fcd]=useState(_0x27cfe4);function _0x2355f5(_0x2496bd){const _0x195c69=a50_0x192d;if(_0x2496bd[_0x195c69(0xcc)]===0x0)return{'valid':![],'message':''};if(_0x2496bd[_0x195c69(0xcc)]>0x64)return{'valid':![],'message':_0x195c69(0xbf)};const _0x42462d=/^[A-Za-z0-9_-]+$/;if(!_0x42462d[_0x195c69(0xde)](_0x2496bd))return{'valid':![],'message':_0x195c69(0xd9)};return{'valid':!![]};}useInput((_0x2c4cb5,_0x12c1e8)=>{const _0x49664b=a50_0x192d;if(!_0xa82fb7)return;if(_0x12c1e8[_0x49664b(0xc1)]){if(_0x368bf0||!_0x3b5d32['trim']()){_0x319703(_0x49664b(0xc8));return;}const _0x370a87=_0x3b5d32['trim'](),{valid:_0xafd7b1,message:_0x1c684f}=_0x2355f5(_0x370a87);if(!_0xafd7b1){_0x319703(_0x1c684f||_0x49664b(0xba));return;}_0xba5edc(_0x370a87),_0x585e72(![]);}else{if(_0x12c1e8['backspace']||_0x12c1e8[_0x49664b(0xcf)])_0x25dbc8(_0x2fbf32=>{const _0x2ed4ec=_0x49664b,_0x4f5a37=_0x2fbf32[_0x2ed4ec(0xd4)](0x0,-0x1);if(_0x4f5a37[_0x2ed4ec(0xcc)]===0x0)_0x319703('');else{const {valid:_0x1ef030,message:_0x554518}=_0x2355f5(_0x4f5a37);_0x319703(_0x1ef030?'':_0x554518||'应用代码不合法');}return _0x4f5a37;});else _0x12c1e8[_0x49664b(0xd7)]&&_0x2c4cb5==='c'?process[_0x49664b(0xc7)](0x0):_0x25dbc8(_0xbf5e31=>{const _0x332cbb=_0xbf5e31+_0x2c4cb5,{valid:_0xca2979,message:_0x211bfa}=_0x2355f5(_0x332cbb);return _0x319703(_0xca2979?'':_0x211bfa||'应用代码不合法'),_0x332cbb;});}},{'isActive':_0xa82fb7}),useEffect(()=>{const _0x1fc9e3=a50_0x192d;if(!_0x2acca9||_0xa82fb7)return;const _0x1196a6=resolve(process[_0x1fc9e3(0xb5)](),'.lovrabetrc');if(existsSync(_0x1196a6)){_0x3ffe3a(_0x1fc9e3(0xe1)),setTimeout(()=>process[_0x1fc9e3(0xc7)](0x1),0x64);return;}try{const _0x4b4b2d=fileURLToPath(import.meta.url),_0x3d8c28=resolve(dirname(_0x4b4b2d),'../..'),_0x5a173b=join(_0x3d8c28,_0x1fc9e3(0xdc));let _0x29683f=_0x1fc9e3(0xd3);try{const _0x594e88=JSON[_0x1fc9e3(0xc9)](readFileSync(_0x5a173b,_0x1fc9e3(0xc2)));_0x29683f=_0x594e88[_0x1fc9e3(0xb4)]||_0x1fc9e3(0xd3);}catch(_0x1b585a){}const _0x26def3=readConfig(),_0x50a7cb=typeof _0x26def3[_0x1fc9e3(0xd2)]===_0x1fc9e3(0xc0)?_0x26def3[_0x1fc9e3(0xd2)]:undefined,{app:_0x7428a2,appcode:_0x32be9b,..._0x305ed0}=_0x26def3,_0x555c1b={..._0x305ed0,'appcode':_0x2acca9,'env':_0x2e7fcd||_0x50a7cb||_0x1fc9e3(0xb7),'createdAt':new Date()[_0x1fc9e3(0xd0)](),'version':_0x29683f};writeFileSync(_0x1196a6,JSON[_0x1fc9e3(0xda)](_0x555c1b,null,0x2),{'encoding':_0x1fc9e3(0xc2),'mode':0x180}),logger[_0x1fc9e3(0xce)](process[_0x1fc9e3(0xb5)]()),logger['info'](_0x1fc9e3(0xcb),_0x1fc9e3(0xca),{'appcode':_0x2acca9,'env':_0x555c1b[_0x1fc9e3(0xd2)],'version':_0x555c1b[_0x1fc9e3(0xb4)],'configPath':_0x1196a6}),_0xf19e00(!![]),setTimeout(()=>process[_0x1fc9e3(0xc7)](0x0),0x64);}catch(_0x383038){logger[_0x1fc9e3(0xc5)](_0x1fc9e3(0xcb),_0x1fc9e3(0xd6),{'error':_0x383038 instanceof Error?_0x383038[_0x1fc9e3(0xc3)]:String(_0x383038)}),_0x3ffe3a(_0x1fc9e3(0xcd)+(_0x383038 instanceof Error?_0x383038['message']:String(_0x383038))),setTimeout(()=>process[_0x1fc9e3(0xc7)](0x1),0x64);}},[_0x2acca9,_0xa82fb7,_0x2e7fcd]);if(_0x5a46c8)return a50_0x3559c8(Box,{'flexDirection':_0x22a362(0xd1),'children':a50_0x12b968(Text,{'color':_0x22a362(0xdd),'children':['✗\x20',_0x5a46c8]})});if(_0xa82fb7)return a50_0x12b968(Box,{'flexDirection':_0x22a362(0xd1),'children':[a50_0x12b968(Box,{'children':[a50_0x3559c8(Text,{'color':_0x22a362(0xbc),'children':_0x22a362(0xb6)}),_0x3b5d32?a50_0x3559c8(Text,{'color':_0x22a362(0xe3),'children':_0x3b5d32}):a50_0x3559c8(Text,{'color':_0x22a362(0xb8),'children':'_'}),_0x368bf0&&a50_0x12b968(Text,{'color':'red','children':[_0x22a362(0xe0),_0x368bf0]})]}),!_0x368bf0&&!_0x3b5d32&&a50_0x3559c8(Box,{'children':a50_0x3559c8(Text,{'color':_0x22a362(0xb8),'children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x1e8e62)return a50_0x12b968(Box,{'flexDirection':_0x22a362(0xd1),'children':[a50_0x3559c8(Text,{'color':_0x22a362(0xe3),'children':_0x22a362(0xdb)}),a50_0x12b968(Text,{'color':_0x22a362(0xbc),'children':[_0x22a362(0xb9),_0x2acca9]}),a50_0x3559c8(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a50_0x3559c8(Box,{'children':a50_0x3559c8(Text,{'children':'正在初始化配置文件...'})});}