From bb84fc59d557499a6162fe0877da0f7616b38c5d Mon Sep 17 00:00:00 2001 From: what Date: Wed, 17 Jun 2026 09:53:27 +0800 Subject: [PATCH] v0.6.47 --- dist/button.js | 2 +- dist/common/main-CkdKM5PB.js | 1568 ------------------------------- dist/common/main-Cta62l2D.js | 1572 ++++++++++++++++++++++++++++++++ dist/components.js | 2 +- dist/container.js | 2 +- dist/data-converter.js | 2 +- dist/data-list.js | 2 +- dist/data-list/utils.js | 2 +- dist/grid-layout-form.js | 2 +- dist/grid-layout-form/utils.js | 2 +- dist/grid-layout.js | 2 +- dist/grid-layout/utils.js | 2 +- dist/hooks.js | 2 +- dist/iconfont.js | 2 +- dist/index.js | 2 +- dist/pages.js | 2 +- dist/res-ws.js | 2 +- dist/style.css | 2 +- dist/utils.js | 2 +- dist/virtual-fs.js | 2 +- package.json | 2 +- 21 files changed, 1591 insertions(+), 1587 deletions(-) delete mode 100644 dist/common/main-CkdKM5PB.js create mode 100644 dist/common/main-Cta62l2D.js diff --git a/dist/button.js b/dist/button.js index badd300..b72d20e 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { am as s, al as u, an as e } from "./common/main-CkdKM5PB.js"; +import { am as s, al as u, an as e } from "./common/main-Cta62l2D.js"; export { s as auth, u as default, diff --git a/dist/common/main-CkdKM5PB.js b/dist/common/main-CkdKM5PB.js deleted file mode 100644 index b4b62c2..0000000 --- a/dist/common/main-CkdKM5PB.js +++ /dev/null @@ -1,1568 +0,0 @@ -var Or = Object.defineProperty; -var wi = (t) => { - throw TypeError(t); -}; -var Rr = (t, e, i) => e in t ? Or(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i; -var O = (t, e, i) => Rr(t, typeof e != "symbol" ? e + "" : e, i), bi = (t, e, i) => e.has(t) || wi("Cannot " + i); -var d = (t, e, i) => (bi(t, e, "read from private field"), i ? i.call(t) : e.get(t)), v = (t, e, i) => e.has(t) ? wi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), K = (t, e, i, r) => (bi(t, e, "write to private field"), r ? r.call(t, i) : e.set(t, i), i); -var Ci = (t, e, i, r) => ({ - set _(n) { - K(t, e, n, i); - }, - get _() { - return d(t, e, r); - } -}); -import { jsx as m, jsxs as L } from "react/jsx-runtime"; -import S, { useEffect as q, useState as I, useCallback as H, useRef as _, useContext as he, useMemo as U, useId as Dt, isValidElement as Fr, useLayoutEffect as jr } from "react"; -import me from "pathe"; -import b from "prop-types"; -import j from "classnames"; -import { useNotification as Ar } from "rc-notification"; -import f from "lodash"; -import ae, { Field as Zt, FieldContext as Li } from "rc-field-form"; -import { useMountedState as Ir, useDeepCompareEffect as ei, useUpdateEffect as Mi, usePrevious as Vi } from "react-use"; -import { _ as ki, M as It, N as tt, b as De, i as zt, c as Lr, S as Mr } from "./vender-hQk7ADWo.js"; -import Vr from "rc-util/lib/hooks/useMergedState"; -import Di from "immutability-helper"; -import { Space as Bt, Form as wt, Input as Dr, Button as Ct, Pagination as zr, Tree as Br, Breadcrumb as Wr, Empty as Wt, Table as Si, Popover as Ur, Popconfirm as qr, Tooltip as Kr, Divider as Jr } from "antd"; -import { useMergedState as _r } from "rc-util"; -import { generatePath as Hr, useInRouterContext as zi, useParams as Gr, useLocation as Yr, createBrowserRouter as Xr, Navigate as Qr } from "react-router-dom"; -import Zr from "rc-drawer"; -import en from "rc-dialog"; -import * as Ei from "react-is"; -var Je, rt, _e, xe, ze, Be; -class Bi { - constructor(e, i) { - v(this, Je, /* @__PURE__ */ new Map()); - v(this, rt, !0); - v(this, _e, []); - v(this, xe); - v(this, ze, () => d(this, xe)); - v(this, Be, () => Promise.resolve()); - O(this, "get", (...e) => new Promise((i, r) => { - const n = JSON.stringify(e); - if (d(this, Je).has(n)) return i(d(this, Be).call(this, d(this, xe), ...e)); - if (d(this, xe) === void 0) d(this, _e).push([e, i, r]), d(this, rt) && (K(this, rt, !1), Promise.resolve(typeof d(this, ze) == "function" ? d(this, ze).call(this) : d(this, ze)).then((o) => K(this, xe, o || null)).finally(() => { - d(this, _e).forEach(([o, a, s]) => { - try { - const l = d(this, Be).call(this, d(this, xe), ...o); - d(this, Je).set(JSON.stringify(o), l), a(l); - } catch (l) { - s(l); - } - }), d(this, _e).length = 0; - })); - else { - const o = d(this, Be).call(this, d(this, xe), ...e); - d(this, Je).set(n, o), i(o); - } - })); - K(this, Be, i), K(this, ze, e); - } -} -Je = new WeakMap(), rt = new WeakMap(), _e = new WeakMap(), xe = new WeakMap(), ze = new WeakMap(), Be = new WeakMap(); -const No = () => m("div", { children: "Empty" }), ht = S.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), te = ({ rootClassName: t, className: e, children: i, actions: r, title: n, subTitle: o, extras: a, style: s = {} }) => { - const { mount: l, unmount: c } = S.useContext(ht); - return te.Action({ children: r }), te.Title({ children: n }), te.SubTitle({ children: o }), te.Extra({ children: a }), q(() => (l("rootClassName", t), () => c(t)), [t]), m("div", { className: j("ff-container", e), style: s, children: i }); -}, yt = (t) => ({ children: e, className: i }) => { - const { mount: r, unmount: n } = S.useContext(ht); - return q(() => (e && r(t, S.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, i) }, e)), () => n(t)), [i, e]), null; -}; -te.Action = yt("actions"), te.Title = yt("title"), te.SubTitle = yt("sub-title"), te.Extra = yt("extras"), te.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; -const To = () => m(te, { className: "ff-loading", children: L("div", { className: "loader", children: [L("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), L("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), L("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), L("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] })] }) }), Oo = () => m("div", { children: "NotFound" }), Wi = ({ children: t }) => { - const [e, i] = I({}), r = H((o, a) => i((s) => ({ ...s, [o]: a })), []), n = H((o) => i((a) => ({ ...a, [o]: void 0 })), []); - return typeof (t == null ? void 0 : t.type) == "string" ? t : m(ht.Provider, { value: { ele: e, mount: r, unmount: n }, children: S.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); -}; -Wi.propTypes = { children: b.element.isRequired }; -const $i = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, ti = ({ type: t, props: e }) => m("i", { ...e, children: m("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: ($i[t] || $i.info).map((i, r) => m("path", { d: i }, r)) }) }), Ui = ({ className: t, content: e, icon: i, $close: r }) => L(S.Fragment, { children: [i && m("div", { className: j("ff-notification-icon", t), children: m(ti, { type: i }) }), e] }), tn = ({}) => m(te, { children: "Confirm" }); -var Oe, He; -const fe = class fe { - constructor() { - v(this, He, /* @__PURE__ */ new Map()); - O(this, "init", (e) => K(this, He, new Map(e))); - O(this, "check", (e) => !d(this, He).has(e) || d(this, He).get(e)); - if (d(fe, Oe)) return d(fe, Oe); - } -}; -Oe = new WeakMap(), He = new WeakMap(), v(fe, Oe, null), O(fe, "getInstance", () => (d(fe, Oe) || K(fe, Oe, new fe()), d(fe, Oe))); -let Ut = fe; -const qi = Ut.getInstance(), rn = (t, e, i = "children") => { - if (f.isEmpty(t)) return {}; - const r = f.find(t, ["value", e]); - if (!f.isEmpty(r)) return r; - const n = t.length; - for (let o = 0; o < n; o++) { - const { [i]: a } = t[o], s = rn(a, e, i); - if (!f.isEmpty(s)) return s; - } - return {}; -}, Ki = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; -var Re, nt; -const ye = class ye { - constructor() { - v(this, nt, null); - O(this, "init", (e) => K(this, nt, e)); - O(this, "get", (e, i) => f.get(d(this, nt), e, i)); - if (d(ye, Re)) return d(ye, Re); - } -}; -Re = new WeakMap(), nt = new WeakMap(), v(ye, Re, null), O(ye, "getInstance", () => (d(ye, Re) || K(ye, Re, new ye()), d(ye, Re))); -let qt = ye; -const qe = qt.getInstance(); -var Ge, Et, ot, at, $t; -const Te = class Te { - constructor(...e) { - v(this, ot, []); - v(this, at, (e) => { - var i; - for (let r of e) Array.isArray(r[0]) ? d(this, at).call(this, r) : d(this, ot).push(d(i = Te, Et).call(i, r[0], r[1])); - }); - O(this, "toValue", async (e, i = null) => { - const r = { getValue: () => e, getRecord: () => i }; - let n = e; - for (const o of d(this, ot)) try { - const a = await o; - if (typeof a != "function") { - console.warn("middleware is not a function, skip:", a); - continue; - } - n = await a.call(r, n); - } catch (a) { - console.error("middleware error, skip:", a); - } - return n; - }); - O(this, "toRender", (e, i, r = null) => S.createElement(d(this, $t), { value: e, record: i }, r)); - v(this, $t, ({ value: e, record: i, children: r }) => { - const [n, o] = I(r), a = Ir(); - return ei(() => { - o(r), this.toValue(e, i).then((s) => a() && o(s)).catch((s) => a() && o(`${s}`)); - }, [e, i]), n; - }); - d(this, at).call(this, e); - } -}; -Ge = new WeakMap(), Et = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), $t = new WeakMap(), v(Te, Ge, null), v(Te, Et, f.memoize((e, i) => { - if (typeof e == "function") return e(i); - if (typeof e == "string") return le.getWidgetComponent(e).then((r) => { - var n; - return ((n = r.default) == null ? void 0 : n.call(r, i)) || ((o) => o); - }); - throw new TypeError("middleware must be a string or a function"); -}, (...e) => { - var i; - return d(Te, Ge) || K(Te, Ge, Rn()), d(i = Te, Ge).call(i, ...e); -})); -let kt = Te; -const ce = S.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { -}, getSelectedRows: () => [], onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -}, reload: () => { -}, setPage: () => { -}, setPageSize: () => { -}, setTab: () => { -}, setSider: () => { -}, setKeyword: () => { -}, setCondition: () => { -} }), xi = ({ className: t, record: e, column: i, ...r }) => { - if (i != null && i.editableByJs && (i != null && i.uuid)) { - const { formSetting: n = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (i == null ? void 0 : i.editableByJsSetting) || {}; - return m(R.Popover, { widget: Ji, widgetData: { record: e, column: i }, widgetSetting: { widgetSetting: o, formSetting: n }, widgetContainerProps: { title: i != null && i.title ? `${i.title} - 编辑` : "编辑", ...a, width: (a == null ? void 0 : a.width) || 260, arrow: !0 }, children: m("td", { className: j("ff-data-list-cell-editable", t), ...r }) }); - } - return m("td", { className: t, ...r }); -}, Ji = ({ record: t, column: e, $close: i, $setting: r }) => { - const n = _(Tn(f.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = he(ce), [s] = ae.useForm(), { formSetting: l, widgetSetting: c } = r, { primaryKey: u = "id", help: p, validators: h } = l || {}, g = () => { - s.setFieldsValue({ value: f.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); - }; - return Ot(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), m(te, { actions: L(S.Fragment, { children: [m(R, { size: "small", onClick: g, children: "重置" }), L(Bt.Compact, { block: !0, children: [m(R, { size: "small", widget: i, children: "取消" }), m(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: y }) => { - const w = f.get(t, u.substring(u.indexOf(".") + 1)); - if (!w) throw "获取更新主键失败!"; - z.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${w}`, { value: y }).msg(() => a(2, t)).then(i); - }).catch(console.warn), children: "保存" })] })] }), children: L(ae, { form: s, children: [m(ni, { label: "", code: "value", type: n.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: h }), m(Zt, { noStyle: !0, name: ["__PROPS__"], children: () => { - } })] }) }); -}; -Ji.displayName = "DataListCellEditableContainer"; -const nn = (t) => function(e) { - return t(e, getRecord()); -}, on = async ({ widgetByJs: t, widgetByJsSetting: e }) => { - const i = await le.getWidgetComponent(t).then((r) => r.default || ((n) => n)); - return function(r) { - return m(i, { value: r, $setting: e }); - }; -}, an = (t, e = {}) => U(() => { - var i; - return (i = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : i.map(({ widgetByJs: r, widgetByJsSetting: n, middlewares: o, ...a }, s) => { - const l = (c) => ({ record: c, column: a }); - return o || (o = []), r && o.push([on, { widgetByJs: r, widgetByJsSetting: n }]), o.length > 0 ? (a != null && a.render && o.push([nn, a.render]), { ...a, onCell: l, render: (c, u) => new kt(o).toRender(c, u, "-") }) : { ...a, onCell: l }; - }); -}, [t, e]), sn = (t = {}) => U(() => { - var e; - return t.body ?? (t.body = { cell: xi }), (e = t.body).cell ?? (e.cell = xi), t; -}, [t]), Ro = (t) => { - const [e, i] = I({}); - return q(() => { - let r = !1; - return t && z.get(`/api/_/${t}`).then((n) => f.pick(n, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((n) => !r && i(n)), () => r = !0; - }, [t]), e; -}, Fo = (t, e = {}) => { - const [i, r] = I({ dataSource: [] }); - return mt(() => { - let n = !1; - return t && z.get(`/api/${t}/${z.encode({ page: 1, ...e })}`).then((o) => !n && r(o)), () => n = !0; - }, [t, e]), i; -}, _i = (t = [], e = /* @__PURE__ */ new Map(), i = "id", r) => { - const n = H(r ? (o) => f.get(o, i, f.get(o, [r, i])) : (o) => f.get(o, i), [i, r]); - return H((o) => t == null ? void 0 : t.filter((a) => !a.uuid || !e.has(a.uuid) || e.get(a.uuid).some((s) => s == n(o))), [t, e, n]); -}, Kt = (t = [], e = /* @__PURE__ */ new Map(), i = [], r = "id", n) => { - const o = H(n ? (a) => f.get(a, r, f.get(a, [n, r])) : (a) => f.get(a, r), [r, n]); - return U(() => { - if (f.isEmpty(t) || !t.some(({ uuid: s }) => qi.check(s))) return !1; - if (f.isEmpty(e) || f.isEmpty(i)) return !0; - const a = i.map((s) => o(s)); - return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((c) => c == l))); - }, [t, i, e, o]); -}, ln = (t, e, i = "id", r = null) => { - const n = Tt(), o = _(!1), a = _(t.dataSource), s = _(t.itemOperationsAccess); - return q(() => (a.current = t.dataSource, s.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = a.current, t.itemOperationsAccess = s.current), [t, (l = 0, c = null) => { - var u, p; - if (o.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); - if (l === 2) { - const h = f.get(c, "__PARENT_ID__", ""), g = f.get(c, i, f.get(c, [r, i], "")), y = f.findIndex(a.current, ["__PARENT_ID__", h]), w = f.findIndex(y > -1 ? f.get(a.current, [y, "children"]) : a.current, [i, g]); - if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t); - Promise.all([z.get(`/api/${e}/detail/${g}`), z.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([E, C]) => { - const x = f.get(a.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]); - a.current = Di(a.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...E, children: x }]] } } } : { $splice: [[w, 1, { ...E, children: x }]] }); - const k = new Map(C); - s.current.forEach(($, F) => { - var A; - (A = k.get(F)) != null && A.some((T) => T == g) || s.current.set(F, $.filter((T) => T !== g)); - }), k.forEach(($, F) => { - s.current.has(F) ? s.current.set(F, f.uniq([...s.current.get(F) || [], ...$])) : s.current.set(F, $); - }); - }).then(() => { - o.current = !0, n(); - }); - } - }]; -}, cn = (t, e) => { - const i = Tt(), r = _(e), n = _(/* @__PURE__ */ new Map()), o = _([]), a = f.throttle((l) => { - o.current = [], z.list(t, f.pick({ ...r.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: h, sider: g, page: y, pageSize: w, operationsAccess: E, dataSource: C }) => { - r.current = { tab: h, condition: u, sider: g, keyword: c, total: p, pageSize: w, page: C != null && C.length ? y : 1 }, o.current = C, n.current = new Map(E), i(); - }); - }, 380, { leading: !1, trailing: !0 }); - Ot(() => { - o.current = [], t && a(e); - }, [t, e]); - const s = U(() => f.pick(r.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [r.current]); - return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, c) => a({ page: l, pageSize: c }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, c) => a({ keyword: c, condition: Di(r.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => a({ sider: l, page: 1 }), onKeywordChange: (l) => a({ keyword: l, page: 1 }), itemOperationsAccess: n.current, dataSource: o.current, onReload: a, payload: e == null ? void 0 : e.payload }); -}, dn = ({ listCode: t, className: e, layouts: i = {}, dataSource: r, isPaginate: n, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: h, itemGridLayout: g, $setting: y, tabs: w, isConditionFormLayout: E, isTreeSider: C, treeSiderConfig: x, rowSelection: k }) => { - const { classNames: $, onClickCallback: F } = he(ce), A = f.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = y == null ? void 0 : y.isMarkSelected, N = _i(l, c, p, u), V = H((P, M, D) => m(un, { isMarkSelected: T, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? N(M) : [], data: u ? { [u]: M } : M, children: P, onClickCallback: F }), [T, u, p, o, F, l, c]); - return L("div", { className: j("ff-data-list-framework", e), children: [m(i.sider, { isTreeSider: C, ...x }), L("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [m(i.filter, { isConditionFormLayout: E }), m(i.toolbar, { title: h, tabs: w }), m(xn, { ...A, ...g, rowSelection: k, empty: m(i.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: V, dataSource: r }), m(i.footer, { isPaginate: n, isOperations: a, operations: s })] })] }); -}, un = ({ className: t, operations: e, children: i, data: r, onClickCallback: n, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => L("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [m("div", { className: "data-list-grid-layout-item-container", children: i }), !!(e != null && e.length) && m("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => m("span", { className: "data-list-grid-layout-item-action", children: m(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: r, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (n == null ? void 0 : n(c.isRefresh, r)) }, c.uuid || Dt()) }, (c == null ? void 0 : c.uuid) || Dt())) })] }), pn = ({ listCode: t, className: e, layouts: i = {}, dataSource: r, columns: n, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: h, tabs: g, isPaginate: y, rowSelection: w, isTreeSider: E, treeSiderConfig: C, isConditionFormLayout: x, ...k }) => { - const { classNames: $, onClickCallback: F } = he(ce), A = _i(l, c, p, u), T = Kt(l, c, r, p, u); - return L("div", { className: j("ff-data-table-framework", e), children: [m(i.sider, { isTreeSider: E, ...C }), L("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [m(i.filter, { isConditionFormLayout: x }), m(i.toolbar, { title: h, tabs: g }), m(bn, { ...k, primaryKey: p, className: "ff-data-table-content", columns: n, dataSource: r, rowSelection: w, operationRender: T ? (N) => { - var V; - return m("div", { className: "ff-data-table-actions", children: (V = A(N)) == null ? void 0 : V.map((P, M) => m(R.Link, { size: "small", uuid: P.uuid, type: P.type, name: P.name, widget: P.widget, widgetType: P.widgetType, widgetProps: P.widgetProps, widgetData: P.widgetData, widgetSetting: P.widgetSetting, widgetContainerProps: P.widgetContainerSetting, data: N, confirm: P.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(P.isRefresh, N)) }, P.uuid || M)) }); - } : null }), m(i.footer, { isPaginate: y, isOperations: a, operations: s })] })] }); -}, ii = (t = [], e, i = null) => { - var r; - return (r = f.sortBy(t, ["y", "x"])) == null ? void 0 : r.map(({ i: n, x: o, y: a, w: s, h: l, field: { boxStyle: c, ...u } = {} }, p) => m("div", { className: "grid-layout-item", style: Hi(o, a, s, l, c), children: m(e, { ...u, basicForm: i }) }, n ?? p)); -}, Hi = (t, e, i, r, n = {}, o = 0) => { - const a = { "--grid-layout-h": `${r}`, "--grid-layout-w": `${i}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; - return n != null && n.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${r}`, n != null && n.alignItems && (a["--grid-layout-box-align-items"] = n.alignItems), n != null && n.justifyContent && (a["--grid-layout-box-justify-content"] = n.justifyContent), a["--grid-layout-box-margin"] = vi(n == null ? void 0 : n.marginTop, n == null ? void 0 : n.marginRight, n == null ? void 0 : n.marginBottom, n == null ? void 0 : n.marginLeft), a["--grid-layout-box-padding"] = vi(n == null ? void 0 : n.paddingTop, n == null ? void 0 : n.paddingRight, n == null ? void 0 : n.paddingBottom, n == null ? void 0 : n.paddingLeft), o && (a.height = `${o}px`), a; -}, vi = (t, e, i, r) => `${t || 0}px ${e || 0}px ${i || 0}px ${r || 0}px`, jo = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Gi = (t) => Object.keys(t).reduce((e, i) => (/^on[A-Z]/.test(i) && (e[i] = t[i]), e), {}), Yi = ({ className: t, isConditionFormLayout: e }) => { - var h, g; - const [i, r] = I({}), { listCode: n, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = S.useContext(ce), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = wt.useForm(); - return q(() => { - n && e && z.get(`/api/_/${n}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: E, rowHeight: C, cols: x, fields: k }) => { - r({ resource: y, itemMargin: [w, E], rowHeight: C, cols: x, fields: k }); - }).catch(() => r({})); - }, [n, e]), q(() => { - p.setFieldsValue({ keyword: c, ...u }); - }, [JSON.stringify([c, u])]), m("div", { className: j("ff-data-list-filter", l.filter, t), children: m(wt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((h = i.fields) == null ? void 0 : h.length) > 1 ? (y) => a({ [i.resource]: y[i.resource] }, y.keyword) : () => { - }, onValuesChange: (y) => { - f.isEmpty(f.omit(y, ["keyword"])) || p.submit(); - }, children: ((g = i.fields) == null ? void 0 : g.length) > 1 ? m(oi, { ...i, children: m(gn, { onReset: () => { - const { keyword: y, condition: w } = s("init") || {}; - p.setFieldsValue({ keyword: y, ...w }); - } }) }) : m("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: m("div", { className: "grid-layout-item", style: Hi(20, 0, 5, 2), children: m(wt.Item, { name: ["keyword"], children: m(Dr.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => o(y) }) }) }) }) }) }); -}, gn = ({ cols: t, fields: e, onReset: i }) => { - const [r, n] = I(!1), o = U(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]); - return L(wt.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: r }), children: [m(Ct, { onClick: i, children: "重置" }), m(Ct, { type: "primary", htmlType: "submit", children: "查询" }), o && m(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => n((a) => !a), type: "primary", name: r ? "关闭" : "展开", icon: r ? "icon-up" : "icon-down", iconPosition: "end" })] }); -}; -Yi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; -const hn = ({ className: t, operations: e, isOperations: i, isPaginate: r }) => { - const { onPageChange: n, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = S.useContext(ce), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; - return i && !f.isEmpty(e) || r ? L("div", { className: j("ff-data-list-footer", t), children: [m("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, h) => m(R, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || h)) }), r && m(zr, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: n, onShowSizeChange: o })] }) : null; -}, mn = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: m("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], fn = ({ className: t, width: e = 280, isTreeSider: i }) => { - const { classNames: r } = he(ce); - return i ? m(Br.DirectoryTree, { className: j("ff-data-list-sider", r.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: mn }) : null; -}, yn = ({ className: t, title: e, tabs: i }) => { - const { getBase62params: r, onTabChange: n, onReload: o, classNames: a } = he(ce), { tab: s } = (r == null ? void 0 : r()) || {}, [l, c] = _r((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: n }); - return L("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [m("div", { className: "ff-data-list-title", children: e }), m(Wr, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: h }) => m("span", { onClick: () => c(h ?? p), className: j("ff-data-list-tab", { active: (h ?? p) == l }), children: u }), items: i }), L("div", { className: "ff-data-list-actions", children: [m(R.Link, { icon: "icon-reload", widget: () => o() }), m(R.Link, { icon: "icon-setting" })] })] }); -}, wn = ({ className: t, ...e }) => m(Wt, { className: j(t, "ff-data-list-empty"), image: Wt.PRESENTED_IMAGE_SIMPLE, ...e }), Xi = ({ isItemGridLayout: t, theme: e, themeProps: i, onClickCallback: r, onReload: n, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: h, keyword: g, onKeywordChange: y, condition: w, onConditionChange: E, sider: C, onSiderChange: x, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: A = [], rowSelection: T, getSelectedRows: N, primaryKey: V, ...P }) => { - const [M, D] = I(), B = N ?? (() => A), X = H((W, de) => { - const G = { tab: p, page: s, pageSize: c, keyword: g, sider: C, condition: w, total: a, payload: F }; - return W && W != "init" ? f.get(G, W, de) : G; - }, [JSON.stringify(w), JSON.stringify(F), p, s, c, g, C, a]), se = U(() => { - let W = { sider: fn, filter: Yi, footer: hn, toolbar: yn, empty: wn }; - k === !1 ? W = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : f.isPlainObject(k) && (W = Object.assign({}, W, k)); - for (const de in W) if (W[de]) { - if (Fr(W[de])) { - const G = W[de]; - W[de] = (Ft) => S.cloneElement(G, Ft); - } - } else W[de] = () => m(S.Fragment, {}); - return W; - }, [k]); - return q(() => { - e ? le.getWidgetComponent(e).then((W) => { - if (!W) throw `${e} not found`; - return W; - }).catch((W) => ({ default: () => `${W}` })).then((W) => D(S.createElement(W.default, { ...P, layouts: se, $setting: i }))) : D(m(t ? dn : pn, { ...P, layouts: se, $setting: i })); - }, [e, i]), m(ce.Provider, { value: { classNames: $, listCode: o, onClickCallback: r, onReload: n, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: h, onSiderChange: x, onKeywordChange: y, onConditionChange: E, setPage: l, setPageSize: u, setTab: h, setSider: x, setKeyword: y, setCondition: E, getSelectedRows: B }, children: M && S.cloneElement(M, { dataSource: A, primaryKey: V, rowSelection: T, ...P }) }); -}; -Xi.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string, empty: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]), empty: b.oneOfType([b.elementType, b.element]) }), b.bool]) }; -var Fe, ve, We, xt; -const we = class we { - constructor() { - v(this, ve, null); - v(this, We, /* @__PURE__ */ new Map()); - v(this, xt, () => { - if (d(this, ve)) return d(this, ve).port.postMessage({ command: "status", data: [] }); - K(this, ve, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), d(this, ve).port.onmessage = (e) => { - var i, r; - (i = e.data) != null && i.uuid ? d(this, We).forEach((n, o) => { - var a; - (n == "*" || (a = n == null ? void 0 : n.includes) != null && a.call(n, e.data.uuid)) && o(e.data); - }) : ((r = e.data) == null ? void 0 : r.readyState) == WebSocket.CLOSED && z.get("/api/user-api-token").then(({ token: n, expire_at: o }) => { - d(this, ve).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(z.appUrl, "http")}api/user-resource-status-ws?token=${n}`] }); - }); - }, d(this, ve).port.postMessage({ command: "status", data: [] }); - }); - O(this, "subscribe", (e, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", d(this, We).set(e, i), d(this, We).size == 1 && d(this, xt).call(this), () => this.unsubscribe(e))); - O(this, "unsubscribe", (e) => d(this, We).delete(e)); - if (d(we, Fe)) return d(we, Fe); - } -}; -Fe = new WeakMap(), ve = new WeakMap(), We = new WeakMap(), xt = new WeakMap(), v(we, Fe, null), O(we, "getInstance", () => (d(we, Fe) || K(we, Fe, new we()), d(we, Fe))); -let Jt = we; -const Qi = Jt.getInstance(), ri = S.forwardRef(({ listCode: t, base62params: e, className: i, theme: r, themeProps: n, layouts: o, classNames: a, onSelectionChange: s, defaultSelectedRowKeys: l, selectedRowKeys: c, onDataSourceChange: u }, p) => { - const [{ resource: h, primaryKey: g, batchOperations: y = [], itemOperations: w = [], columns: E = [], isConditionFormLayout: C = !1, isTreeSider: x, treeSiderConfig: k, theme: $, themeConfig: F, isItemGridLayout: A, itemGridLayout: { themeConfig: T, ...N } = {}, title: V, isPaginate: P, tabs: M, selectionType: D }, B] = I({ isItemGridLayout: !1, itemGridLayout: {} }), X = cn(t, e), [{ dataSource: se, itemOperationsAccess: W, condition: de, tab: G, keyword: Ft, page: ci, total: di, pageSize: ui, sider: gr, onConditionChange: hr, onTabChange: mr, onKeywordChange: fr, onPageChange: yr, onPageSizeChange: wr, onSiderChange: br, onReload: jt, payload: Cr }, pi] = ln(X, t, g, h), kr = ki(u); - Mi(() => { - kr(se, { page: ci, pageSize: ui, total: di }); - }, [se]); - const [gi, Sr] = Vr([], { defaultValue: l ?? [], value: c }), [hi, Er] = I([]), mi = H(() => D ? hi : se, [D, hi, se]), $r = Kt(w, W, se, g), xr = Kt(y); - q(() => { - let Q = null; - return t && z.get(`/api/_/${t}`).resp(({ data: Ve, res: At }) => { - Ve != null && Ve.isDynamicRefresh && (Q = Qi.subscribe(() => jt(), At)), B(Ve); - }).catch(() => B({})), () => Q == null ? void 0 : Q(); - }, [t]), S.useImperativeHandle(p, () => ({ onReload: jt, onClickCallback: pi, getSelectedRows: mi })); - const fi = ki((Q, Ve) => { - Er((At) => { - const yi = new Map(At.map((ue) => [ue == null ? void 0 : ue[g], ue])); - return Ve.forEach((ue) => yi.set(ue == null ? void 0 : ue[g], ue)), Q.map((ue) => yi.get(ue)).filter(Boolean); - }), Sr(Q), s == null || s(Q, Ve); - }), vr = U(() => D ? { type: D, columnWidth: 80, selectedRowKeys: gi, onChange: fi } : void 0, [D, gi, fi]), Pr = U(() => f.merge({}, F, n), [F, n]), Nr = U(() => w == null ? void 0 : w.map((Q) => f.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [w]), Tr = U(() => ({ ...N, themeProps: T }), [N, T]); - return m(Xi, { listCode: t, title: V, classNames: a, layouts: o, resource: h, primaryKey: g, theme: r || $, themeProps: Pr, isTreeSider: x, treeSiderConfig: k, isPaginate: P, rowSelection: vr, getSelectedRows: mi, tabs: M, isItemOperations: $r, itemOperations: Nr, isBatchOperations: xr, batchOperations: y, isItemGridLayout: A, columns: E, itemGridLayout: Tr, isConditionFormLayout: C, itemOperationsAccess: W, dataSource: se, onConditionChange: hr, onTabChange: mr, onKeywordChange: fr, onPageChange: yr, onPageSizeChange: wr, onSiderChange: br, condition: de, tab: G, keyword: Ft, page: ci, total: di, pageSize: ui, sider: gr, payload: Cr, className: j("ff-data-list-helper", i), onReload: jt, onClickCallback: pi }); -}), Zi = (t, e, i = !0) => i !== !0 && i-- <= 0 ? [] : f.isArray(t) && !f.isEmpty(t) ? t.reduce((r, n) => (Reflect.has(n, e) && Reflect.has(n, "children") && r.push(n[e]), Reflect.has(n, "children") && !f.isEmpty(n.children) ? r.concat(Zi(n.children, e, i)) : r), []) : [], bn = ({ className: t, primaryKey: e, columns: i = [], dataSource: r = [], operationRender: n, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { - const { classNames: c } = he(ce), u = _(null), p = _(null), [h, g] = I([]), [y, w] = I({ width: 0, height: 0 }); - q(() => { - g(Zi(r, e)); - }, [r, e]), jr(() => { - const k = new ResizeObserver(() => { - var $; - w({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); - }); - return p.current && k.observe(p.current), () => { - p.current && k.unobserve(p.current); - }; - }, []); - const E = U(() => { - if (!(y != null && y.width) || !(i != null && i.length)) return i; - const k = (s ? s.columnWidth ?? 32 : 0) + (n ? o : 0), $ = i.reduce((T, N) => T + (N != null && N.isWidthFixed && N.width ? N.width : 0), 0), F = i.filter((T) => !(T != null && T.isWidthFixed)).reduce((T, N) => T + ((N == null ? void 0 : N.width) ?? 100), 0); - if ($ + F + k >= y.width) return i; - const A = y.width - $ - k; - return i.map((T) => T != null && T.isWidthFixed ? T : { ...T, width: Math.floor(A * ((T == null ? void 0 : T.width) ?? 100) / F) }); - }, [i, y.width, s, n, o]), C = an(E), x = sn(a); - return m("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: y.height ? m(Si, { bordered: !0, ...l, components: x, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { - var $, F; - const k = [...C ?? []]; - return s && k.splice((F = ($ = k[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, Si.SELECTION_COLUMN), n && k.push({ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(o / y.width * 100).toFixed(2)}%`, render: (A, T, N) => n(T, N) }), k; - })(), dataSource: r, size: "middle", scroll: { x: "max-content", y: y.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: h } }) : null }); -}, Cn = "RC_FORM_INTERNAL_HOOKS", kn = (t) => { - const [e, i] = S.useState({ items: [] }); - return q(() => { - t && z.get(`/api/_/${t}`).then(({ uuid: r, code: n, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, fields: h, theme: g, themeSetting: y, groups: w }) => ({ uuid: r, code: n, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: y, groups: w, items: h })).then(i); - }, [t]), e; -}, Sn = (t, { initialValue: e, initialValueLanguage: i, convertJs: r, convertJsSetting: n, type: o = "string" }, a = null) => { - const s = _(!1), l = he(Li), [c, u] = I(), [p, h] = I(i != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(Cn) || {}; - return q(() => g == null ? void 0 : g((y, w, E) => { - if (!s.current) return; - const C = f.get(w, t); - f.isEqual(C, p) || h(ge(C, o)); - }), [p]), q(() => { - i == "javascript" && e ? Me.exec(e, {}, { getFieldValueForBasicForm: (y) => a ? a.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => h(ge(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && h(ge(e ?? l.getFieldValue(t), o)), s.current = !0); - }, [e, i]), mt(() => { - s.current && r && new kt([r, n]).toValue(p, l.getFieldsValue(!0)).then(u).catch((y) => { - u(y), console.error("布局数据转换错误: ", y, r); - }); - }, [p, r, n]), [c ?? p, p]; -}, Ao = (t, e, i = null) => U(() => ii(t, e, i), [t]), er = (t, e, i = {}, r = {}, n = {}, o = null) => { - const a = he(Li), s = Tt(), l = _(!0), c = _([]), [u, p] = I(e), [h, g] = I(), y = ae.useWatch((w) => JSON.stringify(f.pick(w, c.current)), a) || "{}"; - return Ot(() => { - t && Me.exec(t, i, { ...r, getFieldValueForBasicForm: (w) => n ? n.getFieldValue(w) : null, getFieldValue: f.wrap(a.getFieldValue, (w, E) => (c.current.some((C) => f.isEqual(C, E)) || (c.current.push(E), s()), w == null ? void 0 : w(E))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((w) => { - l.current && (p(w), g(null)); - }).catch((w) => { - l.current && (p(e), g(w)); - }); - }, [t, y, a, i, r]), q(() => () => l.current = !1, []), t ? [o ? ge(u, o) : u, h] : [o ? ge(e, o) : e, null]; -}, En = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: i, ...r }) => { - const n = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = I(); - return q(() => { - n && le.getWidgetComponent(n).then(({ defaultProps: s = {}, default: l }) => ({ default: $n(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(S.createElement(s.default, r))); - }, [n]), o; -}, $n = (t, e = {}, i = null) => (r) => { - const { code: n, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: h, ...g } = f.merge({}, e, r), [y, w] = Sn(s ? null : n, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, i), E = U(() => { - const k = Object.keys((e == null ? void 0 : e.extras) || {}); - return f.over([f.partialRight(f.pick, k), f.partialRight(f.omit, k)]); - }, [e == null ? void 0 : e.extras]), [C, x] = E(g); - return m(t, { ...x, value: y, rawValue: w, $setting: Object.assign({}, a, C) }); -}, tr = ({ theme: t, basicForm: e, items: i = [{ key: "default", label: "默认" }], fields: r = [], itemRender: n, chunks: o = [], children: a, $setting: s = {}, ...l }) => { - const [c, u] = I(); - q(() => { - t ? le.getWidgetComponent(t).then((h) => { - if (!(h != null && h.default)) throw "not found"; - return h; - }).catch((h) => ({ default: () => `${t} ${h}` })).then((h) => u(S.createElement(h.default, {}))) : u(null); - }, [t]); - const p = U(() => i == null ? void 0 : i.map((h) => ({ ...h, children: n(h, r == null ? void 0 : r.filter((g) => !(g != null && g.group) && h.key == "default" || g.group == h.key), h.key == "default" ? a : null) })).concat(o), [i, a, o]); - return c && S.cloneElement(c, { items: p, basicForm: e, $setting: { ...s, ...l } }); -}, ir = ({ name: t, form: e = null, basicForm: i = null, style: r = {}, className: n, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: h, theme: g, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: E, ...C }) => { - const [x] = ae.useForm(e), k = U(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); - mt(() => (x.setFieldsValue(h), () => x.resetFields()), [h]); - const $ = (F, A, T) => { - const N = ii(A, En, i), V = Gi(C); - return L("div", { ...V, className: j("ff-grid-layout", n), style: { ...r, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [N, T && S.cloneElement(T, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: A, basicForm: i })] }); - }; - return m(ae, { ...C, fields: k, form: x, component: !1, children: g ? m(tr, { ...y, items: w, theme: g, itemRender: $, fields: p, children: E, basicForm: i }) : $(0, p, E) }); -}, Io = /* @__PURE__ */ ((t) => function({ code: e, data: i, ...r }) { - const { uuid: n, resource: o, items: a, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: h, themeProps: g, groups: y } = kn(e) || {}, w = U(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: n }], [e, n, o]); - return o && m(t, { name: e, theme: h, themeProps: g, groups: y, ...r, fields: a, formFields: w, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: i } : i }); -})(ir), xn = ({ column: t = 0, colWidth: e = 0, cols: i, rowHeight: r, itemMargin: n, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: h = ($, F, A) => $, empty: g = m(Wt, { description: null }), className: y, style: w = {}, theme: E, themeProps: C = {}, groups: x = [{ key: "default", label: "默认" }], rowSelection: k }) => { - const { classNames: $ } = he(ce), F = H((N) => { - if (!k) return; - const { selectedRowKeys: V = [], onChange: P, type: M = "checkbox" } = k, D = N == null ? void 0 : N[s]; - let B; - B = M === "radio" ? [D] : V.includes(D) ? V.filter((X) => X !== D) : [...V, D], P == null || P(B, l.filter((X) => B.includes(X == null ? void 0 : X[s]))); - }, [k, s, l]), A = U(() => m(ir, { groups: x, theme: E, themeProps: C, cols: i, rowHeight: r, itemMargin: n, containerPadding: o, fields: a, className: p }), [a, i, r, n, o, x, E, C]), T = f.isEmpty(l); - return L("div", { className: j("ff-data-list-content", $.content, y), style: Object.assign({}, w, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), T ? g : l.map((N, V) => { - var B; - const P = (N == null ? void 0 : N[s]) ?? V, M = `${P}-${On(N)}`, D = h(S.cloneElement(A, { data: N }), N, V); - return S.cloneElement(D, { key: M, ...k && { isSelected: (B = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : B.includes(P), selectionType: k.type ?? "checkbox", onSelect: () => F(N) } }); - }), u == null ? void 0 : u(l)] }); -}, vn = ({ component: t, $props: e }) => { - const { base62params: i } = Nt(e, {}); - return m(te, { children: m(ri, { listCode: t, base62params: z.decode(i) }) }); -}, Lo = () => m(rr, {}), rr = () => "Empty", Pn = ({ component: t, $setting: e, $props: i }) => { - const [r, n] = I(), [o, a] = lr(i); - return q(() => { - if (!t) return n(m(rr, { description: null })); - le.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => S.createElement(s.default, { $setting: e })).then(n); - }, [t]), r ? S.cloneElement(r, { ...o, $setProps: a }) : null; -}, Mo = () => "NotFoundPage"; -var je, pe, Ae, ke, st, lt; -const be = class be { - constructor() { - v(this, pe, /* @__PURE__ */ new Map()); - v(this, Ae, {}); - v(this, ke, null); - O(this, "init", (e, i) => { - K(this, pe, e), K(this, Ae, i); - }); - O(this, "get", (e) => (d(this, pe).has(e) || (e = Array.from(d(this, pe).keys()).find((i) => d(this, pe).get(i).uri === e)), d(this, pe).get(e) || {})); - O(this, "redirect", (e, i, r = {}) => { - var y; - const { uri: n, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...c } = i || {}, u = Object.assign({}, c, s), p = Object.assign({}, c, l); - o == "list" && (u.base62params = z.encode(u != null && u.base62params ? u.base62params : u)); - let h = Hr(n || e, u); - const g = new URLSearchParams(); - for (const w in a || {}) ((y = a[w]) == null ? void 0 : y.type) == "query" && Object.has(p, w) && g.append(w, JSON.stringify(p[w])); - return g.size > 0 && (h = `${h}?${g.toString()}`), r != null && r.isOpenWindow ? window.open(h) : d(this, ke).navigate(h, { replace: !!(r != null && r.isReplaceRouteHistory) }); - }); - O(this, "getMenus", (e) => { - var i; - return ((i = d(this, Ae)) == null ? void 0 : i[e]) || []; - }); - O(this, "findMenuPathByUuid", (e) => { - let i = []; - for (const r in d(this, Ae)) if (i = d(this, st).call(this, d(this, Ae)[r], e, [r]), i.length > 1) return i; - return i; - }); - O(this, "getMenusByRouteUuid", (e) => d(this, lt).call(this, e, Object.values(d(this, Ae)).flat())); - v(this, st, (e, i, r = []) => { - if (f.isEmpty(e)) return r; - for (const { uuid: n, children: o } of e) { - if (n == i) return r.concat(n); - if (!f.isEmpty(o)) return r.concat(n, d(this, st).call(this, o, i)); - } - return r; - }); - v(this, lt, (e, i) => { - var n; - let r = []; - for (const o of i) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? r.push(o) : (n = o.children) != null && n.length && (r = r.concat(d(this, lt).call(this, e, o.children)))); - return r; - }); - O(this, "getCurrentMenu", () => { - const { uuid: e } = this.getCurrentRoute() || {}; - if (!e) return; - const i = this.getMenusByRouteUuid(e); - return f.isEmpty(i) ? void 0 : i[0]; - }); - O(this, "getCurrentRoute", (e = 0) => { - var r; - const i = (r = d(this, ke).state.matches[d(this, ke).state.matches.length - 1 - e]) == null ? void 0 : r.route; - if (!i) return null; - for (let [n, o] of d(this, pe)) if (o.uri === i.path) return o; - return null; - }); - O(this, "getPageParams", (e) => { - var a, s; - const { location: i = {}, matches: r = [] } = ((a = d(this, ke)) == null ? void 0 : a.state) || {}, n = { ...((s = r[r.length - 1]) == null ? void 0 : s.params) || {} }, o = i.search; - return o && new URLSearchParams(o).forEach((l, c) => { - n[c] = l; - }), e ? f.get(n, e) : n; - }); - O(this, "usePageParams", (e) => { - var r; - let i = zi() ? { ...Gr(), ...Object.fromEntries(new URLSearchParams(((r = Yr()) == null ? void 0 : r.search) ?? "")) } : this.getPageParams(); - return e ? f.get(i, e) : i; - }); - O(this, "createBrowserRouter", (e = {}) => { - if (d(this, pe).size == 0) return null; - if (d(this, ke)) return d(this, ke); - const i = qe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), r = qe.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), n = { [i]: 0 }, o = (s, l) => () => Promise.all([le.getWidgetComponent(s), Nt(l)]).then(([c, u]) => [c.default || function() { - return `${s}`; - }, u]).then(([c, u]) => ({ Component: () => S.createElement(Wi, {}, S.createElement(c, { $setting: u })) })), a = Array.from(d(this, pe).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: h, widgetSetting: g, widgetProps: y, isLogin: w, isLayout: E, extra: C }) => { - let x = {}, k = 0; - switch (p) { - case "list": - x.element = S.createElement(vn, { component: h, $props: y }); - break; - case "fsdpf-component": - x.element = S.createElement(Pn, { key: h, component: h, $setting: g, $props: y }); - } - const $ = (C == null ? void 0 : C.theme) ?? (C == null ? void 0 : C.layout); - if ($) { - const F = (C == null ? void 0 : C.themeProps) ?? (C == null ? void 0 : C.layoutProps); - if (!n[$]) return n[$] = s.length, [...s, { path: "/", lazy: o($, F), children: [{ path: c, ...x }] }]; - k = n[$]; - } - return E && k > -1 ? (s[k].children.push({ path: c, ...x }), s) : [...s, { path: c, ...x }]; - }, [{ path: "/", lazy: o(i, {}), children: [] }]); - return a.push({ index: !0, element: S.createElement(Nn, { to: r, replace: !0 }) }), K(this, ke, Xr(a, e)); - }); - if (d(be, je)) return d(be, je); - } -}; -je = new WeakMap(), pe = new WeakMap(), Ae = new WeakMap(), ke = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), v(be, je, null), O(be, "getInstance", () => (d(be, je) || K(be, je, new be()), d(be, je))); -let _t = be; -const Nn = ({ to: t, replace: e }) => zi() ? S.createElement(Qr, { to: t, replace: e }) : (window.document.location = t, "redirect"), oe = _t.getInstance(), Ke = new Worker(new URL("/ff-worker/index.js", self.location)), Pi = { generateUUID: () => jn(), getConfigure: (t) => qe.get(t), route: { redirect: (...t) => oe.redirect(...t), getPageParams: (...t) => oe.getPageParams(...t), getCurrentRoute: () => oe.getCurrentRoute() }, popup: { notification: (...t) => ne.notification(...t), success: (...t) => ne.success(...t), error: (...t) => ne.error(...t), form: (...t) => ne.form(...t), modal: (...t) => ne.modal(...t), confirm: (...t) => ne.confirm(...t) } }; -var vt, Ye, Ie; -const J = class J { - constructor() { - O(this, "exec", (e, i = {}, r = {}, n = "") => new Promise((o, a) => { - if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return o(); - const s = Ci(J, vt)._++; - d(J, Ye).set(s, r), J.mQueue.set(s, [o, a]), Ke.postMessage({ id: s, session: n, category: "eval", method: e, args: i }); - })); - O(this, "clear", (e) => Ke.postMessage({ session: e, category: "clear" })); - if (d(J, Ie)) return d(J, Ie); - Promise.resolve().then(() => so).then((e) => { - Pi.http = e.http; - }), Ke.addEventListener("message", ({ data: { id: e, task_id: i, method: r, args: n, category: o, data: a, error: s, session: l } }) => { - if (o === "eval" && J.mQueue.has(e)) s !== null ? J.mQueue.get(e)[1](s) : J.mQueue.get(e)[0](a), d(J, Ye).delete(e), J.mQueue.delete(e); - else if (o === "util") try { - const c = f.get(Pi, r.split("/")) || f.get(d(J, Ye).get(i), r.split("/")); - if (!f.isFunction(c)) throw `${r} not found`; - Promise.resolve(Reflect.apply(c, void 0, n)).then((u) => { - Ke.postMessage({ id: e, task_id: i, category: o, method: r, args: n, session: l, data: u, error: null }); - }).catch((u) => { - Ke.postMessage({ id: e, task_id: i, category: o, method: r, args: n, session: l, data: null, error: u }); - }); - } catch (c) { - Ke.postMessage({ id: e, task_id: i, category: o, method: r, args: n, session: l, data: null, error: c }); - } - }, !1); - } -}; -vt = new WeakMap(), Ye = new WeakMap(), Ie = new WeakMap(), O(J, "mQueue", /* @__PURE__ */ new Map()), v(J, vt, 0), v(J, Ye, /* @__PURE__ */ new Map()), v(J, Ie, null), O(J, "getInstance", () => (d(J, Ie) || K(J, Ie, new J()), d(J, Ie))); -let Ht = J; -const Me = Ht.getInstance(), Ni = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { - switch (`${t}`.toLowerCase()) { - case "0": - case "false": - case "[]": - case "{}": - return !1; - } - return !!t; -}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, ge = (t, e) => { - let i = "string"; - i = Array.isArray(t) ? "array" : typeof t, f.isObject(t) && (i = "json"); - const r = `${i}2${e}`; - return Reflect.has(Ni, r) ? Ni[r](t) : t; -}, Tn = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, Nt = (t = {}, e = {}, i = {}, r = "") => nr(t, (n, o) => o === "type" && n === "code") ? or(t, e, i, r) : ar(t, e, r), nr = (t, e = () => !1) => f.some(t, (i) => !!f.some(i, e) || (f.isEmpty(i) || !f.isPlainObject(i) && !f.isArray(i) ? void 0 : nr(i, e))), or = async (t = {}, e = {}, i = {}, r = "") => { - let n = /* @__PURE__ */ Object.create(null); - for (let o in t) { - let a; - if (Reflect.has(t[o], "type") && ["code", "field", "router", "query", "string"].includes(t[o].type)) { - const { type: s, value: l = "", default: c = r } = t[o]; - switch (s) { - case "code": - try { - a = await Me.exec(l, e, i); - } catch (u) { - console.error("getWidgetPropsData", u); - } - break; - case "field": - a = f.get(e, l) ?? f.get(e, l.substring(l.indexOf(".") + 1)); - break; - case "router": - case "query": - a = oe.getPageParams(l); - break; - case "string": - a = l; - } - a ?? (a = c); - } else a = await or(t[o], e, i, r); - f.set(n, o, a); - } - return n; -}, ar = (t = {}, e = {}, i = "") => Object.keys(t || {}).reduce((r, n) => { - if (f.isPlainObject(t[n])) { - let o; - if (Reflect.has(t[n], "type") && ["field", "router", "query", "string"].includes(t[n].type)) { - const { type: a, value: s = "", default: l = i } = t[n]; - switch (a) { - case "field": - o = f.get(e, s) ?? f.get(e, s.substring(s.indexOf(".") + 1)); - break; - case "router": - case "query": - o = oe.getPageParams(s); - break; - case "string": - o = s; - } - o ?? (o = l); - } else o = ar(t[n], e, i); - f.set(r, n, o); - } - return r; -}, {}), Lt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((i) => Lt(i, e)) : Object.keys(t).reduce((i, r) => (e[r] ? i[e[r]] = Lt(t[r], e) : i[r] = Lt(t[r], e), i), {}) : t, Vo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { - const e = 16 * Math.random() | 0; - return (t === "x" ? e : 3 & e | 8).toString(16); -}), Do = (t) => { - var e, i; - return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.name : ""; -}, zo = (t) => { - var e, i; - return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.category : ""; -}, Bo = (t) => { - var e, i; - return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.owner : ""; -}, On = (t, e = 32, i = "auto") => { - const r = Gt(t), n = i === "auto" ? "x64" : i; - if (e === 32) return It.x86.hash32(r).toString(); - if (e === 128) return n === "x64" ? It.x64.hash128(r) : It.x86.hash128(r); - throw new Error("bits 只能是 32 或 128"); -}, Gt = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Gt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Gt(t[e])}`).join(",") + "}" : String(t), Rn = () => { - let t = 1; - const e = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Map(); - return (...r) => r.length === 0 ? "" : r.map((n) => { - return String((o = n) === null || typeof o != "object" && typeof o != "function" ? (i.has(o) || i.set(o, t++), i.get(o)) : (e.has(o) || e.set(o, t++), e.get(o))); - var o; - }).join("::"); -}, Fn = (t) => { - if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; - try { - let e = t.startsWith("//") ? `http:${t}` : t; - return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname; - } catch { - return !1; - } -}, Wo = (t, e = "") => { - if (!t || typeof t != "string" || Fn(t)) return t; - let i = e; - return !i && typeof window < "u" && window.location && (i = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? i ? `${i}${t}` : t : i ? `${i}/${t}` : t; -}, jn = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : typeof crypto < "u" && crypto.getRandomValues ? "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)) : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { - const e = 16 * Math.random() | 0; - return (t === "x" ? e : 3 & e | 8).toString(16); -}), Tt = () => { - const t = _(!0), [, e] = S.useReducer((i) => i + 1, 0); - return q(() => () => t.current = !1, []), () => t.current && e(); -}, Uo = (t) => { - const [e, i] = I(t), r = _(null), n = H((o, a) => { - r.current = a, i(o); - }, []); - return q(() => { - r.current && (r.current(e), r.current = null); - }, [e]), [e, n]; -}, mt = (t = (r) => { -}, e, i = f.isEqual) => { - const r = S.useRef(); - i(e, r.current) || (r.current = f.cloneDeep(e)), S.useEffect(t, [r.current]); -}, Ot = mt, sr = (t, e = "string") => { - var i; - if (!Array.isArray(t)) return t; - for (let r = 0; r < t.length; r++) t[r].value = ge((i = t[r]) == null ? void 0 : i.value, e), t[r] && Reflect.has(t[r], "children") && (t[r].children = sr(t[r].children, e)); - return t; -}, qo = (t, e = "json", i = "string", r, n = null) => { - const [o] = ae.useForm(r), [a, s] = I([{ label: "无", value: "", disabled: !0 }]), l = _([]), c = ae.useWatch((u) => l.current.length === 0 ? null : f.pick(u, l.current), o) || null; - return q(() => { - Array.isArray(t) ? s(t) : e === "javascript" && t ? Me.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), o.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), n ? n.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => { - s(ge(u, "array")); - }).catch((u) => console.error("useOptions", u)) : t && s(ge(t, "array")); - }, [t, e, c]), sr(a, i); -}, Ko = (t) => { - const [e, i] = I(), r = { type: "GET" }; - if (typeof t == "string" ? r.url = t : f.isPlainObject(t) && Object.assign(r, t), !(r != null && r.url)) throw "url is required"; - const n = (o) => z.request(r, !1).resp((a) => (console.log("useSubscribeRequest", o), i(a), a)); - return mt(() => { - let o = null; - return n().then((a) => { - o = Qi.subscribe(f.throttle(n, 180, { leading: !1, trailing: !0 }), a.res); - }), () => o == null ? void 0 : o(); - }, r), e; -}, An = (t, e) => H((i) => { - const r = {}; - for (const [n, o] of Object.entries(i)) { - const a = t == null ? void 0 : t[n]; - if ((a == null ? void 0 : a.type) === "router" || (a == null ? void 0 : a.type) === "query") { - const s = oe.getCurrentRoute(); - s != null && s.uuid && oe.redirect(s.uuid, { ...oe.getPageParams(), [a.type]: { [a.value || n]: o } }, { isReplaceRouteHistory: !0 }); - } else r[n] = o; - } - Object.keys(r).length > 0 && e(r); -}, [t, e]), lr = (t, e = {}, i = {}, r = []) => { - const [n, o] = I({}), [a, s] = I({}), l = Vi(a), c = oe.usePageParams(); - ei(() => { - Promise.resolve(Nt(t, e, i)).then(s); - }, [t, e, c, ...r]), Mi(() => { - const h = l ?? {}, g = Object.keys({ ...h, ...a }).reduce((y, w) => (h[w] !== a[w] && (y[w] = a[w]), y), {}); - Object.keys(g).length > 0 && o((y) => ({ ...y, ...g })); - }, [a]); - const u = An(t, (h) => { - o((g) => ({ ...g, ...h })); - }), p = U(() => Object.fromEntries(Object.entries(n).filter(([h, g]) => g !== a[h])), [n, a]); - return [n, u, p]; -}, In = (t) => { - const [e, i] = S.useState({ items: [], hides: [] }); - return S.useEffect(() => { - t && z.get(`/api/_/${t}`).then(({ pk: r, uuid: n, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: h, listenChangeFieldsFunc: g, fields: y, theme: w, themeSetting: E, groups: C }) => ({ pk: r, uuid: n, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: w, themeProps: E, groups: C, listenChangeFields: h, listenChangeFieldsFunc: g, ...y.reduce((x, k) => { - var $; - return ($ = k == null ? void 0 : k.field) != null && $.hidden ? x.hides.push(k == null ? void 0 : k.field) : x.items.push(k), x; - }, { items: [], hides: [] }) })).then(i); - }, [t]), e; -}, Ln = ({ max: t = 0, min: e = 0, type: i = "", message: r, pattern: n, required: o = !1, validator: a } = {}, s, l) => { - const [c, u] = I([]); - return q(() => { - const p = []; - if (o) { - let h = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - h = "boolean"; - break; - case "json": - h = "object"; - } - p.push({ type: h, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (i) { - case "string": - p.push({ type: i, max: t, min: e, message: r || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); - break; - case "pattern": - p.push({ type: "string", pattern: n, message: r }); - break; - case "validator": - a && p.push(({ getFieldValue: h }) => ({ validator: async (g, y) => { - const w = await Me.exec(a, { value: y, fieldName: s }, { getFieldValue: h }); - return f.isString(w) && w ? Promise.reject(w) : f.isBoolean(w) && !w ? Promise.reject(r) : Promise.resolve(); - } })); - } - u(p); - }, [t, e, i, r, n, o, a]), c; -}, Mn = (t, e, i) => { - const [r, n] = I(null); - return q(() => { - const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = i || {}; - e && z.request({ method: a, url: f.trimEnd(`${o}/${e}`, "/") }).then((s) => { - n(s); - }); - }, [t, e, i]), r; -}, Vn = (t, e, i) => H((r, n = { serialize: (o) => o, onSuccess: () => { -}, onFail: (o) => (o == null ? void 0 : o.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => { - const o = r.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = i || {}; - return r.validateFields().then((l) => o ? f.pick(l, [o]) : l).then(n.serialize).then((l) => z.request({ method: s, url: f.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(n.onSuccess)).catch(n.onFail); -}, [t, e, i]), Dn = (t, e, i, r) => { - const n = Mn(e, i, r); - q(() => { - n ? t.setFieldsValue(n) : t.resetFields(); - }, [t, n]); - const o = Vn(e, i, r); - return f.partial(o, t); -}, zn = (t, e, i = [], r = {}) => { - const n = _({}), o = _(), a = f.debounce(Tt(), 180), s = ["disabled", "required"], l = (h, g) => { - s.includes(h) && (n.current[h] = g), a(); - }, c = U(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => n.current.disabled, getRequired: () => n.current.required }), [e]), [u, p] = er(e, -1, {}, c, r); - if (!p && o.current != u && (u >= 0 || !f.isEmpty(i == null ? void 0 : i[u]))) { - o.current = u; - const { widget: h, widgetPrefix: g, props: y } = i == null ? void 0 : i[u]; - t = Ki(h, g), n.current = f.merge(y, f.pick(n.current, s)); - } - return [t, n.current]; -}, Ti = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Jo = ({ value: t, onChange: e }, i = null) => { - const r = _(), [n] = ae.useForm(i), o = _({}); - return Ot(() => { - f.isEqual(r.current, t) || n.setFieldsValue(t); - }, [t]), q(() => () => n.resetFields(), []), [U(() => n.__INTERNAL__ ? n : { ...n, __INTERNAL__: { itemRef: (a) => (s) => { - const l = Ti(a); - s ? o.current[l] = s : delete o.current[l]; - } }, scrollToField: (a, s = {}) => { - console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); - }, focusField: (a) => { - console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); - }, getFieldInstance: (a) => { - const s = Ti(a); - return o.current[s]; - } }, [n]), (a, s) => { - r.current = s, e == null || e(s); - }]; -}, ni = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: r = [], basicForm: n, ...o }) => { - const a = Ki(t, e), [s, l] = zn(a, i, r, n), [c, u] = I(); - return q(() => { - s && le.getWidgetComponent(s).then(({ defaultProps: p = {}, default: h }) => ({ default: Bn(h, p, n) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(S.createElement(p.default, o))); - }, [s]), c && S.cloneElement(c, { ...o, ...l }); -}, Bn = (t, e = {}, i = null) => (r) => { - const { type: n, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: h, help: g, isVirtual: y, $isReserved: w, initialValue: E, initialValueLanguage: C, ...x } = f.omit(f.merge({}, e, r), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Ln(Object.assign({}, h, u ? { required: !0 } : {}), o, n), $ = U(() => { - const V = Object.keys((e == null ? void 0 : e.extras) || {}); - return f.over([f.partialRight(f.pick, V), f.partialRight(f.omit, V)]); - }, [e == null ? void 0 : e.extras]), [F, A] = $(x), T = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, N = H((V) => V == null ? void 0 : ge(V, n), [n]); - return m(Zt, { name: o, rules: k, initialValue: N(E), normalize: N, children: (V, P, M) => { - var D; - return m(t, { type: n, rcform: M, basicForm: i, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...T }, fieldProps: { placeholder: c, ...A, ...V }, $setting: Object.assign({}, p, F) }); - } }); -}, oi = ({ name: t, form: e = null, basicForm: i = null, style: r = {}, className: n, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: h = {}, formFields: g = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: E, theme: C, themeProps: x = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { - const [A] = ae.useForm(e), T = H((P, M) => { - E == null || E(P, M), w && Array.isArray(y) && Me.exec(w, { changedValues: P, allValues: M }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); - }, [t, A, E, y, w]), N = U(() => [{ name: "__PROPS__", value: h }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, h, g]), V = (P, M, D) => { - const B = ii(M, ni, i), X = Gi(F); - return L("div", { ...X, className: j("ff-grid-layout-form", n), style: { ...r, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [B, D && S.cloneElement(D, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: M, basicForm: i })] }); - }; - return L(ae, { ...F, form: A, fields: N, onValuesChange: T, children: [C ? m(tr, { ...x, items: k, theme: C, itemRender: V, fields: c, children: $, basicForm: i }) : V(0, c, $), u == null ? void 0 : u.map((P) => { - var M; - return m(Zt, { name: P.code, children: m(Wn, { form: A, basicForm: i, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (M = P.extras) == null ? void 0 : M.initialValueLanguage }) }, JSON.stringify(P.code)); - })] }); -}, Wn = ({ type: t, initialValue: e, initialValueLanguage: i, onChange: r, basicForm: n }) => { - const [o, a] = er(i == "javascript" && e, i == "javascript" ? void 0 : e, {}, {}, n); - return q(() => { - i == "javascript" ? r(ge(o, t)) : e && r(ge(e, t)); - }, [t, e, o]), null; -}; -oi.propTypes = { fields: b.array, hides: b.array }; -const Un = /* @__PURE__ */ ((t) => ({ code: e, isPreview: i = !1, ...r }) => { - const { align: n, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: h, listenChangeFields: g, listenChangeFieldsFunc: y, pk: w, uuid: E, theme: C, themeProps: x, groups: k } = In(e), $ = U(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: E }], [w, e, E, a]); - return m(t, { name: e, autoComplete: o, theme: C, themeProps: x, groups: k, ...r, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: y, fields: s, hides: l, cols: h, rowHeight: c, itemMargin: [u, p] }); -})(oi), cr = ({ $setting: t, $close: e, extras: i, code: r, primaryKey: n, ...o }) => { - const [a] = ae.useForm(), s = Dn(a, r, n, t); - return m(te, { actions: L(S.Fragment, { children: [m(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), m(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: i, children: m(Un, { form: a, code: r, primaryKey: n, ...o }) }); -}, Oi = /* @__PURE__ */ new Set(), Yt = (t = [], e = 0) => { - const i = t[e]; - if (i.length && !Oi.has(i)) { - const r = document.createElement("script"); - r.setAttribute("src", i), r.setAttribute("data-namespace", i), t.length > e + 1 && (r.onload = () => { - Yt(t, e + 1); - }, r.onerror = () => { - Yt(t, e + 1); - }), Oi.add(i), document.body.appendChild(r); - } -}, St = ({ className: t, type: e, style: i = {}, ...r }) => m("span", { role: "img", className: j("ff-iconfont", t), style: i, ...r, children: m("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: m("use", { xlinkHref: `#${e}` }) }) }); -St.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, St.init = Yt; -const qn = (t, e, i, r) => oe.redirect(i, e, r), Kn = (t, e = {}, i, r = {}) => { - var o; - const n = (o = r.router) == null ? void 0 : o.reduce((a, [s, l, c]) => { - const u = f.get(e, ["router", s]); - if (!u && u !== 0 && l) throw `请传入 ${c}`; - return `${a}/${u}`; - }, `/api/${i}`); - return z.del(n, e.param).msg(); -}, Ri = (t, e, i, { status: { loading: r, disabled: n }, setStatus: o, listFn: a }) => { - const s = { loading: (l) => l === void 0 ? r : o((c) => ({ ...c, loading: l })), disabled: (l) => l === void 0 ? n : o((c) => ({ ...c, disabled: l })), list: a }; - return f.isFunction(i) ? i.call(null, e, s) : f.isString(i) && i ? Me.exec(i, e, s) : null; -}, Fi = (t, e, i, r, n) => f.isString(i) && i ? le.getWidgetComponent(i).then(({ default: o }) => ne.modal(o, { ...e, $setting: r }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n)).catch((o) => { - ne.error(i, { content: o.toString() }); -}) : ne.modal(i, { ...e, $setting: r }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n), Jn = (t, e, i, r, n) => ne.modal(cr, { ...e, $setting: r, code: i }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n), _n = (t, e, i, r, n) => ne.modal(ri, { base62params: e, $setting: r, listCode: i }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n), Hn = ({ widget: t, widgetType: e, widgetData: i, widgetProps: r, widgetSetting: n, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { - const l = he(ce), [c, u] = I({ leading: !0, trailing: !1 }), p = U(() => { - switch (e) { - case "redirect": - return f.partialRight(qn, t, n); - case "func": - return f.partialRight(Ri, (n == null ? void 0 : n.code) ?? t, { status: c, setStatus: u, listFn: l }); - case "component": - case "fsdpf-component": - return f.partialRight(Fi, t, n, o); - case "grid-layout-form": - return f.partialRight(Jn, t, n, o); - case "data-list": - return f.partialRight(_n, t, n, o); - case "destroy": - return f.partialRight(Kn, t, n, o); - default: - if (si(t) || S.isValidElement(t)) return f.partialRight(Fi, t, n, o); - if (f.isFunction(t)) return f.partialRight(Ri, (n == null ? void 0 : n.code) || t, { status: c, setStatus: u }); - } - return (...h) => console.error("useButton unknown widgetType", e, ...h); - }, [t, e, l.getBase62params, l.getSelectedRows]); - return [f.debounce((h) => (s == null || s(h), Promise.resolve(Nt(r, h, { list: l })).then((g) => p(h, { ...i, ...g })).then((g) => a == null ? void 0 : a(g)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; -}, dr = ({ type: t, name: e, className: i, icon: r, iconPosition: n, size: o }, a = "default") => U(() => { - const s = { type: "primary", className: j("ff-button", i), iconPosition: n, size: o }; - return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), a === "link" || a === "dashed" ? (s.type = a, t === "default" && (s.className = j(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), r && (s.icon = m(St, { type: r })), e && (s.children = e), s; -}, [a, t, i, r, n]), Rt = ({ data: t, widget: e, widgetType: i = "fsdpf-component", widgetData: r, widgetProps: n, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: c, extras: u }) => { - const p = he(ce), [h, g] = I(!1), [y, w] = I("hover"), [E, C] = lr(n, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [x, k] = I(), { placement: $, align: F, zIndex: A, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: V = !0, ...P } = a || {}; - q(() => { - i == "grid-layout-form" ? k(S.createElement(cr, { ...r, $setting: o, code: e })) : i == "data-list" ? k(S.createElement(ri, { base62params: t, $setting: o, listCode: e })) : f.isString(e) ? le.getWidgetComponent(e).then(({ default: B }) => { - k(S.createElement(B, { ...r, $setting: o })); - }).catch((B) => k(B.toString())) : S.isValidElement(e) ? k(S.cloneElement(e, { ...r, $setting: o })) : (si(e) || f.isFunction(e) && ["component", "fsdpf-component"].includes(i)) && k(S.createElement(e, { ...r, $setting: o })); - }, [e, i, r]); - const M = (B, X = !1) => (g(B), !B && w("hover"), B ? l == null ? void 0 : l(E) : s == null ? void 0 : s(X)), D = (B) => { - g(!0), w("click"); - }; - return m(Ur, { zIndex: A, placement: $, onPopupClick: D, onClick: D, open: h, align: F, arrow: T, trigger: y, getPopupContainer: N || V ? void 0 : (B) => B, content: m(Gn, { ...P, extras: u, children: x && S.cloneElement(x, { ...E, $setProps: C, $close: (B) => M(!1, B) }) }), children: c, onOpenChange: M }); -}, Gn = ({ title: t, className: e, classNames: i, children: r, extras: n, width: o, height: a, ...s }) => { - const [l, c] = I({}), u = H((y, w) => c((E) => ({ ...E, [y]: w })), []), p = H((y) => c((w) => ({ ...w, [y]: void 0 })), []), h = t ? S.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = n ?? S.createElement("div", { className: "ff-popup-reserved-extras" }, n); - return m(ht.Provider, { value: { ele: l, mount: u, unmount: p }, children: L("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [L("div", { className: j("ff-popup-header", "ff-popover-header", i == null ? void 0 : i.header), children: [h, l == null ? void 0 : l["sub-title"]] }), m("div", { className: j("ff-popup-body", "ff-popover-body", i == null ? void 0 : i.body), children: r }), L("div", { className: j("ff-popup-footer", "ff-popover-footer", i == null ? void 0 : i.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); -}; -Rt.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const ft = (t) => function({ className: e, variant: i, children: r, name: n, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: h, disabled: g, tooltip: y, confirm: w, widget: E = () => { -}, widgetType: C, widgetData: x, widgetProps: k, widgetSetting: $, widgetContainerProps: F, ...A }) { - const { mode: T, ...N } = F || {}, V = dr({ className: e, name: n, type: a, icon: o, iconPosition: s }, i ?? t), P = m(Ct, { ...V, ...A, children: r || n }); - if (T === "popover" && !["destroy", "redirect", "func"].includes(C)) return m(Rt, { data: p, widget: E, widgetType: C, widgetData: x, widgetProps: k, widgetSetting: $, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: P }); - const M = f.isEmpty(y) || !y.enabled ? {} : y, D = f.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [B, X] = I(!1), [se, { disabled: W, loading: de }] = Hn({ widget: E, widgetType: C, widgetData: x, widgetProps: k, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); - return m(qr, { okText: "确定", cancelText: "取消", getPopupContainer: (G) => G, ...D, disabled: W || g, open: B, onOpenChange: (G) => { - if (!G) return X(G); - D.enabled ? X(G) : se(p); - }, onConfirm: (G) => { - se(p, G); - }, onClick: (G) => { - G.stopPropagation(); - }, children: m(Kr, { getPopupContainer: (G) => G, ...M, title: B ? null : M == null ? void 0 : M.title, trigger: ["hover", "click"], children: S.cloneElement(P, { loading: de || h, disabled: W || g }) }) }); -}, R = ft("default"); -R.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }; -const Yn = ft("link"), Xn = ft("circle"), Qn = ft("round"), Zn = ft("dashed"), ji = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (g, y, w) => { -}, onBeforeClick: r = (g, y, w) => { -}, labelVariant: n = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: c = (g, y) => m(R, { ...g, data: y }, g.uuid || Dt()), widgetContainerProps: u = {}, children: p, data: h }) => { - if (f.isEmpty(t)) return p; - l ?? (l = o), s ?? (s = n); - const [g, y] = U(() => (t || []).reduce((C, x) => { - const k = e.indexOf(x.widgetType); - return k === -1 ? C[1].push(x) : C[0] ? k < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = x) : C[1].push(x) : C[0] = x, C; - }, [null, []]), [t, e]); - a ? p = a(g, h) || p : p || (p = m(Ct, { ...dr(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), n) })); - const w = y.map((C) => c(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: f.partialRight(i, C, h), onBeforeClick: f.partialRight(r, C, h) }, { size: l, variant: s }), h)); - let E = w; - return (w == null ? void 0 : w.length) > 1 && (E = s == "link" ? m(Bt, { split: m(Jr, { type: "vertical" }), size: l, children: w }) : m(Bt.Compact, { size: l, children: w })), g ? m(Rt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: h, widgetData: g == null ? void 0 : g.widgetData, extras: E, onAfterClick: f.partialRight(i, g, h), onBeforeClick: f.partialRight(r, g, h), children: p }) : E; -}; -ji.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: R.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = Yn, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Xn, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Qn, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = Zn, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = Rt, R.GroupPopover = ji; -const eo = ({ fields: t, formProps: e, $close: i }) => { - const [r] = ae.useForm(), n = U(() => [{ name: "__PROPS__", value: e }], [e]); - return m(te, { actions: L(S.Fragment, { children: [m(R, { name: "取消", widget: () => i(!1) }), m(R, { name: "确定", type: "primary", widget: () => r.validateFields(!0).then(i) })] }), children: m(ae, { fields: n, form: r, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => m(ni, { code: o, ...a }, o)) }) }); -}, to = ({ className: t, classNames: e, $close: i, children: r, title: n, subTitle: o, actions: a, extras: s, ...l }) => L(Zr, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [L("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [m("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: m(ti, { type: "close" }) }), n, o] }), m("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: r }), L("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), io = ({ className: t, classNames: e, $close: i, $event: r, children: n, title: o, subTitle: a, actions: s, extras: l, placement: c, ...u }) => { - const p = (r == null ? void 0 : r.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: r == null ? void 0 : r.pageX, y: r == null ? void 0 : r.pageY } }; - return m(en, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => L("div", { className: j("ff-modal-content ff-popup", t), children: [L("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [m("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: u.onClose, children: m(ti, { type: "close" }) }), o, a] }), m("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: n }), L("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) }); -}, ur = ({ placement: t, $close: e, $event: i, children: r, title: n, ...o }) => { - const [a, s] = I({}), [l, c] = I(!0), u = H((y, w) => s((E) => ({ ...E, [y]: w })), []), p = H((y) => s((w) => ({ ...w, [y]: void 0 })), []); - let h = { ...o, className: a.rootClassName, title: a.title || n && S.createElement("div", { className: j("ff-popup-title") }, n), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: r, $close: e, $event: i, onClose: () => c(!1) }; - const g = () => { - e(!1); - }; - return m(ht.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? m(to, { ...h, placement: t, open: l, afterOpenChange: (y) => !y && g() }) : m(io, { ...h, visible: l, afterClose: g }) }); -}; -ur.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; -const ro = ({ widget: t, widgetProps: e, $close: i, onSetProps: r }) => { - const [n, o] = I(e || {}), a = Vi(e); - ei(() => { - const l = a ?? {}, c = e ?? {}, u = Object.keys({ ...l, ...c }).reduce((p, h) => (l[h] !== c[h] && (p[h] = c[h]), p), {}); - Object.keys(u).length > 0 && o((p) => ({ ...p, ...u })); - }, [e]); - const s = H((l) => { - o((c) => ({ ...c, ...l })), r == null || r(l); - }, [r]); - return S.isValidElement(t) ? S.cloneElement(t, { ...n, $close: i, $setProps: s }) : t != null && t.name || Ei.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === Ei.ForwardRef ? S.createElement(t, { ...n, $close: i, $setProps: s }) : t; -}, re = () => { - const [t, e] = Ar({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => { - const { offsetHeight: a } = o; - return { height: a }; - }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = S.useReducer((o) => o + 1, 0); - q(() => { - re.$onClick = r, re.$queue.forEach(([o, a, s], l, c) => { - n([a, s], ...o), delete c[l]; - }); - }, []); - const r = (o, a = {}, s = {}) => new Promise((l, c) => n([l, c], o, a, s)), n = ([o, a], s, l = {}, c = {}) => { - const u = re.$index++, p = (y) => ((w, E) => (re.$popups.delete(w), i(), E == null ? void 0 : E()))(u, () => o(y)); - if (s === Ui) return t.open({ ...c, key: u, content: S.createElement(s, { ...l, $close: () => t.close(u) }) }); - const { $setProps: h, ...g } = l; - re.$popups.set(u, S.createElement(ur, { maskClosable: !1, $event: g == null ? void 0 : g.$event, ...c, key: u, $close: p }, S.createElement(ro, { widget: s, widgetProps: g, $close: p, onSetProps: h }))), i(); - }; - return L(S.Fragment, { children: [Array.from(re.$popups).map(([o, a]) => a), e] }); -}; -re.$popups = /* @__PURE__ */ new Map(), re.$index = 0, re.$queue = [], re.$onClick = (...t) => new Promise((e, i) => { - re.$queue.push([t, e, i]); -}); -const Ai = (t, e, i = {}) => re.$onClick(t, e, i), Mt = (t, { showProgress: e, duration: i, ...r } = { duration: 1.5 }) => re.$onClick(Ui, { content: t, ...r }, { showProgress: e, duration: i }), ne = { modal: Ai, confirm: (t, e = {}) => re.$onClick(tn, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, i = {}) => Ai(eo, { formProps: i, fields: t }, { placement: "center", ...e }).then((r) => { - if (r === !1) throw !1; - return r; -}), notification: Mt, success: (t, e = { duration: 1.5 }) => Mt(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => Mt(t, { ...e, className: "ff-notification-error", icon: "close" }) }; -tt.configure({ showSpinner: !1 }); -const pr = () => { - const t = window.localStorage.getItem(bt); - return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); -}; -De.interceptors.request.use((t) => (Object.assign(t.headers, pr()), tt.inc(), t), (t) => (tt.done(), Promise.reject({ code: -1, msg: t }))), De.interceptors.response.use(({ data: t, headers: e }) => (tt.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { - return tt.done(), Promise.reject(t.message); -}), window.addEventListener("unhandledrejection", zt.onUnhandledRejection), zt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && oe.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); -var Xe, Ue, Qe; -const Z = class Z { - constructor() { - O(this, "appUrl", ""); - v(this, Xe, null); - return d(Z, Ue) || (K(Z, Qe, new zt()), K(Z, Ue, new Proxy(this, { get(e, i) { - if (i in e) { - const r = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), i); - return r != null && r.get ? Reflect.get(e, i, e) : typeof e[i] == "function" ? e[i].bind(e) : e[i]; - } - return d(Z, Qe)[i]; - } }))), d(Z, Ue); - } - init(e, i, r) { - De.defaults.baseURL = this.appUrl = r, De.defaults.timeout = 15e3, d(Z, Qe).init(e, i, De); - } - get driver() { - return De; - } - get headers() { - return pr(); - } - mock(e = {}) { - return d(this, Xe) ?? K(this, Xe, new Lr(De, { onNoMatch: "passthrough", ...e })); - } - unmock() { - var e; - (e = d(this, Xe)) == null || e.restore(), K(this, Xe, null); - } -}; -Xe = new WeakMap(), Ue = new WeakMap(), Qe = new WeakMap(), v(Z, Ue), v(Z, Qe), O(Z, "getInstance", () => d(Z, Ue) ?? K(Z, Ue, new Z())); -let Xt = Z; -const z = Xt.getInstance(); -class ai extends Error { - constructor(e, i) { - super(i), Error.captureStackTrace && Error.captureStackTrace(this, ai), !i instanceof it && (this.name = `${e} Error Runtime`); - } -} -class it extends Error { - constructor(e, ...i) { - super(...i), Error.captureStackTrace && Error.captureStackTrace(this, it), this.name = `${e} Not Found`; - } -} -const Vt = "mine", bt = "token"; -var Le, Ze; -const Ce = class Ce { - constructor() { - v(this, Ze, /* @__PURE__ */ new Map()); - O(this, "setVendor", (e, i) => d(this, Ze).set(e, new Bi(i, async (r, n) => { - var a, s; - if (!(r != null && r.default)) throw "@pkg not found"; - let o = () => n; - switch ("function") { - case typeof (o = (a = r.default) == null ? void 0 : a[`./${n}/index.jsx`]): - case typeof (o = (s = r.default) == null ? void 0 : s[`./${n}/index.js`]): - return o(); - } - throw new it(n); - }))); - O(this, "getWidgetComponent", async (e) => { - if (!e) throw "getWidgetComponent widget is required"; - if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); - const [, i] = e == null ? void 0 : e.split("@pkg/"); - if (!i) throw new it(e); - try { - return d(this, Ze).has("pkg") ? await d(this, Ze).get("pkg").get(i) : await import(`${z.appUrl}/api/pkg-import/web?name=${e}`); - } catch (r) { - throw new ai(e, r); - } - }); - O(this, "getRoutes", () => z.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: i, ...r }) => [i, { uuid: i, ...r }])).then((e) => new Map(e))); - O(this, "getMenus", () => z.get("/api/my-menu")); - O(this, "getConfigure", () => z.get("api/init-configure")); - O(this, "getWidgetOperationAuth", () => z.get("/api/init-widget-operation-auth").then((e) => e.reduce((i, { uuid: r, auth: n }) => [...i, [r, n]], []))); - O(this, "getPhoneNumber", (e) => z.get(`/api/user-wx-phone-number/${e}`)); - O(this, "getUserToken", () => { - const e = window.localStorage.getItem(bt); - if (!e) return ""; - const i = e.split("."); - if (!Array.isArray(i) || i.length !== 3) throw "登录令牌无效!"; - const { iat: r } = JSON.parse(window.atob(i[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - r > 2592e3) throw "登录令牌已过期, 请重新登录!"; - return e; - }); - O(this, "checkUserToken", () => { - try { - return !!this.getUserToken(); - } catch { - return !1; - } - }); - O(this, "getUserInfo", (e = !0) => { - var i; - try { - const r = this.getUserToken(); - if (!r) return Promise.resolve(null); - const { iat: n } = JSON.parse(window.atob((i = r == null ? void 0 : r.split(".")) == null ? void 0 : i[1])), { iat: o, ...a } = z.decode(window.localStorage.getItem(Vt) || "", {}); - return o === n ? Promise.resolve(a) : z.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Vt, z.encode({ ...s, iat: n })), s)); - } catch (r) { - console.error(r), e && ne.error("请登录").then(this.logout); - } - return Promise.resolve(null); - }); - O(this, "login", (e, i, r = {}) => z.post("/api/user-token", { username: e, passwd: Mr.hash(i), platform: "web", ...r }).then(({ token: n }) => (window.localStorage.setItem(bt, n), n)).then(async (n) => (await this.initAppEnv(), n))); - O(this, "logout", (e) => (window.localStorage.removeItem(Vt), window.localStorage.removeItem(bt), e == null ? void 0 : e())); - O(this, "initAppEnv", async () => { - const [e, i, r, n] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return qi.init(e), qe.init(n), oe.init(i, r), St.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: i, menus: r, configures: n }; - }); - if (d(Ce, Le)) return d(Ce, Le); - } -}; -Le = new WeakMap(), Ze = new WeakMap(), v(Ce, Le, null), O(Ce, "getInstance", () => (d(Ce, Le) || K(Ce, Le, new Ce()), d(Ce, Le))); -let Qt = Ce; -const le = Qt.getInstance(), no = S.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), oo = S.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), si = (t) => { - if (!t) return !1; - if (t.prototype instanceof S.Component || t.$$typeof) return !0; - if (typeof t == "function") { - const e = t.displayName || t.name; - return !e || /^[A-Z]/.test(e); - } - return !1; -}, ao = (t, e) => { - if (!t || typeof window > "u") return; - let i = document.querySelector(`style[ff-style-token="${e}"]`); - return i ? (i.innerHTML = t, t) : (i = document.createElement("style"), i.setAttribute("ff-style-token", e), i.setAttribute("type", "text/css"), i.innerHTML = t, document.head.appendChild(i), t); -}, so = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: no, AppGlobalParamsContext: oo, cache: Bi, configure: qe, default: le, func: Me, http: z, insertStyle: ao, isReactComponent: si, route: oe }, Symbol.toStringTag, { value: "Module" })); -var Pe, et, Ne, Se, Ee, ie, ee, Y, $e, ct, dt, ut, pt, Pt, gt; -const li = class li { - constructor(e, i = "/") { - v(this, Pe, "/"); - v(this, et, /* @__PURE__ */ new Set()); - v(this, Ne, (e) => { - for (const i of d(this, et)) try { - i(e); - } catch (r) { - console.error("Error in VirtualFS event listener:", r); - } - }); - v(this, Se, (e) => { - const i = Date.now(); - if (e && (e.lastModified = i), d(this, Pe) != "/") { - const r = d(this, Y).call(this, d(this, Pe)); - r && (r.lastModified = i); - } - this.root.lastModified = i; - }); - v(this, Ee, (e) => { - let i = me.normalize(e); - return i.startsWith("/") || (i = "/" + i), i.length > 1 && i.endsWith("/") && (i = i.slice(0, -1)), i; - }); - v(this, ie, (e) => { - const i = me.join(d(this, Pe), e); - return d(this, Ee).call(this, i); - }); - v(this, ee, (e) => { - if (!e || typeof e != "string") return !1; - const i = d(this, Ee).call(this, e); - return !i.includes("..") && i.startsWith("/"); - }); - v(this, Y, (e) => { - var o; - const i = d(this, Ee).call(this, e); - if (i === "/") return this.root; - const r = i.split("/").filter((a) => a); - let n = this.root; - for (const a of r) { - if (n.type !== "dir") return null; - const s = (o = n.children) == null ? void 0 : o.find((l) => l.name === a); - if (!s) return null; - n = s; - } - return n; - }); - v(this, $e, (e) => { - const i = d(this, Ee).call(this, e), r = me.basename(i), n = me.dirname(i); - return { parent: d(this, Y).call(this, n), name: r }; - }); - v(this, ct, (e, i, r) => r === !1 ? e : r === "root" ? e.map((n) => me.join(i, n)) : r === !0 || r === "working" ? e.map((n) => me.relative(d(this, Pe), me.join(i, n))) : e); - v(this, dt, async (e, i, r, n = "") => { - const o = [], a = d(this, Y).call(this, e); - if (!a || a.type !== "dir") return o; - const s = a.children; - for (const l of s) { - const c = l.name, u = e === "/" ? `/${c}` : `${e}/${c}`, p = n ? `${n}/${c}` : c; - try { - if (l.type === "file") i(r ? p : c) && o.push(p); - else if (l.type === "dir" && r) { - const h = await d(this, dt).call(this, u, i, r, p); - o.push(...h); - } - } catch { - continue; - } - } - return o; - }); - v(this, ut, async (e, i, r, n = "") => { - const o = [], a = Array.isArray(i) ? i : [i], s = d(this, Y).call(this, e); - if (!s || s.type !== "dir") return o; - if (!r) { - for (const c of a) if (d(this, pt).call(this, c)) { - const u = await d(this, Pt).call(this, e, c); - o.push(...u); - } else { - const u = me.join(e, c), p = d(this, Ee).call(this, u); - d(this, Y).call(this, p) && o.push(c); - } - return o; - } - const l = s.children; - for (const c of l) { - const u = c.name, p = e === "/" ? `/${u}` : `${e}/${u}`, h = n ? `${n}/${u}` : u; - try { - if (c.type === "file") for (const g of a) { - let y = !1; - if (y = d(this, pt).call(this, g) ? d(this, gt).call(this, u, g) : u === g, y) { - o.push(h); - break; - } - } - else if (c.type === "dir") { - const g = await d(this, ut).call(this, p, i, r, h); - o.push(...g); - } - } catch { - continue; - } - } - return o; - }); - v(this, pt, (e) => /[*?[\]{}]/.test(e)); - v(this, Pt, async (e, i) => { - const r = [], n = d(this, Y).call(this, e); - if (!n || n.type !== "dir") return r; - const o = n.children.map((a) => a.name); - for (const a of o) d(this, gt).call(this, a, i) && r.push(a); - return r; - }); - v(this, gt, (e, i) => { - const r = i.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (n, o) => "(" + o.split(",").join("|") + ")"); - return new RegExp(`^${r}$`).test(e); - }); - var r, n, o; - K(this, Pe, i), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (r = this.root).name ?? (r.name = "/"), (n = this.root).children ?? (n.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now()))); - } - async stat(e) { - const i = d(this, ie).call(this, e); - if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const r = d(this, Y).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); - return { isFile: () => r.type === "file", isDirectory: () => r.type === "dir", lastModified: r.lastModified }; - } - async dir(e) { - const i = d(this, ie).call(this, e); - if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const r = d(this, Y).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); - if (r.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); - return r.children.map((n) => n.name); - } - async readFile(e) { - const i = d(this, ie).call(this, e); - if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const r = d(this, Y).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (r.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); - return r.content || ""; - } - async writeFile(e, i) { - const r = d(this, ie).call(this, e); - if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: n, name: o } = d(this, $e).call(this, r); - if (!n) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (n.type !== "dir") throw new Error("ENOTDIR: not a directory"); - const a = n.children.findIndex((c) => c.name === o), s = a >= 0, l = { name: o, type: "file", content: i, lastModified: Date.now() }; - s ? n.children[a] = l : n.children.push(l), d(this, Se).call(this, n), d(this, Ne).call(this, { action: s ? "update" : "create", path: r, type: "file", timestamp: Date.now() }); - } - async mkdir(e, i = {}) { - const r = d(this, ie).call(this, e); - if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - const { recursive: n } = i; - if (n) { - const o = r.split("/").filter((s) => s); - let a = "/"; - for (const s of o) - if (a = me.join(a, s), !d(this, Y).call(this, a)) { - const { parent: l, name: c } = d(this, $e).call(this, a); - if (l && l.type === "dir") { - const u = { name: c, type: "dir", children: [], lastModified: Date.now() }; - l.children.push(u), d(this, Se).call(this, l), d(this, Ne).call(this, { action: "create", path: d(this, Ee).call(this, a), type: "dir", timestamp: Date.now() }); - } - } - } else { - const { parent: o, name: a } = d(this, $e).call(this, r); - if (!o) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); - if (o.type !== "dir") throw new Error("ENOTDIR: not a directory"); - if (o.children.find((l) => l.name === a)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); - const s = { name: a, type: "dir", children: [], lastModified: Date.now() }; - o.children.push(s), d(this, Se).call(this, o), d(this, Ne).call(this, { action: "create", path: r, type: "dir", timestamp: Date.now() }); - } - } - async unlink(e) { - const i = d(this, ie).call(this, e); - if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: n } = d(this, $e).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - const o = r.children.findIndex((a) => a.name === n); - if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - if (r.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); - r.children.splice(o, 1), d(this, Se).call(this, r), d(this, Ne).call(this, { action: "delete", path: i, type: "file", timestamp: Date.now() }); - } - async rmdir(e, i = {}) { - const r = d(this, ie).call(this, e); - if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: n, name: o } = d(this, $e).call(this, r); - if (!n) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); - const a = n.children.findIndex((l) => l.name === o); - if (a < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); - const s = n.children[a]; - if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); - if (!i.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); - n.children.splice(a, 1), d(this, Se).call(this, n), d(this, Ne).call(this, { action: "delete", path: r, type: "dir", timestamp: Date.now() }); - } - async rename(e, i) { - const r = d(this, ie).call(this, e), n = d(this, ie).call(this, i); - if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${i}'`); - if (!d(this, Y).call(this, r)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); - const { parent: o, name: a } = d(this, $e).call(this, r), { parent: s, name: l } = d(this, $e).call(this, n); - if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); - if (d(this, Y).call(this, n)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${i}'`); - const c = o.children.findIndex((p) => p.name === a), u = { ...o.children[c], name: l, lastModified: Date.now() }; - o.children.splice(c, 1), s.children.push(u), d(this, Se).call(this, o), o !== s && d(this, Se).call(this, s), d(this, Ne).call(this, { action: "rename", path: n, oldPath: r, type: u.type, timestamp: Date.now() }); - } - async exists(e) { - const i = d(this, ie).call(this, e); - return d(this, ee).call(this, i) ? d(this, Y).call(this, i) !== null : !1; - } - getLastModified() { - return this.root.lastModified; - } - subscribe(e) { - if (typeof e != "function") throw new Error("Callback must be a function"); - return d(this, et).add(e), () => { - d(this, et).delete(e); - }; - } - getWorkingDirectory() { - return d(this, Pe); - } - scope(e = "/") { - const i = d(this, Ee).call(this, e); - if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const r = d(this, Y).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (r.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - return r.children ?? (r.children = []), r.lastModified ?? (r.lastModified = Date.now()), new li(this.root, i); - } - async findFiles(e, i, r = {}) { - const n = d(this, ie).call(this, e); - if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const o = d(this, Y).call(this, n); - if (!o) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (o.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - const { recursive: a = !1, fullPath: s = !1 } = r; - if (typeof i == "function") { - const c = await d(this, dt).call(this, n, i, a); - return d(this, ct).call(this, c, n, s); - } - const l = await d(this, ut).call(this, n, i, a); - return d(this, ct).call(this, l, n, s); - } -}; -Pe = new WeakMap(), et = new WeakMap(), Ne = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), ie = new WeakMap(), ee = new WeakMap(), Y = new WeakMap(), $e = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), pt = new WeakMap(), Pt = new WeakMap(), gt = new WeakMap(); -let Ii = li; -const lo = async (t, e = "/", i = "") => { - try { - const r = await t.stat(e), n = e === "/" ? "/" : me.basename(e), o = { title: n, key: i ? `${i}${e}` : e, isLeaf: r.isFile() }; - if (r.isDirectory()) { - const a = await t.dir(e); - if (a.length > 0) { - o.children = []; - const s = [], l = []; - for (const c of a) { - const u = e === "/" ? `/${c}` : `${e}/${c}`; - try { - (await t.stat(u)).isDirectory() ? s.push(c) : l.push(c); - } catch (p) { - console.warn(`Failed to stat ${u}:`, p.message); - } - } - s.sort(), l.sort(); - for (const c of [...s, ...l]) { - const u = e === "/" ? `/${c}` : `${e}/${c}`; - try { - const p = await lo(t, u, i); - o.children.push(p); - } catch (p) { - console.warn(`Failed to process ${u}:`, p.message); - } - } - } - } - return o; - } catch { - return null; - } -}; -export { - Wo as $, - sn as A, - Ro as B, - Fo as C, - kt as D, - _i as E, - Kt as F, - Io as G, - Cn as H, - ln as I, - cn as J, - vn as K, - Pn as L, - Lo as M, - Mo as N, - ge as O, - Tn as P, - Nt as Q, - Qi as R, - nr as S, - Lt as T, - Vo as U, - Do as V, - zo as W, - Bo as X, - On as Y, - Rn as Z, - Fn as _, - Ki as a, - jn as a0, - Tt as a1, - Uo as a2, - mt as a3, - Ot as a4, - qo as a5, - Ko as a6, - An as a7, - lr as a8, - Un as a9, - Bi as aA, - qe as aB, - Me as aC, - oe as aD, - no as aE, - oo as aF, - Ii as aG, - lo as aH, - ro as aI, - oi as aa, - ni as ab, - cr as ac, - In as ad, - Ln as ae, - Mn as af, - Vn as ag, - Dn as ah, - zn as ai, - Jo as aj, - St as ak, - R as al, - qi as am, - Hn as an, - te as ao, - ht as ap, - Wi as aq, - re as ar, - ne as as, - No as at, - To as au, - Oo as av, - le as aw, - si as ax, - ao as ay, - z as az, - Hi as b, - jo as c, - Gi as d, - ii as e, - Zi as f, - rn as g, - ir as h, - En as i, - tr as j, - Sn as k, - Ao as l, - er as m, - Xi as n, - Yi as o, - yn as p, - fn as q, - hn as r, - ri as s, - ce as t, - kn as u, - bn as v, - xn as w, - dn as x, - pn as y, - an as z -}; diff --git a/dist/common/main-Cta62l2D.js b/dist/common/main-Cta62l2D.js new file mode 100644 index 0000000..978b069 --- /dev/null +++ b/dist/common/main-Cta62l2D.js @@ -0,0 +1,1572 @@ +var Ri = Object.defineProperty; +var bn = (t) => { + throw TypeError(t); +}; +var Fi = (t, e, n) => e in t ? Ri(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; +var O = (t, e, n) => Fi(t, typeof e != "symbol" ? e + "" : e, n), Cn = (t, e, n) => e.has(t) || bn("Cannot " + n); +var d = (t, e, n) => (Cn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), v = (t, e, n) => e.has(t) ? bn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), K = (t, e, n, i) => (Cn(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n); +var kn = (t, e, n, i) => ({ + set _(r) { + K(t, e, r, n); + }, + get _() { + return d(t, e, i); + } +}); +import { jsx as m, jsxs as I } from "react/jsx-runtime"; +import E, { useEffect as q, useState as L, useCallback as J, useRef as _, useContext as he, useMemo as U, useId as Dt, isValidElement as ji, useLayoutEffect as Ai } from "react"; +import me from "pathe"; +import C from "prop-types"; +import j from "classnames"; +import { useNotification as Ii } from "rc-notification"; +import f from "lodash"; +import oe, { Field as Zt, FieldContext as Mn } from "rc-field-form"; +import { useMountedState as Li, useDeepCompareEffect as en, useUpdateEffect as Vn, usePrevious as Dn } from "react-use"; +import { _ as Sn, M as It, N as tt, b as De, i as Wt, c as Mi, S as Vi } from "./vender-hQk7ADWo.js"; +import Di from "rc-util/lib/hooks/useMergedState"; +import Wn from "immutability-helper"; +import { Space as Bt, Form as wt, Input as Wi, Button as Ct, Pagination as Bi, Tree as zi, Breadcrumb as Ui, Empty as zt, Table as En, Popover as qi, Popconfirm as Ki, Tooltip as Hi, Divider as _i } from "antd"; +import { useMergedState as Ji } from "rc-util"; +import { generatePath as Gi, useInRouterContext as Bn, useParams as Yi, useLocation as Xi, createBrowserRouter as Qi, Navigate as Zi } from "react-router-dom"; +import er from "rc-drawer"; +import tr from "rc-dialog"; +import * as $n from "react-is"; +var He, it, _e, xe, We, Be; +class zn { + constructor(e, n) { + v(this, He, /* @__PURE__ */ new Map()); + v(this, it, !0); + v(this, _e, []); + v(this, xe); + v(this, We, () => d(this, xe)); + v(this, Be, () => Promise.resolve()); + O(this, "get", (...e) => new Promise((n, i) => { + const r = JSON.stringify(e); + if (d(this, He).has(r)) return n(d(this, Be).call(this, d(this, xe), ...e)); + if (d(this, xe) === void 0) d(this, _e).push([e, n, i]), d(this, it) && (K(this, it, !1), Promise.resolve(typeof d(this, We) == "function" ? d(this, We).call(this) : d(this, We)).then((a) => K(this, xe, a || null)).finally(() => { + d(this, _e).forEach(([a, o, s]) => { + try { + const l = d(this, Be).call(this, d(this, xe), ...a); + d(this, He).set(JSON.stringify(a), l), o(l); + } catch (l) { + s(l); + } + }), d(this, _e).length = 0; + })); + else { + const a = d(this, Be).call(this, d(this, xe), ...e); + d(this, He).set(r, a), n(a); + } + })); + K(this, Be, n), K(this, We, e); + } +} +He = new WeakMap(), it = new WeakMap(), _e = new WeakMap(), xe = new WeakMap(), We = new WeakMap(), Be = new WeakMap(); +const Pa = () => m("div", { children: "Empty" }), ht = E.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), te = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: a, extras: o, style: s = {} }) => { + const { mount: l, unmount: c } = E.useContext(ht); + return te.Action({ children: i }), te.Title({ children: r }), te.SubTitle({ children: a }), te.Extra({ children: o }), q(() => (l("rootClassName", t), () => c(t)), [t]), m("div", { className: j("ff-container", e), style: s, children: n }); +}, yt = (t) => ({ children: e, className: n }) => { + const { mount: i, unmount: r } = E.useContext(ht); + return q(() => (e && i(t, E.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, n) }, e)), () => r(t)), [n, e]), null; +}; +te.Action = yt("actions"), te.Title = yt("title"), te.SubTitle = yt("sub-title"), te.Extra = yt("extras"), te.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; +const Na = () => m(te, { className: "ff-loading", children: I("div", { className: "loader", children: [I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] }), I("div", { className: "square", children: [m("span", {}), m("span", {}), m("span", {})] })] }) }), Ta = () => m("div", { children: "NotFound" }), Un = ({ children: t }) => { + const [e, n] = L({}), i = J((a, o) => n((s) => ({ ...s, [a]: o })), []), r = J((a) => n((o) => ({ ...o, [a]: void 0 })), []); + return typeof (t == null ? void 0 : t.type) == "string" ? t : m(ht.Provider, { value: { ele: e, mount: i, unmount: r }, children: E.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); +}; +Un.propTypes = { children: C.element.isRequired }; +const xn = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, tn = ({ type: t, props: e }) => m("i", { ...e, children: m("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (xn[t] || xn.info).map((n, i) => m("path", { d: n }, i)) }) }), qn = ({ className: t, content: e, icon: n, $close: i }) => I(E.Fragment, { children: [n && m("div", { className: j("ff-notification-icon", t), children: m(tn, { type: n }) }), e] }), nr = ({}) => m(te, { children: "Confirm" }); +var Oe, Je; +const fe = class fe { + constructor() { + v(this, Je, /* @__PURE__ */ new Map()); + O(this, "init", (e) => K(this, Je, new Map(e))); + O(this, "check", (e) => !d(this, Je).has(e) || d(this, Je).get(e)); + if (d(fe, Oe)) return d(fe, Oe); + } +}; +Oe = new WeakMap(), Je = new WeakMap(), v(fe, Oe, null), O(fe, "getInstance", () => (d(fe, Oe) || K(fe, Oe, new fe()), d(fe, Oe))); +let Ut = fe; +const Kn = Ut.getInstance(), ir = (t, e, n = "children") => { + if (f.isEmpty(t)) return {}; + const i = f.find(t, ["value", e]); + if (!f.isEmpty(i)) return i; + const r = t.length; + for (let a = 0; a < r; a++) { + const { [n]: o } = t[a], s = ir(o, e, n); + if (!f.isEmpty(s)) return s; + } + return {}; +}, Hn = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; +var Re, rt; +const ye = class ye { + constructor() { + v(this, rt, null); + O(this, "init", (e) => K(this, rt, e)); + O(this, "get", (e, n) => f.get(d(this, rt), e, n)); + if (d(ye, Re)) return d(ye, Re); + } +}; +Re = new WeakMap(), rt = new WeakMap(), v(ye, Re, null), O(ye, "getInstance", () => (d(ye, Re) || K(ye, Re, new ye()), d(ye, Re))); +let qt = ye; +const qe = qt.getInstance(); +var Ge, Et, at, ot, $t; +const Te = class Te { + constructor(...e) { + v(this, at, []); + v(this, ot, (e) => { + var n; + for (let i of e) Array.isArray(i[0]) ? d(this, ot).call(this, i) : d(this, at).push(d(n = Te, Et).call(n, i[0], i[1])); + }); + O(this, "toValue", async (e, n = null) => { + const i = { getValue: () => e, getRecord: () => n }; + let r = e; + for (const a of d(this, at)) try { + const o = await a; + if (typeof o != "function") { + console.warn("middleware is not a function, skip:", o); + continue; + } + r = await o.call(i, r); + } catch (o) { + console.error("middleware error, skip:", o); + } + return r; + }); + O(this, "toRender", (e, n, i = null) => E.createElement(d(this, $t), { value: e, record: n }, i)); + v(this, $t, ({ value: e, record: n, children: i }) => { + const [r, a] = L(i), o = Li(); + return en(() => { + a(i), this.toValue(e, n).then((s) => o() && a(s)).catch((s) => o() && a(`${s}`)); + }, [e, n]), r; + }); + d(this, ot).call(this, e); + } +}; +Ge = new WeakMap(), Et = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), $t = new WeakMap(), v(Te, Ge, null), v(Te, Et, f.memoize((e, n) => { + if (typeof e == "function") return e(n); + if (typeof e == "string") return le.getWidgetComponent(e).then((i) => { + var r; + return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((a) => a); + }); + throw new TypeError("middleware must be a string or a function"); +}, (...e) => { + var n; + return d(Te, Ge) || K(Te, Ge, Rr()), d(n = Te, Ge).call(n, ...e); +})); +let kt = Te; +const ce = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { +}, getSelectedRows: () => [], onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +}, reload: () => { +}, setPage: () => { +}, setPageSize: () => { +}, setTab: () => { +}, setSider: () => { +}, setKeyword: () => { +}, setCondition: () => { +} }), vn = ({ className: t, record: e, column: n, ...i }) => { + if (n != null && n.editableByJs && (n != null && n.uuid)) { + const { formSetting: r = { primaryKey: "id" }, widgetSetting: a = {}, widgetContainerSetting: o = {} } = (n == null ? void 0 : n.editableByJsSetting) || {}; + return m(R.Popover, { widget: _n, widgetData: { record: e, column: n }, widgetSetting: { widgetSetting: a, formSetting: r }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...o }, children: m("td", { className: j("ff-data-list-cell-editable", t), ...i }) }); + } + return m("td", { className: t, ...i }); +}, _n = ({ record: t, column: e, $close: n, $setting: i }) => { + const r = _(Tr(f.get(t, e == null ? void 0 : e.dataIndex))), { listCode: a, onClickCallback: o } = he(ce), [s] = oe.useForm(), { formSetting: l, widgetSetting: c } = i, { primaryKey: u = "id", help: p, validators: h } = l || {}, g = () => { + s.setFieldsValue({ value: f.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); + }; + return Ot(() => g(), [t, e == null ? void 0 : e.dataIndex, a]), m(te, { actions: I(E.Fragment, { children: [m(R, { size: "small", onClick: g, children: "重置" }), I(Bt.Compact, { block: !0, children: [m(R, { size: "small", widget: n, children: "取消" }), m(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: y }) => { + const w = f.get(t, u.substring(u.indexOf(".") + 1)); + if (!w) throw "获取更新主键失败!"; + W.put(`/api/${a}-storeBy-${e == null ? void 0 : e.uuid}/${w}`, { value: y }).msg(() => o(2, t)).then(n); + }).catch(console.warn), children: "保存" })] })] }), children: I(oe, { form: s, children: [m(an, { label: "", code: "value", type: r.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: h }), m(Zt, { noStyle: !0, name: ["__PROPS__"], children: () => { + } })] }) }); +}; +_n.displayName = "DataListCellEditableContainer"; +const rr = (t) => function(e) { + return t(e, getRecord()); +}, ar = async ({ widgetByJs: t, widgetByJsSetting: e }) => { + const n = await le.getWidgetComponent(t).then((i) => i.default || ((r) => r)); + return function(i) { + return m(n, { value: i, $setting: e }); + }; +}, or = (t, e = {}) => U(() => { + var n; + return (n = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : n.map(({ widgetByJs: i, widgetByJsSetting: r, middlewares: a, ...o }, s) => { + const l = (c) => ({ record: c, column: o }); + return a || (a = []), i && a.push([ar, { widgetByJs: i, widgetByJsSetting: r }]), a.length > 0 ? (o != null && o.render && a.push([rr, o.render]), { ...o, onCell: l, render: (c, u) => new kt(a).toRender(c, u, "-") }) : { ...o, onCell: l }; + }); +}, [t, e]), sr = (t = {}) => U(() => { + var e; + return t.body ?? (t.body = { cell: vn }), (e = t.body).cell ?? (e.cell = vn), t; +}, [t]), Oa = (t) => { + const [e, n] = L({}); + return q(() => { + let i = !1; + return t && W.get(`/api/_/${t}`).then((r) => f.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((r) => !i && n(r)), () => i = !0; + }, [t]), e; +}, Ra = (t, e = {}) => { + const [n, i] = L({ dataSource: [] }); + return mt(() => { + let r = !1; + return t && W.get(`/api/${t}/${W.encode({ page: 1, ...e })}`).then((a) => !r && i(a)), () => r = !0; + }, [t, e]), n; +}, Jn = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { + const r = J(i ? (a) => f.get(a, n, f.get(a, [i, n])) : (a) => f.get(a, n), [n, i]); + return J((a) => t == null ? void 0 : t.filter((o) => !o.uuid || !e.has(o.uuid) || e.get(o.uuid).some((s) => s == r(a))), [t, e, r]); +}, Kt = (t = [], e = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { + const a = J(r ? (o) => f.get(o, i, f.get(o, [r, i])) : (o) => f.get(o, i), [i, r]); + return U(() => { + if (f.isEmpty(t) || !t.some(({ uuid: s }) => Kn.check(s))) return !1; + if (f.isEmpty(e) || f.isEmpty(n)) return !0; + const o = n.map((s) => a(s)); + return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => o.some((c) => c == l))); + }, [t, n, e, a]); +}, lr = (t, e, n = "id", i = null) => { + const r = Tt(), a = _(!1), o = _(t.dataSource), s = _(t.itemOperationsAccess); + return q(() => (o.current = t.dataSource, s.current = t.itemOperationsAccess, () => a.current = !1), [t.dataSource, t.itemOperationsAccess]), a.current && (t.dataSource = o.current, t.itemOperationsAccess = s.current), [t, (l = 0, c = null) => { + var u, p; + if (a.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); + if (l === 2) { + const h = f.get(c, "__PARENT_ID__", ""), g = f.get(c, n, f.get(c, [i, n], "")), y = f.findIndex(o.current, ["__PARENT_ID__", h]), w = f.findIndex(y > -1 ? f.get(o.current, [y, "children"]) : o.current, [n, g]); + if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t); + Promise.all([W.get(`/api/${e}/detail/${g}`), W.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([S, b]) => { + const x = f.get(o.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]); + o.current = Wn(o.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...S, children: x }]] } } } : { $splice: [[w, 1, { ...S, children: x }]] }); + const k = new Map(b); + s.current.forEach(($, F) => { + var A; + (A = k.get(F)) != null && A.some((T) => T == g) || s.current.set(F, $.filter((T) => T !== g)); + }), k.forEach(($, F) => { + s.current.has(F) ? s.current.set(F, f.uniq([...s.current.get(F) || [], ...$])) : s.current.set(F, $); + }); + }).then(() => { + a.current = !0, r(); + }); + } + }]; +}, cr = (t, e) => { + const n = Tt(), i = _(e), r = _(/* @__PURE__ */ new Map()), a = _([]), o = f.throttle((l) => { + a.current = [], W.list(t, f.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: h, sider: g, page: y, pageSize: w, operationsAccess: S, dataSource: b }) => { + i.current = { tab: h, condition: u, sider: g, keyword: c, total: p, pageSize: w, page: b != null && b.length ? y : 1 }, a.current = b, r.current = new Map(S), n(); + }); + }, 380, { leading: !1, trailing: !0 }); + Ot(() => { + a.current = [], t && o(e); + }, [t, e]); + const s = U(() => f.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [i.current]); + return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, c) => o({ page: l, pageSize: c }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, c) => o({ keyword: c, condition: Wn(i.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: a.current, onReload: o, payload: e == null ? void 0 : e.payload }); +}, dr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: h, itemGridLayout: g, $setting: y, tabs: w, isConditionFormLayout: S, isTreeSider: b, treeSiderConfig: x, rowSelection: k }) => { + const { classNames: $, onClickCallback: F } = he(ce), A = f.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = y == null ? void 0 : y.isMarkSelected, N = Jn(l, c, p, u), V = J((P, M, D) => m(ur, { isMarkSelected: T, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: a ? N(M) : [], data: u ? { [u]: M } : M, children: P, onClickCallback: F }), [T, u, p, a, F, l, c]); + return I("div", { className: j("ff-data-list-framework", e), children: [m(n.sider, { isTreeSider: b, ...x }), I("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [m(n.filter, { isConditionFormLayout: S }), m(n.toolbar, { title: h, tabs: w }), m(xr, { ...A, ...g, rowSelection: k, empty: m(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: V, dataSource: i }), m(n.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); +}, ur = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: a, isMarkSelected: o, isSelected: s, selectionType: l }) => I("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": o, "is-selected": s, "is-selectable": !!l }, t), onClick: a, children: [m("div", { className: "data-list-grid-layout-item-container", children: n }), !!(e != null && e.length) && m("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => m("span", { className: "data-list-grid-layout-item-action", children: m(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: i, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (r == null ? void 0 : r(c.isRefresh, i)) }, c.uuid || Dt()) }, (c == null ? void 0 : c.uuid) || Dt())) })] }), pr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: h, tabs: g, isPaginate: y, rowSelection: w, isTreeSider: S, treeSiderConfig: b, isConditionFormLayout: x, ...k }) => { + const { classNames: $, onClickCallback: F } = he(ce), A = Jn(l, c, p, u), T = Kt(l, c, i, p, u); + return I("div", { className: j("ff-data-table-framework", e), children: [m(n.sider, { isTreeSider: S, ...b }), I("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [m(n.filter, { isConditionFormLayout: x }), m(n.toolbar, { title: h, tabs: g }), m(br, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: w, operationRender: T ? (N) => { + var V; + return m("div", { className: "ff-data-table-actions", children: (V = A(N)) == null ? void 0 : V.map((P, M) => m(R.Link, { size: "small", uuid: P.uuid, type: P.type, name: P.name, widget: P.widget, widgetType: P.widgetType, widgetProps: P.widgetProps, widgetData: P.widgetData, widgetSetting: P.widgetSetting, widgetContainerProps: P.widgetContainerSetting, data: N, confirm: P.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(P.isRefresh, N)) }, P.uuid || M)) }); + } : null }), m(n.footer, { isPaginate: y, isOperations: o, operations: s })] })] }); +}, nn = (t = [], e, n = null) => { + var i; + return (i = f.sortBy(t, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: c, ...u } = {} }, p) => m("div", { className: "grid-layout-item", style: Gn(a, o, s, l, c), children: m(e, { ...u, basicForm: n }) }, r ?? p)); +}, Gn = (t, e, n, i, r = {}, a = 0) => { + const o = { "--grid-layout-h": `${i}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; + return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${i}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = Pn(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = Pn(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o; +}, Pn = (t, e, n, i) => `${t || 0}px ${e || 0}px ${n || 0}px ${i || 0}px`, Fa = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Yn = (t) => Object.keys(t).reduce((e, n) => (/^on[A-Z]/.test(n) && (e[n] = t[n]), e), {}), Xn = ({ className: t, isConditionFormLayout: e }) => { + var h, g; + const [n, i] = L({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = E.useContext(ce), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = wt.useForm(); + return q(() => { + r && e && W.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: S, rowHeight: b, cols: x, fields: k }) => { + i({ resource: y, itemMargin: [w, S], rowHeight: b, cols: x, fields: k }); + }).catch(() => i({})); + }, [r, e]), q(() => { + p.setFieldsValue({ keyword: c, ...u }); + }, [JSON.stringify([c, u])]), m("div", { className: j("ff-data-list-filter", l.filter, t), children: m(wt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((h = n.fields) == null ? void 0 : h.length) > 1 ? (y) => o({ [n.resource]: y[n.resource] }, y.keyword) : () => { + }, onValuesChange: (y) => { + f.isEmpty(f.omit(y, ["keyword"])) || p.submit(); + }, children: ((g = n.fields) == null ? void 0 : g.length) > 1 ? m(on, { ...n, children: m(gr, { onReset: () => { + const { keyword: y, condition: w } = s("init") || {}; + p.setFieldsValue({ keyword: y, ...w }); + } }) }) : m("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: m("div", { className: "grid-layout-item", style: Gn(20, 0, 5, 2), children: m(wt.Item, { name: ["keyword"], children: m(Wi.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => a(y) }) }) }) }) }) }); +}, gr = ({ cols: t, fields: e, onReset: n }) => { + const [i, r] = L(!1), a = U(() => e == null ? void 0 : e.toReversed().some((o) => o.y > 1 || o.x + o.w >= t - 5), [t, e]); + return I(wt.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: i }), children: [m(Ct, { onClick: n, children: "重置" }), m(Ct, { type: "primary", htmlType: "submit", children: "查询" }), a && m(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: i ? "关闭" : "展开", icon: i ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +Xn.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; +const hr = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => { + const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = E.useContext(ce), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; + return n && !f.isEmpty(e) || i ? I("div", { className: j("ff-data-list-footer", t), children: [m("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, h) => m(R, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || h)) }), i && m(Bi, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null; +}, mr = [{ title: "parent 1", key: "0-0", children: [{ title: "parent 1-0", key: "0-0-0", disabled: !0, children: [{ title: "leaf", key: "0-0-0-0", disableCheckbox: !0 }, { title: "leaf", key: "0-0-0-1" }] }, { title: "parent 1-1", key: "0-0-1", children: [{ title: m("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], fr = ({ className: t, width: e = 280, isTreeSider: n }) => { + const { classNames: i } = he(ce); + return n ? m(zi.DirectoryTree, { className: j("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: mr }) : null; +}, yr = ({ className: t, title: e, tabs: n }) => { + const { getBase62params: i, onTabChange: r, onReload: a, classNames: o } = he(ce), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Ji((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); + return I("div", { className: j("ff-data-list-toolbar", o.toolbar, t), children: [m("div", { className: "ff-data-list-title", children: e }), m(Ui, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: h }) => m("span", { onClick: () => c(h ?? p), className: j("ff-data-list-tab", { active: (h ?? p) == l }), children: u }), items: n }), I("div", { className: "ff-data-list-actions", children: [m(R.Link, { icon: "icon-reload", widget: () => a() }), m(R.Link, { icon: "icon-setting" })] })] }); +}, wr = ({ className: t, ...e }) => m(zt, { className: j(t, "ff-data-list-empty"), image: zt.PRESENTED_IMAGE_SIMPLE, ...e }), Qn = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: h, keyword: g, onKeywordChange: y, condition: w, onConditionChange: S, sider: b, onSiderChange: x, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: A = [], rowSelection: T, getSelectedRows: N, primaryKey: V, ...P }) => { + const [M, D] = L(), B = N ?? (() => A), X = J((z, de) => { + const G = { tab: p, page: s, pageSize: c, keyword: g, sider: b, condition: w, total: o, payload: F }; + return z && z != "init" ? f.get(G, z, de) : G; + }, [JSON.stringify(w), JSON.stringify(F), p, s, c, g, b, o]), se = U(() => { + let z = { sider: fr, filter: Xn, footer: hr, toolbar: yr, empty: wr }; + k === !1 ? z = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : f.isPlainObject(k) && (z = Object.assign({}, z, k)); + for (const de in z) if (z[de]) { + if (ji(z[de])) { + const G = z[de]; + z[de] = (Ft) => E.cloneElement(G, Ft); + } + } else z[de] = () => m(E.Fragment, {}); + return z; + }, [k]); + return q(() => { + e ? le.getWidgetComponent(e).then((z) => { + if (!z) throw `${e} not found`; + return z; + }).catch((z) => ({ default: () => `${z}` })).then((z) => D(E.createElement(z.default, { ...P, layouts: se, $setting: n }))) : D(m(t ? dr : pr, { ...P, layouts: se, $setting: n })); + }, [e, n]), m(ce.Provider, { value: { classNames: $, listCode: a, onClickCallback: i, onReload: r, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: h, onSiderChange: x, onKeywordChange: y, onConditionChange: S, setPage: l, setPageSize: u, setTab: h, setSider: x, setKeyword: y, setCondition: S, getSelectedRows: B }, children: M && E.cloneElement(M, { dataSource: A, primaryKey: V, rowSelection: T, ...P }) }); +}; +Qn.propTypes = { classNames: C.exact({ sider: C.string, filter: C.string, footer: C.string, toolbar: C.string, container: C.string, content: C.string, item: C.string, empty: C.string }), layouts: C.oneOfType([C.exact({ sider: C.oneOfType([C.elementType, C.element]), filter: C.oneOfType([C.elementType, C.element]), footer: C.oneOfType([C.elementType, C.element]), toolbar: C.oneOfType([C.elementType, C.element]), empty: C.oneOfType([C.elementType, C.element]) }), C.bool]) }; +var Fe, ve, ze, xt; +const we = class we { + constructor() { + v(this, ve, null); + v(this, ze, /* @__PURE__ */ new Map()); + v(this, xt, () => { + if (d(this, ve)) return d(this, ve).port.postMessage({ command: "status", data: [] }); + K(this, ve, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), d(this, ve).port.onmessage = (e) => { + var n, i; + (n = e.data) != null && n.uuid ? d(this, ze).forEach((r, a) => { + var o; + (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, e.data.uuid)) && a(e.data); + }) : ((i = e.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && W.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { + d(this, ve).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(W.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, d(this, ve).port.postMessage({ command: "status", data: [] }); + }); + O(this, "subscribe", (e, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", d(this, ze).set(e, n), d(this, ze).size == 1 && d(this, xt).call(this), () => this.unsubscribe(e))); + O(this, "unsubscribe", (e) => d(this, ze).delete(e)); + if (d(we, Fe)) return d(we, Fe); + } +}; +Fe = new WeakMap(), ve = new WeakMap(), ze = new WeakMap(), xt = new WeakMap(), v(we, Fe, null), O(we, "getInstance", () => (d(we, Fe) || K(we, Fe, new we()), d(we, Fe))); +let Ht = we; +const Zn = Ht.getInstance(), rn = E.forwardRef(({ listCode: t, base62params: e, className: n, theme: i, themeProps: r, layouts: a, classNames: o, onSelectionChange: s, defaultSelectedRowKeys: l, selectedRowKeys: c, onDataSourceChange: u }, p) => { + const [{ resource: h, primaryKey: g, batchOperations: y = [], itemOperations: w = [], columns: S = [], isConditionFormLayout: b = !1, isTreeSider: x, treeSiderConfig: k, theme: $, themeConfig: F, isItemGridLayout: A, itemGridLayout: { themeConfig: T, ...N } = {}, title: V, isPaginate: P, tabs: M, selectionType: D }, B] = L({ isItemGridLayout: !1, itemGridLayout: {} }), X = cr(t, e), [{ dataSource: se, itemOperationsAccess: z, condition: de, tab: G, keyword: Ft, page: dn, total: un, pageSize: pn, sider: hi, onConditionChange: mi, onTabChange: fi, onKeywordChange: yi, onPageChange: wi, onPageSizeChange: bi, onSiderChange: Ci, onReload: jt, payload: ki }, gn] = lr(X, t, g, h), Si = Sn(u); + Vn(() => { + Si(se, { page: dn, pageSize: pn, total: un }); + }, [se]); + const [hn, Ei] = Di([], { defaultValue: l ?? [], value: c }), [mn, $i] = L([]), fn = J(() => D ? mn : se, [D, mn, se]), xi = Kt(w, z, se, g), vi = Kt(y); + q(() => { + let Q = null; + return t && W.get(`/api/_/${t}`).resp(({ data: Ve, res: At }) => { + Ve != null && Ve.isDynamicRefresh && (Q = Zn.subscribe(() => jt(), At)), B(Ve); + }).catch(() => B({})), () => Q == null ? void 0 : Q(); + }, [t]), E.useImperativeHandle(p, () => ({ onReload: jt, onClickCallback: gn, getSelectedRows: fn })); + const yn = Sn((Q, Ve) => { + $i((At) => { + const wn = new Map(At.map((ue) => [ue == null ? void 0 : ue[g], ue])); + return Ve.forEach((ue) => wn.set(ue == null ? void 0 : ue[g], ue)), Q.map((ue) => wn.get(ue)).filter(Boolean); + }), Ei(Q), s == null || s(Q, Ve); + }), Pi = U(() => D ? { type: D, columnWidth: 80, selectedRowKeys: hn, onChange: yn } : void 0, [D, hn, yn]), Ni = U(() => f.merge({}, F, r), [F, r]), Ti = U(() => w == null ? void 0 : w.map((Q) => f.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [w]), Oi = U(() => ({ ...N, themeProps: T }), [N, T]); + return m(Qn, { listCode: t, title: V, classNames: o, layouts: a, resource: h, primaryKey: g, theme: i || $, themeProps: Ni, isTreeSider: x, treeSiderConfig: k, isPaginate: P, rowSelection: Pi, getSelectedRows: fn, tabs: M, isItemOperations: xi, itemOperations: Ti, isBatchOperations: vi, batchOperations: y, isItemGridLayout: A, columns: S, itemGridLayout: Oi, isConditionFormLayout: b, itemOperationsAccess: z, dataSource: se, onConditionChange: mi, onTabChange: fi, onKeywordChange: yi, onPageChange: wi, onPageSizeChange: bi, onSiderChange: Ci, condition: de, tab: G, keyword: Ft, page: dn, total: un, pageSize: pn, sider: hi, payload: ki, className: j("ff-data-list-helper", n), onReload: jt, onClickCallback: gn }); +}), ei = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : f.isArray(t) && !f.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !f.isEmpty(r.children) ? i.concat(ei(r.children, e, n)) : i), []) : [], br = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: a = 180, components: o = {}, rowSelection: s, ...l }) => { + const { classNames: c } = he(ce), u = _(null), p = _(null), [h, g] = L([]), [y, w] = L({ width: 0, height: 0 }); + q(() => { + g(ei(i, e)); + }, [i, e]), Ai(() => { + const k = new ResizeObserver(() => { + var $; + w({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); + }); + return p.current && k.observe(p.current), () => { + p.current && k.unobserve(p.current); + }; + }, []); + const S = U(() => { + if (!(y != null && y.width) || !(n != null && n.length)) return n; + const k = (s ? s.columnWidth ?? 32 : 0) + (r ? a : 0), $ = n.reduce((T, N) => T + (N != null && N.isWidthFixed && N.width ? N.width : 0), 0), F = n.filter((T) => !(T != null && T.isWidthFixed)).reduce((T, N) => T + ((N == null ? void 0 : N.width) ?? 100), 0); + if ($ + F + k >= y.width) return n; + const A = y.width - $ - k; + return n.map((T) => T != null && T.isWidthFixed ? T : { ...T, width: Math.floor(A * ((T == null ? void 0 : T.width) ?? 100) / F) }); + }, [n, y.width, s, r, a]), b = or(S), x = sr(o); + return m("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: y.height ? m(En, { bordered: !0, ...l, components: x, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { + var $, F; + const k = [...b ?? []]; + return s && k.splice((F = ($ = k[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, En.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / y.width * 100).toFixed(2)}%`, render: (A, T, N) => r(T, N) }), k; + })(), dataSource: i, size: "middle", scroll: { x: "max-content", y: y.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: h } }) : null }); +}, Cr = "RC_FORM_INTERNAL_HOOKS", kr = (t) => { + const [e, n] = E.useState({ items: [] }); + return q(() => { + t && W.get(`/api/_/${t}`).then(({ uuid: i, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, fields: h, theme: g, themeSetting: y, groups: w }) => ({ uuid: i, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: y, groups: w, items: h })).then(n); + }, [t]), e; +}, Sr = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: a = "string" }, o = null) => { + const s = _(!1), l = he(Mn), [c, u] = L(), [p, h] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(Cr) || {}; + return q(() => g == null ? void 0 : g((y, w, S) => { + if (!s.current) return; + const b = f.get(w, t); + f.isEqual(b, p) || h(ge(b, a)); + }), [p]), q(() => { + n == "javascript" && e ? Me.exec(e, {}, { getFieldValueForBasicForm: (y) => o ? o.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => h(ge(y, a))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && h(ge(e ?? l.getFieldValue(t), a)), s.current = !0); + }, [e, n]), mt(() => { + s.current && i && new kt([i, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((y) => { + u(y), console.error("布局数据转换错误: ", y, i); + }); + }, [p, i, r]), [c ?? p, p]; +}, ja = (t, e, n = null) => U(() => nn(t, e, n), [t]), ti = (t, e, n = {}, i = {}, r = {}, a = null) => { + const o = he(Mn), s = Tt(), l = _(!0), c = _([]), [u, p] = L(e), [h, g] = L(), y = oe.useWatch((w) => JSON.stringify(f.pick(w, c.current)), o) || "{}"; + return Ot(() => { + t && Me.exec(t, n, { ...i, getFieldValueForBasicForm: (w) => r ? r.getFieldValue(w) : null, getFieldValue: f.wrap(o.getFieldValue, (w, S) => (c.current.some((b) => f.isEqual(b, S)) || (c.current.push(S), s()), w == null ? void 0 : w(S))), isFieldTouched: o.isFieldTouched, isFieldsTouched: o.isFieldsTouched }).then((w) => { + l.current && (p(w), g(null)); + }).catch((w) => { + l.current && (p(e), g(w)); + }); + }, [t, y, o, n, i]), q(() => () => l.current = !1, []), t ? [a ? ge(u, a) : u, h] : [a ? ge(e, a) : e, null]; +}, Er = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => { + const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [a, o] = L(); + return q(() => { + r && le.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: $r(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(E.createElement(s.default, i))); + }, [r]), a; +}, $r = (t, e = {}, n = null) => (i) => { + const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: h, ...g } = f.merge({}, e, i), [y, w] = Sr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), S = U(() => { + const k = Object.keys((e == null ? void 0 : e.extras) || {}); + return f.over([f.partialRight(f.pick, k), f.partialRight(f.omit, k)]); + }, [e == null ? void 0 : e.extras]), [b, x] = S(g); + return m(t, { ...x, value: y, rawValue: w, $setting: Object.assign({}, o, b) }); +}, ni = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: a = [], children: o, $setting: s = {}, ...l }) => { + const [c, u] = L(); + q(() => { + t ? le.getWidgetComponent(t).then((h) => { + if (!(h != null && h.default)) throw "not found"; + return h; + }).catch((h) => ({ default: () => `${t} ${h}` })).then((h) => u(E.createElement(h.default, {}))) : u(null); + }, [t]); + const p = U(() => n == null ? void 0 : n.map((h) => ({ ...h, children: r(h, i == null ? void 0 : i.filter((g) => !(g != null && g.group) && h.key == "default" || g.group == h.key), h.key == "default" ? o : null) })).concat(a), [n, o, a]); + return c && E.cloneElement(c, { items: p, basicForm: e, $setting: { ...s, ...l } }); +}, ii = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: a = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: h, theme: g, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: S, ...b }) => { + const [x] = oe.useForm(e), k = U(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); + mt(() => (x.setFieldsValue(h), () => x.resetFields()), [h]); + const $ = (F, A, T) => { + const N = nn(A, Er, n), V = Yn(b); + return I("div", { ...V, className: j("ff-grid-layout", r), style: { ...i, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [N, T && E.cloneElement(T, { cols: a, rowHeight: o, itemMargin: l, containerPadding: s, fields: A, basicForm: n })] }); + }; + return m(oe, { ...b, fields: k, form: x, component: !1, children: g ? m(ni, { ...y, items: w, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); +}, Aa = /* @__PURE__ */ ((t) => function({ code: e, data: n, ...i }) { + const { uuid: r, resource: a, items: o, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: h, themeProps: g, groups: y } = kr(e) || {}, w = U(() => [{ name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, a]); + return a && m(t, { name: e, theme: h, themeProps: g, groups: y, ...i, fields: o, formFields: w, rowHeight: l, cols: p, itemMargin: [c, u], data: a ? { [a]: n } : n }); +})(ii), xr = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, containerPadding: a, fields: o, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: h = ($, F, A) => $, empty: g = m(zt, { description: null }), className: y, style: w = {}, theme: S, themeProps: b = {}, groups: x = [{ key: "default", label: "默认" }], rowSelection: k }) => { + const { classNames: $ } = he(ce), F = J((N) => { + if (!k) return; + const { selectedRowKeys: V = [], onChange: P, type: M = "checkbox" } = k, D = N == null ? void 0 : N[s]; + let B; + B = M === "radio" ? [D] : V.includes(D) ? V.filter((X) => X !== D) : [...V, D], P == null || P(B, l.filter((X) => B.includes(X == null ? void 0 : X[s]))); + }, [k, s, l]), A = U(() => m(ii, { groups: x, theme: S, themeProps: b, cols: n, rowHeight: i, itemMargin: r, containerPadding: a, fields: o, className: p }), [o, n, i, r, a, x, S, b]), T = f.isEmpty(l); + return I("div", { className: j("ff-data-list-content", $.content, y), style: Object.assign({}, w, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), T ? g : l.map((N, V) => { + var B; + const P = (N == null ? void 0 : N[s]) ?? V, M = `${P}-${Or(N)}`, D = h(E.cloneElement(A, { data: N }), N, V); + return E.cloneElement(D, { key: M, ...k && { isSelected: (B = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : B.includes(P), selectionType: k.type ?? "checkbox", onSelect: () => F(N) } }); + }), u == null ? void 0 : u(l)] }); +}, vr = ({ component: t, $props: e }) => { + const { base62params: n } = Nt(e, {}); + return m(te, { children: m(rn, { listCode: t, base62params: W.decode(n) }) }); +}, Ia = () => m(ri, {}), ri = () => "Empty", Pr = ({ component: t, $setting: e, $props: n }) => { + const [i, r] = L(), [a, o] = ci(n); + return q(() => { + if (!t) return r(m(ri, { description: null })); + le.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => E.createElement(s.default, { $setting: e })).then(r); + }, [t]), i ? E.cloneElement(i, { ...a, $setProps: o }) : null; +}, La = () => "NotFoundPage"; +var je, pe, Ae, ke, st, lt; +const be = class be { + constructor() { + v(this, pe, /* @__PURE__ */ new Map()); + v(this, Ae, {}); + v(this, ke, null); + O(this, "init", (e, n) => { + K(this, pe, e), K(this, Ae, n); + }); + O(this, "get", (e) => (d(this, pe).has(e) || (e = Array.from(d(this, pe).keys()).find((n) => d(this, pe).get(n).uri === e)), d(this, pe).get(e) || {})); + O(this, "redirect", (e, n, i = {}) => { + var y; + const { uri: r, type: a, widgetProps: o } = this.get(e) || {}, { router: s, query: l, ...c } = n || {}, u = Object.assign({}, c, s), p = Object.assign({}, c, l); + a == "list" && (u.base62params = W.encode(u != null && u.base62params ? u.base62params : u)); + let h = Gi(r || e, u); + const g = new URLSearchParams(); + for (const w in o || {}) ((y = o[w]) == null ? void 0 : y.type) == "query" && Object.has(p, w) && g.append(w, JSON.stringify(p[w])); + return g.size > 0 && (h = `${h}?${g.toString()}`), i != null && i.isOpenWindow ? window.open(h) : d(this, ke).navigate(h, { replace: !!(i != null && i.isReplaceRouteHistory) }); + }); + O(this, "getMenus", (e) => { + var n; + return ((n = d(this, Ae)) == null ? void 0 : n[e]) || []; + }); + O(this, "findMenuPathByUuid", (e) => { + let n = []; + for (const i in d(this, Ae)) if (n = d(this, st).call(this, d(this, Ae)[i], e, [i]), n.length > 1) return n; + return n; + }); + O(this, "getMenusByRouteUuid", (e) => d(this, lt).call(this, e, Object.values(d(this, Ae)).flat())); + v(this, st, (e, n, i = []) => { + if (f.isEmpty(e)) return i; + for (const { uuid: r, children: a } of e) { + if (r == n) return i.concat(r); + if (!f.isEmpty(a)) return i.concat(r, d(this, st).call(this, a, n)); + } + return i; + }); + v(this, lt, (e, n) => { + var r; + let i = []; + for (const a of n) a.widgetType == "redirect" && (a.uuid == e || a.widget == e ? i.push(a) : (r = a.children) != null && r.length && (i = i.concat(d(this, lt).call(this, e, a.children)))); + return i; + }); + O(this, "getCurrentMenu", () => { + const { uuid: e } = this.getCurrentRoute() || {}; + if (!e) return; + const n = this.getMenusByRouteUuid(e); + return f.isEmpty(n) ? void 0 : n[0]; + }); + O(this, "getCurrentRoute", (e = 0) => { + var i; + const n = (i = d(this, ke).state.matches[d(this, ke).state.matches.length - 1 - e]) == null ? void 0 : i.route; + if (!n) return null; + for (let [r, a] of d(this, pe)) if (a.uri === n.path) return a; + return null; + }); + O(this, "getPageParams", (e) => { + var o, s; + const { location: n = {}, matches: i = [] } = ((o = d(this, ke)) == null ? void 0 : o.state) || {}, r = { ...((s = i[i.length - 1]) == null ? void 0 : s.params) || {} }, a = n.search; + return a && new URLSearchParams(a).forEach((l, c) => { + r[c] = l; + }), e ? f.get(r, e) : r; + }); + O(this, "usePageParams", (e) => { + var i; + let n = Bn() ? { ...Yi(), ...Object.fromEntries(new URLSearchParams(((i = Xi()) == null ? void 0 : i.search) ?? "")) } : this.getPageParams(); + return e ? f.get(n, e) : n; + }); + O(this, "createBrowserRouter", (e = {}) => { + if (d(this, pe).size == 0) return null; + if (d(this, ke)) return d(this, ke); + const n = qe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = qe.get(le.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, a = (s, l) => () => Promise.all([le.getWidgetComponent(s), Nt(l)]).then(([c, u]) => [c.default || function() { + return `${s}`; + }, u]).then(([c, u]) => ({ Component: () => E.createElement(Un, {}, E.createElement(c, { $setting: u })) })), o = Array.from(d(this, pe).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: h, widgetSetting: g, widgetProps: y, isLogin: w, isLayout: S, extra: b }) => { + let x = {}, k = 0; + switch (p) { + case "list": + x.element = E.createElement(vr, { component: h, $props: y }); + break; + case "fsdpf-component": + x.element = E.createElement(Pr, { key: h, component: h, $setting: g, $props: y }); + } + const $ = (b == null ? void 0 : b.theme) ?? (b == null ? void 0 : b.layout); + if ($) { + const F = (b == null ? void 0 : b.themeProps) ?? (b == null ? void 0 : b.layoutProps); + if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: a($, F), children: [{ path: c, ...x }] }]; + k = r[$]; + } + return S && k > -1 ? (s[k].children.push({ path: c, ...x }), s) : [...s, { path: c, ...x }]; + }, [{ path: "/", lazy: a(n, {}), children: [] }]); + return o.push({ index: !0, element: E.createElement(Nr, { to: i, replace: !0 }) }), K(this, ke, Qi(o, e)); + }); + if (d(be, je)) return d(be, je); + } +}; +je = new WeakMap(), pe = new WeakMap(), Ae = new WeakMap(), ke = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), v(be, je, null), O(be, "getInstance", () => (d(be, je) || K(be, je, new be()), d(be, je))); +let _t = be; +const Nr = ({ to: t, replace: e }) => Bn() ? E.createElement(Zi, { to: t, replace: e }) : (window.document.location = t, "redirect"), ae = _t.getInstance(), Ke = new Worker(new URL("/ff-worker/index.js", self.location)), Nn = { generateUUID: () => jr(), getConfigure: (t) => qe.get(t), route: { redirect: (...t) => ae.redirect(...t), getPageParams: (...t) => ae.getPageParams(...t), getCurrentRoute: () => ae.getCurrentRoute() }, popup: { notification: (...t) => re.notification(...t), success: (...t) => re.success(...t), error: (...t) => re.error(...t), form: (...t) => re.form(...t), modal: (...t) => re.modal(...t), confirm: (...t) => re.confirm(...t) } }; +var vt, Ye, Ie; +const H = class H { + constructor() { + O(this, "exec", (e, n = {}, i = {}, r = "") => new Promise((a, o) => { + if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return a(); + const s = kn(H, vt)._++; + d(H, Ye).set(s, i), H.mQueue.set(s, [a, o]), Ke.postMessage({ id: s, session: r, category: "eval", method: e, args: n }); + })); + O(this, "clear", (e) => Ke.postMessage({ session: e, category: "clear" })); + if (d(H, Ie)) return d(H, Ie); + Promise.resolve().then(() => sa).then((e) => { + Nn.http = e.http; + }), Ke.addEventListener("message", ({ data: { id: e, task_id: n, method: i, args: r, category: a, data: o, error: s, session: l } }) => { + if (a === "eval" && H.mQueue.has(e)) s !== null ? H.mQueue.get(e)[1](s) : H.mQueue.get(e)[0](o), d(H, Ye).delete(e), H.mQueue.delete(e); + else if (a === "util") try { + const c = f.get(Nn, i.split("/")) || f.get(d(H, Ye).get(n), i.split("/")); + if (!f.isFunction(c)) throw `${i} not found`; + Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => { + Ke.postMessage({ id: e, task_id: n, category: a, method: i, args: r, session: l, data: u, error: null }); + }).catch((u) => { + Ke.postMessage({ id: e, task_id: n, category: a, method: i, args: r, session: l, data: null, error: u }); + }); + } catch (c) { + Ke.postMessage({ id: e, task_id: n, category: a, method: i, args: r, session: l, data: null, error: c }); + } + }, !1); + } +}; +vt = new WeakMap(), Ye = new WeakMap(), Ie = new WeakMap(), O(H, "mQueue", /* @__PURE__ */ new Map()), v(H, vt, 0), v(H, Ye, /* @__PURE__ */ new Map()), v(H, Ie, null), O(H, "getInstance", () => (d(H, Ie) || K(H, Ie, new H()), d(H, Ie))); +let Jt = H; +const Me = Jt.getInstance(), Tn = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { + switch (`${t}`.toLowerCase()) { + case "0": + case "false": + case "[]": + case "{}": + return !1; + } + return !!t; +}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, ge = (t, e) => { + let n = "string"; + n = Array.isArray(t) ? "array" : typeof t, f.isObject(t) && (n = "json"); + const i = `${n}2${e}`; + return Reflect.has(Tn, i) ? Tn[i](t) : t; +}, Tr = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, Nt = (t = {}, e = {}, n = {}, i = "") => ai(t, (r, a) => a === "type" && r === "code") ? oi(t, e, n, i) : si(t, e, i), ai = (t, e = () => !1) => f.some(t, (n) => !!f.some(n, e) || (f.isEmpty(n) || !f.isPlainObject(n) && !f.isArray(n) ? void 0 : ai(n, e))), oi = async (t = {}, e = {}, n = {}, i = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let a in t) { + let o; + if (Reflect.has(t[a], "type") && ["code", "field", "router", "query", "string"].includes(t[a].type)) { + const { type: s, value: l = "", default: c = i } = t[a]; + switch (s) { + case "code": + try { + o = await Me.exec(l, e, n); + } catch (u) { + console.error("getWidgetPropsData", u); + } + break; + case "field": + o = f.get(e, l) ?? f.get(e, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + o = ae.getPageParams(l); + break; + case "string": + o = l; + } + o ?? (o = c); + } else o = await oi(t[a], e, n, i); + f.set(r, a, o); + } + return r; +}, si = (t = {}, e = {}, n = "") => Object.keys(t || {}).reduce((i, r) => { + if (f.isPlainObject(t[r])) { + let a; + if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) { + const { type: o, value: s = "", default: l = n } = t[r]; + switch (o) { + case "field": + a = f.get(e, s) ?? f.get(e, s.substring(s.indexOf(".") + 1)); + break; + case "router": + case "query": + a = ae.getPageParams(s); + break; + case "string": + a = s; + } + a ?? (a = l); + } else a = si(t[r], e, n); + f.set(i, r, a); + } + return i; +}, {}), Lt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((n) => Lt(n, e)) : Object.keys(t).reduce((n, i) => (e[i] ? n[e[i]] = Lt(t[i], e) : n[i] = Lt(t[i], e), n), {}) : t, Ma = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { + const e = 16 * Math.random() | 0; + return (t === "x" ? e : 3 & e | 8).toString(16); +}), Va = (t) => { + var e, n; + return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.name : ""; +}, Da = (t) => { + var e, n; + return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.category : ""; +}, Wa = (t) => { + var e, n; + return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.owner : ""; +}, Or = (t, e = 32, n = "auto") => { + const i = Gt(t), r = n === "auto" ? "x64" : n; + if (e === 32) return It.x86.hash32(i).toString(); + if (e === 128) return r === "x64" ? It.x64.hash128(i) : It.x86.hash128(i); + throw new Error("bits 只能是 32 或 128"); +}, Gt = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Gt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Gt(t[e])}`).join(",") + "}" : String(t), Rr = () => { + let t = 1; + const e = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Map(); + return (...i) => i.length === 0 ? "" : i.map((r) => { + return String((a = r) === null || typeof a != "object" && typeof a != "function" ? (n.has(a) || n.set(a, t++), n.get(a)) : (e.has(a) || e.set(a, t++), e.get(a))); + var a; + }).join("::"); +}, Fr = (t) => { + if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; + try { + let e = t.startsWith("//") ? `http:${t}` : t; + return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname; + } catch { + return !1; + } +}, Ba = (t, e = "") => { + if (!t || typeof t != "string" || Fr(t)) return t; + let n = e; + return !n && typeof window < "u" && window.location && (n = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? n ? `${n}${t}` : t : n ? `${n}/${t}` : t; +}, jr = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : typeof crypto < "u" && crypto.getRandomValues ? "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)) : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { + const e = 16 * Math.random() | 0; + return (t === "x" ? e : 3 & e | 8).toString(16); +}), Tt = () => { + const t = _(!0), [, e] = E.useReducer((n) => n + 1, 0); + return q(() => () => t.current = !1, []), () => t.current && e(); +}, za = (t) => { + const [e, n] = L(t), i = _(null), r = J((a, o) => { + i.current = o, n(a); + }, []); + return q(() => { + i.current && (i.current(e), i.current = null); + }, [e]), [e, r]; +}, mt = (t = (i) => { +}, e, n = f.isEqual) => { + const i = E.useRef(); + n(e, i.current) || (i.current = f.cloneDeep(e)), E.useEffect(t, [i.current]); +}, Ot = mt, li = (t, e = "string") => { + var n; + if (!Array.isArray(t)) return t; + for (let i = 0; i < t.length; i++) t[i].value = ge((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = li(t[i].children, e)); + return t; +}, Ua = (t, e = "json", n = "string", i, r = null) => { + const [a] = oe.useForm(i), [o, s] = L([{ label: "无", value: "", disabled: !0 }]), l = _([]), c = oe.useWatch((u) => l.current.length === 0 ? null : f.pick(u, l.current), a) || null; + return q(() => { + Array.isArray(t) ? s(t) : e === "javascript" && t ? Me.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), a.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : a.getFieldValue(u)) }).then((u) => { + s(ge(u, "array")); + }).catch((u) => console.error("useOptions", u)) : t && s(ge(t, "array")); + }, [t, e, c]), li(o, n); +}, qa = (t) => { + const [e, n] = L(), i = { type: "GET" }; + if (typeof t == "string" ? i.url = t : f.isPlainObject(t) && Object.assign(i, t), !(i != null && i.url)) throw "url is required"; + const r = (a) => W.request(i, !1).resp((o) => (console.log("useSubscribeRequest", a), n(o), o)); + return mt(() => { + let a = null; + return r().then((o) => { + a = Zn.subscribe(f.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); + }), () => a == null ? void 0 : a(); + }, i), e; +}, Ar = (t, e) => J((n) => { + const i = {}; + for (const [r, a] of Object.entries(n)) { + const o = t == null ? void 0 : t[r]; + if ((o == null ? void 0 : o.type) === "router" || (o == null ? void 0 : o.type) === "query") { + const s = ae.getCurrentRoute(); + s != null && s.uuid && ae.redirect(s.uuid, { ...ae.getPageParams(), [o.type]: { [o.value || r]: a } }, { isReplaceRouteHistory: !0 }); + } else i[r] = a; + } + Object.keys(i).length > 0 && e(i); +}, [t, e]), ci = (t, e = {}, n = {}, i = []) => { + const [r, a] = L({}), [o, s] = L({}), l = Dn(o), c = ae.usePageParams(); + en(() => { + Promise.resolve(Nt(t, e, n)).then(s); + }, [t, e, c, ...i]), Vn(() => { + const h = l ?? {}, g = Object.keys({ ...h, ...o }).reduce((y, w) => (h[w] !== o[w] && (y[w] = o[w]), y), {}); + Object.keys(g).length > 0 && a((y) => ({ ...y, ...g })); + }, [o]); + const u = Ar(t, (h) => { + a((g) => ({ ...g, ...h })); + }), p = U(() => Object.fromEntries(Object.entries(r).filter(([h, g]) => g !== o[h])), [r, o]); + return [r, u, p]; +}, Ir = (t) => { + const [e, n] = E.useState({ items: [], hides: [] }); + return E.useEffect(() => { + t && W.get(`/api/_/${t}`).then(({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: h, listenChangeFieldsFunc: g, fields: y, theme: w, themeSetting: S, groups: b }) => ({ pk: i, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: w, themeProps: S, groups: b, listenChangeFields: h, listenChangeFieldsFunc: g, ...y.reduce((x, k) => { + var $; + return ($ = k == null ? void 0 : k.field) != null && $.hidden ? x.hides.push(k == null ? void 0 : k.field) : x.items.push(k), x; + }, { items: [], hides: [] }) })).then(n); + }, [t]), e; +}, Lr = ({ max: t = 0, min: e = 0, type: n = "", message: i, pattern: r, required: a = !1, validator: o } = {}, s, l) => { + const [c, u] = L([]); + return q(() => { + const p = []; + if (a) { + let h = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + h = "boolean"; + break; + case "json": + h = "object"; + } + p.push({ type: h, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (n) { + case "string": + p.push({ type: n, max: t, min: e, message: i || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); + break; + case "pattern": + p.push({ type: "string", pattern: r, message: i }); + break; + case "validator": + o && p.push(({ getFieldValue: h }) => ({ validator: async (g, y) => { + const w = await Me.exec(o, { value: y, fieldName: s }, { getFieldValue: h }); + return f.isString(w) && w ? Promise.reject(w) : f.isBoolean(w) && !w ? Promise.reject(i) : Promise.resolve(); + } })); + } + u(p); + }, [t, e, n, i, r, a, o]), c; +}, Mr = (t, e, n) => { + const [i, r] = L(null); + return q(() => { + const { initDataUri: a = `/api/${t}`, initDataMethod: o = "GET" } = n || {}; + e && W.request({ method: o, url: f.trimEnd(`${a}/${e}`, "/") }).then((s) => { + r(s); + }); + }, [t, e, n]), i; +}, Vr = (t, e, n) => J((i, r = { serialize: (a) => a, onSuccess: () => { +}, onFail: (a) => (a == null ? void 0 : a.errorFields) && re.error("请先完善表单信息", { duration: 2e3 }) }) => { + const a = i.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${t}`, submitDataMethod: s = "POST" } = n || {}; + return i.validateFields().then((l) => a ? f.pick(l, [a]) : l).then(r.serialize).then((l) => W.request({ method: s, url: f.trimEnd(`${o}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); +}, [t, e, n]), Dr = (t, e, n, i) => { + const r = Mr(e, n, i); + q(() => { + r ? t.setFieldsValue(r) : t.resetFields(); + }, [t, r]); + const a = Vr(e, n, i); + return f.partial(a, t); +}, Wr = (t, e, n = [], i = {}) => { + const r = _({}), a = _(), o = f.debounce(Tt(), 180), s = ["disabled", "required"], l = (h, g) => { + s.includes(h) && (r.current[h] = g), o(); + }, c = U(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = ti(e, -1, {}, c, i); + if (!p && a.current != u && (u >= 0 || !f.isEmpty(n == null ? void 0 : n[u]))) { + a.current = u; + const { widget: h, widgetPrefix: g, props: y } = n == null ? void 0 : n[u]; + t = Hn(h, g), r.current = f.merge(y, f.pick(r.current, s)); + } + return [t, r.current]; +}, On = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Ka = ({ value: t, onChange: e }, n = null) => { + const i = _(), [r] = oe.useForm(n), a = _({}); + return Ot(() => { + f.isEqual(i.current, t) || r.setFieldsValue(t); + }, [t]), q(() => () => r.resetFields(), []), [U(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { + const l = On(o); + s ? a.current[l] = s : delete a.current[l]; + } }, scrollToField: (o, s = {}) => { + console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); + }, focusField: (o) => { + console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); + }, getFieldInstance: (o) => { + const s = On(o); + return a.current[s]; + } }, [r]), (o, s) => { + i.current = s, e == null || e(s); + }]; +}, an = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...a }) => { + const o = Hn(t, e), [s, l] = Wr(o, n, i, r), [c, u] = L(); + return q(() => { + s && le.getWidgetComponent(s).then(({ defaultProps: p = {}, default: h }) => ({ default: Br(h, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(E.createElement(p.default, a))); + }, [s]), c && E.cloneElement(c, { ...a, ...l }); +}, Br = (t, e = {}, n = null) => (i) => { + const { type: r, code: a, label: o, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: h, help: g, isVirtual: y, $isReserved: w, initialValue: S, initialValueLanguage: b, ...x } = f.omit(f.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Lr(Object.assign({}, h, u ? { required: !0 } : {}), a, r), $ = U(() => { + const V = Object.keys((e == null ? void 0 : e.extras) || {}); + return f.over([f.partialRight(f.pick, V), f.partialRight(f.omit, V)]); + }, [e == null ? void 0 : e.extras]), [F, A] = $(x), T = { label: o, noStyle: s, style: l, colon: !1, layout: "vertical" }, N = J((V) => V == null ? void 0 : ge(V, r), [r]); + return m(Zt, { name: a, rules: k, initialValue: N(S), normalize: N, children: (V, P, M) => { + var D; + return m(t, { type: r, rcform: M, basicForm: n, itemProps: { validateStatus: P.errors.length > 0 ? "error" : "success", tooltip: g || null, help: P.errors.length > 0 ? P.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...T }, fieldProps: { placeholder: c, ...A, ...V }, $setting: Object.assign({}, p, F) }); + } }); +}, on = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: a = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: h = {}, formFields: g = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: S, theme: b, themeProps: x = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { + const [A] = oe.useForm(e), T = J((P, M) => { + S == null || S(P, M), w && Array.isArray(y) && Me.exec(w, { changedValues: P, allValues: M }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); + }, [t, A, S, y, w]), N = U(() => [{ name: "__PROPS__", value: h }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, h, g]), V = (P, M, D) => { + const B = nn(M, an, n), X = Yn(F); + return I("div", { ...X, className: j("ff-grid-layout-form", r), style: { ...i, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [B, D && E.cloneElement(D, { cols: a, rowHeight: o, itemMargin: s, containerPadding: l, fields: M, basicForm: n })] }); + }; + return I(oe, { ...F, form: A, fields: N, onValuesChange: T, children: [b ? m(ni, { ...x, items: k, theme: b, itemRender: V, fields: c, children: $, basicForm: n }) : V(0, c, $), u == null ? void 0 : u.map((P) => { + var M; + return m(Zt, { name: P.code, children: m(zr, { form: A, basicForm: n, name: P.code, type: P.type, initialValue: P.initialValue, initialValueLanguage: (M = P.extras) == null ? void 0 : M.initialValueLanguage }) }, JSON.stringify(P.code)); + })] }); +}, zr = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { + const [a, o] = ti(n == "javascript" && e, n == "javascript" ? void 0 : e, {}, {}, r); + return q(() => { + n == "javascript" ? i(ge(a, t)) : e && i(ge(e, t)); + }, [t, e, a]), null; +}; +on.propTypes = { fields: C.array, hides: C.array }; +const Ur = /* @__PURE__ */ ((t) => ({ code: e, isPreview: n = !1, ...i }) => { + const { align: r, autoComplete: a, resource: o, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: h, listenChangeFields: g, listenChangeFieldsFunc: y, pk: w, uuid: S, theme: b, themeProps: x, groups: k } = Ir(e), $ = U(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }], [w, e, S, o]); + return m(t, { name: e, autoComplete: a, theme: b, themeProps: x, groups: k, ...i, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: y, fields: s, hides: l, cols: h, rowHeight: c, itemMargin: [u, p] }); +})(on), di = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...a }) => { + const [o] = oe.useForm(), s = Dr(o, i, r, t); + return m(te, { actions: I(E.Fragment, { children: [m(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), m(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: n, children: m(Ur, { form: o, code: i, primaryKey: r, ...a }) }); +}, Rn = /* @__PURE__ */ new Set(), Yt = (t = [], e = 0) => { + const n = t[e]; + if (n.length && !Rn.has(n)) { + const i = document.createElement("script"); + i.setAttribute("src", n), i.setAttribute("data-namespace", n), t.length > e + 1 && (i.onload = () => { + Yt(t, e + 1); + }, i.onerror = () => { + Yt(t, e + 1); + }), Rn.add(n), document.body.appendChild(i); + } +}, St = ({ className: t, type: e, style: n = {}, ...i }) => m("span", { role: "img", className: j("ff-iconfont", t), style: n, ...i, children: m("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: m("use", { xlinkHref: `#${e}` }) }) }); +St.propTypes = { className: C.string, type: C.string.isRequired, style: C.object }, St.init = Yt; +const qr = (t, e, n, i) => ae.redirect(n, e, i), Kr = (t, e = {}, n, i = {}) => { + var a; + const r = (a = i.router) == null ? void 0 : a.reduce((o, [s, l, c]) => { + const u = f.get(e, ["router", s]); + if (!u && u !== 0 && l) throw `请传入 ${c}`; + return `${o}/${u}`; + }, `/api/${n}`); + return W.del(r, e.param).msg(); +}, Fn = (t, e, n, { status: { loading: i, disabled: r }, setStatus: a, listFn: o }) => { + const s = { loading: (l) => l === void 0 ? i : a((c) => ({ ...c, loading: l })), disabled: (l) => l === void 0 ? r : a((c) => ({ ...c, disabled: l })), list: o }; + return f.isFunction(n) ? n.call(null, e, s) : f.isString(n) && n ? Me.exec(n, e, s) : null; +}, jn = (t, e, n, i, r) => f.isString(n) && n ? le.getWidgetComponent(n).then(({ default: a }) => re.modal(a, { ...e, $setting: i }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r)).catch((a) => { + re.error(n, { content: a.toString() }); +}) : re.modal(n, { ...e, $setting: i }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r), Hr = (t, e, n, i, r) => re.modal(di, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r), _r = (t, e, n, i, r) => re.modal(rn, { base62params: e, $setting: i, listCode: n }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r), Jr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s } = {}) => { + const l = he(ce), [c, u] = L({ leading: !0, trailing: !1 }), p = U(() => { + switch (e) { + case "redirect": + return f.partialRight(qr, t, r); + case "func": + return f.partialRight(Fn, (r == null ? void 0 : r.code) ?? t, { status: c, setStatus: u, listFn: l }); + case "component": + case "fsdpf-component": + return f.partialRight(jn, t, r, a); + case "grid-layout-form": + return f.partialRight(Hr, t, r, a); + case "data-list": + return f.partialRight(_r, t, r, a); + case "destroy": + return f.partialRight(Kr, t, r, a); + default: + if (ln(t) || E.isValidElement(t)) return f.partialRight(jn, t, r, a); + if (f.isFunction(t)) return f.partialRight(Fn, (r == null ? void 0 : r.code) || t, { status: c, setStatus: u }); + } + return (...h) => console.error("useButton unknown widgetType", e, ...h); + }, [t, e, l.getBase62params, l.getSelectedRows]); + return [f.debounce((h) => (s == null || s(h), Promise.resolve(Nt(i, h, { list: l })).then((g) => p(h, { ...n, ...g })).then((g) => o == null ? void 0 : o(g)).catch(console.error)), 300, { leading: !0, trailing: !1 }), c]; +}, ui = ({ type: t, name: e, className: n, icon: i, iconPosition: r, size: a }, o = "default") => U(() => { + const s = { type: "primary", className: j("ff-button", n), iconPosition: r, size: a }; + return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), o === "link" || o === "dashed" ? (s.type = o, t === "default" && (s.className = j(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), i && (s.icon = m(St, { type: i })), e && (s.children = e), s; +}, [o, t, n, i, r]), Rt = ({ data: t, widget: e, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: c, extras: u }) => { + const p = he(ce), [h, g] = L(!1), [y, w] = L("hover"), [S, b] = ci(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [x, k] = L(), { placement: $, align: F, zIndex: A, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: V = !0, ...P } = o || {}; + q(() => { + n == "grid-layout-form" ? k(E.createElement(di, { ...i, $setting: a, code: e })) : n == "data-list" ? k(E.createElement(rn, { base62params: t, $setting: a, listCode: e })) : f.isString(e) ? le.getWidgetComponent(e).then(({ default: B }) => { + k(E.createElement(B, { ...i, $setting: a })); + }).catch((B) => k(B.toString())) : E.isValidElement(e) ? k(E.cloneElement(e, { ...i, $setting: a })) : (ln(e) || f.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(E.createElement(e, { ...i, $setting: a })); + }, [e, n, i]); + const M = (B, X = !1) => (g(B), !B && w("hover"), B ? l == null ? void 0 : l(S) : s == null ? void 0 : s(X)), D = (B) => { + g(!0), w("click"); + }; + return m(qi, { zIndex: A, placement: $, onPopupClick: D, onClick: D, open: h, align: F, arrow: T, trigger: y, getPopupContainer: N || V ? void 0 : (B) => B, content: m(Gr, { ...P, extras: u, children: x && E.cloneElement(x, { ...S, $setProps: b, $close: (B) => M(!1, B) }) }), children: c, onOpenChange: M }); +}, Gr = ({ title: t, className: e, classNames: n, children: i, extras: r, width: a, height: o, ...s }) => { + const [l, c] = L({}), u = J((y, w) => c((S) => ({ ...S, [y]: w })), []), p = J((y) => c((w) => ({ ...w, [y]: void 0 })), []), h = t ? E.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? E.createElement("div", { className: "ff-popup-reserved-extras" }, r); + return m(ht.Provider, { value: { ele: l, mount: u, unmount: p }, children: I("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: a ?? 260, height: o }, ...s, children: [I("div", { className: j("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [h, l == null ? void 0 : l["sub-title"]] }), m("div", { className: j("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); +}; +Rt.propTypes = { widgetType: C.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const ft = (t) => function({ className: e, variant: n, children: i, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: h, disabled: g, tooltip: y, confirm: w, widget: S = () => { +}, widgetType: b, widgetData: x, widgetProps: k, widgetSetting: $, widgetContainerProps: F, ...A }) { + const { mode: T, ...N } = F || {}, V = ui({ className: e, name: r, type: o, icon: a, iconPosition: s }, n ?? t), P = m(Ct, { ...V, ...A, children: i || r }); + if (T === "popover" && !["destroy", "redirect", "func"].includes(b)) return m(Rt, { data: p, widget: S, widgetType: b, widgetData: x, widgetProps: k, widgetSetting: $, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: P }); + const M = f.isEmpty(y) || !y.enabled ? {} : y, D = f.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [B, X] = L(!1), [se, { disabled: z, loading: de }] = Jr({ widget: S, widgetType: b, widgetData: x, widgetProps: k, widgetSetting: $, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); + return m(Ki, { okText: "确定", cancelText: "取消", getPopupContainer: (G) => G, ...D, disabled: z || g, open: B, onOpenChange: (G) => { + if (!G) return X(G); + D.enabled ? X(G) : se(p); + }, onConfirm: (G) => { + se(p, G); + }, onClick: (G) => { + G.stopPropagation(); + }, children: m(Hi, { getPopupContainer: (G) => G, ...M, title: B ? null : M == null ? void 0 : M.title, trigger: ["hover", "click"], children: E.cloneElement(P, { loading: de || h, disabled: z || g }) }) }); +}, R = ft("default"); +R.propTypes = { type: C.oneOf(["primary", "default", "danger", ""]), size: C.oneOf(["large", "middle", "small"]), name: C.string, icon: C.string, iconPosition: C.oneOf(["start", "end"]), data: C.any, widget: C.any, widgetType: C.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: C.object, widgetProps: C.object, widgetSetting: C.object, widgetContainerProps: C.object, tooltip: C.exact({ title: C.string.isRequired, placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func }), confirm: C.exact({ title: C.string.isRequired, cancelText: C.string, okText: C.string, okType: C.oneOf(["primary", "default", "danger", ""]), placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func, arrow: C.oneOfType([C.bool, C.exact({ pointAtCenter: C.bool })]) }) }; +const Yr = ft("link"), Xr = ft("circle"), Qr = ft("round"), Zr = ft("dashed"), An = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (g, y, w) => { +}, onBeforeClick: i = (g, y, w) => { +}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: c = (g, y) => m(R, { ...g, data: y }, g.uuid || Dt()), widgetContainerProps: u = {}, children: p, data: h }) => { + if (f.isEmpty(t)) return p; + l ?? (l = a), s ?? (s = r); + const [g, y] = U(() => (t || []).reduce((b, x) => { + const k = e.indexOf(x.widgetType); + return k === -1 ? b[1].push(x) : b[0] ? k < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = x) : b[1].push(x) : b[0] = x, b; + }, [null, []]), [t, e]); + o ? p = o(g, h) || p : p || (p = m(Ct, { ...ui(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: a }), r) })); + const w = y.map((b) => c(Object.assign({ uuid: b.uuid, type: b.type, name: b.name, widget: b.widget, widgetType: b.widgetType, widgetProps: b.widgetProps, widgetData: b.widgetData, widgetSetting: b.widgetSetting, widgetContainerProps: b.widgetContainerSetting, confirm: b.confirm, onAfterClick: f.partialRight(n, b, h), onBeforeClick: f.partialRight(i, b, h) }, { size: l, variant: s }), h)); + let S = w; + return (w == null ? void 0 : w.length) > 1 && (S = s == "link" ? m(Bt, { split: m(_i, { type: "vertical" }), size: l, children: w }) : m(Bt.Compact, { size: l, children: w })), g ? m(Rt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: h, widgetData: g == null ? void 0 : g.widgetData, extras: S, onAfterClick: f.partialRight(n, g, h), onBeforeClick: f.partialRight(i, g, h), children: p }) : S; +}; +An.propTypes = { triggerWeights: C.array, options: C.arrayOf(C.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: C.func, btnVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: C.func, labelSize: R.propTypes.size, onAfterClick: C.func, onBeforeClick: C.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = Yr, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Xr, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Qr, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = Zr, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = Rt, R.GroupPopover = An; +const ea = ({ fields: t, formProps: e, $close: n }) => { + const [i] = oe.useForm(), r = U(() => [{ name: "__PROPS__", value: e }], [e]); + return m(te, { actions: I(E.Fragment, { children: [m(R, { name: "取消", widget: () => n(!1) }), m(R, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: m(oe, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: a, ...o }) => m(an, { code: a, ...o }, a)) }) }); +}, ta = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: a, actions: o, extras: s, ...l }) => I(er, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [I("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [m("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: m(tn, { type: "close" }) }), r, a] }), m("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, o] })] }), na = ({ className: t, classNames: e, $close: n, $event: i, children: r, title: a, subTitle: o, actions: s, extras: l, placement: c, ...u }) => { + const { style: p, rest: h } = ((y, w = ["height", "width", "style"]) => { + const S = { ...y }, b = {}; + for (const x of w) x === "style" ? Object.assign(b, S.style) : S[x] !== void 0 && (b[x] = S[x]), delete S[x]; + return { style: b, rest: S }; + })(u), g = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; + return m(tr, { ...h, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => I(E.Fragment, { children: [m("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: h.onClose, children: m(tn, { type: "close" }) }), I("div", { className: j("ff-modal-content"), style: p, children: [I("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [a, o] }), m("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), I("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] })] }) }); +}, pi = ({ placement: t, $close: e, $event: n, children: i, title: r, ...a }) => { + const [o, s] = L({}), [l, c] = L(!0), u = J((y, w) => s((S) => ({ ...S, [y]: w })), []), p = J((y) => s((w) => ({ ...w, [y]: void 0 })), []); + let h = { ...a, className: o.rootClassName, title: o.title || r && E.createElement("div", { className: j("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: i, $close: e, $event: n, onClose: () => c(!1) }; + const g = () => { + e(!1); + }; + return m(ht.Provider, { value: { ele: o, mount: u, unmount: p }, children: t && t !== "center" ? m(ta, { ...h, placement: t, open: l, afterOpenChange: (y) => !y && g() }) : m(na, { ...h, visible: l, afterClose: g }) }); +}; +pi.propTypes = { placement: C.oneOf(["center", "left", "top", "right", "bottom"]) }; +const ia = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { + const [r, a] = L(e || {}), o = Dn(e); + en(() => { + const l = o ?? {}, c = e ?? {}, u = Object.keys({ ...l, ...c }).reduce((p, h) => (l[h] !== c[h] && (p[h] = c[h]), p), {}); + Object.keys(u).length > 0 && a((p) => ({ ...p, ...u })); + }, [e]); + const s = J((l) => { + a((c) => ({ ...c, ...l })), i == null || i(l); + }, [i]); + return E.isValidElement(t) ? E.cloneElement(t, { ...r, $close: n, $setProps: s }) : t != null && t.name || $n.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === $n.ForwardRef ? E.createElement(t, { ...r, $close: n, $setProps: s }) : t; +}, ie = () => { + const [t, e] = Ii({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (a) => { + const { offsetHeight: o } = a; + return { height: o }; + }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, n] = E.useReducer((a) => a + 1, 0); + q(() => { + ie.$onClick = i, ie.$queue.forEach(([a, o, s], l, c) => { + r([o, s], ...a), delete c[l]; + }); + }, []); + const i = (a, o = {}, s = {}) => new Promise((l, c) => r([l, c], a, o, s)), r = ([a, o], s, l = {}, c = {}) => { + const u = ie.$index++, p = (y) => ((w, S) => (ie.$popups.delete(w), n(), S == null ? void 0 : S()))(u, () => a(y)); + if (s === qn) return t.open({ ...c, key: u, content: E.createElement(s, { ...l, $close: () => t.close(u) }) }); + const { $setProps: h, ...g } = l; + ie.$popups.set(u, E.createElement(pi, { maskClosable: !1, $event: g == null ? void 0 : g.$event, ...c, key: u, $close: p }, E.createElement(ia, { widget: s, widgetProps: g, $close: p, onSetProps: h }))), n(); + }; + return I(E.Fragment, { children: [Array.from(ie.$popups).map(([a, o]) => o), e] }); +}; +ie.$popups = /* @__PURE__ */ new Map(), ie.$index = 0, ie.$queue = [], ie.$onClick = (...t) => new Promise((e, n) => { + ie.$queue.push([t, e, n]); +}); +const In = (t, e, n = {}) => ie.$onClick(t, e, n), Mt = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => ie.$onClick(qn, { content: t, ...i }, { showProgress: e, duration: n }), re = { modal: In, confirm: (t, e = {}) => ie.$onClick(nr, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => In(ea, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { + if (i === !1) throw !1; + return i; +}), notification: Mt, success: (t, e = { duration: 1.5 }) => Mt(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => Mt(t, { ...e, className: "ff-notification-error", icon: "close" }) }; +tt.configure({ showSpinner: !1 }); +const gi = () => { + const t = window.localStorage.getItem(bt); + return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); +}; +De.interceptors.request.use((t) => (Object.assign(t.headers, gi()), tt.inc(), t), (t) => (tt.done(), Promise.reject({ code: -1, msg: t }))), De.interceptors.response.use(({ data: t, headers: e }) => (tt.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { + return tt.done(), Promise.reject(t.message); +}), window.addEventListener("unhandledrejection", Wt.onUnhandledRejection), Wt.onMsg = (t, e) => re[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && ae.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); +var Xe, Ue, Qe; +const Z = class Z { + constructor() { + O(this, "appUrl", ""); + v(this, Xe, null); + return d(Z, Ue) || (K(Z, Qe, new Wt()), K(Z, Ue, new Proxy(this, { get(e, n) { + if (n in e) { + const i = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), n); + return i != null && i.get ? Reflect.get(e, n, e) : typeof e[n] == "function" ? e[n].bind(e) : e[n]; + } + return d(Z, Qe)[n]; + } }))), d(Z, Ue); + } + init(e, n, i) { + De.defaults.baseURL = this.appUrl = i, De.defaults.timeout = 15e3, d(Z, Qe).init(e, n, De); + } + get driver() { + return De; + } + get headers() { + return gi(); + } + mock(e = {}) { + return d(this, Xe) ?? K(this, Xe, new Mi(De, { onNoMatch: "passthrough", ...e })); + } + unmock() { + var e; + (e = d(this, Xe)) == null || e.restore(), K(this, Xe, null); + } +}; +Xe = new WeakMap(), Ue = new WeakMap(), Qe = new WeakMap(), v(Z, Ue), v(Z, Qe), O(Z, "getInstance", () => d(Z, Ue) ?? K(Z, Ue, new Z())); +let Xt = Z; +const W = Xt.getInstance(); +class sn extends Error { + constructor(e, n) { + super(n), Error.captureStackTrace && Error.captureStackTrace(this, sn), !n instanceof nt && (this.name = `${e} Error Runtime`); + } +} +class nt extends Error { + constructor(e, ...n) { + super(...n), Error.captureStackTrace && Error.captureStackTrace(this, nt), this.name = `${e} Not Found`; + } +} +const Vt = "mine", bt = "token"; +var Le, Ze; +const Ce = class Ce { + constructor() { + v(this, Ze, /* @__PURE__ */ new Map()); + O(this, "setVendor", (e, n) => d(this, Ze).set(e, new zn(n, async (i, r) => { + var o, s; + if (!(i != null && i.default)) throw "@pkg not found"; + let a = () => r; + switch ("function") { + case typeof (a = (o = i.default) == null ? void 0 : o[`./${r}/index.jsx`]): + case typeof (a = (s = i.default) == null ? void 0 : s[`./${r}/index.js`]): + return a(); + } + throw new nt(r); + }))); + O(this, "getWidgetComponent", async (e) => { + if (!e) throw "getWidgetComponent widget is required"; + if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); + const [, n] = e == null ? void 0 : e.split("@pkg/"); + if (!n) throw new nt(e); + try { + return d(this, Ze).has("pkg") ? await d(this, Ze).get("pkg").get(n) : await import(`${W.appUrl}/api/pkg-import/web?name=${e}`); + } catch (i) { + throw new sn(e, i); + } + }); + O(this, "getRoutes", () => W.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...i }) => [n, { uuid: n, ...i }])).then((e) => new Map(e))); + O(this, "getMenus", () => W.get("/api/my-menu")); + O(this, "getConfigure", () => W.get("api/init-configure")); + O(this, "getWidgetOperationAuth", () => W.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); + O(this, "getPhoneNumber", (e) => W.get(`/api/user-wx-phone-number/${e}`)); + O(this, "getUserToken", () => { + const e = window.localStorage.getItem(bt); + if (!e) return ""; + const n = e.split("."); + if (!Array.isArray(n) || n.length !== 3) throw "登录令牌无效!"; + const { iat: i } = JSON.parse(window.atob(n[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - i > 2592e3) throw "登录令牌已过期, 请重新登录!"; + return e; + }); + O(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + O(this, "getUserInfo", (e = !0) => { + var n; + try { + const i = this.getUserToken(); + if (!i) return Promise.resolve(null); + const { iat: r } = JSON.parse(window.atob((n = i == null ? void 0 : i.split(".")) == null ? void 0 : n[1])), { iat: a, ...o } = W.decode(window.localStorage.getItem(Vt) || "", {}); + return a === r ? Promise.resolve(o) : W.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Vt, W.encode({ ...s, iat: r })), s)); + } catch (i) { + console.error(i), e && re.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + O(this, "login", (e, n, i = {}) => W.post("/api/user-token", { username: e, passwd: Vi.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(bt, r), r)).then(async (r) => (await this.initAppEnv(), r))); + O(this, "logout", (e) => (window.localStorage.removeItem(Vt), window.localStorage.removeItem(bt), e == null ? void 0 : e())); + O(this, "initAppEnv", async () => { + const [e, n, i, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); + return Kn.init(e), qe.init(r), ae.init(n, i), St.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; + }); + if (d(Ce, Le)) return d(Ce, Le); + } +}; +Le = new WeakMap(), Ze = new WeakMap(), v(Ce, Le, null), O(Ce, "getInstance", () => (d(Ce, Le) || K(Ce, Le, new Ce()), d(Ce, Le))); +let Qt = Ce; +const le = Qt.getInstance(), ra = E.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), aa = E.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), ln = (t) => { + if (!t) return !1; + if (t.prototype instanceof E.Component || t.$$typeof) return !0; + if (typeof t == "function") { + const e = t.displayName || t.name; + return !e || /^[A-Z]/.test(e); + } + return !1; +}, oa = (t, e) => { + if (!t || typeof window > "u") return; + let n = document.querySelector(`style[ff-style-token="${e}"]`); + return n ? (n.innerHTML = t, t) : (n = document.createElement("style"), n.setAttribute("ff-style-token", e), n.setAttribute("type", "text/css"), n.innerHTML = t, document.head.appendChild(n), t); +}, sa = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: ra, AppGlobalParamsContext: aa, cache: zn, configure: qe, default: le, func: Me, http: W, insertStyle: oa, isReactComponent: ln, route: ae }, Symbol.toStringTag, { value: "Module" })); +var Pe, et, Ne, Se, Ee, ne, ee, Y, $e, ct, dt, ut, pt, Pt, gt; +const cn = class cn { + constructor(e, n = "/") { + v(this, Pe, "/"); + v(this, et, /* @__PURE__ */ new Set()); + v(this, Ne, (e) => { + for (const n of d(this, et)) try { + n(e); + } catch (i) { + console.error("Error in VirtualFS event listener:", i); + } + }); + v(this, Se, (e) => { + const n = Date.now(); + if (e && (e.lastModified = n), d(this, Pe) != "/") { + const i = d(this, Y).call(this, d(this, Pe)); + i && (i.lastModified = n); + } + this.root.lastModified = n; + }); + v(this, Ee, (e) => { + let n = me.normalize(e); + return n.startsWith("/") || (n = "/" + n), n.length > 1 && n.endsWith("/") && (n = n.slice(0, -1)), n; + }); + v(this, ne, (e) => { + const n = me.join(d(this, Pe), e); + return d(this, Ee).call(this, n); + }); + v(this, ee, (e) => { + if (!e || typeof e != "string") return !1; + const n = d(this, Ee).call(this, e); + return !n.includes("..") && n.startsWith("/"); + }); + v(this, Y, (e) => { + var a; + const n = d(this, Ee).call(this, e); + if (n === "/") return this.root; + const i = n.split("/").filter((o) => o); + let r = this.root; + for (const o of i) { + if (r.type !== "dir") return null; + const s = (a = r.children) == null ? void 0 : a.find((l) => l.name === o); + if (!s) return null; + r = s; + } + return r; + }); + v(this, $e, (e) => { + const n = d(this, Ee).call(this, e), i = me.basename(n), r = me.dirname(n); + return { parent: d(this, Y).call(this, r), name: i }; + }); + v(this, ct, (e, n, i) => i === !1 ? e : i === "root" ? e.map((r) => me.join(n, r)) : i === !0 || i === "working" ? e.map((r) => me.relative(d(this, Pe), me.join(n, r))) : e); + v(this, dt, async (e, n, i, r = "") => { + const a = [], o = d(this, Y).call(this, e); + if (!o || o.type !== "dir") return a; + const s = o.children; + for (const l of s) { + const c = l.name, u = e === "/" ? `/${c}` : `${e}/${c}`, p = r ? `${r}/${c}` : c; + try { + if (l.type === "file") n(i ? p : c) && a.push(p); + else if (l.type === "dir" && i) { + const h = await d(this, dt).call(this, u, n, i, p); + a.push(...h); + } + } catch { + continue; + } + } + return a; + }); + v(this, ut, async (e, n, i, r = "") => { + const a = [], o = Array.isArray(n) ? n : [n], s = d(this, Y).call(this, e); + if (!s || s.type !== "dir") return a; + if (!i) { + for (const c of o) if (d(this, pt).call(this, c)) { + const u = await d(this, Pt).call(this, e, c); + a.push(...u); + } else { + const u = me.join(e, c), p = d(this, Ee).call(this, u); + d(this, Y).call(this, p) && a.push(c); + } + return a; + } + const l = s.children; + for (const c of l) { + const u = c.name, p = e === "/" ? `/${u}` : `${e}/${u}`, h = r ? `${r}/${u}` : u; + try { + if (c.type === "file") for (const g of o) { + let y = !1; + if (y = d(this, pt).call(this, g) ? d(this, gt).call(this, u, g) : u === g, y) { + a.push(h); + break; + } + } + else if (c.type === "dir") { + const g = await d(this, ut).call(this, p, n, i, h); + a.push(...g); + } + } catch { + continue; + } + } + return a; + }); + v(this, pt, (e) => /[*?[\]{}]/.test(e)); + v(this, Pt, async (e, n) => { + const i = [], r = d(this, Y).call(this, e); + if (!r || r.type !== "dir") return i; + const a = r.children.map((o) => o.name); + for (const o of a) d(this, gt).call(this, o, n) && i.push(o); + return i; + }); + v(this, gt, (e, n) => { + const i = n.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, a) => "(" + a.split(",").join("|") + ")"); + return new RegExp(`^${i}$`).test(e); + }); + var i, r, a; + K(this, Pe, n), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (i = this.root).name ?? (i.name = "/"), (r = this.root).children ?? (r.children = []), (a = this.root).lastModified ?? (a.lastModified = Date.now()))); + } + async stat(e) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const i = d(this, Y).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); + return { isFile: () => i.type === "file", isDirectory: () => i.type === "dir", lastModified: i.lastModified }; + } + async dir(e) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const i = d(this, Y).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); + if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); + return i.children.map((r) => r.name); + } + async readFile(e) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const i = d(this, Y).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (i.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); + return i.content || ""; + } + async writeFile(e, n) { + const i = d(this, ne).call(this, e); + if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: r, name: a } = d(this, $e).call(this, i); + if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); + const o = r.children.findIndex((c) => c.name === a), s = o >= 0, l = { name: a, type: "file", content: n, lastModified: Date.now() }; + s ? r.children[o] = l : r.children.push(l), d(this, Se).call(this, r), d(this, Ne).call(this, { action: s ? "update" : "create", path: i, type: "file", timestamp: Date.now() }); + } + async mkdir(e, n = {}) { + const i = d(this, ne).call(this, e); + if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const { recursive: r } = n; + if (r) { + const a = i.split("/").filter((s) => s); + let o = "/"; + for (const s of a) + if (o = me.join(o, s), !d(this, Y).call(this, o)) { + const { parent: l, name: c } = d(this, $e).call(this, o); + if (l && l.type === "dir") { + const u = { name: c, type: "dir", children: [], lastModified: Date.now() }; + l.children.push(u), d(this, Se).call(this, l), d(this, Ne).call(this, { action: "create", path: d(this, Ee).call(this, o), type: "dir", timestamp: Date.now() }); + } + } + } else { + const { parent: a, name: o } = d(this, $e).call(this, i); + if (!a) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); + if (a.type !== "dir") throw new Error("ENOTDIR: not a directory"); + if (a.children.find((l) => l.name === o)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); + const s = { name: o, type: "dir", children: [], lastModified: Date.now() }; + a.children.push(s), d(this, Se).call(this, a), d(this, Ne).call(this, { action: "create", path: i, type: "dir", timestamp: Date.now() }); + } + } + async unlink(e) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: i, name: r } = d(this, $e).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + const a = i.children.findIndex((o) => o.name === r); + if (a < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + if (i.children[a].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); + i.children.splice(a, 1), d(this, Se).call(this, i), d(this, Ne).call(this, { action: "delete", path: n, type: "file", timestamp: Date.now() }); + } + async rmdir(e, n = {}) { + const i = d(this, ne).call(this, e); + if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: r, name: a } = d(this, $e).call(this, i); + if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const o = r.children.findIndex((l) => l.name === a); + if (o < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const s = r.children[o]; + if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); + if (!n.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); + r.children.splice(o, 1), d(this, Se).call(this, r), d(this, Ne).call(this, { action: "delete", path: i, type: "dir", timestamp: Date.now() }); + } + async rename(e, n) { + const i = d(this, ne).call(this, e), r = d(this, ne).call(this, n); + if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${n}'`); + if (!d(this, Y).call(this, i)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); + const { parent: a, name: o } = d(this, $e).call(this, i), { parent: s, name: l } = d(this, $e).call(this, r); + if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); + if (d(this, Y).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${n}'`); + const c = a.children.findIndex((p) => p.name === o), u = { ...a.children[c], name: l, lastModified: Date.now() }; + a.children.splice(c, 1), s.children.push(u), d(this, Se).call(this, a), a !== s && d(this, Se).call(this, s), d(this, Ne).call(this, { action: "rename", path: r, oldPath: i, type: u.type, timestamp: Date.now() }); + } + async exists(e) { + const n = d(this, ne).call(this, e); + return d(this, ee).call(this, n) ? d(this, Y).call(this, n) !== null : !1; + } + getLastModified() { + return this.root.lastModified; + } + subscribe(e) { + if (typeof e != "function") throw new Error("Callback must be a function"); + return d(this, et).add(e), () => { + d(this, et).delete(e); + }; + } + getWorkingDirectory() { + return d(this, Pe); + } + scope(e = "/") { + const n = d(this, Ee).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const i = d(this, Y).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory '${e}'`); + if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); + return i.children ?? (i.children = []), i.lastModified ?? (i.lastModified = Date.now()), new cn(this.root, n); + } + async findFiles(e, n, i = {}) { + const r = d(this, ne).call(this, e); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const a = d(this, Y).call(this, r); + if (!a) throw new Error(`ENOENT: no such file or directory '${e}'`); + if (a.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); + const { recursive: o = !1, fullPath: s = !1 } = i; + if (typeof n == "function") { + const c = await d(this, dt).call(this, r, n, o); + return d(this, ct).call(this, c, r, s); + } + const l = await d(this, ut).call(this, r, n, o); + return d(this, ct).call(this, l, r, s); + } +}; +Pe = new WeakMap(), et = new WeakMap(), Ne = new WeakMap(), Se = new WeakMap(), Ee = new WeakMap(), ne = new WeakMap(), ee = new WeakMap(), Y = new WeakMap(), $e = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), pt = new WeakMap(), Pt = new WeakMap(), gt = new WeakMap(); +let Ln = cn; +const la = async (t, e = "/", n = "") => { + try { + const i = await t.stat(e), r = e === "/" ? "/" : me.basename(e), a = { title: r, key: n ? `${n}${e}` : e, isLeaf: i.isFile() }; + if (i.isDirectory()) { + const o = await t.dir(e); + if (o.length > 0) { + a.children = []; + const s = [], l = []; + for (const c of o) { + const u = e === "/" ? `/${c}` : `${e}/${c}`; + try { + (await t.stat(u)).isDirectory() ? s.push(c) : l.push(c); + } catch (p) { + console.warn(`Failed to stat ${u}:`, p.message); + } + } + s.sort(), l.sort(); + for (const c of [...s, ...l]) { + const u = e === "/" ? `/${c}` : `${e}/${c}`; + try { + const p = await la(t, u, n); + a.children.push(p); + } catch (p) { + console.warn(`Failed to process ${u}:`, p.message); + } + } + } + } + return a; + } catch { + return null; + } +}; +export { + Ba as $, + sr as A, + Oa as B, + Ra as C, + kt as D, + Jn as E, + Kt as F, + Aa as G, + Cr as H, + lr as I, + cr as J, + vr as K, + Pr as L, + Ia as M, + La as N, + ge as O, + Tr as P, + Nt as Q, + Zn as R, + ai as S, + Lt as T, + Ma as U, + Va as V, + Da as W, + Wa as X, + Or as Y, + Rr as Z, + Fr as _, + Hn as a, + jr as a0, + Tt as a1, + za as a2, + mt as a3, + Ot as a4, + Ua as a5, + qa as a6, + Ar as a7, + ci as a8, + Ur as a9, + zn as aA, + qe as aB, + Me as aC, + ae as aD, + ra as aE, + aa as aF, + Ln as aG, + la as aH, + ia as aI, + on as aa, + an as ab, + di as ac, + Ir as ad, + Lr as ae, + Mr as af, + Vr as ag, + Dr as ah, + Wr as ai, + Ka as aj, + St as ak, + R as al, + Kn as am, + Jr as an, + te as ao, + ht as ap, + Un as aq, + ie as ar, + re as as, + Pa as at, + Na as au, + Ta as av, + le as aw, + ln as ax, + oa as ay, + W as az, + Gn as b, + Fa as c, + Yn as d, + nn as e, + ei as f, + ir as g, + ii as h, + Er as i, + ni as j, + Sr as k, + ja as l, + ti as m, + Qn as n, + Xn as o, + yr as p, + fr as q, + hr as r, + rn as s, + ce as t, + kr as u, + br as v, + xr as w, + dr as x, + pr as y, + or as z +}; diff --git a/dist/components.js b/dist/components.js index 598b9e4..91c6272 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-CkdKM5PB.js"; +import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-Cta62l2D.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index 4491159..8f9c0ba 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { ap as s, at as e, au as p, av as t, aq as d, as as n, ar as r, ao as u } from "./common/main-CkdKM5PB.js"; +import { ap as s, at as e, au as p, av as t, aq as d, as as n, ar as r, ao as u } from "./common/main-Cta62l2D.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 21dd5f5..a3a01ec 100644 --- a/dist/data-converter.js +++ b/dist/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as i } from "./common/main-CkdKM5PB.js"; +import { D as i } from "./common/main-Cta62l2D.js"; import "react-use"; export { i as default diff --git a/dist/data-list.js b/dist/data-list.js index 2136d10..51c5cf7 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { w as t, t as e, o as r, r as o, x as i, s as l, q as u, v as n, p as D, y as L, n as p, A as C, z as m, J as b, C as c, F, E as d, I as k, B as w } from "./common/main-CkdKM5PB.js"; +import { w as t, t as e, o as r, r as o, x as i, s as l, q as u, v as n, p as D, y as L, n as p, A as C, z as m, J as b, C as c, F, E as d, I as k, B as w } from "./common/main-Cta62l2D.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 5233598..6781328 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { f as a } from "../common/main-CkdKM5PB.js"; +import { f as a } from "../common/main-Cta62l2D.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index e80923d..abb4d07 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { aa as s, ac as r, ab as u, a9 as o, m as t, ah as m, af as d, ag as i, aj as F, ae as g, ad as c, ai as l } from "./common/main-CkdKM5PB.js"; +import { aa as s, ac as r, ab as u, a9 as o, m as t, ah as m, af as d, ag as i, aj as F, ae as g, ad as c, ai as l } from "./common/main-Cta62l2D.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index f342fa8..c5d809d 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a as o, g } from "../common/main-CkdKM5PB.js"; +import { a as o, g } from "../common/main-Cta62l2D.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index a870dff..3e410f4 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { h as u, j as e, i as r, H as t, G as d, k as i, m as o, l as G, u as l } from "./common/main-CkdKM5PB.js"; +import { h as u, j as e, i as r, H as t, G as d, k as i, m as o, l as G, u as l } from "./common/main-Cta62l2D.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 34899e8..bf810fc 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { b as a, d as o, e as s, c as g } from "../common/main-CkdKM5PB.js"; +import { b as a, d as o, e as s, c as g } from "../common/main-Cta62l2D.js"; export { a as getBoxStyle, o as getEventProps, diff --git a/dist/hooks.js b/dist/hooks.js index 8d64ee7..9eae245 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -2,7 +2,7 @@ import "lodash"; import "rc-field-form"; import "react"; import "react-use"; -import { a4 as u, a3 as o, a5 as i, a2 as f, a6 as m, a1 as d, a8 as c, a7 as l } from "./common/main-CkdKM5PB.js"; +import { a4 as u, a3 as o, a5 as i, a2 as f, a6 as m, a1 as d, a8 as c, a7 as l } from "./common/main-Cta62l2D.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; import { a as x } from "./common/vender-hQk7ADWo.js"; export { diff --git a/dist/iconfont.js b/dist/iconfont.js index e698bdd..6dfbf4e 100644 --- a/dist/iconfont.js +++ b/dist/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { ak as a } from "./common/main-CkdKM5PB.js"; +import { ak as a } from "./common/main-Cta62l2D.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index c23cb13..b2b86fe 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { aE as t, aF as e, aA as o, aB as n, aw as p, aC as r, az as c, ay as f, ax as l, aD as u } from "./common/main-CkdKM5PB.js"; +import { aE as t, aF as e, aA as o, aB as n, aw as p, aC as r, az as c, ay as f, ax as l, aD as u } from "./common/main-Cta62l2D.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index 1c80705..06c8552 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { L as t, K as e, M as o, N as g } from "./common/main-CkdKM5PB.js"; +import { L as t, K as e, M as o, N as g } from "./common/main-Cta62l2D.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index f3c11b7..3f949a3 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-CkdKM5PB.js"; +import { R as a } from "./common/main-Cta62l2D.js"; export { a as default }; diff --git a/dist/style.css b/dist/style.css index 98409b4..f66f644 100644 --- a/dist/style.css +++ b/dist/style.css @@ -1 +1 @@ -#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}input:-webkit-autofill,textarea:-webkit-autofill,select:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #fff inset!important;-webkit-text-fill-color:#000!important;transition:background-color 9999s ease-in-out 0s}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px}.ff-container{height:100%}.ff-loading{height:100vh;width:100%;background-color:#f0f2f5;display:flex;justify-content:center;align-items:center}.ff-loading .loader{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:128px;height:80px}.ff-loading .loader .square{position:relative}.ff-loading .loader .square:nth-child(1){margin-left:0}.ff-loading .loader .square:nth-child(1) span{-webkit-animation:animsquare1 2s infinite ease-in;animation:animsquare1 2s infinite ease-in}.ff-loading .loader .square:nth-child(2){margin-left:44px}.ff-loading .loader .square:nth-child(2) span{-webkit-animation:animsquare2 2s infinite ease-in;animation:animsquare2 2s infinite ease-in}.ff-loading .loader .square:nth-child(3){margin-left:88px}.ff-loading .loader .square:nth-child(3) span{-webkit-animation:animsquare3 2s infinite ease-in;animation:animsquare3 2s infinite ease-in}.ff-loading .loader .square:nth-child(4){margin-left:132px}.ff-loading .loader .square:nth-child(4) span{-webkit-animation:animsquare4 2s infinite ease-in;animation:animsquare4 2s infinite ease-in}.ff-loading .loader .square span{position:absolute;top:0;left:20px;height:36px;width:36px;border-radius:2px;background-color:#fff}.ff-loading .loader .square span:nth-child(1){top:0;-webkit-animation-delay:0s;animation-delay:0s}.ff-loading .loader .square span:nth-child(2){top:44px;-webkit-animation-delay:.15s;animation-delay:.15s}.ff-loading .loader .square span:nth-child(3){top:88px;-webkit-animation-delay:.3s;animation-delay:.3s}@media (max-width: 550px){.ff-loading .loader{-webkit-transform:scale(.75);transform:scale(.75)}}@media (max-width: 440px){.ff-loading .loader{-webkit-transform:scale(.5);transform:scale(.5)}}@keyframes animsquare4{0%,5%,95%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}30%,70%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare3{0%,10%,90%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}35%,65%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare2{0%,15%,85%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}40%,60%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare1{0%,20%,80%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}45%,55%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}.ff-notification{position:fixed;z-index:2000;display:flex;max-height:100vh;padding:20px;align-items:flex-end;width:380px;overflow-x:hidden;overflow-y:clip;height:100vh;box-sizing:content-box;pointer-events:none;flex-direction:column;gap:24px}.ff-notification-top,.ff-notification-topLeft,.ff-notification-topRight{top:0}.ff-notification-bottom,.ff-notification-bottomRight,.ff-notification-bottomLeft{bottom:0}.ff-notification-bottomRight,.ff-notification-topRight{right:0}.ff-notification-notice{position:relative;display:block;box-sizing:border-box;line-height:1.5;width:100%}.ff-notification-notice-wrapper{z-index:2000;pointer-events:auto;position:relative;display:block;box-sizing:border-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;width:calc(100% - 40px);background-color:#fff;right:0}.ff-notification-notice-content{padding:14px 18px;display:flex;gap:8px;white-space:pre-wrap}.ff-notification-notice-content .ff-notification-icon.ff-notification-error{--bg-color: #ff4d4f}.ff-notification-notice-content .ff-notification-icon.ff-notification-success{--bg-color: #52c41a}.ff-notification-notice-content .ff-notification-icon.ff-notification-info{--bg-color: #1677ff}.ff-notification-notice-content .ff-notification-icon>*:first-child{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;background-color:var(--bg-color)}.ff-notification-notice-progress{position:absolute;left:3px;right:3px;border-radius:1px;overflow:hidden;-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;inline-size:100%;block-size:2px;border:0}.ff-notification-notice-progress,.ff-notification-notice-progress::-webkit-progress-bar{background-color:#0000000a}.ff-notification-notice-progress::-moz-progress-bar{background-color:#31afff}.ff-notification-notice-progress::-webkit-progress-value{background-color:#31afff}.ff-notification-fade{overflow:hidden;transition:all .3s}.ff-notification-fade-appear-prepare{pointer-events:none;opacity:0!important}.ff-notification-fade-appear-start{transform:translate(100%);opacity:0}.ff-notification-fade-appear-active{transform:translate(0);opacity:1}.ff-data-list-cell-editable:after{content:" ";display:block;position:absolute;width:0px;height:0px;bottom:0;right:0;border-style:solid;border-color:rgba(0,0,0,.45) transparent;border-width:0 0 var(--padding-xs, 8px) var(--padding-xs, 8px)}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--col-width: 200px;--gap: 8px;--item-bg-color: #fff;--item-box-shadow: 0px 0px 8px rgba(0, 0, 0, .08);--item-selected-color: rgba(0, 122, 255, .1);--item-selected-bg-color: rgba(0, 122, 255, .01);--item-selected-mark-size: 8px;--item-selected-mark-color: rgba(0, 122, 255, .8);--item-selected-border-width: 1px;display:flex;gap:var(--gap)}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:var(--gap);display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-content{flex:1;overflow-y:auto;padding:calc(var(--gap) / 2)}.ff-data-list-framework :where(.data-list-grid-layout-item){border-radius:4px;background-color:var(--item-bg-color);border:var(--item-selected-border-width) solid transparent;box-shadow:var(--item-box-shadow);transition:border-color .2s,background-color .2s}.ff-data-list-framework .data-list-grid-layout-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:var(--gap);position:relative;overflow-x:hidden}.ff-data-list-framework .data-list-grid-layout-item.is-selectable:hover{background-color:var(--item-selected-bg-color)}.ff-data-list-framework .data-list-grid-layout-item.is-selected{background-color:var(--item-selected-bg-color);border-color:var(--item-selected-color)}.ff-data-list-framework .data-list-grid-layout-item.is-selected.is-mark-selected:after{content:" ";display:block;position:absolute;width:0px;height:0px;top:0;right:0;border-style:solid;border-color:var(--item-selected-mark-color) transparent;border-width:var(--item-selected-mark-size) 0 0 var(--item-selected-mark-size)}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-container{padding:var(--gap)}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-actions{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #f0f0f0;height:32px}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:var(--gap)}.ff-data-table-framework .ff-data-table-container{width:100%;height:100%;display:flex;flex-direction:column;row-gap:var(--gap)}.ff-data-list-filter:has(.ff-data-list-filter-actions:not(.expanded)){height:60px;overflow-y:hidden}.ff-data-list-filter .ff-data-list-filter-default-form.ff-grid-layout-form{--grid-layout-cols: 25;--grid-layout-item-margin-x: 8px;--grid-layout-item-margin-y: 16px}.ff-data-list-filter .ff-data-list-filter-actions{grid-column:span var(--itemp-span, 5) / calc(var(--grid-layout-cols, 25) + 1)}.ff-data-list-filter .ff-data-list-filter-actions:not(.expanded){grid-row:1}.ff-data-list-filter .ff-data-list-filter-actions .ff-data-list-filter-expanded-button{margin-left:8px}.ff-data-list-filter .ff-data-list-filter-actions .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;gap:8px}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width, 280px))}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-title{color:#000000e0;font-weight:600;font-size:14px}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab.active{color:#1677ff;font-weight:600}.ff-data-list-empty{display:flex;align-items:center;justify-content:center}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y));column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin);display:var(--grid-layout-box-display, flex);align-items:var(--grid-layout-box-align-items, center);justify-content:var(--grid-layout-box-justify-content, normal)}.ff-data-list-content{display:grid;gap:var(--gap, 8px);grid-template-columns:repeat(var(--col-num, 5),1fr);grid-auto-rows:min-content}.ff-data-list-content[style*=--col-width]{grid-template-columns:repeat(auto-fill,minmax(var(--col-width, 280px),1fr))}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y, 16px));column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 16px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-iconfont{transform:scale(1.14);vertical-align:-.125em;display:inline-flex;align-items:center;justify-content:center}.ff-iconfont:not(:last-child){margin-right:8px}.ff-popover-header{margin-bottom:calc(var(--margin-sm) / 2)}.ff-popover-header:empty{display:none}.ff-popover-footer{padding-top:12px}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-modal-form{display:flex;flex-direction:column;gap:var(--modal-form-gap, 8px)}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave-active{transition:all .3s}.mask-motion-enter,.mask-motion-appear{opacity:0}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave{opacity:1}.mask-motion-leave-active{opacity:0}.panel-motion-left-enter-start,.panel-motion-left-appear-start,.panel-motion-left-leave-start{transition:none!important}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave-active{transition:all .3s}.panel-motion-left-enter,.panel-motion-left-appear{transform:translate(-100%)}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave{transform:translate(0)}.panel-motion-left-leave-active{transform:translate(-100%)!important}.panel-motion-right-enter-start,.panel-motion-right-appear-start,.panel-motion-right-leave-start{transition:none!important}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave-active{transition:all .3s}.panel-motion-right-enter,.panel-motion-right-appear{transform:translate(100%)}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave{transform:translate(0)}.panel-motion-right-leave-active{transform:translate(100%)!important}.panel-motion-top-enter-start,.panel-motion-top-appear-start,.panel-motion-top-leave-start{transition:none!important}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave-active{transition:all .3s}.panel-motion-top-enter,.panel-motion-top-appear{transform:translateY(-100%)}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave{transform:translateY(0)}.panel-motion-top-leave-active{transform:translateY(-100%)!important}.panel-motion-bottom-enter-start,.panel-motion-bottom-appear-start,.panel-motion-bottom-leave-start{transition:none!important}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave-active{transition:all .3s}.panel-motion-bottom-enter,.panel-motion-bottom-appear{transform:translateY(100%)}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave{transform:translateY(0)}.panel-motion-bottom-leave-active{transform:translateY(100%)!important}.ff-drawer-mask{top:0;right:0;bottom:0;left:0;position:absolute;z-index:1050;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45))}.ff-drawer{top:0;right:0;bottom:0;left:0;position:fixed;z-index:1050;pointer-events:none}.ff-drawer-close{top:14px;right:0}.ff-drawer-inline{position:absolute}.ff-drawer-left .ff-drawer-content-wrapper{inset:0 auto 0 0;box-shadow:6px 0 16px #00000014,3px 0 6px -4px #0000001f,9px 0 28px 8px #0000000d}.ff-drawer-right .ff-drawer-content-wrapper{inset:0 0 0 auto;box-shadow:-6px 0 16px #00000014,-3px 0 6px -4px #0000001f,-9px 0 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper{top:0;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d}.ff-drawer-bottom .ff-drawer-content-wrapper{bottom:0;box-shadow:0 -6px 16px #00000014,0 -3px 6px -4px #0000001f,0 -9px 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper,.ff-drawer-bottom .ff-drawer-content-wrapper{inset-inline:0}.ff-drawer-content{width:100%;height:100%;overflow:auto;background-color:var(--popup-bg-color, #fff);pointer-events:auto}.ff-drawer-header{padding:16px 8px;border-bottom:1px solid rgba(5,5,5,.06)}.ff-drawer-footer{border-top:1px solid rgba(5,5,5,.06);padding:12px 8px}.ff-drawer-body{padding:8px}.ff-drawer-content-wrapper{position:absolute;z-index:1050;overflow:hidden;transition:transform .3s;max-width:100vw}.ff-drawer-content-wrapper-hidden{display:none}.ff-modal-mask{position:fixed;top:0;right:0;left:0;bottom:0;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45));height:100%;filter:alpha(opacity=50);z-index:1050}.ff-modal-mask-hidden{display:none}.ff-modal-fade-enter,.ff-modal-fade-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-enter.ff-modal-fade-enter-active,.ff-modal-fade-appear.ff-modal-fade-appear-active{animation-name:rcDialogFadeIn;animation-play-state:running}.ff-modal-fade-leave.ff-modal-fade-leave-active{animation-name:rcDialogFadeOut;animation-play-state:running}@keyframes rcDialogFadeIn{0%{opacity:0}to{opacity:1}}@keyframes rcDialogFadeOut{0%{opacity:1}to{opacity:0}}.ff-modal{position:relative;top:100px;width:fit-content;min-width:max(35vw,248px);padding:0;margin:0 auto}.ff-modal-close{position:absolute;top:14px;right:8px}.ff-modal-header:has(.ff-popup-title),.ff-modal-header:has(.ff-popup-sub-title){margin-bottom:8px}.ff-modal-footer:not(:empty){margin-top:12px}.ff-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.ff-modal-title{margin:0;font-size:14px;line-height:21px;font-weight:700}.ff-modal-content{position:relative;background-color:var(--popup-bg-color, #fff);border-radius:8px;background-clip:padding-box;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:20px 24px;max-height:calc(100vh - 150px)}.ff-modal-zoom-enter,.ff-modal-zoom-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused}.ff-modal-zoom-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:paused}.ff-modal-zoom-enter.ff-modal-zoom-enter-active,.ff-modal-zoom-appear.ff-modal-zoom-appear-active{animation-name:rcDialogZoomIn;animation-play-state:running}.ff-modal-zoom-leave.ff-modal-zoom-leave-active{animation-name:rcDialogZoomOut;animation-play-state:running}@keyframes rcDialogZoomIn{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes rcDialogZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}.ff-popup-close{cursor:pointer;border:0;background:transparent;font-size:24px;position:absolute;line-height:1;color:#000;opacity:.5}.ff-popup-close:disabled{pointer-events:none}.ff-popup-close:hover{opacity:.65}.ff-popup{display:flex;flex-direction:column}.ff-popup-title,.ff-popup-sub-title{display:inline}.ff-popup-title{font-size:16px;font-weight:600}.ff-popup-footer{display:flex;gap:8px;justify-content:flex-end}.ff-popup-footer:empty{display:none}.ff-popup-reserved-extras,.ff-popup-extras,.ff-popup-actions{display:flex;align-items:center;gap:8px}.ff-popup-reserved-extras:empty,.ff-popup-extras:empty,.ff-popup-actions:empty{display:none}.ff-popup-actions{margin-left:auto}.ff-popup-body{flex:1;overflow-y:auto} +#nprogress{pointer-events:none}#nprogress .bar{background:#29d;position:fixed;z-index:1031;top:0;left:0;width:100%;height:2px}#nprogress .peg{display:block;position:absolute;right:0;width:100px;height:100%;box-shadow:0 0 10px #29d,0 0 5px #29d;opacity:1;-webkit-transform:rotate(3deg) translate(0px,-4px);-ms-transform:rotate(3deg) translate(0px,-4px);transform:rotate(3deg) translateY(-4px)}#nprogress .spinner{display:block;position:fixed;z-index:1031;top:15px;right:15px}#nprogress .spinner-icon{width:18px;height:18px;box-sizing:border-box;border:solid 2px transparent;border-top-color:#29d;border-left-color:#29d;border-radius:50%;-webkit-animation:nprogress-spinner .4s linear infinite;animation:nprogress-spinner .4s linear infinite}.nprogress-custom-parent{overflow:hidden;position:relative}.nprogress-custom-parent #nprogress .spinner,.nprogress-custom-parent #nprogress .bar{position:absolute}@-webkit-keyframes nprogress-spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes nprogress-spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.react-grid-layout .react-grid-item{box-sizing:border-box!important}.monaco-editor .parameter-hints-widget{border:0px}.monaco-editor .parameter-hints-widget .signature{padding:0}.monaco-editor .suggest-widget,.monaco-editor.vs-dark .suggest-widget{border:0px}.monaco-editor .rename-box{top:0}.ant-divider:has(+.ant-form .ant-divider:first-child){display:none}input:-webkit-autofill,textarea:-webkit-autofill,select:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #fff inset!important;-webkit-text-fill-color:#000!important;transition:background-color 9999s ease-in-out 0s}:root{--padding-lg: 24px;--padding-md: 16px;--padding-sm: 12px;--padding-xs: 8px;--padding-xss: 4px;--margin-lg: 24px;--margin-md: 16px;--margin-sm: 12px;--margin-xs: 8px;--margin-xss: 4px;--border-color: #f2f2f2;--bg-color: rgba(0, 0, 0, .02)}#root{height:100vh;background-color:#f0f2f5}*::-webkit-scrollbar-thumb{background:#aaa;border-radius:5px}*::-webkit-scrollbar-thumb:hover{background:#999}*::-webkit-scrollbar-track{background-color:#ddd}*::-webkit-scrollbar-corner{background-color:#ddd}*::-webkit-scrollbar{width:5px;height:5px}.ff-container{height:100%}.ff-loading{height:100vh;width:100%;background-color:#f0f2f5;display:flex;justify-content:center;align-items:center}.ff-loading .loader{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);width:128px;height:80px}.ff-loading .loader .square{position:relative}.ff-loading .loader .square:nth-child(1){margin-left:0}.ff-loading .loader .square:nth-child(1) span{-webkit-animation:animsquare1 2s infinite ease-in;animation:animsquare1 2s infinite ease-in}.ff-loading .loader .square:nth-child(2){margin-left:44px}.ff-loading .loader .square:nth-child(2) span{-webkit-animation:animsquare2 2s infinite ease-in;animation:animsquare2 2s infinite ease-in}.ff-loading .loader .square:nth-child(3){margin-left:88px}.ff-loading .loader .square:nth-child(3) span{-webkit-animation:animsquare3 2s infinite ease-in;animation:animsquare3 2s infinite ease-in}.ff-loading .loader .square:nth-child(4){margin-left:132px}.ff-loading .loader .square:nth-child(4) span{-webkit-animation:animsquare4 2s infinite ease-in;animation:animsquare4 2s infinite ease-in}.ff-loading .loader .square span{position:absolute;top:0;left:20px;height:36px;width:36px;border-radius:2px;background-color:#fff}.ff-loading .loader .square span:nth-child(1){top:0;-webkit-animation-delay:0s;animation-delay:0s}.ff-loading .loader .square span:nth-child(2){top:44px;-webkit-animation-delay:.15s;animation-delay:.15s}.ff-loading .loader .square span:nth-child(3){top:88px;-webkit-animation-delay:.3s;animation-delay:.3s}@media (max-width: 550px){.ff-loading .loader{-webkit-transform:scale(.75);transform:scale(.75)}}@media (max-width: 440px){.ff-loading .loader{-webkit-transform:scale(.5);transform:scale(.5)}}@keyframes animsquare4{0%,5%,95%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}30%,70%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare3{0%,10%,90%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}35%,65%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare2{0%,15%,85%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}40%,60%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}@keyframes animsquare1{0%,20%,80%,to{-webkit-transform:translate(0px,0px) rotate(0deg);transform:translate(0) rotate(0)}45%,55%{-webkit-transform:translate(40px,0px) rotate(90deg);transform:translate(40px) rotate(90deg)}}.ff-notification{position:fixed;z-index:2000;display:flex;max-height:100vh;padding:20px;align-items:flex-end;width:380px;overflow-x:hidden;overflow-y:clip;height:100vh;box-sizing:content-box;pointer-events:none;flex-direction:column;gap:24px}.ff-notification-top,.ff-notification-topLeft,.ff-notification-topRight{top:0}.ff-notification-bottom,.ff-notification-bottomRight,.ff-notification-bottomLeft{bottom:0}.ff-notification-bottomRight,.ff-notification-topRight{right:0}.ff-notification-notice{position:relative;display:block;box-sizing:border-box;line-height:1.5;width:100%}.ff-notification-notice-wrapper{z-index:2000;pointer-events:auto;position:relative;display:block;box-sizing:border-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;width:calc(100% - 40px);background-color:#fff;right:0}.ff-notification-notice-content{padding:14px 18px;display:flex;gap:8px;white-space:pre-wrap}.ff-notification-notice-content .ff-notification-icon.ff-notification-error{--bg-color: #ff4d4f}.ff-notification-notice-content .ff-notification-icon.ff-notification-success{--bg-color: #52c41a}.ff-notification-notice-content .ff-notification-icon.ff-notification-info{--bg-color: #1677ff}.ff-notification-notice-content .ff-notification-icon>*:first-child{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;background-color:var(--bg-color)}.ff-notification-notice-progress{position:absolute;left:3px;right:3px;border-radius:1px;overflow:hidden;-moz-appearance:none;appearance:none;-webkit-appearance:none;display:block;inline-size:100%;block-size:2px;border:0}.ff-notification-notice-progress,.ff-notification-notice-progress::-webkit-progress-bar{background-color:#0000000a}.ff-notification-notice-progress::-moz-progress-bar{background-color:#31afff}.ff-notification-notice-progress::-webkit-progress-value{background-color:#31afff}.ff-notification-fade{overflow:hidden;transition:all .3s}.ff-notification-fade-appear-prepare{pointer-events:none;opacity:0!important}.ff-notification-fade-appear-start{transform:translate(100%);opacity:0}.ff-notification-fade-appear-active{transform:translate(0);opacity:1}.ff-data-list-cell-editable:after{content:" ";display:block;position:absolute;width:0px;height:0px;bottom:0;right:0;border-style:solid;border-color:rgba(0,0,0,.45) transparent;border-width:0 0 var(--padding-xs, 8px) var(--padding-xs, 8px)}.ff-data-list-framework{height:100%;--sider-width: 280px;--col-num: 1;--col-width: 200px;--gap: 8px;--item-bg-color: #fff;--item-box-shadow: 0px 0px 8px rgba(0, 0, 0, .08);--item-selected-color: rgba(0, 122, 255, .1);--item-selected-bg-color: rgba(0, 122, 255, .01);--item-selected-mark-size: 8px;--item-selected-mark-color: rgba(0, 122, 255, .8);--item-selected-border-width: 1px;display:flex;gap:var(--gap)}.ff-data-list-framework .ff-data-list-container{width:100%;height:100%;row-gap:var(--gap);display:flex;flex-direction:column}.ff-data-list-framework .ff-data-list-content{flex:1;overflow-y:auto;padding:calc(var(--gap) / 2)}.ff-data-list-framework :where(.data-list-grid-layout-item){border-radius:4px;background-color:var(--item-bg-color);border:var(--item-selected-border-width) solid transparent;box-shadow:var(--item-box-shadow);transition:border-color .2s,background-color .2s}.ff-data-list-framework .data-list-grid-layout-item{display:flex;flex-direction:column;justify-content:space-between;row-gap:var(--gap);position:relative;overflow-x:hidden}.ff-data-list-framework .data-list-grid-layout-item.is-selectable:hover{background-color:var(--item-selected-bg-color)}.ff-data-list-framework .data-list-grid-layout-item.is-selected{background-color:var(--item-selected-bg-color);border-color:var(--item-selected-color)}.ff-data-list-framework .data-list-grid-layout-item.is-selected.is-mark-selected:after{content:" ";display:block;position:absolute;width:0px;height:0px;top:0;right:0;border-style:solid;border-color:var(--item-selected-mark-color) transparent;border-width:var(--item-selected-mark-size) 0 0 var(--item-selected-mark-size)}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-container{padding:var(--gap)}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-actions{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #f0f0f0;height:32px}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action{text-align:center;margin:2px 0;flex:1}.ff-data-list-framework .data-list-grid-layout-item .data-list-grid-layout-item-actions .data-list-grid-layout-item-action:not(:last-child){border-right:1px solid #f0f0f0}.ff-data-table-framework{height:100%;--sider-width: 280px;--col-num: 1;--gap: 8px;display:flex;gap:var(--gap)}.ff-data-table-framework .ff-data-table-container{width:100%;height:100%;display:flex;flex-direction:column;row-gap:var(--gap)}.ff-data-list-filter:has(.ff-data-list-filter-actions:not(.expanded)){height:60px;overflow-y:hidden}.ff-data-list-filter .ff-data-list-filter-default-form.ff-grid-layout-form{--grid-layout-cols: 25;--grid-layout-item-margin-x: 8px;--grid-layout-item-margin-y: 16px}.ff-data-list-filter .ff-data-list-filter-actions{grid-column:span var(--itemp-span, 5) / calc(var(--grid-layout-cols, 25) + 1)}.ff-data-list-filter .ff-data-list-filter-actions:not(.expanded){grid-row:1}.ff-data-list-filter .ff-data-list-filter-actions .ff-data-list-filter-expanded-button{margin-left:8px}.ff-data-list-filter .ff-data-list-filter-actions .ant-form-item-control-input-content{display:flex;justify-content:flex-end;align-items:center;gap:8px}.ff-data-list-footer{padding-block-start:8px;display:flex;justify-content:space-between}.ff-data-list-footer .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-sider{width:var(--sider-width, 280px);overflow-y:auto;box-shadow:8px 0 4px -8px #0000000d}.ff-data-list-sider+.ff-data-list-container{width:calc(100% - var(--sider-width, 280px))}.ff-data-list-toolbar{gap:8px;display:flex;justify-content:space-between;align-items:center}.ff-data-list-toolbar .ff-data-list-title{color:#000000e0;font-weight:600;font-size:14px}.ff-data-list-toolbar .ff-data-list-actions{display:flex;justify-content:center;gap:8px}.ff-data-list-toolbar .ff-data-list-tabs{cursor:pointer}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab{color:#00000073}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab:hover{font-weight:600}.ff-data-list-toolbar .ff-data-list-tabs .ff-data-list-tab.active{color:#1677ff;font-weight:600}.ff-data-list-empty{display:flex;align-items:center;justify-content:center}.ff-data-list-item-operations{max-width:180px;display:flex;flex-wrap:wrap;gap:var(--margin-xss, 4px)}.ff-data-list-item-operations>.ant-btn:not(.ant-btn-circle){flex-grow:1}.ff-data-list-helper{height:100%}.ff-data-list-table{height:100%;overflow-y:hidden}.ff-data-list-table .ant-table *{scrollbar-width:auto;scrollbar-color:auto}.ff-grid-layout{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y));column-gap:var(--grid-layout-item-margin-x);row-gap:var(--grid-layout-item-margin-y)}.ff-grid-layout .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-paddin);margin:var(--grid-layout-box-margin);display:var(--grid-layout-box-display, flex);align-items:var(--grid-layout-box-align-items, center);justify-content:var(--grid-layout-box-justify-content, normal)}.ff-data-list-content{display:grid;gap:var(--gap, 8px);grid-template-columns:repeat(var(--col-num, 5),1fr);grid-auto-rows:min-content}.ff-data-list-content[style*=--col-width]{grid-template-columns:repeat(auto-fill,minmax(var(--col-width, 280px),1fr))}.ff-grid-layout-form{--grid-layout-h: 1;--grid-layout-row: none;--grid-layout-row-height: 18px;--grid-layout-row-height-offset: 0px;--grid-layout-cols: 12;display:grid;grid-template-columns:repeat(var(--grid-layout-cols),1fr);grid-auto-rows:minmax(min-content,max-content);padding:var(--grid-layout-container-padding-y, 0) var(--grid-layout-container-padding-x, 0);padding-bottom:calc(var(--grid-layout-container-padding-y, 0) + var(--grid-layout-item-margin-y, 16px));column-gap:var(--grid-layout-item-margin-x, 8px);row-gap:var(--grid-layout-item-margin-y, 16px)}.ff-grid-layout-form .grid-layout-item{grid-row:span var(--grid-layout-h, 1);grid-column:calc(var(--grid-layout-x, 1) + 1)/calc(var(--grid-layout-x, 1) + var(--grid-layout-w, 1) + 1);height:calc(var(--grid-layout-row-height) * var(--grid-layout-h) + var(--grid-layout-row-height-offset));padding:var(--grid-layout-box-padding-y, 0) var(--grid-layout-box-padding-x, 0);margin:var(--grid-layout-box-margin)}.ff-iconfont{transform:scale(1.14);vertical-align:-.125em;display:inline-flex;align-items:center;justify-content:center}.ff-iconfont:not(:last-child){margin-right:8px}.ff-popover-header{margin-bottom:calc(var(--margin-sm) / 2)}.ff-popover-header:empty{display:none}.ff-popover-footer{padding-top:12px}.ff-button.ant-btn-link,.ff-button.ant-btn-text{width:initial;padding:0;height:auto}.ff-default.ant-btn-link{color:#000000e0}.ant-btn-link.ant-btn:not(:disabled):focus-visible{outline:initial;outline-offset:initial;transition:initial}.ff-modal-form{display:flex;flex-direction:column;gap:var(--modal-form-gap, 8px)}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave-active{transition:all .3s}.mask-motion-enter,.mask-motion-appear{opacity:0}.mask-motion-enter-active,.mask-motion-appear-active,.mask-motion-leave{opacity:1}.mask-motion-leave-active{opacity:0}.panel-motion-left-enter-start,.panel-motion-left-appear-start,.panel-motion-left-leave-start{transition:none!important}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave-active{transition:all .3s}.panel-motion-left-enter,.panel-motion-left-appear{transform:translate(-100%)}.panel-motion-left-enter-active,.panel-motion-left-appear-active,.panel-motion-left-leave{transform:translate(0)}.panel-motion-left-leave-active{transform:translate(-100%)!important}.panel-motion-right-enter-start,.panel-motion-right-appear-start,.panel-motion-right-leave-start{transition:none!important}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave-active{transition:all .3s}.panel-motion-right-enter,.panel-motion-right-appear{transform:translate(100%)}.panel-motion-right-enter-active,.panel-motion-right-appear-active,.panel-motion-right-leave{transform:translate(0)}.panel-motion-right-leave-active{transform:translate(100%)!important}.panel-motion-top-enter-start,.panel-motion-top-appear-start,.panel-motion-top-leave-start{transition:none!important}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave-active{transition:all .3s}.panel-motion-top-enter,.panel-motion-top-appear{transform:translateY(-100%)}.panel-motion-top-enter-active,.panel-motion-top-appear-active,.panel-motion-top-leave{transform:translateY(0)}.panel-motion-top-leave-active{transform:translateY(-100%)!important}.panel-motion-bottom-enter-start,.panel-motion-bottom-appear-start,.panel-motion-bottom-leave-start{transition:none!important}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave-active{transition:all .3s}.panel-motion-bottom-enter,.panel-motion-bottom-appear{transform:translateY(100%)}.panel-motion-bottom-enter-active,.panel-motion-bottom-appear-active,.panel-motion-bottom-leave{transform:translateY(0)}.panel-motion-bottom-leave-active{transform:translateY(100%)!important}.ff-drawer-mask{top:0;right:0;bottom:0;left:0;position:absolute;z-index:1050;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45))}.ff-drawer{top:0;right:0;bottom:0;left:0;position:fixed;z-index:1050;pointer-events:none}.ff-drawer-close{font-size:24px;top:14px;right:0;position:absolute;color:#000;opacity:.5;background:transparent;line-height:1}.ff-drawer-close:hover{opacity:.65}.ff-drawer-inline{position:absolute}.ff-drawer-left .ff-drawer-content-wrapper{inset:0 auto 0 0;box-shadow:6px 0 16px #00000014,3px 0 6px -4px #0000001f,9px 0 28px 8px #0000000d}.ff-drawer-right .ff-drawer-content-wrapper{inset:0 0 0 auto;box-shadow:-6px 0 16px #00000014,-3px 0 6px -4px #0000001f,-9px 0 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper{top:0;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d}.ff-drawer-bottom .ff-drawer-content-wrapper{bottom:0;box-shadow:0 -6px 16px #00000014,0 -3px 6px -4px #0000001f,0 -9px 28px 8px #0000000d}.ff-drawer-top .ff-drawer-content-wrapper,.ff-drawer-bottom .ff-drawer-content-wrapper{inset-inline:0}.ff-drawer-content{width:100%;height:100%;overflow:auto;background-color:var(--popup-bg-color, #fff);pointer-events:auto}.ff-drawer-header{padding:16px 8px;border-bottom:1px solid rgba(5,5,5,.06)}.ff-drawer-footer{border-top:1px solid rgba(5,5,5,.06);padding:12px 8px}.ff-drawer-body{padding:8px}.ff-drawer-content-wrapper{position:absolute;z-index:1050;overflow:hidden;transition:transform .3s;max-width:100vw}.ff-drawer-content-wrapper-hidden{display:none}.ff-modal-mask{position:fixed;top:0;right:0;left:0;bottom:0;pointer-events:auto;background-color:var(--popup-mask-bg-color, rgba(0, 0, 0, .45));height:100%;filter:alpha(opacity=50);z-index:1050}.ff-modal-mask-hidden{display:none}.ff-modal-fade-enter,.ff-modal-fade-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.55,0,.55,.2);animation-play-state:paused}.ff-modal-fade-enter.ff-modal-fade-enter-active,.ff-modal-fade-appear.ff-modal-fade-appear-active{animation-name:rcDialogFadeIn;animation-play-state:running}.ff-modal-fade-leave.ff-modal-fade-leave-active{animation-name:rcDialogFadeOut;animation-play-state:running}@keyframes rcDialogFadeIn{0%{opacity:0}to{opacity:1}}@keyframes rcDialogFadeOut{0%{opacity:1}to{opacity:0}}.ff-modal{position:relative;top:100px;width:fit-content;min-width:max(35vw,248px);padding:0;margin:0 auto}.ff-modal-close{position:fixed;top:32px;right:32px;display:flex;color:#fff;background-color:#0000001a;border-radius:50%;font-size:18px;padding:12px;outline:0;border:0;transition:background-color .3s}.ff-modal-close:hover{background-color:#0003}.ff-modal-close svg{display:block}.ff-modal-header:has(.ff-popup-title),.ff-modal-header:has(.ff-popup-sub-title){margin-bottom:8px}.ff-modal-footer:not(:empty){margin-top:12px}.ff-modal-wrap{position:fixed;overflow:auto;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.ff-modal-title{margin:0;font-size:14px;line-height:21px;font-weight:700}.ff-modal-content{display:flex;flex-direction:column;position:relative;background-color:var(--popup-bg-color, #fff);border-radius:8px;background-clip:padding-box;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:20px 24px;max-height:calc(100vh - 150px)}.ff-modal-zoom-enter,.ff-modal-zoom-appear{opacity:0;animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused}.ff-modal-zoom-leave{animation-duration:.3s;animation-fill-mode:both;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:paused}.ff-modal-zoom-enter.ff-modal-zoom-enter-active,.ff-modal-zoom-appear.ff-modal-zoom-appear-active{animation-name:rcDialogZoomIn;animation-play-state:running}.ff-modal-zoom-leave.ff-modal-zoom-leave-active{animation-name:rcDialogZoomOut;animation-play-state:running}@keyframes rcDialogZoomIn{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes rcDialogZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}.ff-popup-close{cursor:pointer;border:0}.ff-popup-close:disabled{pointer-events:none}.ff-popup{display:flex;flex-direction:column}.ff-popup-title,.ff-popup-sub-title{display:inline}.ff-popup-title{font-size:16px;font-weight:600}.ff-popup-footer{display:flex;gap:8px;justify-content:flex-end}.ff-popup-footer:empty{display:none}.ff-popup-reserved-extras,.ff-popup-extras,.ff-popup-actions{display:flex;align-items:center;gap:8px}.ff-popup-reserved-extras:empty,.ff-popup-extras:empty,.ff-popup-actions:empty{display:none}.ff-popup-actions{margin-left:auto}.ff-popup-body{flex:1;overflow-y:auto} diff --git a/dist/utils.js b/dist/utils.js index 4ea5836..3a7cf6c 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { S as r, a0 as i, W as g, V as o, X as P, P as m, $ as p, Q as U, _ as d, Y as h, Z as k, T as n, O as f, U as l } from "./common/main-CkdKM5PB.js"; +import { S as r, a0 as i, W as g, V as o, X as P, P as m, $ as p, Q as U, _ as d, Y as h, Z as k, T as n, O as f, U as l } from "./common/main-Cta62l2D.js"; import "./common/vender-hQk7ADWo.js"; export { r as deepSome, diff --git a/dist/virtual-fs.js b/dist/virtual-fs.js index 33f7f58..9f2a3b9 100644 --- a/dist/virtual-fs.js +++ b/dist/virtual-fs.js @@ -1,5 +1,5 @@ import "pathe"; -import { aG as o, aH as r } from "./common/main-CkdKM5PB.js"; +import { aG as o, aH as r } from "./common/main-Cta62l2D.js"; export { o as default, r as toTreePaths diff --git a/package.json b/package.json index eb9176d..b3a2eaf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.6.46", + "version": "0.6.47", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",