@fudanda/admin-antd 2.20261024.1-beta.2 → 2.20261026.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.
Files changed (32) hide show
  1. package/dist/chunks/App-BzdEg22K.js +79 -0
  2. package/dist/chunks/{ArcBaseAdmin-BNQYOjn5.js → ArcBaseAdmin-C_MS4ReQ.js} +1 -1
  3. package/dist/chunks/EmptyIllustration-BmZ4blnB.js +8 -0
  4. package/dist/chunks/{FileNameCell-y0GBeT7U.js → FileNameCell-3SmT42SA.js} +1 -1
  5. package/dist/chunks/{FileStorageConfigsPage-t-xAXrj9.js → FileStorageConfigsPage-CcCNEOSu.js} +1 -1
  6. package/dist/chunks/{FileViewerPreviewPanel-Br6xqekv.js → FileViewerPreviewPanel-Dexjx5kJ.js} +1 -1
  7. package/dist/chunks/{FilesPage-CMdOCFHC.js → FilesPage-CwKU7xeQ.js} +1 -1
  8. package/dist/chunks/{PreferencesSheetBody-6TY-ilIY.js → PreferencesSheetBody-MkbTc5f-.js} +1 -1
  9. package/dist/chunks/{ProfilePage-FgaNlvLP.js → ProfilePage-CiQ6UMTI.js} +1 -1
  10. package/dist/chunks/SettingsPage-CeVVSj52.js +19 -0
  11. package/dist/chunks/UserLogsPanels-D4yH_I6c.js +36 -0
  12. package/dist/chunks/{UsersPage-BKG0yUcl.js → UsersPage-DKCLViG7.js} +1 -1
  13. package/dist/file-viewer/flyfish-viewer-assets.json +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/{src-DXdeqJtP.js → src-CeFrSNPb.js} +1 -1
  16. package/package.json +635 -635
  17. package/dist/chunks/App-9RR_IB-H.js +0 -79
  18. package/dist/chunks/EmptyIllustration-CUIwSy8B.js +0 -1
  19. package/dist/chunks/SettingsPage-DIhjac2E.js +0 -26
  20. package/dist/chunks/UserLogsPanels-avjOQTTV.js +0 -36
  21. package/dist/public/avatars/avatar-01.svg +0 -1
  22. package/dist/public/avatars/avatar-02.svg +0 -1
  23. package/dist/public/avatars/avatar-03.svg +0 -1
  24. package/dist/public/avatars/avatar-04.svg +0 -1
  25. package/dist/public/avatars/avatar-05.svg +0 -1
  26. package/dist/public/avatars/avatar-06.svg +0 -1
  27. package/dist/public/avatars/avatar-07.svg +0 -1
  28. package/dist/public/avatars/avatar-08.svg +0 -1
  29. package/dist/public/avatars/avatar-09.svg +0 -1
  30. package/dist/public/avatars/avatar-10.svg +0 -1
  31. package/dist/public/avatars/avatar-11.svg +0 -1
  32. package/dist/public/avatars/avatar-12.svg +0 -1
