@lovrabet/cli 1.1.0

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 (76) hide show
  1. package/README.md +28 -0
  2. package/lib/add-page/input-page-router.js +1 -0
  3. package/lib/add-page/main.js +1 -0
  4. package/lib/add-page/select-page-template.js +1 -0
  5. package/lib/api/api-pull-ui.js +1 -0
  6. package/lib/api/format-dataset.js +1 -0
  7. package/lib/api/generate-api-file.js +1 -0
  8. package/lib/api/main.js +1 -0
  9. package/lib/api/pull-silent.js +1 -0
  10. package/lib/api/pull.js +1 -0
  11. package/lib/api/types.js +1 -0
  12. package/lib/auth/auth-server-ui.js +1 -0
  13. package/lib/auth/auth-server.js +1 -0
  14. package/lib/auth/constant.js +1 -0
  15. package/lib/auth/get-cookie.js +1 -0
  16. package/lib/auth/is-session-valid.js +1 -0
  17. package/lib/auth/logout.js +1 -0
  18. package/lib/cli.js +2 -0
  19. package/lib/cmd/build-watch.js +1 -0
  20. package/lib/cmd/build.js +1 -0
  21. package/lib/cmd/logs.js +1 -0
  22. package/lib/cmd/preview.js +1 -0
  23. package/lib/cmd/start.js +1 -0
  24. package/lib/config/config-help.js +1 -0
  25. package/lib/config/main.js +1 -0
  26. package/lib/constant/domain.js +1 -0
  27. package/lib/constant/env.js +1 -0
  28. package/lib/create-app/enhanced-guided-create.js +1 -0
  29. package/lib/create-app/format-elapsed.js +1 -0
  30. package/lib/create-app/main.js +1 -0
  31. package/lib/create-app/task-finished.js +1 -0
  32. package/lib/create-app/task-loading.js +1 -0
  33. package/lib/create-app/task-running.js +1 -0
  34. package/lib/create-app/task-time.js +1 -0
  35. package/lib/create-app/use-copy-project-template.js +1 -0
  36. package/lib/create-app/use-format-code.js +1 -0
  37. package/lib/create-app/use-install-dependencies.js +1 -0
  38. package/lib/help.js +1 -0
  39. package/lib/utils/config.js +1 -0
  40. package/lib/utils/copy-directory.js +1 -0
  41. package/lib/utils/logger.js +1 -0
  42. package/lib/utils/router-updater.js +1 -0
  43. package/lib/utils/template-replacer.js +1 -0
  44. package/package.json +41 -0
  45. package/templates/README.md +115 -0
  46. package/templates/generate-api/api.ts.tpl +42 -0
  47. package/templates/generate-api/client.ts.tpl +64 -0
  48. package/templates/pages/blank/index.tsx.tpl +13 -0
  49. package/templates/pages/sdk-fetch/index.tsx.tpl +82 -0
  50. package/templates/projects/sub-app-react-demo/.prettierrc +1 -0
  51. package/templates/projects/sub-app-react-demo/.vscode/extensions.json +3 -0
  52. package/templates/projects/sub-app-react-demo/.vscode/settings.json +57 -0
  53. package/templates/projects/sub-app-react-demo/CHANGELOG.md +37 -0
  54. package/templates/projects/sub-app-react-demo/README.md +209 -0
  55. package/templates/projects/sub-app-react-demo/bun.lock +600 -0
  56. package/templates/projects/sub-app-react-demo/docs/API_RULE_CHANGE.md +212 -0
  57. package/templates/projects/sub-app-react-demo/docs/quick-start.md +526 -0
  58. package/templates/projects/sub-app-react-demo/index.html +39 -0
  59. package/templates/projects/sub-app-react-demo/package.json +34 -0
  60. package/templates/projects/sub-app-react-demo/public/vite.svg +1 -0
  61. package/templates/projects/sub-app-react-demo/src/api/api.ts +66 -0
  62. package/templates/projects/sub-app-react-demo/src/api/client.ts +63 -0
  63. package/templates/projects/sub-app-react-demo/src/components/ApiUrlDisplay.tsx +111 -0
  64. package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +116 -0
  65. package/templates/projects/sub-app-react-demo/src/main.tsx +48 -0
  66. package/templates/projects/sub-app-react-demo/src/pages/chart-fetch/index.tsx +137 -0
  67. package/templates/projects/sub-app-react-demo/src/pages/dashboard/index.tsx +572 -0
  68. package/templates/projects/sub-app-react-demo/src/pages/index.tsx +129 -0
  69. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +182 -0
  70. package/templates/projects/sub-app-react-demo/src/pages/table-display.tsx +130 -0
  71. package/templates/projects/sub-app-react-demo/src/router/index.tsx +30 -0
  72. package/templates/projects/sub-app-react-demo/src/style.css +47 -0
  73. package/templates/projects/sub-app-react-demo/src/utils/api.ts +12 -0
  74. package/templates/projects/sub-app-react-demo/src/vite-env.d.ts +2 -0
  75. package/templates/projects/sub-app-react-demo/tsconfig.json +26 -0
  76. package/templates/projects/sub-app-react-demo/vite.config.ts +88 -0
