@yuku123/z-ctc-component 1.0.20 → 1.0.21

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 (3) hide show
  1. package/dist/index.cjs +27 -27
  2. package/dist/index.js +2638 -2611
  3. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var Qd=Object.defineProperty;var ef=(e,t,n)=>t in e?Qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>ef(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),c=require("antd"),jt=require("@yuku123/z-frontend-common/ui"),d=require("react"),de=require("@ant-design/icons"),cn=require("@yuku123/z-frontend-common");require("react-dom/client");const Gc=require("react-dom"),tf=require("react-router-dom");function nf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const be=nf(d),rf="# z-ctc-component\n\nz-ctc 4A 中心的**可复用前端组件层**(library mode):账号 / 组织 / 部门 / 用户组 / 租户 / 域 / 角色 / 资源 /\n权限 / 审计 / 字典 / 短链这一整套管理组件。主壳「系统工作台」按域接进来后,ctc 域的页面都从这里出。\n\n- **npm 包名**:`@yuku123/z-ctc-component`\n- **宿主接入**:`import { ComponentDocPage } from '@yuku123/z-ctc-component'`(主壳取文档页的统一名,lead 008 §7)\n 或直接消费各管理组件(`OrgPage` / `AccountManagement` / `RoleManagement` / …)\n- **后端**:z-ctc 后端,前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 默认 `/api`)\n- **技术栈**:React 19 + antd 6 + `@yuku123/z-frontend-common`(基座 `createRequest` 统一解包 `Result<T>`)\n\n> ⚠ 本仓与 `z-ctc-suit` 是**两个不同的包**:suit 是 4A 中心的独立运行壳(`private: true`,不发布 npm),\n> 它不再自建页面,菜单里的每一页都是本包组件的薄包装;本包承载的是**组件层**(`src/components/**`)。\n> 两边视角不同、API 大体重叠 —— 本文件描述的是**本包**的能力面。\n\n---\n\n## 一、能力概览\n\n| 能力 | 组件 | 源文件 | 说明 |\n|------|------|--------|------|\n| 4A 总览 | `CtcOverview` | `components/CtcOverview/index.jsx` | 4A 中心概览入口 |\n| 组织 / 部门 / 组 | `OrgPage`、`OrgManagement` | `components/OrgPage/`、`components/OrgManagement/` | 三级树 CRUD;`OrgPage` 自带租户 / 域拉取,`OrgManagement` 由调用方传 `tenants` / `domains` |\n| 租户 / 域 | `TenantManagement` | `components/TenantManagement/` | 左树右表:租户维护 + 租户下的域维护 |\n| 账号 | `AccountManagement` | `components/AccountManagement/` | 账号列表、新增 / 停用、分配角色、改密 / 重置口令、删除 |\n| 角色 | `RoleManagement` | `components/RoleManagement/` | 角色 CRUD(4A AUTHZ 域) |\n| 权限 | `PermissionManagement` | `components/PermissionManagement/` | 资源 × 角色的授权配置 |\n| 资源(权限点) | `ResourcePage` | `components/ResourcePage/index.jsx` | 全域权限点统一视图,按应用分页查询 |\n| 用户权限 | `UserPermissionPage` | `components/UserPermissionPage/index.jsx` | 查某用户的角色 + 权限资源树 |\n| 应用 | `ApplicationManagement` | `components/ApplicationManagement/` | split-panel:左应用列表,右「基本信息 + Tabs(API 资产 / 菜单 / 按钮 / 数据)」 |\n| 审计 | `AuditPage` | `components/AuditPage/index.jsx` | 审计中心,按类型 Tabs 隔离日志(登录日志等) |\n| 字典 | `DictPage` | `components/DictPage/index.jsx` | 字典类型 + 字典项维护 |\n| 短链 | `SurlManagement` | `components/SurlManagement/` | 生成短码、查元信息、失效 |\n| 通用件 | `UserTable`、`StatusTag` | `components/UserTable.jsx`、`components/StatusTag.jsx` | 可复用的用户表格 / 状态标签 |\n\n### 路由\n\n本包**不自带**路由表;页面由调用方组合(本仓 `src/pages-manifest.tsx` 只提供一条骨架路由 `/z-ctc/hello`)。\n主壳工作台按宿主前缀 `/ctc/*` 挂,文档页的实际路径见第五节。\n\n## 二、导出面\n\n```ts\n// 主入口\nimport { ComponentDocPage } from '@yuku123/z-ctc-component'; // 主壳按统一名取文档页(lead 008 §7)\nimport HelloCtc from '@yuku123/z-ctc-component'; // 默认导出桶(宿主可能依赖其形状)\n\n// 管理组件\nimport { OrgPage, TenantManagement, AccountManagement, ApplicationManagement,\n RoleManagement, PermissionManagement, ResourcePage, UserPermissionPage,\n SurlManagement, DictPage, AuditPage, CtcOverview, OrgManagement,\n UserTable, StatusTag } from '@yuku123/z-ctc-component';\n\n// API client(顶栏租户 / 域下拉要用)\nimport { ctcAcTenantApi, ctcAcDomainApi } from '@yuku123/z-ctc-component';\n\n// /pages 子路径\nimport { routes, appMeta } from '@yuku123/z-ctc-component/pages';\n```\n\n- `ComponentDocPage` 是**具名再导出**(`export { default as ComponentDocPage } from './pages/ComponentDoc'`),\n 与默认导出桶 `export default { HelloCtc }` **并存** —— 默认桶的形状不动(宿主可能依赖它)。\n- `src/index.d.ts` 是手写声明文件(TS 走它、运行时走 `.js`),新增导出必须**同步补进去**,\n 否则 TS 侧会报 TS2305「no exported member」而运行期正常。\n\n## 三、API 端点\n\n前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 可改),下表路径是 `src/components/**/api.js`\n与 `src/components/_api/**` 里**实际调用**的路径。\n\n### 3.1 账号(AC 域,`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/accounts` | 建账号,返回新 ID |\n| GET | `/ctc/ac/accounts` | 账号列表(按租户 / 域过滤)或按 `id` 查单条 |\n| PUT | `/ctc/ac/accounts` | 改账号(`id` 走请求参数) |\n| DELETE | `/ctc/ac/accounts` | 删账号 |\n| POST | `/ctc/ac/accounts/status` | 启用 / 停用 |\n| POST | `/ctc/ac/accounts/password/change` | 改口令 |\n| POST | `/ctc/ac/accounts/password/reset` | 重置口令 |\n| POST | `/ctc/ac/accounts/assign-role` | 给账号分配角色 |\n\n### 3.2 租户 / 域(AC 域,`TenantManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/tenants` | 建租户 |\n| GET | `/ctc/ac/tenants` | 按 `tenantCode` 查租户 |\n| GET | `/ctc/ac/tenants/list` | 租户全量列表 |\n| POST | `/ctc/ac/tenants/status` | 启用 / 停用租户 |\n| GET | `/ctc/ac/domains/list` | 某租户下的域列表 |\n| GET | `/ctc/ac/domains/list-all` | 域全量列表 |\n| GET | `/ctc/ac/domains` | 按 `id` 查域 |\n| POST | `/ctc/ac/domains` | 建域 |\n| PUT | `/ctc/ac/domains` | 改域 |\n| DELETE | `/ctc/ac/domains` | 删域 |\n\n### 3.3 组织 / 部门 / 组(AC 域,`OrgManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST / GET / PUT / DELETE | `/ctc/ac/orgs` | 组织增删改查;列表走 `/ctc/ac/orgs/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/depts` | 部门增删改查;列表走 `/ctc/ac/depts/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/groups` | 用户组增删改查;列表走 `/ctc/ac/groups/list` |\n\n组织 / 部门 / 组三级都以 `tenantCode` + `domainCode` 为前缀过滤,组再带 `deptCode`;\n主键类参数一律走**请求参数**(`?xxx=`),不用路径变量。\n\n### 3.4 授权(AUTHZ 域,`_api/ctcAuthorization.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/authz/resources/page-by-app`、`/list`、`/page`、`/distinct-apps` | 资源(权限点)分页 / 列表 / 按应用 |\n| GET / POST / PUT / DELETE | `/ctc/authz/resources` | 资源增删改查 |\n| GET | `/ctc/authz/resources/roles` | 某资源上的角色 |\n| POST / DELETE | `/ctc/authz/roles/grant-resource`、`/ctc/authz/roles/revoke-resource` | 角色 ↔ 资源 绑定 / 解绑 |\n| GET | `/ctc/authz/roles/list`、`/page` | 角色清单 / 分页 |\n| GET / POST / PUT / DELETE | `/ctc/authz/roles` | 角色增删改查 |\n| GET | `/ctc/authz/users/roles`、`/ctc/authz/users/permissions` | 某用户的角色 / 权限 |\n| POST / DELETE | `/ctc/authz/users/grant-role`、`/ctc/authz/users/revoke-role` | 用户 ↔ 角色 授予 / 撤销 |\n| GET | `/ctc/authz/roles/resources` | 某角色拥有的资源 |\n| POST | `/ctc/authz/check` | 鉴权判定 |\n\n### 3.5 应用(`_api/metaApp.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/meta-app/list` | 应用清单 |\n| GET | `/meta-app/get` | 应用详情 |\n| POST | `/meta-app` | 建应用 |\n| PUT | `/meta-app` | 改应用 |\n| DELETE | `/meta-app` | 删应用 |\n\n### 3.6 字典(`_api/dict.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/dict/type/list`、`/dict/type/get` | 字典类型列表 / 详情 |\n| POST / PUT / DELETE | `/dict/type` | 字典类型增删改 |\n| GET | `/dict/item/list`、`/dict/items/get` | 字典项列表(按 `dictId` 或 `dictCode`) |\n| POST / PUT / DELETE | `/dict/item` | 字典项增删改 |\n\n### 3.7 审计 / 登录日志(`_api/loginLog.js`、`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/ac/login-log/list` | 登录日志列表 |\n| GET | `/ctc/ac/login-log/page` | 登录日志分页 |\n| GET | `/ctc/ac/login-log/recent` | 最近登录 |\n| POST | `/ctc/ac/login-log/list` | 登录日志条件查询(账号页在用) |\n\n### 3.8 短链(`SurlManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/surl/shorten` | 生成短码 |\n| GET | `/ctc/surl/info` | 查短码元信息 |\n| DELETE | `/ctc/surl` | 失效短码 |\n| GET | `/s/{mapKey}` | 短链跳转(前端拼 `origin + /s/{mapKey}`) |\n\n## 四、组件说明\n\n### 4.1 组织 / 部门 / 组(OrgPage、OrgManagement)\n\n左树右表布局,三级联动:租户 → 域 → 组织 → 部门 → 用户组。\n`OrgPage` 是**标准页面**:自己拉租户 / 域并维护选中态;`OrgManagement` 是**业务组件**:\n租户 / 域由调用方通过 props 传入(本组件不耦合 z-meta),适合嵌进别的页面。\n\n### 4.2 租户 / 域(TenantManagement)\n\n左树右表。租户支持新建、按 code 查询、启停用、全量列表;域挂在选中租户下,支持新建 / 改 / 删。\n`ctcAcTenantApi` / `ctcAcDomainApi` 同时从主入口导出,供宿主顶栏的租户 / 域下拉直接调用。\n\n### 4.3 账号(AccountManagement)\n\n列表 + 新增 / 停用 / 分配角色 / 改密 / 重置口令 / 删除。\n\n### 4.4 应用(ApplicationManagement)\n\nsplit-panel:左侧应用紧凑列表(编辑 / 停用 / 删除),右侧整块替换为「应用基本信息 + Tabs」,\n每个 Tab 一张表(API 资产 / 菜单 / 按钮 / 数据)。\n\n### 4.5 授权(RoleManagement / PermissionManagement / ResourcePage / UserPermissionPage)\n\n- **角色**:角色 CRUD。\n- **权限**:资源 × 角色的授权配置(授予 / 撤销)。\n- **资源**:全域权限点统一视图,按应用分页。\n- **用户权限**:输入用户 → 看他的角色 + 权限资源树(用户列表来自 AC 域,角色 / 权限来自 AUTHZ 域)。\n\n### 4.6 审计 / 字典 / 短链\n\n审计中心按类型 Tabs 隔离日志(当前实现登录日志);字典是类型 + 字典项两级;短链是生成 / 查询 / 失效三件套。\n\n### 4.7 组件文档\n\n本文件。内容以 `?raw` 在编译期内联进 bundle(零额外请求);渲染用基座\n`@yuku123/z-frontend-common/ui` 的 `ComponentDoc`(左 240px TOC + 右正文两栏)。\n\n## 五、路由与宿主接入\n\n| 场景 | 路径 | 说明 |\n|---|---|---|\n| 独立壳(`z-ctc-suit`) | `/z-ctc/docs` | 本包 `src/pages-manifest.tsx` 里 `routes` 的路径;独立壳把 `routes` 数组直接铺成 `<Route>` |\n| 主壳「系统工作台」 | **`/ctc/docs`** | 工作台按**宿主前缀**挂各域(`/ctc/*`),文档页由主壳 `SystemShell.tsx` 的路由表指向本包导出的 `ComponentDocPage` |\n\n⚠ 两者路径**不同源**:manifest 的 `/z-ctc/docs` 只在独立壳里生效;工作台里走宿主前缀 `/ctc/docs`\n(主壳的路由表注释写明:manifest 的 routes 是给独立壳用的,工作台按宿主前缀挂,manifest 路径在工作台不生效)。\n\n## 六、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| API 前缀 | `/api` | 各 `api.js` 的 `configureApiBaseURL(baseURL)` 可覆写 |\n| 超时 | 15000ms | `createRequest({baseURL, timeout})` |\n| 响应解包 | 基座统一拦截器 | 业务层拿到的已经是内层数据,**不要**再 `.then(r => r.data)` |\n| 参数规约 | 请求参数 | 主键 / 编码一律 `?xxx=`,不用路径变量 |\n\n## 七、已知限制\n\n- **认证策略配置(密码策略、第三方登录)还没有迁进本包** —— 那张页面目前仍住在 `z-ctc-suit/src/pages/AuthnPage.jsx`,\n 本包不含对应组件与端点。\n- **本包不含路由表**:真实页面路由由宿主(独立壳 / 主壳)决定,本包只提供组件与 `routes` 骨架。\n- `src/index.d.ts` 是手写声明文件,**新增导出必须同步补**,否则 TS 侧报 TS2305 而运行期正常。\n- `OrgManagement` 依赖调用方传入 `tenants` / `domains`,不自己拉租户域(避免耦合 z-meta)。\n- 主键类参数走请求参数,URL 变长;后端因此不能靠路径变量路由。\n\n## 八、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 1.0.4(本次改动,版本号未抬) | 落地 lead 008 §7:新增本文件 + `src/pages/ComponentDoc.tsx` 薄包装 + `pages-manifest` 里 `/z-ctc/docs` 路由 + 主入口(与 `index.d.ts`)具名再导出 `ComponentDocPage` |\n| 1.0.4 | 4A 组件层:账号 / 组织 / 部门 / 组 / 租户 / 域 / 角色 / 资源 / 权限 / 应用 / 审计 / 字典 / 短链 |\n";function sf(){return s.jsx(jt.ComponentDoc,{markdown:rf,title:"组件文档 — z-ctc"})}function af({dataSource:e,loading:t,onEdit:n,onDelete:r,onRefresh:a}){const i=[{title:"用户名",dataIndex:"userName",key:"userName"},{title:"昵称",dataIndex:"nickName",key:"nickName"},{title:"手机号",dataIndex:"phone",key:"phone"},{title:"邮箱",dataIndex:"email",key:"email"},{title:"状态",dataIndex:"status",key:"status",render:o=>s.jsx(c.Tag,{color:o===1?"green":"red",children:o===1?"正常":"禁用"})},{title:"操作",key:"action",render:(o,l)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>n==null?void 0:n(l),children:"编辑"}),s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:()=>r==null?void 0:r(l),children:"删除"})]})}];return s.jsx(jt.ListTable,{rows:e,columns:i,loading:t,rowKey:"id",searchKeys:["userName","nickName","phone","email"],searchPlaceholder:"按用户名 / 昵称 / 手机号 / 邮箱过滤"})}const of={1:{color:"green",text:"正常"},0:{color:"red",text:"禁用"},pending:{color:"orange",text:"待处理"},approved:{color:"blue",text:"已通过"},rejected:{color:"red",text:"已拒绝"}};function lf({status:e,map:t}){const n=(t==null?void 0:t[e])||of[e]||{color:"default",text:e};return s.jsx(c.Tag,{color:n.color,children:n.text})}let Zc="/api";function cf(e){Zc=e||"/api"}function yt(){return cn.createRequest({baseURL:Zc,timeout:15e3})}const Ia={create:e=>yt().post("/ctc/ac/orgs",e),listByDomain:(e,t)=>yt().get("/ctc/ac/orgs/list",{params:{tenantCode:e,domainCode:t}}),getByCode:(e,t,n)=>yt().get("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}}),update:(e,t,n,r)=>yt().put("/ctc/ac/orgs",r,{params:{tenantCode:e,domainCode:t,orgCode:n}}),delete:(e,t,n)=>yt().delete("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}})},In={create:e=>yt().post("/ctc/ac/depts",e),listByOrg:(e,t,n)=>yt().get("/ctc/ac/depts/list",{params:{tenantCode:e,domainCode:t,orgCode:n}}),getByCode:(e,t,n,r)=>yt().get("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),update:(e,t,n,r)=>yt().put("/ctc/ac/depts",r,{params:{tenantCode:e,domainCode:t,deptCode:n}}),delete:(e,t,n,r)=>yt().delete("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),listMembers:(e,t,{orgCode:n,deptCode:r}={})=>yt().get("/ctc/ac/depts/members",{params:{tenantCode:e,domainCode:t,orgCode:n,deptCode:r}}),attachMember:(e,t,n,r,a)=>yt().post("/ctc/ac/depts/members",null,{params:{tenantCode:e,domainCode:t,deptCode:n,userId:r,roleCode:a}}),detachMember:(e,t,n,r)=>yt().delete("/ctc/ac/depts/members",{params:{tenantCode:e,domainCode:t,deptCode:n,userId:r}})},Ma={create:e=>yt().post("/ctc/ac/groups",e),listByDept:(e,t,n)=>yt().get("/ctc/ac/groups/list",{params:{tenantCode:e,domainCode:t,deptCode:n}}),getByCode:(e,t,n,r)=>yt().get("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),update:(e,t,n,r,a)=>yt().put("/ctc/ac/groups",a,{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),delete:(e,t,n,r)=>yt().delete("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}})};let uf="/api";function _t(){return cn.createRequest({baseURL:uf,timeout:15e3})}const sn={create:e=>_t().post("/ctc/ac/accounts",e),getById:e=>_t().get("/ctc/ac/accounts",{params:{id:e}}),listByTenant:e=>_t().get("/ctc/ac/accounts",{params:e}),updateStatus:(e,t)=>_t().post("/ctc/ac/accounts/status",null,{params:{id:e,status:t}}),changePassword:(e,t)=>_t().post("/ctc/ac/accounts/password/change",t,{params:{id:e}}),resetPassword:(e,t)=>_t().post("/ctc/ac/accounts/password/reset",t,{params:{id:e}}),update:(e,t)=>_t().put("/ctc/ac/accounts",t,{params:{id:e}}),delete:e=>_t().delete("/ctc/ac/accounts",{params:{id:e}}),assignRole:(e,t)=>_t().post("/ctc/ac/accounts/assign-role",null,{params:{userId:e,roleId:t}}),listAffiliations:e=>_t().get("/ctc/ac/accounts/affiliations",{params:{userId:e}})},df={list:e=>_t().post("/ctc/ac/login-log/list",e)},ff="z_org_ext_config",Eo={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Kt={org:{label:"组织",color:"#1677ff"},dept:{label:"部门",color:"#52c41a"},group:{label:"组别",color:"#fa8c16"}};function mn(e,t){return`${e}:${t}`}function hn(e,t){return t==="org"?e.orgCode:t==="dept"?e.deptCode:e.groupCode}function Er(e){return e.orgName||e.deptName||e.groupName||""}function fs(e){return e.groupCode?"group":e.deptCode?"dept":"org"}function Ro(e,t){try{return JSON.parse(localStorage.getItem(t)||"{}")[e]||[]}catch{return[]}}function Io(e,t,n){const r=JSON.parse(localStorage.getItem(n)||"{}");r[e]=t,localStorage.setItem(n,JSON.stringify(r))}function Jc({selectedTenant:e=null,selectedDomain:t=null,apiBaseURL:n,extConfigStorageKey:r=ff}){var lt,nt;d.useEffect(()=>{n&&cf(n)},[n]);const[a,i]=d.useState({}),[o,l]=d.useState({}),[u,m]=d.useState({}),[g,f]=d.useState([]),[h,p]=d.useState([]),[S,y]=d.useState([]),[w,v]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState([]),[T,$]=d.useState([]),[E,R]=d.useState(!1),[I,M]=d.useState(!1),[Y,U]=d.useState([]),[A]=c.Form.useForm(),k=d.useCallback(ne=>{if(!ne||!e||!t||ne.type==="group"){$([]);return}let Q=!1;R(!0);const{type:he,data:Ce}=ne;return In.listMembers(e,t,{deptCode:he==="dept"?Ce.deptCode:void 0,orgCode:he==="org"?Ce.orgCode:void 0}).then(Je=>{Q||$(Array.isArray(Je)?Je:[])}).catch(()=>{Q||$([])}).finally(()=>{Q||R(!1)}),()=>{Q=!0}},[e,t]);d.useEffect(()=>{k(w)},[w,k]);const F=async()=>{var ne;M(!0);try{const Q=await sn.listByTenant({pageNum:1,pageSize:200}),he=Array.isArray(Q)?Q:(Q==null?void 0:Q.records)||((ne=Q==null?void 0:Q.data)==null?void 0:ne.records)||[];U(he.map(Ce=>({value:Ce.userId??Ce.id,label:Ce.nickname?`${Ce.username||`#${Ce.userId}`}(${Ce.nickname})`:Ce.username||`#${Ce.userId}`})))}catch{U([]),c.message.error("账号列表加载失败")}},D=async()=>{try{const ne=await A.validateFields();await In.attachMember(e,t,w.data.deptCode,ne.userId,ne.roleCode||void 0),c.message.success("成员已挂载到部门"),M(!1),A.resetFields(),k(w)}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("挂载失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},O=async ne=>{try{await In.detachMember(e,t,w.data.deptCode,ne.userId),c.message.success("已移出部门"),k(w)}catch(Q){c.message.error("移出失败:"+((Q==null?void 0:Q.message)||"未知错误"))}},[B,q]=d.useState(!1),[z,V]=d.useState(null),[Z]=c.Form.useForm(),[G,H]=d.useState(!1),[L,K]=d.useState(null),[P,W]=d.useState(null),[te]=c.Form.useForm(),re=d.useCallback(async(ne,Q)=>{if(!ne||!Q)return[];const he=await Ia.listByDomain(ne,Q),Ce=Array.isArray(he)?he:[];return i(Je=>({...Je,[Q]:Ce})),Ce},[]),X=d.useCallback(async(ne,Q,he)=>{if(!ne||!Q||!he)return[];const Ce=await In.listByOrg(ne,Q,he),Je=Array.isArray(Ce)?Ce:[];return l(Ct=>({...Ct,[he]:Je})),Je},[]),se=d.useCallback(async(ne,Q,he)=>{if(!ne||!Q||!he)return[];const Ce=await Ma.listByDept(ne,Q,he),Je=Array.isArray(Ce)?Ce:[];return m(Ct=>({...Ct,[he]:Je})),Je},[]);d.useEffect(()=>{if(!e||!t){f([]);return}if(!a[t]){re(e,t);return}const Q=(a[t]||[]).map(he=>({key:mn("org",he.orgCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Kt.org.color,style:{margin:0},children:"组织"}),he.orgName||he.orgCode,he.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"org",data:he},isLeaf:!1}));f(Q)},[e,t,a,re]);const ae=ne=>ne.map(Q=>({key:mn("dept",Q.deptCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Kt.dept.color,style:{margin:0},children:"部门"}),Q.deptName||Q.deptCode,Q.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"dept",data:Q},isLeaf:!1})),ue=ne=>ne.map(Q=>({key:mn("group",Q.groupCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Kt.group.color,style:{margin:0},children:"组"}),Q.groupName||Q.groupCode,Q.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"group",data:Q},isLeaf:!0})),pe=async ne=>{var tn;const Q=(tn=ne==null?void 0:ne.data)!=null&&tn.type?ne.data:ne,{key:he}=ne,Ce=Q==null?void 0:Q.type,Je=(Q==null?void 0:Q.data)||{};let Ct=[];Ce==="org"?Ct=ae(await X(e,t,Je.orgCode)):Ce==="dept"&&(Ct=ue(await se(e,t,Je.deptCode))),f(ht=>fe(ht,he,Ct))},me=async(ne,Q)=>{let he=[];if(ne==="org")he=ae(await X(e,t,Q));else if(ne==="dept")he=ue(await se(e,t,Q));else return;f(Ce=>fe(Ce,mn(ne,Q),he))},fe=(ne,Q,he)=>ne.map(Ce=>Ce.key===Q?{...Ce,children:he}:Ce.children?{...Ce,children:fe(Ce.children,Q,he)}:Ce),ye=(ne,Q)=>{if(!ne||ne.length===0)return;const he=ne[0];y([he]);const Ce=Q.node.data;v(Ce),C(Ro(he,r)),Ce.type==="org"?b(o[Ce.data.orgCode]||[]):Ce.type==="dept"?b(u[Ce.data.deptCode]||[]):b([])},Te=ne=>{var tn;const Q=ne.data,he=Q==null?void 0:Q.type,Ce=Q==null?void 0:Q.data,Je=he==="org"?[{key:"dept",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Kt.dept.color,children:"部门"})," 新增部门"]})}]:he==="dept"?[{key:"group",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Kt.group.color,children:"组别"})," 新增组别"]})}]:[],Ct=he&&((tn=Kt[he])==null?void 0:tn.label)||"节点";return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},onClick:ht=>ht.stopPropagation(),children:[s.jsx("span",{style:{flex:1},children:ne.title}),Je.length>0&&s.jsx(c.Dropdown,{menu:{items:Je,onClick:({key:ht})=>Ae(ht,Ce)},trigger:["click"],children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{style:{fontSize:11}}),onClick:ht=>ht.stopPropagation()})}),s.jsx(c.Popconfirm,{title:`确定删除该${Ct}?`,onConfirm:()=>he&&Oe(he,Ce),onCancel:ht=>ht==null?void 0:ht.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(de.DeleteOutlined,{style:{fontSize:11}}),onClick:ht=>ht.stopPropagation()})})]})},Oe=async(ne,Q)=>{try{const he=Q.tenantCode||e,Ce=Q.domainCode||t;if(!he||!Ce){c.message.error("租户/域信息缺失, 无法删除");return}ne==="org"?(await Ia.delete(he,Ce,Q.orgCode),await re(he,Ce)):ne==="dept"?(await In.delete(he,Ce,Q.deptCode,Q.orgCode),Q.orgCode&&await me("org",Q.orgCode)):ne==="group"&&(await Ma.delete(he,Ce,Q.deptCode,Q.groupCode),Q.deptCode&&await me("dept",Q.deptCode)),c.message.success("删除成功"),w&&hn(w.data,w.type)===hn(Q,ne)&&(v(null),C([]),b([]),y([]))}catch(he){c.message.error("删除失败:"+((he==null?void 0:he.message)||"未知错误"))}},Ae=(ne,Q)=>{K(ne),W(Q||null),te.resetFields(),H(!0)},ze=d.useMemo(()=>{const ne=(P==null?void 0:P.data)||P||{},Q={tenantCode:ne.tenantCode||e,domainCode:ne.domainCode||t};return L==="dept"&&(Q.orgCode=ne.orgCode),L==="group"&&(Q.deptCode=ne.deptCode,ne.orgCode&&(Q.orgCode=ne.orgCode)),Q},[L,P,e,t]),ce=async()=>{if(L)try{const ne=await te.validateFields(),Q={...ze,...ne,status:Number(ne.status??1),description:ne.description||"",extConfig:"[]"};if(L==="org"){await Ia.create(Q);const he=Q.domainCode||t;he&&await re(Q.tenantCode,he)}else if(L==="dept"){await In.create(Q);const he=Q.orgCode;if(he&&await me("org",he),(w==null?void 0:w.type)==="org"&&w.data.orgCode===he){const Ce=await In.listByOrg(Q.tenantCode,Q.domainCode,he);b(Ce)}}else if(L==="group"){await Ma.create(Q);const he=Q.deptCode;he&&await me("dept",he)}c.message.success("创建成功"),H(!1)}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("创建失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},_=async()=>{if(w)try{const ne=await Z.validateFields();let Q;if(z)Q=x.map(Ce=>Ce.key===z.key?{key:ne.dataId,value:ne.content}:Ce);else{if(x.some(Ce=>Ce.key===ne.dataId)){c.message.error("Key 已存在");return}Q=[...x,{key:ne.dataId,value:ne.content}]}const he=mn(w.type,hn(w.data,w.type));Io(he,Q,r),C(Q),q(!1),V(null),Z.resetFields(),c.message.success("保存成功")}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("保存失败")}},J=ne=>{if(!w)return;const Q=mn(w.type,hn(w.data,w.type)),he=x.filter(Ce=>Ce.key!==ne.key);Io(Q,he,r),C(he),c.message.success("删除成功")},le=(ne,Q)=>{const he=hn(ne,Q);y([mn(Q,he)]),v({type:Q,data:ne}),C(Ro(mn(Q,he),r)),b(Q==="org"?o[ne.orgCode]||[]:Q==="dept"?u[ne.deptCode]||[]:[])},[Se,Ee]=d.useState(""),Fe=d.useMemo(()=>j.map((ne,Q)=>({...ne,key:Q})),[j]),Ie=d.useMemo(()=>{const ne=Se.trim().toLowerCase();return ne?Fe.filter(Q=>`${hn(Q,fs(Q))||""} ${Er(Q)||""}`.toLowerCase().includes(ne)):Fe},[Fe,Se]),De=[{title:"编码",dataIndex:"code",width:140,render:(ne,Q)=>hn(Q,fs(Q))},{title:"名称",dataIndex:"name",ellipsis:!0,render:(ne,Q)=>Er(Q)},{title:"类型",dataIndex:"type",width:100,render:(ne,Q)=>{const he=fs(Q);return s.jsx(c.Tag,{color:Kt[he].color,children:Kt[he].label})}},{title:"操作",dataIndex:"action",width:100,render:(ne,Q)=>{const he=fs(Q);return s.jsx(c.Button,{type:"link",size:"small",onClick:()=>le(Q,he),children:"详情"})}}],ve=[{title:"Key",dataIndex:"key",width:200,ellipsis:!0},{title:"Value",dataIndex:"value",ellipsis:!0},{title:"操作",width:140,render:(ne,Q)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",type:"link",onClick:()=>{V(Q),Z.setFieldsValue({dataId:Q.key,content:Q.value}),q(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除",onConfirm:()=>J(Q),children:s.jsx(c.Button,{size:"small",type:"link",danger:!0,children:"删除"})})]})}],ke={0:{text:"待接受",color:"processing"},1:{text:"正常",color:"success"},2:{text:"已禁用",color:"error"},3:{text:"已退出",color:"default"}},Le=[{title:"成员",dataIndex:"nickname",ellipsis:!0,render:(ne,Q)=>Q.nickname||Q.username||`#${Q.userId}`},{title:"账号",dataIndex:"username",ellipsis:!0,render:ne=>ne||"-"},{title:"角色",dataIndex:"roleCode",width:100,render:ne=>s.jsx(c.Tag,{style:{margin:0},children:ne||"-"})},{title:"部门",dataIndex:"deptCode",width:130,ellipsis:!0,render:(ne,Q)=>(w==null?void 0:w.type)==="org"&&Q.deptCode?Q.deptCode:"-"},{title:"状态",dataIndex:"memberStatus",width:90,render:ne=>{var Q,he;return s.jsx(c.Tag,{color:((Q=ke[ne])==null?void 0:Q.color)||"default",style:{margin:0},children:((he=ke[ne])==null?void 0:he.text)||ne})}},{title:"加入时间",dataIndex:"joinedAt",width:160,render:ne=>ne?String(ne).replace("T"," ").slice(0,19):"-"},...(w==null?void 0:w.type)==="dept"?[{title:"操作",width:90,render:(ne,Q)=>s.jsx(c.Popconfirm,{title:`将 ${Q.nickname||Q.username||`#${Q.userId}`} 移出本部门?`,onConfirm:()=>O(Q),okText:"移出",cancelText:"取消",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"移出部门"})})}]:[]];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,flex:1,minHeight:0},children:[s.jsxs("div",{style:{display:"flex",gap:16,flex:1,minHeight:0},children:[s.jsx(c.Card,{size:"small",style:{width:340,overflow:"auto",flexShrink:0},title:"组织树",extra:s.jsxs(c.Space,{size:4,children:[t&&s.jsx(c.Tooltip,{title:"新增组织",children:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>Ae("org",{tenantCode:e,domainCode:t})})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>re(e,t)})})]}),children:t?g.length>0?s.jsx(c.Tree,{treeData:g,onSelect:ye,loadData:pe,titleRender:Te,blockNode:!0,showLine:!0,showIcon:!1,expandedKeys:h,onExpand:p,selectedKeys:S}):s.jsx(c.Empty,{description:"该域下暂无组织,请点击右上角新增"}):s.jsx(c.Empty,{description:"未获取到登录租户/域上下文"})}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},children:w?s.jsxs(s.Fragment,{children:[s.jsxs(c.Descriptions,{title:`${Kt[w.type].label}信息 — ${Er(w.data)}`,size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[s.jsx(c.Descriptions.Item,{label:"编码",children:hn(w.data,w.type)}),s.jsx(c.Descriptions.Item,{label:"名称",children:Er(w.data)}),s.jsx(c.Descriptions.Item,{label:"租户",children:w.data.tenantCode||"-"}),s.jsx(c.Descriptions.Item,{label:"域",children:w.data.domainCode||"-"}),w.type!=="org"&&s.jsx(c.Descriptions.Item,{label:"所属组织",children:w.data.orgCode}),w.type==="group"&&s.jsx(c.Descriptions.Item,{label:"所属部门",children:w.data.deptCode}),s.jsx(c.Descriptions.Item,{label:"状态",span:w.type==="group"?1:2,children:s.jsx(c.Tag,{color:(lt=Eo[w.data.status??1])==null?void 0:lt.color,children:(nt=Eo[w.data.status??1])==null?void 0:nt.text})}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:w.data.description||"-"})]}),w.type!=="group"&&s.jsx(c.Card,{type:"inner",title:w.type==="org"?"下级部门 / 组":"下级组",size:"small",style:{marginBottom:16},extra:s.jsx(c.Space,{children:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按编码 / 名称过滤",style:{width:220},onChange:ne=>Ee(ne.target.value)})}),children:s.jsx(c.Table,{columns:De,dataSource:Ie,rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无下级"}})}),w.type!=="group"&&s.jsx(c.Card,{type:"inner",title:"节点成员",size:"small",style:{marginBottom:16},extra:s.jsxs(c.Space,{size:8,children:[s.jsx("span",{style:{fontSize:12,color:"#999"},children:w.type==="org"?"本组织全部部门成员":"本部门成员"}),w.type==="dept"&&s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:F,children:"添加成员"})]}),children:s.jsx(c.Table,{columns:Le,dataSource:T.map((ne,Q)=>({...ne,key:`${ne.userId}-${Q}`})),rowKey:"key",loading:E,pagination:!1,size:"small",locale:{emptyText:"该节点下暂无成员"}})}),w.type==="group"&&s.jsx(c.Card,{type:"inner",title:"节点成员",size:"small",style:{marginBottom:16},children:s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"组别层级暂未挂载成员(成员关系挂在部门维度)"})}),s.jsx(c.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{V(null),Z.resetFields(),q(!0)},children:"新增"}),children:s.jsx(c.Table,{columns:ve,dataSource:x.map((ne,Q)=>({...ne,key:ne.key||Q})),rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无扩展配置"}})})]}):s.jsx(c.Empty,{description:"请从左侧选择组织/部门/组"})})]}),s.jsx(c.Modal,{title:z?"编辑配置":"新增配置",open:B,onCancel:()=>{q(!1),V(null)},onOk:_,destroyOnHidden:!0,children:s.jsxs(c.Form,{form:Z,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!z})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4})})]})}),s.jsxs(c.Modal,{title:L?`新增${Kt[L].label}`:"新增",open:G,onCancel:()=>H(!1),onOk:ce,destroyOnHidden:!0,children:[s.jsxs("div",{style:{marginTop:12,padding:"8px 12px",background:"#f7f8fa",borderRadius:6,fontSize:12,color:"#666",display:"flex",flexWrap:"wrap",gap:16},children:[s.jsxs("span",{children:["租户:",ze.tenantCode||"-"]}),s.jsxs("span",{children:["域:",ze.domainCode||"-"]}),L==="dept"&&s.jsxs("span",{children:["所属组织:",ze.orgCode||"-"]}),L==="group"&&s.jsxs("span",{children:["所属部门:",ze.deptCode||"-"]})]}),s.jsxs(c.Form,{form:te,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:L==="org"?"orgCode":L==="dept"?"deptCode":"groupCode",label:"编码",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"唯一标识"})}),s.jsx(c.Form.Item,{name:L==="org"?"orgName":L==="dept"?"deptName":"groupName",label:"名称",rules:[{required:!0}],children:s.jsx(c.Input,{})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2})})]})]}),s.jsx(c.Modal,{title:`添加成员到「${w?Er(w.data):""}」`,open:I,onCancel:()=>{M(!1),A.resetFields()},onOk:D,okText:"挂载",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:A,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"userId",label:"账号",rules:[{required:!0,message:"请选择账号"}],children:s.jsx(c.Select,{showSearch:!0,optionFilterProp:"label",placeholder:"搜索 / 选择账号",options:Y,notFoundContent:Y.length===0?"账号列表为空":void 0})}),s.jsx(c.Form.Item,{name:"roleCode",label:"角色",initialValue:"member",children:s.jsx(c.Select,{allowClear:!0,placeholder:"默认 member",options:[{value:"member",label:"member(成员)"},{value:"admin",label:"admin(管理员)"}]})})]})})]})}let Xc="/api";function no(e){Xc=e||"/api"}function Vt(){return cn.createRequest({baseURL:Xc,timeout:15e3})}const sr={create:e=>Vt().post("/ctc/ac/tenants",e),getByCode:e=>Vt().get("/ctc/ac/tenants",{params:{tenantCode:e}}),updateStatus:(e,t)=>Vt().post("/ctc/ac/tenants/status",null,{params:{tenantCode:e,status:t}}),listAll:()=>Vt().get("/ctc/ac/tenants/list"),listAllForPlatform:()=>Vt().get("/ctc/ac/tenants/list-all")},Ht={listByTenant:e=>Vt().get("/ctc/ac/domains/list",{params:{tenantCode:e}}),listAll:()=>Vt().get("/ctc/ac/domains/list-all"),getById:e=>Vt().get("/ctc/ac/domains",{params:{id:e}}),create:e=>Vt().post("/ctc/ac/domains",e),update:(e,t)=>Vt().put("/ctc/ac/domains",t,{params:{id:e}}),delete:e=>Vt().delete("/ctc/ac/domains",{params:{id:e}})};function fi(e,t){const n=t==null?void 0:t.domainCode;return n?n==="default"||!!e&&n===`${e}-default`:!1}function mf(){let e="",t="";try{const n=JSON.parse(localStorage.getItem("userInfo")||"{}");e=String((n==null?void 0:n.tenantCode)??""),t=String((n==null?void 0:n.domainCode)??"")}catch{}try{const n=JSON.parse(localStorage.getItem("z_ctc_domain")||"null");n&&n.tenantCode&&n.tenantCode===e&&n.domainCode&&(t=String(n.domainCode))}catch{}return{tenantCode:e||null,domainCode:t||null}}function hf({apiBaseURL:e}){d.useEffect(()=>{e&&no(e)},[e]);const[{tenantCode:t,domainCode:n},r]=d.useState(mf);return d.useEffect(()=>{if(!t||n)return;let a=!1;return Ht.listByTenant(t).then(i=>{if(a||!Array.isArray(i)||i.length!==1)return;const o=i[0],l=String((o==null?void 0:o.domainCode)??"");if(!l)return;const u={tenantCode:t,domainCode:l,domainName:String((o==null?void 0:o.domainName)??l)};try{localStorage.setItem("z_ctc_domain",JSON.stringify(u))}catch{}r(m=>m.domainCode?m:{...m,domainCode:l})}).catch(()=>{}),()=>{a=!0}},[t,n]),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:s.jsx(Jc,{selectedTenant:t,selectedDomain:n,apiBaseURL:"/api"})})}function Jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds={exports:{}},gf=Ds.exports,Mo;function Qc(){return Mo||(Mo=1,(function(e,t){(function(n,r){e.exports=r()})(gf,(function(){var n=1e3,r=6e4,a=36e5,i="millisecond",o="second",l="minute",u="hour",m="day",g="week",f="month",h="quarter",p="year",S="date",y="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var k=["th","st","nd","rd"],F=A%100;return"["+A+(k[(F-20)%10]||k[F]||k[0])+"]"}},C=function(A,k,F){var D=String(A);return!D||D.length>=k?A:""+Array(k+1-D.length).join(F)+A},j={s:C,z:function(A){var k=-A.utcOffset(),F=Math.abs(k),D=Math.floor(F/60),O=F%60;return(k<=0?"+":"-")+C(D,2,"0")+":"+C(O,2,"0")},m:function A(k,F){if(k.date()<F.date())return-A(F,k);var D=12*(F.year()-k.year())+(F.month()-k.month()),O=k.clone().add(D,f),B=F-O<0,q=k.clone().add(D+(B?-1:1),f);return+(-(D+(F-O)/(B?O-q:q-O))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:p,w:g,d:m,D:S,h:u,m:l,s:o,ms:i,Q:h}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},b="en",T={};T[b]=x;var $="$isDayjsObject",E=function(A){return A instanceof Y||!(!A||!A[$])},R=function A(k,F,D){var O;if(!k)return b;if(typeof k=="string"){var B=k.toLowerCase();T[B]&&(O=B),F&&(T[B]=F,O=B);var q=k.split("-");if(!O&&q.length>1)return A(q[0])}else{var z=k.name;T[z]=k,O=z}return!D&&O&&(b=O),O||!D&&b},I=function(A,k){if(E(A))return A.clone();var F=typeof k=="object"?k:{};return F.date=A,F.args=arguments,new Y(F)},M=j;M.l=R,M.i=E,M.w=function(A,k){return I(A,{locale:k.$L,utc:k.$u,x:k.$x,$offset:k.$offset})};var Y=(function(){function A(F){this.$L=R(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[$]=!0}var k=A.prototype;return k.parse=function(F){this.$d=(function(D){var O=D.date,B=D.utc;if(O===null)return new Date(NaN);if(M.u(O))return new Date;if(O instanceof Date)return new Date(O);if(typeof O=="string"&&!/Z$/i.test(O)){var q=O.match(w);if(q){var z=q[2]-1||0,V=(q[7]||"0").substring(0,3);return B?new Date(Date.UTC(q[1],z,q[3]||1,q[4]||0,q[5]||0,q[6]||0,V)):new Date(q[1],z,q[3]||1,q[4]||0,q[5]||0,q[6]||0,V)}}return new Date(O)})(F),this.init()},k.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},k.$utils=function(){return M},k.isValid=function(){return this.$d.toString()!==y},k.isSame=function(F,D){var O=I(F);return this.startOf(D)<=O&&O<=this.endOf(D)},k.isAfter=function(F,D){return I(F)<this.startOf(D)},k.isBefore=function(F,D){return this.endOf(D)<I(F)},k.$g=function(F,D,O){return M.u(F)?this[D]:this.set(O,F)},k.unix=function(){return Math.floor(this.valueOf()/1e3)},k.valueOf=function(){return this.$d.getTime()},k.startOf=function(F,D){var O=this,B=!!M.u(D)||D,q=M.p(F),z=function(W,te){var re=M.w(O.$u?Date.UTC(O.$y,te,W):new Date(O.$y,te,W),O);return B?re:re.endOf(m)},V=function(W,te){return M.w(O.toDate()[W].apply(O.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(te)),O)},Z=this.$W,G=this.$M,H=this.$D,L="set"+(this.$u?"UTC":"");switch(q){case p:return B?z(1,0):z(31,11);case f:return B?z(1,G):z(0,G+1);case g:var K=this.$locale().weekStart||0,P=(Z<K?Z+7:Z)-K;return z(B?H-P:H+(6-P),G);case m:case S:return V(L+"Hours",0);case u:return V(L+"Minutes",1);case l:return V(L+"Seconds",2);case o:return V(L+"Milliseconds",3);default:return this.clone()}},k.endOf=function(F){return this.startOf(F,!1)},k.$set=function(F,D){var O,B=M.p(F),q="set"+(this.$u?"UTC":""),z=(O={},O[m]=q+"Date",O[S]=q+"Date",O[f]=q+"Month",O[p]=q+"FullYear",O[u]=q+"Hours",O[l]=q+"Minutes",O[o]=q+"Seconds",O[i]=q+"Milliseconds",O)[B],V=B===m?this.$D+(D-this.$W):D;if(B===f||B===p){var Z=this.clone().set(S,1);Z.$d[z](V),Z.init(),this.$d=Z.set(S,Math.min(this.$D,Z.daysInMonth())).$d}else z&&this.$d[z](V);return this.init(),this},k.set=function(F,D){return this.clone().$set(F,D)},k.get=function(F){return this[M.p(F)]()},k.add=function(F,D){var O,B=this;F=Number(F);var q=M.p(D),z=function(G){var H=I(B);return M.w(H.date(H.date()+Math.round(G*F)),B)};if(q===f)return this.set(f,this.$M+F);if(q===p)return this.set(p,this.$y+F);if(q===m)return z(1);if(q===g)return z(7);var V=(O={},O[l]=r,O[u]=a,O[o]=n,O)[q]||1,Z=this.$d.getTime()+F*V;return M.w(Z,this)},k.subtract=function(F,D){return this.add(-1*F,D)},k.format=function(F){var D=this,O=this.$locale();if(!this.isValid())return O.invalidDate||y;var B=F||"YYYY-MM-DDTHH:mm:ssZ",q=M.z(this),z=this.$H,V=this.$m,Z=this.$M,G=O.weekdays,H=O.months,L=O.meridiem,K=function(te,re,X,se){return te&&(te[re]||te(D,B))||X[re].slice(0,se)},P=function(te){return M.s(z%12||12,te,"0")},W=L||function(te,re,X){var se=te<12?"AM":"PM";return X?se.toLowerCase():se};return B.replace(v,(function(te,re){return re||(function(X){switch(X){case"YY":return String(D.$y).slice(-2);case"YYYY":return M.s(D.$y,4,"0");case"M":return Z+1;case"MM":return M.s(Z+1,2,"0");case"MMM":return K(O.monthsShort,Z,H,3);case"MMMM":return K(H,Z);case"D":return D.$D;case"DD":return M.s(D.$D,2,"0");case"d":return String(D.$W);case"dd":return K(O.weekdaysMin,D.$W,G,2);case"ddd":return K(O.weekdaysShort,D.$W,G,3);case"dddd":return G[D.$W];case"H":return String(z);case"HH":return M.s(z,2,"0");case"h":return P(1);case"hh":return P(2);case"a":return W(z,V,!0);case"A":return W(z,V,!1);case"m":return String(V);case"mm":return M.s(V,2,"0");case"s":return String(D.$s);case"ss":return M.s(D.$s,2,"0");case"SSS":return M.s(D.$ms,3,"0");case"Z":return q}return null})(te)||q.replace(":","")}))},k.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},k.diff=function(F,D,O){var B,q=this,z=M.p(D),V=I(F),Z=(V.utcOffset()-this.utcOffset())*r,G=this-V,H=function(){return M.m(q,V)};switch(z){case p:B=H()/12;break;case f:B=H();break;case h:B=H()/3;break;case g:B=(G-Z)/6048e5;break;case m:B=(G-Z)/864e5;break;case u:B=G/a;break;case l:B=G/r;break;case o:B=G/n;break;default:B=G}return O?B:M.a(B)},k.daysInMonth=function(){return this.endOf(f).$D},k.$locale=function(){return T[this.$L]},k.locale=function(F,D){if(!F)return this.$L;var O=this.clone(),B=R(F,D,!0);return B&&(O.$L=B),O},k.clone=function(){return M.w(this.$d,this)},k.toDate=function(){return new Date(this.valueOf())},k.toJSON=function(){return this.isValid()?this.toISOString():null},k.toISOString=function(){return this.$d.toISOString()},k.toString=function(){return this.$d.toUTCString()},A})(),U=Y.prototype;return I.prototype=U,[["$ms",i],["$s",o],["$m",l],["$H",u],["$W",m],["$M",f],["$y",p],["$D",S]].forEach((function(A){U[A[1]]=function(k){return this.$g(k,A[0],A[1])}})),I.extend=function(A,k){return A.$i||(A(k,Y,I),A.$i=!0),I},I.locale=R,I.isDayjs=E,I.unix=function(A){return I(1e3*A)},I.en=T[b],I.Ls=T,I.p={},I}))})(Ds)),Ds.exports}var pf=Qc();const Re=Jt(pf),gn={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Aa=(e,t,n)=>e==="tenant"?`tenant:${t}`:`domain:${t}:${n}`;function yf({apiBaseURL:e,platformView:t=!1}){var Te,Oe,Ae,ze;d.useEffect(()=>{e&&no(e)},[e]);const[n,r]=d.useState([]),[a,i]=d.useState(!1),[o,l]=d.useState({}),[u,m]=d.useState({}),[g,f]=d.useState([]),[h,p]=d.useState([]),[S,y]=d.useState([]),[w,v]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState(!1),[T]=c.Form.useForm(),[$,E]=d.useState(!1),[R,I]=d.useState(null),[M]=c.Form.useForm(),[Y,U]=d.useState(!1),[A,k]=d.useState(null),[F]=c.Form.useForm(),[D,O]=d.useState(()=>{try{const ce=Number(localStorage.getItem("ctc_tenant_tree_width"));return Number.isFinite(ce)&&ce>=220&&ce<=640?ce:320}catch{return 320}}),B=d.useRef(D),q=ce=>{ce.preventDefault();const _=ce.clientX,J=B.current,le=Ee=>{const Fe=Math.min(640,Math.max(220,J+Ee.clientX-_));B.current=Fe,O(Fe)},Se=()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",Se),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem("ctc_tenant_tree_width",String(B.current))}catch{}};document.addEventListener("mousemove",le),document.addEventListener("mouseup",Se),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},z=d.useCallback(async()=>{i(!0);try{const ce=t?await sr.listAllForPlatform():await sr.listAll();r(Array.isArray(ce)?ce:[])}catch(ce){c.message.error((t?"获取全平台租户失败(系统租户面板仅平台管理员可访问):":"获取租户列表失败:")+((ce==null?void 0:ce.message)||"未知错误")),r([])}finally{i(!1)}},[t]);d.useEffect(()=>{z()},[z]);const V=d.useCallback(async ce=>{const _=await Promise.all(ce.map(async J=>{try{const le=await Ht.listByTenant(J.tenantCode);return[J.tenantCode,Array.isArray(le)?le:[]]}catch{return[J.tenantCode,[]]}}));l(Object.fromEntries(_))},[]);d.useEffect(()=>{n.length>0&&V(n)},[n,V]),d.useEffect(()=>{const ce=n.map(_=>{var J,le;return{key:Aa("tenant",_.tenantCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:_.tenantName||_.tenantCode}),s.jsx(c.Tag,{color:(J=gn[_.status??1])==null?void 0:J.color,style:{margin:0,fontSize:10,flexShrink:0},children:(le=gn[_.status??1])==null?void 0:le.text})]}),rawTitle:`${_.tenantName||_.tenantCode} (${_.tenantCode})`,data:{type:"tenant",data:_},children:(Array.isArray(o[_.tenantCode])?o[_.tenantCode]:[]).map(Se=>{var Ee,Fe;return{key:Aa("domain",_.tenantCode,Se.domainCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Se.domainName}),s.jsx(c.Tag,{color:(Ee=gn[Se.status])==null?void 0:Ee.color,style:{margin:0,fontSize:10,flexShrink:0},children:(Fe=gn[Se.status])==null?void 0:Fe.text})]}),rawTitle:`${Se.domainName} (${Se.domainCode})`,data:{type:"domain",data:Se},isLeaf:!0}})}});f(ce),y(_=>_.length>0?_:ce.map(J=>J.key))},[n,o]);const Z=async(ce,_)=>{if(fi(ce,_)){c.message.warning("默认域受保护,不可删除");return}if(_.id==null){c.message.error("域 ID 缺失");return}try{await Ht.delete(_.id),c.message.success("删除成功");const J=await Ht.listByTenant(ce);l(le=>({...le,[ce]:Array.isArray(J)?J:[]}))}catch(J){c.message.error("删除失败:"+((J==null?void 0:J.message)||"未知错误"))}},G=async()=>{try{const ce=await T.validateFields();await sr.create({...ce,status:1}),c.message.success("创建成功"),b(!1),T.resetFields(),await z()}catch(ce){if(ce!=null&&ce.errorFields)return;c.message.error("创建失败:"+((ce==null?void 0:ce.message)||"未知错误"))}},H=async(ce,_)=>{const J=_===1?0:1;try{await sr.updateStatus(ce,J),c.message.success(J===1?"已启用":"已停用"),await z()}catch(le){c.message.error("操作失败:"+((le==null?void 0:le.message)||"未知错误"))}},L=ce=>{I(ce),M.resetFields(),M.setFieldsValue({status:1}),E(!0)},K=async()=>{if(R)try{const ce=await M.validateFields(),_=R.tenantCode;await Ht.create({domainCode:ce.domainCode,domainName:ce.domainName,tenantCode:_,status:ce.status??1}),c.message.success(`已为租户「${R.tenantName||_}」新增域「${ce.domainName}」`),E(!1),M.resetFields();const J=await Ht.listByTenant(_),le=Array.isArray(J)?J:[];l(Ee=>({...Ee,[_]:le}));const Se=Aa("tenant",_);y(Ee=>Ee.includes(Se)?Ee:[...Ee,Se])}catch(ce){if(ce!=null&&ce.errorFields)return;c.message.error("新增域失败:"+((ce==null?void 0:ce.message)||"未知错误"))}},P=(ce,_)=>{if(ce.length===0)return;const J=ce[0];p([J]);const le=_.node.data;v(le),C(u[J]||[])},W=async()=>{if(h[0])try{const ce=await F.validateFields();let _;if(A)_=x.map(J=>J.key===A.key?{key:ce.dataId,value:ce.content}:J);else{if(x.some(J=>J.key===ce.dataId)){c.message.error("Key 已存在");return}_=[...x,{key:ce.dataId,value:ce.content}]}m(J=>({...J,[h[0]]:_})),C(_),c.message.success(A?"更新成功":"创建成功"),U(!1),k(null),F.resetFields()}catch(ce){if(ce!=null&&ce.errorFields)return;c.message.error("保存失败")}},te=ce=>{const _=x.filter(J=>J.key!==ce.key);m(J=>({...J,[h[0]]:_})),C(_),c.message.success("删除成功")},re=(w==null?void 0:w.type)==="tenant"?w.data:null,X=(w==null?void 0:w.type)==="domain"?w.data:null,se=X?n.find(ce=>ce.tenantCode===X.tenantCode):null,[ae,ue]=d.useState(""),pe=d.useMemo(()=>x.map((ce,_)=>({...ce,_idx:_})),[x]),me=d.useMemo(()=>{const ce=ae.trim().toLowerCase();return ce?pe.filter(_=>`${_.key||""} ${_.value||""}`.toLowerCase().includes(ce)):pe},[pe,ae]),fe=[{title:"Key",dataIndex:"key",key:"key",width:200},{title:"Value",dataIndex:"value",key:"value",ellipsis:!0},{title:"操作",key:"action",width:120,render:(ce,_)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>{k(_),F.setFieldsValue({dataId:_.key,content:_.value}),U(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除该配置?",onConfirm:()=>te(_),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})]})}],ye=ce=>{const _=ce.data;if(_.type==="tenant"){const Se=_.data;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:ce.title}),s.jsx(c.Tooltip,{title:"新增域",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{style:{fontSize:11}}),onClick:Ee=>{Ee.stopPropagation(),L(Se)}})})]})}const J=_.data,le=J.tenantCode;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:ce.title}),s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:Se=>{Se==null||Se.stopPropagation(),Z(le,J)},onCancel:Se=>Se==null?void 0:Se.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(de.DeleteOutlined,{style:{fontSize:11}}),onClick:Se=>Se.stopPropagation()})})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs("div",{style:{display:"flex",gap:0,height:"calc(100vh - 140px)"},children:[s.jsx(c.Card,{title:"租户 / 域",size:"small",style:{width:D,minWidth:D,flexShrink:0},styles:{body:{padding:8,overflow:"auto",height:"calc(100% - 40px)"}},extra:s.jsxs(c.Space,{size:4,children:[s.jsx(c.Tooltip,{title:"新增租户",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{T.resetFields(),b(!0)}})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.ReloadOutlined,{}),onClick:z})})]}),children:g.length>0?s.jsx(c.Tree,{treeData:g,selectedKeys:h,onSelect:P,titleRender:ye,expandedKeys:S,onExpand:y,defaultExpandAll:!0,showLine:!0,className:"ctc-tenant-tree",blockNode:!0}):s.jsx(c.Empty,{description:a?"加载中...":'暂无租户,点击右上"新增租户"图标创建'})}),s.jsx("div",{onMouseDown:q,title:"拖动调整宽度",style:{width:5,flexShrink:0,cursor:"col-resize",borderRadius:2,background:"#eef0f3"}}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},children:w?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions,{title:re?"租户信息":"域信息",size:"small",bordered:!0,column:2,style:{marginBottom:16},children:re?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:re.tenantCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:re.tenantName}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:re.description||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Popconfirm,{title:`确认${re.status===1?"停用":"启用"}该租户?`,onConfirm:()=>H(re.tenantCode,re.status??1),children:s.jsxs(c.Button,{size:"small",type:"link",danger:re.status===1,children:[s.jsx(c.Tag,{color:(Te=gn[re.status??1])==null?void 0:Te.color,children:(Oe=gn[re.status??1])==null?void 0:Oe.text}),s.jsx("span",{style:{marginLeft:4,fontSize:12},children:"点击切换"})]})})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:re.createdAt||"-"})]}):s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:X.domainCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:X.domainName}),s.jsx(c.Descriptions.Item,{label:"所属租户",children:(se==null?void 0:se.tenantName)||X.tenantCode}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(Ae=gn[X.status])==null?void 0:Ae.color,children:(ze=gn[X.status])==null?void 0:ze.text})})]})}),s.jsx(c.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按 Key / Value 过滤",style:{width:220},onChange:ce=>ue(ce.target.value)}),s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{k(null),F.resetFields(),U(!0)},children:"新增"})]}),children:s.jsx(c.Table,{columns:fe,dataSource:me,rowKey:ce=>`${ce.key}_${ce._idx}`,pagination:!1,size:"small",locale:{emptyText:'暂无扩展配置,点击右上"新增"添加'}})})]}):s.jsx(c.Empty,{description:"请从左侧选择租户或域",style:{marginTop:80}})})]}),s.jsx(c.Modal,{title:"新建租户",open:j,onOk:G,onCancel:()=>b(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:T,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"tenantCode",label:"租户编码",rules:[{required:!0,message:"请输入租户编码"},{pattern:/^[a-z0-9_]+$/,message:"仅允许小写字母数字下划线"}],extra:"唯一标识,创建后不可修改",children:s.jsx(c.Input,{placeholder:"如 default / tenant_a"})}),s.jsx(c.Form.Item,{name:"tenantName",label:"租户名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 默认租户"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:3,placeholder:"可选"})})]})}),s.jsx(c.Modal,{title:A?"编辑配置":"新增配置",open:Y,onOk:W,onCancel:()=>{U(!1),k(null)},destroyOnHidden:!0,children:s.jsxs(c.Form,{form:F,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!A,placeholder:"如 max_users"})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4,placeholder:"配置值"})})]})}),s.jsx(c.Modal,{title:R?`为「${R.tenantName||R.tenantCode}」新增域`:"新增域",open:$,onOk:K,onCancel:()=>{E(!1),M.resetFields()},size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:M,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{label:"所属租户",children:s.jsx(c.Input,{value:(R==null?void 0:R.tenantName)||"",disabled:!0})}),s.jsx(c.Form.Item,{name:"domainCode",label:"域编码",rules:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(c.Input,{placeholder:"如 prod / staging"})}),s.jsx(c.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(c.Input,{placeholder:"如 生产环境"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})})]})})]})}const ka={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function xf({apiBaseURL:e}){d.useEffect(()=>{e&&no(e)},[e]);const[t,n]=d.useState([]),[r,a]=d.useState(""),[i,o]=d.useState(!1),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),w=d.useCallback(async()=>{o(!0);try{const E=await sr.listAll(),R=Array.isArray(E)?E:[];n(R),a(I=>{var M;return R.some(Y=>Y.tenantCode===I)?I:((M=R[0])==null?void 0:M.tenantCode)||""})}catch(E){c.message.error("获取我的租户失败:"+((E==null?void 0:E.message)||"未知错误")),n([]),a("")}finally{o(!1)}},[]),v=d.useCallback(async E=>{if(!E){u([]);return}g(!0);try{const R=await Ht.listByTenant(E);u(Array.isArray(R)?R:[])}catch(R){c.message.error("获取域列表失败:"+((R==null?void 0:R.message)||"未知错误")),u([])}finally{g(!1)}},[]);d.useEffect(()=>{w()},[w]),d.useEffect(()=>{v(r)},[r,v]);const x=d.useMemo(()=>t.find(E=>E.tenantCode===r)||null,[t,r]),C=()=>{S(null),y.resetFields(),y.setFieldsValue({status:1}),h(!0)},j=E=>{S(E),y.resetFields(),y.setFieldsValue({domainCode:E.domainCode,domainName:E.domainName,description:E.description,status:E.status??1}),h(!0)},b=async()=>{if(r)try{const E=await y.validateFields();p?(await Ht.update(p.id,{domainName:E.domainName,description:E.description||"",status:E.status??1}),c.message.success("已保存")):(await Ht.create({domainCode:E.domainCode,domainName:E.domainName,description:E.description||"",tenantCode:r,status:E.status??1}),c.message.success(`已新增域「${E.domainName}」`)),h(!1),S(null),y.resetFields(),await v(r)}catch(E){if(E!=null&&E.errorFields)return;c.message.error("保存失败:"+((E==null?void 0:E.message)||"未知错误"))}},T=async E=>{if(fi(r,E)){c.message.warning("默认域受保护,不可删除");return}try{await Ht.delete(E.id),c.message.success("已删除"),await v(r)}catch(R){c.message.error("删除失败:"+((R==null?void 0:R.message)||"未知错误"))}},$=[{title:"域编码",dataIndex:"domainCode",key:"domainCode",width:220},{title:"域名称",dataIndex:"domainName",key:"domainName",width:200},{title:"状态",dataIndex:"status",key:"status",width:100,render:E=>{const R=ka[E]||{text:String(E??"-"),color:"default"};return s.jsx(c.Tag,{color:R.color,children:R.text})}},{title:"描述",dataIndex:"description",key:"description",ellipsis:!0},{title:"创建时间",dataIndex:"createdAt",key:"createdAt",width:180},{title:"操作",key:"action",width:150,render:(E,R)=>s.jsxs(c.Space,{size:0,children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>j(R),children:"编辑"}),fi(r,R)?s.jsx(c.Tooltip,{title:"默认域受保护,不可删除",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,disabled:!0,children:"删除"})}):s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:()=>T(R),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return!i&&t.length===0?s.jsx(c.Card,{size:"small",children:s.jsx(c.Empty,{description:"当前账号还未加入任何租户"})}):s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(c.Card,{size:"small",title:"我的租户",extra:s.jsxs(c.Space,{size:8,children:[t.length>1&&s.jsx(c.Select,{size:"small",style:{minWidth:200},value:r||void 0,onChange:a,options:t.map(E=>({value:E.tenantCode,label:`${E.tenantName||E.tenantCode} (${E.tenantCode})`}))}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{w(),v(r)}})})]}),children:x?s.jsxs(c.Descriptions,{size:"small",bordered:!0,column:{xs:1,sm:2,md:2,lg:4},children:[s.jsx(c.Descriptions.Item,{label:"租户编码",children:x.tenantCode}),s.jsx(c.Descriptions.Item,{label:"租户名称",children:x.tenantName||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(ka[x.status??1]||{}).color,children:(ka[x.status??1]||{text:"-"}).text})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:x.createdAt||"-"})]}):s.jsx(c.Empty,{description:i?"加载中...":"暂无租户"})}),s.jsx(c.Card,{size:"small",title:"域",extra:s.jsx(c.Space,{size:4,children:s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),disabled:!r,onClick:C,children:"新增域"})}),children:s.jsx(c.Table,{columns:$,dataSource:l,rowKey:E=>E.id??E.domainCode,loading:m,size:"small",scroll:{x:880},pagination:{pageSize:10,showSizeChanger:!1,hideOnSinglePage:!0},locale:{emptyText:"该租户下暂无域,点击右上「新增域」创建"}})}),s.jsx(c.Modal,{title:p?`编辑域「${p.domainName}」`:`为「${(x==null?void 0:x.tenantName)||r}」新增域`,open:f,onOk:b,onCancel:()=>{h(!1),S(null),y.resetFields()},destroyOnHidden:!0,children:s.jsxs(c.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"domainCode",label:"域编码",rules:p?[]:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:p?"编码创建后不可修改":"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(c.Input,{placeholder:"如 prod / staging",disabled:!!p})}),s.jsx(c.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(c.Input,{placeholder:"如 生产环境"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:3,placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"正常"},{value:0,label:"停用"}]})})]})})]})}const eu=e=>{const t=be.useRef(e);return t.current=e,be.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])};function Xr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const Ao=process.env.NODE_ENV!=="test"&&Xr()?be.useLayoutEffect:be.useEffect,bf=(e,t)=>{const n=be.useRef(!0);Ao(()=>e(n.current),t),Ao(()=>(n.current=!1,()=>{n.current=!0}),[])};function dt(e,t){const[n,r]=d.useState(e),a=t!==void 0?t:n;return bf(i=>{i||r(t)},[t]),[a,r]}let tu=e=>+setTimeout(e,16),nu=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(tu=e=>window.requestAnimationFrame(e),nu=e=>window.cancelAnimationFrame(e));let ko=0;const fa=new Map;function ru(e){fa.delete(e)}const ro=(e,t=1)=>{ko+=1;const n=ko;function r(a){if(a===0)ru(n),e();else{const i=tu(()=>{r(a-1)});fa.set(n,i)}}return r(t),n};ro.cancel=e=>{const t=fa.get(e);return ru(e),nu(t)};process.env.NODE_ENV!=="production"&&(ro.ids=()=>fa);function Sf(e,t,n){const r=be.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var ms={exports:{}},We={};/**
1
+ "use strict";var Qd=Object.defineProperty;var ef=(e,t,n)=>t in e?Qd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>ef(e,typeof t!="symbol"?t+"":t,n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),c=require("antd"),jt=require("@yuku123/z-frontend-common/ui"),d=require("react"),de=require("@ant-design/icons"),cn=require("@yuku123/z-frontend-common");require("react-dom/client");const Gc=require("react-dom"),tf=require("react-router-dom");function nf(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const be=nf(d),rf="# z-ctc-component\n\nz-ctc 4A 中心的**可复用前端组件层**(library mode):账号 / 组织 / 部门 / 用户组 / 租户 / 域 / 角色 / 资源 /\n权限 / 审计 / 字典 / 短链这一整套管理组件。主壳「系统工作台」按域接进来后,ctc 域的页面都从这里出。\n\n- **npm 包名**:`@yuku123/z-ctc-component`\n- **宿主接入**:`import { ComponentDocPage } from '@yuku123/z-ctc-component'`(主壳取文档页的统一名,lead 008 §7)\n 或直接消费各管理组件(`OrgPage` / `AccountManagement` / `RoleManagement` / …)\n- **后端**:z-ctc 后端,前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 默认 `/api`)\n- **技术栈**:React 19 + antd 6 + `@yuku123/z-frontend-common`(基座 `createRequest` 统一解包 `Result<T>`)\n\n> ⚠ 本仓与 `z-ctc-suit` 是**两个不同的包**:suit 是 4A 中心的独立运行壳(`private: true`,不发布 npm),\n> 它不再自建页面,菜单里的每一页都是本包组件的薄包装;本包承载的是**组件层**(`src/components/**`)。\n> 两边视角不同、API 大体重叠 —— 本文件描述的是**本包**的能力面。\n\n---\n\n## 一、能力概览\n\n| 能力 | 组件 | 源文件 | 说明 |\n|------|------|--------|------|\n| 4A 总览 | `CtcOverview` | `components/CtcOverview/index.jsx` | 4A 中心概览入口 |\n| 组织 / 部门 / 组 | `OrgPage`、`OrgManagement` | `components/OrgPage/`、`components/OrgManagement/` | 三级树 CRUD;`OrgPage` 自带租户 / 域拉取,`OrgManagement` 由调用方传 `tenants` / `domains` |\n| 租户 / 域 | `TenantManagement` | `components/TenantManagement/` | 左树右表:租户维护 + 租户下的域维护 |\n| 账号 | `AccountManagement` | `components/AccountManagement/` | 账号列表、新增 / 停用、分配角色、改密 / 重置口令、删除 |\n| 角色 | `RoleManagement` | `components/RoleManagement/` | 角色 CRUD(4A AUTHZ 域) |\n| 权限 | `PermissionManagement` | `components/PermissionManagement/` | 资源 × 角色的授权配置 |\n| 资源(权限点) | `ResourcePage` | `components/ResourcePage/index.jsx` | 全域权限点统一视图,按应用分页查询 |\n| 用户权限 | `UserPermissionPage` | `components/UserPermissionPage/index.jsx` | 查某用户的角色 + 权限资源树 |\n| 应用 | `ApplicationManagement` | `components/ApplicationManagement/` | split-panel:左应用列表,右「基本信息 + Tabs(API 资产 / 菜单 / 按钮 / 数据)」 |\n| 审计 | `AuditPage` | `components/AuditPage/index.jsx` | 审计中心,按类型 Tabs 隔离日志(登录日志等) |\n| 字典 | `DictPage` | `components/DictPage/index.jsx` | 字典类型 + 字典项维护 |\n| 短链 | `SurlManagement` | `components/SurlManagement/` | 生成短码、查元信息、失效 |\n| 通用件 | `UserTable`、`StatusTag` | `components/UserTable.jsx`、`components/StatusTag.jsx` | 可复用的用户表格 / 状态标签 |\n\n### 路由\n\n本包**不自带**路由表;页面由调用方组合(本仓 `src/pages-manifest.tsx` 只提供一条骨架路由 `/z-ctc/hello`)。\n主壳工作台按宿主前缀 `/ctc/*` 挂,文档页的实际路径见第五节。\n\n## 二、导出面\n\n```ts\n// 主入口\nimport { ComponentDocPage } from '@yuku123/z-ctc-component'; // 主壳按统一名取文档页(lead 008 §7)\nimport HelloCtc from '@yuku123/z-ctc-component'; // 默认导出桶(宿主可能依赖其形状)\n\n// 管理组件\nimport { OrgPage, TenantManagement, AccountManagement, ApplicationManagement,\n RoleManagement, PermissionManagement, ResourcePage, UserPermissionPage,\n SurlManagement, DictPage, AuditPage, CtcOverview, OrgManagement,\n UserTable, StatusTag } from '@yuku123/z-ctc-component';\n\n// API client(顶栏租户 / 域下拉要用)\nimport { ctcAcTenantApi, ctcAcDomainApi } from '@yuku123/z-ctc-component';\n\n// /pages 子路径\nimport { routes, appMeta } from '@yuku123/z-ctc-component/pages';\n```\n\n- `ComponentDocPage` 是**具名再导出**(`export { default as ComponentDocPage } from './pages/ComponentDoc'`),\n 与默认导出桶 `export default { HelloCtc }` **并存** —— 默认桶的形状不动(宿主可能依赖它)。\n- `src/index.d.ts` 是手写声明文件(TS 走它、运行时走 `.js`),新增导出必须**同步补进去**,\n 否则 TS 侧会报 TS2305「no exported member」而运行期正常。\n\n## 三、API 端点\n\n前缀 `/api`(各 `api.js` 的 `configureApiBaseURL` 可改),下表路径是 `src/components/**/api.js`\n与 `src/components/_api/**` 里**实际调用**的路径。\n\n### 3.1 账号(AC 域,`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/accounts` | 建账号,返回新 ID |\n| GET | `/ctc/ac/accounts` | 账号列表(按租户 / 域过滤)或按 `id` 查单条 |\n| PUT | `/ctc/ac/accounts` | 改账号(`id` 走请求参数) |\n| DELETE | `/ctc/ac/accounts` | 删账号 |\n| POST | `/ctc/ac/accounts/status` | 启用 / 停用 |\n| POST | `/ctc/ac/accounts/password/change` | 改口令 |\n| POST | `/ctc/ac/accounts/password/reset` | 重置口令 |\n| POST | `/ctc/ac/accounts/assign-role` | 给账号分配角色 |\n\n### 3.2 租户 / 域(AC 域,`TenantManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/ac/tenants` | 建租户 |\n| GET | `/ctc/ac/tenants` | 按 `tenantCode` 查租户 |\n| GET | `/ctc/ac/tenants/list` | 租户全量列表 |\n| POST | `/ctc/ac/tenants/status` | 启用 / 停用租户 |\n| GET | `/ctc/ac/domains/list` | 某租户下的域列表 |\n| GET | `/ctc/ac/domains/list-all` | 域全量列表 |\n| GET | `/ctc/ac/domains` | 按 `id` 查域 |\n| POST | `/ctc/ac/domains` | 建域 |\n| PUT | `/ctc/ac/domains` | 改域 |\n| DELETE | `/ctc/ac/domains` | 删域 |\n\n### 3.3 组织 / 部门 / 组(AC 域,`OrgManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST / GET / PUT / DELETE | `/ctc/ac/orgs` | 组织增删改查;列表走 `/ctc/ac/orgs/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/depts` | 部门增删改查;列表走 `/ctc/ac/depts/list` |\n| POST / GET / PUT / DELETE | `/ctc/ac/groups` | 用户组增删改查;列表走 `/ctc/ac/groups/list` |\n\n组织 / 部门 / 组三级都以 `tenantCode` + `domainCode` 为前缀过滤,组再带 `deptCode`;\n主键类参数一律走**请求参数**(`?xxx=`),不用路径变量。\n\n### 3.4 授权(AUTHZ 域,`_api/ctcAuthorization.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/authz/resources/page-by-app`、`/list`、`/page`、`/distinct-apps` | 资源(权限点)分页 / 列表 / 按应用 |\n| GET / POST / PUT / DELETE | `/ctc/authz/resources` | 资源增删改查 |\n| GET | `/ctc/authz/resources/roles` | 某资源上的角色 |\n| POST / DELETE | `/ctc/authz/roles/grant-resource`、`/ctc/authz/roles/revoke-resource` | 角色 ↔ 资源 绑定 / 解绑 |\n| GET | `/ctc/authz/roles/list`、`/page` | 角色清单 / 分页 |\n| GET / POST / PUT / DELETE | `/ctc/authz/roles` | 角色增删改查 |\n| GET | `/ctc/authz/users/roles`、`/ctc/authz/users/permissions` | 某用户的角色 / 权限 |\n| POST / DELETE | `/ctc/authz/users/grant-role`、`/ctc/authz/users/revoke-role` | 用户 ↔ 角色 授予 / 撤销 |\n| GET | `/ctc/authz/roles/resources` | 某角色拥有的资源 |\n| POST | `/ctc/authz/check` | 鉴权判定 |\n\n### 3.5 应用(`_api/metaApp.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/meta-app/list` | 应用清单 |\n| GET | `/meta-app/get` | 应用详情 |\n| POST | `/meta-app` | 建应用 |\n| PUT | `/meta-app` | 改应用 |\n| DELETE | `/meta-app` | 删应用 |\n\n### 3.6 字典(`_api/dict.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/dict/type/list`、`/dict/type/get` | 字典类型列表 / 详情 |\n| POST / PUT / DELETE | `/dict/type` | 字典类型增删改 |\n| GET | `/dict/item/list`、`/dict/items/get` | 字典项列表(按 `dictId` 或 `dictCode`) |\n| POST / PUT / DELETE | `/dict/item` | 字典项增删改 |\n\n### 3.7 审计 / 登录日志(`_api/loginLog.js`、`_api/ctcAcAccount.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| GET | `/ctc/ac/login-log/list` | 登录日志列表 |\n| GET | `/ctc/ac/login-log/page` | 登录日志分页 |\n| GET | `/ctc/ac/login-log/recent` | 最近登录 |\n| POST | `/ctc/ac/login-log/list` | 登录日志条件查询(账号页在用) |\n\n### 3.8 短链(`SurlManagement/api.js`)\n\n| 方法 | 路径 | 说明 |\n|---|---|---|\n| POST | `/ctc/surl/shorten` | 生成短码 |\n| GET | `/ctc/surl/info` | 查短码元信息 |\n| DELETE | `/ctc/surl` | 失效短码 |\n| GET | `/s/{mapKey}` | 短链跳转(前端拼 `origin + /s/{mapKey}`) |\n\n## 四、组件说明\n\n### 4.1 组织 / 部门 / 组(OrgPage、OrgManagement)\n\n左树右表布局,三级联动:租户 → 域 → 组织 → 部门 → 用户组。\n`OrgPage` 是**标准页面**:自己拉租户 / 域并维护选中态;`OrgManagement` 是**业务组件**:\n租户 / 域由调用方通过 props 传入(本组件不耦合 z-meta),适合嵌进别的页面。\n\n### 4.2 租户 / 域(TenantManagement)\n\n左树右表。租户支持新建、按 code 查询、启停用、全量列表;域挂在选中租户下,支持新建 / 改 / 删。\n`ctcAcTenantApi` / `ctcAcDomainApi` 同时从主入口导出,供宿主顶栏的租户 / 域下拉直接调用。\n\n### 4.3 账号(AccountManagement)\n\n列表 + 新增 / 停用 / 分配角色 / 改密 / 重置口令 / 删除。\n\n### 4.4 应用(ApplicationManagement)\n\nsplit-panel:左侧应用紧凑列表(编辑 / 停用 / 删除),右侧整块替换为「应用基本信息 + Tabs」,\n每个 Tab 一张表(API 资产 / 菜单 / 按钮 / 数据)。\n\n### 4.5 授权(RoleManagement / PermissionManagement / ResourcePage / UserPermissionPage)\n\n- **角色**:角色 CRUD。\n- **权限**:资源 × 角色的授权配置(授予 / 撤销)。\n- **资源**:全域权限点统一视图,按应用分页。\n- **用户权限**:输入用户 → 看他的角色 + 权限资源树(用户列表来自 AC 域,角色 / 权限来自 AUTHZ 域)。\n\n### 4.6 审计 / 字典 / 短链\n\n审计中心按类型 Tabs 隔离日志(当前实现登录日志);字典是类型 + 字典项两级;短链是生成 / 查询 / 失效三件套。\n\n### 4.7 组件文档\n\n本文件。内容以 `?raw` 在编译期内联进 bundle(零额外请求);渲染用基座\n`@yuku123/z-frontend-common/ui` 的 `ComponentDoc`(左 240px TOC + 右正文两栏)。\n\n## 五、路由与宿主接入\n\n| 场景 | 路径 | 说明 |\n|---|---|---|\n| 独立壳(`z-ctc-suit`) | `/z-ctc/docs` | 本包 `src/pages-manifest.tsx` 里 `routes` 的路径;独立壳把 `routes` 数组直接铺成 `<Route>` |\n| 主壳「系统工作台」 | **`/ctc/docs`** | 工作台按**宿主前缀**挂各域(`/ctc/*`),文档页由主壳 `SystemShell.tsx` 的路由表指向本包导出的 `ComponentDocPage` |\n\n⚠ 两者路径**不同源**:manifest 的 `/z-ctc/docs` 只在独立壳里生效;工作台里走宿主前缀 `/ctc/docs`\n(主壳的路由表注释写明:manifest 的 routes 是给独立壳用的,工作台按宿主前缀挂,manifest 路径在工作台不生效)。\n\n## 六、配置\n\n| 配置项 | 默认值 | 说明 |\n|---|---|---|\n| API 前缀 | `/api` | 各 `api.js` 的 `configureApiBaseURL(baseURL)` 可覆写 |\n| 超时 | 15000ms | `createRequest({baseURL, timeout})` |\n| 响应解包 | 基座统一拦截器 | 业务层拿到的已经是内层数据,**不要**再 `.then(r => r.data)` |\n| 参数规约 | 请求参数 | 主键 / 编码一律 `?xxx=`,不用路径变量 |\n\n## 七、已知限制\n\n- **认证策略配置(密码策略、第三方登录)还没有迁进本包** —— 那张页面目前仍住在 `z-ctc-suit/src/pages/AuthnPage.jsx`,\n 本包不含对应组件与端点。\n- **本包不含路由表**:真实页面路由由宿主(独立壳 / 主壳)决定,本包只提供组件与 `routes` 骨架。\n- `src/index.d.ts` 是手写声明文件,**新增导出必须同步补**,否则 TS 侧报 TS2305 而运行期正常。\n- `OrgManagement` 依赖调用方传入 `tenants` / `domains`,不自己拉租户域(避免耦合 z-meta)。\n- 主键类参数走请求参数,URL 变长;后端因此不能靠路径变量路由。\n\n## 八、变更记录\n\n| 版本 | 变更 |\n|---|---|\n| 1.0.4(本次改动,版本号未抬) | 落地 lead 008 §7:新增本文件 + `src/pages/ComponentDoc.tsx` 薄包装 + `pages-manifest` 里 `/z-ctc/docs` 路由 + 主入口(与 `index.d.ts`)具名再导出 `ComponentDocPage` |\n| 1.0.4 | 4A 组件层:账号 / 组织 / 部门 / 组 / 租户 / 域 / 角色 / 资源 / 权限 / 应用 / 审计 / 字典 / 短链 |\n";function sf(){return s.jsx(jt.ComponentDoc,{markdown:rf,title:"组件文档 — z-ctc"})}function af({dataSource:e,loading:t,onEdit:n,onDelete:r,onRefresh:a}){const i=[{title:"用户名",dataIndex:"userName",key:"userName"},{title:"昵称",dataIndex:"nickName",key:"nickName"},{title:"手机号",dataIndex:"phone",key:"phone"},{title:"邮箱",dataIndex:"email",key:"email"},{title:"状态",dataIndex:"status",key:"status",render:o=>s.jsx(c.Tag,{color:o===1?"green":"red",children:o===1?"正常":"禁用"})},{title:"操作",key:"action",render:(o,l)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>n==null?void 0:n(l),children:"编辑"}),s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:()=>r==null?void 0:r(l),children:"删除"})]})}];return s.jsx(jt.ListTable,{rows:e,columns:i,loading:t,rowKey:"id",searchKeys:["userName","nickName","phone","email"],searchPlaceholder:"按用户名 / 昵称 / 手机号 / 邮箱过滤"})}const of={1:{color:"green",text:"正常"},0:{color:"red",text:"禁用"},pending:{color:"orange",text:"待处理"},approved:{color:"blue",text:"已通过"},rejected:{color:"red",text:"已拒绝"}};function lf({status:e,map:t}){const n=(t==null?void 0:t[e])||of[e]||{color:"default",text:e};return s.jsx(c.Tag,{color:n.color,children:n.text})}let Zc="/api";function cf(e){Zc=e||"/api"}function yt(){return cn.createRequest({baseURL:Zc,timeout:15e3})}const Ia={create:e=>yt().post("/ctc/ac/orgs",e),listByDomain:(e,t)=>yt().get("/ctc/ac/orgs/list",{params:{tenantCode:e,domainCode:t}}),getByCode:(e,t,n)=>yt().get("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}}),update:(e,t,n,r)=>yt().put("/ctc/ac/orgs",r,{params:{tenantCode:e,domainCode:t,orgCode:n}}),delete:(e,t,n)=>yt().delete("/ctc/ac/orgs",{params:{tenantCode:e,domainCode:t,orgCode:n}})},In={create:e=>yt().post("/ctc/ac/depts",e),listByOrg:(e,t,n)=>yt().get("/ctc/ac/depts/list",{params:{tenantCode:e,domainCode:t,orgCode:n}}),getByCode:(e,t,n,r)=>yt().get("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),update:(e,t,n,r)=>yt().put("/ctc/ac/depts",r,{params:{tenantCode:e,domainCode:t,deptCode:n}}),delete:(e,t,n,r)=>yt().delete("/ctc/ac/depts",{params:{tenantCode:e,domainCode:t,orgCode:r,deptCode:n}}),listMembers:(e,t,{orgCode:n,deptCode:r}={})=>yt().get("/ctc/ac/depts/members",{params:{tenantCode:e,domainCode:t,orgCode:n,deptCode:r}}),attachMember:(e,t,n,r,a)=>yt().post("/ctc/ac/depts/members",null,{params:{tenantCode:e,domainCode:t,deptCode:n,userId:r,roleCode:a}}),detachMember:(e,t,n,r)=>yt().delete("/ctc/ac/depts/members",{params:{tenantCode:e,domainCode:t,deptCode:n,userId:r}})},Ma={create:e=>yt().post("/ctc/ac/groups",e),listByDept:(e,t,n)=>yt().get("/ctc/ac/groups/list",{params:{tenantCode:e,domainCode:t,deptCode:n}}),getByCode:(e,t,n,r)=>yt().get("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),update:(e,t,n,r,a)=>yt().put("/ctc/ac/groups",a,{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}}),delete:(e,t,n,r)=>yt().delete("/ctc/ac/groups",{params:{tenantCode:e,domainCode:t,deptCode:n,groupCode:r}})};let uf="/api";function _t(){return cn.createRequest({baseURL:uf,timeout:15e3})}const sn={create:e=>_t().post("/ctc/ac/accounts",e),getById:e=>_t().get("/ctc/ac/accounts",{params:{id:e}}),listByTenant:e=>_t().get("/ctc/ac/accounts",{params:e}),updateStatus:(e,t)=>_t().post("/ctc/ac/accounts/status",null,{params:{id:e,status:t}}),changePassword:(e,t)=>_t().post("/ctc/ac/accounts/password/change",t,{params:{id:e}}),resetPassword:(e,t)=>_t().post("/ctc/ac/accounts/password/reset",t,{params:{id:e}}),update:(e,t)=>_t().put("/ctc/ac/accounts",t,{params:{id:e}}),delete:e=>_t().delete("/ctc/ac/accounts",{params:{id:e}}),assignRole:(e,t)=>_t().post("/ctc/ac/accounts/assign-role",null,{params:{userId:e,roleId:t}}),listAffiliations:e=>_t().get("/ctc/ac/accounts/affiliations",{params:{userId:e}})},df={list:e=>_t().post("/ctc/ac/login-log/list",e)},ff="z_org_ext_config",Eo={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Kt={org:{label:"组织",color:"#1677ff"},dept:{label:"部门",color:"#52c41a"},group:{label:"组别",color:"#fa8c16"}};function mn(e,t){return`${e}:${t}`}function hn(e,t){return t==="org"?e.orgCode:t==="dept"?e.deptCode:e.groupCode}function Er(e){return e.orgName||e.deptName||e.groupName||""}function fs(e){return e.groupCode?"group":e.deptCode?"dept":"org"}function Ro(e,t){try{return JSON.parse(localStorage.getItem(t)||"{}")[e]||[]}catch{return[]}}function Io(e,t,n){const r=JSON.parse(localStorage.getItem(n)||"{}");r[e]=t,localStorage.setItem(n,JSON.stringify(r))}function Jc({selectedTenant:e=null,selectedDomain:t=null,apiBaseURL:n,extConfigStorageKey:r=ff}){var lt,nt;d.useEffect(()=>{n&&cf(n)},[n]);const[a,i]=d.useState({}),[o,l]=d.useState({}),[u,m]=d.useState({}),[g,f]=d.useState([]),[h,p]=d.useState([]),[S,y]=d.useState([]),[w,T]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState([]),[v,$]=d.useState([]),[E,R]=d.useState(!1),[D,M]=d.useState(!1),[U,Y]=d.useState([]),[O]=c.Form.useForm(),I=d.useCallback(ne=>{if(!ne||!e||!t||ne.type==="group"){$([]);return}let Q=!1;R(!0);const{type:he,data:Ce}=ne;return In.listMembers(e,t,{deptCode:he==="dept"?Ce.deptCode:void 0,orgCode:he==="org"?Ce.orgCode:void 0}).then(Je=>{Q||$(Array.isArray(Je)?Je:[])}).catch(()=>{Q||$([])}).finally(()=>{Q||R(!1)}),()=>{Q=!0}},[e,t]);d.useEffect(()=>{I(w)},[w,I]);const F=async()=>{var ne;M(!0);try{const Q=await sn.listByTenant({pageNum:1,pageSize:200}),he=Array.isArray(Q)?Q:(Q==null?void 0:Q.records)||((ne=Q==null?void 0:Q.data)==null?void 0:ne.records)||[];Y(he.map(Ce=>({value:Ce.userId??Ce.id,label:Ce.nickname?`${Ce.username||`#${Ce.userId}`}(${Ce.nickname})`:Ce.username||`#${Ce.userId}`})))}catch{Y([]),c.message.error("账号列表加载失败")}},A=async()=>{try{const ne=await O.validateFields();await In.attachMember(e,t,w.data.deptCode,ne.userId,ne.roleCode||void 0),c.message.success("成员已挂载到部门"),M(!1),O.resetFields(),I(w)}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("挂载失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},k=async ne=>{try{await In.detachMember(e,t,w.data.deptCode,ne.userId),c.message.success("已移出部门"),I(w)}catch(Q){c.message.error("移出失败:"+((Q==null?void 0:Q.message)||"未知错误"))}},[B,G]=d.useState(!1),[_,H]=d.useState(null),[Z]=c.Form.useForm(),[q,V]=d.useState(!1),[L,K]=d.useState(null),[P,W]=d.useState(null),[te]=c.Form.useForm(),re=d.useCallback(async(ne,Q)=>{if(!ne||!Q)return[];const he=await Ia.listByDomain(ne,Q),Ce=Array.isArray(he)?he:[];return i(Je=>({...Je,[Q]:Ce})),Ce},[]),X=d.useCallback(async(ne,Q,he)=>{if(!ne||!Q||!he)return[];const Ce=await In.listByOrg(ne,Q,he),Je=Array.isArray(Ce)?Ce:[];return l(Ct=>({...Ct,[he]:Je})),Je},[]),se=d.useCallback(async(ne,Q,he)=>{if(!ne||!Q||!he)return[];const Ce=await Ma.listByDept(ne,Q,he),Je=Array.isArray(Ce)?Ce:[];return m(Ct=>({...Ct,[he]:Je})),Je},[]);d.useEffect(()=>{if(!e||!t){f([]);return}if(!a[t]){re(e,t);return}const Q=(a[t]||[]).map(he=>({key:mn("org",he.orgCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Kt.org.color,style:{margin:0},children:"组织"}),he.orgName||he.orgCode,he.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"org",data:he},isLeaf:!1}));f(Q)},[e,t,a,re]);const ae=ne=>ne.map(Q=>({key:mn("dept",Q.deptCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Kt.dept.color,style:{margin:0},children:"部门"}),Q.deptName||Q.deptCode,Q.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"dept",data:Q},isLeaf:!1})),ue=ne=>ne.map(Q=>({key:mn("group",Q.groupCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx(c.Tag,{color:Kt.group.color,style:{margin:0},children:"组"}),Q.groupName||Q.groupCode,Q.status===0&&s.jsx(c.Tag,{color:"default",style:{margin:0,fontSize:10},children:"停用"})]}),data:{type:"group",data:Q},isLeaf:!0})),pe=async ne=>{var tn;const Q=(tn=ne==null?void 0:ne.data)!=null&&tn.type?ne.data:ne,{key:he}=ne,Ce=Q==null?void 0:Q.type,Je=(Q==null?void 0:Q.data)||{};let Ct=[];Ce==="org"?Ct=ae(await X(e,t,Je.orgCode)):Ce==="dept"&&(Ct=ue(await se(e,t,Je.deptCode))),f(ht=>fe(ht,he,Ct))},me=async(ne,Q)=>{let he=[];if(ne==="org")he=ae(await X(e,t,Q));else if(ne==="dept")he=ue(await se(e,t,Q));else return;f(Ce=>fe(Ce,mn(ne,Q),he))},fe=(ne,Q,he)=>ne.map(Ce=>Ce.key===Q?{...Ce,children:he}:Ce.children?{...Ce,children:fe(Ce.children,Q,he)}:Ce),ye=(ne,Q)=>{if(!ne||ne.length===0)return;const he=ne[0];y([he]);const Ce=Q.node.data;T(Ce),C(Ro(he,r)),Ce.type==="org"?b(o[Ce.data.orgCode]||[]):Ce.type==="dept"?b(u[Ce.data.deptCode]||[]):b([])},Te=ne=>{var tn;const Q=ne.data,he=Q==null?void 0:Q.type,Ce=Q==null?void 0:Q.data,Je=he==="org"?[{key:"dept",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Kt.dept.color,children:"部门"})," 新增部门"]})}]:he==="dept"?[{key:"group",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:Kt.group.color,children:"组别"})," 新增组别"]})}]:[],Ct=he&&((tn=Kt[he])==null?void 0:tn.label)||"节点";return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},onClick:ht=>ht.stopPropagation(),children:[s.jsx("span",{style:{flex:1},children:ne.title}),Je.length>0&&s.jsx(c.Dropdown,{menu:{items:Je,onClick:({key:ht})=>Ae(ht,Ce)},trigger:["click"],children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{style:{fontSize:11}}),onClick:ht=>ht.stopPropagation()})}),s.jsx(c.Popconfirm,{title:`确定删除该${Ct}?`,onConfirm:()=>he&&Oe(he,Ce),onCancel:ht=>ht==null?void 0:ht.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(de.DeleteOutlined,{style:{fontSize:11}}),onClick:ht=>ht.stopPropagation()})})]})},Oe=async(ne,Q)=>{try{const he=Q.tenantCode||e,Ce=Q.domainCode||t;if(!he||!Ce){c.message.error("租户/域信息缺失, 无法删除");return}ne==="org"?(await Ia.delete(he,Ce,Q.orgCode),await re(he,Ce)):ne==="dept"?(await In.delete(he,Ce,Q.deptCode,Q.orgCode),Q.orgCode&&await me("org",Q.orgCode)):ne==="group"&&(await Ma.delete(he,Ce,Q.deptCode,Q.groupCode),Q.deptCode&&await me("dept",Q.deptCode)),c.message.success("删除成功"),w&&hn(w.data,w.type)===hn(Q,ne)&&(T(null),C([]),b([]),y([]))}catch(he){c.message.error("删除失败:"+((he==null?void 0:he.message)||"未知错误"))}},Ae=(ne,Q)=>{K(ne),W(Q||null),te.resetFields(),V(!0)},ze=d.useMemo(()=>{const ne=(P==null?void 0:P.data)||P||{},Q={tenantCode:ne.tenantCode||e,domainCode:ne.domainCode||t};return L==="dept"&&(Q.orgCode=ne.orgCode),L==="group"&&(Q.deptCode=ne.deptCode,ne.orgCode&&(Q.orgCode=ne.orgCode)),Q},[L,P,e,t]),ce=async()=>{if(L)try{const ne=await te.validateFields(),Q={...ze,...ne,status:Number(ne.status??1),description:ne.description||"",extConfig:"[]"};if(L==="org"){await Ia.create(Q);const he=Q.domainCode||t;he&&await re(Q.tenantCode,he)}else if(L==="dept"){await In.create(Q);const he=Q.orgCode;if(he&&await me("org",he),(w==null?void 0:w.type)==="org"&&w.data.orgCode===he){const Ce=await In.listByOrg(Q.tenantCode,Q.domainCode,he);b(Ce)}}else if(L==="group"){await Ma.create(Q);const he=Q.deptCode;he&&await me("dept",he)}c.message.success("创建成功"),V(!1)}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("创建失败:"+((ne==null?void 0:ne.message)||"未知错误"))}},z=async()=>{if(w)try{const ne=await Z.validateFields();let Q;if(_)Q=x.map(Ce=>Ce.key===_.key?{key:ne.dataId,value:ne.content}:Ce);else{if(x.some(Ce=>Ce.key===ne.dataId)){c.message.error("Key 已存在");return}Q=[...x,{key:ne.dataId,value:ne.content}]}const he=mn(w.type,hn(w.data,w.type));Io(he,Q,r),C(Q),G(!1),H(null),Z.resetFields(),c.message.success("保存成功")}catch(ne){if(ne!=null&&ne.errorFields)return;c.message.error("保存失败")}},J=ne=>{if(!w)return;const Q=mn(w.type,hn(w.data,w.type)),he=x.filter(Ce=>Ce.key!==ne.key);Io(Q,he,r),C(he),c.message.success("删除成功")},le=(ne,Q)=>{const he=hn(ne,Q);y([mn(Q,he)]),T({type:Q,data:ne}),C(Ro(mn(Q,he),r)),b(Q==="org"?o[ne.orgCode]||[]:Q==="dept"?u[ne.deptCode]||[]:[])},[Se,Ee]=d.useState(""),Fe=d.useMemo(()=>j.map((ne,Q)=>({...ne,key:Q})),[j]),Ie=d.useMemo(()=>{const ne=Se.trim().toLowerCase();return ne?Fe.filter(Q=>`${hn(Q,fs(Q))||""} ${Er(Q)||""}`.toLowerCase().includes(ne)):Fe},[Fe,Se]),De=[{title:"编码",dataIndex:"code",width:140,render:(ne,Q)=>hn(Q,fs(Q))},{title:"名称",dataIndex:"name",ellipsis:!0,render:(ne,Q)=>Er(Q)},{title:"类型",dataIndex:"type",width:100,render:(ne,Q)=>{const he=fs(Q);return s.jsx(c.Tag,{color:Kt[he].color,children:Kt[he].label})}},{title:"操作",dataIndex:"action",width:100,render:(ne,Q)=>{const he=fs(Q);return s.jsx(c.Button,{type:"link",size:"small",onClick:()=>le(Q,he),children:"详情"})}}],ve=[{title:"Key",dataIndex:"key",width:200,ellipsis:!0},{title:"Value",dataIndex:"value",ellipsis:!0},{title:"操作",width:140,render:(ne,Q)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",type:"link",onClick:()=>{H(Q),Z.setFieldsValue({dataId:Q.key,content:Q.value}),G(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除",onConfirm:()=>J(Q),children:s.jsx(c.Button,{size:"small",type:"link",danger:!0,children:"删除"})})]})}],ke={0:{text:"待接受",color:"processing"},1:{text:"正常",color:"success"},2:{text:"已禁用",color:"error"},3:{text:"已退出",color:"default"}},Le=[{title:"成员",dataIndex:"nickname",ellipsis:!0,render:(ne,Q)=>Q.nickname||Q.username||`#${Q.userId}`},{title:"账号",dataIndex:"username",ellipsis:!0,render:ne=>ne||"-"},{title:"角色",dataIndex:"roleCode",width:100,render:ne=>s.jsx(c.Tag,{style:{margin:0},children:ne||"-"})},{title:"部门",dataIndex:"deptCode",width:130,ellipsis:!0,render:(ne,Q)=>(w==null?void 0:w.type)==="org"&&Q.deptCode?Q.deptCode:"-"},{title:"状态",dataIndex:"memberStatus",width:90,render:ne=>{var Q,he;return s.jsx(c.Tag,{color:((Q=ke[ne])==null?void 0:Q.color)||"default",style:{margin:0},children:((he=ke[ne])==null?void 0:he.text)||ne})}},{title:"加入时间",dataIndex:"joinedAt",width:160,render:ne=>ne?String(ne).replace("T"," ").slice(0,19):"-"},...(w==null?void 0:w.type)==="dept"?[{title:"操作",width:90,render:(ne,Q)=>s.jsx(c.Popconfirm,{title:`将 ${Q.nickname||Q.username||`#${Q.userId}`} 移出本部门?`,onConfirm:()=>k(Q),okText:"移出",cancelText:"取消",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"移出部门"})})}]:[]];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0,flex:1,minHeight:0},children:[s.jsxs("div",{style:{display:"flex",gap:16,flex:1,minHeight:0},children:[s.jsx(c.Card,{size:"small",style:{width:340,overflow:"auto",flexShrink:0},title:"组织树",extra:s.jsxs(c.Space,{size:4,children:[t&&s.jsx(c.Tooltip,{title:"新增组织",children:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>Ae("org",{tenantCode:e,domainCode:t})})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>re(e,t)})})]}),children:t?g.length>0?s.jsx(c.Tree,{treeData:g,onSelect:ye,loadData:pe,titleRender:Te,blockNode:!0,showLine:!0,showIcon:!1,expandedKeys:h,onExpand:p,selectedKeys:S}):s.jsx(c.Empty,{description:"该域下暂无组织,请点击右上角新增"}):s.jsx(c.Empty,{description:"未获取到登录租户/域上下文"})}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},children:w?s.jsxs(s.Fragment,{children:[s.jsxs(c.Descriptions,{title:`${Kt[w.type].label}信息 — ${Er(w.data)}`,size:"small",bordered:!0,column:2,style:{marginBottom:16},children:[s.jsx(c.Descriptions.Item,{label:"编码",children:hn(w.data,w.type)}),s.jsx(c.Descriptions.Item,{label:"名称",children:Er(w.data)}),s.jsx(c.Descriptions.Item,{label:"租户",children:w.data.tenantCode||"-"}),s.jsx(c.Descriptions.Item,{label:"域",children:w.data.domainCode||"-"}),w.type!=="org"&&s.jsx(c.Descriptions.Item,{label:"所属组织",children:w.data.orgCode}),w.type==="group"&&s.jsx(c.Descriptions.Item,{label:"所属部门",children:w.data.deptCode}),s.jsx(c.Descriptions.Item,{label:"状态",span:w.type==="group"?1:2,children:s.jsx(c.Tag,{color:(lt=Eo[w.data.status??1])==null?void 0:lt.color,children:(nt=Eo[w.data.status??1])==null?void 0:nt.text})}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:w.data.description||"-"})]}),w.type!=="group"&&s.jsx(c.Card,{type:"inner",title:w.type==="org"?"下级部门 / 组":"下级组",size:"small",style:{marginBottom:16},extra:s.jsx(c.Space,{children:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按编码 / 名称过滤",style:{width:220},onChange:ne=>Ee(ne.target.value)})}),children:s.jsx(c.Table,{columns:De,dataSource:Ie,rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无下级"}})}),w.type!=="group"&&s.jsx(c.Card,{type:"inner",title:"节点成员",size:"small",style:{marginBottom:16},extra:s.jsxs(c.Space,{size:8,children:[s.jsx("span",{style:{fontSize:12,color:"#999"},children:w.type==="org"?"本组织全部部门成员":"本部门成员"}),w.type==="dept"&&s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:F,children:"添加成员"})]}),children:s.jsx(c.Table,{columns:Le,dataSource:v.map((ne,Q)=>({...ne,key:`${ne.userId}-${Q}`})),rowKey:"key",loading:E,pagination:!1,size:"small",locale:{emptyText:"该节点下暂无成员"}})}),w.type==="group"&&s.jsx(c.Card,{type:"inner",title:"节点成员",size:"small",style:{marginBottom:16},children:s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"组别层级暂未挂载成员(成员关系挂在部门维度)"})}),s.jsx(c.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsx(c.Button,{size:"small",type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{H(null),Z.resetFields(),G(!0)},children:"新增"}),children:s.jsx(c.Table,{columns:ve,dataSource:x.map((ne,Q)=>({...ne,key:ne.key||Q})),rowKey:"key",pagination:!1,size:"small",locale:{emptyText:"暂无扩展配置"}})})]}):s.jsx(c.Empty,{description:"请从左侧选择组织/部门/组"})})]}),s.jsx(c.Modal,{title:_?"编辑配置":"新增配置",open:B,onCancel:()=>{G(!1),H(null)},onOk:z,destroyOnHidden:!0,children:s.jsxs(c.Form,{form:Z,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!_})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4})})]})}),s.jsxs(c.Modal,{title:L?`新增${Kt[L].label}`:"新增",open:q,onCancel:()=>V(!1),onOk:ce,destroyOnHidden:!0,children:[s.jsxs("div",{style:{marginTop:12,padding:"8px 12px",background:"#f7f8fa",borderRadius:6,fontSize:12,color:"#666",display:"flex",flexWrap:"wrap",gap:16},children:[s.jsxs("span",{children:["租户:",ze.tenantCode||"-"]}),s.jsxs("span",{children:["域:",ze.domainCode||"-"]}),L==="dept"&&s.jsxs("span",{children:["所属组织:",ze.orgCode||"-"]}),L==="group"&&s.jsxs("span",{children:["所属部门:",ze.deptCode||"-"]})]}),s.jsxs(c.Form,{form:te,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:L==="org"?"orgCode":L==="dept"?"deptCode":"groupCode",label:"编码",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"唯一标识"})}),s.jsx(c.Form.Item,{name:L==="org"?"orgName":L==="dept"?"deptName":"groupName",label:"名称",rules:[{required:!0}],children:s.jsx(c.Input,{})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2})})]})]}),s.jsx(c.Modal,{title:`添加成员到「${w?Er(w.data):""}」`,open:D,onCancel:()=>{M(!1),O.resetFields()},onOk:A,okText:"挂载",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:O,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"userId",label:"账号",rules:[{required:!0,message:"请选择账号"}],children:s.jsx(c.Select,{showSearch:!0,optionFilterProp:"label",placeholder:"搜索 / 选择账号",options:U,notFoundContent:U.length===0?"账号列表为空":void 0})}),s.jsx(c.Form.Item,{name:"roleCode",label:"角色",initialValue:"member",children:s.jsx(c.Select,{allowClear:!0,placeholder:"默认 member",options:[{value:"member",label:"member(成员)"},{value:"admin",label:"admin(管理员)"}]})})]})})]})}let Xc="/api";function no(e){Xc=e||"/api"}function Vt(){return cn.createRequest({baseURL:Xc,timeout:15e3})}const sr={create:e=>Vt().post("/ctc/ac/tenants",e),getByCode:e=>Vt().get("/ctc/ac/tenants",{params:{tenantCode:e}}),updateStatus:(e,t)=>Vt().post("/ctc/ac/tenants/status",null,{params:{tenantCode:e,status:t}}),listAll:()=>Vt().get("/ctc/ac/tenants/list"),listAllForPlatform:()=>Vt().get("/ctc/ac/tenants/list-all")},Ht={listByTenant:e=>Vt().get("/ctc/ac/domains/list",{params:{tenantCode:e}}),listAll:()=>Vt().get("/ctc/ac/domains/list-all"),getById:e=>Vt().get("/ctc/ac/domains",{params:{id:e}}),create:e=>Vt().post("/ctc/ac/domains",e),update:(e,t)=>Vt().put("/ctc/ac/domains",t,{params:{id:e}}),delete:e=>Vt().delete("/ctc/ac/domains",{params:{id:e}})};function fi(e,t){const n=t==null?void 0:t.domainCode;return n?n==="default"||!!e&&n===`${e}-default`:!1}function mf(){let e="",t="";try{const n=JSON.parse(localStorage.getItem("userInfo")||"{}");e=String((n==null?void 0:n.tenantCode)??""),t=String((n==null?void 0:n.domainCode)??"")}catch{}try{const n=JSON.parse(localStorage.getItem("z_ctc_domain")||"null");n&&n.tenantCode&&n.tenantCode===e&&n.domainCode&&(t=String(n.domainCode))}catch{}return{tenantCode:e||null,domainCode:t||null}}function hf({apiBaseURL:e}){d.useEffect(()=>{e&&no(e)},[e]);const[{tenantCode:t,domainCode:n},r]=d.useState(mf);return d.useEffect(()=>{if(!t||n)return;let a=!1;return Ht.listByTenant(t).then(i=>{if(a||!Array.isArray(i)||i.length!==1)return;const o=i[0],l=String((o==null?void 0:o.domainCode)??"");if(!l)return;const u={tenantCode:t,domainCode:l,domainName:String((o==null?void 0:o.domainName)??l)};try{localStorage.setItem("z_ctc_domain",JSON.stringify(u))}catch{}r(m=>m.domainCode?m:{...m,domainCode:l})}).catch(()=>{}),()=>{a=!0}},[t,n]),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:s.jsx(Jc,{selectedTenant:t,selectedDomain:n,apiBaseURL:"/api"})})}function Jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ds={exports:{}},gf=Ds.exports,Mo;function Qc(){return Mo||(Mo=1,(function(e,t){(function(n,r){e.exports=r()})(gf,(function(){var n=1e3,r=6e4,a=36e5,i="millisecond",o="second",l="minute",u="hour",m="day",g="week",f="month",h="quarter",p="year",S="date",y="Invalid Date",w=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,x={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var I=["th","st","nd","rd"],F=O%100;return"["+O+(I[(F-20)%10]||I[F]||I[0])+"]"}},C=function(O,I,F){var A=String(O);return!A||A.length>=I?O:""+Array(I+1-A.length).join(F)+O},j={s:C,z:function(O){var I=-O.utcOffset(),F=Math.abs(I),A=Math.floor(F/60),k=F%60;return(I<=0?"+":"-")+C(A,2,"0")+":"+C(k,2,"0")},m:function O(I,F){if(I.date()<F.date())return-O(F,I);var A=12*(F.year()-I.year())+(F.month()-I.month()),k=I.clone().add(A,f),B=F-k<0,G=I.clone().add(A+(B?-1:1),f);return+(-(A+(F-k)/(B?k-G:G-k))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:f,y:p,w:g,d:m,D:S,h:u,m:l,s:o,ms:i,Q:h}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},b="en",v={};v[b]=x;var $="$isDayjsObject",E=function(O){return O instanceof U||!(!O||!O[$])},R=function O(I,F,A){var k;if(!I)return b;if(typeof I=="string"){var B=I.toLowerCase();v[B]&&(k=B),F&&(v[B]=F,k=B);var G=I.split("-");if(!k&&G.length>1)return O(G[0])}else{var _=I.name;v[_]=I,k=_}return!A&&k&&(b=k),k||!A&&b},D=function(O,I){if(E(O))return O.clone();var F=typeof I=="object"?I:{};return F.date=O,F.args=arguments,new U(F)},M=j;M.l=R,M.i=E,M.w=function(O,I){return D(O,{locale:I.$L,utc:I.$u,x:I.$x,$offset:I.$offset})};var U=(function(){function O(F){this.$L=R(F.locale,null,!0),this.parse(F),this.$x=this.$x||F.x||{},this[$]=!0}var I=O.prototype;return I.parse=function(F){this.$d=(function(A){var k=A.date,B=A.utc;if(k===null)return new Date(NaN);if(M.u(k))return new Date;if(k instanceof Date)return new Date(k);if(typeof k=="string"&&!/Z$/i.test(k)){var G=k.match(w);if(G){var _=G[2]-1||0,H=(G[7]||"0").substring(0,3);return B?new Date(Date.UTC(G[1],_,G[3]||1,G[4]||0,G[5]||0,G[6]||0,H)):new Date(G[1],_,G[3]||1,G[4]||0,G[5]||0,G[6]||0,H)}}return new Date(k)})(F),this.init()},I.init=function(){var F=this.$d;this.$y=F.getFullYear(),this.$M=F.getMonth(),this.$D=F.getDate(),this.$W=F.getDay(),this.$H=F.getHours(),this.$m=F.getMinutes(),this.$s=F.getSeconds(),this.$ms=F.getMilliseconds()},I.$utils=function(){return M},I.isValid=function(){return this.$d.toString()!==y},I.isSame=function(F,A){var k=D(F);return this.startOf(A)<=k&&k<=this.endOf(A)},I.isAfter=function(F,A){return D(F)<this.startOf(A)},I.isBefore=function(F,A){return this.endOf(A)<D(F)},I.$g=function(F,A,k){return M.u(F)?this[A]:this.set(k,F)},I.unix=function(){return Math.floor(this.valueOf()/1e3)},I.valueOf=function(){return this.$d.getTime()},I.startOf=function(F,A){var k=this,B=!!M.u(A)||A,G=M.p(F),_=function(W,te){var re=M.w(k.$u?Date.UTC(k.$y,te,W):new Date(k.$y,te,W),k);return B?re:re.endOf(m)},H=function(W,te){return M.w(k.toDate()[W].apply(k.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(te)),k)},Z=this.$W,q=this.$M,V=this.$D,L="set"+(this.$u?"UTC":"");switch(G){case p:return B?_(1,0):_(31,11);case f:return B?_(1,q):_(0,q+1);case g:var K=this.$locale().weekStart||0,P=(Z<K?Z+7:Z)-K;return _(B?V-P:V+(6-P),q);case m:case S:return H(L+"Hours",0);case u:return H(L+"Minutes",1);case l:return H(L+"Seconds",2);case o:return H(L+"Milliseconds",3);default:return this.clone()}},I.endOf=function(F){return this.startOf(F,!1)},I.$set=function(F,A){var k,B=M.p(F),G="set"+(this.$u?"UTC":""),_=(k={},k[m]=G+"Date",k[S]=G+"Date",k[f]=G+"Month",k[p]=G+"FullYear",k[u]=G+"Hours",k[l]=G+"Minutes",k[o]=G+"Seconds",k[i]=G+"Milliseconds",k)[B],H=B===m?this.$D+(A-this.$W):A;if(B===f||B===p){var Z=this.clone().set(S,1);Z.$d[_](H),Z.init(),this.$d=Z.set(S,Math.min(this.$D,Z.daysInMonth())).$d}else _&&this.$d[_](H);return this.init(),this},I.set=function(F,A){return this.clone().$set(F,A)},I.get=function(F){return this[M.p(F)]()},I.add=function(F,A){var k,B=this;F=Number(F);var G=M.p(A),_=function(q){var V=D(B);return M.w(V.date(V.date()+Math.round(q*F)),B)};if(G===f)return this.set(f,this.$M+F);if(G===p)return this.set(p,this.$y+F);if(G===m)return _(1);if(G===g)return _(7);var H=(k={},k[l]=r,k[u]=a,k[o]=n,k)[G]||1,Z=this.$d.getTime()+F*H;return M.w(Z,this)},I.subtract=function(F,A){return this.add(-1*F,A)},I.format=function(F){var A=this,k=this.$locale();if(!this.isValid())return k.invalidDate||y;var B=F||"YYYY-MM-DDTHH:mm:ssZ",G=M.z(this),_=this.$H,H=this.$m,Z=this.$M,q=k.weekdays,V=k.months,L=k.meridiem,K=function(te,re,X,se){return te&&(te[re]||te(A,B))||X[re].slice(0,se)},P=function(te){return M.s(_%12||12,te,"0")},W=L||function(te,re,X){var se=te<12?"AM":"PM";return X?se.toLowerCase():se};return B.replace(T,(function(te,re){return re||(function(X){switch(X){case"YY":return String(A.$y).slice(-2);case"YYYY":return M.s(A.$y,4,"0");case"M":return Z+1;case"MM":return M.s(Z+1,2,"0");case"MMM":return K(k.monthsShort,Z,V,3);case"MMMM":return K(V,Z);case"D":return A.$D;case"DD":return M.s(A.$D,2,"0");case"d":return String(A.$W);case"dd":return K(k.weekdaysMin,A.$W,q,2);case"ddd":return K(k.weekdaysShort,A.$W,q,3);case"dddd":return q[A.$W];case"H":return String(_);case"HH":return M.s(_,2,"0");case"h":return P(1);case"hh":return P(2);case"a":return W(_,H,!0);case"A":return W(_,H,!1);case"m":return String(H);case"mm":return M.s(H,2,"0");case"s":return String(A.$s);case"ss":return M.s(A.$s,2,"0");case"SSS":return M.s(A.$ms,3,"0");case"Z":return G}return null})(te)||G.replace(":","")}))},I.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},I.diff=function(F,A,k){var B,G=this,_=M.p(A),H=D(F),Z=(H.utcOffset()-this.utcOffset())*r,q=this-H,V=function(){return M.m(G,H)};switch(_){case p:B=V()/12;break;case f:B=V();break;case h:B=V()/3;break;case g:B=(q-Z)/6048e5;break;case m:B=(q-Z)/864e5;break;case u:B=q/a;break;case l:B=q/r;break;case o:B=q/n;break;default:B=q}return k?B:M.a(B)},I.daysInMonth=function(){return this.endOf(f).$D},I.$locale=function(){return v[this.$L]},I.locale=function(F,A){if(!F)return this.$L;var k=this.clone(),B=R(F,A,!0);return B&&(k.$L=B),k},I.clone=function(){return M.w(this.$d,this)},I.toDate=function(){return new Date(this.valueOf())},I.toJSON=function(){return this.isValid()?this.toISOString():null},I.toISOString=function(){return this.$d.toISOString()},I.toString=function(){return this.$d.toUTCString()},O})(),Y=U.prototype;return D.prototype=Y,[["$ms",i],["$s",o],["$m",l],["$H",u],["$W",m],["$M",f],["$y",p],["$D",S]].forEach((function(O){Y[O[1]]=function(I){return this.$g(I,O[0],O[1])}})),D.extend=function(O,I){return O.$i||(O(I,U,D),O.$i=!0),D},D.locale=R,D.isDayjs=E,D.unix=function(O){return D(1e3*O)},D.en=v[b],D.Ls=v,D.p={},D}))})(Ds)),Ds.exports}var pf=Qc();const Re=Jt(pf),gn={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}},Aa=(e,t,n)=>e==="tenant"?`tenant:${t}`:`domain:${t}:${n}`;function yf({apiBaseURL:e,platformView:t=!1}){var Te,Oe,Ae,ze;d.useEffect(()=>{e&&no(e)},[e]);const[n,r]=d.useState([]),[a,i]=d.useState(!1),[o,l]=d.useState({}),[u,m]=d.useState({}),[g,f]=d.useState([]),[h,p]=d.useState([]),[S,y]=d.useState([]),[w,T]=d.useState(null),[x,C]=d.useState([]),[j,b]=d.useState(!1),[v]=c.Form.useForm(),[$,E]=d.useState(!1),[R,D]=d.useState(null),[M]=c.Form.useForm(),[U,Y]=d.useState(!1),[O,I]=d.useState(null),[F]=c.Form.useForm(),[A,k]=d.useState(()=>{try{const ce=Number(localStorage.getItem("ctc_tenant_tree_width"));return Number.isFinite(ce)&&ce>=220&&ce<=640?ce:320}catch{return 320}}),B=d.useRef(A),G=ce=>{ce.preventDefault();const z=ce.clientX,J=B.current,le=Ee=>{const Fe=Math.min(640,Math.max(220,J+Ee.clientX-z));B.current=Fe,k(Fe)},Se=()=>{document.removeEventListener("mousemove",le),document.removeEventListener("mouseup",Se),document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem("ctc_tenant_tree_width",String(B.current))}catch{}};document.addEventListener("mousemove",le),document.addEventListener("mouseup",Se),document.body.style.cursor="col-resize",document.body.style.userSelect="none"},_=d.useCallback(async()=>{i(!0);try{const ce=t?await sr.listAllForPlatform():await sr.listAll();r(Array.isArray(ce)?ce:[])}catch(ce){c.message.error((t?"获取全平台租户失败(系统租户面板仅平台管理员可访问):":"获取租户列表失败:")+((ce==null?void 0:ce.message)||"未知错误")),r([])}finally{i(!1)}},[t]);d.useEffect(()=>{_()},[_]);const H=d.useCallback(async ce=>{const z=await Promise.all(ce.map(async J=>{try{const le=await Ht.listByTenant(J.tenantCode);return[J.tenantCode,Array.isArray(le)?le:[]]}catch{return[J.tenantCode,[]]}}));l(Object.fromEntries(z))},[]);d.useEffect(()=>{n.length>0&&H(n)},[n,H]),d.useEffect(()=>{const ce=n.map(z=>{var J,le;return{key:Aa("tenant",z.tenantCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:z.tenantName||z.tenantCode}),s.jsx(c.Tag,{color:(J=gn[z.status??1])==null?void 0:J.color,style:{margin:0,fontSize:10,flexShrink:0},children:(le=gn[z.status??1])==null?void 0:le.text})]}),rawTitle:`${z.tenantName||z.tenantCode} (${z.tenantCode})`,data:{type:"tenant",data:z},children:(Array.isArray(o[z.tenantCode])?o[z.tenantCode]:[]).map(Se=>{var Ee,Fe;return{key:Aa("domain",z.tenantCode,Se.domainCode),title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,minWidth:0,maxWidth:"100%"},children:[s.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Se.domainName}),s.jsx(c.Tag,{color:(Ee=gn[Se.status])==null?void 0:Ee.color,style:{margin:0,fontSize:10,flexShrink:0},children:(Fe=gn[Se.status])==null?void 0:Fe.text})]}),rawTitle:`${Se.domainName} (${Se.domainCode})`,data:{type:"domain",data:Se},isLeaf:!0}})}});f(ce),y(z=>z.length>0?z:ce.map(J=>J.key))},[n,o]);const Z=async(ce,z)=>{if(fi(ce,z)){c.message.warning("默认域受保护,不可删除");return}if(z.id==null){c.message.error("域 ID 缺失");return}try{await Ht.delete(z.id),c.message.success("删除成功");const J=await Ht.listByTenant(ce);l(le=>({...le,[ce]:Array.isArray(J)?J:[]}))}catch(J){c.message.error("删除失败:"+((J==null?void 0:J.message)||"未知错误"))}},q=async()=>{try{const ce=await v.validateFields();await sr.create({...ce,status:1}),c.message.success("创建成功"),b(!1),v.resetFields(),await _()}catch(ce){if(ce!=null&&ce.errorFields)return;c.message.error("创建失败:"+((ce==null?void 0:ce.message)||"未知错误"))}},V=async(ce,z)=>{const J=z===1?0:1;try{await sr.updateStatus(ce,J),c.message.success(J===1?"已启用":"已停用"),await _()}catch(le){c.message.error("操作失败:"+((le==null?void 0:le.message)||"未知错误"))}},L=ce=>{D(ce),M.resetFields(),M.setFieldsValue({status:1}),E(!0)},K=async()=>{if(R)try{const ce=await M.validateFields(),z=R.tenantCode;await Ht.create({domainCode:ce.domainCode,domainName:ce.domainName,tenantCode:z,status:ce.status??1}),c.message.success(`已为租户「${R.tenantName||z}」新增域「${ce.domainName}」`),E(!1),M.resetFields();const J=await Ht.listByTenant(z),le=Array.isArray(J)?J:[];l(Ee=>({...Ee,[z]:le}));const Se=Aa("tenant",z);y(Ee=>Ee.includes(Se)?Ee:[...Ee,Se])}catch(ce){if(ce!=null&&ce.errorFields)return;c.message.error("新增域失败:"+((ce==null?void 0:ce.message)||"未知错误"))}},P=(ce,z)=>{if(ce.length===0)return;const J=ce[0];p([J]);const le=z.node.data;T(le),C(u[J]||[])},W=async()=>{if(h[0])try{const ce=await F.validateFields();let z;if(O)z=x.map(J=>J.key===O.key?{key:ce.dataId,value:ce.content}:J);else{if(x.some(J=>J.key===ce.dataId)){c.message.error("Key 已存在");return}z=[...x,{key:ce.dataId,value:ce.content}]}m(J=>({...J,[h[0]]:z})),C(z),c.message.success(O?"更新成功":"创建成功"),Y(!1),I(null),F.resetFields()}catch(ce){if(ce!=null&&ce.errorFields)return;c.message.error("保存失败")}},te=ce=>{const z=x.filter(J=>J.key!==ce.key);m(J=>({...J,[h[0]]:z})),C(z),c.message.success("删除成功")},re=(w==null?void 0:w.type)==="tenant"?w.data:null,X=(w==null?void 0:w.type)==="domain"?w.data:null,se=X?n.find(ce=>ce.tenantCode===X.tenantCode):null,[ae,ue]=d.useState(""),pe=d.useMemo(()=>x.map((ce,z)=>({...ce,_idx:z})),[x]),me=d.useMemo(()=>{const ce=ae.trim().toLowerCase();return ce?pe.filter(z=>`${z.key||""} ${z.value||""}`.toLowerCase().includes(ce)):pe},[pe,ae]),fe=[{title:"Key",dataIndex:"key",key:"key",width:200},{title:"Value",dataIndex:"value",key:"value",ellipsis:!0},{title:"操作",key:"action",width:120,render:(ce,z)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>{I(z),F.setFieldsValue({dataId:z.key,content:z.value}),Y(!0)},children:"编辑"}),s.jsx(c.Popconfirm,{title:"确认删除该配置?",onConfirm:()=>te(z),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})]})}],ye=ce=>{const z=ce.data;if(z.type==="tenant"){const Se=z.data;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:ce.title}),s.jsx(c.Tooltip,{title:"新增域",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{style:{fontSize:11}}),onClick:Ee=>{Ee.stopPropagation(),L(Se)}})})]})}const J=z.data,le=J.tenantCode;return s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:[s.jsx("span",{style:{flex:1},children:ce.title}),s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:Se=>{Se==null||Se.stopPropagation(),Z(le,J)},onCancel:Se=>Se==null?void 0:Se.stopPropagation(),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{size:"small",type:"text",danger:!0,icon:s.jsx(de.DeleteOutlined,{style:{fontSize:11}}),onClick:Se=>Se.stopPropagation()})})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs("div",{style:{display:"flex",gap:0,height:"calc(100vh - 140px)"},children:[s.jsx(c.Card,{title:"租户 / 域",size:"small",style:{width:A,minWidth:A,flexShrink:0},styles:{body:{padding:8,overflow:"auto",height:"calc(100% - 40px)"}},extra:s.jsxs(c.Space,{size:4,children:[s.jsx(c.Tooltip,{title:"新增租户",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{v.resetFields(),b(!0)}})}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.ReloadOutlined,{}),onClick:_})})]}),children:g.length>0?s.jsx(c.Tree,{treeData:g,selectedKeys:h,onSelect:P,titleRender:ye,expandedKeys:S,onExpand:y,defaultExpandAll:!0,showLine:!0,className:"ctc-tenant-tree",blockNode:!0}):s.jsx(c.Empty,{description:a?"加载中...":'暂无租户,点击右上"新增租户"图标创建'})}),s.jsx("div",{onMouseDown:G,title:"拖动调整宽度",style:{width:5,flexShrink:0,cursor:"col-resize",borderRadius:2,background:"#eef0f3"}}),s.jsx(c.Card,{size:"small",style:{flex:1,overflow:"auto"},styles:{body:{padding:16}},children:w?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions,{title:re?"租户信息":"域信息",size:"small",bordered:!0,column:2,style:{marginBottom:16},children:re?s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:re.tenantCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:re.tenantName}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:re.description||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Popconfirm,{title:`确认${re.status===1?"停用":"启用"}该租户?`,onConfirm:()=>V(re.tenantCode,re.status??1),children:s.jsxs(c.Button,{size:"small",type:"link",danger:re.status===1,children:[s.jsx(c.Tag,{color:(Te=gn[re.status??1])==null?void 0:Te.color,children:(Oe=gn[re.status??1])==null?void 0:Oe.text}),s.jsx("span",{style:{marginLeft:4,fontSize:12},children:"点击切换"})]})})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:re.createdAt||"-"})]}):s.jsxs(s.Fragment,{children:[s.jsx(c.Descriptions.Item,{label:"编码",children:X.domainCode}),s.jsx(c.Descriptions.Item,{label:"名称",children:X.domainName}),s.jsx(c.Descriptions.Item,{label:"所属租户",children:(se==null?void 0:se.tenantName)||X.tenantCode}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(Ae=gn[X.status])==null?void 0:Ae.color,children:(ze=gn[X.status])==null?void 0:ze.text})})]})}),s.jsx(c.Card,{type:"inner",title:"扩展配置 (K-V)",size:"small",extra:s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按 Key / Value 过滤",style:{width:220},onChange:ce=>ue(ce.target.value)}),s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{I(null),F.resetFields(),Y(!0)},children:"新增"})]}),children:s.jsx(c.Table,{columns:fe,dataSource:me,rowKey:ce=>`${ce.key}_${ce._idx}`,pagination:!1,size:"small",locale:{emptyText:'暂无扩展配置,点击右上"新增"添加'}})})]}):s.jsx(c.Empty,{description:"请从左侧选择租户或域",style:{marginTop:80}})})]}),s.jsx(c.Modal,{title:"新建租户",open:j,onOk:q,onCancel:()=>b(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:v,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"tenantCode",label:"租户编码",rules:[{required:!0,message:"请输入租户编码"},{pattern:/^[a-z0-9_]+$/,message:"仅允许小写字母数字下划线"}],extra:"唯一标识,创建后不可修改",children:s.jsx(c.Input,{placeholder:"如 default / tenant_a"})}),s.jsx(c.Form.Item,{name:"tenantName",label:"租户名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 默认租户"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:3,placeholder:"可选"})})]})}),s.jsx(c.Modal,{title:O?"编辑配置":"新增配置",open:U,onOk:W,onCancel:()=>{Y(!1),I(null)},destroyOnHidden:!0,children:s.jsxs(c.Form,{form:F,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dataId",label:"Key",rules:[{required:!0}],children:s.jsx(c.Input,{disabled:!!O,placeholder:"如 max_users"})}),s.jsx(c.Form.Item,{name:"content",label:"Value",rules:[{required:!0}],children:s.jsx(c.Input.TextArea,{rows:4,placeholder:"配置值"})})]})}),s.jsx(c.Modal,{title:R?`为「${R.tenantName||R.tenantCode}」新增域`:"新增域",open:$,onOk:K,onCancel:()=>{E(!1),M.resetFields()},size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:M,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{label:"所属租户",children:s.jsx(c.Input,{value:(R==null?void 0:R.tenantName)||"",disabled:!0})}),s.jsx(c.Form.Item,{name:"domainCode",label:"域编码",rules:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(c.Input,{placeholder:"如 prod / staging"})}),s.jsx(c.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(c.Input,{placeholder:"如 生产环境"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsxs("select",{style:{width:"100%",padding:"4px 8px",border:"1px solid #d9d9d9",borderRadius:4},children:[s.jsx("option",{value:1,children:"正常"}),s.jsx("option",{value:0,children:"停用"})]})})]})})]})}const ka={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function xf({apiBaseURL:e}){d.useEffect(()=>{e&&no(e)},[e]);const[t,n]=d.useState([]),[r,a]=d.useState(""),[i,o]=d.useState(!1),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),w=d.useCallback(async()=>{o(!0);try{const E=await sr.listAll(),R=Array.isArray(E)?E:[];n(R),a(D=>{var M;return R.some(U=>U.tenantCode===D)?D:((M=R[0])==null?void 0:M.tenantCode)||""})}catch(E){c.message.error("获取我的租户失败:"+((E==null?void 0:E.message)||"未知错误")),n([]),a("")}finally{o(!1)}},[]),T=d.useCallback(async E=>{if(!E){u([]);return}g(!0);try{const R=await Ht.listByTenant(E);u(Array.isArray(R)?R:[])}catch(R){c.message.error("获取域列表失败:"+((R==null?void 0:R.message)||"未知错误")),u([])}finally{g(!1)}},[]);d.useEffect(()=>{w()},[w]),d.useEffect(()=>{T(r)},[r,T]);const x=d.useMemo(()=>t.find(E=>E.tenantCode===r)||null,[t,r]),C=()=>{S(null),y.resetFields(),y.setFieldsValue({status:1}),h(!0)},j=E=>{S(E),y.resetFields(),y.setFieldsValue({domainCode:E.domainCode,domainName:E.domainName,description:E.description,status:E.status??1}),h(!0)},b=async()=>{if(r)try{const E=await y.validateFields();p?(await Ht.update(p.id,{domainName:E.domainName,description:E.description||"",status:E.status??1}),c.message.success("已保存")):(await Ht.create({domainCode:E.domainCode,domainName:E.domainName,description:E.description||"",tenantCode:r,status:E.status??1}),c.message.success(`已新增域「${E.domainName}」`)),h(!1),S(null),y.resetFields(),await T(r)}catch(E){if(E!=null&&E.errorFields)return;c.message.error("保存失败:"+((E==null?void 0:E.message)||"未知错误"))}},v=async E=>{if(fi(r,E)){c.message.warning("默认域受保护,不可删除");return}try{await Ht.delete(E.id),c.message.success("已删除"),await T(r)}catch(R){c.message.error("删除失败:"+((R==null?void 0:R.message)||"未知错误"))}},$=[{title:"域编码",dataIndex:"domainCode",key:"domainCode",width:220},{title:"域名称",dataIndex:"domainName",key:"domainName",width:200},{title:"状态",dataIndex:"status",key:"status",width:100,render:E=>{const R=ka[E]||{text:String(E??"-"),color:"default"};return s.jsx(c.Tag,{color:R.color,children:R.text})}},{title:"描述",dataIndex:"description",key:"description",ellipsis:!0},{title:"创建时间",dataIndex:"createdAt",key:"createdAt",width:180},{title:"操作",key:"action",width:150,render:(E,R)=>s.jsxs(c.Space,{size:0,children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>j(R),children:"编辑"}),fi(r,R)?s.jsx(c.Tooltip,{title:"默认域受保护,不可删除",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,disabled:!0,children:"删除"})}):s.jsx(c.Popconfirm,{title:"确定删除该域?",description:"删除后不可恢复",onConfirm:()=>v(R),okText:"确定",cancelText:"取消",children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return!i&&t.length===0?s.jsx(c.Card,{size:"small",children:s.jsx(c.Empty,{description:"当前账号还未加入任何租户"})}):s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsx(c.Card,{size:"small",title:"我的租户",extra:s.jsxs(c.Space,{size:8,children:[t.length>1&&s.jsx(c.Select,{size:"small",style:{minWidth:200},value:r||void 0,onChange:a,options:t.map(E=>({value:E.tenantCode,label:`${E.tenantName||E.tenantCode} (${E.tenantCode})`}))}),s.jsx(c.Tooltip,{title:"刷新",children:s.jsx(c.Button,{size:"small",type:"text",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{w(),T(r)}})})]}),children:x?s.jsxs(c.Descriptions,{size:"small",bordered:!0,column:{xs:1,sm:2,md:2,lg:4},children:[s.jsx(c.Descriptions.Item,{label:"租户编码",children:x.tenantCode}),s.jsx(c.Descriptions.Item,{label:"租户名称",children:x.tenantName||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(ka[x.status??1]||{}).color,children:(ka[x.status??1]||{text:"-"}).text})}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:x.createdAt||"-"})]}):s.jsx(c.Empty,{description:i?"加载中...":"暂无租户"})}),s.jsx(c.Card,{size:"small",title:"域",extra:s.jsx(c.Space,{size:4,children:s.jsx(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),disabled:!r,onClick:C,children:"新增域"})}),children:s.jsx(c.Table,{columns:$,dataSource:l,rowKey:E=>E.id??E.domainCode,loading:m,size:"small",scroll:{x:880},pagination:{pageSize:10,showSizeChanger:!1,hideOnSinglePage:!0},locale:{emptyText:"该租户下暂无域,点击右上「新增域」创建"}})}),s.jsx(c.Modal,{title:p?`编辑域「${p.domainName}」`:`为「${(x==null?void 0:x.tenantName)||r}」新增域`,open:f,onOk:b,onCancel:()=>{h(!1),S(null),y.resetFields()},destroyOnHidden:!0,children:s.jsxs(c.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"domainCode",label:"域编码",rules:p?[]:[{required:!0,message:"请输入域编码"},{pattern:/^[a-z0-9_-]+$/,message:"仅允许小写字母、数字、下划线、短横线"}],extra:p?"编码创建后不可修改":"租户内唯一,建议形如 prod / staging / dev",children:s.jsx(c.Input,{placeholder:"如 prod / staging",disabled:!!p})}),s.jsx(c.Form.Item,{name:"domainName",label:"域名称",rules:[{required:!0,message:"请输入域名称"}],children:s.jsx(c.Input,{placeholder:"如 生产环境"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:3,placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"正常"},{value:0,label:"停用"}]})})]})})]})}const eu=e=>{const t=be.useRef(e);return t.current=e,be.useCallback((...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])};function Xr(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}const Ao=process.env.NODE_ENV!=="test"&&Xr()?be.useLayoutEffect:be.useEffect,bf=(e,t)=>{const n=be.useRef(!0);Ao(()=>e(n.current),t),Ao(()=>(n.current=!1,()=>{n.current=!0}),[])};function dt(e,t){const[n,r]=d.useState(e),a=t!==void 0?t:n;return bf(i=>{i||r(t)},[t]),[a,r]}let tu=e=>+setTimeout(e,16),nu=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(tu=e=>window.requestAnimationFrame(e),nu=e=>window.cancelAnimationFrame(e));let ko=0;const fa=new Map;function ru(e){fa.delete(e)}const ro=(e,t=1)=>{ko+=1;const n=ko;function r(a){if(a===0)ru(n),e();else{const i=tu(()=>{r(a-1)});fa.set(n,i)}}return r(t),n};ro.cancel=e=>{const t=fa.get(e);return ru(e),nu(t)};process.env.NODE_ENV!=="production"&&(ro.ids=()=>fa);function Sf(e,t,n){const r=be.useRef({});return(!("value"in r.current)||n(r.current.condition,t))&&(r.current.value=e(),r.current.condition=t),r.current.value}var ms={exports:{}},We={};/**
2
2
  * @license React
3
3
  * react-is.production.js
4
4
  *
@@ -14,9 +14,9 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Do;function wf(){return Do||(Do=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(typeof y=="object"&&y!==null){var w=y.$$typeof;switch(w){case t:switch(y=y.type,y){case r:case i:case a:case m:case g:case p:return y;default:switch(y=y&&y.$$typeof,y){case l:case u:case h:case f:return y;case o:return y;default:return w}}case n:return w}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),S=Symbol.for("react.client.reference");qe.ContextConsumer=o,qe.ContextProvider=l,qe.Element=t,qe.ForwardRef=u,qe.Fragment=r,qe.Lazy=h,qe.Memo=f,qe.Portal=n,qe.Profiler=i,qe.StrictMode=a,qe.Suspense=m,qe.SuspenseList=g,qe.isContextConsumer=function(y){return e(y)===o},qe.isContextProvider=function(y){return e(y)===l},qe.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},qe.isForwardRef=function(y){return e(y)===u},qe.isFragment=function(y){return e(y)===r},qe.isLazy=function(y){return e(y)===h},qe.isMemo=function(y){return e(y)===f},qe.isPortal=function(y){return e(y)===n},qe.isProfiler=function(y){return e(y)===i},qe.isStrictMode=function(y){return e(y)===a},qe.isSuspense=function(y){return e(y)===m},qe.isSuspenseList=function(y){return e(y)===g},qe.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===i||y===a||y===m||y===g||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===l||y.$$typeof===o||y.$$typeof===u||y.$$typeof===S||y.getModuleId!==void 0)},qe.typeOf=e})()),qe}var Po;function jf(){return Po||(Po=1,process.env.NODE_ENV==="production"?ms.exports=Cf():ms.exports=wf()),ms.exports}var Oa=jf();const vf=Symbol.for("react.element"),Tf=Symbol.for("react.transitional.element"),Ff=Symbol.for("react.fragment");function su(e){return e&&typeof e=="object"&&(e.$$typeof===vf||e.$$typeof===Tf)&&e.type===Ff}var Wc;const $f=Number((Wc=d.version)==null?void 0:Wc.split(".")[0]),Ef=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},Rf=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{Ef(r,n)})}},If=(...e)=>Sf(()=>Rf(...e),e,(t,n)=>t.length!==n.length||t.every((r,a)=>r!==n[a])),Mf=e=>{var n,r;if(!e)return!1;if(au(e)&&$f>=19)return!0;const t=Oa.isMemo(e)?e.type.type:e.type;return!(typeof t=="function"&&!((n=t.prototype)!=null&&n.render)&&t.$$typeof!==Oa.ForwardRef||typeof e=="function"&&!((r=e.prototype)!=null&&r.render)&&e.$$typeof!==Oa.ForwardRef)};function au(e){return d.isValidElement(e)&&!su(e)}const Af=e=>{if(e&&au(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function kf(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const No="data-rc-order",Lo="data-rc-priority",Of="rc-util-key",mi=new Map;function iu({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Of}function ma(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Df(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function so(e){return e?Array.from((mi.get(e)||e).children).filter(t=>t.tagName==="STYLE"):[]}function ou(e,t={}){if(!Xr())return null;const{csp:n,prepend:r,priority:a=0}=t,i=Df(r),o=i==="prependQueue",l=document.createElement("style");l.setAttribute(No,i),o&&a&&l.setAttribute(Lo,`${a}`),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;const u=ma(t);if(!u)return null;const{firstChild:m}=u;if(r){if(o){const g=(t.styles||so(u)).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(No)))return!1;const h=Number(f.getAttribute(Lo)||0);return a>=h});if(g.length)return u.insertBefore(l,g[g.length-1].nextSibling),l}u.insertBefore(l,m)}else u.appendChild(l);return l}function lu(e,t={}){let{styles:n}=t;return n||(n=so(ma(t))),n.find(r=>r.getAttribute(iu(t))===e)}function Pf(e,t={}){const n=lu(e,t);if(n){const r=ma(t);r==null||r.removeChild(n)}}function Nf(e,t){const n=mi.get(e);if(!n||!kf(document,n)){const r=ou("",t);if(!r)return;const{parentNode:a}=r;mi.set(e,a),e.removeChild(r)}}function Ps(e,t,n={}){var u,m,g;const r=ma(n);if(!r)return null;const a=so(r),i={...n,styles:a};Nf(r,i);const o=lu(t,i);if(o)return(u=i.csp)!=null&&u.nonce&&o.nonce!==((m=i.csp)==null?void 0:m.nonce)&&(o.nonce=(g=i.csp)==null?void 0:g.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;const l=ou(e,i);return l?(l.setAttribute(iu(i),t),l):null}function _o(e){return e instanceof HTMLElement||e instanceof SVGElement}function Lf(e){return e&&typeof e=="object"&&_o(e.nativeElement)?e.nativeElement:_o(e)?e:null}let hi={};const ao=[],_f=e=>{ao.push(e)};function Js(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=ao.reduce((r,a)=>a(r??"","warning"),t);n&&console.error(`Warning: ${n}`)}}function zf(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=ao.reduce((r,a)=>a(r??"","note"),t);n&&console.warn(`Note: ${n}`)}}function Bf(){hi={}}function cu(e,t,n){!t&&!hi[n]&&(e(!1,n),hi[n]=!0)}function st(e,t){cu(Js,e,t)}function Vf(e,t){cu(zf,e,t)}st.preMessage=_f;st.resetWarned=Bf;st.noteOnce=Vf;function zo(e,t,n=!1){const r=new Set;function a(i,o,l=1){const u=r.has(i);if(st(!u,"Warning: There may be circular references"),u)return!1;if(i===o)return!0;if(n&&l>1)return!1;r.add(i);const m=l+1;if(Array.isArray(i)){if(!Array.isArray(o)||i.length!==o.length)return!1;for(let g=0;g<i.length;g++)if(!a(i[g],o[g],m))return!1;return!0}if(i&&o&&typeof i=="object"&&typeof o=="object"){const g=Object.keys(i);return g.length!==Object.keys(o).length?!1:g.every(f=>a(i[f],o[f],m))}return!1}return a(e,t)}var Rr={exports:{}},Bo;function Hf(){if(Bo)return Rr.exports;Bo=1,Rr.exports=r,Rr.exports.isMobile=r,Rr.exports.default=r;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,t=/CrOS/,n=/android|ipad|playbook|silk/i;function r(a){a||(a={});let i=a.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let o=e.test(i)&&!t.test(i)||!!a.tablet&&n.test(i);return!o&&a.tablet&&a.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(o=!0),o}return Rr.exports}Hf();function Ze(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function Tn(e,t={}){let n=[];return d.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Tn(r)):su(r)&&r.props?n=n.concat(Tn(r.props.children,t)):n.push(r))}),n}function Be(e,t){let n=e;for(let r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function uu(e,t,n,r){if(!t.length)return n;const[a,...i]=t;let o;if(!e&&typeof a=="number"?o=[]:Array.isArray(e)?o=[...e]:o={...e},r&&n===void 0&&i.length===1){const l=o[a];if(l&&typeof l=="object"){const u=Array.isArray(l)?[...l]:{...l};delete u[i[0]],o[a]=u}}else o[a]=uu(o[a],i,n,r);return o}function Qe(e,t,n,r=!1){return t.length&&r&&n===void 0&&!Be(e,t.slice(0,-1))?e:uu(e,t,n,r)}function Yf(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Vo(e){return Array.isArray(e)?[]:{}}const Uf=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Kf(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let a=Vo(e[0]);return e.forEach(i=>{function o(l,u){const m=new Set(u),g=Be(i,l),f=Array.isArray(g);if(f||Yf(g)){if(!m.has(g)){m.add(g);const h=Be(a,l);f?a=Qe(a,l,r(h,g)):(!h||typeof h!="object")&&(a=Qe(a,l,Vo(g))),Uf(g).forEach(p=>{Object.getOwnPropertyDescriptor(g,p).enumerable&&o([...l,p],m)})}}else a=Qe(a,l,g)}o([])}),a}function ar(...e){return Kf(e)}function du(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=du(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ie(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=du(e))&&(r&&(r+=" "),r+=t);return r}function Ur(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}const Wf="%";function gi(e){return e.join(Wf)}let Ho=0;class qf{constructor(t){oe(this,"instanceId");oe(this,"cache",new Map);oe(this,"updateTimes",new Map);oe(this,"extracted",new Set);this.instanceId=t}get(t){return this.opGet(gi(t))}opGet(t){return this.cache.get(t)||null}update(t,n){return this.opUpdate(gi(t),n)}opUpdate(t,n){const r=this.cache.get(t),a=n(r);a===null?(this.cache.delete(t),this.updateTimes.delete(t)):(this.cache.set(t,a),this.updateTimes.set(t,Ho),Ho+=1)}}const fu="data-token-hash",Nn="data-css-hash",Gf="data-cache-path",bn="__cssinjs_instance__";function Zf(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${Nn}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(a=>{a[bn]||(a[bn]=e),a[bn]===e&&document.head.insertBefore(a,n)});const r={};Array.from(document.querySelectorAll(`style[${Nn}]`)).forEach(a=>{var o;const i=a.getAttribute(Nn);r[i]?a[bn]===e&&((o=a.parentNode)==null||o.removeChild(a)):r[i]=!0})}return new qf(e)}const io=be.createContext({hashPriority:"low",cache:Zf(),defaultCache:!0,autoPrefix:!1});let Yo=0;class Jf{constructor(t){oe(this,"derivatives");oe(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=Yo,t.length===0&&Js(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Yo+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const Xf=new WeakMap,Da={};function Qf(e,t){let n=Xf;for(let r=0;r<t.length;r+=1){const a=t[r];n.has(a)||n.set(a,new WeakMap),n=n.get(a)}return n.has(Da)||n.set(Da,e()),n.get(Da)}const Uo=new WeakMap;function _r(e){let t=Uo.get(e)||"";return t||(Object.keys(e).forEach(n=>{const r=e[n];t+=n,r instanceof Jf?t+=r.id:r&&typeof r=="object"?t+=_r(r):t+=r}),t=Ur(t),Uo.set(e,t)),t}function em(e,t){return Ur(`${t}_${_r(e)}`)}const Ko=Xr();function mu(e){const{hashCls:t,hashPriority:n="low"}=e||{};if(!t)return"";const r=`.${t}`;return n==="low"?`:where(${r})`:r}const tm=e=>e!=null;function hu(e,t){const n=typeof t=="function"?t():t;return n?{...e,csp:{...e.csp,nonce:n}}:e}const nm=(e,t="")=>`--${t?`${t}-`:""}${e}`.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase(),rm=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",scope:i}=n||{};if(!Object.keys(e).length)return"";const o=`${mu({hashCls:r,hashPriority:a})}.${t}`,l=[i].flat().filter(Boolean);return`${l.length?l.map(m=>`${o}.${m}`).join(", "):o}{${Object.entries(e).map(([m,g])=>`${m}:${g};`).join("")}}`},sm=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",prefix:i,unitless:o,ignore:l,preserve:u}=n||{},m={},g={};return Object.entries(e).forEach(([f,h])=>{if(u!=null&&u[f])g[f]=h;else if((typeof h=="string"||typeof h=="number")&&!(l!=null&&l[f])){const p=nm(f,i);m[p]=typeof h=="number"&&!(o!=null&&o[f])?`${h}px`:String(h),g[f]=`var(${p})`}}),[g,rm(m,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:a})]};function am(){return!1}let pi=!1;function im(){return pi}const om=process.env.NODE_ENV==="production"?am:im;if(process.env.NODE_ENV!=="production"&&typeof module<"u"&&module&&module.hot&&typeof window<"u"){const e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null;if(e&&typeof e.webpackHotUpdate=="function"){const t=e.webpackHotUpdate;e.webpackHotUpdate=(...n)=>(pi=!0,setTimeout(()=>{pi=!1},0),t(...n))}}const hs=new Map;function gu(e,t,n,r,a){const{cache:i}=be.useContext(io),o=[e,...t],l=gi(o),u=om(),m=h=>{i.opUpdate(l,p=>{const[S=0,y]=p||[void 0,void 0];let w=y;process.env.NODE_ENV!=="production"&&y&&u&&(r==null||r(w,u),w=null);const v=w||n(),x=[S,v];return h?h(x):x})};be.useMemo(()=>{m()},[l]);let g=i.opGet(l);process.env.NODE_ENV!=="production"&&!g&&(m(),g=i.opGet(l));const f=g[1];return d.useInsertionEffect(()=>(m(([h,p])=>[h+1,p]),hs.has(l)||(a==null||a(f),hs.set(l,!0),Promise.resolve().then(()=>{hs.delete(l)})),()=>{i.opUpdate(l,h=>{const[p=0,S]=h||[];return p-1===0?(r==null||r(S,!1),hs.delete(l),null):[p-1,S]})}),[l]),f}const lm={},cm=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",kn=new Map;function um(e){kn.set(e,(kn.get(e)||0)+1)}function dm(e,t){typeof document<"u"&&document.querySelectorAll(`style[${fu}="${e}"]`).forEach(r=>{var a;r[bn]===t&&((a=r.parentNode)==null||a.removeChild(r))})}const fm=-1;function mm(e,t){kn.set(e,(kn.get(e)||0)-1);const n=new Set;kn.forEach((r,a)=>{r<=0&&n.add(a)}),kn.size-n.size>fm&&n.forEach(r=>{dm(r,t),kn.delete(r)})}const hm=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},gm="token";function pm(e,t,n){const{cache:{instanceId:r},container:a,hashPriority:i}=d.useContext(io),{salt:o="",override:l=lm,formatToken:u,getComputedToken:m,cssVar:g,nonce:f}=n,h=Qf(()=>Object.assign({},...t),t),p=_r(h),S=_r(l),y=_r(g);return gu(gm,[o,e.id,p,S,y],()=>{const v=m?m(h,l,e):hm(h,l,e,u),x={...v},C=`${o}_${g.prefix}`,j=Ur(C),b=`${cm}-${j}`;x._tokenKey=em(x,C);const[T,$]=sm(v,g.key,{prefix:g.prefix,ignore:g.ignore,unitless:g.unitless,preserve:g.preserve,hashPriority:i,hashCls:g.hashed?b:void 0});return T._hashId=j,um(g.key),[T,b,x,$,g.key]},([,,,,v])=>{mm(v,r)},([,,,v,x])=>{if(!v)return;let C={mark:Nn,prepend:"queue",attachTo:a,priority:-999};C=hu(C,f);const j=Ps(v,Ur(`css-var-${x}`),C);j[bn]=r,j.setAttribute(fu,x)})}var ym={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},at="-ms-",zr="-moz-",He="-webkit-",pu="comm",oo="rule",lo="decl",xm="@import",bm="@namespace",yu="@keyframes",Sm="@layer",Cm=Math.abs,Br=String.fromCharCode,yi=Object.assign;function wm(e,t){return gt(e,0)^45?(((t<<2^gt(e,0))<<2^gt(e,1))<<2^gt(e,2))<<2^gt(e,3):0}function xu(e){return e.trim()}function rn(e,t){return(e=t.exec(e))?e[0]:e}function Pe(e,t,n){return e.replace(t,n)}function Pa(e,t){return e.indexOf(t)}function gt(e,t){return e.charCodeAt(t)|0}function _n(e,t,n){return e.slice(t,n)}function Bt(e){return e.length}function bu(e){return e.length}function Dr(e,t){return t.push(e),e}function jm(e,t){return e.map(t).join("")}function Wo(e,t){return e.filter(function(n){return!rn(n,t)})}var ha=1,dr=1,Su=0,Nt=0,mt=0,yr="";function ga(e,t,n,r,a,i,o,l){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:ha,column:dr,length:o,return:"",siblings:l}}function yn(e,t){return yi(ga("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Qn(e){for(;e.root;)e=yn(e.root,{children:[e]});Dr(e,e.siblings)}function vm(){return mt}function Tm(){return mt=Nt>0?gt(yr,--Nt):0,dr--,mt===10&&(dr=1,ha--),mt}function Ut(){return mt=Nt<Su?gt(yr,Nt++):0,dr++,mt===10&&(dr=1,ha++),mt}function Sn(){return gt(yr,Nt)}function Ns(){return Nt}function pa(e,t){return _n(yr,e,t)}function Kr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Fm(e){return ha=dr=1,Su=Bt(yr=e),Nt=0,[]}function $m(e){return yr="",e}function Na(e){return xu(pa(Nt-1,xi(e===91?e+2:e===40?e+1:e)))}function Em(e){for(;(mt=Sn())&&mt<33;)Ut();return Kr(e)>2||Kr(mt)>3?"":" "}function Rm(e,t){for(;--t&&Ut()&&!(mt<48||mt>102||mt>57&&mt<65||mt>70&&mt<97););return pa(e,Ns()+(t<6&&Sn()==32&&Ut()==32))}function xi(e){for(;Ut();)switch(mt){case e:return Nt;case 34:case 39:e!==34&&e!==39&&xi(mt);break;case 40:e===41&&xi(e);break;case 92:Ut();break}return Nt}function Im(e,t){for(;Ut()&&e+mt!==57;)if(e+mt===84&&Sn()===47)break;return"/*"+pa(t,Nt-1)+"*"+Br(e===47?e:Ut())}function Mm(e){for(;!Kr(Sn());)Ut();return pa(e,Nt)}function qo(e){return $m(Ls("",null,null,null,[""],e=Fm(e),0,[0],e))}function Ls(e,t,n,r,a,i,o,l,u){for(var m=0,g=0,f=o,h=0,p=0,S=0,y=1,w=1,v=1,x=0,C=0,j="",b=a,T=i,$=r,E=j;w;)switch(S=C,C=Ut()){case 40:S!=108&&gt(E,f-1)==58?(x++,E+="("):E+=Na(C);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=Na(C);break;case 9:case 10:case 13:case 32:if(x>0){E+=Br(C);break}E+=Em(S);break;case 92:E+=Rm(Ns()-1,7);continue;case 47:switch(Sn()){case 42:case 47:Dr(Am(Im(Ut(),Ns()),t,n,u),u),(Kr(S||1)==5||Kr(Sn()||1)==5)&&Bt(E)&&_n(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*y:l[m++]=Bt(E)*v;case 125*y:case 59:case 0:if(x>0&&C){E+=Br(C);break}switch(C){case 0:case 125:w=0;case 59+g:v==-1&&(E=Pe(E,/\f/g,"")),p>0&&(Bt(E)-f||y===0)&&Dr(p>32?Zo(E+";",r,n,f-1,u):Zo(Pe(E," ","")+";",r,n,f-2,u),u);break;case 59:E+=";";default:if(Dr($=Go(E,t,n,m,g,a,l,j,b=[],T=[],f,i),i),C===123)if(g===0)Ls(E,t,$,$,b,i,f,l,T);else{switch(h){case 99:if(gt(E,3)===110)break;case 108:if(gt(E,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Ls(e,$,$,r&&Dr(Go(e,$,$,0,0,a,l,j,a,b=[],f,T),T),a,T,f,l,r?b:T):Ls(E,$,$,$,[""],T,0,l,T)}}m=g=p=0,y=v=1,j=E="",f=o;break;case 58:f=1+Bt(E),p=S;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&Tm()==125)continue}switch(E+=Br(C),C*y){case 38:v=g>0?1:(E+="\f",-1);break;case 44:if(x>0)break;l[m++]=(Bt(E)-1)*v,v=1;break;case 64:Sn()===45&&(E+=Na(Ut())),h=Sn(),g=f=Bt(j=E+=Mm(Ns())),C++;break;case 45:S===45&&Bt(E)==2&&(y=0)}}return i}function Go(e,t,n,r,a,i,o,l,u,m,g,f){for(var h=a-1,p=a===0?i:[""],S=bu(p),y=0,w=0,v=0;y<r;++y)for(var x=0,C=_n(e,h+1,h=Cm(w=o[y])),j=e;x<S;++x)(j=xu(w>0?p[x]+" "+C:Pe(C,/&\f/g,p[x])))&&(u[v++]=j);return ga(e,t,n,a===0?oo:l,u,m,g,f)}function Am(e,t,n,r){return ga(e,t,n,pu,Br(vm()),_n(e,2,-2),0,r)}function Zo(e,t,n,r,a){return ga(e,t,n,lo,_n(e,0,r),_n(e,r+1,-1),r,a)}function Cu(e,t,n){switch(wm(e,t)){case 5103:return He+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return He+e+e;case 4855:return He+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return zr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return He+e+zr+e+at+e+e;case 5936:switch(gt(e,t+11)){case 114:return He+e+at+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return He+e+at+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return He+e+at+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return He+e+at+e+e;case 6165:return He+e+at+"flex-"+e+e;case 5187:return He+e+Pe(e,/(\w+).+(:[^]+)/,He+"box-$1$2"+at+"flex-$1$2")+e;case 5443:return He+e+at+"flex-item-"+Pe(e,/flex-|-self/g,"")+(rn(e,/flex-|baseline/)?"":at+"grid-row-"+Pe(e,/flex-|-self/g,""))+e;case 4675:return He+e+at+"flex-line-pack"+Pe(e,/align-content|flex-|-self/g,"")+e;case 5548:return He+e+at+Pe(e,"shrink","negative")+e;case 5292:return He+e+at+Pe(e,"basis","preferred-size")+e;case 6060:return He+"box-"+Pe(e,"-grow","")+He+e+at+Pe(e,"grow","positive")+e;case 4554:return He+Pe(e,/([^-])(transform)/g,"$1"+He+"$2")+e;case 6187:return Pe(Pe(Pe(e,/(zoom-|grab)/,He+"$1"),/(image-set)/,He+"$1"),e,"")+e;case 5495:case 3959:return Pe(e,/(image-set\([^]*)/,He+"$1$`$1");case 4968:return Pe(Pe(e,/(.+:)(flex-)?(.*)/,He+"box-pack:$3"+at+"flex-pack:$3"),/space-between/,"justify")+He+e+e;case 4200:if(!rn(e,/flex-|baseline/))return at+"grid-column-align"+_n(e,t)+e;break;case 2592:case 3360:return at+Pe(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,a){return t=a,rn(r.props,/grid-\w+-end/)})?~Pa(e+(n=n[t].value),"span")?e:at+Pe(e,"-start","")+e+at+"grid-row-span:"+(~Pa(n,"span")?rn(n,/\d+/):+rn(n,/\d+/)-+rn(e,/\d+/))+";":at+Pe(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return rn(r.props,/grid-\w+-start/)})?e:at+Pe(Pe(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Pe(e,/(.+)-inline(.+)/,He+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Bt(e)-1-t>6)switch(gt(e,t+1)){case 109:if(gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+He+"$2-$3$1"+zr+(gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Pa(e,"stretch")?Cu(Pe(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Pe(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,a,i,o,l,u,m){return at+a+":"+i+m+(o?at+a+"-span:"+(l?u:+u-+i)+m:"")+e});case 4949:if(gt(e,t+6)===121)return Pe(e,":",":"+He)+e;break;case 6444:switch(gt(e,gt(e,14)===45?18:11)){case 120:return Pe(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+He+(gt(e,14)===45?"inline-":"")+"box$3$1"+He+"$2$3$1"+at+"$2box$3")+e;case 100:return Pe(e,":",":"+at)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Pe(e,"scroll-","scroll-snap-")+e}return e}function Wr(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Jo(e,t,n,r){switch(e.type){case Sm:if(e.children.length)break;case xm:case bm:case lo:return e.return=e.return||e.value;case pu:return"";case yu:return e.return=e.value+"{"+Wr(e.children,r)+"}";case oo:if(!Bt(e.value=e.props.join(",")))return""}return Bt(n=Wr(e.children,r))?e.return=e.value+"{"+n+"}":""}function km(e){var t=bu(e);return function(n,r,a,i){for(var o="",l=0;l<t;l++)o+=e[l](n,r,a,i)||"";return o}}function Om(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case lo:e.return=Cu(e.value,e.length,n);return;case yu:return Wr([yn(e,{value:Pe(e.value,"@","@"+He)})],r);case oo:if(e.length)return jm(n=e.props,function(a){switch(rn(a,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Qn(yn(e,{props:[Pe(a,/:(read-\w+)/,":"+zr+"$1")]})),Qn(yn(e,{props:[a]})),yi(e,{props:Wo(n,r)});break;case"::placeholder":Qn(yn(e,{props:[Pe(a,/:(plac\w+)/,":"+He+"input-$1")]})),Qn(yn(e,{props:[Pe(a,/:(plac\w+)/,":"+zr+"$1")]})),Qn(yn(e,{props:[Pe(a,/:(plac\w+)/,at+"input-$1")]})),Qn(yn(e,{props:[a]})),yi(e,{props:Wo(n,r)});break}return""})}}function wu(e,t){const{path:n,parentSelectors:r}=t;st(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${e}${r.length?` Selector: ${r.join(" | ")}`:""}`)}const Dm=(e,t,n)=>{if(e==="content"){const r=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;(typeof t!="string"||["normal","none","initial","inherit","unset"].indexOf(t)===-1&&!r.test(t)&&!t.startsWith("var(")&&(t.charAt(0)!==t.charAt(t.length-1)||t.charAt(0)!=='"'&&t.charAt(0)!=="'"))&&wu(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${t}"'\`.`,n)}},Pm=(e,t,n)=>{e==="animation"&&n.hashId&&t!=="none"&&wu(`You seem to be using hashed animation '${t}', in which case 'animationName' with Keyframe as value is recommended.`,n)},Xo="data-ant-cssinjs-cache-path",ju="_FILE_STYLE__";let Ln,vu=!0;function Nm(){var e;if(!Ln&&(Ln={},Xr())){const t=document.createElement("div");t.className=Xo,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);let n=getComputedStyle(t).content||"";n=n.replace(/^"/,"").replace(/"$/,""),n.split(";").forEach(a=>{const[i,o]=a.split(":");Ln[i]=o});const r=document.querySelector(`style[${Xo}]`);r&&(vu=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function Lm(e){return Nm(),!!Ln[e]}function _m(e){const t=Ln[e];let n=null;if(t&&Xr())if(vu)n=ju;else{const r=document.querySelector(`style[${Nn}="${Ln[e]}"]`);r?n=r.innerHTML:delete Ln[e]}return[n,t]}const Tu="_skip_check_",Fu="_multi_value_";function La(e,t){return(t?Wr(qo(e),km([Om,Jo])):Wr(qo(e),Jo)).replace(/\{%%%\:[^;];}/g,";")}function zm(e){return typeof e=="object"&&e&&(Tu in e||Fu in e)}function Qo(e,t,n="high"){if(!t)return e;const r=mu({hashCls:t,hashPriority:n});return e.split(",").map(i=>{var m;const o=i.trim().split(/\s+/);let l=o[0]||"";const u=((m=l.match(/^\w+/))==null?void 0:m[0])||"";return l=`${u}${r}${l.slice(u.length)}`,[l,...o.slice(1)].join(" ")}).join(",")}const bi=(e,t={},{root:n,injectHash:r,parentSelectors:a}={root:!0,parentSelectors:[]})=>{const{hashId:i,layer:o,path:l,hashPriority:u,transformers:m=[],linters:g=[]}=t;let f="",h={};function p(w){const v=w.getName(i);if(!h[v]){const[x]=bi(w.style,t,{root:!1,parentSelectors:a});h[v]=`@keyframes ${w.getName(i)}${x}`}}function S(w,v=[]){return w.forEach(x=>{Array.isArray(x)?S(x,v):x&&v.push(x)}),v}return S(Array.isArray(e)?e:[e]).forEach(w=>{const v=typeof w=="string"&&!n?{}:w;if(typeof v=="string")f+=`${v}
18
- `;else if(v._keyframe)p(v);else{const x=m.reduce((C,j)=>{var b;return((b=j==null?void 0:j.visit)==null?void 0:b.call(j,C))||C},v);Object.keys(x).forEach(C=>{const j=x[C];if(typeof j=="object"&&j&&(C!=="animationName"||!j._keyframe)&&!zm(j)){let b=!1,T=C.trim(),$=!1;(n||r)&&i?T.startsWith("@")?b=!0:T==="&"?T=Qo("",i,u):T=Qo(C,i,u):n&&!i&&(T==="&"||T==="")&&(T="",$=!0);const[E,R]=bi(j,t,{root:$,injectHash:b,parentSelectors:[...a,T]});h={...h,...R},f+=`${T}${E}`}else{let b=function($,E){process.env.NODE_ENV!=="production"&&(typeof j!="object"||!(j!=null&&j[Tu]))&&[Dm,Pm,...g].forEach(M=>M($,E,{path:l,hashId:i,parentSelectors:a}));const R=$.replace(/[A-Z]/g,M=>`-${M.toLowerCase()}`);let I=E;!ym[$]&&typeof I=="number"&&I!==0&&(I=`${I}px`),$==="animationName"&&(E!=null&&E._keyframe)&&(p(E),I=E.getName(i)),f+=`${R}:${I};`};const T=(j==null?void 0:j.value)??j;typeof j=="object"&&(j!=null&&j[Fu])&&Array.isArray(T)?T.forEach($=>{b(C,$)}):tm(T)&&b(C,T)}})}}),n?o&&(f&&(f=`@layer ${o.name} {${f}}`),o.dependencies&&(h[`@layer ${o.name}`]=o.dependencies.map(w=>`@layer ${w}, ${o.name};`).join(`
19
- `))):f=`{${f}}`,[f,h]};function Bm(e,t){return Ur(`${e.join("%")}${t}`)}const Vm="style";function Hm(e,t){const{path:n,hashId:r,layer:a,nonce:i,clientOnly:o,order:l=0}=e,{mock:u,hashPriority:m,container:g,transformers:f,linters:h,cache:p,layer:S,autoPrefix:y}=be.useContext(io),w=[r||""];S&&w.push("layer"),w.push(...n);let v=Ko;process.env.NODE_ENV!=="production"&&u!==void 0&&(v=u==="client"),gu(Vm,w,()=>{const x=w.join("|");if(Lm(x)){const[E,R]=_m(x);if(E)return[E,R,{},o,l]}const C=t(),[j,b]=bi(C,{hashId:r,hashPriority:m,layer:S?a:void 0,path:n.join("-"),transformers:f,linters:h}),T=La(j,y||!1),$=Bm(w,T);return[T,$,b,o,l]},(x,C)=>{const[,j]=x;C&&Ko&&Pf(j,{mark:Nn,attachTo:g})},x=>{const[C,j,b,,T]=x;if(v&&C!==ju){let $={mark:Nn,prepend:S?!1:"queue",attachTo:g,priority:T};$=hu($,i);const E=[],R=[];Object.keys(b).forEach(M=>{M.startsWith("@layer")?E.push(M):R.push(M)}),E.forEach(M=>{Ps(La(b[M],y||!1),`_layer-${M}`,{...$,prepend:!0})});const I=Ps(C,j,$);I[bn]=p.instanceId,process.env.NODE_ENV!=="production"&&I.setAttribute(Gf,w.join("|")),R.forEach(M=>{Ps(La(b[M],y||!1),`_effect-${M}`,$)})}})}class $u{constructor(t,n){oe(this,"name");oe(this,"style");oe(this,"_keyframe",!0);this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}function er(e){return e.notSplit=!0,e}er(["borderTop","borderBottom"]),er(["borderTop"]),er(["borderBottom"]),er(["borderLeft","borderRight"]),er(["borderLeft"]),er(["borderRight"]);const Ym={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},Um={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},Km={...Um,locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月",nextMonth:"下个月",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年",nextYear:"下一年",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1},Eu={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Si={lang:{placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"],...Km},timePickerLocale:{...Eu}};Si.lang.ok="确定";const Ft="${label}不是一个有效的${type}",Wm={locale:"zh-cn",Pagination:Ym,DatePicker:Si,TimePicker:Eu,Calendar:Si,global:{placeholder:"请选择",close:"关闭",sortable:"可排序",show:"显示",hide:"隐藏"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckAll:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Carousel:{prevSlide:"上一张幻灯片",nextSlide:"下一张幻灯片"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:Ft,method:Ft,array:Ft,object:Ft,number:Ft,date:Ft,boolean:Ft,integer:Ft,float:Ft,regexp:Ft,email:Ft,url:Ft,hex:Ft},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无",transparent:"无色",singleColor:"单色",gradientColor:"渐变色"}};var _s={exports:{}},qm=_s.exports,el;function Gm(){return el||(el=1,(function(e,t){(function(n,r){e.exports=r(Qc())})(qm,(function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var a=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,l){return l==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,l){var u=100*o+l;return u<600?"凌晨":u<900?"早上":u<1100?"上午":u<1300?"中午":u<1800?"下午":"晚上"}};return a.default.locale(i,null,!0),i}))})(_s)),_s.exports}Gm();var gs={exports:{}},_a={};/**
17
+ */var Do;function wf(){return Do||(Do=1,process.env.NODE_ENV!=="production"&&(function(){function e(y){if(typeof y=="object"&&y!==null){var w=y.$$typeof;switch(w){case t:switch(y=y.type,y){case r:case i:case a:case m:case g:case p:return y;default:switch(y=y&&y.$$typeof,y){case l:case u:case h:case f:return y;case o:return y;default:return w}}case n:return w}}}var t=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.for("react.view_transition"),S=Symbol.for("react.client.reference");qe.ContextConsumer=o,qe.ContextProvider=l,qe.Element=t,qe.ForwardRef=u,qe.Fragment=r,qe.Lazy=h,qe.Memo=f,qe.Portal=n,qe.Profiler=i,qe.StrictMode=a,qe.Suspense=m,qe.SuspenseList=g,qe.isContextConsumer=function(y){return e(y)===o},qe.isContextProvider=function(y){return e(y)===l},qe.isElement=function(y){return typeof y=="object"&&y!==null&&y.$$typeof===t},qe.isForwardRef=function(y){return e(y)===u},qe.isFragment=function(y){return e(y)===r},qe.isLazy=function(y){return e(y)===h},qe.isMemo=function(y){return e(y)===f},qe.isPortal=function(y){return e(y)===n},qe.isProfiler=function(y){return e(y)===i},qe.isStrictMode=function(y){return e(y)===a},qe.isSuspense=function(y){return e(y)===m},qe.isSuspenseList=function(y){return e(y)===g},qe.isValidElementType=function(y){return typeof y=="string"||typeof y=="function"||y===r||y===i||y===a||y===m||y===g||y===p||typeof y=="object"&&y!==null&&(y.$$typeof===h||y.$$typeof===f||y.$$typeof===l||y.$$typeof===o||y.$$typeof===u||y.$$typeof===S||y.getModuleId!==void 0)},qe.typeOf=e})()),qe}var Po;function jf(){return Po||(Po=1,process.env.NODE_ENV==="production"?ms.exports=Cf():ms.exports=wf()),ms.exports}var Oa=jf();const vf=Symbol.for("react.element"),Tf=Symbol.for("react.transitional.element"),Ff=Symbol.for("react.fragment");function su(e){return e&&typeof e=="object"&&(e.$$typeof===vf||e.$$typeof===Tf)&&e.type===Ff}var Wc;const $f=Number((Wc=d.version)==null?void 0:Wc.split(".")[0]),Ef=(e,t)=>{typeof e=="function"?e(t):typeof e=="object"&&e&&"current"in e&&(e.current=t)},Rf=(...e)=>{const t=e.filter(Boolean);return t.length<=1?t[0]:n=>{e.forEach(r=>{Ef(r,n)})}},If=(...e)=>Sf(()=>Rf(...e),e,(t,n)=>t.length!==n.length||t.every((r,a)=>r!==n[a])),Mf=e=>{var n,r;if(!e)return!1;if(au(e)&&$f>=19)return!0;const t=Oa.isMemo(e)?e.type.type:e.type;return!(typeof t=="function"&&!((n=t.prototype)!=null&&n.render)&&t.$$typeof!==Oa.ForwardRef||typeof e=="function"&&!((r=e.prototype)!=null&&r.render)&&e.$$typeof!==Oa.ForwardRef)};function au(e){return d.isValidElement(e)&&!su(e)}const Af=e=>{if(e&&au(e)){const t=e;return t.props.propertyIsEnumerable("ref")?t.props.ref:t.ref}return null};function kf(e,t){if(!e)return!1;if(e.contains)return e.contains(t);let n=t;for(;n;){if(n===e)return!0;n=n.parentNode}return!1}const No="data-rc-order",Lo="data-rc-priority",Of="rc-util-key",mi=new Map;function iu({mark:e}={}){return e?e.startsWith("data-")?e:`data-${e}`:Of}function ma(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Df(e){return e==="queue"?"prependQueue":e?"prepend":"append"}function so(e){return e?Array.from((mi.get(e)||e).children).filter(t=>t.tagName==="STYLE"):[]}function ou(e,t={}){if(!Xr())return null;const{csp:n,prepend:r,priority:a=0}=t,i=Df(r),o=i==="prependQueue",l=document.createElement("style");l.setAttribute(No,i),o&&a&&l.setAttribute(Lo,`${a}`),n!=null&&n.nonce&&(l.nonce=n==null?void 0:n.nonce),l.innerHTML=e;const u=ma(t);if(!u)return null;const{firstChild:m}=u;if(r){if(o){const g=(t.styles||so(u)).filter(f=>{if(!["prepend","prependQueue"].includes(f.getAttribute(No)))return!1;const h=Number(f.getAttribute(Lo)||0);return a>=h});if(g.length)return u.insertBefore(l,g[g.length-1].nextSibling),l}u.insertBefore(l,m)}else u.appendChild(l);return l}function lu(e,t={}){let{styles:n}=t;return n||(n=so(ma(t))),n.find(r=>r.getAttribute(iu(t))===e)}function Pf(e,t={}){const n=lu(e,t);if(n){const r=ma(t);r==null||r.removeChild(n)}}function Nf(e,t){const n=mi.get(e);if(!n||!kf(document,n)){const r=ou("",t);if(!r)return;const{parentNode:a}=r;mi.set(e,a),e.removeChild(r)}}function Ps(e,t,n={}){var u,m,g;const r=ma(n);if(!r)return null;const a=so(r),i={...n,styles:a};Nf(r,i);const o=lu(t,i);if(o)return(u=i.csp)!=null&&u.nonce&&o.nonce!==((m=i.csp)==null?void 0:m.nonce)&&(o.nonce=(g=i.csp)==null?void 0:g.nonce),o.innerHTML!==e&&(o.innerHTML=e),o;const l=ou(e,i);return l?(l.setAttribute(iu(i),t),l):null}function _o(e){return e instanceof HTMLElement||e instanceof SVGElement}function Lf(e){return e&&typeof e=="object"&&_o(e.nativeElement)?e.nativeElement:_o(e)?e:null}let hi={};const ao=[],_f=e=>{ao.push(e)};function Js(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=ao.reduce((r,a)=>a(r??"","warning"),t);n&&console.error(`Warning: ${n}`)}}function zf(e,t){if(process.env.NODE_ENV!=="production"&&!e&&console!==void 0){const n=ao.reduce((r,a)=>a(r??"","note"),t);n&&console.warn(`Note: ${n}`)}}function Bf(){hi={}}function cu(e,t,n){!t&&!hi[n]&&(e(!1,n),hi[n]=!0)}function st(e,t){cu(Js,e,t)}function Vf(e,t){cu(zf,e,t)}st.preMessage=_f;st.resetWarned=Bf;st.noteOnce=Vf;function zo(e,t,n=!1){const r=new Set;function a(i,o,l=1){const u=r.has(i);if(st(!u,"Warning: There may be circular references"),u)return!1;if(i===o)return!0;if(n&&l>1)return!1;r.add(i);const m=l+1;if(Array.isArray(i)){if(!Array.isArray(o)||i.length!==o.length)return!1;for(let g=0;g<i.length;g++)if(!a(i[g],o[g],m))return!1;return!0}if(i&&o&&typeof i=="object"&&typeof o=="object"){const g=Object.keys(i);return g.length!==Object.keys(o).length?!1:g.every(f=>a(i[f],o[f],m))}return!1}return a(e,t)}var Rr={exports:{}},Bo;function Hf(){if(Bo)return Rr.exports;Bo=1,Rr.exports=r,Rr.exports.isMobile=r,Rr.exports.default=r;const e=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,t=/CrOS/,n=/android|ipad|playbook|silk/i;function r(a){a||(a={});let i=a.ua;if(!i&&typeof navigator<"u"&&(i=navigator.userAgent),i&&i.headers&&typeof i.headers["user-agent"]=="string"&&(i=i.headers["user-agent"]),typeof i!="string")return!1;let o=e.test(i)&&!t.test(i)||!!a.tablet&&n.test(i);return!o&&a.tablet&&a.featureDetect&&navigator&&navigator.maxTouchPoints>1&&i.indexOf("Macintosh")!==-1&&i.indexOf("Safari")!==-1&&(o=!0),o}return Rr.exports}Hf();function Ze(e,t){const n=Object.assign({},e);return Array.isArray(t)&&t.forEach(r=>{delete n[r]}),n}function Tn(e,t={}){let n=[];return d.Children.forEach(e,r=>{r==null&&!t.keepEmpty||(Array.isArray(r)?n=n.concat(Tn(r)):su(r)&&r.props?n=n.concat(Tn(r.props.children,t)):n.push(r))}),n}function Be(e,t){let n=e;for(let r=0;r<t.length;r+=1){if(n==null)return;n=n[t[r]]}return n}function uu(e,t,n,r){if(!t.length)return n;const[a,...i]=t;let o;if(!e&&typeof a=="number"?o=[]:Array.isArray(e)?o=[...e]:o={...e},r&&n===void 0&&i.length===1){const l=o[a];if(l&&typeof l=="object"){const u=Array.isArray(l)?[...l]:{...l};delete u[i[0]],o[a]=u}}else o[a]=uu(o[a],i,n,r);return o}function Qe(e,t,n,r=!1){return t.length&&r&&n===void 0&&!Be(e,t.slice(0,-1))?e:uu(e,t,n,r)}function Uf(e){return typeof e=="object"&&e!==null&&Object.getPrototypeOf(e)===Object.prototype}function Vo(e){return Array.isArray(e)?[]:{}}const Yf=typeof Reflect>"u"?Object.keys:Reflect.ownKeys;function Kf(e,t={}){const{prepareArray:n}=t,r=n||(()=>[]);let a=Vo(e[0]);return e.forEach(i=>{function o(l,u){const m=new Set(u),g=Be(i,l),f=Array.isArray(g);if(f||Uf(g)){if(!m.has(g)){m.add(g);const h=Be(a,l);f?a=Qe(a,l,r(h,g)):(!h||typeof h!="object")&&(a=Qe(a,l,Vo(g))),Yf(g).forEach(p=>{Object.getOwnPropertyDescriptor(g,p).enumerable&&o([...l,p],m)})}}else a=Qe(a,l,g)}o([])}),a}function ar(...e){return Kf(e)}function du(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=du(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ie(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=du(e))&&(r&&(r+=" "),r+=t);return r}function Yr(e){for(var t=0,n,r=0,a=e.length;a>=4;++r,a-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(a){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}const Wf="%";function gi(e){return e.join(Wf)}let Ho=0;class qf{constructor(t){oe(this,"instanceId");oe(this,"cache",new Map);oe(this,"updateTimes",new Map);oe(this,"extracted",new Set);this.instanceId=t}get(t){return this.opGet(gi(t))}opGet(t){return this.cache.get(t)||null}update(t,n){return this.opUpdate(gi(t),n)}opUpdate(t,n){const r=this.cache.get(t),a=n(r);a===null?(this.cache.delete(t),this.updateTimes.delete(t)):(this.cache.set(t,a),this.updateTimes.set(t,Ho),Ho+=1)}}const fu="data-token-hash",Nn="data-css-hash",Gf="data-cache-path",bn="__cssinjs_instance__";function Zf(){const e=Math.random().toString(12).slice(2);if(typeof document<"u"&&document.head&&document.body){const t=document.body.querySelectorAll(`style[${Nn}]`)||[],{firstChild:n}=document.head;Array.from(t).forEach(a=>{a[bn]||(a[bn]=e),a[bn]===e&&document.head.insertBefore(a,n)});const r={};Array.from(document.querySelectorAll(`style[${Nn}]`)).forEach(a=>{var o;const i=a.getAttribute(Nn);r[i]?a[bn]===e&&((o=a.parentNode)==null||o.removeChild(a)):r[i]=!0})}return new qf(e)}const io=be.createContext({hashPriority:"low",cache:Zf(),defaultCache:!0,autoPrefix:!1});let Uo=0;class Jf{constructor(t){oe(this,"derivatives");oe(this,"id");this.derivatives=Array.isArray(t)?t:[t],this.id=Uo,t.length===0&&Js(t.length>0,"[Ant Design CSS-in-JS] Theme should have at least one derivative function."),Uo+=1}getDerivativeToken(t){return this.derivatives.reduce((n,r)=>r(t,n),void 0)}}const Xf=new WeakMap,Da={};function Qf(e,t){let n=Xf;for(let r=0;r<t.length;r+=1){const a=t[r];n.has(a)||n.set(a,new WeakMap),n=n.get(a)}return n.has(Da)||n.set(Da,e()),n.get(Da)}const Yo=new WeakMap;function _r(e){let t=Yo.get(e)||"";return t||(Object.keys(e).forEach(n=>{const r=e[n];t+=n,r instanceof Jf?t+=r.id:r&&typeof r=="object"?t+=_r(r):t+=r}),t=Yr(t),Yo.set(e,t)),t}function em(e,t){return Yr(`${t}_${_r(e)}`)}const Ko=Xr();function mu(e){const{hashCls:t,hashPriority:n="low"}=e||{};if(!t)return"";const r=`.${t}`;return n==="low"?`:where(${r})`:r}const tm=e=>e!=null;function hu(e,t){const n=typeof t=="function"?t():t;return n?{...e,csp:{...e.csp,nonce:n}}:e}const nm=(e,t="")=>`--${t?`${t}-`:""}${e}`.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/([A-Z]+)([A-Z][a-z0-9]+)/g,"$1-$2").replace(/([a-z])([A-Z0-9])/g,"$1-$2").toLowerCase(),rm=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",scope:i}=n||{};if(!Object.keys(e).length)return"";const o=`${mu({hashCls:r,hashPriority:a})}.${t}`,l=[i].flat().filter(Boolean);return`${l.length?l.map(m=>`${o}.${m}`).join(", "):o}{${Object.entries(e).map(([m,g])=>`${m}:${g};`).join("")}}`},sm=(e,t,n)=>{const{hashCls:r,hashPriority:a="low",prefix:i,unitless:o,ignore:l,preserve:u}=n||{},m={},g={};return Object.entries(e).forEach(([f,h])=>{if(u!=null&&u[f])g[f]=h;else if((typeof h=="string"||typeof h=="number")&&!(l!=null&&l[f])){const p=nm(f,i);m[p]=typeof h=="number"&&!(o!=null&&o[f])?`${h}px`:String(h),g[f]=`var(${p})`}}),[g,rm(m,t,{scope:n==null?void 0:n.scope,hashCls:r,hashPriority:a})]};function am(){return!1}let pi=!1;function im(){return pi}const om=process.env.NODE_ENV==="production"?am:im;if(process.env.NODE_ENV!=="production"&&typeof module<"u"&&module&&module.hot&&typeof window<"u"){const e=typeof globalThis<"u"?globalThis:typeof window<"u"?window:null;if(e&&typeof e.webpackHotUpdate=="function"){const t=e.webpackHotUpdate;e.webpackHotUpdate=(...n)=>(pi=!0,setTimeout(()=>{pi=!1},0),t(...n))}}const hs=new Map;function gu(e,t,n,r,a){const{cache:i}=be.useContext(io),o=[e,...t],l=gi(o),u=om(),m=h=>{i.opUpdate(l,p=>{const[S=0,y]=p||[void 0,void 0];let w=y;process.env.NODE_ENV!=="production"&&y&&u&&(r==null||r(w,u),w=null);const T=w||n(),x=[S,T];return h?h(x):x})};be.useMemo(()=>{m()},[l]);let g=i.opGet(l);process.env.NODE_ENV!=="production"&&!g&&(m(),g=i.opGet(l));const f=g[1];return d.useInsertionEffect(()=>(m(([h,p])=>[h+1,p]),hs.has(l)||(a==null||a(f),hs.set(l,!0),Promise.resolve().then(()=>{hs.delete(l)})),()=>{i.opUpdate(l,h=>{const[p=0,S]=h||[];return p-1===0?(r==null||r(S,!1),hs.delete(l),null):[p-1,S]})}),[l]),f}const lm={},cm=process.env.NODE_ENV!=="production"?"css-dev-only-do-not-override":"css",kn=new Map;function um(e){kn.set(e,(kn.get(e)||0)+1)}function dm(e,t){typeof document<"u"&&document.querySelectorAll(`style[${fu}="${e}"]`).forEach(r=>{var a;r[bn]===t&&((a=r.parentNode)==null||a.removeChild(r))})}const fm=-1;function mm(e,t){kn.set(e,(kn.get(e)||0)-1);const n=new Set;kn.forEach((r,a)=>{r<=0&&n.add(a)}),kn.size-n.size>fm&&n.forEach(r=>{dm(r,t),kn.delete(r)})}const hm=(e,t,n,r)=>{let i={...n.getDerivativeToken(e),...t};return r&&(i=r(i)),i},gm="token";function pm(e,t,n){const{cache:{instanceId:r},container:a,hashPriority:i}=d.useContext(io),{salt:o="",override:l=lm,formatToken:u,getComputedToken:m,cssVar:g,nonce:f}=n,h=Qf(()=>Object.assign({},...t),t),p=_r(h),S=_r(l),y=_r(g);return gu(gm,[o,e.id,p,S,y],()=>{const T=m?m(h,l,e):hm(h,l,e,u),x={...T},C=`${o}_${g.prefix}`,j=Yr(C),b=`${cm}-${j}`;x._tokenKey=em(x,C);const[v,$]=sm(T,g.key,{prefix:g.prefix,ignore:g.ignore,unitless:g.unitless,preserve:g.preserve,hashPriority:i,hashCls:g.hashed?b:void 0});return v._hashId=j,um(g.key),[v,b,x,$,g.key]},([,,,,T])=>{mm(T,r)},([,,,T,x])=>{if(!T)return;let C={mark:Nn,prepend:"queue",attachTo:a,priority:-999};C=hu(C,f);const j=Ps(T,Yr(`css-var-${x}`),C);j[bn]=r,j.setAttribute(fu,x)})}var ym={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},at="-ms-",zr="-moz-",He="-webkit-",pu="comm",oo="rule",lo="decl",xm="@import",bm="@namespace",yu="@keyframes",Sm="@layer",Cm=Math.abs,Br=String.fromCharCode,yi=Object.assign;function wm(e,t){return gt(e,0)^45?(((t<<2^gt(e,0))<<2^gt(e,1))<<2^gt(e,2))<<2^gt(e,3):0}function xu(e){return e.trim()}function rn(e,t){return(e=t.exec(e))?e[0]:e}function Pe(e,t,n){return e.replace(t,n)}function Pa(e,t){return e.indexOf(t)}function gt(e,t){return e.charCodeAt(t)|0}function _n(e,t,n){return e.slice(t,n)}function Bt(e){return e.length}function bu(e){return e.length}function Dr(e,t){return t.push(e),e}function jm(e,t){return e.map(t).join("")}function Wo(e,t){return e.filter(function(n){return!rn(n,t)})}var ha=1,dr=1,Su=0,Nt=0,mt=0,yr="";function ga(e,t,n,r,a,i,o,l){return{value:e,root:t,parent:n,type:r,props:a,children:i,line:ha,column:dr,length:o,return:"",siblings:l}}function yn(e,t){return yi(ga("",null,null,"",null,null,0,e.siblings),e,{length:-e.length},t)}function Qn(e){for(;e.root;)e=yn(e.root,{children:[e]});Dr(e,e.siblings)}function vm(){return mt}function Tm(){return mt=Nt>0?gt(yr,--Nt):0,dr--,mt===10&&(dr=1,ha--),mt}function Yt(){return mt=Nt<Su?gt(yr,Nt++):0,dr++,mt===10&&(dr=1,ha++),mt}function Sn(){return gt(yr,Nt)}function Ns(){return Nt}function pa(e,t){return _n(yr,e,t)}function Kr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Fm(e){return ha=dr=1,Su=Bt(yr=e),Nt=0,[]}function $m(e){return yr="",e}function Na(e){return xu(pa(Nt-1,xi(e===91?e+2:e===40?e+1:e)))}function Em(e){for(;(mt=Sn())&&mt<33;)Yt();return Kr(e)>2||Kr(mt)>3?"":" "}function Rm(e,t){for(;--t&&Yt()&&!(mt<48||mt>102||mt>57&&mt<65||mt>70&&mt<97););return pa(e,Ns()+(t<6&&Sn()==32&&Yt()==32))}function xi(e){for(;Yt();)switch(mt){case e:return Nt;case 34:case 39:e!==34&&e!==39&&xi(mt);break;case 40:e===41&&xi(e);break;case 92:Yt();break}return Nt}function Im(e,t){for(;Yt()&&e+mt!==57;)if(e+mt===84&&Sn()===47)break;return"/*"+pa(t,Nt-1)+"*"+Br(e===47?e:Yt())}function Mm(e){for(;!Kr(Sn());)Yt();return pa(e,Nt)}function qo(e){return $m(Ls("",null,null,null,[""],e=Fm(e),0,[0],e))}function Ls(e,t,n,r,a,i,o,l,u){for(var m=0,g=0,f=o,h=0,p=0,S=0,y=1,w=1,T=1,x=0,C=0,j="",b=a,v=i,$=r,E=j;w;)switch(S=C,C=Yt()){case 40:S!=108&&gt(E,f-1)==58?(x++,E+="("):E+=Na(C);break;case 41:x--,E+=")";break;case 34:case 39:case 91:E+=Na(C);break;case 9:case 10:case 13:case 32:if(x>0){E+=Br(C);break}E+=Em(S);break;case 92:E+=Rm(Ns()-1,7);continue;case 47:switch(Sn()){case 42:case 47:Dr(Am(Im(Yt(),Ns()),t,n,u),u),(Kr(S||1)==5||Kr(Sn()||1)==5)&&Bt(E)&&_n(E,-1,void 0)!==" "&&(E+=" ");break;default:E+="/"}break;case 123*y:l[m++]=Bt(E)*T;case 125*y:case 59:case 0:if(x>0&&C){E+=Br(C);break}switch(C){case 0:case 125:w=0;case 59+g:T==-1&&(E=Pe(E,/\f/g,"")),p>0&&(Bt(E)-f||y===0)&&Dr(p>32?Zo(E+";",r,n,f-1,u):Zo(Pe(E," ","")+";",r,n,f-2,u),u);break;case 59:E+=";";default:if(Dr($=Go(E,t,n,m,g,a,l,j,b=[],v=[],f,i),i),C===123)if(g===0)Ls(E,t,$,$,b,i,f,l,v);else{switch(h){case 99:if(gt(E,3)===110)break;case 108:if(gt(E,2)===97)break;default:g=0;case 100:case 109:case 115:}g?Ls(e,$,$,r&&Dr(Go(e,$,$,0,0,a,l,j,a,b=[],f,v),v),a,v,f,l,r?b:v):Ls(E,$,$,$,[""],v,0,l,v)}}m=g=p=0,y=T=1,j=E="",f=o;break;case 58:f=1+Bt(E),p=S;default:if(y<1){if(C==123)--y;else if(C==125&&y++==0&&Tm()==125)continue}switch(E+=Br(C),C*y){case 38:T=g>0?1:(E+="\f",-1);break;case 44:if(x>0)break;l[m++]=(Bt(E)-1)*T,T=1;break;case 64:Sn()===45&&(E+=Na(Yt())),h=Sn(),g=f=Bt(j=E+=Mm(Ns())),C++;break;case 45:S===45&&Bt(E)==2&&(y=0)}}return i}function Go(e,t,n,r,a,i,o,l,u,m,g,f){for(var h=a-1,p=a===0?i:[""],S=bu(p),y=0,w=0,T=0;y<r;++y)for(var x=0,C=_n(e,h+1,h=Cm(w=o[y])),j=e;x<S;++x)(j=xu(w>0?p[x]+" "+C:Pe(C,/&\f/g,p[x])))&&(u[T++]=j);return ga(e,t,n,a===0?oo:l,u,m,g,f)}function Am(e,t,n,r){return ga(e,t,n,pu,Br(vm()),_n(e,2,-2),0,r)}function Zo(e,t,n,r,a){return ga(e,t,n,lo,_n(e,0,r),_n(e,r+1,-1),r,a)}function Cu(e,t,n){switch(wm(e,t)){case 5103:return He+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:case 6391:case 5879:case 5623:case 6135:case 4599:return He+e+e;case 4855:return He+e.replace("add","source-over").replace("substract","source-out").replace("intersect","source-in").replace("exclude","xor")+e;case 4789:return zr+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return He+e+zr+e+at+e+e;case 5936:switch(gt(e,t+11)){case 114:return He+e+at+Pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return He+e+at+Pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return He+e+at+Pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return He+e+at+e+e;case 6165:return He+e+at+"flex-"+e+e;case 5187:return He+e+Pe(e,/(\w+).+(:[^]+)/,He+"box-$1$2"+at+"flex-$1$2")+e;case 5443:return He+e+at+"flex-item-"+Pe(e,/flex-|-self/g,"")+(rn(e,/flex-|baseline/)?"":at+"grid-row-"+Pe(e,/flex-|-self/g,""))+e;case 4675:return He+e+at+"flex-line-pack"+Pe(e,/align-content|flex-|-self/g,"")+e;case 5548:return He+e+at+Pe(e,"shrink","negative")+e;case 5292:return He+e+at+Pe(e,"basis","preferred-size")+e;case 6060:return He+"box-"+Pe(e,"-grow","")+He+e+at+Pe(e,"grow","positive")+e;case 4554:return He+Pe(e,/([^-])(transform)/g,"$1"+He+"$2")+e;case 6187:return Pe(Pe(Pe(e,/(zoom-|grab)/,He+"$1"),/(image-set)/,He+"$1"),e,"")+e;case 5495:case 3959:return Pe(e,/(image-set\([^]*)/,He+"$1$`$1");case 4968:return Pe(Pe(e,/(.+:)(flex-)?(.*)/,He+"box-pack:$3"+at+"flex-pack:$3"),/space-between/,"justify")+He+e+e;case 4200:if(!rn(e,/flex-|baseline/))return at+"grid-column-align"+_n(e,t)+e;break;case 2592:case 3360:return at+Pe(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,a){return t=a,rn(r.props,/grid-\w+-end/)})?~Pa(e+(n=n[t].value),"span")?e:at+Pe(e,"-start","")+e+at+"grid-row-span:"+(~Pa(n,"span")?rn(n,/\d+/):+rn(n,/\d+/)-+rn(e,/\d+/))+";":at+Pe(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return rn(r.props,/grid-\w+-start/)})?e:at+Pe(Pe(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return Pe(e,/(.+)-inline(.+)/,He+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Bt(e)-1-t>6)switch(gt(e,t+1)){case 109:if(gt(e,t+4)!==45)break;case 102:return Pe(e,/(.+:)(.+)-([^]+)/,"$1"+He+"$2-$3$1"+zr+(gt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Pa(e,"stretch")?Cu(Pe(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return Pe(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,a,i,o,l,u,m){return at+a+":"+i+m+(o?at+a+"-span:"+(l?u:+u-+i)+m:"")+e});case 4949:if(gt(e,t+6)===121)return Pe(e,":",":"+He)+e;break;case 6444:switch(gt(e,gt(e,14)===45?18:11)){case 120:return Pe(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+He+(gt(e,14)===45?"inline-":"")+"box$3$1"+He+"$2$3$1"+at+"$2box$3")+e;case 100:return Pe(e,":",":"+at)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return Pe(e,"scroll-","scroll-snap-")+e}return e}function Wr(e,t){for(var n="",r=0;r<e.length;r++)n+=t(e[r],r,e,t)||"";return n}function Jo(e,t,n,r){switch(e.type){case Sm:if(e.children.length)break;case xm:case bm:case lo:return e.return=e.return||e.value;case pu:return"";case yu:return e.return=e.value+"{"+Wr(e.children,r)+"}";case oo:if(!Bt(e.value=e.props.join(",")))return""}return Bt(n=Wr(e.children,r))?e.return=e.value+"{"+n+"}":""}function km(e){var t=bu(e);return function(n,r,a,i){for(var o="",l=0;l<t;l++)o+=e[l](n,r,a,i)||"";return o}}function Om(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case lo:e.return=Cu(e.value,e.length,n);return;case yu:return Wr([yn(e,{value:Pe(e.value,"@","@"+He)})],r);case oo:if(e.length)return jm(n=e.props,function(a){switch(rn(a,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Qn(yn(e,{props:[Pe(a,/:(read-\w+)/,":"+zr+"$1")]})),Qn(yn(e,{props:[a]})),yi(e,{props:Wo(n,r)});break;case"::placeholder":Qn(yn(e,{props:[Pe(a,/:(plac\w+)/,":"+He+"input-$1")]})),Qn(yn(e,{props:[Pe(a,/:(plac\w+)/,":"+zr+"$1")]})),Qn(yn(e,{props:[Pe(a,/:(plac\w+)/,at+"input-$1")]})),Qn(yn(e,{props:[a]})),yi(e,{props:Wo(n,r)});break}return""})}}function wu(e,t){const{path:n,parentSelectors:r}=t;st(!1,`[Ant Design CSS-in-JS] ${n?`Error in ${n}: `:""}${e}${r.length?` Selector: ${r.join(" | ")}`:""}`)}const Dm=(e,t,n)=>{if(e==="content"){const r=/(attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\(|(no-)?(open|close)-quote/;(typeof t!="string"||["normal","none","initial","inherit","unset"].indexOf(t)===-1&&!r.test(t)&&!t.startsWith("var(")&&(t.charAt(0)!==t.charAt(t.length-1)||t.charAt(0)!=='"'&&t.charAt(0)!=="'"))&&wu(`You seem to be using a value for 'content' without quotes, try replacing it with \`content: '"${t}"'\`.`,n)}},Pm=(e,t,n)=>{e==="animation"&&n.hashId&&t!=="none"&&wu(`You seem to be using hashed animation '${t}', in which case 'animationName' with Keyframe as value is recommended.`,n)},Xo="data-ant-cssinjs-cache-path",ju="_FILE_STYLE__";let Ln,vu=!0;function Nm(){var e;if(!Ln&&(Ln={},Xr())){const t=document.createElement("div");t.className=Xo,t.style.position="fixed",t.style.visibility="hidden",t.style.top="-9999px",document.body.appendChild(t);let n=getComputedStyle(t).content||"";n=n.replace(/^"/,"").replace(/"$/,""),n.split(";").forEach(a=>{const[i,o]=a.split(":");Ln[i]=o});const r=document.querySelector(`style[${Xo}]`);r&&(vu=!1,(e=r.parentNode)==null||e.removeChild(r)),document.body.removeChild(t)}}function Lm(e){return Nm(),!!Ln[e]}function _m(e){const t=Ln[e];let n=null;if(t&&Xr())if(vu)n=ju;else{const r=document.querySelector(`style[${Nn}="${Ln[e]}"]`);r?n=r.innerHTML:delete Ln[e]}return[n,t]}const Tu="_skip_check_",Fu="_multi_value_";function La(e,t){return(t?Wr(qo(e),km([Om,Jo])):Wr(qo(e),Jo)).replace(/\{%%%\:[^;];}/g,";")}function zm(e){return typeof e=="object"&&e&&(Tu in e||Fu in e)}function Qo(e,t,n="high"){if(!t)return e;const r=mu({hashCls:t,hashPriority:n});return e.split(",").map(i=>{var m;const o=i.trim().split(/\s+/);let l=o[0]||"";const u=((m=l.match(/^\w+/))==null?void 0:m[0])||"";return l=`${u}${r}${l.slice(u.length)}`,[l,...o.slice(1)].join(" ")}).join(",")}const bi=(e,t={},{root:n,injectHash:r,parentSelectors:a}={root:!0,parentSelectors:[]})=>{const{hashId:i,layer:o,path:l,hashPriority:u,transformers:m=[],linters:g=[]}=t;let f="",h={};function p(w){const T=w.getName(i);if(!h[T]){const[x]=bi(w.style,t,{root:!1,parentSelectors:a});h[T]=`@keyframes ${w.getName(i)}${x}`}}function S(w,T=[]){return w.forEach(x=>{Array.isArray(x)?S(x,T):x&&T.push(x)}),T}return S(Array.isArray(e)?e:[e]).forEach(w=>{const T=typeof w=="string"&&!n?{}:w;if(typeof T=="string")f+=`${T}
18
+ `;else if(T._keyframe)p(T);else{const x=m.reduce((C,j)=>{var b;return((b=j==null?void 0:j.visit)==null?void 0:b.call(j,C))||C},T);Object.keys(x).forEach(C=>{const j=x[C];if(typeof j=="object"&&j&&(C!=="animationName"||!j._keyframe)&&!zm(j)){let b=!1,v=C.trim(),$=!1;(n||r)&&i?v.startsWith("@")?b=!0:v==="&"?v=Qo("",i,u):v=Qo(C,i,u):n&&!i&&(v==="&"||v==="")&&(v="",$=!0);const[E,R]=bi(j,t,{root:$,injectHash:b,parentSelectors:[...a,v]});h={...h,...R},f+=`${v}${E}`}else{let b=function($,E){process.env.NODE_ENV!=="production"&&(typeof j!="object"||!(j!=null&&j[Tu]))&&[Dm,Pm,...g].forEach(M=>M($,E,{path:l,hashId:i,parentSelectors:a}));const R=$.replace(/[A-Z]/g,M=>`-${M.toLowerCase()}`);let D=E;!ym[$]&&typeof D=="number"&&D!==0&&(D=`${D}px`),$==="animationName"&&(E!=null&&E._keyframe)&&(p(E),D=E.getName(i)),f+=`${R}:${D};`};const v=(j==null?void 0:j.value)??j;typeof j=="object"&&(j!=null&&j[Fu])&&Array.isArray(v)?v.forEach($=>{b(C,$)}):tm(v)&&b(C,v)}})}}),n?o&&(f&&(f=`@layer ${o.name} {${f}}`),o.dependencies&&(h[`@layer ${o.name}`]=o.dependencies.map(w=>`@layer ${w}, ${o.name};`).join(`
19
+ `))):f=`{${f}}`,[f,h]};function Bm(e,t){return Yr(`${e.join("%")}${t}`)}const Vm="style";function Hm(e,t){const{path:n,hashId:r,layer:a,nonce:i,clientOnly:o,order:l=0}=e,{mock:u,hashPriority:m,container:g,transformers:f,linters:h,cache:p,layer:S,autoPrefix:y}=be.useContext(io),w=[r||""];S&&w.push("layer"),w.push(...n);let T=Ko;process.env.NODE_ENV!=="production"&&u!==void 0&&(T=u==="client"),gu(Vm,w,()=>{const x=w.join("|");if(Lm(x)){const[E,R]=_m(x);if(E)return[E,R,{},o,l]}const C=t(),[j,b]=bi(C,{hashId:r,hashPriority:m,layer:S?a:void 0,path:n.join("-"),transformers:f,linters:h}),v=La(j,y||!1),$=Bm(w,v);return[v,$,b,o,l]},(x,C)=>{const[,j]=x;C&&Ko&&Pf(j,{mark:Nn,attachTo:g})},x=>{const[C,j,b,,v]=x;if(T&&C!==ju){let $={mark:Nn,prepend:S?!1:"queue",attachTo:g,priority:v};$=hu($,i);const E=[],R=[];Object.keys(b).forEach(M=>{M.startsWith("@layer")?E.push(M):R.push(M)}),E.forEach(M=>{Ps(La(b[M],y||!1),`_layer-${M}`,{...$,prepend:!0})});const D=Ps(C,j,$);D[bn]=p.instanceId,process.env.NODE_ENV!=="production"&&D.setAttribute(Gf,w.join("|")),R.forEach(M=>{Ps(La(b[M],y||!1),`_effect-${M}`,$)})}})}class $u{constructor(t,n){oe(this,"name");oe(this,"style");oe(this,"_keyframe",!0);this.name=t,this.style=n}getName(t=""){return t?`${t}-${this.name}`:this.name}}function er(e){return e.notSplit=!0,e}er(["borderTop","borderBottom"]),er(["borderTop"]),er(["borderBottom"]),er(["borderLeft","borderRight"]),er(["borderLeft"]),er(["borderRight"]);const Um={items_per_page:"条/页",jump_to:"跳至",jump_to_confirm:"确定",page:"页",prev_page:"上一页",next_page:"下一页",prev_5:"向前 5 页",next_5:"向后 5 页",prev_3:"向前 3 页",next_3:"向后 3 页",page_size:"页码"},Ym={yearFormat:"YYYY",dayFormat:"D",cellMeridiemFormat:"A",monthBeforeYear:!0},Km={...Ym,locale:"zh_CN",today:"今天",now:"此刻",backToToday:"返回今天",ok:"确定",timeSelect:"选择时间",dateSelect:"选择日期",weekSelect:"选择周",clear:"清除",week:"周",month:"月",year:"年",previousMonth:"上个月",nextMonth:"下个月",monthSelect:"选择月份",yearSelect:"选择年份",decadeSelect:"选择年代",previousYear:"上一年",nextYear:"下一年",previousDecade:"上一年代",nextDecade:"下一年代",previousCentury:"上一世纪",nextCentury:"下一世纪",yearFormat:"YYYY年",cellDateFormat:"D",monthBeforeYear:!1},Eu={placeholder:"请选择时间",rangePlaceholder:["开始时间","结束时间"]},Si={lang:{placeholder:"请选择日期",yearPlaceholder:"请选择年份",quarterPlaceholder:"请选择季度",monthPlaceholder:"请选择月份",weekPlaceholder:"请选择周",rangePlaceholder:["开始日期","结束日期"],rangeYearPlaceholder:["开始年份","结束年份"],rangeMonthPlaceholder:["开始月份","结束月份"],rangeQuarterPlaceholder:["开始季度","结束季度"],rangeWeekPlaceholder:["开始周","结束周"],...Km},timePickerLocale:{...Eu}};Si.lang.ok="确定";const Ft="${label}不是一个有效的${type}",Wm={locale:"zh-cn",Pagination:Um,DatePicker:Si,TimePicker:Eu,Calendar:Si,global:{placeholder:"请选择",close:"关闭",sortable:"可排序",show:"显示",hide:"隐藏"},Table:{filterTitle:"筛选",filterConfirm:"确定",filterReset:"重置",filterEmptyText:"无筛选项",filterCheckAll:"全选",filterSearchPlaceholder:"在筛选项中搜索",emptyText:"暂无数据",selectAll:"全选当页",selectInvert:"反选当页",selectNone:"清空所有",selectionAll:"全选所有",sortTitle:"排序",expand:"展开行",collapse:"关闭行",triggerDesc:"点击降序",triggerAsc:"点击升序",cancelSort:"取消排序"},Modal:{okText:"确定",cancelText:"取消",justOkText:"知道了"},Tour:{Next:"下一步",Previous:"上一步",Finish:"结束导览"},Popconfirm:{cancelText:"取消",okText:"确定"},Transfer:{titles:["",""],searchPlaceholder:"请输入搜索内容",itemUnit:"项",itemsUnit:"项",remove:"删除",selectCurrent:"全选当页",removeCurrent:"删除当页",selectAll:"全选所有",deselectAll:"取消全选",removeAll:"删除全部",selectInvert:"反选当页"},Upload:{uploading:"文件上传中",removeFile:"删除文件",uploadError:"上传错误",previewFile:"预览文件",downloadFile:"下载文件"},Empty:{description:"暂无数据"},Icon:{icon:"图标"},Text:{edit:"编辑",copy:"复制",copied:"复制成功",expand:"展开",collapse:"收起"},Carousel:{prevSlide:"上一张幻灯片",nextSlide:"下一张幻灯片"},Form:{optional:"(可选)",defaultValidateMessages:{default:"字段验证错误${label}",required:"请输入${label}",enum:"${label}必须是其中一个[${enum}]",whitespace:"${label}不能为空字符",date:{format:"${label}日期格式无效",parse:"${label}不能转换为日期",invalid:"${label}是一个无效日期"},types:{string:Ft,method:Ft,array:Ft,object:Ft,number:Ft,date:Ft,boolean:Ft,integer:Ft,float:Ft,regexp:Ft,email:Ft,url:Ft,hex:Ft},string:{len:"${label}须为${len}个字符",min:"${label}最少${min}个字符",max:"${label}最多${max}个字符",range:"${label}须在${min}-${max}字符之间"},number:{len:"${label}必须等于${len}",min:"${label}最小值为${min}",max:"${label}最大值为${max}",range:"${label}须在${min}-${max}之间"},array:{len:"须为${len}个${label}",min:"最少${min}个${label}",max:"最多${max}个${label}",range:"${label}数量须在${min}-${max}之间"},pattern:{mismatch:"${label}与模式不匹配${pattern}"}}},QRCode:{expired:"二维码过期",refresh:"点击刷新",scanned:"已扫描"},ColorPicker:{presetEmpty:"暂无",transparent:"无色",singleColor:"单色",gradientColor:"渐变色"}};var _s={exports:{}},qm=_s.exports,el;function Gm(){return el||(el=1,(function(e,t){(function(n,r){e.exports=r(Qc())})(qm,(function(n){function r(o){return o&&typeof o=="object"&&"default"in o?o:{default:o}}var a=r(n),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(o,l){return l==="W"?o+"周":o+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(o,l){var u=100*o+l;return u<600?"凌晨":u<900?"早上":u<1100?"上午":u<1300?"中午":u<1800?"下午":"晚上"}};return a.default.locale(i,null,!0),i}))})(_s)),_s.exports}Gm();var gs={exports:{}},_a={};/**
20
20
  * @license React
21
21
  * use-sync-external-store-shim.production.js
22
22
  *
@@ -32,31 +32,31 @@
32
32
  *
33
33
  * This source code is licensed under the MIT license found in the
34
34
  * LICENSE file in the root directory of this source tree.
35
- */var nl;function Jm(){return nl||(nl=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}function t(p,S){g||a.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=S();if(!f){var w=S();i(y,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}w=o({inst:{value:y,getSnapshot:S}});var v=w[0].inst,x=w[1];return u(function(){v.value=y,v.getSnapshot=S,n(v)&&x({inst:v})},[p,y,S]),l(function(){return n(v)&&x({inst:v}),p(function(){n(v)&&x({inst:v})})},[p]),m(y),y}function n(p){var S=p.getSnapshot;p=p.value;try{var y=S();return!i(p,y)}catch{return!0}}function r(p,S){return S()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=d,i=typeof Object.is=="function"?Object.is:e,o=a.useState,l=a.useEffect,u=a.useLayoutEffect,m=a.useDebugValue,g=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;za.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),za}var rl;function Xm(){return rl||(rl=1,process.env.NODE_ENV==="production"?gs.exports=Zm():gs.exports=Jm()),gs.exports}var sl=Xm(),al=Object.prototype.hasOwnProperty;function Ci(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ci(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(al.call(e,n)&&++r&&!al.call(t,n)||!(n in t)||!Ci(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Ru=0,Iu=1,Mu=2,il=3,Au=4,Wt=new WeakMap,an=()=>{},et=an(),Xs=Object,Me=e=>e===et,Yt=e=>typeof e=="function",qt=(e,t)=>({...e,...t}),wi=e=>Yt(e.then),Ba={},ps={},co="undefined",Qr=typeof window!=co,ji=typeof document!=co,Qm=Qr&&"Deno"in window,eh=()=>Qr&&typeof window.requestAnimationFrame!=co,ku=(e,t)=>{const n=Wt.get(e);return[()=>!Me(t)&&e.get(t)||Ba,r=>{if(!Me(t)){const a=e.get(t);t in ps||(ps[t]=a),n[5](t,qt(a,r),a||Ba)}},n[6],()=>!Me(t)&&t in ps?ps[t]:!Me(t)&&e.get(t)||Ba]};let vi=!0;const th=()=>vi,[Ti,Fi]=Qr&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[an,an],nh=()=>{const e=ji&&document.visibilityState;return Me(e)||e!=="hidden"},rh=e=>(ji&&document.addEventListener("visibilitychange",e),Ti("focus",e),()=>{ji&&document.removeEventListener("visibilitychange",e),Fi("focus",e)}),sh=e=>{const t=()=>{vi=!0,e()},n=()=>{vi=!1};return Ti("online",t),Ti("offline",n),()=>{Fi("online",t),Fi("offline",n)}},ah={isOnline:th,isVisible:nh},ih={initFocus:rh,initReconnect:sh},ol=!d.useId,On=!Qr||Qm,oh=e=>eh()?window.requestAnimationFrame(e):setTimeout(e,1),rr=On?d.useEffect:d.useLayoutEffect,Va=typeof navigator<"u"&&navigator.connection,ll=!On&&Va&&(["slow-2g","2g"].includes(Va.effectiveType)||Va.saveData),ys=new WeakMap,lh=e=>Xs.prototype.toString.call(e),Ha=(e,t)=>e===`[object ${t}]`;let ch=0;const $i=e=>{const t=typeof e,n=lh(e),r=Ha(n,"Date"),a=Ha(n,"RegExp"),i=Ha(n,"Object");let o,l;if(Xs(e)===e&&!r&&!a){if(o=ys.get(e),o)return o;if(o=++ch+"~",ys.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=$i(e[l])+",";ys.set(e,o)}if(i){o="#";const u=Xs.keys(e).sort();for(;!Me(l=u.pop());)Me(e[l])||(o+=l+":"+$i(e[l])+",");ys.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},uo=e=>{if(Yt(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?$i(e):"",[e,t]};let uh=0;const Qs=()=>++uh;async function Ou(...e){const[t,n,r,a]=e,i=qt({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const l=i.rollbackOnError;let u=i.optimisticData;const m=h=>typeof l=="function"?l(h):l!==!1,g=i.throwOnError;if(Yt(n)){const h=n,p=[],S=t.keys();for(const y of S)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&p.push(y);return Promise.all(p.map(f))}return f(n);async function f(h){const[p]=uo(h);if(!p)return;const[S,y]=ku(t,p),[w,v,x,C]=Wt.get(t),j=()=>{const A=w[p];return(Yt(i.revalidate)?i.revalidate(S().data,h):i.revalidate!==!1)&&(delete x[p],delete C[p],A&&A[0])?A[0](Mu).then(()=>S().data):S().data};if(e.length<3)return j();let b=r,T,$=!1;const E=Qs();v[p]=[E,0];const R=!Me(u),I=S(),M=I.data,Y=I._c,U=Me(Y)?M:Y;if(R&&(u=Yt(u)?u(U,M):u,y({data:u,_c:U})),Yt(b))try{b=b(U)}catch(A){T=A,$=!0}if(b&&wi(b))if(b=await b.catch(A=>{T=A,$=!0}),E!==v[p][0]){if($)throw T;return b}else $&&R&&m(T)&&(o=!0,y({data:U,_c:et}));if(o&&!$)if(Yt(o)){const A=o(b,U);y({data:A,error:et,_c:et})}else y({data:b,error:et,_c:et});if(v[p][1]=Qs(),Promise.resolve(j()).then(()=>{y({_c:et})}),$){if(g)throw T;return}return b}}const cl=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Du=(e,t)=>{if(!Wt.has(e)){const r=qt(ih,t),a=Object.create(null),i=Ou.bind(et,e);let o=an;const l=Object.create(null),u=(h,p)=>{const S=l[h]||[];return l[h]=S,S.push(p),()=>{const y=S.indexOf(p);y>=0&&(S[y]=S[S.length-1],S.pop())}},m=(h,p,S)=>{e.set(h,p);const y=l[h];if(y)for(const w of y)w(p,S)},g=h=>{const p=Wt.get(e),[,S,y,w]=p,v=Qs();p[8]++;for(const j in y)delete y[j];for(const j in w)delete w[j];for(const j in S)S[j]=[v,v];const x={};for(const j of[...e.keys()]){const b=e.get(j);e.delete(j);const T=l[j];if(T)for(const $ of T)$(x,b)}const C=!h||h.revalidate!==!1;for(const j in a){const b=a[j];for(let T=0;T<b.length;T++)b[T](Au,{revalidate:C&&!T})}},f=()=>{if(!Wt.has(e)&&(Wt.set(e,[a,Object.create(null),Object.create(null),Object.create(null),i,m,u,g,0]),!On)){const h=r.initFocus(setTimeout.bind(et,cl.bind(et,a,Ru))),p=r.initReconnect(setTimeout.bind(et,cl.bind(et,a,Iu)));o=()=>{h&&h(),p&&p(),Wt.delete(e)}}};return f(),[e,i,f,o,g]}const n=Wt.get(e);return[e,n[4],et,et,n[7]]},dh=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Me(i)&&o>i||setTimeout(r,l,a)},fh=Ci,[fo,mh,,,hh]=Du(new Map),Pu=qt({onLoadingSlow:an,onSuccess:an,onError:an,onErrorRetry:dh,onDiscarded:an,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ll?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ll?5e3:3e3,compare:fh,isPaused:()=>!1,cache:fo,mutate:mh,unload:hh,fallback:{}},ah),Nu=(e,t)=>{const n=qt(e,t);if(t){const{use:r,fallback:a,cacheData:i}=e,{use:o,fallback:l,cacheData:u}=t;r&&o&&(n.use=r.concat(o)),a&&l&&(n.fallback=qt(a,l)),i&&u&&(n.cacheData=qt(i,u))}return n},Ei=d.createContext({}),gh=e=>{const{value:t}=e,n=d.useContext(Ei),r=Yt(t),a=d.useMemo(()=>r?t(n):t,[r,n,t]),i=d.useMemo(()=>r?a:Nu(n,a),[r,n,a]),o=a&&a.provider,l=d.useRef(et);o&&!l.current&&(l.current=Du(o(i.cache||fo),a));const u=l.current;return u&&(i.cache=u[0],i.mutate=u[1],i.unload=u[4]),rr(()=>{if(u)return u[2]&&u[2](),u[3]},[]),d.createElement(Ei.Provider,qt(e,{value:i}))},ph="$inf$",Lu=Qr&&window.__SWR_DEVTOOLS_USE__,yh=Lu?window.__SWR_DEVTOOLS_USE__:[],xh=()=>{Lu&&(window.__SWR_DEVTOOLS_REACT__=d)},bh=e=>Yt(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_u=()=>{const e=d.useContext(Ei);return d.useMemo(()=>qt(Pu,e),[e])},Sh=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=uo(t),[,,,l]=Wt.get(fo);if(o.startsWith(ph))return n(...i);const u=l[o];return Me(u)?n(...i):(delete l[o],u)}),r),Ch=yh.concat(Sh),wh=e=>function(...n){const r=_u(),[a,i,o]=bh(n),l=Nu(r,o);let u=e;const{use:m}=l,g=(m||[]).concat(Ch);for(let f=g.length;f--;)u=g[f](u);return u(a,i||l.fetcher||null,l)},jh=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};xh();const xs=d.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ya={dedupe:!0},ul=(e,t,n)=>{var r;return t?((r=e.get(t))==null?void 0:r.has(n))===!0:!1},Ua=(e,t,n)=>{if(!t)return;let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)},vh=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{const a=i=>{n()&&Me(t())&&r(i)};Promise.resolve(e).then(i=>{a({data:i,error:et})},i=>{a({error:i})})},ea=Promise.resolve(et);ea.status="fulfilled";ea.value=et;const Th=()=>an,Fh=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:f,keepPreviousData:h,strictServerPrefetchWarning:p}=n,[S,y,w,v]=Wt.get(r),[x,C]=uo(e),j=d.useRef(!1),b=d.useRef(!1),T=d.useRef(x),$=d.useRef(t),E=d.useRef(n),R=()=>E.current,I=()=>R().isVisible()&&R().isOnline(),[M,Y,U,A]=ku(r,x),k=d.useRef({}).current,F=Me(o)?Me(n.fallback)?et:n.fallback[x]:o,D=n.cacheData,O=x?D==null?void 0:D[x]:et,B=x?v[x]:et,q=Me(B)&&!Me(O),z=q?O:B,V=(_,J)=>{for(const le in k){const Se=le;if(Se==="data"){if(!a(_[Se],J[Se])&&(!Me(_[Se])||!a(ae,J[Se])))return!1}else if(J[Se]!==_[Se])return!1}return!0},Z=!j.current,G=d.useMemo(()=>{const _=M(),J=A(),le=Ie=>{const De=qt(Ie);return delete De._k,(()=>{if(!x||!t||R().isPaused())return!1;if(Z&&!Me(l))return l;const ke=Me(F)?De.data:F;return i&&q&&Me(ke)?!1:Me(ke)||u})()?{isValidating:!0,isLoading:!0,...De}:De},Se=le(_),Ee=_===J?Se:le(J);let Fe=Se;return[()=>{const Ie=le(M());return V(Ie,Fe)?(Fe.data=Ie.data,Fe.isLoading=Ie.isLoading,Fe.isValidating=Ie.isValidating,Fe.error=Ie.error,Fe):(Fe=Ie,Ie)},()=>Ee]},[r,x]),H=sl.useSyncExternalStore(d.useCallback(_=>U(x,(J,le)=>{V(le,J)||_()}),[r,x]),G[0],G[1]),L=S[x]&&S[x].length>0,K=H.data;let P=Me(K)?F&&wi(F)?xs(F):F:K;const W=H.error,te=d.useRef(P),re=d.useRef(et);let X=re.current;X||(X=new WeakMap,re.current=X);const se=d.useRef(null);let ae=h?Me(K)?Me(te.current)?P:te.current:K:P;const ue=x&&Me(P),pe=d.useRef(null);!On&&sl.useSyncExternalStore(Th,()=>(pe.current=!1,pe),()=>(pe.current=!0,pe));const me=pe.current;p&&me&&!i&&ue&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const fe=!x||!t||R().isPaused()||L&&!Me(W)?!1:Z&&!Me(l)?l:i&&q&&ue?!1:i?Me(P)?!1:u:Me(P)||u,ye=Z&&fe,Te=Me(H.isValidating)?ye:H.isValidating,Oe=Me(H.isLoading)?ye:H.isLoading,Ae=d.useCallback(async _=>{const J=$.current;if(!x||!J||b.current||R().isPaused())return!1;let le,Se,Ee=!0;const Fe=_||{},Ie=!w[x]||!Fe.dedupe,De=q&&!ul(X,D,x)&&!Me(z)&&Me(M().data),ve=()=>ol?!b.current&&x===T.current&&j.current:x===T.current,ke={isValidating:!1,isLoading:!1},Le=()=>{Y(ke)},lt=()=>{const ne=w[x];ne&&ne[1]===Se&&delete w[x]},nt={isValidating:!0};Me(M().data)&&(nt.isLoading=!0);try{if(Ie&&(Y(nt),n.loadingTimeout&&Me(M().data)&&setTimeout(()=>{Ee&&ve()&&R().onLoadingSlow(x,n)},n.loadingTimeout),De&&Ua(X,D,x),w[x]=[De?z:J(C),Qs()],De&&v[x]&&delete v[x]),[le,Se]=w[x],le=await le,Ie&&setTimeout(lt,n.dedupingInterval),!w[x]||w[x][1]!==Se)return Ie&&ve()&&R().onDiscarded(x),!1;ke.error=et;const ne=y[x];if(!Me(ne)&&(Se<=ne[0]||Se<=ne[1]||ne[1]===0))return Le(),Ie&&ve()&&R().onDiscarded(x),!1;const Q=M().data;ke.data=a(Q,le)?Q:le,Ie&&ve()&&R().onSuccess(le,x,n)}catch(ne){lt();const Q=R(),{shouldRetryOnError:he}=Q;Q.isPaused()||(ke.error=ne,Ie&&ve()&&(Q.onError(ne,x,Q),(he===!0||Yt(he)&&he(ne))&&(!R().revalidateOnFocus||!R().revalidateOnReconnect||I())&&Q.onErrorRetry(ne,x,Q,Ce=>{const Je=S[x];Je&&Je[0]&&Je[0](il,Ce)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ee=!1,Le(),!0},[x,r]),ze=d.useCallback((..._)=>Ou(r,T.current,..._),[]);if(rr(()=>{const _=se.current;_&&(se.current=null,Ua(X,_.cacheData,_.key),Me(M().data)&&Y({data:_.data,error:et,_k:_._k}),v[_.key]&&delete v[_.key])}),rr(()=>{$.current=t,E.current=n,Me(K)||(te.current=K)}),rr(()=>{if(t||!q||Me(z)||ul(X,D,x)||!Me(M().data))return;Ua(X,D,x);const _=y[x];vh({value:z,getCacheData:()=>M().data,canCommit:()=>!b.current&&x===T.current&&y[x]===_,setCache:J=>Y({...J,_k:C})})}),rr(()=>{if(!x)return;const _=Ae.bind(et,Ya);let J=0;R().revalidateOnFocus&&(J=Date.now()+R().focusThrottleInterval);const Se=jh(x,S,(Ee,Fe={})=>{if(Ee==Ru){const Ie=Date.now();R().revalidateOnFocus&&Ie>J&&I()&&(J=Ie+R().focusThrottleInterval,_())}else if(Ee==Iu)R().revalidateOnReconnect&&I()&&_();else{if(Ee==Mu)return Ae();if(Ee==il)return Ae(Fe);if(Ee==Au&&(te.current=et,Fe.revalidate))return Ae()}});return b.current=!1,T.current=x,j.current=!0,Y({_k:C}),fe&&(w[x]||(Me(P)||On?_():oh(_))),()=>{b.current=!0,Se()}},[x]),rr(()=>{let _;function J(){const Se=Yt(m)?m(M().data):m;Se&&_!==-1&&(_=setTimeout(le,Se))}function le(){!M().error&&(g||R().isVisible())&&(f||R().isOnline())?Ae(Ya).then(J):J()}return J(),()=>{_&&(clearTimeout(_),_=-1)}},[m,g,f,x]),d.useDebugValue(ae),i){if(!ol&&On&&ue&&Me(z))throw new Error("Fallback data is required when using Suspense in SSR.");ue&&($.current=t,E.current=n,b.current=!1);const _=!Me(z)&&ue;let J=et;if(_&&q)J=z&&wi(z)?xs(z):z,P=J,ae=J,On||(se.current={data:J,_k:C,key:x,cacheData:D});else{const Se=_?ze(z):ea;xs(Se)}if(!Me(W)&&ue)throw W;const le=ue&&Me(J)?Ae(Ya):ea;!Me(ae)&&ue&&(le.status="fulfilled",le.value=!0),xs(le)}return{mutate:ze,get data(){return k.data=!0,ae},get error(){return k.error=!0,W},get isValidating(){return k.isValidating=!0,Te},get isLoading(){return k.isLoading=!0,Oe}}},$h=Xs.defineProperty(gh,"defaultValue",{value:Pu}),zu=wh(Fh),Eh={moneySymbol:"$",form:{lightFilter:{more:"المزيد",clear:"نظف",confirm:"تأكيد",itemUnit:"عناصر"}},tableForm:{search:"ابحث",reset:"إعادة تعيين",submit:"ارسال",collapsed:"مُقلص",expand:"مُوسع",inputPlaceholder:"الرجاء الإدخال",selectPlaceholder:"الرجاء الإختيار"},alert:{clear:"نظف",selected:"محدد",item:"عنصر"},pagination:{total:{range:" ",total:"من",item:"عناصر"}},tableToolBar:{leftPin:"ثبت على اليسار",rightPin:"ثبت على اليمين",noPin:"الغاء التثبيت",leftFixedTitle:"لصق على اليسار",rightFixedTitle:"لصق على اليمين",noFixedTitle:"إلغاء الإلصاق",reset:"إعادة تعيين",columnDisplay:"الأعمدة المعروضة",columnSetting:"الإعدادات",fullScreen:"وضع كامل الشاشة",exitFullScreen:"الخروج من وضع كامل الشاشة",reload:"تحديث",density:"الكثافة",densityDefault:"افتراضي",densityLarger:"أكبر",densityMiddle:"وسط",densitySmall:"مدمج"},stepsForm:{next:"التالي",prev:"السابق",submit:"أنهى"},loginForm:{submitText:"تسجيل الدخول"},editableTable:{action:{save:"أنقذ",cancel:"إلغاء الأمر",delete:"حذف",add:"إضافة صف من البيانات"}},switch:{open:"مفتوح",close:"غلق"}},Rh={moneySymbol:"€",form:{lightFilter:{more:"Més",clear:"Netejar",confirm:"Confirmar",itemUnit:"Elements"}},tableForm:{search:"Cercar",reset:"Netejar",submit:"Enviar",collapsed:"Expandir",expand:"Col·lapsar",inputPlaceholder:"Introduïu valor",selectPlaceholder:"Seleccioneu valor"},alert:{clear:"Netejar",selected:"Seleccionat",item:"Article"},pagination:{total:{range:" ",total:"de",item:"articles"}},tableToolBar:{leftPin:"Pin a l'esquerra",rightPin:"Pin a la dreta",noPin:"Sense Pin",leftFixedTitle:"Fixat a l'esquerra",rightFixedTitle:"Fixat a la dreta",noFixedTitle:"Sense fixar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuració",fullScreen:"Pantalla Completa",exitFullScreen:"Sortir Pantalla Completa",reload:"Refrescar",density:"Densitat",densityDefault:"Per Defecte",densityLarger:"Llarg",densityMiddle:"Mitjà",densitySmall:"Compacte"},stepsForm:{next:"Següent",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Cancel·lar",delete:"Eliminar",add:"afegir una fila de dades"}},switch:{open:"obert",close:"tancat"}},Ih={moneySymbol:"Kč",deleteThisLine:"Smazat tento řádek",copyThisLine:"Kopírovat tento řádek",form:{lightFilter:{more:"Víc",clear:"Vymazat",confirm:"Potvrdit",itemUnit:"Položky"}},tableForm:{search:"Hledat",reset:"Resetovat",submit:"Odeslat",collapsed:"Zvětšit",expand:"Zmenšit",inputPlaceholder:"Zadejte prosím",selectPlaceholder:"Vyberte prosím"},alert:{clear:"Vymazat",selected:"Vybráno",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položek"}},tableToolBar:{leftPin:"Připnout doleva",rightPin:"Připnout doprava",noPin:"Odepnuto",leftFixedTitle:"Fixováno nalevo",rightFixedTitle:"Fixováno napravo",noFixedTitle:"Nefixováno",reset:"Resetovat",columnDisplay:"Zobrazení sloupců",columnSetting:"Nastavení",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončit celou obrazovku",reload:"Obnovit",density:"Hustota",densityDefault:"Výchozí",densityLarger:"Větší",densityMiddle:"Střední",densitySmall:"Kompaktní"},stepsForm:{next:"Další",prev:"Předchozí",submit:"Dokončit"},loginForm:{submitText:"Přihlásit se"},editableTable:{onlyOneLineEditor:"Upravit lze pouze jeden řádek",action:{save:"Uložit",cancel:"Zrušit",delete:"Vymazat",add:"Přidat řádek"}},switch:{open:"Otevřít",close:"Zavřít"}},Mh={moneySymbol:"€",form:{lightFilter:{more:"Mehr",clear:"Zurücksetzen",confirm:"Bestätigen",itemUnit:"Einträge"}},tableForm:{search:"Suchen",reset:"Zurücksetzen",submit:"Absenden",collapsed:"Zeige mehr",expand:"Zeige weniger",inputPlaceholder:"Bitte eingeben",selectPlaceholder:"Bitte auswählen"},alert:{clear:"Zurücksetzen",selected:"Ausgewählt",item:"Eintrag"},pagination:{total:{range:" ",total:"von",item:"Einträgen"}},tableToolBar:{leftPin:"Links anheften",rightPin:"Rechts anheften",noPin:"Nicht angeheftet",leftFixedTitle:"Links fixiert",rightFixedTitle:"Rechts fixiert",noFixedTitle:"Nicht fixiert",reset:"Zurücksetzen",columnDisplay:"Angezeigte Reihen",columnSetting:"Einstellungen",fullScreen:"Vollbild",exitFullScreen:"Vollbild verlassen",reload:"Aktualisieren",density:"Abstand",densityDefault:"Standard",densityLarger:"Größer",densityMiddle:"Mittel",densitySmall:"Kompakt"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Anmelden"},editableTable:{action:{save:"Retten",cancel:"Abbrechen",delete:"Löschen",add:"Hinzufügen einer Datenzeile"}},switch:{open:"offen",close:"schließen"}},Ah={moneySymbol:"£",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},kh={moneySymbol:"$",deleteThisLine:"Delete this line",copyThisLine:"Copy this line",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},Oh={moneySymbol:"€",form:{lightFilter:{more:"Más",clear:"Limpiar",confirm:"Confirmar",itemUnit:"artículos"}},tableForm:{search:"Buscar",reset:"Limpiar",submit:"Submit",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Ingrese valor",selectPlaceholder:"Seleccione valor"},alert:{clear:"Limpiar",selected:"Seleccionado",item:"Articulo"},pagination:{total:{range:" ",total:"de",item:"artículos"}},tableToolBar:{leftPin:"Pin a la izquierda",rightPin:"Pin a la derecha",noPin:"Sin Pin",leftFixedTitle:"Fijado a la izquierda",rightFixedTitle:"Fijado a la derecha",noFixedTitle:"Sin Fijar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuración",fullScreen:"Pantalla Completa",exitFullScreen:"Salir Pantalla Completa",reload:"Refrescar",density:"Densidad",densityDefault:"Por Defecto",densityLarger:"Largo",densityMiddle:"Medio",densitySmall:"Compacto"},stepsForm:{next:"Siguiente",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Descartar",delete:"Borrar",add:"añadir una fila de datos"}},switch:{open:"abrir",close:"cerrar"}},Dh={moneySymbol:"تومان",form:{lightFilter:{more:"بیشتر",clear:"پاک کردن",confirm:"تایید",itemUnit:"مورد"}},tableForm:{search:"جستجو",reset:"بازنشانی",submit:"تایید",collapsed:"نمایش بیشتر",expand:"نمایش کمتر",inputPlaceholder:"پیدا کنید",selectPlaceholder:"انتخاب کنید"},alert:{clear:"پاک سازی",selected:"انتخاب",item:"مورد"},pagination:{total:{range:" ",total:"از",item:"مورد"}},tableToolBar:{leftPin:"سنجاق به چپ",rightPin:"سنجاق به راست",noPin:"سنجاق نشده",leftFixedTitle:"ثابت شده در چپ",rightFixedTitle:"ثابت شده در راست",noFixedTitle:"شناور",reset:"بازنشانی",columnDisplay:"نمایش همه",columnSetting:"تنظیمات",fullScreen:"تمام صفحه",exitFullScreen:"خروج از حالت تمام صفحه",reload:"تازه سازی",density:"تراکم",densityDefault:"پیش فرض",densityLarger:"بزرگ",densityMiddle:"متوسط",densitySmall:"کوچک"},stepsForm:{next:"بعدی",prev:"قبلی",submit:"اتمام"},loginForm:{submitText:"ورود"},editableTable:{action:{save:"ذخیره",cancel:"لغو",delete:"حذف",add:"یک ردیف داده اضافه کنید"}},switch:{open:"باز",close:"نزدیک"}},Ph={moneySymbol:"€",form:{lightFilter:{more:"Plus",clear:"Effacer",confirm:"Confirmer",itemUnit:"Items"}},tableForm:{search:"Rechercher",reset:"Réinitialiser",submit:"Envoyer",collapsed:"Agrandir",expand:"Réduire",inputPlaceholder:"Entrer une valeur",selectPlaceholder:"Sélectionner une valeur"},alert:{clear:"Réinitialiser",selected:"Sélectionné",item:"Item"},pagination:{total:{range:" ",total:"sur",item:"éléments"}},tableToolBar:{leftPin:"Épingler à gauche",rightPin:"Épingler à gauche",noPin:"Sans épingle",leftFixedTitle:"Fixer à gauche",rightFixedTitle:"Fixer à droite",noFixedTitle:"Non fixé",reset:"Réinitialiser",columnDisplay:"Affichage colonne",columnSetting:"Réglages",fullScreen:"Plein écran",exitFullScreen:"Quitter Plein écran",reload:"Rafraichir",density:"Densité",densityDefault:"Par défaut",densityLarger:"Larger",densityMiddle:"Moyenne",densitySmall:"Compacte"},stepsForm:{next:"Suivante",prev:"Précédente",submit:"Finaliser"},loginForm:{submitText:"Se connecter"},editableTable:{action:{save:"Sauvegarder",cancel:"Annuler",delete:"Supprimer",add:"ajouter une ligne de données"}},switch:{open:"ouvert",close:"près"}},Nh={moneySymbol:"₪",deleteThisLine:"מחק שורה זו",copyThisLine:"העתק שורה זו",form:{lightFilter:{more:"יותר",clear:"נקה",confirm:"אישור",itemUnit:"פריטים"}},tableForm:{search:"חיפוש",reset:"איפוס",submit:"שלח",collapsed:"הרחב",expand:"כווץ",inputPlaceholder:"אנא הכנס",selectPlaceholder:"אנא בחר"},alert:{clear:"נקה",selected:"נבחר",item:"פריט"},pagination:{total:{range:" ",total:"מתוך",item:"פריטים"}},tableToolBar:{leftPin:"הצמד לשמאל",rightPin:"הצמד לימין",noPin:"לא מצורף",leftFixedTitle:"מוצמד לשמאל",rightFixedTitle:"מוצמד לימין",noFixedTitle:"לא מוצמד",reset:"איפוס",columnDisplay:"תצוגת עמודות",columnSetting:"הגדרות",fullScreen:"מסך מלא",exitFullScreen:"צא ממסך מלא",reload:"רענן",density:"רזולוציה",densityDefault:"ברירת מחדל",densityLarger:"גדול",densityMiddle:"בינוני",densitySmall:"קטן"},stepsForm:{next:"הבא",prev:"קודם",submit:"סיום"},loginForm:{submitText:"כניסה"},editableTable:{onlyOneLineEditor:"ניתן לערוך רק שורה אחת",action:{save:"שמור",cancel:"ביטול",delete:"מחיקה",add:"הוסף שורת נתונים"}},switch:{open:"פתח",close:"סגור"}},Lh={moneySymbol:"kn",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pretraži",reset:"Poništi",submit:"Potvrdi",collapsed:"Raširi",expand:"Skupi",inputPlaceholder:"Unesite",selectPlaceholder:"Odaberite"},alert:{clear:"Očisti",selected:"Odaberi",item:"stavke"},pagination:{total:{range:" ",total:"od",item:"stavke"}},tableToolBar:{leftPin:"Prikači lijevo",rightPin:"Prikači desno",noPin:"Bez prikačenja",leftFixedTitle:"Fiksiraj lijevo",rightFixedTitle:"Fiksiraj desno",noFixedTitle:"Bez fiksiranja",reset:"Resetiraj",columnDisplay:"Prikaz stupaca",columnSetting:"Postavke",fullScreen:"Puni zaslon",exitFullScreen:"Izađi iz punog zaslona",reload:"Ponovno učitaj",density:"Veličina",densityDefault:"Zadano",densityLarger:"Veliko",densityMiddle:"Srednje",densitySmall:"Malo"},stepsForm:{next:"Sljedeći",prev:"Prethodni",submit:"Kraj"},loginForm:{submitText:"Prijava"},editableTable:{action:{save:"Spremi",cancel:"Odustani",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"otvori",close:"zatvori"}},_h={moneySymbol:"RP",form:{lightFilter:{more:"Lebih",clear:"Hapus",confirm:"Konfirmasi",itemUnit:"Unit"}},tableForm:{search:"Cari",reset:"Atur ulang",submit:"Kirim",collapsed:"Lebih sedikit",expand:"Lebih banyak",inputPlaceholder:"Masukkan pencarian",selectPlaceholder:"Pilih"},alert:{clear:"Hapus",selected:"Dipilih",item:"Butir"},pagination:{total:{range:" ",total:"Dari",item:"Butir"}},tableToolBar:{leftPin:"Pin kiri",rightPin:"Pin kanan",noPin:"Tidak ada pin",leftFixedTitle:"Rata kiri",rightFixedTitle:"Rata kanan",noFixedTitle:"Tidak tetap",reset:"Atur ulang",columnDisplay:"Tampilan kolom",columnSetting:"Pengaturan",fullScreen:"Layar penuh",exitFullScreen:"Keluar layar penuh",reload:"Atur ulang",density:"Kerapatan",densityDefault:"Standar",densityLarger:"Lebih besar",densityMiddle:"Sedang",densitySmall:"Rapat"},stepsForm:{next:"Selanjutnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Login"},editableTable:{action:{save:"simpan",cancel:"batal",delete:"hapus",add:"Tambahkan baris data"}},switch:{open:"buka",close:"tutup"}},zh={moneySymbol:"€",form:{lightFilter:{more:"più",clear:"pulisci",confirm:"conferma",itemUnit:"elementi"}},tableForm:{search:"Filtra",reset:"Pulisci",submit:"Invia",collapsed:"Espandi",expand:"Contrai",inputPlaceholder:"Digita",selectPlaceholder:"Seleziona"},alert:{clear:"Rimuovi",selected:"Selezionati",item:"elementi"},pagination:{total:{range:" ",total:"di",item:"elementi"}},tableToolBar:{leftPin:"Fissa a sinistra",rightPin:"Fissa a destra",noPin:"Ripristina posizione",leftFixedTitle:"Fissato a sinistra",rightFixedTitle:"Fissato a destra",noFixedTitle:"Non fissato",reset:"Ripristina",columnDisplay:"Disposizione colonne",columnSetting:"Impostazioni",fullScreen:"Modalità schermo intero",exitFullScreen:"Esci da modalità schermo intero",reload:"Ricarica",density:"Grandezza tabella",densityDefault:"predefinito",densityLarger:"Grande",densityMiddle:"Media",densitySmall:"Compatta"},stepsForm:{next:"successivo",prev:"precedente",submit:"finisci"},loginForm:{submitText:"Accedi"},editableTable:{action:{save:"salva",cancel:"annulla",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"chiudi"}},Bh={moneySymbol:"¥",form:{lightFilter:{more:"更に",clear:"クリア",confirm:"確認",itemUnit:"アイテム"}},tableForm:{search:"検索",reset:"リセット",submit:"送信",collapsed:"拡大",expand:"折畳",inputPlaceholder:"入力してください",selectPlaceholder:"選択してください"},alert:{clear:"クリア",selected:"選択した",item:"アイテム"},pagination:{total:{range:"レコード",total:"/合計",item:" "}},tableToolBar:{leftPin:"左に固定",rightPin:"右に固定",noPin:"キャンセル",leftFixedTitle:"左に固定された項目",rightFixedTitle:"右に固定された項目",noFixedTitle:"固定されてない項目",reset:"リセット",columnDisplay:"表示列",columnSetting:"列表示設定",fullScreen:"フルスクリーン",exitFullScreen:"終了",reload:"更新",density:"行高",densityDefault:"デフォルト",densityLarger:"大",densityMiddle:"中",densitySmall:"小"},stepsForm:{next:"次へ",prev:"前へ",submit:"送信"},loginForm:{submitText:"ログイン"},editableTable:{action:{save:"保存",cancel:"キャンセル",delete:"削除",add:"追加"}},switch:{open:"開く",close:"閉じる"}},Vh={moneySymbol:"₩",form:{lightFilter:{more:"더보기",clear:"초기화",confirm:"확인",itemUnit:"건수"}},tableForm:{search:"조회",reset:"초기화",submit:"제출",collapsed:"확장",expand:"닫기",inputPlaceholder:"입력해 주세요",selectPlaceholder:"선택해 주세요"},alert:{clear:"취소",selected:"선택",item:"건"},pagination:{total:{range:" ",total:"/ 총",item:"건"}},tableToolBar:{leftPin:"왼쪽으로 핀",rightPin:"오른쪽으로 핀",noPin:"핀 제거",leftFixedTitle:"왼쪽으로 고정",rightFixedTitle:"오른쪽으로 고정",noFixedTitle:"비고정",reset:"초기화",columnDisplay:"컬럼 표시",columnSetting:"설정",fullScreen:"전체 화면",exitFullScreen:"전체 화면 취소",reload:"새로 고침",density:"여백",densityDefault:"기본",densityLarger:"많은 여백",densityMiddle:"중간 여백",densitySmall:"좁은 여백"},stepsForm:{next:"다음",prev:"이전",submit:"종료"},loginForm:{submitText:"로그인"},editableTable:{action:{save:"저장",cancel:"취소",delete:"삭제",add:"데이터 행 추가"}},switch:{open:"열",close:"가까 운"}},Hh={moneySymbol:"₮",form:{lightFilter:{more:"Илүү",clear:"Цэвэрлэх",confirm:"Баталгаажуулах",itemUnit:"Нэгжүүд"}},tableForm:{search:"Хайх",reset:"Шинэчлэх",submit:"Илгээх",collapsed:"Өргөтгөх",expand:"Хураах",inputPlaceholder:"Утга оруулна уу",selectPlaceholder:"Утга сонгоно уу"},alert:{clear:"Цэвэрлэх",selected:"Сонгогдсон",item:"Нэгж"},pagination:{total:{range:" ",total:"Нийт",item:"мөр"}},tableToolBar:{leftPin:"Зүүн тийш бэхлэх",rightPin:"Баруун тийш бэхлэх",noPin:"Бэхлэхгүй",leftFixedTitle:"Зүүн зэрэгцүүлэх",rightFixedTitle:"Баруун зэрэгцүүлэх",noFixedTitle:"Зэрэгцүүлэхгүй",reset:"Шинэчлэх",columnDisplay:"Баганаар харуулах",columnSetting:"Тохиргоо",fullScreen:"Бүтэн дэлгэцээр",exitFullScreen:"Бүтэн дэлгэц цуцлах",reload:"Шинэчлэх",density:"Хэмжээ",densityDefault:"Хэвийн",densityLarger:"Том",densityMiddle:"Дунд",densitySmall:"Жижиг"},stepsForm:{next:"Дараах",prev:"Өмнөх",submit:"Дуусгах"},loginForm:{submitText:"Нэвтрэх"},editableTable:{action:{save:"Хадгалах",cancel:"Цуцлах",delete:"Устгах",add:"Мөр нэмэх"}},switch:{open:"Нээх",close:"Хаах"}},Yh={moneySymbol:"RM",form:{lightFilter:{more:"Lebih banyak",clear:"Jelas",confirm:"Mengesahkan",itemUnit:"Item"}},tableForm:{search:"Cari",reset:"Menetapkan semula",submit:"Hantar",collapsed:"Kembang",expand:"Kuncup",inputPlaceholder:"Sila masuk",selectPlaceholder:"Sila pilih"},alert:{clear:"Padam",selected:"Dipilih",item:"Item"},pagination:{total:{range:" ",total:"daripada",item:"item"}},tableToolBar:{leftPin:"Pin ke kiri",rightPin:"Pin ke kanan",noPin:"Tidak pin",leftFixedTitle:"Tetap ke kiri",rightFixedTitle:"Tetap ke kanan",noFixedTitle:"Tidak Tetap",reset:"Menetapkan semula",columnDisplay:"Lajur",columnSetting:"Settings",fullScreen:"Full Screen",exitFullScreen:"Keluar Full Screen",reload:"Muat Semula",density:"Densiti",densityDefault:"Biasa",densityLarger:"Besar",densityMiddle:"Tengah",densitySmall:"Kecil"},stepsForm:{next:"Seterusnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Log Masuk"},editableTable:{action:{save:"Simpan",cancel:"Membatalkan",delete:"Menghapuskan",add:"tambah baris data"}},switch:{open:"Terbuka",close:"Tutup"}},Uh={moneySymbol:"€",deleteThisLine:"Verwijder deze regel",copyThisLine:"Kopieer deze regel",form:{lightFilter:{more:"Meer filters",clear:"Wissen",confirm:"Bevestigen",itemUnit:"item"}},tableForm:{search:"Zoeken",reset:"Resetten",submit:"Indienen",collapsed:"Uitvouwen",expand:"Inklappen",inputPlaceholder:"Voer in",selectPlaceholder:"Selecteer"},alert:{clear:"Selectie annuleren",selected:"Geselecteerd",item:"item"},pagination:{total:{range:"Van",total:"items/totaal",item:"items"}},tableToolBar:{leftPin:"Vastzetten aan begin",rightPin:"Vastzetten aan einde",noPin:"Niet vastzetten",leftFixedTitle:"Vastzetten aan de linkerkant",rightFixedTitle:"Vastzetten aan de rechterkant",noFixedTitle:"Niet vastzetten",reset:"Resetten",columnDisplay:"Kolomweergave",columnSetting:"Kolominstellingen",fullScreen:"Volledig scherm",exitFullScreen:"Verlaat volledig scherm",reload:"Vernieuwen",density:"Dichtheid",densityDefault:"Normaal",densityLarger:"Ruim",densityMiddle:"Gemiddeld",densitySmall:"Compact"},stepsForm:{next:"Volgende stap",prev:"Vorige stap",submit:"Indienen"},loginForm:{submitText:"Inloggen"},editableTable:{onlyOneLineEditor:"Slechts één regel tegelijk bewerken",action:{save:"Opslaan",cancel:"Annuleren",delete:"Verwijderen",add:"Een regel toevoegen"}},switch:{open:"Openen",close:"Sluiten"}},Kh={moneySymbol:"zł",form:{lightFilter:{more:"Więcej",clear:"Wyczyść",confirm:"Potwierdź",itemUnit:"Ilość"}},tableForm:{search:"Szukaj",reset:"Reset",submit:"Zatwierdź",collapsed:"Pokaż wiecej",expand:"Pokaż mniej",inputPlaceholder:"Proszę podać",selectPlaceholder:"Proszę wybrać"},alert:{clear:"Wyczyść",selected:"Wybrane",item:"Wpis"},pagination:{total:{range:" ",total:"z",item:"Wpisów"}},tableToolBar:{leftPin:"Przypnij do lewej",rightPin:"Przypnij do prawej",noPin:"Odepnij",leftFixedTitle:"Przypięte do lewej",rightFixedTitle:"Przypięte do prawej",noFixedTitle:"Nieprzypięte",reset:"Reset",columnDisplay:"Wyświetlane wiersze",columnSetting:"Ustawienia",fullScreen:"Pełen ekran",exitFullScreen:"Zamknij pełen ekran",reload:"Odśwież",density:"Odstęp",densityDefault:"Standard",densityLarger:"Wiekszy",densityMiddle:"Sredni",densitySmall:"Kompaktowy"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Zaloguj się"},editableTable:{action:{save:"Zapisać",cancel:"Anuluj",delete:"Usunąć",add:"dodawanie wiersza danych"}},switch:{open:"otwierać",close:"zamykać"}},Wh={moneySymbol:"R$",form:{lightFilter:{more:"Mais",clear:"Limpar",confirm:"Confirmar",itemUnit:"Itens"}},tableForm:{search:"Filtrar",reset:"Limpar",submit:"Confirmar",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Por favor insira",selectPlaceholder:"Por favor selecione"},alert:{clear:"Limpar",selected:"Selecionado(s)",item:"Item(s)"},pagination:{total:{range:" ",total:"de",item:"itens"}},tableToolBar:{leftPin:"Fixar à esquerda",rightPin:"Fixar à direita",noPin:"Desfixado",leftFixedTitle:"Fixado à esquerda",rightFixedTitle:"Fixado à direita",noFixedTitle:"Não fixado",reset:"Limpar",columnDisplay:"Mostrar Coluna",columnSetting:"Configurações",fullScreen:"Tela Cheia",exitFullScreen:"Sair da Tela Cheia",reload:"Atualizar",density:"Densidade",densityDefault:"Padrão",densityLarger:"Largo",densityMiddle:"Médio",densitySmall:"Compacto"},stepsForm:{next:"Próximo",prev:"Anterior",submit:"Enviar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Salvar",cancel:"Cancelar",delete:"Apagar",add:"adicionar uma linha de dados"}},switch:{open:"abrir",close:"fechar"}},qh={moneySymbol:"RON",deleteThisLine:"Șterge acest rând",copyThisLine:"Copiază acest rând",form:{lightFilter:{more:"Mai multe filtre",clear:"Curăță",confirm:"Confirmă",itemUnit:"elemente"}},tableForm:{search:"Caută",reset:"Resetează",submit:"Trimite",collapsed:"Extinde",expand:"Restrânge",inputPlaceholder:"Introduceți",selectPlaceholder:"Selectați"},alert:{clear:"Anulează selecția",selected:"Selectat",item:"elemente"},pagination:{total:{range:"De la",total:"elemente/total",item:"elemente"}},tableToolBar:{leftPin:"Fixează la început",rightPin:"Fixează la sfârșit",noPin:"Nu fixa",leftFixedTitle:"Fixează în stânga",rightFixedTitle:"Fixează în dreapta",noFixedTitle:"Nu fixa",reset:"Resetează",columnDisplay:"Afișare coloane",columnSetting:"Setări coloane",fullScreen:"Ecran complet",exitFullScreen:"Ieși din ecran complet",reload:"Reîncarcă",density:"Densitate",densityDefault:"Normal",densityLarger:"Larg",densityMiddle:"Mediu",densitySmall:"Compact"},stepsForm:{next:"Pasul următor",prev:"Pasul anterior",submit:"Trimite"},loginForm:{submitText:"Autentificare"},editableTable:{onlyOneLineEditor:"Se poate edita doar un rând simultan",action:{save:"Salvează",cancel:"Anulează",delete:"Șterge",add:"Adaugă un rând"}},switch:{open:"Deschide",close:"Închide"}},Gh={moneySymbol:"₽",form:{lightFilter:{more:"Еще",clear:"Очистить",confirm:"ОК",itemUnit:"Позиции"}},tableForm:{search:"Найти",reset:"Сброс",submit:"Отправить",collapsed:"Развернуть",expand:"Свернуть",inputPlaceholder:"Введите значение",selectPlaceholder:"Выберите значение"},alert:{clear:"Очистить",selected:"Выбрано",item:"элементов"},pagination:{total:{range:" ",total:"из",item:"элементов"}},tableToolBar:{leftPin:"Закрепить слева",rightPin:"Закрепить справа",noPin:"Открепить",leftFixedTitle:"Закреплено слева",rightFixedTitle:"Закреплено справа",noFixedTitle:"Не закреплено",reset:"Сброс",columnDisplay:"Отображение столбца",columnSetting:"Настройки",fullScreen:"Полный экран",exitFullScreen:"Выйти из полноэкранного режима",reload:"Обновить",density:"Размер",densityDefault:"По умолчанию",densityLarger:"Большой",densityMiddle:"Средний",densitySmall:"Сжатый"},stepsForm:{next:"Следующий",prev:"Предыдущий",submit:"Завершить"},loginForm:{submitText:"Вход"},editableTable:{action:{save:"Сохранить",cancel:"Отменить",delete:"Удалить",add:"добавить ряд данных"}},switch:{open:"Открытый чемпионат мира по теннису",close:"По адресу:"}},Zh={moneySymbol:"€",deleteThisLine:"Odstrániť tento riadok",copyThisLine:"Skopírujte tento riadok",form:{lightFilter:{more:"Viac",clear:"Vyčistiť",confirm:"Potvrďte",itemUnit:"Položky"}},tableForm:{search:"Vyhladať",reset:"Resetovať",submit:"Odoslať",collapsed:"Rozbaliť",expand:"Zbaliť",inputPlaceholder:"Prosím, zadajte",selectPlaceholder:"Prosím, vyberte"},alert:{clear:"Vyčistiť",selected:"Vybraný",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položiek"}},tableToolBar:{leftPin:"Pripnúť vľavo",rightPin:"Pripnúť vpravo",noPin:"Odopnuté",leftFixedTitle:"Fixované na ľavo",rightFixedTitle:"Fixované na pravo",noFixedTitle:"Nefixované",reset:"Resetovať",columnDisplay:"Zobrazenie stĺpcov",columnSetting:"Nastavenia",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončiť celú obrazovku",reload:"Obnoviť",density:"Hustota",densityDefault:"Predvolené",densityLarger:"Väčšie",densityMiddle:"Stredné",densitySmall:"Kompaktné"},stepsForm:{next:"Ďalšie",prev:"Predchádzajúce",submit:"Potvrdiť"},loginForm:{submitText:"Prihlásiť sa"},editableTable:{onlyOneLineEditor:"Upravovať možno iba jeden riadok",action:{save:"Uložiť",cancel:"Zrušiť",delete:"Odstrániť",add:"pridať riadok údajov"}},switch:{open:"otvoriť",close:"zavrieť"}},Jh={moneySymbol:"RSD",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pronađi",reset:"Resetuj",submit:"Pošalji",collapsed:"Proširi",expand:"Skupi",inputPlaceholder:"Molimo unesite",selectPlaceholder:"Molimo odaberite"},alert:{clear:"Očisti",selected:"Odabrano",item:"Stavka"},pagination:{total:{range:" ",total:"od",item:"stavki"}},tableToolBar:{leftPin:"Zakači levo",rightPin:"Zakači desno",noPin:"Nije zakačeno",leftFixedTitle:"Fiksirano levo",rightFixedTitle:"Fiksirano desno",noFixedTitle:"Nije fiksirano",reset:"Resetuj",columnDisplay:"Prikaz kolona",columnSetting:"Podešavanja",fullScreen:"Pun ekran",exitFullScreen:"Zatvori pun ekran",reload:"Osveži",density:"Veličina",densityDefault:"Podrazumevana",densityLarger:"Veća",densityMiddle:"Srednja",densitySmall:"Kompaktna"},stepsForm:{next:"Dalje",prev:"Nazad",submit:"Gotovo"},loginForm:{submitText:"Prijavi se"},editableTable:{action:{save:"Sačuvaj",cancel:"Poništi",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"Отворите",close:"Затворите"}},Xh={moneySymbol:"SEK",deleteThisLine:"Radera denna rad",copyThisLine:"Kopiera denna rad",form:{lightFilter:{more:"Fler filter",clear:"Rensa",confirm:"Bekräfta",itemUnit:"objekt"}},tableForm:{search:"Sök",reset:"Återställ",submit:"Skicka",collapsed:"Expandera",expand:"Fäll ihop",inputPlaceholder:"Vänligen ange",selectPlaceholder:"Vänligen välj"},alert:{clear:"Avbryt val",selected:"Vald",item:"objekt"},pagination:{total:{range:"Från",total:"objekt/totalt",item:"objekt"}},tableToolBar:{leftPin:"Fäst till vänster",rightPin:"Fäst till höger",noPin:"Inte fäst",leftFixedTitle:"Fäst till vänster",rightFixedTitle:"Fäst till höger",noFixedTitle:"Inte fäst",reset:"Återställ",columnDisplay:"Kolumnvisning",columnSetting:"Kolumninställningar",fullScreen:"Fullskärm",exitFullScreen:"Avsluta fullskärm",reload:"Ladda om",density:"Täthet",densityDefault:"Normal",densityLarger:"Lös",densityMiddle:"Medium",densitySmall:"Kompakt"},stepsForm:{next:"Nästa steg",prev:"Föregående steg",submit:"Skicka"},loginForm:{submitText:"Logga in"},editableTable:{onlyOneLineEditor:"Endast en rad kan redigeras åt gången",action:{save:"Spara",cancel:"Avbryt",delete:"Radera",add:"Lägg till en rad"}},switch:{open:"Öppna",close:"Stäng"}},Qh={moneySymbol:"฿",deleteThisLine:"ลบบรรทัดนี้",copyThisLine:"คัดลอกบรรทัดนี้",form:{lightFilter:{more:"มากกว่า",clear:"ชัดเจน",confirm:"ยืนยัน",itemUnit:"รายการ"}},tableForm:{search:"สอบถาม",reset:"รีเซ็ต",submit:"ส่ง",collapsed:"ขยาย",expand:"ทรุด",inputPlaceholder:"กรุณาป้อน",selectPlaceholder:"โปรดเลือก"},alert:{clear:"ชัดเจน",selected:"เลือกแล้ว",item:"รายการ"},pagination:{total:{range:" ",total:"ของ",item:"รายการ"}},tableToolBar:{leftPin:"ปักหมุดไปทางซ้าย",rightPin:"ปักหมุดไปทางขวา",noPin:"เลิกตรึงแล้ว",leftFixedTitle:"แก้ไขด้านซ้าย",rightFixedTitle:"แก้ไขด้านขวา",noFixedTitle:"ไม่คงที่",reset:"รีเซ็ต",columnDisplay:"การแสดงคอลัมน์",columnSetting:"การตั้งค่า",fullScreen:"เต็มจอ",exitFullScreen:"ออกจากโหมดเต็มหน้าจอ",reload:"รีเฟรช",density:"ความหนาแน่น",densityDefault:"ค่าเริ่มต้น",densityLarger:"ขนาดใหญ่ขึ้น",densityMiddle:"กลาง",densitySmall:"กะทัดรัด"},stepsForm:{next:"ถัดไป",prev:"ก่อนหน้า",submit:"เสร็จ"},loginForm:{submitText:"เข้าสู่ระบบ"},editableTable:{onlyOneLineEditor:"แก้ไขได้เพียงบรรทัดเดียวเท่านั้น",action:{save:"บันทึก",cancel:"ยกเลิก",delete:"ลบ",add:"เพิ่มแถวของข้อมูล"}},switch:{open:"เปิด",close:"ปิด"}},eg={moneySymbol:"₺",form:{lightFilter:{more:"Daha Fazla",clear:"Temizle",confirm:"Onayla",itemUnit:"Öğeler"}},tableForm:{search:"Filtrele",reset:"Sıfırla",submit:"Gönder",collapsed:"Daha fazla",expand:"Daha az",inputPlaceholder:"Filtrelemek için bir değer girin",selectPlaceholder:"Filtrelemek için bir değer seçin"},alert:{clear:"Temizle",selected:"Seçili",item:"Öğe"},pagination:{total:{range:" ",total:"Toplam",item:"Öğe"}},tableToolBar:{leftPin:"Sola sabitle",rightPin:"Sağa sabitle",noPin:"Sabitlemeyi kaldır",leftFixedTitle:"Sola sabitlendi",rightFixedTitle:"Sağa sabitlendi",noFixedTitle:"Sabitlenmedi",reset:"Sıfırla",columnDisplay:"Kolon Görünümü",columnSetting:"Ayarlar",fullScreen:"Tam Ekran",exitFullScreen:"Tam Ekrandan Çık",reload:"Yenile",density:"Kalınlık",densityDefault:"Varsayılan",densityLarger:"Büyük",densityMiddle:"Orta",densitySmall:"Küçük"},stepsForm:{next:"Sıradaki",prev:"Önceki",submit:"Gönder"},loginForm:{submitText:"Giriş Yap"},editableTable:{action:{save:"Kaydet",cancel:"Vazgeç",delete:"Sil",add:"foegje in rige gegevens ta"}},switch:{open:"açık",close:"kapatmak"}},tg={moneySymbol:"₴",deleteThisLine:"Видатили рядок",copyThisLine:"Скопіювати рядок",form:{lightFilter:{more:"Ще",clear:"Очистити",confirm:"Ок",itemUnit:"Позиції"}},tableForm:{search:"Пошук",reset:"Очистити",submit:"Відправити",collapsed:"Розгорнути",expand:"Згорнути",inputPlaceholder:"Введіть значення",selectPlaceholder:"Оберіть значення"},alert:{clear:"Очистити",selected:"Обрано",item:"елементів"},pagination:{total:{range:" ",total:"з",item:"елементів"}},tableToolBar:{leftPin:"Закріпити зліва",rightPin:"Закріпити справа",noPin:"Відкріпити",leftFixedTitle:"Закріплено зліва",rightFixedTitle:"Закріплено справа",noFixedTitle:"Не закріплено",reset:"Скинути",columnDisplay:"Відображення стовпців",columnSetting:"Налаштування",fullScreen:"Повноекранний режим",exitFullScreen:"Вийти з повноекранного режиму",reload:"Оновити",density:"Розмір",densityDefault:"За замовчуванням",densityLarger:"Великий",densityMiddle:"Середній",densitySmall:"Стислий"},stepsForm:{next:"Наступний",prev:"Попередній",submit:"Завершити"},loginForm:{submitText:"Вхіх"},editableTable:{onlyOneLineEditor:"Тільки один рядок може бути редагований одночасно",action:{save:"Зберегти",cancel:"Відмінити",delete:"Видалити",add:"додати рядок"}},switch:{open:"Відкрито",close:"Закрито"}},ng={moneySymbol:"UZS",form:{lightFilter:{more:"Yana",clear:"Tozalash",confirm:"OK",itemUnit:"Pozitsiyalar"}},tableForm:{search:"Qidirish",reset:"Qayta tiklash",submit:"Yuborish",collapsed:"Yig‘ish",expand:"Kengaytirish",inputPlaceholder:"Qiymatni kiriting",selectPlaceholder:"Qiymatni tanlang"},alert:{clear:"Tozalash",selected:"Tanlangan",item:"elementlar"},pagination:{total:{range:" ",total:"dan",item:"elementlar"}},tableToolBar:{leftPin:"Chapga mahkamlash",rightPin:"O‘ngga mahkamlash",noPin:"Mahkamlashni olib tashlash",leftFixedTitle:"Chapga mahkamlangan",rightFixedTitle:"O‘ngga mahkamlangan",noFixedTitle:"Mahkamlashsiz",reset:"Qayta tiklash",columnDisplay:"Ustunni ko‘rsatish",columnSetting:"Sozlamalar",fullScreen:"To‘liq ekran",exitFullScreen:"To‘liq ekrandan chiqish",reload:"Yangilash",density:"O‘lcham",densityDefault:"Standart",densityLarger:"Katta",densityMiddle:"O‘rtacha",densitySmall:"Kichik"},stepsForm:{next:"Keyingi",prev:"Oldingi",submit:"Tugatish"},loginForm:{submitText:"Kirish"},editableTable:{action:{save:"Saqlash",cancel:"Bekor qilish",delete:"O‘chirish",add:"maʼlumotlar qatorini qo‘shish"}},switch:{open:"Ochish",close:"Yopish"}},rg={moneySymbol:"₫",form:{lightFilter:{more:"Nhiều hơn",clear:"Trong",confirm:"Xác nhận",itemUnit:"Mục"}},tableForm:{search:"Tìm kiếm",reset:"Làm lại",submit:"Gửi đi",collapsed:"Mở rộng",expand:"Thu gọn",inputPlaceholder:"nhập dữ liệu",selectPlaceholder:"Vui lòng chọn"},alert:{clear:"Xóa",selected:"đã chọn",item:"mục"},pagination:{total:{range:" ",total:"trên",item:"mặt hàng"}},tableToolBar:{leftPin:"Ghim trái",rightPin:"Ghim phải",noPin:"Bỏ ghim",leftFixedTitle:"Cố định trái",rightFixedTitle:"Cố định phải",noFixedTitle:"Chưa cố định",reset:"Làm lại",columnDisplay:"Cột hiển thị",columnSetting:"Cấu hình",fullScreen:"Chế độ toàn màn hình",exitFullScreen:"Thoát chế độ toàn màn hình",reload:"Làm mới",density:"Mật độ hiển thị",densityDefault:"Mặc định",densityLarger:"Mặc định",densityMiddle:"Trung bình",densitySmall:"Chật"},stepsForm:{next:"Sau",prev:"Trước",submit:"Kết thúc"},loginForm:{submitText:"Đăng nhập"},editableTable:{action:{save:"Cứu",cancel:"Hủy",delete:"Xóa",add:"thêm một hàng dữ liệu"}},switch:{open:"mở",close:"đóng"}},sg={moneySymbol:"¥",deleteThisLine:"删除此项",copyThisLine:"复制此项",form:{lightFilter:{more:"更多筛选",clear:"清除",confirm:"确认",itemUnit:"项"}},tableForm:{search:"查询",reset:"重置",submit:"提交",collapsed:"展开",expand:"收起",inputPlaceholder:"请输入",selectPlaceholder:"请选择"},alert:{clear:"取消选择",selected:"已选择",item:"项"},pagination:{total:{range:"第",total:"条/总共",item:"条"}},tableToolBar:{leftPin:"固定在列首",rightPin:"固定在列尾",noPin:"不固定",leftFixedTitle:"固定在左侧",rightFixedTitle:"固定在右侧",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列设置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"宽松",densityMiddle:"中等",densitySmall:"紧凑"},stepsForm:{next:"下一步",prev:"上一步",submit:"提交"},loginForm:{submitText:"登录"},editableTable:{onlyOneLineEditor:"只能同时编辑一行",action:{save:"保存",cancel:"取消",delete:"删除",add:"添加一行数据"}},switch:{open:"打开",close:"关闭"}},ag={moneySymbol:"HK$",deleteThisLine:"刪除此項",copyThisLine:"複製此項",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"搜尋",reset:"重設",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選取",selected:"已選取",item:"項"},pagination:{total:{range:"第",total:"項/總共",item:"項"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重設",columnDisplay:"列顯示",columnSetting:"列設定",fullScreen:"全螢幕",exitFullScreen:"退出全螢幕",reload:"重新整理",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},ig={moneySymbol:"NT$",deleteThisLine:"刪除此项",copyThisLine:"複製此项",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"查詢",reset:"重置",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選擇",selected:"已選擇",item:"項"},pagination:{total:{range:"第",total:"條/總共",item:"條"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列設置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},Ve=(e,t)=>({getMessage:(n,r)=>{const a=Be(t,n.replace(/\[(\d+)\]/g,".$1").split("."))||"";if(a)return a;if(e.replace("_","-")==="zh-CN")return r;const o=zn["zh-CN"];return o?o.getMessage(n,r):r},locale:e}),og=Ve("mn_MN",Hh),lg=Ve("ar_EG",Eh),qr=Ve("zh_CN",sg),cg=Ve("en_US",kh),ug=Ve("en_GB",Ah),dg=Ve("vi_VN",rg),fg=Ve("it_IT",zh),mg=Ve("ja_JP",Bh),hg=Ve("es_ES",Oh),gg=Ve("ca_ES",Rh),pg=Ve("ru_RU",Gh),yg=Ve("sr_RS",Jh),xg=Ve("ms_MY",Yh),bg=Ve("zh_TW",ig),Sg=Ve("zh_HK",ag),Cg=Ve("fr_FR",Ph),wg=Ve("pt_BR",Wh),jg=Ve("ko_KR",Vh),vg=Ve("id_ID",_h),Tg=Ve("de_DE",Mh),Fg=Ve("fa_IR",Dh),$g=Ve("tr_TR",eg),Eg=Ve("pl_PL",Kh),Rg=Ve("hr_",Lh),Ig=Ve("th_TH",Qh),Mg=Ve("cs_cz",Ih),Ag=Ve("sk_SK",Zh),kg=Ve("he_IL",Nh),Og=Ve("uk_UA",tg),Dg=Ve("uz_UZ",ng),Pg=Ve("nl_NL",Uh),Ng=Ve("ro_RO",qh),Lg=Ve("sv_SE",Xh),zn={"mn-MN":og,"ar-EG":lg,"zh-CN":qr,"en-US":cg,"en-GB":ug,"vi-VN":dg,"it-IT":fg,"ja-JP":mg,"es-ES":hg,"ca-ES":gg,"ru-RU":pg,"sr-RS":yg,"ms-MY":xg,"zh-TW":bg,"zh-HK":Sg,"fr-FR":Cg,"pt-BR":wg,"ko-KR":jg,"id-ID":vg,"de-DE":Tg,"fa-IR":Fg,"tr-TR":$g,"pl-PL":Eg,"hr-HR":Rg,"th-TH":Ig,"cs-CZ":Mg,"sk-SK":Ag,"he-IL":kg,"uk-UA":Og,"uz-UZ":Dg,"nl-NL":Pg,"ro-RO":Ng,"sv-SE":Lg},_g=Object.keys(zn),Bu=e=>{const t=(e||"zh-CN").toLocaleLowerCase();return _g.find(n=>n.toLocaleLowerCase().includes(t))};function bt(e,t){zg(e)&&(e="100%");const n=Bg(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)}function bs(e){return Math.min(1,Math.max(0,e))}function zg(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Bg(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Vu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ss(e){return Number(e)<=1?`${Number(e)*100}%`:e}function Dn(e){return e.length===1?"0"+e:String(e)}function Vg(e,t,n){return{r:bt(e,255)*255,g:bt(t,255)*255,b:bt(n,255)*255}}function dl(e,t,n){e=bt(e,255),t=bt(t,255),n=bt(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0,o=0;const l=(r+a)/2;if(r===a)o=0,i=0;else{const u=r-a;switch(o=l>.5?u/(2-r-a):u/(r+a),r){case e:i=(t-n)/u+(t<n?6:0);break;case t:i=(n-e)/u+2;break;case n:i=(e-t)/u+4;break}i/=6}return{h:i,s:o,l}}function Ka(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Hg(e,t,n){let r,a,i;if(e=bt(e,360),t=bt(t,100),n=bt(n,100),t===0)a=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=Ka(l,o,e+1/3),a=Ka(l,o,e),i=Ka(l,o,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function fl(e,t,n){e=bt(e,255),t=bt(t,255),n=bt(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0;const o=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:u,v:o}}function Yg(e,t,n){e=bt(e,360)*6,t=bt(t,100),n=bt(n,100);const r=Math.floor(e),a=e-r,i=n*(1-t),o=n*(1-a*t),l=n*(1-(1-a)*t),u=r%6,m=[n,o,i,i,l,n][u],g=[l,n,n,o,i,i][u],f=[i,i,l,n,n,o][u];return{r:m*255,g:g*255,b:f*255}}function ml(e,t,n,r){const a=Dn(Math.round(e).toString(16)),i=Dn(Math.round(t).toString(16)),o=Dn(Math.round(n).toString(16));return r&&a.startsWith(a.charAt(1))&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))?a.charAt(0)+i.charAt(0)+o.charAt(0):a+i+o}function Ug(e,t,n,r,a){const i=Dn(Math.round(e).toString(16)),o=Dn(Math.round(t).toString(16)),l=Dn(Math.round(n).toString(16)),u=Dn(Wg(r));return a&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))&&l.startsWith(l.charAt(1))&&u.startsWith(u.charAt(1))?i.charAt(0)+o.charAt(0)+l.charAt(0)+u.charAt(0):i+o+l+u}function Kg(e,t,n,r){const a=e/100,i=t/100,o=n/100,l=r/100,u=255*(1-a)*(1-l),m=255*(1-i)*(1-l),g=255*(1-o)*(1-l);return{r:u,g:m,b:g}}function hl(e,t,n){let r=1-e/255,a=1-t/255,i=1-n/255,o=Math.min(r,a,i);return o===1?(r=0,a=0,i=0):(r=(r-o)/(1-o)*100,a=(a-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(a),y:Math.round(i),k:Math.round(o)}}function Wg(e){return Math.round(parseFloat(e)*255).toString(16)}function gl(e){return Et(e)/255}function Et(e){return parseInt(e,16)}function qg(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const Ri={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Gg(e){let t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,l=!1;return typeof e=="string"&&(e=Xg(e)),typeof e=="object"&&($t(e.r)&&$t(e.g)&&$t(e.b)?(t=Vg(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):$t(e.h)&&$t(e.s)&&$t(e.v)?(r=Ss(e.s),a=Ss(e.v),t=Yg(e.h,r,a),o=!0,l="hsv"):$t(e.h)&&$t(e.s)&&$t(e.l)?(r=Ss(e.s),i=Ss(e.l),t=Hg(e.h,r,i),o=!0,l="hsl"):$t(e.c)&&$t(e.m)&&$t(e.y)&&$t(e.k)&&(t=Kg(e.c,e.m,e.y,e.k),o=!0,l="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Vu(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const Zg="[-\\+]?\\d+%?",Jg="[-\\+]?\\d*\\.\\d+%?",Cn="(?:"+Jg+")|(?:"+Zg+")",Wa="[\\s|\\(]+("+Cn+")[,|\\s]+("+Cn+")[,|\\s]+("+Cn+")\\s*\\)?",Cs="[\\s|\\(]+("+Cn+")[,|\\s]+("+Cn+")[,|\\s]+("+Cn+")[,|\\s]+("+Cn+")\\s*\\)?",Rt={hex:/^[0-9a-fA-F]+$/,CSS_UNIT:new RegExp(Cn),rgb:new RegExp("rgb"+Wa),rgba:new RegExp("rgba"+Cs),hsl:new RegExp("hsl"+Wa),hsla:new RegExp("hsla"+Cs),hsv:new RegExp("hsv"+Wa),hsva:new RegExp("hsva"+Cs),cmyk:new RegExp("cmyk"+Cs),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Xg(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(Ri[e])e=Ri[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n;if(typeof e=="string"&&e.length<=9&&(e.startsWith("#")||Rt.hex.test(e))){if(n=Rt.hex8.exec(e),n)return{r:Et(n[1]),g:Et(n[2]),b:Et(n[3]),a:gl(n[4]),format:t?"name":"hex8"};if(n=Rt.hex6.exec(e),n)return{r:Et(n[1]),g:Et(n[2]),b:Et(n[3]),format:t?"name":"hex"};if(n=Rt.hex4.exec(e),n)return{r:Et(n[1]+n[1]),g:Et(n[2]+n[2]),b:Et(n[3]+n[3]),a:gl(n[4]+n[4]),format:t?"name":"hex8"};if(n=Rt.hex3.exec(e),n)return{r:Et(n[1]+n[1]),g:Et(n[2]+n[2]),b:Et(n[3]+n[3]),format:t?"name":"hex"}}return n=Rt.rgb.exec(e),n?{r:n[1],g:n[2],b:n[3]}:(n=Rt.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Rt.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Rt.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Rt.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Rt.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Rt.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function $t(e){return typeof e=="number"?!Number.isNaN(e):Rt.CSS_UNIT.test(e)}class ft{constructor(t="",n={}){if(t instanceof ft)return t;typeof t=="number"&&(t=qg(t)),this.originalInput=t;const r=Gg(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,r,a;const i=t.r/255,o=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a}getAlpha(){return this.a}setAlpha(t){return this.a=Vu(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=fl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=fl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${a}%)`:`hsva(${n}, ${r}%, ${a}%, ${this.roundA})`}toHsl(){const t=dl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=dl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${a}%)`:`hsla(${n}, ${r}%, ${a}%, ${this.roundA})`}toHex(t=!1){return ml(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return Ug(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(bt(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(bt(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...hl(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=hl(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+ml(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(Ri))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const a=this.a<1&&this.a>=0;return!n&&a&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),t==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new ft(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=bs(n.l),new ft(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new ft(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=bs(n.l),new ft(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=bs(n.s),new ft(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=bs(n.s),new ft(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new ft(n)}mix(t,n=50){const r=this.toRgb(),a=new ft(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new ft(o)}analogous(t=6,n=30){const r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(new ft(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new ft(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s:a}=n;let{v:i}=n;const o=[],l=1/t;for(;t--;)o.push(new ft({h:r,s:a,v:i})),i=(i+l)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new ft({h:(n+72)%360,s:t.s,l:t.l}),new ft({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new ft(t).toRgb(),a=n.a+r.a*(1-n.a);return new ft({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,a=[this],i=360/t;for(let o=1;o<t;o++)a.push(new ft({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new ft(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}const It=(e,t)=>new ft(e).setAlpha(t).toRgbString(),jn=c.theme,qa=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none","*, *::before, *::after":{boxSizing:"border-box"}}),Qg=e=>{let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},ep=e=>{try{return Qg(JSON.stringify(e))}catch{return""}};function tt(e,t){let{token:n={},hashed:r}=d.useContext(Xt);const{token:a,hashId:i,theme:o}=c.theme.useToken(),{getPrefixCls:l,csp:u}=d.useContext(c.ConfigProvider.ConfigContext);n.layout||(n={...a}),n.proComponentsCls=n.proComponentsCls??`.${l("pro")}`,n.antCls=`.${l()}`;const m=d.useMemo(()=>ep(n),[n]),g=[i,o.id,n.themeId,m].filter(Boolean).join("-"),f=d.useRef(""),h=d.useRef(0);f.current!==g&&(h.current+=1,f.current=g);const p=[e,g,h.current].filter(Boolean);return Hm({path:p,nonce:u==null?void 0:u.nonce,layer:{name:"antd-pro"}},()=>t(n)),{wrapSSR:S=>S,hashId:r?i:""}}const tp=(e,t)=>{var a,i,o,l,u;const n={...e},r=It(t.colorBgElevated,.6);return{bgLayout:`linear-gradient(${t.colorBgContainer}, ${t.colorBgLayout} 28%)`,colorTextAppListIcon:t.colorTextSecondary,appListIconHoverBgColor:(a=n==null?void 0:n.sider)==null?void 0:a.colorBgMenuItemSelected,colorBgAppListIconHover:It(t.colorTextBase,.04),colorTextAppListIconHover:t.colorTextBase,...n,header:{colorBgHeader:r,colorBgScrollHeader:It(t.colorBgElevated,.8),colorHeaderTitle:t.colorText,colorBgMenuItemHover:It(t.colorTextBase,.03),colorBgMenuItemSelected:"transparent",colorBgMenuElevated:(((i=n==null?void 0:n.header)==null?void 0:i.colorBgHeader)??r)!==r?(o=n.header)==null?void 0:o.colorBgHeader:t.colorBgElevated,colorTextMenuSelected:It(t.colorTextBase,.95),colorBgRightActionsItemHover:It(t.colorTextBase,.03),colorTextRightActionsItem:t.colorTextTertiary,heightLayoutHeader:56,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextMenuActive:t.colorText,...n.header},sider:{paddingInlineLayoutMenu:8,paddingBlockLayoutMenu:0,colorBgCollapsedButton:t.colorBgElevated,colorTextCollapsedButtonHover:t.colorTextSecondary,colorTextCollapsedButton:It(t.colorTextBase,.25),colorMenuBackground:"transparent",colorMenuItemDivider:It(t.colorTextBase,.06),colorBgMenuItemHover:It(t.colorTextBase,.03),colorBgMenuItemSelected:It(t.colorTextBase,.04),colorTextMenuItemHover:t.colorText,colorTextMenuSelected:It(t.colorTextBase,.95),colorTextMenuActive:t.colorText,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextSubMenuSelected:It(t.colorTextBase,.95),...n.sider},pageContainer:{colorBgPageContainer:"transparent",paddingInlinePageContainerContent:((l=n.pageContainer)==null?void 0:l.paddingInlinePageContainerContent)||40,paddingBlockPageContainerContent:((u=n.pageContainer)==null?void 0:u.paddingBlockPageContainerContent)||32,colorBgPageContainerFixed:t.colorBgElevated,...n.pageContainer}}},np=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t},rp=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Ga=()=>{var e,t;return!(typeof process<"u"&&(((e=process.env.NODE_ENV)==null?void 0:e.toUpperCase())==="TEST"||((t=process.env.NODE_ENV)==null?void 0:t.toUpperCase())==="DEV"))},Zt=d.createContext({intl:{...qr,locale:"default"},valueTypeMap:{},hashed:!0,dark:!1,token:{...c.theme.getDesignToken(),proComponentsCls:".ant-pro",antCls:".ant",themeId:0},prefixCls:".ant-pro"}),{Consumer:vF}=Zt,sp=()=>{const{cache:e}=_u();return d.useEffect(()=>()=>{e.clear()},[]),null},ap=e=>{var I,M;const{children:t,dark:n,valueTypeMap:r,autoClearCache:a=!1,token:i,prefixCls:o,intl:l}=e,{locale:u,getPrefixCls:m,...g}=d.useContext(c.ConfigProvider.ConfigContext),f=(M=(I=c.theme).useToken)==null?void 0:M.call(I),h=d.useContext(Zt),p=o?`.${o}`:`.${m()}-pro`,S="."+m(),y=`${p}`,w=d.useMemo(()=>tp(i||{},f.token),[i,f.token]),v=d.useMemo(()=>{var k;const Y=u==null?void 0:u.locale,U=Bu(Y),A=l??(Y&&((k=h.intl)==null?void 0:k.locale)==="default"?zn[U]:h.intl||zn[U]);return{...h,dark:n??h.dark,token:np(h.token,f.token,{proComponentsCls:p,antCls:S,themeId:f.theme.id,layout:w}),intl:A||qr}},[u==null?void 0:u.locale,h,n,f.token,f.theme.id,p,S,w,l]),x={...v.token||{},proComponentsCls:p},[C,j]=pm(f.theme,[f.token,x??{}],{salt:y,override:x,cssVar:{key:"pro"}}),b=d.useMemo(()=>!(e.hashed===!1||h.hashed===!1),[h.hashed,e.hashed]),T=d.useMemo(()=>e.hashed===!1||h.hashed===!1||Ga()===!1?"":f.hashId?f.hashId:j,[j,h.hashed,e.hashed]);d.useEffect(()=>{Re.locale((u==null?void 0:u.locale)||"zh-cn")},[u==null?void 0:u.locale]);const $=d.useMemo(()=>({...g.theme,hashId:T,hashed:b&&Ga()}),[g.theme,T,b,Ga()]),E=d.useMemo(()=>({...v,valueTypeMap:r||(v==null?void 0:v.valueTypeMap),token:x,theme:f.theme,hashed:b,hashId:T,prefixCls:o}),[v,r,C,f.theme,b,T,o]),R=d.useMemo(()=>s.jsx(c.ConfigProvider,{...g,theme:$,children:s.jsx(Zt.Provider,{value:E,children:s.jsxs(s.Fragment,{children:[a&&s.jsx(sp,{}),t]})})}),[g,$,E,a,t]);return a?s.jsx($h,{value:{provider:()=>new Map},children:R}):R},Bn=e=>{const{needDeps:t,dark:n,token:r}=e,a=d.useContext(Zt),{locale:i,theme:o,...l}=d.useContext(c.ConfigProvider.ConfigContext);if(t&&a.hashId!==void 0&&Object.keys(e).sort().join("-")==="children-needDeps")return s.jsx(s.Fragment,{children:e.children});const g={...l,locale:i||Wm,theme:rp({...o,algorithm:n??a.dark?[o==null?void 0:o.algorithm,c.theme.darkAlgorithm].flat(1).filter(Boolean):o==null?void 0:o.algorithm})};return s.jsx(c.ConfigProvider,{...g,children:s.jsx(ap,{...e,token:r})})};function Ne(){const{locale:e}=d.useContext(c.ConfigProvider.ConfigContext),{intl:t}=d.useContext(Zt);return t&&t.locale!=="default"?t:e!=null&&e.locale&&zn[Bu(e.locale)]||qr}Zt.displayName="ProProvider";const Xt=Zt,ip=e=>{const{componentCls:t,antCls:n}=e;return{[`${t}-actions`]:{boxSizing:"border-box",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,listStyle:"none",display:"flex",gap:e.marginXS,background:e.colorBgContainer,borderBlockStart:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,minHeight:42,"& > *":{alignItems:"center",justifyContent:"center",flex:1,display:"flex",cursor:"pointer",color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},"& > li > div":{flex:1,width:"100%",marginBlock:e.marginSM,marginInline:0,color:e.colorTextSecondary,textAlign:"center",a:{color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},div:{position:"relative",display:"block",minWidth:32,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimaryHover,transition:"color 0.3s"},[`a:not(${n}-btn),
36
- > .anticon`]:{display:"inline-block",width:"100%",color:e.colorTextSecondary,lineHeight:"22px",transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},".anticon":{fontSize:e.cardActionIconSize,lineHeight:"22px"}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`}}}}};function op(e){return tt("ProCardActions",t=>{const n={...t,componentCls:`.${e}`,cardActionIconSize:16};return[ip(n)]})}const lp=e=>{const{actions:t,prefixCls:n}=e,{wrapSSR:r,hashId:a}=op(n);return Array.isArray(t)&&(t!=null&&t.length)?r(s.jsx("ul",{className:ie(`${n}-actions`,a),children:t.map((i,o)=>s.jsx("li",{style:{width:`${100/t.length}%`,padding:0,margin:0},className:ie(`${n}-actions-item`,a),children:i},`action-${o}`))})):r(s.jsx("ul",{className:ie(`${n}-actions`,a),children:t}))};function mo(e,t){if(!t||!d.isValidElement(e))return e;if(e.type===d.Fragment){const r=d.Children.toArray(e.props.children).map((a,i)=>i===0?mo(a,t):a);return d.cloneElement(e,{},...r)}return d.cloneElement(e,{...e.props,autoFocus:t})}const cp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"flex",justifyContent:"space-between",paddingBlock:8,paddingInlineStart:8,paddingInlineEnd:8,borderBlockStart:`1px solid ${e.colorSplit}`}});function up(e){return tt("DropdownFooter",t=>{const n={...t,componentCls:`.${e}`};return[cp(n)]})}const dp=e=>{const t=Ne(),{onClear:n,onConfirm:r,disabled:a,footerRender:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-core-dropdown-footer"),{wrapSSR:u,hashId:m}=up(l),g=[s.jsx(c.Button,{style:{visibility:n?"visible":"hidden"},type:"link",size:"small",disabled:a,onClick:h=>{n&&n(h),h.stopPropagation()},children:t.getMessage("form.lightFilter.clear","清除")},"clear"),s.jsx(c.Button,{"data-type":"confirm",type:"primary",size:"small",onClick:r,disabled:a,children:t.getMessage("form.lightFilter.confirm","确认")},"confirm")];if(i===!1||(i==null?void 0:i(r,n))===!1)return null;const f=(i==null?void 0:i(r,n))||g;return u(s.jsx("div",{className:ie(l,m),onClick:h=>h.target.getAttribute("data-type")!=="confirm"&&h.stopPropagation(),children:f}))};class fp extends d.Component{constructor(){super(...arguments);oe(this,"state",{hasError:!1,errorInfo:""})}static getDerivedStateFromError(n){return console.warn("ErrorBoundary caught an error",n),{hasError:!0,errorInfo:n.message}}componentDidCatch(n,r){console.warn("ErrorBoundary caught an error",n,r)}render(){return this.state.hasError?s.jsx(c.Result,{status:"error",title:"Something went wrong.",extra:this.state.errorInfo}):this.props.children}}const mp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",gap:e.marginXXS,alignItems:"center",height:"30px",paddingBlock:0,paddingInline:8,fontSize:e.fontSize,lineHeight:"30px",borderRadius:e.borderRadius,cornerShape:"squircle",cursor:"pointer","&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{paddingBlock:0,paddingInline:8,[`&${e.componentCls}-allow-clear:hover:not(${e.componentCls}-disabled)`]:{[`${e.componentCls}-arrow`]:{display:"none"},[`${e.componentCls}-close`]:{display:"inline-flex"}}},[`${e.antCls}-select`]:{[`${e.antCls}-select-clear`]:{borderRadius:"50%"}},[`${e.antCls}-picker`]:{[`${e.antCls}-picker-clear`]:{borderRadius:"50%"}},"&-icon":{color:e.colorIcon,transition:"color 0.3s",fontSize:12,verticalAlign:"middle",[`&${e.componentCls}-close`]:{display:"none",fontSize:12,alignItems:"center",justifyContent:"center",color:e.colorTextPlaceholder,borderRadius:"50%"},"&:hover":{color:e.colorIconHover}},"&-disabled":{color:e.colorTextPlaceholder,cursor:"not-allowed",[`${e.componentCls}-icon`]:{color:e.colorTextPlaceholder}},"&-small":{height:"24px",paddingBlock:0,paddingInline:4,fontSize:e.fontSizeSM,lineHeight:"24px",[`&${e.componentCls}-active`]:{paddingBlock:0,paddingInline:8},[`${e.componentCls}-icon`]:{paddingBlock:0,paddingInline:0},[`${e.componentCls}-close`]:{marginBlockStart:"-2px",paddingBlock:4,paddingInline:4,fontSize:"6px"}},"&-outlined":{height:"32px",paddingBlock:0,paddingInline:8,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,"&-active":{backgroundColor:"none"}},"&-borderless":{height:"32px","&-active":{backgroundColor:e.colorBgTextHover}},"&-filled":{height:"32px",backgroundColor:e.colorBgTextHover,border:`${e.lineWidth}px solid transparent`,"&:hover":{border:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-underlined":{height:"32px",borderRadius:0,borderBottom:`${e.lineWidth}px solid ${e.colorSplit}`,"&:hover":{borderBottom:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-bordered&-small":{height:"24px",paddingBlock:0,paddingInline:8},"&-bordered&-active":{backgroundColor:e.colorBgContainer}}});function hp(e){return tt("FieldLabel",t=>{const n={...t,componentCls:`.${e}`};return[mp(n)]})}const gp=(e,t)=>{var M,Y;const{label:n,onClear:r,value:a,disabled:i,onLabelClick:o,ellipsis:l,placeholder:u,className:m,formatter:g,variant:f,style:h,downIcon:p,allowClear:S=!0,valueMaxLength:y=41}=e,{componentSize:w}=((Y=(M=c.ConfigProvider)==null?void 0:M.useConfig)==null?void 0:Y.call(M))||{componentSize:"middle"},{getPrefixCls:v}=d.useContext(c.ConfigProvider.ConfigContext),x=v("pro-core-field-label"),{wrapSSR:C,hashId:j}=hp(x),b=Ne(),T=d.useRef(null),$=d.useRef(null);d.useImperativeHandle(t,()=>({labelRef:$,clearRef:T}));const E=U=>U.every(A=>typeof A=="string")?U.join(","):U.map((A,k)=>{const F=k===U.length-1?"":",";return typeof A=="string"?s.jsxs("span",{children:[A,F]},k):s.jsxs("span",{style:{display:"flex"},children:[A,F]},k)}),R=U=>g?g(U):Array.isArray(U)?E(U):U,I=(U,A)=>{var k,F;if(A!=null&&A!==""&&(!Array.isArray(A)||A.length)){const D=U?s.jsxs("span",{onClick:()=>{o==null||o()},className:ie(`${x}-text`,j),children:[U,": "]}):"",O=R(A);if(!l)return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center"},children:[D,R(A)]});const q=(()=>{const z=Array.isArray(A)&&A.length>1,V=b.getMessage("form.lightFilter.itemUnit","项");return typeof O=="string"&&O.length>y&&z?`...${A.length}${V}`:""})();return s.jsxs("span",{title:typeof O=="string"?O:void 0,style:{display:"inline-flex",alignItems:"center"},children:[D,s.jsx("span",{style:{paddingInlineStart:4,display:"flex"},children:typeof O=="string"?(F=(k=O==null?void 0:O.toString())==null?void 0:k.slice)==null?void 0:F.call(k,0,y):O}),q]})}return U||u};return C(s.jsxs("span",{className:ie(x,j,`${x}-${e.size??w??"middle"}`,{[`${x}-${f||"borderless"}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-disabled`]:i,[`${x}-${f}`]:f,[`${x}-allow-clear`]:S},m),style:h,ref:$,onClick:()=>{var U;(U=e==null?void 0:e.onClick)==null||U.call(e)},children:[I(n,a),(a||a===0)&&S&&s.jsx(de.CloseCircleFilled,{role:"button",title:b.getMessage("form.lightFilter.clear","清除"),className:ie(`${x}-icon`,j,`${x}-close`),onClick:U=>{i||r==null||r(),U.stopPropagation()},ref:T}),p!==!1?p??s.jsx(de.DownOutlined,{className:ie(`${x}-icon`,j,`${x}-arrow`)}):null]}))},Qt=d.forwardRef(gp),pp=e=>({[`${e.componentCls}-label`]:{cursor:"pointer"},[`${e.componentCls}-label-bordered`]:{display:"inline-flex",alignItems:"center",height:e.controlHeight,paddingBlock:0,paddingInline:e.paddingSM,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,boxSizing:"border-box"},[`${e.componentCls}-overlay`]:{minWidth:"200px",marginBlockStart:"4px"},[`${e.componentCls}-content`]:{paddingBlock:16,paddingInline:16}});function yp(e){return tt("FilterDropdown",t=>{const n={...t,componentCls:`.${e}`};return[pp(n)]})}const Hu=e=>{const{children:t,label:n,footer:r,open:a,onOpenChange:i,disabled:o,footerRender:l,placement:u,popoverProps:m}=e,{getPrefixCls:g}=d.useContext(c.ConfigProvider.ConfigContext),f=g("pro-core-field-dropdown"),{wrapSSR:h,hashId:p}=yp(f),S=d.useRef(null),y=d.useMemo(()=>{var w;return{container:{padding:0,...((w=m==null?void 0:m.styles)==null?void 0:w.container)||{}},...(m==null?void 0:m.styles)||{}}},[m==null?void 0:m.styles]);return h(s.jsx(c.Popover,{...m,placement:u,trigger:["click"],open:a||!1,onOpenChange:i,styles:y,content:s.jsxs("div",{ref:S,className:ie(`${f}-overlay`,{[`${f}-overlay-${u}`]:u,hashId:p}),children:[s.jsx(c.ConfigProvider,{getPopupContainer:()=>S.current||document.body,children:s.jsx("div",{className:ie(`${f}-content`,p),children:t})}),r&&s.jsx(dp,{disabled:o,footerRender:l,...r})]}),children:s.jsx("span",{className:ie(`${f}-label`,p),children:n})}))},xp=e=>{const t=`${e.antCls}-progress-bg`;return{[e.componentCls]:{boxSizing:"border-box","&-multiple":{paddingBlockStart:6,paddingBlockEnd:12,paddingInline:8},"&-progress":{"&-success":{[t]:{backgroundColor:e.colorSuccess}},"&-error":{[t]:{backgroundColor:e.colorError}},"&-warning":{[t]:{backgroundColor:e.colorWarning}}},"&-rule":{display:"flex",alignItems:"center","&-icon":{"&-default":{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"22px","&-circle":{width:"6px",height:"6px",backgroundColor:e.colorTextSecondary,borderRadius:"4px"}},"&-loading":{color:e.colorPrimary},"&-error":{color:e.colorError},"&-success":{color:e.colorSuccess}},"&-text":{color:e.colorText}}}}};function bp(e){return tt("InlineErrorFormItem",t=>{const n={...t,componentCls:`.${e}`};return[xp(n)]})}const Yu={marginBlockStart:-5,marginBlockEnd:-5,marginInlineStart:0,marginInlineEnd:0},Sp=({inputProps:e,input:t,extra:n,errorList:r,popoverProps:a})=>{var v,x;const[i,o]=d.useState(!1),[l,u]=d.useState({errors:[],warnings:[]}),{getPrefixCls:m}=d.useContext(c.ConfigProvider.ConfigContext),g=m(),f=c.theme.useToken(),{wrapSSR:h,hashId:p}=bp(`${g}-form-item-with-help`);d.useEffect(()=>{e.validateStatus!=="validating"&&u({errors:e.errors??[],warnings:e.warnings??[]})},[e.errors,e.warnings,e.validateStatus]);const S=e.validateStatus==="validating",y=(((v=l.errors)==null?void 0:v.length)??0)+(((x=l.warnings)==null?void 0:x.length)??0)>=1,w=()=>{var C,j;return s.jsxs(s.Fragment,{children:[(C=l.errors)==null?void 0:C.map((b,T)=>s.jsx("div",{className:ie(`${g}-form-item-explain-error`,p),children:b},`error-${T}`)),(j=l.warnings)==null?void 0:j.map((b,T)=>s.jsx("div",{className:ie(`${g}-form-item-explain-warning`,p),children:b},`warning-${T}`))]})};return s.jsx(c.Popover,{open:y?i:!1,onOpenChange:C=>{C!==i&&o(C)},trigger:(a==null?void 0:a.trigger)||["click"],placement:(a==null?void 0:a.placement)||"topLeft",getPopupContainer:a==null?void 0:a.getPopupContainer,getTooltipContainer:a==null?void 0:a.getTooltipContainer,content:h(s.jsx("div",{className:ie(`${g}-form-item`,p,f.hashId),style:{margin:0,padding:0},children:s.jsxs("div",{className:ie(`${g}-form-item-with-help`,p,f.hashId),children:[S?s.jsx(de.LoadingOutlined,{}):null,y?w():r]})})),...a,children:s.jsxs(s.Fragment,{children:[t,n]})},"popover")},Cp=({rules:e,name:t,children:n,popoverProps:r,...a})=>s.jsx(c.Form.Item,{name:t,rules:e,hasFeedback:!1,shouldUpdate:(i,o)=>{if(i===o)return!1;const l=[t].flat(1);l.length>1&&l.pop();try{return JSON.stringify(Be(i,l))!==JSON.stringify(Be(o,l))}catch{return!0}},_internalItemRender:{mark:"pro_table_render",render:(i,o)=>s.jsx(Sp,{inputProps:i,popoverProps:r,...o})},...a,style:{...Yu,...a==null?void 0:a.style},children:n}),wp=e=>{const{errorType:t,rules:n,name:r,popoverProps:a,children:i,...o}=e;return r&&(n!=null&&n.length)&&t==="popover"?s.jsx(Cp,{name:r,rules:n,popoverProps:a,...o,children:i}):s.jsx(c.Form.Item,{rules:n,shouldUpdate:r?(l,u)=>{if(l===u)return!1;const m=[r].flat(1);m.length>1&&m.pop();try{return JSON.stringify(Be(l,m))!==JSON.stringify(Be(u,m))}catch{return!0}}:void 0,...o,style:{...Yu,...o.style},name:r,children:i})},jp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",alignItems:"center",maxWidth:"100%","&-icon":{display:"block",marginInlineStart:"4px",cursor:"pointer","&:hover":{color:e.colorPrimary}},"&-title":{display:"inline-flex",flex:"1"},"&-subtitle ":{marginInlineStart:8,color:e.colorTextSecondary,fontWeight:"normal",fontSize:e.fontSize,whiteSpace:"nowrap"},"&-title-ellipsis":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",wordBreak:"keep-all"}}});function vp(e){return tt("LabelIconTip",t=>{const n={...t,componentCls:`.${e}`};return[jp(n)]})}const fr=d.memo(e=>{const{label:t,tooltip:n,ellipsis:r,subTitle:a}=e,{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-core-label-tip"),{wrapSSR:l,hashId:u}=vp(o);if(!n&&!a)return s.jsx(s.Fragment,{children:t});const m=typeof n=="string"||d.isValidElement(n)?{title:n}:n,g=(m==null?void 0:m.icon)||s.jsx(de.InfoCircleOutlined,{});return l(s.jsxs("div",{className:ie(o,u),onMouseDown:f=>f.stopPropagation(),onMouseLeave:f=>f.stopPropagation(),onMouseMove:f=>f.stopPropagation(),children:[s.jsx("div",{className:ie(`${o}-title`,u,{[`${o}-title-ellipsis`]:r}),children:t}),a&&s.jsx("div",{className:ie(`${o}-subtitle`,u),children:a}),n&&s.jsx(c.Tooltip,{...m,children:s.jsx("span",{className:ie(`${o}-icon`,u),children:g})})]}))}),es=d.createContext({});var zs={exports:{}},Tp=zs.exports,pl;function Fp(){return pl||(pl=1,(function(e,t){(function(n,r){e.exports=r()})(Tp,(function(){var n="month",r="quarter";return function(a,i){var o=i.prototype;o.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var l=o.add;o.add=function(m,g){return m=Number(m),this.$utils().p(g)===r?this.add(3*m,n):l.bind(this)(m,g)};var u=o.startOf;o.startOf=function(m,g){var f=this.$utils(),h=!!f.u(g)||g;if(f.p(m)===r){var p=this.quarter()-1;return h?this.month(3*p).startOf(n).startOf("day"):this.month(3*p+2).endOf(n).endOf("day")}return u.bind(this)(m,g)}}}))})(zs)),zs.exports}var $p=Fp();const Ep=Jt($p),Lt=e=>e==null;Re.extend(Ep);const ho={time:"HH:mm:ss",timeRange:"HH:mm:ss",date:"YYYY-MM-DD",dateWeek:"YYYY-wo",dateMonth:"YYYY-MM",dateQuarter:"YYYY-[Q]Q",dateYear:"YYYY",dateRange:"YYYY-MM-DD",dateTime:"YYYY-MM-DD HH:mm:ss",dateTimeRange:"YYYY-MM-DD HH:mm:ss"};function yl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rp(e){if(yl(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(yl(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}const Ii=e=>!!(e!=null&&e._isAMomentObject),xl=(e,t,n)=>{if(!t)return e;if(Re.isDayjs(e)||Ii(e)){if(t==="number")return e.valueOf();if(t==="string")return e.format(ho[n]||"YYYY-MM-DD HH:mm:ss");if(typeof t=="string"&&t!=="string")return e.format(t);if(typeof t=="function")return t(e,n)}return e},Mi=(e,t,n,r,a)=>{const i={};return typeof window>"u"||typeof e!="object"||Lt(e)||e instanceof Blob||Array.isArray(e)?e:(Object.keys(e).forEach(o=>{const l=a?[a,o].flat(1):[o],u=Be(n,l)||"text";let m="text",g;typeof u=="string"?m=u:(m=u.valueType,g=u.dateFormat);const f=e[o];if(Lt(f)&&r||r&&f==="")return;if(Rp(f)&&!Array.isArray(f)&&!Re.isDayjs(f)&&!Ii(f)){i[o]=Mi(f,t,n,r,l);return}const h=t??"string";let p;if(h==="number"||h===!1||typeof h=="function"?p=h:h==="string"?p=g||ho[m]:p=h,Array.isArray(f)){i[o]=f.map((S,y)=>Re.isDayjs(S)||Ii(S)?xl(S,p===void 0&&h==="string"?"string":p,m):Mi(S,t,n,r,[o,`${y}`].flat(1)));return}i[o]=xl(f,p,m)}),i)},bl=(e,t)=>typeof t=="function"?t(Re(e)):Re(e).format(t),Ip=(e,t)=>{const[n,r]=Array.isArray(e)?e:[];let a,i;Array.isArray(t)?(a=t[0],i=t[1]):typeof t=="object"&&t.type==="mask"?(a=t.format,i=t.format):(a=t,i=t);const o=n?bl(n,a):"",l=r?bl(r,i):"";return o&&l?`${o} ~ ${l}`:""};function Pt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}const Mp=e=>{var t;return!!((t=e==null?void 0:e.valueType)!=null&&t.toString().startsWith("date")||(e==null?void 0:e.valueType)==="select"||e!=null&&e.valueEnum)},Ap=e=>{var t;return((t=e.ellipsis)==null?void 0:t.showTitle)===!1?!1:e.ellipsis},Sl=e=>e==null?"":String(e).trimEnd(),kp=e=>d.isValidElement(e),Op=(e,t,n,r)=>{const a=Ap(t);if(!a)return!1;const i=Mp(t),o=kp(r);if((i||o)&&(t==null?void 0:t.tooltip)!==!1){const l=s.jsx("div",{className:"pro-table-tooltip-text",children:e});return Pt(a)&&Pt(a.tooltip)?{tooltip:{title:l,...a.tooltip}}:{tooltip:l}}return n?Pt(a)&&Pt(a.tooltip)?{tooltip:{title:n,...a.tooltip}}:{tooltip:n}:!1},Dp=(e,t,n,r)=>{if(!t.copyable&&!t.ellipsis)return e;const a=Sl(n),i=r!==void 0?Sl(r):a,o=Op(e,t,a,n);return t.copyable?s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"},children:[s.jsx(c.Typography.Text,{style:{flex:1,minWidth:0,margin:0,padding:0},title:"",ellipsis:o,children:e}),i?s.jsx("span",{style:{flex:"none",userSelect:"none"},children:s.jsx(c.Typography.Text,{style:{margin:0,padding:0},copyable:{text:i,tooltips:["",""]}})}):null]}):s.jsx(c.Typography.Text,{style:{width:"100%",margin:0,padding:0},title:"",ellipsis:o,children:e})};function vt(e,...t){return typeof e=="function"?e(...t):e}const Ai=(e,t,n)=>t===void 0?e:vt(e,t,n),je=e=>{const t=d.useRef(null);return t.current=e,d.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])};function go(e,t){const n=je(e),r=d.useRef(),a=d.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i=d.useCallback(async(...o)=>t===0||t===void 0?n(...o):(a(),new Promise(l=>{r.current=setTimeout(async()=>{l(await n(...o))},t)})),[n,a,t]);return d.useEffect(()=>a,[a]),{run:i,cancel:a}}const po=e=>{const t=d.useRef(e);return t.current=e,t};function Pp(e,t=100,n){const[r,a]=d.useState(e),i=po(e);return d.useEffect(()=>{const o=setTimeout(()=>{a(i.current)},t);return()=>clearTimeout(o)},n?[t,...n]:void 0),r}function vn(e,t,n){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,a,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(!vn(e[a],t[a],n))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;for(a of e.entries())if(!vn(a[1],t.get(a[0]),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=r;a--!==0;){const o=i[a];if(!(n!=null&&n.includes(o))&&!(o==="_owner"&&e.$$typeof)&&!vn(e[o],t[o],n))return!1}return!0}return e!==e&&t!==t}const Np=(e,t,n)=>vn(e,t,n);function yo(e,t){const n=d.useRef();return Np(e,n.current,t)||(n.current=e),n.current}function ir(e,t,n){d.useEffect(e,yo(t||[],n))}function Uu(e,t,n,r){const a=go(async()=>{e()},r||16);d.useEffect(()=>{a.run()},yo(t||[],n))}function St(e,t){return d.useMemo(e,yo(t))}const Lp=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,xo=()=>typeof process<"u"&&process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Lp;let Cl=0;function _p(e){const t=d.useRef(null),[n]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():(Cl+=1,Cl.toString())),r=async()=>{var l;(l=t.current)==null||l.abort();const o=new AbortController;t.current=o;try{return e.request?await e.request(e.params,o.signal):void 0}catch(u){if(u.name==="AbortError")return;throw u}},{data:a,isValidating:i}=zu(e.request?[n,e.params]:null,r,{revalidateOnFocus:!1,shouldRetryOnError:!1,onError:()=>{}});return e.request?[a,i]:[void 0,!1]}const Vr=e=>{const t=d.useRef();return d.useEffect(()=>{t.current=e}),t.current};function zp(){const[,e]=d.useState(!0);return d.useCallback(()=>e(n=>!n),[])}function Bp(e,t){const n=d.useMemo(()=>{const r={current:t};return new Proxy(r,{set(a,i,o){return Object.is(a[i],o)||(a[i]=o,e(n)),!0}})},[]);return n}function Vp(e){const t=zp();return Bp(t,e)}const Hp=e=>{let t=!1;return(typeof e=="string"&&e.startsWith("date")&&!e.endsWith("Range")||e==="select"||e==="time")&&(t=!0),t},Ku=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t};let wl=0,Yp=(e=21)=>{if(typeof window>"u"||!window.crypto)return(wl+=1).toFixed(0);let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const Gr=()=>{var e;return(e=window==null?void 0:window.crypto)!=null&&e.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Yp()},Wu=e=>{if(e&&e!==!0)return e},xt=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Up=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};var Bs={exports:{}},Kp=Bs.exports,jl;function Wp(){return jl||(jl=1,(function(e,t){(function(n,r){e.exports=r()})(Kp,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,i=/\d\d/,o=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,u={},m=function(w){return(w=+w)+(w>68?1900:2e3)},g=function(w){return function(v){this[w]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(w){(this.zone||(this.zone={})).offset=(function(v){if(!v||v==="Z")return 0;var x=v.match(/([+-]|\d\d)/g),C=60*x[1]+(+x[2]||0);return C===0?0:x[0]==="+"?-C:C})(w)}],h=function(w){var v=u[w];return v&&(v.indexOf?v:v.s.concat(v.f))},p=function(w,v){var x,C=u.meridiem;if(C){for(var j=1;j<=24;j+=1)if(w.indexOf(C(j,0,v))>-1){x=j>12;break}}else x=w===(v?"pm":"PM");return x},S={A:[l,function(w){this.afternoon=p(w,!1)}],a:[l,function(w){this.afternoon=p(w,!0)}],Q:[a,function(w){this.month=3*(w-1)+1}],S:[a,function(w){this.milliseconds=100*+w}],SS:[i,function(w){this.milliseconds=10*+w}],SSS:[/\d{3}/,function(w){this.milliseconds=+w}],s:[o,g("seconds")],ss:[o,g("seconds")],m:[o,g("minutes")],mm:[o,g("minutes")],H:[o,g("hours")],h:[o,g("hours")],HH:[o,g("hours")],hh:[o,g("hours")],D:[o,g("day")],DD:[i,g("day")],Do:[l,function(w){var v=u.ordinal,x=w.match(/\d+/);if(this.day=x[0],v)for(var C=1;C<=31;C+=1)v(C).replace(/\[|\]/g,"")===w&&(this.day=C)}],w:[o,g("week")],ww:[i,g("week")],M:[o,g("month")],MM:[i,g("month")],MMM:[l,function(w){var v=h("months"),x=(h("monthsShort")||v.map((function(C){return C.slice(0,3)}))).indexOf(w)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[l,function(w){var v=h("months").indexOf(w)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,g("year")],YY:[i,function(w){this.year=m(w)}],YYYY:[/\d{4}/,g("year")],Z:f,ZZ:f};function y(w){var v,x;v=w,x=u&&u.formats;for(var C=(w=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(I,M,Y){var U=Y&&Y.toUpperCase();return M||x[Y]||n[Y]||x[U].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(A,k,F){return k||F.slice(1)}))}))).match(r),j=C.length,b=0;b<j;b+=1){var T=C[b],$=S[T],E=$&&$[0],R=$&&$[1];C[b]=R?{regex:E,parser:R}:T.replace(/^\[|\]$/g,"")}return function(I){for(var M={},Y=0,U=0;Y<j;Y+=1){var A=C[Y];if(typeof A=="string")U+=A.length;else{var k=A.regex,F=A.parser,D=I.slice(U),O=k.exec(D)[0];F.call(M,O),I=I.replace(O,"")}}return(function(B){var q=B.afternoon;if(q!==void 0){var z=B.hours;q?z<12&&(B.hours+=12):z===12&&(B.hours=0),delete B.afternoon}})(M),M}}return function(w,v,x){x.p.customParseFormat=!0,w&&w.parseTwoDigitYear&&(m=w.parseTwoDigitYear);var C=v.prototype,j=C.parse;C.parse=function(b){var T=b.date,$=b.utc,E=b.args;this.$u=$;var R=E[1];if(typeof R=="string"){var I=E[2]===!0,M=E[3]===!0,Y=I||M,U=E[2];M&&(U=E[2]),u=this.$locale(),!I&&U&&(u=x.Ls[U]),this.$d=(function(D,O,B,q){try{if(["x","X"].indexOf(O)>-1)return new Date((O==="X"?1e3:1)*D);var z=y(O)(D),V=z.year,Z=z.month,G=z.day,H=z.hours,L=z.minutes,K=z.seconds,P=z.milliseconds,W=z.zone,te=z.week,re=new Date,X=G||(V||Z?1:re.getDate()),se=V||re.getFullYear(),ae=0;V&&!Z||(ae=Z>0?Z-1:re.getMonth());var ue,pe=H||0,me=L||0,fe=K||0,ye=P||0;return W?new Date(Date.UTC(se,ae,X,pe,me,fe,ye+60*W.offset*1e3)):B?new Date(Date.UTC(se,ae,X,pe,me,fe,ye)):(ue=new Date(se,ae,X,pe,me,fe,ye),te&&(ue=q(ue).week(te).toDate()),ue)}catch{return new Date("")}})(T,R,$,x),this.init(),U&&U!==!0&&(this.$L=this.locale(U).$L),Y&&T!=this.format(R)&&(this.$d=new Date("")),u={}}else if(R instanceof Array)for(var A=R.length,k=1;k<=A;k+=1){E[1]=R[k-1];var F=x.apply(this,E);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}k===A&&(this.$d=new Date(""))}else j.call(this,b)}}}))})(Bs)),Bs.exports}var qp=Wp();const Gp=Jt(qp);Re.extend(Gp);const vl=e=>!!(e!=null&&e._isAMomentObject),xr=(e,t)=>Lt(e)||Re.isDayjs(e)||vl(e)?vl(e)?Re(e):e:Array.isArray(e)?e.map(n=>xr(n,t)):typeof e=="number"?Re(e):Re(e,t),Zp=["colon","dependencies","extra","getValueFromEvent","getValueProps","hasFeedback","help","htmlFor","initialValue","noStyle","label","labelAlign","labelCol","name","preserve","normalize","required","rules","shouldUpdate","trigger","validateFirst","validateStatus","validateTrigger","valuePropName","wrapperCol","hidden","validateDebounce","addonBefore","addonAfter","addonWarpStyle"];function Jp(e){const t={};return Zp.forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t}const Xp="valueType request formItemRender render text formItemProps valueEnum",Qp="fieldProps isDefaultDom groupProps contentRender submitterProps submitter";function zt(e,t=!1){const n=`${Xp} ${Qp}`.split(/[\s\n]+/),r={};return Object.keys(e||{}).forEach(a=>{n.includes(a)&&!t||(r[a]=e[a])}),r}function ey(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const ty=({color:e,children:t})=>s.jsx(c.Badge,{color:e,text:t}),un=e=>ey(e)==="map"?e:new Map(Object.entries(e||{})),ny={Success:({children:e})=>s.jsx(c.Badge,{status:"success",text:e}),Error:({children:e})=>s.jsx(c.Badge,{status:"error",text:e}),Default:({children:e})=>s.jsx(c.Badge,{status:"default",text:e}),Processing:({children:e})=>s.jsx(c.Badge,{status:"processing",text:e}),Warning:({children:e})=>s.jsx(c.Badge,{status:"warning",text:e}),success:({children:e})=>s.jsx(c.Badge,{status:"success",text:e}),error:({children:e})=>s.jsx(c.Badge,{status:"error",text:e}),default:({children:e})=>s.jsx(c.Badge,{status:"default",text:e}),processing:({children:e})=>s.jsx(c.Badge,{status:"processing",text:e}),warning:({children:e})=>s.jsx(c.Badge,{status:"warning",text:e})},Yn=(e,t,n)=>{if(Array.isArray(e))return s.jsx(c.Space,{separator:",",size:2,wrap:!0,children:e.map((u,m)=>Yn(u,t,m))},n);const r=un(t);if(!r.has(e)&&!r.has(`${e}`))return(e==null?void 0:e.label)||e;const a=r.get(e)||r.get(`${e}`);if(!a)return s.jsx(d.Fragment,{children:(e==null?void 0:e.label)||e},n);const{status:i,color:o}=a,l=ny[i||"Init"];return l?s.jsx(l,{children:a.text},n):o?s.jsx(ty,{color:o,children:a.text},n):s.jsx(d.Fragment,{children:a.text||a},n)};var ws={exports:{}},Tl;function ry(){return Tl||(Tl=1,(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=v();r.configure=v,r.stringify=r,r.default=r,t.stringify=r,t.configure=v,e.exports=r;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function i(x){return x.length<5e3&&!a.test(x)?`"${x}"`:JSON.stringify(x)}function o(x,C){if(x.length>200||C)return x.sort(C);for(let j=1;j<x.length;j++){const b=x[j];let T=j;for(;T!==0&&x[T-1]>b;)x[T]=x[T-1],T--;x[T]=b}return x}const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(x){return l.call(x)!==void 0&&x.length!==0}function m(x,C,j){x.length<j&&(j=x.length);const b=C===","?"":" ";let T=`"0":${b}${x[0]}`;for(let $=1;$<j;$++)T+=`${C}"${$}":${b}${x[$]}`;return T}function g(x){if(n.call(x,"circularValue")){const C=x.circularValue;if(typeof C=="string")return`"${C}"`;if(C==null)return C;if(C===Error||C===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(x){let C;if(n.call(x,"deterministic")&&(C=x.deterministic,typeof C!="boolean"&&typeof C!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return C===void 0?!0:C}function h(x,C){let j;if(n.call(x,C)&&(j=x[C],typeof j!="boolean"))throw new TypeError(`The "${C}" argument must be of type boolean`);return j===void 0?!0:j}function p(x,C){let j;if(n.call(x,C)){if(j=x[C],typeof j!="number")throw new TypeError(`The "${C}" argument must be of type number`);if(!Number.isInteger(j))throw new TypeError(`The "${C}" argument must be an integer`);if(j<1)throw new RangeError(`The "${C}" argument must be >= 1`)}return j===void 0?1/0:j}function S(x){return x===1?"1 item":`${x} items`}function y(x){const C=new Set;for(const j of x)(typeof j=="string"||typeof j=="number")&&C.add(String(j));return C}function w(x){if(n.call(x,"strict")){const C=x.strict;if(typeof C!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(C)return j=>{let b=`Object can not safely be stringified. Received type ${typeof j}`;throw typeof j!="function"&&(b+=` (${j.toString()})`),new Error(b)}}}function v(x){x={...x};const C=w(x);C&&(x.bigint===void 0&&(x.bigint=!1),"circularValue"in x||(x.circularValue=Error));const j=g(x),b=h(x,"bigint"),T=f(x),$=typeof T=="function"?T:void 0,E=p(x,"maximumDepth"),R=p(x,"maximumBreadth");function I(k,F,D,O,B,q){let z=F[k];switch(typeof z=="object"&&z!==null&&typeof z.toJSON=="function"&&(z=z.toJSON(k)),z=O.call(F,k,z),typeof z){case"string":return i(z);case"object":{if(z===null)return"null";if(D.indexOf(z)!==-1)return j;let V="",Z=",";const G=q;if(Array.isArray(z)){if(z.length===0)return"[]";if(E<D.length+1)return'"[Array]"';D.push(z),B!==""&&(q+=B,V+=`
37
- ${q}`,Z=`,
38
- ${q}`);const te=Math.min(z.length,R);let re=0;for(;re<te-1;re++){const se=I(String(re),z,D,O,B,q);V+=se!==void 0?se:"null",V+=Z}const X=I(String(re),z,D,O,B,q);if(V+=X!==void 0?X:"null",z.length-1>R){const se=z.length-R-1;V+=`${Z}"... ${S(se)} not stringified"`}return B!==""&&(V+=`
39
- ${G}`),D.pop(),`[${V}]`}let H=Object.keys(z);const L=H.length;if(L===0)return"{}";if(E<D.length+1)return'"[Object]"';let K="",P="";B!==""&&(q+=B,Z=`,
40
- ${q}`,K=" ");const W=Math.min(L,R);T&&!u(z)&&(H=o(H,$)),D.push(z);for(let te=0;te<W;te++){const re=H[te],X=I(re,z,D,O,B,q);X!==void 0&&(V+=`${P}${i(re)}:${K}${X}`,P=Z)}if(L>R){const te=L-R;V+=`${P}"...":${K}"${S(te)} not stringified"`,P=Z}return B!==""&&P.length>1&&(V=`
41
- ${q}${V}
42
- ${G}`),D.pop(),`{${V}}`}case"number":return isFinite(z)?String(z):C?C(z):"null";case"boolean":return z===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(z);default:return C?C(z):void 0}}function M(k,F,D,O,B,q){switch(typeof F=="object"&&F!==null&&typeof F.toJSON=="function"&&(F=F.toJSON(k)),typeof F){case"string":return i(F);case"object":{if(F===null)return"null";if(D.indexOf(F)!==-1)return j;const z=q;let V="",Z=",";if(Array.isArray(F)){if(F.length===0)return"[]";if(E<D.length+1)return'"[Array]"';D.push(F),B!==""&&(q+=B,V+=`
43
- ${q}`,Z=`,
44
- ${q}`);const L=Math.min(F.length,R);let K=0;for(;K<L-1;K++){const W=M(String(K),F[K],D,O,B,q);V+=W!==void 0?W:"null",V+=Z}const P=M(String(K),F[K],D,O,B,q);if(V+=P!==void 0?P:"null",F.length-1>R){const W=F.length-R-1;V+=`${Z}"... ${S(W)} not stringified"`}return B!==""&&(V+=`
45
- ${z}`),D.pop(),`[${V}]`}D.push(F);let G="";B!==""&&(q+=B,Z=`,
46
- ${q}`,G=" ");let H="";for(const L of O){const K=M(L,F[L],D,O,B,q);K!==void 0&&(V+=`${H}${i(L)}:${G}${K}`,H=Z)}return B!==""&&H.length>1&&(V=`
47
- ${q}${V}
48
- ${z}`),D.pop(),`{${V}}`}case"number":return isFinite(F)?String(F):C?C(F):"null";case"boolean":return F===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(F);default:return C?C(F):void 0}}function Y(k,F,D,O,B){switch(typeof F){case"string":return i(F);case"object":{if(F===null)return"null";if(typeof F.toJSON=="function"){if(F=F.toJSON(k),typeof F!="object")return Y(k,F,D,O,B);if(F===null)return"null"}if(D.indexOf(F)!==-1)return j;const q=B;if(Array.isArray(F)){if(F.length===0)return"[]";if(E<D.length+1)return'"[Array]"';D.push(F),B+=O;let K=`
35
+ */var nl;function Jm(){return nl||(nl=1,process.env.NODE_ENV!=="production"&&(function(){function e(p,S){return p===S&&(p!==0||1/p===1/S)||p!==p&&S!==S}function t(p,S){g||a.startTransition===void 0||(g=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var y=S();if(!f){var w=S();i(y,w)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),f=!0)}w=o({inst:{value:y,getSnapshot:S}});var T=w[0].inst,x=w[1];return u(function(){T.value=y,T.getSnapshot=S,n(T)&&x({inst:T})},[p,y,S]),l(function(){return n(T)&&x({inst:T}),p(function(){n(T)&&x({inst:T})})},[p]),m(y),y}function n(p){var S=p.getSnapshot;p=p.value;try{var y=S();return!i(p,y)}catch{return!0}}function r(p,S){return S()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var a=d,i=typeof Object.is=="function"?Object.is:e,o=a.useState,l=a.useEffect,u=a.useLayoutEffect,m=a.useDebugValue,g=!1,f=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:t;za.useSyncExternalStore=a.useSyncExternalStore!==void 0?a.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()),za}var rl;function Xm(){return rl||(rl=1,process.env.NODE_ENV==="production"?gs.exports=Zm():gs.exports=Jm()),gs.exports}var sl=Xm(),al=Object.prototype.hasOwnProperty;function Ci(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Ci(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(al.call(e,n)&&++r&&!al.call(t,n)||!(n in t)||!Ci(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const Ru=0,Iu=1,Mu=2,il=3,Au=4,Wt=new WeakMap,an=()=>{},et=an(),Xs=Object,Me=e=>e===et,Ut=e=>typeof e=="function",qt=(e,t)=>({...e,...t}),wi=e=>Ut(e.then),Ba={},ps={},co="undefined",Qr=typeof window!=co,ji=typeof document!=co,Qm=Qr&&"Deno"in window,eh=()=>Qr&&typeof window.requestAnimationFrame!=co,ku=(e,t)=>{const n=Wt.get(e);return[()=>!Me(t)&&e.get(t)||Ba,r=>{if(!Me(t)){const a=e.get(t);t in ps||(ps[t]=a),n[5](t,qt(a,r),a||Ba)}},n[6],()=>!Me(t)&&t in ps?ps[t]:!Me(t)&&e.get(t)||Ba]};let vi=!0;const th=()=>vi,[Ti,Fi]=Qr&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[an,an],nh=()=>{const e=ji&&document.visibilityState;return Me(e)||e!=="hidden"},rh=e=>(ji&&document.addEventListener("visibilitychange",e),Ti("focus",e),()=>{ji&&document.removeEventListener("visibilitychange",e),Fi("focus",e)}),sh=e=>{const t=()=>{vi=!0,e()},n=()=>{vi=!1};return Ti("online",t),Ti("offline",n),()=>{Fi("online",t),Fi("offline",n)}},ah={isOnline:th,isVisible:nh},ih={initFocus:rh,initReconnect:sh},ol=!d.useId,On=!Qr||Qm,oh=e=>eh()?window.requestAnimationFrame(e):setTimeout(e,1),rr=On?d.useEffect:d.useLayoutEffect,Va=typeof navigator<"u"&&navigator.connection,ll=!On&&Va&&(["slow-2g","2g"].includes(Va.effectiveType)||Va.saveData),ys=new WeakMap,lh=e=>Xs.prototype.toString.call(e),Ha=(e,t)=>e===`[object ${t}]`;let ch=0;const $i=e=>{const t=typeof e,n=lh(e),r=Ha(n,"Date"),a=Ha(n,"RegExp"),i=Ha(n,"Object");let o,l;if(Xs(e)===e&&!r&&!a){if(o=ys.get(e),o)return o;if(o=++ch+"~",ys.set(e,o),Array.isArray(e)){for(o="@",l=0;l<e.length;l++)o+=$i(e[l])+",";ys.set(e,o)}if(i){o="#";const u=Xs.keys(e).sort();for(;!Me(l=u.pop());)Me(e[l])||(o+=l+":"+$i(e[l])+",");ys.set(e,o)}}else o=r?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return o},uo=e=>{if(Ut(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?$i(e):"",[e,t]};let uh=0;const Qs=()=>++uh;async function Ou(...e){const[t,n,r,a]=e,i=qt({populateCache:!0,throwOnError:!0},typeof a=="boolean"?{revalidate:a}:a||{});let o=i.populateCache;const l=i.rollbackOnError;let u=i.optimisticData;const m=h=>typeof l=="function"?l(h):l!==!1,g=i.throwOnError;if(Ut(n)){const h=n,p=[],S=t.keys();for(const y of S)!/^\$(inf|sub)\$/.test(y)&&h(t.get(y)._k)&&p.push(y);return Promise.all(p.map(f))}return f(n);async function f(h){const[p]=uo(h);if(!p)return;const[S,y]=ku(t,p),[w,T,x,C]=Wt.get(t),j=()=>{const O=w[p];return(Ut(i.revalidate)?i.revalidate(S().data,h):i.revalidate!==!1)&&(delete x[p],delete C[p],O&&O[0])?O[0](Mu).then(()=>S().data):S().data};if(e.length<3)return j();let b=r,v,$=!1;const E=Qs();T[p]=[E,0];const R=!Me(u),D=S(),M=D.data,U=D._c,Y=Me(U)?M:U;if(R&&(u=Ut(u)?u(Y,M):u,y({data:u,_c:Y})),Ut(b))try{b=b(Y)}catch(O){v=O,$=!0}if(b&&wi(b))if(b=await b.catch(O=>{v=O,$=!0}),E!==T[p][0]){if($)throw v;return b}else $&&R&&m(v)&&(o=!0,y({data:Y,_c:et}));if(o&&!$)if(Ut(o)){const O=o(b,Y);y({data:O,error:et,_c:et})}else y({data:b,error:et,_c:et});if(T[p][1]=Qs(),Promise.resolve(j()).then(()=>{y({_c:et})}),$){if(g)throw v;return}return b}}const cl=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},Du=(e,t)=>{if(!Wt.has(e)){const r=qt(ih,t),a=Object.create(null),i=Ou.bind(et,e);let o=an;const l=Object.create(null),u=(h,p)=>{const S=l[h]||[];return l[h]=S,S.push(p),()=>{const y=S.indexOf(p);y>=0&&(S[y]=S[S.length-1],S.pop())}},m=(h,p,S)=>{e.set(h,p);const y=l[h];if(y)for(const w of y)w(p,S)},g=h=>{const p=Wt.get(e),[,S,y,w]=p,T=Qs();p[8]++;for(const j in y)delete y[j];for(const j in w)delete w[j];for(const j in S)S[j]=[T,T];const x={};for(const j of[...e.keys()]){const b=e.get(j);e.delete(j);const v=l[j];if(v)for(const $ of v)$(x,b)}const C=!h||h.revalidate!==!1;for(const j in a){const b=a[j];for(let v=0;v<b.length;v++)b[v](Au,{revalidate:C&&!v})}},f=()=>{if(!Wt.has(e)&&(Wt.set(e,[a,Object.create(null),Object.create(null),Object.create(null),i,m,u,g,0]),!On)){const h=r.initFocus(setTimeout.bind(et,cl.bind(et,a,Ru))),p=r.initReconnect(setTimeout.bind(et,cl.bind(et,a,Iu)));o=()=>{h&&h(),p&&p(),Wt.delete(e)}}};return f(),[e,i,f,o,g]}const n=Wt.get(e);return[e,n[4],et,et,n[7]]},dh=(e,t,n,r,a)=>{const i=n.errorRetryCount,o=a.retryCount,l=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!Me(i)&&o>i||setTimeout(r,l,a)},fh=Ci,[fo,mh,,,hh]=Du(new Map),Pu=qt({onLoadingSlow:an,onSuccess:an,onError:an,onErrorRetry:dh,onDiscarded:an,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:ll?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:ll?5e3:3e3,compare:fh,isPaused:()=>!1,cache:fo,mutate:mh,unload:hh,fallback:{}},ah),Nu=(e,t)=>{const n=qt(e,t);if(t){const{use:r,fallback:a,cacheData:i}=e,{use:o,fallback:l,cacheData:u}=t;r&&o&&(n.use=r.concat(o)),a&&l&&(n.fallback=qt(a,l)),i&&u&&(n.cacheData=qt(i,u))}return n},Ei=d.createContext({}),gh=e=>{const{value:t}=e,n=d.useContext(Ei),r=Ut(t),a=d.useMemo(()=>r?t(n):t,[r,n,t]),i=d.useMemo(()=>r?a:Nu(n,a),[r,n,a]),o=a&&a.provider,l=d.useRef(et);o&&!l.current&&(l.current=Du(o(i.cache||fo),a));const u=l.current;return u&&(i.cache=u[0],i.mutate=u[1],i.unload=u[4]),rr(()=>{if(u)return u[2]&&u[2](),u[3]},[]),d.createElement(Ei.Provider,qt(e,{value:i}))},ph="$inf$",Lu=Qr&&window.__SWR_DEVTOOLS_USE__,yh=Lu?window.__SWR_DEVTOOLS_USE__:[],xh=()=>{Lu&&(window.__SWR_DEVTOOLS_REACT__=d)},bh=e=>Ut(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],_u=()=>{const e=d.useContext(Ei);return d.useMemo(()=>qt(Pu,e),[e])},Sh=e=>(t,n,r)=>e(t,n&&((...i)=>{const[o]=uo(t),[,,,l]=Wt.get(fo);if(o.startsWith(ph))return n(...i);const u=l[o];return Me(u)?n(...i):(delete l[o],u)}),r),Ch=yh.concat(Sh),wh=e=>function(...n){const r=_u(),[a,i,o]=bh(n),l=Nu(r,o);let u=e;const{use:m}=l,g=(m||[]).concat(Ch);for(let f=g.length;f--;)u=g[f](u);return u(a,i||l.fetcher||null,l)},jh=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const a=r.indexOf(n);a>=0&&(r[a]=r[r.length-1],r.pop())}};xh();const xs=d.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ua={dedupe:!0},ul=(e,t,n)=>{var r;return t?((r=e.get(t))==null?void 0:r.has(n))===!0:!1},Ya=(e,t,n)=>{if(!t)return;let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)},vh=({value:e,getCacheData:t,canCommit:n,setCache:r})=>{const a=i=>{n()&&Me(t())&&r(i)};Promise.resolve(e).then(i=>{a({data:i,error:et})},i=>{a({error:i})})},ea=Promise.resolve(et);ea.status="fulfilled";ea.value=et;const Th=()=>an,Fh=(e,t,n)=>{const{cache:r,compare:a,suspense:i,fallbackData:o,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:m,refreshWhenHidden:g,refreshWhenOffline:f,keepPreviousData:h,strictServerPrefetchWarning:p}=n,[S,y,w,T]=Wt.get(r),[x,C]=uo(e),j=d.useRef(!1),b=d.useRef(!1),v=d.useRef(x),$=d.useRef(t),E=d.useRef(n),R=()=>E.current,D=()=>R().isVisible()&&R().isOnline(),[M,U,Y,O]=ku(r,x),I=d.useRef({}).current,F=Me(o)?Me(n.fallback)?et:n.fallback[x]:o,A=n.cacheData,k=x?A==null?void 0:A[x]:et,B=x?T[x]:et,G=Me(B)&&!Me(k),_=G?k:B,H=(z,J)=>{for(const le in I){const Se=le;if(Se==="data"){if(!a(z[Se],J[Se])&&(!Me(z[Se])||!a(ae,J[Se])))return!1}else if(J[Se]!==z[Se])return!1}return!0},Z=!j.current,q=d.useMemo(()=>{const z=M(),J=O(),le=Ie=>{const De=qt(Ie);return delete De._k,(()=>{if(!x||!t||R().isPaused())return!1;if(Z&&!Me(l))return l;const ke=Me(F)?De.data:F;return i&&G&&Me(ke)?!1:Me(ke)||u})()?{isValidating:!0,isLoading:!0,...De}:De},Se=le(z),Ee=z===J?Se:le(J);let Fe=Se;return[()=>{const Ie=le(M());return H(Ie,Fe)?(Fe.data=Ie.data,Fe.isLoading=Ie.isLoading,Fe.isValidating=Ie.isValidating,Fe.error=Ie.error,Fe):(Fe=Ie,Ie)},()=>Ee]},[r,x]),V=sl.useSyncExternalStore(d.useCallback(z=>Y(x,(J,le)=>{H(le,J)||z()}),[r,x]),q[0],q[1]),L=S[x]&&S[x].length>0,K=V.data;let P=Me(K)?F&&wi(F)?xs(F):F:K;const W=V.error,te=d.useRef(P),re=d.useRef(et);let X=re.current;X||(X=new WeakMap,re.current=X);const se=d.useRef(null);let ae=h?Me(K)?Me(te.current)?P:te.current:K:P;const ue=x&&Me(P),pe=d.useRef(null);!On&&sl.useSyncExternalStore(Th,()=>(pe.current=!1,pe),()=>(pe.current=!0,pe));const me=pe.current;p&&me&&!i&&ue&&console.warn(`Missing pre-initiated data for serialized key "${x}" during server-side rendering. Data fetching should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const fe=!x||!t||R().isPaused()||L&&!Me(W)?!1:Z&&!Me(l)?l:i&&G&&ue?!1:i?Me(P)?!1:u:Me(P)||u,ye=Z&&fe,Te=Me(V.isValidating)?ye:V.isValidating,Oe=Me(V.isLoading)?ye:V.isLoading,Ae=d.useCallback(async z=>{const J=$.current;if(!x||!J||b.current||R().isPaused())return!1;let le,Se,Ee=!0;const Fe=z||{},Ie=!w[x]||!Fe.dedupe,De=G&&!ul(X,A,x)&&!Me(_)&&Me(M().data),ve=()=>ol?!b.current&&x===v.current&&j.current:x===v.current,ke={isValidating:!1,isLoading:!1},Le=()=>{U(ke)},lt=()=>{const ne=w[x];ne&&ne[1]===Se&&delete w[x]},nt={isValidating:!0};Me(M().data)&&(nt.isLoading=!0);try{if(Ie&&(U(nt),n.loadingTimeout&&Me(M().data)&&setTimeout(()=>{Ee&&ve()&&R().onLoadingSlow(x,n)},n.loadingTimeout),De&&Ya(X,A,x),w[x]=[De?_:J(C),Qs()],De&&T[x]&&delete T[x]),[le,Se]=w[x],le=await le,Ie&&setTimeout(lt,n.dedupingInterval),!w[x]||w[x][1]!==Se)return Ie&&ve()&&R().onDiscarded(x),!1;ke.error=et;const ne=y[x];if(!Me(ne)&&(Se<=ne[0]||Se<=ne[1]||ne[1]===0))return Le(),Ie&&ve()&&R().onDiscarded(x),!1;const Q=M().data;ke.data=a(Q,le)?Q:le,Ie&&ve()&&R().onSuccess(le,x,n)}catch(ne){lt();const Q=R(),{shouldRetryOnError:he}=Q;Q.isPaused()||(ke.error=ne,Ie&&ve()&&(Q.onError(ne,x,Q),(he===!0||Ut(he)&&he(ne))&&(!R().revalidateOnFocus||!R().revalidateOnReconnect||D())&&Q.onErrorRetry(ne,x,Q,Ce=>{const Je=S[x];Je&&Je[0]&&Je[0](il,Ce)},{retryCount:(Fe.retryCount||0)+1,dedupe:!0})))}return Ee=!1,Le(),!0},[x,r]),ze=d.useCallback((...z)=>Ou(r,v.current,...z),[]);if(rr(()=>{const z=se.current;z&&(se.current=null,Ya(X,z.cacheData,z.key),Me(M().data)&&U({data:z.data,error:et,_k:z._k}),T[z.key]&&delete T[z.key])}),rr(()=>{$.current=t,E.current=n,Me(K)||(te.current=K)}),rr(()=>{if(t||!G||Me(_)||ul(X,A,x)||!Me(M().data))return;Ya(X,A,x);const z=y[x];vh({value:_,getCacheData:()=>M().data,canCommit:()=>!b.current&&x===v.current&&y[x]===z,setCache:J=>U({...J,_k:C})})}),rr(()=>{if(!x)return;const z=Ae.bind(et,Ua);let J=0;R().revalidateOnFocus&&(J=Date.now()+R().focusThrottleInterval);const Se=jh(x,S,(Ee,Fe={})=>{if(Ee==Ru){const Ie=Date.now();R().revalidateOnFocus&&Ie>J&&D()&&(J=Ie+R().focusThrottleInterval,z())}else if(Ee==Iu)R().revalidateOnReconnect&&D()&&z();else{if(Ee==Mu)return Ae();if(Ee==il)return Ae(Fe);if(Ee==Au&&(te.current=et,Fe.revalidate))return Ae()}});return b.current=!1,v.current=x,j.current=!0,U({_k:C}),fe&&(w[x]||(Me(P)||On?z():oh(z))),()=>{b.current=!0,Se()}},[x]),rr(()=>{let z;function J(){const Se=Ut(m)?m(M().data):m;Se&&z!==-1&&(z=setTimeout(le,Se))}function le(){!M().error&&(g||R().isVisible())&&(f||R().isOnline())?Ae(Ua).then(J):J()}return J(),()=>{z&&(clearTimeout(z),z=-1)}},[m,g,f,x]),d.useDebugValue(ae),i){if(!ol&&On&&ue&&Me(_))throw new Error("Fallback data is required when using Suspense in SSR.");ue&&($.current=t,E.current=n,b.current=!1);const z=!Me(_)&&ue;let J=et;if(z&&G)J=_&&wi(_)?xs(_):_,P=J,ae=J,On||(se.current={data:J,_k:C,key:x,cacheData:A});else{const Se=z?ze(_):ea;xs(Se)}if(!Me(W)&&ue)throw W;const le=ue&&Me(J)?Ae(Ua):ea;!Me(ae)&&ue&&(le.status="fulfilled",le.value=!0),xs(le)}return{mutate:ze,get data(){return I.data=!0,ae},get error(){return I.error=!0,W},get isValidating(){return I.isValidating=!0,Te},get isLoading(){return I.isLoading=!0,Oe}}},$h=Xs.defineProperty(gh,"defaultValue",{value:Pu}),zu=wh(Fh),Eh={moneySymbol:"$",form:{lightFilter:{more:"المزيد",clear:"نظف",confirm:"تأكيد",itemUnit:"عناصر"}},tableForm:{search:"ابحث",reset:"إعادة تعيين",submit:"ارسال",collapsed:"مُقلص",expand:"مُوسع",inputPlaceholder:"الرجاء الإدخال",selectPlaceholder:"الرجاء الإختيار"},alert:{clear:"نظف",selected:"محدد",item:"عنصر"},pagination:{total:{range:" ",total:"من",item:"عناصر"}},tableToolBar:{leftPin:"ثبت على اليسار",rightPin:"ثبت على اليمين",noPin:"الغاء التثبيت",leftFixedTitle:"لصق على اليسار",rightFixedTitle:"لصق على اليمين",noFixedTitle:"إلغاء الإلصاق",reset:"إعادة تعيين",columnDisplay:"الأعمدة المعروضة",columnSetting:"الإعدادات",fullScreen:"وضع كامل الشاشة",exitFullScreen:"الخروج من وضع كامل الشاشة",reload:"تحديث",density:"الكثافة",densityDefault:"افتراضي",densityLarger:"أكبر",densityMiddle:"وسط",densitySmall:"مدمج"},stepsForm:{next:"التالي",prev:"السابق",submit:"أنهى"},loginForm:{submitText:"تسجيل الدخول"},editableTable:{action:{save:"أنقذ",cancel:"إلغاء الأمر",delete:"حذف",add:"إضافة صف من البيانات"}},switch:{open:"مفتوح",close:"غلق"}},Rh={moneySymbol:"€",form:{lightFilter:{more:"Més",clear:"Netejar",confirm:"Confirmar",itemUnit:"Elements"}},tableForm:{search:"Cercar",reset:"Netejar",submit:"Enviar",collapsed:"Expandir",expand:"Col·lapsar",inputPlaceholder:"Introduïu valor",selectPlaceholder:"Seleccioneu valor"},alert:{clear:"Netejar",selected:"Seleccionat",item:"Article"},pagination:{total:{range:" ",total:"de",item:"articles"}},tableToolBar:{leftPin:"Pin a l'esquerra",rightPin:"Pin a la dreta",noPin:"Sense Pin",leftFixedTitle:"Fixat a l'esquerra",rightFixedTitle:"Fixat a la dreta",noFixedTitle:"Sense fixar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuració",fullScreen:"Pantalla Completa",exitFullScreen:"Sortir Pantalla Completa",reload:"Refrescar",density:"Densitat",densityDefault:"Per Defecte",densityLarger:"Llarg",densityMiddle:"Mitjà",densitySmall:"Compacte"},stepsForm:{next:"Següent",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Cancel·lar",delete:"Eliminar",add:"afegir una fila de dades"}},switch:{open:"obert",close:"tancat"}},Ih={moneySymbol:"Kč",deleteThisLine:"Smazat tento řádek",copyThisLine:"Kopírovat tento řádek",form:{lightFilter:{more:"Víc",clear:"Vymazat",confirm:"Potvrdit",itemUnit:"Položky"}},tableForm:{search:"Hledat",reset:"Resetovat",submit:"Odeslat",collapsed:"Zvětšit",expand:"Zmenšit",inputPlaceholder:"Zadejte prosím",selectPlaceholder:"Vyberte prosím"},alert:{clear:"Vymazat",selected:"Vybráno",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položek"}},tableToolBar:{leftPin:"Připnout doleva",rightPin:"Připnout doprava",noPin:"Odepnuto",leftFixedTitle:"Fixováno nalevo",rightFixedTitle:"Fixováno napravo",noFixedTitle:"Nefixováno",reset:"Resetovat",columnDisplay:"Zobrazení sloupců",columnSetting:"Nastavení",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončit celou obrazovku",reload:"Obnovit",density:"Hustota",densityDefault:"Výchozí",densityLarger:"Větší",densityMiddle:"Střední",densitySmall:"Kompaktní"},stepsForm:{next:"Další",prev:"Předchozí",submit:"Dokončit"},loginForm:{submitText:"Přihlásit se"},editableTable:{onlyOneLineEditor:"Upravit lze pouze jeden řádek",action:{save:"Uložit",cancel:"Zrušit",delete:"Vymazat",add:"Přidat řádek"}},switch:{open:"Otevřít",close:"Zavřít"}},Mh={moneySymbol:"€",form:{lightFilter:{more:"Mehr",clear:"Zurücksetzen",confirm:"Bestätigen",itemUnit:"Einträge"}},tableForm:{search:"Suchen",reset:"Zurücksetzen",submit:"Absenden",collapsed:"Zeige mehr",expand:"Zeige weniger",inputPlaceholder:"Bitte eingeben",selectPlaceholder:"Bitte auswählen"},alert:{clear:"Zurücksetzen",selected:"Ausgewählt",item:"Eintrag"},pagination:{total:{range:" ",total:"von",item:"Einträgen"}},tableToolBar:{leftPin:"Links anheften",rightPin:"Rechts anheften",noPin:"Nicht angeheftet",leftFixedTitle:"Links fixiert",rightFixedTitle:"Rechts fixiert",noFixedTitle:"Nicht fixiert",reset:"Zurücksetzen",columnDisplay:"Angezeigte Reihen",columnSetting:"Einstellungen",fullScreen:"Vollbild",exitFullScreen:"Vollbild verlassen",reload:"Aktualisieren",density:"Abstand",densityDefault:"Standard",densityLarger:"Größer",densityMiddle:"Mittel",densitySmall:"Kompakt"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Anmelden"},editableTable:{action:{save:"Retten",cancel:"Abbrechen",delete:"Löschen",add:"Hinzufügen einer Datenzeile"}},switch:{open:"offen",close:"schließen"}},Ah={moneySymbol:"£",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},kh={moneySymbol:"$",deleteThisLine:"Delete this line",copyThisLine:"Copy this line",form:{lightFilter:{more:"More",clear:"Clear",confirm:"Confirm",itemUnit:"Items"}},tableForm:{search:"Query",reset:"Reset",submit:"Submit",collapsed:"Expand",expand:"Collapse",inputPlaceholder:"Please enter",selectPlaceholder:"Please select"},alert:{clear:"Clear",selected:"Selected",item:"Item"},pagination:{total:{range:" ",total:"of",item:"items"}},tableToolBar:{leftPin:"Pin to left",rightPin:"Pin to right",noPin:"Unpinned",leftFixedTitle:"Fixed to the left",rightFixedTitle:"Fixed to the right",noFixedTitle:"Not Fixed",reset:"Reset",columnDisplay:"Column Display",columnSetting:"Table Settings",fullScreen:"Full Screen",exitFullScreen:"Exit Full Screen",reload:"Refresh",density:"Density",densityDefault:"Default",densityLarger:"Larger",densityMiddle:"Middle",densitySmall:"Compact"},stepsForm:{next:"Next",prev:"Previous",submit:"Finish"},loginForm:{submitText:"Login"},editableTable:{onlyOneLineEditor:"Only one line can be edited",onlyAddOneLine:"Only one line can be added",action:{save:"Save",cancel:"Cancel",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"close"}},Oh={moneySymbol:"€",form:{lightFilter:{more:"Más",clear:"Limpiar",confirm:"Confirmar",itemUnit:"artículos"}},tableForm:{search:"Buscar",reset:"Limpiar",submit:"Submit",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Ingrese valor",selectPlaceholder:"Seleccione valor"},alert:{clear:"Limpiar",selected:"Seleccionado",item:"Articulo"},pagination:{total:{range:" ",total:"de",item:"artículos"}},tableToolBar:{leftPin:"Pin a la izquierda",rightPin:"Pin a la derecha",noPin:"Sin Pin",leftFixedTitle:"Fijado a la izquierda",rightFixedTitle:"Fijado a la derecha",noFixedTitle:"Sin Fijar",reset:"Reiniciar",columnDisplay:"Mostrar Columna",columnSetting:"Configuración",fullScreen:"Pantalla Completa",exitFullScreen:"Salir Pantalla Completa",reload:"Refrescar",density:"Densidad",densityDefault:"Por Defecto",densityLarger:"Largo",densityMiddle:"Medio",densitySmall:"Compacto"},stepsForm:{next:"Siguiente",prev:"Anterior",submit:"Finalizar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Guardar",cancel:"Descartar",delete:"Borrar",add:"añadir una fila de datos"}},switch:{open:"abrir",close:"cerrar"}},Dh={moneySymbol:"تومان",form:{lightFilter:{more:"بیشتر",clear:"پاک کردن",confirm:"تایید",itemUnit:"مورد"}},tableForm:{search:"جستجو",reset:"بازنشانی",submit:"تایید",collapsed:"نمایش بیشتر",expand:"نمایش کمتر",inputPlaceholder:"پیدا کنید",selectPlaceholder:"انتخاب کنید"},alert:{clear:"پاک سازی",selected:"انتخاب",item:"مورد"},pagination:{total:{range:" ",total:"از",item:"مورد"}},tableToolBar:{leftPin:"سنجاق به چپ",rightPin:"سنجاق به راست",noPin:"سنجاق نشده",leftFixedTitle:"ثابت شده در چپ",rightFixedTitle:"ثابت شده در راست",noFixedTitle:"شناور",reset:"بازنشانی",columnDisplay:"نمایش همه",columnSetting:"تنظیمات",fullScreen:"تمام صفحه",exitFullScreen:"خروج از حالت تمام صفحه",reload:"تازه سازی",density:"تراکم",densityDefault:"پیش فرض",densityLarger:"بزرگ",densityMiddle:"متوسط",densitySmall:"کوچک"},stepsForm:{next:"بعدی",prev:"قبلی",submit:"اتمام"},loginForm:{submitText:"ورود"},editableTable:{action:{save:"ذخیره",cancel:"لغو",delete:"حذف",add:"یک ردیف داده اضافه کنید"}},switch:{open:"باز",close:"نزدیک"}},Ph={moneySymbol:"€",form:{lightFilter:{more:"Plus",clear:"Effacer",confirm:"Confirmer",itemUnit:"Items"}},tableForm:{search:"Rechercher",reset:"Réinitialiser",submit:"Envoyer",collapsed:"Agrandir",expand:"Réduire",inputPlaceholder:"Entrer une valeur",selectPlaceholder:"Sélectionner une valeur"},alert:{clear:"Réinitialiser",selected:"Sélectionné",item:"Item"},pagination:{total:{range:" ",total:"sur",item:"éléments"}},tableToolBar:{leftPin:"Épingler à gauche",rightPin:"Épingler à gauche",noPin:"Sans épingle",leftFixedTitle:"Fixer à gauche",rightFixedTitle:"Fixer à droite",noFixedTitle:"Non fixé",reset:"Réinitialiser",columnDisplay:"Affichage colonne",columnSetting:"Réglages",fullScreen:"Plein écran",exitFullScreen:"Quitter Plein écran",reload:"Rafraichir",density:"Densité",densityDefault:"Par défaut",densityLarger:"Larger",densityMiddle:"Moyenne",densitySmall:"Compacte"},stepsForm:{next:"Suivante",prev:"Précédente",submit:"Finaliser"},loginForm:{submitText:"Se connecter"},editableTable:{action:{save:"Sauvegarder",cancel:"Annuler",delete:"Supprimer",add:"ajouter une ligne de données"}},switch:{open:"ouvert",close:"près"}},Nh={moneySymbol:"₪",deleteThisLine:"מחק שורה זו",copyThisLine:"העתק שורה זו",form:{lightFilter:{more:"יותר",clear:"נקה",confirm:"אישור",itemUnit:"פריטים"}},tableForm:{search:"חיפוש",reset:"איפוס",submit:"שלח",collapsed:"הרחב",expand:"כווץ",inputPlaceholder:"אנא הכנס",selectPlaceholder:"אנא בחר"},alert:{clear:"נקה",selected:"נבחר",item:"פריט"},pagination:{total:{range:" ",total:"מתוך",item:"פריטים"}},tableToolBar:{leftPin:"הצמד לשמאל",rightPin:"הצמד לימין",noPin:"לא מצורף",leftFixedTitle:"מוצמד לשמאל",rightFixedTitle:"מוצמד לימין",noFixedTitle:"לא מוצמד",reset:"איפוס",columnDisplay:"תצוגת עמודות",columnSetting:"הגדרות",fullScreen:"מסך מלא",exitFullScreen:"צא ממסך מלא",reload:"רענן",density:"רזולוציה",densityDefault:"ברירת מחדל",densityLarger:"גדול",densityMiddle:"בינוני",densitySmall:"קטן"},stepsForm:{next:"הבא",prev:"קודם",submit:"סיום"},loginForm:{submitText:"כניסה"},editableTable:{onlyOneLineEditor:"ניתן לערוך רק שורה אחת",action:{save:"שמור",cancel:"ביטול",delete:"מחיקה",add:"הוסף שורת נתונים"}},switch:{open:"פתח",close:"סגור"}},Lh={moneySymbol:"kn",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pretraži",reset:"Poništi",submit:"Potvrdi",collapsed:"Raširi",expand:"Skupi",inputPlaceholder:"Unesite",selectPlaceholder:"Odaberite"},alert:{clear:"Očisti",selected:"Odaberi",item:"stavke"},pagination:{total:{range:" ",total:"od",item:"stavke"}},tableToolBar:{leftPin:"Prikači lijevo",rightPin:"Prikači desno",noPin:"Bez prikačenja",leftFixedTitle:"Fiksiraj lijevo",rightFixedTitle:"Fiksiraj desno",noFixedTitle:"Bez fiksiranja",reset:"Resetiraj",columnDisplay:"Prikaz stupaca",columnSetting:"Postavke",fullScreen:"Puni zaslon",exitFullScreen:"Izađi iz punog zaslona",reload:"Ponovno učitaj",density:"Veličina",densityDefault:"Zadano",densityLarger:"Veliko",densityMiddle:"Srednje",densitySmall:"Malo"},stepsForm:{next:"Sljedeći",prev:"Prethodni",submit:"Kraj"},loginForm:{submitText:"Prijava"},editableTable:{action:{save:"Spremi",cancel:"Odustani",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"otvori",close:"zatvori"}},_h={moneySymbol:"RP",form:{lightFilter:{more:"Lebih",clear:"Hapus",confirm:"Konfirmasi",itemUnit:"Unit"}},tableForm:{search:"Cari",reset:"Atur ulang",submit:"Kirim",collapsed:"Lebih sedikit",expand:"Lebih banyak",inputPlaceholder:"Masukkan pencarian",selectPlaceholder:"Pilih"},alert:{clear:"Hapus",selected:"Dipilih",item:"Butir"},pagination:{total:{range:" ",total:"Dari",item:"Butir"}},tableToolBar:{leftPin:"Pin kiri",rightPin:"Pin kanan",noPin:"Tidak ada pin",leftFixedTitle:"Rata kiri",rightFixedTitle:"Rata kanan",noFixedTitle:"Tidak tetap",reset:"Atur ulang",columnDisplay:"Tampilan kolom",columnSetting:"Pengaturan",fullScreen:"Layar penuh",exitFullScreen:"Keluar layar penuh",reload:"Atur ulang",density:"Kerapatan",densityDefault:"Standar",densityLarger:"Lebih besar",densityMiddle:"Sedang",densitySmall:"Rapat"},stepsForm:{next:"Selanjutnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Login"},editableTable:{action:{save:"simpan",cancel:"batal",delete:"hapus",add:"Tambahkan baris data"}},switch:{open:"buka",close:"tutup"}},zh={moneySymbol:"€",form:{lightFilter:{more:"più",clear:"pulisci",confirm:"conferma",itemUnit:"elementi"}},tableForm:{search:"Filtra",reset:"Pulisci",submit:"Invia",collapsed:"Espandi",expand:"Contrai",inputPlaceholder:"Digita",selectPlaceholder:"Seleziona"},alert:{clear:"Rimuovi",selected:"Selezionati",item:"elementi"},pagination:{total:{range:" ",total:"di",item:"elementi"}},tableToolBar:{leftPin:"Fissa a sinistra",rightPin:"Fissa a destra",noPin:"Ripristina posizione",leftFixedTitle:"Fissato a sinistra",rightFixedTitle:"Fissato a destra",noFixedTitle:"Non fissato",reset:"Ripristina",columnDisplay:"Disposizione colonne",columnSetting:"Impostazioni",fullScreen:"Modalità schermo intero",exitFullScreen:"Esci da modalità schermo intero",reload:"Ricarica",density:"Grandezza tabella",densityDefault:"predefinito",densityLarger:"Grande",densityMiddle:"Media",densitySmall:"Compatta"},stepsForm:{next:"successivo",prev:"precedente",submit:"finisci"},loginForm:{submitText:"Accedi"},editableTable:{action:{save:"salva",cancel:"annulla",delete:"Delete",add:"add a row of data"}},switch:{open:"open",close:"chiudi"}},Bh={moneySymbol:"¥",form:{lightFilter:{more:"更に",clear:"クリア",confirm:"確認",itemUnit:"アイテム"}},tableForm:{search:"検索",reset:"リセット",submit:"送信",collapsed:"拡大",expand:"折畳",inputPlaceholder:"入力してください",selectPlaceholder:"選択してください"},alert:{clear:"クリア",selected:"選択した",item:"アイテム"},pagination:{total:{range:"レコード",total:"/合計",item:" "}},tableToolBar:{leftPin:"左に固定",rightPin:"右に固定",noPin:"キャンセル",leftFixedTitle:"左に固定された項目",rightFixedTitle:"右に固定された項目",noFixedTitle:"固定されてない項目",reset:"リセット",columnDisplay:"表示列",columnSetting:"列表示設定",fullScreen:"フルスクリーン",exitFullScreen:"終了",reload:"更新",density:"行高",densityDefault:"デフォルト",densityLarger:"大",densityMiddle:"中",densitySmall:"小"},stepsForm:{next:"次へ",prev:"前へ",submit:"送信"},loginForm:{submitText:"ログイン"},editableTable:{action:{save:"保存",cancel:"キャンセル",delete:"削除",add:"追加"}},switch:{open:"開く",close:"閉じる"}},Vh={moneySymbol:"₩",form:{lightFilter:{more:"더보기",clear:"초기화",confirm:"확인",itemUnit:"건수"}},tableForm:{search:"조회",reset:"초기화",submit:"제출",collapsed:"확장",expand:"닫기",inputPlaceholder:"입력해 주세요",selectPlaceholder:"선택해 주세요"},alert:{clear:"취소",selected:"선택",item:"건"},pagination:{total:{range:" ",total:"/ 총",item:"건"}},tableToolBar:{leftPin:"왼쪽으로 핀",rightPin:"오른쪽으로 핀",noPin:"핀 제거",leftFixedTitle:"왼쪽으로 고정",rightFixedTitle:"오른쪽으로 고정",noFixedTitle:"비고정",reset:"초기화",columnDisplay:"컬럼 표시",columnSetting:"설정",fullScreen:"전체 화면",exitFullScreen:"전체 화면 취소",reload:"새로 고침",density:"여백",densityDefault:"기본",densityLarger:"많은 여백",densityMiddle:"중간 여백",densitySmall:"좁은 여백"},stepsForm:{next:"다음",prev:"이전",submit:"종료"},loginForm:{submitText:"로그인"},editableTable:{action:{save:"저장",cancel:"취소",delete:"삭제",add:"데이터 행 추가"}},switch:{open:"열",close:"가까 운"}},Hh={moneySymbol:"₮",form:{lightFilter:{more:"Илүү",clear:"Цэвэрлэх",confirm:"Баталгаажуулах",itemUnit:"Нэгжүүд"}},tableForm:{search:"Хайх",reset:"Шинэчлэх",submit:"Илгээх",collapsed:"Өргөтгөх",expand:"Хураах",inputPlaceholder:"Утга оруулна уу",selectPlaceholder:"Утга сонгоно уу"},alert:{clear:"Цэвэрлэх",selected:"Сонгогдсон",item:"Нэгж"},pagination:{total:{range:" ",total:"Нийт",item:"мөр"}},tableToolBar:{leftPin:"Зүүн тийш бэхлэх",rightPin:"Баруун тийш бэхлэх",noPin:"Бэхлэхгүй",leftFixedTitle:"Зүүн зэрэгцүүлэх",rightFixedTitle:"Баруун зэрэгцүүлэх",noFixedTitle:"Зэрэгцүүлэхгүй",reset:"Шинэчлэх",columnDisplay:"Баганаар харуулах",columnSetting:"Тохиргоо",fullScreen:"Бүтэн дэлгэцээр",exitFullScreen:"Бүтэн дэлгэц цуцлах",reload:"Шинэчлэх",density:"Хэмжээ",densityDefault:"Хэвийн",densityLarger:"Том",densityMiddle:"Дунд",densitySmall:"Жижиг"},stepsForm:{next:"Дараах",prev:"Өмнөх",submit:"Дуусгах"},loginForm:{submitText:"Нэвтрэх"},editableTable:{action:{save:"Хадгалах",cancel:"Цуцлах",delete:"Устгах",add:"Мөр нэмэх"}},switch:{open:"Нээх",close:"Хаах"}},Uh={moneySymbol:"RM",form:{lightFilter:{more:"Lebih banyak",clear:"Jelas",confirm:"Mengesahkan",itemUnit:"Item"}},tableForm:{search:"Cari",reset:"Menetapkan semula",submit:"Hantar",collapsed:"Kembang",expand:"Kuncup",inputPlaceholder:"Sila masuk",selectPlaceholder:"Sila pilih"},alert:{clear:"Padam",selected:"Dipilih",item:"Item"},pagination:{total:{range:" ",total:"daripada",item:"item"}},tableToolBar:{leftPin:"Pin ke kiri",rightPin:"Pin ke kanan",noPin:"Tidak pin",leftFixedTitle:"Tetap ke kiri",rightFixedTitle:"Tetap ke kanan",noFixedTitle:"Tidak Tetap",reset:"Menetapkan semula",columnDisplay:"Lajur",columnSetting:"Settings",fullScreen:"Full Screen",exitFullScreen:"Keluar Full Screen",reload:"Muat Semula",density:"Densiti",densityDefault:"Biasa",densityLarger:"Besar",densityMiddle:"Tengah",densitySmall:"Kecil"},stepsForm:{next:"Seterusnya",prev:"Sebelumnya",submit:"Selesai"},loginForm:{submitText:"Log Masuk"},editableTable:{action:{save:"Simpan",cancel:"Membatalkan",delete:"Menghapuskan",add:"tambah baris data"}},switch:{open:"Terbuka",close:"Tutup"}},Yh={moneySymbol:"€",deleteThisLine:"Verwijder deze regel",copyThisLine:"Kopieer deze regel",form:{lightFilter:{more:"Meer filters",clear:"Wissen",confirm:"Bevestigen",itemUnit:"item"}},tableForm:{search:"Zoeken",reset:"Resetten",submit:"Indienen",collapsed:"Uitvouwen",expand:"Inklappen",inputPlaceholder:"Voer in",selectPlaceholder:"Selecteer"},alert:{clear:"Selectie annuleren",selected:"Geselecteerd",item:"item"},pagination:{total:{range:"Van",total:"items/totaal",item:"items"}},tableToolBar:{leftPin:"Vastzetten aan begin",rightPin:"Vastzetten aan einde",noPin:"Niet vastzetten",leftFixedTitle:"Vastzetten aan de linkerkant",rightFixedTitle:"Vastzetten aan de rechterkant",noFixedTitle:"Niet vastzetten",reset:"Resetten",columnDisplay:"Kolomweergave",columnSetting:"Kolominstellingen",fullScreen:"Volledig scherm",exitFullScreen:"Verlaat volledig scherm",reload:"Vernieuwen",density:"Dichtheid",densityDefault:"Normaal",densityLarger:"Ruim",densityMiddle:"Gemiddeld",densitySmall:"Compact"},stepsForm:{next:"Volgende stap",prev:"Vorige stap",submit:"Indienen"},loginForm:{submitText:"Inloggen"},editableTable:{onlyOneLineEditor:"Slechts één regel tegelijk bewerken",action:{save:"Opslaan",cancel:"Annuleren",delete:"Verwijderen",add:"Een regel toevoegen"}},switch:{open:"Openen",close:"Sluiten"}},Kh={moneySymbol:"zł",form:{lightFilter:{more:"Więcej",clear:"Wyczyść",confirm:"Potwierdź",itemUnit:"Ilość"}},tableForm:{search:"Szukaj",reset:"Reset",submit:"Zatwierdź",collapsed:"Pokaż wiecej",expand:"Pokaż mniej",inputPlaceholder:"Proszę podać",selectPlaceholder:"Proszę wybrać"},alert:{clear:"Wyczyść",selected:"Wybrane",item:"Wpis"},pagination:{total:{range:" ",total:"z",item:"Wpisów"}},tableToolBar:{leftPin:"Przypnij do lewej",rightPin:"Przypnij do prawej",noPin:"Odepnij",leftFixedTitle:"Przypięte do lewej",rightFixedTitle:"Przypięte do prawej",noFixedTitle:"Nieprzypięte",reset:"Reset",columnDisplay:"Wyświetlane wiersze",columnSetting:"Ustawienia",fullScreen:"Pełen ekran",exitFullScreen:"Zamknij pełen ekran",reload:"Odśwież",density:"Odstęp",densityDefault:"Standard",densityLarger:"Wiekszy",densityMiddle:"Sredni",densitySmall:"Kompaktowy"},stepsForm:{next:"Weiter",prev:"Zurück",submit:"Abschließen"},loginForm:{submitText:"Zaloguj się"},editableTable:{action:{save:"Zapisać",cancel:"Anuluj",delete:"Usunąć",add:"dodawanie wiersza danych"}},switch:{open:"otwierać",close:"zamykać"}},Wh={moneySymbol:"R$",form:{lightFilter:{more:"Mais",clear:"Limpar",confirm:"Confirmar",itemUnit:"Itens"}},tableForm:{search:"Filtrar",reset:"Limpar",submit:"Confirmar",collapsed:"Expandir",expand:"Colapsar",inputPlaceholder:"Por favor insira",selectPlaceholder:"Por favor selecione"},alert:{clear:"Limpar",selected:"Selecionado(s)",item:"Item(s)"},pagination:{total:{range:" ",total:"de",item:"itens"}},tableToolBar:{leftPin:"Fixar à esquerda",rightPin:"Fixar à direita",noPin:"Desfixado",leftFixedTitle:"Fixado à esquerda",rightFixedTitle:"Fixado à direita",noFixedTitle:"Não fixado",reset:"Limpar",columnDisplay:"Mostrar Coluna",columnSetting:"Configurações",fullScreen:"Tela Cheia",exitFullScreen:"Sair da Tela Cheia",reload:"Atualizar",density:"Densidade",densityDefault:"Padrão",densityLarger:"Largo",densityMiddle:"Médio",densitySmall:"Compacto"},stepsForm:{next:"Próximo",prev:"Anterior",submit:"Enviar"},loginForm:{submitText:"Entrar"},editableTable:{action:{save:"Salvar",cancel:"Cancelar",delete:"Apagar",add:"adicionar uma linha de dados"}},switch:{open:"abrir",close:"fechar"}},qh={moneySymbol:"RON",deleteThisLine:"Șterge acest rând",copyThisLine:"Copiază acest rând",form:{lightFilter:{more:"Mai multe filtre",clear:"Curăță",confirm:"Confirmă",itemUnit:"elemente"}},tableForm:{search:"Caută",reset:"Resetează",submit:"Trimite",collapsed:"Extinde",expand:"Restrânge",inputPlaceholder:"Introduceți",selectPlaceholder:"Selectați"},alert:{clear:"Anulează selecția",selected:"Selectat",item:"elemente"},pagination:{total:{range:"De la",total:"elemente/total",item:"elemente"}},tableToolBar:{leftPin:"Fixează la început",rightPin:"Fixează la sfârșit",noPin:"Nu fixa",leftFixedTitle:"Fixează în stânga",rightFixedTitle:"Fixează în dreapta",noFixedTitle:"Nu fixa",reset:"Resetează",columnDisplay:"Afișare coloane",columnSetting:"Setări coloane",fullScreen:"Ecran complet",exitFullScreen:"Ieși din ecran complet",reload:"Reîncarcă",density:"Densitate",densityDefault:"Normal",densityLarger:"Larg",densityMiddle:"Mediu",densitySmall:"Compact"},stepsForm:{next:"Pasul următor",prev:"Pasul anterior",submit:"Trimite"},loginForm:{submitText:"Autentificare"},editableTable:{onlyOneLineEditor:"Se poate edita doar un rând simultan",action:{save:"Salvează",cancel:"Anulează",delete:"Șterge",add:"Adaugă un rând"}},switch:{open:"Deschide",close:"Închide"}},Gh={moneySymbol:"₽",form:{lightFilter:{more:"Еще",clear:"Очистить",confirm:"ОК",itemUnit:"Позиции"}},tableForm:{search:"Найти",reset:"Сброс",submit:"Отправить",collapsed:"Развернуть",expand:"Свернуть",inputPlaceholder:"Введите значение",selectPlaceholder:"Выберите значение"},alert:{clear:"Очистить",selected:"Выбрано",item:"элементов"},pagination:{total:{range:" ",total:"из",item:"элементов"}},tableToolBar:{leftPin:"Закрепить слева",rightPin:"Закрепить справа",noPin:"Открепить",leftFixedTitle:"Закреплено слева",rightFixedTitle:"Закреплено справа",noFixedTitle:"Не закреплено",reset:"Сброс",columnDisplay:"Отображение столбца",columnSetting:"Настройки",fullScreen:"Полный экран",exitFullScreen:"Выйти из полноэкранного режима",reload:"Обновить",density:"Размер",densityDefault:"По умолчанию",densityLarger:"Большой",densityMiddle:"Средний",densitySmall:"Сжатый"},stepsForm:{next:"Следующий",prev:"Предыдущий",submit:"Завершить"},loginForm:{submitText:"Вход"},editableTable:{action:{save:"Сохранить",cancel:"Отменить",delete:"Удалить",add:"добавить ряд данных"}},switch:{open:"Открытый чемпионат мира по теннису",close:"По адресу:"}},Zh={moneySymbol:"€",deleteThisLine:"Odstrániť tento riadok",copyThisLine:"Skopírujte tento riadok",form:{lightFilter:{more:"Viac",clear:"Vyčistiť",confirm:"Potvrďte",itemUnit:"Položky"}},tableForm:{search:"Vyhladať",reset:"Resetovať",submit:"Odoslať",collapsed:"Rozbaliť",expand:"Zbaliť",inputPlaceholder:"Prosím, zadajte",selectPlaceholder:"Prosím, vyberte"},alert:{clear:"Vyčistiť",selected:"Vybraný",item:"Položka"},pagination:{total:{range:" ",total:"z",item:"položiek"}},tableToolBar:{leftPin:"Pripnúť vľavo",rightPin:"Pripnúť vpravo",noPin:"Odopnuté",leftFixedTitle:"Fixované na ľavo",rightFixedTitle:"Fixované na pravo",noFixedTitle:"Nefixované",reset:"Resetovať",columnDisplay:"Zobrazenie stĺpcov",columnSetting:"Nastavenia",fullScreen:"Celá obrazovka",exitFullScreen:"Ukončiť celú obrazovku",reload:"Obnoviť",density:"Hustota",densityDefault:"Predvolené",densityLarger:"Väčšie",densityMiddle:"Stredné",densitySmall:"Kompaktné"},stepsForm:{next:"Ďalšie",prev:"Predchádzajúce",submit:"Potvrdiť"},loginForm:{submitText:"Prihlásiť sa"},editableTable:{onlyOneLineEditor:"Upravovať možno iba jeden riadok",action:{save:"Uložiť",cancel:"Zrušiť",delete:"Odstrániť",add:"pridať riadok údajov"}},switch:{open:"otvoriť",close:"zavrieť"}},Jh={moneySymbol:"RSD",form:{lightFilter:{more:"Više",clear:"Očisti",confirm:"Potvrdi",itemUnit:"Stavke"}},tableForm:{search:"Pronađi",reset:"Resetuj",submit:"Pošalji",collapsed:"Proširi",expand:"Skupi",inputPlaceholder:"Molimo unesite",selectPlaceholder:"Molimo odaberite"},alert:{clear:"Očisti",selected:"Odabrano",item:"Stavka"},pagination:{total:{range:" ",total:"od",item:"stavki"}},tableToolBar:{leftPin:"Zakači levo",rightPin:"Zakači desno",noPin:"Nije zakačeno",leftFixedTitle:"Fiksirano levo",rightFixedTitle:"Fiksirano desno",noFixedTitle:"Nije fiksirano",reset:"Resetuj",columnDisplay:"Prikaz kolona",columnSetting:"Podešavanja",fullScreen:"Pun ekran",exitFullScreen:"Zatvori pun ekran",reload:"Osveži",density:"Veličina",densityDefault:"Podrazumevana",densityLarger:"Veća",densityMiddle:"Srednja",densitySmall:"Kompaktna"},stepsForm:{next:"Dalje",prev:"Nazad",submit:"Gotovo"},loginForm:{submitText:"Prijavi se"},editableTable:{action:{save:"Sačuvaj",cancel:"Poništi",delete:"Obriši",add:"dodajte red podataka"}},switch:{open:"Отворите",close:"Затворите"}},Xh={moneySymbol:"SEK",deleteThisLine:"Radera denna rad",copyThisLine:"Kopiera denna rad",form:{lightFilter:{more:"Fler filter",clear:"Rensa",confirm:"Bekräfta",itemUnit:"objekt"}},tableForm:{search:"Sök",reset:"Återställ",submit:"Skicka",collapsed:"Expandera",expand:"Fäll ihop",inputPlaceholder:"Vänligen ange",selectPlaceholder:"Vänligen välj"},alert:{clear:"Avbryt val",selected:"Vald",item:"objekt"},pagination:{total:{range:"Från",total:"objekt/totalt",item:"objekt"}},tableToolBar:{leftPin:"Fäst till vänster",rightPin:"Fäst till höger",noPin:"Inte fäst",leftFixedTitle:"Fäst till vänster",rightFixedTitle:"Fäst till höger",noFixedTitle:"Inte fäst",reset:"Återställ",columnDisplay:"Kolumnvisning",columnSetting:"Kolumninställningar",fullScreen:"Fullskärm",exitFullScreen:"Avsluta fullskärm",reload:"Ladda om",density:"Täthet",densityDefault:"Normal",densityLarger:"Lös",densityMiddle:"Medium",densitySmall:"Kompakt"},stepsForm:{next:"Nästa steg",prev:"Föregående steg",submit:"Skicka"},loginForm:{submitText:"Logga in"},editableTable:{onlyOneLineEditor:"Endast en rad kan redigeras åt gången",action:{save:"Spara",cancel:"Avbryt",delete:"Radera",add:"Lägg till en rad"}},switch:{open:"Öppna",close:"Stäng"}},Qh={moneySymbol:"฿",deleteThisLine:"ลบบรรทัดนี้",copyThisLine:"คัดลอกบรรทัดนี้",form:{lightFilter:{more:"มากกว่า",clear:"ชัดเจน",confirm:"ยืนยัน",itemUnit:"รายการ"}},tableForm:{search:"สอบถาม",reset:"รีเซ็ต",submit:"ส่ง",collapsed:"ขยาย",expand:"ทรุด",inputPlaceholder:"กรุณาป้อน",selectPlaceholder:"โปรดเลือก"},alert:{clear:"ชัดเจน",selected:"เลือกแล้ว",item:"รายการ"},pagination:{total:{range:" ",total:"ของ",item:"รายการ"}},tableToolBar:{leftPin:"ปักหมุดไปทางซ้าย",rightPin:"ปักหมุดไปทางขวา",noPin:"เลิกตรึงแล้ว",leftFixedTitle:"แก้ไขด้านซ้าย",rightFixedTitle:"แก้ไขด้านขวา",noFixedTitle:"ไม่คงที่",reset:"รีเซ็ต",columnDisplay:"การแสดงคอลัมน์",columnSetting:"การตั้งค่า",fullScreen:"เต็มจอ",exitFullScreen:"ออกจากโหมดเต็มหน้าจอ",reload:"รีเฟรช",density:"ความหนาแน่น",densityDefault:"ค่าเริ่มต้น",densityLarger:"ขนาดใหญ่ขึ้น",densityMiddle:"กลาง",densitySmall:"กะทัดรัด"},stepsForm:{next:"ถัดไป",prev:"ก่อนหน้า",submit:"เสร็จ"},loginForm:{submitText:"เข้าสู่ระบบ"},editableTable:{onlyOneLineEditor:"แก้ไขได้เพียงบรรทัดเดียวเท่านั้น",action:{save:"บันทึก",cancel:"ยกเลิก",delete:"ลบ",add:"เพิ่มแถวของข้อมูล"}},switch:{open:"เปิด",close:"ปิด"}},eg={moneySymbol:"₺",form:{lightFilter:{more:"Daha Fazla",clear:"Temizle",confirm:"Onayla",itemUnit:"Öğeler"}},tableForm:{search:"Filtrele",reset:"Sıfırla",submit:"Gönder",collapsed:"Daha fazla",expand:"Daha az",inputPlaceholder:"Filtrelemek için bir değer girin",selectPlaceholder:"Filtrelemek için bir değer seçin"},alert:{clear:"Temizle",selected:"Seçili",item:"Öğe"},pagination:{total:{range:" ",total:"Toplam",item:"Öğe"}},tableToolBar:{leftPin:"Sola sabitle",rightPin:"Sağa sabitle",noPin:"Sabitlemeyi kaldır",leftFixedTitle:"Sola sabitlendi",rightFixedTitle:"Sağa sabitlendi",noFixedTitle:"Sabitlenmedi",reset:"Sıfırla",columnDisplay:"Kolon Görünümü",columnSetting:"Ayarlar",fullScreen:"Tam Ekran",exitFullScreen:"Tam Ekrandan Çık",reload:"Yenile",density:"Kalınlık",densityDefault:"Varsayılan",densityLarger:"Büyük",densityMiddle:"Orta",densitySmall:"Küçük"},stepsForm:{next:"Sıradaki",prev:"Önceki",submit:"Gönder"},loginForm:{submitText:"Giriş Yap"},editableTable:{action:{save:"Kaydet",cancel:"Vazgeç",delete:"Sil",add:"foegje in rige gegevens ta"}},switch:{open:"açık",close:"kapatmak"}},tg={moneySymbol:"₴",deleteThisLine:"Видатили рядок",copyThisLine:"Скопіювати рядок",form:{lightFilter:{more:"Ще",clear:"Очистити",confirm:"Ок",itemUnit:"Позиції"}},tableForm:{search:"Пошук",reset:"Очистити",submit:"Відправити",collapsed:"Розгорнути",expand:"Згорнути",inputPlaceholder:"Введіть значення",selectPlaceholder:"Оберіть значення"},alert:{clear:"Очистити",selected:"Обрано",item:"елементів"},pagination:{total:{range:" ",total:"з",item:"елементів"}},tableToolBar:{leftPin:"Закріпити зліва",rightPin:"Закріпити справа",noPin:"Відкріпити",leftFixedTitle:"Закріплено зліва",rightFixedTitle:"Закріплено справа",noFixedTitle:"Не закріплено",reset:"Скинути",columnDisplay:"Відображення стовпців",columnSetting:"Налаштування",fullScreen:"Повноекранний режим",exitFullScreen:"Вийти з повноекранного режиму",reload:"Оновити",density:"Розмір",densityDefault:"За замовчуванням",densityLarger:"Великий",densityMiddle:"Середній",densitySmall:"Стислий"},stepsForm:{next:"Наступний",prev:"Попередній",submit:"Завершити"},loginForm:{submitText:"Вхіх"},editableTable:{onlyOneLineEditor:"Тільки один рядок може бути редагований одночасно",action:{save:"Зберегти",cancel:"Відмінити",delete:"Видалити",add:"додати рядок"}},switch:{open:"Відкрито",close:"Закрито"}},ng={moneySymbol:"UZS",form:{lightFilter:{more:"Yana",clear:"Tozalash",confirm:"OK",itemUnit:"Pozitsiyalar"}},tableForm:{search:"Qidirish",reset:"Qayta tiklash",submit:"Yuborish",collapsed:"Yig‘ish",expand:"Kengaytirish",inputPlaceholder:"Qiymatni kiriting",selectPlaceholder:"Qiymatni tanlang"},alert:{clear:"Tozalash",selected:"Tanlangan",item:"elementlar"},pagination:{total:{range:" ",total:"dan",item:"elementlar"}},tableToolBar:{leftPin:"Chapga mahkamlash",rightPin:"O‘ngga mahkamlash",noPin:"Mahkamlashni olib tashlash",leftFixedTitle:"Chapga mahkamlangan",rightFixedTitle:"O‘ngga mahkamlangan",noFixedTitle:"Mahkamlashsiz",reset:"Qayta tiklash",columnDisplay:"Ustunni ko‘rsatish",columnSetting:"Sozlamalar",fullScreen:"To‘liq ekran",exitFullScreen:"To‘liq ekrandan chiqish",reload:"Yangilash",density:"O‘lcham",densityDefault:"Standart",densityLarger:"Katta",densityMiddle:"O‘rtacha",densitySmall:"Kichik"},stepsForm:{next:"Keyingi",prev:"Oldingi",submit:"Tugatish"},loginForm:{submitText:"Kirish"},editableTable:{action:{save:"Saqlash",cancel:"Bekor qilish",delete:"O‘chirish",add:"maʼlumotlar qatorini qo‘shish"}},switch:{open:"Ochish",close:"Yopish"}},rg={moneySymbol:"₫",form:{lightFilter:{more:"Nhiều hơn",clear:"Trong",confirm:"Xác nhận",itemUnit:"Mục"}},tableForm:{search:"Tìm kiếm",reset:"Làm lại",submit:"Gửi đi",collapsed:"Mở rộng",expand:"Thu gọn",inputPlaceholder:"nhập dữ liệu",selectPlaceholder:"Vui lòng chọn"},alert:{clear:"Xóa",selected:"đã chọn",item:"mục"},pagination:{total:{range:" ",total:"trên",item:"mặt hàng"}},tableToolBar:{leftPin:"Ghim trái",rightPin:"Ghim phải",noPin:"Bỏ ghim",leftFixedTitle:"Cố định trái",rightFixedTitle:"Cố định phải",noFixedTitle:"Chưa cố định",reset:"Làm lại",columnDisplay:"Cột hiển thị",columnSetting:"Cấu hình",fullScreen:"Chế độ toàn màn hình",exitFullScreen:"Thoát chế độ toàn màn hình",reload:"Làm mới",density:"Mật độ hiển thị",densityDefault:"Mặc định",densityLarger:"Mặc định",densityMiddle:"Trung bình",densitySmall:"Chật"},stepsForm:{next:"Sau",prev:"Trước",submit:"Kết thúc"},loginForm:{submitText:"Đăng nhập"},editableTable:{action:{save:"Cứu",cancel:"Hủy",delete:"Xóa",add:"thêm một hàng dữ liệu"}},switch:{open:"mở",close:"đóng"}},sg={moneySymbol:"¥",deleteThisLine:"删除此项",copyThisLine:"复制此项",form:{lightFilter:{more:"更多筛选",clear:"清除",confirm:"确认",itemUnit:"项"}},tableForm:{search:"查询",reset:"重置",submit:"提交",collapsed:"展开",expand:"收起",inputPlaceholder:"请输入",selectPlaceholder:"请选择"},alert:{clear:"取消选择",selected:"已选择",item:"项"},pagination:{total:{range:"第",total:"条/总共",item:"条"}},tableToolBar:{leftPin:"固定在列首",rightPin:"固定在列尾",noPin:"不固定",leftFixedTitle:"固定在左侧",rightFixedTitle:"固定在右侧",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列设置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"宽松",densityMiddle:"中等",densitySmall:"紧凑"},stepsForm:{next:"下一步",prev:"上一步",submit:"提交"},loginForm:{submitText:"登录"},editableTable:{onlyOneLineEditor:"只能同时编辑一行",action:{save:"保存",cancel:"取消",delete:"删除",add:"添加一行数据"}},switch:{open:"打开",close:"关闭"}},ag={moneySymbol:"HK$",deleteThisLine:"刪除此項",copyThisLine:"複製此項",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"搜尋",reset:"重設",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選取",selected:"已選取",item:"項"},pagination:{total:{range:"第",total:"項/總共",item:"項"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重設",columnDisplay:"列顯示",columnSetting:"列設定",fullScreen:"全螢幕",exitFullScreen:"退出全螢幕",reload:"重新整理",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},ig={moneySymbol:"NT$",deleteThisLine:"刪除此项",copyThisLine:"複製此项",form:{lightFilter:{more:"更多篩選",clear:"清除",confirm:"確認",itemUnit:"項"}},tableForm:{search:"查詢",reset:"重置",submit:"提交",collapsed:"展開",expand:"收起",inputPlaceholder:"請輸入",selectPlaceholder:"請選擇"},alert:{clear:"取消選擇",selected:"已選擇",item:"項"},pagination:{total:{range:"第",total:"條/總共",item:"條"}},tableToolBar:{leftPin:"固定到左邊",rightPin:"固定到右邊",noPin:"不固定",leftFixedTitle:"固定在左側",rightFixedTitle:"固定在右側",noFixedTitle:"不固定",reset:"重置",columnDisplay:"列展示",columnSetting:"列設置",fullScreen:"全屏",exitFullScreen:"退出全屏",reload:"刷新",density:"密度",densityDefault:"正常",densityLarger:"寬鬆",densityMiddle:"中等",densitySmall:"緊湊"},stepsForm:{next:"下一步",prev:"上一步",submit:"完成"},loginForm:{submitText:"登入"},editableTable:{onlyOneLineEditor:"只能同時編輯一行",action:{save:"保存",cancel:"取消",delete:"刪除",add:"新增一行資料"}},switch:{open:"打開",close:"關閉"}},Ve=(e,t)=>({getMessage:(n,r)=>{const a=Be(t,n.replace(/\[(\d+)\]/g,".$1").split("."))||"";if(a)return a;if(e.replace("_","-")==="zh-CN")return r;const o=zn["zh-CN"];return o?o.getMessage(n,r):r},locale:e}),og=Ve("mn_MN",Hh),lg=Ve("ar_EG",Eh),qr=Ve("zh_CN",sg),cg=Ve("en_US",kh),ug=Ve("en_GB",Ah),dg=Ve("vi_VN",rg),fg=Ve("it_IT",zh),mg=Ve("ja_JP",Bh),hg=Ve("es_ES",Oh),gg=Ve("ca_ES",Rh),pg=Ve("ru_RU",Gh),yg=Ve("sr_RS",Jh),xg=Ve("ms_MY",Uh),bg=Ve("zh_TW",ig),Sg=Ve("zh_HK",ag),Cg=Ve("fr_FR",Ph),wg=Ve("pt_BR",Wh),jg=Ve("ko_KR",Vh),vg=Ve("id_ID",_h),Tg=Ve("de_DE",Mh),Fg=Ve("fa_IR",Dh),$g=Ve("tr_TR",eg),Eg=Ve("pl_PL",Kh),Rg=Ve("hr_",Lh),Ig=Ve("th_TH",Qh),Mg=Ve("cs_cz",Ih),Ag=Ve("sk_SK",Zh),kg=Ve("he_IL",Nh),Og=Ve("uk_UA",tg),Dg=Ve("uz_UZ",ng),Pg=Ve("nl_NL",Yh),Ng=Ve("ro_RO",qh),Lg=Ve("sv_SE",Xh),zn={"mn-MN":og,"ar-EG":lg,"zh-CN":qr,"en-US":cg,"en-GB":ug,"vi-VN":dg,"it-IT":fg,"ja-JP":mg,"es-ES":hg,"ca-ES":gg,"ru-RU":pg,"sr-RS":yg,"ms-MY":xg,"zh-TW":bg,"zh-HK":Sg,"fr-FR":Cg,"pt-BR":wg,"ko-KR":jg,"id-ID":vg,"de-DE":Tg,"fa-IR":Fg,"tr-TR":$g,"pl-PL":Eg,"hr-HR":Rg,"th-TH":Ig,"cs-CZ":Mg,"sk-SK":Ag,"he-IL":kg,"uk-UA":Og,"uz-UZ":Dg,"nl-NL":Pg,"ro-RO":Ng,"sv-SE":Lg},_g=Object.keys(zn),Bu=e=>{const t=(e||"zh-CN").toLocaleLowerCase();return _g.find(n=>n.toLocaleLowerCase().includes(t))};function bt(e,t){zg(e)&&(e="100%");const n=Bg(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/t:e=e%t/t,e)}function bs(e){return Math.min(1,Math.max(0,e))}function zg(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Bg(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Vu(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Ss(e){return Number(e)<=1?`${Number(e)*100}%`:e}function Dn(e){return e.length===1?"0"+e:String(e)}function Vg(e,t,n){return{r:bt(e,255)*255,g:bt(t,255)*255,b:bt(n,255)*255}}function dl(e,t,n){e=bt(e,255),t=bt(t,255),n=bt(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0,o=0;const l=(r+a)/2;if(r===a)o=0,i=0;else{const u=r-a;switch(o=l>.5?u/(2-r-a):u/(r+a),r){case e:i=(t-n)/u+(t<n?6:0);break;case t:i=(n-e)/u+2;break;case n:i=(e-t)/u+4;break}i/=6}return{h:i,s:o,l}}function Ka(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Hg(e,t,n){let r,a,i;if(e=bt(e,360),t=bt(t,100),n=bt(n,100),t===0)a=n,i=n,r=n;else{const o=n<.5?n*(1+t):n+t-n*t,l=2*n-o;r=Ka(l,o,e+1/3),a=Ka(l,o,e),i=Ka(l,o,e-1/3)}return{r:r*255,g:a*255,b:i*255}}function fl(e,t,n){e=bt(e,255),t=bt(t,255),n=bt(n,255);const r=Math.max(e,t,n),a=Math.min(e,t,n);let i=0;const o=r,l=r-a,u=r===0?0:l/r;if(r===a)i=0;else{switch(r){case e:i=(t-n)/l+(t<n?6:0);break;case t:i=(n-e)/l+2;break;case n:i=(e-t)/l+4;break}i/=6}return{h:i,s:u,v:o}}function Ug(e,t,n){e=bt(e,360)*6,t=bt(t,100),n=bt(n,100);const r=Math.floor(e),a=e-r,i=n*(1-t),o=n*(1-a*t),l=n*(1-(1-a)*t),u=r%6,m=[n,o,i,i,l,n][u],g=[l,n,n,o,i,i][u],f=[i,i,l,n,n,o][u];return{r:m*255,g:g*255,b:f*255}}function ml(e,t,n,r){const a=Dn(Math.round(e).toString(16)),i=Dn(Math.round(t).toString(16)),o=Dn(Math.round(n).toString(16));return r&&a.startsWith(a.charAt(1))&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))?a.charAt(0)+i.charAt(0)+o.charAt(0):a+i+o}function Yg(e,t,n,r,a){const i=Dn(Math.round(e).toString(16)),o=Dn(Math.round(t).toString(16)),l=Dn(Math.round(n).toString(16)),u=Dn(Wg(r));return a&&i.startsWith(i.charAt(1))&&o.startsWith(o.charAt(1))&&l.startsWith(l.charAt(1))&&u.startsWith(u.charAt(1))?i.charAt(0)+o.charAt(0)+l.charAt(0)+u.charAt(0):i+o+l+u}function Kg(e,t,n,r){const a=e/100,i=t/100,o=n/100,l=r/100,u=255*(1-a)*(1-l),m=255*(1-i)*(1-l),g=255*(1-o)*(1-l);return{r:u,g:m,b:g}}function hl(e,t,n){let r=1-e/255,a=1-t/255,i=1-n/255,o=Math.min(r,a,i);return o===1?(r=0,a=0,i=0):(r=(r-o)/(1-o)*100,a=(a-o)/(1-o)*100,i=(i-o)/(1-o)*100),o*=100,{c:Math.round(r),m:Math.round(a),y:Math.round(i),k:Math.round(o)}}function Wg(e){return Math.round(parseFloat(e)*255).toString(16)}function gl(e){return Et(e)/255}function Et(e){return parseInt(e,16)}function qg(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}const Ri={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Gg(e){let t={r:0,g:0,b:0},n=1,r=null,a=null,i=null,o=!1,l=!1;return typeof e=="string"&&(e=Xg(e)),typeof e=="object"&&($t(e.r)&&$t(e.g)&&$t(e.b)?(t=Vg(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):$t(e.h)&&$t(e.s)&&$t(e.v)?(r=Ss(e.s),a=Ss(e.v),t=Ug(e.h,r,a),o=!0,l="hsv"):$t(e.h)&&$t(e.s)&&$t(e.l)?(r=Ss(e.s),i=Ss(e.l),t=Hg(e.h,r,i),o=!0,l="hsl"):$t(e.c)&&$t(e.m)&&$t(e.y)&&$t(e.k)&&(t=Kg(e.c,e.m,e.y,e.k),o=!0,l="cmyk"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=Vu(n),{ok:o,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}const Zg="[-\\+]?\\d+%?",Jg="[-\\+]?\\d*\\.\\d+%?",Cn="(?:"+Jg+")|(?:"+Zg+")",Wa="[\\s|\\(]+("+Cn+")[,|\\s]+("+Cn+")[,|\\s]+("+Cn+")\\s*\\)?",Cs="[\\s|\\(]+("+Cn+")[,|\\s]+("+Cn+")[,|\\s]+("+Cn+")[,|\\s]+("+Cn+")\\s*\\)?",Rt={hex:/^[0-9a-fA-F]+$/,CSS_UNIT:new RegExp(Cn),rgb:new RegExp("rgb"+Wa),rgba:new RegExp("rgba"+Cs),hsl:new RegExp("hsl"+Wa),hsla:new RegExp("hsla"+Cs),hsv:new RegExp("hsv"+Wa),hsva:new RegExp("hsva"+Cs),cmyk:new RegExp("cmyk"+Cs),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Xg(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;let t=!1;if(Ri[e])e=Ri[e],t=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let n;if(typeof e=="string"&&e.length<=9&&(e.startsWith("#")||Rt.hex.test(e))){if(n=Rt.hex8.exec(e),n)return{r:Et(n[1]),g:Et(n[2]),b:Et(n[3]),a:gl(n[4]),format:t?"name":"hex8"};if(n=Rt.hex6.exec(e),n)return{r:Et(n[1]),g:Et(n[2]),b:Et(n[3]),format:t?"name":"hex"};if(n=Rt.hex4.exec(e),n)return{r:Et(n[1]+n[1]),g:Et(n[2]+n[2]),b:Et(n[3]+n[3]),a:gl(n[4]+n[4]),format:t?"name":"hex8"};if(n=Rt.hex3.exec(e),n)return{r:Et(n[1]+n[1]),g:Et(n[2]+n[2]),b:Et(n[3]+n[3]),format:t?"name":"hex"}}return n=Rt.rgb.exec(e),n?{r:n[1],g:n[2],b:n[3]}:(n=Rt.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Rt.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=Rt.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Rt.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=Rt.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Rt.cmyk.exec(e),n?{c:n[1],m:n[2],y:n[3],k:n[4]}:!1))))))}function $t(e){return typeof e=="number"?!Number.isNaN(e):Rt.CSS_UNIT.test(e)}class ft{constructor(t="",n={}){if(t instanceof ft)return t;typeof t=="number"&&(t=qg(t)),this.originalInput=t;const r=Gg(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=n.format??r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3}getLuminance(){const t=this.toRgb();let n,r,a;const i=t.r/255,o=t.g/255,l=t.b/255;return i<=.03928?n=i/12.92:n=Math.pow((i+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*r+.0722*a}getAlpha(){return this.a}setAlpha(t){return this.a=Vu(t),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:t}=this.toHsl();return t===0}toHsv(){const t=fl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}}toHsvString(){const t=fl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.v*100);return this.a===1?`hsv(${n}, ${r}%, ${a}%)`:`hsva(${n}, ${r}%, ${a}%, ${this.roundA})`}toHsl(){const t=dl(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}}toHslString(){const t=dl(this.r,this.g,this.b),n=Math.round(t.h*360),r=Math.round(t.s*100),a=Math.round(t.l*100);return this.a===1?`hsl(${n}, ${r}%, ${a}%)`:`hsla(${n}, ${r}%, ${a}%, ${this.roundA})`}toHex(t=!1){return ml(this.r,this.g,this.b,t)}toHexString(t=!1){return"#"+this.toHex(t)}toHex8(t=!1){return Yg(this.r,this.g,this.b,this.a,t)}toHex8String(t=!1){return"#"+this.toHex8(t)}toHexShortString(t=!1){return this.a===1?this.toHexString(t):this.toHex8String(t)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const t=Math.round(this.r),n=Math.round(this.g),r=Math.round(this.b);return this.a===1?`rgb(${t}, ${n}, ${r})`:`rgba(${t}, ${n}, ${r}, ${this.roundA})`}toPercentageRgb(){const t=n=>`${Math.round(bt(n,255)*100)}%`;return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}}toPercentageRgbString(){const t=n=>Math.round(bt(n,255)*100);return this.a===1?`rgb(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%)`:`rgba(${t(this.r)}%, ${t(this.g)}%, ${t(this.b)}%, ${this.roundA})`}toCmyk(){return{...hl(this.r,this.g,this.b)}}toCmykString(){const{c:t,m:n,y:r,k:a}=hl(this.r,this.g,this.b);return`cmyk(${t}, ${n}, ${r}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const t="#"+ml(this.r,this.g,this.b,!1);for(const[n,r]of Object.entries(Ri))if(t===r)return n;return!1}toString(t){const n=!!t;t=t??this.format;let r=!1;const a=this.a<1&&this.a>=0;return!n&&a&&(t.startsWith("hex")||t==="name")?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(r=this.toRgbString()),t==="prgb"&&(r=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(r=this.toHexString()),t==="hex3"&&(r=this.toHexString(!0)),t==="hex4"&&(r=this.toHex8String(!0)),t==="hex8"&&(r=this.toHex8String()),t==="name"&&(r=this.toName()),t==="hsl"&&(r=this.toHslString()),t==="hsv"&&(r=this.toHsvString()),t==="cmyk"&&(r=this.toCmykString()),r||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new ft(this.toString())}lighten(t=10){const n=this.toHsl();return n.l+=t/100,n.l=bs(n.l),new ft(n)}brighten(t=10){const n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new ft(n)}darken(t=10){const n=this.toHsl();return n.l-=t/100,n.l=bs(n.l),new ft(n)}tint(t=10){return this.mix("white",t)}shade(t=10){return this.mix("black",t)}desaturate(t=10){const n=this.toHsl();return n.s-=t/100,n.s=bs(n.s),new ft(n)}saturate(t=10){const n=this.toHsl();return n.s+=t/100,n.s=bs(n.s),new ft(n)}greyscale(){return this.desaturate(100)}spin(t){const n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new ft(n)}mix(t,n=50){const r=this.toRgb(),a=new ft(t).toRgb(),i=n/100,o={r:(a.r-r.r)*i+r.r,g:(a.g-r.g)*i+r.g,b:(a.b-r.b)*i+r.b,a:(a.a-r.a)*i+r.a};return new ft(o)}analogous(t=6,n=30){const r=this.toHsl(),a=360/n,i=[this];for(r.h=(r.h-(a*t>>1)+720)%360;--t;)r.h=(r.h+a)%360,i.push(new ft(r));return i}complement(){const t=this.toHsl();return t.h=(t.h+180)%360,new ft(t)}monochromatic(t=6){const n=this.toHsv(),{h:r}=n,{s:a}=n;let{v:i}=n;const o=[],l=1/t;for(;t--;)o.push(new ft({h:r,s:a,v:i})),i=(i+l)%1;return o}splitcomplement(){const t=this.toHsl(),{h:n}=t;return[this,new ft({h:(n+72)%360,s:t.s,l:t.l}),new ft({h:(n+216)%360,s:t.s,l:t.l})]}onBackground(t){const n=this.toRgb(),r=new ft(t).toRgb(),a=n.a+r.a*(1-n.a);return new ft({r:(n.r*n.a+r.r*r.a*(1-n.a))/a,g:(n.g*n.a+r.g*r.a*(1-n.a))/a,b:(n.b*n.a+r.b*r.a*(1-n.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(t){const n=this.toHsl(),{h:r}=n,a=[this],i=360/t;for(let o=1;o<t;o++)a.push(new ft({h:(r+o*i)%360,s:n.s,l:n.l}));return a}equals(t){const n=new ft(t);return this.format==="cmyk"||n.format==="cmyk"?this.toCmykString()===n.toCmykString():this.toRgbString()===n.toRgbString()}}const It=(e,t)=>new ft(e).setAlpha(t).toRgbString(),jn=c.theme,qa=e=>({boxSizing:"border-box",margin:0,padding:0,color:e.colorText,fontSize:e.fontSize,lineHeight:e.lineHeight,listStyle:"none","*, *::before, *::after":{boxSizing:"border-box"}}),Qg=e=>{let t=5381;for(let n=0;n<e.length;n+=1)t=t*33^e.charCodeAt(n);return(t>>>0).toString(36)},ep=e=>{try{return Qg(JSON.stringify(e))}catch{return""}};function tt(e,t){let{token:n={},hashed:r}=d.useContext(Xt);const{token:a,hashId:i,theme:o}=c.theme.useToken(),{getPrefixCls:l,csp:u}=d.useContext(c.ConfigProvider.ConfigContext);n.layout||(n={...a}),n.proComponentsCls=n.proComponentsCls??`.${l("pro")}`,n.antCls=`.${l()}`;const m=d.useMemo(()=>ep(n),[n]),g=[i,o.id,n.themeId,m].filter(Boolean).join("-"),f=d.useRef(""),h=d.useRef(0);f.current!==g&&(h.current+=1,f.current=g);const p=[e,g,h.current].filter(Boolean);return Hm({path:p,nonce:u==null?void 0:u.nonce,layer:{name:"antd-pro"}},()=>t(n)),{wrapSSR:S=>S,hashId:r?i:""}}const tp=(e,t)=>{var a,i,o,l,u;const n={...e},r=It(t.colorBgElevated,.6);return{bgLayout:`linear-gradient(${t.colorBgContainer}, ${t.colorBgLayout} 28%)`,colorTextAppListIcon:t.colorTextSecondary,appListIconHoverBgColor:(a=n==null?void 0:n.sider)==null?void 0:a.colorBgMenuItemSelected,colorBgAppListIconHover:It(t.colorTextBase,.04),colorTextAppListIconHover:t.colorTextBase,...n,header:{colorBgHeader:r,colorBgScrollHeader:It(t.colorBgElevated,.8),colorHeaderTitle:t.colorText,colorBgMenuItemHover:It(t.colorTextBase,.03),colorBgMenuItemSelected:"transparent",colorBgMenuElevated:(((i=n==null?void 0:n.header)==null?void 0:i.colorBgHeader)??r)!==r?(o=n.header)==null?void 0:o.colorBgHeader:t.colorBgElevated,colorTextMenuSelected:It(t.colorTextBase,.95),colorBgRightActionsItemHover:It(t.colorTextBase,.03),colorTextRightActionsItem:t.colorTextTertiary,heightLayoutHeader:56,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextMenuActive:t.colorText,...n.header},sider:{paddingInlineLayoutMenu:8,paddingBlockLayoutMenu:0,colorBgCollapsedButton:t.colorBgElevated,colorTextCollapsedButtonHover:t.colorTextSecondary,colorTextCollapsedButton:It(t.colorTextBase,.25),colorMenuBackground:"transparent",colorMenuItemDivider:It(t.colorTextBase,.06),colorBgMenuItemHover:It(t.colorTextBase,.03),colorBgMenuItemSelected:It(t.colorTextBase,.04),colorTextMenuItemHover:t.colorText,colorTextMenuSelected:It(t.colorTextBase,.95),colorTextMenuActive:t.colorText,colorTextMenu:t.colorTextSecondary,colorTextMenuSecondary:t.colorTextTertiary,colorTextMenuTitle:t.colorText,colorTextSubMenuSelected:It(t.colorTextBase,.95),...n.sider},pageContainer:{colorBgPageContainer:"transparent",paddingInlinePageContainerContent:((l=n.pageContainer)==null?void 0:l.paddingInlinePageContainerContent)||40,paddingBlockPageContainerContent:((u=n.pageContainer)==null?void 0:u.paddingBlockPageContainerContent)||32,colorBgPageContainerFixed:t.colorBgElevated,...n.pageContainer}}},np=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t},rp=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Ga=()=>{var e,t;return!(typeof process<"u"&&(((e=process.env.NODE_ENV)==null?void 0:e.toUpperCase())==="TEST"||((t=process.env.NODE_ENV)==null?void 0:t.toUpperCase())==="DEV"))},Zt=d.createContext({intl:{...qr,locale:"default"},valueTypeMap:{},hashed:!0,dark:!1,token:{...c.theme.getDesignToken(),proComponentsCls:".ant-pro",antCls:".ant",themeId:0},prefixCls:".ant-pro"}),{Consumer:vF}=Zt,sp=()=>{const{cache:e}=_u();return d.useEffect(()=>()=>{e.clear()},[]),null},ap=e=>{var D,M;const{children:t,dark:n,valueTypeMap:r,autoClearCache:a=!1,token:i,prefixCls:o,intl:l}=e,{locale:u,getPrefixCls:m,...g}=d.useContext(c.ConfigProvider.ConfigContext),f=(M=(D=c.theme).useToken)==null?void 0:M.call(D),h=d.useContext(Zt),p=o?`.${o}`:`.${m()}-pro`,S="."+m(),y=`${p}`,w=d.useMemo(()=>tp(i||{},f.token),[i,f.token]),T=d.useMemo(()=>{var I;const U=u==null?void 0:u.locale,Y=Bu(U),O=l??(U&&((I=h.intl)==null?void 0:I.locale)==="default"?zn[Y]:h.intl||zn[Y]);return{...h,dark:n??h.dark,token:np(h.token,f.token,{proComponentsCls:p,antCls:S,themeId:f.theme.id,layout:w}),intl:O||qr}},[u==null?void 0:u.locale,h,n,f.token,f.theme.id,p,S,w,l]),x={...T.token||{},proComponentsCls:p},[C,j]=pm(f.theme,[f.token,x??{}],{salt:y,override:x,cssVar:{key:"pro"}}),b=d.useMemo(()=>!(e.hashed===!1||h.hashed===!1),[h.hashed,e.hashed]),v=d.useMemo(()=>e.hashed===!1||h.hashed===!1||Ga()===!1?"":f.hashId?f.hashId:j,[j,h.hashed,e.hashed]);d.useEffect(()=>{Re.locale((u==null?void 0:u.locale)||"zh-cn")},[u==null?void 0:u.locale]);const $=d.useMemo(()=>({...g.theme,hashId:v,hashed:b&&Ga()}),[g.theme,v,b,Ga()]),E=d.useMemo(()=>({...T,valueTypeMap:r||(T==null?void 0:T.valueTypeMap),token:x,theme:f.theme,hashed:b,hashId:v,prefixCls:o}),[T,r,C,f.theme,b,v,o]),R=d.useMemo(()=>s.jsx(c.ConfigProvider,{...g,theme:$,children:s.jsx(Zt.Provider,{value:E,children:s.jsxs(s.Fragment,{children:[a&&s.jsx(sp,{}),t]})})}),[g,$,E,a,t]);return a?s.jsx($h,{value:{provider:()=>new Map},children:R}):R},Bn=e=>{const{needDeps:t,dark:n,token:r}=e,a=d.useContext(Zt),{locale:i,theme:o,...l}=d.useContext(c.ConfigProvider.ConfigContext);if(t&&a.hashId!==void 0&&Object.keys(e).sort().join("-")==="children-needDeps")return s.jsx(s.Fragment,{children:e.children});const g={...l,locale:i||Wm,theme:rp({...o,algorithm:n??a.dark?[o==null?void 0:o.algorithm,c.theme.darkAlgorithm].flat(1).filter(Boolean):o==null?void 0:o.algorithm})};return s.jsx(c.ConfigProvider,{...g,children:s.jsx(ap,{...e,token:r})})};function Ne(){const{locale:e}=d.useContext(c.ConfigProvider.ConfigContext),{intl:t}=d.useContext(Zt);return t&&t.locale!=="default"?t:e!=null&&e.locale&&zn[Bu(e.locale)]||qr}Zt.displayName="ProProvider";const Xt=Zt,ip=e=>{const{componentCls:t,antCls:n}=e;return{[`${t}-actions`]:{boxSizing:"border-box",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,listStyle:"none",display:"flex",gap:e.marginXS,background:e.colorBgContainer,borderBlockStart:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,minHeight:42,"& > *":{alignItems:"center",justifyContent:"center",flex:1,display:"flex",cursor:"pointer",color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},"& > li > div":{flex:1,width:"100%",marginBlock:e.marginSM,marginInline:0,color:e.colorTextSecondary,textAlign:"center",a:{color:e.colorTextSecondary,transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},div:{position:"relative",display:"block",minWidth:32,fontSize:e.fontSize,lineHeight:e.lineHeight,cursor:"pointer","&:hover":{color:e.colorPrimaryHover,transition:"color 0.3s"},[`a:not(${n}-btn),
36
+ > .anticon`]:{display:"inline-block",width:"100%",color:e.colorTextSecondary,lineHeight:"22px",transition:"color 0.3s","&:hover":{color:e.colorPrimaryHover}},".anticon":{fontSize:e.cardActionIconSize,lineHeight:"22px"}},"&:not(:last-child)":{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`}}}}};function op(e){return tt("ProCardActions",t=>{const n={...t,componentCls:`.${e}`,cardActionIconSize:16};return[ip(n)]})}const lp=e=>{const{actions:t,prefixCls:n}=e,{wrapSSR:r,hashId:a}=op(n);return Array.isArray(t)&&(t!=null&&t.length)?r(s.jsx("ul",{className:ie(`${n}-actions`,a),children:t.map((i,o)=>s.jsx("li",{style:{width:`${100/t.length}%`,padding:0,margin:0},className:ie(`${n}-actions-item`,a),children:i},`action-${o}`))})):r(s.jsx("ul",{className:ie(`${n}-actions`,a),children:t}))};function mo(e,t){if(!t||!d.isValidElement(e))return e;if(e.type===d.Fragment){const r=d.Children.toArray(e.props.children).map((a,i)=>i===0?mo(a,t):a);return d.cloneElement(e,{},...r)}return d.cloneElement(e,{...e.props,autoFocus:t})}const cp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"flex",justifyContent:"space-between",paddingBlock:8,paddingInlineStart:8,paddingInlineEnd:8,borderBlockStart:`1px solid ${e.colorSplit}`}});function up(e){return tt("DropdownFooter",t=>{const n={...t,componentCls:`.${e}`};return[cp(n)]})}const dp=e=>{const t=Ne(),{onClear:n,onConfirm:r,disabled:a,footerRender:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-core-dropdown-footer"),{wrapSSR:u,hashId:m}=up(l),g=[s.jsx(c.Button,{style:{visibility:n?"visible":"hidden"},type:"link",size:"small",disabled:a,onClick:h=>{n&&n(h),h.stopPropagation()},children:t.getMessage("form.lightFilter.clear","清除")},"clear"),s.jsx(c.Button,{"data-type":"confirm",type:"primary",size:"small",onClick:r,disabled:a,children:t.getMessage("form.lightFilter.confirm","确认")},"confirm")];if(i===!1||(i==null?void 0:i(r,n))===!1)return null;const f=(i==null?void 0:i(r,n))||g;return u(s.jsx("div",{className:ie(l,m),onClick:h=>h.target.getAttribute("data-type")!=="confirm"&&h.stopPropagation(),children:f}))};class fp extends d.Component{constructor(){super(...arguments);oe(this,"state",{hasError:!1,errorInfo:""})}static getDerivedStateFromError(n){return console.warn("ErrorBoundary caught an error",n),{hasError:!0,errorInfo:n.message}}componentDidCatch(n,r){console.warn("ErrorBoundary caught an error",n,r)}render(){return this.state.hasError?s.jsx(c.Result,{status:"error",title:"Something went wrong.",extra:this.state.errorInfo}):this.props.children}}const mp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",gap:e.marginXXS,alignItems:"center",height:"30px",paddingBlock:0,paddingInline:8,fontSize:e.fontSize,lineHeight:"30px",borderRadius:e.borderRadius,cornerShape:"squircle",cursor:"pointer","&:hover":{backgroundColor:e.colorBgTextHover},"&-active":{paddingBlock:0,paddingInline:8,[`&${e.componentCls}-allow-clear:hover:not(${e.componentCls}-disabled)`]:{[`${e.componentCls}-arrow`]:{display:"none"},[`${e.componentCls}-close`]:{display:"inline-flex"}}},[`${e.antCls}-select`]:{[`${e.antCls}-select-clear`]:{borderRadius:"50%"}},[`${e.antCls}-picker`]:{[`${e.antCls}-picker-clear`]:{borderRadius:"50%"}},"&-icon":{color:e.colorIcon,transition:"color 0.3s",fontSize:12,verticalAlign:"middle",[`&${e.componentCls}-close`]:{display:"none",fontSize:12,alignItems:"center",justifyContent:"center",color:e.colorTextPlaceholder,borderRadius:"50%"},"&:hover":{color:e.colorIconHover}},"&-disabled":{color:e.colorTextPlaceholder,cursor:"not-allowed",[`${e.componentCls}-icon`]:{color:e.colorTextPlaceholder}},"&-small":{height:"24px",paddingBlock:0,paddingInline:4,fontSize:e.fontSizeSM,lineHeight:"24px",[`&${e.componentCls}-active`]:{paddingBlock:0,paddingInline:8},[`${e.componentCls}-icon`]:{paddingBlock:0,paddingInline:0},[`${e.componentCls}-close`]:{marginBlockStart:"-2px",paddingBlock:4,paddingInline:4,fontSize:"6px"}},"&-outlined":{height:"32px",paddingBlock:0,paddingInline:8,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,"&-active":{backgroundColor:"none"}},"&-borderless":{height:"32px","&-active":{backgroundColor:e.colorBgTextHover}},"&-filled":{height:"32px",backgroundColor:e.colorBgTextHover,border:`${e.lineWidth}px solid transparent`,"&:hover":{border:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-underlined":{height:"32px",borderRadius:0,borderBottom:`${e.lineWidth}px solid ${e.colorSplit}`,"&:hover":{borderBottom:`${e.lineWidth}px solid ${e.colorPrimary}`,backgroundColor:e.colorBgTextHover}},"&-bordered&-small":{height:"24px",paddingBlock:0,paddingInline:8},"&-bordered&-active":{backgroundColor:e.colorBgContainer}}});function hp(e){return tt("FieldLabel",t=>{const n={...t,componentCls:`.${e}`};return[mp(n)]})}const gp=(e,t)=>{var M,U;const{label:n,onClear:r,value:a,disabled:i,onLabelClick:o,ellipsis:l,placeholder:u,className:m,formatter:g,variant:f,style:h,downIcon:p,allowClear:S=!0,valueMaxLength:y=41}=e,{componentSize:w}=((U=(M=c.ConfigProvider)==null?void 0:M.useConfig)==null?void 0:U.call(M))||{componentSize:"middle"},{getPrefixCls:T}=d.useContext(c.ConfigProvider.ConfigContext),x=T("pro-core-field-label"),{wrapSSR:C,hashId:j}=hp(x),b=Ne(),v=d.useRef(null),$=d.useRef(null);d.useImperativeHandle(t,()=>({labelRef:$,clearRef:v}));const E=Y=>Y.every(O=>typeof O=="string")?Y.join(","):Y.map((O,I)=>{const F=I===Y.length-1?"":",";return typeof O=="string"?s.jsxs("span",{children:[O,F]},I):s.jsxs("span",{style:{display:"flex"},children:[O,F]},I)}),R=Y=>g?g(Y):Array.isArray(Y)?E(Y):Y,D=(Y,O)=>{var I,F;if(O!=null&&O!==""&&(!Array.isArray(O)||O.length)){const A=Y?s.jsxs("span",{onClick:()=>{o==null||o()},className:ie(`${x}-text`,j),children:[Y,": "]}):"",k=R(O);if(!l)return s.jsxs("span",{style:{display:"inline-flex",alignItems:"center"},children:[A,R(O)]});const G=(()=>{const _=Array.isArray(O)&&O.length>1,H=b.getMessage("form.lightFilter.itemUnit","项");return typeof k=="string"&&k.length>y&&_?`...${O.length}${H}`:""})();return s.jsxs("span",{title:typeof k=="string"?k:void 0,style:{display:"inline-flex",alignItems:"center"},children:[A,s.jsx("span",{style:{paddingInlineStart:4,display:"flex"},children:typeof k=="string"?(F=(I=k==null?void 0:k.toString())==null?void 0:I.slice)==null?void 0:F.call(I,0,y):k}),G]})}return Y||u};return C(s.jsxs("span",{className:ie(x,j,`${x}-${e.size??w??"middle"}`,{[`${x}-${f||"borderless"}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-active`]:(Array.isArray(a)?a.length>0:!!a)||a===0,[`${x}-disabled`]:i,[`${x}-${f}`]:f,[`${x}-allow-clear`]:S},m),style:h,ref:$,onClick:()=>{var Y;(Y=e==null?void 0:e.onClick)==null||Y.call(e)},children:[D(n,a),(a||a===0)&&S&&s.jsx(de.CloseCircleFilled,{role:"button",title:b.getMessage("form.lightFilter.clear","清除"),className:ie(`${x}-icon`,j,`${x}-close`),onClick:Y=>{i||r==null||r(),Y.stopPropagation()},ref:v}),p!==!1?p??s.jsx(de.DownOutlined,{className:ie(`${x}-icon`,j,`${x}-arrow`)}):null]}))},Qt=d.forwardRef(gp),pp=e=>({[`${e.componentCls}-label`]:{cursor:"pointer"},[`${e.componentCls}-label-bordered`]:{display:"inline-flex",alignItems:"center",height:e.controlHeight,paddingBlock:0,paddingInline:e.paddingSM,border:`${e.lineWidth}px solid ${e.colorBorder}`,borderRadius:e.borderRadius,boxSizing:"border-box"},[`${e.componentCls}-overlay`]:{minWidth:"200px",marginBlockStart:"4px"},[`${e.componentCls}-content`]:{paddingBlock:16,paddingInline:16}});function yp(e){return tt("FilterDropdown",t=>{const n={...t,componentCls:`.${e}`};return[pp(n)]})}const Hu=e=>{const{children:t,label:n,footer:r,open:a,onOpenChange:i,disabled:o,footerRender:l,placement:u,popoverProps:m}=e,{getPrefixCls:g}=d.useContext(c.ConfigProvider.ConfigContext),f=g("pro-core-field-dropdown"),{wrapSSR:h,hashId:p}=yp(f),S=d.useRef(null),y=d.useMemo(()=>{var w;return{container:{padding:0,...((w=m==null?void 0:m.styles)==null?void 0:w.container)||{}},...(m==null?void 0:m.styles)||{}}},[m==null?void 0:m.styles]);return h(s.jsx(c.Popover,{...m,placement:u,trigger:["click"],open:a||!1,onOpenChange:i,styles:y,content:s.jsxs("div",{ref:S,className:ie(`${f}-overlay`,{[`${f}-overlay-${u}`]:u,hashId:p}),children:[s.jsx(c.ConfigProvider,{getPopupContainer:()=>S.current||document.body,children:s.jsx("div",{className:ie(`${f}-content`,p),children:t})}),r&&s.jsx(dp,{disabled:o,footerRender:l,...r})]}),children:s.jsx("span",{className:ie(`${f}-label`,p),children:n})}))},xp=e=>{const t=`${e.antCls}-progress-bg`;return{[e.componentCls]:{boxSizing:"border-box","&-multiple":{paddingBlockStart:6,paddingBlockEnd:12,paddingInline:8},"&-progress":{"&-success":{[t]:{backgroundColor:e.colorSuccess}},"&-error":{[t]:{backgroundColor:e.colorError}},"&-warning":{[t]:{backgroundColor:e.colorWarning}}},"&-rule":{display:"flex",alignItems:"center","&-icon":{"&-default":{display:"flex",alignItems:"center",justifyContent:"center",width:"14px",height:"22px","&-circle":{width:"6px",height:"6px",backgroundColor:e.colorTextSecondary,borderRadius:"4px"}},"&-loading":{color:e.colorPrimary},"&-error":{color:e.colorError},"&-success":{color:e.colorSuccess}},"&-text":{color:e.colorText}}}}};function bp(e){return tt("InlineErrorFormItem",t=>{const n={...t,componentCls:`.${e}`};return[xp(n)]})}const Uu={marginBlockStart:-5,marginBlockEnd:-5,marginInlineStart:0,marginInlineEnd:0},Sp=({inputProps:e,input:t,extra:n,errorList:r,popoverProps:a})=>{var T,x;const[i,o]=d.useState(!1),[l,u]=d.useState({errors:[],warnings:[]}),{getPrefixCls:m}=d.useContext(c.ConfigProvider.ConfigContext),g=m(),f=c.theme.useToken(),{wrapSSR:h,hashId:p}=bp(`${g}-form-item-with-help`);d.useEffect(()=>{e.validateStatus!=="validating"&&u({errors:e.errors??[],warnings:e.warnings??[]})},[e.errors,e.warnings,e.validateStatus]);const S=e.validateStatus==="validating",y=(((T=l.errors)==null?void 0:T.length)??0)+(((x=l.warnings)==null?void 0:x.length)??0)>=1,w=()=>{var C,j;return s.jsxs(s.Fragment,{children:[(C=l.errors)==null?void 0:C.map((b,v)=>s.jsx("div",{className:ie(`${g}-form-item-explain-error`,p),children:b},`error-${v}`)),(j=l.warnings)==null?void 0:j.map((b,v)=>s.jsx("div",{className:ie(`${g}-form-item-explain-warning`,p),children:b},`warning-${v}`))]})};return s.jsx(c.Popover,{open:y?i:!1,onOpenChange:C=>{C!==i&&o(C)},trigger:(a==null?void 0:a.trigger)||["click"],placement:(a==null?void 0:a.placement)||"topLeft",getPopupContainer:a==null?void 0:a.getPopupContainer,getTooltipContainer:a==null?void 0:a.getTooltipContainer,content:h(s.jsx("div",{className:ie(`${g}-form-item`,p,f.hashId),style:{margin:0,padding:0},children:s.jsxs("div",{className:ie(`${g}-form-item-with-help`,p,f.hashId),children:[S?s.jsx(de.LoadingOutlined,{}):null,y?w():r]})})),...a,children:s.jsxs(s.Fragment,{children:[t,n]})},"popover")},Cp=({rules:e,name:t,children:n,popoverProps:r,...a})=>s.jsx(c.Form.Item,{name:t,rules:e,hasFeedback:!1,shouldUpdate:(i,o)=>{if(i===o)return!1;const l=[t].flat(1);l.length>1&&l.pop();try{return JSON.stringify(Be(i,l))!==JSON.stringify(Be(o,l))}catch{return!0}},_internalItemRender:{mark:"pro_table_render",render:(i,o)=>s.jsx(Sp,{inputProps:i,popoverProps:r,...o})},...a,style:{...Uu,...a==null?void 0:a.style},children:n}),wp=e=>{const{errorType:t,rules:n,name:r,popoverProps:a,children:i,...o}=e;return r&&(n!=null&&n.length)&&t==="popover"?s.jsx(Cp,{name:r,rules:n,popoverProps:a,...o,children:i}):s.jsx(c.Form.Item,{rules:n,shouldUpdate:r?(l,u)=>{if(l===u)return!1;const m=[r].flat(1);m.length>1&&m.pop();try{return JSON.stringify(Be(l,m))!==JSON.stringify(Be(u,m))}catch{return!0}}:void 0,...o,style:{...Uu,...o.style},name:r,children:i})},jp=e=>({[e.componentCls]:{boxSizing:"border-box",display:"inline-flex",alignItems:"center",maxWidth:"100%","&-icon":{display:"block",marginInlineStart:"4px",cursor:"pointer","&:hover":{color:e.colorPrimary}},"&-title":{display:"inline-flex",flex:"1"},"&-subtitle ":{marginInlineStart:8,color:e.colorTextSecondary,fontWeight:"normal",fontSize:e.fontSize,whiteSpace:"nowrap"},"&-title-ellipsis":{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",wordBreak:"keep-all"}}});function vp(e){return tt("LabelIconTip",t=>{const n={...t,componentCls:`.${e}`};return[jp(n)]})}const fr=d.memo(e=>{const{label:t,tooltip:n,ellipsis:r,subTitle:a}=e,{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-core-label-tip"),{wrapSSR:l,hashId:u}=vp(o);if(!n&&!a)return s.jsx(s.Fragment,{children:t});const m=typeof n=="string"||d.isValidElement(n)?{title:n}:n,g=(m==null?void 0:m.icon)||s.jsx(de.InfoCircleOutlined,{});return l(s.jsxs("div",{className:ie(o,u),onMouseDown:f=>f.stopPropagation(),onMouseLeave:f=>f.stopPropagation(),onMouseMove:f=>f.stopPropagation(),children:[s.jsx("div",{className:ie(`${o}-title`,u,{[`${o}-title-ellipsis`]:r}),children:t}),a&&s.jsx("div",{className:ie(`${o}-subtitle`,u),children:a}),n&&s.jsx(c.Tooltip,{...m,children:s.jsx("span",{className:ie(`${o}-icon`,u),children:g})})]}))}),es=d.createContext({});var zs={exports:{}},Tp=zs.exports,pl;function Fp(){return pl||(pl=1,(function(e,t){(function(n,r){e.exports=r()})(Tp,(function(){var n="month",r="quarter";return function(a,i){var o=i.prototype;o.quarter=function(m){return this.$utils().u(m)?Math.ceil((this.month()+1)/3):this.month(this.month()%3+3*(m-1))};var l=o.add;o.add=function(m,g){return m=Number(m),this.$utils().p(g)===r?this.add(3*m,n):l.bind(this)(m,g)};var u=o.startOf;o.startOf=function(m,g){var f=this.$utils(),h=!!f.u(g)||g;if(f.p(m)===r){var p=this.quarter()-1;return h?this.month(3*p).startOf(n).startOf("day"):this.month(3*p+2).endOf(n).endOf("day")}return u.bind(this)(m,g)}}}))})(zs)),zs.exports}var $p=Fp();const Ep=Jt($p),Lt=e=>e==null;Re.extend(Ep);const ho={time:"HH:mm:ss",timeRange:"HH:mm:ss",date:"YYYY-MM-DD",dateWeek:"YYYY-wo",dateMonth:"YYYY-MM",dateQuarter:"YYYY-[Q]Q",dateYear:"YYYY",dateRange:"YYYY-MM-DD",dateTime:"YYYY-MM-DD HH:mm:ss",dateTimeRange:"YYYY-MM-DD HH:mm:ss"};function yl(e){return Object.prototype.toString.call(e)==="[object Object]"}function Rp(e){if(yl(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(yl(n)===!1||n.hasOwnProperty("isPrototypeOf")===!1)}const Ii=e=>!!(e!=null&&e._isAMomentObject),xl=(e,t,n)=>{if(!t)return e;if(Re.isDayjs(e)||Ii(e)){if(t==="number")return e.valueOf();if(t==="string")return e.format(ho[n]||"YYYY-MM-DD HH:mm:ss");if(typeof t=="string"&&t!=="string")return e.format(t);if(typeof t=="function")return t(e,n)}return e},Mi=(e,t,n,r,a)=>{const i={};return typeof window>"u"||typeof e!="object"||Lt(e)||e instanceof Blob||Array.isArray(e)?e:(Object.keys(e).forEach(o=>{const l=a?[a,o].flat(1):[o],u=Be(n,l)||"text";let m="text",g;typeof u=="string"?m=u:(m=u.valueType,g=u.dateFormat);const f=e[o];if(Lt(f)&&r||r&&f==="")return;if(Rp(f)&&!Array.isArray(f)&&!Re.isDayjs(f)&&!Ii(f)){i[o]=Mi(f,t,n,r,l);return}const h=t??"string";let p;if(h==="number"||h===!1||typeof h=="function"?p=h:h==="string"?p=g||ho[m]:p=h,Array.isArray(f)){i[o]=f.map((S,y)=>Re.isDayjs(S)||Ii(S)?xl(S,p===void 0&&h==="string"?"string":p,m):Mi(S,t,n,r,[o,`${y}`].flat(1)));return}i[o]=xl(f,p,m)}),i)},bl=(e,t)=>typeof t=="function"?t(Re(e)):Re(e).format(t),Ip=(e,t)=>{const[n,r]=Array.isArray(e)?e:[];let a,i;Array.isArray(t)?(a=t[0],i=t[1]):typeof t=="object"&&t.type==="mask"?(a=t.format,i=t.format):(a=t,i=t);const o=n?bl(n,a):"",l=r?bl(r,i):"";return o&&l?`${o} ~ ${l}`:""};function Pt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}const Mp=e=>{var t;return!!((t=e==null?void 0:e.valueType)!=null&&t.toString().startsWith("date")||(e==null?void 0:e.valueType)==="select"||e!=null&&e.valueEnum)},Ap=e=>{var t;return((t=e.ellipsis)==null?void 0:t.showTitle)===!1?!1:e.ellipsis},Sl=e=>e==null?"":String(e).trimEnd(),kp=e=>d.isValidElement(e),Op=(e,t,n,r)=>{const a=Ap(t);if(!a)return!1;const i=Mp(t),o=kp(r);if((i||o)&&(t==null?void 0:t.tooltip)!==!1){const l=s.jsx("div",{className:"pro-table-tooltip-text",children:e});return Pt(a)&&Pt(a.tooltip)?{tooltip:{title:l,...a.tooltip}}:{tooltip:l}}return n?Pt(a)&&Pt(a.tooltip)?{tooltip:{title:n,...a.tooltip}}:{tooltip:n}:!1},Dp=(e,t,n,r)=>{if(!t.copyable&&!t.ellipsis)return e;const a=Sl(n),i=r!==void 0?Sl(r):a,o=Op(e,t,a,n);return t.copyable?s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",maxWidth:"100%"},children:[s.jsx(c.Typography.Text,{style:{flex:1,minWidth:0,margin:0,padding:0},title:"",ellipsis:o,children:e}),i?s.jsx("span",{style:{flex:"none",userSelect:"none"},children:s.jsx(c.Typography.Text,{style:{margin:0,padding:0},copyable:{text:i,tooltips:["",""]}})}):null]}):s.jsx(c.Typography.Text,{style:{width:"100%",margin:0,padding:0},title:"",ellipsis:o,children:e})};function vt(e,...t){return typeof e=="function"?e(...t):e}const Ai=(e,t,n)=>t===void 0?e:vt(e,t,n),je=e=>{const t=d.useRef(null);return t.current=e,d.useCallback((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])};function go(e,t){const n=je(e),r=d.useRef(),a=d.useCallback(()=>{r.current&&(clearTimeout(r.current),r.current=null)},[]),i=d.useCallback(async(...o)=>t===0||t===void 0?n(...o):(a(),new Promise(l=>{r.current=setTimeout(async()=>{l(await n(...o))},t)})),[n,a,t]);return d.useEffect(()=>a,[a]),{run:i,cancel:a}}const po=e=>{const t=d.useRef(e);return t.current=e,t};function Pp(e,t=100,n){const[r,a]=d.useState(e),i=po(e);return d.useEffect(()=>{const o=setTimeout(()=>{a(i.current)},t);return()=>clearTimeout(o)},n?[t,...n]:void 0),r}function vn(e,t,n){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,a,i;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(!vn(e[a],t[a],n))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;for(a of e.entries())if(!vn(a[1],t.get(a[0]),n))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(a=r;a--!==0;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(t,i[a]))return!1;for(a=r;a--!==0;){const o=i[a];if(!(n!=null&&n.includes(o))&&!(o==="_owner"&&e.$$typeof)&&!vn(e[o],t[o],n))return!1}return!0}return e!==e&&t!==t}const Np=(e,t,n)=>vn(e,t,n);function yo(e,t){const n=d.useRef();return Np(e,n.current,t)||(n.current=e),n.current}function ir(e,t,n){d.useEffect(e,yo(t||[],n))}function Yu(e,t,n,r){const a=go(async()=>{e()},r||16);d.useEffect(()=>{a.run()},yo(t||[],n))}function St(e,t){return d.useMemo(e,yo(t))}const Lp=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,xo=()=>typeof process<"u"&&process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Lp;let Cl=0;function _p(e){const t=d.useRef(null),[n]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():(Cl+=1,Cl.toString())),r=async()=>{var l;(l=t.current)==null||l.abort();const o=new AbortController;t.current=o;try{return e.request?await e.request(e.params,o.signal):void 0}catch(u){if(u.name==="AbortError")return;throw u}},{data:a,isValidating:i}=zu(e.request?[n,e.params]:null,r,{revalidateOnFocus:!1,shouldRetryOnError:!1,onError:()=>{}});return e.request?[a,i]:[void 0,!1]}const Vr=e=>{const t=d.useRef();return d.useEffect(()=>{t.current=e}),t.current};function zp(){const[,e]=d.useState(!0);return d.useCallback(()=>e(n=>!n),[])}function Bp(e,t){const n=d.useMemo(()=>{const r={current:t};return new Proxy(r,{set(a,i,o){return Object.is(a[i],o)||(a[i]=o,e(n)),!0}})},[]);return n}function Vp(e){const t=zp();return Bp(t,e)}const Hp=e=>{let t=!1;return(typeof e=="string"&&e.startsWith("date")&&!e.endsWith("Range")||e==="select"||e==="time")&&(t=!0),t},Ku=(...e)=>{const t={},n=e.length;let r,a=0;for(;a<n;a+=1)for(r in e[a])e[a].hasOwnProperty(r)&&(typeof t[r]=="object"&&typeof e[a][r]=="object"&&t[r]!==void 0&&t[r]!==null&&!Array.isArray(t[r])&&!Array.isArray(e[a][r])?t[r]={...t[r],...e[a][r]}:t[r]=e[a][r]);return t};let wl=0,Up=(e=21)=>{if(typeof window>"u"||!window.crypto)return(wl+=1).toFixed(0);let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;){let r=63&n[e];t+=r<36?r.toString(36):r<62?(r-26).toString(36).toUpperCase():r<63?"_":"-"}return t};const Gr=()=>{var e;return(e=window==null?void 0:window.crypto)!=null&&e.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Up()},Wu=e=>{if(e&&e!==!0)return e},xt=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},Yp=e=>{const t={};return Object.keys(e||{}).forEach(n=>{var r;Array.isArray(e[n])&&((r=e[n])==null?void 0:r.length)===0||e[n]!==void 0&&(t[n]=e[n])}),t};var Bs={exports:{}},Kp=Bs.exports,jl;function Wp(){return jl||(jl=1,(function(e,t){(function(n,r){e.exports=r()})(Kp,(function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,a=/\d/,i=/\d\d/,o=/\d\d?/,l=/\d*[^-_:/,()\s\d]+/,u={},m=function(w){return(w=+w)+(w>68?1900:2e3)},g=function(w){return function(T){this[w]=+T}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(w){(this.zone||(this.zone={})).offset=(function(T){if(!T||T==="Z")return 0;var x=T.match(/([+-]|\d\d)/g),C=60*x[1]+(+x[2]||0);return C===0?0:x[0]==="+"?-C:C})(w)}],h=function(w){var T=u[w];return T&&(T.indexOf?T:T.s.concat(T.f))},p=function(w,T){var x,C=u.meridiem;if(C){for(var j=1;j<=24;j+=1)if(w.indexOf(C(j,0,T))>-1){x=j>12;break}}else x=w===(T?"pm":"PM");return x},S={A:[l,function(w){this.afternoon=p(w,!1)}],a:[l,function(w){this.afternoon=p(w,!0)}],Q:[a,function(w){this.month=3*(w-1)+1}],S:[a,function(w){this.milliseconds=100*+w}],SS:[i,function(w){this.milliseconds=10*+w}],SSS:[/\d{3}/,function(w){this.milliseconds=+w}],s:[o,g("seconds")],ss:[o,g("seconds")],m:[o,g("minutes")],mm:[o,g("minutes")],H:[o,g("hours")],h:[o,g("hours")],HH:[o,g("hours")],hh:[o,g("hours")],D:[o,g("day")],DD:[i,g("day")],Do:[l,function(w){var T=u.ordinal,x=w.match(/\d+/);if(this.day=x[0],T)for(var C=1;C<=31;C+=1)T(C).replace(/\[|\]/g,"")===w&&(this.day=C)}],w:[o,g("week")],ww:[i,g("week")],M:[o,g("month")],MM:[i,g("month")],MMM:[l,function(w){var T=h("months"),x=(h("monthsShort")||T.map((function(C){return C.slice(0,3)}))).indexOf(w)+1;if(x<1)throw new Error;this.month=x%12||x}],MMMM:[l,function(w){var T=h("months").indexOf(w)+1;if(T<1)throw new Error;this.month=T%12||T}],Y:[/[+-]?\d+/,g("year")],YY:[i,function(w){this.year=m(w)}],YYYY:[/\d{4}/,g("year")],Z:f,ZZ:f};function y(w){var T,x;T=w,x=u&&u.formats;for(var C=(w=T.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(D,M,U){var Y=U&&U.toUpperCase();return M||x[U]||n[U]||x[Y].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(O,I,F){return I||F.slice(1)}))}))).match(r),j=C.length,b=0;b<j;b+=1){var v=C[b],$=S[v],E=$&&$[0],R=$&&$[1];C[b]=R?{regex:E,parser:R}:v.replace(/^\[|\]$/g,"")}return function(D){for(var M={},U=0,Y=0;U<j;U+=1){var O=C[U];if(typeof O=="string")Y+=O.length;else{var I=O.regex,F=O.parser,A=D.slice(Y),k=I.exec(A)[0];F.call(M,k),D=D.replace(k,"")}}return(function(B){var G=B.afternoon;if(G!==void 0){var _=B.hours;G?_<12&&(B.hours+=12):_===12&&(B.hours=0),delete B.afternoon}})(M),M}}return function(w,T,x){x.p.customParseFormat=!0,w&&w.parseTwoDigitYear&&(m=w.parseTwoDigitYear);var C=T.prototype,j=C.parse;C.parse=function(b){var v=b.date,$=b.utc,E=b.args;this.$u=$;var R=E[1];if(typeof R=="string"){var D=E[2]===!0,M=E[3]===!0,U=D||M,Y=E[2];M&&(Y=E[2]),u=this.$locale(),!D&&Y&&(u=x.Ls[Y]),this.$d=(function(A,k,B,G){try{if(["x","X"].indexOf(k)>-1)return new Date((k==="X"?1e3:1)*A);var _=y(k)(A),H=_.year,Z=_.month,q=_.day,V=_.hours,L=_.minutes,K=_.seconds,P=_.milliseconds,W=_.zone,te=_.week,re=new Date,X=q||(H||Z?1:re.getDate()),se=H||re.getFullYear(),ae=0;H&&!Z||(ae=Z>0?Z-1:re.getMonth());var ue,pe=V||0,me=L||0,fe=K||0,ye=P||0;return W?new Date(Date.UTC(se,ae,X,pe,me,fe,ye+60*W.offset*1e3)):B?new Date(Date.UTC(se,ae,X,pe,me,fe,ye)):(ue=new Date(se,ae,X,pe,me,fe,ye),te&&(ue=G(ue).week(te).toDate()),ue)}catch{return new Date("")}})(v,R,$,x),this.init(),Y&&Y!==!0&&(this.$L=this.locale(Y).$L),U&&v!=this.format(R)&&(this.$d=new Date("")),u={}}else if(R instanceof Array)for(var O=R.length,I=1;I<=O;I+=1){E[1]=R[I-1];var F=x.apply(this,E);if(F.isValid()){this.$d=F.$d,this.$L=F.$L,this.init();break}I===O&&(this.$d=new Date(""))}else j.call(this,b)}}}))})(Bs)),Bs.exports}var qp=Wp();const Gp=Jt(qp);Re.extend(Gp);const vl=e=>!!(e!=null&&e._isAMomentObject),xr=(e,t)=>Lt(e)||Re.isDayjs(e)||vl(e)?vl(e)?Re(e):e:Array.isArray(e)?e.map(n=>xr(n,t)):typeof e=="number"?Re(e):Re(e,t),Zp=["colon","dependencies","extra","getValueFromEvent","getValueProps","hasFeedback","help","htmlFor","initialValue","noStyle","label","labelAlign","labelCol","name","preserve","normalize","required","rules","shouldUpdate","trigger","validateFirst","validateStatus","validateTrigger","valuePropName","wrapperCol","hidden","validateDebounce","addonBefore","addonAfter","addonWarpStyle"];function Jp(e){const t={};return Zp.forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t}const Xp="valueType request formItemRender render text formItemProps valueEnum",Qp="fieldProps isDefaultDom groupProps contentRender submitterProps submitter";function zt(e,t=!1){const n=`${Xp} ${Qp}`.split(/[\s\n]+/),r={};return Object.keys(e||{}).forEach(a=>{n.includes(a)&&!t||(r[a]=e[a])}),r}function ey(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const ty=({color:e,children:t})=>s.jsx(c.Badge,{color:e,text:t}),un=e=>ey(e)==="map"?e:new Map(Object.entries(e||{})),ny={Success:({children:e})=>s.jsx(c.Badge,{status:"success",text:e}),Error:({children:e})=>s.jsx(c.Badge,{status:"error",text:e}),Default:({children:e})=>s.jsx(c.Badge,{status:"default",text:e}),Processing:({children:e})=>s.jsx(c.Badge,{status:"processing",text:e}),Warning:({children:e})=>s.jsx(c.Badge,{status:"warning",text:e}),success:({children:e})=>s.jsx(c.Badge,{status:"success",text:e}),error:({children:e})=>s.jsx(c.Badge,{status:"error",text:e}),default:({children:e})=>s.jsx(c.Badge,{status:"default",text:e}),processing:({children:e})=>s.jsx(c.Badge,{status:"processing",text:e}),warning:({children:e})=>s.jsx(c.Badge,{status:"warning",text:e})},Un=(e,t,n)=>{if(Array.isArray(e))return s.jsx(c.Space,{separator:",",size:2,wrap:!0,children:e.map((u,m)=>Un(u,t,m))},n);const r=un(t);if(!r.has(e)&&!r.has(`${e}`))return(e==null?void 0:e.label)||e;const a=r.get(e)||r.get(`${e}`);if(!a)return s.jsx(d.Fragment,{children:(e==null?void 0:e.label)||e},n);const{status:i,color:o}=a,l=ny[i||"Init"];return l?s.jsx(l,{children:a.text},n):o?s.jsx(ty,{color:o,children:a.text},n):s.jsx(d.Fragment,{children:a.text||a},n)};var ws={exports:{}},Tl;function ry(){return Tl||(Tl=1,(function(e,t){const{hasOwnProperty:n}=Object.prototype,r=T();r.configure=T,r.stringify=r,r.default=r,t.stringify=r,t.configure=T,e.exports=r;const a=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]/;function i(x){return x.length<5e3&&!a.test(x)?`"${x}"`:JSON.stringify(x)}function o(x,C){if(x.length>200||C)return x.sort(C);for(let j=1;j<x.length;j++){const b=x[j];let v=j;for(;v!==0&&x[v-1]>b;)x[v]=x[v-1],v--;x[v]=b}return x}const l=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function u(x){return l.call(x)!==void 0&&x.length!==0}function m(x,C,j){x.length<j&&(j=x.length);const b=C===","?"":" ";let v=`"0":${b}${x[0]}`;for(let $=1;$<j;$++)v+=`${C}"${$}":${b}${x[$]}`;return v}function g(x){if(n.call(x,"circularValue")){const C=x.circularValue;if(typeof C=="string")return`"${C}"`;if(C==null)return C;if(C===Error||C===TypeError)return{toString(){throw new TypeError("Converting circular structure to JSON")}};throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined')}return'"[Circular]"'}function f(x){let C;if(n.call(x,"deterministic")&&(C=x.deterministic,typeof C!="boolean"&&typeof C!="function"))throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');return C===void 0?!0:C}function h(x,C){let j;if(n.call(x,C)&&(j=x[C],typeof j!="boolean"))throw new TypeError(`The "${C}" argument must be of type boolean`);return j===void 0?!0:j}function p(x,C){let j;if(n.call(x,C)){if(j=x[C],typeof j!="number")throw new TypeError(`The "${C}" argument must be of type number`);if(!Number.isInteger(j))throw new TypeError(`The "${C}" argument must be an integer`);if(j<1)throw new RangeError(`The "${C}" argument must be >= 1`)}return j===void 0?1/0:j}function S(x){return x===1?"1 item":`${x} items`}function y(x){const C=new Set;for(const j of x)(typeof j=="string"||typeof j=="number")&&C.add(String(j));return C}function w(x){if(n.call(x,"strict")){const C=x.strict;if(typeof C!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(C)return j=>{let b=`Object can not safely be stringified. Received type ${typeof j}`;throw typeof j!="function"&&(b+=` (${j.toString()})`),new Error(b)}}}function T(x){x={...x};const C=w(x);C&&(x.bigint===void 0&&(x.bigint=!1),"circularValue"in x||(x.circularValue=Error));const j=g(x),b=h(x,"bigint"),v=f(x),$=typeof v=="function"?v:void 0,E=p(x,"maximumDepth"),R=p(x,"maximumBreadth");function D(I,F,A,k,B,G){let _=F[I];switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(I)),_=k.call(F,I,_),typeof _){case"string":return i(_);case"object":{if(_===null)return"null";if(A.indexOf(_)!==-1)return j;let H="",Z=",";const q=G;if(Array.isArray(_)){if(_.length===0)return"[]";if(E<A.length+1)return'"[Array]"';A.push(_),B!==""&&(G+=B,H+=`
37
+ ${G}`,Z=`,
38
+ ${G}`);const te=Math.min(_.length,R);let re=0;for(;re<te-1;re++){const se=D(String(re),_,A,k,B,G);H+=se!==void 0?se:"null",H+=Z}const X=D(String(re),_,A,k,B,G);if(H+=X!==void 0?X:"null",_.length-1>R){const se=_.length-R-1;H+=`${Z}"... ${S(se)} not stringified"`}return B!==""&&(H+=`
39
+ ${q}`),A.pop(),`[${H}]`}let V=Object.keys(_);const L=V.length;if(L===0)return"{}";if(E<A.length+1)return'"[Object]"';let K="",P="";B!==""&&(G+=B,Z=`,
40
+ ${G}`,K=" ");const W=Math.min(L,R);v&&!u(_)&&(V=o(V,$)),A.push(_);for(let te=0;te<W;te++){const re=V[te],X=D(re,_,A,k,B,G);X!==void 0&&(H+=`${P}${i(re)}:${K}${X}`,P=Z)}if(L>R){const te=L-R;H+=`${P}"...":${K}"${S(te)} not stringified"`,P=Z}return B!==""&&P.length>1&&(H=`
41
+ ${G}${H}
42
+ ${q}`),A.pop(),`{${H}}`}case"number":return isFinite(_)?String(_):C?C(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(_);default:return C?C(_):void 0}}function M(I,F,A,k,B,G){switch(typeof F=="object"&&F!==null&&typeof F.toJSON=="function"&&(F=F.toJSON(I)),typeof F){case"string":return i(F);case"object":{if(F===null)return"null";if(A.indexOf(F)!==-1)return j;const _=G;let H="",Z=",";if(Array.isArray(F)){if(F.length===0)return"[]";if(E<A.length+1)return'"[Array]"';A.push(F),B!==""&&(G+=B,H+=`
43
+ ${G}`,Z=`,
44
+ ${G}`);const L=Math.min(F.length,R);let K=0;for(;K<L-1;K++){const W=M(String(K),F[K],A,k,B,G);H+=W!==void 0?W:"null",H+=Z}const P=M(String(K),F[K],A,k,B,G);if(H+=P!==void 0?P:"null",F.length-1>R){const W=F.length-R-1;H+=`${Z}"... ${S(W)} not stringified"`}return B!==""&&(H+=`
45
+ ${_}`),A.pop(),`[${H}]`}A.push(F);let q="";B!==""&&(G+=B,Z=`,
46
+ ${G}`,q=" ");let V="";for(const L of k){const K=M(L,F[L],A,k,B,G);K!==void 0&&(H+=`${V}${i(L)}:${q}${K}`,V=Z)}return B!==""&&V.length>1&&(H=`
47
+ ${G}${H}
48
+ ${_}`),A.pop(),`{${H}}`}case"number":return isFinite(F)?String(F):C?C(F):"null";case"boolean":return F===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(F);default:return C?C(F):void 0}}function U(I,F,A,k,B){switch(typeof F){case"string":return i(F);case"object":{if(F===null)return"null";if(typeof F.toJSON=="function"){if(F=F.toJSON(I),typeof F!="object")return U(I,F,A,k,B);if(F===null)return"null"}if(A.indexOf(F)!==-1)return j;const G=B;if(Array.isArray(F)){if(F.length===0)return"[]";if(E<A.length+1)return'"[Array]"';A.push(F),B+=k;let K=`
49
49
  ${B}`;const P=`,
50
- ${B}`,W=Math.min(F.length,R);let te=0;for(;te<W-1;te++){const X=Y(String(te),F[te],D,O,B);K+=X!==void 0?X:"null",K+=P}const re=Y(String(te),F[te],D,O,B);if(K+=re!==void 0?re:"null",F.length-1>R){const X=F.length-R-1;K+=`${P}"... ${S(X)} not stringified"`}return K+=`
51
- ${q}`,D.pop(),`[${K}]`}let z=Object.keys(F);const V=z.length;if(V===0)return"{}";if(E<D.length+1)return'"[Object]"';B+=O;const Z=`,
52
- ${B}`;let G="",H="",L=Math.min(V,R);u(F)&&(G+=m(F,Z,R),z=z.slice(F.length),L-=F.length,H=Z),T&&(z=o(z,$)),D.push(F);for(let K=0;K<L;K++){const P=z[K],W=Y(P,F[P],D,O,B);W!==void 0&&(G+=`${H}${i(P)}: ${W}`,H=Z)}if(V>R){const K=V-R;G+=`${H}"...": "${S(K)} not stringified"`,H=Z}return H!==""&&(G=`
53
- ${B}${G}
54
- ${q}`),D.pop(),`{${G}}`}case"number":return isFinite(F)?String(F):C?C(F):"null";case"boolean":return F===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(F);default:return C?C(F):void 0}}function U(k,F,D){switch(typeof F){case"string":return i(F);case"object":{if(F===null)return"null";if(typeof F.toJSON=="function"){if(F=F.toJSON(k),typeof F!="object")return U(k,F,D);if(F===null)return"null"}if(D.indexOf(F)!==-1)return j;let O="";const B=F.length!==void 0;if(B&&Array.isArray(F)){if(F.length===0)return"[]";if(E<D.length+1)return'"[Array]"';D.push(F);const G=Math.min(F.length,R);let H=0;for(;H<G-1;H++){const K=U(String(H),F[H],D);O+=K!==void 0?K:"null",O+=","}const L=U(String(H),F[H],D);if(O+=L!==void 0?L:"null",F.length-1>R){const K=F.length-R-1;O+=`,"... ${S(K)} not stringified"`}return D.pop(),`[${O}]`}let q=Object.keys(F);const z=q.length;if(z===0)return"{}";if(E<D.length+1)return'"[Object]"';let V="",Z=Math.min(z,R);B&&u(F)&&(O+=m(F,",",R),q=q.slice(F.length),Z-=F.length,V=","),T&&(q=o(q,$)),D.push(F);for(let G=0;G<Z;G++){const H=q[G],L=U(H,F[H],D);L!==void 0&&(O+=`${V}${i(H)}:${L}`,V=",")}if(z>R){const G=z-R;O+=`${V}"...":"${S(G)} not stringified"`}return D.pop(),`{${O}}`}case"number":return isFinite(F)?String(F):C?C(F):"null";case"boolean":return F===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(F);default:return C?C(F):void 0}}function A(k,F,D){if(arguments.length>1){let O="";if(typeof D=="number"?O=" ".repeat(Math.min(D,10)):typeof D=="string"&&(O=D.slice(0,10)),F!=null){if(typeof F=="function")return I("",{"":k},[],F,O,"");if(Array.isArray(F))return M("",k,[],y(F),O,"")}if(O.length!==0)return Y("",k,[],O,"")}return U("",k,[])}return A}})(ws,ws.exports)),ws.exports}var sy=ry();const ay=Jt(sy),iy=ay.configure,wn=iy({bigint:!0,circularValue:"Magic circle!",deterministic:!1,maximumDepth:4});var qu=typeof global=="object"&&global&&global.Object===Object&&global,oy=typeof self=="object"&&self&&self.Object===Object&&self,en=qu||oy||Function("return this")(),Fn=en.Symbol,Gu=Object.prototype,ly=Gu.hasOwnProperty,cy=Gu.toString,Ir=Fn?Fn.toStringTag:void 0;function uy(e){var t=ly.call(e,Ir),n=e[Ir];try{e[Ir]=void 0;var r=!0}catch{}var a=cy.call(e);return r&&(t?e[Ir]=n:delete e[Ir]),a}var dy=Object.prototype,fy=dy.toString;function my(e){return fy.call(e)}var hy="[object Null]",gy="[object Undefined]",Fl=Fn?Fn.toStringTag:void 0;function br(e){return e==null?e===void 0?gy:hy:Fl&&Fl in Object(e)?uy(e):my(e)}function ln(e){return e!=null&&typeof e=="object"}var $n=Array.isArray;function Zu(e){return e}var py="[object AsyncFunction]",yy="[object Function]",xy="[object GeneratorFunction]",by="[object Proxy]";function bo(e){if(!Pt(e))return!1;var t=br(e);return t==yy||t==xy||t==py||t==by}var Za=en["__core-js_shared__"],$l=(function(){var e=/[^.]+$/.exec(Za&&Za.keys&&Za.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Sy(e){return!!$l&&$l in e}var Cy=Function.prototype,wy=Cy.toString;function Un(e){if(e!=null){try{return wy.call(e)}catch{}try{return e+""}catch{}}return""}var jy=/[\\^$.*+?()[\]{}|]/g,vy=/^\[object .+?Constructor\]$/,Ty=Function.prototype,Fy=Object.prototype,$y=Ty.toString,Ey=Fy.hasOwnProperty,Ry=RegExp("^"+$y.call(Ey).replace(jy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Iy(e){if(!Pt(e)||Sy(e))return!1;var t=bo(e)?Ry:vy;return t.test(Un(e))}function My(e,t){return e==null?void 0:e[t]}function Kn(e,t){var n=My(e,t);return Iy(n)?n:void 0}var ki=Kn(en,"WeakMap"),El=Object.create,Ay=(function(){function e(){}return function(t){if(!Pt(t))return{};if(El)return El(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function ky(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Oy(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Dy=800,Py=16,Ny=Date.now;function Ly(e){var t=0,n=0;return function(){var r=Ny(),a=Py-(r-n);if(n=r,a>0){if(++t>=Dy)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function _y(e){return function(){return e}}var ta=(function(){try{var e=Kn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),zy=ta?function(e,t){return ta(e,"toString",{configurable:!0,enumerable:!1,value:_y(t),writable:!0})}:Zu,By=Ly(zy);function Vy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Hy=9007199254740991,Yy=/^(?:0|[1-9]\d*)$/;function Ju(e,t){var n=typeof e;return t=t??Hy,!!t&&(n=="number"||n!="symbol"&&Yy.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,n){t=="__proto__"&&ta?ta(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ts(e,t){return e===t||e!==e&&t!==t}var Uy=Object.prototype,Ky=Uy.hasOwnProperty;function Xu(e,t,n){var r=e[t];(!(Ky.call(e,t)&&ts(r,n))||n===void 0&&!(t in e))&&So(e,t,n)}function Wy(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var l=t[i],u=void 0;u===void 0&&(u=e[l]),a?So(n,l,u):Xu(n,l,u)}return n}var Rl=Math.max;function qy(e,t,n){return t=Rl(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=Rl(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),ky(e,this,l)}}function Gy(e,t){return By(qy(e,t,Zu),e+"")}var Zy=9007199254740991;function Qu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Zy}function ns(e){return e!=null&&Qu(e.length)&&!bo(e)}function Jy(e,t,n){if(!Pt(n))return!1;var r=typeof t;return(r=="number"?ns(n)&&Ju(t,n.length):r=="string"&&t in n)?ts(n[t],e):!1}function Xy(e){return Gy(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&Jy(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,i)}return t})}var Qy=Object.prototype;function ya(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Qy;return e===n}function ex(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var tx="[object Arguments]";function Il(e){return ln(e)&&br(e)==tx}var ed=Object.prototype,nx=ed.hasOwnProperty,rx=ed.propertyIsEnumerable,na=Il((function(){return arguments})())?Il:function(e){return ln(e)&&nx.call(e,"callee")&&!rx.call(e,"callee")};function sx(){return!1}var td=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ml=td&&typeof module=="object"&&module&&!module.nodeType&&module,ax=Ml&&Ml.exports===td,Al=ax?en.Buffer:void 0,ix=Al?Al.isBuffer:void 0,mr=ix||sx,ox="[object Arguments]",lx="[object Array]",cx="[object Boolean]",ux="[object Date]",dx="[object Error]",fx="[object Function]",mx="[object Map]",hx="[object Number]",gx="[object Object]",px="[object RegExp]",yx="[object Set]",xx="[object String]",bx="[object WeakMap]",Sx="[object ArrayBuffer]",Cx="[object DataView]",wx="[object Float32Array]",jx="[object Float64Array]",vx="[object Int8Array]",Tx="[object Int16Array]",Fx="[object Int32Array]",$x="[object Uint8Array]",Ex="[object Uint8ClampedArray]",Rx="[object Uint16Array]",Ix="[object Uint32Array]",ot={};ot[wx]=ot[jx]=ot[vx]=ot[Tx]=ot[Fx]=ot[$x]=ot[Ex]=ot[Rx]=ot[Ix]=!0;ot[ox]=ot[lx]=ot[Sx]=ot[cx]=ot[Cx]=ot[ux]=ot[dx]=ot[fx]=ot[mx]=ot[hx]=ot[gx]=ot[px]=ot[yx]=ot[xx]=ot[bx]=!1;function Mx(e){return ln(e)&&Qu(e.length)&&!!ot[br(e)]}function Co(e){return function(t){return e(t)}}var nd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hr=nd&&typeof module=="object"&&module&&!module.nodeType&&module,Ax=Hr&&Hr.exports===nd,Ja=Ax&&qu.process,hr=(function(){try{var e=Hr&&Hr.require&&Hr.require("util").types;return e||Ja&&Ja.binding&&Ja.binding("util")}catch{}})(),kl=hr&&hr.isTypedArray,xa=kl?Co(kl):Mx,kx=Object.prototype,Ox=kx.hasOwnProperty;function rd(e,t){var n=$n(e),r=!n&&na(e),a=!n&&!r&&mr(e),i=!n&&!r&&!a&&xa(e),o=n||r||a||i,l=o?ex(e.length,String):[],u=l.length;for(var m in e)(t||Ox.call(e,m))&&!(o&&(m=="length"||a&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Ju(m,u)))&&l.push(m);return l}function sd(e,t){return function(n){return e(t(n))}}var Dx=sd(Object.keys,Object),Px=Object.prototype,Nx=Px.hasOwnProperty;function ad(e){if(!ya(e))return Dx(e);var t=[];for(var n in Object(e))Nx.call(e,n)&&n!="constructor"&&t.push(n);return t}function Lx(e){return ns(e)?rd(e):ad(e)}function _x(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var zx=Object.prototype,Bx=zx.hasOwnProperty;function Vx(e){if(!Pt(e))return _x(e);var t=ya(e),n=[];for(var r in e)r=="constructor"&&(t||!Bx.call(e,r))||n.push(r);return n}function id(e){return ns(e)?rd(e,!0):Vx(e)}var Zr=Kn(Object,"create");function Hx(){this.__data__=Zr?Zr(null):{},this.size=0}function Yx(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ux="__lodash_hash_undefined__",Kx=Object.prototype,Wx=Kx.hasOwnProperty;function qx(e){var t=this.__data__;if(Zr){var n=t[e];return n===Ux?void 0:n}return Wx.call(t,e)?t[e]:void 0}var Gx=Object.prototype,Zx=Gx.hasOwnProperty;function Jx(e){var t=this.__data__;return Zr?t[e]!==void 0:Zx.call(t,e)}var Xx="__lodash_hash_undefined__";function Qx(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zr&&t===void 0?Xx:t,this}function Vn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vn.prototype.clear=Hx;Vn.prototype.delete=Yx;Vn.prototype.get=qx;Vn.prototype.has=Jx;Vn.prototype.set=Qx;function eb(){this.__data__=[],this.size=0}function ba(e,t){for(var n=e.length;n--;)if(ts(e[n][0],t))return n;return-1}var tb=Array.prototype,nb=tb.splice;function rb(e){var t=this.__data__,n=ba(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():nb.call(t,n,1),--this.size,!0}function sb(e){var t=this.__data__,n=ba(t,e);return n<0?void 0:t[n][1]}function ab(e){return ba(this.__data__,e)>-1}function ib(e,t){var n=this.__data__,r=ba(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=eb;dn.prototype.delete=rb;dn.prototype.get=sb;dn.prototype.has=ab;dn.prototype.set=ib;var Jr=Kn(en,"Map");function ob(){this.size=0,this.__data__={hash:new Vn,map:new(Jr||dn),string:new Vn}}function lb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Sa(e,t){var n=e.__data__;return lb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function cb(e){var t=Sa(this,e).delete(e);return this.size-=t?1:0,t}function ub(e){return Sa(this,e).get(e)}function db(e){return Sa(this,e).has(e)}function fb(e,t){var n=Sa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Wn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Wn.prototype.clear=ob;Wn.prototype.delete=cb;Wn.prototype.get=ub;Wn.prototype.has=db;Wn.prototype.set=fb;function mb(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var od=sd(Object.getPrototypeOf,Object),hb="[object Object]",gb=Function.prototype,pb=Object.prototype,ld=gb.toString,yb=pb.hasOwnProperty,xb=ld.call(Object);function bb(e){if(!ln(e)||br(e)!=hb)return!1;var t=od(e);if(t===null)return!0;var n=yb.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ld.call(n)==xb}function Sb(){this.__data__=new dn,this.size=0}function Cb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function wb(e){return this.__data__.get(e)}function jb(e){return this.__data__.has(e)}var vb=200;function Tb(e,t){var n=this.__data__;if(n instanceof dn){var r=n.__data__;if(!Jr||r.length<vb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this}function Gt(e){var t=this.__data__=new dn(e);this.size=t.size}Gt.prototype.clear=Sb;Gt.prototype.delete=Cb;Gt.prototype.get=wb;Gt.prototype.has=jb;Gt.prototype.set=Tb;var cd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ol=cd&&typeof module=="object"&&module&&!module.nodeType&&module,Fb=Ol&&Ol.exports===cd,Dl=Fb?en.Buffer:void 0,Pl=Dl?Dl.allocUnsafe:void 0;function ud(e,t){if(t)return e.slice();var n=e.length,r=Pl?Pl(n):new e.constructor(n);return e.copy(r),r}function $b(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}function Eb(){return[]}var Rb=Object.prototype,Ib=Rb.propertyIsEnumerable,Nl=Object.getOwnPropertySymbols,Mb=Nl?function(e){return e==null?[]:(e=Object(e),$b(Nl(e),function(t){return Ib.call(e,t)}))}:Eb;function Ab(e,t,n){var r=t(e);return $n(e)?r:mb(r,n(e))}function Oi(e){return Ab(e,Lx,Mb)}var Di=Kn(en,"DataView"),Pi=Kn(en,"Promise"),Ni=Kn(en,"Set"),Ll="[object Map]",kb="[object Object]",_l="[object Promise]",zl="[object Set]",Bl="[object WeakMap]",Vl="[object DataView]",Ob=Un(Di),Db=Un(Jr),Pb=Un(Pi),Nb=Un(Ni),Lb=Un(ki),Dt=br;(Di&&Dt(new Di(new ArrayBuffer(1)))!=Vl||Jr&&Dt(new Jr)!=Ll||Pi&&Dt(Pi.resolve())!=_l||Ni&&Dt(new Ni)!=zl||ki&&Dt(new ki)!=Bl)&&(Dt=function(e){var t=br(e),n=t==kb?e.constructor:void 0,r=n?Un(n):"";if(r)switch(r){case Ob:return Vl;case Db:return Ll;case Pb:return _l;case Nb:return zl;case Lb:return Bl}return t});var _b=Object.prototype,zb=_b.hasOwnProperty;function Bb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&zb.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ra=en.Uint8Array;function wo(e){var t=new e.constructor(e.byteLength);return new ra(t).set(new ra(e)),t}function Vb(e,t){var n=wo(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Hb=/\w*$/;function Yb(e){var t=new e.constructor(e.source,Hb.exec(e));return t.lastIndex=e.lastIndex,t}var Hl=Fn?Fn.prototype:void 0,Yl=Hl?Hl.valueOf:void 0;function Ub(e){return Yl?Object(Yl.call(e)):{}}function dd(e,t){var n=t?wo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Kb="[object Boolean]",Wb="[object Date]",qb="[object Map]",Gb="[object Number]",Zb="[object RegExp]",Jb="[object Set]",Xb="[object String]",Qb="[object Symbol]",eS="[object ArrayBuffer]",tS="[object DataView]",nS="[object Float32Array]",rS="[object Float64Array]",sS="[object Int8Array]",aS="[object Int16Array]",iS="[object Int32Array]",oS="[object Uint8Array]",lS="[object Uint8ClampedArray]",cS="[object Uint16Array]",uS="[object Uint32Array]";function dS(e,t,n){var r=e.constructor;switch(t){case eS:return wo(e);case Kb:case Wb:return new r(+e);case tS:return Vb(e);case nS:case rS:case sS:case aS:case iS:case oS:case lS:case cS:case uS:return dd(e,n);case qb:return new r;case Gb:case Xb:return new r(e);case Zb:return Yb(e);case Jb:return new r;case Qb:return Ub(e)}}function fd(e){return typeof e.constructor=="function"&&!ya(e)?Ay(od(e)):{}}var fS="[object Map]";function mS(e){return ln(e)&&Dt(e)==fS}var Ul=hr&&hr.isMap,hS=Ul?Co(Ul):mS,gS="[object Set]";function pS(e){return ln(e)&&Dt(e)==gS}var Kl=hr&&hr.isSet,yS=Kl?Co(Kl):pS,xS=1,md="[object Arguments]",bS="[object Array]",SS="[object Boolean]",CS="[object Date]",wS="[object Error]",hd="[object Function]",jS="[object GeneratorFunction]",vS="[object Map]",TS="[object Number]",gd="[object Object]",FS="[object RegExp]",$S="[object Set]",ES="[object String]",RS="[object Symbol]",IS="[object WeakMap]",MS="[object ArrayBuffer]",AS="[object DataView]",kS="[object Float32Array]",OS="[object Float64Array]",DS="[object Int8Array]",PS="[object Int16Array]",NS="[object Int32Array]",LS="[object Uint8Array]",_S="[object Uint8ClampedArray]",zS="[object Uint16Array]",BS="[object Uint32Array]",rt={};rt[md]=rt[bS]=rt[MS]=rt[AS]=rt[SS]=rt[CS]=rt[kS]=rt[OS]=rt[DS]=rt[PS]=rt[NS]=rt[vS]=rt[TS]=rt[gd]=rt[FS]=rt[$S]=rt[ES]=rt[RS]=rt[LS]=rt[_S]=rt[zS]=rt[BS]=!0;rt[wS]=rt[hd]=rt[IS]=!1;function Vs(e,t,n,r,a,i){var o,l=t&xS;if(o!==void 0)return o;if(!Pt(e))return e;var u=$n(e);if(u)o=Bb(e);else{var m=Dt(e),g=m==hd||m==jS;if(mr(e))return ud(e,l);if(m==gd||m==md||g&&!a)o=g?{}:fd(e);else{if(!rt[m])return a?e:{};o=dS(e,m,l)}}i||(i=new Gt);var f=i.get(e);if(f)return f;i.set(e,o),yS(e)?e.forEach(function(S){o.add(Vs(S,t,n,S,e,i))}):hS(e)&&e.forEach(function(S,y){o.set(y,Vs(S,t,n,y,e,i))});var h=Oi,p=u?void 0:h(e);return Vy(p||e,function(S,y){p&&(y=S,S=e[y]),Xu(o,y,Vs(S,t,n,y,e,i))}),o}var VS=1,HS=4;function YS(e){return Vs(e,VS|HS)}var US="__lodash_hash_undefined__";function KS(e){return this.__data__.set(e,US),this}function WS(e){return this.__data__.has(e)}function sa(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}sa.prototype.add=sa.prototype.push=KS;sa.prototype.has=WS;function qS(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function GS(e,t){return e.has(t)}var ZS=1,JS=2;function pd(e,t,n,r,a,i){var o=n&ZS,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var m=i.get(e),g=i.get(t);if(m&&g)return m==t&&g==e;var f=-1,h=!0,p=n&JS?new sa:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var S=e[f],y=t[f];if(r)var w=o?r(y,S,f,t,e,i):r(S,y,f,e,t,i);if(w!==void 0){if(w)continue;h=!1;break}if(p){if(!qS(t,function(v,x){if(!GS(p,x)&&(S===v||a(S,v,n,r,i)))return p.push(x)})){h=!1;break}}else if(!(S===y||a(S,y,n,r,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function XS(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function QS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var eC=1,tC=2,nC="[object Boolean]",rC="[object Date]",sC="[object Error]",aC="[object Map]",iC="[object Number]",oC="[object RegExp]",lC="[object Set]",cC="[object String]",uC="[object Symbol]",dC="[object ArrayBuffer]",fC="[object DataView]",Wl=Fn?Fn.prototype:void 0,Xa=Wl?Wl.valueOf:void 0;function mC(e,t,n,r,a,i,o){switch(n){case fC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case dC:return!(e.byteLength!=t.byteLength||!i(new ra(e),new ra(t)));case nC:case rC:case iC:return ts(+e,+t);case sC:return e.name==t.name&&e.message==t.message;case oC:case cC:return e==t+"";case aC:var l=XS;case lC:var u=r&eC;if(l||(l=QS),e.size!=t.size&&!u)return!1;var m=o.get(e);if(m)return m==t;r|=tC,o.set(e,t);var g=pd(l(e),l(t),r,a,i,o);return o.delete(e),g;case uC:if(Xa)return Xa.call(e)==Xa.call(t)}return!1}var hC=1,gC=Object.prototype,pC=gC.hasOwnProperty;function yC(e,t,n,r,a,i){var o=n&hC,l=Oi(e),u=l.length,m=Oi(t),g=m.length;if(u!=g&&!o)return!1;for(var f=u;f--;){var h=l[f];if(!(o?h in t:pC.call(t,h)))return!1}var p=i.get(e),S=i.get(t);if(p&&S)return p==t&&S==e;var y=!0;i.set(e,t),i.set(t,e);for(var w=o;++f<u;){h=l[f];var v=e[h],x=t[h];if(r)var C=o?r(x,v,h,t,e,i):r(v,x,h,e,t,i);if(!(C===void 0?v===x||a(v,x,n,r,i):C)){y=!1;break}w||(w=h=="constructor")}if(y&&!w){var j=e.constructor,b=t.constructor;j!=b&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof b=="function"&&b instanceof b)&&(y=!1)}return i.delete(e),i.delete(t),y}var xC=1,ql="[object Arguments]",Gl="[object Array]",js="[object Object]",bC=Object.prototype,Zl=bC.hasOwnProperty;function SC(e,t,n,r,a,i){var o=$n(e),l=$n(t),u=o?Gl:Dt(e),m=l?Gl:Dt(t);u=u==ql?js:u,m=m==ql?js:m;var g=u==js,f=m==js,h=u==m;if(h&&mr(e)){if(!mr(t))return!1;o=!0,g=!1}if(h&&!g)return i||(i=new Gt),o||xa(e)?pd(e,t,n,r,a,i):mC(e,t,u,n,r,a,i);if(!(n&xC)){var p=g&&Zl.call(e,"__wrapped__"),S=f&&Zl.call(t,"__wrapped__");if(p||S){var y=p?e.value():e,w=S?t.value():t;return i||(i=new Gt),a(y,w,n,r,i)}}return h?(i||(i=new Gt),yC(e,t,n,r,a,i)):!1}function yd(e,t,n,r,a){return e===t?!0:e==null||t==null||!ln(e)&&!ln(t)?e!==e&&t!==t:SC(e,t,n,r,yd,a)}function CC(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),l=o.length;l--;){var u=o[++a];if(n(i[u],u,i)===!1)break}return t}}var wC=CC();function Li(e,t,n){(n!==void 0&&!ts(e[t],n)||n===void 0&&!(t in e))&&So(e,t,n)}function jC(e){return ln(e)&&ns(e)}function _i(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function vC(e){return Wy(e,id(e))}function TC(e,t,n,r,a,i,o){var l=_i(e,n),u=_i(t,n),m=o.get(u);if(m){Li(e,n,m);return}var g=i?i(l,u,n+"",e,t,o):void 0,f=g===void 0;if(f){var h=$n(u),p=!h&&mr(u),S=!h&&!p&&xa(u);g=u,h||p||S?$n(l)?g=l:jC(l)?g=Oy(l):p?(f=!1,g=ud(u,!0)):S?(f=!1,g=dd(u,!0)):g=[]:bb(u)||na(u)?(g=l,na(l)?g=vC(l):(!Pt(l)||bo(l))&&(g=fd(u))):f=!1}f&&(o.set(u,g),a(g,u,r,i,o),o.delete(u)),Li(e,n,g)}function xd(e,t,n,r,a){e!==t&&wC(t,function(i,o){if(a||(a=new Gt),Pt(i))TC(e,t,o,n,xd,r,a);else{var l=r?r(_i(e,o),i,o+"",e,t,a):void 0;l===void 0&&(l=i),Li(e,o,l)}},id)}var FC="[object Map]",$C="[object Set]",EC=Object.prototype,RC=EC.hasOwnProperty;function IC(e){if(e==null)return!0;if(ns(e)&&($n(e)||typeof e=="string"||typeof e.splice=="function"||mr(e)||xa(e)||na(e)))return!e.length;var t=Dt(e);if(t==FC||t==$C)return!e.size;if(ya(e))return!ad(e).length;for(var n in e)if(RC.call(e,n))return!1;return!0}function Qa(e,t){return yd(e,t)}var aa=Xy(function(e,t,n){xd(e,t,n)});function MC(e){return typeof e!="object"?!1:e===null?!0:!(d.isValidElement(e)||e.constructor===RegExp||e instanceof Map||e instanceof Set||e instanceof HTMLElement||e instanceof Blob||e instanceof File||Array.isArray(e))}function AC(e){return e.split(".").map(t=>/^\d+$/.test(t)?parseInt(t,10):t)}function kC(e){const t={};for(const n in e){const r=e[n];Lt(r)||(t[n]=r)}return t}function OC(e){const t={},n={};for(const r in e){const a=e[r];Lt(a)||(r.includes(".")?t[r]=a:n[r]=a)}return{dotPathTransforms:t,objectTransforms:n}}function DC(e,t){for(const n in t){const r=t[n];if(typeof r!="function")continue;const a=AC(n),i=Be(e,a);if(i===void 0)continue;const o=r(i,a.map(String),e);if(typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=a.slice(0,-1),u=l.length>0?Be(e,l):e;if(u&&typeof u=="object"){const m=a[a.length-1];delete u[m],Object.assign(u,o)}}else{let l=e;for(let u=0;u<a.length-1;u++){const m=a[u];if(l[m]===void 0){const g=a[u+1];l[m]=typeof g=="number"?[]:{}}l=l[m]}l[a[a.length-1]]=o}}}function PC(e,t,n){let r=e;for(const a of t){const i=String(a);if(r&&typeof r[i]=="object")r=r[i];else{r=null;break}}if(r&&typeof r[n]=="function")return r[n]}function NC(e){return e.some(t=>!isNaN(Number(t)))}function zi(e,t,n,r,a){if(e!=null&&typeof e=="object"){if(a.has(e))return e;a.add(e)}const i=Array.isArray(e);let o=i?[]:{};if(e==null||e===void 0)return o;const l=i?e.map((u,m)=>m.toString()):Object.keys(e);for(const u of l){const m=t?[...t,u]:[u],g=e[u];let f=n[u];if(!f&&t&&(f=PC(n,t,u)),f&&typeof f=="function"){const h=f(g,u,e);typeof h=="object"&&h!==null&&!Array.isArray(h)?(t?NC(t):!1)?Object.assign(o,h):r.push(h):o[u]=h}else if(MC(g)&&!Lt(g)){const h=n[u];if(h&&typeof h=="object"){const p=zi(g,m,h,r,a);Object.keys(p).length>0&&(o[u]=p)}else{const p=zi(g,m,n,r,a);o[u]=p}}else Lt(g)||(o[u]=g)}return o}const LC=(e,t)=>{const n=kC(t);if(Object.keys(n).length<1||typeof window>"u"||typeof e!="object"||Lt(e)||e instanceof Blob)return e;let r=YS(e);const{dotPathTransforms:a,objectTransforms:i}=OC(t);DC(r,a);const o=[];Object.keys(i).length>0&&(r=zi(r,void 0,i,o,new Set));for(const l of o)Object.assign(r,l);return r},_C=(e,t,n)=>{const r=d.useRef({});function a(i){var l;function o(u,m){u.forEach((g,f)=>{const h=n(g,f);m.set(h,g),g&&typeof g=="object"&&t in g&&o(g[t]||[],m)})}if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){const u=new Map;o(e,u),r.current={data:e,childrenColumnName:t,kvMap:u,getRowKey:n}}return(l=r.current.kvMap)==null?void 0:l.get(i)}return[a]},{noteOnce:zC}=st,Jl=e=>c.message.warning(e),it=e=>Array.isArray(e)?e.join(","):e,jo=(...e)=>e.flat(1).filter(t=>t!=null).map(t=>typeof t=="number"?t.toString():t);function bd(e,t,n,r,a){const i=new Map;return e.forEach((o,l)=>{const u=(a||0)*10+l,m=t(o,u).toString();if(o&&typeof o=="object"&&n in o){const h=o[n]||[];bd(h,t,n,m,u).forEach((S,y)=>i.set(y,S))}const f={...o,map_row_key:m,map_row_parentKey:r};delete f.children,r||delete f.map_row_parentKey,i.set(m,f)}),i}function BC(e,t,n){const r=new Map,a=[],i=o=>{e.forEach(l=>{var u;if(l.map_row_parentKey!=null&&!l.map_row_key){const{map_row_parentKey:m,...g}=l,f=String(m);r.has(f)||r.set(f,[]),o&&((u=r.get(f))==null||u.push(g))}})};return i(n==="top"),e.forEach(o=>{var l,u;if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:m,map_row_key:g,isNewRecord:f,...h}=o,p={...h,map_row_key:g},S=m!=null?String(m):null;if(!S)return;r.has(S)||r.set(S,[]),f&&n==="top"?(l=r.get(S))==null||l.unshift(p):(u=r.get(S))==null||u.push(p)}}),e.forEach(o=>{if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:l,map_row_key:u}=o,m=l!=null?String(l):null;if(!m)return;const g=r.get(m);if(g&&g.length>0){const f=g.findIndex(h=>{const p=h.map_row_key||h.id;return String(p)===String(u)});f>=0&&r.has(u)&&(g[f]={...g[f],[t]:r.get(u)})}}}),i(n==="update"),e.forEach(o=>{if(!o.map_row_parentKey){const{map_row_key:l,...u}=o,m=l&&r.has(l)?{...u,[t]:r.get(l)}:u;a.push(m)}}),a}function Pr(e,t){var u;const{getRowKey:n,row:r,data:a,childrenColumnName:i="children"}=e,o=(u=it(e.key))==null?void 0:u.toString(),l=bd(a,n,i);if(t==="delete")l.delete(o);else if(t==="top"||t==="update"){const m=l.get(o);m?l.set(o,{...m,...r}):l.set(o,{...r,map_row_key:o,map_row_parentKey:r.map_row_parentKey,isNewRecord:!0})}return BC(l,i,t)}function VC({recordKey:e,onSave:t,row:n,children:r,newLineConfig:a,editorType:i,tableName:o},l){const u=d.useContext(es),m=c.Form.useFormInstance(),[g,f]=d.useState(!1),h=je(async()=>{try{const p=i==="Map",S=jo(o,Array.isArray(e)?e[0]:e);f(!0);try{await m.validateFields(S,{recursive:!0})}catch(x){throw f(!1),x}const y=(()=>{var j;const x=(j=u==null?void 0:u.getFieldFormatValueObject)==null?void 0:j.call(u,S);return(x!=null?Be(x,S):null)??m.getFieldValue(S)})();if(Array.isArray(e)&&e.length>1){const[,...x]=e,C=Be(y,x);Qe(y,x,C)}const w=p?Qe({},S,y):y,v=await(t==null?void 0:t(e,Ku({},n,w),n,a));return f(!1),v}catch(p){throw f(!1),p}});return d.useImperativeHandle(l,()=>({save:h}),[h]),s.jsxs("a",{onClick:async p=>{p.stopPropagation(),p.preventDefault();try{await h()}catch{}},children:[g?s.jsx(de.LoadingOutlined,{style:{marginInlineEnd:8}}):null,r||"保存"]},"save")}const HC=({recordKey:e,onDelete:t,preEditRowRef:n,preEditRowRefs:r,row:a,children:i,deletePopconfirmMessage:o})=>{const[l,u]=d.useState(!1),m=je(async()=>{var g,f;try{u(!0);const h=await(t==null?void 0:t(e,a));return u(!1),h===!1?!1:h}catch{return u(!1),null}finally{const h=(g=it(e))==null?void 0:g.toString();h&&((f=r==null?void 0:r.current)==null||f.delete(h)),n&&(n.current=null)}});return i!==!1?s.jsx(c.Popconfirm,{title:o||"确定要删除这条记录吗?",onConfirm:m,getPopupContainer:g=>g.parentElement||document.body,children:s.jsxs("a",{children:[l?s.jsx(de.LoadingOutlined,{style:{marginInlineEnd:8}}):null,i||"删除"]})},"delete"):null},YC=e=>{const{recordKey:t,tableName:n,newLineConfig:r,editorType:a,onCancel:i,cancelEditable:o,row:l,cancelText:u,preEditRowRef:m,preEditRowRefs:g}=e,f=d.useContext(es),h=c.Form.useFormInstance();return s.jsx("a",{onClick:async p=>{var E,R,I,M;p.stopPropagation(),p.preventDefault();const S=a==="Map",y=(E=it(t))==null?void 0:E.toString(),w=jo(n,t),v=(()=>{var A;const Y=(A=f==null?void 0:f.getFieldFormatValueObject)==null?void 0:A.call(f,w);return(Y!=null?Be(Y,w):null)??(h==null?void 0:h.getFieldValue(w))})(),x=S?Qe({},w,v):v,C=y!=null?(R=g==null?void 0:g.current)==null?void 0:R.get(y):void 0,j=(()=>{var k,F,D;const Y=(k=r==null?void 0:r.options)==null?void 0:k.recordKey;if(Y==null||t==null)return!1;const U=(F=it(Y))==null?void 0:F.toString(),A=(D=it(t))==null?void 0:D.toString();return!U||!A?!1:U===A})(),b=await(i==null?void 0:i(t,x,l,r));await o(t);const T=C??(m==null?void 0:m.current)??l;return C===null||C===void 0&&(m==null?void 0:m.current)===null&&j?await((I=e.onDelete)==null?void 0:I.call(e,t,l)):T!=null&&h.setFieldsValue(Qe({},w,T)),y&&((M=g==null?void 0:g.current)==null||M.delete(y)),m&&(m.current=null),b},children:u||"取消"},"cancel")};function UC(e,t){const{recordKey:n,newLineConfig:r,saveText:a,deleteText:i}=t,o=d.forwardRef(VC),l=d.createRef();return{save:s.jsx(o,{...t,row:e,ref:l,children:a},"save"+n),saveRef:l,delete:(r==null?void 0:r.options.recordKey)!==n?s.jsx(HC,{...t,row:e,children:i},"delete"+n):void 0,cancel:s.jsx(YC,{...t,row:e},"cancel"+n)}}function KC(e){const t=Ne(),n=d.useRef(null),r=d.useRef(new Map),[a,i]=d.useState(void 0),o=je(()=>{const P=new Map,W=(te,re)=>{te==null||te.forEach((X,se)=>{const ae=re==null?se.toString():`${re}_${se}`,ue=it(e.getRowKey(X,-1));if(ue==null)return;P.set(ae,ue),P.set(ue.toString(),ae);const pe=e.childrenColumnName&&(X==null?void 0:X[e.childrenColumnName]);pe&&W(pe,ae)})};return W(e.dataSource),P}),l=d.useMemo(()=>o(),[]),u=d.useRef(l),m=d.useRef(void 0);Uu(()=>{u.current=o()},[e.dataSource]),m.current=a;const g=e.type||"single",[f]=_C(e.dataSource,"children",e.getRowKey),[h,p]=dt([],e.editableKeys),S=d.useCallback(P=>{p(W=>{var re;const te=typeof P=="function"?P(W):P;return(re=e==null?void 0:e.onChange)==null||re.call(e,(te==null?void 0:te.filter(X=>X!==void 0))??[],(te==null?void 0:te.map(X=>f(X)).filter(X=>X!==void 0))??[]),te})},[e.onChange,f]),y=Vr(h),w=je((P,W)=>W.includes(P)),v=je(P=>{var ae,ue;const W=(ae=e.getRowKey(P,P.index))==null?void 0:ae.toString(),te=(ue=e.getRowKey(P,-1))==null?void 0:ue.toString(),re=(h==null?void 0:h.map(pe=>pe==null?void 0:pe.toString()))||[],X=(y==null?void 0:y.map(pe=>pe==null?void 0:pe.toString()))||[],se=w(te,X)||w(W,X);return{recordKey:te,isEditable:w(te,re)||w(W,re),preIsEditable:se}}),x=je(()=>h&&h.length>0&&g==="single"&&e.onlyOneLineEditorAlertMessage!==!1?(Jl(e.onlyOneLineEditorAlertMessage||t.getMessage("editableTable.onlyOneLineEditor","只能同时编辑一行")),!1):!0),C=je(P=>{var W;return((W=e.dataSource)==null?void 0:W.find((te,re)=>e.getRowKey(te,re)===P))??null}),j=je((P,W)=>{var X;if(!x())return!1;if(!(h==null?void 0:h.some(se=>se===P||(se==null?void 0:se.toString())===(P==null?void 0:P.toString())))){const se=h?[...h,P]:[P];S(se)}n.current=W??C(P)??null;const re=(X=it(P))==null?void 0:X.toString();return re&&r.current.set(re,n.current),!0}),b=je(P=>{const W=it(P),te=W!=null?W.toString():null;if(te==null)return;const re=(h==null?void 0:h.filter(X=>(X==null?void 0:X.toString())!==te&&X!==W))??[];S(re)}),T=je(async(P,W)=>{var ue,pe,me,fe;const te=it(P),re=te!=null?te.toString():null,X=re!=null?u.current.get(re):void 0,se=h==null?void 0:h.some(ye=>re==null?!1:(ye==null?void 0:ye.toString())===re||ye===te);if(!se&&X&&(W??!0)&&e.tableName)return await T(X,!1);if(e.onCancel&&se){const ye=Array.isArray(P)?P[0]:P,Te=C(ye),Oe=n.current,Ae=(ue=a==null?void 0:a.options)==null?void 0:ue.recordKey,ze=Ae!=null?it(Ae):null,ce=ze!=null?ze.toString():null,_=a!=null&&Ae!=null&&(Ae===P||ce!=null&&re!=null&&ce===re||(Ae==null?void 0:Ae.toString())===(P==null?void 0:P.toString())||String(Ae)===String(P))?a:void 0;try{await e.onCancel(P,Te||(_==null?void 0:_.defaultValue)||{},Oe||Te||(_==null?void 0:_.defaultValue)||{},_)}catch(J){console.error("onCancel error:",J)}}if(a){const ye=a.options.recordKey,Te=ye!=null?(pe=it(ye))==null?void 0:pe.toString():null;(ye===P||Te!=null&&re!=null&&Te===re||(ye==null?void 0:ye.toString())===(P==null?void 0:P.toString())||String(ye)===String(P))&&i(void 0)}const ae=n.current;if(ae&&e.getRowKey(ae,-1)===P&&se){try{const ye=(me=e.formProps)==null?void 0:me.formRef,Te=(ye==null?void 0:ye.current)||e.form;if(Te)if(e.tableName){const Oe=jo(e.tableName,P);Te.setFieldsValue(Qe({},Oe,ae))}else{const Oe=(fe=it(P))==null?void 0:fe.toString();if(Oe)try{Te.resetFields([[Oe]]),Te.setFieldsValue({[Oe]:void 0})}catch(Ae){console.warn("Failed to clear form fields in cancelEditable:",Ae)}}}catch(ye){console.warn("Failed to reset form fields in cancelEditable:",ye)}n.current=null}return b(P),!0}),$=go(async(...P)=>{var W;(W=e.onValuesChange)==null||W.call(e,...P)},64),E=je(P=>[e.tableName||"",P].flat(1).filter(W=>W||W===0)),R=je((P,W)=>{let te=P;return h==null||h.forEach(re=>{if((a==null?void 0:a.options.recordKey)===re)return;const X=re.toString(),se=E(X),ae=Be(W,se);ae&&(te=Pr({data:te,getRowKey:e.getRowKey,row:ae,key:X,childrenColumnName:e.childrenColumnName||"children"},"update"))}),te}),I=je((P,W,te)=>{var pe;const re=Object.keys(P||{});if(re.length===0)return(a==null?void 0:a.defaultValue)||{};const X=((pe=re.pop())==null?void 0:pe.toString())||"";if(!X)return(a==null?void 0:a.defaultValue)||{};const se=E(X),ae={...a==null?void 0:a.defaultValue,...Be(W,se)};return u.current.has(it(X))&&te.find((fe,ye)=>{var Oe;return((Oe=e.getRowKey(fe,ye))==null?void 0:Oe.toString())===X})||ae}),M=je((P,W)=>{if(!e.onValuesChange)return;const te=R(e.dataSource,W),re=I(P,W,te);$.run(re,te)}),Y=d.useRef(new Map);d.useEffect(()=>{const P=new Set((h==null?void 0:h.map(W=>W==null?void 0:W.toString()))??[]);Y.current.forEach((W,te)=>{P.has(te==null?void 0:te.toString())||Y.current.delete(te)})},[h]);const U=je(P=>{const W=it(P);return Y.current.get(W)||Y.current.get(W.toString())}),A=je(async(P,W)=>{const te=it(P),re=te.toString(),X=u.current.get(re);if(!(h==null?void 0:h.some(ue=>(ue==null?void 0:ue.toString())===re||ue===te))&&X&&(W??!0)&&e.tableName)return await A(X,!1);const ae=U(P);return ae!=null&&ae.current?(await ae.current.save(),b(P),!0):!1}),k=je(P=>P!=null&&P.parentKey&&!u.current.has(it(P==null?void 0:P.parentKey).toString())?(console.warn("can't find record by key",P==null?void 0:P.parentKey),!1):m.current&&e.onlyAddOneLineAlertMessage!==!1?(Jl(e.onlyAddOneLineAlertMessage||t.getMessage("editableTable.onlyAddOneLine","只能新增一行")),!1):!!x()),F=je(P=>{if(P==null&&P!==0&&P!=="")throw zC(!1,`请设置 recordCreatorProps.record 并返回一个唯一的key
55
- https://procomponents.ant.design/components/editable-table#editable-%E6%96%B0%E5%BB%BA%E8%A1%8C`),new Error("请设置 recordCreatorProps.record 并返回一个唯一的key")}),D=je((P,W)=>{var ue,pe;if(!k(W))return!1;const te=e.getRowKey(P,-1);F(te);const re=(ue=it(te))==null?void 0:ue.toString();if(re&&r.current.set(re,null),!(h==null?void 0:h.some(me=>me===te||(me==null?void 0:me.toString())===(te==null?void 0:te.toString())))){const me=h?[...h,te]:[te];S(me)}const se=typeof(W==null?void 0:W.parentKey)=="function"?W.parentKey():W==null?void 0:W.parentKey;if((W==null?void 0:W.newRecordType)==="dataSource"||e.tableName&&(W==null?void 0:W.newRecordType)!=="cache"){const me={data:e.dataSource,getRowKey:e.getRowKey,row:{...P,map_row_parentKey:se?(pe=it(se))==null?void 0:pe.toString():void 0},key:te,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Pr(me,(W==null?void 0:W.position)==="top"?"top":"update"))}else i({defaultValue:P,options:{...W,parentKey:se,recordKey:te}});return!0}),O=(e==null?void 0:e.saveText)||t.getMessage("editableTable.action.save","保存"),B=(e==null?void 0:e.deleteText)||t.getMessage("editableTable.action.delete","删除"),q=(e==null?void 0:e.cancelText)||t.getMessage("editableTable.action.cancel","取消"),z=je(async(P,W,te,re)=>{var pe,me,fe;const X=await((pe=e==null?void 0:e.onSave)==null?void 0:pe.call(e,P,W,te,re));if(X===!1)return X;const{options:se}=re||m.current||{};if(!(se!=null&&se.parentKey)&&(se==null?void 0:se.recordKey)===P)(se==null?void 0:se.position)==="top"?e.setDataSource([W,...e.dataSource]):e.setDataSource([...e.dataSource,W]);else{const ye={data:e.dataSource,getRowKey:e.getRowKey,row:se?{...W,map_row_parentKey:(me=it((se==null?void 0:se.parentKey)??""))==null?void 0:me.toString()}:W,key:P,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Pr(ye,(se==null?void 0:se.position)==="top"?"top":"update"))}await T(P);const ue=(fe=it(P))==null?void 0:fe.toString();return ue&&r.current.delete(ue),X}),V=je(async(P,W)=>{var se,ae;const te={data:e.dataSource,getRowKey:e.getRowKey,row:W,key:P,childrenColumnName:e.childrenColumnName||"children"},re=await((se=e==null?void 0:e.onDelete)==null?void 0:se.call(e,P,W));if(re===!1)return!1;await T(P,!1),e.setDataSource(Pr(te,"delete"));const X=(ae=it(P))==null?void 0:ae.toString();return X&&r.current.delete(X),re}),Z=je(async(P,W,te,re)=>{var se;return await((se=e==null?void 0:e.onCancel)==null?void 0:se.call(e,P,W,te,re))}),G=e.actionRender&&typeof e.actionRender=="function",H=G?e.actionRender:()=>{},L=je(H);return{editableKeys:h,setEditableRowKeys:S,isEditable:v,actionRender:P=>{const W=e.getRowKey(P,P.index),te={saveText:O,cancelText:q,deleteText:B,addEditRecord:D,recordKey:W,cancelEditable:T,index:P.index,tableName:e.tableName,newLineConfig:a,onCancel:Z,onDelete:V,onSave:z,editableKeys:h,setEditableRowKeys:S,preEditRowRef:n,preEditRowRefs:r,deletePopconfirmMessage:e.deletePopconfirmMessage||`${t.getMessage("deleteThisLine","删除此项")}?`},re=UC(P,te);return e.tableName?Y.current.set(u.current.get(it(W))||it(W),re.saveRef):Y.current.set(it(W),re.saveRef),G?L(P,te,{save:re.save,delete:re.delete,cancel:re.cancel}):[re.save,re.delete,re.cancel]},startEditable:j,cancelEditable:T,addEditRecord:D,saveEditable:A,newLineRecord:a,preEditableKeys:y,onValuesChange:M,getRealIndex:e.getRealIndex}}const WC=new $u("card-loading",{"0%":{backgroundPosition:"0 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),qC=e=>({[e.componentCls]:{boxSizing:"border-box","&-loading":{overflow:"hidden"},"&-loading &-body":{userSelect:"none"},[`${e.componentCls}-loading-content`]:{width:"100%",p:{marginBlock:0,marginInline:0}},[`${e.componentCls}-loading-block`]:{height:"14px",marginBlock:"4px",background:"linear-gradient(90deg, rgba(54, 61, 64, 0.2), rgba(54, 61, 64, 0.4), rgba(54, 61, 64, 0.2))",backgroundSize:"600% 600%",borderRadius:e.borderRadius,animationName:WC,animationDuration:"1.4s",animationTimingFunction:"ease",animationIterationCount:"infinite"}}});function GC(e){return tt("ProCardLoading",t=>{const n={...t,componentCls:`.${e}`};return[qC(n)]})}const ZC=e=>{const{style:t,prefix:n}=e,{wrapSSR:r}=GC(n||"ant-pro-card");return r(s.jsxs("div",{className:`${n}-loading-content`,style:t,children:[s.jsx(c.Row,{gutter:8,children:s.jsx(c.Col,{span:22,children:s.jsx("div",{className:`${n}-loading-block`})})}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:8,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:15,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:6,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:18,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:13,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:9,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:4,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:3,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:16,children:s.jsx("div",{className:`${n}-loading-block`})})]})]}))},Xl=e=>({backgroundColor:e.controlItemBgActive,borderColor:e.controlOutline}),JC=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"flex",flexDirection:"column",boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},width:"100%",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,backgroundColor:e.colorBgContainer,borderRadius:e.borderRadius,transition:"all 0.3s",...qa==null?void 0:qa(e),"&-box-shadow":{boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017",borderColor:"transparent"},"&-col":{width:"100%"},[` ${t}-col${t}-split-vertical`]:{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[` ${t}-col${t}-split-horizontal`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-divider`]:{flex:"none",alignSelf:"stretch",width:e.lineWidth,marginInline:e.marginXS,marginBlock:e.marginLG,backgroundColor:e.colorSplit,[`&${t}-divider-horizontal`]:{width:"auto",alignSelf:"auto",height:e.lineWidth,marginInline:e.marginLG,marginBlock:e.marginXS}},"&-border":{border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-hoverable":{cursor:"pointer",transition:"box-shadow 0.3s, border-color 0.3s","&:hover":{borderColor:"transparent",boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017"},[`&${t}-checked:hover`]:{borderColor:e.controlOutline}},"&-checked":{...Xl(e),"&::after":{visibility:"visible",position:"absolute",insetBlockStart:2,insetInlineEnd:2,opacity:1,width:0,height:0,border:`6px solid ${e.colorPrimary}`,borderBlockEnd:"6px solid transparent",borderInlineStart:"6px solid transparent",borderStartEndRadius:2,content:'""'}},"&:focus":{...Xl(e)},"&&-ghost":{backgroundColor:"transparent",[`> ${t}`]:{"&-header":{paddingInlineEnd:0,paddingBlockEnd:e.padding,paddingInlineStart:0},"&-body":{paddingBlock:0,paddingInline:0,backgroundColor:"transparent"}}},"&&-split > &-body":{paddingBlock:0,paddingInline:0},"&&-contain-card > &-body":{display:"flex"},[`${t}-body-direction-column`]:{flexDirection:"column"},[`${t}-body-wrap`]:{flexWrap:"wrap"},"&&-collapse":{[`> ${t}`]:{"&-header":{paddingBlockEnd:e.padding,borderBlockEnd:0},"&-body":{display:"none"}}},[`${t}-header`]:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:e.paddingLG,paddingBlock:e.padding,paddingBlockEnd:0,"&-border":{"&":{paddingBlockEnd:e.padding},borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-collapsible":{cursor:"pointer"}},[`${t}-title`]:{color:e.colorText,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeight},[`${t}-extra`]:{color:e.colorText},[`${t}-type-inner`]:{[`${t}-header`]:{backgroundColor:e.colorFillAlter}},[`${t}-collapsible-icon`]:{marginInlineEnd:e.marginXS,color:e.colorIconHover,":hover":{color:e.colorPrimaryHover},"& svg":{transition:`transform ${e.motionDurationMid}`}},[`${t}-cover`]:{overflow:"hidden",borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`,"& > *":{width:"100%",display:"block"},"& img":{verticalAlign:"middle"}},[`${t}-body`]:{display:"block",boxSizing:"border-box",height:"100%",paddingInline:e.paddingLG,paddingBlock:e.padding,"&-center":{display:"flex",alignItems:"center",justifyContent:"center"}},"&&-size-small":{[t]:{"&-header":{paddingInline:e.paddingSM,paddingBlock:e.paddingXS,paddingBlockEnd:0,"&-border":{paddingBlockEnd:e.paddingXS}},"&-title":{fontSize:e.fontSize},"&-body":{paddingInline:e.paddingSM,paddingBlock:e.paddingSM}},[` ${t}-divider`]:{marginBlock:e.marginLG,marginInline:e.marginXS,[`&${t}-divider-horizontal`]:{marginBlock:e.marginXS,marginInline:e.marginLG}},[`${t}-header${t}-header-collapsible`]:{paddingBlock:e.paddingXS}}},[`${t}-tabs`]:{[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:e.marginXS,paddingInlineStart:e.padding}},[`${e.antCls}-tabs-bottom > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingInlineStart:e.padding}},[`${e.antCls}-tabs-left`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-left > ${e.antCls}-tabs-nav`]:{marginInlineEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}},[`${e.antCls}-tabs-right`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-right > ${e.antCls}-tabs-nav`]:{[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}}}}},Sd=24,XC=(e,t)=>{const{componentCls:n}=t;return e===0?{[`${n}-col-0`]:{display:"none"}}:{[`${n}-col-${e}`]:{flexShrink:0,width:`${e/Sd*100}%`}}},QC=e=>Array(Sd+1).fill(1).map((t,n)=>XC(n,e));function ew(e){return tt("ProCard",t=>{const n={...t,componentCls:`.${e}`};return[JC(n),QC(n)]})}const{useBreakpoint:tw}=c.Grid,Cd=d.forwardRef((e,t)=>{var De;const{className:n,rootClassName:r,style:a,styles:i,title:o,subTitle:l,extra:u,wrap:m=!1,layout:g,loading:f,gutter:h=0,tooltip:p,split:S,headerBordered:y=!1,variant:w,cover:v,classNames:x,boxShadow:C=!1,children:j,size:b,actions:T,ghost:$=!1,hoverable:E=!1,direction:R,collapsed:I,collapsible:M=!1,collapsibleIconRender:Y,colStyle:U,defaultCollapsed:A=!1,onCollapse:k,checked:F,onChecked:D,tabs:O,type:B,...q}=e,z=w??"outlined",V={header:i==null?void 0:i.header,body:i==null?void 0:i.body,root:i==null?void 0:i.root,extra:i==null?void 0:i.extra,title:i==null?void 0:i.title,actions:i==null?void 0:i.actions,cover:i==null?void 0:i.cover},{getPrefixCls:Z}=d.useContext(c.ConfigProvider.ConfigContext),G=tw()||{lg:!0,md:!0,sm:!0,xl:!1,xs:!1,xxl:!1},[H,L]=dt(A,I),K=je(ve=>{k==null||k(ve)}),P=d.useCallback(ve=>{L(ke=>{const Le=typeof ve=="function"?ve(ke):ve;return queueMicrotask(()=>{K(Le)}),Le})},[K]),W=["xxl","xl","lg","md","sm","xs"],te=O==null?void 0:O.items,re=ve=>{const ke=[0,0];return(Array.isArray(ve)?ve:[ve,0]).forEach((lt,nt)=>{if(typeof lt=="object")for(let ne=0;ne<W.length;ne+=1){const Q=W[ne];if(G[Q]&&lt[Q]!==void 0){ke[nt]=lt[Q];break}}else ke[nt]=lt||0}),ke},X=(ve,ke)=>ve?ke:{},se=ve=>{let ke=ve;if(typeof ve=="object")for(let lt=0;lt<W.length;lt+=1){const nt=W[lt];if(G!=null&&G[nt]&&(ve==null?void 0:ve[nt])!==void 0){ke=ve[nt];break}}const Le=X(typeof ke=="string"&&/\d%|\dpx/i.test(ke),{width:ke,flexShrink:0});return{span:ke,colSpanStyle:Le}},ae=Z("pro-card"),{wrapSSR:ue,hashId:pe}=ew(ae),[me,fe]=re(h);let ye=!1;const Te=d.Children.toArray(j),Oe=Te.map((ve,ke)=>{var Le;if((Le=ve==null?void 0:ve.type)!=null&&Le.isProCard){ye=!0;const{colSpan:lt}=ve.props,{span:nt,colSpanStyle:ne}=se(lt),Q=ie([`${ae}-col`],pe,{[`${ae}-split-vertical`]:S==="vertical"&&ke!==Te.length-1,[`${ae}-split-horizontal`]:S==="horizontal"&&ke!==Te.length-1,[`${ae}-col-${nt}`]:typeof nt=="number"&&nt>=0&&nt<=24}),he=ue(s.jsx("div",{style:{...ne,...X(me>0,{paddingInlineEnd:me/2,paddingInlineStart:me/2}),...X(fe>0,{paddingBlockStart:fe/2,paddingBlockEnd:fe/2}),...U},className:Q,children:d.cloneElement(ve)}));return d.cloneElement(he,{key:`pro-card-col-${(ve==null?void 0:ve.key)||ke}`})}return ve}),Ae=ie(`${ae}`,n,r,pe,x==null?void 0:x.root,{[`${ae}-border`]:z==="outlined",[`${ae}-box-shadow`]:C,[`${ae}-contain-card`]:ye,[`${ae}-loading`]:f,[`${ae}-split`]:S==="vertical"||S==="horizontal",[`${ae}-ghost`]:$,[`${ae}-hoverable`]:E,[`${ae}-size-${b}`]:b,[`${ae}-type-${B}`]:B,[`${ae}-collapse`]:H,[`${ae}-checked`]:F}),ze=ie(`${ae}-body`,pe,x==null?void 0:x.body,{[`${ae}-body-center`]:g==="center",[`${ae}-body-direction-column`]:S==="horizontal"||R==="column",[`${ae}-body-wrap`]:m&&ye}),ce=(De=V.body)==null?void 0:De.padding,_=d.isValidElement(f)?f:s.jsx(ZC,{prefix:ae,style:ce===0||ce==="0px"?{padding:24}:void 0}),J=d.useCallback(()=>{M==="icon"&&P(ve=>!ve)},[M,P]),le=M&&(Y?s.jsx("span",{role:"button",tabIndex:M==="icon"?0:void 0,className:ie(`${ae}-collapsible-icon`,pe),onClick:M==="icon"?J:void 0,onKeyDown:M==="icon"?ve=>{(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),J())}:void 0,children:Y({collapsed:H})}):s.jsx(de.RightOutlined,{onClick:J,rotate:H?void 0:90,className:ie(`${ae}-collapsible-icon`,pe)})),Se=ie(`${ae}-header`,pe,x==null?void 0:x.header,{[`${ae}-header-border`]:y||B==="inner",[`${ae}-header-collapsible`]:le}),Ee=ie(`${ae}-title`,pe,x==null?void 0:x.title),Fe=ie(`${ae}-extra`,pe,x==null?void 0:x.extra),Ie={...V.root,...a};return ue(s.jsxs("div",{className:Ae,style:Ie,ref:t,onClick:ve=>{var ke;D==null||D(ve),(ke=q==null?void 0:q.onClick)==null||ke.call(q,ve)},...Ze(q,["prefixCls","colSpan"]),children:[(o||u||le)&&s.jsxs("div",{className:Se,style:V.header,onClick:()=>{(M==="header"||M===!0)&&P(!H)},children:[s.jsxs("div",{className:Ee,style:V.title,children:[le,s.jsx(fr,{label:o,tooltip:p,subTitle:l})]}),u&&s.jsx("div",{className:Fe,style:V.extra,onClick:ve=>ve.stopPropagation(),children:u})]}),v&&!H&&s.jsx("div",{className:ie(`${ae}-cover`,pe,x==null?void 0:x.cover),style:V.cover,children:v}),O?s.jsx("div",{className:ie(`${ae}-tabs`,pe),children:s.jsx(c.Tabs,{onChange:O.onChange,...Ze(O,["cardProps"]),items:te,children:f?_:j})}):s.jsx("div",{className:ze,style:V.body,children:f?_:Oe}),T?s.jsx(lp,{actions:T,prefixCls:ae}):null]}))});function nw(e){return tt("ProCardDivider",()=>({}))}const rw=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),r=`${t("pro-card")}-divider`,{wrapSSR:a,hashId:i}=nw(),{className:o,style:l={},orientation:u="vertical"}=e,m=ie(r,o,i,{[`${r}-${u}`]:u});return a(s.jsx("div",{className:m,style:l}))},sw=e=>{const{styles:t,...n}=e;return s.jsx(Cd,{...n,styles:{...t,body:{...t==null?void 0:t.body,padding:0}}})},Ca=Cd;Ca.isProCard=!0;Ca.Divider=rw;Ca.Group=sw;var Hs={exports:{}},aw=Hs.exports,Ql;function iw(){return Ql||(Ql=1,(function(e,t){(function(n,r){e.exports=r()})(aw,(function(){return function(n,r){var a=r.prototype,i=a.format;a.format=function(o){var l=this,u=this.$locale();if(!this.isValid())return i.bind(this)(o);var m=this.$utils(),g=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return u.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return u.ordinal(l.week(),"W");case"w":case"ww":return m.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return m.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return m.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return i.bind(this)(g)}}}))})(Hs)),Hs.exports}var ow=iw();const wd=Jt(ow);var Ys={exports:{}},lw=Ys.exports,ec;function cw(){return ec||(ec=1,(function(e,t){(function(n,r){e.exports=r()})(lw,(function(){var n="day";return function(r,a,i){var o=function(m){return m.add(4-m.isoWeekday(),n)},l=a.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),n);var g,f,h,p,S=o(this),y=(g=this.isoWeekYear(),f=this.$u,h=(f?i.utc:i)().year(g).startOf("year"),p=4-h.isoWeekday(),h.isoWeekday()>4&&(p+=7),h.add(p,n));return S.diff(y,"week")+1},l.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var u=l.startOf;l.startOf=function(m,g){var f=this.$utils(),h=!!f.u(g)||g;return f.p(m)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(m,g)}}}))})(Ys)),Ys.exports}var uw=cw();const jd=Jt(uw);var Us={exports:{}},dw=Us.exports,tc;function fw(){return tc||(tc=1,(function(e,t){(function(n,r){e.exports=r()})(dw,(function(){return function(n,r,a){var i=r.prototype,o=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,h,p,S,y){var w=f.name?f:f.$locale(),v=o(w[h]),x=o(w[p]),C=v||x.map((function(b){return b.slice(0,S)}));if(!y)return C;var j=w.weekStart;return C.map((function(b,T){return C[(T+(j||0))%7]}))},u=function(){return a.Ls[a.locale()]},m=function(f,h){return f.formats[h]||(function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,y,w){return y||w.slice(1)}))})(f.formats[h.toUpperCase()])},g=function(){var f=this;return{months:function(h){return h?h.format("MMMM"):l(f,"months")},monthsShort:function(h){return h?h.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):l(f,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return m(f.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return g.bind(this)()},a.localeData=function(){var f=u();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(h){return m(f,h)},meridiem:f.meridiem,ordinal:f.ordinal}},a.months=function(){return l(u(),"months")},a.monthsShort=function(){return l(u(),"monthsShort","months",3)},a.weekdays=function(f){return l(u(),"weekdays",null,null,f)},a.weekdaysShort=function(f){return l(u(),"weekdaysShort","weekdays",3,f)},a.weekdaysMin=function(f){return l(u(),"weekdaysMin","weekdays",2,f)}}}))})(Us)),Us.exports}var mw=fw();const vd=Jt(mw);var Ks={exports:{}},hw=Ks.exports,nc;function gw(){return nc||(nc=1,(function(e,t){(function(n,r){e.exports=r()})(hw,(function(){return function(n,r){r.prototype.weekday=function(a){var i=this.$locale().weekStart||0,o=this.$W,l=(o<i?o+7:o)-i;return this.$utils().u(a)?l:this.subtract(l,"day").add(a,"day")}}}))})(Ks)),Ks.exports}var pw=gw();const Td=Jt(pw);var Ws={exports:{}},yw=Ws.exports,rc;function xw(){return rc||(rc=1,(function(e,t){(function(n,r){e.exports=r()})(yw,(function(){var n="week",r="year";return function(a,i,o){var l=i.prototype;l.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var g=o(this).startOf(r).add(1,r).date(m),f=o(this).endOf(n);if(g.isBefore(f))return 1}var h=o(this).startOf(r).date(m).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},l.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}}))})(Ws)),Ws.exports}var bw=xw();const vo=Jt(bw),sc=(e,t)=>typeof t!="object"?e[t]||t:e[t==null?void 0:t.value]||t.label,Sw=(e,t)=>{const{label:n,prefixCls:r,onChange:a,value:i,mode:o,defaultValue:l,labelVariant:u,size:m,showSearch:g,disabled:f,style:h,className:p,options:S,onSearch:y,allowClear:w,labelInValue:v,fieldNames:x,lightLabel:C,labelTrigger:j,optionFilterProp:b,optionLabelProp:T="",valueMaxLength:$=41,fetchDataOnSearch:E=!1,fetchData:R,variant:I="outlined",...M}=e,{placeholder:Y=n}=e,{label:U="label",value:A="value"}=x||{},{getPrefixCls:k}=d.useContext(c.ConfigProvider.ConfigContext),F=k("pro-field-select-light-select"),[D,O]=d.useState(!1),[B,q]=d.useState(""),{wrapSSR:z,hashId:V}=tt("LightSelect",L=>({[`.${F}`]:{[`${L.antCls}-select`]:{position:"absolute",width:"153px",height:"28px",visibility:"hidden",opacity:0,"&-selector":{height:28}},[`&.${F}-searchable`]:{[`${L.antCls}-select`]:{width:"200px","&-selector":{height:28}}}}})),Z=d.useMemo(()=>{const L={};return S==null||S.forEach(K=>{const P=K[T]||K[U],W=K[A];L[W]=P||W}),L},[U,S,A,T]),G=d.useMemo(()=>Reflect.has(M,"open")?M==null?void 0:M.open:D,[D,M]),H=Array.isArray(i)?i.map(L=>sc(Z,L)):sc(Z,i);return z(s.jsxs("div",{className:ie(F,V,{[`${F}-searchable`]:g},`${F}-container-${M.placement||"bottomLeft"}`,p),style:h,onClick:L=>{var P,W,te;if(f)return;((te=(W=(P=C==null?void 0:C.current)==null?void 0:P.labelRef)==null?void 0:W.current)==null?void 0:te.contains(L.target))||O(!0)},children:[s.jsx(c.Select,{...M,allowClear:w,value:i,mode:o,labelInValue:v,size:m,disabled:f,variant:I,onChange:(L,K)=>{a==null||a(L,K),o!=="multiple"&&O(!1)},showSearch:g,onSearch:g?L=>{E&&R&&R(L),y==null||y(L)}:void 0,style:h,popupRender:L=>s.jsxs("div",{ref:t,children:[g&&s.jsx("div",{style:{margin:"4px 8px"},children:s.jsx(c.Input,{value:B,allowClear:!!w,onChange:K=>{q(K.target.value),E&&R&&R(K.target.value),y==null||y(K.target.value)},onKeyDown:K=>{if(K.key==="Backspace"){K.stopPropagation();return}(K.key==="ArrowUp"||K.key==="ArrowDown")&&K.preventDefault()},style:{width:"100%"},prefix:s.jsx(de.SearchOutlined,{})})}),L]}),open:G,onOpenChange:L=>{var K;L||q(""),j||O(L),(K=M==null?void 0:M.onOpenChange)==null||K.call(M,L)},prefixCls:r,options:y||!B?S:S==null?void 0:S.filter(L=>{var K,P,W,te,re;return b?Tn(L[b]).join("").toLowerCase().includes(B):((P=(K=String(L[U]))==null?void 0:K.toLowerCase())==null?void 0:P.includes(B==null?void 0:B.toLowerCase()))||((re=(te=(W=L[A])==null?void 0:W.toString())==null?void 0:te.toLowerCase())==null?void 0:re.includes(B==null?void 0:B.toLowerCase()))})}),s.jsx(Qt,{ellipsis:!0,label:n,placeholder:Y,disabled:f,variant:u,allowClear:!!w,value:H||(i==null?void 0:i.label)||i,onClear:()=>{a==null||a(void 0,void 0)},onClick:()=>{f||O(!D)},ref:C,valueMaxLength:$})]}))},Cw=d.forwardRef(Sw),ww=(e,t)=>{const{optionItemRender:n,mode:r,onSearch:a,onFocus:i,onChange:o,autoClearSearchValue:l=!0,searchOnFocus:u=!1,resetAfterSelect:m=!1,fetchDataOnSearch:g=!0,optionFilterProp:f="label",optionLabelProp:h="label",className:p,disabled:S,options:y,fetchData:w,resetData:v,prefixCls:x,onClear:C,searchValue:j,showSearch:b,fieldNames:T,defaultSearchValue:$,preserveOriginalLabel:E=!1,...R}=e,{label:I="label",value:M="value",options:Y="options"}=T||{},[U,A]=dt($,j),k=d.useRef();d.useImperativeHandle(t,()=>k.current),d.useEffect(()=>{var V;R.autoFocus&&((V=k==null?void 0:k.current)==null||V.focus())},[R.autoFocus]);const{getPrefixCls:F}=d.useContext(c.ConfigProvider.ConfigContext),D=F("pro-filed-search-select",x),O=ie(D,p,{[`${D}-disabled`]:S}),B=(V,Z)=>{if(V&&typeof V.label=="string"&&V.label)return V.label;if(V&&V.text&&typeof V.text=="string")return V.text;if(V&&V.label)return String(V.label);if(V&&V.text)return String(V.text);if(Z&&Z.label){const G=Z.label;return(d.isValidElement(G)||G&&typeof G=="object"&&"props"in G)&&G.props&&G.props.label?String(G.props.label):typeof G=="string"?G:String(G)}return""},q=(V,Z)=>Array.isArray(V)&&Array.isArray(Z)&&V.length>0?V.map((G,H)=>{const L=Z==null?void 0:Z[H],K=L==null?void 0:L["data-item"],P=B(K,G);return{...K||{},...G,label:P||G.label}}):[],z=V=>V.map((Z,G)=>{const{className:H,optionType:L,...K}=Z,P=Z[I]??Z.text,W=Z[M],te=Z[Y]??[];return L==="optGroup"||Z.options?{label:P,...K,data_title:P,title:P,key:W??`${P==null?void 0:P.toString()}-${G}-${Gr()}`,children:z(te)}:{title:P,...K,data_title:P,value:W??G,key:W??`${P==null?void 0:P.toString()}-${G}-${Gr()}`,"data-item":Z,className:`${D}-option ${H||""}`.trim(),label:(n==null?void 0:n(Z))||P}});return s.jsx(c.Select,{ref:k,className:O,allowClear:!0,autoClearSearchValue:l,disabled:S,mode:r,showSearch:b,searchValue:U,optionFilterProp:f,optionLabelProp:h,onClear:()=>{C==null||C(),w(void 0),b&&(a==null||a(""),A(""))},...R,filterOption:R.filterOption==!1?!1:(V,Z)=>{var H,L;const G=U===""?"":V||U;return G?R.filterOption&&typeof R.filterOption=="function"?R.filterOption(G,{...Z,label:Z==null?void 0:Z.data_title}):!!((H=Z==null?void 0:Z.data_title)!=null&&H.toString().toLowerCase().includes(G.toLowerCase())||(L=Z==null?void 0:Z[f])!=null&&L.toString().toLowerCase().includes(G.toLowerCase())):!0},onSearch:b?V=>{g&&w(V),a==null||a(V),A(V)}:void 0,onChange:(V,Z,...G)=>{if(b&&l&&(w(void 0),a==null||a(""),A("")),!e.labelInValue){o==null||o(V,Z,...G);return}if(r!=="multiple"&&!Array.isArray(Z)){let K=Z&&Z["data-item"];if(!K&&V&&y){const P=V[M]??V.value,W=te=>{for(const re of te){if((re[M]??re.value)===P)return re;if(re[Y]||re.options){const se=W(re[Y]||re.options||[]);if(se)return se}}return null};K=W(y)}if(!V||!K){const P=B(K,V),W=V&&{...V,label:P};o==null||o(W,Z,...G)}else{const P=B(K,V);o==null||o({...V,...K,label:P},Z,...G)}return}const H=q(V,Z);o==null||o(H,Z,...G),m&&v()},onFocus:V=>{u&&(w(void 0),b&&(a==null||a(""),A(""))),i==null||i(V)},options:z(y||[])})},jw=d.forwardRef(ww),vw=({label:e,words:t})=>{const{getPrefixCls:n}=d.useContext(c.ConfigProvider.ConfigContext),r=n("pro-select-item-option-content-light"),a=n("pro-select-item-option-content"),{wrapSSR:i}=tt("Highlight",m=>({[`.${r}`]:{color:m.colorPrimary},[`.${a}`]:{flex:"auto",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})),o=new RegExp(t.map(m=>m.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")).join("|"),"gi");let l=e;const u=[];for(;l.length;){const m=o.exec(l);if(!m){u.push(l);break}const g=m.index,f=m[0].length+g;u.push(l.slice(0,g),d.createElement("span",{className:r},l.slice(g,f))),l=l.slice(f)}return i(d.createElement("div",{title:e,className:a},...u))};function Bi(e,t){var n,r;return!!(!t||(n=e==null?void 0:e.label)!=null&&n.toString().toLowerCase().includes(t.toLowerCase())||(r=e==null?void 0:e.value)!=null&&r.toString().toLowerCase().includes(t.toLowerCase())||(e.children||e.options)&&[...e.children||[],e.options||[]].find(i=>Bi(i,t)))}const Fd=e=>{const t=[],n=un(e);return n.forEach((r,a)=>{const i=n.get(a)||n.get(`${a}`);if(i){if(typeof i=="object"&&(i!=null&&i.text)){t.push({text:i==null?void 0:i.text,value:a,label:i==null?void 0:i.text,disabled:i.disabled});return}t.push({text:i,value:a})}}),t},Sr=e=>{var w,v;const{cacheForSwr:t,fieldProps:n}=e,[r,a]=d.useState(e.defaultKeyWords),[i]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():e.request?Gr():"no-fetch"),o=d.useRef(i),l=je(x=>Fd(un(x)).map(({value:C,text:j,...b})=>({label:j,value:C,key:C,...b}))),u=St(()=>{if(!n)return;const x=(n==null?void 0:n.options)||(n==null?void 0:n.treeData);if(!x)return;const{children:C,label:j,value:b}=n.fieldNames||{},T=($,E)=>{if(!($!=null&&$.length))return;const R=$.length;let I=0;for(;I<R;){const M=$[I++];(M[C]||M[j]||M[b])&&(M[E]=M[E==="children"?C:E==="label"?j:b],T(M[C],E))}};return C&&T(x,"children"),j&&T(x,"label"),b&&T(x,"value"),x},[n]),[m,g]=dt(()=>e.valueEnum?l(e.valueEnum):[],u);ir(()=>{var x,C;!e.valueEnum||(x=e.fieldProps)!=null&&x.options||(C=e.fieldProps)!=null&&C.treeData||g(l(e.valueEnum))},[e.valueEnum]);const f=Pp([o.current,e.params,r],e.debounceTime??((w=e==null?void 0:e.fieldProps)==null?void 0:w.debounceTime)??0,[e.params,r]),{data:h,mutate:p,isValidating:S}=zu(()=>e.request?f:null,([,x,C])=>e.request({...x,keyWords:C},e),{revalidateIfStale:!t,revalidateOnReconnect:t,shouldRetryOnError:!1,revalidateOnFocus:!1}),y=d.useMemo(()=>{var C,j;const x=m==null?void 0:m.map(b=>{if(typeof b=="string")return{label:b,value:b};if(b.children||b.options){const T=[...b.children||[],...b.options||[]].filter($=>Bi($,r));return{...b,children:T,options:T}}return b});return((C=e.fieldProps)==null?void 0:C.filterOption)===!0||((j=e.fieldProps)==null?void 0:j.filterOption)===void 0?x==null?void 0:x.filter(b=>b?r?Bi(b,r):!0:!1):x},[m,r,(v=e.fieldProps)==null?void 0:v.filterOption]);return[S,e.request?h:y,x=>{a(x)},()=>{a(void 0),p([],!1)}]},Tw=(e,t)=>{var M,Y;const{mode:n,valueEnum:r,render:a,formItemRender:i,request:o,fieldProps:l,light:u,proFieldKey:m,params:g,label:f,variant:h,id:p,lightLabel:S,labelTrigger:y,...w}=e,v=d.useRef(),x=Ne(),C=d.useRef(""),{fieldNames:j}=l;d.useEffect(()=>{C.current=l==null?void 0:l.searchValue},[l==null?void 0:l.searchValue]);const[b,T,$,E]=Sr(e),{componentSize:R}=((Y=(M=c.ConfigProvider)==null?void 0:M.useConfig)==null?void 0:Y.call(M))||{componentSize:"middle"};d.useImperativeHandle(t,()=>({...v.current||{},fetchData:U=>$(U)}),[$]);const I=d.useMemo(()=>{if(n!=="read")return;const{label:U="label",value:A="value",options:k="options"}=j||{},F=new Map,D=O=>{if(!(O!=null&&O.length))return F;const B=O.length;let q=0;for(;q<B;){const z=O[q++];F.set(z[A],z[U]),D(z[k])}return F};return D(T)},[j,n,T]);if(n==="read"){const U=s.jsx(s.Fragment,{children:Yn(w.text,un(r||I))});return a?a(U,{mode:n,...l},U)??null:U}if(n==="edit"||n==="update"){const A=u?s.jsx(Cw,{id:p,loading:b,ref:v,allowClear:!0,size:R,options:T,label:f,labelVariant:h,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),lightLabel:S,labelTrigger:y,fetchData:$,...l}):s.jsx(jw,{className:w.className,style:{minWidth:100,...w.style},id:p,loading:b,ref:v,allowClear:!0,defaultSearchValue:e.defaultKeyWords,notFoundContent:b?s.jsx(c.Spin,{size:"small"}):l==null?void 0:l.notFoundContent,fetchData:k=>{C.current=k??"",$(k),k===void 0&&(C.current="")},resetData:E,optionItemRender:k=>typeof k.label=="string"&&C.current?s.jsx(vw,{label:k.label,words:[C.current]}):k.label,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),label:f,...l,options:T},"SearchSelect");return i?i(w.text,{mode:n,...l,options:T,loading:b},A)??null:A}return null},vs=d.forwardRef(Tw),Fw=({placeholder:e,formItemRender:t,mode:n,render:r,label:a,light:i,variant:o,...l},u)=>{var C;const{getPrefixCls:m}=d.useContext(c.ConfigProvider.ConfigContext),g=m("pro-field-cascader"),[f,h,p]=Sr(l),S=Ne(),y=d.useRef(),[w,v]=d.useState(!1);d.useImperativeHandle(u,()=>({...y.current||{},fetchData:j=>p(j)}),[p]);const x=d.useMemo(()=>{var R;if(n!=="read")return;const{value:j="value",label:b="label",children:T="children"}=((R=l.fieldProps)==null?void 0:R.fieldNames)||{},$=new Map,E=I=>{if(!(I!=null&&I.length))return $;const M=I.length;let Y=0;for(;Y<M;){const U=I[Y++];$.set(U[j],U[b]),E(U[T])}return $};return E(h)},[n,h,(C=l.fieldProps)==null?void 0:C.fieldNames]);if(n==="read"){const j=s.jsx(s.Fragment,{children:Yn(l.text,un(l.valueEnum||x))});return r?r(l.text,{mode:n,...l.fieldProps},j)??null:j}if(n==="edit"){const j=l.fieldProps||{};let b=s.jsx(c.Cascader,{ref:y,open:w,suffixIcon:f?s.jsx(de.LoadingOutlined,{}):void 0,placeholder:e||S.getMessage("tableForm.selectPlaceholder","请选择"),allowClear:(j==null?void 0:j.allowClear)!==!1,...j,onOpenChange:T=>{var $;($=j==null?void 0:j.onOpenChange)==null||$.call(j,T),v(T)},className:ie(j==null?void 0:j.className,g),options:h});if(t&&(b=t(l.text,{mode:n,...j,options:h,loading:f},b)??null),i){const{disabled:T,value:$}=j,E=!!$&&($==null?void 0:$.length)!==0;return s.jsx(Qt,{label:a,disabled:T,variant:o,value:E||w?b:null,style:E?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:E||w?!1:void 0,onClick:()=>{var R;v(!0),(R=j==null?void 0:j.onOpenChange)==null||R.call(j,!0)}})}return b}return null},ac=d.forwardRef(Fw),$w=({layout:e="horizontal",formItemRender:t,mode:n,render:r,...a},i)=>{var w,v,x,C,j;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-checkbox"),u=(v=(w=c.Form.Item)==null?void 0:w.useStatus)==null?void 0:v.call(w),[m,g,f]=Sr(a),{wrapSSR:h,hashId:p}=tt("Checkbox",b=>({[`.${l}`]:{"&-error":{span:{color:b.colorError}},"&-warning":{span:{color:b.colorWarning}},"&-vertical":{[`&${b.antCls}-checkbox-group`]:{display:"inline-block"},[`${b.antCls}-checkbox-wrapper+${b.antCls}-checkbox-wrapper`]:{"margin-inline-start":"0 !important"},[`${b.antCls}-checkbox-group-item`]:{display:"flex",marginInlineEnd:0}}}})),{token:S}=(C=(x=c.theme).useToken)==null?void 0:C.call(x),y=d.useRef();if(d.useImperativeHandle(i,()=>({...y.current||{},fetchData:b=>f(b)}),[f]),m)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const b=g!=null&&g.length?g==null?void 0:g.reduce(($,E)=>({...$,[E.value??""]:E.label}),{}):void 0,T=Yn(a.text,un(a.valueEnum||b));return r?r(a.text,{mode:n,...a.fieldProps},s.jsx(s.Fragment,{children:T}))??null:s.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:S.marginSM},children:T})}if(n==="edit"){const{fieldNames:b,variant:T,...$}=a.fieldProps||{},E=h(s.jsx(c.Checkbox.Group,{...$,variant:T,className:ie((j=a.fieldProps)==null?void 0:j.className,p,`${l}-${e}`,{[`${l}-error`]:(u==null?void 0:u.status)==="error",[`${l}-warning`]:(u==null?void 0:u.status)==="warning"}),options:g}));return t?t(a.text,{mode:n,...a.fieldProps,options:g,loading:m},E)??null:E}return null},ic=d.forwardRef($w),Ew=(e,t)=>{if(typeof e!="string")return e;try{if(t==="json")return JSON.stringify(JSON.parse(e),null,2)}catch{}return e},Rw=({text:e,mode:t,render:n,language:r="text",formItemRender:a,fieldProps:i},o)=>{const l=Ew(e,r),{token:u}=jn.useToken();if(t==="read"){const m=s.jsx("pre",{ref:o,...i,style:{padding:16,overflow:"auto",fontSize:"85%",lineHeight:1.45,color:u.colorTextSecondary,fontFamily:u.fontFamilyCode,backgroundColor:"rgba(150, 150, 150, 0.1)",borderRadius:3,width:"min-content",...i.style},children:s.jsx("code",{children:l})});return n?n(l,{mode:t,...i,ref:o},m):m}if(t==="edit"||t==="update"){i.value=l;const m=s.jsx(c.Input.TextArea,{rows:5,...i,ref:o});return a?a(l,{mode:t,...i,ref:o},m)??null:m}return null},Ts=d.forwardRef(Rw),Iw={label:"Recommended",colors:["#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB","#722ED1","#EB2F96","#F5222D4D","#FA8C164D","#FADB144D","#8BBB114D","#52C41A4D","#13A8A84D","#1677FF4D","#2F54EB4D","#722ED14D","#EB2F964D"]},Mw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-color-picker");if(t==="read"){const u=s.jsx(c.ColorPicker,{value:e,className:ie({[l]:!0}),open:!1});return n?n(e,{mode:t,...a},u):u}if(t==="edit"||t==="update"){const u={display:"table-cell",...a.style},m=s.jsx(c.ColorPicker,{ref:i,presets:[Iw],...a,style:u,className:ie({[l]:!0})});return r?r(e,{mode:t,...a,style:u},m):m}return null},oc=d.forwardRef(Mw);Re.extend(vo);const Aw=(e,t)=>e?typeof t=="function"?t(Re(e)):Re(e).format((Array.isArray(t)?t[0]:t)||"YYYY-MM-DD"):"-",kw=({text:e,mode:t,format:n="YYYY-MM-DD",label:r,light:a,render:i,formItemRender:o,showTime:l,fieldProps:u,picker:m,lightLabel:g,variant:f},h)=>{const p=Ne(),[S,y]=d.useState(!1);if(t==="read"){const w=Aw(e,u.format||n);return i?i(e,{mode:t,...u},s.jsx(s.Fragment,{children:w})):s.jsx(s.Fragment,{children:w})}if(t==="edit"||t==="update"){let w;const{disabled:v,value:x,placeholder:C=p.getMessage("tableForm.selectPlaceholder","请选择")}=u,j=xr(x);return a?w=s.jsx(Qt,{label:r,onClick:()=>{var b;(b=u==null?void 0:u.onOpenChange)==null||b.call(u,!0),y(!0)},style:j?{paddingInlineEnd:0}:void 0,disabled:v,value:j||S?s.jsx(c.DatePicker,{picker:m,showTime:l,format:n,ref:h,...u,value:j,onOpenChange:b=>{var T;y(b),(T=u==null?void 0:u.onOpenChange)==null||T.call(u,b)},open:S}):void 0,allowClear:!1,downIcon:j||S?!1:void 0,variant:f,ref:g}):w=s.jsx(c.DatePicker,{picker:m,showTime:l,format:n,placeholder:C,variant:f,ref:h,...u,value:j}),o?o(e,{mode:t,...u},w):w}return null},At=d.forwardRef(kw);function Ow(e){return Lt(e)||e===""||(e==null?void 0:e.trim())===""}const Dw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i},o)=>{var g;const l=Ne(),u=r||l.getMessage("tableForm.inputPlaceholder","请输入"),m=d.useCallback(f=>{let h=f??void 0;if(!i.stringMode&&typeof h=="string"){const p=Number(h);if(isNaN(p)){const S=h.match(/^(\d+(?:\.\d+)?)/);S?h=Number(S[1]):h=void 0}else h=p}return typeof h=="number"&&!Lt(h)&&!Lt(i.precision)&&(h=Number(h.toFixed(i.precision))),h},[i]);if(t==="read"){let f={};i!=null&&i.precision&&(f={minimumFractionDigits:Number(i.precision),maximumFractionDigits:Number(i.precision)});const h=new Intl.NumberFormat(void 0,{...f,...(i==null?void 0:i.intlProps)||{}}).format(Number(e)),p=i!=null&&i.stringMode?s.jsx("span",{children:e}):s.jsx("span",{ref:o,children:((g=i==null?void 0:i.formatter)==null?void 0:g.call(i,h))||h});return n?n(e,{mode:t,...i},p):p}if(t==="edit"||t==="update"){const f=s.jsx(c.InputNumber,{ref:o,min:0,placeholder:u,...Ze(i,["onChange","onBlur"]),onChange:h=>{var p;return(p=i==null?void 0:i.onChange)==null?void 0:p.call(i,m(h))},onBlur:h=>{var y,w,v;const p=h.target.value;if(Ow(p)){(y=i==null?void 0:i.onBlur)==null||y.call(i,h);return}const S=m(p);h.target&&typeof S=="number"&&(h.target.value=S.toString(),(w=i==null?void 0:i.onChange)==null||w.call(i,S)),(v=i==null?void 0:i.onBlur)==null||v.call(i,h)}});return a?a(e,{mode:t,...i},f):f}return null},ia=d.forwardRef(Dw),Pw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i,separator:o="~",separatorWidth:l=30},u)=>{const{value:m,defaultValue:g,onChange:f,id:h}=i,p=Ne(),{token:S}=jn.useToken(),[y,w]=dt(()=>g,m),v=d.useCallback(C=>{w(j=>{const b=typeof C=="function"?C(j):C;return f==null||f(b),b})},[f]),x=d.useRef(y);if(t==="read"){const C=b=>{var $;const T=new Intl.NumberFormat(void 0,{minimumSignificantDigits:2,...(i==null?void 0:i.intlProps)||{}}).format(Number(b));return(($=i==null?void 0:i.formatter)==null?void 0:$.call(i,T))||T},j=s.jsxs("span",{ref:u,children:[C(e[0])," ",o," ",C(e[1])]});return n?n(e,{mode:t,...i},j):j}if(t==="edit"||t==="update"){const C=()=>{if(Array.isArray(x.current)){const[E,R]=x.current;if(typeof E=="number"&&typeof R=="number"&&E>R){v([R,E]);return}E===void 0&&R===void 0&&v(void 0)}},j=(E,R)=>{const I=[...y||[]];I[E]=R===null?void 0:R,x.current=I,v(I)},b=(i==null?void 0:i.placeholder)||r||[p.getMessage("tableForm.inputPlaceholder","请输入"),p.getMessage("tableForm.inputPlaceholder","请输入")],T=E=>Array.isArray(b)?b[E]:b,$=s.jsxs(c.Space.Compact,{block:!0,onBlur:C,children:[s.jsx(c.InputNumber,{...i,placeholder:T(0),id:h??`${h}-0`,style:{width:`calc((100% - ${l}px) / 2)`},value:y==null?void 0:y[0],defaultValue:g==null?void 0:g[0],onChange:E=>j(0,E)}),s.jsx(c.Input,{style:{width:l,textAlign:"center",borderInlineStart:0,borderInlineEnd:0,pointerEvents:"none",backgroundColor:S==null?void 0:S.colorBgContainer},placeholder:o,disabled:!0}),s.jsx(c.InputNumber,{...i,placeholder:T(1),id:h??`${h}-1`,style:{width:`calc((100% - ${l}px) / 2)`,borderInlineStart:0},value:y==null?void 0:y[1],defaultValue:g==null?void 0:g[1],onChange:E=>j(1,E)})]});return a?a(e,{mode:t,...i},$):$}return null},lc=d.forwardRef(Pw);var qs={exports:{}},Nw=qs.exports,cc;function Lw(){return cc||(cc=1,(function(e,t){(function(n,r){e.exports=r()})(Nw,(function(){return function(n,r,a){n=n||{};var i=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(m,g,f,h){return i.fromToBase(m,g,f,h)}a.en.relativeTime=o,i.fromToBase=function(m,g,f,h,p){for(var S,y,w,v=f.$locale().relativeTime||o,x=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],C=x.length,j=0;j<C;j+=1){var b=x[j];b.d&&(S=h?a(m).diff(f,b.d,!0):f.diff(m,b.d,!0));var T=(n.rounding||Math.round)(Math.abs(S));if(w=S>0,T<=b.r||!b.r){T<=1&&j>0&&(b=x[j-1]);var $=v[b.l];p&&(T=p(""+T)),y=typeof $=="string"?$.replace("%d",T):$(T,g,b.l,w);break}}if(g)return y;var E=w?v.future:v.past;return typeof E=="function"?E(y):E.replace("%s",y)},i.to=function(m,g){return l(m,g,this,!0)},i.from=function(m,g){return l(m,g,this)};var u=function(m){return m.$u?a.utc():a()};i.toNow=function(m){return this.to(u(this),m)},i.fromNow=function(m){return this.from(u(this),m)}}}))})(qs)),qs.exports}var _w=Lw();const zw=Jt(_w);Re.extend(zw);const Bw=({text:e,mode:t,variant:n,render:r,formItemRender:a,format:i,fieldProps:o},l)=>{const u=Ne();if(t==="read"){const m=s.jsx(c.Tooltip,{title:Re(e).format((o==null?void 0:o.format)||i||"YYYY-MM-DD HH:mm:ss"),children:Re(e).fromNow()});return r?r(e,{mode:t,...o},s.jsx(s.Fragment,{children:m})):s.jsx(s.Fragment,{children:m})}if(t==="edit"||t==="update"){const m=u.getMessage("tableForm.selectPlaceholder","请选择"),g=xr(o.value),f=s.jsx(c.DatePicker,{ref:l,placeholder:m,showTime:!0,variant:n??(o==null?void 0:o.variant)??"outlined",...o,value:g});return a?a(e,{mode:t,...o},f):f}return null},uc=d.forwardRef(Bw),dc=d.forwardRef(({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i,width:o},l)=>{const u=Ne(),m=i||u.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const g=s.jsx(c.Image,{ref:l,width:o||32,src:e,...a});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(c.Input,{ref:l,placeholder:m,...a});return r?r(e,{mode:t,...a},g):g}return null}),Vw=({border:e=!1,children:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-index-column"),{wrapSSR:i,hashId:o}=tt("IndexColumn",()=>({[`.${a}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px","&-border":{color:"#fff",fontSize:"12px",lineHeight:"12px",backgroundColor:"#314659",borderRadius:"9px","&.top-three":{backgroundColor:"#979797"}}}}));return i(s.jsx("div",{ref:n,className:ie(a,o,{[`${a}-border`]:e,"top-three":t>3}),children:t}))},Fs=d.forwardRef(Vw),$d=new Intl.NumberFormat("zh-Hans-CN",{currency:"CNY",style:"currency"}),Hw={style:"currency",currency:"USD"},Yw={style:"currency",currency:"RUB"},Uw={style:"currency",currency:"RSD"},Kw={style:"currency",currency:"MYR"},Ww={style:"currency",currency:"BRL"},qw={default:$d,"zh-Hans-CN":{currency:"CNY",style:"currency"},"en-US":Hw,"ru-RU":Yw,"ms-MY":Kw,"sr-RS":Uw,"pt-BR":Ww},fc=(e,t,n,r,a="")=>{let i=t==null?void 0:t.toString().replaceAll(",","");if(typeof i=="string"){const l=Number(i);if(Number.isNaN(l))return i;i=l}if(!i&&i!==0)return"";let o=!1;try{o=e!==!1&&Intl.NumberFormat.supportedLocalesOf([e.replace("_","-")],{localeMatcher:"lookup"}).length>0}catch{}try{const u=new Intl.NumberFormat(o&&e!==!1&&(e==null?void 0:e.replace("_","-"))||"zh-Hans-CN",{...qw[e||"zh-Hans-CN"]||$d,maximumFractionDigits:n,...r}).format(i),g=(h=>{const p=h.match(/\d+/);if(p){const S=p[0];return h.slice(h.indexOf(S))}else return h})(u),[f]=u||"";return["+","-"].includes(f)?`${a||""}${f}${g}`:`${a||""}${g}`}catch{return i}},ei=2,Gw=d.forwardRef(({contentRender:e,numberFormatOptions:t,numberPopoverRender:n,open:r,onOpenChange:a,...i},o)=>{const[l,u]=dt(()=>i.defaultValue,i.value),[m,g]=d.useState(r??!1),f=d.useRef(!0);d.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),d.useEffect(()=>{r!==void 0&&g(r)},[r]);const h=d.useCallback(y=>{u(w=>{var x;const v=typeof y=="function"?y(w):y;return(x=i.onChange)==null||x.call(i,v),v})},[i.onChange,u]),p=d.useCallback(y=>{a==null||a(y),r===void 0&&queueMicrotask(()=>{f.current&&g(y)})},[r,a]),S=e==null?void 0:e({...i,value:l});return S?s.jsx(c.Popover,{placement:"topLeft",open:m,onOpenChange:p,trigger:["focus","click"],content:S,getPopupContainer:y=>(y==null?void 0:y.parentElement)||document.body,children:s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:h})}):s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:h})}),Zw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,proFieldKey:i,valueEnum:o,placeholder:l,locale:u,customSymbol:m=a.customSymbol,numberFormatOptions:g=a==null?void 0:a.numberFormatOptions,numberPopoverRender:f=(a==null?void 0:a.numberPopoverRender)||!1,...h},p)=>{const S=(a==null?void 0:a.precision)??ei;let y=Ne();u&&zn[u]&&(y=zn[u]);const w=l||y.getMessage("tableForm.inputPlaceholder","请输入"),v=d.useMemo(()=>{if(m)return m;if(!(h.moneySymbol===!1||a.moneySymbol===!1))return y.getMessage("moneySymbol","¥")},[m,a.moneySymbol,y,h.moneySymbol]),x=d.useCallback(C=>{const j=new RegExp(`\\B(?=(\\d{${3+Math.max(S-ei,0)}})+(?!\\d))`,"g"),[b,T]=String(C).split("."),$=b.replace(j,",");let E="";return T&&S>0&&(E=`.${T.slice(0,S===void 0?ei:S)}`),`${$}${E}`},[S]);if(t==="read"){const C=s.jsx("span",{ref:p,children:fc(u||!1,e,S,g??a.numberFormatOptions,v)});return n?n(e,{mode:t,...a},C):C}if(t==="edit"||t==="update"){const C=s.jsx(Gw,{contentRender:j=>{if(f===!1||!j.value)return null;const b=fc(v||u||!1,`${x(j.value)}`,S,{...g,notation:"compact"},v);return typeof f=="function"?f==null?void 0:f(j,b):b},ref:p,precision:S,formatter:j=>j&&v?`${v} ${x(j)}`:(j==null?void 0:j.toString())||j,parser:j=>v&&j?j.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),""):j,placeholder:w,...Ze(a,["numberFormatOptions","precision","numberPopoverRender","customSymbol","moneySymbol","visible","open"]),onBlur:a.onBlur?j=>{var T;let b=j.target.value;v&&b&&(b=b.replace(new RegExp(`\\${v}\\s?|(,*)`,"g"),"")),(T=a.onBlur)==null||T.call(a,b)}:void 0});return r?r(e,{mode:t,...a},C):C}return null},mc=d.forwardRef(Zw),hc=e=>e.map((t,n)=>{var r;return d.isValidElement(t)?d.cloneElement(t,{key:n,...t==null?void 0:t.props,style:{...(r=t==null?void 0:t.props)==null?void 0:r.style}}):s.jsx(d.Fragment,{children:t},n)}),Jw=({text:e,mode:t,render:n,fieldProps:r},a)=>{const{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-field-option"),{token:l}=jn.useToken();if(d.useImperativeHandle(a,()=>({})),n){const u=n(e,{mode:t,...r},s.jsx(s.Fragment,{}));return!u||(u==null?void 0:u.length)<1||!Array.isArray(u)?null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:hc(u)})}return!e||!Array.isArray(e)?d.isValidElement(e)?e:null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:hc(e)})},gc=d.forwardRef(Jw),Xw=(e,t)=>{const n=Ne(),{text:r,mode:a,render:i,formItemRender:o,fieldProps:l,...u}=Ze(e,["proFieldKey"]),[m,g]=dt(()=>u.open||!1,u.open),f=d.useCallback(h=>{g(p=>{var y;const S=typeof h=="function"?h(p):h;return(y=u.onOpenChange)==null||y.call(u,S),S})},[u.onOpenChange]);if(a==="read"){let h=s.jsx(s.Fragment,{children:"-"});return r&&(h=s.jsxs(c.Space,{children:[s.jsx("span",{ref:t,children:m?r:"********"}),s.jsx("a",{onClick:()=>f(!m),children:m?s.jsx(de.EyeOutlined,{}):s.jsx(de.EyeInvisibleOutlined,{})})]})),i?i(r,{mode:a,...l},h):h}if(a==="edit"||a==="update"){const h=s.jsx(c.Input.Password,{placeholder:n.getMessage("tableForm.inputPlaceholder","请输入"),ref:t,...l});return o?o(r,{mode:a,...l},h):h}return null},or=d.forwardRef(Xw);function Qw(e){return e===0?null:e>0?"+":"-"}function ej(e){return e===0?"#595959":e>0?"#ff4d4f":"#52c41a"}function tj(e,t=2){return t>=0?e==null?void 0:e.toFixed(t):e}function oa(e){return typeof e=="symbol"||e instanceof Symbol?NaN:Number(e)}const nj=({text:e,prefix:t,precision:n,suffix:r="%",mode:a,showColor:i=!1,render:o,formItemRender:l,fieldProps:u,placeholder:m,showSymbol:g},f)=>{const h=Ne(),p=m||h.getMessage("tableForm.inputPlaceholder","请输入"),S=d.useMemo(()=>typeof e=="string"&&e.includes("%")?oa(e.replace("%","")):oa(e),[e]),y=d.useMemo(()=>typeof g=="function"?g==null?void 0:g(e):g,[g,e]);if(a==="read"){const w=i?{color:ej(S)}:{},v=s.jsxs("span",{style:w,ref:f,children:[t&&s.jsx("span",{children:t}),y&&s.jsxs(d.Fragment,{children:[Qw(S)," "]}),tj(Math.abs(S),n),r&&r]});return o?o(e,{mode:a,...u,prefix:t,precision:n,showSymbol:y,suffix:r},v):v}if(a==="edit"||a==="update"){const w=s.jsx(c.InputNumber,{ref:f,formatter:v=>v&&t?`${t} ${v}`.replace(/\B(?=(\d{3})+(?!\d)$)/g,","):v,parser:v=>v?v.replace(/.*\s|,/g,""):"",placeholder:p,...u});return l?l(e,{mode:a,...u},w):w}return null},pc=d.forwardRef(nj);function rj(e){return e===100?"success":e<0?"exception":e<100?"active":"normal"}const sj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Ne(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入"),m=d.useMemo(()=>typeof e=="string"&&e.includes("%")?oa(e.replace("%","")):oa(e),[e]);if(t==="read"){const g=s.jsx(c.Progress,{ref:o,size:"small",style:{minWidth:100,maxWidth:320},percent:m,steps:a==null?void 0:a.steps,status:rj(m),...a});return n?n(m,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(c.InputNumber,{ref:o,placeholder:u,...a});return r?r(e,{mode:t,...a},g):g}return null},yc=d.forwardRef(sj),aj=({radioType:e,formItemRender:t,mode:n,render:r,...a},i)=>{var y,w,v;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-radio"),[u,m,g]=Sr(a),f=d.useRef(),h=(w=(y=c.Form.Item)==null?void 0:y.useStatus)==null?void 0:w.call(y);d.useImperativeHandle(i,()=>({...f.current||{},fetchData:x=>g(x)}),[g]);const{wrapSSR:p,hashId:S}=tt("FieldRadioRadio",x=>({[`.${l}-error`]:{span:{color:x.colorError}},[`.${l}-warning`]:{span:{color:x.colorWarning}},[`.${l}-vertical`]:{[`${x.antCls}-radio-wrapper`]:{display:"flex",marginInlineEnd:0}}}));if(u)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const x=m!=null&&m.length?m==null?void 0:m.reduce((j,b)=>({...j,[b.value??""]:b.label}),{}):void 0,C=s.jsx(s.Fragment,{children:Yn(a.text,un(a.valueEnum||x))});return r?r(a.text,{mode:n,...a.fieldProps},C)??null:C}if(n==="edit"){const x=p(s.jsx(c.Radio.Group,{ref:f,optionType:e,...a.fieldProps,className:ie((v=a.fieldProps)==null?void 0:v.className,{[`${l}-error`]:(h==null?void 0:h.status)==="error",[`${l}-warning`]:(h==null?void 0:h.status)==="warning"},S,`${l}-${a.fieldProps.layout||"horizontal"}`),options:m}));return t?t(a.text,{mode:n,...a.fieldProps,options:m,loading:u},x)??null:x}return null},$s=d.forwardRef(aj),ij=({text:e,mode:t,light:n,label:r,format:a="YYYY-MM-DD",render:i,picker:o,formItemRender:l,showTime:u,lightLabel:m,variant:g,fieldProps:f},h)=>{const p=Ne(),[S,y]=Array.isArray(e)?e:[],[w,v]=d.useState(!1),x=d.useCallback(b=>{var T;return typeof(f==null?void 0:f.format)=="function"?(T=f==null?void 0:f.format)==null?void 0:T.call(f,b):(f==null?void 0:f.format)||a||"YYYY-MM-DD"},[f,a]),C=S?Re(S).format(x(Re(S))):"",j=y?Re(y).format(x(Re(y))):"";if(t==="read"){const b=s.jsxs("div",{ref:h,style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return i?i(e,{mode:t,...f},s.jsx("span",{children:b})):b}if(t==="edit"||t==="update"){const b=xr(f.value);let T;const $=E=>{var R;(R=f==null?void 0:f.onChange)==null||R.call(f,E),E||v(!1)};return n?T=s.jsx(Qt,{label:r,onClick:()=>{var E;(E=f==null?void 0:f.onOpenChange)==null||E.call(f,!0),v(!0)},style:b?{paddingInlineEnd:0}:void 0,disabled:f.disabled,value:b||w?s.jsx(c.DatePicker.RangePicker,{picker:o,showTime:u,format:a,...f,placeholder:f.placeholder??[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],value:b,onOpenChange:E=>{var R;b&&v(E),(R=f==null?void 0:f.onOpenChange)==null||R.call(f,E)},onChange:$}):null,variant:g,allowClear:!1,ref:m,downIcon:b||w?!1:void 0}):T=s.jsx(c.DatePicker.RangePicker,{ref:h,format:a,showTime:u,placeholder:[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],...f,value:b}),l?l(e,{mode:t,...f},T):T}return null},kt=d.forwardRef(ij),oj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=s.jsx(c.Rate,{allowHalf:!0,disabled:!0,ref:i,...a,value:e});return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):o}if(t==="edit"||t==="update"){const o=s.jsx(c.Rate,{allowHalf:!0,ref:i,...a});return r?r(e,{mode:t,...a},o):o}return null},xc=d.forwardRef(oj);function lj(e){let t=e,n="",r=!1;t<0&&(t=-t,r=!0);const a=Math.floor(t/(3600*24)),i=Math.floor(t/3600%24),o=Math.floor(t/60%60);return n=`${Math.floor(t%60)}秒`,o>0&&(n=`${o}分钟${n}`),i>0&&(n=`${i}小时${n}`),a>0&&(n=`${a}天${n}`),r&&(n+="前"),n}const cj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Ne(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const m=lj(Number(e)),g=s.jsx("span",{ref:o,children:m});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const m=s.jsx(c.InputNumber,{ref:o,min:0,style:{width:"100%"},placeholder:u,...a});return r?r(e,{mode:t,...a},m):m}return null},bc=d.forwardRef(cj),uj=(e,t)=>{const{mode:n,render:r,formItemRender:a,fieldProps:i,emptyText:o="-",...l}=e,u=d.useRef(),[m,g,f]=Sr(e);if(d.useImperativeHandle(t,()=>({...u.current||{},fetchData:h=>f(h)}),[f]),m)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const h=g!=null&&g.length?g==null?void 0:g.reduce((S,y)=>({...S,[y.value??""]:y.label}),{}):void 0,p=s.jsx(s.Fragment,{children:Yn(l.text,un(l.valueEnum||h))});return r?r(l.text,{mode:n,...i},s.jsx(s.Fragment,{children:p}))??o:p}if(n==="edit"||n==="update"){const h=s.jsx(c.Segmented,{ref:u,...Ze(i||{},["allowClear"]),options:g});return a?a(l.text,{mode:n,...i,options:g,loading:m},h):h}return null},Sc=d.forwardRef(uj),dj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=e;return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):s.jsx(s.Fragment,{children:o})}if(t==="edit"||t==="update"){const o=s.jsx(c.Slider,{ref:i,...a,style:{minWidth:120,...a==null?void 0:a.style}});return r?r(e,{mode:t,...a},o):o}return null},Cc=d.forwardRef(dj),fj=({text:e,mode:t,render:n,light:r,label:a,formItemRender:i,fieldProps:o,variant:l},u)=>{const m=Ne(),g=l??(o==null?void 0:o.variant),f=d.useMemo(()=>e==null||`${e}`.length<1?"-":e?(o==null?void 0:o.checkedChildren)??m.getMessage("switch.open","打开"):(o==null?void 0:o.unCheckedChildren)??m.getMessage("switch.close","关闭"),[o==null?void 0:o.checkedChildren,o==null?void 0:o.unCheckedChildren,e]);if(t==="read")return n?n(e,{mode:t,...o},s.jsx(s.Fragment,{children:f})):f??"-";if(t==="edit"||t==="update"){const h=s.jsx(c.Switch,{ref:u,size:r?"small":void 0,...Ze(o,["value"]),checked:(o==null?void 0:o.checked)??(o==null?void 0:o.value)});if(r){const{disabled:p}=o;return s.jsx(Qt,{label:a,disabled:p,variant:g,downIcon:!1,value:s.jsx("div",{style:{paddingLeft:8},children:h}),allowClear:!1})}return i?i(e,{mode:t,...o},h):h}return null},wc=d.forwardRef(fj),mj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,emptyText:i="-"},o)=>{const{autoFocus:l,prefix:u="",suffix:m=""}=a||{},g=Ne(),f=d.useRef();if(d.useImperativeHandle(o,()=>f.current,[]),d.useEffect(()=>{l&&queueMicrotask(()=>{var h;(h=f.current)==null||h.focus()})},[l]),t==="read"){const h=s.jsxs(s.Fragment,{children:[u,e??i,m]});return n?n(e,{mode:t,...a},h)??i:h}if(t==="edit"||t==="update"){const h=g.getMessage("tableForm.inputPlaceholder","请输入"),p=s.jsx(c.Input,{ref:f,placeholder:h,allowClear:!0,...a});return r?r(e,{mode:t,...a},p):p}return null},Vi=d.forwardRef(mj),hj=({text:e,fieldProps:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-readonly"),i=`${a}-textarea`,{wrapSSR:o,hashId:l}=tt("TextArea",()=>({[`.${i}`]:{display:"inline-block",lineHeight:"1.5715",maxWidth:"100%",whiteSpace:"pre-wrap"}}));return o(s.jsx("span",{ref:n,className:ie(l,a,i),...Ze(t,["autoSize","classNames","styles"]),children:e??"-"}))},gj=d.forwardRef(hj),pj=(e,t)=>{const{text:n,mode:r,render:a,formItemRender:i,fieldProps:o}=e,l=Ne();if(r==="read"){const u=s.jsx(gj,{...e,ref:t});return a?a(n,{mode:r,...Ze(o,["showCount"])},u):u}if(r==="edit"||r==="update"){const u=s.jsx(c.Input.TextArea,{ref:t,rows:3,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},placeholder:l.getMessage("tableForm.inputPlaceholder","请输入"),...o});return i?i(n,{mode:r,...o},u):u}return null},jc=d.forwardRef(pj),yj=({text:e,mode:t,light:n,label:r,format:a="HH:mm:ss",render:i,formItemRender:o,fieldProps:l,lightLabel:u,variant:m},g)=>{const[f,h]=d.useState(!1),p=Ne(),S=(l==null?void 0:l.format)||a,y=Re.isDayjs(e)||typeof e=="number";if(t==="read"){const w=s.jsx("span",{ref:g,children:e?Re(e,y?void 0:S).format(S):"-"});return i?i(e,{mode:t,...l},s.jsx("span",{children:w})):w}if(t==="edit"||t==="update"){let w;const{disabled:v,value:x}=l,C=xr(x,S);return n?w=s.jsx(Qt,{onClick:()=>{var j;(j=l==null?void 0:l.onOpenChange)==null||j.call(l,!0),h(!0)},style:C?{paddingInlineEnd:0}:void 0,label:r,disabled:v,variant:m??(l==null?void 0:l.variant),value:C||f?s.jsx(c.TimePicker,{variant:m??(l==null?void 0:l.variant),format:a,ref:g,...l,placeholder:l.placeholder??p.getMessage("tableForm.selectPlaceholder","请选择"),value:C,onOpenChange:j=>{var b;h(j),(b=l==null?void 0:l.onOpenChange)==null||b.call(l,j)},open:f}):null,downIcon:C||f?!1:void 0,allowClear:!1,ref:u}):w=s.jsx(c.DatePicker.TimePicker,{ref:g,format:a,...l,value:C}),o?o(e,{mode:t,...l},w):w}return null},xj=({text:e,light:t,label:n,mode:r,lightLabel:a,format:i="HH:mm:ss",render:o,formItemRender:l,fieldProps:u,variant:m},g)=>{const f=Ne(),[h,p]=d.useState(!1),S=(u==null?void 0:u.format)||i,[y,w]=Array.isArray(e)?e:[],v=Re.isDayjs(y)||typeof y=="number",x=Re.isDayjs(w)||typeof w=="number",C=y?Re(y,v?void 0:S).format(S):"",j=w?Re(w,x?void 0:S).format(S):"";if(r==="read"){const b=s.jsxs("div",{ref:g,children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return o?o(e,{mode:r,...u},s.jsx("span",{children:b})):b}if(r==="edit"||r==="update"){const b=xr(u.value,S);let T;if(t){const{disabled:$,placeholder:E=[f.getMessage("tableForm.selectPlaceholder","请选择"),f.getMessage("tableForm.selectPlaceholder","请选择")]}=u;T=s.jsx(Qt,{onClick:()=>{var R;(R=u==null?void 0:u.onOpenChange)==null||R.call(u,!0),p(!0)},style:b?{paddingInlineEnd:0}:void 0,label:n,disabled:$,variant:m,placeholder:E,value:b||h?s.jsx(c.TimePicker.RangePicker,{variant:m??(u==null?void 0:u.variant),format:i,ref:g,...u,placeholder:E,value:b,onOpenChange:R=>{var I;p(R),(I=u==null?void 0:u.onOpenChange)==null||I.call(u,R)},open:h}):null,downIcon:b||h?!1:void 0,allowClear:!1,ref:a})}else T=s.jsx(c.TimePicker.RangePicker,{ref:g,format:i,variant:m,...u,value:b});return l?l(e,{mode:r,...u},T):T}return null},vc=d.forwardRef(xj),Tc=d.forwardRef(yj),bj=({formItemRender:e,mode:t,light:n,label:r,render:a,variant:i,...o},l)=>{var q,z;const{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),m=u("pro-field-tree-select"),g=d.useRef(null),[f,h]=d.useState(!1),{onClear:p,onChange:S,onBlur:y,showSearch:w,fetchDataOnSearch:v,onSearch:x,autoClearSearchValue:C,searchValue:j,...b}=Ze(o.fieldProps,["treeData"]),T=typeof w=="object"?w:{},$=(T==null?void 0:T.onSearch)!==void 0?T.onSearch:x,E=(T==null?void 0:T.autoClearSearchValue)!==void 0?T.autoClearSearchValue:C,R=(T==null?void 0:T.searchValue)!==void 0?T.searchValue:j,I=i??(b==null?void 0:b.variant),M=Ne(),[Y,U,A]=Sr({...o,defaultKeyWords:R}),[k,F]=dt(void 0,R),D=d.useCallback(V=>{F(Z=>{const G=typeof V=="function"?V(Z):V;return $==null||$(G),G})},[$]);d.useImperativeHandle(l,()=>({...g.current||{},fetchData:V=>A(V)}));const O=d.useMemo(()=>{if(t!=="read")return;const{value:V="value",label:Z="label",children:G="children"}=(b==null?void 0:b.fieldNames)||{},H=new Map,L=K=>{if(!(K!=null&&K.length))return H;const P=K.length;let W=0;for(;W<P;){const te=K[W++];H.set(te[V],te[Z]),L(te[G])}return H};return L(U)},[b==null?void 0:b.fieldNames,t,U]),B=(V,Z,G)=>{w&&E&&(A(void 0),D(void 0)),S==null||S(V,Z,G)};if(t==="read"){const V=s.jsx(s.Fragment,{children:Yn(o.text,un(o.valueEnum||O))});return a?a(o.text,{mode:t,...b,treeData:U},V)??null:V}if(t==="edit"){const V=Array.isArray(b==null?void 0:b.value)?(q=b==null?void 0:b.value)==null?void 0:q.length:0;let Z=s.jsx(c.Spin,{spinning:Y,children:s.jsx(c.TreeSelect,{open:f,onOpenChange:G=>{var H;(H=b==null?void 0:b.onOpenChange)==null||H.call(b,G),h(G)},ref:g,popupMatchSelectWidth:!n,placeholder:M.getMessage("tableForm.selectPlaceholder","请选择"),tagRender:n?G=>{var L;if(V<2)return s.jsx(s.Fragment,{children:G.label});const H=(L=b==null?void 0:b.value)==null?void 0:L.findIndex(K=>K===G.value||K.value===G.value);return s.jsxs(s.Fragment,{children:[G.label," ",H<V-1?",":""]})}:void 0,...b,treeData:U,showSearch:w&&{...T,searchValue:k,autoClearSearchValue:E,onSearch:G=>{v&&(o!=null&&o.request)&&A(G),D(G)}},style:{minWidth:60,...b.style},allowClear:b.allowClear!==!1,onClear:()=>{p==null||p(),A(void 0),w&&D(void 0)},onChange:B,onBlur:G=>{D(void 0),A(void 0),y==null||y(G)},className:ie(b==null?void 0:b.className,m)})});if(e&&(Z=e(o.text,{mode:t,...b,options:U,loading:Y},Z)??null),n){const{disabled:G,placeholder:H}=b,L=!!b.value&&((z=b.value)==null?void 0:z.length)!==0;return s.jsx(Qt,{label:r,disabled:G,placeholder:H,onClick:()=>{var K;h(!0),(K=b==null?void 0:b.onOpenChange)==null||K.call(b,!0)},variant:I,value:L||f?Z:null,style:L?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:!1})}return Z}return null},Fc=d.forwardRef(bj);function Ye(e){const[t,n]=d.useState(!1),r=d.useRef(null),a=d.useCallback(l=>{var g,f,h,p,S,y;const u=(h=(f=(g=r.current)==null?void 0:g.labelRef)==null?void 0:f.current)==null?void 0:h.contains(l.target),m=(y=(S=(p=r.current)==null?void 0:p.clearRef)==null?void 0:S.current)==null?void 0:y.contains(l.target);return u&&!m},[r]),i=l=>{a(l)&&n(!0)},o=()=>{n(!1)};return e.isLight?s.jsx("div",{onMouseDown:i,onMouseUp:o,children:d.cloneElement(e.children,{labelTrigger:t,lightLabel:r})}):s.jsx(s.Fragment,{children:e.children})}Re.extend(vd);Re.extend(wd);Re.extend(jd);Re.extend(vo);Re.extend(Td);const Ed=(e,t,n,r)=>{var l,u,m,g;const{mode:a="read",emptyText:i="-"}=n;if(i!==!1&&a==="read"&&t!=="option"&&t!=="switch"&&typeof e!="boolean"&&typeof e!="number"&&!e){const{fieldProps:f,render:h}=n;return h?h(e,{mode:a,...f},s.jsx(s.Fragment,{children:i})):s.jsx(s.Fragment,{children:i})}if(delete n.emptyText,typeof t=="object")return Ed(e,t.type,{...t,...n},r);const o=r&&r[t];if(o){if(delete n.ref,a==="read"){const f=(l=o.render)==null?void 0:l.call(o,e,{text:e,...n,mode:a||"read"},s.jsx(s.Fragment,{children:e}));return n!=null&&n.render?(u=n.render)==null?void 0:u.call(n,e,{text:e,...n},f):f}if(a==="update"||a==="edit"){const f=(m=o.formItemRender)==null?void 0:m.call(o,e,{text:e,...n},s.jsx(s.Fragment,{children:e}));return n!=null&&n.formItemRender?(g=n.formItemRender)==null?void 0:g.call(n,e,{text:e,...n},f):f}}return s.jsx(Vi,{text:e,...n})},Sj=({text:e,valueType:t="text",mode:n="read",onChange:r,formItemRender:a,value:i,readonly:o,fieldProps:l,...u},m)=>{const g=d.useContext(Zt),f=je((...S)=>{var y;(y=l==null?void 0:l.onChange)==null||y.call(l,...S),r==null||r(...S)}),h=St(()=>(i!==void 0||l)&&{value:i,...xt(l),onChange:f},[i,l,f]),p=Ed(n==="edit"?(h==null?void 0:h.value)??e??"":e??(h==null?void 0:h.value)??"",t||"text",xt({ref:m,...u,mode:o?"read":n,formItemRender:a?(S,y,w)=>{const{placeholder:v,...x}=y,C=a(S,x,w);return d.isValidElement(C)?d.cloneElement(C,{...h,...C.props||{}}):C}:void 0,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(h==null?void 0:h.placeholder),fieldProps:zt(xt({...h,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(h==null?void 0:h.placeholder)}))}),g.valueTypeMap||{});return s.jsx(d.Fragment,{children:p})},Cj=d.forwardRef(Sj);Re.extend(vd);Re.extend(wd);Re.extend(jd);Re.extend(vo);Re.extend(Td);const Rd={progress:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(yc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(yc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},money:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(mc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(mc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},percent:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(pc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(pc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},image:{render:(e,t)=>s.jsx(dc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(dc,{...t,text:e})},date:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD",...t,text:e})})},dateWeek:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-wo",picker:"week",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-wo",picker:"week",...t,text:e})})},dateWeekRange:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})})},dateMonthRange:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})})},dateQuarterRange:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})})},dateYearRange:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})})},dateMonth:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM",picker:"month",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM",picker:"month",...t,text:e})})},dateQuarter:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})})},dateYear:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY",picker:"year",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY",picker:"year",...t,text:e})})},dateRange:{render:(e,t)=>s.jsx(kt,{format:"YYYY-MM-DD",...t,text:e}),formItemRender:(e,t)=>s.jsx(kt,{format:"YYYY-MM-DD",...t,text:e})},dateTime:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},dateTimeRange:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},time:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(Tc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(Tc,{format:"HH:mm:ss",...t,text:e})})},timeRange:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(vc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(vc,{format:"HH:mm:ss",...t,text:e})})},fromNow:{render:(e,t)=>s.jsx(uc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(uc,{...t,text:e})},index:{render:e=>s.jsx(Fs,{children:e+1}),formItemRender:e=>s.jsx(Fs,{children:e+1})},indexBorder:{render:e=>s.jsx(Fs,{border:!0,children:e+1}),formItemRender:e=>s.jsx(Fs,{border:!0,children:e+1})},avatar:{render:e=>s.jsx(c.Avatar,{src:e,size:22,shape:"circle"}),formItemRender:e=>s.jsx(c.Avatar,{src:e,size:22,shape:"circle"})},code:{render:(e,t)=>s.jsx(Ts,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Ts,{...t,text:e})},jsonCode:{render:(e,t)=>s.jsx(Ts,{language:"json",...t,text:e}),formItemRender:(e,t)=>s.jsx(Ts,{language:"json",...t,text:e})},textarea:{render:(e,t)=>s.jsx(jc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(jc,{...t,text:e})},digit:{render:(e,t)=>{const n=zt(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(ia,{text:a,placeholder:r,mode:t.mode,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(ia,{text:a,placeholder:r,mode:t.mode,fieldProps:n})}},digitRange:{render:(e,t)=>s.jsx(lc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(lc,{...t,text:e})},second:{render:(e,t)=>s.jsx(bc,{...t,text:e,placeholder:t.placeholder}),formItemRender:(e,t)=>s.jsx(bc,{...t,text:e,placeholder:t.placeholder})},select:{render:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(vs,{...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ye,{isLight:t.light,children:s.jsx(vs,{...t,text:e})})},text:{render:(e,t)=>"valueEnum"in t?s.jsx(Ye,{isLight:t.light,children:s.jsx(vs,{...t,text:e})}):s.jsx(Vi,{...t,text:e}),formItemRender:(e,t)=>"valueEnum"in t?s.jsx(Ye,{isLight:t.light,children:s.jsx(vs,{...t,text:e})}):s.jsx(Vi,{...t,text:e})},checkbox:{render:(e,t)=>s.jsx(ic,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ic,{...t,text:e})},radio:{render:(e,t)=>s.jsx($s,{...t,text:e}),formItemRender:(e,t)=>s.jsx($s,{...t,text:e})},radioButton:{render:(e,t)=>s.jsx($s,{radioType:"button",...t,text:e}),formItemRender:(e,t)=>s.jsx($s,{radioType:"button",...t,text:e})},rate:{render:(e,t)=>s.jsx(xc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(xc,{...t,text:e})},slider:{render:(e,t)=>s.jsx(Cc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Cc,{...t,text:e})},switch:{render:(e,t)=>s.jsx(wc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(wc,{...t,text:e})},option:{render:(e,t)=>s.jsx(gc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(gc,{...t,text:e})},password:{render:(e,t)=>s.jsx(or,{...t,text:e}),formItemRender:(e,t)=>s.jsx(or,{...t,text:e})},cascader:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})}},treeSelect:{render:(e,t)=>s.jsx(Fc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Fc,{...t,text:e})},color:{render:(e,t)=>s.jsx(oc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(oc,{...t,text:e})},segmented:{render:(e,t)=>s.jsx(Sc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Sc,{...t,text:e})}},To=d.createContext({grid:!1,colProps:void 0,rowProps:void 0}),wj=({grid:e,rowProps:t,colProps:n})=>({grid:!!e,RowWrapper({children:r,Wrapper:a,...i}={}){return e?s.jsx(c.Row,{gutter:8,...t,...i,children:r}):a?s.jsx(a,{children:r}):r},ColWrapper({children:r,Wrapper:a,variant:i,fieldProps:o,...l}={}){var g;const u=d.useMemo(()=>{const f={...n,...l};return typeof f.span>"u"&&typeof f.xs>"u"&&(f.xs=24),f},[l]),m=(i!==void 0||o!==void 0)&&d.Children.count(r)===1&&d.isValidElement(r)?d.cloneElement(r,{...i!==void 0&&{variant:i},...o&&{fieldProps:{...(g=r==null?void 0:r.props)==null?void 0:g.fieldProps,...o}}}):r;return e?s.jsx(c.Col,{...u,children:m}):a?s.jsx(a,{children:m}):m}}),Cr=e=>{const t=d.useMemo(()=>typeof e=="object"?e:{grid:e},[e]),{grid:n,colProps:r}=d.useContext(To);return d.useMemo(()=>wj({grid:!!(n||t.grid),rowProps:t==null?void 0:t.rowProps,colProps:(t==null?void 0:t.colProps)||r,Wrapper:t==null?void 0:t.Wrapper}),[t==null?void 0:t.Wrapper,t.grid,n,JSON.stringify([r,t==null?void 0:t.colProps,t==null?void 0:t.rowProps])])},Pn="RC_FORM_INTERNAL_HOOKS",Ge=()=>{st(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Hn=be.createContext({getFieldValue:Ge,getFieldsValue:Ge,getFieldError:Ge,getFieldWarning:Ge,getFieldsError:Ge,isFieldsTouched:Ge,isFieldTouched:Ge,isFieldValidating:Ge,isFieldsValidating:Ge,resetFields:Ge,setFields:Ge,setFieldValue:Ge,setFieldsValue:Ge,validateFields:Ge,submit:Ge,getInternalHooks:()=>(Ge(),{dispatch:Ge,initEntityValue:Ge,registerField:Ge,useSubscribe:Ge,setInitialValues:Ge,destroyForm:Ge,setCallbacks:Ge,registerWatch:Ge,getFields:Ge,setValidateMessages:Ge,setPreserve:Ge,getInitialValue:Ge})}),la=be.createContext(null);function Hi(e){return e==null?[]:Array.isArray(e)?e:[e]}function jj(e){return e&&!!e._init}function Yi(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){const e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}const ti=Yi(),vj=/%[sdj%]/g;let Id=()=>{};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Id=(e,t)=>{typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&t.every(n=>typeof n=="string")&&console.warn(e,t)});function Ui(e){if(!e||!e.length)return null;const t={};return e.forEach(n=>{const r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Mt(e,...t){let n=0;const r=t.length;return typeof e=="function"?e.apply(null,t):typeof e=="string"?e.replace(vj,i=>{if(i==="%%")return"%";if(n>=r)return i;switch(i){case"%s":return String(t[n++]);case"%d":return Number(t[n++]);case"%j":try{return JSON.stringify(t[n++])}catch{return"[Circular]"}break;default:return i}}):e}function Tj(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function pt(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Tj(t)&&typeof e=="string"&&!e)}function Fj(e,t,n){const r=[];let a=0;const i=e.length;function o(l){r.push(...l||[]),a++,a===i&&n(r)}e.forEach(l=>{t(l,o)})}function $c(e,t,n){let r=0;const a=e.length;function i(o){if(o&&o.length){n(o);return}const l=r;r=r+1,l<a?t(e[l],i):n([])}i([])}function $j(e){const t=[];return Object.keys(e).forEach(n=>{t.push(...e[n]||[])}),t}class Ec extends Error{constructor(n,r){super("Async Validation Error");oe(this,"errors");oe(this,"fields");this.errors=n,this.fields=r}}function Ej(e,t,n,r,a){if(t.first){const f=new Promise((h,p)=>{const S=w=>(r(w),w.length?p(new Ec(w,Ui(w))):h(a)),y=$j(e);$c(y,n,S)});return f.catch(h=>h),f}const i=t.firstFields===!0?Object.keys(e):t.firstFields||[],o=Object.keys(e),l=o.length;let u=0;const m=[],g=new Promise((f,h)=>{const p=S=>{if(m.push.apply(m,S),u++,u===l)return r(m),m.length?h(new Ec(m,Ui(m))):f(a)};o.length||(r(m),f(a)),o.forEach(S=>{const y=e[S];i.indexOf(S)!==-1?$c(y,n,p):Fj(y,n,p)})});return g.catch(f=>f),g}function Rj(e){return!!(e&&e.message!==void 0)}function Ij(e,t){let n=e;for(let r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function Rc(e,t){return n=>{let r;return e.fullFields?r=Ij(t,e.fullFields):r=t[n.field||e.fullField],Rj(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function Ic(e,t){if(t){for(const n in t)if(t.hasOwnProperty(n)){const r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]={...e[n],...r}:e[n]=r}}return e}const tr="enum",Mj=(e,t,n,r,a)=>{e[tr]=Array.isArray(e[tr])?e[tr]:[],e[tr].indexOf(t)===-1&&r.push(Mt(a.messages[tr],e.fullField,e[tr].join(", ")))},Aj=(e,t,n,r,a)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Mt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern=="string"&&(new RegExp(e.pattern).test(t)||r.push(Mt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))))},kj=(e,t,n,r,a)=>{const i=typeof e.len=="number",o=typeof e.min=="number",l=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let m=t,g=null;const f=typeof t=="number",h=typeof t=="string",p=Array.isArray(t);if(f?g="number":h?g="string":p&&(g="array"),!g)return!1;p&&(m=t.length),h&&(m=t.replace(u,"_").length),i?m!==e.len&&r.push(Mt(a.messages[g].len,e.fullField,e.len)):o&&!l&&m<e.min?r.push(Mt(a.messages[g].min,e.fullField,e.min)):l&&!o&&m>e.max?r.push(Mt(a.messages[g].max,e.fullField,e.max)):o&&l&&(m<e.min||m>e.max)&&r.push(Mt(a.messages[g].range,e.fullField,e.min,e.max))},Md=(e,t,n,r,a,i)=>{e.required&&(!n.hasOwnProperty(e.field)||pt(t,i||e.type))&&r.push(Mt(a.messages.required,e.fullField))};let Es;const Oj=(()=>{if(Es)return Es;const e="[a-fA-F\\d:]",t=b=>b&&b.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=`(?:${[`(?:${r}:){7}(?:${r}|:)`,`(?:${r}:){6}(?:${n}|:${r}|:)`,`(?:${r}:){5}(?::${n}|(?::${r}){1,2}|:)`,`(?:${r}:){4}(?:(?::${r}){0,1}:${n}|(?::${r}){1,3}|:)`,`(?:${r}:){3}(?:(?::${r}){0,2}:${n}|(?::${r}){1,4}|:)`,`(?:${r}:){2}(?:(?::${r}){0,3}:${n}|(?::${r}){1,5}|:)`,`(?:${r}:){1}(?:(?::${r}){0,4}:${n}|(?::${r}){1,6}|:)`,`(?::(?:(?::${r}){0,5}:${n}|(?::${r}){1,7}|:))`].join("|")})(?:%[0-9a-zA-Z]{1,})?`,l=new RegExp(`(?:^${n}$)|(?:^${o}$)`),u=new RegExp(`^${n}$`),m=new RegExp(`^${o}$`),g=b=>b&&b.exact?l:new RegExp(`(?:${t(b)}${n}${t(b)})|(?:${t(b)}${o}${t(b)})`,"g");g.v4=b=>b&&b.exact?u:new RegExp(`${t(b)}${n}${t(b)}`,"g"),g.v6=b=>b&&b.exact?m:new RegExp(`${t(b)}${o}${t(b)}`,"g");const f="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",p=g.v4().source,S=g.v6().source,j=`(?:${f}|www\\.)${h}(?:localhost|${p}|${S}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return Es=new RegExp(`(?:^${j}$)`,"i"),Es}),ni={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Nr={integer(e){return Nr.number(e)&&parseInt(e,10)===e},float(e){return Nr.number(e)&&!Nr.integer(e)},array(e){return Array.isArray(e)},regexp(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number(e){return isNaN(e)?!1:typeof e=="number"},object(e){return typeof e=="object"&&!Nr.array(e)},method(e){return typeof e=="function"},email(e){return typeof e=="string"&&e.length<=320&&!!e.match(ni.email)},tel(e){return typeof e=="string"&&e.length<=32&&!!e.match(ni.tel)},url(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Oj())},hex(e){return typeof e=="string"&&!!e.match(ni.hex)}},Dj=(e,t,n,r,a)=>{if(e.required&&t===void 0){Md(e,t,n,r,a);return}const i=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],o=e.type;i.indexOf(o)>-1?Nr[o](t)||r.push(Mt(a.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(Mt(a.messages.types[o],e.fullField,e.type))},Pj=(e,t,n,r,a)=>{(/^\s+$/.test(t)||t==="")&&r.push(Mt(a.messages.whitespace,e.fullField))},_e={required:Md,whitespace:Pj,type:Dj,range:kj,enum:Mj,pattern:Aj},Nj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a)}n(i)},Lj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();_e.required(e,t,r,i,a,"array"),t!=null&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},_j=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e.type(e,t,r,i,a)}n(i)},zj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,"date")&&!e.required)return n();if(_e.required(e,t,r,i,a),!pt(t,"date")){let l;t instanceof Date?l=t:l=new Date(t),_e.type(e,l,r,i,a),l&&_e.range(e,l.getTime(),r,i,a)}}n(i)},Bj="enum",Vj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e[Bj](e,t,r,i,a)}n(i)},Hj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},Yj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},Uj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e.type(e,t,r,i,a)}n(i)},Kj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===""&&(t=void 0),pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},Wj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e.type(e,t,r,i,a)}n(i)},qj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,"string")&&!e.required)return n();_e.required(e,t,r,i,a),pt(t,"string")||_e.pattern(e,t,r,i,a)}n(i)},Gj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),pt(t)||_e.type(e,t,r,i,a)}n(i)},Zj=(e,t,n,r,a)=>{const i=[],o=Array.isArray(t)?"array":typeof t;_e.required(e,t,r,i,a,o),n(i)},Jj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,"string")&&!e.required)return n();_e.required(e,t,r,i,a,"string"),pt(t,"string")||(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a),_e.pattern(e,t,r,i,a),e.whitespace===!0&&_e.whitespace(e,t,r,i,a))}n(i)},Rs=(e,t,n,r,a)=>{const i=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,i)&&!e.required)return n();_e.required(e,t,r,o,a,i),pt(t,i)||_e.type(e,t,r,o,a)}n(o)},Mr={string:Jj,method:Uj,number:Kj,boolean:_j,regexp:Gj,integer:Yj,float:Hj,array:Lj,object:Wj,enum:Vj,pattern:qj,date:zj,url:Rs,hex:Rs,email:Rs,tel:Rs,required:Zj,any:Nj},xn=class xn{constructor(t){oe(this,"rules",null);oe(this,"_messages",ti);this.define(t)}define(t){if(!t)throw new Error("Cannot configure a schema with no rules");if(typeof t!="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach(n=>{const r=t[n];this.rules[n]=Array.isArray(r)?r:[r]})}messages(t){return t&&(this._messages=Ic(Yi(),t)),this._messages}validate(t,n={},r=()=>{}){let a=t,i=n,o=r;if(typeof i=="function"&&(o=i,i={}),!this.rules||Object.keys(this.rules).length===0)return o&&o(null,a),Promise.resolve(a);function l(f){let h=[],p={};function S(y){Array.isArray(y)?h=h.concat(...y):h.push(y)}for(let y=0;y<f.length;y++)S(f[y]);h.length?(p=Ui(h),o(h,p)):o(null,a)}if(i.messages){let f=this.messages();f===ti&&(f=Yi()),Ic(f,i.messages),i.messages=f}else i.messages=this.messages();const u={};(i.keys||Object.keys(this.rules)).forEach(f=>{const h=this.rules[f];let p=a[f];h.forEach(S=>{let y=S;typeof y.transform=="function"&&(a===t&&(a={...a}),p=a[f]=y.transform(p),p!=null&&(y.type=y.type||(Array.isArray(p)?"array":typeof p))),typeof y=="function"?y={validator:y}:y={...y},y.validator=this.getValidationMethod(y),y.validator&&(y.field=f,y.fullField=y.fullField||f,y.type=this.getType(y),u[f]=u[f]||[],u[f].push({rule:y,value:p,source:a,field:f}))})});const g={};return Ej(u,i,(f,h)=>{var x;const p=f.rule;let S=(p.type==="object"||p.type==="array")&&(typeof p.fields=="object"||typeof p.defaultField=="object");S=S&&(p.required||!p.required&&f.value),p.field=f.field;function y(C,j){return{...j,fullField:`${p.fullField}.${C}`,fullFields:p.fullFields?[...p.fullFields,C]:[C]}}function w(C=[]){let j=Array.isArray(C)?C:[C];!i.suppressWarning&&j.length&&xn.warning("async-validator:",j),j.length&&p.message!==void 0&&p.message!==null&&(j=[].concat(p.message));let b=j.map(Rc(p,a));if(i.first&&b.length)return g[p.field]=1,h(b);if(!S)h(b);else{if(p.required&&!f.value)return p.message!==void 0?b=[].concat(p.message).map(Rc(p,a)):i.error&&(b=[i.error(p,Mt(i.messages.required,p.field))]),h(b);let T={};p.defaultField&&Object.keys(f.value).map(R=>{T[R]=p.defaultField}),T={...T,...f.rule.fields};const $={};Object.keys(T).forEach(R=>{const I=T[R],M=Array.isArray(I)?I:[I];$[R]=M.map(y.bind(null,R))});const E=new xn($);E.messages(i.messages),f.rule.options&&(f.rule.options.messages=i.messages,f.rule.options.error=i.error),E.validate(f.value,f.rule.options||i,R=>{const I=[];b&&b.length&&I.push(...b),R&&R.length&&I.push(...R),h(I.length?I:null)})}}let v;if(p.asyncValidator)v=p.asyncValidator(p,f.value,w,f.source,i);else if(p.validator){try{v=p.validator(p,f.value,w,f.source,i)}catch(C){(x=console.error)==null||x.call(console,C),i.suppressValidatorError||setTimeout(()=>{throw C},0),w(C.message)}v===!0?w():v===!1?w(typeof p.message=="function"?p.message(p.fullField||p.field):p.message||`${p.fullField||p.field} fails`):v instanceof Array?w(v):v instanceof Error&&w(v.message)}v&&v.then&&v.then(()=>w(),C=>w(C))},f=>{l(f)},a)}getType(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!Mr.hasOwnProperty(t.type))throw new Error(Mt("Unknown rule type %s",t.type));return t.type||"string"}getValidationMethod(t){if(typeof t.validator=="function")return t.validator;const n=Object.keys(t),r=n.indexOf("message");return r!==-1&&n.splice(r,1),n.length===1&&n[0]==="required"?Mr.required:Mr[this.getType(t)]||void 0}};oe(xn,"register",function(n,r){if(typeof r!="function")throw new Error("Cannot register a validator by type, validator is not a function");Mr[n]=r}),oe(xn,"warning",Id),oe(xn,"messages",ti),oe(xn,"validators",Mr);let Ki=xn;const wt="'${name}' is not a valid ${type}",Ad={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:wt,method:wt,array:wt,object:wt,number:wt,date:wt,boolean:wt,integer:wt,float:wt,regexp:wt,email:wt,tel:wt,url:wt,hex:wt},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},Mc=Ki;function Xj(e,t){return e.replace(/\\?\$\{\w+\}/g,n=>{if(n.startsWith("\\"))return n.slice(1);const r=n.slice(2,-1);return t[r]})}const Ac="CODE_LOGIC_ERROR";async function Wi(e,t,n,r,a){const i={...n};if(delete i.ruleIndex,Mc.warning=()=>{},i.validator){const h=i.validator;i.validator=(...p)=>{try{return h(...p)}catch(S){return console.error(S),Promise.reject(Ac)}}}let o=null;i&&i.type==="array"&&i.defaultField&&(o=i.defaultField,delete i.defaultField);const l=new Mc({[e]:[i]}),u=ar(Ad,r.validateMessages);l.messages(u);let m=[];try{await Promise.resolve(l.validate({[e]:t},{...r}))}catch(h){h.errors&&(m=h.errors.map(({message:p},S)=>{const y=p===Ac?u.default:p;return be.isValidElement(y)?be.cloneElement(y,{key:`error_${S}`}):y}))}if(!m.length&&o&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((p,S)=>Wi(`${e}.${S}`,p,o,r,a)))).reduce((p,S)=>[...p,...S],[]);const g={...n,name:e,enum:(n.enum||[]).join(", "),...a};return m.map(h=>typeof h=="string"?Xj(h,g):h)}function Qj(e,t,n,r,a,i){const o=e.join("."),l=n.map((m,g)=>{const f=m.validator,h={...m,ruleIndex:g};return f&&(h.validator=(p,S,y)=>{let w=!1;const x=f(p,S,(...C)=>{Promise.resolve().then(()=>{st(!w,"Your validator function has already return a promise. `callback` will be ignored."),w||y(...C)})});w=x&&typeof x.then=="function"&&typeof x.catch=="function",st(w,"`callback` is deprecated. Please return a promise instead."),w&&x.then(()=>{y()}).catch(C=>{y(C||" ")})}),h}).sort(({warningOnly:m,ruleIndex:g},{warningOnly:f,ruleIndex:h})=>!!m==!!f?g-h:m?1:-1);let u;if(a===!0)u=new Promise(async(m,g)=>{for(let f=0;f<l.length;f+=1){const h=l[f],p=await Wi(o,t,h,r,i);if(p.length){g([{errors:p,rule:h}]);return}}m([])});else{const m=l.map(g=>Wi(o,t,g,r,i).then(f=>({errors:f,rule:g})));u=(a?t0(m):e0(m)).then(g=>Promise.reject(g))}return u.catch(m=>m),u}async function e0(e){return Promise.all(e).then(t=>[].concat(...t))}async function t0(e){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(a=>{a.errors.length&&n([a]),t+=1,t===e.length&&n([])})})})}function ut(e){return Hi(e)}function kc(e,t){let n={};return t.forEach(r=>{const a=Be(e,r);n=Qe(n,r,a)}),n}function cr(e,t,n=!1){return e&&e.some(r=>ca(t,r,n))}function ca(e,t,n=!1){return!e||!t||!n&&e.length!==t.length?!1:t.every((r,a)=>e[a]===r)}function n0(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);return[...new Set([...n,...r])].every(i=>{const o=e[i],l=t[i];return typeof o=="function"&&typeof l=="function"?!0:o===l})}function r0(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function Oc(e,t,n){const{length:r}=e;if(t<0||t>=r||n<0||n>=r)return e;const a=e[t],i=t-n;return i>0?[...e.slice(0,n),a,...e.slice(n,t),...e.slice(t+1,r)]:i<0?[...e.slice(0,t),...e.slice(t+1,n+1),a,...e.slice(n+1,r)]:e}const kd=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class s0{constructor(t){oe(this,"namePathList",[]);oe(this,"taskId",0);oe(this,"watcherList",new Set);oe(this,"form");this.form=t}register(t){return this.watcherList.add(t),()=>{this.watcherList.delete(t)}}notify(t){t.forEach(n=>{this.namePathList.every(r=>!ca(r,n))&&this.namePathList.push(n)}),this.doBatch()}doBatch(){this.taskId+=1;const t=this.taskId;kd(()=>{if(t===this.taskId&&this.watcherList.size){const n=this.form.getForm(),r=n.getFieldsValue(),a=n.getFieldsValue(!0);this.watcherList.forEach(i=>{i(r,a,this.namePathList)}),this.namePathList=[]}})}}async function a0(){return new Promise(e=>{kd(()=>{ro(()=>{e()})})})}function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qi.apply(this,arguments)}const Mn=[],Ar=[];function ri(e,t,n,r,a,i){return typeof e=="function"?e(t,n,"source"in i?{source:i.source}:{}):r!==a}class Od extends be.PureComponent{constructor(n){super(n);oe(this,"state",{resetCount:0});oe(this,"cancelRegisterFunc",null);oe(this,"mounted",!1);oe(this,"touched",!1);oe(this,"dirty",!1);oe(this,"validatePromise");oe(this,"prevValidating");oe(this,"errors",Mn);oe(this,"warnings",Ar);oe(this,"cancelRegister",()=>{const{preserve:n,isListField:r,name:a}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,ut(a)),this.cancelRegisterFunc=null});oe(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:a=[]}=r;return n!==void 0?[...a,...n]:[]});oe(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(a=>typeof a=="function"?a(r):a)});oe(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});oe(this,"metaCache",null);oe(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const a={...this.getMeta(),destroy:n};zo(this.metaCache,a)||r(a),this.metaCache=a}else this.metaCache=null});oe(this,"onStoreChange",(n,r,a)=>{const{shouldUpdate:i,dependencies:o=[],onReset:l}=this.props,{store:u}=a,m=this.getNamePath(),g=this.getValue(n),f=this.getValue(u),h=r&&cr(r,m);switch(a.type==="valueUpdate"&&a.source==="external"&&!zo(g,f)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=Mn,this.warnings=Ar,this.triggerMetaEvent()),a.type){case"reset":if(!r||h){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=Mn,this.warnings=Ar,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&ri(i,n,u,g,f,a)){this.reRender();return}break}case"setField":{const{data:p}=a;if(h){"touched"in p&&(this.touched=p.touched),"validating"in p&&!("originRCField"in p)&&(this.validatePromise=p.validating?Promise.resolve([]):null),"errors"in p&&(this.errors=p.errors||Mn),"warnings"in p&&(this.warnings=p.warnings||Ar),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in p&&cr(r,m,!0)){this.reRender();return}if(i&&!m.length&&ri(i,n,u,g,f,a)){this.reRender();return}break}case"dependenciesUpdate":{if(o.map(ut).some(S=>cr(a.relatedFields,S))){this.reRender();return}break}default:if(h||(!o.length||m.length||i)&&ri(i,n,u,g,f,a)){this.reRender();return}break}i===!0&&this.reRender()});oe(this,"validateRules",n=>{const r=this.getNamePath(),a=this.getValue(),{triggerName:i,validateOnly:o=!1,delayFrame:l}=n||{},u=Promise.resolve().then(async()=>{if(!this.mounted)return[];const{validateFirst:m=!1,messageVariables:g,validateDebounce:f}=this.props;l&&await a0();let h=this.getRules();if(i&&(h=h.filter(S=>S).filter(S=>{const{validateTrigger:y}=S;return y?Hi(y).includes(i):!0})),f&&i&&(await new Promise(S=>{setTimeout(S,f)}),this.validatePromise!==u))return[];const p=Qj(r,a,h,n,m,g);return p.catch(S=>S).then((S=Mn)=>{var y;if(this.validatePromise===u){this.validatePromise=null;const w=[],v=[];(y=S.forEach)==null||y.call(S,({rule:{warningOnly:x},errors:C=Mn})=>{x?v.push(...C):w.push(...C)}),this.errors=w,this.warnings=v,this.triggerMetaEvent(),this.reRender()}}),p});return o||(this.validatePromise=u,this.dirty=!0,this.errors=Mn,this.warnings=Ar,this.triggerMetaEvent(),this.reRender()),u});oe(this,"isFieldValidating",()=>!!this.validatePromise);oe(this,"isFieldTouched",()=>this.touched);oe(this,"isFieldDirty",()=>{if(this.dirty||this.props.initialValue!==void 0)return!0;const{fieldContext:n}=this.props,{getInitialValue:r}=n.getInternalHooks(Pn);return r(this.getNamePath())!==void 0});oe(this,"getErrors",()=>this.errors);oe(this,"getWarnings",()=>this.warnings);oe(this,"isListField",()=>this.props.isListField);oe(this,"isList",()=>this.props.isList);oe(this,"isPreserve",()=>this.props.preserve);oe(this,"getMeta",()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:this.validatePromise===null}));oe(this,"getOnlyChild",n=>{if(typeof n=="function"){const a=this.getMeta();return{...this.getOnlyChild(n(this.getControlled(),a,this.props.fieldContext)),isFunction:!0}}const r=Tn(n);return r.length!==1||!be.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});oe(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,a=this.getNamePath();return Be(n||r(!0),a)});oe(this,"getControlled",(n={})=>{const{name:r,trigger:a="onChange",validateTrigger:i,getValueFromEvent:o,normalize:l,valuePropName:u="value",getValueProps:m,fieldContext:g}=this.props,f=i!==void 0?i:g.validateTrigger,h=this.getNamePath(),{getInternalHooks:p,getFieldsValue:S}=g,{dispatch:y}=p(Pn),w=this.getValue(),v=m||(T=>({[u]:T})),x=n[a],C=r!==void 0?v(w):{};process.env.NODE_ENV!=="production"&&C&&Object.keys(C).forEach(T=>{st(typeof C[T]!="function",`It's not recommended to generate dynamic function prop by \`getValueProps\`. Please pass it to child component directly (prop: ${T})`)});const j={...n,...C};return j[a]=(...T)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();const $=this.getValue();let E;o?E=o(...T):E=r0(u,...T),l&&(E=l(E,$,S(!0))),E!==$&&y({type:"updateValue",namePath:h,value:E}),x&&x(...T)},Hi(f||[]).forEach(T=>{const $=j[T];j[T]=(...E)=>{$&&$(...E);const{rules:R}=this.props;R&&R.length&&y({type:"validateField",namePath:h,triggerName:T})}}),j});if(n.fieldContext){const{getInternalHooks:r}=n.fieldContext,{initEntityValue:a}=r(Pn);a(this)}}componentDidMount(){const{shouldUpdate:n,fieldContext:r}=this.props;if(this.mounted=!0,r){const{getInternalHooks:a}=r,{registerField:i}=a(Pn);this.cancelRegisterFunc=i(this)}n===!0&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}reRender(){this.mounted&&this.forceUpdate()}render(){const{resetCount:n}=this.state,{children:r}=this.props,{child:a,isFunction:i}=this.getOnlyChild(r);let o;return i?o=a:be.isValidElement(a)?o=be.cloneElement(a,this.getControlled(a.props)):(st(!a,"`children` of Field is not validate ReactElement."),o=a),be.createElement(be.Fragment,{key:n},o)}}oe(Od,"contextType",Hn);function Dd({name:e,...t}){const n=be.useContext(Hn),r=be.useContext(la),a=e!==void 0?ut(e):void 0,i=t.isListField??!!r;let o="keep";return i||(o=`_${(a||[]).join("_")}`),process.env.NODE_ENV!=="production"&&t.preserve===!1&&i&&a.length<=1&&st(!1,"`preserve` should not apply on Form.List fields."),be.createElement(Od,qi({key:o,name:a,isListField:i},t,{fieldContext:n}))}function i0({name:e,initialValue:t,children:n,rules:r,validateTrigger:a,isListField:i}){const o=be.useContext(Hn),l=be.useContext(la),m=be.useRef({keys:[],id:0}).current,g=be.useMemo(()=>[...ut(o.prefixName)||[],...ut(e)],[o.prefixName,e]),f=be.useMemo(()=>({...o,prefixName:g}),[o,g]),h=be.useMemo(()=>({getKey:S=>{const y=g.length,w=S[y];return[m.keys[w],S.slice(y+1)]}}),[m,g]);if(typeof n!="function")return st(!1,"Form.List only accepts function as children."),null;const p=(S,y,{source:w})=>w==="internal"?!1:S!==y;return be.createElement(la.Provider,{value:h},be.createElement(Hn.Provider,{value:f},be.createElement(Dd,{name:[],shouldUpdate:p,rules:r,validateTrigger:a,initialValue:t,isList:!0,isListField:i??!!l},({value:S=[],onChange:y},w)=>{const{getFieldValue:v}=o,x=()=>v(g||[])||[],C={add:(b,T)=>{const $=x();T>=0&&T<=$.length?(m.keys=[...m.keys.slice(0,T),m.id,...m.keys.slice(T)],y([...$.slice(0,T),b,...$.slice(T)])):(process.env.NODE_ENV!=="production"&&(T<0||T>$.length)&&st(!1,"The second parameter of the add function should be a valid positive number."),m.keys=[...m.keys,m.id],y([...$,b])),m.id+=1},remove:b=>{const T=x(),$=new Set(Array.isArray(b)?b:[b]);$.size<=0||(m.keys=m.keys.filter((E,R)=>!$.has(R)),y(T.filter((E,R)=>!$.has(R))))},move(b,T){if(b===T)return;const $=x();b<0||b>=$.length||T<0||T>=$.length||(m.keys=Oc(m.keys,b,T),y(Oc($,b,T)))}};let j=S||[];return Array.isArray(j)||(j=[],process.env.NODE_ENV!=="production"&&st(!1,`Current value of '${g.join(" > ")}' is not an array type.`)),n(j.map((b,T)=>{let $=m.keys[T];return $===void 0&&(m.keys[T]=m.id,$=m.keys[T],m.id+=1),{name:T,key:$,isListField:!0}}),C,w)})))}function o0(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((a,i)=>{e.forEach((o,l)=>{o.catch(u=>(t=!0,u)).then(u=>{n-=1,r[l]=u,!(n>0)&&(t&&i(r),a(r))})})}):Promise.resolve([])}const Gi="__@field_split__";function Is(e){return e.map(t=>`${typeof t}:${t}`).join(Gi)}class nr{constructor(){oe(this,"kvs",new Map)}set(t,n){this.kvs.set(Is(t),n)}get(t){return this.kvs.get(Is(t))}getAsPrefix(t){const n=Is(t),r=n+Gi,a=[],i=this.kvs.get(n);return i!==void 0&&a.push(i),this.kvs.forEach((o,l)=>{l.startsWith(r)&&a.push(o)}),a}update(t,n){const r=this.get(t),a=n(r);a?this.set(t,a):this.delete(t)}delete(t){this.kvs.delete(Is(t))}map(t){return[...this.kvs.entries()].map(([n,r])=>{const a=n.split(Gi);return t({key:a.map(i=>{const[,o,l]=i.match(/^([^:]*):(.*)$/);return o==="number"?Number(l):l}),value:r})})}toJSON(){const t={};return this.map(({key:n,value:r})=>(t[n.join(".")]=r,null)),t}}class l0{constructor(t){oe(this,"formHooked",!1);oe(this,"forceRootUpdate");oe(this,"subscribable",!0);oe(this,"store",{});oe(this,"fieldEntities",[]);oe(this,"initialValues",{});oe(this,"callbacks",{});oe(this,"validateMessages",null);oe(this,"preserve",null);oe(this,"lastValidatePromise",null);oe(this,"watcherCenter",new s0(this));oe(this,"getForm",()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks}));oe(this,"getInternalHooks",t=>t===Pn?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):(st(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));oe(this,"useSubscribe",t=>{this.subscribable=t});oe(this,"prevWithoutPreserves",null);oe(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let a=ar(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{a=Qe(a,i,Be(t,i))}),this.prevWithoutPreserves=null,this.updateStore(a)}});oe(this,"destroyForm",t=>{if(t)this.updateStore({});else{const n=new nr;this.getFieldEntities(!0).forEach(r=>{this.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),this.prevWithoutPreserves=n}});oe(this,"getInitialValue",t=>{const n=Be(this.initialValues,t);return t.length?ar(n):n});oe(this,"setCallbacks",t=>{this.callbacks=t});oe(this,"setValidateMessages",t=>{this.validateMessages=t});oe(this,"setPreserve",t=>{this.preserve=t});oe(this,"registerWatch",t=>this.watcherCenter.register(t));oe(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});oe(this,"timeoutId",null);oe(this,"warningUnhooked",()=>{process.env.NODE_ENV!=="production"&&!this.timeoutId&&typeof window<"u"&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.formHooked||st(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))});oe(this,"updateStore",t=>{this.store=t});oe(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);oe(this,"getFieldsMap",(t=!1)=>{const n=new nr;return this.getFieldEntities(t).forEach(r=>{const a=r.getNamePath();n.set(a,r)}),n});oe(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(a=>{const i=ut(a),o=r.getAsPrefix(i);return o.length?o:[{INVALIDATE_NAME_PATH:i}]}):t.map(a=>{const i=ut(a);return r.get(i)||{INVALIDATE_NAME_PATH:ut(a)}})});oe(this,"getFieldsValue",(t,n)=>{this.warningUnhooked();let r,a;if(t===!0||Array.isArray(t)?(r=t,a=n):t&&typeof t=="object"&&(a=t.filter),r===!0&&!a)return this.store;const i=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),o=[],l=[];i.forEach(m=>{var f;const g=m.INVALIDATE_NAME_PATH||m.getNamePath();if((f=m.isList)!=null&&f.call(m)){l.push(g);return}if(!a)o.push(g);else{const h="getMeta"in m?m.getMeta():null;a(h)&&o.push(g)}});let u=kc(this.store,o.map(ut));return l.forEach(m=>{Be(u,m)||(u=Qe(u,m,[]))}),u});oe(this,"getFieldValue",t=>{this.warningUnhooked();const n=ut(t);return Be(this.store,n)});oe(this,"getFieldsError",t=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(t).map((r,a)=>r&&!r.INVALIDATE_NAME_PATH?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:ut(t[a]),errors:[],warnings:[]})));oe(this,"getFieldError",t=>{this.warningUnhooked();const n=ut(t);return this.getFieldsError([n])[0].errors});oe(this,"getFieldWarning",t=>{this.warningUnhooked();const n=ut(t);return this.getFieldsError([n])[0].warnings});oe(this,"isFieldsTouched",(...t)=>{this.warningUnhooked();const[n,r]=t;let a,i=!1;t.length===0?a=null:t.length===1?Array.isArray(n)?(a=n.map(ut),i=!1):(a=null,i=n):(a=n.map(ut),i=r);const o=this.getFieldEntities(!0),l=f=>f.isFieldTouched();if(!a)return i?o.every(f=>l(f)||f.isList()):o.some(l);const u=new nr;a.forEach(f=>{u.set(f,[])}),o.forEach(f=>{const h=f.getNamePath();a.forEach(p=>{p.every((S,y)=>h[y]===S)&&u.update(p,S=>[...S,f])})});const m=f=>f.some(l),g=u.map(({value:f})=>f);return i?g.every(m):g.some(m)});oe(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));oe(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(a=>a.isFieldValidating());const r=t.map(ut);return n.some(a=>{const i=a.getNamePath();return cr(r,i)&&a.isFieldValidating()})});oe(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));oe(this,"resetWithFieldInitialValue",(t={})=>{const n=new nr,r=this.getFieldEntities(!0);r.forEach(o=>{const{initialValue:l}=o.props,u=o.getNamePath();if(l!==void 0){const m=n.get(u)||new Set;m.add({entity:o,value:l}),n.set(u,m)}});const a=o=>{o.forEach(l=>{const{initialValue:u}=l.props;if(u!==void 0){const m=l.getNamePath();if(this.getInitialValue(m)!==void 0)st(!1,`Form already set 'initialValues' with path '${m.join(".")}'. Field can not overwrite it.`);else{const f=n.get(m);if(f&&f.size>1)st(!1,`Multiple Field with path '${m.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(f){const h=this.getFieldValue(m);!l.isListField()&&(!t.skipExist||h===void 0)&&this.updateStore(Qe(this.store,m,[...f][0].value))}}}})};let i;t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach(o=>{const l=n.get(o);l&&i.push(...[...l].map(u=>u.entity))})):i=r,a(i)});oe(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(ar(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(ut);r.forEach(a=>{const i=this.getInitialValue(a);this.updateStore(Qe(this.store,a,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});oe(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(a=>{const{name:i,...o}=a,l=ut(i);r.push(l),"value"in o&&this.updateStore(Qe(this.store,l,o.value)),this.notifyObservers(n,[l],{type:"setField",data:a})}),this.notifyWatch(r)});oe(this,"getFields",()=>this.getFieldEntities(!0).map(r=>{const a=r.getNamePath(),o={...r.getMeta(),name:a,value:this.getFieldValue(a)};return Object.defineProperty(o,"originRCField",{value:!0}),o}));oe(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();Be(this.store,r)===void 0&&this.updateStore(Qe(this.store,r,n))}});oe(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);oe(this,"registerField",t=>{this.fieldEntities.push(t);const n=t.getNamePath();if(this.notifyWatch([n]),t.props.initialValue!==void 0){const r=this.store;this.resetWithFieldInitialValue({entities:[t],skipExist:!0}),this.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,a,i=[])=>{if(this.fieldEntities=this.fieldEntities.filter(o=>o!==t),!this.isMergedPreserve(a)&&(!r||i.length>1)){const o=r?void 0:this.getInitialValue(n);if(n.length&&this.getFieldValue(n)!==o&&this.fieldEntities.every(l=>!ca(l.getNamePath(),n))){const l=this.store;this.updateStore(Qe(l,n,o,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});oe(this,"dispatch",t=>{switch(t.type){case"updateValue":{const{namePath:n,value:r}=t;this.updateValue(n,r);break}case"validateField":{const{namePath:n,triggerName:r}=t;this.validateFields([n],{triggerName:r});break}}});oe(this,"notifyObservers",(t,n,r)=>{if(this.subscribable){const a={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:i})=>{i(t,n,a)})}else this.forceRootUpdate()});oe(this,"triggerDependenciesUpdate",(t,n)=>{const r=this.getDependencyChildrenFields(n);return r.length&&this.validateFields(r,{delayFrame:!0}),this.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[n,...r]}),r});oe(this,"updateValue",(t,n)=>{const r=ut(t),a=this.store;this.updateStore(Qe(this.store,r,n)),this.notifyObservers(a,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);const i=this.triggerDependenciesUpdate(a,r),{onValuesChange:o}=this.callbacks;if(o){const l=kc(this.store,[r]),u=this.getFieldsValue(),m=Qe(u,r,Be(l,r));o(l,m)}this.triggerOnFieldsChange([r,...i])});oe(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=ar(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});oe(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});oe(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],a=new nr;this.getFieldEntities().forEach(o=>{const{dependencies:l}=o.props;(l||[]).forEach(u=>{const m=ut(u);a.update(m,(g=new Set)=>(g.add(o),g))})});const i=o=>{(a.get(o)||new Set).forEach(u=>{if(!n.has(u)){n.add(u);const m=u.getNamePath();u.isFieldDirty()&&m.length&&(r.push(m),i(m))}})};return i(t),r});oe(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const a=this.getFields();if(n){const o=new nr;n.forEach(({name:l,errors:u})=>{o.set(l,u)}),a.forEach(l=>{l.errors=o.get(l.name)||l.errors})}const i=a.filter(({name:o})=>cr(t,o));i.length&&r(i,a)}});oe(this,"validateFields",(t,n)=>{this.warningUnhooked();let r,a;Array.isArray(t)||typeof t=="string"||typeof n=="string"?(r=t,a=n):a=t;const i=!!r,o=i?r.map(ut):[],l=[...o],u=[],m=String(Date.now()),g=new Set,{recursive:f,dirty:h}=a||{};this.getFieldEntities(!0).forEach(w=>{const v=w.getNamePath();if(i||((!w.isList()||!o.some(x=>ca(x,v,!0)))&&l.push(v),o.push(v)),!(!w.props.rules||!w.props.rules.length)&&!(h&&!w.isFieldDirty())&&(g.add(v.join(m)),!i||cr(o,v,f))){const x=w.validateRules({validateMessages:{...Ad,...this.validateMessages},...a});u.push(x.then(()=>({name:v,errors:[],warnings:[]})).catch(C=>{var T;const j=[],b=[];return(T=C.forEach)==null||T.call(C,({rule:{warningOnly:$},errors:E})=>{$?b.push(...E):j.push(...E)}),j.length?Promise.reject({name:v,errors:j,warnings:b}):{name:v,errors:j,warnings:b}}))}});const p=o0(u);this.lastValidatePromise=p,p.catch(w=>w).then(w=>{const v=w.map(({name:x})=>x);this.notifyObservers(this.store,v,{type:"validateFinish"}),this.triggerOnFieldsChange(v,w)});const S=p.then(()=>this.lastValidatePromise===p?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(w=>{var C,j;const v=w.filter(b=>b&&b.errors.length),x=(j=(C=v[0])==null?void 0:C.errors)==null?void 0:j[0];return Promise.reject({message:x,values:this.getFieldsValue(o),errorFields:v,outOfDate:this.lastValidatePromise!==p})});S.catch(w=>w);const y=o.filter(w=>g.has(w.join(m)));return this.triggerOnFieldsChange(y),S});oe(this,"submit",()=>{this.warningUnhooked(),this.validateFields().then(t=>{const{onFinish:n}=this.callbacks;if(n)try{n(t)}catch(r){console.error(r)}}).catch(t=>{const{onFinishFailed:n}=this.callbacks;n&&n(t)})});this.forceRootUpdate=t}}function Pd(e){const t=be.useRef(null),[,n]=be.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},a=new l0(r);t.current=a.getForm()}return[t.current]}const Zi=be.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),c0=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const a=be.useContext(Zi),i=be.useRef({});return be.createElement(Zi.Provider,{value:{...a,validateMessages:{...a.validateMessages,...e},triggerFormChange:(o,l)=>{t&&t(o,{changedFields:l,forms:i.current}),a.triggerFormChange(o,l)},triggerFormFinish:(o,l)=>{n&&n(o,{values:l,forms:i.current}),a.triggerFormFinish(o,l)},registerForm:(o,l)=>{o&&(i.current={...i.current,[o]:l}),a.registerForm(o,l)},unregisterForm:o=>{const l={...i.current};delete l[o],i.current=l,a.unregisterForm(o)}}},r)};function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ji.apply(this,arguments)}const u0=(e,t)=>{const{name:n,initialValues:r,fields:a,form:i,preserve:o,children:l,component:u="form",validateMessages:m,validateTrigger:g="onChange",onValuesChange:f,onFieldsChange:h,onFinish:p,onFinishFailed:S,clearOnDestroy:y,...w}=e,v=be.useRef(null),x=be.useContext(Zi),[C]=Pd(i),{useSubscribe:j,setInitialValues:b,setCallbacks:T,setValidateMessages:$,setPreserve:E,destroyForm:R}=C.getInternalHooks(Pn);be.useImperativeHandle(t,()=>({...C,nativeElement:v.current})),be.useEffect(()=>(x.registerForm(n,C),()=>{x.unregisterForm(n)}),[x,C,n]),$({...x.validateMessages,...m}),T({onValuesChange:f,onFieldsChange:(F,...D)=>{x.triggerFormChange(n,F),h&&h(F,...D)},onFinish:F=>{x.triggerFormFinish(n,F),p&&p(F)},onFinishFailed:S}),E(o);const I=be.useRef(null);b(r,!I.current),I.current||(I.current=!0),be.useEffect(()=>()=>R(y),[]);let M;const Y=typeof l=="function";if(Y){const F=C.getFieldsValue(!0);M=l(F,C)}else M=l;j(!Y);const U=be.useRef(null);be.useEffect(()=>{n0(U.current||[],a||[])||C.setFields(a||[]),U.current=a},[a,C]);const A=be.useMemo(()=>({...C,validateTrigger:g}),[C,g]),k=be.createElement(la.Provider,{value:null},be.createElement(Hn.Provider,{value:A},M));return u===!1?k:be.createElement(u,Ji({},w,{ref:v,onSubmit:F=>{F.preventDefault(),F.stopPropagation(),C.submit()},onReset:F=>{var D;F.preventDefault(),C.resetFields(),(D=w.onReset)==null||D.call(w,F)}}),k)};function si(e){try{return JSON.stringify(e)}catch{return Math.random()}}function d0(...e){const[t,n={}]=e,r=jj(n)?{form:n}:n,a=r.form,[i,o]=d.useState(()=>typeof t=="function"?t({}):void 0),l=d.useMemo(()=>si(i),[i]),u=d.useRef(l);u.current=l;const m=d.useContext(Hn),g=a||m,f=g&&g._init;process.env.NODE_ENV!=="production"&&st(e.length===2?a?f:!0:f,"useWatch requires a form instance since it can not auto detect from context.");const{getFieldsValue:h,getInternalHooks:p}=g,{registerWatch:S}=p(Pn),y=eu((v,x)=>{const C=r.preserve?x??h(!0):v??h(),j=typeof t=="function"?t(C):Be(C,ut(t));si(i)!==si(j)&&o(j)}),w=typeof t=="function"?t:JSON.stringify(t);return d.useEffect(()=>{f&&y()},[f,w]),d.useEffect(()=>f?S((x,C)=>{y(x,C)}):void 0,[f]),i}const f0=be.forwardRef(u0),rs=f0;rs.FormProvider=c0;rs.Field=Dd;rs.List=i0;rs.useForm=Pd;rs.useWatch=d0;const wr=d.createContext({}),ss=d.createContext({mode:"edit"}),m0=e=>Array.isArray(e)?e:typeof e=="function"?[e]:Tn(e),h0=e=>{var ue,pe,me;const{creatorButtonProps:t,deleteIconProps:n,copyIconProps:r,arrowSort:a,upIconProps:i,downIconProps:o,itemContainerRender:l,itemRender:u,alwaysShowItemLabel:m,prefixCls:g,creatorRecord:f,action:h,actionGuard:p,children:S,actionRender:y,fields:w,meta:v,field:x,index:C,formInstance:j,originName:b,containerClassName:T,containerStyle:$,min:E,max:R,count:I,...M}=e,{hashId:Y}=d.useContext(Xt),{componentSize:U}=((pe=(ue=c.ConfigProvider).useConfig)==null?void 0:pe.call(ue))||{componentSize:"middle"},A=d.useContext(gr),k=d.useRef(!1),{mode:F}=d.useContext(ss),[D,O]=d.useState(!1),[B,q]=d.useState(!1);d.useEffect(()=>()=>{k.current=!0},[]);const z=()=>j.getFieldValue([A.listName,b,C==null?void 0:C.toString()].flat(1).filter(fe=>fe!=null)),V={getCurrentRowData:z,setCurrentRowData:fe=>{var Ae;const ye=((Ae=j==null?void 0:j.getFieldsValue)==null?void 0:Ae.call(j))||{},Te=[A.listName,b,C==null?void 0:C.toString()].flat(1).filter(ze=>ze!=null),Oe=Qe(ye,Te,{...z(),...fe||{}});return j.setFieldsValue(Oe)}},Z=m0(S).map(fe=>typeof fe=="function"?fe==null?void 0:fe(x,C,{...h,...V},I):fe).map((fe,ye)=>{var Te;return d.isValidElement(fe)?d.cloneElement(fe,{key:fe.key||((Te=fe==null?void 0:fe.props)==null?void 0:Te.name)||ye,...(fe==null?void 0:fe.props)||{}}):fe}),G=d.useMemo(()=>{if(F==="read"||r===!1||R===I)return null;const{Icon:fe=de.CopyOutlined,tooltipText:ye}=r;return s.jsx(c.Tooltip,{title:ye,children:B?s.jsx(de.LoadingOutlined,{}):s.jsx(fe,{className:ie(`${g}-action-icon action-copy`,Y),onClick:async()=>{q(!0);const Te=j==null?void 0:j.getFieldValue([A.listName,b,x.name].filter(Oe=>Oe!==void 0).flat(1));await h.add(Te,I),q(!1)}})},"copy")},[r,R,I,B,g,Y,j,A.listName,x.name,b,h]),H=d.useMemo(()=>{if(F==="read"||n===!1||E===I)return null;const{Icon:fe=de.DeleteOutlined,tooltipText:ye}=n;return s.jsx(c.Tooltip,{title:ye,children:D?s.jsx(de.LoadingOutlined,{}):s.jsx(fe,{className:ie(`${g}-action-icon action-remove`,Y),onClick:async()=>{O(!0),await h.remove(x.name),k.current||O(!1)}})},"delete")},[n,E,I,D,g,Y,h,x.name]),L=d.useMemo(()=>{if(!a||F==="read"||i===!1)return null;const fe=C-1;if(fe<0)return null;const{Icon:ye=de.ArrowUpOutlined,tooltipText:Te}=i;return s.jsx(c.Tooltip,{title:Te,children:s.jsx(ye,{className:ie(`${g}-action-icon action-up`,Y),onClick:async()=>{await h.move(C,fe)}})},"up")},[i,g,Y,h,a]),K=d.useMemo(()=>{if(!a||F==="read"||o===!1)return null;const fe=C+1;if(fe>=I)return null;const{Icon:ye=de.ArrowDownOutlined,tooltipText:Te}=o;return s.jsx(c.Tooltip,{title:Te,children:s.jsx(ye,{className:ie(`${g}-action-icon action-down`,Y),onClick:async()=>{await h.move(C,fe)}})},"down")},[i,g,Y,h,a]),P=d.useMemo(()=>[G,H,L,K].filter(fe=>fe!=null),[G,H,L,K]),W=(y==null?void 0:y(x,h,P,I))||P,te=W.length>0&&F!=="read"?s.jsx("div",{className:ie(`${g}-action`,{[`${g}-action-small`]:U==="small"},Y),children:W}):null,re={name:M.name,field:x,index:C,record:(me=j==null?void 0:j.getFieldValue)==null?void 0:me.call(j,[A.listName,b,x.name].filter(fe=>fe!==void 0).flat(1)),fields:w,operation:h,meta:v},{grid:X}=Cr(),se=(l==null?void 0:l(Z,re))||Z,ae=(u==null?void 0:u({listDom:s.jsx("div",{className:ie(`${g}-container`,T,Y),style:{width:X?"100%":void 0,...$},children:se}),action:te},re))||s.jsxs("div",{className:ie(`${g}-item`,Y,{[`${g}-item-default`]:m===void 0,[`${g}-item-show-label`]:m}),style:{display:"flex",alignItems:"flex-end"},children:[s.jsx("div",{className:ie(`${g}-container`,T,Y),style:{width:X?"100%":void 0,...$},children:se}),te]});return s.jsx(gr.Provider,{value:{...x,listName:[A.listName,b,x.name].filter(fe=>fe!==void 0).flat(1)},children:ae})},g0=e=>{const t=Ne(),{creatorButtonProps:n,prefixCls:r,children:a,creatorRecord:i,action:o,fields:l,actionGuard:u,max:m,fieldExtraRender:g,meta:f,containerClassName:h,containerStyle:p,onAfterAdd:S,onAfterRemove:y}=e,{hashId:w}=d.useContext(Xt),v=d.useRef(new Map),[x,C]=d.useState(!1),j=d.useMemo(()=>l.map(I=>{var Y,U,A;(Y=v.current)!=null&&Y.has(I.key.toString())||(U=v.current)==null||U.set(I.key.toString(),Gr());const M=(A=v.current)==null?void 0:A.get(I.key.toString());return{...I,uuid:M}}),[l]),b=d.useMemo(()=>{const I={...o},M=j.length;return u!=null&&u.beforeAddRow?I.add=async(...Y)=>{if(await u.beforeAddRow(...Y,M)){const A=o.add(...Y);return S==null||S(...Y,M+1),A}return!1}:I.add=async(...Y)=>{const U=o.add(...Y);return S==null||S(...Y,M+1),U},u!=null&&u.beforeRemoveRow?I.remove=async(...Y)=>{if(await u.beforeRemoveRow(...Y,M)){const A=o.remove(...Y);return y==null||y(...Y,M-1),A}return!1}:I.remove=async(...Y)=>{const U=o.remove(...Y);return y==null||y(...Y,M-1),U},I},[o,u==null?void 0:u.beforeAddRow,u==null?void 0:u.beforeRemoveRow,S,y,j.length]),T=d.useMemo(()=>{if(n===!1||j.length===m)return null;const{position:I="bottom",creatorButtonText:M=t.getMessage("editableTable.action.add","添加一行数据")}=n||{};return s.jsx(c.Button,{className:ie(`${r}-creator-button-${I}`,w),type:"dashed",loading:x,block:!0,icon:s.jsx(de.PlusOutlined,{}),...Ze(n||{},["position","creatorButtonText"]),onClick:async()=>{C(!0);let Y=j.length;I==="top"&&(Y=0),await b.add(vt(i)??{},Y),C(!1)},children:M})},[n,j.length,m,t,r,w,x,b,i]),$=d.useContext(ss),E={width:"max-content",maxWidth:"100%",minWidth:"100%",...p},R=d.useMemo(()=>j.map((I,M)=>d.createElement(h0,{...e,key:I.uuid,field:I,index:M,action:b,count:j.length},a)),[a,e,j,b]);return $.mode==="read"||e.readonly===!0?s.jsx(s.Fragment,{children:R}):s.jsxs("div",{style:E,className:h,children:[n!==!1&&(n==null?void 0:n.position)==="top"&&T,R,g&&g(b,f),n!==!1&&(n==null?void 0:n.position)!=="top"&&T]})},p0=e=>({[`${e.antCls}-pro`]:{[`${e.antCls}-form:not(${e.antCls}-form-horizontal)`]:{[e.componentCls]:{[`&-item:not(${e.componentCls}-item-show-label)`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},[e.componentCls]:{boxSizing:"border-box",maxWidth:"100%","&-item":{"&&-show-label":{[`${e.antCls}-form-item-label`]:{display:"inline-block"}},"&&-default:first-child":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"inline-block"}}}},"&&-default:not(:first-child)":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},"&-action":{display:"flex",height:e.controlHeight,marginBlockEnd:e.marginLG,lineHeight:e.controlHeight+"px","&-small":{height:e.controlHeightSM,lineHeight:e.controlHeightSM}},"&-action-icon":{marginInlineStart:8,cursor:"pointer",transition:"color 0.3s ease-in-out","&:hover":{color:e.colorPrimaryTextHover}},[`${e.proComponentsCls}-card ${e.proComponentsCls}-card-extra`]:{[e.componentCls]:{"&-action":{marginBlockEnd:0}}},"&-creator-button-top":{marginBlockEnd:24}}});function y0(e){return tt("ProFormList",t=>{const n={...t,componentCls:`.${e}`};return[p0(n)]})}const{noteOnce:Dc}=st,gr=d.createContext({});function x0(e){const t=d.useRef(),n=d.useContext(c.ConfigProvider.ConfigContext),r=d.useContext(gr),a=n.getPrefixCls("pro-form-list"),i=Ne(),{setFieldValueType:o}=d.useContext(wr),{transform:l,actionRender:u,creatorButtonProps:m,label:g,alwaysShowItemLabel:f,tooltip:h,creatorRecord:p,itemRender:S,rules:y,itemContainerRender:w,fieldExtraRender:v,copyIconProps:x={Icon:de.CopyOutlined,tooltipText:i.getMessage("copyThisLine","复制此项")},children:C,deleteIconProps:j={Icon:de.DeleteOutlined,tooltipText:i.getMessage("deleteThisLine","删除此项")},arrowSort:b,upIconProps:T={Icon:de.ArrowUpOutlined,tooltipText:i.getMessage("sortUpThisLine","向上排序")},downIconProps:$={Icon:de.ArrowDownOutlined,tooltipText:i.getMessage("sortDownThisLine","向下排序")},actionRef:E,style:R,prefixCls:I,actionGuard:M,min:Y,max:U,colProps:A,wrapperCol:k,rowProps:F,onAfterAdd:D,onAfterRemove:O,isValidateList:B=!1,emptyListMessage:q="列表不能为空",className:z,containerClassName:V,containerStyle:Z,readonly:G,...H}=e,{ColWrapper:L,RowWrapper:K}=Cr({colProps:A,rowProps:F}),P=d.useContext(es),W=d.useMemo(()=>r.name===void 0?[H.name].flat(1):[r.name,H.name].flat(1),[r.name,H.name]);d.useImperativeHandle(E,()=>({...t.current,get:X=>P.formRef.current.getFieldValue([...W,X]),getList:()=>P.formRef.current.getFieldValue([...W])}),[W,P.formRef]),d.useEffect(()=>{Dc(!!P.formRef,"ProFormList 必须要放到 ProForm 中,否则会造成行为异常。"),Dc(!!P.formRef,"Proformlist must be placed in ProForm, otherwise it will cause abnormal behavior.")},[P.formRef]),d.useEffect(()=>{!o||!e.name||o([e.name].flat(1).filter(X=>X!==void 0),{valueType:"formList",transform:l})},[e.name,o,l]);const{wrapSSR:te,hashId:re}=y0(a);return P.formRef?te(s.jsx(L,{children:s.jsx("div",{className:ie(a,re),style:R,children:s.jsx(c.Form.Item,{label:g,prefixCls:I,tooltip:h,style:R,required:y==null?void 0:y.some(X=>X.required),wrapperCol:k,className:z,...H,name:B?W:void 0,rules:B?[{validator:(X,se)=>!se||se.length===0?Promise.reject(new Error(q)):Promise.resolve(),required:!0}]:void 0,children:s.jsx(c.Form.List,{rules:y,...H,name:W,children:(X,se,ae)=>(t.current=se,s.jsxs(K,{children:[s.jsx(g0,{name:W,readonly:!!G,originName:H.name,copyIconProps:x,deleteIconProps:j,arrowSort:b,upIconProps:T,downIconProps:$,formInstance:P.formRef.current,prefixCls:a,meta:ae,fields:X,itemContainerRender:w,itemRender:S,fieldExtraRender:v,creatorButtonProps:m,creatorRecord:p,actionRender:u,action:se,actionGuard:M,alwaysShowItemLabel:f,min:Y,max:U,count:X.length,onAfterAdd:(ue,pe,me)=>{B&&P.formRef.current.validateFields([W]),D==null||D(ue,pe,me)},onAfterRemove:(ue,pe)=>{B&&pe===0&&P.formRef.current.validateFields([W]),O==null||O(ue,pe)},containerClassName:V,containerStyle:Z,children:C}),s.jsx(c.Form.ErrorList,{errors:ae.errors})]}))})})})})):null}const wa=({name:e,originDependencies:t=e,children:n,ignoreFormListField:r,...a})=>{const i=d.useContext(es),o=d.useContext(gr),l=d.useMemo(()=>e.map(u=>{var g;const m=[u];return!r&&o.name!==void 0&&((g=o.listName)!=null&&g.length)&&m.unshift(o.listName),m.flat(1)}),[o.listName,o.name,r,e==null?void 0:e.toString()]);return s.jsx(c.Form.Item,{...a,noStyle:!0,shouldUpdate:(u,m,g)=>{var f;return typeof a.shouldUpdate=="boolean"?a.shouldUpdate:typeof a.shouldUpdate=="function"?(f=a.shouldUpdate)==null?void 0:f.call(a,u,m,g):l.some(h=>!vn(Be(u,h),Be(m,h)))},children:u=>{var g,f;let m={};for(let h=0;h<e.length;h++){const p=l[h],S=t[h];let y=(g=i.getFieldFormatValueObject)==null?void 0:g.call(i,p);y&&Object.keys(y).length?(m=aa({},m,y),Be(y,p)&&(m=Qe(m,[S].flat(1),Be(y,p)))):(y=(f=u.getFieldValue)==null?void 0:f.call(u,p),typeof y<"u"&&(m=Qe(m,[S].flat(1),y)))}return n==null?void 0:n(m,{...u,...i})}})};wa.displayName="ProFormDependency";const b0=d.createContext({}),S0=e=>{var v,x,C;const{children:t,onChange:n,onBlur:r,ignoreFormItem:a,valuePropName:i="value",...o}=e,l=((v=t==null?void 0:t.type)==null?void 0:v.displayName)!=="ProFormComponent",u=!d.isValidElement(t),m=je(function(...j){var b,T,$,E,R;n==null||n(...j),!l&&(u||((T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...j),(R=(E=($=t==null?void 0:t.props)==null?void 0:$.fieldProps)==null?void 0:E.onChange)==null||R.call(E,...j)))}),g=je(function(...j){var b,T,$,E,R;l||u||(r==null||r(...j),(T=(b=t==null?void 0:t.props)==null?void 0:b.onBlur)==null||T.call(b,...j),(R=(E=($=t==null?void 0:t.props)==null?void 0:$.fieldProps)==null?void 0:E.onBlur)==null||R.call(E,...j))}),f=St(()=>{var j;return Ze(((j=t==null?void 0:t.props)==null?void 0:j.fieldProps)||{},["onBlur","onChange"])},[Ze(((x=t==null?void 0:t.props)==null?void 0:x.fieldProps)||{},["onBlur","onChange"])]),h=e[i],p=d.useMemo(()=>{if(!l&&!u)return xt({id:o.id,[i]:h,...f,onBlur:g,onChange:m})},[h,f,g,m,o.id,i]),S=d.useMemo(()=>{if(!p&&d.isValidElement(t))return(...j)=>{var b,T;n==null||n(...j),(T=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||T.call(b,...j)}},[p,t,n]);if(!d.isValidElement(t))return s.jsx(s.Fragment,{children:t});const y=o.variant,w=o.fieldProps;return d.cloneElement(t,xt({...o,[i]:e[i],...t.props,onChange:S,...!l&&p?{fieldProps:{...(C=t.props)==null?void 0:C.fieldProps,...w,...p}}:{},...y!==void 0&&{variant:y},onBlur:l&&!u&&typeof r=="function"?r:void 0}))},Pc=({children:e,addonAfter:t,addonBefore:n,valuePropName:r,addonWarpStyle:a,convertValue:i,help:o,...l})=>{const u=d.useMemo(()=>{let m=g=>{const f=(i==null?void 0:i(g,l.name))??g;return l.getValueProps?l.getValueProps(f):{[r||"value"]:f}};return!i&&!l.getValueProps&&(m=void 0),!t&&!n?s.jsx(c.Form.Item,{...l,valuePropName:r,getValueProps:m,children:e}):s.jsx(c.Form.Item,{...l,help:typeof o!="function"?o:void 0,valuePropName:r,_internalItemRender:{mark:"pro_table_render",render:(g,f)=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",...a},children:[n?s.jsx("div",{style:{marginInlineEnd:8},children:n}):null,f.input,t?s.jsx("div",{style:{marginInlineStart:8},children:t}):null]}),typeof o=="function"?o({errors:g.errors,warnings:g.warnings}):f.errorList,f.extra]})},...l,getValueProps:m,children:e})},[t,n,e,i==null?void 0:i.toString(),l]);return s.jsx(b0.Provider,{value:{name:l.name,label:l.label},children:u})},Nd=e=>{var j,b,T,$,E,R;const{componentSize:t}=((b=(j=c.ConfigProvider)==null?void 0:j.useConfig)==null?void 0:b.call(j))||{componentSize:"middle"},n=t,{valueType:r,transform:a,dataFormat:i,ignoreFormItem:o,lightProps:l,children:u,fieldProps:m,...g}=e,f=d.useContext(gr),h=d.useMemo(()=>e.name===void 0?e.name:f.name!==void 0?[f.name,e.name].flat(1):Array.isArray(e.name)?e.name:[e.name],[f.name,e.name]),{setFieldValueType:p,formItemProps:S}=d.useContext(wr);d.useEffect(()=>{!p||!e.name||p(h,{valueType:r||"text",dateFormat:i,transform:a})},[h,i,e.name,p,a,r]);const y=d.isValidElement(e.children)&&Hp(r||e.children.props.valueType),w=d.useMemo(()=>!!(!(l!=null&&l.light)||l!=null&&l.customLightMode||y),[l==null?void 0:l.customLightMode,y,l==null?void 0:l.light]);if(typeof e.children=="function")return d.createElement(Pc,{...g,name:h,key:g.proFormFieldKey||((T=g.name)==null?void 0:T.toString())},e.children);const v=s.jsx(S0,{valuePropName:e.valuePropName,children:e.children},g.proFormFieldKey||(($=g.name)==null?void 0:$.toString())),x=xt(l||{}),C=w?v:d.createElement(I0,{...x,key:g.proFormFieldKey||((E=g.name)==null?void 0:E.toString()),size:n},v);return o?s.jsx(s.Fragment,{children:C}):s.jsx(Pc,{...S,...g,name:h,isListField:f.name!==void 0,children:C},g.proFormFieldKey||((R=g.name)==null?void 0:R.toString()))},Nc={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},C0=["switch","radioButton","radio","rate"];function ur(e,t){e.displayName="ProFormComponent";const n=a=>{const{valueType:i,customLightMode:o,lightFilterLabelFormatter:l,valuePropName:u="value",ignoreWidth:m,defaultProps:g,...f}={...a==null?void 0:a.fieldConfig,...t},{label:h,tooltip:p,placeholder:S,width:y,bordered:w,messageVariables:v,ignoreFormItem:x,transform:C,convertValue:j,readonly:b,allowClear:T,colSize:$,getFormItemProps:E,getFieldProps:R,fieldConfig:I,cacheForSwr:M,proFieldProps:Y,...U}={...g,...a},A=i||U.valueType,k=d.useMemo(()=>m||C0.includes(A),[m,A]),[,F]=d.useState(),[D,O]=d.useState(),B=d.useContext(wr),q=St(()=>({formItemProps:E==null?void 0:E(),fieldProps:R==null?void 0:R()}),[R,E,U.dependenciesValues,D]),z=St(()=>{const ue={...x?xt({value:U.value}):{},placeholder:S,disabled:a.disabled,...B.fieldProps,...q.fieldProps,...U.fieldProps};return ue.style=xt(ue==null?void 0:ue.style),ue},[x,U.value,U.fieldProps,S,a.disabled,B.fieldProps,q.fieldProps]),V=Jp(U),Z=St(()=>({...B.formItemProps,...V,...q.formItemProps,...U.formItemProps}),[q.formItemProps,B.formItemProps,U.formItemProps,V]),G=St(()=>({messageVariables:v,...f,...Z}),[f,Z,v]),{prefixName:H}=d.useContext(Hn),L=St(()=>{let ue=G==null?void 0:G.name;return Array.isArray(ue)&&(ue=ue.join("_")),Array.isArray(H)&&ue&&(ue=`${H.join(".")}.${ue}`),ue&&`form-${B.formKey??""}-field-${ue}`},[wn(G==null?void 0:G.name),H,B.formKey]),K=je((...ue)=>{var pe;E||R?O([]):U.formItemRender&&F([]),(pe=z==null?void 0:z.onChange)==null||pe.call(z,...ue)}),P=St(()=>{const ue={width:y&&!Nc[y]?y:B.grid?"100%":void 0,...z==null?void 0:z.style};return k&&Reflect.deleteProperty(ue,"width"),xt(ue)},[wn(z==null?void 0:z.style),B.grid,k,y]),W=St(()=>{const ue=y&&Nc[y];return ie(z==null?void 0:z.className,{"pro-field":ue,[`pro-field-${y}`]:ue&&!k})||void 0},[y,z==null?void 0:z.className,k]),te=St(()=>xt({...B.proFieldProps,mode:U==null?void 0:U.mode,readonly:b,params:U.params,proFieldKey:L,cacheForSwr:M,...Y}),[B.proFieldProps,U==null?void 0:U.mode,U.params,b,L,M,Y]),re=St(()=>({onChange:K,allowClear:T,...z,style:P,className:W}),[T,W,K,z,P]),X=St(()=>s.jsx(e,{...U,fieldProps:re,proFieldProps:te,ref:a==null?void 0:a.fieldRef},a.proFormFieldKey||a.name),[te,re,U]),se=St(()=>{var ue,pe,me;return s.jsx(Nd,{label:h&&(Y==null?void 0:Y.light)!==!0?h:void 0,tooltip:(Y==null?void 0:Y.light)!==!0&&p,valuePropName:u,...G,ignoreFormItem:x,transform:C,dataFormat:z==null?void 0:z.format,valueType:A,messageVariables:{label:h||"",...G==null?void 0:G.messageVariables},convertValue:j,lightProps:xt({...z,variant:U.variant??(z==null?void 0:z.variant),valueType:A,bordered:w,allowClear:((ue=X==null?void 0:X.props)==null?void 0:ue.allowClear)??T,light:Y==null?void 0:Y.light,label:h,customLightMode:o,labelFormatter:l,valuePropName:u,footerRender:(pe=X==null?void 0:X.props)==null?void 0:pe.footerRender,...U.lightProps,...G.lightProps}),children:X},a.proFormFieldKey||((me=G.name)==null?void 0:me.toString()))},[h,Y==null?void 0:Y.light,p,u,a.proFormFieldKey,G,x,C,z,A,j,w,X,T,o,l,U.lightProps]),{ColWrapper:ae}=Cr(U);return s.jsx(ae,{children:se})};return a=>{const{dependencies:i}=a;return i?s.jsx(wa,{name:i,originDependencies:a==null?void 0:a.originDependencies,children:o=>s.jsx(n,{dependenciesValues:o,dependencies:i,...a})}):s.jsx(n,{dependencies:i,...a})}}var Yr=function(){return Yr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Yr.apply(this,arguments)};function w0(e){var t,n=(typeof window<"u"?window:{}).URL,r=new n((t=window==null?void 0:window.location)===null||t===void 0?void 0:t.href);return Object.keys(e).forEach(function(a){var i=e[a];i!=null?Array.isArray(i)?(r.searchParams.delete(a),i.forEach(function(o){r.searchParams.append(a,o)})):i instanceof Date?Number.isNaN(i.getTime())||r.searchParams.set(a,i.toISOString()):typeof i=="object"?r.searchParams.set(a,JSON.stringify(i)):r.searchParams.set(a,i):r.searchParams.delete(a)}),r}function j0(e,t){var n;e===void 0&&(e={}),t===void 0&&(t={disabled:!1});var r=d.useState(),a=r[1],i=typeof window<"u"&&((n=window==null?void 0:window.location)===null||n===void 0?void 0:n.search),o=d.useMemo(function(){return t.disabled?{}:new URLSearchParams(i||{})},[t.disabled,i]),l=d.useMemo(function(){if(t.disabled)return{};if(typeof window>"u"||!window.URL)return{};var g=[];o.forEach(function(h,p){g.push({key:p,value:h})}),g=g.reduce(function(h,p){return(h[p.key]=h[p.key]||[]).push(p),h},{}),g=Object.keys(g).map(function(h){var p=g[h];return p.length===1?[h,p[0].value]:[h,p.map(function(S){var y=S.value;return y})]});var f=Yr({},e);return g.forEach(function(h){var p=h[0],S=h[1];f[p]=T0(p,S,{},e)}),f},[t.disabled,e,o]);function u(g){if(!(typeof window>"u"||!window.URL)){var f=w0(g);window.location.search!==f.search&&window.history.replaceState({},"",f.toString()),o.toString()!==f.searchParams.toString()&&a({})}}d.useEffect(function(){t.disabled||typeof window>"u"||!window.URL||u(Yr(Yr({},e),l))},[t.disabled,l]);var m=function(g){u(g)};return d.useEffect(function(){if(t.disabled)return function(){};if(typeof window>"u"||!window.URL)return function(){};var g=function(){a({})};return window.addEventListener("popstate",g),function(){window.removeEventListener("popstate",g)}},[t.disabled]),[l,m]}var v0={true:!0,false:!1};function T0(e,t,n,r){if(!n)return t;var a=n[e],i=t===void 0?r[e]:t;return a===Number?Number(i):a===Boolean||t==="true"||t==="false"?v0[i]:Array.isArray(a)?a.find(function(o){return o==i})||r[e]:i}const F0=e=>{const t=Ne(),n=c.Form.useFormInstance();if(e.render===!1)return null;const{onSubmit:r,render:a,onReset:i,searchConfig:o={},submitButtonProps:l,resetButtonProps:u}=e,{token:m}=jn.useToken(),g=()=>{n.submit(),r==null||r()},f=()=>{n.resetFields(),i==null||i()},{submitText:h=t.getMessage("tableForm.submit","提交"),resetText:p=t.getMessage("tableForm.reset","重置")}=o,S=[];u!==!1&&S.push(d.createElement(c.Button,{...Ze(u??{},["preventDefault","fieldProps"]),key:"rest",onClick:w=>{var v;u!=null&&u.preventDefault||f(),(v=u==null?void 0:u.onClick)==null||v.call(u,w)}},p)),l!==!1&&S.push(d.createElement(c.Button,{type:"primary",...Ze(l||{},["preventDefault","fieldProps"]),key:"submit",onClick:w=>{var v;l!=null&&l.preventDefault||g(),(v=l==null?void 0:l.onClick)==null||v.call(l,w)}},h));const y=a?a({...e,form:n,submit:g,reset:f},S):S;return y?Array.isArray(y)?(y==null?void 0:y.length)<1?null:(y==null?void 0:y.length)===1?y[0]:s.jsx("div",{style:{display:"flex",gap:m.marginXS,alignItems:"center"},children:y}):y:null},{noteOnce:Lc}=st,Gs=(e,t,n)=>e===!0?t:vt(e,t,n),Ms=e=>!e||Array.isArray(e)?e:[e],Ld={};function $0(e){var B,q;const{children:t,contentRender:n,submitter:r,fieldProps:a,formItemProps:i,groupProps:o,transformKey:l,formRef:u,onInit:m,form:g,loading:f,formComponentType:h,extraUrlParams:p=Ld,syncToUrl:S,onUrlSearchChange:y,onReset:w,omitNil:v=!0,isKeyPressSubmit:x,autoFocusFirstInput:C=!0,grid:j,rowProps:b,colProps:T,...$}=e,E=c.Form.useFormInstance(),{componentSize:R}=((q=(B=c.ConfigProvider)==null?void 0:B.useConfig)==null?void 0:q.call(B))||{componentSize:"middle"},I=d.useRef(g||E),{RowWrapper:M}=Cr({grid:j,rowProps:b}),Y=je(()=>E),U=d.useMemo(()=>({getFieldsFormatValue:(z,V)=>{const Z=Y();if(!Z)return{};const G=Z.getFieldsValue(z);return l(G,V!==void 0?V:v)},getFieldFormatValue:(z=[],V)=>{const Z=Y();if(!Z)return;const G=Ms(z);if(!G)throw new Error("nameList is require");const H=Z.getFieldValue(G),L=G?Qe({},G,H):H,K=[...G];K.shift();const P=l(L,V!==void 0?V:v,K),W=Be(P,G);if(W&&typeof W=="object"&&!Array.isArray(W)){const te=Object.values(W)[0];return Array.isArray(te),te}return W},getFieldFormatValueObject:(z,V)=>{const Z=Y();if(!Z)return{};const G=Ms(z),H=Z.getFieldValue(G),L=G?Qe({},G,H):H;return l(L,V!==void 0?V:v,G)},validateFieldsReturnFormatValue:async(z,V)=>{const Z=Y();if(!Z)return{};if(!Array.isArray(z)&&z)throw new Error("nameList must be array");const G=await Z.validateFields(z),H=l(G,V!==void 0?V:v);return H||{}}}),[v,l,Y]),A=d.useMemo(()=>d.Children.toArray(t).map((z,V)=>V===0&&d.isValidElement(z)&&C?mo(z,C):z),[C,t]),k=d.useMemo(()=>typeof r=="boolean"||!r?{}:r,[r]),F=d.useMemo(()=>{if(r!==!1)return s.jsx(F0,{...k,onReset:()=>{var V,Z,G;const z=l((V=I.current)==null?void 0:V.getFieldsValue(),v);if((Z=k==null?void 0:k.onReset)==null||Z.call(k,z),w==null||w(z),S){const H=Object.keys(l((G=I.current)==null?void 0:G.getFieldsValue(),!1)).reduce((L,K)=>({...L,[K]:z[K]||void 0}),p);y(Gs(S,H||{},"set"))}},submitButtonProps:{loading:f,...k.submitButtonProps}},"submitter")},[r,k,f,l,v,w,S,p,y]),D=d.useMemo(()=>{const z=j?s.jsx(M,{children:A}):A;return n?n(z,F,I.current):z},[j,M,A,n,F]),O=Vr(e.initialValues);return d.useEffect(()=>{if(S||!e.initialValues||!O||$.request)return;const z=vn(e.initialValues,O);Lc(z,"initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null "),Lc(z,"The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null ")},[e.initialValues]),d.useImperativeHandle(u,()=>({...I.current,getFieldsFormatValue:(z,V)=>{const Z=I.current;if(!Z)return{};const G=Z.getFieldsValue(z);return l(G,V!==void 0?V:v)},getFieldFormatValue:(z=[],V)=>{const Z=I.current;if(!Z)return;const G=Ms(z);if(!G)throw new Error("nameList is require");const H=Z.getFieldValue(G),L=G?Qe({},G,H):H,K=[...G];K.shift();const P=l(L,V!==void 0?V:v,K),W=Be(P,G);if(W&&typeof W=="object"&&!Array.isArray(W)){const te=Object.values(W)[0];return Array.isArray(te),te}return W},getFieldFormatValueObject:(z,V)=>{const Z=I.current;if(!Z)return{};const G=Ms(z),H=Z.getFieldValue(G),L=G?Qe({},G,H):H;return l(L,V!==void 0?V:v,G)},validateFieldsReturnFormatValue:async(z,V)=>{const Z=I.current;if(!Z)return{};if(!Array.isArray(z)&&z)throw new Error("nameList must be array");const G=await Z.validateFields(z),H=l(G,V!==void 0?V:v);return H||{}}}),[v,l,I.current]),d.useEffect(()=>{var V,Z;const z=l((Z=(V=I.current)==null?void 0:V.getFieldsValue)==null?void 0:Z.call(V,!0),v);m==null||m(z,{...I.current,...U})},[]),s.jsx(es.Provider,{value:{...U,formRef:I},children:s.jsx(c.ConfigProvider,{componentSize:$.size||R,children:s.jsxs(To.Provider,{value:{grid:j,colProps:T},children:[$.component!==!1&&s.jsx("input",{type:"text",style:{display:"none"}}),D]})})})}let _c=0;function jr(e){const{extraUrlParams:t=Ld,syncToUrl:n,isKeyPressSubmit:r,syncToUrlAsImportant:a=!1,syncToInitialValues:i=!0,children:o,contentRender:l,submitter:u,fieldProps:m,proFieldProps:g,formItemProps:f,groupProps:h,dateFormatter:p="string",formRef:S,onInit:y,form:w,formComponentType:v,onReset:x,grid:C,rowProps:j,colProps:b,omitNil:T=!0,request:$,params:E,initialValues:R,formKey:I=_c,readonly:M,onLoadingChange:Y,loading:U,...A}=e,k=d.useRef({}),[F,D]=dt(!1,U),O=je(me=>{Y==null||Y(me)}),B=d.useCallback(me=>{D(fe=>{const ye=typeof me=="function"?me(fe):me;return queueMicrotask(()=>{O(ye)}),ye})},[O]),[q,z]=j0({},{disabled:!n}),V=d.useRef(Gr());d.useEffect(()=>{_c+=0},[]);const[Z,G]=_p({request:$,params:E,proFieldKey:I}),{getPrefixCls:H}=d.useContext(c.ConfigProvider.ConfigContext),L=H("pro-form"),{wrapSSR:K,hashId:P}=tt("ProForm",me=>({[`.${L}`]:{[`> div:not(${me.proComponentsCls}-form-light-filter)`]:{".pro-field":{maxWidth:"100%","@media screen and (max-width: 575px)":{maxWidth:"calc(93vw - 48px)"},"&-xs":{width:104},"&-s":{width:216},"&-sm":{width:216},"&-m":{width:328},"&-md":{width:328},"&-l":{width:440},"&-lg":{width:440},"&-xl":{width:552}}}}})),[W,te]=d.useState(()=>n?Gs(n,q,"get"):{}),re=d.useRef({}),X=d.useRef({}),se=je((me,fe,ye)=>!me||typeof me!="object"?me:LC(Mi(me,p,X.current,fe,ye),re.current));d.useEffect(()=>{i||te({})},[i]);const ae=je(()=>({...q,...t}));d.useEffect(()=>{n&&z(Gs(n,ae(),"set"))},[t,ae,n]);const ue=d.useMemo(()=>{if(!(typeof window>"u")&&v&&["DrawerForm"].includes(v))return me=>me.parentNode||document.body},[v]),pe=je(async()=>{var me,fe,ye,Te;if(A.onFinish&&!F)try{B(!0);const Oe=((fe=(me=k==null?void 0:k.current)==null?void 0:me.getFieldsFormatValue)==null?void 0:fe.call(me))||{},Ae=A.onFinish(Oe);if(Ae&&typeof Ae=="object"&&typeof Ae.then=="function"){try{await Ae}catch(ze){throw B(!1),ze}B(!1)}else B(!1);if(n){const ze=Object.keys(((Te=(ye=k==null?void 0:k.current)==null?void 0:ye.getFieldsFormatValue)==null?void 0:Te.call(ye,!0,!1))||{}).reduce((ce,_)=>({...ce,[_]:Oe[_]??void 0}),t);Object.keys(q).forEach(ce=>{ze[ce]!==!1&&ze[ce]!==0&&!ze[ce]&&(ze[ce]=void 0)}),z(Gs(n,ze,"set"))}}catch{B(!1)}});return d.useImperativeHandle(S,()=>k.current,[!Z]),$&&G?s.jsx("div",{style:{paddingTop:50,paddingBottom:50,textAlign:"center"},children:s.jsx(c.Spin,{})}):K(s.jsx(ss.Provider,{value:{mode:e.readonly?"read":"edit"},children:s.jsx(Bn,{needDeps:!0,children:s.jsx(wr.Provider,{value:{formRef:k,fieldProps:m,proFieldProps:g,formItemProps:f,groupProps:h,formComponentType:v,getPopupContainer:ue,formKey:V.current,setFieldValueType:(me,{valueType:fe="text",dateFormat:ye,transform:Te})=>{Array.isArray(me)&&(Te&&(re.current=Qe(re.current,me,Te)),X.current=Qe(X.current,me,{valueType:fe,dateFormat:ye}))}},children:s.jsx(gr.Provider,{value:{},children:s.jsx(c.Form,{onKeyDown:me=>{var fe;r&&me.key==="Enter"&&((fe=k.current)==null||fe.submit())},autoComplete:"off",form:w,...Ze(A,["ref","labelWidth","autoFocusFirstInput","rootClassName"]),ref:me=>{k.current&&(k.current.nativeElement=me==null?void 0:me.nativeElement,k.current.focus=()=>{var ye;const fe=(ye=me==null?void 0:me.nativeElement)==null?void 0:ye.querySelector("input, textarea, select");fe==null||fe.focus()})},initialValues:a?{...R,...Z,...W}:{...W,...R,...Z},onValuesChange:(me,fe)=>{var ye;(ye=A==null?void 0:A.onValuesChange)==null||ye.call(A,se(me,!!T),se(fe,!!T))},className:e.className,rootClassName:ie(L,P,e.rootClassName),onFinish:pe,children:s.jsx($0,{transformKey:se,autoComplete:"off",loading:F||!!($&&!Z&&G),onUrlSearchChange:z,...e,formRef:k,initialValues:{...R,...Z}})})})})})}))}const E0=e=>({[`${e.componentCls}-collapse-label`]:{boxSizing:"border-box",paddingInline:1,paddingBlock:1},[`${e.componentCls}-container`]:{boxSizing:"border-box",[`${e.antCls}-form-item`]:{marginBlockEnd:0}}});function R0(e){return tt("LightWrapper",t=>{const n={...t,componentCls:`.${e}`};return[E0(n)]})}const I0=e=>{var U;const{label:t,size:n,disabled:r,onChange:a,className:i,style:o,children:l,valuePropName:u,placeholder:m,labelFormatter:g,variant:f,footerRender:h,allowClear:p,otherFieldProps:S,valueType:y,placement:w,...v}=e,{getPrefixCls:x}=d.useContext(c.ConfigProvider.ConfigContext),C=x("pro-field-light-wrapper"),{wrapSSR:j,hashId:b}=R0(C),[T,$]=d.useState(e[u]),[E,R]=d.useState(!1),I=(...A)=>{var k;(k=S==null?void 0:S.onChange)==null||k.call(S,...A),a==null||a(...A)},M=e[u],Y=d.useMemo(()=>{var k;if(!M)return M;const A=(k=y==null?void 0:y.toLowerCase)==null?void 0:k.call(y);return A!=null&&A.endsWith("range")&&A!=="digitrange"&&!g?Ip(M,y&&ho[y]||"YYYY-MM-DD"):Array.isArray(M)?M.map(F=>typeof F=="object"&&F.label&&F.value?F.label:F):M},[M,y,g]);return j(s.jsx(Hu,{disabled:r,open:E,onOpenChange:R,placement:w,label:s.jsx(Qt,{ellipsis:!0,size:n,onClear:()=>{I==null||I(),$(null)},variant:f,style:o,className:i,label:t,placeholder:m,value:Y,disabled:r,formatter:g,allowClear:p}),footer:{onClear:()=>$(null),onConfirm:()=>{I==null||I(T),R(!1)}},footerRender:h,children:s.jsx("div",{className:ie(`${C}-container`,b,i),style:o,children:d.cloneElement(l,{...v,[u]:T,onChange:A=>{$(A!=null&&A.target?A.target.value:A)},...l.props,variant:"borderless",fieldProps:{...(U=l.props)==null?void 0:U.fieldProps,variant:"borderless"}})})}))},M0=e=>{const{fieldProps:t,children:n,labelCol:r,label:a,autoFocus:i,isDefaultDom:o,render:l,proFieldProps:u,formItemRender:m,valueType:g,initialValue:f,onChange:h,valueEnum:p,params:S,name:y,dependenciesValues:w,cacheForSwr:v=!1,valuePropName:x="value",...C}=e,j=d.useContext(ss),b=d.useMemo(()=>w&&C.request?{...S,...w||{}}:S,[w,S,C.request]),T=je((...R)=>{var I;if(t!=null&&t.onChange){(I=t==null?void 0:t.onChange)==null||I.call(t,...R);return}}),$=d.useMemo(()=>({autoFocus:i,...t,onChange:T}),[i,t,T]),E=d.useMemo(()=>{if(n)return d.isValidElement(n)?d.cloneElement(n,{...C,onChange:(...R)=>{var I;if(t!=null&&t.onChange){(I=t==null?void 0:t.onChange)==null||I.call(t,...R);return}h==null||h(...R)},...(n==null?void 0:n.props)||{}}):s.jsx(s.Fragment,{children:n})},[n,t==null?void 0:t.onChange,h,C]);return E||s.jsx(Cj,{text:t==null?void 0:t[x],render:l,formItemRender:m,valueType:g||"text",cacheForSwr:v,fieldProps:$,valueEnum:vt(p),...u,...C,mode:(u==null?void 0:u.mode)||j.mode||"edit",params:b})},En=ur==null?void 0:ur(M0),A0=({fieldProps:e,min:t,proFieldProps:n,max:r,...a},i)=>s.jsx(Bn,{valueTypeMap:{digit:{render:(o,l)=>s.jsx(ia,{...l,text:o,placeholder:l.placeholder}),formItemRender:(o,l)=>s.jsx(ia,{...l,text:o,placeholder:l.placeholder})}},children:s.jsx(En,{valueType:"digit",fieldProps:{min:t,max:r,...e},ref:i,fieldConfig:{defaultProps:{width:"100%"}},proFieldProps:n,...a})}),k0=d.forwardRef(A0),O0={space:c.Space,group:c.Space.Compact};function D0(e,...t){const n=t[0];return n&&n.target&&e in n.target?n.target[e]:n}const P0=e=>{const{children:t,value:n=[],valuePropName:r,onChange:a,fieldProps:i,space:o,type:l="space",transform:u,convertValue:m,lightProps:g,...f}=e,h=je((x,C)=>{var b;const j=[...n];j[C]=D0(r||"value",x),a==null||a(j),(b=i==null?void 0:i.onChange)==null||b.call(i,j)});let p=-1;const S=Tn(vt(t,n,e)).map(x=>{var C,j,b;if(d.isValidElement(x)){p+=1;const T=p,E=((C=x==null?void 0:x.type)==null?void 0:C.displayName)==="ProFormComponent"||((j=x==null?void 0:x.props)==null?void 0:j.readonly)?{key:T,ignoreFormItem:!0,...x.props||{},fieldProps:{...(b=x==null?void 0:x.props)==null?void 0:b.fieldProps,onChange:(...R)=>{h(R[0],T)}},value:n==null?void 0:n[T],onChange:void 0}:{key:T,...x.props||{},value:n==null?void 0:n[T],onChange:R=>{var I,M;h(R,T),(M=(I=x.props).onChange)==null||M.call(I,R)}};return d.cloneElement(x,E)}return x}),y=O0[l],{RowWrapper:w}=Cr(f),v=d.useCallback(({children:x})=>{const C={...o,align:"start"};return l==="space"&&(o==null?void 0:o.wrap)!==void 0&&(C.wrap=o.wrap),s.jsx(y,{...C,children:x})},[y,o,l]);return s.jsx(w,{Wrapper:v,children:S})},N0=d.forwardRef(({children:e,space:t,valuePropName:n,...r},a)=>(d.useImperativeHandle(a,()=>({})),s.jsx(P0,{space:t,valuePropName:n,...r.fieldProps,onChange:void 0,...r,children:e}))),L0=ur==null?void 0:ur(N0),_0=e=>({[e.componentCls]:{boxSizing:"border-box","&-title":{marginBlockEnd:e.marginXL,fontWeight:"bold"},"&-container":{flexWrap:"wrap",maxWidth:"100%",[`> div${e.antCls}-space-item`]:{maxWidth:"100%"}},"&-twoLine":{display:"block",width:"100%",[`${e.componentCls}-title`]:{width:"100%",margin:"8px 0"},[`${e.componentCls}-container`]:{paddingInlineStart:16},[`${e.antCls}-space-item,${e.antCls}-form-item`]:{width:"100%"},[`${e.antCls}-form-item`]:{"&-control":{display:"flex",alignItems:"center",justifyContent:"flex-end","&-input":{alignItems:"center",justifyContent:"flex-end","&-content":{flex:"none"}}}}}}});function z0(e){return tt("ProFormGroup",t=>{const n={...t,componentCls:`.${e}`};return[_0(n)]})}const _d=d.forwardRef((e,t)=>{const{groupProps:n}=d.useContext(wr),{children:r,collapsible:a,defaultCollapsed:i,style:o,labelLayout:l,title:u=e.label,tooltip:m,align:g="start",direction:f,size:h=32,titleStyle:p,titleRender:S,spaceProps:y,extra:w,autoFocus:v}={...n,...e},[x,C]=dt(()=>i||!1,e.collapsed),j=je(O=>{var B;(B=e.onCollapse)==null||B.call(e,O)}),b=d.useCallback(O=>{C(B=>{const q=typeof O=="function"?O(B):O;return queueMicrotask(()=>{j(q)}),q})},[j]),{getPrefixCls:T}=d.useContext(c.ConfigProvider.ConfigContext),{ColWrapper:$,RowWrapper:E}=Cr(e),R=T("pro-form-group"),{wrapSSR:I,hashId:M}=z0(R),Y=a&&s.jsx(de.RightOutlined,{style:{marginInlineEnd:8},rotate:x?void 0:90}),U=s.jsx(fr,{label:Y?s.jsxs("div",{children:[Y,u]}):u,tooltip:m}),A=d.useCallback(({children:O})=>s.jsx(c.Space,{...y,className:ie(`${R}-container ${M}`,y==null?void 0:y.className),size:h,align:g,orientation:f,style:{rowGap:0,...y==null?void 0:y.style},children:O}),[g,R,f,M,h,y]),k=S?S(U,e):U,[F,D]=d.useMemo(()=>{const O=[],B=d.Children.toArray(r).map((q,z)=>{var V;return d.isValidElement(q)&&((V=q==null?void 0:q.props)!=null&&V.hidden)?(O.push(q),null):z===0&&d.isValidElement(q)&&v?mo(q,v):q});return[s.jsx(E,{Wrapper:A,children:B},"children"),O.length>0?s.jsx("div",{style:{display:"none"},children:O},"hidden"):null]},[r,E,A,v]);return I(s.jsx($,{children:s.jsxs("div",{className:ie(R,M,{[`${R}-twoLine`]:l==="twoLine"}),style:o,ref:t,children:[D,(u||m||w)&&s.jsx("div",{role:"button",tabIndex:0,className:ie(`${R}-title`,M),style:p,onClick:()=>{b(!x)},onKeyDown:O=>{(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),b(!x))},children:w?s.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[k,s.jsx("span",{role:"presentation",onClick:O=>O.stopPropagation(),onKeyDown:O=>O.stopPropagation(),children:w})]}):k}),s.jsx("div",{style:{display:a&&x?"none":void 0},children:F})]})}))});_d.displayName="ProForm-Group";const B0=e=>({[e.componentCls]:{boxSizing:"border-box","&-sidebar-dragger":{width:"5px",cursor:"ew-resize",padding:"4px 0 0",borderTop:"1px solid transparent",position:"absolute",top:0,left:0,bottom:0,zIndex:100,backgroundColor:"transparent","&-min-disabled":{cursor:"w-resize"},"&-max-disabled":{cursor:"e-resize"}}}});function V0(e){return tt("DrawerForm",t=>{const n={...t,componentCls:`.${e}`};return[B0(n)]})}const{noteOnce:H0}=st;function Y0({children:e,trigger:t,drawerProps:n,onFinish:r,submitTimeout:a,title:i,width:o,resize:l,onOpenChange:u,open:m,...g}){var V,Z,G,H;H0(!g.footer||!(n!=null&&n.footer),"DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const f=d.useMemo(()=>{const L={onResize:()=>{},maxWidth:xo()?window.innerWidth*.8:void 0,minWidth:300};return typeof l=="boolean"?l?L:{}:xt({onResize:(l==null?void 0:l.onResize)??L.onResize,maxWidth:(l==null?void 0:l.maxWidth)??L.maxWidth,minWidth:(l==null?void 0:l.minWidth)??L.minWidth})},[l]),h=d.useContext(c.ConfigProvider.ConfigContext),p=h.getPrefixCls("pro-form-drawer"),{wrapSSR:S,hashId:y}=V0(p),w=L=>`${p}-${L}`,[,v]=d.useState([]),[x,C]=d.useState(!1),[j,b]=d.useState(!1),[T,$]=d.useState(o||(l?f==null?void 0:f.minWidth:800)),[E,R]=dt(!!m,m),I=je(L=>{u==null||u(L)}),M=d.useCallback(L=>{R(K=>{const P=typeof L=="function"?L(K):L;return queueMicrotask(()=>{I(P)}),P})},[I]),Y=d.useRef(null),U=d.useCallback(L=>{Y.current===null&&L&&v([]),Y.current=L},[]),A=d.useRef(),k=d.useCallback(()=>{var K;const L=((K=g.formRef)==null?void 0:K.current)??g.form??A.current;L&&(n!=null&&n.destroyOnHidden)&&typeof L.resetFields=="function"&&L.resetFields()},[n==null?void 0:n.destroyOnHidden,g.form,g.formRef]);d.useEffect(()=>{E&&m&&(u==null||u(!0)),j&&$(f==null?void 0:f.minWidth)},[m,E,j]),d.useImperativeHandle(g.formRef,()=>A.current,[A.current]);const F=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async L=>{var K,P;M(!E),b(!Object.keys(f)),(P=(K=t.props)==null?void 0:K.onClick)==null||P.call(K,L)}}):null,[M,t,E,b,j]),D=d.useMemo(()=>{var L,K,P,W;return g.submitter===!1?!1:ar({searchConfig:{submitText:((K=(L=h.locale)==null?void 0:L.Modal)==null?void 0:K.okText)??"确认",resetText:((W=(P=h.locale)==null?void 0:P.Modal)==null?void 0:W.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:a&&x,onClick:te=>{var re;M(!1),(re=n==null?void 0:n.onClose)==null||re.call(n,te)}}},g.submitter??{})},[g.submitter,(Z=(V=h.locale)==null?void 0:V.Modal)==null?void 0:Z.okText,(H=(G=h.locale)==null?void 0:G.Modal)==null?void 0:H.cancelText,a,x,M,n]),O=d.useCallback((L,K)=>s.jsxs(s.Fragment,{children:[L,Y.current&&K?s.jsx(d.Fragment,{children:Gc.createPortal(K,Y.current)},"submitter"):K]}),[]),B=je(async L=>{const K=r==null?void 0:r(L);if(a&&K instanceof Promise){C(!0);const W=setTimeout(()=>C(!1),a);try{const te=await K;return clearTimeout(W),C(!1),te&&M(!1),te}catch(te){throw clearTimeout(W),C(!1),te}}else if(a){C(!0);const W=setTimeout(()=>C(!1),a);try{const te=await K;return clearTimeout(W),C(!1),te&&M(!1),te}catch(te){throw clearTimeout(W),C(!1),te}}const P=await K;return P&&M(!1),P}),q=d.useCallback(L=>{const K=(document.body.offsetWidth||1e3)-(L.clientX-document.body.offsetLeft),P=(f==null?void 0:f.minWidth)??(o||800),W=(f==null?void 0:f.maxWidth)??window.innerWidth*.8;if(K<P){$(P);return}if(K>W){$(W);return}$(K)},[f==null?void 0:f.maxWidth,f==null?void 0:f.minWidth,o]),z=d.useCallback(()=>{document.removeEventListener("mousemove",q),document.removeEventListener("mouseup",z)},[q]);return S(s.jsxs(s.Fragment,{children:[s.jsxs(c.Drawer,{...n,destroyOnHidden:n==null?void 0:n.destroyOnHidden,title:i,size:T,open:E,afterOpenChange:L=>{var K;!L&&(n!=null&&n.destroyOnHidden)&&k(),(K=n==null?void 0:n.afterOpenChange)==null||K.call(n,L),u==null||u(L)},onClose:L=>{var K;a&&x||(M(!1),(K=n==null?void 0:n.onClose)==null||K.call(n,L))},footer:g.submitter!==!1&&s.jsx("div",{ref:U,style:{display:"flex",justifyContent:"flex-end"}}),children:[l?s.jsx("div",{className:ie(w("sidebar-dragger"),y,{[w("sidebar-dragger-min-disabled")]:T===(f==null?void 0:f.minWidth),[w("sidebar-dragger-max-disabled")]:T===(f==null?void 0:f.maxWidth)}),onMouseDown:L=>{var K;(K=f==null?void 0:f.onResize)==null||K.call(f),L.stopPropagation(),L.preventDefault(),document.addEventListener("mousemove",q),document.addEventListener("mouseup",z),b(!0)}}):null,s.jsx(s.Fragment,{children:s.jsx(jr,{formComponentType:"DrawerForm",layout:"vertical",...g,formRef:A,onInit:(L,K)=>{var P;g.formRef&&(g.formRef.current=K),(P=g==null?void 0:g.onInit)==null||P.call(g,L,K),A.current=K},submitter:D,onFinish:async L=>await B(L),contentRender:O,children:e})})]}),F]}))}const U0=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"30px","&::before":{display:"block",height:0,visibility:"hidden",content:"'.'"},"&-small":{lineHeight:e.lineHeight},"&-container":{display:"flex",flexWrap:"wrap",gap:e.marginXS},"&-item":{whiteSpace:"nowrap",[`${e.antCls}-form-item`]:{marginBlock:0}},"&-line":{minWidth:"198px"},"&-line:not(:first-child)":{marginBlockStart:"16px",marginBlockEnd:8},"&-collapse-icon":{width:e.controlHeight,height:e.controlHeight,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},"&-effective":{[`${e.componentCls}-collapse-icon`]:{backgroundColor:e.colorBgTextHover}}}});function K0(e){return tt("LightFilter",t=>{const n={...t,componentCls:`.${e}`};return[U0(n)]})}const W0=e=>{const{items:t,prefixCls:n,size:r="middle",collapse:a,collapseLabel:i,onValuesChange:o,variant:l="borderless",values:u,footerRender:m,placement:g,popoverProps:f}=e,h=Ne(),p=`${n}-light-filter`,{wrapSSR:S,hashId:y}=K0(p),[w,v]=d.useState(!1),[x,C]=d.useState(()=>({...u})),j=d.useMemo(()=>i||(a?s.jsx(de.FilterOutlined,{className:ie(`${p}-collapse-icon`,y)}):s.jsx(Qt,{variant:l,size:r,label:h.getMessage("form.lightFilter.more","更多筛选")})),[i,a,p,y,l,r,h]),{collapseItems:b,outsideItems:T}=d.useMemo(()=>{const $=[],E=[];return t.forEach(R=>{const{secondary:I}=R.props||{};I||a?$.push(R):E.push(R)}),{collapseItems:$,outsideItems:E}},[e.items]);return S(s.jsx("div",{className:ie(p,y,`${p}-${r}`,{[`${p}-effective`]:Object.keys(u).some($=>Array.isArray(u[$])?u[$].length>0:u[$])}),children:s.jsxs("div",{className:ie(`${p}-container`,y),children:[T.map(($,E)=>{if(!($!=null&&$.props))return $;const{key:R}=$,{fieldProps:I}=($==null?void 0:$.props)||{},M=I!=null&&I.placement?I==null?void 0:I.placement:g;return s.jsx("div",{className:ie(`${p}-item`,y),children:d.cloneElement($,{fieldProps:{...$.props.fieldProps,placement:M,variant:"borderless"},proFieldProps:{...$.props.proFieldProps,light:!0,label:$.props.label,variant:l},variant:l})},R||E)}),b.length?s.jsx("div",{className:ie(`${p}-item`,y),children:s.jsx(Hu,{padding:24,open:w,onOpenChange:$=>{v($)},placement:g,popoverProps:f,label:j,footerRender:m,footer:{onConfirm:()=>{o({...x}),v(!1)},onClear:()=>{const $={};b.forEach(E=>{const{name:R}=E.props;$[R]=void 0}),o($)}},children:b.map($=>{const{key:E}=$,{name:R,fieldProps:I}=$.props,M={...I,onChange:U=>(C({...x,[R]:U!=null&&U.target?U.target.value:U}),!1)};x.hasOwnProperty(R)&&(M[$.props.valuePropName||"value"]=x[R]);const Y=I!=null&&I.placement?I==null?void 0:I.placement:g;return s.jsx("div",{className:ie(`${p}-line`,y),children:d.cloneElement($,{fieldProps:{...M,placement:Y,variant:l}})},E)})})},"more"):null]})}))};function q0(e){const{size:t,collapse:n,collapseLabel:r,initialValues:a,onValuesChange:i,form:o,placement:l,formRef:u,variant:m,ignoreRules:g,footerRender:f,popoverProps:h,...p}=e,{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-form"),[w,v]=d.useState(()=>({...a})),x=d.useRef();return d.useImperativeHandle(u,()=>x.current,[x.current]),s.jsx(jr,{size:t,initialValues:a,form:o,contentRender:C=>s.jsx(W0,{prefixCls:y,items:C==null?void 0:C.flatMap(j=>{var b;return!j||!(j!=null&&j.type)?j:((b=j==null?void 0:j.type)==null?void 0:b.displayName)==="ProForm-Group"?j.props.children:j}),size:t,variant:m||"borderless",collapse:n,collapseLabel:r,placement:l,popoverProps:h,values:w||{},footerRender:f,onValuesChange:j=>{var T,$;const b={...w,...j};v(b),(T=x.current)==null||T.setFieldsValue(b),($=x.current)==null||$.submit(),i&&i(j,b)}},JSON.stringify(w||{})),formRef:x,formItemProps:{colon:!1,labelAlign:"left"},fieldProps:{style:{width:void 0}},...Ze(p,["labelWidth"]),onValuesChange:(C,j)=>{var b;v(j),i==null||i(C,j),(b=x.current)==null||b.submit()}})}const{noteOnce:G0}=st;function Z0({children:e,trigger:t,onOpenChange:n,modalProps:r,onFinish:a,submitTimeout:i,title:o,width:l,open:u,...m}){var I,M,Y,U;G0(!m.footer||!(r!=null&&r.footer),"ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const g=d.useContext(c.ConfigProvider.ConfigContext),[,f]=d.useState([]),[h,p]=d.useState(!1),[S,y]=dt(!1,u),w=je(A=>{n==null||n(A)}),v=d.useCallback(A=>{y(k=>{const F=typeof A=="function"?A(k):A;return queueMicrotask(()=>{w(F)}),F})},[w]),x=d.useRef(null),C=d.useCallback(A=>{x.current===null&&A&&f([]),x.current=A},[]),j=d.useRef(),b=d.useCallback(()=>{var k;const A=m.form??((k=m.formRef)==null?void 0:k.current)??j.current;A&&(r!=null&&r.destroyOnHidden)&&typeof A.resetFields=="function"&&A.resetFields()},[r==null?void 0:r.destroyOnHidden,m.form,m.formRef]);d.useImperativeHandle(m.formRef,()=>j.current,[j.current]),d.useEffect(()=>{u&&(n==null||n(!0))},[u]);const T=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async A=>{var k,F;v(!S),(F=(k=t.props)==null?void 0:k.onClick)==null||F.call(k,A)}}):null,[v,t,S]),$=d.useMemo(()=>{var A,k,F,D;return m.submitter===!1?!1:aa({searchConfig:{submitText:(r==null?void 0:r.okText)??((k=(A=g.locale)==null?void 0:A.Modal)==null?void 0:k.okText)??"确认",resetText:(r==null?void 0:r.cancelText)??((D=(F=g.locale)==null?void 0:F.Modal)==null?void 0:D.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:i&&h,onClick:O=>{var B;v(!1),(B=r==null?void 0:r.onCancel)==null||B.call(r,O)}}},m.submitter??{})},[(M=(I=g.locale)==null?void 0:I.Modal)==null?void 0:M.cancelText,(U=(Y=g.locale)==null?void 0:Y.Modal)==null?void 0:U.okText,r,m.submitter,v,h,i]),E=d.useCallback((A,k)=>s.jsxs(s.Fragment,{children:[A,x.current&&k?s.jsx(d.Fragment,{children:Gc.createPortal(k,x.current)},"submitter"):k]}),[]),R=d.useCallback(async A=>{const k=a==null?void 0:a(A);if(i&&k instanceof Promise){p(!0);const D=setTimeout(()=>p(!1),i);try{const O=await k;return clearTimeout(D),p(!1),O&&v(!1),O}catch(O){throw clearTimeout(D),p(!1),O}}else if(i){p(!0);const D=setTimeout(()=>p(!1),i);try{const O=await k;return clearTimeout(D),p(!1),O&&v(!1),O}catch(O){throw clearTimeout(D),p(!1),O}}const F=await k;return F&&v(!1),F},[a,v,i]);return s.jsxs(s.Fragment,{children:[s.jsx(c.Modal,{title:o,width:l||800,...r,open:S,onCancel:A=>{var k;i&&h||(v(!1),(k=r==null?void 0:r.onCancel)==null||k.call(r,A))},afterClose:()=>{var A;r!=null&&r.destroyOnHidden&&b(),S&&v(!1),(A=r==null?void 0:r.afterClose)==null||A.call(r)},footer:m.submitter!==!1?s.jsx("div",{ref:C,style:{display:"flex",justifyContent:"flex-end"}}):null,children:s.jsx(jr,{formComponentType:"ModalForm",layout:"vertical",...m,onInit:(A,k)=>{var F;m.formRef&&(m.formRef.current=k),(F=m==null?void 0:m.onInit)==null||F.call(m,A,k),j.current=k},formRef:j,submitter:$,onFinish:async A=>await R(A),contentRender:E,children:e})}),T]})}const Xi=be.createContext(null);function J0({children:e,onBatchResize:t}){const n=be.useRef(0),r=be.useRef([]),a=be.useContext(Xi),i=be.useCallback((o,l,u)=>{n.current+=1;const m=n.current;r.current.push({size:o,element:l,data:u}),Promise.resolve().then(()=>{m===n.current&&(t==null||t(r.current),r.current=[])}),a==null||a(o,l,u)},[t,a]);return be.createElement(Xi.Provider,{value:i},e)}const on=new Map;function zd(e){e.forEach(t=>{var r;const{target:n}=t;(r=on.get(n))==null||r.forEach(a=>a(n))})}let ai;function Bd(){return ai||(ai=new ResizeObserver(zd)),ai}process.env.NODE_ENV;process.env.NODE_ENV;function X0(e,t){on.has(e)||(on.set(e,new Set),Bd().observe(e)),on.get(e).add(t)}function Q0(e,t){on.has(e)&&(on.get(e).delete(t),on.get(e).size||(Bd().unobserve(e),on.delete(e)))}function ev(e,t,n,r){const a=be.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=eu(u=>{const{width:m,height:g}=u.getBoundingClientRect(),{offsetWidth:f,offsetHeight:h}=u,p=Math.floor(m),S=Math.floor(g);if(a.current.width!==p||a.current.height!==S||a.current.offsetWidth!==f||a.current.offsetHeight!==h){const y={width:p,height:S,offsetWidth:f,offsetHeight:h};a.current=y;const w=f===Math.round(m)?m:f,v=h===Math.round(g)?g:h,x={...y,offsetWidth:w,offsetHeight:v};r==null||r(x,u),Promise.resolve().then(()=>{n==null||n(x,u)})}}),o=typeof t=="function",l=be.useRef(0);be.useEffect(()=>{const u=o?t():t;return u&&e?X0(u,i):e&&o&&(l.current+=1),()=>{u&&Q0(u,i)}},[e,o?l.current:t])}function tv(e,t){const{children:n,disabled:r,onResize:a,data:i}=e,o=be.useRef(null),l=be.useContext(Xi),u=typeof n=="function",m=u?n(o):n,g=!u&&be.isValidElement(m)&&Mf(m),f=g?Af(m):null,h=If(f,o),p=()=>Lf(o.current);return be.useImperativeHandle(t,()=>p()),ev(!r,p,a,(S,y)=>{l==null||l(S,y,i)}),g?be.cloneElement(m,{ref:h}):m}const Vd=be.forwardRef(tv);process.env.NODE_ENV!=="production"&&(Vd.displayName="SingleObserver");function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qi.apply(this,arguments)}const nv="rc-observer-key";function rv(e,t){const{children:n}=e,r=typeof n=="function"?[n]:Tn(n);return process.env.NODE_ENV!=="production"&&(r.length>1?Js(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):r.length===0&&Js(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),r.map((a,i)=>{const o=(a==null?void 0:a.key)||`${nv}-${i}`;return be.createElement(Vd,Qi({},e,{key:o,ref:i===0?t:void 0}),a)})}const ja=be.forwardRef(rv);process.env.NODE_ENV!=="production"&&(ja.displayName="ResizeObserver");ja.Collection=J0;const sv=(e,t,n,r)=>e?s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.collapsed","展开"),r&&`(${r})`,s.jsx(de.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}):s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.expand","收起"),s.jsx(de.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}),av=e=>{const{setCollapsed:t,collapsed:n=!1,submitter:r,style:a,hiddenNum:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=Ne(),{hashId:u}=d.useContext(Xt),m=Wu(e.collapseRender)||sv;return s.jsxs(c.Space,{style:a,size:16,children:[r,e.collapseRender!==!1&&s.jsx("a",{className:ie(o("pro-query-filter-collapse-button"),u),onClick:()=>t(!n),children:m==null?void 0:m(n,e,l,i)})]})},iv=e=>({[e.componentCls]:{boxSizing:"border-box","&&":{padding:24},[`${e.antCls}-form-item`]:{marginBlock:0},[`${e.proComponentsCls}-form-group-title`]:{marginBlock:0},"&-row":{rowGap:24,"&-split":{[`${e.proComponentsCls}-form-group`]:{display:"flex",alignItems:"center",gap:e.marginXS},"&:last-child":{marginBlockEnd:12}},"&-split-line":{"&:after":{position:"absolute",width:"100%",content:'""',height:1,insetBlockEnd:-12,borderBlockEnd:`1px dashed ${e.colorSplit}`}}},"&-collapse-button":{display:"flex",alignItems:"center",color:e.colorPrimary}}});function ov(e){return tt("QueryFilter",t=>{const n={...t,componentCls:`.${e}`};return[iv(n)]})}const lv=e=>{const n={...c.theme.getDesignToken(),...e},r={xs:n.screenSMMin??576,sm:n.screenMDMin??768,md:n.screenLGMin??992,lg:n.screenXLMin??1200,xl:n.screenXXLMin??1600,xxl:1/0};return{configSpanBreakpoints:r,breakpoints:{vertical:[[r.xs,1,"vertical"],[r.md,2,"vertical"],[r.xl,3,"vertical"],[1/0,4,"vertical"]],default:[[r.xs,1,"vertical"],[r.sm,2,"vertical"],[r.xl,3,"horizontal"],[1/0,4,"horizontal"]]}}},cv=(e,t,n,r)=>{if(n&&typeof n=="number")return{span:n,layout:e};const{breakpoints:a,configSpanBreakpoints:i}=r,l=((n?["xs","sm","md","lg","xl","xxl"].map(u=>[i[u],24/n[u],"horizontal"]):a[e||"default"])||a.default).find(u=>t<u[0]+16);return l?{span:24/l[1],layout:l==null?void 0:l[2]}:{span:8,layout:"horizontal"}},uv=(e,t)=>e==null?void 0:e.flatMap(n=>{var r,a,i;return((r=n==null?void 0:n.type)==null?void 0:r.displayName)==="ProForm-Group"&&!((a=n.props)!=null&&a.title)?n.props.children:t&&d.isValidElement(n)?d.cloneElement(n,{...n.props,formItemProps:{...(i=n.props)==null?void 0:i.formItemProps,rules:[]}}):n}),dv=e=>{var A,k,F;const t=Ne(),{hashId:n}=d.useContext(Xt),r=e.resetText||t.getMessage("tableForm.reset","重置"),a=e.searchText||t.getMessage("tableForm.search","搜索"),[i,o]=dt(()=>e.defaultCollapsed&&!!e.submitter,e.collapsed),l=je(D=>{var O;(O=e.onCollapse)==null||O.call(e,D)}),u=d.useCallback(D=>{o(O=>{const B=typeof D=="function"?D(O):D;return queueMicrotask(()=>{l(B)}),B})},[l]),{optionRender:m,collapseRender:g,split:f,items:h,spanSize:p,showLength:S,searchGutter:y,showHiddenNum:w}=e,v=d.useMemo(()=>!e.submitter||m===!1?null:d.cloneElement(e.submitter,{searchConfig:{resetText:r,submitText:a},render:m&&((D,O)=>m({...e,resetText:r,searchText:a},e,O)),...e.submitter.props}),[e,r,a,m]);let x=0,C=0,j=!1,b=0,T=0;const $=uv(h,e.ignoreRules).map((D,O)=>{var Z,G,H,L;const B=d.isValidElement(D)?((Z=D==null?void 0:D.props)==null?void 0:Z.colSize)??1:1,q=Math.min(p.span*(B||1),24);x+=q,b+=B,O===0&&(j=q===24&&!((G=D==null?void 0:D.props)!=null&&G.hidden));const z=((H=D==null?void 0:D.props)==null?void 0:H.hidden)||i&&(j||b>S)&&!!O;C+=1;const V=d.isValidElement(D)&&(D.key||`${(L=D.props)==null?void 0:L.name}`)||O;return d.isValidElement(D)&&z?e.preserve?{itemDom:d.cloneElement(D,{hidden:!0,key:V||O}),hidden:!0,colSpan:q}:{itemDom:null,colSpan:0,hidden:!0}:{itemDom:D,colSpan:q,hidden:!1}}),E=$.map((D,O)=>{var Z,G;const{itemDom:B,colSpan:q}=D;if((Z=B==null?void 0:B.props)==null?void 0:Z.hidden)return B;const V=d.isValidElement(B)&&(B.key||`${(G=B.props)==null?void 0:G.name}`)||O;return 24-T%24<q&&(x+=24-T%24,T+=24-T%24),T+=q,f&&T%24===0&&O<C-1?s.jsx(c.Col,{span:q,className:ie(`${e.baseClassName}-row-split-line`,`${e.baseClassName}-row-split`,n),children:B},V):s.jsx(c.Col,{className:ie(`${e.baseClassName}-row-split`,n),span:q,children:B},V)}),R=w&&$.filter(D=>D.hidden).length,I=d.useMemo(()=>!(x<24||b<=S),[b,S,x]),M=d.useMemo(()=>{var O,B;const D=T%24+(((O=e.submitterColSpanProps)==null?void 0:O.span)??p.span);return D>24?24-(((B=e.submitterColSpanProps)==null?void 0:B.span)??p.span):24-D},[T,T%24+(((A=e.submitterColSpanProps)==null?void 0:A.span)??p.span),(k=e.submitterColSpanProps)==null?void 0:k.span]),U=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter");return s.jsxs(c.Row,{gutter:y,justify:"start",className:ie(`${U}-row`,n),children:[E,v&&s.jsx(c.Col,{span:p.span,offset:M,className:ie((F=e.submitterColSpanProps)==null?void 0:F.className),...e.submitterColSpanProps,style:{textAlign:"end"},children:s.jsx(c.Form.Item,{label:" ",colon:!1,shouldUpdate:!1,className:ie(`${U}-actions`,n),children:s.jsx(av,{hiddenNum:R,collapsed:i,collapseRender:I?g:!1,submitter:v,setCollapsed:u},"pro-form-query-filter-actions")})},"submitter")]},"resize-observer-row")};var qc;const fv=xo()?(qc=document==null?void 0:document.body)==null?void 0:qc.clientWidth:1024;function mv(e){const{collapsed:t,layout:n,defaultCollapsed:r=!0,defaultColsNumber:a,defaultFormItemsNumber:i,span:o,searchGutter:l=24,searchText:u,resetText:m,optionRender:g,collapseRender:f,onReset:h,onCollapse:p,labelWidth:S="80",style:y,split:w,preserve:v=!0,ignoreRules:x,showHiddenNum:C=!1,submitterColSpanProps:j,...b}=e,$=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter"),{wrapSSR:E,hashId:R}=ov($),{token:I}=c.theme.useToken(),[M,Y]=d.useState(()=>typeof(y==null?void 0:y.width)=="number"?y==null?void 0:y.width:fv),U=d.useMemo(()=>lv(I),[I.screenSMMin,I.screenMDMin,I.screenLGMin,I.screenXLMin,I.screenXXLMin]),A=d.useMemo(()=>cv(n,M+16,o,U),[n,M,o,U]),k=d.useMemo(()=>{if(i!==void 0)return i;if(a!==void 0){const D=24/A.span-1;return a>D?D:a}return Math.max(1,24/A.span-1)},[a,i,A.span]),F=d.useMemo(()=>{if(S&&A.layout!=="vertical"&&S!=="auto")return{labelCol:{flex:`0 0 ${S}px`},wrapperCol:{style:{maxWidth:`calc(100% - ${S}px)`}},style:{flexWrap:"nowrap"}}},[A.layout,S]);return E(s.jsx(ja,{onResize:D=>{M!==D.width&&D.width>17&&Y(D.width)},children:D=>s.jsx("div",{ref:D,className:ie(`${$}-container`,R),style:e.containerStyle,children:s.jsx(jr,{isKeyPressSubmit:!0,preserve:v,...b,className:ie($,R,b.className),onReset:h,style:y,layout:A.layout,fieldProps:{style:{width:"100%"}},formItemProps:F,groupProps:{titleStyle:{display:"inline-block",marginInlineEnd:16}},contentRender:(O,B,q)=>s.jsx(dv,{spanSize:A,collapsed:t,form:q,submitterColSpanProps:j,collapseRender:f,defaultCollapsed:r,onCollapse:p,optionRender:g,submitter:B,items:O,split:w,baseClassName:$,resetText:e.resetText,searchText:e.searchText,searchGutter:l,preserve:v,ignoreRules:x,showLength:k,showHiddenNum:C})})})},"resize-observer"))}const{noteOnce:hv}=st;function gv(e){const t=d.useRef(),n=d.useContext(Hd),r=d.useContext(Yd),a={...e,...r},{onFinish:i,step:o,formRef:l,title:u,stepProps:m,...g}=a;return hv(!g.submitter,"StepForm 不包含提交按钮,请在 StepsForm 上"),d.useImperativeHandle(l,()=>t.current,[l==null?void 0:l.current]),d.useEffect(()=>{if(!(a.name||a.step))return;const f=(a.name||a.step).toString();return n==null||n.regForm(f,a),()=>{n==null||n.unRegForm(f)}},[]),n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),s.jsx(jr,{formRef:t,onFinish:async f=>{if(g.name&&(n==null||n.onFormFinish(g.name,f)),i){n==null||n.setLoading(!0);try{await(i==null?void 0:i(f))&&(n==null||n.next())}finally{n==null||n.setLoading(!1)}return}n!=null&&n.lastStep||n==null||n.next()},onInit:(f,h)=>{var p;t.current=h,n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),(p=g==null?void 0:g.onInit)==null||p.call(g,f,h)},layout:"vertical",...Ze(g,["layoutType","columns"])})}const pv=e=>({[e.componentCls]:{boxSizing:"border-box","&-container":{width:"max-content",minWidth:"420px",maxWidth:"100%",margin:"auto"},"&-steps-container":{maxWidth:"1160px",margin:"auto",[`${e.antCls}-steps-vertical`]:{height:"100%"}},"&-step":{display:"none",marginBlockStart:"32px","&-active":{display:"block"},"> form":{maxWidth:"100%"}}}});function yv(e){return tt("StepsForm",t=>{const n={...t,componentCls:`.${e}`};return[pv(n)]})}const Hd=d.createContext(void 0),xv={horizontal({stepsDom:e,formDom:t}){return s.jsxs(s.Fragment,{children:[s.jsx(c.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(c.Col,{span:24,children:e})}),s.jsx(c.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(c.Col,{span:24,children:t})})]})},vertical({stepsDom:e,formDom:t}){return s.jsxs(c.Row,{align:"stretch",wrap:!0,gutter:{xs:8,sm:16,md:24},children:[s.jsx(c.Col,{xxl:4,xl:6,lg:7,md:8,sm:10,xs:12,children:d.cloneElement(e,{style:{height:"100%"}})}),s.jsx(c.Col,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:t})})]})}},Yd=d.createContext(null);function bv(e){const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=t("pro-steps-form"),{wrapSSR:r,hashId:a}=yv(n),{current:i,onCurrentChange:o,submitter:l,stepsFormRender:u,stepsRender:m,stepFormRender:g,stepsProps:f,onFinish:h,formProps:p,containerStyle:S,formRef:y,formMapRef:w,layoutRender:v,...x}=e,C=d.useRef(new Map),j=d.useRef(new Map),b=d.useRef([]),[T,$]=d.useState([]),[E,R]=d.useState(!1),I=Ne(),[M,Y]=dt(0,e.current),U=je(X=>{var se;(se=e.onCurrentChange)==null||se.call(e,X)}),A=d.useCallback(X=>{Y(se=>{const ae=typeof X=="function"?X(se):X;return queueMicrotask(()=>{U(ae)}),ae})},[U]),k=d.useMemo(()=>xv[(f==null?void 0:f.orientation)||"horizontal"],[f==null?void 0:f.orientation]),F=d.useMemo(()=>M===T.length-1,[T.length,M]),D=d.useCallback((X,se)=>{j.current.has(X)||$(ae=>[...ae,X]),j.current.set(X,se)},[]),O=d.useCallback(X=>{$(se=>se.filter(ae=>ae!==X)),j.current.delete(X),C.current.delete(X)},[]);d.useImperativeHandle(w,()=>b.current,[b.current]),d.useImperativeHandle(y,()=>{var X;return(X=b.current[M||0])==null?void 0:X.current},[M,b.current]);const B=d.useCallback(async(X,se)=>{if(C.current.set(X,se),!F||!h)return;R(!0);const ae=Ku({},...Array.from(C.current.values()));try{await h(ae)&&(A(0),b.current.forEach(pe=>{var me;return(me=pe.current)==null?void 0:me.resetFields()}))}catch(ue){console.log(ue)}finally{R(!1)}},[F,h,R,A]),q=d.useMemo(()=>{const X={items:T.map(se=>{const ae=j.current.get(se),ue={key:se,title:ae==null?void 0:ae.title,...ae==null?void 0:ae.stepProps};return ue.description&&(ue.content=ue.description,delete ue.description),ue})};return s.jsx("div",{className:ie(`${n}-steps-container`,a),style:{maxWidth:Math.min(T.length*320,1160)},children:s.jsx(c.Steps,{...f,...X,current:M,onChange:void 0})})},[T,a,n,M,f]),z=je(()=>{var se;(se=b.current[M].current)==null||se.submit()}),V=je(()=>{M<1||A(M-1)}),Z=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:E,...l==null?void 0:l.submitButtonProps,onClick:()=>{var X;(X=l==null?void 0:l.onSubmit)==null||X.call(l),z()},children:I.getMessage("stepsForm.next","下一步")},"next"),[I,E,z,l]),G=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{...l==null?void 0:l.resetButtonProps,onClick:()=>{var X;V(),(X=l==null?void 0:l.onReset)==null||X.call(l)},children:I.getMessage("stepsForm.prev","上一步")},"pre"),[I,V,l]),H=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:E,...l==null?void 0:l.submitButtonProps,onClick:()=>{var X;(X=l==null?void 0:l.onSubmit)==null||X.call(l),z()},children:I.getMessage("stepsForm.submit","提交")},"submit"),[I,E,z,l]),L=je(()=>{T.length!==0&&(M>T.length-2||A(M+1))}),K=d.useMemo(()=>{var ae;let X=[];const se=M||0;if(se<1?T.length===1?X.push(H):X.push(Z):se+1===T.length?X.push(G,H):X.push(G,Z),X=X.filter(d.isValidElement),l&&l.render){const ue={form:(ae=b.current[M])==null?void 0:ae.current,onSubmit:z,step:M,onPre:V};return l.render(ue,X)}return l&&(l==null?void 0:l.render)===!1?null:X},[T.length,Z,z,G,V,M,H,l]),P=d.useMemo(()=>Tn(e.children).map((X,se)=>{const ae=X.props,ue=ae.name||`${se}`,pe=M===se,me=pe?{contentRender:g,submitter:!1}:{};return s.jsx("div",{className:ie(`${n}-step`,a,{[`${n}-step-active`]:pe}),children:s.jsx(Yd.Provider,{value:{...me,...p,...ae,name:ue,step:se},children:X})},ue)}),[p,a,n,e.children,M,g]),W=d.useMemo(()=>m?m(T.map(X=>{var se;return{key:X,title:(se=j.current.get(X))==null?void 0:se.title}}),q):q,[T,q,m]),te=d.useMemo(()=>s.jsxs("div",{className:ie(`${n}-container`,a),style:S,children:[P,u?null:s.jsx(c.Space,{children:K})]}),[S,P,a,n,u,K]),re=d.useMemo(()=>{const X={stepsDom:W,formDom:te};return u?u(v?v(X):k(X),K):v?v(X):k(X)},[W,te,k,u,K,v]);return r(s.jsx("div",{className:ie(n,a),children:s.jsx(c.Form.Provider,{...x,children:s.jsx(Hd.Provider,{value:{loading:E,setLoading:R,regForm:D,keyArray:T,next:L,formArrayRef:b,formMapRef:j,lastStep:F,unRegForm:O,onFormFinish:B},children:re})})}))}function va(e){return s.jsx(Bn,{needDeps:!0,children:s.jsx(bv,{...e})})}va.StepForm=gv;va.useForm=c.Form.useForm;const Sv=({children:e})=>s.jsx(s.Fragment,{children:e}),Cv=({steps:e,columns:t,forceUpdate:n,grid:r,...a})=>{const i=po(a),o=d.useCallback(u=>{var m,g;(g=(m=i.current).onCurrentChange)==null||g.call(m,u),n([])},[n,i]),l=d.useMemo(()=>e==null?void 0:e.map((u,m)=>d.createElement(Ud,{grid:r,...u,key:m,layoutType:"StepForm",columns:t[m]})),[t,r,e]);return s.jsx(va,{...a,onCurrentChange:o,children:l})},{noteOnce:zc}=st,wv=(e,t)=>{var n;if(e.valueType==="dependency"){const r=(n=e.getFieldProps)==null?void 0:n.call(e);return zc(Array.isArray(e.name??(r==null?void 0:r.name)),'SchemaForm: fieldProps.name should be NamePath[] when valueType is "dependency"'),zc(typeof e.columns=="function",'SchemaForm: columns should be a function when valueType is "dependency"'),Array.isArray(e.name??(r==null?void 0:r.name))?d.createElement(wa,{name:e.name,...r,key:e.key},a=>!e.columns||typeof e.columns!="function"?null:t.genItems(e.columns(a))):null}return!0},jv=e=>{var t;return e.valueType==="divider"?d.createElement(c.Divider,{...(t=e.getFieldProps)==null?void 0:t.call(e),key:e.key}):!0},vv=(e,{action:t,formRef:n,type:r,originItem:a})=>{const i={...Ze(e,["dataIndex","width","render","formItemRender","renderText","title"]),name:e.name||e.key||e.dataIndex,width:e.width,render:e!=null&&e.render?(m,g,f)=>{var h,p,S,y;return(y=e==null?void 0:e.render)==null?void 0:y.call(e,m,g,f,t==null?void 0:t.current,{type:r,...e,key:(h=e.key)==null?void 0:h.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e)})}:void 0},o=()=>{const{key:m,...g}=i;return s.jsx(En,{...g,ignoreFormItem:!0},m)},l=e!=null&&e.formItemRender?(m,g)=>{var h,p,S,y;const f=xt({...g,onChange:void 0});return(y=e==null?void 0:e.formItemRender)==null?void 0:y.call(e,{type:r,...e,key:(h=e.key)==null?void 0:h.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e),originProps:a},{...f,defaultRender:o,type:r},n.current)}:void 0,u=()=>{if(e!=null&&e.formItemRender){const m=l==null?void 0:l(null,{});if(!m||e.ignoreFormItem)return m}return d.createElement(En,{...i,key:[e.key,e.index||0].join("-"),formItemRender:l})};return e.dependencies?s.jsx(wa,{name:e.dependencies||[],children:u},e.key):u()},Tv=(e,{genItems:t})=>{var n,r;return e.valueType==="formList"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(x0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,name:e.dataIndex,label:e.label,initialValue:e.initialValue,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},Fv=(e,{genItems:t})=>{var n,r;return e.valueType==="formSet"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(L0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,initialValue:e.initialValue,name:e.dataIndex,label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},$v=(e,{genItems:t})=>{var n;return e.valueType==="group"?!e.columns||!Array.isArray(e.columns)?null:s.jsx(Ov,{label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(n=e.getFieldProps)==null?void 0:n.call(e),children:t(e.columns)},e.key):!0},Ev=e=>e.valueType&&typeof e.valueType=="string"&&["index","indexBorder","option"].includes(e==null?void 0:e.valueType)?null:!0,Bc=[Ev,$v,Tv,Fv,jv,wv],Rv=(e,t)=>{for(let n=0;n<Bc.length;n++){const r=Bc[n],a=r(e,t);if(a!==!0)return a}return vv(e,t)},Iv={DrawerForm:Y0,QueryFilter:mv,LightFilter:q0,StepForm:va.StepForm,StepsForm:Cv,ModalForm:Z0,Embed:Sv,Form:Tt};function Ud(e){const{columns:t,layoutType:n="Form",type:r="form",action:a,shouldUpdate:i=(T,$)=>wn(T)!==wn($),formRef:o,...l}=e,u=Iv[n]||Tt,[m]=c.Form.useForm(),g=c.Form.useFormInstance(),[,f]=d.useState([]),[h,p]=d.useState(()=>[]),S=Vp(e.form||g||m),y=d.useRef(),w=po(e),v=je(T=>T.filter($=>!($.hideInForm&&r==="form")).sort(($,E)=>E.order||$.order?(E.order||0)-($.order||0):(E.index||0)-($.index||0)).map(($,E)=>{const R=vt($.title,$,"form",s.jsx(fr,{label:$.title,tooltip:$.tooltip})),I=xt({title:R,label:R,name:$.name,valueType:vt($.valueType,{}),key:$.key||$.dataIndex||E,columns:$.columns,valueEnum:$.valueEnum,dataIndex:$.dataIndex||$.key,initialValue:$.initialValue,width:$.width,index:$.index,readonly:$.readonly,colSize:$.colSize,colProps:$.colProps,rowProps:$.rowProps,className:$.className,tooltip:$.tooltip,dependencies:$.dependencies,proFieldProps:$.proFieldProps,ignoreFormItem:$.ignoreFormItem,getFieldProps:$.fieldProps?()=>vt($.fieldProps,S.current,$):void 0,getFormItemProps:$.formItemProps?()=>vt($.formItemProps,S.current,$):void 0,render:$.render,formItemRender:$.formItemRender,renderText:$.renderText,request:$.request,params:$.params,transform:$.transform,convertValue:$.convertValue,debounceTime:$.debounceTime,defaultKeyWords:$.defaultKeyWords});return Rv(I,{action:a,type:r,originItem:$,formRef:S,genItems:v})}).filter($=>!!$)),x=d.useCallback((T,$)=>{const{onValuesChange:E}=w.current;(i===!0||typeof i=="function"&&i($,y.current))&&p([]),y.current=$,E==null||E(T,$)},[w,i]),C=St(()=>{if(!(t.length&&Array.isArray(t[0])))return v(t)},[t,l==null?void 0:l.open,a,r,h,S.current]),j=St(()=>n==="StepsForm"?{forceUpdate:f,columns:t}:{},[t,n]);d.useImperativeHandle(o,()=>S.current,[S.current]);const b=d.useContext(Zt);return s.jsx(Bn,{valueTypeMap:{...b.valueTypeMap,...Rd},children:s.jsx(u,{...j,...l,onInit:(T,$)=>{var E;o&&(o.current=$),(E=l==null?void 0:l.onInit)==null||E.call(l,T,$),S.current=$},form:e.form||m,formRef:S,onValuesChange:x,children:C})})}const ua="text",Mv=({fieldProps:e,proFieldProps:t,...n})=>s.jsx(En,{valueType:ua,fieldProps:e,fieldConfig:{valueType:ua},proFieldProps:t,...n}),Av=e=>{const[t,n]=dt(e.open||!1,e.open),r=d.useCallback(a=>{n(i=>{var l;const o=typeof a=="function"?a(i):a;return(l=e.onOpenChange)==null||l.call(e,o),o})},[e.onOpenChange]);return s.jsx(c.Form.Item,{shouldUpdate:!0,noStyle:!0,children:a=>{var o;const i=a.getFieldValue(e.name||[]);return s.jsx(c.Popover,{getPopupContainer:l=>l&&l.parentNode?l.parentNode:l,onOpenChange:l=>r(l),content:s.jsxs("div",{style:{padding:"4px 0"},children:[(o=e.statusRender)==null?void 0:o.call(e,i),e.strengthText?s.jsx("div",{style:{marginTop:10},children:s.jsx("span",{children:e.strengthText})}):null]}),styles:{root:{width:240}},placement:"rightTop",...e.popoverProps,open:t,children:e.children})}})},kv=({fieldProps:e,proFieldProps:t,...n})=>{const[r,a]=d.useState(!1);return e!=null&&e.statusRender&&n.name?s.jsx(Bn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(or,{...o,text:i}),formItemRender:(i,o)=>s.jsx(or,{...o,text:i})}},children:s.jsx(Av,{name:n.name,statusRender:e==null?void 0:e.statusRender,popoverProps:e==null?void 0:e.popoverProps,strengthText:e==null?void 0:e.strengthText,open:r,onOpenChange:a,children:s.jsx("div",{children:s.jsx(En,{valueType:"password",fieldProps:{...Ze(e,["statusRender","popoverProps","strengthText"]),onBlur:i=>{var o;(o=e==null?void 0:e.onBlur)==null||o.call(e,i),a(!1)},onClick:i=>{var o;(o=e==null?void 0:e.onClick)==null||o.call(e,i),a(!0)}},proFieldProps:t,fieldConfig:{valueType:ua},...n})})})}):s.jsx(Bn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(or,{...o,text:i}),formItemRender:(i,o)=>s.jsx(or,{...o,text:i})}},children:s.jsx(En,{valueType:"password",fieldProps:e,proFieldProps:t,fieldConfig:{valueType:ua},...n})})},da=Mv;da.Password=kv;da.displayName="ProFormComponent";function Tt(e){return s.jsx(jr,{layout:"vertical",contentRender:(t,n)=>s.jsxs(s.Fragment,{children:[t,n]}),...e})}Tt.Group=_d;Tt.useForm=c.Form.useForm;Tt.Item=Nd;Tt.useWatch=c.Form.useWatch;Tt.ErrorList=c.Form.ErrorList;Tt.Provider=c.Form.Provider;Tt.useFormInstance=c.Form.useFormInstance;Tt.EditOrReadOnlyContext=ss;const Ov=Tt.Group,Dv=e=>({[e.componentCls]:{boxSizing:"border-box",marginBlockEnd:16,backgroundColor:It(e.colorTextBase,.02),borderRadius:e.borderRadius,border:"none","&-container":{paddingBlock:e.paddingSM,paddingInline:e.paddingLG},"&-info":{display:"flex",alignItems:"center",transition:"all 0.3s",color:e.colorTextTertiary,"&-content":{flex:1},"&-option":{minWidth:48,paddingInlineStart:16}}}});function Pv(e){return tt("ProTableAlert",t=>{const n={...t,componentCls:`.${e}`};return[Dv(n)]})}const Nv=e=>{const{intl:t,onCleanSelected:n}=e;return[s.jsx("a",{onClick:n,children:t.getMessage("alert.clear","清空")},"0")]};function Lv({selectedRowKeys:e=[],onCleanSelected:t,alwaysShowAlert:n,selectedRows:r,alertInfoRender:a=({intl:o})=>s.jsxs(c.Space,{children:[o.getMessage("alert.selected","已选择"),e.length,o.getMessage("alert.item","项"),"  "]}),alertOptionRender:i=Nv}){const o=Ne(),l=i&&i({onCleanSelected:t,selectedRowKeys:e,selectedRows:r,intl:o}),{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),m=u("pro-table-alert"),{wrapSSR:g,hashId:f}=Pv(m);if(a===!1)return null;const h=a({intl:o,selectedRowKeys:e,selectedRows:r,onCleanSelected:t});return h===!1||e.length<1&&!n?null:g(s.jsx("div",{className:ie(m,f),children:s.jsx("div",{className:ie(`${m}-container`,f),children:s.jsxs("div",{className:ie(`${m}-info`,f),children:[s.jsx("div",{className:ie(`${m}-info-content`,f),children:h}),l?s.jsx("div",{className:ie(`${m}-info-option`,f),children:l}):null]})})}))}function _v(e,t,n){if(e===!1)return!1;const{total:r,current:a,pageSize:i,setPageInfo:o}=t;return{showTotal:(u,m)=>`${n.getMessage("pagination.total.range","第")} ${m[0]}-${m[1]} ${n.getMessage("pagination.total.total","条/总共")} ${u} ${n.getMessage("pagination.total.item","条")}`,total:r,...typeof e=="object"?e:{},current:e!==!0&&e?e.current??a:a,pageSize:e!==!0&&e?e.pageSize??i:i,onChange:(u,m)=>{const{onChange:g}=e;g==null||g(u,m||20),(m!==i||a!==u)&&o({pageSize:m,current:u})}}}function zv(e,t,n){const r={...n.editableUtils,pageInfo:t.pageInfo,nativeElement:n.nativeElement,focus:n.focus,reload:async a=>{a&&await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reloadAndRest:async()=>{n.onCleanSelected(),await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reset:async()=>{var a;await n.resetAll(),await((a=t==null?void 0:t.reset)==null?void 0:a.call(t)),await(t==null?void 0:t.reload())},fullScreen:()=>n.fullScreen(),clearSelected:()=>n.onCleanSelected(),setPageInfo:a=>t.setPageInfo(a),scrollTo:n.scrollTo};e.current=r}function Bv(e,t){return t.filter(n=>n).length<1?e:t.reduce((n,r)=>r(n),e)}const Kd=(e,t)=>t===void 0?!1:typeof t=="boolean"?t:t[e],Vv=e=>{var t;return e&&typeof e=="object"&&((t=e==null?void 0:e.props)==null?void 0:t.colSpan)},pr=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`,as=e=>Array.isArray(e)?e.join(","):e==null?void 0:e.toString(),eo=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.children?t.push(...eo(r.children)):t.push(r)}return t},Fo=(e,t)=>!!e&&!!t,$o=e=>typeof e=="function"||typeof e=="object"&&typeof e.compare=="function",Hv=(e,t)=>Object.entries(e).reduce((n,[r,a])=>{const i=t.find(o=>as(o.dataIndex)===r);return i!=null&&!Fo(i.filters,i.onFilter)&&(n[r]=a),n},{}),Yv=e=>(Array.isArray(e)?e:[e]).reduce((r,a)=>{var l,u;const i=(l=a.column)==null?void 0:l.sorter;if(i!=null&&$o(i))return r;const o=typeof i=="string"?i:as((u=a.column)==null?void 0:u.dataIndex);return o!=null&&(r[o]=a.order),r},{}),Uv=e=>{const t={},n={};return e.forEach(r=>{const a=as(r.dataIndex);a&&(r.filters&&!Fo(r.filters,r.onFilter)&&(t[a]=r.defaultFilteredValue??null),r.sorter&&!$o(r.sorter)&&(typeof r.sorter=="string"?n[r.sorter]=r.defaultSortOrder??null:n[a]=r.defaultSortOrder??null))}),{sort:n,filter:t}},Kv=(e,t)=>{const{sorter:n,sortOrder:r,dataIndex:a}=t;if(r!==void 0)return r;if(n==null||$o(n))return;const i=typeof n=="string"?n:as(a);return i?e[i]:void 0},Wv=(e,t)=>{const{filters:n,onFilter:r,filteredValue:a,dataIndex:i}=t;if(a!==void 0)return a;if(n==null||Fo(n,r))return;const o=as(i);return o?e[o]:void 0};function qv(e={}){var x,C,j,b,T,$;const t=d.useRef(),n=d.useRef(null),r=d.useRef(),a=d.useRef(),[i,o]=d.useState(""),l=d.useRef([]),[u,m]=dt(()=>e.size||e.defaultSize||"middle",e.size),g=d.useCallback(E=>{m(R=>{var M;const I=typeof E=="function"?E(R):E;return(M=e.onSizeChange)==null||M.call(e,I),I})},[e.onSizeChange]),f=d.useMemo(()=>{var R,I;if((R=e==null?void 0:e.columnsState)!=null&&R.defaultValue)return e.columnsState.defaultValue;const E={};return(I=e.columns)==null||I.forEach(({key:M,dataIndex:Y,fixed:U,disable:A},k)=>{const F=pr(M??Y,k);F&&(E[F]={show:!0,fixed:U,disable:A})}),E},[e.columns]),[h,p]=dt(()=>{var I,M,Y,U;const{persistenceType:E,persistenceKey:R}=e.columnsState||{};if(R&&E&&typeof window<"u"){const A=window[E];try{const k=A==null?void 0:A.getItem(R);if(k)return(I=e==null?void 0:e.columnsState)!=null&&I.defaultValue?aa({},(M=e==null?void 0:e.columnsState)==null?void 0:M.defaultValue,JSON.parse(k)):JSON.parse(k)}catch(k){console.warn(k)}}return((Y=e.columnsState)==null?void 0:Y.value)||((U=e.columnsState)==null?void 0:U.defaultValue)||f},(x=e.columnsState)==null?void 0:x.value),S=(C=e.columnsState)==null?void 0:C.onChange,y=d.useCallback(E=>{p(R=>{const I=typeof E=="function"?E(R):E;return S==null||S(I),I})},[S]);d.useEffect(()=>{var I,M;const{persistenceType:E,persistenceKey:R}=e.columnsState||{};if(R&&E&&typeof window<"u"){const Y=window[E];try{const U=Y==null?void 0:Y.getItem(R);U?(I=e==null?void 0:e.columnsState)!=null&&I.defaultValue?y(aa({},(M=e==null?void 0:e.columnsState)==null?void 0:M.defaultValue,JSON.parse(U))):y(JSON.parse(U)):y(f)}catch(U){console.warn(U)}}},[(j=e.columnsState)==null?void 0:j.persistenceKey,(b=e.columnsState)==null?void 0:b.persistenceType,f]);const w=d.useCallback(()=>{const{persistenceType:E,persistenceKey:R}=e.columnsState||{};if(!R||!E||typeof window>"u")return;const I=window[E];try{I==null||I.removeItem(R)}catch(M){console.warn(M)}},[e.columnsState]);d.useEffect(()=>{var M,Y;if(!((M=e.columnsState)!=null&&M.persistenceKey)||!((Y=e.columnsState)!=null&&Y.persistenceType)||typeof window>"u")return;const{persistenceType:E,persistenceKey:R}=e.columnsState,I=window[E];try{I==null||I.setItem(R,JSON.stringify(h))}catch(U){console.warn(U),w()}},[(T=e.columnsState)==null?void 0:T.persistenceKey,h,($=e.columnsState)==null?void 0:$.persistenceType]);const v={action:t.current,setAction:E=>{t.current=E},sortKeyColumns:l.current,setSortKeyColumns:E=>{l.current=E},propsRef:a,columnsMap:h,keyWords:i,setKeyWords:E=>o(E),setTableSize:g,tableSize:u,prefixName:r.current,setPrefixName:E=>{r.current=E},setColumnsMap:y,columns:e.columns,rootDomRef:n,clearPersistenceStorage:w,defaultColumnKeyMap:f};return Object.defineProperty(v,"prefixName",{get:()=>r.current}),Object.defineProperty(v,"sortKeyColumns",{get:()=>l.current}),Object.defineProperty(v,"action",{get:()=>t.current}),v}const qn=d.createContext({}),Gv=e=>{const t=qv(e.initValue);return s.jsx(qn.Provider,{value:t,children:e.children})},Zv=new $u("turn",{"0%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(90deg)"},"50%":{transform:"rotate(180deg)"},"75%":{transform:"rotate(270deg)"},"100%":{transform:"rotate(360deg)"}}),Jv=e=>({[e.componentCls]:{boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},zIndex:1,[`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]:{marginBlockEnd:0},"&:not(:root):fullscreen":{minHeight:"100vh",overflow:"auto",background:e.colorBgContainer},"&-extra":{marginBlockEnd:16},"&-polling":{[`${e.componentCls}-list-toolbar-setting-item`]:{".anticon.anticon-reload":{transform:"rotate(0deg)",animationName:Zv,animationDuration:"1s",animationTimingFunction:"linear",animationIterationCount:"infinite"}}},[`td${e.antCls}-table-cell`]:{">a":{fontSize:e.fontSize}},[`${e.antCls}-table${e.antCls}-table-tbody${e.antCls}-table-wrapper:only-child${e.antCls}-table`]:{marginBlock:0,marginInline:0},[`${e.antCls}-table${e.antCls}-table-middle ${e.componentCls}`]:{marginBlock:0,marginInline:-8,[`${e.proComponentsCls}-card`]:{backgroundColor:"initial"}},"& &-search":{marginBlockEnd:"16px",background:e.colorBgContainer,"&-ghost":{background:"transparent"},[`&${e.componentCls}-form`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:16,overflow:"unset"},"&-light-filter":{marginBlockEnd:0,paddingBlock:0,paddingInline:0},"&-form-option":{[`${e.antCls}-form-item`]:{},[`${e.antCls}-form-item-label`]:{},[`${e.antCls}-form-item-control-input`]:{}},"@media (max-width: 575px)":{[e.componentCls]:{height:"auto !important",paddingBlockEnd:"24px",[`${e.antCls}-form-item-label`]:{minWidth:"80px",textAlign:"start"}}}},"&-toolbar":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"64px",paddingInline:24,paddingBlock:0,"&-option":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"&-title":{flex:"1",color:e.colorTextLabel,fontWeight:"500",fontSize:"16px",lineHeight:"24px",opacity:"0.85"}}},[`@media (max-width: ${e.screenXS})px`]:{[e.componentCls]:{[`${e.antCls}-table`]:{width:"100%",overflowX:"auto","&-thead > tr,&-tbody > tr":{"> th,> td":{whiteSpace:"pre",">span":{display:"block"}}}}}},"@media (max-width: 575px)":{[`${e.componentCls}-toolbar`]:{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",height:"auto",marginBlockEnd:"16px",marginInlineStart:"16px",paddingBlock:8,paddingInline:8,paddingBlockStart:"16px",lineHeight:"normal","&-title":{marginBlockEnd:16},"&-option":{display:"flex",justifyContent:"space-between",width:"100%"},"&-default-option":{display:"flex",flex:"1",alignItems:"center",justifyContent:"flex-end"}}}});function Xv(e){return tt("ProTable",t=>{const n={...t,componentCls:`.${e}`};return[Jv(n)]})}function Qv(e){let t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t.startsWith("-")&&(t=t.slice(1)),t}const eT=(e,t)=>!e&&t!==!1?(t==null?void 0:t.filterType)==="light"?"LightFilter":"QueryFilter":"Form",tT=(e,t,n)=>!e&&n==="LightFilter"?Ze({...t},["labelWidth","defaultCollapsed","filterType"]):e?{}:Ze({labelWidth:t?t==null?void 0:t.labelWidth:void 0,defaultCollapsed:!0,...t},["filterType"]),nT=(e,t)=>e?Ze(t,["ignoreRules"]):{ignoreRules:!0,...t},rT=({onSubmit:e,formRef:t,dateFormatter:n="string",type:r,columns:a,action:i,ghost:o,manualRequest:l,onReset:u,submitButtonLoading:m,search:g,form:f,bordered:h})=>{const{hashId:p}=d.useContext(Xt),S=r==="form",y=async(T,$)=>{e&&e(T,$)},{getPrefixCls:w}=d.useContext(c.ConfigProvider.ConfigContext),v=d.useMemo(()=>a.filter(T=>!(T===c.Table.EXPAND_COLUMN||T===c.Table.SELECTION_COLUMN||T.search===!1&&r!=="form"||r==="form"&&T.hideInForm)).map(T=>{var R;const $=!T.valueType||["textarea","jsonCode","code"].includes(T==null?void 0:T.valueType)&&r==="table"?"text":T==null?void 0:T.valueType,E=(T==null?void 0:T.key)||((R=T==null?void 0:T.dataIndex)==null?void 0:R.toString());return{...T,width:void 0,...T.search&&typeof T.search=="object"?T.search:{},valueType:$,proFieldProps:{...T.proFieldProps,proFieldKey:E?`table-field-${E}`:void 0}}}),[a,r]),x=w("pro-table-search"),C=w("pro-table-form"),j=d.useMemo(()=>eT(S,g),[g,S]),b=d.useMemo(()=>({submitter:{submitButtonProps:{loading:m}}}),[m]);return s.jsx("div",{className:ie(p,{[w("pro-card")]:!0,[`${w("pro-card")}-border`]:!!h,[`${w("pro-card")}-bordered`]:!!h,[`${w("pro-card")}-ghost`]:!!o,[x]:!0,[C]:S,[w(`pro-table-search-${Qv(j)}`)]:!0,[`${x}-ghost`]:o,[g==null?void 0:g.className]:g!==!1&&(g==null?void 0:g.className)}),children:s.jsx(Ud,{layoutType:j,columns:v,type:r,...b,...tT(S,g,j),...nT(S,f||{}),formRef:t,action:i,dateFormatter:n,onInit:(T,$)=>{var E,R,I;if(t.current=$,r!=="form"){const M=(E=i.current)==null?void 0:E.pageInfo,{current:Y=M==null?void 0:M.current,pageSize:U=M==null?void 0:M.pageSize}=T;if((I=(R=i.current)==null?void 0:R.setPageInfo)==null||I.call(R,{...M,current:parseInt(Y,10),pageSize:parseInt(U,10)}),l)return;y(T,!0)}},onReset:T=>{u==null||u(T)},onFinish:T=>{y(T,!1)},initialValues:f==null?void 0:f.initialValues})})},sT=e=>{const{columns:t,loading:n,formRef:r,type:a,action:i,cardBordered:o,dateFormatter:l,form:u,search:m,pagination:g,ghost:f,manualRequest:h,beforeSearchSubmit:p=j=>j,onSubmit:S,onFormSearchSubmit:y,onReset:w}=e,v=d.useMemo(()=>g?xt({current:g.current,pageSize:g.pageSize}):{},[g]),x=je((j,b)=>{var E,R,I;if((u==null?void 0:u.ignoreRules)===!1&&b){(E=r==null?void 0:r.current)==null||E.validateFields().then(()=>{var U,A;const M={...j,_timestamp:Date.now(),...v},Y=Ze(p(M),Object.keys(v));y(Y),b||(A=(U=i.current)==null?void 0:U.setPageInfo)==null||A.call(U,{current:1}),S&&!b&&(S==null||S(j))}).catch(M=>{});return}const T={...j,_timestamp:Date.now(),...v},$=Ze(p(T),Object.keys(v));y($),b||(I=(R=i.current)==null?void 0:R.setPageInfo)==null||I.call(R,{current:1}),S&&!b&&(S==null||S(j))}),C=je(j=>{var T;const b=()=>{var E,R;const $=Ze(p({...j,...v}),Object.keys(v));y($),(R=(E=i.current)==null?void 0:E.setPageInfo)==null||R.call(E,{current:1}),w==null||w()};if((u==null?void 0:u.ignoreRules)===!1){(T=r==null?void 0:r.current)==null||T.validateFields().then(b).catch(()=>{});return}b()});return s.jsx(rT,{submitButtonLoading:n,columns:t,type:a,ghost:f,formRef:r,onSubmit:x,manualRequest:h,onReset:C,dateFormatter:l,search:m,form:{autoFocusFirstInput:!1,...u,extraUrlParams:{...v,...u==null?void 0:u.extraUrlParams}},action:i,bordered:Kd("search",o)})},aT=(e,t)=>{const n={columns:e.columns,loading:e.loading,formRef:e.formRef,type:e.type,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,form:e.form,search:e.search,manualRequest:e.manualRequest};return vn(n,{columns:t.columns,formRef:t.formRef,loading:t.loading,type:t.type,cardBordered:t.cardBordered,dateFormatter:t.dateFormatter,form:t.form,search:t.search,manualRequest:t.manualRequest})},iT=d.memo(sT,aT);function oT(e){const{search:t,type:n,pagination:r,beforeSearchSubmit:a,actionRef:i,columns:o,onFormSearchSubmit:l,ghost:u,onReset:m,onSubmit:g,loading:f,manualRequest:h,form:p,formRef:S,cardBordered:y,dateFormatter:w,searchFormRender:v,proTableProps:x}=e;return d.useMemo(()=>{const C=t===!1&&n!=="form"?null:s.jsx(iT,{pagination:r,beforeSearchSubmit:a,action:i,columns:o,onFormSearchSubmit:j=>{l(j)},ghost:u,onReset:m,onSubmit:g,loading:f,manualRequest:h,search:t,form:p,formRef:S,type:n||"table",cardBordered:y,dateFormatter:w});return v&&C?s.jsx(s.Fragment,{children:v(x,C)}):C},[i,a,y,o,w,p,S,u,f,h,l,m,g,r,x,t,v,n])}const lT=e=>({[e.componentCls]:{boxSizing:"border-box",width:"auto","&-title":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"32px"},"&-overlay":{[`${e.antCls}-popover-inner-content`]:{width:"200px",paddingBlock:0,paddingInline:0,paddingBlockEnd:8},[`${e.antCls}-tree-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${e.antCls}-tree-draggable-icon`]:{cursor:"grab"},[`${e.antCls}-tree-treenode`]:{alignItems:"center","&:hover":{[`${e.componentCls}-list-item-option`]:{display:"block"}},[`${e.antCls}-tree-checkbox`]:{marginInlineEnd:"4px"},[`${e.antCls}-tree-title`]:{width:"100%"}}}},[`${e.componentCls}-action-rest-button`]:{color:e.colorPrimary},[`${e.componentCls}-list`]:{display:"flex",flexDirection:"column",width:"100%",paddingBlockStart:8,[`&${e.componentCls}-list-group`]:{paddingBlockStart:0},"&-title":{marginBlockStart:"6px",marginBlockEnd:"6px",paddingInlineStart:"24px",color:e.colorTextSecondary,fontSize:"12px"},"&-item":{display:"flex",alignItems:"center",maxHeight:24,justifyContent:"space-between","&-title":{flex:1,maxWidth:80,textOverflow:"ellipsis",overflow:"hidden",wordBreak:"break-all",whiteSpace:"nowrap"},"&-option":{display:"none",float:"right",cursor:"pointer","> span":{"> span.anticon":{color:e.colorPrimary}},"> span + span":{marginInlineStart:4}}}}});function cT(e){return tt("ColumnSetting",t=>{const n={...t,componentCls:`.${e}`};return[lT(n)]})}const ii=({title:e,show:t,children:n,columnKey:r,fixed:a})=>{const{columnsMap:i,setColumnsMap:o}=d.useContext(qn);return t?s.jsx(c.Tooltip,{title:e,children:s.jsx("span",{onClick:l=>{l.stopPropagation(),l.preventDefault();const u=(i==null?void 0:i[r])||{},m={...i,[r]:{...u,fixed:a}};o(m)},children:n})}):null},uT=({columnKey:e,isLeaf:t,title:n,className:r,fixed:a,showListItemOption:i})=>{const o=Ne(),{hashId:l}=d.useContext(Xt),u=s.jsxs("span",{className:ie(`${r}-list-item-option`,l),children:[s.jsx(ii,{columnKey:e,fixed:"left",title:o.getMessage("tableToolBar.leftPin","固定在列首"),show:a!=="left",children:s.jsx(de.VerticalAlignTopOutlined,{})}),s.jsx(ii,{columnKey:e,fixed:void 0,title:o.getMessage("tableToolBar.noPin","不固定"),show:!!a,children:s.jsx(de.VerticalAlignMiddleOutlined,{})}),s.jsx(ii,{columnKey:e,fixed:"right",title:o.getMessage("tableToolBar.rightPin","固定在列尾"),show:a!=="right",children:s.jsx(de.VerticalAlignBottomOutlined,{})})]});return s.jsxs("span",{className:ie(`${r}-list-item`,l),children:[s.jsx("div",{className:ie(`${r}-list-item-title`,l),children:n}),i&&!t?u:null]},e)},oi=({list:e,draggable:t,checkable:n,showListItemOption:r,className:a,showTitle:i=!0,title:o,listHeight:l=280})=>{var x,C,j;const{hashId:u}=d.useContext(Xt),{columnsMap:m,setColumnsMap:g,sortKeyColumns:f,setSortKeyColumns:h}=d.useContext(qn),p=e&&e.length>0,S=d.useMemo(()=>{if(!p)return{};const b=[],T=new Map,$=(E,R)=>E.map(({key:I,dataIndex:M,children:Y,...U})=>{var D,O;const A=pr(I,[R==null?void 0:R.columnKey,U.index].filter(Boolean).join("-")),k=(m==null?void 0:m[A||"null"])||{show:!0};k.show!==!1&&!Y&&b.push(A);const F={key:A,...Ze(U,["className"]),selectable:!1,disabled:k.disable===!0,disableCheckbox:typeof k.disable=="boolean"?k.disable:(D=k.disable)==null?void 0:D.checkbox,isLeaf:R?!0:void 0};return Y&&(F.children=$(Y,{...k,columnKey:A}),(O=F.children)!=null&&O.every(B=>b==null?void 0:b.includes(B.key))&&b.push(A)),T.set(I,{...F,parentKey:R==null?void 0:R.columnKey}),F});return{list:$(e),keys:b,map:T}},[m,e,p]),y=je((b,T,$)=>{const E={...m},R=[...f],I=R.findIndex(A=>A===b),M=R.findIndex(A=>A===T),Y=$>=I;if(I<0)return;const U=R[I];R.splice(I,1),$===0?R.unshift(U):R.splice(Y?M:M+1,0,U),R.forEach((A,k)=>{E[A]={...E[A]||{},order:k}}),g(E),h(R)}),w=je(b=>{const T={...m},$=E=>{var M,Y,U,A,k,F;const R={...T[E]};R.show=b.checked,(Y=(M=S.map)==null?void 0:M.get(E))!=null&&Y.children&&((A=(U=S.map.get(E))==null?void 0:U.children)==null||A.forEach(D=>$(D.key)));const I=(F=(k=S.map)==null?void 0:k.get(E))==null?void 0:F.parentKey;I&&(T[I]={...T[I],show:!0}),T[E]=R};$(b.node.key),g({...T})});if(!p)return null;const v=s.jsx(c.Tree,{itemHeight:24,draggable:t&&!!((x=S.list)!=null&&x.length)&&((C=S.list)==null?void 0:C.length)>1,checkable:n,onDrop:b=>{const T=b.node.key,$=b.dragNode.key,{dropPosition:E,dropToGap:R}=b,I=E===-1||!R?E+1:E;y($,T,I)},blockNode:!0,onCheck:(b,T)=>w(T),checkedKeys:S.keys,showLine:!1,titleRender:b=>{const T={...b,children:void 0};if(!T.title)return null;const $=vt(T.title,T),E=s.jsx(c.Typography.Text,{style:{width:80},ellipsis:{tooltip:$},children:$});return s.jsx(uT,{className:a,...Ze(T,["key"]),showListItemOption:r,title:E,columnKey:T.key})},height:l,treeData:(j=S.list)==null?void 0:j.map(({disabled:b,...T})=>T)});return s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:ie(`${a}-list-title`,u),children:o}),v]})},dT=({localColumns:e,className:t,draggable:n,checkable:r,showListItemOption:a,listsHeight:i})=>{const{hashId:o}=d.useContext(Xt),l=[],u=[],m=[],g=Ne();e.forEach(p=>{if(p.hideInSetting)return;const{fixed:S}=p;if(S==="left"){u.push(p);return}if(S==="right"){l.push(p);return}m.push(p)});const f=l&&l.length>0,h=u&&u.length>0;return s.jsxs("div",{className:ie(`${t}-list`,o,{[`${t}-list-group`]:f||h}),children:[s.jsx(oi,{title:g.getMessage("tableToolBar.leftFixedTitle","固定在左侧"),list:u,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i}),s.jsx(oi,{list:m,draggable:n,checkable:r,showListItemOption:a,title:g.getMessage("tableToolBar.noFixedTitle","不固定"),showTitle:h||f,className:t,listHeight:i}),s.jsx(oi,{title:g.getMessage("tableToolBar.rightFixedTitle","固定在右侧"),list:l,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i})]})};function fT(e){const t=d.useRef(null),n=d.useContext(qn),r=e.columns,{checkedReset:a=!0}=e,{columnsMap:i,setColumnsMap:o,clearPersistenceStorage:l}=n;d.useEffect(()=>{var x,C,j,b;(C=(x=n.propsRef.current)==null?void 0:x.columnsState)!=null&&C.value&&(t.current=JSON.parse(JSON.stringify(((b=(j=n.propsRef.current)==null?void 0:j.columnsState)==null?void 0:b.value)||{})))},[]);const u=je((x=!0)=>{const C={},j=b=>{b.forEach(({key:T,fixed:$,index:E,children:R,disable:I})=>{var Y,U;const M=pr(T,E);M&&(C[M]={show:I?(Y=i==null?void 0:i[M])==null?void 0:Y.show:x,fixed:$,disable:I,order:(U=i==null?void 0:i[M])==null?void 0:U.order}),R&&j(R)})};j(r),o(C)}),m=je(x=>{x.target.checked?u():u(!1)}),g=je(()=>{var x,C;l==null||l(),o(((C=(x=n.propsRef.current)==null?void 0:x.columnsState)==null?void 0:C.defaultValue)||t.current||n.defaultColumnKeyMap)}),f=Object.values(i).filter(x=>!x||x.show===!1),h=f.length>0&&f.length!==r.length,p=Ne(),{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-table-column-setting"),{wrapSSR:w,hashId:v}=cT(y);return w(s.jsx(c.Popover,{arrow:!1,title:s.jsxs("div",{className:ie(`${y}-title`,v),children:[e.checkable===!1?s.jsx("div",{}):s.jsx(c.Checkbox,{indeterminate:h,checked:f.length===0&&f.length!==r.length,onChange:x=>{m(x)},children:p.getMessage("tableToolBar.columnDisplay","列展示")}),a?s.jsx("a",{onClick:g,className:ie(`${y}-action-rest-button`,v),children:p.getMessage("tableToolBar.reset","重置")}):null,e!=null&&e.extra?s.jsx(c.Space,{size:12,align:"center",children:e.extra}):null]}),classNames:{root:ie(`${y}-overlay`,v)},trigger:"click",placement:"bottomRight",content:s.jsx(dT,{checkable:e.checkable??!0,draggable:e.draggable??!0,showListItemOption:e.showListItemOption??!0,className:y,localColumns:r,listsHeight:e.listsHeight}),children:e.children||s.jsx(c.Tooltip,{title:p.getMessage("tableToolBar.columnSetting","列设置"),children:e.settingIcon??s.jsx(de.SettingOutlined,{})})}))}const mT=e=>{const{hashId:t}=d.useContext(Xt),n=e.hashId??t,{items:r=[],type:a="inline",prefixCls:i,activeKey:o,defaultActiveKey:l}=e,[u,m]=dt(o||l,o),g=d.useCallback(h=>{m(p=>{var y;const S=typeof h=="function"?h(p):h;return(y=e.onChange)==null||y.call(e,S,p),S})},[e.onChange]);if(r.length<1)return null;const f=r.find(h=>h.key===u)||r[0];return a==="inline"?s.jsx("div",{className:ie(`${i}-menu`,`${i}-inline-menu`,n),children:r.map((h,p)=>s.jsx("div",{onClick:()=>{g(h.key)},className:ie(`${i}-inline-menu-item`,f.key===h.key?`${i}-inline-menu-item-active`:void 0,n),children:h.label},h.key||p))}):a==="tab"?s.jsx(c.Tabs,{items:r.map(h=>{var p;return{...h,key:(p=h.key)==null?void 0:p.toString()}}),activeKey:f.key,onTabClick:h=>g(h)}):s.jsx("div",{className:ie(`${i}-menu`,`${i}-dropdownmenu`,n),children:s.jsx(c.Dropdown,{trigger:["click"],menu:{selectedKeys:[f.key],onClick:h=>{g(h.key)},items:r.map((h,p)=>({key:h.key||p,disabled:h.disabled,label:h.label}))},children:s.jsxs(c.Space,{className:ie(`${i}-dropdownmenu-label`,n),children:[f.label,s.jsx(de.DownOutlined,{})]})})})},hT=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"1","&-container":{display:"flex",justifyContent:"space-between",paddingBlock:e.padding,paddingInline:e.paddingXS,"&-mobile":{flexDirection:"column"}},"&-title":{display:"flex",alignItems:"center",justifyContent:"flex-start",color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},"&-search:not(:last-child)":{display:"flex",alignItems:"center",justifyContent:"flex-start"},"&-setting-item":{marginBlock:0,marginInline:4,color:e.colorIconHover,fontSize:e.fontSizeLG,cursor:"pointer","> span":{display:"block",width:"100%",height:"100%"},"&:hover":{color:e.colorPrimary}},"&-left":{display:"flex",flexWrap:"wrap",alignItems:"center",gap:e.marginXS,justifyContent:"flex-start",maxWidth:"calc(100% - 200px)",[`${e.antCls}-tabs`]:{width:"100%"},"&-has-tabs":{overflow:"hidden"}},"&-right":{flex:1,display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:e.marginXS},"&-extra-line":{marginBlockEnd:e.margin},"&-setting-items":{display:"flex",gap:e.marginXS,lineHeight:"32px",alignItems:"center"},"&-filter":{"&:not(:last-child)":{marginInlineEnd:e.margin},display:"flex",alignItems:"center",[`div$${e.antCls}-pro-table-search`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0}},"&-inline-menu-item":{display:"inline-block",marginInlineEnd:e.marginLG,cursor:"pointer",opacity:"0.75","&-active":{fontWeight:"bold",opacity:"1"}},[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,"&::before":{borderBlockEnd:0},[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:0,[`${e.antCls}-tabs-tab`]:{paddingBlockStart:0}}},"&-dropdownmenu-label":{fontWeight:"bold",fontSize:e.fontSizeIcon,textAlign:"center",cursor:"pointer"},"@media (max-width: 768px)":{[e.componentCls]:{"&-container":{display:"flex",flexWrap:"wrap",flexDirection:"column"},"&-left":{marginBlockEnd:"16px",maxWidth:"100%"}}}}});function gT(e){return tt("ProTableListToolBar",t=>{const n={...t,componentCls:`.${e}`};return[hT(n)]})}function pT(e){if(d.isValidElement(e))return e;if(e){const t=e,{icon:n,tooltip:r,onClick:a,key:i}=t;return n&&r?s.jsx(c.Tooltip,{title:r,children:s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}):s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}return null}const yT=({prefixCls:e,hashId:t,tabs:n,multipleLine:r,filtersNode:a})=>r?s.jsx("div",{className:ie(`${e}-extra-line`,t),children:n!=null&&n.items&&(n!=null&&n.items.length)?s.jsx(c.Tabs,{style:{width:"100%"},defaultActiveKey:n.defaultActiveKey,activeKey:n.activeKey,items:n.items.map((i,o)=>{var l;return{label:i.tab,...i,key:((l=i.key)==null?void 0:l.toString())||(o==null?void 0:o.toString())}}),onChange:n.onChange,tabBarExtraContent:a}):a}):null,xT=({prefixCls:e,title:t,subTitle:n,tooltip:r,className:a,style:i,search:o,onSearch:l,multipleLine:u=!1,filter:m,actions:g=[],settings:f=[],tabs:h,menu:p})=>{const{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),{token:y}=jn.useToken(),w=S("pro-table-list-toolbar",e),{wrapSSR:v,hashId:x}=gT(w),C=Ne(),[j,b]=d.useState(!1),T=C.getMessage("tableForm.inputPlaceholder","请输入"),$=d.useMemo(()=>o?d.isValidElement(o)?o:s.jsx(c.Input.Search,{style:{width:200},placeholder:T,...o,onSearch:async(...F)=>{var O;await((O=o.onSearch)==null?void 0:O.call(o,...F))!==!1&&(l==null||l(F==null?void 0:F[0]))}}):null,[T,l,o]),E=d.useMemo(()=>m?s.jsx("div",{className:ie(`${w}-filter`,x),children:m}):null,[m,x,w]),R=d.useMemo(()=>p||t||n||r,[p,n,t,r]),I=d.useMemo(()=>Array.isArray(g)?g.length<1?null:s.jsx("div",{style:{display:"flex",alignItems:"center",gap:y.marginXS},children:g.map((F,D)=>d.isValidElement(F)?d.cloneElement(F,{key:D,...F==null?void 0:F.props}):s.jsx(d.Fragment,{children:F},D))}):g,[g]),M=d.useMemo(()=>!!(R&&$||!u&&E||I||f!=null&&f.length),[I,E,R,u,$,f==null?void 0:f.length]),Y=d.useMemo(()=>r||t||n||p||!R&&$,[R,p,$,n,t,r]),U=d.useMemo(()=>!Y&&M?s.jsx("div",{className:ie(`${w}-left`,x)}):!p&&(R||!$)?s.jsx("div",{className:ie(`${w}-left`,x),children:s.jsx("div",{className:ie(`${w}-title`,x),children:s.jsx(fr,{tooltip:r,label:t,subTitle:n})})}):s.jsxs("div",{className:ie(`${w}-left`,x,{[`${w}-left-has-tabs`]:(p==null?void 0:p.type)==="tab",[`${w}-left-has-dropdown`]:(p==null?void 0:p.type)==="dropdown",[`${w}-left-has-inline-menu`]:(p==null?void 0:p.type)==="inline"}),children:[R&&!p&&s.jsx("div",{className:ie(`${w}-title`,x),children:s.jsx(fr,{tooltip:r,label:t,subTitle:n})}),p&&s.jsx(mT,{...p,prefixCls:w,hashId:x}),!R&&$?s.jsx("div",{className:ie(`${w}-search`,x),children:$}):null]}),[Y,M,R,x,p,w,$,n,t,r]),A=d.useMemo(()=>M?s.jsxs("div",{className:ie(`${w}-right`,x),style:j?{}:{alignItems:"center"},children:[u?null:E,R&&$?s.jsx("div",{className:ie(`${w}-search`,x),children:$}):null,I,f!=null&&f.length?s.jsx("div",{className:ie(`${w}-setting-items`,x),children:f.map((F,D)=>{const O=pT(F);return s.jsx("div",{className:ie(`${w}-setting-item`,x),children:O},D)})}):null]}):null,[M,w,x,j,R,$,u,E,I,f]),k=d.useMemo(()=>{if(!M&&!Y)return null;const F=ie(`${w}-container`,x,{[`${w}-container-mobile`]:j});return s.jsxs("div",{className:F,children:[U,A]})},[Y,M,x,j,U,w,A]);return v(s.jsx(ja,{onResize:F=>{F.width<375!==j&&b(F.width<375)},children:F=>s.jsxs("div",{ref:F,style:i,className:ie(w,x,a),children:[k,s.jsx(yT,{filtersNode:E,hashId:x,prefixCls:w,tabs:h,multipleLine:u})]})}))},bT=d.forwardRef((e,t)=>{const{icon:n=s.jsx(de.ColumnHeightOutlined,{})}=e,r=d.useContext(qn),a=Ne();return s.jsx(c.Dropdown,{menu:{selectedKeys:[r.tableSize],onClick:({key:i})=>{var o;(o=r.setTableSize)==null||o.call(r,i)},style:{width:80},items:[{key:"large",label:a.getMessage("tableToolBar.densityLarger","宽松")},{key:"middle",label:a.getMessage("tableToolBar.densityMiddle","中等")},{key:"small",label:a.getMessage("tableToolBar.densitySmall","紧凑")}]},trigger:["click"],children:s.jsx(c.Tooltip,{title:a.getMessage("tableToolBar.density","表格密度"),children:s.jsx("span",{ref:t,children:n})})})}),ST=d.memo(bT),CT=d.forwardRef((e,t)=>{const n=Ne(),[r,a]=d.useState(!1);return d.useEffect(()=>{xo()&&(document.onfullscreenchange=()=>{a(!!document.fullscreenElement)})},[]),r?s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.exitFullScreen","退出全屏"),children:s.jsx("span",{ref:t,children:s.jsx(de.FullscreenExitOutlined,{})})}):s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.fullScreen","全屏"),children:s.jsx("span",{ref:t,children:s.jsx(de.FullscreenOutlined,{})})})}),Wd=d.memo(CT);function wT({intl:e},t){return{reload:{text:e.getMessage("tableToolBar.reload","刷新"),icon:t.reloadIcon??s.jsx(de.ReloadOutlined,{})},density:{text:e.getMessage("tableToolBar.density","表格密度"),icon:s.jsx(ST,{icon:t.densityIcon})},fullScreen:{text:e.getMessage("tableToolBar.fullScreen","全屏"),icon:s.jsx(Wd,{})}}}function jT(e,t,n,r){return Object.keys(e).filter(a=>a).map(a=>{const i=e[a];if(!i)return null;let o=i===!0?t[a]:u=>{i==null||i(u,n.current)};if(typeof o!="function"&&(o=()=>{}),a==="setting")return d.createElement(fT,{...e[a],columns:r,key:a});if(a==="fullScreen")return s.jsx("span",{onClick:o,children:s.jsx(Wd,{})},a);const l=wT(t,e)[a];return l?s.jsx("span",{onClick:o,children:s.jsx(c.Tooltip,{title:l.text,children:l.icon})},a):null}).filter(a=>a)}function vT({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:m,optionsRender:g,...f}){const h=d.useContext(qn),p=Ne(),S=d.useMemo(()=>{const v={reload:()=>{var j;return(j=r==null?void 0:r.current)==null?void 0:j.reload()},density:!0,setting:!0,search:!1,fullScreen:()=>{var j,b;return(b=(j=r==null?void 0:r.current)==null?void 0:j.fullScreen)==null?void 0:b.call(j)}};if(a===!1)return[];const x={...v,fullScreen:!1,...a},C=jT(x,{...v,intl:p},r,m);return g?g({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:m,optionsRender:g,...f},C):C},[r,m,e,p,u,g,a,f,i,o,n,l,t]),y=n?n(r==null?void 0:r.current,{selectedRowKeys:i,selectedRows:o}):[],w=d.useMemo(()=>{if(!a||!a.search)return!1;const v={value:h.keyWords,onChange:x=>h.setKeyWords(x.target.value)};return a.search===!0?v:{...v,...a.search}},[h,a]);return d.useEffect(()=>{h.keyWords===void 0&&(u==null||u(""))},[h.keyWords,u]),s.jsx(xT,{title:e,tooltip:t,search:w,onSearch:u,actions:y,settings:S,...l})}const TT=e=>{const{hideToolbar:t,tableColumn:n,options:r,searchNode:a,tooltip:i,toolbar:o,selectedRows:l,selectedRowKeys:u,headerTitle:m,actionRef:g,toolBarRender:f,optionsRender:h,onFormSearchSubmit:p}=e,S=d.useCallback(y=>{var x,C,j,b;if(!r||!r.search)return;const{name:w="keyword"}=r.search===!0?{}:r.search;((C=(x=r.search)==null?void 0:x.onSearch)==null?void 0:C.call(x,y))!==!1&&((b=(j=g==null?void 0:g.current)==null?void 0:j.setPageInfo)==null||b.call(j,{current:1}),p(xt({_timestamp:Date.now(),[w]:y})))},[r,p,g]);return t?null:s.jsx(vT,{tooltip:i,columns:n,options:r,headerTitle:m,action:g,onSearch:S,selectedRows:l,selectedRowKeys:u,toolBarRender:f,toolbar:{filter:a,...o},optionsRender:h})},FT=(e,t)=>t.searchNode?!1:vn({hideToolbar:e.hideToolbar,tableColumn:e.tableColumn,options:e.options,tooltip:e.tooltip,toolbar:e.toolbar,selectedRows:e.selectedRows,selectedRowKeys:e.selectedRowKeys,headerTitle:e.headerTitle,actionRef:e.actionRef,toolBarRender:e.toolBarRender},{hideToolbar:t.hideToolbar,tableColumn:t.tableColumn,options:t.options,tooltip:t.tooltip,toolbar:t.toolbar,selectedRows:t.selectedRows,selectedRowKeys:t.selectedRowKeys,headerTitle:t.headerTitle,actionRef:t.actionRef,toolBarRender:t.toolBarRender},["render","formItemRender"]),$T=d.memo(TT,FT);function ET(e){const{toolBarRender:t,headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,isLightFilter:m,searchNode:g,options:f,optionsRender:h,actionRef:p,setFormSearch:S,formSearch:y}=e;return d.useMemo(()=>t===!1?null:s.jsx($T,{headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,onFormSearchSubmit:w=>{S({...y||{},...w})},searchNode:m?g:null,options:f,optionsRender:h,actionRef:p,toolBarRender:t}),[p,y,n,r,m,f,h,g,i,a,S,o,t,l,u])}const RT=({pageInfo:e})=>{if(e){const{current:t,defaultCurrent:n,pageSize:r,defaultPageSize:a}=e;return{current:t||n||1,total:0,pageSize:r||a||20}}return{current:1,total:0,pageSize:20}};function IT(e){const[t,n]=dt(()=>RT(e),void 0),r=d.useCallback(i=>{n(o=>{var u;const l=typeof i=="function"?i(o):i;return(u=e==null?void 0:e.onPageInfoChange)==null||u.call(e,l),l})},[e==null?void 0:e.onPageInfoChange]),a=je(i=>{const o={...t,...i};(o.current!==t.current||o.pageSize!==t.pageSize||o.total!==t.total)&&r(o)});return[t,a]}const MT=(e,t,n)=>{var D;const r=d.useRef(!1),a=d.useRef(null),{onLoad:i,manual:o,polling:l,onRequestError:u,debounceTime:m=20,effects:g=[]}=n||{},f=d.useRef(o),h=d.useRef(),[p,S]=dt(t,n==null?void 0:n.dataSource),y=d.useCallback(O=>{S(B=>{const q=typeof O=="function"?O(B):O;return queueMicrotask(()=>{var z;(z=n==null?void 0:n.onDataSourceChange)==null||z.call(n,q)}),q})},[n==null?void 0:n.onDataSourceChange]),w=typeof(n==null?void 0:n.loading)=="object"?(D=n==null?void 0:n.loading)==null?void 0:D.spinning:n==null?void 0:n.loading,[v,x]=dt(!1,w),C=je(O=>{var B;(B=n==null?void 0:n.onLoadingChange)==null||B.call(n,O)}),j=d.useCallback(O=>{x(B=>{const q=typeof O=="function"?O(B):O;return queueMicrotask(()=>{C(q)}),q})},[C]),[b,T]=IT(n),[$,E]=d.useState(!1),R=(O,B)=>{y(O),(b==null?void 0:b.total)!==B&&T({...b,total:B||O.length})},I=Vr(b==null?void 0:b.current),M=Vr(b==null?void 0:b.pageSize),Y=Vr(l),U=je(()=>{j(!1),E(!1)}),A=async(O,B)=>{if(f.current){f.current=!1;return}O?E(!0):j(!0);const{pageSize:q,current:z}=b||{};try{const V=(n==null?void 0:n.pageInfo)!==!1?{current:z,pageSize:q}:void 0,{data:Z=[],success:G,total:H=0,...L}=await(e==null?void 0:e(V))||{};if(B!=null&&B.aborted)return[];if(G===!1)return[];const K=Bv(Z,[n.postData].filter(P=>P));return B!=null&&B.aborted?[]:(R(K,H),i==null||i(K,L),K)}catch(V){if(B!=null&&B.aborted)return[];if(u===void 0)throw new Error(V);p===void 0&&y([]),u(V)}finally{B!=null&&B.aborted||U()}return[]},k=go(async O=>{if(h.current&&clearTimeout(h.current),!e)return;const B=new AbortController;a.current=B;try{const q=await Promise.race([A(O,B.signal),new Promise((V,Z)=>{var G,H,L;(L=(H=(G=a.current)==null?void 0:G.signal)==null?void 0:H.addEventListener)==null||L.call(H,"abort",()=>{Z("aborted"),k.cancel(),U()})})]);if(B.signal.aborted)return;const z=vt(l,q);return z&&!r.current&&(h.current=setTimeout(()=>{k.run(z)},Math.max(z,2e3))),q}catch(q){if(q==="aborted")return[];throw q}},m||30),F=()=>{var O;(O=a.current)==null||O.abort(),k.cancel(),U()};return d.useEffect(()=>(l||clearTimeout(h.current),!Y&&l&&k.run(!0),()=>{clearTimeout(h.current)}),[l]),d.useEffect(()=>(r.current=!1,()=>{r.current=!0}),[]),d.useEffect(()=>{const{current:O,pageSize:B}=b||{};(!I||I===O)&&(!M||M===B)||n.pageInfo&&p&&(p==null?void 0:p.length)>B||O!==void 0&&p&&p.length<=B&&(F(),k.run(!1))},[b==null?void 0:b.current]),d.useEffect(()=>{M&&(F(),k.run(!1))},[b==null?void 0:b.pageSize]),ir(()=>(F(),k.run(!1),o||(f.current=!1),()=>{F()}),[...g,o]),{dataSource:p,setDataSource:y,loading:typeof(n==null?void 0:n.loading)=="object"?{...n==null?void 0:n.loading,spinning:v}:v,reload:async()=>(F(),f.current=!1,await k.run(!1)),pageInfo:b,pollingLoading:$,reset:async()=>{const{pageInfo:O}=n||{},{defaultCurrent:B=1,defaultPageSize:q=20}=O||{};T({current:B,total:0,pageSize:q})},setPageInfo:async O=>{T(O)}}},AT=e=>(t,n)=>{var m,g,f,h;const{fixed:r,index:a}=t,{fixed:i,index:o}=n;if(r==="left"&&i!=="left"||i==="right"&&r!=="right")return-2;if(i==="left"&&r!=="left"||r==="right"&&i!=="right")return 2;const l=t.key||`${a}`,u=n.key||`${o}`;return(m=e==null?void 0:e[l])!=null&&m.order||(g=e==null?void 0:e[u])!=null&&g.order?(((f=e==null?void 0:e[l])==null?void 0:f.order)||0)-(((h=e==null?void 0:e[u])==null?void 0:h.order)||0):(t.index||0)-(n.index||0)},kT=["",null,void 0],Vc=(...e)=>e.filter(t=>t!==void 0).map(t=>typeof t=="number"?t.toString():t).flat(1),OT=e=>{const t=d.useContext(wr),{columnProps:n,prefixName:r,text:a,counter:i,rowData:o,index:l,recordKey:u,subName:m,proFieldProps:g,editableUtils:f}=e,h=Tt.useFormInstance(),p=u||l,S=d.useMemo(()=>{var b;return((b=f==null?void 0:f.getRealIndex)==null?void 0:b.call(f,o))??l},[f,l,o]),[y,w]=d.useState(()=>Vc(r,r?m:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l)),v=d.useMemo(()=>y.slice(0,-1),[y]);d.useEffect(()=>{const b=Vc(r,r?m:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l);b.join("-")!==y.join("-")&&w(b)},[n==null?void 0:n.dataIndex,n==null?void 0:n.key,l,u,r,p,m,y,S]);const x=d.useMemo(()=>[h,{...n,rowKey:v,rowIndex:l,isEditable:!0}],[n,h,l,v]),C=d.useCallback(({children:b,...T})=>s.jsx(wp,{popoverProps:{getPopupContainer:t.getPopupContainer||(()=>i.rootDomRef.current||document.body)},errorType:"popover",name:y,...T,children:b},p),[p,y]),j=d.useCallback(()=>{const b={...Ai(n==null?void 0:n.formItemProps,...x)};b.messageVariables={label:(n==null?void 0:n.title)||"此项",type:(n==null?void 0:n.valueType)||"文本",...b==null?void 0:b.messageVariables},b.initialValue=(r?null:a)??(b==null?void 0:b.initialValue)??(n==null?void 0:n.initialValue);let T=s.jsx(En,{cacheForSwr:!0,name:y,proFormFieldKey:p,ignoreFormItem:!0,fieldProps:Ai(n==null?void 0:n.fieldProps,...x),...g},y.join("-"));return n!=null&&n.formItemRender&&(T=n.formItemRender({...n,index:l,isEditable:!0,type:"table"},{defaultRender:()=>s.jsx(s.Fragment,{children:T}),type:"form",recordKey:u,record:{...o,...h==null?void 0:h.getFieldValue([p])},isEditable:!0},h,e.editableUtils),n.ignoreFormItem)?s.jsx(s.Fragment,{children:T}):s.jsx(C,{...b,children:T},y.join("-"))},[n,x,r,a,p,y,g,C,l,u,o,h,e.editableUtils]);return y.length===0?null:typeof(n==null?void 0:n.formItemRender)=="function"||typeof(n==null?void 0:n.fieldProps)=="function"||typeof(n==null?void 0:n.formItemProps)=="function"?s.jsx(c.Form.Item,{noStyle:!0,shouldUpdate:(b,T)=>{if(b===T)return!1;const $=[v].flat(1);try{return JSON.stringify(Be(b,$))!==JSON.stringify(Be(T,$))}catch{return!0}},children:()=>j()}):j()};function qd(e){var m,g;const{text:t,valueType:n,rowData:r,columnProps:a,index:i}=e;if((!n||["textarea","text"].includes(n.toString()))&&!(a!=null&&a.valueEnum)&&e.mode==="read")return kT.includes(t)?e.columnEmptyText:t;if(typeof n=="function"&&r)return qd({...e,valueType:n(r,e.type)||"text"});const o=(a==null?void 0:a.key)||((m=a==null?void 0:a.dataIndex)==null?void 0:m.toString()),l=a!=null&&a.dependencies?[e.prefixName,e.prefixName?i==null?void 0:i.toString():(g=e.recordKey)==null?void 0:g.toString(),a==null?void 0:a.dependencies].filter(Boolean).flat(1):[],u={valueEnum:vt(a==null?void 0:a.valueEnum,r),request:a==null?void 0:a.request,dependencies:a!=null&&a.dependencies?[l]:void 0,originDependencies:a!=null&&a.dependencies?[a==null?void 0:a.dependencies]:void 0,params:vt(a==null?void 0:a.params,r,a),readonly:a==null?void 0:a.readonly,text:n==="index"||n==="indexBorder"?e.index:t,mode:e.mode,formItemRender:void 0,valueType:n,record:r,proFieldProps:{emptyText:e.columnEmptyText,proFieldKey:o?`table-field-${o}`:void 0}};return e.mode!=="edit"?s.jsx(En,{mode:"read",ignoreFormItem:!0,fieldProps:Ai(a==null?void 0:a.fieldProps,null,a),...u}):s.jsx(OT,{...e,proFieldProps:u},e.recordKey)}const DT=e=>{var r;const{title:t}=e,n=typeof(e==null?void 0:e.ellipsis)=="boolean"?e==null?void 0:e.ellipsis:(r=e==null?void 0:e.ellipsis)==null?void 0:r.showTitle;return t&&typeof t=="function"?t(e,"table",null):s.jsx(fr,{label:t,tooltip:e.tooltip,ellipsis:n})};function PT(e,t,n,r){return typeof r=="boolean"?r===!1:(r==null?void 0:r(e,t,n))===!1}const NT=(e,t,n)=>{const r=Array.isArray(n)?Be(t,n):t[n],a=String(r);return String(a)===String(e)};function LT({columnProps:e,text:t,rowData:n,index:r,columnEmptyText:a,counter:i,type:o,subName:l,marginSM:u,editableUtils:m}){const{action:g,prefixName:f}=i,{isEditable:h,recordKey:p}=m.isEditable({...n,index:r}),{renderText:S=j=>j}=e,y=S(t,n,r,g),w=h&&!PT(t,n,r,e==null?void 0:e.editable)?"edit":"read",v=qd({text:y,valueType:e.valueType||"text",index:r,rowData:n,subName:l,columnProps:{...e,entry:n,entity:n},counter:i,columnEmptyText:a,type:o,recordKey:p,mode:w,prefixName:f,editableUtils:m}),x=w==="edit"?v:Dp(v,e,y,t);if(w==="edit")return e.valueType==="option"?s.jsx("div",{style:{display:"flex",alignItems:"center",gap:u,justifyContent:e.align==="center"?"center":"flex-start"},children:m.actionRender({...n,index:e.index||r})}):x;if(!e.render){const j=d.isValidElement(x)||["string","number"].includes(typeof x);return!Lt(x)&&j?x:null}const C=e.render(x,n,r,{...g,...m},{...e,isEditable:h,type:"table"});return Vv(C)?C:C&&e.valueType==="option"&&Array.isArray(C)?s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:8},children:C}):C}function _T(e){const{onFilter:t,dataIndex:n}=e;return t===!0?(r,a)=>NT(r,a,n):Wu(t)}function zT(e){const{filters:t=[],valueEnum:n}=e;return t===!0?Fd(vt(n,void 0)).filter(r=>r&&r.value!=="all"):t}function BT(e,t,n){return{fixed:((e==null?void 0:e[t])||{fixed:n.fixed}).fixed}}function VT(e,t,n){return{filteredValue:Wv(e,n),sortOrder:Kv(t,n)}}function HT(e,t,n,r,a){var u;if(typeof e!="object"||e===null||!Reflect.has(e,n))return;const i=e,o=i[n],l=a.get(o)||[];return(u=i[r])==null||u.forEach(m=>{const g=m[n];a.has(g)||a.set(g,l.concat([t,r]))}),o}function YT(e,t,n){let r=t.rowKey??"id";return function(i,o,l){typeof t.rowKey=="function"&&(r=t.rowKey(o,l));const u=HT(o,l,r,t.childrenColumnName,n);return LT({columnProps:e,text:i,rowData:o,index:l,columnEmptyText:t.columnEmptyText,counter:t.counter,type:t.type,marginSM:t.marginSM,subName:n.get(u)??[],editableUtils:t.editableUtils})}}function Gd(e){var i;const{columns:t,context:n,parents:r}=e,a=new Map;return(i=t==null?void 0:t.map((o,l)=>{if(o===c.Table.EXPAND_COLUMN||o===c.Table.SELECTION_COLUMN)return o;const{key:u,dataIndex:m,valueEnum:g,valueType:f="text",children:h}=o,p=pr(u||(m==null?void 0:m.toString()),[r==null?void 0:r.key,l].filter(Boolean).join("-"));if(!g&&!f&&!h)return{index:l,...o};const{filteredValue:y,sortOrder:w}=VT(n.proFilter,n.proSort,o),{fixed:v}=BT(n.counter.columnsMap,p,o),x={index:l,key:p,...o,title:DT(o),valueEnum:g,filters:zT(o),onFilter:_T(o),filteredValue:y,sortOrder:w,fixed:v,width:o.width||(o.fixed?200:void 0),children:o.children?Gd({columns:(o==null?void 0:o.children)??[],context:n,parents:{...o,key:p}}):void 0,render:YT(o,n,a)};return Up(x)}))==null?void 0:i.filter(o=>!o.hideInTable)}function UT({dataSource:e,editableUtils:t,pagination:n,getRowKey:r,childrenColumnName:a}){var f;const i=Array.isArray(e)?[...e]:[],o=t==null?void 0:t.newLineRecord,l=o==null?void 0:o.defaultValue;if(!o||!l)return i;const{options:u}=o,m=a;if(u!=null&&u.parentKey){const h={...l,map_row_parentKey:(f=it(u.parentKey))==null?void 0:f.toString()},p={data:i,getRowKey:r,row:h,key:(u==null?void 0:u.recordKey)??r(h,-1),childrenColumnName:m};return Pr(p,(u==null?void 0:u.position)==="top"?"top":"update")}if((u==null?void 0:u.position)==="top")return[l,...i];const g=n&&typeof n=="object"?n:void 0;if(g!=null&&g.current&&(g!=null&&g.pageSize)){if(g.pageSize>i.length)return i.push(l),i;const h=g.current*g.pageSize-1;return i.splice(h,0,l),i}return i.push(l),i}function KT({propsCardProps:e,notNeedCardDom:t,name:n,hideToolbar:r,toolbarDom:a}){return e===!1||t||n?{}:r?{padding:0}:a?{paddingBlockStart:0}:{padding:0}}function WT({rowKey:e,name:t}){return d.useMemo(()=>typeof e=="function"?e:(n,r)=>r===-1?n==null?void 0:n[e]:t?r==null?void 0:r.toString():(n==null?void 0:n[e])??(r==null?void 0:r.toString()),[t,e])}function qT({propsPagination:e,action:t,intl:n,request:r,type:a}){return d.useMemo(()=>{const i=e===!1?!1:{...e||{}},o={...t.pageInfo,setPageInfo:({pageSize:l,current:u})=>{const{pageInfo:m}=t;if(l===m.pageSize||m.current===1){t.setPageInfo({pageSize:l,current:u});return}r&&t.setDataSource([]),t.setPageInfo({pageSize:l,current:a==="list"?u:1})}};return r&&i&&(delete i.onChange,delete i.onShowSizeChange),_v(i,o,n)},[t,n,e,r,a])}function GT({propsRowSelection:e,selectedRowKeys:t,selectedRows:n,onCleanSelected:r,tableAlertOptionRender:a,tableAlertRender:i}){return d.useMemo(()=>e===!1?null:s.jsx(Lv,{selectedRowKeys:t,selectedRows:n,onCleanSelected:r,alertOptionRender:a,alertInfoRender:i,alwaysShowAlert:e==null?void 0:e.alwaysShowAlert}),[r,e,t,n,a,i])}const ZT={},JT=e=>{var Rn,Zn,us,Jn,Xn,ds;const{cardBordered:t,request:n,className:r,params:a=ZT,defaultData:i,headerTitle:o,postData:l,ghost:u,pagination:m,actionRef:g,toolBarRender:f,optionsRender:h,onLoad:p,onRequestError:S,style:y,cardProps:w,tableStyle:v,tableClassName:x,options:C,search:j,name:b,onLoadingChange:T,rowSelection:$=!1,beforeSearchSubmit:E,tableAlertRender:R,defaultClassName:I,formRef:M,type:Y="table",columnEmptyText:U="-",toolbar:A,rowKey:k,manualRequest:F,polling:D,tooltip:O,revalidateOnFocus:B=!1,searchFormRender:q,...z}=e,{wrapSSR:V,hashId:Z}=Xv(e.defaultClassName),G=ie(I,r,Z),H=d.useRef(),L=d.useRef(null),K=d.useRef(),P=M||K;d.useImperativeHandle(g,()=>H.current);const[W,te]=dt($?($==null?void 0:$.defaultSelectedRowKeys)||[]:void 0,$?$.selectedRowKeys:void 0),[re,X]=d.useState(()=>{if(!(F||j!==!1))return{}}),se=d.useRef(re),ae=je(ge=>{const we=typeof ge=="function"?ge(se.current):ge;se.current=we,X(we)}),{columns:ue=[],columnsState:pe}=e,{defaultProFilter:me,defaultProSort:fe}=d.useMemo(()=>{const{sort:ge,filter:we}=Uv(eo(ue));return{defaultProFilter:we,defaultProSort:ge}},[ue]),[ye,Te]=d.useState(me),[Oe,Ae]=d.useState(fe);ir(()=>{Te(me),Ae(fe)},[me,fe]);const ze=Ne(),ce=typeof m=="object"?m:{defaultCurrent:1,defaultPageSize:20,pageSize:20,current:1},_=d.useContext(qn),J=d.useMemo(()=>{if(n)return async ge=>{const we={...ge||{},...se.current||{},...a};return delete we._timestamp,await n(we,Oe,ye)}},[re,a,ye,Oe,n]),le=MT(J,i,{pageInfo:m===!1?!1:ce,loading:e.loading,dataSource:e.dataSource,onDataSourceChange:e.onDataSourceChange,onLoad:p,onLoadingChange:T,onRequestError:S,postData:l,revalidateOnFocus:B,manual:re===void 0,polling:D,effects:[wn(a),wn(re),wn(ye),wn(Oe)],debounceTime:e.debounceTime,onPageInfoChange:ge=>{var we,N;!m||!J||((we=m==null?void 0:m.onChange)==null||we.call(m,ge.current,ge.pageSize),(N=m==null?void 0:m.onShowSizeChange)==null||N.call(m,ge.current,ge.pageSize))}});d.useEffect(()=>{var we;if(e.manualRequest||!e.request||!B||(we=e.form)!=null&&we.ignoreRules)return;const ge=()=>{document.visibilityState==="visible"&&le.reload()};return document.addEventListener("visibilitychange",ge),()=>document.removeEventListener("visibilitychange",ge)},[]);const Se=d.useRef(new Map),Ee=WT({rowKey:k,name:e.name});d.useMemo(()=>{var ge;return(ge=le.dataSource)!=null&&ge.length?le.dataSource.map(N=>{const ee=Ee(N,-1);return Se.current.set(ee,N),ee}):[]},[le.dataSource,Ee]);const Fe=qT({propsPagination:m,action:le,intl:ze,request:n,type:Y});ir(()=>{Fe&&(Fe.current!==le.pageInfo.current||Fe.pageSize!==le.pageInfo.pageSize)&&le.setPageInfo({current:Fe.current,pageSize:Fe.pageSize})},[Fe]),ir(()=>{var ge;e.request&&!IC(a)&&le.dataSource&&!Qa(le.dataSource,i)&&((ge=le==null?void 0:le.pageInfo)==null?void 0:ge.current)!==1&&le.setPageInfo({current:1})},[a]),_.setPrefixName(e.name),d.useEffect(()=>{(pe==null?void 0:pe.value)!==void 0&&_.setColumnsMap(pe.value)},[pe==null?void 0:pe.value]);const Ie=je(()=>{$&&$.onChange&&$.onChange([],[],{type:"none"}),te([])});_.propsRef.current=e;const De=KC({...e.editable,tableName:e.name,getRowKey:Ee,childrenColumnName:((Rn=e.expandable)==null?void 0:Rn.childrenColumnName)||"children",dataSource:le.dataSource||[],setDataSource:ge=>{var we,N;(N=(we=e.editable)==null?void 0:we.onValuesChange)==null||N.call(we,void 0,ge),le.setDataSource(ge)}}),{token:ve}=jn==null?void 0:jn.useToken();zv(H,le,{nativeElement:((Zn=_.rootDomRef)==null?void 0:Zn.current)||void 0,focus:()=>{var ge,we;(we=(ge=_.rootDomRef)==null?void 0:ge.current)==null||we.focus()},fullScreen:()=>{var ge,we;!((ge=_.rootDomRef)!=null&&ge.current)||!document.fullscreenEnabled||(document.fullscreenElement?document.exitFullscreen():(we=_.rootDomRef)==null||we.current.requestFullscreen())},onCleanSelected:()=>{Ie()},resetAll:()=>{var N,ee,xe,$e,Ke;Ie(),_.setKeyWords(void 0),le.setPageInfo({current:1}),Te(me),Ae(fe),(N=P==null?void 0:P.current)==null||N.resetFields();const ge=((xe=(ee=P==null?void 0:P.current)==null?void 0:ee.getFieldsFormatValue)==null?void 0:xe.call(ee,!0))??((Ke=($e=P==null?void 0:P.current)==null?void 0:$e.getFieldsValue)==null?void 0:Ke.call($e,!0))??{},we=E?E(ge):ge;ae(we??{})},editableUtils:De,scrollTo:ge=>{var we,N;return(N=(we=L==null?void 0:L.current)==null?void 0:we.scrollTo)==null?void 0:N.call(we,ge)}}),_.setAction(H.current);const ke=d.useMemo(()=>{var we;const ge={counter:_,columnEmptyText:U,type:Y,editableUtils:De,marginSM:ve.marginSM,rowKey:k??"id",childrenColumnName:((we=e.expandable)==null?void 0:we.childrenColumnName)??"children",proFilter:ye,proSort:Oe};return Gd({columns:ue,context:ge}).sort(AT(_.columnsMap??{}))},[ue,_==null?void 0:_.sortKeyColumns,_==null?void 0:_.columnsMap,U,Y,De.editableKeys&&De.editableKeys.join(","),ye,Oe]);Uu(()=>{if(ke&&ke.length>0){const ge=ke.map(we=>pr(we.key,we.index));_.setSortKeyColumns(ge)}},[ke],["render","formItemRender"],100),ir(()=>{const{pageInfo:ge}=le,{current:we=ge==null?void 0:ge.current,pageSize:N=ge==null?void 0:ge.pageSize}=m||{};m&&(we||N)&&(N!==(ge==null?void 0:ge.pageSize)||we!==(ge==null?void 0:ge.current))&&le.setPageInfo({pageSize:N||ge.pageSize,current:we||ge.current})},[m&&m.pageSize,m&&m.current]);const Le={selectedRowKeys:W,...$,onChange:(ge,we,N)=>{$&&$.onChange&&$.onChange(ge,we,N),te(ge)}},lt=j!==!1&&(j==null?void 0:j.filterType)==="light",nt=je(ge=>{var we,N;if(C&&C.search){const{name:ee="keyword"}=C.search===!0?{}:C.search;if(((N=(we=C.search)==null?void 0:we.onSearch)==null?void 0:N.call(we,_.keyWords))!==!1){ae({...ge,[ee]:_.keyWords});return}}ae(ge)}),ne=d.useMemo(()=>{var ge;return typeof le.loading=="object"?((ge=le.loading)==null?void 0:ge.spinning)||!1:le.loading},[le.loading]),Q=s.jsx(oT,{search:j,type:Y,pagination:Fe,beforeSearchSubmit:E,actionRef:H,columns:ue,onFormSearchSubmit:nt,ghost:u,onReset:e.onReset,onSubmit:e.onSubmit,loading:!!ne,manualRequest:F,form:e.form,formRef:P,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,searchFormRender:q,proTableProps:e}),he=d.useMemo(()=>W==null?void 0:W.map(ge=>{var we;return(we=Se.current)==null?void 0:we.get(ge)}),[le.dataSource,W]),Ce=d.useMemo(()=>C===!1&&!o&&!f&&!A&&!lt,[C,o,f,A,lt]),Je=s.jsx(ET,{toolBarRender:f,headerTitle:o,hideToolbar:Ce,selectedRows:he,selectedRowKeys:W,tableColumn:ke,tooltip:O,toolbar:A,isLightFilter:lt,searchNode:Q,options:C,optionsRender:h,actionRef:H,setFormSearch:ae,formSearch:re}),Ct=GT({propsRowSelection:$,selectedRowKeys:W,selectedRows:he,onCleanSelected:Ie,tableAlertOptionRender:z.tableAlertOptionRender,tableAlertRender:R}),tn=d.useMemo(()=>{var ge;return UT({dataSource:le.dataSource,editableUtils:De,pagination:Fe,getRowKey:Ee,childrenColumnName:((ge=e.expandable)==null?void 0:ge.childrenColumnName)||"children"})},[le.dataSource,De==null?void 0:De.newLineRecord,Ee,Fe,(us=e.expandable)==null?void 0:us.childrenColumnName]),ht=d.useMemo(()=>{const ge=we=>we.map(N=>{var $e;const ee=pr(N.key,N.index),xe=($e=_.columnsMap)==null?void 0:$e[ee];return xe&&xe.show===!1?!1:N.children?{...N,children:ge(N.children)}:N}).filter(Boolean);return ge(ke)},[_.columnsMap,ke]),is=d.useMemo(()=>eo(ht).filter(we=>!!we.filters),[ht]),Ta=ge=>{Qa(ge,Oe)||Ae(ge??{})},Fa=ge=>{Qa(ge,ye)||Te(ge??{})},fn=()=>({...z,size:_.tableSize,rowSelection:$===!1?void 0:Le,className:x,style:v,columns:ht,loading:le.loading,dataSource:tn,pagination:Fe,onChange:(ge,we,N,ee)=>{var Ke;(Ke=z.onChange)==null||Ke.call(z,ge,we,N,ee);const xe=Hv(we,is);Fa(xt(xe));const $e=Yv(N);Ta(xt($e))}}),Gn=j===!1&&!o&&!f,os=s.jsx(To.Provider,{value:{grid:!1,colProps:void 0,rowProps:void 0},children:s.jsx(c.Table,{...fn(),rowKey:k,ref:L})}),Tr=e.tableViewRender?e.tableViewRender({...fn(),rowSelection:$!==!1?Le:void 0},os):os,ls=e.editable&&!b?s.jsxs(s.Fragment,{children:[Je,Ct,d.createElement(Tt,{...e.editable.formProps,formRef:(Jn=e.editable.formProps)==null?void 0:Jn.formRef,component:!1,form:e.editable.form,onValuesChange:De.onValuesChange,key:"table",submitter:!1,omitNil:!1,dateFormatter:e.dateFormatter},Tr)]}):s.jsxs(s.Fragment,{children:[Je,Ct,Tr]}),$a=KT({propsCardProps:w,notNeedCardDom:Gn,name:e.name,hideToolbar:Ce,toolbarDom:Je}),Ue=d.useMemo(()=>w!==!1&&!e.name&&!Gn||w!==!1&&Y==="list",[w,e.name,Y,Gn]),Fr=w===!1?{}:w??{},cs=Ue?s.jsx(Ca,{...Fr,ghost:u,variant:Kd("table",t)?"outlined":"borderless",styles:{body:{...$a,...((Xn=Fr.styles)==null?void 0:Xn.body)??{}},header:(ds=Fr.styles)==null?void 0:ds.header},children:ls}):ls,Ea=()=>e.tableRender?e.tableRender(e,cs,{toolbar:Je||void 0,alert:Ct||void 0,table:Tr||void 0}):cs,$r=s.jsxs("div",{className:ie(G,{[`${I}-polling`]:le.pollingLoading}),style:y,ref:_.rootDomRef,"data-testid":"pro-table",children:[lt?null:Q,Y!=="form"&&e.tableExtraRender&&s.jsx("div",{className:ie(G,`${I}-extra`),children:e.tableExtraRender(e,le.dataSource||[])}),Y!=="form"&&Ea()]});return!C||!(C!=null&&C.fullScreen)?V($r):V(s.jsx(c.ConfigProvider,{getPopupContainer:()=>_.rootDomRef.current||document.body,children:$r}))},vr=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=e.ErrorBoundary===!1?d.Fragment:e.ErrorBoundary||fp,r=d.useContext(Zt);return s.jsx(Gv,{initValue:{...e,columnsState:e.columnsState,columns:e.columns,onSizeChange:e.onSizeChange,size:e.size||void 0,defaultSize:e.defaultSize||void 0},children:s.jsx(Bn,{valueTypeMap:{...r.valueTypeMap,...Rd},needDeps:!0,children:s.jsx(n,{children:s.jsx(JT,{defaultClassName:`${t("pro-table")}`,...e})})})})};vr.Summary=c.Table.Summary;let XT="/api";function ct(){return cn.createRequest({baseURL:XT,timeout:15e3})}const Xe={listResourcesByApp:e=>ct().get("/ctc/authz/resources/page-by-app",{params:e}),listAllResources:()=>ct().get("/ctc/authz/resources/list"),pageResources:e=>ct().get("/ctc/authz/resources/page",{params:e}),distinctApps:()=>ct().get("/ctc/authz/resources/distinct-apps"),getResource:e=>ct().get("/ctc/authz/resources",{params:{id:e}}),createResource:e=>ct().post("/ctc/authz/resources",e),updateResource:(e,t)=>ct().put("/ctc/authz/resources",t,{params:{id:e}}),deleteResource:e=>ct().delete("/ctc/authz/resources",{params:{id:e}}),listResourceRoles:e=>ct().get("/ctc/authz/resources/roles",{params:{resourceId:e}}),grantRoleResource:(e,t,n)=>{const r=n==null?{}:{dataFilter:n};return ct().post("/ctc/authz/roles/grant-resource",r,{params:{roleId:e,resourceId:t}})},revokeRoleResource:(e,t)=>ct().delete("/ctc/authz/roles/revoke-resource",{params:{roleId:e,resourceId:t}}),listAllRoles:()=>ct().get("/ctc/authz/roles/list"),pageRoles:e=>ct().get("/ctc/authz/roles/page",{params:e}),getRole:e=>ct().get("/ctc/authz/roles",{params:{id:e}}),createRole:e=>ct().post("/ctc/authz/roles",e),updateRole:(e,t)=>ct().put("/ctc/authz/roles",t,{params:{id:e}}),deleteRole:e=>ct().delete("/ctc/authz/roles",{params:{id:e}}),listUserRoles:e=>ct().get("/ctc/authz/users/roles",{params:{userId:e}}),listUserPermissions:e=>ct().get("/ctc/authz/users/permissions",{params:{userId:e}}),grantUserRole:(e,t,n)=>{const r={userId:e,roleId:t};return n&&(r.expireAt=n),ct().post("/ctc/authz/users/grant-role",null,{params:r})},revokeUserRole:(e,t)=>ct().delete("/ctc/authz/users/revoke-role",{params:{userId:e,roleId:t}}),listRolePermissions:e=>ct().get("/ctc/authz/roles/resources",{params:{roleId:e}}),check:e=>ct().post("/ctc/authz/check",e)},lr={listAccounts:e=>sn.listByTenant(e),listUserRoles:e=>Xe.listUserRoles(e),listUserPermissions:e=>Xe.listUserPermissions(e),listRoleResources:e=>Xe.listRolePermissions(e)},{Text:QT}=c.Typography,As={0:{text:"禁用",color:"default"},1:{text:"正常",color:"success"},2:{text:"锁定",color:"warning"}},ks={1:{text:"超级管理员",color:"red"},2:{text:"租户管理员",color:"volcano"},3:{text:"普通成员",color:"blue"},4:{text:"临时账号",color:"orange"}},eF={1:{text:"用户名",color:"blue"},2:{text:"邮箱",color:"purple"},3:{text:"手机",color:"cyan"}};function nn({value:e}){const t=e==null||e===""?"-":String(e);return t==="-"?s.jsx("span",{children:"-"}):s.jsx(c.Tooltip,{title:t,placement:"topLeft",children:s.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})})}function tF({apiBaseURL:e}){var Oe,Ae,ze,ce;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),[w]=c.Form.useForm(),[v,x]=d.useState(!1),[C,j]=d.useState(null),[b,T]=d.useState("info"),[$,E]=d.useState([]),[R,I]=d.useState(!1),[M,Y]=d.useState([]),[U,A]=d.useState([]),[k,F]=d.useState(!1),[D,O]=d.useState(!1),[B,q]=d.useState([]),[z,V]=d.useState(!1),Z=async _=>{if(!_){E([]);return}I(!0);try{const J=await df.list({accountId:Number(_),pageSize:50});E((J==null?void 0:J.records)||[])}catch{E([])}finally{I(!1)}},G=async _=>{if(!_){Y([]),A([]);return}F(!0),O(!0);try{const[J,le]=await Promise.all([lr.listUserRoles(_),lr.listUserPermissions(_)]);Y(Array.isArray(J)?J:[]),A(Array.isArray(le)?le:[])}catch{Y([]),A([])}finally{F(!1),O(!1)}},H=async _=>{if(!_){q([]);return}V(!0);try{const J=await sn.listAffiliations(Number(_));q(Array.isArray(J)?J:[])}catch{q([])}finally{V(!1)}},L=_=>{j(_),T("info"),x(!0),Z(_.id)},K=()=>{x(!1),j(null),E([]),Y([]),A([]),q([])},P=_=>{T(_),_==="logs"&&(C!=null&&C.id)&&Z(C.id),_==="roles"&&(C!=null&&C.id)&&G(C.id),_==="affiliations"&&(C!=null&&C.id)&&H(C.id)},W=d.useCallback(()=>{var le;const _=n.getFieldsValue(),J={};_.username&&(J.username=_.username),_.status!==void 0&&(J.status=_.status),_.dateRange&&(J.startDate=_.dateRange[0].format("YYYY-MM-DD"),J.endDate=_.dateRange[1].format("YYYY-MM-DD")),a(J),(le=t.current)==null||le.reload()},[n]),te=d.useCallback(()=>{var _;n.resetFields(),a({}),(_=t.current)==null||_.reload()},[n]),re=async _=>{try{let le=await sn.listByTenant({tenant:r.tenant,pageNum:_.current,pageSize:_.pageSize})||[];const Se=r.username,Ee=r.status,Fe=r.startDate,Ie=r.endDate;return le=le.filter(De=>{var ve;return!(Se&&!((ve=De.username)!=null&&ve.includes(Se))||Ee!==void 0&&De.status!==Ee||Fe&&De.createdAt&&Re(De.createdAt).isBefore(Fe,"day")||Ie&&De.createdAt&&Re(De.createdAt).isAfter(Ie,"day"))}),{data:le,success:!0,total:le.length}}catch(J){return c.message.error("获取账号列表失败:"+((J==null?void 0:J.message)||"未知错误")),{data:[],success:!1,total:0}}},X=async()=>{var _;try{const J=await y.validateFields();await sn.create(J),c.message.success("创建成功"),g(!1),y.resetFields(),(_=t.current)==null||_.reload()}catch(J){if(J!=null&&J.errorFields)return;c.message.error("创建失败:"+((J==null?void 0:J.message)||"未知错误"))}},se=async(_,J)=>{var Se;const le=J===1?0:1;try{await sn.updateStatus(_,le),c.message.success(le===1?"已启用":"已停用"),(Se=t.current)==null||Se.reload()}catch(Ee){c.message.error("操作失败:"+((Ee==null?void 0:Ee.message)||"未知错误"))}},ae=async()=>{var _;try{await Promise.all(l.map(J=>sn.updateStatus(J.id,0))),c.message.success(`已停用 ${l.length} 个账号`),o([]),u([]),(_=t.current)==null||_.reload()}catch(J){c.message.error("批量操作失败:"+((J==null?void 0:J.message)||"未知错误"))}},ue=()=>{const _=`ID,账号,昵称,类型,邮箱,手机,租户,状态,创建时间
56
- `,J=l.length>0?l:[];if(J.length===0){c.message.warning("请先选择要导出的数据,或取消选择导出全部");return}const le=_+J.map(Ie=>[Ie.id,Ie.username,Ie.nickname,(ks[Ie.accountType??3]||{text:String(Ie.accountType)}).text,Ie.email,Ie.phone,Ie.tenantCode,(As[Ie.status??1]||{text:String(Ie.status)}).text,Ie.createdAt].join(",")).join(`
57
- `),Se=new Blob(["\uFEFF"+le],{type:"text/csv;charset=utf-8"}),Ee=URL.createObjectURL(Se),Fe=document.createElement("a");Fe.href=Ee,Fe.download=`accounts_${Re().format("YYYYMMDD_HHmmss")}.csv`,Fe.click(),URL.revokeObjectURL(Ee),c.message.success(`已导出 ${J.length} 条数据`)},pe=_=>{S(_),w.resetFields(),h(!0)},me=async()=>{if(p!=null&&p.id)try{const _=await w.validateFields();await sn.resetPassword(p.id,{newPassword:_.newPassword}),c.message.success(`已重置账号 ${p.username} 的密码`),h(!1),w.resetFields()}catch(_){if(_!=null&&_.errorFields)return;c.message.error("重置失败:"+((_==null?void 0:_.message)||"未知错误"))}},fe=[{title:"登录标识",dataIndex:"identifier",width:140},{title:"登录方式",dataIndex:"identityType",width:90,render:(_,J)=>{const le=eF[J.identityType]||{text:`${J.identityType}`,color:"default"};return s.jsx(c.Tag,{color:le.color,children:le.text})}},{title:"结果",dataIndex:"loginStatus",width:80,render:(_,J)=>s.jsx(c.Tag,{color:J.loginStatus===1?"success":"error",children:J.loginStatus===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0},{title:"客户端IP",dataIndex:"clientIp",width:120},{title:"登录时间",dataIndex:"loginTime",width:170,render:_=>_?Re(_).format("YYYY-MM-DD HH:mm:ss"):"-"}],ye=[{title:"租户",dataIndex:"tenantCode",width:110,render:(_,J)=>s.jsx(nn,{value:J.tenantCode})},{title:"组织",width:180,ellipsis:!0,render:(_,J)=>J.orgCode?s.jsx(nn,{value:J.orgName?`${J.orgName} (${J.orgCode})`:J.orgCode}):"-"},{title:"部门",width:180,ellipsis:!0,render:(_,J)=>J.deptCode?s.jsx(nn,{value:J.deptName?`${J.deptName} (${J.deptCode})`:J.deptCode}):"-"},{title:"角色",dataIndex:"roleCode",width:100,render:_=>s.jsx(c.Tag,{style:{margin:0},children:_||"-"})},{title:"状态",dataIndex:"memberStatus",width:90,render:_=>{const J={0:{text:"待接受",color:"processing"},1:{text:"正常",color:"success"},2:{text:"已禁用",color:"error"},3:{text:"已退出",color:"default"}}[_]||{text:String(_),color:"default"};return s.jsx(c.Tag,{color:J.color,style:{margin:0},children:J.text})}},{title:"加入时间",dataIndex:"joinedAt",width:160,render:_=>_?Re(_).format("YYYY-MM-DD HH:mm:ss"):"-"}],Te=[{title:"账号",dataIndex:"username",width:200,fixed:"left",ellipsis:{showTitle:!1},search:!1,render:(_,J)=>s.jsx(nn,{value:J.username})},{title:"昵称",dataIndex:"nickname",width:120,ellipsis:{showTitle:!1},search:!1,render:(_,J)=>s.jsx(nn,{value:J.nickname})},{title:"类型",dataIndex:"accountType",width:104,search:!1,render:(_,J)=>{const le=ks[J.accountType??3]||{text:String(J.accountType??"未知"),color:"default"};return s.jsx(c.Tag,{color:le.color,children:le.text})}},{title:"邮箱",dataIndex:"email",width:150,ellipsis:{showTitle:!1},search:!1,render:(_,J)=>s.jsx(nn,{value:J.email})},{title:"手机",dataIndex:"phone",width:126,ellipsis:{showTitle:!1},search:!1,render:(_,J)=>s.jsx(nn,{value:J.phone})},{title:"租户",dataIndex:"tenantCode",width:92,ellipsis:{showTitle:!1},search:!1,render:(_,J)=>s.jsx(nn,{value:J.tenantCode})},{title:"状态",dataIndex:"status",width:84,search:!1,render:(_,J)=>{const le=As[J.status??1]||{text:String(J.status??"未知"),color:"default"};return s.jsx(c.Tag,{color:le.color,children:le.text})}},{title:"创建时间",dataIndex:"createdAt",width:160,search:!1,ellipsis:{showTitle:!1},render:(_,J)=>s.jsx(nn,{value:J.createdAt?Re(J.createdAt).format("YYYY-MM-DD HH:mm:ss"):null})},{title:"操作",valueType:"option",width:150,fixed:"right",search:!1,render:(_,J)=>[s.jsx(c.Button,{type:"link",size:"small",danger:J.status===1,onClick:()=>se(J.id,J.status??1),children:J.status===1?"停用":"启用"},"status"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>pe(J),children:"重置密码"},"reset"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>L(J),children:"详情"},"detail")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",children:[s.jsx(c.Form.Item,{name:"username",label:"用户名",children:s.jsx(jt.SearchInput,{placeholder:"请输入用户名",onChange:_=>n.setFieldValue("username",_)})}),s.jsx(c.Form.Item,{name:"status",label:"状态",children:s.jsx(c.Select,{placeholder:"全部",allowClear:!0,style:{width:120},options:[{value:1,label:"正常"},{value:0,label:"禁用"},{value:2,label:"锁定"}]})}),s.jsx(c.Form.Item,{name:"dateRange",label:"创建时间",children:s.jsx(c.DatePicker.RangePicker,{style:{width:240}})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:W,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:te,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>g(!0),children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(de.DeleteOutlined,{}),disabled:i.length===0,onClick:ae,children:"批量停用"}),s.jsx(c.Button,{icon:s.jsx(de.DownloadOutlined,{}),onClick:ue,children:"导出"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var _;return(_=t.current)==null?void 0:_.reload()},children:"刷新"})]})]})}),s.jsx(vr,{actionRef:t,rowKey:"id",columns:Te,request:re,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:_=>`共 ${_} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(_,J)=>{o(_),u(J)}},tableAlertRender:({selectedRowKeys:_})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:_.length})," 项"]})}),s.jsx(c.Modal,{title:"新建账号",open:m,onOk:X,onCancel:()=>g(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"username",label:"用户名",rules:[{required:!0,min:3,max:32}],children:s.jsx(c.Input,{placeholder:"3-32 位字母数字下划线"})}),s.jsx(c.Form.Item,{name:"password",label:"初始密码",rules:[{required:!0,min:8}],children:s.jsx(c.Input.Password,{placeholder:"至少 8 位"})}),s.jsx(c.Form.Item,{name:"nickname",label:"昵称",children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"email",label:"邮箱",rules:[{type:"email"}],children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"phone",label:"手机号",children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"accountType",label:"账号类型",initialValue:3,children:s.jsx(c.Select,{options:[{value:1,label:"超级管理员"},{value:2,label:"租户管理员"},{value:3,label:"普通成员"},{value:4,label:"临时账号"}]})}),s.jsx(c.Form.Item,{name:"tenantCode",label:"租户编码",children:s.jsx(c.Input,{placeholder:"如 default / tenant1"})})]})}),s.jsx(c.Modal,{title:p?`重置密码 — ${p.username}`:"重置密码",open:f,onOk:me,onCancel:()=>h(!1),size:"large",okText:"确认重置",okButtonProps:{danger:!0},destroyOnHidden:!0,children:s.jsx(c.Form,{form:w,layout:"vertical",style:{marginTop:16},children:s.jsx(c.Form.Item,{name:"newPassword",label:"新密码",rules:[{required:!0,min:8,message:"至少 8 位"}],extra:"重置后建议通知账号持有人当面修改",children:s.jsx(c.Input.Password,{placeholder:"至少 8 位"})})})}),s.jsx(c.Drawer,{title:C?`账号详情 — ${C.username}`:"账号详情",open:v,onClose:K,width:"min(1120px, 94vw)",destroyOnHidden:!0,children:C&&s.jsx(c.Tabs,{activeKey:b,onChange:P,tabBarExtraContent:b==="logs"?s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>C.id&&Z(C.id),children:"刷新日志"}):null,items:[{key:"info",label:"基本信息",children:s.jsxs(c.Descriptions,{title:"账号信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"账号ID",children:C.id}),s.jsx(c.Descriptions.Item,{label:"用户名",children:C.username}),s.jsx(c.Descriptions.Item,{label:"昵称",children:C.nickname||"-"}),s.jsx(c.Descriptions.Item,{label:"账号类型",children:s.jsx(c.Tag,{color:(Oe=ks[C.accountType??3])==null?void 0:Oe.color,children:((Ae=ks[C.accountType??3])==null?void 0:Ae.text)||C.accountType})}),s.jsx(c.Descriptions.Item,{label:"邮箱",children:C.email||"-"}),s.jsx(c.Descriptions.Item,{label:"手机",children:C.phone||"-"}),s.jsx(c.Descriptions.Item,{label:"租户",children:C.tenantCode||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(ze=As[C.status??1])==null?void 0:ze.color,children:(ce=As[C.status??1])==null?void 0:ce.text})}),s.jsx(c.Descriptions.Item,{label:"到期时间",children:C.expireAt?Re(C.expireAt).format("YYYY-MM-DD HH:mm:ss"):"永久"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:C.createdAt?Re(C.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",span:2,children:C.updatedAt?Re(C.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]})},{key:"roles",label:`角色与权限${M.length?`(${M.length})`:""}`,children:s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[s.jsx(c.Card,{size:"small",style:{flex:"0 0 340px"},title:`角色(${M.length})`,loading:k,children:M.length?s.jsx(c.List,{size:"small",dataSource:M,rowKey:_=>_.id,renderItem:_=>s.jsx(c.List.Item,{children:s.jsx(c.List.Item.Meta,{title:s.jsxs(c.Space,{children:[s.jsx(QT,{strong:!0,children:_.roleName||_.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:_.roleCode})]}),description:_.description||"-"})})}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该账号暂无角色"})}),s.jsx(jt.ListTable,{cardTitle:`直接权限(${U.length})`,rows:U,rowKey:(_,J)=>_.code||_.resourceCode||_.id||J,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该账号暂无直接权限",loading:D,columns:[{title:"资源编码",dataIndex:"code",width:220,render:(_,J)=>s.jsx("span",{style:{fontFamily:"monospace"},children:J.code||J.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(_,J)=>J.name||J.resourceName||"-"}]})]})},{key:"affiliations",label:`组织归属${B.length?`(${B.length})`:""}`,children:s.jsx(jt.ListTable,{cardTitle:"挂在哪些租户 / 组织 / 部门",rows:B,rowKey:(_,J)=>`${_.tenantCode}-${_.deptCode||"root"}-${J}`,loading:z,searchKeys:["tenantCode","orgName","orgCode","deptName","deptCode"],searchPlaceholder:"按租户 / 组织 / 部门过滤",emptyTitle:"该账号未挂在任何组织节点下",columns:ye})},{key:"logs",label:`登录日志(${$.length})`,children:s.jsx(jt.ListTable,{rows:$,columns:fe,rowKey:"id",loading:R,searchKeys:["identifier","clientIp"],searchPlaceholder:"按登录标识 / 客户端 IP 过滤",emptyTitle:"暂无登录记录"})}]})})]})}let nF="/api";function kr(){return cn.createRequest({baseURL:nF,timeout:15e3})}const Lr={listApplications:e=>kr().get("/meta-app/list",{params:e}),getApplication:e=>kr().get("/meta-app/get",{params:{id:e}}),create:e=>kr().post("/meta-app",e),update:(e,t)=>kr().put("/meta-app",t,{params:{id:e}}),delete:e=>kr().delete("/meta-app",{params:{id:e}})},rF={API:1,MENU:2,BUTTON:3,DATA:4},Or={API:{text:"API",color:"orange",int:1},MENU:{text:"菜单",color:"blue",int:2},BUTTON:{text:"按钮",color:"green",int:3},DATA:{text:"数据",color:"purple",int:4}},sF={GET:"green",POST:"blue",PUT:"orange",DELETE:"red",PATCH:"purple"},li={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function aF({apiBaseURL:e}){var Z,G;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState(!1),[l]=c.Form.useForm(),[u,m]=d.useState(null),[g,f]=d.useState(!1),[h,p]=d.useState([]),[S,y]=d.useState(""),[w,v]=d.useState(!1),[x]=c.Form.useForm(),[C,j]=d.useState("API"),b=d.useCallback(async H=>{try{const L=await Xe.listResourcesByApp({appCode:H,pageNum:1,pageSize:1e3});p(L.data||[])}catch(L){c.message.error("拉取资源失败:"+((L==null?void 0:L.message)||"未知错误")),p([])}},[]),T=H=>{m(H),f(!0),H.appCode&&b(H.appCode)},$=d.useCallback(()=>{var K;const H=n.getFieldsValue(),L={};H.appCode&&(L.appCode=H.appCode),H.appName&&(L.appName=H.appName),a(L),(K=t.current)==null||K.reload()},[n]),E=d.useCallback(()=>{var H;n.resetFields(),a({}),(H=t.current)==null||H.reload()},[n]),R=async H=>{try{const L=(H==null?void 0:H.current)||1,K=(H==null?void 0:H.pageSize)||20,P=await Lr.listApplications({appCode:r.appCode,appName:r.appName,pageNum:L,pageSize:K});return{data:P.records||[],success:!0,total:P.total||0}}catch(L){return c.message.error("获取应用列表失败:"+((L==null?void 0:L.message)||"未知错误")),{data:[],success:!1,total:0}}},I=async()=>{var H;try{const L=await l.validateFields();await Lr.create({appCode:L.appCode,appName:L.appName,appType:L.appType||"web",description:L.description,status:1}),c.message.success("应用创建成功"),o(!1),l.resetFields(),(H=t.current)==null||H.reload()}catch(L){if(L!=null&&L.errorFields)return;c.message.error("创建失败:"+((L==null?void 0:L.message)||"未知错误"))}},M=async H=>{var L;try{if(H.id==null){c.message.error("应用 ID 缺失");return}await Lr.delete(H.id),c.message.success(`已删除应用 ${H.appCode}`),(u==null?void 0:u.id)===H.id&&(m(null),p([])),(L=t.current)==null||L.reload()}catch(K){c.message.error("删除失败:"+((K==null?void 0:K.message)||"未知错误"))}},Y=async H=>{var L;try{if(H.id==null){c.message.error("应用 ID 缺失");return}const K=H.status===1?0:1;await Lr.update(H.id,{status:K}),c.message.success(K===1?"已启用":"已停用"),(u==null?void 0:u.id)===H.id&&m({...H,status:K}),(L=t.current)==null||L.reload()}catch(K){c.message.error("切换状态失败:"+((K==null?void 0:K.message)||"未知错误"))}},U=async()=>{if(u)try{const H=await x.validateFields(),L={resourceCode:H.resourceCode,resourceName:H.resourceName,resourceType:rF[C],appCode:u.appCode,path:H.path,method:H.method,description:H.description,status:1};await Xe.createResource(L),c.message.success("资源创建成功"),v(!1),x.resetFields(),b(u.appCode)}catch(H){if(H!=null&&H.errorFields)return;c.message.error("创建失败:"+((H==null?void 0:H.message)||"未知错误"))}},A=async H=>{if(H.id==null){c.message.error("资源 ID 缺失");return}try{await Xe.deleteResource(H.id),c.message.success("资源已删除"),u!=null&&u.appCode&&b(u.appCode)}catch(L){c.message.error("删除失败:"+((L==null?void 0:L.message)||"未知错误"))}},k=H=>{j(H),x.resetFields(),v(!0)},F=[{title:"应用",dataIndex:"appName",width:180,search:!1,render:(H,L)=>{const K=li[L.status??1]||{text:String(L.status??"未知"),color:"default"},P=(u==null?void 0:u.id)===L.id;return s.jsxs("div",{style:{padding:"4px 0",borderLeft:P?"3px solid #1677ff":"3px solid transparent",paddingLeft:8},children:[s.jsx("div",{style:{fontWeight:500},children:L.appName}),s.jsxs("div",{style:{fontSize:12,color:"#999",marginTop:2},children:[s.jsx(c.Tag,{color:K.color,style:{marginRight:4,marginInlineEnd:4},children:K.text}),s.jsx("code",{style:{fontSize:11},children:L.appCode})]})]})}},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(H,L)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>T(L),children:"编辑"},"edit"),s.jsx(c.Button,{type:"link",size:"small",danger:L.status===1,onClick:()=>Y(L),children:L.status===1?"停用":"启用"},"toggle"),s.jsx(c.Popconfirm,{title:`确认删除应用 ${L.appName}?`,description:"该应用下的所有资源会一并删除",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>M(L),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})},"del")]}],D=[{title:"资源编码",dataIndex:"resourceCode",width:180,ellipsis:!0},{title:"资源名称",dataIndex:"resourceName",width:140,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(H,L)=>L.method?s.jsx(c.Tag,{color:sF[L.method],children:L.method}):"-"},{title:"URL / Path",dataIndex:"path",ellipsis:!0},{title:"描述",dataIndex:"description",width:200,ellipsis:!0},{title:"操作",width:80,fixed:"right",render:(H,L)=>s.jsx(c.Popconfirm,{title:"确认删除该资源?",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>A(L),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})}],O=h.filter(H=>(H.resourceType??1)===1),B=h.filter(H=>H.resourceType===2),q=h.filter(H=>H.resourceType===3),z=h.filter(H=>H.resourceType===4),V=(H,L)=>{const K=S.trim().toLowerCase(),P=K?H.filter(W=>`${W.resourceCode||""} ${W.resourceName||""} ${W.path||""}`.toLowerCase().includes(K)):H;return s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("span",{style:{color:"#666"},children:["共 ",s.jsx("b",{children:H.length})," 条 ",Or[L].text," 资源"]}),s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按资源编码 / 名称过滤",style:{width:220},onChange:W=>y(W.target.value)}),s.jsxs(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>k(L),children:["新建",Or[L].text]})]})]}),H.length>0?s.jsx(c.Table,{rowKey:"id",columns:D,dataSource:P,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:W=>`共 ${W} 条`},size:"small",scroll:{x:800},locale:{emptyText:s.jsx(jt.EmptyState,{title:`没有匹配的 ${Or[L].text} 资源`,description:"换个关键字再试一次",size:"sm"})}}):s.jsx(jt.EmptyState,{title:`该应用暂无 ${Or[L].text} 资源`,description:"点击上方按钮新增",size:"sm"})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",size:"small",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用编码",style:{marginBottom:8},children:s.jsx(c.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(c.Form.Item,{name:"appName",label:"应用名称",style:{marginBottom:8},children:s.jsx(c.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(c.Form.Item,{style:{marginBottom:8},children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:$,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:E,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>o(!0),children:"新增应用"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var H;(H=t.current)==null||H.reload(),u!=null&&u.appCode&&b(u.appCode)},children:"刷新"})]})]})}),s.jsx(vr,{actionRef:t,rowKey:"id",columns:F,request:R,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:H=>`共 ${H} 条`},onRow:H=>({onClick:()=>T(H),style:{cursor:"pointer"}})}),s.jsx(c.Drawer,{title:u?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600},children:u.appName}),s.jsx(c.Tag,{color:((Z=li[u.status??1])==null?void 0:Z.color)||"default",children:((G=li[u.status??1])==null?void 0:G.text)||"未知"}),s.jsx("code",{style:{fontSize:12,color:"#666"},children:u.appCode})]}):"应用详情",open:g,onClose:()=>f(!1),width:"80vw",destroyOnHidden:!0,extra:u?s.jsxs(c.Space,{children:[s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>b(u.appCode),children:"刷新资源"}),s.jsx(c.Button,{icon:s.jsx(de.EditOutlined,{}),onClick:()=>o(!0),children:"编辑应用"}),s.jsx(c.Button,{danger:u.status===1,icon:s.jsx(de.StopOutlined,{}),onClick:()=>Y(u),children:u.status===1?"停用":"启用"})]}):null,children:u&&s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:16,paddingBottom:12,borderBottom:"1px solid #f0f0f0",fontSize:13,color:"#666",display:"flex",gap:16},children:[u.gmtCreate&&s.jsxs("span",{children:["创建:",Re(u.gmtCreate).format("YYYY-MM-DD HH:mm:ss")]}),u.description&&s.jsxs("span",{children:["描述:",u.description]})]}),s.jsx(c.Tabs,{defaultActiveKey:"API",items:[{key:"API",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"orange",children:"API"})," API 资产 (",O.length,")"]}),children:V(O,"API")},{key:"MENU",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"blue",children:"菜单"})," 菜单 (",B.length,")"]}),children:V(B,"MENU")},{key:"BUTTON",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"green",children:"按钮"})," 按钮 (",q.length,")"]}),children:V(q,"BUTTON")},{key:"DATA",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"purple",children:"数据"})," 数据 (",z.length,")"]}),children:V(z,"DATA")}]})]})}),s.jsx(c.Modal,{title:"新建应用",open:i,onOk:I,onCancel:()=>o(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:l,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用编码",rules:[{required:!0},{pattern:/^[a-z][a-z0-9_-]*$/,message:"小写字母开头,仅允许小写字母/数字/下划线/短横"}],extra:"唯一标识,如 z-ctc / z-task",children:s.jsx(c.Input,{placeholder:"如 z-opc"})}),s.jsx(c.Form.Item,{name:"appName",label:"应用名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 统一管理平台"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})})]})}),s.jsx(c.Modal,{title:`新建资源 — ${(u==null?void 0:u.appCode)||""} (${Or[C].text})`,open:w,onOk:U,onCancel:()=>v(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:x,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0}],extra:"唯一标识,如 user:read / menu:dashboard",children:s.jsx(c.Input,{placeholder:"如 user:read"})}),s.jsx(c.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 查看用户"})}),C==="API"&&s.jsxs(s.Fragment,{children:[s.jsx(c.Form.Item,{name:"method",label:"HTTP 方法",children:s.jsx(c.Select,{allowClear:!0,placeholder:"选择 HTTP 方法",options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}]})}),s.jsx(c.Form.Item,{name:"path",label:"URL Pattern",children:s.jsx(c.Input,{placeholder:"如 /api/users/*"})})]}),C==="MENU"&&s.jsx(c.Form.Item,{name:"path",label:"菜单路径",children:s.jsx(c.Input,{placeholder:"如 /ctc/dashboard"})}),C==="BUTTON"&&s.jsx(c.Form.Item,{name:"resourceCode",label:"按钮权限编码",extra:"如 btn:user:create",children:s.jsx(c.Input,{placeholder:"如 btn:user:create"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})})]})})]})}const to={0:{text:"功能",color:"geekblue"},1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}},iF=[{value:"",label:"任意"},{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}],oF=[{key:"roles",label:"角色",icon:s.jsx(de.TeamOutlined,{})},{key:"points",label:"权限点",icon:s.jsx(de.AuditOutlined,{})},{key:"tree",label:"权限树",icon:s.jsx(de.ApartmentOutlined,{})},{key:"auth",label:"授权",icon:s.jsx(de.SolutionOutlined,{})}];function Zs(e){const t=to[e]||{text:String(e??"?"),color:"default"};return s.jsx(c.Tag,{color:t.color,style:{margin:0,fontSize:11},children:t.text})}function Hc(e,{search:t=""}={}){const n=t.trim().toLowerCase(),r=u=>!n||(u.resourceCode||"").toLowerCase().includes(n)||(u.resourceName||"").toLowerCase().includes(n),a=e.filter(r),i=new Map;a.forEach(u=>{const m=u.appCode||"公共";i.has(m)||i.set(m,[]),i.get(m).push(u)});const o=u=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("span",{children:u.resourceName||u.resourceCode}),Zs(u.resourceType),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:u.resourceCode})]}),l=[];return i.forEach((u,m)=>{const g=new Map;u.forEach(h=>g.set(h.id,{key:h.id,title:o(h),raw:h,children:[]}));const f=[];u.forEach(h=>{const p=g.get(h.id),S=h.parentId??0;S&&g.has(S)?g.get(S).children.push(p):f.push(p)}),l.push({key:`app:${m}`,title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontWeight:600},children:[m,s.jsx(c.Tag,{color:"cyan",style:{margin:0,fontSize:11},children:u.length})]}),selectable:!1,checkable:!1,children:f})}),l}function lF(e){const t=[],n=r=>{r.forEach(a=>{var i;t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function cF(e){const t=[],n=r=>{r.forEach(a=>{var i;a.raw&&t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function Zd({apiBaseURL:e}){const[t,n]=tf.useSearchParams(),r=["roles","points","tree","auth"].includes(t.get("view"))?t.get("view"):"roles",a=d.useCallback(N=>{const ee=new URLSearchParams(t);N==="roles"?ee.delete("view"):ee.set("view",N),n(ee,{replace:!0})},[t,n]),[i,o]=d.useState([]),[l,u]=d.useState(!1),[m,g]=d.useState([]),[f,h]=d.useState(!1),[p,S]=d.useState(""),[y,w]=d.useState(!1),[v,x]=d.useState(null),[C]=c.Form.useForm(),[j,b]=d.useState(null),[T,$]=d.useState([]),[E,R]=d.useState([]),[I,M]=d.useState(""),[Y,U]=d.useState(null),[A,k]=d.useState([]),[F,D]=d.useState(!1),[O,B]=d.useState(null),[q,z]=d.useState(""),[V,Z]=d.useState([]),[G,H]=d.useState(!1),[L,K]=d.useState(null),[P,W]=d.useState([]),[te,re]=d.useState(!1),[X,se]=d.useState(!1),[ae,ue]=d.useState(!1),[pe,me]=d.useState([]),fe=d.useRef(void 0),[ye]=c.Form.useForm(),[Te,Oe]=d.useState({}),[Ae,ze]=d.useState([]),[ce,_]=d.useState([]),[J,le]=d.useState([]),[Se,Ee]=d.useState(!1),[Fe,Ie]=d.useState(null),[De]=c.Form.useForm(),[ve,ke]=d.useState(!1),[Le,lt]=d.useState(null),nt=d.useCallback(async()=>{u(!0);try{const N=await Xe.listAllResources();o(Array.isArray(N)?N:[])}catch(N){c.message.error("加载权限点失败:"+((N==null?void 0:N.message)||"未知错误"))}finally{u(!1)}},[]),ne=d.useCallback(async()=>{h(!0);try{const N=await Xe.listAllRoles();g(Array.isArray(N)?N:[])}catch(N){c.message.error("加载角色失败:"+((N==null?void 0:N.message)||"未知错误"))}finally{h(!1)}},[]),Q=d.useCallback(async()=>{try{const N=await Xe.distinctApps(),ee=Array.isArray(N)?N:[];le(ee.map(xe=>({value:xe,label:xe})))}catch{le([])}},[]);d.useEffect(()=>{nt(),ne(),Q()},[nt,ne,Q]);const he=d.useCallback(async N=>{b(N),M(""),ue(!0),$([]),R([]);try{const ee=await Xe.listRolePermissions(N.id),xe=(Array.isArray(ee)?ee:[]).map($e=>$e.id);$(xe),R(xe)}catch(ee){c.message.error("加载角色权限点失败:"+((ee==null?void 0:ee.message)||"未知错误"))}finally{ue(!1)}},[]),Ce=d.useCallback(async()=>{if(!(j!=null&&j.id))return;const N=new Set(E.map(Number).filter(Ke=>Number.isFinite(Ke))),ee=new Set(T.map(Number).filter(Ke=>Number.isFinite(Ke))),xe=[...N].filter(Ke=>!ee.has(Ke)),$e=[...ee].filter(Ke=>!N.has(Ke));if(xe.length===0&&$e.length===0){c.message.info("没有变更");return}se(!0);try{for(const Ke of xe)await Xe.grantRoleResource(j.id,Ke);for(const Ke of $e)await Xe.revokeRoleResource(j.id,Ke);c.message.success(`已保存:+${xe.length} / -${$e.length}`),$([...N])}catch(Ke){c.message.error("保存失败:"+((Ke==null?void 0:Ke.message)||"未知错误"))}finally{se(!1)}},[j,E,T]),Je=d.useCallback(async(N,ee)=>{try{await Xe.updateRole(N.id,{status:ee?1:0}),c.message.success(ee?`角色 ${N.roleName} 已启用`:`角色 ${N.roleName} 已停用`),await ne()}catch(xe){c.message.error("更新状态失败:"+((xe==null?void 0:xe.message)||"未知错误"))}},[ne]),Ct=d.useCallback(async()=>{try{const N=await C.validateFields();await Xe.createRole({roleCode:N.roleCode,roleName:N.roleName,description:N.description,status:N.enabled===!1?0:1}),c.message.success("角色创建成功"),w(!1),C.resetFields(),await ne()}catch(N){if(N!=null&&N.errorFields)return;c.message.error("创建失败:"+((N==null?void 0:N.message)||"未知错误"))}},[ne,C]),tn=d.useCallback(async()=>{if(v!=null&&v.id)try{const N=await C.validateFields();await Xe.updateRole(v.id,{roleName:N.roleName,description:N.description,status:N.enabled===!1?0:1}),c.message.success("角色已更新"),w(!1),x(null),C.resetFields(),await ne(),(j==null?void 0:j.id)===v.id&&b(ee=>ee&&{...ee,roleName:N.roleName,status:N.enabled===!1?0:1})}catch(N){if(N!=null&&N.errorFields)return;c.message.error("更新失败:"+((N==null?void 0:N.message)||"未知错误"))}},[j,v,ne,C]),ht=d.useCallback(async N=>{try{await Xe.deleteRole(N.id),c.message.success("角色已删除"),(j==null?void 0:j.id)===N.id&&b(null),await ne()}catch(ee){c.message.error("删除失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},[j,ne]),is=d.useMemo(()=>{const N=p.trim().toLowerCase();return N?m.filter(ee=>(ee.roleCode||"").toLowerCase().includes(N)||(ee.roleName||"").toLowerCase().includes(N)):m},[m,p]),Ta=d.useCallback(async N=>{try{const ee=await Xe.listResourcesByApp({appCode:Te.appCode,type:Te.type,keyword:Te.keyword,pageNum:N.current,pageSize:N.pageSize}),xe=(ee==null?void 0:ee.data)||[];return{data:xe,success:!0,total:(ee==null?void 0:ee.total)??xe.length}}catch(ee){return c.message.error("查询权限点失败:"+((ee==null?void 0:ee.message)||"未知错误")),{data:[],success:!1,total:0}}},[Te]),Fa=[{title:"编码",dataIndex:"resourceCode",width:200,fixed:"left",render:(N,ee)=>s.jsx(c.Tooltip,{title:ee.resourceCode,children:s.jsx("span",{style:{fontFamily:"monospace"},children:ee.resourceCode})})},{title:"名称",dataIndex:"resourceName",width:160},{title:"类型",dataIndex:"resourceType",width:80,render:(N,ee)=>Zs(ee.resourceType)},{title:"应用",dataIndex:"appCode",width:140,render:(N,ee)=>ee.appCode?s.jsx(c.Tag,{color:"cyan",children:ee.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"路径",dataIndex:"path",width:220,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(N,ee)=>ee.method?s.jsx(c.Tag,{children:ee.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,render:(N,ee)=>s.jsx(c.Tag,{color:ee.status===1?"success":"default",children:ee.status===1?"启用":"禁用"})},{title:"创建时间",dataIndex:"createdAt",width:170,render:N=>N||"-"},{title:"操作",width:160,render:(N,ee)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:xe=>{xe.stopPropagation(),Ie(ee),De.setFieldsValue(ee),Ee(!0)},children:"编辑"},"edit"),s.jsx(c.Popconfirm,{title:"确认删除该权限点?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:async xe=>{var $e,Ke;($e=xe==null?void 0:xe.stopPropagation)==null||$e.call(xe);try{await Xe.deleteResource(ee.id),c.message.success("已删除"),(Ke=fe.current)==null||Ke.reload(),nt()}catch(Ra){c.message.error("删除失败:"+((Ra==null?void 0:Ra.message)||"未知错误"))}},children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:xe=>xe.stopPropagation(),children:"删除"})},"delete"),s.jsx(c.Button,{type:"link",size:"small",onClick:xe=>{xe.stopPropagation(),lt(ee),ke(!0)},children:"详情"},"detail")]}],fn=d.useMemo(()=>Hc(i,{search:I}),[i,I]);d.useEffect(()=>{me(lF(fn))},[fn]);const Gn=d.useRef(null),[os,Tr]=d.useState(void 0);d.useEffect(()=>{const N=()=>{const xe=Gn.current;if(!xe)return;const $e=xe.getBoundingClientRect().top;Tr(Math.max(420,window.innerHeight-$e-24))};N();const ee=setTimeout(N,300);return window.addEventListener("resize",N),()=>{clearTimeout(ee),window.removeEventListener("resize",N)}},[]);const ls=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:320,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"搜索角色编码 / 名称",onSearch:S,onChange:N=>!N.target.value&&S(""),style:{flex:1}}),s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{x(null),C.setFieldsValue({enabled:!0}),w(!0)},children:"新增"})]}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[is.map(N=>{const ee=(j==null?void 0:j.id)===N.id;return s.jsxs("div",{onClick:()=>he(N),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:ee?"#e6f4ff":"transparent",border:ee?"1px solid #91caff":"1px solid transparent"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:ee?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.roleName||N.roleCode,N.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.roleCode,N.tenantCode?` · ${N.tenantCode}`:""]})]}),s.jsx("span",{onClick:xe=>xe.stopPropagation(),children:s.jsx(c.Switch,{size:"small",checked:N.status===1,onChange:xe=>Je(N,xe)})}),s.jsx("span",{onClick:xe=>xe.stopPropagation(),children:s.jsx(c.Dropdown,{trigger:["click"],menu:{items:[{key:"edit",icon:s.jsx(de.AuditOutlined,{}),label:"编辑"},{type:"divider"},{key:"delete",icon:s.jsx(de.DeleteOutlined,{}),label:"删除",danger:!0}],onClick:({key:xe})=>{xe==="edit"?(x(N),C.setFieldsValue({roleCode:N.roleCode,roleName:N.roleName,description:N.description,enabled:N.status!==0}),w(!0)):xe==="delete"&&c.Modal.confirm({title:`删除角色 ${N.roleName}?`,okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onOk:()=>ht(N)})}},children:s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(de.EllipsisOutlined,{})})})})]},N.id)}),is.length===0?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:p?"没有匹配的角色":"还没有角色,点「新增」创建",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},title:j?`权限点 — ${j.roleName}`:"权限点",extra:j?s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",onClick:()=>R(cF(fn)),children:"全选"}),s.jsx(c.Button,{size:"small",onClick:()=>R([]),children:"清空"}),s.jsx(c.Button,{size:"small",type:"primary",loading:X,onClick:Ce,children:"保存"})]}):null,styles:{body:{padding:"12px 8px 12px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:j?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx(c.Input.Search,{allowClear:!0,size:"small",placeholder:"按编码 / 名称过滤权限点",onSearch:M,onChange:N=>!N.target.value&&M("")})}),s.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:8},children:["已挂载 ",s.jsx("b",{children:T.length})," / 共 ",i.length," 个权限点 —— 勾选即挂载,取消即卸载。"]}),s.jsx(c.Tree,{checkable:!0,blockNode:!0,treeData:fn,checkedKeys:E,onCheck:N=>R(Array.isArray(N)?N:N.checked),expandedKeys:pe,onExpand:N=>me(N),loading:ae})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧角色,这里展开它挂载的权限点树",style:{margin:"24px 0"}})})})]}),$a=()=>s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:ye,layout:"inline",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用",children:s.jsx(c.Select,{placeholder:"全部应用",allowClear:!0,style:{width:180},options:J,showSearch:!0,optionFilterProp:"label"})}),s.jsx(c.Form.Item,{name:"type",label:"类型",children:s.jsx(c.Select,{placeholder:"全部类型",allowClear:!0,style:{width:120},options:Object.entries(to).map(([N,ee])=>({value:Number(N),label:ee.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",children:s.jsx(c.Select,{placeholder:"全部",allowClear:!0,style:{width:100},options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:()=>{const N=ye.getFieldsValue(),ee={};N.appCode&&(ee.appCode=N.appCode),N.type!==void 0&&N.type!==null&&(ee.type=N.type),N.keyword&&(ee.keyword=N.keyword),N.status!==void 0&&N.status!==null&&(ee.status=N.status),Oe(ee)},children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:()=>{ye.resetFields(),Oe({})},children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{Ie(null),De.resetFields(),De.setFieldsValue({resourceType:3,status:1,sortOrder:0}),Ee(!0)},children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(de.DeleteOutlined,{}),disabled:Ae.length===0,onClick:async()=>{var N;try{await Promise.all(ce.map(ee=>Xe.deleteResource(ee.id))),c.message.success(`已删除 ${ce.length} 条`),ze([]),_([]),(N=fe.current)==null||N.reload(),nt()}catch(ee){c.message.error("批量删除失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},children:"批量删除"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var N;return(N=fe.current)==null?void 0:N.reload()},children:"刷新"})]})]})}),s.jsx(vr,{actionRef:fe,rowKey:"id",columns:Fa,request:Ta,params:Te,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:N=>`共 ${N} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:Ae,onChange:(N,ee)=>{ze(N),_(ee)}},tableAlertRender:({selectedRowKeys:N})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:N.length})," 项"]})})]}),Ue=Y!=null?i.find(N=>N.id===Y):null,Fr=(()=>{if(!Ue)return[];const N=new Map(i.map(Ke=>[Ke.id,Ke])),ee=[Ue],xe=new Set([Ue.id]);let $e=Ue;for(;$e!=null&&$e.parentId&&N.has($e.parentId)&&!xe.has($e.parentId);)$e=N.get($e.parentId),xe.add($e.id),ee.unshift($e);return ee})(),cs=Ue?i.filter(N=>N.parentId===Ue.id):[],Ea=()=>{var N;return s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:460,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[s.jsx(c.Input.Search,{allowClear:!0,size:"small",style:{flex:1},placeholder:"按编码 / 名称过滤",onSearch:M,onChange:ee=>!ee.target.value&&M("")}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:nt,children:"刷新"})]}),s.jsxs("div",{style:{fontSize:12,color:"#999"},children:["权限模型全貌:按「应用 → 父子层级」组织,共 ",i.length," 个。点条目看详情。"]}),s.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:s.jsx(c.Tree,{blockNode:!0,treeData:fn,loading:l,defaultExpandAll:!0,selectedKeys:Y!=null?[Y]:[],onSelect:ee=>U(ee.length?ee[ee.length-1]:null)})})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:16,flex:1,minHeight:0,overflowY:"auto"}},title:Ue?`权限点详情 — ${Ue.resourceName||Ue.resourceCode}`:"权限点详情",children:Ue?s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{fontSize:13,color:"#595959"},children:[Fr.map((ee,xe)=>s.jsxs("span",{children:[xe>0?s.jsx("span",{style:{color:"#bfbfbf",margin:"0 6px"},children:"/"}):null,ee.resourceName||ee.resourceCode]},ee.id)),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999",marginLeft:10},children:Ue.resourceCode})]}),s.jsxs(c.Descriptions,{bordered:!0,size:"small",column:2,children:[s.jsxs(c.Descriptions.Item,{label:"资源名称",span:2,children:[s.jsx("span",{style:{fontWeight:600},children:Ue.resourceName||"-"}),s.jsx("span",{style:{marginLeft:8},children:Zs(Ue.resourceType)})]}),s.jsx(c.Descriptions.Item,{label:"编码",span:2,children:s.jsx("span",{style:{fontFamily:"monospace"},children:Ue.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"应用",children:Ue.appCode?s.jsx(c.Tag,{color:"cyan",style:{margin:0},children:Ue.appCode}):s.jsx(c.Tag,{color:"default",style:{margin:0},children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:Ue.status===1?"success":"default",style:{margin:0},children:Ue.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"ID",children:Ue.id}),s.jsx(c.Descriptions.Item,{label:"排序",children:Ue.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"父权限",children:Ue.parentId&&i.some(ee=>ee.id===Ue.parentId)?((N=i.find(ee=>ee.id===Ue.parentId))==null?void 0:N.resourceName)||Ue.parentId:"顶层"}),s.jsxs(c.Descriptions.Item,{label:"子权限点",children:[cs.length," 个"]}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:Ue.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:Ue.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:Ue.updatedAt||"-"})]})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧权限点,这里展示它的详情与扩展字段",style:{margin:"48px 0"}})})})]})},$r=d.useCallback(async()=>{D(!0);try{const N=await sn.listByTenant({pageNum:1,pageSize:200}),ee=Array.isArray(N)?N:(N==null?void 0:N.records)||(N==null?void 0:N.data)||[];k(ee)}catch(N){c.message.error("加载用户失败:"+((N==null?void 0:N.message)||"未知错误"))}finally{D(!1)}},[]),Rn=d.useCallback(async N=>{re(!0);try{const ee=await Xe.listUserPermissions(N),xe=Array.isArray(ee)?ee:[];W(xe.map($e=>$e==null?null:typeof $e=="object"?$e.id!=null?$e.id:$e.resourceCode||$e.code:$e).filter($e=>$e!=null))}catch(ee){c.message.error("加载用户权限失败:"+((ee==null?void 0:ee.message)||"未知错误"))}finally{re(!1)}},[]),Zn=d.useCallback(async N=>{B(N.id),Z([]),W([]),H(!0),re(!0);try{const ee=await Xe.listUserRoles(N.id);Z((Array.isArray(ee)?ee:[]).map(xe=>xe.id))}catch(ee){c.message.error("加载用户角色失败:"+((ee==null?void 0:ee.message)||"未知错误"))}finally{H(!1)}Rn(N.id)},[Rn]);d.useEffect(()=>{$r()},[$r]),d.useEffect(()=>{O==null&&A.length>0&&Zn(A[0])},[A,O,Zn]);const us=async(N,ee)=>{if(O){K(N.id);try{ee?await Xe.grantUserRole(O,N.id):await Xe.revokeUserRole(O,N.id),Z(xe=>ee?[...xe,N.id]:xe.filter($e=>$e!==N.id)),c.message.success(`已${ee?"授予":"收回"}角色 ${N.roleName||N.roleCode}`),Rn(O)}catch(xe){c.message.error((ee?"授予":"收回")+"失败:"+((xe==null?void 0:xe.message)||"未知错误"))}finally{K(null)}}},Jn=d.useMemo(()=>{const N=new Map(i.map(xe=>[xe.id,xe])),ee=new Set;return P.forEach(xe=>{if(typeof xe=="number"||/^\d+$/.test(String(xe))){ee.add(Number(xe));const $e=N.get(Number(xe));$e&&ee.add($e.resourceCode)}else{ee.add(xe);const $e=i.find(Ke=>Ke.resourceCode===xe);$e&&ee.add($e.id)}}),ee},[P,i]),Xn=d.useMemo(()=>Hc(i),[i]),ds=d.useMemo(()=>Xn.flatMap(N=>(N.children||[]).map(ee=>ee.key)).filter(N=>Jn.has(N)),[Xn,Jn]),ge=d.useMemo(()=>{const N=q.trim().toLowerCase();return N?A.filter(ee=>`${ee.username||""} ${ee.nickname||""} ${ee.tenantCode||""}`.toLowerCase().includes(N)):A},[A,q]),we=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:300,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"搜索用户名 / 昵称 / 租户",onSearch:z,onChange:N=>!N.target.value&&z("")}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[ge.map(N=>{const ee=O===N.id;return s.jsx("div",{onClick:()=>Zn(N),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:ee?"#e6f4ff":"transparent",border:ee?"1px solid #91caff":"1px solid transparent"},children:s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:ee?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.nickname||N.username||N.id,N.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.username,N.tenantCode?` · ${N.tenantCode}`:""]})]})},N.id)}),ge.length===0&&!F?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"没有用户",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{width:300,flexShrink:0,display:"flex"},children:s.jsx(c.Card,{size:"small",title:`角色 (${V.length})`,loading:G&&O!=null,style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:"8px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:O?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:m.map(N=>{const ee=V.includes(N.id),xe=L===N.id;return s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 8px",borderRadius:6,cursor:xe?"wait":"pointer"},children:[s.jsx(c.Checkbox,{checked:ee,disabled:xe||f,onChange:$e=>us(N,$e.target.checked)}),s.jsxs("span",{style:{fontSize:13,flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.roleName||N.roleCode,N.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:N.roleCode})]},N.id)})}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"先在左侧选人",style:{margin:"24px 0"}})})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:8,overflow:"hidden"}},title:O?`有效权限点 (${Jn.size})`:"有效权限点",extra:O?s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>Rn(O),children:"刷新"}):null,children:O?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:12,color:"#999"},children:"该人经角色叠加到手的权限点全貌;勾选状态只读,要改去「角色」tab 调整角色挂载,或在中栏勾选/取消角色。"}),s.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:s.jsx(c.Tree,{checkable:!0,blockNode:!0,treeData:Xn,checkedKeys:ds,loading:te,defaultExpandAll:!0})})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"先在左侧选人",style:{margin:"24px 0"}})})})]});return s.jsxs("div",{ref:Gn,className:"perm-mgmt-fullheight",style:{display:"flex",flexDirection:"column",minHeight:420,height:os},children:[s.jsx("style",{children:`
50
+ ${B}`,W=Math.min(F.length,R);let te=0;for(;te<W-1;te++){const X=U(String(te),F[te],A,k,B);K+=X!==void 0?X:"null",K+=P}const re=U(String(te),F[te],A,k,B);if(K+=re!==void 0?re:"null",F.length-1>R){const X=F.length-R-1;K+=`${P}"... ${S(X)} not stringified"`}return K+=`
51
+ ${G}`,A.pop(),`[${K}]`}let _=Object.keys(F);const H=_.length;if(H===0)return"{}";if(E<A.length+1)return'"[Object]"';B+=k;const Z=`,
52
+ ${B}`;let q="",V="",L=Math.min(H,R);u(F)&&(q+=m(F,Z,R),_=_.slice(F.length),L-=F.length,V=Z),v&&(_=o(_,$)),A.push(F);for(let K=0;K<L;K++){const P=_[K],W=U(P,F[P],A,k,B);W!==void 0&&(q+=`${V}${i(P)}: ${W}`,V=Z)}if(H>R){const K=H-R;q+=`${V}"...": "${S(K)} not stringified"`,V=Z}return V!==""&&(q=`
53
+ ${B}${q}
54
+ ${G}`),A.pop(),`{${q}}`}case"number":return isFinite(F)?String(F):C?C(F):"null";case"boolean":return F===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(F);default:return C?C(F):void 0}}function Y(I,F,A){switch(typeof F){case"string":return i(F);case"object":{if(F===null)return"null";if(typeof F.toJSON=="function"){if(F=F.toJSON(I),typeof F!="object")return Y(I,F,A);if(F===null)return"null"}if(A.indexOf(F)!==-1)return j;let k="";const B=F.length!==void 0;if(B&&Array.isArray(F)){if(F.length===0)return"[]";if(E<A.length+1)return'"[Array]"';A.push(F);const q=Math.min(F.length,R);let V=0;for(;V<q-1;V++){const K=Y(String(V),F[V],A);k+=K!==void 0?K:"null",k+=","}const L=Y(String(V),F[V],A);if(k+=L!==void 0?L:"null",F.length-1>R){const K=F.length-R-1;k+=`,"... ${S(K)} not stringified"`}return A.pop(),`[${k}]`}let G=Object.keys(F);const _=G.length;if(_===0)return"{}";if(E<A.length+1)return'"[Object]"';let H="",Z=Math.min(_,R);B&&u(F)&&(k+=m(F,",",R),G=G.slice(F.length),Z-=F.length,H=","),v&&(G=o(G,$)),A.push(F);for(let q=0;q<Z;q++){const V=G[q],L=Y(V,F[V],A);L!==void 0&&(k+=`${H}${i(V)}:${L}`,H=",")}if(_>R){const q=_-R;k+=`${H}"...":"${S(q)} not stringified"`}return A.pop(),`{${k}}`}case"number":return isFinite(F)?String(F):C?C(F):"null";case"boolean":return F===!0?"true":"false";case"undefined":return;case"bigint":if(b)return String(F);default:return C?C(F):void 0}}function O(I,F,A){if(arguments.length>1){let k="";if(typeof A=="number"?k=" ".repeat(Math.min(A,10)):typeof A=="string"&&(k=A.slice(0,10)),F!=null){if(typeof F=="function")return D("",{"":I},[],F,k,"");if(Array.isArray(F))return M("",I,[],y(F),k,"")}if(k.length!==0)return U("",I,[],k,"")}return Y("",I,[])}return O}})(ws,ws.exports)),ws.exports}var sy=ry();const ay=Jt(sy),iy=ay.configure,wn=iy({bigint:!0,circularValue:"Magic circle!",deterministic:!1,maximumDepth:4});var qu=typeof global=="object"&&global&&global.Object===Object&&global,oy=typeof self=="object"&&self&&self.Object===Object&&self,en=qu||oy||Function("return this")(),Fn=en.Symbol,Gu=Object.prototype,ly=Gu.hasOwnProperty,cy=Gu.toString,Ir=Fn?Fn.toStringTag:void 0;function uy(e){var t=ly.call(e,Ir),n=e[Ir];try{e[Ir]=void 0;var r=!0}catch{}var a=cy.call(e);return r&&(t?e[Ir]=n:delete e[Ir]),a}var dy=Object.prototype,fy=dy.toString;function my(e){return fy.call(e)}var hy="[object Null]",gy="[object Undefined]",Fl=Fn?Fn.toStringTag:void 0;function br(e){return e==null?e===void 0?gy:hy:Fl&&Fl in Object(e)?uy(e):my(e)}function ln(e){return e!=null&&typeof e=="object"}var $n=Array.isArray;function Zu(e){return e}var py="[object AsyncFunction]",yy="[object Function]",xy="[object GeneratorFunction]",by="[object Proxy]";function bo(e){if(!Pt(e))return!1;var t=br(e);return t==yy||t==xy||t==py||t==by}var Za=en["__core-js_shared__"],$l=(function(){var e=/[^.]+$/.exec(Za&&Za.keys&&Za.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function Sy(e){return!!$l&&$l in e}var Cy=Function.prototype,wy=Cy.toString;function Yn(e){if(e!=null){try{return wy.call(e)}catch{}try{return e+""}catch{}}return""}var jy=/[\\^$.*+?()[\]{}|]/g,vy=/^\[object .+?Constructor\]$/,Ty=Function.prototype,Fy=Object.prototype,$y=Ty.toString,Ey=Fy.hasOwnProperty,Ry=RegExp("^"+$y.call(Ey).replace(jy,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Iy(e){if(!Pt(e)||Sy(e))return!1;var t=bo(e)?Ry:vy;return t.test(Yn(e))}function My(e,t){return e==null?void 0:e[t]}function Kn(e,t){var n=My(e,t);return Iy(n)?n:void 0}var ki=Kn(en,"WeakMap"),El=Object.create,Ay=(function(){function e(){}return function(t){if(!Pt(t))return{};if(El)return El(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}})();function ky(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Oy(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var Dy=800,Py=16,Ny=Date.now;function Ly(e){var t=0,n=0;return function(){var r=Ny(),a=Py-(r-n);if(n=r,a>0){if(++t>=Dy)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function _y(e){return function(){return e}}var ta=(function(){try{var e=Kn(Object,"defineProperty");return e({},"",{}),e}catch{}})(),zy=ta?function(e,t){return ta(e,"toString",{configurable:!0,enumerable:!1,value:_y(t),writable:!0})}:Zu,By=Ly(zy);function Vy(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var Hy=9007199254740991,Uy=/^(?:0|[1-9]\d*)$/;function Ju(e,t){var n=typeof e;return t=t??Hy,!!t&&(n=="number"||n!="symbol"&&Uy.test(e))&&e>-1&&e%1==0&&e<t}function So(e,t,n){t=="__proto__"&&ta?ta(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function ts(e,t){return e===t||e!==e&&t!==t}var Yy=Object.prototype,Ky=Yy.hasOwnProperty;function Xu(e,t,n){var r=e[t];(!(Ky.call(e,t)&&ts(r,n))||n===void 0&&!(t in e))&&So(e,t,n)}function Wy(e,t,n,r){var a=!n;n||(n={});for(var i=-1,o=t.length;++i<o;){var l=t[i],u=void 0;u===void 0&&(u=e[l]),a?So(n,l,u):Xu(n,l,u)}return n}var Rl=Math.max;function qy(e,t,n){return t=Rl(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,i=Rl(r.length-t,0),o=Array(i);++a<i;)o[a]=r[t+a];a=-1;for(var l=Array(t+1);++a<t;)l[a]=r[a];return l[t]=n(o),ky(e,this,l)}}function Gy(e,t){return By(qy(e,t,Zu),e+"")}var Zy=9007199254740991;function Qu(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Zy}function ns(e){return e!=null&&Qu(e.length)&&!bo(e)}function Jy(e,t,n){if(!Pt(n))return!1;var r=typeof t;return(r=="number"?ns(n)&&Ju(t,n.length):r=="string"&&t in n)?ts(n[t],e):!1}function Xy(e){return Gy(function(t,n){var r=-1,a=n.length,i=a>1?n[a-1]:void 0,o=a>2?n[2]:void 0;for(i=e.length>3&&typeof i=="function"?(a--,i):void 0,o&&Jy(n[0],n[1],o)&&(i=a<3?void 0:i,a=1),t=Object(t);++r<a;){var l=n[r];l&&e(t,l,r,i)}return t})}var Qy=Object.prototype;function ya(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Qy;return e===n}function ex(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var tx="[object Arguments]";function Il(e){return ln(e)&&br(e)==tx}var ed=Object.prototype,nx=ed.hasOwnProperty,rx=ed.propertyIsEnumerable,na=Il((function(){return arguments})())?Il:function(e){return ln(e)&&nx.call(e,"callee")&&!rx.call(e,"callee")};function sx(){return!1}var td=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ml=td&&typeof module=="object"&&module&&!module.nodeType&&module,ax=Ml&&Ml.exports===td,Al=ax?en.Buffer:void 0,ix=Al?Al.isBuffer:void 0,mr=ix||sx,ox="[object Arguments]",lx="[object Array]",cx="[object Boolean]",ux="[object Date]",dx="[object Error]",fx="[object Function]",mx="[object Map]",hx="[object Number]",gx="[object Object]",px="[object RegExp]",yx="[object Set]",xx="[object String]",bx="[object WeakMap]",Sx="[object ArrayBuffer]",Cx="[object DataView]",wx="[object Float32Array]",jx="[object Float64Array]",vx="[object Int8Array]",Tx="[object Int16Array]",Fx="[object Int32Array]",$x="[object Uint8Array]",Ex="[object Uint8ClampedArray]",Rx="[object Uint16Array]",Ix="[object Uint32Array]",ot={};ot[wx]=ot[jx]=ot[vx]=ot[Tx]=ot[Fx]=ot[$x]=ot[Ex]=ot[Rx]=ot[Ix]=!0;ot[ox]=ot[lx]=ot[Sx]=ot[cx]=ot[Cx]=ot[ux]=ot[dx]=ot[fx]=ot[mx]=ot[hx]=ot[gx]=ot[px]=ot[yx]=ot[xx]=ot[bx]=!1;function Mx(e){return ln(e)&&Qu(e.length)&&!!ot[br(e)]}function Co(e){return function(t){return e(t)}}var nd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Hr=nd&&typeof module=="object"&&module&&!module.nodeType&&module,Ax=Hr&&Hr.exports===nd,Ja=Ax&&qu.process,hr=(function(){try{var e=Hr&&Hr.require&&Hr.require("util").types;return e||Ja&&Ja.binding&&Ja.binding("util")}catch{}})(),kl=hr&&hr.isTypedArray,xa=kl?Co(kl):Mx,kx=Object.prototype,Ox=kx.hasOwnProperty;function rd(e,t){var n=$n(e),r=!n&&na(e),a=!n&&!r&&mr(e),i=!n&&!r&&!a&&xa(e),o=n||r||a||i,l=o?ex(e.length,String):[],u=l.length;for(var m in e)(t||Ox.call(e,m))&&!(o&&(m=="length"||a&&(m=="offset"||m=="parent")||i&&(m=="buffer"||m=="byteLength"||m=="byteOffset")||Ju(m,u)))&&l.push(m);return l}function sd(e,t){return function(n){return e(t(n))}}var Dx=sd(Object.keys,Object),Px=Object.prototype,Nx=Px.hasOwnProperty;function ad(e){if(!ya(e))return Dx(e);var t=[];for(var n in Object(e))Nx.call(e,n)&&n!="constructor"&&t.push(n);return t}function Lx(e){return ns(e)?rd(e):ad(e)}function _x(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var zx=Object.prototype,Bx=zx.hasOwnProperty;function Vx(e){if(!Pt(e))return _x(e);var t=ya(e),n=[];for(var r in e)r=="constructor"&&(t||!Bx.call(e,r))||n.push(r);return n}function id(e){return ns(e)?rd(e,!0):Vx(e)}var Zr=Kn(Object,"create");function Hx(){this.__data__=Zr?Zr(null):{},this.size=0}function Ux(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Yx="__lodash_hash_undefined__",Kx=Object.prototype,Wx=Kx.hasOwnProperty;function qx(e){var t=this.__data__;if(Zr){var n=t[e];return n===Yx?void 0:n}return Wx.call(t,e)?t[e]:void 0}var Gx=Object.prototype,Zx=Gx.hasOwnProperty;function Jx(e){var t=this.__data__;return Zr?t[e]!==void 0:Zx.call(t,e)}var Xx="__lodash_hash_undefined__";function Qx(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zr&&t===void 0?Xx:t,this}function Vn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Vn.prototype.clear=Hx;Vn.prototype.delete=Ux;Vn.prototype.get=qx;Vn.prototype.has=Jx;Vn.prototype.set=Qx;function eb(){this.__data__=[],this.size=0}function ba(e,t){for(var n=e.length;n--;)if(ts(e[n][0],t))return n;return-1}var tb=Array.prototype,nb=tb.splice;function rb(e){var t=this.__data__,n=ba(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():nb.call(t,n,1),--this.size,!0}function sb(e){var t=this.__data__,n=ba(t,e);return n<0?void 0:t[n][1]}function ab(e){return ba(this.__data__,e)>-1}function ib(e,t){var n=this.__data__,r=ba(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function dn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dn.prototype.clear=eb;dn.prototype.delete=rb;dn.prototype.get=sb;dn.prototype.has=ab;dn.prototype.set=ib;var Jr=Kn(en,"Map");function ob(){this.size=0,this.__data__={hash:new Vn,map:new(Jr||dn),string:new Vn}}function lb(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function Sa(e,t){var n=e.__data__;return lb(t)?n[typeof t=="string"?"string":"hash"]:n.map}function cb(e){var t=Sa(this,e).delete(e);return this.size-=t?1:0,t}function ub(e){return Sa(this,e).get(e)}function db(e){return Sa(this,e).has(e)}function fb(e,t){var n=Sa(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Wn(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Wn.prototype.clear=ob;Wn.prototype.delete=cb;Wn.prototype.get=ub;Wn.prototype.has=db;Wn.prototype.set=fb;function mb(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var od=sd(Object.getPrototypeOf,Object),hb="[object Object]",gb=Function.prototype,pb=Object.prototype,ld=gb.toString,yb=pb.hasOwnProperty,xb=ld.call(Object);function bb(e){if(!ln(e)||br(e)!=hb)return!1;var t=od(e);if(t===null)return!0;var n=yb.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&ld.call(n)==xb}function Sb(){this.__data__=new dn,this.size=0}function Cb(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function wb(e){return this.__data__.get(e)}function jb(e){return this.__data__.has(e)}var vb=200;function Tb(e,t){var n=this.__data__;if(n instanceof dn){var r=n.__data__;if(!Jr||r.length<vb-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Wn(r)}return n.set(e,t),this.size=n.size,this}function Gt(e){var t=this.__data__=new dn(e);this.size=t.size}Gt.prototype.clear=Sb;Gt.prototype.delete=Cb;Gt.prototype.get=wb;Gt.prototype.has=jb;Gt.prototype.set=Tb;var cd=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ol=cd&&typeof module=="object"&&module&&!module.nodeType&&module,Fb=Ol&&Ol.exports===cd,Dl=Fb?en.Buffer:void 0,Pl=Dl?Dl.allocUnsafe:void 0;function ud(e,t){if(t)return e.slice();var n=e.length,r=Pl?Pl(n):new e.constructor(n);return e.copy(r),r}function $b(e,t){for(var n=-1,r=e==null?0:e.length,a=0,i=[];++n<r;){var o=e[n];t(o,n,e)&&(i[a++]=o)}return i}function Eb(){return[]}var Rb=Object.prototype,Ib=Rb.propertyIsEnumerable,Nl=Object.getOwnPropertySymbols,Mb=Nl?function(e){return e==null?[]:(e=Object(e),$b(Nl(e),function(t){return Ib.call(e,t)}))}:Eb;function Ab(e,t,n){var r=t(e);return $n(e)?r:mb(r,n(e))}function Oi(e){return Ab(e,Lx,Mb)}var Di=Kn(en,"DataView"),Pi=Kn(en,"Promise"),Ni=Kn(en,"Set"),Ll="[object Map]",kb="[object Object]",_l="[object Promise]",zl="[object Set]",Bl="[object WeakMap]",Vl="[object DataView]",Ob=Yn(Di),Db=Yn(Jr),Pb=Yn(Pi),Nb=Yn(Ni),Lb=Yn(ki),Dt=br;(Di&&Dt(new Di(new ArrayBuffer(1)))!=Vl||Jr&&Dt(new Jr)!=Ll||Pi&&Dt(Pi.resolve())!=_l||Ni&&Dt(new Ni)!=zl||ki&&Dt(new ki)!=Bl)&&(Dt=function(e){var t=br(e),n=t==kb?e.constructor:void 0,r=n?Yn(n):"";if(r)switch(r){case Ob:return Vl;case Db:return Ll;case Pb:return _l;case Nb:return zl;case Lb:return Bl}return t});var _b=Object.prototype,zb=_b.hasOwnProperty;function Bb(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&zb.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ra=en.Uint8Array;function wo(e){var t=new e.constructor(e.byteLength);return new ra(t).set(new ra(e)),t}function Vb(e,t){var n=wo(e.buffer);return new e.constructor(n,e.byteOffset,e.byteLength)}var Hb=/\w*$/;function Ub(e){var t=new e.constructor(e.source,Hb.exec(e));return t.lastIndex=e.lastIndex,t}var Hl=Fn?Fn.prototype:void 0,Ul=Hl?Hl.valueOf:void 0;function Yb(e){return Ul?Object(Ul.call(e)):{}}function dd(e,t){var n=t?wo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var Kb="[object Boolean]",Wb="[object Date]",qb="[object Map]",Gb="[object Number]",Zb="[object RegExp]",Jb="[object Set]",Xb="[object String]",Qb="[object Symbol]",eS="[object ArrayBuffer]",tS="[object DataView]",nS="[object Float32Array]",rS="[object Float64Array]",sS="[object Int8Array]",aS="[object Int16Array]",iS="[object Int32Array]",oS="[object Uint8Array]",lS="[object Uint8ClampedArray]",cS="[object Uint16Array]",uS="[object Uint32Array]";function dS(e,t,n){var r=e.constructor;switch(t){case eS:return wo(e);case Kb:case Wb:return new r(+e);case tS:return Vb(e);case nS:case rS:case sS:case aS:case iS:case oS:case lS:case cS:case uS:return dd(e,n);case qb:return new r;case Gb:case Xb:return new r(e);case Zb:return Ub(e);case Jb:return new r;case Qb:return Yb(e)}}function fd(e){return typeof e.constructor=="function"&&!ya(e)?Ay(od(e)):{}}var fS="[object Map]";function mS(e){return ln(e)&&Dt(e)==fS}var Yl=hr&&hr.isMap,hS=Yl?Co(Yl):mS,gS="[object Set]";function pS(e){return ln(e)&&Dt(e)==gS}var Kl=hr&&hr.isSet,yS=Kl?Co(Kl):pS,xS=1,md="[object Arguments]",bS="[object Array]",SS="[object Boolean]",CS="[object Date]",wS="[object Error]",hd="[object Function]",jS="[object GeneratorFunction]",vS="[object Map]",TS="[object Number]",gd="[object Object]",FS="[object RegExp]",$S="[object Set]",ES="[object String]",RS="[object Symbol]",IS="[object WeakMap]",MS="[object ArrayBuffer]",AS="[object DataView]",kS="[object Float32Array]",OS="[object Float64Array]",DS="[object Int8Array]",PS="[object Int16Array]",NS="[object Int32Array]",LS="[object Uint8Array]",_S="[object Uint8ClampedArray]",zS="[object Uint16Array]",BS="[object Uint32Array]",rt={};rt[md]=rt[bS]=rt[MS]=rt[AS]=rt[SS]=rt[CS]=rt[kS]=rt[OS]=rt[DS]=rt[PS]=rt[NS]=rt[vS]=rt[TS]=rt[gd]=rt[FS]=rt[$S]=rt[ES]=rt[RS]=rt[LS]=rt[_S]=rt[zS]=rt[BS]=!0;rt[wS]=rt[hd]=rt[IS]=!1;function Vs(e,t,n,r,a,i){var o,l=t&xS;if(o!==void 0)return o;if(!Pt(e))return e;var u=$n(e);if(u)o=Bb(e);else{var m=Dt(e),g=m==hd||m==jS;if(mr(e))return ud(e,l);if(m==gd||m==md||g&&!a)o=g?{}:fd(e);else{if(!rt[m])return a?e:{};o=dS(e,m,l)}}i||(i=new Gt);var f=i.get(e);if(f)return f;i.set(e,o),yS(e)?e.forEach(function(S){o.add(Vs(S,t,n,S,e,i))}):hS(e)&&e.forEach(function(S,y){o.set(y,Vs(S,t,n,y,e,i))});var h=Oi,p=u?void 0:h(e);return Vy(p||e,function(S,y){p&&(y=S,S=e[y]),Xu(o,y,Vs(S,t,n,y,e,i))}),o}var VS=1,HS=4;function US(e){return Vs(e,VS|HS)}var YS="__lodash_hash_undefined__";function KS(e){return this.__data__.set(e,YS),this}function WS(e){return this.__data__.has(e)}function sa(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Wn;++t<n;)this.add(e[t])}sa.prototype.add=sa.prototype.push=KS;sa.prototype.has=WS;function qS(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function GS(e,t){return e.has(t)}var ZS=1,JS=2;function pd(e,t,n,r,a,i){var o=n&ZS,l=e.length,u=t.length;if(l!=u&&!(o&&u>l))return!1;var m=i.get(e),g=i.get(t);if(m&&g)return m==t&&g==e;var f=-1,h=!0,p=n&JS?new sa:void 0;for(i.set(e,t),i.set(t,e);++f<l;){var S=e[f],y=t[f];if(r)var w=o?r(y,S,f,t,e,i):r(S,y,f,e,t,i);if(w!==void 0){if(w)continue;h=!1;break}if(p){if(!qS(t,function(T,x){if(!GS(p,x)&&(S===T||a(S,T,n,r,i)))return p.push(x)})){h=!1;break}}else if(!(S===y||a(S,y,n,r,i))){h=!1;break}}return i.delete(e),i.delete(t),h}function XS(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}function QS(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var eC=1,tC=2,nC="[object Boolean]",rC="[object Date]",sC="[object Error]",aC="[object Map]",iC="[object Number]",oC="[object RegExp]",lC="[object Set]",cC="[object String]",uC="[object Symbol]",dC="[object ArrayBuffer]",fC="[object DataView]",Wl=Fn?Fn.prototype:void 0,Xa=Wl?Wl.valueOf:void 0;function mC(e,t,n,r,a,i,o){switch(n){case fC:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case dC:return!(e.byteLength!=t.byteLength||!i(new ra(e),new ra(t)));case nC:case rC:case iC:return ts(+e,+t);case sC:return e.name==t.name&&e.message==t.message;case oC:case cC:return e==t+"";case aC:var l=XS;case lC:var u=r&eC;if(l||(l=QS),e.size!=t.size&&!u)return!1;var m=o.get(e);if(m)return m==t;r|=tC,o.set(e,t);var g=pd(l(e),l(t),r,a,i,o);return o.delete(e),g;case uC:if(Xa)return Xa.call(e)==Xa.call(t)}return!1}var hC=1,gC=Object.prototype,pC=gC.hasOwnProperty;function yC(e,t,n,r,a,i){var o=n&hC,l=Oi(e),u=l.length,m=Oi(t),g=m.length;if(u!=g&&!o)return!1;for(var f=u;f--;){var h=l[f];if(!(o?h in t:pC.call(t,h)))return!1}var p=i.get(e),S=i.get(t);if(p&&S)return p==t&&S==e;var y=!0;i.set(e,t),i.set(t,e);for(var w=o;++f<u;){h=l[f];var T=e[h],x=t[h];if(r)var C=o?r(x,T,h,t,e,i):r(T,x,h,e,t,i);if(!(C===void 0?T===x||a(T,x,n,r,i):C)){y=!1;break}w||(w=h=="constructor")}if(y&&!w){var j=e.constructor,b=t.constructor;j!=b&&"constructor"in e&&"constructor"in t&&!(typeof j=="function"&&j instanceof j&&typeof b=="function"&&b instanceof b)&&(y=!1)}return i.delete(e),i.delete(t),y}var xC=1,ql="[object Arguments]",Gl="[object Array]",js="[object Object]",bC=Object.prototype,Zl=bC.hasOwnProperty;function SC(e,t,n,r,a,i){var o=$n(e),l=$n(t),u=o?Gl:Dt(e),m=l?Gl:Dt(t);u=u==ql?js:u,m=m==ql?js:m;var g=u==js,f=m==js,h=u==m;if(h&&mr(e)){if(!mr(t))return!1;o=!0,g=!1}if(h&&!g)return i||(i=new Gt),o||xa(e)?pd(e,t,n,r,a,i):mC(e,t,u,n,r,a,i);if(!(n&xC)){var p=g&&Zl.call(e,"__wrapped__"),S=f&&Zl.call(t,"__wrapped__");if(p||S){var y=p?e.value():e,w=S?t.value():t;return i||(i=new Gt),a(y,w,n,r,i)}}return h?(i||(i=new Gt),yC(e,t,n,r,a,i)):!1}function yd(e,t,n,r,a){return e===t?!0:e==null||t==null||!ln(e)&&!ln(t)?e!==e&&t!==t:SC(e,t,n,r,yd,a)}function CC(e){return function(t,n,r){for(var a=-1,i=Object(t),o=r(t),l=o.length;l--;){var u=o[++a];if(n(i[u],u,i)===!1)break}return t}}var wC=CC();function Li(e,t,n){(n!==void 0&&!ts(e[t],n)||n===void 0&&!(t in e))&&So(e,t,n)}function jC(e){return ln(e)&&ns(e)}function _i(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function vC(e){return Wy(e,id(e))}function TC(e,t,n,r,a,i,o){var l=_i(e,n),u=_i(t,n),m=o.get(u);if(m){Li(e,n,m);return}var g=i?i(l,u,n+"",e,t,o):void 0,f=g===void 0;if(f){var h=$n(u),p=!h&&mr(u),S=!h&&!p&&xa(u);g=u,h||p||S?$n(l)?g=l:jC(l)?g=Oy(l):p?(f=!1,g=ud(u,!0)):S?(f=!1,g=dd(u,!0)):g=[]:bb(u)||na(u)?(g=l,na(l)?g=vC(l):(!Pt(l)||bo(l))&&(g=fd(u))):f=!1}f&&(o.set(u,g),a(g,u,r,i,o),o.delete(u)),Li(e,n,g)}function xd(e,t,n,r,a){e!==t&&wC(t,function(i,o){if(a||(a=new Gt),Pt(i))TC(e,t,o,n,xd,r,a);else{var l=r?r(_i(e,o),i,o+"",e,t,a):void 0;l===void 0&&(l=i),Li(e,o,l)}},id)}var FC="[object Map]",$C="[object Set]",EC=Object.prototype,RC=EC.hasOwnProperty;function IC(e){if(e==null)return!0;if(ns(e)&&($n(e)||typeof e=="string"||typeof e.splice=="function"||mr(e)||xa(e)||na(e)))return!e.length;var t=Dt(e);if(t==FC||t==$C)return!e.size;if(ya(e))return!ad(e).length;for(var n in e)if(RC.call(e,n))return!1;return!0}function Qa(e,t){return yd(e,t)}var aa=Xy(function(e,t,n){xd(e,t,n)});function MC(e){return typeof e!="object"?!1:e===null?!0:!(d.isValidElement(e)||e.constructor===RegExp||e instanceof Map||e instanceof Set||e instanceof HTMLElement||e instanceof Blob||e instanceof File||Array.isArray(e))}function AC(e){return e.split(".").map(t=>/^\d+$/.test(t)?parseInt(t,10):t)}function kC(e){const t={};for(const n in e){const r=e[n];Lt(r)||(t[n]=r)}return t}function OC(e){const t={},n={};for(const r in e){const a=e[r];Lt(a)||(r.includes(".")?t[r]=a:n[r]=a)}return{dotPathTransforms:t,objectTransforms:n}}function DC(e,t){for(const n in t){const r=t[n];if(typeof r!="function")continue;const a=AC(n),i=Be(e,a);if(i===void 0)continue;const o=r(i,a.map(String),e);if(typeof o=="object"&&o!==null&&!Array.isArray(o)){const l=a.slice(0,-1),u=l.length>0?Be(e,l):e;if(u&&typeof u=="object"){const m=a[a.length-1];delete u[m],Object.assign(u,o)}}else{let l=e;for(let u=0;u<a.length-1;u++){const m=a[u];if(l[m]===void 0){const g=a[u+1];l[m]=typeof g=="number"?[]:{}}l=l[m]}l[a[a.length-1]]=o}}}function PC(e,t,n){let r=e;for(const a of t){const i=String(a);if(r&&typeof r[i]=="object")r=r[i];else{r=null;break}}if(r&&typeof r[n]=="function")return r[n]}function NC(e){return e.some(t=>!isNaN(Number(t)))}function zi(e,t,n,r,a){if(e!=null&&typeof e=="object"){if(a.has(e))return e;a.add(e)}const i=Array.isArray(e);let o=i?[]:{};if(e==null||e===void 0)return o;const l=i?e.map((u,m)=>m.toString()):Object.keys(e);for(const u of l){const m=t?[...t,u]:[u],g=e[u];let f=n[u];if(!f&&t&&(f=PC(n,t,u)),f&&typeof f=="function"){const h=f(g,u,e);typeof h=="object"&&h!==null&&!Array.isArray(h)?(t?NC(t):!1)?Object.assign(o,h):r.push(h):o[u]=h}else if(MC(g)&&!Lt(g)){const h=n[u];if(h&&typeof h=="object"){const p=zi(g,m,h,r,a);Object.keys(p).length>0&&(o[u]=p)}else{const p=zi(g,m,n,r,a);o[u]=p}}else Lt(g)||(o[u]=g)}return o}const LC=(e,t)=>{const n=kC(t);if(Object.keys(n).length<1||typeof window>"u"||typeof e!="object"||Lt(e)||e instanceof Blob)return e;let r=US(e);const{dotPathTransforms:a,objectTransforms:i}=OC(t);DC(r,a);const o=[];Object.keys(i).length>0&&(r=zi(r,void 0,i,o,new Set));for(const l of o)Object.assign(r,l);return r},_C=(e,t,n)=>{const r=d.useRef({});function a(i){var l;function o(u,m){u.forEach((g,f)=>{const h=n(g,f);m.set(h,g),g&&typeof g=="object"&&t in g&&o(g[t]||[],m)})}if(!r.current||r.current.data!==e||r.current.childrenColumnName!==t||r.current.getRowKey!==n){const u=new Map;o(e,u),r.current={data:e,childrenColumnName:t,kvMap:u,getRowKey:n}}return(l=r.current.kvMap)==null?void 0:l.get(i)}return[a]},{noteOnce:zC}=st,Jl=e=>c.message.warning(e),it=e=>Array.isArray(e)?e.join(","):e,jo=(...e)=>e.flat(1).filter(t=>t!=null).map(t=>typeof t=="number"?t.toString():t);function bd(e,t,n,r,a){const i=new Map;return e.forEach((o,l)=>{const u=(a||0)*10+l,m=t(o,u).toString();if(o&&typeof o=="object"&&n in o){const h=o[n]||[];bd(h,t,n,m,u).forEach((S,y)=>i.set(y,S))}const f={...o,map_row_key:m,map_row_parentKey:r};delete f.children,r||delete f.map_row_parentKey,i.set(m,f)}),i}function BC(e,t,n){const r=new Map,a=[],i=o=>{e.forEach(l=>{var u;if(l.map_row_parentKey!=null&&!l.map_row_key){const{map_row_parentKey:m,...g}=l,f=String(m);r.has(f)||r.set(f,[]),o&&((u=r.get(f))==null||u.push(g))}})};return i(n==="top"),e.forEach(o=>{var l,u;if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:m,map_row_key:g,isNewRecord:f,...h}=o,p={...h,map_row_key:g},S=m!=null?String(m):null;if(!S)return;r.has(S)||r.set(S,[]),f&&n==="top"?(l=r.get(S))==null||l.unshift(p):(u=r.get(S))==null||u.push(p)}}),e.forEach(o=>{if(o.map_row_parentKey!=null&&o.map_row_key){const{map_row_parentKey:l,map_row_key:u}=o,m=l!=null?String(l):null;if(!m)return;const g=r.get(m);if(g&&g.length>0){const f=g.findIndex(h=>{const p=h.map_row_key||h.id;return String(p)===String(u)});f>=0&&r.has(u)&&(g[f]={...g[f],[t]:r.get(u)})}}}),i(n==="update"),e.forEach(o=>{if(!o.map_row_parentKey){const{map_row_key:l,...u}=o,m=l&&r.has(l)?{...u,[t]:r.get(l)}:u;a.push(m)}}),a}function Pr(e,t){var u;const{getRowKey:n,row:r,data:a,childrenColumnName:i="children"}=e,o=(u=it(e.key))==null?void 0:u.toString(),l=bd(a,n,i);if(t==="delete")l.delete(o);else if(t==="top"||t==="update"){const m=l.get(o);m?l.set(o,{...m,...r}):l.set(o,{...r,map_row_key:o,map_row_parentKey:r.map_row_parentKey,isNewRecord:!0})}return BC(l,i,t)}function VC({recordKey:e,onSave:t,row:n,children:r,newLineConfig:a,editorType:i,tableName:o},l){const u=d.useContext(es),m=c.Form.useFormInstance(),[g,f]=d.useState(!1),h=je(async()=>{try{const p=i==="Map",S=jo(o,Array.isArray(e)?e[0]:e);f(!0);try{await m.validateFields(S,{recursive:!0})}catch(x){throw f(!1),x}const y=(()=>{var j;const x=(j=u==null?void 0:u.getFieldFormatValueObject)==null?void 0:j.call(u,S);return(x!=null?Be(x,S):null)??m.getFieldValue(S)})();if(Array.isArray(e)&&e.length>1){const[,...x]=e,C=Be(y,x);Qe(y,x,C)}const w=p?Qe({},S,y):y,T=await(t==null?void 0:t(e,Ku({},n,w),n,a));return f(!1),T}catch(p){throw f(!1),p}});return d.useImperativeHandle(l,()=>({save:h}),[h]),s.jsxs("a",{onClick:async p=>{p.stopPropagation(),p.preventDefault();try{await h()}catch{}},children:[g?s.jsx(de.LoadingOutlined,{style:{marginInlineEnd:8}}):null,r||"保存"]},"save")}const HC=({recordKey:e,onDelete:t,preEditRowRef:n,preEditRowRefs:r,row:a,children:i,deletePopconfirmMessage:o})=>{const[l,u]=d.useState(!1),m=je(async()=>{var g,f;try{u(!0);const h=await(t==null?void 0:t(e,a));return u(!1),h===!1?!1:h}catch{return u(!1),null}finally{const h=(g=it(e))==null?void 0:g.toString();h&&((f=r==null?void 0:r.current)==null||f.delete(h)),n&&(n.current=null)}});return i!==!1?s.jsx(c.Popconfirm,{title:o||"确定要删除这条记录吗?",onConfirm:m,getPopupContainer:g=>g.parentElement||document.body,children:s.jsxs("a",{children:[l?s.jsx(de.LoadingOutlined,{style:{marginInlineEnd:8}}):null,i||"删除"]})},"delete"):null},UC=e=>{const{recordKey:t,tableName:n,newLineConfig:r,editorType:a,onCancel:i,cancelEditable:o,row:l,cancelText:u,preEditRowRef:m,preEditRowRefs:g}=e,f=d.useContext(es),h=c.Form.useFormInstance();return s.jsx("a",{onClick:async p=>{var E,R,D,M;p.stopPropagation(),p.preventDefault();const S=a==="Map",y=(E=it(t))==null?void 0:E.toString(),w=jo(n,t),T=(()=>{var O;const U=(O=f==null?void 0:f.getFieldFormatValueObject)==null?void 0:O.call(f,w);return(U!=null?Be(U,w):null)??(h==null?void 0:h.getFieldValue(w))})(),x=S?Qe({},w,T):T,C=y!=null?(R=g==null?void 0:g.current)==null?void 0:R.get(y):void 0,j=(()=>{var I,F,A;const U=(I=r==null?void 0:r.options)==null?void 0:I.recordKey;if(U==null||t==null)return!1;const Y=(F=it(U))==null?void 0:F.toString(),O=(A=it(t))==null?void 0:A.toString();return!Y||!O?!1:Y===O})(),b=await(i==null?void 0:i(t,x,l,r));await o(t);const v=C??(m==null?void 0:m.current)??l;return C===null||C===void 0&&(m==null?void 0:m.current)===null&&j?await((D=e.onDelete)==null?void 0:D.call(e,t,l)):v!=null&&h.setFieldsValue(Qe({},w,v)),y&&((M=g==null?void 0:g.current)==null||M.delete(y)),m&&(m.current=null),b},children:u||"取消"},"cancel")};function YC(e,t){const{recordKey:n,newLineConfig:r,saveText:a,deleteText:i}=t,o=d.forwardRef(VC),l=d.createRef();return{save:s.jsx(o,{...t,row:e,ref:l,children:a},"save"+n),saveRef:l,delete:(r==null?void 0:r.options.recordKey)!==n?s.jsx(HC,{...t,row:e,children:i},"delete"+n):void 0,cancel:s.jsx(UC,{...t,row:e},"cancel"+n)}}function KC(e){const t=Ne(),n=d.useRef(null),r=d.useRef(new Map),[a,i]=d.useState(void 0),o=je(()=>{const P=new Map,W=(te,re)=>{te==null||te.forEach((X,se)=>{const ae=re==null?se.toString():`${re}_${se}`,ue=it(e.getRowKey(X,-1));if(ue==null)return;P.set(ae,ue),P.set(ue.toString(),ae);const pe=e.childrenColumnName&&(X==null?void 0:X[e.childrenColumnName]);pe&&W(pe,ae)})};return W(e.dataSource),P}),l=d.useMemo(()=>o(),[]),u=d.useRef(l),m=d.useRef(void 0);Yu(()=>{u.current=o()},[e.dataSource]),m.current=a;const g=e.type||"single",[f]=_C(e.dataSource,"children",e.getRowKey),[h,p]=dt([],e.editableKeys),S=d.useCallback(P=>{p(W=>{var re;const te=typeof P=="function"?P(W):P;return(re=e==null?void 0:e.onChange)==null||re.call(e,(te==null?void 0:te.filter(X=>X!==void 0))??[],(te==null?void 0:te.map(X=>f(X)).filter(X=>X!==void 0))??[]),te})},[e.onChange,f]),y=Vr(h),w=je((P,W)=>W.includes(P)),T=je(P=>{var ae,ue;const W=(ae=e.getRowKey(P,P.index))==null?void 0:ae.toString(),te=(ue=e.getRowKey(P,-1))==null?void 0:ue.toString(),re=(h==null?void 0:h.map(pe=>pe==null?void 0:pe.toString()))||[],X=(y==null?void 0:y.map(pe=>pe==null?void 0:pe.toString()))||[],se=w(te,X)||w(W,X);return{recordKey:te,isEditable:w(te,re)||w(W,re),preIsEditable:se}}),x=je(()=>h&&h.length>0&&g==="single"&&e.onlyOneLineEditorAlertMessage!==!1?(Jl(e.onlyOneLineEditorAlertMessage||t.getMessage("editableTable.onlyOneLineEditor","只能同时编辑一行")),!1):!0),C=je(P=>{var W;return((W=e.dataSource)==null?void 0:W.find((te,re)=>e.getRowKey(te,re)===P))??null}),j=je((P,W)=>{var X;if(!x())return!1;if(!(h==null?void 0:h.some(se=>se===P||(se==null?void 0:se.toString())===(P==null?void 0:P.toString())))){const se=h?[...h,P]:[P];S(se)}n.current=W??C(P)??null;const re=(X=it(P))==null?void 0:X.toString();return re&&r.current.set(re,n.current),!0}),b=je(P=>{const W=it(P),te=W!=null?W.toString():null;if(te==null)return;const re=(h==null?void 0:h.filter(X=>(X==null?void 0:X.toString())!==te&&X!==W))??[];S(re)}),v=je(async(P,W)=>{var ue,pe,me,fe;const te=it(P),re=te!=null?te.toString():null,X=re!=null?u.current.get(re):void 0,se=h==null?void 0:h.some(ye=>re==null?!1:(ye==null?void 0:ye.toString())===re||ye===te);if(!se&&X&&(W??!0)&&e.tableName)return await v(X,!1);if(e.onCancel&&se){const ye=Array.isArray(P)?P[0]:P,Te=C(ye),Oe=n.current,Ae=(ue=a==null?void 0:a.options)==null?void 0:ue.recordKey,ze=Ae!=null?it(Ae):null,ce=ze!=null?ze.toString():null,z=a!=null&&Ae!=null&&(Ae===P||ce!=null&&re!=null&&ce===re||(Ae==null?void 0:Ae.toString())===(P==null?void 0:P.toString())||String(Ae)===String(P))?a:void 0;try{await e.onCancel(P,Te||(z==null?void 0:z.defaultValue)||{},Oe||Te||(z==null?void 0:z.defaultValue)||{},z)}catch(J){console.error("onCancel error:",J)}}if(a){const ye=a.options.recordKey,Te=ye!=null?(pe=it(ye))==null?void 0:pe.toString():null;(ye===P||Te!=null&&re!=null&&Te===re||(ye==null?void 0:ye.toString())===(P==null?void 0:P.toString())||String(ye)===String(P))&&i(void 0)}const ae=n.current;if(ae&&e.getRowKey(ae,-1)===P&&se){try{const ye=(me=e.formProps)==null?void 0:me.formRef,Te=(ye==null?void 0:ye.current)||e.form;if(Te)if(e.tableName){const Oe=jo(e.tableName,P);Te.setFieldsValue(Qe({},Oe,ae))}else{const Oe=(fe=it(P))==null?void 0:fe.toString();if(Oe)try{Te.resetFields([[Oe]]),Te.setFieldsValue({[Oe]:void 0})}catch(Ae){console.warn("Failed to clear form fields in cancelEditable:",Ae)}}}catch(ye){console.warn("Failed to reset form fields in cancelEditable:",ye)}n.current=null}return b(P),!0}),$=go(async(...P)=>{var W;(W=e.onValuesChange)==null||W.call(e,...P)},64),E=je(P=>[e.tableName||"",P].flat(1).filter(W=>W||W===0)),R=je((P,W)=>{let te=P;return h==null||h.forEach(re=>{if((a==null?void 0:a.options.recordKey)===re)return;const X=re.toString(),se=E(X),ae=Be(W,se);ae&&(te=Pr({data:te,getRowKey:e.getRowKey,row:ae,key:X,childrenColumnName:e.childrenColumnName||"children"},"update"))}),te}),D=je((P,W,te)=>{var pe;const re=Object.keys(P||{});if(re.length===0)return(a==null?void 0:a.defaultValue)||{};const X=((pe=re.pop())==null?void 0:pe.toString())||"";if(!X)return(a==null?void 0:a.defaultValue)||{};const se=E(X),ae={...a==null?void 0:a.defaultValue,...Be(W,se)};return u.current.has(it(X))&&te.find((fe,ye)=>{var Oe;return((Oe=e.getRowKey(fe,ye))==null?void 0:Oe.toString())===X})||ae}),M=je((P,W)=>{if(!e.onValuesChange)return;const te=R(e.dataSource,W),re=D(P,W,te);$.run(re,te)}),U=d.useRef(new Map);d.useEffect(()=>{const P=new Set((h==null?void 0:h.map(W=>W==null?void 0:W.toString()))??[]);U.current.forEach((W,te)=>{P.has(te==null?void 0:te.toString())||U.current.delete(te)})},[h]);const Y=je(P=>{const W=it(P);return U.current.get(W)||U.current.get(W.toString())}),O=je(async(P,W)=>{const te=it(P),re=te.toString(),X=u.current.get(re);if(!(h==null?void 0:h.some(ue=>(ue==null?void 0:ue.toString())===re||ue===te))&&X&&(W??!0)&&e.tableName)return await O(X,!1);const ae=Y(P);return ae!=null&&ae.current?(await ae.current.save(),b(P),!0):!1}),I=je(P=>P!=null&&P.parentKey&&!u.current.has(it(P==null?void 0:P.parentKey).toString())?(console.warn("can't find record by key",P==null?void 0:P.parentKey),!1):m.current&&e.onlyAddOneLineAlertMessage!==!1?(Jl(e.onlyAddOneLineAlertMessage||t.getMessage("editableTable.onlyAddOneLine","只能新增一行")),!1):!!x()),F=je(P=>{if(P==null&&P!==0&&P!=="")throw zC(!1,`请设置 recordCreatorProps.record 并返回一个唯一的key
55
+ https://procomponents.ant.design/components/editable-table#editable-%E6%96%B0%E5%BB%BA%E8%A1%8C`),new Error("请设置 recordCreatorProps.record 并返回一个唯一的key")}),A=je((P,W)=>{var ue,pe;if(!I(W))return!1;const te=e.getRowKey(P,-1);F(te);const re=(ue=it(te))==null?void 0:ue.toString();if(re&&r.current.set(re,null),!(h==null?void 0:h.some(me=>me===te||(me==null?void 0:me.toString())===(te==null?void 0:te.toString())))){const me=h?[...h,te]:[te];S(me)}const se=typeof(W==null?void 0:W.parentKey)=="function"?W.parentKey():W==null?void 0:W.parentKey;if((W==null?void 0:W.newRecordType)==="dataSource"||e.tableName&&(W==null?void 0:W.newRecordType)!=="cache"){const me={data:e.dataSource,getRowKey:e.getRowKey,row:{...P,map_row_parentKey:se?(pe=it(se))==null?void 0:pe.toString():void 0},key:te,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Pr(me,(W==null?void 0:W.position)==="top"?"top":"update"))}else i({defaultValue:P,options:{...W,parentKey:se,recordKey:te}});return!0}),k=(e==null?void 0:e.saveText)||t.getMessage("editableTable.action.save","保存"),B=(e==null?void 0:e.deleteText)||t.getMessage("editableTable.action.delete","删除"),G=(e==null?void 0:e.cancelText)||t.getMessage("editableTable.action.cancel","取消"),_=je(async(P,W,te,re)=>{var pe,me,fe;const X=await((pe=e==null?void 0:e.onSave)==null?void 0:pe.call(e,P,W,te,re));if(X===!1)return X;const{options:se}=re||m.current||{};if(!(se!=null&&se.parentKey)&&(se==null?void 0:se.recordKey)===P)(se==null?void 0:se.position)==="top"?e.setDataSource([W,...e.dataSource]):e.setDataSource([...e.dataSource,W]);else{const ye={data:e.dataSource,getRowKey:e.getRowKey,row:se?{...W,map_row_parentKey:(me=it((se==null?void 0:se.parentKey)??""))==null?void 0:me.toString()}:W,key:P,childrenColumnName:e.childrenColumnName||"children"};e.setDataSource(Pr(ye,(se==null?void 0:se.position)==="top"?"top":"update"))}await v(P);const ue=(fe=it(P))==null?void 0:fe.toString();return ue&&r.current.delete(ue),X}),H=je(async(P,W)=>{var se,ae;const te={data:e.dataSource,getRowKey:e.getRowKey,row:W,key:P,childrenColumnName:e.childrenColumnName||"children"},re=await((se=e==null?void 0:e.onDelete)==null?void 0:se.call(e,P,W));if(re===!1)return!1;await v(P,!1),e.setDataSource(Pr(te,"delete"));const X=(ae=it(P))==null?void 0:ae.toString();return X&&r.current.delete(X),re}),Z=je(async(P,W,te,re)=>{var se;return await((se=e==null?void 0:e.onCancel)==null?void 0:se.call(e,P,W,te,re))}),q=e.actionRender&&typeof e.actionRender=="function",V=q?e.actionRender:()=>{},L=je(V);return{editableKeys:h,setEditableRowKeys:S,isEditable:T,actionRender:P=>{const W=e.getRowKey(P,P.index),te={saveText:k,cancelText:G,deleteText:B,addEditRecord:A,recordKey:W,cancelEditable:v,index:P.index,tableName:e.tableName,newLineConfig:a,onCancel:Z,onDelete:H,onSave:_,editableKeys:h,setEditableRowKeys:S,preEditRowRef:n,preEditRowRefs:r,deletePopconfirmMessage:e.deletePopconfirmMessage||`${t.getMessage("deleteThisLine","删除此项")}?`},re=YC(P,te);return e.tableName?U.current.set(u.current.get(it(W))||it(W),re.saveRef):U.current.set(it(W),re.saveRef),q?L(P,te,{save:re.save,delete:re.delete,cancel:re.cancel}):[re.save,re.delete,re.cancel]},startEditable:j,cancelEditable:v,addEditRecord:A,saveEditable:O,newLineRecord:a,preEditableKeys:y,onValuesChange:M,getRealIndex:e.getRealIndex}}const WC=new $u("card-loading",{"0%":{backgroundPosition:"0 50%"},"50%":{backgroundPosition:"100% 50%"},"100%":{backgroundPosition:"0 50%"}}),qC=e=>({[e.componentCls]:{boxSizing:"border-box","&-loading":{overflow:"hidden"},"&-loading &-body":{userSelect:"none"},[`${e.componentCls}-loading-content`]:{width:"100%",p:{marginBlock:0,marginInline:0}},[`${e.componentCls}-loading-block`]:{height:"14px",marginBlock:"4px",background:"linear-gradient(90deg, rgba(54, 61, 64, 0.2), rgba(54, 61, 64, 0.4), rgba(54, 61, 64, 0.2))",backgroundSize:"600% 600%",borderRadius:e.borderRadius,animationName:WC,animationDuration:"1.4s",animationTimingFunction:"ease",animationIterationCount:"infinite"}}});function GC(e){return tt("ProCardLoading",t=>{const n={...t,componentCls:`.${e}`};return[qC(n)]})}const ZC=e=>{const{style:t,prefix:n}=e,{wrapSSR:r}=GC(n||"ant-pro-card");return r(s.jsxs("div",{className:`${n}-loading-content`,style:t,children:[s.jsx(c.Row,{gutter:8,children:s.jsx(c.Col,{span:22,children:s.jsx("div",{className:`${n}-loading-block`})})}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:8,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:15,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:6,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:18,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:13,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:9,children:s.jsx("div",{className:`${n}-loading-block`})})]}),s.jsxs(c.Row,{gutter:8,children:[s.jsx(c.Col,{span:4,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:3,children:s.jsx("div",{className:`${n}-loading-block`})}),s.jsx(c.Col,{span:16,children:s.jsx("div",{className:`${n}-loading-block`})})]})]}))},Xl=e=>({backgroundColor:e.controlItemBgActive,borderColor:e.controlOutline}),JC=e=>{const{componentCls:t}=e;return{[t]:{position:"relative",display:"flex",flexDirection:"column",boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},width:"100%",marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0,backgroundColor:e.colorBgContainer,borderRadius:e.borderRadius,transition:"all 0.3s",...qa==null?void 0:qa(e),"&-box-shadow":{boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017",borderColor:"transparent"},"&-col":{width:"100%"},[` ${t}-col${t}-split-vertical`]:{borderInlineEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[` ${t}-col${t}-split-horizontal`]:{borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},[`${t}-divider`]:{flex:"none",alignSelf:"stretch",width:e.lineWidth,marginInline:e.marginXS,marginBlock:e.marginLG,backgroundColor:e.colorSplit,[`&${t}-divider-horizontal`]:{width:"auto",alignSelf:"auto",height:e.lineWidth,marginInline:e.marginLG,marginBlock:e.marginXS}},"&-border":{border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-hoverable":{cursor:"pointer",transition:"box-shadow 0.3s, border-color 0.3s","&:hover":{borderColor:"transparent",boxShadow:"0 1px 2px -2px #00000029, 0 3px 6px #0000001f, 0 5px 12px 4px #00000017"},[`&${t}-checked:hover`]:{borderColor:e.controlOutline}},"&-checked":{...Xl(e),"&::after":{visibility:"visible",position:"absolute",insetBlockStart:2,insetInlineEnd:2,opacity:1,width:0,height:0,border:`6px solid ${e.colorPrimary}`,borderBlockEnd:"6px solid transparent",borderInlineStart:"6px solid transparent",borderStartEndRadius:2,content:'""'}},"&:focus":{...Xl(e)},"&&-ghost":{backgroundColor:"transparent",[`> ${t}`]:{"&-header":{paddingInlineEnd:0,paddingBlockEnd:e.padding,paddingInlineStart:0},"&-body":{paddingBlock:0,paddingInline:0,backgroundColor:"transparent"}}},"&&-split > &-body":{paddingBlock:0,paddingInline:0},"&&-contain-card > &-body":{display:"flex"},[`${t}-body-direction-column`]:{flexDirection:"column"},[`${t}-body-wrap`]:{flexWrap:"wrap"},"&&-collapse":{[`> ${t}`]:{"&-header":{paddingBlockEnd:e.padding,borderBlockEnd:0},"&-body":{display:"none"}}},[`${t}-header`]:{display:"flex",alignItems:"center",justifyContent:"space-between",paddingInline:e.paddingLG,paddingBlock:e.padding,paddingBlockEnd:0,"&-border":{"&":{paddingBlockEnd:e.padding},borderBlockEnd:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`},"&-collapsible":{cursor:"pointer"}},[`${t}-title`]:{color:e.colorText,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG,lineHeight:e.lineHeight},[`${t}-extra`]:{color:e.colorText},[`${t}-type-inner`]:{[`${t}-header`]:{backgroundColor:e.colorFillAlter}},[`${t}-collapsible-icon`]:{marginInlineEnd:e.marginXS,color:e.colorIconHover,":hover":{color:e.colorPrimaryHover},"& svg":{transition:`transform ${e.motionDurationMid}`}},[`${t}-cover`]:{overflow:"hidden",borderRadius:`${e.borderRadius}px ${e.borderRadius}px 0 0`,"& > *":{width:"100%",display:"block"},"& img":{verticalAlign:"middle"}},[`${t}-body`]:{display:"block",boxSizing:"border-box",height:"100%",paddingInline:e.paddingLG,paddingBlock:e.padding,"&-center":{display:"flex",alignItems:"center",justifyContent:"center"}},"&&-size-small":{[t]:{"&-header":{paddingInline:e.paddingSM,paddingBlock:e.paddingXS,paddingBlockEnd:0,"&-border":{paddingBlockEnd:e.paddingXS}},"&-title":{fontSize:e.fontSize},"&-body":{paddingInline:e.paddingSM,paddingBlock:e.paddingSM}},[` ${t}-divider`]:{marginBlock:e.marginLG,marginInline:e.marginXS,[`&${t}-divider-horizontal`]:{marginBlock:e.marginXS,marginInline:e.marginLG}},[`${t}-header${t}-header-collapsible`]:{paddingBlock:e.paddingXS}}},[`${t}-tabs`]:{[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:e.marginXS,paddingInlineStart:e.padding}},[`${e.antCls}-tabs-bottom > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingInlineStart:e.padding}},[`${e.antCls}-tabs-left`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-left > ${e.antCls}-tabs-nav`]:{marginInlineEnd:0,[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}},[`${e.antCls}-tabs-right`]:{[`${e.antCls}-tabs-content-holder`]:{[`${e.antCls}-tabs-content`]:{[`${e.antCls}-tabs-tabpane`]:{paddingInlineStart:0}}}},[`${e.antCls}-tabs-right > ${e.antCls}-tabs-nav`]:{[`${e.antCls}-tabs-nav-list`]:{paddingBlockStart:e.padding}}}}},Sd=24,XC=(e,t)=>{const{componentCls:n}=t;return e===0?{[`${n}-col-0`]:{display:"none"}}:{[`${n}-col-${e}`]:{flexShrink:0,width:`${e/Sd*100}%`}}},QC=e=>Array(Sd+1).fill(1).map((t,n)=>XC(n,e));function ew(e){return tt("ProCard",t=>{const n={...t,componentCls:`.${e}`};return[JC(n),QC(n)]})}const{useBreakpoint:tw}=c.Grid,Cd=d.forwardRef((e,t)=>{var De;const{className:n,rootClassName:r,style:a,styles:i,title:o,subTitle:l,extra:u,wrap:m=!1,layout:g,loading:f,gutter:h=0,tooltip:p,split:S,headerBordered:y=!1,variant:w,cover:T,classNames:x,boxShadow:C=!1,children:j,size:b,actions:v,ghost:$=!1,hoverable:E=!1,direction:R,collapsed:D,collapsible:M=!1,collapsibleIconRender:U,colStyle:Y,defaultCollapsed:O=!1,onCollapse:I,checked:F,onChecked:A,tabs:k,type:B,...G}=e,_=w??"outlined",H={header:i==null?void 0:i.header,body:i==null?void 0:i.body,root:i==null?void 0:i.root,extra:i==null?void 0:i.extra,title:i==null?void 0:i.title,actions:i==null?void 0:i.actions,cover:i==null?void 0:i.cover},{getPrefixCls:Z}=d.useContext(c.ConfigProvider.ConfigContext),q=tw()||{lg:!0,md:!0,sm:!0,xl:!1,xs:!1,xxl:!1},[V,L]=dt(O,D),K=je(ve=>{I==null||I(ve)}),P=d.useCallback(ve=>{L(ke=>{const Le=typeof ve=="function"?ve(ke):ve;return queueMicrotask(()=>{K(Le)}),Le})},[K]),W=["xxl","xl","lg","md","sm","xs"],te=k==null?void 0:k.items,re=ve=>{const ke=[0,0];return(Array.isArray(ve)?ve:[ve,0]).forEach((lt,nt)=>{if(typeof lt=="object")for(let ne=0;ne<W.length;ne+=1){const Q=W[ne];if(q[Q]&&lt[Q]!==void 0){ke[nt]=lt[Q];break}}else ke[nt]=lt||0}),ke},X=(ve,ke)=>ve?ke:{},se=ve=>{let ke=ve;if(typeof ve=="object")for(let lt=0;lt<W.length;lt+=1){const nt=W[lt];if(q!=null&&q[nt]&&(ve==null?void 0:ve[nt])!==void 0){ke=ve[nt];break}}const Le=X(typeof ke=="string"&&/\d%|\dpx/i.test(ke),{width:ke,flexShrink:0});return{span:ke,colSpanStyle:Le}},ae=Z("pro-card"),{wrapSSR:ue,hashId:pe}=ew(ae),[me,fe]=re(h);let ye=!1;const Te=d.Children.toArray(j),Oe=Te.map((ve,ke)=>{var Le;if((Le=ve==null?void 0:ve.type)!=null&&Le.isProCard){ye=!0;const{colSpan:lt}=ve.props,{span:nt,colSpanStyle:ne}=se(lt),Q=ie([`${ae}-col`],pe,{[`${ae}-split-vertical`]:S==="vertical"&&ke!==Te.length-1,[`${ae}-split-horizontal`]:S==="horizontal"&&ke!==Te.length-1,[`${ae}-col-${nt}`]:typeof nt=="number"&&nt>=0&&nt<=24}),he=ue(s.jsx("div",{style:{...ne,...X(me>0,{paddingInlineEnd:me/2,paddingInlineStart:me/2}),...X(fe>0,{paddingBlockStart:fe/2,paddingBlockEnd:fe/2}),...Y},className:Q,children:d.cloneElement(ve)}));return d.cloneElement(he,{key:`pro-card-col-${(ve==null?void 0:ve.key)||ke}`})}return ve}),Ae=ie(`${ae}`,n,r,pe,x==null?void 0:x.root,{[`${ae}-border`]:_==="outlined",[`${ae}-box-shadow`]:C,[`${ae}-contain-card`]:ye,[`${ae}-loading`]:f,[`${ae}-split`]:S==="vertical"||S==="horizontal",[`${ae}-ghost`]:$,[`${ae}-hoverable`]:E,[`${ae}-size-${b}`]:b,[`${ae}-type-${B}`]:B,[`${ae}-collapse`]:V,[`${ae}-checked`]:F}),ze=ie(`${ae}-body`,pe,x==null?void 0:x.body,{[`${ae}-body-center`]:g==="center",[`${ae}-body-direction-column`]:S==="horizontal"||R==="column",[`${ae}-body-wrap`]:m&&ye}),ce=(De=H.body)==null?void 0:De.padding,z=d.isValidElement(f)?f:s.jsx(ZC,{prefix:ae,style:ce===0||ce==="0px"?{padding:24}:void 0}),J=d.useCallback(()=>{M==="icon"&&P(ve=>!ve)},[M,P]),le=M&&(U?s.jsx("span",{role:"button",tabIndex:M==="icon"?0:void 0,className:ie(`${ae}-collapsible-icon`,pe),onClick:M==="icon"?J:void 0,onKeyDown:M==="icon"?ve=>{(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),J())}:void 0,children:U({collapsed:V})}):s.jsx(de.RightOutlined,{onClick:J,rotate:V?void 0:90,className:ie(`${ae}-collapsible-icon`,pe)})),Se=ie(`${ae}-header`,pe,x==null?void 0:x.header,{[`${ae}-header-border`]:y||B==="inner",[`${ae}-header-collapsible`]:le}),Ee=ie(`${ae}-title`,pe,x==null?void 0:x.title),Fe=ie(`${ae}-extra`,pe,x==null?void 0:x.extra),Ie={...H.root,...a};return ue(s.jsxs("div",{className:Ae,style:Ie,ref:t,onClick:ve=>{var ke;A==null||A(ve),(ke=G==null?void 0:G.onClick)==null||ke.call(G,ve)},...Ze(G,["prefixCls","colSpan"]),children:[(o||u||le)&&s.jsxs("div",{className:Se,style:H.header,onClick:()=>{(M==="header"||M===!0)&&P(!V)},children:[s.jsxs("div",{className:Ee,style:H.title,children:[le,s.jsx(fr,{label:o,tooltip:p,subTitle:l})]}),u&&s.jsx("div",{className:Fe,style:H.extra,onClick:ve=>ve.stopPropagation(),children:u})]}),T&&!V&&s.jsx("div",{className:ie(`${ae}-cover`,pe,x==null?void 0:x.cover),style:H.cover,children:T}),k?s.jsx("div",{className:ie(`${ae}-tabs`,pe),children:s.jsx(c.Tabs,{onChange:k.onChange,...Ze(k,["cardProps"]),items:te,children:f?z:j})}):s.jsx("div",{className:ze,style:H.body,children:f?z:Oe}),v?s.jsx(lp,{actions:v,prefixCls:ae}):null]}))});function nw(e){return tt("ProCardDivider",()=>({}))}const rw=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),r=`${t("pro-card")}-divider`,{wrapSSR:a,hashId:i}=nw(),{className:o,style:l={},orientation:u="vertical"}=e,m=ie(r,o,i,{[`${r}-${u}`]:u});return a(s.jsx("div",{className:m,style:l}))},sw=e=>{const{styles:t,...n}=e;return s.jsx(Cd,{...n,styles:{...t,body:{...t==null?void 0:t.body,padding:0}}})},Ca=Cd;Ca.isProCard=!0;Ca.Divider=rw;Ca.Group=sw;var Hs={exports:{}},aw=Hs.exports,Ql;function iw(){return Ql||(Ql=1,(function(e,t){(function(n,r){e.exports=r()})(aw,(function(){return function(n,r){var a=r.prototype,i=a.format;a.format=function(o){var l=this,u=this.$locale();if(!this.isValid())return i.bind(this)(o);var m=this.$utils(),g=(o||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(f){switch(f){case"Q":return Math.ceil((l.$M+1)/3);case"Do":return u.ordinal(l.$D);case"gggg":return l.weekYear();case"GGGG":return l.isoWeekYear();case"wo":return u.ordinal(l.week(),"W");case"w":case"ww":return m.s(l.week(),f==="w"?1:2,"0");case"W":case"WW":return m.s(l.isoWeek(),f==="W"?1:2,"0");case"k":case"kk":return m.s(String(l.$H===0?24:l.$H),f==="k"?1:2,"0");case"X":return Math.floor(l.$d.getTime()/1e3);case"x":return l.$d.getTime();case"z":return"["+l.offsetName()+"]";case"zzz":return"["+l.offsetName("long")+"]";default:return f}}));return i.bind(this)(g)}}}))})(Hs)),Hs.exports}var ow=iw();const wd=Jt(ow);var Us={exports:{}},lw=Us.exports,ec;function cw(){return ec||(ec=1,(function(e,t){(function(n,r){e.exports=r()})(lw,(function(){var n="day";return function(r,a,i){var o=function(m){return m.add(4-m.isoWeekday(),n)},l=a.prototype;l.isoWeekYear=function(){return o(this).year()},l.isoWeek=function(m){if(!this.$utils().u(m))return this.add(7*(m-this.isoWeek()),n);var g,f,h,p,S=o(this),y=(g=this.isoWeekYear(),f=this.$u,h=(f?i.utc:i)().year(g).startOf("year"),p=4-h.isoWeekday(),h.isoWeekday()>4&&(p+=7),h.add(p,n));return S.diff(y,"week")+1},l.isoWeekday=function(m){return this.$utils().u(m)?this.day()||7:this.day(this.day()%7?m:m-7)};var u=l.startOf;l.startOf=function(m,g){var f=this.$utils(),h=!!f.u(g)||g;return f.p(m)==="isoweek"?h?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):u.bind(this)(m,g)}}}))})(Us)),Us.exports}var uw=cw();const jd=Jt(uw);var Ys={exports:{}},dw=Ys.exports,tc;function fw(){return tc||(tc=1,(function(e,t){(function(n,r){e.exports=r()})(dw,(function(){return function(n,r,a){var i=r.prototype,o=function(f){return f&&(f.indexOf?f:f.s)},l=function(f,h,p,S,y){var w=f.name?f:f.$locale(),T=o(w[h]),x=o(w[p]),C=T||x.map((function(b){return b.slice(0,S)}));if(!y)return C;var j=w.weekStart;return C.map((function(b,v){return C[(v+(j||0))%7]}))},u=function(){return a.Ls[a.locale()]},m=function(f,h){return f.formats[h]||(function(p){return p.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(S,y,w){return y||w.slice(1)}))})(f.formats[h.toUpperCase()])},g=function(){var f=this;return{months:function(h){return h?h.format("MMMM"):l(f,"months")},monthsShort:function(h){return h?h.format("MMM"):l(f,"monthsShort","months",3)},firstDayOfWeek:function(){return f.$locale().weekStart||0},weekdays:function(h){return h?h.format("dddd"):l(f,"weekdays")},weekdaysMin:function(h){return h?h.format("dd"):l(f,"weekdaysMin","weekdays",2)},weekdaysShort:function(h){return h?h.format("ddd"):l(f,"weekdaysShort","weekdays",3)},longDateFormat:function(h){return m(f.$locale(),h)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};i.localeData=function(){return g.bind(this)()},a.localeData=function(){var f=u();return{firstDayOfWeek:function(){return f.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(h){return m(f,h)},meridiem:f.meridiem,ordinal:f.ordinal}},a.months=function(){return l(u(),"months")},a.monthsShort=function(){return l(u(),"monthsShort","months",3)},a.weekdays=function(f){return l(u(),"weekdays",null,null,f)},a.weekdaysShort=function(f){return l(u(),"weekdaysShort","weekdays",3,f)},a.weekdaysMin=function(f){return l(u(),"weekdaysMin","weekdays",2,f)}}}))})(Ys)),Ys.exports}var mw=fw();const vd=Jt(mw);var Ks={exports:{}},hw=Ks.exports,nc;function gw(){return nc||(nc=1,(function(e,t){(function(n,r){e.exports=r()})(hw,(function(){return function(n,r){r.prototype.weekday=function(a){var i=this.$locale().weekStart||0,o=this.$W,l=(o<i?o+7:o)-i;return this.$utils().u(a)?l:this.subtract(l,"day").add(a,"day")}}}))})(Ks)),Ks.exports}var pw=gw();const Td=Jt(pw);var Ws={exports:{}},yw=Ws.exports,rc;function xw(){return rc||(rc=1,(function(e,t){(function(n,r){e.exports=r()})(yw,(function(){var n="week",r="year";return function(a,i,o){var l=i.prototype;l.week=function(u){if(u===void 0&&(u=null),u!==null)return this.add(7*(u-this.week()),"day");var m=this.$locale().yearStart||1;if(this.month()===11&&this.date()>25){var g=o(this).startOf(r).add(1,r).date(m),f=o(this).endOf(n);if(g.isBefore(f))return 1}var h=o(this).startOf(r).date(m).startOf(n).subtract(1,"millisecond"),p=this.diff(h,n,!0);return p<0?o(this).startOf("week").week():Math.ceil(p)},l.weeks=function(u){return u===void 0&&(u=null),this.week(u)}}}))})(Ws)),Ws.exports}var bw=xw();const vo=Jt(bw),sc=(e,t)=>typeof t!="object"?e[t]||t:e[t==null?void 0:t.value]||t.label,Sw=(e,t)=>{const{label:n,prefixCls:r,onChange:a,value:i,mode:o,defaultValue:l,labelVariant:u,size:m,showSearch:g,disabled:f,style:h,className:p,options:S,onSearch:y,allowClear:w,labelInValue:T,fieldNames:x,lightLabel:C,labelTrigger:j,optionFilterProp:b,optionLabelProp:v="",valueMaxLength:$=41,fetchDataOnSearch:E=!1,fetchData:R,variant:D="outlined",...M}=e,{placeholder:U=n}=e,{label:Y="label",value:O="value"}=x||{},{getPrefixCls:I}=d.useContext(c.ConfigProvider.ConfigContext),F=I("pro-field-select-light-select"),[A,k]=d.useState(!1),[B,G]=d.useState(""),{wrapSSR:_,hashId:H}=tt("LightSelect",L=>({[`.${F}`]:{[`${L.antCls}-select`]:{position:"absolute",width:"153px",height:"28px",visibility:"hidden",opacity:0,"&-selector":{height:28}},[`&.${F}-searchable`]:{[`${L.antCls}-select`]:{width:"200px","&-selector":{height:28}}}}})),Z=d.useMemo(()=>{const L={};return S==null||S.forEach(K=>{const P=K[v]||K[Y],W=K[O];L[W]=P||W}),L},[Y,S,O,v]),q=d.useMemo(()=>Reflect.has(M,"open")?M==null?void 0:M.open:A,[A,M]),V=Array.isArray(i)?i.map(L=>sc(Z,L)):sc(Z,i);return _(s.jsxs("div",{className:ie(F,H,{[`${F}-searchable`]:g},`${F}-container-${M.placement||"bottomLeft"}`,p),style:h,onClick:L=>{var P,W,te;if(f)return;((te=(W=(P=C==null?void 0:C.current)==null?void 0:P.labelRef)==null?void 0:W.current)==null?void 0:te.contains(L.target))||k(!0)},children:[s.jsx(c.Select,{...M,allowClear:w,value:i,mode:o,labelInValue:T,size:m,disabled:f,variant:D,onChange:(L,K)=>{a==null||a(L,K),o!=="multiple"&&k(!1)},showSearch:g,onSearch:g?L=>{E&&R&&R(L),y==null||y(L)}:void 0,style:h,popupRender:L=>s.jsxs("div",{ref:t,children:[g&&s.jsx("div",{style:{margin:"4px 8px"},children:s.jsx(c.Input,{value:B,allowClear:!!w,onChange:K=>{G(K.target.value),E&&R&&R(K.target.value),y==null||y(K.target.value)},onKeyDown:K=>{if(K.key==="Backspace"){K.stopPropagation();return}(K.key==="ArrowUp"||K.key==="ArrowDown")&&K.preventDefault()},style:{width:"100%"},prefix:s.jsx(de.SearchOutlined,{})})}),L]}),open:q,onOpenChange:L=>{var K;L||G(""),j||k(L),(K=M==null?void 0:M.onOpenChange)==null||K.call(M,L)},prefixCls:r,options:y||!B?S:S==null?void 0:S.filter(L=>{var K,P,W,te,re;return b?Tn(L[b]).join("").toLowerCase().includes(B):((P=(K=String(L[Y]))==null?void 0:K.toLowerCase())==null?void 0:P.includes(B==null?void 0:B.toLowerCase()))||((re=(te=(W=L[O])==null?void 0:W.toString())==null?void 0:te.toLowerCase())==null?void 0:re.includes(B==null?void 0:B.toLowerCase()))})}),s.jsx(Qt,{ellipsis:!0,label:n,placeholder:U,disabled:f,variant:u,allowClear:!!w,value:V||(i==null?void 0:i.label)||i,onClear:()=>{a==null||a(void 0,void 0)},onClick:()=>{f||k(!A)},ref:C,valueMaxLength:$})]}))},Cw=d.forwardRef(Sw),ww=(e,t)=>{const{optionItemRender:n,mode:r,onSearch:a,onFocus:i,onChange:o,autoClearSearchValue:l=!0,searchOnFocus:u=!1,resetAfterSelect:m=!1,fetchDataOnSearch:g=!0,optionFilterProp:f="label",optionLabelProp:h="label",className:p,disabled:S,options:y,fetchData:w,resetData:T,prefixCls:x,onClear:C,searchValue:j,showSearch:b,fieldNames:v,defaultSearchValue:$,preserveOriginalLabel:E=!1,...R}=e,{label:D="label",value:M="value",options:U="options"}=v||{},[Y,O]=dt($,j),I=d.useRef();d.useImperativeHandle(t,()=>I.current),d.useEffect(()=>{var H;R.autoFocus&&((H=I==null?void 0:I.current)==null||H.focus())},[R.autoFocus]);const{getPrefixCls:F}=d.useContext(c.ConfigProvider.ConfigContext),A=F("pro-filed-search-select",x),k=ie(A,p,{[`${A}-disabled`]:S}),B=(H,Z)=>{if(H&&typeof H.label=="string"&&H.label)return H.label;if(H&&H.text&&typeof H.text=="string")return H.text;if(H&&H.label)return String(H.label);if(H&&H.text)return String(H.text);if(Z&&Z.label){const q=Z.label;return(d.isValidElement(q)||q&&typeof q=="object"&&"props"in q)&&q.props&&q.props.label?String(q.props.label):typeof q=="string"?q:String(q)}return""},G=(H,Z)=>Array.isArray(H)&&Array.isArray(Z)&&H.length>0?H.map((q,V)=>{const L=Z==null?void 0:Z[V],K=L==null?void 0:L["data-item"],P=B(K,q);return{...K||{},...q,label:P||q.label}}):[],_=H=>H.map((Z,q)=>{const{className:V,optionType:L,...K}=Z,P=Z[D]??Z.text,W=Z[M],te=Z[U]??[];return L==="optGroup"||Z.options?{label:P,...K,data_title:P,title:P,key:W??`${P==null?void 0:P.toString()}-${q}-${Gr()}`,children:_(te)}:{title:P,...K,data_title:P,value:W??q,key:W??`${P==null?void 0:P.toString()}-${q}-${Gr()}`,"data-item":Z,className:`${A}-option ${V||""}`.trim(),label:(n==null?void 0:n(Z))||P}});return s.jsx(c.Select,{ref:I,className:k,allowClear:!0,autoClearSearchValue:l,disabled:S,mode:r,showSearch:b,searchValue:Y,optionFilterProp:f,optionLabelProp:h,onClear:()=>{C==null||C(),w(void 0),b&&(a==null||a(""),O(""))},...R,filterOption:R.filterOption==!1?!1:(H,Z)=>{var V,L;const q=Y===""?"":H||Y;return q?R.filterOption&&typeof R.filterOption=="function"?R.filterOption(q,{...Z,label:Z==null?void 0:Z.data_title}):!!((V=Z==null?void 0:Z.data_title)!=null&&V.toString().toLowerCase().includes(q.toLowerCase())||(L=Z==null?void 0:Z[f])!=null&&L.toString().toLowerCase().includes(q.toLowerCase())):!0},onSearch:b?H=>{g&&w(H),a==null||a(H),O(H)}:void 0,onChange:(H,Z,...q)=>{if(b&&l&&(w(void 0),a==null||a(""),O("")),!e.labelInValue){o==null||o(H,Z,...q);return}if(r!=="multiple"&&!Array.isArray(Z)){let K=Z&&Z["data-item"];if(!K&&H&&y){const P=H[M]??H.value,W=te=>{for(const re of te){if((re[M]??re.value)===P)return re;if(re[U]||re.options){const se=W(re[U]||re.options||[]);if(se)return se}}return null};K=W(y)}if(!H||!K){const P=B(K,H),W=H&&{...H,label:P};o==null||o(W,Z,...q)}else{const P=B(K,H);o==null||o({...H,...K,label:P},Z,...q)}return}const V=G(H,Z);o==null||o(V,Z,...q),m&&T()},onFocus:H=>{u&&(w(void 0),b&&(a==null||a(""),O(""))),i==null||i(H)},options:_(y||[])})},jw=d.forwardRef(ww),vw=({label:e,words:t})=>{const{getPrefixCls:n}=d.useContext(c.ConfigProvider.ConfigContext),r=n("pro-select-item-option-content-light"),a=n("pro-select-item-option-content"),{wrapSSR:i}=tt("Highlight",m=>({[`.${r}`]:{color:m.colorPrimary},[`.${a}`]:{flex:"auto",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})),o=new RegExp(t.map(m=>m.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")).join("|"),"gi");let l=e;const u=[];for(;l.length;){const m=o.exec(l);if(!m){u.push(l);break}const g=m.index,f=m[0].length+g;u.push(l.slice(0,g),d.createElement("span",{className:r},l.slice(g,f))),l=l.slice(f)}return i(d.createElement("div",{title:e,className:a},...u))};function Bi(e,t){var n,r;return!!(!t||(n=e==null?void 0:e.label)!=null&&n.toString().toLowerCase().includes(t.toLowerCase())||(r=e==null?void 0:e.value)!=null&&r.toString().toLowerCase().includes(t.toLowerCase())||(e.children||e.options)&&[...e.children||[],e.options||[]].find(i=>Bi(i,t)))}const Fd=e=>{const t=[],n=un(e);return n.forEach((r,a)=>{const i=n.get(a)||n.get(`${a}`);if(i){if(typeof i=="object"&&(i!=null&&i.text)){t.push({text:i==null?void 0:i.text,value:a,label:i==null?void 0:i.text,disabled:i.disabled});return}t.push({text:i,value:a})}}),t},Sr=e=>{var w,T;const{cacheForSwr:t,fieldProps:n}=e,[r,a]=d.useState(e.defaultKeyWords),[i]=d.useState(()=>e.proFieldKey?e.proFieldKey.toString():e.request?Gr():"no-fetch"),o=d.useRef(i),l=je(x=>Fd(un(x)).map(({value:C,text:j,...b})=>({label:j,value:C,key:C,...b}))),u=St(()=>{if(!n)return;const x=(n==null?void 0:n.options)||(n==null?void 0:n.treeData);if(!x)return;const{children:C,label:j,value:b}=n.fieldNames||{},v=($,E)=>{if(!($!=null&&$.length))return;const R=$.length;let D=0;for(;D<R;){const M=$[D++];(M[C]||M[j]||M[b])&&(M[E]=M[E==="children"?C:E==="label"?j:b],v(M[C],E))}};return C&&v(x,"children"),j&&v(x,"label"),b&&v(x,"value"),x},[n]),[m,g]=dt(()=>e.valueEnum?l(e.valueEnum):[],u);ir(()=>{var x,C;!e.valueEnum||(x=e.fieldProps)!=null&&x.options||(C=e.fieldProps)!=null&&C.treeData||g(l(e.valueEnum))},[e.valueEnum]);const f=Pp([o.current,e.params,r],e.debounceTime??((w=e==null?void 0:e.fieldProps)==null?void 0:w.debounceTime)??0,[e.params,r]),{data:h,mutate:p,isValidating:S}=zu(()=>e.request?f:null,([,x,C])=>e.request({...x,keyWords:C},e),{revalidateIfStale:!t,revalidateOnReconnect:t,shouldRetryOnError:!1,revalidateOnFocus:!1}),y=d.useMemo(()=>{var C,j;const x=m==null?void 0:m.map(b=>{if(typeof b=="string")return{label:b,value:b};if(b.children||b.options){const v=[...b.children||[],...b.options||[]].filter($=>Bi($,r));return{...b,children:v,options:v}}return b});return((C=e.fieldProps)==null?void 0:C.filterOption)===!0||((j=e.fieldProps)==null?void 0:j.filterOption)===void 0?x==null?void 0:x.filter(b=>b?r?Bi(b,r):!0:!1):x},[m,r,(T=e.fieldProps)==null?void 0:T.filterOption]);return[S,e.request?h:y,x=>{a(x)},()=>{a(void 0),p([],!1)}]},Tw=(e,t)=>{var M,U;const{mode:n,valueEnum:r,render:a,formItemRender:i,request:o,fieldProps:l,light:u,proFieldKey:m,params:g,label:f,variant:h,id:p,lightLabel:S,labelTrigger:y,...w}=e,T=d.useRef(),x=Ne(),C=d.useRef(""),{fieldNames:j}=l;d.useEffect(()=>{C.current=l==null?void 0:l.searchValue},[l==null?void 0:l.searchValue]);const[b,v,$,E]=Sr(e),{componentSize:R}=((U=(M=c.ConfigProvider)==null?void 0:M.useConfig)==null?void 0:U.call(M))||{componentSize:"middle"};d.useImperativeHandle(t,()=>({...T.current||{},fetchData:Y=>$(Y)}),[$]);const D=d.useMemo(()=>{if(n!=="read")return;const{label:Y="label",value:O="value",options:I="options"}=j||{},F=new Map,A=k=>{if(!(k!=null&&k.length))return F;const B=k.length;let G=0;for(;G<B;){const _=k[G++];F.set(_[O],_[Y]),A(_[I])}return F};return A(v)},[j,n,v]);if(n==="read"){const Y=s.jsx(s.Fragment,{children:Un(w.text,un(r||D))});return a?a(Y,{mode:n,...l},Y)??null:Y}if(n==="edit"||n==="update"){const O=u?s.jsx(Cw,{id:p,loading:b,ref:T,allowClear:!0,size:R,options:v,label:f,labelVariant:h,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),lightLabel:S,labelTrigger:y,fetchData:$,...l}):s.jsx(jw,{className:w.className,style:{minWidth:100,...w.style},id:p,loading:b,ref:T,allowClear:!0,defaultSearchValue:e.defaultKeyWords,notFoundContent:b?s.jsx(c.Spin,{size:"small"}):l==null?void 0:l.notFoundContent,fetchData:I=>{C.current=I??"",$(I),I===void 0&&(C.current="")},resetData:E,optionItemRender:I=>typeof I.label=="string"&&C.current?s.jsx(vw,{label:I.label,words:[C.current]}):I.label,placeholder:x.getMessage("tableForm.selectPlaceholder","请选择"),label:f,...l,options:v},"SearchSelect");return i?i(w.text,{mode:n,...l,options:v,loading:b},O)??null:O}return null},vs=d.forwardRef(Tw),Fw=({placeholder:e,formItemRender:t,mode:n,render:r,label:a,light:i,variant:o,...l},u)=>{var C;const{getPrefixCls:m}=d.useContext(c.ConfigProvider.ConfigContext),g=m("pro-field-cascader"),[f,h,p]=Sr(l),S=Ne(),y=d.useRef(),[w,T]=d.useState(!1);d.useImperativeHandle(u,()=>({...y.current||{},fetchData:j=>p(j)}),[p]);const x=d.useMemo(()=>{var R;if(n!=="read")return;const{value:j="value",label:b="label",children:v="children"}=((R=l.fieldProps)==null?void 0:R.fieldNames)||{},$=new Map,E=D=>{if(!(D!=null&&D.length))return $;const M=D.length;let U=0;for(;U<M;){const Y=D[U++];$.set(Y[j],Y[b]),E(Y[v])}return $};return E(h)},[n,h,(C=l.fieldProps)==null?void 0:C.fieldNames]);if(n==="read"){const j=s.jsx(s.Fragment,{children:Un(l.text,un(l.valueEnum||x))});return r?r(l.text,{mode:n,...l.fieldProps},j)??null:j}if(n==="edit"){const j=l.fieldProps||{};let b=s.jsx(c.Cascader,{ref:y,open:w,suffixIcon:f?s.jsx(de.LoadingOutlined,{}):void 0,placeholder:e||S.getMessage("tableForm.selectPlaceholder","请选择"),allowClear:(j==null?void 0:j.allowClear)!==!1,...j,onOpenChange:v=>{var $;($=j==null?void 0:j.onOpenChange)==null||$.call(j,v),T(v)},className:ie(j==null?void 0:j.className,g),options:h});if(t&&(b=t(l.text,{mode:n,...j,options:h,loading:f},b)??null),i){const{disabled:v,value:$}=j,E=!!$&&($==null?void 0:$.length)!==0;return s.jsx(Qt,{label:a,disabled:v,variant:o,value:E||w?b:null,style:E?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:E||w?!1:void 0,onClick:()=>{var R;T(!0),(R=j==null?void 0:j.onOpenChange)==null||R.call(j,!0)}})}return b}return null},ac=d.forwardRef(Fw),$w=({layout:e="horizontal",formItemRender:t,mode:n,render:r,...a},i)=>{var w,T,x,C,j;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-checkbox"),u=(T=(w=c.Form.Item)==null?void 0:w.useStatus)==null?void 0:T.call(w),[m,g,f]=Sr(a),{wrapSSR:h,hashId:p}=tt("Checkbox",b=>({[`.${l}`]:{"&-error":{span:{color:b.colorError}},"&-warning":{span:{color:b.colorWarning}},"&-vertical":{[`&${b.antCls}-checkbox-group`]:{display:"inline-block"},[`${b.antCls}-checkbox-wrapper+${b.antCls}-checkbox-wrapper`]:{"margin-inline-start":"0 !important"},[`${b.antCls}-checkbox-group-item`]:{display:"flex",marginInlineEnd:0}}}})),{token:S}=(C=(x=c.theme).useToken)==null?void 0:C.call(x),y=d.useRef();if(d.useImperativeHandle(i,()=>({...y.current||{},fetchData:b=>f(b)}),[f]),m)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const b=g!=null&&g.length?g==null?void 0:g.reduce(($,E)=>({...$,[E.value??""]:E.label}),{}):void 0,v=Un(a.text,un(a.valueEnum||b));return r?r(a.text,{mode:n,...a.fieldProps},s.jsx(s.Fragment,{children:v}))??null:s.jsx("div",{style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:S.marginSM},children:v})}if(n==="edit"){const{fieldNames:b,variant:v,...$}=a.fieldProps||{},E=h(s.jsx(c.Checkbox.Group,{...$,variant:v,className:ie((j=a.fieldProps)==null?void 0:j.className,p,`${l}-${e}`,{[`${l}-error`]:(u==null?void 0:u.status)==="error",[`${l}-warning`]:(u==null?void 0:u.status)==="warning"}),options:g}));return t?t(a.text,{mode:n,...a.fieldProps,options:g,loading:m},E)??null:E}return null},ic=d.forwardRef($w),Ew=(e,t)=>{if(typeof e!="string")return e;try{if(t==="json")return JSON.stringify(JSON.parse(e),null,2)}catch{}return e},Rw=({text:e,mode:t,render:n,language:r="text",formItemRender:a,fieldProps:i},o)=>{const l=Ew(e,r),{token:u}=jn.useToken();if(t==="read"){const m=s.jsx("pre",{ref:o,...i,style:{padding:16,overflow:"auto",fontSize:"85%",lineHeight:1.45,color:u.colorTextSecondary,fontFamily:u.fontFamilyCode,backgroundColor:"rgba(150, 150, 150, 0.1)",borderRadius:3,width:"min-content",...i.style},children:s.jsx("code",{children:l})});return n?n(l,{mode:t,...i,ref:o},m):m}if(t==="edit"||t==="update"){i.value=l;const m=s.jsx(c.Input.TextArea,{rows:5,...i,ref:o});return a?a(l,{mode:t,...i,ref:o},m)??null:m}return null},Ts=d.forwardRef(Rw),Iw={label:"Recommended",colors:["#F5222D","#FA8C16","#FADB14","#8BBB11","#52C41A","#13A8A8","#1677FF","#2F54EB","#722ED1","#EB2F96","#F5222D4D","#FA8C164D","#FADB144D","#8BBB114D","#52C41A4D","#13A8A84D","#1677FF4D","#2F54EB4D","#722ED14D","#EB2F964D"]},Mw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-color-picker");if(t==="read"){const u=s.jsx(c.ColorPicker,{value:e,className:ie({[l]:!0}),open:!1});return n?n(e,{mode:t,...a},u):u}if(t==="edit"||t==="update"){const u={display:"table-cell",...a.style},m=s.jsx(c.ColorPicker,{ref:i,presets:[Iw],...a,style:u,className:ie({[l]:!0})});return r?r(e,{mode:t,...a,style:u},m):m}return null},oc=d.forwardRef(Mw);Re.extend(vo);const Aw=(e,t)=>e?typeof t=="function"?t(Re(e)):Re(e).format((Array.isArray(t)?t[0]:t)||"YYYY-MM-DD"):"-",kw=({text:e,mode:t,format:n="YYYY-MM-DD",label:r,light:a,render:i,formItemRender:o,showTime:l,fieldProps:u,picker:m,lightLabel:g,variant:f},h)=>{const p=Ne(),[S,y]=d.useState(!1);if(t==="read"){const w=Aw(e,u.format||n);return i?i(e,{mode:t,...u},s.jsx(s.Fragment,{children:w})):s.jsx(s.Fragment,{children:w})}if(t==="edit"||t==="update"){let w;const{disabled:T,value:x,placeholder:C=p.getMessage("tableForm.selectPlaceholder","请选择")}=u,j=xr(x);return a?w=s.jsx(Qt,{label:r,onClick:()=>{var b;(b=u==null?void 0:u.onOpenChange)==null||b.call(u,!0),y(!0)},style:j?{paddingInlineEnd:0}:void 0,disabled:T,value:j||S?s.jsx(c.DatePicker,{picker:m,showTime:l,format:n,ref:h,...u,value:j,onOpenChange:b=>{var v;y(b),(v=u==null?void 0:u.onOpenChange)==null||v.call(u,b)},open:S}):void 0,allowClear:!1,downIcon:j||S?!1:void 0,variant:f,ref:g}):w=s.jsx(c.DatePicker,{picker:m,showTime:l,format:n,placeholder:C,variant:f,ref:h,...u,value:j}),o?o(e,{mode:t,...u},w):w}return null},At=d.forwardRef(kw);function Ow(e){return Lt(e)||e===""||(e==null?void 0:e.trim())===""}const Dw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i},o)=>{var g;const l=Ne(),u=r||l.getMessage("tableForm.inputPlaceholder","请输入"),m=d.useCallback(f=>{let h=f??void 0;if(!i.stringMode&&typeof h=="string"){const p=Number(h);if(isNaN(p)){const S=h.match(/^(\d+(?:\.\d+)?)/);S?h=Number(S[1]):h=void 0}else h=p}return typeof h=="number"&&!Lt(h)&&!Lt(i.precision)&&(h=Number(h.toFixed(i.precision))),h},[i]);if(t==="read"){let f={};i!=null&&i.precision&&(f={minimumFractionDigits:Number(i.precision),maximumFractionDigits:Number(i.precision)});const h=new Intl.NumberFormat(void 0,{...f,...(i==null?void 0:i.intlProps)||{}}).format(Number(e)),p=i!=null&&i.stringMode?s.jsx("span",{children:e}):s.jsx("span",{ref:o,children:((g=i==null?void 0:i.formatter)==null?void 0:g.call(i,h))||h});return n?n(e,{mode:t,...i},p):p}if(t==="edit"||t==="update"){const f=s.jsx(c.InputNumber,{ref:o,min:0,placeholder:u,...Ze(i,["onChange","onBlur"]),onChange:h=>{var p;return(p=i==null?void 0:i.onChange)==null?void 0:p.call(i,m(h))},onBlur:h=>{var y,w,T;const p=h.target.value;if(Ow(p)){(y=i==null?void 0:i.onBlur)==null||y.call(i,h);return}const S=m(p);h.target&&typeof S=="number"&&(h.target.value=S.toString(),(w=i==null?void 0:i.onChange)==null||w.call(i,S)),(T=i==null?void 0:i.onBlur)==null||T.call(i,h)}});return a?a(e,{mode:t,...i},f):f}return null},ia=d.forwardRef(Dw),Pw=({text:e,mode:t,render:n,placeholder:r,formItemRender:a,fieldProps:i,separator:o="~",separatorWidth:l=30},u)=>{const{value:m,defaultValue:g,onChange:f,id:h}=i,p=Ne(),{token:S}=jn.useToken(),[y,w]=dt(()=>g,m),T=d.useCallback(C=>{w(j=>{const b=typeof C=="function"?C(j):C;return f==null||f(b),b})},[f]),x=d.useRef(y);if(t==="read"){const C=b=>{var $;const v=new Intl.NumberFormat(void 0,{minimumSignificantDigits:2,...(i==null?void 0:i.intlProps)||{}}).format(Number(b));return(($=i==null?void 0:i.formatter)==null?void 0:$.call(i,v))||v},j=s.jsxs("span",{ref:u,children:[C(e[0])," ",o," ",C(e[1])]});return n?n(e,{mode:t,...i},j):j}if(t==="edit"||t==="update"){const C=()=>{if(Array.isArray(x.current)){const[E,R]=x.current;if(typeof E=="number"&&typeof R=="number"&&E>R){T([R,E]);return}E===void 0&&R===void 0&&T(void 0)}},j=(E,R)=>{const D=[...y||[]];D[E]=R===null?void 0:R,x.current=D,T(D)},b=(i==null?void 0:i.placeholder)||r||[p.getMessage("tableForm.inputPlaceholder","请输入"),p.getMessage("tableForm.inputPlaceholder","请输入")],v=E=>Array.isArray(b)?b[E]:b,$=s.jsxs(c.Space.Compact,{block:!0,onBlur:C,children:[s.jsx(c.InputNumber,{...i,placeholder:v(0),id:h??`${h}-0`,style:{width:`calc((100% - ${l}px) / 2)`},value:y==null?void 0:y[0],defaultValue:g==null?void 0:g[0],onChange:E=>j(0,E)}),s.jsx(c.Input,{style:{width:l,textAlign:"center",borderInlineStart:0,borderInlineEnd:0,pointerEvents:"none",backgroundColor:S==null?void 0:S.colorBgContainer},placeholder:o,disabled:!0}),s.jsx(c.InputNumber,{...i,placeholder:v(1),id:h??`${h}-1`,style:{width:`calc((100% - ${l}px) / 2)`,borderInlineStart:0},value:y==null?void 0:y[1],defaultValue:g==null?void 0:g[1],onChange:E=>j(1,E)})]});return a?a(e,{mode:t,...i},$):$}return null},lc=d.forwardRef(Pw);var qs={exports:{}},Nw=qs.exports,cc;function Lw(){return cc||(cc=1,(function(e,t){(function(n,r){e.exports=r()})(Nw,(function(){return function(n,r,a){n=n||{};var i=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function l(m,g,f,h){return i.fromToBase(m,g,f,h)}a.en.relativeTime=o,i.fromToBase=function(m,g,f,h,p){for(var S,y,w,T=f.$locale().relativeTime||o,x=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],C=x.length,j=0;j<C;j+=1){var b=x[j];b.d&&(S=h?a(m).diff(f,b.d,!0):f.diff(m,b.d,!0));var v=(n.rounding||Math.round)(Math.abs(S));if(w=S>0,v<=b.r||!b.r){v<=1&&j>0&&(b=x[j-1]);var $=T[b.l];p&&(v=p(""+v)),y=typeof $=="string"?$.replace("%d",v):$(v,g,b.l,w);break}}if(g)return y;var E=w?T.future:T.past;return typeof E=="function"?E(y):E.replace("%s",y)},i.to=function(m,g){return l(m,g,this,!0)},i.from=function(m,g){return l(m,g,this)};var u=function(m){return m.$u?a.utc():a()};i.toNow=function(m){return this.to(u(this),m)},i.fromNow=function(m){return this.from(u(this),m)}}}))})(qs)),qs.exports}var _w=Lw();const zw=Jt(_w);Re.extend(zw);const Bw=({text:e,mode:t,variant:n,render:r,formItemRender:a,format:i,fieldProps:o},l)=>{const u=Ne();if(t==="read"){const m=s.jsx(c.Tooltip,{title:Re(e).format((o==null?void 0:o.format)||i||"YYYY-MM-DD HH:mm:ss"),children:Re(e).fromNow()});return r?r(e,{mode:t,...o},s.jsx(s.Fragment,{children:m})):s.jsx(s.Fragment,{children:m})}if(t==="edit"||t==="update"){const m=u.getMessage("tableForm.selectPlaceholder","请选择"),g=xr(o.value),f=s.jsx(c.DatePicker,{ref:l,placeholder:m,showTime:!0,variant:n??(o==null?void 0:o.variant)??"outlined",...o,value:g});return a?a(e,{mode:t,...o},f):f}return null},uc=d.forwardRef(Bw),dc=d.forwardRef(({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i,width:o},l)=>{const u=Ne(),m=i||u.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const g=s.jsx(c.Image,{ref:l,width:o||32,src:e,...a});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(c.Input,{ref:l,placeholder:m,...a});return r?r(e,{mode:t,...a},g):g}return null}),Vw=({border:e=!1,children:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-index-column"),{wrapSSR:i,hashId:o}=tt("IndexColumn",()=>({[`.${a}`]:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"18px",height:"18px","&-border":{color:"#fff",fontSize:"12px",lineHeight:"12px",backgroundColor:"#314659",borderRadius:"9px","&.top-three":{backgroundColor:"#979797"}}}}));return i(s.jsx("div",{ref:n,className:ie(a,o,{[`${a}-border`]:e,"top-three":t>3}),children:t}))},Fs=d.forwardRef(Vw),$d=new Intl.NumberFormat("zh-Hans-CN",{currency:"CNY",style:"currency"}),Hw={style:"currency",currency:"USD"},Uw={style:"currency",currency:"RUB"},Yw={style:"currency",currency:"RSD"},Kw={style:"currency",currency:"MYR"},Ww={style:"currency",currency:"BRL"},qw={default:$d,"zh-Hans-CN":{currency:"CNY",style:"currency"},"en-US":Hw,"ru-RU":Uw,"ms-MY":Kw,"sr-RS":Yw,"pt-BR":Ww},fc=(e,t,n,r,a="")=>{let i=t==null?void 0:t.toString().replaceAll(",","");if(typeof i=="string"){const l=Number(i);if(Number.isNaN(l))return i;i=l}if(!i&&i!==0)return"";let o=!1;try{o=e!==!1&&Intl.NumberFormat.supportedLocalesOf([e.replace("_","-")],{localeMatcher:"lookup"}).length>0}catch{}try{const u=new Intl.NumberFormat(o&&e!==!1&&(e==null?void 0:e.replace("_","-"))||"zh-Hans-CN",{...qw[e||"zh-Hans-CN"]||$d,maximumFractionDigits:n,...r}).format(i),g=(h=>{const p=h.match(/\d+/);if(p){const S=p[0];return h.slice(h.indexOf(S))}else return h})(u),[f]=u||"";return["+","-"].includes(f)?`${a||""}${f}${g}`:`${a||""}${g}`}catch{return i}},ei=2,Gw=d.forwardRef(({contentRender:e,numberFormatOptions:t,numberPopoverRender:n,open:r,onOpenChange:a,...i},o)=>{const[l,u]=dt(()=>i.defaultValue,i.value),[m,g]=d.useState(r??!1),f=d.useRef(!0);d.useEffect(()=>(f.current=!0,()=>{f.current=!1}),[]),d.useEffect(()=>{r!==void 0&&g(r)},[r]);const h=d.useCallback(y=>{u(w=>{var x;const T=typeof y=="function"?y(w):y;return(x=i.onChange)==null||x.call(i,T),T})},[i.onChange,u]),p=d.useCallback(y=>{a==null||a(y),r===void 0&&queueMicrotask(()=>{f.current&&g(y)})},[r,a]),S=e==null?void 0:e({...i,value:l});return S?s.jsx(c.Popover,{placement:"topLeft",open:m,onOpenChange:p,trigger:["focus","click"],content:S,getPopupContainer:y=>(y==null?void 0:y.parentElement)||document.body,children:s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:h})}):s.jsx(c.InputNumber,{ref:o,...i,value:l,onChange:h})}),Zw=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,proFieldKey:i,valueEnum:o,placeholder:l,locale:u,customSymbol:m=a.customSymbol,numberFormatOptions:g=a==null?void 0:a.numberFormatOptions,numberPopoverRender:f=(a==null?void 0:a.numberPopoverRender)||!1,...h},p)=>{const S=(a==null?void 0:a.precision)??ei;let y=Ne();u&&zn[u]&&(y=zn[u]);const w=l||y.getMessage("tableForm.inputPlaceholder","请输入"),T=d.useMemo(()=>{if(m)return m;if(!(h.moneySymbol===!1||a.moneySymbol===!1))return y.getMessage("moneySymbol","¥")},[m,a.moneySymbol,y,h.moneySymbol]),x=d.useCallback(C=>{const j=new RegExp(`\\B(?=(\\d{${3+Math.max(S-ei,0)}})+(?!\\d))`,"g"),[b,v]=String(C).split("."),$=b.replace(j,",");let E="";return v&&S>0&&(E=`.${v.slice(0,S===void 0?ei:S)}`),`${$}${E}`},[S]);if(t==="read"){const C=s.jsx("span",{ref:p,children:fc(u||!1,e,S,g??a.numberFormatOptions,T)});return n?n(e,{mode:t,...a},C):C}if(t==="edit"||t==="update"){const C=s.jsx(Gw,{contentRender:j=>{if(f===!1||!j.value)return null;const b=fc(T||u||!1,`${x(j.value)}`,S,{...g,notation:"compact"},T);return typeof f=="function"?f==null?void 0:f(j,b):b},ref:p,precision:S,formatter:j=>j&&T?`${T} ${x(j)}`:(j==null?void 0:j.toString())||j,parser:j=>T&&j?j.replace(new RegExp(`\\${T}\\s?|(,*)`,"g"),""):j,placeholder:w,...Ze(a,["numberFormatOptions","precision","numberPopoverRender","customSymbol","moneySymbol","visible","open"]),onBlur:a.onBlur?j=>{var v;let b=j.target.value;T&&b&&(b=b.replace(new RegExp(`\\${T}\\s?|(,*)`,"g"),"")),(v=a.onBlur)==null||v.call(a,b)}:void 0});return r?r(e,{mode:t,...a},C):C}return null},mc=d.forwardRef(Zw),hc=e=>e.map((t,n)=>{var r;return d.isValidElement(t)?d.cloneElement(t,{key:n,...t==null?void 0:t.props,style:{...(r=t==null?void 0:t.props)==null?void 0:r.style}}):s.jsx(d.Fragment,{children:t},n)}),Jw=({text:e,mode:t,render:n,fieldProps:r},a)=>{const{getPrefixCls:i}=d.useContext(c.ConfigProvider.ConfigContext),o=i("pro-field-option"),{token:l}=jn.useToken();if(d.useImperativeHandle(a,()=>({})),n){const u=n(e,{mode:t,...r},s.jsx(s.Fragment,{}));return!u||(u==null?void 0:u.length)<1||!Array.isArray(u)?null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:hc(u)})}return!e||!Array.isArray(e)?d.isValidElement(e)?e:null:s.jsx("div",{style:{display:"flex",gap:l.margin,alignItems:"center"},className:o,children:hc(e)})},gc=d.forwardRef(Jw),Xw=(e,t)=>{const n=Ne(),{text:r,mode:a,render:i,formItemRender:o,fieldProps:l,...u}=Ze(e,["proFieldKey"]),[m,g]=dt(()=>u.open||!1,u.open),f=d.useCallback(h=>{g(p=>{var y;const S=typeof h=="function"?h(p):h;return(y=u.onOpenChange)==null||y.call(u,S),S})},[u.onOpenChange]);if(a==="read"){let h=s.jsx(s.Fragment,{children:"-"});return r&&(h=s.jsxs(c.Space,{children:[s.jsx("span",{ref:t,children:m?r:"********"}),s.jsx("a",{onClick:()=>f(!m),children:m?s.jsx(de.EyeOutlined,{}):s.jsx(de.EyeInvisibleOutlined,{})})]})),i?i(r,{mode:a,...l},h):h}if(a==="edit"||a==="update"){const h=s.jsx(c.Input.Password,{placeholder:n.getMessage("tableForm.inputPlaceholder","请输入"),ref:t,...l});return o?o(r,{mode:a,...l},h):h}return null},or=d.forwardRef(Xw);function Qw(e){return e===0?null:e>0?"+":"-"}function ej(e){return e===0?"#595959":e>0?"#ff4d4f":"#52c41a"}function tj(e,t=2){return t>=0?e==null?void 0:e.toFixed(t):e}function oa(e){return typeof e=="symbol"||e instanceof Symbol?NaN:Number(e)}const nj=({text:e,prefix:t,precision:n,suffix:r="%",mode:a,showColor:i=!1,render:o,formItemRender:l,fieldProps:u,placeholder:m,showSymbol:g},f)=>{const h=Ne(),p=m||h.getMessage("tableForm.inputPlaceholder","请输入"),S=d.useMemo(()=>typeof e=="string"&&e.includes("%")?oa(e.replace("%","")):oa(e),[e]),y=d.useMemo(()=>typeof g=="function"?g==null?void 0:g(e):g,[g,e]);if(a==="read"){const w=i?{color:ej(S)}:{},T=s.jsxs("span",{style:w,ref:f,children:[t&&s.jsx("span",{children:t}),y&&s.jsxs(d.Fragment,{children:[Qw(S)," "]}),tj(Math.abs(S),n),r&&r]});return o?o(e,{mode:a,...u,prefix:t,precision:n,showSymbol:y,suffix:r},T):T}if(a==="edit"||a==="update"){const w=s.jsx(c.InputNumber,{ref:f,formatter:T=>T&&t?`${t} ${T}`.replace(/\B(?=(\d{3})+(?!\d)$)/g,","):T,parser:T=>T?T.replace(/.*\s|,/g,""):"",placeholder:p,...u});return l?l(e,{mode:a,...u},w):w}return null},pc=d.forwardRef(nj);function rj(e){return e===100?"success":e<0?"exception":e<100?"active":"normal"}const sj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Ne(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入"),m=d.useMemo(()=>typeof e=="string"&&e.includes("%")?oa(e.replace("%","")):oa(e),[e]);if(t==="read"){const g=s.jsx(c.Progress,{ref:o,size:"small",style:{minWidth:100,maxWidth:320},percent:m,steps:a==null?void 0:a.steps,status:rj(m),...a});return n?n(m,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const g=s.jsx(c.InputNumber,{ref:o,placeholder:u,...a});return r?r(e,{mode:t,...a},g):g}return null},yc=d.forwardRef(sj),aj=({radioType:e,formItemRender:t,mode:n,render:r,...a},i)=>{var y,w,T;const{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=o("pro-field-radio"),[u,m,g]=Sr(a),f=d.useRef(),h=(w=(y=c.Form.Item)==null?void 0:y.useStatus)==null?void 0:w.call(y);d.useImperativeHandle(i,()=>({...f.current||{},fetchData:x=>g(x)}),[g]);const{wrapSSR:p,hashId:S}=tt("FieldRadioRadio",x=>({[`.${l}-error`]:{span:{color:x.colorError}},[`.${l}-warning`]:{span:{color:x.colorWarning}},[`.${l}-vertical`]:{[`${x.antCls}-radio-wrapper`]:{display:"flex",marginInlineEnd:0}}}));if(u)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const x=m!=null&&m.length?m==null?void 0:m.reduce((j,b)=>({...j,[b.value??""]:b.label}),{}):void 0,C=s.jsx(s.Fragment,{children:Un(a.text,un(a.valueEnum||x))});return r?r(a.text,{mode:n,...a.fieldProps},C)??null:C}if(n==="edit"){const x=p(s.jsx(c.Radio.Group,{ref:f,optionType:e,...a.fieldProps,className:ie((T=a.fieldProps)==null?void 0:T.className,{[`${l}-error`]:(h==null?void 0:h.status)==="error",[`${l}-warning`]:(h==null?void 0:h.status)==="warning"},S,`${l}-${a.fieldProps.layout||"horizontal"}`),options:m}));return t?t(a.text,{mode:n,...a.fieldProps,options:m,loading:u},x)??null:x}return null},$s=d.forwardRef(aj),ij=({text:e,mode:t,light:n,label:r,format:a="YYYY-MM-DD",render:i,picker:o,formItemRender:l,showTime:u,lightLabel:m,variant:g,fieldProps:f},h)=>{const p=Ne(),[S,y]=Array.isArray(e)?e:[],[w,T]=d.useState(!1),x=d.useCallback(b=>{var v;return typeof(f==null?void 0:f.format)=="function"?(v=f==null?void 0:f.format)==null?void 0:v.call(f,b):(f==null?void 0:f.format)||a||"YYYY-MM-DD"},[f,a]),C=S?Re(S).format(x(Re(S))):"",j=y?Re(y).format(x(Re(y))):"";if(t==="read"){const b=s.jsxs("div",{ref:h,style:{display:"flex",flexWrap:"wrap",gap:8,alignItems:"center"},children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return i?i(e,{mode:t,...f},s.jsx("span",{children:b})):b}if(t==="edit"||t==="update"){const b=xr(f.value);let v;const $=E=>{var R;(R=f==null?void 0:f.onChange)==null||R.call(f,E),E||T(!1)};return n?v=s.jsx(Qt,{label:r,onClick:()=>{var E;(E=f==null?void 0:f.onOpenChange)==null||E.call(f,!0),T(!0)},style:b?{paddingInlineEnd:0}:void 0,disabled:f.disabled,value:b||w?s.jsx(c.DatePicker.RangePicker,{picker:o,showTime:u,format:a,...f,placeholder:f.placeholder??[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],value:b,onOpenChange:E=>{var R;b&&T(E),(R=f==null?void 0:f.onOpenChange)==null||R.call(f,E)},onChange:$}):null,variant:g,allowClear:!1,ref:m,downIcon:b||w?!1:void 0}):v=s.jsx(c.DatePicker.RangePicker,{ref:h,format:a,showTime:u,placeholder:[p.getMessage("tableForm.selectPlaceholder","请选择"),p.getMessage("tableForm.selectPlaceholder","请选择")],...f,value:b}),l?l(e,{mode:t,...f},v):v}return null},kt=d.forwardRef(ij),oj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=s.jsx(c.Rate,{allowHalf:!0,disabled:!0,ref:i,...a,value:e});return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):o}if(t==="edit"||t==="update"){const o=s.jsx(c.Rate,{allowHalf:!0,ref:i,...a});return r?r(e,{mode:t,...a},o):o}return null},xc=d.forwardRef(oj);function lj(e){let t=e,n="",r=!1;t<0&&(t=-t,r=!0);const a=Math.floor(t/(3600*24)),i=Math.floor(t/3600%24),o=Math.floor(t/60%60);return n=`${Math.floor(t%60)}秒`,o>0&&(n=`${o}分钟${n}`),i>0&&(n=`${i}小时${n}`),a>0&&(n=`${a}天${n}`),r&&(n+="前"),n}const cj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,placeholder:i},o)=>{const l=Ne(),u=i||l.getMessage("tableForm.inputPlaceholder","请输入");if(t==="read"){const m=lj(Number(e)),g=s.jsx("span",{ref:o,children:m});return n?n(e,{mode:t,...a},g):g}if(t==="edit"||t==="update"){const m=s.jsx(c.InputNumber,{ref:o,min:0,style:{width:"100%"},placeholder:u,...a});return r?r(e,{mode:t,...a},m):m}return null},bc=d.forwardRef(cj),uj=(e,t)=>{const{mode:n,render:r,formItemRender:a,fieldProps:i,emptyText:o="-",...l}=e,u=d.useRef(),[m,g,f]=Sr(e);if(d.useImperativeHandle(t,()=>({...u.current||{},fetchData:h=>f(h)}),[f]),m)return s.jsx(c.Spin,{size:"small"});if(n==="read"){const h=g!=null&&g.length?g==null?void 0:g.reduce((S,y)=>({...S,[y.value??""]:y.label}),{}):void 0,p=s.jsx(s.Fragment,{children:Un(l.text,un(l.valueEnum||h))});return r?r(l.text,{mode:n,...i},s.jsx(s.Fragment,{children:p}))??o:p}if(n==="edit"||n==="update"){const h=s.jsx(c.Segmented,{ref:u,...Ze(i||{},["allowClear"]),options:g});return a?a(l.text,{mode:n,...i,options:g,loading:m},h):h}return null},Sc=d.forwardRef(uj),dj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a},i)=>{if(t==="read"){const o=e;return n?n(e,{mode:t,...a},s.jsx(s.Fragment,{children:o})):s.jsx(s.Fragment,{children:o})}if(t==="edit"||t==="update"){const o=s.jsx(c.Slider,{ref:i,...a,style:{minWidth:120,...a==null?void 0:a.style}});return r?r(e,{mode:t,...a},o):o}return null},Cc=d.forwardRef(dj),fj=({text:e,mode:t,render:n,light:r,label:a,formItemRender:i,fieldProps:o,variant:l},u)=>{const m=Ne(),g=l??(o==null?void 0:o.variant),f=d.useMemo(()=>e==null||`${e}`.length<1?"-":e?(o==null?void 0:o.checkedChildren)??m.getMessage("switch.open","打开"):(o==null?void 0:o.unCheckedChildren)??m.getMessage("switch.close","关闭"),[o==null?void 0:o.checkedChildren,o==null?void 0:o.unCheckedChildren,e]);if(t==="read")return n?n(e,{mode:t,...o},s.jsx(s.Fragment,{children:f})):f??"-";if(t==="edit"||t==="update"){const h=s.jsx(c.Switch,{ref:u,size:r?"small":void 0,...Ze(o,["value"]),checked:(o==null?void 0:o.checked)??(o==null?void 0:o.value)});if(r){const{disabled:p}=o;return s.jsx(Qt,{label:a,disabled:p,variant:g,downIcon:!1,value:s.jsx("div",{style:{paddingLeft:8},children:h}),allowClear:!1})}return i?i(e,{mode:t,...o},h):h}return null},wc=d.forwardRef(fj),mj=({text:e,mode:t,render:n,formItemRender:r,fieldProps:a,emptyText:i="-"},o)=>{const{autoFocus:l,prefix:u="",suffix:m=""}=a||{},g=Ne(),f=d.useRef();if(d.useImperativeHandle(o,()=>f.current,[]),d.useEffect(()=>{l&&queueMicrotask(()=>{var h;(h=f.current)==null||h.focus()})},[l]),t==="read"){const h=s.jsxs(s.Fragment,{children:[u,e??i,m]});return n?n(e,{mode:t,...a},h)??i:h}if(t==="edit"||t==="update"){const h=g.getMessage("tableForm.inputPlaceholder","请输入"),p=s.jsx(c.Input,{ref:f,placeholder:h,allowClear:!0,...a});return r?r(e,{mode:t,...a},p):p}return null},Vi=d.forwardRef(mj),hj=({text:e,fieldProps:t},n)=>{const{getPrefixCls:r}=d.useContext(c.ConfigProvider.ConfigContext),a=r("pro-field-readonly"),i=`${a}-textarea`,{wrapSSR:o,hashId:l}=tt("TextArea",()=>({[`.${i}`]:{display:"inline-block",lineHeight:"1.5715",maxWidth:"100%",whiteSpace:"pre-wrap"}}));return o(s.jsx("span",{ref:n,className:ie(l,a,i),...Ze(t,["autoSize","classNames","styles"]),children:e??"-"}))},gj=d.forwardRef(hj),pj=(e,t)=>{const{text:n,mode:r,render:a,formItemRender:i,fieldProps:o}=e,l=Ne();if(r==="read"){const u=s.jsx(gj,{...e,ref:t});return a?a(n,{mode:r,...Ze(o,["showCount"])},u):u}if(r==="edit"||r==="update"){const u=s.jsx(c.Input.TextArea,{ref:t,rows:3,onKeyDown:m=>{m.key==="Enter"&&m.stopPropagation()},placeholder:l.getMessage("tableForm.inputPlaceholder","请输入"),...o});return i?i(n,{mode:r,...o},u):u}return null},jc=d.forwardRef(pj),yj=({text:e,mode:t,light:n,label:r,format:a="HH:mm:ss",render:i,formItemRender:o,fieldProps:l,lightLabel:u,variant:m},g)=>{const[f,h]=d.useState(!1),p=Ne(),S=(l==null?void 0:l.format)||a,y=Re.isDayjs(e)||typeof e=="number";if(t==="read"){const w=s.jsx("span",{ref:g,children:e?Re(e,y?void 0:S).format(S):"-"});return i?i(e,{mode:t,...l},s.jsx("span",{children:w})):w}if(t==="edit"||t==="update"){let w;const{disabled:T,value:x}=l,C=xr(x,S);return n?w=s.jsx(Qt,{onClick:()=>{var j;(j=l==null?void 0:l.onOpenChange)==null||j.call(l,!0),h(!0)},style:C?{paddingInlineEnd:0}:void 0,label:r,disabled:T,variant:m??(l==null?void 0:l.variant),value:C||f?s.jsx(c.TimePicker,{variant:m??(l==null?void 0:l.variant),format:a,ref:g,...l,placeholder:l.placeholder??p.getMessage("tableForm.selectPlaceholder","请选择"),value:C,onOpenChange:j=>{var b;h(j),(b=l==null?void 0:l.onOpenChange)==null||b.call(l,j)},open:f}):null,downIcon:C||f?!1:void 0,allowClear:!1,ref:u}):w=s.jsx(c.DatePicker.TimePicker,{ref:g,format:a,...l,value:C}),o?o(e,{mode:t,...l},w):w}return null},xj=({text:e,light:t,label:n,mode:r,lightLabel:a,format:i="HH:mm:ss",render:o,formItemRender:l,fieldProps:u,variant:m},g)=>{const f=Ne(),[h,p]=d.useState(!1),S=(u==null?void 0:u.format)||i,[y,w]=Array.isArray(e)?e:[],T=Re.isDayjs(y)||typeof y=="number",x=Re.isDayjs(w)||typeof w=="number",C=y?Re(y,T?void 0:S).format(S):"",j=w?Re(w,x?void 0:S).format(S):"";if(r==="read"){const b=s.jsxs("div",{ref:g,children:[s.jsx("div",{children:C||"-"}),s.jsx("div",{children:j||"-"})]});return o?o(e,{mode:r,...u},s.jsx("span",{children:b})):b}if(r==="edit"||r==="update"){const b=xr(u.value,S);let v;if(t){const{disabled:$,placeholder:E=[f.getMessage("tableForm.selectPlaceholder","请选择"),f.getMessage("tableForm.selectPlaceholder","请选择")]}=u;v=s.jsx(Qt,{onClick:()=>{var R;(R=u==null?void 0:u.onOpenChange)==null||R.call(u,!0),p(!0)},style:b?{paddingInlineEnd:0}:void 0,label:n,disabled:$,variant:m,placeholder:E,value:b||h?s.jsx(c.TimePicker.RangePicker,{variant:m??(u==null?void 0:u.variant),format:i,ref:g,...u,placeholder:E,value:b,onOpenChange:R=>{var D;p(R),(D=u==null?void 0:u.onOpenChange)==null||D.call(u,R)},open:h}):null,downIcon:b||h?!1:void 0,allowClear:!1,ref:a})}else v=s.jsx(c.TimePicker.RangePicker,{ref:g,format:i,variant:m,...u,value:b});return l?l(e,{mode:r,...u},v):v}return null},vc=d.forwardRef(xj),Tc=d.forwardRef(yj),bj=({formItemRender:e,mode:t,light:n,label:r,render:a,variant:i,...o},l)=>{var G,_;const{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),m=u("pro-field-tree-select"),g=d.useRef(null),[f,h]=d.useState(!1),{onClear:p,onChange:S,onBlur:y,showSearch:w,fetchDataOnSearch:T,onSearch:x,autoClearSearchValue:C,searchValue:j,...b}=Ze(o.fieldProps,["treeData"]),v=typeof w=="object"?w:{},$=(v==null?void 0:v.onSearch)!==void 0?v.onSearch:x,E=(v==null?void 0:v.autoClearSearchValue)!==void 0?v.autoClearSearchValue:C,R=(v==null?void 0:v.searchValue)!==void 0?v.searchValue:j,D=i??(b==null?void 0:b.variant),M=Ne(),[U,Y,O]=Sr({...o,defaultKeyWords:R}),[I,F]=dt(void 0,R),A=d.useCallback(H=>{F(Z=>{const q=typeof H=="function"?H(Z):H;return $==null||$(q),q})},[$]);d.useImperativeHandle(l,()=>({...g.current||{},fetchData:H=>O(H)}));const k=d.useMemo(()=>{if(t!=="read")return;const{value:H="value",label:Z="label",children:q="children"}=(b==null?void 0:b.fieldNames)||{},V=new Map,L=K=>{if(!(K!=null&&K.length))return V;const P=K.length;let W=0;for(;W<P;){const te=K[W++];V.set(te[H],te[Z]),L(te[q])}return V};return L(Y)},[b==null?void 0:b.fieldNames,t,Y]),B=(H,Z,q)=>{w&&E&&(O(void 0),A(void 0)),S==null||S(H,Z,q)};if(t==="read"){const H=s.jsx(s.Fragment,{children:Un(o.text,un(o.valueEnum||k))});return a?a(o.text,{mode:t,...b,treeData:Y},H)??null:H}if(t==="edit"){const H=Array.isArray(b==null?void 0:b.value)?(G=b==null?void 0:b.value)==null?void 0:G.length:0;let Z=s.jsx(c.Spin,{spinning:U,children:s.jsx(c.TreeSelect,{open:f,onOpenChange:q=>{var V;(V=b==null?void 0:b.onOpenChange)==null||V.call(b,q),h(q)},ref:g,popupMatchSelectWidth:!n,placeholder:M.getMessage("tableForm.selectPlaceholder","请选择"),tagRender:n?q=>{var L;if(H<2)return s.jsx(s.Fragment,{children:q.label});const V=(L=b==null?void 0:b.value)==null?void 0:L.findIndex(K=>K===q.value||K.value===q.value);return s.jsxs(s.Fragment,{children:[q.label," ",V<H-1?",":""]})}:void 0,...b,treeData:Y,showSearch:w&&{...v,searchValue:I,autoClearSearchValue:E,onSearch:q=>{T&&(o!=null&&o.request)&&O(q),A(q)}},style:{minWidth:60,...b.style},allowClear:b.allowClear!==!1,onClear:()=>{p==null||p(),O(void 0),w&&A(void 0)},onChange:B,onBlur:q=>{A(void 0),O(void 0),y==null||y(q)},className:ie(b==null?void 0:b.className,m)})});if(e&&(Z=e(o.text,{mode:t,...b,options:Y,loading:U},Z)??null),n){const{disabled:q,placeholder:V}=b,L=!!b.value&&((_=b.value)==null?void 0:_.length)!==0;return s.jsx(Qt,{label:r,disabled:q,placeholder:V,onClick:()=>{var K;h(!0),(K=b==null?void 0:b.onOpenChange)==null||K.call(b,!0)},variant:D,value:L||f?Z:null,style:L?{paddingInlineEnd:0}:void 0,allowClear:!1,downIcon:!1})}return Z}return null},Fc=d.forwardRef(bj);function Ue(e){const[t,n]=d.useState(!1),r=d.useRef(null),a=d.useCallback(l=>{var g,f,h,p,S,y;const u=(h=(f=(g=r.current)==null?void 0:g.labelRef)==null?void 0:f.current)==null?void 0:h.contains(l.target),m=(y=(S=(p=r.current)==null?void 0:p.clearRef)==null?void 0:S.current)==null?void 0:y.contains(l.target);return u&&!m},[r]),i=l=>{a(l)&&n(!0)},o=()=>{n(!1)};return e.isLight?s.jsx("div",{onMouseDown:i,onMouseUp:o,children:d.cloneElement(e.children,{labelTrigger:t,lightLabel:r})}):s.jsx(s.Fragment,{children:e.children})}Re.extend(vd);Re.extend(wd);Re.extend(jd);Re.extend(vo);Re.extend(Td);const Ed=(e,t,n,r)=>{var l,u,m,g;const{mode:a="read",emptyText:i="-"}=n;if(i!==!1&&a==="read"&&t!=="option"&&t!=="switch"&&typeof e!="boolean"&&typeof e!="number"&&!e){const{fieldProps:f,render:h}=n;return h?h(e,{mode:a,...f},s.jsx(s.Fragment,{children:i})):s.jsx(s.Fragment,{children:i})}if(delete n.emptyText,typeof t=="object")return Ed(e,t.type,{...t,...n},r);const o=r&&r[t];if(o){if(delete n.ref,a==="read"){const f=(l=o.render)==null?void 0:l.call(o,e,{text:e,...n,mode:a||"read"},s.jsx(s.Fragment,{children:e}));return n!=null&&n.render?(u=n.render)==null?void 0:u.call(n,e,{text:e,...n},f):f}if(a==="update"||a==="edit"){const f=(m=o.formItemRender)==null?void 0:m.call(o,e,{text:e,...n},s.jsx(s.Fragment,{children:e}));return n!=null&&n.formItemRender?(g=n.formItemRender)==null?void 0:g.call(n,e,{text:e,...n},f):f}}return s.jsx(Vi,{text:e,...n})},Sj=({text:e,valueType:t="text",mode:n="read",onChange:r,formItemRender:a,value:i,readonly:o,fieldProps:l,...u},m)=>{const g=d.useContext(Zt),f=je((...S)=>{var y;(y=l==null?void 0:l.onChange)==null||y.call(l,...S),r==null||r(...S)}),h=St(()=>(i!==void 0||l)&&{value:i,...xt(l),onChange:f},[i,l,f]),p=Ed(n==="edit"?(h==null?void 0:h.value)??e??"":e??(h==null?void 0:h.value)??"",t||"text",xt({ref:m,...u,mode:o?"read":n,formItemRender:a?(S,y,w)=>{const{placeholder:T,...x}=y,C=a(S,x,w);return d.isValidElement(C)?d.cloneElement(C,{...h,...C.props||{}}):C}:void 0,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(h==null?void 0:h.placeholder),fieldProps:zt(xt({...h,placeholder:a?void 0:(u==null?void 0:u.placeholder)??(h==null?void 0:h.placeholder)}))}),g.valueTypeMap||{});return s.jsx(d.Fragment,{children:p})},Cj=d.forwardRef(Sj);Re.extend(vd);Re.extend(wd);Re.extend(jd);Re.extend(vo);Re.extend(Td);const Rd={progress:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(yc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(yc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},money:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(mc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(mc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},percent:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(pc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(pc,{mode:t.mode,text:e,placeholder:r,fieldProps:n})}},image:{render:(e,t)=>s.jsx(dc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(dc,{...t,text:e})},date:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD",...t,text:e})})},dateWeek:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-wo",picker:"week",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-wo",picker:"week",...t,text:e})})},dateWeekRange:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-W",showTime:!0,fieldProps:{picker:"week",...t.fieldProps},...t,text:e})})},dateMonthRange:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM",showTime:!0,fieldProps:{picker:"month",...t.fieldProps},...t,text:e})})},dateQuarterRange:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-Q",showTime:!0,fieldProps:{picker:"quarter",...t.fieldProps},...t,text:e})})},dateYearRange:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY",showTime:!0,fieldProps:{picker:"year",...t.fieldProps},...t,text:e})})},dateMonth:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM",picker:"month",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM",picker:"month",...t,text:e})})},dateQuarter:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-[Q]Q",picker:"quarter",...t,text:e})})},dateYear:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY",picker:"year",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY",picker:"year",...t,text:e})})},dateRange:{render:(e,t)=>s.jsx(kt,{format:"YYYY-MM-DD",...t,text:e}),formItemRender:(e,t)=>s.jsx(kt,{format:"YYYY-MM-DD",...t,text:e})},dateTime:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(At,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},dateTimeRange:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(kt,{format:"YYYY-MM-DD HH:mm:ss",showTime:!0,...t,text:e})})},time:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(Tc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(Tc,{format:"HH:mm:ss",...t,text:e})})},timeRange:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(vc,{format:"HH:mm:ss",...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(vc,{format:"HH:mm:ss",...t,text:e})})},fromNow:{render:(e,t)=>s.jsx(uc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(uc,{...t,text:e})},index:{render:e=>s.jsx(Fs,{children:e+1}),formItemRender:e=>s.jsx(Fs,{children:e+1})},indexBorder:{render:e=>s.jsx(Fs,{border:!0,children:e+1}),formItemRender:e=>s.jsx(Fs,{border:!0,children:e+1})},avatar:{render:e=>s.jsx(c.Avatar,{src:e,size:22,shape:"circle"}),formItemRender:e=>s.jsx(c.Avatar,{src:e,size:22,shape:"circle"})},code:{render:(e,t)=>s.jsx(Ts,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Ts,{...t,text:e})},jsonCode:{render:(e,t)=>s.jsx(Ts,{language:"json",...t,text:e}),formItemRender:(e,t)=>s.jsx(Ts,{language:"json",...t,text:e})},textarea:{render:(e,t)=>s.jsx(jc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(jc,{...t,text:e})},digit:{render:(e,t)=>{const n=zt(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(ia,{text:a,placeholder:r,mode:t.mode,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=Array.isArray(t.placeholder)?t.placeholder[0]:typeof t.placeholder=="string"?t.placeholder:void 0,a=typeof e=="number"?e:Number(e)||0;return s.jsx(ia,{text:a,placeholder:r,mode:t.mode,fieldProps:n})}},digitRange:{render:(e,t)=>s.jsx(lc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(lc,{...t,text:e})},second:{render:(e,t)=>s.jsx(bc,{...t,text:e,placeholder:t.placeholder}),formItemRender:(e,t)=>s.jsx(bc,{...t,text:e,placeholder:t.placeholder})},select:{render:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(vs,{...t,text:e})}),formItemRender:(e,t)=>s.jsx(Ue,{isLight:t.light,children:s.jsx(vs,{...t,text:e})})},text:{render:(e,t)=>"valueEnum"in t?s.jsx(Ue,{isLight:t.light,children:s.jsx(vs,{...t,text:e})}):s.jsx(Vi,{...t,text:e}),formItemRender:(e,t)=>"valueEnum"in t?s.jsx(Ue,{isLight:t.light,children:s.jsx(vs,{...t,text:e})}):s.jsx(Vi,{...t,text:e})},checkbox:{render:(e,t)=>s.jsx(ic,{...t,text:e}),formItemRender:(e,t)=>s.jsx(ic,{...t,text:e})},radio:{render:(e,t)=>s.jsx($s,{...t,text:e}),formItemRender:(e,t)=>s.jsx($s,{...t,text:e})},radioButton:{render:(e,t)=>s.jsx($s,{radioType:"button",...t,text:e}),formItemRender:(e,t)=>s.jsx($s,{radioType:"button",...t,text:e})},rate:{render:(e,t)=>s.jsx(xc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(xc,{...t,text:e})},slider:{render:(e,t)=>s.jsx(Cc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Cc,{...t,text:e})},switch:{render:(e,t)=>s.jsx(wc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(wc,{...t,text:e})},option:{render:(e,t)=>s.jsx(gc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(gc,{...t,text:e})},password:{render:(e,t)=>s.jsx(or,{...t,text:e}),formItemRender:(e,t)=>s.jsx(or,{...t,text:e})},cascader:{render:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})},formItemRender:(e,t)=>{const n=zt(t.fieldProps),r=typeof t.placeholder=="string"?t.placeholder:void 0;return s.jsx(ac,{...t,mode:t.mode,text:e,placeholder:r,fieldProps:n})}},treeSelect:{render:(e,t)=>s.jsx(Fc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Fc,{...t,text:e})},color:{render:(e,t)=>s.jsx(oc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(oc,{...t,text:e})},segmented:{render:(e,t)=>s.jsx(Sc,{...t,text:e}),formItemRender:(e,t)=>s.jsx(Sc,{...t,text:e})}},To=d.createContext({grid:!1,colProps:void 0,rowProps:void 0}),wj=({grid:e,rowProps:t,colProps:n})=>({grid:!!e,RowWrapper({children:r,Wrapper:a,...i}={}){return e?s.jsx(c.Row,{gutter:8,...t,...i,children:r}):a?s.jsx(a,{children:r}):r},ColWrapper({children:r,Wrapper:a,variant:i,fieldProps:o,...l}={}){var g;const u=d.useMemo(()=>{const f={...n,...l};return typeof f.span>"u"&&typeof f.xs>"u"&&(f.xs=24),f},[l]),m=(i!==void 0||o!==void 0)&&d.Children.count(r)===1&&d.isValidElement(r)?d.cloneElement(r,{...i!==void 0&&{variant:i},...o&&{fieldProps:{...(g=r==null?void 0:r.props)==null?void 0:g.fieldProps,...o}}}):r;return e?s.jsx(c.Col,{...u,children:m}):a?s.jsx(a,{children:m}):m}}),Cr=e=>{const t=d.useMemo(()=>typeof e=="object"?e:{grid:e},[e]),{grid:n,colProps:r}=d.useContext(To);return d.useMemo(()=>wj({grid:!!(n||t.grid),rowProps:t==null?void 0:t.rowProps,colProps:(t==null?void 0:t.colProps)||r,Wrapper:t==null?void 0:t.Wrapper}),[t==null?void 0:t.Wrapper,t.grid,n,JSON.stringify([r,t==null?void 0:t.colProps,t==null?void 0:t.rowProps])])},Pn="RC_FORM_INTERNAL_HOOKS",Ge=()=>{st(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Hn=be.createContext({getFieldValue:Ge,getFieldsValue:Ge,getFieldError:Ge,getFieldWarning:Ge,getFieldsError:Ge,isFieldsTouched:Ge,isFieldTouched:Ge,isFieldValidating:Ge,isFieldsValidating:Ge,resetFields:Ge,setFields:Ge,setFieldValue:Ge,setFieldsValue:Ge,validateFields:Ge,submit:Ge,getInternalHooks:()=>(Ge(),{dispatch:Ge,initEntityValue:Ge,registerField:Ge,useSubscribe:Ge,setInitialValues:Ge,destroyForm:Ge,setCallbacks:Ge,registerWatch:Ge,getFields:Ge,setValidateMessages:Ge,setPreserve:Ge,getInitialValue:Ge})}),la=be.createContext(null);function Hi(e){return e==null?[]:Array.isArray(e)?e:[e]}function jj(e){return e&&!!e._init}function Ui(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",tel:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone(){const e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}const ti=Ui(),vj=/%[sdj%]/g;let Id=()=>{};typeof process<"u"&&process.env&&process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof document<"u"&&(Id=(e,t)=>{typeof console<"u"&&console.warn&&typeof ASYNC_VALIDATOR_NO_WARNING>"u"&&t.every(n=>typeof n=="string")&&console.warn(e,t)});function Yi(e){if(!e||!e.length)return null;const t={};return e.forEach(n=>{const r=n.field;t[r]=t[r]||[],t[r].push(n)}),t}function Mt(e,...t){let n=0;const r=t.length;return typeof e=="function"?e.apply(null,t):typeof e=="string"?e.replace(vj,i=>{if(i==="%%")return"%";if(n>=r)return i;switch(i){case"%s":return String(t[n++]);case"%d":return Number(t[n++]);case"%j":try{return JSON.stringify(t[n++])}catch{return"[Circular]"}break;default:return i}}):e}function Tj(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"||e==="tel"}function pt(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Tj(t)&&typeof e=="string"&&!e)}function Fj(e,t,n){const r=[];let a=0;const i=e.length;function o(l){r.push(...l||[]),a++,a===i&&n(r)}e.forEach(l=>{t(l,o)})}function $c(e,t,n){let r=0;const a=e.length;function i(o){if(o&&o.length){n(o);return}const l=r;r=r+1,l<a?t(e[l],i):n([])}i([])}function $j(e){const t=[];return Object.keys(e).forEach(n=>{t.push(...e[n]||[])}),t}class Ec extends Error{constructor(n,r){super("Async Validation Error");oe(this,"errors");oe(this,"fields");this.errors=n,this.fields=r}}function Ej(e,t,n,r,a){if(t.first){const f=new Promise((h,p)=>{const S=w=>(r(w),w.length?p(new Ec(w,Yi(w))):h(a)),y=$j(e);$c(y,n,S)});return f.catch(h=>h),f}const i=t.firstFields===!0?Object.keys(e):t.firstFields||[],o=Object.keys(e),l=o.length;let u=0;const m=[],g=new Promise((f,h)=>{const p=S=>{if(m.push.apply(m,S),u++,u===l)return r(m),m.length?h(new Ec(m,Yi(m))):f(a)};o.length||(r(m),f(a)),o.forEach(S=>{const y=e[S];i.indexOf(S)!==-1?$c(y,n,p):Fj(y,n,p)})});return g.catch(f=>f),g}function Rj(e){return!!(e&&e.message!==void 0)}function Ij(e,t){let n=e;for(let r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function Rc(e,t){return n=>{let r;return e.fullFields?r=Ij(t,e.fullFields):r=t[n.field||e.fullField],Rj(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n=="function"?n():n,fieldValue:r,field:n.field||e.fullField}}}function Ic(e,t){if(t){for(const n in t)if(t.hasOwnProperty(n)){const r=t[n];typeof r=="object"&&typeof e[n]=="object"?e[n]={...e[n],...r}:e[n]=r}}return e}const tr="enum",Mj=(e,t,n,r,a)=>{e[tr]=Array.isArray(e[tr])?e[tr]:[],e[tr].indexOf(t)===-1&&r.push(Mt(a.messages[tr],e.fullField,e[tr].join(", ")))},Aj=(e,t,n,r,a)=>{e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Mt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern=="string"&&(new RegExp(e.pattern).test(t)||r.push(Mt(a.messages.pattern.mismatch,e.fullField,t,e.pattern))))},kj=(e,t,n,r,a)=>{const i=typeof e.len=="number",o=typeof e.min=="number",l=typeof e.max=="number",u=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;let m=t,g=null;const f=typeof t=="number",h=typeof t=="string",p=Array.isArray(t);if(f?g="number":h?g="string":p&&(g="array"),!g)return!1;p&&(m=t.length),h&&(m=t.replace(u,"_").length),i?m!==e.len&&r.push(Mt(a.messages[g].len,e.fullField,e.len)):o&&!l&&m<e.min?r.push(Mt(a.messages[g].min,e.fullField,e.min)):l&&!o&&m>e.max?r.push(Mt(a.messages[g].max,e.fullField,e.max)):o&&l&&(m<e.min||m>e.max)&&r.push(Mt(a.messages[g].range,e.fullField,e.min,e.max))},Md=(e,t,n,r,a,i)=>{e.required&&(!n.hasOwnProperty(e.field)||pt(t,i||e.type))&&r.push(Mt(a.messages.required,e.fullField))};let Es;const Oj=(()=>{if(Es)return Es;const e="[a-fA-F\\d:]",t=b=>b&&b.includeBoundaries?`(?:(?<=\\s|^)(?=${e})|(?<=${e})(?=\\s|$))`:"",n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=`(?:${[`(?:${r}:){7}(?:${r}|:)`,`(?:${r}:){6}(?:${n}|:${r}|:)`,`(?:${r}:){5}(?::${n}|(?::${r}){1,2}|:)`,`(?:${r}:){4}(?:(?::${r}){0,1}:${n}|(?::${r}){1,3}|:)`,`(?:${r}:){3}(?:(?::${r}){0,2}:${n}|(?::${r}){1,4}|:)`,`(?:${r}:){2}(?:(?::${r}){0,3}:${n}|(?::${r}){1,5}|:)`,`(?:${r}:){1}(?:(?::${r}){0,4}:${n}|(?::${r}){1,6}|:)`,`(?::(?:(?::${r}){0,5}:${n}|(?::${r}){1,7}|:))`].join("|")})(?:%[0-9a-zA-Z]{1,})?`,l=new RegExp(`(?:^${n}$)|(?:^${o}$)`),u=new RegExp(`^${n}$`),m=new RegExp(`^${o}$`),g=b=>b&&b.exact?l:new RegExp(`(?:${t(b)}${n}${t(b)})|(?:${t(b)}${o}${t(b)})`,"g");g.v4=b=>b&&b.exact?u:new RegExp(`${t(b)}${n}${t(b)}`,"g"),g.v6=b=>b&&b.exact?m:new RegExp(`${t(b)}${o}${t(b)}`,"g");const f="(?:(?:[a-z]+:)?//)",h="(?:\\S+(?::\\S*)?@)?",p=g.v4().source,S=g.v6().source,j=`(?:${f}|www\\.)${h}(?:localhost|${p}|${S}|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?`;return Es=new RegExp(`(?:^${j}$)`,"i"),Es}),ni={email:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,tel:/^(\+[0-9]{1,3}[-\s\u2011]?)?(\([0-9]{1,4}\)[-\s\u2011]?)?([0-9]+[-\s\u2011]?)*[0-9]+$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Nr={integer(e){return Nr.number(e)&&parseInt(e,10)===e},float(e){return Nr.number(e)&&!Nr.integer(e)},array(e){return Array.isArray(e)},regexp(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date(e){return typeof e.getTime=="function"&&typeof e.getMonth=="function"&&typeof e.getYear=="function"&&!isNaN(e.getTime())},number(e){return isNaN(e)?!1:typeof e=="number"},object(e){return typeof e=="object"&&!Nr.array(e)},method(e){return typeof e=="function"},email(e){return typeof e=="string"&&e.length<=320&&!!e.match(ni.email)},tel(e){return typeof e=="string"&&e.length<=32&&!!e.match(ni.tel)},url(e){return typeof e=="string"&&e.length<=2048&&!!e.match(Oj())},hex(e){return typeof e=="string"&&!!e.match(ni.hex)}},Dj=(e,t,n,r,a)=>{if(e.required&&t===void 0){Md(e,t,n,r,a);return}const i=["integer","float","array","regexp","object","method","email","tel","number","date","url","hex"],o=e.type;i.indexOf(o)>-1?Nr[o](t)||r.push(Mt(a.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(Mt(a.messages.types[o],e.fullField,e.type))},Pj=(e,t,n,r,a)=>{(/^\s+$/.test(t)||t==="")&&r.push(Mt(a.messages.whitespace,e.fullField))},_e={required:Md,whitespace:Pj,type:Dj,range:kj,enum:Mj,pattern:Aj},Nj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a)}n(i)},Lj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();_e.required(e,t,r,i,a,"array"),t!=null&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},_j=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e.type(e,t,r,i,a)}n(i)},zj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,"date")&&!e.required)return n();if(_e.required(e,t,r,i,a),!pt(t,"date")){let l;t instanceof Date?l=t:l=new Date(t),_e.type(e,l,r,i,a),l&&_e.range(e,l.getTime(),r,i,a)}}n(i)},Bj="enum",Vj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e[Bj](e,t,r,i,a)}n(i)},Hj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},Uj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},Yj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e.type(e,t,r,i,a)}n(i)},Kj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===""&&(t=void 0),pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a))}n(i)},Wj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),t!==void 0&&_e.type(e,t,r,i,a)}n(i)},qj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,"string")&&!e.required)return n();_e.required(e,t,r,i,a),pt(t,"string")||_e.pattern(e,t,r,i,a)}n(i)},Gj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t)&&!e.required)return n();_e.required(e,t,r,i,a),pt(t)||_e.type(e,t,r,i,a)}n(i)},Zj=(e,t,n,r,a)=>{const i=[],o=Array.isArray(t)?"array":typeof t;_e.required(e,t,r,i,a,o),n(i)},Jj=(e,t,n,r,a)=>{const i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,"string")&&!e.required)return n();_e.required(e,t,r,i,a,"string"),pt(t,"string")||(_e.type(e,t,r,i,a),_e.range(e,t,r,i,a),_e.pattern(e,t,r,i,a),e.whitespace===!0&&_e.whitespace(e,t,r,i,a))}n(i)},Rs=(e,t,n,r,a)=>{const i=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(pt(t,i)&&!e.required)return n();_e.required(e,t,r,o,a,i),pt(t,i)||_e.type(e,t,r,o,a)}n(o)},Mr={string:Jj,method:Yj,number:Kj,boolean:_j,regexp:Gj,integer:Uj,float:Hj,array:Lj,object:Wj,enum:Vj,pattern:qj,date:zj,url:Rs,hex:Rs,email:Rs,tel:Rs,required:Zj,any:Nj},xn=class xn{constructor(t){oe(this,"rules",null);oe(this,"_messages",ti);this.define(t)}define(t){if(!t)throw new Error("Cannot configure a schema with no rules");if(typeof t!="object"||Array.isArray(t))throw new Error("Rules must be an object");this.rules={},Object.keys(t).forEach(n=>{const r=t[n];this.rules[n]=Array.isArray(r)?r:[r]})}messages(t){return t&&(this._messages=Ic(Ui(),t)),this._messages}validate(t,n={},r=()=>{}){let a=t,i=n,o=r;if(typeof i=="function"&&(o=i,i={}),!this.rules||Object.keys(this.rules).length===0)return o&&o(null,a),Promise.resolve(a);function l(f){let h=[],p={};function S(y){Array.isArray(y)?h=h.concat(...y):h.push(y)}for(let y=0;y<f.length;y++)S(f[y]);h.length?(p=Yi(h),o(h,p)):o(null,a)}if(i.messages){let f=this.messages();f===ti&&(f=Ui()),Ic(f,i.messages),i.messages=f}else i.messages=this.messages();const u={};(i.keys||Object.keys(this.rules)).forEach(f=>{const h=this.rules[f];let p=a[f];h.forEach(S=>{let y=S;typeof y.transform=="function"&&(a===t&&(a={...a}),p=a[f]=y.transform(p),p!=null&&(y.type=y.type||(Array.isArray(p)?"array":typeof p))),typeof y=="function"?y={validator:y}:y={...y},y.validator=this.getValidationMethod(y),y.validator&&(y.field=f,y.fullField=y.fullField||f,y.type=this.getType(y),u[f]=u[f]||[],u[f].push({rule:y,value:p,source:a,field:f}))})});const g={};return Ej(u,i,(f,h)=>{var x;const p=f.rule;let S=(p.type==="object"||p.type==="array")&&(typeof p.fields=="object"||typeof p.defaultField=="object");S=S&&(p.required||!p.required&&f.value),p.field=f.field;function y(C,j){return{...j,fullField:`${p.fullField}.${C}`,fullFields:p.fullFields?[...p.fullFields,C]:[C]}}function w(C=[]){let j=Array.isArray(C)?C:[C];!i.suppressWarning&&j.length&&xn.warning("async-validator:",j),j.length&&p.message!==void 0&&p.message!==null&&(j=[].concat(p.message));let b=j.map(Rc(p,a));if(i.first&&b.length)return g[p.field]=1,h(b);if(!S)h(b);else{if(p.required&&!f.value)return p.message!==void 0?b=[].concat(p.message).map(Rc(p,a)):i.error&&(b=[i.error(p,Mt(i.messages.required,p.field))]),h(b);let v={};p.defaultField&&Object.keys(f.value).map(R=>{v[R]=p.defaultField}),v={...v,...f.rule.fields};const $={};Object.keys(v).forEach(R=>{const D=v[R],M=Array.isArray(D)?D:[D];$[R]=M.map(y.bind(null,R))});const E=new xn($);E.messages(i.messages),f.rule.options&&(f.rule.options.messages=i.messages,f.rule.options.error=i.error),E.validate(f.value,f.rule.options||i,R=>{const D=[];b&&b.length&&D.push(...b),R&&R.length&&D.push(...R),h(D.length?D:null)})}}let T;if(p.asyncValidator)T=p.asyncValidator(p,f.value,w,f.source,i);else if(p.validator){try{T=p.validator(p,f.value,w,f.source,i)}catch(C){(x=console.error)==null||x.call(console,C),i.suppressValidatorError||setTimeout(()=>{throw C},0),w(C.message)}T===!0?w():T===!1?w(typeof p.message=="function"?p.message(p.fullField||p.field):p.message||`${p.fullField||p.field} fails`):T instanceof Array?w(T):T instanceof Error&&w(T.message)}T&&T.then&&T.then(()=>w(),C=>w(C))},f=>{l(f)},a)}getType(t){if(t.type===void 0&&t.pattern instanceof RegExp&&(t.type="pattern"),typeof t.validator!="function"&&t.type&&!Mr.hasOwnProperty(t.type))throw new Error(Mt("Unknown rule type %s",t.type));return t.type||"string"}getValidationMethod(t){if(typeof t.validator=="function")return t.validator;const n=Object.keys(t),r=n.indexOf("message");return r!==-1&&n.splice(r,1),n.length===1&&n[0]==="required"?Mr.required:Mr[this.getType(t)]||void 0}};oe(xn,"register",function(n,r){if(typeof r!="function")throw new Error("Cannot register a validator by type, validator is not a function");Mr[n]=r}),oe(xn,"warning",Id),oe(xn,"messages",ti),oe(xn,"validators",Mr);let Ki=xn;const wt="'${name}' is not a valid ${type}",Ad={default:"Validation error on field '${name}'",required:"'${name}' is required",enum:"'${name}' must be one of [${enum}]",whitespace:"'${name}' cannot be empty",date:{format:"'${name}' is invalid for format date",parse:"'${name}' could not be parsed as date",invalid:"'${name}' is invalid date"},types:{string:wt,method:wt,array:wt,object:wt,number:wt,date:wt,boolean:wt,integer:wt,float:wt,regexp:wt,email:wt,tel:wt,url:wt,hex:wt},string:{len:"'${name}' must be exactly ${len} characters",min:"'${name}' must be at least ${min} characters",max:"'${name}' cannot be longer than ${max} characters",range:"'${name}' must be between ${min} and ${max} characters"},number:{len:"'${name}' must equal ${len}",min:"'${name}' cannot be less than ${min}",max:"'${name}' cannot be greater than ${max}",range:"'${name}' must be between ${min} and ${max}"},array:{len:"'${name}' must be exactly ${len} in length",min:"'${name}' cannot be less than ${min} in length",max:"'${name}' cannot be greater than ${max} in length",range:"'${name}' must be between ${min} and ${max} in length"},pattern:{mismatch:"'${name}' does not match pattern ${pattern}"}},Mc=Ki;function Xj(e,t){return e.replace(/\\?\$\{\w+\}/g,n=>{if(n.startsWith("\\"))return n.slice(1);const r=n.slice(2,-1);return t[r]})}const Ac="CODE_LOGIC_ERROR";async function Wi(e,t,n,r,a){const i={...n};if(delete i.ruleIndex,Mc.warning=()=>{},i.validator){const h=i.validator;i.validator=(...p)=>{try{return h(...p)}catch(S){return console.error(S),Promise.reject(Ac)}}}let o=null;i&&i.type==="array"&&i.defaultField&&(o=i.defaultField,delete i.defaultField);const l=new Mc({[e]:[i]}),u=ar(Ad,r.validateMessages);l.messages(u);let m=[];try{await Promise.resolve(l.validate({[e]:t},{...r}))}catch(h){h.errors&&(m=h.errors.map(({message:p},S)=>{const y=p===Ac?u.default:p;return be.isValidElement(y)?be.cloneElement(y,{key:`error_${S}`}):y}))}if(!m.length&&o&&Array.isArray(t)&&t.length>0)return(await Promise.all(t.map((p,S)=>Wi(`${e}.${S}`,p,o,r,a)))).reduce((p,S)=>[...p,...S],[]);const g={...n,name:e,enum:(n.enum||[]).join(", "),...a};return m.map(h=>typeof h=="string"?Xj(h,g):h)}function Qj(e,t,n,r,a,i){const o=e.join("."),l=n.map((m,g)=>{const f=m.validator,h={...m,ruleIndex:g};return f&&(h.validator=(p,S,y)=>{let w=!1;const x=f(p,S,(...C)=>{Promise.resolve().then(()=>{st(!w,"Your validator function has already return a promise. `callback` will be ignored."),w||y(...C)})});w=x&&typeof x.then=="function"&&typeof x.catch=="function",st(w,"`callback` is deprecated. Please return a promise instead."),w&&x.then(()=>{y()}).catch(C=>{y(C||" ")})}),h}).sort(({warningOnly:m,ruleIndex:g},{warningOnly:f,ruleIndex:h})=>!!m==!!f?g-h:m?1:-1);let u;if(a===!0)u=new Promise(async(m,g)=>{for(let f=0;f<l.length;f+=1){const h=l[f],p=await Wi(o,t,h,r,i);if(p.length){g([{errors:p,rule:h}]);return}}m([])});else{const m=l.map(g=>Wi(o,t,g,r,i).then(f=>({errors:f,rule:g})));u=(a?t0(m):e0(m)).then(g=>Promise.reject(g))}return u.catch(m=>m),u}async function e0(e){return Promise.all(e).then(t=>[].concat(...t))}async function t0(e){let t=0;return new Promise(n=>{e.forEach(r=>{r.then(a=>{a.errors.length&&n([a]),t+=1,t===e.length&&n([])})})})}function ut(e){return Hi(e)}function kc(e,t){let n={};return t.forEach(r=>{const a=Be(e,r);n=Qe(n,r,a)}),n}function cr(e,t,n=!1){return e&&e.some(r=>ca(t,r,n))}function ca(e,t,n=!1){return!e||!t||!n&&e.length!==t.length?!1:t.every((r,a)=>e[a]===r)}function n0(e,t){if(e===t)return!0;if(!e&&t||e&&!t||!e||!t||typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(e),r=Object.keys(t);return[...new Set([...n,...r])].every(i=>{const o=e[i],l=t[i];return typeof o=="function"&&typeof l=="function"?!0:o===l})}function r0(e,...t){const n=t[0];return n&&n.target&&typeof n.target=="object"&&e in n.target?n.target[e]:n}function Oc(e,t,n){const{length:r}=e;if(t<0||t>=r||n<0||n>=r)return e;const a=e[t],i=t-n;return i>0?[...e.slice(0,n),a,...e.slice(n,t),...e.slice(t+1,r)]:i<0?[...e.slice(0,t),...e.slice(t+1,n+1),a,...e.slice(n+1,r)]:e}const kd=e=>{const t=new MessageChannel;t.port1.onmessage=e,t.port2.postMessage(null)};class s0{constructor(t){oe(this,"namePathList",[]);oe(this,"taskId",0);oe(this,"watcherList",new Set);oe(this,"form");this.form=t}register(t){return this.watcherList.add(t),()=>{this.watcherList.delete(t)}}notify(t){t.forEach(n=>{this.namePathList.every(r=>!ca(r,n))&&this.namePathList.push(n)}),this.doBatch()}doBatch(){this.taskId+=1;const t=this.taskId;kd(()=>{if(t===this.taskId&&this.watcherList.size){const n=this.form.getForm(),r=n.getFieldsValue(),a=n.getFieldsValue(!0);this.watcherList.forEach(i=>{i(r,a,this.namePathList)}),this.namePathList=[]}})}}async function a0(){return new Promise(e=>{kd(()=>{ro(()=>{e()})})})}function qi(){return qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qi.apply(this,arguments)}const Mn=[],Ar=[];function ri(e,t,n,r,a,i){return typeof e=="function"?e(t,n,"source"in i?{source:i.source}:{}):r!==a}class Od extends be.PureComponent{constructor(n){super(n);oe(this,"state",{resetCount:0});oe(this,"cancelRegisterFunc",null);oe(this,"mounted",!1);oe(this,"touched",!1);oe(this,"dirty",!1);oe(this,"validatePromise");oe(this,"prevValidating");oe(this,"errors",Mn);oe(this,"warnings",Ar);oe(this,"cancelRegister",()=>{const{preserve:n,isListField:r,name:a}=this.props;this.cancelRegisterFunc&&this.cancelRegisterFunc(r,n,ut(a)),this.cancelRegisterFunc=null});oe(this,"getNamePath",()=>{const{name:n,fieldContext:r}=this.props,{prefixName:a=[]}=r;return n!==void 0?[...a,...n]:[]});oe(this,"getRules",()=>{const{rules:n=[],fieldContext:r}=this.props;return n.map(a=>typeof a=="function"?a(r):a)});oe(this,"refresh",()=>{this.mounted&&this.setState(({resetCount:n})=>({resetCount:n+1}))});oe(this,"metaCache",null);oe(this,"triggerMetaEvent",n=>{const{onMetaChange:r}=this.props;if(r){const a={...this.getMeta(),destroy:n};zo(this.metaCache,a)||r(a),this.metaCache=a}else this.metaCache=null});oe(this,"onStoreChange",(n,r,a)=>{const{shouldUpdate:i,dependencies:o=[],onReset:l}=this.props,{store:u}=a,m=this.getNamePath(),g=this.getValue(n),f=this.getValue(u),h=r&&cr(r,m);switch(a.type==="valueUpdate"&&a.source==="external"&&!zo(g,f)&&(this.touched=!0,this.dirty=!0,this.validatePromise=null,this.errors=Mn,this.warnings=Ar,this.triggerMetaEvent()),a.type){case"reset":if(!r||h){this.touched=!1,this.dirty=!1,this.validatePromise=void 0,this.errors=Mn,this.warnings=Ar,this.triggerMetaEvent(),l==null||l(),this.refresh();return}break;case"remove":{if(i&&ri(i,n,u,g,f,a)){this.reRender();return}break}case"setField":{const{data:p}=a;if(h){"touched"in p&&(this.touched=p.touched),"validating"in p&&!("originRCField"in p)&&(this.validatePromise=p.validating?Promise.resolve([]):null),"errors"in p&&(this.errors=p.errors||Mn),"warnings"in p&&(this.warnings=p.warnings||Ar),this.dirty=!0,this.triggerMetaEvent(),this.reRender();return}else if("value"in p&&cr(r,m,!0)){this.reRender();return}if(i&&!m.length&&ri(i,n,u,g,f,a)){this.reRender();return}break}case"dependenciesUpdate":{if(o.map(ut).some(S=>cr(a.relatedFields,S))){this.reRender();return}break}default:if(h||(!o.length||m.length||i)&&ri(i,n,u,g,f,a)){this.reRender();return}break}i===!0&&this.reRender()});oe(this,"validateRules",n=>{const r=this.getNamePath(),a=this.getValue(),{triggerName:i,validateOnly:o=!1,delayFrame:l}=n||{},u=Promise.resolve().then(async()=>{if(!this.mounted)return[];const{validateFirst:m=!1,messageVariables:g,validateDebounce:f}=this.props;l&&await a0();let h=this.getRules();if(i&&(h=h.filter(S=>S).filter(S=>{const{validateTrigger:y}=S;return y?Hi(y).includes(i):!0})),f&&i&&(await new Promise(S=>{setTimeout(S,f)}),this.validatePromise!==u))return[];const p=Qj(r,a,h,n,m,g);return p.catch(S=>S).then((S=Mn)=>{var y;if(this.validatePromise===u){this.validatePromise=null;const w=[],T=[];(y=S.forEach)==null||y.call(S,({rule:{warningOnly:x},errors:C=Mn})=>{x?T.push(...C):w.push(...C)}),this.errors=w,this.warnings=T,this.triggerMetaEvent(),this.reRender()}}),p});return o||(this.validatePromise=u,this.dirty=!0,this.errors=Mn,this.warnings=Ar,this.triggerMetaEvent(),this.reRender()),u});oe(this,"isFieldValidating",()=>!!this.validatePromise);oe(this,"isFieldTouched",()=>this.touched);oe(this,"isFieldDirty",()=>{if(this.dirty||this.props.initialValue!==void 0)return!0;const{fieldContext:n}=this.props,{getInitialValue:r}=n.getInternalHooks(Pn);return r(this.getNamePath())!==void 0});oe(this,"getErrors",()=>this.errors);oe(this,"getWarnings",()=>this.warnings);oe(this,"isListField",()=>this.props.isListField);oe(this,"isList",()=>this.props.isList);oe(this,"isPreserve",()=>this.props.preserve);oe(this,"getMeta",()=>(this.prevValidating=this.isFieldValidating(),{touched:this.isFieldTouched(),validating:this.prevValidating,errors:this.errors,warnings:this.warnings,name:this.getNamePath(),validated:this.validatePromise===null}));oe(this,"getOnlyChild",n=>{if(typeof n=="function"){const a=this.getMeta();return{...this.getOnlyChild(n(this.getControlled(),a,this.props.fieldContext)),isFunction:!0}}const r=Tn(n);return r.length!==1||!be.isValidElement(r[0])?{child:r,isFunction:!1}:{child:r[0],isFunction:!1}});oe(this,"getValue",n=>{const{getFieldsValue:r}=this.props.fieldContext,a=this.getNamePath();return Be(n||r(!0),a)});oe(this,"getControlled",(n={})=>{const{name:r,trigger:a="onChange",validateTrigger:i,getValueFromEvent:o,normalize:l,valuePropName:u="value",getValueProps:m,fieldContext:g}=this.props,f=i!==void 0?i:g.validateTrigger,h=this.getNamePath(),{getInternalHooks:p,getFieldsValue:S}=g,{dispatch:y}=p(Pn),w=this.getValue(),T=m||(v=>({[u]:v})),x=n[a],C=r!==void 0?T(w):{};process.env.NODE_ENV!=="production"&&C&&Object.keys(C).forEach(v=>{st(typeof C[v]!="function",`It's not recommended to generate dynamic function prop by \`getValueProps\`. Please pass it to child component directly (prop: ${v})`)});const j={...n,...C};return j[a]=(...v)=>{this.touched=!0,this.dirty=!0,this.triggerMetaEvent();const $=this.getValue();let E;o?E=o(...v):E=r0(u,...v),l&&(E=l(E,$,S(!0))),E!==$&&y({type:"updateValue",namePath:h,value:E}),x&&x(...v)},Hi(f||[]).forEach(v=>{const $=j[v];j[v]=(...E)=>{$&&$(...E);const{rules:R}=this.props;R&&R.length&&y({type:"validateField",namePath:h,triggerName:v})}}),j});if(n.fieldContext){const{getInternalHooks:r}=n.fieldContext,{initEntityValue:a}=r(Pn);a(this)}}componentDidMount(){const{shouldUpdate:n,fieldContext:r}=this.props;if(this.mounted=!0,r){const{getInternalHooks:a}=r,{registerField:i}=a(Pn);this.cancelRegisterFunc=i(this)}n===!0&&this.reRender()}componentWillUnmount(){this.cancelRegister(),this.triggerMetaEvent(!0),this.mounted=!1}reRender(){this.mounted&&this.forceUpdate()}render(){const{resetCount:n}=this.state,{children:r}=this.props,{child:a,isFunction:i}=this.getOnlyChild(r);let o;return i?o=a:be.isValidElement(a)?o=be.cloneElement(a,this.getControlled(a.props)):(st(!a,"`children` of Field is not validate ReactElement."),o=a),be.createElement(be.Fragment,{key:n},o)}}oe(Od,"contextType",Hn);function Dd({name:e,...t}){const n=be.useContext(Hn),r=be.useContext(la),a=e!==void 0?ut(e):void 0,i=t.isListField??!!r;let o="keep";return i||(o=`_${(a||[]).join("_")}`),process.env.NODE_ENV!=="production"&&t.preserve===!1&&i&&a.length<=1&&st(!1,"`preserve` should not apply on Form.List fields."),be.createElement(Od,qi({key:o,name:a,isListField:i},t,{fieldContext:n}))}function i0({name:e,initialValue:t,children:n,rules:r,validateTrigger:a,isListField:i}){const o=be.useContext(Hn),l=be.useContext(la),m=be.useRef({keys:[],id:0}).current,g=be.useMemo(()=>[...ut(o.prefixName)||[],...ut(e)],[o.prefixName,e]),f=be.useMemo(()=>({...o,prefixName:g}),[o,g]),h=be.useMemo(()=>({getKey:S=>{const y=g.length,w=S[y];return[m.keys[w],S.slice(y+1)]}}),[m,g]);if(typeof n!="function")return st(!1,"Form.List only accepts function as children."),null;const p=(S,y,{source:w})=>w==="internal"?!1:S!==y;return be.createElement(la.Provider,{value:h},be.createElement(Hn.Provider,{value:f},be.createElement(Dd,{name:[],shouldUpdate:p,rules:r,validateTrigger:a,initialValue:t,isList:!0,isListField:i??!!l},({value:S=[],onChange:y},w)=>{const{getFieldValue:T}=o,x=()=>T(g||[])||[],C={add:(b,v)=>{const $=x();v>=0&&v<=$.length?(m.keys=[...m.keys.slice(0,v),m.id,...m.keys.slice(v)],y([...$.slice(0,v),b,...$.slice(v)])):(process.env.NODE_ENV!=="production"&&(v<0||v>$.length)&&st(!1,"The second parameter of the add function should be a valid positive number."),m.keys=[...m.keys,m.id],y([...$,b])),m.id+=1},remove:b=>{const v=x(),$=new Set(Array.isArray(b)?b:[b]);$.size<=0||(m.keys=m.keys.filter((E,R)=>!$.has(R)),y(v.filter((E,R)=>!$.has(R))))},move(b,v){if(b===v)return;const $=x();b<0||b>=$.length||v<0||v>=$.length||(m.keys=Oc(m.keys,b,v),y(Oc($,b,v)))}};let j=S||[];return Array.isArray(j)||(j=[],process.env.NODE_ENV!=="production"&&st(!1,`Current value of '${g.join(" > ")}' is not an array type.`)),n(j.map((b,v)=>{let $=m.keys[v];return $===void 0&&(m.keys[v]=m.id,$=m.keys[v],m.id+=1),{name:v,key:$,isListField:!0}}),C,w)})))}function o0(e){let t=!1,n=e.length;const r=[];return e.length?new Promise((a,i)=>{e.forEach((o,l)=>{o.catch(u=>(t=!0,u)).then(u=>{n-=1,r[l]=u,!(n>0)&&(t&&i(r),a(r))})})}):Promise.resolve([])}const Gi="__@field_split__";function Is(e){return e.map(t=>`${typeof t}:${t}`).join(Gi)}class nr{constructor(){oe(this,"kvs",new Map)}set(t,n){this.kvs.set(Is(t),n)}get(t){return this.kvs.get(Is(t))}getAsPrefix(t){const n=Is(t),r=n+Gi,a=[],i=this.kvs.get(n);return i!==void 0&&a.push(i),this.kvs.forEach((o,l)=>{l.startsWith(r)&&a.push(o)}),a}update(t,n){const r=this.get(t),a=n(r);a?this.set(t,a):this.delete(t)}delete(t){this.kvs.delete(Is(t))}map(t){return[...this.kvs.entries()].map(([n,r])=>{const a=n.split(Gi);return t({key:a.map(i=>{const[,o,l]=i.match(/^([^:]*):(.*)$/);return o==="number"?Number(l):l}),value:r})})}toJSON(){const t={};return this.map(({key:n,value:r})=>(t[n.join(".")]=r,null)),t}}class l0{constructor(t){oe(this,"formHooked",!1);oe(this,"forceRootUpdate");oe(this,"subscribable",!0);oe(this,"store",{});oe(this,"fieldEntities",[]);oe(this,"initialValues",{});oe(this,"callbacks",{});oe(this,"validateMessages",null);oe(this,"preserve",null);oe(this,"lastValidatePromise",null);oe(this,"watcherCenter",new s0(this));oe(this,"getForm",()=>({getFieldValue:this.getFieldValue,getFieldsValue:this.getFieldsValue,getFieldError:this.getFieldError,getFieldWarning:this.getFieldWarning,getFieldsError:this.getFieldsError,isFieldsTouched:this.isFieldsTouched,isFieldTouched:this.isFieldTouched,isFieldValidating:this.isFieldValidating,isFieldsValidating:this.isFieldsValidating,resetFields:this.resetFields,setFields:this.setFields,setFieldValue:this.setFieldValue,setFieldsValue:this.setFieldsValue,validateFields:this.validateFields,submit:this.submit,_init:!0,getInternalHooks:this.getInternalHooks}));oe(this,"getInternalHooks",t=>t===Pn?(this.formHooked=!0,{dispatch:this.dispatch,initEntityValue:this.initEntityValue,registerField:this.registerField,useSubscribe:this.useSubscribe,setInitialValues:this.setInitialValues,destroyForm:this.destroyForm,setCallbacks:this.setCallbacks,setValidateMessages:this.setValidateMessages,getFields:this.getFields,setPreserve:this.setPreserve,getInitialValue:this.getInitialValue,registerWatch:this.registerWatch}):(st(!1,"`getInternalHooks` is internal usage. Should not call directly."),null));oe(this,"useSubscribe",t=>{this.subscribable=t});oe(this,"prevWithoutPreserves",null);oe(this,"setInitialValues",(t,n)=>{var r;if(this.initialValues=t||{},n){let a=ar(t,this.store);(r=this.prevWithoutPreserves)==null||r.map(({key:i})=>{a=Qe(a,i,Be(t,i))}),this.prevWithoutPreserves=null,this.updateStore(a)}});oe(this,"destroyForm",t=>{if(t)this.updateStore({});else{const n=new nr;this.getFieldEntities(!0).forEach(r=>{this.isMergedPreserve(r.isPreserve())||n.set(r.getNamePath(),!0)}),this.prevWithoutPreserves=n}});oe(this,"getInitialValue",t=>{const n=Be(this.initialValues,t);return t.length?ar(n):n});oe(this,"setCallbacks",t=>{this.callbacks=t});oe(this,"setValidateMessages",t=>{this.validateMessages=t});oe(this,"setPreserve",t=>{this.preserve=t});oe(this,"registerWatch",t=>this.watcherCenter.register(t));oe(this,"notifyWatch",(t=[])=>{this.watcherCenter.notify(t)});oe(this,"timeoutId",null);oe(this,"warningUnhooked",()=>{process.env.NODE_ENV!=="production"&&!this.timeoutId&&typeof window<"u"&&(this.timeoutId=setTimeout(()=>{this.timeoutId=null,this.formHooked||st(!1,"Instance created by `useForm` is not connected to any Form element. Forget to pass `form` prop?")}))});oe(this,"updateStore",t=>{this.store=t});oe(this,"getFieldEntities",(t=!1)=>t?this.fieldEntities.filter(n=>n.getNamePath().length):this.fieldEntities);oe(this,"getFieldsMap",(t=!1)=>{const n=new nr;return this.getFieldEntities(t).forEach(r=>{const a=r.getNamePath();n.set(a,r)}),n});oe(this,"getFieldEntitiesForNamePathList",(t,n=!1)=>{if(!t)return this.getFieldEntities(!0);const r=this.getFieldsMap(!0);return n?t.flatMap(a=>{const i=ut(a),o=r.getAsPrefix(i);return o.length?o:[{INVALIDATE_NAME_PATH:i}]}):t.map(a=>{const i=ut(a);return r.get(i)||{INVALIDATE_NAME_PATH:ut(a)}})});oe(this,"getFieldsValue",(t,n)=>{this.warningUnhooked();let r,a;if(t===!0||Array.isArray(t)?(r=t,a=n):t&&typeof t=="object"&&(a=t.filter),r===!0&&!a)return this.store;const i=this.getFieldEntitiesForNamePathList(Array.isArray(r)?r:null,!0),o=[],l=[];i.forEach(m=>{var f;const g=m.INVALIDATE_NAME_PATH||m.getNamePath();if((f=m.isList)!=null&&f.call(m)){l.push(g);return}if(!a)o.push(g);else{const h="getMeta"in m?m.getMeta():null;a(h)&&o.push(g)}});let u=kc(this.store,o.map(ut));return l.forEach(m=>{Be(u,m)||(u=Qe(u,m,[]))}),u});oe(this,"getFieldValue",t=>{this.warningUnhooked();const n=ut(t);return Be(this.store,n)});oe(this,"getFieldsError",t=>(this.warningUnhooked(),this.getFieldEntitiesForNamePathList(t).map((r,a)=>r&&!r.INVALIDATE_NAME_PATH?{name:r.getNamePath(),errors:r.getErrors(),warnings:r.getWarnings()}:{name:ut(t[a]),errors:[],warnings:[]})));oe(this,"getFieldError",t=>{this.warningUnhooked();const n=ut(t);return this.getFieldsError([n])[0].errors});oe(this,"getFieldWarning",t=>{this.warningUnhooked();const n=ut(t);return this.getFieldsError([n])[0].warnings});oe(this,"isFieldsTouched",(...t)=>{this.warningUnhooked();const[n,r]=t;let a,i=!1;t.length===0?a=null:t.length===1?Array.isArray(n)?(a=n.map(ut),i=!1):(a=null,i=n):(a=n.map(ut),i=r);const o=this.getFieldEntities(!0),l=f=>f.isFieldTouched();if(!a)return i?o.every(f=>l(f)||f.isList()):o.some(l);const u=new nr;a.forEach(f=>{u.set(f,[])}),o.forEach(f=>{const h=f.getNamePath();a.forEach(p=>{p.every((S,y)=>h[y]===S)&&u.update(p,S=>[...S,f])})});const m=f=>f.some(l),g=u.map(({value:f})=>f);return i?g.every(m):g.some(m)});oe(this,"isFieldTouched",t=>(this.warningUnhooked(),this.isFieldsTouched([t])));oe(this,"isFieldsValidating",t=>{this.warningUnhooked();const n=this.getFieldEntities();if(!t)return n.some(a=>a.isFieldValidating());const r=t.map(ut);return n.some(a=>{const i=a.getNamePath();return cr(r,i)&&a.isFieldValidating()})});oe(this,"isFieldValidating",t=>(this.warningUnhooked(),this.isFieldsValidating([t])));oe(this,"resetWithFieldInitialValue",(t={})=>{const n=new nr,r=this.getFieldEntities(!0);r.forEach(o=>{const{initialValue:l}=o.props,u=o.getNamePath();if(l!==void 0){const m=n.get(u)||new Set;m.add({entity:o,value:l}),n.set(u,m)}});const a=o=>{o.forEach(l=>{const{initialValue:u}=l.props;if(u!==void 0){const m=l.getNamePath();if(this.getInitialValue(m)!==void 0)st(!1,`Form already set 'initialValues' with path '${m.join(".")}'. Field can not overwrite it.`);else{const f=n.get(m);if(f&&f.size>1)st(!1,`Multiple Field with path '${m.join(".")}' set 'initialValue'. Can not decide which one to pick.`);else if(f){const h=this.getFieldValue(m);!l.isListField()&&(!t.skipExist||h===void 0)&&this.updateStore(Qe(this.store,m,[...f][0].value))}}}})};let i;t.entities?i=t.entities:t.namePathList?(i=[],t.namePathList.forEach(o=>{const l=n.get(o);l&&i.push(...[...l].map(u=>u.entity))})):i=r,a(i)});oe(this,"resetFields",t=>{this.warningUnhooked();const n=this.store;if(!t){this.updateStore(ar(this.initialValues)),this.resetWithFieldInitialValue(),this.notifyObservers(n,null,{type:"reset"}),this.notifyWatch();return}const r=t.map(ut);r.forEach(a=>{const i=this.getInitialValue(a);this.updateStore(Qe(this.store,a,i))}),this.resetWithFieldInitialValue({namePathList:r}),this.notifyObservers(n,r,{type:"reset"}),this.notifyWatch(r)});oe(this,"setFields",t=>{this.warningUnhooked();const n=this.store,r=[];t.forEach(a=>{const{name:i,...o}=a,l=ut(i);r.push(l),"value"in o&&this.updateStore(Qe(this.store,l,o.value)),this.notifyObservers(n,[l],{type:"setField",data:a})}),this.notifyWatch(r)});oe(this,"getFields",()=>this.getFieldEntities(!0).map(r=>{const a=r.getNamePath(),o={...r.getMeta(),name:a,value:this.getFieldValue(a)};return Object.defineProperty(o,"originRCField",{value:!0}),o}));oe(this,"initEntityValue",t=>{const{initialValue:n}=t.props;if(n!==void 0){const r=t.getNamePath();Be(this.store,r)===void 0&&this.updateStore(Qe(this.store,r,n))}});oe(this,"isMergedPreserve",t=>(t!==void 0?t:this.preserve)??!0);oe(this,"registerField",t=>{this.fieldEntities.push(t);const n=t.getNamePath();if(this.notifyWatch([n]),t.props.initialValue!==void 0){const r=this.store;this.resetWithFieldInitialValue({entities:[t],skipExist:!0}),this.notifyObservers(r,[t.getNamePath()],{type:"valueUpdate",source:"internal"})}return(r,a,i=[])=>{if(this.fieldEntities=this.fieldEntities.filter(o=>o!==t),!this.isMergedPreserve(a)&&(!r||i.length>1)){const o=r?void 0:this.getInitialValue(n);if(n.length&&this.getFieldValue(n)!==o&&this.fieldEntities.every(l=>!ca(l.getNamePath(),n))){const l=this.store;this.updateStore(Qe(l,n,o,!0)),this.notifyObservers(l,[n],{type:"remove"}),this.triggerDependenciesUpdate(l,n)}}this.notifyWatch([n])}});oe(this,"dispatch",t=>{switch(t.type){case"updateValue":{const{namePath:n,value:r}=t;this.updateValue(n,r);break}case"validateField":{const{namePath:n,triggerName:r}=t;this.validateFields([n],{triggerName:r});break}}});oe(this,"notifyObservers",(t,n,r)=>{if(this.subscribable){const a={...r,store:this.getFieldsValue(!0)};this.getFieldEntities().forEach(({onStoreChange:i})=>{i(t,n,a)})}else this.forceRootUpdate()});oe(this,"triggerDependenciesUpdate",(t,n)=>{const r=this.getDependencyChildrenFields(n);return r.length&&this.validateFields(r,{delayFrame:!0}),this.notifyObservers(t,r,{type:"dependenciesUpdate",relatedFields:[n,...r]}),r});oe(this,"updateValue",(t,n)=>{const r=ut(t),a=this.store;this.updateStore(Qe(this.store,r,n)),this.notifyObservers(a,[r],{type:"valueUpdate",source:"internal"}),this.notifyWatch([r]);const i=this.triggerDependenciesUpdate(a,r),{onValuesChange:o}=this.callbacks;if(o){const l=kc(this.store,[r]),u=this.getFieldsValue(),m=Qe(u,r,Be(l,r));o(l,m)}this.triggerOnFieldsChange([r,...i])});oe(this,"setFieldsValue",t=>{this.warningUnhooked();const n=this.store;if(t){const r=ar(this.store,t);this.updateStore(r)}this.notifyObservers(n,null,{type:"valueUpdate",source:"external"}),this.notifyWatch()});oe(this,"setFieldValue",(t,n)=>{this.setFields([{name:t,value:n,errors:[],warnings:[],touched:!0}])});oe(this,"getDependencyChildrenFields",t=>{const n=new Set,r=[],a=new nr;this.getFieldEntities().forEach(o=>{const{dependencies:l}=o.props;(l||[]).forEach(u=>{const m=ut(u);a.update(m,(g=new Set)=>(g.add(o),g))})});const i=o=>{(a.get(o)||new Set).forEach(u=>{if(!n.has(u)){n.add(u);const m=u.getNamePath();u.isFieldDirty()&&m.length&&(r.push(m),i(m))}})};return i(t),r});oe(this,"triggerOnFieldsChange",(t,n)=>{const{onFieldsChange:r}=this.callbacks;if(r){const a=this.getFields();if(n){const o=new nr;n.forEach(({name:l,errors:u})=>{o.set(l,u)}),a.forEach(l=>{l.errors=o.get(l.name)||l.errors})}const i=a.filter(({name:o})=>cr(t,o));i.length&&r(i,a)}});oe(this,"validateFields",(t,n)=>{this.warningUnhooked();let r,a;Array.isArray(t)||typeof t=="string"||typeof n=="string"?(r=t,a=n):a=t;const i=!!r,o=i?r.map(ut):[],l=[...o],u=[],m=String(Date.now()),g=new Set,{recursive:f,dirty:h}=a||{};this.getFieldEntities(!0).forEach(w=>{const T=w.getNamePath();if(i||((!w.isList()||!o.some(x=>ca(x,T,!0)))&&l.push(T),o.push(T)),!(!w.props.rules||!w.props.rules.length)&&!(h&&!w.isFieldDirty())&&(g.add(T.join(m)),!i||cr(o,T,f))){const x=w.validateRules({validateMessages:{...Ad,...this.validateMessages},...a});u.push(x.then(()=>({name:T,errors:[],warnings:[]})).catch(C=>{var v;const j=[],b=[];return(v=C.forEach)==null||v.call(C,({rule:{warningOnly:$},errors:E})=>{$?b.push(...E):j.push(...E)}),j.length?Promise.reject({name:T,errors:j,warnings:b}):{name:T,errors:j,warnings:b}}))}});const p=o0(u);this.lastValidatePromise=p,p.catch(w=>w).then(w=>{const T=w.map(({name:x})=>x);this.notifyObservers(this.store,T,{type:"validateFinish"}),this.triggerOnFieldsChange(T,w)});const S=p.then(()=>this.lastValidatePromise===p?Promise.resolve(this.getFieldsValue(l)):Promise.reject([])).catch(w=>{var C,j;const T=w.filter(b=>b&&b.errors.length),x=(j=(C=T[0])==null?void 0:C.errors)==null?void 0:j[0];return Promise.reject({message:x,values:this.getFieldsValue(o),errorFields:T,outOfDate:this.lastValidatePromise!==p})});S.catch(w=>w);const y=o.filter(w=>g.has(w.join(m)));return this.triggerOnFieldsChange(y),S});oe(this,"submit",()=>{this.warningUnhooked(),this.validateFields().then(t=>{const{onFinish:n}=this.callbacks;if(n)try{n(t)}catch(r){console.error(r)}}).catch(t=>{const{onFinishFailed:n}=this.callbacks;n&&n(t)})});this.forceRootUpdate=t}}function Pd(e){const t=be.useRef(null),[,n]=be.useState({});if(!t.current)if(e)t.current=e;else{const r=()=>{n({})},a=new l0(r);t.current=a.getForm()}return[t.current]}const Zi=be.createContext({triggerFormChange:()=>{},triggerFormFinish:()=>{},registerForm:()=>{},unregisterForm:()=>{}}),c0=({validateMessages:e,onFormChange:t,onFormFinish:n,children:r})=>{const a=be.useContext(Zi),i=be.useRef({});return be.createElement(Zi.Provider,{value:{...a,validateMessages:{...a.validateMessages,...e},triggerFormChange:(o,l)=>{t&&t(o,{changedFields:l,forms:i.current}),a.triggerFormChange(o,l)},triggerFormFinish:(o,l)=>{n&&n(o,{values:l,forms:i.current}),a.triggerFormFinish(o,l)},registerForm:(o,l)=>{o&&(i.current={...i.current,[o]:l}),a.registerForm(o,l)},unregisterForm:o=>{const l={...i.current};delete l[o],i.current=l,a.unregisterForm(o)}}},r)};function Ji(){return Ji=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ji.apply(this,arguments)}const u0=(e,t)=>{const{name:n,initialValues:r,fields:a,form:i,preserve:o,children:l,component:u="form",validateMessages:m,validateTrigger:g="onChange",onValuesChange:f,onFieldsChange:h,onFinish:p,onFinishFailed:S,clearOnDestroy:y,...w}=e,T=be.useRef(null),x=be.useContext(Zi),[C]=Pd(i),{useSubscribe:j,setInitialValues:b,setCallbacks:v,setValidateMessages:$,setPreserve:E,destroyForm:R}=C.getInternalHooks(Pn);be.useImperativeHandle(t,()=>({...C,nativeElement:T.current})),be.useEffect(()=>(x.registerForm(n,C),()=>{x.unregisterForm(n)}),[x,C,n]),$({...x.validateMessages,...m}),v({onValuesChange:f,onFieldsChange:(F,...A)=>{x.triggerFormChange(n,F),h&&h(F,...A)},onFinish:F=>{x.triggerFormFinish(n,F),p&&p(F)},onFinishFailed:S}),E(o);const D=be.useRef(null);b(r,!D.current),D.current||(D.current=!0),be.useEffect(()=>()=>R(y),[]);let M;const U=typeof l=="function";if(U){const F=C.getFieldsValue(!0);M=l(F,C)}else M=l;j(!U);const Y=be.useRef(null);be.useEffect(()=>{n0(Y.current||[],a||[])||C.setFields(a||[]),Y.current=a},[a,C]);const O=be.useMemo(()=>({...C,validateTrigger:g}),[C,g]),I=be.createElement(la.Provider,{value:null},be.createElement(Hn.Provider,{value:O},M));return u===!1?I:be.createElement(u,Ji({},w,{ref:T,onSubmit:F=>{F.preventDefault(),F.stopPropagation(),C.submit()},onReset:F=>{var A;F.preventDefault(),C.resetFields(),(A=w.onReset)==null||A.call(w,F)}}),I)};function si(e){try{return JSON.stringify(e)}catch{return Math.random()}}function d0(...e){const[t,n={}]=e,r=jj(n)?{form:n}:n,a=r.form,[i,o]=d.useState(()=>typeof t=="function"?t({}):void 0),l=d.useMemo(()=>si(i),[i]),u=d.useRef(l);u.current=l;const m=d.useContext(Hn),g=a||m,f=g&&g._init;process.env.NODE_ENV!=="production"&&st(e.length===2?a?f:!0:f,"useWatch requires a form instance since it can not auto detect from context.");const{getFieldsValue:h,getInternalHooks:p}=g,{registerWatch:S}=p(Pn),y=eu((T,x)=>{const C=r.preserve?x??h(!0):T??h(),j=typeof t=="function"?t(C):Be(C,ut(t));si(i)!==si(j)&&o(j)}),w=typeof t=="function"?t:JSON.stringify(t);return d.useEffect(()=>{f&&y()},[f,w]),d.useEffect(()=>f?S((x,C)=>{y(x,C)}):void 0,[f]),i}const f0=be.forwardRef(u0),rs=f0;rs.FormProvider=c0;rs.Field=Dd;rs.List=i0;rs.useForm=Pd;rs.useWatch=d0;const wr=d.createContext({}),ss=d.createContext({mode:"edit"}),m0=e=>Array.isArray(e)?e:typeof e=="function"?[e]:Tn(e),h0=e=>{var ue,pe,me;const{creatorButtonProps:t,deleteIconProps:n,copyIconProps:r,arrowSort:a,upIconProps:i,downIconProps:o,itemContainerRender:l,itemRender:u,alwaysShowItemLabel:m,prefixCls:g,creatorRecord:f,action:h,actionGuard:p,children:S,actionRender:y,fields:w,meta:T,field:x,index:C,formInstance:j,originName:b,containerClassName:v,containerStyle:$,min:E,max:R,count:D,...M}=e,{hashId:U}=d.useContext(Xt),{componentSize:Y}=((pe=(ue=c.ConfigProvider).useConfig)==null?void 0:pe.call(ue))||{componentSize:"middle"},O=d.useContext(gr),I=d.useRef(!1),{mode:F}=d.useContext(ss),[A,k]=d.useState(!1),[B,G]=d.useState(!1);d.useEffect(()=>()=>{I.current=!0},[]);const _=()=>j.getFieldValue([O.listName,b,C==null?void 0:C.toString()].flat(1).filter(fe=>fe!=null)),H={getCurrentRowData:_,setCurrentRowData:fe=>{var Ae;const ye=((Ae=j==null?void 0:j.getFieldsValue)==null?void 0:Ae.call(j))||{},Te=[O.listName,b,C==null?void 0:C.toString()].flat(1).filter(ze=>ze!=null),Oe=Qe(ye,Te,{..._(),...fe||{}});return j.setFieldsValue(Oe)}},Z=m0(S).map(fe=>typeof fe=="function"?fe==null?void 0:fe(x,C,{...h,...H},D):fe).map((fe,ye)=>{var Te;return d.isValidElement(fe)?d.cloneElement(fe,{key:fe.key||((Te=fe==null?void 0:fe.props)==null?void 0:Te.name)||ye,...(fe==null?void 0:fe.props)||{}}):fe}),q=d.useMemo(()=>{if(F==="read"||r===!1||R===D)return null;const{Icon:fe=de.CopyOutlined,tooltipText:ye}=r;return s.jsx(c.Tooltip,{title:ye,children:B?s.jsx(de.LoadingOutlined,{}):s.jsx(fe,{className:ie(`${g}-action-icon action-copy`,U),onClick:async()=>{G(!0);const Te=j==null?void 0:j.getFieldValue([O.listName,b,x.name].filter(Oe=>Oe!==void 0).flat(1));await h.add(Te,D),G(!1)}})},"copy")},[r,R,D,B,g,U,j,O.listName,x.name,b,h]),V=d.useMemo(()=>{if(F==="read"||n===!1||E===D)return null;const{Icon:fe=de.DeleteOutlined,tooltipText:ye}=n;return s.jsx(c.Tooltip,{title:ye,children:A?s.jsx(de.LoadingOutlined,{}):s.jsx(fe,{className:ie(`${g}-action-icon action-remove`,U),onClick:async()=>{k(!0),await h.remove(x.name),I.current||k(!1)}})},"delete")},[n,E,D,A,g,U,h,x.name]),L=d.useMemo(()=>{if(!a||F==="read"||i===!1)return null;const fe=C-1;if(fe<0)return null;const{Icon:ye=de.ArrowUpOutlined,tooltipText:Te}=i;return s.jsx(c.Tooltip,{title:Te,children:s.jsx(ye,{className:ie(`${g}-action-icon action-up`,U),onClick:async()=>{await h.move(C,fe)}})},"up")},[i,g,U,h,a]),K=d.useMemo(()=>{if(!a||F==="read"||o===!1)return null;const fe=C+1;if(fe>=D)return null;const{Icon:ye=de.ArrowDownOutlined,tooltipText:Te}=o;return s.jsx(c.Tooltip,{title:Te,children:s.jsx(ye,{className:ie(`${g}-action-icon action-down`,U),onClick:async()=>{await h.move(C,fe)}})},"down")},[i,g,U,h,a]),P=d.useMemo(()=>[q,V,L,K].filter(fe=>fe!=null),[q,V,L,K]),W=(y==null?void 0:y(x,h,P,D))||P,te=W.length>0&&F!=="read"?s.jsx("div",{className:ie(`${g}-action`,{[`${g}-action-small`]:Y==="small"},U),children:W}):null,re={name:M.name,field:x,index:C,record:(me=j==null?void 0:j.getFieldValue)==null?void 0:me.call(j,[O.listName,b,x.name].filter(fe=>fe!==void 0).flat(1)),fields:w,operation:h,meta:T},{grid:X}=Cr(),se=(l==null?void 0:l(Z,re))||Z,ae=(u==null?void 0:u({listDom:s.jsx("div",{className:ie(`${g}-container`,v,U),style:{width:X?"100%":void 0,...$},children:se}),action:te},re))||s.jsxs("div",{className:ie(`${g}-item`,U,{[`${g}-item-default`]:m===void 0,[`${g}-item-show-label`]:m}),style:{display:"flex",alignItems:"flex-end"},children:[s.jsx("div",{className:ie(`${g}-container`,v,U),style:{width:X?"100%":void 0,...$},children:se}),te]});return s.jsx(gr.Provider,{value:{...x,listName:[O.listName,b,x.name].filter(fe=>fe!==void 0).flat(1)},children:ae})},g0=e=>{const t=Ne(),{creatorButtonProps:n,prefixCls:r,children:a,creatorRecord:i,action:o,fields:l,actionGuard:u,max:m,fieldExtraRender:g,meta:f,containerClassName:h,containerStyle:p,onAfterAdd:S,onAfterRemove:y}=e,{hashId:w}=d.useContext(Xt),T=d.useRef(new Map),[x,C]=d.useState(!1),j=d.useMemo(()=>l.map(D=>{var U,Y,O;(U=T.current)!=null&&U.has(D.key.toString())||(Y=T.current)==null||Y.set(D.key.toString(),Gr());const M=(O=T.current)==null?void 0:O.get(D.key.toString());return{...D,uuid:M}}),[l]),b=d.useMemo(()=>{const D={...o},M=j.length;return u!=null&&u.beforeAddRow?D.add=async(...U)=>{if(await u.beforeAddRow(...U,M)){const O=o.add(...U);return S==null||S(...U,M+1),O}return!1}:D.add=async(...U)=>{const Y=o.add(...U);return S==null||S(...U,M+1),Y},u!=null&&u.beforeRemoveRow?D.remove=async(...U)=>{if(await u.beforeRemoveRow(...U,M)){const O=o.remove(...U);return y==null||y(...U,M-1),O}return!1}:D.remove=async(...U)=>{const Y=o.remove(...U);return y==null||y(...U,M-1),Y},D},[o,u==null?void 0:u.beforeAddRow,u==null?void 0:u.beforeRemoveRow,S,y,j.length]),v=d.useMemo(()=>{if(n===!1||j.length===m)return null;const{position:D="bottom",creatorButtonText:M=t.getMessage("editableTable.action.add","添加一行数据")}=n||{};return s.jsx(c.Button,{className:ie(`${r}-creator-button-${D}`,w),type:"dashed",loading:x,block:!0,icon:s.jsx(de.PlusOutlined,{}),...Ze(n||{},["position","creatorButtonText"]),onClick:async()=>{C(!0);let U=j.length;D==="top"&&(U=0),await b.add(vt(i)??{},U),C(!1)},children:M})},[n,j.length,m,t,r,w,x,b,i]),$=d.useContext(ss),E={width:"max-content",maxWidth:"100%",minWidth:"100%",...p},R=d.useMemo(()=>j.map((D,M)=>d.createElement(h0,{...e,key:D.uuid,field:D,index:M,action:b,count:j.length},a)),[a,e,j,b]);return $.mode==="read"||e.readonly===!0?s.jsx(s.Fragment,{children:R}):s.jsxs("div",{style:E,className:h,children:[n!==!1&&(n==null?void 0:n.position)==="top"&&v,R,g&&g(b,f),n!==!1&&(n==null?void 0:n.position)!=="top"&&v]})},p0=e=>({[`${e.antCls}-pro`]:{[`${e.antCls}-form:not(${e.antCls}-form-horizontal)`]:{[e.componentCls]:{[`&-item:not(${e.componentCls}-item-show-label)`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},[e.componentCls]:{boxSizing:"border-box",maxWidth:"100%","&-item":{"&&-show-label":{[`${e.antCls}-form-item-label`]:{display:"inline-block"}},"&&-default:first-child":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"inline-block"}}}},"&&-default:not(:first-child)":{"div:first-of-type":{[`${e.antCls}-form-item`]:{[`${e.antCls}-form-item-label`]:{display:"none"}}}}},"&-action":{display:"flex",height:e.controlHeight,marginBlockEnd:e.marginLG,lineHeight:e.controlHeight+"px","&-small":{height:e.controlHeightSM,lineHeight:e.controlHeightSM}},"&-action-icon":{marginInlineStart:8,cursor:"pointer",transition:"color 0.3s ease-in-out","&:hover":{color:e.colorPrimaryTextHover}},[`${e.proComponentsCls}-card ${e.proComponentsCls}-card-extra`]:{[e.componentCls]:{"&-action":{marginBlockEnd:0}}},"&-creator-button-top":{marginBlockEnd:24}}});function y0(e){return tt("ProFormList",t=>{const n={...t,componentCls:`.${e}`};return[p0(n)]})}const{noteOnce:Dc}=st,gr=d.createContext({});function x0(e){const t=d.useRef(),n=d.useContext(c.ConfigProvider.ConfigContext),r=d.useContext(gr),a=n.getPrefixCls("pro-form-list"),i=Ne(),{setFieldValueType:o}=d.useContext(wr),{transform:l,actionRender:u,creatorButtonProps:m,label:g,alwaysShowItemLabel:f,tooltip:h,creatorRecord:p,itemRender:S,rules:y,itemContainerRender:w,fieldExtraRender:T,copyIconProps:x={Icon:de.CopyOutlined,tooltipText:i.getMessage("copyThisLine","复制此项")},children:C,deleteIconProps:j={Icon:de.DeleteOutlined,tooltipText:i.getMessage("deleteThisLine","删除此项")},arrowSort:b,upIconProps:v={Icon:de.ArrowUpOutlined,tooltipText:i.getMessage("sortUpThisLine","向上排序")},downIconProps:$={Icon:de.ArrowDownOutlined,tooltipText:i.getMessage("sortDownThisLine","向下排序")},actionRef:E,style:R,prefixCls:D,actionGuard:M,min:U,max:Y,colProps:O,wrapperCol:I,rowProps:F,onAfterAdd:A,onAfterRemove:k,isValidateList:B=!1,emptyListMessage:G="列表不能为空",className:_,containerClassName:H,containerStyle:Z,readonly:q,...V}=e,{ColWrapper:L,RowWrapper:K}=Cr({colProps:O,rowProps:F}),P=d.useContext(es),W=d.useMemo(()=>r.name===void 0?[V.name].flat(1):[r.name,V.name].flat(1),[r.name,V.name]);d.useImperativeHandle(E,()=>({...t.current,get:X=>P.formRef.current.getFieldValue([...W,X]),getList:()=>P.formRef.current.getFieldValue([...W])}),[W,P.formRef]),d.useEffect(()=>{Dc(!!P.formRef,"ProFormList 必须要放到 ProForm 中,否则会造成行为异常。"),Dc(!!P.formRef,"Proformlist must be placed in ProForm, otherwise it will cause abnormal behavior.")},[P.formRef]),d.useEffect(()=>{!o||!e.name||o([e.name].flat(1).filter(X=>X!==void 0),{valueType:"formList",transform:l})},[e.name,o,l]);const{wrapSSR:te,hashId:re}=y0(a);return P.formRef?te(s.jsx(L,{children:s.jsx("div",{className:ie(a,re),style:R,children:s.jsx(c.Form.Item,{label:g,prefixCls:D,tooltip:h,style:R,required:y==null?void 0:y.some(X=>X.required),wrapperCol:I,className:_,...V,name:B?W:void 0,rules:B?[{validator:(X,se)=>!se||se.length===0?Promise.reject(new Error(G)):Promise.resolve(),required:!0}]:void 0,children:s.jsx(c.Form.List,{rules:y,...V,name:W,children:(X,se,ae)=>(t.current=se,s.jsxs(K,{children:[s.jsx(g0,{name:W,readonly:!!q,originName:V.name,copyIconProps:x,deleteIconProps:j,arrowSort:b,upIconProps:v,downIconProps:$,formInstance:P.formRef.current,prefixCls:a,meta:ae,fields:X,itemContainerRender:w,itemRender:S,fieldExtraRender:T,creatorButtonProps:m,creatorRecord:p,actionRender:u,action:se,actionGuard:M,alwaysShowItemLabel:f,min:U,max:Y,count:X.length,onAfterAdd:(ue,pe,me)=>{B&&P.formRef.current.validateFields([W]),A==null||A(ue,pe,me)},onAfterRemove:(ue,pe)=>{B&&pe===0&&P.formRef.current.validateFields([W]),k==null||k(ue,pe)},containerClassName:H,containerStyle:Z,children:C}),s.jsx(c.Form.ErrorList,{errors:ae.errors})]}))})})})})):null}const wa=({name:e,originDependencies:t=e,children:n,ignoreFormListField:r,...a})=>{const i=d.useContext(es),o=d.useContext(gr),l=d.useMemo(()=>e.map(u=>{var g;const m=[u];return!r&&o.name!==void 0&&((g=o.listName)!=null&&g.length)&&m.unshift(o.listName),m.flat(1)}),[o.listName,o.name,r,e==null?void 0:e.toString()]);return s.jsx(c.Form.Item,{...a,noStyle:!0,shouldUpdate:(u,m,g)=>{var f;return typeof a.shouldUpdate=="boolean"?a.shouldUpdate:typeof a.shouldUpdate=="function"?(f=a.shouldUpdate)==null?void 0:f.call(a,u,m,g):l.some(h=>!vn(Be(u,h),Be(m,h)))},children:u=>{var g,f;let m={};for(let h=0;h<e.length;h++){const p=l[h],S=t[h];let y=(g=i.getFieldFormatValueObject)==null?void 0:g.call(i,p);y&&Object.keys(y).length?(m=aa({},m,y),Be(y,p)&&(m=Qe(m,[S].flat(1),Be(y,p)))):(y=(f=u.getFieldValue)==null?void 0:f.call(u,p),typeof y<"u"&&(m=Qe(m,[S].flat(1),y)))}return n==null?void 0:n(m,{...u,...i})}})};wa.displayName="ProFormDependency";const b0=d.createContext({}),S0=e=>{var T,x,C;const{children:t,onChange:n,onBlur:r,ignoreFormItem:a,valuePropName:i="value",...o}=e,l=((T=t==null?void 0:t.type)==null?void 0:T.displayName)!=="ProFormComponent",u=!d.isValidElement(t),m=je(function(...j){var b,v,$,E,R;n==null||n(...j),!l&&(u||((v=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||v.call(b,...j),(R=(E=($=t==null?void 0:t.props)==null?void 0:$.fieldProps)==null?void 0:E.onChange)==null||R.call(E,...j)))}),g=je(function(...j){var b,v,$,E,R;l||u||(r==null||r(...j),(v=(b=t==null?void 0:t.props)==null?void 0:b.onBlur)==null||v.call(b,...j),(R=(E=($=t==null?void 0:t.props)==null?void 0:$.fieldProps)==null?void 0:E.onBlur)==null||R.call(E,...j))}),f=St(()=>{var j;return Ze(((j=t==null?void 0:t.props)==null?void 0:j.fieldProps)||{},["onBlur","onChange"])},[Ze(((x=t==null?void 0:t.props)==null?void 0:x.fieldProps)||{},["onBlur","onChange"])]),h=e[i],p=d.useMemo(()=>{if(!l&&!u)return xt({id:o.id,[i]:h,...f,onBlur:g,onChange:m})},[h,f,g,m,o.id,i]),S=d.useMemo(()=>{if(!p&&d.isValidElement(t))return(...j)=>{var b,v;n==null||n(...j),(v=(b=t==null?void 0:t.props)==null?void 0:b.onChange)==null||v.call(b,...j)}},[p,t,n]);if(!d.isValidElement(t))return s.jsx(s.Fragment,{children:t});const y=o.variant,w=o.fieldProps;return d.cloneElement(t,xt({...o,[i]:e[i],...t.props,onChange:S,...!l&&p?{fieldProps:{...(C=t.props)==null?void 0:C.fieldProps,...w,...p}}:{},...y!==void 0&&{variant:y},onBlur:l&&!u&&typeof r=="function"?r:void 0}))},Pc=({children:e,addonAfter:t,addonBefore:n,valuePropName:r,addonWarpStyle:a,convertValue:i,help:o,...l})=>{const u=d.useMemo(()=>{let m=g=>{const f=(i==null?void 0:i(g,l.name))??g;return l.getValueProps?l.getValueProps(f):{[r||"value"]:f}};return!i&&!l.getValueProps&&(m=void 0),!t&&!n?s.jsx(c.Form.Item,{...l,valuePropName:r,getValueProps:m,children:e}):s.jsx(c.Form.Item,{...l,help:typeof o!="function"?o:void 0,valuePropName:r,_internalItemRender:{mark:"pro_table_render",render:(g,f)=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",...a},children:[n?s.jsx("div",{style:{marginInlineEnd:8},children:n}):null,f.input,t?s.jsx("div",{style:{marginInlineStart:8},children:t}):null]}),typeof o=="function"?o({errors:g.errors,warnings:g.warnings}):f.errorList,f.extra]})},...l,getValueProps:m,children:e})},[t,n,e,i==null?void 0:i.toString(),l]);return s.jsx(b0.Provider,{value:{name:l.name,label:l.label},children:u})},Nd=e=>{var j,b,v,$,E,R;const{componentSize:t}=((b=(j=c.ConfigProvider)==null?void 0:j.useConfig)==null?void 0:b.call(j))||{componentSize:"middle"},n=t,{valueType:r,transform:a,dataFormat:i,ignoreFormItem:o,lightProps:l,children:u,fieldProps:m,...g}=e,f=d.useContext(gr),h=d.useMemo(()=>e.name===void 0?e.name:f.name!==void 0?[f.name,e.name].flat(1):Array.isArray(e.name)?e.name:[e.name],[f.name,e.name]),{setFieldValueType:p,formItemProps:S}=d.useContext(wr);d.useEffect(()=>{!p||!e.name||p(h,{valueType:r||"text",dateFormat:i,transform:a})},[h,i,e.name,p,a,r]);const y=d.isValidElement(e.children)&&Hp(r||e.children.props.valueType),w=d.useMemo(()=>!!(!(l!=null&&l.light)||l!=null&&l.customLightMode||y),[l==null?void 0:l.customLightMode,y,l==null?void 0:l.light]);if(typeof e.children=="function")return d.createElement(Pc,{...g,name:h,key:g.proFormFieldKey||((v=g.name)==null?void 0:v.toString())},e.children);const T=s.jsx(S0,{valuePropName:e.valuePropName,children:e.children},g.proFormFieldKey||(($=g.name)==null?void 0:$.toString())),x=xt(l||{}),C=w?T:d.createElement(I0,{...x,key:g.proFormFieldKey||((E=g.name)==null?void 0:E.toString()),size:n},T);return o?s.jsx(s.Fragment,{children:C}):s.jsx(Pc,{...S,...g,name:h,isListField:f.name!==void 0,children:C},g.proFormFieldKey||((R=g.name)==null?void 0:R.toString()))},Nc={xs:104,s:216,sm:216,m:328,md:328,l:440,lg:440,xl:552},C0=["switch","radioButton","radio","rate"];function ur(e,t){e.displayName="ProFormComponent";const n=a=>{const{valueType:i,customLightMode:o,lightFilterLabelFormatter:l,valuePropName:u="value",ignoreWidth:m,defaultProps:g,...f}={...a==null?void 0:a.fieldConfig,...t},{label:h,tooltip:p,placeholder:S,width:y,bordered:w,messageVariables:T,ignoreFormItem:x,transform:C,convertValue:j,readonly:b,allowClear:v,colSize:$,getFormItemProps:E,getFieldProps:R,fieldConfig:D,cacheForSwr:M,proFieldProps:U,...Y}={...g,...a},O=i||Y.valueType,I=d.useMemo(()=>m||C0.includes(O),[m,O]),[,F]=d.useState(),[A,k]=d.useState(),B=d.useContext(wr),G=St(()=>({formItemProps:E==null?void 0:E(),fieldProps:R==null?void 0:R()}),[R,E,Y.dependenciesValues,A]),_=St(()=>{const ue={...x?xt({value:Y.value}):{},placeholder:S,disabled:a.disabled,...B.fieldProps,...G.fieldProps,...Y.fieldProps};return ue.style=xt(ue==null?void 0:ue.style),ue},[x,Y.value,Y.fieldProps,S,a.disabled,B.fieldProps,G.fieldProps]),H=Jp(Y),Z=St(()=>({...B.formItemProps,...H,...G.formItemProps,...Y.formItemProps}),[G.formItemProps,B.formItemProps,Y.formItemProps,H]),q=St(()=>({messageVariables:T,...f,...Z}),[f,Z,T]),{prefixName:V}=d.useContext(Hn),L=St(()=>{let ue=q==null?void 0:q.name;return Array.isArray(ue)&&(ue=ue.join("_")),Array.isArray(V)&&ue&&(ue=`${V.join(".")}.${ue}`),ue&&`form-${B.formKey??""}-field-${ue}`},[wn(q==null?void 0:q.name),V,B.formKey]),K=je((...ue)=>{var pe;E||R?k([]):Y.formItemRender&&F([]),(pe=_==null?void 0:_.onChange)==null||pe.call(_,...ue)}),P=St(()=>{const ue={width:y&&!Nc[y]?y:B.grid?"100%":void 0,..._==null?void 0:_.style};return I&&Reflect.deleteProperty(ue,"width"),xt(ue)},[wn(_==null?void 0:_.style),B.grid,I,y]),W=St(()=>{const ue=y&&Nc[y];return ie(_==null?void 0:_.className,{"pro-field":ue,[`pro-field-${y}`]:ue&&!I})||void 0},[y,_==null?void 0:_.className,I]),te=St(()=>xt({...B.proFieldProps,mode:Y==null?void 0:Y.mode,readonly:b,params:Y.params,proFieldKey:L,cacheForSwr:M,...U}),[B.proFieldProps,Y==null?void 0:Y.mode,Y.params,b,L,M,U]),re=St(()=>({onChange:K,allowClear:v,..._,style:P,className:W}),[v,W,K,_,P]),X=St(()=>s.jsx(e,{...Y,fieldProps:re,proFieldProps:te,ref:a==null?void 0:a.fieldRef},a.proFormFieldKey||a.name),[te,re,Y]),se=St(()=>{var ue,pe,me;return s.jsx(Nd,{label:h&&(U==null?void 0:U.light)!==!0?h:void 0,tooltip:(U==null?void 0:U.light)!==!0&&p,valuePropName:u,...q,ignoreFormItem:x,transform:C,dataFormat:_==null?void 0:_.format,valueType:O,messageVariables:{label:h||"",...q==null?void 0:q.messageVariables},convertValue:j,lightProps:xt({..._,variant:Y.variant??(_==null?void 0:_.variant),valueType:O,bordered:w,allowClear:((ue=X==null?void 0:X.props)==null?void 0:ue.allowClear)??v,light:U==null?void 0:U.light,label:h,customLightMode:o,labelFormatter:l,valuePropName:u,footerRender:(pe=X==null?void 0:X.props)==null?void 0:pe.footerRender,...Y.lightProps,...q.lightProps}),children:X},a.proFormFieldKey||((me=q.name)==null?void 0:me.toString()))},[h,U==null?void 0:U.light,p,u,a.proFormFieldKey,q,x,C,_,O,j,w,X,v,o,l,Y.lightProps]),{ColWrapper:ae}=Cr(Y);return s.jsx(ae,{children:se})};return a=>{const{dependencies:i}=a;return i?s.jsx(wa,{name:i,originDependencies:a==null?void 0:a.originDependencies,children:o=>s.jsx(n,{dependenciesValues:o,dependencies:i,...a})}):s.jsx(n,{dependencies:i,...a})}}var Ur=function(){return Ur=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Ur.apply(this,arguments)};function w0(e){var t,n=(typeof window<"u"?window:{}).URL,r=new n((t=window==null?void 0:window.location)===null||t===void 0?void 0:t.href);return Object.keys(e).forEach(function(a){var i=e[a];i!=null?Array.isArray(i)?(r.searchParams.delete(a),i.forEach(function(o){r.searchParams.append(a,o)})):i instanceof Date?Number.isNaN(i.getTime())||r.searchParams.set(a,i.toISOString()):typeof i=="object"?r.searchParams.set(a,JSON.stringify(i)):r.searchParams.set(a,i):r.searchParams.delete(a)}),r}function j0(e,t){var n;e===void 0&&(e={}),t===void 0&&(t={disabled:!1});var r=d.useState(),a=r[1],i=typeof window<"u"&&((n=window==null?void 0:window.location)===null||n===void 0?void 0:n.search),o=d.useMemo(function(){return t.disabled?{}:new URLSearchParams(i||{})},[t.disabled,i]),l=d.useMemo(function(){if(t.disabled)return{};if(typeof window>"u"||!window.URL)return{};var g=[];o.forEach(function(h,p){g.push({key:p,value:h})}),g=g.reduce(function(h,p){return(h[p.key]=h[p.key]||[]).push(p),h},{}),g=Object.keys(g).map(function(h){var p=g[h];return p.length===1?[h,p[0].value]:[h,p.map(function(S){var y=S.value;return y})]});var f=Ur({},e);return g.forEach(function(h){var p=h[0],S=h[1];f[p]=T0(p,S,{},e)}),f},[t.disabled,e,o]);function u(g){if(!(typeof window>"u"||!window.URL)){var f=w0(g);window.location.search!==f.search&&window.history.replaceState({},"",f.toString()),o.toString()!==f.searchParams.toString()&&a({})}}d.useEffect(function(){t.disabled||typeof window>"u"||!window.URL||u(Ur(Ur({},e),l))},[t.disabled,l]);var m=function(g){u(g)};return d.useEffect(function(){if(t.disabled)return function(){};if(typeof window>"u"||!window.URL)return function(){};var g=function(){a({})};return window.addEventListener("popstate",g),function(){window.removeEventListener("popstate",g)}},[t.disabled]),[l,m]}var v0={true:!0,false:!1};function T0(e,t,n,r){if(!n)return t;var a=n[e],i=t===void 0?r[e]:t;return a===Number?Number(i):a===Boolean||t==="true"||t==="false"?v0[i]:Array.isArray(a)?a.find(function(o){return o==i})||r[e]:i}const F0=e=>{const t=Ne(),n=c.Form.useFormInstance();if(e.render===!1)return null;const{onSubmit:r,render:a,onReset:i,searchConfig:o={},submitButtonProps:l,resetButtonProps:u}=e,{token:m}=jn.useToken(),g=()=>{n.submit(),r==null||r()},f=()=>{n.resetFields(),i==null||i()},{submitText:h=t.getMessage("tableForm.submit","提交"),resetText:p=t.getMessage("tableForm.reset","重置")}=o,S=[];u!==!1&&S.push(d.createElement(c.Button,{...Ze(u??{},["preventDefault","fieldProps"]),key:"rest",onClick:w=>{var T;u!=null&&u.preventDefault||f(),(T=u==null?void 0:u.onClick)==null||T.call(u,w)}},p)),l!==!1&&S.push(d.createElement(c.Button,{type:"primary",...Ze(l||{},["preventDefault","fieldProps"]),key:"submit",onClick:w=>{var T;l!=null&&l.preventDefault||g(),(T=l==null?void 0:l.onClick)==null||T.call(l,w)}},h));const y=a?a({...e,form:n,submit:g,reset:f},S):S;return y?Array.isArray(y)?(y==null?void 0:y.length)<1?null:(y==null?void 0:y.length)===1?y[0]:s.jsx("div",{style:{display:"flex",gap:m.marginXS,alignItems:"center"},children:y}):y:null},{noteOnce:Lc}=st,Gs=(e,t,n)=>e===!0?t:vt(e,t,n),Ms=e=>!e||Array.isArray(e)?e:[e],Ld={};function $0(e){var B,G;const{children:t,contentRender:n,submitter:r,fieldProps:a,formItemProps:i,groupProps:o,transformKey:l,formRef:u,onInit:m,form:g,loading:f,formComponentType:h,extraUrlParams:p=Ld,syncToUrl:S,onUrlSearchChange:y,onReset:w,omitNil:T=!0,isKeyPressSubmit:x,autoFocusFirstInput:C=!0,grid:j,rowProps:b,colProps:v,...$}=e,E=c.Form.useFormInstance(),{componentSize:R}=((G=(B=c.ConfigProvider)==null?void 0:B.useConfig)==null?void 0:G.call(B))||{componentSize:"middle"},D=d.useRef(g||E),{RowWrapper:M}=Cr({grid:j,rowProps:b}),U=je(()=>E),Y=d.useMemo(()=>({getFieldsFormatValue:(_,H)=>{const Z=U();if(!Z)return{};const q=Z.getFieldsValue(_);return l(q,H!==void 0?H:T)},getFieldFormatValue:(_=[],H)=>{const Z=U();if(!Z)return;const q=Ms(_);if(!q)throw new Error("nameList is require");const V=Z.getFieldValue(q),L=q?Qe({},q,V):V,K=[...q];K.shift();const P=l(L,H!==void 0?H:T,K),W=Be(P,q);if(W&&typeof W=="object"&&!Array.isArray(W)){const te=Object.values(W)[0];return Array.isArray(te),te}return W},getFieldFormatValueObject:(_,H)=>{const Z=U();if(!Z)return{};const q=Ms(_),V=Z.getFieldValue(q),L=q?Qe({},q,V):V;return l(L,H!==void 0?H:T,q)},validateFieldsReturnFormatValue:async(_,H)=>{const Z=U();if(!Z)return{};if(!Array.isArray(_)&&_)throw new Error("nameList must be array");const q=await Z.validateFields(_),V=l(q,H!==void 0?H:T);return V||{}}}),[T,l,U]),O=d.useMemo(()=>d.Children.toArray(t).map((_,H)=>H===0&&d.isValidElement(_)&&C?mo(_,C):_),[C,t]),I=d.useMemo(()=>typeof r=="boolean"||!r?{}:r,[r]),F=d.useMemo(()=>{if(r!==!1)return s.jsx(F0,{...I,onReset:()=>{var H,Z,q;const _=l((H=D.current)==null?void 0:H.getFieldsValue(),T);if((Z=I==null?void 0:I.onReset)==null||Z.call(I,_),w==null||w(_),S){const V=Object.keys(l((q=D.current)==null?void 0:q.getFieldsValue(),!1)).reduce((L,K)=>({...L,[K]:_[K]||void 0}),p);y(Gs(S,V||{},"set"))}},submitButtonProps:{loading:f,...I.submitButtonProps}},"submitter")},[r,I,f,l,T,w,S,p,y]),A=d.useMemo(()=>{const _=j?s.jsx(M,{children:O}):O;return n?n(_,F,D.current):_},[j,M,O,n,F]),k=Vr(e.initialValues);return d.useEffect(()=>{if(S||!e.initialValues||!k||$.request)return;const _=vn(e.initialValues,k);Lc(_,"initialValues 只在 form 初始化时生效,如果你需要异步加载推荐使用 request,或者 initialValues ? <Form/> : null "),Lc(_,"The initialValues only take effect when the form is initialized, if you need to load asynchronously recommended request, or the initialValues ? <Form/> : null ")},[e.initialValues]),d.useImperativeHandle(u,()=>({...D.current,getFieldsFormatValue:(_,H)=>{const Z=D.current;if(!Z)return{};const q=Z.getFieldsValue(_);return l(q,H!==void 0?H:T)},getFieldFormatValue:(_=[],H)=>{const Z=D.current;if(!Z)return;const q=Ms(_);if(!q)throw new Error("nameList is require");const V=Z.getFieldValue(q),L=q?Qe({},q,V):V,K=[...q];K.shift();const P=l(L,H!==void 0?H:T,K),W=Be(P,q);if(W&&typeof W=="object"&&!Array.isArray(W)){const te=Object.values(W)[0];return Array.isArray(te),te}return W},getFieldFormatValueObject:(_,H)=>{const Z=D.current;if(!Z)return{};const q=Ms(_),V=Z.getFieldValue(q),L=q?Qe({},q,V):V;return l(L,H!==void 0?H:T,q)},validateFieldsReturnFormatValue:async(_,H)=>{const Z=D.current;if(!Z)return{};if(!Array.isArray(_)&&_)throw new Error("nameList must be array");const q=await Z.validateFields(_),V=l(q,H!==void 0?H:T);return V||{}}}),[T,l,D.current]),d.useEffect(()=>{var H,Z;const _=l((Z=(H=D.current)==null?void 0:H.getFieldsValue)==null?void 0:Z.call(H,!0),T);m==null||m(_,{...D.current,...Y})},[]),s.jsx(es.Provider,{value:{...Y,formRef:D},children:s.jsx(c.ConfigProvider,{componentSize:$.size||R,children:s.jsxs(To.Provider,{value:{grid:j,colProps:v},children:[$.component!==!1&&s.jsx("input",{type:"text",style:{display:"none"}}),A]})})})}let _c=0;function jr(e){const{extraUrlParams:t=Ld,syncToUrl:n,isKeyPressSubmit:r,syncToUrlAsImportant:a=!1,syncToInitialValues:i=!0,children:o,contentRender:l,submitter:u,fieldProps:m,proFieldProps:g,formItemProps:f,groupProps:h,dateFormatter:p="string",formRef:S,onInit:y,form:w,formComponentType:T,onReset:x,grid:C,rowProps:j,colProps:b,omitNil:v=!0,request:$,params:E,initialValues:R,formKey:D=_c,readonly:M,onLoadingChange:U,loading:Y,...O}=e,I=d.useRef({}),[F,A]=dt(!1,Y),k=je(me=>{U==null||U(me)}),B=d.useCallback(me=>{A(fe=>{const ye=typeof me=="function"?me(fe):me;return queueMicrotask(()=>{k(ye)}),ye})},[k]),[G,_]=j0({},{disabled:!n}),H=d.useRef(Gr());d.useEffect(()=>{_c+=0},[]);const[Z,q]=_p({request:$,params:E,proFieldKey:D}),{getPrefixCls:V}=d.useContext(c.ConfigProvider.ConfigContext),L=V("pro-form"),{wrapSSR:K,hashId:P}=tt("ProForm",me=>({[`.${L}`]:{[`> div:not(${me.proComponentsCls}-form-light-filter)`]:{".pro-field":{maxWidth:"100%","@media screen and (max-width: 575px)":{maxWidth:"calc(93vw - 48px)"},"&-xs":{width:104},"&-s":{width:216},"&-sm":{width:216},"&-m":{width:328},"&-md":{width:328},"&-l":{width:440},"&-lg":{width:440},"&-xl":{width:552}}}}})),[W,te]=d.useState(()=>n?Gs(n,G,"get"):{}),re=d.useRef({}),X=d.useRef({}),se=je((me,fe,ye)=>!me||typeof me!="object"?me:LC(Mi(me,p,X.current,fe,ye),re.current));d.useEffect(()=>{i||te({})},[i]);const ae=je(()=>({...G,...t}));d.useEffect(()=>{n&&_(Gs(n,ae(),"set"))},[t,ae,n]);const ue=d.useMemo(()=>{if(!(typeof window>"u")&&T&&["DrawerForm"].includes(T))return me=>me.parentNode||document.body},[T]),pe=je(async()=>{var me,fe,ye,Te;if(O.onFinish&&!F)try{B(!0);const Oe=((fe=(me=I==null?void 0:I.current)==null?void 0:me.getFieldsFormatValue)==null?void 0:fe.call(me))||{},Ae=O.onFinish(Oe);if(Ae&&typeof Ae=="object"&&typeof Ae.then=="function"){try{await Ae}catch(ze){throw B(!1),ze}B(!1)}else B(!1);if(n){const ze=Object.keys(((Te=(ye=I==null?void 0:I.current)==null?void 0:ye.getFieldsFormatValue)==null?void 0:Te.call(ye,!0,!1))||{}).reduce((ce,z)=>({...ce,[z]:Oe[z]??void 0}),t);Object.keys(G).forEach(ce=>{ze[ce]!==!1&&ze[ce]!==0&&!ze[ce]&&(ze[ce]=void 0)}),_(Gs(n,ze,"set"))}}catch{B(!1)}});return d.useImperativeHandle(S,()=>I.current,[!Z]),$&&q?s.jsx("div",{style:{paddingTop:50,paddingBottom:50,textAlign:"center"},children:s.jsx(c.Spin,{})}):K(s.jsx(ss.Provider,{value:{mode:e.readonly?"read":"edit"},children:s.jsx(Bn,{needDeps:!0,children:s.jsx(wr.Provider,{value:{formRef:I,fieldProps:m,proFieldProps:g,formItemProps:f,groupProps:h,formComponentType:T,getPopupContainer:ue,formKey:H.current,setFieldValueType:(me,{valueType:fe="text",dateFormat:ye,transform:Te})=>{Array.isArray(me)&&(Te&&(re.current=Qe(re.current,me,Te)),X.current=Qe(X.current,me,{valueType:fe,dateFormat:ye}))}},children:s.jsx(gr.Provider,{value:{},children:s.jsx(c.Form,{onKeyDown:me=>{var fe;r&&me.key==="Enter"&&((fe=I.current)==null||fe.submit())},autoComplete:"off",form:w,...Ze(O,["ref","labelWidth","autoFocusFirstInput","rootClassName"]),ref:me=>{I.current&&(I.current.nativeElement=me==null?void 0:me.nativeElement,I.current.focus=()=>{var ye;const fe=(ye=me==null?void 0:me.nativeElement)==null?void 0:ye.querySelector("input, textarea, select");fe==null||fe.focus()})},initialValues:a?{...R,...Z,...W}:{...W,...R,...Z},onValuesChange:(me,fe)=>{var ye;(ye=O==null?void 0:O.onValuesChange)==null||ye.call(O,se(me,!!v),se(fe,!!v))},className:e.className,rootClassName:ie(L,P,e.rootClassName),onFinish:pe,children:s.jsx($0,{transformKey:se,autoComplete:"off",loading:F||!!($&&!Z&&q),onUrlSearchChange:_,...e,formRef:I,initialValues:{...R,...Z}})})})})})}))}const E0=e=>({[`${e.componentCls}-collapse-label`]:{boxSizing:"border-box",paddingInline:1,paddingBlock:1},[`${e.componentCls}-container`]:{boxSizing:"border-box",[`${e.antCls}-form-item`]:{marginBlockEnd:0}}});function R0(e){return tt("LightWrapper",t=>{const n={...t,componentCls:`.${e}`};return[E0(n)]})}const I0=e=>{var Y;const{label:t,size:n,disabled:r,onChange:a,className:i,style:o,children:l,valuePropName:u,placeholder:m,labelFormatter:g,variant:f,footerRender:h,allowClear:p,otherFieldProps:S,valueType:y,placement:w,...T}=e,{getPrefixCls:x}=d.useContext(c.ConfigProvider.ConfigContext),C=x("pro-field-light-wrapper"),{wrapSSR:j,hashId:b}=R0(C),[v,$]=d.useState(e[u]),[E,R]=d.useState(!1),D=(...O)=>{var I;(I=S==null?void 0:S.onChange)==null||I.call(S,...O),a==null||a(...O)},M=e[u],U=d.useMemo(()=>{var I;if(!M)return M;const O=(I=y==null?void 0:y.toLowerCase)==null?void 0:I.call(y);return O!=null&&O.endsWith("range")&&O!=="digitrange"&&!g?Ip(M,y&&ho[y]||"YYYY-MM-DD"):Array.isArray(M)?M.map(F=>typeof F=="object"&&F.label&&F.value?F.label:F):M},[M,y,g]);return j(s.jsx(Hu,{disabled:r,open:E,onOpenChange:R,placement:w,label:s.jsx(Qt,{ellipsis:!0,size:n,onClear:()=>{D==null||D(),$(null)},variant:f,style:o,className:i,label:t,placeholder:m,value:U,disabled:r,formatter:g,allowClear:p}),footer:{onClear:()=>$(null),onConfirm:()=>{D==null||D(v),R(!1)}},footerRender:h,children:s.jsx("div",{className:ie(`${C}-container`,b,i),style:o,children:d.cloneElement(l,{...T,[u]:v,onChange:O=>{$(O!=null&&O.target?O.target.value:O)},...l.props,variant:"borderless",fieldProps:{...(Y=l.props)==null?void 0:Y.fieldProps,variant:"borderless"}})})}))},M0=e=>{const{fieldProps:t,children:n,labelCol:r,label:a,autoFocus:i,isDefaultDom:o,render:l,proFieldProps:u,formItemRender:m,valueType:g,initialValue:f,onChange:h,valueEnum:p,params:S,name:y,dependenciesValues:w,cacheForSwr:T=!1,valuePropName:x="value",...C}=e,j=d.useContext(ss),b=d.useMemo(()=>w&&C.request?{...S,...w||{}}:S,[w,S,C.request]),v=je((...R)=>{var D;if(t!=null&&t.onChange){(D=t==null?void 0:t.onChange)==null||D.call(t,...R);return}}),$=d.useMemo(()=>({autoFocus:i,...t,onChange:v}),[i,t,v]),E=d.useMemo(()=>{if(n)return d.isValidElement(n)?d.cloneElement(n,{...C,onChange:(...R)=>{var D;if(t!=null&&t.onChange){(D=t==null?void 0:t.onChange)==null||D.call(t,...R);return}h==null||h(...R)},...(n==null?void 0:n.props)||{}}):s.jsx(s.Fragment,{children:n})},[n,t==null?void 0:t.onChange,h,C]);return E||s.jsx(Cj,{text:t==null?void 0:t[x],render:l,formItemRender:m,valueType:g||"text",cacheForSwr:T,fieldProps:$,valueEnum:vt(p),...u,...C,mode:(u==null?void 0:u.mode)||j.mode||"edit",params:b})},En=ur==null?void 0:ur(M0),A0=({fieldProps:e,min:t,proFieldProps:n,max:r,...a},i)=>s.jsx(Bn,{valueTypeMap:{digit:{render:(o,l)=>s.jsx(ia,{...l,text:o,placeholder:l.placeholder}),formItemRender:(o,l)=>s.jsx(ia,{...l,text:o,placeholder:l.placeholder})}},children:s.jsx(En,{valueType:"digit",fieldProps:{min:t,max:r,...e},ref:i,fieldConfig:{defaultProps:{width:"100%"}},proFieldProps:n,...a})}),k0=d.forwardRef(A0),O0={space:c.Space,group:c.Space.Compact};function D0(e,...t){const n=t[0];return n&&n.target&&e in n.target?n.target[e]:n}const P0=e=>{const{children:t,value:n=[],valuePropName:r,onChange:a,fieldProps:i,space:o,type:l="space",transform:u,convertValue:m,lightProps:g,...f}=e,h=je((x,C)=>{var b;const j=[...n];j[C]=D0(r||"value",x),a==null||a(j),(b=i==null?void 0:i.onChange)==null||b.call(i,j)});let p=-1;const S=Tn(vt(t,n,e)).map(x=>{var C,j,b;if(d.isValidElement(x)){p+=1;const v=p,E=((C=x==null?void 0:x.type)==null?void 0:C.displayName)==="ProFormComponent"||((j=x==null?void 0:x.props)==null?void 0:j.readonly)?{key:v,ignoreFormItem:!0,...x.props||{},fieldProps:{...(b=x==null?void 0:x.props)==null?void 0:b.fieldProps,onChange:(...R)=>{h(R[0],v)}},value:n==null?void 0:n[v],onChange:void 0}:{key:v,...x.props||{},value:n==null?void 0:n[v],onChange:R=>{var D,M;h(R,v),(M=(D=x.props).onChange)==null||M.call(D,R)}};return d.cloneElement(x,E)}return x}),y=O0[l],{RowWrapper:w}=Cr(f),T=d.useCallback(({children:x})=>{const C={...o,align:"start"};return l==="space"&&(o==null?void 0:o.wrap)!==void 0&&(C.wrap=o.wrap),s.jsx(y,{...C,children:x})},[y,o,l]);return s.jsx(w,{Wrapper:T,children:S})},N0=d.forwardRef(({children:e,space:t,valuePropName:n,...r},a)=>(d.useImperativeHandle(a,()=>({})),s.jsx(P0,{space:t,valuePropName:n,...r.fieldProps,onChange:void 0,...r,children:e}))),L0=ur==null?void 0:ur(N0),_0=e=>({[e.componentCls]:{boxSizing:"border-box","&-title":{marginBlockEnd:e.marginXL,fontWeight:"bold"},"&-container":{flexWrap:"wrap",maxWidth:"100%",[`> div${e.antCls}-space-item`]:{maxWidth:"100%"}},"&-twoLine":{display:"block",width:"100%",[`${e.componentCls}-title`]:{width:"100%",margin:"8px 0"},[`${e.componentCls}-container`]:{paddingInlineStart:16},[`${e.antCls}-space-item,${e.antCls}-form-item`]:{width:"100%"},[`${e.antCls}-form-item`]:{"&-control":{display:"flex",alignItems:"center",justifyContent:"flex-end","&-input":{alignItems:"center",justifyContent:"flex-end","&-content":{flex:"none"}}}}}}});function z0(e){return tt("ProFormGroup",t=>{const n={...t,componentCls:`.${e}`};return[_0(n)]})}const _d=d.forwardRef((e,t)=>{const{groupProps:n}=d.useContext(wr),{children:r,collapsible:a,defaultCollapsed:i,style:o,labelLayout:l,title:u=e.label,tooltip:m,align:g="start",direction:f,size:h=32,titleStyle:p,titleRender:S,spaceProps:y,extra:w,autoFocus:T}={...n,...e},[x,C]=dt(()=>i||!1,e.collapsed),j=je(k=>{var B;(B=e.onCollapse)==null||B.call(e,k)}),b=d.useCallback(k=>{C(B=>{const G=typeof k=="function"?k(B):k;return queueMicrotask(()=>{j(G)}),G})},[j]),{getPrefixCls:v}=d.useContext(c.ConfigProvider.ConfigContext),{ColWrapper:$,RowWrapper:E}=Cr(e),R=v("pro-form-group"),{wrapSSR:D,hashId:M}=z0(R),U=a&&s.jsx(de.RightOutlined,{style:{marginInlineEnd:8},rotate:x?void 0:90}),Y=s.jsx(fr,{label:U?s.jsxs("div",{children:[U,u]}):u,tooltip:m}),O=d.useCallback(({children:k})=>s.jsx(c.Space,{...y,className:ie(`${R}-container ${M}`,y==null?void 0:y.className),size:h,align:g,orientation:f,style:{rowGap:0,...y==null?void 0:y.style},children:k}),[g,R,f,M,h,y]),I=S?S(Y,e):Y,[F,A]=d.useMemo(()=>{const k=[],B=d.Children.toArray(r).map((G,_)=>{var H;return d.isValidElement(G)&&((H=G==null?void 0:G.props)!=null&&H.hidden)?(k.push(G),null):_===0&&d.isValidElement(G)&&T?mo(G,T):G});return[s.jsx(E,{Wrapper:O,children:B},"children"),k.length>0?s.jsx("div",{style:{display:"none"},children:k},"hidden"):null]},[r,E,O,T]);return D(s.jsx($,{children:s.jsxs("div",{className:ie(R,M,{[`${R}-twoLine`]:l==="twoLine"}),style:o,ref:t,children:[A,(u||m||w)&&s.jsx("div",{role:"button",tabIndex:0,className:ie(`${R}-title`,M),style:p,onClick:()=>{b(!x)},onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),b(!x))},children:w?s.jsxs("div",{style:{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between"},children:[I,s.jsx("span",{role:"presentation",onClick:k=>k.stopPropagation(),onKeyDown:k=>k.stopPropagation(),children:w})]}):I}),s.jsx("div",{style:{display:a&&x?"none":void 0},children:F})]})}))});_d.displayName="ProForm-Group";const B0=e=>({[e.componentCls]:{boxSizing:"border-box","&-sidebar-dragger":{width:"5px",cursor:"ew-resize",padding:"4px 0 0",borderTop:"1px solid transparent",position:"absolute",top:0,left:0,bottom:0,zIndex:100,backgroundColor:"transparent","&-min-disabled":{cursor:"w-resize"},"&-max-disabled":{cursor:"e-resize"}}}});function V0(e){return tt("DrawerForm",t=>{const n={...t,componentCls:`.${e}`};return[B0(n)]})}const{noteOnce:H0}=st;function U0({children:e,trigger:t,drawerProps:n,onFinish:r,submitTimeout:a,title:i,width:o,resize:l,onOpenChange:u,open:m,...g}){var H,Z,q,V;H0(!g.footer||!(n!=null&&n.footer),"DrawerForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const f=d.useMemo(()=>{const L={onResize:()=>{},maxWidth:xo()?window.innerWidth*.8:void 0,minWidth:300};return typeof l=="boolean"?l?L:{}:xt({onResize:(l==null?void 0:l.onResize)??L.onResize,maxWidth:(l==null?void 0:l.maxWidth)??L.maxWidth,minWidth:(l==null?void 0:l.minWidth)??L.minWidth})},[l]),h=d.useContext(c.ConfigProvider.ConfigContext),p=h.getPrefixCls("pro-form-drawer"),{wrapSSR:S,hashId:y}=V0(p),w=L=>`${p}-${L}`,[,T]=d.useState([]),[x,C]=d.useState(!1),[j,b]=d.useState(!1),[v,$]=d.useState(o||(l?f==null?void 0:f.minWidth:800)),[E,R]=dt(!!m,m),D=je(L=>{u==null||u(L)}),M=d.useCallback(L=>{R(K=>{const P=typeof L=="function"?L(K):L;return queueMicrotask(()=>{D(P)}),P})},[D]),U=d.useRef(null),Y=d.useCallback(L=>{U.current===null&&L&&T([]),U.current=L},[]),O=d.useRef(),I=d.useCallback(()=>{var K;const L=((K=g.formRef)==null?void 0:K.current)??g.form??O.current;L&&(n!=null&&n.destroyOnHidden)&&typeof L.resetFields=="function"&&L.resetFields()},[n==null?void 0:n.destroyOnHidden,g.form,g.formRef]);d.useEffect(()=>{E&&m&&(u==null||u(!0)),j&&$(f==null?void 0:f.minWidth)},[m,E,j]),d.useImperativeHandle(g.formRef,()=>O.current,[O.current]);const F=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async L=>{var K,P;M(!E),b(!Object.keys(f)),(P=(K=t.props)==null?void 0:K.onClick)==null||P.call(K,L)}}):null,[M,t,E,b,j]),A=d.useMemo(()=>{var L,K,P,W;return g.submitter===!1?!1:ar({searchConfig:{submitText:((K=(L=h.locale)==null?void 0:L.Modal)==null?void 0:K.okText)??"确认",resetText:((W=(P=h.locale)==null?void 0:P.Modal)==null?void 0:W.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:a&&x,onClick:te=>{var re;M(!1),(re=n==null?void 0:n.onClose)==null||re.call(n,te)}}},g.submitter??{})},[g.submitter,(Z=(H=h.locale)==null?void 0:H.Modal)==null?void 0:Z.okText,(V=(q=h.locale)==null?void 0:q.Modal)==null?void 0:V.cancelText,a,x,M,n]),k=d.useCallback((L,K)=>s.jsxs(s.Fragment,{children:[L,U.current&&K?s.jsx(d.Fragment,{children:Gc.createPortal(K,U.current)},"submitter"):K]}),[]),B=je(async L=>{const K=r==null?void 0:r(L);if(a&&K instanceof Promise){C(!0);const W=setTimeout(()=>C(!1),a);try{const te=await K;return clearTimeout(W),C(!1),te&&M(!1),te}catch(te){throw clearTimeout(W),C(!1),te}}else if(a){C(!0);const W=setTimeout(()=>C(!1),a);try{const te=await K;return clearTimeout(W),C(!1),te&&M(!1),te}catch(te){throw clearTimeout(W),C(!1),te}}const P=await K;return P&&M(!1),P}),G=d.useCallback(L=>{const K=(document.body.offsetWidth||1e3)-(L.clientX-document.body.offsetLeft),P=(f==null?void 0:f.minWidth)??(o||800),W=(f==null?void 0:f.maxWidth)??window.innerWidth*.8;if(K<P){$(P);return}if(K>W){$(W);return}$(K)},[f==null?void 0:f.maxWidth,f==null?void 0:f.minWidth,o]),_=d.useCallback(()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",_)},[G]);return S(s.jsxs(s.Fragment,{children:[s.jsxs(c.Drawer,{...n,destroyOnHidden:n==null?void 0:n.destroyOnHidden,title:i,size:v,open:E,afterOpenChange:L=>{var K;!L&&(n!=null&&n.destroyOnHidden)&&I(),(K=n==null?void 0:n.afterOpenChange)==null||K.call(n,L),u==null||u(L)},onClose:L=>{var K;a&&x||(M(!1),(K=n==null?void 0:n.onClose)==null||K.call(n,L))},footer:g.submitter!==!1&&s.jsx("div",{ref:Y,style:{display:"flex",justifyContent:"flex-end"}}),children:[l?s.jsx("div",{className:ie(w("sidebar-dragger"),y,{[w("sidebar-dragger-min-disabled")]:v===(f==null?void 0:f.minWidth),[w("sidebar-dragger-max-disabled")]:v===(f==null?void 0:f.maxWidth)}),onMouseDown:L=>{var K;(K=f==null?void 0:f.onResize)==null||K.call(f),L.stopPropagation(),L.preventDefault(),document.addEventListener("mousemove",G),document.addEventListener("mouseup",_),b(!0)}}):null,s.jsx(s.Fragment,{children:s.jsx(jr,{formComponentType:"DrawerForm",layout:"vertical",...g,formRef:O,onInit:(L,K)=>{var P;g.formRef&&(g.formRef.current=K),(P=g==null?void 0:g.onInit)==null||P.call(g,L,K),O.current=K},submitter:A,onFinish:async L=>await B(L),contentRender:k,children:e})})]}),F]}))}const Y0=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"30px","&::before":{display:"block",height:0,visibility:"hidden",content:"'.'"},"&-small":{lineHeight:e.lineHeight},"&-container":{display:"flex",flexWrap:"wrap",gap:e.marginXS},"&-item":{whiteSpace:"nowrap",[`${e.antCls}-form-item`]:{marginBlock:0}},"&-line":{minWidth:"198px"},"&-line:not(:first-child)":{marginBlockStart:"16px",marginBlockEnd:8},"&-collapse-icon":{width:e.controlHeight,height:e.controlHeight,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center"},"&-effective":{[`${e.componentCls}-collapse-icon`]:{backgroundColor:e.colorBgTextHover}}}});function K0(e){return tt("LightFilter",t=>{const n={...t,componentCls:`.${e}`};return[Y0(n)]})}const W0=e=>{const{items:t,prefixCls:n,size:r="middle",collapse:a,collapseLabel:i,onValuesChange:o,variant:l="borderless",values:u,footerRender:m,placement:g,popoverProps:f}=e,h=Ne(),p=`${n}-light-filter`,{wrapSSR:S,hashId:y}=K0(p),[w,T]=d.useState(!1),[x,C]=d.useState(()=>({...u})),j=d.useMemo(()=>i||(a?s.jsx(de.FilterOutlined,{className:ie(`${p}-collapse-icon`,y)}):s.jsx(Qt,{variant:l,size:r,label:h.getMessage("form.lightFilter.more","更多筛选")})),[i,a,p,y,l,r,h]),{collapseItems:b,outsideItems:v}=d.useMemo(()=>{const $=[],E=[];return t.forEach(R=>{const{secondary:D}=R.props||{};D||a?$.push(R):E.push(R)}),{collapseItems:$,outsideItems:E}},[e.items]);return S(s.jsx("div",{className:ie(p,y,`${p}-${r}`,{[`${p}-effective`]:Object.keys(u).some($=>Array.isArray(u[$])?u[$].length>0:u[$])}),children:s.jsxs("div",{className:ie(`${p}-container`,y),children:[v.map(($,E)=>{if(!($!=null&&$.props))return $;const{key:R}=$,{fieldProps:D}=($==null?void 0:$.props)||{},M=D!=null&&D.placement?D==null?void 0:D.placement:g;return s.jsx("div",{className:ie(`${p}-item`,y),children:d.cloneElement($,{fieldProps:{...$.props.fieldProps,placement:M,variant:"borderless"},proFieldProps:{...$.props.proFieldProps,light:!0,label:$.props.label,variant:l},variant:l})},R||E)}),b.length?s.jsx("div",{className:ie(`${p}-item`,y),children:s.jsx(Hu,{padding:24,open:w,onOpenChange:$=>{T($)},placement:g,popoverProps:f,label:j,footerRender:m,footer:{onConfirm:()=>{o({...x}),T(!1)},onClear:()=>{const $={};b.forEach(E=>{const{name:R}=E.props;$[R]=void 0}),o($)}},children:b.map($=>{const{key:E}=$,{name:R,fieldProps:D}=$.props,M={...D,onChange:Y=>(C({...x,[R]:Y!=null&&Y.target?Y.target.value:Y}),!1)};x.hasOwnProperty(R)&&(M[$.props.valuePropName||"value"]=x[R]);const U=D!=null&&D.placement?D==null?void 0:D.placement:g;return s.jsx("div",{className:ie(`${p}-line`,y),children:d.cloneElement($,{fieldProps:{...M,placement:U,variant:l}})},E)})})},"more"):null]})}))};function q0(e){const{size:t,collapse:n,collapseLabel:r,initialValues:a,onValuesChange:i,form:o,placement:l,formRef:u,variant:m,ignoreRules:g,footerRender:f,popoverProps:h,...p}=e,{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-form"),[w,T]=d.useState(()=>({...a})),x=d.useRef();return d.useImperativeHandle(u,()=>x.current,[x.current]),s.jsx(jr,{size:t,initialValues:a,form:o,contentRender:C=>s.jsx(W0,{prefixCls:y,items:C==null?void 0:C.flatMap(j=>{var b;return!j||!(j!=null&&j.type)?j:((b=j==null?void 0:j.type)==null?void 0:b.displayName)==="ProForm-Group"?j.props.children:j}),size:t,variant:m||"borderless",collapse:n,collapseLabel:r,placement:l,popoverProps:h,values:w||{},footerRender:f,onValuesChange:j=>{var v,$;const b={...w,...j};T(b),(v=x.current)==null||v.setFieldsValue(b),($=x.current)==null||$.submit(),i&&i(j,b)}},JSON.stringify(w||{})),formRef:x,formItemProps:{colon:!1,labelAlign:"left"},fieldProps:{style:{width:void 0}},...Ze(p,["labelWidth"]),onValuesChange:(C,j)=>{var b;T(j),i==null||i(C,j),(b=x.current)==null||b.submit()}})}const{noteOnce:G0}=st;function Z0({children:e,trigger:t,onOpenChange:n,modalProps:r,onFinish:a,submitTimeout:i,title:o,width:l,open:u,...m}){var D,M,U,Y;G0(!m.footer||!(r!=null&&r.footer),"ModalForm 是一个 ProForm 的特殊布局,如果想自定义按钮,请使用 submit.render 自定义。");const g=d.useContext(c.ConfigProvider.ConfigContext),[,f]=d.useState([]),[h,p]=d.useState(!1),[S,y]=dt(!1,u),w=je(O=>{n==null||n(O)}),T=d.useCallback(O=>{y(I=>{const F=typeof O=="function"?O(I):O;return queueMicrotask(()=>{w(F)}),F})},[w]),x=d.useRef(null),C=d.useCallback(O=>{x.current===null&&O&&f([]),x.current=O},[]),j=d.useRef(),b=d.useCallback(()=>{var I;const O=m.form??((I=m.formRef)==null?void 0:I.current)??j.current;O&&(r!=null&&r.destroyOnHidden)&&typeof O.resetFields=="function"&&O.resetFields()},[r==null?void 0:r.destroyOnHidden,m.form,m.formRef]);d.useImperativeHandle(m.formRef,()=>j.current,[j.current]),d.useEffect(()=>{u&&(n==null||n(!0))},[u]);const v=d.useMemo(()=>t?d.cloneElement(t,{key:"trigger",...t.props,onClick:async O=>{var I,F;T(!S),(F=(I=t.props)==null?void 0:I.onClick)==null||F.call(I,O)}}):null,[T,t,S]),$=d.useMemo(()=>{var O,I,F,A;return m.submitter===!1?!1:aa({searchConfig:{submitText:(r==null?void 0:r.okText)??((I=(O=g.locale)==null?void 0:O.Modal)==null?void 0:I.okText)??"确认",resetText:(r==null?void 0:r.cancelText)??((A=(F=g.locale)==null?void 0:F.Modal)==null?void 0:A.cancelText)??"取消"},resetButtonProps:{preventDefault:!0,disabled:i&&h,onClick:k=>{var B;T(!1),(B=r==null?void 0:r.onCancel)==null||B.call(r,k)}}},m.submitter??{})},[(M=(D=g.locale)==null?void 0:D.Modal)==null?void 0:M.cancelText,(Y=(U=g.locale)==null?void 0:U.Modal)==null?void 0:Y.okText,r,m.submitter,T,h,i]),E=d.useCallback((O,I)=>s.jsxs(s.Fragment,{children:[O,x.current&&I?s.jsx(d.Fragment,{children:Gc.createPortal(I,x.current)},"submitter"):I]}),[]),R=d.useCallback(async O=>{const I=a==null?void 0:a(O);if(i&&I instanceof Promise){p(!0);const A=setTimeout(()=>p(!1),i);try{const k=await I;return clearTimeout(A),p(!1),k&&T(!1),k}catch(k){throw clearTimeout(A),p(!1),k}}else if(i){p(!0);const A=setTimeout(()=>p(!1),i);try{const k=await I;return clearTimeout(A),p(!1),k&&T(!1),k}catch(k){throw clearTimeout(A),p(!1),k}}const F=await I;return F&&T(!1),F},[a,T,i]);return s.jsxs(s.Fragment,{children:[s.jsx(c.Modal,{title:o,width:l||800,...r,open:S,onCancel:O=>{var I;i&&h||(T(!1),(I=r==null?void 0:r.onCancel)==null||I.call(r,O))},afterClose:()=>{var O;r!=null&&r.destroyOnHidden&&b(),S&&T(!1),(O=r==null?void 0:r.afterClose)==null||O.call(r)},footer:m.submitter!==!1?s.jsx("div",{ref:C,style:{display:"flex",justifyContent:"flex-end"}}):null,children:s.jsx(jr,{formComponentType:"ModalForm",layout:"vertical",...m,onInit:(O,I)=>{var F;m.formRef&&(m.formRef.current=I),(F=m==null?void 0:m.onInit)==null||F.call(m,O,I),j.current=I},formRef:j,submitter:$,onFinish:async O=>await R(O),contentRender:E,children:e})}),v]})}const Xi=be.createContext(null);function J0({children:e,onBatchResize:t}){const n=be.useRef(0),r=be.useRef([]),a=be.useContext(Xi),i=be.useCallback((o,l,u)=>{n.current+=1;const m=n.current;r.current.push({size:o,element:l,data:u}),Promise.resolve().then(()=>{m===n.current&&(t==null||t(r.current),r.current=[])}),a==null||a(o,l,u)},[t,a]);return be.createElement(Xi.Provider,{value:i},e)}const on=new Map;function zd(e){e.forEach(t=>{var r;const{target:n}=t;(r=on.get(n))==null||r.forEach(a=>a(n))})}let ai;function Bd(){return ai||(ai=new ResizeObserver(zd)),ai}process.env.NODE_ENV;process.env.NODE_ENV;function X0(e,t){on.has(e)||(on.set(e,new Set),Bd().observe(e)),on.get(e).add(t)}function Q0(e,t){on.has(e)&&(on.get(e).delete(t),on.get(e).size||(Bd().unobserve(e),on.delete(e)))}function ev(e,t,n,r){const a=be.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),i=eu(u=>{const{width:m,height:g}=u.getBoundingClientRect(),{offsetWidth:f,offsetHeight:h}=u,p=Math.floor(m),S=Math.floor(g);if(a.current.width!==p||a.current.height!==S||a.current.offsetWidth!==f||a.current.offsetHeight!==h){const y={width:p,height:S,offsetWidth:f,offsetHeight:h};a.current=y;const w=f===Math.round(m)?m:f,T=h===Math.round(g)?g:h,x={...y,offsetWidth:w,offsetHeight:T};r==null||r(x,u),Promise.resolve().then(()=>{n==null||n(x,u)})}}),o=typeof t=="function",l=be.useRef(0);be.useEffect(()=>{const u=o?t():t;return u&&e?X0(u,i):e&&o&&(l.current+=1),()=>{u&&Q0(u,i)}},[e,o?l.current:t])}function tv(e,t){const{children:n,disabled:r,onResize:a,data:i}=e,o=be.useRef(null),l=be.useContext(Xi),u=typeof n=="function",m=u?n(o):n,g=!u&&be.isValidElement(m)&&Mf(m),f=g?Af(m):null,h=If(f,o),p=()=>Lf(o.current);return be.useImperativeHandle(t,()=>p()),ev(!r,p,a,(S,y)=>{l==null||l(S,y,i)}),g?be.cloneElement(m,{ref:h}):m}const Vd=be.forwardRef(tv);process.env.NODE_ENV!=="production"&&(Vd.displayName="SingleObserver");function Qi(){return Qi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qi.apply(this,arguments)}const nv="rc-observer-key";function rv(e,t){const{children:n}=e,r=typeof n=="function"?[n]:Tn(n);return process.env.NODE_ENV!=="production"&&(r.length>1?Js(!1,"Find more than one child node with `children` in ResizeObserver. Please use ResizeObserver.Collection instead."):r.length===0&&Js(!1,"`children` of ResizeObserver is empty. Nothing is in observe.")),r.map((a,i)=>{const o=(a==null?void 0:a.key)||`${nv}-${i}`;return be.createElement(Vd,Qi({},e,{key:o,ref:i===0?t:void 0}),a)})}const ja=be.forwardRef(rv);process.env.NODE_ENV!=="production"&&(ja.displayName="ResizeObserver");ja.Collection=J0;const sv=(e,t,n,r)=>e?s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.collapsed","展开"),r&&`(${r})`,s.jsx(de.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}):s.jsxs(s.Fragment,{children:[n.getMessage("tableForm.expand","收起"),s.jsx(de.DownOutlined,{style:{marginInlineStart:"0.5em",transition:"0.3s all",transform:`rotate(${e?0:.5}turn)`}})]}),av=e=>{const{setCollapsed:t,collapsed:n=!1,submitter:r,style:a,hiddenNum:i}=e,{getPrefixCls:o}=d.useContext(c.ConfigProvider.ConfigContext),l=Ne(),{hashId:u}=d.useContext(Xt),m=Wu(e.collapseRender)||sv;return s.jsxs(c.Space,{style:a,size:16,children:[r,e.collapseRender!==!1&&s.jsx("a",{className:ie(o("pro-query-filter-collapse-button"),u),onClick:()=>t(!n),children:m==null?void 0:m(n,e,l,i)})]})},iv=e=>({[e.componentCls]:{boxSizing:"border-box","&&":{padding:24},[`${e.antCls}-form-item`]:{marginBlock:0},[`${e.proComponentsCls}-form-group-title`]:{marginBlock:0},"&-row":{rowGap:24,"&-split":{[`${e.proComponentsCls}-form-group`]:{display:"flex",alignItems:"center",gap:e.marginXS},"&:last-child":{marginBlockEnd:12}},"&-split-line":{"&:after":{position:"absolute",width:"100%",content:'""',height:1,insetBlockEnd:-12,borderBlockEnd:`1px dashed ${e.colorSplit}`}}},"&-collapse-button":{display:"flex",alignItems:"center",color:e.colorPrimary}}});function ov(e){return tt("QueryFilter",t=>{const n={...t,componentCls:`.${e}`};return[iv(n)]})}const lv=e=>{const n={...c.theme.getDesignToken(),...e},r={xs:n.screenSMMin??576,sm:n.screenMDMin??768,md:n.screenLGMin??992,lg:n.screenXLMin??1200,xl:n.screenXXLMin??1600,xxl:1/0};return{configSpanBreakpoints:r,breakpoints:{vertical:[[r.xs,1,"vertical"],[r.md,2,"vertical"],[r.xl,3,"vertical"],[1/0,4,"vertical"]],default:[[r.xs,1,"vertical"],[r.sm,2,"vertical"],[r.xl,3,"horizontal"],[1/0,4,"horizontal"]]}}},cv=(e,t,n,r)=>{if(n&&typeof n=="number")return{span:n,layout:e};const{breakpoints:a,configSpanBreakpoints:i}=r,l=((n?["xs","sm","md","lg","xl","xxl"].map(u=>[i[u],24/n[u],"horizontal"]):a[e||"default"])||a.default).find(u=>t<u[0]+16);return l?{span:24/l[1],layout:l==null?void 0:l[2]}:{span:8,layout:"horizontal"}},uv=(e,t)=>e==null?void 0:e.flatMap(n=>{var r,a,i;return((r=n==null?void 0:n.type)==null?void 0:r.displayName)==="ProForm-Group"&&!((a=n.props)!=null&&a.title)?n.props.children:t&&d.isValidElement(n)?d.cloneElement(n,{...n.props,formItemProps:{...(i=n.props)==null?void 0:i.formItemProps,rules:[]}}):n}),dv=e=>{var O,I,F;const t=Ne(),{hashId:n}=d.useContext(Xt),r=e.resetText||t.getMessage("tableForm.reset","重置"),a=e.searchText||t.getMessage("tableForm.search","搜索"),[i,o]=dt(()=>e.defaultCollapsed&&!!e.submitter,e.collapsed),l=je(A=>{var k;(k=e.onCollapse)==null||k.call(e,A)}),u=d.useCallback(A=>{o(k=>{const B=typeof A=="function"?A(k):A;return queueMicrotask(()=>{l(B)}),B})},[l]),{optionRender:m,collapseRender:g,split:f,items:h,spanSize:p,showLength:S,searchGutter:y,showHiddenNum:w}=e,T=d.useMemo(()=>!e.submitter||m===!1?null:d.cloneElement(e.submitter,{searchConfig:{resetText:r,submitText:a},render:m&&((A,k)=>m({...e,resetText:r,searchText:a},e,k)),...e.submitter.props}),[e,r,a,m]);let x=0,C=0,j=!1,b=0,v=0;const $=uv(h,e.ignoreRules).map((A,k)=>{var Z,q,V,L;const B=d.isValidElement(A)?((Z=A==null?void 0:A.props)==null?void 0:Z.colSize)??1:1,G=Math.min(p.span*(B||1),24);x+=G,b+=B,k===0&&(j=G===24&&!((q=A==null?void 0:A.props)!=null&&q.hidden));const _=((V=A==null?void 0:A.props)==null?void 0:V.hidden)||i&&(j||b>S)&&!!k;C+=1;const H=d.isValidElement(A)&&(A.key||`${(L=A.props)==null?void 0:L.name}`)||k;return d.isValidElement(A)&&_?e.preserve?{itemDom:d.cloneElement(A,{hidden:!0,key:H||k}),hidden:!0,colSpan:G}:{itemDom:null,colSpan:0,hidden:!0}:{itemDom:A,colSpan:G,hidden:!1}}),E=$.map((A,k)=>{var Z,q;const{itemDom:B,colSpan:G}=A;if((Z=B==null?void 0:B.props)==null?void 0:Z.hidden)return B;const H=d.isValidElement(B)&&(B.key||`${(q=B.props)==null?void 0:q.name}`)||k;return 24-v%24<G&&(x+=24-v%24,v+=24-v%24),v+=G,f&&v%24===0&&k<C-1?s.jsx(c.Col,{span:G,className:ie(`${e.baseClassName}-row-split-line`,`${e.baseClassName}-row-split`,n),children:B},H):s.jsx(c.Col,{className:ie(`${e.baseClassName}-row-split`,n),span:G,children:B},H)}),R=w&&$.filter(A=>A.hidden).length,D=d.useMemo(()=>!(x<24||b<=S),[b,S,x]),M=d.useMemo(()=>{var k,B;const A=v%24+(((k=e.submitterColSpanProps)==null?void 0:k.span)??p.span);return A>24?24-(((B=e.submitterColSpanProps)==null?void 0:B.span)??p.span):24-A},[v,v%24+(((O=e.submitterColSpanProps)==null?void 0:O.span)??p.span),(I=e.submitterColSpanProps)==null?void 0:I.span]),Y=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter");return s.jsxs(c.Row,{gutter:y,justify:"start",className:ie(`${Y}-row`,n),children:[E,T&&s.jsx(c.Col,{span:p.span,offset:M,className:ie((F=e.submitterColSpanProps)==null?void 0:F.className),...e.submitterColSpanProps,style:{textAlign:"end"},children:s.jsx(c.Form.Item,{label:" ",colon:!1,shouldUpdate:!1,className:ie(`${Y}-actions`,n),children:s.jsx(av,{hiddenNum:R,collapsed:i,collapseRender:D?g:!1,submitter:T,setCollapsed:u},"pro-form-query-filter-actions")})},"submitter")]},"resize-observer-row")};var qc;const fv=xo()?(qc=document==null?void 0:document.body)==null?void 0:qc.clientWidth:1024;function mv(e){const{collapsed:t,layout:n,defaultCollapsed:r=!0,defaultColsNumber:a,defaultFormItemsNumber:i,span:o,searchGutter:l=24,searchText:u,resetText:m,optionRender:g,collapseRender:f,onReset:h,onCollapse:p,labelWidth:S="80",style:y,split:w,preserve:T=!0,ignoreRules:x,showHiddenNum:C=!1,submitterColSpanProps:j,...b}=e,$=d.useContext(c.ConfigProvider.ConfigContext).getPrefixCls("pro-query-filter"),{wrapSSR:E,hashId:R}=ov($),{token:D}=c.theme.useToken(),[M,U]=d.useState(()=>typeof(y==null?void 0:y.width)=="number"?y==null?void 0:y.width:fv),Y=d.useMemo(()=>lv(D),[D.screenSMMin,D.screenMDMin,D.screenLGMin,D.screenXLMin,D.screenXXLMin]),O=d.useMemo(()=>cv(n,M+16,o,Y),[n,M,o,Y]),I=d.useMemo(()=>{if(i!==void 0)return i;if(a!==void 0){const A=24/O.span-1;return a>A?A:a}return Math.max(1,24/O.span-1)},[a,i,O.span]),F=d.useMemo(()=>{if(S&&O.layout!=="vertical"&&S!=="auto")return{labelCol:{flex:`0 0 ${S}px`},wrapperCol:{style:{maxWidth:`calc(100% - ${S}px)`}},style:{flexWrap:"nowrap"}}},[O.layout,S]);return E(s.jsx(ja,{onResize:A=>{M!==A.width&&A.width>17&&U(A.width)},children:A=>s.jsx("div",{ref:A,className:ie(`${$}-container`,R),style:e.containerStyle,children:s.jsx(jr,{isKeyPressSubmit:!0,preserve:T,...b,className:ie($,R,b.className),onReset:h,style:y,layout:O.layout,fieldProps:{style:{width:"100%"}},formItemProps:F,groupProps:{titleStyle:{display:"inline-block",marginInlineEnd:16}},contentRender:(k,B,G)=>s.jsx(dv,{spanSize:O,collapsed:t,form:G,submitterColSpanProps:j,collapseRender:f,defaultCollapsed:r,onCollapse:p,optionRender:g,submitter:B,items:k,split:w,baseClassName:$,resetText:e.resetText,searchText:e.searchText,searchGutter:l,preserve:T,ignoreRules:x,showLength:I,showHiddenNum:C})})})},"resize-observer"))}const{noteOnce:hv}=st;function gv(e){const t=d.useRef(),n=d.useContext(Hd),r=d.useContext(Ud),a={...e,...r},{onFinish:i,step:o,formRef:l,title:u,stepProps:m,...g}=a;return hv(!g.submitter,"StepForm 不包含提交按钮,请在 StepsForm 上"),d.useImperativeHandle(l,()=>t.current,[l==null?void 0:l.current]),d.useEffect(()=>{if(!(a.name||a.step))return;const f=(a.name||a.step).toString();return n==null||n.regForm(f,a),()=>{n==null||n.unRegForm(f)}},[]),n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),s.jsx(jr,{formRef:t,onFinish:async f=>{if(g.name&&(n==null||n.onFormFinish(g.name,f)),i){n==null||n.setLoading(!0);try{await(i==null?void 0:i(f))&&(n==null||n.next())}finally{n==null||n.setLoading(!1)}return}n!=null&&n.lastStep||n==null||n.next()},onInit:(f,h)=>{var p;t.current=h,n&&(n!=null&&n.formArrayRef)&&(n.formArrayRef.current[o||0]=t),(p=g==null?void 0:g.onInit)==null||p.call(g,f,h)},layout:"vertical",...Ze(g,["layoutType","columns"])})}const pv=e=>({[e.componentCls]:{boxSizing:"border-box","&-container":{width:"max-content",minWidth:"420px",maxWidth:"100%",margin:"auto"},"&-steps-container":{maxWidth:"1160px",margin:"auto",[`${e.antCls}-steps-vertical`]:{height:"100%"}},"&-step":{display:"none",marginBlockStart:"32px","&-active":{display:"block"},"> form":{maxWidth:"100%"}}}});function yv(e){return tt("StepsForm",t=>{const n={...t,componentCls:`.${e}`};return[pv(n)]})}const Hd=d.createContext(void 0),xv={horizontal({stepsDom:e,formDom:t}){return s.jsxs(s.Fragment,{children:[s.jsx(c.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(c.Col,{span:24,children:e})}),s.jsx(c.Row,{gutter:{xs:8,sm:16,md:24},children:s.jsx(c.Col,{span:24,children:t})})]})},vertical({stepsDom:e,formDom:t}){return s.jsxs(c.Row,{align:"stretch",wrap:!0,gutter:{xs:8,sm:16,md:24},children:[s.jsx(c.Col,{xxl:4,xl:6,lg:7,md:8,sm:10,xs:12,children:d.cloneElement(e,{style:{height:"100%"}})}),s.jsx(c.Col,{children:s.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%",height:"100%"},children:t})})]})}},Ud=d.createContext(null);function bv(e){const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=t("pro-steps-form"),{wrapSSR:r,hashId:a}=yv(n),{current:i,onCurrentChange:o,submitter:l,stepsFormRender:u,stepsRender:m,stepFormRender:g,stepsProps:f,onFinish:h,formProps:p,containerStyle:S,formRef:y,formMapRef:w,layoutRender:T,...x}=e,C=d.useRef(new Map),j=d.useRef(new Map),b=d.useRef([]),[v,$]=d.useState([]),[E,R]=d.useState(!1),D=Ne(),[M,U]=dt(0,e.current),Y=je(X=>{var se;(se=e.onCurrentChange)==null||se.call(e,X)}),O=d.useCallback(X=>{U(se=>{const ae=typeof X=="function"?X(se):X;return queueMicrotask(()=>{Y(ae)}),ae})},[Y]),I=d.useMemo(()=>xv[(f==null?void 0:f.orientation)||"horizontal"],[f==null?void 0:f.orientation]),F=d.useMemo(()=>M===v.length-1,[v.length,M]),A=d.useCallback((X,se)=>{j.current.has(X)||$(ae=>[...ae,X]),j.current.set(X,se)},[]),k=d.useCallback(X=>{$(se=>se.filter(ae=>ae!==X)),j.current.delete(X),C.current.delete(X)},[]);d.useImperativeHandle(w,()=>b.current,[b.current]),d.useImperativeHandle(y,()=>{var X;return(X=b.current[M||0])==null?void 0:X.current},[M,b.current]);const B=d.useCallback(async(X,se)=>{if(C.current.set(X,se),!F||!h)return;R(!0);const ae=Ku({},...Array.from(C.current.values()));try{await h(ae)&&(O(0),b.current.forEach(pe=>{var me;return(me=pe.current)==null?void 0:me.resetFields()}))}catch(ue){console.log(ue)}finally{R(!1)}},[F,h,R,O]),G=d.useMemo(()=>{const X={items:v.map(se=>{const ae=j.current.get(se),ue={key:se,title:ae==null?void 0:ae.title,...ae==null?void 0:ae.stepProps};return ue.description&&(ue.content=ue.description,delete ue.description),ue})};return s.jsx("div",{className:ie(`${n}-steps-container`,a),style:{maxWidth:Math.min(v.length*320,1160)},children:s.jsx(c.Steps,{...f,...X,current:M,onChange:void 0})})},[v,a,n,M,f]),_=je(()=>{var se;(se=b.current[M].current)==null||se.submit()}),H=je(()=>{M<1||O(M-1)}),Z=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:E,...l==null?void 0:l.submitButtonProps,onClick:()=>{var X;(X=l==null?void 0:l.onSubmit)==null||X.call(l),_()},children:D.getMessage("stepsForm.next","下一步")},"next"),[D,E,_,l]),q=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{...l==null?void 0:l.resetButtonProps,onClick:()=>{var X;H(),(X=l==null?void 0:l.onReset)==null||X.call(l)},children:D.getMessage("stepsForm.prev","上一步")},"pre"),[D,H,l]),V=d.useMemo(()=>l!==!1&&s.jsx(c.Button,{type:"primary",loading:E,...l==null?void 0:l.submitButtonProps,onClick:()=>{var X;(X=l==null?void 0:l.onSubmit)==null||X.call(l),_()},children:D.getMessage("stepsForm.submit","提交")},"submit"),[D,E,_,l]),L=je(()=>{v.length!==0&&(M>v.length-2||O(M+1))}),K=d.useMemo(()=>{var ae;let X=[];const se=M||0;if(se<1?v.length===1?X.push(V):X.push(Z):se+1===v.length?X.push(q,V):X.push(q,Z),X=X.filter(d.isValidElement),l&&l.render){const ue={form:(ae=b.current[M])==null?void 0:ae.current,onSubmit:_,step:M,onPre:H};return l.render(ue,X)}return l&&(l==null?void 0:l.render)===!1?null:X},[v.length,Z,_,q,H,M,V,l]),P=d.useMemo(()=>Tn(e.children).map((X,se)=>{const ae=X.props,ue=ae.name||`${se}`,pe=M===se,me=pe?{contentRender:g,submitter:!1}:{};return s.jsx("div",{className:ie(`${n}-step`,a,{[`${n}-step-active`]:pe}),children:s.jsx(Ud.Provider,{value:{...me,...p,...ae,name:ue,step:se},children:X})},ue)}),[p,a,n,e.children,M,g]),W=d.useMemo(()=>m?m(v.map(X=>{var se;return{key:X,title:(se=j.current.get(X))==null?void 0:se.title}}),G):G,[v,G,m]),te=d.useMemo(()=>s.jsxs("div",{className:ie(`${n}-container`,a),style:S,children:[P,u?null:s.jsx(c.Space,{children:K})]}),[S,P,a,n,u,K]),re=d.useMemo(()=>{const X={stepsDom:W,formDom:te};return u?u(T?T(X):I(X),K):T?T(X):I(X)},[W,te,I,u,K,T]);return r(s.jsx("div",{className:ie(n,a),children:s.jsx(c.Form.Provider,{...x,children:s.jsx(Hd.Provider,{value:{loading:E,setLoading:R,regForm:A,keyArray:v,next:L,formArrayRef:b,formMapRef:j,lastStep:F,unRegForm:k,onFormFinish:B},children:re})})}))}function va(e){return s.jsx(Bn,{needDeps:!0,children:s.jsx(bv,{...e})})}va.StepForm=gv;va.useForm=c.Form.useForm;const Sv=({children:e})=>s.jsx(s.Fragment,{children:e}),Cv=({steps:e,columns:t,forceUpdate:n,grid:r,...a})=>{const i=po(a),o=d.useCallback(u=>{var m,g;(g=(m=i.current).onCurrentChange)==null||g.call(m,u),n([])},[n,i]),l=d.useMemo(()=>e==null?void 0:e.map((u,m)=>d.createElement(Yd,{grid:r,...u,key:m,layoutType:"StepForm",columns:t[m]})),[t,r,e]);return s.jsx(va,{...a,onCurrentChange:o,children:l})},{noteOnce:zc}=st,wv=(e,t)=>{var n;if(e.valueType==="dependency"){const r=(n=e.getFieldProps)==null?void 0:n.call(e);return zc(Array.isArray(e.name??(r==null?void 0:r.name)),'SchemaForm: fieldProps.name should be NamePath[] when valueType is "dependency"'),zc(typeof e.columns=="function",'SchemaForm: columns should be a function when valueType is "dependency"'),Array.isArray(e.name??(r==null?void 0:r.name))?d.createElement(wa,{name:e.name,...r,key:e.key},a=>!e.columns||typeof e.columns!="function"?null:t.genItems(e.columns(a))):null}return!0},jv=e=>{var t;return e.valueType==="divider"?d.createElement(c.Divider,{...(t=e.getFieldProps)==null?void 0:t.call(e),key:e.key}):!0},vv=(e,{action:t,formRef:n,type:r,originItem:a})=>{const i={...Ze(e,["dataIndex","width","render","formItemRender","renderText","title"]),name:e.name||e.key||e.dataIndex,width:e.width,render:e!=null&&e.render?(m,g,f)=>{var h,p,S,y;return(y=e==null?void 0:e.render)==null?void 0:y.call(e,m,g,f,t==null?void 0:t.current,{type:r,...e,key:(h=e.key)==null?void 0:h.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e)})}:void 0},o=()=>{const{key:m,...g}=i;return s.jsx(En,{...g,ignoreFormItem:!0},m)},l=e!=null&&e.formItemRender?(m,g)=>{var h,p,S,y;const f=xt({...g,onChange:void 0});return(y=e==null?void 0:e.formItemRender)==null?void 0:y.call(e,{type:r,...e,key:(h=e.key)==null?void 0:h.toString(),formItemProps:(p=e.getFormItemProps)==null?void 0:p.call(e),fieldProps:(S=e.getFieldProps)==null?void 0:S.call(e),originProps:a},{...f,defaultRender:o,type:r},n.current)}:void 0,u=()=>{if(e!=null&&e.formItemRender){const m=l==null?void 0:l(null,{});if(!m||e.ignoreFormItem)return m}return d.createElement(En,{...i,key:[e.key,e.index||0].join("-"),formItemRender:l})};return e.dependencies?s.jsx(wa,{name:e.dependencies||[],children:u},e.key):u()},Tv=(e,{genItems:t})=>{var n,r;return e.valueType==="formList"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(x0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,name:e.dataIndex,label:e.label,initialValue:e.initialValue,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},Fv=(e,{genItems:t})=>{var n,r;return e.valueType==="formSet"&&e.dataIndex?!e.columns||!Array.isArray(e.columns)?null:d.createElement(L0,{...(n=e.getFormItemProps)==null?void 0:n.call(e),key:e.key,initialValue:e.initialValue,name:e.dataIndex,label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(r=e.getFieldProps)==null?void 0:r.call(e)},t(e.columns)):!0},$v=(e,{genItems:t})=>{var n;return e.valueType==="group"?!e.columns||!Array.isArray(e.columns)?null:s.jsx(Ov,{label:e.label,colProps:e.colProps,rowProps:e.rowProps,...(n=e.getFieldProps)==null?void 0:n.call(e),children:t(e.columns)},e.key):!0},Ev=e=>e.valueType&&typeof e.valueType=="string"&&["index","indexBorder","option"].includes(e==null?void 0:e.valueType)?null:!0,Bc=[Ev,$v,Tv,Fv,jv,wv],Rv=(e,t)=>{for(let n=0;n<Bc.length;n++){const r=Bc[n],a=r(e,t);if(a!==!0)return a}return vv(e,t)},Iv={DrawerForm:U0,QueryFilter:mv,LightFilter:q0,StepForm:va.StepForm,StepsForm:Cv,ModalForm:Z0,Embed:Sv,Form:Tt};function Yd(e){const{columns:t,layoutType:n="Form",type:r="form",action:a,shouldUpdate:i=(v,$)=>wn(v)!==wn($),formRef:o,...l}=e,u=Iv[n]||Tt,[m]=c.Form.useForm(),g=c.Form.useFormInstance(),[,f]=d.useState([]),[h,p]=d.useState(()=>[]),S=Vp(e.form||g||m),y=d.useRef(),w=po(e),T=je(v=>v.filter($=>!($.hideInForm&&r==="form")).sort(($,E)=>E.order||$.order?(E.order||0)-($.order||0):(E.index||0)-($.index||0)).map(($,E)=>{const R=vt($.title,$,"form",s.jsx(fr,{label:$.title,tooltip:$.tooltip})),D=xt({title:R,label:R,name:$.name,valueType:vt($.valueType,{}),key:$.key||$.dataIndex||E,columns:$.columns,valueEnum:$.valueEnum,dataIndex:$.dataIndex||$.key,initialValue:$.initialValue,width:$.width,index:$.index,readonly:$.readonly,colSize:$.colSize,colProps:$.colProps,rowProps:$.rowProps,className:$.className,tooltip:$.tooltip,dependencies:$.dependencies,proFieldProps:$.proFieldProps,ignoreFormItem:$.ignoreFormItem,getFieldProps:$.fieldProps?()=>vt($.fieldProps,S.current,$):void 0,getFormItemProps:$.formItemProps?()=>vt($.formItemProps,S.current,$):void 0,render:$.render,formItemRender:$.formItemRender,renderText:$.renderText,request:$.request,params:$.params,transform:$.transform,convertValue:$.convertValue,debounceTime:$.debounceTime,defaultKeyWords:$.defaultKeyWords});return Rv(D,{action:a,type:r,originItem:$,formRef:S,genItems:T})}).filter($=>!!$)),x=d.useCallback((v,$)=>{const{onValuesChange:E}=w.current;(i===!0||typeof i=="function"&&i($,y.current))&&p([]),y.current=$,E==null||E(v,$)},[w,i]),C=St(()=>{if(!(t.length&&Array.isArray(t[0])))return T(t)},[t,l==null?void 0:l.open,a,r,h,S.current]),j=St(()=>n==="StepsForm"?{forceUpdate:f,columns:t}:{},[t,n]);d.useImperativeHandle(o,()=>S.current,[S.current]);const b=d.useContext(Zt);return s.jsx(Bn,{valueTypeMap:{...b.valueTypeMap,...Rd},children:s.jsx(u,{...j,...l,onInit:(v,$)=>{var E;o&&(o.current=$),(E=l==null?void 0:l.onInit)==null||E.call(l,v,$),S.current=$},form:e.form||m,formRef:S,onValuesChange:x,children:C})})}const ua="text",Mv=({fieldProps:e,proFieldProps:t,...n})=>s.jsx(En,{valueType:ua,fieldProps:e,fieldConfig:{valueType:ua},proFieldProps:t,...n}),Av=e=>{const[t,n]=dt(e.open||!1,e.open),r=d.useCallback(a=>{n(i=>{var l;const o=typeof a=="function"?a(i):a;return(l=e.onOpenChange)==null||l.call(e,o),o})},[e.onOpenChange]);return s.jsx(c.Form.Item,{shouldUpdate:!0,noStyle:!0,children:a=>{var o;const i=a.getFieldValue(e.name||[]);return s.jsx(c.Popover,{getPopupContainer:l=>l&&l.parentNode?l.parentNode:l,onOpenChange:l=>r(l),content:s.jsxs("div",{style:{padding:"4px 0"},children:[(o=e.statusRender)==null?void 0:o.call(e,i),e.strengthText?s.jsx("div",{style:{marginTop:10},children:s.jsx("span",{children:e.strengthText})}):null]}),styles:{root:{width:240}},placement:"rightTop",...e.popoverProps,open:t,children:e.children})}})},kv=({fieldProps:e,proFieldProps:t,...n})=>{const[r,a]=d.useState(!1);return e!=null&&e.statusRender&&n.name?s.jsx(Bn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(or,{...o,text:i}),formItemRender:(i,o)=>s.jsx(or,{...o,text:i})}},children:s.jsx(Av,{name:n.name,statusRender:e==null?void 0:e.statusRender,popoverProps:e==null?void 0:e.popoverProps,strengthText:e==null?void 0:e.strengthText,open:r,onOpenChange:a,children:s.jsx("div",{children:s.jsx(En,{valueType:"password",fieldProps:{...Ze(e,["statusRender","popoverProps","strengthText"]),onBlur:i=>{var o;(o=e==null?void 0:e.onBlur)==null||o.call(e,i),a(!1)},onClick:i=>{var o;(o=e==null?void 0:e.onClick)==null||o.call(e,i),a(!0)}},proFieldProps:t,fieldConfig:{valueType:ua},...n})})})}):s.jsx(Bn,{valueTypeMap:{password:{render:(i,o)=>s.jsx(or,{...o,text:i}),formItemRender:(i,o)=>s.jsx(or,{...o,text:i})}},children:s.jsx(En,{valueType:"password",fieldProps:e,proFieldProps:t,fieldConfig:{valueType:ua},...n})})},da=Mv;da.Password=kv;da.displayName="ProFormComponent";function Tt(e){return s.jsx(jr,{layout:"vertical",contentRender:(t,n)=>s.jsxs(s.Fragment,{children:[t,n]}),...e})}Tt.Group=_d;Tt.useForm=c.Form.useForm;Tt.Item=Nd;Tt.useWatch=c.Form.useWatch;Tt.ErrorList=c.Form.ErrorList;Tt.Provider=c.Form.Provider;Tt.useFormInstance=c.Form.useFormInstance;Tt.EditOrReadOnlyContext=ss;const Ov=Tt.Group,Dv=e=>({[e.componentCls]:{boxSizing:"border-box",marginBlockEnd:16,backgroundColor:It(e.colorTextBase,.02),borderRadius:e.borderRadius,border:"none","&-container":{paddingBlock:e.paddingSM,paddingInline:e.paddingLG},"&-info":{display:"flex",alignItems:"center",transition:"all 0.3s",color:e.colorTextTertiary,"&-content":{flex:1},"&-option":{minWidth:48,paddingInlineStart:16}}}});function Pv(e){return tt("ProTableAlert",t=>{const n={...t,componentCls:`.${e}`};return[Dv(n)]})}const Nv=e=>{const{intl:t,onCleanSelected:n}=e;return[s.jsx("a",{onClick:n,children:t.getMessage("alert.clear","清空")},"0")]};function Lv({selectedRowKeys:e=[],onCleanSelected:t,alwaysShowAlert:n,selectedRows:r,alertInfoRender:a=({intl:o})=>s.jsxs(c.Space,{children:[o.getMessage("alert.selected","已选择"),e.length,o.getMessage("alert.item","项"),"  "]}),alertOptionRender:i=Nv}){const o=Ne(),l=i&&i({onCleanSelected:t,selectedRowKeys:e,selectedRows:r,intl:o}),{getPrefixCls:u}=d.useContext(c.ConfigProvider.ConfigContext),m=u("pro-table-alert"),{wrapSSR:g,hashId:f}=Pv(m);if(a===!1)return null;const h=a({intl:o,selectedRowKeys:e,selectedRows:r,onCleanSelected:t});return h===!1||e.length<1&&!n?null:g(s.jsx("div",{className:ie(m,f),children:s.jsx("div",{className:ie(`${m}-container`,f),children:s.jsxs("div",{className:ie(`${m}-info`,f),children:[s.jsx("div",{className:ie(`${m}-info-content`,f),children:h}),l?s.jsx("div",{className:ie(`${m}-info-option`,f),children:l}):null]})})}))}function _v(e,t,n){if(e===!1)return!1;const{total:r,current:a,pageSize:i,setPageInfo:o}=t;return{showTotal:(u,m)=>`${n.getMessage("pagination.total.range","第")} ${m[0]}-${m[1]} ${n.getMessage("pagination.total.total","条/总共")} ${u} ${n.getMessage("pagination.total.item","条")}`,total:r,...typeof e=="object"?e:{},current:e!==!0&&e?e.current??a:a,pageSize:e!==!0&&e?e.pageSize??i:i,onChange:(u,m)=>{const{onChange:g}=e;g==null||g(u,m||20),(m!==i||a!==u)&&o({pageSize:m,current:u})}}}function zv(e,t,n){const r={...n.editableUtils,pageInfo:t.pageInfo,nativeElement:n.nativeElement,focus:n.focus,reload:async a=>{a&&await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reloadAndRest:async()=>{n.onCleanSelected(),await t.setPageInfo({current:1}),await(t==null?void 0:t.reload())},reset:async()=>{var a;await n.resetAll(),await((a=t==null?void 0:t.reset)==null?void 0:a.call(t)),await(t==null?void 0:t.reload())},fullScreen:()=>n.fullScreen(),clearSelected:()=>n.onCleanSelected(),setPageInfo:a=>t.setPageInfo(a),scrollTo:n.scrollTo};e.current=r}function Bv(e,t){return t.filter(n=>n).length<1?e:t.reduce((n,r)=>r(n),e)}const Kd=(e,t)=>t===void 0?!1:typeof t=="boolean"?t:t[e],Vv=e=>{var t;return e&&typeof e=="object"&&((t=e==null?void 0:e.props)==null?void 0:t.colSpan)},pr=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`,as=e=>Array.isArray(e)?e.join(","):e==null?void 0:e.toString(),eo=e=>{const t=[];for(let n=0;n<e.length;n++){const r=e[n];r.children?t.push(...eo(r.children)):t.push(r)}return t},Fo=(e,t)=>!!e&&!!t,$o=e=>typeof e=="function"||typeof e=="object"&&typeof e.compare=="function",Hv=(e,t)=>Object.entries(e).reduce((n,[r,a])=>{const i=t.find(o=>as(o.dataIndex)===r);return i!=null&&!Fo(i.filters,i.onFilter)&&(n[r]=a),n},{}),Uv=e=>(Array.isArray(e)?e:[e]).reduce((r,a)=>{var l,u;const i=(l=a.column)==null?void 0:l.sorter;if(i!=null&&$o(i))return r;const o=typeof i=="string"?i:as((u=a.column)==null?void 0:u.dataIndex);return o!=null&&(r[o]=a.order),r},{}),Yv=e=>{const t={},n={};return e.forEach(r=>{const a=as(r.dataIndex);a&&(r.filters&&!Fo(r.filters,r.onFilter)&&(t[a]=r.defaultFilteredValue??null),r.sorter&&!$o(r.sorter)&&(typeof r.sorter=="string"?n[r.sorter]=r.defaultSortOrder??null:n[a]=r.defaultSortOrder??null))}),{sort:n,filter:t}},Kv=(e,t)=>{const{sorter:n,sortOrder:r,dataIndex:a}=t;if(r!==void 0)return r;if(n==null||$o(n))return;const i=typeof n=="string"?n:as(a);return i?e[i]:void 0},Wv=(e,t)=>{const{filters:n,onFilter:r,filteredValue:a,dataIndex:i}=t;if(a!==void 0)return a;if(n==null||Fo(n,r))return;const o=as(i);return o?e[o]:void 0};function qv(e={}){var x,C,j,b,v,$;const t=d.useRef(),n=d.useRef(null),r=d.useRef(),a=d.useRef(),[i,o]=d.useState(""),l=d.useRef([]),[u,m]=dt(()=>e.size||e.defaultSize||"middle",e.size),g=d.useCallback(E=>{m(R=>{var M;const D=typeof E=="function"?E(R):E;return(M=e.onSizeChange)==null||M.call(e,D),D})},[e.onSizeChange]),f=d.useMemo(()=>{var R,D;if((R=e==null?void 0:e.columnsState)!=null&&R.defaultValue)return e.columnsState.defaultValue;const E={};return(D=e.columns)==null||D.forEach(({key:M,dataIndex:U,fixed:Y,disable:O},I)=>{const F=pr(M??U,I);F&&(E[F]={show:!0,fixed:Y,disable:O})}),E},[e.columns]),[h,p]=dt(()=>{var D,M,U,Y;const{persistenceType:E,persistenceKey:R}=e.columnsState||{};if(R&&E&&typeof window<"u"){const O=window[E];try{const I=O==null?void 0:O.getItem(R);if(I)return(D=e==null?void 0:e.columnsState)!=null&&D.defaultValue?aa({},(M=e==null?void 0:e.columnsState)==null?void 0:M.defaultValue,JSON.parse(I)):JSON.parse(I)}catch(I){console.warn(I)}}return((U=e.columnsState)==null?void 0:U.value)||((Y=e.columnsState)==null?void 0:Y.defaultValue)||f},(x=e.columnsState)==null?void 0:x.value),S=(C=e.columnsState)==null?void 0:C.onChange,y=d.useCallback(E=>{p(R=>{const D=typeof E=="function"?E(R):E;return S==null||S(D),D})},[S]);d.useEffect(()=>{var D,M;const{persistenceType:E,persistenceKey:R}=e.columnsState||{};if(R&&E&&typeof window<"u"){const U=window[E];try{const Y=U==null?void 0:U.getItem(R);Y?(D=e==null?void 0:e.columnsState)!=null&&D.defaultValue?y(aa({},(M=e==null?void 0:e.columnsState)==null?void 0:M.defaultValue,JSON.parse(Y))):y(JSON.parse(Y)):y(f)}catch(Y){console.warn(Y)}}},[(j=e.columnsState)==null?void 0:j.persistenceKey,(b=e.columnsState)==null?void 0:b.persistenceType,f]);const w=d.useCallback(()=>{const{persistenceType:E,persistenceKey:R}=e.columnsState||{};if(!R||!E||typeof window>"u")return;const D=window[E];try{D==null||D.removeItem(R)}catch(M){console.warn(M)}},[e.columnsState]);d.useEffect(()=>{var M,U;if(!((M=e.columnsState)!=null&&M.persistenceKey)||!((U=e.columnsState)!=null&&U.persistenceType)||typeof window>"u")return;const{persistenceType:E,persistenceKey:R}=e.columnsState,D=window[E];try{D==null||D.setItem(R,JSON.stringify(h))}catch(Y){console.warn(Y),w()}},[(v=e.columnsState)==null?void 0:v.persistenceKey,h,($=e.columnsState)==null?void 0:$.persistenceType]);const T={action:t.current,setAction:E=>{t.current=E},sortKeyColumns:l.current,setSortKeyColumns:E=>{l.current=E},propsRef:a,columnsMap:h,keyWords:i,setKeyWords:E=>o(E),setTableSize:g,tableSize:u,prefixName:r.current,setPrefixName:E=>{r.current=E},setColumnsMap:y,columns:e.columns,rootDomRef:n,clearPersistenceStorage:w,defaultColumnKeyMap:f};return Object.defineProperty(T,"prefixName",{get:()=>r.current}),Object.defineProperty(T,"sortKeyColumns",{get:()=>l.current}),Object.defineProperty(T,"action",{get:()=>t.current}),T}const qn=d.createContext({}),Gv=e=>{const t=qv(e.initValue);return s.jsx(qn.Provider,{value:t,children:e.children})},Zv=new $u("turn",{"0%":{transform:"rotate(0deg)"},"25%":{transform:"rotate(90deg)"},"50%":{transform:"rotate(180deg)"},"75%":{transform:"rotate(270deg)"},"100%":{transform:"rotate(360deg)"}}),Jv=e=>({[e.componentCls]:{boxSizing:"border-box","*, *::before, *::after":{boxSizing:"border-box"},zIndex:1,[`${e.antCls}-table-wrapper ${e.antCls}-table-pagination${e.antCls}-pagination`]:{marginBlockEnd:0},"&:not(:root):fullscreen":{minHeight:"100vh",overflow:"auto",background:e.colorBgContainer},"&-extra":{marginBlockEnd:16},"&-polling":{[`${e.componentCls}-list-toolbar-setting-item`]:{".anticon.anticon-reload":{transform:"rotate(0deg)",animationName:Zv,animationDuration:"1s",animationTimingFunction:"linear",animationIterationCount:"infinite"}}},[`td${e.antCls}-table-cell`]:{">a":{fontSize:e.fontSize}},[`${e.antCls}-table${e.antCls}-table-tbody${e.antCls}-table-wrapper:only-child${e.antCls}-table`]:{marginBlock:0,marginInline:0},[`${e.antCls}-table${e.antCls}-table-middle ${e.componentCls}`]:{marginBlock:0,marginInline:-8,[`${e.proComponentsCls}-card`]:{backgroundColor:"initial"}},"& &-search":{marginBlockEnd:"16px",background:e.colorBgContainer,"&-ghost":{background:"transparent"},[`&${e.componentCls}-form`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:16,overflow:"unset"},"&-light-filter":{marginBlockEnd:0,paddingBlock:0,paddingInline:0},"&-form-option":{[`${e.antCls}-form-item`]:{},[`${e.antCls}-form-item-label`]:{},[`${e.antCls}-form-item-control-input`]:{}},"@media (max-width: 575px)":{[e.componentCls]:{height:"auto !important",paddingBlockEnd:"24px",[`${e.antCls}-form-item-label`]:{minWidth:"80px",textAlign:"start"}}}},"&-toolbar":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"64px",paddingInline:24,paddingBlock:0,"&-option":{display:"flex",alignItems:"center",justifyContent:"flex-end"},"&-title":{flex:"1",color:e.colorTextLabel,fontWeight:"500",fontSize:"16px",lineHeight:"24px",opacity:"0.85"}}},[`@media (max-width: ${e.screenXS})px`]:{[e.componentCls]:{[`${e.antCls}-table`]:{width:"100%",overflowX:"auto","&-thead > tr,&-tbody > tr":{"> th,> td":{whiteSpace:"pre",">span":{display:"block"}}}}}},"@media (max-width: 575px)":{[`${e.componentCls}-toolbar`]:{flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",height:"auto",marginBlockEnd:"16px",marginInlineStart:"16px",paddingBlock:8,paddingInline:8,paddingBlockStart:"16px",lineHeight:"normal","&-title":{marginBlockEnd:16},"&-option":{display:"flex",justifyContent:"space-between",width:"100%"},"&-default-option":{display:"flex",flex:"1",alignItems:"center",justifyContent:"flex-end"}}}});function Xv(e){return tt("ProTable",t=>{const n={...t,componentCls:`.${e}`};return[Jv(n)]})}function Qv(e){let t=e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`);return t.startsWith("-")&&(t=t.slice(1)),t}const eT=(e,t)=>!e&&t!==!1?(t==null?void 0:t.filterType)==="light"?"LightFilter":"QueryFilter":"Form",tT=(e,t,n)=>!e&&n==="LightFilter"?Ze({...t},["labelWidth","defaultCollapsed","filterType"]):e?{}:Ze({labelWidth:t?t==null?void 0:t.labelWidth:void 0,defaultCollapsed:!0,...t},["filterType"]),nT=(e,t)=>e?Ze(t,["ignoreRules"]):{ignoreRules:!0,...t},rT=({onSubmit:e,formRef:t,dateFormatter:n="string",type:r,columns:a,action:i,ghost:o,manualRequest:l,onReset:u,submitButtonLoading:m,search:g,form:f,bordered:h})=>{const{hashId:p}=d.useContext(Xt),S=r==="form",y=async(v,$)=>{e&&e(v,$)},{getPrefixCls:w}=d.useContext(c.ConfigProvider.ConfigContext),T=d.useMemo(()=>a.filter(v=>!(v===c.Table.EXPAND_COLUMN||v===c.Table.SELECTION_COLUMN||v.search===!1&&r!=="form"||r==="form"&&v.hideInForm)).map(v=>{var R;const $=!v.valueType||["textarea","jsonCode","code"].includes(v==null?void 0:v.valueType)&&r==="table"?"text":v==null?void 0:v.valueType,E=(v==null?void 0:v.key)||((R=v==null?void 0:v.dataIndex)==null?void 0:R.toString());return{...v,width:void 0,...v.search&&typeof v.search=="object"?v.search:{},valueType:$,proFieldProps:{...v.proFieldProps,proFieldKey:E?`table-field-${E}`:void 0}}}),[a,r]),x=w("pro-table-search"),C=w("pro-table-form"),j=d.useMemo(()=>eT(S,g),[g,S]),b=d.useMemo(()=>({submitter:{submitButtonProps:{loading:m}}}),[m]);return s.jsx("div",{className:ie(p,{[w("pro-card")]:!0,[`${w("pro-card")}-border`]:!!h,[`${w("pro-card")}-bordered`]:!!h,[`${w("pro-card")}-ghost`]:!!o,[x]:!0,[C]:S,[w(`pro-table-search-${Qv(j)}`)]:!0,[`${x}-ghost`]:o,[g==null?void 0:g.className]:g!==!1&&(g==null?void 0:g.className)}),children:s.jsx(Yd,{layoutType:j,columns:T,type:r,...b,...tT(S,g,j),...nT(S,f||{}),formRef:t,action:i,dateFormatter:n,onInit:(v,$)=>{var E,R,D;if(t.current=$,r!=="form"){const M=(E=i.current)==null?void 0:E.pageInfo,{current:U=M==null?void 0:M.current,pageSize:Y=M==null?void 0:M.pageSize}=v;if((D=(R=i.current)==null?void 0:R.setPageInfo)==null||D.call(R,{...M,current:parseInt(U,10),pageSize:parseInt(Y,10)}),l)return;y(v,!0)}},onReset:v=>{u==null||u(v)},onFinish:v=>{y(v,!1)},initialValues:f==null?void 0:f.initialValues})})},sT=e=>{const{columns:t,loading:n,formRef:r,type:a,action:i,cardBordered:o,dateFormatter:l,form:u,search:m,pagination:g,ghost:f,manualRequest:h,beforeSearchSubmit:p=j=>j,onSubmit:S,onFormSearchSubmit:y,onReset:w}=e,T=d.useMemo(()=>g?xt({current:g.current,pageSize:g.pageSize}):{},[g]),x=je((j,b)=>{var E,R,D;if((u==null?void 0:u.ignoreRules)===!1&&b){(E=r==null?void 0:r.current)==null||E.validateFields().then(()=>{var Y,O;const M={...j,_timestamp:Date.now(),...T},U=Ze(p(M),Object.keys(T));y(U),b||(O=(Y=i.current)==null?void 0:Y.setPageInfo)==null||O.call(Y,{current:1}),S&&!b&&(S==null||S(j))}).catch(M=>{});return}const v={...j,_timestamp:Date.now(),...T},$=Ze(p(v),Object.keys(T));y($),b||(D=(R=i.current)==null?void 0:R.setPageInfo)==null||D.call(R,{current:1}),S&&!b&&(S==null||S(j))}),C=je(j=>{var v;const b=()=>{var E,R;const $=Ze(p({...j,...T}),Object.keys(T));y($),(R=(E=i.current)==null?void 0:E.setPageInfo)==null||R.call(E,{current:1}),w==null||w()};if((u==null?void 0:u.ignoreRules)===!1){(v=r==null?void 0:r.current)==null||v.validateFields().then(b).catch(()=>{});return}b()});return s.jsx(rT,{submitButtonLoading:n,columns:t,type:a,ghost:f,formRef:r,onSubmit:x,manualRequest:h,onReset:C,dateFormatter:l,search:m,form:{autoFocusFirstInput:!1,...u,extraUrlParams:{...T,...u==null?void 0:u.extraUrlParams}},action:i,bordered:Kd("search",o)})},aT=(e,t)=>{const n={columns:e.columns,loading:e.loading,formRef:e.formRef,type:e.type,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,form:e.form,search:e.search,manualRequest:e.manualRequest};return vn(n,{columns:t.columns,formRef:t.formRef,loading:t.loading,type:t.type,cardBordered:t.cardBordered,dateFormatter:t.dateFormatter,form:t.form,search:t.search,manualRequest:t.manualRequest})},iT=d.memo(sT,aT);function oT(e){const{search:t,type:n,pagination:r,beforeSearchSubmit:a,actionRef:i,columns:o,onFormSearchSubmit:l,ghost:u,onReset:m,onSubmit:g,loading:f,manualRequest:h,form:p,formRef:S,cardBordered:y,dateFormatter:w,searchFormRender:T,proTableProps:x}=e;return d.useMemo(()=>{const C=t===!1&&n!=="form"?null:s.jsx(iT,{pagination:r,beforeSearchSubmit:a,action:i,columns:o,onFormSearchSubmit:j=>{l(j)},ghost:u,onReset:m,onSubmit:g,loading:f,manualRequest:h,search:t,form:p,formRef:S,type:n||"table",cardBordered:y,dateFormatter:w});return T&&C?s.jsx(s.Fragment,{children:T(x,C)}):C},[i,a,y,o,w,p,S,u,f,h,l,m,g,r,x,t,T,n])}const lT=e=>({[e.componentCls]:{boxSizing:"border-box",width:"auto","&-title":{display:"flex",alignItems:"center",justifyContent:"space-between",height:"32px"},"&-overlay":{[`${e.antCls}-popover-inner-content`]:{width:"200px",paddingBlock:0,paddingInline:0,paddingBlockEnd:8},[`${e.antCls}-tree-node-content-wrapper:hover`]:{backgroundColor:"transparent"},[`${e.antCls}-tree-draggable-icon`]:{cursor:"grab"},[`${e.antCls}-tree-treenode`]:{alignItems:"center","&:hover":{[`${e.componentCls}-list-item-option`]:{display:"block"}},[`${e.antCls}-tree-checkbox`]:{marginInlineEnd:"4px"},[`${e.antCls}-tree-title`]:{width:"100%"}}}},[`${e.componentCls}-action-rest-button`]:{color:e.colorPrimary},[`${e.componentCls}-list`]:{display:"flex",flexDirection:"column",width:"100%",paddingBlockStart:8,[`&${e.componentCls}-list-group`]:{paddingBlockStart:0},"&-title":{marginBlockStart:"6px",marginBlockEnd:"6px",paddingInlineStart:"24px",color:e.colorTextSecondary,fontSize:"12px"},"&-item":{display:"flex",alignItems:"center",maxHeight:24,justifyContent:"space-between","&-title":{flex:1,maxWidth:80,textOverflow:"ellipsis",overflow:"hidden",wordBreak:"break-all",whiteSpace:"nowrap"},"&-option":{display:"none",float:"right",cursor:"pointer","> span":{"> span.anticon":{color:e.colorPrimary}},"> span + span":{marginInlineStart:4}}}}});function cT(e){return tt("ColumnSetting",t=>{const n={...t,componentCls:`.${e}`};return[lT(n)]})}const ii=({title:e,show:t,children:n,columnKey:r,fixed:a})=>{const{columnsMap:i,setColumnsMap:o}=d.useContext(qn);return t?s.jsx(c.Tooltip,{title:e,children:s.jsx("span",{onClick:l=>{l.stopPropagation(),l.preventDefault();const u=(i==null?void 0:i[r])||{},m={...i,[r]:{...u,fixed:a}};o(m)},children:n})}):null},uT=({columnKey:e,isLeaf:t,title:n,className:r,fixed:a,showListItemOption:i})=>{const o=Ne(),{hashId:l}=d.useContext(Xt),u=s.jsxs("span",{className:ie(`${r}-list-item-option`,l),children:[s.jsx(ii,{columnKey:e,fixed:"left",title:o.getMessage("tableToolBar.leftPin","固定在列首"),show:a!=="left",children:s.jsx(de.VerticalAlignTopOutlined,{})}),s.jsx(ii,{columnKey:e,fixed:void 0,title:o.getMessage("tableToolBar.noPin","不固定"),show:!!a,children:s.jsx(de.VerticalAlignMiddleOutlined,{})}),s.jsx(ii,{columnKey:e,fixed:"right",title:o.getMessage("tableToolBar.rightPin","固定在列尾"),show:a!=="right",children:s.jsx(de.VerticalAlignBottomOutlined,{})})]});return s.jsxs("span",{className:ie(`${r}-list-item`,l),children:[s.jsx("div",{className:ie(`${r}-list-item-title`,l),children:n}),i&&!t?u:null]},e)},oi=({list:e,draggable:t,checkable:n,showListItemOption:r,className:a,showTitle:i=!0,title:o,listHeight:l=280})=>{var x,C,j;const{hashId:u}=d.useContext(Xt),{columnsMap:m,setColumnsMap:g,sortKeyColumns:f,setSortKeyColumns:h}=d.useContext(qn),p=e&&e.length>0,S=d.useMemo(()=>{if(!p)return{};const b=[],v=new Map,$=(E,R)=>E.map(({key:D,dataIndex:M,children:U,...Y})=>{var A,k;const O=pr(D,[R==null?void 0:R.columnKey,Y.index].filter(Boolean).join("-")),I=(m==null?void 0:m[O||"null"])||{show:!0};I.show!==!1&&!U&&b.push(O);const F={key:O,...Ze(Y,["className"]),selectable:!1,disabled:I.disable===!0,disableCheckbox:typeof I.disable=="boolean"?I.disable:(A=I.disable)==null?void 0:A.checkbox,isLeaf:R?!0:void 0};return U&&(F.children=$(U,{...I,columnKey:O}),(k=F.children)!=null&&k.every(B=>b==null?void 0:b.includes(B.key))&&b.push(O)),v.set(D,{...F,parentKey:R==null?void 0:R.columnKey}),F});return{list:$(e),keys:b,map:v}},[m,e,p]),y=je((b,v,$)=>{const E={...m},R=[...f],D=R.findIndex(O=>O===b),M=R.findIndex(O=>O===v),U=$>=D;if(D<0)return;const Y=R[D];R.splice(D,1),$===0?R.unshift(Y):R.splice(U?M:M+1,0,Y),R.forEach((O,I)=>{E[O]={...E[O]||{},order:I}}),g(E),h(R)}),w=je(b=>{const v={...m},$=E=>{var M,U,Y,O,I,F;const R={...v[E]};R.show=b.checked,(U=(M=S.map)==null?void 0:M.get(E))!=null&&U.children&&((O=(Y=S.map.get(E))==null?void 0:Y.children)==null||O.forEach(A=>$(A.key)));const D=(F=(I=S.map)==null?void 0:I.get(E))==null?void 0:F.parentKey;D&&(v[D]={...v[D],show:!0}),v[E]=R};$(b.node.key),g({...v})});if(!p)return null;const T=s.jsx(c.Tree,{itemHeight:24,draggable:t&&!!((x=S.list)!=null&&x.length)&&((C=S.list)==null?void 0:C.length)>1,checkable:n,onDrop:b=>{const v=b.node.key,$=b.dragNode.key,{dropPosition:E,dropToGap:R}=b,D=E===-1||!R?E+1:E;y($,v,D)},blockNode:!0,onCheck:(b,v)=>w(v),checkedKeys:S.keys,showLine:!1,titleRender:b=>{const v={...b,children:void 0};if(!v.title)return null;const $=vt(v.title,v),E=s.jsx(c.Typography.Text,{style:{width:80},ellipsis:{tooltip:$},children:$});return s.jsx(uT,{className:a,...Ze(v,["key"]),showListItemOption:r,title:E,columnKey:v.key})},height:l,treeData:(j=S.list)==null?void 0:j.map(({disabled:b,...v})=>v)});return s.jsxs(s.Fragment,{children:[i&&s.jsx("span",{className:ie(`${a}-list-title`,u),children:o}),T]})},dT=({localColumns:e,className:t,draggable:n,checkable:r,showListItemOption:a,listsHeight:i})=>{const{hashId:o}=d.useContext(Xt),l=[],u=[],m=[],g=Ne();e.forEach(p=>{if(p.hideInSetting)return;const{fixed:S}=p;if(S==="left"){u.push(p);return}if(S==="right"){l.push(p);return}m.push(p)});const f=l&&l.length>0,h=u&&u.length>0;return s.jsxs("div",{className:ie(`${t}-list`,o,{[`${t}-list-group`]:f||h}),children:[s.jsx(oi,{title:g.getMessage("tableToolBar.leftFixedTitle","固定在左侧"),list:u,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i}),s.jsx(oi,{list:m,draggable:n,checkable:r,showListItemOption:a,title:g.getMessage("tableToolBar.noFixedTitle","不固定"),showTitle:h||f,className:t,listHeight:i}),s.jsx(oi,{title:g.getMessage("tableToolBar.rightFixedTitle","固定在右侧"),list:l,draggable:n,checkable:r,showListItemOption:a,className:t,listHeight:i})]})};function fT(e){const t=d.useRef(null),n=d.useContext(qn),r=e.columns,{checkedReset:a=!0}=e,{columnsMap:i,setColumnsMap:o,clearPersistenceStorage:l}=n;d.useEffect(()=>{var x,C,j,b;(C=(x=n.propsRef.current)==null?void 0:x.columnsState)!=null&&C.value&&(t.current=JSON.parse(JSON.stringify(((b=(j=n.propsRef.current)==null?void 0:j.columnsState)==null?void 0:b.value)||{})))},[]);const u=je((x=!0)=>{const C={},j=b=>{b.forEach(({key:v,fixed:$,index:E,children:R,disable:D})=>{var U,Y;const M=pr(v,E);M&&(C[M]={show:D?(U=i==null?void 0:i[M])==null?void 0:U.show:x,fixed:$,disable:D,order:(Y=i==null?void 0:i[M])==null?void 0:Y.order}),R&&j(R)})};j(r),o(C)}),m=je(x=>{x.target.checked?u():u(!1)}),g=je(()=>{var x,C;l==null||l(),o(((C=(x=n.propsRef.current)==null?void 0:x.columnsState)==null?void 0:C.defaultValue)||t.current||n.defaultColumnKeyMap)}),f=Object.values(i).filter(x=>!x||x.show===!1),h=f.length>0&&f.length!==r.length,p=Ne(),{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),y=S("pro-table-column-setting"),{wrapSSR:w,hashId:T}=cT(y);return w(s.jsx(c.Popover,{arrow:!1,title:s.jsxs("div",{className:ie(`${y}-title`,T),children:[e.checkable===!1?s.jsx("div",{}):s.jsx(c.Checkbox,{indeterminate:h,checked:f.length===0&&f.length!==r.length,onChange:x=>{m(x)},children:p.getMessage("tableToolBar.columnDisplay","列展示")}),a?s.jsx("a",{onClick:g,className:ie(`${y}-action-rest-button`,T),children:p.getMessage("tableToolBar.reset","重置")}):null,e!=null&&e.extra?s.jsx(c.Space,{size:12,align:"center",children:e.extra}):null]}),classNames:{root:ie(`${y}-overlay`,T)},trigger:"click",placement:"bottomRight",content:s.jsx(dT,{checkable:e.checkable??!0,draggable:e.draggable??!0,showListItemOption:e.showListItemOption??!0,className:y,localColumns:r,listsHeight:e.listsHeight}),children:e.children||s.jsx(c.Tooltip,{title:p.getMessage("tableToolBar.columnSetting","列设置"),children:e.settingIcon??s.jsx(de.SettingOutlined,{})})}))}const mT=e=>{const{hashId:t}=d.useContext(Xt),n=e.hashId??t,{items:r=[],type:a="inline",prefixCls:i,activeKey:o,defaultActiveKey:l}=e,[u,m]=dt(o||l,o),g=d.useCallback(h=>{m(p=>{var y;const S=typeof h=="function"?h(p):h;return(y=e.onChange)==null||y.call(e,S,p),S})},[e.onChange]);if(r.length<1)return null;const f=r.find(h=>h.key===u)||r[0];return a==="inline"?s.jsx("div",{className:ie(`${i}-menu`,`${i}-inline-menu`,n),children:r.map((h,p)=>s.jsx("div",{onClick:()=>{g(h.key)},className:ie(`${i}-inline-menu-item`,f.key===h.key?`${i}-inline-menu-item-active`:void 0,n),children:h.label},h.key||p))}):a==="tab"?s.jsx(c.Tabs,{items:r.map(h=>{var p;return{...h,key:(p=h.key)==null?void 0:p.toString()}}),activeKey:f.key,onTabClick:h=>g(h)}):s.jsx("div",{className:ie(`${i}-menu`,`${i}-dropdownmenu`,n),children:s.jsx(c.Dropdown,{trigger:["click"],menu:{selectedKeys:[f.key],onClick:h=>{g(h.key)},items:r.map((h,p)=>({key:h.key||p,disabled:h.disabled,label:h.label}))},children:s.jsxs(c.Space,{className:ie(`${i}-dropdownmenu-label`,n),children:[f.label,s.jsx(de.DownOutlined,{})]})})})},hT=e=>({[e.componentCls]:{boxSizing:"border-box",lineHeight:"1","&-container":{display:"flex",justifyContent:"space-between",paddingBlock:e.padding,paddingInline:e.paddingXS,"&-mobile":{flexDirection:"column"}},"&-title":{display:"flex",alignItems:"center",justifyContent:"flex-start",color:e.colorTextHeading,fontWeight:e.fontWeightStrong,fontSize:e.fontSizeLG},"&-search:not(:last-child)":{display:"flex",alignItems:"center",justifyContent:"flex-start"},"&-setting-item":{marginBlock:0,marginInline:4,color:e.colorIconHover,fontSize:e.fontSizeLG,cursor:"pointer","> span":{display:"block",width:"100%",height:"100%"},"&:hover":{color:e.colorPrimary}},"&-left":{display:"flex",flexWrap:"wrap",alignItems:"center",gap:e.marginXS,justifyContent:"flex-start",maxWidth:"calc(100% - 200px)",[`${e.antCls}-tabs`]:{width:"100%"},"&-has-tabs":{overflow:"hidden"}},"&-right":{flex:1,display:"flex",flexWrap:"wrap",justifyContent:"flex-end",gap:e.marginXS},"&-extra-line":{marginBlockEnd:e.margin},"&-setting-items":{display:"flex",gap:e.marginXS,lineHeight:"32px",alignItems:"center"},"&-filter":{"&:not(:last-child)":{marginInlineEnd:e.margin},display:"flex",alignItems:"center",[`div$${e.antCls}-pro-table-search`]:{marginBlock:0,marginInline:0,paddingBlock:0,paddingInline:0}},"&-inline-menu-item":{display:"inline-block",marginInlineEnd:e.marginLG,cursor:"pointer",opacity:"0.75","&-active":{fontWeight:"bold",opacity:"1"}},[`${e.antCls}-tabs-top > ${e.antCls}-tabs-nav`]:{marginBlockEnd:0,"&::before":{borderBlockEnd:0},[`${e.antCls}-tabs-nav-list`]:{marginBlockStart:0,[`${e.antCls}-tabs-tab`]:{paddingBlockStart:0}}},"&-dropdownmenu-label":{fontWeight:"bold",fontSize:e.fontSizeIcon,textAlign:"center",cursor:"pointer"},"@media (max-width: 768px)":{[e.componentCls]:{"&-container":{display:"flex",flexWrap:"wrap",flexDirection:"column"},"&-left":{marginBlockEnd:"16px",maxWidth:"100%"}}}}});function gT(e){return tt("ProTableListToolBar",t=>{const n={...t,componentCls:`.${e}`};return[hT(n)]})}function pT(e){if(d.isValidElement(e))return e;if(e){const t=e,{icon:n,tooltip:r,onClick:a,key:i}=t;return n&&r?s.jsx(c.Tooltip,{title:r,children:s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}):s.jsx("span",{onClick:()=>{a&&a(i)},children:n},i)}return null}const yT=({prefixCls:e,hashId:t,tabs:n,multipleLine:r,filtersNode:a})=>r?s.jsx("div",{className:ie(`${e}-extra-line`,t),children:n!=null&&n.items&&(n!=null&&n.items.length)?s.jsx(c.Tabs,{style:{width:"100%"},defaultActiveKey:n.defaultActiveKey,activeKey:n.activeKey,items:n.items.map((i,o)=>{var l;return{label:i.tab,...i,key:((l=i.key)==null?void 0:l.toString())||(o==null?void 0:o.toString())}}),onChange:n.onChange,tabBarExtraContent:a}):a}):null,xT=({prefixCls:e,title:t,subTitle:n,tooltip:r,className:a,style:i,search:o,onSearch:l,multipleLine:u=!1,filter:m,actions:g=[],settings:f=[],tabs:h,menu:p})=>{const{getPrefixCls:S}=d.useContext(c.ConfigProvider.ConfigContext),{token:y}=jn.useToken(),w=S("pro-table-list-toolbar",e),{wrapSSR:T,hashId:x}=gT(w),C=Ne(),[j,b]=d.useState(!1),v=C.getMessage("tableForm.inputPlaceholder","请输入"),$=d.useMemo(()=>o?d.isValidElement(o)?o:s.jsx(c.Input.Search,{style:{width:200},placeholder:v,...o,onSearch:async(...F)=>{var k;await((k=o.onSearch)==null?void 0:k.call(o,...F))!==!1&&(l==null||l(F==null?void 0:F[0]))}}):null,[v,l,o]),E=d.useMemo(()=>m?s.jsx("div",{className:ie(`${w}-filter`,x),children:m}):null,[m,x,w]),R=d.useMemo(()=>p||t||n||r,[p,n,t,r]),D=d.useMemo(()=>Array.isArray(g)?g.length<1?null:s.jsx("div",{style:{display:"flex",alignItems:"center",gap:y.marginXS},children:g.map((F,A)=>d.isValidElement(F)?d.cloneElement(F,{key:A,...F==null?void 0:F.props}):s.jsx(d.Fragment,{children:F},A))}):g,[g]),M=d.useMemo(()=>!!(R&&$||!u&&E||D||f!=null&&f.length),[D,E,R,u,$,f==null?void 0:f.length]),U=d.useMemo(()=>r||t||n||p||!R&&$,[R,p,$,n,t,r]),Y=d.useMemo(()=>!U&&M?s.jsx("div",{className:ie(`${w}-left`,x)}):!p&&(R||!$)?s.jsx("div",{className:ie(`${w}-left`,x),children:s.jsx("div",{className:ie(`${w}-title`,x),children:s.jsx(fr,{tooltip:r,label:t,subTitle:n})})}):s.jsxs("div",{className:ie(`${w}-left`,x,{[`${w}-left-has-tabs`]:(p==null?void 0:p.type)==="tab",[`${w}-left-has-dropdown`]:(p==null?void 0:p.type)==="dropdown",[`${w}-left-has-inline-menu`]:(p==null?void 0:p.type)==="inline"}),children:[R&&!p&&s.jsx("div",{className:ie(`${w}-title`,x),children:s.jsx(fr,{tooltip:r,label:t,subTitle:n})}),p&&s.jsx(mT,{...p,prefixCls:w,hashId:x}),!R&&$?s.jsx("div",{className:ie(`${w}-search`,x),children:$}):null]}),[U,M,R,x,p,w,$,n,t,r]),O=d.useMemo(()=>M?s.jsxs("div",{className:ie(`${w}-right`,x),style:j?{}:{alignItems:"center"},children:[u?null:E,R&&$?s.jsx("div",{className:ie(`${w}-search`,x),children:$}):null,D,f!=null&&f.length?s.jsx("div",{className:ie(`${w}-setting-items`,x),children:f.map((F,A)=>{const k=pT(F);return s.jsx("div",{className:ie(`${w}-setting-item`,x),children:k},A)})}):null]}):null,[M,w,x,j,R,$,u,E,D,f]),I=d.useMemo(()=>{if(!M&&!U)return null;const F=ie(`${w}-container`,x,{[`${w}-container-mobile`]:j});return s.jsxs("div",{className:F,children:[Y,O]})},[U,M,x,j,Y,w,O]);return T(s.jsx(ja,{onResize:F=>{F.width<375!==j&&b(F.width<375)},children:F=>s.jsxs("div",{ref:F,style:i,className:ie(w,x,a),children:[I,s.jsx(yT,{filtersNode:E,hashId:x,prefixCls:w,tabs:h,multipleLine:u})]})}))},bT=d.forwardRef((e,t)=>{const{icon:n=s.jsx(de.ColumnHeightOutlined,{})}=e,r=d.useContext(qn),a=Ne();return s.jsx(c.Dropdown,{menu:{selectedKeys:[r.tableSize],onClick:({key:i})=>{var o;(o=r.setTableSize)==null||o.call(r,i)},style:{width:80},items:[{key:"large",label:a.getMessage("tableToolBar.densityLarger","宽松")},{key:"middle",label:a.getMessage("tableToolBar.densityMiddle","中等")},{key:"small",label:a.getMessage("tableToolBar.densitySmall","紧凑")}]},trigger:["click"],children:s.jsx(c.Tooltip,{title:a.getMessage("tableToolBar.density","表格密度"),children:s.jsx("span",{ref:t,children:n})})})}),ST=d.memo(bT),CT=d.forwardRef((e,t)=>{const n=Ne(),[r,a]=d.useState(!1);return d.useEffect(()=>{xo()&&(document.onfullscreenchange=()=>{a(!!document.fullscreenElement)})},[]),r?s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.exitFullScreen","退出全屏"),children:s.jsx("span",{ref:t,children:s.jsx(de.FullscreenExitOutlined,{})})}):s.jsx(c.Tooltip,{title:n.getMessage("tableToolBar.fullScreen","全屏"),children:s.jsx("span",{ref:t,children:s.jsx(de.FullscreenOutlined,{})})})}),Wd=d.memo(CT);function wT({intl:e},t){return{reload:{text:e.getMessage("tableToolBar.reload","刷新"),icon:t.reloadIcon??s.jsx(de.ReloadOutlined,{})},density:{text:e.getMessage("tableToolBar.density","表格密度"),icon:s.jsx(ST,{icon:t.densityIcon})},fullScreen:{text:e.getMessage("tableToolBar.fullScreen","全屏"),icon:s.jsx(Wd,{})}}}function jT(e,t,n,r){return Object.keys(e).filter(a=>a).map(a=>{const i=e[a];if(!i)return null;let o=i===!0?t[a]:u=>{i==null||i(u,n.current)};if(typeof o!="function"&&(o=()=>{}),a==="setting")return d.createElement(fT,{...e[a],columns:r,key:a});if(a==="fullScreen")return s.jsx("span",{onClick:o,children:s.jsx(Wd,{})},a);const l=wT(t,e)[a];return l?s.jsx("span",{onClick:o,children:s.jsx(c.Tooltip,{title:l.text,children:l.icon})},a):null}).filter(a=>a)}function vT({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:m,optionsRender:g,...f}){const h=d.useContext(qn),p=Ne(),S=d.useMemo(()=>{const T={reload:()=>{var j;return(j=r==null?void 0:r.current)==null?void 0:j.reload()},density:!0,setting:!0,search:!1,fullScreen:()=>{var j,b;return(b=(j=r==null?void 0:r.current)==null?void 0:j.fullScreen)==null?void 0:b.call(j)}};if(a===!1)return[];const x={...T,fullScreen:!1,...a},C=jT(x,{...T,intl:p},r,m);return g?g({headerTitle:e,tooltip:t,toolBarRender:n,action:r,options:a,selectedRowKeys:i,selectedRows:o,toolbar:l,onSearch:u,columns:m,optionsRender:g,...f},C):C},[r,m,e,p,u,g,a,f,i,o,n,l,t]),y=n?n(r==null?void 0:r.current,{selectedRowKeys:i,selectedRows:o}):[],w=d.useMemo(()=>{if(!a||!a.search)return!1;const T={value:h.keyWords,onChange:x=>h.setKeyWords(x.target.value)};return a.search===!0?T:{...T,...a.search}},[h,a]);return d.useEffect(()=>{h.keyWords===void 0&&(u==null||u(""))},[h.keyWords,u]),s.jsx(xT,{title:e,tooltip:t,search:w,onSearch:u,actions:y,settings:S,...l})}const TT=e=>{const{hideToolbar:t,tableColumn:n,options:r,searchNode:a,tooltip:i,toolbar:o,selectedRows:l,selectedRowKeys:u,headerTitle:m,actionRef:g,toolBarRender:f,optionsRender:h,onFormSearchSubmit:p}=e,S=d.useCallback(y=>{var x,C,j,b;if(!r||!r.search)return;const{name:w="keyword"}=r.search===!0?{}:r.search;((C=(x=r.search)==null?void 0:x.onSearch)==null?void 0:C.call(x,y))!==!1&&((b=(j=g==null?void 0:g.current)==null?void 0:j.setPageInfo)==null||b.call(j,{current:1}),p(xt({_timestamp:Date.now(),[w]:y})))},[r,p,g]);return t?null:s.jsx(vT,{tooltip:i,columns:n,options:r,headerTitle:m,action:g,onSearch:S,selectedRows:l,selectedRowKeys:u,toolBarRender:f,toolbar:{filter:a,...o},optionsRender:h})},FT=(e,t)=>t.searchNode?!1:vn({hideToolbar:e.hideToolbar,tableColumn:e.tableColumn,options:e.options,tooltip:e.tooltip,toolbar:e.toolbar,selectedRows:e.selectedRows,selectedRowKeys:e.selectedRowKeys,headerTitle:e.headerTitle,actionRef:e.actionRef,toolBarRender:e.toolBarRender},{hideToolbar:t.hideToolbar,tableColumn:t.tableColumn,options:t.options,tooltip:t.tooltip,toolbar:t.toolbar,selectedRows:t.selectedRows,selectedRowKeys:t.selectedRowKeys,headerTitle:t.headerTitle,actionRef:t.actionRef,toolBarRender:t.toolBarRender},["render","formItemRender"]),$T=d.memo(TT,FT);function ET(e){const{toolBarRender:t,headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,isLightFilter:m,searchNode:g,options:f,optionsRender:h,actionRef:p,setFormSearch:S,formSearch:y}=e;return d.useMemo(()=>t===!1?null:s.jsx($T,{headerTitle:n,hideToolbar:r,selectedRows:a,selectedRowKeys:i,tableColumn:o,tooltip:l,toolbar:u,onFormSearchSubmit:w=>{S({...y||{},...w})},searchNode:m?g:null,options:f,optionsRender:h,actionRef:p,toolBarRender:t}),[p,y,n,r,m,f,h,g,i,a,S,o,t,l,u])}const RT=({pageInfo:e})=>{if(e){const{current:t,defaultCurrent:n,pageSize:r,defaultPageSize:a}=e;return{current:t||n||1,total:0,pageSize:r||a||20}}return{current:1,total:0,pageSize:20}};function IT(e){const[t,n]=dt(()=>RT(e),void 0),r=d.useCallback(i=>{n(o=>{var u;const l=typeof i=="function"?i(o):i;return(u=e==null?void 0:e.onPageInfoChange)==null||u.call(e,l),l})},[e==null?void 0:e.onPageInfoChange]),a=je(i=>{const o={...t,...i};(o.current!==t.current||o.pageSize!==t.pageSize||o.total!==t.total)&&r(o)});return[t,a]}const MT=(e,t,n)=>{var A;const r=d.useRef(!1),a=d.useRef(null),{onLoad:i,manual:o,polling:l,onRequestError:u,debounceTime:m=20,effects:g=[]}=n||{},f=d.useRef(o),h=d.useRef(),[p,S]=dt(t,n==null?void 0:n.dataSource),y=d.useCallback(k=>{S(B=>{const G=typeof k=="function"?k(B):k;return queueMicrotask(()=>{var _;(_=n==null?void 0:n.onDataSourceChange)==null||_.call(n,G)}),G})},[n==null?void 0:n.onDataSourceChange]),w=typeof(n==null?void 0:n.loading)=="object"?(A=n==null?void 0:n.loading)==null?void 0:A.spinning:n==null?void 0:n.loading,[T,x]=dt(!1,w),C=je(k=>{var B;(B=n==null?void 0:n.onLoadingChange)==null||B.call(n,k)}),j=d.useCallback(k=>{x(B=>{const G=typeof k=="function"?k(B):k;return queueMicrotask(()=>{C(G)}),G})},[C]),[b,v]=IT(n),[$,E]=d.useState(!1),R=(k,B)=>{y(k),(b==null?void 0:b.total)!==B&&v({...b,total:B||k.length})},D=Vr(b==null?void 0:b.current),M=Vr(b==null?void 0:b.pageSize),U=Vr(l),Y=je(()=>{j(!1),E(!1)}),O=async(k,B)=>{if(f.current){f.current=!1;return}k?E(!0):j(!0);const{pageSize:G,current:_}=b||{};try{const H=(n==null?void 0:n.pageInfo)!==!1?{current:_,pageSize:G}:void 0,{data:Z=[],success:q,total:V=0,...L}=await(e==null?void 0:e(H))||{};if(B!=null&&B.aborted)return[];if(q===!1)return[];const K=Bv(Z,[n.postData].filter(P=>P));return B!=null&&B.aborted?[]:(R(K,V),i==null||i(K,L),K)}catch(H){if(B!=null&&B.aborted)return[];if(u===void 0)throw new Error(H);p===void 0&&y([]),u(H)}finally{B!=null&&B.aborted||Y()}return[]},I=go(async k=>{if(h.current&&clearTimeout(h.current),!e)return;const B=new AbortController;a.current=B;try{const G=await Promise.race([O(k,B.signal),new Promise((H,Z)=>{var q,V,L;(L=(V=(q=a.current)==null?void 0:q.signal)==null?void 0:V.addEventListener)==null||L.call(V,"abort",()=>{Z("aborted"),I.cancel(),Y()})})]);if(B.signal.aborted)return;const _=vt(l,G);return _&&!r.current&&(h.current=setTimeout(()=>{I.run(_)},Math.max(_,2e3))),G}catch(G){if(G==="aborted")return[];throw G}},m||30),F=()=>{var k;(k=a.current)==null||k.abort(),I.cancel(),Y()};return d.useEffect(()=>(l||clearTimeout(h.current),!U&&l&&I.run(!0),()=>{clearTimeout(h.current)}),[l]),d.useEffect(()=>(r.current=!1,()=>{r.current=!0}),[]),d.useEffect(()=>{const{current:k,pageSize:B}=b||{};(!D||D===k)&&(!M||M===B)||n.pageInfo&&p&&(p==null?void 0:p.length)>B||k!==void 0&&p&&p.length<=B&&(F(),I.run(!1))},[b==null?void 0:b.current]),d.useEffect(()=>{M&&(F(),I.run(!1))},[b==null?void 0:b.pageSize]),ir(()=>(F(),I.run(!1),o||(f.current=!1),()=>{F()}),[...g,o]),{dataSource:p,setDataSource:y,loading:typeof(n==null?void 0:n.loading)=="object"?{...n==null?void 0:n.loading,spinning:T}:T,reload:async()=>(F(),f.current=!1,await I.run(!1)),pageInfo:b,pollingLoading:$,reset:async()=>{const{pageInfo:k}=n||{},{defaultCurrent:B=1,defaultPageSize:G=20}=k||{};v({current:B,total:0,pageSize:G})},setPageInfo:async k=>{v(k)}}},AT=e=>(t,n)=>{var m,g,f,h;const{fixed:r,index:a}=t,{fixed:i,index:o}=n;if(r==="left"&&i!=="left"||i==="right"&&r!=="right")return-2;if(i==="left"&&r!=="left"||r==="right"&&i!=="right")return 2;const l=t.key||`${a}`,u=n.key||`${o}`;return(m=e==null?void 0:e[l])!=null&&m.order||(g=e==null?void 0:e[u])!=null&&g.order?(((f=e==null?void 0:e[l])==null?void 0:f.order)||0)-(((h=e==null?void 0:e[u])==null?void 0:h.order)||0):(t.index||0)-(n.index||0)},kT=["",null,void 0],Vc=(...e)=>e.filter(t=>t!==void 0).map(t=>typeof t=="number"?t.toString():t).flat(1),OT=e=>{const t=d.useContext(wr),{columnProps:n,prefixName:r,text:a,counter:i,rowData:o,index:l,recordKey:u,subName:m,proFieldProps:g,editableUtils:f}=e,h=Tt.useFormInstance(),p=u||l,S=d.useMemo(()=>{var b;return((b=f==null?void 0:f.getRealIndex)==null?void 0:b.call(f,o))??l},[f,l,o]),[y,w]=d.useState(()=>Vc(r,r?m:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l)),T=d.useMemo(()=>y.slice(0,-1),[y]);d.useEffect(()=>{const b=Vc(r,r?m:[],r?S:p,(n==null?void 0:n.key)??(n==null?void 0:n.dataIndex)??l);b.join("-")!==y.join("-")&&w(b)},[n==null?void 0:n.dataIndex,n==null?void 0:n.key,l,u,r,p,m,y,S]);const x=d.useMemo(()=>[h,{...n,rowKey:T,rowIndex:l,isEditable:!0}],[n,h,l,T]),C=d.useCallback(({children:b,...v})=>s.jsx(wp,{popoverProps:{getPopupContainer:t.getPopupContainer||(()=>i.rootDomRef.current||document.body)},errorType:"popover",name:y,...v,children:b},p),[p,y]),j=d.useCallback(()=>{const b={...Ai(n==null?void 0:n.formItemProps,...x)};b.messageVariables={label:(n==null?void 0:n.title)||"此项",type:(n==null?void 0:n.valueType)||"文本",...b==null?void 0:b.messageVariables},b.initialValue=(r?null:a)??(b==null?void 0:b.initialValue)??(n==null?void 0:n.initialValue);let v=s.jsx(En,{cacheForSwr:!0,name:y,proFormFieldKey:p,ignoreFormItem:!0,fieldProps:Ai(n==null?void 0:n.fieldProps,...x),...g},y.join("-"));return n!=null&&n.formItemRender&&(v=n.formItemRender({...n,index:l,isEditable:!0,type:"table"},{defaultRender:()=>s.jsx(s.Fragment,{children:v}),type:"form",recordKey:u,record:{...o,...h==null?void 0:h.getFieldValue([p])},isEditable:!0},h,e.editableUtils),n.ignoreFormItem)?s.jsx(s.Fragment,{children:v}):s.jsx(C,{...b,children:v},y.join("-"))},[n,x,r,a,p,y,g,C,l,u,o,h,e.editableUtils]);return y.length===0?null:typeof(n==null?void 0:n.formItemRender)=="function"||typeof(n==null?void 0:n.fieldProps)=="function"||typeof(n==null?void 0:n.formItemProps)=="function"?s.jsx(c.Form.Item,{noStyle:!0,shouldUpdate:(b,v)=>{if(b===v)return!1;const $=[T].flat(1);try{return JSON.stringify(Be(b,$))!==JSON.stringify(Be(v,$))}catch{return!0}},children:()=>j()}):j()};function qd(e){var m,g;const{text:t,valueType:n,rowData:r,columnProps:a,index:i}=e;if((!n||["textarea","text"].includes(n.toString()))&&!(a!=null&&a.valueEnum)&&e.mode==="read")return kT.includes(t)?e.columnEmptyText:t;if(typeof n=="function"&&r)return qd({...e,valueType:n(r,e.type)||"text"});const o=(a==null?void 0:a.key)||((m=a==null?void 0:a.dataIndex)==null?void 0:m.toString()),l=a!=null&&a.dependencies?[e.prefixName,e.prefixName?i==null?void 0:i.toString():(g=e.recordKey)==null?void 0:g.toString(),a==null?void 0:a.dependencies].filter(Boolean).flat(1):[],u={valueEnum:vt(a==null?void 0:a.valueEnum,r),request:a==null?void 0:a.request,dependencies:a!=null&&a.dependencies?[l]:void 0,originDependencies:a!=null&&a.dependencies?[a==null?void 0:a.dependencies]:void 0,params:vt(a==null?void 0:a.params,r,a),readonly:a==null?void 0:a.readonly,text:n==="index"||n==="indexBorder"?e.index:t,mode:e.mode,formItemRender:void 0,valueType:n,record:r,proFieldProps:{emptyText:e.columnEmptyText,proFieldKey:o?`table-field-${o}`:void 0}};return e.mode!=="edit"?s.jsx(En,{mode:"read",ignoreFormItem:!0,fieldProps:Ai(a==null?void 0:a.fieldProps,null,a),...u}):s.jsx(OT,{...e,proFieldProps:u},e.recordKey)}const DT=e=>{var r;const{title:t}=e,n=typeof(e==null?void 0:e.ellipsis)=="boolean"?e==null?void 0:e.ellipsis:(r=e==null?void 0:e.ellipsis)==null?void 0:r.showTitle;return t&&typeof t=="function"?t(e,"table",null):s.jsx(fr,{label:t,tooltip:e.tooltip,ellipsis:n})};function PT(e,t,n,r){return typeof r=="boolean"?r===!1:(r==null?void 0:r(e,t,n))===!1}const NT=(e,t,n)=>{const r=Array.isArray(n)?Be(t,n):t[n],a=String(r);return String(a)===String(e)};function LT({columnProps:e,text:t,rowData:n,index:r,columnEmptyText:a,counter:i,type:o,subName:l,marginSM:u,editableUtils:m}){const{action:g,prefixName:f}=i,{isEditable:h,recordKey:p}=m.isEditable({...n,index:r}),{renderText:S=j=>j}=e,y=S(t,n,r,g),w=h&&!PT(t,n,r,e==null?void 0:e.editable)?"edit":"read",T=qd({text:y,valueType:e.valueType||"text",index:r,rowData:n,subName:l,columnProps:{...e,entry:n,entity:n},counter:i,columnEmptyText:a,type:o,recordKey:p,mode:w,prefixName:f,editableUtils:m}),x=w==="edit"?T:Dp(T,e,y,t);if(w==="edit")return e.valueType==="option"?s.jsx("div",{style:{display:"flex",alignItems:"center",gap:u,justifyContent:e.align==="center"?"center":"flex-start"},children:m.actionRender({...n,index:e.index||r})}):x;if(!e.render){const j=d.isValidElement(x)||["string","number"].includes(typeof x);return!Lt(x)&&j?x:null}const C=e.render(x,n,r,{...g,...m},{...e,isEditable:h,type:"table"});return Vv(C)?C:C&&e.valueType==="option"&&Array.isArray(C)?s.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",gap:8},children:C}):C}function _T(e){const{onFilter:t,dataIndex:n}=e;return t===!0?(r,a)=>NT(r,a,n):Wu(t)}function zT(e){const{filters:t=[],valueEnum:n}=e;return t===!0?Fd(vt(n,void 0)).filter(r=>r&&r.value!=="all"):t}function BT(e,t,n){return{fixed:((e==null?void 0:e[t])||{fixed:n.fixed}).fixed}}function VT(e,t,n){return{filteredValue:Wv(e,n),sortOrder:Kv(t,n)}}function HT(e,t,n,r,a){var u;if(typeof e!="object"||e===null||!Reflect.has(e,n))return;const i=e,o=i[n],l=a.get(o)||[];return(u=i[r])==null||u.forEach(m=>{const g=m[n];a.has(g)||a.set(g,l.concat([t,r]))}),o}function UT(e,t,n){let r=t.rowKey??"id";return function(i,o,l){typeof t.rowKey=="function"&&(r=t.rowKey(o,l));const u=HT(o,l,r,t.childrenColumnName,n);return LT({columnProps:e,text:i,rowData:o,index:l,columnEmptyText:t.columnEmptyText,counter:t.counter,type:t.type,marginSM:t.marginSM,subName:n.get(u)??[],editableUtils:t.editableUtils})}}function Gd(e){var i;const{columns:t,context:n,parents:r}=e,a=new Map;return(i=t==null?void 0:t.map((o,l)=>{if(o===c.Table.EXPAND_COLUMN||o===c.Table.SELECTION_COLUMN)return o;const{key:u,dataIndex:m,valueEnum:g,valueType:f="text",children:h}=o,p=pr(u||(m==null?void 0:m.toString()),[r==null?void 0:r.key,l].filter(Boolean).join("-"));if(!g&&!f&&!h)return{index:l,...o};const{filteredValue:y,sortOrder:w}=VT(n.proFilter,n.proSort,o),{fixed:T}=BT(n.counter.columnsMap,p,o),x={index:l,key:p,...o,title:DT(o),valueEnum:g,filters:zT(o),onFilter:_T(o),filteredValue:y,sortOrder:w,fixed:T,width:o.width||(o.fixed?200:void 0),children:o.children?Gd({columns:(o==null?void 0:o.children)??[],context:n,parents:{...o,key:p}}):void 0,render:UT(o,n,a)};return Yp(x)}))==null?void 0:i.filter(o=>!o.hideInTable)}function YT({dataSource:e,editableUtils:t,pagination:n,getRowKey:r,childrenColumnName:a}){var f;const i=Array.isArray(e)?[...e]:[],o=t==null?void 0:t.newLineRecord,l=o==null?void 0:o.defaultValue;if(!o||!l)return i;const{options:u}=o,m=a;if(u!=null&&u.parentKey){const h={...l,map_row_parentKey:(f=it(u.parentKey))==null?void 0:f.toString()},p={data:i,getRowKey:r,row:h,key:(u==null?void 0:u.recordKey)??r(h,-1),childrenColumnName:m};return Pr(p,(u==null?void 0:u.position)==="top"?"top":"update")}if((u==null?void 0:u.position)==="top")return[l,...i];const g=n&&typeof n=="object"?n:void 0;if(g!=null&&g.current&&(g!=null&&g.pageSize)){if(g.pageSize>i.length)return i.push(l),i;const h=g.current*g.pageSize-1;return i.splice(h,0,l),i}return i.push(l),i}function KT({propsCardProps:e,notNeedCardDom:t,name:n,hideToolbar:r,toolbarDom:a}){return e===!1||t||n?{}:r?{padding:0}:a?{paddingBlockStart:0}:{padding:0}}function WT({rowKey:e,name:t}){return d.useMemo(()=>typeof e=="function"?e:(n,r)=>r===-1?n==null?void 0:n[e]:t?r==null?void 0:r.toString():(n==null?void 0:n[e])??(r==null?void 0:r.toString()),[t,e])}function qT({propsPagination:e,action:t,intl:n,request:r,type:a}){return d.useMemo(()=>{const i=e===!1?!1:{...e||{}},o={...t.pageInfo,setPageInfo:({pageSize:l,current:u})=>{const{pageInfo:m}=t;if(l===m.pageSize||m.current===1){t.setPageInfo({pageSize:l,current:u});return}r&&t.setDataSource([]),t.setPageInfo({pageSize:l,current:a==="list"?u:1})}};return r&&i&&(delete i.onChange,delete i.onShowSizeChange),_v(i,o,n)},[t,n,e,r,a])}function GT({propsRowSelection:e,selectedRowKeys:t,selectedRows:n,onCleanSelected:r,tableAlertOptionRender:a,tableAlertRender:i}){return d.useMemo(()=>e===!1?null:s.jsx(Lv,{selectedRowKeys:t,selectedRows:n,onCleanSelected:r,alertOptionRender:a,alertInfoRender:i,alwaysShowAlert:e==null?void 0:e.alwaysShowAlert}),[r,e,t,n,a,i])}const ZT={},JT=e=>{var Rn,Zn,us,Jn,Xn,ds;const{cardBordered:t,request:n,className:r,params:a=ZT,defaultData:i,headerTitle:o,postData:l,ghost:u,pagination:m,actionRef:g,toolBarRender:f,optionsRender:h,onLoad:p,onRequestError:S,style:y,cardProps:w,tableStyle:T,tableClassName:x,options:C,search:j,name:b,onLoadingChange:v,rowSelection:$=!1,beforeSearchSubmit:E,tableAlertRender:R,defaultClassName:D,formRef:M,type:U="table",columnEmptyText:Y="-",toolbar:O,rowKey:I,manualRequest:F,polling:A,tooltip:k,revalidateOnFocus:B=!1,searchFormRender:G,..._}=e,{wrapSSR:H,hashId:Z}=Xv(e.defaultClassName),q=ie(D,r,Z),V=d.useRef(),L=d.useRef(null),K=d.useRef(),P=M||K;d.useImperativeHandle(g,()=>V.current);const[W,te]=dt($?($==null?void 0:$.defaultSelectedRowKeys)||[]:void 0,$?$.selectedRowKeys:void 0),[re,X]=d.useState(()=>{if(!(F||j!==!1))return{}}),se=d.useRef(re),ae=je(ge=>{const we=typeof ge=="function"?ge(se.current):ge;se.current=we,X(we)}),{columns:ue=[],columnsState:pe}=e,{defaultProFilter:me,defaultProSort:fe}=d.useMemo(()=>{const{sort:ge,filter:we}=Yv(eo(ue));return{defaultProFilter:we,defaultProSort:ge}},[ue]),[ye,Te]=d.useState(me),[Oe,Ae]=d.useState(fe);ir(()=>{Te(me),Ae(fe)},[me,fe]);const ze=Ne(),ce=typeof m=="object"?m:{defaultCurrent:1,defaultPageSize:20,pageSize:20,current:1},z=d.useContext(qn),J=d.useMemo(()=>{if(n)return async ge=>{const we={...ge||{},...se.current||{},...a};return delete we._timestamp,await n(we,Oe,ye)}},[re,a,ye,Oe,n]),le=MT(J,i,{pageInfo:m===!1?!1:ce,loading:e.loading,dataSource:e.dataSource,onDataSourceChange:e.onDataSourceChange,onLoad:p,onLoadingChange:v,onRequestError:S,postData:l,revalidateOnFocus:B,manual:re===void 0,polling:A,effects:[wn(a),wn(re),wn(ye),wn(Oe)],debounceTime:e.debounceTime,onPageInfoChange:ge=>{var we,N;!m||!J||((we=m==null?void 0:m.onChange)==null||we.call(m,ge.current,ge.pageSize),(N=m==null?void 0:m.onShowSizeChange)==null||N.call(m,ge.current,ge.pageSize))}});d.useEffect(()=>{var we;if(e.manualRequest||!e.request||!B||(we=e.form)!=null&&we.ignoreRules)return;const ge=()=>{document.visibilityState==="visible"&&le.reload()};return document.addEventListener("visibilitychange",ge),()=>document.removeEventListener("visibilitychange",ge)},[]);const Se=d.useRef(new Map),Ee=WT({rowKey:I,name:e.name});d.useMemo(()=>{var ge;return(ge=le.dataSource)!=null&&ge.length?le.dataSource.map(N=>{const ee=Ee(N,-1);return Se.current.set(ee,N),ee}):[]},[le.dataSource,Ee]);const Fe=qT({propsPagination:m,action:le,intl:ze,request:n,type:U});ir(()=>{Fe&&(Fe.current!==le.pageInfo.current||Fe.pageSize!==le.pageInfo.pageSize)&&le.setPageInfo({current:Fe.current,pageSize:Fe.pageSize})},[Fe]),ir(()=>{var ge;e.request&&!IC(a)&&le.dataSource&&!Qa(le.dataSource,i)&&((ge=le==null?void 0:le.pageInfo)==null?void 0:ge.current)!==1&&le.setPageInfo({current:1})},[a]),z.setPrefixName(e.name),d.useEffect(()=>{(pe==null?void 0:pe.value)!==void 0&&z.setColumnsMap(pe.value)},[pe==null?void 0:pe.value]);const Ie=je(()=>{$&&$.onChange&&$.onChange([],[],{type:"none"}),te([])});z.propsRef.current=e;const De=KC({...e.editable,tableName:e.name,getRowKey:Ee,childrenColumnName:((Rn=e.expandable)==null?void 0:Rn.childrenColumnName)||"children",dataSource:le.dataSource||[],setDataSource:ge=>{var we,N;(N=(we=e.editable)==null?void 0:we.onValuesChange)==null||N.call(we,void 0,ge),le.setDataSource(ge)}}),{token:ve}=jn==null?void 0:jn.useToken();zv(V,le,{nativeElement:((Zn=z.rootDomRef)==null?void 0:Zn.current)||void 0,focus:()=>{var ge,we;(we=(ge=z.rootDomRef)==null?void 0:ge.current)==null||we.focus()},fullScreen:()=>{var ge,we;!((ge=z.rootDomRef)!=null&&ge.current)||!document.fullscreenEnabled||(document.fullscreenElement?document.exitFullscreen():(we=z.rootDomRef)==null||we.current.requestFullscreen())},onCleanSelected:()=>{Ie()},resetAll:()=>{var N,ee,xe,$e,Ke;Ie(),z.setKeyWords(void 0),le.setPageInfo({current:1}),Te(me),Ae(fe),(N=P==null?void 0:P.current)==null||N.resetFields();const ge=((xe=(ee=P==null?void 0:P.current)==null?void 0:ee.getFieldsFormatValue)==null?void 0:xe.call(ee,!0))??((Ke=($e=P==null?void 0:P.current)==null?void 0:$e.getFieldsValue)==null?void 0:Ke.call($e,!0))??{},we=E?E(ge):ge;ae(we??{})},editableUtils:De,scrollTo:ge=>{var we,N;return(N=(we=L==null?void 0:L.current)==null?void 0:we.scrollTo)==null?void 0:N.call(we,ge)}}),z.setAction(V.current);const ke=d.useMemo(()=>{var we;const ge={counter:z,columnEmptyText:Y,type:U,editableUtils:De,marginSM:ve.marginSM,rowKey:I??"id",childrenColumnName:((we=e.expandable)==null?void 0:we.childrenColumnName)??"children",proFilter:ye,proSort:Oe};return Gd({columns:ue,context:ge}).sort(AT(z.columnsMap??{}))},[ue,z==null?void 0:z.sortKeyColumns,z==null?void 0:z.columnsMap,Y,U,De.editableKeys&&De.editableKeys.join(","),ye,Oe]);Yu(()=>{if(ke&&ke.length>0){const ge=ke.map(we=>pr(we.key,we.index));z.setSortKeyColumns(ge)}},[ke],["render","formItemRender"],100),ir(()=>{const{pageInfo:ge}=le,{current:we=ge==null?void 0:ge.current,pageSize:N=ge==null?void 0:ge.pageSize}=m||{};m&&(we||N)&&(N!==(ge==null?void 0:ge.pageSize)||we!==(ge==null?void 0:ge.current))&&le.setPageInfo({pageSize:N||ge.pageSize,current:we||ge.current})},[m&&m.pageSize,m&&m.current]);const Le={selectedRowKeys:W,...$,onChange:(ge,we,N)=>{$&&$.onChange&&$.onChange(ge,we,N),te(ge)}},lt=j!==!1&&(j==null?void 0:j.filterType)==="light",nt=je(ge=>{var we,N;if(C&&C.search){const{name:ee="keyword"}=C.search===!0?{}:C.search;if(((N=(we=C.search)==null?void 0:we.onSearch)==null?void 0:N.call(we,z.keyWords))!==!1){ae({...ge,[ee]:z.keyWords});return}}ae(ge)}),ne=d.useMemo(()=>{var ge;return typeof le.loading=="object"?((ge=le.loading)==null?void 0:ge.spinning)||!1:le.loading},[le.loading]),Q=s.jsx(oT,{search:j,type:U,pagination:Fe,beforeSearchSubmit:E,actionRef:V,columns:ue,onFormSearchSubmit:nt,ghost:u,onReset:e.onReset,onSubmit:e.onSubmit,loading:!!ne,manualRequest:F,form:e.form,formRef:P,cardBordered:e.cardBordered,dateFormatter:e.dateFormatter,searchFormRender:G,proTableProps:e}),he=d.useMemo(()=>W==null?void 0:W.map(ge=>{var we;return(we=Se.current)==null?void 0:we.get(ge)}),[le.dataSource,W]),Ce=d.useMemo(()=>C===!1&&!o&&!f&&!O&&!lt,[C,o,f,O,lt]),Je=s.jsx(ET,{toolBarRender:f,headerTitle:o,hideToolbar:Ce,selectedRows:he,selectedRowKeys:W,tableColumn:ke,tooltip:k,toolbar:O,isLightFilter:lt,searchNode:Q,options:C,optionsRender:h,actionRef:V,setFormSearch:ae,formSearch:re}),Ct=GT({propsRowSelection:$,selectedRowKeys:W,selectedRows:he,onCleanSelected:Ie,tableAlertOptionRender:_.tableAlertOptionRender,tableAlertRender:R}),tn=d.useMemo(()=>{var ge;return YT({dataSource:le.dataSource,editableUtils:De,pagination:Fe,getRowKey:Ee,childrenColumnName:((ge=e.expandable)==null?void 0:ge.childrenColumnName)||"children"})},[le.dataSource,De==null?void 0:De.newLineRecord,Ee,Fe,(us=e.expandable)==null?void 0:us.childrenColumnName]),ht=d.useMemo(()=>{const ge=we=>we.map(N=>{var $e;const ee=pr(N.key,N.index),xe=($e=z.columnsMap)==null?void 0:$e[ee];return xe&&xe.show===!1?!1:N.children?{...N,children:ge(N.children)}:N}).filter(Boolean);return ge(ke)},[z.columnsMap,ke]),is=d.useMemo(()=>eo(ht).filter(we=>!!we.filters),[ht]),Ta=ge=>{Qa(ge,Oe)||Ae(ge??{})},Fa=ge=>{Qa(ge,ye)||Te(ge??{})},fn=()=>({..._,size:z.tableSize,rowSelection:$===!1?void 0:Le,className:x,style:T,columns:ht,loading:le.loading,dataSource:tn,pagination:Fe,onChange:(ge,we,N,ee)=>{var Ke;(Ke=_.onChange)==null||Ke.call(_,ge,we,N,ee);const xe=Hv(we,is);Fa(xt(xe));const $e=Uv(N);Ta(xt($e))}}),Gn=j===!1&&!o&&!f,os=s.jsx(To.Provider,{value:{grid:!1,colProps:void 0,rowProps:void 0},children:s.jsx(c.Table,{...fn(),rowKey:I,ref:L})}),Tr=e.tableViewRender?e.tableViewRender({...fn(),rowSelection:$!==!1?Le:void 0},os):os,ls=e.editable&&!b?s.jsxs(s.Fragment,{children:[Je,Ct,d.createElement(Tt,{...e.editable.formProps,formRef:(Jn=e.editable.formProps)==null?void 0:Jn.formRef,component:!1,form:e.editable.form,onValuesChange:De.onValuesChange,key:"table",submitter:!1,omitNil:!1,dateFormatter:e.dateFormatter},Tr)]}):s.jsxs(s.Fragment,{children:[Je,Ct,Tr]}),$a=KT({propsCardProps:w,notNeedCardDom:Gn,name:e.name,hideToolbar:Ce,toolbarDom:Je}),Ye=d.useMemo(()=>w!==!1&&!e.name&&!Gn||w!==!1&&U==="list",[w,e.name,U,Gn]),Fr=w===!1?{}:w??{},cs=Ye?s.jsx(Ca,{...Fr,ghost:u,variant:Kd("table",t)?"outlined":"borderless",styles:{body:{...$a,...((Xn=Fr.styles)==null?void 0:Xn.body)??{}},header:(ds=Fr.styles)==null?void 0:ds.header},children:ls}):ls,Ea=()=>e.tableRender?e.tableRender(e,cs,{toolbar:Je||void 0,alert:Ct||void 0,table:Tr||void 0}):cs,$r=s.jsxs("div",{className:ie(q,{[`${D}-polling`]:le.pollingLoading}),style:y,ref:z.rootDomRef,"data-testid":"pro-table",children:[lt?null:Q,U!=="form"&&e.tableExtraRender&&s.jsx("div",{className:ie(q,`${D}-extra`),children:e.tableExtraRender(e,le.dataSource||[])}),U!=="form"&&Ea()]});return!C||!(C!=null&&C.fullScreen)?H($r):H(s.jsx(c.ConfigProvider,{getPopupContainer:()=>z.rootDomRef.current||document.body,children:$r}))},vr=e=>{const{getPrefixCls:t}=d.useContext(c.ConfigProvider.ConfigContext),n=e.ErrorBoundary===!1?d.Fragment:e.ErrorBoundary||fp,r=d.useContext(Zt);return s.jsx(Gv,{initValue:{...e,columnsState:e.columnsState,columns:e.columns,onSizeChange:e.onSizeChange,size:e.size||void 0,defaultSize:e.defaultSize||void 0},children:s.jsx(Bn,{valueTypeMap:{...r.valueTypeMap,...Rd},needDeps:!0,children:s.jsx(n,{children:s.jsx(JT,{defaultClassName:`${t("pro-table")}`,...e})})})})};vr.Summary=c.Table.Summary;let XT="/api";function ct(){return cn.createRequest({baseURL:XT,timeout:15e3})}const Xe={listResourcesByApp:e=>ct().get("/ctc/authz/resources/page-by-app",{params:e}),listAllResources:()=>ct().get("/ctc/authz/resources/list"),pageResources:e=>ct().get("/ctc/authz/resources/page",{params:e}),distinctApps:()=>ct().get("/ctc/authz/resources/distinct-apps"),getResource:e=>ct().get("/ctc/authz/resources",{params:{id:e}}),createResource:e=>ct().post("/ctc/authz/resources",e),updateResource:(e,t)=>ct().put("/ctc/authz/resources",t,{params:{id:e}}),deleteResource:e=>ct().delete("/ctc/authz/resources",{params:{id:e}}),listResourceRoles:e=>ct().get("/ctc/authz/resources/roles",{params:{resourceId:e}}),grantRoleResource:(e,t,n)=>{const r=n==null?{}:{dataFilter:n};return ct().post("/ctc/authz/roles/grant-resource",r,{params:{roleId:e,resourceId:t}})},revokeRoleResource:(e,t)=>ct().delete("/ctc/authz/roles/revoke-resource",{params:{roleId:e,resourceId:t}}),listAllRoles:()=>ct().get("/ctc/authz/roles/list"),pageRoles:e=>ct().get("/ctc/authz/roles/page",{params:e}),getRole:e=>ct().get("/ctc/authz/roles",{params:{id:e}}),createRole:e=>ct().post("/ctc/authz/roles",e),updateRole:(e,t)=>ct().put("/ctc/authz/roles",t,{params:{id:e}}),deleteRole:e=>ct().delete("/ctc/authz/roles",{params:{id:e}}),listUserRoles:e=>ct().get("/ctc/authz/users/roles",{params:{userId:e}}),listUserPermissions:e=>ct().get("/ctc/authz/users/permissions",{params:{userId:e}}),grantUserRole:(e,t,n)=>{const r={userId:e,roleId:t};return n&&(r.expireAt=n),ct().post("/ctc/authz/users/grant-role",null,{params:r})},revokeUserRole:(e,t)=>ct().delete("/ctc/authz/users/revoke-role",{params:{userId:e,roleId:t}}),listRolePermissions:e=>ct().get("/ctc/authz/roles/resources",{params:{roleId:e}}),check:e=>ct().post("/ctc/authz/check",e)},lr={listAccounts:e=>sn.listByTenant(e),listUserRoles:e=>Xe.listUserRoles(e),listUserPermissions:e=>Xe.listUserPermissions(e),listRoleResources:e=>Xe.listRolePermissions(e)},{Text:QT}=c.Typography,As={0:{text:"禁用",color:"default"},1:{text:"正常",color:"success"},2:{text:"锁定",color:"warning"}},ks={1:{text:"超级管理员",color:"red"},2:{text:"租户管理员",color:"volcano"},3:{text:"普通成员",color:"blue"},4:{text:"临时账号",color:"orange"}},eF={1:{text:"用户名",color:"blue"},2:{text:"邮箱",color:"purple"},3:{text:"手机",color:"cyan"}};function nn({value:e}){const t=e==null||e===""?"-":String(e);return t==="-"?s.jsx("span",{children:"-"}):s.jsx(c.Tooltip,{title:t,placement:"topLeft",children:s.jsx("span",{style:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t})})}function tF({apiBaseURL:e}){var Oe,Ae,ze,ce;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState(!1),[p,S]=d.useState(null),[y]=c.Form.useForm(),[w]=c.Form.useForm(),[T,x]=d.useState(!1),[C,j]=d.useState(null),[b,v]=d.useState("info"),[$,E]=d.useState([]),[R,D]=d.useState(!1),[M,U]=d.useState([]),[Y,O]=d.useState([]),[I,F]=d.useState(!1),[A,k]=d.useState(!1),[B,G]=d.useState([]),[_,H]=d.useState(!1),Z=async z=>{if(!z){E([]);return}D(!0);try{const J=await df.list({accountId:Number(z),pageSize:50});E((J==null?void 0:J.records)||[])}catch{E([])}finally{D(!1)}},q=async z=>{if(!z){U([]),O([]);return}F(!0),k(!0);try{const[J,le]=await Promise.all([lr.listUserRoles(z),lr.listUserPermissions(z)]);U(Array.isArray(J)?J:[]),O(Array.isArray(le)?le:[])}catch{U([]),O([])}finally{F(!1),k(!1)}},V=async z=>{if(!z){G([]);return}H(!0);try{const J=await sn.listAffiliations(Number(z));G(Array.isArray(J)?J:[])}catch{G([])}finally{H(!1)}},L=z=>{j(z),v("info"),x(!0),Z(z.id)},K=()=>{x(!1),j(null),E([]),U([]),O([]),G([])},P=z=>{v(z),z==="logs"&&(C!=null&&C.id)&&Z(C.id),z==="roles"&&(C!=null&&C.id)&&q(C.id),z==="affiliations"&&(C!=null&&C.id)&&V(C.id)},W=d.useCallback(()=>{var le;const z=n.getFieldsValue(),J={};z.username&&(J.username=z.username),z.status!==void 0&&(J.status=z.status),z.dateRange&&(J.startDate=z.dateRange[0].format("YYYY-MM-DD"),J.endDate=z.dateRange[1].format("YYYY-MM-DD")),a(J),(le=t.current)==null||le.reload()},[n]),te=d.useCallback(()=>{var z;n.resetFields(),a({}),(z=t.current)==null||z.reload()},[n]),re=async z=>{try{let le=await sn.listByTenant({tenant:r.tenant,pageNum:z.current,pageSize:z.pageSize})||[];const Se=r.username,Ee=r.status,Fe=r.startDate,Ie=r.endDate;return le=le.filter(De=>{var ve;return!(Se&&!((ve=De.username)!=null&&ve.includes(Se))||Ee!==void 0&&De.status!==Ee||Fe&&De.createdAt&&Re(De.createdAt).isBefore(Fe,"day")||Ie&&De.createdAt&&Re(De.createdAt).isAfter(Ie,"day"))}),{data:le,success:!0,total:le.length}}catch(J){return c.message.error("获取账号列表失败:"+((J==null?void 0:J.message)||"未知错误")),{data:[],success:!1,total:0}}},X=async()=>{var z;try{const J=await y.validateFields();await sn.create(J),c.message.success("创建成功"),g(!1),y.resetFields(),(z=t.current)==null||z.reload()}catch(J){if(J!=null&&J.errorFields)return;c.message.error("创建失败:"+((J==null?void 0:J.message)||"未知错误"))}},se=async(z,J)=>{var Se;const le=J===1?0:1;try{await sn.updateStatus(z,le),c.message.success(le===1?"已启用":"已停用"),(Se=t.current)==null||Se.reload()}catch(Ee){c.message.error("操作失败:"+((Ee==null?void 0:Ee.message)||"未知错误"))}},ae=async()=>{var z;try{await Promise.all(l.map(J=>sn.updateStatus(J.id,0))),c.message.success(`已停用 ${l.length} 个账号`),o([]),u([]),(z=t.current)==null||z.reload()}catch(J){c.message.error("批量操作失败:"+((J==null?void 0:J.message)||"未知错误"))}},ue=()=>{const z=`ID,账号,昵称,类型,邮箱,手机,租户,状态,创建时间
56
+ `,J=l.length>0?l:[];if(J.length===0){c.message.warning("请先选择要导出的数据,或取消选择导出全部");return}const le=z+J.map(Ie=>[Ie.id,Ie.username,Ie.nickname,(ks[Ie.accountType??3]||{text:String(Ie.accountType)}).text,Ie.email,Ie.phone,Ie.tenantCode,(As[Ie.status??1]||{text:String(Ie.status)}).text,Ie.createdAt].join(",")).join(`
57
+ `),Se=new Blob(["\uFEFF"+le],{type:"text/csv;charset=utf-8"}),Ee=URL.createObjectURL(Se),Fe=document.createElement("a");Fe.href=Ee,Fe.download=`accounts_${Re().format("YYYYMMDD_HHmmss")}.csv`,Fe.click(),URL.revokeObjectURL(Ee),c.message.success(`已导出 ${J.length} 条数据`)},pe=z=>{S(z),w.resetFields(),h(!0)},me=async()=>{if(p!=null&&p.id)try{const z=await w.validateFields();await sn.resetPassword(p.id,{newPassword:z.newPassword}),c.message.success(`已重置账号 ${p.username} 的密码`),h(!1),w.resetFields()}catch(z){if(z!=null&&z.errorFields)return;c.message.error("重置失败:"+((z==null?void 0:z.message)||"未知错误"))}},fe=[{title:"登录标识",dataIndex:"identifier",width:140},{title:"登录方式",dataIndex:"identityType",width:90,render:(z,J)=>{const le=eF[J.identityType]||{text:`${J.identityType}`,color:"default"};return s.jsx(c.Tag,{color:le.color,children:le.text})}},{title:"结果",dataIndex:"loginStatus",width:80,render:(z,J)=>s.jsx(c.Tag,{color:J.loginStatus===1?"success":"error",children:J.loginStatus===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0},{title:"客户端IP",dataIndex:"clientIp",width:120},{title:"登录时间",dataIndex:"loginTime",width:170,render:z=>z?Re(z).format("YYYY-MM-DD HH:mm:ss"):"-"}],ye=[{title:"租户",dataIndex:"tenantCode",width:110,render:(z,J)=>s.jsx(nn,{value:J.tenantCode})},{title:"组织",width:180,ellipsis:!0,render:(z,J)=>J.orgCode?s.jsx(nn,{value:J.orgName?`${J.orgName} (${J.orgCode})`:J.orgCode}):"-"},{title:"部门",width:180,ellipsis:!0,render:(z,J)=>J.deptCode?s.jsx(nn,{value:J.deptName?`${J.deptName} (${J.deptCode})`:J.deptCode}):"-"},{title:"角色",dataIndex:"roleCode",width:100,render:z=>s.jsx(c.Tag,{style:{margin:0},children:z||"-"})},{title:"状态",dataIndex:"memberStatus",width:90,render:z=>{const J={0:{text:"待接受",color:"processing"},1:{text:"正常",color:"success"},2:{text:"已禁用",color:"error"},3:{text:"已退出",color:"default"}}[z]||{text:String(z),color:"default"};return s.jsx(c.Tag,{color:J.color,style:{margin:0},children:J.text})}},{title:"加入时间",dataIndex:"joinedAt",width:160,render:z=>z?Re(z).format("YYYY-MM-DD HH:mm:ss"):"-"}],Te=[{title:"账号",dataIndex:"username",width:200,fixed:"left",ellipsis:{showTitle:!1},search:!1,render:(z,J)=>s.jsx(nn,{value:J.username})},{title:"昵称",dataIndex:"nickname",width:120,ellipsis:{showTitle:!1},search:!1,render:(z,J)=>s.jsx(nn,{value:J.nickname})},{title:"类型",dataIndex:"accountType",width:104,search:!1,render:(z,J)=>{const le=ks[J.accountType??3]||{text:String(J.accountType??"未知"),color:"default"};return s.jsx(c.Tag,{color:le.color,children:le.text})}},{title:"邮箱",dataIndex:"email",width:150,ellipsis:{showTitle:!1},search:!1,render:(z,J)=>s.jsx(nn,{value:J.email})},{title:"手机",dataIndex:"phone",width:126,ellipsis:{showTitle:!1},search:!1,render:(z,J)=>s.jsx(nn,{value:J.phone})},{title:"租户",dataIndex:"tenantCode",width:92,ellipsis:{showTitle:!1},search:!1,render:(z,J)=>s.jsx(nn,{value:J.tenantCode})},{title:"状态",dataIndex:"status",width:84,search:!1,render:(z,J)=>{const le=As[J.status??1]||{text:String(J.status??"未知"),color:"default"};return s.jsx(c.Tag,{color:le.color,children:le.text})}},{title:"创建时间",dataIndex:"createdAt",width:160,search:!1,ellipsis:{showTitle:!1},render:(z,J)=>s.jsx(nn,{value:J.createdAt?Re(J.createdAt).format("YYYY-MM-DD HH:mm:ss"):null})},{title:"操作",valueType:"option",width:150,fixed:"right",search:!1,render:(z,J)=>[s.jsx(c.Button,{type:"link",size:"small",danger:J.status===1,onClick:()=>se(J.id,J.status??1),children:J.status===1?"停用":"启用"},"status"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>pe(J),children:"重置密码"},"reset"),s.jsx(c.Button,{type:"link",size:"small",onClick:()=>L(J),children:"详情"},"detail")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",children:[s.jsx(c.Form.Item,{name:"username",label:"用户名",children:s.jsx(jt.SearchInput,{placeholder:"请输入用户名",onChange:z=>n.setFieldValue("username",z)})}),s.jsx(c.Form.Item,{name:"status",label:"状态",children:s.jsx(c.Select,{placeholder:"全部",allowClear:!0,style:{width:120},options:[{value:1,label:"正常"},{value:0,label:"禁用"},{value:2,label:"锁定"}]})}),s.jsx(c.Form.Item,{name:"dateRange",label:"创建时间",children:s.jsx(c.DatePicker.RangePicker,{style:{width:240}})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:W,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:te,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>g(!0),children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(de.DeleteOutlined,{}),disabled:i.length===0,onClick:ae,children:"批量停用"}),s.jsx(c.Button,{icon:s.jsx(de.DownloadOutlined,{}),onClick:ue,children:"导出"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var z;return(z=t.current)==null?void 0:z.reload()},children:"刷新"})]})]})}),s.jsx(vr,{actionRef:t,rowKey:"id",columns:Te,request:re,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:z=>`共 ${z} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:i,onChange:(z,J)=>{o(z),u(J)}},tableAlertRender:({selectedRowKeys:z})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:z.length})," 项"]})}),s.jsx(c.Modal,{title:"新建账号",open:m,onOk:X,onCancel:()=>g(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:y,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"username",label:"用户名",rules:[{required:!0,min:3,max:32}],children:s.jsx(c.Input,{placeholder:"3-32 位字母数字下划线"})}),s.jsx(c.Form.Item,{name:"password",label:"初始密码",rules:[{required:!0,min:8}],children:s.jsx(c.Input.Password,{placeholder:"至少 8 位"})}),s.jsx(c.Form.Item,{name:"nickname",label:"昵称",children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"email",label:"邮箱",rules:[{type:"email"}],children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"phone",label:"手机号",children:s.jsx(c.Input,{placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"accountType",label:"账号类型",initialValue:3,children:s.jsx(c.Select,{options:[{value:1,label:"超级管理员"},{value:2,label:"租户管理员"},{value:3,label:"普通成员"},{value:4,label:"临时账号"}]})}),s.jsx(c.Form.Item,{name:"tenantCode",label:"租户编码",children:s.jsx(c.Input,{placeholder:"如 default / tenant1"})})]})}),s.jsx(c.Modal,{title:p?`重置密码 — ${p.username}`:"重置密码",open:f,onOk:me,onCancel:()=>h(!1),size:"large",okText:"确认重置",okButtonProps:{danger:!0},destroyOnHidden:!0,children:s.jsx(c.Form,{form:w,layout:"vertical",style:{marginTop:16},children:s.jsx(c.Form.Item,{name:"newPassword",label:"新密码",rules:[{required:!0,min:8,message:"至少 8 位"}],extra:"重置后建议通知账号持有人当面修改",children:s.jsx(c.Input.Password,{placeholder:"至少 8 位"})})})}),s.jsx(c.Drawer,{title:C?`账号详情 — ${C.username}`:"账号详情",open:T,onClose:K,width:"min(1120px, 94vw)",destroyOnHidden:!0,children:C&&s.jsx(c.Tabs,{activeKey:b,onChange:P,tabBarExtraContent:b==="logs"?s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>C.id&&Z(C.id),children:"刷新日志"}):null,items:[{key:"info",label:"基本信息",children:s.jsxs(c.Descriptions,{title:"账号信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"账号ID",children:C.id}),s.jsx(c.Descriptions.Item,{label:"用户名",children:C.username}),s.jsx(c.Descriptions.Item,{label:"昵称",children:C.nickname||"-"}),s.jsx(c.Descriptions.Item,{label:"账号类型",children:s.jsx(c.Tag,{color:(Oe=ks[C.accountType??3])==null?void 0:Oe.color,children:((Ae=ks[C.accountType??3])==null?void 0:Ae.text)||C.accountType})}),s.jsx(c.Descriptions.Item,{label:"邮箱",children:C.email||"-"}),s.jsx(c.Descriptions.Item,{label:"手机",children:C.phone||"-"}),s.jsx(c.Descriptions.Item,{label:"租户",children:C.tenantCode||"-"}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:(ze=As[C.status??1])==null?void 0:ze.color,children:(ce=As[C.status??1])==null?void 0:ce.text})}),s.jsx(c.Descriptions.Item,{label:"到期时间",children:C.expireAt?Re(C.expireAt).format("YYYY-MM-DD HH:mm:ss"):"永久"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:C.createdAt?Re(C.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",span:2,children:C.updatedAt?Re(C.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]})},{key:"roles",label:`角色与权限${M.length?`(${M.length})`:""}`,children:s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"flex-start"},children:[s.jsx(c.Card,{size:"small",style:{flex:"0 0 340px"},title:`角色(${M.length})`,loading:I,children:M.length?s.jsx(c.List,{size:"small",dataSource:M,rowKey:z=>z.id,renderItem:z=>s.jsx(c.List.Item,{children:s.jsx(c.List.Item.Meta,{title:s.jsxs(c.Space,{children:[s.jsx(QT,{strong:!0,children:z.roleName||z.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:z.roleCode})]}),description:z.description||"-"})})}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该账号暂无角色"})}),s.jsx(jt.ListTable,{cardTitle:`直接权限(${Y.length})`,rows:Y,rowKey:(z,J)=>z.code||z.resourceCode||z.id||J,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该账号暂无直接权限",loading:A,columns:[{title:"资源编码",dataIndex:"code",width:220,render:(z,J)=>s.jsx("span",{style:{fontFamily:"monospace"},children:J.code||J.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(z,J)=>J.name||J.resourceName||"-"}]})]})},{key:"affiliations",label:`组织归属${B.length?`(${B.length})`:""}`,children:s.jsx(jt.ListTable,{cardTitle:"挂在哪些租户 / 组织 / 部门",rows:B,rowKey:(z,J)=>`${z.tenantCode}-${z.deptCode||"root"}-${J}`,loading:_,searchKeys:["tenantCode","orgName","orgCode","deptName","deptCode"],searchPlaceholder:"按租户 / 组织 / 部门过滤",emptyTitle:"该账号未挂在任何组织节点下",columns:ye})},{key:"logs",label:`登录日志(${$.length})`,children:s.jsx(jt.ListTable,{rows:$,columns:fe,rowKey:"id",loading:R,searchKeys:["identifier","clientIp"],searchPlaceholder:"按登录标识 / 客户端 IP 过滤",emptyTitle:"暂无登录记录"})}]})})]})}let nF="/api";function kr(){return cn.createRequest({baseURL:nF,timeout:15e3})}const Lr={listApplications:e=>kr().get("/meta-app/list",{params:e}),getApplication:e=>kr().get("/meta-app/get",{params:{id:e}}),create:e=>kr().post("/meta-app",e),update:(e,t)=>kr().put("/meta-app",t,{params:{id:e}}),delete:e=>kr().delete("/meta-app",{params:{id:e}})},rF={API:1,MENU:2,BUTTON:3,DATA:4},Or={API:{text:"API",color:"orange",int:1},MENU:{text:"菜单",color:"blue",int:2},BUTTON:{text:"按钮",color:"green",int:3},DATA:{text:"数据",color:"purple",int:4}},sF={GET:"green",POST:"blue",PUT:"orange",DELETE:"red",PATCH:"purple"},li={1:{text:"正常",color:"success"},0:{text:"停用",color:"default"}};function aF({apiBaseURL:e}){var Z,q;const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState(!1),[l]=c.Form.useForm(),[u,m]=d.useState(null),[g,f]=d.useState(!1),[h,p]=d.useState([]),[S,y]=d.useState(""),[w,T]=d.useState(!1),[x]=c.Form.useForm(),[C,j]=d.useState("API"),b=d.useCallback(async V=>{try{const L=await Xe.listResourcesByApp({appCode:V,pageNum:1,pageSize:1e3});p(L.data||[])}catch(L){c.message.error("拉取资源失败:"+((L==null?void 0:L.message)||"未知错误")),p([])}},[]),v=V=>{m(V),f(!0),V.appCode&&b(V.appCode)},$=d.useCallback(()=>{var K;const V=n.getFieldsValue(),L={};V.appCode&&(L.appCode=V.appCode),V.appName&&(L.appName=V.appName),a(L),(K=t.current)==null||K.reload()},[n]),E=d.useCallback(()=>{var V;n.resetFields(),a({}),(V=t.current)==null||V.reload()},[n]),R=async V=>{try{const L=(V==null?void 0:V.current)||1,K=(V==null?void 0:V.pageSize)||20,P=await Lr.listApplications({appCode:r.appCode,appName:r.appName,pageNum:L,pageSize:K});return{data:P.records||[],success:!0,total:P.total||0}}catch(L){return c.message.error("获取应用列表失败:"+((L==null?void 0:L.message)||"未知错误")),{data:[],success:!1,total:0}}},D=async()=>{var V;try{const L=await l.validateFields();await Lr.create({appCode:L.appCode,appName:L.appName,appType:L.appType||"web",description:L.description,status:1}),c.message.success("应用创建成功"),o(!1),l.resetFields(),(V=t.current)==null||V.reload()}catch(L){if(L!=null&&L.errorFields)return;c.message.error("创建失败:"+((L==null?void 0:L.message)||"未知错误"))}},M=async V=>{var L;try{if(V.id==null){c.message.error("应用 ID 缺失");return}await Lr.delete(V.id),c.message.success(`已删除应用 ${V.appCode}`),(u==null?void 0:u.id)===V.id&&(m(null),p([])),(L=t.current)==null||L.reload()}catch(K){c.message.error("删除失败:"+((K==null?void 0:K.message)||"未知错误"))}},U=async V=>{var L;try{if(V.id==null){c.message.error("应用 ID 缺失");return}const K=V.status===1?0:1;await Lr.update(V.id,{status:K}),c.message.success(K===1?"已启用":"已停用"),(u==null?void 0:u.id)===V.id&&m({...V,status:K}),(L=t.current)==null||L.reload()}catch(K){c.message.error("切换状态失败:"+((K==null?void 0:K.message)||"未知错误"))}},Y=async()=>{if(u)try{const V=await x.validateFields(),L={resourceCode:V.resourceCode,resourceName:V.resourceName,resourceType:rF[C],appCode:u.appCode,path:V.path,method:V.method,description:V.description,status:1};await Xe.createResource(L),c.message.success("资源创建成功"),T(!1),x.resetFields(),b(u.appCode)}catch(V){if(V!=null&&V.errorFields)return;c.message.error("创建失败:"+((V==null?void 0:V.message)||"未知错误"))}},O=async V=>{if(V.id==null){c.message.error("资源 ID 缺失");return}try{await Xe.deleteResource(V.id),c.message.success("资源已删除"),u!=null&&u.appCode&&b(u.appCode)}catch(L){c.message.error("删除失败:"+((L==null?void 0:L.message)||"未知错误"))}},I=V=>{j(V),x.resetFields(),T(!0)},F=[{title:"应用",dataIndex:"appName",width:180,search:!1,render:(V,L)=>{const K=li[L.status??1]||{text:String(L.status??"未知"),color:"default"},P=(u==null?void 0:u.id)===L.id;return s.jsxs("div",{style:{padding:"4px 0",borderLeft:P?"3px solid #1677ff":"3px solid transparent",paddingLeft:8},children:[s.jsx("div",{style:{fontWeight:500},children:L.appName}),s.jsxs("div",{style:{fontSize:12,color:"#999",marginTop:2},children:[s.jsx(c.Tag,{color:K.color,style:{marginRight:4,marginInlineEnd:4},children:K.text}),s.jsx("code",{style:{fontSize:11},children:L.appCode})]})]})}},{title:"操作",valueType:"option",width:160,fixed:"right",search:!1,render:(V,L)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>v(L),children:"编辑"},"edit"),s.jsx(c.Button,{type:"link",size:"small",danger:L.status===1,onClick:()=>U(L),children:L.status===1?"停用":"启用"},"toggle"),s.jsx(c.Popconfirm,{title:`确认删除应用 ${L.appName}?`,description:"该应用下的所有资源会一并删除",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>M(L),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})},"del")]}],A=[{title:"资源编码",dataIndex:"resourceCode",width:180,ellipsis:!0},{title:"资源名称",dataIndex:"resourceName",width:140,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(V,L)=>L.method?s.jsx(c.Tag,{color:sF[L.method],children:L.method}):"-"},{title:"URL / Path",dataIndex:"path",ellipsis:!0},{title:"描述",dataIndex:"description",width:200,ellipsis:!0},{title:"操作",width:80,fixed:"right",render:(V,L)=>s.jsx(c.Popconfirm,{title:"确认删除该资源?",okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onConfirm:()=>O(L),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"删除"})})}],k=h.filter(V=>(V.resourceType??1)===1),B=h.filter(V=>V.resourceType===2),G=h.filter(V=>V.resourceType===3),_=h.filter(V=>V.resourceType===4),H=(V,L)=>{const K=S.trim().toLowerCase(),P=K?V.filter(W=>`${W.resourceCode||""} ${W.resourceName||""} ${W.path||""}`.toLowerCase().includes(K)):V;return s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:12,display:"flex",justifyContent:"space-between",alignItems:"center"},children:[s.jsxs("span",{style:{color:"#666"},children:["共 ",s.jsx("b",{children:V.length})," 条 ",Or[L].text," 资源"]}),s.jsxs(c.Space,{children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按资源编码 / 名称过滤",style:{width:220},onChange:W=>y(W.target.value)}),s.jsxs(c.Button,{type:"primary",size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>I(L),children:["新建",Or[L].text]})]})]}),V.length>0?s.jsx(c.Table,{rowKey:"id",columns:A,dataSource:P,pagination:{pageSize:20,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"],showTotal:W=>`共 ${W} 条`},size:"small",scroll:{x:800},locale:{emptyText:s.jsx(jt.EmptyState,{title:`没有匹配的 ${Or[L].text} 资源`,description:"换个关键字再试一次",size:"sm"})}}):s.jsx(jt.EmptyState,{title:`该应用暂无 ${Or[L].text} 资源`,description:"点击上方按钮新增",size:"sm"})]})};return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",size:"small",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用编码",style:{marginBottom:8},children:s.jsx(c.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(c.Form.Item,{name:"appName",label:"应用名称",style:{marginBottom:8},children:s.jsx(c.Input,{placeholder:"搜索",allowClear:!0})}),s.jsx(c.Form.Item,{style:{marginBottom:8},children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:$,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:E,children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>o(!0),children:"新增应用"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var V;(V=t.current)==null||V.reload(),u!=null&&u.appCode&&b(u.appCode)},children:"刷新"})]})]})}),s.jsx(vr,{actionRef:t,rowKey:"id",columns:F,request:R,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:V=>`共 ${V} 条`},onRow:V=>({onClick:()=>v(V),style:{cursor:"pointer"}})}),s.jsx(c.Drawer,{title:u?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[s.jsx("span",{style:{fontSize:16,fontWeight:600},children:u.appName}),s.jsx(c.Tag,{color:((Z=li[u.status??1])==null?void 0:Z.color)||"default",children:((q=li[u.status??1])==null?void 0:q.text)||"未知"}),s.jsx("code",{style:{fontSize:12,color:"#666"},children:u.appCode})]}):"应用详情",open:g,onClose:()=>f(!1),width:"80vw",destroyOnHidden:!0,extra:u?s.jsxs(c.Space,{children:[s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>b(u.appCode),children:"刷新资源"}),s.jsx(c.Button,{icon:s.jsx(de.EditOutlined,{}),onClick:()=>o(!0),children:"编辑应用"}),s.jsx(c.Button,{danger:u.status===1,icon:s.jsx(de.StopOutlined,{}),onClick:()=>U(u),children:u.status===1?"停用":"启用"})]}):null,children:u&&s.jsxs("div",{children:[s.jsxs("div",{style:{marginBottom:16,paddingBottom:12,borderBottom:"1px solid #f0f0f0",fontSize:13,color:"#666",display:"flex",gap:16},children:[u.gmtCreate&&s.jsxs("span",{children:["创建:",Re(u.gmtCreate).format("YYYY-MM-DD HH:mm:ss")]}),u.description&&s.jsxs("span",{children:["描述:",u.description]})]}),s.jsx(c.Tabs,{defaultActiveKey:"API",items:[{key:"API",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"orange",children:"API"})," API 资产 (",k.length,")"]}),children:H(k,"API")},{key:"MENU",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"blue",children:"菜单"})," 菜单 (",B.length,")"]}),children:H(B,"MENU")},{key:"BUTTON",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"green",children:"按钮"})," 按钮 (",G.length,")"]}),children:H(G,"BUTTON")},{key:"DATA",label:s.jsxs("span",{children:[s.jsx(c.Tag,{color:"purple",children:"数据"})," 数据 (",_.length,")"]}),children:H(_,"DATA")}]})]})}),s.jsx(c.Modal,{title:"新建应用",open:i,onOk:D,onCancel:()=>o(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:l,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用编码",rules:[{required:!0},{pattern:/^[a-z][a-z0-9_-]*$/,message:"小写字母开头,仅允许小写字母/数字/下划线/短横"}],extra:"唯一标识,如 z-ctc / z-task",children:s.jsx(c.Input,{placeholder:"如 z-opc"})}),s.jsx(c.Form.Item,{name:"appName",label:"应用名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 统一管理平台"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})})]})}),s.jsx(c.Modal,{title:`新建资源 — ${(u==null?void 0:u.appCode)||""} (${Or[C].text})`,open:w,onOk:Y,onCancel:()=>T(!1),size:"large",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:x,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0}],extra:"唯一标识,如 user:read / menu:dashboard",children:s.jsx(c.Input,{placeholder:"如 user:read"})}),s.jsx(c.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0}],children:s.jsx(c.Input,{placeholder:"如 查看用户"})}),C==="API"&&s.jsxs(s.Fragment,{children:[s.jsx(c.Form.Item,{name:"method",label:"HTTP 方法",children:s.jsx(c.Select,{allowClear:!0,placeholder:"选择 HTTP 方法",options:[{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}]})}),s.jsx(c.Form.Item,{name:"path",label:"URL Pattern",children:s.jsx(c.Input,{placeholder:"如 /api/users/*"})})]}),C==="MENU"&&s.jsx(c.Form.Item,{name:"path",label:"菜单路径",children:s.jsx(c.Input,{placeholder:"如 /ctc/dashboard"})}),C==="BUTTON"&&s.jsx(c.Form.Item,{name:"resourceCode",label:"按钮权限编码",extra:"如 btn:user:create",children:s.jsx(c.Input,{placeholder:"如 btn:user:create"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})})]})})]})}const to={0:{text:"功能",color:"geekblue"},1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}},iF=[{value:"",label:"任意"},{value:"GET",label:"GET"},{value:"POST",label:"POST"},{value:"PUT",label:"PUT"},{value:"DELETE",label:"DELETE"},{value:"PATCH",label:"PATCH"}],oF=[{key:"roles",label:"角色",icon:s.jsx(de.TeamOutlined,{})},{key:"points",label:"权限点",icon:s.jsx(de.AuditOutlined,{})},{key:"tree",label:"权限树",icon:s.jsx(de.ApartmentOutlined,{})},{key:"auth",label:"授权",icon:s.jsx(de.SolutionOutlined,{})}];function Zs(e){const t=to[e]||{text:String(e??"?"),color:"default"};return s.jsx(c.Tag,{color:t.color,style:{margin:0,fontSize:11},children:t.text})}function Hc(e,{search:t=""}={}){const n=t.trim().toLowerCase(),r=u=>!n||(u.resourceCode||"").toLowerCase().includes(n)||(u.resourceName||"").toLowerCase().includes(n),a=e.filter(r),i=new Map;a.forEach(u=>{const m=u.appCode||"公共";i.has(m)||i.set(m,[]),i.get(m).push(u)});const o=u=>s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[s.jsx("span",{children:u.resourceName||u.resourceCode}),Zs(u.resourceType),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:u.resourceCode})]}),l=[];return i.forEach((u,m)=>{const g=new Map;u.forEach(h=>g.set(h.id,{key:h.id,title:o(h),raw:h,children:[]}));const f=[];u.forEach(h=>{const p=g.get(h.id),S=h.parentId??0;S&&g.has(S)?g.get(S).children.push(p):f.push(p)}),l.push({key:`app:${m}`,title:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6,fontWeight:600},children:[m,s.jsx(c.Tag,{color:"cyan",style:{margin:0,fontSize:11},children:u.length})]}),selectable:!1,checkable:!1,children:f})}),l}function lF(e){const t=[],n=r=>{r.forEach(a=>{var i;t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function cF(e){const t=[],n=r=>{r.forEach(a=>{var i;a.raw&&t.push(a.key),(i=a.children)!=null&&i.length&&n(a.children)})};return n(e),t}function Zd({apiBaseURL:e}){const[t,n]=tf.useSearchParams(),r=["roles","points","tree","auth"].includes(t.get("view"))?t.get("view"):"roles",a=d.useCallback(N=>{const ee=new URLSearchParams(t);N==="roles"?ee.delete("view"):ee.set("view",N),n(ee,{replace:!0})},[t,n]),[i,o]=d.useState([]),[l,u]=d.useState(!1),[m,g]=d.useState([]),[f,h]=d.useState(!1),[p,S]=d.useState(""),[y,w]=d.useState(!1),[T,x]=d.useState(null),[C]=c.Form.useForm(),[j,b]=d.useState(null),[v,$]=d.useState([]),[E,R]=d.useState([]),[D,M]=d.useState(""),[U,Y]=d.useState(null),[O,I]=d.useState([]),[F,A]=d.useState(!1),[k,B]=d.useState(null),[G,_]=d.useState(""),[H,Z]=d.useState([]),[q,V]=d.useState(!1),[L,K]=d.useState(null),[P,W]=d.useState([]),[te,re]=d.useState(!1),[X,se]=d.useState(!1),[ae,ue]=d.useState(!1),[pe,me]=d.useState([]),fe=d.useRef(void 0),[ye]=c.Form.useForm(),[Te,Oe]=d.useState({}),[Ae,ze]=d.useState([]),[ce,z]=d.useState([]),[J,le]=d.useState([]),[Se,Ee]=d.useState(!1),[Fe,Ie]=d.useState(null),[De]=c.Form.useForm(),[ve,ke]=d.useState(!1),[Le,lt]=d.useState(null),nt=d.useCallback(async()=>{u(!0);try{const N=await Xe.listAllResources();o(Array.isArray(N)?N:[])}catch(N){c.message.error("加载权限点失败:"+((N==null?void 0:N.message)||"未知错误"))}finally{u(!1)}},[]),ne=d.useCallback(async()=>{h(!0);try{const N=await Xe.listAllRoles();g(Array.isArray(N)?N:[])}catch(N){c.message.error("加载角色失败:"+((N==null?void 0:N.message)||"未知错误"))}finally{h(!1)}},[]),Q=d.useCallback(async()=>{try{const N=await Xe.distinctApps(),ee=Array.isArray(N)?N:[];le(ee.map(xe=>({value:xe,label:xe})))}catch{le([])}},[]);d.useEffect(()=>{nt(),ne(),Q()},[nt,ne,Q]);const he=d.useCallback(async N=>{b(N),M(""),ue(!0),$([]),R([]);try{const ee=await Xe.listRolePermissions(N.id),xe=(Array.isArray(ee)?ee:[]).map($e=>$e.id);$(xe),R(xe)}catch(ee){c.message.error("加载角色权限点失败:"+((ee==null?void 0:ee.message)||"未知错误"))}finally{ue(!1)}},[]),Ce=d.useCallback(async()=>{if(!(j!=null&&j.id))return;const N=new Set(E.map(Number).filter(Ke=>Number.isFinite(Ke))),ee=new Set(v.map(Number).filter(Ke=>Number.isFinite(Ke))),xe=[...N].filter(Ke=>!ee.has(Ke)),$e=[...ee].filter(Ke=>!N.has(Ke));if(xe.length===0&&$e.length===0){c.message.info("没有变更");return}se(!0);try{for(const Ke of xe)await Xe.grantRoleResource(j.id,Ke);for(const Ke of $e)await Xe.revokeRoleResource(j.id,Ke);c.message.success(`已保存:+${xe.length} / -${$e.length}`),$([...N])}catch(Ke){c.message.error("保存失败:"+((Ke==null?void 0:Ke.message)||"未知错误"))}finally{se(!1)}},[j,E,v]),Je=d.useCallback(async(N,ee)=>{try{await Xe.updateRole(N.id,{status:ee?1:0}),c.message.success(ee?`角色 ${N.roleName} 已启用`:`角色 ${N.roleName} 已停用`),await ne()}catch(xe){c.message.error("更新状态失败:"+((xe==null?void 0:xe.message)||"未知错误"))}},[ne]),Ct=d.useCallback(async()=>{try{const N=await C.validateFields();await Xe.createRole({roleCode:N.roleCode,roleName:N.roleName,description:N.description,status:N.enabled===!1?0:1}),c.message.success("角色创建成功"),w(!1),C.resetFields(),await ne()}catch(N){if(N!=null&&N.errorFields)return;c.message.error("创建失败:"+((N==null?void 0:N.message)||"未知错误"))}},[ne,C]),tn=d.useCallback(async()=>{if(T!=null&&T.id)try{const N=await C.validateFields();await Xe.updateRole(T.id,{roleName:N.roleName,description:N.description,status:N.enabled===!1?0:1}),c.message.success("角色已更新"),w(!1),x(null),C.resetFields(),await ne(),(j==null?void 0:j.id)===T.id&&b(ee=>ee&&{...ee,roleName:N.roleName,status:N.enabled===!1?0:1})}catch(N){if(N!=null&&N.errorFields)return;c.message.error("更新失败:"+((N==null?void 0:N.message)||"未知错误"))}},[j,T,ne,C]),ht=d.useCallback(async N=>{try{await Xe.deleteRole(N.id),c.message.success("角色已删除"),(j==null?void 0:j.id)===N.id&&b(null),await ne()}catch(ee){c.message.error("删除失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},[j,ne]),is=d.useMemo(()=>{const N=p.trim().toLowerCase();return N?m.filter(ee=>(ee.roleCode||"").toLowerCase().includes(N)||(ee.roleName||"").toLowerCase().includes(N)):m},[m,p]),Ta=d.useCallback(async N=>{try{const ee=await Xe.listResourcesByApp({appCode:Te.appCode,type:Te.type,keyword:Te.keyword,pageNum:N.current,pageSize:N.pageSize}),xe=(ee==null?void 0:ee.data)||[];return{data:xe,success:!0,total:(ee==null?void 0:ee.total)??xe.length}}catch(ee){return c.message.error("查询权限点失败:"+((ee==null?void 0:ee.message)||"未知错误")),{data:[],success:!1,total:0}}},[Te]),Fa=[{title:"编码",dataIndex:"resourceCode",width:200,fixed:"left",render:(N,ee)=>s.jsx(c.Tooltip,{title:ee.resourceCode,children:s.jsx("span",{style:{fontFamily:"monospace"},children:ee.resourceCode})})},{title:"名称",dataIndex:"resourceName",width:160},{title:"类型",dataIndex:"resourceType",width:80,render:(N,ee)=>Zs(ee.resourceType)},{title:"应用",dataIndex:"appCode",width:140,render:(N,ee)=>ee.appCode?s.jsx(c.Tag,{color:"cyan",children:ee.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"路径",dataIndex:"path",width:220,ellipsis:!0},{title:"方法",dataIndex:"method",width:80,render:(N,ee)=>ee.method?s.jsx(c.Tag,{children:ee.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,render:(N,ee)=>s.jsx(c.Tag,{color:ee.status===1?"success":"default",children:ee.status===1?"启用":"禁用"})},{title:"创建时间",dataIndex:"createdAt",width:170,render:N=>N||"-"},{title:"操作",width:160,render:(N,ee)=>[s.jsx(c.Button,{type:"link",size:"small",onClick:xe=>{xe.stopPropagation(),Ie(ee),De.setFieldsValue(ee),Ee(!0)},children:"编辑"},"edit"),s.jsx(c.Popconfirm,{title:"确认删除该权限点?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:async xe=>{var $e,Ke;($e=xe==null?void 0:xe.stopPropagation)==null||$e.call(xe);try{await Xe.deleteResource(ee.id),c.message.success("已删除"),(Ke=fe.current)==null||Ke.reload(),nt()}catch(Ra){c.message.error("删除失败:"+((Ra==null?void 0:Ra.message)||"未知错误"))}},children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,onClick:xe=>xe.stopPropagation(),children:"删除"})},"delete"),s.jsx(c.Button,{type:"link",size:"small",onClick:xe=>{xe.stopPropagation(),lt(ee),ke(!0)},children:"详情"},"detail")]}],fn=d.useMemo(()=>Hc(i,{search:D}),[i,D]);d.useEffect(()=>{me(lF(fn))},[fn]);const Gn=d.useRef(null),[os,Tr]=d.useState(void 0);d.useEffect(()=>{const N=()=>{const xe=Gn.current;if(!xe)return;const $e=xe.getBoundingClientRect().top;Tr(Math.max(420,window.innerHeight-$e-24))};N();const ee=setTimeout(N,300);return window.addEventListener("resize",N),()=>{clearTimeout(ee),window.removeEventListener("resize",N)}},[]);const ls=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:320,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"搜索角色编码 / 名称",onSearch:S,onChange:N=>!N.target.value&&S(""),style:{flex:1}}),s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{x(null),C.setFieldsValue({enabled:!0}),w(!0)},children:"新增"})]}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[is.map(N=>{const ee=(j==null?void 0:j.id)===N.id;return s.jsxs("div",{onClick:()=>he(N),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:ee?"#e6f4ff":"transparent",border:ee?"1px solid #91caff":"1px solid transparent"},children:[s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:ee?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.roleName||N.roleCode,N.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.roleCode,N.tenantCode?` · ${N.tenantCode}`:""]})]}),s.jsx("span",{onClick:xe=>xe.stopPropagation(),children:s.jsx(c.Switch,{size:"small",checked:N.status===1,onChange:xe=>Je(N,xe)})}),s.jsx("span",{onClick:xe=>xe.stopPropagation(),children:s.jsx(c.Dropdown,{trigger:["click"],menu:{items:[{key:"edit",icon:s.jsx(de.AuditOutlined,{}),label:"编辑"},{type:"divider"},{key:"delete",icon:s.jsx(de.DeleteOutlined,{}),label:"删除",danger:!0}],onClick:({key:xe})=>{xe==="edit"?(x(N),C.setFieldsValue({roleCode:N.roleCode,roleName:N.roleName,description:N.description,enabled:N.status!==0}),w(!0)):xe==="delete"&&c.Modal.confirm({title:`删除角色 ${N.roleName}?`,okText:"删除",okButtonProps:{danger:!0},cancelText:"取消",onOk:()=>ht(N)})}},children:s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(de.EllipsisOutlined,{})})})})]},N.id)}),is.length===0?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:p?"没有匹配的角色":"还没有角色,点「新增」创建",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},title:j?`权限点 — ${j.roleName}`:"权限点",extra:j?s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",onClick:()=>R(cF(fn)),children:"全选"}),s.jsx(c.Button,{size:"small",onClick:()=>R([]),children:"清空"}),s.jsx(c.Button,{size:"small",type:"primary",loading:X,onClick:Ce,children:"保存"})]}):null,styles:{body:{padding:"12px 8px 12px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:j?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx(c.Input.Search,{allowClear:!0,size:"small",placeholder:"按编码 / 名称过滤权限点",onSearch:M,onChange:N=>!N.target.value&&M("")})}),s.jsxs("div",{style:{fontSize:12,color:"#666",marginBottom:8},children:["已挂载 ",s.jsx("b",{children:v.length})," / 共 ",i.length," 个权限点 —— 勾选即挂载,取消即卸载。"]}),s.jsx(c.Tree,{checkable:!0,blockNode:!0,treeData:fn,checkedKeys:E,onCheck:N=>R(Array.isArray(N)?N:N.checked),expandedKeys:pe,onExpand:N=>me(N),loading:ae})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧角色,这里展开它挂载的权限点树",style:{margin:"24px 0"}})})})]}),$a=()=>s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(c.Card,{size:"small",styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:ye,layout:"inline",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用",children:s.jsx(c.Select,{placeholder:"全部应用",allowClear:!0,style:{width:180},options:J,showSearch:!0,optionFilterProp:"label"})}),s.jsx(c.Form.Item,{name:"type",label:"类型",children:s.jsx(c.Select,{placeholder:"全部类型",allowClear:!0,style:{width:120},options:Object.entries(to).map(([N,ee])=>({value:Number(N),label:ee.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",children:s.jsx(c.Select,{placeholder:"全部",allowClear:!0,style:{width:100},options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:()=>{const N=ye.getFieldsValue(),ee={};N.appCode&&(ee.appCode=N.appCode),N.type!==void 0&&N.type!==null&&(ee.type=N.type),N.keyword&&(ee.keyword=N.keyword),N.status!==void 0&&N.status!==null&&(ee.status=N.status),Oe(ee)},children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:()=>{ye.resetFields(),Oe({})},children:"重置"})]})})]}),s.jsxs(c.Space,{style:{flexShrink:0},children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),onClick:()=>{Ie(null),De.resetFields(),De.setFieldsValue({resourceType:3,status:1,sortOrder:0}),Ee(!0)},children:"新增"}),s.jsx(c.Button,{danger:!0,icon:s.jsx(de.DeleteOutlined,{}),disabled:Ae.length===0,onClick:async()=>{var N;try{await Promise.all(ce.map(ee=>Xe.deleteResource(ee.id))),c.message.success(`已删除 ${ce.length} 条`),ze([]),z([]),(N=fe.current)==null||N.reload(),nt()}catch(ee){c.message.error("批量删除失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},children:"批量删除"}),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var N;return(N=fe.current)==null?void 0:N.reload()},children:"刷新"})]})]})}),s.jsx(vr,{actionRef:fe,rowKey:"id",columns:Fa,request:Ta,params:Te,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:10,showSizeChanger:!0,showTotal:N=>`共 ${N} 条`},dateFormatter:"string",rowSelection:{selectedRowKeys:Ae,onChange:(N,ee)=>{ze(N),z(ee)}},tableAlertRender:({selectedRowKeys:N})=>s.jsxs("span",{children:["已选择 ",s.jsx("a",{style:{fontWeight:600},children:N.length})," 项"]})})]}),Ye=U!=null?i.find(N=>N.id===U):null,Fr=(()=>{if(!Ye)return[];const N=new Map(i.map(Ke=>[Ke.id,Ke])),ee=[Ye],xe=new Set([Ye.id]);let $e=Ye;for(;$e!=null&&$e.parentId&&N.has($e.parentId)&&!xe.has($e.parentId);)$e=N.get($e.parentId),xe.add($e.id),ee.unshift($e);return ee})(),cs=Ye?i.filter(N=>N.parentId===Ye.id):[],Ea=()=>{var N;return s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:460,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsxs("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[s.jsx(c.Input.Search,{allowClear:!0,size:"small",style:{flex:1},placeholder:"按编码 / 名称过滤",onSearch:M,onChange:ee=>!ee.target.value&&M("")}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:nt,children:"刷新"})]}),s.jsxs("div",{style:{fontSize:12,color:"#999"},children:["权限模型全貌:按「应用 → 父子层级」组织,共 ",i.length," 个。点条目看详情。"]}),s.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:s.jsx(c.Tree,{blockNode:!0,treeData:fn,loading:l,defaultExpandAll:!0,selectedKeys:U!=null?[U]:[],onSelect:ee=>Y(ee.length?ee[ee.length-1]:null)})})]})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:16,flex:1,minHeight:0,overflowY:"auto"}},title:Ye?`权限点详情 — ${Ye.resourceName||Ye.resourceCode}`:"权限点详情",children:Ye?s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[s.jsxs("div",{style:{fontSize:13,color:"#595959"},children:[Fr.map((ee,xe)=>s.jsxs("span",{children:[xe>0?s.jsx("span",{style:{color:"#bfbfbf",margin:"0 6px"},children:"/"}):null,ee.resourceName||ee.resourceCode]},ee.id)),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999",marginLeft:10},children:Ye.resourceCode})]}),s.jsxs(c.Descriptions,{bordered:!0,size:"small",column:2,children:[s.jsxs(c.Descriptions.Item,{label:"资源名称",span:2,children:[s.jsx("span",{style:{fontWeight:600},children:Ye.resourceName||"-"}),s.jsx("span",{style:{marginLeft:8},children:Zs(Ye.resourceType)})]}),s.jsx(c.Descriptions.Item,{label:"编码",span:2,children:s.jsx("span",{style:{fontFamily:"monospace"},children:Ye.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"应用",children:Ye.appCode?s.jsx(c.Tag,{color:"cyan",style:{margin:0},children:Ye.appCode}):s.jsx(c.Tag,{color:"default",style:{margin:0},children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:Ye.status===1?"success":"default",style:{margin:0},children:Ye.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"ID",children:Ye.id}),s.jsx(c.Descriptions.Item,{label:"排序",children:Ye.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"父权限",children:Ye.parentId&&i.some(ee=>ee.id===Ye.parentId)?((N=i.find(ee=>ee.id===Ye.parentId))==null?void 0:N.resourceName)||Ye.parentId:"顶层"}),s.jsxs(c.Descriptions.Item,{label:"子权限点",children:[cs.length," 个"]}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:Ye.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:Ye.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:Ye.updatedAt||"-"})]})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"点左侧权限点,这里展示它的详情与扩展字段",style:{margin:"48px 0"}})})})]})},$r=d.useCallback(async()=>{A(!0);try{const N=await sn.listByTenant({pageNum:1,pageSize:200}),ee=Array.isArray(N)?N:(N==null?void 0:N.records)||(N==null?void 0:N.data)||[];I(ee)}catch(N){c.message.error("加载用户失败:"+((N==null?void 0:N.message)||"未知错误"))}finally{A(!1)}},[]),Rn=d.useCallback(async N=>{re(!0);try{const ee=await Xe.listUserPermissions(N),xe=Array.isArray(ee)?ee:[];W(xe.map($e=>$e==null?null:typeof $e=="object"?$e.id!=null?$e.id:$e.resourceCode||$e.code:$e).filter($e=>$e!=null))}catch(ee){c.message.error("加载用户权限失败:"+((ee==null?void 0:ee.message)||"未知错误"))}finally{re(!1)}},[]),Zn=d.useCallback(async N=>{B(N.id),Z([]),W([]),V(!0),re(!0);try{const ee=await Xe.listUserRoles(N.id);Z((Array.isArray(ee)?ee:[]).map(xe=>xe.id))}catch(ee){c.message.error("加载用户角色失败:"+((ee==null?void 0:ee.message)||"未知错误"))}finally{V(!1)}Rn(N.id)},[Rn]);d.useEffect(()=>{$r()},[$r]),d.useEffect(()=>{k==null&&O.length>0&&Zn(O[0])},[O,k,Zn]);const us=async(N,ee)=>{if(k){K(N.id);try{ee?await Xe.grantUserRole(k,N.id):await Xe.revokeUserRole(k,N.id),Z(xe=>ee?[...xe,N.id]:xe.filter($e=>$e!==N.id)),c.message.success(`已${ee?"授予":"收回"}角色 ${N.roleName||N.roleCode}`),Rn(k)}catch(xe){c.message.error((ee?"授予":"收回")+"失败:"+((xe==null?void 0:xe.message)||"未知错误"))}finally{K(null)}}},Jn=d.useMemo(()=>{const N=new Map(i.map(xe=>[xe.id,xe])),ee=new Set;return P.forEach(xe=>{if(typeof xe=="number"||/^\d+$/.test(String(xe))){ee.add(Number(xe));const $e=N.get(Number(xe));$e&&ee.add($e.resourceCode)}else{ee.add(xe);const $e=i.find(Ke=>Ke.resourceCode===xe);$e&&ee.add($e.id)}}),ee},[P,i]),Xn=d.useMemo(()=>Hc(i),[i]),ds=d.useMemo(()=>Xn.flatMap(N=>(N.children||[]).map(ee=>ee.key)).filter(N=>Jn.has(N)),[Xn,Jn]),ge=d.useMemo(()=>{const N=G.trim().toLowerCase();return N?O.filter(ee=>`${ee.username||""} ${ee.nickname||""} ${ee.tenantCode||""}`.toLowerCase().includes(N)):O},[O,G]),we=()=>s.jsxs("div",{style:{display:"flex",gap:16,alignItems:"stretch",height:"100%",minHeight:0},children:[s.jsx("div",{style:{width:300,flexShrink:0,display:"flex"},children:s.jsxs(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:10,overflow:"hidden"}},children:[s.jsx(c.Input.Search,{allowClear:!0,placeholder:"搜索用户名 / 昵称 / 租户",onSearch:_,onChange:N=>!N.target.value&&_("")}),s.jsxs("div",{style:{overflowY:"auto",flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:4},children:[ge.map(N=>{const ee=k===N.id;return s.jsx("div",{onClick:()=>Zn(N),style:{display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,cursor:"pointer",background:ee?"#e6f4ff":"transparent",border:ee?"1px solid #91caff":"1px solid transparent"},children:s.jsxs("div",{style:{flex:1,minWidth:0},children:[s.jsxs("div",{style:{fontSize:13,fontWeight:ee?600:400,color:"#1a1a2e",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.nickname||N.username||N.id,N.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsxs("div",{style:{fontSize:11,color:"#8c8c8c",fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.username,N.tenantCode?` · ${N.tenantCode}`:""]})]})},N.id)}),ge.length===0&&!F?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"没有用户",style:{margin:"24px 0"}}):null]})]})}),s.jsx("div",{style:{width:300,flexShrink:0,display:"flex"},children:s.jsx(c.Card,{size:"small",title:`角色 (${H.length})`,loading:q&&k!=null,style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:"8px 12px",flex:1,minHeight:0,overflowY:"auto"}},children:k?s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:2},children:m.map(N=>{const ee=H.includes(N.id),xe=L===N.id;return s.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"7px 8px",borderRadius:6,cursor:xe?"wait":"pointer"},children:[s.jsx(c.Checkbox,{checked:ee,disabled:xe||f,onChange:$e=>us(N,$e.target.checked)}),s.jsxs("span",{style:{fontSize:13,flex:1,minWidth:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[N.roleName||N.roleCode,N.status===0?s.jsx(c.Tag,{color:"default",style:{margin:"0 0 0 6px",fontSize:11},children:"停用"}):null]}),s.jsx("span",{style:{fontFamily:"monospace",fontSize:11,color:"#999"},children:N.roleCode})]},N.id)})}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"先在左侧选人",style:{margin:"24px 0"}})})}),s.jsx("div",{style:{flex:1,minWidth:0,display:"flex"},children:s.jsx(c.Card,{size:"small",style:{width:"100%",display:"flex",flexDirection:"column"},styles:{body:{padding:12,flex:1,minHeight:0,display:"flex",flexDirection:"column",gap:8,overflow:"hidden"}},title:k?`有效权限点 (${Jn.size})`:"有效权限点",extra:k?s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>Rn(k),children:"刷新"}):null,children:k?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{fontSize:12,color:"#999"},children:"该人经角色叠加到手的权限点全貌;勾选状态只读,要改去「角色」tab 调整角色挂载,或在中栏勾选/取消角色。"}),s.jsx("div",{style:{flex:1,minHeight:0,overflowY:"auto"},children:s.jsx(c.Tree,{checkable:!0,blockNode:!0,treeData:Xn,checkedKeys:ds,loading:te,defaultExpandAll:!0})})]}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"先在左侧选人",style:{margin:"24px 0"}})})})]});return s.jsxs("div",{ref:Gn,className:"perm-mgmt-fullheight",style:{display:"flex",flexDirection:"column",minHeight:420,height:os},children:[s.jsx("style",{children:`
58
58
  .perm-mgmt-fullheight .ant-tabs { display: flex; flex-direction: column; height: 100%; }
59
59
  .perm-mgmt-fullheight .ant-tabs-content-holder { flex: 1; min-height: 0; }
60
60
  .perm-mgmt-fullheight .ant-tabs-content,
61
61
  .perm-mgmt-fullheight .ant-tabs-tabpane { height: 100%; }
62
- `}),s.jsx(c.Tabs,{style:{flex:1,minHeight:0},activeKey:r,onChange:a,items:oF.map(N=>({key:N.key,label:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[N.icon,N.label]}),children:N.key==="roles"?ls():N.key==="points"?$a():N.key==="auth"?we():Ea()})),destroyInactiveTabPane:!0}),s.jsx(c.Modal,{title:v?`编辑角色 — ${v.roleCode}`:"新增角色",open:y,onOk:v?tn:Ct,onCancel:()=>{w(!1),x(null),C.resetFields()},okText:v?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0,message:"请输入角色编码"}],extra:"唯一标识,英文/下划线;创建后不可改",children:s.jsx(c.Input,{placeholder:"如 admin / dev / viewer",disabled:!!v})}),s.jsx(c.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0,message:"请输入角色名称"}],children:s.jsx(c.Input,{placeholder:"如 管理员"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"enabled",label:"启用",valuePropName:"checked",initialValue:!0,children:s.jsx(c.Switch,{checkedChildren:"启用",unCheckedChildren:"停用"})})]})}),s.jsx(c.Modal,{title:Fe?`编辑权限点 — ${Fe.resourceCode}`:"新建权限点",open:Se,onOk:async()=>{var N;try{const ee=await De.validateFields();Fe?(await Xe.updateResource(Fe.id,ee),c.message.success("更新成功")):(await Xe.createResource(ee),c.message.success("创建成功")),Ee(!1),Ie(null),De.resetFields(),(N=fe.current)==null||N.reload(),nt()}catch(ee){if(ee!=null&&ee.errorFields)return;c.message.error("保存失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},onCancel:()=>{Ee(!1),Ie(null),De.resetFields()},okText:Fe?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:De,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0,min:2,max:128,pattern:/^[a-zA-Z0-9_:.-]+$/,message:"2-128 位字母数字下划线冒号"}],extra:"业务唯一,如 user:read / order:create",children:s.jsx(c.Input,{placeholder:"如 user:read",disabled:!!Fe})}),s.jsx(c.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 用户查询"})}),s.jsx(c.Form.Item,{name:"resourceType",label:"资源类型",rules:[{required:!0}],initialValue:3,children:s.jsx(c.Select,{options:Object.entries(to).map(([N,ee])=>({value:Number(N),label:ee.text}))})}),s.jsx(c.Form.Item,{name:"appCode",label:"所属应用",extra:"选择权限点归属的应用;不选则为「公共」",children:s.jsx(c.Select,{placeholder:"公共(跨应用)",allowClear:!0,showSearch:!0,optionFilterProp:"label",options:J})}),s.jsx(c.Form.Item,{name:"path",label:"URL 路径",extra:"菜单 / API 资源对应路径",children:s.jsx(c.Input,{placeholder:"如 /api/ctc/authorization/users"})}),s.jsx(c.Form.Item,{name:"method",label:"HTTP 方法",extra:"API 资源填 HTTP 方法;菜单/数据/按钮可留空",children:s.jsx(c.Select,{options:iF})}),s.jsx(c.Form.Item,{name:"icon",label:"图标 (菜单用)",children:s.jsx(c.Input,{placeholder:"如 UserOutlined"})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,maxLength:512,showCount:!0})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})}),s.jsx(c.Drawer,{title:Le?`权限点详情 — ${Le.resourceCode}`:"权限点详情",open:ve,onClose:()=>ke(!1),size:720,destroyOnHidden:!0,children:Le&&s.jsxs(c.Descriptions,{title:"权限点信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"资源ID",children:Le.id}),s.jsx(c.Descriptions.Item,{label:"资源编码",children:s.jsx("span",{style:{fontFamily:"monospace"},children:Le.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"资源名称",children:Le.resourceName}),s.jsx(c.Descriptions.Item,{label:"资源类型",children:Zs(Le.resourceType)}),s.jsx(c.Descriptions.Item,{label:"所属应用",span:2,children:Le.appCode?s.jsx(c.Tag,{color:"cyan",children:Le.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"URL 路径",span:2,children:Le.path||"-"}),s.jsx(c.Descriptions.Item,{label:"HTTP 方法",children:Le.method?s.jsx(c.Tag,{children:Le.method}):"-"}),s.jsx(c.Descriptions.Item,{label:"图标",children:Le.icon||"-"}),s.jsx(c.Descriptions.Item,{label:"排序",children:Le.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:Le.status===1?"success":"default",children:Le.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"租户",span:2,children:Le.tenantCode||"公共"}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:Le.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:Le.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:Le.updatedAt||"-"})]})})]})}function uF(e){return s.jsx(Zd,{...e})}const Yc={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}};function dF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]);d.useEffect(()=>{Lr.listApplications({status:1}).then(h=>{const p=((h==null?void 0:h.records)||[]).map(S=>({value:S.appCode,label:`${S.appName} (${S.appCode})`}));o(p)}).catch(()=>o([]))},[]);const l=async h=>{try{const p=await Xe.listResourcesByApp({appCode:r.appCode,type:r.type,keyword:r.keyword,pageNum:h.current,pageSize:h.pageSize}),S=(p==null?void 0:p.data)||[],y=(p==null?void 0:p.total)??S.length;return{data:S,success:!0,total:y}}catch(p){return c.message.error("查询资源失败:"+((p==null?void 0:p.message)||"未知错误")),{data:[],success:!1,total:0}}},u=()=>{var S;const h=n.getFieldsValue(),p={};h.appCode&&(p.appCode=h.appCode),h.type!==void 0&&h.type!==null&&(p.type=h.type),h.keyword&&(p.keyword=h.keyword),a(p),(S=t.current)==null||S.reload()},m=()=>{var h;n.resetFields(),a({}),(h=t.current)==null||h.reload()},g=async h=>{var p;try{await Xe.deleteResource(h),c.message.success("已删除"),(p=t.current)==null||p.reload()}catch(S){c.message.error("删除失败:"+((S==null?void 0:S.message)||"未知错误"))}},f=[{title:"资源编码",dataIndex:"resourceCode",width:220,fixed:"left",search:!1,render:(h,p)=>s.jsx("span",{style:{fontFamily:"monospace"},children:p.resourceCode})},{title:"资源名称",dataIndex:"resourceName",width:160,search:!1},{title:"类型",dataIndex:"resourceType",width:80,search:!1,render:(h,p)=>{const S=Yc[p.resourceType??3]||{text:String(p.resourceType??"?"),color:"default"};return s.jsx(c.Tag,{color:S.color,children:S.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(h,p)=>p.appCode?s.jsx(c.Tag,{color:"cyan",children:p.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"URL",dataIndex:"path",width:220,ellipsis:!0,search:!1},{title:"方法",dataIndex:"method",width:80,search:!1,render:(h,p)=>p.method?s.jsx(c.Tag,{children:p.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(h,p)=>s.jsx(c.Tag,{color:p.status===1?"success":"default",children:p.status===1?"启用":"禁用"})},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:120,fixed:"right",search:!1,render:(h,p)=>[s.jsx(c.Popconfirm,{title:`删除资源 ${p.resourceCode}?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>g(p.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})},"delete")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(c.Card,{size:"small",style:{marginBottom:16},styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用",children:s.jsx(c.Select,{placeholder:"全部应用",allowClear:!0,style:{width:200},options:i,showSearch:!0,optionFilterProp:"label"})}),s.jsx(c.Form.Item,{name:"type",label:"类型",children:s.jsx(c.Select,{placeholder:"全部类型",allowClear:!0,style:{width:110},options:Object.entries(Yc).map(([h,p])=>({value:Number(h),label:p.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:u,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:m,children:"重置"})]})})]}),s.jsx(c.Space,{style:{flexShrink:0},children:s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var h;return(h=t.current)==null?void 0:h.reload()},children:"刷新"})})]})}),s.jsx(vr,{actionRef:t,rowKey:"id",columns:f,request:l,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:15,showSizeChanger:!0,showTotal:h=>`共 ${h} 条`},dateFormatter:"string"})]})}const{Text:fF}=c.Typography;function mF({apiBaseURL:e}){const[t,n]=d.useState([]),[r,a]=d.useState(!1),[i,o]=d.useState(null),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState([]),[p,S]=d.useState(!1),[y,w]=d.useState([]),[v,x]=d.useState(null),[C,j]=d.useState(!1),b=async()=>{a(!0);try{const I=await lr.listAccounts({pageNum:1,pageSize:200}),M=Array.isArray(I)?I:(I==null?void 0:I.records)||(I==null?void 0:I.data)||[];n(M),M.length>0&&!i&&o(M[0].id)}catch{n([])}finally{a(!1)}};d.useEffect(()=>{b()},[]),d.useEffect(()=>{if(!i){u([]),h([]);return}g(!0),S(!0),lr.listUserRoles(i).then(I=>u(Array.isArray(I)?I:[])).catch(()=>u([])).finally(()=>g(!1)),lr.listUserPermissions(i).then(I=>h(Array.isArray(I)?I:[])).catch(()=>h([])).finally(()=>S(!1))},[i]),d.useEffect(()=>{if(!v){w([]);return}j(!0),lr.listRoleResources(v).then(I=>{const M=Array.isArray(I)?I:[],Y={};M.forEach(A=>{const k=A.resourceType||"OTHER";Y[k]||(Y[k]=[]),Y[k].push(A)});const U=Object.entries(Y).map(([A,k])=>({title:`${A} (${k.length})`,key:`type-${A}`,children:k.map(F=>({title:`${F.resourceName} (${F.resourceCode})`,key:`res-${F.id}`,raw:F}))}));w(U)}).catch(()=>w([])).finally(()=>j(!1))},[v]);const T=t.map(I=>({value:I.id,label:`${I.username||I.nickname||I.id} (${I.tenantCode||"default"})`})),[$,E]=d.useState(""),R=d.useMemo(()=>{const I=$.trim().toLowerCase();return I?l.filter(M=>`${M.roleCode||""} ${M.roleName||""}`.toLowerCase().includes(I)):l},[l,$]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(jt.TableToolbar,{left:s.jsx(c.Select,{showSearch:!0,placeholder:"选择用户",style:{width:320},value:i,onChange:o,loading:r,options:T,filterOption:(I,M)=>M.label.toLowerCase().includes(I.toLowerCase())}),right:s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:b,children:"刷新用户"})}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16},children:[s.jsx(c.Card,{size:"small",title:`用户角色 (${l.length})`,loading:m,extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按角色编码 / 名称过滤",style:{width:220},onChange:I=>E(I.target.value)}),children:l.length===0&&!m?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该用户暂无角色"}):s.jsx(c.List,{size:"small",dataSource:R,renderItem:I=>s.jsx(c.List.Item,{actions:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>x(I.id),disabled:I.id===v,children:I.id===v?"查看中":"查看资源"},"res")],children:s.jsx(c.List.Item.Meta,{title:s.jsxs(c.Space,{children:[s.jsx(fF,{strong:!0,children:I.roleName||I.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:I.roleCode})]}),description:I.description||"-"})})})}),s.jsx(jt.ListTable,{cardTitle:`用户权限 (${f.length})`,rows:f,rowKey:(I,M)=>I.code||I.resourceCode||I.id||M,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该用户暂无直接权限",columns:[{title:"资源编码",dataIndex:"code",width:200,render:(I,M)=>s.jsx("span",{style:{fontFamily:"monospace"},children:M.code||M.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(I,M)=>M.name||M.resourceName||"-"}],cardProps:{size:"small",loading:p}}),s.jsx(c.Card,{size:"small",title:v?`角色资源 (${y.reduce((I,M)=>{var Y;return I+(((Y=M.children)==null?void 0:Y.length)||0)},0)})`:"角色资源",loading:C,children:v?y.length===0&&!C?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该角色暂无资源"}):s.jsx(c.Tree,{treeData:y,defaultExpandAll:!0,selectable:!1,showLine:!0,blockNode:!0,height:420}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"左侧点击「查看资源」以查看该角色拥有的权限点"})})]})]})}let Jd="/api";function hF(e){Jd=e||"/api"}function ci(){return cn.createRequest({baseURL:Jd,timeout:15e3})}const An={shorten:e=>ci().post("/ctc/surl/shorten",e),info:e=>ci().get("/ctc/surl/info",{params:{mapKey:e}}),invalidate:e=>ci().delete("/ctc/surl",{params:{mapKey:e}}),buildUrl:e=>`${typeof window<"u"&&window.location&&window.location.origin||""}/s/${encodeURIComponent(e)}`},Uc="z_surl_history";function gF({apiBaseURL:e}){e&&hF(e);const[t]=c.Form.useForm(),n=d.useRef(void 0),[r,a]=d.useState(null),[i,o]=d.useState(()=>JSON.parse(localStorage.getItem(Uc)||"[]")),[l,u]=d.useState(!1),[m,g]=d.useState(""),f=d.useMemo(()=>{const v=m.trim().toLowerCase();return v?i.filter(x=>`${x.mapKey||""} ${x.originUrl||""} ${x.remark||""}`.toLowerCase().includes(v)):i},[i,m]),h=v=>{o(v),localStorage.setItem(Uc,JSON.stringify(v))},p=async v=>{var x;u(!0);try{const C=await An.shorten({originUrl:v.originUrl,ttlMillis:v.ttlMillis||0,remark:v.remark});a(C);const j=An.buildUrl(C.mapKey),b={mapKey:C.mapKey,originUrl:C.originUrl,expireAt:C.expireAt,hits:C.hits,remark:v.remark,createdAt:new Date().toISOString()};h([b,...i]),c.message.success(`短链生成成功:${j}`),(x=n.current)==null||x.reload()}catch(C){c.message.error("生成失败:"+((C==null?void 0:C.message)||"未知错误"))}finally{u(!1)}},S=async v=>{try{await navigator.clipboard.writeText(v),c.message.success("已复制到剪贴板")}catch{c.message.error("复制失败,请手动复制")}},y=async v=>{var x;try{await An.invalidate(v),c.message.success("已失效"),h(i.filter(C=>C.mapKey!==v)),(x=n.current)==null||x.reload()}catch(C){h(i.filter(j=>j.mapKey!==v)),c.message.warning("后端失效失败,已从本地移除:"+((C==null?void 0:C.message)||""))}},w=[{title:"短码",dataIndex:"mapKey",width:120,fixed:"left"},{title:"完整短链",dataIndex:"mapKey",width:280,render:(v,x)=>{const C=An.buildUrl(x.mapKey);return s.jsxs(c.Space,{size:4,children:[s.jsx("a",{href:C,target:"_blank",rel:"noreferrer",children:C}),s.jsx(c.Tooltip,{title:"复制",children:s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(de.CopyOutlined,{}),onClick:()=>S(C)})})]})}},{title:"原始URL",dataIndex:"originUrl",width:280,ellipsis:!0},{title:"备注",dataIndex:"remark",width:160,ellipsis:!0},{title:"命中次数",dataIndex:"hits",width:90,valueType:"digit"},{title:"过期时间",dataIndex:"expireAt",width:170,render:(v,x)=>x.expireAt?new Date(x.expireAt).toLocaleString():s.jsx(c.Tag,{color:"green",children:"永久"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime"},{title:"操作",valueType:"option",width:100,fixed:"right",render:(v,x)=>[s.jsx(c.Popconfirm,{title:"失效该短链?",onConfirm:()=>y(x.mapKey),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"失效"})},"del")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs(c.Card,{title:s.jsxs(s.Fragment,{children:[s.jsx(de.LinkOutlined,{})," 生成短链"]}),children:[s.jsxs(Tt,{form:t,layout:"inline",onFinish:p,submitter:{render:v=>[s.jsx(c.Button,{onClick:()=>{var x;return(x=v.form)==null?void 0:x.resetFields()},children:"重置"},"reset"),s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),loading:l,onClick:()=>{var x;return(x=v.form)==null?void 0:x.submit()},children:"生成"},"submit")]},children:[s.jsx(da,{name:"originUrl",label:"原始URL",width:"md",rules:[{required:!0,message:"请输入要缩短的URL"},{type:"url",message:"请输入合法的URL"}],placeholder:"https://example.com/some/very/long/path?param=1"}),s.jsx(k0,{name:"ttlMillis",label:"有效期(ms)",width:"sm",min:0,placeholder:"0 = 永久",tooldescription:"0 = 永久;其它填毫秒数,如 86400000 = 1天"}),s.jsx(da,{name:"remark",label:"备注",width:"sm",placeholder:"可选"})]}),r&&s.jsxs("div",{style:{marginTop:16,padding:16,background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx("b",{children:"生成结果:"})}),s.jsxs(c.Space,{orientation:"vertical",style:{width:"100%"},children:[s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"短码:"}),s.jsx(c.Tag,{color:"green",children:r.mapKey})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"完整短链:"}),s.jsx("a",{href:An.buildUrl(r.mapKey),target:"_blank",rel:"noreferrer",children:An.buildUrl(r.mapKey)}),s.jsx(c.Button,{type:"link",size:"small",icon:s.jsx(de.CopyOutlined,{}),onClick:()=>S(An.buildUrl(r.mapKey)),children:"复制"})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"原始URL:"}),s.jsx("span",{style:{wordBreak:"break-all"},children:r.originUrl})]})]})]})]}),s.jsx(c.Card,{title:"历史短链",style:{marginTop:16},extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按短码 / 原始 URL / 备注过滤",style:{width:260},onChange:v=>g(v.target.value)}),children:s.jsx(vr,{actionRef:n,rowKey:"mapKey",columns:w,dataSource:f,search:!1,pagination:{pageSize:10,showSizeChanger:!0},toolBarRender:()=>[s.jsx(c.Button,{onClick:()=>h([]),children:"清空历史"},"clear"),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var v;return(v=n.current)==null?void 0:v.reload()},children:"刷新"},"reload")]})})]})}let pF="/api";function Ot(){return cn.createRequest({baseURL:pF,timeout:15e3})}const pn={listCategories:e=>Ot().get("/ctc/ac/dict/categories/list",{params:e}),getCategory:e=>Ot().get(`/ctc/ac/dict/categories/${e}`),createCategory:e=>Ot().post("/ctc/ac/dict/categories",e),updateCategory:(e,t)=>Ot().put(`/ctc/ac/dict/categories/${e}`,t),deleteCategory:e=>Ot().delete(`/ctc/ac/dict/categories/${e}`),listEntries:(e,t)=>Ot().get("/ctc/ac/dict/entries/list",{params:{category:e,...t}}),getEntry:e=>Ot().get(`/ctc/ac/dict/entries/${e}`),createEntry:e=>Ot().post("/ctc/ac/dict/entries",e),updateEntry:(e,t)=>Ot().put(`/ctc/ac/dict/entries/${e}`,t),deleteEntry:e=>Ot().delete(`/ctc/ac/dict/entries/${e}`),lookup:e=>Ot().get("/ctc/ac/dict/lookup",{params:e}),resolve:(e,t)=>Ot().get("/ctc/ac/dict/resolve",{params:{categories:e.join(","),...t}})};function yF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState(null),[o,l]=d.useState([]),[u,m]=d.useState(!1),[g,f]=d.useState(!1),[h,p]=d.useState(null),[S]=c.Form.useForm(),[y,w]=d.useState(!1),[v,x]=d.useState(null),[C]=c.Form.useForm(),j=async()=>{r(!0);try{const F=await pn.listCategories();t(Array.isArray(F)?F:[])}catch(F){message.error("加载字典分类失败:"+((F==null?void 0:F.message)||"未知错误")),t([])}finally{r(!1)}};d.useEffect(()=>{j()},[]);const b=async F=>{if(!F){l([]);return}m(!0);try{const D=await pn.listEntries(F);l(Array.isArray(D)?D:[])}catch(D){message.error("加载字典条目失败:"+((D==null?void 0:D.message)||"未知错误")),l([])}finally{m(!1)}};d.useEffect(()=>{a!=null&&a.catCode?b(a.catCode):l([])},[a==null?void 0:a.catCode]);const T=()=>{p(null),S.resetFields(),f(!0)},$=F=>{p(F),S.setFieldsValue({catCode:F.catCode,catName:F.catName,scope:F.scope||"TENANT",valueType:F.valueType||"string",entryShape:F.entryShape||"flat",status:F.status??1,sortOrder:F.sortOrder??0,description:F.description}),f(!0)},E=async()=>{try{const F=await S.validateFields();h?(await pn.updateCategory(h.id,F),message.success("更新成功")):(await pn.createCategory(F),message.success("创建成功")),f(!1),p(null),S.resetFields(),j()}catch(F){if(F!=null&&F.errorFields)return;message.error((h?"更新失败:":"创建失败:")+((F==null?void 0:F.message)||"未知错误"))}},R=async F=>{try{await pn.deleteCategory(F),message.success("已删除"),(a==null?void 0:a.id)===F&&i(null),j()}catch(D){message.error("删除失败:"+((D==null?void 0:D.message)||"未知错误"))}},I=()=>{if(!a){message.warning("请先选择左侧的字典分类");return}x(null),C.resetFields(),w(!0)},M=F=>{x(F),C.setFieldsValue({dictKey:F.dictKey,dictValue:F.dictValue,dataValue:F.dataValue,parentKey:F.parentKey,sortOrder:F.sortOrder??0,status:F.status??1}),w(!0)},Y=async()=>{try{const D={...await C.validateFields(),category:a.catCode};v?(await pn.updateEntry(v.id,D),message.success("更新成功")):(await pn.createEntry(D),message.success("创建成功")),w(!1),x(null),C.resetFields(),b(a.catCode)}catch(F){if(F!=null&&F.errorFields)return;message.error((v?"更新失败:":"创建失败:")+((F==null?void 0:F.message)||"未知错误"))}},U=async F=>{try{await pn.deleteEntry(F),message.success("已删除"),b(a.catCode)}catch(D){message.error("删除失败:"+((D==null?void 0:D.message)||"未知错误"))}},A=F=>{const D={GLOBAL:"purple",TENANT:"blue",DOMAIN:"cyan"};return s.jsx(c.Tag,{color:D[F]||"default",children:F||"TENANT"})},k=[{title:"条目键",dataIndex:"dictKey",width:160,render:F=>s.jsx("span",{style:{fontFamily:"monospace"},children:F})},{title:"显示值",dataIndex:"dictValue",width:180},{title:"标签",dataIndex:"tags",width:120,render:F=>F||"-"},{title:"排序",dataIndex:"sortOrder",width:70},{title:"状态",dataIndex:"status",width:80,render:F=>s.jsx(c.Tag,{color:F===1?"success":"default",children:F===1?"启用":"禁用"})},{title:"操作",width:120,render:(F,D)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>M(D),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该字典条目?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>U(D.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:16},children:[s.jsx(jt.ListTable,{cardTitle:`字典分类 (${e.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:T,children:"新增"}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:j})]}),rows:e,rowKey:"id",searchKeys:["catCode","catName"],searchPlaceholder:"搜索编码 / 名称",cardProps:{size:"small",loading:n},tableProps:{onRow:F=>({onClick:()=>i(F),style:{cursor:"pointer",background:(a==null?void 0:a.id)===F.id?"#e6f4ff":void 0}})},columns:[{title:"编码",dataIndex:"catCode",width:110,ellipsis:!0,render:F=>s.jsx("span",{style:{fontFamily:"monospace"},children:F})},{title:"名称",dataIndex:"catName",width:110,ellipsis:!0},{title:"作用域",dataIndex:"scope",width:80,render:F=>A(F)},{title:"状态",dataIndex:"status",width:60,render:F=>s.jsx(c.Tag,{color:F===1?"success":"default",children:F===1?"启":"禁"})},{title:"操作",width:100,render:(F,D)=>s.jsxs(c.Space,{onClick:O=>O.stopPropagation(),children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>$(D),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该分类?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>R(D.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}]}),a?s.jsx(jt.ListTable,{cardTitle:`字典条目 — ${a.catName} (${o.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:I,disabled:!a,children:"新增条目"}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),disabled:!a,onClick:()=>a&&b(a.catCode)})]}),rows:o,rowKey:"id",loading:u,searchKeys:["dictKey","dictValue"],searchPlaceholder:"按条目键 / 显示值过滤",cardProps:{size:"small"},columns:k}):s.jsx(c.Card,{size:"small",title:"字典条目",children:s.jsx("div",{style:{padding:40,textAlign:"center",color:"#999"},children:"请在左侧选择一个字典分类以查看其条目"})})]}),s.jsx(c.Modal,{title:h?"编辑字典分类":"新建字典分类",open:g,onOk:E,onCancel:()=>{f(!1),p(null),S.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(c.Form,{form:S,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"catCode",label:"分类编码",rules:[{required:!0,max:64}],extra:"业务引用键,全局唯一,如 user_status",children:s.jsx(c.Input,{disabled:!!h,placeholder:"如 user_status"})}),s.jsx(c.Form.Item,{name:"catName",label:"分类名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 用户状态"})}),s.jsx(c.Form.Item,{name:"scope",label:"作用域",initialValue:"TENANT",extra:"GLOBAL 全平台共享;TENANT 租户内;DOMAIN 租户 + 域内",children:s.jsx(c.Select,{options:[{value:"GLOBAL",label:"GLOBAL(全平台)"},{value:"TENANT",label:"TENANT(租户)"},{value:"DOMAIN",label:"DOMAIN(租户+域)"}]})}),s.jsx(c.Form.Item,{name:"valueType",label:"条目值类型",initialValue:"string",children:s.jsx(c.Select,{options:[{value:"string",label:"string"},{value:"number",label:"number"},{value:"boolean",label:"boolean"},{value:"json",label:"json"}]})}),s.jsx(c.Form.Item,{name:"entryShape",label:"条目形状",initialValue:"flat",extra:"tree 形状的分类下条目可用父键成树",children:s.jsx(c.Select,{options:[{value:"flat",label:"flat(平铺)"},{value:"tree",label:"tree(树形)"}]})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,maxLength:512})})]})}),s.jsx(c.Modal,{title:v?`编辑字典条目 — ${(a==null?void 0:a.catName)||""}`:`新建字典条目 — ${(a==null?void 0:a.catName)||""}`,open:y,onOk:Y,onCancel:()=>{w(!1),x(null),C.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(c.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dictKey",label:"条目键",rules:[{required:!0,max:64}],extra:"分类内业务唯一,如 enabled",children:s.jsx(c.Input,{placeholder:"如 enabled"})}),s.jsx(c.Form.Item,{name:"dictValue",label:"显示值",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 启用"})}),s.jsx(c.Form.Item,{name:"dataValue",label:"数据值",extra:"值类型为 number/boolean/json 时的载荷(JSON 字符串)",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:'如 {"min": 0, "max": 100}'})}),s.jsx(c.Form.Item,{name:"parentKey",label:"父条目键",extra:"仅 tree 形状的分类生效,填父条目的条目键",children:s.jsx(c.Input,{placeholder:"tree 分类下成树,留空为顶层"})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})})]})}let xF="/api";function ui(){return cn.createRequest({baseURL:xF,timeout:15e3})}const Kc={list:e=>ui().get("/ctc/ac/login-log/list",{params:e}),page:e=>ui().get("/ctc/ac/login-log/page",{params:e}),recent:()=>ui().get("/ctc/ac/login-log/recent")};function bF(){return s.jsx("div",{children:s.jsx(c.Tabs,{defaultActiveKey:"login",size:"small",items:[{key:"login",label:s.jsxs("span",{children:[s.jsx(de.LoginOutlined,{})," 登录日志"]}),children:s.jsx(SF,{})},{key:"operation",label:s.jsxs("span",{children:[s.jsx(de.LoginOutlined,{})," 操作日志"]}),children:s.jsx(c.Card,{children:s.jsxs("div",{style:{padding:40,textAlign:"center",color:"#8a8f98"},children:[s.jsx("div",{style:{marginBottom:8,fontSize:14},children:"操作日志 - 规划中"}),s.jsxs("div",{style:{fontSize:12},children:["未来记录: 谁在什么时间对什么资源做了什么操作",s.jsx("br",{}),"(创建/修改/删除/审批/授权等)"]})]})}),disabled:!0}]})})}function SF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState([]),[o,l]=d.useState(!1),[u,m]=d.useState(0),[g,f]=d.useState({page:1,size:20}),[h,p]=d.useState({identifier:"",tenantCode:"",loginStatus:void 0}),S=async()=>{r(!0);try{const b=await Kc.recent();t(Array.isArray(b)?b:[])}catch{t([])}finally{r(!1)}},y=async b=>{const T=b||g;l(!0);try{const $=await Kc.list({...h,...T});i(($==null?void 0:$.list)||[]),m(($==null?void 0:$.total)||0)}catch{i([]),m(0)}finally{l(!1)}};d.useEffect(()=>{S(),y({page:1,size:20})},[]);const w=()=>y({page:1,size:20}),v=(b,T)=>{const $={page:b,size:T||g.size};f($),y($)},x=e.filter(b=>b.loginStatus===1).length,C=e.filter(b=>b.loginStatus!==1).length,j=[{title:"登录标识",dataIndex:"identifier",width:160},{title:"方式",dataIndex:"identityType",width:90,render:b=>s.jsx(c.Tag,{color:b===1?"blue":b===2?"purple":"cyan",children:b===1?"用户名":b===2?"邮箱":b===3?"手机":b||"-"})},{title:"结果",dataIndex:"loginStatus",width:80,render:b=>s.jsx(c.Tag,{color:b===1?"success":"error",children:b===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0,render:b=>b?s.jsx(c.Tooltip,{title:b,children:b}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"IP",dataIndex:"clientIp",width:130},{title:"租户",dataIndex:"tenantCode",width:100},{title:"域",dataIndex:"domainCode",width:100},{title:"UA",dataIndex:"userAgent",ellipsis:!0,render:b=>b?s.jsx(c.Tooltip,{title:b,children:s.jsx("span",{style:{fontFamily:"monospace",fontSize:12},children:b.length>60?b.slice(0,60)+"…":b})}):"-"},{title:"登录时间",dataIndex:"loginTime",width:170,render:b=>b?Re(b).format("YYYY-MM-DD HH:mm:ss"):"-"}];return s.jsxs(c.Space,{orientation:"vertical",size:12,style:{width:"100%"},children:[s.jsxs(c.Row,{gutter:12,children:[s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近成功登录 (10 条内)",value:x,styles:{content:{color:"#52c41a",fontSize:20}},prefix:s.jsx(de.LoginOutlined,{})})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近失败登录 (10 条内)",value:C,styles:{content:{color:"#ff4d4f",fontSize:20}}})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近 10 条",value:e.length,styles:{content:{fontSize:20}}})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"总日志数",value:u,loading:o,styles:{content:{fontSize:20}}})})})]}),s.jsxs(c.Card,{size:"small",title:s.jsxs(c.Space,{children:[s.jsx("span",{children:"登录日志"}),s.jsxs(c.Tag,{color:"cyan",children:[u," 条"]})]}),extra:s.jsxs(c.Space,{children:[s.jsxs("a",{onClick:S,children:[s.jsx(de.ReloadOutlined,{spin:n})," 刷新最近"]}),s.jsxs("a",{onClick:()=>y(),children:[s.jsx(de.ReloadOutlined,{spin:o})," 刷新列表"]})]}),children:[s.jsxs(c.Space,{wrap:!0,style:{marginBottom:12},children:[s.jsx(jt.SearchInput,{placeholder:"登录标识",value:h.identifier,onChange:b=>p({...h,identifier:b}),onSearch:w}),s.jsx(jt.SearchInput,{placeholder:"租户编码",value:h.tenantCode,onChange:b=>p({...h,tenantCode:b}),onSearch:w}),s.jsx(c.Select,{placeholder:"结果",allowClear:!0,style:{width:110},value:h.loginStatus,onChange:b=>p({...h,loginStatus:b}),options:[{value:1,label:"成功"},{value:0,label:"失败"}]}),s.jsxs("a",{onClick:w,children:[s.jsx(de.SearchOutlined,{})," 查询"]})]}),s.jsx(c.Table,{size:"small",rowKey:"id",loading:o,dataSource:a,columns:j,pagination:{current:g.page,pageSize:g.size,total:u,showSizeChanger:!0,showTotal:b=>`共 ${b} 条`,onChange:v}})]})]})}const Os=cn.createRequest({baseURL:"/api",timeout:1e4}),di=e=>e?typeof e.total=="number"?e.total:Array.isArray(e)?e.length:Array.isArray(e.records)?e.records.length:0:0;function CF(){const[e,t]=d.useState({account:null,role:null,tenant:null,surl:null}),[n,r]=d.useState(!0);return d.useEffect(()=>{let a=!0;return Promise.all([Os.get("/ctc/ac/accounts",{params:{pageSize:1}}).then(i=>di(i)).catch(()=>0),Os.get("/ctc/authz/roles/list").then(i=>di(i)).catch(()=>0),Os.get("/ctc/ac/tenants/list").then(i=>i&&Array.isArray(i)?i.length:0).catch(()=>0),Os.get("/ctc/surl/list",{params:{pageSize:1}}).then(i=>di(i)).catch(()=>0)]).then(([i,o,l,u])=>{a&&(t({account:i,role:o,tenant:l,surl:u}),r(!1))}),()=>{a=!1}},[]),s.jsx("div",{style:{padding:24},children:s.jsxs(c.Row,{gutter:[16,16],children:[s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"账号数",value:e.account,prefix:s.jsx(de.TeamOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"角色数",value:e.role,prefix:s.jsx(de.SafetyCertificateOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"租户数",value:e.tenant,prefix:s.jsx(de.AppstoreOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"短链数",value:e.surl,prefix:s.jsx(de.LinkOutlined,{})})})})]})})}const Xd=({name:e="4A"})=>s.jsxs(c.Button,{type:"primary",children:["Hello ",e,"(来自 @yuku123/z-ctc-component)"]}),wF={HelloCtc:Xd};Object.defineProperty(exports,"Button",{enumerable:!0,get:()=>c.Button});Object.defineProperty(exports,"Card",{enumerable:!0,get:()=>c.Card});Object.defineProperty(exports,"Form",{enumerable:!0,get:()=>c.Form});Object.defineProperty(exports,"Input",{enumerable:!0,get:()=>c.Input});Object.defineProperty(exports,"Space",{enumerable:!0,get:()=>c.Space});Object.defineProperty(exports,"Table",{enumerable:!0,get:()=>c.Table});exports.AccountManagement=tF;exports.ApplicationManagement=aF;exports.AuditPage=bF;exports.ComponentDocPage=sf;exports.CtcOverview=CF;exports.DictPage=yF;exports.HelloCtc=Xd;exports.MyTenantManagement=xf;exports.OrgManagement=Jc;exports.OrgPage=hf;exports.PermissionManagement=Zd;exports.ResourcePage=dF;exports.RoleManagement=uF;exports.StatusTag=lf;exports.SurlManagement=gF;exports.TenantManagement=yf;exports.UserPermissionPage=mF;exports.UserTable=af;exports.ctcAcDomainApi=Ht;exports.ctcAcTenantApi=sr;exports.default=wF;
62
+ `}),s.jsx(c.Tabs,{style:{flex:1,minHeight:0},activeKey:r,onChange:a,items:oF.map(N=>({key:N.key,label:s.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:6},children:[N.icon,N.label]}),children:N.key==="roles"?ls():N.key==="points"?$a():N.key==="auth"?we():Ea()})),destroyInactiveTabPane:!0}),s.jsx(c.Modal,{title:T?`编辑角色 — ${T.roleCode}`:"新增角色",open:y,onOk:T?tn:Ct,onCancel:()=>{w(!1),x(null),C.resetFields()},okText:T?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"roleCode",label:"角色编码",rules:[{required:!0,message:"请输入角色编码"}],extra:"唯一标识,英文/下划线;创建后不可改",children:s.jsx(c.Input,{placeholder:"如 admin / dev / viewer",disabled:!!T})}),s.jsx(c.Form.Item,{name:"roleName",label:"角色名称",rules:[{required:!0,message:"请输入角色名称"}],children:s.jsx(c.Input,{placeholder:"如 管理员"})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:"可选"})}),s.jsx(c.Form.Item,{name:"enabled",label:"启用",valuePropName:"checked",initialValue:!0,children:s.jsx(c.Switch,{checkedChildren:"启用",unCheckedChildren:"停用"})})]})}),s.jsx(c.Modal,{title:Fe?`编辑权限点 — ${Fe.resourceCode}`:"新建权限点",open:Se,onOk:async()=>{var N;try{const ee=await De.validateFields();Fe?(await Xe.updateResource(Fe.id,ee),c.message.success("更新成功")):(await Xe.createResource(ee),c.message.success("创建成功")),Ee(!1),Ie(null),De.resetFields(),(N=fe.current)==null||N.reload(),nt()}catch(ee){if(ee!=null&&ee.errorFields)return;c.message.error("保存失败:"+((ee==null?void 0:ee.message)||"未知错误"))}},onCancel:()=>{Ee(!1),Ie(null),De.resetFields()},okText:Fe?"保存":"创建",destroyOnHidden:!0,children:s.jsxs(c.Form,{form:De,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"resourceCode",label:"资源编码",rules:[{required:!0,min:2,max:128,pattern:/^[a-zA-Z0-9_:.-]+$/,message:"2-128 位字母数字下划线冒号"}],extra:"业务唯一,如 user:read / order:create",children:s.jsx(c.Input,{placeholder:"如 user:read",disabled:!!Fe})}),s.jsx(c.Form.Item,{name:"resourceName",label:"资源名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 用户查询"})}),s.jsx(c.Form.Item,{name:"resourceType",label:"资源类型",rules:[{required:!0}],initialValue:3,children:s.jsx(c.Select,{options:Object.entries(to).map(([N,ee])=>({value:Number(N),label:ee.text}))})}),s.jsx(c.Form.Item,{name:"appCode",label:"所属应用",extra:"选择权限点归属的应用;不选则为「公共」",children:s.jsx(c.Select,{placeholder:"公共(跨应用)",allowClear:!0,showSearch:!0,optionFilterProp:"label",options:J})}),s.jsx(c.Form.Item,{name:"path",label:"URL 路径",extra:"菜单 / API 资源对应路径",children:s.jsx(c.Input,{placeholder:"如 /api/ctc/authorization/users"})}),s.jsx(c.Form.Item,{name:"method",label:"HTTP 方法",extra:"API 资源填 HTTP 方法;菜单/数据/按钮可留空",children:s.jsx(c.Select,{options:iF})}),s.jsx(c.Form.Item,{name:"icon",label:"图标 (菜单用)",children:s.jsx(c.Input,{placeholder:"如 UserOutlined"})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,maxLength:512,showCount:!0})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})}),s.jsx(c.Drawer,{title:Le?`权限点详情 — ${Le.resourceCode}`:"权限点详情",open:ve,onClose:()=>ke(!1),size:720,destroyOnHidden:!0,children:Le&&s.jsxs(c.Descriptions,{title:"权限点信息",size:"small",bordered:!0,column:2,children:[s.jsx(c.Descriptions.Item,{label:"资源ID",children:Le.id}),s.jsx(c.Descriptions.Item,{label:"资源编码",children:s.jsx("span",{style:{fontFamily:"monospace"},children:Le.resourceCode})}),s.jsx(c.Descriptions.Item,{label:"资源名称",children:Le.resourceName}),s.jsx(c.Descriptions.Item,{label:"资源类型",children:Zs(Le.resourceType)}),s.jsx(c.Descriptions.Item,{label:"所属应用",span:2,children:Le.appCode?s.jsx(c.Tag,{color:"cyan",children:Le.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})}),s.jsx(c.Descriptions.Item,{label:"URL 路径",span:2,children:Le.path||"-"}),s.jsx(c.Descriptions.Item,{label:"HTTP 方法",children:Le.method?s.jsx(c.Tag,{children:Le.method}):"-"}),s.jsx(c.Descriptions.Item,{label:"图标",children:Le.icon||"-"}),s.jsx(c.Descriptions.Item,{label:"排序",children:Le.sortOrder??0}),s.jsx(c.Descriptions.Item,{label:"状态",children:s.jsx(c.Tag,{color:Le.status===1?"success":"default",children:Le.status===1?"启用":"禁用"})}),s.jsx(c.Descriptions.Item,{label:"租户",span:2,children:Le.tenantCode||"公共"}),s.jsx(c.Descriptions.Item,{label:"描述",span:2,children:Le.description||"-"}),s.jsx(c.Descriptions.Item,{label:"创建时间",children:Le.createdAt||"-"}),s.jsx(c.Descriptions.Item,{label:"更新时间",children:Le.updatedAt||"-"})]})})]})}function uF(e){return s.jsx(Zd,{...e})}const Uc={1:{text:"菜单",color:"blue"},2:{text:"数据",color:"purple"},3:{text:"API",color:"orange"},4:{text:"按钮",color:"green"}};function dF({apiBaseURL:e}){const t=d.useRef(void 0),[n]=c.Form.useForm(),[r,a]=d.useState({}),[i,o]=d.useState([]);d.useEffect(()=>{Lr.listApplications({status:1}).then(h=>{const p=((h==null?void 0:h.records)||[]).map(S=>({value:S.appCode,label:`${S.appName} (${S.appCode})`}));o(p)}).catch(()=>o([]))},[]);const l=async h=>{try{const p=await Xe.listResourcesByApp({appCode:r.appCode,type:r.type,keyword:r.keyword,pageNum:h.current,pageSize:h.pageSize}),S=(p==null?void 0:p.data)||[],y=(p==null?void 0:p.total)??S.length;return{data:S,success:!0,total:y}}catch(p){return c.message.error("查询资源失败:"+((p==null?void 0:p.message)||"未知错误")),{data:[],success:!1,total:0}}},u=()=>{var S;const h=n.getFieldsValue(),p={};h.appCode&&(p.appCode=h.appCode),h.type!==void 0&&h.type!==null&&(p.type=h.type),h.keyword&&(p.keyword=h.keyword),a(p),(S=t.current)==null||S.reload()},m=()=>{var h;n.resetFields(),a({}),(h=t.current)==null||h.reload()},g=async h=>{var p;try{await Xe.deleteResource(h),c.message.success("已删除"),(p=t.current)==null||p.reload()}catch(S){c.message.error("删除失败:"+((S==null?void 0:S.message)||"未知错误"))}},f=[{title:"资源编码",dataIndex:"resourceCode",width:220,fixed:"left",search:!1,render:(h,p)=>s.jsx("span",{style:{fontFamily:"monospace"},children:p.resourceCode})},{title:"资源名称",dataIndex:"resourceName",width:160,search:!1},{title:"类型",dataIndex:"resourceType",width:80,search:!1,render:(h,p)=>{const S=Uc[p.resourceType??3]||{text:String(p.resourceType??"?"),color:"default"};return s.jsx(c.Tag,{color:S.color,children:S.text})}},{title:"应用",dataIndex:"appCode",width:140,search:!1,render:(h,p)=>p.appCode?s.jsx(c.Tag,{color:"cyan",children:p.appCode}):s.jsx(c.Tag,{color:"default",children:"公共"})},{title:"URL",dataIndex:"path",width:220,ellipsis:!0,search:!1},{title:"方法",dataIndex:"method",width:80,search:!1,render:(h,p)=>p.method?s.jsx(c.Tag,{children:p.method}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"状态",dataIndex:"status",width:80,search:!1,render:(h,p)=>s.jsx(c.Tag,{color:p.status===1?"success":"default",children:p.status===1?"启用":"禁用"})},{title:"租户",dataIndex:"tenantCode",width:100,search:!1},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime",search:!1},{title:"操作",valueType:"option",width:120,fixed:"right",search:!1,render:(h,p)=>[s.jsx(c.Popconfirm,{title:`删除资源 ${p.resourceCode}?`,okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>g(p.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})},"delete")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsx(c.Card,{size:"small",style:{marginBottom:16},styles:{body:{padding:"12px 16px"}},children:s.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",flexWrap:"wrap",gap:12},children:[s.jsxs(c.Form,{form:n,layout:"inline",children:[s.jsx(c.Form.Item,{name:"appCode",label:"应用",children:s.jsx(c.Select,{placeholder:"全部应用",allowClear:!0,style:{width:200},options:i,showSearch:!0,optionFilterProp:"label"})}),s.jsx(c.Form.Item,{name:"type",label:"类型",children:s.jsx(c.Select,{placeholder:"全部类型",allowClear:!0,style:{width:110},options:Object.entries(Uc).map(([h,p])=>({value:Number(h),label:p.text}))})}),s.jsx(c.Form.Item,{name:"keyword",label:"关键字",children:s.jsx(c.Input,{placeholder:"编码 / 名称",allowClear:!0,style:{width:180}})}),s.jsx(c.Form.Item,{children:s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"primary",icon:s.jsx(de.SearchOutlined,{}),onClick:u,children:"查询"}),s.jsx(c.Button,{icon:s.jsx(de.UndoOutlined,{}),onClick:m,children:"重置"})]})})]}),s.jsx(c.Space,{style:{flexShrink:0},children:s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var h;return(h=t.current)==null?void 0:h.reload()},children:"刷新"})})]})}),s.jsx(vr,{actionRef:t,rowKey:"id",columns:f,request:l,params:r,search:!1,size:"small",options:!1,toolBarRender:!1,pagination:{pageSize:15,showSizeChanger:!0,showTotal:h=>`共 ${h} 条`},dateFormatter:"string"})]})}const{Text:fF}=c.Typography;function mF({apiBaseURL:e}){const[t,n]=d.useState([]),[r,a]=d.useState(!1),[i,o]=d.useState(null),[l,u]=d.useState([]),[m,g]=d.useState(!1),[f,h]=d.useState([]),[p,S]=d.useState(!1),[y,w]=d.useState([]),[T,x]=d.useState(null),[C,j]=d.useState(!1),b=d.useRef(0),v=d.useRef(0),$=d.useRef(0),E=d.useCallback(I=>{++v.current,++$.current,o(I??null),u([]),h([]),x(null),w([]),g(!1),S(!1),j(!1)},[]),R=I=>{++$.current,x(I),w([]),j(!0)},D=async()=>{const I=++b.current,F=v.current;a(!0);try{const A=await lr.listAccounts({pageNum:1,pageSize:200});if(I!==b.current)return;const k=Array.isArray(A)?A:(A==null?void 0:A.records)||(A==null?void 0:A.data)||[];n(k),k.length>0&&!i&&F===v.current&&E(k[0].id)}catch{I===b.current&&n([])}finally{I===b.current&&a(!1)}};d.useEffect(()=>(D(),()=>{++b.current}),[]),d.useEffect(()=>{if(!i)return;let I=!0;const F=v.current,A=()=>I&&F===v.current;return g(!0),S(!0),lr.listUserRoles(i).then(k=>{A()&&u(Array.isArray(k)?k:[])}).catch(()=>{A()&&u([])}).finally(()=>{A()&&g(!1)}),lr.listUserPermissions(i).then(k=>{A()&&h(Array.isArray(k)?k:[])}).catch(()=>{A()&&h([])}).finally(()=>{A()&&S(!1)}),()=>{I=!1}},[i]),d.useEffect(()=>{if(!i||!T)return;let I=!0;const F=v.current,A=$.current,k=()=>I&&F===v.current&&A===$.current;return j(!0),lr.listRoleResources(T).then(B=>{if(!k())return;const G=Array.isArray(B)?B:[],_={};G.forEach(Z=>{const q=Z.resourceType||"OTHER";_[q]||(_[q]=[]),_[q].push(Z)});const H=Object.entries(_).map(([Z,q])=>({title:`${Z} (${q.length})`,key:`type-${Z}`,children:q.map(V=>({title:`${V.resourceName} (${V.resourceCode})`,key:`res-${V.id}`,raw:V}))}));w(H)}).catch(()=>{k()&&w([])}).finally(()=>{k()&&j(!1)}),()=>{I=!1}},[i,T]);const M=t.map(I=>({value:I.id,label:`${I.username||I.nickname||I.id} (${I.tenantCode||"default"})`})),[U,Y]=d.useState(""),O=d.useMemo(()=>{const I=U.trim().toLowerCase();return I?l.filter(F=>`${F.roleCode||""} ${F.roleName||""}`.toLowerCase().includes(I)):l},[l,U]);return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsx(jt.TableToolbar,{left:s.jsx(c.Select,{showSearch:!0,allowClear:!0,placeholder:"选择用户",style:{width:320},value:i,onChange:E,loading:r,options:M,filterOption:(I,F)=>F.label.toLowerCase().includes(I.toLowerCase())}),right:s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:D,children:"刷新用户"})}),s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:16},children:[s.jsx(c.Card,{size:"small",title:`用户角色 (${l.length})`,loading:m,extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按角色编码 / 名称过滤",style:{width:220},onChange:I=>Y(I.target.value)}),children:l.length===0&&!m?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该用户暂无角色"}):s.jsx(c.List,{size:"small",dataSource:O,renderItem:I=>s.jsx(c.List.Item,{actions:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>R(I.id),disabled:I.id===T,children:I.id===T?"查看中":"查看资源"},"res")],children:s.jsx(c.List.Item.Meta,{title:s.jsxs(c.Space,{children:[s.jsx(fF,{strong:!0,children:I.roleName||I.roleCode}),s.jsx(c.Tag,{color:"blue",style:{margin:0},children:I.roleCode})]}),description:I.description||"-"})})})}),s.jsx(jt.ListTable,{cardTitle:`用户权限 (${f.length})`,rows:f,rowKey:(I,F)=>I.code||I.resourceCode||I.id||F,searchKeys:["code","name","resourceCode","resourceName"],searchPlaceholder:"按资源编码 / 名称过滤",emptyTitle:"该用户暂无直接权限",columns:[{title:"资源编码",dataIndex:"code",width:200,render:(I,F)=>s.jsx("span",{style:{fontFamily:"monospace"},children:F.code||F.resourceCode||"-"})},{title:"资源名称",dataIndex:"name",ellipsis:!0,render:(I,F)=>F.name||F.resourceName||"-"}],cardProps:{size:"small",loading:p}}),s.jsx(c.Card,{size:"small",title:T?`角色资源 (${y.reduce((I,F)=>{var A;return I+(((A=F.children)==null?void 0:A.length)||0)},0)})`:"角色资源",loading:C,children:T?y.length===0&&!C?s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"该角色暂无资源"}):s.jsx(c.Tree,{treeData:y,defaultExpandAll:!0,selectable:!1,showLine:!0,blockNode:!0,height:420}):s.jsx(c.Empty,{image:c.Empty.PRESENTED_IMAGE_SIMPLE,description:"左侧点击「查看资源」以查看该角色拥有的权限点"})})]})]})}let Jd="/api";function hF(e){Jd=e||"/api"}function ci(){return cn.createRequest({baseURL:Jd,timeout:15e3})}const An={shorten:e=>ci().post("/ctc/surl/shorten",e),info:e=>ci().get("/ctc/surl/info",{params:{mapKey:e}}),invalidate:e=>ci().delete("/ctc/surl",{params:{mapKey:e}}),buildUrl:e=>`${typeof window<"u"&&window.location&&window.location.origin||""}/s/${encodeURIComponent(e)}`},Yc="z_surl_history";function gF({apiBaseURL:e}){e&&hF(e);const[t]=c.Form.useForm(),n=d.useRef(void 0),[r,a]=d.useState(null),[i,o]=d.useState(()=>JSON.parse(localStorage.getItem(Yc)||"[]")),[l,u]=d.useState(!1),[m,g]=d.useState(""),f=d.useMemo(()=>{const T=m.trim().toLowerCase();return T?i.filter(x=>`${x.mapKey||""} ${x.originUrl||""} ${x.remark||""}`.toLowerCase().includes(T)):i},[i,m]),h=T=>{o(T),localStorage.setItem(Yc,JSON.stringify(T))},p=async T=>{var x;u(!0);try{const C=await An.shorten({originUrl:T.originUrl,ttlMillis:T.ttlMillis||0,remark:T.remark});a(C);const j=An.buildUrl(C.mapKey),b={mapKey:C.mapKey,originUrl:C.originUrl,expireAt:C.expireAt,hits:C.hits,remark:T.remark,createdAt:new Date().toISOString()};h([b,...i]),c.message.success(`短链生成成功:${j}`),(x=n.current)==null||x.reload()}catch(C){c.message.error("生成失败:"+((C==null?void 0:C.message)||"未知错误"))}finally{u(!1)}},S=async T=>{try{await navigator.clipboard.writeText(T),c.message.success("已复制到剪贴板")}catch{c.message.error("复制失败,请手动复制")}},y=async T=>{var x;try{await An.invalidate(T),c.message.success("已失效"),h(i.filter(C=>C.mapKey!==T)),(x=n.current)==null||x.reload()}catch(C){h(i.filter(j=>j.mapKey!==T)),c.message.warning("后端失效失败,已从本地移除:"+((C==null?void 0:C.message)||""))}},w=[{title:"短码",dataIndex:"mapKey",width:120,fixed:"left"},{title:"完整短链",dataIndex:"mapKey",width:280,render:(T,x)=>{const C=An.buildUrl(x.mapKey);return s.jsxs(c.Space,{size:4,children:[s.jsx("a",{href:C,target:"_blank",rel:"noreferrer",children:C}),s.jsx(c.Tooltip,{title:"复制",children:s.jsx(c.Button,{type:"text",size:"small",icon:s.jsx(de.CopyOutlined,{}),onClick:()=>S(C)})})]})}},{title:"原始URL",dataIndex:"originUrl",width:280,ellipsis:!0},{title:"备注",dataIndex:"remark",width:160,ellipsis:!0},{title:"命中次数",dataIndex:"hits",width:90,valueType:"digit"},{title:"过期时间",dataIndex:"expireAt",width:170,render:(T,x)=>x.expireAt?new Date(x.expireAt).toLocaleString():s.jsx(c.Tag,{color:"green",children:"永久"})},{title:"创建时间",dataIndex:"createdAt",width:170,valueType:"dateTime"},{title:"操作",valueType:"option",width:100,fixed:"right",render:(T,x)=>[s.jsx(c.Popconfirm,{title:"失效该短链?",onConfirm:()=>y(x.mapKey),children:s.jsx(c.Button,{type:"link",danger:!0,size:"small",children:"失效"})},"del")]}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:0},children:[s.jsxs(c.Card,{title:s.jsxs(s.Fragment,{children:[s.jsx(de.LinkOutlined,{})," 生成短链"]}),children:[s.jsxs(Tt,{form:t,layout:"inline",onFinish:p,submitter:{render:T=>[s.jsx(c.Button,{onClick:()=>{var x;return(x=T.form)==null?void 0:x.resetFields()},children:"重置"},"reset"),s.jsx(c.Button,{type:"primary",icon:s.jsx(de.PlusOutlined,{}),loading:l,onClick:()=>{var x;return(x=T.form)==null?void 0:x.submit()},children:"生成"},"submit")]},children:[s.jsx(da,{name:"originUrl",label:"原始URL",width:"md",rules:[{required:!0,message:"请输入要缩短的URL"},{type:"url",message:"请输入合法的URL"}],placeholder:"https://example.com/some/very/long/path?param=1"}),s.jsx(k0,{name:"ttlMillis",label:"有效期(ms)",width:"sm",min:0,placeholder:"0 = 永久",tooldescription:"0 = 永久;其它填毫秒数,如 86400000 = 1天"}),s.jsx(da,{name:"remark",label:"备注",width:"sm",placeholder:"可选"})]}),r&&s.jsxs("div",{style:{marginTop:16,padding:16,background:"#f6ffed",border:"1px solid #b7eb8f",borderRadius:6},children:[s.jsx("div",{style:{marginBottom:8},children:s.jsx("b",{children:"生成结果:"})}),s.jsxs(c.Space,{orientation:"vertical",style:{width:"100%"},children:[s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"短码:"}),s.jsx(c.Tag,{color:"green",children:r.mapKey})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"完整短链:"}),s.jsx("a",{href:An.buildUrl(r.mapKey),target:"_blank",rel:"noreferrer",children:An.buildUrl(r.mapKey)}),s.jsx(c.Button,{type:"link",size:"small",icon:s.jsx(de.CopyOutlined,{}),onClick:()=>S(An.buildUrl(r.mapKey)),children:"复制"})]}),s.jsxs("div",{children:[s.jsx("span",{style:{color:"#999",marginRight:8},children:"原始URL:"}),s.jsx("span",{style:{wordBreak:"break-all"},children:r.originUrl})]})]})]})]}),s.jsx(c.Card,{title:"历史短链",style:{marginTop:16},extra:s.jsx(c.Input.Search,{allowClear:!0,placeholder:"按短码 / 原始 URL / 备注过滤",style:{width:260},onChange:T=>g(T.target.value)}),children:s.jsx(vr,{actionRef:n,rowKey:"mapKey",columns:w,dataSource:f,search:!1,pagination:{pageSize:10,showSizeChanger:!0},toolBarRender:()=>[s.jsx(c.Button,{onClick:()=>h([]),children:"清空历史"},"clear"),s.jsx(c.Button,{icon:s.jsx(de.ReloadOutlined,{}),onClick:()=>{var T;return(T=n.current)==null?void 0:T.reload()},children:"刷新"},"reload")]})})]})}let pF="/api";function Ot(){return cn.createRequest({baseURL:pF,timeout:15e3})}const pn={listCategories:e=>Ot().get("/ctc/ac/dict/categories/list",{params:e}),getCategory:e=>Ot().get(`/ctc/ac/dict/categories/${e}`),createCategory:e=>Ot().post("/ctc/ac/dict/categories",e),updateCategory:(e,t)=>Ot().put(`/ctc/ac/dict/categories/${e}`,t),deleteCategory:e=>Ot().delete(`/ctc/ac/dict/categories/${e}`),listEntries:(e,t)=>Ot().get("/ctc/ac/dict/entries/list",{params:{category:e,...t}}),getEntry:e=>Ot().get(`/ctc/ac/dict/entries/${e}`),createEntry:e=>Ot().post("/ctc/ac/dict/entries",e),updateEntry:(e,t)=>Ot().put(`/ctc/ac/dict/entries/${e}`,t),deleteEntry:e=>Ot().delete(`/ctc/ac/dict/entries/${e}`),lookup:e=>Ot().get("/ctc/ac/dict/lookup",{params:e}),resolve:(e,t)=>Ot().get("/ctc/ac/dict/resolve",{params:{categories:e.join(","),...t}})};function yF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState(null),[o,l]=d.useState([]),[u,m]=d.useState(!1),[g,f]=d.useState(!1),[h,p]=d.useState(null),[S]=c.Form.useForm(),[y,w]=d.useState(!1),[T,x]=d.useState(null),[C]=c.Form.useForm(),j=async()=>{r(!0);try{const F=await pn.listCategories();t(Array.isArray(F)?F:[])}catch(F){message.error("加载字典分类失败:"+((F==null?void 0:F.message)||"未知错误")),t([])}finally{r(!1)}};d.useEffect(()=>{j()},[]);const b=async F=>{if(!F){l([]);return}m(!0);try{const A=await pn.listEntries(F);l(Array.isArray(A)?A:[])}catch(A){message.error("加载字典条目失败:"+((A==null?void 0:A.message)||"未知错误")),l([])}finally{m(!1)}};d.useEffect(()=>{a!=null&&a.catCode?b(a.catCode):l([])},[a==null?void 0:a.catCode]);const v=()=>{p(null),S.resetFields(),f(!0)},$=F=>{p(F),S.setFieldsValue({catCode:F.catCode,catName:F.catName,scope:F.scope||"TENANT",valueType:F.valueType||"string",entryShape:F.entryShape||"flat",status:F.status??1,sortOrder:F.sortOrder??0,description:F.description}),f(!0)},E=async()=>{try{const F=await S.validateFields();h?(await pn.updateCategory(h.id,F),message.success("更新成功")):(await pn.createCategory(F),message.success("创建成功")),f(!1),p(null),S.resetFields(),j()}catch(F){if(F!=null&&F.errorFields)return;message.error((h?"更新失败:":"创建失败:")+((F==null?void 0:F.message)||"未知错误"))}},R=async F=>{try{await pn.deleteCategory(F),message.success("已删除"),(a==null?void 0:a.id)===F&&i(null),j()}catch(A){message.error("删除失败:"+((A==null?void 0:A.message)||"未知错误"))}},D=()=>{if(!a){message.warning("请先选择左侧的字典分类");return}x(null),C.resetFields(),w(!0)},M=F=>{x(F),C.setFieldsValue({dictKey:F.dictKey,dictValue:F.dictValue,dataValue:F.dataValue,parentKey:F.parentKey,sortOrder:F.sortOrder??0,status:F.status??1}),w(!0)},U=async()=>{try{const A={...await C.validateFields(),category:a.catCode};T?(await pn.updateEntry(T.id,A),message.success("更新成功")):(await pn.createEntry(A),message.success("创建成功")),w(!1),x(null),C.resetFields(),b(a.catCode)}catch(F){if(F!=null&&F.errorFields)return;message.error((T?"更新失败:":"创建失败:")+((F==null?void 0:F.message)||"未知错误"))}},Y=async F=>{try{await pn.deleteEntry(F),message.success("已删除"),b(a.catCode)}catch(A){message.error("删除失败:"+((A==null?void 0:A.message)||"未知错误"))}},O=F=>{const A={GLOBAL:"purple",TENANT:"blue",DOMAIN:"cyan"};return s.jsx(c.Tag,{color:A[F]||"default",children:F||"TENANT"})},I=[{title:"条目键",dataIndex:"dictKey",width:160,render:F=>s.jsx("span",{style:{fontFamily:"monospace"},children:F})},{title:"显示值",dataIndex:"dictValue",width:180},{title:"标签",dataIndex:"tags",width:120,render:F=>F||"-"},{title:"排序",dataIndex:"sortOrder",width:70},{title:"状态",dataIndex:"status",width:80,render:F=>s.jsx(c.Tag,{color:F===1?"success":"default",children:F===1?"启用":"禁用"})},{title:"操作",width:120,render:(F,A)=>s.jsxs(c.Space,{children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>M(A),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该字典条目?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>Y(A.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}];return s.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"380px 1fr",gap:16},children:[s.jsx(jt.ListTable,{cardTitle:`字典分类 (${e.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:v,children:"新增"}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),onClick:j})]}),rows:e,rowKey:"id",searchKeys:["catCode","catName"],searchPlaceholder:"搜索编码 / 名称",cardProps:{size:"small",loading:n},tableProps:{onRow:F=>({onClick:()=>i(F),style:{cursor:"pointer",background:(a==null?void 0:a.id)===F.id?"#e6f4ff":void 0}})},columns:[{title:"编码",dataIndex:"catCode",width:110,ellipsis:!0,render:F=>s.jsx("span",{style:{fontFamily:"monospace"},children:F})},{title:"名称",dataIndex:"catName",width:110,ellipsis:!0},{title:"作用域",dataIndex:"scope",width:80,render:F=>O(F)},{title:"状态",dataIndex:"status",width:60,render:F=>s.jsx(c.Tag,{color:F===1?"success":"default",children:F===1?"启":"禁"})},{title:"操作",width:100,render:(F,A)=>s.jsxs(c.Space,{onClick:k=>k.stopPropagation(),children:[s.jsx(c.Button,{type:"link",size:"small",onClick:()=>$(A),children:"编辑"}),s.jsx(c.Popconfirm,{title:"删除该分类?",okText:"删除",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>R(A.id),children:s.jsx(c.Button,{type:"link",size:"small",danger:!0,children:"删除"})})]})}]}),a?s.jsx(jt.ListTable,{cardTitle:`字典条目 — ${a.catName} (${o.length})`,cardExtra:s.jsxs(c.Space,{children:[s.jsx(c.Button,{size:"small",icon:s.jsx(de.PlusOutlined,{}),onClick:D,disabled:!a,children:"新增条目"}),s.jsx(c.Button,{size:"small",icon:s.jsx(de.ReloadOutlined,{}),disabled:!a,onClick:()=>a&&b(a.catCode)})]}),rows:o,rowKey:"id",loading:u,searchKeys:["dictKey","dictValue"],searchPlaceholder:"按条目键 / 显示值过滤",cardProps:{size:"small"},columns:I}):s.jsx(c.Card,{size:"small",title:"字典条目",children:s.jsx("div",{style:{padding:40,textAlign:"center",color:"#999"},children:"请在左侧选择一个字典分类以查看其条目"})})]}),s.jsx(c.Modal,{title:h?"编辑字典分类":"新建字典分类",open:g,onOk:E,onCancel:()=>{f(!1),p(null),S.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(c.Form,{form:S,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"catCode",label:"分类编码",rules:[{required:!0,max:64}],extra:"业务引用键,全局唯一,如 user_status",children:s.jsx(c.Input,{disabled:!!h,placeholder:"如 user_status"})}),s.jsx(c.Form.Item,{name:"catName",label:"分类名称",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 用户状态"})}),s.jsx(c.Form.Item,{name:"scope",label:"作用域",initialValue:"TENANT",extra:"GLOBAL 全平台共享;TENANT 租户内;DOMAIN 租户 + 域内",children:s.jsx(c.Select,{options:[{value:"GLOBAL",label:"GLOBAL(全平台)"},{value:"TENANT",label:"TENANT(租户)"},{value:"DOMAIN",label:"DOMAIN(租户+域)"}]})}),s.jsx(c.Form.Item,{name:"valueType",label:"条目值类型",initialValue:"string",children:s.jsx(c.Select,{options:[{value:"string",label:"string"},{value:"number",label:"number"},{value:"boolean",label:"boolean"},{value:"json",label:"json"}]})}),s.jsx(c.Form.Item,{name:"entryShape",label:"条目形状",initialValue:"flat",extra:"tree 形状的分类下条目可用父键成树",children:s.jsx(c.Select,{options:[{value:"flat",label:"flat(平铺)"},{value:"tree",label:"tree(树形)"}]})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})}),s.jsx(c.Form.Item,{name:"description",label:"描述",children:s.jsx(c.Input.TextArea,{rows:2,maxLength:512})})]})}),s.jsx(c.Modal,{title:T?`编辑字典条目 — ${(a==null?void 0:a.catName)||""}`:`新建字典条目 — ${(a==null?void 0:a.catName)||""}`,open:y,onOk:U,onCancel:()=>{w(!1),x(null),C.resetFields()},destroyOnHidden:!0,size:"large",children:s.jsxs(c.Form,{form:C,layout:"vertical",style:{marginTop:16},children:[s.jsx(c.Form.Item,{name:"dictKey",label:"条目键",rules:[{required:!0,max:64}],extra:"分类内业务唯一,如 enabled",children:s.jsx(c.Input,{placeholder:"如 enabled"})}),s.jsx(c.Form.Item,{name:"dictValue",label:"显示值",rules:[{required:!0,max:128}],children:s.jsx(c.Input,{placeholder:"如 启用"})}),s.jsx(c.Form.Item,{name:"dataValue",label:"数据值",extra:"值类型为 number/boolean/json 时的载荷(JSON 字符串)",children:s.jsx(c.Input.TextArea,{rows:2,placeholder:'如 {"min": 0, "max": 100}'})}),s.jsx(c.Form.Item,{name:"parentKey",label:"父条目键",extra:"仅 tree 形状的分类生效,填父条目的条目键",children:s.jsx(c.Input,{placeholder:"tree 分类下成树,留空为顶层"})}),s.jsx(c.Form.Item,{name:"sortOrder",label:"排序",initialValue:0,children:s.jsx(c.InputNumber,{min:0,max:9999,style:{width:"100%"}})}),s.jsx(c.Form.Item,{name:"status",label:"状态",initialValue:1,children:s.jsx(c.Select,{options:[{value:1,label:"启用"},{value:0,label:"禁用"}]})})]})})]})}let xF="/api";function ui(){return cn.createRequest({baseURL:xF,timeout:15e3})}const Kc={list:e=>ui().get("/ctc/ac/login-log/list",{params:e}),page:e=>ui().get("/ctc/ac/login-log/page",{params:e}),recent:()=>ui().get("/ctc/ac/login-log/recent")};function bF(){return s.jsx("div",{children:s.jsx(c.Tabs,{defaultActiveKey:"login",size:"small",items:[{key:"login",label:s.jsxs("span",{children:[s.jsx(de.LoginOutlined,{})," 登录日志"]}),children:s.jsx(SF,{})},{key:"operation",label:s.jsxs("span",{children:[s.jsx(de.LoginOutlined,{})," 操作日志"]}),children:s.jsx(c.Card,{children:s.jsxs("div",{style:{padding:40,textAlign:"center",color:"#8a8f98"},children:[s.jsx("div",{style:{marginBottom:8,fontSize:14},children:"操作日志 - 规划中"}),s.jsxs("div",{style:{fontSize:12},children:["未来记录: 谁在什么时间对什么资源做了什么操作",s.jsx("br",{}),"(创建/修改/删除/审批/授权等)"]})]})}),disabled:!0}]})})}function SF(){const[e,t]=d.useState([]),[n,r]=d.useState(!1),[a,i]=d.useState([]),[o,l]=d.useState(!1),[u,m]=d.useState(0),[g,f]=d.useState({page:1,size:20}),[h,p]=d.useState({identifier:"",tenantCode:"",loginStatus:void 0}),S=async()=>{r(!0);try{const b=await Kc.recent();t(Array.isArray(b)?b:[])}catch{t([])}finally{r(!1)}},y=async b=>{const v=b||g;l(!0);try{const $=await Kc.list({...h,...v});i(($==null?void 0:$.list)||[]),m(($==null?void 0:$.total)||0)}catch{i([]),m(0)}finally{l(!1)}};d.useEffect(()=>{S(),y({page:1,size:20})},[]);const w=()=>y({page:1,size:20}),T=(b,v)=>{const $={page:b,size:v||g.size};f($),y($)},x=e.filter(b=>b.loginStatus===1).length,C=e.filter(b=>b.loginStatus!==1).length,j=[{title:"登录标识",dataIndex:"identifier",width:160},{title:"方式",dataIndex:"identityType",width:90,render:b=>s.jsx(c.Tag,{color:b===1?"blue":b===2?"purple":"cyan",children:b===1?"用户名":b===2?"邮箱":b===3?"手机":b||"-"})},{title:"结果",dataIndex:"loginStatus",width:80,render:b=>s.jsx(c.Tag,{color:b===1?"success":"error",children:b===1?"成功":"失败"})},{title:"失败原因",dataIndex:"failureReason",ellipsis:!0,render:b=>b?s.jsx(c.Tooltip,{title:b,children:b}):s.jsx("span",{style:{color:"#bbb"},children:"-"})},{title:"IP",dataIndex:"clientIp",width:130},{title:"租户",dataIndex:"tenantCode",width:100},{title:"域",dataIndex:"domainCode",width:100},{title:"UA",dataIndex:"userAgent",ellipsis:!0,render:b=>b?s.jsx(c.Tooltip,{title:b,children:s.jsx("span",{style:{fontFamily:"monospace",fontSize:12},children:b.length>60?b.slice(0,60)+"…":b})}):"-"},{title:"登录时间",dataIndex:"loginTime",width:170,render:b=>b?Re(b).format("YYYY-MM-DD HH:mm:ss"):"-"}];return s.jsxs(c.Space,{orientation:"vertical",size:12,style:{width:"100%"},children:[s.jsxs(c.Row,{gutter:12,children:[s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近成功登录 (10 条内)",value:x,styles:{content:{color:"#52c41a",fontSize:20}},prefix:s.jsx(de.LoginOutlined,{})})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近失败登录 (10 条内)",value:C,styles:{content:{color:"#ff4d4f",fontSize:20}}})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"最近 10 条",value:e.length,styles:{content:{fontSize:20}}})})}),s.jsx(c.Col,{span:6,children:s.jsx(c.Card,{size:"small",children:s.jsx(c.Statistic,{title:"总日志数",value:u,loading:o,styles:{content:{fontSize:20}}})})})]}),s.jsxs(c.Card,{size:"small",title:s.jsxs(c.Space,{children:[s.jsx("span",{children:"登录日志"}),s.jsxs(c.Tag,{color:"cyan",children:[u," 条"]})]}),extra:s.jsxs(c.Space,{children:[s.jsxs("a",{onClick:S,children:[s.jsx(de.ReloadOutlined,{spin:n})," 刷新最近"]}),s.jsxs("a",{onClick:()=>y(),children:[s.jsx(de.ReloadOutlined,{spin:o})," 刷新列表"]})]}),children:[s.jsxs(c.Space,{wrap:!0,style:{marginBottom:12},children:[s.jsx(jt.SearchInput,{placeholder:"登录标识",value:h.identifier,onChange:b=>p({...h,identifier:b}),onSearch:w}),s.jsx(jt.SearchInput,{placeholder:"租户编码",value:h.tenantCode,onChange:b=>p({...h,tenantCode:b}),onSearch:w}),s.jsx(c.Select,{placeholder:"结果",allowClear:!0,style:{width:110},value:h.loginStatus,onChange:b=>p({...h,loginStatus:b}),options:[{value:1,label:"成功"},{value:0,label:"失败"}]}),s.jsxs("a",{onClick:w,children:[s.jsx(de.SearchOutlined,{})," 查询"]})]}),s.jsx(c.Table,{size:"small",rowKey:"id",loading:o,dataSource:a,columns:j,pagination:{current:g.page,pageSize:g.size,total:u,showSizeChanger:!0,showTotal:b=>`共 ${b} 条`,onChange:T}})]})]})}const Os=cn.createRequest({baseURL:"/api",timeout:1e4}),di=e=>e?typeof e.total=="number"?e.total:Array.isArray(e)?e.length:Array.isArray(e.records)?e.records.length:0:0;function CF(){const[e,t]=d.useState({account:null,role:null,tenant:null,surl:null}),[n,r]=d.useState(!0);return d.useEffect(()=>{let a=!0;return Promise.all([Os.get("/ctc/ac/accounts",{params:{pageSize:1}}).then(i=>di(i)).catch(()=>0),Os.get("/ctc/authz/roles/list").then(i=>di(i)).catch(()=>0),Os.get("/ctc/ac/tenants/list").then(i=>i&&Array.isArray(i)?i.length:0).catch(()=>0),Os.get("/ctc/surl/list",{params:{pageSize:1}}).then(i=>di(i)).catch(()=>0)]).then(([i,o,l,u])=>{a&&(t({account:i,role:o,tenant:l,surl:u}),r(!1))}),()=>{a=!1}},[]),s.jsx("div",{style:{padding:24},children:s.jsxs(c.Row,{gutter:[16,16],children:[s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"账号数",value:e.account,prefix:s.jsx(de.TeamOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"角色数",value:e.role,prefix:s.jsx(de.SafetyCertificateOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"租户数",value:e.tenant,prefix:s.jsx(de.AppstoreOutlined,{})})})}),s.jsx(c.Col,{xs:24,sm:12,lg:6,children:s.jsx(c.Card,{loading:n,children:s.jsx(c.Statistic,{title:"短链数",value:e.surl,prefix:s.jsx(de.LinkOutlined,{})})})})]})})}const Xd=({name:e="4A"})=>s.jsxs(c.Button,{type:"primary",children:["Hello ",e,"(来自 @yuku123/z-ctc-component)"]}),wF={HelloCtc:Xd};Object.defineProperty(exports,"Button",{enumerable:!0,get:()=>c.Button});Object.defineProperty(exports,"Card",{enumerable:!0,get:()=>c.Card});Object.defineProperty(exports,"Form",{enumerable:!0,get:()=>c.Form});Object.defineProperty(exports,"Input",{enumerable:!0,get:()=>c.Input});Object.defineProperty(exports,"Space",{enumerable:!0,get:()=>c.Space});Object.defineProperty(exports,"Table",{enumerable:!0,get:()=>c.Table});exports.AccountManagement=tF;exports.ApplicationManagement=aF;exports.AuditPage=bF;exports.ComponentDocPage=sf;exports.CtcOverview=CF;exports.DictPage=yF;exports.HelloCtc=Xd;exports.MyTenantManagement=xf;exports.OrgManagement=Jc;exports.OrgPage=hf;exports.PermissionManagement=Zd;exports.ResourcePage=dF;exports.RoleManagement=uF;exports.StatusTag=lf;exports.SurlManagement=gF;exports.TenantManagement=yf;exports.UserPermissionPage=mF;exports.UserTable=af;exports.ctcAcDomainApi=Ht;exports.ctcAcTenantApi=sr;exports.default=wF;