@fudanda/admin-antd 1.20261015.1-beta.1 → 2.20261024.1-beta.1
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/LICENSE +21 -21
- package/README.md +58 -42
- package/THIRD_PARTY_NOTICES.md +55 -55
- package/dist/automation.js +3 -3
- package/dist/chunks/App-DNjXLysb.js +79 -0
- package/dist/chunks/{AppModal-B_xvSaeq.js → AppModal-DJzQA6FR.js} +1 -1
- package/dist/chunks/ArcBaseAdmin-BZrHGq2f.js +1 -0
- package/dist/chunks/ConfigurableTable-DzmZDd8F.js +55 -0
- package/dist/chunks/{DashboardPage-BTLufKzi.js → DashboardPage-BohGodSl.js} +1 -1
- package/dist/chunks/DataScopePanel-B2-x8Jcz.js +1 -0
- package/dist/chunks/{DateTimeText-rk9NeYgA.js → DateTimeText-CIt0Qy45.js} +1 -1
- package/dist/chunks/DepartmentsPage-DMWY__Y_.js +1 -0
- package/dist/chunks/DictTag-2-adKbYg.js +1 -0
- package/dist/chunks/DictsPage-DILDyHi-.js +15 -0
- package/dist/chunks/EditFormModal-DNHOZHxM.js +1 -0
- package/dist/chunks/EntityContextRuntime-DMklAv-k.js +1 -0
- package/dist/chunks/{EntityContextRuntime-BrAz-aCV.js → EntityContextRuntime-sslBZqYD.js} +1 -1
- package/dist/chunks/{EntityRelationButton-C8Cl8wyh.js → EntityRelationButton-DWn1rC2J.js} +2 -2
- package/dist/chunks/{ExportButton-D4IvZKHy.js → ExportButton-AzH4D0oW.js} +1 -1
- package/dist/chunks/FileNameCell-DPyi64Rv.js +1 -0
- package/dist/chunks/FileStorageConfigsPage-CzuOgeK0.js +15 -0
- package/dist/chunks/FileTypeIcon-DIih3XQG.js +1 -0
- package/dist/chunks/{FileViewerPreviewPanel-wbXzgqxc.js → FileViewerPreviewPanel-CMqVtGCr.js} +2 -2
- package/dist/chunks/FilesPage-BaEBCOCs.js +43 -0
- package/dist/chunks/IdentitySecurityPage-BO7nY8id.js +1 -0
- package/dist/chunks/{JsonPreviewPanel-D8YpZD1A.js → JsonPreviewPanel-Dhbza-Uu.js} +1 -1
- package/dist/chunks/LogStatsScaffold-CLycj3da.js +1 -0
- package/dist/chunks/LoginLogsPage-DTmHi8u0.js +1 -0
- package/dist/chunks/LoginLogsTable-DVmHnC6V.js +1 -0
- package/dist/chunks/{MasterDetailLayout-DDVFodpX.js → MasterDetailLayout-sjPWw8BI.js} +2 -2
- package/dist/chunks/{MemberAssignmentSheet-NWm5vThg.js → MemberAssignmentSheet-Czbt6_zv.js} +1 -1
- package/dist/chunks/MenuCommandPalette-BCOzf-Kq.js +8 -0
- package/dist/chunks/MenusPage-DN8DTGB1.js +1 -0
- package/dist/chunks/{ModalFooter-vXDpmYTM.js → ModalFooter-RMlvqrO9.js} +1 -1
- package/dist/chunks/NavListPanel-vjIOIqK0.js +1 -0
- package/dist/chunks/OnlineSessionsPage-FoHYZKlR.js +1 -0
- package/dist/chunks/OperationLogsPage-BeRnGcBJ.js +1 -0
- package/dist/chunks/OperationLogsTable-COI-Lp-y.js +1 -0
- package/dist/chunks/PDFPreviewPanel-BIQuBnZZ.js +37 -0
- package/dist/chunks/PasswordInput-DGEJO9yx.js +1 -0
- package/dist/chunks/PositionsPage-DohI0luX.js +1 -0
- package/dist/chunks/PreferencesSheetBody-B9niQABW.js +43 -0
- package/dist/chunks/ProfilePage-CVTRv7xb.js +15 -0
- package/dist/chunks/RelationPanel-B1X6AVaM.js +36 -0
- package/dist/chunks/RolesPage-CtUw93L8.js +1 -0
- package/dist/chunks/{SearchToolbar-BAh56OAa.js → SearchToolbar-CvgYKUjr.js} +1 -1
- package/dist/chunks/{SessionClientTag-DafwXf-o.js → SessionClientTag-DIwnYodW.js} +2 -2
- package/dist/chunks/SessionConflictModal-BLNuDsN_.js +1 -0
- package/dist/chunks/SettingRow-DVNmTJWC.js +1 -0
- package/dist/chunks/SettingsPage-BRnCxYQm.js +26 -0
- package/dist/chunks/StatCard-Czjfs0fa.js +4 -0
- package/dist/chunks/{UserDisplay-BYhcfa84.js → UserDisplay-J0Re8z-7.js} +1 -1
- package/dist/chunks/UserGroupsPage-CNwbejx-.js +1 -0
- package/dist/chunks/{UserLogsPanels-3ZlKQsCu.js → UserLogsPanels-BHeSxWrk.js} +2 -2
- package/dist/chunks/UserTransferSelect-CAeyxdor.js +22 -0
- package/dist/chunks/UsersPage-BXt9fOru.js +36 -0
- package/dist/chunks/{archive-D0BSMQmn.js → archive-B_IKvysI.js} +4 -4
- package/dist/chunks/chart-data-DImT_Mzn.js +5 -0
- package/dist/chunks/{chart-renderer-BWLqOvLF.js → chart-renderer-k-Rd8vdL.js} +1 -1
- package/dist/chunks/{user-cC0uCe3d.js → chevron-right-EBApfX6q.js} +2 -2
- package/dist/chunks/{clipboard-BKPNFY58.js → clipboard-ERcMSMRH.js} +1 -1
- package/dist/chunks/{confirm-CC2F8XXe.js → confirm-BtBBEqk8.js} +1 -1
- package/dist/chunks/{data-DPCozzrG.js → data-B05HzECj.js} +1 -1
- package/dist/chunks/{deleteAction-NGTDhZud.js → deleteAction-CCocr5uV.js} +1 -1
- package/dist/chunks/{diagram-vBbcsoK2.js → diagram-D9cwc7QH.js} +3 -3
- package/dist/chunks/dist-Bauqz5on.js +1 -0
- package/dist/chunks/{drawing-CUAfa3D5.js → drawing-D2Qrun-P.js} +2 -2
- package/dist/chunks/{email-U025DuXM.js → email-ByshRsFv.js} +2 -2
- package/dist/chunks/{export-CCaKk9VN.js → export-DlTz5dc2.js} +5 -5
- package/dist/chunks/{eye-DNBTmA6c.js → eye-off-BtJoIT5n.js} +1 -8
- package/dist/chunks/feedback-BnjMKZpz.js +1 -0
- package/dist/chunks/file-utils-DyvnVEoH.js +1 -0
- package/dist/chunks/fit-CsnhEncA.js +1 -0
- package/dist/chunks/{form-DhQiOMvp.js → form-CQutQFiD.js} +1 -1
- package/dist/chunks/geo-DR0fL7r2.js +38 -0
- package/dist/chunks/{image-C52XMTxg.js → image-ez9hvzKT.js} +1 -1
- package/dist/chunks/{lib-DZsU27Fn.js → lib-BlRm3nk1.js} +4 -4
- package/dist/chunks/line-BV7qVRkM.js +1 -0
- package/dist/chunks/{msg-DNXH9mKo.js → msg-BzZbudMm.js} +1 -1
- package/dist/chunks/{ofd-B0_-rey2.js → ofd-C7DKqJ6Z.js} +1 -1
- package/dist/chunks/{openDocument-DW7w0HpR.js → openDocument-DGzqlyJg.js} +1 -1
- package/dist/chunks/parse-6ZQGx714.js +1 -0
- package/dist/chunks/{parser-BFNqF7wU.js → parser-DC3PvpL4.js} +1 -1
- package/dist/chunks/ppt-B0WY5Gks.js +30 -0
- package/dist/chunks/pptx-DX5KDFZ7.js +109 -0
- package/dist/chunks/{print-mask-DTiml6Ox.js → print-mask-Dguzv0rv.js} +2 -2
- package/dist/chunks/{psd-yU36O76Y.js → psd-hjeNFQZ-.js} +1 -1
- package/dist/chunks/{search-filters-BoRMIesR.js → search-filters-CRIhZ0gL.js} +1 -1
- package/dist/chunks/spreadsheet-BzbBEhmY.js +1 -0
- package/dist/chunks/{spreadsheet-DiZ31XlH.js → spreadsheet-LR3SOG-x.js} +3 -3
- package/dist/chunks/toolbar-controls-CThS0xuP.js +15 -0
- package/dist/chunks/ui-BFsHoY7a.js +1 -0
- package/dist/chunks/{useCrudOperationColumn-PObQMk2y.js → useCrudOperationColumn-D935tixd.js} +1 -1
- package/dist/chunks/useListPage-CbcOQG4m.js +1 -0
- package/dist/chunks/{useStatusToggle-B7KSIN75.js → useStatusToggle-B2qZaoc-.js} +1 -1
- package/dist/chunks/wordDoc-BZY3ZnxN.js +152 -0
- package/dist/chunks/wordDocx-Bt2mlB3C.js +77 -0
- package/dist/chunks/{xmind-B9BtGBNI.js → xmind-CF9YwkOD.js} +2 -2
- package/dist/file-viewer/flyfish-viewer-assets.json +5 -5
- package/dist/file-viewer/vendor/docx/jszip.min.js +0 -0
- package/dist/file-viewer/wasm/data/sql-wasm.wasm +0 -0
- package/dist/index.js +1 -1
- package/dist/{src-DVwjbBTf.js → src-LbWcrSWe.js} +1 -1
- package/dist/styles.css +1 -1
- package/package.json +7 -7
- package/dist/chunks/App-DX7JOOmP.js +0 -79
- package/dist/chunks/ArcBaseAdmin-CdB_roNY.js +0 -1
- package/dist/chunks/ConfigurableTable-CyfZLgG0.js +0 -55
- package/dist/chunks/DataScopePanel-CubtBhTT.js +0 -1
- package/dist/chunks/DepartmentsPage-ECexbzsK.js +0 -1
- package/dist/chunks/DictTag-BerYvaUM.js +0 -1
- package/dist/chunks/DictsPage-65kAxYFd.js +0 -15
- package/dist/chunks/DirectoryLoginModal-rRXvoqV7.js +0 -1
- package/dist/chunks/EditFormModal-D68dOnaj.js +0 -1
- package/dist/chunks/EntityContextRuntime-D9mWi5xC.js +0 -1
- package/dist/chunks/FileNameCell-C_V1k0q-.js +0 -1
- package/dist/chunks/FilePreviewModal-D7v5seXB.js +0 -1
- package/dist/chunks/FileStorageConfigsPage-D2UYESb5.js +0 -15
- package/dist/chunks/FileTypeIcon-C77EVWXZ.js +0 -1
- package/dist/chunks/FilesPage-By81A2i7.js +0 -43
- package/dist/chunks/ForgotPasswordModal-DTlunJpM.js +0 -1
- package/dist/chunks/IdentitySecurityPage-Dp5EP7aT.js +0 -1
- package/dist/chunks/LogStatsScaffold-BFwbN_MU.js +0 -1
- package/dist/chunks/LoginField-Bu4C0-Mk.js +0 -1
- package/dist/chunks/LoginLogsPage-BuMJ6U8I.js +0 -1
- package/dist/chunks/LoginLogsTable-DfAlWPZb.js +0 -1
- package/dist/chunks/MenuCommandPalette-BvW2kEU4.js +0 -8
- package/dist/chunks/MenusPage-DT3kxAfi.js +0 -1
- package/dist/chunks/NavListPanel-agMt2kc6.js +0 -1
- package/dist/chunks/OnlineSessionsPage-BJJAB2pV.js +0 -1
- package/dist/chunks/OperationLogsPage-CP-wUt_N.js +0 -1
- package/dist/chunks/OperationLogsTable-BX0vV3fT.js +0 -1
- package/dist/chunks/PDFPreviewPanel-D8-74Zqs.js +0 -30
- package/dist/chunks/PasswordInput--G8GKd5g.js +0 -1
- package/dist/chunks/PositionsPage-Cs7xq89s.js +0 -1
- package/dist/chunks/PreferencesSheetBody-CdA4Ig_g.js +0 -43
- package/dist/chunks/ProfilePage-Bt3yP6D-.js +0 -15
- package/dist/chunks/RelationPanel-B-KAfl9B.js +0 -36
- package/dist/chunks/RolesPage-DDNGkGAq.js +0 -1
- package/dist/chunks/SessionConflictModal-DgFNCU3j.js +0 -1
- package/dist/chunks/SettingRow-BIb1ruW2.js +0 -1
- package/dist/chunks/SettingsPage-rhqkPOJ9.js +0 -16
- package/dist/chunks/StatCard-BwhGDWpE.js +0 -4
- package/dist/chunks/UserGroupsPage-D3_aji58.js +0 -1
- package/dist/chunks/UserTransferSelect-S-GUw2Y9.js +0 -1
- package/dist/chunks/UsersPage-CLRJX-V9.js +0 -29
- package/dist/chunks/WorkflowPrintButton-BVa-xw-8.js +0 -1
- package/dist/chunks/chart-data-DOMSCLwj.js +0 -5
- package/dist/chunks/chevron-left-DnDEG_PI.js +0 -8
- package/dist/chunks/chevron-right-CzizTV5i.js +0 -8
- package/dist/chunks/dist-BqNhxPp5.js +0 -1
- package/dist/chunks/feedback-D4BIfDNd.js +0 -1
- package/dist/chunks/file-utils-DJ9ksj-g.js +0 -1
- package/dist/chunks/geo-Bf8ymo43.js +0 -38
- package/dist/chunks/line-DSFA8EqT.js +0 -1
- package/dist/chunks/mail-Cduf1OFr.js +0 -8
- package/dist/chunks/mono-icons-CxCoktev.js +0 -1
- package/dist/chunks/plus-Bvdn6bx1.js +0 -8
- package/dist/chunks/ppt-C9RgrmNU.js +0 -30
- package/dist/chunks/pptx-_T8ZPVQn.js +0 -109
- package/dist/chunks/printer-DL8WQci4.js +0 -8
- package/dist/chunks/shield-check-DZGK8n9u.js +0 -8
- package/dist/chunks/spreadsheet-CHFSQY8j.js +0 -1
- package/dist/chunks/table-columns-XaoxVUJN.js +0 -1
- package/dist/chunks/toolbar-controls-BFOuV86W.js +0 -8
- package/dist/chunks/ui-DoIHGuTR.js +0 -1
- package/dist/chunks/useDebouncedValue-DFoJN77o.js +0 -22
- package/dist/chunks/useListPage-1Upr_ala.js +0 -1
- package/dist/chunks/wordDoc-CtetBfzo.js +0 -152
- package/dist/chunks/wordDocx-8ak39HcF.js +0 -77
- package/dist/chunks/zoom-8Eo2fTNd.js +0 -1
- package/dist/public/monaco/vs/editor/editor.worker.js +0 -1
- package/dist/public/monaco/vs/language/css/css.worker.js +0 -66
- package/dist/public/monaco/vs/language/html/html.worker.js +0 -443
- package/dist/public/monaco/vs/language/json/json.worker.js +0 -17
- package/dist/public/monaco/vs/language/typescript/ts.worker.js +0 -67693
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,o as n}from"../src-DVwjbBTf.js";import{a as r,i,n as a,o,r as s,s as c}from"./controls-C5dPckUT.js";import{n as l,t as u}from"./createLucideIcon-BtwfYE6A.js";import{i as d,n as f,r as p,t as m}from"./menu-mQgsexFx.js";import{n as h,t as ee}from"./chevron-left-DnDEG_PI.js";import{n as g,t as te}from"./chevron-right-CzizTV5i.js";import{n as _,t as v}from"./info-BQa8C31Y.js";import{C as y,a as b,m as x,s as S,w as C}from"./ui-DoIHGuTR.js";import{n as w,t as T}from"./ScrollArea-DqjJmHDN.js";import{c as ne,l as E,n as D,o as re,s as ie,t as O}from"./SettingRow-BIb1ruW2.js";import{useCallback as k,useEffect as A,useRef as j,useState as M}from"react";import{DARK_SURFACE_TONE_OPTIONS as ae,FONT_FAMILY_OPTIONS as oe,LOADING_STYLE_OPTIONS as N,UI_SCALE_OPTIONS as se,isScheduleTime as ce,usePreferences as le}from"@fudanda/react-core/hooks/usePreferences";import{Fragment as ue,jsx as P,jsxs as F}from"react/jsx-runtime";import{Button as de,Empty as fe}from"antd";import{THEME_COLOR_PRESETS as pe}from"@fudanda/react-core/lib/theme-color";import{textMatches as me}from"@fudanda/react-core/utils/pinyin";import{preferenceDefinitionMap as he,preferenceDefinitions as ge}from"@fudanda/shared/preferences";import{clearAllListFilterSnapshots as _e}from"@fudanda/react-core/lib/list-filter-memory";var I,ve;function ye(){return(ye=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
l(),I={name:`columns-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]],aliases:[`panels-left-right`]},I.node,ve=u(I)})))()}var L,R;function z(){return(z=e((()=>{
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v1.53.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
l(),L={name:`layout-dashboard`,size:24,node:[[`rect`,{width:`7`,height:`9`,x:`3`,y:`3`,rx:`1`,key:`10lvy0`}],[`rect`,{width:`7`,height:`5`,x:`14`,y:`3`,rx:`1`,key:`16une8`}],[`rect`,{width:`7`,height:`9`,x:`14`,y:`12`,rx:`1`,key:`1hutg5`}],[`rect`,{width:`7`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`ldoo1y`}]]},L.node,R=u(L)})))()}var B,V;function H(){return(H=e((()=>{
|
|
16
|
-
/**
|
|
17
|
-
* @license lucide-react v1.53.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/
|
|
22
|
-
l(),B={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]},B.node,V=u(B)})))()}var U,W;function G(){return(G=e((()=>{
|
|
23
|
-
/**
|
|
24
|
-
* @license lucide-react v1.53.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/
|
|
29
|
-
l(),U={name:`navigation`,size:24,node:[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]},U.node,W=u(U)})))()}var K,q;function J(){return(J=e((()=>{
|
|
30
|
-
/**
|
|
31
|
-
* @license lucide-react v1.53.0 - ISC
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the ISC license.
|
|
34
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/
|
|
36
|
-
l(),K={name:`palette`,size:24,node:[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]},K.node,q=u(K)})))()}var Y,X;function be(){return(be=e((()=>{
|
|
37
|
-
/**
|
|
38
|
-
* @license lucide-react v1.53.0 - ISC
|
|
39
|
-
*
|
|
40
|
-
* This source code is licensed under the ISC license.
|
|
41
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/
|
|
43
|
-
l(),Y={name:`sliders-horizontal`,size:24,node:[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]},Y.node,X=u(Y)})))()}function xe(e,t){let n=t.trim();if(!n)return!0;let r=Z.find(t=>t.key===e.group),i=Ce[e.path]??[];return[e.label,e.path,e.description??``,r?.label??``,...e.options?.flatMap(e=>[e.label,String(e.value)])??[],...i].some(e=>me(e,n))}function Se(e,t,n,r,i){return Z.map(a=>({...a,fields:ge.filter(o=>o.group===a.key&&(t(o.path)||o.path===`enableLockScreen`&&i)&&xe(o,e)&&(o.path!==`showQuickChat`||n)&&(o.path!==`autoLockMinutes`||r))})).filter(e=>e.fields.length>0)}var Z,Ce;function we(){return(we=e((()=>{Z=[{key:`layout`,label:`布局`,description:`选择导航结构和内容区域的呈现方式。`},{key:`appearance`,label:`外观`,description:`调整主题、颜色、字体和界面动效。`},{key:`navigation`,label:`导航`,description:`设置面包屑、顶栏工具和时钟。`},{key:`sidebar`,label:`侧栏`,description:`调整菜单宽度、展开方式和滚动行为。`},{key:`tabs`,label:`标签页`,description:`设置多页浏览、页面缓存和切换行为。`},{key:`table`,label:`表格`,description:`设置列表样式、分页和筛选记忆。单张表格的独立设置优先,可在表格中选择“跟随全局偏好”恢复。`},{key:`general`,label:`通用`,description:`调整首页、时间显示、交互和锁屏设置。`}],Ce={colorMode:[`主题`,`主题模式`],themeColor:[`主题色`,`配色`,`品牌色`],homePath:[`默认首页`,`登录跳转`,`落地页`],enableLockScreen:[`密码`,`屏幕锁`,`锁屏密码`],sidebarWidth:[`侧栏宽度`],loadingStyle:[`Loading`],reduceMotion:[`减少动画`,`关闭动画`]}})))()}function Te({value:e,onChange:t,options:n,allowCustom:r=!0,customTitle:i=`自定义颜色`,allowClear:a=!1,clearTitle:o=`无颜色`}){let s=e.startsWith(`#`)&&!n.some(t=>t.key===e);return/* @__PURE__ */ F(`div`,{className:`swatch-color-picker`,children:[a&&/* @__PURE__ */ P(y,{content:o,position:`top`,children:/* @__PURE__ */ P(`button`,{type:`button`,"aria-label":o,"aria-pressed":e===``,className:`swatch-color-swatch swatch-color-swatch--clear${e===``?` swatch-color-swatch--active`:``}`,onClick:()=>t(``),children:e===``&&/* @__PURE__ */ P(`span`,{className:`swatch-color-swatch__check`,children:/* @__PURE__ */ P(p,{size:14,strokeWidth:2.5})})})}),n.map(n=>{let r=e===n.key;return/* @__PURE__ */ P(y,{content:n.label,position:`top`,children:/* @__PURE__ */ P(`button`,{type:`button`,"aria-label":n.label,"aria-pressed":r,className:`swatch-color-swatch${r?` swatch-color-swatch--active`:``}`,style:{backgroundColor:n.color,color:n.color},onClick:()=>t(n.key),title:n.label,children:r&&/* @__PURE__ */ P(`span`,{className:`swatch-color-swatch__check`,children:/* @__PURE__ */ P(p,{size:14,strokeWidth:2.5})})})},n.key)}),r&&/* @__PURE__ */ P(S,{alpha:!1,usePopover:!0,value:s?S.colorStringToValue(e):void 0,onChange:e=>t(e.hex),popoverProps:{position:`top`,zIndex:10010},children:/* @__PURE__ */ P(`button`,{type:`button`,"aria-label":i,"aria-pressed":s,className:`swatch-color-swatch swatch-color-swatch--custom${s?` swatch-color-swatch--active`:``}`,style:s?{backgroundColor:e,color:e}:{},title:i,children:s?/* @__PURE__ */ P(`span`,{className:`swatch-color-swatch__check`,children:/* @__PURE__ */ P(p,{size:14,strokeWidth:2.5})}):/* @__PURE__ */ P(`span`,{className:`swatch-color-swatch__icon`,children:/* @__PURE__ */ P(q,{size:14})})})})]})}function Q(){return(Q=e((()=>{C(),d(),J()})))()}function Ee({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,navLayout:o}){return/* @__PURE__ */ F(D,{title:e(`布局`),children:[t([`导航布局`,`布局`,`左侧菜单`,`顶部菜单`,`混合菜单`,`双列菜单`])&&/* @__PURE__ */ P(O,{path:`navLayout`,children:/* @__PURE__ */ F(`div`,{children:[/* @__PURE__ */ P(`div`,{style:{marginBottom:12,fontSize:13,fontWeight:500,color:`var(--arc-antd-color-text-0)`},children:`导航布局`}),/* @__PURE__ */ P(`div`,{className:`arc-preferences__layout-options`,children:[{value:`vertical`,label:`左侧菜单`},{value:`horizontal`,label:`顶部菜单`},{value:`mixed`,label:`混合菜单`},{value:`double`,label:`双列菜单`}].map(({value:e,label:t})=>/* @__PURE__ */ F(`button`,{type:`button`,className:`layout-picker__option${o===e?` layout-picker__option--active`:``}`,"aria-pressed":o===e,onClick:()=>a({navLayout:e}),children:[/* @__PURE__ */ F(`div`,{className:`layout-picker__preview layout-picker__preview--${e}`,"aria-hidden":`true`,children:[/* @__PURE__ */ P(`i`,{className:`layout-preview__rail`}),/* @__PURE__ */ P(`i`,{className:`layout-preview__menu`}),/* @__PURE__ */ P(`i`,{className:`layout-preview__header`}),/* @__PURE__ */ F(`i`,{className:`layout-preview__content`,children:[/* @__PURE__ */ P(`i`,{}),/* @__PURE__ */ P(`i`,{}),/* @__PURE__ */ P(`i`,{})]})]}),/* @__PURE__ */ F(`span`,{className:`layout-picker__label`,children:[t,o===e&&/* @__PURE__ */ P(p,{size:14})]})]},e))})]})}),o===`double`&&t([`双列`,`双列菜单`,`首列`,`双列首列`,`图标`,`图标文字`])&&/* @__PURE__ */ P(O,{path:`doubleRailStyle`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`双列首列形式`,/* @__PURE__ */ P(y,{content:`仅图标:与左侧菜单收起时同宽,名称靠悬浮提示,可容纳更多一级模块;图标 + 文字:名称直接可读,但条目更高,矮窗口需要滚动`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:n.doubleRailStyle??`icon`,onChange:e=>a({doubleRailStyle:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`icon`,children:`仅图标`}),/* @__PURE__ */ P(i,{value:`icon-text`,children:`图标 + 文字`})]})]})}),t([`内容宽度`,`固定宽度`,`居中`,`内容区`])&&/* @__PURE__ */ P(O,{path:`contentWidth`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`固定内容宽度`,/* @__PURE__ */ P(y,{content:`开启后内容区最大宽度为 1440px 并居中,适合宽屏显示器`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:(n.contentWidth??`fluid`)===`fixed`,onChange:e=>a({contentWidth:e?`fixed`:`fluid`})})]})}),t([`Logo`,`Logo图标`,`图标`,`显示Logo`])&&/* @__PURE__ */ P(O,{path:`showLogo`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示 Logo 图标`}),/* @__PURE__ */ P(c,{checked:n.showLogo??!0,onChange:e=>a({showLogo:e})})]})})]})}function $({label:e,hint:t,value:n,onChange:a}){return/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[e,/* @__PURE__ */ P(y,{content:t,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(r,{type:`button`,value:n,onChange:e=>a(e.target.value),children:ae.map(e=>/* @__PURE__ */ P(i,{value:e.value,children:e.label},e.value))})]})}function De({path:e,label:t,value:n,onCommit:r}){return/* @__PURE__ */ P(O,{path:e,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:t}),/* @__PURE__ */ P(a,{defaultValue:n,placeholder:`18:00`,"aria-label":t,style:{width:96},onChange:e=>{ce(e)&&r(e)}},n)]})})}function Oe({prefSection:e,matchesPref:n,preferences:a,setPreferences:s,mode:l,handleThemeModeChange:u,isDark:d,themeColor:f,setThemeColor:p}){let m=j(null),h=j(null),g=E()(`loadingStyle`)&&n([`加载动画`,`加载效果`,`Loading`,...N.map(e=>e.label)]),[_,x]=M({canPrev:!1,canNext:!1}),S=k(()=>{let e=m.current;e&&x({canPrev:e.scrollLeft>1,canNext:e.scrollLeft+e.clientWidth<e.scrollWidth-1})},[]);A(()=>{if(!g)return;let e=m.current;if(!e)return;S();let t=new ResizeObserver(S);return t.observe(e),()=>t.disconnect()},[g,S]),A(()=>{let e=m.current,t=h.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();r.left<n.left?e.scrollLeft-=n.left-r.left:r.right>n.right&&(e.scrollLeft+=r.right-n.right)},[g,a.loadingStyle]);let C=k(e=>{let t=m.current;t&&t.scrollBy({left:e*t.clientWidth,behavior:`smooth`})},[]);return/* @__PURE__ */ F(D,{title:e(`外观`),children:[n([`颜色模式`,`深色`,`浅色`,`系统`,`主题模式`])&&/* @__PURE__ */ P(O,{path:`colorMode`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`颜色模式`}),/* @__PURE__ */ F(r,{type:`button`,value:l,onChange:e=>{let t=e.target.value;u(t)},children:[/* @__PURE__ */ P(i,{value:`light`,children:`浅色`}),/* @__PURE__ */ P(i,{value:`dark`,children:`深色`}),/* @__PURE__ */ P(i,{value:`system`,children:`系统`})]})]})}),n([`主题颜色`,`主题色`,`颜色`,`品牌色`,`自定义颜色`])&&/* @__PURE__ */ P(O,{path:`themeColor`,children:/* @__PURE__ */ F(`div`,{children:[/* @__PURE__ */ P(`div`,{style:{marginBottom:12,fontSize:13,fontWeight:500,color:`var(--arc-antd-color-text-0)`},children:`主题颜色`}),/* @__PURE__ */ P(Te,{value:f,onChange:p,options:pe.map(e=>({key:e.key,label:e.name,color:d?e.dark.primary:e.light.primary}))})]})}),n([`定时深色`,`夜间深色`,`自动深色`,`深色定时`,`深色时段`])&&/* @__PURE__ */ P(O,{path:`scheduledDarkMode`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`定时深色`,/* @__PURE__ */ P(y,{content:`时段内无条件使用深色;时段外跟随颜色模式`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:a.scheduledDarkMode??`off`,onChange:e=>s({scheduledDarkMode:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`off`,children:`关闭`}),/* @__PURE__ */ P(i,{value:`custom`,children:`自定义时段`})]})]})}),n([`深色开始时间`,`开始时间`,`定时深色`,`夜间开始`])&&/* @__PURE__ */ P(De,{path:`scheduledDarkStart`,label:`深色开始时间`,value:a.scheduledDarkStart??`18:00`,onCommit:e=>s({scheduledDarkStart:e})}),n([`深色结束时间`,`结束时间`,`定时深色`,`夜间结束`])&&/* @__PURE__ */ P(De,{path:`scheduledDarkEnd`,label:`深色结束时间`,value:a.scheduledDarkEnd??`06:00`,onCommit:e=>s({scheduledDarkEnd:e})}),!d&&n([`顶部栏深色`,`深色`,`深色模式`,`顶部栏`,`顶部导航`])&&/* @__PURE__ */ P(O,{path:`headerDarkMode`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`顶部栏深色模式`}),/* @__PURE__ */ P(c,{checked:a.headerDarkMode??!1,onChange:e=>s({headerDarkMode:e})})]})}),!d&&n([`侧边栏深色`,`深色`,`深色模式`,`侧边栏`])&&/* @__PURE__ */ P(O,{path:`sidebarDarkMode`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`侧边栏深色模式`}),/* @__PURE__ */ P(c,{checked:a.sidebarDarkMode??!1,onChange:e=>s({sidebarDarkMode:e})})]})}),(d||a.sidebarDarkMode)&&n([`侧边栏底色`,`底色`,`色调`,`深浅`,`侧边栏`])&&/* @__PURE__ */ P(O,{path:`darkSidebarTone`,children:/* @__PURE__ */ P($,{label:`侧边栏底色`,hint:`标准与卡片、表格同色;更深会比标准再暗一档,让侧边栏从内容中分离出来`,value:a.darkSidebarTone??`bg-1`,onChange:e=>s({darkSidebarTone:e})})}),(d||a.headerDarkMode)&&n([`顶部底色`,`底色`,`色调`,`深浅`,`顶部`,`顶栏`,`标签栏`,`面包屑`])&&/* @__PURE__ */ P(O,{path:`darkHeaderTone`,children:/* @__PURE__ */ P($,{label:`顶部底色`,hint:`作用于顶栏、头部、面包屑栏与标签栏;更深会让整条顶部区域比内容更暗`,value:a.darkHeaderTone??`bg-1`,onChange:e=>s({darkHeaderTone:e})})}),d&&n([`主区域底色`,`底色`,`色调`,`深浅`,`主区域`,`内容区`,`画布`])&&/* @__PURE__ */ P(O,{path:`darkContentTone`,children:/* @__PURE__ */ P($,{label:`主区域底色`,hint:`作用于内容画布;更深时卡片与表格会从画布中浮起,形成明度层次`,value:a.darkContentTone??`bg-1`,onChange:e=>s({darkContentTone:e})})}),n([`圆角`,`圆角大小`,`直角`,`边框圆角`,`radius`,`外观`])&&/* @__PURE__ */ P(O,{path:`borderRadius`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`圆角大小`,/* @__PURE__ */ P(y,{content:`调整按钮、卡片、弹窗等组件的圆角风格:直角更硬朗,大圆角更柔和`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:a.borderRadius??`medium`,onChange:e=>s({borderRadius:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`none`,children:`直角`}),/* @__PURE__ */ P(i,{value:`small`,children:`小`}),/* @__PURE__ */ P(i,{value:`medium`,children:`默认`}),/* @__PURE__ */ P(i,{value:`large`,children:`大`})]})]})}),n([`界面缩放`,`缩放`,`字号`,`字体大小`,`放大`,`缩小`,`外观`,`无障碍`])&&/* @__PURE__ */ P(O,{path:`uiScale`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[`界面缩放`,/* @__PURE__ */ P(y,{content:`整体放大或缩小界面(含文字、控件与弹层),适合高分屏或需要更大字号的场景`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(o,{value:a.uiScale??100,optionList:se.map(e=>({value:e.value,label:e.label})),onChange:e=>s({uiScale:e}),style:{width:100}})]})}),n([`字体`,`界面字体`,`Inter`,`思源`,`等宽`,`外观`])&&/* @__PURE__ */ P(O,{path:`fontFamily`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[`界面字体`,/* @__PURE__ */ P(y,{content:`只使用系统已安装的字体,未安装时按预设回退到系统默认字体`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(o,{value:a.fontFamily??`system`,optionList:oe.map(e=>({value:e.value,label:e.label})),onChange:e=>s({fontFamily:e}),style:{width:140}})]})}),n([`标签栏尺寸`,`Tabs尺寸`,`Tabs 大小`,`标签控件尺寸`,`small`,`medium`,`large`,`外观`])&&/* @__PURE__ */ P(O,{path:`tabsSize`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`标签栏尺寸`,/* @__PURE__ */ P(y,{content:`控制页面内部标签栏的尺寸,与多标签页开关无关`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:a.tabsSize??`small`,onChange:e=>s({tabsSize:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`small`,children:`小`}),/* @__PURE__ */ P(i,{value:`medium`,children:`中`}),/* @__PURE__ */ P(i,{value:`large`,children:`大`})]})]})}),n([`标签栏样式`,`Tabs样式`,`Tabs 类型`,`line`,`button`,`card`,`slash`,`外观`])&&/* @__PURE__ */ P(O,{path:`tabsType`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`标签栏样式`,/* @__PURE__ */ P(y,{content:`控制页面内部标签栏的显示样式`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(o,{value:a.tabsType??`line`,optionList:[{value:`line`,label:`线条`},{value:`button`,label:`按钮`},{value:`card`,label:`卡片`},{value:`slash`,label:`斜线`}],onChange:e=>s({tabsType:e}),style:{width:120}})]})}),g&&/* @__PURE__ */ P(O,{path:`loadingStyle`,children:/* @__PURE__ */ F(`div`,{children:[/* @__PURE__ */ F(`div`,{className:`loading-style-picker__heading`,children:[/* @__PURE__ */ P(`span`,{children:`加载动画`}),/* @__PURE__ */ P(y,{content:`用于首次进入系统、菜单首载和页面懒加载`,position:`right`,children:/* @__PURE__ */ P(v,{size:13})})]}),/* @__PURE__ */ F(`div`,{className:`loading-style-picker__nav`,children:[/* @__PURE__ */ P(b,{theme:`borderless`,size:`small`,className:`loading-style-picker__nav-button`,icon:/* @__PURE__ */ P(ee,{size:14}),"aria-label":`上一个加载动画`,title:`上一个`,disabled:!_.canPrev,onClick:()=>C(-1)}),/* @__PURE__ */ P(T,{className:`loading-style-picker`,scrollRef:m,horizontal:!0,vertical:!1,onScroll:S,"aria-label":`加载动画预览`,children:N.map(e=>{let n=a.loadingStyle===e.value;return/* @__PURE__ */ F(`button`,{type:`button`,ref:n?h:void 0,className:`loading-style-picker__option${n?` loading-style-picker__option--active`:``}`,"aria-pressed":n,title:e.isDefault?`${e.label}(默认)`:e.label,onClick:()=>s({loadingStyle:e.value}),children:[/* @__PURE__ */ P(`span`,{className:`loading-style-picker__preview`,children:/* @__PURE__ */ P(t,{variant:e.value})}),/* @__PURE__ */ P(`span`,{className:`loading-style-picker__label`,children:e.label})]},e.value)})}),/* @__PURE__ */ P(b,{theme:`borderless`,size:`small`,className:`loading-style-picker__nav-button`,icon:/* @__PURE__ */ P(te,{size:14}),"aria-label":`下一个加载动画`,title:`下一个`,disabled:!_.canNext,onClick:()=>C(1)})]})]})}),n([`灰色`,`灰色模式`,`无障碍`,`公祭日`,`去色`])&&/* @__PURE__ */ P(O,{path:`grayscale`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`灰色模式`,/* @__PURE__ */ P(y,{content:`适用于国家公祭日等场景,全局去除色彩`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:a.grayscale??!1,onChange:e=>s({grayscale:e,...e?{colorBlind:!1}:{}})})]})}),n([`色弱`,`色弱模式`,`无障碍`,`对比度`,`色觉`])&&/* @__PURE__ */ P(O,{path:`colorBlind`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`色弱模式`,/* @__PURE__ */ P(y,{content:`提高界面对比度,辅助色觉障碍用户`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:a.colorBlind??!1,onChange:e=>s({colorBlind:e,...e?{grayscale:!1}:{}})})]})}),n([`动效`,`动画`,`减弱动效`,`性能`,`晕动`,`过渡`])&&/* @__PURE__ */ P(O,{path:`reduceMotion`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`减弱动效`,/* @__PURE__ */ P(y,{content:`关闭路由切换、标签页、主题切换扩散等装饰性动画与过渡;加载指示不受影响。适合低配设备或对动效敏感的用户`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:a.reduceMotion??!1,onChange:e=>s({reduceMotion:e})})]})})]})}function ke({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,prefsSearch:o,quickChatEnabled:s}){return/* @__PURE__ */ F(D,{title:e(`导航与工具栏`),children:[t([`动态标题`,`浏览器标题`,`页面标题`,`标题`])&&/* @__PURE__ */ P(O,{path:`dynamicTitle`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`动态浏览器标题`,/* @__PURE__ */ P(y,{content:`开启后浏览器标签页标题会随当前页面变化,如「用户管理 - ArcBase」;关闭后固定显示应用名称`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.dynamicTitle??!0,onChange:e=>a({dynamicTitle:e})})]})}),t([`面包屑`,`面包屑导航`,`导航栏`,`路径导航`])&&/* @__PURE__ */ P(O,{path:`showBreadcrumb`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`显示面包屑导航`,/* @__PURE__ */ P(y,{content:`在页面顶部显示路径导航(如:首页 / 系统管理 / 用户管理),帮助定位当前位置`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.showBreadcrumb,onChange:e=>a({showBreadcrumb:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑图标`,`图标`,`面包屑`])&&/* @__PURE__ */ P(O,{path:`breadcrumbIcon`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`面包屑显示图标`}),/* @__PURE__ */ P(c,{checked:n.breadcrumbIcon??!1,onChange:e=>a({breadcrumbIcon:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑首页`,`首页`,`面包屑`])&&/* @__PURE__ */ P(O,{path:`breadcrumbShowHome`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`面包屑从首页开始`,/* @__PURE__ */ P(y,{content:`开启后面包屑导航会以「首页」作为第一项,关闭后直接从当前页面的父级路径开始`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.breadcrumbShowHome??!0,onChange:e=>a({breadcrumbShowHome:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑可点击`,`点击`,`面包屑跳转`,`面包屑`])&&/* @__PURE__ */ P(O,{path:`breadcrumbClickable`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`面包屑可点击`,/* @__PURE__ */ P(y,{content:`关闭后面包屑仅展示路径文字,不可点击跳转`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.breadcrumbClickable??!0,onChange:e=>a({breadcrumbClickable:e})})]})}),(n.showBreadcrumb||!!o.trim())&&t([`面包屑子菜单`,`子菜单`,`面包屑悬浮`,`面包屑展开`])&&/* @__PURE__ */ P(O,{path:`breadcrumbSubMenu`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`面包屑子菜单`,/* @__PURE__ */ P(y,{content:`悬停目录层级时弹出子菜单快速导航,支持多级展开`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.breadcrumbSubMenu??!1,onChange:e=>a({breadcrumbSubMenu:e})})]})}),t([`菜单搜索`,`搜索框`,`搜索`,`搜索菜单`])&&/* @__PURE__ */ P(O,{path:`showMenuSearch`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示菜单搜索框`}),/* @__PURE__ */ P(c,{checked:n.showMenuSearch??!0,onChange:e=>a({showMenuSearch:e})})]})}),t([`收藏`,`收藏菜单`,`收藏按钮`,`显示收藏`,`收藏入口`,`快捷收藏`])&&/* @__PURE__ */ P(O,{path:`showFavorites`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示收藏入口`}),/* @__PURE__ */ P(c,{checked:n.showFavorites??!1,onChange:e=>a({showFavorites:e})})]})}),t([`全屏`,`全屏按钮`,`显示全屏`])&&/* @__PURE__ */ P(O,{path:`showFullscreen`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示全屏按钮`}),/* @__PURE__ */ P(c,{checked:n.showFullscreen??!0,onChange:e=>a({showFullscreen:e})})]})}),t([`回到顶部`,`BackTop`,`返回顶部`,`回到顶`,`顶部按钮`])&&/* @__PURE__ */ P(O,{path:`showBackTop`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`显示回到顶部按钮`,/* @__PURE__ */ P(y,{content:`内容区域滚动超过 400px 后,右下角浮现回顶按钮`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.showBackTop??!0,onChange:e=>a({showBackTop:e})})]})}),s&&t([`快捷聊天`,`聊天`,`AI助手`,`聊天按钮`,`快捷聊天按钮`])&&/* @__PURE__ */ P(O,{path:`showQuickChat`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`显示快捷聊天按钮`,/* @__PURE__ */ P(y,{content:`在页面右下角显示浮动聊天按钮,可快速唤起 AI 助手`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.showQuickChat??!0,onChange:e=>a({showQuickChat:e})})]})}),t([`顶栏时钟`,`时钟`,`时钟显示`,`12小时`,`24小时`])&&/* @__PURE__ */ P(O,{path:`topbarClock`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`顶栏时钟`}),/* @__PURE__ */ F(r,{type:`button`,value:n.topbarClock??`off`,onChange:e=>a({topbarClock:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`off`,children:`关闭`}),/* @__PURE__ */ P(i,{value:`12h`,children:`12小时制`}),/* @__PURE__ */ P(i,{value:`24h`,children:`24小时制`})]})]})}),t([`时钟显示日期`,`日期`,`时钟日期`,`星期`])&&/* @__PURE__ */ P(O,{path:`topbarClockShowDate`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`时钟显示日期`}),/* @__PURE__ */ P(c,{checked:n.topbarClockShowDate??!0,onChange:e=>a({topbarClockShowDate:e})})]})})]})}function Ae({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,navLayout:o}){return/* @__PURE__ */ F(D,{title:e(`侧边栏`),children:[t([`侧边栏宽度`,`侧边栏`,`菜单宽度`,`展开宽度`])&&o!==`horizontal`&&/* @__PURE__ */ P(O,{path:`sidebarWidth`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ P(`span`,{style:{flexShrink:0},children:`侧边栏宽度`}),/* @__PURE__ */ P(s,{style:{width:110},size:`small`,min:160,max:320,step:4,suffix:`px`,value:n.sidebarWidth??216,onChange:e=>a({sidebarWidth:Number(e)||216})})]})}),t([`箭头`,`展开箭头`,`箭头位置`,`展开收起`,`子菜单箭头`,`侧边栏`])&&/* @__PURE__ */ P(O,{path:`sidebarToggleIconPosition`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`子菜单箭头位置`,/* @__PURE__ */ P(y,{content:`侧边栏可展开子菜单的展开/收起箭头显示位置:默认在菜单项右端,可改为显示在左侧`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:n.sidebarToggleIconPosition??`right`,onChange:e=>a({sidebarToggleIconPosition:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`left`,children:`左侧`}),/* @__PURE__ */ P(i,{value:`right`,children:`右侧`})]})]})}),t([`侧边栏`,`分组标题`,`滚动固定`,`侧边栏分组`])&&/* @__PURE__ */ P(O,{path:`sidebarStickyScroll`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`侧边栏分组标题滚动固定`,/* @__PURE__ */ P(y,{content:`侧边栏菜单滚动时,分组标题吸附固定在顶部,便于识别当前菜单所属分组`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.sidebarStickyScroll??!0,onChange:e=>a({sidebarStickyScroll:e})})]})}),t([`侧边栏`,`手风琴`,`排他展开`,`侧栏排他`])&&/* @__PURE__ */ P(O,{path:`sidebarAccordion`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`侧栏排他展开`,/* @__PURE__ */ P(y,{content:`开启后侧边栏同级菜单同时只允许展开一项,点击其他分组时自动收起之前展开的分组`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.sidebarAccordion??!1,onChange:e=>a({sidebarAccordion:e})})]})}),t([`悬浮展开`,`侧边栏悬浮`,`侧边栏`,`hover`])&&/* @__PURE__ */ P(O,{path:`sidebarHoverTrigger`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`悬浮展开侧边栏`,/* @__PURE__ */ P(y,{content:`开启后侧边栏收起时,鼠标悬浮即可临时展开,移开后自动收起`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.sidebarHoverTrigger??!1,onChange:e=>a({sidebarHoverTrigger:e})})]})}),t([`菜单滚动`,`自动定位`,`菜单`,`滚动定位`])&&/* @__PURE__ */ P(O,{path:`scrollMenuIntoView`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`菜单自动滚动定位`,/* @__PURE__ */ P(y,{content:`开启后切换菜单时,侧边栏自动平滑滚动使激活项居中可见`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.scrollMenuIntoView??!0,onChange:e=>a({scrollMenuIntoView:e})})]})})]})}function je({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,homePathOptions:s,autoLockMinutes:l,hasPassword:u,clearLockPassword:d,openLockPasswordModal:f}){let p=E();return/* @__PURE__ */ F(D,{title:e(`通用`),children:[t([`默认首页`,`首页`,`登录跳转`,`落地页`,`默认页面`,`登录页面`])&&/* @__PURE__ */ P(O,{path:`homePath`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,gap:12},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4,flexShrink:0},children:[`登录默认页面`,/* @__PURE__ */ P(y,{content:`登录成功后进入的页面;不影响日常点击「首页」菜单的行为`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(o,{filter:!0,style:{width:170},value:n.homePath??`/`,onChange:e=>a({homePath:e||`/`}),optionList:s})]})}),t([`时间显示`,`相对时间`,`绝对时间`,`分钟前`,`时间格式`,`时间戳`])&&/* @__PURE__ */ P(O,{path:`timeDisplay`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`时间显示方式`,/* @__PURE__ */ P(y,{content:`列表、消息与时间线里的时间:绝对时间显示完整日期时刻;相对时间显示「3 分钟前」,悬停查看精确时刻。详情页字段始终为绝对时间`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:n.timeDisplay??`absolute`,onChange:e=>a({timeDisplay:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`absolute`,children:`绝对`}),/* @__PURE__ */ P(i,{value:`relative`,children:`相对`})]})]})}),t([`一周起始日`,`周一`,`周日`,`星期`,`日历`,`日期选择器`,`起始日`])&&/* @__PURE__ */ P(O,{path:`weekStart`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`一周起始日`,/* @__PURE__ */ P(y,{content:`日期选择器与日历面板每周从哪一天开始排列`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:n.weekStart??`monday`,onChange:e=>a({weekStart:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`monday`,children:`周一`}),/* @__PURE__ */ P(i,{value:`sunday`,children:`周日`})]})]})}),t([`自动刷新`,`聚焦`,`切回`,`窗口`,`页签`,`重新获取`,`过期数据`,`refetch`])&&/* @__PURE__ */ P(O,{path:`refetchOnFocus`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`切回窗口时自动刷新数据`,/* @__PURE__ */ P(y,{content:`从其他窗口或页签切回时,自动重新获取已过期的列表与详情数据;网络较差时可关闭`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.refetchOnFocus??!1,onChange:e=>a({refetchOnFocus:e})})]})}),t([`进度条`,`加载进度`,`页面加载`,`顶部进度`,`NProgress`])&&/* @__PURE__ */ P(O,{path:`showProgressBar`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`页面加载进度条`,/* @__PURE__ */ P(y,{content:`页面切换时在内容区顶部显示加载进度条`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.showProgressBar??!0,onChange:e=>a({showProgressBar:e})})]})}),t([`快捷键`,`键盘`,`热键`,`Alt`,`Ctrl`,`组合键`])&&/* @__PURE__ */ P(O,{path:`enableShortcuts`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`启用全局快捷键`,/* @__PURE__ */ P(y,{content:`Alt+L 锁屏、Alt+S 收起/展开侧边栏、Alt+C 内容全屏、Ctrl+K 搜索菜单;关闭后这些组合键不再生效`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.enableShortcuts??!0,onChange:e=>a({enableShortcuts:e})})]})}),t([`地址栏`,`URL`,`深链`,`页面状态`,`查询参数`,`分享`,`书签`,`标签参数`,`tab参数`,`选中项`])&&/* @__PURE__ */ P(O,{path:`syncPageStateToUrl`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`页面状态同步到地址栏`,/* @__PURE__ */ P(y,{content:`页面内的 Tab 与分栏选中项以查询参数写入地址栏(如 ?tab=),刷新、收藏或分享链接可直达当前视图;关闭时地址栏保持干净,外部带参链接进入仍会生效一次`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.syncPageStateToUrl??!1,onChange:e=>a({syncPageStateToUrl:e})})]})}),t([`退出确认`,`退出登录`,`二次确认`,`注销`,`登出`])&&/* @__PURE__ */ P(O,{path:`confirmLogout`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`退出登录二次确认`,/* @__PURE__ */ P(y,{content:`关闭后点击「退出登录」将直接退出,不再弹出确认框`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.confirmLogout??!0,onChange:e=>a({confirmLogout:e})})]})}),t([`弹窗`,`模态框`,`遮罩`,`蒙层`,`点击关闭`,`maskClosable`,`误触`])&&/* @__PURE__ */ P(O,{path:`modalClickMaskToClose`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`弹窗点击遮罩关闭`,/* @__PURE__ */ P(y,{content:`开启后,点击弹窗外的遮罩区域可直接关闭弹窗(按 Esc 关闭不受影响);关闭时需点击右上角或底部按钮,可防止误触丢失表单内容`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.modalClickMaskToClose??!1,onChange:e=>a({modalClickMaskToClose:e})})]})}),t([`文件视图`,`文件列表`,`文件管理`,`列表`,`网格`,`文件`])&&/* @__PURE__ */ P(O,{path:`filesViewMode`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`文件列表默认视图`}),/* @__PURE__ */ F(r,{type:`button`,value:n.filesViewMode??`list`,onChange:e=>a({filesViewMode:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`list`,children:`列表`}),/* @__PURE__ */ P(i,{value:`grid`,children:`网格`})]})]})}),t([`锁屏`,`屏幕锁`,`密码`,`锁定`])&&/* @__PURE__ */ P(O,{path:`enableLockScreen`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`开启屏幕锁`,/* @__PURE__ */ P(y,{content:`开启后可通过 Alt+L 快捷键或用户菜单锁定屏幕,解锁需输入密码`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.enableLockScreen??!1,onChange:e=>{e?f(`set`):(d(),a({enableLockScreen:!1}))}})]})}),(n.enableLockScreen??!1)&&p(`enableLockScreen`)&&t([`锁屏`,`密码`,`锁屏密码`])&&/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`锁屏密码`}),/* @__PURE__ */ P(b,{size:`small`,theme:`light`,onClick:()=>{f(u()?`change`:`set`)},children:u()?`修改密码`:`设置密码`})]}),(n.enableLockScreen??!1)&&u()&&t([`自动锁屏`,`锁屏`,`无操作`,`空闲`,`闲置`])&&/* @__PURE__ */ P(O,{path:`autoLockMinutes`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`无操作自动锁屏`,/* @__PURE__ */ P(y,{content:`超过设定时长没有任何鼠标/键盘操作时自动锁定屏幕`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(o,{style:{width:110},value:l,onChange:e=>a({autoLockMinutes:e}),optionList:[{value:0,label:`关闭`},{value:5,label:`5 分钟`},{value:10,label:`10 分钟`},{value:30,label:`30 分钟`}]})]})})]})}function Me({prefSection:e,matchesPref:t,preferences:n,setPreferences:a}){return/* @__PURE__ */ F(D,{title:e(`表格`),children:[t([`表格`,`边框`,`斦马纹`,`尺寸`,`分页`,`列设置`,`显示表格`,`启用斦马纹`])&&/* @__PURE__ */ F(ue,{children:[/* @__PURE__ */ P(O,{path:`tableBordered`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示表格边框`}),/* @__PURE__ */ P(c,{checked:n.tableBordered??!0,onChange:e=>a({tableBordered:e})})]})}),/* @__PURE__ */ P(O,{path:`tableStriped`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`启用斑马纹`}),/* @__PURE__ */ P(c,{checked:n.tableStriped??!1,onChange:e=>a({tableStriped:e})})]})}),/* @__PURE__ */ P(O,{path:`tableSize`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`表格尺寸`}),/* @__PURE__ */ F(r,{type:`button`,value:n.tableSize??`default`,onChange:e=>a({tableSize:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`small`,children:`紧凑`}),/* @__PURE__ */ P(i,{value:`middle`,children:`适中`}),/* @__PURE__ */ P(i,{value:`default`,children:`宽松`})]})]})}),/* @__PURE__ */ P(O,{path:`tablePageSize`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`默认分页大小`}),/* @__PURE__ */ P(o,{value:n.tablePageSize??10,onChange:e=>a({tablePageSize:e}),style:{width:100},optionList:[10,20,50,100].map(e=>({value:e,label:`${e} 条`}))})]})}),/* @__PURE__ */ P(O,{path:`showTableColumnSettings`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示表格列设置按钮`}),/* @__PURE__ */ P(c,{checked:n.showTableColumnSettings??!0,onChange:e=>a({showTableColumnSettings:e})})]})})]}),t([`筛选`,`筛选条件`,`记住`,`搜索条件`,`恢复`,`查询条件`,`表格`])&&/* @__PURE__ */ P(O,{path:`rememberListFilters`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`记住列表筛选条件`,/* @__PURE__ */ P(y,{content:`离开列表页再回来时恢复上次查询的筛选条件(分页回到第 1 页);关闭浏览器即清除`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.rememberListFilters??!1,onChange:e=>{e||_e(),a({rememberListFilters:e})}})]})})]})}function Ne({prefSection:e,matchesPref:t,preferences:n,setPreferences:a,prefsSearch:l}){return/* @__PURE__ */ F(D,{title:e(`标签页`),children:[t([`多标签页`,`标签页`,`标签`,`启用标签`])&&/* @__PURE__ */ P(O,{path:`enableTabs`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`启用多标签页`}),/* @__PURE__ */ P(c,{checked:n.enableTabs,onChange:e=>a({enableTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`保存标签`,`恢复标签`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`keepTabs`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`保存标签页`,/* @__PURE__ */ P(y,{content:`刷新页面或重新登录后,自动恢复上次打开的标签页`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.keepTabs??!0,onChange:e=>a({keepTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`页面缓存`,`keepalive`,`keep-alive`,`缓存`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`enablePageCache`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`页面缓存`,/* @__PURE__ */ P(y,{content:`菜单管理中开启「页面缓存」的页面,切换标签页时保留状态(搜索条件、滚动位置等),关闭标签页时释放`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.enablePageCache??!0,onChange:e=>a({enablePageCache:e})})]})}),(n.enableTabs||!!l.trim())&&t([`标签图标`,`图标`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`showTabIcon`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`标签页显示图标`}),/* @__PURE__ */ P(c,{checked:n.showTabIcon,onChange:e=>a({showTabIcon:e})})]})}),(n.enableTabs||!!l.trim())&&t([`紧凑标签`,`紧凑模式`,`页签密度`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`compactTabs`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`紧凑标签页`,/* @__PURE__ */ P(y,{content:`减少标签栏的高度与页签间距,适合同时打开较多页面`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.compactTabs??!0,onChange:e=>a({compactTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`标签切换器`,`切换器`,`chevron`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`showTabSwitcher`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`显示标签切换器`}),/* @__PURE__ */ P(c,{checked:n.showTabSwitcher??!0,onChange:e=>a({showTabSwitcher:e})})]})}),(n.enableTabs||!!l.trim())&&t([`自动隐藏`,`隐藏标签`,`程序坞`,`dock`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`autoHideTabs`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`自动隐藏标签栏`,/* @__PURE__ */ P(y,{content:`平时收起为一条细线,鼠标悬停或键盘聚焦时展开;触屏设备上保持常显`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ P(c,{checked:n.autoHideTabs??!1,onChange:e=>a({autoHideTabs:e})})]})}),(n.enableTabs||!!l.trim())&&t([`最大标签`,`标签数量`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`tabsMaxCount`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`最大标签数`}),/* @__PURE__ */ P(s,{min:5,max:50,value:n.tabsMaxCount,onChange:e=>a({tabsMaxCount:e}),style:{width:100}})]})}),(n.enableTabs||!!l.trim())&&t([`超限策略`,`FIFO`,`LRU`,`关闭策略`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`tabEvictPolicy`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`超限关闭策略`,/* @__PURE__ */ P(y,{content:`FIFO: 关闭最早打开的标签;LRU: 关闭最久未使用的标签`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:n.tabEvictPolicy??`fifo`,onChange:e=>a({tabEvictPolicy:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`fifo`,children:`FIFO`}),/* @__PURE__ */ P(i,{value:`lru`,children:`LRU`})]})]})}),(n.enableTabs||!!l.trim())&&t([`插入位置`,`新标签位置`,`标签插入`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`openTabBehavior`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ F(`span`,{style:{display:`flex`,alignItems:`center`,gap:4},children:[`新标签插入位置`,/* @__PURE__ */ P(y,{content:`末尾:新标签始终排在最右侧;当前后方:新标签紧跟在当前标签之后插入`,position:`right`,children:/* @__PURE__ */ P(v,{size:13,style:{color:`var(--arc-antd-color-text-2)`,cursor:`help`}})})]}),/* @__PURE__ */ F(r,{type:`button`,value:n.openTabBehavior??`append`,onChange:e=>a({openTabBehavior:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`append`,children:`末尾`}),/* @__PURE__ */ P(i,{value:`insert-next`,children:`当前后方`})]})]})}),(n.enableTabs||!!l.trim())&&t([`双击标签`,`双击`,`标签行为`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`tabDoubleClickAction`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`双击标签行为`}),/* @__PURE__ */ F(r,{type:`button`,value:n.tabDoubleClickAction??`refresh`,onChange:e=>a({tabDoubleClickAction:e.target.value}),children:[/* @__PURE__ */ P(i,{value:`refresh`,children:`刷新`}),/* @__PURE__ */ P(i,{value:`close`,children:`关闭`}),/* @__PURE__ */ P(i,{value:`none`,children:`无`})]})]})}),(n.enableTabs||!!l.trim())&&t([`标签风格`,`风格`,`线条`,`胶囊`,`卡片`,`chrome`,`谷歌`,`极简`,`minimal`,`分段`,`segment`,`方块`,`block`,`短线`,`shortline`,`圆点`,`dot`,`顶线`,`topline`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`tabStyle`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`标签页风格`}),/* @__PURE__ */ P(o,{value:n.tabStyle??`line`,optionList:[{value:`line`,label:`线条`},{value:`pill`,label:`胶囊`},{value:`card`,label:`卡片`},{value:`chrome`,label:`谷歌`},{value:`minimal`,label:`极简`},{value:`segment`,label:`分段`},{value:`block`,label:`方块`},{value:`shortline`,label:`短线`},{value:`dot`,label:`圆点`},{value:`topline`,label:`顶线`}],onChange:e=>a({tabStyle:e}),style:{width:120}})]})}),(n.enableTabs||!!l.trim())&&t([`标签动画`,`动画`,`淡入`,`滑入`,`缩放`,`标签页`,`标签`])&&/* @__PURE__ */ P(O,{path:`tabAnimation`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`标签页动画`}),/* @__PURE__ */ P(r,{type:`button`,value:n.tabAnimation??`none`,onChange:e=>a({tabAnimation:e.target.value}),children:[`none`,`fade`,`slide`,`scale`].map(e=>{let t=/* @__PURE__ */ P(i,{value:e,children:{none:`无`,fade:`淡入`,slide:`滑入`,scale:`缩放`}[e]},e);return e===`none`?t:/* @__PURE__ */ P(x,{trigger:`hover`,position:`bottom`,mouseEnterDelay:100,mouseLeaveDelay:100,content:/* @__PURE__ */ F(`div`,{className:`tab-anim-preview`,"data-anim":e,children:[/* @__PURE__ */ P(`span`,{className:`tab-anim-preview__pill`,children:`首页`}),/* @__PURE__ */ P(`span`,{className:`tab-anim-preview__pill tab-anim-preview__pill--active`,children:`用户管理`}),/* @__PURE__ */ P(`span`,{className:`tab-anim-preview__pill tab-anim-preview__demo`,children:`角色管理`})]}),children:t},e)})})]})}),t([`路由动画`,`切换动画`,`动画`,`淡入`,`上滑`,`左滑`])&&/* @__PURE__ */ P(O,{path:`routeAnimation`,children:/* @__PURE__ */ F(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`},children:[/* @__PURE__ */ P(`span`,{children:`路由切换动画`}),/* @__PURE__ */ P(r,{type:`button`,value:n.routeAnimation??`fade`,onChange:e=>a({routeAnimation:e.target.value}),children:[`none`,`fade`,`slide-up`,`slide-left`].map(e=>{let t=/* @__PURE__ */ P(i,{value:e,children:{none:`无`,fade:`淡入`,"slide-up":`上滑`,"slide-left":`左滑`}[e]},e);return e===`none`?t:/* @__PURE__ */ P(x,{trigger:`hover`,position:`bottom`,mouseEnterDelay:100,mouseLeaveDelay:100,content:/* @__PURE__ */ P(`div`,{className:`route-anim-preview`,"data-anim":e,children:/* @__PURE__ */ F(`div`,{className:`route-anim-preview__page`,children:[/* @__PURE__ */ P(`div`,{className:`route-anim-preview__title`}),/* @__PURE__ */ P(`div`,{className:`route-anim-preview__line`}),/* @__PURE__ */ P(`div`,{className:`route-anim-preview__line route-anim-preview__line--short`})]})}),children:t},e)})})]})})]})}function Pe(){return(Pe=e((()=>{C(),d(),h(),g(),_(),ne(),Q(),w(),n(),re()})))()}function Fe(e){let{canEditPreference:t,hasManagedPreferences:n}=le(),[r,i]=M(`layout`),a=!!e.prefsSearch.trim(),o=Se(``,t,e.quickChatEnabled,e.hasPassword(),e.preferences.enableLockScreen),s=Se(e.prefsSearch,t,e.quickChatEnabled,e.hasPassword(),e.preferences.enableLockScreen),c=o.find(e=>e.key===r)??o[0],l=a?s:c?[c]:[],u={prefSection:Re,matchesPref:Le,preferences:e.preferences,setPreferences:e.setPreferences},d={layout:/* @__PURE__ */ P(Ee,{...u,navLayout:e.navLayout}),appearance:/* @__PURE__ */ P(Oe,{...u,mode:e.mode,handleThemeModeChange:e.handleThemeModeChange,isDark:e.isDark,themeColor:e.themeColor,setThemeColor:e.setThemeColor}),navigation:/* @__PURE__ */ P(ke,{...u,prefsSearch:e.prefsSearch,quickChatEnabled:e.quickChatEnabled}),sidebar:/* @__PURE__ */ P(Ae,{...u,navLayout:e.navLayout}),general:/* @__PURE__ */ P(je,{...u,homePathOptions:e.homePathOptions,autoLockMinutes:e.autoLockMinutes,hasPassword:e.hasPassword,clearLockPassword:e.clearLockPassword,openLockPasswordModal:e.openLockPasswordModal}),table:/* @__PURE__ */ P(Me,{...u}),tabs:/* @__PURE__ */ P(Ne,{...u,prefsSearch:e.prefsSearch})};return/* @__PURE__ */ P(ie.Provider,{value:t=>xe(he[t],e.prefsSearch),children:/* @__PURE__ */ F(`div`,{className:`arc-preferences__browser${a?` arc-preferences__browser--search`:``}`,children:[!a&&o.length>0&&/* @__PURE__ */ P(T,{as:`nav`,className:`arc-preferences__categories`,"aria-label":`偏好分类`,children:o.map(e=>{let t=Ie[e.key];return/* @__PURE__ */ F(`button`,{type:`button`,"aria-pressed":e.key===c?.key,onClick:()=>i(e.key),children:[/* @__PURE__ */ P(t,{size:16}),/* @__PURE__ */ P(`span`,{children:e.label})]},e.key)})}),/* @__PURE__ */ F(T,{className:`arc-preferences__content`,"aria-label":`偏好设置内容`,children:[a&&/* @__PURE__ */ F(`div`,{className:`arc-preferences__result-summary`,role:`status`,children:[`找到 `,s.reduce((e,t)=>e+t.fields.length,0),` 项可调整的设置`]}),l.map(e=>/* @__PURE__ */ F(`section`,{className:`arc-preferences__section`,"aria-label":`${e.label}设置`,children:[/* @__PURE__ */ F(`div`,{className:`arc-preferences__section-heading`,children:[/* @__PURE__ */ P(`h3`,{children:e.label}),/* @__PURE__ */ P(`p`,{children:e.description})]}),d[e.key]]},e.key)),l.length===0&&/* @__PURE__ */ P(fe,{image:fe.PRESENTED_IMAGE_SIMPLE,description:a?`没有找到匹配的设置`:`当前没有可调整的个人设置`,children:a&&/* @__PURE__ */ P(de,{onClick:e.onClearSearch,children:`清空搜索`})}),n&&/* @__PURE__ */ P(`p`,{className:`arc-preferences__policy-note`,children:`部分设置由系统统一管理,此处仅展示可调整的项目。`})]},a?`search`:c?.key)]})})}var Ie,Le,Re;function ze(){return(ze=e((()=>{ye(),z(),H(),f(),G(),J(),be(),w(),ne(),we(),Pe(),Ie={layout:R,appearance:q,navigation:W,sidebar:m,tabs:ve,table:V,general:X},Le=()=>!0,Re=()=>null})))()}ze();export{Fe as default};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./typography-DKK_iHcj.js";import{i as n,n as ee}from"./feedback-D4BIfDNd.js";import{n as r}from"./tabs-BobA_IcO.js";import{n as i,t as te}from"./ConfigurableTable-CyfZLgG0.js";import{n as a,t as o}from"./createLucideIcon-BtwfYE6A.js";import{a as s,c as ne,i as re,l as ie,n as ae,o as oe,r as c,s as l,t as se}from"./UserLogsPanels-3ZlKQsCu.js";import{n as u,t as ce}from"./copy-ofLPH1I0.js";import{a as d,i as le,r as f,t as p}from"./SessionClientTag-DafwXf-o.js";import{n as m,t as ue}from"./list-DCcWnjUg.js";import{i as de,n as h,r as fe,t as pe}from"./user-round-kYfBkPNu.js";import{n as g,t as me}from"./plus-Bvdn6bx1.js";import{t as _}from"./form-DhQiOMvp.js";import{n as v}from"./list-0CbyOlT9.js";import{_ as y,a as b,b as x,c as he,l as ge,r as S,v as C,w as _e}from"./ui-DoIHGuTR.js";import{i as ve,t as w}from"./confirm-CC2F8XXe.js";import{r as T,t as ye}from"./deleteAction-NGTDhZud.js";import{n as be}from"./listTableProps-DDynsnLF.js";import{n as E,t as D}from"./DateTimeText-rk9NeYgA.js";import{i as O,n as xe,r as k}from"./table-columns-XaoxVUJN.js";import{a as Se,i as A,r as j,t as Ce}from"./EditFormModal-D68dOnaj.js";import{r as M,t as we}from"./clipboard-BKPNFY58.js";import{n as N,t as Te}from"./UserAvatar-B8CFnTCn.js";import{r as P,t as F}from"./PasswordInput--G8GKd5g.js";import{n as I,t as Ee}from"./DictTag-BerYvaUM.js";import{useState as L}from"react";import{Fragment as De,jsx as R,jsxs as z}from"react/jsx-runtime";import{abortSubmit as B}from"@fudanda/react-core/lib/abort-submit";import{useDictItems as Oe}from"@fudanda/react-core/hooks/useDictItems";import{formatDateForApi as ke,formatDateTime as Ae,formatDateTimeForApi as je}from"@fudanda/react-core/utils/date";import{usePagination as Me}from"@fudanda/react-core/hooks/usePagination";import{OAUTH_PROVIDERS as Ne,SESSION_CLIENT_KIND_LABELS as V}from"@fudanda/shared/identity";import{useOAuthProviders as Pe}from"@fudanda/react-core/hooks/queries/auth-public";import{useMySettings as Fe}from"@fudanda/react-core/hooks/queries/settings";import{uploadAvatarBlobToFileCenter as Ie}from"@fudanda/react-core/utils/avatar-upload";import{formatSessionPolicyHint as H}from"@fudanda/shared/settings";import{useApiKeyPermissions as Le,useBeginTotpSetup as Re,useChangeProfilePassword as ze,useCreateApiToken as Be,useDeleteApiToken as Ve,useDeleteMfaFactor as He,useDisableMfaFactor as Ue,useKickOtherProfileSessions as We,useKickProfileSession as Ge,useProfileApiTokens as Ke,useProfileMfaFactors as qe,useProfileOAuthBindUrl as Je,useProfileOauthAccounts as Ye,useProfileSessions as Xe,useUnbindProfileOAuth as Ze,useUpdateProfile as U,useVerifyTotpSetup as Qe}from"@fudanda/react-core/hooks/queries/profile";import{useMyOAuth2Grants as $e,useRevokeMyOAuth2Grant as et}from"@fudanda/react-core/hooks/queries/oauth2-apps";import{useUrlTabState as tt}from"@fudanda/react-core/hooks/useUrlTabState";var W,G;function K(){return(K=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
a(),W={name:`key`,size:24,node:[[`path`,{d:`m2 21 9.6-9.6`,key:`9l79m3`}],[`path`,{d:`m7.5 15.5 2.3 2.3a1 1 0 0 1 0 1.4l-2.1 2.1a1 1 0 0 1-1.4 0L4 19`,key:`fw8biw`}],[`circle`,{cx:`15.5`,cy:`7.5`,r:`5.5`,key:`4wxmhb`}]]},W.node,G=o(W)})))()}var q,nt;function J(){return(J=e((()=>{
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v1.53.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
a(),q={name:`shield`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]},q.node,nt=o(q)})))()}function rt({policy:e}){return!e||e.maxSessions<=0?null:/* @__PURE__ */ R(S,{type:`info`,closeIcon:null,fullMode:!1,style:{marginBottom:12},description:`当前策略:${H(e)}`})}function it({sessions:e,loading:t,onKick:n}){return/* @__PURE__ */ R(v,{className:`session-list`,dataSource:e,emptyContent:/* @__PURE__ */ R(`div`,{className:`session-list-empty`,children:`暂无在线设备信息`}),loading:t,renderItem:e=>/* @__PURE__ */ R(v.Item,{align:`center`,className:`session-list-item`,main:/* @__PURE__ */ z(`div`,{className:`session-list-main`,children:[/* @__PURE__ */ R(p,{client:e.client,size:16,className:`session-list-client`}),/* @__PURE__ */ R(Y,{strong:!0,children:e.browser}),/* @__PURE__ */ R(Y,{type:`tertiary`,size:`small`,children:V[e.client]??e.client}),e.isCurrent&&/* @__PURE__ */ R(x,{color:`blue`,size:`small`,children:`当前设备`}),/* @__PURE__ */ z(Y,{type:`tertiary`,size:`small`,className:`session-list-meta`,children:[e.os,` · `,e.location?`${e.location}(${e.ip})`:`IP: ${e.ip}`,` · `,`登录 `,/* @__PURE__ */ R(D,{value:e.loginAt}),` · `,`活跃 `,/* @__PURE__ */ R(D,{value:e.lastActiveAt})]})]}),extra:!e.isCurrent&&/* @__PURE__ */ R(b,{theme:`borderless`,type:`danger`,size:`small`,onClick:()=>{w({title:`确定要退出该设备吗?`,onOk:()=>n(e.tokenId)})},children:`退出`})},e.tokenId)})}function at({user:e}){let[t,i]=tt([`profile`,`security`,`devices`,`login`,`operation`,`api-tokens`],`profile`),{options:a}=Oe(`user_gender`),[o,s]=L(!1),[ie,c]=L(``);L(null),L(``);let[l,u]=L(null),[d,f]=L(!1),p=Fe(),m=Ye(t===`security`),de=Pe(t===`security`);qe(t===`security`);let h=Xe(t===`devices`),g=Ke(t===`api-tokens`),v=Le(t===`api-tokens`),{page:_e,pageSize:ve}=Me();$e(_e,ve,!1),et();let T=p.data?.identitySecurity.password??null,E=m.data??[],D=de.data??[];Ne.filter(e=>D.includes(e)||E.some(t=>t.provider===e));let O=h.data??[],A=U(),j=U(),M=ze();Je(),Ze(),Re(),Qe(),Ue(),He();let N=We(),P=Ge(),I=Be(),V=Ve(),H=Se({save:{mutateAsync:({values:e})=>I.mutateAsync({body:e}),isPending:I.isPending},beforeSave:e=>{let t=e.name.trim();return t||(n.error(`请填写 Token 名称`),B(`validation`)),e.permissions?.length||(n.error(`请选择 API Key 权限`),B(`validation`)),{name:t,...e.expiresAt?{expiresAt:je(e.expiresAt)}:{},permissions:e.permissions}},successMessage:()=>null,onSaved:e=>u(e)}),W=A.isPending,K=M.isPending,q=h.isFetching,J=N.isPending,at=g.isFetching,Q=j.isPending;async function st(e){await A.mutateAsync({body:{...e,email:e.email||null,phone:e.phone||null,gender:e.gender??null,birthDate:e.birthDate?ke(e.birthDate):null}}),n.success(`资料已更新`)}async function ct(e){e.newPassword===e.confirmPassword?(await M.mutateAsync({body:{oldPassword:e.oldPassword,newPassword:e.newPassword}}),n.success(`密码修改成功,请重新登录`),c(``)):n.error(`两次密码输入不一致`)}async function lt(){await N.mutateAsync({}),n.success(`操作成功`)}async function ut(e){await P.mutateAsync({params:{tokenId:e}}),n.success(`已退出该设备`)}async function dt(e){await V.mutateAsync({params:{id:e}}),n.success(`Token 已撤销`)}function ft(e){we(e).then(e=>{e?(f(!0),setTimeout(()=>f(!1),2e3)):n.error(`复制失败,请手动复制`)})}async function pt(){ye({title:`确定要移除头像吗?`,content:`移除后将使用昵称缩写作为默认头像。`,run:()=>j.mutateAsync({body:{avatar:null}}),successMessage:`头像已移除`})}function $(){s(!0)}async function mt(e){s(!1),await j.mutateAsync({body:{avatar:e}}),n.success(`头像已更新`)}return/* @__PURE__ */ z(`div`,{className:`page-container page-tabs-page`,children:[/* @__PURE__ */ R(`div`,{className:`profile-content-card`,children:/* @__PURE__ */ z(r,{collapsible:`auto`,activeKey:t,onChange:e=>i(e),className:`profile-tabs`,children:[/* @__PURE__ */ R(r.TabPane,{itemKey:`profile`,tab:/* @__PURE__ */ z(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ R(pe,{size:14}),/* @__PURE__ */ R(`span`,{children:`基本信息`})]}),children:/* @__PURE__ */ z(`div`,{className:`profile-section`,children:[/* @__PURE__ */ R(`div`,{className:`section-title`,children:`基本信息`}),e.accountSource===`casdoor`&&/* @__PURE__ */ R(S,{type:`info`,description:`统一账户资料由 Casdoor 管理;请联系管理员修改。`,closeIcon:null}),/* @__PURE__ */ z(`div`,{className:`profile-basic-overview`,children:[/* @__PURE__ */ z(`div`,{className:`avatar-column`,children:[/* @__PURE__ */ R(`button`,{type:`button`,className:`avatar-upload-trigger`,disabled:e.accountSource===`casdoor`,onClick:$,"aria-label":`更换头像`,children:Q?/* @__PURE__ */ R(`div`,{className:`avatar-loading-wrapper`,style:{width:80,height:80},children:/* @__PURE__ */ R(C,{})}):/* @__PURE__ */ z(De,{children:[/* @__PURE__ */ R(Te,{name:e.nickname||`用户`,avatar:e.avatar,size:80,style:{fontSize:28}}),/* @__PURE__ */ R(`div`,{className:`avatar-upload-mask`,children:`更换头像`})]})}),/* @__PURE__ */ R(b,{size:`small`,theme:`light`,loading:Q,disabled:e.accountSource===`casdoor`,onClick:$,style:{width:`100%`},children:`更换头像`})]}),/* @__PURE__ */ z(`div`,{className:`profile-basic-summary`,children:[/* @__PURE__ */ z(`div`,{className:`profile-basic-heading`,children:[/* @__PURE__ */ R(ot,{heading:5,style:{margin:0},children:e.nickname}),/* @__PURE__ */ z(Y,{type:`tertiary`,size:`small`,children:[`@`,e.username]})]}),/* @__PURE__ */ R(he,{align:`plain`,layout:`horizontal`,column:2,style:{width:`100%`},data:[{key:`手机号`,value:e.phone,hidden:!e.phone},{key:`邮箱`,value:e.email},{key:`性别`,value:/* @__PURE__ */ R(Ee,{dictCode:`user_gender`,value:e.gender}),hidden:!e.gender},{key:`出生日期`,value:e.birthDate,hidden:!e.birthDate},{key:`部门`,value:e.departmentName,hidden:!e.departmentName},{key:`岗位`,value:e.positions?.length?/* @__PURE__ */ R(y,{spacing:4,style:{display:`inline-flex`,flexWrap:`wrap`},children:e.positions.map(e=>/* @__PURE__ */ R(x,{size:`small`,style:X,children:e.name},e.id))}):void 0,hidden:!e.positions?.length},{key:`角色`,value:e.roles?.length?/* @__PURE__ */ R(y,{spacing:4,style:{display:`inline-flex`,flexWrap:`wrap`},children:e.roles.map(e=>/* @__PURE__ */ R(x,{size:`small`,style:X,children:e.name},e.id))}):`无角色`},{key:`注册时间`,value:Ae(e.createdAt)}]})]})]}),/* @__PURE__ */ R(ge,{margin:28}),/* @__PURE__ */ R(`div`,{className:`section-title`,children:`资料编辑`}),/* @__PURE__ */ z(_,{initValues:{nickname:e.nickname,email:e.email??``,phone:e.phone??``,gender:e.gender??void 0,birthDate:e.birthDate??void 0},disabled:e.accountSource===`casdoor`,onSubmit:st,allowEmpty:!0,labelPosition:`left`,labelWidth:80,children:[/* @__PURE__ */ R(_.Input,{field:`nickname`,label:`昵称`,placeholder:`请输入昵称`,rules:[{required:!0,message:`昵称不能为空`}],style:{width:320}}),/* @__PURE__ */ R(_.Input,{field:`phone`,label:`手机号`,placeholder:`请输入手机号(选填)`,rules:[{pattern:/^1[3-9]\d{9}$/,message:`请输入正确的手机号码`}],style:{width:320}}),/* @__PURE__ */ R(_.Input,{field:`email`,label:`邮箱`,placeholder:`请输入邮箱(选填)`,rules:[{type:`email`,message:`邮箱格式不正确`}],style:{width:320}}),/* @__PURE__ */ R(_.Select,{field:`gender`,label:`性别`,style:{width:320},showClear:!0,optionList:a,placeholder:`请选择性别(选填)`}),/* @__PURE__ */ R(_.DatePicker,{field:`birthDate`,label:`出生日期`,type:`date`,style:{width:320},placeholder:`请选择出生日期(选填)`,showClear:!0}),/* @__PURE__ */ R(_.Slot,{children:/* @__PURE__ */ R(b,{htmlType:`submit`,type:`primary`,loading:W,children:`保存修改`})})]})]})}),!1,/* @__PURE__ */ R(r.TabPane,{itemKey:`security`,tab:/* @__PURE__ */ z(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ R(nt,{size:14}),/* @__PURE__ */ R(`span`,{children:`账号安全`})]}),children:/* @__PURE__ */ z(`div`,{className:`profile-section`,children:[/* @__PURE__ */ R(`div`,{className:`section-title`,children:`修改密码`}),e.accountSource===`casdoor`&&/* @__PURE__ */ R(S,{type:`info`,description:`密码及 MFA 请在 Casdoor 中管理。`,closeIcon:null}),/* @__PURE__ */ z(_,{disabled:e.accountSource===`casdoor`,onSubmit:ct,labelPosition:`left`,labelWidth:100,children:[/* @__PURE__ */ R(F,{field:`oldPassword`,label:`原密码`,placeholder:`请输入原密码`,rules:[{required:!0,message:`请输入原密码`}],style:{width:320}}),/* @__PURE__ */ R(F,{field:`newPassword`,label:`新密码`,placeholder:`请输入新密码`,rules:[{required:!0,message:`请输入新密码`},...T?.minLength?[{min:T.minLength,message:`密码至少${T.minLength}个字符`}]:[]],style:{width:320},onChange:e=>c(String(e??``)),helpText:/* @__PURE__ */ R(re,{password:ie,policy:T})}),/* @__PURE__ */ R(F,{field:`confirmPassword`,label:`确认密码`,placeholder:`请再次输入新密码`,rules:[{required:!0,message:`请确认新密码`}],style:{width:320}}),/* @__PURE__ */ R(_.Slot,{children:/* @__PURE__ */ R(b,{htmlType:`submit`,type:`primary`,loading:K,children:`修改密码`})})]}),!1]})}),!1,/* @__PURE__ */ R(r.TabPane,{itemKey:`devices`,tab:/* @__PURE__ */ z(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ R(le,{size:14}),/* @__PURE__ */ R(`span`,{children:`我的设备`})]}),children:/* @__PURE__ */ z(`div`,{className:`profile-section`,children:[/* @__PURE__ */ z(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:20},children:[/* @__PURE__ */ R(`div`,{className:`section-title`,style:{margin:0},children:`在线设备`}),/* @__PURE__ */ R(b,{type:`danger`,theme:`light`,size:`small`,loading:J,icon:/* @__PURE__ */ R(fe,{size:14}),onClick:()=>{w({title:`确定要退出其他所有设备吗?`,content:`退出后其他设备将需要重新登录。`,onOk:lt})},children:`退出其他设备`})]}),/* @__PURE__ */ R(rt,{policy:p.data?.identitySecurity.session}),/* @__PURE__ */ R(it,{sessions:O,loading:q,onKick:ut})]})}),/* @__PURE__ */ R(r.TabPane,{itemKey:`login`,tab:/* @__PURE__ */ z(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ R(ue,{size:14}),/* @__PURE__ */ R(`span`,{children:`登录记录`})]}),children:/* @__PURE__ */ R(`div`,{className:`profile-section`,children:/* @__PURE__ */ R(se,{scope:Z,enabled:t===`login`,columnSettingsKey:`profile-login-logs`})})}),/* @__PURE__ */ R(r.TabPane,{itemKey:`operation`,tab:/* @__PURE__ */ z(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ R(ue,{size:14}),/* @__PURE__ */ R(`span`,{children:`操作记录`})]}),children:/* @__PURE__ */ R(`div`,{className:`profile-section`,children:/* @__PURE__ */ R(ae,{scope:Z,enabled:t===`operation`,columnSettingsKey:`profile-operation-logs`})})}),/* @__PURE__ */ R(r.TabPane,{itemKey:`api-tokens`,tab:/* @__PURE__ */ z(`span`,{className:`profile-tab-label`,children:[/* @__PURE__ */ R(G,{size:14}),/* @__PURE__ */ R(`span`,{children:`API Token`})]}),children:/* @__PURE__ */ z(`div`,{className:`profile-section`,children:[/* @__PURE__ */ z(`div`,{style:{display:`flex`,justifyContent:`space-between`,alignItems:`center`,marginBottom:8},children:[/* @__PURE__ */ R(`div`,{className:`section-title`,style:{margin:0},children:`API Token`}),/* @__PURE__ */ R(b,{type:`primary`,size:`small`,icon:/* @__PURE__ */ R(me,{size:14}),onClick:H.openCreate,children:`新建 Token`})]}),/* @__PURE__ */ z(Y,{type:`tertiary`,size:`small`,style:{display:`block`,marginBottom:16},children:[`Token 可通过 `,/* @__PURE__ */ R(`code`,{children:`Authorization: Bearer YOUR_TOKEN`}),` 头访问 API,每人最多 20 个。`]}),at?/* @__PURE__ */ R(`div`,{style:{textAlign:`center`,padding:40},children:/* @__PURE__ */ R(C,{})}):/* @__PURE__ */ R(te,{...be(g),columns:[{title:`名称`,dataIndex:`name`,minWidth:150,render:e=>/* @__PURE__ */ R(Y,{strong:!0,children:e})},{title:`Token 前缀`,dataIndex:`tokenPrefix`,width:160,render:e=>/* @__PURE__ */ R(`code`,{style:{fontSize:12},children:e})},k(`最后使用`,`lastUsedAt`,{empty:`未使用`}),k(`过期时间`,`expiresAt`,{empty:`永久有效`}),xe,{title:`操作`,dataIndex:`id`,width:80,fixed:`right`,render:e=>/* @__PURE__ */ R(b,{theme:`borderless`,type:`danger`,size:`small`,onClick:()=>{w({title:`确定要撤销该 Token 吗?`,content:`撤销后将无法恢复,使用该 Token 的调用将立即失效。`,onOk:()=>dt(e)})},children:`撤销`})}]})]})}),!1]})}),/* @__PURE__ */ R(oe,{visible:o,currentAvatar:e.avatar,confirmLoading:j.isPending,uploadBlob:Ie,onCancel:()=>s(!1),onSelect:e=>void mt(e),onRemove:e.avatar?pt:void 0}),!1,/* @__PURE__ */ z(Ce,{modal:H,title:`新建 API Token`,okText:`创建`,cancelText:`取消`,width:480,centered:!0,children:[/* @__PURE__ */ R(_.Input,{field:`name`,label:`名称`,placeholder:`如:本地开发、CI/CD 环境`,rules:[{required:!0,message:`请填写 Token 名称`}],style:{width:`100%`}}),/* @__PURE__ */ R(_.Select,{field:`permissions`,label:`权限范围`,multiple:!0,filter:!0,optionList:(v.data??[]).map(e=>({label:e,value:e})),rules:[{required:!0,message:`请选择权限`}],style:{width:`100%`},extraText:`密钥权限不会超过账号当前权限;权限撤销、停用和改密后立即失效。`}),/* @__PURE__ */ R(_.DatePicker,{field:`expiresAt`,label:`过期时间`,type:`dateTime`,placeholder:`不填则永久有效`,style:{width:`100%`},disabledDate:e=>!!e&&e</* @__PURE__ */ new Date})]}),/* @__PURE__ */ z(ee,{title:`Token 创建成功`,visible:!!l,closeOnEsc:!0,onCancel:()=>u(null),footer:/* @__PURE__ */ R(b,{type:`primary`,onClick:()=>u(null),children:`关闭`}),width:520,centered:!0,children:[/* @__PURE__ */ R(Y,{type:`warning`,style:{display:`block`,marginBottom:12,padding:`8px 12px`,background:`var(--arc-antd-color-warning-light-default)`,borderRadius:`var(--arc-antd-border-radius-medium)`},children:`⚠️ 请立即复制并安全保存此 Token,关闭后将无法再次查看完整内容。`}),l&&/* @__PURE__ */ z(`div`,{className:`token-display`,children:[/* @__PURE__ */ R(`code`,{style:{flex:1,wordBreak:`break-all`,fontSize:12,lineHeight:1.6},children:l.token}),/* @__PURE__ */ R(b,{icon:R(d?ne:ce,{size:14}),type:d?`tertiary`:`primary`,onClick:()=>ft(l.token),style:{flexShrink:0},children:d?`已复制`:`复制`})]})]})]})}var ot,Y,X,Z;function Q(){return(Q=e((()=>{P(),_e(),h(),J(),d(),m(),K(),de(),g(),u(),ie(),l(),N(),f(),E(),s(),i(),I(),T(),ve(),M(),O(),A(),c(),j(),{Title:ot,Text:Y}=t,X={color:`var(--arc-antd-color-primary)`,backgroundColor:`var(--arc-antd-color-primary-light-default)`,borderColor:`transparent`},Z={kind:`self`}})))()}Q();export{at as default};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,t as n}from"./preload-helper-C-73SErw.js";import{c as r,n as i,o as a,t as o}from"./controls-C5dPckUT.js";import{t as s}from"./typography-DKK_iHcj.js";import{i as c}from"./feedback-D4BIfDNd.js";import{r as l}from"./media-DoGe_p4O.js";import{n as u,o as d,r as f,t as p}from"./search-filters-BoRMIesR.js";import{n as m,t as h}from"./createLucideIcon-BtwfYE6A.js";import{n as g,t as _}from"./activity-DBu4axwF.js";import{n as v,t as y}from"./circle-check-RKAno__V.js";import{n as b,t as ee}from"./download--5IybXxz.js";import{i as x,n as S,r as te,t as ne}from"./eye-DNBTmA6c.js";import{n as C,t as w}from"./funnel-BwQjQI4Y.js";import{a as T,i as E,r as D,t as O}from"./EntityRelationButton-C8Cl8wyh.js";import{n as k,t as re}from"./plus-Bvdn6bx1.js";import{n as A,t as j}from"./refresh-cw-Dz8O9-Hp.js";import{n as ie,t as ae}from"./rotate-ccw-D2__Zisi.js";import{n as oe,t as se}from"./x-Ak9hw1R9.js";import{n as M,t as N}from"./list-0CbyOlT9.js";import{C as P,_ as F,a as I,b as ce,d as L,h as le,v as R,w as z}from"./ui-DoIHGuTR.js";import{r as ue,t as de}from"./deleteAction-NGTDhZud.js";import{n as fe,t as pe}from"./DateTimeText-rk9NeYgA.js";import{S as me,a as he,d as ge,i as _e,n as ve,t as ye}from"./file-utils-DJ9ksj-g.js";import{n as be,t as xe}from"./AppModal-B_xvSaeq.js";import{n as Se,t as Ce}from"./FilePreviewModal-D7v5seXB.js";import{Suspense as we,lazy as Te,useCallback as B,useContext as Ee,useEffect as V,useId as De,useMemo as Oe,useRef as H,useState as U}from"react";import{Fragment as ke,jsx as W,jsxs as G}from"react/jsx-runtime";import{Upload as K}from"antd";import{formatBytes as Ae}from"@fudanda/shared/core";import{goTransport as je}from"@fudanda/react-core/lib/go-transport";import{useLocation as Me,useNavigate as Ne}from"react-router-dom";import{contractKey as Pe,urlOf as Fe,useApiQuery as Ie}from"@fudanda/react-core/lib/contract-query";import{useFilterQuery as Le}from"@fudanda/react-core/hooks/useFilterQuery";import{useListSearch as Re}from"@fudanda/react-core/hooks/useListSearch";import{formatDateTime as q,formatDateTimeRangeForApi as ze}from"@fudanda/react-core/utils/date";import{useQueryClient as Be}from"@tanstack/react-query";import{MANUAL_RELATION_OPTIONS as Ve,SEARCH_TYPE_ENTITY_TYPES as He,businessFileContract as Ue,entityRelationsContract as We,fileContract as Ge,supportsEntityRelations as Ke}from"@fudanda/shared/platform";import{config as qe}from"@fudanda/react-core/config";import{request as Je}from"@fudanda/react-core/utils/request";import{useGlobalSearch as Ye}from"@fudanda/react-core/hooks/queries/global-search";import{useEntityAccessKey as Xe,useEntityRelationSection as Ze,useEntityRelations as Qe,useEntityWorkflowAttachment as $e,useLinkEntity as et,useUnlinkEntity as tt}from"@fudanda/react-core/hooks/queries/entity-relations";import{entityDetailRoute as nt,entityRelationKindLabel as rt,entityRelationLabel as it,entityStatusLabel as at,entityTypeLabel as J}from"@fudanda/react-core/utils/entity-relations";import{EntityNavigationContext as ot,EntityRelationViewStateContext as st,beginEntityRelationNavigation as ct,entityRelationSourceUrl as lt}from"@fudanda/react-core/components/entity-relations/entity-navigation";import{createDisplayableImageUrl as ut}from"@fudanda/react-core/utils/image-decode";var dt,ft;function pt(){return(pt=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
m(),dt={name:`circle-alert`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`]},dt.node,ft=h(dt)})))()}var mt,ht;function gt(){return(gt=e((()=>{
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v1.53.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
m(),mt={name:`circle-off`,size:24,node:[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M8.35 2.69A10 10 0 0 1 21.3 15.65`,key:`1pfsoa`}],[`path`,{d:`M19.08 19.08A10 10 0 1 1 4.92 4.92`,key:`1ablyi`}]]},mt.node,ht=h(mt)})))()}var _t,vt;function yt(){return(yt=e((()=>{
|
|
16
|
-
/**
|
|
17
|
-
* @license lucide-react v1.53.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/
|
|
22
|
-
m(),_t={name:`circle-slash-2`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M22 2 2 22`,key:`y4kqgn`}]],aliases:[`circle-slashed`]},_t.node,vt=h(_t)})))()}var bt,xt;function St(){return(St=e((()=>{
|
|
23
|
-
/**
|
|
24
|
-
* @license lucide-react v1.53.0 - ISC
|
|
25
|
-
*
|
|
26
|
-
* This source code is licensed under the ISC license.
|
|
27
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
28
|
-
*/
|
|
29
|
-
m(),bt={name:`git-branch`,size:24,node:[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]},bt.node,xt=h(bt)})))()}var Ct,wt;function Tt(){return(Tt=e((()=>{
|
|
30
|
-
/**
|
|
31
|
-
* @license lucide-react v1.53.0 - ISC
|
|
32
|
-
*
|
|
33
|
-
* This source code is licensed under the ISC license.
|
|
34
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
-
*/
|
|
36
|
-
m(),Ct={name:`zap`,size:24,node:[[`path`,{d:`M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z`,key:`1v7up4`}]]},Ct.node,wt=h(Ct)})))()}function Y(e){return{...e,status:e.status===`done`?`success`:e.status===`error`?`uploadFail`:e.status===`uploading`?`uploading`:`wait`,fileInstance:e.originFileObj}}function Et({fileList:e,headers:t,listType:n,limit:r,showClear:i,beforeUpload:a,onProgress:o,onSuccess:s,onError:c,onChange:l,onExceed:u,onRemove:d,renderFileItem:f,...p}){let m=H(null),h=H(/* @__PURE__ */ new Map);V(()=>()=>{for(let e of h.current.values())e.abort();h.current.clear()},[]);let g=e=>{let t=new AbortController,n=e.file;h.current.set(n.uid,t);let r=new FormData;r.append(e.filename??`file`,n);for(let[t,n]of Object.entries(e.data??{}))r.append(t,String(n));return je.postForm(e.action,r,{signal:t.signal,headers:e.headers,onProgress:t=>e.onProgress?.({percent:t})}).then(n=>{if(!t.signal.aborted){if(n.code!==0)throw Error(n.message);e.onSuccess?.(n)}}).catch(n=>{t.signal.aborted||e.onError?.(n instanceof Error?n:Error(String(n)))}).finally(()=>{h.current.get(n.uid)===t&&h.current.delete(n.uid)}),{abort:()=>t.abort()}},_=async e=>{let n=e.originFileObj;if(!n||h.current.has(e.uid))return;let r=typeof p.action==`function`?await p.action(n):p.action;r&&(m.current?.onBatchStart?.([{file:n,parsedFile:n}]),g({file:n,action:r,method:p.method??`post`,filename:p.name??`file`,data:typeof p.data==`function`?await p.data(n):p.data,headers:typeof t==`function`?t():t,onProgress:e=>m.current?.onProgress({percent:e.percent??0},n),onSuccess:e=>m.current?.onSuccess(e,n,void 0),onError:e=>m.current?.onError(e instanceof Error?e:/* @__PURE__ */ Error(`上传失败`),void 0,n)}))};return/* @__PURE__ */ W(K,{...p,ref:m,customRequest:p.customRequest??g,withCredentials:!0,fileList:e?.map(e=>({...e,size:e.size===void 0?void 0:Number(e.size),originFileObj:e.fileInstance,status:e.status===`success`?`done`:e.status===`uploadFail`?`error`:`uploading`})),headers:typeof t==`function`?t():t,maxCount:r,beforeUpload:async t=>r&&(e?.length??0)>=r?(u?.(),K.LIST_IGNORE):!a||await a({file:Y({...t,originFileObj:t})})?!0:K.LIST_IGNORE,itemRender:f?(e,t,n,r)=>f({...Y(t),onRemove:r.remove,onRetry:()=>{_(t)}}):void 0,onChange:e=>{let t=e.fileList.map(Y),n=e.file.originFileObj;l?.({fileList:t}),n&&(e.file.status===`uploading`?o?.(e.file.percent??0,n,t):e.file.status===`done`?s?.(e.file.response,n,t):e.file.status===`error`&&c?.(e.file.error,n,t))},onRemove:t=>(h.current.get(t.uid)?.abort(),d?.(t.originFileObj??new File([],t.name),(e??[]).filter(e=>e.uid!==t.uid),Y(t)),!0)})}function Dt(){return(Dt=e((()=>{})))()}function Ot({entityRef:e,capabilities:t,children:n}){let r=Ne(),i=Me(),a=Ee(ot),o=JSON.stringify(Xe()),[c,l]=U(!1),u=n??`${J(e.type)} #${e.key}`;return t.view?t.open?/* @__PURE__ */ G(ke,{children:[/* @__PURE__ */ W(I,{theme:`borderless`,size:`small`,style:{maxWidth:`100%`,paddingLeft:0,justifyContent:`flex-start`},onClick:t=>{if(t.stopPropagation(),a){a(e);return}let n=nt(e);n?(ct({url:lt(i),locationKey:i.key,state:i.state,kind:`page`,pageScrollTop:document.querySelector(`.admin-content`)?.scrollTop??0},n,o,i.pathname),r(n)):l(!0)},children:/* @__PURE__ */ W(s.Text,{ellipsis:{showTooltip:!0},style:{color:`inherit`},children:u})}),c&&/* @__PURE__ */ W(we,{fallback:null,children:/* @__PURE__ */ W(O,{entityRef:e,onClose:()=>l(!1)})})]}):/* @__PURE__ */ W(s.Text,{children:u}):null}function kt(){return(kt=e((()=>{z(),D()})))()}function At({anchor:e,onClose:t}){let n=De(),[o,l]=U(``),[u,d]=U(`related`),[f,p]=U(``),[m,h]=U(null),g=Ye(o,!0,void 0,20),_=et(),v=(g.data?.results??[]).filter(t=>{if(t.actions?.view===!1)return!1;let n=He[t.type];return Ke(n)&&(n!==e.type||String(t.id)!==e.key)});return/* @__PURE__ */ G(xe,{title:`添加关联对象`,visible:!0,width:640,closeOnEsc:!0,onCancel:t,okText:`建立关联`,okButtonProps:{disabled:!m,loading:_.isPending},onOk:async()=>{m&&(await _.mutateAsync({params:e,body:{target:m.ref,relationType:u,note:f}}),c.success(`已建立关联`),t())},children:[/* @__PURE__ */ G(F,{vertical:!0,align:`start`,style:{width:`100%`,marginBottom:12},children:[/* @__PURE__ */ W(s.Text,{id:n,children:`关联类型`}),/* @__PURE__ */ W(a,{"aria-labelledby":n,value:u,optionList:Ve,onChange:e=>d(e),style:{width:180}}),/* @__PURE__ */ W(s.Text,{type:`tertiary`,children:`选择目标对象作为当前对象的相关对象、补充材料、参考依据或后续处理事项。`}),/* @__PURE__ */ W(r,{"aria-label":`关联说明`,value:f,onChange:p,placeholder:`关联说明(选填)`,maxCount:500,rows:2})]}),/* @__PURE__ */ W(i,{value:o,onChange:e=>{l(e),h(null)},placeholder:`搜索用户、订单、流程、内容或设备`,showClear:!0}),m&&/* @__PURE__ */ G(s.Paragraph,{style:{marginTop:12},children:[`已选择:`,J(m.ref.type),` · `,m.title]}),g.isFetching?/* @__PURE__ */ W(R,{style:{marginTop:16}}):o.trim().length<2?/* @__PURE__ */ W(L,{description:`输入至少 2 个字符查找对象`}):g.isError?/* @__PURE__ */ G(F,{children:[/* @__PURE__ */ W(s.Text,{type:`danger`,children:`搜索暂时不可用`}),/* @__PURE__ */ W(I,{onClick:()=>void g.refetch(),children:`重试`})]}):v.length===0?/* @__PURE__ */ W(L,{description:`没有找到可关联对象`}):/* @__PURE__ */ W(M,{size:`small`,split:!0,dataSource:v,style:{maxHeight:360,overflowY:`auto`},renderItem:e=>{let t={type:He[e.type],key:String(e.id)},n=m?.ref.type===t.type&&m.ref.key===t.key;return/* @__PURE__ */ W(M.Item,{extra:/* @__PURE__ */ W(I,{size:`small`,theme:n?`solid`:`borderless`,onClick:()=>h({ref:t,title:e.title}),children:n?`已选择`:`选择`}),main:/* @__PURE__ */ G(`div`,{style:{minWidth:0},children:[/* @__PURE__ */ W(s.Text,{strong:!0,children:e.title}),/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ G(s.Text,{type:`tertiary`,children:[J(t.type),e.subtitle?` · ${e.subtitle}`:``]})})]})},`${t.type}:${t.key}`)}})]})}function jt({anchor:e}){let[t,n]=U(!1);return/* @__PURE__ */ G(ke,{children:[/* @__PURE__ */ W(I,{size:`small`,theme:`borderless`,icon:/* @__PURE__ */ W(re,{size:14}),onClick:()=>n(!0),children:`添加关联`}),t&&/* @__PURE__ */ W(At,{anchor:e,onClose:()=>n(!1)})]})}function Mt(){return(Mt=e((()=>{z(),k(),be()})))()}function Nt({section:e,search:t}){let n=e.filters;return/* @__PURE__ */ G(F,{wrap:!0,spacing:8,style:{padding:`4px 0 12px`,width:`100%`},children:[n?.keyword&&/* @__PURE__ */ W(f,{"aria-label":`关联记录关键词`,placeholder:`搜索关联记录`,...t.bindKeyword(`keyword`),width:180}),!!n?.statusOptions?.length&&/* @__PURE__ */ W(u,{"aria-label":`关联记录状态`,placeholder:`全部状态`,items:n.statusOptions,...t.bind(`status`)}),n?.dateRange&&/* @__PURE__ */ W(p,{...t.bind(`range`)}),n?.attentionOnly&&/* @__PURE__ */ W(o,{checked:t.draftParams.attentionOnly,onChange:e=>t.setField(`attentionOnly`)(!!e.target.checked),children:`仅看需处理`}),/* @__PURE__ */ W(I,{size:`small`,onClick:t.handleSearch,children:`查询`}),/* @__PURE__ */ W(I,{size:`small`,theme:`borderless`,onClick:t.handleReset,children:`重置`})]})}function Pt(){return(Pt=e((()=>{z(),d()})))()}function Ft(e){return{uid:`attach-${e.id}`,name:e.file.originalName,size:String(e.file.size),status:`success`,url:e.file.url,...e}}function X(e){if(!e)return!1;let t=e;return typeof t.fileId==`string`&&t.file?.originalName!=null}function It(e,t){return{id:-Date.now(),fileId:e.id,file:{id:e.id,originalName:e.originalName,size:e.size,mimeType:e.mimeType??null,extension:e.extension??null,url:e.url},sortOrder:t,createdAt:e.createdAt||q(/* @__PURE__ */ new Date)}}function Lt(e){let t=e;return t?.code===0&&t.data?t.data:null}function Rt(e){let t=e;return typeof t?.code==`number`&&t.code!==0}function zt(e){return Vt.has(e.status)}function Bt({value:e=[],onChange:t,mode:n=`view`,limit:r=0,multiple:i=!0,maxSizeMB:a=50,accept:o,title:s=`附件`,showTitle:u=!0,uploadTip:d,style:f,disabled:p=!1,uploadPath:m=Fe(Ge.uploadOne),uploadData:h}={}){let g=n===`edit`&&!p,[_,v]=U(!1),[y,b]=U(null),[x,S]=U(null),te=`${qe.apiBaseUrl}${m}`,C=Oe(()=>e.filter(e=>e?.file!=null).map(Ft),[e]),[w,T]=U(C),E=H(e),D=H(/* @__PURE__ */ new Set),O=H(0);V(()=>{E.current=e,T(e=>{let t=g?e.filter(e=>!X(e)&&[`wait`,`validating`,`uploading`].includes(e.status)):[];return[...C,...t]})},[e,C,g]);let k=B((e,t,n)=>{let r=e.uid;if(t&&(O.current+=1),r&&D.current.delete(r),D.current.size>0||n.some(zt))return;let i=O.current;O.current=0,D.current.clear(),i>0?c.error(i===1?`1 个文件上传失败`:`${i} 个文件上传失败`):c.success(`上传成功`)},[]),A=B(e=>e,[]),j=B(async e=>{try{let t=await ve(e.file.url),n=globalThis.URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e.file.originalName,r.click(),globalThis.setTimeout(()=>globalThis.URL.revokeObjectURL(n),6e4)}catch{c.error(`下载文件失败`)}},[]),ie=B(async e=>{let t=me(e.file.mimeType,e.file.originalName);if(!t)await j(e);else if(ge(t,e.file.originalName))try{let n=await ve(e.file.url),r=await ut(n,t,e.file.originalName);S(r)}catch{c.error(`加载图片失败`)}else ye(t,e.file.originalName)?(b({id:e.file.id,url:e.file.url,name:e.file.originalName,mimeType:t}),v(!0)):await j(e)},[j]),oe=B(e=>{if(!X(e)){let t=Math.max(0,Math.min(100,Math.round(e.percent??0))),n=e.status===`uploading`||e.status===`wait`||e.status===`validating`,r=e.status===`uploadFail`,i=e.fileInstance?.size??Number(e.size),a=Number.isFinite(i)&&i>0?Ae(i):``;return/* @__PURE__ */ G(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 0`,borderBottom:`1px solid var(--arc-antd-color-border-light)`,width:`100%`},children:[_e(e.fileInstance?.type||null,18,e.name),/* @__PURE__ */ G(`div`,{style:{flex:1,minWidth:0},children:[/* @__PURE__ */ W(Z,{size:`small`,style:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:e.name||`上传中...`}),/* @__PURE__ */ G(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,marginTop:4},children:[a&&/* @__PURE__ */ W(Z,{type:`tertiary`,size:`small`,children:a}),n&&/* @__PURE__ */ W(`div`,{style:{flex:1,minWidth:80},children:/* @__PURE__ */ W(le,{percent:t,size:`small`,showInfo:!1})}),/* @__PURE__ */ W(Z,{type:r?`danger`:`tertiary`,size:`small`,children:r?`上传失败`:n?`${t}%`:``})]})]}),/* @__PURE__ */ G(F,{children:[g&&r&&/* @__PURE__ */ W(I,{"aria-label":`重试上传 ${e.name||`文件`}`,theme:`borderless`,type:`primary`,icon:/* @__PURE__ */ W(ae,{size:12}),size:`small`,onClick:t=>{t.stopPropagation(),D.current.add(e.uid),e.onRetry?.()}}),g&&/* @__PURE__ */ W(I,{"aria-label":`移除 ${e.name||`文件`}`,theme:`borderless`,type:`danger`,icon:/* @__PURE__ */ W(se,{size:12}),size:`small`,onClick:t=>{t.stopPropagation(),e.onRemove?.()}})]})]},e.uid)}let t=A(e),n=t.file.size?Ae(t.file.size):``;return/* @__PURE__ */ G(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,padding:`8px 0`,borderBottom:`1px solid var(--arc-antd-color-border-light)`,width:`100%`},children:[_e(t.file.mimeType,18,t.file.originalName),/* @__PURE__ */ G(`div`,{style:{flex:1,minWidth:0},children:[/* @__PURE__ */ W(Z,{size:`small`,style:{display:`block`,overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:t.file.originalName}),/* @__PURE__ */ W(Z,{type:`tertiary`,size:`small`,children:n})]}),/* @__PURE__ */ G(F,{children:[/* @__PURE__ */ W(I,{"aria-label":`预览 ${t.file.originalName}`,theme:`borderless`,type:`primary`,icon:/* @__PURE__ */ W(ne,{size:12}),size:`small`,onClick:e=>{e.stopPropagation(),ie(t)}}),/* @__PURE__ */ W(I,{"aria-label":`下载 ${t.file.originalName}`,theme:`borderless`,type:`primary`,icon:/* @__PURE__ */ W(ee,{size:12}),size:`small`,onClick:e=>{e.stopPropagation(),j(t)}}),g&&/* @__PURE__ */ W(I,{"aria-label":`移除 ${t.file.originalName}`,theme:`borderless`,type:`danger`,icon:/* @__PURE__ */ W(se,{size:12}),size:`small`,onClick:t=>{t.stopPropagation(),e.onRemove?.()}})]})]},e.uid)},[A,ie,j,g]),M=B((e,n,r)=>{let i=e;if(i?.code!==0||!i.data){let t=n.uid,i=r.map(n=>n.uid===t?{...n,status:`uploadFail`,response:e}:n);T(i),k(n,!0,i);return}let a=It(i.data,E.current.length),o=Ft(a),s=[...E.current.filter(e=>e.fileId!==a.fileId),a];E.current=s;let c=r.map(t=>t.response===e||t.uid===n.uid?o:t);T(c),t?.(s),k(n,!1,c)},[k,t]),N=B(({fileList:e})=>{let t=E.current.length;T(e.map(e=>{if(X(e))return e;let n=Lt(e.response);return!n&&Rt(e.response)?{...e,status:`uploadFail`}:n?Ft(E.current.find(e=>e.fileId===n.id)??It(n,t++)):e}))},[]),P=B(({file:e})=>(e.fileInstance?.size??Number(e.size))>a*1024*1024?(c.warning(`${e.name} 超过 ${a}MB,已跳过`),!1):r>0&&w.length>=r?(c.warning(`最多上传 ${r} 个文件`),!1):(D.current.add(e.uid),!0),[a,r,w.length]),ce=B((e,t,n)=>{T(n)},[]),L=B((e,t,n)=>{T(n),k(t,!0,n)},[k]),R=B(()=>{r>0&&c.warning(`最多上传 ${r} 个文件`)},[r]),z=B(e=>{if(!e)return;if(!X(e)){T(t=>t.filter(t=>t.uid!==e.uid));return}let n=A(e),r=E.current.filter(e=>e.id!==n.id);E.current=r,T(t=>t.filter(t=>t.uid!==e.uid)),t?.(r)},[t,A]);return/* @__PURE__ */ G(`div`,{style:f,children:[u&&/* @__PURE__ */ G(`div`,{style:{marginBottom:8,fontSize:14,fontWeight:500},children:[s,e.length>0&&/* @__PURE__ */ G(Z,{type:`tertiary`,size:`small`,style:{marginLeft:4},children:[`(`,e.length,`)`]})]}),/* @__PURE__ */ W(Et,{action:te,data:h,headers:()=>Je.authHeaders(),name:`file`,fileList:w,listType:`list`,accept:o,limit:r>0?r:void 0,multiple:i,beforeUpload:g?P:void 0,onProgress:g?ce:void 0,onSuccess:g?M:void 0,onChange:g?N:void 0,onError:g?L:void 0,onExceed:g?R:void 0,onRemove:g?(e,t,n)=>z(n):void 0,renderFileItem:oe,disabled:!g,showClear:!1,children:g&&(r===0||w.length<r)&&/* @__PURE__ */ W(I,{theme:`light`,icon:/* @__PURE__ */ W(re,{size:14}),children:d||`上传文件`})}),y&&/* @__PURE__ */ W(Ce,{visible:_,fileUrl:y.url,fileName:y.name,mimeType:y.mimeType,onClose:()=>{v(!1),b(null)},onFallback:()=>{v(!1),b(null)}}),x&&/* @__PURE__ */ W(l,{src:x,visible:!!x,onVisibleChange:e=>{e||S(null)}})]})}var Z,Vt;function Q(){return(Q=e((()=>{z(),k(),b(),oe(),S(),ie(),he(),Se(),{Text:Z}=s,Vt=/* @__PURE__ */ new Set([`wait`,`validating`,`uploading`])})))()}function Ht({fileId:e}){let t=Ie(Ue.managedDetail,{params:{fileId:e}},{retry:!1});if(t.isLoading)return/* @__PURE__ */ W(R,{size:`small`});if(!t.data||t.isError)return/* @__PURE__ */ G(F,{children:[/* @__PURE__ */ W(s.Text,{type:`danger`,children:`附件不可用或无权查看`}),/* @__PURE__ */ W(I,{onClick:()=>void t.refetch(),children:`重试`})]});let n=t.data;return/* @__PURE__ */ W(Bt,{mode:`view`,showTitle:!1,value:[{id:0,fileId:n.id,sortOrder:0,createdAt:n.createdAt,file:n}]})}function Ut(){return(Ut=e((()=>{z(),Q()})))()}function Wt({id:e}){let t=$e(e);if(t.isLoading)return/* @__PURE__ */ W(R,{size:`small`});if(!t.data||t.isError)return/* @__PURE__ */ G(F,{children:[/* @__PURE__ */ W(s.Text,{type:`danger`,children:`附件不可用或无权查看`}),/* @__PURE__ */ W(I,{onClick:()=>void t.refetch(),children:`重试`})]});let n=t.data;return/* @__PURE__ */ W(Bt,{mode:`view`,showTitle:!1,value:[{id:n.id,fileId:n.fileId,sortOrder:0,createdAt:``,file:{id:n.fileId,originalName:n.name,size:n.size,mimeType:n.mimeType,extension:n.name.includes(`.`)?n.name.split(`.`).at(-1):null,url:n.url}}]})}function Gt(){return(Gt=e((()=>{z(),Q()})))()}function Kt({section:e,summaryState:t}){let n=it(e.labelKey,e.targetTypes),r=en[t],i=`${n}:${r.label}`,a=r.Icon,o=$[e.kind],s=o.Icon,c=`关联来源:${rt(e.kind)}`;return/* @__PURE__ */ G(F,{spacing:6,children:[/* @__PURE__ */ W(P,{content:i,children:/* @__PURE__ */ W(`span`,{role:`img`,"aria-label":i,style:{color:r.color,display:`inline-flex`},children:/* @__PURE__ */ W(a,{size:15,"aria-hidden":`true`})})}),/* @__PURE__ */ W(P,{content:c,children:/* @__PURE__ */ W(`span`,{role:`img`,"aria-label":c,style:{color:o.color,display:`inline-flex`},children:/* @__PURE__ */ W(s,{size:14,"aria-hidden":`true`})})}),/* @__PURE__ */ W(`span`,{children:n})]})}function qt({section:e,item:t}){let n=t.origin?.kind??e.kind,r=$[n],i=r.Icon,a=[`关联来源:${rt(n)}`];t.origin?.explanation&&a.push(t.origin.explanation),t.origin?.eventType&&a.push(`来源事件:${t.origin.eventType}`),t.origin?.relatedAt&&a.push(`关联建立时间:${q(t.origin.relatedAt)}`),t.manual?.createdByName&&a.push(`建立人:${t.manual.createdByName}`),t.occurredAt&&a.push(`记录时间:${q(t.occurredAt)}`);let o=a.join(` · `);return/* @__PURE__ */ W(P,{content:o,children:/* @__PURE__ */ W(`span`,{role:`img`,"aria-label":o,style:{color:r.color,display:`inline-flex`},children:/* @__PURE__ */ W(i,{size:14,"aria-hidden":`true`})})})}function Jt({entityType:e,entityKey:t,section:n,active:r,canManageLinks:i,onSummaryStateChange:a,query:o,filtered:c,filters:l,filterToggle:u}){let d=tt(),f=Be(),p=()=>{o.refetch(),f.invalidateQueries({queryKey:Pe(We.describe,{params:{type:e,key:t}})})},m=o.data?.pages??[],h=m.flatMap(e=>e.items).filter(e=>e.capabilities.view),g=m.some(e=>e.degraded),_=o.isError,v=o.data!==void 0;V(()=>{!r||o.isFetching||c||(_||g?a(n.key,`unavailable`):v&&a(n.key,h.length>0?n.summaryState===`attention`?`attention`:`has-data`:o.hasNextPage?`unavailable`:`empty`))},[r,g,c,v,h.length,a,o.hasNextPage,o.isFetching,n.key,n.summaryState,_]);let y=it(n.labelKey,n.targetTypes);return/* @__PURE__ */ G(`div`,{style:{position:`relative`},children:[u&&/* @__PURE__ */ W(`span`,{style:{position:`absolute`,top:0,right:32,zIndex:1,lineHeight:0},children:u}),/* @__PURE__ */ W(`span`,{style:{position:`absolute`,top:0,right:0,zIndex:1,lineHeight:0},children:/* @__PURE__ */ W(P,{content:`刷新${y}`,children:/* @__PURE__ */ W(I,{size:`small`,theme:`borderless`,icon:/* @__PURE__ */ W(j,{size:14}),loading:o.isFetching,"aria-label":`刷新${y}`,onClick:e=>{e.stopPropagation(),p()}})})}),/* @__PURE__ */ G(`div`,{style:{paddingTop:4,paddingRight:u?64:32},children:[l,(o.isError||g)&&/* @__PURE__ */ G(F,{wrap:!0,spacing:8,children:[/* @__PURE__ */ W(s.Text,{type:`danger`,children:g?`部分关联记录暂时不可用`:`关联记录加载失败`}),/* @__PURE__ */ W(I,{size:`small`,onClick:()=>void(o.isFetchNextPageError?o.fetchNextPage():o.refetch()),children:`重试`})]}),v&&!_&&!g&&h.length===0&&/* @__PURE__ */ W(L,{description:o.hasNextPage?`继续加载以查找可见的匹配记录`:c?`没有符合筛选条件的关联记录`:`暂无关联记录`}),h.length>0&&/* @__PURE__ */ W(M,{size:`small`,split:!0,dataSource:h,renderItem:r=>/* @__PURE__ */ W(M.Item,{extra:/* @__PURE__ */ G(F,{spacing:8,children:[r.action&&/* @__PURE__ */ W(Ot,{entityRef:r.action.target,capabilities:r.capabilities,children:r.action.label}),i&&n.labelKey===`relation.common.related`?/* @__PURE__ */ W(I,{size:`small`,theme:`borderless`,type:`danger`,disabled:d.isPending,onClick:()=>de({title:`解除与「${r.title}」的关联?`,okText:`解除关联`,successMessage:`已解除关联`,run:()=>d.mutateAsync({params:{type:e,key:t},body:{target:r.ref,relationType:r.manual?.type,direction:r.manual?.direction}})}),children:`解除`}):null]}),main:/* @__PURE__ */ G(`div`,{style:{minWidth:0},children:[/* @__PURE__ */ G(F,{wrap:!0,spacing:8,children:[/* @__PURE__ */ W(Ot,{entityRef:r.ref,capabilities:{view:r.capabilities.view&&n.capabilities.view,open:r.capabilities.open&&n.capabilities.open},children:r.title}),/* @__PURE__ */ W(qt,{section:n,item:r}),at(r.status)&&/* @__PURE__ */ W(ce,{size:`small`,children:at(r.status)})]}),r.subtitle&&/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(s.Text,{type:`tertiary`,children:r.subtitle})}),r.description&&/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(s.Text,{type:`tertiary`,children:r.description})}),r.occurredAt&&/* @__PURE__ */ W(`div`,{children:/* @__PURE__ */ W(s.Text,{type:`tertiary`,children:/* @__PURE__ */ W(pe,{value:r.occurredAt})})})]})},`${r.ref.type}:${r.ref.key}:${r.manual?.type??``}:${r.manual?.direction??``}`)}),o.hasNextPage&&/* @__PURE__ */ W(I,{size:`small`,loading:o.isFetchingNextPage,onClick:()=>void o.fetchNextPage(),children:`加载更多`})]})]})}function Yt({entityType:e,entityKey:t,section:n,active:r,summaryState:i,canManageLinks:a,onSummaryStateChange:o}){let s=Re({defaults:Qt,listKey:Pe(We.section,{params:{type:e,key:t,sectionKey:n.key},query:{}})}),c=Le({keyword:s.submittedParams.keyword,status:s.submittedParams.status,...ze(s.submittedParams.range),attentionOnly:s.submittedParams.attentionOnly?!0:void 0}),l=Object.keys(c).length>0,[u,d]=U(l),f=!!(n.filters?.keyword||n.filters?.dateRange||n.filters?.attentionOnly||n.filters?.statusOptions?.length),p=Ze(e,t,n.key,r,5,c);return/* @__PURE__ */ W(N.Panel,{itemKey:n.key,header:/* @__PURE__ */ W(Kt,{section:n,summaryState:i}),children:/* @__PURE__ */ W(Jt,{entityType:e,entityKey:t,section:n,active:r,canManageLinks:a,onSummaryStateChange:o,query:p,filtered:l,filters:f&&u?/* @__PURE__ */ W(Nt,{section:n,search:s}):void 0,filterToggle:f?/* @__PURE__ */ W(P,{content:`筛选关联记录`,children:/* @__PURE__ */ W(I,{size:`small`,theme:l?`light`:`borderless`,"aria-label":`筛选关联记录`,"aria-expanded":u,icon:/* @__PURE__ */ W(w,{size:14}),onClick:()=>d(e=>!e)})}):void 0})},n.key)}function Xt({entityType:e,entityKey:t,sections:n,canManageLinks:r,hideEmpty:i}){let a=Ee(st),[o,s]=U([]),c=a?.expandedGroups??o,l=a?.setExpandedGroups??s,u=Oe(()=>Object.fromEntries(n.map(e=>[e.key,e.summaryState])),[n]),[d,f]=U(()=>Object.fromEntries(n.map(e=>[e.key,e.summaryState])));V(()=>{f(u)},[u]);let p=B((e,t)=>{f(n=>n[e]===t?n:{...n,[e]:t})},[]);return/* @__PURE__ */ W(N,{activeKey:c,onChange:e=>l(Array.isArray(e)?e.map(String):[String(e)]),children:n.filter(e=>e.capabilities.view&&(!i||(d[e.key]??e.summaryState)!==`empty`)).map(n=>/* @__PURE__ */ W(Yt,{entityType:e,entityKey:t,section:n,active:c.includes(n.key),summaryState:d[n.key]??`unavailable`,canManageLinks:r,onSummaryStateChange:p},n.key))})}function Zt({entityType:e,entityKey:t,enabled:n=!0,showAnchor:r=!1}){let i=Qe(e,t,n),a=Xe(),o=Re({defaults:{hideEmpty:!1},listKey:[`entity-relation-display`,e,t,a],refetchOnSearch:!1});if(!n||!t)return null;if(i.isLoading)return/* @__PURE__ */ W(R,{size:`small`});if(i.isError)return/* @__PURE__ */ G(F,{wrap:!0,children:[/* @__PURE__ */ W(s.Text,{type:`danger`,children:`对象不可用或关联信息加载失败`}),/* @__PURE__ */ W(I,{size:`small`,onClick:()=>void i.refetch(),children:`重试`})]});let c=i.data?.sections??[];return/* @__PURE__ */ G(`div`,{style:{paddingTop:12},children:[r&&i.data&&/* @__PURE__ */ W(s.Title,{heading:6,children:i.data.anchor.title}),e===`workflow.archive`&&i.data&&/* @__PURE__ */ W(we,{fallback:/* @__PURE__ */ W(R,{size:`small`}),children:/* @__PURE__ */ W($t,{instanceId:Number(t),source:`archive`,children:`查看归档原件`})}),e===`workflow.attachment`&&i.data&&/* @__PURE__ */ W(Wt,{id:Number(t)}),e===`platform.managed-file`&&i.data&&/* @__PURE__ */ W(Ht,{fileId:t}),/* @__PURE__ */ G(F,{spacing:8,style:{marginBottom:8},children:[!1,i.data?.canManageLinks&&/* @__PURE__ */ W(jt,{anchor:{type:e,key:t}},`manager:${e}:${t}:${JSON.stringify(a)}`),/* @__PURE__ */ W(P,{content:o.submittedParams.hideEmpty?`显示空分组`:`隐藏空分组`,children:/* @__PURE__ */ W(I,{size:`small`,theme:o.submittedParams.hideEmpty?`light`:`borderless`,"aria-label":`隐藏空分组`,"aria-pressed":o.submittedParams.hideEmpty,icon:/* @__PURE__ */ W(te,{size:14}),onClick:()=>o.applySearch({hideEmpty:!o.submittedParams.hideEmpty})})})]}),c.length===0?/* @__PURE__ */ W(L,{description:`暂无可见关联信息`}):/* @__PURE__ */ W(Xt,{entityType:e,entityKey:t,sections:c,canManageLinks:i.data?.canManageLinks??!1,hideEmpty:o.submittedParams.hideEmpty},`groups:${e}:${t}:${JSON.stringify(a)}`)]})}var Qt,$t,en,$;function tn(){return(tn=e((()=>{z(),g(),pt(),v(),gt(),yt(),x(),C(),St(),T(),A(),Tt(),fe(),kt(),Mt(),ue(),Pt(),Ut(),Gt(),t(),Qt=()=>({keyword:``,status:void 0,range:null,attentionOnly:!1}),$t=Te(()=>n(()=>import(`./WorkflowPrintButton-BVa-xw-8.js`),[],import.meta.url)),en={"has-data":{label:`有记录`,Icon:y,color:`var(--arc-antd-color-success)`},empty:{label:`暂无记录`,Icon:vt,color:`var(--arc-antd-color-tertiary)`},attention:{label:`需处理`,Icon:ft,color:`var(--arc-antd-color-warning)`},unavailable:{label:`暂不可用`,Icon:ht,color:`var(--arc-antd-color-danger)`}},$={direct:{Icon:E,color:`var(--arc-antd-color-primary)`},derived:{Icon:xt,color:`var(--arc-antd-color-info)`},causal:{Icon:wt,color:`var(--arc-antd-color-warning)`},activity:{Icon:_,color:`var(--arc-antd-color-tertiary)`}}})))()}export{tn as n,Dt as r,Zt as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{i as t,r as n}from"./feedback-D4BIfDNd.js";import{c as ee,l as r,n as i,t as te}from"./ConfigurableTable-CyfZLgG0.js";import{o as a,t as ne}from"./search-filters-BoRMIesR.js";import{r as re,s as o}from"./toolbar-controls-BFOuV86W.js";import{t as s}from"./form-DhQiOMvp.js";import{v as c,w as l}from"./ui-DoIHGuTR.js";import{n as ie,t as u}from"./useStatusToggle-B7KSIN75.js";import{n as ae,t as d}from"./useCrudOperationColumn-PObQMk2y.js";import{n as oe,t as f}from"./useListPage-1Upr_ala.js";import{i as p,n as se,s as m}from"./table-columns-XaoxVUJN.js";import{a as ce,i as h,r as g,t as le}from"./EditFormModal-D68dOnaj.js";import{n as _,t as ue}from"./ModalFooter-vXDpmYTM.js";import{n as v,t as y}from"./AppModal-B_xvSaeq.js";import{n as b,t as de}from"./ExportButton-D4IvZKHy.js";import{i as x,n as S,r as fe,t as pe}from"./UserTransferSelect-S-GUw2Y9.js";import{a as C,i as me,n as he,r as w}from"./DataScopePanel-CubtBhTT.js";import{useEffect as T,useMemo as E,useState as D}from"react";import{jsx as O,jsxs as k}from"react/jsx-runtime";import{enumValueOf as ge}from"@fudanda/shared/core";import{useDictItems as _e}from"@fudanda/react-core/hooks/useDictItems";import{usePermission as ve}from"@fudanda/react-core/hooks/usePermission";import{useAllUsers as ye}from"@fudanda/react-core/hooks/queries/users";import{useMenuTree as A}from"@fudanda/react-core/hooks/queries/menus";import{DATA_SCOPES as j,roleContract as M}from"@fudanda/shared/identity";import{departmentTreeToTreeData as N,useDepartmentTree as P}from"@fudanda/react-core/hooks/queries/departments";import{useAssignRoleMenus as be,useAssignRoleUsers as xe,useDeleteRoles as Se,useRoleDetail as F,useRoleList as Ce,useRoleUsers as we,useSaveRole as I,useUpdateRoleDataScope as Te}from"@fudanda/react-core/hooks/queries/roles";function L(){let{hasPermission:e}=ve(),{options:r}=_e(`common_status`),i=oe({contract:M,useList:Ce}),{tableProps:a,filterQuery:o}=i,[l,u]=D(!1),[d,f]=D(null),[p,h]=D([]),[g,_]=D(!1),[v,b]=D(null),[x,S]=D([]),[C,w]=D(!1),[L,R]=D(null),[z,B]=D(`all`),[V,H]=D([]),U=A({enabled:l}),W=F(d?.id,l),G=ye({enabled:g}),K=we(v?.id,g),q=F(L?.id,C),J=P(),Y=E(()=>J.data??[],[J.data]),Ee=I(),X=ce({entityName:`角色`,save:Ee,useDetail:F,defaults:{status:`enabled`},toValues:e=>({name:e.name,code:e.code,description:e.description??void 0,deptScopeIds:e.deptScopeIds,status:e.status})}),De=X.editing,Oe=I(),ke=Se(),Z=be(),Q=xe(),$=Te(),Ae=ie({toggle:(e,t)=>Oe.mutateAsync({id:e.id,values:{status:t?`enabled`:`disabled`}}),confirmDisable:e=>({danger:!0,title:`确认禁用角色「${e.name}」?`,content:`禁用后持有该角色的用户将不能登录。`,okText:`确认禁用`}),disabled:t=>t.code===`super_admin`||!e(`system:role:update`),messages:{disabled:`已禁用`}});T(()=>{l&&h(W.data?.menuIds??[])},[l,W.data]),T(()=>{g&&S((K.data??[]).map(e=>e.id))},[g,K.data]),T(()=>{C&&q.data&&H(q.data.deptScopeIds??[])},[C,q.data]);let je=e=>{f(e),u(!0)},Me=async()=>{d&&(await Z.mutateAsync({params:{id:d.id},body:{menuIds:p}}),t.success(`菜单权限已更新`),u(!1))},Ne=E(()=>{let e=[],t=n=>{n.forEach(n=>{e.push(n),n.children&&t(n.children)})};return t(Y),e},[Y]),Pe=E(()=>G.data??[],[G.data]),Fe=e=>{b(e),_(!0)},Ie=async()=>{v&&(await Q.mutateAsync({params:{id:v.id},body:{userIds:x}}),t.success(`用户分配已更新`),_(!1))},Le=e=>{R(e),B(e.dataScope??`all`),H([]),w(!0)},Re=async()=>{if(!L)return;let e=ge(j,z)??`all`;await $.mutateAsync({params:{id:L.id},body:e===`custom`?{dataScope:e,deptScopeIds:V}:{dataScope:e}}),t.success(`数据权限已更新`),w(!1)},ze=ae({permission:`system:role`,edit:X,remove:ke,title:`确认删除此角色?`,disabled:{remove:e=>e.code===`super_admin`,reason:`超级管理员角色不允许删除`},extraBetween:t=>[{key:`menu`,label:`菜单权限`,hidden:!e(`system:role:assign`),onClick:()=>je(t)}],extraAfter:t=>[{key:`users`,label:`分配用户`,hidden:!e(`system:role:assign`),onClick:()=>Fe(t)},{key:`dataScope`,label:`数据权限`,hidden:!e(`system:role:update`),onClick:()=>Le(t)}],width:260,desktopInlineKeys:[`edit`,`menu`,`delete`]}),Be=[{title:`角色名称`,dataIndex:`name`,width:160,render:m},{title:`角色编码`,dataIndex:`code`,width:160,render:m},{title:`描述`,dataIndex:`description`,minWidth:200,render:(e,t)=>m(t.description)},{title:`数据权限`,dataIndex:`dataScope`,width:140,align:`center`,render:e=>({all:`全部数据`,dept:`本部门及以下`,self:`仅本人数据`})[e]??e},{title:`用户`,dataIndex:`userPreview`,width:180,render:(e,t)=>/* @__PURE__ */ O(fe,{preview:t.userPreview,count:t.userCount,scope:{type:`role`,id:t.id,name:t.name}})},se,Ae.column(),ze];return/* @__PURE__ */ k(`div`,{className:`page-container`,children:[/* @__PURE__ */ O(te,{searchConfig:ee({page:i,filters:[`keyword`,`status`,[`startTime`,`endTime`]],overrides:{startTime:e=>/* @__PURE__ */ O(ne,{placeholder:[`开始时间`,`结束时间`],...e.bindRange([`startTime`,`endTime`])})},create:/* @__PURE__ */ O(re,{permission:`system:role:create`,onClick:X.openCreate}),actions:/* @__PURE__ */ O(de,{entity:`system.roles`,query:o}),filterTitle:`角色筛选`,actionTitle:`角色操作`}),columns:Be,...a}),/* @__PURE__ */ k(le,{modal:X,width:480,children:[/* @__PURE__ */ O(s.Input,{field:`name`,label:`角色名称`,placeholder:`请输入角色名称`,rules:[{required:!0,message:`请输入角色名称`}]}),/* @__PURE__ */ O(s.Input,{field:`code`,label:`角色编码`,placeholder:`请输入角色编码`,rules:[{required:!0,message:`请输入角色编码`}]}),/* @__PURE__ */ O(s.Input,{field:`description`,label:`描述`,placeholder:`请输入描述`}),/* @__PURE__ */ O(s.TreeSelect,{field:`deptScopeIds`,label:`管理范围`,placeholder:`默认全员(用于工作流「角色」审批人按部门过滤)`,multiple:!0,filterTreeNode:!0,treeData:N(Y),style:{width:`100%`}}),/* @__PURE__ */ O(s.Select,{field:`status`,label:`状态`,style:{width:`100%`},disabled:De?.code===`super_admin`,optionList:r,placeholder:`请选择状态`})]}),/* @__PURE__ */ O(y,{title:`分配菜单权限 — ${d?.name}`,visible:l,onCancel:()=>u(!1),onOk:Me,okButtonProps:{disabled:!W.isSuccess,loading:Z.isPending},width:640,children:/* @__PURE__ */ O(me,{allMenus:U.data??[],checkedMenuIds:p,onChange:h,loading:U.isFetching||W.isFetching})}),/* @__PURE__ */ O(y,{title:`数据权限 — ${L?.name}`,visible:C,onCancel:()=>w(!1),onOk:Re,okButtonProps:{disabled:!q.isSuccess,loading:$.isPending},width:400,children:/* @__PURE__ */ O(he,{dataScope:z,deptScopeIds:V,deptTree:Y,onScopeChange:e=>B(e??`all`),onDeptIdsChange:H,loading:J.isFetching||q.isFetching})}),/* @__PURE__ */ O(n,{title:/* @__PURE__ */ k(`span`,{children:[`分配用户 — `,v?.name]}),visible:g,onCancel:()=>_(!1),width:720,footer:/* @__PURE__ */ O(ue,{onCancel:()=>_(!1),onOk:Ie,okText:`保存`,loading:Q.isPending,disabled:!K.isSuccess||!G.isSuccess}),children:G.isFetching||K.isFetching?/* @__PURE__ */ O(`div`,{style:{display:`flex`,justifyContent:`center`,padding:40},children:/* @__PURE__ */ O(c,{})}):/* @__PURE__ */ O(pe,{dataSource:Pe,value:x,onChange:S,departments:Ne})})]})}function R(){return(R=e((()=>{l(),S(),x(),b(),v(),i(),p(),C(),w(),h(),o(),a(),r(),u(),d(),_(),f(),g()})))()}R();export{L as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./typography-DKK_iHcj.js";import{r as n,t as r}from"./SessionClientTag-DafwXf-o.js";import{n as i,t as a}from"./shield-alert-De_Hx56I.js";import{a as o,w as s}from"./ui-DoIHGuTR.js";import{n as c,t as l}from"./DateTimeText-rk9NeYgA.js";import{n as u,t as d}from"./AppModal-B_xvSaeq.js";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{SESSION_CLIENT_KIND_LABELS as m}from"@fudanda/shared/identity";function h({conflict:e,loading:t,onConfirm:n,onCancel:i}){let s=e?.sessions??[];return/* @__PURE__ */ p(d,{title:`该账号已在其他设备登录`,visible:e!==null,onCancel:i,maskClosable:!1,width:440,footer:/* @__PURE__ */ p(`div`,{className:`session-conflict-footer`,children:[/* @__PURE__ */ f(o,{theme:`borderless`,type:`tertiary`,onClick:i,disabled:t,children:`取消`}),/* @__PURE__ */ f(o,{type:`danger`,theme:`solid`,loading:t,onClick:n,children:`下线其他设备并登录`})]}),children:[/* @__PURE__ */ p(`div`,{className:`session-conflict-intro`,children:[/* @__PURE__ */ f(a,{size:18,"aria-hidden":!0}),/* @__PURE__ */ p(g,{type:`secondary`,children:[`受安全策略限制,该账号最多同时在 `,e?.maxSessions??1,` 处登录。下线以下设备后即可继续;如不是您本人的登录,请尽快修改密码。`]})]}),/* @__PURE__ */ f(`ul`,{className:`session-conflict-list`,"aria-label":`占用名额的设备`,children:s.map((e,t)=>/* @__PURE__ */ p(`li`,{className:`session-conflict-item`,children:[/* @__PURE__ */ f(r,{client:e.client,size:20,className:`session-conflict-icon`}),/* @__PURE__ */ p(`div`,{className:`session-conflict-body`,children:[/* @__PURE__ */ f(`div`,{className:`session-conflict-title`,children:/* @__PURE__ */ p(g,{strong:!0,children:[m[e.client]??e.client,` · `,e.browser,` / `,e.os]})}),/* @__PURE__ */ p(g,{type:`tertiary`,size:`small`,className:`session-conflict-meta`,children:[e.location?`${e.location}(${e.ip})`:`IP: ${e.ip}`,` · `,`登录 `,/* @__PURE__ */ f(l,{value:e.loginAt}),` · `,`活跃 `,/* @__PURE__ */ f(l,{value:e.lastActiveAt})]})]})]},`${e.ip}-${e.loginAt}-${t}`))})]})}var g;function _(){return(_=e((()=>{s(),i(),u(),c(),n(),{Text:g}=t})))()}_();export{h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{t}from"./typography-DKK_iHcj.js";import{n,t as r}from"./rotate-ccw-D2__Zisi.js";import{C as i,a,b as o,l as s,w as c}from"./ui-DoIHGuTR.js";import{n as l,t as u}from"./rendered-slot-YhfmcMJr.js";import{createContext as d,useContext as f}from"react";import{usePreferences as p}from"@fudanda/react-core/hooks/usePreferences";import{Fragment as m,jsx as h,jsxs as g}from"react/jsx-runtime";import{useRenderedSlot as _}from"@fudanda/react-core/hooks/useRenderedSlot";import{preferenceDefinitionMap as v}from"@fudanda/shared/preferences";function y(){return f(b)}var b;function x(){return(x=e((()=>{b=d(()=>!0)})))()}function S({title:e,description:t,control:n,overridden:r,extra:i,style:a}){return/* @__PURE__ */ g(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,gap:16,padding:`14px 0`,...a},children:[/* @__PURE__ */ g(`div`,{style:{minWidth:0},children:[/* @__PURE__ */ g(`div`,{style:{display:`flex`,alignItems:`center`,gap:8},children:[/* @__PURE__ */ h(k,{heading:6,style:{margin:0},children:e}),r?/* @__PURE__ */ h(o,{size:`small`,color:`blue`,children:`已覆盖`}):null,i]}),t?/* @__PURE__ */ h(O,{type:`tertiary`,size:`small`,children:t}):null]}),/* @__PURE__ */ h(`div`,{style:{flexShrink:0},children:n})]})}function C({title:e,description:t,children:n}){return/* @__PURE__ */ g(`section`,{children:[/* @__PURE__ */ h(k,{heading:6,style:{margin:`24px 0 4px`,color:`var(--arc-antd-color-text-2)`,fontWeight:600},children:e}),t?/* @__PURE__ */ h(O,{type:`tertiary`,size:`small`,children:t}):null,n]})}function w(){return/* @__PURE__ */ h(s,{margin:0})}function T({path:e}){let{canEditPreference:t,isPreferenceOverridden:n,resetPreference:o}=p();return!t(e)||!n(e)?null:/* @__PURE__ */ h(i,{content:`清除这项个人选择,跟随系统当前默认值`,styles:{root:{pointerEvents:`none`}},children:/* @__PURE__ */ h(a,{size:`small`,theme:`borderless`,type:`tertiary`,icon:/* @__PURE__ */ h(r,{size:12}),"aria-label":`${e}恢复系统默认`,onClick:()=>o(e),children:`跟随系统`})})}function E({path:e,children:t,inline:n=!1}){let{canEditPreference:r,isPreferenceOverridden:i}=p(),a=y();if(!r(e)||!a(e))return null;let o=v[e];return/* @__PURE__ */ g(`div`,{className:`preference-control${n?` preference-control--inline`:``}`,"data-preference-path":e,role:`group`,"aria-label":o.label,children:[t,!n&&o.description?/* @__PURE__ */ h(`div`,{className:`preference-control__description`,children:o.description}):null,i(e)?/* @__PURE__ */ h(`span`,{className:`preference-control__reset`,children:/* @__PURE__ */ h(T,{path:e})}):null]})}function D({title:e,children:t}){p();let{probeRef:n,rendered:r}=_();return/* @__PURE__ */ g(m,{children:[r?e:null,/* @__PURE__ */ h(u,{ref:n,children:t})]})}var O,k;function A(){return(A=e((()=>{c(),n(),x(),l(),{Text:O,Title:k}=t})))()}export{C as a,x as c,S as i,y as l,D as n,A as o,w as r,b as s,E as t};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-BKuNeK48.js";import{n as t,o as n,r,s as i,t as a}from"./controls-C5dPckUT.js";import{t as o}from"./typography-DKK_iHcj.js";import{i as s}from"./feedback-D4BIfDNd.js";import{n as c,o as l,r as u}from"./search-filters-BoRMIesR.js";import{n as d,t as f}from"./createLucideIcon-BtwfYE6A.js";import{n as p,t as m}from"./MasterDetailLayout-DDVFodpX.js";import{a as h,i as g,s as _}from"./toolbar-controls-BFOuV86W.js";import{n as v,t as ee}from"./rotate-ccw-D2__Zisi.js";import{n as y,t as b}from"./save-w-NwiMMY.js";import{C as te,S as x,_ as ne,a as S,b as C,d as re,r as w,s as T,v as ie,w as E}from"./ui-DoIHGuTR.js";import{n as D,t as ae}from"./rendered-slot-YhfmcMJr.js";import{n as oe,t as O}from"./SearchToolbar-BAh56OAa.js";import{n as k,t as se}from"./EmptyIllustration-DUC3RZmF.js";import{a as A,i as ce,o as j,r as le}from"./SettingRow-BIb1ruW2.js";import{i as ue,r as de,t as fe}from"./NavListPanel-agMt2kc6.js";import{Fragment as pe,useEffect as me,useMemo as M,useState as he}from"react";import{Fragment as N,jsx as P,jsxs as F}from"react/jsx-runtime";import{Link as ge}from"react-router-dom";import{useApiQuery as _e}from"@fudanda/react-core/lib/contract-query";import{usePermission as ve}from"@fudanda/react-core/hooks/usePermission";import{useRenderedSlot as ye}from"@fudanda/react-core/hooks/useRenderedSlot";import{useListSearch as be}from"@fudanda/react-core/hooks/useListSearch";import{ApiError as xe,LOOKUP_STALE_TIME as Se}from"@fudanda/react-core/lib/query";import{useCurrentUserMenuTree as Ce,useMenuTree as we}from"@fudanda/react-core/hooks/queries/menus";import{THEME_COLOR_PRESETS as I}from"@fudanda/react-core/lib/theme-color";import{settingsKeys as Te,useSaveSettings as Ee,useSettings as De,useSettingsModules as Oe}from"@fudanda/react-core/hooks/queries/settings";import{textMatches as ke}from"@fudanda/react-core/utils/pinyin";import{usePinyinReady as Ae}from"@fudanda/react-core/hooks/usePinyinReady";import{canOverridePreference as L,defaultPreferences as je,describePreferenceCondition as Me,getPreferenceValue as R,isPreferenceApplicable as Ne,preferenceDefinitions as z,preferenceGroups as B,resolvePreferences as Pe,setPreferenceValue as V}from"@fudanda/shared/preferences";import{CAPTCHA_COMPLEXITY_LABELS as Fe,SETTINGS_MODULES as Ie,isSettingsModuleKey as Le}from"@fudanda/shared/settings";import{useUrlSelectionState as Re}from"@fudanda/react-core/hooks/useUrlSelectionState";import{foundationSettingSchemas as H}from"@fudanda/shared/settings/foundation";import{terminalFileContract as ze}from"@fudanda/shared/ops";var U,W;function Be(){return(Be=e((()=>{
|
|
2
|
-
/**
|
|
3
|
-
* @license lucide-react v1.53.0 - ISC
|
|
4
|
-
*
|
|
5
|
-
* This source code is licensed under the ISC license.
|
|
6
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
7
|
-
*/
|
|
8
|
-
d(),U={name:`external-link`,size:24,node:[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]},U.node,W=f(U)})))()}var G,Ve;function He(){return(He=e((()=>{
|
|
9
|
-
/**
|
|
10
|
-
* @license lucide-react v1.53.0 - ISC
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the ISC license.
|
|
13
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
-
*/
|
|
15
|
-
d(),G={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]},G.node,Ve=f(G)})))()}function Ue({primary:e,filters:t,onRefresh:n,refreshing:r,onReset:i,actions:a,mobileActions:o,extra:s,filterTitle:c,actionTitle:l,className:u}){let d=n?/* @__PURE__ */ P(g,{onClick:n,loading:r}):null,f=ye(),p=K(a)||K(s)?/* @__PURE__ */ F(N,{children:[/* @__PURE__ */ P(ae,{ref:f.probeRef,children:a}),s]}):void 0;return/* @__PURE__ */ P(O,{className:u,primary:/* @__PURE__ */ F(N,{children:[e,t,d,i?/* @__PURE__ */ P(h,{onClick:i}):null]}),actions:p,mobilePrimary:/* @__PURE__ */ F(N,{children:[e,d]}),mobileFilters:K(t)?t:void 0,mobileActions:o??(f.rendered?a:!1),filterTitle:c,actionTitle:l,onFilterReset:i})}var K;function We(){return(We=e((()=>{oe(),_(),D(),K=e=>!!e})))()}function q(e){return(e.def.checks??[]).map(e=>e._zod.def)}function J(e){let t=e,n={},r=!1;for(;;){let e=t.meta();e&&(e.title||e.description)&&!n.title&&(n={title:e.title,description:e.description});let i=t.def;if(i.type===`nullable`&&(r=!0),(i.type==="default"||i.type===`prefault`||i.type===`optional`||i.type===`nullable`)&&i.innerType)t=i.innerType;else break}let i=t.def;switch(i.type){case`boolean`:return{meta:n,leaf:{kind:`boolean`}};case`number`:{let e=q(t),i=e.find(e=>e.check===`greater_than`),a=e.find(e=>e.check===`less_than`),o=e.some(e=>e.check===`number_format`)||t.def.format===`safeint`,s=(e,t)=>e?.value===void 0?void 0:e.inclusive===!1&&o?e.value+t:e.value;return{meta:n,leaf:{kind:`number`,int:o,min:s(i,1),max:s(a,-1),nullable:r}}}case`enum`:return{meta:n,leaf:{kind:`enum`,options:Object.values(i.entries??{})}};case`string`:return{meta:n,leaf:{kind:`string`,maxLength:q(t).find(e=>e.check===`max_length`)?.maximum}};case`array`:{let e=i.element?J(i.element):null;return e?.leaf.kind===`string`||e?.leaf.kind===`enum`?{meta:n,leaf:{kind:`string-array`,maxItems:q(t).find(e=>e.check===`max_length`)?.maximum}}:{meta:n,leaf:{kind:`unknown`}}}case`object`:return{meta:n,leaf:{kind:`object`,shape:t.shape}};default:return{meta:n,leaf:{kind:`unknown`}}}}function Ge(e,t){return JSON.stringify(e)===JSON.stringify(t)}function Ke(e,t,n){if(t.length===1)return{...e,[t[0]]:n};let[r,...i]=t,a=e[r]??{};return{...e,[r]:Ke(a,i,n)}}function qe(e,t){return t.reduce((e,t)=>e&&typeof e==`object`?e[t]:void 0,e)}function Je({schema:e,value:a,inheritedValue:o,onChange:s,disabled:c,allowRevert:l=!0,enumLabels:u}){let d=(e,t)=>s(Ke(a,e,t)),f=(e,s)=>{let f=e.join(`.`),p=qe(a,e),m=o?qe(o,e):void 0,h=o!==void 0&&!Ge(p,m),g=l&&h&&!c?/* @__PURE__ */ P(S,{size:`small`,theme:`borderless`,onClick:()=>d(e,m),children:`恢复继承`}):null,_=s.meta.title??e[e.length-1],v;switch(s.leaf.kind){case`boolean`:v=/* @__PURE__ */ P(i,{checked:!!p,disabled:c,onChange:t=>d(e,t)});break;case`number`:{let{min:t,max:n,int:i,nullable:a}=s.leaf;v=/* @__PURE__ */ P(r,{style:{width:160},min:t,max:n,precision:i?0:void 0,disabled:c,value:typeof p==`number`?p:void 0,placeholder:a?`留空 = 未设置`:void 0,onChange:t=>{typeof t==`number`&&Number.isFinite(t)?d(e,i?Math.trunc(t):t):a&&d(e,null)}});break}case`enum`:v=/* @__PURE__ */ P(n,{style:{width:200},disabled:c,value:typeof p==`string`?p:void 0,optionList:s.leaf.options.map(e=>({value:e,label:u?.[f]?.[e]??e})),onChange:t=>d(e,t)});break;case`string`:v=/* @__PURE__ */ P(t,{style:{width:280},disabled:c,maxLength:s.leaf.maxLength,value:typeof p==`string`?p:``,onChange:t=>d(e,t)});break;case`string-array`:v=/* @__PURE__ */ P(x,{style:{width:360,maxWidth:`100%`},disabled:c,max:s.leaf.maxItems,value:Array.isArray(p)?p:[],allowDuplicates:!1,separator:[`,`,` `,`
|
|
16
|
-
`],addOnBlur:!0,placeholder:`输入后按回车添加`,onChange:t=>d(e,t)});break;default:v=/* @__PURE__ */ P(`span`,{style:{color:`var(--arc-antd-color-text-2)`},children:`该字段类型暂不支持在通用设置页编辑`})}return/* @__PURE__ */ P(ce,{title:_,description:s.meta.description,control:v,overridden:h,extra:g},f)},p=(e,t)=>{let n=Object.entries(e),r=n.filter(([,e])=>J(e).leaf.kind!==`object`),i=n.filter(([,e])=>J(e).leaf.kind===`object`);return/* @__PURE__ */ F(N,{children:[r.map(([e,n],r)=>/* @__PURE__ */ F(pe,{children:[r>0?/* @__PURE__ */ P(le,{}):null,f([...t,e],J(n))]},e)),i.map(([e,n])=>{let r=J(n);return r.leaf.kind===`object`?/* @__PURE__ */ P(A,{title:r.meta.title??e,description:r.meta.description,children:p(r.leaf.shape,[...t,e])},e):null})]})};return/* @__PURE__ */ P(`div`,{children:p(e.shape,[])})}function Y(){return(Y=e((()=>{E(),j()})))()}function Ye(e){return M(()=>{let t=[],n=(e,r)=>{for(let i of e){if(i.type===`menu`&&i.path&&i.status===`enabled`&&i.visible){let e=i.isExternal&&i.embed?`/embed/${i.id}`:i.path;t.push({id:i.id,title:i.title,path:e,icon:i.icon,breadcrumb:r})}i.children?.length&&n(i.children,i.type===`directory`?[...r,i.title]:r)}};return n(e,[]),t},[e])}function Xe(){return(Xe=e((()=>{})))()}var Ze,X;function Qe(){return(Qe=e((()=>{Ze=[{label:`Cascadia Code`,value:`"Cascadia Code", "JetBrains Mono", Menlo, Monaco, "Courier New", monospace`},{label:`JetBrains Mono`,value:`"JetBrains Mono", "Cascadia Code", Menlo, Monaco, monospace`},{label:`Fira Code`,value:`"Fira Code", "Cascadia Code", Menlo, Monaco, monospace`},{label:`Source Code Pro`,value:`"Source Code Pro", Menlo, Monaco, monospace`},{label:`Consolas`,value:`Consolas, "Courier New", monospace`},{label:`Menlo / Monaco`,value:`Menlo, Monaco, "Courier New", monospace`},{label:`系统等宽`,value:`ui-monospace, SFMono-Regular, "Courier New", monospace`}],X=[{id:`catppuccin-mocha`,name:`Catppuccin Mocha`,type:`dark`,background:`#1e1e2e`,foreground:`#cdd6f4`,cursor:`#f5e0dc`,selection:`#585b70`,black:`#45475a`,red:`#f38ba8`,green:`#a6e3a1`,yellow:`#f9e2af`,blue:`#89b4fa`,magenta:`#f5c2e7`,cyan:`#94e2d5`,white:`#bac2de`,brightBlack:`#585b70`,brightRed:`#f38ba8`,brightGreen:`#a6e3a1`,brightYellow:`#f9e2af`,brightBlue:`#89b4fa`,brightMagenta:`#f5c2e7`,brightCyan:`#94e2d5`,brightWhite:`#a6adc8`},{id:`vscode-dark`,name:`VS Code Dark`,type:`dark`,background:`#1e1e1e`,foreground:`#d4d4d4`,cursor:`#aeafad`,selection:`#264f78`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},{id:`dracula`,name:`Dracula`,type:`dark`,background:`#282a36`,foreground:`#f8f8f2`,cursor:`#f8f8f2`,selection:`#44475a`,black:`#21222c`,red:`#ff5555`,green:`#50fa7b`,yellow:`#f1fa8c`,blue:`#bd93f9`,magenta:`#ff79c6`,cyan:`#8be9fd`,white:`#f8f8f2`,brightBlack:`#6272a4`,brightRed:`#ff6e6e`,brightGreen:`#69ff94`,brightYellow:`#ffffa5`,brightBlue:`#d6acff`,brightMagenta:`#ff92df`,brightCyan:`#a4ffff`,brightWhite:`#ffffff`},{id:`one-dark`,name:`One Dark`,type:`dark`,background:`#282c34`,foreground:`#abb2bf`,cursor:`#528bff`,selection:`#3e4451`,black:`#282c34`,red:`#e06c75`,green:`#98c379`,yellow:`#e5c07b`,blue:`#61afef`,magenta:`#c678dd`,cyan:`#56b6c2`,white:`#abb2bf`,brightBlack:`#5c6370`,brightRed:`#e06c75`,brightGreen:`#98c379`,brightYellow:`#e5c07b`,brightBlue:`#61afef`,brightMagenta:`#c678dd`,brightCyan:`#56b6c2`,brightWhite:`#ffffff`},{id:`solarized-dark`,name:`Solarized Dark`,type:`dark`,background:`#002b36`,foreground:`#839496`,cursor:`#93a1a1`,selection:`#073642`,black:`#073642`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,magenta:`#d33682`,cyan:`#2aa198`,white:`#eee8d5`,brightBlack:`#586e75`,brightRed:`#cb4b16`,brightGreen:`#586e75`,brightYellow:`#657b83`,brightBlue:`#839496`,brightMagenta:`#6c71c4`,brightCyan:`#93a1a1`,brightWhite:`#fdf6e3`},{id:`github-dark`,name:`GitHub Dark`,type:`dark`,background:`#0d1117`,foreground:`#c9d1d9`,cursor:`#c9d1d9`,selection:`#163356`,black:`#484f58`,red:`#ff7b72`,green:`#3fb950`,yellow:`#d29922`,blue:`#58a6ff`,magenta:`#bc8cff`,cyan:`#39c5cf`,white:`#b1bac4`,brightBlack:`#6e7681`,brightRed:`#ffa198`,brightGreen:`#56d364`,brightYellow:`#e3b341`,brightBlue:`#79c0ff`,brightMagenta:`#d2a8ff`,brightCyan:`#56d4dd`,brightWhite:`#f0f6fc`},{id:`nord`,name:`Nord`,type:`dark`,background:`#2e3440`,foreground:`#d8dee9`,cursor:`#d8dee9`,selection:`#434c5e`,black:`#3b4252`,red:`#bf616a`,green:`#a3be8c`,yellow:`#ebcb8b`,blue:`#81a1c1`,magenta:`#b48ead`,cyan:`#88c0d0`,white:`#e5e9f0`,brightBlack:`#4c566a`,brightRed:`#bf616a`,brightGreen:`#a3be8c`,brightYellow:`#ebcb8b`,brightBlue:`#81a1c1`,brightMagenta:`#b48ead`,brightCyan:`#8fbcbb`,brightWhite:`#eceff4`},{id:`monokai`,name:`Monokai`,type:`dark`,background:`#272822`,foreground:`#f8f8f2`,cursor:`#f8f8f0`,selection:`#49483e`,black:`#272822`,red:`#f92672`,green:`#a6e22e`,yellow:`#f4bf75`,blue:`#66d9ef`,magenta:`#ae81ff`,cyan:`#a1efe4`,white:`#f8f8f2`,brightBlack:`#75715e`,brightRed:`#f92672`,brightGreen:`#a6e22e`,brightYellow:`#f4bf75`,brightBlue:`#66d9ef`,brightMagenta:`#ae81ff`,brightCyan:`#a1efe4`,brightWhite:`#f9f8f5`},{id:`tokyo-night`,name:`Tokyo Night`,type:`dark`,background:`#1a1b26`,foreground:`#a9b1d6`,cursor:`#c0caf5`,selection:`#33467c`,black:`#15161e`,red:`#f7768e`,green:`#9ece6a`,yellow:`#e0af68`,blue:`#7aa2f7`,magenta:`#bb9af7`,cyan:`#7dcfff`,white:`#a9b1d6`,brightBlack:`#414868`,brightRed:`#f7768e`,brightGreen:`#9ece6a`,brightYellow:`#e0af68`,brightBlue:`#7aa2f7`,brightMagenta:`#bb9af7`,brightCyan:`#7dcfff`,brightWhite:`#c0caf5`},{id:`gruvbox-dark`,name:`Gruvbox Dark`,type:`dark`,background:`#282828`,foreground:`#ebdbb2`,cursor:`#ebdbb2`,selection:`#504945`,black:`#282828`,red:`#cc241d`,green:`#98971a`,yellow:`#d79921`,blue:`#458588`,magenta:`#b16286`,cyan:`#689d6a`,white:`#a89984`,brightBlack:`#928374`,brightRed:`#fb4934`,brightGreen:`#b8bb26`,brightYellow:`#fabd2f`,brightBlue:`#83a598`,brightMagenta:`#d3869b`,brightCyan:`#8ec07c`,brightWhite:`#ebdbb2`},{id:`night-owl`,name:`Night Owl`,type:`dark`,background:`#011627`,foreground:`#d6deeb`,cursor:`#80a4c2`,selection:`#1d3b53`,black:`#011627`,red:`#ef5350`,green:`#22da6e`,yellow:`#c5e478`,blue:`#82aaff`,magenta:`#c792ea`,cyan:`#21c7a8`,white:`#ffffff`,brightBlack:`#575656`,brightRed:`#ef5350`,brightGreen:`#22da6e`,brightYellow:`#ffeb95`,brightBlue:`#82aaff`,brightMagenta:`#c792ea`,brightCyan:`#7fdbca`,brightWhite:`#ffffff`},{id:`ayu-dark`,name:`Ayu Dark`,type:`dark`,background:`#0a0e14`,foreground:`#b3b1ad`,cursor:`#e6b450`,selection:`#273747`,black:`#01060e`,red:`#ea6c73`,green:`#91b362`,yellow:`#f9af4f`,blue:`#53bdfa`,magenta:`#fae994`,cyan:`#90e1c6`,white:`#c7c7c7`,brightBlack:`#686868`,brightRed:`#f07178`,brightGreen:`#c2d94c`,brightYellow:`#ffb454`,brightBlue:`#59c2ff`,brightMagenta:`#ffee99`,brightCyan:`#95e6cb`,brightWhite:`#ffffff`},{id:`palenight`,name:`Palenight`,type:`dark`,background:`#292d3e`,foreground:`#a6accd`,cursor:`#ffcc00`,selection:`#444267`,black:`#292d3e`,red:`#f07178`,green:`#c3e88d`,yellow:`#ffcb6b`,blue:`#82aaff`,magenta:`#c792ea`,cyan:`#89ddff`,white:`#d0d0d0`,brightBlack:`#434758`,brightRed:`#ff8b92`,brightGreen:`#ddffa7`,brightYellow:`#ffe585`,brightBlue:`#9cc4ff`,brightMagenta:`#e1acff`,brightCyan:`#a3f7ff`,brightWhite:`#ffffff`},{id:`everforest-dark`,name:`Everforest Dark`,type:`dark`,background:`#2d353b`,foreground:`#d3c6aa`,cursor:`#d3c6aa`,selection:`#475258`,black:`#475258`,red:`#e67e80`,green:`#a7c080`,yellow:`#dbbc7f`,blue:`#7fbbb3`,magenta:`#d699b6`,cyan:`#83c092`,white:`#d3c6aa`,brightBlack:`#475258`,brightRed:`#e67e80`,brightGreen:`#a7c080`,brightYellow:`#dbbc7f`,brightBlue:`#7fbbb3`,brightMagenta:`#d699b6`,brightCyan:`#83c092`,brightWhite:`#9da9a0`},{id:`cobalt2`,name:`Cobalt2`,type:`dark`,background:`#193549`,foreground:`#ffffff`,cursor:`#ffc600`,selection:`#0050a4`,black:`#000000`,red:`#ff0000`,green:`#38de21`,yellow:`#ffe50a`,blue:`#1460d2`,magenta:`#ff005d`,cyan:`#00bbbb`,white:`#bbbbbb`,brightBlack:`#555555`,brightRed:`#f40e17`,brightGreen:`#3bd01d`,brightYellow:`#edc809`,brightBlue:`#5555ff`,brightMagenta:`#ff55ff`,brightCyan:`#6ae3fa`,brightWhite:`#ffffff`},{id:`rose-pine`,name:`Rosé Pine`,type:`dark`,background:`#191724`,foreground:`#e0def4`,cursor:`#e0def4`,selection:`#403d52`,black:`#26233a`,red:`#eb6f92`,green:`#31748f`,yellow:`#f6c177`,blue:`#9ccfd8`,magenta:`#c4a7e7`,cyan:`#ebbcba`,white:`#e0def4`,brightBlack:`#6e6a86`,brightRed:`#eb6f92`,brightGreen:`#31748f`,brightYellow:`#f6c177`,brightBlue:`#9ccfd8`,brightMagenta:`#c4a7e7`,brightCyan:`#ebbcba`,brightWhite:`#e0def4`},{id:`rose-pine-moon`,name:`Rosé Pine Moon`,type:`dark`,background:`#232136`,foreground:`#e0def4`,cursor:`#e0def4`,selection:`#44415a`,black:`#393552`,red:`#eb6f92`,green:`#3e8fb0`,yellow:`#f6c177`,blue:`#9ccfd8`,magenta:`#c4a7e7`,cyan:`#ea9a97`,white:`#e0def4`,brightBlack:`#6e6a86`,brightRed:`#eb6f92`,brightGreen:`#3e8fb0`,brightYellow:`#f6c177`,brightBlue:`#9ccfd8`,brightMagenta:`#c4a7e7`,brightCyan:`#ea9a97`,brightWhite:`#e0def4`},{id:`kanagawa`,name:`Kanagawa Wave`,type:`dark`,background:`#1f1f28`,foreground:`#dcd7ba`,cursor:`#c8c093`,selection:`#2d4f67`,black:`#090618`,red:`#c34043`,green:`#76946a`,yellow:`#c0a36e`,blue:`#7e9cd8`,magenta:`#957fb8`,cyan:`#6a9589`,white:`#c8c093`,brightBlack:`#727169`,brightRed:`#e82424`,brightGreen:`#98bb6c`,brightYellow:`#e6c384`,brightBlue:`#7fb4ca`,brightMagenta:`#938aa9`,brightCyan:`#7aa89f`,brightWhite:`#dcd7ba`},{id:`synthwave-84`,name:`Synthwave '84`,type:`dark`,background:`#262335`,foreground:`#ffffff`,cursor:`#f92aad`,selection:`#463465`,black:`#262335`,red:`#f97e72`,green:`#72f1b8`,yellow:`#fede5d`,blue:`#6872ab`,magenta:`#f92aad`,cyan:`#2ee2fa`,white:`#ffffff`,brightBlack:`#495495`,brightRed:`#ff7edb`,brightGreen:`#72f1b8`,brightYellow:`#fede5d`,brightBlue:`#6f7ec9`,brightMagenta:`#f92aad`,brightCyan:`#03edf9`,brightWhite:`#ffffff`},{id:`catppuccin-macchiato`,name:`Catppuccin Macchiato`,type:`dark`,background:`#24273a`,foreground:`#cad3f5`,cursor:`#f4dbd6`,selection:`#5b6078`,black:`#494d64`,red:`#ed8796`,green:`#a6da95`,yellow:`#eed49f`,blue:`#8aadf4`,magenta:`#f5bde6`,cyan:`#8bd5ca`,white:`#b8c0e0`,brightBlack:`#5b6078`,brightRed:`#ed8796`,brightGreen:`#a6da95`,brightYellow:`#eed49f`,brightBlue:`#8aadf4`,brightMagenta:`#f5bde6`,brightCyan:`#8bd5ca`,brightWhite:`#a5adcb`},{id:`catppuccin-frappe`,name:`Catppuccin Frappé`,type:`dark`,background:`#303446`,foreground:`#c6d0f5`,cursor:`#f2d5cf`,selection:`#626880`,black:`#51576d`,red:`#e78284`,green:`#a6d189`,yellow:`#e5c890`,blue:`#8caaee`,magenta:`#f4b8e4`,cyan:`#81c8be`,white:`#b5bfe2`,brightBlack:`#626880`,brightRed:`#e78284`,brightGreen:`#a6d189`,brightYellow:`#e5c890`,brightBlue:`#8caaee`,brightMagenta:`#f4b8e4`,brightCyan:`#81c8be`,brightWhite:`#a5adce`},{id:`tokyo-night-storm`,name:`Tokyo Night Storm`,type:`dark`,background:`#24283b`,foreground:`#c0caf5`,cursor:`#c0caf5`,selection:`#364a82`,black:`#1d202f`,red:`#f7768e`,green:`#9ece6a`,yellow:`#e0af68`,blue:`#7aa2f7`,magenta:`#bb9af7`,cyan:`#7dcfff`,white:`#a9b1d6`,brightBlack:`#414868`,brightRed:`#f7768e`,brightGreen:`#9ece6a`,brightYellow:`#e0af68`,brightBlue:`#7aa2f7`,brightMagenta:`#bb9af7`,brightCyan:`#7dcfff`,brightWhite:`#c0caf5`},{id:`material-dark`,name:`Material Dark`,type:`dark`,background:`#212121`,foreground:`#eeffff`,cursor:`#ffcc00`,selection:`#546e7a`,black:`#000000`,red:`#f07178`,green:`#c3e88d`,yellow:`#ffcb6b`,blue:`#82aaff`,magenta:`#c792ea`,cyan:`#89ddff`,white:`#eeffff`,brightBlack:`#546e7a`,brightRed:`#ff5370`,brightGreen:`#c3e88d`,brightYellow:`#ffcb6b`,brightBlue:`#82aaff`,brightMagenta:`#c792ea`,brightCyan:`#89ddff`,brightWhite:`#ffffff`},{id:`horizon`,name:`Horizon`,type:`dark`,background:`#1c1e26`,foreground:`#d5d8da`,cursor:`#d5d8da`,selection:`#2e303e`,black:`#1c1e26`,red:`#e95678`,green:`#29d398`,yellow:`#fab795`,blue:`#26bbd9`,magenta:`#ee64ac`,cyan:`#59e1e3`,white:`#d5d8da`,brightBlack:`#6c6f93`,brightRed:`#ec6a88`,brightGreen:`#3fdaa4`,brightYellow:`#fbc3a7`,brightBlue:`#3fc4de`,brightMagenta:`#f075b5`,brightCyan:`#6be6e8`,brightWhite:`#d5d8da`},{id:`panda`,name:`Panda`,type:`dark`,background:`#292a2b`,foreground:`#e6e6e6`,cursor:`#ff2c6d`,selection:`#3c3c3c`,black:`#292a2b`,red:`#ff2c6d`,green:`#19f9d8`,yellow:`#ffb86c`,blue:`#45a9f9`,magenta:`#ff75b5`,cyan:`#6fc1ff`,white:`#e6e6e6`,brightBlack:`#676b79`,brightRed:`#ff2c6d`,brightGreen:`#19f9d8`,brightYellow:`#ffb86c`,brightBlue:`#45a9f9`,brightMagenta:`#ff75b5`,brightCyan:`#6fc1ff`,brightWhite:`#ffffff`},{id:`oxocarbon`,name:`Oxocarbon`,type:`dark`,background:`#161616`,foreground:`#f2f4f8`,cursor:`#f2f4f8`,selection:`#2d2d2d`,black:`#262626`,red:`#ff7eb6`,green:`#42be65`,yellow:`#ffe97b`,blue:`#78a9ff`,magenta:`#be95ff`,cyan:`#82cfff`,white:`#dde1e6`,brightBlack:`#393939`,brightRed:`#ff7eb6`,brightGreen:`#42be65`,brightYellow:`#ffe97b`,brightBlue:`#78a9ff`,brightMagenta:`#be95ff`,brightCyan:`#82cfff`,brightWhite:`#ffffff`},{id:`monokai-pro`,name:`Monokai Pro`,type:`dark`,background:`#2d2a2e`,foreground:`#fcfcfa`,cursor:`#fcfcfa`,selection:`#403e41`,black:`#403e41`,red:`#ff6188`,green:`#a9dc76`,yellow:`#ffd866`,blue:`#78dce8`,magenta:`#ab9df2`,cyan:`#fc9867`,white:`#fcfcfa`,brightBlack:`#727072`,brightRed:`#ff6188`,brightGreen:`#a9dc76`,brightYellow:`#ffd866`,brightBlue:`#78dce8`,brightMagenta:`#ab9df2`,brightCyan:`#fc9867`,brightWhite:`#fcfcfa`},{id:`shades-of-purple`,name:`Shades of Purple`,type:`dark`,background:`#2d2b55`,foreground:`#ffffff`,cursor:`#ffee80`,selection:`#44406e`,black:`#1e1e3f`,red:`#f97583`,green:`#3ad900`,yellow:`#fad000`,blue:`#6943ff`,magenta:`#ff2c70`,cyan:`#80ffea`,white:`#a599e9`,brightBlack:`#696099`,brightRed:`#f97583`,brightGreen:`#3ad900`,brightYellow:`#fad000`,brightBlue:`#6943ff`,brightMagenta:`#ff2c70`,brightCyan:`#80ffea`,brightWhite:`#ffffff`},{id:`flexoki-dark`,name:`Flexoki Dark`,type:`dark`,background:`#100f0f`,foreground:`#cecdc3`,cursor:`#cecdc3`,selection:`#282726`,black:`#1c1b1a`,red:`#d14d41`,green:`#879a39`,yellow:`#d0a215`,blue:`#4385be`,magenta:`#8b7ec8`,cyan:`#3aa99f`,white:`#b7b5ac`,brightBlack:`#403e3c`,brightRed:`#d14d41`,brightGreen:`#879a39`,brightYellow:`#d0a215`,brightBlue:`#4385be`,brightMagenta:`#8b7ec8`,brightCyan:`#3aa99f`,brightWhite:`#cecdc3`},{id:`zenburn`,name:`Zenburn`,type:`dark`,background:`#3f3f3f`,foreground:`#dcdccc`,cursor:`#dcdccc`,selection:`#525252`,black:`#1e2320`,red:`#cc9393`,green:`#7f9f7f`,yellow:`#d0bf8f`,blue:`#6ca0a3`,magenta:`#dc8cc3`,cyan:`#93e0e3`,white:`#dcdccc`,brightBlack:`#709080`,brightRed:`#dca3a3`,brightGreen:`#c3bf9f`,brightYellow:`#f0dfaf`,brightBlue:`#94bff3`,brightMagenta:`#ec93d3`,brightCyan:`#bde0f3`,brightWhite:`#ffffff`},{id:`vscode-light`,name:`VS Code Light`,type:`light`,background:`#ffffff`,foreground:`#383a42`,cursor:`#000000`,selection:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#686868`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`},{id:`catppuccin-latte`,name:`Catppuccin Latte`,type:`light`,background:`#eff1f5`,foreground:`#4c4f69`,cursor:`#dc8a78`,selection:`#acb0be`,black:`#5c5f77`,red:`#d20f39`,green:`#40a02b`,yellow:`#df8e1d`,blue:`#1e66f5`,magenta:`#ea76cb`,cyan:`#179299`,white:`#acb0be`,brightBlack:`#6c6f85`,brightRed:`#d20f39`,brightGreen:`#40a02b`,brightYellow:`#df8e1d`,brightBlue:`#1e66f5`,brightMagenta:`#ea76cb`,brightCyan:`#179299`,brightWhite:`#bcc0cc`},{id:`one-light`,name:`One Light`,type:`light`,background:`#fafafa`,foreground:`#383a42`,cursor:`#526fff`,selection:`#e5e5e6`,black:`#383a42`,red:`#e45649`,green:`#50a14f`,yellow:`#c18401`,blue:`#4078f2`,magenta:`#a626a4`,cyan:`#0184bc`,white:`#fafafa`,brightBlack:`#a0a1a7`,brightRed:`#e45649`,brightGreen:`#50a14f`,brightYellow:`#c18401`,brightBlue:`#4078f2`,brightMagenta:`#a626a4`,brightCyan:`#0184bc`,brightWhite:`#ffffff`},{id:`solarized-light`,name:`Solarized Light`,type:`light`,background:`#fdf6e3`,foreground:`#657b83`,cursor:`#586e75`,selection:`#eee8d5`,black:`#073642`,red:`#dc322f`,green:`#859900`,yellow:`#b58900`,blue:`#268bd2`,magenta:`#d33682`,cyan:`#2aa198`,white:`#eee8d5`,brightBlack:`#002b36`,brightRed:`#cb4b16`,brightGreen:`#586e75`,brightYellow:`#657b83`,brightBlue:`#839496`,brightMagenta:`#6c71c4`,brightCyan:`#93a1a1`,brightWhite:`#fdf6e3`},{id:`github-light`,name:`GitHub Light`,type:`light`,background:`#ffffff`,foreground:`#24292f`,cursor:`#24292f`,selection:`#add6ff`,black:`#24292f`,red:`#cf222e`,green:`#116329`,yellow:`#4d2d00`,blue:`#0969da`,magenta:`#8250df`,cyan:`#1b7c83`,white:`#6e7781`,brightBlack:`#57606a`,brightRed:`#a40e26`,brightGreen:`#1a7f37`,brightYellow:`#633c01`,brightBlue:`#218bff`,brightMagenta:`#a475f9`,brightCyan:`#3192aa`,brightWhite:`#8c959f`},{id:`gruvbox-light`,name:`Gruvbox Light`,type:`light`,background:`#fbf1c7`,foreground:`#3c3836`,cursor:`#3c3836`,selection:`#d5c4a1`,black:`#fbf1c7`,red:`#cc241d`,green:`#98971a`,yellow:`#d79921`,blue:`#458588`,magenta:`#b16286`,cyan:`#689d6a`,white:`#7c6f64`,brightBlack:`#928374`,brightRed:`#9d0006`,brightGreen:`#79740e`,brightYellow:`#b57614`,brightBlue:`#076678`,brightMagenta:`#8f3f71`,brightCyan:`#427b58`,brightWhite:`#3c3836`},{id:`ayu-light`,name:`Ayu Light`,type:`light`,background:`#fafafa`,foreground:`#5c6166`,cursor:`#ff9940`,selection:`#d1e4f4`,black:`#000000`,red:`#ea6c73`,green:`#6cbf43`,yellow:`#eca944`,blue:`#3199e1`,magenta:`#9e75c7`,cyan:`#46ba94`,white:`#c7c7c7`,brightBlack:`#686868`,brightRed:`#f07178`,brightGreen:`#86b300`,brightYellow:`#f2ae49`,brightBlue:`#399ee6`,brightMagenta:`#a37acc`,brightCyan:`#4cbf99`,brightWhite:`#d1d1d1`},{id:`everforest-light`,name:`Everforest Light`,type:`light`,background:`#fdf6e3`,foreground:`#5c6a72`,cursor:`#5c6a72`,selection:`#edeada`,black:`#5c6a72`,red:`#f85552`,green:`#8da101`,yellow:`#dfa000`,blue:`#3a94c5`,magenta:`#df69ba`,cyan:`#35a77c`,white:`#e0dcc7`,brightBlack:`#939f91`,brightRed:`#f85552`,brightGreen:`#8da101`,brightYellow:`#dfa000`,brightBlue:`#3a94c5`,brightMagenta:`#df69ba`,brightCyan:`#35a77c`,brightWhite:`#5c6a72`},{id:`rose-pine-dawn`,name:`Rosé Pine Dawn`,type:`light`,background:`#faf4ed`,foreground:`#575279`,cursor:`#575279`,selection:`#dfdad9`,black:`#f2e9e1`,red:`#b4637a`,green:`#286983`,yellow:`#ea9d34`,blue:`#56949f`,magenta:`#907aa9`,cyan:`#d7827e`,white:`#575279`,brightBlack:`#9893a5`,brightRed:`#b4637a`,brightGreen:`#286983`,brightYellow:`#ea9d34`,brightBlue:`#56949f`,brightMagenta:`#907aa9`,brightCyan:`#d7827e`,brightWhite:`#575279`},{id:`kanagawa-lotus`,name:`Kanagawa Lotus`,type:`light`,background:`#f2ecbc`,foreground:`#545464`,cursor:`#43436c`,selection:`#9fb5c9`,black:`#1f1f28`,red:`#c84053`,green:`#6f894e`,yellow:`#77713f`,blue:`#4d699b`,magenta:`#b35b79`,cyan:`#597b75`,white:`#717c7c`,brightBlack:`#282831`,brightRed:`#d7474b`,brightGreen:`#6e915f`,brightYellow:`#836f4a`,brightBlue:`#6693bf`,brightMagenta:`#624c83`,brightCyan:`#5e857a`,brightWhite:`#545464`},{id:`tokyo-day`,name:`Tokyo Day`,type:`light`,background:`#e1e2e7`,foreground:`#3760bf`,cursor:`#3760bf`,selection:`#b6bfe2`,black:`#b4b5b9`,red:`#f52a65`,green:`#587539`,yellow:`#8c6c3e`,blue:`#2e7de9`,magenta:`#9854f1`,cyan:`#007197`,white:`#848cb5`,brightBlack:`#9699a3`,brightRed:`#f52a65`,brightGreen:`#587539`,brightYellow:`#8c6c3e`,brightBlue:`#2e7de9`,brightMagenta:`#9854f1`,brightCyan:`#007197`,brightWhite:`#3760bf`},{id:`material-light`,name:`Material Light`,type:`light`,background:`#fafafa`,foreground:`#546e7a`,cursor:`#272727`,selection:`#80cbc4`,black:`#000000`,red:`#e53935`,green:`#91b859`,yellow:`#e2931d`,blue:`#6182b8`,magenta:`#9c3eda`,cyan:`#39adb5`,white:`#a0a0a0`,brightBlack:`#5f6c72`,brightRed:`#ff5370`,brightGreen:`#91b859`,brightYellow:`#ffb62c`,brightBlue:`#6182b8`,brightMagenta:`#9c3eda`,brightCyan:`#39adb5`,brightWhite:`#ffffff`},{id:`flexoki-light`,name:`Flexoki Light`,type:`light`,background:`#fffcf0`,foreground:`#100f0f`,cursor:`#100f0f`,selection:`#e6e4d9`,black:`#100f0f`,red:`#af3029`,green:`#66800b`,yellow:`#ad8301`,blue:`#205ea6`,magenta:`#5e409d`,cyan:`#24837b`,white:`#b7b5ac`,brightBlack:`#6f6e69`,brightRed:`#d14d41`,brightGreen:`#879a39`,brightYellow:`#d0a215`,brightBlue:`#4385be`,brightMagenta:`#8b7ec8`,brightCyan:`#3aa99f`,brightWhite:`#fffcf0`},{id:`pencil-light`,name:`Pencil Light`,type:`light`,background:`#f1f1f1`,foreground:`#424242`,cursor:`#424242`,selection:`#b9d4f4`,black:`#212121`,red:`#c30771`,green:`#10a778`,yellow:`#a89c14`,blue:`#008ec4`,magenta:`#523c79`,cyan:`#20a5ba`,white:`#d9d9d9`,brightBlack:`#424242`,brightRed:`#fb007a`,brightGreen:`#5fd7a7`,brightYellow:`#f3e430`,brightBlue:`#20bbfc`,brightMagenta:`#6855de`,brightCyan:`#4fb8cc`,brightWhite:`#f1f1f1`}],X.filter(e=>e.type===`dark`),X.filter(e=>e.type===`light`)})))()}function Z(e,t){return!L(t,e)||R(e.defaults,t)!==R(je,t)}function $e({value:e,disabled:t,onChange:r,label:i}){let a=I.find(t=>t.key===e),o=a?.light.primary??e,s=I.map(e=>({value:e.key,label:e.name}));return a||s.push({value:e,label:e}),/* @__PURE__ */ F(`div`,{className:`preference-policy-editor__color`,children:[/* @__PURE__ */ P(n,{"aria-label":i,value:e,optionList:s,disabled:t,onChange:e=>{typeof e==`string`&&r(e)}}),/* @__PURE__ */ P(T,{alpha:!1,usePopover:!0,value:T.colorStringToValue(o),onChange:e=>{t||r(e.hex)},children:/* @__PURE__ */ P(`button`,{type:`button`,className:`preference-policy-editor__swatch`,disabled:t,"aria-label":`自定义主题色`,title:`自定义主题色`,style:{backgroundColor:o}})})]})}function et({value:e,onChange:s,disabled:l}){let{hasPermission:d,hasAnyPermission:f}=ve(),p=d(`system:menu:list`),m=we({enabled:p}),h=Ce(),g=Ye(m.data??h.data??[]),_=f(`system:file:use`,`system:terminal:execute`),v=_e(ze.shells,{enabled:_,staleTime:Se,requestOptions:{silent:!0}}),{draftParams:y,bind:b,setField:x,handleReset:C}=be({defaults:tt,listKey:Te.module(`ui`),refetchOnSearch:!1}),T=M(()=>{let t=[{value:`/`,label:`首页(默认)`}],n=/* @__PURE__ */ new Set([`/`]);for(let e of g)!e.path.startsWith(`/`)||e.path.startsWith(`//`)||n.has(e.path)||(n.add(e.path),t.push({value:e.path,label:[...e.breadcrumb,e.title].join(` / `)}));let r=e.defaults.homePath;return n.has(r)||t.push({value:r,label:`${r}(当前已配置)`}),t},[g,e.defaults.homePath]),ie=M(()=>{let t=[{value:``,label:`服务器默认`},...(v.data?.shells??[]).map(e=>({value:e.id,label:e.label}))],n=e.defaults.terminal.defaultShell;return n&&!t.some(e=>e.value===n)&&t.push({value:n,label:`${n}(当前已配置)`}),t},[v.data,e.defaults.terminal.defaultShell]),E=Ae(),D=M(()=>{let t=y.keyword.trim();return z.filter(n=>y.group&&n.group!==y.group||y.changedOnly&&!Z(e,n.path)||y.lockedOnly&&L(n.path,e)?!1:!t||[n.label,n.path,n.description,B.find(e=>e.id===n.group)?.label,n.applicableWhen&&Me(n.applicableWhen)].filter(Boolean).some(e=>ke(String(e),t)))},[y,e,E]),ae=z.filter(t=>Z(e,t.path)).length,oe=z.filter(t=>!L(t.path,e)).length,O=Pe(e,{});function k(t,n){s({...e,defaults:V(e.defaults,t,n)})}function se(t){s({defaults:V(e.defaults,t,R(je,t)),allowUserOverride:V(e.allowUserOverride,t,!0)})}function j(i){let{path:a,kind:o}=i,s=R(e.defaults,a),c=`${i.label}默认值`;return o===`boolean`?/* @__PURE__ */ P(n,{"aria-label":c,value:String(s),optionList:rt,disabled:l,onChange:e=>k(a,e===`true`)}):o===`number`?/* @__PURE__ */ P(r,{"aria-label":c,value:typeof s==`number`?s:void 0,min:i.min,max:i.max,step:i.step??1,precision:i.step&&i.step<1?void 0:0,suffix:i.unit,disabled:l,onChange:e=>{typeof e==`number`&&Number.isFinite(e)&&k(a,e)}}):o===`color`?/* @__PURE__ */ P($e,{value:String(s),disabled:l,label:c,onChange:e=>k(a,e)}):o===`home-path`?/* @__PURE__ */ P(n,{"aria-label":c,value:String(s),optionList:T,filter:!0,disabled:l,loading:p?m.isFetching:h.isFetching,onChange:e=>{typeof e==`string`&&k(a,e)}}):a===`terminal.defaultShell`?/* @__PURE__ */ P(n,{"aria-label":c,value:String(s),optionList:ie,disabled:l,loading:_&&v.isFetching,onChange:e=>{typeof e==`string`&&k(a,e)}}):o===`terminal-theme`?/* @__PURE__ */ P(n,{"aria-label":c,value:String(s),disabled:l,filter:!0,optionList:[...i.options??[]],onChange:e=>{typeof e==`string`&&k(a,e)}}):a===`terminal.fontFamily`?/* @__PURE__ */ P(n,{"aria-label":c,value:String(s),disabled:l,filter:!0,allowCreate:!0,optionList:[...Ze],onChange:e=>{typeof e==`string`&&k(a,e)}}):o===`select`?/* @__PURE__ */ P(n,{"aria-label":c,value:typeof s==`number`?s:String(s),optionList:[...i.options??[]],disabled:l,onChange:e=>{(typeof e==`string`||typeof e==`number`)&&k(a,e)}}):/* @__PURE__ */ P(t,{"aria-label":c,value:String(s),disabled:l,onChange:e=>k(a,e)})}function ue(e){let t=Ne(e.path,O);return/* @__PURE__ */ F(`span`,{className:`preference-policy-editor__description`,children:[e.description?/* @__PURE__ */ P(`span`,{children:e.description}):null,e.applicableWhen?/* @__PURE__ */ F(`span`,{children:[`适用条件:`,Me(e.applicableWhen)]}):null,t?null:/* @__PURE__ */ P(`span`,{className:`preference-policy-editor__hint`,children:`当前系统默认组合不满足条件,满足条件后生效。`}),e.path===`homePath`?/* @__PURE__ */ F(`span`,{children:[`用户无权访问指定页面时回到可访问的首页。`,p?``:`当前仅列出你可访问的页面。`]}):null,e.path===`terminal.defaultShell`&&!_?/* @__PURE__ */ P(`span`,{children:`没有读取终端 Shell 列表的权限,可使用服务器默认。`}):null,e.path===`terminal.defaultShell`&&v.isError?/* @__PURE__ */ P(`span`,{children:`暂时无法读取 Shell 列表,可使用服务器默认或保留已配置值。`}):null]})}return/* @__PURE__ */ P(`div`,{className:`preference-policy-editor`,children:/* @__PURE__ */ F(A,{title:`偏好策略`,description:`设置每项偏好的系统默认值,并决定用户是否可以修改。`,children:[/* @__PURE__ */ P(w,{type:`info`,closeIcon:null,className:`preference-policy-editor__intro`,description:`禁止用户修改的项目会在个人偏好中隐藏并使用系统值;子项是否显示取决于父项的生效值。更改将在保存后统一生效。`}),/* @__PURE__ */ P(Ue,{primary:/* @__PURE__ */ P(u,{placeholder:`搜索偏好名称 / 说明`,...b(`keyword`)}),filters:/* @__PURE__ */ F(N,{children:[/* @__PURE__ */ P(c,{placeholder:`全部分组`,items:nt,...b(`group`)}),/* @__PURE__ */ P(a,{checked:y.changedOnly,onChange:e=>x(`changedOnly`)(!!e.target.checked),children:`仅看已调整`}),/* @__PURE__ */ P(a,{checked:y.lockedOnly,onChange:e=>x(`lockedOnly`)(!!e.target.checked),children:`仅看禁止修改`})]}),onReset:C}),/* @__PURE__ */ F(o.Text,{type:`tertiary`,size:`small`,children:[`共 `,z.length,` 项 · 已调整 `,ae,` 项 · 禁止修改 `,oe,` 项 · 当前显示 `,D.length,` 项`]}),D.length===0?/* @__PURE__ */ P(re,{description:`没有符合筛选条件的偏好`}):null,B.map(t=>{let n=D.filter(e=>e.group===t.id);return n.length===0?null:/* @__PURE__ */ F(A,{title:t.label,children:[/* @__PURE__ */ F(`div`,{className:`preference-policy-editor__head`,"aria-hidden":`true`,children:[/* @__PURE__ */ P(`span`,{children:`偏好设置`}),/* @__PURE__ */ F(`div`,{className:`preference-policy-editor__controls`,children:[/* @__PURE__ */ P(`span`,{children:`系统默认值`}),/* @__PURE__ */ P(`span`,{children:`用户可修改`}),/* @__PURE__ */ P(`span`,{})]})]}),n.map((t,n)=>/* @__PURE__ */ F(pe,{children:[n>0?/* @__PURE__ */ P(le,{}):null,/* @__PURE__ */ P(`div`,{className:`preference-policy-editor__row`,"data-preference-path":t.path,children:/* @__PURE__ */ P(ce,{title:t.label,description:ue(t),style:{flexWrap:`wrap`},control:/* @__PURE__ */ F(`div`,{className:`preference-policy-editor__controls`,children:[/* @__PURE__ */ F(`div`,{className:`preference-policy-editor__value`,children:[/* @__PURE__ */ P(`span`,{className:`preference-policy-editor__mobile-label`,children:`系统默认值`}),j(t)]}),/* @__PURE__ */ F(`div`,{className:`preference-policy-editor__override`,children:[/* @__PURE__ */ P(`span`,{className:`preference-policy-editor__mobile-label`,children:`用户可修改`}),/* @__PURE__ */ P(i,{"aria-label":`${t.label}用户可修改`,disabled:l,checked:L(t.path,e),onChange:n=>s({...e,allowUserOverride:V(e.allowUserOverride,t.path,n)})})]}),/* @__PURE__ */ P(te,{content:`恢复内置默认值并允许用户修改`,children:/* @__PURE__ */ P(ne,{children:/* @__PURE__ */ P(S,{theme:`borderless`,size:`small`,"aria-label":`恢复${t.label}内置策略`,icon:/* @__PURE__ */ P(ee,{size:14}),disabled:l||!Z(e,t.path),onClick:()=>se(t.path)})})})]})})})]},t.path))]},t.id)})]})})}var tt,nt,rt;function it(){return(it=e((()=>{E(),v(),We(),l(),j(),Xe(),Qe(),tt={keyword:``,group:void 0,changedOnly:!1,lockedOnly:!1},nt=B.map(e=>({value:e.id,label:e.label})),rt=[{value:`true`,label:`开启`},{value:`false`,label:`关闭`}]})))()}function at(){let e=Oe(),t=M(()=>(e.data??[]).filter(({module:e})=>e!==`identitySecurity`),[e.data]),[n,r]=Re(`module`),[i,a]=he(!1),o=n!==null&&Le(n)?t.find(e=>e.module===n)??null:null,s=o??(i?null:t[0]??null),c=s?.module??null;return me(()=>{n!==null&&o===null&&e.data&&!e.isFetching&&r(null)},[n,o,e.data,e.isFetching,r]),/* @__PURE__ */ P(`div`,{className:`page-container page-container--stretch`,children:/* @__PURE__ */ P(m,{defaultSize:260,minSize:200,maxSize:400,persistKey:`system-settings`,style:{flex:1,minHeight:0,overflow:`hidden`},showDetail:c!==null,onBack:()=>r(null),onResponsiveChange:a,master:/* @__PURE__ */ P(de,{title:`设置模块`,loading:e.isLoading,emptyText:`没有可访问的设置模块`,dataSource:t,renderItem:e=>/* @__PURE__ */ P(fe,{active:e.module===c,onClick:()=>r(e.module),icon:/* @__PURE__ */ P(Ve,{size:16}),primary:e.title,secondary:e.version>0?`v${e.version}`:void 0,meta:/* @__PURE__ */ F(`span`,{style:{display:`inline-flex`,gap:6,alignItems:`center`},children:[/* @__PURE__ */ P(C,{size:`small`,color:e.scope===`tenant`?`blue`:`grey`,children:`系统级`}),e.overriddenCount>0?/* @__PURE__ */ F(C,{size:`small`,color:`orange`,children:[e.overriddenCount,` 项覆盖`]}):null]}),extra:e.page?/* @__PURE__ */ P(te,{content:`有专用设置页面`,children:/* @__PURE__ */ P(W,{size:14,style:{display:`block`,color:`var(--arc-antd-color-text-2)`}})}):void 0,extraAlwaysVisible:!!e.page},e.module)}),detail:c&&s?/* @__PURE__ */ P(ot,{module:c,meta:s},c):/* @__PURE__ */ P(`div`,{style:{padding:48},children:/* @__PURE__ */ P(re,{...se(`NoContent`,120),description:`选择左侧模块查看或修改设置`})})})})}function ot({module:e,meta:t}){let n=Ie[e],r=De(e),i=Ee(e),a=r.data,[o,c]=he(null);me(()=>{c(null)},[a?.version]);let l=M(()=>o??a?.effective??null,[o,a]),u=o!==null&&JSON.stringify(o)!==JSON.stringify(a?.effective),d=e===`ui`&&l?l:null,f=e===`ui`&&a?a.effective:null,p=d&&f?z.filter(({path:e})=>R(d.preferences.defaults,e)!==R(f.preferences.defaults,e)||R(d.preferences.allowUserOverride,e)!==R(f.preferences.allowUserOverride,e)):[],h=p.filter(({path:e})=>d&&!R(d.preferences.allowUserOverride,e)).length;async function g(){if(!a||!l)return;let e=n.schema.safeParse(l);if(e.success)try{await i.mutateAsync({body:{version:a.version,data:e.data}}),c(null),s.success(`设置已保存`)}catch(e){e instanceof xe&&e.code===409&&(c(null),r.refetch())}else{let t=e.error.issues[0];s.error(`${t.path.join(`.`)||`表单`}:${t.message}`)}}return/* @__PURE__ */ P(m.Body,{padding:24,children:/* @__PURE__ */ F(`div`,{style:{maxWidth:e===`ui`?1040:760},children:[/* @__PURE__ */ F(`div`,{style:{display:`flex`,alignItems:`flex-start`,justifyContent:`space-between`,gap:16,marginBottom:8},children:[/* @__PURE__ */ F(`div`,{children:[/* @__PURE__ */ P(st,{heading:5,style:{margin:0},children:n.title}),/* @__PURE__ */ P(Q,{type:`tertiary`,children:n.description})]}),!t.page&&t.canWrite?/* @__PURE__ */ P(S,{theme:`solid`,icon:/* @__PURE__ */ P(b,{size:14}),loading:i.isPending,disabled:!u,onClick:()=>void g(),children:`保存`}):null]}),/* @__PURE__ */ F(`div`,{style:{display:`flex`,gap:8,flexWrap:`wrap`,marginBottom:12},children:[/* @__PURE__ */ P(C,{color:t.scope===`tenant`?`blue`:`grey`,children:`系统级`}),t.feature?/* @__PURE__ */ F(C,{children:[`License 特性:`,t.feature]}):null,a?/* @__PURE__ */ F(C,{children:[`版本 `,a.version]}):null,t.overriddenCount>0?/* @__PURE__ */ F(C,{color:`orange`,children:[t.overriddenCount,` 项覆盖`]}):null,a?.updatedAt?/* @__PURE__ */ F(Q,{type:`tertiary`,size:`small`,children:[`最后修改 `,a.updatedAt]}):null]}),t.page?/* @__PURE__ */ P(w,{type:`info`,closeIcon:null,description:/* @__PURE__ */ F(`span`,{children:[`该模块有专用设置页面,请前往`,/* @__PURE__ */ F(ge,{to:t.page,style:{margin:`0 4px`,display:`inline-flex`,alignItems:`center`,gap:4},children:[n.title,/* @__PURE__ */ P(W,{size:12})]}),`修改。`]})}):null,!t.page&&!t.canWrite?/* @__PURE__ */ P(w,{type:`warning`,closeIcon:null,description:t.scope===`platform`?`平台级设置仅平台管理员可修改,当前为只读。`:`当前账号没有修改权限,当前为只读。`}):null,p.length>0?/* @__PURE__ */ P(w,{type:`info`,closeIcon:null,description:`待保存 ${p.length} 项偏好策略,其中 ${h} 项将统一使用系统值;允许修改的项目保留用户已有选择。`}):null,/* @__PURE__ */ P(ie,{spinning:r.isLoading,children:a&&l?/* @__PURE__ */ F(N,{children:[/* @__PURE__ */ P(Je,{schema:e in H?e===`ui`?H.ui.omit({preferences:!0}):H[e]:e===`ui`?Ie.ui.schema.omit({preferences:!0}):n.schema,value:l,inheritedValue:a.inherited,onChange:e=>c({...l,...e}),disabled:!!t.page||!t.canWrite,enumLabels:ct}),d?/* @__PURE__ */ P(et,{value:d.preferences,onChange:e=>c({...l,preferences:e}),disabled:!t.canWrite}):null]}):null})]})})}var Q,st,ct;function $(){return($=e((()=>{E(),Be(),y(),He(),k(),p(),ue(),Y(),it(),{Text:Q,Title:st}=o,ct={captchaComplexity:Fe}})))()}$();export{at as default};
|