var Si = Object.defineProperty; var hr = (t) => { throw TypeError(t); }; var $i = (t, e, r) => e in t ? Si(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; var v = (t, e, r) => $i(t, typeof e != "symbol" ? e + "" : e, r), mr = (t, e, r) => e.has(t) || hr("Cannot " + r); var c = (t, e, r) => (mr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), N = (t, e, r) => e.has(t) ? hr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), B = (t, e, r, i) => (mr(t, e, "write to private field"), i ? i.call(t, r) : e.set(t, r), r); var fr = (t, e, r, i) => ({ set _(n) { B(t, e, n, r); }, get _() { return c(t, e, i); } }); import { jsx as m, jsxs as L } from "react/jsx-runtime"; import $, { useEffect as V, useState as A, useCallback as Y, useRef as J, useContext as ge, useMemo as q, useId as Dt, isValidElement as Ei, useLayoutEffect as Pi } from "react"; import me from "pathe"; import b from "prop-types"; import O from "classnames"; import { useNotification as Ni } from "rc-notification"; import f from "lodash"; import oe, { Field as Qt, FieldContext as Rr } from "rc-field-form"; import { useUpdateEffect as vi, usePrevious as Fr, useDeepCompareEffect as jr } from "react-use"; import { _ as xi, M as Lt, N as tt, b as De, i as zt, c as Ti, S as Oi } from "./vender-hQk7ADWo.js"; import Ar from "immutability-helper"; import { Space as Ri, Form as bt, Input as Fi, Button as kt, Pagination as ji, Tree as Ai, Breadcrumb as Li, Empty as Wt, Table as yr, Popover as Ii, Popconfirm as Mi, Tooltip as Vi } from "antd"; import Di from "rc-util/lib/hooks/useMergedState"; import { useMergedState as zi } from "rc-util"; import { generatePath as Wi, useInRouterContext as Lr, useParams as Bi, useLocation as Ui, createBrowserRouter as qi, Navigate as Ki } from "react-router-dom"; import Hi from "rc-drawer"; import Ji from "rc-dialog"; import * as wr from "react-is"; var He, it, Je, Pe, ze, We; class Ir { constructor(e, r) { N(this, He, /* @__PURE__ */ new Map()); N(this, it, !0); N(this, Je, []); N(this, Pe); N(this, ze, () => c(this, Pe)); N(this, We, () => Promise.resolve()); v(this, "get", (...e) => new Promise((r, i) => { const n = JSON.stringify(e); if (c(this, He).has(n)) return r(c(this, We).call(this, c(this, Pe), ...e)); if (c(this, Pe) === void 0) c(this, Je).push([e, r, i]), c(this, it) && (B(this, it, !1), Promise.resolve(typeof c(this, ze) == "function" ? c(this, ze).call(this) : c(this, ze)).then((o) => B(this, Pe, o || null)).finally(() => { c(this, Je).forEach(([o, a, s]) => { try { const l = c(this, We).call(this, c(this, Pe), ...o); c(this, He).set(JSON.stringify(o), l), a(l); } catch (l) { s(l); } }), c(this, Je).length = 0; })); else { const o = c(this, We).call(this, c(this, Pe), ...e); c(this, He).set(n, o), r(o); } })); B(this, We, r), B(this, ze, e); } } He = new WeakMap(), it = new WeakMap(), Je = new WeakMap(), Pe = new WeakMap(), ze = new WeakMap(), We = new WeakMap(); const Co = () => m("div", { children: "Empty" }), ht = $.createContext({ ele: {}, mount: () => { }, unmount: () => { } }), ee = ({ rootClassName: t, className: e, children: r, actions: i, title: n, subTitle: o, extras: a, style: s = {} }) => { const { mount: l, unmount: d } = $.useContext(ht); return ee.Action({ children: i }), ee.Title({ children: n }), ee.SubTitle({ children: o }), ee.Extra({ children: a }), V(() => (l("rootClassName", t), () => d(t)), [t]), m("div", { className: O("ff-container", e), style: s, children: r }); }, wt = (t) => ({ children: e, className: r }) => { const { mount: i, unmount: n } = $.useContext(ht); return V(() => (e && i(t, $.createElement("div", { key: `ff-${t}`, className: O(`ff-popup-${t}`, r) }, e)), () => n(t)), [r, e]), null; }; ee.Action = wt("actions"), ee.Title = wt("title"), ee.SubTitle = wt("sub-title"), ee.Extra = wt("extras"), ee.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; const ko = () => m(ee, { 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", {})] })] }) }), So = () => m("div", { children: "NotFound" }), Mr = ({ children: t }) => { const [e, r] = A({}), i = Y((o, a) => r((s) => ({ ...s, [o]: a })), []), n = Y((o) => r((a) => ({ ...a, [o]: void 0 })), []); return typeof (t == null ? void 0 : t.type) == "string" ? t : m(ht.Provider, { value: { ele: e, mount: i, unmount: n }, children: $.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); }; Mr.propTypes = { children: b.element.isRequired }; const br = { 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"] }, Zt = ({ type: t, props: e }) => m("i", { ...e, children: m("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (br[t] || br.info).map((r, i) => m("path", { d: r }, i)) }) }), Vr = ({ className: t, content: e, icon: r, $close: i }) => L($.Fragment, { children: [r && m("div", { className: O("ff-notification-icon", t), children: m(Zt, { type: r }) }), e] }), _i = ({}) => m(ee, { children: "Confirm" }); var Oe, _e; const fe = class fe { constructor() { N(this, _e, /* @__PURE__ */ new Map()); v(this, "init", (e) => B(this, _e, new Map(e))); v(this, "check", (e) => !c(this, _e).has(e) || c(this, _e).get(e)); if (c(fe, Oe)) return c(fe, Oe); } }; Oe = new WeakMap(), _e = new WeakMap(), N(fe, Oe, null), v(fe, "getInstance", () => (c(fe, Oe) || B(fe, Oe, new fe()), c(fe, Oe))); let Bt = fe; const Dr = Bt.getInstance(), Gi = (t, e, r = "children") => { if (f.isEmpty(t)) return {}; const i = f.find(t, ["value", e]); if (!f.isEmpty(i)) return i; const n = t.length; for (let o = 0; o < n; o++) { const { [r]: a } = t[o], s = Gi(a, e, r); if (!f.isEmpty(s)) return s; } return {}; }, zr = (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() { N(this, nt, null); v(this, "init", (e) => B(this, nt, e)); v(this, "get", (e, r) => f.get(c(this, nt), e, r)); if (c(ye, Re)) return c(ye, Re); } }; Re = new WeakMap(), nt = new WeakMap(), N(ye, Re, null), v(ye, "getInstance", () => (c(ye, Re) || B(ye, Re, new ye()), c(ye, Re))); let Ut = ye; const qe = Ut.getInstance(); var Ge, Et, ot, at, Pt; const Te = class Te { constructor(...e) { N(this, ot, []); N(this, at, (e) => { var r; for (let i of e) Array.isArray(i[0]) ? c(this, at).call(this, i) : c(this, ot).push(c(r = Te, Et).call(r, i[0], i[1])); }); v(this, "toValue", async (e, r = null) => { const i = { getValue: () => e, getRecord: () => r }; let n = e; for (const o of c(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(i, n); } catch (a) { console.error("middleware error, skip:", a); } return n; }); v(this, "toRender", (e, r, i = null) => $.createElement(c(this, Pt), { value: e, record: r }, i)); N(this, Pt, ({ value: e, record: r, children: i }) => { const [n, o] = A(i); return ft(() => { let a = !1; return o(i), this.toValue(e, r).then((s) => !a && o(s)).catch((s) => !a && o(`${s}`)), () => a = !0; }, [e, r]), n; }); c(this, at).call(this, e); } }; Ge = new WeakMap(), Et = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), Pt = new WeakMap(), N(Te, Ge, null), N(Te, Et, f.memoize((e, r) => { if (typeof e == "function") return e(r); if (typeof e == "string") return pe.getWidgetComponent(e).then((i) => { var n; return ((n = i.default) == null ? void 0 : n.call(i, r)) || ((o) => o); }); throw new TypeError("middleware must be a string or a function"); }, (...e) => { var r; return c(Te, Ge) || B(Te, Ge, En()), c(r = Te, Ge).call(r, ...e); })); let St = Te; const se = $.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { }, getSelectedRows: () => [], onReload: () => { }, onClickCallback: () => { }, onConditionChange: () => { }, onTabChange: () => { }, onSiderChange: () => { }, onKeywordChange: () => { }, onPageChange: () => { }, onPageSizeChange: () => { }, reload: () => { }, setPage: () => { }, setPageSize: () => { }, setTab: () => { }, setSider: () => { }, setKeyword: () => { }, setCondition: () => { } }), Cr = ({ className: t, record: e, column: r, ...i }) => { if (r != null && r.editableByJs && (r != null && r.uuid)) { const { formSetting: n = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (r == null ? void 0 : r.editableByJsSetting) || {}; return m(x.Popover, { widget: Yi, widgetData: { record: e, column: r }, widgetSetting: { widgetSetting: o, formSetting: n }, widgetContainerProps: { title: r != null && r.title ? `${r.title} - 编辑` : "编辑", ...a, width: (a == null ? void 0 : a.width) || 260, arrow: !0 }, children: m("td", { className: O("ff-data-list-cell-editable", t), ...i }) }); } return m("td", { className: t, ...i }); }, Yi = ({ record: t, column: e, $close: r, $setting: i }) => { const n = J(Sn(f.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = ge(se), [s] = oe.useForm(), { formSetting: l, widgetSetting: d } = i, u = (l == null ? void 0 : l.primaryKey) || "id", p = () => { s.setFieldsValue({ value: f.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); }; return ft(() => p(), [t, e == null ? void 0 : e.dataIndex, o]), m(ee, { actions: L($.Fragment, { children: [m(x, { size: "small", onClick: p, children: "重置" }), L(Ri.Compact, { block: !0, children: [m(x, { size: "small", widget: r, children: "取消" }), m(x, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: h }) => { const g = f.get(t, u.substring(u.indexOf(".") + 1)); if (!g) throw "获取更新主键失败!"; I.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${g}`, { value: h }).msg(() => a(2, t)).then(r); }).catch(console.warn), children: "保存" })] })] }), children: L(oe, { form: s, children: [m(rr, { label: "", type: n.current, code: "value", widget: e == null ? void 0 : e.editableByJs, extras: d }), m(Qt, { noStyle: !0, name: ["__PROPS__"], children: () => { } })] }) }); }, Xi = (t) => function(e) { return t(e, getRecord()); }, Qi = (t, e = {}) => q(() => { var r; return (r = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : r.map(({ widgetByJs: i, widgetByJsSetting: n, ...o }, a) => { const s = (d) => ({ record: d, column: o }); let l = []; return i && l.push([i, n]), l.length > 0 ? (o != null && o.render && l.push([Xi, o.render]), { ...o, onCell: s, render: (d, u) => new St(l).toRender(d, u, "-") }) : { ...o, onCell: s }; }); }, [t, e]), Zi = (t = {}) => q(() => { var e; return t.body ?? (t.body = { cell: Cr }), (e = t.body).cell ?? (e.cell = Cr), t; }, [t]), $o = (t) => { const [e, r] = A({}); return V(() => { let i = !1; return t && I.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) => !i && r(n)), () => i = !0; }, [t]), e; }, Eo = (t, e = {}) => { const [r, i] = A({ dataSource: [] }); return mt(() => { let n = !1; return t && I.get(`/api/${t}/${I.encode({ page: 1, ...e })}`).then((o) => !n && i(o)), () => n = !0; }, [t, e]), r; }, Wr = (t = [], e = /* @__PURE__ */ new Map(), r = "id", i) => { const n = Y(i ? (o) => f.get(o, r, f.get(o, [i, r])) : (o) => f.get(o, r), [r, i]); return Y((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]); }, qt = (t = [], e = /* @__PURE__ */ new Map(), r = [], i = "id", n) => { const o = Y(n ? (a) => f.get(a, i, f.get(a, [n, i])) : (a) => f.get(a, i), [i, n]); return q(() => { if (f.isEmpty(t) || !t.some(({ uuid: s }) => Dr.check(s))) return !1; if (f.isEmpty(e) || f.isEmpty(r)) return !0; const a = r.map((s) => o(s)); return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((d) => d == l))); }, [t, r, e, o]); }, en = (t, e, r = "id", i = null) => { const n = Ot(), o = J(!1), a = J(t.dataSource), s = J(t.itemOperationsAccess); return V(() => (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, d = 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(d, "__PARENT_ID__", ""), g = f.get(d, r, f.get(d, [i, r], "")), y = f.findIndex(a.current, ["__PARENT_ID__", h]), w = f.findIndex(y > -1 ? f.get(a.current, [y, "children"]) : a.current, [r, g]); if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t); Promise.all([I.get(`/api/${e}/detail/${g}`), I.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([C, S]) => { const P = f.get(a.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]); a.current = Ar(a.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...C, children: P }]] } } } : { $splice: [[w, 1, { ...C, children: P }]] }); const k = new Map(S); s.current.forEach((E, T) => { var j; (j = k.get(T)) != null && j.some((F) => F == g) || s.current.set(T, E.filter((F) => F !== g)); }), k.forEach((E, T) => { s.current.has(T) ? s.current.set(T, f.uniq([...s.current.get(T) || [], ...E])) : s.current.set(T, E); }); }).then(() => { o.current = !0, n(); }); } }]; }, tn = (t, e) => { const r = Ot(), i = J(e), n = J(/* @__PURE__ */ new Map()), o = J([]), a = f.throttle((l) => { o.current = [], I.list(t, f.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: u, total: p, tab: h, sider: g, page: y, pageSize: w, operationsAccess: C, dataSource: S }) => { i.current = { tab: h, condition: u, sider: g, keyword: d, total: p, pageSize: w, page: S != null && S.length ? y : 1 }, o.current = S, n.current = new Map(C), r(); }); }, 380, { leading: !1, trailing: !0 }); ft(() => { o.current = [], t && a(e); }, [t, e]); const s = q(() => f.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [i.current]); return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, d) => a({ page: l, pageSize: d }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, d) => a({ keyword: d, condition: Ar(i.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 }); }, rn = ({ listCode: t, className: e, layouts: r = {}, dataSource: i, isPaginate: n, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: h, itemGridLayout: g, $setting: y, tabs: w, isConditionFormLayout: C, isTreeSider: S, treeSiderConfig: P }) => { const { classNames: k, onClickCallback: E } = ge(se), T = f.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style"]), j = Wr(l, d, p, u), F = Y((M, D, R) => m(nn, { className: O("ff-data-list-framework-item", k == null ? void 0 : k.item), operations: o ? j(D) : [], data: u ? { [u]: D } : D, children: M, onClickCallback: E }), [u, p, o, E, l, d]); return L("div", { className: O("ff-data-list-framework", e), children: [m(r.sider, { isTreeSider: S, ...P }), L("div", { className: O("ff-data-list-container", k == null ? void 0 : k.container), children: [m(r.filter, { isConditionFormLayout: C }), m(r.toolbar, { title: h, tabs: w }), m(wn, { ...T, ...g, empty: m(r.empty, { className: k == null ? void 0 : k.empty }), primaryKey: p, itemRender: F, dataSource: i }), m(r.footer, { isPaginate: n, isOperations: a, operations: s })] })] }); }, nn = ({ className: t, operations: e, children: r, data: i, onClickCallback: n }) => L("div", { className: O("data-list-grid-layout-item", t), children: [m("div", { className: "data-list-grid-layout-item-container", children: r }), !!(e != null && e.length) && m("div", { className: "data-list-grid-layout-item-actions", children: e.map((o) => m("span", { className: "data-list-grid-layout-item-action", children: m(x.Link, { uuid: o.uuid, type: o.type, name: o.name, widget: o.widget, widgetType: o.widgetType, widgetProps: o.widgetProps, widgetSetting: o.widgetSetting, widgetContainerProps: o.widgetContainerSetting, data: i, confirm: o.confirm, onAfterClick: (a) => a !== !1 && (n == null ? void 0 : n(o.isRefresh, i)) }, o.uuid || Dt()) }, (o == null ? void 0 : o.uuid) || Dt())) })] }), on = ({ listCode: t, className: e, layouts: r = {}, dataSource: i, columns: n, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: h, tabs: g, isPaginate: y, rowSelection: w, isTreeSider: C, treeSiderConfig: S, isConditionFormLayout: P, ...k }) => { const { classNames: E, onClickCallback: T } = ge(se), j = Wr(l, d, p, u), F = qt(l, d, i, p, u); return L("div", { className: O("ff-data-table-framework", e), children: [m(r.sider, { isTreeSider: C, ...S }), L("div", { className: O("ff-data-table-container", E == null ? void 0 : E.container), children: [m(r.filter, { isConditionFormLayout: P }), m(r.toolbar, { title: h, tabs: g }), m(pn, { ...k, primaryKey: p, className: "ff-data-table-content", columns: n, dataSource: i, rowSelection: w, operationRender: F ? (M) => { var D; return m("div", { className: "ff-data-table-actions", children: (D = j(M)) == null ? void 0 : D.map((R, W) => m(x.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: M, confirm: R.confirm, onAfterClick: (U) => U !== !1 && (T == null ? void 0 : T(R.isRefresh, M)) }, R.uuid || W)) }); } : null }), m(r.footer, { isPaginate: y, isOperations: a, operations: s })] })] }); }, er = (t = [], e, r = null) => { var i; return (i = f.sortBy(t, ["y", "x"])) == null ? void 0 : i.map(({ i: n, x: o, y: a, w: s, h: l, field: { boxStyle: d, ...u } = {} }, p) => m("div", { className: "grid-layout-item", style: Br(o, a, s, l, d), children: m(e, { ...u, basicForm: r }) }, n ?? p)); }, Br = (t, e, r, i, n = {}, o = 0) => { const a = { "--grid-layout-h": `${i}`, "--grid-layout-w": `${r}`, "--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"] = `${i}`, 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"] = kr(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"] = kr(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; }, kr = (t, e, r, i) => `${t || 0}px ${e || 0}px ${r || 0}px ${i || 0}px`, Po = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Ur = (t) => Object.keys(t).reduce((e, r) => (/^on[A-Z]/.test(r) && (e[r] = t[r]), e), {}), qr = ({ className: t, isConditionFormLayout: e }) => { var h, g; const [r, i] = A({}), { listCode: n, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = $.useContext(se), { keyword: d, condition: u } = (s == null ? void 0 : s()) || {}, [p] = bt.useForm(); return V(() => { n && e && I.get(`/api/_/${n}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: C, rowHeight: S, cols: P, fields: k }) => { i({ resource: y, itemMargin: [w, C], rowHeight: S, cols: P, fields: k }); }).catch(() => i({})); }, [n, e]), V(() => { p.setFieldsValue({ keyword: d, ...u }); }, [JSON.stringify([d, u])]), m("div", { className: O("ff-data-list-filter", l.filter, t), children: m(bt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((h = r.fields) == null ? void 0 : h.length) > 1 ? (y) => a({ [r.resource]: y[r.resource] }, y.keyword) : () => { }, onValuesChange: (y) => { f.isEmpty(f.omit(y, ["keyword"])) || p.submit(); }, children: ((g = r.fields) == null ? void 0 : g.length) > 1 ? m(ir, { ...r, children: m(an, { 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: Br(20, 0, 5, 2), children: m(bt.Item, { name: ["keyword"], children: m(Fi.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => o(y) }) }) }) }) }) }); }, an = ({ cols: t, fields: e, onReset: r }) => { const [i, n] = A(!1), o = q(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]); return L(bt.Item, { label: " ", style: { "--item-span": 5 }, className: O("ff-data-list-filter-actions", { expanded: i }), children: [m(kt, { onClick: r, children: "重置" }), m(kt, { type: "primary", htmlType: "submit", children: "查询" }), o && m(x.Link, { className: "ff-data-list-filter-expanded-button", widget: () => n((a) => !a), type: "primary", name: i ? "关闭" : "展开", icon: i ? "icon-up" : "icon-down", iconPosition: "end" })] }); }; qr.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 sn = ({ className: t, operations: e, isOperations: r, isPaginate: i }) => { const { onPageChange: n, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = $.useContext(se), { total: l, page: d, pageSize: u } = (s == null ? void 0 : s()) || {}; return r && !f.isEmpty(e) || i ? L("div", { className: O("ff-data-list-footer", t), children: [m("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, h) => m(x, { 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)) }), i && m(ji, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${d} 页 / 总共 ${p} 条`, onChange: n, onShowSizeChange: o })] }) : null; }, ln = [{ 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" }] }] }], cn = ({ className: t, width: e = 280, isTreeSider: r }) => { const { classNames: i } = ge(se); return r ? m(Ai.DirectoryTree, { className: O("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: ln }) : null; }, dn = ({ className: t, title: e, tabs: r }) => { const { getBase62params: i, onTabChange: n, onReload: o, classNames: a } = ge(se), { tab: s } = (i == null ? void 0 : i()) || {}, [l, d] = zi((r == null ? void 0 : r[0].value) ?? (r == null ? void 0 : r[0].code), { value: s, onChange: n }); return L("div", { className: O("ff-data-list-toolbar", a.toolbar, t), children: [m("div", { className: "ff-data-list-title", children: e }), m(Li, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: h }) => m("span", { onClick: () => d(h ?? p), className: O("ff-data-list-tab", { active: (h ?? p) == l }), children: u }), items: r }), L("div", { className: "ff-data-list-actions", children: [m(x.Link, { icon: "icon-reload", widget: () => o() }), m(x.Link, { icon: "icon-setting" })] })] }); }, un = ({ className: t, ...e }) => m(Wt, { className: O(t, "ff-data-list-empty"), image: Wt.PRESENTED_IMAGE_SIMPLE, ...e }), Kr = ({ isItemGridLayout: t, theme: e, themeProps: r, onClickCallback: i, onReload: n, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: u, tab: p, onTabChange: h, keyword: g, onKeywordChange: y, condition: w, onConditionChange: C, sider: S, onSiderChange: P, layouts: k, classNames: E = {}, payload: T = {}, dataSource: j = [], rowSelection: F, getSelectedRows: M, primaryKey: D, ...R }) => { const [W, U] = A(), K = M ?? (() => j), he = Y((z, le) => { const _ = { tab: p, page: s, pageSize: d, keyword: g, sider: S, condition: w, total: a, payload: T }; return z && z != "init" ? f.get(_, z, le) : _; }, [JSON.stringify(w), JSON.stringify(T), p, s, d, g, S, a]), ae = q(() => { let z = { sider: cn, filter: qr, footer: sn, toolbar: dn, empty: un }; k === !1 ? z = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : f.isPlainObject(k) && (z = Object.assign({}, z, k)); for (const le in z) if (z[le]) { if (Ei(z[le])) { const _ = z[le]; z[le] = (Ft) => $.cloneElement(_, Ft); } } else z[le] = () => m($.Fragment, {}); return z; }, [k]); return V(() => { e ? pe.getWidgetComponent(e).then((z) => { if (!z) throw `${e} not found`; return z; }).catch((z) => ({ default: () => `${z}` })).then((z) => U($.createElement(z.default, { ...R, layouts: ae, $setting: r }))) : U(m(t ? rn : on, { ...R, layouts: ae, $setting: r })); }, [e, r]), m(se.Provider, { value: { classNames: E, listCode: o, onClickCallback: i, onReload: n, getBase62params: he, onPageChange: l, onPageSizeChange: u, onTabChange: h, onSiderChange: P, onKeywordChange: y, onConditionChange: C, setPage: l, setPageSize: u, setTab: h, setSider: P, setKeyword: y, setCondition: C, getSelectedRows: K }, children: W && $.cloneElement(W, { dataSource: j, primaryKey: D, rowSelection: F, ...R }) }); }; Kr.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, Ne, Be, Nt; const we = class we { constructor() { N(this, Ne, null); N(this, Be, /* @__PURE__ */ new Map()); N(this, Nt, () => { if (c(this, Ne)) return c(this, Ne).port.postMessage({ command: "status", data: [] }); B(this, Ne, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), c(this, Ne).port.onmessage = (e) => { var r, i; (r = e.data) != null && r.uuid ? c(this, Be).forEach((n, o) => { var a; (n == "*" || (a = n == null ? void 0 : n.includes) != null && a.call(n, e.data.uuid)) && o(e.data); }) : ((i = e.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: n, expire_at: o }) => { c(this, Ne).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(I.appUrl, "http")}api/user-resource-status-ws?token=${n}`] }); }); }, c(this, Ne).port.postMessage({ command: "status", data: [] }); }); v(this, "subscribe", (e, r = []) => (r ? Array.isArray(r) && r.length == 0 ? r = "*" : Array.isArray(r) || (r = [r].flat()) : r = "*", c(this, Be).set(e, r), c(this, Be).size == 1 && c(this, Nt).call(this), () => this.unsubscribe(e))); v(this, "unsubscribe", (e) => c(this, Be).delete(e)); if (c(we, Fe)) return c(we, Fe); } }; Fe = new WeakMap(), Ne = new WeakMap(), Be = new WeakMap(), Nt = new WeakMap(), N(we, Fe, null), v(we, "getInstance", () => (c(we, Fe) || B(we, Fe, new we()), c(we, Fe))); let Kt = we; const Hr = Kt.getInstance(), tr = $.forwardRef(({ listCode: t, base62params: e, className: r, theme: i, themeProps: n, layouts: o, classNames: a, onSelectionChange: s, defaultSelectedRowKeys: l, selectedRowKeys: d, onDataSourceChange: u }, p) => { const [{ resource: h, primaryKey: g, batchOperations: y = [], itemOperations: w = [], columns: C = [], themeConfig: S, theme: P, isConditionFormLayout: k = !1, isTreeSider: E, treeSiderConfig: T, isItemGridLayout: j, itemGridLayout: { themeConfig: F, ...M } = {}, title: D, isPaginate: R, tabs: W, selectionType: U }, K] = A({ isItemGridLayout: !1, itemGridLayout: {} }), he = tn(t, e), [{ dataSource: ae, itemOperationsAccess: z, condition: le, tab: _, keyword: Ft, page: sr, total: lr, pageSize: cr, sider: si, onConditionChange: li, onTabChange: ci, onKeywordChange: di, onPageChange: ui, onPageSizeChange: pi, onSiderChange: gi, onReload: jt, payload: hi }, dr] = en(he, t, g, h), mi = xi(u); vi(() => { mi(ae, { page: sr, pageSize: cr, total: lr }); }, [ae]); const [fi, yi] = Di([], { defaultValue: l ?? [], value: d }), [ur, wi] = A([]), pr = Y(() => U ? ur : ae, [U, ur, ae]), bi = qt(w, z, ae, g), Ci = qt(y); V(() => { let X = null; return t && I.get(`/api/_/${t}`).resp(({ data: Ve, res: At }) => { Ve != null && Ve.isDynamicRefresh && (X = Hr.subscribe(() => jt(), At)), K(Ve); }).catch(() => K({})), () => X == null ? void 0 : X(); }, [t]), $.useImperativeHandle(p, () => ({ onReload: jt, onClickCallback: dr, getSelectedRows: pr })); const ki = { listCode: t, title: D, classNames: a, layouts: o, resource: h, primaryKey: g, theme: i || P, themeProps: n || S, isTreeSider: E, treeSiderConfig: T, isPaginate: R, rowSelection: U ? { type: U, columnWidth: 80, selectedRowKeys: fi, onChange: (X, Ve) => { wi((At) => { const gr = new Map(At.map((ce) => [ce == null ? void 0 : ce[g], ce])); return Ve.forEach((ce) => gr.set(ce == null ? void 0 : ce[g], ce)), X.map((ce) => gr.get(ce)).filter(Boolean); }), yi(X), s == null || s(X, Ve); } } : void 0, getSelectedRows: pr, tabs: W, isItemOperations: bi, itemOperations: w == null ? void 0 : w.map((X) => f.isEmpty(X == null ? void 0 : X.confirm) ? X : { ...X, confirm: Object.assign({}, X.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: Ci, batchOperations: y, isItemGridLayout: j, columns: C, itemGridLayout: { ...M, themeProps: F }, isConditionFormLayout: k, itemOperationsAccess: z, dataSource: ae, onConditionChange: li, onTabChange: ci, onKeywordChange: di, onPageChange: ui, onPageSizeChange: pi, onSiderChange: gi, condition: le, tab: _, keyword: Ft, page: sr, total: lr, pageSize: cr, sider: si, payload: hi }; return m(Kr, { ...ki, className: O("ff-data-list-helper", r), onReload: jt, onClickCallback: dr }); }), Jr = (t, e, r = !0) => r !== !0 && r-- <= 0 ? [] : f.isArray(t) && !f.isEmpty(t) ? t.reduce((i, n) => (Reflect.has(n, e) && Reflect.has(n, "children") && i.push(n[e]), Reflect.has(n, "children") && !f.isEmpty(n.children) ? i.concat(Jr(n.children, e, r)) : i), []) : [], pn = ({ className: t, primaryKey: e, columns: r = [], dataSource: i = [], operationRender: n, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { const { classNames: d } = ge(se), u = J(null), p = J(null), [h, g] = A([]), [y, w] = A({ width: 0, height: 0 }); V(() => { g(Jr(i, e)); }, [i, e]), Pi(() => { const k = new ResizeObserver(() => { var E; w({ width: ((E = u.current) == null ? void 0 : E.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 C = q(() => { if (!(y != null && y.width) || !(r != null && r.length)) return r; const k = (s ? s.columnWidth ?? 32 : 0) + (n ? o : 0), E = r.reduce((F, M) => F + (M.isWidthFixed && M.width ? M.width : 0), 0), T = r.filter((F) => !F.isWidthFixed).reduce((F, M) => F + (M.width ?? 100), 0); if (E + T + k >= y.width) return r; const j = y.width - E - k; return r.map((F) => F.isWidthFixed ? F : { ...F, width: Math.floor(j * (F.width ?? 100) / T) }); }, [r, y.width, s, n, o]), S = Qi(C), P = Zi(a); return m("div", { ref: p, className: O("ff-data-list-table", d.content, t), children: y.height ? m(yr, { bordered: !0, ...l, components: P, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { var E, T; const k = [...S ?? []]; return s && k.splice((T = (E = k[0]) == null ? void 0 : E.key) != null && T.startsWith("__") ? 1 : 0, 0, yr.SELECTION_COLUMN), n && k.push({ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(o / y.width * 100).toFixed(2)}%`, render: (j, F, M) => n(F, M) }), 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 }); }, gn = "RC_FORM_INTERNAL_HOOKS", hn = (t) => { const [e, r] = $.useState({ items: [] }); return V(() => { t && I.get(`/api/_/${t}`).then(({ uuid: i, code: n, name: o, resource: a, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, fields: h, theme: g, themeSetting: y, groups: w }) => ({ uuid: i, code: n, name: o, resource: a, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, theme: g, themeProps: y, groups: w, items: h })).then(r); }, [t]), e; }, mn = (t, { initialValue: e, initialValueLanguage: r, convertJs: i, convertJsSetting: n, type: o = "string" }, a = null) => { const s = J(!1), l = ge(Rr), [d, u] = A(), [p, h] = A(r != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(gn) || {}; return V(() => g == null ? void 0 : g((y, w, C) => { if (!s.current) return; const S = f.get(w, t); f.isEqual(S, p) || h(ue(S, o)); }), [p]), V(() => { r == "javascript" && e ? Me.exec(e, {}, { getFieldValueForBasicForm: (y) => a ? a.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => h(ue(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && h(ue(e ?? l.getFieldValue(t), o)), s.current = !0); }, [e, r]), mt(() => { s.current && i && new St([i, n]).toValue(p, l.getFieldsValue(!0)).then(u).catch((y) => { u(y), console.error("布局数据转换错误: ", y, i); }); }, [p, i, n]), [d ?? p, p]; }, No = (t, e, r = null) => q(() => er(t, e, r), [t]), _r = (t, e, r = {}, i = {}, n = {}, o = null) => { const a = ge(Rr), s = Ot(), l = J(!0), d = J([]), [u, p] = A(e), [h, g] = A(), y = oe.useWatch((w) => JSON.stringify(f.pick(w, d.current)), a) || "{}"; return ft(() => { t && Me.exec(t, r, { ...i, getFieldValueForBasicForm: (w) => n ? n.getFieldValue(w) : null, getFieldValue: f.wrap(a.getFieldValue, (w, C) => (d.current.some((S) => f.isEqual(S, C)) || (d.current.push(C), s()), w == null ? void 0 : w(C))), 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, r, i]), V(() => () => l.current = !1, []), t ? [o ? ue(u, o) : u, h] : [o ? ue(e, o) : e, null]; }, fn = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: r, ...i }) => { const n = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = A(); return V(() => { n && pe.getWidgetComponent(n).then(({ defaultProps: s = {}, default: l }) => ({ default: yn(l, s, r) })).catch((s) => ({ default: () => `${s}` })).then((s) => a($.createElement(s.default, i))); }, [n]), o; }, yn = (t, e = {}, r = null) => (i) => { const { code: n, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, value: h, ...g } = f.merge({}, e, i), [y, w] = mn(s ? null : n, { initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, r), C = q(() => { 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]), [S, P] = C(g); return m(t, { ...P, value: y, rawValue: w, $setting: Object.assign({}, a, S) }); }, Gr = ({ theme: t, basicForm: e, items: r = [{ key: "default", label: "默认" }], fields: i = [], itemRender: n, chunks: o = [], children: a, $setting: s = {}, ...l }) => { const [d, u] = A(); V(() => { t ? pe.getWidgetComponent(t).then((h) => { if (!(h != null && h.default)) throw "not found"; return h; }).catch((h) => ({ default: () => `${t} ${h}` })).then((h) => u($.createElement(h.default, {}))) : u(null); }, [t]); const p = q(() => r == null ? void 0 : r.map((h) => ({ ...h, children: n(h, i == null ? void 0 : i.filter((g) => !(g != null && g.group) && h.key == "default" || g.group == h.key), h.key == "default" ? a : null) })).concat(o), [r, a, o]); return d && $.cloneElement(d, { items: p, basicForm: e, $setting: { ...s, ...l } }); }, Yr = ({ name: t, form: e = null, basicForm: r = null, style: i = {}, className: n, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: d = {}, formFields: u = [], fields: p = [], data: h, theme: g, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...S }) => { const [P] = oe.useForm(e), k = q(() => [{ name: "__PROPS__", value: d }].concat(u), [d, u]); mt(() => (P.setFieldsValue(h), () => P.resetFields()), [h]); const E = (T, j, F) => { const M = er(j, fn, r), D = Ur(S); return L("div", { ...D, className: O("ff-grid-layout", n), 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": o, "--grid-layout-row-height": `${a}px` }, children: [M, F && $.cloneElement(F, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: j, basicForm: r })] }); }; return m(oe, { ...S, fields: k, form: P, component: !1, children: g ? m(Gr, { ...y, items: w, theme: g, itemRender: E, fields: p, children: C, basicForm: r }) : E(0, p, C) }); }, vo = /* @__PURE__ */ ((t) => function({ code: e, data: r, ...i }) { const { uuid: n, resource: o, items: a, hides: s, rowHeight: l, marginX: d, marginY: u, cols: p, theme: h, themeProps: g, groups: y } = hn(e) || {}, w = q(() => [{ 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, ...i, fields: a, formFields: w, rowHeight: l, cols: p, itemMargin: [d, u], data: o ? { [o]: r } : r }); })(Yr), wn = ({ column: t = 0, colWidth: e = 0, cols: r, rowHeight: i, itemMargin: n, fields: o, primaryKey: a, dataSource: s, beforeRender: l = null, afterRender: d = null, itemClassName: u, itemRender: p = (P, k, E) => P, empty: h = m(Wt, { description: null }), className: g, style: y = {}, theme: w, themeProps: C = {}, groups: S = [{ key: "default", label: "默认" }] }) => { const { classNames: P } = ge(se), k = q(() => m(Yr, { groups: S, theme: w, themeProps: C, cols: r, rowHeight: i, itemMargin: n, fields: o, className: u }), [o, r, i, n, S, w, C]), E = f.isEmpty(s); return L("div", { className: O("ff-data-list-content", P.content, g), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [l == null ? void 0 : l(s), E ? h : s.map((T, j) => { const F = p($.cloneElement(k, { data: T }), T, j); return $.cloneElement(F, { key: `${(T == null ? void 0 : T[a]) ?? j}-${$n(T)}` }); }), d == null ? void 0 : d(s)] }); }, bn = ({ component: t, $props: e }) => { const { base62params: r } = Tt(e, {}); return m(ee, { children: m(tr, { listCode: t, base62params: I.decode(r) }) }); }, xo = () => m(Xr, {}), Xr = () => "Empty", Cn = ({ component: t, $setting: e, $props: r }) => { const [i, n] = A(), [o, a] = ri(r); return V(() => { if (!t) return n(m(Xr, { description: null })); pe.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => $.createElement(s.default, { $setting: e })).then(n); }, [t]), i ? $.cloneElement(i, { ...o, $setProps: a }) : null; }, To = () => "NotFoundPage"; var je, de, Ae, ke, st, lt; const be = class be { constructor() { N(this, de, /* @__PURE__ */ new Map()); N(this, Ae, {}); N(this, ke, null); v(this, "init", (e, r) => { B(this, de, e), B(this, Ae, r); }); v(this, "get", (e) => (c(this, de).has(e) || (e = Array.from(c(this, de).keys()).find((r) => c(this, de).get(r).uri === e)), c(this, de).get(e) || {})); v(this, "redirect", (e, r, i = {}) => { var y; const { uri: n, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...d } = r || {}, u = Object.assign({}, d, s), p = Object.assign({}, d, l); o == "list" && (u.base62params = I.encode(u != null && u.base62params ? u.base62params : u)); let h = Wi(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()}`), i != null && i.isOpenWindow ? window.open(h) : c(this, ke).navigate(h, { replace: !!(i != null && i.isReplaceRouteHistory) }); }); v(this, "getMenus", (e) => { var r; return ((r = c(this, Ae)) == null ? void 0 : r[e]) || []; }); v(this, "findMenuPathByUuid", (e) => { let r = []; for (const i in c(this, Ae)) if (r = c(this, st).call(this, c(this, Ae)[i], e, [i]), r.length > 1) return r; return r; }); v(this, "getMenusByRouteUuid", (e) => c(this, lt).call(this, e, Object.values(c(this, Ae)).flat())); N(this, st, (e, r, i = []) => { if (f.isEmpty(e)) return i; for (const { uuid: n, children: o } of e) { if (n == r) return i.concat(n); if (!f.isEmpty(o)) return i.concat(n, c(this, st).call(this, o, r)); } return i; }); N(this, lt, (e, r) => { var n; let i = []; for (const o of r) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? i.push(o) : (n = o.children) != null && n.length && (i = i.concat(c(this, lt).call(this, e, o.children)))); return i; }); v(this, "getCurrentMenu", () => { const { uuid: e } = this.getCurrentRoute() || {}; if (!e) return; const r = this.getMenusByRouteUuid(e); return f.isEmpty(r) ? void 0 : r[0]; }); v(this, "getCurrentRoute", (e = 0) => { var i; const r = (i = c(this, ke).state.matches[c(this, ke).state.matches.length - 1 - e]) == null ? void 0 : i.route; if (!r) return null; for (let [n, o] of c(this, de)) if (o.uri === r.path) return o; return null; }); v(this, "getPageParams", (e) => { var a, s; const { location: r = {}, matches: i = [] } = ((a = c(this, ke)) == null ? void 0 : a.state) || {}, n = { ...((s = i[i.length - 1]) == null ? void 0 : s.params) || {} }, o = r.search; return o && new URLSearchParams(o).forEach((l, d) => { n[d] = l; }), e ? f.get(n, e) : n; }); v(this, "usePageParams", (e) => { var i; let r = Lr() ? { ...Bi(), ...Object.fromEntries(new URLSearchParams(((i = Ui()) == null ? void 0 : i.search) ?? "")) } : this.getPageParams(); return e ? f.get(r, e) : r; }); v(this, "createBrowserRouter", (e = {}) => { if (c(this, de).size == 0) return null; if (c(this, ke)) return c(this, ke); const r = qe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = qe.get(pe.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), n = { [r]: 0 }, o = (s, l) => () => Promise.all([pe.getWidgetComponent(s), Tt(l)]).then(([d, u]) => [d.default || function() { return `${s}`; }, u]).then(([d, u]) => ({ Component: () => $.createElement(Mr, {}, $.createElement(d, { $setting: u })) })), a = Array.from(c(this, de).values()).reduce((s, { uuid: l, uri: d, name: u, type: p, component: h, widgetSetting: g, widgetProps: y, isLogin: w, isLayout: C, extra: S }) => { let P = {}, k = 0; switch (p) { case "list": P.element = $.createElement(bn, { component: h, $props: y }); break; case "fsdpf-component": P.element = $.createElement(Cn, { key: h, component: h, $setting: g, $props: y }); } const E = (S == null ? void 0 : S.theme) ?? (S == null ? void 0 : S.layout); if (E) { const T = (S == null ? void 0 : S.themeProps) ?? (S == null ? void 0 : S.layoutProps); if (!n[E]) return n[E] = s.length, [...s, { path: "/", lazy: o(E, T), children: [{ path: d, ...P }] }]; k = n[E]; } return C && k > -1 ? (s[k].children.push({ path: d, ...P }), s) : [...s, { path: d, ...P }]; }, [{ path: "/", lazy: o(r, {}), children: [] }]); return a.push({ index: !0, element: $.createElement(kn, { to: i, replace: !0 }) }), B(this, ke, qi(a, e)); }); if (c(be, je)) return c(be, je); } }; je = new WeakMap(), de = new WeakMap(), Ae = new WeakMap(), ke = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), N(be, je, null), v(be, "getInstance", () => (c(be, je) || B(be, je, new be()), c(be, je))); let Ht = be; const kn = ({ to: t, replace: e }) => Lr() ? $.createElement(Ki, { to: t, replace: e }) : (window.document.location = t, "redirect"), ne = Ht.getInstance(), Ke = new Worker(new URL("/ff-worker/index.js", self.location)), Sr = { getConfigure: (t) => qe.get(t), route: { redirect: (...t) => ne.redirect(...t), getPageParams: (...t) => ne.getPageParams(...t), getCurrentRoute: () => ne.getCurrentRoute() }, popup: { notification: (...t) => ie.notification(...t), success: (...t) => ie.success(...t), error: (...t) => ie.error(...t), form: (...t) => ie.form(...t), modal: (...t) => ie.modal(...t), confirm: (...t) => ie.confirm(...t) } }; var vt, Ye, Le; const H = class H { constructor() { v(this, "exec", (e, r = {}, i = {}, n = "") => new Promise((o, a) => { if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return o(); const s = fr(H, vt)._++; c(H, Ye).set(s, i), H.mQueue.set(s, [o, a]), Ke.postMessage({ id: s, session: n, category: "eval", method: e, args: r }); })); v(this, "clear", (e) => Ke.postMessage({ session: e, category: "clear" })); if (c(H, Le)) return c(H, Le); Promise.resolve().then(() => Zn).then((e) => { Sr.http = e.http; }), Ke.addEventListener("message", ({ data: { id: e, task_id: r, method: i, args: n, category: o, data: a, error: s, session: l } }) => { if (o === "eval" && H.mQueue.has(e)) s !== null ? H.mQueue.get(e)[1](s) : H.mQueue.get(e)[0](a), c(H, Ye).delete(e), H.mQueue.delete(e); else if (o === "util") try { const d = f.get(Sr, i.split("/")) || f.get(c(H, Ye).get(r), i.split("/")); if (!f.isFunction(d)) throw `${i} not found`; Promise.resolve(Reflect.apply(d, void 0, n)).then((u) => { Ke.postMessage({ id: e, task_id: r, category: o, method: i, args: n, session: l, data: u, error: null }); }).catch((u) => { Ke.postMessage({ id: e, task_id: r, category: o, method: i, args: n, session: l, data: null, error: u }); }); } catch (d) { Ke.postMessage({ id: e, task_id: r, category: o, method: i, args: n, session: l, data: null, error: d }); } }, !1); } }; vt = new WeakMap(), Ye = new WeakMap(), Le = new WeakMap(), v(H, "mQueue", /* @__PURE__ */ new Map()), N(H, vt, 0), N(H, Ye, /* @__PURE__ */ new Map()), N(H, Le, null), v(H, "getInstance", () => (c(H, Le) || B(H, Le, new H()), c(H, Le))); let Jt = H; const Me = Jt.getInstance(), $r = { 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" }, ue = (t, e) => { let r = "string"; r = Array.isArray(t) ? "array" : typeof t, f.isObject(t) && (r = "json"); const i = `${r}2${e}`; return Reflect.has($r, i) ? $r[i](t) : t; }, Sn = (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, Tt = (t = {}, e = {}, r = {}, i = "") => Qr(t, (n, o) => o === "type" && n === "code") ? Zr(t, e, r, i) : ei(t, e, i), Qr = (t, e = () => !1) => f.some(t, (r) => !!f.some(r, e) || (f.isEmpty(r) || !f.isPlainObject(r) && !f.isArray(r) ? void 0 : Qr(r, e))), Zr = async (t = {}, e = {}, r = {}, i = "") => { 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: d = i } = t[o]; switch (s) { case "code": try { a = await Me.exec(l, e, r); } 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 = ne.getPageParams(l); break; case "string": a = l; } a ?? (a = d); } else a = await Zr(t[o], e, r, i); f.set(n, o, a); } return n; }, ei = (t = {}, e = {}, r = "") => Object.keys(t || {}).reduce((i, 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 = r } = 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 = ne.getPageParams(s); break; case "string": o = s; } o ?? (o = l); } else o = ei(t[n], e, r); f.set(i, n, o); } return i; }, {}), It = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((r) => It(r, e)) : Object.keys(t).reduce((r, i) => (e[i] ? r[e[i]] = It(t[i], e) : r[i] = It(t[i], e), r), {}) : t, Oo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { const e = 16 * Math.random() | 0; return (t === "x" ? e : 3 & e | 8).toString(16); }), Ro = (t) => { var e, r; return t ? (r = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : r.name : ""; }, Fo = (t) => { var e, r; return t ? (r = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : r.category : ""; }, jo = (t) => { var e, r; return t ? (r = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : r.owner : ""; }, $n = (t, e = 32, r = "auto") => { const i = _t(t), n = r === "auto" ? "x64" : r; if (e === 32) return Lt.x86.hash32(i).toString(); if (e === 128) return n === "x64" ? Lt.x64.hash128(i) : Lt.x86.hash128(i); throw new Error("bits 只能是 32 或 128"); }, _t = (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(_t).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${_t(t[e])}`).join(",") + "}" : String(t), En = () => { let t = 1; const e = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new Map(); return (...i) => i.length === 0 ? "" : i.map((n) => { return String((o = n) === null || typeof o != "object" && typeof o != "function" ? (r.has(o) || r.set(o, t++), r.get(o)) : (e.has(o) || e.set(o, t++), e.get(o))); var o; }).join("::"); }, Pn = (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; } }, Ao = (t, e = "") => { if (!t || typeof t != "string" || Pn(t)) return t; let r = e; return !r && typeof window < "u" && window.location && (r = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? r ? `${r}${t}` : t : r ? `${r}/${t}` : t; }, Ot = () => { const t = J(!0), [, e] = $.useReducer((r) => r + 1, 0); return V(() => () => t.current = !1, []), () => t.current && e(); }, Lo = (t) => { const [e, r] = A(t), i = J(null), n = Y((o, a) => { i.current = a, r(o); }, []); return V(() => { i.current && (i.current(e), i.current = null); }, [e]), [e, n]; }, mt = (t = (i) => { }, e, r = f.isEqual) => { const i = $.useRef(); r(e, i.current) || (i.current = f.cloneDeep(e)), $.useEffect(t, [i.current]); }, ft = mt, ti = (t, e = "string") => { var r; if (!Array.isArray(t)) return t; for (let i = 0; i < t.length; i++) t[i].value = ue((r = t[i]) == null ? void 0 : r.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = ti(t[i].children, e)); return t; }, Io = (t, e = "json", r = "string", i, n = null) => { const [o] = oe.useForm(i), [a, s] = A([{ label: "无", value: "", disabled: !0 }]), l = J([]), d = oe.useWatch((u) => l.current.length === 0 ? null : f.pick(u, l.current), o) || null; return V(() => { 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(ue(u, "array")); }).catch((u) => console.error("useOptions", u)) : t && s(ue(t, "array")); }, [t, e, d]), ti(a, r); }, Mo = (t) => { const [e, r] = A(), 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 n = (o) => I.request(i, !1).resp((a) => (console.log("useSubscribeRequest", o), r(a), a)); return mt(() => { let o = null; return n().then((a) => { o = Hr.subscribe(f.throttle(n, 180, { leading: !1, trailing: !0 }), a.res); }), () => o == null ? void 0 : o(); }, i), e; }, Nn = (t, e) => Y((r) => { const i = {}; for (const [n, o] of Object.entries(r)) { 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 = ne.getCurrentRoute(); s != null && s.uuid && ne.redirect(s.uuid, { ...ne.getPageParams(), [a.type]: { [a.value || n]: o } }, { isReplaceRouteHistory: !0 }); } else i[n] = o; } Object.keys(i).length > 0 && e(i); }, [t, e]), ri = (t, e = {}, r = {}, i = []) => { const [n, o] = A({}), [a, s] = A({}), l = Fr(a), d = ne.usePageParams(); jr(() => { Promise.resolve(Tt(t, e, r)).then(s); }, [t, e, d, ...i]), V(() => { 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 = Nn(t, (h) => { o((g) => ({ ...g, ...h })); }), p = q(() => Object.fromEntries(Object.entries(n).filter(([h, g]) => g !== a[h])), [n, a]); return [n, u, p]; }, vn = (t) => { const [e, r] = $.useState({ items: [], hides: [] }); return $.useEffect(() => { t && I.get(`/api/_/${t}`).then(({ pk: i, uuid: n, code: o, resource: a, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, listenChangeFields: h, listenChangeFieldsFunc: g, fields: y, theme: w, themeSetting: C, groups: S }) => ({ pk: i, uuid: n, code: o, resource: a, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, theme: w, themeProps: C, groups: S, listenChangeFields: h, listenChangeFieldsFunc: g, ...y.reduce((P, k) => { var E; return (E = k == null ? void 0 : k.field) != null && E.hidden ? P.hides.push(k == null ? void 0 : k.field) : P.items.push(k), P; }, { items: [], hides: [] }) })).then(r); }, [t]), e; }, xn = ({ max: t = 0, min: e = 0, type: r = "", message: i, pattern: n, required: o = !1, validator: a } = {}, s, l) => { const [d, u] = A([]); return V(() => { 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 (r) { case "string": p.push({ type: r, max: t, min: e, message: i || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); break; case "pattern": p.push({ type: "string", pattern: n, message: i }); 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(i) : Promise.resolve(); } })); } u(p); }, [t, e, r, i, n, o, a]), d; }, Tn = (t, e, r) => { const [i, n] = A(null); return V(() => { const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = r || {}; e && I.request({ method: a, url: f.trimEnd(`${o}/${e}`, "/") }).then((s) => { n(s); }); }, [t, e, r]), i; }, On = (t, e, r) => Y((i, n = { serialize: (o) => o, onSuccess: () => { }, onFail: (o) => (o == null ? void 0 : o.errorFields) && ie.error("请先完善表单信息", { duration: 2e3 }) }) => { const o = i.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = r || {}; return i.validateFields().then((l) => o ? f.pick(l, [o]) : l).then(n.serialize).then((l) => I.request({ method: s, url: f.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(n.onSuccess)).catch(n.onFail); }, [t, e, r]), Rn = (t, e, r, i) => { const n = Tn(e, r, i); V(() => { n ? t.setFieldsValue(n) : t.resetFields(); }, [t, n]); const o = On(e, r, i); return f.partial(o, t); }, Fn = (t, e, r = [], i = {}) => { const n = J({}), o = J(), a = f.debounce(Ot(), 180), s = ["disabled", "required"], l = (h, g) => { s.includes(h) && (n.current[h] = g), a(); }, d = q(() => ({ setDisabled: (h) => l("disabled", h), setRequired: (h) => l("required", h), getDisabled: () => n.current.disabled, getRequired: () => n.current.required }), [e]), [u, p] = _r(e, -1, {}, d, i); if (!p && o.current != u && (u >= 0 || !f.isEmpty(r == null ? void 0 : r[u]))) { o.current = u; const { widget: h, widgetPrefix: g, props: y } = r == null ? void 0 : r[u]; t = zr(h, g), n.current = f.merge(y, f.pick(n.current, s)); } return [t, n.current]; }, Er = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Vo = ({ value: t, onChange: e }, r = null) => { const i = J(), [n] = oe.useForm(r), o = J({}); return ft(() => { f.isEqual(i.current, t) || n.setFieldsValue(t); }, [t]), V(() => () => n.resetFields(), []), [q(() => n.__INTERNAL__ ? n : { ...n, __INTERNAL__: { itemRef: (a) => (s) => { const l = Er(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 = Er(a); return o.current[s]; } }, [n]), (a, s) => { i.current = s, e == null || e(s); }]; }, rr = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: r, subWidgets: i = [], basicForm: n, ...o }) => { const a = zr(t, e), [s, l] = Fn(a, r, i, n), [d, u] = A(); return V(() => { s && pe.getWidgetComponent(s).then(({ defaultProps: p = {}, default: h }) => ({ default: jn(h, p, n) })).catch((p) => ({ default: () => `${p}` })).then((p) => u($.createElement(p.default, o))); }, [s]), d && $.cloneElement(d, { ...o, ...l }); }, jn = (t, e = {}, r = null) => (i) => { const { type: n, code: o, label: a, noStyle: s, style: l, placeholder: d, required: u = !1, extras: p, validators: h, help: g, isVirtual: y, $isReserved: w, initialValue: C, initialValueLanguage: S, ...P } = f.omit(f.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = xn(Object.assign({}, h, u ? { required: !0 } : {}), o, n), E = q(() => { const D = Object.keys((e == null ? void 0 : e.extras) || {}); return f.over([f.partialRight(f.pick, D), f.partialRight(f.omit, D)]); }, [e == null ? void 0 : e.extras]), [T, j] = E(P), F = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, M = Y((D) => D == null ? void 0 : ue(D, n), [n]); return m(Qt, { name: o, rules: k, initialValue: M(C), normalize: M, children: (D, R, W) => { var U; return m(t, { type: n, rcform: W, basicForm: r, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: g || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((U = k == null ? void 0 : k[0]) == null ? void 0 : U.required) || !1, ...F }, fieldProps: { placeholder: d, ...j, ...D }, $setting: Object.assign({}, p, T) }); } }); }, ir = ({ name: t, form: e = null, basicForm: r = null, style: i = {}, className: n, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: d = [], hides: u = [], primaryKey: p = 0, formProps: h = {}, formFields: g = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: C, theme: S, themeProps: P = {}, groups: k = [{ key: "default", label: "默认" }], children: E, ...T }) => { const [j] = oe.useForm(e), F = Y((R, W) => { C == null || C(R, W), w && Array.isArray(y) && Me.exec(w, { changedValues: R, allValues: W }, { getFieldValue: j.getFieldValue, setFieldValue: j.setFieldValue, setFieldsValue: j.setFieldsValue, isFieldTouched: j.isFieldTouched, isFieldsTouched: j.isFieldsTouched }).catch((U) => console.error("onFormValuesChange", t, U)); }, [t, j, C, y, w]), M = q(() => [{ name: "__PROPS__", value: h }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, h, g]), D = (R, W, U) => { const K = er(W, rr, r), he = Ur(T); return L("div", { ...he, className: O("ff-grid-layout-form", n), 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": o, "--grid-layout-row-height": `${a}px` }, children: [K, U && $.cloneElement(U, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: W, basicForm: r })] }); }; return L(oe, { ...T, form: j, fields: M, onValuesChange: F, children: [S ? m(Gr, { ...P, items: k, theme: S, itemRender: D, fields: d, children: E, basicForm: r }) : D(0, d, E), u == null ? void 0 : u.map((R) => { var W; return m(Qt, { name: R.code, children: m(An, { form: j, basicForm: r, name: R.code, type: R.type, initialValue: R.initialValue, initialValueLanguage: (W = R.extras) == null ? void 0 : W.initialValueLanguage }) }, JSON.stringify(R.code)); })] }); }, An = ({ type: t, initialValue: e, initialValueLanguage: r, onChange: i, basicForm: n }) => { const [o, a] = _r(r == "javascript" && e, r == "javascript" ? void 0 : e, {}, {}, n); return V(() => { r == "javascript" ? i(ue(o, t)) : e && i(ue(e, t)); }, [t, e, o]), null; }; ir.propTypes = { fields: b.array, hides: b.array }; const Ln = /* @__PURE__ */ ((t) => ({ code: e, isPreview: r = !1, ...i }) => { const { align: n, autoComplete: o, resource: a, items: s, hides: l, rowHeight: d, marginX: u, marginY: p, cols: h, listenChangeFields: g, listenChangeFieldsFunc: y, pk: w, uuid: C, theme: S, themeProps: P, groups: k } = vn(e), E = q(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: C }], [w, e, C, a]); return m(t, { name: e, autoComplete: o, theme: S, themeProps: P, groups: k, ...i, formFields: E, listenChangeFields: g, listenChangeFieldsFunc: y, fields: s, hides: l, cols: h, rowHeight: d, itemMargin: [u, p] }); })(ir), ii = ({ $setting: t, $close: e, extras: r, code: i, primaryKey: n, ...o }) => { const [a] = oe.useForm(), s = Rn(a, i, n, t); return m(ee, { actions: L($.Fragment, { children: [m(x, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), m(x, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: r, children: m(Ln, { form: a, code: i, primaryKey: n, ...o }) }); }, Pr = /* @__PURE__ */ new Set(), Gt = (t = [], e = 0) => { const r = t[e]; if (r.length && !Pr.has(r)) { const i = document.createElement("script"); i.setAttribute("src", r), i.setAttribute("data-namespace", r), t.length > e + 1 && (i.onload = () => { Gt(t, e + 1); }, i.onerror = () => { Gt(t, e + 1); }), Pr.add(r), document.body.appendChild(i); } }, $t = ({ className: t, type: e, style: r = {}, ...i }) => m("span", { role: "img", className: O("ff-iconfont", t), style: r, ...i, children: m("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: m("use", { xlinkHref: `#${e}` }) }) }); $t.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, $t.init = Gt; const In = (t, e, r, i) => ne.redirect(r, e, i), Mn = (t, e = {}, r, i = {}) => { var o; const n = (o = i.router) == null ? void 0 : o.reduce((a, [s, l, d]) => { const u = f.get(e, ["router", s]); if (!u && u !== 0 && l) throw `请传入 ${d}`; return `${a}/${u}`; }, `/api/${r}`); return I.del(n, e.param).msg(); }, Nr = (t, e, r, { status: { loading: i, disabled: n }, setStatus: o, listFn: a }) => { const s = { loading: (l) => l === void 0 ? i : o((d) => ({ ...d, loading: l })), disabled: (l) => l === void 0 ? n : o((d) => ({ ...d, disabled: l })), list: a }; return f.isFunction(r) ? r.call(null, e, s) : f.isString(r) && r ? Me.exec(r, e, s) : null; }, vr = (t, e, r, i, n) => f.isString(r) && r ? pe.getWidgetComponent(r).then(({ default: o }) => ie.modal(o, { ...e, $setting: i }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n)).catch((o) => { ie.error(r, { content: o.toString() }); }) : ie.modal(r, { ...e, $setting: i }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n), Vn = (t, e, r, i, n) => ie.modal(ii, { ...e, $setting: i, code: r }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n), Dn = (t, e, r, i, n) => ie.modal(tr, { base62params: e, $setting: i, listCode: r }, n != null && n.title ? { ...n, title: f.template(n.title)(t) } : n), zn = ({ widget: t, widgetType: e, widgetData: r, widgetProps: i, widgetSetting: n, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { const l = ge(se), [d, u] = A({ leading: !0, trailing: !1 }), p = q(() => { switch (e) { case "redirect": return f.partialRight(In, t, n); case "func": return f.partialRight(Nr, (n == null ? void 0 : n.code) ?? t, { status: d, setStatus: u, listFn: l }); case "component": case "fsdpf-component": return f.partialRight(vr, t, n, o); case "grid-layout-form": return f.partialRight(Vn, t, n, o); case "data-list": return f.partialRight(Dn, t, n, o); case "destroy": return f.partialRight(Mn, t, n, o); default: if (or(t) || $.isValidElement(t)) return f.partialRight(vr, t, n, o); if (f.isFunction(t)) return f.partialRight(Nr, (n == null ? void 0 : n.code) || t, { status: d, 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(Tt(i, h, { list: l })).then((g) => p(h, { ...r, ...g })).then((g) => a == null ? void 0 : a(g)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; }, ni = ({ type: t, name: e, className: r, icon: i, iconPosition: n, size: o }, a = "default") => q(() => { const s = { type: "primary", className: O("ff-button", r), 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 = O(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), i && (s.icon = m($t, { type: i })), e && (s.children = e), s; }, [a, t, r, i, n]), Rt = ({ data: t, widget: e, widgetType: r = "fsdpf-component", widgetData: i, widgetProps: n, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: d, extras: u }) => { const p = ge(se), [h, g] = A(!1), [y, w] = A("hover"), [C, S] = ri(n, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [P, k] = A(), { placement: E, align: T, zIndex: j, arrow: F = { pointAtCenter: !0 }, getPopupContainer: M, isPopupMountBodyContainer: D = !0, ...R } = a || {}; V(() => { r == "grid-layout-form" ? k($.createElement(ii, { ...i, $setting: o, code: e })) : r == "data-list" ? k($.createElement(tr, { base62params: t, $setting: o, listCode: e })) : f.isString(e) ? pe.getWidgetComponent(e).then(({ default: K }) => { k($.createElement(K, { ...i, $setting: o })); }).catch((K) => k(K.toString())) : or(e) ? k($.createElement(e, { ...i, $setting: o })) : $.isValidElement(e) && k($.cloneElement(e, { ...i, $setting: o })); }, [e, r, i]); const W = (K, he = !1) => (g(K), !K && w("hover"), K ? l == null ? void 0 : l(C) : s == null ? void 0 : s(he)), U = (K) => { g(!0), w("click"); }; return m(Ii, { zIndex: j, placement: E, onPopupClick: U, onClick: U, open: h, align: T, arrow: F, trigger: y, getPopupContainer: M || D ? void 0 : (K) => K, content: m(Wn, { ...R, extras: u, children: P && $.cloneElement(P, { ...C, $setProps: S, $close: (K) => W(!1, K) }) }), children: d, onOpenChange: W }); }, Wn = ({ title: t, className: e, classNames: r, children: i, extras: n, width: o, height: a, ...s }) => { const [l, d] = A({}), u = Y((y, w) => d((C) => ({ ...C, [y]: w })), []), p = Y((y) => d((w) => ({ ...w, [y]: void 0 })), []), h = t ? $.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = n ?? $.createElement("div", { className: "ff-popup-reserved-extras" }, n); return m(ht.Provider, { value: { ele: l, mount: u, unmount: p }, children: L("div", { className: O("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [L("div", { className: O("ff-popup-header", "ff-popover-header", r == null ? void 0 : r.header), children: [h, l == null ? void 0 : l["sub-title"]] }), m("div", { className: O("ff-popup-body", "ff-popover-body", r == null ? void 0 : r.body), children: i }), L("div", { className: O("ff-popup-footer", "ff-popover-footer", r == null ? void 0 : r.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 yt = (t) => function({ className: e, variant: r, children: i, name: n, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: u, data: p, loading: h, disabled: g, tooltip: y, confirm: w, widget: C = () => { }, widgetType: S, widgetData: P, widgetProps: k, widgetSetting: E, widgetContainerProps: T, ...j }) { const { mode: F, ...M } = T || {}, D = ni({ className: e, name: n, type: a, icon: o, iconPosition: s }, r ?? t), R = m(kt, { ...D, ...j, children: i || n }); if (F === "popover" && !["destroy", "redirect", "func"].includes(S)) return m(Rt, { data: p, widget: C, widgetType: S, widgetData: P, widgetProps: k, widgetSetting: E, widgetContainerProps: M, onAfterClick: d, onBeforeClick: u, children: R }); const W = f.isEmpty(y) || !y.enabled ? {} : y, U = f.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [K, he] = A(!1), [ae, { disabled: z, loading: le }] = zn({ widget: C, widgetType: S, widgetData: P, widgetProps: k, widgetSetting: E, widgetContainerProps: M }, { onAfterClick: d, onBeforeClick: u }); return m(Mi, { okText: "确定", cancelText: "取消", getPopupContainer: (_) => _, ...U, disabled: z || g, open: K, onOpenChange: (_) => { if (!_) return he(_); U.enabled ? he(_) : ae(p); }, onConfirm: (_) => { ae(p, _); }, onClick: (_) => { _.stopPropagation(); }, children: m(Vi, { getPopupContainer: (_) => _, ...W, title: K ? null : W == null ? void 0 : W.title, trigger: ["hover", "click"], children: $.cloneElement(R, { loading: le || h, disabled: z || g }) }) }); }, x = yt("default"); x.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 Bn = yt("link"), Un = yt("circle"), qn = yt("round"), Kn = yt("dashed"), xr = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: r = (g, y, w) => { }, onBeforeClick: i = (g, y, w) => { }, labelVariant: n = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: d = (g, y) => m(x, { ...g, data: y }, g.uuid || Dt()), widgetContainerProps: u = {}, children: p, data: h }) => { if (f.isEmpty(t)) return p; const [g, y] = q(() => (t || []).reduce((C, S) => { const P = e.indexOf(S.widgetType); return P === -1 ? C[1].push(S) : C[0] ? P < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = S) : C[1].push(S) : C[0] = S, C; }, [null, []]), [t, e]); a ? p = a(g, h) || p : p || (p = m(kt, { ...ni(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), n) })); const w = y.map((C) => d(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(r, C, h), onBeforeClick: f.partialRight(i, C, h) }, { size: l, variant: s }), h)); return 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: w, onAfterClick: f.partialRight(r, g, h), onBeforeClick: f.partialRight(i, g, h), children: p }); }; xr.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...x.propTypes, widgetType: x.propTypes.widgetType.isRequired })), btnSize: x.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: x.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: x.propTypes.widgetContainerProps, data: x.propTypes.data }, x.Link = Bn, x.Link.defaultProps = x.defaultProps, x.Link.propTypes = x.propTypes, x.Circle = Un, x.Circle.defaultProps = x.defaultProps, x.Circle.propTypes = x.propTypes, x.Round = qn, x.Round.defaultProps = x.defaultProps, x.Round.propTypes = x.propTypes, x.Dashed = Kn, x.Dashed.defaultProps = x.defaultProps, x.Dashed.propTypes = x.propTypes, x.Popover = Rt, x.GroupPopover = xr; const Hn = ({ fields: t, formProps: e, $close: r }) => { const [i] = oe.useForm(), n = q(() => [{ name: "__PROPS__", value: e }], [e]); return m(ee, { actions: L($.Fragment, { children: [m(x, { name: "取消", widget: () => r(!1) }), m(x, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(r) })] }), children: m(oe, { fields: n, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => m(rr, { code: o, ...a }, o)) }) }); }, Jn = ({ className: t, classNames: e, $close: r, children: i, title: n, subTitle: o, actions: a, extras: s, ...l }) => L(Hi, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [L("div", { className: O("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [m("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: m(Zt, { type: "close" }) }), n, o] }), m("div", { className: O("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), L("div", { className: O("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), _n = ({ className: t, classNames: e, $close: r, $event: i, children: n, title: o, subTitle: a, actions: s, extras: l, placement: d, ...u }) => { const p = (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(Ji, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => L("div", { className: O("ff-modal-content ff-popup", t), children: [L("div", { className: O("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [m("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: u.onClose, children: m(Zt, { type: "close" }) }), o, a] }), m("div", { className: O("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: n }), L("div", { className: O("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) }); }, oi = ({ placement: t, $close: e, $event: r, children: i, title: n, ...o }) => { const [a, s] = A({}), [l, d] = A(!0), u = Y((y, w) => s((C) => ({ ...C, [y]: w })), []), p = Y((y) => s((w) => ({ ...w, [y]: void 0 })), []); let h = { ...o, className: a.rootClassName, title: a.title || n && $.createElement("div", { className: O("ff-popup-title") }, n), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: i, $close: e, $event: r, onClose: () => d(!1) }; const g = () => { e(!1); }; return m(ht.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? m(Jn, { ...h, placement: t, open: l, afterOpenChange: (y) => !y && g() }) : m(_n, { ...h, visible: l, afterClose: g }) }); }; oi.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; const Gn = ({ widget: t, widgetProps: e, $close: r, onSetProps: i }) => { const [n, o] = A(e || {}), a = Fr(e); jr(() => { const l = a ?? {}, d = e ?? {}, u = Object.keys({ ...l, ...d }).reduce((p, h) => (l[h] !== d[h] && (p[h] = d[h]), p), {}); Object.keys(u).length > 0 && o((p) => ({ ...p, ...u })); }, [e]); const s = Y((l) => { o((d) => ({ ...d, ...l })), i == null || i(l); }, [i]); return $.isValidElement(t) ? $.cloneElement(t, { ...n, $close: r, $setProps: s }) : t != null && t.name || wr.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === wr.ForwardRef ? $.createElement(t, { ...n, $close: r, $setProps: s }) : t; }, re = () => { const [t, e] = Ni({ 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" }), [, r] = $.useReducer((o) => o + 1, 0); V(() => { re.$onClick = i, re.$queue.forEach(([o, a, s], l, d) => { n([a, s], ...o), delete d[l]; }); }, []); const i = (o, a = {}, s = {}) => new Promise((l, d) => n([l, d], o, a, s)), n = ([o, a], s, l = {}, d = {}) => { const u = re.$index++, p = (y) => ((w, C) => (re.$popups.delete(w), r(), C == null ? void 0 : C()))(u, () => o(y)); if (s === Vr) return t.open({ ...d, key: u, content: $.createElement(s, { ...l, $close: () => t.close(u) }) }); const { $setProps: h, ...g } = l; re.$popups.set(u, $.createElement(oi, { maskClosable: !1, $event: g == null ? void 0 : g.$event, ...d, key: u, $close: p }, $.createElement(Gn, { widget: s, widgetProps: g, $close: p, onSetProps: h }))), r(); }; return L($.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, r) => { re.$queue.push([t, e, r]); }); const Tr = (t, e, r = {}) => re.$onClick(t, e, r), Mt = (t, { showProgress: e, duration: r, ...i } = { duration: 1.5 }) => re.$onClick(Vr, { content: t, ...i }, { showProgress: e, duration: r }), ie = { modal: Tr, confirm: (t, e = {}) => re.$onClick(_i, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, r = {}) => Tr(Hn, { formProps: r, 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 ai = () => { const t = window.localStorage.getItem(Ct); 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, ai()), 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) => ie[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && ne.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); var Xe, Ue, Qe; const Q = class Q { constructor() { v(this, "appUrl", ""); N(this, Xe, null); return c(Q, Ue) || (B(Q, Qe, new zt()), B(Q, Ue, new Proxy(this, { get(e, r) { if (r in e) { const i = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), r); return i != null && i.get ? Reflect.get(e, r, e) : typeof e[r] == "function" ? e[r].bind(e) : e[r]; } return c(Q, Qe)[r]; } }))), c(Q, Ue); } init(e, r, i) { De.defaults.baseURL = this.appUrl = i, De.defaults.timeout = 15e3, c(Q, Qe).init(e, r, De); } get driver() { return De; } get headers() { return ai(); } mock(e = {}) { return c(this, Xe) ?? B(this, Xe, new Ti(De, { onNoMatch: "passthrough", ...e })); } unmock() { var e; (e = c(this, Xe)) == null || e.restore(), B(this, Xe, null); } }; Xe = new WeakMap(), Ue = new WeakMap(), Qe = new WeakMap(), N(Q, Ue), N(Q, Qe), v(Q, "getInstance", () => c(Q, Ue) ?? B(Q, Ue, new Q())); let Yt = Q; const I = Yt.getInstance(); class nr extends Error { constructor(e, r) { super(r), Error.captureStackTrace && Error.captureStackTrace(this, nr), !r instanceof rt && (this.name = `${e} Error Runtime`); } } class rt extends Error { constructor(e, ...r) { super(...r), Error.captureStackTrace && Error.captureStackTrace(this, rt), this.name = `${e} Not Found`; } } const Vt = "mine", Ct = "token"; var Ie, Ze; const Ce = class Ce { constructor() { N(this, Ze, /* @__PURE__ */ new Map()); v(this, "setVendor", (e, r) => c(this, Ze).set(e, new Ir(r, async (i, n) => { var a, s; if (!(i != null && i.default)) throw "@pkg not found"; let o = () => n; switch ("function") { case typeof (o = (a = i.default) == null ? void 0 : a[`./${n}/index.jsx`]): case typeof (o = (s = i.default) == null ? void 0 : s[`./${n}/index.js`]): return o(); } throw new rt(n); }))); v(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 [, r] = e == null ? void 0 : e.split("@pkg/"); if (!r) throw new rt(e); try { return c(this, Ze).has("pkg") ? await c(this, Ze).get("pkg").get(r) : await import(`${I.appUrl}/api/pkg-import/web?name=${e}`); } catch (i) { throw new nr(e, i); } }); v(this, "getRoutes", () => I.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: r, ...i }) => [r, { uuid: r, ...i }])).then((e) => new Map(e))); v(this, "getMenus", () => I.get("/api/my-menu")); v(this, "getConfigure", () => I.get("api/init-configure")); v(this, "getWidgetOperationAuth", () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((r, { uuid: i, auth: n }) => [...r, [i, n]], []))); v(this, "getPhoneNumber", (e) => I.get(`/api/user-wx-phone-number/${e}`)); v(this, "getUserToken", () => { const e = window.localStorage.getItem(Ct); if (!e) return ""; const r = e.split("."); if (!Array.isArray(r) || r.length !== 3) throw "登录令牌无效!"; const { iat: i } = JSON.parse(window.atob(r[1])); if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - i > 2592e3) throw "登录令牌已过期, 请重新登录!"; return e; }); v(this, "checkUserToken", () => { try { return !!this.getUserToken(); } catch { return !1; } }); v(this, "getUserInfo", (e = !0) => { var r; try { const i = this.getUserToken(); if (!i) return Promise.resolve(null); const { iat: n } = JSON.parse(window.atob((r = i == null ? void 0 : i.split(".")) == null ? void 0 : r[1])), { iat: o, ...a } = I.decode(window.localStorage.getItem(Vt) || "", {}); return o === n ? Promise.resolve(a) : I.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Vt, I.encode({ ...s, iat: n })), s)); } catch (i) { console.error(i), e && ie.error("请登录").then(this.logout); } return Promise.resolve(null); }); v(this, "login", (e, r, i = {}) => I.post("/api/user-token", { username: e, passwd: Oi.hash(r), platform: "web", ...i }).then(({ token: n }) => (window.localStorage.setItem(Ct, n), n)).then(async (n) => (await this.initAppEnv(), n))); v(this, "logout", (e) => (window.localStorage.removeItem(Vt), window.localStorage.removeItem(Ct), e == null ? void 0 : e())); v(this, "initAppEnv", async () => { const [e, r, i, n] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); return Dr.init(e), qe.init(n), ne.init(r, i), $t.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: r, menus: i, configures: n }; }); if (c(Ce, Ie)) return c(Ce, Ie); } }; Ie = new WeakMap(), Ze = new WeakMap(), N(Ce, Ie, null), v(Ce, "getInstance", () => (c(Ce, Ie) || B(Ce, Ie, new Ce()), c(Ce, Ie))); let Xt = Ce; const pe = Xt.getInstance(), Yn = $.createContext({ user: {}, initUser: () => { }, initUserComplete: !1 }), Xn = $.createContext({ set: () => { }, get: () => { }, assign: () => { }, currentRoute: () => { } }), or = (t) => !!(t != null && t.name) && (t.prototype instanceof $.Component || /^[A-Z]/.test(t.name)), Qn = (t, e) => { if (!t || typeof window > "u") return; let r = document.querySelector(`style[ff-style-token="${e}"]`); return r ? (r.innerHTML = t, t) : (r = document.createElement("style"), r.setAttribute("ff-style-token", e), r.setAttribute("type", "text/css"), r.innerHTML = t, document.head.appendChild(r), t); }, Zn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Yn, AppGlobalParamsContext: Xn, cache: Ir, configure: qe, default: pe, func: Me, http: I, insertStyle: Qn, isReactComponent: or, route: ne }, Symbol.toStringTag, { value: "Module" })); var ve, et, xe, Se, $e, te, Z, G, Ee, ct, dt, ut, pt, xt, gt; const ar = class ar { constructor(e, r = "/") { N(this, ve, "/"); N(this, et, /* @__PURE__ */ new Set()); N(this, xe, (e) => { for (const r of c(this, et)) try { r(e); } catch (i) { console.error("Error in VirtualFS event listener:", i); } }); N(this, Se, (e) => { const r = Date.now(); if (e && (e.lastModified = r), c(this, ve) != "/") { const i = c(this, G).call(this, c(this, ve)); i && (i.lastModified = r); } this.root.lastModified = r; }); N(this, $e, (e) => { let r = me.normalize(e); return r.startsWith("/") || (r = "/" + r), r.length > 1 && r.endsWith("/") && (r = r.slice(0, -1)), r; }); N(this, te, (e) => { const r = me.join(c(this, ve), e); return c(this, $e).call(this, r); }); N(this, Z, (e) => { if (!e || typeof e != "string") return !1; const r = c(this, $e).call(this, e); return !r.includes("..") && r.startsWith("/"); }); N(this, G, (e) => { var o; const r = c(this, $e).call(this, e); if (r === "/") return this.root; const i = r.split("/").filter((a) => a); let n = this.root; for (const a of i) { 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; }); N(this, Ee, (e) => { const r = c(this, $e).call(this, e), i = me.basename(r), n = me.dirname(r); return { parent: c(this, G).call(this, n), name: i }; }); N(this, ct, (e, r, i) => i === !1 ? e : i === "root" ? e.map((n) => me.join(r, n)) : i === !0 || i === "working" ? e.map((n) => me.relative(c(this, ve), me.join(r, n))) : e); N(this, dt, async (e, r, i, n = "") => { const o = [], a = c(this, G).call(this, e); if (!a || a.type !== "dir") return o; const s = a.children; for (const l of s) { const d = l.name, u = e === "/" ? `/${d}` : `${e}/${d}`, p = n ? `${n}/${d}` : d; try { if (l.type === "file") r(i ? p : d) && o.push(p); else if (l.type === "dir" && i) { const h = await c(this, dt).call(this, u, r, i, p); o.push(...h); } } catch { continue; } } return o; }); N(this, ut, async (e, r, i, n = "") => { const o = [], a = Array.isArray(r) ? r : [r], s = c(this, G).call(this, e); if (!s || s.type !== "dir") return o; if (!i) { for (const d of a) if (c(this, pt).call(this, d)) { const u = await c(this, xt).call(this, e, d); o.push(...u); } else { const u = me.join(e, d), p = c(this, $e).call(this, u); c(this, G).call(this, p) && o.push(d); } return o; } const l = s.children; for (const d of l) { const u = d.name, p = e === "/" ? `/${u}` : `${e}/${u}`, h = n ? `${n}/${u}` : u; try { if (d.type === "file") for (const g of a) { let y = !1; if (y = c(this, pt).call(this, g) ? c(this, gt).call(this, u, g) : u === g, y) { o.push(h); break; } } else if (d.type === "dir") { const g = await c(this, ut).call(this, p, r, i, h); o.push(...g); } } catch { continue; } } return o; }); N(this, pt, (e) => /[*?[\]{}]/.test(e)); N(this, xt, async (e, r) => { const i = [], n = c(this, G).call(this, e); if (!n || n.type !== "dir") return i; const o = n.children.map((a) => a.name); for (const a of o) c(this, gt).call(this, a, r) && i.push(a); return i; }); N(this, gt, (e, r) => { const i = r.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (n, o) => "(" + o.split(",").join("|") + ")"); return new RegExp(`^${i}$`).test(e); }); var i, n, o; B(this, ve, r), 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 = "/"), (n = this.root).children ?? (n.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now()))); } async stat(e) { const r = c(this, te).call(this, e); if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const i = c(this, G).call(this, r); 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 r = c(this, te).call(this, e); if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const i = c(this, G).call(this, r); 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((n) => n.name); } async readFile(e) { const r = c(this, te).call(this, e); if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const i = c(this, G).call(this, r); 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, r) { const i = c(this, te).call(this, e); if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { parent: n, name: o } = c(this, Ee).call(this, i); 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((d) => d.name === o), s = a >= 0, l = { name: o, type: "file", content: r, lastModified: Date.now() }; s ? n.children[a] = l : n.children.push(l), c(this, Se).call(this, n), c(this, xe).call(this, { action: s ? "update" : "create", path: i, type: "file", timestamp: Date.now() }); } async mkdir(e, r = {}) { const i = c(this, te).call(this, e); if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { recursive: n } = r; if (n) { const o = i.split("/").filter((s) => s); let a = "/"; for (const s of o) if (a = me.join(a, s), !c(this, G).call(this, a)) { const { parent: l, name: d } = c(this, Ee).call(this, a); if (l && l.type === "dir") { const u = { name: d, type: "dir", children: [], lastModified: Date.now() }; l.children.push(u), c(this, Se).call(this, l), c(this, xe).call(this, { action: "create", path: c(this, $e).call(this, a), type: "dir", timestamp: Date.now() }); } } } else { const { parent: o, name: a } = c(this, Ee).call(this, i); 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), c(this, Se).call(this, o), c(this, xe).call(this, { action: "create", path: i, type: "dir", timestamp: Date.now() }); } } async unlink(e) { const r = c(this, te).call(this, e); if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const { parent: i, name: n } = c(this, Ee).call(this, r); if (!i) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); const o = i.children.findIndex((a) => a.name === n); if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); if (i.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); i.children.splice(o, 1), c(this, Se).call(this, i), c(this, xe).call(this, { action: "delete", path: r, type: "file", timestamp: Date.now() }); } async rmdir(e, r = {}) { const i = c(this, te).call(this, e); if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); const { parent: n, name: o } = c(this, Ee).call(this, i); 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 (!r.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); n.children.splice(a, 1), c(this, Se).call(this, n), c(this, xe).call(this, { action: "delete", path: i, type: "dir", timestamp: Date.now() }); } async rename(e, r) { const i = c(this, te).call(this, e), n = c(this, te).call(this, r); if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${r}'`); if (!c(this, G).call(this, i)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${r}'`); const { parent: o, name: a } = c(this, Ee).call(this, i), { parent: s, name: l } = c(this, Ee).call(this, n); if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${r}'`); if (c(this, G).call(this, n)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${r}'`); const d = o.children.findIndex((p) => p.name === a), u = { ...o.children[d], name: l, lastModified: Date.now() }; o.children.splice(d, 1), s.children.push(u), c(this, Se).call(this, o), o !== s && c(this, Se).call(this, s), c(this, xe).call(this, { action: "rename", path: n, oldPath: i, type: u.type, timestamp: Date.now() }); } async exists(e) { const r = c(this, te).call(this, e); return c(this, Z).call(this, r) ? c(this, G).call(this, r) !== null : !1; } getLastModified() { return this.root.lastModified; } subscribe(e) { if (typeof e != "function") throw new Error("Callback must be a function"); return c(this, et).add(e), () => { c(this, et).delete(e); }; } getWorkingDirectory() { return c(this, ve); } scope(e = "/") { const r = c(this, $e).call(this, e); if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); const i = c(this, G).call(this, r); 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 ar(this.root, r); } async findFiles(e, r, i = {}) { const n = c(this, te).call(this, e); if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); const o = c(this, G).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 } = i; if (typeof r == "function") { const d = await c(this, dt).call(this, n, r, a); return c(this, ct).call(this, d, n, s); } const l = await c(this, ut).call(this, n, r, a); return c(this, ct).call(this, l, n, s); } }; ve = new WeakMap(), et = new WeakMap(), xe = new WeakMap(), Se = new WeakMap(), $e = new WeakMap(), te = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Ee = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), pt = new WeakMap(), xt = new WeakMap(), gt = new WeakMap(); let Or = ar; const eo = async (t, e = "/", r = "") => { try { const i = await t.stat(e), n = e === "/" ? "/" : me.basename(e), o = { title: n, key: r ? `${r}${e}` : e, isLeaf: i.isFile() }; if (i.isDirectory()) { const a = await t.dir(e); if (a.length > 0) { o.children = []; const s = [], l = []; for (const d of a) { const u = e === "/" ? `/${d}` : `${e}/${d}`; try { (await t.stat(u)).isDirectory() ? s.push(d) : l.push(d); } catch (p) { console.warn(`Failed to stat ${u}:`, p.message); } } s.sort(), l.sort(); for (const d of [...s, ...l]) { const u = e === "/" ? `/${d}` : `${e}/${d}`; try { const p = await eo(t, u, r); o.children.push(p); } catch (p) { console.warn(`Failed to process ${u}:`, p.message); } } } } return o; } catch { return null; } }; export { Ao as $, Zi as A, $o as B, Eo as C, St as D, Wr as E, qt as F, vo as G, gn as H, en as I, tn as J, bn as K, Cn as L, xo as M, To as N, ue as O, Sn as P, Tt as Q, Hr as R, Qr as S, It as T, Oo as U, Ro as V, Fo as W, jo as X, $n as Y, En as Z, Pn as _, zr as a, Ot as a0, Lo as a1, mt as a2, ft as a3, Io as a4, Mo as a5, Nn as a6, ri as a7, Ln as a8, ir as a9, qe as aA, Me as aB, ne as aC, Yn as aD, Xn as aE, Or as aF, eo as aG, Gn as aH, rr as aa, ii as ab, vn as ac, xn as ad, Tn as ae, On as af, Rn as ag, Fn as ah, Vo as ai, $t as aj, x as ak, Dr as al, zn as am, ee as an, ht as ao, Mr as ap, re as aq, ie as ar, Co as as, ko as at, So as au, pe as av, or as aw, Qn as ax, I as ay, Ir as az, Br as b, Po as c, Ur as d, er as e, Jr as f, Gi as g, Yr as h, fn as i, Gr as j, mn as k, No as l, _r as m, Kr as n, qr as o, dn as p, cn as q, sn as r, tr as s, se as t, hn as u, pn as v, wn as w, rn as x, on as y, Qi as z };