@ug666/ui-react 0.3.0-beta.2 → 0.3.0-beta.4

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 (279) hide show
  1. package/LICENSE +21 -0
  2. package/dist/RELEASE_PROVENANCE.json +8 -0
  3. package/dist/ai/SKILL.md +245 -0
  4. package/dist/ai/manifest.json +819 -0
  5. package/dist/ai/references/components/accordion.md +41 -0
  6. package/dist/ai/references/components/admin-shell.md +27 -0
  7. package/dist/ai/references/components/alert.md +40 -0
  8. package/dist/ai/references/components/app-tabs.md +27 -0
  9. package/dist/ai/references/components/attachment-list.md +27 -0
  10. package/dist/ai/references/components/autocomplete.md +41 -0
  11. package/dist/ai/references/components/avatar-group.md +39 -0
  12. package/dist/ai/references/components/avatar.md +39 -0
  13. package/dist/ai/references/components/backtop.md +40 -0
  14. package/dist/ai/references/components/badge.md +43 -0
  15. package/dist/ai/references/components/bar-chart.md +41 -0
  16. package/dist/ai/references/components/breadcrumb.md +41 -0
  17. package/dist/ai/references/components/button.md +39 -0
  18. package/dist/ai/references/components/calendar.md +42 -0
  19. package/dist/ai/references/components/card.md +39 -0
  20. package/dist/ai/references/components/carousel.md +41 -0
  21. package/dist/ai/references/components/cascader.md +43 -0
  22. package/dist/ai/references/components/checkbox.md +40 -0
  23. package/dist/ai/references/components/collapse.md +41 -0
  24. package/dist/ai/references/components/color-picker.md +42 -0
  25. package/dist/ai/references/components/config-provider.md +39 -0
  26. package/dist/ai/references/components/confirm-dialog.md +27 -0
  27. package/dist/ai/references/components/container.md +39 -0
  28. package/dist/ai/references/components/context-menu.md +40 -0
  29. package/dist/ai/references/components/conversation-list.md +27 -0
  30. package/dist/ai/references/components/copy-field.md +27 -0
  31. package/dist/ai/references/components/data-panel.md +43 -0
  32. package/dist/ai/references/components/data-table-identity.md +27 -0
  33. package/dist/ai/references/components/data-table-toolbar.md +27 -0
  34. package/dist/ai/references/components/data-table.md +32 -0
  35. package/dist/ai/references/components/date-picker.md +42 -0
  36. package/dist/ai/references/components/date-range-picker.md +43 -0
  37. package/dist/ai/references/components/date-time-picker.md +40 -0
  38. package/dist/ai/references/components/descriptions.md +40 -0
  39. package/dist/ai/references/components/dialog.md +40 -0
  40. package/dist/ai/references/components/dock.md +41 -0
  41. package/dist/ai/references/components/donut-chart.md +41 -0
  42. package/dist/ai/references/components/drawer.md +41 -0
  43. package/dist/ai/references/components/dropdown.md +42 -0
  44. package/dist/ai/references/components/empty-state.md +40 -0
  45. package/dist/ai/references/components/fab.md +41 -0
  46. package/dist/ai/references/components/feature-grid.md +27 -0
  47. package/dist/ai/references/components/fieldset.md +41 -0
  48. package/dist/ai/references/components/file-input.md +41 -0
  49. package/dist/ai/references/components/form.md +42 -0
  50. package/dist/ai/references/components/gauge-chart.md +41 -0
  51. package/dist/ai/references/components/heatmap-chart.md +41 -0
  52. package/dist/ai/references/components/icon.md +39 -0
  53. package/dist/ai/references/components/image.md +41 -0
  54. package/dist/ai/references/components/index.md +171 -0
  55. package/dist/ai/references/components/indicator.md +41 -0
  56. package/dist/ai/references/components/infinite-scroll.md +42 -0
  57. package/dist/ai/references/components/input.md +42 -0
  58. package/dist/ai/references/components/join.md +40 -0
  59. package/dist/ai/references/components/kbd.md +40 -0
  60. package/dist/ai/references/components/label.md +39 -0
  61. package/dist/ai/references/components/landing-hero.md +27 -0
  62. package/dist/ai/references/components/layout.md +39 -0
  63. package/dist/ai/references/components/link.md +41 -0
  64. package/dist/ai/references/components/list.md +41 -0
  65. package/dist/ai/references/components/loading.md +40 -0
  66. package/dist/ai/references/components/message.md +27 -0
  67. package/dist/ai/references/components/modal.md +42 -0
  68. package/dist/ai/references/components/navbar.md +41 -0
  69. package/dist/ai/references/components/navigation-menu.md +41 -0
  70. package/dist/ai/references/components/notification.md +41 -0
  71. package/dist/ai/references/components/number-input.md +40 -0
  72. package/dist/ai/references/components/otp-input.md +40 -0
  73. package/dist/ai/references/components/page-header.md +27 -0
  74. package/dist/ai/references/components/pagination.md +42 -0
  75. package/dist/ai/references/components/popconfirm.md +42 -0
  76. package/dist/ai/references/components/popover.md +41 -0
  77. package/dist/ai/references/components/progress.md +41 -0
  78. package/dist/ai/references/components/prompt-composer.md +27 -0
  79. package/dist/ai/references/components/quick-access.md +30 -0
  80. package/dist/ai/references/components/radar-chart.md +41 -0
  81. package/dist/ai/references/components/radial-progress.md +41 -0
  82. package/dist/ai/references/components/radio.md +40 -0
  83. package/dist/ai/references/components/ranking-list.md +41 -0
  84. package/dist/ai/references/components/rating.md +42 -0
  85. package/dist/ai/references/components/result.md +40 -0
  86. package/dist/ai/references/components/scrollbar.md +39 -0
  87. package/dist/ai/references/components/select.md +41 -0
  88. package/dist/ai/references/components/selection-list.md +29 -0
  89. package/dist/ai/references/components/separator.md +39 -0
  90. package/dist/ai/references/components/sheet.md +40 -0
  91. package/dist/ai/references/components/sidebar.md +46 -0
  92. package/dist/ai/references/components/skeleton.md +40 -0
  93. package/dist/ai/references/components/slider.md +40 -0
  94. package/dist/ai/references/components/space.md +39 -0
  95. package/dist/ai/references/components/spinner.md +41 -0
  96. package/dist/ai/references/components/splitter.md +39 -0
  97. package/dist/ai/references/components/stack.md +41 -0
  98. package/dist/ai/references/components/stacked-bar-chart.md +41 -0
  99. package/dist/ai/references/components/statistic-card.md +41 -0
  100. package/dist/ai/references/components/statistic.md +41 -0
  101. package/dist/ai/references/components/steps.md +40 -0
  102. package/dist/ai/references/components/switch.md +40 -0
  103. package/dist/ai/references/components/table.md +41 -0
  104. package/dist/ai/references/components/tabs.md +41 -0
  105. package/dist/ai/references/components/tag.md +39 -0
  106. package/dist/ai/references/components/text.md +39 -0
  107. package/dist/ai/references/components/textarea.md +40 -0
  108. package/dist/ai/references/components/theme-configurator-dialog.md +27 -0
  109. package/dist/ai/references/components/theme-configurator.md +27 -0
  110. package/dist/ai/references/components/theme-controller.md +41 -0
  111. package/dist/ai/references/components/time-picker.md +42 -0
  112. package/dist/ai/references/components/time-range-picker.md +41 -0
  113. package/dist/ai/references/components/time-select.md +40 -0
  114. package/dist/ai/references/components/timeline.md +41 -0
  115. package/dist/ai/references/components/toast.md +39 -0
  116. package/dist/ai/references/components/tooltip.md +39 -0
  117. package/dist/ai/references/components/transfer.md +41 -0
  118. package/dist/ai/references/components/tree-select.md +45 -0
  119. package/dist/ai/references/components/tree-table.md +27 -0
  120. package/dist/ai/references/components/tree.md +43 -0
  121. package/dist/ai/references/components/trend-chart.md +41 -0
  122. package/dist/ai/references/components/upload.md +43 -0
  123. package/dist/ai/references/components.md +97 -0
  124. package/dist/ai/references/examples/data-table.md +50 -0
  125. package/dist/ai/references/release.md +159 -0
  126. package/dist/ai/ui-react.zip +0 -0
  127. package/dist/blocks/index.cjs +1 -1
  128. package/dist/blocks/index.js +1 -1
  129. package/dist/{chunk-NRCPYVJW.js → chunk-36XR4DWY.js} +1 -1
  130. package/dist/chunk-36XR4DWY.js.map +1 -0
  131. package/dist/chunk-3G4F4FBP.js +1 -0
  132. package/dist/chunk-3G4F4FBP.js.map +1 -0
  133. package/dist/chunk-6CAP3PTC.cjs +1 -0
  134. package/dist/chunk-6CAP3PTC.cjs.map +1 -0
  135. package/dist/chunk-EZEVLBUH.cjs +1 -0
  136. package/dist/chunk-EZEVLBUH.cjs.map +1 -0
  137. package/dist/chunk-G7UYIR6Z.js +1 -0
  138. package/dist/chunk-G7UYIR6Z.js.map +1 -0
  139. package/dist/chunk-JJA2B3JL.cjs +1 -0
  140. package/dist/chunk-JJA2B3JL.cjs.map +1 -0
  141. package/dist/chunk-LNVPMWCL.cjs +1 -0
  142. package/dist/chunk-LNVPMWCL.cjs.map +1 -0
  143. package/dist/chunk-NIQAVPSL.js +1 -0
  144. package/dist/chunk-NIQAVPSL.js.map +1 -0
  145. package/dist/chunk-PGJ5O3CM.cjs +1 -0
  146. package/dist/chunk-PGJ5O3CM.cjs.map +1 -0
  147. package/dist/chunk-RLPW73WX.js +1 -0
  148. package/dist/chunk-RLPW73WX.js.map +1 -0
  149. package/dist/chunk-RZSNVJZO.cjs +1 -0
  150. package/dist/chunk-RZSNVJZO.cjs.map +1 -0
  151. package/dist/chunk-Z4MRC4LZ.js +1 -0
  152. package/dist/chunk-Z4MRC4LZ.js.map +1 -0
  153. package/dist/components/alert.d.ts +4 -5
  154. package/dist/components/alert.d.ts.map +1 -1
  155. package/dist/components/avatar.d.ts +4 -5
  156. package/dist/components/avatar.d.ts.map +1 -1
  157. package/dist/components/badge.d.ts +5 -2
  158. package/dist/components/badge.d.ts.map +1 -1
  159. package/dist/components/button.d.ts +10 -5
  160. package/dist/components/button.d.ts.map +1 -1
  161. package/dist/components/checkbox.d.ts +4 -2
  162. package/dist/components/checkbox.d.ts.map +1 -1
  163. package/dist/components/date-picker.d.ts +1 -1
  164. package/dist/components/date-picker.d.ts.map +1 -1
  165. package/dist/components/date-time-picker.d.ts +2 -2
  166. package/dist/components/date-time-picker.d.ts.map +1 -1
  167. package/dist/components/dialog.d.ts.map +1 -1
  168. package/dist/components/drawer.d.ts.map +1 -1
  169. package/dist/components/index.cjs +1 -1
  170. package/dist/components/index.cjs.map +1 -1
  171. package/dist/components/index.js +1 -1
  172. package/dist/components/input.d.ts +2 -0
  173. package/dist/components/input.d.ts.map +1 -1
  174. package/dist/components/number-input.d.ts +4 -2
  175. package/dist/components/number-input.d.ts.map +1 -1
  176. package/dist/components/radio.d.ts +4 -6
  177. package/dist/components/radio.d.ts.map +1 -1
  178. package/dist/components/select.d.ts +4 -0
  179. package/dist/components/select.d.ts.map +1 -1
  180. package/dist/components/sidebar.d.ts +17 -8
  181. package/dist/components/sidebar.d.ts.map +1 -1
  182. package/dist/components/skeleton.d.ts +4 -5
  183. package/dist/components/skeleton.d.ts.map +1 -1
  184. package/dist/components/spinner.d.ts +5 -6
  185. package/dist/components/spinner.d.ts.map +1 -1
  186. package/dist/components/switch.d.ts +2 -0
  187. package/dist/components/switch.d.ts.map +1 -1
  188. package/dist/components/tag.d.ts +5 -2
  189. package/dist/components/tag.d.ts.map +1 -1
  190. package/dist/components/time-picker.d.ts +1 -1
  191. package/dist/components/time-picker.d.ts.map +1 -1
  192. package/dist/essentials.cjs +1 -0
  193. package/dist/essentials.cjs.map +1 -0
  194. package/dist/essentials.css +2 -0
  195. package/dist/essentials.d.ts +9 -0
  196. package/dist/essentials.d.ts.map +1 -0
  197. package/dist/essentials.js +1 -0
  198. package/dist/essentials.js.map +1 -0
  199. package/dist/index.cjs +1 -1
  200. package/dist/index.cjs.map +1 -1
  201. package/dist/index.js +1 -1
  202. package/dist/internal/data-table-header.d.ts.map +1 -1
  203. package/dist/internal/date-time/date-mode-panel.d.ts.map +1 -0
  204. package/dist/internal/{date-time-control.d.ts → date-time/date-time-control.d.ts} +1 -1
  205. package/dist/internal/date-time/date-time-control.d.ts.map +1 -0
  206. package/dist/internal/date-time/date-time-range-control.d.ts.map +1 -0
  207. package/dist/internal/date-time/time-panel.d.ts.map +1 -0
  208. package/dist/internal/{admin-horizontal-navigation.d.ts → navigation/admin-horizontal-navigation.d.ts} +1 -1
  209. package/dist/internal/navigation/admin-horizontal-navigation.d.ts.map +1 -0
  210. package/dist/internal/navigation/sidebar-navigation.d.ts.map +1 -0
  211. package/dist/internal/overlay/use-floating-layout-observer.d.ts.map +1 -0
  212. package/dist/internal/overlay/use-overlay-focus.d.ts.map +1 -0
  213. package/dist/internal/overlay/use-portal-container.d.ts.map +1 -0
  214. package/dist/internal/overlay/use-presence.d.ts.map +1 -0
  215. package/dist/internal/selection/option-window.d.ts.map +1 -0
  216. package/dist/internal/{use-cascader-lazy.d.ts → selection/use-cascader-lazy.d.ts} +1 -1
  217. package/dist/internal/selection/use-cascader-lazy.d.ts.map +1 -0
  218. package/dist/internal/{use-transfer-remote.d.ts → selection/use-transfer-remote.d.ts} +1 -1
  219. package/dist/internal/selection/use-transfer-remote.d.ts.map +1 -0
  220. package/dist/internal/{use-tree-data.d.ts → selection/use-tree-data.d.ts} +1 -1
  221. package/dist/internal/selection/use-tree-data.d.ts.map +1 -0
  222. package/dist/patterns/admin-shell.d.ts +4 -0
  223. package/dist/patterns/admin-shell.d.ts.map +1 -1
  224. package/dist/patterns/data-table.d.ts +18 -7
  225. package/dist/patterns/data-table.d.ts.map +1 -1
  226. package/dist/patterns/index.cjs +1 -1
  227. package/dist/patterns/index.cjs.map +1 -1
  228. package/dist/patterns/index.js +1 -1
  229. package/dist/patterns/index.js.map +1 -1
  230. package/dist/patterns/page-header.d.ts +4 -0
  231. package/dist/patterns/page-header.d.ts.map +1 -1
  232. package/dist/primitives/index.cjs +1 -1
  233. package/dist/primitives/index.js +1 -1
  234. package/dist/styles.css +1 -1
  235. package/dist/themes/dense.css +1 -0
  236. package/dist/tokens.css +1 -1
  237. package/package.json +18 -5
  238. package/dist/chunk-J4NAYP4L.cjs +0 -1
  239. package/dist/chunk-J4NAYP4L.cjs.map +0 -1
  240. package/dist/chunk-JY5S7YLF.cjs +0 -1
  241. package/dist/chunk-JY5S7YLF.cjs.map +0 -1
  242. package/dist/chunk-NRCPYVJW.js.map +0 -1
  243. package/dist/chunk-PXVCZ6AZ.js +0 -1
  244. package/dist/chunk-PXVCZ6AZ.js.map +0 -1
  245. package/dist/chunk-UBZ2ZCEJ.cjs +0 -1
  246. package/dist/chunk-UBZ2ZCEJ.cjs.map +0 -1
  247. package/dist/chunk-UEJM2SLH.js +0 -1
  248. package/dist/chunk-UEJM2SLH.js.map +0 -1
  249. package/dist/chunk-UESSLLSC.js +0 -1
  250. package/dist/chunk-UESSLLSC.js.map +0 -1
  251. package/dist/chunk-VDBATAZ3.js +0 -1
  252. package/dist/chunk-VDBATAZ3.js.map +0 -1
  253. package/dist/chunk-XVFRKGM7.cjs +0 -1
  254. package/dist/chunk-XVFRKGM7.cjs.map +0 -1
  255. package/dist/chunk-ZDO5A2IZ.cjs +0 -1
  256. package/dist/chunk-ZDO5A2IZ.cjs.map +0 -1
  257. package/dist/internal/admin-horizontal-navigation.d.ts.map +0 -1
  258. package/dist/internal/date-mode-panel.d.ts.map +0 -1
  259. package/dist/internal/date-time-control.d.ts.map +0 -1
  260. package/dist/internal/date-time-range-control.d.ts.map +0 -1
  261. package/dist/internal/option-window.d.ts.map +0 -1
  262. package/dist/internal/sidebar-navigation.d.ts.map +0 -1
  263. package/dist/internal/time-panel.d.ts.map +0 -1
  264. package/dist/internal/use-cascader-lazy.d.ts.map +0 -1
  265. package/dist/internal/use-floating-layout-observer.d.ts.map +0 -1
  266. package/dist/internal/use-overlay-focus.d.ts.map +0 -1
  267. package/dist/internal/use-portal-container.d.ts.map +0 -1
  268. package/dist/internal/use-presence.d.ts.map +0 -1
  269. package/dist/internal/use-transfer-remote.d.ts.map +0 -1
  270. package/dist/internal/use-tree-data.d.ts.map +0 -1
  271. /package/dist/internal/{date-mode-panel.d.ts → date-time/date-mode-panel.d.ts} +0 -0
  272. /package/dist/internal/{date-time-range-control.d.ts → date-time/date-time-range-control.d.ts} +0 -0
  273. /package/dist/internal/{time-panel.d.ts → date-time/time-panel.d.ts} +0 -0
  274. /package/dist/internal/{sidebar-navigation.d.ts → navigation/sidebar-navigation.d.ts} +0 -0
  275. /package/dist/internal/{use-floating-layout-observer.d.ts → overlay/use-floating-layout-observer.d.ts} +0 -0
  276. /package/dist/internal/{use-overlay-focus.d.ts → overlay/use-overlay-focus.d.ts} +0 -0
  277. /package/dist/internal/{use-portal-container.d.ts → overlay/use-portal-container.d.ts} +0 -0
  278. /package/dist/internal/{use-presence.d.ts → overlay/use-presence.d.ts} +0 -0
  279. /package/dist/internal/{option-window.d.ts → selection/option-window.d.ts} +0 -0