@@ -0,0 +1,79 @@
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./preload-helper-B32n4JOp.js";import{a as r,o as i}from"../src-CeFrSNPb.js";import{t as a}from"./typography-CRVG4mWv.js";import{i as o,t as s}from"./feedback-BfXgoa0c.js";import{n as c,t as l}from"./createLucideIcon-C5OSmeyR.js";import{i as u,n as d,r as f,t as p}from"./menu-8WYIdKA2.js";import{n as m,t as h}from"./chevron-down-BGIidrMe.js";import{n as g,t as _}from"./copy-b6jxljaK.js";import{n as v,t as y}from"./download-B_9KkRk3.js";import{n as b,t as x}from"./ellipsis-B-5WtT0F.js";import{n as S,t as C}from"./layout-grid-Dojxc0Yp.js";import{i as ee,n as w,r as te,t as T}from"./user-round-D08nSPFl.js";import{n as E,t as D}from"./maximize-BcTWSiHf.js";import{n as O,t as k}from"./minimize-X-efhoW4.js";import{n as A,t as j}from"./refresh-cw-BFOr7C74.js";import{n as M,t as N}from"./rotate-ccw-nywjAlIn.js";import{n as P,t as F}from"./search-DL18EZlo.js";import{i as I,n as ne,r as re,t as ie}from"./EmptyIllustration-BmZ4blnB.js";import{n as ae,t as oe}from"./shield-alert-DFY_NI5e.js";import{n as se,t as ce}from"./upload-Cnqtp0CI.js";import{n as le,t as ue}from"./x-Cy9T0Gfj.js";import{C as de,_ as fe,a as pe,d as me}from"./ui-B2vRXZUo.js";import{i as he,t as ge}from"./confirm-CpM2HLx_.js";import{n as _e,t as ve}from"./ModalFooter-DpJqOw8j.js";import{n as ye,r as be}from"./clipboard-Cc2mRkhL.js";import{i as xe,n as Se,t as Ce}from"./icons-CJ96Om6P.js";import{n as we,t as Te}from"./theme-controller-CpTzD2Pa.js";import{n as Ee,t as De}from"./ScrollArea-D36AQ-H2.js";import Oe,{Activity as ke,Suspense as Ae,ViewTransition as je,createContext as Me,lazy as Ne,startTransition as Pe,useCallback as Fe,useContext as Ie,useEffect as L,useId as Le,useLayoutEffect as Re,useMemo as R,useRef as z,useState as B}from"react";import{Fragment as V,jsx as H,jsxs as U}from"react/jsx-runtime";import{readCachedPreferences as ze}from"@fudanda/admin-antd/core/lib/preference-cache";import{isScheduledDarkNow as Be,msUntilScheduleBoundary as Ve,sanitizeImportedPreferences as He,useOptionalPreferences as Ue,usePreferences as W}from"@fudanda/admin-antd/core/hooks/usePreferences";import{App as We,Avatar as Ge,BackTop as Ke,Breadcrumb as qe,Button as G,ConfigProvider as K,Drawer as Je,Dropdown as Ye,Form as q,Input as J,Menu as Xe,Modal as Ze,Result as Qe,Space as $e,Spin as et,Tabs as tt,Tooltip as Y,theme as X}from"antd";import{GoaError as nt}from"@fudanda/client";import rt from"dayjs";import{Link as it,Navigate as at,Route as Z,Routes as ot,useLocation as Q,useNavigate as st,useOutlet as ct}from"react-router-dom";import{useIsMobile as lt,usePrefersDark as ut}from"@fudanda/admin-antd/core/hooks/useMediaQuery";import{formatDateTime as dt}from"@fudanda/admin-antd/core/utils/date";import{EmbeddedIdentityLogin as ft,IdentityCallback as pt,LoginField as mt,LoginFormError as ht,useLoginForm as gt}from"@fudanda/admin-antd/elements";import{useArcBase as _t}from"@fudanda/admin-antd/hooks";import{useAuth as vt}from"@fudanda/admin-antd/core/hooks/useAuth";import{AdminPathsContext as yt,useAdminOptions as bt,useAdminTitle as xt}from"@fudanda/admin-antd/core/admin/runtime";import{useCurrentUserMenuTree as St}from"@fudanda/admin-antd/core/hooks/queries/menus";import{useMountedAdminModules as Ct}from"@fudanda/admin-antd/core/admin/modules";import{foundationPagePaths as wt}from"@fudanda/admin-antd/core/lib/foundation-mode";import{useTabsStore as Tt}from"@fudanda/admin-antd/core/hooks/useTabsStore";import{TabsMetaContext as Et}from"@fudanda/admin-antd/core/hooks/useTabMeta";import{formatTopbarClock as Dt}from"@fudanda/admin-antd/core/utils/topbar-clock";import{useLockScreen as Ot}from"@fudanda/admin-antd/core/hooks/useLockScreen";import{useAutoLock as kt}from"@fudanda/admin-antd/core/hooks/useAutoLock";import{useLayoutShortcuts as At}from"@fudanda/admin-antd/core/hooks/useLayoutShortcuts";import{useFavoriteMenus as jt}from"@fudanda/admin-antd/core/hooks/useFavoriteMenus";import{PreferencesProvider as Mt}from"@fudanda/admin-antd/core/hooks/PreferencesProvider";import Nt from"dayjs/plugin/updateLocale";import"dayjs/locale/zh-cn";import"dayjs/locale/en";import{RealtimeBridge as Pt}from"@fudanda/admin-antd/core/providers/RealtimeBridge";import{useRecentMenus as Ft}from"@fudanda/admin-antd/core/hooks/useRecentMenus";import It from"antd/locale/zh_CN";import Lt from"antd/locale/en_US";import{getThemeColorVars as Rt}from"@fudanda/admin-antd/core/lib/theme-color";import{downloadBlob as zt}from"@fudanda/admin-antd/core/utils/download";import"@fudanda/admin-antd/elements/styles.css";import{ApiLoginConflictSchema as Bt}from"@fudanda/client/api/identity";import{takeAuthInvalidatedReason as Vt}from"@fudanda/admin-antd/core/utils/http-client";import{useIdentityCapabilities as Ht,usePublicCaptcha as Ut}from"@fudanda/admin-antd/core/hooks/queries/auth-public";var Wt,Gt;function Kt(){return(Kt=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
+ c(),Wt={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]},Wt.node,Gt=l(Wt)})))()}var qt,Jt;function Yt(){return(Yt=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
+ c(),qt={name:`lock-keyhole`,size:24,node:[[`circle`,{cx:`12`,cy:`16`,r:`1`,key:`1au0dj`}],[`rect`,{x:`3`,y:`10`,width:`18`,height:`12`,rx:`2`,key:`6s8ecr`}],[`path`,{d:`M7 10V7a5 5 0 0 1 10 0v3`,key:`1pqi11`}]]},qt.node,Jt=l(qt)})))()}var Xt,Zt;function Qt(){return(Qt=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
+ c(),Xt={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]},Xt.node,Zt=l(Xt)})))()}var $t,en;function tn(){return(tn=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
+ c(),$t={name:`moon`,size:24,node:[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]},$t.node,en=l($t)})))()}var nn,rn;function an(){return(an=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
+ c(),nn={name:`panel-left-close`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]],aliases:[`sidebar-close`]},nn.node,rn=l(nn)})))()}var on,sn;function cn(){return(cn=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
+ c(),on={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]},on.node,sn=l(on)})))()}var ln,un;function dn(){return(dn=e((()=>{
44
+ /**
45
+ * @license lucide-react v1.53.0 - ISC
46
+ *
47
+ * This source code is licensed under the ISC license.
48
+ * See the LICENSE file in the root directory of this source tree.
49
+ */
50
+ c(),ln={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]},ln.node,un=l(ln)})))()}var fn,pn;function mn(){return(mn=e((()=>{
51
+ /**
52
+ * @license lucide-react v1.53.0 - ISC
53
+ *
54
+ * This source code is licensed under the ISC license.
55
+ * See the LICENSE file in the root directory of this source tree.
56
+ */
57
+ c(),fn={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]},fn.node,pn=l(fn)})))()}var hn,gn;function _n(){return(_n=e((()=>{
58
+ /**
59
+ * @license lucide-react v1.53.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */
64
+ c(),hn={name:`star`,size:24,node:[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]},hn.node,gn=l(hn)})))()}var vn,yn;function bn(){return(bn=e((()=>{
65
+ /**
66
+ * @license lucide-react v1.53.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */
71
+ c(),vn={name:`sun`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]},vn.node,yn=l(vn)})))()}var xn,Sn;function Cn(){return(Cn=e((()=>{
72
+ /**
73
+ * @license lucide-react v1.53.0 - ISC
74
+ *
75
+ * This source code is licensed under the ISC license.
76
+ * See the LICENSE file in the root directory of this source tree.
77
+ */
78
+ c(),xn={name:`user`,size:24,node:[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]},xn.node,Sn=l(xn)})))()}function wn(){try{sessionStorage.setItem(Dn,`1`)}catch{}}function Tn(){try{return sessionStorage.getItem(Dn)===`1`}catch{return!1}}function En(){try{sessionStorage.removeItem(Dn)}catch{}}var Dn;function On(){return(On=e((()=>{Dn=`arcbase_post_login_home`})))()}var $,kn;function An(){return(An=e((()=>{t(),$=/* #__PURE__ */ Object.assign({"./pages/dashboard/DashboardPage.tsx":()=>n(()=>import(`./DashboardPage-Cf3liiTR.js`),[],import.meta.url),"./pages/profile/ProfilePage.tsx":()=>n(()=>import(`./ProfilePage-CiQ6UMTI.js`),[],import.meta.url),"./pages/system/departments/DepartmentsPage.tsx":()=>n(()=>import(`./DepartmentsPage-DNdW4DHz.js`),[],import.meta.url),"./pages/system/dicts/DictsPage.tsx":()=>n(()=>import(`./DictsPage-EQQ9BmBh.js`),[],import.meta.url),"./pages/system/file-configs/FileStorageConfigsPage.tsx":()=>n(()=>import(`./FileStorageConfigsPage-CcCNEOSu.js`),[],import.meta.url),"./pages/system/files/FilesPage.tsx":()=>n(()=>import(`./FilesPage-CwKU7xeQ.js`),[],import.meta.url),"./pages/system/identity-security/IdentitySecurityPage.tsx":()=>n(()=>import(`./IdentitySecurityPage-BsT3Dy7c.js`),[],import.meta.url),"./pages/system/login-logs/LoginLogsPage.tsx":()=>n(()=>import(`./LoginLogsPage-BN0LqvKy.js`),[],import.meta.url),"./pages/system/menus/MenusPage.tsx":()=>n(()=>import(`./MenusPage-DuenlYXw.js`),[],import.meta.url),"./pages/system/operation-logs/OperationLogsPage.tsx":()=>n(()=>import(`./OperationLogsPage-Ca5Rd8AT.js`).then(e=>(e.n(),e.t)),[],import.meta.url),"./pages/system/positions/PositionsPage.tsx":()=>n(()=>import(`./PositionsPage-DSEodKAv.js`),[],import.meta.url),"./pages/system/roles/RolesPage.tsx":()=>n(()=>import(`./RolesPage-Cl6YVPIo.js`),[],import.meta.url),"./pages/system/sessions/OnlineSessionsPage.tsx":()=>n(()=>import(`./OnlineSessionsPage-BmHE-k15.js`),[],import.meta.url),"./pages/system/settings/SettingsPage.tsx":()=>n(()=>import(`./SettingsPage-CeVVSj52.js`),[],import.meta.url),"./pages/system/user-groups/UserGroupsPage.tsx":()=>n(()=>import(`./UserGroupsPage-DEKvOhK-.js`),[],import.meta.url),"./pages/users/UsersPage.tsx":()=>n(()=>import(`./UsersPage-DKCLViG7.js`),[],import.meta.url)}),kn={"/":$[`./pages/dashboard/DashboardPage.tsx`],"/system/departments":$[`./pages/system/departments/DepartmentsPage.tsx`],"/system/positions":$[`./pages/system/positions/PositionsPage.tsx`],"/system/users":$[`./pages/users/UsersPage.tsx`],"/system/menus":$[`./pages/system/menus/MenusPage.tsx`],"/system/roles":$[`./pages/system/roles/RolesPage.tsx`],"/system/user-groups":$[`./pages/system/user-groups/UserGroupsPage.tsx`],"/system/dicts":$[`./pages/system/dicts/DictsPage.tsx`],"/system/settings":$[`./pages/system/settings/SettingsPage.tsx`],"/system/identity-security":$[`./pages/system/identity-security/IdentitySecurityPage.tsx`],"/system/file-configs":$[`./pages/system/file-configs/FileStorageConfigsPage.tsx`],"/system/files":$[`./pages/system/files/FilesPage.tsx`],"/system/sessions":$[`./pages/system/sessions/OnlineSessionsPage.tsx`],"/system/login-logs":$[`./pages/system/login-logs/LoginLogsPage.tsx`],"/system/operation-logs":$[`./pages/system/operation-logs/OperationLogsPage.tsx`],"/profile":$[`./pages/profile/ProfilePage.tsx`]}})))()}function jn({mode:e,showDate:t}){let[n,r]=B(()=>/* @__PURE__ */ new Date);return L(()=>{let e,t=setTimeout(()=>{r(/* @__PURE__ */ new Date),e=setInterval(()=>r(/* @__PURE__ */ new Date),6e4)},(60-(/* @__PURE__ */ new Date()).getSeconds())*1e3+50);return()=>{clearTimeout(t),e!==void 0&&clearInterval(e)}},[]),/* @__PURE__ */ H(`span`,{className:`admin-topbar-clock`,title:Dt(n,e,!0),children:Dt(n,e,t)})}function Mn(){return(Mn=e((()=>{})))()}function Nn(e){return e.name===`ChunkLoadError`||/Failed to fetch dynamically imported module|error loading dynamically imported module|Importing a module script failed/i.test(e.message)}function Pn({children:e}){let{pathname:t}=Q();return/* @__PURE__ */ H(Fn,{resetKey:t,children:e})}var Fn;function In(){return(In=e((()=>{de(),A(),Kt(),g(),be(),ne(),Fn=class extends Oe.Component{static contextType=yt;constructor(e){super(e),this.state={error:null,componentStack:null,resetKey:e.resetKey}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return e.resetKey===t.resetKey?null:{error:null,componentStack:null,resetKey:e.resetKey}}componentDidCatch(e,t){console.error(`[PageErrorBoundary] 捕获到运行时错误:`,e,t.componentStack),this.setState({componentStack:t.componentStack??null})}handleRetry=()=>{this.state.error&&Nn(this.state.error)?globalThis.location.reload():this.setState({error:null,componentStack:null})};handleCopy=()=>{let{error:e,componentStack:t}=this.state;if(!e)return;let n=[`[ArcBase 页面错误报告]`,`时间: ${dt(/* @__PURE__ */ new Date)}`,`页面: ${globalThis.location.href}`,`浏览器: ${navigator.userAgent}`,``,`${e.name}: ${e.message}`,e.stack?`\n堆栈:\n${e.stack}`:``,t?`\n组件栈:${t}`:``].filter(Boolean).join(`
79
+ `);ye(n,{success:`错误信息已复制,可粘贴给开发人员排查`,error:`复制失败,请手动选择复制`})};render(){if(!this.state.error)return this.props.children;let e=this.state.error,t=Nn(e);return/* @__PURE__ */ H(`div`,{style:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`safe center`,minHeight:`min(400px, 100dvh)`,maxHeight:`100dvh`,overflowY:`auto`,padding:`40px 24px`},children:/* @__PURE__ */ U(me,{...ie(`Failure`,120),title:t?`页面资源加载失败`:`页面加载出错`,description:t?`可能是网络不稳定,或系统刚刚发布了新版本。点击重新加载获取最新页面。`:`当前页面遇到了一个意外错误。你可以尝试刷新页面,或返回首页继续操作。`,children:[!1,/* @__PURE__ */ U(`div`,{style:{display:`flex`,gap:12,marginTop:16,justifyContent:`center`},children:[/* @__PURE__ */ H(pe,{icon:/* @__PURE__ */ H(j,{size:14}),theme:`solid`,type:`primary`,onClick:this.handleRetry,children:`重新加载`}),/* @__PURE__ */ H(pe,{icon:/* @__PURE__ */ H(Gt,{size:14}),theme:`light`,type:`primary`,onClick:()=>{globalThis.location.href=this.context?.basePath??`./`},children:`返回首页`}),/* @__PURE__ */ H(pe,{icon:/* @__PURE__ */ H(_,{size:14}),theme:`light`,type:`tertiary`,onClick:this.handleCopy,children:`复制错误信息`})]})]})})}}})))()}function Ln({lock:e,mode:t,onClose:n}){let r=vt(),{preferences:i}=W(),{message:a}=We.useApp();return e.isLocked?/* @__PURE__ */ H(Qe,{title:`屏幕已锁定`,subTitle:`输入锁屏密码继续使用管理台`,extra:/* @__PURE__ */ U(q,{style:{maxWidth:320,margin:`auto`},onFinish:({password:t})=>{e.unlock(t)||a.error(`锁屏密码不正确`)},children:[/* @__PURE__ */ H(q.Item,{name:`password`,rules:[{required:!0,message:`请输入锁屏密码`}],children:/* @__PURE__ */ H(J.Password,{autoFocus:!0,placeholder:`锁屏密码`})}),/* @__PURE__ */ H(G,{type:`primary`,htmlType:`submit`,children:`解锁`}),` `,/* @__PURE__ */ H(G,{onClick:()=>{e.clearLockPassword(),r.logout().catch(e=>{a.error(e instanceof Error?e.message:`退出失败,请重试`)})},children:`退出登录`})]})}):/* @__PURE__ */ H(Ze,{title:t===`change`?`修改锁屏密码`:`设置锁屏密码`,open:t!==null,onCancel:n,mask:{closable:i.modalClickMaskToClose},footer:null,destroyOnHidden:!0,children:/* @__PURE__ */ U(q,{layout:`vertical`,onFinish:r=>{t===`change`&&!e.verifyLockPassword(r.current??``)?a.error(`原锁屏密码不正确`):(e.setLockPassword(r.password),n(),a.success(`锁屏密码已保存`))},children:[t===`change`&&/* @__PURE__ */ H(q.Item,{name:`current`,label:`原锁屏密码`,rules:[{required:!0}],children:/* @__PURE__ */ H(J.Password,{autoComplete:`off`})}),/* @__PURE__ */ H(q.Item,{name:`password`,label:`新锁屏密码`,rules:[{required:!0},{min:4,message:`至少输入 4 位字符`}],children:/* @__PURE__ */ H(J.Password,{autoComplete:`new-password`})}),/* @__PURE__ */ H(q.Item,{name:`confirm`,label:`确认密码`,dependencies:[`password`],rules:[{required:!0},({getFieldValue:e})=>({validator:(t,n)=>n===e(`password`)?Promise.resolve():Promise.reject(/* @__PURE__ */ Error(`两次密码不一致`))})],children:/* @__PURE__ */ H(J.Password,{autoComplete:`new-password`})}),/* @__PURE__ */ H(G,{htmlType:`submit`,type:`primary`,children:`保存`})]},t)})}function Rn(){return(Rn=e((()=>{})))()}function zn({name:e,size:t=16,fallback:n=null,...r}){return xe(),e?Se(e,t,r)??n:n}function Bn(){return(Bn=e((()=>{Ce()})))()}function Vn(e){let t=e===`sunday`?0:1;return rt.updateLocale(`zh-cn`,{weekStart:t}),rt.updateLocale(`en`,{weekStart:t}),Promise.resolve()}function Hn(){return(Hn=e((()=>{rt.extend(Nt)})))()}function Un({children:e}){return/* @__PURE__ */ H(Mt,{onWeekStartChange:Vn,children:e})}function Wn(){return(Wn=e((()=>{Hn()})))()}function Gn({children:e,dark:t}){let{token:n}=X.useToken();return L(()=>{document.body.setAttribute(`theme-mode`,t?`dark`:`light`),document.body.style.colorScheme=t?`dark`:`light`,document.body.style.fontFamily=n.fontFamily;let e={"font-family":n.fontFamily??`-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif`,"color-primary":n.colorPrimary,"color-primary-hover":n.colorPrimaryHover,"color-primary-active":n.colorPrimaryActive,"color-primary-light-default":n.colorPrimaryBg,"color-primary-light-hover":n.colorPrimaryBgHover,"color-primary-light-active":n.colorPrimaryBorder,"color-bg-0":n.colorBgLayout,"color-bg-1":n.colorBgContainer,"color-bg-2":n.colorBgElevated,"color-bg-3":n.colorBgSpotlight,"color-text-0":n.colorText,"color-text-1":n.colorTextSecondary,"color-text-2":n.colorTextTertiary,"color-text-3":n.colorTextQuaternary,"color-border":n.colorBorder,"color-fill-0":n.colorFillTertiary,"color-fill-1":n.colorFillSecondary,"color-fill-2":n.colorFill,"color-danger":n.colorError,"color-success":n.colorSuccess,"color-warning":n.colorWarning,"color-info":n.colorInfo,"color-danger-light-default":n.colorErrorBg,"color-success-light-default":n.colorSuccessBg,"color-warning-light-default":n.colorWarningBg,"border-radius-small":n.borderRadiusSM+`px`,"border-radius-medium":n.borderRadius+`px`,"border-radius-large":n.borderRadiusLG+`px`};for(let[t,n]of Object.entries(e))document.body.style.setProperty(`--arc-antd-`+t,n);for(let[e,t]of Object.entries({primary:n.colorPrimary,success:n.colorSuccess,warning:n.colorWarning,danger:n.colorError}))document.body.style.setProperty(`--arcbase-avatar-`+e,t)},[n,t]),/* @__PURE__ */ H(V,{children:e})}function Kn({children:e}){let t=Ue(),[n]=B(ze),{locale:r,theme:i}=bt(),a=R(()=>t?.preferences??{...n,colorMode:i??n.colorMode},[t?.preferences,n,i]),o=ut(),[c,l]=B(()=>/* @__PURE__ */ new Date);L(()=>{l(/* @__PURE__ */ new Date)},[a.scheduledDarkMode,a.scheduledDarkStart,a.scheduledDarkEnd]),L(()=>{let e=()=>{document.visibilityState===`visible`&&l(/* @__PURE__ */ new Date)};return document.addEventListener(`visibilitychange`,e),window.addEventListener(`focus`,e),()=>{document.removeEventListener(`visibilitychange`,e),window.removeEventListener(`focus`,e)}},[]),L(()=>{let e=Ve(a,c);if(e===null)return;let t=setTimeout(()=>l(/* @__PURE__ */ new Date),e+50);return()=>clearTimeout(t)},[a,c]);let u=a.colorMode===`dark`||a.colorMode===`system`&&o||Be(a,c),d=Rt(a.themeColor,u),f={none:0,small:4,medium:6,large:12}[a.borderRadius],p=a.fontFamily===`mono`?`"Cascadia Code", Consolas, monospace`:a.fontFamily===`inter`?`Inter, "Microsoft YaHei", sans-serif`:a.fontFamily===`noto-sans-sc`?`"Noto Sans SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif`:X.defaultSeed.fontFamily;return L(()=>{document.body.style.setProperty(`--arcbase-ui-scale`,String(a.uiScale/100)),document.body.style.setProperty(`zoom`,String(a.uiScale/100)),document.body.dataset.reduceMotion=String(a.reduceMotion),document.body.style.filter=a.grayscale?`grayscale(1)`:a.colorBlind?`saturate(.75) contrast(1.1)`:``},[a.uiScale,a.reduceMotion,a.grayscale,a.colorBlind]),/* @__PURE__ */ H(qn.Provider,{value:u,children:/* @__PURE__ */ H(K,{locale:r===`en-US`?Lt:It,theme:{algorithm:u?X.darkAlgorithm:X.defaultAlgorithm,token:{colorPrimary:d.primary,borderRadius:f,fontFamily:p,...a.reduceMotion?{motionDurationFast:`0s`,motionDurationMid:`0s`,motionDurationSlow:`0s`}:{}}},children:/* @__PURE__ */ U(We,{children:[/* @__PURE__ */ H(s,{}),/* @__PURE__ */ H(Te.Provider,{value:{isDark:u,mode:a.colorMode,themeColor:a.themeColor,setThemeMode:e=>t?.setPreferences({colorMode:e}),setThemeColor:e=>t?.setPreferences({themeColor:e}),cycleTheme:()=>t?.setPreferences({colorMode:a.colorMode===`light`?`dark`:a.colorMode===`dark`?`system`:`light`}),resetTheme:()=>t?.resetPreference([`colorMode`,`themeColor`])},children:/* @__PURE__ */ H(Gn,{dark:u,children:e})})]})})})}var qn,Jn;function Yn(){return(Yn=e((()=>{de(),we(),qn=Me(!1),Jn=()=>Ie(qn)})))()}function Xn(){let{overrides:e,setPreferences:t}=W(),[n,r]=B(!1),[i,a]=B(``),s=Fe(()=>{ye(JSON.stringify({overrides:e},null,2),{success:`偏好设置已复制到剪贴板`,error:`复制失败,请重试`})},[e]),c=Fe(()=>{zt(new Blob([JSON.stringify({overrides:e},null,2)],{type:`application/json`}),`arcbase-preferences.json`),o.success(`偏好配置已导出为文件`)},[e]),[l,u]=B(!1),[d,f]=B(``);return{prefsVisible:n,setPrefsVisible:r,prefsSearch:i,setPrefsSearch:a,handleCopyPreferences:s,handleExportPreferences:c,importPrefsVisible:l,setImportPrefsVisible:u,importPrefsText:d,setImportPrefsText:f,handleImportPreferences:Fe(()=>{let e;try{e=JSON.parse(d)}catch{o.error(`JSON 解析失败,请检查格式`);return}let n=He(e&&typeof e==`object`&&`overrides`in e?e.overrides:null);if(!n){o.error(`未识别到有效的偏好设置字段`);return}let r=t(n);u(!1),f(``),r.applied>0?o.success(`已导入 ${r.applied} 项设置${r.skipped?`,跳过 ${r.skipped} 项系统管理设置`:``}`):o.info(`所选设置由系统管理,未导入任何修改`)},[d,t])}}function Zn(){return(Zn=e((()=>{de(),be()})))()}function Qn({homePaths:e,lock:t}){let{preferences:n,setPreferences:r,resetPreferences:i,hasEditablePreferences:a}=W(),o=Xn(),s=Jn(),[c,l]=B(null),u=()=>{o.setImportPrefsVisible(!1),o.setImportPrefsText(``)};return/* @__PURE__ */ U(V,{children:[/* @__PURE__ */ H(Y,{title:`偏好设置`,children:/* @__PURE__ */ H(G,{type:`text`,"aria-label":`偏好设置`,icon:/* @__PURE__ */ H(pn,{size:17}),onClick:()=>o.setPrefsVisible(!0)})}),/* @__PURE__ */ U(K,{theme:{algorithm:s?X.darkAlgorithm:X.defaultAlgorithm},children:[/* @__PURE__ */ U(Je,{title:/* @__PURE__ */ U(`div`,{className:`arc-preferences__title`,children:[`偏好设置`,/* @__PURE__ */ H(`span`,{children:`打造适合你的工作界面`})]}),open:o.prefsVisible,onClose:()=>o.setPrefsVisible(!1),size:`min(680px, 100vw)`,destroyOnHidden:!0,className:`arc-preferences`,styles:{body:{padding:0,display:`flex`,flexDirection:`column`,overflow:`hidden`}},footer:/* @__PURE__ */ U(`div`,{className:`arc-preferences__footer`,children:[/* @__PURE__ */ H(`p`,{children:`修改后自动保存;单项可通过「跟随系统」恢复默认。`}),/* @__PURE__ */ U(`div`,{className:`arc-preferences__actions`,children:[/* @__PURE__ */ H(G,{icon:/* @__PURE__ */ H(_,{size:14}),onClick:o.handleCopyPreferences,children:`复制`}),/* @__PURE__ */ H(G,{icon:/* @__PURE__ */ H(ce,{size:14}),disabled:!a,onClick:()=>o.setImportPrefsVisible(!0),children:`导入`}),/* @__PURE__ */ H(G,{icon:/* @__PURE__ */ H(y,{size:14}),onClick:o.handleExportPreferences,children:`导出`}),/* @__PURE__ */ H(G,{danger:!0,icon:/* @__PURE__ */ H(N,{size:14}),disabled:!a,onClick:()=>ge({title:`恢复系统默认`,content:`清除个人偏好覆盖,重新跟随系统当前默认值。确定恢复吗?`,okText:`重置`,cancelText:`取消`,onOk:i}),children:`恢复默认`})]})]}),children:[/* @__PURE__ */ H(`div`,{className:`arc-preferences__search`,children:/* @__PURE__ */ H(J,{allowClear:!0,prefix:/* @__PURE__ */ H(F,{size:16}),placeholder:`搜索全部设置,如主题、表格、锁屏`,"aria-label":`搜索偏好设置`,value:o.prefsSearch,onChange:e=>o.setPrefsSearch(e.target.value)})}),/* @__PURE__ */ H(Ae,{fallback:/* @__PURE__ */ H(`div`,{className:`arc-preferences__loading`,children:/* @__PURE__ */ H(et,{tip:`正在加载设置`})}),children:/* @__PURE__ */ H($n,{...o,preferences:n,setPreferences:r,navLayout:n.navLayout,mode:n.colorMode,handleThemeModeChange:e=>r({colorMode:e}),isDark:s,themeColor:n.themeColor,setThemeColor:e=>r({themeColor:e}),quickChatEnabled:!1,homePathOptions:e,autoLockMinutes:t.autoLockMinutes,setAutoLockMinutes:t.setAutoLockMinutes,hasPassword:t.hasPassword,clearLockPassword:t.clearLockPassword,openLockPasswordModal:l,onClearSearch:()=>o.setPrefsSearch(``)})})]}),/* @__PURE__ */ H(Ln,{lock:t,mode:c,onClose:()=>l(null)}),/* @__PURE__ */ U(Ze,{title:`导入偏好设置`,open:o.importPrefsVisible,onCancel:u,mask:{closable:n.modalClickMaskToClose},destroyOnHidden:!0,footer:/* @__PURE__ */ H(ve,{onCancel:u,onOk:o.handleImportPreferences,okText:`导入`}),children:[/* @__PURE__ */ H(`p`,{children:`粘贴导出的配置。仅更新有效且允许个人调整的字段。`}),/* @__PURE__ */ H(J.TextArea,{rows:10,"aria-label":`偏好配置 JSON`,value:o.importPrefsText,onChange:e=>o.setImportPrefsText(e.target.value),placeholder:`{"overrides":{}}`})]})]})]})}var $n;function er(){return(er=e((()=>{g(),v(),M(),P(),mn(),se(),Yn(),_e(),he(),Rn(),Zn(),t(),$n=Ne(()=>n(()=>import(`./PreferencesSheetBody-MkbTc5f-.js`),[],import.meta.url))})))()}var tr;function nr(){return(nr=e((()=>{tr=`route-back`})))()}function rr({animation:e,children:t}){return!e||e===`none`?/* @__PURE__ */ H(je,{default:`none`,children:t}):/* @__PURE__ */ H(je,{default:`none`,enter:ir[e],exit:ar[e],children:t})}var ir,ar;function or(){return(or=e((()=>{nr(),ir={fade:`route-vt-fade-in`,"slide-up":`route-vt-slide-up-in`,"slide-left":{[tr]:`route-vt-slide-right-in`,default:`route-vt-slide-left-in`}},ar={fade:`route-vt-fade-out`,"slide-up":`route-vt-slide-up-out`,"slide-left":{[tr]:`route-vt-slide-right-out`,default:`route-vt-slide-left-out`}}})))()}function sr({keepAlivePaths:e,openPaths:t,refreshVersion:n,scrollContainerSelector:r=`.admin-content`,animation:i}){let a=ct(),{pathname:o}=Q(),s=z(/* @__PURE__ */ new Map),c=z(null),l=s.current,u=e.has(o),d=n[o]??0;if(u){let e=l.get(o);!e||e.version!==d?(l.delete(o),l.set(o,{element:a,version:d,scrollTop:e?.scrollTop??0})):(e.element=a,l.delete(o),l.set(o,e))}for(let n of[...l.keys()])(!e.has(n)||n!==o&&!t.has(n))&&l.delete(n);for(;l.size>cr;){let e=[...l.keys()].find(e=>e!==o);if(!e)break;l.delete(e)}return Re(()=>{let e=document.querySelector(r),t=c.current;if(e&&t&&t!==o){let n=l.get(t);n&&(n.scrollTop=e.scrollTop)}e&&(e.scrollTop=l.get(o)?.scrollTop??0),c.current=o},[o,r,l]),/* @__PURE__ */ U(V,{children:[[...l.entries()].map(([e,t])=>/* @__PURE__ */ H(ke,{mode:e===o?`visible`:`hidden`,children:/* @__PURE__ */ H(rr,{animation:i,children:/* @__PURE__ */ H(`div`,{style:{height:`100%`},children:t.element})})},`${e}:${t.version}`)),!u&&/* @__PURE__ */ H(rr,{animation:i,children:/* @__PURE__ */ H(`div`,{style:{height:`100%`},children:a})},`${o}:${d}`)]})}var cr;function lr(){return(lr=e((()=>{or(),cr=10})))()}function ur({menus:e,recentMenus:t,onClearRecents:n,onRemoveRecent:r}){let[i,a]=B(!1),[o,s]=B(!1),c=z(null),l=Ue()?.preferences.enableShortcuts??!0;return L(()=>{let e=()=>{s(!0),a(!0)},t=e=>{(e.ctrlKey||e.metaKey)&&e.key===`k`&&l&&(e.preventDefault(),s(!0),a(e=>!e)),e.key===`Escape`&&a(!1)};return globalThis.addEventListener(`open-menu-palette`,e),globalThis.addEventListener(`keydown`,t),()=>{globalThis.removeEventListener(`open-menu-palette`,e),globalThis.removeEventListener(`keydown`,t)}},[l]),L(()=>{if(i)return;let e=setTimeout(()=>{let e=document.activeElement;e instanceof HTMLElement&&e.blur(),c.current?.blur()},0);return()=>clearTimeout(e)},[i]),/* @__PURE__ */ U(V,{children:[/* @__PURE__ */ U(`button`,{ref:c,type:`button`,className:`menu-search-trigger`,onClick:()=>{s(!0),a(!0)},title:`全局搜索 (Ctrl+K)`,"aria-label":`全局搜索`,"aria-expanded":i,children:[/* @__PURE__ */ H(`span`,{className:`menu-search-trigger__icon`,children:/* @__PURE__ */ H(F,{size:16,strokeWidth:1.8})}),/* @__PURE__ */ H(`span`,{className:`menu-search-trigger__label`,children:`全局搜索`}),/* @__PURE__ */ H(`kbd`,{className:`menu-search-trigger__kbd`,children:`Ctrl K`})]}),o&&/* @__PURE__ */ H(Ae,{fallback:null,children:/* @__PURE__ */ H(dr,{menus:e,recentMenus:t,onClearRecents:n,onRemoveRecent:r,open:i,onClose:()=>{a(!1),setTimeout(()=>{let e=document.activeElement;e instanceof HTMLElement&&e.blur(),c.current?.blur()},0)}})})]})}var dr;function fr(){return(fr=e((()=>{P(),t(),dr=Ne(()=>n(()=>import(`./MenuCommandPalette-DKXTyON1.js`),[],import.meta.url))})))()}function pr(e){return e.filter(e=>e.type!==`button`&&e.visible!==!1&&e.status===`enabled`)}function mr(e){return e.path||pr(e.children??[]).map(mr).find(Boolean)}function hr(e,t){for(let n of pr(e)){if(n.path===t)return[n];let e=hr(n.children??[],t);if(e.length)return[n,...e]}return[]}function gr({menus:e,path:t,title:n,isFavorite:r,toggleFavorite:i}){let{preferences:a}=W(),o=st(),s=hr(e,t),c=s.at(-1),l={title:/* @__PURE__ */ U($e,{size:4,children:[a.breadcrumbIcon&&/* @__PURE__ */ H(Gt,{size:13}),`首页`]}),onClick:a.breadcrumbClickable?()=>o(`/`):void 0},u=s.map((e,t)=>({title:/* @__PURE__ */ U($e,{size:4,children:[a.breadcrumbIcon&&e.icon&&/* @__PURE__ */ H(zn,{name:e.icon}),` `,e.title]}),onClick:t<s.length-1&&a.breadcrumbClickable&&mr(e)?()=>o(mr(e)):void 0,...a.breadcrumbSubMenu&&t<s.length-1?{menu:{items:pr(e.children??[]).map(e=>({key:String(e.id),label:e.title,onClick:()=>{let t=mr(e);t&&o(t)}}))}}:{}}));return/* @__PURE__ */ U($e,{size:6,style:{marginBottom:12},children:[/* @__PURE__ */ H(qe,{items:[...a.breadcrumbShowHome&&t!==`/`?[l]:[],...u.length?u:[{title:n}]]}),a.showFavorites&&c&&/* @__PURE__ */ H(G,{size:`small`,type:`text`,"aria-label":r(c.id)?`取消收藏此页`:`收藏此页`,onClick:()=>i(c.id),icon:/* @__PURE__ */ H(gn,{size:14,fill:r(c.id)?`currentColor`:`none`,style:{color:r(c.id)?`var(--arc-antd-color-warning)`:void 0}})})]})}function _r(){return(_r=e((()=>{Kt(),_n(),Bn()})))()}function vr(){let{pathname:e}=Q(),t=z(e),[n,r]=B(0);return L(()=>{if(t.current===e)return;t.current=e,r(20);let n=setInterval(()=>r(e=>Math.min(90,e+15)),100),i=setTimeout(()=>{clearInterval(n),r(100)},400),a=setTimeout(()=>r(0),700);return()=>{clearInterval(n),clearTimeout(i),clearTimeout(a)}},[e]),n>0?/* @__PURE__ */ H(`div`,{"aria-label":`页面切换进度`,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,style:{position:`fixed`,inset:`0 auto auto 0`,height:3,width:n+`%`,background:`var(--arc-antd-color-primary)`,zIndex:2e3,transition:`width .2s, opacity .3s`,opacity:n===100?0:1}}):null}function yr(){return(yr=e((()=>{})))()}function br({menus:e,current:t,favorites:n}){let r=st(),i=(e,t)=>{let r=[...n.favorites],i=r.indexOf(e),a=i+t;i<0||a<0||a>=r.length||([r[i],r[a]]=[r[a],r[i]],n.reorder(r))},a=n.favorites.flatMap((t,a)=>{let o=e.find(e=>e.id===t);return o?[{key:String(t),label:o.title,children:[{key:t+`-open`,label:`打开页面`,onClick:()=>o.path&&r(o.path)},{key:t+`-up`,label:`上移`,disabled:a===0,onClick:()=>i(t,-1)},{key:t+`-down`,label:`下移`,disabled:a===n.favorites.length-1,onClick:()=>i(t,1)},{key:t+`-remove`,label:`取消收藏`,onClick:()=>n.toggle(t)}]}]:[]});return/* @__PURE__ */ H(Ye,{menu:{items:[...a,...t?[{key:`current`,label:n.isFavorite(t.id)?`取消收藏此页`:`收藏此页`,onClick:()=>n.toggle(t.id)}]:[]]},children:/* @__PURE__ */ H(G,{"aria-label":`收藏菜单`,icon:/* @__PURE__ */ H(gn,{size:16})})})}function xr(){return(xr=e((()=>{_n()})))()}function Sr(e){return e===`vertical`?{x1:`0`,y1:`0`,x2:`0`,y2:`1`}:{x1:`0`,y1:`0`,x2:`1`,y2:`0`}}function Cr([e,t]){return`color-mix(in srgb, var(--arc-antd-color-primary) ${e}%, ${t})`}var wr,Tr,Er;function Dr(){return(Dr=e((()=>{wr=`0 0 64 64`,Tr=2.5,Er=[{key:`top`,d:`M8 46 L8 29 C8 15 18 6 32 6 L32 18 C25 18 20 23 20 30 L20 46Z`,axis:`horizontal`,stops:[[52,`#fff`],[70,`#fff`]]},{key:`band`,d:`M32 6 C46 6 56 15 56 29 L56 46 L44 46 L44 30 C44 23 39 18 32 18Z`,axis:`vertical`,stops:[[92,`#000`],[88,`#fff`]]},{key:`base`,d:`M8 46 L56 46 L56 57 L8 57Z M25 32 L39 32 L39 39 L25 39Z`,axis:`horizontal`,stops:[[80,`#000`],[66,`#000`]]}]})))()}function Or({size:e=28,className:t}){let n=Le().replaceAll(/[^a-zA-Z0-9]/g,``),r=bt().brand?.logo;if(r!==void 0)return/* @__PURE__ */ H(`span`,{className:[`app-logo`,t].filter(Boolean).join(` `),style:{width:e,height:e,display:`inline-flex`,alignItems:`center`,justifyContent:`center`},children:r});let i=e=>`app-logo-${e}-${n}`,a=[`app-logo`,t].filter(Boolean).join(` `);return/* @__PURE__ */ U(`svg`,{className:a,width:e,height:e,viewBox:wr,fill:`none`,"aria-hidden":`true`,focusable:`false`,children:[/* @__PURE__ */ H(`defs`,{children:Er.map(e=>/* @__PURE__ */ U(`linearGradient`,{id:i(e.key),...Sr(e.axis),children:[/* @__PURE__ */ H(`stop`,{offset:`0`,style:{stopColor:Cr(e.stops[0])}}),/* @__PURE__ */ H(`stop`,{offset:`1`,style:{stopColor:Cr(e.stops[1])}})]},e.key))}),Er.map(e=>/* @__PURE__ */ H(`path`,{d:e.d,fill:`url(#${i(e.key)})`,stroke:`url(#${i(e.key)})`,strokeWidth:Tr,strokeLinejoin:`round`},e.key))]})}function kr(){return(kr=e((()=>{Dr()})))()}function Ar(){return(Ar=e((()=>{})))()}function jr(){return(jr=e((()=>{})))()}function Mr({onLogin:e}){let t=xt(),{brand:n}=bt(),r=st(),i=Q(),a=new URLSearchParams(i.search),s=a.get(`redirect`)??`/`,c=s.startsWith(`/`)&&!s.startsWith(`//`)&&!s.startsWith(`/login`)?s:`/`,l=a.get(`username`)??``,{resolveSessionConflict:u}=vt(),[d,p]=B(!1),[m,h]=B(null),[g,_]=B(!1),[v,y]=B(null),b=Ht(),x=Ut(b.data?.passwordLogin===!0),S=x.data?.enabled??!1,C=S||v!==null,ee=v?.captchaId??x.data?.captchaId,w=v?.svg??x.data?.svg,te=()=>{x.refetch()},T=R(()=>({username:[{required:!0,message:`请输入用户名/手机号`}],password:[{required:!0,message:`请输入密码`}],captchaCode:C?[{required:!0,message:`请输入验证码`}]:[]}),[C]),E=R(()=>({username:l,password:``,captchaCode:``}),[l]),D=gt(E,T),[O,k]=B(null),A=z(!1),j=D.setValue;L(()=>{if(A.current)return;A.current=!0;let e=Vt();e&&(e.reason&&e.reason!==`rotated`&&e.reason!==`logout`?(k(e),e.username&&!l&&j(`username`,e.username)):o.warning({content:e.message,duration:6}))},[j,l]);let M=()=>{c===`/`&&wn(),r(c,{replace:!0})},N=async t=>{if(!d){p(!0);try{let n=await e(t.username,t.password,ee,C?t.captchaCode:void 0);D.setValue(`captchaCode`,``),n.outcome.type===`captcha`?(y(n.outcome.value),D.setFormError(n.outcome.value.message)):M()}catch(e){if(e instanceof nt&&e.status===409){let t=Bt.safeParse(e.details);if(t.success&&t.data.details.type===`sessionLimit`){h(t.data.details.value);return}}D.setFormError(e instanceof Error?e.message:`登录失败`),S&&te()}finally{p(!1)}}},P=async()=>{if(m&&!g){_(!0);try{await u(m.ticket),h(null),M()}catch(e){D.setFormError(e instanceof Error?e.message:`登录失败`),h(null)}finally{_(!1)}}},F=e=>{e.preventDefault();let t=D.validate();t&&N(t)},I=()=>b.data?b.data.externalLogin?/* @__PURE__ */ H(ft,{onSuccess:M}):/* @__PURE__ */ U(`form`,{className:`login-form`,onSubmit:F,noValidate:!0,children:[/* @__PURE__ */ H(mt,{...D.field(`username`),id:`login-username`,placeholder:`请输入用户名/手机号`,prefix:/* @__PURE__ */ H(Sn,{}),size:`large`,autoComplete:`username`}),/* @__PURE__ */ H(mt,{...D.field(`password`),id:`login-password`,mode:`password`,placeholder:`请输入密码`,prefix:/* @__PURE__ */ H(Zt,{}),size:`large`,autoComplete:`current-password`}),C&&/* @__PURE__ */ U(`div`,{style:{display:`flex`,gap:8,alignItems:`flex-start`},children:[/* @__PURE__ */ H(`div`,{style:{flex:1},children:/* @__PURE__ */ H(mt,{...D.field(`captchaCode`),id:`login-captcha`,placeholder:`请输入验证码`,size:`large`,autoComplete:`one-time-code`})}),S?/* @__PURE__ */ H(`button`,{type:`button`,style:{...Rr,cursor:`pointer`},title:`点击刷新验证码`,onClick:te,children:/* @__PURE__ */ H(`img`,{src:w,alt:`登录验证码`,width:160,height:48})}):/* @__PURE__ */ H(`img`,{src:w,alt:`登录验证码`,width:180,height:48})]}),/* @__PURE__ */ H(ht,{message:D.formError}),/* @__PURE__ */ H(pe,{htmlType:`submit`,type:`primary`,theme:`solid`,loading:d,block:!0,size:`large`,style:Lr,children:`登录`})]}):/* @__PURE__ */ U(`div`,{children:[/* @__PURE__ */ H(fe,{}),b.isError&&/* @__PURE__ */ H(pe,{onClick:()=>{b.refetch()},children:`重新读取登录方式`})]}),ne=Ir[O?.reason??``]??`会话已被强制下线`;return/* @__PURE__ */ U(`div`,{className:`login-page`,children:[/* @__PURE__ */ U(`div`,{className:`login-bg`,"aria-hidden":`true`,style:n?.loginImage?{backgroundImage:`url(${JSON.stringify(n.loginImage)})`,backgroundSize:`cover`,backgroundPosition:`center`}:void 0,children:[/* @__PURE__ */ H(`div`,{className:`login-wash login-wash-a`}),/* @__PURE__ */ H(`div`,{className:`login-wash login-wash-b`})]}),/* @__PURE__ */ U(`header`,{className:`login-topbar`,children:[/* @__PURE__ */ H(Or,{size:34}),/* @__PURE__ */ H(`span`,{className:`login-brand-name`,children:t})]}),/* @__PURE__ */ U(`main`,{className:`login-main`,children:[/* @__PURE__ */ U(`section`,{className:`login-hero`,children:[/* @__PURE__ */ H(`div`,{className:`login-eyebrow`,children:`企业级后台管理`}),/* @__PURE__ */ U(`h1`,{className:`login-headline`,children:[`高效管理,`,/* @__PURE__ */ H(`br`,{}),/* @__PURE__ */ H(`span`,{className:`login-headline-highlight`,children:`赋能业务增长`})]}),/* @__PURE__ */ H(`p`,{className:`login-desc`,children:`企业级后台管理系统,为团队提供高效、稳定、安全的一站式管理解决方案。`}),/* @__PURE__ */ H(`div`,{className:`login-feature-list`,children:[`精细化权限管理`,`安全审计机制`,`稳定可靠运行`,`多租户支持`].map(e=>/* @__PURE__ */ U(`div`,{className:`login-feature-item`,children:[/* @__PURE__ */ H(`span`,{className:`login-feature-check`,children:/* @__PURE__ */ H(f,{size:12,strokeWidth:3})}),e]},e))})]}),/* @__PURE__ */ U(`div`,{className:`login-card${b.data?.externalLogin?` login-card-external`:``}`,children:[/* @__PURE__ */ U(`div`,{className:`login-form-header`,children:[/* @__PURE__ */ H(Pr,{heading:3,style:{marginBottom:8,fontWeight:600},children:`欢迎回来`}),/* @__PURE__ */ H(Fr,{type:`tertiary`,style:{fontSize:14,display:`block`,marginBottom:24},children:`请输入您的账号信息以登录工作台`})]}),O&&/* @__PURE__ */ U(`div`,{className:`login-alert${O.reason===`concurrent-login`?` login-alert-danger`:``}`,role:`alert`,children:[/* @__PURE__ */ H(oe,{size:18,className:`login-alert-icon`,"aria-hidden":!0}),/* @__PURE__ */ U(`div`,{className:`login-alert-body`,children:[/* @__PURE__ */ H(`div`,{className:`login-alert-title`,children:ne}),/* @__PURE__ */ H(`div`,{className:`login-alert-text`,children:O.message})]}),/* @__PURE__ */ H(`button`,{type:`button`,className:`login-alert-close`,"aria-label":`关闭提示`,onClick:()=>k(null),children:`×`})]}),/* @__PURE__ */ H(`div`,{style:{marginBottom:20},children:I()}),!1]})]}),/* @__PURE__ */ U(`footer`,{className:`login-footer`,children:[`© `,rt().year(),` `,n?.copyrightName??t,` · 高效 · 稳定 · 安全`,n?.icpNumber&&/* @__PURE__ */ U(`span`,{children:[` · `,n.icpUrl?/* @__PURE__ */ H(`a`,{href:n.icpUrl,target:`_blank`,rel:`noopener noreferrer`,children:n.icpNumber}):n.icpNumber]})]}),m&&/* @__PURE__ */ H(Ae,{fallback:null,children:/* @__PURE__ */ H(Nr,{conflict:m,loading:g,onConfirm:()=>void P(),onCancel:()=>h(null)})})]})}var Nr,Pr,Fr,Ir,Lr,Rr;function zr(){return(zr=e((()=>{de(),Cn(),Qt(),ae(),u(),On(),kr(),Ar(),jr(),t(),Nr=Ne(()=>n(()=>import(`./SessionConflictModal-IIDTCm9d.js`),[],import.meta.url)),{Title:Pr,Text:Fr}=a,Ir={"concurrent-login":`已在其他设备登录`,"password-changed":`密码已修改`},Lr={marginTop:8,borderRadius:`var(--semi-border-radius-medium)`,height:42},Rr={flexShrink:0,borderRadius:`var(--semi-border-radius-small)`,overflow:`hidden`,border:`1px solid var(--semi-color-border)`,padding:0,background:`transparent`,lineHeight:0}})))()}function Br({children:e,actions:t,mobile:n,collapsed:r,showTrigger:i,onToggle:a}){return/* @__PURE__ */ U(`header`,{className:`arc-layout-header`,children:[/* @__PURE__ */ U(`div`,{className:`arc-layout-header__navigation`,children:[i&&/* @__PURE__ */ H(G,{type:`text`,className:`arc-layout-icon-button`,"aria-label":n?`打开导航菜单`:r?`展开侧边栏`:`收起侧边栏`,icon:n?/* @__PURE__ */ H(p,{size:19}):H(r?sn:rn,{size:18}),onClick:a}),/* @__PURE__ */ H(`div`,{className:`arc-layout-header__title`,children:e})]}),/* @__PURE__ */ H(`div`,{className:`arc-layout-header__actions`,children:t})]})}function Vr(){return(Vr=e((()=>{d(),an(),cn()})))()}function Hr({width:e,collapsed:t,logo:n,children:r,title:i,rail:a,onToggle:o,onHover:s}){return/* @__PURE__ */ U(`aside`,{className:`arc-layout-sidebar`,"aria-label":`主导航`,style:{width:e},onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[a&&/* @__PURE__ */ U(`div`,{className:`arc-layout-rail`+(a.showLabels?` arc-layout-rail--labels`:``),children:[/* @__PURE__ */ H(`div`,{className:`arc-layout-logo arc-layout-logo--compact`,children:n}),/* @__PURE__ */ H(De,{className:`arc-layout-rail__menu`,"aria-label":`导航分组`,children:a.items.map(e=>/* @__PURE__ */ H(Y,{title:e.label,placement:`right`,children:/* @__PURE__ */ U(`button`,{type:`button`,className:`arc-layout-rail__item`+(a.activeKey===e.key?` arc-layout-rail__item--active`:``),"aria-label":e.label,"aria-current":a.activeKey===e.key?`page`:void 0,onClick:()=>a.onSelect(e.key),children:[e.icon??/* @__PURE__ */ H(C,{size:20}),/* @__PURE__ */ H(`span`,{children:e.label})]})},e.key))})]}),/* @__PURE__ */ U(`div`,{className:`arc-layout-sidebar__column`,children:[/* @__PURE__ */ U(`div`,{className:`arc-layout-logo`+(t?` arc-layout-logo--compact`:``),children:[!a&&n,!t&&/* @__PURE__ */ H(`strong`,{children:i})]}),/* @__PURE__ */ H(De,{className:`arc-layout-sidebar__scroll`,"aria-label":`导航菜单`,children:r}),/* @__PURE__ */ H(G,{type:`text`,className:`arc-layout-sidebar__trigger`,"aria-label":t?`展开侧边栏`:`收起侧边栏`,icon:H(t?sn:rn,{size:17}),onClick:o})]})]})}function Ur(){return(Ur=e((()=>{S(),an(),cn(),Ee()})))()}function Wr(e,{settingsKey:t,profileIcon:n,settingsIcon:r}){let i=e=>e.flatMap(e=>{if(e.path===`/profile`)return[];let n=e.children?i(e.children):void 0;return n?.length===0&&!e.path&&e.key!==t?[]:[{...e,...n?{children:n}:{}}]}),a=i(e),o={key:`personal-center`,label:`个人中心`,path:`/profile`,icon:n},s=a.findIndex(e=>e.key===t);return s<0?[...a,{key:`personal-settings`,label:`系统设置`,icon:r,children:[o]}]:a.map((e,t)=>t===s?{...e,children:[o,...e.children??[]]}:e)}function Gr(e,t){for(let n of e){if(n.path===t)return[n];let e=Gr(n.children??[],t);if(e.length)return[n,...e]}return[]}function Kr(e){return e.path||e.children?.map(Kr).find(Boolean)}function qr(e,t=[]){return Object.fromEntries(e.flatMap(e=>[[e.key,t],...Object.entries(qr(e.children??[],[...t,e.key]))]))}function Jr(e,t,n){let r=e.find(e=>!t.includes(e));if(r)return[...n[r]??[],r];let i=t.find(t=>!e.includes(t));return i?n[i]??[]:e}function Yr({items:e,path:t,collapsed:n=!1,accordion:r=!1,dark:i=!1,scrollIntoView:a,mode:o=`inline`,onSelect:s}){let{token:c}=X.useToken(),l=`color-mix(in srgb, ${c.colorPrimaryBg} 50%, ${c.colorPrimaryBgHover})`,[u,d]=B([]),f=z(null),p=R(()=>qr(e),[e]),m=R(()=>Gr(e,t).map(e=>e.key),[e,t]),h=R(()=>{let t=e=>e.map(({children:e,...n})=>e?.length?{...n,children:t(e)}:n);return t(e)},[e]),g=o===`inline`;return L(()=>{d(e=>n?[]:r?m.slice(0,-1):[.../* @__PURE__ */ new Set([...e.filter(e=>e in p),...m.slice(0,-1)])])},[m,n,r,p]),L(()=>{if(!a||!g||n)return;let e=requestAnimationFrame(()=>f.current?.querySelector(`.ant-menu-item-selected`)?.scrollIntoView({block:`nearest`}));return()=>cancelAnimationFrame(e)},[t,u,a,g,n]),/* @__PURE__ */ H(`div`,{ref:f,className:`arc-layout-menu`,style:{"--arc-layout-menu-selected-bg":i?c.colorPrimary:l},children:/* @__PURE__ */ H(K,{theme:{components:{Menu:{itemSelectedBg:l}}},children:/* @__PURE__ */ H(Xe,{className:`arc-layout-menu__items`,items:h,mode:o,theme:i?`dark`:`light`,inlineIndent:16,selectedKeys:m,...g?{inlineCollapsed:n,openKeys:u,onOpenChange:e=>d(r||n?Jr(e,u,p):e)}:{},onClick:({key:e})=>s(e)})})})}function Xr(){return(Xr=e((()=>{})))()}function Zr({preferences:e,dark:t,mobile:n,collapsed:r,maximized:i,title:a,brand:o,logo:s,menus:c,path:l,breadcrumb:u,actions:d,tabbar:f,children:p,onCollapse:m,onNavigate:h,onRestore:g}){let{token:_}=X.useToken(),v=R(()=>X.getDesignToken({algorithm:X.darkAlgorithm,token:{colorPrimary:_.colorPrimary}}),[_.colorPrimary]),[y,b]=B(!1),x=n?`vertical`:e.navLayout,S=x===`mixed`||x===`double`,C=R(()=>Gr(c,l)[0]??c[0],[c,l]),ee=S&&C?C.children?.length?C.children:[C]:c,w=x!==`horizontal`,te=e.sidebarHoverTrigger&&r&&y&&!n,T=r&&!te,E=x===`double`?e.doubleRailStyle===`icon-text`?80:56:0,D=E+(T?56:e.sidebarWidth),O=n||i||!w?0:E+(r?56:e.sidebarWidth),A=t||e.sidebarDarkMode,j=t||e.headerDarkMode,M=(e,t)=>t?e===`bg-0`?v.colorBgLayout:v.colorBgContainer:_.colorBgContainer,N={fontFamily:_.fontFamily,fontSize:_.fontSize,lineHeight:_.lineHeight,"--arc-layout-sidebar-width":`${O}px`,"--arc-layout-sidebar-bg":M(e.darkSidebarTone,A),"--arc-layout-header-bg":M(e.darkHeaderTone,j),"--arc-layout-sidebar-text":A?v.colorText:_.colorText,"--arc-layout-sidebar-border":A?v.colorBorderSecondary:_.colorBorderSecondary,"--arc-layout-header-text":j?v.colorText:_.colorText,"--arc-layout-header-border":j?v.colorBorderSecondary:_.colorBorderSecondary,"--arc-layout-tab-active-bg":j?v.colorPrimaryBg:_.colorPrimaryBg,"--arc-layout-tabbar-height":f?e.compactTabs?`35px`:`43px`:`0px`,"--arc-layout-content-bg":t?M(e.darkContentTone,!0):_.colorBgLayout,"--arc-layout-rail-width":`${E}px`},P=e=>{let t=n=>{for(let r of n){if(r.key===e)return r;let n=t(r.children??[]);if(n)return n}},r=t(c),i=r&&Kr(r);i&&(n&&m(!0),h(i))},F=(t,n=T,r=`inline`)=>/* @__PURE__ */ H(Yr,{items:t,path:l,collapsed:n,mode:r,accordion:e.sidebarAccordion,dark:r===`horizontal`?j:A,scrollIntoView:e.scrollMenuIntoView,onSelect:P}),I=S?c.map(e=>({...e,children:void 0})):c,ne={algorithm:A?X.darkAlgorithm:X.defaultAlgorithm};return/* @__PURE__ */ U(`section`,{className:`arc-admin-layout arc-admin-layout--`+x+(i?` arc-admin-layout--maximized`:``)+(e.sidebarToggleIconPosition===`left`?` arc-admin-layout--arrow-left`:``)+(e.sidebarStickyScroll?` arc-admin-layout--sticky-menu`:``),style:N,"data-layout-source":`react-antd-admin`,children:[!n&&!i&&w&&/* @__PURE__ */ H(K,{theme:ne,children:/* @__PURE__ */ H(Hr,{width:D,collapsed:T,title:o,logo:s,onToggle:()=>m(!r),onHover:b,rail:x===`double`?{items:c,activeKey:C?.key??``,showLabels:e.doubleRailStyle===`icon-text`,onSelect:P}:void 0,children:F(ee)})}),/* @__PURE__ */ U(`div`,{className:`arc-layout-main`,children:[!i&&/* @__PURE__ */ H(K,{theme:{algorithm:j?X.darkAlgorithm:X.defaultAlgorithm},children:/* @__PURE__ */ U(Br,{mobile:n,collapsed:r,showTrigger:n||x===`vertical`||x===`double`,onToggle:()=>m(!r),actions:d,children:[x===`horizontal`&&/* @__PURE__ */ U(`div`,{className:`arc-layout-header__brand`,children:[s,/* @__PURE__ */ H(`strong`,{children:o})]}),x===`horizontal`||x===`mixed`?F(I,!1,`horizontal`):u||/* @__PURE__ */ H(`span`,{className:`arc-layout-page-title`,children:a})]})}),!i&&(x===`horizontal`||x===`mixed`)&&u&&/* @__PURE__ */ H(K,{theme:{algorithm:j?X.darkAlgorithm:X.defaultAlgorithm},children:/* @__PURE__ */ H(`div`,{className:`arc-layout-breadcrumb`,children:u})}),/* @__PURE__ */ H(K,{theme:{algorithm:j?X.darkAlgorithm:X.defaultAlgorithm},children:f}),/* @__PURE__ */ H(De,{as:`main`,horizontal:!0,"aria-label":`页面内容`,className:`admin-content arc-layout-content`+(e.contentWidth===`fixed`?` arc-layout-content--fixed`:``),children:/* @__PURE__ */ H(`div`,{className:`arc-layout-content__inner`,children:p})}),i&&!f&&/* @__PURE__ */ H(G,{className:`arc-layout-restore`,"aria-label":`退出内容全屏`,icon:/* @__PURE__ */ H(k,{size:16}),onClick:g,children:`退出全屏`})]}),n&&/* @__PURE__ */ H(K,{theme:ne,children:/* @__PURE__ */ H(Je,{title:o,placement:`left`,size:Math.min(e.sidebarWidth+24,320),open:!r,onClose:()=>m(!0),className:`arc-layout-mobile-menu`,styles:{body:{padding:0,overflow:`hidden`,background:M(e.darkSidebarTone,A)}},children:/* @__PURE__ */ H(De,{className:`arc-layout-mobile-menu__scroll`,"aria-label":`导航菜单`,style:{height:`100%`},children:F(c,!1)})})})]})}function Qr(){return(Qr=e((()=>{O(),Vr(),Ur(),Xr(),Ee()})))()}function $r({tabs:e,store:t,path:n,preferences:r,maximized:i,onNavigate:a,onRefresh:o,onClose:s,onMaximize:c}){let l=z(null);L(()=>{let e=l.current?.querySelector(`.ant-tabs-nav-wrap`);if(!e||typeof IntersectionObserver>`u`)return;let t=/* @__PURE__ */ new Set,n=new IntersectionObserver(e=>{for(let t of e)t.target.dataset.clipped=String(t.intersectionRatio<.999)},{root:e,threshold:[0,.999,1]}),r=()=>{let r=new Set(e.querySelectorAll(`.ant-tabs-tab`));for(let e of t)r.has(e)||(n.unobserve(e),t.delete(e));for(let e of r)t.has(e)||(n.observe(e),t.add(e))};r();let i=new MutationObserver(r);return i.observe(e,{childList:!0,subtree:!0}),()=>{n.disconnect(),i.disconnect();for(let e of t)delete e.dataset.clipped}},[e.length,r.tabStyle,r.compactTabs]);let u=e.map(e=>e.key),[d,f]=B({keys:u,entering:/* @__PURE__ */ new Set});u.join(`\0`)!==d.keys.join(`\0`)&&f({keys:u,entering:new Set([...d.entering,...u.filter(e=>!d.keys.includes(e))].filter(e=>u.includes(e)))});let p=e=>f(t=>({...t,entering:new Set([...t.entering].filter(t=>t!==e))})),m=e=>[{key:`refresh`,label:`刷新`,icon:/* @__PURE__ */ H(j,{size:14}),onClick:()=>o(e.key)},{key:`pin`,label:e.pinned?`取消固定`:`固定`,disabled:e.key===`/`,icon:/* @__PURE__ */ H(un,{size:14}),onClick:()=>e.pinned?t.unpinTab(e.key):t.pinTab(e.key)},{type:`divider`},{key:`close`,label:`关闭当前`,disabled:!e.closable||e.pinned,onClick:()=>s(e.key)},{key:`others`,label:`关闭其他`,onClick:()=>a(t.closeOthers(e.key))},{key:`left`,label:`关闭左侧`,onClick:()=>a(t.closeLeft(e.key))},{key:`right`,label:`关闭右侧`,onClick:()=>a(t.closeRight(e.key))},{key:`all`,label:`关闭全部`,onClick:()=>{t.closeAll(),a(`/`)}}],g=e.find(e=>e.key===n)??e[0];return/* @__PURE__ */ H(`div`,{ref:l,className:`arc-layout-tabbar arc-layout-tabbar--`+r.tabStyle+(r.compactTabs?` arc-layout-tabbar--compact`:``)+(r.autoHideTabs?` arc-layout-tabbar--autohide`:``),"data-tab-animation":r.reduceMotion?`none`:r.tabAnimation,children:/* @__PURE__ */ H(tt,{activeKey:n,onChange:a,type:`editable-card`,hideAdd:!0,size:`small`,animated:!1,more:{trigger:`click`,icon:/* @__PURE__ */ H(`span`,{role:`img`,"aria-label":`更多标签页`,title:`更多标签页`,children:/* @__PURE__ */ H(x,{size:16})})},onEdit:(e,t)=>{t===`remove`&&typeof e==`string`&&s(e)},items:e.map(e=>({key:e.key,closable:e.closable&&!e.pinned,closeIcon:/* @__PURE__ */ H(ue,{size:12,"aria-label":`关闭`+e.title}),label:/* @__PURE__ */ H(Ye,{trigger:[`contextMenu`],menu:{items:m(e)},children:/* @__PURE__ */ U(`span`,{className:`arc-layout-tab-label`+(d.entering.has(e.key)?` arc-layout-tab-label--entering`:``),onAnimationEnd:()=>p(e.key),draggable:e.key!==`/`&&!e.pinned,onDragStart:t=>t.dataTransfer.setData(`arcbase-tab`,e.key),onDragOver:e=>e.preventDefault(),onDrop:n=>{let r=n.dataTransfer.getData(`arcbase-tab`);r&&t.reorderTabs(r,e.key)},onDoubleClick:()=>{r.tabDoubleClickAction===`refresh`&&o(e.key),r.tabDoubleClickAction===`close`&&e.closable&&!e.pinned&&s(e.key)},children:[e.pinned&&/* @__PURE__ */ H(un,{size:12}),r.showTabIcon&&e.icon&&/* @__PURE__ */ H(zn,{name:e.icon}),e.title]})})})),tabBarExtraContent:/* @__PURE__ */ U(`div`,{className:`arc-layout-tabbar__actions`,children:[/* @__PURE__ */ H(Y,{title:`刷新当前页`,children:/* @__PURE__ */ H(G,{type:`text`,"aria-label":`刷新当前页`,icon:/* @__PURE__ */ H(j,{size:15}),onClick:()=>o(n)})}),g&&/* @__PURE__ */ H(Ye,{trigger:[`click`],menu:{items:m(g)},children:/* @__PURE__ */ H(G,{type:`text`,"aria-label":`标签页操作`,icon:/* @__PURE__ */ H(h,{size:15})})}),r.showTabSwitcher&&/* @__PURE__ */ H(Ye,{trigger:[`click`],menu:{selectedKeys:[n],items:e.map(e=>({key:e.key,label:e.title,icon:r.showTabIcon&&e.icon?/* @__PURE__ */ H(zn,{name:e.icon}):void 0,onClick:()=>a(e.key)}))},children:/* @__PURE__ */ H(G,{type:`text`,"aria-label":`标签切换器`,title:`切换到已打开的标签页`,icon:/* @__PURE__ */ H(h,{size:15})})}),/* @__PURE__ */ H(Y,{title:i?`退出内容全屏`:`内容全屏`,children:/* @__PURE__ */ H(G,{type:`text`,"aria-label":i?`退出内容全屏`:`内容全屏`,icon:H(i?k:D,{size:15}),onClick:c})})]})})})}function ei(){return(ei=e((()=>{m(),b(),E(),O(),dn(),A(),le(),Bn()})))()}function ti(e){return/* @__PURE__ */ H(Qe,{status:e?`403`:`404`,title:e?`无权访问`:`页面不存在`,extra:/* @__PURE__ */ H(it,{to:`/`,children:`返回首页`})})}function ni(e){let t=new URLSearchParams(e).get(`redirect`);return t&&t.startsWith(`/`)&&!t.startsWith(`//`)&&!t.includes(`\\`)&&!/^\/(login|auth\/callback)([/?#]|$)/.test(t)?t:`/`}function ri(){let e=lt(),t=vt(),n=bt(),i=Q(),a=st(),o=St(),s=Ct(),{preferences:c,setPreferences:l,canEditPreference:u}=W(),{modal:d,message:f}=We.useApp(),p=Jn(),m=Ot(),h=jt(),[g,_]=B(!1),[v,y]=B(e),[b,x]=B({});L(()=>{e&&y(!0)},[e]);let S=Tt(c.tabsMaxCount,void 0,c.keepTabs,c.tabEvictPolicy,c.openTabBehavior),{addTab:C,removeTab:ee,setActiveKey:w,tabs:E}=S,{data:O=[]}=o,k=R(()=>{let e=(t,n=[])=>t.flatMap(t=>t.type===`button`||t.visible===!1?[]:[...t.path?[{...t,path:t.path,breadcrumb:n}]:[],...e(t.children??[],[...n,t.title])]);return e(O)},[O]),A=Ft(k,i.pathname);kt(m.autoLockMinutes,m.hasPassword(),m.isLocked,m.hasPassword,m.lock),At({enableShortcuts:c.enableShortcuts,enableLockScreen:m.hasPassword(),hasPassword:m.hasPassword,lock:m.lock,collapsed:v,handleCollapseChange:y,isContentFullscreen:g,setIsContentFullscreen:_}),L(()=>{c.sidebarHoverTrigger&&y(!0)},[c.sidebarHoverTrigger]);let j=R(()=>{let e=t=>t.filter(e=>e.type!==`button`&&e.visible!==!1&&e.status===`enabled`).map(t=>({key:String(t.id),path:t.path??void 0,label:t.title,icon:t.icon?/* @__PURE__ */ H(zn,{name:t.icon}):void 0,children:t.children?.length?e(t.children):void 0})).filter(e=>e.path||e.children?.length),t=O.find(e=>e.type===`directory`&&e.name===`SystemSettings`);return Wr(e(O),{settingsKey:t?String(t.id):void 0,profileIcon:/* @__PURE__ */ H(T,{size:16}),settingsIcon:/* @__PURE__ */ H(re,{size:16})})},[O]),M=s.modules.flatMap(e=>e.pages),N=M.find(e=>e.path===i.pathname),P=k.find(e=>e.path===i.pathname),F=R(()=>/* @__PURE__ */ new Set([`/`,`/profile`,...k.map(e=>e.path)]),[k]),I=N?.title??P?.title??(i.pathname===`/profile`?`个人中心`:`首页`);L(()=>{(F.has(i.pathname)||N?.navigation===!1)&&(C(i.pathname,I,P?.icon??N?.icon),w(i.pathname))},[i.pathname,I,F,N?.navigation,P?.icon,N?.icon,C,w]),L(()=>{document.title=(c.dynamicTitle?I+` · `:``)+(n.brand?.name??`ArcBase`)},[c.dynamicTitle,I,n.brand?.name]);let ne=Fe(e=>Pe(()=>x(t=>({...t,[e]:(t[e]??0)+1}))),[]),ie=Fe(e=>{if(ee(e),e===i.pathname){let t=E.findIndex(t=>t.key===e);a(E[t-1]?.key??`/`)}},[ee,E,i.pathname,a]),ae=R(()=>({enabled:c.enableTabs,setTabMeta:S.setTabMeta,closeTab:ie}),[c.enableTabs,S.setTabMeta,ie]),oe=new Set(S.tabs.map(e=>e.key)),se=new Set(c.enablePageCache&&c.enableTabs?[...k.filter(e=>e.keepAlive).map(e=>e.path),...M.filter(e=>e.keepAlive).map(e=>e.path)]:[]);if(o.isError||s.enabled&&s.query.isError)return/* @__PURE__ */ H(Qe,{status:`error`,title:`导航加载失败`,subTitle:(o.error??s.query.error)?.message,extra:/* @__PURE__ */ H(G,{onClick:()=>{o.refetch(),s.enabled&&s.query.refetch()},children:`重试`})});if(o.isPending||s.enabled&&s.query.isPending)return/* @__PURE__ */ H(r,{});let ce=/* @__PURE__ */ H(Pn,{children:/* @__PURE__ */ H(Ae,{fallback:/* @__PURE__ */ H(r,{}),children:/* @__PURE__ */ H(sr,{keepAlivePaths:se,openPaths:oe,refreshVersion:b,animation:c.reduceMotion?`none`:c.routeAnimation})})}),le=/* @__PURE__ */ H(Et.Provider,{value:ae,children:ce});if(m.hasPassword()&&m.isLocked)return/* @__PURE__ */ H(Ln,{lock:m,mode:null,onClose:()=>{}});if(N?.layout===`workspace`)return le;let ue=S.tabs.filter(e=>F.has(e.key)||M.some(n=>n.navigation===!1&&n.path===e.key&&(t.permissions.includes(`*`)||t.permissions.includes(n.permission)))).map(e=>e.title===e.key?{...e,title:k.find(t=>t.path===e.key)?.title??M.find(t=>t.path===e.key)?.title??(e.key===`/profile`?`个人中心`:e.title)}:e),de=()=>{let e=()=>t.logout().catch(e=>{throw f.error(e instanceof Error?e.message:`退出失败,请重试`),e});c.confirmLogout?d.confirm({title:`退出登录`,content:`确定退出当前账号?`,onOk:e}):e().catch(()=>{})},fe=/* @__PURE__ */ U(V,{children:[c.topbarClock!==`off`&&/* @__PURE__ */ H(jn,{mode:c.topbarClock,showDate:c.topbarClockShowDate}),c.showMenuSearch&&/* @__PURE__ */ H(ur,{menus:k,recentMenus:A.recents.flatMap(e=>{let t=k.find(t=>t.id===e);return t?[t]:[]}),onClearRecents:A.clear,onRemoveRecent:A.remove}),c.showFavorites&&/* @__PURE__ */ H(br,{menus:k,current:P,favorites:h}),m.hasPassword()&&m.hasPassword()&&/* @__PURE__ */ H(Y,{title:`锁屏`,children:/* @__PURE__ */ H(G,{type:`text`,className:`arc-layout-desktop-action`,"aria-label":`锁屏`,icon:/* @__PURE__ */ H(Jt,{size:17}),onClick:m.lock})}),/* @__PURE__ */ H(Qn,{lock:m,homePaths:k.map(e=>({value:e.path,label:e.title}))}),/* @__PURE__ */ H(Y,{title:p?`切换浅色主题`:`切换深色主题`,children:/* @__PURE__ */ H(G,{type:`text`,"aria-label":p?`切换浅色主题`:`切换深色主题`,disabled:!u(`colorMode`),icon:H(p?yn:en,{size:17}),onClick:()=>l({colorMode:p?`light`:`dark`})})}),c.showFullscreen&&/* @__PURE__ */ H(Y,{title:`浏览器全屏`,children:/* @__PURE__ */ H(G,{type:`text`,className:`arc-layout-desktop-action`,"aria-label":`全屏`,icon:/* @__PURE__ */ H(D,{size:17}),onClick:()=>{document.fullscreenElement?document.exitFullscreen():document.documentElement.requestFullscreen()}})}),/* @__PURE__ */ H(Ye,{trigger:[`click`],placement:`bottomRight`,menu:{items:[{key:`profile`,label:`个人中心`,icon:/* @__PURE__ */ H(T,{size:16}),onClick:()=>a(`/profile`)},...m.hasPassword()&&m.hasPassword()?[{key:`lock`,label:`锁屏`,icon:/* @__PURE__ */ H(Jt,{size:16}),onClick:m.lock}]:[],{type:`divider`},{key:`logout`,label:`退出登录`,icon:/* @__PURE__ */ H(te,{size:16}),onClick:de}]},children:/* @__PURE__ */ U(`button`,{type:`button`,className:`arc-layout-user`,"aria-label":`账户菜单`,children:[/* @__PURE__ */ H(Ge,{size:28,src:t.user?.avatar||void 0,icon:/* @__PURE__ */ H(T,{size:16})}),/* @__PURE__ */ H(`span`,{className:`arc-layout-user__name`,children:t.user?.nickname??t.user?.username})]})})]});return/* @__PURE__ */ U(V,{children:[c.showProgressBar&&/* @__PURE__ */ H(vr,{}),/* @__PURE__ */ H(Zr,{preferences:c,dark:p,mobile:e,collapsed:v,maximized:g,title:I,brand:n.brand?.name??`ArcBase`,logo:c.showLogo?/* @__PURE__ */ H(Or,{size:28}):null,menus:j,path:i.pathname,onCollapse:y,onNavigate:a,onRestore:()=>_(!1),actions:fe,breadcrumb:c.showBreadcrumb&&/* @__PURE__ */ H(gr,{menus:O,path:i.pathname,title:I,isFavorite:h.isFavorite,toggleFavorite:h.toggle}),tabbar:c.enableTabs?/* @__PURE__ */ H($r,{tabs:ue,store:S,path:i.pathname,preferences:c,maximized:g,onNavigate:a,onRefresh:ne,onClose:ie,onMaximize:()=>_(e=>!e)}):null,children:le}),c.showBackTop&&/* @__PURE__ */ H(Ke,{target:()=>document.querySelector(`.admin-content`)})]})}function ii(){let{preferences:e,ready:t}=W(),n=st(),r=St();L(()=>{if(!t||!r.isSuccess||!Tn())return;En();let i=t=>t.some(t=>t.visible!==!1&&t.status===`enabled`&&t.type!==`button`&&(t.path===e.homePath||i(t.children??[])));e.homePath!==`/`&&(e.homePath===`/profile`||i(r.data??[]))&&n(e.homePath,{replace:!0})},[t,r.isSuccess,r.data,e.homePath,n]);let i=si[`/`];return/* @__PURE__ */ H(i,{})}function ai(){let e=vt(),t=Q(),{client:n}=_t(),r=St(),i=Ct(),a=/* @__PURE__ */ new Set([`/`,`/profile`]),o=e=>e.forEach(e=>{e.type!==`button`&&e.path&&e.visible!==!1&&a.add(e.path),e.children&&o(e.children)});o(r.data??[]);let s={client:n,user:e.user,permissions:e.permissions,hasPermission:t=>e.permissions.includes(`*`)||e.permissions.includes(t)};return e.user?.requirePasswordChange&&t.pathname!==`/profile`?/* @__PURE__ */ H(at,{to:`/profile?tab=security`,replace:!0}):/* @__PURE__ */ H(ot,{children:/* @__PURE__ */ U(Z,{element:/* @__PURE__ */ H(ri,{}),children:[Object.entries(si).map(([t,n])=>/* @__PURE__ */ H(Z,{path:t,element:a.has(t)?t===`/`?/* @__PURE__ */ H(ii,{}):/* @__PURE__ */ H(n,{user:e.user}):ti(!0)},t)),i.modules.flatMap(e=>e.pages).map(e=>/* @__PURE__ */ H(Z,{path:e.path,element:(e.navigation===!1||a.has(e.path))&&s.hasPermission(e.permission)?/* @__PURE__ */ H(e.component,{...s}):ti(!0)},e.path)),/* @__PURE__ */ H(Z,{path:`/login`,element:/* @__PURE__ */ H(at,{to:ni(t.search),replace:!0})}),/* @__PURE__ */ H(Z,{path:`/forbidden`,element:ti(!0)}),/* @__PURE__ */ H(Z,{path:`*`,element:ti(wt.has(t.pathname))})]})})}function oi(){let e=vt(),t=Q();return t.pathname===`/auth/callback`?/* @__PURE__ */ H(Kn,{children:/* @__PURE__ */ H(pt,{})}):e.status===`unavailable`?/* @__PURE__ */ H(Kn,{children:/* @__PURE__ */ H(Qe,{status:`error`,title:`会话校验失败`,subTitle:e.error?.message,extra:/* @__PURE__ */ H(G,{loading:e.refreshing,onClick:()=>void e.refresh(),children:`重试`})})}):e.status===`checking`?/* @__PURE__ */ H(Kn,{children:/* @__PURE__ */ H(r,{})}):e.user?/* @__PURE__ */ H(Un,{children:/* @__PURE__ */ H(Pt,{children:/* @__PURE__ */ H(Kn,{children:/* @__PURE__ */ H(ai,{})})})}):/* @__PURE__ */ H(Kn,{children:/* @__PURE__ */ U(ot,{children:[/* @__PURE__ */ H(Z,{path:`/login`,element:/* @__PURE__ */ H(Mr,{onLogin:e.login})}),/* @__PURE__ */ H(Z,{path:`*`,element:/* @__PURE__ */ H(at,{to:`/login?redirect=`+encodeURIComponent(t.pathname+t.search),replace:!0})})]})})}var si;function ci(){return(ci=e((()=>{E(),Yt(),tn(),bn(),w(),ee(),I(),On(),An(),Mn(),In(),Rn(),Bn(),Wn(),er(),Yn(),lr(),fr(),i(),_r(),yr(),xr(),zr(),kr(),Qr(),ei(),si=Object.fromEntries(Object.entries(kn).map(([e,t])=>[e,Ne(t)]))})))()}ci();export{oi as AntApp};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./preload-helper-B32n4JOp.js";import{a as r,o as i}from"../src-DXdeqJtP.js";import{a,i as o}from"./feedback-BfXgoa0c.js";import{Component as s,Suspense as c,lazy as l,useEffect as u,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";import{GoaClient as p}from"@fudanda/client";import{installRequestFeedback as m}from"@fudanda/admin-antd/core/utils/request-toast";import{goTransport as h}from"@fudanda/admin-antd/core/lib/go-transport";import{BrowserRouter as g}from"react-router-dom";import{QueryClientProvider as _}from"@tanstack/react-query";import{installScopedStorage as v}from"@fudanda/admin-antd/core/utils/storage";import{ArcBaseProvider as y}from"@fudanda/admin-antd/elements";import{AdminOptionsContext as b,AdminPathsContext as x,normalizeAdminBasePath as S,normalizeAssetBasePath as C,validateAdminOptions as w}from"@fudanda/admin-antd/core/admin/runtime";import"antd/dist/reset.css";import{GoAuthProvider as T}from"@fudanda/admin-antd/core/providers/GoAuthProvider";import{createAdminQueryClient as E}from"@fudanda/admin-antd/core/lib/query";function D(e){return/* @__PURE__ */ f(T,{...e,provider:y,loading:/* @__PURE__ */ f(r,{})})}function O(){return(O=e((()=>{i()})))()}function k(e){w(e);let[t]=d(()=>({client:e.client??new p,cache:e.queryClient??E(),paths:{basePath:S(e.basePath),assetBasePath:C(e.assetBasePath??`./`)},original:{client:e.client,queryClient:e.queryClient,authSession:e.authSession}})),[n,i]=d(!1),[a,s]=d(null);if(u(()=>{let e,n,r,a=document.body.getAttribute(`style`),c=document.documentElement.getAttribute(`style`),l=document.body.getAttribute(`data-reduce-motion`),u=document.body.getAttribute(`theme-mode`),d=document.title,f=document.documentElement.getAttribute(`lang`),p=document.querySelector(`link[rel="icon"]`),g=p?.getAttribute(`href`),_=p?.getAttribute(`type`);try{e=h.bind(t.client),r=v(),n=m({error:(e,t)=>o.error(t?e+` · 链路 ID:`+t:e),warning:o.warning}),i(!0)}catch(e){s(e instanceof Error?e:Error(String(e)))}return()=>{if(!e)return;e(),t.cache.cancelQueries(),t.cache.clear(),r?.(),n?.();let i=(e,t,n)=>{n===null?e.removeAttribute(t):e.setAttribute(t,n)};i(document.body,`style`,a),i(document.documentElement,`style`,c),i(document.body,`theme-mode`,u),i(document.body,`data-reduce-motion`,l),document.title=d,i(document.documentElement,`lang`,f),p?(i(p,`href`,g??null),i(p,`type`,_??null)):document.querySelector(`link[rel="icon"]`)?.remove()}},[t]),u(()=>{e.locale&&(document.documentElement.lang=e.locale)},[e.locale]),a)throw a;if(t.original.client!==e.client||t.original.queryClient!==e.queryClient||t.original.authSession!==e.authSession||t.paths.basePath!==S(e.basePath)||t.paths.assetBasePath!==C(e.assetBasePath??`./`))throw Error(`Remount ArcBaseAdmin to change its client, cache or paths`);return n?/* @__PURE__ */ f(b.Provider,{value:e,children:/* @__PURE__ */ f(x.Provider,{value:t.paths,children:/* @__PURE__ */ f(_,{client:t.cache,children:/* @__PURE__ */ f(D,{client:t.client,authSession:e.authSession,children:/* @__PURE__ */ f(g,{basename:t.paths.basePath,children:/* @__PURE__ */ f(c,{fallback:e.loading??/* @__PURE__ */ f(r,{}),children:/* @__PURE__ */ f(j,{})})})})})})}):e.loading??/* @__PURE__ */ f(r,{})}function A(e){return/* @__PURE__ */ f(M,{fallback:e.errorFallback,children:/* @__PURE__ */ f(k,{...e})})}var j,M;function N(){return(N=e((()=>{a(),O(),i(),t(),j=l(()=>n(()=>import(`./App-9RR_IB-H.js`).then(e=>({default:e.AntApp})),[],import.meta.url)),M=class extends s{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?this.props.fallback?.(this.state.error)??/* @__PURE__ */ f(`div`,{role:`alert`,children:this.state.error.message}):this.props.children}}})))()}N();export{A as ArcBaseAdmin};
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./preload-helper-B32n4JOp.js";import{a as r,o as i}from"../src-CeFrSNPb.js";import{a,i as o}from"./feedback-BfXgoa0c.js";import{Component as s,Suspense as c,lazy as l,useEffect as u,useState as d}from"react";import{jsx as f}from"react/jsx-runtime";import{GoaClient as p}from"@fudanda/client";import{installRequestFeedback as m}from"@fudanda/admin-antd/core/utils/request-toast";import{goTransport as h}from"@fudanda/admin-antd/core/lib/go-transport";import{BrowserRouter as g}from"react-router-dom";import{QueryClientProvider as _}from"@tanstack/react-query";import{installScopedStorage as v}from"@fudanda/admin-antd/core/utils/storage";import{ArcBaseProvider as y}from"@fudanda/admin-antd/elements";import{AdminOptionsContext as b,AdminPathsContext as x,normalizeAdminBasePath as S,normalizeAssetBasePath as C,validateAdminOptions as w}from"@fudanda/admin-antd/core/admin/runtime";import"antd/dist/reset.css";import{GoAuthProvider as T}from"@fudanda/admin-antd/core/providers/GoAuthProvider";import{createAdminQueryClient as E}from"@fudanda/admin-antd/core/lib/query";function D(e){return/* @__PURE__ */ f(T,{...e,provider:y,loading:/* @__PURE__ */ f(r,{})})}function O(){return(O=e((()=>{i()})))()}function k(e){w(e);let[t]=d(()=>({client:e.client??new p,cache:e.queryClient??E(),paths:{basePath:S(e.basePath),assetBasePath:C(e.assetBasePath??`./`)},original:{client:e.client,queryClient:e.queryClient,authSession:e.authSession}})),[n,i]=d(!1),[a,s]=d(null);if(u(()=>{let e,n,r,a=document.body.getAttribute(`style`),c=document.documentElement.getAttribute(`style`),l=document.body.getAttribute(`data-reduce-motion`),u=document.body.getAttribute(`theme-mode`),d=document.title,f=document.documentElement.getAttribute(`lang`),p=document.querySelector(`link[rel="icon"]`),g=p?.getAttribute(`href`),_=p?.getAttribute(`type`);try{e=h.bind(t.client),r=v(),n=m({error:(e,t)=>o.error(t?e+` · 链路 ID:`+t:e),warning:o.warning}),i(!0)}catch(e){s(e instanceof Error?e:Error(String(e)))}return()=>{if(!e)return;e(),t.cache.cancelQueries(),t.cache.clear(),r?.(),n?.();let i=(e,t,n)=>{n===null?e.removeAttribute(t):e.setAttribute(t,n)};i(document.body,`style`,a),i(document.documentElement,`style`,c),i(document.body,`theme-mode`,u),i(document.body,`data-reduce-motion`,l),document.title=d,i(document.documentElement,`lang`,f),p?(i(p,`href`,g??null),i(p,`type`,_??null)):document.querySelector(`link[rel="icon"]`)?.remove()}},[t]),u(()=>{e.locale&&(document.documentElement.lang=e.locale)},[e.locale]),a)throw a;if(t.original.client!==e.client||t.original.queryClient!==e.queryClient||t.original.authSession!==e.authSession||t.paths.basePath!==S(e.basePath)||t.paths.assetBasePath!==C(e.assetBasePath??`./`))throw Error(`Remount ArcBaseAdmin to change its client, cache or paths`);return n?/* @__PURE__ */ f(b.Provider,{value:e,children:/* @__PURE__ */ f(x.Provider,{value:t.paths,children:/* @__PURE__ */ f(_,{client:t.cache,children:/* @__PURE__ */ f(D,{client:t.client,authSession:e.authSession,children:/* @__PURE__ */ f(g,{basename:t.paths.basePath,children:/* @__PURE__ */ f(c,{fallback:e.loading??/* @__PURE__ */ f(r,{}),children:/* @__PURE__ */ f(j,{})})})})})})}):e.loading??/* @__PURE__ */ f(r,{})}function A(e){return/* @__PURE__ */ f(M,{fallback:e.errorFallback,children:/* @__PURE__ */ f(k,{...e})})}var j,M;function N(){return(N=e((()=>{a(),O(),i(),t(),j=l(()=>n(()=>import(`./App-BzdEg22K.js`).then(e=>({default:e.AntApp})),[],import.meta.url)),M=class extends s{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?this.props.fallback?.(this.state.error)??/* @__PURE__ */ f(`div`,{role:`alert`,children:this.state.error.message}):this.props.children}}})))()}N();export{A as ArcBaseAdmin};
@@ -0,0 +1,8 @@
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./preload-helper-B32n4JOp.js";import{n as r,t as i}from"./createLucideIcon-C5OSmeyR.js";import{Suspense as a,lazy as o}from"react";import{jsx as s}from"react/jsx-runtime";var c,l;function u(){return(u=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
+ r(),c={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`}]]},c.node,l=i(c)})))()}function d(e){let t=p.get(e);return t||(t=o(()=>n(()=>import(`./illustrations-CD8rBDUg.js`).then(t=>({default:t[e]})),[],import.meta.url)),p.set(e,t)),t}function f(e,t){let n=d(`Illustration${e}`),r=d(`Illustration${e}Dark`),i=t===void 0?void 0:{width:t,height:t};return{image:/* @__PURE__ */ s(a,{fallback:null,children:/* @__PURE__ */ s(n,{style:i})}),darkModeImage:/* @__PURE__ */ s(a,{fallback:null,children:/* @__PURE__ */ s(r,{style:i})})}}var p;function m(){return(m=e((()=>{t(),p=/* @__PURE__ */ new Map})))()}export{u as i,m as n,l as r,f as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./preload-helper-B32n4JOp.js";import{t as r}from"./controls-bzoKYN3r.js";import{t as i}from"./typography-CRVG4mWv.js";import{i as a,n as o}from"./feedback-BfXgoa0c.js";import{i as s,r as c,t as l}from"./media-CW6STJvO.js";import{n as u,t as d}from"./x-Cy9T0Gfj.js";import{C as f,S as p,_ as m,a as h,c as g,g as _,u as v}from"./ui-B2vRXZUo.js";import{i as y,r as b}from"./confirm-CpM2HLx_.js";import{r as x,t as S}from"./deleteAction-B_E1jPob.js";import{n as ee,r as te}from"./theme-controller-CpTzD2Pa.js";import{S as C,_ as ne,a as w,b as re,c as ie,d as ae,f as oe,g as se,h as ce,i as T,l as le,m as ue,n as E,o as de,p as fe,s as pe,t as D,u as me,v as he,x as ge,y as _e}from"./file-utils-Buv1r1rr.js";import{n as O,t as k}from"./AppModal-D7N3dWkx.js";import{Suspense as A,cloneElement as ve,lazy as j,useCallback as M,useEffect as N,useMemo as P,useRef as F,useState as I}from"react";import{Fragment as L,jsx as R,jsxs as z}from"react/jsx-runtime";import{escapeRegExp as ye,formatBytes as B}from"@fudanda/client/core";import{fileContract as be}from"@fudanda/admin-antd/core/lib/native-operations";import{contractKey as xe}from"@fudanda/admin-antd/core/lib/contract-query";import{formatDateTime as Se}from"@fudanda/admin-antd/core/utils/date";import{useQuery as Ce}from"@tanstack/react-query";import{createPortal as we}from"react-dom";import{generateWatermarkTile as Te}from"@fudanda/admin-antd/core/components/watermark-tile";import{createDisplayableImageUrl as V}from"@fudanda/admin-antd/core/utils/image-decode";function Ee(e,{preview:t,onDetail:n,onCopyUrl:r,onDelete:i,canDelete:a}){return[{key:`preview`,label:`预览`,disabled:!D(e.mimeType,e.originalName),loading:t.previewLoadingId===e.id,onClick:()=>t.handlePreview(e)},{key:`download`,label:`下载`,loading:t.downloadLoadingId===e.id,onClick:()=>t.handleDownload(e)},{key:`detail`,label:`详情`,onClick:()=>n(e)},{key:`copy-url`,label:`复制链接`,onClick:()=>r(e)},{key:`delete`,label:`删除`,danger:!0,dividerBefore:!0,hidden:!a,onClick:()=>{b({title:`确认删除此文件?`,content:`删除文件记录后,将同步尝试删除实际存储对象。`,onOk:()=>i(e)})}}]}function H(){return(H=e((()=>{w(),y()})))()}function De(e){(e?.kind===`audio`||e?.kind===`video`||e?.kind===`svg`)&&URL.revokeObjectURL(e.url)}function U({title:e,onCancel:t,fullscreen:n,onToggleFullscreen:r,width:i,viewportHeight:a,children:o}){return/* @__PURE__ */ R(k,{visible:!0,onCancel:t,title:e,footer:null,fullscreenable:!0,fullscreen:n,onToggleFullscreen:r,width:i,centered:!0,bodyStyle:{padding:0,display:`flex`,flexDirection:`column`,overflow:`hidden`,height:n?`calc(100vh - 40px)`:`calc(${a} - 40px)`},keepDOM:!1,children:/* @__PURE__ */ R(A,{fallback:/* @__PURE__ */ R(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,flex:1},children:/* @__PURE__ */ R(m,{size:`large`,tip:`加载预览组件...`})}),children:o})})}function Oe({fileUrl:e,fileName:t=`文件`,mimeType:n,visible:r,onClose:c,onFallback:u}){let[f,p]=I(!1),h=M(()=>{p(e=>!e)},[]),{isDark:g}=te(),_=P(()=>C(n,t),[t,n]),v=P(()=>{if(!_)return null;let e=_.startsWith(`image/`),n=_===`video/mp2t`&&/\.(ts|tsx)$/i.test(t);return _e(_)?`spreadsheet`:ge(_)?`word`:he(_)?`presentation`:se(_)?`ofd`:me(_)?`email`:ce(_)?`mindmap`:le(_)?`drawing`:ie(_)?`dataAsset`:oe(_)?`geo`:ue(_)?`markdown`:ne(_)?`plainText`:de(_)?`archive`:fe(_)?`json`:re(_)?`svg`:pe(_)||n?`code`:_===`application/pdf`?`pdf`:_.startsWith(`audio/`)?`audio`:_.startsWith(`video/`)&&!n?`video`:e?`image`:`unsupported`},[t,_]),y=Ce({queryKey:[...xe(be.content),`preview`,r,e,t,_,v],queryFn:async()=>{let n=await E(e);if(v===`spreadsheet`||v===`word`||v===`presentation`||v===`ofd`||v===`email`||v===`mindmap`||v===`drawing`||v===`dataAsset`||v===`geo`||v===`archive`)return{kind:v,file:new File([n],t,{type:_||n.type})};if(v===`markdown`)return{kind:`markdown`,text:await n.text()};if(v===`plainText`)return{kind:`plainText`,text:await n.text()};if(v===`json`)return{kind:`json`,text:await n.text()};if(v===`svg`)return{kind:`svg`,url:URL.createObjectURL(n)};if(v===`code`)return{kind:`code`,text:await n.text()};if(v===`pdf`)return{kind:`pdf`,file:new File([n],t,{type:`application/pdf`})};if(v===`audio`)return{kind:`audio`,url:URL.createObjectURL(n)};if(v===`video`)return{kind:`video`,url:URL.createObjectURL(n)};throw Error(`文件加载失败`)},enabled:r&&!!v&&v!==`unsupported`&&v!==`image`,staleTime:0,gcTime:0}),b=y.data;N(()=>()=>De(b),[b]),N(()=>{r?_?v===`unsupported`?(u?.(e,t,_),c()):v===`image`&&c():c():p(!1)},[t,e,c,u,v,_,r]),N(()=>{y.error&&(a.error(y.error instanceof Error?y.error.message:`文件加载失败`),c())},[c,y.error]);let x=()=>{c()},S=/* @__PURE__ */ z(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[T(n,15,t),/* @__PURE__ */ R(i.Text,{ellipsis:{showTooltip:!0},style:{fontSize:13,fontWeight:500,minWidth:0},children:t})]});if(!r)return null;if(y.isLoading)return/* @__PURE__ */ R(k,{visible:!0,onCancel:x,title:S,footer:null,fullscreenable:!1,centered:!0,keepDOM:!1,bodyStyle:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:40},children:/* @__PURE__ */ R(m,{size:`large`,tip:`加载中...`})});if(b?.kind===`pdf`)return/* @__PURE__ */ R(o,{visible:!0,onCancel:x,title:null,footer:null,fullScreen:f,width:`min(1100px, 92vw)`,centered:!0,bodyStyle:{padding:0,display:`flex`,overflow:`hidden`,height:f?`100vh`:`88vh`},closable:!1,keepDOM:!1,children:/* @__PURE__ */ R(A,{fallback:/* @__PURE__ */ R(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`},children:/* @__PURE__ */ R(m,{size:`large`})}),children:/* @__PURE__ */ R(W,{file:b.file,onClose:x,fullscreen:f,onToggleFullscreen:h,style:{width:`100%`,borderLeft:`none`}})})});if(b?.kind===`spreadsheet`||b?.kind===`word`||b?.kind===`presentation`||b?.kind===`ofd`||b?.kind===`email`||b?.kind===`mindmap`||b?.kind===`drawing`||b?.kind===`dataAsset`||b?.kind===`geo`||b?.kind===`archive`){let e=b.kind===`presentation`,t=b.kind===`spreadsheet`||b.kind===`archive`||b.kind===`email`||b.kind===`mindmap`||b.kind===`drawing`||b.kind===`dataAsset`||b.kind===`geo`||e;return/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:t?`min(1200px, 94vw)`:`min(960px, 92vw)`,viewportHeight:`90vh`,children:/* @__PURE__ */ R(G,{file:b.file,style:{flex:1}})})}if(b?.kind===`markdown`){let e=b.text.startsWith(`\0PLAINTEXT\0`),t=e?b.text.slice(11):b.text;return/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:`min(900px, 92vw)`,viewportHeight:`90vh`,children:/* @__PURE__ */ R(K,{content:t,rawText:e,style:{flex:1,minHeight:0}})})}return b?.kind===`json`?/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:`min(900px, 92vw)`,viewportHeight:`88vh`,children:/* @__PURE__ */ R(q,{content:b.text,style:{flex:1,minHeight:0}})}):b?.kind===`code`||b?.kind===`plainText`?/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:`min(1100px, 92vw)`,viewportHeight:`90vh`,children:/* @__PURE__ */ R(J,{content:b.text,fileName:t,style:{flex:1,minHeight:0}})}):b?.kind===`svg`?/* @__PURE__ */ R(k,{visible:!0,onCancel:x,title:S,footer:null,fullscreenable:!0,fullscreen:f,onToggleFullscreen:h,width:`min(900px, 92vw)`,centered:!0,bodyStyle:{padding:16,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`auto`,height:f?`calc(100vh - 40px)`:`calc(80vh - 40px)`},keepDOM:!1,children:/* @__PURE__ */ R(`img`,{src:b.url,alt:t,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`}})}):b?.kind===`audio`?we(/* @__PURE__ */ R(`div`,{className:`arcbase-audio-dock`,role:`region`,"aria-label":`音频播放器`,children:/* @__PURE__ */ z(`div`,{className:`arcbase-audio-dock__inner`,children:[/* @__PURE__ */ R(`div`,{className:`arcbase-audio-dock__player`,children:/* @__PURE__ */ R(l,{className:`arcbase-audio-preview`,audioUrl:{src:b.url,title:t},theme:g?`dark`:`light`,autoPlay:!0,style:{width:`100%`}})}),/* @__PURE__ */ R(`button`,{type:`button`,className:`arcbase-audio-dock__close`,onClick:x,"aria-label":`关闭音频播放器`,children:/* @__PURE__ */ R(d,{size:18})})]})}),document.body):b?.kind===`video`?/* @__PURE__ */ R(k,{visible:!0,onCancel:x,title:S,footer:null,fullscreenable:!1,width:`min(960px, 92vw)`,centered:!0,bodyStyle:{padding:0,overflow:`hidden`,borderRadius:`var(--arc-antd-border-radius-medium)`},keepDOM:!1,children:/* @__PURE__ */ R(s,{src:b.url,theme:g?`dark`:`light`,width:`100%`,autoPlay:!1,muted:!1,volume:100,clickToPlay:!0,defaultPlaybackRate:1,playbackRateList:[{label:`0.5x`,value:.5},{label:`1x`,value:1},{label:`1.5x`,value:1.5},{label:`2x`,value:2}],style:{borderRadius:`var(--arc-antd-border-radius-medium)`}})}):null}var W,G,K,q,J;function Y(){return(Y=e((()=>{f(),u(),ee(),w(),O(),t(),W=j(()=>n(()=>import(`./PDFPreviewPanel-B-Uv0k-c.js`).then(e=>({default:e.PDFPreviewPanel})),[],import.meta.url)),G=j(()=>n(()=>import(`./FileViewerPreviewPanel-Br6xqekv.js`),[],import.meta.url)),K=j(()=>n(()=>import(`./MarkdownPreviewPanel-_h_-DdZ3.js`),[],import.meta.url)),q=j(()=>n(()=>import(`./JsonPreviewPanel-OAknwa5a.js`),[],import.meta.url)),J=j(()=>n(()=>import(`./MonacoPreviewPanel-j5NDq6E7.js`),[],import.meta.url))})))()}function ke({content:e,visible:t}){let n=(Array.isArray(e)?e:e?[e]:[]).filter(Boolean),r=JSON.stringify(n),[i,a]=I(null);return N(()=>{let e=JSON.parse(r);if(!t||e.length===0){a(null);return}let n=document.body.getAttribute(`theme-mode`)===`dark`,i=Te(e,13,.22,-22,180,110,n);i&&a({position:`fixed`,inset:0,pointerEvents:`none`,userSelect:`none`,zIndex:2100,backgroundImage:`url(${i.dataUrl})`,backgroundRepeat:`repeat`,backgroundSize:`${i.cssWidth}px ${i.cssHeight}px`})},[r,t]),i?/* @__PURE__ */ R(`div`,{"aria-hidden":!0,style:i,"data-testid":`preview-watermark`}):null}function X(){return(X=e((()=>{})))()}function Ae({preview:e,watermark:t}){return/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ R(c,{src:e.previewSrcList,visible:e.previewVisible,currentIndex:e.previewCurrentIndex,onChange:e.setPreviewCurrentIndex,onVisibleChange:t=>{t||e.closeImagePreview()},infinite:!0}),/* @__PURE__ */ R(Oe,{fileUrl:e.filePreview?.url??``,fileName:e.filePreview?.name,mimeType:e.filePreview?.mimeType,visible:!!e.filePreview,onClose:e.closeFilePreview}),/* @__PURE__ */ R(ke,{content:t,visible:e.previewVisible||!!e.filePreview})]})}function Z(){return(Z=e((()=>{f(),Y(),X()})))()}function je({visible:e,file:t,loading:n,resolveUrl:r,onCopyUrl:i,onClose:a,extraRows:o=[]}){return/* @__PURE__ */ R(k,{title:`文件详情`,visible:e,onCancel:a,footer:/* @__PURE__ */ z(_,{children:[/* @__PURE__ */ R(h,{onClick:()=>t&&i(t),children:`复制链接`}),/* @__PURE__ */ R(h,{type:`primary`,onClick:a,children:`关闭`})]}),width:560,children:/* @__PURE__ */ R(m,{spinning:n,tip:`加载中...`,size:`small`,children:t&&/* @__PURE__ */ R(g,{align:`left`,size:`medium`,data:[{key:`文件名`,value:t.originalName},{key:`存储服务`,value:t.storageName},{key:`MIME 类型`,value:t.mimeType||`—`},{key:`文件大小`,value:B(t.size)},...o,{key:`上传人`,value:t.uploaderName||`—`},{key:`对象键`,value:/* @__PURE__ */ R(Q,{copyable:!0,style:{fontSize:12,wordBreak:`break-all`},children:t.objectKey})},{key:`访问链接`,value:/* @__PURE__ */ R(Q,{copyable:!0,style:{fontSize:12,wordBreak:`break-all`},children:r(t)})},{key:`上传时间`,value:Se(t.createdAt)}]})})})}var Q;function Me(){return(Me=e((()=>{f(),O(),{Text:Q}=i})))()}function Ne(e){let[t,n]=I(!1),[r,i]=I([]),[o,s]=I(0),[c,l]=I(null),[u,d]=I(null),[f,p]=I(null),m=F([]),h=F(0),g=()=>{m.current.forEach(e=>globalThis.URL.revokeObjectURL(e)),m.current=[]};return{previewVisible:t,previewSrcList:r,previewCurrentIndex:o,setPreviewCurrentIndex:s,previewLoadingId:c,downloadLoadingId:f,filePreview:u,handlePreview:async t=>{let r=C(t.mimeType,t.originalName),o=ae(t.mimeType,t.originalName);if(!D(t.mimeType,t.originalName)&&!o){try{let e=await E(t.url),n=globalThis.URL.createObjectURL(e);globalThis.open(n,`_blank`,`noopener,noreferrer`),globalThis.setTimeout(()=>globalThis.URL.revokeObjectURL(n),6e4)}catch(e){a.error(e instanceof Error?e.message:`预览文件失败`)}return}if(!o){l(t.id);try{d({id:t.id,url:t.url,name:t.originalName,mimeType:r??`application/octet-stream`})}catch(e){a.error(e instanceof Error?e.message:`预览文件失败`)}finally{l(null)}return}let c=e().filter(e=>ae(e.mimeType,e.originalName)),u=c.findIndex(e=>e.id===t.id);l(t.id),h.current+=1;let f=h.current;try{g();let e=c.map(()=>``);m.current=[...e];let t=c[u],r=await E(t.url);if(h.current!==f)return;let a=await V(r,t.mimeType,t.originalName);if(h.current!==f){globalThis.URL.revokeObjectURL(a);return}e[u]=a,m.current[u]=a,i([...e]),s(Math.max(0,u)),n(!0),c.forEach(async(e,t)=>{if(t!==u)try{let n=await E(e.url);if(h.current!==f)return;let r=await V(n,e.mimeType,e.originalName);if(h.current!==f){globalThis.URL.revokeObjectURL(r);return}m.current[t]=r,i(e=>{let n=[...e];return n[t]=r,n})}catch{}})}catch(e){a.error(e instanceof Error?e.message:`预览图片失败`)}finally{l(null)}},handleDownload:async e=>{p(e.id);try{let t=await E(e.url),n=globalThis.URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e.originalName,r.click(),globalThis.setTimeout(()=>globalThis.URL.revokeObjectURL(n),6e4)}catch(e){a.error(e instanceof Error?e.message:`下载文件失败`)}finally{p(null)}},closeImagePreview:()=>{h.current+=1,n(!1),g(),i([])},closeFilePreview:()=>d(null),resetPreview:()=>{d(null),n(!1),h.current+=1}}}function Pe(){return(Pe=e((()=>{f(),w()})))()}function Fe(e){return ve(e,{style:{...e.props.style,...Re}})}function Ie(){return document.body}function Le({point:e,contextKey:t,render:n,onClose:r}){let i=`${t}:${e.x}:${e.y}`,a=F(null),o=M(()=>{a.current!==i&&(a.current=i,r())},[r,i]);return/* @__PURE__ */ R(v,{visible:!0,trigger:`click`,position:`bottomLeft`,autoAdjustOverflow:!0,rePosKey:i,render:Fe(n),getPopupContainer:Ie,clickToHide:!0,closeOnEsc:!0,onClickOutSide:o,onVisibleChange:e=>{e||o()},children:/* @__PURE__ */ R(`span`,{"aria-hidden":`true`,style:{position:`fixed`,left:e.x,top:e.y,width:1,height:1,pointerEvents:`none`}})})}var Re;function ze(){return(ze=e((()=>{f(),Re={maxHeight:`calc(100vh - 16px)`,overflowY:`auto`}})))()}function Be(){return(Be=e((()=>{})))()}function Ve({file:e,selected:t,canSelect:n,onSelect:i,onPreview:a,onDownload:o,onDelete:s,onDetail:c,onCopyUrl:l,canDelete:u,previewLoading:d}){let[f,h]=I(null),g=D(e.mimeType,e.originalName),_=e.originalName.includes(`.`)?e.originalName.split(`.`).pop()?.toUpperCase():``;return/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ z(`div`,{className:`files-grid-card${t?` files-grid-card--selected`:``}`,onContextMenu:e=>{e.preventDefault(),h({x:e.clientX,y:e.clientY})},children:[/* @__PURE__ */ R(`button`,{type:`button`,className:`files-grid-card__preview-btn`,"aria-label":g?`预览 ${e.originalName}`:e.originalName,style:{cursor:g?`pointer`:`default`},onClick:r=>{n&&(r.ctrlKey||r.metaKey||r.shiftKey)?i(e.id,!t):g&&a(e)}}),n&&/* @__PURE__ */ R(`div`,{className:`files-grid-card__checkbox`,children:/* @__PURE__ */ R(r,{checked:t,onChange:()=>i(e.id,!t)})}),/* @__PURE__ */ R(`div`,{className:`files-grid-card__media-wrap`,children:/* @__PURE__ */ z(`div`,{className:`files-grid-card__media`,children:[/* @__PURE__ */ R(`span`,{className:`files-grid-card__icon`,children:T(e.mimeType,34,e.originalName)}),_&&/* @__PURE__ */ R(`span`,{className:`files-grid-card__type-badge`,children:_}),d&&/* @__PURE__ */ R(`div`,{className:`files-grid-card__media-overlay`,children:/* @__PURE__ */ R(m,{})})]})}),/* @__PURE__ */ z(`div`,{className:`files-grid-card__info`,children:[/* @__PURE__ */ R(p,{content:e.originalName,position:`top`,children:/* @__PURE__ */ R(`div`,{className:`files-grid-card__name`,children:e.originalName})}),/* @__PURE__ */ R(`div`,{className:`files-grid-card__meta`,children:/* @__PURE__ */ R(`span`,{children:B(e.size)})})]})]}),f&&/* @__PURE__ */ R(Le,{point:f,contextKey:e.id,onClose:()=>h(null),render:/* @__PURE__ */ z(v.Menu,{children:[g&&/* @__PURE__ */ R(v.Item,{onClick:()=>a(e),children:`预览`}),/* @__PURE__ */ R(v.Item,{onClick:()=>o(e),children:`下载`}),/* @__PURE__ */ R(v.Item,{onClick:()=>c(e),children:`详情`}),/* @__PURE__ */ R(v.Item,{onClick:()=>l(e),children:`复制链接`}),u&&/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ R(v.Divider,{}),/* @__PURE__ */ R(v.Item,{type:`danger`,onClick:()=>{S({title:`确认删除此文件?`,content:`删除文件记录后,将同步尝试删除实际存储对象。`,run:()=>Promise.resolve(s(e)),successMessage:null})},children:`删除`})]})]})})]})}function He(){return(He=e((()=>{f(),w(),x(),ze()})))()}function Ue({name:e,icon:t,mimeType:n,onClick:r,highlight:i}){let a=i?e.split(RegExp(`(${ye(i)})`,`gi`)):[e],o=/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ R(`span`,{className:`file-name-cell__icon`,children:t??T(n,16,e)}),/* @__PURE__ */ R(p,{content:e,children:/* @__PURE__ */ R(`span`,{className:`file-name-cell__text`,children:a.map((e,t)=>i&&e.toLowerCase()===i.toLowerCase()?/* @__PURE__ */ R(`mark`,{children:e},t):e)})})]});return r?/* @__PURE__ */ R(`button`,{type:`button`,className:`file-name-cell file-name-cell--button`,onClick:r,children:o}):/* @__PURE__ */ R(`div`,{className:`file-name-cell`,children:o})}function $(){return($=e((()=>{f(),w()})))()}export{Be as a,je as c,Z as d,Ee as f,He as i,Me as l,$ as n,Pe as o,H as p,Ve as r,Ne as s,Ue as t,Ae as u};
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./preload-helper-B32n4JOp.js";import{t as r}from"./controls-bzoKYN3r.js";import{t as i}from"./typography-CRVG4mWv.js";import{i as a,n as o}from"./feedback-BfXgoa0c.js";import{i as s,r as c,t as l}from"./media-CW6STJvO.js";import{n as u,t as d}from"./x-Cy9T0Gfj.js";import{C as f,S as p,_ as m,a as h,c as g,g as _,u as v}from"./ui-B2vRXZUo.js";import{i as y,r as b}from"./confirm-CpM2HLx_.js";import{r as x,t as S}from"./deleteAction-B_E1jPob.js";import{n as ee,r as te}from"./theme-controller-CpTzD2Pa.js";import{S as C,_ as ne,a as w,b as re,c as ie,d as ae,f as oe,g as se,h as ce,i as T,l as le,m as ue,n as E,o as de,p as fe,s as pe,t as D,u as me,v as he,x as ge,y as _e}from"./file-utils-Buv1r1rr.js";import{n as O,t as k}from"./AppModal-D7N3dWkx.js";import{Suspense as A,cloneElement as ve,lazy as j,useCallback as M,useEffect as N,useMemo as P,useRef as F,useState as I}from"react";import{Fragment as L,jsx as R,jsxs as z}from"react/jsx-runtime";import{escapeRegExp as ye,formatBytes as B}from"@fudanda/client/core";import{fileContract as be}from"@fudanda/admin-antd/core/lib/native-operations";import{contractKey as xe}from"@fudanda/admin-antd/core/lib/contract-query";import{formatDateTime as Se}from"@fudanda/admin-antd/core/utils/date";import{useQuery as Ce}from"@tanstack/react-query";import{createPortal as we}from"react-dom";import{generateWatermarkTile as Te}from"@fudanda/admin-antd/core/components/watermark-tile";import{createDisplayableImageUrl as V}from"@fudanda/admin-antd/core/utils/image-decode";function Ee(e,{preview:t,onDetail:n,onCopyUrl:r,onDelete:i,canDelete:a}){return[{key:`preview`,label:`预览`,disabled:!D(e.mimeType,e.originalName),loading:t.previewLoadingId===e.id,onClick:()=>t.handlePreview(e)},{key:`download`,label:`下载`,loading:t.downloadLoadingId===e.id,onClick:()=>t.handleDownload(e)},{key:`detail`,label:`详情`,onClick:()=>n(e)},{key:`copy-url`,label:`复制链接`,onClick:()=>r(e)},{key:`delete`,label:`删除`,danger:!0,dividerBefore:!0,hidden:!a,onClick:()=>{b({title:`确认删除此文件?`,content:`删除文件记录后,将同步尝试删除实际存储对象。`,onOk:()=>i(e)})}}]}function H(){return(H=e((()=>{w(),y()})))()}function De(e){(e?.kind===`audio`||e?.kind===`video`||e?.kind===`svg`)&&URL.revokeObjectURL(e.url)}function U({title:e,onCancel:t,fullscreen:n,onToggleFullscreen:r,width:i,viewportHeight:a,children:o}){return/* @__PURE__ */ R(k,{visible:!0,onCancel:t,title:e,footer:null,fullscreenable:!0,fullscreen:n,onToggleFullscreen:r,width:i,centered:!0,bodyStyle:{padding:0,display:`flex`,flexDirection:`column`,overflow:`hidden`,height:n?`calc(100vh - 40px)`:`calc(${a} - 40px)`},keepDOM:!1,children:/* @__PURE__ */ R(A,{fallback:/* @__PURE__ */ R(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,flex:1},children:/* @__PURE__ */ R(m,{size:`large`,tip:`加载预览组件...`})}),children:o})})}function Oe({fileUrl:e,fileName:t=`文件`,mimeType:n,visible:r,onClose:c,onFallback:u}){let[f,p]=I(!1),h=M(()=>{p(e=>!e)},[]),{isDark:g}=te(),_=P(()=>C(n,t),[t,n]),v=P(()=>{if(!_)return null;let e=_.startsWith(`image/`),n=_===`video/mp2t`&&/\.(ts|tsx)$/i.test(t);return _e(_)?`spreadsheet`:ge(_)?`word`:he(_)?`presentation`:se(_)?`ofd`:me(_)?`email`:ce(_)?`mindmap`:le(_)?`drawing`:ie(_)?`dataAsset`:oe(_)?`geo`:ue(_)?`markdown`:ne(_)?`plainText`:de(_)?`archive`:fe(_)?`json`:re(_)?`svg`:pe(_)||n?`code`:_===`application/pdf`?`pdf`:_.startsWith(`audio/`)?`audio`:_.startsWith(`video/`)&&!n?`video`:e?`image`:`unsupported`},[t,_]),y=Ce({queryKey:[...xe(be.content),`preview`,r,e,t,_,v],queryFn:async()=>{let n=await E(e);if(v===`spreadsheet`||v===`word`||v===`presentation`||v===`ofd`||v===`email`||v===`mindmap`||v===`drawing`||v===`dataAsset`||v===`geo`||v===`archive`)return{kind:v,file:new File([n],t,{type:_||n.type})};if(v===`markdown`)return{kind:`markdown`,text:await n.text()};if(v===`plainText`)return{kind:`plainText`,text:await n.text()};if(v===`json`)return{kind:`json`,text:await n.text()};if(v===`svg`)return{kind:`svg`,url:URL.createObjectURL(n)};if(v===`code`)return{kind:`code`,text:await n.text()};if(v===`pdf`)return{kind:`pdf`,file:new File([n],t,{type:`application/pdf`})};if(v===`audio`)return{kind:`audio`,url:URL.createObjectURL(n)};if(v===`video`)return{kind:`video`,url:URL.createObjectURL(n)};throw Error(`文件加载失败`)},enabled:r&&!!v&&v!==`unsupported`&&v!==`image`,staleTime:0,gcTime:0}),b=y.data;N(()=>()=>De(b),[b]),N(()=>{r?_?v===`unsupported`?(u?.(e,t,_),c()):v===`image`&&c():c():p(!1)},[t,e,c,u,v,_,r]),N(()=>{y.error&&(a.error(y.error instanceof Error?y.error.message:`文件加载失败`),c())},[c,y.error]);let x=()=>{c()},S=/* @__PURE__ */ z(`div`,{style:{display:`flex`,alignItems:`center`,gap:8,minWidth:0},children:[T(n,15,t),/* @__PURE__ */ R(i.Text,{ellipsis:{showTooltip:!0},style:{fontSize:13,fontWeight:500,minWidth:0},children:t})]});if(!r)return null;if(y.isLoading)return/* @__PURE__ */ R(k,{visible:!0,onCancel:x,title:S,footer:null,fullscreenable:!1,centered:!0,keepDOM:!1,bodyStyle:{display:`flex`,alignItems:`center`,justifyContent:`center`,padding:40},children:/* @__PURE__ */ R(m,{size:`large`,tip:`加载中...`})});if(b?.kind===`pdf`)return/* @__PURE__ */ R(o,{visible:!0,onCancel:x,title:null,footer:null,fullScreen:f,width:`min(1100px, 92vw)`,centered:!0,bodyStyle:{padding:0,display:`flex`,overflow:`hidden`,height:f?`100vh`:`88vh`},closable:!1,keepDOM:!1,children:/* @__PURE__ */ R(A,{fallback:/* @__PURE__ */ R(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`,width:`100%`},children:/* @__PURE__ */ R(m,{size:`large`})}),children:/* @__PURE__ */ R(W,{file:b.file,onClose:x,fullscreen:f,onToggleFullscreen:h,style:{width:`100%`,borderLeft:`none`}})})});if(b?.kind===`spreadsheet`||b?.kind===`word`||b?.kind===`presentation`||b?.kind===`ofd`||b?.kind===`email`||b?.kind===`mindmap`||b?.kind===`drawing`||b?.kind===`dataAsset`||b?.kind===`geo`||b?.kind===`archive`){let e=b.kind===`presentation`,t=b.kind===`spreadsheet`||b.kind===`archive`||b.kind===`email`||b.kind===`mindmap`||b.kind===`drawing`||b.kind===`dataAsset`||b.kind===`geo`||e;return/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:t?`min(1200px, 94vw)`:`min(960px, 92vw)`,viewportHeight:`90vh`,children:/* @__PURE__ */ R(G,{file:b.file,style:{flex:1}})})}if(b?.kind===`markdown`){let e=b.text.startsWith(`\0PLAINTEXT\0`),t=e?b.text.slice(11):b.text;return/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:`min(900px, 92vw)`,viewportHeight:`90vh`,children:/* @__PURE__ */ R(K,{content:t,rawText:e,style:{flex:1,minHeight:0}})})}return b?.kind===`json`?/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:`min(900px, 92vw)`,viewportHeight:`88vh`,children:/* @__PURE__ */ R(q,{content:b.text,style:{flex:1,minHeight:0}})}):b?.kind===`code`||b?.kind===`plainText`?/* @__PURE__ */ R(U,{title:S,onCancel:x,fullscreen:f,onToggleFullscreen:h,width:`min(1100px, 92vw)`,viewportHeight:`90vh`,children:/* @__PURE__ */ R(J,{content:b.text,fileName:t,style:{flex:1,minHeight:0}})}):b?.kind===`svg`?/* @__PURE__ */ R(k,{visible:!0,onCancel:x,title:S,footer:null,fullscreenable:!0,fullscreen:f,onToggleFullscreen:h,width:`min(900px, 92vw)`,centered:!0,bodyStyle:{padding:16,display:`flex`,alignItems:`center`,justifyContent:`center`,overflow:`auto`,height:f?`calc(100vh - 40px)`:`calc(80vh - 40px)`},keepDOM:!1,children:/* @__PURE__ */ R(`img`,{src:b.url,alt:t,style:{maxWidth:`100%`,maxHeight:`100%`,objectFit:`contain`}})}):b?.kind===`audio`?we(/* @__PURE__ */ R(`div`,{className:`arcbase-audio-dock`,role:`region`,"aria-label":`音频播放器`,children:/* @__PURE__ */ z(`div`,{className:`arcbase-audio-dock__inner`,children:[/* @__PURE__ */ R(`div`,{className:`arcbase-audio-dock__player`,children:/* @__PURE__ */ R(l,{className:`arcbase-audio-preview`,audioUrl:{src:b.url,title:t},theme:g?`dark`:`light`,autoPlay:!0,style:{width:`100%`}})}),/* @__PURE__ */ R(`button`,{type:`button`,className:`arcbase-audio-dock__close`,onClick:x,"aria-label":`关闭音频播放器`,children:/* @__PURE__ */ R(d,{size:18})})]})}),document.body):b?.kind===`video`?/* @__PURE__ */ R(k,{visible:!0,onCancel:x,title:S,footer:null,fullscreenable:!1,width:`min(960px, 92vw)`,centered:!0,bodyStyle:{padding:0,overflow:`hidden`,borderRadius:`var(--arc-antd-border-radius-medium)`},keepDOM:!1,children:/* @__PURE__ */ R(s,{src:b.url,theme:g?`dark`:`light`,width:`100%`,autoPlay:!1,muted:!1,volume:100,clickToPlay:!0,defaultPlaybackRate:1,playbackRateList:[{label:`0.5x`,value:.5},{label:`1x`,value:1},{label:`1.5x`,value:1.5},{label:`2x`,value:2}],style:{borderRadius:`var(--arc-antd-border-radius-medium)`}})}):null}var W,G,K,q,J;function Y(){return(Y=e((()=>{f(),u(),ee(),w(),O(),t(),W=j(()=>n(()=>import(`./PDFPreviewPanel-B-Uv0k-c.js`).then(e=>({default:e.PDFPreviewPanel})),[],import.meta.url)),G=j(()=>n(()=>import(`./FileViewerPreviewPanel-Dexjx5kJ.js`),[],import.meta.url)),K=j(()=>n(()=>import(`./MarkdownPreviewPanel-_h_-DdZ3.js`),[],import.meta.url)),q=j(()=>n(()=>import(`./JsonPreviewPanel-OAknwa5a.js`),[],import.meta.url)),J=j(()=>n(()=>import(`./MonacoPreviewPanel-j5NDq6E7.js`),[],import.meta.url))})))()}function ke({content:e,visible:t}){let n=(Array.isArray(e)?e:e?[e]:[]).filter(Boolean),r=JSON.stringify(n),[i,a]=I(null);return N(()=>{let e=JSON.parse(r);if(!t||e.length===0){a(null);return}let n=document.body.getAttribute(`theme-mode`)===`dark`,i=Te(e,13,.22,-22,180,110,n);i&&a({position:`fixed`,inset:0,pointerEvents:`none`,userSelect:`none`,zIndex:2100,backgroundImage:`url(${i.dataUrl})`,backgroundRepeat:`repeat`,backgroundSize:`${i.cssWidth}px ${i.cssHeight}px`})},[r,t]),i?/* @__PURE__ */ R(`div`,{"aria-hidden":!0,style:i,"data-testid":`preview-watermark`}):null}function X(){return(X=e((()=>{})))()}function Ae({preview:e,watermark:t}){return/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ R(c,{src:e.previewSrcList,visible:e.previewVisible,currentIndex:e.previewCurrentIndex,onChange:e.setPreviewCurrentIndex,onVisibleChange:t=>{t||e.closeImagePreview()},infinite:!0}),/* @__PURE__ */ R(Oe,{fileUrl:e.filePreview?.url??``,fileName:e.filePreview?.name,mimeType:e.filePreview?.mimeType,visible:!!e.filePreview,onClose:e.closeFilePreview}),/* @__PURE__ */ R(ke,{content:t,visible:e.previewVisible||!!e.filePreview})]})}function Z(){return(Z=e((()=>{f(),Y(),X()})))()}function je({visible:e,file:t,loading:n,resolveUrl:r,onCopyUrl:i,onClose:a,extraRows:o=[]}){return/* @__PURE__ */ R(k,{title:`文件详情`,visible:e,onCancel:a,footer:/* @__PURE__ */ z(_,{children:[/* @__PURE__ */ R(h,{onClick:()=>t&&i(t),children:`复制链接`}),/* @__PURE__ */ R(h,{type:`primary`,onClick:a,children:`关闭`})]}),width:560,children:/* @__PURE__ */ R(m,{spinning:n,tip:`加载中...`,size:`small`,children:t&&/* @__PURE__ */ R(g,{align:`left`,size:`medium`,data:[{key:`文件名`,value:t.originalName},{key:`存储服务`,value:t.storageName},{key:`MIME 类型`,value:t.mimeType||`—`},{key:`文件大小`,value:B(t.size)},...o,{key:`上传人`,value:t.uploaderName||`—`},{key:`对象键`,value:/* @__PURE__ */ R(Q,{copyable:!0,style:{fontSize:12,wordBreak:`break-all`},children:t.objectKey})},{key:`访问链接`,value:/* @__PURE__ */ R(Q,{copyable:!0,style:{fontSize:12,wordBreak:`break-all`},children:r(t)})},{key:`上传时间`,value:Se(t.createdAt)}]})})})}var Q;function Me(){return(Me=e((()=>{f(),O(),{Text:Q}=i})))()}function Ne(e){let[t,n]=I(!1),[r,i]=I([]),[o,s]=I(0),[c,l]=I(null),[u,d]=I(null),[f,p]=I(null),m=F([]),h=F(0),g=()=>{m.current.forEach(e=>globalThis.URL.revokeObjectURL(e)),m.current=[]};return{previewVisible:t,previewSrcList:r,previewCurrentIndex:o,setPreviewCurrentIndex:s,previewLoadingId:c,downloadLoadingId:f,filePreview:u,handlePreview:async t=>{let r=C(t.mimeType,t.originalName),o=ae(t.mimeType,t.originalName);if(!D(t.mimeType,t.originalName)&&!o){try{let e=await E(t.url),n=globalThis.URL.createObjectURL(e);globalThis.open(n,`_blank`,`noopener,noreferrer`),globalThis.setTimeout(()=>globalThis.URL.revokeObjectURL(n),6e4)}catch(e){a.error(e instanceof Error?e.message:`预览文件失败`)}return}if(!o){l(t.id);try{d({id:t.id,url:t.url,name:t.originalName,mimeType:r??`application/octet-stream`})}catch(e){a.error(e instanceof Error?e.message:`预览文件失败`)}finally{l(null)}return}let c=e().filter(e=>ae(e.mimeType,e.originalName)),u=c.findIndex(e=>e.id===t.id);l(t.id),h.current+=1;let f=h.current;try{g();let e=c.map(()=>``);m.current=[...e];let t=c[u],r=await E(t.url);if(h.current!==f)return;let a=await V(r,t.mimeType,t.originalName);if(h.current!==f){globalThis.URL.revokeObjectURL(a);return}e[u]=a,m.current[u]=a,i([...e]),s(Math.max(0,u)),n(!0),c.forEach(async(e,t)=>{if(t!==u)try{let n=await E(e.url);if(h.current!==f)return;let r=await V(n,e.mimeType,e.originalName);if(h.current!==f){globalThis.URL.revokeObjectURL(r);return}m.current[t]=r,i(e=>{let n=[...e];return n[t]=r,n})}catch{}})}catch(e){a.error(e instanceof Error?e.message:`预览图片失败`)}finally{l(null)}},handleDownload:async e=>{p(e.id);try{let t=await E(e.url),n=globalThis.URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=e.originalName,r.click(),globalThis.setTimeout(()=>globalThis.URL.revokeObjectURL(n),6e4)}catch(e){a.error(e instanceof Error?e.message:`下载文件失败`)}finally{p(null)}},closeImagePreview:()=>{h.current+=1,n(!1),g(),i([])},closeFilePreview:()=>d(null),resetPreview:()=>{d(null),n(!1),h.current+=1}}}function Pe(){return(Pe=e((()=>{f(),w()})))()}function Fe(e){return ve(e,{style:{...e.props.style,...Re}})}function Ie(){return document.body}function Le({point:e,contextKey:t,render:n,onClose:r}){let i=`${t}:${e.x}:${e.y}`,a=F(null),o=M(()=>{a.current!==i&&(a.current=i,r())},[r,i]);return/* @__PURE__ */ R(v,{visible:!0,trigger:`click`,position:`bottomLeft`,autoAdjustOverflow:!0,rePosKey:i,render:Fe(n),getPopupContainer:Ie,clickToHide:!0,closeOnEsc:!0,onClickOutSide:o,onVisibleChange:e=>{e||o()},children:/* @__PURE__ */ R(`span`,{"aria-hidden":`true`,style:{position:`fixed`,left:e.x,top:e.y,width:1,height:1,pointerEvents:`none`}})})}var Re;function ze(){return(ze=e((()=>{f(),Re={maxHeight:`calc(100vh - 16px)`,overflowY:`auto`}})))()}function Be(){return(Be=e((()=>{})))()}function Ve({file:e,selected:t,canSelect:n,onSelect:i,onPreview:a,onDownload:o,onDelete:s,onDetail:c,onCopyUrl:l,canDelete:u,previewLoading:d}){let[f,h]=I(null),g=D(e.mimeType,e.originalName),_=e.originalName.includes(`.`)?e.originalName.split(`.`).pop()?.toUpperCase():``;return/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ z(`div`,{className:`files-grid-card${t?` files-grid-card--selected`:``}`,onContextMenu:e=>{e.preventDefault(),h({x:e.clientX,y:e.clientY})},children:[/* @__PURE__ */ R(`button`,{type:`button`,className:`files-grid-card__preview-btn`,"aria-label":g?`预览 ${e.originalName}`:e.originalName,style:{cursor:g?`pointer`:`default`},onClick:r=>{n&&(r.ctrlKey||r.metaKey||r.shiftKey)?i(e.id,!t):g&&a(e)}}),n&&/* @__PURE__ */ R(`div`,{className:`files-grid-card__checkbox`,children:/* @__PURE__ */ R(r,{checked:t,onChange:()=>i(e.id,!t)})}),/* @__PURE__ */ R(`div`,{className:`files-grid-card__media-wrap`,children:/* @__PURE__ */ z(`div`,{className:`files-grid-card__media`,children:[/* @__PURE__ */ R(`span`,{className:`files-grid-card__icon`,children:T(e.mimeType,34,e.originalName)}),_&&/* @__PURE__ */ R(`span`,{className:`files-grid-card__type-badge`,children:_}),d&&/* @__PURE__ */ R(`div`,{className:`files-grid-card__media-overlay`,children:/* @__PURE__ */ R(m,{})})]})}),/* @__PURE__ */ z(`div`,{className:`files-grid-card__info`,children:[/* @__PURE__ */ R(p,{content:e.originalName,position:`top`,children:/* @__PURE__ */ R(`div`,{className:`files-grid-card__name`,children:e.originalName})}),/* @__PURE__ */ R(`div`,{className:`files-grid-card__meta`,children:/* @__PURE__ */ R(`span`,{children:B(e.size)})})]})]}),f&&/* @__PURE__ */ R(Le,{point:f,contextKey:e.id,onClose:()=>h(null),render:/* @__PURE__ */ z(v.Menu,{children:[g&&/* @__PURE__ */ R(v.Item,{onClick:()=>a(e),children:`预览`}),/* @__PURE__ */ R(v.Item,{onClick:()=>o(e),children:`下载`}),/* @__PURE__ */ R(v.Item,{onClick:()=>c(e),children:`详情`}),/* @__PURE__ */ R(v.Item,{onClick:()=>l(e),children:`复制链接`}),u&&/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ R(v.Divider,{}),/* @__PURE__ */ R(v.Item,{type:`danger`,onClick:()=>{S({title:`确认删除此文件?`,content:`删除文件记录后,将同步尝试删除实际存储对象。`,run:()=>Promise.resolve(s(e)),successMessage:null})},children:`删除`})]})]})})]})}function He(){return(He=e((()=>{f(),w(),x(),ze()})))()}function Ue({name:e,icon:t,mimeType:n,onClick:r,highlight:i}){let a=i?e.split(RegExp(`(${ye(i)})`,`gi`)):[e],o=/* @__PURE__ */ z(L,{children:[/* @__PURE__ */ R(`span`,{className:`file-name-cell__icon`,children:t??T(n,16,e)}),/* @__PURE__ */ R(p,{content:e,children:/* @__PURE__ */ R(`span`,{className:`file-name-cell__text`,children:a.map((e,t)=>i&&e.toLowerCase()===i.toLowerCase()?/* @__PURE__ */ R(`mark`,{children:e},t):e)})})]});return r?/* @__PURE__ */ R(`button`,{type:`button`,className:`file-name-cell file-name-cell--button`,onClick:r,children:o}):/* @__PURE__ */ R(`div`,{className:`file-name-cell`,children:o})}function $(){return($=e((()=>{f(),w()})))()}export{Be as a,je as c,Z as d,Ee as f,He as i,Me as l,$ as n,Pe as o,H as p,Ve as r,Ne as s,Ue as t,Ae as u};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{i as t,o as n,s as r}from"./controls-bzoKYN3r.js";import{t as i}from"./typography-CRVG4mWv.js";import{i as a,o,r as ee,s}from"./feedback-BfXgoa0c.js";import{_ as c,a as l,d as u,g as d,l as f,n as p,o as m,r as h,t as te}from"./ConfigurableTable-99s2D6Oo.js";import{n as g,t as _}from"./createLucideIcon-C5OSmeyR.js";import{r as v,s as y}from"./toolbar-controls-DsP_IMzf.js";import{i as b,n as x,r as ne,t as S}from"./chevron-right-qLlse2z0.js";import{n as C,t as re}from"./layout-grid-Dojxc0Yp.js";import{n as w,t as ie}from"./list-DM-uRQCs.js";import{t as T}from"./form-CNk_tjQY.js";import{C as E,S as ae,_ as oe,a as D,g as O,h as k,i as A,o as j,y as M}from"./ui-B2vRXZUo.js";import{n as N,t as P}from"./useStatusToggle-DKDwKCpT.js";import{n as se,t as ce}from"./ResponsiveTableActions-CZYzbN58.js";import{n as F,t as I}from"./useCrudOperationColumn-DPH7ct5h.js";import{n as L,t as R}from"./useListPage-Cqvo-Nm8.js";import{n as le,t as ue}from"./DateTimeText-2wbw50Ix.js";import{a as z,i as B,n as V,o as de,r as fe}from"./EditFormModal-DnbfZLjs.js";import{n as pe,r as me}from"./clipboard-Cc2mRkhL.js";import{a as he,r as ge,t as _e}from"./file-utils-Buv1r1rr.js";import{n as ve,t as ye}from"./PasswordInput-BmDdyOQ4.js";import{n as be,t as xe}from"./ExportButton-G_lYg41m.js";import{c as Se,d as Ce,f as we,i as Te,l as Ee,n as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne}from"./FileNameCell-y0GBeT7U.js";import{useEffect as Pe,useState as H}from"react";import{Fragment as Fe,jsx as U,jsxs as W}from"react/jsx-runtime";import{abortSubmit as Ie}from"@fudanda/admin-antd/core/lib/abort-submit";import{formatBytes as Le}from"@fudanda/client/core";import{fileStorageConfigContract as G}from"@fudanda/admin-antd/core/lib/native-operations";import{usePermission as Re}from"@fudanda/admin-antd/core/hooks/usePermission";import{usePagination as ze}from"@fudanda/admin-antd/core/hooks/usePagination";import{IS_GO_FOUNDATION as K}from"@fudanda/admin-antd/core/lib/foundation-mode";import{FILE_OBJECT_ACL_LABELS as Be,FILE_OBJECT_ACL_SUPPORT as Ve,FILE_STORAGE_PROVIDER_LABELS as He,FILE_STORAGE_PROVIDER_OPTIONS as Ue,FILE_URL_STRATEGY_LABELS as We,FILE_URL_STRATEGY_OPTIONS as Ge,PRESIGNED_EXPIRY_DEFAULT_SECONDS as q,PRESIGNED_EXPIRY_MAX_SECONDS as Ke,PRESIGNED_EXPIRY_MIN_SECONDS as qe}from"@fudanda/client/platform";import{useDeleteFiles as Je,useFileDetail as Ye}from"@fudanda/admin-antd/core/hooks/queries/files";import{useDeleteFileStorageConfigs as Xe,useFileStorageConfigDetail as Ze,useFileStorageConfigList as Qe,useSaveFileStorageConfig as $e,useSetDefaultFileStorageConfig as et,useStorageBrowse as tt,useTestFileStorageConfig as nt}from"@fudanda/admin-antd/core/hooks/queries/file-storage-configs";var J,Y;function rt(){return(rt=e((()=>{
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{i as t,o as n,s as r}from"./controls-bzoKYN3r.js";import{t as i}from"./typography-CRVG4mWv.js";import{i as a,o,r as ee,s}from"./feedback-BfXgoa0c.js";import{_ as c,a as l,d as u,g as d,l as f,n as p,o as m,r as h,t as te}from"./ConfigurableTable-99s2D6Oo.js";import{n as g,t as _}from"./createLucideIcon-C5OSmeyR.js";import{r as v,s as y}from"./toolbar-controls-DsP_IMzf.js";import{i as b,n as x,r as ne,t as S}from"./chevron-right-qLlse2z0.js";import{n as C,t as re}from"./layout-grid-Dojxc0Yp.js";import{n as w,t as ie}from"./list-DM-uRQCs.js";import{t as T}from"./form-CNk_tjQY.js";import{C as E,S as ae,_ as oe,a as D,g as O,h as k,i as A,o as j,y as M}from"./ui-B2vRXZUo.js";import{n as N,t as P}from"./useStatusToggle-DKDwKCpT.js";import{n as se,t as ce}from"./ResponsiveTableActions-CZYzbN58.js";import{n as F,t as I}from"./useCrudOperationColumn-DPH7ct5h.js";import{n as L,t as R}from"./useListPage-Cqvo-Nm8.js";import{n as le,t as ue}from"./DateTimeText-2wbw50Ix.js";import{a as z,i as B,n as V,o as de,r as fe}from"./EditFormModal-DnbfZLjs.js";import{n as pe,r as me}from"./clipboard-Cc2mRkhL.js";import{a as he,r as ge,t as _e}from"./file-utils-Buv1r1rr.js";import{n as ve,t as ye}from"./PasswordInput-BmDdyOQ4.js";import{n as be,t as xe}from"./ExportButton-G_lYg41m.js";import{c as Se,d as Ce,f as we,i as Te,l as Ee,n as De,o as Oe,p as ke,r as Ae,s as je,t as Me,u as Ne}from"./FileNameCell-3SmT42SA.js";import{useEffect as Pe,useState as H}from"react";import{Fragment as Fe,jsx as U,jsxs as W}from"react/jsx-runtime";import{abortSubmit as Ie}from"@fudanda/admin-antd/core/lib/abort-submit";import{formatBytes as Le}from"@fudanda/client/core";import{fileStorageConfigContract as G}from"@fudanda/admin-antd/core/lib/native-operations";import{usePermission as Re}from"@fudanda/admin-antd/core/hooks/usePermission";import{usePagination as ze}from"@fudanda/admin-antd/core/hooks/usePagination";import{IS_GO_FOUNDATION as K}from"@fudanda/admin-antd/core/lib/foundation-mode";import{FILE_OBJECT_ACL_LABELS as Be,FILE_OBJECT_ACL_SUPPORT as Ve,FILE_STORAGE_PROVIDER_LABELS as He,FILE_STORAGE_PROVIDER_OPTIONS as Ue,FILE_URL_STRATEGY_LABELS as We,FILE_URL_STRATEGY_OPTIONS as Ge,PRESIGNED_EXPIRY_DEFAULT_SECONDS as q,PRESIGNED_EXPIRY_MAX_SECONDS as Ke,PRESIGNED_EXPIRY_MIN_SECONDS as qe}from"@fudanda/client/platform";import{useDeleteFiles as Je,useFileDetail as Ye}from"@fudanda/admin-antd/core/hooks/queries/files";import{useDeleteFileStorageConfigs as Xe,useFileStorageConfigDetail as Ze,useFileStorageConfigList as Qe,useSaveFileStorageConfig as $e,useSetDefaultFileStorageConfig as et,useStorageBrowse as tt,useTestFileStorageConfig as nt}from"@fudanda/admin-antd/core/hooks/queries/file-storage-configs";var J,Y;function rt(){return(rt=e((()=>{
2
2
  /**
3
3
  * @license lucide-react v1.53.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{i as e,n as t,r as n}from"./rolldown-runtime-pDENg-lZ.js";import{n as r,t as i}from"./preload-helper-B32n4JOp.js";import{c as a,s as o}from"../src-DXdeqJtP.js";import{n as s,r as c}from"./theme-controller-CpTzD2Pa.js";import{n as l,t as u}from"./purify.es-Va5z8s_I.js";import{S as d,a as f,y as p}from"./file-utils-Buv1r1rr.js";import{forwardRef as m,useEffect as h,useImperativeHandle as g,useMemo as _,useRef as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{DEFAULT_RENDERER_DEFINITIONS as S,attachFileViewerErrorMessage as ee,createFileViewerTranslator as te,createFileViewerZoomChangeEmitter as ne,fileViewerCoreRendererRegistry as re,getDefaultFileViewerAssetBaseUrl as ie,getFileViewerShadowRootForNode as ae,normalizeFileViewerErrorMessage as C,registerFileViewerAutoRendererPreset as w,registerFileViewerZoomProvider as oe,resolveFileViewerCopiedAssetUrl as se,resolveFileViewerLocale as T,resolveFileViewerPresentationWorkerUrl as ce,resolveFileViewerRuntimeAssetBaseUrl as le,unregisterFileViewerZoomProvider as ue,waitForFileViewerNextPaint as de}from"@file-viewer/core";import{resolveFileViewerRuntimeAssetBaseUrl as fe,setDefaultFileViewerAssetBaseUrl as E}from"@file-viewer/core/assets";var D=/* @__PURE__ */ n({});import*as O from"@file-viewer/core/browser";e(D,O);function k(){return(k=t((()=>{})))()}var A,pe,j,M;function N(){return(N=t((()=>{k(),A={width:`100%`,height:`100%`,minHeight:0},pe={registry:re},j=(e,t)=>{var n;(n=e.current)==null||n.destroy(),e.current=null,t&&(t.innerHTML=``)},M=m((e,t)=>{let{url:n,file:r,buffer:i,name:a,filename:o,type:s,size:c,options:l,onEvent:u,onStateChange:d,style:f,...p}=e,m=v(null),y=v(null),x=v(null),S=_(()=>({url:n,file:r,buffer:i,name:a,filename:o,type:s,size:c,options:l,onEvent:u,onStateChange:d}),[n,r,i,a,o,s,c,l,u,d]);return h(()=>{let e=m.current;if(e&&!y.current)return x.current=S,y.current=(0,D.mountViewer)(e,S,pe),()=>{x.current=null,j(y,e)}},[]),h(()=>{var e;x.current!==S&&(x.current=S,(e=y.current)==null||e.update(S))},[S]),g(t,()=>(0,D.createViewerControllerHandle)(()=>y.current,()=>j(y,m.current)),[]),b(`div`,{...p,ref:m,style:{...A,...f}})}),M.displayName=`FileViewer`})))()}var P,me,he,ge;function _e(){return(_e=t((()=>{if(r(),P=S.find(e=>e.id===`archive`),!P)throw Error(`@file-viewer/renderer-archive could not locate the shared archive format definition.`);me=P,he=(e,t,n,r)=>i(async()=>{let{default:e}=await import(`./archive-CfhpdMSv.js`);return{default:e}},[],import.meta.url).then(({default:i})=>i(e,t,n,r)),ge={id:`file-viewer-renderer-archive`,label:`Flyfish File Viewer archive renderer`,definitions:[me],handlers:[{rendererId:me.id,handler:he}]}})))()}var ve;function ye(){return(ye=t((()=>{ve=new URL(`../assets/worker-bundle-Dx5mKZOL.js`,import.meta.url).href})))()}var be;function xe(){return(xe=t((()=>{be=new URL(`../assets/libarchive-DxGirPmi.wasm`,import.meta.url).href})))()}var Se,Ce,we,Te,Ee,F,De,Oe,ke,Ae,I,je,Me,L,Ne,Pe,Fe,Ie;function Le(){return(Le=t((()=>{Se=null,Ce=e=>Array.isArray(e?.MsgQueue)?e.MsgQueue:[],we=(e,t)=>{let n=e;return n.id===t?n:Array.from(e.querySelectorAll(`[id]`)).find(e=>e.id===t)||null},Te=(e,t)=>{switch(e){case`arabicPeriod`:return`${t}. `;case`arabicParenR`:return`${t}) `;case`alphaLcParenR`:return`${String.fromCharCode(t+96)}) `;case`alphaLcPeriod`:return`${String.fromCharCode(t+96)}. `;case`alphaUcParenR`:return`${String.fromCharCode(t+64)}) `;case`alphaUcPeriod`:return`${String.fromCharCode(t+64)}. `;default:return String(t)}},Ee=e=>{let t=[...Array.from(e.querySelectorAll(`.block`)),...Array.from(e.querySelectorAll(`table td`))];for(let e of t){let t=Array.from(e.querySelectorAll(`.numeric-bullet-style`)),n=/* @__PURE__ */ new Map;for(let e of t){let t=String(e.dataset.bulltname||`arabicPeriod`),r=`${String(e.dataset.bulltlvl||`0`)}:${t}`,i=(n.get(r)||0)+1;n.set(r,i),e.textContent=Te(t,i)}}},F=.7,De=8,Oe=1,ke=e=>`pptxFit${e.charAt(0).toUpperCase()}${e.slice(1)}`,Ae=(e,t,n=getComputedStyle(e))=>{let r=ke(t),i=Number(e.dataset[r]);if(Number.isFinite(i)&&i>0)return i;let a=parseFloat(n[t]);if(!(!Number.isFinite(a)||a<=0))return e.dataset[r]=String(a),a},I=(e,t,n,r=getComputedStyle(e))=>{let i=Ae(e,t,r);i!==void 0&&(e.style[t]=`${i*n}px`)},je=e=>{let t=/* @__PURE__ */ new Set;return e.querySelectorAll(`.text-block, .numeric-bullet-style`).forEach(e=>{t.add(e)}),e.querySelectorAll(`.slide-prgrph`).forEach(e=>{Array.from(e.children).forEach(e=>{if(!(e instanceof HTMLElement)||e.querySelector(`.text-block`))return;let n=getComputedStyle(e),r=parseFloat(n.fontSize);Number.isFinite(r)&&r>0&&t.add(e)})}),t},Me=(e,t)=>{e.dataset.pptxTextFitScale=String(t);for(let n of je(e)){let e=getComputedStyle(n);I(n,`fontSize`,t,e),I(n,`lineHeight`,t,e),I(n,`paddingLeft`,t,e),I(n,`paddingRight`,t,e)}e.querySelectorAll(`.slide-prgrph`).forEach(e=>{let n=getComputedStyle(e);I(e,`lineHeight`,t,n),I(e,`marginTop`,t,n),I(e,`marginBottom`,t,n),I(e,`paddingTop`,t,n),I(e,`paddingBottom`,t,n)}),e.querySelectorAll(`.slide-prgrph > *`).forEach(e=>{let n=getComputedStyle(e);I(e,`marginLeft`,t,n),I(e,`marginRight`,t,n),I(e,`paddingLeft`,t,n),I(e,`paddingRight`,t,n)})},L=(e,t=!0)=>e.scrollHeight>e.clientHeight+Oe||t&&e.scrollWidth>e.clientWidth+Oe,Ne=(e,t=!0)=>{if(!e.querySelector(`.text-block`)||e.clientWidth<=0||e.clientHeight<=0)return;let n=Number(e.dataset.pptxTextFitScale)||1;if(L(e,t))for(let r=0;r<De&&L(e,t);r+=1){let r=e.scrollHeight>0?Math.min(1,e.clientHeight/e.scrollHeight):1,i=t&&e.scrollWidth>0?Math.min(1,e.clientWidth/e.scrollWidth):1,a=Math.max(F,n*Math.max(Math.min(r,i,.98),.95));if(n=a>=n-.002?Math.max(F,n*.97):a,Me(e,n),n<=F&&L(e,t))break}},Pe=e=>{e.querySelectorAll(`.slide div.content, .slide div.content-rtl`).forEach(e=>Ne(e)),e.querySelectorAll(`.slide .pptx-table-cell-content`).forEach(e=>Ne(e,!1))},Fe=async(e,t)=>{let n=e.data;if(!n?.chartID||!n.chartType||!n.chartData)return;let r=we(t,n.chartID);if(!r)return;if(!Se){r.dataset.fileViewerMissingCapability=`pptx-charts`,r.setAttribute(`title`,"PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`."),console.warn("[file-viewer] PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`.");return}let{billboard:i,d3Format:a}=await Se(),o=i.default||i,{area:s,bar:c,line:l,pie:u,scatter:d}=i,f={bindto:r},p=n.chartData,m={x:{tick:{format(e){return p[0]?.xlabels?.[e]??e}}}};switch(n.chartType){case`lineChart`:Object.assign(f,{data:{columns:p.map(e=>[e.key,...e.values.map(({y:e})=>e)]),type:l()},axis:m,interaction:{enabled:!0}});break;case`barChart`:Object.assign(f,{data:{columns:p.map(e=>[e.key,...e.values.map(({y:e})=>e)]),type:c()},axis:{rotated:n.barDirection===`bar`,x:{tick:{multiline:!0,format(e){return p[0]?.xlabels?.[e]??e}}}}});break;case`pieChart`:case`pie3DChart`:Object.assign(f,{data:{columns:Object.values(p[0]?.xlabels||{}).map((e,t)=>[e,p[0]?.values?.[t]?.y]),type:u()}});break;case`areaChart`:Object.assign(f,{data:{columns:p.map(e=>[e.key,...e.values.map(({y:e})=>e)]),type:s()},axis:m,interaction:{enabled:!0}});break;case`scatterChart`:Object.assign(f,{data:{xs:{y:`x`},columns:p.map((e,t)=>[t?`y`:`x`,...e]),type:d()},axis:{x:{label:`X`,showDist:!0,tick:{format:a.format(`.02f`)}},y:{label:`Y`,showDist:!0,tick:{format:a.format(`.02f`)}}}});break;default:return}if(f.data)return o.generate(f)},Ie=async(e,t)=>{Ee(t),Pe(t);let n=Ce(e),r=[];if(n.length){let e=await Promise.allSettled(n.map(e=>Fe(e,t)));for(let t of e)t.status===`fulfilled`?t.value&&r.push(t.value):console.warn(`PPTX chart rendering skipped:`,t.reason)}let i=!1;return{destroy(){var e;if(!i){i=!0;for(let t of r)try{(e=t.destroy)==null||e.call(t)}catch{}r.length=0}}}}})))()}var Re,ze,Be;function Ve(){return(Ve=t((()=>{Re={maxFileBytes:167772160},ze=()=>({slidesScale:``,slideMode:!1,slideType:`divs2slidesjs`,revealjsPath:``,keyBoardShortCut:!1,mediaProcess:!0,jsZipV2:!1,themeProcess:!0,incSlide:{width:0,height:0},slideModeConfig:{first:1,nav:!0,navTxtColor:`black`,keyBoardShortCut:!0,showSlideNum:!0,showTotalSlideNum:!0,autoSlide:!0,randomAutoSlide:!1,loop:!1,background:!1,transition:`default`,transitionTime:1},revealjsConfig:{}}),Be=e=>{let t=ze();return{...t,...e,incSlide:{width:e?.incSlide?.width??t.incSlide?.width??0,height:e?.incSlide?.height??t.incSlide?.height??0},slideModeConfig:{...t.slideModeConfig,...e?.slideModeConfig},revealjsConfig:{...t.revealjsConfig,...e?.revealjsConfig}}}})))()}var He,Ue;function We(){return(We=t((()=>{He=(e,t,n)=>Math.min(Math.max(e,t),n),Ue=class{constructor(e,t={},n=!0){this.overlay=null,this.stage=null,this.counter=null,this.placeholder=null,this.listeners=[],this.layoutFrame=0,this.ownsFullscreen=!1,this.current=1,this.viewer=e,this.labels=t,this.fullscreen=n}get active(){return!!this.overlay}get slideNumber(){return this.current}get state(){return{active:this.active,slideNumber:this.current,total:this.viewer.slideCount}}async enter(e=this.current){var t;if(this.active||this.viewer.slideCount===0)return;let n=this.viewer.target.ownerDocument||document,r=n.createElement(`div`);r.className=`flyfish-pptx-presentation`,r.tabIndex=-1,r.setAttribute(`role`,`region`),r.setAttribute(`aria-label`,this.labels.hint||`Slideshow`);let i=n.createElement(`div`);i.className=`flyfish-pptx-presentation-stage`;let a=n.createElement(`div`);a.className=`flyfish-pptx-presentation-counter`;let o=n.createElement(`div`);o.className=`flyfish-pptx-presentation-hint`,o.textContent=this.labels.hint||``,o.hidden=!this.labels.hint;let s=n.createElement(`button`);if(s.type=`button`,s.className=`flyfish-pptx-presentation-exit`,s.textContent=`✕`,s.setAttribute(`aria-label`,this.labels.exit||`Exit slideshow`),s.addEventListener(`click`,e=>{e.stopPropagation(),this.exit()}),r.append(i,a,o,s),this.overlay=r,this.stage=i,this.counter=a,this.viewer.presentationRoot.appendChild(r),this.placeholder=n.createComment(`flyfish-pptx-presentation`),this.viewer.saveScrollPosition(),this.viewer.scaleBox.replaceWith(this.placeholder),i.appendChild(this.viewer.scaleBox),this.viewer.content.classList.add(`is-presenting`),this.attach(n,r),this.goTo(e),this.fullscreen)try{await r.requestFullscreen?.call(r),this.ownsFullscreen=this.isFullscreenElement(r)}catch{this.ownsFullscreen=!1}this.overlay===r?(r.focus({preventScroll:!0}),this.scheduleLayout(),this.notify()):(this.ownsFullscreen&&((t=n.exitFullscreen)==null||t.call(n).catch(()=>void 0)),this.ownsFullscreen=!1)}exit(){var e;let t=this.overlay;if(!t)return;let n=this.viewer.target.ownerDocument||document,r=this.ownsFullscreen&&this.isFullscreenElement(t);this.detach(),this.layoutFrame&&=((n.defaultView||window).cancelAnimationFrame(this.layoutFrame),0),this.viewer.content.classList.remove(`is-presenting`);for(let e of this.slideContainers())e.classList.remove(`is-active-slide`);this.placeholder?.parentNode?this.placeholder.replaceWith(this.viewer.scaleBox):this.viewer.target.appendChild(this.viewer.scaleBox),this.placeholder=null,t.remove(),this.overlay=null,this.stage=null,this.counter=null,r&&((e=n.exitFullscreen)==null||e.call(n).catch(()=>void 0)),this.ownsFullscreen=!1,this.viewer.restoreScrollPosition(),this.notify()}async toggle(e){this.active?this.exit():await this.enter(e)}goTo(e){let t=this.viewer.slideCount;if(t===0)return;this.current=He(Math.round(e)||1,1,t),this.viewer.ensureSlideRendered(this.current),this.viewer.ensureSlideRendered(this.current+1);let n=this.slideContainers(),r=n.some(e=>!!e.dataset.slideNumber);n.forEach((e,t)=>{let n=r?Number(e.dataset.slideNumber)===this.current:t===this.current-1;e.classList.toggle(`is-active-slide`,n)}),this.counter&&(this.counter.textContent=`${this.current} / ${t}`),this.active&&(this.scheduleLayout(),this.notify())}next(){this.current<this.viewer.slideCount&&this.goTo(this.current+1)}previous(){this.current>1&&this.goTo(this.current-1)}layout(){let e=this.overlay;if(!e)return;let t=this.slideContainers().find((e,t)=>e.dataset.slideNumber?Number(e.dataset.slideNumber)===this.current:t===this.current-1),n=t&&t.classList.contains(`flyfish-pptx-slide-slot`)?t.firstElementChild:t,r=this.viewer.slideDimensions,i=n?.offsetWidth||r?.width||0,a=n?.offsetHeight||r?.height||0;if(!i||!a)return;let o=e.clientWidth,s=e.clientHeight,c=Math.min(o/i,s/a),l=Math.max(0,(o-i*c)/2),u=Math.max(0,(s-a*c)/2),d=this.viewer.content;d.style.width=`${i}px`,d.style.transform=`translate(${l}px, ${u}px) scale(${c})`;let f=this.viewer.scaleBox;f.style.width=`100%`,f.style.height=`100%`,f.style.minHeight=``}destroy(){this.exit()}slots(){return Array.from(this.viewer.content.querySelectorAll(`:scope > .flyfish-pptx-slide-slot`))}slideContainers(){let e=this.slots();return e.length>0?e:Array.from(this.viewer.content.querySelectorAll(`:scope > .slide`))}isFullscreenElement(e){let t=this.viewer.target.ownerDocument||document;if(t.fullscreenElement===e)return!0;let n=e.getRootNode();return n!==t&&`fullscreenElement`in n&&n.fullscreenElement===e}scheduleLayout(){let e=this.viewer.target.ownerDocument.defaultView||window;this.layoutFrame&&e.cancelAnimationFrame(this.layoutFrame),this.layoutFrame=e.requestAnimationFrame(()=>{this.layoutFrame=0,this.layout()})}notify(){this.viewer.emitPresentationChange(this.state)}on(e,t,n){e.addEventListener(t,n),this.listeners.push({target:e,type:t,listener:n})}attach(e,t){let n=e.defaultView||window;this.on(e,`keydown`,e=>this.handleKey(e)),this.on(t,`click`,e=>this.handleClick(e)),this.on(t,`contextmenu`,e=>{e.preventDefault(),this.previous()}),this.on(n,`resize`,()=>this.scheduleLayout()),this.on(e,`fullscreenchange`,()=>{this.ownsFullscreen&&!this.isFullscreenElement(t)&&(this.ownsFullscreen=!1,this.exit())})}detach(){for(let{target:e,type:t,listener:n}of this.listeners)e.removeEventListener(t,n);this.listeners=[]}handleClick(e){let t=this.overlay;if(!t||e.target?.closest(`.flyfish-pptx-presentation-exit`))return;let n=t.getBoundingClientRect();(e.clientX-n.left)/(n.width||1)<.2?this.previous():this.next()}handleKey(e){if(!this.active||e.altKey||e.metaKey||e.ctrlKey)return;let t=e.target;if(!(t&&typeof t.closest==`function`&&t.closest(`button, a, input, textarea, select, [contenteditable="true"], [contenteditable=""]`))){if(t&&typeof t.closest==`function`){let e=t.closest(`.flyfish-pptx-presentation`);if(e&&e!==this.overlay)return}switch(e.key){case`ArrowRight`:case`ArrowDown`:case`PageDown`:case` `:case`Enter`:e.preventDefault(),this.next();break;case`ArrowLeft`:case`ArrowUp`:case`PageUp`:case`Backspace`:e.preventDefault(),this.previous();break;case`Home`:e.preventDefault(),this.goTo(1);break;case`End`:e.preventDefault(),this.goTo(this.viewer.slideCount);break;case`Escape`:e.preventDefault(),this.exit()}}}}})))()}var Ge,R,Ke,qe,Je,Ye,Xe,z,B,Ze,Qe,$e,et,tt;function nt(){return(nt=t((()=>{u(),Ge=`.flyfish-pptx-content`,R=/\s*(\._(?:css|svg_css|tbl_cell_css)_[A-Za-z0-9_-]+)\s*\{([^{}]*)\}/y,Ke=/* @__PURE__ */ new WeakMap,qe=e=>{let t=e.createDocumentFragment(),n=e.createElement(`section`);return n.className=`slide flyfish-pptx-slide-error`,n.textContent=`This slide could not be displayed safely.`,t.append(n),t},Je=e=>{let t=Ke.get(e);if(t)return t;let n=e.defaultView;if(!n)return null;let r=l(n);return r.isSupported?(Ke.set(e,r),r):null},Ye=e=>{let t=e.trim().replace(/^(?:"([\s\S]*)"|'([\s\S]*)')$/,`$1$2`).trim();return/^#[A-Za-z0-9_.:-]+$/.test(t)?!0:/^data:image\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+$/i.test(t)},Xe=(e,t)=>{let n=e.trim();return t&&/^#[A-Za-z0-9_.:-]+$/.test(n)||/^blob:/i.test(n)?!0:/^data:image\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+$/i.test(n)},z=e=>{let t=e.replace(/\/\*[\s\S]*?\*\//g,``).trim();if(/(?:expression|image(?:-set)?|paint|var)\s*\(/i.test(t)||/(?:javascript|vbscript)\s*:/i.test(t)||/(?:^|[^-])behavior\s*:/i.test(t)||/-moz-binding/i.test(t)||t.includes(`\\`))return!1;let n=!1,r=t.replace(/url\(\s*([^)]*?)\s*\)/gi,(e,t)=>(Ye(t)||(n=!0),``));return!n&&!/url\s*\(/i.test(r)},B=(e,t)=>{let n=e.createElement(`span`);n.setAttribute(`style`,t);let r=n.style,i=Array.from({length:r.length},(e,t)=>r.item(t));for(let e of i){let t=r.getPropertyValue(e);(!e||e.startsWith(`--`)||e===`behavior`||e===`-moz-binding`||e===`position`&&/^(?:fixed|sticky)$/i.test(t.trim())||!z(t))&&r.removeProperty(e)}return r.cssText},Ze=(e,t)=>{t.querySelectorAll(`[style]`).forEach(t=>{let n=B(e,t.getAttribute(`style`)||``);n?t.setAttribute(`style`,n):t.removeAttribute(`style`)})},Qe=e=>{e.querySelectorAll(`[src],[srcset],[poster],[href],[xlink\\:href]`).forEach(e=>{for(let t of[`src`,`srcset`,`poster`,`href`,`xlink:href`]){if(!e.hasAttribute(t)||e.namespaceURI===`http://www.w3.org/1999/xhtml`&&e.localName===`a`&&t===`href`)continue;let n=e.namespaceURI===`http://www.w3.org/2000/svg`&&(t===`href`||t===`xlink:href`);Xe(e.getAttribute(t)||``,n)||e.removeAttribute(t)}})},$e=e=>{e.querySelectorAll(`svg, svg *`).forEach(e=>{for(let t of Array.from(e.attributes)){let n=t.value;/url\s*\(/i.test(n)&&!z(n)&&e.removeAttribute(t.name)}})},et=(e,t)=>{let n=[],r=0;for(;r<t.length&&t.slice(r).trim();){R.lastIndex=r;let i=R.exec(t);if(!i)return``;let a=B(e,i[2]);a&&n.push(`${Ge} ${i[1]}{${a}}`),r=R.lastIndex}return n.join(`
1
+ import{i as e,n as t,r as n}from"./rolldown-runtime-pDENg-lZ.js";import{n as r,t as i}from"./preload-helper-B32n4JOp.js";import{c as a,s as o}from"../src-CeFrSNPb.js";import{n as s,r as c}from"./theme-controller-CpTzD2Pa.js";import{n as l,t as u}from"./purify.es-Va5z8s_I.js";import{S as d,a as f,y as p}from"./file-utils-Buv1r1rr.js";import{forwardRef as m,useEffect as h,useImperativeHandle as g,useMemo as _,useRef as v,useState as y}from"react";import{jsx as b,jsxs as x}from"react/jsx-runtime";import{DEFAULT_RENDERER_DEFINITIONS as S,attachFileViewerErrorMessage as ee,createFileViewerTranslator as te,createFileViewerZoomChangeEmitter as ne,fileViewerCoreRendererRegistry as re,getDefaultFileViewerAssetBaseUrl as ie,getFileViewerShadowRootForNode as ae,normalizeFileViewerErrorMessage as C,registerFileViewerAutoRendererPreset as w,registerFileViewerZoomProvider as oe,resolveFileViewerCopiedAssetUrl as se,resolveFileViewerLocale as T,resolveFileViewerPresentationWorkerUrl as ce,resolveFileViewerRuntimeAssetBaseUrl as le,unregisterFileViewerZoomProvider as ue,waitForFileViewerNextPaint as de}from"@file-viewer/core";import{resolveFileViewerRuntimeAssetBaseUrl as fe,setDefaultFileViewerAssetBaseUrl as E}from"@file-viewer/core/assets";var D=/* @__PURE__ */ n({});import*as O from"@file-viewer/core/browser";e(D,O);function k(){return(k=t((()=>{})))()}var A,pe,j,M;function N(){return(N=t((()=>{k(),A={width:`100%`,height:`100%`,minHeight:0},pe={registry:re},j=(e,t)=>{var n;(n=e.current)==null||n.destroy(),e.current=null,t&&(t.innerHTML=``)},M=m((e,t)=>{let{url:n,file:r,buffer:i,name:a,filename:o,type:s,size:c,options:l,onEvent:u,onStateChange:d,style:f,...p}=e,m=v(null),y=v(null),x=v(null),S=_(()=>({url:n,file:r,buffer:i,name:a,filename:o,type:s,size:c,options:l,onEvent:u,onStateChange:d}),[n,r,i,a,o,s,c,l,u,d]);return h(()=>{let e=m.current;if(e&&!y.current)return x.current=S,y.current=(0,D.mountViewer)(e,S,pe),()=>{x.current=null,j(y,e)}},[]),h(()=>{var e;x.current!==S&&(x.current=S,(e=y.current)==null||e.update(S))},[S]),g(t,()=>(0,D.createViewerControllerHandle)(()=>y.current,()=>j(y,m.current)),[]),b(`div`,{...p,ref:m,style:{...A,...f}})}),M.displayName=`FileViewer`})))()}var P,me,he,ge;function _e(){return(_e=t((()=>{if(r(),P=S.find(e=>e.id===`archive`),!P)throw Error(`@file-viewer/renderer-archive could not locate the shared archive format definition.`);me=P,he=(e,t,n,r)=>i(async()=>{let{default:e}=await import(`./archive-CfhpdMSv.js`);return{default:e}},[],import.meta.url).then(({default:i})=>i(e,t,n,r)),ge={id:`file-viewer-renderer-archive`,label:`Flyfish File Viewer archive renderer`,definitions:[me],handlers:[{rendererId:me.id,handler:he}]}})))()}var ve;function ye(){return(ye=t((()=>{ve=new URL(`../assets/worker-bundle-Dx5mKZOL.js`,import.meta.url).href})))()}var be;function xe(){return(xe=t((()=>{be=new URL(`../assets/libarchive-DxGirPmi.wasm`,import.meta.url).href})))()}var Se,Ce,we,Te,Ee,F,De,Oe,ke,Ae,I,je,Me,L,Ne,Pe,Fe,Ie;function Le(){return(Le=t((()=>{Se=null,Ce=e=>Array.isArray(e?.MsgQueue)?e.MsgQueue:[],we=(e,t)=>{let n=e;return n.id===t?n:Array.from(e.querySelectorAll(`[id]`)).find(e=>e.id===t)||null},Te=(e,t)=>{switch(e){case`arabicPeriod`:return`${t}. `;case`arabicParenR`:return`${t}) `;case`alphaLcParenR`:return`${String.fromCharCode(t+96)}) `;case`alphaLcPeriod`:return`${String.fromCharCode(t+96)}. `;case`alphaUcParenR`:return`${String.fromCharCode(t+64)}) `;case`alphaUcPeriod`:return`${String.fromCharCode(t+64)}. `;default:return String(t)}},Ee=e=>{let t=[...Array.from(e.querySelectorAll(`.block`)),...Array.from(e.querySelectorAll(`table td`))];for(let e of t){let t=Array.from(e.querySelectorAll(`.numeric-bullet-style`)),n=/* @__PURE__ */ new Map;for(let e of t){let t=String(e.dataset.bulltname||`arabicPeriod`),r=`${String(e.dataset.bulltlvl||`0`)}:${t}`,i=(n.get(r)||0)+1;n.set(r,i),e.textContent=Te(t,i)}}},F=.7,De=8,Oe=1,ke=e=>`pptxFit${e.charAt(0).toUpperCase()}${e.slice(1)}`,Ae=(e,t,n=getComputedStyle(e))=>{let r=ke(t),i=Number(e.dataset[r]);if(Number.isFinite(i)&&i>0)return i;let a=parseFloat(n[t]);if(!(!Number.isFinite(a)||a<=0))return e.dataset[r]=String(a),a},I=(e,t,n,r=getComputedStyle(e))=>{let i=Ae(e,t,r);i!==void 0&&(e.style[t]=`${i*n}px`)},je=e=>{let t=/* @__PURE__ */ new Set;return e.querySelectorAll(`.text-block, .numeric-bullet-style`).forEach(e=>{t.add(e)}),e.querySelectorAll(`.slide-prgrph`).forEach(e=>{Array.from(e.children).forEach(e=>{if(!(e instanceof HTMLElement)||e.querySelector(`.text-block`))return;let n=getComputedStyle(e),r=parseFloat(n.fontSize);Number.isFinite(r)&&r>0&&t.add(e)})}),t},Me=(e,t)=>{e.dataset.pptxTextFitScale=String(t);for(let n of je(e)){let e=getComputedStyle(n);I(n,`fontSize`,t,e),I(n,`lineHeight`,t,e),I(n,`paddingLeft`,t,e),I(n,`paddingRight`,t,e)}e.querySelectorAll(`.slide-prgrph`).forEach(e=>{let n=getComputedStyle(e);I(e,`lineHeight`,t,n),I(e,`marginTop`,t,n),I(e,`marginBottom`,t,n),I(e,`paddingTop`,t,n),I(e,`paddingBottom`,t,n)}),e.querySelectorAll(`.slide-prgrph > *`).forEach(e=>{let n=getComputedStyle(e);I(e,`marginLeft`,t,n),I(e,`marginRight`,t,n),I(e,`paddingLeft`,t,n),I(e,`paddingRight`,t,n)})},L=(e,t=!0)=>e.scrollHeight>e.clientHeight+Oe||t&&e.scrollWidth>e.clientWidth+Oe,Ne=(e,t=!0)=>{if(!e.querySelector(`.text-block`)||e.clientWidth<=0||e.clientHeight<=0)return;let n=Number(e.dataset.pptxTextFitScale)||1;if(L(e,t))for(let r=0;r<De&&L(e,t);r+=1){let r=e.scrollHeight>0?Math.min(1,e.clientHeight/e.scrollHeight):1,i=t&&e.scrollWidth>0?Math.min(1,e.clientWidth/e.scrollWidth):1,a=Math.max(F,n*Math.max(Math.min(r,i,.98),.95));if(n=a>=n-.002?Math.max(F,n*.97):a,Me(e,n),n<=F&&L(e,t))break}},Pe=e=>{e.querySelectorAll(`.slide div.content, .slide div.content-rtl`).forEach(e=>Ne(e)),e.querySelectorAll(`.slide .pptx-table-cell-content`).forEach(e=>Ne(e,!1))},Fe=async(e,t)=>{let n=e.data;if(!n?.chartID||!n.chartType||!n.chartData)return;let r=we(t,n.chartID);if(!r)return;if(!Se){r.dataset.fileViewerMissingCapability=`pptx-charts`,r.setAttribute(`title`,"PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`."),console.warn("[file-viewer] PPTX chart rendering requires @file-viewer/capability-pptx-charts. Run `npx file-viewer-cli add pptx-charts --write`, then `npx file-viewer-cli install --yes`.");return}let{billboard:i,d3Format:a}=await Se(),o=i.default||i,{area:s,bar:c,line:l,pie:u,scatter:d}=i,f={bindto:r},p=n.chartData,m={x:{tick:{format(e){return p[0]?.xlabels?.[e]??e}}}};switch(n.chartType){case`lineChart`:Object.assign(f,{data:{columns:p.map(e=>[e.key,...e.values.map(({y:e})=>e)]),type:l()},axis:m,interaction:{enabled:!0}});break;case`barChart`:Object.assign(f,{data:{columns:p.map(e=>[e.key,...e.values.map(({y:e})=>e)]),type:c()},axis:{rotated:n.barDirection===`bar`,x:{tick:{multiline:!0,format(e){return p[0]?.xlabels?.[e]??e}}}}});break;case`pieChart`:case`pie3DChart`:Object.assign(f,{data:{columns:Object.values(p[0]?.xlabels||{}).map((e,t)=>[e,p[0]?.values?.[t]?.y]),type:u()}});break;case`areaChart`:Object.assign(f,{data:{columns:p.map(e=>[e.key,...e.values.map(({y:e})=>e)]),type:s()},axis:m,interaction:{enabled:!0}});break;case`scatterChart`:Object.assign(f,{data:{xs:{y:`x`},columns:p.map((e,t)=>[t?`y`:`x`,...e]),type:d()},axis:{x:{label:`X`,showDist:!0,tick:{format:a.format(`.02f`)}},y:{label:`Y`,showDist:!0,tick:{format:a.format(`.02f`)}}}});break;default:return}if(f.data)return o.generate(f)},Ie=async(e,t)=>{Ee(t),Pe(t);let n=Ce(e),r=[];if(n.length){let e=await Promise.allSettled(n.map(e=>Fe(e,t)));for(let t of e)t.status===`fulfilled`?t.value&&r.push(t.value):console.warn(`PPTX chart rendering skipped:`,t.reason)}let i=!1;return{destroy(){var e;if(!i){i=!0;for(let t of r)try{(e=t.destroy)==null||e.call(t)}catch{}r.length=0}}}}})))()}var Re,ze,Be;function Ve(){return(Ve=t((()=>{Re={maxFileBytes:167772160},ze=()=>({slidesScale:``,slideMode:!1,slideType:`divs2slidesjs`,revealjsPath:``,keyBoardShortCut:!1,mediaProcess:!0,jsZipV2:!1,themeProcess:!0,incSlide:{width:0,height:0},slideModeConfig:{first:1,nav:!0,navTxtColor:`black`,keyBoardShortCut:!0,showSlideNum:!0,showTotalSlideNum:!0,autoSlide:!0,randomAutoSlide:!1,loop:!1,background:!1,transition:`default`,transitionTime:1},revealjsConfig:{}}),Be=e=>{let t=ze();return{...t,...e,incSlide:{width:e?.incSlide?.width??t.incSlide?.width??0,height:e?.incSlide?.height??t.incSlide?.height??0},slideModeConfig:{...t.slideModeConfig,...e?.slideModeConfig},revealjsConfig:{...t.revealjsConfig,...e?.revealjsConfig}}}})))()}var He,Ue;function We(){return(We=t((()=>{He=(e,t,n)=>Math.min(Math.max(e,t),n),Ue=class{constructor(e,t={},n=!0){this.overlay=null,this.stage=null,this.counter=null,this.placeholder=null,this.listeners=[],this.layoutFrame=0,this.ownsFullscreen=!1,this.current=1,this.viewer=e,this.labels=t,this.fullscreen=n}get active(){return!!this.overlay}get slideNumber(){return this.current}get state(){return{active:this.active,slideNumber:this.current,total:this.viewer.slideCount}}async enter(e=this.current){var t;if(this.active||this.viewer.slideCount===0)return;let n=this.viewer.target.ownerDocument||document,r=n.createElement(`div`);r.className=`flyfish-pptx-presentation`,r.tabIndex=-1,r.setAttribute(`role`,`region`),r.setAttribute(`aria-label`,this.labels.hint||`Slideshow`);let i=n.createElement(`div`);i.className=`flyfish-pptx-presentation-stage`;let a=n.createElement(`div`);a.className=`flyfish-pptx-presentation-counter`;let o=n.createElement(`div`);o.className=`flyfish-pptx-presentation-hint`,o.textContent=this.labels.hint||``,o.hidden=!this.labels.hint;let s=n.createElement(`button`);if(s.type=`button`,s.className=`flyfish-pptx-presentation-exit`,s.textContent=`✕`,s.setAttribute(`aria-label`,this.labels.exit||`Exit slideshow`),s.addEventListener(`click`,e=>{e.stopPropagation(),this.exit()}),r.append(i,a,o,s),this.overlay=r,this.stage=i,this.counter=a,this.viewer.presentationRoot.appendChild(r),this.placeholder=n.createComment(`flyfish-pptx-presentation`),this.viewer.saveScrollPosition(),this.viewer.scaleBox.replaceWith(this.placeholder),i.appendChild(this.viewer.scaleBox),this.viewer.content.classList.add(`is-presenting`),this.attach(n,r),this.goTo(e),this.fullscreen)try{await r.requestFullscreen?.call(r),this.ownsFullscreen=this.isFullscreenElement(r)}catch{this.ownsFullscreen=!1}this.overlay===r?(r.focus({preventScroll:!0}),this.scheduleLayout(),this.notify()):(this.ownsFullscreen&&((t=n.exitFullscreen)==null||t.call(n).catch(()=>void 0)),this.ownsFullscreen=!1)}exit(){var e;let t=this.overlay;if(!t)return;let n=this.viewer.target.ownerDocument||document,r=this.ownsFullscreen&&this.isFullscreenElement(t);this.detach(),this.layoutFrame&&=((n.defaultView||window).cancelAnimationFrame(this.layoutFrame),0),this.viewer.content.classList.remove(`is-presenting`);for(let e of this.slideContainers())e.classList.remove(`is-active-slide`);this.placeholder?.parentNode?this.placeholder.replaceWith(this.viewer.scaleBox):this.viewer.target.appendChild(this.viewer.scaleBox),this.placeholder=null,t.remove(),this.overlay=null,this.stage=null,this.counter=null,r&&((e=n.exitFullscreen)==null||e.call(n).catch(()=>void 0)),this.ownsFullscreen=!1,this.viewer.restoreScrollPosition(),this.notify()}async toggle(e){this.active?this.exit():await this.enter(e)}goTo(e){let t=this.viewer.slideCount;if(t===0)return;this.current=He(Math.round(e)||1,1,t),this.viewer.ensureSlideRendered(this.current),this.viewer.ensureSlideRendered(this.current+1);let n=this.slideContainers(),r=n.some(e=>!!e.dataset.slideNumber);n.forEach((e,t)=>{let n=r?Number(e.dataset.slideNumber)===this.current:t===this.current-1;e.classList.toggle(`is-active-slide`,n)}),this.counter&&(this.counter.textContent=`${this.current} / ${t}`),this.active&&(this.scheduleLayout(),this.notify())}next(){this.current<this.viewer.slideCount&&this.goTo(this.current+1)}previous(){this.current>1&&this.goTo(this.current-1)}layout(){let e=this.overlay;if(!e)return;let t=this.slideContainers().find((e,t)=>e.dataset.slideNumber?Number(e.dataset.slideNumber)===this.current:t===this.current-1),n=t&&t.classList.contains(`flyfish-pptx-slide-slot`)?t.firstElementChild:t,r=this.viewer.slideDimensions,i=n?.offsetWidth||r?.width||0,a=n?.offsetHeight||r?.height||0;if(!i||!a)return;let o=e.clientWidth,s=e.clientHeight,c=Math.min(o/i,s/a),l=Math.max(0,(o-i*c)/2),u=Math.max(0,(s-a*c)/2),d=this.viewer.content;d.style.width=`${i}px`,d.style.transform=`translate(${l}px, ${u}px) scale(${c})`;let f=this.viewer.scaleBox;f.style.width=`100%`,f.style.height=`100%`,f.style.minHeight=``}destroy(){this.exit()}slots(){return Array.from(this.viewer.content.querySelectorAll(`:scope > .flyfish-pptx-slide-slot`))}slideContainers(){let e=this.slots();return e.length>0?e:Array.from(this.viewer.content.querySelectorAll(`:scope > .slide`))}isFullscreenElement(e){let t=this.viewer.target.ownerDocument||document;if(t.fullscreenElement===e)return!0;let n=e.getRootNode();return n!==t&&`fullscreenElement`in n&&n.fullscreenElement===e}scheduleLayout(){let e=this.viewer.target.ownerDocument.defaultView||window;this.layoutFrame&&e.cancelAnimationFrame(this.layoutFrame),this.layoutFrame=e.requestAnimationFrame(()=>{this.layoutFrame=0,this.layout()})}notify(){this.viewer.emitPresentationChange(this.state)}on(e,t,n){e.addEventListener(t,n),this.listeners.push({target:e,type:t,listener:n})}attach(e,t){let n=e.defaultView||window;this.on(e,`keydown`,e=>this.handleKey(e)),this.on(t,`click`,e=>this.handleClick(e)),this.on(t,`contextmenu`,e=>{e.preventDefault(),this.previous()}),this.on(n,`resize`,()=>this.scheduleLayout()),this.on(e,`fullscreenchange`,()=>{this.ownsFullscreen&&!this.isFullscreenElement(t)&&(this.ownsFullscreen=!1,this.exit())})}detach(){for(let{target:e,type:t,listener:n}of this.listeners)e.removeEventListener(t,n);this.listeners=[]}handleClick(e){let t=this.overlay;if(!t||e.target?.closest(`.flyfish-pptx-presentation-exit`))return;let n=t.getBoundingClientRect();(e.clientX-n.left)/(n.width||1)<.2?this.previous():this.next()}handleKey(e){if(!this.active||e.altKey||e.metaKey||e.ctrlKey)return;let t=e.target;if(!(t&&typeof t.closest==`function`&&t.closest(`button, a, input, textarea, select, [contenteditable="true"], [contenteditable=""]`))){if(t&&typeof t.closest==`function`){let e=t.closest(`.flyfish-pptx-presentation`);if(e&&e!==this.overlay)return}switch(e.key){case`ArrowRight`:case`ArrowDown`:case`PageDown`:case` `:case`Enter`:e.preventDefault(),this.next();break;case`ArrowLeft`:case`ArrowUp`:case`PageUp`:case`Backspace`:e.preventDefault(),this.previous();break;case`Home`:e.preventDefault(),this.goTo(1);break;case`End`:e.preventDefault(),this.goTo(this.viewer.slideCount);break;case`Escape`:e.preventDefault(),this.exit()}}}}})))()}var Ge,R,Ke,qe,Je,Ye,Xe,z,B,Ze,Qe,$e,et,tt;function nt(){return(nt=t((()=>{u(),Ge=`.flyfish-pptx-content`,R=/\s*(\._(?:css|svg_css|tbl_cell_css)_[A-Za-z0-9_-]+)\s*\{([^{}]*)\}/y,Ke=/* @__PURE__ */ new WeakMap,qe=e=>{let t=e.createDocumentFragment(),n=e.createElement(`section`);return n.className=`slide flyfish-pptx-slide-error`,n.textContent=`This slide could not be displayed safely.`,t.append(n),t},Je=e=>{let t=Ke.get(e);if(t)return t;let n=e.defaultView;if(!n)return null;let r=l(n);return r.isSupported?(Ke.set(e,r),r):null},Ye=e=>{let t=e.trim().replace(/^(?:"([\s\S]*)"|'([\s\S]*)')$/,`$1$2`).trim();return/^#[A-Za-z0-9_.:-]+$/.test(t)?!0:/^data:image\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+$/i.test(t)},Xe=(e,t)=>{let n=e.trim();return t&&/^#[A-Za-z0-9_.:-]+$/.test(n)||/^blob:/i.test(n)?!0:/^data:image\/[A-Za-z0-9.+-]+;base64,[A-Za-z0-9+/=\s]+$/i.test(n)},z=e=>{let t=e.replace(/\/\*[\s\S]*?\*\//g,``).trim();if(/(?:expression|image(?:-set)?|paint|var)\s*\(/i.test(t)||/(?:javascript|vbscript)\s*:/i.test(t)||/(?:^|[^-])behavior\s*:/i.test(t)||/-moz-binding/i.test(t)||t.includes(`\\`))return!1;let n=!1,r=t.replace(/url\(\s*([^)]*?)\s*\)/gi,(e,t)=>(Ye(t)||(n=!0),``));return!n&&!/url\s*\(/i.test(r)},B=(e,t)=>{let n=e.createElement(`span`);n.setAttribute(`style`,t);let r=n.style,i=Array.from({length:r.length},(e,t)=>r.item(t));for(let e of i){let t=r.getPropertyValue(e);(!e||e.startsWith(`--`)||e===`behavior`||e===`-moz-binding`||e===`position`&&/^(?:fixed|sticky)$/i.test(t.trim())||!z(t))&&r.removeProperty(e)}return r.cssText},Ze=(e,t)=>{t.querySelectorAll(`[style]`).forEach(t=>{let n=B(e,t.getAttribute(`style`)||``);n?t.setAttribute(`style`,n):t.removeAttribute(`style`)})},Qe=e=>{e.querySelectorAll(`[src],[srcset],[poster],[href],[xlink\\:href]`).forEach(e=>{for(let t of[`src`,`srcset`,`poster`,`href`,`xlink:href`]){if(!e.hasAttribute(t)||e.namespaceURI===`http://www.w3.org/1999/xhtml`&&e.localName===`a`&&t===`href`)continue;let n=e.namespaceURI===`http://www.w3.org/2000/svg`&&(t===`href`||t===`xlink:href`);Xe(e.getAttribute(t)||``,n)||e.removeAttribute(t)}})},$e=e=>{e.querySelectorAll(`svg, svg *`).forEach(e=>{for(let t of Array.from(e.attributes)){let n=t.value;/url\s*\(/i.test(n)&&!z(n)&&e.removeAttribute(t.name)}})},et=(e,t)=>{let n=[],r=0;for(;r<t.length&&t.slice(r).trim();){R.lastIndex=r;let i=R.exec(t);if(!i)return``;let a=B(e,i[2]);a&&n.push(`${Ge} ${i[1]}{${a}}`),r=R.lastIndex}return n.join(`
2
2
  `)},tt=(e,t)=>{let n=Je(e);if(!n)return qe(e);let r=n.sanitize(t,{RETURN_DOM_FRAGMENT:!0,USE_PROFILES:{html:!0,svg:!0,svgFilters:!0},ADD_ATTR:[`target`],FORBID_TAGS:[`script`,`style`,`iframe`,`object`,`embed`,`form`],FORBID_ATTR:[`srcdoc`]});return Ze(e,r),Qe(r),$e(r),r.querySelectorAll(`a[target]`).forEach(e=>{(e.getAttribute(`target`)||``).trim().toLowerCase()===`_blank`&&(e.rel=`noopener noreferrer`)}),r}})))()}var rt,it,at,ot,V,st;function ct(){return(ct=t((()=>{rt=`
3
3
  .slide{position:relative;border:0;border-radius:0;overflow:hidden;margin-bottom:50px;margin-left:auto;margin-right:auto;z-index:100}
4
4
  .slide div.block{position:absolute;top:0;left:0;width:100%;line-height:1}
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{t}from"./controls-bzoKYN3r.js";import{t as n}from"./typography-CRVG4mWv.js";import{i as r}from"./feedback-BfXgoa0c.js";import{n as i,t as a}from"./tabs-DcQoPXnM.js";import{_ as o,a as s,d as c,g as l,h as u,l as d,n as f,o as p,r as m,t as ee}from"./ConfigurableTable-99s2D6Oo.js";import{n as te,o as ne,r as re,t as ie}from"./search-filters-CnzOdZLe.js";import{n as h,t as g}from"./createLucideIcon-C5OSmeyR.js";import{c as ae,l as oe,s as _,t as se}from"./toolbar-controls-DsP_IMzf.js";import{n as v,t as ce}from"./circle-check-_4dDb5BE.js";import{n as le,t as ue}from"./circle-x-D6Z-Ao84.js";import{n as y,t as de}from"./layout-grid-Dojxc0Yp.js";import{n as b,t as fe}from"./list-DM-uRQCs.js";import{n as x,t as pe}from"./x-Cy9T0Gfj.js";import{n as me}from"./list-CqPepmX-.js";import{C as S,S as he,_ as ge,a as C,g as w,m as _e}from"./ui-B2vRXZUo.js";import{n as T,t as ve}from"./ResponsiveTableActions-CZYzbN58.js";import{r as ye,t as be}from"./deleteAction-B_E1jPob.js";import{n as xe}from"./listTableProps-Dgysmp29.js";import{n as Se,r as Ce}from"./clipboard-Cc2mRkhL.js";import{a as we,i as Te,n as Ee,r as De,t as Oe}from"./file-utils-Buv1r1rr.js";import{n as E,t as ke}from"./AppModal-D7N3dWkx.js";import{c as Ae,d as D,f as je,i as Me,l as O,n as k,o as Ne,p as Pe,r as Fe,s as Ie,t as Le,u as Re}from"./FileNameCell-y0GBeT7U.js";import{Ar as A,At as ze,C as j,Ct as M,D as N,Dt as P,E as Be,Et as Ve,I as He,It as F,L as I,Lt as L,Mt as Ue,Nt as We,Ot as Ge,S as R,St as z,T as Ke,Tt as qe,_ as Je,_t as Ye,b as Xe,bt as Ze,c as Qe,fi as $e,gt as et,ht as tt,i as nt,ir as rt,jr as B,jt as it,kt as at,m as V,n as ot,ni as st,o as ct,pi as lt,r as ut,ri as dt,rr as ft,t as H,vt as pt,w as mt,wt as ht,x as gt,xt as _t,yt as vt}from"./StatCard-BnpVf2qC.js";import{Hn as yt}from"./chart-data-DR6hkaAO.js";import{n as bt,t as xt}from"./line-B8QjYlU3.js";import{useEffect as St,useMemo as U,useRef as Ct,useState as W}from"react";import{Fragment as wt,jsx as G,jsxs as K}from"react/jsx-runtime";import{usePreferences as Tt}from"@fudanda/admin-antd/core/hooks/usePreferences";import{formatBytes as q}from"@fudanda/client/core";import{goTransport as Et}from"@fudanda/admin-antd/core/lib/go-transport";import{usePermission as Dt}from"@fudanda/admin-antd/core/hooks/usePermission";import{useFilterQuery as Ot}from"@fudanda/admin-antd/core/hooks/useFilterQuery";import{useListSearch as kt}from"@fudanda/admin-antd/core/hooks/useListSearch";import{formatDateTimeRangeValuesForApi as At}from"@fudanda/admin-antd/core/utils/date";import{usePagination as jt}from"@fudanda/admin-antd/core/hooks/usePagination";import{useQueryClient as Mt}from"@tanstack/react-query";import{downloadBlob as Nt}from"@fudanda/admin-antd/core/utils/download";import{useUrlTabState as Pt}from"@fudanda/admin-antd/core/hooks/useUrlTabState";import{FILE_STORAGE_PROVIDER_LABELS as Ft,FILE_STORAGE_PROVIDER_OPTIONS as It,FILE_TYPE_FILTER_OPTIONS as Lt}from"@fudanda/client/platform";import{fileKeys as Rt,invalidateAfterFilesAdded as zt,useChunkUploadThreshold as Bt,useDeleteFiles as Vt,useFileDetail as Ht,useFileList as Ut,useFileStats as Wt,useUploadFile as Gt}from"@fudanda/admin-antd/core/hooks/queries/files";import{useDefaultFileStorageConfig as Kt}from"@fudanda/admin-antd/core/hooks/queries/file-storage-configs";import{filesBatchDownload as qt,filesList as Jt}from"@fudanda/client/api/files";import{CHUNKED_UPLOAD_CANCELLED as Yt,chunkedUpload as Xt}from"@fudanda/admin-antd/core/utils/chunked-upload";var Zt,Qt;function $t(){return($t=e((()=>{
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{t}from"./controls-bzoKYN3r.js";import{t as n}from"./typography-CRVG4mWv.js";import{i as r}from"./feedback-BfXgoa0c.js";import{n as i,t as a}from"./tabs-DcQoPXnM.js";import{_ as o,a as s,d as c,g as l,h as u,l as d,n as f,o as p,r as m,t as ee}from"./ConfigurableTable-99s2D6Oo.js";import{n as te,o as ne,r as re,t as ie}from"./search-filters-CnzOdZLe.js";import{n as h,t as g}from"./createLucideIcon-C5OSmeyR.js";import{c as ae,l as oe,s as _,t as se}from"./toolbar-controls-DsP_IMzf.js";import{n as v,t as ce}from"./circle-check-_4dDb5BE.js";import{n as le,t as ue}from"./circle-x-D6Z-Ao84.js";import{n as y,t as de}from"./layout-grid-Dojxc0Yp.js";import{n as b,t as fe}from"./list-DM-uRQCs.js";import{n as x,t as pe}from"./x-Cy9T0Gfj.js";import{n as me}from"./list-CqPepmX-.js";import{C as S,S as he,_ as ge,a as C,g as w,m as _e}from"./ui-B2vRXZUo.js";import{n as T,t as ve}from"./ResponsiveTableActions-CZYzbN58.js";import{r as ye,t as be}from"./deleteAction-B_E1jPob.js";import{n as xe}from"./listTableProps-Dgysmp29.js";import{n as Se,r as Ce}from"./clipboard-Cc2mRkhL.js";import{a as we,i as Te,n as Ee,r as De,t as Oe}from"./file-utils-Buv1r1rr.js";import{n as E,t as ke}from"./AppModal-D7N3dWkx.js";import{c as Ae,d as D,f as je,i as Me,l as O,n as k,o as Ne,p as Pe,r as Fe,s as Ie,t as Le,u as Re}from"./FileNameCell-3SmT42SA.js";import{Ar as A,At as ze,C as j,Ct as M,D as N,Dt as P,E as Be,Et as Ve,I as He,It as F,L as I,Lt as L,Mt as Ue,Nt as We,Ot as Ge,S as R,St as z,T as Ke,Tt as qe,_ as Je,_t as Ye,b as Xe,bt as Ze,c as Qe,fi as $e,gt as et,ht as tt,i as nt,ir as rt,jr as B,jt as it,kt as at,m as V,n as ot,ni as st,o as ct,pi as lt,r as ut,ri as dt,rr as ft,t as H,vt as pt,w as mt,wt as ht,x as gt,xt as _t,yt as vt}from"./StatCard-BnpVf2qC.js";import{Hn as yt}from"./chart-data-DR6hkaAO.js";import{n as bt,t as xt}from"./line-B8QjYlU3.js";import{useEffect as St,useMemo as U,useRef as Ct,useState as W}from"react";import{Fragment as wt,jsx as G,jsxs as K}from"react/jsx-runtime";import{usePreferences as Tt}from"@fudanda/admin-antd/core/hooks/usePreferences";import{formatBytes as q}from"@fudanda/client/core";import{goTransport as Et}from"@fudanda/admin-antd/core/lib/go-transport";import{usePermission as Dt}from"@fudanda/admin-antd/core/hooks/usePermission";import{useFilterQuery as Ot}from"@fudanda/admin-antd/core/hooks/useFilterQuery";import{useListSearch as kt}from"@fudanda/admin-antd/core/hooks/useListSearch";import{formatDateTimeRangeValuesForApi as At}from"@fudanda/admin-antd/core/utils/date";import{usePagination as jt}from"@fudanda/admin-antd/core/hooks/usePagination";import{useQueryClient as Mt}from"@tanstack/react-query";import{downloadBlob as Nt}from"@fudanda/admin-antd/core/utils/download";import{useUrlTabState as Pt}from"@fudanda/admin-antd/core/hooks/useUrlTabState";import{FILE_STORAGE_PROVIDER_LABELS as Ft,FILE_STORAGE_PROVIDER_OPTIONS as It,FILE_TYPE_FILTER_OPTIONS as Lt}from"@fudanda/client/platform";import{fileKeys as Rt,invalidateAfterFilesAdded as zt,useChunkUploadThreshold as Bt,useDeleteFiles as Vt,useFileDetail as Ht,useFileList as Ut,useFileStats as Wt,useUploadFile as Gt}from"@fudanda/admin-antd/core/hooks/queries/files";import{useDefaultFileStorageConfig as Kt}from"@fudanda/admin-antd/core/hooks/queries/file-storage-configs";import{filesBatchDownload as qt,filesList as Jt}from"@fudanda/client/api/files";import{CHUNKED_UPLOAD_CANCELLED as Yt,chunkedUpload as Xt}from"@fudanda/admin-antd/core/utils/chunked-upload";var Zt,Qt;function $t(){return($t=e((()=>{
2
2
  /**
3
3
  * @license lucide-react v1.53.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{i as t,o as n}from"../src-DXdeqJtP.js";import{a as r,i,n as a,o,r as s,s as c}from"./controls-bzoKYN3r.js";import{n as l,t as u}from"./createLucideIcon-C5OSmeyR.js";import{i as d,n as f,r as p,t as m}from"./menu-8WYIdKA2.js";import{i as h,n as g,r as ee,t as te}from"./chevron-right-qLlse2z0.js";import{n as _,t as v}from"./info-kC0nipUB.js";import{C as y,S as b,a as x,p as S,s as C}from"./ui-B2vRXZUo.js";import{n as w,t as T}from"./ScrollArea-D36AQ-H2.js";import{c as ne,l as re,n as E,o as ie,s as ae,t as D}from"./SettingRow-CBYEEgy6.js";import{useCallback as O,useEffect as oe,useRef as se,useState as ce}from"react";import{Fragment as k,jsx as A,jsxs as j}from"react/jsx-runtime";import{DARK_SURFACE_TONE_OPTIONS as le,FONT_FAMILY_OPTIONS as ue,LOADING_STYLE_OPTIONS as M,UI_SCALE_OPTIONS as de,isScheduleTime as fe,usePreferences as pe}from"@fudanda/admin-antd/core/hooks/usePreferences";import{Button as me,Empty as N}from"antd";import{THEME_COLOR_PRESETS as he}from"@fudanda/admin-antd/core/lib/theme-color";import{textMatches as P}from"@fudanda/admin-antd/core/utils/pinyin";import{preferenceDefinitionMap as ge,preferenceDefinitions as _e,preferenceOverridesSchema as ve}from"@fudanda/client/preferences";import{clearAllListFilterSnapshots as ye}from"@fudanda/admin-antd/core/lib/list-filter-memory";var F,I;function L(){return(L=e((()=>{
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{i as t,o as n}from"../src-CeFrSNPb.js";import{a as r,i,n as a,o,r as s,s as c}from"./controls-bzoKYN3r.js";import{n as l,t as u}from"./createLucideIcon-C5OSmeyR.js";import{i as d,n as f,r as p,t as m}from"./menu-8WYIdKA2.js";import{i as h,n as g,r as ee,t as te}from"./chevron-right-qLlse2z0.js";import{n as _,t as v}from"./info-kC0nipUB.js";import{C as y,S as b,a as x,p as S,s as C}from"./ui-B2vRXZUo.js";import{n as w,t as T}from"./ScrollArea-D36AQ-H2.js";import{c as ne,l as re,n as E,o as ie,s as ae,t as D}from"./SettingRow-CBYEEgy6.js";import{useCallback as O,useEffect as oe,useRef as se,useState as ce}from"react";import{Fragment as k,jsx as A,jsxs as j}from"react/jsx-runtime";import{DARK_SURFACE_TONE_OPTIONS as le,FONT_FAMILY_OPTIONS as ue,LOADING_STYLE_OPTIONS as M,UI_SCALE_OPTIONS as de,isScheduleTime as fe,usePreferences as pe}from"@fudanda/admin-antd/core/hooks/usePreferences";import{Button as me,Empty as N}from"antd";import{THEME_COLOR_PRESETS as he}from"@fudanda/admin-antd/core/lib/theme-color";import{textMatches as P}from"@fudanda/admin-antd/core/utils/pinyin";import{preferenceDefinitionMap as ge,preferenceDefinitions as _e,preferenceOverridesSchema as ve}from"@fudanda/client/preferences";import{clearAllListFilterSnapshots as ye}from"@fudanda/admin-antd/core/lib/list-filter-memory";var F,I;function L(){return(L=e((()=>{
2
2
  /**
3
3
  * @license lucide-react v1.53.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./controls-bzoKYN3r.js";import{t as r}from"./typography-CRVG4mWv.js";import{i,n as a}from"./feedback-BfXgoa0c.js";import{n as o}from"./tabs-DcQoPXnM.js";import{a as s,i as c,n as l,o as u,t as ee}from"./ConfigurableTable-99s2D6Oo.js";import{n as d,t as f}from"./createLucideIcon-C5OSmeyR.js";import{c as te,l as p}from"./toolbar-controls-DsP_IMzf.js";import{a as m,c as ne,i as re,l as h,n as ie,o as ae,r as g,s as _,t as oe}from"./UserLogsPanels-avjOQTTV.js";import{n as v,t as se}from"./copy-b6jxljaK.js";import{a as y,i as b,o as ce,r as x,s as S,t as C}from"./SessionClientTag-CEmgKH_p.js";import{n as le,t as ue}from"./list-DM-uRQCs.js";import{i as w,n as T,r as de,t as fe}from"./user-round-D08nSPFl.js";import{o as E,t as D}from"./form-CNk_tjQY.js";import{n as O}from"./list-CqPepmX-.js";import{C as k,_ as A,a as j,c as pe,g as M,l as me,r as N,y as P}from"./ui-B2vRXZUo.js";import{i as F,t as he}from"./confirm-CpM2HLx_.js";import{r as ge,t as _e}from"./deleteAction-B_E1jPob.js";import{n as ve,t as I}from"./useCrudOperationColumn-DPH7ct5h.js";import{n as ye}from"./listTableProps-Dgysmp29.js";import{n as be,t as L}from"./DateTimeText-2wbw50Ix.js";import{a as xe,o as Se,r as Ce,t as we}from"./EditFormModal-DnbfZLjs.js";import{r as Te,t as Ee}from"./clipboard-Cc2mRkhL.js";import{n as R,t as De}from"./UserAvatar-N_67vm9d.js";import{n as Oe,t as z}from"./PasswordInput-BmDdyOQ4.js";import{n as ke,t as Ae}from"./DictTag-Bz-emCz0.js";import{useState as B}from"react";import{Fragment as je,jsx as V,jsxs as H}from"react/jsx-runtime";import{abortSubmit as Me}from"@fudanda/admin-antd/core/lib/abort-submit";import{useDictItems as Ne}from"@fudanda/admin-antd/core/hooks/useDictItems";import{formatDateForApi as Pe,formatDateTime as Fe}from"@fudanda/admin-antd/core/utils/date";import{TOKEN_PERMISSION_KIND_LABELS as U,tokenPermissionGroups as W,tokenPermissionPreset as G,tokenPermissionPreview as Ie,useApiKeyPermissions as Le,useApiTokenDetail as Re,useApiTokenSecret as ze,useChangeProfilePassword as Be,useDeleteApiToken as Ve,useKickOtherProfileSessions as He,useKickProfileSession as Ue,useProfileApiTokens as We,useProfileSessions as Ge,useSaveApiToken as Ke,useUpdateProfile as qe}from"@fudanda/admin-antd/core/hooks/queries/profile";import{uploadAvatarBlobToFileCenter as Je}from"@fudanda/admin-antd/core/utils/avatar-upload";import{formatSessionPolicyHint as Ye}from"@fudanda/client/settings";import{useMySettings as Xe}from"@fudanda/admin-antd/core/hooks/queries/settings";import{useUrlTabState as Ze}from"@fudanda/admin-antd/core/hooks/useUrlTabState";var K,Qe;function q(){return(q=e((()=>{
1
+ import{n as e}from"./rolldown-runtime-pDENg-lZ.js";import{n as t,t as n}from"./controls-bzoKYN3r.js";import{t as r}from"./typography-CRVG4mWv.js";import{i,n as a}from"./feedback-BfXgoa0c.js";import{n as o}from"./tabs-DcQoPXnM.js";import{a as s,i as c,n as l,o as u,t as ee}from"./ConfigurableTable-99s2D6Oo.js";import{n as d,t as f}from"./createLucideIcon-C5OSmeyR.js";import{c as te,l as p}from"./toolbar-controls-DsP_IMzf.js";import{a as m,c as ne,i as re,l as h,n as ie,o as ae,r as g,s as _,t as oe}from"./UserLogsPanels-D4yH_I6c.js";import{n as v,t as se}from"./copy-b6jxljaK.js";import{a as y,i as b,o as ce,r as x,s as S,t as C}from"./SessionClientTag-CEmgKH_p.js";import{n as le,t as ue}from"./list-DM-uRQCs.js";import{i as w,n as T,r as de,t as fe}from"./user-round-D08nSPFl.js";import{o as E,t as D}from"./form-CNk_tjQY.js";import{n as O}from"./list-CqPepmX-.js";import{C as k,_ as A,a as j,c as pe,g as M,l as me,r as N,y as P}from"./ui-B2vRXZUo.js";import{i as F,t as he}from"./confirm-CpM2HLx_.js";import{r as ge,t as _e}from"./deleteAction-B_E1jPob.js";import{n as ve,t as I}from"./useCrudOperationColumn-DPH7ct5h.js";import{n as ye}from"./listTableProps-Dgysmp29.js";import{n as be,t as L}from"./DateTimeText-2wbw50Ix.js";import{a as xe,o as Se,r as Ce,t as we}from"./EditFormModal-DnbfZLjs.js";import{r as Te,t as Ee}from"./clipboard-Cc2mRkhL.js";import{n as R,t as De}from"./UserAvatar-N_67vm9d.js";import{n as Oe,t as z}from"./PasswordInput-BmDdyOQ4.js";import{n as ke,t as Ae}from"./DictTag-Bz-emCz0.js";import{useState as B}from"react";import{Fragment as je,jsx as V,jsxs as H}from"react/jsx-runtime";import{abortSubmit as Me}from"@fudanda/admin-antd/core/lib/abort-submit";import{useDictItems as Ne}from"@fudanda/admin-antd/core/hooks/useDictItems";import{formatDateForApi as Pe,formatDateTime as Fe}from"@fudanda/admin-antd/core/utils/date";import{TOKEN_PERMISSION_KIND_LABELS as U,tokenPermissionGroups as W,tokenPermissionPreset as G,tokenPermissionPreview as Ie,useApiKeyPermissions as Le,useApiTokenDetail as Re,useApiTokenSecret as ze,useChangeProfilePassword as Be,useDeleteApiToken as Ve,useKickOtherProfileSessions as He,useKickProfileSession as Ue,useProfileApiTokens as We,useProfileSessions as Ge,useSaveApiToken as Ke,useUpdateProfile as qe}from"@fudanda/admin-antd/core/hooks/queries/profile";import{uploadAvatarBlobToFileCenter as Je}from"@fudanda/admin-antd/core/utils/avatar-upload";import{formatSessionPolicyHint as Ye}from"@fudanda/client/settings";import{useMySettings as Xe}from"@fudanda/admin-antd/core/hooks/queries/settings";import{useUrlTabState as Ze}from"@fudanda/admin-antd/core/hooks/useUrlTabState";var K,Qe;function q(){return(q=e((()=>{
2
2
  /**
3
3
  * @license lucide-react v1.53.0 - ISC
4
4
  *