package/README.md ADDED
@@ -0,0 +1,28 @@
1
+ # lovrabet
2
+
3
+ ## 内部体验试用
4
+
5
+ ### 安装
6
+
7
+ ```bash
8
+ $ bun install --global @lovrabet/cli
9
+ ```
10
+
11
+
12
+
13
+ ```bash
14
+ $ npm install --global @lovrabet/cli
15
+
16
+ ```
17
+
18
+ ## 查看命令帮助
19
+
20
+ lovrabet --help
21
+
22
+ ## 试用目标
23
+
24
+ 1. 创建一个项目
25
+ 2. 创建一个页面
26
+ 3. 登录鉴权
27
+ 4. 绑定应用
28
+ 5. 生成数据集 api 文件
@@ -0,0 +1 @@
1
+ (function(_0x1e5230,_0x562407){const _0x32411a=a0_0x467e,_0x22ae19=_0x1e5230();while(!![]){try{const _0xb12019=parseInt(_0x32411a(0x7a))/0x1*(parseInt(_0x32411a(0x75))/0x2)+-parseInt(_0x32411a(0x74))/0x3*(parseInt(_0x32411a(0x73))/0x4)+-parseInt(_0x32411a(0x72))/0x5+-parseInt(_0x32411a(0x7f))/0x6+-parseInt(_0x32411a(0x7d))/0x7*(-parseInt(_0x32411a(0x7c))/0x8)+parseInt(_0x32411a(0x8a))/0x9*(parseInt(_0x32411a(0x84))/0xa)+-parseInt(_0x32411a(0x76))/0xb;if(_0xb12019===_0x562407)break;else _0x22ae19['push'](_0x22ae19['shift']());}catch(_0x47f191){_0x22ae19['push'](_0x22ae19['shift']());}}}(a0_0x22f0,0x3f34b));function a0_0x22f0(){const _0x5f5b84=['页面路径不合法','gray','startsWith','371830MVymqO','24YoucZQ','167307UleieO','743092xvsNSt','1210033JHIrVu','\x20直接回车确认,或输入自定义路由地址','red','column','1yzyzxr','split','2824952ofUTNd','7oihqLD','green','2712312zuslWf','路径不能包含连续的\x20/','路径中的每个段只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','delete','页面路径长度不能超过\x20100\x20个字符','5052610JWwAnv','页面路由地址:\x20','\x20已存在,请使用其他路径','includes','my-page','existsSync','9vPLmRZ','路径不能以\x20/\x20开头或结尾'];a0_0x22f0=function(){return _0x5f5b84;};return a0_0x22f0();}function a0_0x467e(_0xa377dd,_0x4040f8){const _0x22f042=a0_0x22f0();return a0_0x467e=function(_0x467e07,_0x5c1d99){_0x467e07=_0x467e07-0x72;let _0x3f0f00=_0x22f042[_0x467e07];return _0x3f0f00;},a0_0x467e(_0xa377dd,_0x4040f8);}import{jsx as a0_0x5f1b17,jsxs as a0_0xb51a28}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import a0_0xd35c4b from'node:fs';export function InputProjectCode(_0x179559){const _0x3421cb=a0_0x467e,{onSubmit:_0x35f247,pagePath:_0x452cda}=_0x179559,[_0x332c93,_0x125bb4]=useState(''),[_0x1389db,_0x454b2a]=useState(''),_0x178711=_0x3421cb(0x88);function _0x25faf5(_0x272b34){const _0x5d1222=_0x3421cb;if(_0x272b34['length']>0x64)return{'valid':![],'message':_0x5d1222(0x83)};if(_0x272b34[_0x5d1222(0x8e)]('/')||_0x272b34['endsWith']('/'))return{'valid':![],'message':_0x5d1222(0x8b)};if(_0x272b34[_0x5d1222(0x87)]('//'))return{'valid':![],'message':_0x5d1222(0x80)};const _0x528081=_0x272b34[_0x5d1222(0x7b)]('/');for(const _0x402bbf of _0x528081){if(!_0x402bbf)continue;const _0xb8db0c=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(!_0xb8db0c['test'](_0x402bbf))return{'valid':![],'message':_0x5d1222(0x81)};}return{'valid':!![]};}return useInput((_0x1e06c0,_0xcf9287)=>{const _0x3d3563=_0x3421cb;if(_0xcf9287['return']){const _0x5db97d=_0x332c93['trim']()||_0x178711;if(_0x1389db)return;const _0x4ad7f9=_0x452cda+'/'+_0x5db97d;if(a0_0xd35c4b[_0x3d3563(0x89)](_0x4ad7f9)){_0x454b2a('页面路径\x20'+_0x5db97d+_0x3d3563(0x86));return;}_0x35f247(_0x5db97d),_0x125bb4(''),_0x454b2a('');}else _0xcf9287['backspace']||_0xcf9287[_0x3d3563(0x82)]?_0x125bb4(_0xee6eeb=>{const _0x11b0c2=_0xee6eeb['slice'](0x0,-0x1),{valid:_0x3dd5e2,message:_0xad4f05}=_0x25faf5(_0x11b0c2);return _0x454b2a(_0x3dd5e2?'':_0xad4f05||'页面路径不合法'),_0x11b0c2;}):_0x125bb4(_0x36927f=>{const _0x275c1b=_0x3d3563,_0x19866c=_0x36927f+_0x1e06c0,{valid:_0x26d626,message:_0x49b3c0}=_0x25faf5(_0x19866c);return _0x454b2a(_0x26d626?'':_0x49b3c0||_0x275c1b(0x8c)),_0x19866c;});}),a0_0xb51a28(Box,{'flexDirection':_0x3421cb(0x79),'children':[a0_0xb51a28(Box,{'children':[a0_0x5f1b17(Text,{'color':'gray','children':'\x20Step2:\x20'}),a0_0x5f1b17(Text,{'children':_0x3421cb(0x85)}),_0x332c93?a0_0x5f1b17(Text,{'color':_0x3421cb(0x7e),'children':_0x332c93}):a0_0x5f1b17(Text,{'color':'gray','children':_0x178711}),_0x1389db&&a0_0xb51a28(Text,{'color':_0x3421cb(0x78),'children':['\x20←\x20',_0x1389db]})]}),!_0x1389db&&!_0x332c93&&a0_0x5f1b17(Box,{'children':a0_0x5f1b17(Text,{'color':_0x3421cb(0x8d),'children':_0x3421cb(0x77)})})]});}
@@ -0,0 +1 @@
1
+ function a1_0x2a81(_0x57531e,_0x5a06db){const _0x20ab3c=a1_0x20ab();return a1_0x2a81=function(_0x2a81c9,_0x412d67){_0x2a81c9=_0x2a81c9-0xce;let _0x12ce35=_0x20ab3c[_0x2a81c9];return _0x12ce35;},a1_0x2a81(_0x57531e,_0x5a06db);}const a1_0x200adb=a1_0x2a81;(function(_0x5be83c,_0x47748b){const _0x5941c1=a1_0x2a81,_0x31c686=_0x5be83c();while(!![]){try{const _0x20678a=parseInt(_0x5941c1(0xd9))/0x1*(-parseInt(_0x5941c1(0xe2))/0x2)+parseInt(_0x5941c1(0xe3))/0x3+-parseInt(_0x5941c1(0xf0))/0x4+-parseInt(_0x5941c1(0xec))/0x5+parseInt(_0x5941c1(0xf6))/0x6*(parseInt(_0x5941c1(0xdd))/0x7)+parseInt(_0x5941c1(0xe6))/0x8*(parseInt(_0x5941c1(0xd5))/0x9)+-parseInt(_0x5941c1(0xdc))/0xa*(-parseInt(_0x5941c1(0xf2))/0xb);if(_0x20678a===_0x47748b)break;else _0x31c686['push'](_0x31c686['shift']());}catch(_0x2a4f3a){_0x31c686['push'](_0x31c686['shift']());}}}(a1_0x20ab,0x1fe78));import{jsx as a1_0x511d2d,jsxs as a1_0x4d86a7,Fragment as a1_0x4bc256}from'react/jsx-runtime';import{fileURLToPath}from'node:url';import a1_0x403b54 from'node:path';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{SelectPageTemplate}from'./select-page-template.js';function a1_0x20ab(){const _0x13c331=['\x20Step1:\x20','页面添加失败:\x20','\x20*\x20页面创建成功!','72CRTqcR','join','dirname','add-page','951KTRRDS','finally','\x20*\x20页面路径:\x20','10TMrCqI','1460641mRgbyz','cwd','processTemplate','\x20Step2:\x20','green','482IynfYt','343248EQrqgH','src','开始添加页面:\x20','89104dcHijn','resolve','gray','setLogPath','url','then','765205mJLeHe','cyan','now','success','296032iJlJtN','info','1922107rJJKkW','message','pages','\x20*\x20路由地址:\x20','6eZaCVB','catch','已选择页面模板\x20','已输入的页面路由\x20','error'];a1_0x20ab=function(){return _0x13c331;};return a1_0x20ab();}import{InputProjectCode}from'./input-page-router.js';import{logger}from'../utils/logger.js';import{TemplateReplacer}from'../utils/template-replacer.js';const __dirname=a1_0x403b54[a1_0x200adb(0xd7)](fileURLToPath(import.meta[a1_0x200adb(0xea)])),pageTemplateDir=a1_0x403b54[a1_0x200adb(0xe7)](__dirname,'../../templates/pages'),projectDir=process[a1_0x200adb(0xde)]();export const AddPage=()=>{const _0x2ccbd8=a1_0x200adb,{exit:_0x12b119}=useApp(),[_0xbb903b,_0x409d4d]=useState(''),[_0x3c9124,_0x539738]=useState(''),[_0xf393e0,_0x1a5fdb]=useState(![]),[_0xa3a0a6,_0x56f87e]=useState(![]),_0x3a020c=a1_0x403b54[_0x2ccbd8(0xd6)](projectDir,_0x2ccbd8(0xe4),_0x2ccbd8(0xf4)),_0x1b3f0c=a1_0x403b54[_0x2ccbd8(0xd6)](_0x3a020c,_0x3c9124),_0x3627dd=a1_0x403b54['join'](_0x2ccbd8(0xe4),_0x2ccbd8(0xf4),_0x3c9124);useEffect(()=>{const _0x35a2ea=_0x2ccbd8,_0x124d6a=a1_0x403b54[_0x35a2ea(0xe7)](pageTemplateDir,_0xbb903b);if(_0xbb903b&&_0x3c9124){_0x1a5fdb(!![]),logger[_0x35a2ea(0xe9)](process[_0x35a2ea(0xde)]());const _0x11d0b4=Date['now']();logger[_0x35a2ea(0xf1)](_0x35a2ea(0xd8),_0x35a2ea(0xe5)+_0x3c9124,{'template':_0xbb903b,'targetPath':_0x3627dd}),TemplateReplacer[_0x35a2ea(0xdf)](_0x124d6a,a1_0x403b54[_0x35a2ea(0xd6)](_0x3a020c,_0x3c9124),_0x3c9124,_0xbb903b)[_0x35a2ea(0xeb)](()=>{const _0x44b4a4=_0x35a2ea,_0x2befd1=Date[_0x44b4a4(0xee)]()-_0x11d0b4;logger[_0x44b4a4(0xef)]('add-page','页面添加成功:\x20'+_0x3c9124,_0x2befd1,{'template':_0xbb903b,'targetPath':_0x3627dd,'routePath':_0x3c9124}),_0x56f87e(!![]);})[_0x35a2ea(0xce)](_0x3740c1=>{const _0x5024fc=_0x35a2ea,_0x1152c3=Date[_0x5024fc(0xee)]()-_0x11d0b4;logger[_0x5024fc(0xd1)](_0x5024fc(0xd8),_0x5024fc(0xd3)+_0x3c9124,{'template':_0xbb903b,'targetPath':_0x3627dd,'error':_0x3740c1 instanceof Error?_0x3740c1[_0x5024fc(0xf3)]:String(_0x3740c1),'duration':_0x1152c3});})[_0x35a2ea(0xda)](()=>{_0x1a5fdb(![]);});}},[_0xbb903b,_0x3c9124]),useEffect(()=>{_0xa3a0a6&&setTimeout(()=>{_0x12b119();});},[_0xa3a0a6]);if(_0xbb903b)return a1_0x4d86a7(Box,{'flexDirection':'column','paddingY':0x1,'children':[a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xd2)}),a1_0x511d2d(Text,{'children':_0x2ccbd8(0xcf)}),a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe1),'children':_0xbb903b})]}),_0x3c9124?a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xe0)}),a1_0x511d2d(Text,{'children':_0x2ccbd8(0xd0)}),a1_0x511d2d(Text,{'color':'green','children':_0x3c9124})]}):a1_0x511d2d(InputProjectCode,{'pagePath':_0x1b3f0c,'onSubmit':_0x539738}),_0x3c9124&&_0xf393e0?a1_0x4d86a7(Box,{'marginTop':0x1,'children':[a1_0x511d2d(Box,{'width':'4'}),a1_0x511d2d(Text,{'children':'正在创建页面,请稍候…'})]}):null,_0xa3a0a6?a1_0x4d86a7(a1_0x4bc256,{'children':[a1_0x511d2d(Box,{'marginTop':0x1,'children':a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xd4)})}),a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xdb)}),a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe1),'children':_0x3627dd})]}),a1_0x4d86a7(Box,{'children':[a1_0x511d2d(Text,{'color':_0x2ccbd8(0xe8),'children':_0x2ccbd8(0xf5)}),a1_0x4d86a7(Text,{'color':_0x2ccbd8(0xe1),'children':['/',_0x3c9124]})]}),a1_0x511d2d(Box,{'marginTop':0x1,'children':a1_0x511d2d(Text,{'color':_0x2ccbd8(0xed),'children':'\x20*\x20页面文件已创建,可直接通过路由访问'})})]}):null]});return a1_0x511d2d(SelectPageTemplate,{'onSelect':_0x409d4d});};
@@ -0,0 +1 @@
1
+ (function(_0x16fa14,_0x3154ce){const _0x59033a=a2_0x5d7d,_0x293aea=_0x16fa14();while(!![]){try{const _0x58f667=-parseInt(_0x59033a(0x157))/0x1+-parseInt(_0x59033a(0x153))/0x2+-parseInt(_0x59033a(0x148))/0x3+-parseInt(_0x59033a(0x154))/0x4*(-parseInt(_0x59033a(0x152))/0x5)+-parseInt(_0x59033a(0x15d))/0x6*(-parseInt(_0x59033a(0x149))/0x7)+parseInt(_0x59033a(0x162))/0x8+-parseInt(_0x59033a(0x144))/0x9;if(_0x58f667===_0x3154ce)break;else _0x293aea['push'](_0x293aea['shift']());}catch(_0x24a20e){_0x293aea['push'](_0x293aea['shift']());}}}(a2_0x526d,0xcb21b));function a2_0x5d7d(_0x33c30b,_0x9fb3b6){const _0x526d23=a2_0x526d();return a2_0x5d7d=function(_0x5d7df8,_0x577a54){_0x5d7df8=_0x5d7df8-0x143;let _0xbcdc7d=_0x526d23[_0x5d7df8];return _0xbcdc7d;},a2_0x5d7d(_0x33c30b,_0x9fb3b6);}import{jsx as a2_0x21c279,jsxs as a2_0x30c003}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Text,Box,useInput}from'ink';import{readdir}from'node:fs/promises';import a2_0x52488f from'node:path';import{fileURLToPath}from'node:url';async function getTemplateList(){const _0x206c2c=a2_0x5d7d;try{const _0x14f921=fileURLToPath(import.meta[_0x206c2c(0x15b)]),_0x1fb033=a2_0x52488f[_0x206c2c(0x15c)](a2_0x52488f[_0x206c2c(0x15f)](_0x14f921),_0x206c2c(0x14d)),_0x913662=a2_0x52488f[_0x206c2c(0x14a)](_0x1fb033,_0x206c2c(0x15e)),_0x4d0e14=await readdir(_0x913662,{'withFileTypes':!![]}),_0x34cc44=_0x4d0e14['filter'](_0x2a50db=>_0x2a50db[_0x206c2c(0x151)]())[_0x206c2c(0x14c)](_0x59dd0d=>({'label':_0x59dd0d[_0x206c2c(0x145)]}))['sort']((_0x7cb155,_0x49fe9d)=>_0x7cb155['label']['localeCompare'](_0x49fe9d[_0x206c2c(0x155)]));return _0x34cc44;}catch(_0x14b07b){return console[_0x206c2c(0x160)](_0x206c2c(0x158),_0x14b07b),[{'label':_0x206c2c(0x15a)},{'label':_0x206c2c(0x147)}];}}export function SelectPageTemplate(_0x461fea){const _0x43dc75=a2_0x5d7d,[_0x4e53b9,_0x3bd1db]=useState(0x0),[_0xe0c482,_0x36a3d0]=useState([]),[_0x3b0a06,_0x2c4bb8]=useState(!![]);useEffect(()=>{async function _0x80fcc2(){const _0x232a7b=await getTemplateList();_0x36a3d0(_0x232a7b),_0x2c4bb8(![]);}_0x80fcc2();},[]),useInput((_0x39e591,_0x19771c)=>{const _0x4c559d=a2_0x5d7d;if(_0x3b0a06)return;if(_0x19771c[_0x4c559d(0x150)]){const _0x2671c8=_0xe0c482[_0x4e53b9];_0x2671c8&&_0x461fea[_0x4c559d(0x143)](_0x2671c8[_0x4c559d(0x155)]);}_0x19771c[_0x4c559d(0x161)]&&_0x3bd1db(_0x5bee51=>_0x5bee51===0x0?_0xe0c482['length']-0x1:_0x5bee51-0x1),_0x19771c[_0x4c559d(0x156)]&&_0x3bd1db(_0x17a9cb=>_0x17a9cb===_0xe0c482['length']-0x1?0x0:_0x17a9cb+0x1);});if(_0x3b0a06)return a2_0x21c279(Box,{'flexDirection':_0x43dc75(0x14f),'paddingY':0x1,'children':a2_0x30c003(Box,{'children':[a2_0x21c279(Text,{'color':'gray','children':'\x20Step1:\x20'}),a2_0x21c279(Text,{'children':_0x43dc75(0x14b)})]})});return a2_0x30c003(Box,{'flexDirection':_0x43dc75(0x14f),'paddingY':0x1,'children':[a2_0x30c003(Box,{'children':[a2_0x21c279(Text,{'color':_0x43dc75(0x159),'children':'\x20Step1:\x20'}),a2_0x21c279(Text,{'children':'请选择您要创建的页面模板'})]}),_0xe0c482[_0x43dc75(0x14c)]((_0xf3113f,_0x5f4e9c)=>{const _0x3b1286=_0x43dc75,_0x456b19=_0x5f4e9c===_0x4e53b9,_0x1c7c39=_0x456b19?_0x3b1286(0x146)+_0xf3113f[_0x3b1286(0x155)]:_0x3b1286(0x14e)+_0xf3113f[_0x3b1286(0x155)];return a2_0x21c279(Box,{'children':a2_0x21c279(Text,{'color':_0x456b19?'green':undefined,'children':_0x1c7c39})},_0x1c7c39);})]});}function a2_0x526d(){const _0x75e28=['url','resolve','18QgPOvu','templates/pages','dirname','error','upArrow','9312488JJLEGd','onSelect','3888864XDrOhw','name','\x20\x20\x20\x20\x20\x20>\x20','sdk-fetch','193011ckwOAU','3097283yxCUfS','join','正在加载页面模板...','map','../..','\x20\x20\x20\x20\x20\x20\x20\x20','column','return','isDirectory','144665qMAqYD','943018ukpUXE','92axlydb','label','downArrow','1356958ZdqEaT','获取模板列表失败:','gray','blank'];a2_0x526d=function(){return _0x75e28;};return a2_0x526d();}
@@ -0,0 +1 @@
1
+ (function(_0x4b9e76,_0x5dccd8){const _0x4c0a8f=a3_0x108a,_0x44474e=_0x4b9e76();while(!![]){try{const _0x1e89af=parseInt(_0x4c0a8f(0x178))/0x1+-parseInt(_0x4c0a8f(0x188))/0x2*(parseInt(_0x4c0a8f(0x176))/0x3)+-parseInt(_0x4c0a8f(0x195))/0x4*(parseInt(_0x4c0a8f(0x19a))/0x5)+-parseInt(_0x4c0a8f(0x180))/0x6*(parseInt(_0x4c0a8f(0x18d))/0x7)+-parseInt(_0x4c0a8f(0x182))/0x8*(parseInt(_0x4c0a8f(0x186))/0x9)+parseInt(_0x4c0a8f(0x196))/0xa*(parseInt(_0x4c0a8f(0x1ac))/0xb)+parseInt(_0x4c0a8f(0x192))/0xc*(parseInt(_0x4c0a8f(0x171))/0xd);if(_0x1e89af===_0x5dccd8)break;else _0x44474e['push'](_0x44474e['shift']());}catch(_0x5423d0){_0x44474e['push'](_0x44474e['shift']());}}}(a3_0xd038,0x2a26c));import{jsx as a3_0x11d652,jsxs as a3_0x4b62ba}from'react/jsx-runtime';import{useEffect,useState}from'react';import{Box,Text,useApp}from'ink';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';function a3_0x108a(_0x3cea62,_0x3ff26d){const _0xd0389c=a3_0xd038();return a3_0x108a=function(_0x108a2a,_0x43277d){_0x108a2a=_0x108a2a-0x16d;let _0x5c4a46=_0xd0389c[_0x108a2a];return _0x5c4a46;},a3_0x108a(_0x3cea62,_0x3ff26d);}import{getApiDomain}from'../constant/domain.js';function a3_0xd038(){const _0x3c1447=['\x20-\x20客户端实例文件','1071aqPdXK','import\x20','message','√\x20API\x20文件生成成功!','text','336eNodIl','error','&pageSize=999&currentPage=1','12oGrbbn','10mgmJqh','src/api/','gray','cyan','384760yWCkxo','\x20from\x20\x27@/api/','yellow','dim','.ts','💡\x20请使用\x20','\x20-\x20模型配置文件','api','api-pull','white','app','-api','*\x20将生成文件:\x20','{\x20lovrabetClient\x20}','cwd','使用配置的应用AppCode:\x20','/smartapi/dataset/getList?appCode=','status','345081dOxRlV',',且无法读取错误响应内容','includes','使用指定的应用AppCode:\x20','json','success','413101JpNkda','setLogPath','join','\x20重新登录后再试','replace','1821MpoZIU','green','33023kuMSkd','client','🚀\x20正在从服务器拉取\x20API\x20配置...','slice','登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录','拉取\x20API\x20配置失败:\x20','column','red','12606pnVnat','未提供应用AppCode,且配置中也没有默认值','580664APiFcs','获取数据集失败,HTTP状态码:\x20','*\x20导入方式:','data','9qDfpuK','lovrabet\x20auth','516orpBBr','url','tableData','-client'];a3_0xd038=function(){return _0x3c1447;};return a3_0xd038();}import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';export const ApiPullUI=({appCode:_0x4f53c9})=>{const _0x3afa64=a3_0x108a,{exit:_0x2dfd8c}=useApp(),[_0x4619d0,_0x395460]=useState(![]),[_0x521af4,_0x3be2de]=useState(![]),[_0x106cfe,_0x26be5c]=useState(null),[_0x31c455,_0x3bbbe7]=useState(null),_0x584744=readConfig(),_0x264e14=_0x4f53c9||_0x584744?.[_0x3afa64(0x1a4)],_0x2a6fef=_0x4f53c9&&_0x4f53c9[_0x3afa64(0x16d)]('-')?_0x4f53c9['split']('-')[_0x3afa64(0x17b)](0x1)[_0x3afa64(0x173)]('-'):'',_0x5c5c0f=_0x4f53c9?_0x3afa64(0x16e)+_0x264e14:_0x3afa64(0x1a9)+_0x264e14,_0x1ca6c8=_0x2a6fef?_0x2a6fef+_0x3afa64(0x1a5):_0x3afa64(0x1a1),_0x49963c=_0x2a6fef?_0x2a6fef+_0x3afa64(0x18b):_0x3afa64(0x179);useEffect(()=>{_0x395460(!![]),_0x35f3b2();},[]),useEffect(()=>{(_0x521af4||_0x106cfe)&&_0x2dfd8c();},[_0x521af4,_0x106cfe,_0x2dfd8c]);async function _0x35f3b2(){const _0x1a9750=_0x3afa64;if(!_0x264e14){_0x26be5c(_0x1a9750(0x181));return;}try{logger[_0x1a9750(0x172)](process[_0x1a9750(0x1a8)]());const _0xbde337=await fetch(getApiDomain()+_0x1a9750(0x1aa)+_0x264e14+_0x1a9750(0x194),{'headers':{'Cookie':getCookie()}});if(_0xbde337['ok']){const _0x2e2536=await _0xbde337[_0x1a9750(0x16f)]();if(_0x2e2536[_0x1a9750(0x170)]){const _0x85902c=!_0x4f53c9;await generateApiFile(_0x2e2536[_0x1a9750(0x185)][_0x1a9750(0x18a)],_0x2a6fef,_0x264e14,_0x85902c),_0x3bbbe7({'api':'src/api/'+_0x1ca6c8+_0x1a9750(0x19e),'client':'src/api/'+_0x49963c+'.ts'}),_0x3be2de(!![]);}}else{if(_0xbde337['status']===0x191){const _0x6b8573=_0x1a9750(0x17c);logger[_0x1a9750(0x193)](_0x1a9750(0x1a2),_0x6b8573,{'status':_0xbde337['status'],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)]}),_0x26be5c(_0x6b8573);}else{const _0x1fd4c9=_0x1a9750(0x183)+_0xbde337[_0x1a9750(0x1ab)];try{const _0x875417=await _0xbde337[_0x1a9750(0x191)]();_0x875417?logger['error'](_0x1a9750(0x1a2),_0x1fd4c9,{'status':_0xbde337[_0x1a9750(0x1ab)],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)],'errorBody':_0x875417}):logger[_0x1a9750(0x193)](_0x1a9750(0x1a2),_0x1fd4c9,{'status':_0xbde337['status'],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)]});}catch(_0x5b1e09){logger[_0x1a9750(0x193)](_0x1a9750(0x1a2),_0x1fd4c9+_0x1a9750(0x1ad),{'status':_0xbde337[_0x1a9750(0x1ab)],'appCode':_0x264e14,'url':_0xbde337[_0x1a9750(0x189)],'readError':_0x5b1e09 instanceof Error?_0x5b1e09[_0x1a9750(0x18f)]:String(_0x5b1e09)});}_0x26be5c(_0x1fd4c9);}}}catch(_0x122cd6){const _0x3157a1=_0x122cd6 instanceof Error?_0x122cd6['message']:String(_0x122cd6);_0x26be5c(_0x1a9750(0x17d)+_0x3157a1);}finally{_0x395460(![]);}}return a3_0x4b62ba(Box,{'flexDirection':_0x3afa64(0x17e),'children':[a3_0x4b62ba(Box,{'children':[a3_0x11d652(Text,{'color':'gray','children':'*\x20'}),a3_0x11d652(Text,{'color':_0x4f53c9?_0x3afa64(0x1a3):_0x3afa64(0x19d),'children':_0x5c5c0f})]}),a3_0x4b62ba(Box,{'children':[a3_0x11d652(Text,{'color':_0x3afa64(0x198),'children':_0x3afa64(0x1a6)}),a3_0x4b62ba(Text,{'color':'cyan','children':[_0x1ca6c8,_0x3afa64(0x19e)]}),a3_0x11d652(Text,{'color':_0x3afa64(0x19d),'children':'\x20和\x20'}),a3_0x4b62ba(Text,{'color':_0x3afa64(0x199),'children':[_0x49963c,_0x3afa64(0x19e)]})]}),_0x4619d0&&a3_0x11d652(Box,{'children':a3_0x11d652(Text,{'children':_0x3afa64(0x17a)})}),_0x521af4&&_0x31c455&&a3_0x4b62ba(Box,{'flexDirection':'column','children':[a3_0x11d652(Box,{'children':a3_0x11d652(Text,{'color':_0x3afa64(0x177),'children':_0x3afa64(0x190)})}),a3_0x11d652(Box,{'marginTop':0x1,'children':a3_0x11d652(Text,{'color':_0x3afa64(0x198),'children':'*\x20已生成文件:'})}),a3_0x4b62ba(Box,{'marginLeft':0x2,'children':[a3_0x4b62ba(Text,{'color':_0x3afa64(0x199),'children':['•\x20',_0x31c455['api']]}),a3_0x11d652(Text,{'color':_0x3afa64(0x19d),'children':_0x3afa64(0x1a0)})]}),a3_0x4b62ba(Box,{'marginLeft':0x2,'children':[a3_0x4b62ba(Text,{'color':_0x3afa64(0x199),'children':['•\x20',_0x31c455[_0x3afa64(0x179)]]}),a3_0x11d652(Text,{'color':_0x3afa64(0x19d),'children':_0x3afa64(0x18c)})]}),a3_0x11d652(Box,{'marginTop':0x1,'children':a3_0x11d652(Text,{'color':_0x3afa64(0x198),'children':_0x3afa64(0x184)})}),a3_0x11d652(Box,{'marginLeft':0x2,'children':a3_0x4b62ba(Text,{'color':_0x3afa64(0x19c),'children':[_0x3afa64(0x18e),_0x3afa64(0x1a7),_0x3afa64(0x19b),_0x31c455['client'][_0x3afa64(0x175)](_0x3afa64(0x197),'')[_0x3afa64(0x175)](_0x3afa64(0x19e),''),'\x27']})})]}),_0x106cfe&&a3_0x4b62ba(Box,{'flexDirection':_0x3afa64(0x17e),'children':[a3_0x11d652(Box,{'children':a3_0x4b62ba(Text,{'color':_0x3afa64(0x17f),'children':['❌\x20',_0x106cfe]})}),_0x106cfe[_0x3afa64(0x16d)]('登录')&&a3_0x4b62ba(Box,{'marginTop':0x1,'children':[a3_0x11d652(Text,{'color':_0x3afa64(0x19c),'children':_0x3afa64(0x19f)}),a3_0x11d652(Text,{'color':'cyan','children':_0x3afa64(0x187)}),a3_0x11d652(Text,{'color':_0x3afa64(0x19c),'children':_0x3afa64(0x174)})]})]})]});};
@@ -0,0 +1 @@
1
+ (function(_0x20a520,_0x549d0e){const _0x111624=a4_0x532d,_0x28c4cb=_0x20a520();while(!![]){try{const _0x1001f2=-parseInt(_0x111624(0x98))/0x1+parseInt(_0x111624(0x9d))/0x2*(parseInt(_0x111624(0x9e))/0x3)+-parseInt(_0x111624(0xab))/0x4*(-parseInt(_0x111624(0x97))/0x5)+parseInt(_0x111624(0xac))/0x6+parseInt(_0x111624(0xa9))/0x7*(-parseInt(_0x111624(0x99))/0x8)+-parseInt(_0x111624(0xa8))/0x9*(-parseInt(_0x111624(0x96))/0xa)+-parseInt(_0x111624(0xa7))/0xb*(parseInt(_0x111624(0x95))/0xc);if(_0x1001f2===_0x549d0e)break;else _0x28c4cb['push'](_0x28c4cb['shift']());}catch(_0x1327a5){_0x28c4cb['push'](_0x28c4cb['shift']());}}}(a4_0x27c1,0xc9d54));export function formatDataset(_0x58eb16){const _0x10d746=a4_0x532d,_0x15514c=_0x58eb16['filter'](_0x59e1b0=>_0x59e1b0[_0x10d746(0x9a)]),_0x291337=_0x58eb16['filter'](_0x1a1ac9=>!_0x1a1ac9[_0x10d746(0x9a)]),_0x456f88=new Map();_0x15514c[_0x10d746(0x9b)](_0x4f9687=>{const _0x4ddc07=_0x10d746,_0x124386=_0x4f9687['dbtableConfig'][_0x4ddc07(0xa1)],_0x50a290=_0x456f88[_0x4ddc07(0xad)](_0x124386);(!_0x50a290||_0x4f9687['id']>_0x50a290['id'])&&_0x456f88[_0x4ddc07(0xb0)](_0x124386,_0x4f9687);});const _0x328dbe=Array[_0x10d746(0xaa)](_0x456f88['values']())[_0x10d746(0xa4)](_0x460029=>{const _0x299f1d=_0x10d746,_0x35ee0b=snakeToCamel(_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa1)]);return{'id':_0x460029['id'],'name':_0x460029[_0x299f1d(0xae)],'code':_0x460029[_0x299f1d(0xa2)],'tableName':_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa1)],'apiFucName':_0x35ee0b?_0x35ee0b+_0x299f1d(0xa0):'dataset'+_0x460029[_0x299f1d(0xa2)]+'Api','pkField':_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa6)],'allFields':_0x460029[_0x299f1d(0x9a)][_0x299f1d(0xa3)][_0x299f1d(0xa5)](',')};}),_0x1005a4=_0x291337[_0x10d746(0xa4)](_0x1cccea=>{const _0x3d172e=_0x10d746,_0x3c9aeb=_0x3d172e(0x9c)+_0x1cccea[_0x3d172e(0xa2)],_0x22942b=snakeToCamel(_0x3c9aeb);return{'id':_0x1cccea['id'],'name':_0x1cccea[_0x3d172e(0xae)],'code':_0x1cccea[_0x3d172e(0xa2)],'tableName':_0x3c9aeb,'apiFucName':_0x22942b?_0x22942b+'Api':_0x3d172e(0xaf)+_0x1cccea[_0x3d172e(0xa2)]+'Api','pkField':undefined,'allFields':[]};});return[..._0x328dbe,..._0x1005a4];}function a4_0x532d(_0x4171c4,_0x3a7cd5){const _0x27c1bd=a4_0x27c1();return a4_0x532d=function(_0x532d91,_0x515b06){_0x532d91=_0x532d91-0x95;let _0x1f5ca1=_0x27c1bd[_0x532d91];return _0x1f5ca1;},a4_0x532d(_0x4171c4,_0x3a7cd5);}function a4_0x27c1(){const _0xb76743=['code','allFields','map','split','pkField','3275261fjeXax','3413655QrKgZQ','189AVYRoC','from','56812nPnzRD','9051570lBtIAF','get','name','dataset','set','132YVfQty','40ZusHvQ','230dtiPAH','760192IllHoW','63272NisyIm','dbtableConfig','forEach','dataset_','3046wROpET','2751KMJIig','trim','Api','tableName'];a4_0x27c1=function(){return _0xb76743;};return a4_0x27c1();}function snakeToCamel(_0x5d178e){const _0x5757ec=a4_0x532d;if(!_0x5d178e)return _0x5d178e;const _0x18952f=_0x5d178e[_0x5757ec(0x9f)]();return _0x18952f['replace'](/_([a-zA-Z0-9])/g,(_0x2047f7,_0x36d6ff)=>_0x36d6ff['toUpperCase']());}
@@ -0,0 +1 @@
1
+ (function(_0x4ba014,_0x270288){const _0x2be778=a5_0xbbad,_0x2480fa=_0x4ba014();while(!![]){try{const _0x261313=-parseInt(_0x2be778(0xb7))/0x1*(-parseInt(_0x2be778(0x92))/0x2)+-parseInt(_0x2be778(0x90))/0x3+parseInt(_0x2be778(0xbc))/0x4*(parseInt(_0x2be778(0x9b))/0x5)+-parseInt(_0x2be778(0xb8))/0x6+-parseInt(_0x2be778(0x97))/0x7+-parseInt(_0x2be778(0xab))/0x8*(parseInt(_0x2be778(0x98))/0x9)+parseInt(_0x2be778(0xb5))/0xa;if(_0x261313===_0x270288)break;else _0x2480fa['push'](_0x2480fa['shift']());}catch(_0x17bb17){_0x2480fa['push'](_0x2480fa['shift']());}}}(a5_0x5e56,0x4dea0));function a5_0xbbad(_0x68d0b8,_0x1c2064){const _0x5e56ef=a5_0x5e56();return a5_0xbbad=function(_0xbbad0b,_0x1a8fd5){_0xbbad0b=_0xbbad0b-0x8f;let _0x3af880=_0x5e56ef[_0xbbad0b];return _0x3af880;},a5_0xbbad(_0x68d0b8,_0x1c2064);}import a5_0x5981b9 from'prettier';import{mkdirSync,writeFileSync,readFileSync}from'node:fs';function a5_0x5e56(){const _0x43cd58=['utf8','src/api/','url','23124Vaduoc','dirname','919113qzySRa','*\x20已生成文件:','1266GpAnLw','*\x20API配置\x20apiConfigName\x20:\x20','CONFIG_NAMES.DEFAULT','请先通过\x20`lovrabet\x20config\x20set\x20app\x20<value>`\x20配置应用\x20Code','success','2141034cACTDT','423PDOcJz','typescript','\x20\x20\x20•\x20','60qeFiMw','length','charAt','\x20-\x20模型配置文件\x20(','tableName','toUpperCase','keys','src/api','replace','log','client','format','replaceApiContent','app','../..','slice','79952xtRMMw','forEach','resolve','templates/generate-api','.ts','\x20个模型)','*\x20可以开始使用:\x20import\x20{\x20lovrabetClient\x20}\x20from\x20\x27@/api/','init-api','join','-client','11961240GgkErk','api','656NGGNGY','1677942hXnbYn'];a5_0x5e56=function(){return _0x43cd58;};return a5_0x5e56();}import a5_0x478809 from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{formatDataset}from'./format-dataset.js';import{TemplateReplacer}from'../utils/template-replacer.js';import{logger}from'../utils/logger.js';export async function generateApiFile(_0x467efe,_0x1b8d4a='',_0x48bae1,_0xac6723=![]){const _0x2a5752=a5_0xbbad,_0x483544=readConfig(),_0x59c78e=_0x48bae1||_0x483544?.[_0x2a5752(0xa8)];if(typeof _0x59c78e!=='string'||!_0x59c78e)throw new Error(_0x2a5752(0x95));const _0x5eab6b=_0xac6723?_0x2a5752(0x94):'\x22'+_0x59c78e+'\x22',_0xaa38d6=_0xac6723?'':'\x22'+_0x59c78e+'\x22',_0x1fd12c=_0x1b8d4a?_0x1b8d4a+'-api':_0x2a5752(0xb6),_0x36ffc5=_0x1b8d4a?_0x1b8d4a+_0x2a5752(0xb4):_0x2a5752(0xa5),_0x4f7f76=formatDataset(_0x467efe),_0x40ca65={};_0x4f7f76[_0x2a5752(0xac)](_0x235fac=>{const _0x3d4d2b=_0x2a5752,_0x3a0ebc=_0x235fac['apiFucName'][_0x3d4d2b(0xa3)](/Api$/,''),_0x486b23=_0x3a0ebc[_0x3d4d2b(0x9d)](0x0)[_0x3d4d2b(0xa0)]()+_0x3a0ebc[_0x3d4d2b(0xaa)](0x1);_0x40ca65[_0x486b23]={'tableName':_0x235fac[_0x3d4d2b(0x9f)],'datasetId':_0x235fac['code']};});const _0x9ecfef=fileURLToPath(import.meta[_0x2a5752(0xbb)]),_0x21c3a8=a5_0x478809[_0x2a5752(0xad)](a5_0x478809[_0x2a5752(0x8f)](_0x9ecfef),_0x2a5752(0xa9)),_0x3fa488=a5_0x478809[_0x2a5752(0xb3)](_0x21c3a8,_0x2a5752(0xae)),_0x18fd17=a5_0x478809[_0x2a5752(0xb3)](_0x3fa488,'api.ts.tpl'),_0x33bec3=a5_0x478809['join'](_0x3fa488,'client.ts.tpl');mkdirSync(_0x2a5752(0xa2),{'recursive':!![]});const _0x1e75cb=readFileSync(_0x18fd17,_0x2a5752(0xb9)),_0x9b40eb=TemplateReplacer[_0x2a5752(0xa7)](_0x1e75cb,_0x59c78e,_0x40ca65,Object['keys'](_0x40ca65)[0x0],_0x1fd12c,_0x5eab6b),_0x1cd61c=await a5_0x5981b9[_0x2a5752(0xa6)](_0x9b40eb,{'parser':_0x2a5752(0x99)}),_0x33aad4='src/api/'+_0x1fd12c+_0x2a5752(0xaf);writeFileSync(_0x33aad4,_0x1cd61c,{'encoding':_0x2a5752(0xb9)});const _0x3787a2=readFileSync(_0x33bec3,_0x2a5752(0xb9)),_0x1457cb=TemplateReplacer[_0x2a5752(0xa7)](_0x3787a2,_0x59c78e,_0x40ca65,Object[_0x2a5752(0xa1)](_0x40ca65)[0x0],_0x1fd12c,_0x5eab6b,_0xaa38d6),_0x43bcc5=await a5_0x5981b9['format'](_0x1457cb,{'parser':_0x2a5752(0x99)}),_0x390326=_0x2a5752(0xba)+_0x36ffc5+_0x2a5752(0xaf);writeFileSync(_0x390326,_0x43bcc5,{'encoding':'utf8'}),logger[_0x2a5752(0x96)](_0x2a5752(0xb2),'API\x20文件生成成功!'),console[_0x2a5752(0xa4)](_0x2a5752(0x91)),console[_0x2a5752(0xa4)]('\x20\x20\x20•\x20'+_0x33aad4+_0x2a5752(0x9e)+Object['keys'](_0x40ca65)[_0x2a5752(0x9c)]+_0x2a5752(0xb0)),console[_0x2a5752(0xa4)](_0x2a5752(0x9a)+_0x390326+'\x20-\x20客户端实例文件'),console['log'](_0x2a5752(0x93)+_0x5eab6b),console[_0x2a5752(0xa4)](_0x2a5752(0xb1)+_0x36ffc5+'\x27');}
@@ -0,0 +1 @@
1
+ (function(_0x5eb058,_0x175b0e){const _0x2188d4=a6_0x4073,_0x58b11f=_0x5eb058();while(!![]){try{const _0x20e15c=parseInt(_0x2188d4(0x18f))/0x1*(-parseInt(_0x2188d4(0x19a))/0x2)+parseInt(_0x2188d4(0x198))/0x3+-parseInt(_0x2188d4(0x192))/0x4*(-parseInt(_0x2188d4(0x18d))/0x5)+-parseInt(_0x2188d4(0x199))/0x6+parseInt(_0x2188d4(0x18c))/0x7+parseInt(_0x2188d4(0x190))/0x8+-parseInt(_0x2188d4(0x195))/0x9*(parseInt(_0x2188d4(0x18e))/0xa);if(_0x20e15c===_0x175b0e)break;else _0x58b11f['push'](_0x58b11f['shift']());}catch(_0x246a53){_0x58b11f['push'](_0x58b11f['shift']());}}}(a6_0x6f48,0x73ec8));import{jsx as a6_0x33f040}from'react/jsx-runtime';function a6_0x4073(_0x3209f0,_0x1f7230){const _0x6f485c=a6_0x6f48();return a6_0x4073=function(_0x40738c,_0x19a72f){_0x40738c=_0x40738c-0x18b;let _0x463e8f=_0x6f485c[_0x40738c];return _0x463e8f;},a6_0x4073(_0x3209f0,_0x1f7230);}import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';function a6_0x6f48(){const _0x5c0d8d=['119576BzALWa','\x20\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件','6414877JYiGSR','222895BqTaLP','10623480XnWvCQ','7bXuvRo','1819744lPNmjj','input','64oacbmk','pull','\x20\x20\x20\x20app-code:\x20可选的应用AppCode,不指定则使用配置的默认值','9XIGFrN','exit','log','1352622jzDhus','2113974dUHWYs'];a6_0x6f48=function(){return _0x5c0d8d;};return a6_0x6f48();}export async function apiCli(_0x269840){const _0x3730fa=a6_0x4073,_0x387b92=_0x269840[_0x3730fa(0x191)][0x1];if(_0x387b92===_0x3730fa(0x193)){const _0x55e2a2=_0x269840['input'][0x2];render(a6_0x33f040(ApiPullUI,{'appCode':_0x55e2a2}));}else console['error']('Unknown\x20api\x20command:\x20'+_0x387b92),console[_0x3730fa(0x197)]('Available\x20commands:'),console[_0x3730fa(0x197)](_0x3730fa(0x18b)),console[_0x3730fa(0x197)](_0x3730fa(0x194)),process[_0x3730fa(0x196)](0x1);}
@@ -0,0 +1 @@
1
+ (function(_0x43a5e7,_0x26148a){const _0x56322f=a7_0x2365,_0x638905=_0x43a5e7();while(!![]){try{const _0x38c656=parseInt(_0x56322f(0xf9))/0x1+-parseInt(_0x56322f(0xfb))/0x2*(-parseInt(_0x56322f(0xee))/0x3)+parseInt(_0x56322f(0xed))/0x4+-parseInt(_0x56322f(0xf2))/0x5+parseInt(_0x56322f(0xd6))/0x6*(parseInt(_0x56322f(0xdd))/0x7)+-parseInt(_0x56322f(0xe8))/0x8*(-parseInt(_0x56322f(0xe3))/0x9)+parseInt(_0x56322f(0xdf))/0xa*(-parseInt(_0x56322f(0xe4))/0xb);if(_0x38c656===_0x26148a)break;else _0x638905['push'](_0x638905['shift']());}catch(_0x44c805){_0x638905['push'](_0x638905['shift']());}}}(a7_0xd9ff,0x64f9e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';function a7_0xd9ff(){const _0x12e2c1=['success','*\x20正在从服务器拉取\x20API\x20配置...','cwd','773010KoyEsv','error','54AgAXzh','*\x20正在处理\x20','×\x20服务器返回错误:','API\x20配置拉取异常:\x20','API\x20配置拉取成功:\x20',',且无法读取错误响应内容','data','8430vZYapp','未知错误','获取数据集失败,HTTP状态码:\x20','*\x20开始生成\x20API\x20配置文件:','client','\x20\x20\x20•\x20','create-api-pull','3262npMwfq','/smartapi/dataset/getList?appCode=','7607780Vtjfet','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','message','-client','36HnDjbz','22qdpNpd','status','.ts\x20-\x20模型配置文件','获取数据集失败,原因:登录鉴权失败,登录已过期','552208KELgRj','length','-api','chdir','json','822120GMPptb','6012nQgTqs','log','info','url','141640EybFWH','tableData','×\x20API\x20配置拉取异常:','&pageSize=999&currentPage=1'];a7_0xd9ff=function(){return _0x12e2c1;};return a7_0xd9ff();}import{logger}from'../utils/logger.js';function a7_0x2365(_0x309d2f,_0x5b7158){const _0xd9ff05=a7_0xd9ff();return a7_0x2365=function(_0x236514,_0x427a9f){_0x236514=_0x236514-0xd1;let _0x494db1=_0xd9ff05[_0x236514];return _0x494db1;},a7_0x2365(_0x309d2f,_0x5b7158);}export async function pullApiSilent(_0x3eef91,_0x4d2a0d,_0x4ab7df){const _0x4aa770=a7_0x2365;let _0x3f4d1d;try{const _0x34ced9=_0x4d2a0d?.['trim']()||'';if(_0x34ced9){const _0x143990=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x143990['test'](_0x34ced9))return console[_0x4aa770(0xfa)](_0x4aa770(0xe0)),![];}_0x4ab7df&&(_0x3f4d1d=process[_0x4aa770(0xf8)](),process[_0x4aa770(0xeb)](_0x4ab7df));console[_0x4aa770(0xef)](_0x4aa770(0xf7));const _0x5c167b=await fetch(getApiDomain()+_0x4aa770(0xde)+_0x3eef91+_0x4aa770(0xf5),{'headers':{'Cookie':getCookie()}});if(_0x5c167b['ok']){const _0x452e9b=await _0x5c167b[_0x4aa770(0xec)]();if(_0x452e9b[_0x4aa770(0xf6)]){const _0x394860=_0x34ced9?_0x34ced9+_0x4aa770(0xea):'api',_0x335e36=_0x34ced9?_0x34ced9+_0x4aa770(0xe2):_0x4aa770(0xda);return console[_0x4aa770(0xef)](_0x4aa770(0xd9)),console[_0x4aa770(0xef)](_0x4aa770(0xdb)+_0x394860+_0x4aa770(0xe6)),console[_0x4aa770(0xef)](_0x4aa770(0xdb)+_0x335e36+'.ts\x20-\x20客户端实例文件'),console[_0x4aa770(0xef)](_0x4aa770(0xfc)+_0x452e9b[_0x4aa770(0xd5)][_0x4aa770(0xf3)]['length']+'\x20个数据集...'),await generateApiFile(_0x452e9b[_0x4aa770(0xd5)][_0x4aa770(0xf3)],_0x34ced9,_0x3eef91,!![]),console['log']('√\x20API\x20配置文件生成完成'),_0x4ab7df&&logger[_0x4aa770(0xf0)](_0x4aa770(0xdc),_0x4aa770(0xd3)+_0x3eef91,{'projectPath':_0x4ab7df,'appCode':_0x3eef91,'datasetCount':_0x452e9b['data'][_0x4aa770(0xf3)][_0x4aa770(0xe9)],'filePrefix':_0x34ced9}),!![];}else return console['error'](_0x4aa770(0xd1),_0x452e9b['message']||_0x4aa770(0xd7)),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),'API\x20配置拉取失败:\x20'+(_0x452e9b['message']||_0x4aa770(0xd7)),{'projectPath':_0x4ab7df,'appCode':_0x3eef91}),![];}else{if(_0x5c167b[_0x4aa770(0xe5)]===0x191){const _0x3bea3e=_0x4aa770(0xe7);console[_0x4aa770(0xfa)]('×\x20'+_0x3bea3e),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x3bea3e,{'status':_0x5c167b[_0x4aa770(0xe5)],'appCode':_0x3eef91,'url':_0x5c167b[_0x4aa770(0xf1)],'projectPath':_0x4ab7df});}else{const _0x438424=_0x4aa770(0xd8)+_0x5c167b['status'];console[_0x4aa770(0xfa)]('×\x20'+_0x438424);try{const _0x2413bd=await _0x5c167b['text']();_0x2413bd&&console[_0x4aa770(0xfa)]('×\x20错误详情:',_0x2413bd),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x438424,{'status':_0x5c167b[_0x4aa770(0xe5)],'appCode':_0x3eef91,'url':_0x5c167b[_0x4aa770(0xf1)],'errorBody':_0x2413bd,'projectPath':_0x4ab7df});}catch(_0x3929e6){console[_0x4aa770(0xfa)]('×\x20无法读取错误响应内容'),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x438424+_0x4aa770(0xd4),{'status':_0x5c167b[_0x4aa770(0xe5)],'appCode':_0x3eef91,'url':_0x5c167b[_0x4aa770(0xf1)],'readError':_0x3929e6 instanceof Error?_0x3929e6['message']:String(_0x3929e6),'projectPath':_0x4ab7df});}}return![];}}catch(_0x2ab089){const _0xd353b0=_0x2ab089 instanceof Error?_0x2ab089[_0x4aa770(0xe1)]:String(_0x2ab089);return console[_0x4aa770(0xfa)](_0x4aa770(0xf4),_0xd353b0),_0x4ab7df&&logger[_0x4aa770(0xfa)](_0x4aa770(0xdc),_0x4aa770(0xd2)+_0xd353b0,{'appCode':_0x3eef91,'projectPath':_0x4ab7df}),![];}finally{_0x3f4d1d&&process['chdir'](_0x3f4d1d);}}
@@ -0,0 +1 @@
1
+ function a8_0x2165(_0x847ec,_0x2c2a31){const _0x2c1af8=a8_0x2c1a();return a8_0x2165=function(_0x216540,_0x5a153f){_0x216540=_0x216540-0xe2;let _0xd77604=_0x2c1af8[_0x216540];return _0xd77604;},a8_0x2165(_0x847ec,_0x2c2a31);}(function(_0x2b18b8,_0x19a24b){const _0x414d09=a8_0x2165,_0x38ccb3=_0x2b18b8();while(!![]){try{const _0x227d45=parseInt(_0x414d09(0xed))/0x1+parseInt(_0x414d09(0xee))/0x2*(-parseInt(_0x414d09(0x10a))/0x3)+-parseInt(_0x414d09(0x110))/0x4+-parseInt(_0x414d09(0x10f))/0x5+-parseInt(_0x414d09(0xe3))/0x6*(-parseInt(_0x414d09(0xe9))/0x7)+parseInt(_0x414d09(0xf3))/0x8*(parseInt(_0x414d09(0xf9))/0x9)+parseInt(_0x414d09(0xe6))/0xa;if(_0x227d45===_0x19a24b)break;else _0x38ccb3['push'](_0x38ccb3['shift']());}catch(_0x59f5e5){_0x38ccb3['push'](_0x38ccb3['shift']());}}}(a8_0x2c1a,0x9e8c9));import{createInterface}from'node:readline/promises';import{readConfig}from'../utils/config.js';import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{generateApiFile}from'./generate-api-file.js';function a8_0x2c1a(){const _0x5ee8c2=['\x20\x20\x20•\x20','stdout','48TaPKYZ','text','/smartapi/dataset/getList?appCode=','trim','×\x20提供的应用AppCode\x20\x22','2325765Yogcxv','770748mRpxNh','获取数据集失败,原因:登录鉴权失败,登录已过期,请使用\x20lovrabet\x20auth\x20重新登录后再尝试','url','30ZaSRXY','\x20个数据集...','*\x20开始生成\x20API\x20配置文件:','6258380aOfKqL','api','exit','600901nKXnfx','string','stdin','.ts\x20-\x20模型配置文件','335664nvhmFh','94978PeMwLO','\x22\x20无效','\x20\x20\x202.\x20配置默认值:\x20lovrabet\x20config\x20set\x20app\x20<app-code>','message','\x20\x20\x201.\x20直接指定:\x20lovrabet\x20api\x20pull\x20<app-code>','8RsHEOr','&pageSize=999&currentPage=1',',且无法读取错误响应内容','×\x20文件前缀格式不正确。只能包含字母、数字、连字符和下划线,且必须以字母开头。','log','\x1b[0m','6087276OJWXsh','data','app','×\x20无法读取错误响应内容','!\x20请输入文件前缀\x20\x1b[90m[留空表示无前缀]\x1b[0m:\x20','×\x20未提供应用AppCode,且配置中也没有默认值','success','\x1b[90m*\x20使用配置的应用AppCode:\x20','*\x20正在处理\x20','error','question','status','api-pull','tableData','.ts\x20-\x20客户端实例文件'];a8_0x2c1a=function(){return _0x5ee8c2;};return a8_0x2c1a();}import{logger}from'../utils/logger.js';export async function initApi(_0xedebcb){const _0x1e3856=a8_0x2165,_0x2c552a=readConfig(),_0x34d14e=_0xedebcb||_0x2c552a?.[_0x1e3856(0xfb)];(typeof _0x34d14e!==_0x1e3856(0xea)||!_0x34d14e)&&(_0xedebcb?console['error'](_0x1e3856(0x10e)+_0xedebcb+_0x1e3856(0xef)):(console[_0x1e3856(0x102)](_0x1e3856(0xfe)),console[_0x1e3856(0xf7)]('!\x20请使用以下方式之一:'),console['log'](_0x1e3856(0xf2)),console[_0x1e3856(0xf7)](_0x1e3856(0xf0))),process[_0x1e3856(0xe8)](0x1));_0xedebcb?console[_0x1e3856(0xf7)]('*\x20使用指定的应用AppCode:\x20'+_0x34d14e):console[_0x1e3856(0xf7)](_0x1e3856(0x100)+_0x34d14e+_0x1e3856(0xf8));const _0x4620c0=createInterface({'input':process[_0x1e3856(0xeb)],'output':process[_0x1e3856(0x109)]});let _0x287cdd;try{const _0x4e1818=await _0x4620c0[_0x1e3856(0x103)](_0x1e3856(0xfd));_0x287cdd=_0x4e1818[_0x1e3856(0x10d)]();if(_0x287cdd){const _0x5ba4be=/^[a-zA-Z][a-zA-Z0-9_-]*$/;!_0x5ba4be['test'](_0x287cdd)&&(console[_0x1e3856(0x102)](_0x1e3856(0xf6)),process[_0x1e3856(0xe8)](0x1));}}finally{_0x4620c0['close']();}console[_0x1e3856(0xf7)]('\x0a*\x20正在从服务器拉取\x20API\x20配置...');const _0x458c60=await fetch(getApiDomain()+_0x1e3856(0x10c)+_0x34d14e+_0x1e3856(0xf4),{'headers':{'Cookie':getCookie()}});if(_0x458c60['ok']){const _0x1b263d=await _0x458c60['json']();if(_0x1b263d[_0x1e3856(0xff)]){const _0x44d81a=_0x287cdd?_0x287cdd+'-api':_0x1e3856(0xe7),_0x56af27=_0x287cdd?_0x287cdd+'-client':'client';console[_0x1e3856(0xf7)](_0x1e3856(0xe5)),console[_0x1e3856(0xf7)](_0x1e3856(0x108)+_0x44d81a+_0x1e3856(0xec)),console['log'](_0x1e3856(0x108)+_0x56af27+_0x1e3856(0x107)),console[_0x1e3856(0xf7)](_0x1e3856(0x101)+_0x1b263d[_0x1e3856(0xfa)][_0x1e3856(0x106)]['length']+_0x1e3856(0xe4));const _0x3c00c7=!_0xedebcb;await generateApiFile(_0x1b263d[_0x1e3856(0xfa)][_0x1e3856(0x106)],_0x287cdd,_0x34d14e,_0x3c00c7);}}else{if(_0x458c60[_0x1e3856(0x104)]===0x191){const _0x4ab3b2=_0x1e3856(0x111);console[_0x1e3856(0x102)]('×\x20'+_0x4ab3b2),logger[_0x1e3856(0x102)](_0x1e3856(0x105),_0x4ab3b2,{'status':_0x458c60[_0x1e3856(0x104)],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)]});}else{const _0x39be16='获取数据集失败,HTTP状态码:\x20'+_0x458c60[_0x1e3856(0x104)];console[_0x1e3856(0x102)]('×\x20'+_0x39be16);try{const _0x2edf80=await _0x458c60[_0x1e3856(0x10b)]();_0x2edf80?(console[_0x1e3856(0x102)]('×\x20错误详情:',_0x2edf80),logger[_0x1e3856(0x102)](_0x1e3856(0x105),_0x39be16,{'status':_0x458c60['status'],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)],'errorBody':_0x2edf80})):logger[_0x1e3856(0x102)]('api-pull',_0x39be16,{'status':_0x458c60[_0x1e3856(0x104)],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)]});}catch(_0xc56da9){console[_0x1e3856(0x102)](_0x1e3856(0xfc)),logger['error']('api-pull',_0x39be16+_0x1e3856(0xf5),{'status':_0x458c60[_0x1e3856(0x104)],'appCode':_0x34d14e,'url':_0x458c60[_0x1e3856(0xe2)],'readError':_0xc56da9 instanceof Error?_0xc56da9[_0x1e3856(0xf1)]:String(_0xc56da9)});}}process['exit'](0x1);}}
@@ -0,0 +1 @@
1
+ export{};
@@ -0,0 +1 @@
1
+ (function(_0x5ab5c0,_0x2c9981){const _0x3707cc=a10_0x53c7,_0xb64b1b=_0x5ab5c0();while(!![]){try{const _0x3702cc=-parseInt(_0x3707cc(0x186))/0x1+-parseInt(_0x3707cc(0x18a))/0x2+-parseInt(_0x3707cc(0x188))/0x3+-parseInt(_0x3707cc(0x18b))/0x4+-parseInt(_0x3707cc(0x18e))/0x5*(parseInt(_0x3707cc(0x187))/0x6)+parseInt(_0x3707cc(0x192))/0x7+parseInt(_0x3707cc(0x185))/0x8*(parseInt(_0x3707cc(0x184))/0x9);if(_0x3702cc===_0x2c9981)break;else _0xb64b1b['push'](_0xb64b1b['shift']());}catch(_0x4a74ed){_0xb64b1b['push'](_0xb64b1b['shift']());}}}(a10_0x49a2,0x3757c));function a10_0x53c7(_0x5b76e6,_0x54224c){const _0x49a269=a10_0x49a2();return a10_0x53c7=function(_0x53c797,_0x517bec){_0x53c797=_0x53c797-0x180;let _0x113c0d=_0x49a269[_0x53c797];return _0x113c0d;},a10_0x53c7(_0x5b76e6,_0x54224c);}import{jsx as a10_0x2aa1ca,jsxs as a10_0x474b0f}from'react/jsx-runtime';import{Text,Box,useInput,useApp}from'ink';import{useEffect,useState}from'react';import{getIsSessionValid}from'./is-session-valid.js';import{authServer}from'./auth-server.js';import a10_0x56ebea from'ink-spinner';export function AuthServer(){const _0x3b1c4b=a10_0x53c7,{exit:_0x2910ed}=useApp(),[_0x4b1ce0,_0x2a8f9d]=useState(![]),[_0x2685b5,_0x5c0dc7]=useState(!![]),[_0x5ce72a,_0x9c6301]=useState(![]),[_0x414327,_0x286ea4]=useState(![]);useEffect(()=>{const _0x340cb6=a10_0x53c7;getIsSessionValid()[_0x340cb6(0x191)](_0x2a8f9d)[_0x340cb6(0x18f)](()=>_0x5c0dc7(![]));},[]),useEffect(()=>{const _0x2349c8=a10_0x53c7;!_0x2685b5&&_0x4b1ce0&&(console[_0x2349c8(0x194)](_0x2349c8(0x183)),_0x2910ed());},[_0x2685b5,_0x4b1ce0,_0x2910ed]),useEffect(()=>{const _0x1d2d73=a10_0x53c7;_0x414327&&(console[_0x1d2d73(0x194)](_0x1d2d73(0x18d)),_0x2910ed());},[_0x414327,_0x2910ed]),useInput((_0x308db5,_0xe674d9)=>{const _0x5ea1af=a10_0x53c7;_0xe674d9[_0x5ea1af(0x189)]&&(_0x9c6301(!![]),authServer({'silent':!![]})[_0x5ea1af(0x191)](_0x5d3815=>{_0x286ea4(_0x5d3815);})),_0x308db5==='q'&&_0x2910ed();});if(_0x2685b5)return null;if(_0x4b1ce0||_0x414327)return null;return a10_0x2aa1ca(Box,{'flexDirection':_0x3b1c4b(0x193),'marginTop':0x1,'marginBottom':0x1,'children':_0x5ce72a?a10_0x474b0f(Box,{'children':[a10_0x2aa1ca(Box,{'width':'1'}),a10_0x474b0f(Text,{'color':'green','children':[a10_0x2aa1ca(a10_0x56ebea,{'type':_0x3b1c4b(0x190)}),'\x20\x20']}),a10_0x2aa1ca(Text,{'children':_0x3b1c4b(0x182)}),a10_0x2aa1ca(Text,{'color':'gray','children':_0x3b1c4b(0x18c)})]}):a10_0x474b0f(Box,{'children':[a10_0x2aa1ca(Box,{'width':'1'}),a10_0x2aa1ca(Text,{'children':'*\x20按回车开始登录。'}),a10_0x2aa1ca(Text,{'color':_0x3b1c4b(0x180),'children':_0x3b1c4b(0x181)})]})});}function a10_0x49a2(){const _0x134f54=['then','2362297ATWfTW','column','log','gray','按\x20“q”\x20退出。','正在登录...\x20','√\x20当前为有效会话,无需重新登录。','9SzTizY','7448536AmXewG','149470gpxMvx','2167974bWJAjq','29925uKXCcj','return','400040TsFxnt','1284240ocPoRH','请前往浏览器完成登录。','*\x20登录成功!','5swZPie','finally','dots'];a10_0x49a2=function(){return _0x134f54;};return a10_0x49a2();}
@@ -0,0 +1 @@
1
+ const a11_0x17c8a4=a11_0x5e5f;function a11_0xc8d5(){const _0x272b27=['utf-8','catch','13145BDtCfL','isAuth','318023uqSBHg','40163332RWIkmv','session','port','Auth\x20server\x20error:','https://g.yuntooai.com/cert/lovrabet-dev.json','object','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','⚠️\x20\x20无法自动打开浏览器','✅\x20浏览器已自动打开,请在浏览器中完成登录','createServer','7129071ANMBKD','win32','🔐\x20正在启动登录服务...','2BCMEEw','3962980cEJdWn','1772mMRAdZ','end','then','json','3594eUoycB','writeHead','listen','start\x20\x22\x22\x20\x22','address','📍\x20登录地址:','open\x20\x22','🔗\x20请手动复制登录地址到浏览器:','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','127.0.0.1','7755090JpiOYj','error','/sign-in?redirect=','/api/auth/get-session','text/html;\x20charset=utf-8','user','16vWVsDi','log','xdg-open\x20\x22','10851EZLNdR','platform'];a11_0xc8d5=function(){return _0x272b27;};return a11_0xc8d5();}function a11_0x5e5f(_0x11c552,_0x17e2a9){const _0xc8d5ee=a11_0xc8d5();return a11_0x5e5f=function(_0x5e5f46,_0x4dfd90){_0x5e5f46=_0x5e5f46-0x7a;let _0x4b1b0c=_0xc8d5ee[_0x5e5f46];return _0x4b1b0c;},a11_0x5e5f(_0x11c552,_0x17e2a9);}(function(_0x5d108d,_0x1bd16e){const _0x329c00=a11_0x5e5f,_0x25b8fb=_0x5d108d();while(!![]){try{const _0x5d25ed=parseInt(_0x329c00(0x89))/0x1*(parseInt(_0x329c00(0x97))/0x2)+-parseInt(_0x329c00(0x83))/0x3*(-parseInt(_0x329c00(0x99))/0x4)+-parseInt(_0x329c00(0x87))/0x5*(parseInt(_0x329c00(0x9d))/0x6)+-parseInt(_0x329c00(0x7a))/0x7+-parseInt(_0x329c00(0x80))/0x8*(parseInt(_0x329c00(0x94))/0x9)+-parseInt(_0x329c00(0x98))/0xa+parseInt(_0x329c00(0x8a))/0xb;if(_0x5d25ed===_0x1bd16e)break;else _0x25b8fb['push'](_0x25b8fb['shift']());}catch(_0x3694e3){_0x25b8fb['push'](_0x25b8fb['shift']());}}}(a11_0xc8d5,0xddc65));import{writeFileSync}from'node:fs';import a11_0x251a5c from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x1dcdb9){const _0x5e570e=a11_0x5e5f,_0x5d3a3d=_0x1dcdb9?.['silent']||![];if(await getIsSessionValid())return!![];const _0x43d5b1=await(await fetch(_0x5e570e(0x8e)))[_0x5e570e(0x9c)]();return new Promise(async(_0x11957f,_0x59e629)=>{const _0x5453c3=_0x5e570e;let _0x1c4336=0x0;const _0x3b4098=a11_0x251a5c[_0x5453c3(0x93)](_0x43d5b1,async(_0x276af1,_0x53c79a)=>{const _0x2ab5ec=_0x5453c3,_0x5c0481=getUserDomain(),_0x118384=_0x276af1['headers']['cookie']||'',_0x10d504=await fetch(_0x5c0481+_0x2ab5ec(0x7d),{'headers':{'cookie':_0x118384}})[_0x2ab5ec(0x9b)](_0x2d612c=>_0x2d612c[_0x2ab5ec(0x9c)]()),_0x516639=_0x10d504&&_0x10d504[_0x2ab5ec(0x8b)]&&_0x10d504[_0x2ab5ec(0x7f)];if(_0x516639){writeFileSync(cookieFile,_0x118384,_0x2ab5ec(0x85)),_0x11957f(!![]);const _0x383443=_0x2ab5ec(0xa5);_0x53c79a[_0x2ab5ec(0x9e)](0xc8,{'Content-Type':_0x2ab5ec(0x7e)}),_0x53c79a['end'](_0x383443),_0x3b4098['close']();}else{const _0x364511=''+encodeURIComponent('https://dev.lovrabet.com:'+_0x1c4336);_0x53c79a['writeHead'](0x12e,{'location':_0x5c0481+_0x2ab5ec(0x7c)+_0x364511}),_0x53c79a[_0x2ab5ec(0x9a)]();return;}});_0x3b4098[_0x5453c3(0x9f)](0x0,_0x5453c3(0xa6),()=>{const _0x12d601=_0x5453c3,_0x36632c=_0x3b4098[_0x12d601(0xa1)]();_0x1c4336=typeof _0x36632c===_0x12d601(0x8f)&&_0x36632c?_0x36632c[_0x12d601(0x8c)]:Number(_0x36632c);const _0x42da47='https://dev.lovrabet.com:'+_0x1c4336;!_0x5d3a3d&&(console[_0x12d601(0x81)](_0x12d601(0x96)),console[_0x12d601(0x81)](_0x12d601(0xa2),_0x42da47),console[_0x12d601(0x81)]('🌐\x20正在尝试自动打开浏览器...'),console[_0x12d601(0x81)](''),console[_0x12d601(0x81)](_0x12d601(0x90)),console[_0x12d601(0x81)]('')),openInBrowser(_0x42da47)['then'](_0x3a69a2=>{const _0x4fc4fb=_0x12d601;!_0x5d3a3d&&(_0x3a69a2?console['log'](_0x4fc4fb(0x92)):(console['log'](_0x4fc4fb(0x91)),console[_0x4fc4fb(0x81)](_0x4fc4fb(0xa4),_0x42da47)),console[_0x4fc4fb(0x81)](''));})[_0x12d601(0x86)](()=>{const _0x130385=_0x12d601;!_0x5d3a3d&&(console['log'](_0x130385(0x91)),console[_0x130385(0x81)](_0x130385(0xa4),_0x42da47),console[_0x130385(0x81)](''));});}),_0x3b4098['on'](_0x5453c3(0x7b),_0x305a3b=>{const _0x528ec2=_0x5453c3;!_0x5d3a3d&&console[_0x528ec2(0x7b)](_0x528ec2(0x8d),_0x305a3b),_0x59e629(_0x305a3b);});});}function openInBrowser(_0x37b3a7){return new Promise(_0x255de0=>{const _0x22ebf6=a11_0x5e5f,_0x2e4d84=process[_0x22ebf6(0x84)];let _0x55bf5c;if(_0x2e4d84===_0x22ebf6(0x95))_0x55bf5c=_0x22ebf6(0xa0)+_0x37b3a7+'\x22';else _0x2e4d84==='darwin'?_0x55bf5c=_0x22ebf6(0xa3)+_0x37b3a7+'\x22':_0x55bf5c=_0x22ebf6(0x82)+_0x37b3a7+'\x22';exec(_0x55bf5c,_0x2dd76d=>{_0x2dd76d?_0x255de0(![]):_0x255de0(!![]);});});}if(import.meta['main']){const isAuth=await authServer();console['log'](a11_0x17c8a4(0x88),isAuth);}
@@ -0,0 +1 @@
1
+ const a12_0x38d5a4=a12_0x17d5;function a12_0x2d7b(){const _0xe458c7=['73XraYLY','/.lovrabet','31586772cMCgnM','188CtzmyT','430dMjtxd','7156824oGQXyG','/cookie','21278zmhrus','11aTkdQX','508109pQIJyJ','9oEAFPF','8491420zORKgS','10278orCnpk','75144cqYTrM'];a12_0x2d7b=function(){return _0xe458c7;};return a12_0x2d7b();}(function(_0x20ca57,_0x3d71ed){const _0x5b3fc1=a12_0x17d5,_0x4e880a=_0x20ca57();while(!![]){try{const _0x32ed7e=-parseInt(_0x5b3fc1(0x1c9))/0x1*(parseInt(_0x5b3fc1(0x1c2))/0x2)+parseInt(_0x5b3fc1(0x1c8))/0x3*(-parseInt(_0x5b3fc1(0x1cc))/0x4)+parseInt(_0x5b3fc1(0x1bf))/0x5*(parseInt(_0x5b3fc1(0x1c7))/0x6)+-parseInt(_0x5b3fc1(0x1c4))/0x7+-parseInt(_0x5b3fc1(0x1c0))/0x8*(parseInt(_0x5b3fc1(0x1c5))/0x9)+parseInt(_0x5b3fc1(0x1c6))/0xa*(parseInt(_0x5b3fc1(0x1c3))/0xb)+parseInt(_0x5b3fc1(0x1cb))/0xc;if(_0x32ed7e===_0x3d71ed)break;else _0x4e880a['push'](_0x4e880a['shift']());}catch(_0x42cd57){_0x4e880a['push'](_0x4e880a['shift']());}}}(a12_0x2d7b,0xacc0e));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+a12_0x38d5a4(0x1ca);export const cookieFile=configDir+a12_0x38d5a4(0x1c1);function a12_0x17d5(_0x57aa8d,_0x4909d1){const _0x2d7b41=a12_0x2d7b();return a12_0x17d5=function(_0x17d56b,_0x17767f){_0x17d56b=_0x17d56b-0x1bf;let _0x8800a8=_0x2d7b41[_0x17d56b];return _0x8800a8;},a12_0x17d5(_0x57aa8d,_0x4909d1);}mkdirSync(configDir,{'recursive':!![]});
@@ -0,0 +1 @@
1
+ (function(_0x3fe8a7,_0xbf9ba9){var _0x35840b=a13_0x1a9c,_0x48aa34=_0x3fe8a7();while(!![]){try{var _0x200baa=-parseInt(_0x35840b(0x7c))/0x1+parseInt(_0x35840b(0x7a))/0x2+-parseInt(_0x35840b(0x77))/0x3*(parseInt(_0x35840b(0x75))/0x4)+parseInt(_0x35840b(0x79))/0x5*(parseInt(_0x35840b(0x78))/0x6)+parseInt(_0x35840b(0x73))/0x7+parseInt(_0x35840b(0x72))/0x8*(parseInt(_0x35840b(0x74))/0x9)+-parseInt(_0x35840b(0x7b))/0xa;if(_0x200baa===_0xbf9ba9)break;else _0x48aa34['push'](_0x48aa34['shift']());}catch(_0x4f630e){_0x48aa34['push'](_0x48aa34['shift']());}}}(a13_0x1978,0x289b0));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';function a13_0x1978(){var _0x59ff5a=['172436PTJmOj','3021810NGLDzz','61903kPyraV','64PVwLDW','1705459avzOJw','69291gAOmie','60NSGSDM','utf-8','23799tQlhiT','288OooVOv','26870czexkI'];a13_0x1978=function(){return _0x59ff5a;};return a13_0x1978();}function a13_0x1a9c(_0x101406,_0x378f8c){var _0x197863=a13_0x1978();return a13_0x1a9c=function(_0x1a9ce8,_0x15ba0e){_0x1a9ce8=_0x1a9ce8-0x72;var _0x5626e7=_0x197863[_0x1a9ce8];return _0x5626e7;},a13_0x1a9c(_0x101406,_0x378f8c);}export function getCookie(){var _0x4cf10a=a13_0x1a9c;try{return readFileSync(cookieFile,_0x4cf10a(0x76));}catch{}return'';}
@@ -0,0 +1 @@
1
+ (function(_0x3c910a,_0x5d712b){const _0x9d7acc=a14_0x2d0a,_0x31e09a=_0x3c910a();while(!![]){try{const _0x2c2c47=parseInt(_0x9d7acc(0x150))/0x1*(-parseInt(_0x9d7acc(0x151))/0x2)+-parseInt(_0x9d7acc(0x14f))/0x3*(parseInt(_0x9d7acc(0x14e))/0x4)+parseInt(_0x9d7acc(0x14a))/0x5*(parseInt(_0x9d7acc(0x148))/0x6)+parseInt(_0x9d7acc(0x152))/0x7+parseInt(_0x9d7acc(0x147))/0x8+parseInt(_0x9d7acc(0x153))/0x9+parseInt(_0x9d7acc(0x14d))/0xa*(-parseInt(_0x9d7acc(0x14c))/0xb);if(_0x2c2c47===_0x5d712b)break;else _0x31e09a['push'](_0x31e09a['shift']());}catch(_0x25ac2e){_0x31e09a['push'](_0x31e09a['shift']());}}}(a14_0x10e7,0x590ef));import{existsSync,readFileSync}from'node:fs';function a14_0x10e7(){const _0x35a8fa=['3245jpZYsJ','utf-8','506968Pxsypr','290YaeTic','32xRYHhU','18474ydmyPd','867dctZEl','4zIwJWK','4588773bTssPI','3650283rNOAme','user','json','5306400JXnvBF','258qGVUnZ','/api/auth/get-session'];a14_0x10e7=function(){return _0x35a8fa;};return a14_0x10e7();}import{getUserDomain}from'../constant/domain.js';function a14_0x2d0a(_0x40e2ab,_0x19da7a){const _0x10e70f=a14_0x10e7();return a14_0x2d0a=function(_0x2d0a77,_0x113c08){_0x2d0a77=_0x2d0a77-0x147;let _0x57b49a=_0x10e70f[_0x2d0a77];return _0x57b49a;},a14_0x2d0a(_0x40e2ab,_0x19da7a);}import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0xe79b3f=a14_0x2d0a;try{if(!existsSync(cookieFile))return![];const _0xfd20dc=readFileSync(cookieFile,_0xe79b3f(0x14b)),_0xdd6d8b=await fetch(getUserDomain()+_0xe79b3f(0x149),{'headers':{'cookie':_0xfd20dc}})['then'](_0x51443f=>_0x51443f[_0xe79b3f(0x155)]());return _0xdd6d8b&&_0xdd6d8b['session']&&_0xdd6d8b[_0xe79b3f(0x154)];}catch{}return![];}
@@ -0,0 +1 @@
1
+ function a15_0x41c7(){var _0x1822a7=['14sdUjpA','1949272IXFqwG','312088QomnSn','3589200HwMVDW','!\x20当前未登录','log','54Exgcfp','35590sTHUjV','8404920SKvkGg','✓\x20已退出登录','348785nNMrNn','370308MTKqzp','35goTPpv'];a15_0x41c7=function(){return _0x1822a7;};return a15_0x41c7();}(function(_0x15cb77,_0x43e7c2){var _0x4d235a=a15_0xf49c,_0x58104f=_0x15cb77();while(!![]){try{var _0x4b00fd=-parseInt(_0x4d235a(0xad))/0x1+-parseInt(_0x4d235a(0xaa))/0x2*(-parseInt(_0x4d235a(0xa9))/0x3)+-parseInt(_0x4d235a(0xa5))/0x4+-parseInt(_0x4d235a(0xa2))/0x5*(-parseInt(_0x4d235a(0xa1))/0x6)+-parseInt(_0x4d235a(0xa3))/0x7*(parseInt(_0x4d235a(0xa4))/0x8)+-parseInt(_0x4d235a(0xa6))/0x9+parseInt(_0x4d235a(0xab))/0xa;if(_0x4b00fd===_0x43e7c2)break;else _0x58104f['push'](_0x58104f['shift']());}catch(_0x12527a){_0x58104f['push'](_0x58104f['shift']());}}}(a15_0x41c7,0x4455f));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';function a15_0xf49c(_0x7d6077,_0x440858){var _0x41c7a4=a15_0x41c7();return a15_0xf49c=function(_0xf49c68,_0xd0b5ed){_0xf49c68=_0xf49c68-0xa1;var _0x2d2337=_0x41c7a4[_0xf49c68];return _0x2d2337;},a15_0xf49c(_0x7d6077,_0x440858);}export function logout(){var _0x5d31dc=a15_0xf49c;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5d31dc(0xa8)](_0x5d31dc(0xac))):console[_0x5d31dc(0xa8)](_0x5d31dc(0xa7));}
package/lib/cli.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ const a16_0x260a2e=a16_0x101c;(function(_0x536154,_0x47b41a){const _0x556b95=a16_0x101c,_0x35e6d6=_0x536154();while(!![]){try{const _0x26e5ac=-parseInt(_0x556b95(0xda))/0x1*(-parseInt(_0x556b95(0xde))/0x2)+-parseInt(_0x556b95(0xdd))/0x3+parseInt(_0x556b95(0xd5))/0x4*(parseInt(_0x556b95(0xc4))/0x5)+-parseInt(_0x556b95(0xd2))/0x6*(parseInt(_0x556b95(0xe1))/0x7)+-parseInt(_0x556b95(0xdb))/0x8+parseInt(_0x556b95(0xce))/0x9+-parseInt(_0x556b95(0xcc))/0xa*(-parseInt(_0x556b95(0xd7))/0xb);if(_0x26e5ac===_0x47b41a)break;else _0x35e6d6['push'](_0x35e6d6['shift']());}catch(_0x55e576){_0x35e6d6['push'](_0x35e6d6['shift']());}}}(a16_0x117f,0x2c777));import{jsx as a16_0x4c93de}from'react/jsx-runtime';import a16_0x613f57 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';import{runStart}from'./cmd/start.js';function a16_0x117f(){const _0x20b53a=['474ElLrqR','string','watch','3256tCONpE','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20[app-code]\x20\x20//\x20拉取并生成\x20API\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','501083ZliInZ','boolean','input','2GIwhfO','883512ICbUbU','auth','31398LwbamY','275336yEpAdg','error','exit','28854bmhEfd','1090KeWVTR','page','flags','setLogPath','logs','clear','logout','start','10wOFhLj','preview','1173033UodHAw','cwd','all','build'];a16_0x117f=function(){return _0x20b53a;};return a16_0x117f();}function a16_0x101c(_0x6f4864,_0x14b8f4){const _0x117f36=a16_0x117f();return a16_0x101c=function(_0x101c4a,_0x2ca18c){_0x101c4a=_0x101c4a-0xc4;let _0x370093=_0x117f36[_0x101c4a];return _0x370093;},a16_0x101c(_0x6f4864,_0x14b8f4);}import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x613f57(a16_0x260a2e(0xd6),{'importMeta':import.meta,'flags':{'name':{'type':a16_0x260a2e(0xd3)},'clear':{'type':a16_0x260a2e(0xd8)}}});await run();async function run(){const _0x59174f=a16_0x260a2e,_0x22a4c7=cli[_0x59174f(0xd9)][0x0];switch(_0x22a4c7){case'create':{const _0x2bea91=cli['input'][0x1]?.['trim']();render(a16_0x4c93de(CreateApp,{'projectCode':_0x2bea91}));break;}case'add':{cli[_0x59174f(0xd9)][0x1]===_0x59174f(0xc5)&&(logger[_0x59174f(0xc7)](process[_0x59174f(0xcf)]()),render(a16_0x4c93de(AddPage,{})));break;}case _0x59174f(0xcb):{try{logger[_0x59174f(0xc7)](process[_0x59174f(0xcf)]()),await runStart();}catch(_0x96c6da){console['error'](_0x96c6da),process[_0x59174f(0xe0)](0x1);}break;}case _0x59174f(0xd1):{try{logger['setLogPath'](process[_0x59174f(0xcf)]()),await runBuild();}catch(_0x4e8b77){console[_0x59174f(0xdf)](_0x4e8b77),process[_0x59174f(0xe0)](0x1);}break;}case _0x59174f(0xcd):{const _0x49d89b=cli['flags'][_0x59174f(0xd4)];logger[_0x59174f(0xc7)](process[_0x59174f(0xcf)]());if(_0x49d89b)try{await Promise[_0x59174f(0xd0)]([runBuildWatch(),runPreview()]);}catch(_0x29fd69){console[_0x59174f(0xdf)](_0x29fd69),process[_0x59174f(0xe0)](0x1);}else try{await runPreview();}catch(_0x55ea31){console[_0x59174f(0xdf)](_0x55ea31),process['exit'](0x1);}break;}case'config':{render(a16_0x4c93de(Config,{'cli':cli}));break;}case'api':{await apiCli(cli);break;}case _0x59174f(0xdc):{render(a16_0x4c93de(AuthServer,{}));break;}case _0x59174f(0xca):{logout();break;}case _0x59174f(0xc8):{cli[_0x59174f(0xc6)][_0x59174f(0xc9)]?clearLogs():showLogs();break;}default:render(a16_0x4c93de(Help,{}));break;}}
@@ -0,0 +1 @@
1
+ (function(_0x2c7fea,_0x1209fa){const _0x137f5d=a17_0x1385,_0x3865dc=_0x2c7fea();while(!![]){try{const _0x44fd70=parseInt(_0x137f5d(0xe6))/0x1+parseInt(_0x137f5d(0xe2))/0x2+parseInt(_0x137f5d(0xd9))/0x3*(-parseInt(_0x137f5d(0xd8))/0x4)+-parseInt(_0x137f5d(0xdb))/0x5*(-parseInt(_0x137f5d(0xdf))/0x6)+-parseInt(_0x137f5d(0xe0))/0x7+parseInt(_0x137f5d(0xe7))/0x8+-parseInt(_0x137f5d(0xe8))/0x9*(parseInt(_0x137f5d(0xd7))/0xa);if(_0x44fd70===_0x1209fa)break;else _0x3865dc['push'](_0x3865dc['shift']());}catch(_0x5cfa3c){_0x3865dc['push'](_0x3865dc['shift']());}}}(a17_0xcd73,0x7260f));function a17_0xcd73(){const _0x554a0b=['.bin','env','node_modules','4498510UrwlIL','92RrGgtm','110799bjxefW','PATH','212965PNThwz','cwd','close','inherit','42suqxpg','759073fJywPW','build','1140358FzFTDG','--watch','error','vite','267637CAagNR','5922216STpNBe','9CXvjGA'];a17_0xcd73=function(){return _0x554a0b;};return a17_0xcd73();}function a17_0x1385(_0xd2d2e5,_0x429137){const _0xcd7389=a17_0xcd73();return a17_0x1385=function(_0x1385cf,_0x30e509){_0x1385cf=_0x1385cf-0xd6;let _0x3bd34f=_0xcd7389[_0x1385cf];return _0x3bd34f;},a17_0x1385(_0xd2d2e5,_0x429137);}import{spawn}from'node:child_process';import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x4c6f78,_0x30a968)=>{const _0x1c4271=a17_0x1385,_0xcec0fd=spawn(_0x1c4271(0xe5),[_0x1c4271(0xe1),_0x1c4271(0xe3)],{'stdio':_0x1c4271(0xde),'shell':!![],'env':{...process[_0x1c4271(0xea)],'PATH':''+join(process[_0x1c4271(0xdc)](),_0x1c4271(0xd6),_0x1c4271(0xe9))+delimiter+process[_0x1c4271(0xea)][_0x1c4271(0xda)]}});_0xcec0fd['on'](_0x1c4271(0xdd),_0x56d75d=>{if(_0x56d75d===0x0||_0x56d75d===null)_0x4c6f78();else _0x30a968(new Error('npm\x20run\x20build\x20exited\x20with\x20code\x20'+_0x56d75d));}),_0xcec0fd['on'](_0x1c4271(0xe4),_0x30a968);});}
@@ -0,0 +1 @@
1
+ (function(_0x4d56fe,_0x23f973){const _0x353203=a18_0x4df0,_0x57dc0=_0x4d56fe();while(!![]){try{const _0x3a8f27=-parseInt(_0x353203(0x1a0))/0x1+parseInt(_0x353203(0x1a9))/0x2+-parseInt(_0x353203(0x1a8))/0x3+parseInt(_0x353203(0x19e))/0x4+parseInt(_0x353203(0x1b0))/0x5+parseInt(_0x353203(0x19f))/0x6*(parseInt(_0x353203(0x19c))/0x7)+-parseInt(_0x353203(0x1b6))/0x8;if(_0x3a8f27===_0x23f973)break;else _0x57dc0['push'](_0x57dc0['shift']());}catch(_0x3f53e1){_0x57dc0['push'](_0x57dc0['shift']());}}}(a18_0x3763,0xe02f0));function a18_0x4df0(_0x2d0a42,_0x266a26){const _0x376349=a18_0x3763();return a18_0x4df0=function(_0x4df029,_0x4b4d8a){_0x4df029=_0x4df029-0x19c;let _0x4a26a4=_0x376349[_0x4df029];return _0x4a26a4;},a18_0x4df0(_0x2d0a42,_0x266a26);}function a18_0x3763(){const _0x2926cc=['message','close','data','20694864LAqzmt','项目构建出错','stderr','2884FspBjZ','toString','744020sCIaMC','24330deCCIT','199822sjwWtR','now','inherit','npm','npm\x20run\x20build','项目构建失败','error','.bin','2940423pLyQAQ','2034598qHqnha','cwd','env','node_modules','trim','info','npm\x20run\x20build\x20exited\x20with\x20code\x20','9055565WLjEBi','PATH','build'];a18_0x3763=function(){return _0x2926cc;};return a18_0x3763();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x25d500,_0x446f85)=>{const _0x288f1d=a18_0x4df0,_0x829e8a=Date[_0x288f1d(0x1a1)]();logger[_0x288f1d(0x1ae)]('build','开始构建项目',{'command':_0x288f1d(0x1a4)});let _0x2a5d14='';const _0xf8567c=spawn(_0x288f1d(0x1a3),['run',_0x288f1d(0x1b2)],{'stdio':[_0x288f1d(0x1a2),_0x288f1d(0x1a2),'pipe'],'shell':!![],'env':{...process[_0x288f1d(0x1ab)],'PATH':''+join(process[_0x288f1d(0x1aa)](),_0x288f1d(0x1ac),_0x288f1d(0x1a7))+delimiter+process[_0x288f1d(0x1ab)][_0x288f1d(0x1b1)]}});_0xf8567c[_0x288f1d(0x1b8)]?.['on'](_0x288f1d(0x1b5),_0x20c2ff=>{const _0x3344fd=_0x288f1d;_0x2a5d14+=_0x20c2ff[_0x3344fd(0x19d)]();}),_0xf8567c['on'](_0x288f1d(0x1b4),_0x387ba5=>{const _0x439d57=_0x288f1d,_0x5f252f=Date[_0x439d57(0x1a1)]()-_0x829e8a;if(_0x387ba5===0x0||_0x387ba5===null)logger['success'](_0x439d57(0x1b2),'项目构建成功',_0x5f252f),_0x25d500();else{const _0x3c1235={'exitCode':_0x387ba5,'duration':_0x5f252f,'command':'npm\x20run\x20build','cwd':process[_0x439d57(0x1aa)]()};_0x2a5d14[_0x439d57(0x1ad)]()&&(_0x3c1235[_0x439d57(0x1b8)]=_0x2a5d14['trim']()),logger[_0x439d57(0x1a6)](_0x439d57(0x1b2),_0x439d57(0x1a5),_0x3c1235),_0x446f85(new Error(_0x439d57(0x1af)+_0x387ba5));}}),_0xf8567c['on'](_0x288f1d(0x1a6),_0x37a92c=>{const _0x3656ad=_0x288f1d,_0x519d20=Date['now']()-_0x829e8a;logger[_0x3656ad(0x1a6)](_0x3656ad(0x1b2),_0x3656ad(0x1b7),{'error':_0x37a92c[_0x3656ad(0x1b3)],'duration':_0x519d20,'stderr':_0x2a5d14[_0x3656ad(0x1ad)]()||undefined}),_0x446f85(_0x37a92c);});});}
@@ -0,0 +1 @@
1
+ function a19_0x27cc(_0x4a7f68,_0xff0661){const _0x1fbdce=a19_0x1fbd();return a19_0x27cc=function(_0x27cc26,_0x5781ee){_0x27cc26=_0x27cc26-0x15c;let _0x40dd8b=_0x1fbdce[_0x27cc26];return _0x40dd8b;},a19_0x27cc(_0x4a7f68,_0xff0661);}(function(_0x28be68,_0x3056df){const _0x3cfbcb=a19_0x27cc,_0x334a5b=_0x28be68();while(!![]){try{const _0x2a24be=-parseInt(_0x3cfbcb(0x172))/0x1*(-parseInt(_0x3cfbcb(0x16e))/0x2)+-parseInt(_0x3cfbcb(0x175))/0x3+-parseInt(_0x3cfbcb(0x167))/0x4+parseInt(_0x3cfbcb(0x162))/0x5+parseInt(_0x3cfbcb(0x165))/0x6+-parseInt(_0x3cfbcb(0x166))/0x7+parseInt(_0x3cfbcb(0x160))/0x8;if(_0x2a24be===_0x3056df)break;else _0x334a5b['push'](_0x334a5b['shift']());}catch(_0xaf1396){_0x334a5b['push'](_0x334a5b['shift']());}}}(a19_0x1fbd,0xbcfd7));import{logger}from'../utils/logger.js';function a19_0x1fbd(){const _0x3d9372=['success','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','1uzyEql','toLocaleString','duration','3399084rITXEG','details','\x20\x20\x20耗时:\x20','length','command','error','keys','12948584krgyhW','warn','5129820GiMFTz','level','log','2273136CxjBRi','10321892QjEEUO','3928608xicRLR','cwd','message','clearLogs','timestamp','setLogPath','*\x20日志已清空','2680892ibIMwV','forEach'];a19_0x1fbd=function(){return _0x3d9372;};return a19_0x1fbd();}export function showLogs(){const _0x364262=a19_0x27cc;logger[_0x364262(0x16c)](process[_0x364262(0x168)]());const _0x267f12=logger['readLogs']();if(_0x267f12[_0x364262(0x15c)]===0x0){console['log']('*\x20暂无日志记录');return;}console[_0x364262(0x164)](_0x364262(0x171)),_0x267f12[_0x364262(0x16f)]((_0x33a1d4,_0x10da01)=>{const _0x314d10=_0x364262,_0x489a5d=new Date(_0x33a1d4[_0x314d10(0x16b)])[_0x314d10(0x173)]('zh-CN'),_0x1b544e=_0x33a1d4[_0x314d10(0x163)]===_0x314d10(0x170)?'√':_0x33a1d4[_0x314d10(0x163)]===_0x314d10(0x15e)?'×':_0x33a1d4[_0x314d10(0x163)]===_0x314d10(0x161)?'!':'i';console[_0x314d10(0x164)](_0x10da01+0x1+'.\x20'+_0x1b544e+'\x20['+_0x33a1d4[_0x314d10(0x15d)]+']\x20'+_0x33a1d4[_0x314d10(0x169)]),console['log']('\x20\x20\x20时间:\x20'+_0x489a5d),_0x33a1d4['duration']&&console['log'](_0x314d10(0x177)+_0x33a1d4[_0x314d10(0x174)]+'ms'),_0x33a1d4[_0x314d10(0x176)]&&Object[_0x314d10(0x15f)](_0x33a1d4['details'])[_0x314d10(0x15c)]>0x0&&console[_0x314d10(0x164)]('\x20\x20\x20详情:\x20'+JSON['stringify'](_0x33a1d4[_0x314d10(0x176)],null,0x2)),console[_0x314d10(0x164)]('');});}export function clearLogs(){const _0x51589c=a19_0x27cc;logger[_0x51589c(0x16c)](process[_0x51589c(0x168)]()),logger[_0x51589c(0x16a)](),console[_0x51589c(0x164)](_0x51589c(0x16d));}
@@ -0,0 +1 @@
1
+ function a20_0x506a(_0x539e77,_0x476ecc){const _0x2cd3d5=a20_0x2cd3();return a20_0x506a=function(_0x506aa7,_0x577203){_0x506aa7=_0x506aa7-0x19b;let _0x1b609b=_0x2cd3d5[_0x506aa7];return _0x1b609b;},a20_0x506a(_0x539e77,_0x476ecc);}(function(_0x3a709e,_0x297ac3){const _0x38a299=a20_0x506a,_0x12e703=_0x3a709e();while(!![]){try{const _0x3e1901=parseInt(_0x38a299(0x1aa))/0x1+-parseInt(_0x38a299(0x19f))/0x2+parseInt(_0x38a299(0x1af))/0x3*(parseInt(_0x38a299(0x1a2))/0x4)+-parseInt(_0x38a299(0x1b4))/0x5+parseInt(_0x38a299(0x1ae))/0x6+-parseInt(_0x38a299(0x1a5))/0x7+parseInt(_0x38a299(0x1ad))/0x8;if(_0x3e1901===_0x297ac3)break;else _0x12e703['push'](_0x12e703['shift']());}catch(_0x3b7f9d){_0x12e703['push'](_0x12e703['shift']());}}}(a20_0x2cd3,0xc6def));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';function a20_0x2cd3(){const _0x15609c=['pipe','env','预览服务器启动出错','1804468bHYzkm','close','toString','16RfPBFc','now','vite\x20preview','9306283cssgAd','cwd','vite\x20preview\x20exited\x20with\x20code\x20','预览服务器启动成功','vite','875567NVczPm','error','node_modules','8221352TzNpws','9303474TxSwhI','263757kDUTXB','preview','.bin','stderr','message','3796065kMVYEn','启动预览服务器'];a20_0x2cd3=function(){return _0x15609c;};return a20_0x2cd3();}export function runPreview(){return new Promise((_0x2327e9,_0x50a920)=>{const _0x4d4e3f=a20_0x506a,_0x3de84a=Date['now']();logger['info'](_0x4d4e3f(0x1b0),_0x4d4e3f(0x19b),{'command':_0x4d4e3f(0x1a4)});let _0x134768='';const _0x47d864=spawn(_0x4d4e3f(0x1a9),[_0x4d4e3f(0x1b0)],{'stdio':['inherit','inherit',_0x4d4e3f(0x19c)],'shell':!![],'env':{...process[_0x4d4e3f(0x19d)],'PATH':''+join(process[_0x4d4e3f(0x1a6)](),_0x4d4e3f(0x1ac),_0x4d4e3f(0x1b1))+delimiter+process[_0x4d4e3f(0x19d)]['PATH']}});_0x47d864[_0x4d4e3f(0x1b2)]?.['on']('data',_0x12f04b=>{const _0x3b7ccd=_0x4d4e3f;_0x134768+=_0x12f04b[_0x3b7ccd(0x1a1)]();}),_0x47d864['on'](_0x4d4e3f(0x1a0),_0x8cf5ef=>{const _0x885154=_0x4d4e3f,_0x2f9382=Date[_0x885154(0x1a3)]()-_0x3de84a;if(_0x8cf5ef===0x0||_0x8cf5ef===null)logger['success'](_0x885154(0x1b0),_0x885154(0x1a8),_0x2f9382),_0x2327e9();else{const _0x1d5828={'exitCode':_0x8cf5ef,'duration':_0x2f9382,'command':_0x885154(0x1a4),'cwd':process[_0x885154(0x1a6)]()};_0x134768['trim']()&&(_0x1d5828[_0x885154(0x1b2)]=_0x134768['trim']()),logger[_0x885154(0x1ab)](_0x885154(0x1b0),'预览服务器启动失败',_0x1d5828),_0x50a920(new Error(_0x885154(0x1a7)+_0x8cf5ef));}}),_0x47d864['on'](_0x4d4e3f(0x1ab),_0x35b170=>{const _0x161cf9=_0x4d4e3f,_0x11a17c=Date[_0x161cf9(0x1a3)]()-_0x3de84a;logger[_0x161cf9(0x1ab)](_0x161cf9(0x1b0),_0x161cf9(0x19e),{'error':_0x35b170[_0x161cf9(0x1b3)],'duration':_0x11a17c,'stderr':_0x134768['trim']()||undefined}),_0x50a920(_0x35b170);});});}
@@ -0,0 +1 @@
1
+ function a21_0x548d(){const _0x5bb773=['开发服务器启动出错','49jzkJQk','node_modules','5SIKjTb','3WGvrXf','7562007loqrlD','10103137LvbGIv','vite','now','1815326DFuACS','write','开发服务器启动失败','2779432GmBrYP','info','vite\x20exited\x20with\x20code\x20','trim','close','message','183678URyAyJ','start','success','env','cwd','stderr','1866772KAJDxG','开发服务器启动成功','error','inherit','启动开发服务器','data','1731831BOyvbN','PATH','10tqArHZ'];a21_0x548d=function(){return _0x5bb773;};return a21_0x548d();}function a21_0x1498(_0x125861,_0x219b1d){const _0x548dda=a21_0x548d();return a21_0x1498=function(_0x1498fe,_0x14fcf2){_0x1498fe=_0x1498fe-0x6c;let _0x365def=_0x548dda[_0x1498fe];return _0x365def;},a21_0x1498(_0x125861,_0x219b1d);}(function(_0x498bf8,_0x3d4b48){const _0x323d8c=a21_0x1498,_0x303f18=_0x498bf8();while(!![]){try{const _0x381fd7=parseInt(_0x323d8c(0x87))/0x1+-parseInt(_0x323d8c(0x72))/0x2*(parseInt(_0x323d8c(0x6d))/0x3)+parseInt(_0x323d8c(0x81))/0x4*(-parseInt(_0x323d8c(0x6c))/0x5)+parseInt(_0x323d8c(0x7b))/0x6*(parseInt(_0x323d8c(0x8b))/0x7)+parseInt(_0x323d8c(0x75))/0x8+-parseInt(_0x323d8c(0x6e))/0x9*(parseInt(_0x323d8c(0x89))/0xa)+parseInt(_0x323d8c(0x6f))/0xb;if(_0x381fd7===_0x3d4b48)break;else _0x303f18['push'](_0x303f18['shift']());}catch(_0x37d2c6){_0x303f18['push'](_0x303f18['shift']());}}}(a21_0x548d,0xf383f));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runStart(_0xe583fb){return new Promise((_0x2b3531,_0x1dece9)=>{const _0x254037=a21_0x1498,_0x135a63=Date[_0x254037(0x71)](),_0x2f5acd=_0xe583fb||process[_0x254037(0x7f)]();logger[_0x254037(0x76)](_0x254037(0x7c),_0x254037(0x85),{'command':_0x254037(0x70),'cwd':_0x2f5acd});let _0x364635='';const _0x12ce02=spawn('vite',{'stdio':[_0x254037(0x84),'inherit','pipe'],'shell':!![],'cwd':_0x2f5acd,'env':{...process[_0x254037(0x7e)],'PATH':''+join(_0x2f5acd,_0x254037(0x8c),'.bin')+delimiter+process[_0x254037(0x7e)][_0x254037(0x88)]}});_0x12ce02[_0x254037(0x80)]?.['on'](_0x254037(0x86),_0x48a926=>{const _0x1cf0aa=_0x254037,_0x4cdeac=_0x48a926['toString']();_0x364635+=_0x4cdeac,process['stderr'][_0x1cf0aa(0x73)](_0x4cdeac);}),_0x12ce02['on'](_0x254037(0x79),_0x536c4b=>{const _0x3b6c75=_0x254037,_0x380e8a=Date[_0x3b6c75(0x71)]()-_0x135a63;if(_0x536c4b===0x0||_0x536c4b===null)logger[_0x3b6c75(0x7d)]('start',_0x3b6c75(0x82),_0x380e8a),_0x2b3531();else{const _0x1d9a51={'exitCode':_0x536c4b,'duration':_0x380e8a,'command':_0x3b6c75(0x70),'cwd':_0x2f5acd};_0x364635['trim']()&&(_0x1d9a51['stderr']=_0x364635['trim']()),logger[_0x3b6c75(0x83)](_0x3b6c75(0x7c),_0x3b6c75(0x74),_0x1d9a51),_0x1dece9(new Error(_0x3b6c75(0x77)+_0x536c4b));}}),_0x12ce02['on'](_0x254037(0x83),_0x29fa38=>{const _0x3241b6=_0x254037,_0x4698e6=Date[_0x3241b6(0x71)]()-_0x135a63,_0x23920d={'error':_0x29fa38[_0x3241b6(0x7a)],'duration':_0x4698e6,'command':_0x3241b6(0x70),'cwd':_0x2f5acd};_0x364635[_0x3241b6(0x78)]()&&(_0x23920d[_0x3241b6(0x80)]=_0x364635[_0x3241b6(0x78)]()),logger[_0x3241b6(0x83)]('start',_0x3241b6(0x8a),_0x23920d),_0x1dece9(_0x29fa38);});});}
@@ -0,0 +1 @@
1
+ function a22_0x15ad(_0x27e8db,_0x10ff94){const _0x286454=a22_0x2864();return a22_0x15ad=function(_0x15ad9e,_0x347c6a){_0x15ad9e=_0x15ad9e-0xfd;let _0x4293bc=_0x286454[_0x15ad9e];return _0x4293bc;},a22_0x15ad(_0x27e8db,_0x10ff94);}(function(_0x522bb9,_0x298de9){const _0x40cfa1=a22_0x15ad,_0x10f2ab=_0x522bb9();while(!![]){try{const _0x42040b=-parseInt(_0x40cfa1(0xfd))/0x1*(-parseInt(_0x40cfa1(0x114))/0x2)+-parseInt(_0x40cfa1(0x10d))/0x3+-parseInt(_0x40cfa1(0x10e))/0x4*(parseInt(_0x40cfa1(0x100))/0x5)+-parseInt(_0x40cfa1(0x111))/0x6*(-parseInt(_0x40cfa1(0x107))/0x7)+-parseInt(_0x40cfa1(0x10f))/0x8*(parseInt(_0x40cfa1(0xff))/0x9)+-parseInt(_0x40cfa1(0x101))/0xa+parseInt(_0x40cfa1(0x106))/0xb*(parseInt(_0x40cfa1(0x102))/0xc);if(_0x42040b===_0x298de9)break;else _0x10f2ab['push'](_0x10f2ab['shift']());}catch(_0x8145ef){_0x10f2ab['push'](_0x10f2ab['shift']());}}}(a22_0x2864,0xa56b0));import{jsxs as a22_0x2894f6,jsx as a22_0x483f36}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0x4d13c4=a22_0x15ad,_0x4825af=[{'command':_0x4d13c4(0x10a),'description':_0x4d13c4(0x10b)},{'command':_0x4d13c4(0x104),'description':_0x4d13c4(0xfe)},{'command':_0x4d13c4(0x105),'description':'列出所有配置项'}],_0x5511b5=[{'command':_0x4d13c4(0x108),'description':'配置当前项目的\x20App\x20Code'}];return a22_0x2894f6(Box,{'flexDirection':_0x4d13c4(0x109),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x483f36(Box,{'marginBottom':0x1,'children':a22_0x2894f6(Text,{'color':_0x4d13c4(0x112),'children':['\x20!','\x20\x20','无效的命令,可用命令如下:']})}),_0x4825af['map'](_0x3a337f=>a22_0x2894f6(Box,{'children':[a22_0x2894f6(Text,{'children':[_0x4d13c4(0x113),_0x3a337f['command']]}),a22_0x483f36(Text,{'color':_0x4d13c4(0x112),'children':_0x3a337f[_0x4d13c4(0x10c)]})]},_0x3a337f[_0x4d13c4(0x103)])),a22_0x483f36(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a22_0x483f36(Text,{'color':'gray','children':'\x20*\x20配置示例:'})}),_0x5511b5[_0x4d13c4(0x110)](_0x3255f0=>a22_0x2894f6(Box,{'children':[a22_0x2894f6(Text,{'children':[_0x4d13c4(0x113),_0x3255f0[_0x4d13c4(0x103)]]}),a22_0x483f36(Text,{'color':_0x4d13c4(0x112),'children':_0x3255f0[_0x4d13c4(0x10c)]})]},_0x3255f0['command']))]});}function a22_0x2864(){const _0x2ad876=['description','1400778IjYmCi','12KjnGrn','392oliOXJ','map','205158iYxBVo','gray','\x20\x20\x20\x20','28MBqMBl','19361lqhTiu','获取配置项','69570jKKOup','1751570QbPnjy','10703640gxRiuP','12cYTNiD','command','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','36732377RFwKOF','7SLzgoX','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','column','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','设置配置项'];a22_0x2864=function(){return _0x2ad876;};return a22_0x2864();}
@@ -0,0 +1 @@
1
+ const a23_0x3a0acb=a23_0x3493;(function(_0x4c2e51,_0x272e34){const _0x5157ed=a23_0x3493,_0x1af7ad=_0x4c2e51();while(!![]){try{const _0x544f8b=parseInt(_0x5157ed(0xbb))/0x1+parseInt(_0x5157ed(0xb3))/0x2*(parseInt(_0x5157ed(0xaf))/0x3)+-parseInt(_0x5157ed(0xb1))/0x4+parseInt(_0x5157ed(0xb9))/0x5*(parseInt(_0x5157ed(0xb0))/0x6)+-parseInt(_0x5157ed(0xbc))/0x7*(-parseInt(_0x5157ed(0xa8))/0x8)+parseInt(_0x5157ed(0xb5))/0x9+-parseInt(_0x5157ed(0xa7))/0xa;if(_0x544f8b===_0x272e34)break;else _0x1af7ad['push'](_0x1af7ad['shift']());}catch(_0x2531b6){_0x1af7ad['push'](_0x1af7ad['shift']());}}}(a23_0x1482,0x2138b));import{jsx as a23_0x25589c}from'react/jsx-runtime';import{resolve}from'node:path';function a23_0x3493(_0x2b540d,_0x598329){const _0x148243=a23_0x1482();return a23_0x3493=function(_0x3493fd,_0x515cc6){_0x3493fd=_0x3493fd-0xa7;let _0x795225=_0x148243[_0x3493fd];return _0x795225;},a23_0x3493(_0x2b540d,_0x598329);}import{writeFileSync}from'node:fs';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig}from'../utils/config.js';const configPath=resolve(process['cwd'](),a23_0x3a0acb(0xb6));export function Config(_0xa75eac){const _0x4510d2=a23_0x3a0acb,{cli:_0x2e1aa6}=_0xa75eac,_0x134b87=_0x2e1aa6[_0x4510d2(0xba)][0x1],_0x46ee10=_0x2e1aa6[_0x4510d2(0xba)][0x2],_0xae8142=[_0x4510d2(0xae),'get'][_0x4510d2(0xaa)](_0x134b87||''),_0x37f7ea=_0x2e1aa6[_0x4510d2(0xba)][_0x4510d2(0xb2)]>=0x3,_0x236096=readConfig();if(_0x134b87===_0x4510d2(0xae)){if(_0x46ee10){const _0x30109e=_0x2e1aa6[_0x4510d2(0xba)][0x3];if(typeof _0x30109e!==_0x4510d2(0xa9)){_0x236096[_0x46ee10]=_0x30109e;try{writeFileSync(configPath,JSON['stringify'](_0x236096,null,0x2),{'encoding':'utf8'});}catch(_0x365221){return a23_0x25589c(Box,{'children':a23_0x25589c(Text,{'color':_0x4510d2(0xb4),'children':_0x4510d2(0xac)})});}return null;}return a23_0x25589c(Box,{'children':a23_0x25589c(Text,{'color':_0x4510d2(0xb4),'children':'未提供配置值'})});}}if(_0x134b87===_0x4510d2(0xb8)){if(_0x46ee10)return console['log'](_0x236096[_0x46ee10]||_0x4510d2(0xa9)),null;return null;}if(_0x134b87===_0x4510d2(0xab))return console[_0x4510d2(0xad)](JSON[_0x4510d2(0xb7)](_0x236096,null,0x2)),null;if(!_0xae8142||!_0x37f7ea)return a23_0x25589c(ConfigHelp,{});return null;}function a23_0x1482(){const _0x5e45ff=['stringify','get','100745baWSwX','input','221710ykOhLH','8372DaFUkI','2601910bnjuRe','824mpAwsT','undefined','includes','list','保存配置失败','log','set','30XebhcO','18cUHsiY','1020820ejtrmZ','length','45268MMBTji','red','178074UKgdGP','.lovrabetrc'];a23_0x1482=function(){return _0x5e45ff;};return a23_0x1482();}
@@ -0,0 +1 @@
1
+ const a24_0x40f68c=a24_0x30e3;(function(_0x3811e8,_0x5a0a79){const _0x250fe1=a24_0x30e3,_0x8c8f6d=_0x3811e8();while(!![]){try{const _0x1be0ef=-parseInt(_0x250fe1(0x1cc))/0x1+parseInt(_0x250fe1(0x1c6))/0x2+parseInt(_0x250fe1(0x1c8))/0x3+parseInt(_0x250fe1(0x1cb))/0x4*(-parseInt(_0x250fe1(0x1c7))/0x5)+-parseInt(_0x250fe1(0x1c9))/0x6*(parseInt(_0x250fe1(0x1ca))/0x7)+-parseInt(_0x250fe1(0x1ce))/0x8+parseInt(_0x250fe1(0x1cd))/0x9;if(_0x1be0ef===_0x5a0a79)break;else _0x8c8f6d['push'](_0x8c8f6d['shift']());}catch(_0x537133){_0x8c8f6d['push'](_0x8c8f6d['shift']());}}}(a24_0x4cd8,0xe7cbe));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a24_0x40f68c(0x1c5)?a24_0x40f68c(0x1c3):'https://user-daily.lovrabet.com';function a24_0x4cd8(){const _0x2ca24d=['online','3310070ZntIat','212395bykjsq','1050516grDomE','444474LEkxmd','7aYclpf','160LgPZwX','1030168WskJbF','20243259XsCvoU','4012904uKjuZV','https://user.lovrabet.com','https://api.lovrabet.com'];a24_0x4cd8=function(){return _0x2ca24d;};return a24_0x4cd8();}function a24_0x30e3(_0x5a17cb,_0x1bdd0a){const _0x4cd84c=a24_0x4cd8();return a24_0x30e3=function(_0x30e390,_0x4ed987){_0x30e390=_0x30e390-0x1c3;let _0x27f234=_0x4cd84c[_0x30e390];return _0x27f234;},a24_0x30e3(_0x5a17cb,_0x1bdd0a);}export const getApiDomain=()=>getEnv()===a24_0x40f68c(0x1c5)?a24_0x40f68c(0x1c4):'https://daily-api.lovrabet.com';
@@ -0,0 +1 @@
1
+ function a25_0x5c2c(_0x2a302e,_0x582473){const _0x457ff3=a25_0x457f();return a25_0x5c2c=function(_0x5c2c33,_0x4dddf0){_0x5c2c33=_0x5c2c33-0xcf;let _0x563ac0=_0x457ff3[_0x5c2c33];return _0x563ac0;},a25_0x5c2c(_0x2a302e,_0x582473);}const a25_0x246f26=a25_0x5c2c;function a25_0x457f(){const _0x59b49f=['1055PdDrSJ','562347HovONd','659439BsvOxR','online','711396AfIolT','5142pySjJe','61kHZnoP','738984SJRTlV','1478aGAeBI','906440cmJSLe'];a25_0x457f=function(){return _0x59b49f;};return a25_0x457f();}(function(_0x180559,_0x339a60){const _0x3a41f2=a25_0x5c2c,_0x34ec83=_0x180559();while(!![]){try{const _0x40c26f=-parseInt(_0x3a41f2(0xd0))/0x1*(parseInt(_0x3a41f2(0xd2))/0x2)+-parseInt(_0x3a41f2(0xd6))/0x3+parseInt(_0x3a41f2(0xd3))/0x4+-parseInt(_0x3a41f2(0xd4))/0x5*(-parseInt(_0x3a41f2(0xcf))/0x6)+-parseInt(_0x3a41f2(0xd8))/0x7+parseInt(_0x3a41f2(0xd1))/0x8+parseInt(_0x3a41f2(0xd5))/0x9;if(_0x40c26f===_0x339a60)break;else _0x34ec83['push'](_0x34ec83['shift']());}catch(_0x711a33){_0x34ec83['push'](_0x34ec83['shift']());}}}(a25_0x457f,0x2fcbd));let env=process['env']['LOVRABET_ENV']||a25_0x246f26(0xd7);export function getEnv(){return env;}export function initEnv(_0x30a2ad){env=_0x30a2ad;}
@@ -0,0 +1 @@
1
+ (function(_0x1805a3,_0x296e1b){const _0x4ada04=a26_0x4026,_0x239e19=_0x1805a3();while(!![]){try{const _0x15befa=parseInt(_0x4ada04(0xf4))/0x1+parseInt(_0x4ada04(0x103))/0x2+-parseInt(_0x4ada04(0xeb))/0x3+parseInt(_0x4ada04(0xf9))/0x4*(-parseInt(_0x4ada04(0xd1))/0x5)+parseInt(_0x4ada04(0xdc))/0x6+-parseInt(_0x4ada04(0xfa))/0x7*(parseInt(_0x4ada04(0xd9))/0x8)+-parseInt(_0x4ada04(0xca))/0x9*(-parseInt(_0x4ada04(0xdd))/0xa);if(_0x15befa===_0x296e1b)break;else _0x239e19['push'](_0x239e19['shift']());}catch(_0xd36227){_0x239e19['push'](_0x239e19['shift']());}}}(a26_0x5a1f,0x66b0e));import{jsx as a26_0x56ee04,jsxs as a26_0xec85bf,Fragment as a26_0x4ec71e}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a26_0x5a1f(){const _0xea5e13=['项目名不合法','8UIabgJ','√\x20检测到有效登录状态','[可选]:\x20','3935712ioHCQr','184010NwxXGv','login-prompt','Yes','gray','登录状态','creating','length','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','\x20直接回车确认,或输入自定义名称','test','step','*\x20正在登录,请前往浏览器完成登录...','\x20←\x20','login-process','2493114DhMlvm','trim','项目名','project-name','*\x20创建新项目','未设置','*\x20项目名:\x20','map','label','361671cvfOYf','应用AppCode长度不能超过\x20100\x20个字符','column','login-check','*\x20应用AppCode\x20','708fkyEhM','3767393FEmJZb','delete','*\x20正在检查登录状态...','\x20\x20使用\x20←→\x20选择,回车确认','leftArrow','red','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','跳过登录','app-code','947392TpeFKn','已登录','rightArrow','登录失败','\x20检查中...','green','531aWxrKV','*\x20是否要自动拉取\x20API\x20配置?','应用AppCode','slice','!\x20未检测到有效登录','cyan','confirm-api-pull','22235lEAJTu','login','includes','项目名长度不能超过\x2050\x20个字符','yellow','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','api-pull'];a26_0x5a1f=function(){return _0xea5e13;};return a26_0x5a1f();}function a26_0x4026(_0x1876f6,_0x546dd3){const _0x5a1fd5=a26_0x5a1f();return a26_0x4026=function(_0x40260c,_0x156567){_0x40260c=_0x40260c-0xc7;let _0x2d1a90=_0x5a1fd5[_0x40260c];return _0x2d1a90;},a26_0x4026(_0x1876f6,_0x546dd3);}import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';export function EnhancedGuidedCreate(_0x2283c1){const _0x14bb6d=a26_0x4026,{onCreate:_0x563a9d}=_0x2283c1,[_0x4a7e0e,_0x152116]=useState('project-name'),[_0x577ea6,_0x463ff8]=useState(''),[_0x3c4e96,_0x4e74a4]=useState(''),[_0x53236d,_0x26e2c9]=useState(''),[_0x4d0d99,_0x1bbe71]=useState(''),[_0x4444f3,_0x36665a]=useState([]),[_0x364a5b,_0x670d82]=useState(null),[_0x2a8b83,_0x3293ce]=useState(![]),[_0x246225,_0x46f4d2]=useState(![]),[_0x518bc9,_0x5973c8]=useState(![]),[_0x5991ef,_0x1dc219]=useState(0x0),[_0x5075a6,_0x3bfb74]=useState(0x0),_0x4e7e7e='my-app';function _0x49b888(_0x1c2611){const _0x3b628f=a26_0x4026;if(_0x1c2611[_0x3b628f(0xe3)]>0x32)return{'valid':![],'message':_0x3b628f(0xd4)};const _0x518298=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1c2611?.[_0x3b628f(0xec)]()&&!_0x518298[_0x3b628f(0xe6)](_0x1c2611))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x5c5507(_0x314145){const _0x5a258a=a26_0x4026;if(!_0x314145[_0x5a258a(0xec)]())return{'valid':!![]};if(_0x314145[_0x5a258a(0xe3)]>0x64)return{'valid':![],'message':_0x5a258a(0xf5)};const _0x47dc1d=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x47dc1d[_0x5a258a(0xe6)](_0x314145))return{'valid':![],'message':'应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头'};return{'valid':!![]};}async function _0x59f50c(){_0x3293ce(!![]);try{const _0x440a20=await getIsSessionValid();return _0x670d82(_0x440a20),_0x440a20;}catch(_0x3fdc1d){return _0x670d82(![]),![];}finally{_0x3293ce(![]);}}async function _0x3ad262(){_0x46f4d2(!![]);try{const _0x3b5ea7=await authServer({'silent':!![]});return _0x670d82(_0x3b5ea7),_0x3b5ea7;}catch(_0x13d9a8){return _0x670d82(![]),![];}finally{_0x46f4d2(![]);}}return useInput(async(_0xf805df,_0x43927f)=>{const _0x34bb58=a26_0x4026;if(_0x43927f[_0x34bb58(0xfe)]||_0x43927f[_0x34bb58(0x105)]){if(_0x4a7e0e===_0x34bb58(0xd0)){_0x1dc219(_0x8370d3=>_0x8370d3===0x0?0x1:0x0);return;}if(_0x4a7e0e===_0x34bb58(0xde)){_0x3bfb74(_0x303983=>_0x303983===0x0?0x1:0x0);return;}}if(_0x43927f['return']){if(_0x4a7e0e==='project-name'){const _0x66b0ad=_0x53236d[_0x34bb58(0xec)]()||_0x4e7e7e;if(_0x4d0d99)return;_0x463ff8(_0x66b0ad),_0x36665a([{'step':_0x34bb58(0xee),'label':_0x34bb58(0xed),'value':_0x66b0ad}]),_0x26e2c9(''),_0x1bbe71(''),_0x152116(_0x34bb58(0x102));return;}if(_0x4a7e0e===_0x34bb58(0x102)){if(_0x4d0d99)return;const _0x4872f0=_0x53236d['trim']();_0x4e74a4(_0x4872f0),_0x36665a(_0x5243f2=>[..._0x5243f2,{'step':'app-code','label':_0x34bb58(0xcc),'value':_0x4872f0||_0x34bb58(0xf0)}]),_0x26e2c9(''),_0x1bbe71('');if(_0x4872f0){_0x152116(_0x34bb58(0xf7));const _0x4c3f99=await _0x59f50c();_0x4c3f99?_0x152116(_0x34bb58(0xd0)):_0x152116(_0x34bb58(0xde));}else _0x563a9d({'projectName':_0x577ea6,'appCode':undefined,'pullApi':![]}),_0x152116(_0x34bb58(0xe2));return;}if(_0x4a7e0e===_0x34bb58(0xd0)){const _0x39f149=_0x5991ef===0x0;_0x5973c8(_0x39f149),_0x36665a(_0x3df7c0=>[..._0x3df7c0,{'step':_0x34bb58(0xd7),'label':'拉取API配置','value':_0x39f149?'是':'否'}]),_0x563a9d({'projectName':_0x577ea6,'appCode':_0x3c4e96,'pullApi':_0x39f149}),_0x152116(_0x34bb58(0xe2));return;}if(_0x4a7e0e===_0x34bb58(0xde)){const _0x5dd85b=_0x5075a6===0x0;if(_0x5dd85b){_0x152116(_0x34bb58(0xea));const _0x428ed4=await _0x3ad262();_0x428ed4?(_0x36665a(_0x8f8777=>[..._0x8f8777,{'step':_0x34bb58(0xd2),'label':'登录状态','value':_0x34bb58(0x104)}]),_0x152116('confirm-api-pull')):(_0x36665a(_0x322882=>[..._0x322882,{'step':_0x34bb58(0xd2),'label':_0x34bb58(0xe1),'value':_0x34bb58(0xc7)}]),_0x563a9d({'projectName':_0x577ea6,'appCode':_0x3c4e96,'pullApi':![]}),_0x152116(_0x34bb58(0xe2)));}else _0x36665a(_0x395027=>[..._0x395027,{'step':'login','label':_0x34bb58(0xe1),'value':_0x34bb58(0x101)}]),_0x563a9d({'projectName':_0x577ea6,'appCode':_0x3c4e96,'pullApi':![]}),_0x152116('creating');return;}}if(_0x43927f['backspace']||_0x43927f[_0x34bb58(0xfb)]){_0x26e2c9(_0x5d991f=>{const _0x2a257d=_0x34bb58,_0x4cd2f1=_0x5d991f[_0x2a257d(0xcd)](0x0,-0x1);if(_0x4a7e0e===_0x2a257d(0xee)){const {valid:_0x3b07b0,message:_0x3e5c40}=_0x49b888(_0x4cd2f1);_0x1bbe71(_0x3b07b0?'':_0x3e5c40||_0x2a257d(0xd8));}else{if(_0x4a7e0e===_0x2a257d(0x102)){const {valid:_0x17c922,message:_0x2ece25}=_0x5c5507(_0x4cd2f1);_0x1bbe71(_0x17c922?'':_0x2ece25||'应用AppCode不合法');}}return _0x4cd2f1;});return;}if([_0x34bb58(0xe2),_0x34bb58(0xf7),'login-process'][_0x34bb58(0xd3)](_0x4a7e0e))return;if(_0x4a7e0e===_0x34bb58(0xd0)||_0x4a7e0e==='login-prompt')return;_0x26e2c9(_0x59117d=>{const _0x34e7dd=_0x34bb58,_0x5cb57a=_0x59117d+_0xf805df;if(_0x4a7e0e===_0x34e7dd(0xee)){const {valid:_0x4fb5e0,message:_0x1f290f}=_0x49b888(_0x5cb57a);_0x1bbe71(_0x4fb5e0?'':_0x1f290f||_0x34e7dd(0xd8));}else{if(_0x4a7e0e==='app-code'){const {valid:_0x3b9afc,message:_0x394b8c}=_0x5c5507(_0x5cb57a);_0x1bbe71(_0x3b9afc?'':_0x394b8c||'应用AppCode不合法');}}return _0x5cb57a;});}),a26_0xec85bf(Box,{'flexDirection':_0x14bb6d(0xf6),'marginTop':0x1,'children':[_0x4444f3[_0x14bb6d(0xe3)]===0x0&&a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':_0x14bb6d(0xcf),'children':_0x14bb6d(0xef)})}),_0x4444f3[_0x14bb6d(0xf2)](_0x35c23a=>a26_0xec85bf(Box,{'children':[a26_0xec85bf(Text,{'color':_0x14bb6d(0xc9),'children':['√\x20',_0x35c23a[_0x14bb6d(0xf3)],':\x20']}),a26_0x56ee04(Text,{'color':'cyan','children':_0x35c23a['value']})]},_0x35c23a[_0x14bb6d(0xe7)])),_0x4a7e0e===_0x14bb6d(0xee)&&a26_0xec85bf(a26_0x4ec71e,{'children':[a26_0xec85bf(Box,{'children':[a26_0x56ee04(Text,{'children':_0x14bb6d(0xf1)}),_0x53236d?a26_0x56ee04(Text,{'color':_0x14bb6d(0xc9),'children':_0x53236d}):a26_0x56ee04(Text,{'color':_0x14bb6d(0xe0),'children':_0x4e7e7e}),_0x4d0d99&&a26_0xec85bf(Text,{'color':_0x14bb6d(0xff),'children':['\x20←\x20',_0x4d0d99]})]}),!_0x4d0d99&&!_0x53236d&&a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':_0x14bb6d(0xe0),'children':_0x14bb6d(0xe5)})})]}),_0x4a7e0e===_0x14bb6d(0x102)&&a26_0xec85bf(a26_0x4ec71e,{'children':[a26_0xec85bf(Box,{'children':[a26_0x56ee04(Text,{'children':_0x14bb6d(0xf8)}),a26_0x56ee04(Text,{'color':_0x14bb6d(0xe0),'children':_0x14bb6d(0xdb)}),a26_0x56ee04(Text,{'color':_0x14bb6d(0xc9),'children':_0x53236d}),_0x4d0d99&&a26_0xec85bf(Text,{'color':_0x14bb6d(0xff),'children':[_0x14bb6d(0xe9),_0x4d0d99]})]}),!_0x4d0d99&&a26_0x56ee04(Box,{'children':a26_0xec85bf(Text,{'color':_0x14bb6d(0xe0),'children':['\x20',_0x14bb6d(0xd6)]})})]}),_0x4a7e0e==='login-check'&&a26_0xec85bf(Box,{'children':[a26_0x56ee04(Text,{'children':_0x14bb6d(0xfc)}),_0x2a8b83&&a26_0x56ee04(Text,{'color':_0x14bb6d(0xe0),'children':_0x14bb6d(0xc8)})]}),_0x4a7e0e==='confirm-api-pull'&&a26_0xec85bf(a26_0x4ec71e,{'children':[a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':'green','children':_0x14bb6d(0xda)})}),a26_0x56ee04(Box,{'marginTop':0x1,'children':a26_0x56ee04(Text,{'children':_0x14bb6d(0xcb)})}),a26_0xec85bf(Box,{'marginLeft':0x2,'children':[a26_0xec85bf(Text,{'color':_0x5991ef===0x0?_0x14bb6d(0xc9):'gray','children':[_0x5991ef===0x0?'▶\x20':'\x20\x20',_0x14bb6d(0xdf)]}),a26_0x56ee04(Text,{'children':'\x20'}),a26_0xec85bf(Text,{'color':_0x5991ef===0x1?_0x14bb6d(0xc9):'gray','children':[_0x5991ef===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':_0x14bb6d(0xe0),'children':_0x14bb6d(0xfd)})}),a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':'yellow','children':_0x14bb6d(0xe4)})})]}),_0x4a7e0e===_0x14bb6d(0xde)&&a26_0xec85bf(a26_0x4ec71e,{'children':[a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':_0x14bb6d(0xd5),'children':_0x14bb6d(0xce)})}),a26_0x56ee04(Box,{'marginTop':0x1,'children':a26_0x56ee04(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a26_0xec85bf(Box,{'marginLeft':0x2,'children':[a26_0xec85bf(Text,{'color':_0x5075a6===0x0?_0x14bb6d(0xc9):'gray','children':[_0x5075a6===0x0?'▶\x20':'\x20\x20',_0x14bb6d(0xdf)]}),a26_0x56ee04(Text,{'children':'\x20'}),a26_0xec85bf(Text,{'color':_0x5075a6===0x1?_0x14bb6d(0xc9):'gray','children':[_0x5075a6===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':'gray','children':_0x14bb6d(0xfd)})}),a26_0x56ee04(Box,{'children':a26_0x56ee04(Text,{'color':_0x14bb6d(0xd5),'children':_0x14bb6d(0x100)})})]}),_0x4a7e0e==='login-process'&&a26_0xec85bf(Box,{'children':[a26_0x56ee04(Text,{'children':_0x14bb6d(0xe8)}),_0x246225&&a26_0x56ee04(Text,{'color':_0x14bb6d(0xe0),'children':'\x20登录中...'})]})]});}
@@ -0,0 +1 @@
1
+ function a27_0x89c5(){const _0x48a335=['6757248gxOzHm','109484rnnJzF','396SoMfhC','271656FIQYlF','50681ERzpRP','85CDCWVn','315AmjOFR','now','replace','1967UdoOcS','toFixed','701170XZjCtM','2379957HFNSrn'];a27_0x89c5=function(){return _0x48a335;};return a27_0x89c5();}function a27_0x3c89(_0x75d87,_0x38240f){const _0x89c552=a27_0x89c5();return a27_0x3c89=function(_0x3c89ee,_0x3541b){_0x3c89ee=_0x3c89ee-0x77;let _0x71c8a6=_0x89c552[_0x3c89ee];return _0x71c8a6;},a27_0x3c89(_0x75d87,_0x38240f);}(function(_0x52184a,_0x1be920){const _0x30ba4b=a27_0x3c89,_0x4ba162=_0x52184a();while(!![]){try{const _0x30c086=-parseInt(_0x30ba4b(0x83))/0x1+parseInt(_0x30ba4b(0x82))/0x2+-parseInt(_0x30ba4b(0x7e))/0x3+-parseInt(_0x30ba4b(0x80))/0x4*(parseInt(_0x30ba4b(0x77))/0x5)+parseInt(_0x30ba4b(0x81))/0x6*(parseInt(_0x30ba4b(0x7b))/0x7)+-parseInt(_0x30ba4b(0x7f))/0x8+parseInt(_0x30ba4b(0x78))/0x9*(parseInt(_0x30ba4b(0x7d))/0xa);if(_0x30c086===_0x1be920)break;else _0x4ba162['push'](_0x4ba162['shift']());}catch(_0x244130){_0x4ba162['push'](_0x4ba162['shift']());}}}(a27_0x89c5,0x6ef6a));export function formatElapsed(_0xf2c8b5){const _0x12f5b0=a27_0x3c89,_0x309d5e=Date[_0x12f5b0(0x79)]()-_0xf2c8b5;if(_0x309d5e<0x3e8)return _0x309d5e+'ms';const _0x19f7dd=(_0x309d5e/0x3e8)[_0x12f5b0(0x7c)](0x2),_0x2cac83=_0x19f7dd[_0x12f5b0(0x7a)](/\.?0+$/u,'');return _0x2cac83+'s';}
@@ -0,0 +1 @@
1
+ function a28_0x217a(_0xed1b10,_0x297f8d){const _0x180bbe=a28_0x180b();return a28_0x217a=function(_0x217a7d,_0x17b155){_0x217a7d=_0x217a7d-0x1dc;let _0x58b82d=_0x180bbe[_0x217a7d];return _0x58b82d;},a28_0x217a(_0xed1b10,_0x297f8d);}(function(_0xde7cd,_0x251361){const _0x3cddd0=a28_0x217a,_0x3e82ad=_0xde7cd();while(!![]){try{const _0x2b4e19=parseInt(_0x3cddd0(0x1f9))/0x1+-parseInt(_0x3cddd0(0x200))/0x2+parseInt(_0x3cddd0(0x20c))/0x3+parseInt(_0x3cddd0(0x1e4))/0x4+parseInt(_0x3cddd0(0x1fd))/0x5*(-parseInt(_0x3cddd0(0x215))/0x6)+-parseInt(_0x3cddd0(0x1e9))/0x7*(parseInt(_0x3cddd0(0x1e7))/0x8)+parseInt(_0x3cddd0(0x1ef))/0x9*(parseInt(_0x3cddd0(0x1e0))/0xa);if(_0x2b4e19===_0x251361)break;else _0x3e82ad['push'](_0x3e82ad['shift']());}catch(_0x4c0044){_0x3e82ad['push'](_0x3e82ad['shift']());}}}(a28_0x180b,0x97196));import{jsx as a28_0x34f0c1,Fragment as a28_0x21606c,jsxs as a28_0x3fee18}from'react/jsx-runtime';import a28_0x373243 from'node:path';import a28_0x6d3d6b from'node:fs';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{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';function a28_0x180b(){const _0x2c0e3c=['10dyeZBe','log','white','2.\x20','3618704CPaUro','项目创建失败:\x20','resolve','8904uChwvP','\x20配置应用AppCode:\x20','6293OxkKAU','message','projectCode','lovrabet\x20api\x20pull','join','\x20创建配置文件','15531642hVDqmP','gray','column','doTask','配置应用AppCode:\x20','\x20&&\x20lovrabet\x20start','cyan','启动项目:\x20','\x20|\x20应用AppCode:\x20','\x20√\x20','573059PktYCD','🎉\x20项目创建成功!','项目创建完成:\x20','API\x20配置拉取成功:\x20','35MXyndD','error','项目名称:\x20','2351364haIeLp','existsSync','拉取API配置:\x20','info','📁\x20项目名称:\x20','*\x20配置文件路径:\x20','pullApi','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20app\x20<app-code>\x27\x20配置','writeFileSync','🔗\x20应用AppCode:\x20','yellow','success','1053951LooMYJ','*\x20正在为项目\x20','repeat','1.\x20','utf8','warn','lovrabet\x20config\x20set\x20app\x20[app-code]','cwd','toISOString','651102UzWBth','√\x20配置文件已创建,应用AppCode:\x20','projectName','未配置','1.0.0','开始创建项目:\x20','appCode','×\x20项目目录\x20','setLogPath','create','green','.lovrabetrc','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','\x20已存在,请使用其他项目名'];a28_0x180b=function(){return _0x2c0e3c;};return a28_0x180b();}import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x1ad692){const _0x5f4824=a28_0x217a,[_0x2ec882,_0x2f0d96]=useState(![]),[_0x305527,_0xe4a782]=useState(![]),[_0x500d06,_0x142e1e]=useState(null),_0x18c4c1=useCopyProjectTemplate(),_0x59b1fc=useInstallDependencies(),_0x373802=useFormatCode(),_0x41565b=async _0x121796=>{const _0x342399=a28_0x217a,_0x436135=a28_0x373243[_0x342399(0x1e6)](process[_0x342399(0x213)](),_0x121796['projectName']);if(a28_0x6d3d6b[_0x342399(0x201)](_0x436135)){console['error'](_0x342399(0x21c)+_0x121796[_0x342399(0x217)]+_0x342399(0x1df));return;}_0x142e1e(_0x121796),_0x2f0d96(!![]),logger[_0x342399(0x21d)](_0x436135),logger[_0x342399(0x203)](_0x342399(0x21e),_0x342399(0x21a)+_0x121796[_0x342399(0x217)],{'projectDir':_0x436135,'appCode':_0x121796['appCode']});try{await _0x18c4c1[_0x342399(0x1f2)](_0x121796['projectName']),await _0x59b1fc[_0x342399(0x1f2)](_0x121796[_0x342399(0x217)]),await _0x373802[_0x342399(0x1f2)](_0x121796[_0x342399(0x217)]),await _0x2c510d(_0x121796[_0x342399(0x217)],_0x121796[_0x342399(0x21b)]||'');if(_0x121796[_0x342399(0x206)]&&_0x121796[_0x342399(0x21b)]){console['log']('*\x20正在拉取\x20API\x20配置...');const _0x469d77=await pullApiSilent(_0x121796['appCode'],undefined,_0x436135);_0x469d77?(console[_0x342399(0x1e1)]('√\x20API\x20配置拉取完成'),logger[_0x342399(0x203)](_0x342399(0x21e),_0x342399(0x1fc)+_0x121796['appCode'],{'projectDir':_0x436135,'appCode':_0x121796[_0x342399(0x21b)]})):(console['log'](_0x342399(0x1de)),logger[_0x342399(0x211)]('create','API\x20配置拉取失败:\x20'+_0x121796[_0x342399(0x21b)],{'projectDir':_0x436135,'appCode':_0x121796[_0x342399(0x21b)]}));}logger[_0x342399(0x20b)](_0x342399(0x21e),_0x342399(0x1fb)+_0x121796[_0x342399(0x217)]),_0xe4a782(!![]),_0x2f0d96(![]);}catch(_0x21a129){logger[_0x342399(0x1fe)]('create',_0x342399(0x1e5)+_0x121796[_0x342399(0x217)],{'error':_0x21a129 instanceof Error?_0x21a129[_0x342399(0x1ea)]:String(_0x21a129)}),_0x2f0d96(![]);throw _0x21a129;}},_0x590f86=async _0x5abc1a=>{await _0x41565b({'projectName':_0x5abc1a});},_0x2c510d=async(_0x737ef5,_0x446da4)=>{const _0x83cd9b=a28_0x217a,_0x2d5d95=a28_0x373243[_0x83cd9b(0x1e6)](process['cwd'](),_0x737ef5),_0x314781=a28_0x373243[_0x83cd9b(0x1ed)](_0x2d5d95,_0x83cd9b(0x1dd));try{_0x446da4?console[_0x83cd9b(0x1e1)](_0x83cd9b(0x20d)+_0x737ef5+_0x83cd9b(0x1e8)+_0x446da4):console['log'](_0x83cd9b(0x20d)+_0x737ef5+_0x83cd9b(0x1ee));console[_0x83cd9b(0x1e1)](_0x83cd9b(0x205)+_0x314781);const _0x5e2256={'app':_0x446da4||'','createdAt':new Date()[_0x83cd9b(0x214)](),'version':_0x83cd9b(0x219)};a28_0x6d3d6b[_0x83cd9b(0x208)](_0x314781,JSON['stringify'](_0x5e2256,null,0x2),_0x83cd9b(0x210)),_0x446da4?console[_0x83cd9b(0x1e1)](_0x83cd9b(0x216)+_0x446da4):console[_0x83cd9b(0x1e1)](_0x83cd9b(0x207)),logger['info'](_0x83cd9b(0x21e),_0x83cd9b(0x1f3)+_0x446da4,{'projectName':_0x737ef5,'configFile':_0x83cd9b(0x1dd)});}catch(_0x429c53){logger[_0x83cd9b(0x1fe)]('create','配置应用AppCode失败:\x20'+_0x446da4,{'projectName':_0x737ef5,'error':_0x429c53 instanceof Error?_0x429c53[_0x83cd9b(0x1ea)]:String(_0x429c53)});}};useEffect(()=>{const _0x1475b1=a28_0x217a;_0x1ad692[_0x1475b1(0x1eb)]&&_0x590f86(_0x1ad692[_0x1475b1(0x1eb)]);},[_0x1ad692[_0x5f4824(0x1eb)]]);if(!_0x2ec882&&!_0x305527&&!_0x1ad692['projectCode'])return a28_0x34f0c1(EnhancedGuidedCreate,{'onCreate':_0x41565b});if(_0x2ec882)return a28_0x3fee18(a28_0x21606c,{'children':[a28_0x3fee18(Box,{'marginTop':0x1,'children':[a28_0x34f0c1(Box,{'width':'1'}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'children':_0x5f4824(0x1f8)}),a28_0x34f0c1(Text,{'children':_0x5f4824(0x1ff)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'children':_0x500d06?.[_0x5f4824(0x217)]}),_0x500d06?.[_0x5f4824(0x21b)]&&a28_0x3fee18(a28_0x21606c,{'children':[a28_0x34f0c1(Text,{'children':_0x5f4824(0x1f7)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f5),'children':_0x500d06[_0x5f4824(0x21b)]})]})]}),a28_0x34f0c1(TaskRunning,{..._0x18c4c1}),a28_0x34f0c1(TaskRunning,{..._0x59b1fc}),a28_0x34f0c1(TaskRunning,{..._0x373802})]});if(_0x305527)return a28_0x3fee18(a28_0x21606c,{'children':[a28_0x3fee18(Box,{'marginTop':0x1,'children':[a28_0x34f0c1(Box,{'width':'1'}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'children':_0x5f4824(0x1f8)}),a28_0x34f0c1(Text,{'children':_0x5f4824(0x1ff)}),a28_0x34f0c1(Text,{'color':'green','children':_0x500d06?.['projectName']}),_0x500d06?.[_0x5f4824(0x21b)]&&a28_0x3fee18(a28_0x21606c,{'children':[a28_0x34f0c1(Text,{'children':_0x5f4824(0x1f7)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f5),'children':_0x500d06[_0x5f4824(0x21b)]})]})]}),a28_0x34f0c1(TaskFinished,{..._0x18c4c1}),a28_0x34f0c1(TaskFinished,{..._0x59b1fc}),a28_0x34f0c1(TaskFinished,{..._0x373802}),a28_0x34f0c1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'children':'─'[_0x5f4824(0x20e)](0x3c)})}),a28_0x34f0c1(Box,{'children':a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'bold':!![],'children':_0x5f4824(0x1fa)})}),a28_0x3fee18(Box,{'marginTop':0x1,'flexDirection':'column','children':[a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f5),'children':_0x5f4824(0x204)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1e2),'bold':!![],'children':_0x500d06?.['projectName']})]}),_0x500d06?.[_0x5f4824(0x21b)]&&a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f5),'children':_0x5f4824(0x209)}),a28_0x34f0c1(Text,{'color':'white','bold':!![],'children':_0x500d06['appCode']})]}),a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':'cyan','children':'📦\x20API配置:\x20'}),_0x500d06?.[_0x5f4824(0x206)]?a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'bold':!![],'children':'已自动拉取\x20✓'}):_0x500d06?.[_0x5f4824(0x21b)]?a28_0x34f0c1(Text,{'color':_0x5f4824(0x20a),'bold':!![],'children':'需手动拉取'}):a28_0x34f0c1(Text,{'color':'gray','bold':!![],'children':_0x5f4824(0x218)})]})]}),a28_0x34f0c1(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x34f0c1(Text,{'color':'cyan','bold':!![],'children':'🚀\x20接下来可以:'})}),a28_0x3fee18(Box,{'marginLeft':0x2,'flexDirection':_0x5f4824(0x1f1),'children':[a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'children':_0x5f4824(0x20f)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1e2),'children':_0x5f4824(0x1f6)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f5),'bold':!![],'children':'cd\x20'+_0x500d06?.['projectName']+_0x5f4824(0x1f4)})]}),_0x500d06?.[_0x5f4824(0x21b)]&&!_0x500d06?.[_0x5f4824(0x206)]&&a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':_0x5f4824(0x20a),'children':_0x5f4824(0x1e3)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1e2),'children':_0x5f4824(0x202)}),a28_0x34f0c1(Text,{'color':'cyan','bold':!![],'children':_0x5f4824(0x1ec)})]}),!_0x500d06?.['appCode']&&a28_0x3fee18(a28_0x21606c,{'children':[a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':'gray','children':_0x5f4824(0x1e3)}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1e2),'children':'配置AppCode:\x20'}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f5),'bold':!![],'children':_0x5f4824(0x212)})]}),a28_0x3fee18(Box,{'children':[a28_0x34f0c1(Text,{'color':_0x5f4824(0x1f0),'children':'3.\x20'}),a28_0x34f0c1(Text,{'color':_0x5f4824(0x1e2),'children':_0x5f4824(0x202)}),a28_0x34f0c1(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20api\x20pull\x20[app-code]'})]})]})]}),a28_0x34f0c1(Box,{'marginTop':0x1,'children':a28_0x34f0c1(Text,{'color':_0x5f4824(0x1dc),'children':'─'['repeat'](0x3c)})})]});return null;}
@@ -0,0 +1 @@
1
+ (function(_0xa83369,_0x439a77){var _0x580c26=a29_0x28aa,_0x48e694=_0xa83369();while(!![]){try{var _0x16c894=-parseInt(_0x580c26(0x17b))/0x1+-parseInt(_0x580c26(0x171))/0x2*(-parseInt(_0x580c26(0x170))/0x3)+-parseInt(_0x580c26(0x177))/0x4*(parseInt(_0x580c26(0x16d))/0x5)+-parseInt(_0x580c26(0x172))/0x6*(parseInt(_0x580c26(0x176))/0x7)+-parseInt(_0x580c26(0x17c))/0x8+parseInt(_0x580c26(0x17a))/0x9*(parseInt(_0x580c26(0x178))/0xa)+parseInt(_0x580c26(0x175))/0xb*(parseInt(_0x580c26(0x174))/0xc);if(_0x16c894===_0x439a77)break;else _0x48e694['push'](_0x48e694['shift']());}catch(_0x2a586a){_0x48e694['push'](_0x48e694['shift']());}}}(a29_0x3bf2,0x427ee));import{jsx as a29_0x2bcab1,jsxs as a29_0x13ee22}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';function a29_0x28aa(_0x5b96d4,_0x5698a5){var _0x3bf2dc=a29_0x3bf2();return a29_0x28aa=function(_0x28aae2,_0x5f1211){_0x28aae2=_0x28aae2-0x16d;var _0x570f3b=_0x3bf2dc[_0x28aae2];return _0x570f3b;},a29_0x28aa(_0x5b96d4,_0x5698a5);}function a29_0x3bf2(){var _0x17a728=['361632UforpP','209uSXTTi','511Rlabiz','3048fBPRjD','40bbEsFu','taskName','276741RNgotT','123317XODkZh','3642640bGmZRL','430XHURli','elapsed','green','1432680lWnpYs','2cNknXB','21090eGGltj','\x20√\x20'];a29_0x3bf2=function(){return _0x17a728;};return a29_0x3bf2();}export function TaskFinished(_0x242d2e){var _0x2b3c26=a29_0x28aa;return a29_0x13ee22(Box,{'children':[a29_0x2bcab1(Box,{'width':'1'}),a29_0x2bcab1(Text,{'color':_0x2b3c26(0x16f),'children':_0x2b3c26(0x173)}),a29_0x2bcab1(Text,{'children':_0x242d2e[_0x2b3c26(0x179)]}),a29_0x2bcab1(TaskTime,{'elapsed':_0x242d2e[_0x2b3c26(0x16e)]})]});}
@@ -0,0 +1 @@
1
+ (function(_0x4c393c,_0x4057d6){var _0x29db4c=a30_0x5b33,_0x1e4e0a=_0x4c393c();while(!![]){try{var _0x4b6aa2=-parseInt(_0x29db4c(0x188))/0x1+-parseInt(_0x29db4c(0x18b))/0x2+-parseInt(_0x29db4c(0x184))/0x3*(parseInt(_0x29db4c(0x18c))/0x4)+parseInt(_0x29db4c(0x18e))/0x5*(-parseInt(_0x29db4c(0x183))/0x6)+-parseInt(_0x29db4c(0x187))/0x7+parseInt(_0x29db4c(0x18f))/0x8*(-parseInt(_0x29db4c(0x18a))/0x9)+parseInt(_0x29db4c(0x181))/0xa*(parseInt(_0x29db4c(0x18d))/0xb);if(_0x4b6aa2===_0x4057d6)break;else _0x1e4e0a['push'](_0x1e4e0a['shift']());}catch(_0x218285){_0x1e4e0a['push'](_0x1e4e0a['shift']());}}}(a30_0x3276,0xf2526));import{jsx as a30_0x1c5420,jsxs as a30_0xd41aab}from'react/jsx-runtime';function a30_0x5b33(_0x4ddb58,_0x4f46f2){var _0x32760e=a30_0x3276();return a30_0x5b33=function(_0x5b33ba,_0x31210a){_0x5b33ba=_0x5b33ba-0x181;var _0x3673ab=_0x32760e[_0x5b33ba];return _0x3673ab;},a30_0x5b33(_0x4ddb58,_0x4f46f2);}import{Text}from'ink';import a30_0x2f113d from'ink-spinner';function a30_0x3276(){var _0x3118c2=['9287474IUSdJZ','703619VPlHbB','loading','2754099QbHvgR','2200806FGJVwf','376ymMuMX','9684895IBbZxA','3163700qKXpLe','40RRjdEo','90fKhlPx','dots','6hWUtRT','52272fIRsTF','green','\x20√\x20'];a30_0x3276=function(){return _0x3118c2;};return a30_0x3276();}export function TaskLoading(_0x52dea7){var _0x3f2cd8=a30_0x5b33;if(_0x52dea7['finished'])return a30_0x1c5420(Text,{'color':_0x3f2cd8(0x185),'children':_0x3f2cd8(0x186)});if(_0x52dea7[_0x3f2cd8(0x189)])return a30_0xd41aab(Text,{'color':_0x3f2cd8(0x185),'children':['\x20',a30_0x1c5420(a30_0x2f113d,{'type':_0x3f2cd8(0x182)}),'\x20']});return a30_0x1c5420(Text,{'children':'\x20\x20\x20'});}
@@ -0,0 +1 @@
1
+ (function(_0x403e29,_0x48da8b){var _0x5775cb=a31_0xa3cd,_0x51257c=_0x403e29();while(!![]){try{var _0x2d4785=parseInt(_0x5775cb(0xc3))/0x1*(parseInt(_0x5775cb(0xce))/0x2)+-parseInt(_0x5775cb(0xcb))/0x3*(-parseInt(_0x5775cb(0xc4))/0x4)+-parseInt(_0x5775cb(0xcc))/0x5*(-parseInt(_0x5775cb(0xca))/0x6)+-parseInt(_0x5775cb(0xcd))/0x7*(-parseInt(_0x5775cb(0xc8))/0x8)+-parseInt(_0x5775cb(0xc5))/0x9+parseInt(_0x5775cb(0xc7))/0xa+-parseInt(_0x5775cb(0xc6))/0xb;if(_0x2d4785===_0x48da8b)break;else _0x51257c['push'](_0x51257c['shift']());}catch(_0x179716){_0x51257c['push'](_0x51257c['shift']());}}}(a31_0x5bfa,0x2df7f));import{jsx as a31_0x1e34e7,jsxs as a31_0x4976b7}from'react/jsx-runtime';function a31_0x5bfa(){var _0x324dec=['2924490oeWevI','152MGsrwJ','taskName','73914SXWezr','3AgFqTU','5zOvBWv','5866Vunbve','607142EzAKcP','1shUekR','1431988XavLwD','409590uzULoJ','8233071NiKoWx'];a31_0x5bfa=function(){return _0x324dec;};return a31_0x5bfa();}import{Box,Text}from'ink';function a31_0xa3cd(_0x4a141b,_0x16e98f){var _0x5bfa18=a31_0x5bfa();return a31_0xa3cd=function(_0xa3cd8f,_0x36409e){_0xa3cd8f=_0xa3cd8f-0xc3;var _0x1cb8fa=_0x5bfa18[_0xa3cd8f];return _0x1cb8fa;},a31_0xa3cd(_0x4a141b,_0x16e98f);}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x5b3602){var _0xc4fc2e=a31_0xa3cd;return a31_0x4976b7(Box,{'children':[a31_0x1e34e7(Box,{'width':'1'}),a31_0x1e34e7(TaskLoading,{..._0x5b3602}),a31_0x1e34e7(Text,{'children':_0x5b3602[_0xc4fc2e(0xc9)]}),a31_0x1e34e7(TaskTime,{'elapsed':_0x5b3602['elapsed']})]});}
@@ -0,0 +1 @@
1
+ function a32_0x5365(_0xf0dc51,_0x3d798b){var _0x41e9a7=a32_0x41e9();return a32_0x5365=function(_0x536549,_0x10bf46){_0x536549=_0x536549-0x188;var _0x594f8b=_0x41e9a7[_0x536549];return _0x594f8b;},a32_0x5365(_0xf0dc51,_0x3d798b);}(function(_0x23625,_0x57d4e1){var _0x3251a9=a32_0x5365,_0x457aeb=_0x23625();while(!![]){try{var _0xe2aaf9=parseInt(_0x3251a9(0x191))/0x1+parseInt(_0x3251a9(0x18e))/0x2*(parseInt(_0x3251a9(0x18c))/0x3)+-parseInt(_0x3251a9(0x18f))/0x4*(-parseInt(_0x3251a9(0x18d))/0x5)+parseInt(_0x3251a9(0x18a))/0x6*(parseInt(_0x3251a9(0x189))/0x7)+-parseInt(_0x3251a9(0x188))/0x8*(-parseInt(_0x3251a9(0x192))/0x9)+parseInt(_0x3251a9(0x195))/0xa*(-parseInt(_0x3251a9(0x190))/0xb)+-parseInt(_0x3251a9(0x18b))/0xc;if(_0xe2aaf9===_0x57d4e1)break;else _0x457aeb['push'](_0x457aeb['shift']());}catch(_0x291795){_0x457aeb['push'](_0x457aeb['shift']());}}}(a32_0x41e9,0xdac5b));import{jsx as a32_0x1dfd7c,Fragment as a32_0x4c5da1,jsxs as a32_0x239b3f}from'react/jsx-runtime';function a32_0x41e9(){var _0x16799a=['121dEaFSH','753436vqMWaQ','177759DiifSv','elapsed','gray','1331870qtUyzu','8sJkUny','2302867xQyMeB','12QoQuSr','26114604DDHiYm','10071QwBalR','5gSuXfX','986pDBery','5804860zGufpC'];a32_0x41e9=function(){return _0x16799a;};return a32_0x41e9();}import{Text}from'ink';export function TaskTime(_0x5ca7ba){var _0x44e9c6=a32_0x5365;if(_0x5ca7ba[_0x44e9c6(0x193)])return a32_0x239b3f(a32_0x4c5da1,{'children':[a32_0x1dfd7c(Text,{'color':_0x44e9c6(0x194),'children':'\x20['}),a32_0x1dfd7c(Text,{'color':'gray','bold':!![],'children':_0x5ca7ba['elapsed']}),a32_0x1dfd7c(Text,{'color':_0x44e9c6(0x194),'children':']'})]});return null;}
@@ -0,0 +1 @@
1
+ const a33_0x1826b9=a33_0x1d29;(function(_0x50e514,_0x112f1d){const _0x142b77=a33_0x1d29,_0x3af1fc=_0x50e514();while(!![]){try{const _0x3d2901=parseInt(_0x142b77(0x72))/0x1+-parseInt(_0x142b77(0x84))/0x2*(-parseInt(_0x142b77(0x81))/0x3)+-parseInt(_0x142b77(0x73))/0x4*(-parseInt(_0x142b77(0x7f))/0x5)+-parseInt(_0x142b77(0x80))/0x6+parseInt(_0x142b77(0x7e))/0x7+parseInt(_0x142b77(0x79))/0x8+-parseInt(_0x142b77(0x7c))/0x9;if(_0x3d2901===_0x112f1d)break;else _0x3af1fc['push'](_0x3af1fc['shift']());}catch(_0x4a7484){_0x3af1fc['push'](_0x3af1fc['shift']());}}}(a33_0x2c65,0x19706));import a33_0x2ae78e from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';function a33_0x2c65(){const _0x137162=['907380TsLgfk','185046tWuwFq','项目模板复制失败','cwd','2cVrIfM','复制项目文件','152336DRhYGX','12SiZamC','项目模板复制完成','../../templates/projects/sub-app-react-demo','success','info','message','244976RVBqFq','copy','resolve','998910XaHjou','dirname','198779KcRvBB','155635yMrVjp'];a33_0x2c65=function(){return _0x137162;};return a33_0x2c65();}import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a33_0x1d29(_0x1fafdc,_0x369911){const _0x2c654b=a33_0x2c65();return a33_0x1d29=function(_0x1d292c,_0x52e6d7){_0x1d292c=_0x1d292c-0x72;let _0x258c07=_0x2c654b[_0x1d292c];return _0x258c07;},a33_0x1d29(_0x1fafdc,_0x369911);}const __dirname=a33_0x2ae78e[a33_0x1826b9(0x7d)](fileURLToPath(import.meta['url'])),templateDir=a33_0x2ae78e[a33_0x1826b9(0x7b)](__dirname,a33_0x1826b9(0x75));export function useCopyProjectTemplate(){const _0x340c1d=a33_0x1826b9,[_0x850de3,_0x1af543]=useState(![]),[_0x57c1dc,_0x55c44f]=useState(![]),[_0x21e3ec,_0x64973b]=useState(''),_0x268c5d=useCallback(async _0x187098=>{const _0x4ca4f2=a33_0x1d29,_0x562595=Date['now'](),_0x42eb81=a33_0x2ae78e[_0x4ca4f2(0x7b)](process[_0x4ca4f2(0x83)](),_0x187098);_0x1af543(!![]);try{logger[_0x4ca4f2(0x77)](_0x4ca4f2(0x7a),'开始复制项目模板',{'projectCode':_0x187098,'templateDir':templateDir}),await copyDirectory(templateDir,_0x42eb81);const _0xd93d0=Date['now']()-_0x562595;logger[_0x4ca4f2(0x76)]('copy',_0x4ca4f2(0x74),_0xd93d0,{'projectCode':_0x187098});}catch(_0x17ee9e){const _0x47e587=Date['now']()-_0x562595;logger['error']('copy',_0x4ca4f2(0x82),{'projectCode':_0x187098,'error':_0x17ee9e instanceof Error?_0x17ee9e[_0x4ca4f2(0x78)]:String(_0x17ee9e),'duration':_0x47e587});throw _0x17ee9e;}finally{_0x1af543(![]),_0x55c44f(!![]),_0x64973b(formatElapsed(_0x562595));}},[]);return{'taskName':_0x340c1d(0x85),'finished':_0x57c1dc,'loading':_0x850de3,'elapsed':_0x21e3ec,'doTask':_0x268c5d};}
@@ -0,0 +1 @@
1
+ (function(_0x24d93d,_0x359014){const _0x5938c2=a34_0x45a1,_0x83474f=_0x24d93d();while(!![]){try{const _0x2d2860=parseInt(_0x5938c2(0x7d))/0x1*(-parseInt(_0x5938c2(0x77))/0x2)+parseInt(_0x5938c2(0x75))/0x3*(-parseInt(_0x5938c2(0x76))/0x4)+-parseInt(_0x5938c2(0x70))/0x5+parseInt(_0x5938c2(0x6b))/0x6+parseInt(_0x5938c2(0x78))/0x7*(parseInt(_0x5938c2(0x6f))/0x8)+-parseInt(_0x5938c2(0x80))/0x9*(parseInt(_0x5938c2(0x6d))/0xa)+parseInt(_0x5938c2(0x7a))/0xb;if(_0x2d2860===_0x359014)break;else _0x83474f['push'](_0x83474f['shift']());}catch(_0x321a16){_0x83474f['push'](_0x83474f['shift']());}}}(a34_0x1aae,0x1fff4));import a34_0x427c36 from'node:path';import{useCallback,useState}from'react';function a34_0x45a1(_0x2853e0,_0x26709b){const _0x1aae26=a34_0x1aae();return a34_0x45a1=function(_0x45a16e,_0x128350){_0x45a16e=_0x45a16e-0x6b;let _0x312091=_0x1aae26[_0x45a16e];return _0x312091;},a34_0x45a1(_0x2853e0,_0x26709b);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a34_0x1aae(){const _0x9a15f3=['4327cBYAli','format','prettier','819810swtGTS','resolve','cwd','now','1022850eTZaNV','info','10xdyEyR','message','8fnRuTS','508890OvhZbn','error','success','格式化代码','--write','6EhIiuO','353788KujbNG','98QzAxtR','437626yvNIzx','npx','5278372kIfdwk','代码格式化完成','开始格式化代码'];a34_0x1aae=function(){return _0x9a15f3;};return a34_0x1aae();}export function useFormatCode(){const _0x53ebbd=a34_0x45a1,[_0x25db0c,_0x13423d]=useState(![]),[_0x253f23,_0x4aafb0]=useState(![]),[_0xb2c1d7,_0xabd0f7]=useState(''),_0x437071=useCallback(async _0x40b52a=>{const _0x5212f8=a34_0x45a1,_0x3f7184=Date[_0x5212f8(0x83)](),_0x3ac942=a34_0x427c36[_0x5212f8(0x81)](process[_0x5212f8(0x82)](),_0x40b52a);_0x13423d(!![]);try{logger[_0x5212f8(0x6c)]('format',_0x5212f8(0x7c),{'projectCode':_0x40b52a}),await execa(_0x5212f8(0x79),[_0x5212f8(0x7f),_0x5212f8(0x74),'.'],{'cwd':_0x3ac942});const _0x56e472=Date[_0x5212f8(0x83)]()-_0x3f7184;logger[_0x5212f8(0x72)]('format',_0x5212f8(0x7b),_0x56e472,{'projectCode':_0x40b52a});}catch(_0x364b42){const _0x87d8f2=Date[_0x5212f8(0x83)]()-_0x3f7184;logger[_0x5212f8(0x71)](_0x5212f8(0x7e),'代码格式化失败',{'projectCode':_0x40b52a,'error':_0x364b42 instanceof Error?_0x364b42[_0x5212f8(0x6e)]:String(_0x364b42),'duration':_0x87d8f2});throw _0x364b42;}finally{_0x13423d(![]),_0x4aafb0(!![]),_0xabd0f7(formatElapsed(_0x3f7184));}},[]);return{'taskName':_0x53ebbd(0x73),'finished':_0x253f23,'loading':_0x25db0c,'elapsed':_0xb2c1d7,'doTask':_0x437071};}
@@ -0,0 +1 @@
1
+ (function(_0x18263f,_0x558783){const _0x4bfb08=a35_0x339c,_0x2b43ac=_0x18263f();while(!![]){try{const _0x490d2f=parseInt(_0x4bfb08(0xdf))/0x1*(-parseInt(_0x4bfb08(0xdb))/0x2)+parseInt(_0x4bfb08(0xe2))/0x3*(-parseInt(_0x4bfb08(0xd1))/0x4)+parseInt(_0x4bfb08(0xe5))/0x5*(-parseInt(_0x4bfb08(0xdc))/0x6)+-parseInt(_0x4bfb08(0xd4))/0x7*(parseInt(_0x4bfb08(0xd3))/0x8)+parseInt(_0x4bfb08(0xe4))/0x9+parseInt(_0x4bfb08(0xd9))/0xa*(parseInt(_0x4bfb08(0xdd))/0xb)+-parseInt(_0x4bfb08(0xda))/0xc*(-parseInt(_0x4bfb08(0xe6))/0xd);if(_0x490d2f===_0x558783)break;else _0x2b43ac['push'](_0x2b43ac['shift']());}catch(_0x482768){_0x2b43ac['push'](_0x2b43ac['shift']());}}}(a35_0x5677,0xb69e5));import a35_0x48c04e from'node:path';function a35_0x339c(_0x28096b,_0x59eeef){const _0x5677fe=a35_0x5677();return a35_0x339c=function(_0x339c19,_0x1ba97e){_0x339c19=_0x339c19-0xd0;let _0x35f803=_0x5677fe[_0x339c19];return _0x35f803;},a35_0x339c(_0x28096b,_0x59eeef);}function a35_0x5677(){const _0x229465=['message','2mFMYrl','依赖安装完成','resolve','3345kbDHhB','开始安装依赖','5643909mwAShc','411865EFUgfk','351pebSnN','依赖安装失败','https://registry.npmmirror.com','install','2116XlPKwg','success','8qUqCKS','8445227LbmLIZ','now','error','cwd','npm','5286560asTHqS','1102932xYHcMa','845934xOUqPP','18NLOBZx','11aYbiBh'];a35_0x5677=function(){return _0x229465;};return a35_0x5677();}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const [_0x1f055b,_0x404df6]=useState(![]),[_0x288356,_0x3e0411]=useState(![]),[_0x1ec3e3,_0x25d5d0]=useState(''),_0x12ada7=useCallback(async _0x55caa4=>{const _0xc632fb=a35_0x339c,_0x1b54ff=Date[_0xc632fb(0xd5)](),_0x48fa2f=a35_0x48c04e[_0xc632fb(0xe1)](process[_0xc632fb(0xd7)](),_0x55caa4);_0x404df6(!![]),_0x3e0411(![]);const _0x55fb80=async(_0x4176d9,_0x576257)=>{await execa(_0x4176d9,_0x576257,{'cwd':_0x48fa2f});};try{logger['info'](_0xc632fb(0xd0),_0xc632fb(0xe3),{'projectCode':_0x55caa4,'registry':'https://registry.npmmirror.com'}),await _0x55fb80(_0xc632fb(0xd8),[_0xc632fb(0xd0),'--registry',_0xc632fb(0xe8)]);const _0x288868=Date[_0xc632fb(0xd5)]()-_0x1b54ff;logger[_0xc632fb(0xd2)]('install',_0xc632fb(0xe0),_0x288868,{'projectCode':_0x55caa4});}catch(_0x4e959c){const _0xebaaec=Date[_0xc632fb(0xd5)]()-_0x1b54ff;logger[_0xc632fb(0xd6)](_0xc632fb(0xd0),_0xc632fb(0xe7),{'projectCode':_0x55caa4,'error':_0x4e959c instanceof Error?_0x4e959c[_0xc632fb(0xde)]:String(_0x4e959c),'duration':_0xebaaec});throw _0x4e959c;}finally{_0x404df6(![]),_0x3e0411(!![]),_0x25d5d0(formatElapsed(_0x1b54ff));}},[]);return{'taskName':'安装依赖','finished':_0x288356,'loading':_0x1f055b,'elapsed':_0x1ec3e3,'doTask':_0x12ada7};}
package/lib/help.js ADDED
@@ -0,0 +1 @@
1
+ (function(_0x4e6bb1,_0x35c41f){var _0x16b07b=a36_0x1bf5,_0x38d87b=_0x4e6bb1();while(!![]){try{var _0x18af15=-parseInt(_0x16b07b(0x18c))/0x1+parseInt(_0x16b07b(0x194))/0x2*(parseInt(_0x16b07b(0x188))/0x3)+parseInt(_0x16b07b(0x18d))/0x4*(parseInt(_0x16b07b(0x187))/0x5)+parseInt(_0x16b07b(0x189))/0x6+parseInt(_0x16b07b(0x195))/0x7*(parseInt(_0x16b07b(0x192))/0x8)+parseInt(_0x16b07b(0x191))/0x9+parseInt(_0x16b07b(0x18e))/0xa*(-parseInt(_0x16b07b(0x18b))/0xb);if(_0x18af15===_0x35c41f)break;else _0x38d87b['push'](_0x38d87b['shift']());}catch(_0x43c327){_0x38d87b['push'](_0x38d87b['shift']());}}}(a36_0x8695,0x99f1f));import{jsx as a36_0x5a921a,jsxs as a36_0x211ae8}from'react/jsx-runtime';import{Box,Text}from'ink';function a36_0x1bf5(_0x41db1f,_0x3ceb56){var _0x8695da=a36_0x8695();return a36_0x1bf5=function(_0x1bf5cb,_0x5dec25){_0x1bf5cb=_0x1bf5cb-0x187;var _0x512031=_0x8695da[_0x1bf5cb];return _0x512031;},a36_0x1bf5(_0x41db1f,_0x3ceb56);}export function Help(){var _0xdf7084=a36_0x1bf5;return a36_0x211ae8(Box,{'flexDirection':_0xdf7084(0x193),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0x211ae8(Box,{'children':[a36_0x5a921a(Box,{'width':'1'}),a36_0x5a921a(Text,{'children':'!\x20请指定一个有效的命令。'})]}),a36_0x211ae8(Box,{'marginTop':0x1,'children':[a36_0x5a921a(Box,{'width':'1'}),a36_0x211ae8(Text,{'children':['\x20\x20','使用']}),a36_0x211ae8(Text,{'bold':!![],'color':_0xdf7084(0x18f),'children':['\x20',_0xdf7084(0x190),'\x20']}),a36_0x5a921a(Text,{'children':_0xdf7084(0x18a)})]})]});}function a36_0x8695(){var _0x3e6d15=['4050558cfSamO','12368WuOqDx','column','162346YIIwBG','3143LwVIXT','55PrhYmm','3pRWfiq','5928474vvBIvd','查看可用命令。','1018831vIwHao','325025HhcSJd','317236MJJvXt','230HnJhCQ','green','lovrabet\x20--help'];a36_0x8695=function(){return _0x3e6d15;};return a36_0x8695();}
@@ -0,0 +1 @@
1
+ function a37_0x3ac6(_0xb31505,_0x5792cb){const _0x1b8690=a37_0x1b86();return a37_0x3ac6=function(_0x3ac648,_0x2e2069){_0x3ac648=_0x3ac648-0x84;let _0x43f4ac=_0x1b8690[_0x3ac648];return _0x43f4ac;},a37_0x3ac6(_0xb31505,_0x5792cb);}(function(_0x2d66b8,_0x4d8f31){const _0x5215a0=a37_0x3ac6,_0x46caec=_0x2d66b8();while(!![]){try{const _0x56c1fa=-parseInt(_0x5215a0(0x90))/0x1*(-parseInt(_0x5215a0(0x87))/0x2)+-parseInt(_0x5215a0(0x85))/0x3*(parseInt(_0x5215a0(0x84))/0x4)+parseInt(_0x5215a0(0x86))/0x5*(-parseInt(_0x5215a0(0x8f))/0x6)+parseInt(_0x5215a0(0x8e))/0x7*(-parseInt(_0x5215a0(0x88))/0x8)+-parseInt(_0x5215a0(0x8c))/0x9*(-parseInt(_0x5215a0(0x91))/0xa)+-parseInt(_0x5215a0(0x92))/0xb+parseInt(_0x5215a0(0x89))/0xc*(parseInt(_0x5215a0(0x8d))/0xd);if(_0x56c1fa===_0x4d8f31)break;else _0x46caec['push'](_0x46caec['shift']());}catch(_0x250d23){_0x46caec['push'](_0x46caec['shift']());}}}(a37_0x1b86,0x856dd));function a37_0x1b86(){const _0x5550d2=['1549278uWYsXv','25975yhyMFG','74fqTcAe','2835528fgHrxg','48GBEDAf','parse','utf8','1314wCWOSp','7210489qsfCvR','21jUlUAF','606EzpFhE','12743IPaMyL','39390bvWHAs','6756508nURJjI','4FtSnsl'];a37_0x1b86=function(){return _0x5550d2;};return a37_0x1b86();}import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';export const configPath=resolve(process['cwd'](),'.lovrabetrc');export function readConfig(){const _0x163658=a37_0x3ac6;try{if(existsSync(configPath)){const _0x90bfdb=readFileSync(configPath,{'encoding':_0x163658(0x8b)});return _0x90bfdb?JSON[_0x163658(0x8a)](_0x90bfdb):{};}}catch(_0x5dd8ec){}return{};}
@@ -0,0 +1 @@
1
+ (function(_0x209535,_0x1d5d95){const _0x612d87=a38_0x17fe,_0x3fd721=_0x209535();while(!![]){try{const _0x2ea780=parseInt(_0x612d87(0x190))/0x1+parseInt(_0x612d87(0x181))/0x2*(parseInt(_0x612d87(0x188))/0x3)+parseInt(_0x612d87(0x192))/0x4*(parseInt(_0x612d87(0x186))/0x5)+-parseInt(_0x612d87(0x180))/0x6*(-parseInt(_0x612d87(0x18c))/0x7)+-parseInt(_0x612d87(0x18d))/0x8*(-parseInt(_0x612d87(0x187))/0x9)+-parseInt(_0x612d87(0x191))/0xa*(parseInt(_0x612d87(0x189))/0xb)+parseInt(_0x612d87(0x185))/0xc*(-parseInt(_0x612d87(0x18e))/0xd);if(_0x2ea780===_0x1d5d95)break;else _0x3fd721['push'](_0x3fd721['shift']());}catch(_0x3119c7){_0x3fd721['push'](_0x3fd721['shift']());}}}(a38_0x1f46,0x4bd43));import a38_0x35a0a3 from'node:path';function a38_0x17fe(_0x1ac421,_0x5e2b11){const _0x1f46f4=a38_0x1f46();return a38_0x17fe=function(_0x17fe95,_0x263d18){_0x17fe95=_0x17fe95-0x180;let _0x1abee1=_0x1f46f4[_0x17fe95];return _0x1abee1;},a38_0x17fe(_0x1ac421,_0x5e2b11);}import a38_0x3f231e from'node:fs';function a38_0x1f46(){const _0x51e84d=['385OpbUsV','1552336tLHmSM','39hXJfNq','复制目录时出错:','102187ORWwQa','12060TrgnNX','292IXiKHv','join','36894wVLqxC','26cYhfPi','name','isDirectory','error','7024716hJiTpv','39135aQnAzZ','27DCgxWL','112191qhqrjw','121PdWZHf','copyFileSync','mkdirSync'];a38_0x1f46=function(){return _0x51e84d;};return a38_0x1f46();}export async function copyDirectory(_0x1d0204,_0x327a8a){const _0x17bd30=a38_0x17fe;try{const _0x447b12=a38_0x3f231e['readdirSync'](_0x1d0204,{'withFileTypes':!![]});a38_0x3f231e[_0x17bd30(0x18b)](_0x327a8a,{'recursive':!![]});for(const _0xfe9d87 of _0x447b12){const _0x3a00d9=a38_0x35a0a3[_0x17bd30(0x193)](_0x1d0204,_0xfe9d87[_0x17bd30(0x182)]),_0x56b4d0=a38_0x35a0a3[_0x17bd30(0x193)](_0x327a8a,_0xfe9d87[_0x17bd30(0x182)]);_0xfe9d87[_0x17bd30(0x183)]()?await copyDirectory(_0x3a00d9,_0x56b4d0):a38_0x3f231e[_0x17bd30(0x18a)](_0x3a00d9,_0x56b4d0);}}catch(_0x16e02a){console[_0x17bd30(0x184)](_0x17bd30(0x18f),_0x16e02a);}}
@@ -0,0 +1 @@
1
+ const a39_0x47f93c=a39_0x5568;(function(_0x3b93dc,_0x3c5cdf){const _0x4ded42=a39_0x5568,_0x6260c8=_0x3b93dc();while(!![]){try{const _0x285ccc=-parseInt(_0x4ded42(0x1ce))/0x1*(parseInt(_0x4ded42(0x1ca))/0x2)+parseInt(_0x4ded42(0x1c1))/0x3+parseInt(_0x4ded42(0x1c8))/0x4+-parseInt(_0x4ded42(0x1c0))/0x5*(-parseInt(_0x4ded42(0x1c4))/0x6)+-parseInt(_0x4ded42(0x1c9))/0x7+-parseInt(_0x4ded42(0x1d1))/0x8+-parseInt(_0x4ded42(0x1bd))/0x9*(-parseInt(_0x4ded42(0x1be))/0xa);if(_0x285ccc===_0x3c5cdf)break;else _0x6260c8['push'](_0x6260c8['shift']());}catch(_0x5d9409){_0x6260c8['push'](_0x6260c8['shift']());}}}(a39_0x2e3e,0xc67b2));import a39_0x6b97bf from'winston';import a39_0xfe08a5 from'node:fs';import a39_0x1159b2 from'node:path';function a39_0x5568(_0x22e084,_0x485880){const _0x2e3ef9=a39_0x2e3e();return a39_0x5568=function(_0x5568f7,_0x1f6f81){_0x5568f7=_0x5568f7-0x19c;let _0x5147b3=_0x2e3ef9[_0x5568f7];return _0x5147b3;},a39_0x5568(_0x22e084,_0x485880);}class Logger{['winstonLogger'];[a39_0x47f93c(0x19f)];constructor(){const _0x38ef06=a39_0x47f93c;this[_0x38ef06(0x19f)]='';}[a39_0x47f93c(0x1d0)](){const _0x282d16=a39_0x47f93c,_0x3f0467=a39_0x1159b2[_0x282d16(0x1af)](this[_0x282d16(0x19f)]);!a39_0xfe08a5['existsSync'](_0x3f0467)&&a39_0xfe08a5[_0x282d16(0x1b9)](_0x3f0467,{'recursive':!![]});const _0x4f1be9=a39_0x6b97bf[_0x282d16(0x1b2)][_0x282d16(0x1b8)](a39_0x6b97bf[_0x282d16(0x1b2)][_0x282d16(0x1b3)](),a39_0x6b97bf[_0x282d16(0x1b2)][_0x282d16(0x1ae)]({'stack':!![]}),a39_0x6b97bf[_0x282d16(0x1b2)][_0x282d16(0x1c7)](_0x5a75e5=>{const _0x3157e6=_0x282d16,_0x73c7cb={'timestamp':_0x5a75e5['timestamp']||new Date()[_0x3157e6(0x1c3)](),'level':_0x5a75e5[_0x3157e6(0x1a5)]||_0x3157e6(0x1a1),'command':_0x5a75e5['command']||_0x3157e6(0x1cb),'message':_0x5a75e5['message']||'','duration':_0x5a75e5[_0x3157e6(0x1ac)]||undefined,'details':_0x5a75e5[_0x3157e6(0x1cc)]||undefined};return JSON[_0x3157e6(0x1a2)](_0x73c7cb);}));this[_0x282d16(0x1bb)]=a39_0x6b97bf['createLogger']({'level':_0x282d16(0x1a1),'format':_0x4f1be9,'transports':[new a39_0x6b97bf[(_0x282d16(0x1a0))]['File']({'filename':this[_0x282d16(0x19f)],'level':_0x282d16(0x1a1)})],'silent':![]}),a39_0x6b97bf['addColors']({'success':'green','error':_0x282d16(0x1cf),'warn':'yellow','info':'blue'});}[a39_0x47f93c(0x1a4)](_0x143b21){const _0x5ede68=a39_0x47f93c;this[_0x5ede68(0x19f)]=a39_0x1159b2[_0x5ede68(0x1bf)](_0x143b21,_0x5ede68(0x1b6)),this[_0x5ede68(0x1bb)]&&this[_0x5ede68(0x1bb)][_0x5ede68(0x1b7)](),this['initWinstonLogger']();}['info'](_0x841557,_0xb14b00,_0x53e738){const _0x37e5dc=a39_0x47f93c;if(!this[_0x37e5dc(0x19f)]||!this[_0x37e5dc(0x1bb)])return;this[_0x37e5dc(0x1bb)][_0x37e5dc(0x1a1)](_0xb14b00,{'command':_0x841557,'details':_0x53e738});}['success'](_0x400c78,_0x529152,_0xba83fe,_0x4b1838){const _0x3ea7a6=a39_0x47f93c;if(!this[_0x3ea7a6(0x19f)]||!this[_0x3ea7a6(0x1bb)])return;this[_0x3ea7a6(0x1bb)][_0x3ea7a6(0x1ad)](_0x3ea7a6(0x1a1),_0x529152,{'level':_0x3ea7a6(0x19d),'command':_0x400c78,'duration':_0xba83fe,'details':_0x4b1838});}['error'](_0x2abcf7,_0x2cb4fe,_0xbcb14f){const _0x496662=a39_0x47f93c;if(!this['logFilePath']||!this[_0x496662(0x1bb)])return;this['winstonLogger'][_0x496662(0x1b5)](_0x2cb4fe,{'command':_0x2abcf7,'details':_0xbcb14f});}[a39_0x47f93c(0x1c2)](_0x2d56a4,_0x3a58f3,_0x36a3db){const _0xfa28a4=a39_0x47f93c;if(!this[_0xfa28a4(0x19f)]||!this[_0xfa28a4(0x1bb)])return;this['winstonLogger'][_0xfa28a4(0x1c2)](_0x3a58f3,{'command':_0x2d56a4,'details':_0x36a3db});}async[a39_0x47f93c(0x1bc)](_0x9b687b,_0x2a89e1,_0x1ce8cc){const _0x4da7b1=a39_0x47f93c,_0x30c09a=Date[_0x4da7b1(0x1a9)]();this[_0x4da7b1(0x1a1)](_0x9b687b,_0x4da7b1(0x1c6)+_0x2a89e1);try{const _0xe08947=await _0x1ce8cc(),_0x1d1943=Date[_0x4da7b1(0x1a9)]()-_0x30c09a;return this[_0x4da7b1(0x19d)](_0x9b687b,_0x4da7b1(0x1a3)+_0x2a89e1,_0x1d1943),_0xe08947;}catch(_0x3fc706){const _0x39f9e7=Date[_0x4da7b1(0x1a9)]()-_0x30c09a;this[_0x4da7b1(0x1b5)](_0x9b687b,_0x4da7b1(0x1cd)+_0x2a89e1,{'error':_0x3fc706 instanceof Error?_0x3fc706['message']:String(_0x3fc706),'duration':_0x39f9e7});throw _0x3fc706;}}[a39_0x47f93c(0x19c)](){const _0x409294=a39_0x47f93c;try{if(!a39_0xfe08a5['existsSync'](this[_0x409294(0x19f)]))return[];const _0x3de6b7=a39_0xfe08a5[_0x409294(0x1ba)](this[_0x409294(0x19f)],'utf8');return _0x3de6b7[_0x409294(0x19e)]('\x0a')[_0x409294(0x1ab)](_0x3d2a70=>_0x3d2a70[_0x409294(0x1b4)]())[_0x409294(0x1a6)](_0x159067=>JSON[_0x409294(0x1aa)](_0x159067));}catch(_0x2f4bf6){return console['warn'](_0x409294(0x1c5),_0x2f4bf6),[];}}[a39_0x47f93c(0x1b0)](){const _0x38e2c6=a39_0x47f93c;try{a39_0xfe08a5['existsSync'](this[_0x38e2c6(0x19f)])&&a39_0xfe08a5['writeFileSync'](this['logFilePath'],'',_0x38e2c6(0x1a8));}catch(_0x2f82b0){console['warn'](_0x38e2c6(0x1a7),_0x2f82b0);}}[a39_0x47f93c(0x1b1)](){return this['winstonLogger'];}}function a39_0x2e3e(){const _0x2392cc=['level','map','Failed\x20to\x20clear\x20logs:','utf8','now','parse','filter','duration','log','errors','dirname','clearLogs','getWinstonInstance','format','timestamp','trim','error','.lovrabet.log','clear','combine','mkdirSync','readFileSync','winstonLogger','logTask','15848523uBUJfZ','10QdxMAW','join','9505oxHazR','1806738kNnoRj','warn','toISOString','1626VFhcXT','Failed\x20to\x20read\x20logs:','开始执行:\x20','printf','6238688aXdbCb','9179660MuzKHI','2srQclN','unknown','details','失败:\x20','1351194SIsEHg','red','initWinstonLogger','7699872HEUYyG','readLogs','success','split','logFilePath','transports','info','stringify','完成:\x20','setLogPath'];a39_0x2e3e=function(){return _0x2392cc;};return a39_0x2e3e();}export const logger=new Logger();
@@ -0,0 +1 @@
1
+ const a40_0x28226e=a40_0x21fd;(function(_0xbfee75,_0x41cb60){const _0x3290ed=a40_0x21fd,_0x4ff9ed=_0xbfee75();while(!![]){try{const _0x1238bb=parseInt(_0x3290ed(0x99))/0x1+parseInt(_0x3290ed(0x89))/0x2+parseInt(_0x3290ed(0xa8))/0x3*(parseInt(_0x3290ed(0x88))/0x4)+parseInt(_0x3290ed(0x98))/0x5+-parseInt(_0x3290ed(0x7e))/0x6+parseInt(_0x3290ed(0xa4))/0x7*(parseInt(_0x3290ed(0xa0))/0x8)+-parseInt(_0x3290ed(0x8a))/0x9;if(_0x1238bb===_0x41cb60)break;else _0x4ff9ed['push'](_0x4ff9ed['shift']());}catch(_0x2cc84f){_0x4ff9ed['push'](_0x4ff9ed['shift']());}}}(a40_0x3e1e,0xf07af));import a40_0x3e0d97 from'node:fs';function a40_0x21fd(_0x205663,_0x4457e1){const _0x3e1e94=a40_0x3e1e();return a40_0x21fd=function(_0x21fd9e,_0x4c8bf1){_0x21fd9e=_0x21fd9e-0x7b;let _0x2a9ab0=_0x3e1e94[_0x21fd9e];return _0x2a9ab0;},a40_0x21fd(_0x205663,_0x4457e1);}function a40_0x3e1e(){const _0x373971=['lastIndexOf','join','toComponentName','split','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','writeFile','10852AhpgQU','2717794GikpMf','3449961EhHLpi','error','addImport','now','length','router','slice','index','indexOf','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','toLowerCase','charAt','match','路由配置更新完成','2622030WjjfJL','26806znsCQD','previewChanges','success','addPageRoute','promises','toUpperCase','routerFilePath','949432suWGNL','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','开始更新路由配置','utf8','21KgtxlV','import\x20','readFile','src','717gwenhL','existsSync','路由文件不存在:\x20','index.tsx','addRoute','9277302dIzGRf','includes','path:\x20\x22','map'];a40_0x3e1e=function(){return _0x373971;};return a40_0x3e1e();}import a40_0x22b0cb from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a40_0x28226e(0x9f)];constructor(_0x201119){const _0x2fd31e=a40_0x28226e;this[_0x2fd31e(0x9f)]=a40_0x22b0cb[_0x2fd31e(0x83)](_0x201119,_0x2fd31e(0xa7),'router',_0x2fd31e(0x7c));}async[a40_0x28226e(0x9c)](_0x359215,_0x27a36f){const _0x208401=a40_0x28226e;if(!a40_0x3e0d97[_0x208401(0xa9)](this[_0x208401(0x9f)]))throw new Error(_0x208401(0x7b)+this[_0x208401(0x9f)]);const _0xe20bd5=Date[_0x208401(0x8d)]();logger['info'](_0x208401(0x8f),_0x208401(0xa2),{'pageName':_0x359215,'routePath':_0x27a36f,'file':this['routerFilePath']});try{const _0x24ce22=await a40_0x3e0d97[_0x208401(0x9d)][_0x208401(0xa6)](this[_0x208401(0x9f)],_0x208401(0xa3)),_0x39ae2d=this[_0x208401(0x84)](_0x359215),_0x11d7f4=this[_0x208401(0x8c)](_0x24ce22,_0x39ae2d,_0x359215),_0x7cfc3b=this[_0x208401(0x7d)](_0x11d7f4,_0x27a36f,_0x39ae2d);await a40_0x3e0d97[_0x208401(0x9d)][_0x208401(0x87)](this[_0x208401(0x9f)],_0x7cfc3b,_0x208401(0xa3));const _0x44c546=Date[_0x208401(0x8d)]()-_0xe20bd5;logger[_0x208401(0x9b)](_0x208401(0x8f),_0x208401(0x97),_0x44c546,{'pageName':_0x359215,'routePath':_0x27a36f,'componentName':_0x39ae2d});}catch(_0x325a99){const _0x40f929=Date[_0x208401(0x8d)]()-_0xe20bd5;logger[_0x208401(0x8b)]('router','路由配置更新失败',{'pageName':_0x359215,'routePath':_0x27a36f,'error':_0x325a99 instanceof Error?_0x325a99['message']:String(_0x325a99),'duration':_0x40f929});throw _0x325a99;}}[a40_0x28226e(0x84)](_0x153c60){const _0x433e1b=a40_0x28226e;return _0x153c60[_0x433e1b(0x85)]('-')[_0x433e1b(0x81)](_0x52b869=>_0x52b869[_0x433e1b(0x95)](0x0)[_0x433e1b(0x9e)]()+_0x52b869[_0x433e1b(0x90)](0x1)[_0x433e1b(0x94)]())['join']('');}[a40_0x28226e(0x8c)](_0x7a55a6,_0x48172d,_0x2bd343){const _0x475fd3=a40_0x28226e,_0x219be5=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x3dca1c=_0x7a55a6['match'](_0x219be5)||[],_0x58e4dd=_0x475fd3(0xa5)+_0x48172d+'\x20from\x20\x22../pages/'+_0x2bd343+'\x22;';if(_0x7a55a6[_0x475fd3(0x7f)](_0x58e4dd))return _0x7a55a6;if(_0x3dca1c[_0x475fd3(0x8e)]>0x0){const _0xfaaea4=_0x3dca1c[_0x3dca1c['length']-0x1];if(_0xfaaea4){const _0x40467d=_0x7a55a6[_0x475fd3(0x82)](_0xfaaea4),_0x549499=_0x40467d+_0xfaaea4[_0x475fd3(0x8e)];return _0x7a55a6[_0x475fd3(0x90)](0x0,_0x549499)+_0x58e4dd+'\x0a'+_0x7a55a6['slice'](_0x549499);}}const _0xcb177a=_0x7a55a6[_0x475fd3(0x96)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0xcb177a&&_0xcb177a[_0x475fd3(0x91)]!==undefined){const _0x1f6839=_0xcb177a[_0x475fd3(0x91)]+_0xcb177a[0x0][_0x475fd3(0x8e)];return _0x7a55a6[_0x475fd3(0x90)](0x0,_0x1f6839)+_0x58e4dd+'\x0a'+_0x7a55a6['slice'](_0x1f6839);}return _0x7a55a6;}['addRoute'](_0xc345ad,_0x23b62c,_0xa73962){const _0x23afdc=a40_0x28226e,_0x40591f=_0x23afdc(0x93)+_0x23b62c+_0x23afdc(0xa1)+_0xa73962+_0x23afdc(0x86);if(_0xc345ad[_0x23afdc(0x7f)](_0x23afdc(0x80)+_0x23b62c+'\x22'))return _0xc345ad;const _0x26c0ed=/children:\s*\[([\s\S]*?)\]/,_0x199eae=_0xc345ad[_0x23afdc(0x96)](_0x26c0ed);if(!_0x199eae||_0x199eae['index']===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x143c1f=_0x199eae[0x1],_0x3a90de=_0x199eae[_0x23afdc(0x91)]+_0x199eae[0x0][_0x23afdc(0x92)]('[')+0x1,_0x481e9a=_0x143c1f?.[_0x23afdc(0x96)](/\{[\s\S]*?\},/g)||[];if(_0x481e9a[_0x23afdc(0x8e)]>0x0){const _0x5404f5=_0x481e9a[_0x481e9a[_0x23afdc(0x8e)]-0x1];if(_0x5404f5){const _0x12302d=_0xc345ad['lastIndexOf'](_0x5404f5),_0x17a1ef=_0x12302d+_0x5404f5['length'];return _0xc345ad[_0x23afdc(0x90)](0x0,_0x17a1ef)+'\x0a'+_0x40591f+_0xc345ad[_0x23afdc(0x90)](_0x17a1ef);}}return _0xc345ad[_0x23afdc(0x90)](0x0,_0x3a90de)+'\x0a'+_0x40591f+_0xc345ad['slice'](_0x3a90de);}async[a40_0x28226e(0x9a)](_0x16ae13,_0xb6fec1){const _0x5a8714=a40_0x28226e;if(!a40_0x3e0d97[_0x5a8714(0xa9)](this[_0x5a8714(0x9f)]))throw new Error(_0x5a8714(0x7b)+this[_0x5a8714(0x9f)]);const _0x252881=await a40_0x3e0d97['promises'][_0x5a8714(0xa6)](this[_0x5a8714(0x9f)],_0x5a8714(0xa3)),_0x1f5d3b=this[_0x5a8714(0x84)](_0x16ae13);let _0x1dea22=this[_0x5a8714(0x8c)](_0x252881,_0x1f5d3b,_0x16ae13);return _0x1dea22=this[_0x5a8714(0x7d)](_0x1dea22,_0xb6fec1,_0x1f5d3b),_0x1dea22;}}
@@ -0,0 +1 @@
1
+ const a41_0x75efe8=a41_0x3730;function a41_0x41a4(){const _0x49dc3c=['slice','7fWnAHK','176113UeBGhf','keys','1783903gqMhGb','2-digit','isDirectory','1381803paeaLm','utf8','YourModel','2583MXPgNT','success','readdir','.css','464UBBvwl','toISOString','endsWith','toDisplayTitle','error','toLocaleString','api','4GybDpq','charAt','writeFile','extname','now','.ts','split','toUpperCase','replaceApiContent','toLocaleDateString','360674bOBNpd','readFile','replaceContent','toLocaleTimeString','map','processDirectory','template','toComponentName','replace','default','.tpl','name','.json','8944362mkvGgc','copyFile','.jsx','\x20\x20\x20\x20','pop','message','promises','processFile','.md','mkdir','.scss','info','join','8450ywxZcP','processTemplate','toLowerCase','2226235ThHlcn'];a41_0x41a4=function(){return _0x49dc3c;};return a41_0x41a4();}(function(_0x2e0503,_0xf44944){const _0x438532=a41_0x3730,_0x2599e3=_0x2e0503();while(!![]){try{const _0x2bf574=parseInt(_0x438532(0x15a))/0x1*(-parseInt(_0x438532(0x178))/0x2)+parseInt(_0x438532(0x160))/0x3*(-parseInt(_0x438532(0x16e))/0x4)+-parseInt(_0x438532(0x158))/0x5+parseInt(_0x438532(0x185))/0x6+parseInt(_0x438532(0x15b))/0x7*(parseInt(_0x438532(0x167))/0x8)+-parseInt(_0x438532(0x163))/0x9*(-parseInt(_0x438532(0x155))/0xa)+-parseInt(_0x438532(0x15d))/0xb;if(_0x2bf574===_0xf44944)break;else _0x2599e3['push'](_0x2599e3['shift']());}catch(_0x17f8fe){_0x2599e3['push'](_0x2599e3['shift']());}}}(a41_0x41a4,0xd2784));import a41_0x632ae9 from'node:fs';import a41_0x484255 from'node:path';function a41_0x3730(_0x1f4a9d,_0x1de987){const _0x41a451=a41_0x41a4();return a41_0x3730=function(_0x373009,_0x4c9d2b){_0x373009=_0x373009-0x14c;let _0x24fad4=_0x41a451[_0x373009];return _0x24fad4;},a41_0x3730(_0x1f4a9d,_0x1de987);}import{logger}from'./logger.js';export class TemplateReplacer{static[a41_0x75efe8(0x17f)](_0x3c6b88){const _0x3727ed=a41_0x75efe8,_0xf0547=_0x3c6b88['split']('/')[_0x3727ed(0x14c)]()||_0x3c6b88;return _0xf0547[_0x3727ed(0x174)]('-')[_0x3727ed(0x17c)](_0x52be9e=>_0x52be9e[_0x3727ed(0x16f)](0x0)[_0x3727ed(0x175)]()+_0x52be9e['slice'](0x1)[_0x3727ed(0x157)]())[_0x3727ed(0x154)]('');}static[a41_0x75efe8(0x16a)](_0x2505c3){const _0x299019=a41_0x75efe8,_0x53421d=_0x2505c3[_0x299019(0x174)]('/')['pop']()||_0x2505c3;return _0x53421d[_0x299019(0x174)]('-')[_0x299019(0x17c)](_0xb01db=>_0xb01db['charAt'](0x0)[_0x299019(0x175)]()+_0xb01db[_0x299019(0x159)](0x1)['toLowerCase']())[_0x299019(0x154)]('\x20');}static[a41_0x75efe8(0x17a)](_0x5749e7,_0x3f72b7,_0x4f96cb){const _0x41c996=a41_0x75efe8,_0x44f4f6=this[_0x41c996(0x17f)](_0x3f72b7),_0xcb220d=this[_0x41c996(0x16a)](_0x3f72b7),_0x2b1178=new Date(),_0x240a9e=_0x2b1178[_0x41c996(0x16c)](undefined,{'year':'numeric','month':_0x41c996(0x15e),'day':_0x41c996(0x15e),'hour':_0x41c996(0x15e),'minute':_0x41c996(0x15e),'second':_0x41c996(0x15e),'hour12':![]})['replace'](/\//g,'-'),_0x9a8e54=_0x2b1178[_0x41c996(0x177)](undefined,{'year':'numeric','month':_0x41c996(0x15e),'day':_0x41c996(0x15e)})[_0x41c996(0x180)](/\//g,'-'),_0x35190a=_0x2b1178[_0x41c996(0x17b)](undefined,{'hour12':![]});let _0x26b83d=_0x5749e7['replace'](/\{ComponentName\}/g,_0x44f4f6)['replace'](/\{DisplayTitle\}/g,_0xcb220d)[_0x41c996(0x180)](/\{PageName\}/g,_0x3f72b7)[_0x41c996(0x180)](/\{TemplateName\}/g,_0x4f96cb)['replace'](/\{CreatedAt\}/g,_0x240a9e)[_0x41c996(0x180)](/\{CreatedDate\}/g,_0x9a8e54)[_0x41c996(0x180)](/\{CreatedTime\}/g,_0x35190a);return _0x26b83d;}static[a41_0x75efe8(0x176)](_0x43aa1d,_0x5157ac,_0x3fb07b,_0x57a938,_0x3d4fc5,_0x5cc5e8,_0x71c1c7){const _0x1872b6=a41_0x75efe8,_0x4ee5d9=new Date(),_0x26e84b=_0x4ee5d9[_0x1872b6(0x168)](),_0x485160=JSON['stringify'](_0x3fb07b,null,0x2)[_0x1872b6(0x174)]('\x0a')[_0x1872b6(0x159)](0x1,-0x1)['map'](_0x1af58b=>_0x1af58b['replace'](/^ /,_0x1872b6(0x188)))[_0x1872b6(0x154)]('\x0a'),_0x50a638=_0x57a938||Object[_0x1872b6(0x15c)](_0x3fb07b)[0x0]||_0x1872b6(0x162);let _0x4ff5d0=_0x43aa1d[_0x1872b6(0x180)](/\{AppCode\}/g,_0x5157ac)[_0x1872b6(0x180)](/\{ModelConfigs\}/g,_0x485160)['replace'](/\{ExampleModelName\}/g,_0x50a638)[_0x1872b6(0x180)](/\{ApiFileName\}/g,_0x3d4fc5||_0x1872b6(0x16d))[_0x1872b6(0x180)](/\{ConfigName\}/g,_0x5cc5e8||_0x1872b6(0x181))[_0x1872b6(0x180)](/\{ClientConfigParam\}/g,_0x71c1c7||'')[_0x1872b6(0x180)](/\{CreatedAt\}/g,_0x26e84b);return _0x4ff5d0;}static async[a41_0x75efe8(0x156)](_0x3dda6b,_0x4a1662,_0x7fb460,_0x4730bf,_0x293749=!![]){const _0x52bdfa=a41_0x75efe8,_0x2c7648=Date[_0x52bdfa(0x172)]();try{_0x293749&&logger[_0x52bdfa(0x153)]('template','开始处理模板内容替换',{'templatePath':_0x3dda6b,'targetPath':_0x4a1662,'pageName':_0x7fb460,'templateName':_0x4730bf});await a41_0x632ae9[_0x52bdfa(0x14e)]['mkdir'](_0x4a1662,{'recursive':!![]}),await this['processDirectory'](_0x3dda6b,_0x4a1662,_0x7fb460,_0x4730bf);if(_0x293749){const _0x51411d=Date[_0x52bdfa(0x172)]()-_0x2c7648;logger[_0x52bdfa(0x164)](_0x52bdfa(0x17e),'模板内容替换完成',_0x51411d,{'pageName':_0x7fb460,'templateName':_0x4730bf});}}catch(_0x12e8da){if(_0x293749){const _0x4b2ee8=Date[_0x52bdfa(0x172)]()-_0x2c7648;logger[_0x52bdfa(0x16b)]('template','模板内容替换失败',{'templatePath':_0x3dda6b,'targetPath':_0x4a1662,'pageName':_0x7fb460,'templateName':_0x4730bf,'error':_0x12e8da instanceof Error?_0x12e8da[_0x52bdfa(0x14d)]:String(_0x12e8da),'duration':_0x4b2ee8});}throw _0x12e8da;}}static async[a41_0x75efe8(0x17d)](_0x2cf99d,_0x117131,_0x4cf72e,_0xaeb1fe){const _0x31f4c0=a41_0x75efe8,_0xccc041=await a41_0x632ae9[_0x31f4c0(0x14e)][_0x31f4c0(0x165)](_0x2cf99d,{'withFileTypes':!![]});for(const _0x1b207e of _0xccc041){const _0x1e760a=a41_0x484255['join'](_0x2cf99d,_0x1b207e['name']);let _0x1f2ebb=a41_0x484255[_0x31f4c0(0x154)](_0x117131,_0x1b207e[_0x31f4c0(0x183)]);_0x1b207e[_0x31f4c0(0x183)][_0x31f4c0(0x169)]('.tpl')&&(_0x1f2ebb=a41_0x484255['join'](_0x117131,_0x1b207e['name']['replace'](/\.tpl$/,'')));if(_0x1b207e[_0x31f4c0(0x15f)]())await a41_0x632ae9['promises'][_0x31f4c0(0x151)](_0x1f2ebb,{'recursive':!![]}),await this[_0x31f4c0(0x17d)](_0x1e760a,_0x1f2ebb,_0x4cf72e,_0xaeb1fe);else _0x1b207e['isFile']()&&await this[_0x31f4c0(0x14f)](_0x1e760a,_0x1f2ebb,_0x4cf72e,_0xaeb1fe);}}static async[a41_0x75efe8(0x14f)](_0x2290ea,_0x1a2827,_0x58d418,_0x1376c8){const _0x2d1137=a41_0x75efe8,_0x500832=a41_0x484255[_0x2d1137(0x171)](_0x2290ea)[_0x2d1137(0x157)]();_0x2290ea['endsWith'](_0x2d1137(0x182))&&(_0x1a2827=_0x1a2827['replace'](/\.tpl$/,''));const _0x217fdf=['.tsx',_0x2d1137(0x173),_0x2d1137(0x187),'.js',_0x2d1137(0x184),_0x2d1137(0x150),_0x2d1137(0x166),_0x2d1137(0x152),_0x2d1137(0x182)];if(_0x217fdf['includes'](_0x500832)||_0x2290ea['endsWith'](_0x2d1137(0x182))){const _0x2302e4=await a41_0x632ae9[_0x2d1137(0x14e)][_0x2d1137(0x179)](_0x2290ea,_0x2d1137(0x161)),_0x410f5d=this[_0x2d1137(0x17a)](_0x2302e4,_0x58d418,_0x1376c8);await a41_0x632ae9['promises'][_0x2d1137(0x170)](_0x1a2827,_0x410f5d,'utf8');}else await a41_0x632ae9[_0x2d1137(0x14e)][_0x2d1137(0x186)](_0x2290ea,_0x1a2827);}}