@lovrabet/cli 1.3.2 → 1.3.3
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.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/i18n/I18nProvider.js +1 -0
- package/lib/i18n/hooks.js +1 -0
- package/lib/i18n/index.js +1 -0
- package/lib/i18n/locales/en-US.js +1 -0
- package/lib/i18n/locales/zh-CN.js +1 -0
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +3 -1
package/lib/api/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a10_0x24e884=a10_0x2ec7;(function(_0x5ef1e3,_0x81bc73){const _0x57f3ab=a10_0x2ec7,_0x619ea=_0x5ef1e3();while(!![]){try{const _0x1bb7b4=-parseInt(_0x57f3ab(0xe1))/0x1*(-parseInt(_0x57f3ab(0xd5))/0x2)+parseInt(_0x57f3ab(0xa6))/0x3+-parseInt(_0x57f3ab(0xba))/0x4+-parseInt(_0x57f3ab(0xdd))/0x5+-parseInt(_0x57f3ab(0xda))/0x6*(parseInt(_0x57f3ab(0xa0))/0x7)+parseInt(_0x57f3ab(0xde))/0x8*(parseInt(_0x57f3ab(0x9f))/0x9)+parseInt(_0x57f3ab(0xa3))/0xa;if(_0x1bb7b4===_0x81bc73)break;else _0x619ea['push'](_0x619ea['shift']());}catch(_0x36dc0f){_0x619ea['push'](_0x619ea['shift']());}}}(a10_0x29cb,0xe8bf8));import{jsx as a10_0x51522d}from'react/jsx-runtime';import{render}from'ink';import{ApiPullUI}from'./api-pull-ui.js';import{ApiDocUI}from'./api-doc-ui.js';import{getConfigAppCode}from'../utils/config.js';function a10_0x2ec7(_0x5a0d8a,_0x5e8908){_0x5a0d8a=_0x5a0d8a-0x92;const _0x29cba6=a10_0x29cb();let _0x2ec7cf=_0x29cba6[_0x5a0d8a];return _0x2ec7cf;}import a10_0x32c2f7 from'../i18n/index.js';const t=a10_0x32c2f7['t'][a10_0x24e884(0xbf)](a10_0x32c2f7);function a10_0x29cb(){const _0x9f422e=['\x0a\x20\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--output\x20./docs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.optEnv','bind','output','input','api.help.docAppcode','isArray','env','api.common.onlyGenerateDatasets','api.help.pullAppcode','api.common.noPositionalArgs','\x0a\x20\x20--datasetcode\x20<codes>\x20','log','\x0a\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','error','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20//\x20','\x0a\x20\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','api.help.pullOutput','length','\x20\x20lovrabet\x20api\x20doc\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','\x20\x20lovrabet\x20api\x20pull\x20--env\x20<env>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','api.help.availableCommands','api.help.pullDesc','api.help.title','142RiFjkS','filter','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','map','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','7248oBImQX','string','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','4595725VqwynH','8cPfKVA','api.common.noAppCodeOption1','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--appcode\x20myapp\x20\x20\x20\x20\x20\x20\x20//\x20','23399Yzoxlh','parse','\x0a\x20\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20','api.help.pullEnv','\x1b[0m','api.help.optHelp','api.help.docDatasets','\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001,ds_002\x20\x20\x20\x20\x20\x20//\x20','api.help.unknownCommand','\x20\x20lovrabet\x20api\x20doc\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','exit','api.common.usingConfigAppCode','api.common.paramsError','params','api.common.datasetcodeEmpty','4576833BaNyPR','3948yfmlHs','\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20//\x20','api.help.examples','4341370dZEXrN','api.help.docEnv','api.common.noAppCodeOption2Pull','392601BvQMEL','api.help.usage','api.common.paramsInvalidJson','flags','api.common.paramsNotJson','message','api.help.optOutput','split','\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20','pull','api.help.docOutput','api.help.docDesc','help','doc','\x0a\x20\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20lovrabet\x20api\x20doc\x20--appcode\x20','appcode','api.common.noAppCode','object','\x1b[90m','724308zBqnLJ','api.common.useAppcodeFlag'];a10_0x29cb=function(){return _0x9f422e;};return a10_0x29cb();}export async function apiCli(_0x2a5bfd){const _0x4b759d=a10_0x24e884,_0x43a317=_0x2a5bfd[_0x4b759d(0xc1)][0x1];if(_0x2a5bfd[_0x4b759d(0xa9)][_0x4b759d(0xb2)]){console[_0x4b759d(0xc9)]('\x0a'+t(_0x4b759d(0xd4))+'\x0a\x0a'+t(_0x4b759d(0xa7))+'\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20[options]\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20[options]\x0a\x0a'+t('api.help.options')+_0x4b759d(0x92)+t('api.help.optAppcode')+_0x4b759d(0xb4)+t(_0x4b759d(0xac))+_0x4b759d(0xcd)+t(_0x4b759d(0xbe))+_0x4b759d(0xc8)+t('api.help.optDatasetcode')+_0x4b759d(0xbc)+t(_0x4b759d(0x95))+'\x0a\x0a'+t(_0x4b759d(0xa2))+_0x4b759d(0xae)+t('api.help.pullDesc')+_0x4b759d(0xe0)+t(_0x4b759d(0xc6))+'\x0a\x20\x20$\x20lovrabet\x20api\x20pull\x20--output\x20./api\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x4b759d(0xce))+_0x4b759d(0xd7)+t(_0x4b759d(0x93))+_0x4b759d(0xca)+t(_0x4b759d(0xb1))+_0x4b759d(0xd9)+t('api.help.docAppcode')+_0x4b759d(0xbd)+t(_0x4b759d(0xb0))+_0x4b759d(0xdc)+t(_0x4b759d(0xa4))+'\x0a\x20\x20$\x20lovrabet\x20api\x20doc\x20--datasetcode\x20ds_001\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t('api.help.docDataset')+_0x4b759d(0x97)+t(_0x4b759d(0x96))+'\x0a');return;}if(_0x43a317===_0x4b759d(0xaf)){_0x2a5bfd[_0x4b759d(0xc1)][0x2]&&(console['error'](t(_0x4b759d(0xc7))),console['log'](t(_0x4b759d(0xbb))),console[_0x4b759d(0xc9)]('\x20\x20lovrabet\x20api\x20pull\x20--appcode\x20'+_0x2a5bfd['input'][0x2]),process[_0x4b759d(0x9a)](0x1));const _0x2711b6=getConfigAppCode();let _0x395e7e=_0x2a5bfd[_0x4b759d(0xa9)][_0x4b759d(0xb6)];const _0x4d13a2=typeof _0x2a5bfd[_0x4b759d(0xa9)]['env']===_0x4b759d(0xdb)?_0x2a5bfd[_0x4b759d(0xa9)][_0x4b759d(0xc4)]:undefined,_0x47f20a=_0x2a5bfd['flags'][_0x4b759d(0xc0)];!_0x395e7e&&!_0x2711b6&&(console['error'](t(_0x4b759d(0xb7))),console[_0x4b759d(0xc9)](t('api.common.noAppCodeHint')),console[_0x4b759d(0xc9)](t(_0x4b759d(0xdf))),console[_0x4b759d(0xc9)](t(_0x4b759d(0xa5))),process[_0x4b759d(0x9a)](0x1)),_0x395e7e&&_0x2711b6&&_0x395e7e===_0x2711b6&&(console['log'](_0x4b759d(0xb9)+t(_0x4b759d(0x9b),{'appCode':_0x395e7e})+_0x4b759d(0x94)),console[_0x4b759d(0xc9)](_0x4b759d(0xb9)+t('api.common.usingConfigAppCodeHint')+_0x4b759d(0x94)),_0x395e7e=undefined),render(a10_0x51522d(ApiPullUI,{'appCode':_0x395e7e,'env':_0x4d13a2,'output':_0x47f20a}));}else{if(_0x43a317===_0x4b759d(0xb3)){_0x2a5bfd[_0x4b759d(0xc1)][0x2]&&(console[_0x4b759d(0xcb)](t(_0x4b759d(0xc7))),console[_0x4b759d(0xc9)](t(_0x4b759d(0xbb))),console[_0x4b759d(0xc9)](_0x4b759d(0xb5)+_0x2a5bfd[_0x4b759d(0xc1)][0x2]),process[_0x4b759d(0x9a)](0x1));const _0x438f1e=getConfigAppCode();let _0x370ff5=_0x2a5bfd['flags'][_0x4b759d(0xb6)];const _0x464acf=typeof _0x2a5bfd[_0x4b759d(0xa9)][_0x4b759d(0xc4)]==='string'?_0x2a5bfd[_0x4b759d(0xa9)]['env']:undefined,_0x4e4aca=_0x2a5bfd[_0x4b759d(0xa9)][_0x4b759d(0xc0)],_0x460fcb=_0x2a5bfd[_0x4b759d(0xa9)][_0x4b759d(0x9d)],_0x4bb3ad=_0x2a5bfd[_0x4b759d(0xa9)]['datasetcode'];!_0x370ff5&&!_0x438f1e&&(console[_0x4b759d(0xcb)](t(_0x4b759d(0xb7))),console['log'](t('api.common.noAppCodeHint')),console[_0x4b759d(0xc9)](t('api.common.noAppCodeOption1')),console['log'](t('api.common.noAppCodeOption2Doc')),process['exit'](0x1));_0x370ff5&&_0x438f1e&&_0x370ff5===_0x438f1e&&(console['log']('\x1b[90m'+t(_0x4b759d(0x9b),{'appCode':_0x370ff5})+_0x4b759d(0x94)),_0x370ff5=undefined);let _0x2131b4;if(_0x460fcb)try{_0x2131b4=JSON[_0x4b759d(0xe2)](_0x460fcb),(typeof _0x2131b4!==_0x4b759d(0xb8)||_0x2131b4===null||Array[_0x4b759d(0xc3)](_0x2131b4))&&(console[_0x4b759d(0xcb)](t(_0x4b759d(0xa8))),process['exit'](0x1));}catch(_0x35dfa8){console[_0x4b759d(0xcb)](t(_0x4b759d(0xaa))),console[_0x4b759d(0xcb)](t(_0x4b759d(0x9c),{'error':_0x35dfa8 instanceof Error?_0x35dfa8[_0x4b759d(0xab)]:String(_0x35dfa8)})),process[_0x4b759d(0x9a)](0x1);}let _0x516471;_0x4bb3ad&&(_0x516471=_0x4bb3ad[_0x4b759d(0xad)](',')[_0x4b759d(0xd8)](_0x323b1c=>_0x323b1c['trim']())[_0x4b759d(0xd6)](_0xddeca6=>_0xddeca6[_0x4b759d(0xcf)]>0x0),_0x516471[_0x4b759d(0xcf)]===0x0&&(console[_0x4b759d(0xcb)](t(_0x4b759d(0x9e))),process[_0x4b759d(0x9a)](0x1)),console[_0x4b759d(0xc9)]('\x1b[90m'+t(_0x4b759d(0xc5),{'codes':_0x516471['join'](',\x20')})+'\x1b[0m')),render(a10_0x51522d(ApiDocUI,{'appCode':_0x370ff5,'env':_0x464acf,'output':_0x4e4aca,'extraParams':_0x2131b4,'datasetCodes':_0x516471}));}else console[_0x4b759d(0xcb)](t(_0x4b759d(0x98))+':\x20'+_0x43a317),console[_0x4b759d(0xc9)](t(_0x4b759d(0xd2))),console['log']('\x20\x20lovrabet\x20api\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x4b759d(0xd3))),console[_0x4b759d(0xc9)](_0x4b759d(0xa1)+t(_0x4b759d(0xc6))),console[_0x4b759d(0xc9)]('\x20\x20lovrabet\x20api\x20pull\x20--output\x20<dir>\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x4b759d(0xce))),console[_0x4b759d(0xc9)](_0x4b759d(0xd1)+t(_0x4b759d(0x93))),console[_0x4b759d(0xc9)](''),console['log']('\x20\x20lovrabet\x20api\x20doc\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20'+t(_0x4b759d(0xb1))),console['log'](_0x4b759d(0xcc)+t(_0x4b759d(0xc2))),console[_0x4b759d(0xc9)](_0x4b759d(0x99)+t('api.help.docOutput')),console['log'](_0x4b759d(0xd0)+t('api.help.docEnv')),process[_0x4b759d(0x9a)](0x1);}}
|
package/lib/api/pull-silent.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a11_0x3b1b(){const _0x216f69=['1050394gPWZGC','api.silent.error','2023378IqFblY','string','-api','2143564cgUxAO','9KFBMqY','3591256fYyZdH','517765HWBAMs','770595OhVSEJ','24yhltnR','-client','api.silent.success','modelCount','chdir','API\x20配置拉取异常:\x20','message','log','info','create-api-pull','cwd','api.silent.generating','276594OKrhLS','client','api','env','bind','length','error'];a11_0x3b1b=function(){return _0x216f69;};return a11_0x3b1b();}function a11_0x3552(_0x536655,_0xee3cad){_0x536655=_0x536655-0x134;const _0x3b1bce=a11_0x3b1b();let _0x355217=_0x3b1bce[_0x536655];return _0x355217;}const a11_0x111538=a11_0x3552;(function(_0x1eefe2,_0x2e8d34){const _0x4fdf79=a11_0x3552,_0x5106d7=_0x1eefe2();while(!![]){try{const _0x5020f2=parseInt(_0x4fdf79(0x138))/0x1+-parseInt(_0x4fdf79(0x14d))/0x2+-parseInt(_0x4fdf79(0x146))/0x3+parseInt(_0x4fdf79(0x135))/0x4+-parseInt(_0x4fdf79(0x139))/0x5*(-parseInt(_0x4fdf79(0x13a))/0x6)+-parseInt(_0x4fdf79(0x14f))/0x7+parseInt(_0x4fdf79(0x137))/0x8*(-parseInt(_0x4fdf79(0x136))/0x9);if(_0x5020f2===_0x2e8d34)break;else _0x5106d7['push'](_0x5106d7['shift']());}catch(_0x588637){_0x5106d7['push'](_0x5106d7['shift']());}}}(a11_0x3b1b,0x4cd98));import{readConfig}from'../utils/config.js';import{initEnv}from'../constant/env.js';import{generateApiFile}from'./generate-api-file.js';import{logger}from'../utils/logger.js';import{fetchModelList}from'./fetch-model-list.js';import a11_0x3bc480 from'../i18n/index.js';const t=a11_0x3bc480['t'][a11_0x111538(0x14a)](a11_0x3bc480);export async function pullApiSilent(_0x3904f8,_0x1c0767,_0x4c5332,_0x16282f){const _0x53e82f=a11_0x111538;let _0x5a36f4;try{const _0xd96aa6=_0x1c0767?.['trim']()||'';if(_0xd96aa6){const _0x18c29b=/^[a-zA-Z][a-zA-Z0-9_-]*$/;if(!_0x18c29b['test'](_0xd96aa6))return console[_0x53e82f(0x14c)](t('api.silent.invalidPrefix')),![];}_0x4c5332&&(_0x5a36f4=process[_0x53e82f(0x144)](),process['chdir'](_0x4c5332));const _0x4c8df4=readConfig(),_0x131c2e=typeof _0x4c8df4[_0x53e82f(0x149)]===_0x53e82f(0x150)?_0x4c8df4[_0x53e82f(0x149)]:undefined,_0x49e8ba=_0x16282f||_0x131c2e||'online';initEnv(_0x49e8ba),console['log'](t('api.silent.fetching',{'env':_0x49e8ba}));const {configArray:_0x4353c2}=await fetchModelList(_0x3904f8),_0x2e999d=_0xd96aa6?_0xd96aa6+_0x53e82f(0x134):_0x53e82f(0x148),_0x53c935=_0xd96aa6?_0xd96aa6+_0x53e82f(0x13b):_0x53e82f(0x147);console[_0x53e82f(0x141)](t(_0x53e82f(0x145))),console[_0x53e82f(0x141)](t('api.silent.modelFileName',{'name':_0x2e999d})),console[_0x53e82f(0x141)](t('api.silent.clientFileName',{'name':_0x53c935})),console[_0x53e82f(0x141)](t('api.silent.processing',{'count':_0x4353c2[_0x53e82f(0x14b)]}));const _0x95c24=await generateApiFile(_0x4353c2,_0xd96aa6,_0x3904f8,!![],_0x49e8ba);return console[_0x53e82f(0x141)](t(_0x53e82f(0x13c),{'datasetCount':_0x4353c2[_0x53e82f(0x14b)],'modelCount':_0x95c24[_0x53e82f(0x13d)]})),_0x4c5332&&logger[_0x53e82f(0x142)]('create-api-pull','API\x20配置拉取成功:\x20'+_0x3904f8,{'projectPath':_0x4c5332,'appCode':_0x3904f8,'datasetCount':_0x4353c2[_0x53e82f(0x14b)],'filePrefix':_0xd96aa6}),!![];}catch(_0x6066de){const _0x3302f7=_0x6066de instanceof Error?_0x6066de[_0x53e82f(0x140)]:String(_0x6066de);return console['error'](t(_0x53e82f(0x14e),{'error':_0x3302f7})),_0x4c5332&&logger[_0x53e82f(0x14c)](_0x53e82f(0x143),_0x53e82f(0x13f)+_0x3302f7,{'appCode':_0x3904f8,'projectPath':_0x4c5332}),![];}finally{_0x5a36f4&&process[_0x53e82f(0x13e)](_0x5a36f4);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1f427f,_0x40d0f8){const _0x566a31=a12_0x20ca,_0x14e6f7=_0x1f427f();while(!![]){try{const _0x36368d=parseInt(_0x566a31(0x20c))/0x1*(-parseInt(_0x566a31(0x21b))/0x2)+-parseInt(_0x566a31(0x215))/0x3+parseInt(_0x566a31(0x22e))/0x4*(parseInt(_0x566a31(0x222))/0x5)+-parseInt(_0x566a31(0x1f9))/0x6*(parseInt(_0x566a31(0x1ea))/0x7)+parseInt(_0x566a31(0x1f0))/0x8*(-parseInt(_0x566a31(0x229))/0x9)+-parseInt(_0x566a31(0x221))/0xa*(-parseInt(_0x566a31(0x1f6))/0xb)+parseInt(_0x566a31(0x213))/0xc*(parseInt(_0x566a31(0x210))/0xd);if(_0x36368d===_0x40d0f8)break;else _0x14e6f7['push'](_0x14e6f7['shift']());}catch(_0x21d362){_0x14e6f7['push'](_0x14e6f7['shift']());}}}(a12_0x3df1,0x78326));import{jsx as a12_0x5bcc98,jsxs as a12_0x1fcba6,Fragment as a12_0x1be7d4}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';import a12_0x389237 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';function a12_0x20ca(_0x2bd162,_0x2c4518){_0x2bd162=_0x2bd162-0x1ea;const _0x3df192=a12_0x3df1();let _0x20ca17=_0x3df192[_0x2bd162];return _0x20ca17;}import{getLocalPages}from'./get-local-pages.js';function a12_0x3df1(){const _0x53f836=['backspace','10777gcxLSt','*\x20同步菜单到\x20Lovrabet\x20平台','√\x20菜单创建完成','29604HvIHrF','CSS\x20链接无法访问','348897gYlwnU','label','green','max','\x20输入项目的\x20JS\x20资源链接(https://...)','\x20命令重新登录','1794442bUKPbD','请输入有效的\x20CSS\x20https\x20链接','local','filter','upArrow','slice','10GkMFTw','45jRBJpR','*\x20JS\x20链接:\x20','includes','*\x20请选择要同步的菜单:','请输入有效的\x20JS\x20https\x20链接','\x20正在获取线上菜单列表...','path','9fOitQa','online','创建菜单失败','cyan','菜单名称','259352kKyTJK','message','JS\x20链接无法访问','8729WcDntm','dots','join','done','\x20←\x20','selecting','7122832qkNbjh','test','length','add','已选择菜单','提示:使用\x20','7785283KdRGbr','gray','map','4524wUghEl','white','delete','red','lovrabet\x20auth','creating','input-css','fill','has','trim','input-js','CSS\x20链接','repeat','Lovrabet平台','JS\x20链接','size','return','请至少选择一个菜单','*\x20正在创建菜单...','1LotyHK','[\x20]','column'];a12_0x3df1=function(){return _0x53f836;};return a12_0x3df1();}import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import.meta.main&&render(a12_0x5bcc98(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0x1984ef=a12_0x20ca,{exit:_0x3fe2d6}=useApp(),{loading:_0x395867,menuList:_0x30024b,error:_0xcef265}=useGetOnlineMenuList(),_0x4da114=getLocalPages(),_0x49bb67=_0x30024b[_0x1984ef(0x1f8)](_0x3fd622=>_0x3fd622['path']),_0x19ac7b=[_0x1984ef(0x22d),..._0x4da114['map'](_0x5d7a92=>_0x5d7a92['label'])],_0x3ddf8e=getStringWidth(getMaxWidth(_0x19ac7b,0x4)),_0x28e0cd=getStringWidth(getMaxWidth([_0x1984ef(0x22d)])),[_0x4dfbe4,_0x34a925]=useState(_0x1984ef(0x1ef)),[_0x506728,_0x24bd2e]=useState(new Set()),[_0x4076a5,_0x1b8c22]=useState(0x0),[_0x1efe3b,_0x485896]=useState(''),[_0x3a0684,_0x5c141f]=useState(''),[_0x2aec27,_0x2f5920]=useState(''),[_0xc5434a,_0x272cd9]=useState(''),[_0x1c39b9,_0x325dc8]=useState([]),_0x270af9=_0x4da114[_0x1984ef(0x1f8)](_0x5b2e9e=>({'label':_0x5b2e9e[_0x1984ef(0x216)],'path':_0x5b2e9e[_0x1984ef(0x228)],'local':!![],'online':_0x49bb67[_0x1984ef(0x224)](_0x5b2e9e[_0x1984ef(0x228)])})),_0x274904=_0x4da114[_0x1984ef(0x21e)](_0x330c53=>{return!_0x49bb67['includes'](_0x330c53['path']);});useEffect(()=>{const _0x3006b2=_0x1984ef;if(!_0x395867&&_0x4da114[_0x3006b2(0x1f2)]>0x0&&_0x506728[_0x3006b2(0x208)]===0x0){const _0x554a11=new Set(_0x4da114[_0x3006b2(0x1f8)]((_0x243b11,_0x1ea128)=>({'page':_0x243b11,'index':_0x1ea128}))[_0x3006b2(0x21e)](({page:_0x534d8c})=>!_0x49bb67[_0x3006b2(0x224)](_0x534d8c[_0x3006b2(0x228)]))[_0x3006b2(0x1f8)](({index:_0x44166a})=>_0x44166a));_0x24bd2e(_0x554a11);}},[_0x395867,_0x4da114[_0x1984ef(0x1f2)],_0x49bb67[_0x1984ef(0x1f2)]]),useInput(async(_0x3b599a,_0x287372)=>{const _0x5b073f=_0x1984ef;if(_0x4dfbe4===_0x5b073f(0x1ef)){if(_0x287372[_0x5b073f(0x21f)]){_0x1b8c22(_0x15b4ae=>_0x15b4ae>0x0?_0x15b4ae-0x1:_0x4da114[_0x5b073f(0x1f2)]-0x1);return;}if(_0x287372['downArrow']){_0x1b8c22(_0x1b4d0f=>_0x1b4d0f<_0x4da114[_0x5b073f(0x1f2)]-0x1?_0x1b4d0f+0x1:0x0);return;}if(_0x3b599a==='\x20'){_0x24bd2e(_0x1fd455=>{const _0x82ebfa=_0x5b073f,_0x869253=new Set(_0x1fd455);return _0x869253['has'](_0x4076a5)?_0x869253[_0x82ebfa(0x1fb)](_0x4076a5):_0x869253[_0x82ebfa(0x1f3)](_0x4076a5),_0x869253;});return;}if(_0x3b599a==='a'||_0x3b599a==='A'){const _0x1083df=new Set(_0x4da114[_0x5b073f(0x1f8)]((_0x5073bc,_0x31df14)=>_0x31df14));_0x24bd2e(_0x1083df);return;}if(_0x3b599a==='i'||_0x3b599a==='I'||_0x3b599a==='r'||_0x3b599a==='R'){_0x24bd2e(_0x3fe767=>{const _0x24daeb=_0x5b073f,_0x3e3dbc=new Set();for(let _0x2f1e9e=0x0;_0x2f1e9e<_0x4da114[_0x24daeb(0x1f2)];_0x2f1e9e++){!_0x3fe767[_0x24daeb(0x201)](_0x2f1e9e)&&_0x3e3dbc[_0x24daeb(0x1f3)](_0x2f1e9e);}return _0x3e3dbc;});return;}if(_0x3b599a==='q'||_0x3b599a==='Q'){_0x3fe2d6();return;}if(_0x287372[_0x5b073f(0x209)]){if(_0x506728[_0x5b073f(0x208)]===0x0){_0x272cd9(_0x5b073f(0x20a));return;}const _0x149f23=_0x4da114['filter']((_0x7aa396,_0x2cb57b)=>_0x506728['has'](_0x2cb57b)),_0x472f42=_0x149f23[_0x5b073f(0x1f8)](_0x4ad397=>_0x4ad397[_0x5b073f(0x216)])[_0x5b073f(0x1ec)](',\x20');_0x325dc8([{'label':_0x5b073f(0x1f4),'value':_0x506728[_0x5b073f(0x208)]+'\x20个'}]),_0x272cd9(''),_0x34a925(_0x5b073f(0x203));return;}return;}if(_0x4dfbe4===_0x5b073f(0x203)){if(_0x287372[_0x5b073f(0x209)]){const _0x8b484d=_0x2aec27[_0x5b073f(0x202)]();if(_0x8b484d==='')return;if(!isValidJsHttpsUrl(_0x8b484d)){_0x272cd9(_0x5b073f(0x226));return;}if(!await isUrlReachable(_0x8b484d)){_0x272cd9(_0x5b073f(0x230));return;}_0x485896(_0x8b484d),_0x325dc8(_0x5363d5=>[..._0x5363d5,{'label':_0x5b073f(0x207),'value':_0x8b484d}]),_0x2f5920(''),_0x272cd9(''),_0x34a925(_0x5b073f(0x1ff));return;}if(_0x287372[_0x5b073f(0x20f)]||_0x287372[_0x5b073f(0x1fb)]){_0x2f5920(_0x454eb8=>_0x454eb8[_0x5b073f(0x220)](0x0,-0x1)),_0x272cd9('');return;}_0x2f5920(_0x4c554c=>_0x4c554c+_0x3b599a);return;}if(_0x4dfbe4==='input-css'){if(_0x287372[_0x5b073f(0x209)]){const _0x563ae2=_0x2aec27[_0x5b073f(0x202)]();if(_0x563ae2==='')return;if(!isValidCssHttpsUrl(_0x563ae2)){_0x272cd9(_0x5b073f(0x21c));return;}if(!await isUrlReachable(_0x563ae2)){_0x272cd9(_0x5b073f(0x214));return;}_0x5c141f(_0x563ae2),_0x325dc8(_0x4ca6d0=>[..._0x4ca6d0,{'label':_0x5b073f(0x204),'value':_0x563ae2}]),_0x2f5920(''),_0x272cd9(''),_0x34a925(_0x5b073f(0x1fe));const _0x6c3403=_0x4da114['filter']((_0x1a474b,_0x556e20)=>_0x506728[_0x5b073f(0x201)](_0x556e20));createMenus(_0x6c3403,[_0x1efe3b,_0x563ae2])['then'](()=>{const _0xdf61c8=_0x5b073f;_0x34a925(_0xdf61c8(0x1ed)),setTimeout(()=>{_0x3fe2d6();},0x3e8);})['catch'](_0x18e001=>{const _0x4f0594=_0x5b073f;_0x272cd9(_0x18e001[_0x4f0594(0x22f)]||_0x4f0594(0x22b)),_0x34a925('selecting');});return;}if(_0x287372[_0x5b073f(0x20f)]||_0x287372['delete']){_0x2f5920(_0x5c60c4=>_0x5c60c4[_0x5b073f(0x220)](0x0,-0x1)),_0x272cd9('');return;}_0x2f5920(_0x38b8f2=>_0x38b8f2+_0x3b599a);return;}});if(_0x395867)return a12_0x1fcba6(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x5bcc98(Text,{'children':'\x20\x20'}),a12_0x5bcc98(a12_0x389237,{'type':_0x1984ef(0x1eb)}),a12_0x5bcc98(Text,{'children':_0x1984ef(0x227)})]});if(_0xcef265)return a12_0x1fcba6(Box,{'flexDirection':_0x1984ef(0x20e),'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x1fcba6(Text,{'color':_0x1984ef(0x1fc),'children':['✗\x20',_0xcef265]}),a12_0x1fcba6(Box,{'marginTop':0x1,'children':[a12_0x5bcc98(Text,{'color':_0x1984ef(0x1f7),'children':_0x1984ef(0x1f5)}),a12_0x5bcc98(Text,{'color':_0x1984ef(0x22c),'children':_0x1984ef(0x1fd)}),a12_0x5bcc98(Text,{'color':_0x1984ef(0x1f7),'children':_0x1984ef(0x21a)})]})]});if(_0x4da114[_0x1984ef(0x1f2)]===0x0)return a12_0x5bcc98(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a12_0x5bcc98(Text,{'color':'yellow','children':'!\x20未找到本地页面,请先创建页面'})});return a12_0x1fcba6(Box,{'flexDirection':_0x1984ef(0x20e),'marginTop':0x1,'marginBottom':0x1,'children':[_0x4dfbe4===_0x1984ef(0x1ef)&&a12_0x1fcba6(a12_0x1be7d4,{'children':[a12_0x1fcba6(Box,{'children':[a12_0x1fcba6(Text,{'bold':!![],'children':['\x20\x20','菜单名称',getRemainingSpaces(_0x3ddf8e,_0x1984ef(0x22d))]}),a12_0x1fcba6(Text,{'bold':!![],'children':['本地',getRemainingSpaces(_0x28e0cd,_0x1984ef(0x22d))]}),a12_0x1fcba6(Text,{'bold':!![],'children':[_0x1984ef(0x206),getRemainingSpaces(_0x28e0cd,_0x1984ef(0x22d))]})]}),_0x270af9[_0x1984ef(0x1f8)](_0x248f4c=>a12_0x1fcba6(Box,{'children':[a12_0x1fcba6(Text,{'children':['\x20\x20',_0x248f4c[_0x1984ef(0x216)],getRemainingSpaces(_0x3ddf8e,_0x248f4c[_0x1984ef(0x216)])]}),a12_0x1fcba6(Text,{'color':_0x1984ef(0x217),'children':[_0x248f4c[_0x1984ef(0x21d)]?'✓':'✗',getRemainingSpaces(_0x28e0cd,'✓')]}),a12_0x1fcba6(Text,{'color':_0x248f4c[_0x1984ef(0x22a)]?'green':_0x1984ef(0x1fc),'children':[_0x248f4c[_0x1984ef(0x22a)]?'✓':'✗',getRemainingSpaces(_0x28e0cd,'✓')]})]},_0x248f4c['path']))]}),_0x4dfbe4===_0x1984ef(0x1ef)&&_0x1c39b9[_0x1984ef(0x1f2)]===0x0&&a12_0x5bcc98(Box,{'marginTop':0x1,'children':a12_0x5bcc98(Text,{'color':_0x1984ef(0x22c),'children':_0x1984ef(0x211)})}),_0x1c39b9['map']((_0xa91a8f,_0x4304df)=>a12_0x1fcba6(Box,{'children':[a12_0x1fcba6(Text,{'color':'green','children':['√\x20',_0xa91a8f[_0x1984ef(0x216)],':\x20']}),a12_0x5bcc98(Text,{'color':_0x1984ef(0x22c),'children':_0xa91a8f['value']})]},_0x4304df)),_0xc5434a&&_0x4dfbe4==='selecting'&&a12_0x5bcc98(Box,{'marginTop':0x1,'children':a12_0x1fcba6(Text,{'color':_0x1984ef(0x1fc),'children':['✗\x20',_0xc5434a]})}),_0x4dfbe4===_0x1984ef(0x1ef)&&a12_0x5bcc98(a12_0x1be7d4,{'children':a12_0x1fcba6(Box,{'marginTop':_0x1c39b9[_0x1984ef(0x1f2)]>0x0||_0xc5434a?0x1:0x0,'flexDirection':_0x1984ef(0x20e),'children':[a12_0x5bcc98(Text,{'bold':!![],'children':_0x1984ef(0x225)}),_0x4da114[_0x1984ef(0x1f8)]((_0x2e175e,_0x197a0e)=>{const _0x1005b8=_0x1984ef,_0x31210a=_0x4076a5===_0x197a0e,_0x414173=_0x506728[_0x1005b8(0x201)](_0x197a0e),_0x1a6fcc=_0x49bb67[_0x1005b8(0x224)](_0x2e175e[_0x1005b8(0x228)]),_0x48e19f=_0x1a6fcc?'更新':'新建';return a12_0x5bcc98(Box,{'children':a12_0x1fcba6(Text,{'backgroundColor':_0x31210a?'blue':undefined,'color':_0x31210a?_0x1005b8(0x1fa):undefined,'children':['\x20\x20',_0x414173?'[✓]':_0x1005b8(0x20d),'\x20',_0x2e175e[_0x1005b8(0x216)]]})},_0x2e175e[_0x1005b8(0x228)]);}),a12_0x5bcc98(Box,{'marginTop':0x1,'children':a12_0x1fcba6(Text,{'color':_0x1984ef(0x1f7),'children':['\x20','↑/↓:\x20移动光标\x20空格:\x20切换选中\x20a:\x20全选\x20i/r:\x20反选\x20Enter:\x20确认']})})]})}),_0x4dfbe4===_0x1984ef(0x203)&&a12_0x1fcba6(a12_0x1be7d4,{'children':[a12_0x1fcba6(Box,{'children':[a12_0x5bcc98(Text,{'children':_0x1984ef(0x223)}),a12_0x5bcc98(Text,{'color':'green','children':_0x2aec27}),_0xc5434a&&a12_0x1fcba6(Text,{'color':_0x1984ef(0x1fc),'children':[_0x1984ef(0x1ee),_0xc5434a]})]}),!_0xc5434a&&a12_0x5bcc98(Box,{'children':a12_0x5bcc98(Text,{'color':_0x1984ef(0x1f7),'children':_0x1984ef(0x219)})})]}),_0x4dfbe4===_0x1984ef(0x1ff)&&a12_0x1fcba6(a12_0x1be7d4,{'children':[a12_0x1fcba6(Box,{'children':[a12_0x5bcc98(Text,{'children':'*\x20CSS\x20链接:\x20'}),a12_0x5bcc98(Text,{'color':_0x1984ef(0x217),'children':_0x2aec27}),_0xc5434a&&a12_0x1fcba6(Text,{'color':_0x1984ef(0x1fc),'children':[_0x1984ef(0x1ee),_0xc5434a]})]}),!_0xc5434a&&a12_0x5bcc98(Box,{'children':a12_0x5bcc98(Text,{'color':'gray','children':'\x20输入项目的\x20CSS\x20资源链接(https://...)'})})]}),_0x4dfbe4===_0x1984ef(0x1fe)&&a12_0x5bcc98(Box,{'children':a12_0x5bcc98(Text,{'children':_0x1984ef(0x20b)})}),_0x4dfbe4==='done'&&a12_0x5bcc98(Box,{'children':a12_0x5bcc98(Text,{'color':_0x1984ef(0x217),'children':_0x1984ef(0x212)})})]});}function getStringWidth(_0x595af7){const _0x3a1ad5=a12_0x20ca;let _0x26db4d=0x0;for(const _0x5876aa of _0x595af7){/[\u4e00-\u9fa5]/[_0x3a1ad5(0x1f1)](_0x5876aa)?_0x26db4d+=0x2:_0x26db4d+=0x1;}return _0x26db4d;}function getRemainingSpaces(_0x508235,_0x28c8c2){const _0x2c3e20=a12_0x20ca,_0x5e47ec=getStringWidth(_0x28c8c2);return Array(Math[_0x2c3e20(0x218)](0x0,_0x508235-_0x5e47ec))[_0x2c3e20(0x200)]('\x20')[_0x2c3e20(0x1ec)]('');}function getMaxWidth(_0x50d1d2,_0x1c8357=0x2){const _0x296f79=a12_0x20ca;let _0xea14d='',_0x10e25d=0x0;for(const _0x4b64c1 of _0x50d1d2){const _0x479587=getStringWidth(_0x4b64c1);_0x479587>_0x10e25d&&(_0x10e25d=_0x479587,_0xea14d=_0x4b64c1);}return _0xea14d+'\x20'[_0x296f79(0x205)](_0x1c8357);}
|
|
1
|
+
(function(_0x3069e8,_0x3259de){const _0xe84b0b=a12_0x16a6,_0x34232d=_0x3069e8();while(!![]){try{const _0x2eafdb=parseInt(_0xe84b0b(0x210))/0x1+-parseInt(_0xe84b0b(0x205))/0x2*(-parseInt(_0xe84b0b(0x1f6))/0x3)+-parseInt(_0xe84b0b(0x1ff))/0x4*(parseInt(_0xe84b0b(0x21c))/0x5)+-parseInt(_0xe84b0b(0x226))/0x6*(parseInt(_0xe84b0b(0x22e))/0x7)+parseInt(_0xe84b0b(0x1f2))/0x8*(-parseInt(_0xe84b0b(0x1fb))/0x9)+-parseInt(_0xe84b0b(0x20e))/0xa*(parseInt(_0xe84b0b(0x202))/0xb)+-parseInt(_0xe84b0b(0x227))/0xc*(-parseInt(_0xe84b0b(0x207))/0xd);if(_0x2eafdb===_0x3259de)break;else _0x34232d['push'](_0x34232d['shift']());}catch(_0x192478){_0x34232d['push'](_0x34232d['shift']());}}}(a12_0x3601,0x2ae08));import{jsx as a12_0x2ee017,jsxs as a12_0xa0536c,Fragment as a12_0x30a25e}from'react/jsx-runtime';import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a12_0x16a6(_0x10422f,_0x267b4c){_0x10422f=_0x10422f-0x1e9;const _0x360186=a12_0x3601();let _0x16a628=_0x360186[_0x10422f];return _0x16a628;}import a12_0x2355e1 from'ink-spinner';import{useGetOnlineMenuList}from'./use-get-online-menu-list.js';import{getLocalPages}from'./get-local-pages.js';import{createMenus}from'./create-menu.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'./valid-url.js';import{useI18n}from'../i18n/hooks.js';function a12_0x3601(){const _0x8f613=['local','65DznwEP','input-js','online','max','appMenu.sync.step.completed','appMenu.sync.input.cssUrl.placeholder','appMenu.sync.hotkeys','length','join','dots','6oUvZRe','42288trOMMm','appMenu.sync.loading.fetchingMenuList','then','map','red','trim','filter','431753JtsycQ','appMenu.sync.error.authHint.prefix','appMenu.sync.step.jsUrl','selecting','\x20←\x20','appMenu.sync.step.selectedMenusCount','backspace','add','downArrow','has','column','blue','4336mzvfkR','value','path','creating','86763dHMrtv','return','appMenu.sync.error.createMenuFailed','input-css','appMenu.sync.step.selectMenus','3123KVmfLT','appMenu.sync.operation.create','message','appMenu.sync.input.jsUrl.label','12160obrECu','includes','slice','11CVnjhM','fill','appMenu.sync.input.cssUrl.label','2OZtXHo','delete','1898bbmbDg','size','appMenu.sync.step.cssUrl','label','done','gray','lovrabet\x20auth','895540BpKsyT','appMenu.sync.error.authHint.suffix','11026HvOjsB','[✓]','white','appMenu.sync.table.lovrabetPlatform','test','yellow','cyan','appMenu.sync.error.invalidCssUrl','appMenu.sync.table.menuName','green','appMenu.sync.error.noMenuSelected'];a12_0x3601=function(){return _0x8f613;};return a12_0x3601();}import.meta.main&&render(a12_0x2ee017(AppMenuSyncUI,{}));export function AppMenuSyncUI(){const _0xcdeb8c=a12_0x16a6,{exit:_0x48c4a7}=useApp(),{t:_0x1781f3}=useI18n(),{loading:_0x312e38,menuList:_0x2ee5eb,error:_0x7d1aa4}=useGetOnlineMenuList(),_0x22df30=getLocalPages(),_0x4c1920=_0x2ee5eb[_0xcdeb8c(0x22a)](_0x28bf76=>_0x28bf76[_0xcdeb8c(0x1f4)]),_0x41bb51=_0x1781f3(_0xcdeb8c(0x218)),_0x1fafd3=[_0x41bb51,..._0x22df30[_0xcdeb8c(0x22a)](_0x5dec69=>_0x5dec69[_0xcdeb8c(0x20a)])],_0xf699c6=getStringWidth(getMaxWidth(_0x1fafd3,0x4)),_0x5df4c0=getStringWidth(getMaxWidth([_0x41bb51])),[_0x4822b0,_0x375eeb]=useState(_0xcdeb8c(0x1e9)),[_0x175668,_0x416c4e]=useState(new Set()),[_0x12bf0f,_0x46d237]=useState(0x0),[_0x43f0ee,_0x4444ff]=useState(''),[_0x43bc92,_0x4c349c]=useState(''),[_0x56bf16,_0x510667]=useState(''),[_0x16e360,_0x1f0c9b]=useState(''),[_0x47afdb,_0x1ccaa1]=useState([]),_0x233dd0=_0x22df30[_0xcdeb8c(0x22a)](_0x15e3c1=>({'label':_0x15e3c1[_0xcdeb8c(0x20a)],'path':_0x15e3c1[_0xcdeb8c(0x1f4)],'local':!![],'online':_0x4c1920[_0xcdeb8c(0x200)](_0x15e3c1[_0xcdeb8c(0x1f4)])})),_0x5861c7=_0x22df30[_0xcdeb8c(0x22d)](_0x27a0f1=>{const _0x1b93aa=_0xcdeb8c;return!_0x4c1920[_0x1b93aa(0x200)](_0x27a0f1['path']);});useEffect(()=>{const _0x42af3a=_0xcdeb8c;if(!_0x312e38&&_0x22df30['length']>0x0&&_0x175668[_0x42af3a(0x208)]===0x0){const _0x1913e9=new Set(_0x22df30[_0x42af3a(0x22a)]((_0x4774ad,_0x2cb4f8)=>({'page':_0x4774ad,'index':_0x2cb4f8}))[_0x42af3a(0x22d)](({page:_0x5670db})=>!_0x4c1920[_0x42af3a(0x200)](_0x5670db[_0x42af3a(0x1f4)]))['map'](({index:_0x383b1b})=>_0x383b1b));_0x416c4e(_0x1913e9);}},[_0x312e38,_0x22df30['length'],_0x4c1920['length']]),useInput(async(_0x108bbd,_0x4c3825)=>{const _0x178d1b=_0xcdeb8c;if(_0x4822b0==='selecting'){if(_0x4c3825['upArrow']){_0x46d237(_0x4ba04f=>_0x4ba04f>0x0?_0x4ba04f-0x1:_0x22df30[_0x178d1b(0x223)]-0x1);return;}if(_0x4c3825[_0x178d1b(0x1ee)]){_0x46d237(_0xb724f2=>_0xb724f2<_0x22df30[_0x178d1b(0x223)]-0x1?_0xb724f2+0x1:0x0);return;}if(_0x108bbd==='\x20'){_0x416c4e(_0x29f7db=>{const _0x5310b6=_0x178d1b,_0x52ac75=new Set(_0x29f7db);return _0x52ac75[_0x5310b6(0x1ef)](_0x12bf0f)?_0x52ac75[_0x5310b6(0x206)](_0x12bf0f):_0x52ac75[_0x5310b6(0x1ed)](_0x12bf0f),_0x52ac75;});return;}if(_0x108bbd==='a'||_0x108bbd==='A'){const _0x297f67=new Set(_0x22df30[_0x178d1b(0x22a)]((_0x22f26c,_0x2dad78)=>_0x2dad78));_0x416c4e(_0x297f67);return;}if(_0x108bbd==='i'||_0x108bbd==='I'||_0x108bbd==='r'||_0x108bbd==='R'){_0x416c4e(_0x126a2d=>{const _0x2acb84=_0x178d1b,_0x338361=new Set();for(let _0x59ebcb=0x0;_0x59ebcb<_0x22df30[_0x2acb84(0x223)];_0x59ebcb++){!_0x126a2d[_0x2acb84(0x1ef)](_0x59ebcb)&&_0x338361[_0x2acb84(0x1ed)](_0x59ebcb);}return _0x338361;});return;}if(_0x108bbd==='q'||_0x108bbd==='Q'){_0x48c4a7();return;}if(_0x4c3825['return']){if(_0x175668[_0x178d1b(0x208)]===0x0){_0x1f0c9b(_0x1781f3(_0x178d1b(0x21a)));return;}const _0xf4f56a=_0x22df30[_0x178d1b(0x22d)]((_0x7b9cc6,_0x5d8b59)=>_0x175668[_0x178d1b(0x1ef)](_0x5d8b59)),_0x2aa9a7=_0xf4f56a['map'](_0x45bb9e=>_0x45bb9e[_0x178d1b(0x20a)])[_0x178d1b(0x224)](',\x20');_0x1ccaa1([{'label':_0x1781f3('appMenu.sync.step.selectedMenus'),'value':_0x1781f3(_0x178d1b(0x1eb),{'count':_0x175668['size']})}]),_0x1f0c9b(''),_0x375eeb(_0x178d1b(0x21d));return;}return;}if(_0x4822b0===_0x178d1b(0x21d)){if(_0x4c3825[_0x178d1b(0x1f7)]){const _0x1e11ce=_0x56bf16[_0x178d1b(0x22c)]();if(_0x1e11ce==='')return;if(!isValidJsHttpsUrl(_0x1e11ce)){_0x1f0c9b(_0x1781f3('appMenu.sync.error.invalidJsUrl'));return;}if(!await isUrlReachable(_0x1e11ce)){_0x1f0c9b(_0x1781f3('appMenu.sync.error.jsUrlUnreachable'));return;}_0x4444ff(_0x1e11ce),_0x1ccaa1(_0x5ccc37=>[..._0x5ccc37,{'label':_0x1781f3(_0x178d1b(0x230)),'value':_0x1e11ce}]),_0x510667(''),_0x1f0c9b(''),_0x375eeb(_0x178d1b(0x1f9));return;}if(_0x4c3825['backspace']||_0x4c3825[_0x178d1b(0x206)]){_0x510667(_0x203856=>_0x203856[_0x178d1b(0x201)](0x0,-0x1)),_0x1f0c9b('');return;}_0x510667(_0xbe8592=>_0xbe8592+_0x108bbd);return;}if(_0x4822b0===_0x178d1b(0x1f9)){if(_0x4c3825[_0x178d1b(0x1f7)]){const _0x307188=_0x56bf16['trim']();if(_0x307188==='')return;if(!isValidCssHttpsUrl(_0x307188)){_0x1f0c9b(_0x1781f3(_0x178d1b(0x217)));return;}if(!await isUrlReachable(_0x307188)){_0x1f0c9b(_0x1781f3('appMenu.sync.error.cssUrlUnreachable'));return;}_0x4c349c(_0x307188),_0x1ccaa1(_0x4815cd=>[..._0x4815cd,{'label':_0x1781f3(_0x178d1b(0x209)),'value':_0x307188}]),_0x510667(''),_0x1f0c9b(''),_0x375eeb(_0x178d1b(0x1f5));const _0x5eff2a=_0x22df30[_0x178d1b(0x22d)]((_0x2b5138,_0x2ffae4)=>_0x175668[_0x178d1b(0x1ef)](_0x2ffae4));createMenus(_0x5eff2a,[_0x43f0ee,_0x307188])[_0x178d1b(0x229)](()=>{const _0x316dc4=_0x178d1b;_0x375eeb(_0x316dc4(0x20b)),setTimeout(()=>{_0x48c4a7();},0x3e8);})['catch'](_0x11d692=>{const _0x3a3ef9=_0x178d1b;_0x1f0c9b(_0x11d692[_0x3a3ef9(0x1fd)]||_0x1781f3(_0x3a3ef9(0x1f8))),_0x375eeb('selecting');});return;}if(_0x4c3825[_0x178d1b(0x1ec)]||_0x4c3825[_0x178d1b(0x206)]){_0x510667(_0x261c88=>_0x261c88[_0x178d1b(0x201)](0x0,-0x1)),_0x1f0c9b('');return;}_0x510667(_0x14b15b=>_0x14b15b+_0x108bbd);return;}});if(_0x312e38)return a12_0xa0536c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a12_0x2ee017(Text,{'children':'\x20\x20'}),a12_0x2ee017(a12_0x2355e1,{'type':_0xcdeb8c(0x225)}),a12_0x2ee017(Text,{'children':_0x1781f3(_0xcdeb8c(0x228))})]});if(_0x7d1aa4)return a12_0xa0536c(Box,{'flexDirection':_0xcdeb8c(0x1f0),'marginTop':0x1,'marginBottom':0x1,'children':[a12_0xa0536c(Text,{'color':_0xcdeb8c(0x22b),'children':['✗\x20',_0x7d1aa4]}),a12_0xa0536c(Box,{'marginTop':0x1,'children':[a12_0x2ee017(Text,{'color':_0xcdeb8c(0x20c),'children':_0x1781f3(_0xcdeb8c(0x22f))}),a12_0x2ee017(Text,{'color':_0xcdeb8c(0x216),'children':_0xcdeb8c(0x20d)}),a12_0x2ee017(Text,{'color':_0xcdeb8c(0x20c),'children':_0x1781f3(_0xcdeb8c(0x20f))})]})]});if(_0x22df30['length']===0x0)return a12_0x2ee017(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a12_0x2ee017(Text,{'color':_0xcdeb8c(0x215),'children':_0x1781f3('appMenu.sync.error.noLocalPages')})});return a12_0xa0536c(Box,{'flexDirection':_0xcdeb8c(0x1f0),'marginTop':0x1,'marginBottom':0x1,'children':[_0x4822b0===_0xcdeb8c(0x1e9)&&a12_0xa0536c(a12_0x30a25e,{'children':[a12_0xa0536c(Box,{'children':[a12_0xa0536c(Text,{'bold':!![],'children':['\x20\x20',_0x41bb51,getRemainingSpaces(_0xf699c6,_0x41bb51)]}),a12_0xa0536c(Text,{'bold':!![],'children':[_0x1781f3('appMenu.sync.table.local'),getRemainingSpaces(_0x5df4c0,_0x41bb51)]}),a12_0xa0536c(Text,{'bold':!![],'children':[_0x1781f3(_0xcdeb8c(0x213)),getRemainingSpaces(_0x5df4c0,_0x41bb51)]})]}),_0x233dd0[_0xcdeb8c(0x22a)](_0x279e44=>a12_0xa0536c(Box,{'children':[a12_0xa0536c(Text,{'children':['\x20\x20',_0x279e44['label'],getRemainingSpaces(_0xf699c6,_0x279e44[_0xcdeb8c(0x20a)])]}),a12_0xa0536c(Text,{'color':_0xcdeb8c(0x219),'children':[_0x279e44[_0xcdeb8c(0x21b)]?'✓':'✗',getRemainingSpaces(_0x5df4c0,'✓')]}),a12_0xa0536c(Text,{'color':_0x279e44['online']?_0xcdeb8c(0x219):_0xcdeb8c(0x22b),'children':[_0x279e44[_0xcdeb8c(0x21e)]?'✓':'✗',getRemainingSpaces(_0x5df4c0,'✓')]})]},_0x279e44[_0xcdeb8c(0x1f4)]))]}),_0x4822b0===_0xcdeb8c(0x1e9)&&_0x47afdb[_0xcdeb8c(0x223)]===0x0&&a12_0x2ee017(Box,{'marginTop':0x1,'children':a12_0x2ee017(Text,{'color':_0xcdeb8c(0x216),'children':_0x1781f3('appMenu.sync.title')})}),_0x47afdb[_0xcdeb8c(0x22a)]((_0x515a1c,_0x2d8309)=>a12_0xa0536c(Box,{'children':[a12_0xa0536c(Text,{'color':_0xcdeb8c(0x219),'children':['√\x20',_0x515a1c[_0xcdeb8c(0x20a)],':\x20']}),a12_0x2ee017(Text,{'color':_0xcdeb8c(0x216),'children':_0x515a1c[_0xcdeb8c(0x1f3)]})]},_0x2d8309)),_0x16e360&&_0x4822b0===_0xcdeb8c(0x1e9)&&a12_0x2ee017(Box,{'marginTop':0x1,'children':a12_0xa0536c(Text,{'color':_0xcdeb8c(0x22b),'children':['✗\x20',_0x16e360]})}),_0x4822b0==='selecting'&&a12_0x2ee017(a12_0x30a25e,{'children':a12_0xa0536c(Box,{'marginTop':_0x47afdb[_0xcdeb8c(0x223)]>0x0||_0x16e360?0x1:0x0,'flexDirection':_0xcdeb8c(0x1f0),'children':[a12_0x2ee017(Text,{'bold':!![],'children':_0x1781f3(_0xcdeb8c(0x1fa))}),_0x22df30[_0xcdeb8c(0x22a)]((_0x499cf3,_0x391ea1)=>{const _0x40d36a=_0xcdeb8c,_0x4aac51=_0x12bf0f===_0x391ea1,_0x4953de=_0x175668['has'](_0x391ea1),_0x31436d=_0x4c1920[_0x40d36a(0x200)](_0x499cf3[_0x40d36a(0x1f4)]),_0x4574b5=_0x31436d?_0x1781f3('appMenu.sync.operation.update'):_0x1781f3(_0x40d36a(0x1fc));return a12_0x2ee017(Box,{'children':a12_0xa0536c(Text,{'backgroundColor':_0x4aac51?_0x40d36a(0x1f1):undefined,'color':_0x4aac51?_0x40d36a(0x212):undefined,'children':['\x20\x20',_0x4953de?_0x40d36a(0x211):'[\x20]','\x20',_0x499cf3['label']]})},_0x499cf3[_0x40d36a(0x1f4)]);}),a12_0x2ee017(Box,{'marginTop':0x1,'children':a12_0xa0536c(Text,{'color':_0xcdeb8c(0x20c),'children':['\x20',_0x1781f3(_0xcdeb8c(0x222))]})})]})}),_0x4822b0===_0xcdeb8c(0x21d)&&a12_0xa0536c(a12_0x30a25e,{'children':[a12_0xa0536c(Box,{'children':[a12_0x2ee017(Text,{'children':_0x1781f3(_0xcdeb8c(0x1fe))}),a12_0x2ee017(Text,{'color':_0xcdeb8c(0x219),'children':_0x56bf16}),_0x16e360&&a12_0xa0536c(Text,{'color':_0xcdeb8c(0x22b),'children':[_0xcdeb8c(0x1ea),_0x16e360]})]}),!_0x16e360&&a12_0x2ee017(Box,{'children':a12_0x2ee017(Text,{'color':_0xcdeb8c(0x20c),'children':_0x1781f3('appMenu.sync.input.jsUrl.placeholder')})})]}),_0x4822b0===_0xcdeb8c(0x1f9)&&a12_0xa0536c(a12_0x30a25e,{'children':[a12_0xa0536c(Box,{'children':[a12_0x2ee017(Text,{'children':_0x1781f3(_0xcdeb8c(0x204))}),a12_0x2ee017(Text,{'color':'green','children':_0x56bf16}),_0x16e360&&a12_0xa0536c(Text,{'color':'red','children':[_0xcdeb8c(0x1ea),_0x16e360]})]}),!_0x16e360&&a12_0x2ee017(Box,{'children':a12_0x2ee017(Text,{'color':'gray','children':_0x1781f3(_0xcdeb8c(0x221))})})]}),_0x4822b0===_0xcdeb8c(0x1f5)&&a12_0x2ee017(Box,{'children':a12_0x2ee017(Text,{'children':_0x1781f3('appMenu.sync.step.creating')})}),_0x4822b0==='done'&&a12_0x2ee017(Box,{'children':a12_0x2ee017(Text,{'color':_0xcdeb8c(0x219),'children':_0x1781f3(_0xcdeb8c(0x220))})})]});}function getStringWidth(_0x6f9df7){const _0x46832d=a12_0x16a6;let _0x3603fe=0x0;for(const _0x34d253 of _0x6f9df7){/[\u4e00-\u9fa5]/[_0x46832d(0x214)](_0x34d253)?_0x3603fe+=0x2:_0x3603fe+=0x1;}return _0x3603fe;}function getRemainingSpaces(_0x39a69f,_0x242d58){const _0x14bab2=a12_0x16a6,_0x34c957=getStringWidth(_0x242d58);return Array(Math[_0x14bab2(0x21f)](0x0,_0x39a69f-_0x34c957))[_0x14bab2(0x203)]('\x20')[_0x14bab2(0x224)]('');}function getMaxWidth(_0x3d564d,_0x12aa8e=0x2){let _0x1520e8='',_0x1f46ce=0x0;for(const _0x32b061 of _0x3d564d){const _0x3809a6=getStringWidth(_0x32b061);_0x3809a6>_0x1f46ce&&(_0x1f46ce=_0x3809a6,_0x1520e8=_0x32b061);}return _0x1520e8+'\x20'['repeat'](_0x12aa8e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a13_0x3d1116=a13_0x56e4;(function(_0x13d23c,_0x478b41){const _0x22836b=a13_0x56e4,_0x528227=_0x13d23c();while(!![]){try{const _0x49074b=-parseInt(_0x22836b(0xf4))/0x1*(parseInt(_0x22836b(0xf3))/0x2)+parseInt(_0x22836b(0x113))/0x3+-parseInt(_0x22836b(0x116))/0x4*(parseInt(_0x22836b(0x108))/0x5)+parseInt(_0x22836b(0xf2))/0x6+-parseInt(_0x22836b(0xec))/0x7+-parseInt(_0x22836b(0xef))/0x8+-parseInt(_0x22836b(0xfe))/0x9*(-parseInt(_0x22836b(0x105))/0xa);if(_0x49074b===_0x478b41)break;else _0x528227['push'](_0x528227['shift']());}catch(_0x49cb9d){_0x528227['push'](_0x528227['shift']());}}}(a13_0x301f,0xe620d));function a13_0x301f(){const _0x2d97ee=['procode','appMenu.success.created','8984016cgXkZb','appMenu.error.missingAppCode','appMenu.error.appCodeHint.title','10739016cRqCIC','1992390ZhKuud','1yRFcrF','create-menus','data','error','appMenu.error.createHttpStatus','stringify','appMenu.error.authExpired','appMenu.error.createFailed','length','errorCode','22761ezPvNA','success','import','errorMsg','appMenu.error.appCodeHint.option2','/smartapi/menu/create','bind','2810shcMLY','create-menu','path','30toMIih','POST','status','appMenu.creating.single','appMenu.creating.batch.start','label','0011','map','appcode','resources','all','4230621AFFtBk','json','common.error','146652nIvtaf','appMenu.error.authValidationFailed','log','includes','info','appMenu.creating.batch.completed','4402384RxFOJx'];a13_0x301f=function(){return _0x2d97ee;};return a13_0x301f();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';function a13_0x56e4(_0xa2a98a,_0x573b08){_0xa2a98a=_0xa2a98a-0xea;const _0x301ff1=a13_0x301f();let _0x56e4be=_0x301ff1[_0xa2a98a];return _0x56e4be;}import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import a13_0x37e02 from'../i18n/index.js';const config=readConfig(),t=a13_0x37e02['t'][a13_0x3d1116(0x104)](a13_0x37e02);export async function createMenu(_0x34ab39){const _0x1b6397=a13_0x3d1116,_0xe57ea1=config?.[_0x1b6397(0x110)];if(!_0xe57ea1){const _0x4b5b06=t(_0x1b6397(0xf0));logger[_0x1b6397(0xf7)](_0x1b6397(0x106),_0x4b5b06),console[_0x1b6397(0xf7)]('×\x20'+_0x4b5b06),console[_0x1b6397(0x118)](t(_0x1b6397(0xf1))),console[_0x1b6397(0x118)](t('appMenu.error.appCodeHint.option1')),console[_0x1b6397(0x118)](t(_0x1b6397(0x102)));return;}logger[_0x1b6397(0xea)](_0x1b6397(0x106),t(_0x1b6397(0x10b),{'label':_0x34ab39[_0x1b6397(0x10d)],'path':_0x34ab39[_0x1b6397(0x107)]}));const _0x1e5cae={'appCode':_0xe57ea1,'type':_0x1b6397(0xed),'sort':0x0,'extend':{'loadScriptMode':_0x1b6397(0x100),'resources':_0x34ab39[_0x1b6397(0x111)]?JSON['stringify'](_0x34ab39[_0x1b6397(0x111)]):undefined},..._0x34ab39},_0x2fd6db=await fetch(getApiDomain()+_0x1b6397(0x103),{'method':_0x1b6397(0x109),'body':JSON[_0x1b6397(0xf9)](_0x1e5cae),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x2fd6db['ok']){if(_0x2fd6db[_0x1b6397(0x10a)]===0x191){const _0x35098a=t('appMenu.error.authExpired');logger[_0x1b6397(0xf7)](_0x1b6397(0x106),_0x35098a,{'status':_0x2fd6db[_0x1b6397(0x10a)],'menu':_0x34ab39['label']});throw new Error(_0x35098a);}const _0x37037b=t(_0x1b6397(0xf8),{'status':_0x2fd6db['status']});logger[_0x1b6397(0xf7)]('create-menu',_0x37037b,{'menu':_0x34ab39[_0x1b6397(0x10d)]});throw new Error(_0x37037b);}const _0x3800f5=await _0x2fd6db[_0x1b6397(0x114)]();if(!_0x3800f5[_0x1b6397(0xff)]){const _0x3c382f=t('appMenu.error.createFailed',{'error':_0x3800f5['errorMsg']||t(_0x1b6397(0x115))});logger[_0x1b6397(0xf7)](_0x1b6397(0x106),_0x3c382f,{'errorCode':_0x3800f5['errorCode'],'errorMsg':_0x3800f5[_0x1b6397(0x101)],'menu':_0x34ab39['label']});throw new Error(_0x3c382f);}logger[_0x1b6397(0xea)](_0x1b6397(0x106),''+t(_0x1b6397(0xee))+_0x34ab39[_0x1b6397(0x10d)],_0x3800f5[_0x1b6397(0xf6)]),console[_0x1b6397(0x118)](t(_0x1b6397(0xee)),_0x3800f5[_0x1b6397(0xf6)]);}async function _createMenu(_0x82093a,_0x61c851){const _0x4922e5=a13_0x3d1116,_0x1ed559=config?.[_0x4922e5(0x110)];if(!_0x1ed559){const _0x22b6d0=t('appMenu.error.missingAppCode');logger[_0x4922e5(0xf7)](_0x4922e5(0x106),_0x22b6d0),console['error']('×\x20'+_0x22b6d0),console[_0x4922e5(0x118)](t(_0x4922e5(0xf1))),console['log'](t('appMenu.error.appCodeHint.option1')),console['log'](t('appMenu.error.appCodeHint.option2'));return;}const _0x50c827={'appCode':_0x1ed559,'type':_0x4922e5(0xed),'sort':0x0,'extend':{'loadScriptMode':_0x4922e5(0x100),'resources':_0x61c851?JSON[_0x4922e5(0xf9)](_0x61c851):undefined},'label':_0x82093a[_0x4922e5(0x10d)],'path':_0x82093a['path']},_0x19574e=await fetch(getApiDomain()+'/smartapi/menu/create',{'method':_0x4922e5(0x109),'body':JSON[_0x4922e5(0xf9)](_0x50c827),'headers':{'Content-Type':'application/json','Cookie':getCookie()}});if(!_0x19574e['ok']){if(_0x19574e[_0x4922e5(0x10a)]===0x191){const _0x2fd636=t(_0x4922e5(0xfa));logger[_0x4922e5(0xf7)](_0x4922e5(0x106),_0x2fd636,{'status':_0x19574e['status'],'menu':_0x82093a[_0x4922e5(0x10d)]});throw new Error(_0x2fd636);}const _0x29203d=t('appMenu.error.createHttpStatus',{'status':_0x19574e[_0x4922e5(0x10a)]});logger[_0x4922e5(0xf7)](_0x4922e5(0x106),_0x29203d,{'menu':_0x82093a[_0x4922e5(0x10d)]});throw new Error(_0x29203d);}const _0x25bea0=await _0x19574e[_0x4922e5(0x114)]();if(!_0x25bea0['success']){if(_0x25bea0[_0x4922e5(0xfd)]===_0x4922e5(0x10e)||_0x25bea0[_0x4922e5(0x101)]?.[_0x4922e5(0x119)]('登录')){const _0x4e6a65=t(_0x4922e5(0x117));logger['error']('create-menu',_0x4e6a65,{'errorCode':_0x25bea0[_0x4922e5(0xfd)],'errorMsg':_0x25bea0[_0x4922e5(0x101)],'menu':_0x82093a[_0x4922e5(0x10d)]});throw new Error(_0x4e6a65);}const _0x8aa800=t(_0x4922e5(0xfb),{'error':_0x25bea0[_0x4922e5(0x101)]||t('common.error')});logger['error'](_0x4922e5(0x106),_0x8aa800,{'errorCode':_0x25bea0[_0x4922e5(0xfd)],'errorMsg':_0x25bea0[_0x4922e5(0x101)],'menu':_0x82093a[_0x4922e5(0x10d)]});throw new Error(_0x8aa800);}logger[_0x4922e5(0xea)]('create-menu',''+t(_0x4922e5(0xee))+_0x82093a[_0x4922e5(0x10d)]);}export async function createMenus(_0x4e337f,_0x567cc1){const _0x4497b6=a13_0x3d1116;logger[_0x4497b6(0xea)](_0x4497b6(0xf5),t(_0x4497b6(0x10c),{'count':_0x4e337f[_0x4497b6(0xfc)]})),await Promise[_0x4497b6(0x112)](_0x4e337f[_0x4497b6(0x10f)](async _0x353483=>{await _createMenu(_0x353483,_0x567cc1);})),logger[_0x4497b6(0xea)](_0x4497b6(0xf5),t(_0x4497b6(0xeb),{'count':_0x4e337f[_0x4497b6(0xfc)]}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a14_0x5af4(_0x94457c,_0x46089e){_0x94457c=_0x94457c-0x155;const _0x348536=a14_0x3485();let _0x5af481=_0x348536[_0x94457c];return _0x5af481;}const a14_0x3c10b0=a14_0x5af4;(function(_0x7ed538,_0x4109a3){const _0x1b6af3=a14_0x5af4,_0xc95323=_0x7ed538();while(!![]){try{const _0x549d46=-parseInt(_0x1b6af3(0x155))/0x1*(parseInt(_0x1b6af3(0x16e))/0x2)+-parseInt(_0x1b6af3(0x16a))/0x3+-parseInt(_0x1b6af3(0x15a))/0x4+parseInt(_0x1b6af3(0x159))/0x5*(-parseInt(_0x1b6af3(0x15b))/0x6)+parseInt(_0x1b6af3(0x166))/0x7*(-parseInt(_0x1b6af3(0x15e))/0x8)+parseInt(_0x1b6af3(0x163))/0x9+parseInt(_0x1b6af3(0x165))/0xa*(parseInt(_0x1b6af3(0x160))/0xb);if(_0x549d46===_0x4109a3)break;else _0xc95323['push'](_0xc95323['shift']());}catch(_0x3298fa){_0xc95323['push'](_0xc95323['shift']());}}}(a14_0x3485,0x45bae));import{readdirSync,statSync,readFileSync}from'fs';import{join,relative,resolve}from'path';const pagesDir=resolve(process[a14_0x3c10b0(0x15c)](),a14_0x3c10b0(0x16d));export function extractTitleFromComment(_0x51b1c0){const _0x8bef33=a14_0x3c10b0;try{const _0x47a05f=readFileSync(_0x51b1c0,_0x8bef33(0x158)),_0x1b6ba2=_0x47a05f[_0x8bef33(0x169)](/^\s*\/\*\*?([\s\S]*?)\*\//);if(_0x1b6ba2&&_0x1b6ba2[0x1]){const _0x2c0952=_0x1b6ba2[0x1],_0x142201=_0x2c0952[_0x8bef33(0x169)](/^\s*\*?\s*title\s*:\s*(.+)/im);if(_0x142201&&_0x142201[0x1])return _0x142201[0x1][_0x8bef33(0x162)]();}let _0x44bc19=null;const _0x13d470=_0x47a05f['match'](/export\s+default\s+([A-Z][a-zA-Z0-9]*)/);_0x13d470&&_0x13d470[0x1]&&(_0x44bc19=_0x13d470[0x1]);if(!_0x44bc19){const _0x5a7e4f=_0x47a05f[_0x8bef33(0x169)](/export\s+default\s+function\s+([A-Z][a-zA-Z0-9]*)/);_0x5a7e4f&&_0x5a7e4f[0x1]&&(_0x44bc19=_0x5a7e4f[0x1]);}if(_0x44bc19){const _0x5a4dfa=new RegExp('\x5cb'+_0x44bc19+_0x8bef33(0x156)),_0x4a442a=_0x47a05f['match'](_0x5a4dfa);if(_0x4a442a&&_0x4a442a[0x1])return _0x4a442a[0x1];return _0x44bc19;}return null;}catch(_0x3846e9){return null;}}export function getLocalPages(_0xeb0e3d=pagesDir,_0xe35652=pagesDir){const _0x3f4532=a14_0x3c10b0;let _0x4a0b5c=[];const _0x23d385=readdirSync(_0xeb0e3d);return _0x23d385['forEach'](_0x18f3e0=>{const _0x4673b2=a14_0x5af4,_0x5196b7=join(_0xeb0e3d,_0x18f3e0),_0x23c718=statSync(_0x5196b7);if(_0x23c718&&_0x23c718[_0x4673b2(0x167)]())_0x4a0b5c=_0x4a0b5c['concat'](getLocalPages(_0x5196b7,_0xe35652));else{if(_0x18f3e0[_0x4673b2(0x16b)](_0x4673b2(0x16c))){let _0x3fb4b1=relative(_0xe35652,_0x5196b7);_0x3fb4b1['endsWith'](_0x4673b2(0x15f))?_0x3fb4b1=_0x3fb4b1['replace'](/index\.tsx$/,''):_0x3fb4b1=_0x3fb4b1[_0x4673b2(0x161)](/\.tsx$/,'');_0x3fb4b1[_0x4673b2(0x16b)]('/')&&(_0x3fb4b1=_0x3fb4b1['slice'](0x0,-0x1));const _0x594a6a=extractTitleFromComment(_0x5196b7),_0x4608cf=_0x594a6a||_0x3fb4b1;_0x4a0b5c[_0x4673b2(0x168)]({'path':_0x3fb4b1[_0x4673b2(0x164)]('$',':'),'label':_0x4608cf});}}}),_0x4a0b5c[_0x3f4532(0x157)](_0x1ae3d2=>_0x1ae3d2[_0x3f4532(0x15d)]!=='');}function a14_0x3485(){const _0x5c6644=['184752ivQcPq','endsWith','.tsx','src/pages','795028mSDXak','1RzDRre','\x5c.displayName\x5cs*=\x5cs*[\x22\x27]([^\x22\x27]+)[\x22\x27]','filter','utf-8','5twGzeQ','98792mAzbRt','430818JqTZSj','cwd','path','5928rtSrxq','index.tsx','22ccuVcX','replace','trim','2168226tYxVUT','replaceAll','5191150TIiVsz','4137HTJjON','isDirectory','push','match'];a14_0x3485=function(){return _0x5c6644;};return a14_0x3485();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a15_0x1c4f6b=a15_0x4f2f;(function(_0x4fff65,_0xfbedd8){const _0x4778d9=a15_0x4f2f,_0x531406=_0x4fff65();while(!![]){try{const _0x5d3dd4=parseInt(_0x4778d9(0x15b))/0x1+-parseInt(_0x4778d9(0x165))/0x2*(-parseInt(_0x4778d9(0x169))/0x3)+parseInt(_0x4778d9(0x15c))/0x4*(-parseInt(_0x4778d9(0x14c))/0x5)+-parseInt(_0x4778d9(0x164))/0x6+parseInt(_0x4778d9(0x15a))/0x7+-parseInt(_0x4778d9(0x150))/0x8+-parseInt(_0x4778d9(0x154))/0x9;if(_0x5d3dd4===_0xfbedd8)break;else _0x531406['push'](_0x531406['shift']());}catch(_0x51b728){_0x531406['push'](_0x531406['shift']());}}}(a15_0x41fb,0x5414e));import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';import{getEnv}from'../constant/env.js';function a15_0x41fb(){const _0x11a0b3=['status','length','get-online-menu-list','errorCode','application/json','1142358MYxRoK','485157rIcOqG','1087444LjhosM','data','log','bind','parse','children','json','appMenu.error.missingAppCode','355140zYQcAn','948446ojtlUL','extend','appMenu.error.httpStatus','appMenu.error.authExpired','3bGeYqi','resources','isArray','appMenu.error.appCodeHint.option2','appMenu.success.fetched','error','appcode','appMenu.fetching.online','flat','label','success','5htNuwg','info','/smartapi/menu/find?appCode=','appMenu.error.fetchFailed','3365864mDdfQs','appMenu.info.emptyMenuList','appMenu.error.appCodeHint.option1','common.error','237528JtlOvI'];a15_0x41fb=function(){return _0x11a0b3;};return a15_0x41fb();}import a15_0x476f6a from'../i18n/index.js';const config=readConfig(),t=a15_0x476f6a['t'][a15_0x1c4f6b(0x15f)](a15_0x476f6a);export async function getOnlineMenuList(){const _0xb5fb4f=a15_0x1c4f6b,_0xaccff9=config?.[_0xb5fb4f(0x147)];if(!_0xaccff9){const _0x5ce172=t(_0xb5fb4f(0x163));return logger[_0xb5fb4f(0x146)]('get-online-menu-list',_0x5ce172),console[_0xb5fb4f(0x146)]('×\x20'+_0x5ce172),console[_0xb5fb4f(0x15e)](t('appMenu.error.appCodeHint.title')),console[_0xb5fb4f(0x15e)](t(_0xb5fb4f(0x152))),console[_0xb5fb4f(0x15e)](t(_0xb5fb4f(0x144))),[];}const _0xa31913=getEnv();logger[_0xb5fb4f(0x14d)]('get-online-menu-list',_0xa31913==='online'?t(_0xb5fb4f(0x148),{'appCode':_0xaccff9}):t('appMenu.fetching.daily',{'appCode':_0xaccff9}));const _0x1f2cc5=await fetch(getApiDomain()+_0xb5fb4f(0x14e)+_0xaccff9,{'method':'GET','headers':{'Content-Type':_0xb5fb4f(0x159),'Cookie':getCookie()}});if(!_0x1f2cc5['ok']){if(_0x1f2cc5[_0xb5fb4f(0x155)]===0x191){const _0x1966c5=t(_0xb5fb4f(0x168));logger[_0xb5fb4f(0x146)]('get-online-menu-list',_0x1966c5,{'status':_0x1f2cc5[_0xb5fb4f(0x155)]});throw new Error(_0x1966c5);}const _0x2807ad=t(_0xb5fb4f(0x167),{'status':_0x1f2cc5['status']});logger['error'](_0xb5fb4f(0x157),_0x2807ad);throw new Error(_0x2807ad);}const _0x31418c=await _0x1f2cc5[_0xb5fb4f(0x162)]();if(!_0x31418c[_0xb5fb4f(0x14b)]){const _0x3f0a87=t(_0xb5fb4f(0x14f),{'error':_0x31418c['errorMsg']||t(_0xb5fb4f(0x153))});logger[_0xb5fb4f(0x146)](_0xb5fb4f(0x157),_0x3f0a87,{'errorCode':_0x31418c[_0xb5fb4f(0x158)],'errorMsg':_0x31418c['errorMsg']});throw new Error(_0x3f0a87);}if(!_0x31418c[_0xb5fb4f(0x15d)])return logger[_0xb5fb4f(0x14d)](_0xb5fb4f(0x157),t(_0xb5fb4f(0x151))),[];return logger[_0xb5fb4f(0x14d)]('get-online-menu-list',t(_0xb5fb4f(0x145),{'count':_0x31418c[_0xb5fb4f(0x15d)][_0xb5fb4f(0x156)]})),_0x31418c[_0xb5fb4f(0x15d)]['map'](formatMenuList)[_0xb5fb4f(0x149)]();}function a15_0x4f2f(_0x34d7e9,_0x5de8df){_0x34d7e9=_0x34d7e9-0x143;const _0x41fbb2=a15_0x41fb();let _0x4f2f38=_0x41fbb2[_0x34d7e9];return _0x4f2f38;}function formatMenuList(_0x2743d2){const _0x131e11=a15_0x1c4f6b;let _0x258f8f=[];try{if(_0x2743d2[_0x131e11(0x166)]?.[_0x131e11(0x16a)]){const _0x537fea=JSON[_0x131e11(0x160)](_0x2743d2['extend']['resources']);Array[_0x131e11(0x143)](_0x537fea)&&(_0x258f8f=_0x537fea);}}catch(_0x234e3d){}const _0x438885=[{'id':_0x2743d2['id'],'path':_0x2743d2['path'],'label':_0x2743d2[_0x131e11(0x14a)],'resources':_0x258f8f}];if(_0x2743d2[_0x131e11(0x161)]&&_0x2743d2[_0x131e11(0x161)][_0x131e11(0x156)]>0x0)for(const _0x4b1acc of _0x2743d2[_0x131e11(0x161)]){_0x438885['push'](...formatMenuList(_0x4b1acc));}return _0x438885;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a17_0x3280(){const _0x36e819=['5178AMdzYN','3147525QiqkHB','775vePorG','7837432oejpRl','8796529kvMDxg','common.error','1985IhaiGc','9iNxaUU','17623020rVcWeG','bind','862iODyTd','finally','catch','appMenu.error.fetchFailed','771288FmzCUB'];a17_0x3280=function(){return _0x36e819;};return a17_0x3280();}function a17_0x44e9(_0x48faa2,_0xc15de){_0x48faa2=_0x48faa2-0x13a;const _0x328039=a17_0x3280();let _0x44e9e5=_0x328039[_0x48faa2];return _0x44e9e5;}const a17_0x2489c7=a17_0x44e9;(function(_0x358e55,_0x11c2ce){const _0xba0c87=a17_0x44e9,_0x59cb5f=_0x358e55();while(!![]){try{const _0x4fc31d=-parseInt(_0xba0c87(0x140))/0x1*(parseInt(_0xba0c87(0x144))/0x2)+-parseInt(_0xba0c87(0x141))/0x3*(-parseInt(_0xba0c87(0x148))/0x4)+-parseInt(_0xba0c87(0x13c))/0x5*(-parseInt(_0xba0c87(0x13a))/0x6)+parseInt(_0xba0c87(0x13e))/0x7+parseInt(_0xba0c87(0x13d))/0x8+parseInt(_0xba0c87(0x13b))/0x9+-parseInt(_0xba0c87(0x142))/0xa;if(_0x4fc31d===_0x11c2ce)break;else _0x59cb5f['push'](_0x59cb5f['shift']());}catch(_0x11f2e2){_0x59cb5f['push'](_0x59cb5f['shift']());}}}(a17_0x3280,0xa61fd));import{useEffect,useState}from'react';import{getOnlineMenuList}from'./get-online-menu-list.js';import a17_0x2cdeb1 from'../i18n/index.js';const t=a17_0x2cdeb1['t'][a17_0x2489c7(0x143)](a17_0x2cdeb1);export function useGetOnlineMenuList(){const [_0x184639,_0x2cada0]=useState([]),[_0x2ffe3a,_0xf2d284]=useState(!![]),[_0x313fdd,_0x4aab22]=useState('');return useEffect(()=>{const _0x41a31d=a17_0x44e9;_0xf2d284(!![]),_0x4aab22(''),getOnlineMenuList()['then'](_0x2cada0)[_0x41a31d(0x146)](_0x845afd=>{const _0x370ada=_0x41a31d;_0x4aab22(_0x845afd['message']||t(_0x370ada(0x147),{'error':t(_0x370ada(0x13f))}));})[_0x41a31d(0x145)](()=>_0xf2d284(![]));},[]),{'menuList':_0x184639,'loading':_0x2ffe3a,'error':_0x313fdd};}
|
package/lib/app-menu/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a18_0x40c4(_0x2bc094,_0x53537b){_0x2bc094=_0x2bc094-0x132;const _0x2e418c=a18_0x2e41();let _0x40c44d=_0x2e418c[_0x2bc094];return _0x40c44d;}(function(_0x3f8fdc,_0x228463){const _0x2fc8c9=a18_0x40c4,_0x25ca93=_0x3f8fdc();while(!![]){try{const _0x4e7275=parseInt(_0x2fc8c9(0x139))/0x1+-parseInt(_0x2fc8c9(0x135))/0x2*(parseInt(_0x2fc8c9(0x13e))/0x3)+-parseInt(_0x2fc8c9(0x13f))/0x4+parseInt(_0x2fc8c9(0x140))/0x5*(parseInt(_0x2fc8c9(0x133))/0x6)+parseInt(_0x2fc8c9(0x138))/0x7*(-parseInt(_0x2fc8c9(0x136))/0x8)+-parseInt(_0x2fc8c9(0x13b))/0x9*(-parseInt(_0x2fc8c9(0x13a))/0xa)+-parseInt(_0x2fc8c9(0x132))/0xb;if(_0x4e7275===_0x228463)break;else _0x25ca93['push'](_0x25ca93['shift']());}catch(_0x43af4d){_0x25ca93['push'](_0x25ca93['shift']());}}}(a18_0x2e41,0xbd3f2));export function getRemainingSpaces(_0x3d5620,_0x32529b){const _0x47c664=a18_0x40c4,_0x573b01=getStringWidth(_0x32529b);return Array(Math[_0x47c664(0x134)](0x0,_0x3d5620-_0x573b01))[_0x47c664(0x137)]('\x20')[_0x47c664(0x13d)]('');}function a18_0x2e41(){const _0x308d12=['repeat','join','3qoQwwm','399968Rheapq','11905NqfZZF','11362780ppBhsu','2358NQedJS','max','2443464aODxnd','8QeUhhU','fill','4785291cdWnBF','1406304lrJjVG','8620pibHWS','15363hSbVRz'];a18_0x2e41=function(){return _0x308d12;};return a18_0x2e41();}export function getMaxWidth(_0x5ada0d,_0x2734a7=0x2){const _0x3abc73=a18_0x40c4;let _0x126c36='',_0x4c02bc=0x0;for(const _0x3ac79e of _0x5ada0d){const _0x22f286=getStringWidth(_0x3ac79e);_0x22f286>_0x4c02bc&&(_0x4c02bc=_0x22f286,_0x126c36=_0x3ac79e);}return _0x126c36+'\x20'[_0x3abc73(0x13c)](_0x2734a7);}export function getStringWidth(_0x347903){let _0x3c53c4=0x0;for(const _0x16f226 of _0x347903){/[\u4e00-\u9fa5]/['test'](_0x16f226)?_0x3c53c4+=0x2:_0x3c53c4+=0x1;}return _0x3c53c4;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b2634,_0x443f37){const _0x318bd4=a19_0x47af,_0x29001d=_0x1b2634();while(!![]){try{const _0x10fd1c=parseInt(_0x318bd4(0x184))/0x1+parseInt(_0x318bd4(0x18c))/0x2+-parseInt(_0x318bd4(0x185))/0x3*(-parseInt(_0x318bd4(0x18d))/0x4)+-parseInt(_0x318bd4(0x187))/0x5+parseInt(_0x318bd4(0x189))/0x6*(parseInt(_0x318bd4(0x18e))/0x7)+-parseInt(_0x318bd4(0x18b))/0x8+-parseInt(_0x318bd4(0x188))/0x9*(parseInt(_0x318bd4(0x183))/0xa);if(_0x10fd1c===_0x443f37)break;else _0x29001d['push'](_0x29001d['shift']());}catch(_0x32f060){_0x29001d['push'](_0x29001d['shift']());}}}(a19_0x1884,0xe207e));function a19_0x1884(){const _0x30508b=['557625BmVImI','trim','6415480MNXUEk','12165327PsSrrb','49446UNjwNw','HEAD','113608sNsFhR','1122526Lahoer','20qSpTNx','1365vNLoVf','test','20gKRWAr','1828892AlghGz'];a19_0x1884=function(){return _0x30508b;};return a19_0x1884();}function a19_0x47af(_0x2ad8fa,_0x44c887){_0x2ad8fa=_0x2ad8fa-0x183;const _0x1884c1=a19_0x1884();let _0x47af4c=_0x1884c1[_0x2ad8fa];return _0x47af4c;}export function isValidJsHttpsUrl(_0x28d52c){const _0x3e661b=a19_0x47af;return/^https:\/\/.+\.js(\?.*)?$/['test'](_0x28d52c[_0x3e661b(0x186)]());}export function isValidCssHttpsUrl(_0x52ed0d){const _0x319b5f=a19_0x47af;return/^https:\/\/.+\.css(\?.*)?$/[_0x319b5f(0x18f)](_0x52ed0d['trim']());}export async function isUrlReachable(_0x468d23){const _0x58d35d=a19_0x47af;try{const _0x50161f=await fetch(_0x468d23,{'method':_0x58d35d(0x18a)});return _0x50161f['ok'];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3a31a9,_0x53f805){const _0x50a7ab=a20_0x4d1e,_0x246c91=_0x3a31a9();while(!![]){try{const _0x498b1d=parseInt(_0x50a7ab(0x194))/0x1+-parseInt(_0x50a7ab(0x190))/0x2*(parseInt(_0x50a7ab(0x18d))/0x3)+parseInt(_0x50a7ab(0x18c))/0x4+-parseInt(_0x50a7ab(0x193))/0x5+parseInt(_0x50a7ab(0x19b))/0x6*(-parseInt(_0x50a7ab(0x19d))/0x7)+parseInt(_0x50a7ab(0x196))/0x8+-parseInt(_0x50a7ab(0x18f))/0x9*(-parseInt(_0x50a7ab(0x192))/0xa);if(_0x498b1d===_0x53f805)break;else _0x246c91['push'](_0x246c91['shift']());}catch(_0x12afd9){_0x246c91['push'](_0x246c91['shift']());}}}(a20_0x41fe,0xd6569));function a20_0x41fe(){const _0xef153c=['10dwFJjU','7142975HJxgxT','1568648jTvgPe','filter','10310848uiHwGh','flat','appMenu.updateCdn.preview.resourceLinks','appMenu.updateCdn.preview.title','appMenu.updateCdn.preview.menuList','6MVwXDi','column','433461cvlIxK','map','join','cyan','label','1440140mDKdAP','3ipdIQQ','resources','7333191xGgOEI','3327782SOJCTg','from'];a20_0x41fe=function(){return _0xef153c;};return a20_0x41fe();}import{jsx as a20_0x39f140,jsxs as a20_0x44b4fd}from'react/jsx-runtime';import{Text,Box}from'ink';import{useI18n}from'../i18n/hooks.js';function a20_0x4d1e(_0x2217c0,_0x1af060){_0x2217c0=_0x2217c0-0x18a;const _0x41fef5=a20_0x41fe();let _0x4d1e3a=_0x41fef5[_0x2217c0];return _0x4d1e3a;}export function CurrentMenuCdnContent(_0x28c7ec){const _0x5d9158=a20_0x4d1e,{t:_0x27315e}=useI18n(),{menuList:_0x2e4390}=_0x28c7ec,_0x3ece03=_0x2e4390[_0x5d9158(0x195)](_0x40ea37=>_0x40ea37[_0x5d9158(0x18e)]['length']),_0x5b99e4=Array[_0x5d9158(0x191)](new Set(_0x2e4390[_0x5d9158(0x19e)](_0x3500ad=>_0x3500ad[_0x5d9158(0x18e)])[_0x5d9158(0x197)]()));return a20_0x44b4fd(Box,{'flexDirection':_0x5d9158(0x19c),'children':[a20_0x39f140(Text,{'color':_0x5d9158(0x18a),'children':_0x27315e(_0x5d9158(0x199))}),a20_0x44b4fd(Box,{'marginTop':0x1,'flexDirection':_0x5d9158(0x19c),'children':[a20_0x44b4fd(Text,{'bold':!![],'children':['\x20\x20',_0x27315e(_0x5d9158(0x19a))]}),a20_0x44b4fd(Text,{'children':['\x20\x20',_0x3ece03[_0x5d9158(0x19e)](_0x4d823b=>_0x4d823b[_0x5d9158(0x18b)])[_0x5d9158(0x19f)](',\x20')]})]}),a20_0x39f140(Box,{'marginTop':0x1,'children':a20_0x44b4fd(Text,{'bold':!![],'children':['\x20\x20',_0x27315e(_0x5d9158(0x198))]})}),_0x5b99e4[_0x5d9158(0x19e)](_0x54229a=>a20_0x39f140(Box,{'children':a20_0x44b4fd(Text,{'children':['\x20\x20',_0x54229a]})},_0x54229a))]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25fbef,_0xd8234f){const _0x4b3ea5=a21_0x2646,_0x432604=_0x25fbef();while(!![]){try{const _0x333bc5=-parseInt(_0x4b3ea5(0xed))/0x1*(parseInt(_0x4b3ea5(0xe6))/0x2)+-parseInt(_0x4b3ea5(0xec))/0x3+parseInt(_0x4b3ea5(0xe8))/0x4*(parseInt(_0x4b3ea5(0xee))/0x5)+-parseInt(_0x4b3ea5(0xf1))/0x6*(-parseInt(_0x4b3ea5(0xe9))/0x7)+-parseInt(_0x4b3ea5(0xea))/0x8*(parseInt(_0x4b3ea5(0xf2))/0x9)+-parseInt(_0x4b3ea5(0xf6))/0xa+parseInt(_0x4b3ea5(0xf3))/0xb;if(_0x333bc5===_0xd8234f)break;else _0x432604['push'](_0x432604['shift']());}catch(_0x574e66){_0x432604['push'](_0x432604['shift']());}}}(a21_0x4f1f,0xe7e7c));import{jsx as a21_0x12aaf9,jsxs as a21_0x1fc205}from'react/jsx-runtime';import{Text,Box}from'ink';function a21_0x4f1f(){const _0x175e86=['green','48qMqcDW','72iIyEXS','11483978mEtYcS','appMenu.updateCdn.input.jsUrl.label','cyan','10503550CFstsL','2ZmASSz','appMenu.updateCdn.input.title','320iWvygr','705278gsXaAq','496680SlGrnB','column','2407008HslDEq','287015ivwTaf','108515yFUbUC','appMenu.updateCdn.input.cssUrl.label'];a21_0x4f1f=function(){return _0x175e86;};return a21_0x4f1f();}import{useI18n}from'../i18n/hooks.js';function a21_0x2646(_0x24ffb8,_0x5cfc97){_0x24ffb8=_0x24ffb8-0xe6;const _0x4f1ffc=a21_0x4f1f();let _0x2646c2=_0x4f1ffc[_0x24ffb8];return _0x2646c2;}export function InputCdnAsset(_0x4c1950){const _0x43fca1=a21_0x2646,{t:_0x40f938}=useI18n(),{jsCdnUrl:_0xdc2fd2,cssCdnUrl:_0xc7a27}=_0x4c1950;return a21_0x1fc205(Box,{'flexDirection':_0x43fca1(0xeb),'marginTop':0x1,'children':[a21_0x12aaf9(Text,{'color':_0x43fca1(0xf5),'children':_0x40f938(_0x43fca1(0xe7))}),a21_0x1fc205(Box,{'children':[a21_0x1fc205(Text,{'children':['\x20\x20',_0x40f938(_0x43fca1(0xf4))]}),a21_0x12aaf9(Text,{'color':'green','children':_0xdc2fd2})]}),a21_0x1fc205(Box,{'children':[a21_0x1fc205(Text,{'children':['\x20\x20',_0x40f938(_0x43fca1(0xef))]}),a21_0x12aaf9(Text,{'color':_0x43fca1(0xf0),'children':_0xc7a27})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15aed0,_0x4bf94f){const _0x5e132c=a22_0x4da4,_0x55d08b=_0x15aed0();while(!![]){try{const _0xf09053=-parseInt(_0x5e132c(0x17c))/0x1+-parseInt(_0x5e132c(0x161))/0x2+-parseInt(_0x5e132c(0x164))/0x3*(parseInt(_0x5e132c(0x17f))/0x4)+parseInt(_0x5e132c(0x169))/0x5*(-parseInt(_0x5e132c(0x172))/0x6)+parseInt(_0x5e132c(0x186))/0x7+parseInt(_0x5e132c(0x182))/0x8+parseInt(_0x5e132c(0x18c))/0x9*(parseInt(_0x5e132c(0x194))/0xa);if(_0xf09053===_0x4bf94f)break;else _0x55d08b['push'](_0x55d08b['shift']());}catch(_0x4adb8a){_0x55d08b['push'](_0x55d08b['shift']());}}}(a22_0x5395,0x696c1));import{jsx as a22_0x2ad07b,jsxs as a22_0x33015f,Fragment as a22_0x13cdef}from'react/jsx-runtime';function a22_0x4da4(_0x51a7c7,_0x1e929f){_0x51a7c7=_0x51a7c7-0x160;const _0x5395ab=a22_0x5395();let _0x4da495=_0x5395ab[_0x51a7c7];return _0x4da495;}import{Text,Box,useInput,useApp,render}from'ink';import{useEffect,useState}from'react';function a22_0x5395(){const _0x566817=['resolve','label','58782hxaXVy','updated','appMenu.updateCdn.input.cssUrl.placeholder','path','delete','upArrow','return','resources','yellow','length','176589WivavB','value','appMenu.updateCdn.input.jsUrl.label','4ELDLjJ','appMenu.updateCdn.error.cssUrlUnreachable','all','2083720PEtLeb','slice','map','appMenu.updateCdn.error.jsUrlUnreachable','3134530SutPok','appMenu.updateCdn.error.noCdnLinks','appMenu.updateCdn.error.invalidCssUrl','appMenu.updateCdn.input.jsUrl.placeholder','cyan','dots','18MJPAcc','backspace','creating','need-confirm','\x20←\x20','flat','trim','appMenu.updateCdn.loading.syncing','2229540OAGuUl','appMenu.updateCdn.input.cssUrl.label','cancel','appMenu.updateCdn.error.authHint.prefix','input-js','column','72702EXdPpd','appMenu.updateCdn.error.authHint.suffix','red','1204941JdwdQM','appMenu.updateCdn.error.invalidJsUrl','green','appMenu.updateCdn.action.cancel','leftArrow','55vRAXqD','appMenu.updateCdn.action.continue','lovrabet\x20auth','gray','input-css','appMenu.updateCdn.title','from'];a22_0x5395=function(){return _0x566817;};return a22_0x5395();}import a22_0x57cc38 from'ink-spinner';import{useGetOnlineMenuList}from'../app-menu/use-get-online-menu-list.js';import{isUrlReachable,isValidCssHttpsUrl,isValidJsHttpsUrl}from'../app-menu/valid-url.js';import{CurrentMenuCdnContent}from'./current-content.js';import{InputCdnAsset}from'./input-cdn-asset.js';import{updateMenuCdnUrl}from'./update-menu-cdn-url.js';import{useI18n}from'../i18n/hooks.js';import.meta.main&&render(a22_0x2ad07b(AppMenuUpdateCdn,{}));export function AppMenuUpdateCdn(){const _0x4ce010=a22_0x4da4,{exit:_0xdfb13}=useApp(),{t:_0x3d8e42}=useI18n(),{loading:_0x1ffd6d,menuList:_0x33076a,error:_0x23ac61}=useGetOnlineMenuList(),[_0x2905d4,_0x848265]=useState('ok'),[_0x4b7fe6,_0x1440c9]=useState(_0x4ce010(0x198)),[_0x4e47af,_0x18777e]=useState(''),[_0x1964e3,_0x59123f]=useState(''),[_0x2aa51f,_0x484be2]=useState(''),[_0x186af0,_0x26c8ae]=useState(''),_0x41b19b=Array[_0x4ce010(0x16f)](new Set(_0x33076a['map'](_0x2aa558=>_0x2aa558['resources'])[_0x4ce010(0x191)]()));useEffect(()=>{const _0x1aa191=_0x4ce010;_0x4b7fe6===_0x1aa191(0x173)&&setTimeout(_0xdfb13,0x32);},[_0x4b7fe6]),useInput(async(_0x2dfb14,_0xf0300)=>{const _0x3cd72d=_0x4ce010;if(_0x4b7fe6===_0x3cd72d(0x198)){if(_0xf0300['return']){const _0x1f2b9a=_0x2aa51f[_0x3cd72d(0x192)]();if(_0x1f2b9a==='')return;if(!isValidJsHttpsUrl(_0x1f2b9a)){_0x26c8ae(_0x3d8e42(_0x3cd72d(0x165)));return;}if(!await isUrlReachable(_0x1f2b9a)){_0x26c8ae(_0x3d8e42(_0x3cd72d(0x185)));return;}_0x18777e(_0x1f2b9a),_0x484be2(''),_0x26c8ae(''),_0x1440c9(_0x3cd72d(0x16d));return;}if(_0xf0300[_0x3cd72d(0x18d)]||_0xf0300[_0x3cd72d(0x176)]){_0x484be2(_0x414711=>_0x414711[_0x3cd72d(0x183)](0x0,-0x1)),_0x26c8ae('');return;}_0x484be2(_0x5c025f=>_0x5c025f+_0x2dfb14);return;}if(_0x4b7fe6===_0x3cd72d(0x16d)){if(_0xf0300[_0x3cd72d(0x178)]){const _0x2f12f6=_0x2aa51f[_0x3cd72d(0x192)]();if(_0x2f12f6==='')return;if(!isValidCssHttpsUrl(_0x2f12f6)){_0x26c8ae(_0x3d8e42(_0x3cd72d(0x188)));return;}if(!await isUrlReachable(_0x2f12f6)){_0x26c8ae(_0x3d8e42(_0x3cd72d(0x180)));return;}_0x59123f(_0x2f12f6),_0x484be2(''),_0x26c8ae(''),_0x1440c9(_0x3cd72d(0x18f));return;}if(_0xf0300[_0x3cd72d(0x18d)]||_0xf0300[_0x3cd72d(0x176)]){_0x484be2(_0x2015f9=>_0x2015f9[_0x3cd72d(0x183)](0x0,-0x1)),_0x26c8ae('');return;}_0x484be2(_0x29e5eb=>_0x29e5eb+_0x2dfb14);return;}if(_0x4b7fe6===_0x3cd72d(0x18f)){(_0xf0300[_0x3cd72d(0x177)]||_0xf0300['downArrow']||_0xf0300[_0x3cd72d(0x168)]||_0xf0300['rightArrow'])&&_0x848265(_0xb40ca5=>_0xb40ca5==='ok'?_0x3cd72d(0x196):'ok');if(_0xf0300[_0x3cd72d(0x178)]){_0x1440c9('creating');if(_0x2905d4==='ok')await Promise[_0x3cd72d(0x181)](_0x33076a['map'](_0x68d171=>{const _0x37af6a=_0x3cd72d,_0x307176={'id':_0x68d171['id'],'label':_0x68d171[_0x37af6a(0x171)],'path':_0x68d171[_0x37af6a(0x175)],'resources':[_0x4e47af,_0x1964e3]};if(_0x68d171[_0x37af6a(0x179)][_0x37af6a(0x17b)]===0x0)return Promise[_0x37af6a(0x170)]();return updateMenuCdnUrl(_0x307176);})),await new Promise(_0x4def3b=>setTimeout(_0x4def3b,0x3e8)),_0x1440c9('updated');else _0x2905d4===_0x3cd72d(0x196)&&_0xdfb13();}}});if(_0x1ffd6d)return a22_0x33015f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x2ad07b(Text,{}),a22_0x2ad07b(a22_0x57cc38,{'type':_0x4ce010(0x18b)}),a22_0x2ad07b(Text,{'children':_0x3d8e42('appMenu.updateCdn.loading.fetching')})]});if(_0x23ac61)return a22_0x33015f(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a22_0x33015f(Text,{'color':_0x4ce010(0x163),'children':['✗\x20',_0x23ac61]}),a22_0x33015f(Box,{'marginTop':0x1,'children':[a22_0x2ad07b(Text,{'color':_0x4ce010(0x16c),'children':_0x3d8e42(_0x4ce010(0x197))}),a22_0x2ad07b(Text,{'color':_0x4ce010(0x18a),'children':_0x4ce010(0x16b)}),a22_0x2ad07b(Text,{'color':_0x4ce010(0x16c),'children':_0x3d8e42(_0x4ce010(0x162))})]})]});if(_0x41b19b[_0x4ce010(0x17b)]===0x0)return a22_0x2ad07b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a22_0x2ad07b(Text,{'color':_0x4ce010(0x17a),'children':_0x3d8e42(_0x4ce010(0x187))})});if(_0x4b7fe6===_0x4ce010(0x18f))return a22_0x33015f(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a22_0x2ad07b(CurrentMenuCdnContent,{'menuList':_0x33076a}),a22_0x2ad07b(InputCdnAsset,{'jsCdnUrl':_0x4e47af,'cssCdnUrl':_0x1964e3}),a22_0x2ad07b(Box,{'marginTop':0x1,'flexDirection':_0x4ce010(0x160),'children':[{'label':_0x3d8e42(_0x4ce010(0x16a)),'value':'ok'},{'label':_0x3d8e42(_0x4ce010(0x167)),'value':_0x4ce010(0x196)}][_0x4ce010(0x184)](_0x41aea8=>a22_0x33015f(Text,{'color':_0x2905d4===_0x41aea8[_0x4ce010(0x17d)]?_0x4ce010(0x17a):undefined,'children':[_0x2905d4===_0x41aea8['value']?'>\x20':'\x20\x20',_0x41aea8['label']]},_0x41aea8[_0x4ce010(0x17d)]))})]});if(_0x4b7fe6===_0x4ce010(0x18e))return a22_0x33015f(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a22_0x2ad07b(CurrentMenuCdnContent,{'menuList':_0x33076a}),a22_0x2ad07b(InputCdnAsset,{'jsCdnUrl':_0x4e47af,'cssCdnUrl':_0x1964e3}),a22_0x33015f(Box,{'marginTop':0x1,'children':[a22_0x2ad07b(a22_0x57cc38,{'type':_0x4ce010(0x18b)}),a22_0x2ad07b(Text,{'children':_0x3d8e42(_0x4ce010(0x193))})]})]});if(_0x4b7fe6===_0x4ce010(0x173))return a22_0x33015f(Box,{'flexDirection':_0x4ce010(0x160),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x2ad07b(CurrentMenuCdnContent,{'menuList':_0x33076a}),a22_0x2ad07b(InputCdnAsset,{'jsCdnUrl':_0x4e47af,'cssCdnUrl':_0x1964e3}),a22_0x2ad07b(Box,{'marginTop':0x1,'children':a22_0x2ad07b(Text,{'color':_0x4ce010(0x166),'children':_0x3d8e42('appMenu.updateCdn.success.updated')})})]});return a22_0x33015f(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a22_0x2ad07b(CurrentMenuCdnContent,{'menuList':_0x33076a}),a22_0x33015f(Box,{'marginTop':0x1,'flexDirection':_0x4ce010(0x160),'children':[a22_0x2ad07b(Text,{'color':_0x4ce010(0x18a),'children':_0x3d8e42(_0x4ce010(0x16e))}),_0x4e47af?a22_0x33015f(Box,{'children':[a22_0x33015f(Text,{'color':'gray','children':['\x20\x20',_0x3d8e42('appMenu.updateCdn.input.jsUrl.label')]}),a22_0x2ad07b(Text,{'color':_0x4ce010(0x166),'children':_0x4e47af})]}):_0x4b7fe6===_0x4ce010(0x198)&&a22_0x33015f(a22_0x13cdef,{'children':[a22_0x33015f(Box,{'children':[a22_0x33015f(Text,{'children':['\x20\x20',_0x3d8e42(_0x4ce010(0x17e))]}),a22_0x2ad07b(Text,{'color':_0x4ce010(0x166),'children':_0x2aa51f}),_0x186af0&&a22_0x33015f(Text,{'color':'red','children':[_0x4ce010(0x190),_0x186af0]})]}),!_0x186af0&&a22_0x2ad07b(Box,{'children':a22_0x33015f(Text,{'color':_0x4ce010(0x16c),'children':['\x20\x20',_0x3d8e42(_0x4ce010(0x189))]})})]}),_0x1964e3?a22_0x33015f(Box,{'children':[a22_0x33015f(Text,{'children':['\x20\x20',_0x3d8e42(_0x4ce010(0x195))]}),a22_0x2ad07b(Text,{'color':_0x4ce010(0x166),'children':_0x1964e3})]}):_0x4b7fe6===_0x4ce010(0x16d)&&a22_0x33015f(a22_0x13cdef,{'children':[a22_0x33015f(Box,{'children':[a22_0x33015f(Text,{'children':['\x20\x20',_0x3d8e42(_0x4ce010(0x195))]}),a22_0x2ad07b(Text,{'color':_0x4ce010(0x166),'children':_0x2aa51f}),_0x186af0&&a22_0x33015f(Text,{'color':'red','children':[_0x4ce010(0x190),_0x186af0]})]}),!_0x186af0&&a22_0x2ad07b(Box,{'children':a22_0x33015f(Text,{'color':'gray','children':['\x20\x20',_0x3d8e42(_0x4ce010(0x174))]})})]})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x27a0a5,_0x30273c){const _0x59ca60=a24_0x35f1,_0x327596=_0x27a0a5();while(!![]){try{const _0x3ba6da=-parseInt(_0x59ca60(0x1a5))/0x1+parseInt(_0x59ca60(0x1a0))/0x2+-parseInt(_0x59ca60(0x1a6))/0x3+-parseInt(_0x59ca60(0x199))/0x4+-parseInt(_0x59ca60(0x1b5))/0x5*(parseInt(_0x59ca60(0x1ae))/0x6)+parseInt(_0x59ca60(0x1ac))/0x7*(-parseInt(_0x59ca60(0x1ab))/0x8)+-parseInt(_0x59ca60(0x1a7))/0x9*(-parseInt(_0x59ca60(0x1a4))/0xa);if(_0x3ba6da===_0x30273c)break;else _0x327596['push'](_0x327596['shift']());}catch(_0x583d40){_0x327596['push'](_0x327596['shift']());}}}(a24_0x11b4,0x1c65f));function a24_0x11b4(){const _0x3467e5=['54490Brflpe','status','appMenu.error.appCodeHint.option2','stringify','resources','success','530376VSZbiI','common.error','error','appMenu.error.appCodeHint.option1','appcode','/smartapi/menu/update','import','278084kGzOzV','appMenu.error.appCodeHint.title','appMenu.updateCdn.success.synced','appMenu.updateCdn.updating','20bpzQIn','32120fyjBFV','516396xqrmsc','1828206ixdIrX','info','json','application/json','7928OPgVfT','189AJPtCp','POST','36WOkwwM','appMenu.error.authExpired','appMenu.updateCdn.error.updateFailed','errorMsg','label','log','data'];a24_0x11b4=function(){return _0x3467e5;};return a24_0x11b4();}import{getCookie}from'../auth/get-cookie.js';import{getApiDomain}from'../constant/domain.js';import{readConfig}from'../utils/config.js';function a24_0x35f1(_0x4f9daf,_0x40568b){_0x4f9daf=_0x4f9daf-0x195;const _0x11b42b=a24_0x11b4();let _0x35f1d3=_0x11b42b[_0x4f9daf];return _0x35f1d3;}import{logger}from'../utils/logger.js';import a24_0x4b817d from'../i18n/index.js';const config=readConfig(),logLabel='update-menu-cdn-url',t=a24_0x4b817d['t']['bind'](a24_0x4b817d);import.meta.main&&updateMenuCdnUrl({'id':0xf41e,'label':'SdkDemo1','path':'sdk-demo','resources':['https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.js','https://g.yuntooai.com/dist/yt-test-app/1.0.1/assets/main.css']});export async function updateMenuCdnUrl(_0x4aff1a){const _0x335f5c=a24_0x35f1,_0x2e0b4a=config?.[_0x335f5c(0x19d)];if(!_0x2e0b4a){const _0x7128c=t('appMenu.error.missingAppCode');logger['error'](logLabel,_0x7128c),console[_0x335f5c(0x19b)]('×\x20'+_0x7128c),console[_0x335f5c(0x1b3)](t(_0x335f5c(0x1a1))),console[_0x335f5c(0x1b3)](t(_0x335f5c(0x19c))),console[_0x335f5c(0x1b3)](t(_0x335f5c(0x195)));return;}logger[_0x335f5c(0x1a8)](logLabel,t(_0x335f5c(0x1a3),{'label':_0x4aff1a['label'],'path':_0x4aff1a['path']}));const _0x3f3e89={'id':_0x4aff1a['id'],'appCode':_0x2e0b4a,'extend':{'loadScriptMode':_0x335f5c(0x19f),'resources':_0x4aff1a[_0x335f5c(0x197)]?JSON['stringify'](_0x4aff1a['resources']):undefined}},_0x2f6401=await fetch(getApiDomain()+_0x335f5c(0x19e),{'method':_0x335f5c(0x1ad),'body':JSON[_0x335f5c(0x196)](_0x3f3e89),'headers':{'Content-Type':_0x335f5c(0x1aa),'Cookie':getCookie()}});if(!_0x2f6401['ok']){if(_0x2f6401[_0x335f5c(0x1b6)]===0x191){const _0x3566e5=t(_0x335f5c(0x1af));logger[_0x335f5c(0x19b)](logLabel,_0x3566e5,{'status':_0x2f6401[_0x335f5c(0x1b6)],'menu':_0x4aff1a[_0x335f5c(0x1b2)]});throw new Error(_0x3566e5);}const _0x297fb2=t('appMenu.updateCdn.error.updateFailed',{'error':_0x2f6401[_0x335f5c(0x1b6)]});logger[_0x335f5c(0x19b)](logLabel,_0x297fb2,{'menu':_0x4aff1a[_0x335f5c(0x1b2)]});throw new Error(_0x297fb2);}const _0x34cf05=await _0x2f6401[_0x335f5c(0x1a9)]();if(!_0x34cf05[_0x335f5c(0x198)]){const _0x2acc30=t(_0x335f5c(0x1b0),{'error':_0x34cf05[_0x335f5c(0x1b1)]||t(_0x335f5c(0x19a))});logger[_0x335f5c(0x19b)](logLabel,_0x2acc30,{'errorCode':_0x34cf05['errorCode'],'errorMsg':_0x34cf05['errorMsg'],'menu':_0x4aff1a[_0x335f5c(0x1b2)]});throw new Error(_0x2acc30);}logger[_0x335f5c(0x1a8)](logLabel,t(_0x335f5c(0x1a2),{'label':_0x4aff1a[_0x335f5c(0x1b2)]}),_0x34cf05[_0x335f5c(0x1b4)]);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a834b,_0x493934){const _0x502a2d=a25_0x88a4,_0x488a94=_0x3a834b();while(!![]){try{const _0x155129=parseInt(_0x502a2d(0x192))/0x1+parseInt(_0x502a2d(0x19a))/0x2*(-parseInt(_0x502a2d(0x18c))/0x3)+-parseInt(_0x502a2d(0x194))/0x4+-parseInt(_0x502a2d(0x19e))/0x5*(-parseInt(_0x502a2d(0x19b))/0x6)+parseInt(_0x502a2d(0x191))/0x7*(-parseInt(_0x502a2d(0x199))/0x8)+parseInt(_0x502a2d(0x196))/0x9+-parseInt(_0x502a2d(0x195))/0xa;if(_0x155129===_0x493934)break;else _0x488a94['push'](_0x488a94['shift']());}catch(_0x1fa408){_0x488a94['push'](_0x488a94['shift']());}}}(a25_0x4cb5,0xb6229));import{jsx as a25_0x46cf2a,jsxs as a25_0x749f3b}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 a25_0x43a0c8 from'ink-spinner';import{useI18n}from'../i18n/hooks.js';function a25_0x4cb5(){const _0x556270=['finally','auth.login.successCli','green','1641fZcSsH','gray','column','auth.login.inProgress','return','329xODqAi','1446399HebQtF','auth.session.valid','1490096eFQHVc','2285460jqkQCI','8857197AVsesJ','auth.login.browserPrompt','dots','178224hXMqpz','426GKihjJ','60zihsPt','auth.login.pressQToExit','log','40070RZUYNf'];a25_0x4cb5=function(){return _0x556270;};return a25_0x4cb5();}function a25_0x88a4(_0x484a81,_0x180f88){_0x484a81=_0x484a81-0x18a;const _0x4cb523=a25_0x4cb5();let _0x88a4b2=_0x4cb523[_0x484a81];return _0x88a4b2;}export function AuthServer(){const _0x154e0d=a25_0x88a4,{exit:_0x4f024f}=useApp(),{t:_0x2e72d2}=useI18n(),[_0x43b216,_0x58f368]=useState(![]),[_0xae43a9,_0x2c3500]=useState(!![]),[_0x1e30e2,_0x16bba7]=useState(![]),[_0xa87c13,_0x35edb0]=useState(![]);useEffect(()=>{const _0x8ec938=a25_0x88a4;getIsSessionValid()['then'](_0x58f368)[_0x8ec938(0x19f)](()=>_0x2c3500(![]));},[]),useEffect(()=>{const _0x1fbfcf=a25_0x88a4;!_0xae43a9&&_0x43b216&&(console[_0x1fbfcf(0x19d)](_0x2e72d2(_0x1fbfcf(0x193))),_0x4f024f());},[_0xae43a9,_0x43b216,_0x4f024f]),useEffect(()=>{const _0x2e5812=a25_0x88a4;_0xa87c13&&(console[_0x2e5812(0x19d)]('*\x20'+_0x2e72d2(_0x2e5812(0x18a))),_0x4f024f());},[_0xa87c13,_0x4f024f]),useInput((_0x54d66c,_0x456cd)=>{const _0x58c6ca=a25_0x88a4;_0x456cd[_0x58c6ca(0x190)]&&(_0x16bba7(!![]),authServer({'silent':!![]})['then'](_0x5c843c=>{_0x35edb0(_0x5c843c);})),_0x54d66c==='q'&&_0x4f024f();});if(_0xae43a9)return null;if(_0x43b216||_0xa87c13)return null;return a25_0x46cf2a(Box,{'flexDirection':_0x154e0d(0x18e),'marginTop':0x1,'marginBottom':0x1,'children':_0x1e30e2?a25_0x749f3b(Box,{'children':[a25_0x46cf2a(Box,{'width':'1'}),a25_0x749f3b(Text,{'color':_0x154e0d(0x18b),'children':[a25_0x46cf2a(a25_0x43a0c8,{'type':_0x154e0d(0x198)}),'\x20\x20']}),a25_0x749f3b(Text,{'children':[_0x2e72d2(_0x154e0d(0x18f)),'\x20']}),a25_0x46cf2a(Text,{'color':_0x154e0d(0x18d),'children':_0x2e72d2(_0x154e0d(0x197))})]}):a25_0x749f3b(Box,{'children':[a25_0x46cf2a(Box,{'width':'1'}),a25_0x46cf2a(Text,{'children':_0x2e72d2('auth.login.pressEnter')}),a25_0x46cf2a(Text,{'color':_0x154e0d(0x18d),'children':_0x2e72d2(_0x154e0d(0x19c))})]})});}
|