@@ -1,6 +1,6 @@
1
- import { type HTMLAttributes, type ReactNode } from 'react';
2
- import { type TableColumnLayout, type TableCellSpan } from '@ug666/ui-core';
3
- import { type TableSize } from '../components/table';
1
+ import { type TableCellSpan, type TableColumnLayout } from "@ug666/ui-core";
2
+ import { type HTMLAttributes, type ReactNode } from "react";
3
+ import { type TableSize } from "../components/table";
4
4
  export interface DataTableColumn<TRecord> extends TableColumnLayout {
5
5
  id: string;
6
6
  header: ReactNode;
@@ -11,7 +11,7 @@ export interface DataTableColumn<TRecord> extends TableColumnLayout {
11
11
  sortLabel?: string;
12
12
  className?: string;
13
13
  }
14
- export interface DataTableProps<TRecord> extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
14
+ export interface DataTableProps<TRecord> extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
15
15
  rows: readonly TRecord[];
16
16
  columns: readonly DataTableColumn<TRecord>[];
17
17
  getRowId: (record: TRecord) => string;
@@ -20,11 +20,13 @@ export interface DataTableProps<TRecord> extends Omit<HTMLAttributes<HTMLDivElem
20
20
  errorTitle?: string;
21
21
  emptyTitle?: string;
22
22
  emptyDescription?: string;
23
+ /** 空状态下的引导操作,例如「新建」按钮 */
24
+ emptyAction?: React.ReactNode;
23
25
  selectedIds?: ReadonlySet<string>;
24
26
  onSelectionChange?: (ids: Set<string>) => void;
25
27
  sort?: string;
26
- order?: 'asc' | 'desc';
27
- onSortChange?: (sort: string, order: 'asc' | 'desc') => void;
28
+ order?: "asc" | "desc";
29
+ onSortChange?: (sort: string, order: "asc" | "desc") => void;
28
30
  rowActions?: (record: TRecord) => ReactNode;
29
31
  actionsLabel?: ReactNode;
30
32
  page?: number;
@@ -38,13 +40,22 @@ export interface DataTableProps<TRecord> extends Omit<HTMLAttributes<HTMLDivElem
38
40
  retryLabel?: ReactNode;
39
41
  scrollRegionLabel?: string;
40
42
  size?: TableSize;
43
+ /** 是否画单元格竖线;后台列表默认不画,只保留行分隔。 */
41
44
  bordered?: boolean;
42
45
  striped?: boolean;
43
46
  tableClassName?: string;
44
47
  /** 填满有确定高度的父容器,表格内部滚动,分页保持底部。默认 false。 */
45
48
  fill?: boolean;
46
49
  /** 默认为 true;层级完整数据等无分页模式可关闭整个分页摘要区。 */
50
+ /** 窄屏提示文案;传 null 关闭。默认提示可横向滑动查看其余列。 */
51
+ overflowHint?: ReactNode;
47
52
  pagination?: boolean;
53
+ /** 每页条数选择器与页码按钮的尺寸;默认 default,与表单控件同高。 */
54
+ paginationSize?: "sm" | "default";
55
+ /** 是否显示行号列(序号),序号按当前页与每页条数连续计算。 */
56
+ rowNumber?: boolean;
57
+ /** 行点击回调;传入后整行可点击(内部按钮/链接不会触发)。 */
58
+ onRowClick?: (record: TRecord) => void;
48
59
  spanMethod?: (context: {
49
60
  row: TRecord;
50
61
  column: DataTableColumn<TRecord>;
@@ -64,6 +75,6 @@ export interface DataTableProps<TRecord> extends Omit<HTMLAttributes<HTMLDivElem
64
75
  /**
65
76
  * 通用后台数据表格模式。请求、筛选、权限和路由由调用方负责。
66
77
  */
67
- declare function DataTable<TRecord>({ rows, columns: sourceColumns, getRowId, loading, error, errorTitle, emptyTitle, emptyDescription, selectedIds, onSelectionChange, sort, order, onSortChange, rowActions, actionsLabel, page, total, pageSize, onPageChange, pageSizeOptions, onPageSizeChange, onRetry, retryLabel, scrollRegionLabel, size, bordered, striped, tableClassName, fill, pagination, spanMethod, summaryMethod, columnOrder, defaultColumnOrder, onColumnOrderChange, reorderableColumns, className, ...props }: DataTableProps<TRecord>): import("react").JSX.Element;
78
+ declare function DataTable<TRecord>({ rows, columns: sourceColumns, getRowId, loading, error, errorTitle, emptyTitle, emptyDescription, emptyAction, selectedIds, onSelectionChange, sort, order, onSortChange, rowActions, actionsLabel, page, total, pageSize, onPageChange, pageSizeOptions, onPageSizeChange, onRetry, retryLabel, scrollRegionLabel, size, bordered, striped, tableClassName, fill, overflowHint, pagination, paginationSize, rowNumber, onRowClick, spanMethod, summaryMethod, columnOrder, defaultColumnOrder, onColumnOrderChange, reorderableColumns, className, ...props }: DataTableProps<TRecord>): import("react").JSX.Element;
68
79
  export { DataTable };
69
80
  //# sourceMappingURL=data-table.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/patterns/data-table.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAqC,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC9F,OAAO,EAA+I,KAAK,iBAAiB,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAWxN,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,qBAAqB,CAAA;AAK5B,MAAM,WAAW,eAAe,CAAC,OAAO,CAAE,SAAQ,iBAAiB;IACjE,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,SAAS,CAAA;IACjB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAA;IACrC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAA;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,CACrC,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,IAAI,EAAE,SAAS,OAAO,EAAE,CAAA;IACxB,OAAO,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAA;IAC5C,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAA;IACrC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IACjC,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAA;IAC5D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAA;IAC3C,YAAY,CAAC,EAAE,SAAS,CAAA;IACxB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACrC,+BAA+B;IAC/B,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACnC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAA;IACpB,UAAU,CAAC,EAAE,SAAS,CAAA;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,uCAAuC;IACvC,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,GAAG,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAA;IACvJ,mCAAmC;IACnC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QAAE,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;QAAC,OAAO,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAA;KAAE,KAAK,SAAS,SAAS,EAAE,CAAA;IAC7H,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC/B,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACtC,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC7C,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED;;GAEG;AACH,iBAAS,SAAS,CAAC,OAAO,EAAE,EAC1B,IAAI,EACJ,OAAO,EAAE,aAAa,EACtB,QAAQ,EACR,OAAe,EACf,KAAK,EACL,UAAqB,EACrB,UAAmB,EACnB,gBAAmC,EACnC,WAAuB,EACvB,iBAAiB,EACjB,IAAI,EACJ,KAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAmB,EACnB,IAAQ,EACR,KAAmB,EACnB,QAAa,EACb,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,UAAiB,EACjB,iBAA0B,EAC1B,IAAW,EACX,QAAe,EACf,OAAe,EACf,cAAc,EACd,IAAY,EACZ,UAAiB,EACjB,UAAU,EAAE,aAAa,EAAE,WAAW,EAAE,kBAAuB,EAAE,mBAAmB,EAAE,kBAA0B,EAChH,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,CAAC,+BA0MzB;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"data-table.d.ts","sourceRoot":"","sources":["../../src/patterns/data-table.tsx"],"names":[],"mappings":"AAOA,OAAO,EAMN,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,MAAM,gBAAgB,CAAC;AAOxB,OAAO,EACN,KAAK,cAAc,EACnB,KAAK,SAAS,EAId,MAAM,OAAO,CAAC;AAOf,OAAO,EAKN,KAAK,SAAS,EACd,MAAM,qBAAqB,CAAC;AAY7B,MAAM,WAAW,eAAe,CAAC,OAAO,CAAE,SAAQ,iBAAiB;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC;IACtC,qCAAqC;IACrC,QAAQ,CAAC,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc,CAAC,OAAO,CACtC,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IACxD,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IACzB,OAAO,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;IAC7C,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,MAAM,CAAC;IACtC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,yBAAyB;IACzB,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAClC,iBAAiB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAC/C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,SAAS,CAAC;IAC5C,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,+BAA+B;IAC/B,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,gCAAgC;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0CAA0C;IAC1C,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,uCAAuC;IACvC,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0CAA0C;IAC1C,cAAc,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IAClC,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mCAAmC;IACnC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE;QACtB,GAAG,EAAE,OAAO,CAAC;QACb,MAAM,EAAE,eAAe,CAAC,OAAO,CAAC,CAAC;QACjC,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;KACpB,KAAK,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS,CAAC;IACzC,mCAAmC;IACnC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE;QACzB,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;QACzB,OAAO,EAAE,SAAS,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;KAC7C,KAAK,SAAS,SAAS,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,kBAAkB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAC9C,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,iBAAS,SAAS,CAAC,OAAO,EAAE,EAC3B,IAAI,EACJ,OAAO,EAAE,aAAa,EACtB,QAAQ,EACR,OAAe,EACf,KAAK,EACL,UAAqB,EACrB,UAAmB,EACnB,gBAAmC,EACnC,WAAW,EACX,WAAuB,EACvB,iBAAiB,EACjB,IAAI,EACJ,KAAa,EACb,YAAY,EACZ,UAAU,EACV,YAAmB,EACnB,IAAQ,EACR,KAAmB,EACnB,QAAa,EACb,YAAY,EACZ,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,UAAiB,EACjB,iBAA0B,EAC1B,IAAW,EACX,QAAgB,EAChB,OAAe,EACf,cAAc,EACd,IAAY,EACZ,YAA0B,EAC1B,UAAiB,EACjB,cAA0B,EAC1B,SAAiB,EACjB,UAAU,EACV,UAAU,EACV,aAAa,EACb,WAAW,EACX,kBAAuB,EACvB,mBAAmB,EACnB,kBAA0B,EAC1B,SAAS,EACT,GAAG,KAAK,EACR,EAAE,cAAc,CAAC,OAAO,CAAC,+BA8ezB;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1 +1 @@
1
- "use strict";function _nullishCoalesce(e,a){return null!=e?e:a()}function _optionalChain(e){let a,l=e[0],t=1;for(;t<e.length;){const i=e[t],o=e[t+1];if(t+=2,("optionalAccess"===i||"optionalCall"===i)&&null==l)return;"access"===i||"optionalAccess"===i?(a=l,l=o(l)):"call"!==i&&"optionalCall"!==i||(l=o((...e)=>l.call(a,...e)),a=void 0)}return l}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../chunk-JY5S7YLF.cjs");require("../chunk-2EJWWTLH.cjs");var a=require("../chunk-X4EMYHLY.cjs"),l=require("../chunk-J4NAYP4L.cjs"),t=require("../chunk-XVFRKGM7.cjs"),i=require("react"),o=require("@ug666/ui-core"),n=require("lucide-react"),s=require("react/jsx-runtime"),r=i.forwardRef.call(void 0,({options:a,value:r,defaultValue:d=[],onValueChange:c,searchable:u=!0,searchPlaceholder:v="搜索选项",emptyLabel:g="没有匹配项",disabled:h,size:p,name:m,form:x,layout:b="stack",collapsibleGroups:f=!1,expandedGroups:j,defaultExpandedGroups:w,onExpandedGroupsChange:C,showSelectAll:y=!0,showSummary:N=!0,showGroupCount:k=!0,className:S,...T},z)=>{const _=t.useUIConfig.call(void 0),A=i.useId.call(void 0),R=i.useRef.call(void 0,null),[M,L]=i.useState.call(void 0,[...d]),[I,D]=i.useState.call(void 0,""),E=i.useRef.call(void 0,{value:r,defaultValue:d});E.current={value:r,defaultValue:d};const[B,F]=i.useState.call(void 0,()=>void 0===w?[]:o.groupSelectionListOptions.call(void 0,a).filter(e=>!w.includes(e.key)).map(e=>e.key)),G=_nullishCoalesce(r,()=>M),V=t.resolveDisabled.call(void 0,h,_.disabled),$=t.resolveControlSize.call(void 0,p,_.size),P=o.filterSelectionListOptions.call(void 0,a,u?I:""),U=o.groupSelectionListOptions.call(void 0,P),O=o.getSelectionListScope.call(void 0,P,G),W=o.groupSelectionListOptions.call(void 0,a),H=_nullishCoalesce(j,()=>W.filter(e=>!B.includes(e.key)).map(e=>e.key)),q=u&&I.trim().length>0,Q=U.every(e=>H.includes(e.key));function changeExpanded(e){void 0===j&&F(W.filter(a=>!e.includes(a.key)).map(e=>e.key)),_optionalChain([C,"optionalCall",a=>a(e)])}function change(e){V||(void 0===r&&L(e),_optionalChain([c,"optionalCall",a=>a(e)]))}return i.useEffect.call(void 0,()=>{const e=x?document.getElementById(x):_optionalChain([R,"access",e=>e.current,"optionalAccess",e=>e.closest,"call",e=>e("form")]);if(!e)return;const a=new Set;function reset(e){const l=setTimeout(()=>{a.delete(l),e.defaultPrevented||(void 0===E.current.value&&L([...E.current.defaultValue]),D(""))},0);a.add(l)}return e.addEventListener("reset",reset),()=>{e.removeEventListener("reset",reset),a.forEach(clearTimeout)}},[x]),s.jsxs.call(void 0,"div",{...T,ref:e=>{R.current=e,"function"==typeof z?z(e):z&&(z.current=e)},className:t.cn.call(void 0,"grid min-w-0 gap-[var(--content-gap)] text-text-primary",S),"data-ug":"selection-list","data-ug-slot":"root","data-size":$,"data-layout":b,"data-state":V?"disabled":0===P.length?"empty":"default","data-variant":"grouped",role:"group","aria-label":_nullishCoalesce(T["aria-label"],()=>"选项列表"),"aria-disabled":V||void 0,children:[u?s.jsx.call(void 0,"div",{"data-ug-slot":"search",children:s.jsx.call(void 0,l.Input,{value:I,onValueChange:D,clearable:!0,"aria-label":v,placeholder:v,size:$,disabled:V})}):null,y||N?s.jsxs.call(void 0,"div",{"data-ug-slot":"bulk",className:"flex flex-wrap items-center justify-between gap-[calc(var(--content-gap)*0.5)]",children:[y?s.jsx.call(void 0,e.Checkbox,{checked:O.checked,indeterminate:O.indeterminate,size:$,disabled:V||0===O.available,"aria-describedby":N?`${A}-summary`:void 0,onCheckedChange:e=>change(o.updateSelectionListScope.call(void 0,G,P,e)),label:"全选当前结果"}):null,N?s.jsxs.call(void 0,"span",{id:`${A}-summary`,"data-ug-slot":"summary",className:"text-xs text-text-secondary","aria-live":"polite",children:["已选 ",new Set(G).size," 项;当前 ",O.total," 项,",O.available," 项可操作",O.disabled>0?`,${O.disabled} 项不可操作`:""]}):null]}):null,f?s.jsxs.call(void 0,"div",{"data-ug-slot":"group-actions",children:[s.jsx.call(void 0,t.Button,{type:"button",size:"default",variant:"ghost",disabled:q||0===U.length,title:q?"清空搜索后可折叠分组":void 0,onClick:()=>changeExpanded(Q?H.filter(e=>!U.some(a=>a.key===e)):[...new Set([...H,...U.map(e=>e.key)])]),children:Q?"全部收起":"全部展开"}),q?s.jsx.call(void 0,"span",{"data-ug-slot":"search-hint",children:"搜索时展开匹配分组"}):null]}):null,s.jsxs.call(void 0,"div",{"data-ug-slot":"groups",className:"grid min-w-0 gap-[var(--content-gap)]",children:[U.map(a=>{const l=o.getSelectionListScope.call(void 0,a.options,G),i=!f||q||H.includes(a.key),r=`${A}-group-${encodeURIComponent(a.key)}`;return s.jsxs.call(void 0,e.Fieldset,{variant:"card",size:"sm","data-ug-slot":"group",children:[s.jsx.call(void 0,e.FieldsetLegend,{children:a.label}),s.jsxs.call(void 0,"div",{"data-ug-slot":"group-heading",className:"flex flex-wrap items-center justify-between gap-[calc(var(--content-gap)*0.5)]",children:[s.jsx.call(void 0,e.Checkbox,{checked:l.checked,indeterminate:l.indeterminate,size:$,disabled:V||0===l.available,onCheckedChange:e=>change(o.updateSelectionListScope.call(void 0,G,a.options,e)),label:`全选${a.label}`}),k?s.jsxs.call(void 0,"span",{"data-ug-slot":"group-count",className:"text-xs text-text-secondary",children:["已选 ",l.selected,"/",l.total,l.disabled>0?`,${l.disabled} 项不可操作`:""]}):null,f?s.jsx.call(void 0,t.Button,{type:"button",variant:"ghost",size:"icon",disabled:q,className:k?void 0:"ml-auto","aria-label":`${i?"收起":"展开"}${a.label}选项`,"aria-expanded":i,"aria-controls":r,title:q?"清空搜索后可折叠分组":`${i?"收起":"展开"}${a.label}选项`,onClick:()=>changeExpanded(i?H.filter(e=>e!==a.key):[...H,a.key]),children:i?s.jsx.call(void 0,n.ChevronDown,{size:16,"aria-hidden":"true"}):s.jsx.call(void 0,n.ChevronRight,{size:16,"aria-hidden":"true"})}):null]}),s.jsx.call(void 0,"div",{id:r,"data-ug-slot":"options",hidden:!i,children:s.jsx.call(void 0,e.CheckboxGroup,{value:G,disabled:V,size:$,orientation:"vertical","aria-label":`${a.label}选项`,onValueChange:e=>change(e.map(String)),children:a.options.map(a=>s.jsx.call(void 0,e.Checkbox,{value:a.id,disabled:a.disabled,"aria-label":a.label,"aria-describedby":[a.description&&`${A}-description-${encodeURIComponent(a.id)}`,a.disabled&&`${A}-locked-${encodeURIComponent(a.id)}`].filter(Boolean).join(" ")||void 0,label:s.jsxs.call(void 0,"span",{"data-ug-slot":"option-label",className:"grid min-w-0 [overflow-wrap:anywhere]",children:[s.jsxs.call(void 0,"span",{children:[a.label,a.disabled?s.jsx.call(void 0,"span",{id:`${A}-locked-${encodeURIComponent(a.id)}`,"data-ug-slot":"locked",className:"ml-1 text-xs text-text-secondary",children:"(不可操作)"}):null]}),a.description?s.jsx.call(void 0,"span",{id:`${A}-description-${encodeURIComponent(a.id)}`,"data-ug-slot":"option-description",className:"text-xs text-text-secondary",children:a.description}):null]})},a.id))})})]},a.key)}),0===P.length?s.jsx.call(void 0,"p",{"data-ug-slot":"empty",className:"text-sm text-text-secondary",role:"status",children:g}):null]}),m?[...new Set(G)].map(e=>s.jsx.call(void 0,"input",{type:"hidden",name:m,form:x,value:e,disabled:V},e)):null]})});r.displayName="SelectionList";var d=require("@ug666/ui-web");function DataTableHeader({headers:a,layout:l,widths:r,offset:d,selection:c,actions:u,sort:v,order:g,onSortChange:h,reorderable:p,move:m}){const x=i.useRef.call(void 0,void 0);return s.jsx.call(void 0,e.TableHeader,{children:a.map((i,b)=>s.jsxs.call(void 0,e.TableRow,{children:[0===b&&null!=c&&s.jsx.call(void 0,e.TableHead,{rowSpan:a.length,scope:"col","data-leaf-index":0,className:"text-center","data-fixed":o.getTableColumnFixed.call(void 0,l[0]),style:o.getTableColumnStyle.call(void 0,l,0,r),children:c}),i.map(a=>{const{column:i,leafIndex:c,colSpan:u,rowSpan:b,siblingIds:f}=a,j=c+d,w=l.slice(j,j+u),C=o.getTableColumnFixed.call(void 0,w[0]),y=w.every(e=>o.getTableColumnFixed.call(void 0,e)===C),N=o.getTableColumnStyle.call(void 0,l,"right"===C?j+u-1:j,r),k=f.indexOf(i.id),S=_nullishCoalesce(i.sortLabel,()=>"string"==typeof i.header||"number"==typeof i.header?String(i.header):i.id),T=Boolean(_optionalChain([i,"access",e=>e.children,"optionalAccess",e=>e.length]));return s.jsx.call(void 0,e.TableHead,{scope:T?"colgroup":"col",colSpan:u,rowSpan:b,"data-leaf-index":T?void 0:j,"data-fixed":y?C:void 0,style:T?{...N,width:void 0,minWidth:void 0}:N,className:i.className,"aria-sort":!T&&i.sortable&&v===i.id?"asc"===g?"ascending":"descending":void 0,draggable:p||void 0,onDragStart:e=>{x.current=i.id,e.dataTransfer.setData("text/plain",i.id),e.dataTransfer.effectAllowed="move"},onDragEnd:()=>{x.current=void 0},onDragOver:e=>{p&&x.current&&f.includes(x.current)&&e.preventDefault()},onDrop:e=>{p&&x.current&&f.includes(x.current)&&(e.preventDefault(),m(x.current,i.id),x.current=void 0)},children:s.jsxs.call(void 0,"span",{"data-ug-slot":"header",className:"contents",children:[!T&&i.sortable&&h?s.jsxs.call(void 0,t.Button,{"aria-label":`按${S}排序`,style:{fontWeight:"inherit"},type:"button",size:"sm",tone:"neutral",variant:"text",onClick:()=>h(i.id,v===i.id&&"asc"===g?"desc":"asc"),children:[i.header,v!==i.id?s.jsx.call(void 0,n.ArrowUpDown,{"aria-hidden":!0,size:14}):"asc"===g?s.jsx.call(void 0,n.ArrowUp,{"aria-hidden":!0,size:14}):s.jsx.call(void 0,n.ArrowDown,{"aria-hidden":!0,size:14})]}):i.header,p&&s.jsxs.call(void 0,"span",{"data-ug-slot":"column-reorder",children:[s.jsx.call(void 0,t.Button,{type:"button",variant:"text",size:"icon-sm","aria-label":`向左移动${S}`,disabled:0===k,onClick:()=>m(i.id,f[k-1]),children:s.jsx.call(void 0,n.ChevronLeft,{size:14,"aria-hidden":!0})}),s.jsx.call(void 0,t.Button,{type:"button",variant:"text",size:"icon-sm","aria-label":`向右移动${S}`,disabled:k===f.length-1,onClick:()=>m(i.id,f[k+1],!0),children:s.jsx.call(void 0,n.ChevronRight,{size:14,"aria-hidden":!0})})]})]})},i.id)}),0===b&&null!=u&&s.jsx.call(void 0,e.TableHead,{rowSpan:a.length,scope:"col","data-leaf-index":l.length-1,className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":o.getTableColumnFixed.call(void 0,l.at(-1)),children:u})]},b))})}var c=["loading-a","loading-b","loading-c","loading-d","loading-e"];function DataTable({rows:a,columns:l,getRowId:r,loading:u=!1,error:v,errorTitle:g="数据加载失败",emptyTitle:h="暂无数据",emptyDescription:p="当前条件下没有可展示的记录。",selectedIds:m=new Set,onSelectionChange:x,sort:b,order:f="asc",onSortChange:j,rowActions:w,actionsLabel:C="操作",page:y=1,total:N=a.length,pageSize:k=20,onPageChange:S,pageSizeOptions:T,onPageSizeChange:z,onRetry:_,retryLabel:A="重试",scrollRegionLabel:R="数据表格",size:M="sm",bordered:L=!0,striped:I=!1,tableClassName:D,fill:E=!1,pagination:B=!0,spanMethod:F,summaryMethod:G,columnOrder:V,defaultColumnOrder:$=[],onColumnOrderChange:P,reorderableColumns:U=!1,className:O,...W}){const[H,q]=i.useState.call(void 0,$),Q=o.getTableStructure.call(void 0,l,_nullishCoalesce(V,()=>H)),K=Q.leaves,Y=o.getTableSpanGrid.call(void 0,a.length,K.length,(e,l)=>_optionalChain([F,"optionalCall",t=>t({row:a[e],column:K[l],rowIndex:e,columnIndex:l})])),J=!u&&G?G({rows:a,columns:K}):void 0;const X=i.useRef.call(void 0,null),[Z,ee]=i.useState.call(void 0,{widths:[],regionWidth:1/0}),ae=Z.widths,le=K.some(e=>"left"===o.getTableColumnFixed.call(void 0,e)),te=[...x?[{width:"var(--control-height-lg)",fixed:le?"left":void 0}]:[],...K,...w?[{fixed:"right"}]:[]],ie=x?1:0,oe=o.resolveTableFixedColumns.call(void 0,te,ae,Z.regionWidth,w?te.length-1:void 0),ne=JSON.stringify([Q.order,te.map(({width:e,minWidth:a,align:l,fixed:t})=>({width:e,minWidth:a,align:l,fixed:t}))]),se=a.map(r),re=se.length>0&&se.every(e=>m.has(e)),de=se.some(e=>m.has(e))&&!re,ce=Math.max(Math.ceil(N/Math.max(k,1)),1),ue=[...new Set([..._nullishCoalesce(T,()=>[]),k])].filter(e=>Number.isSafeInteger(e)&&e>0).sort((e,a)=>e-a),ve=v?"error":u?"loading":0===a.length?"empty":"ready";return i.useLayoutEffect.call(void 0,()=>(w||K.some(e=>o.getTableColumnFixed.call(void 0,e)))&&X.current?d.observeTableColumnWidths.call(void 0,X.current,(e,a)=>ee({widths:e,regionWidth:a})):void 0,[ne,ve]),s.jsx.call(void 0,"div",{ref:X,className:t.cn.call(void 0,"min-w-0",!E&&"space-y-[calc(var(--content-gap)*0.75)]",O),"data-ug":"data-table","data-fill":E||void 0,"data-state":ve,"data-variant":L?"bordered":"default","data-size":M,...W,children:v?s.jsxs.call(void 0,"div",{className:"grid min-h-[calc(var(--control-height-lg)*3)] content-center gap-[calc(var(--content-gap)*0.75)]","data-ug-slot":"feedback",children:[s.jsxs.call(void 0,e.Alert,{variant:"destructive",children:[s.jsx.call(void 0,e.AlertTitle,{children:g}),s.jsx.call(void 0,e.AlertDescription,{children:v})]}),_?s.jsx.call(void 0,"div",{children:s.jsxs.call(void 0,t.Button,{onClick:_,size:"sm",type:"button",variant:"default",children:[s.jsx.call(void 0,n.RefreshCw,{"aria-hidden":"true",size:16}),A]})}):null]}):s.jsxs.call(void 0,s.Fragment,{children:[s.jsx.call(void 0,"div",{"data-ug-slot":"table",children:s.jsxs.call(void 0,e.Table,{bordered:L,className:t.cn.call(void 0,"min-w-[48rem] table-auto",D),scrollRegionLabel:R,size:M,striped:I,children:[s.jsx.call(void 0,"colgroup",{children:te.map((e,a)=>s.jsx.call(void 0,"col",{style:{width:o.tableColumnLength.call(void 0,e.width)}},a))}),s.jsx.call(void 0,DataTableHeader,{headers:Q.headers,layout:oe,widths:ae,offset:ie,sort:b,order:f,onSortChange:j,reorderable:U,move:function moveColumn(e,a,t=!1){const i=o.moveTableColumn.call(void 0,l,Q.order,e,a,t);i.every((e,a)=>e===Q.order[a])||(void 0===V&&q(i),_optionalChain([P,"optionalCall",e=>e(i)]))},selection:x?s.jsx.call(void 0,"span",{className:"inline-flex","data-ug-slot":"selection",children:s.jsx.call(void 0,e.Checkbox,{"aria-label":"选择当前页全部记录",checked:re,indeterminate:de,onCheckedChange:function toggleAll(e){const a=new Set(m);for(const l of se)e?a.add(l):a.delete(l);_optionalChain([x,"optionalCall",e=>e(a)])}})}):void 0,actions:w?s.jsx.call(void 0,"span",{"data-ug-slot":"header",children:C}):void 0}),s.jsxs.call(void 0,e.TableBody,{children:[u?c.map(a=>s.jsxs.call(void 0,e.TableRow,{children:[x?s.jsx.call(void 0,e.TableCell,{className:"text-center","data-fixed":o.getTableColumnFixed.call(void 0,oe[0]),style:o.getTableColumnStyle.call(void 0,oe,0,ae),children:s.jsx.call(void 0,"span",{className:"inline-flex","data-ug-slot":"selection",children:s.jsx.call(void 0,e.Skeleton,{className:"size-[calc(var(--control-height-sm)*0.5)]",variant:"rect"})})}):null,K.map((a,l)=>s.jsx.call(void 0,e.TableCell,{className:a.className,"data-fixed":o.getTableColumnFixed.call(void 0,oe[l+ie]),style:o.getTableColumnStyle.call(void 0,oe,l+ie,ae),children:s.jsx.call(void 0,"span",{"data-ug-slot":"loading",children:s.jsx.call(void 0,e.Skeleton,{variant:"text"})})},a.id)),w?s.jsx.call(void 0,e.TableCell,{className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":o.getTableColumnFixed.call(void 0,oe[te.length-1]),children:s.jsx.call(void 0,"span",{"data-ug-slot":"loading",children:s.jsx.call(void 0,e.Skeleton,{variant:"text"})})}):null]},a)):a.map((a,l)=>{const t=r(a),i=m.has(t);return s.jsxs.call(void 0,e.TableRow,{"data-state":i?"selected":"default",children:[x?s.jsx.call(void 0,e.TableCell,{className:"text-center","data-fixed":o.getTableColumnFixed.call(void 0,oe[0]),style:o.getTableColumnStyle.call(void 0,oe,0,ae),children:s.jsx.call(void 0,"span",{className:"inline-flex","data-ug-slot":"selection",children:s.jsx.call(void 0,e.Checkbox,{"aria-label":`选择记录 ${t}`,checked:i,onCheckedChange:e=>function toggleOne(e,a){const l=new Set(m);a?l.add(e):l.delete(e),_optionalChain([x,"optionalCall",e=>e(l)])}(t,e)})})}):null,K.map((t,i)=>Y[l][i].rowSpan>0?s.jsx.call(void 0,e.TableCell,{rowSpan:Y[l][i].rowSpan,colSpan:Y[l][i].colSpan,className:t.className,"data-fixed":1===Y[l][i].colSpan?o.getTableColumnFixed.call(void 0,oe[i+ie]):void 0,style:o.getTableColumnStyle.call(void 0,oe,i+ie,ae),children:s.jsx.call(void 0,"span",{className:"contents","data-ug-slot":"cell",children:t.cell?t.cell(a):String(_nullishCoalesce(a[t.id],()=>"—"))})},t.id):null),w?s.jsx.call(void 0,e.TableCell,{className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":o.getTableColumnFixed.call(void 0,oe[te.length-1]),children:s.jsx.call(void 0,"div",{"data-ug-slot":"actions",children:w(a)})}):null]},t)}),u||0!==a.length?null:s.jsx.call(void 0,e.TableRow,{children:s.jsx.call(void 0,e.TableCell,{colSpan:K.length+(x?1:0)+(w?1:0),children:s.jsx.call(void 0,"div",{"data-ug-slot":"empty",children:s.jsx.call(void 0,e.EmptyState,{description:p,icon:n.Database,size:"sm",title:h})})})})]}),J&&a.length>0&&s.jsx.call(void 0,"tfoot",{"data-ug-slot":"aggregate",children:s.jsxs.call(void 0,e.TableRow,{children:[x&&s.jsx.call(void 0,e.TableCell,{}),K.map((a,l)=>s.jsx.call(void 0,e.TableCell,{"data-fixed":o.getTableColumnFixed.call(void 0,oe[l+ie]),style:o.getTableColumnStyle.call(void 0,oe,l+ie,ae),children:J[l]},a.id)),w&&s.jsx.call(void 0,e.TableCell,{"data-ug-slot":"action-column","data-fixed":o.getTableColumnFixed.call(void 0,oe[te.length-1])})]})})]})}),B&&!u&&(N>0||T&&z)?s.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-[var(--content-gap)] text-sm text-text-secondary max-sm:items-stretch max-sm:flex-col","data-ug-slot":"pagination",children:[s.jsxs.call(void 0,"span",{"data-ug-slot":"summary",children:["共 ",N," 条,第 ",y," / ",ce," 页"]}),s.jsxs.call(void 0,"div",{"data-ug-slot":"pagination-controls",children:[T&&z?s.jsx.call(void 0,e.Select,{"aria-label":"每页条数",options:ue.map(e=>({label:`每页 ${e} 条`,value:e})),size:"sm",value:k,onValueChange:e=>{"number"==typeof e&&z(e)}}):null,S&&ce>1?s.jsx.call(void 0,e.Pagination,{onPageChange:S,page:y,totalPages:ce,size:"sm"}):null]})]}):null]})})}function defaultChildren(e){return e.children}function TreeTable({rows:e,columns:a,getRowId:l,getChildren:r=defaultChildren,getRowLabel:d,treeColumnId:c=_optionalChain([o.getTableStructure.call(void 0,a),"access",e=>e.leaves,"access",e=>e[0],"optionalAccess",e=>e.id]),expandedIds:u,defaultExpandedIds:v,defaultExpandAll:g=!1,onExpandedChange:h,onExpandChange:p,indent:m=16,expansionDisabled:x=!1,expansionDisabledReason:b,fill:f=!1,size:j="sm",bordered:w=!0,className:C,...y}){const[N,k]=i.useState.call(void 0,()=>v?new Set(v):void 0),S=_nullishCoalesce(u,()=>N),T=i.useMemo.call(void 0,()=>o.projectTreeTableRows.call(void 0,e,{getRowId:l,getChildren:r,expandedIds:S,defaultExpandAll:g}),[e,l,r,S,g]),z=new Map(T.visibleRows.map(e=>[e.id,e]));function toggle(e,a){if(x)return;const t=l(e),i=new Set(_nullishCoalesce(S,()=>g?T.expandableIds:[]));a?i.add(t):i.delete(t),void 0===u&&k(i),_optionalChain([h,"optionalCall",e=>e(i)]),_optionalChain([p,"optionalCall",l=>l(e,a)])}const decorate=e=>e.map(e=>_optionalChain([e,"access",e=>e.children,"optionalAccess",e=>e.length])?{...e,children:decorate(e.children)}:e.id!==c?e:{...e,cell:a=>{const i=z.get(l(a)),o=_nullishCoalesce(_optionalChain([d,"optionalCall",e=>e(a)]),()=>`记录 ${i.id}`);return s.jsxs.call(void 0,"div",{"data-ug-slot":"tree-cell","data-depth":i.depth,style:{paddingInlineStart:i.depth*Math.max(m,0)},children:[s.jsxs.call(void 0,"span",{"data-ug-slot":"level",children:["层级 ",i.depth+1,","]}),i.hasChildren?s.jsx.call(void 0,t.Button,{type:"button",size:"icon-sm",variant:"ghost",tone:"neutral","aria-label":`${i.expanded?"收起":"展开"}${o}`,"aria-expanded":i.expanded,disabled:x,"aria-description":b,onClick:()=>toggle(a,!i.expanded),onKeyDown:e=>{x||("ArrowRight"!==e.key||i.expanded||(e.preventDefault(),toggle(a,!0)),"ArrowLeft"===e.key&&i.expanded&&(e.preventDefault(),toggle(a,!1)))},children:i.expanded?s.jsx.call(void 0,n.ChevronDown,{size:16,"aria-hidden":!0}):s.jsx.call(void 0,n.ChevronRight,{size:16,"aria-hidden":!0})}):s.jsx.call(void 0,"span",{"data-ug-slot":"tree-spacer","aria-hidden":!0}),s.jsx.call(void 0,"span",{"data-ug-slot":"tree-content",title:o,children:e.cell?e.cell(a):String(_nullishCoalesce(a[e.id],()=>"—"))})]})}}),_=decorate(a);return s.jsx.call(void 0,"div",{className:C,"data-ug":"tree-table","data-ug-slot":"root","data-fill":f||void 0,"data-size":j,"data-variant":w?"bordered":"default","data-state":y.error?"error":y.loading?"loading":T.visibleRows.length?"ready":"empty",children:s.jsx.call(void 0,DataTable,{...y,rows:T.visibleRows.map(e=>e.record),columns:_,getRowId:l,pagination:!1,fill:f,size:j,bordered:w})})}var u=require("@ug666/ui-core/theme"),v=require("@ug666/ui-web/sidebar");function activeClass(e,a){return e?"indicator"===a?"bg-transparent text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-active-text)] data-[state=open]:bg-[var(--ug-navigation-hover-bg)] data-[state=open]:text-[var(--ug-navigation-active-text)] after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:bg-[var(--ug-navigation-active-text)]":"bg-[var(--ug-navigation-active-bg)] text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-active-bg)] hover:text-[var(--ug-navigation-active-text)] data-[state=open]:bg-[var(--ug-navigation-active-bg)] data-[state=open]:text-[var(--ug-navigation-active-text)]":"bg-transparent text-[var(--ug-navigation-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-text)] data-[state=open]:bg-[var(--ug-navigation-hover-bg)] data-[state=open]:text-[var(--ug-navigation-text)]"}function topItemClass(e,a,l){return t.cn.call(void 0,"relative flex max-w-40 items-center gap-1.5 rounded-[var(--radius-control)] px-2.5 font-medium","compact"===l?"h-8 text-xs":"h-9 text-sm",activeClass(e,a))}function moreItemClass(e,a,l){return t.cn.call(void 0,"relative flex shrink-0 items-center gap-1 px-2.5","compact"===l?"h-8 text-xs":"h-9 text-sm",activeClass(e,a))}var g=i.memo.call(void 0,function DropdownItems2({items:a,level:l=0}){return s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"grid min-w-52 gap-1 p-1.5",l>0&&"min-w-48 border-l border-[var(--ug-navigation-border)] pl-2"),children:a.map((a,i)=>{const o=a.icon,n=_nullishCoalesce(_nullishCoalesce(a.id,()=>a.href),()=>`${l}-${i}-${a.label}`);return _optionalChain([a,"access",e=>e.children,"optionalAccess",e=>e.length])?s.jsxs.call(void 0,"div",{className:"grid gap-1",children:[s.jsxs.call(void 0,"div",{className:"flex items-center gap-2 px-2 py-1.5 text-xs font-semibold text-[var(--ug-navigation-text)] opacity-75",children:[s.jsx.call(void 0,o,{"aria-hidden":"true",size:14}),s.jsx.call(void 0,"span",{className:"truncate",children:a.label})]}),s.jsx.call(void 0,DropdownItems2,{items:a.children,level:l+1})]},n):s.jsxs.call(void 0,e.NavigationMenuLink,{active:a.active,className:t.cn.call(void 0,"flex w-full items-center gap-2 px-2.5 py-2",(r=Boolean(a.active),r?"bg-[var(--ug-navigation-active-bg)] text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-active-bg)] hover:text-[var(--ug-navigation-active-text)]":"bg-transparent text-[var(--ug-navigation-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-text)]")),href:a.href,children:[s.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),s.jsx.call(void 0,"span",{className:"min-w-0 flex-1 truncate",children:a.label}),void 0!==a.badge?s.jsx.call(void 0,"span",{className:"text-xs opacity-70",children:a.badge}):null]},n);var r})})}),h=i.memo.call(void 0,function TopItem2({item:a,active:l,activeStyle:t,density:i}){const o=a.icon,n=topItemClass(l,t,i);return _optionalChain([a,"access",e=>e.children,"optionalAccess",e=>e.length])?s.jsxs.call(void 0,e.NavigationMenuItem,{children:[s.jsxs.call(void 0,e.NavigationMenuTrigger,{active:l,className:n,children:[s.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),s.jsx.call(void 0,"span",{className:"truncate",children:a.label})]}),s.jsx.call(void 0,e.NavigationMenuContent,{className:"max-h-[min(70dvh,32rem)] overflow-y-auto overscroll-contain border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]",children:s.jsx.call(void 0,g,{items:a.children})})]}):s.jsx.call(void 0,e.NavigationMenuItem,{children:s.jsxs.call(void 0,e.NavigationMenuLink,{active:l,className:n,href:a.href,children:[s.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),s.jsx.call(void 0,"span",{className:"truncate",children:a.label})]})})});function AdminHorizontalNavigation({items:a,activeStyle:l,density:o}){const r=i.useMemo.call(void 0,()=>function normalizeItems(e){const a=1===e.length?e[0]:void 0;return _optionalChain([a,"optionalAccess",e=>e.children,"optionalAccess",e=>e.length])?a.href?[{...a,children:void 0},...a.children]:a.children:e}(a),[a]),d=i.useMemo.call(void 0,()=>v.createSidebarTreeMeta.call(void 0,r),[r]),[c,u]=i.useState.call(void 0,()=>Math.min(r.length,6)),p=i.useRef.call(void 0,null),m=i.useRef.call(void 0,null),x=i.useRef.call(void 0,null),b=i.useMemo.call(void 0,()=>r.slice(0,c),[r,c]),f=i.useMemo.call(void 0,()=>r.slice(c),[r,c]),j=i.useCallback.call(void 0,e=>Boolean(e.active||d.activeBranches.has(e)),[d]),w=i.useMemo.call(void 0,()=>f.some(j),[j,f]),C=i.useCallback.call(void 0,()=>{const e=p.current,a=m.current;if(!e||!a||e.clientWidth<=0)return void u(Math.min(r.length,6));const l=Array.from(a.querySelectorAll('[data-ug-navigation-measure="item"]')),t=a.querySelector('[data-ug-navigation-measure="more"]'),i=Number.parseFloat(window.getComputedStyle(a).columnGap)||4,o=_nullishCoalesce(_optionalChain([t,"optionalAccess",e=>e.getBoundingClientRect,"call",e=>e(),"access",e=>e.width]),()=>0);let n=0,s=0;for(let a=0;a<l.length;a+=1){const t=_nullishCoalesce(_optionalChain([l,"access",e=>e[a],"optionalAccess",e=>e.getBoundingClientRect,"call",e=>e(),"access",e=>e.width]),()=>0),r=a>0?i:0;if(n+r+t+(a<l.length-1?i+o:0)>e.clientWidth+.5)break;n+=r+t,s+=1}u(s)},[r]),y=i.useCallback.call(void 0,()=>{null===x.current&&(x.current=window.requestAnimationFrame(()=>{x.current=null,C()}))},[C]);return i.useLayoutEffect.call(void 0,()=>{let e=!1;const a="undefined"==typeof ResizeObserver?void 0:new ResizeObserver(y);return p.current&&_optionalChain([a,"optionalAccess",e=>e.observe,"call",e=>e(p.current)]),y(),_optionalChain([document,"access",e=>e.fonts,"optionalAccess",e=>e.ready,"access",e=>e.then,"call",a=>a(()=>{e||y()})]),()=>{e=!0,null!==x.current&&window.cancelAnimationFrame(x.current),x.current=null,_optionalChain([a,"optionalAccess",e=>e.disconnect,"call",e=>e()])}},[o,y]),s.jsxs.call(void 0,"div",{className:"relative min-w-0 flex-1",ref:p,children:[s.jsxs.call(void 0,"div",{"aria-hidden":"true",className:"pointer-events-none absolute invisible flex max-w-none items-center gap-1 whitespace-nowrap","data-ug-slot":"measure",inert:!0,ref:m,children:[r.map((e,a)=>{const i=e.icon;return s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,topItemClass(j(e),l,o),"max-w-none shrink-0"),"data-ug-navigation-measure":"item",children:[s.jsx.call(void 0,i,{"aria-hidden":"true",size:15}),s.jsx.call(void 0,"span",{children:e.label}),_optionalChain([e,"access",e=>e.children,"optionalAccess",e=>e.length])?s.jsx.call(void 0,n.ChevronDown,{"aria-hidden":"true",size:14}):null]},_nullishCoalesce(_nullishCoalesce(e.id,()=>e.href),()=>`measure-${a}-${e.label}`))}),s.jsxs.call(void 0,"span",{className:moreItemClass(!1,l,o),"data-ug-navigation-measure":"more",children:[s.jsx.call(void 0,n.MoreHorizontal,{"aria-hidden":"true",size:16}),s.jsx.call(void 0,"span",{children:"更多"})]})]}),s.jsxs.call(void 0,e.NavigationMenu,{activation:"click",tone:"inherit",className:"min-w-0 w-full overflow-visible","data-ug-context":"admin-horizontal-navigation",children:[b.map((e,a)=>s.jsx.call(void 0,h,{active:j(e),activeStyle:l,density:o,item:e},_nullishCoalesce(_nullishCoalesce(e.id,()=>e.href),()=>`${a}-${e.label}`))),f.length?s.jsxs.call(void 0,e.NavigationMenuItem,{children:[s.jsxs.call(void 0,e.NavigationMenuTrigger,{active:w,className:moreItemClass(w,l,o),children:[s.jsx.call(void 0,n.MoreHorizontal,{"aria-hidden":"true",size:16}),s.jsx.call(void 0,"span",{children:"更多"})]}),s.jsx.call(void 0,e.NavigationMenuContent,{className:"right-0 left-auto max-h-[min(70dvh,32rem)] overflow-y-auto overscroll-contain border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]",children:s.jsx.call(void 0,g,{items:f})})]}):null]})]})}var p=i.forwardRef.call(void 0,({navItems:l,sidebarHeader:o,sidebarCollapsedHeader:r,sidebarHeaderAlign:d="start",sidebarHeaderDivider:c=!0,sidebarContextSwitcher:v,sidebarContextSwitcherVisible:g=!1,sidebarContextSwitcherDividers:h=!1,sidebarContextSwitcherPlacement:p="after-search",sidebarScrollActiveItemIntoView:m=!0,sidebarFooter:x,sidebarVariant:b="dark",navigationMode:f="sidebar",navigationPalette:j,themePreset:w="default",themeMode:C,themeAccent:y="theme",navigationColors:N,navigationActiveStyle:k,navigationDensity:S,sidebarActiveStyle:T="highlight",sidebarDensity:z="comfortable",sidebarSearchable:_=!1,sidebarSearchPlaceholder:A="搜索菜单...",sidebarSearchDividers:R=!0,sidebarCollapsible:M=!0,sidebarTogglePlacement:L="sidebar",sidebarResizable:I=!1,sidebarWidth:D,defaultSidebarWidth:E=256,sidebarMinWidth:B=208,sidebarMaxWidth:F=480,onSidebarWidthChange:G,sidebarCollapsed:V,defaultSidebarCollapsed:$=!1,onSidebarCollapsedChange:P,mobileSidebarOpen:U,onMobileSidebarOpenChange:O,topbarStart:W,topbarEnd:H,topbar:q,secondaryBar:Q,topbarBordered:K=!0,secondaryBarBordered:Y=!1,fluidContent:J=!1,contentPadding:X=!0,mainClassName:Z,contentClassName:ee,children:ae,className:le,...te},ie)=>{const oe=a.useMediaQuery.call(void 0,"(prefers-color-scheme: dark)"),[ne,se]=i.useState.call(void 0,$),[re,de]=i.useState.call(void 0,!1),ce=_nullishCoalesce(V,()=>ne),ue=_nullishCoalesce(U,()=>re),ve=_nullishCoalesce(j,()=>"primary"===b?"light":"dark"),ge=void 0===C?ve:u.resolveUGNavigationPalette.call(void 0,C,oe),he=N?ve:ge,pe=u.resolveUGNavigationColors.call(void 0,w,he,N,y),me=_nullishCoalesce(k,()=>T),xe=_nullishCoalesce(S,()=>z),be="light"===he?"primary":"dark",fe={"--ug-navigation-bg":pe.background,"--ug-navigation-text":pe.text,"--ug-navigation-active-bg":pe.activeBackground,"--ug-navigation-active-text":pe.activeText,"--ug-navigation-hover-bg":pe.hoverBackground,"--ug-navigation-border":`color-mix(in srgb, ${pe.text} 18%, ${pe.background})`};function setSidebarCollapsed(e){void 0===V&&se(e),_optionalChain([P,"optionalCall",a=>a(e)])}function setMobileOpen(e){void 0===U&&de(e),_optionalChain([O,"optionalCall",a=>a(e)])}return s.jsx.call(void 0,"div",{ref:ie,className:t.cn.call(void 0,"text-text-primary",le),...te,"data-ug":"admin-shell","data-state":ue?"mobile-open":"default","data-variant":be,"data-navigation-mode":f,"data-navigation-palette":he,"data-sidebar-active-style":me,"data-sidebar-density":xe,"data-size":"md",children:s.jsxs.call(void 0,"div",{className:"flex min-h-screen min-w-0",children:[s.jsx.call(void 0,e.Sidebar,{items:l,variant:be,activeStyle:me,density:xe,colors:pe,header:o,headerAlign:d,headerDivider:c,collapsedHeader:r,contextSwitcher:v,contextSwitcherVisible:g,contextSwitcherDividers:h,contextSwitcherPlacement:p,scrollActiveItemIntoView:m,footer:x,searchable:_,searchPlaceholder:A,searchDividers:R,collapsible:M&&"sidebar"===L,bottomCollapsible:M&&"bottom"===L,resizable:I,width:D,defaultWidth:E,minWidth:B,maxWidth:F,onWidthChange:G,collapsed:ce,onCollapsedChange:setSidebarCollapsed,responsive:!0,mobileOpen:ue,onMobileOpenChange:setMobileOpen,className:t.cn.call(void 0,"shrink-0","header"===f&&"lg:hidden"),"data-ug-slot":"sidebar"}),s.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-1 flex-col",children:[s.jsxs.call(void 0,"header",{className:t.cn.call(void 0,"sticky top-0 z-30 flex items-center gap-[calc(var(--content-gap)*0.75)] px-[var(--content-gap)] sm:px-[calc(var(--content-gap)*1.25)] lg:px-[calc(var(--content-gap)*1.5)]",K?"border-b":"border-b-0","header"===f?"border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]":"border-border-base bg-surface-0"),style:"header"===f?fe:void 0,"data-ug-slot":"topbar",children:[s.jsx.call(void 0,t.Button,{type:"button",variant:"ghost",size:"icon",className:"md:hidden","aria-label":"打开侧边栏",onClick:()=>setMobileOpen(!0),"data-ug-slot":"mobile-trigger",children:s.jsx.call(void 0,n.Menu,{"aria-hidden":"true",focusable:"false",size:18})}),"sidebar"===f&&M&&"topbar"===L?s.jsx.call(void 0,t.Button,{type:"button",variant:"ghost",size:"icon",className:"hidden md:inline-flex","aria-label":ce?"展开侧边栏":"折叠侧边栏",onClick:()=>setSidebarCollapsed(!ce),"data-ug-slot":"desktop-sidebar-trigger",children:ce?s.jsx.call(void 0,n.PanelLeftOpen,{"aria-hidden":"true",focusable:"false",size:18}):s.jsx.call(void 0,n.PanelLeftClose,{"aria-hidden":"true",focusable:"false",size:18})}):null,"header"===f?s.jsxs.call(void 0,s.Fragment,{children:[s.jsx.call(void 0,"div",{className:"hidden shrink-0 items-center lg:flex",children:o}),s.jsx.call(void 0,"div",{className:"hidden min-w-0 flex-1 lg:flex",children:s.jsx.call(void 0,AdminHorizontalNavigation,{activeStyle:me,density:xe,items:l})}),s.jsx.call(void 0,"div",{className:"min-w-0 flex-1 lg:hidden","data-ug-slot":"topbar-start",children:W})]}):q?s.jsx.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"topbar-content",children:q}):s.jsx.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"topbar-start",children:W}),"header"!==f&&q||!H?null:s.jsx.call(void 0,"div",{className:"flex shrink-0 items-center gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"topbar-end",children:H},"topbar-end")]}),Q?s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"sticky top-[var(--ug-admin-shell-topbar-height)] z-20 bg-surface-1",Y&&"border-b border-border-base"),"data-ug-slot":"secondary-bar",children:Q}):null,s.jsx.call(void 0,"main",{className:t.cn.call(void 0,"flex-1 overflow-x-clip",Z),"data-ug-slot":"main",children:s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"mx-auto",J?"max-w-none":"max-w-7xl",X?"px-[var(--content-gap)] py-[calc(var(--content-gap)*1.5)] sm:px-[calc(var(--content-gap)*1.25)] lg:px-[calc(var(--content-gap)*1.5)]":"!p-0",ee),"data-ug-context":"admin-shell","data-ug-slot":"content",children:ae})})]})]})})});function getScrollBehavior(e){return e.closest('[data-ug-motion="reduced"]')||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}function getTabElements(e){return Array.from(e.children).filter(e=>e instanceof HTMLLIElement&&"item"===e.dataset.ugSlot)}function clearItemMotion(e){delete e.dataset.motion,e.style.removeProperty("--ug-app-tabs-motion-x")}function playItemMotion(e,a,l=0){const t=Boolean(e.dataset.motion);clearItemMotion(e),t&&e.offsetWidth,"move"===a&&e.style.setProperty("--ug-app-tabs-motion-x",`${l}px`),e.dataset.motion=a}p.displayName="AdminShell";var m=i.memo.call(void 0,({active:e,activeItemRef:a,closable:l,closeEnabled:t,icon:i,label:o,onActivate:r,onClose:d,value:c})=>s.jsxs.call(void 0,"li",{"data-closable":l||void 0,"data-state":e?"active":"default","data-ug-slot":"item","data-value":c,ref:e?a:void 0,children:[s.jsxs.call(void 0,"button",{"aria-current":e?"page":void 0,"data-ug-slot":"trigger",onAuxClick:e=>{1===e.button&&l&&t&&(e.preventDefault(),d(c))},onClick:()=>r(c),title:o,type:"button",children:[i?s.jsx.call(void 0,"span",{"aria-hidden":"true","data-ug-slot":"icon",children:i}):null,s.jsx.call(void 0,"span",{"data-ug-slot":"label",children:o})]}),l&&t?s.jsx.call(void 0,"button",{"aria-label":`关闭页面 ${o}`,"data-ug-slot":"close",onClick:()=>d(c),type:"button",children:s.jsx.call(void 0,n.X,{"aria-hidden":"true",size:13})}):null]}));m.displayName="AppTabView";var x=i.forwardRef.call(void 0,({items:e,value:a,density:l="comfortable",showIcons:o=!0,closable:r=!0,bordered:d=!0,onValueChange:c,onClose:u,className:v,"aria-label":g="页面标签",...h},p)=>{const x=i.useRef.call(void 0,null),b=i.useRef.call(void 0,null),f=i.useRef.call(void 0,null),j=i.useRef.call(void 0,null),w=i.useRef.call(void 0,null),C=i.useRef.call(void 0,new Map),y=i.useRef.call(void 0,null),N=i.useRef.call(void 0,e),k=i.useRef.call(void 0,c),S=i.useRef.call(void 0,u),[T,z]=i.useState.call(void 0,{canScrollStart:!1,canScrollEnd:!1}),_=T.canScrollStart||T.canScrollEnd,A=i.useMemo.call(void 0,()=>e.map(e=>`${e.value}${e.label}${r&&e.closable?"1":"0"}${o&&e.icon?"1":"0"}`).join(""),[r,e,o]);N.current=e,k.current=c,S.current=u;const R=i.useCallback.call(void 0,e=>{const a=N.current.find(a=>a.value===e);a&&k.current(a)},[]),M=i.useCallback.call(void 0,e=>{const a=N.current.find(a=>a.value===e);if(!a)return;const l=b.current;_optionalChain([l?getTabElements(l).find(a=>a.dataset.value===e):null,"optionalAccess",e=>e.contains,"call",e=>e(document.activeElement)])&&(y.current=e),_optionalChain([S,"access",e=>e.current,"optionalCall",e=>e(a)])},[]),L=i.useCallback.call(void 0,()=>{null===j.current&&(j.current=window.requestAnimationFrame(()=>{j.current=null;const e=b.current;if(!e)return;const a=Math.max(0,e.scrollWidth-e.clientWidth),l={canScrollStart:e.scrollLeft>1,canScrollEnd:e.scrollLeft<a-1};z(e=>e.canScrollStart===l.canScrollStart&&e.canScrollEnd===l.canScrollEnd?e:l)}))},[]),I=i.useCallback.call(void 0,e=>{const a=b.current,l=f.current;if(!a||!l)return;const t=getTabElements(a);if(l===t[0]&&a.scrollLeft>1)return void a.scrollBy({behavior:e,left:-a.scrollLeft});const i=Math.max(0,a.scrollWidth-a.clientWidth);if(l===t[t.length-1]&&a.scrollLeft<i-1)return void a.scrollBy({behavior:e,left:i-a.scrollLeft});const o=l.offsetLeft-a.scrollLeft,n=o+l.offsetWidth-a.clientWidth;o<0?a.scrollBy({behavior:e,left:o-2}):n>0&&a.scrollBy({behavior:e,left:n+2})},[]);function scrollTabs(e){const a=b.current;a&&a.scrollBy({behavior:getScrollBehavior(a),left:e*Math.max(160,.6*a.clientWidth)})}return i.useLayoutEffect.call(void 0,()=>{const e=b.current;if(!e)return;const a=getTabElements(e),l=new Map;for(const e of a){const a=e.dataset.value;a&&l.set(a,e.offsetLeft)}const t=C.current;if(t.size>0&&"auto"!==getScrollBehavior(e))for(const e of a){const a=e.dataset.value;if(!a)continue;const i=t.get(a),o=_nullishCoalesce(l.get(a),()=>0),n=void 0===i?0:i-o;void 0!==i&&Math.abs(n)<.5||playItemMotion(e,void 0===i?"enter":"move",n)}C.current=l},[A]),i.useLayoutEffect.call(void 0,()=>{const e=y.current;if(!e||N.current.some(a=>a.value===e))return;const a=_optionalChain([b,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e('[data-ug-slot="item"][data-state="active"] [data-ug-slot="trigger"]')]);a&&(y.current=null,a.focus({preventScroll:!0}))},[A,a]),i.useEffect.call(void 0,()=>{const e=x.current,a=b.current;if(!e||!a)return;L(),a.addEventListener("scroll",L,{passive:!0});const handleContainerResize=()=>{L(),null!==w.current&&window.cancelAnimationFrame(w.current),w.current=window.requestAnimationFrame(()=>{w.current=window.requestAnimationFrame(()=>{w.current=null,I("auto"),L()})})},l="undefined"==typeof ResizeObserver?null:new ResizeObserver(handleContainerResize);return l?l.observe(e):window.addEventListener("resize",handleContainerResize),()=>{a.removeEventListener("scroll",L),l?l.disconnect():window.removeEventListener("resize",handleContainerResize),null!==j.current&&(window.cancelAnimationFrame(j.current),j.current=null),null!==w.current&&(window.cancelAnimationFrame(w.current),w.current=null)}},[I,L]),i.useEffect.call(void 0,()=>{if(!e.some(e=>e.value===a))return;const l=b.current;l&&(I(getScrollBehavior(l)),L())},[e,I,L,a]),s.jsx.call(void 0,"nav",{ref:p,...h,"aria-label":g,className:t.cn.call(void 0,"text-text-primary",!d&&"[background-image:none]",v),"data-density":l,"data-overflow":_||void 0,"data-size":"md","data-state":_?"overflow":"default","data-ug":"app-tabs","data-variant":"browser",children:s.jsxs.call(void 0,"div",{"data-ug-slot":"track",ref:x,children:[s.jsx.call(void 0,"button",{"aria-label":"向左滚动页面标签","data-ug-slot":"scroll-start","data-visible":_&&T.canScrollStart||void 0,disabled:!T.canScrollStart,onClick:()=>scrollTabs(-1),type:"button",children:s.jsx.call(void 0,n.ChevronLeft,{"aria-hidden":"true",size:15})}),s.jsx.call(void 0,"ul",{ref:b,"aria-label":"页面标签列表","data-ug-slot":"list",onAnimationEnd:e=>{["ug-motion-app-tab-enter","ug-motion-app-tab-layout-shift"].includes(e.animationName)&&clearItemMotion(e.target)},children:e.map(e=>s.jsx.call(void 0,m,{active:e.value===a,activeItemRef:f,closable:r&&Boolean(e.closable),closeEnabled:r&&Boolean(u),icon:o?e.icon:void 0,label:e.label,onActivate:R,onClose:M,value:e.value},e.value))}),s.jsx.call(void 0,"button",{"aria-label":"向右滚动页面标签","data-ug-slot":"scroll-end","data-visible":_&&T.canScrollEnd||void 0,disabled:!T.canScrollEnd,onClick:()=>scrollTabs(1),type:"button",children:s.jsx.call(void 0,n.ChevronRight,{"aria-hidden":"true",size:15})})]})})});x.displayName="AppTabs";var b=i.forwardRef.call(void 0,({open:a,onOpenChange:l,title:i,description:o,children:r,variant:d="destructive",icon:c,cancelText:u="取消",confirmText:v="确认",loading:g=!1,disabled:h=!1,closeOnConfirm:p=!0,onCancel:m,onConfirm:x,className:b,...f},j)=>{const w=_nullishCoalesce(c,()=>"destructive"===d?n.AlertTriangle:n.HelpCircle);function handleCancel(){g||(_optionalChain([m,"optionalCall",e=>e()]),l(!1))}return s.jsx.call(void 0,e.Modal,{open:a,onClose:handleCancel,closeOnEsc:!g,closeOnOverlay:!g,children:s.jsxs.call(void 0,e.ModalContent,{ref:j,className:t.cn.call(void 0,"max-w-md",b),...f,"data-ug":"confirm-dialog","data-state":a?"open":"default","data-variant":d,"data-size":"md",children:[s.jsxs.call(void 0,e.ModalHeader,{className:"items-start gap-[calc(var(--content-gap)*0.75)]","data-ug-slot":"header",children:[s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"flex h-[var(--control-height-md)] w-[var(--control-height-md)] shrink-0 items-center justify-center rounded-[var(--radius-control)]","destructive"===d?"bg-danger-soft text-danger-soft-fg":"bg-primary-soft text-primary-soft-fg"),"data-ug-slot":"icon",children:s.jsx.call(void 0,w,{size:20,"aria-hidden":"true"})}),s.jsxs.call(void 0,"div",{className:"min-w-0 flex-1 space-y-[calc(var(--content-gap)*0.25)]","data-ug-slot":"content",children:[s.jsx.call(void 0,e.ModalTitle,{className:"break-words text-base","data-ug-slot":"title",children:i}),o?s.jsx.call(void 0,"p",{className:"text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:o}):null]})]}),r?s.jsx.call(void 0,"div",{className:"px-[var(--content-gap)] py-[var(--content-gap)] text-sm text-text-secondary","data-ug-slot":"body",children:r}):null,s.jsxs.call(void 0,e.ModalFooter,{className:"flex-col-reverse gap-[calc(var(--content-gap)*0.5)] sm:flex-row","data-ug-slot":"footer",children:[s.jsx.call(void 0,t.Button,{type:"button",variant:"outline",disabled:g,onClick:handleCancel,"data-ug-slot":"cancel",children:u}),s.jsx.call(void 0,t.Button,{type:"button",variant:"destructive"===d?"destructive":"default",loading:g,disabled:h,onClick:function handleConfirm(){const e=_optionalChain([x,"optionalCall",e=>e()]);return p&&l(!1),e},"data-ug-slot":"confirm",children:v})]})]})})});b.displayName="ConfirmDialog";var f=i.forwardRef.call(void 0,({value:e,label:a,displayValue:l,monospace:o=!0,disabled:r=!1,bordered:d=!0,showIcon:c=!0,showCopyText:u=!0,copyLabel:v="复制",copiedLabel:g="已复制",onCopied:h,onCopyError:p,className:m,...x},b)=>{const[f,j]=i.useState.call(void 0,!1),w=i.useRef.call(void 0,null),C=i.useRef.call(void 0,{value:e,generation:0,mounted:!0});return C.current.value!==e&&(C.current.value=e,C.current.generation++),i.useEffect.call(void 0,()=>(C.current.mounted=!0,()=>{C.current.mounted=!1,C.current.generation++,w.current&&clearTimeout(w.current)}),[]),i.useEffect.call(void 0,()=>{j(!1),w.current&&(clearTimeout(w.current),w.current=null)},[e]),s.jsxs.call(void 0,"div",{ref:b,className:t.cn.call(void 0,"space-y-[calc(var(--content-gap)*0.5)]",m),...x,"data-ug":"copy-field","data-state":r?"disabled":f?"copied":"default","data-variant":o?"monospace":"default","data-bordered":d?"true":"false","data-size":"md",children:[a?s.jsx.call(void 0,"div",{className:"text-xs font-medium text-text-secondary","data-ug-slot":"label",children:a}):null,s.jsxs.call(void 0,"div",{className:t.cn.call(void 0,"flex min-w-0 items-stretch overflow-hidden rounded-[var(--radius-control)] bg-surface-1",d&&"border border-border-base",r&&"opacity-60"),"data-ug-slot":"field",children:[s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"min-w-0 flex-1 self-center truncate px-[var(--control-padding-x-sm)] py-[calc(var(--content-gap)*0.5)] text-sm text-text-primary",o&&"font-mono"),title:"string"==typeof l?l:e,"data-ug-slot":"value",children:_nullishCoalesce(l,()=>e)}),s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"flex shrink-0 items-center bg-surface-2 px-[calc(var(--content-gap)*0.375)]",d&&"border-l border-border-base"),"data-ug-slot":"action",children:s.jsxs.call(void 0,t.Button,{type:"button",variant:"ghost",size:"sm",disabled:r,onClick:async function handleCopy(){if(r)return;const a=e,l=++C.current.generation,isCurrent=()=>C.current.mounted&&C.current.generation===l&&C.current.value===a;j(!1),w.current&&(clearTimeout(w.current),w.current=null);try{if(!_optionalChain([navigator,"access",e=>e.clipboard,"optionalAccess",e=>e.writeText]))throw new Error("Clipboard API is not available");if(await navigator.clipboard.writeText(a),!isCurrent())return;if(j(!0),_optionalChain([h,"optionalCall",e=>e(a)]),!isCurrent())return;w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{isCurrent()&&j(!1),w.current=null},1400)}catch(e){isCurrent()&&_optionalChain([p,"optionalCall",a=>a(e)])}},"aria-label":u?void 0:f?g:v,"aria-live":"polite","data-ug-slot":"button",children:[c?f?s.jsx.call(void 0,n.Check,{"aria-hidden":"true",focusable:"false",size:15}):s.jsx.call(void 0,n.Copy,{"aria-hidden":"true",focusable:"false",size:15}):null,u?f?g:v:null]})})]})]})});function DataTableIdentity({title:e,description:a,leading:l,showLeading:i=!0,showDescription:o=!0,className:n,...r}){return s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,"gap-[calc(var(--content-gap)*0.5)]",n),...r,"data-size":"md","data-state":"default","data-ug":"data-table-identity","data-variant":"default",children:[i&&l?s.jsx.call(void 0,"span",{"data-ug-slot":"leading",children:l}):null,s.jsxs.call(void 0,"span",{"data-ug-slot":"copy",children:[s.jsx.call(void 0,"strong",{"data-ug-slot":"title",children:e}),o&&a?s.jsx.call(void 0,"small",{className:"text-text-secondary","data-ug-slot":"description",children:a}):null]})]})}function DataTableToolbar({title:e,description:a,showDescription:l=!0,bordered:i=!0,compact:o=!1,actions:n,children:r,className:d,...c}){return s.jsxs.call(void 0,"div",{className:t.cn.call(void 0,"gap-[var(--content-gap)] border-border-base",!i&&"border-b-0",o&&"py-[calc(var(--content-gap)*0.5)]",d),...c,"data-size":o?"sm":"md","data-state":"default","data-ug":"data-table-toolbar","data-variant":"default",children:[s.jsxs.call(void 0,"div",{"data-ug-slot":"heading",children:[s.jsx.call(void 0,"strong",{"data-ug-slot":"title",children:e}),l&&a?s.jsx.call(void 0,"span",{"data-ug-slot":"description",children:a}):null]}),r?s.jsx.call(void 0,"div",{"data-ug-slot":"filters",children:r}):null,n?s.jsx.call(void 0,"div",{className:"flex shrink-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"actions",children:n}):null]})}f.displayName="CopyField";var j=i.forwardRef.call(void 0,({eyebrow:e,title:a,description:l,badge:i,breadcrumb:o,actions:n,meta:r,bordered:d=!0,compact:c=!1,children:u,className:v,...g},h)=>s.jsxs.call(void 0,"header",{ref:h,className:t.cn.call(void 0,"flex min-w-0 flex-col",c?"gap-[calc(var(--content-gap)*0.875)]":"gap-[calc(var(--content-gap)*1.25)]",d&&(c?"border-b border-border-base pb-[var(--content-gap)]":"border-b border-border-base pb-[calc(var(--content-gap)*1.5)]"),v),...g,"data-ug":"page-header","data-state":"default","data-variant":d?"default":"borderless","data-size":c?"sm":"md",children:[o?s.jsx.call(void 0,"div",{className:"min-w-0","data-ug-slot":"breadcrumb",children:o}):null,s.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-col gap-[var(--content-gap)] lg:flex-row lg:items-start lg:justify-between","data-ug-slot":"body",children:[s.jsxs.call(void 0,"div",{className:"min-w-0 space-y-[calc(var(--content-gap)*0.75)]","data-ug-slot":"content",children:[e?s.jsx.call(void 0,"div",{className:"text-xs font-semibold uppercase text-primary","data-ug-slot":"eyebrow",children:e}):null,s.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.625)]",children:[s.jsx.call(void 0,"h1",{className:"min-w-0 break-words text-2xl font-bold leading-tight text-text-primary sm:text-3xl","data-ug-slot":"title",children:a}),i?s.jsx.call(void 0,"div",{className:"shrink-0","data-ug-slot":"badge",children:i}):null]}),l?s.jsx.call(void 0,"p",{className:"max-w-3xl text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:l}):null,r?s.jsx.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center gap-x-[var(--content-gap)] gap-y-[calc(var(--content-gap)*0.5)] text-xs text-text-tertiary","data-ug-slot":"meta",children:r}):null]}),n?s.jsx.call(void 0,"div",{className:"flex shrink-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.5)] lg:justify-end","data-ug-slot":"actions",children:n}):null]}),u?s.jsx.call(void 0,"div",{className:"min-w-0","data-ug-slot":"footer",children:u}):null]}));j.displayName="PageHeader";var w={2:"md:grid-cols-2 xl:grid-cols-2",3:"md:grid-cols-2 lg:grid-cols-3",4:"md:grid-cols-2 xl:grid-cols-4"};function QuickAccessContent({item:e,showIcon:a,showIndicator:l}){const i=e.icon,o=Boolean(a&&i);return s.jsxs.call(void 0,s.Fragment,{children:[o&&i?s.jsx.call(void 0,"span",{"aria-hidden":"true",className:"flex h-[var(--control-height-lg)] w-[var(--control-height-lg)] shrink-0 items-center justify-center rounded-[var(--radius-control)] bg-primary-soft text-primary-soft-fg","data-ug-slot":"icon",children:s.jsx.call(void 0,i,{size:20})}):null,s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,"min-w-0",!o&&"col-start-1"),"data-ug-slot":"content",children:[s.jsxs.call(void 0,"span",{className:"flex min-w-0 flex-wrap items-center gap-x-[calc(var(--content-gap)*0.5)] gap-y-1",children:[s.jsx.call(void 0,"strong",{className:"min-w-0 break-words text-sm font-semibold leading-5","data-ug-slot":"item-title",children:e.title}),e.meta?s.jsx.call(void 0,"span",{className:"text-xs leading-5 text-text-tertiary","data-ug-slot":"meta",children:e.meta}):null]}),e.description?s.jsx.call(void 0,"span",{className:"mt-1 block break-words text-xs leading-5 text-text-secondary","data-ug-slot":"item-description",children:e.description}):null]}),l?s.jsx.call(void 0,n.ArrowRight,{"aria-hidden":"true",className:t.cn.call(void 0,"shrink-0 text-text-tertiary transition-[color] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)] group-hover:text-primary",!o&&"col-start-2"),"data-ug-slot":"indicator",size:16}):null]})}var C=i.forwardRef.call(void 0,({title:e,description:a,items:l,columns:i=4,showIndicator:o=!0,showIcon:n=!0,bordered:r=!0,onSelect:d,className:c,...u},v)=>s.jsxs.call(void 0,"section",{ref:v,...u,className:t.cn.call(void 0,"min-w-0 space-y-[var(--content-gap)]",c),"data-ug":"quick-access","data-state":l.length>0?"ready":"empty","data-variant":i,"data-size":"md",children:[e||a?s.jsxs.call(void 0,"div",{className:"min-w-0 space-y-1","data-ug-slot":"header",children:[e?s.jsx.call(void 0,"h2",{className:"text-base font-semibold leading-6 text-text-primary","data-ug-slot":"title",children:e}):null,a?s.jsx.call(void 0,"p",{className:"text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:a}):null]}):null,s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"grid min-w-0 gap-[var(--content-gap)]",w[i]),"data-ug-slot":"grid",children:l.map(e=>{const a=e.disabled?"disabled":"interactive",l=function getItemClasses(e,a,l){const i=a&&l?"grid-cols-[auto_minmax(0,1fr)_auto]":a?"grid-cols-[auto_minmax(0,1fr)]":l?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]";return t.cn.call(void 0,"group grid min-h-[calc(var(--control-height-lg)*2)] min-w-0 w-full items-center gap-[var(--content-gap)]",i,"rounded-[var(--radius-panel)] bg-surface-1 p-[var(--content-gap)] text-left text-text-primary shadow-sm",e?"border border-border-base hover:border-border-strong":"border border-transparent","transition-[background-color,border-color,box-shadow] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)]","hover:bg-surface-2 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-border-base disabled:hover:bg-surface-1 disabled:hover:shadow-sm")}(r,Boolean(n&&e.icon),o);return e.href&&!e.disabled?s.jsx.call(void 0,"a",{className:l,"data-state":a,"data-ug-slot":"item",href:e.href,onClick:()=>_optionalChain([d,"optionalCall",a=>a(e)]),children:s.jsx.call(void 0,QuickAccessContent,{item:e,showIcon:n,showIndicator:o})},e.id):s.jsx.call(void 0,"button",{className:l,"data-state":a,"data-ug-slot":"item",disabled:e.disabled,onClick:()=>_optionalChain([d,"optionalCall",a=>a(e)]),type:"button",children:s.jsx.call(void 0,QuickAccessContent,{item:e,showIcon:n,showIndicator:o})},e.id)})})]}));C.displayName="QuickAccess";var y=i.forwardRef.call(void 0,({value:a,onValueChange:l,onSubmit:i,onStop:o,onPasteFiles:r,header:d,leading:c,trailing:u,footer:v,submitting:g=!1,disabled:h=!1,submitDisabled:p=!1,allowEmpty:m=!1,submitOnEnter:x=!0,inputLabel:b="消息输入",placeholder:f,submitLabel:j="发送",stopLabel:w="停止",bordered:C=!0,showCharacterCount:y=!1,maxLength:N,shortcutHint:k,showShortcutHint:S,textareaProps:T,className:z,..._},A)=>{const R=!h&&!g&&!p&&(m||a.trim().length>0);function submit(){R&&i(a)}const M=_nullishCoalesce(S,()=>Boolean(k))?_nullishCoalesce(k,()=>x?"Enter 发送 · Shift+Enter 换行":null):null,L=y||Boolean(M);return s.jsxs.call(void 0,"div",{className:t.cn.call(void 0,"grid min-w-0 gap-[calc(var(--content-gap)*0.625)] rounded-[var(--radius-panel)] bg-surface-1 p-[calc(var(--content-gap)*0.75)] shadow-sm transition-[border-color,box-shadow]",C?"border border-border-strong focus-within:border-primary/70":"border border-transparent",h&&"opacity-60",z),..._,"data-ug":"prompt-composer","data-state":h?"disabled":g?"submitting":"default","data-variant":"default","data-size":"md",children:[d?s.jsx.call(void 0,"div",{className:"min-w-0","data-ug-slot":"header",children:d}):null,s.jsxs.call(void 0,"div",{className:"flex min-w-0 items-end gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"body",children:[c?s.jsx.call(void 0,"div",{className:"flex h-[var(--control-height-md)] shrink-0 items-center","data-ug-slot":"leading",children:c}):null,s.jsx.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"input",children:s.jsx.call(void 0,e.Textarea,{...T,ref:A,"aria-label":_nullishCoalesce(_optionalChain([T,"optionalAccess",e=>e["aria-label"]]),()=>b),autosize:_nullishCoalesce(_optionalChain([T,"optionalAccess",e=>e.autosize]),()=>({minRows:1,maxRows:8})),className:t.cn.call(void 0,"min-h-[var(--control-height-md)] border-transparent bg-transparent px-[calc(var(--control-padding-x-sm)*0.5)] py-[var(--ug-prompt-input-padding-y)] shadow-none focus-visible:!border-transparent focus-visible:!ring-0 focus-visible:!ring-offset-0",_optionalChain([T,"optionalAccess",e=>e.className])),disabled:h,maxLength:_nullishCoalesce(N,()=>_optionalChain([T,"optionalAccess",e=>e.maxLength])),onKeyDown:function handleKeyDown(e){x&&"Enter"===e.key&&(e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),submit()))},onPaste:function handlePaste(e){if(!r)return;const a=Array.from(e.clipboardData.files);a.length>0&&r(a,e)},onValueChange:l,placeholder:_nullishCoalesce(f,()=>_optionalChain([T,"optionalAccess",e=>e.placeholder])),resize:"none",value:a})}),u?s.jsx.call(void 0,"div",{className:"flex h-[var(--control-height-md)] shrink-0 items-center gap-1","data-ug-slot":"trailing",children:u}):null,g&&o?s.jsx.call(void 0,t.Button,{"aria-label":w,onClick:o,size:"icon",tone:"danger",type:"button",variant:"soft","data-ug-slot":"submit",children:s.jsx.call(void 0,n.Square,{"aria-hidden":"true",size:15})}):s.jsx.call(void 0,t.Button,{"aria-label":j,disabled:!R,onClick:submit,size:"icon",tone:"primary",type:"button",variant:"solid","data-ug-slot":"submit",children:s.jsx.call(void 0,n.Send,{"aria-hidden":"true",size:16})})]}),v||L?s.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2 text-xs text-text-tertiary","data-ug-slot":"footer",children:[v?s.jsx.call(void 0,"div",{className:"min-w-0 flex-1",children:v}):null,L?s.jsxs.call(void 0,"div",{className:"ml-auto flex shrink-0 items-center gap-3 tabular-nums","data-ug-slot":"footer-meta",children:[M?s.jsx.call(void 0,"span",{"data-ug-slot":"shortcut-hint",children:M}):null,y?s.jsx.call(void 0,"span",{"data-ug-slot":"character-count",children:void 0!==N?`${a.length}/${N}`:`${a.length}`}):null]}):null]}):null]})});y.displayName="PromptComposer";var N=i.forwardRef.call(void 0,({messageRole:e,status:a="idle",avatar:l,header:i,footer:o,children:n,className:r,...d},c)=>s.jsxs.call(void 0,"article",{ref:c,className:t.cn.call(void 0,"flex min-w-0 gap-[calc(var(--content-gap)*0.75)]","user"===e&&"justify-end",r),...d,"data-ug":"message","data-state":a,"data-variant":e,"data-size":"md",children:[l&&"user"!==e?s.jsx.call(void 0,"div",{className:"shrink-0","data-ug-slot":"avatar",children:l}):null,s.jsxs.call(void 0,"div",{className:t.cn.call(void 0,"grid min-w-0 gap-[calc(var(--content-gap)*0.5)]","user"===e?"max-w-[min(85%,44rem)] rounded-[var(--radius-panel)] bg-surface-2 px-[var(--control-padding-x-lg)] py-[calc(var(--content-gap)*0.75)]":"w-full","error"===a&&"text-danger"),"data-ug-slot":"body",children:[i?s.jsx.call(void 0,"div",{className:"text-xs font-medium text-text-secondary","data-ug-slot":"header",children:i}):null,s.jsxs.call(void 0,"div",{className:"min-w-0 break-words text-sm leading-7 text-text-primary","data-ug-slot":"content",children:[n,"streaming"===a?s.jsx.call(void 0,"span",{"aria-label":"正在生成",className:"ml-1 inline-block size-1.5 animate-pulse rounded-full bg-primary motion-reduce:animate-none","data-ug-slot":"streaming"}):null]}),o?s.jsx.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-text-tertiary","data-ug-slot":"footer",children:o}):null]}),l&&"user"===e?s.jsx.call(void 0,"div",{className:"shrink-0","data-ug-slot":"avatar",children:l}):null]}));N.displayName="Message";var k=i.forwardRef.call(void 0,({empty:e,followOutput:a=!0,followThreshold:l=80,children:o,className:n,onScroll:r,...d},c)=>{const u=i.useRef.call(void 0,null),v=i.useRef.call(void 0,!0),g=i.Children.count(o)>0;return i.useEffect.call(void 0,()=>{const e=u.current;a&&e&&v.current&&_optionalChain([e,"access",e=>e.scrollTo,"optionalCall",a=>a({top:e.scrollHeight,behavior:"auto"})])},[o,a]),s.jsx.call(void 0,"div",{ref:function setRef(e){u.current=e,"function"==typeof c?c(e):c&&(c.current=e)},"aria-live":"polite","aria-relevant":"additions text",className:t.cn.call(void 0,"grid min-w-0 gap-[calc(var(--content-gap)*1.5)] overflow-y-auto overscroll-contain [min-height:0] [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]",g?"content-start":"content-center",n),onScroll:function handleScroll(e){const a=e.currentTarget;v.current=a.scrollHeight-a.scrollTop-a.clientHeight<=Math.max(0,l),_optionalChain([r,"optionalCall",a=>a(e)])},role:"log",tabIndex:0,...d,"data-ug":"message-list","data-state":g?"populated":"empty","data-variant":a?"follow":"static","data-size":"md",children:g?o:s.jsx.call(void 0,"div",{className:"grid place-items-center text-center text-sm text-text-secondary [min-height:calc(var(--control-height-lg)*4)]","data-ug-slot":"empty",children:e})})});k.displayName="MessageList";var S=i.forwardRef.call(void 0,({items:e,onRemove:a,renderPreview:l,orientation:i="horizontal",showPreview:o=!0,showStatus:r=!0,showMeta:d=!0,bordered:c=!0,compact:u=!1,getRemoveLabel:v=e=>`移除附件:${e.name}`,empty:g,className:h,tabIndex:p,...m},x)=>0!==e.length||g?s.jsx.call(void 0,"ul",{ref:x,"aria-label":"附件",className:t.cn.call(void 0,"min-w-0 gap-[calc(var(--content-gap)*0.5)]","horizontal"===i?"flex overflow-x-auto pb-1 [scrollbar-width:thin]":"grid",h),tabIndex:_nullishCoalesce(p,()=>"horizontal"===i?0:void 0),...m,"data-ug":"attachment-list","data-state":e.length>0?"populated":"empty","data-variant":i,"data-size":u?"xs":"sm",children:0===e.length?s.jsx.call(void 0,"li",{className:"text-sm text-text-secondary","data-ug-slot":"empty",children:g}):e.map(e=>{const g=_optionalChain([e,"access",e=>e.mime,"optionalAccess",e=>e.startsWith,"call",e=>e("image/")])&&e.previewUrl,h=_nullishCoalesce(e.status,()=>"ready"),p=r?_nullishCoalesce(e.statusLabel,()=>({uploading:"正在上传",success:"上传完成",error:"上传失败"}[h])):void 0,m="uploading"===h?n.LoaderCircle:"success"===h?n.CircleCheck:"error"===h?n.TriangleAlert:null,x=d?e.meta:null;return s.jsxs.call(void 0,"li",{"aria-busy":"uploading"===h||void 0,"aria-invalid":"error"===h||void 0,className:t.cn.call(void 0,"group flex shrink-0 items-center rounded-[var(--radius-control)] bg-surface-2","horizontal"===i?"min-w-52 max-w-72":"w-full min-w-0",c?"border border-border-base":"border border-transparent",u?"gap-1.5 p-1.5":"gap-2 p-2"),"data-state":h,"data-ug-slot":"item",children:[o?s.jsx.call(void 0,"div",{className:t.cn.call(void 0,"grid shrink-0 place-items-center overflow-hidden rounded-[var(--radius-control)] bg-surface-1 text-text-secondary",u?"size-[var(--control-height-md)]":"size-[var(--control-height-lg)]"),"data-ug-slot":"preview",children:l?l(e):g?s.jsx.call(void 0,"img",{alt:e.name,className:"size-full object-cover",src:e.previewUrl}):s.jsx.call(void 0,n.File,{"aria-hidden":"true",size:u?15:17})}):null,s.jsxs.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"content",children:[s.jsx.call(void 0,"p",{className:"truncate text-xs font-medium text-text-primary",title:e.name,children:e.name}),p||x?s.jsxs.call(void 0,"div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-text-tertiary","data-ug-slot":"meta",children:[p?s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,"inline-flex min-w-0 items-center gap-1 truncate","uploading"===h&&"text-primary","success"===h&&"text-success-soft-fg","error"===h&&"text-danger"),"data-ug-slot":"status",role:"ready"===h?void 0:"status",children:[m?s.jsx.call(void 0,m,{"aria-hidden":"true",className:t.cn.call(void 0,"size-3.5 shrink-0","uploading"===h&&"animate-spin motion-reduce:animate-none")}):null,s.jsx.call(void 0,"span",{className:"truncate",children:p})]}):null,x?s.jsx.call(void 0,"span",{className:"min-w-0 truncate","data-ug-slot":"detail",children:x}):null]}):null]}),a?s.jsx.call(void 0,t.Button,{"aria-label":v(e),onClick:()=>a(e),size:"icon-sm",type:"button",variant:"ghost","data-ug-slot":"remove",children:s.jsx.call(void 0,n.X,{"aria-hidden":"true",size:13})}):null]},e.id)})}):null);S.displayName="AttachmentList";var T=i.forwardRef.call(void 0,({items:e,activeId:a,onSelect:l,renderActions:i,empty:o="暂无会话",orientation:n="vertical",activeStyle:r="soft",showBadge:d=!0,showDescription:c=!0,listLabel:u="会话列表",className:v,tabIndex:g,...h},p)=>s.jsx.call(void 0,"div",{ref:p,"aria-label":u,className:t.cn.call(void 0,"horizontal"===n?"flex min-w-0 gap-1 overflow-x-auto pb-1 [scrollbar-width:thin]":"grid min-w-0 content-start gap-1",v),role:"list",tabIndex:_nullishCoalesce(g,()=>"horizontal"===n?0:void 0),...h,"data-ug":"conversation-list","data-active-style":r,"data-state":e.length>0?"populated":"empty","data-variant":n,"data-size":"md",children:0===e.length?s.jsx.call(void 0,"div",{className:"px-[var(--control-padding-x-md)] py-[var(--content-gap)] text-sm text-text-secondary","data-ug-slot":"empty",children:o}):e.map(e=>{const o=e.id===a;return s.jsxs.call(void 0,"div",{className:t.cn.call(void 0,"group relative flex min-w-0 items-center rounded-[var(--radius-control)] transition-[background-color,color] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)] motion-reduce:transition-none","horizontal"===n&&"min-w-52 shrink-0",o?t.cn.call(void 0,"bg-primary-soft","bordered"===r&&"ring-1 ring-inset ring-primary/30","indicator"===r&&"before:absolute before:left-0 before:top-1/2 before:h-[calc(var(--control-height-sm)*0.6)] before:w-[3px] before:-translate-y-1/2 before:rounded-r-[var(--radius-control)] before:bg-primary before:content-['']"):"hover:bg-surface-2",e.disabled&&"opacity-50"),"data-state":e.disabled?"disabled":o?"active":"default","data-ug-slot":"item",role:"listitem",children:[s.jsxs.call(void 0,"button",{"aria-current":o?"page":void 0,className:"min-w-0 flex-1 rounded-[var(--radius-control)] px-[var(--control-padding-x-md)] py-[calc(var(--content-gap)*0.625)] text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/40",disabled:e.disabled,onClick:()=>l(e),type:"button","data-ug-slot":"trigger",children:[s.jsxs.call(void 0,"span",{className:"flex min-w-0 items-center gap-2",children:[s.jsx.call(void 0,"span",{className:t.cn.call(void 0,"min-w-0 flex-1 truncate text-sm text-text-primary",o?"font-semibold":"font-medium"),"data-ug-slot":"title",children:e.title}),d&&e.badge?s.jsx.call(void 0,"span",{className:"shrink-0","data-ug-slot":"badge",children:e.badge}):null]}),c&&e.description?s.jsx.call(void 0,"span",{className:t.cn.call(void 0,"mt-0.5 block truncate text-xs",o?"text-primary-soft-fg":"text-text-tertiary"),"data-ug-slot":"description",children:e.description}):null]}),i?s.jsx.call(void 0,"div",{className:"flex shrink-0 items-center gap-1 pr-2","data-ug-slot":"actions",children:i(e)}):null]},e.id)})}));T.displayName="ConversationList";var z=[{value:"sidebar",label:"左侧导航"},{value:"header",label:"顶部导航"}],_=[{value:"light",label:"浅色"},{value:"dark",label:"深色"}],A=[{value:"highlight",label:"主题色块",description:"使用柔和主题底色突出当前菜单。"},{value:"indicator",label:"侧边标记",description:"使用淡色背景叠加左侧标记,定位更清楚。"}],R=[{value:"comfortable",label:"舒适"},{value:"compact",label:"紧凑"}];function ModeIcon({value:e}){return"system"===e?s.jsx.call(void 0,n.Monitor,{"aria-hidden":"true",size:16}):"light"===e?s.jsx.call(void 0,n.Sun,{"aria-hidden":"true",size:16}):"dark"===e?s.jsx.call(void 0,n.Moon,{"aria-hidden":"true",size:16}):null}function ThemePresetPreview({selected:e,value:a}){const l="mecha"===a;return s.jsxs.call(void 0,"span",{"aria-hidden":"true",className:t.cn.call(void 0,"relative flex h-[calc(var(--control-height-lg)*1.75)] w-full overflow-hidden rounded-[calc(var(--radius-control)*0.75)] border bg-surface-0 transition-[border-color,box-shadow,transform] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)]",e?"border-primary shadow-sm ring-1 ring-primary/20":"border-border-base shadow-xs"),"data-ug-mode":"light","data-ug":"theme-preview","data-ug-theme":a,children:[e?s.jsx.call(void 0,"span",{className:"absolute right-1.5 top-1.5 z-10 inline-flex h-[calc(var(--control-height-sm)*0.75)] w-[calc(var(--control-height-sm)*0.75)] items-center justify-center rounded-full bg-primary text-primary-fg shadow-sm",children:s.jsx.call(void 0,n.Check,{"aria-hidden":"true",size:12,strokeWidth:3})}):null,s.jsxs.call(void 0,"span",{className:"flex w-[24%] flex-col gap-1 border-r border-border-base bg-text-primary p-[calc(var(--content-gap)*0.375)]",children:[s.jsx.call(void 0,"span",{className:"h-[calc(var(--control-height-sm)*0.2)] w-8 rounded-full bg-primary"}),s.jsx.call(void 0,"span",{className:"mt-1 h-[calc(var(--control-height-sm)*0.16)] w-full rounded-full bg-surface-3"}),s.jsx.call(void 0,"span",{className:"h-[calc(var(--control-height-sm)*0.16)] w-4/5 rounded-full bg-surface-3"}),s.jsx.call(void 0,"span",{className:"h-[calc(var(--control-height-sm)*0.16)] w-3/4 rounded-full bg-surface-3"}),s.jsx.call(void 0,"span",{className:"mt-auto h-[calc(var(--control-height-sm)*0.16)] w-2/3 rounded-full bg-surface-3"})]}),s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,"flex min-w-0 flex-1 flex-col",l?"bg-text-primary":"bg-surface-0"),children:[s.jsx.call(void 0,"span",{className:t.cn.call(void 0,"h-[calc(var(--control-height-sm)*0.48)] border-b border-border-base",l?"bg-text-primary":"bg-surface-1")}),s.jsxs.call(void 0,"span",{className:"grid flex-1 grid-cols-3 gap-1.5 p-[calc(var(--content-gap)*0.375)]",children:[[0,1,2].map(e=>s.jsx.call(void 0,"span",{className:t.cn.call(void 0,"h-[calc(var(--control-height-sm)*0.42)] rounded-[calc(var(--radius-control)*0.35)] border border-border-base",l?"bg-text-secondary":1===e?"bg-primary-soft":"bg-surface-1")},e)),s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,"relative col-span-3 overflow-hidden rounded-[calc(var(--radius-control)*0.4)] border border-border-base",l?"bg-text-secondary":"bg-surface-1"),children:[s.jsx.call(void 0,"span",{className:"absolute inset-x-2 bottom-2 top-2 border-b border-l border-border-base"}),s.jsx.call(void 0,"svg",{className:"absolute inset-2 h-[calc(100%_-_var(--content-gap))] w-[calc(100%_-_var(--content-gap))] overflow-visible text-primary",preserveAspectRatio:"none",viewBox:"0 0 100 32",children:s.jsx.call(void 0,"path",{d:"M0 25 C12 22, 16 14, 28 18 S45 27, 56 14 S74 8, 100 4",fill:"none",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})})]})]})]})]})}function ChoiceGroup({title:a,description:l,value:o,options:r,onValueChange:d,presentation:c="compact",swatch:u,iconSet:v}){const g=i.useId.call(void 0),h=i.useId.call(void 0),p="card"===c,m="preview"===c,x=void 0!==u,b=!p&&!m&&!x;return s.jsxs.call(void 0,"section",{className:t.cn.call(void 0,"min-w-0",(b||x)&&"ug-theme-config-row"),"data-presentation":x?"swatch":c,"data-ug-slot":"group",children:[s.jsxs.call(void 0,"div",{className:"min-w-0",children:[s.jsx.call(void 0,"h3",{id:g,className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:a}),s.jsx.call(void 0,"p",{id:h,className:"ug-theme-config-description",children:l})]}),s.jsx.call(void 0,e.RadioGroup,{"aria-describedby":h,"aria-labelledby":g,className:t.cn.call(void 0,"min-w-0",m&&"mt-2.5 grid grid-cols-1 gap-2.5 sm:grid-cols-3",p&&"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",x&&"flex flex-wrap items-center gap-2.5",b&&"auto-cols-[minmax(max-content,1fr)]"),"data-ug-slot":"options",onValueChange:e=>d(String(e)),orientation:"horizontal",presentation:b?"segmented":"default",size:"default",sizing:b?"fill":"content",value:o,children:r.map(a=>s.jsx.call(void 0,e.Radio,{"aria-label":x?a.label:void 0,className:"hidden",controlClassName:x?void 0:"absolute",value:a.value,variant:p||m?"card":b?"segmented":"default",labelClassName:m?"group/theme flex min-h-[0] w-full cursor-pointer flex-col items-stretch gap-1.5 rounded-[var(--radius-control)] border-0 bg-transparent p-0 text-center shadow-none hover:bg-transparent focus-within:outline-none focus-within:ring-2 focus-within:ring-ring/30 data-[state=checked]:border-0 data-[state=checked]:bg-transparent data-[state=checked]:shadow-none":p?"min-h-[calc(var(--control-height-lg)*1.5)] gap-0 rounded-[var(--radius-control)] px-[calc(var(--content-gap)*0.75)] py-[calc(var(--content-gap)*0.5)]":x?"group/swatch min-h-[0] cursor-pointer gap-0 rounded-full p-0 focus-within:outline-none":b?"min-w-max px-[calc(var(--control-padding-x-sm)*0.75)]":void 0,label:s.jsxs.call(void 0,"span",{className:t.cn.call(void 0,"flex min-w-0",p||m?"flex-col gap-1":"items-center gap-2",x&&"block"),children:[m?s.jsx.call(void 0,ThemePresetPreview,{selected:a.value===o,value:a.value}):null,s.jsxs.call(void 0,"span",{className:"inline-flex min-w-0 items-center gap-2",children:["mode"===v?s.jsx.call(void 0,ModeIcon,{value:a.value}):null,x?s.jsx.call(void 0,"span",{"aria-hidden":"true","data-ug-swatch":"accent","data-ug-accent":a.value,children:s.jsx.call(void 0,n.Check,{"aria-hidden":"true",className:a.value===o?void 0:"invisible","data-ug-swatch-check":a.value===o?"":void 0,size:13,strokeWidth:3})}):null,s.jsx.call(void 0,"span",{className:t.cn.call(void 0,"min-w-0",p?"font-semibold text-text-primary":m?"w-full text-center font-medium text-text-primary":x?"sr-only":"truncate"),children:a.label})]}),p&&a.description?s.jsx.call(void 0,"span",{className:"text-xs font-normal leading-4 text-text-secondary",children:a.description}):null]})},a.value))})]})}var M=[{key:"background",label:"导航背景"},{key:"text",label:"普通文字"},{key:"activeBackground",label:"选中背景"},{key:"activeText",label:"选中文字"},{key:"hoverBackground",label:"悬停背景"}];function NavigationColorInput({label:e,value:a,onValueCommit:l}){const t=i.useRef.call(void 0,null),o=i.useRef.call(void 0,l);return o.current=l,i.useEffect.call(void 0,()=>{const e=t.current;if(!e)return;const commitValue=()=>o.current(e.value);return e.addEventListener("change",commitValue),()=>e.removeEventListener("change",commitValue)},[]),i.useEffect.call(void 0,()=>{t.current&&t.current.value!==a&&(t.current.value=a)},[a]),s.jsx.call(void 0,"input",{ref:t,"aria-label":e,"data-ug-slot":"color-swatch",defaultValue:a,type:"color"})}function NavigationColorGroup({customized:e,value:a,onReset:l,onValueChange:i}){return s.jsxs.call(void 0,"section",{className:"ug-theme-config-row min-w-0","data-presentation":"colors","data-ug":"navigation-colors","data-ug-slot":"group",children:[s.jsxs.call(void 0,"div",{className:"min-w-0","data-ug-slot":"group-label",children:[s.jsx.call(void 0,"h3",{className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:"导航颜色"}),e?s.jsx.call(void 0,t.Button,{onClick:l,size:"sm",tone:"neutral",variant:"ghost",children:"恢复主题配色"}):null]}),s.jsx.call(void 0,"div",{"data-ug-slot":"options",children:M.map(e=>s.jsxs.call(void 0,"label",{"data-ug-slot":"color-option",children:[s.jsx.call(void 0,NavigationColorInput,{label:e.label,onValueCommit:l=>i({...a,[e.key]:l}),value:a[e.key]}),s.jsx.call(void 0,"span",{"data-ug-slot":"color-label",children:e.label}),s.jsx.call(void 0,"code",{"data-ug-slot":"color-value",children:a[e.key].toUpperCase()})]},e.key))})]})}function TabLabel({icon:e,children:a}){return s.jsxs.call(void 0,"span",{className:"gap-[calc(var(--content-gap)*0.625)]","data-ug-slot":"tab-label",children:[s.jsx.call(void 0,"span",{"data-ug-slot":"tab-icon",children:e}),s.jsx.call(void 0,"span",{className:"truncate",children:a})]})}var L=i.forwardRef.call(void 0,({value:l,onValueChange:o,options:r,sidebarValue:d,onSidebarValueChange:c,appearanceAddon:v,sidebarAddon:g,className:h,...p},m)=>{const[x,b]=i.useState.call(void 0,"appearance"),f=a.useMediaQuery.call(void 0,"(prefers-color-scheme: dark)"),j=i.useMemo.call(void 0,()=>({...u.defaultUGThemeConfiguratorOptions,...r}),[r]),w=_nullishCoalesce(d.palette,()=>"primary"===d.variant?"light":"dark"),C=d.colors?w:u.resolveUGNavigationPalette.call(void 0,l.mode,f),y=u.resolveUGNavigationColors.call(void 0,l.preset,C,d.colors,l.accent);function updateField(e,a){o({...l,[e]:a})}function updateSidebarField(e,a){c({...d,[e]:a})}return s.jsx.call(void 0,"div",{ref:m,className:t.cn.call(void 0,"h-full min-h-[0] min-w-0 text-text-primary",h),"data-ug":"theme-configurator","data-state":"ready","data-variant":"panel","data-size":"default",...p,children:s.jsx.call(void 0,e.Tabs,{className:"h-full",onValueChange:e=>b(e),size:"md",value:x,variant:"rail",children:s.jsxs.call(void 0,"div",{"data-ug-slot":"configurator-layout",children:[s.jsx.call(void 0,"div",{"data-ug-slot":"navigation",children:s.jsxs.call(void 0,e.TabsList,{"aria-label":"外观设置分类",orientation:"vertical",children:[s.jsx.call(void 0,e.TabsTrigger,{value:"appearance",children:s.jsx.call(void 0,TabLabel,{icon:s.jsx.call(void 0,n.SwatchBook,{"aria-hidden":"true",size:16}),children:"主题外观"})}),s.jsx.call(void 0,e.TabsTrigger,{value:"sidebar",children:s.jsx.call(void 0,TabLabel,{icon:s.jsx.call(void 0,n.PanelTop,{"aria-hidden":"true",size:16}),children:"导航菜单"})})]})}),s.jsxs.call(void 0,"div",{className:"min-h-[0]","data-ug-slot":"settings",children:[s.jsxs.call(void 0,e.TabsContent,{className:"ug-theme-config-appearance min-w-0",value:"appearance",children:[s.jsx.call(void 0,ChoiceGroup,{title:"主题风格",description:"选择整套界面的基础视觉气质。",value:l.preset,options:j.presets,presentation:"preview",onValueChange:e=>updateField("preset",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"显示模式",description:"使用亮色、暗色,或自动跟随操作系统。",value:l.mode,options:j.modes,iconSet:"mode",onValueChange:e=>updateField("mode",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"主题色",description:"统一按钮、链接、当前项和焦点状态。",value:l.accent,options:j.accents,swatch:"accent",onValueChange:e=>updateField("accent",e)}),s.jsxs.call(void 0,"section",{"data-ug-slot":"detail-section",children:[s.jsx.call(void 0,"div",{"data-ug-slot":"section-heading",children:s.jsx.call(void 0,"h3",{className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:"界面细节"})}),s.jsxs.call(void 0,"div",{"data-ug-slot":"detail-grid",children:[s.jsx.call(void 0,ChoiceGroup,{title:"界面密度",description:"控制页面留白与控件间距。",value:l.density,options:j.densities,onValueChange:e=>updateField("density",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"圆角风格",description:"统一控件和面板的边角语言。",value:l.radius,options:j.radii,onValueChange:e=>updateField("radius",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"阴影层级",description:"调整浮层与卡片的空间层次。",value:l.shadow,options:j.shadows,onValueChange:e=>updateField("shadow",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"字体排版",description:"选择阅读性或信息密度取向。",value:l.font,options:j.fonts,onValueChange:e=>updateField("font",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"文字对比",description:"调整正文和次要信息的清晰度。",value:l.contrast,options:j.contrasts,onValueChange:e=>updateField("contrast",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"界面动效",description:"控制过渡反馈的强弱。",value:l.motion,options:j.motions,onValueChange:e=>updateField("motion",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"页面背景",description:"选择纯净、网格或柔光背景。",value:l.background,options:j.backgrounds,onValueChange:e=>updateField("background",e)})]})]}),v?s.jsx.call(void 0,"div",{"data-ug-slot":"appearance-addon",children:v}):null]}),s.jsxs.call(void 0,e.TabsContent,{className:"min-w-0",value:"sidebar",children:[s.jsxs.call(void 0,"div",{className:"ug-theme-config-sidebar-grid",children:[s.jsx.call(void 0,ChoiceGroup,{title:"导航位置",description:"选择左侧栏或桌面端顶栏导航。",value:_nullishCoalesce(d.mode,()=>"sidebar"),options:z,onValueChange:e=>updateSidebarField("mode",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"配色基准",description:"默认跟随显示模式;选择后作为导航颜色覆盖。",value:C,options:_,onValueChange:e=>c({...d,palette:e,variant:"light"===e?"primary":"dark",colors:u.resolveUGNavigationColors.call(void 0,l.preset,e,void 0,l.accent)})}),s.jsx.call(void 0,NavigationColorGroup,{customized:Boolean(d.colors),value:y,onReset:()=>updateSidebarField("colors",void 0),onValueChange:e=>c({...d,palette:C,variant:"light"===C?"primary":"dark",colors:e})}),s.jsx.call(void 0,ChoiceGroup,{title:"当前菜单",description:"选择当前页面在导航中的强调方式。",value:d.activeStyle,options:A,onValueChange:e=>updateSidebarField("activeStyle",e)}),s.jsx.call(void 0,ChoiceGroup,{title:"菜单密度",description:"调整导航菜单的行高与间距。",value:d.density,options:R,onValueChange:e=>updateSidebarField("density",e)})]}),g?s.jsx.call(void 0,"div",{"data-ug-slot":"sidebar-addon",children:g}):null]})]})]})})})});function DefaultThemePreview({value:e,sidebarValue:l}){const t=a.useMediaQuery.call(void 0,"(prefers-color-scheme: dark)"),i=_nullishCoalesce(l.palette,()=>"primary"===l.variant?"light":"dark"),o=l.colors?i:u.resolveUGNavigationPalette.call(void 0,e.mode,t),n=u.resolveUGNavigationColors.call(void 0,e.preset,o,l.colors,e.accent),r={"--ug-preview-navigation-bg":n.background,"--ug-preview-navigation-text":n.text,"--ug-preview-navigation-active-bg":n.activeBackground,"--ug-preview-navigation-active-text":n.activeText,"--ug-preview-navigation-hover-bg":n.hoverBackground};return s.jsxs.call(void 0,"section",{"aria-label":"实时预览",className:"[--ug-theme-preview-gap:var(--content-gap)] border-border-base","data-ug":"theme-configurator-preview",children:[s.jsx.call(void 0,"h3",{"data-ug-preview":"title",children:"实时预览"}),s.jsxs.call(void 0,"div",{"data-navigation-active-style":l.activeStyle,"data-navigation-density":l.density,"data-navigation-mode":_nullishCoalesce(l.mode,()=>"sidebar"),"data-ug-accent":e.accent,"data-ug-background":e.background,"data-ug-contrast":e.contrast,"data-ug-density":e.density,"data-ug-font":e.font,"data-ug-mode":e.mode,"data-ug-motion":e.motion,"data-ug-radius":e.radius,"data-ug-shadow":e.shadow,"data-ug-preview":"frame","data-ug-surface":e.surface,"data-ug-theme":e.preset,style:r,children:[s.jsxs.call(void 0,"aside",{"data-ug-preview":"navigation",children:[s.jsx.call(void 0,"strong",{"data-ug-preview":"brand",children:"UG Admin"}),s.jsx.call(void 0,"div",{"data-ug-preview":"menu",children:["工作台","任务中心","数据分析","系统设置"].map((e,a)=>s.jsxs.call(void 0,"span",{"data-state":0===a?"active":"default","data-ug-preview":"menu-item",children:[s.jsx.call(void 0,"i",{"aria-hidden":"true","data-ug-preview":"menu-icon"}),s.jsx.call(void 0,"span",{children:e})]},e))})]}),s.jsxs.call(void 0,"div",{"data-ug-preview":"content",children:[s.jsxs.call(void 0,"header",{"data-ug-preview":"topbar",children:[s.jsx.call(void 0,"strong",{"data-ug-preview":"topbar-title",children:"工作台"}),s.jsxs.call(void 0,"span",{"aria-hidden":"true","data-ug-preview":"topbar-actions",children:[s.jsx.call(void 0,"i",{}),s.jsx.call(void 0,"i",{}),s.jsx.call(void 0,"i",{})]})]}),s.jsxs.call(void 0,"div",{"data-ug-preview":"tabs",children:[s.jsx.call(void 0,"span",{"data-state":"active",children:"工作台"}),s.jsx.call(void 0,"span",{children:"任务中心"}),s.jsx.call(void 0,"span",{children:"报表"})]}),s.jsxs.call(void 0,"main",{"data-ug-preview":"main",children:[s.jsx.call(void 0,"div",{"data-ug-preview":"stats",children:[["待办任务","12"],["团队成员","8"],["进行项目","24"]].map(([e,a])=>s.jsxs.call(void 0,"span",{"data-ug-preview":"stat",children:[s.jsx.call(void 0,"small",{children:e}),s.jsx.call(void 0,"strong",{children:a})]},e))}),s.jsxs.call(void 0,"div",{"data-ug-preview":"chart",children:[s.jsx.call(void 0,"strong",{children:"工作概览"}),s.jsx.call(void 0,"svg",{"aria-hidden":"true",preserveAspectRatio:"none",viewBox:"0 0 240 72",children:s.jsx.call(void 0,"path",{d:"M0 58 C28 48, 38 24, 66 36 S102 58, 130 28 S172 42, 240 12",fill:"none",stroke:"currentColor",strokeWidth:"3",vectorEffect:"non-scaling-stroke"})})]}),s.jsx.call(void 0,"div",{"data-ug-preview":"table",children:["整理发布计划","复核访问权限","更新项目进度"].map((e,a)=>s.jsxs.call(void 0,"span",{"data-ug-preview":"table-row",children:[s.jsx.call(void 0,"span",{children:e}),s.jsx.call(void 0,"i",{"data-state":1===a?"warning":"success",children:1===a?"待处理":"已完成"})]},e))})]})]})]})]})}function ThemeConfiguratorDialog({open:a,onOpenChange:l,onReset:i,onCancel:o,onApply:r,title:d="外观设置",preview:c,showPreview:u=!0,resetLabel:v="恢复默认",cancelLabel:g="取消",applyLabel:h,doneLabel:p,...m}){const x=_nullishCoalesce(_nullishCoalesce(h,()=>p),()=>"应用"),b=void 0===c?s.jsx.call(void 0,DefaultThemePreview,{value:m.value,sidebarValue:m.sidebarValue}):c,f=u&&null!==b&&!1!==b;function closeAsCancel(){_optionalChain([o,"optionalCall",e=>e()]),l(!1)}return s.jsx.call(void 0,e.Modal,{ariaLabel:"string"==typeof d?d:"外观设置",onClose:closeAsCancel,open:a,size:"2xl",children:s.jsxs.call(void 0,e.ModalContent,{"data-ug":"theme-configurator-dialog","data-state":a?"open":"closed","data-variant":f?"preview":"default","data-size":"2xl",children:[s.jsxs.call(void 0,e.ModalHeader,{children:[s.jsx.call(void 0,e.ModalTitle,{children:d}),s.jsx.call(void 0,e.ModalCloseButton,{})]}),s.jsx.call(void 0,e.ModalBody,{className:"overflow-hidden p-0",children:s.jsxs.call(void 0,"div",{"data-ug-layout":"dialog",children:[s.jsx.call(void 0,"div",{className:"h-full min-h-[0] min-w-0","data-ug-slot":"panel",children:s.jsx.call(void 0,L,{...m})}),f?s.jsx.call(void 0,"div",{"data-ug-slot":"preview",children:b}):null]})}),s.jsxs.call(void 0,e.ModalFooter,{className:"justify-between",children:[s.jsx.call(void 0,"div",{className:"flex min-w-0 items-center gap-3",children:i?s.jsxs.call(void 0,t.Button,{onClick:i,type:"button",variant:"default",children:[s.jsx.call(void 0,n.RotateCcw,{"aria-hidden":"true",size:16}),v]}):null}),s.jsxs.call(void 0,"div",{className:"flex shrink-0 items-center gap-2",children:[o?s.jsx.call(void 0,t.Button,{onClick:closeAsCancel,type:"button",variant:"default",children:g}):null,s.jsx.call(void 0,t.Button,{onClick:function closeAsApply(){_optionalChain([r,"optionalCall",e=>e()]),l(!1)},type:"button",variant:"primary",children:x})]})]})]})})}L.displayName="ThemeConfigurator",exports.AdminShell=p,exports.AppTabs=x,exports.AttachmentList=S,exports.ConfirmDialog=b,exports.ConversationList=T,exports.CopyField=f,exports.DataTable=DataTable,exports.DataTableIdentity=DataTableIdentity,exports.DataTableToolbar=DataTableToolbar,exports.Message=N,exports.MessageList=k,exports.PageHeader=j,exports.PromptComposer=y,exports.QuickAccess=C,exports.SelectionList=r,exports.ThemeConfigurator=L,exports.ThemeConfiguratorDialog=ThemeConfiguratorDialog,exports.TreeTable=TreeTable,exports.UGAdminShell=p,exports.UGAppTabs=x,exports.UGAttachmentList=S,exports.UGConfirmDialog=b,exports.UGConversationList=T,exports.UGCopyField=f,exports.UGDataTable=DataTable,exports.UGDataTableIdentity=DataTableIdentity,exports.UGDataTableToolbar=DataTableToolbar,exports.UGMessage=N,exports.UGMessageList=k,exports.UGPageHeader=j,exports.UGPromptComposer=y,exports.UGQuickAccess=C,exports.UGSelectionList=r,exports.UGThemeConfigurator=L,exports.UGThemeConfiguratorDialog=ThemeConfiguratorDialog,exports.UGTreeTable=TreeTable;//# sourceMappingURL=index.cjs.map
1
+ "use strict";function _nullishCoalesce(e,a){return null!=e?e:a()}function _optionalChain(e){let a,l=e[0],t=1;for(;t<e.length;){const i=e[t],o=e[t+1];if(t+=2,("optionalAccess"===i||"optionalCall"===i)&&null==l)return;"access"===i||"optionalAccess"===i?(a=l,l=o(l)):"call"!==i&&"optionalCall"!==i||(l=o((...e)=>l.call(a,...e)),a=void 0)}return l}Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../chunk-LNVPMWCL.cjs"),a=require("../chunk-JJA2B3JL.cjs");require("../chunk-2EJWWTLH.cjs");var l=require("../chunk-X4EMYHLY.cjs"),t=require("../chunk-PGJ5O3CM.cjs"),i=require("../chunk-RZSNVJZO.cjs"),o=require("react"),n=require("@ug666/ui-core"),s=require("lucide-react"),r=require("react/jsx-runtime"),d=o.forwardRef.call(void 0,({options:a,value:l,defaultValue:d=[],onValueChange:c,searchable:u=!0,searchPlaceholder:v="搜索选项",emptyLabel:g="没有匹配项",disabled:h,size:p,name:m,form:x,layout:b="stack",collapsibleGroups:f=!1,expandedGroups:j,defaultExpandedGroups:w,onExpandedGroupsChange:C,showSelectAll:y=!0,showSummary:N=!0,showGroupCount:k=!0,className:S,...T},z)=>{const _=i.useUIConfig.call(void 0),A=o.useId.call(void 0),R=o.useRef.call(void 0,null),[M,L]=o.useState.call(void 0,[...d]),[I,D]=o.useState.call(void 0,""),E=o.useRef.call(void 0,{value:l,defaultValue:d});E.current={value:l,defaultValue:d};const[B,G]=o.useState.call(void 0,()=>void 0===w?[]:n.groupSelectionListOptions.call(void 0,a).filter(e=>!w.includes(e.key)).map(e=>e.key)),F=_nullishCoalesce(l,()=>M),V=i.resolveDisabled.call(void 0,h,_.disabled),$=i.resolveControlSize.call(void 0,p,_.size),P=n.filterSelectionListOptions.call(void 0,a,u?I:""),U=n.groupSelectionListOptions.call(void 0,P),W=n.getSelectionListScope.call(void 0,P,F),O=n.groupSelectionListOptions.call(void 0,a),H=_nullishCoalesce(j,()=>O.filter(e=>!B.includes(e.key)).map(e=>e.key)),q=u&&I.trim().length>0,Q=U.every(e=>H.includes(e.key));function changeExpanded(e){void 0===j&&G(O.filter(a=>!e.includes(a.key)).map(e=>e.key)),_optionalChain([C,"optionalCall",a=>a(e)])}function change(e){V||(void 0===l&&L(e),_optionalChain([c,"optionalCall",a=>a(e)]))}return o.useEffect.call(void 0,()=>{const e=x?document.getElementById(x):_optionalChain([R,"access",e=>e.current,"optionalAccess",e=>e.closest,"call",e=>e("form")]);if(!e)return;const a=new Set;function reset(e){const l=setTimeout(()=>{a.delete(l),e.defaultPrevented||(void 0===E.current.value&&L([...E.current.defaultValue]),D(""))},0);a.add(l)}return e.addEventListener("reset",reset),()=>{e.removeEventListener("reset",reset),a.forEach(clearTimeout)}},[x]),r.jsxs.call(void 0,"div",{...T,ref:e=>{R.current=e,"function"==typeof z?z(e):z&&(z.current=e)},className:i.cn.call(void 0,"grid min-w-0 gap-[var(--content-gap)] text-text-primary",S),"data-ug":"selection-list","data-ug-slot":"root","data-size":$,"data-layout":b,"data-state":V?"disabled":0===P.length?"empty":"default","data-variant":"grouped",role:"group","aria-label":_nullishCoalesce(T["aria-label"],()=>"选项列表"),"aria-disabled":V||void 0,children:[u?r.jsx.call(void 0,"div",{"data-ug-slot":"search",children:r.jsx.call(void 0,t.Input,{value:I,onValueChange:D,clearable:!0,"aria-label":v,placeholder:v,size:$,disabled:V})}):null,y||N?r.jsxs.call(void 0,"div",{"data-ug-slot":"bulk",className:"flex flex-wrap items-center justify-between gap-[calc(var(--content-gap)*0.5)]",children:[y?r.jsx.call(void 0,e.Checkbox,{checked:W.checked,indeterminate:W.indeterminate,size:$,disabled:V||0===W.available,"aria-describedby":N?`${A}-summary`:void 0,onCheckedChange:e=>change(n.updateSelectionListScope.call(void 0,F,P,e)),label:"全选当前结果"}):null,N?r.jsxs.call(void 0,"span",{id:`${A}-summary`,"data-ug-slot":"summary",className:"text-xs text-text-secondary","aria-live":"polite",children:["已选 ",new Set(F).size," 项;当前 ",W.total," 项,",W.available," 项可操作",W.disabled>0?`,${W.disabled} 项不可操作`:""]}):null]}):null,f?r.jsxs.call(void 0,"div",{"data-ug-slot":"group-actions",children:[r.jsx.call(void 0,i.Button,{type:"button",size:"default",variant:"ghost",disabled:q||0===U.length,title:q?"清空搜索后可折叠分组":void 0,onClick:()=>changeExpanded(Q?H.filter(e=>!U.some(a=>a.key===e)):[...new Set([...H,...U.map(e=>e.key)])]),children:Q?"全部收起":"全部展开"}),q?r.jsx.call(void 0,"span",{"data-ug-slot":"search-hint",children:"搜索时展开匹配分组"}):null]}):null,r.jsxs.call(void 0,"div",{"data-ug-slot":"groups",className:"grid min-w-0 gap-[var(--content-gap)]",children:[U.map(a=>{const l=n.getSelectionListScope.call(void 0,a.options,F),t=!f||q||H.includes(a.key),o=`${A}-group-${encodeURIComponent(a.key)}`;return r.jsxs.call(void 0,e.Fieldset,{variant:"card",size:"sm","data-ug-slot":"group",children:[r.jsx.call(void 0,e.FieldsetLegend,{children:a.label}),r.jsxs.call(void 0,"div",{"data-ug-slot":"group-heading",className:"flex flex-wrap items-center justify-between gap-[calc(var(--content-gap)*0.5)]",children:[r.jsx.call(void 0,e.Checkbox,{checked:l.checked,indeterminate:l.indeterminate,size:$,disabled:V||0===l.available,onCheckedChange:e=>change(n.updateSelectionListScope.call(void 0,F,a.options,e)),label:`全选${a.label}`}),k?r.jsxs.call(void 0,"span",{"data-ug-slot":"group-count",className:"text-xs text-text-secondary",children:["已选 ",l.selected,"/",l.total,l.disabled>0?`,${l.disabled} 项不可操作`:""]}):null,f?r.jsx.call(void 0,i.Button,{type:"button",variant:"ghost",size:"icon",disabled:q,className:k?void 0:"ml-auto","aria-label":`${t?"收起":"展开"}${a.label}选项`,"aria-expanded":t,"aria-controls":o,title:q?"清空搜索后可折叠分组":`${t?"收起":"展开"}${a.label}选项`,onClick:()=>changeExpanded(t?H.filter(e=>e!==a.key):[...H,a.key]),children:t?r.jsx.call(void 0,s.ChevronDown,{size:16,"aria-hidden":"true"}):r.jsx.call(void 0,s.ChevronRight,{size:16,"aria-hidden":"true"})}):null]}),r.jsx.call(void 0,"div",{id:o,"data-ug-slot":"options",hidden:!t,children:r.jsx.call(void 0,e.CheckboxGroup,{value:F,disabled:V,size:$,orientation:"vertical","aria-label":`${a.label}选项`,onValueChange:e=>change(e.map(String)),children:a.options.map(a=>r.jsx.call(void 0,e.Checkbox,{value:a.id,disabled:a.disabled,"aria-label":a.label,"aria-describedby":[a.description&&`${A}-description-${encodeURIComponent(a.id)}`,a.disabled&&`${A}-locked-${encodeURIComponent(a.id)}`].filter(Boolean).join(" ")||void 0,label:r.jsxs.call(void 0,"span",{"data-ug-slot":"option-label",className:"grid min-w-0 [overflow-wrap:anywhere]",children:[r.jsxs.call(void 0,"span",{children:[a.label,a.disabled?r.jsx.call(void 0,"span",{id:`${A}-locked-${encodeURIComponent(a.id)}`,"data-ug-slot":"locked",className:"ml-1 text-xs text-text-secondary",children:"(不可操作)"}):null]}),a.description?r.jsx.call(void 0,"span",{id:`${A}-description-${encodeURIComponent(a.id)}`,"data-ug-slot":"option-description",className:"text-xs text-text-secondary",children:a.description}):null]})},a.id))})})]},a.key)}),0===P.length?r.jsx.call(void 0,"p",{"data-ug-slot":"empty",className:"text-sm text-text-secondary",role:"status",children:g}):null]}),m?[...new Set(F)].map(e=>r.jsx.call(void 0,"input",{type:"hidden",name:m,form:x,value:e,disabled:V},e)):null]})});d.displayName="SelectionList";var c=require("@ug666/ui-web");function DataTableHeader({headers:a,layout:l,widths:t,offset:d,selection:u,actions:v,sort:g,order:h,onSortChange:p,reorderable:m,move:x}){const b=o.useRef.call(void 0,void 0);return r.jsx.call(void 0,e.TableHeader,{children:a.map((o,f)=>r.jsxs.call(void 0,e.TableRow,{children:[0===f&&null!=u&&r.jsx.call(void 0,e.TableHead,{rowSpan:a.length,scope:"col","data-leaf-index":0,className:"text-center","data-fixed":n.getTableColumnFixed.call(void 0,l[0]),style:c.getTableColumnStyle.call(void 0,l,0,t),children:u}),o.map(a=>{const{column:o,leafIndex:u,colSpan:v,rowSpan:f,siblingIds:j}=a,w=u+d,C=l.slice(w,w+v),y=n.getTableColumnFixed.call(void 0,C[0]),N=C.every(e=>n.getTableColumnFixed.call(void 0,e)===y),k=c.getTableColumnStyle.call(void 0,l,"right"===y?w+v-1:w,t),S=j.indexOf(o.id),T=_nullishCoalesce(o.sortLabel,()=>"string"==typeof o.header||"number"==typeof o.header?String(o.header):o.id),z=Boolean(_optionalChain([o,"access",e=>e.children,"optionalAccess",e=>e.length]));return r.jsx.call(void 0,e.TableHead,{scope:z?"colgroup":"col",colSpan:v,rowSpan:f,"data-leaf-index":z?void 0:w,"data-fixed":N?y:void 0,style:z?{...k,width:void 0,minWidth:void 0}:k,className:o.className,"aria-sort":!z&&o.sortable&&g===o.id?"asc"===h?"ascending":"descending":void 0,draggable:m||void 0,onDragStart:e=>{b.current=o.id,e.dataTransfer.setData("text/plain",o.id),e.dataTransfer.effectAllowed="move"},onDragEnd:()=>{b.current=void 0},onDragOver:e=>{m&&b.current&&j.includes(b.current)&&e.preventDefault()},onDrop:e=>{m&&b.current&&j.includes(b.current)&&(e.preventDefault(),x(b.current,o.id),b.current=void 0)},children:r.jsxs.call(void 0,"span",{"data-ug-slot":"header",className:"contents",children:[!z&&o.sortable&&p?r.jsxs.call(void 0,i.Button,{"aria-label":`按${T}排序`,style:{fontWeight:"inherit"},type:"button",size:"sm",tone:"neutral",variant:"text",onClick:()=>p(o.id,g===o.id&&"asc"===h?"desc":"asc"),children:[o.header,g!==o.id?r.jsx.call(void 0,s.ArrowUpDown,{"aria-hidden":!0,size:14}):"asc"===h?r.jsx.call(void 0,s.ArrowUp,{"aria-hidden":!0,size:14}):r.jsx.call(void 0,s.ArrowDown,{"aria-hidden":!0,size:14})]}):o.header,m&&r.jsxs.call(void 0,"span",{"data-ug-slot":"column-reorder",children:[r.jsx.call(void 0,i.Button,{type:"button",variant:"text",size:"icon-sm","aria-label":`向左移动${T}`,disabled:0===S,onClick:()=>x(o.id,j[S-1]),children:r.jsx.call(void 0,s.ChevronLeft,{size:14,"aria-hidden":!0})}),r.jsx.call(void 0,i.Button,{type:"button",variant:"text",size:"icon-sm","aria-label":`向右移动${T}`,disabled:S===j.length-1,onClick:()=>x(o.id,j[S+1],!0),children:r.jsx.call(void 0,s.ChevronRight,{size:14,"aria-hidden":!0})})]})]})},o.id)}),0===f&&null!=v&&r.jsx.call(void 0,e.TableHead,{rowSpan:a.length,scope:"col","data-leaf-index":l.length-1,className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":n.getTableColumnFixed.call(void 0,l.at(-1)),children:v})]},f))})}var u=["loading-a","loading-b","loading-c","loading-d","loading-e"];function DataTable({rows:a,columns:l,getRowId:t,loading:d=!1,error:v,errorTitle:g="数据加载失败",emptyTitle:h="暂无数据",emptyDescription:p="当前条件下没有可展示的记录。",emptyAction:m,selectedIds:x=new Set,onSelectionChange:b,sort:f,order:j="asc",onSortChange:w,rowActions:C,actionsLabel:y="操作",page:N=1,total:k=a.length,pageSize:S=20,onPageChange:T,pageSizeOptions:z,onPageSizeChange:_,onRetry:A,retryLabel:R="重试",scrollRegionLabel:M="数据表格",size:L="sm",bordered:I=!1,striped:D=!1,tableClassName:E,fill:B=!1,overflowHint:G="左右滑动查看全部列",pagination:F=!0,paginationSize:V="default",rowNumber:$=!1,onRowClick:P,spanMethod:U,summaryMethod:W,columnOrder:O,defaultColumnOrder:H=[],onColumnOrderChange:q,reorderableColumns:Q=!1,className:J,...K}){const[X,Y]=o.useState.call(void 0,H),Z="__row_number__",ee=$?[{id:Z,header:"序号",width:64,align:"center"},...l]:l,ae=n.getTableStructure.call(void 0,ee,_nullishCoalesce(O,()=>X)),le=ae.leaves,te=n.getTableSpanGrid.call(void 0,a.length,le.length,(e,l)=>_optionalChain([U,"optionalCall",t=>t({row:a[e],column:le[l],rowIndex:e,columnIndex:l})])),ie=!d&&W?W({rows:a,columns:le}):void 0;const oe=o.useRef.call(void 0,null),[ne,se]=o.useState.call(void 0,{widths:[],regionWidth:1/0}),re=ne.widths,de=le.some(e=>"left"===n.getTableColumnFixed.call(void 0,e)),ce=[...b?[{width:"var(--control-height-lg)",fixed:de?"left":void 0}]:[],...le,...C?[{width:"min-content",minWidth:"min-content",fixed:"right"}]:[]],ue=b?1:0,ve=re.length>0&&re.reduce((e,a)=>e+a,0)>ne.regionWidth+.5,ge=ve?ce:ce.map(({fixed:e,...a})=>a),he=n.resolveTableFixedColumns.call(void 0,ge,re,ne.regionWidth,ve&&C?ge.length-1:void 0),pe=JSON.stringify([ae.order,ce.map(({width:e,minWidth:a,align:l,fixed:t})=>({width:e,minWidth:a,align:l,fixed:t}))]),me=a.map(t),xe=me.length>0&&me.every(e=>x.has(e)),be=me.some(e=>x.has(e))&&!xe,fe=Math.max(Math.ceil(k/Math.max(S,1)),1),je=[...new Set([..._nullishCoalesce(z,()=>[]),S])].filter(e=>Number.isSafeInteger(e)&&e>0).sort((e,a)=>e-a),we=v?"error":d?"loading":0===a.length?"empty":"ready";return o.useLayoutEffect.call(void 0,()=>(C||le.some(e=>n.getTableColumnFixed.call(void 0,e)))&&oe.current?c.observeTableColumnWidths.call(void 0,oe.current,(e,a)=>se({widths:e,regionWidth:a})):void 0,[pe,we]),r.jsx.call(void 0,"div",{ref:oe,className:i.cn.call(void 0,"min-w-0",!B&&"space-y-[calc(var(--content-gap)*0.75)]",J),"data-ug":"data-table","data-fill":B||void 0,"data-state":we,"data-variant":I?"bordered":"default","data-size":L,...K,children:v?r.jsxs.call(void 0,"div",{className:"flex min-h-[calc(var(--control-height-lg)*4)] flex-col items-center justify-center gap-[calc(var(--content-gap)*0.75)] px-[var(--content-gap)] py-[calc(var(--content-gap)*1.5)] text-center","data-ug-slot":"feedback",role:"alert",children:[r.jsx.call(void 0,"span",{"aria-hidden":"true",className:"inline-flex size-10 items-center justify-center rounded-full bg-danger-soft/10 text-danger-soft-fg",children:r.jsx.call(void 0,s.AlertTriangle,{size:20})}),r.jsxs.call(void 0,"div",{className:"flex max-w-[28rem] flex-col gap-1",children:[r.jsx.call(void 0,"p",{className:"m-0 text-sm font-semibold text-text-primary",children:g}),r.jsx.call(void 0,"p",{className:"m-0 text-sm leading-6 text-text-secondary",children:v})]}),A?r.jsxs.call(void 0,i.Button,{onClick:A,size:"default",type:"button",variant:"outline",children:[r.jsx.call(void 0,s.RefreshCw,{"aria-hidden":"true",size:16}),R]}):null]}):r.jsxs.call(void 0,r.Fragment,{children:[r.jsxs.call(void 0,"div",{"data-ug-slot":"table",children:[r.jsxs.call(void 0,e.Table,{bordered:I,className:i.cn.call(void 0,"min-w-[48rem] table-auto",E),scrollRegionLabel:M,size:L,striped:D,children:[r.jsx.call(void 0,"colgroup",{children:ce.map((e,a)=>r.jsx.call(void 0,"col",{style:{width:c.tableColumnLength.call(void 0,_nullishCoalesce(e.width,()=>"12rem"))}},a))}),r.jsx.call(void 0,DataTableHeader,{headers:ae.headers,layout:he,widths:re,offset:ue,sort:f,order:j,onSortChange:w,reorderable:Q,move:function moveColumn(e,a,t=!1){const i=n.moveTableColumn.call(void 0,l,ae.order,e,a,t);i.every((e,a)=>e===ae.order[a])||(void 0===O&&Y(i),_optionalChain([q,"optionalCall",e=>e(i)]))},selection:b?r.jsx.call(void 0,"span",{className:"inline-flex","data-ug-slot":"selection",children:r.jsx.call(void 0,e.Checkbox,{"aria-label":"选择当前页全部记录",checked:xe,indeterminate:be,onCheckedChange:function toggleAll(e){const a=new Set(x);for(const l of me)e?a.add(l):a.delete(l);_optionalChain([b,"optionalCall",e=>e(a)])}})}):void 0,actions:C?r.jsx.call(void 0,"span",{"data-ug-slot":"header",children:y}):void 0}),r.jsxs.call(void 0,e.TableBody,{children:[d?u.map(a=>r.jsxs.call(void 0,e.TableRow,{children:[b?r.jsx.call(void 0,e.TableCell,{className:"text-center","data-fixed":n.getTableColumnFixed.call(void 0,he[0]),style:c.getTableColumnStyle.call(void 0,he,0,re),children:r.jsx.call(void 0,"span",{className:"inline-flex","data-ug-slot":"selection",children:r.jsx.call(void 0,e.Skeleton,{className:"size-[calc(var(--control-height-sm)*0.5)]",variant:"rect"})})}):null,le.map((a,l)=>r.jsx.call(void 0,e.TableCell,{className:a.className,"data-fixed":n.getTableColumnFixed.call(void 0,he[l+ue]),style:c.getTableColumnStyle.call(void 0,he,l+ue,re),children:r.jsx.call(void 0,"span",{"data-ug-slot":"loading",children:r.jsx.call(void 0,e.Skeleton,{variant:"text"})})},a.id)),C?r.jsx.call(void 0,e.TableCell,{className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":n.getTableColumnFixed.call(void 0,he[ce.length-1]),children:r.jsx.call(void 0,"span",{"data-ug-slot":"loading",children:r.jsx.call(void 0,e.Skeleton,{variant:"text"})})}):null]},a)):a.map((a,l)=>{const i=t(a),o=x.has(i);return r.jsxs.call(void 0,e.TableRow,{"data-state":o?"selected":"default","data-clickable":P?"true":void 0,onClick:P?e=>{e.target.closest("a, button, input, select, label")||P(a)}:void 0,children:[b?r.jsx.call(void 0,e.TableCell,{className:"text-center","data-fixed":n.getTableColumnFixed.call(void 0,he[0]),style:c.getTableColumnStyle.call(void 0,he,0,re),children:r.jsx.call(void 0,"span",{className:"inline-flex","data-ug-slot":"selection",children:r.jsx.call(void 0,e.Checkbox,{"aria-label":`选择记录 ${i}`,checked:o,onCheckedChange:e=>function toggleOne(e,a){const l=new Set(x);a?l.add(e):l.delete(e),_optionalChain([b,"optionalCall",e=>e(l)])}(i,e)})})}):null,le.map((t,i)=>te[l][i].rowSpan>0?r.jsx.call(void 0,e.TableCell,{rowSpan:te[l][i].rowSpan,colSpan:te[l][i].colSpan,className:t.className,"data-fixed":1===te[l][i].colSpan?n.getTableColumnFixed.call(void 0,he[i+ue]):void 0,style:c.getTableColumnStyle.call(void 0,he,i+ue,re),children:r.jsx.call(void 0,"span",{className:"contents","data-ug-slot":"cell",children:t.id===Z?(N-1)*S+l+1:t.cell?t.cell(a):String(_nullishCoalesce(a[t.id],()=>"—"))})},t.id):null),C?r.jsx.call(void 0,e.TableCell,{className:"whitespace-nowrap text-right","data-ug-slot":"action-column","data-fixed":n.getTableColumnFixed.call(void 0,he[ce.length-1]),children:r.jsx.call(void 0,"div",{"data-ug-slot":"actions",children:C(a)})}):null]},i)}),d||0!==a.length?null:r.jsx.call(void 0,e.TableRow,{children:r.jsx.call(void 0,e.TableCell,{colSpan:le.length+(b?1:0)+(C?1:0),children:r.jsx.call(void 0,"div",{"data-ug-slot":"empty",children:r.jsx.call(void 0,e.EmptyState,{action:m,description:p,icon:s.Database,size:"sm",title:h})})})})]}),ie&&a.length>0&&r.jsx.call(void 0,"tfoot",{"data-ug-slot":"aggregate",children:r.jsxs.call(void 0,e.TableRow,{children:[b&&r.jsx.call(void 0,e.TableCell,{}),le.map((a,l)=>r.jsx.call(void 0,e.TableCell,{"data-fixed":n.getTableColumnFixed.call(void 0,he[l+ue]),style:c.getTableColumnStyle.call(void 0,he,l+ue,re),children:ie[l]},a.id)),C&&r.jsx.call(void 0,e.TableCell,{"data-ug-slot":"action-column","data-fixed":n.getTableColumnFixed.call(void 0,he[ce.length-1])})]})})]}),G?r.jsx.call(void 0,"p",{className:"data-table__overflow-hint","data-ug-slot":"overflow-hint",children:G}):null]}),F&&!d&&(k>0||z&&_)?r.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-[var(--content-gap)] text-sm text-text-secondary max-sm:items-stretch max-sm:flex-col","data-ug-slot":"pagination",children:[r.jsxs.call(void 0,"span",{"data-ug-slot":"summary",children:["共 ",k," 条,第 ",N," / ",fe," 页"]}),r.jsxs.call(void 0,"div",{"data-ug-slot":"pagination-controls",children:[z&&_?r.jsx.call(void 0,e.Select,{"aria-label":"每页条数",options:je.map(e=>({label:`每页 ${e} 条`,value:e})),size:V,value:S,onValueChange:e=>{"number"==typeof e&&_(e)}}):null,T&&fe>1?r.jsx.call(void 0,e.Pagination,{onPageChange:T,page:N,totalPages:fe,size:"default"===V?"md":V}):null]})]}):null]})})}function defaultChildren(e){return e.children}function TreeTable({rows:e,columns:a,getRowId:l,getChildren:t=defaultChildren,getRowLabel:d,treeColumnId:c=_optionalChain([n.getTableStructure.call(void 0,a),"access",e=>e.leaves,"access",e=>e[0],"optionalAccess",e=>e.id]),expandedIds:u,defaultExpandedIds:v,defaultExpandAll:g=!1,onExpandedChange:h,onExpandChange:p,indent:m=16,expansionDisabled:x=!1,expansionDisabledReason:b,fill:f=!1,size:j="sm",bordered:w=!0,className:C,...y}){const[N,k]=o.useState.call(void 0,()=>v?new Set(v):void 0),S=_nullishCoalesce(u,()=>N),T=o.useMemo.call(void 0,()=>n.projectTreeTableRows.call(void 0,e,{getRowId:l,getChildren:t,expandedIds:S,defaultExpandAll:g}),[e,l,t,S,g]),z=new Map(T.visibleRows.map(e=>[e.id,e]));function toggle(e,a){if(x)return;const t=l(e),i=new Set(_nullishCoalesce(S,()=>g?T.expandableIds:[]));a?i.add(t):i.delete(t),void 0===u&&k(i),_optionalChain([h,"optionalCall",e=>e(i)]),_optionalChain([p,"optionalCall",l=>l(e,a)])}const decorate=e=>e.map(e=>_optionalChain([e,"access",e=>e.children,"optionalAccess",e=>e.length])?{...e,children:decorate(e.children)}:e.id!==c?e:{...e,cell:a=>{const t=z.get(l(a)),o=_nullishCoalesce(_optionalChain([d,"optionalCall",e=>e(a)]),()=>`记录 ${t.id}`);return r.jsxs.call(void 0,"div",{"data-ug-slot":"tree-cell","data-depth":t.depth,style:{paddingInlineStart:t.depth*Math.max(m,0)},children:[r.jsxs.call(void 0,"span",{"data-ug-slot":"level",children:["层级 ",t.depth+1,","]}),t.hasChildren?r.jsx.call(void 0,i.Button,{type:"button",size:"icon-sm",variant:"ghost",tone:"neutral","aria-label":`${t.expanded?"收起":"展开"}${o}`,"aria-expanded":t.expanded,disabled:x,"aria-description":b,onClick:()=>toggle(a,!t.expanded),onKeyDown:e=>{x||("ArrowRight"!==e.key||t.expanded||(e.preventDefault(),toggle(a,!0)),"ArrowLeft"===e.key&&t.expanded&&(e.preventDefault(),toggle(a,!1)))},children:t.expanded?r.jsx.call(void 0,s.ChevronDown,{size:16,"aria-hidden":!0}):r.jsx.call(void 0,s.ChevronRight,{size:16,"aria-hidden":!0})}):r.jsx.call(void 0,"span",{"data-ug-slot":"tree-spacer","aria-hidden":!0}),r.jsx.call(void 0,"span",{"data-ug-slot":"tree-content",title:o,children:e.cell?e.cell(a):String(_nullishCoalesce(a[e.id],()=>"—"))})]})}}),_=decorate(a);return r.jsx.call(void 0,"div",{className:C,"data-ug":"tree-table","data-ug-slot":"root","data-fill":f||void 0,"data-size":j,"data-variant":w?"bordered":"default","data-state":y.error?"error":y.loading?"loading":T.visibleRows.length?"ready":"empty",children:r.jsx.call(void 0,DataTable,{...y,rows:T.visibleRows.map(e=>e.record),columns:_,getRowId:l,pagination:!1,fill:f,size:j,bordered:w})})}var v=require("@ug666/ui-core/theme"),g=require("@ug666/ui-web/sidebar");function activeClass(e,a){return e?"indicator"===a?"bg-transparent text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-active-text)] data-[state=open]:bg-[var(--ug-navigation-hover-bg)] data-[state=open]:text-[var(--ug-navigation-active-text)] after:absolute after:inset-x-2 after:bottom-0 after:h-0.5 after:bg-[var(--ug-navigation-active-text)]":"bg-[var(--ug-navigation-active-bg)] text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-active-bg)] hover:text-[var(--ug-navigation-active-text)] data-[state=open]:bg-[var(--ug-navigation-active-bg)] data-[state=open]:text-[var(--ug-navigation-active-text)]":"bg-transparent text-[var(--ug-navigation-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-text)] data-[state=open]:bg-[var(--ug-navigation-hover-bg)] data-[state=open]:text-[var(--ug-navigation-text)]"}function topItemClass(e,a,l){return i.cn.call(void 0,"relative flex max-w-40 items-center gap-1.5 rounded-[var(--radius-control)] px-2.5 font-medium","compact"===l?"h-8 text-xs":"h-9 text-sm",activeClass(e,a))}function moreItemClass(e,a,l){return i.cn.call(void 0,"relative flex shrink-0 items-center gap-1 px-2.5","compact"===l?"h-8 text-xs":"h-9 text-sm",activeClass(e,a))}var h=o.memo.call(void 0,function DropdownItems2({items:a,level:l=0}){return r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"grid min-w-52 gap-1 p-1.5",l>0&&"min-w-48 border-l border-[var(--ug-navigation-border)] pl-2"),children:a.map((a,t)=>{const o=a.icon,n=_nullishCoalesce(_nullishCoalesce(a.id,()=>a.href),()=>`${l}-${t}-${a.label}`);return _optionalChain([a,"access",e=>e.children,"optionalAccess",e=>e.length])?r.jsxs.call(void 0,"div",{className:"grid gap-1",children:[r.jsxs.call(void 0,"div",{className:"flex items-center gap-2 px-2 py-1.5 text-xs font-semibold text-[var(--ug-navigation-text)] opacity-75",children:[r.jsx.call(void 0,o,{"aria-hidden":"true",size:14}),r.jsx.call(void 0,"span",{className:"truncate",children:a.label})]}),r.jsx.call(void 0,DropdownItems2,{items:a.children,level:l+1})]},n):r.jsxs.call(void 0,e.NavigationMenuLink,{active:a.active,className:i.cn.call(void 0,"flex w-full items-center gap-2 px-2.5 py-2",(s=Boolean(a.active),s?"bg-[var(--ug-navigation-active-bg)] text-[var(--ug-navigation-active-text)] hover:bg-[var(--ug-navigation-active-bg)] hover:text-[var(--ug-navigation-active-text)]":"bg-transparent text-[var(--ug-navigation-text)] hover:bg-[var(--ug-navigation-hover-bg)] hover:text-[var(--ug-navigation-text)]")),href:a.href,children:[r.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),r.jsx.call(void 0,"span",{className:"min-w-0 flex-1 truncate",children:a.label}),void 0!==a.badge?r.jsx.call(void 0,"span",{className:"text-xs opacity-70",children:a.badge}):null]},n);var s})})}),p=o.memo.call(void 0,function TopItem2({item:a,active:l,activeStyle:t,density:i}){const o=a.icon,n=topItemClass(l,t,i);return _optionalChain([a,"access",e=>e.children,"optionalAccess",e=>e.length])?r.jsxs.call(void 0,e.NavigationMenuItem,{children:[r.jsxs.call(void 0,e.NavigationMenuTrigger,{active:l,className:n,children:[r.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),r.jsx.call(void 0,"span",{className:"truncate",children:a.label})]}),r.jsx.call(void 0,e.NavigationMenuContent,{className:"max-h-[min(70dvh,32rem)] overflow-y-auto overscroll-contain border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]",children:r.jsx.call(void 0,h,{items:a.children})})]}):r.jsx.call(void 0,e.NavigationMenuItem,{children:r.jsxs.call(void 0,e.NavigationMenuLink,{active:l,className:n,href:a.href,children:[r.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),r.jsx.call(void 0,"span",{className:"truncate",children:a.label})]})})});function AdminHorizontalNavigation({items:a,activeStyle:l,density:t}){const n=o.useMemo.call(void 0,()=>function normalizeItems(e){const a=1===e.length?e[0]:void 0;return _optionalChain([a,"optionalAccess",e=>e.children,"optionalAccess",e=>e.length])?a.href?[{...a,children:void 0},...a.children]:a.children:e}(a),[a]),d=o.useMemo.call(void 0,()=>g.createSidebarTreeMeta.call(void 0,n),[n]),[c,u]=o.useState.call(void 0,()=>Math.min(n.length,6)),v=o.useRef.call(void 0,null),m=o.useRef.call(void 0,null),x=o.useRef.call(void 0,null),b=o.useMemo.call(void 0,()=>n.slice(0,c),[n,c]),f=o.useMemo.call(void 0,()=>n.slice(c),[n,c]),j=o.useCallback.call(void 0,e=>Boolean(e.active||d.activeBranches.has(e)),[d]),w=o.useMemo.call(void 0,()=>f.some(j),[j,f]),C=o.useCallback.call(void 0,()=>{const e=v.current,a=m.current;if(!e||!a||e.clientWidth<=0)return void u(Math.min(n.length,6));const l=Array.from(a.querySelectorAll('[data-ug-navigation-measure="item"]')),t=a.querySelector('[data-ug-navigation-measure="more"]'),i=Number.parseFloat(window.getComputedStyle(a).columnGap)||4,o=_nullishCoalesce(_optionalChain([t,"optionalAccess",e=>e.getBoundingClientRect,"call",e=>e(),"access",e=>e.width]),()=>0);let s=0,r=0;for(let a=0;a<l.length;a+=1){const t=_nullishCoalesce(_optionalChain([l,"access",e=>e[a],"optionalAccess",e=>e.getBoundingClientRect,"call",e=>e(),"access",e=>e.width]),()=>0),n=a>0?i:0;if(s+n+t+(a<l.length-1?i+o:0)>e.clientWidth+.5)break;s+=n+t,r+=1}u(r)},[n]),y=o.useCallback.call(void 0,()=>{null===x.current&&(x.current=window.requestAnimationFrame(()=>{x.current=null,C()}))},[C]);return o.useLayoutEffect.call(void 0,()=>{let e=!1;const a="undefined"==typeof ResizeObserver?void 0:new ResizeObserver(y);return v.current&&_optionalChain([a,"optionalAccess",e=>e.observe,"call",e=>e(v.current)]),y(),_optionalChain([document,"access",e=>e.fonts,"optionalAccess",e=>e.ready,"access",e=>e.then,"call",a=>a(()=>{e||y()})]),()=>{e=!0,null!==x.current&&window.cancelAnimationFrame(x.current),x.current=null,_optionalChain([a,"optionalAccess",e=>e.disconnect,"call",e=>e()])}},[t,y]),r.jsxs.call(void 0,"div",{className:"relative min-w-0 flex-1",ref:v,children:[r.jsxs.call(void 0,"div",{"aria-hidden":"true",className:"pointer-events-none absolute invisible flex max-w-none items-center gap-1 whitespace-nowrap","data-ug-slot":"measure",inert:!0,ref:m,children:[n.map((e,a)=>{const o=e.icon;return r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,topItemClass(j(e),l,t),"max-w-none shrink-0"),"data-ug-navigation-measure":"item",children:[r.jsx.call(void 0,o,{"aria-hidden":"true",size:15}),r.jsx.call(void 0,"span",{children:e.label}),_optionalChain([e,"access",e=>e.children,"optionalAccess",e=>e.length])?r.jsx.call(void 0,s.ChevronDown,{"aria-hidden":"true",size:14}):null]},_nullishCoalesce(_nullishCoalesce(e.id,()=>e.href),()=>`measure-${a}-${e.label}`))}),r.jsxs.call(void 0,"span",{className:moreItemClass(!1,l,t),"data-ug-navigation-measure":"more",children:[r.jsx.call(void 0,s.MoreHorizontal,{"aria-hidden":"true",size:16}),r.jsx.call(void 0,"span",{children:"更多"})]})]}),r.jsxs.call(void 0,e.NavigationMenu,{activation:"click",tone:"inherit",className:"min-w-0 w-full overflow-visible","data-ug-context":"admin-horizontal-navigation",children:[b.map((e,a)=>r.jsx.call(void 0,p,{active:j(e),activeStyle:l,density:t,item:e},_nullishCoalesce(_nullishCoalesce(e.id,()=>e.href),()=>`${a}-${e.label}`))),f.length?r.jsxs.call(void 0,e.NavigationMenuItem,{children:[r.jsxs.call(void 0,e.NavigationMenuTrigger,{active:w,className:moreItemClass(w,l,t),children:[r.jsx.call(void 0,s.MoreHorizontal,{"aria-hidden":"true",size:16}),r.jsx.call(void 0,"span",{children:"更多"})]}),r.jsx.call(void 0,e.NavigationMenuContent,{className:"right-0 left-auto max-h-[min(70dvh,32rem)] overflow-y-auto overscroll-contain border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]",children:r.jsx.call(void 0,h,{items:f})})]}):null]})]})}var m=o.forwardRef.call(void 0,({navItems:a,sidebarHeader:t,sidebarCollapsedHeader:n,sidebarHeaderAlign:d="start",sidebarHeaderDivider:c=!0,sidebarContextSwitcher:u,sidebarContextSwitcherVisible:g=!1,sidebarContextSwitcherDividers:h=!1,sidebarContextSwitcherPlacement:p="after-search",sidebarScrollActiveItemIntoView:m=!0,sidebarFooter:x,sidebarVariant:b="dark",navigationMode:f="sidebar",navigationPalette:j,themePreset:w="default",themeMode:C,themeAccent:y="theme",navigationColors:N,navigationActiveStyle:k,navigationDensity:S,sidebarActiveStyle:T="highlight",sidebarDensity:z="comfortable",sidebarItemHeight:_,sidebarSubItemHeight:A,sidebarSearchable:R=!1,sidebarSearchPlaceholder:M="搜索菜单...",sidebarSearchDividers:L=!0,sidebarCollapsible:I=!0,sidebarTogglePlacement:D="sidebar",sidebarResizable:E=!0,sidebarWidth:B,defaultSidebarWidth:G=256,sidebarMinWidth:F=208,sidebarMaxWidth:V=480,onSidebarWidthChange:$,sidebarCollapsed:P,defaultSidebarCollapsed:U=!1,onSidebarCollapsedChange:W,mobileSidebarOpen:O,onMobileSidebarOpenChange:H,topbarStart:q,topbarEnd:Q,topbar:J,secondaryBar:K,topbarBordered:X=!0,secondaryBarBordered:Y=!1,fluidContent:Z=!1,contentPadding:ee=!0,mainClassName:ae,contentClassName:le,children:te,className:ie,...oe},ne)=>{const se=l.useMediaQuery.call(void 0,"(prefers-color-scheme: dark)"),[re,de]=o.useState.call(void 0,U),[ce,ue]=o.useState.call(void 0,!1),ve=_nullishCoalesce(P,()=>re),ge=_nullishCoalesce(O,()=>ce),he=_nullishCoalesce(j,()=>"primary"===b?"light":"dark"),pe=void 0===C?he:v.resolveUGNavigationPalette.call(void 0,C,se),me=N?he:pe,xe=v.resolveUGNavigationColors.call(void 0,w,me,N,y),be=_nullishCoalesce(k,()=>T),fe=_nullishCoalesce(S,()=>z),je="light"===me?"primary":"dark",we={"--ug-navigation-bg":xe.background,"--ug-navigation-text":xe.text,"--ug-navigation-active-bg":xe.activeBackground,"--ug-navigation-active-text":xe.activeText,"--ug-navigation-hover-bg":xe.hoverBackground,"--ug-navigation-border":`color-mix(in srgb, ${xe.text} 18%, ${xe.background})`};function setSidebarCollapsed(e){void 0===P&&de(e),_optionalChain([W,"optionalCall",a=>a(e)])}function setMobileOpen(e){void 0===O&&ue(e),_optionalChain([H,"optionalCall",a=>a(e)])}return r.jsx.call(void 0,"div",{ref:ne,className:i.cn.call(void 0,"text-text-primary",ie),...oe,"data-ug":"admin-shell","data-state":ge?"mobile-open":"default","data-variant":je,"data-navigation-mode":f,"data-navigation-palette":me,"data-sidebar-active-style":be,"data-sidebar-density":fe,"data-size":"md",children:r.jsxs.call(void 0,"div",{className:"flex min-h-screen min-w-0",children:[r.jsx.call(void 0,e.Sidebar,{items:a,variant:je,activeStyle:be,density:fe,itemHeight:_,subItemHeight:A,colors:xe,header:t,headerAlign:d,headerDivider:c,collapsedHeader:n,contextSwitcher:u,contextSwitcherVisible:g,contextSwitcherDividers:h,contextSwitcherPlacement:p,scrollActiveItemIntoView:m,footer:x,searchable:R,searchPlaceholder:M,searchDividers:L,collapsible:I&&"sidebar"===D,bottomCollapsible:I&&"bottom"===D,resizable:E,width:B,defaultWidth:G,minWidth:F,maxWidth:V,onWidthChange:$,collapsed:ve,onCollapsedChange:setSidebarCollapsed,responsive:!0,mobileOpen:ge,onMobileOpenChange:setMobileOpen,className:i.cn.call(void 0,"shrink-0","header"===f&&"lg:hidden"),"data-ug-slot":"sidebar"}),r.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-1 flex-col",children:[r.jsxs.call(void 0,"header",{className:i.cn.call(void 0,"sticky top-0 z-30 flex items-center gap-[calc(var(--content-gap)*0.75)] px-[var(--content-gap)] sm:px-[calc(var(--content-gap)*1.25)] lg:px-[calc(var(--content-gap)*1.5)]",X?"border-b":"border-b-0","header"===f?"border-[var(--ug-navigation-border)] bg-[var(--ug-navigation-bg)] text-[var(--ug-navigation-text)]":"border-border-base bg-surface-0"),style:"header"===f?we:void 0,"data-ug-slot":"topbar",children:[r.jsx.call(void 0,i.Button,{type:"button",variant:"ghost",size:"icon",className:"md:hidden","aria-label":"打开侧边栏",onClick:()=>setMobileOpen(!0),"data-ug-slot":"mobile-trigger",children:r.jsx.call(void 0,s.Menu,{"aria-hidden":"true",focusable:"false",size:18})}),"sidebar"===f&&I&&"topbar"===D?r.jsx.call(void 0,i.Button,{type:"button",variant:"ghost",size:"icon",className:"hidden md:inline-flex","aria-label":ve?"展开侧边栏":"折叠侧边栏",onClick:()=>setSidebarCollapsed(!ve),"data-ug-slot":"desktop-sidebar-trigger",children:ve?r.jsx.call(void 0,s.PanelLeftOpen,{"aria-hidden":"true",focusable:"false",size:18}):r.jsx.call(void 0,s.PanelLeftClose,{"aria-hidden":"true",focusable:"false",size:18})}):null,"header"===f?r.jsxs.call(void 0,r.Fragment,{children:[r.jsx.call(void 0,"div",{className:"hidden shrink-0 items-center lg:flex",children:t}),r.jsx.call(void 0,"div",{className:"hidden min-w-0 flex-1 lg:flex",children:r.jsx.call(void 0,AdminHorizontalNavigation,{activeStyle:be,density:fe,items:a})}),r.jsx.call(void 0,"div",{className:"min-w-0 flex-1 lg:hidden","data-ug-slot":"topbar-start",children:q})]}):J?r.jsx.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"topbar-content",children:J}):r.jsx.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"topbar-start",children:q}),"header"!==f&&J||!Q?null:r.jsx.call(void 0,"div",{className:"flex shrink-0 items-center gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"topbar-end",children:Q},"topbar-end")]}),K?r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"sticky top-[var(--ug-admin-shell-topbar-height)] z-20 bg-surface-1",Y&&"border-b border-border-base"),"data-ug-slot":"secondary-bar",children:K}):null,r.jsx.call(void 0,"main",{className:i.cn.call(void 0,"flex-1 overflow-x-clip",ae),"data-ug-slot":"main",children:r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"mx-auto",Z?"max-w-none":"max-w-7xl",ee?"px-[var(--content-gap)] py-[calc(var(--content-gap)*1.5)] sm:px-[calc(var(--content-gap)*1.25)] lg:px-[calc(var(--content-gap)*1.5)]":"!p-0",le),"data-ug-context":"admin-shell","data-ug-slot":"content",children:te})})]})]})})});function getScrollBehavior(e){return e.closest('[data-ug-motion="reduced"]')||"function"==typeof window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches?"auto":"smooth"}function getTabElements(e){return Array.from(e.children).filter(e=>e instanceof HTMLLIElement&&"item"===e.dataset.ugSlot)}function clearItemMotion(e){delete e.dataset.motion,e.style.removeProperty("--ug-app-tabs-motion-x")}function playItemMotion(e,a,l=0){const t=Boolean(e.dataset.motion);clearItemMotion(e),t&&e.offsetWidth,"move"===a&&e.style.setProperty("--ug-app-tabs-motion-x",`${l}px`),e.dataset.motion=a}m.displayName="AdminShell";var x=o.memo.call(void 0,({active:e,activeItemRef:a,closable:l,closeEnabled:t,icon:i,label:o,onActivate:n,onClose:d,value:c})=>r.jsxs.call(void 0,"li",{"data-closable":l||void 0,"data-state":e?"active":"default","data-ug-slot":"item","data-value":c,ref:e?a:void 0,children:[r.jsxs.call(void 0,"button",{"aria-current":e?"page":void 0,"data-ug-slot":"trigger",onAuxClick:e=>{1===e.button&&l&&t&&(e.preventDefault(),d(c))},onClick:()=>n(c),title:o,type:"button",children:[i?r.jsx.call(void 0,"span",{"aria-hidden":"true","data-ug-slot":"icon",children:i}):null,r.jsx.call(void 0,"span",{"data-ug-slot":"label",children:o})]}),l&&t?r.jsx.call(void 0,"button",{"aria-label":`关闭页面 ${o}`,"data-ug-slot":"close",onClick:()=>d(c),type:"button",children:r.jsx.call(void 0,s.X,{"aria-hidden":"true",size:13})}):null]}));x.displayName="AppTabView";var b=o.forwardRef.call(void 0,({items:e,value:a,density:l="comfortable",showIcons:t=!0,closable:n=!0,bordered:d=!0,onValueChange:c,onClose:u,className:v,"aria-label":g="页面标签",...h},p)=>{const m=o.useRef.call(void 0,null),b=o.useRef.call(void 0,null),f=o.useRef.call(void 0,null),j=o.useRef.call(void 0,null),w=o.useRef.call(void 0,null),C=o.useRef.call(void 0,new Map),y=o.useRef.call(void 0,null),N=o.useRef.call(void 0,e),k=o.useRef.call(void 0,c),S=o.useRef.call(void 0,u),[T,z]=o.useState.call(void 0,{canScrollStart:!1,canScrollEnd:!1}),_=T.canScrollStart||T.canScrollEnd,A=o.useMemo.call(void 0,()=>e.map(e=>`${e.value}${e.label}${n&&e.closable?"1":"0"}${t&&e.icon?"1":"0"}`).join(""),[n,e,t]);N.current=e,k.current=c,S.current=u;const R=o.useCallback.call(void 0,e=>{const a=N.current.find(a=>a.value===e);a&&k.current(a)},[]),M=o.useCallback.call(void 0,e=>{const a=N.current.find(a=>a.value===e);if(!a)return;const l=b.current;_optionalChain([l?getTabElements(l).find(a=>a.dataset.value===e):null,"optionalAccess",e=>e.contains,"call",e=>e(document.activeElement)])&&(y.current=e),_optionalChain([S,"access",e=>e.current,"optionalCall",e=>e(a)])},[]),L=o.useCallback.call(void 0,()=>{null===j.current&&(j.current=window.requestAnimationFrame(()=>{j.current=null;const e=b.current;if(!e)return;const a=Math.max(0,e.scrollWidth-e.clientWidth),l={canScrollStart:e.scrollLeft>1,canScrollEnd:e.scrollLeft<a-1};z(e=>e.canScrollStart===l.canScrollStart&&e.canScrollEnd===l.canScrollEnd?e:l)}))},[]),I=o.useCallback.call(void 0,e=>{const a=b.current,l=f.current;if(!a||!l)return;const t=getTabElements(a);if(l===t[0]&&a.scrollLeft>1)return void a.scrollBy({behavior:e,left:-a.scrollLeft});const i=Math.max(0,a.scrollWidth-a.clientWidth);if(l===t[t.length-1]&&a.scrollLeft<i-1)return void a.scrollBy({behavior:e,left:i-a.scrollLeft});const o=l.offsetLeft-a.scrollLeft,n=o+l.offsetWidth-a.clientWidth;o<0?a.scrollBy({behavior:e,left:o-2}):n>0&&a.scrollBy({behavior:e,left:n+2})},[]);function scrollTabs(e){const a=b.current;a&&a.scrollBy({behavior:getScrollBehavior(a),left:e*Math.max(160,.6*a.clientWidth)})}return o.useLayoutEffect.call(void 0,()=>{const e=b.current;if(!e)return;const a=getTabElements(e),l=new Map;for(const e of a){const a=e.dataset.value;a&&l.set(a,e.offsetLeft)}const t=C.current;if(t.size>0&&"auto"!==getScrollBehavior(e))for(const e of a){const a=e.dataset.value;if(!a)continue;const i=t.get(a),o=_nullishCoalesce(l.get(a),()=>0),n=void 0===i?0:i-o;void 0!==i&&Math.abs(n)<.5||playItemMotion(e,void 0===i?"enter":"move",n)}C.current=l},[A]),o.useLayoutEffect.call(void 0,()=>{const e=y.current;if(!e||N.current.some(a=>a.value===e))return;const a=_optionalChain([b,"access",e=>e.current,"optionalAccess",e=>e.querySelector,"call",e=>e('[data-ug-slot="item"][data-state="active"] [data-ug-slot="trigger"]')]);a&&(y.current=null,a.focus({preventScroll:!0}))},[A,a]),o.useEffect.call(void 0,()=>{const e=m.current,a=b.current;if(!e||!a)return;L(),a.addEventListener("scroll",L,{passive:!0});const handleContainerResize=()=>{L(),null!==w.current&&window.cancelAnimationFrame(w.current),w.current=window.requestAnimationFrame(()=>{w.current=window.requestAnimationFrame(()=>{w.current=null,I("auto"),L()})})},l="undefined"==typeof ResizeObserver?null:new ResizeObserver(handleContainerResize);return l?l.observe(e):window.addEventListener("resize",handleContainerResize),()=>{a.removeEventListener("scroll",L),l?l.disconnect():window.removeEventListener("resize",handleContainerResize),null!==j.current&&(window.cancelAnimationFrame(j.current),j.current=null),null!==w.current&&(window.cancelAnimationFrame(w.current),w.current=null)}},[I,L]),o.useEffect.call(void 0,()=>{if(!e.some(e=>e.value===a))return;const l=b.current;l&&(I(getScrollBehavior(l)),L())},[e,I,L,a]),r.jsx.call(void 0,"nav",{ref:p,...h,"aria-label":g,className:i.cn.call(void 0,"text-text-primary",!d&&"[background-image:none]",v),"data-density":l,"data-overflow":_||void 0,"data-size":"md","data-state":_?"overflow":"default","data-ug":"app-tabs","data-variant":"browser",children:r.jsxs.call(void 0,"div",{"data-ug-slot":"track",ref:m,children:[r.jsx.call(void 0,"button",{"aria-label":"向左滚动页面标签","data-ug-slot":"scroll-start","data-visible":_&&T.canScrollStart||void 0,disabled:!T.canScrollStart,onClick:()=>scrollTabs(-1),type:"button",children:r.jsx.call(void 0,s.ChevronLeft,{"aria-hidden":"true",size:15})}),r.jsx.call(void 0,"ul",{ref:b,"aria-label":"页面标签列表","data-ug-slot":"list",onAnimationEnd:e=>{["ug-motion-app-tab-enter","ug-motion-app-tab-layout-shift"].includes(e.animationName)&&clearItemMotion(e.target)},children:e.map(e=>r.jsx.call(void 0,x,{active:e.value===a,activeItemRef:f,closable:n&&Boolean(e.closable),closeEnabled:n&&Boolean(u),icon:t?e.icon:void 0,label:e.label,onActivate:R,onClose:M,value:e.value},e.value))}),r.jsx.call(void 0,"button",{"aria-label":"向右滚动页面标签","data-ug-slot":"scroll-end","data-visible":_&&T.canScrollEnd||void 0,disabled:!T.canScrollEnd,onClick:()=>scrollTabs(1),type:"button",children:r.jsx.call(void 0,s.ChevronRight,{"aria-hidden":"true",size:15})})]})})});b.displayName="AppTabs";var f=o.forwardRef.call(void 0,({open:a,onOpenChange:l,title:t,description:o,children:n,variant:d="destructive",icon:c,cancelText:u="取消",confirmText:v="确认",loading:g=!1,disabled:h=!1,closeOnConfirm:p=!0,onCancel:m,onConfirm:x,className:b,...f},j)=>{const w=_nullishCoalesce(c,()=>"destructive"===d?s.AlertTriangle:s.HelpCircle);function handleCancel(){g||(_optionalChain([m,"optionalCall",e=>e()]),l(!1))}return r.jsx.call(void 0,e.Modal,{open:a,onClose:handleCancel,closeOnEsc:!g,closeOnOverlay:!g,children:r.jsxs.call(void 0,e.ModalContent,{ref:j,className:i.cn.call(void 0,"max-w-md",b),...f,"data-ug":"confirm-dialog","data-state":a?"open":"default","data-variant":d,"data-size":"md",children:[r.jsxs.call(void 0,e.ModalHeader,{className:"items-start gap-[calc(var(--content-gap)*0.75)]","data-ug-slot":"header",children:[r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"flex h-[var(--control-height-md)] w-[var(--control-height-md)] shrink-0 items-center justify-center rounded-[var(--radius-control)]","destructive"===d?"bg-danger-soft text-danger-soft-fg":"bg-primary-soft text-primary-soft-fg"),"data-ug-slot":"icon",children:r.jsx.call(void 0,w,{size:20,"aria-hidden":"true"})}),r.jsxs.call(void 0,"div",{className:"min-w-0 flex-1 space-y-[calc(var(--content-gap)*0.25)]","data-ug-slot":"content",children:[r.jsx.call(void 0,e.ModalTitle,{className:"break-words text-base","data-ug-slot":"title",children:t}),o?r.jsx.call(void 0,"p",{className:"text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:o}):null]})]}),n?r.jsx.call(void 0,"div",{className:"px-[var(--content-gap)] py-[var(--content-gap)] text-sm text-text-secondary","data-ug-slot":"body",children:n}):null,r.jsxs.call(void 0,e.ModalFooter,{className:"flex-col-reverse gap-[calc(var(--content-gap)*0.5)] sm:flex-row","data-ug-slot":"footer",children:[r.jsx.call(void 0,i.Button,{type:"button",variant:"outline",disabled:g,onClick:handleCancel,"data-ug-slot":"cancel",children:u}),r.jsx.call(void 0,i.Button,{type:"button",variant:"destructive"===d?"destructive":"default",loading:g,disabled:h,onClick:function handleConfirm(){const e=_optionalChain([x,"optionalCall",e=>e()]);return p&&l(!1),e},"data-ug-slot":"confirm",children:v})]})]})})});f.displayName="ConfirmDialog";var j=o.forwardRef.call(void 0,({value:e,label:a,displayValue:l,monospace:t=!0,disabled:n=!1,bordered:d=!0,showIcon:c=!0,showCopyText:u=!0,copyLabel:v="复制",copiedLabel:g="已复制",onCopied:h,onCopyError:p,className:m,...x},b)=>{const[f,j]=o.useState.call(void 0,!1),w=o.useRef.call(void 0,null),C=o.useRef.call(void 0,{value:e,generation:0,mounted:!0});return C.current.value!==e&&(C.current.value=e,C.current.generation++),o.useEffect.call(void 0,()=>(C.current.mounted=!0,()=>{C.current.mounted=!1,C.current.generation++,w.current&&clearTimeout(w.current)}),[]),o.useEffect.call(void 0,()=>{j(!1),w.current&&(clearTimeout(w.current),w.current=null)},[e]),r.jsxs.call(void 0,"div",{ref:b,className:i.cn.call(void 0,"space-y-[calc(var(--content-gap)*0.5)]",m),...x,"data-ug":"copy-field","data-state":n?"disabled":f?"copied":"default","data-variant":t?"monospace":"default","data-bordered":d?"true":"false","data-size":"md",children:[a?r.jsx.call(void 0,"div",{className:"text-xs font-medium text-text-secondary","data-ug-slot":"label",children:a}):null,r.jsxs.call(void 0,"div",{className:i.cn.call(void 0,"flex min-w-0 items-stretch overflow-hidden rounded-[var(--radius-control)] bg-surface-1",d&&"border border-border-base",n&&"opacity-60"),"data-ug-slot":"field",children:[r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"min-w-0 flex-1 self-center truncate px-[var(--control-padding-x-sm)] py-[calc(var(--content-gap)*0.5)] text-sm text-text-primary",t&&"font-mono"),title:"string"==typeof l?l:e,"data-ug-slot":"value",children:_nullishCoalesce(l,()=>e)}),r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"flex shrink-0 items-center bg-surface-2 px-[calc(var(--content-gap)*0.375)]",d&&"border-l border-border-base"),"data-ug-slot":"action",children:r.jsxs.call(void 0,i.Button,{type:"button",variant:"ghost",size:"sm",disabled:n,onClick:async function handleCopy(){if(n)return;const a=e,l=++C.current.generation,isCurrent=()=>C.current.mounted&&C.current.generation===l&&C.current.value===a;j(!1),w.current&&(clearTimeout(w.current),w.current=null);try{if(!_optionalChain([navigator,"access",e=>e.clipboard,"optionalAccess",e=>e.writeText]))throw new Error("Clipboard API is not available");if(await navigator.clipboard.writeText(a),!isCurrent())return;if(j(!0),_optionalChain([h,"optionalCall",e=>e(a)]),!isCurrent())return;w.current&&clearTimeout(w.current),w.current=setTimeout(()=>{isCurrent()&&j(!1),w.current=null},1400)}catch(e){isCurrent()&&_optionalChain([p,"optionalCall",a=>a(e)])}},"aria-label":u?void 0:f?g:v,"aria-live":"polite","data-ug-slot":"button",children:[c?f?r.jsx.call(void 0,s.Check,{"aria-hidden":"true",focusable:"false",size:15}):r.jsx.call(void 0,s.Copy,{"aria-hidden":"true",focusable:"false",size:15}):null,u?f?g:v:null]})})]})]})});function DataTableIdentity({title:e,description:a,leading:l,showLeading:t=!0,showDescription:o=!0,className:n,...s}){return r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,"gap-[calc(var(--content-gap)*0.5)]",n),...s,"data-size":"md","data-state":"default","data-ug":"data-table-identity","data-variant":"default",children:[t&&l?r.jsx.call(void 0,"span",{"data-ug-slot":"leading",children:l}):null,r.jsxs.call(void 0,"span",{"data-ug-slot":"copy",children:[r.jsx.call(void 0,"strong",{"data-ug-slot":"title",children:e}),o&&a?r.jsx.call(void 0,"small",{className:"text-text-secondary","data-ug-slot":"description",children:a}):null]})]})}function DataTableToolbar({title:e,description:a,showDescription:l=!0,bordered:t=!0,compact:o=!1,actions:n,children:s,className:d,...c}){return r.jsxs.call(void 0,"div",{className:i.cn.call(void 0,"gap-[var(--content-gap)] border-border-base",!t&&"border-b-0",o&&"py-[calc(var(--content-gap)*0.5)]",d),...c,"data-size":o?"sm":"md","data-state":"default","data-ug":"data-table-toolbar","data-variant":"default",children:[r.jsxs.call(void 0,"div",{"data-ug-slot":"heading",children:[r.jsx.call(void 0,"strong",{"data-ug-slot":"title",children:e}),l&&a?r.jsx.call(void 0,"span",{"data-ug-slot":"description",children:a}):null]}),s?r.jsx.call(void 0,"div",{"data-ug-slot":"filters",children:s}):null,n?r.jsx.call(void 0,"div",{className:"flex shrink-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"actions",children:n}):null]})}j.displayName="CopyField";var w=o.forwardRef.call(void 0,({eyebrow:e,title:a,description:l,descriptionDisplay:t="inline",badge:o,breadcrumb:n,actions:s,meta:d,bordered:c=!0,compact:u=!1,size:v="md",children:g,className:h,...p},m)=>r.jsxs.call(void 0,"header",{ref:m,className:i.cn.call(void 0,"flex min-w-0 flex-col",u?"gap-[calc(var(--content-gap)*0.875)]":"gap-[calc(var(--content-gap)*1.25)]",c&&(u?"border-b border-border-base pb-[var(--content-gap)]":"border-b border-border-base pb-[calc(var(--content-gap)*1.5)]"),h),...p,"data-ug":"page-header","data-state":"default","data-variant":c?"default":"borderless","data-size":"sm"===v||u?"sm":"md","data-description-display":t,children:[n?r.jsx.call(void 0,"div",{className:"min-w-0","data-ug-slot":"breadcrumb",children:n}):null,r.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-col gap-[var(--content-gap)] lg:flex-row lg:items-start lg:justify-between","data-ug-slot":"body",children:[r.jsxs.call(void 0,"div",{className:"min-w-0 space-y-[calc(var(--content-gap)*0.75)]","data-ug-slot":"content",children:[e?r.jsx.call(void 0,"div",{className:"text-xs font-semibold uppercase text-primary","data-ug-slot":"eyebrow",children:e}):null,r.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.625)]",children:[r.jsx.call(void 0,"h1",{className:"sm"===v?"min-w-0 break-words text-lg font-semibold leading-snug text-text-primary":"min-w-0 break-words text-2xl font-bold leading-tight text-text-primary sm:text-3xl","data-ug-slot":"title",children:a}),o?r.jsx.call(void 0,"div",{className:"shrink-0","data-ug-slot":"badge",children:o}):null]}),l&&"hidden"!==t?r.jsx.call(void 0,"p",{className:"max-w-3xl text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:l}):null,d?r.jsx.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center gap-x-[var(--content-gap)] gap-y-[calc(var(--content-gap)*0.5)] text-xs text-text-tertiary","data-ug-slot":"meta",children:d}):null]}),s?r.jsx.call(void 0,"div",{className:"flex shrink-0 flex-wrap items-center gap-[calc(var(--content-gap)*0.5)] lg:justify-end","data-ug-slot":"actions",children:s}):null]}),g?r.jsx.call(void 0,"div",{className:"min-w-0","data-ug-slot":"footer",children:g}):null]}));w.displayName="PageHeader";var C={2:"md:grid-cols-2 xl:grid-cols-2",3:"md:grid-cols-2 lg:grid-cols-3",4:"md:grid-cols-2 xl:grid-cols-4"};function QuickAccessContent({item:e,showIcon:a,showIndicator:l}){const t=e.icon,o=Boolean(a&&t);return r.jsxs.call(void 0,r.Fragment,{children:[o&&t?r.jsx.call(void 0,"span",{"aria-hidden":"true",className:"flex h-[var(--control-height-lg)] w-[var(--control-height-lg)] shrink-0 items-center justify-center rounded-[var(--radius-control)] bg-primary-soft text-primary-soft-fg","data-ug-slot":"icon",children:r.jsx.call(void 0,t,{size:20})}):null,r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,"min-w-0",!o&&"col-start-1"),"data-ug-slot":"content",children:[r.jsxs.call(void 0,"span",{className:"flex min-w-0 flex-wrap items-center gap-x-[calc(var(--content-gap)*0.5)] gap-y-1",children:[r.jsx.call(void 0,"strong",{className:"min-w-0 break-words text-sm font-semibold leading-5","data-ug-slot":"item-title",children:e.title}),e.meta?r.jsx.call(void 0,"span",{className:"text-xs leading-5 text-text-tertiary","data-ug-slot":"meta",children:e.meta}):null]}),e.description?r.jsx.call(void 0,"span",{className:"mt-1 block break-words text-xs leading-5 text-text-secondary","data-ug-slot":"item-description",children:e.description}):null]}),l?r.jsx.call(void 0,s.ArrowRight,{"aria-hidden":"true",className:i.cn.call(void 0,"shrink-0 text-text-tertiary transition-[color] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)] group-hover:text-primary",!o&&"col-start-2"),"data-ug-slot":"indicator",size:16}):null]})}var y=o.forwardRef.call(void 0,({title:e,description:a,items:l,columns:t=4,showIndicator:o=!0,showIcon:n=!0,bordered:s=!0,onSelect:d,className:c,...u},v)=>r.jsxs.call(void 0,"section",{ref:v,...u,className:i.cn.call(void 0,"min-w-0 space-y-[var(--content-gap)]",c),"data-ug":"quick-access","data-state":l.length>0?"ready":"empty","data-variant":t,"data-size":"md",children:[e||a?r.jsxs.call(void 0,"div",{className:"min-w-0 space-y-1","data-ug-slot":"header",children:[e?r.jsx.call(void 0,"h2",{className:"text-base font-semibold leading-6 text-text-primary","data-ug-slot":"title",children:e}):null,a?r.jsx.call(void 0,"p",{className:"text-sm leading-6 text-text-secondary","data-ug-slot":"description",children:a}):null]}):null,r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"grid min-w-0 gap-[var(--content-gap)]",C[t]),"data-ug-slot":"grid",children:l.map(e=>{const a=e.disabled?"disabled":"interactive",l=function getItemClasses(e,a,l){const t=a&&l?"grid-cols-[auto_minmax(0,1fr)_auto]":a?"grid-cols-[auto_minmax(0,1fr)]":l?"grid-cols-[minmax(0,1fr)_auto]":"grid-cols-[minmax(0,1fr)]";return i.cn.call(void 0,"group grid min-h-[calc(var(--control-height-lg)*2)] min-w-0 w-full items-center gap-[var(--content-gap)]",t,"rounded-[var(--radius-panel)] bg-surface-1 p-[var(--content-gap)] text-left text-text-primary shadow-sm",e?"border border-border-base hover:border-border-strong":"border border-transparent","transition-[background-color,border-color,box-shadow] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)]","hover:bg-surface-2 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary focus-visible:ring-offset-2","disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:border-border-base disabled:hover:bg-surface-1 disabled:hover:shadow-sm")}(s,Boolean(n&&e.icon),o);return e.href&&!e.disabled?r.jsx.call(void 0,"a",{className:l,"data-state":a,"data-ug-slot":"item",href:e.href,onClick:()=>_optionalChain([d,"optionalCall",a=>a(e)]),children:r.jsx.call(void 0,QuickAccessContent,{item:e,showIcon:n,showIndicator:o})},e.id):r.jsx.call(void 0,"button",{className:l,"data-state":a,"data-ug-slot":"item",disabled:e.disabled,onClick:()=>_optionalChain([d,"optionalCall",a=>a(e)]),type:"button",children:r.jsx.call(void 0,QuickAccessContent,{item:e,showIcon:n,showIndicator:o})},e.id)})})]}));y.displayName="QuickAccess";var N=o.forwardRef.call(void 0,({value:e,onValueChange:l,onSubmit:t,onStop:o,onPasteFiles:n,header:d,leading:c,trailing:u,footer:v,submitting:g=!1,disabled:h=!1,submitDisabled:p=!1,allowEmpty:m=!1,submitOnEnter:x=!0,inputLabel:b="消息输入",placeholder:f,submitLabel:j="发送",stopLabel:w="停止",bordered:C=!0,showCharacterCount:y=!1,maxLength:N,shortcutHint:k,showShortcutHint:S,textareaProps:T,className:z,..._},A)=>{const R=!h&&!g&&!p&&(m||e.trim().length>0);function submit(){R&&t(e)}const M=_nullishCoalesce(S,()=>Boolean(k))?_nullishCoalesce(k,()=>x?"Enter 发送 · Shift+Enter 换行":null):null,L=y||Boolean(M);return r.jsxs.call(void 0,"div",{className:i.cn.call(void 0,"grid min-w-0 gap-[calc(var(--content-gap)*0.625)] rounded-[var(--radius-panel)] bg-surface-1 p-[calc(var(--content-gap)*0.75)] shadow-sm transition-[border-color,box-shadow]",C?"border border-border-strong focus-within:border-primary/70":"border border-transparent",h&&"opacity-60",z),..._,"data-ug":"prompt-composer","data-state":h?"disabled":g?"submitting":"default","data-variant":"default","data-size":"md",children:[d?r.jsx.call(void 0,"div",{className:"min-w-0","data-ug-slot":"header",children:d}):null,r.jsxs.call(void 0,"div",{className:"flex min-w-0 items-end gap-[calc(var(--content-gap)*0.5)]","data-ug-slot":"body",children:[c?r.jsx.call(void 0,"div",{className:"flex h-[var(--control-height-md)] shrink-0 items-center","data-ug-slot":"leading",children:c}):null,r.jsx.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"input",children:r.jsx.call(void 0,a.Textarea,{...T,ref:A,"aria-label":_nullishCoalesce(_optionalChain([T,"optionalAccess",e=>e["aria-label"]]),()=>b),autosize:_nullishCoalesce(_optionalChain([T,"optionalAccess",e=>e.autosize]),()=>({minRows:1,maxRows:8})),className:i.cn.call(void 0,"min-h-[var(--control-height-md)] border-transparent bg-transparent px-[calc(var(--control-padding-x-sm)*0.5)] py-[var(--ug-prompt-input-padding-y)] shadow-none focus-visible:!border-transparent focus-visible:!ring-0 focus-visible:!ring-offset-0",_optionalChain([T,"optionalAccess",e=>e.className])),disabled:h,maxLength:_nullishCoalesce(N,()=>_optionalChain([T,"optionalAccess",e=>e.maxLength])),onKeyDown:function handleKeyDown(e){x&&"Enter"===e.key&&(e.shiftKey||e.nativeEvent.isComposing||(e.preventDefault(),submit()))},onPaste:function handlePaste(e){if(!n)return;const a=Array.from(e.clipboardData.files);a.length>0&&n(a,e)},onValueChange:l,placeholder:_nullishCoalesce(f,()=>_optionalChain([T,"optionalAccess",e=>e.placeholder])),resize:"none",value:e})}),u?r.jsx.call(void 0,"div",{className:"flex h-[var(--control-height-md)] shrink-0 items-center gap-1","data-ug-slot":"trailing",children:u}):null,g&&o?r.jsx.call(void 0,i.Button,{"aria-label":w,onClick:o,size:"icon",tone:"danger",type:"button",variant:"soft","data-ug-slot":"submit",children:r.jsx.call(void 0,s.Square,{"aria-hidden":"true",size:15})}):r.jsx.call(void 0,i.Button,{"aria-label":j,disabled:!R,onClick:submit,size:"icon",tone:"primary",type:"button",variant:"solid","data-ug-slot":"submit",children:r.jsx.call(void 0,s.Send,{"aria-hidden":"true",size:16})})]}),v||L?r.jsxs.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2 text-xs text-text-tertiary","data-ug-slot":"footer",children:[v?r.jsx.call(void 0,"div",{className:"min-w-0 flex-1",children:v}):null,L?r.jsxs.call(void 0,"div",{className:"ml-auto flex shrink-0 items-center gap-3 tabular-nums","data-ug-slot":"footer-meta",children:[M?r.jsx.call(void 0,"span",{"data-ug-slot":"shortcut-hint",children:M}):null,y?r.jsx.call(void 0,"span",{"data-ug-slot":"character-count",children:void 0!==N?`${e.length}/${N}`:`${e.length}`}):null]}):null]}):null]})});N.displayName="PromptComposer";var k=o.forwardRef.call(void 0,({messageRole:e,status:a="idle",avatar:l,header:t,footer:o,children:n,className:s,...d},c)=>r.jsxs.call(void 0,"article",{ref:c,className:i.cn.call(void 0,"flex min-w-0 gap-[calc(var(--content-gap)*0.75)]","user"===e&&"justify-end",s),...d,"data-ug":"message","data-state":a,"data-variant":e,"data-size":"md",children:[l&&"user"!==e?r.jsx.call(void 0,"div",{className:"shrink-0","data-ug-slot":"avatar",children:l}):null,r.jsxs.call(void 0,"div",{className:i.cn.call(void 0,"grid min-w-0 gap-[calc(var(--content-gap)*0.5)]","user"===e?"max-w-[min(85%,44rem)] rounded-[var(--radius-panel)] bg-surface-2 px-[var(--control-padding-x-lg)] py-[calc(var(--content-gap)*0.75)]":"w-full","error"===a&&"text-danger"),"data-ug-slot":"body",children:[t?r.jsx.call(void 0,"div",{className:"text-xs font-medium text-text-secondary","data-ug-slot":"header",children:t}):null,r.jsxs.call(void 0,"div",{className:"min-w-0 break-words text-sm leading-7 text-text-primary","data-ug-slot":"content",children:[n,"streaming"===a?r.jsx.call(void 0,"span",{"aria-label":"正在生成",className:"ml-1 inline-block size-1.5 animate-pulse rounded-full bg-primary motion-reduce:animate-none","data-ug-slot":"streaming"}):null]}),o?r.jsx.call(void 0,"div",{className:"flex min-w-0 flex-wrap items-center gap-2 text-xs text-text-tertiary","data-ug-slot":"footer",children:o}):null]}),l&&"user"===e?r.jsx.call(void 0,"div",{className:"shrink-0","data-ug-slot":"avatar",children:l}):null]}));k.displayName="Message";var S=o.forwardRef.call(void 0,({empty:e,followOutput:a=!0,followThreshold:l=80,children:t,className:n,onScroll:s,...d},c)=>{const u=o.useRef.call(void 0,null),v=o.useRef.call(void 0,!0),g=o.Children.count(t)>0;return o.useEffect.call(void 0,()=>{const e=u.current;a&&e&&v.current&&_optionalChain([e,"access",e=>e.scrollTo,"optionalCall",a=>a({top:e.scrollHeight,behavior:"auto"})])},[t,a]),r.jsx.call(void 0,"div",{ref:function setRef(e){u.current=e,"function"==typeof c?c(e):c&&(c.current=e)},"aria-live":"polite","aria-relevant":"additions text",className:i.cn.call(void 0,"grid min-w-0 gap-[calc(var(--content-gap)*1.5)] overflow-y-auto overscroll-contain [min-height:0] [scrollbar-color:var(--color-border-strong)_transparent] [scrollbar-width:thin]",g?"content-start":"content-center",n),onScroll:function handleScroll(e){const a=e.currentTarget;v.current=a.scrollHeight-a.scrollTop-a.clientHeight<=Math.max(0,l),_optionalChain([s,"optionalCall",a=>a(e)])},role:"log",tabIndex:0,...d,"data-ug":"message-list","data-state":g?"populated":"empty","data-variant":a?"follow":"static","data-size":"md",children:g?t:r.jsx.call(void 0,"div",{className:"grid place-items-center text-center text-sm text-text-secondary [min-height:calc(var(--control-height-lg)*4)]","data-ug-slot":"empty",children:e})})});S.displayName="MessageList";var T=o.forwardRef.call(void 0,({items:e,onRemove:a,renderPreview:l,orientation:t="horizontal",showPreview:o=!0,showStatus:n=!0,showMeta:d=!0,bordered:c=!0,compact:u=!1,getRemoveLabel:v=e=>`移除附件:${e.name}`,empty:g,className:h,tabIndex:p,...m},x)=>0!==e.length||g?r.jsx.call(void 0,"ul",{ref:x,"aria-label":"附件",className:i.cn.call(void 0,"min-w-0 gap-[calc(var(--content-gap)*0.5)]","horizontal"===t?"flex overflow-x-auto pb-1 [scrollbar-width:thin]":"grid",h),tabIndex:_nullishCoalesce(p,()=>"horizontal"===t?0:void 0),...m,"data-ug":"attachment-list","data-state":e.length>0?"populated":"empty","data-variant":t,"data-size":u?"xs":"sm",children:0===e.length?r.jsx.call(void 0,"li",{className:"text-sm text-text-secondary","data-ug-slot":"empty",children:g}):e.map(e=>{const g=_optionalChain([e,"access",e=>e.mime,"optionalAccess",e=>e.startsWith,"call",e=>e("image/")])&&e.previewUrl,h=_nullishCoalesce(e.status,()=>"ready"),p=n?_nullishCoalesce(e.statusLabel,()=>({uploading:"正在上传",success:"上传完成",error:"上传失败"}[h])):void 0,m="uploading"===h?s.LoaderCircle:"success"===h?s.CircleCheck:"error"===h?s.TriangleAlert:null,x=d?e.meta:null;return r.jsxs.call(void 0,"li",{"aria-busy":"uploading"===h||void 0,"aria-invalid":"error"===h||void 0,className:i.cn.call(void 0,"group flex shrink-0 items-center rounded-[var(--radius-control)] bg-surface-2","horizontal"===t?"min-w-52 max-w-72":"w-full min-w-0",c?"border border-border-base":"border border-transparent",u?"gap-1.5 p-1.5":"gap-2 p-2"),"data-state":h,"data-ug-slot":"item",children:[o?r.jsx.call(void 0,"div",{className:i.cn.call(void 0,"grid shrink-0 place-items-center overflow-hidden rounded-[var(--radius-control)] bg-surface-1 text-text-secondary",u?"size-[var(--control-height-md)]":"size-[var(--control-height-lg)]"),"data-ug-slot":"preview",children:l?l(e):g?r.jsx.call(void 0,"img",{alt:e.name,className:"size-full object-cover",src:e.previewUrl}):r.jsx.call(void 0,s.File,{"aria-hidden":"true",size:u?15:17})}):null,r.jsxs.call(void 0,"div",{className:"min-w-0 flex-1","data-ug-slot":"content",children:[r.jsx.call(void 0,"p",{className:"truncate text-xs font-medium text-text-primary",title:e.name,children:e.name}),p||x?r.jsxs.call(void 0,"div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-text-tertiary","data-ug-slot":"meta",children:[p?r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,"inline-flex min-w-0 items-center gap-1 truncate","uploading"===h&&"text-primary","success"===h&&"text-success-soft-fg","error"===h&&"text-danger"),"data-ug-slot":"status",role:"ready"===h?void 0:"status",children:[m?r.jsx.call(void 0,m,{"aria-hidden":"true",className:i.cn.call(void 0,"size-3.5 shrink-0","uploading"===h&&"animate-spin motion-reduce:animate-none")}):null,r.jsx.call(void 0,"span",{className:"truncate",children:p})]}):null,x?r.jsx.call(void 0,"span",{className:"min-w-0 truncate","data-ug-slot":"detail",children:x}):null]}):null]}),a?r.jsx.call(void 0,i.Button,{"aria-label":v(e),onClick:()=>a(e),size:"icon-sm",type:"button",variant:"ghost","data-ug-slot":"remove",children:r.jsx.call(void 0,s.X,{"aria-hidden":"true",size:13})}):null]},e.id)})}):null);T.displayName="AttachmentList";var z=o.forwardRef.call(void 0,({items:e,activeId:a,onSelect:l,renderActions:t,empty:o="暂无会话",orientation:n="vertical",activeStyle:s="soft",showBadge:d=!0,showDescription:c=!0,listLabel:u="会话列表",className:v,tabIndex:g,...h},p)=>r.jsx.call(void 0,"div",{ref:p,"aria-label":u,className:i.cn.call(void 0,"horizontal"===n?"flex min-w-0 gap-1 overflow-x-auto pb-1 [scrollbar-width:thin]":"grid min-w-0 content-start gap-1",v),role:"list",tabIndex:_nullishCoalesce(g,()=>"horizontal"===n?0:void 0),...h,"data-ug":"conversation-list","data-active-style":s,"data-state":e.length>0?"populated":"empty","data-variant":n,"data-size":"md",children:0===e.length?r.jsx.call(void 0,"div",{className:"px-[var(--control-padding-x-md)] py-[var(--content-gap)] text-sm text-text-secondary","data-ug-slot":"empty",children:o}):e.map(e=>{const o=e.id===a;return r.jsxs.call(void 0,"div",{className:i.cn.call(void 0,"group relative flex min-w-0 items-center rounded-[var(--radius-control)] transition-[background-color,color] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)] motion-reduce:transition-none","horizontal"===n&&"min-w-52 shrink-0",o?i.cn.call(void 0,"bg-primary-soft","bordered"===s&&"ring-1 ring-inset ring-primary/30","indicator"===s&&"before:absolute before:left-0 before:top-1/2 before:h-[calc(var(--control-height-sm)*0.6)] before:w-[3px] before:-translate-y-1/2 before:rounded-r-[var(--radius-control)] before:bg-primary before:content-['']"):"hover:bg-surface-2",e.disabled&&"opacity-50"),"data-state":e.disabled?"disabled":o?"active":"default","data-ug-slot":"item",role:"listitem",children:[r.jsxs.call(void 0,"button",{"aria-current":o?"page":void 0,className:"min-w-0 flex-1 rounded-[var(--radius-control)] px-[var(--control-padding-x-md)] py-[calc(var(--content-gap)*0.625)] text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring/40",disabled:e.disabled,onClick:()=>l(e),type:"button","data-ug-slot":"trigger",children:[r.jsxs.call(void 0,"span",{className:"flex min-w-0 items-center gap-2",children:[r.jsx.call(void 0,"span",{className:i.cn.call(void 0,"min-w-0 flex-1 truncate text-sm text-text-primary",o?"font-semibold":"font-medium"),"data-ug-slot":"title",children:e.title}),d&&e.badge?r.jsx.call(void 0,"span",{className:"shrink-0","data-ug-slot":"badge",children:e.badge}):null]}),c&&e.description?r.jsx.call(void 0,"span",{className:i.cn.call(void 0,"mt-0.5 block truncate text-xs",o?"text-primary-soft-fg":"text-text-tertiary"),"data-ug-slot":"description",children:e.description}):null]}),t?r.jsx.call(void 0,"div",{className:"flex shrink-0 items-center gap-1 pr-2","data-ug-slot":"actions",children:t(e)}):null]},e.id)})}));z.displayName="ConversationList";var _=[{value:"sidebar",label:"左侧导航"},{value:"header",label:"顶部导航"}],A=[{value:"light",label:"浅色"},{value:"dark",label:"深色"}],R=[{value:"highlight",label:"主题色块",description:"使用柔和主题底色突出当前菜单。"},{value:"indicator",label:"侧边标记",description:"使用淡色背景叠加左侧标记,定位更清楚。"}],M=[{value:"comfortable",label:"舒适"},{value:"compact",label:"紧凑"}];function ModeIcon({value:e}){return"system"===e?r.jsx.call(void 0,s.Monitor,{"aria-hidden":"true",size:16}):"light"===e?r.jsx.call(void 0,s.Sun,{"aria-hidden":"true",size:16}):"dark"===e?r.jsx.call(void 0,s.Moon,{"aria-hidden":"true",size:16}):null}function ThemePresetPreview({selected:e,value:a}){const l="mecha"===a;return r.jsxs.call(void 0,"span",{"aria-hidden":"true",className:i.cn.call(void 0,"relative flex h-[calc(var(--control-height-lg)*1.75)] w-full overflow-hidden rounded-[calc(var(--radius-control)*0.75)] border bg-surface-0 transition-[border-color,box-shadow,transform] duration-[var(--motion-duration-state)] ease-[var(--motion-easing-state)]",e?"border-primary shadow-sm ring-1 ring-primary/20":"border-border-base shadow-xs"),"data-ug-mode":"light","data-ug":"theme-preview","data-ug-theme":a,children:[e?r.jsx.call(void 0,"span",{className:"absolute right-1.5 top-1.5 z-10 inline-flex h-[calc(var(--control-height-sm)*0.75)] w-[calc(var(--control-height-sm)*0.75)] items-center justify-center rounded-full bg-primary text-primary-fg shadow-sm",children:r.jsx.call(void 0,s.Check,{"aria-hidden":"true",size:12,strokeWidth:3})}):null,r.jsxs.call(void 0,"span",{className:"flex w-[24%] flex-col gap-1 border-r border-border-base bg-text-primary p-[calc(var(--content-gap)*0.375)]",children:[r.jsx.call(void 0,"span",{className:"h-[calc(var(--control-height-sm)*0.2)] w-8 rounded-full bg-primary"}),r.jsx.call(void 0,"span",{className:"mt-1 h-[calc(var(--control-height-sm)*0.16)] w-full rounded-full bg-surface-3"}),r.jsx.call(void 0,"span",{className:"h-[calc(var(--control-height-sm)*0.16)] w-4/5 rounded-full bg-surface-3"}),r.jsx.call(void 0,"span",{className:"h-[calc(var(--control-height-sm)*0.16)] w-3/4 rounded-full bg-surface-3"}),r.jsx.call(void 0,"span",{className:"mt-auto h-[calc(var(--control-height-sm)*0.16)] w-2/3 rounded-full bg-surface-3"})]}),r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,"flex min-w-0 flex-1 flex-col",l?"bg-text-primary":"bg-surface-0"),children:[r.jsx.call(void 0,"span",{className:i.cn.call(void 0,"h-[calc(var(--control-height-sm)*0.48)] border-b border-border-base",l?"bg-text-primary":"bg-surface-1")}),r.jsxs.call(void 0,"span",{className:"grid flex-1 grid-cols-3 gap-1.5 p-[calc(var(--content-gap)*0.375)]",children:[[0,1,2].map(e=>r.jsx.call(void 0,"span",{className:i.cn.call(void 0,"h-[calc(var(--control-height-sm)*0.42)] rounded-[calc(var(--radius-control)*0.35)] border border-border-base",l?"bg-text-secondary":1===e?"bg-primary-soft":"bg-surface-1")},e)),r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,"relative col-span-3 overflow-hidden rounded-[calc(var(--radius-control)*0.4)] border border-border-base",l?"bg-text-secondary":"bg-surface-1"),children:[r.jsx.call(void 0,"span",{className:"absolute inset-x-2 bottom-2 top-2 border-b border-l border-border-base"}),r.jsx.call(void 0,"svg",{className:"absolute inset-2 h-[calc(100%_-_var(--content-gap))] w-[calc(100%_-_var(--content-gap))] overflow-visible text-primary",preserveAspectRatio:"none",viewBox:"0 0 100 32",children:r.jsx.call(void 0,"path",{d:"M0 25 C12 22, 16 14, 28 18 S45 27, 56 14 S74 8, 100 4",fill:"none",stroke:"currentColor",strokeWidth:"2",vectorEffect:"non-scaling-stroke"})})]})]})]})]})}function ChoiceGroup({title:a,description:l,value:t,options:n,onValueChange:d,presentation:c="compact",swatch:u,iconSet:v}){const g=o.useId.call(void 0),h=o.useId.call(void 0),p="card"===c,m="preview"===c,x=void 0!==u,b=!p&&!m&&!x;return r.jsxs.call(void 0,"section",{className:i.cn.call(void 0,"min-w-0",(b||x)&&"ug-theme-config-row"),"data-presentation":x?"swatch":c,"data-ug-slot":"group",children:[r.jsxs.call(void 0,"div",{className:"min-w-0",children:[r.jsx.call(void 0,"h3",{id:g,className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:a}),r.jsx.call(void 0,"p",{id:h,className:"ug-theme-config-description",children:l})]}),r.jsx.call(void 0,e.RadioGroup,{"aria-describedby":h,"aria-labelledby":g,className:i.cn.call(void 0,"min-w-0",m&&"mt-2.5 grid grid-cols-1 gap-2.5 sm:grid-cols-3",p&&"mt-2 grid grid-cols-1 gap-2 sm:grid-cols-2",x&&"flex flex-wrap items-center gap-2.5",b&&"auto-cols-[minmax(max-content,1fr)]"),"data-ug-slot":"options",onValueChange:e=>d(String(e)),orientation:"horizontal",presentation:b?"segmented":"default",size:"default",sizing:b?"fill":"content",value:t,children:n.map(a=>r.jsx.call(void 0,e.Radio,{"aria-label":x?a.label:void 0,className:"hidden",controlClassName:x?void 0:"absolute",value:a.value,variant:p||m?"card":b?"segmented":"default",labelClassName:m?"group/theme flex min-h-[0] w-full cursor-pointer flex-col items-stretch gap-1.5 rounded-[var(--radius-control)] border-0 bg-transparent p-0 text-center shadow-none hover:bg-transparent focus-within:outline-none focus-within:ring-2 focus-within:ring-ring/30 data-[state=checked]:border-0 data-[state=checked]:bg-transparent data-[state=checked]:shadow-none":p?"min-h-[calc(var(--control-height-lg)*1.5)] gap-0 rounded-[var(--radius-control)] px-[calc(var(--content-gap)*0.75)] py-[calc(var(--content-gap)*0.5)]":x?"group/swatch min-h-[0] cursor-pointer gap-0 rounded-full p-0 focus-within:outline-none":b?"min-w-max px-[calc(var(--control-padding-x-sm)*0.75)]":void 0,label:r.jsxs.call(void 0,"span",{className:i.cn.call(void 0,"flex min-w-0",p||m?"flex-col gap-1":"items-center gap-2",x&&"block"),children:[m?r.jsx.call(void 0,ThemePresetPreview,{selected:a.value===t,value:a.value}):null,r.jsxs.call(void 0,"span",{className:"inline-flex min-w-0 items-center gap-2",children:["mode"===v?r.jsx.call(void 0,ModeIcon,{value:a.value}):null,x?r.jsx.call(void 0,"span",{"aria-hidden":"true","data-ug-swatch":"accent","data-ug-accent":a.value,children:r.jsx.call(void 0,s.Check,{"aria-hidden":"true",className:a.value===t?void 0:"invisible","data-ug-swatch-check":a.value===t?"":void 0,size:13,strokeWidth:3})}):null,r.jsx.call(void 0,"span",{className:i.cn.call(void 0,"min-w-0",p?"font-semibold text-text-primary":m?"w-full text-center font-medium text-text-primary":x?"sr-only":"truncate"),children:a.label})]}),p&&a.description?r.jsx.call(void 0,"span",{className:"text-xs font-normal leading-4 text-text-secondary",children:a.description}):null]})},a.value))})]})}var L=[{key:"background",label:"导航背景"},{key:"text",label:"普通文字"},{key:"activeBackground",label:"选中背景"},{key:"activeText",label:"选中文字"},{key:"hoverBackground",label:"悬停背景"}];function NavigationColorInput({label:e,value:a,onValueCommit:l}){const t=o.useRef.call(void 0,null),i=o.useRef.call(void 0,l);return i.current=l,o.useEffect.call(void 0,()=>{const e=t.current;if(!e)return;const commitValue=()=>i.current(e.value);return e.addEventListener("change",commitValue),()=>e.removeEventListener("change",commitValue)},[]),o.useEffect.call(void 0,()=>{t.current&&t.current.value!==a&&(t.current.value=a)},[a]),r.jsx.call(void 0,"input",{ref:t,"aria-label":e,"data-ug-slot":"color-swatch",defaultValue:a,type:"color"})}function NavigationColorGroup({customized:e,value:a,onReset:l,onValueChange:t}){return r.jsxs.call(void 0,"section",{className:"ug-theme-config-row min-w-0","data-presentation":"colors","data-ug":"navigation-colors","data-ug-slot":"group",children:[r.jsxs.call(void 0,"div",{className:"min-w-0","data-ug-slot":"group-label",children:[r.jsx.call(void 0,"h3",{className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:"导航颜色"}),e?r.jsx.call(void 0,i.Button,{onClick:l,size:"sm",tone:"neutral",variant:"ghost",children:"恢复主题配色"}):null]}),r.jsx.call(void 0,"div",{"data-ug-slot":"options",children:L.map(e=>r.jsxs.call(void 0,"label",{"data-ug-slot":"color-option",children:[r.jsx.call(void 0,NavigationColorInput,{label:e.label,onValueCommit:l=>t({...a,[e.key]:l}),value:a[e.key]}),r.jsx.call(void 0,"span",{"data-ug-slot":"color-label",children:e.label}),r.jsx.call(void 0,"code",{"data-ug-slot":"color-value",children:a[e.key].toUpperCase()})]},e.key))})]})}function TabLabel({icon:e,children:a}){return r.jsxs.call(void 0,"span",{className:"gap-[calc(var(--content-gap)*0.625)]","data-ug-slot":"tab-label",children:[r.jsx.call(void 0,"span",{"data-ug-slot":"tab-icon",children:e}),r.jsx.call(void 0,"span",{className:"truncate",children:a})]})}var I=o.forwardRef.call(void 0,({value:a,onValueChange:t,options:n,sidebarValue:d,onSidebarValueChange:c,appearanceAddon:u,sidebarAddon:g,className:h,...p},m)=>{const[x,b]=o.useState.call(void 0,"appearance"),f=l.useMediaQuery.call(void 0,"(prefers-color-scheme: dark)"),j=o.useMemo.call(void 0,()=>({...v.defaultUGThemeConfiguratorOptions,...n}),[n]),w=_nullishCoalesce(d.palette,()=>"primary"===d.variant?"light":"dark"),C=d.colors?w:v.resolveUGNavigationPalette.call(void 0,a.mode,f),y=v.resolveUGNavigationColors.call(void 0,a.preset,C,d.colors,a.accent);function updateField(e,l){t({...a,[e]:l})}function updateSidebarField(e,a){c({...d,[e]:a})}return r.jsx.call(void 0,"div",{ref:m,className:i.cn.call(void 0,"h-full min-h-[0] min-w-0 text-text-primary",h),"data-ug":"theme-configurator","data-state":"ready","data-variant":"panel","data-size":"default",...p,children:r.jsx.call(void 0,e.Tabs,{className:"h-full",onValueChange:e=>b(e),size:"md",value:x,variant:"rail",children:r.jsxs.call(void 0,"div",{"data-ug-slot":"configurator-layout",children:[r.jsx.call(void 0,"div",{"data-ug-slot":"navigation",children:r.jsxs.call(void 0,e.TabsList,{"aria-label":"外观设置分类",orientation:"vertical",children:[r.jsx.call(void 0,e.TabsTrigger,{value:"appearance",children:r.jsx.call(void 0,TabLabel,{icon:r.jsx.call(void 0,s.SwatchBook,{"aria-hidden":"true",size:16}),children:"主题外观"})}),r.jsx.call(void 0,e.TabsTrigger,{value:"sidebar",children:r.jsx.call(void 0,TabLabel,{icon:r.jsx.call(void 0,s.PanelTop,{"aria-hidden":"true",size:16}),children:"导航菜单"})})]})}),r.jsxs.call(void 0,"div",{className:"min-h-[0]","data-ug-slot":"settings",children:[r.jsxs.call(void 0,e.TabsContent,{className:"ug-theme-config-appearance min-w-0",value:"appearance",children:[r.jsx.call(void 0,ChoiceGroup,{title:"主题风格",description:"选择整套界面的基础视觉气质。",value:a.preset,options:j.presets,presentation:"preview",onValueChange:e=>updateField("preset",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"显示模式",description:"使用亮色、暗色,或自动跟随操作系统。",value:a.mode,options:j.modes,iconSet:"mode",onValueChange:e=>updateField("mode",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"主题色",description:"统一按钮、链接、当前项和焦点状态。",value:a.accent,options:j.accents,swatch:"accent",onValueChange:e=>updateField("accent",e)}),r.jsxs.call(void 0,"section",{"data-ug-slot":"detail-section",children:[r.jsx.call(void 0,"div",{"data-ug-slot":"section-heading",children:r.jsx.call(void 0,"h3",{className:"m-0 text-sm font-semibold leading-5 text-text-primary",children:"界面细节"})}),r.jsxs.call(void 0,"div",{"data-ug-slot":"detail-grid",children:[r.jsx.call(void 0,ChoiceGroup,{title:"界面密度",description:"控制页面留白与控件间距。",value:a.density,options:j.densities,onValueChange:e=>updateField("density",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"圆角风格",description:"统一控件和面板的边角语言。",value:a.radius,options:j.radii,onValueChange:e=>updateField("radius",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"阴影层级",description:"调整浮层与卡片的空间层次。",value:a.shadow,options:j.shadows,onValueChange:e=>updateField("shadow",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"字体排版",description:"选择阅读性或信息密度取向。",value:a.font,options:j.fonts,onValueChange:e=>updateField("font",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"文字对比",description:"调整正文和次要信息的清晰度。",value:a.contrast,options:j.contrasts,onValueChange:e=>updateField("contrast",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"界面动效",description:"控制过渡反馈的强弱。",value:a.motion,options:j.motions,onValueChange:e=>updateField("motion",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"页面背景",description:"选择纯净、网格或柔光背景。",value:a.background,options:j.backgrounds,onValueChange:e=>updateField("background",e)})]})]}),u?r.jsx.call(void 0,"div",{"data-ug-slot":"appearance-addon",children:u}):null]}),r.jsxs.call(void 0,e.TabsContent,{className:"min-w-0",value:"sidebar",children:[r.jsxs.call(void 0,"div",{className:"ug-theme-config-sidebar-grid",children:[r.jsx.call(void 0,ChoiceGroup,{title:"导航位置",description:"选择左侧栏或桌面端顶栏导航。",value:_nullishCoalesce(d.mode,()=>"sidebar"),options:_,onValueChange:e=>updateSidebarField("mode",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"配色基准",description:"默认跟随显示模式;选择后作为导航颜色覆盖。",value:C,options:A,onValueChange:e=>c({...d,palette:e,variant:"light"===e?"primary":"dark",colors:v.resolveUGNavigationColors.call(void 0,a.preset,e,void 0,a.accent)})}),r.jsx.call(void 0,NavigationColorGroup,{customized:Boolean(d.colors),value:y,onReset:()=>updateSidebarField("colors",void 0),onValueChange:e=>c({...d,palette:C,variant:"light"===C?"primary":"dark",colors:e})}),r.jsx.call(void 0,ChoiceGroup,{title:"当前菜单",description:"选择当前页面在导航中的强调方式。",value:d.activeStyle,options:R,onValueChange:e=>updateSidebarField("activeStyle",e)}),r.jsx.call(void 0,ChoiceGroup,{title:"菜单密度",description:"调整导航菜单的行高与间距。",value:d.density,options:M,onValueChange:e=>updateSidebarField("density",e)})]}),g?r.jsx.call(void 0,"div",{"data-ug-slot":"sidebar-addon",children:g}):null]})]})]})})})});function DefaultThemePreview({value:e,sidebarValue:a}){const t=l.useMediaQuery.call(void 0,"(prefers-color-scheme: dark)"),i=_nullishCoalesce(a.palette,()=>"primary"===a.variant?"light":"dark"),o=a.colors?i:v.resolveUGNavigationPalette.call(void 0,e.mode,t),n=v.resolveUGNavigationColors.call(void 0,e.preset,o,a.colors,e.accent),s={"--ug-preview-navigation-bg":n.background,"--ug-preview-navigation-text":n.text,"--ug-preview-navigation-active-bg":n.activeBackground,"--ug-preview-navigation-active-text":n.activeText,"--ug-preview-navigation-hover-bg":n.hoverBackground};return r.jsxs.call(void 0,"section",{"aria-label":"实时预览",className:"[--ug-theme-preview-gap:var(--content-gap)] border-border-base","data-ug":"theme-configurator-preview",children:[r.jsx.call(void 0,"h3",{"data-ug-preview":"title",children:"实时预览"}),r.jsxs.call(void 0,"div",{"data-navigation-active-style":a.activeStyle,"data-navigation-density":a.density,"data-navigation-mode":_nullishCoalesce(a.mode,()=>"sidebar"),"data-ug-accent":e.accent,"data-ug-background":e.background,"data-ug-contrast":e.contrast,"data-ug-density":e.density,"data-ug-font":e.font,"data-ug-mode":e.mode,"data-ug-motion":e.motion,"data-ug-radius":e.radius,"data-ug-shadow":e.shadow,"data-ug-preview":"frame","data-ug-surface":e.surface,"data-ug-theme":e.preset,style:s,children:[r.jsxs.call(void 0,"aside",{"data-ug-preview":"navigation",children:[r.jsx.call(void 0,"strong",{"data-ug-preview":"brand",children:"UG Admin"}),r.jsx.call(void 0,"div",{"data-ug-preview":"menu",children:["工作台","任务中心","数据分析","系统设置"].map((e,a)=>r.jsxs.call(void 0,"span",{"data-state":0===a?"active":"default","data-ug-preview":"menu-item",children:[r.jsx.call(void 0,"i",{"aria-hidden":"true","data-ug-preview":"menu-icon"}),r.jsx.call(void 0,"span",{children:e})]},e))})]}),r.jsxs.call(void 0,"div",{"data-ug-preview":"content",children:[r.jsxs.call(void 0,"header",{"data-ug-preview":"topbar",children:[r.jsx.call(void 0,"strong",{"data-ug-preview":"topbar-title",children:"工作台"}),r.jsxs.call(void 0,"span",{"aria-hidden":"true","data-ug-preview":"topbar-actions",children:[r.jsx.call(void 0,"i",{}),r.jsx.call(void 0,"i",{}),r.jsx.call(void 0,"i",{})]})]}),r.jsxs.call(void 0,"div",{"data-ug-preview":"tabs",children:[r.jsx.call(void 0,"span",{"data-state":"active",children:"工作台"}),r.jsx.call(void 0,"span",{children:"任务中心"}),r.jsx.call(void 0,"span",{children:"报表"})]}),r.jsxs.call(void 0,"main",{"data-ug-preview":"main",children:[r.jsx.call(void 0,"div",{"data-ug-preview":"stats",children:[["待办任务","12"],["团队成员","8"],["进行项目","24"]].map(([e,a])=>r.jsxs.call(void 0,"span",{"data-ug-preview":"stat",children:[r.jsx.call(void 0,"small",{children:e}),r.jsx.call(void 0,"strong",{children:a})]},e))}),r.jsxs.call(void 0,"div",{"data-ug-preview":"chart",children:[r.jsx.call(void 0,"strong",{children:"工作概览"}),r.jsx.call(void 0,"svg",{"aria-hidden":"true",preserveAspectRatio:"none",viewBox:"0 0 240 72",children:r.jsx.call(void 0,"path",{d:"M0 58 C28 48, 38 24, 66 36 S102 58, 130 28 S172 42, 240 12",fill:"none",stroke:"currentColor",strokeWidth:"3",vectorEffect:"non-scaling-stroke"})})]}),r.jsx.call(void 0,"div",{"data-ug-preview":"table",children:["整理发布计划","复核访问权限","更新项目进度"].map((e,a)=>r.jsxs.call(void 0,"span",{"data-ug-preview":"table-row",children:[r.jsx.call(void 0,"span",{children:e}),r.jsx.call(void 0,"i",{"data-state":1===a?"warning":"success",children:1===a?"待处理":"已完成"})]},e))})]})]})]})]})}function ThemeConfiguratorDialog({open:a,onOpenChange:l,onReset:t,onCancel:o,onApply:n,title:d="外观设置",preview:c,showPreview:u=!0,resetLabel:v="恢复默认",cancelLabel:g="取消",applyLabel:h,doneLabel:p,...m}){const x=_nullishCoalesce(_nullishCoalesce(h,()=>p),()=>"应用"),b=void 0===c?r.jsx.call(void 0,DefaultThemePreview,{value:m.value,sidebarValue:m.sidebarValue}):c,f=u&&null!==b&&!1!==b;function closeAsCancel(){_optionalChain([o,"optionalCall",e=>e()]),l(!1)}return r.jsx.call(void 0,e.Modal,{ariaLabel:"string"==typeof d?d:"外观设置",onClose:closeAsCancel,open:a,size:"2xl",children:r.jsxs.call(void 0,e.ModalContent,{"data-ug":"theme-configurator-dialog","data-state":a?"open":"closed","data-variant":f?"preview":"default","data-size":"2xl",children:[r.jsxs.call(void 0,e.ModalHeader,{children:[r.jsx.call(void 0,e.ModalTitle,{children:d}),r.jsx.call(void 0,e.ModalCloseButton,{})]}),r.jsx.call(void 0,e.ModalBody,{className:"overflow-hidden p-0",children:r.jsxs.call(void 0,"div",{"data-ug-layout":"dialog",children:[r.jsx.call(void 0,"div",{className:"h-full min-h-[0] min-w-0","data-ug-slot":"panel",children:r.jsx.call(void 0,I,{...m})}),f?r.jsx.call(void 0,"div",{"data-ug-slot":"preview",children:b}):null]})}),r.jsxs.call(void 0,e.ModalFooter,{className:"justify-between",children:[r.jsx.call(void 0,"div",{className:"flex min-w-0 items-center gap-3",children:t?r.jsxs.call(void 0,i.Button,{onClick:t,type:"button",variant:"default",children:[r.jsx.call(void 0,s.RotateCcw,{"aria-hidden":"true",size:16}),v]}):null}),r.jsxs.call(void 0,"div",{className:"flex shrink-0 items-center gap-2",children:[o?r.jsx.call(void 0,i.Button,{onClick:closeAsCancel,type:"button",variant:"default",children:g}):null,r.jsx.call(void 0,i.Button,{onClick:function closeAsApply(){_optionalChain([n,"optionalCall",e=>e()]),l(!1)},type:"button",variant:"primary",children:x})]})]})]})})}I.displayName="ThemeConfigurator",exports.AdminShell=m,exports.AppTabs=b,exports.AttachmentList=T,exports.ConfirmDialog=f,exports.ConversationList=z,exports.CopyField=j,exports.DataTable=DataTable,exports.DataTableIdentity=DataTableIdentity,exports.DataTableToolbar=DataTableToolbar,exports.Message=k,exports.MessageList=S,exports.PageHeader=w,exports.PromptComposer=N,exports.QuickAccess=y,exports.SelectionList=d,exports.ThemeConfigurator=I,exports.ThemeConfiguratorDialog=ThemeConfiguratorDialog,exports.TreeTable=TreeTable,exports.UGAdminShell=m,exports.UGAppTabs=b,exports.UGAttachmentList=T,exports.UGConfirmDialog=f,exports.UGConversationList=z,exports.UGCopyField=j,exports.UGDataTable=DataTable,exports.UGDataTableIdentity=DataTableIdentity,exports.UGDataTableToolbar=DataTableToolbar,exports.UGMessage=k,exports.UGMessageList=S,exports.UGPageHeader=w,exports.UGPromptComposer=N,exports.UGQuickAccess=y,exports.UGSelectionList=d,exports.UGThemeConfigurator=I,exports.UGThemeConfiguratorDialog=ThemeConfiguratorDialog,exports.UGTreeTable=TreeTable;//# sourceMappingURL=index.cjs.map