This commit is contained in:
what 2024-08-09 22:50:51 +08:00
parent 24fbb40f0a
commit 3612b9393e
23 changed files with 2517 additions and 3200 deletions

12
README.md Normal file
View File

@ -0,0 +1,12 @@
### ff, 集成以下项目的开发环境
```
@ff/button
@ff/container
@ff/core
@ff/data-list
@ff/grid-layout
@ff/grid-layout-form
@ff/iconfont
@ff/pages
```
### 最终打包到 [ff](https://git.fsdpf.net/npm/ff-dist.git).

10
dist/button.js vendored
View File

@ -1,7 +1,7 @@
import { E, B, C } from "./common/main-DHW9LhcM.js";
import "./common/vender-CMS8SASe.js";
import { P as s, O as u, Q as e } from "./common/main-2s1hdQO8.js";
import "prop-types";
export {
E as auth,
B as default,
C as useButton
s as auth,
u as default,
e as useButton
};

912
dist/common/main-2s1hdQO8.js vendored Normal file
View File

@ -0,0 +1,912 @@
var ga = Object.defineProperty;
var Nt = (e) => {
throw TypeError(e);
};
var pa = (e, t, a) => t in e ? ga(e, t, { enumerable: !0, configurable: !0, writable: !0, value: a }) : e[t] = a;
var v = (e, t, a) => pa(e, typeof t != "symbol" ? t + "" : t, a), xt = (e, t, a) => t.has(e) || Nt("Cannot " + a);
var p = (e, t, a) => (xt(e, t, "read from private field"), a ? a.call(e) : t.get(e)), F = (e, t, a) => t.has(e) ? Nt("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, a), z = (e, t, a, n) => (xt(e, t, "write to private field"), n ? n.call(e, a) : t.set(e, a), a);
var Et = (e, t, a, n) => ({
set _(i) {
z(e, t, i, a);
},
get _() {
return p(e, t, n);
}
});
import { jsx as c, jsxs as $ } from "react/jsx-runtime";
import b, { useEffect as N, useState as P, useCallback as ge, useMemo as pe, useContext as Ge, useRef as Y, useId as Dt, useLayoutEffect as ma } from "react";
import g from "lodash";
import R from "classnames";
import { Form as Ze, Input as ha, Button as lt, Breadcrumb as fa, Tree as ya, Pagination as wa, Table as ba, Empty as Ca, Popconfirm as va, Tooltip as ka, Popover as Sa } from "antd";
import { useMergedState as Pa } from "rc-util";
import re, { FieldContext as $a, Field as Wt } from "rc-field-form";
import { useParams as Na, generatePath as xa, createBrowserRouter as Ea, useInRouterContext as Ta, Navigate as Fa } from "react-router-dom";
import O from "prop-types";
import "react-is";
import { useNotification as Ra } from "rc-notification";
import { N as Be, a as Ue, w as ct, S as Oa } from "./vender-DDOSHWIo.js";
import Tt from "immutability-helper";
import La from "rc-drawer";
import Va from "rc-dialog";
const Ft = { null2json: (e) => Object.create(), null2array: (e) => [], null2number: (e) => 0, null2bool: (e) => !1, null2string: (e) => "", null2integer: (e) => 0, null2float: (e) => 0, string2json: (e) => e ? JSON.parse(e) : "{}", string2array: (e) => e.substr(0, 1) === "[" && e.substr(-1) === "]" ? JSON.parse(e) : e.split(","), string2number: (e) => e == "" ? 0 : +e, string2integer: (e) => e == "" ? 0 : +e, string2float: (e) => e == "" ? 0 : +e, string2bool: (e) => {
switch (`${e}`.toLowerCase()) {
case "0":
case "false":
case "[]":
case "{}":
return !1;
}
return !!e;
}, string2string: (e) => e, json2json: (e) => e, json2array: (e) => e ? Object.values(e) : [], json2number: (e) => Object.keys(e).length, json2integer: (e) => Object.keys(e).length, json2float: (e) => Object.keys(e).length, json2bool: (e) => Object.keys(e).length > 0, json2string: (e) => e ? JSON.stringify(e) : "", array2json: (e) => ({ ...e }), array2array: (e) => e, array2number: (e) => e.length, array2integer: (e) => e.length, array2float: (e) => e.length, array2bool: (e) => e.length > 0, array2string: (e) => JSON.stringify(e), number2json: (e) => ({}), number2array: (e) => [e], number2number: (e) => e, number2integer: (e) => e, number2float: (e) => e, number2bool: (e) => !!e, number2string: (e) => e.toString(), boolean2json: (e) => ({}), boolean2array: (e) => [], boolean2number: (e) => +e, boolean2integer: (e) => +e, boolean2float: (e) => +e, boolean2bool: (e) => e, boolean2string: (e) => e ? "true" : "false" }, qt = (e, t) => g.flatMap(g.toPairs(e), ([a, n]) => g.isObjectLike(n) ? qt(n, a) : [[`${g.isUndefined(t) ? "" : t + "."}${a}`, n]]), Ht = (e, t = () => !1) => g.some(e, (a) => !!g.some(a, t) || (g.isEmpty(a) || !g.isPlainObject(a) && !g.isArray(a) ? void 0 : Ht(a, t))), et = (e, t) => e && typeof e == "object" ? Array.isArray(e) ? e.map((a) => et(a, t)) : Object.keys(e).reduce((a, n) => (t[n] ? a[t[n]] = et(e[n], t) : a[n] = et(e[n], t), a), {}) : e;
g.mixin({ toPrimitive: (e, t) => {
let a = "string";
a = Array.isArray(e) ? "array" : typeof e, g.isObject(e) && (a = "json");
const n = `${a}2${t}`;
return Reflect.has(Ft, n) ? Ft[n](e) : e;
}, toPairsDeep: qt, deepSome: Ht, replaceKeys: et });
var Ie, qe, Ae, de, Fe, Re;
class Jt {
constructor(t, a) {
F(this, Ie, /* @__PURE__ */ new Map());
F(this, qe, !0);
F(this, Ae, []);
F(this, de);
F(this, Fe, () => p(this, de));
F(this, Re, () => Promise.resolve());
v(this, "get", (...t) => new Promise((a, n) => {
const i = JSON.stringify(t);
if (p(this, Ie).has(i)) return a(p(this, Re).call(this, p(this, de), ...t));
if (p(this, de) === void 0) p(this, Ae).push([t, a, n]), p(this, qe) && (z(this, qe, !1), Promise.resolve(typeof p(this, Fe) == "function" ? p(this, Fe).call(this) : p(this, Fe)).then((r) => z(this, de, r || null)).finally(() => {
p(this, Ae).forEach(([r, s, o]) => {
try {
const l = p(this, Re).call(this, p(this, de), ...r);
p(this, Ie).set(JSON.stringify(r), l), s(l);
} catch (l) {
o(l);
}
}), p(this, Ae).length = 0;
}));
else {
const r = p(this, Re).call(this, p(this, de), ...t);
p(this, Ie).set(i, r), a(r);
}
}));
z(this, Re, a), z(this, Fe, t);
}
}
Ie = new WeakMap(), qe = new WeakMap(), Ae = new WeakMap(), de = new WeakMap(), Fe = new WeakMap(), Re = new WeakMap();
const Dn = () => c("div", { children: "Empty" }), _e = b.createContext({ ele: {}, mount: () => {
}, unmount: () => {
} }), q = ({ rootClassName: e, className: t, children: a, actions: n, title: i, subTitle: r, extras: s, style: o = {} }) => {
const { mount: l, unmount: u } = b.useContext(_e);
return n && q.Action({ children: n }), i && q.Title({ children: i }), r && q.SubTitle({ children: r }), s && q.Extra({ children: s }), N(() => (l("rootClassName", e), () => u(e)), [e]), c("div", { className: R("ff-container", t), style: o, children: a });
}, Xe = (e) => ({ children: t, className: a }) => {
const { mount: n, unmount: i } = b.useContext(_e);
return N(() => (n(e, b.createElement("div", { key: `ff-${e}`, className: R(`ff-popup-${e}`, a) }, t)), () => i(e)), [a, t]), null;
};
q.Action = Xe("actions"), q.Title = Xe("title"), q.SubTitle = Xe("sub-title"), q.Extra = Xe("extras"), q.propTypes = { className: O.string, style: O.object, title: O.any, subTitle: O.any, actions: O.any, extras: O.any };
const Wn = () => c(q, { className: "ff-loading", children: $("div", { className: "loader", children: [$("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] }), $("div", { className: "square", children: [c("span", {}), c("span", {}), c("span", {})] })] }) }), qn = () => c("div", { children: "NotFound" }), Kt = ({ children: e }) => {
const [t, a] = P({}), n = ge((r, s) => a((o) => ({ ...o, [r]: s })), []), i = ge((r) => a((s) => ({ ...s, [r]: void 0 })), []);
return typeof (e == null ? void 0 : e.type) == "string" ? e : c(_e.Provider, { value: { ele: t, mount: n, unmount: i }, children: b.cloneElement(e, { className: t.rootClassName, title: t.title, subTitle: t["sub-title"], actions: t.actions, extras: t.extras }) });
};
Kt.propTypes = { children: O.element.isRequired };
const Rt = { 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"] }, Ct = ({ type: e, props: t }) => c("i", { ...t, children: c("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Rt[e] || Rt.info).map((a, n) => c("path", { d: a }, n)) }) }), Gt = ({ className: e, content: t, icon: a, $close: n }) => $(b.Fragment, { children: [a && c("div", { className: R("ff-notification-icon", e), children: c(Ct, { type: a }) }), t] }), ja = ({}) => c(q, { children: "Confirm" });
var fe, Me;
const ee = class ee {
constructor() {
F(this, Me, null);
v(this, "init", (t) => z(this, Me, new Map(t)));
v(this, "check", (t) => !p(this, Me).has(t) || p(this, Me).get(t));
if (p(ee, fe)) return p(ee, fe);
}
};
fe = new WeakMap(), Me = new WeakMap(), F(ee, fe, null), v(ee, "getInstance", () => (p(ee, fe) || z(ee, fe, new ee()), p(ee, fe)));
let dt = ee;
const Ia = dt.getInstance(), _t = (e = {}, t = {}, a = {}, n = "") => g.deepSome(e, (i, r) => r === "type" && i === "code") ? Yt(e, t, a, n) : Qt(e, t, n), Yt = async (e = {}, t = {}, a = {}, n = "") => {
let i = /* @__PURE__ */ Object.create(null);
for (let r in e) {
let s;
if (Reflect.has(e[r], "type") && ["code", "field", "router", "query", "string"].includes(e[r].type)) {
const { type: o, value: l = "", default: u = n } = e[r];
switch (o) {
case "code":
s = await $e.exec(l, t, a);
break;
case "field":
s = g.get(t, l) ?? g.get(t, l.substring(l.indexOf(".") + 1));
break;
case "router":
case "query":
s = Pe.getPageParams(l);
break;
case "string":
s = l;
}
s ?? (s = u);
} else s = await Yt(e[r], t, a, n);
g.set(i, r, s);
}
return i;
}, Qt = (e = {}, t = {}, a = "") => Object.keys(e || {}).reduce((n, i) => {
if (g.isPlainObject(e[i])) {
let r;
if (Reflect.has(e[i], "type") && ["field", "router", "query", "string"].includes(e[i].type)) {
const { type: s, value: o = "", default: l = a } = e[i];
switch (s) {
case "field":
r = g.get(t, o) ?? g.get(t, o.substring(o.indexOf(".") + 1));
break;
case "router":
case "query":
r = Pe.getPageParams(o);
break;
case "string":
r = o;
}
r ?? (r = l);
} else r = Qt(e[i], t, a);
g.set(n, i, r);
}
return n;
}, {});
var ye, He;
const te = class te {
constructor() {
F(this, He, null);
v(this, "init", (t) => z(this, He, t));
v(this, "get", (t, a) => g.get(p(this, He), t, a));
if (p(te, ye)) return p(te, ye);
}
};
ye = new WeakMap(), He = new WeakMap(), F(te, ye, null), v(te, "getInstance", () => (p(te, ye) || z(te, ye, new te()), p(te, ye)));
let ut = te;
const De = ut.getInstance(), Aa = (e, t, a, n, i) => {
const r = b.lazy(() => Q.getWidgetComponent(e).catch((s) => ({ default: () => `${s}` })));
return c(b.Suspense, { children: c(r, { value: t, record: a, $setting: n, base62params: i }) }, e);
}, Ma = (e, t = {}) => (jt(e), jt(t), pe(() => e == null ? void 0 : e.map(({ widgetByJs: a, widgetByJsSetting: n, ...i }, r) => a && !a.endsWith("/BasicShowFieldData") ? { ...i, render: (s, o) => {
const l = Aa(a, s, o, n, t);
return g.isFunction(i == null ? void 0 : i.render) ? i.render(l, s, o) : l;
} } : i), [e, t])), Hn = (e) => {
const [t, a] = P({});
return N(() => {
let n = !1;
return e && E.get(`/api/_/${e}`).then((i) => g.pick(i, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig"])).then((i) => !n && a(i)), () => n = !0;
}, [e]), t;
}, Jn = (e, t = {}) => {
const [a, n] = P({ dataSource: [] });
return Ye(() => {
let i = !1;
return e && E.get(`/api/${e}/${E.encode({ page: 1, ...t })}`).then((r) => !i && n(r)), () => i = !0;
}, [e, t]), a;
}, gt = (e, t = null, a = null, n = "id") => pe(() => {
if (g.isEmpty(e) || !e.every(({ uuid: r }) => Ia.check(r))) return !1;
if (g.isEmpty(a) || g.isEmpty(t)) return !0;
const i = t.map((r) => r == null ? void 0 : r[n]);
return e.some(({ uuid: r }) => !r || !a.has(r) || a.get(r).some((s) => i.includes(s)));
}, [e, t, a, n]), za = ({ className: e, itemClassName: t, classNames: a = {}, dataSource: n, isPaginate: i, isItemOperations: r, isBatchOperations: s, batchOperations: o, itemOperations: l, itemOperationsAccess: u, resource: d, primaryKey: m, title: y, itemGridLayout: h, $setting: f, tabs: C, isConditionFormLayout: w, isTreeSider: x, treeSiderConfig: I }) => {
const { getBase62params: B, onClickCallback: X, onTabChange: G } = Ge(Le), { total: A, page: D, pageSize: H, tab: M } = B() || {}, J = ge((V, k, se) => c(Ba, { className: R("ff-data-list-framework-item", t), operations: r && k ? l == null ? void 0 : l.filter((L) => !(m && L.uuid && u.has(L.uuid)) || u.get(L.uuid).includes(k == null ? void 0 : k[m])) : [], data: d ? { [d]: k } : k, children: V, onClickCallback: X }), [d, m, r, X, l, u]);
return $("div", { className: R("ff-data-list-framework", e), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: x, ...I }), $("div", { className: R("ff-data-list-container", a == null ? void 0 : a.container), children: [c(kt, { className: a == null ? void 0 : a.filter, isConditionFormLayout: w }), c(ea, { title: y, className: a == null ? void 0 : a.toolbar, tabs: C, tab: M, onTabChange: G }), c(Ya, { ...h, className: a == null ? void 0 : a.content, style: { "--col-num": (f == null ? void 0 : f.colNum) || 1 }, primaryKey: m, itemRender: J, dataSource: n }), c(aa, { className: a == null ? void 0 : a.footer, isPaginate: i, isOperations: s, operations: o, total: A, page: D, pageSize: H })] })] });
}, Ba = ({ className: e, operations: t, children: a, data: n, onClickCallback: i }) => $("div", { className: R("data-list-grid-layout-item-container", e), children: [a, !!(t != null && t.length) && c("div", { className: "data-list-grid-layout-item-actions", children: t.map((r) => c("span", { className: "data-list-grid-layout-item-action", children: c(S.Link, { uuid: r.uuid, type: r.type, name: r.name, widget: r.widget, widgetType: r.widgetType, widgetProps: r.widgetProps, widgetSetting: r.widgetSetting, widgetContainerProps: r.widgetContainerSetting, data: n, onAfterClick: (s) => s !== !1 && (i == null ? void 0 : i(r.isRefresh, n)) }, r.uuid || useId()) }, (r == null ? void 0 : r.uuid) || useId())) })] }), Ua = ({ listCode: e, className: t, classNames: a = {}, itemClassName: n, dataSource: i, columns: r, isItemOperations: s, isBatchOperations: o, batchOperations: l, itemOperations: u, itemOperationsAccess: d, resource: m, primaryKey: y, title: h, tabs: f, isPaginate: C, isTreeSider: w, treeSiderConfig: x, isConditionFormLayout: I, ...B }) => {
const { getBase62params: X, onClickCallback: G, onTabChange: A } = Ge(Le), { total: D, page: H, tab: M, pageSize: J } = X() || {}, V = gt(u, i, d, y);
return $("div", { className: R("ff-data-table-framework", t), children: [c(ta, { className: a == null ? void 0 : a.sider, isTreeSider: w, ...x }), $("div", { className: R("ff-data-table-container", a == null ? void 0 : a.container), children: [c(kt, { listCode: e, isConditionFormLayout: I }), c(ea, { title: h, className: a == null ? void 0 : a.toolbar, tabs: f, tab: M, onTabChange: A }), c(Ha, { ...B, className: "ff-data-table-content", columns: r, dataSource: i, operationRender: V ? (k) => c("div", { className: "ff-data-table-actions", children: u == null ? void 0 : u.reduce((se, L, me) => [...se, c(S.Link, { size: "small", uuid: L.uuid, type: L.type, name: L.name, widget: L.widget, widgetType: L.widgetType, widgetProps: L.widgetProps, widgetData: L.widgetData, widgetSetting: L.widgetSetting, widgetContainerProps: L.widgetContainerSetting, data: k, onAfterClick: (Ne) => Ne !== !1 && (G == null ? void 0 : G(L.isRefresh, data)) }, L.uuid || me)], []) }) : null }), c(aa, { isPaginate: C, isOperations: o, operations: l, total: D, page: H, pageSize: J })] })] });
}, Le = b.createContext({ listCode: "", getBase62params: (e, t) => {
}, onReload: () => {
}, onClickCallback: () => {
}, onConditonChange: () => {
}, onTabChange: () => {
}, onSiderChange: () => {
}, onKeywordChange: () => {
}, onPageChange: () => {
}, onPageSizeChange: () => {
} }), Da = ({ isItemGridLayout: e, theme: t, themeProps: a, onClickCallback: n, onReload: i, getBase62params: r, listCode: s, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: y, ...h }) => {
const [f, C] = P();
return N(() => {
t ? Q.getWidgetComponent(t).then((w) => {
if (!w) throw `${t} not found`;
return w;
}).catch((w) => ({ default: () => `${w}` })).then((w) => C(b.createElement(w.default, { ...h, $setting: a }))) : f || C(null);
}, [t, a]), c(Le.Provider, { value: { listCode: s, onClickCallback: n, onReload: i, getBase62params: r, onPageChange: o, onPageSizeChange: l, onTabChange: u, onSiderChange: d, onKeywordChange: m, onConditonChange: y }, children: f ? b.cloneElement(f, { ...h, $setting: a }) : c(e ? za : Ua, { ...h, $setting: a }) });
};
var we, ue, Oe, at;
const ae = class ae {
constructor() {
F(this, ue, null);
F(this, Oe, /* @__PURE__ */ new Map());
F(this, at, () => {
if (p(this, ue)) return p(this, ue).port.postMessage({ command: "status", data: [] });
z(this, ue, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), p(this, ue).port.onmessage = (t) => {
var a, n;
(a = t.data) != null && a.uuid ? p(this, Oe).forEach((i, r) => {
var s;
(i == "*" || (s = i == null ? void 0 : i.includes) != null && s.call(i, t.data.uuid)) && r(t.data);
}) : ((n = t.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && E.get("/api/user-api-token").then(({ token: i, expire_at: r }) => {
p(this, ue).port.postMessage({ command: "initWs", data: [`ws${g.trimStart(E.appUrl, "http")}api/user-resource-status-ws?token=${i}`] });
});
}, p(this, ue).port.postMessage({ command: "status", data: [] });
});
v(this, "subscribe", (t, a = []) => (a ? Array.isArray(a) && a.length == 0 ? a = "*" : Array.isArray(a) || (a = [a].flat()) : a = "*", p(this, Oe).set(t, a), p(this, Oe).size == 1 && p(this, at).call(this), () => this.unsubscribe(t)));
v(this, "unsubscribe", (t) => p(this, Oe).delete(t));
if (p(ae, we)) return p(ae, we);
}
};
we = new WeakMap(), ue = new WeakMap(), Oe = new WeakMap(), at = new WeakMap(), F(ae, we, null), v(ae, "getInstance", () => (p(ae, we) || z(ae, we, new ae()), p(ae, we)));
let pt = ae;
const Xt = pt.getInstance(), vt = b.forwardRef(({ listCode: e, base62params: t, className: a, itemClassName: n, theme: i, themeProps: r, classNames: s }, o) => {
const l = oa(), u = Y(t), d = Y(/* @__PURE__ */ new Map()), m = Y([]), [{ resource: y, primaryKey: h, batchOperations: f = [], itemOperations: C = [], columns: w = [], themeConfig: x, theme: I, isConditionFormLayout: B = !1, isTreeSider: X, treeSiderConfig: G, isItemGridLayout: A, itemGridLayout: D, title: H, isPaginate: M, tabs: J }, V] = P({ isItemGridLayout: !1, itemGridLayout: {} }), k = g.throttle((T) => {
m.current = [], E.list(e, g.pick({ ...u.current, ...T }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: U, condition: Ve, total: xe, tab: he, sider: Ee, page: oe, pageSize: le, operationsAccess: ce, dataSource: Te }) => {
u.current = { tab: he, condition: Ve, sider: Ee, keyword: U, total: xe, pageSize: le, page: Te != null && Te.length ? oe : 1 }, m.current = Te, d.current = new Map(ce), l();
});
}, 380, { leading: !1, trailing: !0 }), se = gt(C, m.current, d.current, h), L = gt(f);
N(() => {
let T = null;
return e && E.get(`/api/_/${e}`).resp(({ data: U, res: Ve }) => {
U != null && U.isDynamicRefresh && (T = Xt.subscribe(() => k(), Ve)), u.current.pageSize = U.pageSize, V(U);
}).catch(() => V({})), () => T == null ? void 0 : T();
}, [e]), tn(() => {
e && k(t);
}, [e, t]);
const me = () => {
k();
}, Ne = (T = 0, U = null) => {
if (T === 2) {
const Ve = g.get(U, "__PARENT_ID__", ""), xe = g.get(U, h, g.get(U, [y, h], "")), he = g.findIndex(m.current, ["__PARENT_ID__", Ve]), Ee = g.findIndex(he > -1 ? g.get(m.current, [he, "children"]) : m.current, [h, xe]);
Ee > -1 ? (E.get(`/api/${e}/detail/${xe}`).then((oe) => {
const le = g.get(m.current, he > -1 ? [he, "children", Ee, "children"] : [Ee, "children"]);
m.current = Tt(m.current, he > -1 ? { [he]: { children: { $splice: [[Ee, 1, { ...oe, children: le }]] } } } : { $splice: [[Ee, 1, { ...oe, children: le }]] }), l();
}), E.post(`/api/${e}/list-operations-access`, { ids: xe }).then((oe) => new Map(oe)).then((oe) => {
d.current.forEach((le, ce) => {
var Te;
(Te = oe.get(ce)) != null && Te.some((rt) => rt == xe) || d.current.set(ce, le.filter((rt) => rt !== xe));
}), oe.forEach((le, ce) => {
d.current.has(ce) ? d.current.set(ce, g.uniq([...d.current.get(ce) || [], ...le])) : d.current.set(ce, le);
}), l();
})) : me();
} else T === 1 && me();
};
b.useImperativeHandle(o, () => ({ onReload: me, onClickCallback: Ne }));
const it = { listCode: e, title: H, itemClassName: n, classNames: s, resource: y, primaryKey: h, theme: i || I, themeProps: r || x, isTreeSider: X, treeSiderConfig: G, isPaginate: M, tabs: J, isItemOperations: se, isBatchOperations: L, batchOperations: f, itemOperations: C, isItemGridLayout: A, columns: w, itemGridLayout: D, isConditionFormLayout: B, itemOperationsAccess: d.current, dataSource: m.current };
return c(Da, { ...it, className: R("ff-data-list-helper", a), getBase62params: (T, U, Ve = !1) => T == "init" ? t : T ? g.get(u.current, T, U) : u.current, onReload: me, onClickCallback: Ne, onConditonChange: (T, U) => k({ keyword: U, condition: Tt(u.current.condition || {}, { $merge: T || {} }), page: 1 }), onTabChange: (T) => k({ tab: T, page: 1 }), onSiderChange: (T) => k({ sider: T, page: 1 }), onKeywordChange: (T) => k({ keyword: T, page: 1 }), onPageChange: (T, U) => k({ page: T, pageSize: U }), onPageSizeChange: (T) => k({ pageSize: T, page: 1 }) });
}), Zt = (e, t, a, n, i = {}, r = 0) => {
const s = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${a}`, "--grid-layout-x": `${e}`, "--grid-layout-y": `${t}`, "--grid-layout-row-height-offset": "0px" };
return i != null && i.autoHeight ? s.height = "fit-content" : s["--grid-layout-row"] = `${n}`, s["--grid-layout-box-margin"] = Ot(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), s["--grid-layout-box-padding"] = Ot(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), r && (s.height = `${r}px`), s;
}, Ot = (e, t, a, n) => `${e || 0}px ${t || 0}px ${a || 0}px ${n || 0}px`, kt = ({ className: e, isConditionFormLayout: t }) => {
var m, y;
const [a, n] = P({}), { listCode: i, onKeywordChange: r, onConditonChange: s, getBase62params: o } = b.useContext(Le), { keyword: l, condition: u } = o() || {}, [d] = Ze.useForm();
return N(() => {
i && t && E.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: h, marginX: f, marginY: C, rowHeight: w, cols: x, fields: I }) => {
n({ resource: h, itemMargin: [f, C], rowHeight: w, cols: x, fields: I });
}).catch(() => n({}));
}, [i, t]), N(() => {
d.setFieldsValue({ keyword: l, ...u });
}, [JSON.stringify([l, u])]), c("div", { className: R("ff-data-list-filter", e), children: c(Ze, { form: d, layout: "vertical", autoComplete: "off", onFinish: ((m = a.fields) == null ? void 0 : m.length) > 1 ? (h) => s({ [a.resource]: h[a.resource] }, h.keyword) : () => {
}, onValuesChange: (h) => {
g.isEmpty(g.omit(h, ["keyword"])) || d.submit();
}, children: ((y = a.fields) == null ? void 0 : y.length) > 1 ? c(St, { ...a, children: c(Wa, { onReset: () => {
const { keyword: h, condition: f } = o("init") || {};
d.setFieldsValue({ keyword: h, ...f });
} }) }) : c("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: c("div", { className: "grid-layout-item", style: Zt(20, 0, 5, 2), children: c(Ze.Item, { name: ["keyword"], children: c(ha.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (h) => r(h) }) }) }) }) }) });
}, Wa = ({ cols: e, fields: t, onReset: a }) => {
const [n, i] = P(!1), r = pe(() => t == null ? void 0 : t.toReversed().some((s) => s.y > 1 || s.x + s.w >= e - 5), [e, t]);
return $(Ze.Item, { label: " ", style: { "--item-span": 5 }, className: R("ff-data-list-filter-actions", { expanded: n }), children: [c(lt, { onClick: a, children: "重置" }), c(lt, { type: "primary", htmlType: "submit", children: "查询" }), r && c(S.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((s) => !s), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] });
};
kt.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }];
const ea = ({ className: e, title: t, tabs: a, tab: n, onTabChange: i }) => {
const [r, s] = Pa(a == null ? void 0 : a[0].value, { value: n, onChange: i });
return $("div", { className: R("ff-data-list-toolbar", e), children: [c("div", { className: "ff-data-list-title", children: t }), c(fa, { className: "ff-data-list-tabs", itemRender: ({ label: o, code: l }) => c("span", { onClick: () => s(l), className: R("ff-data-list-tab", { active: l == r }), children: o }), items: a }), $("div", { className: "ff-data-list-actions", children: [c(S.Link, { icon: "icon-reload" }), c(S.Link, { icon: "icon-setting" })] })] });
}, qa = [{ 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: c("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ta = ({ className: e, width: t = 280, isTreeSider: a }) => a ? c(ya.DirectoryTree, { className: R("ff-data-list-sider", e), style: { "--sider-width": t }, showLine: !0, showIcon: !1, treeData: qa }) : null, aa = ({ className: e, operations: t, isOperations: a, isPaginate: n, total: i, page: r, pageSize: s }) => {
const { onPageChange: o, onPageSizeChange: l, onClickCallback: u } = b.useContext(Le);
return a && !g.isEmpty(t) || n ? $("div", { className: R("ff-data-list-footer", e), children: [c("div", { className: "ff-data-list-actions", children: t == null ? void 0 : t.map((d, m) => c(S, { uuid: d.uuid, type: d.type, name: d.name, widget: d.widget, widgetType: d.widgetType, widgetProps: d.widgetProps, widgetData: d.widgetData, widgetSetting: d.widgetSetting, widgetContainerProps: d.widgetContainerSetting, onAfterClick: (y) => y !== !1 && (u == null ? void 0 : u(d.isRefresh, null)) }, d.uuid || m)) }), n && c(wa, { size: "small", total: i, pageSize: s, showSizeChanger: !1, showTotal: (d) => `${r} 页 / 总共 ${d}`, onChange: o, onShowSizeChange: l })] }) : null;
}, na = (e, t, a = !0) => a !== !0 && a-- <= 0 ? [] : g.isArray(e) && !g.isEmpty(e) ? e.reduce((n, i) => (Reflect.has(i, t) && Reflect.has(i, "children") && n.push(i[t]), Reflect.has(i, "children") && !g.isEmpty(i.children) ? n.concat(na(i.children, t, a)) : n), []) : [], Ha = ({ className: e, primaryKey: t, columns: a = [], dataSource: n = [], operationRender: i, operationWidth: r = 180, ...s }) => {
Dt();
const o = Y(null), l = Y(null), [u, d] = P([]), [m, y] = P({ width: 0, height: 0 });
N(() => {
d(na(n, t));
}, [n, t]), ma(() => {
const f = new ResizeObserver(() => {
var C;
y({ width: ((C = o.current) == null ? void 0 : C.nativeElement.querySelector(".ant-table-body").scrollWidth) || l.current.offsetWidth, height: l.current.offsetHeight });
});
return l.current && f.observe(l.current), () => {
l.current && f.unobserve(l.current);
};
}, []);
const h = Ma(a);
return c("div", { ref: l, className: R("ff-data-list-table", e), children: m.height ? c(ba, { ...s, ref: o, rowKey: (f) => (f == null ? void 0 : f[t]) ?? Math.random(), columns: h == null ? void 0 : h.concat(i ? [{ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(r / m.width * 100).toFixed(2)}%`, render: (f, C, w) => i(C, w) }] : []), dataSource: n, size: "middle", scroll: { x: "max-content", y: m.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: d, expandedRowKeys: u } }) : null });
}, Ja = "RC_FORM_INTERNAL_HOOKS", ia = (e, { initialValue: t, initialValueLanguage: a, convertJs: n, convertJsSetting: i, type: r = "string" }, s = null) => {
const o = Y(!1), l = Ge($a), [u, d] = P(), [m, y] = P(a != "javascript" && e ? l.getFieldValue(e) : void 0), { registerWatch: h } = l.getInternalHooks(Ja) || {};
return N(() => h == null ? void 0 : h((f, C, w) => {
if (!o.current) return;
const x = g.get(C, e);
g.isEqual(x, m) || y(g.toPrimitive(x, r));
}), [m]), N(() => {
a == "javascript" && t ? $e.exec(t, {}, { getFieldValueForBasicForm: (f) => s ? s.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => y(g.toPrimitive(f, r))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => o.current = !0) : (t && y(g.toPrimitive(t ?? l.getFieldValue(e), r)), o.current = !0);
}, [t, a]), Ye(() => {
o.current && n && Q.getWidgetComponent(n).then(({ default: f }) => f({ value: m, record: l.getFieldsValue(!0), $setting: i })).then(d).catch((f) => console.error("布局数据转换错误: ", f, n));
}, [m, n, i]), [u || m, m];
}, ra = (e, t, a = "@pkg/grid-layouts", n = null) => pe(() => {
var i;
return (i = g.sortBy(e, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: s, y: o, w: l, h: u, field: { boxStyle: d, widgetPrefix: m = a, widget: y, ...h } }, f) => c("div", { className: "grid-layout-item", style: Zt(s, o, l, u, d, y === "Height" && (h == null ? void 0 : h.initialValue)), children: c(Ka, { ...h, basicForm: n, itemWidget: y != null && y.startsWith("@") ? y : `${m}/${y}`, itemWidgetRender: t }) }, r || f));
}, [e]), Ka = ({ itemWidget: e, itemWidgetRender: t, basicForm: a, ...n }) => {
const [i, r] = P();
return N(() => {
Q.getWidgetComponent(e).then(({ defaultProps: s = {}, default: o }) => {
r(b.createElement(t(o, s, a), n));
}).catch((s) => {
console.error(s), r(e);
});
}, [e]), i;
}, sa = ({ cols: e = 12, rowHeight: t = 21, fields: a = [], data: n, containerPadding: i = [0, 0], itemMargin: r = [4, 0], formProps: s = {}, className: o, ...l }) => {
const [u] = re.useForm(), d = ra(a, Ga, "@pkg/grid-layouts"), m = pe(() => [{ name: "__PROPS__", value: s }], [s]);
return Ye(() => {
u.setFieldsValue(n);
}, [n]), c(re, { fields: m, form: u, component: !1, children: c("div", { ...l, className: R("ff-grid-layout", o), style: { "--grid-layout-item-margin-y": `${(r == null ? void 0 : r[0]) || 0}px`, "--grid-layout-item-margin-x": `${(r == null ? void 0 : r[1]) || 0}px`, "--grid-layout-container-padding-y": `${(i == null ? void 0 : i[0]) || 0}px`, "--grid-layout-container-padding-x": `${(i == null ? void 0 : i[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: d }) });
}, Ga = (e, t = {}, a = null) => (n) => {
const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, ...y } = g.merge({}, t, n), [h, f] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (y == null ? void 0 : y.type) || "string" }, a);
return c(e, { ...y, value: h, rawValue: f, $setting: s || {} });
}, Kn = (Lt = sa, function({ code: e, data: t, ...a }) {
const [n, i] = P({ resource: null, cols: 12, rowHeight: 21, fields: [] });
return N(() => {
e && E.get(`/api/_/${e}`).then((r) => i(g.pick(r, ["resource", "cols", "rowHeight", "fields"])));
}, [e]), (n == null ? void 0 : n.resource) && c(Lt, { ...a, rowHeight: n.rowHeight, cols: n.cols, fields: n.fields, data: n != null && n.resource ? { [n == null ? void 0 : n.resource]: t } : {} });
});
var Lt;
const Gn = ({ widget: e, widgetPrefix: t = "@pkg/grid-layouts", basicForm: a, ...n }) => {
const i = e != null && e.startsWith("@") ? e : `${t}/${e}`, [r, s] = P();
return N(() => {
i && Q.getWidgetComponent(i).then(({ defaultProps: o = {}, default: l }) => ({ default: _a(l, o, a) })).catch((o) => ({ default: () => `${o}` })).then((o) => s(b.createElement(o.default, n)));
}, [i]), r;
}, _a = (e, t = {}, a = null) => (n) => {
const { code: i, label: r, extras: s, isVirtual: o, initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, value: y, ...h } = g.merge({}, t, n), [f, C] = ia(o ? null : i, { initialValue: l, initialValueLanguage: u, convertJs: d, convertJsSetting: m, type: (h == null ? void 0 : h.type) || "string" }, a);
return c(e, { ...h, value: f, rawValue: C, $setting: s || {} });
}, Ya = ({ cols: e, rowHeight: t, itemMargin: a, fields: n, primaryKey: i, dataSource: r, itemClassName: s, itemRender: o = (m, y, h) => m, empty: l = c(Ca, { description: null }), className: u, style: d = {} }) => {
const m = Dt(), y = pe(() => c(sa, { cols: e, rowHeight: t, itemMargin: a, fields: n, className: s }), [n, e, t, a]);
return c("div", { className: R("ff-data-list-content", u), style: d, children: g.isEmpty(r) ? l : r == null ? void 0 : r.map((h, f) => c(b.Fragment, { children: o(b.cloneElement(y, { data: h }), h, f) }, `${m}-${(h == null ? void 0 : h[i]) || f}`)) });
}, Qa = ({ component: e }) => {
const { base62params: t } = Na();
return c(q, { children: c(vt, { listCode: e, base62params: E.decode(t) }) });
}, Xa = () => "Empty", Za = ({ component: e, $setting: t }) => {
const [a, n] = P();
return N(() => {
if (!e) return n(c(Xa, { description: null }));
Q.getWidgetComponent(e).catch((i) => ({ default: () => `${i}` })).then((i) => b.createElement(i.default, { $setting: t })).then(n);
}, [e]), a ? b.cloneElement(a, {}) : null;
};
var be, Z, Ce, ve, Je, Ke;
const ne = class ne {
constructor() {
F(this, Z, /* @__PURE__ */ new Map());
F(this, Ce, {});
F(this, ve, null);
v(this, "init", (t, a) => {
z(this, Z, t), z(this, Ce, a);
});
v(this, "get", (t) => (p(this, Z).has(t) || (t = Array.from(p(this, Z).keys()).find((a) => p(this, Z).get(a).uri === t)), p(this, Z).get(t) || {}));
v(this, "redirect", (t, a, n = {}) => {
const { uri: i, type: r, widgetProps: s } = this.get(t) || {};
let o = xa(i || t, r != "list" ? a : g.mapValues(a, (u) => E.encode(u)));
const l = new URLSearchParams();
for (const u in s || {}) (s == null ? void 0 : s.type) == "query" && l.append(u, a[u]);
return l.size > 0 && (o = `${o}?${l.toString()}`), p(this, ve).navigate(o, n);
});
v(this, "getMenus", (t) => {
var a;
return ((a = p(this, Ce)) == null ? void 0 : a[t]) || [];
});
v(this, "findMenuPathByUuid", (t) => {
let a = [];
for (const n in p(this, Ce)) if (a = p(this, Je).call(this, p(this, Ce)[n], t, [n]), a.length > 1) return a;
return a;
});
v(this, "getMenusByRouteUuid", (t) => p(this, Ke).call(this, t, Object.values(p(this, Ce)).flat()));
F(this, Je, (t, a, n = []) => {
if (g.isEmpty(t)) return n;
for (const { uuid: i, children: r } of t) {
if (i == a) return n.concat(i);
if (!g.isEmpty(r)) return n.concat(i, p(this, Je).call(this, r, a));
}
return n;
});
F(this, Ke, (t, a) => {
var i;
let n = [];
for (const r of a) r.widgetType == "redirect" && (r.uuid == t || r.widget == t ? n.push(r) : (i = r.children) != null && i.length && (n = n.concat(p(this, Ke).call(this, t, r.children))));
return n;
});
v(this, "getCurrentMenu", () => {
const { uuid: t } = this.getCurrentRoute() || {};
if (!t) return;
const a = this.getMenusByRouteUuid(t);
return g.isEmpty(a) ? void 0 : a[0];
});
v(this, "getCurrentRoute", (t = 0) => {
var n;
const a = (n = p(this, ve).state.matches[p(this, ve).state.matches.length - 1 - t]) == null ? void 0 : n.route;
if (!a) return null;
for (let [i, r] of p(this, Z)) if (r.uri === a.path) return r;
return null;
});
v(this, "getPageParams", (t) => {
var r;
const { location: a, matches: n } = p(this, ve).state, i = ((r = n[n.length - 1]) == null ? void 0 : r.params) || {};
return a.search && new URLSearchParams(a.search).forEach((s, o) => {
i[o] = s;
}), t ? g.get(i, t) : i;
});
v(this, "createBrowserRouter", (t = {}) => {
if (p(this, Z).size == 0) return null;
const a = De.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/frameworks/BasicLayout"), n = De.get(Q.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [a]: 0 }, r = (o, l) => () => Q.getWidgetComponent(o).then((u) => u.default || function() {
return `${o}`;
}).then((u) => ({ Component: () => b.createElement(Kt, {}, b.createElement(u, l)) })), s = Array.from(p(this, Z).values()).reduce((o, { uuid: l, uri: u, name: d, type: m, component: y, widgetSetting: h, isLogin: f, isLayout: C, extra: w }) => {
let x = {}, I = 0;
switch (m) {
case "list":
x.element = b.createElement(Qa, { component: y });
break;
case "fsdpf-component":
x.element = b.createElement(Za, { key: y, component: y, $setting: h });
}
if (w != null && w.layout) {
if (!i[w == null ? void 0 : w.layout]) return i[w == null ? void 0 : w.layout] = o.length, [...o, { path: "/", lazy: r(w == null ? void 0 : w.layout, {}), children: [{ path: u, ...x }] }];
I = i[w == null ? void 0 : w.layout];
}
return C && I > -1 ? (o[I].children.push({ path: u, ...x }), o) : [...o, { path: u, ...x }];
}, [{ path: "/", lazy: r(a, {}), children: [] }]);
return s.push({ index: !0, element: b.createElement(en, { to: n, replace: !0 }) }), z(this, ve, Ea(s, t));
});
if (p(ne, be)) return p(ne, be);
}
};
be = new WeakMap(), Z = new WeakMap(), Ce = new WeakMap(), ve = new WeakMap(), Je = new WeakMap(), Ke = new WeakMap(), F(ne, be, null), v(ne, "getInstance", () => (p(ne, be) || z(ne, be, new ne()), p(ne, be)));
let mt = ne;
const en = ({ to: e, replace: t }) => Ta() ? b.createElement(Fa, { to: e, replace: t }) : (window.document.location = e, "redirect"), Pe = mt.getInstance(), je = new Worker(new URL("/ff-worker/index.js", self.location)), Vt = { getConfigure: (e) => De.get(e), route: { redirect: (...e) => Pe.redirect(...e), getPageParams: (...e) => Pe.getPageParams(...e), getCurrentRoute: () => Pe.getCurrentRoute() }, popup: { notification: (...e) => K.notification(...e), success: (...e) => K.success(...e), error: (...e) => K.error(...e), form: (...e) => K.form(...e), modal: (...e) => K.modal(...e), confirm: (...e) => K.confirm(...e) } };
var nt, ze, ke;
const j = class j {
constructor() {
v(this, "exec", (t, a = {}, n = {}, i = "") => new Promise((r, s) => {
const o = Et(j, nt)._++;
p(j, ze).set(o, n), j.mQueue.set(o, [r, s]), je.postMessage({ id: o, session: i, category: "eval", method: t, args: a });
}));
v(this, "clear", (t) => je.postMessage({ session: t, category: "clear" }));
if (p(j, ke)) return p(j, ke);
Promise.resolve().then(() => Pn).then((t) => {
Vt.http = t.http;
}), je.addEventListener("message", ({ data: { id: t, task_id: a, method: n, args: i, category: r, data: s, error: o, session: l } }) => {
if (r === "eval" && j.mQueue.has(t)) o !== null ? j.mQueue.get(t)[1](o) : j.mQueue.get(t)[0](s), p(j, ze).delete(t), j.mQueue.delete(t);
else if (r === "util") try {
const u = g.get(Vt, n.split("/")) || g.get(p(j, ze).get(a), n.split("/"));
if (!g.isFunction(u)) throw `${n} not found`;
Promise.resolve(Reflect.apply(u, void 0, i)).then((d) => {
je.postMessage({ id: t, task_id: a, category: r, method: n, args: i, session: l, data: d, error: null });
}).catch((d) => {
je.postMessage({ id: t, task_id: a, category: r, method: n, args: i, session: l, data: null, error: d });
});
} catch (u) {
je.postMessage({ id: t, task_id: a, category: r, method: n, args: i, session: l, data: null, error: u });
}
}, !1);
}
};
nt = new WeakMap(), ze = new WeakMap(), ke = new WeakMap(), v(j, "mQueue", /* @__PURE__ */ new Map()), F(j, nt, 0), F(j, ze, /* @__PURE__ */ new Map()), F(j, ke, null), v(j, "getInstance", () => (p(j, ke) || z(j, ke, new j()), p(j, ke)));
let ht = j;
const $e = ht.getInstance(), oa = () => {
const e = Y(!0), [, t] = b.useReducer((a) => a + 1, 0);
return N(() => () => e.current = !1, []), () => e.current && t();
}, jt = (e) => {
const t = Y();
return N(() => {
t.current = e;
}, [e]), t.current;
}, _n = (e) => {
const [t, a] = P(e), n = Y(null), i = ge((r, s) => {
n.current = s, a(r);
}, []);
return N(() => {
n.current && (n.current(t), n.current = null);
}, [t]), [t, i];
}, Ye = (e = (n) => {
}, t, a = g.isEqual) => {
const n = b.useRef(t);
a(t, n.current) || (n.current = t), b.useEffect(e, [n.current]);
}, tn = Ye, la = (e, t = "string") => {
var a;
if (!Array.isArray(e)) return e;
for (let n = 0; n < e.length; n++) e[n].value = g.toPrimitive((a = e[n]) == null ? void 0 : a.value, t), e[n] && Reflect.has(e[n], "children") && (e[n].children = la(e[n].children, t));
return e;
}, Yn = (e, t = "json", a = "string", n, i = null) => {
const [r] = re.useForm(n), [s, o] = P([{ label: "无", value: "", disabled: !0 }]), l = Y([]), u = re.useWatch((d) => l.current.length === 0 ? null : g.pick(d, l.current), r) || null;
return N(() => {
Array.isArray(e) ? o(e) : t === "javascript" && e ? $e.exec(e, {}, { getFieldValue: (d) => (l.current.includes(d) || l.current.push(d), r.getFieldValue(d)), getFieldValueForBasicForm: (d) => (l.current.includes(d) || l.current.push(d), i ? i.getFieldValue(d) : r.getFieldValue(d)) }).then((d) => {
o(g.toPrimitive(d, "array"));
}) : e && o(g.toPrimitive(e, "array"));
}, [e, t, u]), la(s, a);
}, Qn = (e) => {
const [t, a] = P(), n = { type: "GET" };
if (typeof e == "string" ? n.url = e : g.isPlainObject(e) && Object.assign(n, e), !(n != null && n.url)) throw "url is required";
const i = (r) => E.request(n, !1).resp((s) => (console.log("useSubscribeRequest", r), a(s), s));
return Ye(() => {
let r = null;
return i().then((s) => {
r = Xt.subscribe(g.throttle(i, 180, { leading: !1, trailing: !0 }), s.res);
}), () => r == null ? void 0 : r();
}, n), t;
}, an = (e) => {
const [t, a] = b.useState({ gridItems: [], hideItems: [] });
return b.useEffect(() => {
e && E.get(`/api/_/${e}`).then(({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, fields: f }) => ({ pk: n, uuid: i, code: r, resource: s, align: o, cols: l, rowHeight: u, marginX: d, marginY: m, listenChangeFields: y, listenChangeFieldsFunc: h, ...f.reduce((C, w) => {
var x;
return (x = w == null ? void 0 : w.field) != null && x.hidden ? C.hides.push(w == null ? void 0 : w.field) : C.items.push(w), C;
}, { items: [], hides: [] }) })).then(a);
}, [e]), t;
}, nn = ({ max: e = 0, min: t = 0, type: a = "", message: n, pattern: i, required: r = !1, validator: s } = {}, o, l) => {
const [u, d] = P([]);
return N(() => {
const m = [];
if (r) {
let y = l;
switch (l) {
case "number":
case "string":
case "array":
break;
case "bool":
y = "boolean";
break;
case "json":
y = "object";
}
m.push({ type: y, required: !0, whitespace: !0, message: "该项必填" });
}
switch (a) {
case "string":
m.push({ type: a, max: e, min: t, message: n || (t && e ? `字符必须在 ${t} ~ ${e} 之间` : `${e ? "最多能有" : "最少要有"} ${t || e} 个字符`) });
break;
case "pattern":
m.push({ type: "string", pattern: i, message: n });
break;
case "validator":
s && m.push(({ getFieldValue: y }) => ({ validator: async (h, f) => {
const C = await $e.exec(s, { value: f, fieldName: o }, { getFieldValue: y });
return g.isString(C) && C ? Promise.reject(C) : g.isBoolean(C) && !C ? Promise.reject(n) : Promise.resolve();
} }));
}
d(m);
}, [e, t, a, n, i, r, s]), u;
}, rn = (e, t, a) => {
const [n, i] = P(null);
return N(() => {
const { initDataUri: r = `/api/${e}`, initDataMethod: s = "GET" } = a || {};
t && E.request({ method: s, url: g.trimEnd(`${r}/${t}`, "/") }).then((o) => {
i(o);
});
}, [e, t, a]), n;
}, sn = (e, t, a, n = {}) => {
const i = oa(), r = Y(!0), s = Y([]), [o, l] = P(a), u = re.useWatch((d) => JSON.stringify(g.pick(d, s.current)), t) || "{}";
return N(() => {
e && $e.exec(e, n, { getFieldValue: g.wrap(t.getFieldValue, (d, m) => (s.current.some((y) => g.isEqual(y, m)) || (s.current.push(m), i()), d(m))), isFieldTouched: t.isFieldTouched, isFieldsTouched: t.isFieldsTouched }).then((d) => r.current && l(d));
}, [e, u, t, n]), N(() => () => r.current = !1, []), o;
}, on = ({ type: e, initialValue: t, initialValueLanguage: a, onChange: n, form: i }) => {
const r = sn(a == "javascript" && t, i, a == "javascript" ? void 0 : t, {});
return N(() => {
n(a == "javascript" ? g.toPrimitive(r, e) : g.toPrimitive(t, e));
}, [e, t, r]), null;
}, ln = ({ widget: e = "Input", widgetPrefix: t = "@pkg/grid-layout-forms", widgetDecorator: a, subWidgets: n, basicForm: i, ...r }) => {
const s = e != null && e.startsWith("@") ? e : `${t}/${e}`, [o, l] = P();
return N(() => {
s && Q.getWidgetComponent(s).then(({ defaultProps: u = {}, default: d }) => ({ default: ca(d, u, i) })).catch((u) => ({ default: () => `${u}` })).then((u) => l(b.createElement(u.default, r)));
}, [s]), o && b.cloneElement(o, r);
}, ca = (e, t = {}, a = null) => (n) => {
const { type: i, code: r, label: s, noStyle: o, placeholder: l, extras: u, validators: d, help: m, isVirtual: y, $isReserved: h, initialValue: f, initialValueLanguage: C, convertJs: w, convertJsSetting: x, widgetPerfix: I, boxStyle: B, widgetDecorator: X, subWidgets: G, ...A } = { ...t, ...n }, D = nn(d || {}, r, i), H = { label: s, noStyle: o, colon: !1, layout: "vertical" }, M = { placeholder: l, ...A }, J = ge((V) => V == null ? void 0 : g.toPrimitive(V, i), [i]);
return c(Wt, { name: r, rules: D, initialValue: J(f), normalize: J, children: (V, k, se) => {
var L;
return c(e, { type: i, rcform: se, itemProps: { validateStatus: k.errors.length > 0 ? "error" : "success", tooltip: m, help: k.errors.length > 0 ? k.errors.join("、") : null, required: ((L = D == null ? void 0 : D[0]) == null ? void 0 : L.required) || !1, ...H }, fieldProps: { ...M, ...V }, $setting: u || {} });
} });
}, St = ({ cols: e = 24, rowHeight: t = 16, itemMargin: a = [8, 16], containerPadding: n = [0, 0], fields: i = [], children: r }) => {
const s = ra(i, ca, "@pkg/grid-layout-forms");
return $("div", { className: "ff-grid-layout-form", style: { "--grid-layout-item-margin-x": `${(a == null ? void 0 : a[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(a == null ? void 0 : a[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(n == null ? void 0 : n[0]) || 0}px`, "--grid-layout-container-padding-x": `${(n == null ? void 0 : n[1]) || 0}px`, "--grid-layout-cols": e, "--grid-layout-row-height": `${t}px` }, children: [s, r && b.cloneElement(r, { cols: e, rowHeight: t, itemMargin: a, containerPadding: n, fields: i })] });
};
St.propTypes = { fields: O.array };
const cn = (It = St, ({ code: e, layout: t, name: a, primaryKey: n = 0, style: i = {}, formProps: r = {}, form: s, isPreview: o = !1, className: l, onFinish: u, onValuesChange: d = () => {
}, ...m }) => {
const { align: y, autoComplete: h, resource: f, items: C, hides: w, rowHeight: x, marginX: I, marginY: B, cols: X, listenChangeFields: G, listenChangeFieldsFunc: A, pk: D, uuid: H } = an(e), [M] = re.useForm(s), J = pe(() => [{ name: "__PK__", value: D }, { name: "__PROPS__", value: r }, { name: "__RESOURCE__", value: f }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: H }, { name: "__PRIMARY_KEY__", value: n }], [D, e, H, f, n, r]);
return $(re, { className: l, name: a || e, layout: t || y, fields: J, form: M, autoComplete: h, style: { ...i, position: "relative" }, onFinish: u, onValuesChange: (V, k) => (({ changedValues: se, allValues: L, listenChangeFields: me, listenChangeFieldsFunc: Ne, onValuesChange: it, code: T }) => {
it(se, L), Ne && Array.isArray(me) && $e.exec(Ne, { changedValues: se, allValues: L }, { getFieldValue: M.getFieldValue, setFieldsValue: M.setFieldsValue, isFieldTouched: M.isFieldTouched, isFieldsTouched: M.isFieldsTouched });
})({ changedValues: V, allValues: k, listenChangeFields: G, listenChangeFieldsFunc: A, onValuesChange: d, code: e }), children: [c(It, { ...m, form: M, code: e, fields: C, cols: X, rowHeight: x, itemMargin: [I, B] }), w == null ? void 0 : w.map((V) => {
var k;
return c(Wt, { name: V.code, children: c(on, { form: M, name: V.code, type: V.type, initialValue: V.initialValue, initialValueLanguage: (k = V.extras) == null ? void 0 : k.initialValueLanguage }) }, JSON.stringify(V.code));
})] });
});
var It;
const da = ({ $setting: e, $close: t, extras: a, code: n, primaryKey: i, ...r }) => {
const [s] = re.useForm(), o = rn(n, i, e);
return N(() => {
o && s.setFieldsValue(o);
}, [o]), c(q, { actions: $(b.Fragment, { children: [c(S, { name: "保存", type: "primary", widget: () => {
const l = s.getFieldValue("__RESOURCE__"), { initDataUri: u = `/api/${n}` } = e || {};
s.validateFields(!0).then((d) => l ? g.pick(d, [l]) : d).then((d) => E.post(i ? `${u}/${i}` : `${u}`, d).msg(t)).catch(() => K.error("请先完善表单信息", { duration: 2e3 }));
} }), c(S, { name: "取消", widget: () => t(!1) })] }), extras: a, children: c(cn, { form: s, code: n, primaryKey: i, ...r }) });
}, dn = (e, t, { isReplaceRouteHistory: a = !1 } = {}) => Pe.redirect(t, e, { replace: a }), At = (e, t, { status: { loading: a, disabled: n }, setStatus: i }) => {
const r = { loading: (s) => s === void 0 ? a : i((o) => ({ ...o, loading: s })), disabled: (s) => s === void 0 ? n : i((o) => ({ ...o, disabled: s })) };
return g.isFunction(t) ? t.call(null, { ...e, ...r }) : g.isString(t) && t ? $e.exec(t, e, r) : null;
}, Mt = (e, t, a, n) => g.isString(t) && t ? Q.getWidgetComponent(t).then(({ default: i }) => K.modal(i, { ...e, $setting: a }, n)).catch((i) => {
K.error(t, { content: i.toString() });
}) : K.modal(t, { ...e, $setting: a }, n), un = (e, t, a, n) => K.modal(da, { ...e, $setting: a, code: t }, n), gn = (e, t, a, n) => K.modal(vt, { base62params: e, $setting: a, listCode: t }, n), pn = ({ widget: e, widgetType: t, widgetData: a, widgetProps: n, widgetSetting: i, widgetContainerProps: r }, { onAfterClick: s, onBeforeClick: o }) => {
const l = Ge(Le), [u, d] = P({ leading: !0, trailing: !1 }), m = pe(() => {
switch (t) {
case "redirect":
return g.partialRight(dn, e, i);
case "func":
return g.partialRight(At, (i == null ? void 0 : i.code) ?? e, { status: u, setStatus: d });
case "fsdpf-component":
return g.partialRight(Mt, e, i, r);
case "grid-layout-form":
return g.partialRight(un, e, i, r);
case "data-list":
return g.partialRight(gn, e, i, r);
default:
if ($t(e) || b.isValidElement(e)) return g.partialRight(Mt, e, i, r);
if (g.isFunction(e)) return g.partialRight(At, (i == null ? void 0 : i.code) || e, { status: u, setStatus: d });
}
return (...y) => console.error("useButton unknown widgetType", t, ...y);
}, [e, t]);
return [g.debounce((y) => (o == null || o(y), Promise.resolve(_t(n, y, { list: l })).then((h) => m({ ...a, ...h })).then((h) => s == null ? void 0 : s(h)).catch(console.error)), 300, { leading: !0, trailing: !1 }), u];
}, zt = /* @__PURE__ */ new Set(), ft = (e = [], t = 0) => {
const a = e[t];
if (a.length && !zt.has(a)) {
const n = document.createElement("script");
n.setAttribute("src", a), n.setAttribute("data-namespace", a), e.length > t + 1 && (n.onload = () => {
ft(e, t + 1);
}, n.onerror = () => {
ft(e, t + 1);
}), zt.add(a), document.body.appendChild(n);
}
}, yt = ({ className: e, type: t, style: a = {}, ...n }) => c("span", { role: "img", className: R("ff-iconfont", e), style: a, ...n, children: c("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: c("use", { xlinkHref: `#${t}` }) }) });
yt.propTypes = { className: O.string, type: O.string.isRequired, style: O.object }, yt.init = ft;
const Qe = (e) => function({ className: t, children: a, name: n, icon: i, type: r = "default", iconPosition: s = "start", noAuthType: o, onAfterClick: l, onBeforeClick: u, data: d, loading: m, disabled: y, tooltip: h, popConfirm: f, widget: C, widgetType: w, widgetData: x, widgetProps: I, widgetSetting: B, widgetContainerProps: X, ...G }) {
const A = { type: "primary", className: R("ff-button", t), iconPosition: s };
r === "danger" ? A.danger = !0 : r === "default" && (A.type = r), e === "link" || e === "dashed" ? (A.type = e, r === "default" && (A.className = R(A.className, "ff-default"))) : e !== "circle" && e !== "round" || (A.shape = e), i && (A.icon = c(yt, { type: i }));
const [D, H] = P(!1), [M, { disabled: J, loading: V }] = pn({ widget: C, widgetType: w, widgetData: x, widgetProps: I, widgetSetting: B, widgetContainerProps: X }, { onAfterClick: l, onBeforeClick: u });
return c(va, { okText: "确定", cancelText: "取消", ...f || {}, disabled: J || y, open: D, onOpenChange: (k) => {
if (!k) return H(k);
f ? H(k) : M(d);
}, onConfirm: () => {
M(d);
}, onClick: (k) => {
k.stopPropagation();
}, children: c(ka, { ...h, title: D ? null : h == null ? void 0 : h.title, trigger: ["hover", "click"], children: c(lt, { loading: V || m, disabled: J || y, ...A, ...G, children: a || n }) }) });
}, S = Qe("default"), mn = Qe("link"), hn = Qe("circle"), fn = Qe("round"), yn = Qe("dashed"), Bt = ({ data: e, widget: t, widgetType: a = "fsdpf-component", children: n, widgetData: i, widgetProps: r, widgetSetting: s, widgetContainerProps: o }) => {
const l = Ge(Le), [u, d] = P(!1), [m, y] = P("hover"), [h, f] = P({}), [C, w] = P();
N(() => {
a == "grid-layout-form" ? w(b.createElement(da, { ...i, $setting: s, code: t })) : a == "data-list" ? w(b.createElement(vt, { base62params: e, $setting: s, listCode: t })) : g.isString(t) ? Q.getWidgetComponent(t).then(({ default: B }) => {
w(b.createElement(B, { ...i, $setting: s }));
}).catch((B) => w(B.toString())) : $t(t) ? w(b.createElement(t, { ...i, $setting: s })) : b.isValidElement(t) && w(b.cloneElement(t, { ...i, $setting: s }));
}, [t, a, i]), N(() => {
Promise.resolve(_t(r, e, { list: l })).then(f);
}, [r, e]);
const x = (B) => {
d(B), !B && y("hover");
}, I = () => {
d(!0), y("click");
};
return c(Sa, { zIndex: 1e3, ...o, onPopupClick: I, onClick: I, open: u, trigger: m, content: c(wn, { children: C && b.cloneElement(C, { ...h, $close: () => x(!1) }) }), children: n, onOpenChange: x, overlayClassName: "ff-popup ff-popover" });
}, wn = ({ children: e }) => {
const [t, a] = P({}), n = ge((r, s) => a((o) => ({ ...o, [r]: s })), []), i = ge((r) => a((s) => ({ ...s, [r]: void 0 })), []);
return $(_e.Provider, { value: { ele: t, mount: n, unmount: i }, children: [t != null && t.title || t != null && t["sub-title"] ? $("div", { className: "ff-popup-header", children: [(t == null ? void 0 : t.title) || c("div", { className: "ff-popup-title" }), (t == null ? void 0 : t["sub-title"]) || c("div", { className: "ff-popup-sub-title" })] }) : null, e, t != null && t.extras || t != null && t.actions ? $("div", { className: "ff-popup-footer", children: [(t == null ? void 0 : t.extras) || c("div", { className: "ff-popup-extras" }), (t == null ? void 0 : t.actions) || c("div", { className: "ff-popup-actions" })] }) : null] });
};
Bt.propTypes = { widgetType: O.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }, S.propTypes = { type: O.oneOf(["primary", "default", "danger", ""]), name: O.string, icon: O.string, iconPosition: O.oneOf(["start", "end"]), data: O.any, widget: O.any, widgetType: O.oneOf(["destroy", "redirect", "func", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: O.object, widgetProps: O.object, widgetSetting: O.object, widgetContainerProps: O.object }, S.Link = mn, S.Link.defaultProps = S.defaultProps, S.Link.propTypes = S.propTypes, S.Circle = hn, S.Circle.defaultProps = S.defaultProps, S.Circle.propTypes = S.propTypes, S.Round = fn, S.Round.defaultProps = S.defaultProps, S.Round.propTypes = S.propTypes, S.Dashed = yn, S.Dashed.defaultProps = S.defaultProps, S.Dashed.propTypes = S.propTypes, S.Popover = Bt;
const bn = ({ fields: e, formProps: t, $close: a }) => {
const [n] = re.useForm(), i = pe(() => [{ name: "__PROPS__", value: t }], [t]);
return c(q, { actions: $(b.Fragment, { children: [c(S, { name: "取消", widget: () => a(!1) }), c(S, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(a) })] }), children: c(re, { fields: i, form: n, className: "ff-modal-form", children: e == null ? void 0 : e.map(({ code: r, ...s }) => c(ln, { code: r, ...s }, r)) }) });
}, Cn = ({ className: e, $close: t, children: a, title: n, subTitle: i, actions: r, extras: s, zIndex: o, ...l }) => $(La, { ...l, prefixCls: "ff-drawer", className: R("ff-popup", e), height: 378, maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (u) => ({ motionAppear: !0, motionName: `panel-motion-${u}` }), children: [$("div", { className: "ff-popup-header", children: [c("button", { "aria-label": "Close", className: "ff-popup-close", onClick: l.onClose, children: c(Ct, { type: "close" }) }), n, i] }), c("div", { className: "ff-popup-body", children: a }), $("div", { className: "ff-popup-footer", children: [s, " ", r] })] }), vn = ({ className: e, $close: t, $event: a, children: n, title: i, subTitle: r, actions: s, extras: o, zIndex: l, placement: u, ...d }) => {
const m = (a == null ? void 0 : a.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: a == null ? void 0 : a.pageX, y: a == null ? void 0 : a.pageY } };
return c(Va, { ...d, ...m, prefixCls: "ff-modal", modalRender: () => $("div", { className: R("ff-modal-content ff-popup", e), children: [$("div", { className: "ff-popup-header", children: [c("button", { "aria-label": "Close", className: "ff-popup-close", onClick: d.onClose, children: c(Ct, { type: "close" }) }), i, " ", r] }), c("div", { className: "ff-popup-body", children: n }), $("div", { className: "ff-popup-footer", children: [o, " ", s] })] }) });
}, ua = ({ placement: e, $close: t, $event: a, children: n, title: i, ...r }) => {
const [s, o] = P({}), [l, u] = P(!0), d = ge((f, C) => o((w) => ({ ...w, [f]: C })), []), m = ge((f) => o((C) => ({ ...C, [f]: void 0 })), []);
let y = { ...r, className: s.rootClassName, title: s.title || i && b.createElement("div", { className: R("ff-popup-title") }, i), subTitle: s["sub-title"], actions: s.actions, extras: s.extras, children: n, $close: t, $event: a, onClose: () => u(!1) };
const h = () => {
t(!1);
};
return c(_e.Provider, { value: { ele: s, mount: d, unmount: m }, children: e && e !== "center" ? c(Cn, { ...y, placement: e, open: l, afterOpenChange: (f) => !f && h() }) : c(vn, { ...y, visible: l, afterClose: h }) });
};
ua.propTypes = { placement: O.oneOf(["center", "left", "top", "right", "bottom"]) };
const W = () => {
const [e, t] = Ra({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (r) => {
const { offsetHeight: s } = r;
return { height: s };
}, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, a] = b.useReducer((r) => r + 1, 0);
N(() => {
W.$onClick = n, W.$queue.forEach(([r, s, o], l, u) => {
i([s, o], ...r), delete u[l];
});
}, []);
const n = (r, s = {}, o = {}) => new Promise((l, u) => i([l, u], r, s, o)), i = ([r, s], o, l = {}, u = {}) => {
const d = W.$index++, m = (y) => ((h, f) => (W.$popups.delete(h), a(), f == null ? void 0 : f()))(d, () => r(y));
if (o === Gt) return e.open({ ...u, key: d, content: b.createElement(o, { ...l, $close: () => e.close(d) }) });
W.$popups.set(d, b.createElement(ua, { zIndex: d, maskClosable: !1, $event: l == null ? void 0 : l.$event, ...u, key: d, $close: m }, b.isValidElement(o) ? b.cloneElement(o, { ...l, $close: m }) : o != null && o.name ? b.createElement(o, { ...l, $close: m }) : o)), a();
};
return $(b.Fragment, { children: [Array.from(W.$popups).map(([r, s]) => s), t] });
};
W.$popups = /* @__PURE__ */ new Map(), W.$index = 0, W.$queue = [], W.$onClick = (...e) => new Promise((t, a) => {
W.$queue.push([e, t, a]);
});
const Ut = (e, t, a = {}) => W.$onClick(e, t, a), st = (e, { showProgress: t, duration: a, ...n } = { duration: 1.5 }) => W.$onClick(Gt, { content: e, ...n }, { showProgress: t, duration: a }), K = { modal: Ut, confirm: (e, t = {}) => W.$onClick(ja, { content: e, ...t }, { placement: "center" }), form: (e, t = {}, a = {}) => Ut(bn, { formProps: a, fields: e }, { placement: "center", ...t }).then((n) => {
if (n === !1) throw !1;
return n;
}), notification: st, success: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-success", icon: "check" }), error: (e, t = { duration: 1.5 }) => st(e, { ...t, className: "ff-notification-error", icon: "close" }) };
Be.configure({ showSpinner: !1 }), Ue.interceptors.request.use((e) => {
e.headers.Platform = "web", e.headers.SaaS = window.localStorage.getItem("SaaS");
const t = window.localStorage.getItem(tt);
return e.headers.Authorization = t ? `Bearer ${t} ` : void 0, Be.inc(), e;
}, (e) => (Be.done(), Promise.reject({ code: -1, msg: e }))), Ue.interceptors.response.use(({ data: e, headers: t }) => (Be.done(), { ...e, res: t == null ? void 0 : t.res }), function(e) {
return Be.done(), Promise.reject(e.message);
}), window.addEventListener("unhandledrejection", ct.onUnhandledRejection), ct.onMsg = (e, t) => K[[0, 1].includes(e) ? "success" : "error"](t).then(() => e === 20300 && Pe.redirect(De.get("Common.WEBSITE_LOGIN_PAGE")));
const wt = { appUrl: "", init: (e, t, a) => {
wt.appUrl = a, Ue.defaults.baseURL = a, Ue.defaults.timeout = 15e3, Object.assign(wt, new ct(e, t, Ue));
} }, E = wt;
class Pt extends Error {
constructor(t, a) {
super(a), Error.captureStackTrace && Error.captureStackTrace(this, Pt), !a instanceof We && (this.name = `${t} Error Runtime`);
}
}
class We extends Error {
constructor(t, ...a) {
super(...a), Error.captureStackTrace && Error.captureStackTrace(this, We), this.name = `${t} Not Found`;
}
}
const ot = "mine", tt = "token";
var Se, _;
const ie = class ie {
constructor() {
F(this, _, /* @__PURE__ */ new Map());
v(this, "setVendor", (t, a) => p(this, _).set(t, new Jt(a, async (n, i) => {
var s, o;
if (!(n != null && n.default)) throw "@pkg not found";
let r = () => i;
switch ("function") {
case typeof (r = (s = n.default) == null ? void 0 : s[`./${i}/index.jsx`]):
case typeof (r = (o = n.default) == null ? void 0 : o[`./${i}/index.js`]):
return r();
}
throw new We(i);
})));
v(this, "getWidgetComponent", async (t) => {
if (!t) throw "getWidgetComponent widget is required";
const [, a] = t == null ? void 0 : t.split("@ff/"), [, n] = t == null ? void 0 : t.split("@app/"), [, i] = t == null ? void 0 : t.split("@pkg/"), [, r] = t == null ? void 0 : t.split("@fsdpf/");
try {
switch (!0) {
case (!!a && p(this, _).has("pkg")):
return await p(this, _).get("pkg").get(a);
case (!!n && p(this, _).has("pkg")):
return await p(this, _).get("pkg").get(n);
case (!!i && p(this, _).has("pkg")):
return await p(this, _).get("pkg").get(i);
case (!!r && p(this, _).has("pkg")):
return await p(this, _).get("pkg").get(r);
default:
throw new We(t);
}
} catch (s) {
throw new Pt(t, s);
}
});
v(this, "getRoutes", () => E.get("/api/my-router").then((t) => [...t, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/DataListSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/GridLayoutFormSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ResourceApiSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ChartsSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/FsmSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/components/ff-design/ComponentSetting", extra: { layout: "@pkg/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/components/ff/NotFound" }].map(({ uuid: a, ...n }) => [a, { uuid: a, ...n }])).then((t) => new Map(t)));
v(this, "getMenus", () => E.get("/api/my-menu"));
v(this, "getConfigure", () => E.get("api/init-configure"));
v(this, "getWidgetOperationAuth", () => E.get("/api/init-widget-operation-auth").then((t) => t.reduce((a, { uuid: n, auth: i }) => [...a, [n, i]], [])));
v(this, "getPhoneNumber", (t) => E.get(`/api/user-wx-phone-number/${t}`));
v(this, "getUserToken", () => {
const t = window.localStorage.getItem(tt);
if (!t) return "";
const a = t.split(".");
if (!Array.isArray(a) || a.length !== 3) throw "登录令牌无效!";
const { iat: n } = JSON.parse(window.atob(a[1]));
if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!";
return t;
});
v(this, "checkUserToken", () => {
try {
return !!this.getUserToken();
} catch {
return !1;
}
});
v(this, "getUserInfo", (t = !0) => {
var a;
try {
const n = this.getUserToken();
if (!n) return Promise.resolve(null);
const { iat: i } = JSON.parse(window.atob((a = n == null ? void 0 : n.split(".")) == null ? void 0 : a[1])), { iat: r, ...s } = E.decode(window.localStorage.getItem(ot) || "", {});
return r === i ? Promise.resolve(s) : E.get("/api/mine-info").then(({ User: o = null }) => (window.localStorage.setItem(ot, E.encode({ ...o, iat: i })), o));
} catch (n) {
console.error(n), t && Popup.error("请登录").then(logout);
}
return Promise.resolve(null);
});
v(this, "login", (t, a, n = {}) => E.post("/api/user-token", { username: t, passwd: Oa.hash(a), platform: "web", ...n }).then(({ token: i }) => (window.localStorage.setItem(tt, i), i)));
v(this, "logout", () => {
window.localStorage.removeItem(ot), window.localStorage.removeItem(tt);
});
if (p(ie, Se)) return p(ie, Se);
}
};
Se = new WeakMap(), _ = new WeakMap(), F(ie, Se, null), v(ie, "getInstance", () => (p(ie, Se) || z(ie, Se, new ie()), p(ie, Se)));
let bt = ie;
const Q = bt.getInstance(), kn = b.createContext({ user: {}, initUser: () => {
}, initUserComplete: !1 }), Sn = b.createContext({ set: () => {
}, get: () => {
}, assign: () => {
}, currentRoute: () => {
} }), $t = (e) => !!(e != null && e.name) && (e.prototype instanceof b.Component || /^[A-Z]/.test(e.name)), Pn = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: kn, AppGlobalParamsContext: Sn, cache: Jt, configure: De, default: Q, func: $e, http: E, isReactComponent: $t, route: Pe }, Symbol.toStringTag, { value: "Module" })), $n = (e, t, a = "children") => {
if (g.isEmpty(e)) return {};
const n = g.find(e, ["value", t]);
if (!g.isEmpty(n)) return n;
const i = e.length;
for (let r = 0; r < i; r++) {
const { [a]: s } = e[r], o = $n(s, t, a);
if (!g.isEmpty(o)) return o;
}
return {};
};
export {
$t as $,
Yn as A,
Qn as B,
cn as C,
Da as D,
St as E,
ln as F,
Kn as G,
Ja as H,
da as I,
an as J,
nn as K,
rn as L,
sn as M,
yt as N,
S as O,
Ia as P,
pn as Q,
Xt as R,
q as S,
_e as T,
Kt as U,
W as V,
K as W,
Dn as X,
Wn as Y,
qn as Z,
Q as _,
na as a,
E as a0,
Jt as a1,
De as a2,
$e as a3,
Pe as a4,
kn as a5,
Sn as a6,
$n as a7,
sa as b,
Gn as c,
ra as d,
kt as e,
ea as f,
Zt as g,
ta as h,
aa as i,
vt as j,
Le as k,
Ha as l,
Ya as m,
za as n,
Ua as o,
Aa as p,
Ma as q,
Hn as r,
Jn as s,
gt as t,
ia as u,
oa as v,
jt as w,
_n as x,
Ye as y,
tn as z
};

File diff suppressed because it is too large Load Diff

View File

@ -1,835 +0,0 @@
var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function getDefaultExportFromCjs(x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
}
var propTypes = { exports: {} }, reactIs = { exports: {} }, reactIs_production_min = {};
/** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredReactIs_production_min;
function requireReactIs_production_min() {
if (hasRequiredReactIs_production_min)
return reactIs_production_min;
hasRequiredReactIs_production_min = 1;
var b = typeof Symbol == "function" && Symbol.for, c = b ? Symbol.for("react.element") : 60103, d = b ? Symbol.for("react.portal") : 60106, e = b ? Symbol.for("react.fragment") : 60107, f = b ? Symbol.for("react.strict_mode") : 60108, g = b ? Symbol.for("react.profiler") : 60114, h = b ? Symbol.for("react.provider") : 60109, k = b ? Symbol.for("react.context") : 60110, l = b ? Symbol.for("react.async_mode") : 60111, m = b ? Symbol.for("react.concurrent_mode") : 60111, n = b ? Symbol.for("react.forward_ref") : 60112, p = b ? Symbol.for("react.suspense") : 60113, q = b ? Symbol.for("react.suspense_list") : 60120, r = b ? Symbol.for("react.memo") : 60115, t = b ? Symbol.for("react.lazy") : 60116, v = b ? Symbol.for("react.block") : 60121, w = b ? Symbol.for("react.fundamental") : 60117, x = b ? Symbol.for("react.responder") : 60118, y = b ? Symbol.for("react.scope") : 60119;
function z(a) {
if (typeof a == "object" && a !== null) {
var u = a.$$typeof;
switch (u) {
case c:
switch (a = a.type, a) {
case l:
case m:
case e:
case g:
case f:
case p:
return a;
default:
switch (a = a && a.$$typeof, a) {
case k:
case n:
case t:
case r:
case h:
return a;
default:
return u;
}
}
case d:
return u;
}
}
}
function A(a) {
return z(a) === m;
}
return reactIs_production_min.AsyncMode = l, reactIs_production_min.ConcurrentMode = m, reactIs_production_min.ContextConsumer = k, reactIs_production_min.ContextProvider = h, reactIs_production_min.Element = c, reactIs_production_min.ForwardRef = n, reactIs_production_min.Fragment = e, reactIs_production_min.Lazy = t, reactIs_production_min.Memo = r, reactIs_production_min.Portal = d, reactIs_production_min.Profiler = g, reactIs_production_min.StrictMode = f, reactIs_production_min.Suspense = p, reactIs_production_min.isAsyncMode = function(a) {
return A(a) || z(a) === l;
}, reactIs_production_min.isConcurrentMode = A, reactIs_production_min.isContextConsumer = function(a) {
return z(a) === k;
}, reactIs_production_min.isContextProvider = function(a) {
return z(a) === h;
}, reactIs_production_min.isElement = function(a) {
return typeof a == "object" && a !== null && a.$$typeof === c;
}, reactIs_production_min.isForwardRef = function(a) {
return z(a) === n;
}, reactIs_production_min.isFragment = function(a) {
return z(a) === e;
}, reactIs_production_min.isLazy = function(a) {
return z(a) === t;
}, reactIs_production_min.isMemo = function(a) {
return z(a) === r;
}, reactIs_production_min.isPortal = function(a) {
return z(a) === d;
}, reactIs_production_min.isProfiler = function(a) {
return z(a) === g;
}, reactIs_production_min.isStrictMode = function(a) {
return z(a) === f;
}, reactIs_production_min.isSuspense = function(a) {
return z(a) === p;
}, reactIs_production_min.isValidElementType = function(a) {
return typeof a == "string" || typeof a == "function" || a === e || a === m || a === g || a === f || a === p || a === q || typeof a == "object" && a !== null && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
}, reactIs_production_min.typeOf = z, reactIs_production_min;
}
var reactIs_development = {};
/** @license React v16.13.1
* react-is.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var hasRequiredReactIs_development;
function requireReactIs_development() {
return hasRequiredReactIs_development || (hasRequiredReactIs_development = 1, process.env.NODE_ENV !== "production" && function() {
var hasSymbol = typeof Symbol == "function" && Symbol.for, REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103, REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106, REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107, REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108, REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114, REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109, REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110, REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111, REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111, REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112, REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113, REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120, REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115, REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116, REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121, REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117, REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118, REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119;
function isValidElementType(type) {
return typeof type == "string" || typeof type == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
}
function typeOf(object) {
if (typeof object == "object" && object !== null) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
var type = object.type;
switch (type) {
case REACT_ASYNC_MODE_TYPE:
case REACT_CONCURRENT_MODE_TYPE:
case REACT_FRAGMENT_TYPE:
case REACT_PROFILER_TYPE:
case REACT_STRICT_MODE_TYPE:
case REACT_SUSPENSE_TYPE:
return type;
default:
var $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
case REACT_CONTEXT_TYPE:
case REACT_FORWARD_REF_TYPE:
case REACT_LAZY_TYPE:
case REACT_MEMO_TYPE:
case REACT_PROVIDER_TYPE:
return $$typeofType;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:
return $$typeof;
}
}
}
var AsyncMode = REACT_ASYNC_MODE_TYPE, ConcurrentMode = REACT_CONCURRENT_MODE_TYPE, ContextConsumer = REACT_CONTEXT_TYPE, ContextProvider = REACT_PROVIDER_TYPE, Element = REACT_ELEMENT_TYPE, ForwardRef = REACT_FORWARD_REF_TYPE, Fragment = REACT_FRAGMENT_TYPE, Lazy = REACT_LAZY_TYPE, Memo = REACT_MEMO_TYPE, Portal = REACT_PORTAL_TYPE, Profiler = REACT_PROFILER_TYPE, StrictMode = REACT_STRICT_MODE_TYPE, Suspense = REACT_SUSPENSE_TYPE, hasWarnedAboutDeprecatedIsAsyncMode = !1;
function isAsyncMode(object) {
return hasWarnedAboutDeprecatedIsAsyncMode || (hasWarnedAboutDeprecatedIsAsyncMode = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
}
function isConcurrentMode(object) {
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
}
function isContextConsumer(object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
}
function isContextProvider(object) {
return typeOf(object) === REACT_PROVIDER_TYPE;
}
function isElement(object) {
return typeof object == "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
reactIs_development.AsyncMode = AsyncMode, reactIs_development.ConcurrentMode = ConcurrentMode, reactIs_development.ContextConsumer = ContextConsumer, reactIs_development.ContextProvider = ContextProvider, reactIs_development.Element = Element, reactIs_development.ForwardRef = ForwardRef, reactIs_development.Fragment = Fragment, reactIs_development.Lazy = Lazy, reactIs_development.Memo = Memo, reactIs_development.Portal = Portal, reactIs_development.Profiler = Profiler, reactIs_development.StrictMode = StrictMode, reactIs_development.Suspense = Suspense, reactIs_development.isAsyncMode = isAsyncMode, reactIs_development.isConcurrentMode = isConcurrentMode, reactIs_development.isContextConsumer = isContextConsumer, reactIs_development.isContextProvider = isContextProvider, reactIs_development.isElement = isElement, reactIs_development.isForwardRef = isForwardRef, reactIs_development.isFragment = isFragment, reactIs_development.isLazy = isLazy, reactIs_development.isMemo = isMemo, reactIs_development.isPortal = isPortal, reactIs_development.isProfiler = isProfiler, reactIs_development.isStrictMode = isStrictMode, reactIs_development.isSuspense = isSuspense, reactIs_development.isValidElementType = isValidElementType, reactIs_development.typeOf = typeOf;
}()), reactIs_development;
}
var hasRequiredReactIs;
function requireReactIs() {
return hasRequiredReactIs || (hasRequiredReactIs = 1, process.env.NODE_ENV === "production" ? reactIs.exports = requireReactIs_production_min() : reactIs.exports = requireReactIs_development()), reactIs.exports;
}
/*
object-assign
(c) Sindre Sorhus
@license MIT
*/
var objectAssign, hasRequiredObjectAssign;
function requireObjectAssign() {
if (hasRequiredObjectAssign)
return objectAssign;
hasRequiredObjectAssign = 1;
var getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty, propIsEnumerable = Object.prototype.propertyIsEnumerable;
function toObject(val) {
if (val == null)
throw new TypeError("Object.assign cannot be called with null or undefined");
return Object(val);
}
function shouldUseNative() {
try {
if (!Object.assign)
return !1;
var test1 = new String("abc");
if (test1[5] = "de", Object.getOwnPropertyNames(test1)[0] === "5")
return !1;
for (var test2 = {}, i = 0; i < 10; i++)
test2["_" + String.fromCharCode(i)] = i;
var order2 = Object.getOwnPropertyNames(test2).map(function(n) {
return test2[n];
});
if (order2.join("") !== "0123456789")
return !1;
var test3 = {};
return "abcdefghijklmnopqrst".split("").forEach(function(letter) {
test3[letter] = letter;
}), Object.keys(Object.assign({}, test3)).join("") === "abcdefghijklmnopqrst";
} catch {
return !1;
}
}
return objectAssign = shouldUseNative() ? Object.assign : function(target, source) {
for (var from, to = toObject(target), symbols, s = 1; s < arguments.length; s++) {
from = Object(arguments[s]);
for (var key in from)
hasOwnProperty.call(from, key) && (to[key] = from[key]);
if (getOwnPropertySymbols) {
symbols = getOwnPropertySymbols(from);
for (var i = 0; i < symbols.length; i++)
propIsEnumerable.call(from, symbols[i]) && (to[symbols[i]] = from[symbols[i]]);
}
}
return to;
}, objectAssign;
}
var ReactPropTypesSecret_1, hasRequiredReactPropTypesSecret;
function requireReactPropTypesSecret() {
if (hasRequiredReactPropTypesSecret)
return ReactPropTypesSecret_1;
hasRequiredReactPropTypesSecret = 1;
var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
return ReactPropTypesSecret_1 = ReactPropTypesSecret, ReactPropTypesSecret_1;
}
var has, hasRequiredHas;
function requireHas() {
return hasRequiredHas || (hasRequiredHas = 1, has = Function.call.bind(Object.prototype.hasOwnProperty)), has;
}
var checkPropTypes_1, hasRequiredCheckPropTypes;
function requireCheckPropTypes() {
if (hasRequiredCheckPropTypes)
return checkPropTypes_1;
hasRequiredCheckPropTypes = 1;
var printWarning = function() {
};
if (process.env.NODE_ENV !== "production") {
var ReactPropTypesSecret = requireReactPropTypesSecret(), loggedTypeFailures = {}, has2 = requireHas();
printWarning = function(text) {
var message = "Warning: " + text;
typeof console < "u" && console.error(message);
try {
throw new Error(message);
} catch {
}
};
}
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
if (process.env.NODE_ENV !== "production") {
for (var typeSpecName in typeSpecs)
if (has2(typeSpecs, typeSpecName)) {
var error;
try {
if (typeof typeSpecs[typeSpecName] != "function") {
var err = Error(
(componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
);
throw err.name = "Invariant Violation", err;
}
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
} catch (ex) {
error = ex;
}
if (error && !(error instanceof Error) && printWarning(
(componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
), error instanceof Error && !(error.message in loggedTypeFailures)) {
loggedTypeFailures[error.message] = !0;
var stack = getStack ? getStack() : "";
printWarning(
"Failed " + location + " type: " + error.message + (stack ?? "")
);
}
}
}
}
return checkPropTypes.resetWarningCache = function() {
process.env.NODE_ENV !== "production" && (loggedTypeFailures = {});
}, checkPropTypes_1 = checkPropTypes, checkPropTypes_1;
}
var factoryWithTypeCheckers, hasRequiredFactoryWithTypeCheckers;
function requireFactoryWithTypeCheckers() {
if (hasRequiredFactoryWithTypeCheckers)
return factoryWithTypeCheckers;
hasRequiredFactoryWithTypeCheckers = 1;
var ReactIs = requireReactIs(), assign = requireObjectAssign(), ReactPropTypesSecret = requireReactPropTypesSecret(), has2 = requireHas(), checkPropTypes = requireCheckPropTypes(), printWarning = function() {
};
process.env.NODE_ENV !== "production" && (printWarning = function(text) {
var message = "Warning: " + text;
typeof console < "u" && console.error(message);
try {
throw new Error(message);
} catch {
}
});
function emptyFunctionThatReturnsNull() {
return null;
}
return factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
var ITERATOR_SYMBOL = typeof Symbol == "function" && Symbol.iterator, FAUX_ITERATOR_SYMBOL = "@@iterator";
function getIteratorFn(maybeIterable) {
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
if (typeof iteratorFn == "function")
return iteratorFn;
}
var ANONYMOUS = "<<anonymous>>", ReactPropTypes = {
array: createPrimitiveTypeChecker("array"),
bigint: createPrimitiveTypeChecker("bigint"),
bool: createPrimitiveTypeChecker("boolean"),
func: createPrimitiveTypeChecker("function"),
number: createPrimitiveTypeChecker("number"),
object: createPrimitiveTypeChecker("object"),
string: createPrimitiveTypeChecker("string"),
symbol: createPrimitiveTypeChecker("symbol"),
any: createAnyTypeChecker(),
arrayOf: createArrayOfTypeChecker,
element: createElementTypeChecker(),
elementType: createElementTypeTypeChecker(),
instanceOf: createInstanceTypeChecker,
node: createNodeChecker(),
objectOf: createObjectOfTypeChecker,
oneOf: createEnumTypeChecker,
oneOfType: createUnionTypeChecker,
shape: createShapeTypeChecker,
exact: createStrictShapeTypeChecker
};
function is(x, y) {
return x === y ? x !== 0 || 1 / x === 1 / y : x !== x && y !== y;
}
function PropTypeError(message, data) {
this.message = message, this.data = data && typeof data == "object" ? data : {}, this.stack = "";
}
PropTypeError.prototype = Error.prototype;
function createChainableTypeChecker(validate) {
if (process.env.NODE_ENV !== "production")
var manualPropTypeCallCache = {}, manualPropTypeWarningCount = 0;
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
if (componentName = componentName || ANONYMOUS, propFullName = propFullName || propName, secret !== ReactPropTypesSecret) {
if (throwOnDirectAccess) {
var err = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
);
throw err.name = "Invariant Violation", err;
} else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
var cacheKey = componentName + ":" + propName;
!manualPropTypeCallCache[cacheKey] && // Avoid spamming the console because they are often not actionable except for lib authors
manualPropTypeWarningCount < 3 && (printWarning(
"You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
), manualPropTypeCallCache[cacheKey] = !0, manualPropTypeWarningCount++);
}
}
return props[propName] == null ? isRequired ? props[propName] === null ? new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")) : new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")) : null : validate(props, propName, componentName, location, propFullName);
}
var chainedCheckType = checkType.bind(null, !1);
return chainedCheckType.isRequired = checkType.bind(null, !0), chainedCheckType;
}
function createPrimitiveTypeChecker(expectedType) {
function validate(props, propName, componentName, location, propFullName, secret) {
var propValue = props[propName], propType = getPropType(propValue);
if (propType !== expectedType) {
var preciseType = getPreciseType(propValue);
return new PropTypeError(
"Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."),
{ expectedType }
);
}
return null;
}
return createChainableTypeChecker(validate);
}
function createAnyTypeChecker() {
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
}
function createArrayOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker != "function")
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf.");
var propValue = props[propName];
if (!Array.isArray(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array."));
}
for (var i = 0; i < propValue.length; i++) {
var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret);
if (error instanceof Error)
return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!isValidElement(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createElementTypeTypeChecker() {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName];
if (!ReactIs.isValidElementType(propValue)) {
var propType = getPropType(propValue);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createInstanceTypeChecker(expectedClass) {
function validate(props, propName, componentName, location, propFullName) {
if (!(props[propName] instanceof expectedClass)) {
var expectedClassName = expectedClass.name || ANONYMOUS, actualClassName = getClassName(props[propName]);
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`."));
}
return null;
}
return createChainableTypeChecker(validate);
}
function createEnumTypeChecker(expectedValues) {
if (!Array.isArray(expectedValues))
return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? printWarning(
"Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
) : printWarning("Invalid argument supplied to oneOf, expected an array.")), emptyFunctionThatReturnsNull;
function validate(props, propName, componentName, location, propFullName) {
for (var propValue = props[propName], i = 0; i < expectedValues.length; i++)
if (is(propValue, expectedValues[i]))
return null;
var valuesString = JSON.stringify(expectedValues, function(key, value) {
var type = getPreciseType(value);
return type === "symbol" ? String(value) : value;
});
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + "."));
}
return createChainableTypeChecker(validate);
}
function createObjectOfTypeChecker(typeChecker) {
function validate(props, propName, componentName, location, propFullName) {
if (typeof typeChecker != "function")
return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf.");
var propValue = props[propName], propType = getPropType(propValue);
if (propType !== "object")
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object."));
for (var key in propValue)
if (has2(propValue, key)) {
var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error instanceof Error)
return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function createUnionTypeChecker(arrayOfTypeCheckers) {
if (!Array.isArray(arrayOfTypeCheckers))
return process.env.NODE_ENV !== "production" && printWarning("Invalid argument supplied to oneOfType, expected an instance of array."), emptyFunctionThatReturnsNull;
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
var checker = arrayOfTypeCheckers[i];
if (typeof checker != "function")
return printWarning(
"Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."
), emptyFunctionThatReturnsNull;
}
function validate(props, propName, componentName, location, propFullName) {
for (var expectedTypes = [], i2 = 0; i2 < arrayOfTypeCheckers.length; i2++) {
var checker2 = arrayOfTypeCheckers[i2], checkerResult = checker2(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
if (checkerResult == null)
return null;
checkerResult.data && has2(checkerResult.data, "expectedType") && expectedTypes.push(checkerResult.data.expectedType);
}
var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : "";
return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + "."));
}
return createChainableTypeChecker(validate);
}
function createNodeChecker() {
function validate(props, propName, componentName, location, propFullName) {
return isNode(props[propName]) ? null : new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode."));
}
return createChainableTypeChecker(validate);
}
function invalidValidatorError(componentName, location, propFullName, key, type) {
return new PropTypeError(
(componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."
);
}
function createShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName], propType = getPropType(propValue);
if (propType !== "object")
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
for (var key in shapeTypes) {
var checker = shapeTypes[key];
if (typeof checker != "function")
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error)
return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function createStrictShapeTypeChecker(shapeTypes) {
function validate(props, propName, componentName, location, propFullName) {
var propValue = props[propName], propType = getPropType(propValue);
if (propType !== "object")
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`."));
var allKeys = assign({}, props[propName], shapeTypes);
for (var key in allKeys) {
var checker = shapeTypes[key];
if (has2(shapeTypes, key) && typeof checker != "function")
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
if (!checker)
return new PropTypeError(
"Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + `
Valid keys: ` + JSON.stringify(Object.keys(shapeTypes), null, " ")
);
var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret);
if (error)
return error;
}
return null;
}
return createChainableTypeChecker(validate);
}
function isNode(propValue) {
switch (typeof propValue) {
case "number":
case "string":
case "undefined":
return !0;
case "boolean":
return !propValue;
case "object":
if (Array.isArray(propValue))
return propValue.every(isNode);
if (propValue === null || isValidElement(propValue))
return !0;
var iteratorFn = getIteratorFn(propValue);
if (iteratorFn) {
var iterator = iteratorFn.call(propValue), step;
if (iteratorFn !== propValue.entries) {
for (; !(step = iterator.next()).done; )
if (!isNode(step.value))
return !1;
} else
for (; !(step = iterator.next()).done; ) {
var entry = step.value;
if (entry && !isNode(entry[1]))
return !1;
}
} else
return !1;
return !0;
default:
return !1;
}
}
function isSymbol(propType, propValue) {
return propType === "symbol" ? !0 : propValue ? propValue["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && propValue instanceof Symbol : !1;
}
function getPropType(propValue) {
var propType = typeof propValue;
return Array.isArray(propValue) ? "array" : propValue instanceof RegExp ? "object" : isSymbol(propType, propValue) ? "symbol" : propType;
}
function getPreciseType(propValue) {
if (typeof propValue > "u" || propValue === null)
return "" + propValue;
var propType = getPropType(propValue);
if (propType === "object") {
if (propValue instanceof Date)
return "date";
if (propValue instanceof RegExp)
return "regexp";
}
return propType;
}
function getPostfixForTypeWarning(value) {
var type = getPreciseType(value);
switch (type) {
case "array":
case "object":
return "an " + type;
case "boolean":
case "date":
case "regexp":
return "a " + type;
default:
return type;
}
}
function getClassName(propValue) {
return !propValue.constructor || !propValue.constructor.name ? ANONYMOUS : propValue.constructor.name;
}
return ReactPropTypes.checkPropTypes = checkPropTypes, ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache, ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes;
}, factoryWithTypeCheckers;
}
var factoryWithThrowingShims, hasRequiredFactoryWithThrowingShims;
function requireFactoryWithThrowingShims() {
if (hasRequiredFactoryWithThrowingShims)
return factoryWithThrowingShims;
hasRequiredFactoryWithThrowingShims = 1;
var ReactPropTypesSecret = requireReactPropTypesSecret();
function emptyFunction() {
}
function emptyFunctionWithReset() {
}
return emptyFunctionWithReset.resetWarningCache = emptyFunction, factoryWithThrowingShims = function() {
function shim(props, propName, componentName, location, propFullName, secret) {
if (secret !== ReactPropTypesSecret) {
var err = new Error(
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
);
throw err.name = "Invariant Violation", err;
}
}
shim.isRequired = shim;
function getShim() {
return shim;
}
var ReactPropTypes = {
array: shim,
bigint: shim,
bool: shim,
func: shim,
number: shim,
object: shim,
string: shim,
symbol: shim,
any: shim,
arrayOf: getShim,
element: shim,
elementType: shim,
instanceOf: getShim,
node: shim,
objectOf: getShim,
oneOf: getShim,
oneOfType: getShim,
shape: getShim,
exact: getShim,
checkPropTypes: emptyFunctionWithReset,
resetWarningCache: emptyFunction
};
return ReactPropTypes.PropTypes = ReactPropTypes, ReactPropTypes;
}, factoryWithThrowingShims;
}
if (process.env.NODE_ENV !== "production") {
var ReactIs = requireReactIs(), throwOnDirectAccess = !0;
propTypes.exports = requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
} else
propTypes.exports = requireFactoryWithThrowingShims()();
var propTypesExports = propTypes.exports;
const PropTypes = /* @__PURE__ */ getDefaultExportFromCjs(propTypesExports);
var nprogress = { exports: {} };
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
* @license MIT */
(function(module, exports) {
(function(root, factory) {
module.exports = factory();
})(commonjsGlobal, function() {
var NProgress2 = {};
NProgress2.version = "0.2.0";
var Settings = NProgress2.settings = {
minimum: 0.08,
easing: "ease",
positionUsing: "",
speed: 200,
trickle: !0,
trickleRate: 0.02,
trickleSpeed: 800,
showSpinner: !0,
barSelector: '[role="bar"]',
spinnerSelector: '[role="spinner"]',
parent: "body",
template: '<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'
};
NProgress2.configure = function(options) {
var key, value;
for (key in options)
value = options[key], value !== void 0 && options.hasOwnProperty(key) && (Settings[key] = value);
return this;
}, NProgress2.status = null, NProgress2.set = function(n) {
var started = NProgress2.isStarted();
n = clamp(n, Settings.minimum, 1), NProgress2.status = n === 1 ? null : n;
var progress = NProgress2.render(!started), bar = progress.querySelector(Settings.barSelector), speed = Settings.speed, ease = Settings.easing;
return progress.offsetWidth, queue(function(next) {
Settings.positionUsing === "" && (Settings.positionUsing = NProgress2.getPositioningCSS()), css(bar, barPositionCSS(n, speed, ease)), n === 1 ? (css(progress, {
transition: "none",
opacity: 1
}), progress.offsetWidth, setTimeout(function() {
css(progress, {
transition: "all " + speed + "ms linear",
opacity: 0
}), setTimeout(function() {
NProgress2.remove(), next();
}, speed);
}, speed)) : setTimeout(next, speed);
}), this;
}, NProgress2.isStarted = function() {
return typeof NProgress2.status == "number";
}, NProgress2.start = function() {
NProgress2.status || NProgress2.set(0);
var work = function() {
setTimeout(function() {
NProgress2.status && (NProgress2.trickle(), work());
}, Settings.trickleSpeed);
};
return Settings.trickle && work(), this;
}, NProgress2.done = function(force) {
return !force && !NProgress2.status ? this : NProgress2.inc(0.3 + 0.5 * Math.random()).set(1);
}, NProgress2.inc = function(amount) {
var n = NProgress2.status;
return n ? (typeof amount != "number" && (amount = (1 - n) * clamp(Math.random() * n, 0.1, 0.95)), n = clamp(n + amount, 0, 0.994), NProgress2.set(n)) : NProgress2.start();
}, NProgress2.trickle = function() {
return NProgress2.inc(Math.random() * Settings.trickleRate);
}, function() {
var initial = 0, current = 0;
NProgress2.promise = function($promise) {
return !$promise || $promise.state() === "resolved" ? this : (current === 0 && NProgress2.start(), initial++, current++, $promise.always(function() {
current--, current === 0 ? (initial = 0, NProgress2.done()) : NProgress2.set((initial - current) / initial);
}), this);
};
}(), NProgress2.render = function(fromStart) {
if (NProgress2.isRendered())
return document.getElementById("nprogress");
addClass(document.documentElement, "nprogress-busy");
var progress = document.createElement("div");
progress.id = "nprogress", progress.innerHTML = Settings.template;
var bar = progress.querySelector(Settings.barSelector), perc = fromStart ? "-100" : toBarPerc(NProgress2.status || 0), parent = document.querySelector(Settings.parent), spinner;
return css(bar, {
transition: "all 0 linear",
transform: "translate3d(" + perc + "%,0,0)"
}), Settings.showSpinner || (spinner = progress.querySelector(Settings.spinnerSelector), spinner && removeElement(spinner)), parent != document.body && addClass(parent, "nprogress-custom-parent"), parent.appendChild(progress), progress;
}, NProgress2.remove = function() {
removeClass(document.documentElement, "nprogress-busy"), removeClass(document.querySelector(Settings.parent), "nprogress-custom-parent");
var progress = document.getElementById("nprogress");
progress && removeElement(progress);
}, NProgress2.isRendered = function() {
return !!document.getElementById("nprogress");
}, NProgress2.getPositioningCSS = function() {
var bodyStyle = document.body.style, vendorPrefix = "WebkitTransform" in bodyStyle ? "Webkit" : "MozTransform" in bodyStyle ? "Moz" : "msTransform" in bodyStyle ? "ms" : "OTransform" in bodyStyle ? "O" : "";
return vendorPrefix + "Perspective" in bodyStyle ? "translate3d" : vendorPrefix + "Transform" in bodyStyle ? "translate" : "margin";
};
function clamp(n, min, max) {
return n < min ? min : n > max ? max : n;
}
function toBarPerc(n) {
return (-1 + n) * 100;
}
function barPositionCSS(n, speed, ease) {
var barCSS;
return Settings.positionUsing === "translate3d" ? barCSS = { transform: "translate3d(" + toBarPerc(n) + "%,0,0)" } : Settings.positionUsing === "translate" ? barCSS = { transform: "translate(" + toBarPerc(n) + "%,0)" } : barCSS = { "margin-left": toBarPerc(n) + "%" }, barCSS.transition = "all " + speed + "ms " + ease, barCSS;
}
var queue = /* @__PURE__ */ function() {
var pending = [];
function next() {
var fn = pending.shift();
fn && fn(next);
}
return function(fn) {
pending.push(fn), pending.length == 1 && next();
};
}(), css = /* @__PURE__ */ function() {
var cssPrefixes = ["Webkit", "O", "Moz", "ms"], cssProps = {};
function camelCase(string) {
return string.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(match, letter) {
return letter.toUpperCase();
});
}
function getVendorProp(name) {
var style = document.body.style;
if (name in style)
return name;
for (var i = cssPrefixes.length, capName = name.charAt(0).toUpperCase() + name.slice(1), vendorName; i--; )
if (vendorName = cssPrefixes[i] + capName, vendorName in style)
return vendorName;
return name;
}
function getStyleProp(name) {
return name = camelCase(name), cssProps[name] || (cssProps[name] = getVendorProp(name));
}
function applyCss(element, prop, value) {
prop = getStyleProp(prop), element.style[prop] = value;
}
return function(element, properties) {
var args = arguments, prop, value;
if (args.length == 2)
for (prop in properties)
value = properties[prop], value !== void 0 && properties.hasOwnProperty(prop) && applyCss(element, prop, value);
else
applyCss(element, args[1], args[2]);
};
}();
function hasClass(element, name) {
var list = typeof element == "string" ? element : classList(element);
return list.indexOf(" " + name + " ") >= 0;
}
function addClass(element, name) {
var oldList = classList(element), newList = oldList + name;
hasClass(oldList, name) || (element.className = newList.substring(1));
}
function removeClass(element, name) {
var oldList = classList(element), newList;
hasClass(element, name) && (newList = oldList.replace(" " + name + " ", " "), element.className = newList.substring(1, newList.length - 1));
}
function classList(element) {
return (" " + (element.className || "") + " ").replace(/\s+/gi, " ");
}
function removeElement(element) {
element && element.parentNode && element.parentNode.removeChild(element);
}
return NProgress2;
});
})(nprogress);
var nprogressExports = nprogress.exports;
const NProgress = /* @__PURE__ */ getDefaultExportFromCjs(nprogressExports);
export {
NProgress as N,
PropTypes as P
};

1470
dist/common/vender-DDOSHWIo.js vendored Normal file

File diff suppressed because it is too large Load Diff

9
dist/components.js vendored
View File

@ -1,5 +1,8 @@
import { N, h } from "./common/main-DHW9LhcM.js";
import { X as s, N as p, Y as n, Z as t, W as d } from "./common/main-2s1hdQO8.js";
export {
N as Icon,
h as Popup
s as Empty,
p as Icon,
n as Loading,
t as NotFound,
d as Popup
};

15
dist/container.js vendored
View File

@ -1,8 +1,11 @@
import { S, g, h, f, F } from "./common/main-DHW9LhcM.js";
import { T as o, X as s, Y as p, Z as t, U as d, W as n, V as r, S as u } from "./common/main-2s1hdQO8.js";
export {
S as Context,
g as FFPageRender,
h as FFPopupRender,
f as SlotRender,
F as default
o as Context,
s as Empty,
p as Loading,
t as NotFound,
d as PageRender,
n as Popup,
r as PopupRender,
u as default
};

32
dist/data-list.js vendored
View File

@ -1,19 +1,19 @@
import { s, q, l, o, t, p, n, r, m, v, D, w, x, z, A, y } from "./common/main-DHW9LhcM.js";
import { m as s, k as e, e as r, i, n as o, j as D, h as l, l as u, f as L, o as n, D as d, p as m, q as F, s as p, t as C, r as b } from "./common/main-2s1hdQO8.js";
export {
s as DataListContent,
q as DataListContext,
l as DataListFilter,
o as DataListFooter,
t as DataListFramework,
p as DataListHelper,
n as DataListSider,
r as DataListTable,
m as DataListToolbar,
v as DataTableFramework,
D as default,
w as loadDataListFieldWidget,
x as useColumnsRender,
z as useDataSource,
A as useHasOperationColumn,
y as useStructure
e as DataListContext,
r as DataListFilter,
i as DataListFooter,
o as DataListFramework,
D as DataListHelper,
l as DataListSider,
u as DataListTable,
L as DataListToolbar,
n as DataTableFramework,
d as default,
m as loadDataListFieldWidget,
F as useColumnsRender,
p as useDataSource,
C as useHasOperationColumn,
b as useStructure
};

5
dist/data-list/utils.js vendored Normal file
View File

@ -0,0 +1,5 @@
import "lodash";
import { a as t } from "../common/main-2s1hdQO8.js";
export {
t as getDefaultExpandRowKeys
};

View File

@ -1,9 +1,11 @@
import { I, K, J, H, M, L } from "./common/main-DHW9LhcM.js";
import { E as r, I as u, F as e, C as o, M as t, L as F, K as d, J as m } from "./common/main-2s1hdQO8.js";
export {
I as GridLayoutForm,
K as GridLayoutFormHelper,
J as GridLayoutFormWidget,
H as default,
M as getOptionItemByValue,
L as useFnRun
r as GridLayoutForm,
u as GridLayoutFormHelper,
e as GridLayoutFormWidget,
o as default,
t as useFnRun,
F as useFormData,
d as useRules,
m as useStructure
};

5
dist/grid-layout-form/utils.js vendored Normal file
View File

@ -0,0 +1,5 @@
import "lodash";
import { a7 as a } from "../common/main-2s1hdQO8.js";
export {
a as getOptionItemByValue
};

11
dist/grid-layout.js vendored
View File

@ -1,6 +1,9 @@
import { j, k, G } from "./common/main-DHW9LhcM.js";
import { b as d, c as e, H as u, G as i, u as t, d as o } from "./common/main-2s1hdQO8.js";
export {
j as GridLayout,
k as GridLayoutWidget,
G as default
d as GridLayout,
e as GridLayoutWidget,
u as HOOK_MARK,
i as default,
t as useField,
o as useGridLayoutFields
};

4
dist/grid-layout/utils.js vendored Normal file
View File

@ -0,0 +1,4 @@
import { g as t } from "../common/main-2s1hdQO8.js";
export {
t as getBoxStyle
};

15
dist/hooks.js vendored
View File

@ -1,12 +1,13 @@
import "lodash";
import "rc-field-form";
import "react";
import { c, d, a, b, e, u } from "./common/main-DHW9LhcM.js";
import { z as p, y as i, A as o, w as r, x as f, B as c, v as m } from "./common/main-2s1hdQO8.js";
export {
c as useDeepEqualEffect,
d as useOptions,
a as usePrevious,
b as useStateWithCallback,
e as useSubscribeRequest,
u as useUpdate
p as useDeepEffect,
i as useDeepEqualEffect,
o as useOptions,
r as usePrevious,
f as useStateWithCallback,
c as useSubscribeRequest,
m as useUpdate
};

8
dist/iconfont.js vendored Normal file
View File

@ -0,0 +1,8 @@
import "react/jsx-runtime";
import "react";
import "prop-types";
import "classnames";
import { N as a } from "./common/main-2s1hdQO8.js";
export {
a as default
};

25
dist/index.js vendored
View File

@ -1,17 +1,12 @@
import "lodash";
import "axios";
import "react";
import { Z, V, _, $, a1, Y, a0, W, X, a2 } from "./common/main-DHW9LhcM.js";
import "ff-request";
import { a5 as t, a6 as e, a1 as o, a2 as p, _ as n, a3 as c, a0 as r, $ as f, a4 as u } from "./common/main-2s1hdQO8.js";
export {
Z as AppGlobalParamsContext,
V as AppUrl,
_ as cache,
$ as configure,
a1 as core,
Y as default,
a0 as func,
W as http,
X as isReactComponent,
a2 as route
t as AppContext,
e as AppGlobalParamsContext,
o as cache,
p as configure,
n as default,
c as func,
r as http,
f as isReactComponent,
u as route
};

4
dist/res-ws.js vendored
View File

@ -1,5 +1,5 @@
import "lodash";
import { R } from "./common/main-DHW9LhcM.js";
import { R as a } from "./common/main-2s1hdQO8.js";
export {
R as default
a as default
};

8
dist/service.js vendored
View File

@ -1,8 +0,0 @@
import { a5, a4, a7, a3, a6 } from "./common/main-DHW9LhcM.js";
export {
a5 as getConfigure,
a4 as getMenus,
a7 as getPhoneNumber,
a3 as getRoutes,
a6 as getWidgetOperationAuth
};

2
dist/style.css vendored

File diff suppressed because one or more lines are too long

13
dist/user.js vendored
View File

@ -1,13 +0,0 @@
import "spark-md5";
import "react/jsx-runtime";
import "react";
import "@ant-design/icons";
import "classnames";
import { P, Q, O, T, U } from "./common/main-DHW9LhcM.js";
export {
P as checkUserToken,
Q as getUserInfo,
O as getUserToken,
T as login,
U as logout
};

5
dist/utils.js vendored
View File

@ -1,5 +0,0 @@
import "lodash";
import { i } from "./common/main-DHW9LhcM.js";
export {
i as getDefaultExpandRowKeys
};

View File

@ -1,60 +1,59 @@
{
"name": "ff",
"private": true,
"version": "0.2.2",
"version": "0.4.1",
"author": "www.fsdpf.com",
"type": "module",
"files": [
"dist/"
],
"main": "./dist/index.js",
"exports": {
".": "./dist/index.js",
"./hooks": "./dist/hooks.js",
"./utils": "./dist/utils.js",
"./res-ws": "./dist/res-ws.js",
"./service": "./dist/service.js",
"./user": "./dist/user.js",
"./button": "./dist/button.js",
"./components": "./dist/components.js",
"./container": "./dist/container.js",
"./data-list": "./dist/data-list.js",
"./grid-layout": "./dist/grid-layout.js",
"./grid-layout-form": "./dist/grid-layout-form.js",
"./style.css": "./dist/style.css"
"./*": "./dist/*"
},
"scripts": {
"start": "vite",
"dev": "vite build --mode development",
"build": "vite build",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"build": "vite build"
},
"dependencies": {
"nprogress": "^0.2.0"
"axios": "^1.7.2",
"ff-request": "git+https://git.fsdpf.net/npm/ff-request-dist.git",
"nprogress": "^0.2.0",
"spark-md5": "^3.0.2"
},
"peerDependencies": {
"antd": "^5.17.0",
"axios": "^1.5.0",
"classnames": "^2.5.1",
"ff-request": "git+https://git.fsdpf.net/npm/ff-request-dist.git",
"immutability-helper": "^3.1.1",
"lodash": "^4.17.21",
"rc-dialog": "^9.5.2",
"rc-drawer": "^7.2.0",
"rc-field-form": "^1.44.0",
"rc-notification": "^5.6.0",
"rc-util": "^5.41.0",
"react": "^18.2.0",
"spark-md5": "^3.0.2",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.3"
"react-router-dom": "6.21.2"
},
"devDependencies": {
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"classnames": "^2.5.1",
"less": "^4.2.0",
"mockjs": "^1.1.0",
"prop-types": "^15.8.1",
"rollup-plugin-copy": "^3.5.0",
"vite": "^5.2.0"
"rollup-plugin-terser": "^7.0.2",
"vite": "^5.2.0",
"vite-plugin-mock": "^3.0.2"
},
"build": {
"external": [
"react",
"react-dom",
"react-is",
"react/jsx-runtime",
"prop-types"
]
}
}