From 72f64f2094a5323fdd321fbaf9047780f529c5d5 Mon Sep 17 00:00:00 2001 From: what Date: Sun, 3 May 2026 22:09:21 +0800 Subject: [PATCH] v0.6.32 --- dist/button.js | 2 +- dist/common/main-D3Yt2diy.js | 1511 +++++++++++++++++ dist/common/main-DOuFUIVr.js | 1507 ---------------- ...{vender-BkiRbACr.js => vender-DTKG7Nf1.js} | 1208 ++++++------- dist/components.js | 2 +- dist/container.js | 2 +- dist/data-converter.js | 2 +- dist/data-list.js | 2 +- dist/data-list/utils.js | 2 +- dist/grid-layout-form.js | 2 +- dist/grid-layout-form/utils.js | 2 +- dist/grid-layout.js | 2 +- dist/grid-layout/utils.js | 2 +- dist/hooks.js | 2 +- dist/iconfont.js | 2 +- dist/index.js | 2 +- dist/pages.js | 2 +- dist/res-ws.js | 2 +- dist/utils.js | 4 +- dist/virtual-fs.js | 2 +- package.json | 2 +- 21 files changed, 2156 insertions(+), 2108 deletions(-) create mode 100644 dist/common/main-D3Yt2diy.js delete mode 100644 dist/common/main-DOuFUIVr.js rename dist/common/{vender-BkiRbACr.js => vender-DTKG7Nf1.js} (63%) diff --git a/dist/button.js b/dist/button.js index 0b96361..4aa3bcf 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { ak as s, aj as u, al as e } from "./common/main-DOuFUIVr.js"; +import { ak as s, aj as u, al as e } from "./common/main-D3Yt2diy.js"; export { s as auth, u as default, diff --git a/dist/common/main-D3Yt2diy.js b/dist/common/main-D3Yt2diy.js new file mode 100644 index 0000000..f25f814 --- /dev/null +++ b/dist/common/main-D3Yt2diy.js @@ -0,0 +1,1511 @@ +var bn = Object.defineProperty; +var hi = (t) => { + throw TypeError(t); +}; +var Cn = (t, e, i) => e in t ? bn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i; +var N = (t, e, i) => Cn(t, typeof e != "symbol" ? e + "" : e, i), gi = (t, e, i) => e.has(t) || hi("Cannot " + i); +var c = (t, e, i) => (gi(t, e, "read from private field"), i ? i.call(t) : e.get(t)), x = (t, e, i) => e.has(t) ? hi("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), B = (t, e, i, n) => (gi(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i); +var mi = (t, e, i, n) => ({ + set _(r) { + B(t, e, r, i); + }, + get _() { + return c(t, e, n); + } +}); +import { jsx as g, jsxs as A } from "react/jsx-runtime"; +import E, { useEffect as V, useState as L, useCallback as Y, useRef as H, useContext as pe, useMemo as _, useId as Mt, isValidElement as kn, useLayoutEffect as Sn } from "react"; +import ge from "pathe"; +import b from "prop-types"; +import O from "classnames"; +import * as fi from "react-is"; +import { useNotification as En } from "rc-notification"; +import m from "lodash"; +import re, { Field as Xt, FieldContext as Oi } from "rc-field-form"; +import { M as At, _ as $n, N as Ze, a as Me, s as Dt, b as vn, S as xn } from "./vender-DTKG7Nf1.js"; +import Ri from "immutability-helper"; +import { Space as Nn, Form as wt, Input as Pn, Button as Ct, Pagination as Tn, Tree as On, Breadcrumb as Rn, Empty as zt, Table as yi, Popover as Fn, Popconfirm as jn, Tooltip as An } from "antd"; +import Ln from "rc-util/lib/hooks/useMergedState"; +import { useMergedState as In } from "rc-util"; +import { generatePath as Vn, useInRouterContext as Fi, useParams as Mn, useLocation as Dn, createBrowserRouter as zn, Navigate as Wn } from "react-router-dom"; +import Bn from "rc-drawer"; +import Un from "rc-dialog"; +var Ke, tt, _e, Ee, De, ze; +class ji { + constructor(e, i) { + x(this, Ke, /* @__PURE__ */ new Map()); + x(this, tt, !0); + x(this, _e, []); + x(this, Ee); + x(this, De, () => c(this, Ee)); + x(this, ze, () => Promise.resolve()); + N(this, "get", (...e) => new Promise((i, n) => { + const r = JSON.stringify(e); + if (c(this, Ke).has(r)) return i(c(this, ze).call(this, c(this, Ee), ...e)); + if (c(this, Ee) === void 0) c(this, _e).push([e, i, n]), c(this, tt) && (B(this, tt, !1), Promise.resolve(typeof c(this, De) == "function" ? c(this, De).call(this) : c(this, De)).then((o) => B(this, Ee, o || null)).finally(() => { + c(this, _e).forEach(([o, a, s]) => { + try { + const l = c(this, ze).call(this, c(this, Ee), ...o); + c(this, Ke).set(JSON.stringify(o), l), a(l); + } catch (l) { + s(l); + } + }), c(this, _e).length = 0; + })); + else { + const o = c(this, ze).call(this, c(this, Ee), ...e); + c(this, Ke).set(r, o), i(o); + } + })); + B(this, ze, i), B(this, De, e); + } +} +Ke = new WeakMap(), tt = new WeakMap(), _e = new WeakMap(), Ee = new WeakMap(), De = new WeakMap(), ze = new WeakMap(); +const po = () => g("div", { children: "Empty" }), pt = E.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), ee = ({ rootClassName: t, className: e, children: i, actions: n, title: r, subTitle: o, extras: a, style: s = {} }) => { + const { mount: l, unmount: d } = E.useContext(pt); + return ee.Action({ children: n }), ee.Title({ children: r }), ee.SubTitle({ children: o }), ee.Extra({ children: a }), V(() => (l("rootClassName", t), () => d(t)), [t]), g("div", { className: O("ff-container", e), style: s, children: i }); +}, yt = (t) => ({ children: e, className: i }) => { + const { mount: n, unmount: r } = E.useContext(pt); + return V(() => (e && n(t, E.createElement("div", { key: `ff-${t}`, className: O(`ff-popup-${t}`, i) }, e)), () => r(t)), [i, e]), null; +}; +ee.Action = yt("actions"), ee.Title = yt("title"), ee.SubTitle = yt("sub-title"), ee.Extra = yt("extras"), ee.propTypes = { className: b.string, style: b.object, title: b.any, subTitle: b.any, actions: b.any, extras: b.any }; +const ho = () => g(ee, { className: "ff-loading", children: A("div", { className: "loader", children: [A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] }), A("div", { className: "square", children: [g("span", {}), g("span", {}), g("span", {})] })] }) }), go = () => g("div", { children: "NotFound" }), Ai = ({ children: t }) => { + const [e, i] = L({}), n = Y((o, a) => i((s) => ({ ...s, [o]: a })), []), r = Y((o) => i((a) => ({ ...a, [o]: void 0 })), []); + return typeof (t == null ? void 0 : t.type) == "string" ? t : g(pt.Provider, { value: { ele: e, mount: n, unmount: r }, children: E.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); +}; +Ai.propTypes = { children: b.element.isRequired }; +const wi = { 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"] }, Qt = ({ type: t, props: e }) => g("i", { ...e, children: g("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (wi[t] || wi.info).map((i, n) => g("path", { d: i }, n)) }) }), Li = ({ className: t, content: e, icon: i, $close: n }) => A(E.Fragment, { children: [i && g("div", { className: O("ff-notification-icon", t), children: g(Qt, { type: i }) }), e] }), qn = ({}) => g(ee, { children: "Confirm" }); +var Pe, He; +const me = class me { + constructor() { + x(this, He, /* @__PURE__ */ new Map()); + N(this, "init", (e) => B(this, He, new Map(e))); + N(this, "check", (e) => !c(this, He).has(e) || c(this, He).get(e)); + if (c(me, Pe)) return c(me, Pe); + } +}; +Pe = new WeakMap(), He = new WeakMap(), x(me, Pe, null), N(me, "getInstance", () => (c(me, Pe) || B(me, Pe, new me()), c(me, Pe))); +let Wt = me; +const Ii = Wt.getInstance(), Kn = (t, e, i = "children") => { + if (m.isEmpty(t)) return {}; + const n = m.find(t, ["value", e]); + if (!m.isEmpty(n)) return n; + const r = t.length; + for (let o = 0; o < r; o++) { + const { [i]: a } = t[o], s = Kn(a, e, i); + if (!m.isEmpty(s)) return s; + } + return {}; +}, Vi = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; +var Te, it; +const fe = class fe { + constructor() { + x(this, it, null); + N(this, "init", (e) => B(this, it, e)); + N(this, "get", (e, i) => m.get(c(this, it), e, i)); + if (c(fe, Te)) return c(fe, Te); + } +}; +Te = new WeakMap(), it = new WeakMap(), x(fe, Te, null), N(fe, "getInstance", () => (c(fe, Te) || B(fe, Te, new fe()), c(fe, Te))); +let Bt = fe; +const Ue = Bt.getInstance(), bi = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { + switch (`${t}`.toLowerCase()) { + case "0": + case "false": + case "[]": + case "{}": + return !1; + } + return !!t; +}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, de = (t, e) => { + let i = "string"; + i = Array.isArray(t) ? "array" : typeof t, m.isObject(t) && (i = "json"); + const n = `${i}2${e}`; + return Reflect.has(bi, n) ? bi[n](t) : t; +}, _n = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, ht = (t = {}, e = {}, i = {}, n = "") => Mi(t, (r, o) => o === "type" && r === "code") ? Di(t, e, i, n) : zi(t, e, n), Mi = (t, e = () => !1) => m.some(t, (i) => !!m.some(i, e) || (m.isEmpty(i) || !m.isPlainObject(i) && !m.isArray(i) ? void 0 : Mi(i, e))), Di = async (t = {}, e = {}, i = {}, n = "") => { + let r = /* @__PURE__ */ Object.create(null); + for (let o in t) { + let a; + if (Reflect.has(t[o], "type") && ["code", "field", "router", "query", "string"].includes(t[o].type)) { + const { type: s, value: l = "", default: d = n } = t[o]; + switch (s) { + case "code": + try { + a = await Ie.exec(l, e, i); + } catch (u) { + console.error("getWidgetPropsData", u); + } + break; + case "field": + a = m.get(e, l) ?? m.get(e, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + a = Ne.getPageParams(l); + break; + case "string": + a = l; + } + a ?? (a = d); + } else a = await Di(t[o], e, i, n); + m.set(r, o, a); + } + return r; +}, zi = (t = {}, e = {}, i = "") => Object.keys(t || {}).reduce((n, r) => { + if (m.isPlainObject(t[r])) { + let o; + if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) { + const { type: a, value: s = "", default: l = i } = t[r]; + switch (a) { + case "field": + o = m.get(e, s) ?? m.get(e, s.substring(s.indexOf(".") + 1)); + break; + case "router": + case "query": + o = Ne.getPageParams(s); + break; + case "string": + o = s; + } + o ?? (o = l); + } else o = zi(t[r], e, i); + m.set(n, r, o); + } + return n; +}, {}), Lt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((i) => Lt(i, e)) : Object.keys(t).reduce((i, n) => (e[n] ? i[e[n]] = Lt(t[n], e) : i[n] = Lt(t[n], e), i), {}) : t, mo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { + const e = 16 * Math.random() | 0; + return (t === "x" ? e : 3 & e | 8).toString(16); +}), fo = (t) => { + var e, i; + return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.name : ""; +}, yo = (t) => { + var e, i; + return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.category : ""; +}, wo = (t) => { + var e, i; + return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.owner : ""; +}, Hn = (t, e = 32, i = "auto") => { + const n = Ut(t), r = i === "auto" ? "x64" : i; + if (e === 32) return At.x86.hash32(n).toString(); + if (e === 128) return r === "x64" ? At.x64.hash128(n) : At.x86.hash128(n); + throw new Error("bits 只能是 32 或 128"); +}, Ut = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(Ut).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Ut(t[e])}`).join(",") + "}" : String(t), Jn = () => { + let t = 1; + const e = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Map(); + return (...n) => n.length === 0 ? "" : n.map((r) => { + return String((o = r) === null || typeof o != "object" && typeof o != "function" ? (i.has(o) || i.set(o, t++), i.get(o)) : (e.has(o) || e.set(o, t++), e.get(o))); + var o; + }).join("::"); +}, Gn = (t) => { + if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; + try { + let e = t.startsWith("//") ? `http:${t}` : t; + return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname; + } catch { + return !1; + } +}, bo = (t, e = "") => { + if (!t || typeof t != "string" || Gn(t)) return t; + let i = e; + return !i && typeof window < "u" && window.location && (i = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? i ? `${i}${t}` : t : i ? `${i}/${t}` : t; +}; +var Et, nt, rt, $t; +const vt = class vt { + constructor(...e) { + x(this, nt, []); + x(this, rt, (e) => { + var i; + for (let n of e) Array.isArray(n[0]) ? c(this, rt).call(this, n) : c(this, nt).push(c(i = vt, Et).call(i, n[0], n[1])); + }); + N(this, "toValue", async (e, i = null) => { + const n = { getValue: () => e, getRecord: () => i }; + let r = e; + for (const o of c(this, nt)) try { + const a = await o; + if (typeof a != "function") { + console.warn("middleware is not a function, skip:", a); + continue; + } + r = await a.call(n, r); + } catch (a) { + console.error("middleware error, skip:", a); + } + return r; + }); + N(this, "toRender", (e, i, n = null) => E.createElement(c(this, $t), { value: e, record: i }, n)); + x(this, $t, ({ value: e, record: i, children: n }) => { + const [r, o] = L(n); + return mt(() => { + let a = !1; + return o(n), this.toValue(e, i).then((s) => !a && o(s)).catch((s) => !a && o(`${s}`)), () => a = !0; + }, [e, i]), r; + }); + c(this, rt).call(this, e); + } +}; +Et = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), $t = new WeakMap(), x(vt, Et, m.memoize((e, i) => { + if (typeof e == "function") return e(i); + if (typeof e == "string") return ue.getWidgetComponent(e).then((n) => { + var r; + return ((r = n.default) == null ? void 0 : r.call(n, i)) || ((o) => o); + }); + throw new TypeError("middleware must be a string or a function"); +}, Jn())); +let kt = vt; +const ae = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { +}, getSelectedRows: () => [], onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +}, reload: () => { +}, setPage: () => { +}, setPageSize: () => { +}, setTab: () => { +}, setSider: () => { +}, setKeyword: () => { +}, setCondition: () => { +} }), Ci = ({ className: t, record: e, column: i, ...n }) => { + if (i != null && i.editableByJs && (i != null && i.uuid)) { + const { formSetting: r = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (i == null ? void 0 : i.editableByJsSetting) || {}; + return g(P.Popover, { widget: Yn, widgetData: { record: e, column: i }, widgetSetting: { widgetSetting: o, formSetting: r }, widgetContainerProps: { title: i != null && i.title ? `${i.title} - 编辑` : "编辑", ...a, width: (a == null ? void 0 : a.width) || 260, arrow: !0 }, children: g("td", { className: O("ff-data-list-cell-editable", t), ...n }) }); + } + return g("td", { className: t, ...n }); +}, Yn = ({ record: t, column: e, $close: i, $setting: n }) => { + const r = H(_n(m.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = pe(ae), [s] = re.useForm(), { formSetting: l, widgetSetting: d } = n, u = (l == null ? void 0 : l.primaryKey) || "id", p = () => { + s.setFieldsValue({ value: m.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); + }; + return mt(() => p(), [t, e == null ? void 0 : e.dataIndex, o]), g(ee, { actions: A(E.Fragment, { children: [g(P, { size: "small", onClick: p, children: "重置" }), A(Nn.Compact, { block: !0, children: [g(P, { size: "small", widget: i, children: "取消" }), g(P, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { + const h = m.get(t, u.substring(u.indexOf(".") + 1)); + if (!h) throw "获取更新主键失败!"; + I.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${h}`, { value: f }).msg(() => a(2, t)).then(i); + }).catch(console.warn), children: "保存" })] })] }), children: A(re, { form: s, children: [g(ti, { label: "", type: r.current, code: "value", widget: e == null ? void 0 : e.editableByJs, extras: d }), g(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => { + } })] }) }); +}, Xn = (t) => function(e) { + return t(e, getRecord()); +}, Qn = (t, e = {}) => _(() => { + var i; + return (i = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : i.map(({ widgetByJs: n, widgetByJsSetting: r, ...o }, a) => { + const s = (d) => ({ record: d, column: o }); + let l = []; + return n && l.push([n, r]), l.length > 0 ? (o != null && o.render && l.push([Xn, o.render]), { ...o, onCell: s, render: (d, u) => new kt(l).toRender(d, u, "-") }) : { ...o, onCell: s }; + }); +}, [t, e]), Zn = (t = {}) => _(() => { + var e; + return t.body ?? (t.body = { cell: Ci }), (e = t.body).cell ?? (e.cell = Ci), t; +}, [t]), Co = (t) => { + const [e, i] = L({}); + return V(() => { + let n = !1; + return t && I.get(`/api/_/${t}`).then((r) => m.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((r) => !n && i(r)), () => n = !0; + }, [t]), e; +}, ko = (t, e = {}) => { + const [i, n] = L({ dataSource: [] }); + return gt(() => { + let r = !1; + return t && I.get(`/api/${t}/${I.encode({ page: 1, ...e })}`).then((o) => !r && n(o)), () => r = !0; + }, [t, e]), i; +}, Wi = (t = [], e = /* @__PURE__ */ new Map(), i = "id", n) => { + const r = Y(n ? (o) => m.get(o, i, m.get(o, [n, i])) : (o) => m.get(o, i), [i, n]); + return Y((o) => t == null ? void 0 : t.filter((a) => !a.uuid || !e.has(a.uuid) || e.get(a.uuid).some((s) => s == r(o))), [t, e, r]); +}, qt = (t = [], e = /* @__PURE__ */ new Map(), i = [], n = "id", r) => { + const o = Y(r ? (a) => m.get(a, n, m.get(a, [r, n])) : (a) => m.get(a, n), [n, r]); + return _(() => { + if (m.isEmpty(t) || !t.some(({ uuid: s }) => Ii.check(s))) return !1; + if (m.isEmpty(e) || m.isEmpty(i)) return !0; + const a = i.map((s) => o(s)); + return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((d) => d == l))); + }, [t, i, e, o]); +}, er = (t, e, i = "id", n = null) => { + const r = Tt(), o = H(!1), a = H(t.dataSource), s = H(t.itemOperationsAccess); + return V(() => (a.current = t.dataSource, s.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = a.current, t.itemOperationsAccess = s.current), [t, (l = 0, d = null) => { + var u, p; + if (o.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); + if (l === 2) { + const f = m.get(d, "__PARENT_ID__", ""), h = m.get(d, i, m.get(d, [n, i], "")), y = m.findIndex(a.current, ["__PARENT_ID__", f]), w = m.findIndex(y > -1 ? m.get(a.current, [y, "children"]) : a.current, [i, h]); + if (w === -1) return (p = t.onReload) == null ? void 0 : p.call(t); + Promise.all([I.get(`/api/${e}/detail/${h}`), I.post(`/api/${e}/list-operations-access`, { ids: h })]).then(([C, S]) => { + const v = m.get(a.current, y > -1 ? [y, "children", w, "children"] : [w, "children"]); + a.current = Ri(a.current, y > -1 ? { [y]: { children: { $splice: [[w, 1, { ...C, children: v }]] } } } : { $splice: [[w, 1, { ...C, children: v }]] }); + const k = new Map(S); + s.current.forEach(($, T) => { + var j; + (j = k.get(T)) != null && j.some((F) => F == h) || s.current.set(T, $.filter((F) => F !== h)); + }), k.forEach(($, T) => { + s.current.has(T) ? s.current.set(T, m.uniq([...s.current.get(T) || [], ...$])) : s.current.set(T, $); + }); + }).then(() => { + o.current = !0, r(); + }); + } + }]; +}, tr = (t, e) => { + const i = Tt(), n = H(e), r = H(/* @__PURE__ */ new Map()), o = H([]), a = m.throttle((l) => { + o.current = [], I.list(t, m.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: u, total: p, tab: f, sider: h, page: y, pageSize: w, operationsAccess: C, dataSource: S }) => { + n.current = { tab: f, condition: u, sider: h, keyword: d, total: p, pageSize: w, page: S != null && S.length ? y : 1 }, o.current = S, r.current = new Map(C), i(); + }); + }, 380, { leading: !1, trailing: !0 }); + mt(() => { + o.current = [], t && a(e); + }, [t, e]); + const s = _(() => m.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); + return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, d) => a({ page: l, pageSize: d }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, d) => a({ keyword: d, condition: Ri(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => a({ sider: l, page: 1 }), onKeywordChange: (l) => a({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: o.current, onReload: a, payload: e == null ? void 0 : e.payload }); +}, ir = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: f, itemGridLayout: h, $setting: y, tabs: w, isConditionFormLayout: C, isTreeSider: S, treeSiderConfig: v }) => { + const { classNames: k, onClickCallback: $ } = pe(ae), T = m.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style"]), j = Wi(l, d, p, u), F = Y((M, D, R) => g(nr, { className: O("ff-data-list-framework-item", k == null ? void 0 : k.item), operations: o ? j(D) : [], data: u ? { [u]: D } : D, children: M, onClickCallback: $ }), [u, p, o, $, l, d]); + return A("div", { className: O("ff-data-list-framework", e), children: [g(i.sider, { isTreeSider: S, ...v }), A("div", { className: O("ff-data-list-container", k == null ? void 0 : k.container), children: [g(i.filter, { isConditionFormLayout: C }), g(i.toolbar, { title: f, tabs: w }), g(yr, { ...T, ...h, empty: g(i.empty, { className: k == null ? void 0 : k.empty }), primaryKey: p, itemRender: F, dataSource: n }), g(i.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); +}, nr = ({ className: t, operations: e, children: i, data: n, onClickCallback: r }) => A("div", { className: O("data-list-grid-layout-item", t), children: [g("div", { className: "data-list-grid-layout-item-container", children: i }), !!(e != null && e.length) && g("div", { className: "data-list-grid-layout-item-actions", children: e.map((o) => g("span", { className: "data-list-grid-layout-item-action", children: g(P.Link, { uuid: o.uuid, type: o.type, name: o.name, widget: o.widget, widgetType: o.widgetType, widgetProps: o.widgetProps, widgetSetting: o.widgetSetting, widgetContainerProps: o.widgetContainerSetting, data: n, confirm: o.confirm, onAfterClick: (a) => a !== !1 && (r == null ? void 0 : r(o.isRefresh, n)) }, o.uuid || Mt()) }, (o == null ? void 0 : o.uuid) || Mt())) })] }), rr = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: f, tabs: h, isPaginate: y, rowSelection: w, isTreeSider: C, treeSiderConfig: S, isConditionFormLayout: v, ...k }) => { + const { classNames: $, onClickCallback: T } = pe(ae), j = Wi(l, d, p, u), F = qt(l, d, n, p, u); + return A("div", { className: O("ff-data-table-framework", e), children: [g(i.sider, { isTreeSider: C, ...S }), A("div", { className: O("ff-data-table-container", $ == null ? void 0 : $.container), children: [g(i.filter, { isConditionFormLayout: v }), g(i.toolbar, { title: f, tabs: h }), g(ur, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: n, rowSelection: w, operationRender: F ? (M) => { + var D; + return g("div", { className: "ff-data-table-actions", children: (D = j(M)) == null ? void 0 : D.map((R, W) => g(P.Link, { size: "small", uuid: R.uuid, type: R.type, name: R.name, widget: R.widget, widgetType: R.widgetType, widgetProps: R.widgetProps, widgetData: R.widgetData, widgetSetting: R.widgetSetting, widgetContainerProps: R.widgetContainerSetting, data: M, confirm: R.confirm, onAfterClick: (U) => U !== !1 && (T == null ? void 0 : T(R.isRefresh, M)) }, R.uuid || W)) }); + } : null }), g(i.footer, { isPaginate: y, isOperations: a, operations: s })] })] }); +}, Zt = (t = [], e, i = null) => { + var n; + return (n = m.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: o, y: a, w: s, h: l, field: { boxStyle: d, ...u } = {} }, p) => g("div", { className: "grid-layout-item", style: Bi(o, a, s, l, d), children: g(e, { ...u, basicForm: i }) }, r ?? p)); +}, Bi = (t, e, i, n, r = {}, o = 0) => { + const a = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${i}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; + return r != null && r.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (a["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (a["--grid-layout-box-justify-content"] = r.justifyContent), a["--grid-layout-box-margin"] = ki(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), a["--grid-layout-box-padding"] = ki(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), o && (a.height = `${o}px`), a; +}, ki = (t, e, i, n) => `${t || 0}px ${e || 0}px ${i || 0}px ${n || 0}px`, So = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Ui = (t) => Object.keys(t).reduce((e, i) => (/^on[A-Z]/.test(i) && (e[i] = t[i]), e), {}), qi = ({ className: t, isConditionFormLayout: e }) => { + var f, h; + const [i, n] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = E.useContext(ae), { keyword: d, condition: u } = (s == null ? void 0 : s()) || {}, [p] = wt.useForm(); + return V(() => { + r && e && I.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: y, marginX: w, marginY: C, rowHeight: S, cols: v, fields: k }) => { + n({ resource: y, itemMargin: [w, C], rowHeight: S, cols: v, fields: k }); + }).catch(() => n({})); + }, [r, e]), V(() => { + p.setFieldsValue({ keyword: d, ...u }); + }, [JSON.stringify([d, u])]), g("div", { className: O("ff-data-list-filter", l.filter, t), children: g(wt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((f = i.fields) == null ? void 0 : f.length) > 1 ? (y) => a({ [i.resource]: y[i.resource] }, y.keyword) : () => { + }, onValuesChange: (y) => { + m.isEmpty(m.omit(y, ["keyword"])) || p.submit(); + }, children: ((h = i.fields) == null ? void 0 : h.length) > 1 ? g(ii, { ...i, children: g(or, { onReset: () => { + const { keyword: y, condition: w } = s("init") || {}; + p.setFieldsValue({ keyword: y, ...w }); + } }) }) : g("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: g("div", { className: "grid-layout-item", style: Bi(20, 0, 5, 2), children: g(wt.Item, { name: ["keyword"], children: g(Pn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => o(y) }) }) }) }) }) }); +}, or = ({ cols: t, fields: e, onReset: i }) => { + const [n, r] = L(!1), o = _(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]); + return A(wt.Item, { label: " ", style: { "--item-span": 5 }, className: O("ff-data-list-filter-actions", { expanded: n }), children: [g(Ct, { onClick: i, children: "重置" }), g(Ct, { type: "primary", htmlType: "submit", children: "查询" }), o && g(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((a) => !a), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +qi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; +const ar = ({ className: t, operations: e, isOperations: i, isPaginate: n }) => { + const { onPageChange: r, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = E.useContext(ae), { total: l, page: d, pageSize: u } = (s == null ? void 0 : s()) || {}; + return i && !m.isEmpty(e) || n ? A("div", { className: O("ff-data-list-footer", t), children: [g("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, f) => g(P, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (h) => h !== !1 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || f)) }), n && g(Tn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${d} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: o })] }) : null; +}, sr = [{ 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: g("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], lr = ({ className: t, width: e = 280, isTreeSider: i }) => { + const { classNames: n } = pe(ae); + return i ? g(On.DirectoryTree, { className: O("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: sr }) : null; +}, cr = ({ className: t, title: e, tabs: i }) => { + const { getBase62params: n, onTabChange: r, onReload: o, classNames: a } = pe(ae), { tab: s } = (n == null ? void 0 : n()) || {}, [l, d] = In((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); + return A("div", { className: O("ff-data-list-toolbar", a.toolbar, t), children: [g("div", { className: "ff-data-list-title", children: e }), g(Rn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: f }) => g("span", { onClick: () => d(f ?? p), className: O("ff-data-list-tab", { active: (f ?? p) == l }), children: u }), items: i }), A("div", { className: "ff-data-list-actions", children: [g(P.Link, { icon: "icon-reload", widget: () => o() }), g(P.Link, { icon: "icon-setting" })] })] }); +}, dr = ({ className: t, ...e }) => g(zt, { className: O(t, "ff-data-list-empty"), image: zt.PRESENTED_IMAGE_SIMPLE, ...e }), Ki = ({ isItemGridLayout: t, theme: e, themeProps: i, onClickCallback: n, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: u, tab: p, onTabChange: f, keyword: h, onKeywordChange: y, condition: w, onConditionChange: C, sider: S, onSiderChange: v, layouts: k, classNames: $ = {}, payload: T = {}, dataSource: j = [], rowSelection: F, getSelectedRows: M, primaryKey: D, ...R }) => { + const [W, U] = L(), q = M ?? (() => j), he = Y((z, se) => { + const J = { tab: p, page: s, pageSize: d, keyword: h, sider: S, condition: w, total: a, payload: T }; + return z && z != "init" ? m.get(J, z, se) : J; + }, [JSON.stringify(w), JSON.stringify(T), p, s, d, h, S, a]), oe = _(() => { + let z = { sider: lr, filter: qi, footer: ar, toolbar: cr, empty: dr }; + k === !1 ? z = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : m.isPlainObject(k) && (z = Object.assign({}, z, k)); + for (const se in z) if (z[se]) { + if (kn(z[se])) { + const J = z[se]; + z[se] = (Rt) => E.cloneElement(J, Rt); + } + } else z[se] = () => g(E.Fragment, {}); + return z; + }, [k]); + return V(() => { + e ? ue.getWidgetComponent(e).then((z) => { + if (!z) throw `${e} not found`; + return z; + }).catch((z) => ({ default: () => `${z}` })).then((z) => U(E.createElement(z.default, { ...R, layouts: oe, $setting: i }))) : U(g(t ? ir : rr, { ...R, layouts: oe, $setting: i })); + }, [e, i]), g(ae.Provider, { value: { classNames: $, listCode: o, onClickCallback: n, onReload: r, getBase62params: he, onPageChange: l, onPageSizeChange: u, onTabChange: f, onSiderChange: v, onKeywordChange: y, onConditionChange: C, setPage: l, setPageSize: u, setTab: f, setSider: v, setKeyword: y, setCondition: C, getSelectedRows: q }, children: W && E.cloneElement(W, { dataSource: j, primaryKey: D, rowSelection: F, ...R }) }); +}; +Ki.propTypes = { classNames: b.exact({ sider: b.string, filter: b.string, footer: b.string, toolbar: b.string, container: b.string, content: b.string, item: b.string, empty: b.string }), layouts: b.oneOfType([b.exact({ sider: b.oneOfType([b.elementType, b.element]), filter: b.oneOfType([b.elementType, b.element]), footer: b.oneOfType([b.elementType, b.element]), toolbar: b.oneOfType([b.elementType, b.element]), empty: b.oneOfType([b.elementType, b.element]) }), b.bool]) }; +var Oe, $e, We, xt; +const ye = class ye { + constructor() { + x(this, $e, null); + x(this, We, /* @__PURE__ */ new Map()); + x(this, xt, () => { + if (c(this, $e)) return c(this, $e).port.postMessage({ command: "status", data: [] }); + B(this, $e, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), c(this, $e).port.onmessage = (e) => { + var i, n; + (i = e.data) != null && i.uuid ? c(this, We).forEach((r, o) => { + var a; + (r == "*" || (a = r == null ? void 0 : r.includes) != null && a.call(r, e.data.uuid)) && o(e.data); + }) : ((n = e.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { + c(this, $e).port.postMessage({ command: "initWs", data: [`ws${m.trimStart(I.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); + }); + }, c(this, $e).port.postMessage({ command: "status", data: [] }); + }); + N(this, "subscribe", (e, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", c(this, We).set(e, i), c(this, We).size == 1 && c(this, xt).call(this), () => this.unsubscribe(e))); + N(this, "unsubscribe", (e) => c(this, We).delete(e)); + if (c(ye, Oe)) return c(ye, Oe); + } +}; +Oe = new WeakMap(), $e = new WeakMap(), We = new WeakMap(), xt = new WeakMap(), x(ye, Oe, null), N(ye, "getInstance", () => (c(ye, Oe) || B(ye, Oe, new ye()), c(ye, Oe))); +let Kt = ye; +const _i = Kt.getInstance(), ei = E.forwardRef(({ listCode: t, base62params: e, className: i, theme: n, themeProps: r, layouts: o, classNames: a, onSelectionChange: s, defaultSelectedRowKeys: l, selectedRowKeys: d, onDataSourceChange: u }, p) => { + const [{ resource: f, primaryKey: h, batchOperations: y = [], itemOperations: w = [], columns: C = [], themeConfig: S, theme: v, isConditionFormLayout: k = !1, isTreeSider: $, treeSiderConfig: T, isItemGridLayout: j, itemGridLayout: { themeConfig: F, ...M } = {}, title: D, isPaginate: R, tabs: W, selectionType: U }, q] = L({ isItemGridLayout: !1, itemGridLayout: {} }), he = tr(t, e), [{ dataSource: oe, itemOperationsAccess: z, condition: se, tab: J, keyword: Rt, page: ai, total: si, pageSize: li, sider: rn, onConditionChange: on, onTabChange: an, onKeywordChange: sn, onPageChange: ln, onPageSizeChange: cn, onSiderChange: dn, onReload: Ft, payload: un }, ci] = er(he, t, h, f), pn = $n(u); + V(() => { + pn(oe, { page: ai, pageSize: li, total: si }); + }, [oe]); + const [hn, gn] = Ln([], { defaultValue: l ?? [], value: d }), [di, mn] = L([]), ui = Y(() => U ? di : oe, [U, di, oe]), fn = qt(w, z, oe, h), yn = qt(y); + V(() => { + let X = null; + return t && I.get(`/api/_/${t}`).resp(({ data: Ve, res: jt }) => { + Ve != null && Ve.isDynamicRefresh && (X = _i.subscribe(() => Ft(), jt)), q(Ve); + }).catch(() => q({})), () => X == null ? void 0 : X(); + }, [t]), E.useImperativeHandle(p, () => ({ onReload: Ft, onClickCallback: ci, getSelectedRows: ui })); + const wn = { listCode: t, title: D, classNames: a, layouts: o, resource: f, primaryKey: h, theme: n || v, themeProps: r || S, isTreeSider: $, treeSiderConfig: T, isPaginate: R, rowSelection: U ? { type: U, columnWidth: 80, selectedRowKeys: hn, onChange: (X, Ve) => { + mn((jt) => { + const pi = new Map(jt.map((le) => [le == null ? void 0 : le[h], le])); + return Ve.forEach((le) => pi.set(le == null ? void 0 : le[h], le)), X.map((le) => pi.get(le)).filter(Boolean); + }), gn(X), s == null || s(X, Ve); + } } : void 0, getSelectedRows: ui, tabs: W, isItemOperations: fn, itemOperations: w == null ? void 0 : w.map((X) => m.isEmpty(X == null ? void 0 : X.confirm) ? X : { ...X, confirm: Object.assign({}, X.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: yn, batchOperations: y, isItemGridLayout: j, columns: C, itemGridLayout: { ...M, themeProps: F }, isConditionFormLayout: k, itemOperationsAccess: z, dataSource: oe, onConditionChange: on, onTabChange: an, onKeywordChange: sn, onPageChange: ln, onPageSizeChange: cn, onSiderChange: dn, condition: se, tab: J, keyword: Rt, page: ai, total: si, pageSize: li, sider: rn, payload: un }; + return g(Ki, { ...wn, className: O("ff-data-list-helper", i), onReload: Ft, onClickCallback: ci }); +}), Hi = (t, e, i = !0) => i !== !0 && i-- <= 0 ? [] : m.isArray(t) && !m.isEmpty(t) ? t.reduce((n, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && n.push(r[e]), Reflect.has(r, "children") && !m.isEmpty(r.children) ? n.concat(Hi(r.children, e, i)) : n), []) : [], ur = ({ className: t, primaryKey: e, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { + const { classNames: d } = pe(ae), u = H(null), p = H(null), [f, h] = L([]), [y, w] = L({ width: 0, height: 0 }); + V(() => { + h(Hi(n, e)); + }, [n, e]), Sn(() => { + const k = new ResizeObserver(() => { + var $; + w({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); + }); + return p.current && k.observe(p.current), () => { + p.current && k.unobserve(p.current); + }; + }, []); + const C = _(() => { + if (!(y != null && y.width) || !(i != null && i.length)) return i; + const k = (s ? s.columnWidth ?? 32 : 0) + (r ? o : 0), $ = i.reduce((F, M) => F + (M.isWidthFixed && M.width ? M.width : 0), 0), T = i.filter((F) => !F.isWidthFixed).reduce((F, M) => F + (M.width ?? 100), 0); + if ($ + T + k >= y.width) return i; + const j = y.width - $ - k; + return i.map((F) => F.isWidthFixed ? F : { ...F, width: Math.floor(j * (F.width ?? 100) / T) }); + }, [i, y.width, s, r, o]), S = Qn(C), v = Zn(a); + return g("div", { ref: p, className: O("ff-data-list-table", d.content, t), children: y.height ? g(yi, { bordered: !0, ...l, components: v, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { + var $, T; + const k = [...S ?? []]; + return s && k.splice((T = ($ = k[0]) == null ? void 0 : $.key) != null && T.startsWith("__") ? 1 : 0, 0, yi.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(o / y.width * 100).toFixed(2)}%`, render: (j, F, M) => r(F, M) }), k; + })(), dataSource: n, size: "middle", scroll: { x: "max-content", y: y.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: h, expandedRowKeys: f } }) : null }); +}, pr = "RC_FORM_INTERNAL_HOOKS", hr = (t) => { + const [e, i] = E.useState({ items: [] }); + return V(() => { + t && I.get(`/api/_/${t}`).then(({ uuid: n, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, fields: f, theme: h, themeSetting: y, groups: w }) => ({ uuid: n, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, theme: h, themeProps: y, groups: w, items: f })).then(i); + }, [t]), e; +}, gr = (t, { initialValue: e, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: o = "string" }, a = null) => { + const s = H(!1), l = pe(Oi), [d, u] = L(), [p, f] = L(i != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: h } = l.getInternalHooks(pr) || {}; + return V(() => h == null ? void 0 : h((y, w, C) => { + if (!s.current) return; + const S = m.get(w, t); + m.isEqual(S, p) || f(de(S, o)); + }), [p]), V(() => { + i == "javascript" && e ? Ie.exec(e, {}, { getFieldValueForBasicForm: (y) => a ? a.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => f(de(y, o))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && f(de(e ?? l.getFieldValue(t), o)), s.current = !0); + }, [e, i]), gt(() => { + s.current && n && new kt([n, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((y) => { + u(y), console.error("布局数据转换错误: ", y, n); + }); + }, [p, n, r]), [d ?? p, p]; +}, Eo = (t, e, i = null) => _(() => Zt(t, e, i), [t]), Ji = (t, e, i = {}, n = {}, r = {}, o = null) => { + const a = pe(Oi), s = Tt(), l = H(!0), d = H([]), [u, p] = L(e), [f, h] = L(), y = re.useWatch((w) => JSON.stringify(m.pick(w, d.current)), a) || "{}"; + return mt(() => { + t && Ie.exec(t, i, { ...n, getFieldValueForBasicForm: (w) => r ? r.getFieldValue(w) : null, getFieldValue: m.wrap(a.getFieldValue, (w, C) => (d.current.some((S) => m.isEqual(S, C)) || (d.current.push(C), s()), w == null ? void 0 : w(C))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((w) => { + l.current && (p(w), h(null)); + }).catch((w) => { + l.current && (p(e), h(w)); + }); + }, [t, y, a, i, n]), V(() => () => l.current = !1, []), t ? [o ? de(u, o) : u, f] : [o ? de(e, o) : e, null]; +}, mr = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => { + const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = L(); + return V(() => { + r && ue.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: fr(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(E.createElement(s.default, n))); + }, [r]), o; +}, fr = (t, e = {}, i = null) => (n) => { + const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, value: f, ...h } = m.merge({}, e, n), [y, w] = gr(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, type: (h == null ? void 0 : h.type) || "string" }, i), C = _(() => { + const k = Object.keys((e == null ? void 0 : e.extras) || {}); + return m.over([m.partialRight(m.pick, k), m.partialRight(m.omit, k)]); + }, [e == null ? void 0 : e.extras]), [S, v] = C(h); + return g(t, { ...v, value: y, rawValue: w, $setting: Object.assign({}, a, S) }); +}, Gi = ({ theme: t, basicForm: e, items: i = [{ key: "default", label: "默认" }], fields: n = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => { + const [d, u] = L(); + V(() => { + t ? ue.getWidgetComponent(t).then((f) => { + if (!(f != null && f.default)) throw "not found"; + return f; + }).catch((f) => ({ default: () => `${t} ${f}` })).then((f) => u(E.createElement(f.default, {}))) : u(null); + }, [t]); + const p = _(() => i == null ? void 0 : i.map((f) => ({ ...f, children: r(f, n == null ? void 0 : n.filter((h) => !(h != null && h.group) && f.key == "default" || h.group == f.key), f.key == "default" ? a : null) })).concat(o), [i, a, o]); + return d && E.cloneElement(d, { items: p, basicForm: e, $setting: { ...s, ...l } }); +}, Yi = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: d = {}, formFields: u = [], fields: p = [], data: f, theme: h, themeProps: y = {}, groups: w = [{ key: "default", label: "默认" }], children: C, ...S }) => { + const [v] = re.useForm(e), k = _(() => [{ name: "__PROPS__", value: d }].concat(u), [d, u]); + gt(() => (v.setFieldsValue(f), () => v.resetFields()), [f]); + const $ = (T, j, F) => { + const M = Zt(j, mr, i), D = Ui(S); + return A("div", { ...D, className: O("ff-grid-layout", r), style: { ...n, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [M, F && E.cloneElement(F, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: j, basicForm: i })] }); + }; + return g(re, { ...S, fields: k, form: v, component: !1, children: h ? g(Gi, { ...y, items: w, theme: h, itemRender: $, fields: p, children: C, basicForm: i }) : $(0, p, C) }); +}, $o = /* @__PURE__ */ ((t) => function({ code: e, data: i, ...n }) { + const { uuid: r, resource: o, items: a, hides: s, rowHeight: l, marginX: d, marginY: u, cols: p, theme: f, themeProps: h, groups: y } = hr(e) || {}, w = _(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, o]); + return o && g(t, { name: e, theme: f, themeProps: h, groups: y, ...n, fields: a, formFields: w, rowHeight: l, cols: p, itemMargin: [d, u], data: o ? { [o]: i } : i }); +})(Yi), yr = ({ column: t = 0, colWidth: e = 0, cols: i, rowHeight: n, itemMargin: r, fields: o, primaryKey: a, dataSource: s, beforeRender: l = null, afterRender: d = null, itemClassName: u, itemRender: p = (v, k, $) => v, empty: f = g(zt, { description: null }), className: h, style: y = {}, theme: w, themeProps: C = {}, groups: S = [{ key: "default", label: "默认" }] }) => { + const { classNames: v } = pe(ae), k = _(() => g(Yi, { groups: S, theme: w, themeProps: C, cols: i, rowHeight: n, itemMargin: r, fields: o, className: u }), [o, i, n, r, S, w, C]), $ = m.isEmpty(s); + return A("div", { className: O("ff-data-list-content", v.content, h), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [l == null ? void 0 : l(s), $ ? f : s.map((T, j) => { + const F = p(E.cloneElement(k, { data: T }), T, j); + return E.cloneElement(F, { key: `${(T == null ? void 0 : T[a]) ?? j}-${Hn(T)}` }); + }), d == null ? void 0 : d(s)] }); +}, wr = ({ component: t, $props: e }) => { + const { base62params: i } = ht(e, {}); + return g(ee, { children: g(ei, { listCode: t, base62params: I.decode(i) }) }); +}, vo = () => g(Xi, {}), Xi = () => "Empty", br = ({ component: t, $setting: e, $props: i }) => { + const [n, r] = L(); + V(() => { + if (!t) return r(g(Xi, { description: null })); + ue.getWidgetComponent(t).catch((a) => ({ default: () => `${a}` })).then((a) => E.createElement(a.default, { $setting: e })).then(r); + }, [t]); + const o = ht(i, {}); + return n ? E.cloneElement(n, o) : null; +}, xo = () => "NotFoundPage"; +var Re, ce, Fe, je, ot, at; +const we = class we { + constructor() { + x(this, ce, /* @__PURE__ */ new Map()); + x(this, Fe, {}); + x(this, je, null); + N(this, "init", (e, i) => { + B(this, ce, e), B(this, Fe, i); + }); + N(this, "get", (e) => (c(this, ce).has(e) || (e = Array.from(c(this, ce).keys()).find((i) => c(this, ce).get(i).uri === e)), c(this, ce).get(e) || {})); + N(this, "redirect", (e, i, n = {}) => { + const { uri: r, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...d } = i || {}, u = Object.assign({}, d, s), p = Object.assign({}, d, l); + o == "list" && (u.base62params = I.encode(u != null && u.base62params ? u.base62params : u)); + let f = Vn(r || e, u); + const h = new URLSearchParams(); + for (const y in a || {}) (a == null ? void 0 : a.type) == "query" && Object.has(p, y) && h.append(y, JSON.stringify(p[y])); + return h.size > 0 && (f = `${f}?${h.toString()}`), n != null && n.isOpenWindow ? window.open(f) : c(this, je).navigate(f, { replace: !!(n != null && n.isReplaceRouteHistory) }); + }); + N(this, "getMenus", (e) => { + var i; + return ((i = c(this, Fe)) == null ? void 0 : i[e]) || []; + }); + N(this, "findMenuPathByUuid", (e) => { + let i = []; + for (const n in c(this, Fe)) if (i = c(this, ot).call(this, c(this, Fe)[n], e, [n]), i.length > 1) return i; + return i; + }); + N(this, "getMenusByRouteUuid", (e) => c(this, at).call(this, e, Object.values(c(this, Fe)).flat())); + x(this, ot, (e, i, n = []) => { + if (m.isEmpty(e)) return n; + for (const { uuid: r, children: o } of e) { + if (r == i) return n.concat(r); + if (!m.isEmpty(o)) return n.concat(r, c(this, ot).call(this, o, i)); + } + return n; + }); + x(this, at, (e, i) => { + var r; + let n = []; + for (const o of i) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? n.push(o) : (r = o.children) != null && r.length && (n = n.concat(c(this, at).call(this, e, o.children)))); + return n; + }); + N(this, "getCurrentMenu", () => { + const { uuid: e } = this.getCurrentRoute() || {}; + if (!e) return; + const i = this.getMenusByRouteUuid(e); + return m.isEmpty(i) ? void 0 : i[0]; + }); + N(this, "getCurrentRoute", (e = 0) => { + var n; + const i = (n = c(this, je).state.matches[c(this, je).state.matches.length - 1 - e]) == null ? void 0 : n.route; + if (!i) return null; + for (let [r, o] of c(this, ce)) if (o.uri === i.path) return o; + return null; + }); + N(this, "getPageParams", (e) => { + var r, o, a; + let i = "", n = {}; + if (Fi()) n = Mn(), i = (r = Dn()) == null ? void 0 : r.search; + else { + const { location: s = {}, matches: l = [] } = ((o = c(this, je)) == null ? void 0 : o.state) || {}; + n = ((a = l[l.length - 1]) == null ? void 0 : a.params) || {}, i = s.search; + } + return i && new URLSearchParams(i).forEach((s, l) => { + n[l] = s; + }), e ? m.get(n, e) : n; + }); + N(this, "createBrowserRouter", (e = {}) => { + if (c(this, ce).size == 0) return null; + const i = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ue.get(ue.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, o = (s, l) => () => Promise.all([ue.getWidgetComponent(s), ht(l)]).then(([d, u]) => [d.default || function() { + return `${s}`; + }, u]).then(([d, u]) => ({ Component: () => E.createElement(Ai, {}, E.createElement(d, { $setting: u })) })), a = Array.from(c(this, ce).values()).reduce((s, { uuid: l, uri: d, name: u, type: p, component: f, widgetSetting: h, widgetProps: y, isLogin: w, isLayout: C, extra: S }) => { + let v = {}, k = 0; + switch (p) { + case "list": + v.element = E.createElement(wr, { component: f, $props: y }); + break; + case "fsdpf-component": + v.element = E.createElement(br, { key: f, component: f, $setting: h, $props: y }); + } + const $ = (S == null ? void 0 : S.theme) ?? (S == null ? void 0 : S.layout); + if ($) { + const T = (S == null ? void 0 : S.themeProps) ?? (S == null ? void 0 : S.layoutProps); + if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: o($, T), children: [{ path: d, ...v }] }]; + k = r[$]; + } + return C && k > -1 ? (s[k].children.push({ path: d, ...v }), s) : [...s, { path: d, ...v }]; + }, [{ path: "/", lazy: o(i, {}), children: [] }]); + return a.push({ index: !0, element: E.createElement(Cr, { to: n, replace: !0 }) }), B(this, je, zn(a, e)); + }); + if (c(we, Re)) return c(we, Re); + } +}; +Re = new WeakMap(), ce = new WeakMap(), Fe = new WeakMap(), je = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), x(we, Re, null), N(we, "getInstance", () => (c(we, Re) || B(we, Re, new we()), c(we, Re))); +let _t = we; +const Cr = ({ to: t, replace: e }) => Fi() ? E.createElement(Wn, { to: t, replace: e }) : (window.document.location = t, "redirect"), Ne = _t.getInstance(), qe = new Worker(new URL("/ff-worker/index.js", self.location)), Si = { getConfigure: (t) => Ue.get(t), route: { redirect: (...t) => Ne.redirect(...t), getPageParams: (...t) => Ne.getPageParams(...t), getCurrentRoute: () => Ne.getCurrentRoute() }, popup: { notification: (...t) => ne.notification(...t), success: (...t) => ne.success(...t), error: (...t) => ne.error(...t), form: (...t) => ne.form(...t), modal: (...t) => ne.modal(...t), confirm: (...t) => ne.confirm(...t) } }; +var Nt, Je, Ae; +const K = class K { + constructor() { + N(this, "exec", (e, i = {}, n = {}, r = "") => new Promise((o, a) => { + if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return o(); + const s = mi(K, Nt)._++; + c(K, Je).set(s, n), K.mQueue.set(s, [o, a]), qe.postMessage({ id: s, session: r, category: "eval", method: e, args: i }); + })); + N(this, "clear", (e) => qe.postMessage({ session: e, category: "clear" })); + if (c(K, Ae)) return c(K, Ae); + Promise.resolve().then(() => _r).then((e) => { + Si.http = e.http; + }), qe.addEventListener("message", ({ data: { id: e, task_id: i, method: n, args: r, category: o, data: a, error: s, session: l } }) => { + if (o === "eval" && K.mQueue.has(e)) s !== null ? K.mQueue.get(e)[1](s) : K.mQueue.get(e)[0](a), c(K, Je).delete(e), K.mQueue.delete(e); + else if (o === "util") try { + const d = m.get(Si, n.split("/")) || m.get(c(K, Je).get(i), n.split("/")); + if (!m.isFunction(d)) throw `${n} not found`; + Promise.resolve(Reflect.apply(d, void 0, r)).then((u) => { + qe.postMessage({ id: e, task_id: i, category: o, method: n, args: r, session: l, data: u, error: null }); + }).catch((u) => { + qe.postMessage({ id: e, task_id: i, category: o, method: n, args: r, session: l, data: null, error: u }); + }); + } catch (d) { + qe.postMessage({ id: e, task_id: i, category: o, method: n, args: r, session: l, data: null, error: d }); + } + }, !1); + } +}; +Nt = new WeakMap(), Je = new WeakMap(), Ae = new WeakMap(), N(K, "mQueue", /* @__PURE__ */ new Map()), x(K, Nt, 0), x(K, Je, /* @__PURE__ */ new Map()), x(K, Ae, null), N(K, "getInstance", () => (c(K, Ae) || B(K, Ae, new K()), c(K, Ae))); +let Ht = K; +const Ie = Ht.getInstance(), Tt = () => { + const t = H(!0), [, e] = E.useReducer((i) => i + 1, 0); + return V(() => () => t.current = !1, []), () => t.current && e(); +}, No = (t) => { + const e = H(); + return V(() => { + e.current = t; + }, [t]), e.current; +}, Po = (t) => { + const [e, i] = L(t), n = H(null), r = Y((o, a) => { + n.current = a, i(o); + }, []); + return V(() => { + n.current && (n.current(e), n.current = null); + }, [e]), [e, r]; +}, gt = (t = (n) => { +}, e, i = m.isEqual) => { + const n = E.useRef(); + i(e, n.current) || (n.current = m.cloneDeep(e)), E.useEffect(t, [n.current]); +}, mt = gt, Qi = (t, e = "string") => { + var i; + if (!Array.isArray(t)) return t; + for (let n = 0; n < t.length; n++) t[n].value = de((i = t[n]) == null ? void 0 : i.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = Qi(t[n].children, e)); + return t; +}, To = (t, e = "json", i = "string", n, r = null) => { + const [o] = re.useForm(n), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = H([]), d = re.useWatch((u) => l.current.length === 0 ? null : m.pick(u, l.current), o) || null; + return V(() => { + Array.isArray(t) ? s(t) : e === "javascript" && t ? Ie.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), o.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => { + s(de(u, "array")); + }).catch((u) => console.error("useOptions", u)) : t && s(de(t, "array")); + }, [t, e, d]), Qi(a, i); +}, Oo = (t) => { + const [e, i] = L(), n = { type: "GET" }; + if (typeof t == "string" ? n.url = t : m.isPlainObject(t) && Object.assign(n, t), !(n != null && n.url)) throw "url is required"; + const r = (o) => I.request(n, !1).resp((a) => (console.log("useSubscribeRequest", o), i(a), a)); + return gt(() => { + let o = null; + return r().then((a) => { + o = _i.subscribe(m.throttle(r, 180, { leading: !1, trailing: !0 }), a.res); + }), () => o == null ? void 0 : o(); + }, n), e; +}, kr = (t) => { + const [e, i] = E.useState({ items: [], hides: [] }); + return E.useEffect(() => { + t && I.get(`/api/_/${t}`).then(({ pk: n, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, listenChangeFields: f, listenChangeFieldsFunc: h, fields: y, theme: w, themeSetting: C, groups: S }) => ({ pk: n, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, theme: w, themeProps: C, groups: S, listenChangeFields: f, listenChangeFieldsFunc: h, ...y.reduce((v, k) => { + var $; + return ($ = k == null ? void 0 : k.field) != null && $.hidden ? v.hides.push(k == null ? void 0 : k.field) : v.items.push(k), v; + }, { items: [], hides: [] }) })).then(i); + }, [t]), e; +}, Sr = ({ max: t = 0, min: e = 0, type: i = "", message: n, pattern: r, required: o = !1, validator: a } = {}, s, l) => { + const [d, u] = L([]); + return V(() => { + const p = []; + if (o) { + let f = l; + switch (l) { + case "number": + case "string": + case "array": + break; + case "bool": + f = "boolean"; + break; + case "json": + f = "object"; + } + p.push({ type: f, required: !0, whitespace: !0, message: "该项必填" }); + } + switch (i) { + case "string": + p.push({ type: i, max: t, min: e, message: n || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); + break; + case "pattern": + p.push({ type: "string", pattern: r, message: n }); + break; + case "validator": + a && p.push(({ getFieldValue: f }) => ({ validator: async (h, y) => { + const w = await Ie.exec(a, { value: y, fieldName: s }, { getFieldValue: f }); + return m.isString(w) && w ? Promise.reject(w) : m.isBoolean(w) && !w ? Promise.reject(n) : Promise.resolve(); + } })); + } + u(p); + }, [t, e, i, n, r, o, a]), d; +}, Er = (t, e, i) => { + const [n, r] = L(null); + return V(() => { + const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = i || {}; + e && I.request({ method: a, url: m.trimEnd(`${o}/${e}`, "/") }).then((s) => { + r(s); + }); + }, [t, e, i]), n; +}, $r = (t, e, i) => Y((n, r = { serialize: (o) => o, onSuccess: () => { +}, onFail: (o) => (o == null ? void 0 : o.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => { + const o = n.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = i || {}; + return n.validateFields().then((l) => o ? m.pick(l, [o]) : l).then(r.serialize).then((l) => I.request({ method: s, url: m.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); +}, [t, e, i]), vr = (t, e, i, n) => { + const r = Er(e, i, n); + V(() => { + r ? t.setFieldsValue(r) : t.resetFields(); + }, [t, r]); + const o = $r(e, i, n); + return m.partial(o, t); +}, xr = (t, e, i = [], n = {}) => { + const r = H({}), o = H(), a = m.debounce(Tt(), 180), s = ["disabled", "required"], l = (f, h) => { + s.includes(f) && (r.current[f] = h), a(); + }, d = _(() => ({ setDisabled: (f) => l("disabled", f), setRequired: (f) => l("required", f), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = Ji(e, -1, {}, d, n); + if (!p && o.current != u && (u >= 0 || !m.isEmpty(i == null ? void 0 : i[u]))) { + o.current = u; + const { widget: f, widgetPrefix: h, props: y } = i == null ? void 0 : i[u]; + t = Vi(f, h), r.current = m.merge(y, m.pick(r.current, s)); + } + return [t, r.current]; +}, Ei = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Ro = ({ value: t, onChange: e }, i = null) => { + const n = H(), [r] = re.useForm(i), o = H({}); + return mt(() => { + m.isEqual(n.current, t) || r.setFieldsValue(t); + }, [t]), V(() => () => r.resetFields(), []), [_(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (a) => (s) => { + const l = Ei(a); + s ? o.current[l] = s : delete o.current[l]; + } }, scrollToField: (a, s = {}) => { + console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); + }, focusField: (a) => { + console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); + }, getFieldInstance: (a) => { + const s = Ei(a); + return o.current[s]; + } }, [r]), (a, s) => { + n.current = s, e == null || e(s); + }]; +}, ti = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...o }) => { + const a = Vi(t, e), [s, l] = xr(a, i, n, r), [d, u] = L(); + return V(() => { + s && ue.getWidgetComponent(s).then(({ defaultProps: p = {}, default: f }) => ({ default: Nr(f, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(E.createElement(p.default, o))); + }, [s]), d && E.cloneElement(d, { ...o, ...l }); +}, Nr = (t, e = {}, i = null) => (n) => { + const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: d, required: u = !1, extras: p, validators: f, help: h, isVirtual: y, $isReserved: w, initialValue: C, initialValueLanguage: S, ...v } = m.omit(m.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Sr(Object.assign({}, f, u ? { required: !0 } : {}), o, r), $ = _(() => { + const D = Object.keys((e == null ? void 0 : e.extras) || {}); + return m.over([m.partialRight(m.pick, D), m.partialRight(m.omit, D)]); + }, [e == null ? void 0 : e.extras]), [T, j] = $(v), F = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, M = Y((D) => D == null ? void 0 : de(D, r), [r]); + return g(Xt, { name: o, rules: k, initialValue: M(C), normalize: M, children: (D, R, W) => { + var U; + return g(t, { type: r, rcform: W, basicForm: i, itemProps: { validateStatus: R.errors.length > 0 ? "error" : "success", tooltip: h || null, help: R.errors.length > 0 ? R.errors.join("、") : null, required: ((U = k == null ? void 0 : k[0]) == null ? void 0 : U.required) || !1, ...F }, fieldProps: { placeholder: d, ...j, ...D }, $setting: Object.assign({}, p, T) }); + } }); +}, ii = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: d = [], hides: u = [], primaryKey: p = 0, formProps: f = {}, formFields: h = [], listenChangeFields: y, listenChangeFieldsFunc: w, onValuesChange: C, theme: S, themeProps: v = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...T }) => { + const [j] = re.useForm(e), F = Y((R, W) => { + C == null || C(R, W), w && Array.isArray(y) && Ie.exec(w, { changedValues: R, allValues: W }, { getFieldValue: j.getFieldValue, setFieldValue: j.setFieldValue, setFieldsValue: j.setFieldsValue, isFieldTouched: j.isFieldTouched, isFieldsTouched: j.isFieldsTouched }).catch((U) => console.error("onFormValuesChange", t, U)); + }, [t, j, C, y, w]), M = _(() => [{ name: "__PROPS__", value: f }, { name: "__PRIMARY_KEY__", value: p }].concat(h), [p, f, h]), D = (R, W, U) => { + const q = Zt(W, ti, i), he = Ui(T); + return A("div", { ...he, className: O("ff-grid-layout-form", r), style: { ...n, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [q, U && E.cloneElement(U, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: W, basicForm: i })] }); + }; + return A(re, { ...T, form: j, fields: M, onValuesChange: F, children: [S ? g(Gi, { ...v, items: k, theme: S, itemRender: D, fields: d, children: $, basicForm: i }) : D(0, d, $), u == null ? void 0 : u.map((R) => { + var W; + return g(Xt, { name: R.code, children: g(Pr, { form: j, basicForm: i, name: R.code, type: R.type, initialValue: R.initialValue, initialValueLanguage: (W = R.extras) == null ? void 0 : W.initialValueLanguage }) }, JSON.stringify(R.code)); + })] }); +}, Pr = ({ type: t, initialValue: e, initialValueLanguage: i, onChange: n, basicForm: r }) => { + const [o, a] = Ji(i == "javascript" && e, i == "javascript" ? void 0 : e, {}, {}, r); + return V(() => { + i == "javascript" ? n(de(o, t)) : e && n(de(e, t)); + }, [t, e, o]), null; +}; +ii.propTypes = { fields: b.array, hides: b.array }; +const Tr = /* @__PURE__ */ ((t) => ({ code: e, isPreview: i = !1, ...n }) => { + const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: d, marginX: u, marginY: p, cols: f, listenChangeFields: h, listenChangeFieldsFunc: y, pk: w, uuid: C, theme: S, themeProps: v, groups: k } = kr(e), $ = _(() => [{ name: "__PK__", value: w }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: C }], [w, e, C, a]); + return g(t, { name: e, autoComplete: o, theme: S, themeProps: v, groups: k, ...n, formFields: $, listenChangeFields: h, listenChangeFieldsFunc: y, fields: s, hides: l, cols: f, rowHeight: d, itemMargin: [u, p] }); +})(ii), Zi = ({ $setting: t, $close: e, extras: i, code: n, primaryKey: r, ...o }) => { + const [a] = re.useForm(), s = vr(a, n, r, t); + return g(ee, { actions: A(E.Fragment, { children: [g(P, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), g(P, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: i, children: g(Tr, { form: a, code: n, primaryKey: r, ...o }) }); +}, $i = /* @__PURE__ */ new Set(), Jt = (t = [], e = 0) => { + const i = t[e]; + if (i.length && !$i.has(i)) { + const n = document.createElement("script"); + n.setAttribute("src", i), n.setAttribute("data-namespace", i), t.length > e + 1 && (n.onload = () => { + Jt(t, e + 1); + }, n.onerror = () => { + Jt(t, e + 1); + }), $i.add(i), document.body.appendChild(n); + } +}, St = ({ className: t, type: e, style: i = {}, ...n }) => g("span", { role: "img", className: O("ff-iconfont", t), style: i, ...n, children: g("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: g("use", { xlinkHref: `#${e}` }) }) }); +St.propTypes = { className: b.string, type: b.string.isRequired, style: b.object }, St.init = Jt; +const Or = (t, e, i, n) => Ne.redirect(i, e, n), Rr = (t, e = {}, i, n = {}) => { + var o; + const r = (o = n.router) == null ? void 0 : o.reduce((a, [s, l, d]) => { + const u = m.get(e, ["router", s]); + if (!u && u !== 0 && l) throw `请传入 ${d}`; + return `${a}/${u}`; + }, `/api/${i}`); + return I.del(r, e.param).msg(); +}, vi = (t, e, i, { status: { loading: n, disabled: r }, setStatus: o, listFn: a }) => { + const s = { loading: (l) => l === void 0 ? n : o((d) => ({ ...d, loading: l })), disabled: (l) => l === void 0 ? r : o((d) => ({ ...d, disabled: l })), list: a }; + return m.isFunction(i) ? i.call(null, e, s) : m.isString(i) && i ? Ie.exec(i, e, s) : null; +}, xi = (t, e, i, n, r) => m.isString(i) && i ? ue.getWidgetComponent(i).then(({ default: o }) => ne.modal(o, { ...e, $setting: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r)).catch((o) => { + ne.error(i, { content: o.toString() }); +}) : ne.modal(i, { ...e, $setting: n }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), Fr = (t, e, i, n, r) => ne.modal(Zi, { ...e, $setting: n, code: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), jr = (t, e, i, n, r) => ne.modal(ei, { base62params: e, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: m.template(r.title)(t) } : r), Ar = ({ widget: t, widgetType: e, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { + const l = pe(ae), [d, u] = L({ leading: !0, trailing: !1 }), p = _(() => { + switch (e) { + case "redirect": + return m.partialRight(Or, t, r); + case "func": + return m.partialRight(vi, (r == null ? void 0 : r.code) ?? t, { status: d, setStatus: u, listFn: l }); + case "component": + case "fsdpf-component": + return m.partialRight(xi, t, r, o); + case "grid-layout-form": + return m.partialRight(Fr, t, r, o); + case "data-list": + return m.partialRight(jr, t, r, o); + case "destroy": + return m.partialRight(Rr, t, r, o); + default: + if (ri(t) || E.isValidElement(t)) return m.partialRight(xi, t, r, o); + if (m.isFunction(t)) return m.partialRight(vi, (r == null ? void 0 : r.code) || t, { status: d, setStatus: u }); + } + return (...f) => console.error("useButton unknown widgetType", e, ...f); + }, [t, e, l.getBase62params, l.getSelectedRows]); + return [m.debounce((f) => (s == null || s(f), Promise.resolve(ht(n, f, { list: l })).then((h) => p(f, { ...i, ...h })).then((h) => a == null ? void 0 : a(h)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; +}, en = ({ type: t, name: e, className: i, icon: n, iconPosition: r, size: o }, a = "default") => _(() => { + const s = { type: "primary", className: O("ff-button", i), iconPosition: r, size: o }; + return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), a === "link" || a === "dashed" ? (s.type = a, t === "default" && (s.className = O(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), n && (s.icon = g(St, { type: n })), e && (s.children = e), s; +}, [a, t, i, n, r]), Ot = ({ data: t, widget: e, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: d, extras: u }) => { + const p = pe(ae), [f, h] = L(!1), [y, w] = L("hover"), [C, S] = L({}), [v, k] = L(), { placement: $, align: T, zIndex: j, arrow: F = { pointAtCenter: !0 }, getPopupContainer: M, isPopupMountBodyContainer: D = !0, ...R } = a || {}; + V(() => { + i == "grid-layout-form" ? k(E.createElement(Zi, { ...n, $setting: o, code: e })) : i == "data-list" ? k(E.createElement(ei, { base62params: t, $setting: o, listCode: e })) : m.isString(e) ? ue.getWidgetComponent(e).then(({ default: q }) => { + k(E.createElement(q, { ...n, $setting: o })); + }).catch((q) => k(q.toString())) : ri(e) ? k(E.createElement(e, { ...n, $setting: o })) : E.isValidElement(e) && k(E.cloneElement(e, { ...n, $setting: o })); + }, [e, i, n]), V(() => { + Promise.resolve(ht(r, t, { list: p })).then(S); + }, [r, t, p.getBase62params, p.getSelectedRows]); + const W = (q, he = !1) => (h(q), !q && w("hover"), q ? l == null ? void 0 : l(C) : s == null ? void 0 : s(he)), U = (q) => { + h(!0), w("click"); + }; + return g(Fn, { zIndex: j, placement: $, onPopupClick: U, onClick: U, open: f, align: T, arrow: F, trigger: y, getPopupContainer: M || D ? void 0 : (q) => q, content: g(Lr, { ...R, extras: u, children: v && E.cloneElement(v, { ...C, $close: (q) => W(!1, q) }) }), children: d, onOpenChange: W }); +}, Lr = ({ title: t, className: e, classNames: i, children: n, extras: r, width: o, height: a, ...s }) => { + const [l, d] = L({}), u = Y((y, w) => d((C) => ({ ...C, [y]: w })), []), p = Y((y) => d((w) => ({ ...w, [y]: void 0 })), []), f = t ? E.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, h = r ?? E.createElement("div", { className: "ff-popup-reserved-extras" }, r); + return g(pt.Provider, { value: { ele: l, mount: u, unmount: p }, children: A("div", { className: O("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [A("div", { className: O("ff-popup-header", "ff-popover-header", i == null ? void 0 : i.header), children: [f, l == null ? void 0 : l["sub-title"]] }), g("div", { className: O("ff-popup-body", "ff-popover-body", i == null ? void 0 : i.body), children: n }), A("div", { className: O("ff-popup-footer", "ff-popover-footer", i == null ? void 0 : i.footer), children: [h, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); +}; +Ot.propTypes = { widgetType: b.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const ft = (t) => function({ className: e, variant: i, children: n, name: r, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: u, data: p, loading: f, disabled: h, tooltip: y, confirm: w, widget: C = () => { +}, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: T, ...j }) { + const { mode: F, ...M } = T || {}, D = en({ className: e, name: r, type: a, icon: o, iconPosition: s }, i ?? t), R = g(Ct, { ...D, ...j, children: n || r }); + if (F === "popover" && !["destroy", "redirect", "func"].includes(S)) return g(Ot, { data: p, widget: C, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: M, onAfterClick: d, onBeforeClick: u, children: R }); + const W = m.isEmpty(y) || !y.enabled ? {} : y, U = m.isEmpty(w) ? { enabled: !1 } : Object.assign({ enabled: !0 }, w), [q, he] = L(!1), [oe, { disabled: z, loading: se }] = Ar({ widget: C, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: M }, { onAfterClick: d, onBeforeClick: u }); + return g(jn, { okText: "确定", cancelText: "取消", getPopupContainer: (J) => J, ...U, disabled: z || h, open: q, onOpenChange: (J) => { + if (!J) return he(J); + U.enabled ? he(J) : oe(p); + }, onConfirm: (J) => { + oe(p, J); + }, onClick: (J) => { + J.stopPropagation(); + }, children: g(An, { getPopupContainer: (J) => J, ...W, title: q ? null : W == null ? void 0 : W.title, trigger: ["hover", "click"], children: E.cloneElement(R, { loading: se || f, disabled: z || h }) }) }); +}, P = ft("default"); +P.propTypes = { type: b.oneOf(["primary", "default", "danger", ""]), size: b.oneOf(["large", "middle", "small"]), name: b.string, icon: b.string, iconPosition: b.oneOf(["start", "end"]), data: b.any, widget: b.any, widgetType: b.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: b.object, widgetProps: b.object, widgetSetting: b.object, widgetContainerProps: b.object, tooltip: b.exact({ title: b.string.isRequired, placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func }), confirm: b.exact({ title: b.string.isRequired, cancelText: b.string, okText: b.string, okType: b.oneOf(["primary", "default", "danger", ""]), placement: b.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: b.oneOfType([b.bool, b.number]), getPopupContainer: b.func, arrow: b.oneOfType([b.bool, b.exact({ pointAtCenter: b.bool })]) }) }; +const Ir = ft("link"), Vr = ft("circle"), Mr = ft("round"), Dr = ft("dashed"), Ni = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (h, y, w) => { +}, onBeforeClick: n = (h, y, w) => { +}, labelVariant: r = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: d = (h, y) => g(P, { ...h, data: y }, h.uuid || Mt()), widgetContainerProps: u = {}, children: p, data: f }) => { + if (m.isEmpty(t)) return p; + const [h, y] = _(() => (t || []).reduce((C, S) => { + const v = e.indexOf(S.widgetType); + return v === -1 ? C[1].push(S) : C[0] ? v < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = S) : C[1].push(S) : C[0] = S, C; + }, [null, []]), [t, e]); + a ? p = a(h, f) || p : p || (p = g(Ct, { ...en(Object.assign(h != null && h.name || h != null && h.icon ? {} : { icon: "icon-location" }, h, { size: o }), r) })); + const w = y.map((C) => d(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: m.partialRight(i, C, f), onBeforeClick: m.partialRight(n, C, f) }, { size: l, variant: s }), f)); + return g(Ot, { widget: h == null ? void 0 : h.widget, widgetType: h == null ? void 0 : h.widgetType, widgetProps: h == null ? void 0 : h.widgetProps, widgetSetting: h == null ? void 0 : h.widgetSetting, widgetContainerProps: Object.assign({}, u, h == null ? void 0 : h.widgetContainerProps), data: f, widgetData: h == null ? void 0 : h.widgetData, extras: w, onAfterClick: m.partialRight(i, h, f), onBeforeClick: m.partialRight(n, h, f), children: p }); +}; +Ni.propTypes = { triggerWeights: b.array, options: b.arrayOf(b.shape({ ...P.propTypes, widgetType: P.propTypes.widgetType.isRequired })), btnSize: P.propTypes.size, btnRender: b.func, btnVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: b.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: b.func, labelSize: P.propTypes.size, onAfterClick: b.func, onBeforeClick: b.func, widgetContainerProps: P.propTypes.widgetContainerProps, data: P.propTypes.data }, P.Link = Ir, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = Vr, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Mr, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Dr, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Ot, P.GroupPopover = Ni; +const zr = ({ fields: t, formProps: e, $close: i }) => { + const [n] = re.useForm(), r = _(() => [{ name: "__PROPS__", value: e }], [e]); + return g(ee, { actions: A(E.Fragment, { children: [g(P, { name: "取消", widget: () => i(!1) }), g(P, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: g(re, { fields: r, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => g(ti, { code: o, ...a }, o)) }) }); +}, Wr = ({ className: t, classNames: e, $close: i, children: n, title: r, subTitle: o, actions: a, extras: s, ...l }) => A(Bn, { ...l, prefixCls: "ff-drawer", className: O("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [A("div", { className: O("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [g("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: g(Qt, { type: "close" }) }), r, o] }), g("div", { className: O("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), A("div", { className: O("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), Br = ({ className: t, classNames: e, $close: i, $event: n, children: r, title: o, subTitle: a, actions: s, extras: l, placement: d, ...u }) => { + const p = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; + return g(Un, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => A("div", { className: O("ff-modal-content ff-popup", t), children: [A("div", { className: O("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [g("button", { "aria-label": "Close", className: O("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: u.onClose, children: g(Qt, { type: "close" }) }), o, a] }), g("div", { className: O("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), A("div", { className: O("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) }); +}, tn = ({ placement: t, $close: e, $event: i, children: n, title: r, ...o }) => { + const [a, s] = L({}), [l, d] = L(!0), u = Y((y, w) => s((C) => ({ ...C, [y]: w })), []), p = Y((y) => s((w) => ({ ...w, [y]: void 0 })), []); + let f = { ...o, className: a.rootClassName, title: a.title || r && E.createElement("div", { className: O("ff-popup-title") }, r), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: n, $close: e, $event: i, onClose: () => d(!1) }; + const h = () => { + e(!1); + }; + return g(pt.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? g(Wr, { ...f, placement: t, open: l, afterOpenChange: (y) => !y && h() }) : g(Br, { ...f, visible: l, afterClose: h }) }); +}; +tn.propTypes = { placement: b.oneOf(["center", "left", "top", "right", "bottom"]) }; +const ie = () => { + const [t, e] = En({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => { + const { offsetHeight: a } = o; + return { height: a }; + }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = E.useReducer((o) => o + 1, 0); + V(() => { + ie.$onClick = n, ie.$queue.forEach(([o, a, s], l, d) => { + r([a, s], ...o), delete d[l]; + }); + }, []); + const n = (o, a = {}, s = {}) => new Promise((l, d) => r([l, d], o, a, s)), r = ([o, a], s, l = {}, d = {}) => { + const u = ie.$index++, p = (f) => ((h, y) => (ie.$popups.delete(h), i(), y == null ? void 0 : y()))(u, () => o(f)); + if (s === Li) return t.open({ ...d, key: u, content: E.createElement(s, { ...l, $close: () => t.close(u) }) }); + ie.$popups.set(u, E.createElement(tn, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: u, $close: p }, E.isValidElement(s) ? E.cloneElement(s, { ...l, $close: p }) : s != null && s.name || fi.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === fi.ForwardRef ? E.createElement(s, { ...l, $close: p }) : s)), i(); + }; + return A(E.Fragment, { children: [Array.from(ie.$popups).map(([o, a]) => a), e] }); +}; +ie.$popups = /* @__PURE__ */ new Map(), ie.$index = 0, ie.$queue = [], ie.$onClick = (...t) => new Promise((e, i) => { + ie.$queue.push([t, e, i]); +}); +const Pi = (t, e, i = {}) => ie.$onClick(t, e, i), It = (t, { showProgress: e, duration: i, ...n } = { duration: 1.5 }) => ie.$onClick(Li, { content: t, ...n }, { showProgress: e, duration: i }), ne = { modal: Pi, confirm: (t, e = {}) => ie.$onClick(qn, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, i = {}) => Pi(zr, { formProps: i, fields: t }, { placement: "center", ...e }).then((n) => { + if (n === !1) throw !1; + return n; +}), notification: It, success: (t, e = { duration: 1.5 }) => It(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => It(t, { ...e, className: "ff-notification-error", icon: "close" }) }; +Ze.configure({ showSpinner: !1 }); +const nn = () => { + const t = window.localStorage.getItem(bt); + return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); +}; +Me.interceptors.request.use((t) => (Object.assign(t.headers, nn()), Ze.inc(), t), (t) => (Ze.done(), Promise.reject({ code: -1, msg: t }))), Me.interceptors.response.use(({ data: t, headers: e }) => (Ze.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { + return Ze.done(), Promise.reject(t.message); +}), window.addEventListener("unhandledrejection", Dt.onUnhandledRejection), Dt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && Ne.redirect(Ue.get("Common.WEBSITE_LOGIN_PAGE"))); +var Ge, Be, Ye; +const Q = class Q { + constructor() { + N(this, "appUrl", ""); + x(this, Ge, null); + return c(Q, Be) || (B(Q, Ye, new Dt()), B(Q, Be, new Proxy(this, { get(e, i) { + if (i in e) { + const n = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), i); + return n != null && n.get ? Reflect.get(e, i, e) : typeof e[i] == "function" ? e[i].bind(e) : e[i]; + } + return c(Q, Ye)[i]; + } }))), c(Q, Be); + } + init(e, i, n) { + Me.defaults.baseURL = this.appUrl = n, Me.defaults.timeout = 15e3, c(Q, Ye).init(e, i, Me); + } + get driver() { + return Me; + } + get headers() { + return nn(); + } + mock(e = {}) { + return c(this, Ge) ?? B(this, Ge, new vn(Me, { onNoMatch: "passthrough", ...e })); + } + unmock() { + var e; + (e = c(this, Ge)) == null || e.restore(), B(this, Ge, null); + } +}; +Ge = new WeakMap(), Be = new WeakMap(), Ye = new WeakMap(), x(Q, Be), x(Q, Ye), N(Q, "getInstance", () => c(Q, Be) ?? B(Q, Be, new Q())); +let Gt = Q; +const I = Gt.getInstance(); +class ni extends Error { + constructor(e, i) { + super(i), Error.captureStackTrace && Error.captureStackTrace(this, ni), !i instanceof et && (this.name = `${e} Error Runtime`); + } +} +class et extends Error { + constructor(e, ...i) { + super(...i), Error.captureStackTrace && Error.captureStackTrace(this, et), this.name = `${e} Not Found`; + } +} +const Vt = "mine", bt = "token"; +var Le, Xe; +const be = class be { + constructor() { + x(this, Xe, /* @__PURE__ */ new Map()); + N(this, "setVendor", (e, i) => c(this, Xe).set(e, new ji(i, async (n, r) => { + var a, s; + if (!(n != null && n.default)) throw "@pkg not found"; + let o = () => r; + switch ("function") { + case typeof (o = (a = n.default) == null ? void 0 : a[`./${r}/index.jsx`]): + case typeof (o = (s = n.default) == null ? void 0 : s[`./${r}/index.js`]): + return o(); + } + throw new et(r); + }))); + N(this, "getWidgetComponent", async (e) => { + if (!e) throw "getWidgetComponent widget is required"; + if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); + const [, i] = e == null ? void 0 : e.split("@pkg/"); + if (!i) throw new et(e); + try { + return c(this, Xe).has("pkg") ? await c(this, Xe).get("pkg").get(i) : await import(`${I.appUrl}/api/pkg-import/web?name=${e}`); + } catch (n) { + throw new ni(e, n); + } + }); + N(this, "getRoutes", () => I.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: i, ...n }) => [i, { uuid: i, ...n }])).then((e) => new Map(e))); + N(this, "getMenus", () => I.get("/api/my-menu")); + N(this, "getConfigure", () => I.get("api/init-configure")); + N(this, "getWidgetOperationAuth", () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((i, { uuid: n, auth: r }) => [...i, [n, r]], []))); + N(this, "getPhoneNumber", (e) => I.get(`/api/user-wx-phone-number/${e}`)); + N(this, "getUserToken", () => { + const e = window.localStorage.getItem(bt); + if (!e) return ""; + const i = e.split("."); + if (!Array.isArray(i) || i.length !== 3) throw "登录令牌无效!"; + const { iat: n } = JSON.parse(window.atob(i[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!"; + return e; + }); + N(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + N(this, "getUserInfo", (e = !0) => { + var i; + try { + const n = this.getUserToken(); + if (!n) return Promise.resolve(null); + const { iat: r } = JSON.parse(window.atob((i = n == null ? void 0 : n.split(".")) == null ? void 0 : i[1])), { iat: o, ...a } = I.decode(window.localStorage.getItem(Vt) || "", {}); + return o === r ? Promise.resolve(a) : I.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Vt, I.encode({ ...s, iat: r })), s)); + } catch (n) { + console.error(n), e && ne.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + N(this, "login", (e, i, n = {}) => I.post("/api/user-token", { username: e, passwd: xn.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(bt, r), r)).then(async (r) => (await this.initAppEnv(), r))); + N(this, "logout", (e) => (window.localStorage.removeItem(Vt), window.localStorage.removeItem(bt), e == null ? void 0 : e())); + N(this, "initAppEnv", async () => { + const [e, i, n, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); + return Ii.init(e), Ue.init(r), Ne.init(i, n), St.init(Ue.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: i, menus: n, configures: r }; + }); + if (c(be, Le)) return c(be, Le); + } +}; +Le = new WeakMap(), Xe = new WeakMap(), x(be, Le, null), N(be, "getInstance", () => (c(be, Le) || B(be, Le, new be()), c(be, Le))); +let Yt = be; +const ue = Yt.getInstance(), Ur = E.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), qr = E.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), ri = (t) => !!(t != null && t.name) && (t.prototype instanceof E.Component || /^[A-Z]/.test(t.name)), Kr = (t, e) => { + if (!t || typeof window > "u") return; + let i = document.querySelector(`style[ff-style-token="${e}"]`); + return i ? (i.innerHTML = t, t) : (i = document.createElement("style"), i.setAttribute("ff-style-token", e), i.setAttribute("type", "text/css"), i.innerHTML = t, document.head.appendChild(i), t); +}, _r = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: Ur, AppGlobalParamsContext: qr, cache: ji, configure: Ue, default: ue, func: Ie, http: I, insertStyle: Kr, isReactComponent: ri, route: Ne }, Symbol.toStringTag, { value: "Module" })); +var ve, Qe, xe, Ce, ke, te, Z, G, Se, st, lt, ct, dt, Pt, ut; +const oi = class oi { + constructor(e, i = "/") { + x(this, ve, "/"); + x(this, Qe, /* @__PURE__ */ new Set()); + x(this, xe, (e) => { + for (const i of c(this, Qe)) try { + i(e); + } catch (n) { + console.error("Error in VirtualFS event listener:", n); + } + }); + x(this, Ce, (e) => { + const i = Date.now(); + if (e && (e.lastModified = i), c(this, ve) != "/") { + const n = c(this, G).call(this, c(this, ve)); + n && (n.lastModified = i); + } + this.root.lastModified = i; + }); + x(this, ke, (e) => { + let i = ge.normalize(e); + return i.startsWith("/") || (i = "/" + i), i.length > 1 && i.endsWith("/") && (i = i.slice(0, -1)), i; + }); + x(this, te, (e) => { + const i = ge.join(c(this, ve), e); + return c(this, ke).call(this, i); + }); + x(this, Z, (e) => { + if (!e || typeof e != "string") return !1; + const i = c(this, ke).call(this, e); + return !i.includes("..") && i.startsWith("/"); + }); + x(this, G, (e) => { + var o; + const i = c(this, ke).call(this, e); + if (i === "/") return this.root; + const n = i.split("/").filter((a) => a); + let r = this.root; + for (const a of n) { + if (r.type !== "dir") return null; + const s = (o = r.children) == null ? void 0 : o.find((l) => l.name === a); + if (!s) return null; + r = s; + } + return r; + }); + x(this, Se, (e) => { + const i = c(this, ke).call(this, e), n = ge.basename(i), r = ge.dirname(i); + return { parent: c(this, G).call(this, r), name: n }; + }); + x(this, st, (e, i, n) => n === !1 ? e : n === "root" ? e.map((r) => ge.join(i, r)) : n === !0 || n === "working" ? e.map((r) => ge.relative(c(this, ve), ge.join(i, r))) : e); + x(this, lt, async (e, i, n, r = "") => { + const o = [], a = c(this, G).call(this, e); + if (!a || a.type !== "dir") return o; + const s = a.children; + for (const l of s) { + const d = l.name, u = e === "/" ? `/${d}` : `${e}/${d}`, p = r ? `${r}/${d}` : d; + try { + if (l.type === "file") i(n ? p : d) && o.push(p); + else if (l.type === "dir" && n) { + const f = await c(this, lt).call(this, u, i, n, p); + o.push(...f); + } + } catch { + continue; + } + } + return o; + }); + x(this, ct, async (e, i, n, r = "") => { + const o = [], a = Array.isArray(i) ? i : [i], s = c(this, G).call(this, e); + if (!s || s.type !== "dir") return o; + if (!n) { + for (const d of a) if (c(this, dt).call(this, d)) { + const u = await c(this, Pt).call(this, e, d); + o.push(...u); + } else { + const u = ge.join(e, d), p = c(this, ke).call(this, u); + c(this, G).call(this, p) && o.push(d); + } + return o; + } + const l = s.children; + for (const d of l) { + const u = d.name, p = e === "/" ? `/${u}` : `${e}/${u}`, f = r ? `${r}/${u}` : u; + try { + if (d.type === "file") for (const h of a) { + let y = !1; + if (y = c(this, dt).call(this, h) ? c(this, ut).call(this, u, h) : u === h, y) { + o.push(f); + break; + } + } + else if (d.type === "dir") { + const h = await c(this, ct).call(this, p, i, n, f); + o.push(...h); + } + } catch { + continue; + } + } + return o; + }); + x(this, dt, (e) => /[*?[\]{}]/.test(e)); + x(this, Pt, async (e, i) => { + const n = [], r = c(this, G).call(this, e); + if (!r || r.type !== "dir") return n; + const o = r.children.map((a) => a.name); + for (const a of o) c(this, ut).call(this, a, i) && n.push(a); + return n; + }); + x(this, ut, (e, i) => { + const n = i.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, o) => "(" + o.split(",").join("|") + ")"); + return new RegExp(`^${n}$`).test(e); + }); + var n, r, o; + B(this, ve, i), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (n = this.root).name ?? (n.name = "/"), (r = this.root).children ?? (r.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now()))); + } + async stat(e) { + const i = c(this, te).call(this, e); + if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, G).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); + return { isFile: () => n.type === "file", isDirectory: () => n.type === "dir", lastModified: n.lastModified }; + } + async dir(e) { + const i = c(this, te).call(this, e); + if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, G).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); + if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); + return n.children.map((r) => r.name); + } + async readFile(e) { + const i = c(this, te).call(this, e); + if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, G).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (n.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); + return n.content || ""; + } + async writeFile(e, i) { + const n = c(this, te).call(this, e); + if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: r, name: o } = c(this, Se).call(this, n); + if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); + const a = r.children.findIndex((d) => d.name === o), s = a >= 0, l = { name: o, type: "file", content: i, lastModified: Date.now() }; + s ? r.children[a] = l : r.children.push(l), c(this, Ce).call(this, r), c(this, xe).call(this, { action: s ? "update" : "create", path: n, type: "file", timestamp: Date.now() }); + } + async mkdir(e, i = {}) { + const n = c(this, te).call(this, e); + if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { recursive: r } = i; + if (r) { + const o = n.split("/").filter((s) => s); + let a = "/"; + for (const s of o) + if (a = ge.join(a, s), !c(this, G).call(this, a)) { + const { parent: l, name: d } = c(this, Se).call(this, a); + if (l && l.type === "dir") { + const u = { name: d, type: "dir", children: [], lastModified: Date.now() }; + l.children.push(u), c(this, Ce).call(this, l), c(this, xe).call(this, { action: "create", path: c(this, ke).call(this, a), type: "dir", timestamp: Date.now() }); + } + } + } else { + const { parent: o, name: a } = c(this, Se).call(this, n); + if (!o) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); + if (o.type !== "dir") throw new Error("ENOTDIR: not a directory"); + if (o.children.find((l) => l.name === a)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); + const s = { name: a, type: "dir", children: [], lastModified: Date.now() }; + o.children.push(s), c(this, Ce).call(this, o), c(this, xe).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() }); + } + } + async unlink(e) { + const i = c(this, te).call(this, e); + if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: n, name: r } = c(this, Se).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + const o = n.children.findIndex((a) => a.name === r); + if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + if (n.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); + n.children.splice(o, 1), c(this, Ce).call(this, n), c(this, xe).call(this, { action: "delete", path: i, type: "file", timestamp: Date.now() }); + } + async rmdir(e, i = {}) { + const n = c(this, te).call(this, e); + if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: r, name: o } = c(this, Se).call(this, n); + if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const a = r.children.findIndex((l) => l.name === o); + if (a < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const s = r.children[a]; + if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); + if (!i.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); + r.children.splice(a, 1), c(this, Ce).call(this, r), c(this, xe).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() }); + } + async rename(e, i) { + const n = c(this, te).call(this, e), r = c(this, te).call(this, i); + if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${i}'`); + if (!c(this, G).call(this, n)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); + const { parent: o, name: a } = c(this, Se).call(this, n), { parent: s, name: l } = c(this, Se).call(this, r); + if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); + if (c(this, G).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${i}'`); + const d = o.children.findIndex((p) => p.name === a), u = { ...o.children[d], name: l, lastModified: Date.now() }; + o.children.splice(d, 1), s.children.push(u), c(this, Ce).call(this, o), o !== s && c(this, Ce).call(this, s), c(this, xe).call(this, { action: "rename", path: r, oldPath: n, type: u.type, timestamp: Date.now() }); + } + async exists(e) { + const i = c(this, te).call(this, e); + return c(this, Z).call(this, i) ? c(this, G).call(this, i) !== null : !1; + } + getLastModified() { + return this.root.lastModified; + } + subscribe(e) { + if (typeof e != "function") throw new Error("Callback must be a function"); + return c(this, Qe).add(e), () => { + c(this, Qe).delete(e); + }; + } + getWorkingDirectory() { + return c(this, ve); + } + scope(e = "/") { + const i = c(this, ke).call(this, e); + if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = c(this, G).call(this, i); + if (!n) throw new Error(`ENOENT: no such file or directory '${e}'`); + if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); + return n.children ?? (n.children = []), n.lastModified ?? (n.lastModified = Date.now()), new oi(this.root, i); + } + async findFiles(e, i, n = {}) { + const r = c(this, te).call(this, e); + if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const o = c(this, G).call(this, r); + if (!o) throw new Error(`ENOENT: no such file or directory '${e}'`); + if (o.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); + const { recursive: a = !1, fullPath: s = !1 } = n; + if (typeof i == "function") { + const d = await c(this, lt).call(this, r, i, a); + return c(this, st).call(this, d, r, s); + } + const l = await c(this, ct).call(this, r, i, a); + return c(this, st).call(this, l, r, s); + } +}; +ve = new WeakMap(), Qe = new WeakMap(), xe = new WeakMap(), Ce = new WeakMap(), ke = new WeakMap(), te = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), Se = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), Pt = new WeakMap(), ut = new WeakMap(); +let Ti = oi; +const Hr = async (t, e = "/", i = "") => { + try { + const n = await t.stat(e), r = e === "/" ? "/" : ge.basename(e), o = { title: r, key: i ? `${i}${e}` : e, isLeaf: n.isFile() }; + if (n.isDirectory()) { + const a = await t.dir(e); + if (a.length > 0) { + o.children = []; + const s = [], l = []; + for (const d of a) { + const u = e === "/" ? `/${d}` : `${e}/${d}`; + try { + (await t.stat(u)).isDirectory() ? s.push(d) : l.push(d); + } catch (p) { + console.warn(`Failed to stat ${u}:`, p.message); + } + } + s.sort(), l.sort(); + for (const d of [...s, ...l]) { + const u = e === "/" ? `/${d}` : `${e}/${d}`; + try { + const p = await Hr(t, u, i); + o.children.push(p); + } catch (p) { + console.warn(`Failed to process ${u}:`, p.message); + } + } + } + } + return o; + } catch { + return null; + } +}; +export { + xo as $, + Ji as A, + Ki as B, + qi as C, + kt as D, + cr as E, + lr as F, + $o as G, + pr as H, + ar as I, + ei as J, + ae as K, + ur as L, + yr as M, + ir as N, + rr as O, + Qn as P, + Zn as Q, + _i as R, + Co as S, + ko as T, + Wi as U, + qt as V, + er as W, + tr as X, + wr as Y, + br as Z, + vo as _, + Vi as a, + Tt as a0, + No as a1, + Po as a2, + gt as a3, + mt as a4, + To as a5, + Oo as a6, + Tr as a7, + ii as a8, + ti as a9, + Ie as aA, + Ne as aB, + Ur as aC, + qr as aD, + Ti as aE, + Hr as aF, + Zi as aa, + kr as ab, + Sr as ac, + Er as ad, + $r as ae, + vr as af, + xr as ag, + Ro as ah, + St as ai, + P as aj, + Ii as ak, + Ar as al, + ee as am, + pt as an, + Ai as ao, + ie as ap, + ne as aq, + po as ar, + ho as as, + go as at, + ue as au, + ri as av, + Kr as aw, + I as ax, + ji as ay, + Ue as az, + _n as b, + ht as c, + Mi as d, + fo as e, + yo as f, + Kn as g, + wo as h, + Hn as i, + Gn as j, + bo as k, + Bi as l, + Jn as m, + So as n, + Ui as o, + Zt as p, + Hi as q, + Lt as r, + Yi as s, + de as t, + mo as u, + mr as v, + Gi as w, + hr as x, + gr as y, + Eo as z +}; diff --git a/dist/common/main-DOuFUIVr.js b/dist/common/main-DOuFUIVr.js deleted file mode 100644 index 49d2d9b..0000000 --- a/dist/common/main-DOuFUIVr.js +++ /dev/null @@ -1,1507 +0,0 @@ -var yn = Object.defineProperty; -var di = (t) => { - throw TypeError(t); -}; -var wn = (t, e, i) => e in t ? yn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i; -var N = (t, e, i) => wn(t, typeof e != "symbol" ? e + "" : e, i), ui = (t, e, i) => e.has(t) || di("Cannot " + i); -var c = (t, e, i) => (ui(t, e, "read from private field"), i ? i.call(t) : e.get(t)), x = (t, e, i) => e.has(t) ? di("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, i), B = (t, e, i, n) => (ui(t, e, "write to private field"), n ? n.call(t, i) : e.set(t, i), i); -var pi = (t, e, i, n) => ({ - set _(r) { - B(t, e, r, i); - }, - get _() { - return c(t, e, n); - } -}); -import { jsx as h, jsxs as j } from "react/jsx-runtime"; -import E, { useEffect as V, useState as L, useCallback as Y, useRef as H, useContext as pe, useMemo as U, useId as Vt, isValidElement as bn, useLayoutEffect as Cn } from "react"; -import ge from "pathe"; -import w from "prop-types"; -import R from "classnames"; -import * as gi from "react-is"; -import { useNotification as kn } from "rc-notification"; -import f from "lodash"; -import ae, { Field as Xt, FieldContext as Ni } from "rc-field-form"; -import { M as jt, N as Ze, a as Ve, s as Dt, b as Sn, S as En } from "./vender-BkiRbACr.js"; -import Pi from "immutability-helper"; -import { Space as $n, Form as wt, Input as vn, Button as Ct, Pagination as xn, Tree as Nn, Breadcrumb as Pn, Empty as zt, Table as hi, Popover as Tn, Popconfirm as Rn, Tooltip as On } from "antd"; -import Fn from "rc-util/lib/hooks/useMergedState"; -import { useMergedState as An } from "rc-util"; -import { generatePath as jn, useInRouterContext as Ti, useParams as Ln, useLocation as In, createBrowserRouter as Mn, Navigate as Vn } from "react-router-dom"; -import Dn from "rc-drawer"; -import zn from "rc-dialog"; -var Ke, tt, _e, Se, De, ze; -class Ri { - constructor(e, i) { - x(this, Ke, /* @__PURE__ */ new Map()); - x(this, tt, !0); - x(this, _e, []); - x(this, Se); - x(this, De, () => c(this, Se)); - x(this, ze, () => Promise.resolve()); - N(this, "get", (...e) => new Promise((i, n) => { - const r = JSON.stringify(e); - if (c(this, Ke).has(r)) return i(c(this, ze).call(this, c(this, Se), ...e)); - if (c(this, Se) === void 0) c(this, _e).push([e, i, n]), c(this, tt) && (B(this, tt, !1), Promise.resolve(typeof c(this, De) == "function" ? c(this, De).call(this) : c(this, De)).then((a) => B(this, Se, a || null)).finally(() => { - c(this, _e).forEach(([a, o, s]) => { - try { - const l = c(this, ze).call(this, c(this, Se), ...a); - c(this, Ke).set(JSON.stringify(a), l), o(l); - } catch (l) { - s(l); - } - }), c(this, _e).length = 0; - })); - else { - const a = c(this, ze).call(this, c(this, Se), ...e); - c(this, Ke).set(r, a), i(a); - } - })); - B(this, ze, i), B(this, De, e); - } -} -Ke = new WeakMap(), tt = new WeakMap(), _e = new WeakMap(), Se = new WeakMap(), De = new WeakMap(), ze = new WeakMap(); -const la = () => h("div", { children: "Empty" }), pt = E.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), ee = ({ rootClassName: t, className: e, children: i, actions: n, title: r, subTitle: a, extras: o, style: s = {} }) => { - const { mount: l, unmount: d } = E.useContext(pt); - return ee.Action({ children: n }), ee.Title({ children: r }), ee.SubTitle({ children: a }), ee.Extra({ children: o }), V(() => (l("rootClassName", t), () => d(t)), [t]), h("div", { className: R("ff-container", e), style: s, children: i }); -}, yt = (t) => ({ children: e, className: i }) => { - const { mount: n, unmount: r } = E.useContext(pt); - return V(() => (e && n(t, E.createElement("div", { key: `ff-${t}`, className: R(`ff-popup-${t}`, i) }, e)), () => r(t)), [i, e]), null; -}; -ee.Action = yt("actions"), ee.Title = yt("title"), ee.SubTitle = yt("sub-title"), ee.Extra = yt("extras"), ee.propTypes = { className: w.string, style: w.object, title: w.any, subTitle: w.any, actions: w.any, extras: w.any }; -const ca = () => h(ee, { className: "ff-loading", children: j("div", { className: "loader", children: [j("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), j("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), j("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), j("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), da = () => h("div", { children: "NotFound" }), Oi = ({ children: t }) => { - const [e, i] = L({}), n = Y((a, o) => i((s) => ({ ...s, [a]: o })), []), r = Y((a) => i((o) => ({ ...o, [a]: void 0 })), []); - return typeof (t == null ? void 0 : t.type) == "string" ? t : h(pt.Provider, { value: { ele: e, mount: n, unmount: r }, children: E.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); -}; -Oi.propTypes = { children: w.element.isRequired }; -const mi = { 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"] }, Qt = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (mi[t] || mi.info).map((i, n) => h("path", { d: i }, n)) }) }), Fi = ({ className: t, content: e, icon: i, $close: n }) => j(E.Fragment, { children: [i && h("div", { className: R("ff-notification-icon", t), children: h(Qt, { type: i }) }), e] }), Wn = ({}) => h(ee, { children: "Confirm" }); -var Pe, He; -const he = class he { - constructor() { - x(this, He, /* @__PURE__ */ new Map()); - N(this, "init", (e) => B(this, He, new Map(e))); - N(this, "check", (e) => !c(this, He).has(e) || c(this, He).get(e)); - if (c(he, Pe)) return c(he, Pe); - } -}; -Pe = new WeakMap(), He = new WeakMap(), x(he, Pe, null), N(he, "getInstance", () => (c(he, Pe) || B(he, Pe, new he()), c(he, Pe))); -let Wt = he; -const Ai = Wt.getInstance(), Bn = (t, e, i = "children") => { - if (f.isEmpty(t)) return {}; - const n = f.find(t, ["value", e]); - if (!f.isEmpty(n)) return n; - const r = t.length; - for (let a = 0; a < r; a++) { - const { [i]: o } = t[a], s = Bn(o, e, i); - if (!f.isEmpty(s)) return s; - } - return {}; -}, ji = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; -var Te, it; -const me = class me { - constructor() { - x(this, it, null); - N(this, "init", (e) => B(this, it, e)); - N(this, "get", (e, i) => f.get(c(this, it), e, i)); - if (c(me, Te)) return c(me, Te); - } -}; -Te = new WeakMap(), it = new WeakMap(), x(me, Te, null), N(me, "getInstance", () => (c(me, Te) || B(me, Te, new me()), c(me, Te))); -let Bt = me; -const qe = Bt.getInstance(), fi = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { - switch (`${t}`.toLowerCase()) { - case "0": - case "false": - case "[]": - case "{}": - return !1; - } - return !!t; -}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, de = (t, e) => { - let i = "string"; - i = Array.isArray(t) ? "array" : typeof t, f.isObject(t) && (i = "json"); - const n = `${i}2${e}`; - return Reflect.has(fi, n) ? fi[n](t) : t; -}, qn = (t) => t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "json" : typeof t == "boolean" ? "bool" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "float" : typeof t, gt = (t = {}, e = {}, i = {}, n = "") => Li(t, (r, a) => a === "type" && r === "code") ? Ii(t, e, i, n) : Mi(t, e, n), Li = (t, e = () => !1) => f.some(t, (i) => !!f.some(i, e) || (f.isEmpty(i) || !f.isPlainObject(i) && !f.isArray(i) ? void 0 : Li(i, e))), Ii = async (t = {}, e = {}, i = {}, n = "") => { - let r = /* @__PURE__ */ Object.create(null); - for (let a in t) { - let o; - if (Reflect.has(t[a], "type") && ["code", "field", "router", "query", "string"].includes(t[a].type)) { - const { type: s, value: l = "", default: d = n } = t[a]; - switch (s) { - case "code": - try { - o = await Ie.exec(l, e, i); - } catch (u) { - console.error("getWidgetPropsData", u); - } - break; - case "field": - o = f.get(e, l) ?? f.get(e, l.substring(l.indexOf(".") + 1)); - break; - case "router": - case "query": - o = xe.getPageParams(l); - break; - case "string": - o = l; - } - o ?? (o = d); - } else o = await Ii(t[a], e, i, n); - f.set(r, a, o); - } - return r; -}, Mi = (t = {}, e = {}, i = "") => Object.keys(t || {}).reduce((n, r) => { - if (f.isPlainObject(t[r])) { - let a; - if (Reflect.has(t[r], "type") && ["field", "router", "query", "string"].includes(t[r].type)) { - const { type: o, value: s = "", default: l = i } = t[r]; - switch (o) { - case "field": - a = f.get(e, s) ?? f.get(e, s.substring(s.indexOf(".") + 1)); - break; - case "router": - case "query": - a = xe.getPageParams(s); - break; - case "string": - a = s; - } - a ?? (a = l); - } else a = Mi(t[r], e, i); - f.set(n, r, a); - } - return n; -}, {}), Lt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((i) => Lt(i, e)) : Object.keys(t).reduce((i, n) => (e[n] ? i[e[n]] = Lt(t[n], e) : i[n] = Lt(t[n], e), i), {}) : t, ua = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { - const e = 16 * Math.random() | 0; - return (t === "x" ? e : 3 & e | 8).toString(16); -}), pa = (t) => { - var e, i; - return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.name : ""; -}, ga = (t) => { - var e, i; - return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.category : ""; -}, ha = (t) => { - var e, i; - return t ? (i = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : i.owner : ""; -}, Un = (t, e = 32, i = "auto") => { - const n = qt(t), r = i === "auto" ? "x64" : i; - if (e === 32) return jt.x86.hash32(n).toString(); - if (e === 128) return r === "x64" ? jt.x64.hash128(n) : jt.x86.hash128(n); - throw new Error("bits 只能是 32 或 128"); -}, qt = (t) => t == null ? "null" : typeof t == "string" ? t : typeof t == "number" || typeof t == "boolean" ? String(t) : typeof t == "function" ? t.toString() : Array.isArray(t) ? "[" + t.map(qt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${qt(t[e])}`).join(",") + "}" : String(t), Kn = () => { - let t = 1; - const e = /* @__PURE__ */ new WeakMap(), i = /* @__PURE__ */ new Map(); - return (...n) => n.length === 0 ? "" : n.map((r) => { - return String((a = r) === null || typeof a != "object" && typeof a != "function" ? (i.has(a) || i.set(a, t++), i.get(a)) : (e.has(a) || e.set(a, t++), e.get(a))); - var a; - }).join("::"); -}, _n = (t) => { - if (!t || typeof t != "string" || t.startsWith("/") || t.startsWith("./") || t.startsWith("../")) return !1; - try { - let e = t.startsWith("//") ? `http:${t}` : t; - return e.includes("://") || e.startsWith("//") || (e = `http://${e}`), !!new URL(e).hostname; - } catch { - return !1; - } -}, ma = (t, e = "") => { - if (!t || typeof t != "string" || _n(t)) return t; - let i = e; - return !i && typeof window < "u" && window.location && (i = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? i ? `${i}${t}` : t : i ? `${i}/${t}` : t; -}; -var Et, nt, rt, $t; -const vt = class vt { - constructor(...e) { - x(this, nt, []); - x(this, rt, (e) => { - var i; - for (let n of e) Array.isArray(n[0]) ? c(this, rt).call(this, n) : c(this, nt).push(c(i = vt, Et).call(i, n[0], n[1])); - }); - N(this, "toValue", async (e, i = null) => { - const n = { getValue: () => e, getRecord: () => i }; - let r = e; - for (const a of c(this, nt)) try { - const o = await a; - if (typeof o != "function") { - console.warn("middleware is not a function, skip:", o); - continue; - } - r = await o.call(n, r); - } catch (o) { - console.error("middleware error, skip:", o); - } - return r; - }); - N(this, "toRender", (e, i, n = null) => E.createElement(c(this, $t), { value: e, record: i }, n)); - x(this, $t, ({ value: e, record: i, children: n }) => { - const [r, a] = L(n); - return mt(() => { - let o = !1; - return a(n), this.toValue(e, i).then((s) => !o && a(s)).catch((s) => !o && a(`${s}`)), () => o = !0; - }, [e, i]), r; - }); - c(this, rt).call(this, e); - } -}; -Et = new WeakMap(), nt = new WeakMap(), rt = new WeakMap(), $t = new WeakMap(), x(vt, Et, f.memoize((e, i) => { - if (typeof e == "function") return e(i); - if (typeof e == "string") return ue.getWidgetComponent(e).then((n) => { - var r; - return ((r = n.default) == null ? void 0 : r.call(n, i)) || ((a) => a); - }); - throw new TypeError("middleware must be a string or a function"); -}, Kn())); -let kt = vt; -const oe = E.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { -}, getSelectedRows: () => [], onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -}, reload: () => { -}, setPage: () => { -}, setPageSize: () => { -}, setTab: () => { -}, setSider: () => { -}, setKeyword: () => { -}, setCondition: () => { -} }), yi = ({ className: t, record: e, column: i, ...n }) => { - if (i != null && i.editableByJs && (i != null && i.uuid)) { - const { formSetting: r = { primaryKey: "id" }, widgetSetting: a = {}, widgetContainerSetting: o = {} } = (i == null ? void 0 : i.editableByJsSetting) || {}; - return h(P.Popover, { widget: Hn, widgetData: { record: e, column: i }, widgetSetting: { widgetSetting: a, formSetting: r }, widgetContainerProps: { title: i != null && i.title ? `${i.title} - 编辑` : "编辑", ...o, width: (o == null ? void 0 : o.width) || 260, arrow: !0 }, children: h("td", { className: R("ff-data-list-cell-editable", t), ...n }) }); - } - return h("td", { className: t, ...n }); -}, Hn = ({ record: t, column: e, $close: i, $setting: n }) => { - const r = H(qn(f.get(t, e == null ? void 0 : e.dataIndex))), { listCode: a, onClickCallback: o } = pe(oe), [s] = ae.useForm(), { formSetting: l, widgetSetting: d } = n, u = (l == null ? void 0 : l.primaryKey) || "id", p = () => { - s.setFieldsValue({ value: f.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); - }; - return mt(() => p(), [t, e == null ? void 0 : e.dataIndex, a]), h(ee, { actions: j(E.Fragment, { children: [h(P, { size: "small", onClick: p, children: "重置" }), j($n.Compact, { block: !0, children: [h(P, { size: "small", widget: i, children: "取消" }), h(P, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: m }) => { - const g = f.get(t, u.substring(u.indexOf(".") + 1)); - if (!g) throw "获取更新主键失败!"; - I.put(`/api/${a}-storeBy-${e == null ? void 0 : e.uuid}/${g}`, { value: m }).msg(() => o(2, t)).then(i); - }).catch(console.warn), children: "保存" })] })] }), children: j(ae, { form: s, children: [h(ti, { label: "", type: r.current, code: "value", widget: e == null ? void 0 : e.editableByJs, extras: d }), h(Xt, { noStyle: !0, name: ["__PROPS__"], children: () => { - } })] }) }); -}, Jn = (t) => function(e) { - return t(e, getRecord()); -}, Gn = (t, e = {}) => U(() => { - var i; - return (i = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : i.map(({ widgetByJs: n, widgetByJsSetting: r, ...a }, o) => { - const s = (d) => ({ record: d, column: a }); - let l = []; - return n && l.push([n, r]), l.length > 0 ? (a != null && a.render && l.push([Jn, a.render]), { ...a, onCell: s, render: (d, u) => new kt(l).toRender(d, u, "-") }) : { ...a, onCell: s }; - }); -}, [t, e]), Yn = (t = {}) => U(() => { - var e; - return t.body ?? (t.body = { cell: yi }), (e = t.body).cell ?? (e.cell = yi), t; -}, [t]), fa = (t) => { - const [e, i] = L({}); - return V(() => { - let n = !1; - return t && I.get(`/api/_/${t}`).then((r) => f.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((r) => !n && i(r)), () => n = !0; - }, [t]), e; -}, ya = (t, e = {}) => { - const [i, n] = L({ dataSource: [] }); - return ht(() => { - let r = !1; - return t && I.get(`/api/${t}/${I.encode({ page: 1, ...e })}`).then((a) => !r && n(a)), () => r = !0; - }, [t, e]), i; -}, Vi = (t = [], e = /* @__PURE__ */ new Map(), i = "id", n) => { - const r = Y(n ? (a) => f.get(a, i, f.get(a, [n, i])) : (a) => f.get(a, i), [i, n]); - return Y((a) => t == null ? void 0 : t.filter((o) => !o.uuid || !e.has(o.uuid) || e.get(o.uuid).some((s) => s == r(a))), [t, e, r]); -}, Ut = (t = [], e = /* @__PURE__ */ new Map(), i = [], n = "id", r) => { - const a = Y(r ? (o) => f.get(o, n, f.get(o, [r, n])) : (o) => f.get(o, n), [n, r]); - return U(() => { - if (f.isEmpty(t) || !t.some(({ uuid: s }) => Ai.check(s))) return !1; - if (f.isEmpty(e) || f.isEmpty(i)) return !0; - const o = i.map((s) => a(s)); - return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => o.some((d) => d == l))); - }, [t, i, e, a]); -}, Xn = (t, e, i = "id", n = null) => { - const r = Tt(), a = H(!1), o = H(t.dataSource), s = H(t.itemOperationsAccess); - return V(() => (o.current = t.dataSource, s.current = t.itemOperationsAccess, () => a.current = !1), [t.dataSource, t.itemOperationsAccess]), a.current && (t.dataSource = o.current, t.itemOperationsAccess = s.current), [t, (l = 0, d = null) => { - var u, p; - if (a.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); - if (l === 2) { - const m = f.get(d, "__PARENT_ID__", ""), g = f.get(d, i, f.get(d, [n, i], "")), y = f.findIndex(o.current, ["__PARENT_ID__", m]), b = f.findIndex(y > -1 ? f.get(o.current, [y, "children"]) : o.current, [i, g]); - if (b === -1) return (p = t.onReload) == null ? void 0 : p.call(t); - Promise.all([I.get(`/api/${e}/detail/${g}`), I.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([C, S]) => { - const v = f.get(o.current, y > -1 ? [y, "children", b, "children"] : [b, "children"]); - o.current = Pi(o.current, y > -1 ? { [y]: { children: { $splice: [[b, 1, { ...C, children: v }]] } } } : { $splice: [[b, 1, { ...C, children: v }]] }); - const k = new Map(S); - s.current.forEach(($, T) => { - var A; - (A = k.get(T)) != null && A.some((F) => F == g) || s.current.set(T, $.filter((F) => F !== g)); - }), k.forEach(($, T) => { - s.current.has(T) ? s.current.set(T, f.uniq([...s.current.get(T) || [], ...$])) : s.current.set(T, $); - }); - }).then(() => { - a.current = !0, r(); - }); - } - }]; -}, Qn = (t, e) => { - const i = Tt(), n = H(e), r = H(/* @__PURE__ */ new Map()), a = H([]), o = f.throttle((l) => { - a.current = [], I.list(t, f.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: d, condition: u, total: p, tab: m, sider: g, page: y, pageSize: b, operationsAccess: C, dataSource: S }) => { - n.current = { tab: m, condition: u, sider: g, keyword: d, total: p, pageSize: b, page: S != null && S.length ? y : 1 }, a.current = S, r.current = new Map(C), i(); - }); - }, 380, { leading: !1, trailing: !0 }); - mt(() => { - a.current = [], t && o(e); - }, [t, e]); - const s = U(() => f.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword"]), [n.current]); - return Object.assign(s, { onTabChange: (l) => o({ tab: l, page: 1 }), onPageChange: (l, d) => o({ page: l, pageSize: d }), onPageSizeChange: (l) => o({ pageSize: l, page: 1 }), onConditionChange: (l, d) => o({ keyword: d, condition: Pi(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => o({ sider: l, page: 1 }), onKeywordChange: (l) => o({ keyword: l, page: 1 }), itemOperationsAccess: r.current, dataSource: a.current, onReload: o, payload: e == null ? void 0 : e.payload }); -}, Zn = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, isPaginate: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: y, tabs: b, isConditionFormLayout: C, isTreeSider: S, treeSiderConfig: v }) => { - const { classNames: k, onClickCallback: $ } = pe(oe), T = f.pick(y, ["column", "colWidth", "beforeRender", "afterRender", "style"]), A = Vi(l, d, p, u), F = Y((M, z, O) => h(er, { className: R("ff-data-list-framework-item", k == null ? void 0 : k.item), operations: a ? A(z) : [], data: u ? { [u]: z } : z, children: M, onClickCallback: $ }), [u, p, a, $, l, d]); - return j("div", { className: R("ff-data-list-framework", e), children: [h(i.sider, { isTreeSider: S, ...v }), j("div", { className: R("ff-data-list-container", k == null ? void 0 : k.container), children: [h(i.filter, { isConditionFormLayout: C }), h(i.toolbar, { title: m, tabs: b }), h(hr, { ...T, ...g, empty: h(i.empty, { className: k == null ? void 0 : k.empty }), primaryKey: p, itemRender: F, dataSource: n }), h(i.footer, { isPaginate: r, isOperations: o, operations: s })] })] }); -}, er = ({ className: t, operations: e, children: i, data: n, onClickCallback: r }) => j("div", { className: R("data-list-grid-layout-item", t), children: [h("div", { className: "data-list-grid-layout-item-container", children: i }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((a) => h("span", { className: "data-list-grid-layout-item-action", children: h(P.Link, { uuid: a.uuid, type: a.type, name: a.name, widget: a.widget, widgetType: a.widgetType, widgetProps: a.widgetProps, widgetSetting: a.widgetSetting, widgetContainerProps: a.widgetContainerSetting, data: n, confirm: a.confirm, onAfterClick: (o) => o !== !1 && (r == null ? void 0 : r(a.isRefresh, n)) }, a.uuid || Vt()) }, (a == null ? void 0 : a.uuid) || Vt())) })] }), tr = ({ listCode: t, className: e, layouts: i = {}, dataSource: n, columns: r, isItemOperations: a, isBatchOperations: o, batchOperations: s, itemOperations: l, itemOperationsAccess: d, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: y, rowSelection: b, isTreeSider: C, treeSiderConfig: S, isConditionFormLayout: v, ...k }) => { - const { classNames: $, onClickCallback: T } = pe(oe), A = Vi(l, d, p, u), F = Ut(l, d, n, p, u); - return j("div", { className: R("ff-data-table-framework", e), children: [h(i.sider, { isTreeSider: C, ...S }), j("div", { className: R("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(i.filter, { isConditionFormLayout: v }), h(i.toolbar, { title: m, tabs: g }), h(lr, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: n, rowSelection: b, operationRender: F ? (M) => { - var z; - return h("div", { className: "ff-data-table-actions", children: (z = A(M)) == null ? void 0 : z.map((O, D) => h(P.Link, { size: "small", uuid: O.uuid, type: O.type, name: O.name, widget: O.widget, widgetType: O.widgetType, widgetProps: O.widgetProps, widgetData: O.widgetData, widgetSetting: O.widgetSetting, widgetContainerProps: O.widgetContainerSetting, data: M, confirm: O.confirm, onAfterClick: (K) => K !== !1 && (T == null ? void 0 : T(O.isRefresh, M)) }, O.uuid || D)) }); - } : null }), h(i.footer, { isPaginate: y, isOperations: o, operations: s })] })] }); -}, Zt = (t = [], e, i = null) => { - var n; - return (n = f.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i: r, x: a, y: o, w: s, h: l, field: { boxStyle: d, ...u } = {} }, p) => h("div", { className: "grid-layout-item", style: Di(a, o, s, l, d), children: h(e, { ...u, basicForm: i }) }, r ?? p)); -}, Di = (t, e, i, n, r = {}, a = 0) => { - const o = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${i}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; - return r != null && r.autoHeight ? o.height = "fit-content" : o["--grid-layout-row"] = `${n}`, r != null && r.alignItems && (o["--grid-layout-box-align-items"] = r.alignItems), r != null && r.justifyContent && (o["--grid-layout-box-justify-content"] = r.justifyContent), o["--grid-layout-box-margin"] = wi(r == null ? void 0 : r.marginTop, r == null ? void 0 : r.marginRight, r == null ? void 0 : r.marginBottom, r == null ? void 0 : r.marginLeft), o["--grid-layout-box-padding"] = wi(r == null ? void 0 : r.paddingTop, r == null ? void 0 : r.paddingRight, r == null ? void 0 : r.paddingBottom, r == null ? void 0 : r.paddingLeft), a && (o.height = `${a}px`), o; -}, wi = (t, e, i, n) => `${t || 0}px ${e || 0}px ${i || 0}px ${n || 0}px`, wa = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, zi = (t) => Object.keys(t).reduce((e, i) => (/^on[A-Z]/.test(i) && (e[i] = t[i]), e), {}), Wi = ({ className: t, isConditionFormLayout: e }) => { - var m, g; - const [i, n] = L({}), { listCode: r, onKeywordChange: a, onConditionChange: o, getBase62params: s, classNames: l } = E.useContext(oe), { keyword: d, condition: u } = (s == null ? void 0 : s()) || {}, [p] = wt.useForm(); - return V(() => { - r && e && I.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: y, marginX: b, marginY: C, rowHeight: S, cols: v, fields: k }) => { - n({ resource: y, itemMargin: [b, C], rowHeight: S, cols: v, fields: k }); - }).catch(() => n({})); - }, [r, e]), V(() => { - p.setFieldsValue({ keyword: d, ...u }); - }, [JSON.stringify([d, u])]), h("div", { className: R("ff-data-list-filter", l.filter, t), children: h(wt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((m = i.fields) == null ? void 0 : m.length) > 1 ? (y) => o({ [i.resource]: y[i.resource] }, y.keyword) : () => { - }, onValuesChange: (y) => { - f.isEmpty(f.omit(y, ["keyword"])) || p.submit(); - }, children: ((g = i.fields) == null ? void 0 : g.length) > 1 ? h(ii, { ...i, children: h(ir, { onReset: () => { - const { keyword: y, condition: b } = s("init") || {}; - p.setFieldsValue({ keyword: y, ...b }); - } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Di(20, 0, 5, 2), children: h(wt.Item, { name: ["keyword"], children: h(vn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (y) => a(y) }) }) }) }) }) }); -}, ir = ({ cols: t, fields: e, onReset: i }) => { - const [n, r] = L(!1), a = U(() => e == null ? void 0 : e.toReversed().some((o) => o.y > 1 || o.x + o.w >= t - 5), [t, e]); - return j(wt.Item, { label: " ", style: { "--item-span": 5 }, className: R("ff-data-list-filter-actions", { expanded: n }), children: [h(Ct, { onClick: i, children: "重置" }), h(Ct, { type: "primary", htmlType: "submit", children: "查询" }), a && h(P.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((o) => !o), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); -}; -Wi.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; -const nr = ({ className: t, operations: e, isOperations: i, isPaginate: n }) => { - const { onPageChange: r, onPageSizeChange: a, onClickCallback: o, getBase62params: s } = E.useContext(oe), { total: l, page: d, pageSize: u } = (s == null ? void 0 : s()) || {}; - return i && !f.isEmpty(e) || n ? j("div", { className: R("ff-data-list-footer", t), children: [h("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, m) => h(P, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (o == null ? void 0 : o(p.isRefresh, null)) }, p.uuid || m)) }), n && h(xn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${d} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: a })] }) : null; -}, rr = [{ 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: h("span", { style: { color: "#1677ff" }, children: "sss" }), key: "0-0-1-0" }] }] }], ar = ({ className: t, width: e = 280, isTreeSider: i }) => { - const { classNames: n } = pe(oe); - return i ? h(Nn.DirectoryTree, { className: R("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: rr }) : null; -}, or = ({ className: t, title: e, tabs: i }) => { - const { getBase62params: n, onTabChange: r, onReload: a, classNames: o } = pe(oe), { tab: s } = (n == null ? void 0 : n()) || {}, [l, d] = An((i == null ? void 0 : i[0].value) ?? (i == null ? void 0 : i[0].code), { value: s, onChange: r }); - return j("div", { className: R("ff-data-list-toolbar", o.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(Pn, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: m }) => h("span", { onClick: () => d(m ?? p), className: R("ff-data-list-tab", { active: (m ?? p) == l }), children: u }), items: i }), j("div", { className: "ff-data-list-actions", children: [h(P.Link, { icon: "icon-reload", widget: () => a() }), h(P.Link, { icon: "icon-setting" })] })] }); -}, sr = ({ className: t, ...e }) => h(zt, { className: R(t, "ff-data-list-empty"), image: zt.PRESENTED_IMAGE_SIMPLE, ...e }), Bi = ({ isItemGridLayout: t, theme: e, themeProps: i, onClickCallback: n, onReload: r, listCode: a, total: o = 0, page: s = 0, onPageChange: l, pageSize: d = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: y, condition: b, onConditionChange: C, sider: S, onSiderChange: v, layouts: k, classNames: $ = {}, payload: T = {}, dataSource: A = [], rowSelection: F, getSelectedRows: M, primaryKey: z, ...O }) => { - const [D, K] = L(), _ = M ?? (() => A), re = Y((W, se) => { - const J = { tab: p, page: s, pageSize: d, keyword: g, sider: S, condition: b, total: o, payload: T }; - return W && W != "init" ? f.get(J, W, se) : J; - }, [JSON.stringify(b), JSON.stringify(T), p, s, d, g, S, o]), Ne = U(() => { - let W = { sider: ar, filter: Wi, footer: nr, toolbar: or, empty: sr }; - k === !1 ? W = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : f.isPlainObject(k) && (W = Object.assign({}, W, k)); - for (const se in W) if (W[se]) { - if (bn(W[se])) { - const J = W[se]; - W[se] = (Ot) => E.cloneElement(J, Ot); - } - } else W[se] = () => h(E.Fragment, {}); - return W; - }, [k]); - return V(() => { - e ? ue.getWidgetComponent(e).then((W) => { - if (!W) throw `${e} not found`; - return W; - }).catch((W) => ({ default: () => `${W}` })).then((W) => K(E.createElement(W.default, { ...O, layouts: Ne, $setting: i }))) : K(h(t ? Zn : tr, { ...O, layouts: Ne, $setting: i })); - }, [e, i]), h(oe.Provider, { value: { classNames: $, listCode: a, onClickCallback: n, onReload: r, getBase62params: re, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: v, onKeywordChange: y, onConditionChange: C, setPage: l, setPageSize: u, setTab: m, setSider: v, setKeyword: y, setCondition: C, getSelectedRows: _ }, children: D && E.cloneElement(D, { dataSource: A, primaryKey: z, rowSelection: F, ...O }) }); -}; -Bi.propTypes = { classNames: w.exact({ sider: w.string, filter: w.string, footer: w.string, toolbar: w.string, container: w.string, content: w.string, item: w.string, empty: w.string }), layouts: w.oneOfType([w.exact({ sider: w.oneOfType([w.elementType, w.element]), filter: w.oneOfType([w.elementType, w.element]), footer: w.oneOfType([w.elementType, w.element]), toolbar: w.oneOfType([w.elementType, w.element]), empty: w.oneOfType([w.elementType, w.element]) }), w.bool]) }; -var Re, Ee, We, xt; -const fe = class fe { - constructor() { - x(this, Ee, null); - x(this, We, /* @__PURE__ */ new Map()); - x(this, xt, () => { - if (c(this, Ee)) return c(this, Ee).port.postMessage({ command: "status", data: [] }); - B(this, Ee, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), c(this, Ee).port.onmessage = (e) => { - var i, n; - (i = e.data) != null && i.uuid ? c(this, We).forEach((r, a) => { - var o; - (r == "*" || (o = r == null ? void 0 : r.includes) != null && o.call(r, e.data.uuid)) && a(e.data); - }) : ((n = e.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && I.get("/api/user-api-token").then(({ token: r, expire_at: a }) => { - c(this, Ee).port.postMessage({ command: "initWs", data: [`ws${f.trimStart(I.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, c(this, Ee).port.postMessage({ command: "status", data: [] }); - }); - N(this, "subscribe", (e, i = []) => (i ? Array.isArray(i) && i.length == 0 ? i = "*" : Array.isArray(i) || (i = [i].flat()) : i = "*", c(this, We).set(e, i), c(this, We).size == 1 && c(this, xt).call(this), () => this.unsubscribe(e))); - N(this, "unsubscribe", (e) => c(this, We).delete(e)); - if (c(fe, Re)) return c(fe, Re); - } -}; -Re = new WeakMap(), Ee = new WeakMap(), We = new WeakMap(), xt = new WeakMap(), x(fe, Re, null), N(fe, "getInstance", () => (c(fe, Re) || B(fe, Re, new fe()), c(fe, Re))); -let Kt = fe; -const qi = Kt.getInstance(), ei = E.forwardRef(({ listCode: t, base62params: e, className: i, theme: n, themeProps: r, layouts: a, classNames: o, onSelectionChange: s, defaultSelectedRowKeys: l, selectedRowKeys: d }, u) => { - const [{ resource: p, primaryKey: m, batchOperations: g = [], itemOperations: y = [], columns: b = [], themeConfig: C, theme: S, isConditionFormLayout: v = !1, isTreeSider: k, treeSiderConfig: $, isItemGridLayout: T, itemGridLayout: { themeConfig: A, ...F } = {}, title: M, isPaginate: z, tabs: O, selectionType: D }, K] = L({ isItemGridLayout: !1, itemGridLayout: {} }), _ = Qn(t, e), [{ dataSource: re, itemOperationsAccess: Ne, condition: W, tab: se, keyword: J, page: Ot, total: en, pageSize: tn, sider: nn, onConditionChange: rn, onTabChange: an, onKeywordChange: on, onPageChange: sn, onPageSizeChange: ln, onSiderChange: cn, onReload: Ft, payload: dn }, oi] = Xn(_, t, m, p), [un, pn] = Fn([], { defaultValue: l ?? [], value: d }), [si, gn] = L([]), li = Y(() => D ? si : re, [D, si, re]), hn = Ut(y, Ne, re, m), mn = Ut(g); - V(() => { - let X = null; - return t && I.get(`/api/_/${t}`).resp(({ data: Me, res: At }) => { - Me != null && Me.isDynamicRefresh && (X = qi.subscribe(() => Ft(), At)), K(Me); - }).catch(() => K({})), () => X == null ? void 0 : X(); - }, [t]), E.useImperativeHandle(u, () => ({ onReload: Ft, onClickCallback: oi, getSelectedRows: li })); - const fn = { listCode: t, title: M, classNames: o, layouts: a, resource: p, primaryKey: m, theme: n || S, themeProps: r || C, isTreeSider: k, treeSiderConfig: $, isPaginate: z, rowSelection: D ? { type: D, columnWidth: 80, selectedRowKeys: un, onChange: (X, Me) => { - gn((At) => { - const ci = new Map(At.map((le) => [le == null ? void 0 : le[m], le])); - return Me.forEach((le) => ci.set(le == null ? void 0 : le[m], le)), X.map((le) => ci.get(le)).filter(Boolean); - }), pn(X), s == null || s(X, Me); - } } : void 0, getSelectedRows: li, tabs: O, isItemOperations: hn, itemOperations: y == null ? void 0 : y.map((X) => f.isEmpty(X == null ? void 0 : X.confirm) ? X : { ...X, confirm: Object.assign({}, X.confirm, { getPopupContainer: () => document.body }) }), isBatchOperations: mn, batchOperations: g, isItemGridLayout: T, columns: b, itemGridLayout: { ...F, themeProps: A }, isConditionFormLayout: v, itemOperationsAccess: Ne, dataSource: re, onConditionChange: rn, onTabChange: an, onKeywordChange: on, onPageChange: sn, onPageSizeChange: ln, onSiderChange: cn, condition: W, tab: se, keyword: J, page: Ot, total: en, pageSize: tn, sider: nn, payload: dn }; - return h(Bi, { ...fn, className: R("ff-data-list-helper", i), onReload: Ft, onClickCallback: oi }); -}), Ui = (t, e, i = !0) => i !== !0 && i-- <= 0 ? [] : f.isArray(t) && !f.isEmpty(t) ? t.reduce((n, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && n.push(r[e]), Reflect.has(r, "children") && !f.isEmpty(r.children) ? n.concat(Ui(r.children, e, i)) : n), []) : [], lr = ({ className: t, primaryKey: e, columns: i = [], dataSource: n = [], operationRender: r, operationWidth: a = 180, components: o = {}, rowSelection: s, ...l }) => { - const { classNames: d } = pe(oe), u = H(null), p = H(null), [m, g] = L([]), [y, b] = L({ width: 0, height: 0 }); - V(() => { - g(Ui(n, e)); - }, [n, e]), Cn(() => { - const k = new ResizeObserver(() => { - var $; - b({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); - }); - return p.current && k.observe(p.current), () => { - p.current && k.unobserve(p.current); - }; - }, []); - const C = U(() => { - if (!(y != null && y.width) || !(i != null && i.length)) return i; - const k = (s ? s.columnWidth ?? 32 : 0) + (r ? a : 0), $ = i.reduce((F, M) => F + (M.isWidthFixed && M.width ? M.width : 0), 0), T = i.filter((F) => !F.isWidthFixed).reduce((F, M) => F + (M.width ?? 100), 0); - if ($ + T + k >= y.width) return i; - const A = y.width - $ - k; - return i.map((F) => F.isWidthFixed ? F : { ...F, width: Math.floor(A * (F.width ?? 100) / T) }); - }, [i, y.width, s, r, a]), S = Gn(C), v = Yn(o); - return h("div", { ref: p, className: R("ff-data-list-table", d.content, t), children: y.height ? h(hi, { bordered: !0, ...l, components: v, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { - var $, T; - const k = [...S ?? []]; - return s && k.splice((T = ($ = k[0]) == null ? void 0 : $.key) != null && T.startsWith("__") ? 1 : 0, 0, hi.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", width: `${Math.ceil(a / y.width * 100).toFixed(2)}%`, render: (A, F, M) => r(F, M) }), k; - })(), dataSource: n, size: "middle", scroll: { x: "max-content", y: y.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: m } }) : null }); -}, cr = "RC_FORM_INTERNAL_HOOKS", dr = (t) => { - const [e, i] = E.useState({ items: [] }); - return V(() => { - t && I.get(`/api/_/${t}`).then(({ uuid: n, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, fields: m, theme: g, themeSetting: y, groups: b }) => ({ uuid: n, code: r, name: a, resource: o, primaryKey: s, marginX: l, marginY: d, cols: u, rowHeight: p, theme: g, themeProps: y, groups: b, items: m })).then(i); - }, [t]), e; -}, ur = (t, { initialValue: e, initialValueLanguage: i, convertJs: n, convertJsSetting: r, type: a = "string" }, o = null) => { - const s = H(!1), l = pe(Ni), [d, u] = L(), [p, m] = L(i != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(cr) || {}; - return V(() => g == null ? void 0 : g((y, b, C) => { - if (!s.current) return; - const S = f.get(b, t); - f.isEqual(S, p) || m(de(S, a)); - }), [p]), V(() => { - i == "javascript" && e ? Ie.exec(e, {}, { getFieldValueForBasicForm: (y) => o ? o.getFieldValue(y) : l.getFieldValue(y), getFieldValue: (y) => l.getFieldValue(y) }).then((y) => m(de(y, a))).catch((y) => notification.error({ message: `布局数据错误: ${JSON.stringify(y)}` })).finally(() => s.current = !0) : (e && m(de(e ?? l.getFieldValue(t), a)), s.current = !0); - }, [e, i]), ht(() => { - s.current && n && new kt([n, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((y) => { - u(y), console.error("布局数据转换错误: ", y, n); - }); - }, [p, n, r]), [d ?? p, p]; -}, ba = (t, e, i = null) => U(() => Zt(t, e, i), [t]), Ki = (t, e, i = {}, n = {}, r = {}, a = null) => { - const o = pe(Ni), s = Tt(), l = H(!0), d = H([]), [u, p] = L(e), [m, g] = L(), y = ae.useWatch((b) => JSON.stringify(f.pick(b, d.current)), o) || "{}"; - return mt(() => { - t && Ie.exec(t, i, { ...n, getFieldValueForBasicForm: (b) => r ? r.getFieldValue(b) : null, getFieldValue: f.wrap(o.getFieldValue, (b, C) => (d.current.some((S) => f.isEqual(S, C)) || (d.current.push(C), s()), b == null ? void 0 : b(C))), isFieldTouched: o.isFieldTouched, isFieldsTouched: o.isFieldsTouched }).then((b) => { - l.current && (p(b), g(null)); - }).catch((b) => { - l.current && (p(e), g(b)); - }); - }, [t, y, o, i, n]), V(() => () => l.current = !1, []), t ? [a ? de(u, a) : u, m] : [a ? de(e, a) : e, null]; -}, pr = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: i, ...n }) => { - const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [a, o] = L(); - return V(() => { - r && ue.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: gr(l, s, i) })).catch((s) => ({ default: () => `${s}` })).then((s) => o(E.createElement(s.default, n))); - }, [r]), a; -}, gr = (t, e = {}, i = null) => (n) => { - const { code: r, label: a, extras: o, isVirtual: s, initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, value: m, ...g } = f.merge({}, e, n), [y, b] = ur(s ? null : r, { initialValue: l, initialValueLanguage: d, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, i), C = U(() => { - const k = Object.keys((e == null ? void 0 : e.extras) || {}); - return f.over([f.partialRight(f.pick, k), f.partialRight(f.omit, k)]); - }, [e == null ? void 0 : e.extras]), [S, v] = C(g); - return h(t, { ...v, value: y, rawValue: b, $setting: Object.assign({}, o, S) }); -}, _i = ({ theme: t, basicForm: e, items: i = [{ key: "default", label: "默认" }], fields: n = [], itemRender: r, chunks: a = [], children: o, $setting: s = {}, ...l }) => { - const [d, u] = L(); - V(() => { - t ? ue.getWidgetComponent(t).then((m) => { - if (!(m != null && m.default)) throw "not found"; - return m; - }).catch((m) => ({ default: () => `${t} ${m}` })).then((m) => u(E.createElement(m.default, {}))) : u(null); - }, [t]); - const p = U(() => i == null ? void 0 : i.map((m) => ({ ...m, children: r(m, n == null ? void 0 : n.filter((g) => !(g != null && g.group) && m.key == "default" || g.group == m.key), m.key == "default" ? o : null) })).concat(a), [i, o, a]); - return d && E.cloneElement(d, { items: p, basicForm: e, $setting: { ...s, ...l } }); -}, Hi = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: a = 12, rowHeight: o = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: d = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: y = {}, groups: b = [{ key: "default", label: "默认" }], children: C, ...S }) => { - const [v] = ae.useForm(e), k = U(() => [{ name: "__PROPS__", value: d }].concat(u), [d, u]); - ht(() => (v.setFieldsValue(m), () => v.resetFields()), [m]); - const $ = (T, A, F) => { - const M = Zt(A, pr, i), z = zi(S); - return j("div", { ...z, className: R("ff-grid-layout", r), style: { ...n, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [M, F && E.cloneElement(F, { cols: a, rowHeight: o, itemMargin: l, containerPadding: s, fields: A, basicForm: i })] }); - }; - return h(ae, { ...S, fields: k, form: v, component: !1, children: g ? h(_i, { ...y, items: b, theme: g, itemRender: $, fields: p, children: C, basicForm: i }) : $(0, p, C) }); -}, Ca = /* @__PURE__ */ ((t) => function({ code: e, data: i, ...n }) { - const { uuid: r, resource: a, items: o, hides: s, rowHeight: l, marginX: d, marginY: u, cols: p, theme: m, themeProps: g, groups: y } = dr(e) || {}, b = U(() => [{ name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, a]); - return a && h(t, { name: e, theme: m, themeProps: g, groups: y, ...n, fields: o, formFields: b, rowHeight: l, cols: p, itemMargin: [d, u], data: a ? { [a]: i } : i }); -})(Hi), hr = ({ column: t = 0, colWidth: e = 0, cols: i, rowHeight: n, itemMargin: r, fields: a, primaryKey: o, dataSource: s, beforeRender: l = null, afterRender: d = null, itemClassName: u, itemRender: p = (v, k, $) => v, empty: m = h(zt, { description: null }), className: g, style: y = {}, theme: b, themeProps: C = {}, groups: S = [{ key: "default", label: "默认" }] }) => { - const { classNames: v } = pe(oe), k = U(() => h(Hi, { groups: S, theme: b, themeProps: C, cols: i, rowHeight: n, itemMargin: r, fields: a, className: u }), [a, i, n, r, S, b, C]), $ = f.isEmpty(s); - return j("div", { className: R("ff-data-list-content", v.content, g), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [l == null ? void 0 : l(s), $ ? m : s.map((T, A) => { - const F = p(E.cloneElement(k, { data: T }), T, A); - return E.cloneElement(F, { key: `${(T == null ? void 0 : T[o]) ?? A}-${Un(T)}` }); - }), d == null ? void 0 : d(s)] }); -}, mr = ({ component: t, $props: e }) => { - const { base62params: i } = gt(e, {}); - return h(ee, { children: h(ei, { listCode: t, base62params: I.decode(i) }) }); -}, ka = () => h(Ji, {}), Ji = () => "Empty", fr = ({ component: t, $setting: e, $props: i }) => { - const [n, r] = L(); - V(() => { - if (!t) return r(h(Ji, { description: null })); - ue.getWidgetComponent(t).catch((o) => ({ default: () => `${o}` })).then((o) => E.createElement(o.default, { $setting: e })).then(r); - }, [t]); - const a = gt(i, {}); - return n ? E.cloneElement(n, a) : null; -}, Sa = () => "NotFoundPage"; -var Oe, ce, Fe, Ae, at, ot; -const ye = class ye { - constructor() { - x(this, ce, /* @__PURE__ */ new Map()); - x(this, Fe, {}); - x(this, Ae, null); - N(this, "init", (e, i) => { - B(this, ce, e), B(this, Fe, i); - }); - N(this, "get", (e) => (c(this, ce).has(e) || (e = Array.from(c(this, ce).keys()).find((i) => c(this, ce).get(i).uri === e)), c(this, ce).get(e) || {})); - N(this, "redirect", (e, i, n = {}) => { - const { uri: r, type: a, widgetProps: o } = this.get(e) || {}, { router: s, query: l, ...d } = i || {}, u = Object.assign({}, d, s), p = Object.assign({}, d, l); - a == "list" && (u.base62params = I.encode(u != null && u.base62params ? u.base62params : u)); - let m = jn(r || e, u); - const g = new URLSearchParams(); - for (const y in o || {}) (o == null ? void 0 : o.type) == "query" && Object.has(p, y) && g.append(y, JSON.stringify(p[y])); - return g.size > 0 && (m = `${m}?${g.toString()}`), n != null && n.isOpenWindow ? window.open(m) : c(this, Ae).navigate(m, { replace: !!(n != null && n.isReplaceRouteHistory) }); - }); - N(this, "getMenus", (e) => { - var i; - return ((i = c(this, Fe)) == null ? void 0 : i[e]) || []; - }); - N(this, "findMenuPathByUuid", (e) => { - let i = []; - for (const n in c(this, Fe)) if (i = c(this, at).call(this, c(this, Fe)[n], e, [n]), i.length > 1) return i; - return i; - }); - N(this, "getMenusByRouteUuid", (e) => c(this, ot).call(this, e, Object.values(c(this, Fe)).flat())); - x(this, at, (e, i, n = []) => { - if (f.isEmpty(e)) return n; - for (const { uuid: r, children: a } of e) { - if (r == i) return n.concat(r); - if (!f.isEmpty(a)) return n.concat(r, c(this, at).call(this, a, i)); - } - return n; - }); - x(this, ot, (e, i) => { - var r; - let n = []; - for (const a of i) a.widgetType == "redirect" && (a.uuid == e || a.widget == e ? n.push(a) : (r = a.children) != null && r.length && (n = n.concat(c(this, ot).call(this, e, a.children)))); - return n; - }); - N(this, "getCurrentMenu", () => { - const { uuid: e } = this.getCurrentRoute() || {}; - if (!e) return; - const i = this.getMenusByRouteUuid(e); - return f.isEmpty(i) ? void 0 : i[0]; - }); - N(this, "getCurrentRoute", (e = 0) => { - var n; - const i = (n = c(this, Ae).state.matches[c(this, Ae).state.matches.length - 1 - e]) == null ? void 0 : n.route; - if (!i) return null; - for (let [r, a] of c(this, ce)) if (a.uri === i.path) return a; - return null; - }); - N(this, "getPageParams", (e) => { - var r, a, o; - let i = "", n = {}; - if (Ti()) n = Ln(), i = (r = In()) == null ? void 0 : r.search; - else { - const { location: s = {}, matches: l = [] } = ((a = c(this, Ae)) == null ? void 0 : a.state) || {}; - n = ((o = l[l.length - 1]) == null ? void 0 : o.params) || {}, i = s.search; - } - return i && new URLSearchParams(i).forEach((s, l) => { - n[l] = s; - }), e ? f.get(n, e) : n; - }); - N(this, "createBrowserRouter", (e = {}) => { - if (c(this, ce).size == 0) return null; - const i = qe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = qe.get(ue.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [i]: 0 }, a = (s, l) => () => Promise.all([ue.getWidgetComponent(s), gt(l)]).then(([d, u]) => [d.default || function() { - return `${s}`; - }, u]).then(([d, u]) => ({ Component: () => E.createElement(Oi, {}, E.createElement(d, { $setting: u })) })), o = Array.from(c(this, ce).values()).reduce((s, { uuid: l, uri: d, name: u, type: p, component: m, widgetSetting: g, widgetProps: y, isLogin: b, isLayout: C, extra: S }) => { - let v = {}, k = 0; - switch (p) { - case "list": - v.element = E.createElement(mr, { component: m, $props: y }); - break; - case "fsdpf-component": - v.element = E.createElement(fr, { key: m, component: m, $setting: g, $props: y }); - } - const $ = (S == null ? void 0 : S.theme) ?? (S == null ? void 0 : S.layout); - if ($) { - const T = (S == null ? void 0 : S.themeProps) ?? (S == null ? void 0 : S.layoutProps); - if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: a($, T), children: [{ path: d, ...v }] }]; - k = r[$]; - } - return C && k > -1 ? (s[k].children.push({ path: d, ...v }), s) : [...s, { path: d, ...v }]; - }, [{ path: "/", lazy: a(i, {}), children: [] }]); - return o.push({ index: !0, element: E.createElement(yr, { to: n, replace: !0 }) }), B(this, Ae, Mn(o, e)); - }); - if (c(ye, Oe)) return c(ye, Oe); - } -}; -Oe = new WeakMap(), ce = new WeakMap(), Fe = new WeakMap(), Ae = new WeakMap(), at = new WeakMap(), ot = new WeakMap(), x(ye, Oe, null), N(ye, "getInstance", () => (c(ye, Oe) || B(ye, Oe, new ye()), c(ye, Oe))); -let _t = ye; -const yr = ({ to: t, replace: e }) => Ti() ? E.createElement(Vn, { to: t, replace: e }) : (window.document.location = t, "redirect"), xe = _t.getInstance(), Ue = new Worker(new URL("/ff-worker/index.js", self.location)), bi = { getConfigure: (t) => qe.get(t), route: { redirect: (...t) => xe.redirect(...t), getPageParams: (...t) => xe.getPageParams(...t), getCurrentRoute: () => xe.getCurrentRoute() }, popup: { notification: (...t) => ne.notification(...t), success: (...t) => ne.success(...t), error: (...t) => ne.error(...t), form: (...t) => ne.form(...t), modal: (...t) => ne.modal(...t), confirm: (...t) => ne.confirm(...t) } }; -var Nt, Je, je; -const q = class q { - constructor() { - N(this, "exec", (e, i = {}, n = {}, r = "") => new Promise((a, o) => { - if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return a(); - const s = pi(q, Nt)._++; - c(q, Je).set(s, n), q.mQueue.set(s, [a, o]), Ue.postMessage({ id: s, session: r, category: "eval", method: e, args: i }); - })); - N(this, "clear", (e) => Ue.postMessage({ session: e, category: "clear" })); - if (c(q, je)) return c(q, je); - Promise.resolve().then(() => qr).then((e) => { - bi.http = e.http; - }), Ue.addEventListener("message", ({ data: { id: e, task_id: i, method: n, args: r, category: a, data: o, error: s, session: l } }) => { - if (a === "eval" && q.mQueue.has(e)) s !== null ? q.mQueue.get(e)[1](s) : q.mQueue.get(e)[0](o), c(q, Je).delete(e), q.mQueue.delete(e); - else if (a === "util") try { - const d = f.get(bi, n.split("/")) || f.get(c(q, Je).get(i), n.split("/")); - if (!f.isFunction(d)) throw `${n} not found`; - Promise.resolve(Reflect.apply(d, void 0, r)).then((u) => { - Ue.postMessage({ id: e, task_id: i, category: a, method: n, args: r, session: l, data: u, error: null }); - }).catch((u) => { - Ue.postMessage({ id: e, task_id: i, category: a, method: n, args: r, session: l, data: null, error: u }); - }); - } catch (d) { - Ue.postMessage({ id: e, task_id: i, category: a, method: n, args: r, session: l, data: null, error: d }); - } - }, !1); - } -}; -Nt = new WeakMap(), Je = new WeakMap(), je = new WeakMap(), N(q, "mQueue", /* @__PURE__ */ new Map()), x(q, Nt, 0), x(q, Je, /* @__PURE__ */ new Map()), x(q, je, null), N(q, "getInstance", () => (c(q, je) || B(q, je, new q()), c(q, je))); -let Ht = q; -const Ie = Ht.getInstance(), Tt = () => { - const t = H(!0), [, e] = E.useReducer((i) => i + 1, 0); - return V(() => () => t.current = !1, []), () => t.current && e(); -}, Ea = (t) => { - const e = H(); - return V(() => { - e.current = t; - }, [t]), e.current; -}, $a = (t) => { - const [e, i] = L(t), n = H(null), r = Y((a, o) => { - n.current = o, i(a); - }, []); - return V(() => { - n.current && (n.current(e), n.current = null); - }, [e]), [e, r]; -}, ht = (t = (n) => { -}, e, i = f.isEqual) => { - const n = E.useRef(); - i(e, n.current) || (n.current = f.cloneDeep(e)), E.useEffect(t, [n.current]); -}, mt = ht, Gi = (t, e = "string") => { - var i; - if (!Array.isArray(t)) return t; - for (let n = 0; n < t.length; n++) t[n].value = de((i = t[n]) == null ? void 0 : i.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = Gi(t[n].children, e)); - return t; -}, va = (t, e = "json", i = "string", n, r = null) => { - const [a] = ae.useForm(n), [o, s] = L([{ label: "无", value: "", disabled: !0 }]), l = H([]), d = ae.useWatch((u) => l.current.length === 0 ? null : f.pick(u, l.current), a) || null; - return V(() => { - Array.isArray(t) ? s(t) : e === "javascript" && t ? Ie.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), a.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : a.getFieldValue(u)) }).then((u) => { - s(de(u, "array")); - }).catch((u) => console.error("useOptions", u)) : t && s(de(t, "array")); - }, [t, e, d]), Gi(o, i); -}, xa = (t) => { - const [e, i] = L(), n = { type: "GET" }; - if (typeof t == "string" ? n.url = t : f.isPlainObject(t) && Object.assign(n, t), !(n != null && n.url)) throw "url is required"; - const r = (a) => I.request(n, !1).resp((o) => (console.log("useSubscribeRequest", a), i(o), o)); - return ht(() => { - let a = null; - return r().then((o) => { - a = qi.subscribe(f.throttle(r, 180, { leading: !1, trailing: !0 }), o.res); - }), () => a == null ? void 0 : a(); - }, n), e; -}, wr = (t) => { - const [e, i] = E.useState({ items: [], hides: [] }); - return E.useEffect(() => { - t && I.get(`/api/_/${t}`).then(({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: y, theme: b, themeSetting: C, groups: S }) => ({ pk: n, uuid: r, code: a, resource: o, align: s, cols: l, rowHeight: d, marginX: u, marginY: p, theme: b, themeProps: C, groups: S, listenChangeFields: m, listenChangeFieldsFunc: g, ...y.reduce((v, k) => { - var $; - return ($ = k == null ? void 0 : k.field) != null && $.hidden ? v.hides.push(k == null ? void 0 : k.field) : v.items.push(k), v; - }, { items: [], hides: [] }) })).then(i); - }, [t]), e; -}, br = ({ max: t = 0, min: e = 0, type: i = "", message: n, pattern: r, required: a = !1, validator: o } = {}, s, l) => { - const [d, u] = L([]); - return V(() => { - const p = []; - if (a) { - let m = l; - switch (l) { - case "number": - case "string": - case "array": - break; - case "bool": - m = "boolean"; - break; - case "json": - m = "object"; - } - p.push({ type: m, required: !0, whitespace: !0, message: "该项必填" }); - } - switch (i) { - case "string": - p.push({ type: i, max: t, min: e, message: n || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); - break; - case "pattern": - p.push({ type: "string", pattern: r, message: n }); - break; - case "validator": - o && p.push(({ getFieldValue: m }) => ({ validator: async (g, y) => { - const b = await Ie.exec(o, { value: y, fieldName: s }, { getFieldValue: m }); - return f.isString(b) && b ? Promise.reject(b) : f.isBoolean(b) && !b ? Promise.reject(n) : Promise.resolve(); - } })); - } - u(p); - }, [t, e, i, n, r, a, o]), d; -}, Cr = (t, e, i) => { - const [n, r] = L(null); - return V(() => { - const { initDataUri: a = `/api/${t}`, initDataMethod: o = "GET" } = i || {}; - e && I.request({ method: o, url: f.trimEnd(`${a}/${e}`, "/") }).then((s) => { - r(s); - }); - }, [t, e, i]), n; -}, kr = (t, e, i) => Y((n, r = { serialize: (a) => a, onSuccess: () => { -}, onFail: (a) => (a == null ? void 0 : a.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => { - const a = n.getFieldValue("__RESOURCE__"), { submitDataUri: o = `/api/${t}`, submitDataMethod: s = "POST" } = i || {}; - return n.validateFields().then((l) => a ? f.pick(l, [a]) : l).then(r.serialize).then((l) => I.request({ method: s, url: f.trimEnd(`${o}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); -}, [t, e, i]), Sr = (t, e, i, n) => { - const r = Cr(e, i, n); - V(() => { - r ? t.setFieldsValue(r) : t.resetFields(); - }, [t, r]); - const a = kr(e, i, n); - return f.partial(a, t); -}, Er = (t, e, i = [], n = {}) => { - const r = H({}), a = H(), o = f.debounce(Tt(), 180), s = ["disabled", "required"], l = (m, g) => { - s.includes(m) && (r.current[m] = g), o(); - }, d = U(() => ({ setDisabled: (m) => l("disabled", m), setRequired: (m) => l("required", m), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = Ki(e, -1, {}, d, n); - if (!p && a.current != u && (u >= 0 || !f.isEmpty(i == null ? void 0 : i[u]))) { - a.current = u; - const { widget: m, widgetPrefix: g, props: y } = i == null ? void 0 : i[u]; - t = ji(m, g), r.current = f.merge(y, f.pick(r.current, s)); - } - return [t, r.current]; -}, Ci = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Na = ({ value: t, onChange: e }, i = null) => { - const n = H(), [r] = ae.useForm(i), a = H({}); - return mt(() => { - f.isEqual(n.current, t) || r.setFieldsValue(t); - }, [t]), V(() => () => r.resetFields(), []), [U(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (o) => (s) => { - const l = Ci(o); - s ? a.current[l] = s : delete a.current[l]; - } }, scrollToField: (o, s = {}) => { - console.warn("useMergedFormValuesChange scrollToField not work, unreferenced antd form"); - }, focusField: (o) => { - console.warn("useMergedFormValuesChange focusField not work, unreferenced antd form"); - }, getFieldInstance: (o) => { - const s = Ci(o); - return a.current[s]; - } }, [r]), (o, s) => { - n.current = s, e == null || e(s); - }]; -}, ti = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: i, subWidgets: n = [], basicForm: r, ...a }) => { - const o = ji(t, e), [s, l] = Er(o, i, n, r), [d, u] = L(); - return V(() => { - s && ue.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: $r(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(E.createElement(p.default, a))); - }, [s]), d && E.cloneElement(d, { ...a, ...l }); -}, $r = (t, e = {}, i = null) => (n) => { - const { type: r, code: a, label: o, noStyle: s, style: l, placeholder: d, required: u = !1, extras: p, validators: m, help: g, isVirtual: y, $isReserved: b, initialValue: C, initialValueLanguage: S, ...v } = f.omit(f.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = br(Object.assign({}, m, u ? { required: !0 } : {}), a, r), $ = U(() => { - const z = Object.keys((e == null ? void 0 : e.extras) || {}); - return f.over([f.partialRight(f.pick, z), f.partialRight(f.omit, z)]); - }, [e == null ? void 0 : e.extras]), [T, A] = $(v), F = { label: o, noStyle: s, style: l, colon: !1, layout: "vertical" }, M = Y((z) => z == null ? void 0 : de(z, r), [r]); - return h(Xt, { name: a, rules: k, initialValue: M(C), normalize: M, children: (z, O, D) => { - var K; - return h(t, { type: r, rcform: D, basicForm: i, itemProps: { validateStatus: O.errors.length > 0 ? "error" : "success", tooltip: g || null, help: O.errors.length > 0 ? O.errors.join("、") : null, required: ((K = k == null ? void 0 : k[0]) == null ? void 0 : K.required) || !1, ...F }, fieldProps: { placeholder: d, ...A, ...z }, $setting: Object.assign({}, p, T) }); - } }); -}, ii = ({ name: t, form: e = null, basicForm: i = null, style: n = {}, className: r, cols: a = 24, rowHeight: o = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: d = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: y, listenChangeFieldsFunc: b, onValuesChange: C, theme: S, themeProps: v = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...T }) => { - const [A] = ae.useForm(e), F = Y((O, D) => { - C == null || C(O, D), b && Array.isArray(y) && Ie.exec(b, { changedValues: O, allValues: D }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((K) => console.error("onFormValuesChange", t, K)); - }, [t, A, C, y, b]), M = U(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), z = (O, D, K) => { - const _ = Zt(D, ti, i), re = zi(T); - return j("div", { ...re, className: R("ff-grid-layout-form", r), style: { ...n, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": a, "--grid-layout-row-height": `${o}px` }, children: [_, K && E.cloneElement(K, { cols: a, rowHeight: o, itemMargin: s, containerPadding: l, fields: D, basicForm: i })] }); - }; - return j(ae, { ...T, form: A, fields: M, onValuesChange: F, children: [S ? h(_i, { ...v, items: k, theme: S, itemRender: z, fields: d, children: $, basicForm: i }) : z(0, d, $), u == null ? void 0 : u.map((O) => { - var D; - return h(Xt, { name: O.code, children: h(vr, { form: A, basicForm: i, name: O.code, type: O.type, initialValue: O.initialValue, initialValueLanguage: (D = O.extras) == null ? void 0 : D.initialValueLanguage }) }, JSON.stringify(O.code)); - })] }); -}, vr = ({ type: t, initialValue: e, initialValueLanguage: i, onChange: n, basicForm: r }) => { - const [a, o] = Ki(i == "javascript" && e, i == "javascript" ? void 0 : e, {}, {}, r); - return V(() => { - i == "javascript" ? n(de(a, t)) : e && n(de(e, t)); - }, [t, e, a]), null; -}; -ii.propTypes = { fields: w.array, hides: w.array }; -const xr = /* @__PURE__ */ ((t) => ({ code: e, isPreview: i = !1, ...n }) => { - const { align: r, autoComplete: a, resource: o, items: s, hides: l, rowHeight: d, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: y, pk: b, uuid: C, theme: S, themeProps: v, groups: k } = wr(e), $ = U(() => [{ name: "__PK__", value: b }, { name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: C }], [b, e, C, o]); - return h(t, { name: e, autoComplete: a, theme: S, themeProps: v, groups: k, ...n, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: y, fields: s, hides: l, cols: m, rowHeight: d, itemMargin: [u, p] }); -})(ii), Yi = ({ $setting: t, $close: e, extras: i, code: n, primaryKey: r, ...a }) => { - const [o] = ae.useForm(), s = Sr(o, n, r, t); - return h(ee, { actions: j(E.Fragment, { children: [h(P, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(P, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: i, children: h(xr, { form: o, code: n, primaryKey: r, ...a }) }); -}, ki = /* @__PURE__ */ new Set(), Jt = (t = [], e = 0) => { - const i = t[e]; - if (i.length && !ki.has(i)) { - const n = document.createElement("script"); - n.setAttribute("src", i), n.setAttribute("data-namespace", i), t.length > e + 1 && (n.onload = () => { - Jt(t, e + 1); - }, n.onerror = () => { - Jt(t, e + 1); - }), ki.add(i), document.body.appendChild(n); - } -}, St = ({ className: t, type: e, style: i = {}, ...n }) => h("span", { role: "img", className: R("ff-iconfont", t), style: i, ...n, children: h("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: h("use", { xlinkHref: `#${e}` }) }) }); -St.propTypes = { className: w.string, type: w.string.isRequired, style: w.object }, St.init = Jt; -const Nr = (t, e, i, n) => xe.redirect(i, e, n), Pr = (t, e = {}, i, n = {}) => { - var a; - const r = (a = n.router) == null ? void 0 : a.reduce((o, [s, l, d]) => { - const u = f.get(e, ["router", s]); - if (!u && u !== 0 && l) throw `请传入 ${d}`; - return `${o}/${u}`; - }, `/api/${i}`); - return I.del(r, e.param).msg(); -}, Si = (t, e, i, { status: { loading: n, disabled: r }, setStatus: a, listFn: o }) => { - const s = { loading: (l) => l === void 0 ? n : a((d) => ({ ...d, loading: l })), disabled: (l) => l === void 0 ? r : a((d) => ({ ...d, disabled: l })), list: o }; - return f.isFunction(i) ? i.call(null, e, s) : f.isString(i) && i ? Ie.exec(i, e, s) : null; -}, Ei = (t, e, i, n, r) => f.isString(i) && i ? ue.getWidgetComponent(i).then(({ default: a }) => ne.modal(a, { ...e, $setting: n }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r)).catch((a) => { - ne.error(i, { content: a.toString() }); -}) : ne.modal(i, { ...e, $setting: n }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r), Tr = (t, e, i, n, r) => ne.modal(Yi, { ...e, $setting: n, code: i }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r), Rr = (t, e, i, n, r) => ne.modal(ei, { base62params: e, $setting: n, listCode: i }, r != null && r.title ? { ...r, title: f.template(r.title)(t) } : r), Or = ({ widget: t, widgetType: e, widgetData: i, widgetProps: n, widgetSetting: r, widgetContainerProps: a }, { onAfterClick: o, onBeforeClick: s } = {}) => { - const l = pe(oe), [d, u] = L({ leading: !0, trailing: !1 }), p = U(() => { - switch (e) { - case "redirect": - return f.partialRight(Nr, t, r); - case "func": - return f.partialRight(Si, (r == null ? void 0 : r.code) ?? t, { status: d, setStatus: u, listFn: l }); - case "component": - case "fsdpf-component": - return f.partialRight(Ei, t, r, a); - case "grid-layout-form": - return f.partialRight(Tr, t, r, a); - case "data-list": - return f.partialRight(Rr, t, r, a); - case "destroy": - return f.partialRight(Pr, t, r, a); - default: - if (ri(t) || E.isValidElement(t)) return f.partialRight(Ei, t, r, a); - if (f.isFunction(t)) return f.partialRight(Si, (r == null ? void 0 : r.code) || t, { status: d, setStatus: u }); - } - return (...m) => console.error("useButton unknown widgetType", e, ...m); - }, [t, e, l.getBase62params, l.getSelectedRows]); - return [f.debounce((m) => (s == null || s(m), Promise.resolve(gt(n, m, { list: l })).then((g) => p(m, { ...i, ...g })).then((g) => o == null ? void 0 : o(g)).catch(console.error)), 300, { leading: !0, trailing: !1 }), d]; -}, Xi = ({ type: t, name: e, className: i, icon: n, iconPosition: r, size: a }, o = "default") => U(() => { - const s = { type: "primary", className: R("ff-button", i), iconPosition: r, size: a }; - return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), o === "link" || o === "dashed" ? (s.type = o, t === "default" && (s.className = R(s.className, "ff-default"))) : o !== "circle" && o !== "round" || (s.shape = o), n && (s.icon = h(St, { type: n })), e && (s.children = e), s; -}, [o, t, i, n, r]), Rt = ({ data: t, widget: e, widgetType: i = "fsdpf-component", widgetData: n, widgetProps: r, widgetSetting: a, widgetContainerProps: o, onAfterClick: s, onBeforeClick: l, children: d, extras: u }) => { - const p = pe(oe), [m, g] = L(!1), [y, b] = L("hover"), [C, S] = L({}), [v, k] = L(), { placement: $, align: T, zIndex: A, arrow: F = { pointAtCenter: !0 }, getPopupContainer: M, isPopupMountBodyContainer: z = !0, ...O } = o || {}; - V(() => { - i == "grid-layout-form" ? k(E.createElement(Yi, { ...n, $setting: a, code: e })) : i == "data-list" ? k(E.createElement(ei, { base62params: t, $setting: a, listCode: e })) : f.isString(e) ? ue.getWidgetComponent(e).then(({ default: _ }) => { - k(E.createElement(_, { ...n, $setting: a })); - }).catch((_) => k(_.toString())) : ri(e) ? k(E.createElement(e, { ...n, $setting: a })) : E.isValidElement(e) && k(E.cloneElement(e, { ...n, $setting: a })); - }, [e, i, n]), V(() => { - Promise.resolve(gt(r, t, { list: p })).then(S); - }, [r, t, p.getBase62params, p.getSelectedRows]); - const D = (_, re = !1) => (g(_), !_ && b("hover"), _ ? l == null ? void 0 : l(C) : s == null ? void 0 : s(re)), K = (_) => { - g(!0), b("click"); - }; - return h(Tn, { zIndex: A, placement: $, onPopupClick: K, onClick: K, open: m, align: T, arrow: F, trigger: y, getPopupContainer: M || z ? void 0 : (_) => _, content: h(Fr, { ...O, extras: u, children: v && E.cloneElement(v, { ...C, $close: (_) => D(!1, _) }) }), children: d, onOpenChange: D }); -}, Fr = ({ title: t, className: e, classNames: i, children: n, extras: r, width: a, height: o, ...s }) => { - const [l, d] = L({}), u = Y((y, b) => d((C) => ({ ...C, [y]: b })), []), p = Y((y) => d((b) => ({ ...b, [y]: void 0 })), []), m = t ? E.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? E.createElement("div", { className: "ff-popup-reserved-extras" }, r); - return h(pt.Provider, { value: { ele: l, mount: u, unmount: p }, children: j("div", { className: R("ff-popup ff-popover", e, l.rootClassName), style: { width: a ?? 260, height: o }, ...s, children: [j("div", { className: R("ff-popup-header", "ff-popover-header", i == null ? void 0 : i.header), children: [m, l == null ? void 0 : l["sub-title"]] }), h("div", { className: R("ff-popup-body", "ff-popover-body", i == null ? void 0 : i.body), children: n }), j("div", { className: R("ff-popup-footer", "ff-popover-footer", i == null ? void 0 : i.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); -}; -Rt.propTypes = { widgetType: w.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const ft = (t) => function({ className: e, variant: i, children: n, name: r, icon: a, type: o = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: d, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: y, confirm: b, widget: C = () => { -}, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: T, ...A }) { - const { mode: F, ...M } = T || {}, z = Xi({ className: e, name: r, type: o, icon: a, iconPosition: s }, i ?? t), O = h(Ct, { ...z, ...A, children: n || r }); - if (F === "popover" && !["destroy", "redirect", "func"].includes(S)) return h(Rt, { data: p, widget: C, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: M, onAfterClick: d, onBeforeClick: u, children: O }); - const D = f.isEmpty(y) || !y.enabled ? {} : y, K = f.isEmpty(b) ? { enabled: !1 } : Object.assign({ enabled: !0 }, b), [_, re] = L(!1), [Ne, { disabled: W, loading: se }] = Or({ widget: C, widgetType: S, widgetData: v, widgetProps: k, widgetSetting: $, widgetContainerProps: M }, { onAfterClick: d, onBeforeClick: u }); - return h(Rn, { okText: "确定", cancelText: "取消", getPopupContainer: (J) => J, ...K, disabled: W || g, open: _, onOpenChange: (J) => { - if (!J) return re(J); - K.enabled ? re(J) : Ne(p); - }, onConfirm: (J) => { - Ne(p, J); - }, onClick: (J) => { - J.stopPropagation(); - }, children: h(On, { getPopupContainer: (J) => J, ...D, title: _ ? null : D == null ? void 0 : D.title, trigger: ["hover", "click"], children: E.cloneElement(O, { loading: se || m, disabled: W || g }) }) }); -}, P = ft("default"); -P.propTypes = { type: w.oneOf(["primary", "default", "danger", ""]), size: w.oneOf(["large", "middle", "small"]), name: w.string, icon: w.string, iconPosition: w.oneOf(["start", "end"]), data: w.any, widget: w.any, widgetType: w.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: w.object, widgetProps: w.object, widgetSetting: w.object, widgetContainerProps: w.object, tooltip: w.exact({ title: w.string.isRequired, placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func }), confirm: w.exact({ title: w.string.isRequired, cancelText: w.string, okText: w.string, okType: w.oneOf(["primary", "default", "danger", ""]), placement: w.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: w.oneOfType([w.bool, w.number]), getPopupContainer: w.func, arrow: w.oneOfType([w.bool, w.exact({ pointAtCenter: w.bool })]) }) }; -const Ar = ft("link"), jr = ft("circle"), Lr = ft("round"), Ir = ft("dashed"), $i = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: i = (g, y, b) => { -}, onBeforeClick: n = (g, y, b) => { -}, labelVariant: r = "link", labelSize: a, labelRender: o, btnVariant: s, btnSize: l, btnRender: d = (g, y) => h(P, { ...g, data: y }, g.uuid || Vt()), widgetContainerProps: u = {}, children: p, data: m }) => { - if (f.isEmpty(t)) return p; - const [g, y] = U(() => (t || []).reduce((C, S) => { - const v = e.indexOf(S.widgetType); - return v === -1 ? C[1].push(S) : C[0] ? v < e.indexOf(C[0].widgetType) ? (C[1].push(C[0]), C[0] = S) : C[1].push(S) : C[0] = S, C; - }, [null, []]), [t, e]); - o ? p = o(g, m) || p : p || (p = h(Ct, { ...Xi(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: a }), r) })); - const b = y.map((C) => d(Object.assign({ uuid: C.uuid, type: C.type, name: C.name, widget: C.widget, widgetType: C.widgetType, widgetProps: C.widgetProps, widgetData: C.widgetData, widgetSetting: C.widgetSetting, widgetContainerProps: C.widgetContainerSetting, confirm: C.confirm, onAfterClick: f.partialRight(i, C, m), onBeforeClick: f.partialRight(n, C, m) }, { size: l, variant: s }), m)); - return h(Rt, { widget: g == null ? void 0 : g.widget, widgetType: g == null ? void 0 : g.widgetType, widgetProps: g == null ? void 0 : g.widgetProps, widgetSetting: g == null ? void 0 : g.widgetSetting, widgetContainerProps: Object.assign({}, u, g == null ? void 0 : g.widgetContainerProps), data: m, widgetData: g == null ? void 0 : g.widgetData, extras: b, onAfterClick: f.partialRight(i, g, m), onBeforeClick: f.partialRight(n, g, m), children: p }); -}; -$i.propTypes = { triggerWeights: w.array, options: w.arrayOf(w.shape({ ...P.propTypes, widgetType: P.propTypes.widgetType.isRequired })), btnSize: P.propTypes.size, btnRender: w.func, btnVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: w.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: w.func, labelSize: P.propTypes.size, onAfterClick: w.func, onBeforeClick: w.func, widgetContainerProps: P.propTypes.widgetContainerProps, data: P.propTypes.data }, P.Link = Ar, P.Link.defaultProps = P.defaultProps, P.Link.propTypes = P.propTypes, P.Circle = jr, P.Circle.defaultProps = P.defaultProps, P.Circle.propTypes = P.propTypes, P.Round = Lr, P.Round.defaultProps = P.defaultProps, P.Round.propTypes = P.propTypes, P.Dashed = Ir, P.Dashed.defaultProps = P.defaultProps, P.Dashed.propTypes = P.propTypes, P.Popover = Rt, P.GroupPopover = $i; -const Mr = ({ fields: t, formProps: e, $close: i }) => { - const [n] = ae.useForm(), r = U(() => [{ name: "__PROPS__", value: e }], [e]); - return h(ee, { actions: j(E.Fragment, { children: [h(P, { name: "取消", widget: () => i(!1) }), h(P, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(i) })] }), children: h(ae, { fields: r, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: a, ...o }) => h(ti, { code: a, ...o }, a)) }) }); -}, Vr = ({ className: t, classNames: e, $close: i, children: n, title: r, subTitle: a, actions: o, extras: s, ...l }) => j(Dn, { ...l, prefixCls: "ff-drawer", className: R("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (d) => ({ motionAppear: !0, motionName: `panel-motion-${d}` }), children: [j("div", { className: R("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: R("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(Qt, { type: "close" }) }), r, a] }), h("div", { className: R("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), j("div", { className: R("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, o] })] }), Dr = ({ className: t, classNames: e, $close: i, $event: n, children: r, title: a, subTitle: o, actions: s, extras: l, placement: d, ...u }) => { - const p = (n == null ? void 0 : n.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: n == null ? void 0 : n.pageX, y: n == null ? void 0 : n.pageY } }; - return h(zn, { ...u, ...p, prefixCls: "ff-modal", modalRender: () => j("div", { className: R("ff-modal-content ff-popup", t), children: [j("div", { className: R("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: R("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: u.onClose, children: h(Qt, { type: "close" }) }), a, o] }), h("div", { className: R("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), j("div", { className: R("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] }) }); -}, Qi = ({ placement: t, $close: e, $event: i, children: n, title: r, ...a }) => { - const [o, s] = L({}), [l, d] = L(!0), u = Y((y, b) => s((C) => ({ ...C, [y]: b })), []), p = Y((y) => s((b) => ({ ...b, [y]: void 0 })), []); - let m = { ...a, className: o.rootClassName, title: o.title || r && E.createElement("div", { className: R("ff-popup-title") }, r), subTitle: o["sub-title"], actions: o.actions, extras: o.extras, children: n, $close: e, $event: i, onClose: () => d(!1) }; - const g = () => { - e(!1); - }; - return h(pt.Provider, { value: { ele: o, mount: u, unmount: p }, children: t && t !== "center" ? h(Vr, { ...m, placement: t, open: l, afterOpenChange: (y) => !y && g() }) : h(Dr, { ...m, visible: l, afterClose: g }) }); -}; -Qi.propTypes = { placement: w.oneOf(["center", "left", "top", "right", "bottom"]) }; -const ie = () => { - const [t, e] = kn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (a) => { - const { offsetHeight: o } = a; - return { height: o }; - }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, i] = E.useReducer((a) => a + 1, 0); - V(() => { - ie.$onClick = n, ie.$queue.forEach(([a, o, s], l, d) => { - r([o, s], ...a), delete d[l]; - }); - }, []); - const n = (a, o = {}, s = {}) => new Promise((l, d) => r([l, d], a, o, s)), r = ([a, o], s, l = {}, d = {}) => { - const u = ie.$index++, p = (m) => ((g, y) => (ie.$popups.delete(g), i(), y == null ? void 0 : y()))(u, () => a(m)); - if (s === Fi) return t.open({ ...d, key: u, content: E.createElement(s, { ...l, $close: () => t.close(u) }) }); - ie.$popups.set(u, E.createElement(Qi, { maskClosable: !1, $event: l == null ? void 0 : l.$event, ...d, key: u, $close: p }, E.isValidElement(s) ? E.cloneElement(s, { ...l, $close: p }) : s != null && s.name || gi.isForwardRef(s) || (s == null ? void 0 : s.$$typeof) === gi.ForwardRef ? E.createElement(s, { ...l, $close: p }) : s)), i(); - }; - return j(E.Fragment, { children: [Array.from(ie.$popups).map(([a, o]) => o), e] }); -}; -ie.$popups = /* @__PURE__ */ new Map(), ie.$index = 0, ie.$queue = [], ie.$onClick = (...t) => new Promise((e, i) => { - ie.$queue.push([t, e, i]); -}); -const vi = (t, e, i = {}) => ie.$onClick(t, e, i), It = (t, { showProgress: e, duration: i, ...n } = { duration: 1.5 }) => ie.$onClick(Fi, { content: t, ...n }, { showProgress: e, duration: i }), ne = { modal: vi, confirm: (t, e = {}) => ie.$onClick(Wn, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, i = {}) => vi(Mr, { formProps: i, fields: t }, { placement: "center", ...e }).then((n) => { - if (n === !1) throw !1; - return n; -}), notification: It, success: (t, e = { duration: 1.5 }) => It(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => It(t, { ...e, className: "ff-notification-error", icon: "close" }) }; -Ze.configure({ showSpinner: !1 }); -const Zi = () => { - const t = window.localStorage.getItem(bt); - return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); -}; -Ve.interceptors.request.use((t) => (Object.assign(t.headers, Zi()), Ze.inc(), t), (t) => (Ze.done(), Promise.reject({ code: -1, msg: t }))), Ve.interceptors.response.use(({ data: t, headers: e }) => (Ze.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { - return Ze.done(), Promise.reject(t.message); -}), window.addEventListener("unhandledrejection", Dt.onUnhandledRejection), Dt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && xe.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); -var Ge, Be, Ye; -const Q = class Q { - constructor() { - N(this, "appUrl", ""); - x(this, Ge, null); - return c(Q, Be) || (B(Q, Ye, new Dt()), B(Q, Be, new Proxy(this, { get(e, i) { - if (i in e) { - const n = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), i); - return n != null && n.get ? Reflect.get(e, i, e) : typeof e[i] == "function" ? e[i].bind(e) : e[i]; - } - return c(Q, Ye)[i]; - } }))), c(Q, Be); - } - init(e, i, n) { - Ve.defaults.baseURL = this.appUrl = n, Ve.defaults.timeout = 15e3, c(Q, Ye).init(e, i, Ve); - } - get driver() { - return Ve; - } - get headers() { - return Zi(); - } - mock(e = {}) { - return c(this, Ge) ?? B(this, Ge, new Sn(Ve, { onNoMatch: "passthrough", ...e })); - } - unmock() { - var e; - (e = c(this, Ge)) == null || e.restore(), B(this, Ge, null); - } -}; -Ge = new WeakMap(), Be = new WeakMap(), Ye = new WeakMap(), x(Q, Be), x(Q, Ye), N(Q, "getInstance", () => c(Q, Be) ?? B(Q, Be, new Q())); -let Gt = Q; -const I = Gt.getInstance(); -class ni extends Error { - constructor(e, i) { - super(i), Error.captureStackTrace && Error.captureStackTrace(this, ni), !i instanceof et && (this.name = `${e} Error Runtime`); - } -} -class et extends Error { - constructor(e, ...i) { - super(...i), Error.captureStackTrace && Error.captureStackTrace(this, et), this.name = `${e} Not Found`; - } -} -const Mt = "mine", bt = "token"; -var Le, Xe; -const we = class we { - constructor() { - x(this, Xe, /* @__PURE__ */ new Map()); - N(this, "setVendor", (e, i) => c(this, Xe).set(e, new Ri(i, async (n, r) => { - var o, s; - if (!(n != null && n.default)) throw "@pkg not found"; - let a = () => r; - switch ("function") { - case typeof (a = (o = n.default) == null ? void 0 : o[`./${r}/index.jsx`]): - case typeof (a = (s = n.default) == null ? void 0 : s[`./${r}/index.js`]): - return a(); - } - throw new et(r); - }))); - N(this, "getWidgetComponent", async (e) => { - if (!e) throw "getWidgetComponent widget is required"; - if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); - const [, i] = e == null ? void 0 : e.split("@pkg/"); - if (!i) throw new et(e); - try { - return c(this, Xe).has("pkg") ? await c(this, Xe).get("pkg").get(i) : await import(`${I.appUrl}/api/pkg-import/web?name=${e}`); - } catch (n) { - throw new ni(e, n); - } - }); - N(this, "getRoutes", () => I.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: i, ...n }) => [i, { uuid: i, ...n }])).then((e) => new Map(e))); - N(this, "getMenus", () => I.get("/api/my-menu")); - N(this, "getConfigure", () => I.get("api/init-configure")); - N(this, "getWidgetOperationAuth", () => I.get("/api/init-widget-operation-auth").then((e) => e.reduce((i, { uuid: n, auth: r }) => [...i, [n, r]], []))); - N(this, "getPhoneNumber", (e) => I.get(`/api/user-wx-phone-number/${e}`)); - N(this, "getUserToken", () => { - const e = window.localStorage.getItem(bt); - if (!e) return ""; - const i = e.split("."); - if (!Array.isArray(i) || i.length !== 3) throw "登录令牌无效!"; - const { iat: n } = JSON.parse(window.atob(i[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!"; - return e; - }); - N(this, "checkUserToken", () => { - try { - return !!this.getUserToken(); - } catch { - return !1; - } - }); - N(this, "getUserInfo", (e = !0) => { - var i; - try { - const n = this.getUserToken(); - if (!n) return Promise.resolve(null); - const { iat: r } = JSON.parse(window.atob((i = n == null ? void 0 : n.split(".")) == null ? void 0 : i[1])), { iat: a, ...o } = I.decode(window.localStorage.getItem(Mt) || "", {}); - return a === r ? Promise.resolve(o) : I.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Mt, I.encode({ ...s, iat: r })), s)); - } catch (n) { - console.error(n), e && ne.error("请登录").then(this.logout); - } - return Promise.resolve(null); - }); - N(this, "login", (e, i, n = {}) => I.post("/api/user-token", { username: e, passwd: En.hash(i), platform: "web", ...n }).then(({ token: r }) => (window.localStorage.setItem(bt, r), r)).then(async (r) => (await this.initAppEnv(), r))); - N(this, "logout", (e) => (window.localStorage.removeItem(Mt), window.localStorage.removeItem(bt), e == null ? void 0 : e())); - N(this, "initAppEnv", async () => { - const [e, i, n, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return Ai.init(e), qe.init(r), xe.init(i, n), St.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: i, menus: n, configures: r }; - }); - if (c(we, Le)) return c(we, Le); - } -}; -Le = new WeakMap(), Xe = new WeakMap(), x(we, Le, null), N(we, "getInstance", () => (c(we, Le) || B(we, Le, new we()), c(we, Le))); -let Yt = we; -const ue = Yt.getInstance(), zr = E.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), Wr = E.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), ri = (t) => !!(t != null && t.name) && (t.prototype instanceof E.Component || /^[A-Z]/.test(t.name)), Br = (t, e) => { - if (!t || typeof window > "u") return; - let i = document.querySelector(`style[ff-style-token="${e}"]`); - return i ? (i.innerHTML = t, t) : (i = document.createElement("style"), i.setAttribute("ff-style-token", e), i.setAttribute("type", "text/css"), i.innerHTML = t, document.head.appendChild(i), t); -}, qr = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: zr, AppGlobalParamsContext: Wr, cache: Ri, configure: qe, default: ue, func: Ie, http: I, insertStyle: Br, isReactComponent: ri, route: xe }, Symbol.toStringTag, { value: "Module" })); -var $e, Qe, ve, be, Ce, te, Z, G, ke, st, lt, ct, dt, Pt, ut; -const ai = class ai { - constructor(e, i = "/") { - x(this, $e, "/"); - x(this, Qe, /* @__PURE__ */ new Set()); - x(this, ve, (e) => { - for (const i of c(this, Qe)) try { - i(e); - } catch (n) { - console.error("Error in VirtualFS event listener:", n); - } - }); - x(this, be, (e) => { - const i = Date.now(); - if (e && (e.lastModified = i), c(this, $e) != "/") { - const n = c(this, G).call(this, c(this, $e)); - n && (n.lastModified = i); - } - this.root.lastModified = i; - }); - x(this, Ce, (e) => { - let i = ge.normalize(e); - return i.startsWith("/") || (i = "/" + i), i.length > 1 && i.endsWith("/") && (i = i.slice(0, -1)), i; - }); - x(this, te, (e) => { - const i = ge.join(c(this, $e), e); - return c(this, Ce).call(this, i); - }); - x(this, Z, (e) => { - if (!e || typeof e != "string") return !1; - const i = c(this, Ce).call(this, e); - return !i.includes("..") && i.startsWith("/"); - }); - x(this, G, (e) => { - var a; - const i = c(this, Ce).call(this, e); - if (i === "/") return this.root; - const n = i.split("/").filter((o) => o); - let r = this.root; - for (const o of n) { - if (r.type !== "dir") return null; - const s = (a = r.children) == null ? void 0 : a.find((l) => l.name === o); - if (!s) return null; - r = s; - } - return r; - }); - x(this, ke, (e) => { - const i = c(this, Ce).call(this, e), n = ge.basename(i), r = ge.dirname(i); - return { parent: c(this, G).call(this, r), name: n }; - }); - x(this, st, (e, i, n) => n === !1 ? e : n === "root" ? e.map((r) => ge.join(i, r)) : n === !0 || n === "working" ? e.map((r) => ge.relative(c(this, $e), ge.join(i, r))) : e); - x(this, lt, async (e, i, n, r = "") => { - const a = [], o = c(this, G).call(this, e); - if (!o || o.type !== "dir") return a; - const s = o.children; - for (const l of s) { - const d = l.name, u = e === "/" ? `/${d}` : `${e}/${d}`, p = r ? `${r}/${d}` : d; - try { - if (l.type === "file") i(n ? p : d) && a.push(p); - else if (l.type === "dir" && n) { - const m = await c(this, lt).call(this, u, i, n, p); - a.push(...m); - } - } catch { - continue; - } - } - return a; - }); - x(this, ct, async (e, i, n, r = "") => { - const a = [], o = Array.isArray(i) ? i : [i], s = c(this, G).call(this, e); - if (!s || s.type !== "dir") return a; - if (!n) { - for (const d of o) if (c(this, dt).call(this, d)) { - const u = await c(this, Pt).call(this, e, d); - a.push(...u); - } else { - const u = ge.join(e, d), p = c(this, Ce).call(this, u); - c(this, G).call(this, p) && a.push(d); - } - return a; - } - const l = s.children; - for (const d of l) { - const u = d.name, p = e === "/" ? `/${u}` : `${e}/${u}`, m = r ? `${r}/${u}` : u; - try { - if (d.type === "file") for (const g of o) { - let y = !1; - if (y = c(this, dt).call(this, g) ? c(this, ut).call(this, u, g) : u === g, y) { - a.push(m); - break; - } - } - else if (d.type === "dir") { - const g = await c(this, ct).call(this, p, i, n, m); - a.push(...g); - } - } catch { - continue; - } - } - return a; - }); - x(this, dt, (e) => /[*?[\]{}]/.test(e)); - x(this, Pt, async (e, i) => { - const n = [], r = c(this, G).call(this, e); - if (!r || r.type !== "dir") return n; - const a = r.children.map((o) => o.name); - for (const o of a) c(this, ut).call(this, o, i) && n.push(o); - return n; - }); - x(this, ut, (e, i) => { - const n = i.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, a) => "(" + a.split(",").join("|") + ")"); - return new RegExp(`^${n}$`).test(e); - }); - var n, r, a; - B(this, $e, i), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (n = this.root).name ?? (n.name = "/"), (r = this.root).children ?? (r.children = []), (a = this.root).lastModified ?? (a.lastModified = Date.now()))); - } - async stat(e) { - const i = c(this, te).call(this, e); - if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const n = c(this, G).call(this, i); - if (!n) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); - return { isFile: () => n.type === "file", isDirectory: () => n.type === "dir", lastModified: n.lastModified }; - } - async dir(e) { - const i = c(this, te).call(this, e); - if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const n = c(this, G).call(this, i); - if (!n) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); - if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); - return n.children.map((r) => r.name); - } - async readFile(e) { - const i = c(this, te).call(this, e); - if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const n = c(this, G).call(this, i); - if (!n) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (n.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); - return n.content || ""; - } - async writeFile(e, i) { - const n = c(this, te).call(this, e); - if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: a } = c(this, ke).call(this, n); - if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); - const o = r.children.findIndex((d) => d.name === a), s = o >= 0, l = { name: a, type: "file", content: i, lastModified: Date.now() }; - s ? r.children[o] = l : r.children.push(l), c(this, be).call(this, r), c(this, ve).call(this, { action: s ? "update" : "create", path: n, type: "file", timestamp: Date.now() }); - } - async mkdir(e, i = {}) { - const n = c(this, te).call(this, e); - if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const { recursive: r } = i; - if (r) { - const a = n.split("/").filter((s) => s); - let o = "/"; - for (const s of a) - if (o = ge.join(o, s), !c(this, G).call(this, o)) { - const { parent: l, name: d } = c(this, ke).call(this, o); - if (l && l.type === "dir") { - const u = { name: d, type: "dir", children: [], lastModified: Date.now() }; - l.children.push(u), c(this, be).call(this, l), c(this, ve).call(this, { action: "create", path: c(this, Ce).call(this, o), type: "dir", timestamp: Date.now() }); - } - } - } else { - const { parent: a, name: o } = c(this, ke).call(this, n); - if (!a) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); - if (a.type !== "dir") throw new Error("ENOTDIR: not a directory"); - if (a.children.find((l) => l.name === o)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); - const s = { name: o, type: "dir", children: [], lastModified: Date.now() }; - a.children.push(s), c(this, be).call(this, a), c(this, ve).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() }); - } - } - async unlink(e) { - const i = c(this, te).call(this, e); - if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: n, name: r } = c(this, ke).call(this, i); - if (!n) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - const a = n.children.findIndex((o) => o.name === r); - if (a < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - if (n.children[a].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); - n.children.splice(a, 1), c(this, be).call(this, n), c(this, ve).call(this, { action: "delete", path: i, type: "file", timestamp: Date.now() }); - } - async rmdir(e, i = {}) { - const n = c(this, te).call(this, e); - if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: a } = c(this, ke).call(this, n); - if (!r) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); - const o = r.children.findIndex((l) => l.name === a); - if (o < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); - const s = r.children[o]; - if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); - if (!i.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); - r.children.splice(o, 1), c(this, be).call(this, r), c(this, ve).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() }); - } - async rename(e, i) { - const n = c(this, te).call(this, e), r = c(this, te).call(this, i); - if (!c(this, Z).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${i}'`); - if (!c(this, G).call(this, n)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); - const { parent: a, name: o } = c(this, ke).call(this, n), { parent: s, name: l } = c(this, ke).call(this, r); - if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${i}'`); - if (c(this, G).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${i}'`); - const d = a.children.findIndex((p) => p.name === o), u = { ...a.children[d], name: l, lastModified: Date.now() }; - a.children.splice(d, 1), s.children.push(u), c(this, be).call(this, a), a !== s && c(this, be).call(this, s), c(this, ve).call(this, { action: "rename", path: r, oldPath: n, type: u.type, timestamp: Date.now() }); - } - async exists(e) { - const i = c(this, te).call(this, e); - return c(this, Z).call(this, i) ? c(this, G).call(this, i) !== null : !1; - } - getLastModified() { - return this.root.lastModified; - } - subscribe(e) { - if (typeof e != "function") throw new Error("Callback must be a function"); - return c(this, Qe).add(e), () => { - c(this, Qe).delete(e); - }; - } - getWorkingDirectory() { - return c(this, $e); - } - scope(e = "/") { - const i = c(this, Ce).call(this, e); - if (!c(this, Z).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const n = c(this, G).call(this, i); - if (!n) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (n.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - return n.children ?? (n.children = []), n.lastModified ?? (n.lastModified = Date.now()), new ai(this.root, i); - } - async findFiles(e, i, n = {}) { - const r = c(this, te).call(this, e); - if (!c(this, Z).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - const a = c(this, G).call(this, r); - if (!a) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (a.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - const { recursive: o = !1, fullPath: s = !1 } = n; - if (typeof i == "function") { - const d = await c(this, lt).call(this, r, i, o); - return c(this, st).call(this, d, r, s); - } - const l = await c(this, ct).call(this, r, i, o); - return c(this, st).call(this, l, r, s); - } -}; -$e = new WeakMap(), Qe = new WeakMap(), ve = new WeakMap(), be = new WeakMap(), Ce = new WeakMap(), te = new WeakMap(), Z = new WeakMap(), G = new WeakMap(), ke = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), ct = new WeakMap(), dt = new WeakMap(), Pt = new WeakMap(), ut = new WeakMap(); -let xi = ai; -const Ur = async (t, e = "/", i = "") => { - try { - const n = await t.stat(e), r = e === "/" ? "/" : ge.basename(e), a = { title: r, key: i ? `${i}${e}` : e, isLeaf: n.isFile() }; - if (n.isDirectory()) { - const o = await t.dir(e); - if (o.length > 0) { - a.children = []; - const s = [], l = []; - for (const d of o) { - const u = e === "/" ? `/${d}` : `${e}/${d}`; - try { - (await t.stat(u)).isDirectory() ? s.push(d) : l.push(d); - } catch (p) { - console.warn(`Failed to stat ${u}:`, p.message); - } - } - s.sort(), l.sort(); - for (const d of [...s, ...l]) { - const u = e === "/" ? `/${d}` : `${e}/${d}`; - try { - const p = await Ur(t, u, i); - a.children.push(p); - } catch (p) { - console.warn(`Failed to process ${u}:`, p.message); - } - } - } - } - return a; - } catch { - return null; - } -}; -export { - Sa as $, - Ki as A, - Bi as B, - Wi as C, - kt as D, - or as E, - ar as F, - Ca as G, - cr as H, - nr as I, - ei as J, - oe as K, - lr as L, - hr as M, - Zn as N, - tr as O, - Gn as P, - Yn as Q, - qi as R, - fa as S, - ya as T, - Vi as U, - Ut as V, - Xn as W, - Qn as X, - mr as Y, - fr as Z, - ka as _, - ji as a, - Tt as a0, - Ea as a1, - $a as a2, - ht as a3, - mt as a4, - va as a5, - xa as a6, - xr as a7, - ii as a8, - ti as a9, - Ie as aA, - xe as aB, - zr as aC, - Wr as aD, - xi as aE, - Ur as aF, - Yi as aa, - wr as ab, - br as ac, - Cr as ad, - kr as ae, - Sr as af, - Er as ag, - Na as ah, - St as ai, - P as aj, - Ai as ak, - Or as al, - ee as am, - pt as an, - Oi as ao, - ie as ap, - ne as aq, - la as ar, - ca as as, - da as at, - ue as au, - ri as av, - Br as aw, - I as ax, - Ri as ay, - qe as az, - qn as b, - gt as c, - Li as d, - pa as e, - ga as f, - Bn as g, - ha as h, - Un as i, - _n as j, - ma as k, - Di as l, - Kn as m, - wa as n, - zi as o, - Zt as p, - Ui as q, - Lt as r, - Hi as s, - de as t, - ua as u, - pr as v, - _i as w, - dr as x, - ur as y, - ba as z -}; diff --git a/dist/common/vender-BkiRbACr.js b/dist/common/vender-DTKG7Nf1.js similarity index 63% rename from dist/common/vender-BkiRbACr.js rename to dist/common/vender-DTKG7Nf1.js index 09b3606..ccc05d6 100644 --- a/dist/common/vender-BkiRbACr.js +++ b/dist/common/vender-DTKG7Nf1.js @@ -1,26 +1,27 @@ -function je(t, e) { +import ur from "react"; +function ke(t, e) { return function() { return t.apply(e, arguments); }; } -const { toString: sr } = Object.prototype, { getPrototypeOf: Jt } = Object, ft = (bt = /* @__PURE__ */ Object.create(null), (t) => { - const e = sr.call(t); +const { toString: lr } = Object.prototype, { getPrototypeOf: Jt } = Object, ft = (bt = /* @__PURE__ */ Object.create(null), (t) => { + const e = lr.call(t); return bt[e] || (bt[e] = e.slice(8, -1).toLowerCase()); }); var bt; -const B = (t) => (t = t.toLowerCase(), (e) => ft(e) === t), gt = (t) => (e) => typeof e === t, { isArray: J } = Array, Z = gt("undefined"), Xt = B("ArrayBuffer"), ir = gt("string"), k = gt("function"), Qt = gt("number"), ot = (t) => t !== null && typeof t == "object", st = (t) => { +const B = (t) => (t = t.toLowerCase(), (e) => ft(e) === t), gt = (t) => (e) => typeof e === t, { isArray: J } = Array, Z = gt("undefined"), Xt = B("ArrayBuffer"), fr = gt("string"), k = gt("function"), Qt = gt("number"), ot = (t) => t !== null && typeof t == "object", st = (t) => { if (ft(t) !== "object") return !1; const e = Jt(t); return !(e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null || Symbol.toStringTag in t || Symbol.iterator in t); -}, ar = B("Date"), cr = B("File"), ur = B("Blob"), lr = B("FileList"), fr = B("URLSearchParams"), [hr, dr, pr, gr] = ["ReadableStream", "Request", "Response", "Headers"].map(B); +}, hr = B("Date"), dr = B("File"), pr = B("Blob"), gr = B("FileList"), mr = B("URLSearchParams"), [yr, br, wr, vr] = ["ReadableStream", "Request", "Response", "Headers"].map(B); function Y(t, e, { allOwnKeys: r = !1 } = {}) { if (t == null) return; let n, o; if (typeof t != "object" && (t = [t]), J(t)) for (n = 0, o = t.length; n < o; n++) e.call(null, t[n], n, t); else { - const c = r ? Object.getOwnPropertyNames(t) : Object.keys(t), a = c.length; - let m; - for (n = 0; n < a; n++) m = c[n], e.call(null, t[m], m, t); + const a = r ? Object.getOwnPropertyNames(t) : Object.keys(t), c = a.length; + let y; + for (n = 0; n < c; n++) y = a[n], e.call(null, t[y], y, t); } } function Zt(t, e) { @@ -30,15 +31,15 @@ function Zt(t, e) { for (; o-- > 0; ) if (n = r[o], e === n.toLowerCase()) return n; return null; } -const ke = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Yt = (t) => !Z(t) && t !== ke, yr = (wt = typeof Uint8Array < "u" && Jt(Uint8Array), (t) => wt && t instanceof wt); +const Ue = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Yt = (t) => !Z(t) && t !== Ue, Er = (wt = typeof Uint8Array < "u" && Jt(Uint8Array), (t) => wt && t instanceof wt); var wt; -const mr = B("HTMLFormElement"), te = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), br = B("RegExp"), ee = (t, e) => { +const Ar = B("HTMLFormElement"), te = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Or = B("RegExp"), ee = (t, e) => { const r = Object.getOwnPropertyDescriptors(t), n = {}; - Y(r, (o, c) => { - let a; - (a = e(o, c, t)) !== !1 && (n[c] = a || o); + Y(r, (o, a) => { + let c; + (c = e(o, a, t)) !== !1 && (n[a] = c || o); }), Object.defineProperties(t, n); -}, vt = "abcdefghijklmnopqrstuvwxyz", re = "0123456789", ne = { DIGIT: re, ALPHA: vt, ALPHA_DIGIT: vt + vt.toUpperCase() + re }, wr = B("AsyncFunction"), v = { isArray: J, isArrayBuffer: Xt, isBuffer: function(t) { +}, vt = "abcdefghijklmnopqrstuvwxyz", re = "0123456789", ne = { DIGIT: re, ALPHA: vt, ALPHA_DIGIT: vt + vt.toUpperCase() + re }, Sr = B("AsyncFunction"), v = { isArray: J, isArrayBuffer: Xt, isBuffer: function(t) { return t !== null && !Z(t) && t.constructor !== null && !Z(t.constructor) && k(t.constructor.isBuffer) && t.constructor.isBuffer(t); }, isFormData: (t) => { let e; @@ -46,23 +47,23 @@ const mr = B("HTMLFormElement"), te = (({ hasOwnProperty: t }) => (e, r) => t.ca }, isArrayBufferView: function(t) { let e; return e = typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer && Xt(t.buffer), e; -}, isString: ir, isNumber: Qt, isBoolean: (t) => t === !0 || t === !1, isObject: ot, isPlainObject: st, isReadableStream: hr, isRequest: dr, isResponse: pr, isHeaders: gr, isUndefined: Z, isDate: ar, isFile: cr, isBlob: ur, isRegExp: br, isFunction: k, isStream: (t) => ot(t) && k(t.pipe), isURLSearchParams: fr, isTypedArray: yr, isFileList: lr, forEach: Y, merge: function t() { - const { caseless: e } = Yt(this) && this || {}, r = {}, n = (o, c) => { - const a = e && Zt(r, c) || c; - st(r[a]) && st(o) ? r[a] = t(r[a], o) : st(o) ? r[a] = t({}, o) : J(o) ? r[a] = o.slice() : r[a] = o; +}, isString: fr, isNumber: Qt, isBoolean: (t) => t === !0 || t === !1, isObject: ot, isPlainObject: st, isReadableStream: yr, isRequest: br, isResponse: wr, isHeaders: vr, isUndefined: Z, isDate: hr, isFile: dr, isBlob: pr, isRegExp: Or, isFunction: k, isStream: (t) => ot(t) && k(t.pipe), isURLSearchParams: mr, isTypedArray: Er, isFileList: gr, forEach: Y, merge: function t() { + const { caseless: e } = Yt(this) && this || {}, r = {}, n = (o, a) => { + const c = e && Zt(r, a) || a; + st(r[c]) && st(o) ? r[c] = t(r[c], o) : st(o) ? r[c] = t({}, o) : J(o) ? r[c] = o.slice() : r[c] = o; }; - for (let o = 0, c = arguments.length; o < c; o++) arguments[o] && Y(arguments[o], n); + for (let o = 0, a = arguments.length; o < a; o++) arguments[o] && Y(arguments[o], n); return r; -}, extend: (t, e, r, { allOwnKeys: n } = {}) => (Y(e, (o, c) => { - r && k(o) ? t[c] = je(o, r) : t[c] = o; +}, extend: (t, e, r, { allOwnKeys: n } = {}) => (Y(e, (o, a) => { + r && k(o) ? t[a] = ke(o, r) : t[a] = o; }, { allOwnKeys: n }), t), trim: (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), stripBOM: (t) => (t.charCodeAt(0) === 65279 && (t = t.slice(1)), t), inherits: (t, e, r, n) => { t.prototype = Object.create(e.prototype, n), t.prototype.constructor = t, Object.defineProperty(t, "super", { value: e.prototype }), r && Object.assign(t.prototype, r); }, toFlatObject: (t, e, r, n) => { - let o, c, a; - const m = {}; + let o, a, c; + const y = {}; if (e = e || {}, t == null) return e; do { - for (o = Object.getOwnPropertyNames(t), c = o.length; c-- > 0; ) a = o[c], n && !n(a, t, e) || m[a] || (e[a] = t[a], m[a] = !0); + for (o = Object.getOwnPropertyNames(t), a = o.length; a-- > 0; ) c = o[a], n && !n(c, t, e) || y[c] || (e[c] = t[c], y[c] = !0); t = r !== !1 && Jt(t); } while (t && (!r || r(t, e)) && t !== Object.prototype); return e; @@ -90,7 +91,7 @@ const mr = B("HTMLFormElement"), te = (({ hasOwnProperty: t }) => (e, r) => t.ca const n = []; for (; (r = t.exec(e)) !== null; ) n.push(r); return n; -}, isHTMLForm: mr, hasOwnProperty: te, hasOwnProp: te, reduceDescriptors: ee, freezeMethods: (t) => { +}, isHTMLForm: Ar, hasOwnProperty: te, hasOwnProp: te, reduceDescriptors: ee, freezeMethods: (t) => { ee(t, (e, r) => { if (k(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1) return !1; const n = t[r]; @@ -100,15 +101,15 @@ const mr = B("HTMLFormElement"), te = (({ hasOwnProperty: t }) => (e, r) => t.ca }); }, toObjectSet: (t, e) => { const r = {}, n = (o) => { - o.forEach((c) => { - r[c] = !0; + o.forEach((a) => { + r[a] = !0; }); }; return J(t) ? n(t) : n(String(t).split(e)), r; }, toCamelCase: (t) => t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g, function(e, r, n) { return r.toUpperCase() + n; }), noop: () => { -}, toFiniteNumber: (t, e) => t != null && Number.isFinite(t = +t) ? t : e, findKey: Zt, global: ke, isContextDefined: Yt, ALPHABET: ne, generateString: (t = 16, e = ne.ALPHA_DIGIT) => { +}, toFiniteNumber: (t, e) => t != null && Number.isFinite(t = +t) ? t : e, findKey: Zt, global: Ue, isContextDefined: Yt, ALPHABET: ne, generateString: (t = 16, e = ne.ALPHA_DIGIT) => { let r = ""; const { length: n } = e; for (; t--; ) r += e[Math.random() * n | 0]; @@ -121,17 +122,17 @@ const mr = B("HTMLFormElement"), te = (({ hasOwnProperty: t }) => (e, r) => t.ca if (e.indexOf(n) >= 0) return; if (!("toJSON" in n)) { e[o] = n; - const c = J(n) ? [] : {}; - return Y(n, (a, m) => { - const y = r(a, o + 1); - !Z(y) && (c[m] = y); - }), e[o] = void 0, c; + const a = J(n) ? [] : {}; + return Y(n, (c, y) => { + const g = r(c, o + 1); + !Z(g) && (a[y] = g); + }), e[o] = void 0, a; } } return n; }; return r(t, 0); -}, isAsyncFn: wr, isThenable: (t) => t && (ot(t) || k(t)) && k(t.then) && k(t.catch) }; +}, isAsyncFn: Sr, isThenable: (t) => t && (ot(t) || k(t)) && k(t.then) && k(t.catch) }; function C(t, e, r, n, o) { Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), r && (this.config = r), n && (this.request = n), o && (this.response = o); } @@ -141,24 +142,24 @@ v.inherits(C, Error, { toJSON: function() { const oe = C.prototype, se = {}; ["ERR_BAD_OPTION_VALUE", "ERR_BAD_OPTION", "ECONNABORTED", "ETIMEDOUT", "ERR_NETWORK", "ERR_FR_TOO_MANY_REDIRECTS", "ERR_DEPRECATED", "ERR_BAD_RESPONSE", "ERR_BAD_REQUEST", "ERR_CANCELED", "ERR_NOT_SUPPORT", "ERR_INVALID_URL"].forEach((t) => { se[t] = { value: t }; -}), Object.defineProperties(C, se), Object.defineProperty(oe, "isAxiosError", { value: !0 }), C.from = (t, e, r, n, o, c) => { - const a = Object.create(oe); - return v.toFlatObject(t, a, function(m) { - return m !== Error.prototype; - }, (m) => m !== "isAxiosError"), C.call(a, t.message, e, r, n, o), a.cause = t, a.name = t.name, c && Object.assign(a, c), a; +}), Object.defineProperties(C, se), Object.defineProperty(oe, "isAxiosError", { value: !0 }), C.from = (t, e, r, n, o, a) => { + const c = Object.create(oe); + return v.toFlatObject(t, c, function(y) { + return y !== Error.prototype; + }, (y) => y !== "isAxiosError"), C.call(c, t.message, e, r, n, o), c.cause = t, c.name = t.name, a && Object.assign(c, a), c; }; function Et(t) { return v.isPlainObject(t) || v.isArray(t); } -function Ue(t) { +function Be(t) { return v.endsWith(t, "[]") ? t.slice(0, -2) : t; } function ie(t, e, r) { return t ? t.concat(e).map(function(n, o) { - return n = Ue(n), !r && o ? "[" + n + "]" : n; + return n = Be(n), !r && o ? "[" + n + "]" : n; }).join(r ? "." : "") : e; } -const vr = v.toFlatObject(v, {}, null, function(t) { +const Cr = v.toFlatObject(v, {}, null, function(t) { return /^is[A-Z]/.test(t); }); function ht(t, e, r) { @@ -166,27 +167,27 @@ function ht(t, e, r) { e = e || new FormData(); const n = (r = v.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(w, E) { return !v.isUndefined(E[w]); - })).metaTokens, o = r.visitor || g, c = r.dots, a = r.indexes, m = (r.Blob || typeof Blob < "u" && Blob) && v.isSpecCompliantForm(e); + })).metaTokens, o = r.visitor || m, a = r.dots, c = r.indexes, y = (r.Blob || typeof Blob < "u" && Blob) && v.isSpecCompliantForm(e); if (!v.isFunction(o)) throw new TypeError("visitor must be a function"); - function y(w) { + function g(w) { if (w === null) return ""; if (v.isDate(w)) return w.toISOString(); - if (!m && v.isBlob(w)) throw new C("Blob is not supported. Use a Buffer instead."); - return v.isArrayBuffer(w) || v.isTypedArray(w) ? m && typeof Blob == "function" ? new Blob([w]) : Buffer.from(w) : w; + if (!y && v.isBlob(w)) throw new C("Blob is not supported. Use a Buffer instead."); + return v.isArrayBuffer(w) || v.isTypedArray(w) ? y && typeof Blob == "function" ? new Blob([w]) : Buffer.from(w) : w; } - function g(w, E, d) { + function m(w, E, d) { let l = w; if (w && !d && typeof w == "object") { if (v.endsWith(E, "{}")) E = n ? E : E.slice(0, -2), w = JSON.stringify(w); else if (v.isArray(w) && function(i) { return v.isArray(i) && !i.some(Et); - }(w) || (v.isFileList(w) || v.endsWith(E, "[]")) && (l = v.toArray(w))) return E = Ue(E), l.forEach(function(i, u) { - !v.isUndefined(i) && i !== null && e.append(a === !0 ? ie([E], u, c) : a === null ? E : E + "[]", y(i)); + }(w) || (v.isFileList(w) || v.endsWith(E, "[]")) && (l = v.toArray(w))) return E = Be(E), l.forEach(function(i, u) { + !v.isUndefined(i) && i !== null && e.append(c === !0 ? ie([E], u, a) : c === null ? E : E + "[]", g(i)); }), !1; } - return !!Et(w) || (e.append(ie(d, E, c), y(w)), !1); + return !!Et(w) || (e.append(ie(d, E, a), g(w)), !1); } - const s = [], b = Object.assign(vr, { defaultVisitor: g, convertValue: y, isVisitable: Et }); + const s = [], b = Object.assign(Cr, { defaultVisitor: m, convertValue: g, isVisitable: Et }); if (!v.isObject(t)) throw new TypeError("data must be an object"); return function w(E, d) { if (!v.isUndefined(E)) { @@ -207,16 +208,16 @@ function zt(t, e) { this._pairs = [], t && ht(t, this, e); } const ce = zt.prototype; -function Er(t) { +function Rr(t) { return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } -function Be(t, e, r) { +function Me(t, e, r) { if (!e) return t; - const n = r && r.encode || Er, o = r && r.serialize; - let c; - if (c = o ? o(e, r) : v.isURLSearchParams(e) ? e.toString() : new zt(e, r).toString(n), c) { - const a = t.indexOf("#"); - a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + c; + const n = r && r.encode || Rr, o = r && r.serialize; + let a; + if (a = o ? o(e, r) : v.isURLSearchParams(e) ? e.toString() : new zt(e, r).toString(n), a) { + const c = t.indexOf("#"); + c !== -1 && (t = t.slice(0, c)), t += (t.indexOf("?") === -1 ? "?" : "&") + a; } return t; } @@ -249,58 +250,58 @@ class ue { }); } } -const Me = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Ar = { isBrowser: !0, classes: { URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : zt, FormData: typeof FormData < "u" ? FormData : null, Blob: typeof Blob < "u" ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Vt = typeof window < "u" && typeof document < "u", Or = (le = typeof navigator < "u" && navigator.product, Vt && ["ReactNative", "NativeScript", "NS"].indexOf(le) < 0); +const Le = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, xr = { isBrowser: !0, classes: { URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : zt, FormData: typeof FormData < "u" ? FormData : null, Blob: typeof Blob < "u" ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Vt = typeof window < "u" && typeof document < "u", Tr = (le = typeof navigator < "u" && navigator.product, Vt && ["ReactNative", "NativeScript", "NS"].indexOf(le) < 0); var le; -const Sr = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Cr = Vt && window.location.href || "http://localhost", U = { ...Object.freeze(Object.defineProperty({ __proto__: null, hasBrowserEnv: Vt, hasStandardBrowserEnv: Or, hasStandardBrowserWebWorkerEnv: Sr, origin: Cr }, Symbol.toStringTag, { value: "Module" })), ...Ar }; -function Le(t) { - function e(r, n, o, c) { - let a = r[c++]; - if (a === "__proto__") return !0; - const m = Number.isFinite(+a), y = c >= r.length; - return a = !a && v.isArray(o) ? o.length : a, y ? (v.hasOwnProp(o, a) ? o[a] = [o[a], n] : o[a] = n, !m) : (o[a] && v.isObject(o[a]) || (o[a] = []), e(r, n, o[a], c) && v.isArray(o[a]) && (o[a] = function(g) { - const s = {}, b = Object.keys(g); +const _r = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Nr = Vt && window.location.href || "http://localhost", U = { ...Object.freeze(Object.defineProperty({ __proto__: null, hasBrowserEnv: Vt, hasStandardBrowserEnv: Tr, hasStandardBrowserWebWorkerEnv: _r, origin: Nr }, Symbol.toStringTag, { value: "Module" })), ...xr }; +function De(t) { + function e(r, n, o, a) { + let c = r[a++]; + if (c === "__proto__") return !0; + const y = Number.isFinite(+c), g = a >= r.length; + return c = !c && v.isArray(o) ? o.length : c, g ? (v.hasOwnProp(o, c) ? o[c] = [o[c], n] : o[c] = n, !y) : (o[c] && v.isObject(o[c]) || (o[c] = []), e(r, n, o[c], a) && v.isArray(o[c]) && (o[c] = function(m) { + const s = {}, b = Object.keys(m); let w; const E = b.length; let d; - for (w = 0; w < E; w++) d = b[w], s[d] = g[d]; + for (w = 0; w < E; w++) d = b[w], s[d] = m[d]; return s; - }(o[a])), !m); + }(o[c])), !y); } if (v.isFormData(t) && v.isFunction(t.entries)) { const r = {}; return v.forEachEntry(t, (n, o) => { - e(function(c) { - return v.matchAll(/\w+|\[(\w*)]/g, c).map((a) => a[0] === "[]" ? "" : a[1] || a[0]); + e(function(a) { + return v.matchAll(/\w+|\[(\w*)]/g, a).map((c) => c[0] === "[]" ? "" : c[1] || c[0]); }(n), o, r, 0); }), r; } return null; } -const rt = { transitional: Me, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, e) { +const rt = { transitional: Le, adapter: ["xhr", "http", "fetch"], transformRequest: [function(t, e) { const r = e.getContentType() || "", n = r.indexOf("application/json") > -1, o = v.isObject(t); - if (o && v.isHTMLForm(t) && (t = new FormData(t)), v.isFormData(t)) return n ? JSON.stringify(Le(t)) : t; + if (o && v.isHTMLForm(t) && (t = new FormData(t)), v.isFormData(t)) return n ? JSON.stringify(De(t)) : t; if (v.isArrayBuffer(t) || v.isBuffer(t) || v.isStream(t) || v.isFile(t) || v.isBlob(t) || v.isReadableStream(t)) return t; if (v.isArrayBufferView(t)) return t.buffer; if (v.isURLSearchParams(t)) return e.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString(); - let c; + let a; if (o) { - if (r.indexOf("application/x-www-form-urlencoded") > -1) return function(a, m) { - return ht(a, new U.classes.URLSearchParams(), Object.assign({ visitor: function(y, g, s, b) { - return U.isNode && v.isBuffer(y) ? (this.append(g, y.toString("base64")), !1) : b.defaultVisitor.apply(this, arguments); - } }, m)); + if (r.indexOf("application/x-www-form-urlencoded") > -1) return function(c, y) { + return ht(c, new U.classes.URLSearchParams(), Object.assign({ visitor: function(g, m, s, b) { + return U.isNode && v.isBuffer(g) ? (this.append(m, g.toString("base64")), !1) : b.defaultVisitor.apply(this, arguments); + } }, y)); }(t, this.formSerializer).toString(); - if ((c = v.isFileList(t)) || r.indexOf("multipart/form-data") > -1) { - const a = this.env && this.env.FormData; - return ht(c ? { "files[]": t } : t, a && new a(), this.formSerializer); + if ((a = v.isFileList(t)) || r.indexOf("multipart/form-data") > -1) { + const c = this.env && this.env.FormData; + return ht(a ? { "files[]": t } : t, c && new c(), this.formSerializer); } } - return o || n ? (e.setContentType("application/json", !1), function(a, m, y) { - if (v.isString(a)) try { - return (m || JSON.parse)(a), v.trim(a); - } catch (g) { - if (g.name !== "SyntaxError") throw g; + return o || n ? (e.setContentType("application/json", !1), function(c, y, g) { + if (v.isString(c)) try { + return (y || JSON.parse)(c), v.trim(c); + } catch (m) { + if (m.name !== "SyntaxError") throw m; } - return (y || JSON.stringify)(a); + return (g || JSON.stringify)(c); }(t)) : t; }], transformResponse: [function(t) { const e = this.transitional || rt.transitional, r = e && e.forcedJSONParsing, n = this.responseType === "json"; @@ -309,9 +310,9 @@ const rt = { transitional: Me, adapter: ["xhr", "http", "fetch"], transformReque const o = !(e && e.silentJSONParsing) && n; try { return JSON.parse(t); - } catch (c) { + } catch (a) { if (o) - throw c.name === "SyntaxError" ? C.from(c, C.ERR_BAD_RESPONSE, this, null, this.response) : c; + throw a.name === "SyntaxError" ? C.from(a, C.ERR_BAD_RESPONSE, this, null, this.response) : a; } } return t; @@ -321,7 +322,7 @@ const rt = { transitional: Me, adapter: ["xhr", "http", "fetch"], transformReque v.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => { rt.headers[t] = {}; }); -const Rr = v.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]), fe = Symbol("internals"); +const Pr = v.toObjectSet(["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"]), fe = Symbol("internals"); function X(t) { return t && String(t).trim().toLowerCase(); } @@ -337,23 +338,23 @@ let j = class { } set(t, e, r) { const n = this; - function o(a, m, y) { - const g = X(m); - if (!g) throw new Error("header name must be a non-empty string"); - const s = v.findKey(n, g); - (!s || n[s] === void 0 || y === !0 || y === void 0 && n[s] !== !1) && (n[s || m] = it(a)); + function o(c, y, g) { + const m = X(y); + if (!m) throw new Error("header name must be a non-empty string"); + const s = v.findKey(n, m); + (!s || n[s] === void 0 || g === !0 || g === void 0 && n[s] !== !1) && (n[s || y] = it(c)); } - const c = (a, m) => v.forEach(a, (y, g) => o(y, g, m)); - if (v.isPlainObject(t) || t instanceof this.constructor) c(t, e); - else if (v.isString(t) && (t = t.trim()) && !/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())) c(((a) => { - const m = {}; - let y, g, s; - return a && a.split(` + const a = (c, y) => v.forEach(c, (g, m) => o(g, m, y)); + if (v.isPlainObject(t) || t instanceof this.constructor) a(t, e); + else if (v.isString(t) && (t = t.trim()) && !/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim())) a(((c) => { + const y = {}; + let g, m, s; + return c && c.split(` `).forEach(function(b) { - s = b.indexOf(":"), y = b.substring(0, s).trim().toLowerCase(), g = b.substring(s + 1).trim(), !y || m[y] && Rr[y] || (y === "set-cookie" ? m[y] ? m[y].push(g) : m[y] = [g] : m[y] = m[y] ? m[y] + ", " + g : g); - }), m; + s = b.indexOf(":"), g = b.substring(0, s).trim().toLowerCase(), m = b.substring(s + 1).trim(), !g || y[g] && Pr[g] || (g === "set-cookie" ? y[g] ? y[g].push(m) : y[g] = [m] : y[g] = y[g] ? y[g] + ", " + m : m); + }), y; })(t), e); - else if (v.isHeaders(t)) for (const [a, m] of t.entries()) o(m, a, r); + else if (v.isHeaders(t)) for (const [c, y] of t.entries()) o(y, c, r); else t != null && o(e, t, r); return this; } @@ -364,10 +365,10 @@ let j = class { const n = this[r]; if (!e) return n; if (e === !0) return function(o) { - const c = /* @__PURE__ */ Object.create(null), a = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let m; - for (; m = a.exec(o); ) c[m[1]] = m[2]; - return c; + const a = /* @__PURE__ */ Object.create(null), c = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; + let y; + for (; y = c.exec(o); ) a[y[1]] = y[2]; + return a; }(n); if (v.isFunction(e)) return e.call(this, n, r); if (v.isRegExp(e)) return e.exec(n); @@ -385,10 +386,10 @@ let j = class { delete(t, e) { const r = this; let n = !1; - function o(c) { - if (c = X(c)) { - const a = v.findKey(r, c); - !a || e && !At(0, r[a], a, e) || (delete r[a], n = !0); + function o(a) { + if (a = X(a)) { + const c = v.findKey(r, a); + !c || e && !At(0, r[c], c, e) || (delete r[c], n = !0); } } return v.isArray(t) ? t.forEach(o) : o(t), n; @@ -405,12 +406,12 @@ let j = class { normalize(t) { const e = this, r = {}; return v.forEach(this, (n, o) => { - const c = v.findKey(r, o); - if (c) return e[c] = it(n), void delete e[o]; - const a = t ? function(m) { - return m.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (y, g, s) => g.toUpperCase() + s); + const a = v.findKey(r, o); + if (a) return e[a] = it(n), void delete e[o]; + const c = t ? function(y) { + return y.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (g, m, s) => m.toUpperCase() + s); }(o) : String(o).trim(); - a !== o && delete e[o], e[a] = it(n), r[a] = !0; + c !== o && delete e[o], e[c] = it(n), r[c] = !0; }), this; } concat(...t) { @@ -442,33 +443,33 @@ let j = class { static accessor(t) { const e = (this[fe] = this[fe] = { accessors: {} }).accessors, r = this.prototype; function n(o) { - const c = X(o); - e[c] || (function(a, m) { - const y = v.toCamelCase(" " + m); - ["get", "set", "has"].forEach((g) => { - Object.defineProperty(a, g + y, { value: function(s, b, w) { - return this[g].call(this, m, s, b, w); + const a = X(o); + e[a] || (function(c, y) { + const g = v.toCamelCase(" " + y); + ["get", "set", "has"].forEach((m) => { + Object.defineProperty(c, m + g, { value: function(s, b, w) { + return this[m].call(this, y, s, b, w); }, configurable: !0 }); }); - }(r, o), e[c] = !0); + }(r, o), e[a] = !0); } return v.isArray(t) ? t.forEach(n) : n(t), this; } }; function Ot(t, e) { const r = this || rt, n = e || r, o = j.from(n.headers); - let c = n.data; - return v.forEach(t, function(a) { - c = a.call(r, c, o.normalize(), e ? e.status : void 0); - }), o.normalize(), c; + let a = n.data; + return v.forEach(t, function(c) { + a = c.call(r, a, o.normalize(), e ? e.status : void 0); + }), o.normalize(), a; } -function De(t) { +function Fe(t) { return !(!t || !t.__CANCEL__); } function G(t, e, r) { C.call(this, t ?? "canceled", C.ERR_CANCELED, e, r), this.name = "CanceledError"; } -function Fe(t, e, r) { +function Ie(t, e, r) { const n = r.config.validateStatus; r.status && n && !n(r.status) ? e(new C("Request failed with status code " + r.status, [C.ERR_BAD_REQUEST, C.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4], r.config, r.request, r)) : t(r); } @@ -480,51 +481,51 @@ j.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User }), v.freezeMethods(j), v.inherits(G, C, { __CANCEL__: !0 }); const dt = (t, e, r = 3) => { let n = 0; - const o = function(c, a) { - c = c || 10; - const m = new Array(c), y = new Array(c); - let g, s = 0, b = 0; - return a = a !== void 0 ? a : 1e3, function(w) { - const E = Date.now(), d = y[b]; - g || (g = E), m[s] = w, y[s] = E; + const o = function(a, c) { + a = a || 10; + const y = new Array(a), g = new Array(a); + let m, s = 0, b = 0; + return c = c !== void 0 ? c : 1e3, function(w) { + const E = Date.now(), d = g[b]; + m || (m = E), y[s] = w, g[s] = E; let l = b, i = 0; - for (; l !== s; ) i += m[l++], l %= c; - if (s = (s + 1) % c, s === b && (b = (b + 1) % c), E - g < a) return; + for (; l !== s; ) i += y[l++], l %= a; + if (s = (s + 1) % a, s === b && (b = (b + 1) % a), E - m < c) return; const u = d && E - d; return u ? Math.round(1e3 * i / u) : void 0; }; }(50, 250); - return function(c, a) { - let m = 0; - const y = 1e3 / a; - let g = null; + return function(a, c) { + let y = 0; + const g = 1e3 / c; + let m = null; return function() { const s = this === !0, b = Date.now(); - if (s || b - m > y) return g && (clearTimeout(g), g = null), m = b, c.apply(null, arguments); - g || (g = setTimeout(() => (g = null, m = Date.now(), c.apply(null, arguments)), y - (b - m))); + if (s || b - y > g) return m && (clearTimeout(m), m = null), y = b, a.apply(null, arguments); + m || (m = setTimeout(() => (m = null, y = Date.now(), a.apply(null, arguments)), g - (b - y))); }; - }((c) => { - const a = c.loaded, m = c.lengthComputable ? c.total : void 0, y = a - n, g = o(y); - n = a; - const s = { loaded: a, total: m, progress: m ? a / m : void 0, bytes: y, rate: g || void 0, estimated: g && m && a <= m ? (m - a) / g : void 0, event: c, lengthComputable: m != null }; + }((a) => { + const c = a.loaded, y = a.lengthComputable ? a.total : void 0, g = c - n, m = o(g); + n = c; + const s = { loaded: c, total: y, progress: y ? c / y : void 0, bytes: g, rate: m || void 0, estimated: m && y && c <= y ? (y - c) / m : void 0, event: a, lengthComputable: y != null }; s[e ? "download" : "upload"] = !0, t(s); }, r); -}, Tr = U.hasStandardBrowserEnv ? function() { +}, jr = U.hasStandardBrowserEnv ? function() { const t = /(msie|trident)/i.test(navigator.userAgent), e = document.createElement("a"); let r; function n(o) { - let c = o; - return t && (e.setAttribute("href", c), c = e.href), e.setAttribute("href", c), { href: e.href, protocol: e.protocol ? e.protocol.replace(/:$/, "") : "", host: e.host, search: e.search ? e.search.replace(/^\?/, "") : "", hash: e.hash ? e.hash.replace(/^#/, "") : "", hostname: e.hostname, port: e.port, pathname: e.pathname.charAt(0) === "/" ? e.pathname : "/" + e.pathname }; + let a = o; + return t && (e.setAttribute("href", a), a = e.href), e.setAttribute("href", a), { href: e.href, protocol: e.protocol ? e.protocol.replace(/:$/, "") : "", host: e.host, search: e.search ? e.search.replace(/^\?/, "") : "", hash: e.hash ? e.hash.replace(/^#/, "") : "", hostname: e.hostname, port: e.port, pathname: e.pathname.charAt(0) === "/" ? e.pathname : "/" + e.pathname }; } return r = n(window.location.href), function(o) { - const c = v.isString(o) ? n(o) : o; - return c.protocol === r.protocol && c.host === r.host; + const a = v.isString(o) ? n(o) : o; + return a.protocol === r.protocol && a.host === r.host; }; }() : function() { return !0; -}, xr = U.hasStandardBrowserEnv ? { write(t, e, r, n, o, c) { - const a = [t + "=" + encodeURIComponent(e)]; - v.isNumber(r) && a.push("expires=" + new Date(r).toGMTString()), v.isString(n) && a.push("path=" + n), v.isString(o) && a.push("domain=" + o), c === !0 && a.push("secure"), document.cookie = a.join("; "); +}, kr = U.hasStandardBrowserEnv ? { write(t, e, r, n, o, a) { + const c = [t + "=" + encodeURIComponent(e)]; + v.isNumber(r) && c.push("expires=" + new Date(r).toGMTString()), v.isString(n) && c.push("path=" + n), v.isString(o) && c.push("domain=" + o), a === !0 && c.push("secure"), document.cookie = c.join("; "); }, read(t) { const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)")); return e ? decodeURIComponent(e[3]) : null; @@ -533,7 +534,7 @@ const dt = (t, e, r = 3) => { } } : { write() { }, read: () => null, remove() { } }; -function Ie(t, e) { +function qe(t, e) { return t && !/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e) ? function(r, n) { return n ? r.replace(/\/?\/$/, "") + "/" + n.replace(/^\/+/, "") : r; }(t, e) : e; @@ -542,150 +543,150 @@ const he = (t) => t instanceof j ? { ...t } : t; function H(t, e) { e = e || {}; const r = {}; - function n(g, s, b) { - return v.isPlainObject(g) && v.isPlainObject(s) ? v.merge.call({ caseless: b }, g, s) : v.isPlainObject(s) ? v.merge({}, s) : v.isArray(s) ? s.slice() : s; + function n(m, s, b) { + return v.isPlainObject(m) && v.isPlainObject(s) ? v.merge.call({ caseless: b }, m, s) : v.isPlainObject(s) ? v.merge({}, s) : v.isArray(s) ? s.slice() : s; } - function o(g, s, b) { - return v.isUndefined(s) ? v.isUndefined(g) ? void 0 : n(void 0, g, b) : n(g, s, b); + function o(m, s, b) { + return v.isUndefined(s) ? v.isUndefined(m) ? void 0 : n(void 0, m, b) : n(m, s, b); } - function c(g, s) { + function a(m, s) { if (!v.isUndefined(s)) return n(void 0, s); } - function a(g, s) { - return v.isUndefined(s) ? v.isUndefined(g) ? void 0 : n(void 0, g) : n(void 0, s); + function c(m, s) { + return v.isUndefined(s) ? v.isUndefined(m) ? void 0 : n(void 0, m) : n(void 0, s); } - function m(g, s, b) { - return b in e ? n(g, s) : b in t ? n(void 0, g) : void 0; + function y(m, s, b) { + return b in e ? n(m, s) : b in t ? n(void 0, m) : void 0; } - const y = { url: c, method: c, data: c, baseURL: a, transformRequest: a, transformResponse: a, paramsSerializer: a, timeout: a, timeoutMessage: a, withCredentials: a, withXSRFToken: a, adapter: a, responseType: a, xsrfCookieName: a, xsrfHeaderName: a, onUploadProgress: a, onDownloadProgress: a, decompress: a, maxContentLength: a, maxBodyLength: a, beforeRedirect: a, transport: a, httpAgent: a, httpsAgent: a, cancelToken: a, socketPath: a, responseEncoding: a, validateStatus: m, headers: (g, s) => o(he(g), he(s), !0) }; - return v.forEach(Object.keys(Object.assign({}, t, e)), function(g) { - const s = y[g] || o, b = s(t[g], e[g], g); - v.isUndefined(b) && s !== m || (r[g] = b); + const g = { url: a, method: a, data: a, baseURL: c, transformRequest: c, transformResponse: c, paramsSerializer: c, timeout: c, timeoutMessage: c, withCredentials: c, withXSRFToken: c, adapter: c, responseType: c, xsrfCookieName: c, xsrfHeaderName: c, onUploadProgress: c, onDownloadProgress: c, decompress: c, maxContentLength: c, maxBodyLength: c, beforeRedirect: c, transport: c, httpAgent: c, httpsAgent: c, cancelToken: c, socketPath: c, responseEncoding: c, validateStatus: y, headers: (m, s) => o(he(m), he(s), !0) }; + return v.forEach(Object.keys(Object.assign({}, t, e)), function(m) { + const s = g[m] || o, b = s(t[m], e[m], m); + v.isUndefined(b) && s !== y || (r[m] = b); }), r; } -const qe = (t) => { +const We = (t) => { const e = H({}, t); - let r, { data: n, withXSRFToken: o, xsrfHeaderName: c, xsrfCookieName: a, headers: m, auth: y } = e; - if (e.headers = m = j.from(m), e.url = Be(Ie(e.baseURL, e.url), t.params, t.paramsSerializer), y && m.set("Authorization", "Basic " + btoa((y.username || "") + ":" + (y.password ? unescape(encodeURIComponent(y.password)) : ""))), v.isFormData(n)) { - if (U.hasStandardBrowserEnv || U.hasStandardBrowserWebWorkerEnv) m.setContentType(void 0); - else if ((r = m.getContentType()) !== !1) { - const [g, ...s] = r ? r.split(";").map((b) => b.trim()).filter(Boolean) : []; - m.setContentType([g || "multipart/form-data", ...s].join("; ")); + let r, { data: n, withXSRFToken: o, xsrfHeaderName: a, xsrfCookieName: c, headers: y, auth: g } = e; + if (e.headers = y = j.from(y), e.url = Me(qe(e.baseURL, e.url), t.params, t.paramsSerializer), g && y.set("Authorization", "Basic " + btoa((g.username || "") + ":" + (g.password ? unescape(encodeURIComponent(g.password)) : ""))), v.isFormData(n)) { + if (U.hasStandardBrowserEnv || U.hasStandardBrowserWebWorkerEnv) y.setContentType(void 0); + else if ((r = y.getContentType()) !== !1) { + const [m, ...s] = r ? r.split(";").map((b) => b.trim()).filter(Boolean) : []; + y.setContentType([m || "multipart/form-data", ...s].join("; ")); } } - if (U.hasStandardBrowserEnv && (o && v.isFunction(o) && (o = o(e)), o || o !== !1 && Tr(e.url))) { - const g = c && a && xr.read(a); - g && m.set(c, g); + if (U.hasStandardBrowserEnv && (o && v.isFunction(o) && (o = o(e)), o || o !== !1 && jr(e.url))) { + const m = a && c && kr.read(c); + m && y.set(a, m); } return e; -}, Nr = typeof XMLHttpRequest < "u" && function(t) { +}, Ur = typeof XMLHttpRequest < "u" && function(t) { return new Promise(function(e, r) { - const n = qe(t); + const n = We(t); let o = n.data; - const c = j.from(n.headers).normalize(); - let a, { responseType: m } = n; - function y() { - n.cancelToken && n.cancelToken.unsubscribe(a), n.signal && n.signal.removeEventListener("abort", a); + const a = j.from(n.headers).normalize(); + let c, { responseType: y } = n; + function g() { + n.cancelToken && n.cancelToken.unsubscribe(c), n.signal && n.signal.removeEventListener("abort", c); } - let g = new XMLHttpRequest(); + let m = new XMLHttpRequest(); function s() { - if (!g) return; - const w = j.from("getAllResponseHeaders" in g && g.getAllResponseHeaders()); - Fe(function(E) { - e(E), y(); + if (!m) return; + const w = j.from("getAllResponseHeaders" in m && m.getAllResponseHeaders()); + Ie(function(E) { + e(E), g(); }, function(E) { - r(E), y(); - }, { data: m && m !== "text" && m !== "json" ? g.response : g.responseText, status: g.status, statusText: g.statusText, headers: w, config: t, request: g }), g = null; + r(E), g(); + }, { data: y && y !== "text" && y !== "json" ? m.response : m.responseText, status: m.status, statusText: m.statusText, headers: w, config: t, request: m }), m = null; } - g.open(n.method.toUpperCase(), n.url, !0), g.timeout = n.timeout, "onloadend" in g ? g.onloadend = s : g.onreadystatechange = function() { - g && g.readyState === 4 && (g.status !== 0 || g.responseURL && g.responseURL.indexOf("file:") === 0) && setTimeout(s); - }, g.onabort = function() { - g && (r(new C("Request aborted", C.ECONNABORTED, n, g)), g = null); - }, g.onerror = function() { - r(new C("Network Error", C.ERR_NETWORK, n, g)), g = null; - }, g.ontimeout = function() { + m.open(n.method.toUpperCase(), n.url, !0), m.timeout = n.timeout, "onloadend" in m ? m.onloadend = s : m.onreadystatechange = function() { + m && m.readyState === 4 && (m.status !== 0 || m.responseURL && m.responseURL.indexOf("file:") === 0) && setTimeout(s); + }, m.onabort = function() { + m && (r(new C("Request aborted", C.ECONNABORTED, n, m)), m = null); + }, m.onerror = function() { + r(new C("Network Error", C.ERR_NETWORK, n, m)), m = null; + }, m.ontimeout = function() { let w = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded"; - const E = n.transitional || Me; - n.timeoutErrorMessage && (w = n.timeoutErrorMessage), r(new C(w, E.clarifyTimeoutError ? C.ETIMEDOUT : C.ECONNABORTED, n, g)), g = null; - }, o === void 0 && c.setContentType(null), "setRequestHeader" in g && v.forEach(c.toJSON(), function(w, E) { - g.setRequestHeader(E, w); - }), v.isUndefined(n.withCredentials) || (g.withCredentials = !!n.withCredentials), m && m !== "json" && (g.responseType = n.responseType), typeof n.onDownloadProgress == "function" && g.addEventListener("progress", dt(n.onDownloadProgress, !0)), typeof n.onUploadProgress == "function" && g.upload && g.upload.addEventListener("progress", dt(n.onUploadProgress)), (n.cancelToken || n.signal) && (a = (w) => { - g && (r(!w || w.type ? new G(null, t, g) : w), g.abort(), g = null); - }, n.cancelToken && n.cancelToken.subscribe(a), n.signal && (n.signal.aborted ? a() : n.signal.addEventListener("abort", a))); + const E = n.transitional || Le; + n.timeoutErrorMessage && (w = n.timeoutErrorMessage), r(new C(w, E.clarifyTimeoutError ? C.ETIMEDOUT : C.ECONNABORTED, n, m)), m = null; + }, o === void 0 && a.setContentType(null), "setRequestHeader" in m && v.forEach(a.toJSON(), function(w, E) { + m.setRequestHeader(E, w); + }), v.isUndefined(n.withCredentials) || (m.withCredentials = !!n.withCredentials), y && y !== "json" && (m.responseType = n.responseType), typeof n.onDownloadProgress == "function" && m.addEventListener("progress", dt(n.onDownloadProgress, !0)), typeof n.onUploadProgress == "function" && m.upload && m.upload.addEventListener("progress", dt(n.onUploadProgress)), (n.cancelToken || n.signal) && (c = (w) => { + m && (r(!w || w.type ? new G(null, t, m) : w), m.abort(), m = null); + }, n.cancelToken && n.cancelToken.subscribe(c), n.signal && (n.signal.aborted ? c() : n.signal.addEventListener("abort", c))); const b = function(w) { const E = /^([-+\w]{1,25})(:?\/\/|:)/.exec(w); return E && E[1] || ""; }(n.url); - b && U.protocols.indexOf(b) === -1 ? r(new C("Unsupported protocol " + b + ":", C.ERR_BAD_REQUEST, t)) : g.send(o || null); + b && U.protocols.indexOf(b) === -1 ? r(new C("Unsupported protocol " + b + ":", C.ERR_BAD_REQUEST, t)) : m.send(o || null); }); -}, _r = (t, e) => { +}, Br = (t, e) => { let r, n = new AbortController(); - const o = function(y) { + const o = function(g) { if (!r) { - r = !0, a(); - const g = y instanceof Error ? y : this.reason; - n.abort(g instanceof C ? g : new G(g instanceof Error ? g.message : g)); + r = !0, c(); + const m = g instanceof Error ? g : this.reason; + n.abort(m instanceof C ? m : new G(m instanceof Error ? m.message : m)); } }; - let c = e && setTimeout(() => { + let a = e && setTimeout(() => { o(new C(`timeout ${e} of ms exceeded`, C.ETIMEDOUT)); }, e); - const a = () => { - t && (c && clearTimeout(c), c = null, t.forEach((y) => { - y && (y.removeEventListener ? y.removeEventListener("abort", o) : y.unsubscribe(o)); + const c = () => { + t && (a && clearTimeout(a), a = null, t.forEach((g) => { + g && (g.removeEventListener ? g.removeEventListener("abort", o) : g.unsubscribe(o)); }), t = null); }; - t.forEach((y) => y && y.addEventListener && y.addEventListener("abort", o)); - const { signal: m } = n; - return m.unsubscribe = a, [m, () => { - c && clearTimeout(c), c = null; + t.forEach((g) => g && g.addEventListener && g.addEventListener("abort", o)); + const { signal: y } = n; + return y.unsubscribe = c, [y, () => { + a && clearTimeout(a), a = null; }]; -}, Pr = function* (t, e) { +}, Mr = function* (t, e) { let r = t.byteLength; if (!e || r < e) return void (yield t); let n, o = 0; for (; o < r; ) n = o + e, yield t.slice(o, n), o = n; }, de = (t, e, r, n, o) => { - const c = async function* (m, y, g) { - for await (const s of m) yield* Pr(ArrayBuffer.isView(s) ? s : await g(String(s)), y); + const a = async function* (y, g, m) { + for await (const s of y) yield* Mr(ArrayBuffer.isView(s) ? s : await m(String(s)), g); }(t, e, o); - let a = 0; - return new ReadableStream({ type: "bytes", async pull(m) { - const { done: y, value: g } = await c.next(); - if (y) return m.close(), void n(); - let s = g.byteLength; - r && r(a += s), m.enqueue(new Uint8Array(g)); - }, cancel: (m) => (n(m), c.return()) }, { highWaterMark: 2 }); + let c = 0; + return new ReadableStream({ type: "bytes", async pull(y) { + const { done: g, value: m } = await a.next(); + if (g) return y.close(), void n(); + let s = m.byteLength; + r && r(c += s), y.enqueue(new Uint8Array(m)); + }, cancel: (y) => (n(y), a.return()) }, { highWaterMark: 2 }); }, pe = (t, e) => { const r = t != null; return (n) => setTimeout(() => e({ lengthComputable: r, total: t, loaded: n })); -}, yt = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", We = yt && typeof ReadableStream == "function", _t = yt && (typeof TextEncoder == "function" ? (ge = new TextEncoder(), (t) => ge.encode(t)) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())); +}, mt = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", $e = mt && typeof ReadableStream == "function", Nt = mt && (typeof TextEncoder == "function" ? (ge = new TextEncoder(), (t) => ge.encode(t)) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())); var ge; -const jr = We && (() => { +const Lr = $e && (() => { let t = !1; const e = new Request(U.origin, { body: new ReadableStream(), method: "POST", get duplex() { return t = !0, "half"; } }).headers.has("Content-Type"); return t && !e; -})(), Pt = We && !!(() => { +})(), Pt = $e && !!(() => { try { return v.isReadableStream(new Response("").body); } catch { } })(), pt = { stream: Pt && ((t) => t.body) }; -var ye; -yt && (ye = new Response(), ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { - !pt[t] && (pt[t] = v.isFunction(ye[t]) ? (e) => e[t]() : (e, r) => { +var me; +mt && (me = new Response(), ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { + !pt[t] && (pt[t] = v.isFunction(me[t]) ? (e) => e[t]() : (e, r) => { throw new C(`Response type '${t}' is not supported`, C.ERR_NOT_SUPPORT, r); }); })); -const kr = async (t, e) => { +const Dr = async (t, e) => { const r = v.toFiniteNumber(t.getContentLength()); - return r ?? (async (n) => n == null ? 0 : v.isBlob(n) ? n.size : v.isSpecCompliantForm(n) ? (await new Request(n).arrayBuffer()).byteLength : v.isArrayBufferView(n) ? n.byteLength : (v.isURLSearchParams(n) && (n += ""), v.isString(n) ? (await _t(n)).byteLength : void 0))(e); -}, $e = { http: null, xhr: Nr, fetch: yt && (async (t) => { - let { url: e, method: r, data: n, signal: o, cancelToken: c, timeout: a, onDownloadProgress: m, onUploadProgress: y, responseType: g, headers: s, withCredentials: b = "same-origin", fetchOptions: w } = qe(t); - g = g ? (g + "").toLowerCase() : "text"; - let E, d, [l, i] = o || c || a ? _r([o, c], a) : []; + return r ?? (async (n) => n == null ? 0 : v.isBlob(n) ? n.size : v.isSpecCompliantForm(n) ? (await new Request(n).arrayBuffer()).byteLength : v.isArrayBufferView(n) ? n.byteLength : (v.isURLSearchParams(n) && (n += ""), v.isString(n) ? (await Nt(n)).byteLength : void 0))(e); +}, He = { http: null, xhr: Ur, fetch: mt && (async (t) => { + let { url: e, method: r, data: n, signal: o, cancelToken: a, timeout: c, onDownloadProgress: y, onUploadProgress: g, responseType: m, headers: s, withCredentials: b = "same-origin", fetchOptions: w } = We(t); + m = m ? (m + "").toLowerCase() : "text"; + let E, d, [l, i] = o || a || c ? Br([o, a], c) : []; const u = () => { !E && setTimeout(() => { l && l.unsubscribe(); @@ -693,31 +694,31 @@ const kr = async (t, e) => { }; let h; try { - if (y && jr && r !== "get" && r !== "head" && (h = await kr(s, n)) !== 0) { - let O, T = new Request(e, { method: "POST", body: n, duplex: "half" }); - v.isFormData(n) && (O = T.headers.get("content-type")) && s.setContentType(O), T.body && (n = de(T.body, 65536, pe(h, dt(y)), null, _t)); + if (g && Lr && r !== "get" && r !== "head" && (h = await Dr(s, n)) !== 0) { + let O, x = new Request(e, { method: "POST", body: n, duplex: "half" }); + v.isFormData(n) && (O = x.headers.get("content-type")) && s.setContentType(O), x.body && (n = de(x.body, 65536, pe(h, dt(g)), null, Nt)); } v.isString(b) || (b = b ? "cors" : "omit"), d = new Request(e, { ...w, signal: l, method: r.toUpperCase(), headers: s.normalize().toJSON(), body: n, duplex: "half", withCredentials: b }); let p = await fetch(d); - const f = Pt && (g === "stream" || g === "response"); - if (Pt && (m || f)) { + const f = Pt && (m === "stream" || m === "response"); + if (Pt && (y || f)) { const O = {}; ["status", "statusText", "headers"].forEach((P) => { O[P] = p[P]; }); - const T = v.toFiniteNumber(p.headers.get("content-length")); - p = new Response(de(p.body, 65536, m && pe(T, dt(m, !0)), f && u, _t), O); + const x = v.toFiniteNumber(p.headers.get("content-length")); + p = new Response(de(p.body, 65536, y && pe(x, dt(y, !0)), f && u, Nt), O); } - g = g || "text"; - let A = await pt[v.findKey(pt, g) || "text"](p, t); - return !f && u(), i && i(), await new Promise((O, T) => { - Fe(O, T, { data: A, headers: j.from(p.headers), status: p.status, statusText: p.statusText, config: t, request: d }); + m = m || "text"; + let A = await pt[v.findKey(pt, m) || "text"](p, t); + return !f && u(), i && i(), await new Promise((O, x) => { + Ie(O, x, { data: A, headers: j.from(p.headers), status: p.status, statusText: p.statusText, config: t, request: d }); }); } catch (p) { throw u(), p && p.name === "TypeError" && /fetch/i.test(p.message) ? Object.assign(new C("Network Error", C.ERR_NETWORK, t, d), { cause: p.cause || p }) : C.from(p, p && p.code, t, d); } }) }; -v.forEach($e, (t, e) => { +v.forEach(He, (t, e) => { if (t) { try { Object.defineProperty(t, "name", { value: e }); @@ -726,22 +727,22 @@ v.forEach($e, (t, e) => { Object.defineProperty(t, "adapterName", { value: e }); } }); -const me = (t) => `- ${t}`, Ur = (t) => v.isFunction(t) || t === null || t === !1, He = (t) => { +const ye = (t) => `- ${t}`, Fr = (t) => v.isFunction(t) || t === null || t === !1, Je = (t) => { t = v.isArray(t) ? t : [t]; const { length: e } = t; let r, n; const o = {}; - for (let c = 0; c < e; c++) { - let a; - if (r = t[c], n = r, !Ur(r) && (n = $e[(a = String(r)).toLowerCase()], n === void 0)) throw new C(`Unknown adapter '${a}'`); + for (let a = 0; a < e; a++) { + let c; + if (r = t[a], n = r, !Fr(r) && (n = He[(c = String(r)).toLowerCase()], n === void 0)) throw new C(`Unknown adapter '${c}'`); if (n) break; - o[a || "#" + c] = n; + o[c || "#" + a] = n; } if (!n) { - const c = Object.entries(o).map(([a, m]) => `adapter ${a} ` + (m === !1 ? "is not supported by the environment" : "is not available in the build")); - throw new C("There is no suitable adapter to dispatch the request " + (e ? c.length > 1 ? `since : -` + c.map(me).join(` -`) : " " + me(c[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); + const a = Object.entries(o).map(([c, y]) => `adapter ${c} ` + (y === !1 ? "is not supported by the environment" : "is not available in the build")); + throw new C("There is no suitable adapter to dispatch the request " + (e ? a.length > 1 ? `since : +` + a.map(ye).join(` +`) : " " + ye(a[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); } return n; }; @@ -749,13 +750,13 @@ function St(t) { if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted) throw new G(null, t); } function be(t) { - return St(t), t.headers = j.from(t.headers), t.data = Ot.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), He(t.adapter || rt.adapter)(t).then(function(e) { + return St(t), t.headers = j.from(t.headers), t.data = Ot.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Je(t.adapter || rt.adapter)(t).then(function(e) { return St(t), e.data = Ot.call(t, t.transformResponse, e), e.headers = j.from(e.headers), e; }, function(e) { - return De(e) || (St(t), e && e.response && (e.response.data = Ot.call(t, t.transformResponse, e.response), e.response.headers = j.from(e.response.headers))), Promise.reject(e); + return Fe(e) || (St(t), e && e.response && (e.response.data = Ot.call(t, t.transformResponse, e.response), e.response.headers = j.from(e.response.headers))), Promise.reject(e); }); } -const Br = "1.7.2", Kt = {}; +const Ir = "1.7.2", Kt = {}; ["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => { Kt[t] = function(r) { return typeof r === t || "a" + (e < 1 ? "n " : " ") + t; @@ -763,12 +764,12 @@ const Br = "1.7.2", Kt = {}; }); const we = {}; Kt.transitional = function(t, e, r) { - function n(o, c) { - return "[Axios v1.7.2] Transitional option '" + o + "'" + c + (r ? ". " + r : ""); + function n(o, a) { + return "[Axios v1.7.2] Transitional option '" + o + "'" + a + (r ? ". " + r : ""); } - return (o, c, a) => { - if (t === !1) throw new C(n(c, " has been removed" + (e ? " in " + e : "")), C.ERR_DEPRECATED); - return e && !we[c] && (we[c] = !0, console.warn(n(c, " has been deprecated since v" + e + " and will be removed in the near future"))), !t || t(o, c, a); + return (o, a, c) => { + if (t === !1) throw new C(n(a, " has been removed" + (e ? " in " + e : "")), C.ERR_DEPRECATED); + return e && !we[a] && (we[a] = !0, console.warn(n(a, " has been deprecated since v" + e + " and will be removed in the near future"))), !t || t(o, a, c); }; }; const jt = { assertOptions: function(t, e, r) { @@ -776,11 +777,11 @@ const jt = { assertOptions: function(t, e, r) { const n = Object.keys(t); let o = n.length; for (; o-- > 0; ) { - const c = n[o], a = e[c]; - if (a) { - const m = t[c], y = m === void 0 || a(m, c, t); - if (y !== !0) throw new C("option " + c + " must be " + y, C.ERR_BAD_OPTION_VALUE); - } else if (r !== !0) throw new C("Unknown option " + c, C.ERR_BAD_OPTION); + const a = n[o], c = e[a]; + if (c) { + const y = t[a], g = y === void 0 || c(y, a, t); + if (g !== !0) throw new C("option " + a + " must be " + g, C.ERR_BAD_OPTION_VALUE); + } else if (r !== !0) throw new C("Unknown option " + a, C.ERR_BAD_OPTION); } }, validators: Kt }, F = jt.validators; let $ = class { @@ -808,30 +809,30 @@ let $ = class { typeof t == "string" ? (e = e || {}).url = t : e = t || {}, e = H(this.defaults, e); const { transitional: r, paramsSerializer: n, headers: o } = e; r !== void 0 && jt.assertOptions(r, { silentJSONParsing: F.transitional(F.boolean), forcedJSONParsing: F.transitional(F.boolean), clarifyTimeoutError: F.transitional(F.boolean) }, !1), n != null && (v.isFunction(n) ? e.paramsSerializer = { serialize: n } : jt.assertOptions(n, { encode: F.function, serialize: F.function }, !0)), e.method = (e.method || this.defaults.method || "get").toLowerCase(); - let c = o && v.merge(o.common, o[e.method]); + let a = o && v.merge(o.common, o[e.method]); o && v.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (E) => { delete o[E]; - }), e.headers = j.concat(c, o); - const a = []; - let m = !0; + }), e.headers = j.concat(a, o); + const c = []; + let y = !0; this.interceptors.request.forEach(function(E) { - typeof E.runWhen == "function" && E.runWhen(e) === !1 || (m = m && E.synchronous, a.unshift(E.fulfilled, E.rejected)); + typeof E.runWhen == "function" && E.runWhen(e) === !1 || (y = y && E.synchronous, c.unshift(E.fulfilled, E.rejected)); }); - const y = []; - let g; + const g = []; + let m; this.interceptors.response.forEach(function(E) { - y.push(E.fulfilled, E.rejected); + g.push(E.fulfilled, E.rejected); }); let s, b = 0; - if (!m) { + if (!y) { const E = [be.bind(this), void 0]; - for (E.unshift.apply(E, a), E.push.apply(E, y), s = E.length, g = Promise.resolve(e); b < s; ) g = g.then(E[b++], E[b++]); - return g; + for (E.unshift.apply(E, c), E.push.apply(E, g), s = E.length, m = Promise.resolve(e); b < s; ) m = m.then(E[b++], E[b++]); + return m; } - s = a.length; + s = c.length; let w = e; for (b = 0; b < s; ) { - const E = a[b++], d = a[b++]; + const E = c[b++], d = c[b++]; try { w = E(w); } catch (l) { @@ -840,15 +841,15 @@ let $ = class { } } try { - g = be.call(this, w); + m = be.call(this, w); } catch (E) { return Promise.reject(E); } - for (b = 0, s = y.length; b < s; ) g = g.then(y[b++], y[b++]); - return g; + for (b = 0, s = g.length; b < s; ) m = m.then(g[b++], g[b++]); + return m; } getUri(t) { - return Be(Ie((t = H(this.defaults, t)).baseURL, t.url), t.params, t.paramsSerializer); + return Me(qe((t = H(this.defaults, t)).baseURL, t.url), t.params, t.paramsSerializer); } }; v.forEach(["delete", "get", "head", "options"], function(t) { @@ -857,8 +858,8 @@ v.forEach(["delete", "get", "head", "options"], function(t) { }; }), v.forEach(["post", "put", "patch"], function(t) { function e(r) { - return function(n, o, c) { - return this.request(H(c || {}, { method: t, headers: r ? { "Content-Type": "multipart/form-data" } : {}, url: n, data: o })); + return function(n, o, a) { + return this.request(H(a || {}, { method: t, headers: r ? { "Content-Type": "multipart/form-data" } : {}, url: n, data: o })); }; } $.prototype[t] = e(), $.prototype[t + "Form"] = e(!0); @@ -867,13 +868,13 @@ const kt = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints Object.entries(kt).forEach(([t, e]) => { kt[e] = t; }); -const N = function t(e) { - const r = new $(e), n = je($.prototype.request, r); +const _ = function t(e) { + const r = new $(e), n = ke($.prototype.request, r); return v.extend(n, $.prototype, r, { allOwnKeys: !0 }), v.extend(n, r, null, { allOwnKeys: !0 }), n.create = function(o) { return t(H(e, o)); }, n; }(rt); -N.Axios = $, N.CanceledError = G, N.CancelToken = class Je { +_.Axios = $, _.CanceledError = G, _.CancelToken = class ze { constructor(e) { if (typeof e != "function") throw new TypeError("executor must be a function."); let r; @@ -883,19 +884,19 @@ N.Axios = $, N.CanceledError = G, N.CancelToken = class Je { const n = this; this.promise.then((o) => { if (!n._listeners) return; - let c = n._listeners.length; - for (; c-- > 0; ) n._listeners[c](o); + let a = n._listeners.length; + for (; a-- > 0; ) n._listeners[a](o); n._listeners = null; }), this.promise.then = (o) => { - let c; - const a = new Promise((m) => { - n.subscribe(m), c = m; + let a; + const c = new Promise((y) => { + n.subscribe(y), a = y; }).then(o); - return a.cancel = function() { - n.unsubscribe(c); - }, a; - }, e(function(o, c, a) { - n.reason || (n.reason = new G(o, c, a), r(n.reason)); + return c.cancel = function() { + n.unsubscribe(a); + }, c; + }, e(function(o, a, c) { + n.reason || (n.reason = new G(o, a, c), r(n.reason)); }); } throwIfRequested() { @@ -911,24 +912,24 @@ N.Axios = $, N.CanceledError = G, N.CancelToken = class Je { } static source() { let e; - return { token: new Je(function(r) { + return { token: new ze(function(r) { e = r; }), cancel: e }; } -}, N.isCancel = De, N.VERSION = Br, N.toFormData = ht, N.AxiosError = C, N.Cancel = N.CanceledError, N.all = function(t) { +}, _.isCancel = Fe, _.VERSION = Ir, _.toFormData = ht, _.AxiosError = C, _.Cancel = _.CanceledError, _.all = function(t) { return Promise.all(t); -}, N.spread = function(t) { +}, _.spread = function(t) { return function(e) { return t.apply(null, e); }; -}, N.isAxiosError = function(t) { +}, _.isAxiosError = function(t) { return v.isObject(t) && t.isAxiosError === !0; -}, N.mergeConfig = H, N.AxiosHeaders = j, N.formToJSON = (t) => Le(v.isHTMLForm(t) ? new FormData(t) : t), N.getAdapter = He, N.HttpStatusCode = kt, N.default = N; -const { Axios: Mr, AxiosError: Lr, CanceledError: Dr, isCancel: Fr, CancelToken: Ir, VERSION: qr, all: Wr, Cancel: $r, isAxiosError: Hr, spread: Jr, toFormData: zr, AxiosHeaders: Vr, HttpStatusCode: Kr, formToJSON: Gr, getAdapter: Xr, mergeConfig: Qr } = N, Zr = Object.freeze(Object.defineProperty({ __proto__: null, Axios: Mr, AxiosError: Lr, AxiosHeaders: Vr, Cancel: $r, CancelToken: Ir, CanceledError: Dr, HttpStatusCode: Kr, VERSION: qr, all: Wr, default: N, formToJSON: Gr, getAdapter: Xr, isAxiosError: Hr, isCancel: Fr, mergeConfig: Qr, spread: Jr, toFormData: zr }, Symbol.toStringTag, { value: "Module" })); -function mt(t) { +}, _.mergeConfig = H, _.AxiosHeaders = j, _.formToJSON = (t) => De(v.isHTMLForm(t) ? new FormData(t) : t), _.getAdapter = Je, _.HttpStatusCode = kt, _.default = _; +const { Axios: qr, AxiosError: Wr, CanceledError: $r, isCancel: Hr, CancelToken: Jr, VERSION: zr, all: Vr, Cancel: Kr, isAxiosError: Gr, spread: Xr, toFormData: Qr, AxiosHeaders: Zr, HttpStatusCode: Yr, formToJSON: tn, getAdapter: en, mergeConfig: rn } = _, nn = Object.freeze(Object.defineProperty({ __proto__: null, Axios: qr, AxiosError: Wr, AxiosHeaders: Zr, Cancel: Kr, CancelToken: Jr, CanceledError: $r, HttpStatusCode: Yr, VERSION: zr, all: Vr, default: _, formToJSON: tn, getAdapter: en, isAxiosError: Gr, isCancel: Hr, mergeConfig: rn, spread: Xr, toFormData: Qr }, Symbol.toStringTag, { value: "Module" })); +function yt(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -function Yr(t) { +function on(t) { if (t.__esModule) return t; var e = t.default; if (typeof e == "function") { @@ -945,11 +946,11 @@ function Yr(t) { }), r; } var Ut = { exports: {} }; -const ve = Yr(Zr), ze = function t(e, r) { +const ve = on(nn), Ve = function t(e, r) { if (e === r) return !0; if (e && r && typeof e == "object" && typeof r == "object") { if (e.constructor !== r.constructor) return !1; - var n, o, c; + var n, o, a; if (Array.isArray(e)) { if ((n = e.length) != r.length) return !1; for (o = n; o-- != 0; ) if (!t(e[o], r[o])) return !1; @@ -958,18 +959,18 @@ const ve = Yr(Zr), ze = function t(e, r) { if (e.constructor === RegExp) return e.source === r.source && e.flags === r.flags; if (e.valueOf !== Object.prototype.valueOf) return e.valueOf() === r.valueOf(); if (e.toString !== Object.prototype.toString) return e.toString() === r.toString(); - if ((n = (c = Object.keys(e)).length) !== Object.keys(r).length) return !1; - for (o = n; o-- != 0; ) if (!Object.prototype.hasOwnProperty.call(r, c[o])) return !1; + if ((n = (a = Object.keys(e)).length) !== Object.keys(r).length) return !1; + for (o = n; o-- != 0; ) if (!Object.prototype.hasOwnProperty.call(r, a[o])) return !1; for (o = n; o-- != 0; ) { - var a = c[o]; - if (!t(e[a], r[a])) return !1; + var c = a[o]; + if (!t(e[c], r[c])) return !1; } return !0; } return e != e && r != r; -}, Ve = function(t) { +}, Ke = function(t) { return t != null && t.constructor != null && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t); -}, Ke = ( +}, Ge = ( /*! * MIT License * @@ -991,7 +992,7 @@ const ve = Yr(Zr), ze = function t(e, r) { function(t) { return typeof Blob < "u" && (t instanceof Blob || Object.prototype.toString.call(t) === "[object Blob]"); } -), Ge = Object.prototype.toString; +), Xe = Object.prototype.toString; function Ee(t, e) { const r = t.length; for (let n = 0; n < r; n++) { @@ -1002,9 +1003,9 @@ function Ee(t, e) { function Gt(t) { return t !== null && typeof t == "object"; } -function tn(t) { +function sn(t) { return Gt(t) && function(e) { - return Ge.call(e) === "[object Function]"; + return Xe.call(e) === "[object Function]"; }(t.pipe); } function Ae(t, e) { @@ -1016,19 +1017,19 @@ function Oe(t, e) { function Se(t, e, r) { return Bt(e, r.params) && function(n, o) { if (o === void 0) return !0; - let c; + let a; try { - c = JSON.parse(n); + a = JSON.parse(n); } catch { } - return Bt(c || n, o); + return Bt(a || n, o); }(t, r.data); } function Bt(t, e) { - return e === void 0 || (typeof e.asymmetricMatch == "function" ? e.asymmetricMatch(t) : ze(t, e)); + return e === void 0 || (typeof e.asymmetricMatch == "function" ? e.asymmetricMatch(t) : Ve(t, e)); } -function en(t) { - return e = t, Ge.call(e) === "[object ArrayBuffer]" || Ve(t) || tn(t) || Ke(t) ? t : Gt(t) ? JSON.parse(JSON.stringify(t)) : t; +function an(t) { + return e = t, Xe.call(e) === "[object ArrayBuffer]" || Ke(t) || sn(t) || Ge(t) ? t : Gt(t) ? JSON.parse(JSON.stringify(t)) : t; var e; } function Ce(t, e, r, n) { @@ -1038,39 +1039,39 @@ function Ce(t, e, r, n) { return { message: this.message, name: this.name, description: this.description, number: this.number, fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, config: this.config, code: this.code }; }, o; } -var Xe = { find: Ee, findHandler: function(t, e, r, n, o, c, a) { - return Ee(t[e.toLowerCase()], function(m) { - let y = !1; - return typeof m.url == "string" ? y = Oe(r, m.url) || Oe(Ae(a, r), m.url) : m.url instanceof RegExp && (y = m.url.test(r) || m.url.test(Ae(a, r))), y && Se(n, o, m) && Bt(c, m.headers); +var Qe = { find: Ee, findHandler: function(t, e, r, n, o, a, c) { + return Ee(t[e.toLowerCase()], function(y) { + let g = !1; + return typeof y.url == "string" ? g = Oe(r, y.url) || Oe(Ae(c, r), y.url) : y.url instanceof RegExp && (g = y.url.test(r) || y.url.test(Ae(c, r))), g && Se(n, o, y) && Bt(a, y.headers); }); }, purgeIfReplyOnce: function(t, e) { const r = t.handlers.indexOf(e); r > -1 && t.handlers.splice(r, 1); }, settle: async function(t, e, r) { r > 0 && await new Promise((o) => setTimeout(o, r)); - const n = await async function(o, c) { - typeof o == "function" && (o = await o(c)); - const a = o.status || o[0], m = en(o.data || o[1]), y = o.headers || o[2]; - return o.config && (c = o.config), { status: a, data: m, headers: y, config: c, request: { responseURL: c.url } }; + const n = await async function(o, a) { + typeof o == "function" && (o = await o(a)); + const c = o.status || o[0], y = an(o.data || o[1]), g = o.headers || o[2]; + return o.config && (a = o.config), { status: c, data: y, headers: g, config: a, request: { responseURL: a.url } }; }(e, t); if (!n.config.validateStatus || n.config.validateStatus(n.status)) return n; throw Ce(`Request failed with status code ${n.status}`, n.config, n); -}, isObjectOrArray: Gt, isBuffer: Ve, isBlob: Ke, isBodyOrParametersMatching: Se, isEqual: ze, createAxiosError: Ce, createCouldNotFindMockError: function(t) { +}, isObjectOrArray: Gt, isBuffer: Ke, isBlob: Ge, isBodyOrParametersMatching: Se, isEqual: Ve, createAxiosError: Ce, createCouldNotFindMockError: function(t) { const e = `Could not find mock for: ${JSON.stringify({ method: t.method, url: t.url, params: t.params, headers: t.headers }, null, 2)}`, r = new Error(e); return r.isCouldNotFindMockError = !0, r.url = t.url, r.method = t.method, r; } }; -const Q = Xe; +const Q = Qe; function Re(t, e) { let r = e.baseURL; return r && !/^https?:/.test(r) && (r = void 0), typeof t.originalAdapter == "function" ? t.originalAdapter(e) : t.axiosInstanceWithoutInterceptors(Object.assign({}, e, { baseURL: r, adapter: t.originalAdapter, transformRequest: [], transformResponse: [] })); } -const rn = async function(t, e) { +const cn = async function(t, e) { let r = e.url || ""; e.baseURL && r.substr(0, e.baseURL.length) === e.baseURL && (r = r.slice(e.baseURL.length)), delete e.adapter, t.history.push(e); const n = Q.findHandler(t.handlers, e.method, r, e.data, e.params, e.headers && e.headers.constructor.name === "AxiosHeaders" ? Object.assign({}, e.headers.toJSON()) : e.headers, e.baseURL); - if (n) return n.replyOnce && Q.purgeIfReplyOnce(t, n), n.passThrough ? Re(t, e) : Q.settle(e, n.response, function(o, c) { - return typeof c.delay == "number" ? c.delay : o.delayResponse; + if (n) return n.replyOnce && Q.purgeIfReplyOnce(t, n), n.passThrough ? Re(t, e) : Q.settle(e, n.response, function(o, a) { + return typeof a.delay == "number" ? a.delay : o.delayResponse; }(t, n)); switch (t.onNoMatch) { case "passthrough": @@ -1080,10 +1081,10 @@ const rn = async function(t, e) { default: return Q.settle(e, { status: 404 }, t.delayResponse); } -}, D = Xe, Qe = ["get", "post", "head", "delete", "patch", "put", "options", "list", "link", "unlink"]; -function Te() { +}, D = Qe, Ze = ["get", "post", "head", "delete", "patch", "put", "options", "list", "link", "unlink"]; +function xe() { const t = []; - return Qe.forEach(function(e) { + return Ze.forEach(function(e) { Object.defineProperty(t, e, { get: () => t.filter(function(r) { return !r.method || r.method === e; }) }); @@ -1095,7 +1096,7 @@ class Ct { this.axiosInstance = e, this.axiosInstanceWithoutInterceptors = e.create ? e.create() : void 0, this.originalAdapter = e.defaults.adapter, this.delayResponse = r.delayResponse > 0 ? r.delayResponse : null, this.onNoMatch = r.onNoMatch || null, e.defaults.adapter = this.adapter(); } adapter() { - return (e) => rn(this, e); + return (e) => cn(this, e); } restore() { this.axiosInstance && (this.axiosInstance.defaults.adapter = this.originalAdapter, this.axiosInstance = void 0); @@ -1104,108 +1105,108 @@ class Ct { this.resetHandlers(), this.resetHistory(); } resetHandlers() { - this.handlers ? this.handlers.length = 0 : this.handlers = Te(); + this.handlers ? this.handlers.length = 0 : this.handlers = xe(); } resetHistory() { - this.history ? this.history.length = 0 : this.history = Te(); + this.history ? this.history.length = 0 : this.history = xe(); } } -const nn = ["any", "get", "delete", "head", "options"], on = ["headers", "params", "data"]; -function xe(t, e) { - for (const r in e) if (!on.includes(r)) throw new Error(`Invalid config property ${JSON.stringify(r)} provided to ${Ze(t)}. Config: ${JSON.stringify(e)}`); +const un = ["any", "get", "delete", "head", "options"], ln = ["headers", "params", "data"]; +function Te(t, e) { + for (const r in e) if (!ln.includes(r)) throw new Error(`Invalid config property ${JSON.stringify(r)} provided to ${Ye(t)}. Config: ${JSON.stringify(e)}`); return e; } -function Ze(t) { +function Ye(t) { return `on${t.charAt(0).toUpperCase()}${t.slice(1)}`; } function Rt(t, e, r) { if (t === "any") e.push(r); else { - const n = function(o, c) { - let a = -1; - for (let m = 0; m < o.length; m += 1) { - const y = o[m], g = y.url instanceof RegExp && c.url instanceof RegExp ? String(y.url) === String(c.url) : y.url === c.url; - (!y.method || y.method === c.method) && g && D.isEqual(y.params, c.params) && D.isEqual(y.data, c.data) && D.isEqual(y.headers, c.headers) && !y.replyOnce && (a = m); + const n = function(o, a) { + let c = -1; + for (let y = 0; y < o.length; y += 1) { + const g = o[y], m = g.url instanceof RegExp && a.url instanceof RegExp ? String(g.url) === String(a.url) : g.url === a.url; + (!g.method || g.method === a.method) && m && D.isEqual(g.params, a.params) && D.isEqual(g.data, a.data) && D.isEqual(g.headers, a.headers) && !g.replyOnce && (c = y); } - return a; + return c; }(e, r); n > -1 && !r.replyOnce ? e.splice(n, 1, r) : e.push(r); } } -Qe.concat("any").forEach(function(t) { - Ct.prototype[Ze(t)] = function(e, r, n) { +Ze.concat("any").forEach(function(t) { + Ct.prototype[Ye(t)] = function(e, r, n) { const o = this; - let c; + let a; e = e === void 0 ? /.*/ : e; - const a = function(s, b, w) { - return nn.includes(s) ? xe(s, b || {}) : xe(s, Object.assign({}, w, { data: b })); + const c = function(s, b, w) { + return un.includes(s) ? Te(s, b || {}) : Te(s, Object.assign({}, w, { data: b })); }(t, r, n); - function m(s, b, w) { - const E = { url: e, method: t === "any" ? void 0 : t, params: a.params, data: a.data, headers: a.headers, replyOnce: !1, delay: c, response: typeof s == "function" ? s : [s, b, w] }; - return Rt(t, o.handlers, E), o; - } function y(s, b, w) { - const E = { url: e, method: t === "any" ? void 0 : t, params: a.params, data: a.data, headers: a.headers, replyOnce: !0, delay: c, response: typeof s == "function" ? s : [s, b, w] }; + const E = { url: e, method: t === "any" ? void 0 : t, params: c.params, data: c.data, headers: c.headers, replyOnce: !1, delay: a, response: typeof s == "function" ? s : [s, b, w] }; return Rt(t, o.handlers, E), o; } - const g = { reply: m, replyOnce: y, withDelayInMs: function(s) { - c = s; - const b = g.reply.bind(g); - return Object.assign(b, g), b; + function g(s, b, w) { + const E = { url: e, method: t === "any" ? void 0 : t, params: c.params, data: c.data, headers: c.headers, replyOnce: !0, delay: a, response: typeof s == "function" ? s : [s, b, w] }; + return Rt(t, o.handlers, E), o; + } + const m = { reply: y, replyOnce: g, withDelayInMs: function(s) { + a = s; + const b = m.reply.bind(m); + return Object.assign(b, m), b; }, passThrough() { - const s = { passThrough: !0, method: t === "any" ? void 0 : t, url: e, params: a.params, data: a.data, headers: a.headers }; + const s = { passThrough: !0, method: t === "any" ? void 0 : t, url: e, params: c.params, data: c.data, headers: c.headers }; return Rt(t, o.handlers, s), o; - }, abortRequest: () => m(async function(s) { + }, abortRequest: () => y(async function(s) { throw D.createAxiosError("Request aborted", s, void 0, "ECONNABORTED"); - }), abortRequestOnce: () => y(async function(s) { + }), abortRequestOnce: () => g(async function(s) { throw D.createAxiosError("Request aborted", s, void 0, "ECONNABORTED"); - }), networkError: () => m(async function(s) { + }), networkError: () => y(async function(s) { throw D.createAxiosError("Network Error", s); - }), networkErrorOnce: () => y(async function(s) { + }), networkErrorOnce: () => g(async function(s) { throw D.createAxiosError("Network Error", s); - }), timeout: () => m(async function(s) { + }), timeout: () => y(async function(s) { throw D.createAxiosError(s.timeoutErrorMessage || `timeout of ${s.timeout}ms exceeded`, s, void 0, s.transitional && s.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"); - }), timeoutOnce: () => y(async function(s) { + }), timeoutOnce: () => g(async function(s) { throw D.createAxiosError(s.timeoutErrorMessage || `timeout of ${s.timeout}ms exceeded`, s, void 0, s.transitional && s.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"); }) }; - return g; + return m; }; }), Ut.exports = Ct, Ut.exports.default = Ct; -const hn = mt(Ut.exports); -var sn = Object.defineProperty, Ye = (t) => { +const vn = yt(Ut.exports); +var fn = Object.defineProperty, tr = (t) => { throw TypeError(t); -}, x = (t, e, r) => ((n, o, c) => o in n ? sn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[o] = c)(t, typeof e != "symbol" ? e + "" : e, r), tr = (t, e, r) => e.has(t) || Ye("Cannot " + r), S = (t, e, r) => (tr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), _ = (t, e, r) => e.has(t) ? Ye("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), M = (t, e, r, n) => (tr(t, e, "write to private field"), e.set(t, r), r); -function an(t) { +}, T = (t, e, r) => ((n, o, a) => o in n ? fn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[o] = a)(t, typeof e != "symbol" ? e + "" : e, r), er = (t, e, r) => e.has(t) || tr("Cannot " + r), S = (t, e, r) => (er(t, e, "read from private field"), r ? r.call(t) : e.get(t)), N = (t, e, r) => e.has(t) ? tr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), M = (t, e, r, n) => (er(t, e, "write to private field"), e.set(t, r), r); +function hn(t) { return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; } -var Ne, er = {}; -Ne = er, function(t, e) { +var _e, rr = {}; +_e = rr, function(t, e) { var r = e(); - for (var n in r) Ne[n] = r[n]; + for (var n in r) _e[n] = r[n]; }(0, function() { - var t = function(c) { - return typeof c != "string" ? c : c.replace(/[\+ \|\^\%]/g, function(a) { - return { " ": "+", "+": "%2B", "|": "%7C", "^": "%5E", "%": "%25" }[a]; + var t = function(a) { + return typeof a != "string" ? a : a.replace(/[\+ \|\^\%]/g, function(c) { + return { " ": "+", "+": "%2B", "|": "%7C", "^": "%5E", "%": "%25" }[c]; }); - }, e = function(c) { - return typeof c != "string" ? c : c.replace(/\+|%2B|%7C|%5E|%25/g, function(a) { - return { "+": " ", "%2B": "+", "%7C": "|", "%5E": "^", "%25": "%" }[a]; + }, e = function(a) { + return typeof a != "string" ? a : a.replace(/\+|%2B|%7C|%5E|%25/g, function(c) { + return { "+": " ", "%2B": "+", "%7C": "|", "%5E": "^", "%25": "%" }[c]; }); - }, r = function(c) { - return Number.prototype.toString.call(c, 36).toUpperCase(); - }, n = function(c) { - return parseInt(c, 36); - }, o = Array.prototype.indexOf || function(c, a) { - for (var m = a || 0, y = this.length; m < y; m++) if (this[m] === c) return m; + }, r = function(a) { + return Number.prototype.toString.call(a, 36).toUpperCase(); + }, n = function(a) { + return parseInt(a, 36); + }, o = Array.prototype.indexOf || function(a, c) { + for (var y = c || 0, g = this.length; y < g; y++) if (this[y] === a) return y; return -1; }; - return { JSON, pack: function(c, a) { - var m = (a = a || {}).verbose || !1; - m && console.log("Normalize the JSON Object"), c = typeof c == "string" ? this.JSON.parse(c) : c, m && console.log("Creating a empty dictionary"); - var y = { strings: [], integers: [], floats: [] }; - m && console.log("Creating the AST"); - var g = function E(d) { - m && console.log("Calling recursiveAstBuilder with " + this.JSON.stringify(d)); + return { JSON, pack: function(a, c) { + var y = (c = c || {}).verbose || !1; + y && console.log("Normalize the JSON Object"), a = typeof a == "string" ? this.JSON.parse(a) : a, y && console.log("Creating a empty dictionary"); + var g = { strings: [], integers: [], floats: [] }; + y && console.log("Creating the AST"); + var m = function E(d) { + y && console.log("Calling recursiveAstBuilder with " + this.JSON.stringify(d)); var l, i = typeof d; if (d === null) return { type: "null", index: -3 }; if (typeof d > "u") return { type: "undefined", index: -5 }; @@ -1219,16 +1220,16 @@ Ne = er, function(t, e) { return u; } if (d === "") return { type: "empty", index: -4 }; - if (i === "string") return (l = o.call(y.strings, d)) == -1 && (y.strings.push(t(d)), l = y.strings.length - 1), { type: "strings", index: l }; - if (i === "number" && d % 1 == 0) return (l = o.call(y.integers, d)) == -1 && (y.integers.push(r(d)), l = y.integers.length - 1), { type: "integers", index: l }; - if (i === "number") return (l = o.call(y.floats, d)) == -1 && (y.floats.push(d), l = y.floats.length - 1), { type: "floats", index: l }; + if (i === "string") return (l = o.call(g.strings, d)) == -1 && (g.strings.push(t(d)), l = g.strings.length - 1), { type: "strings", index: l }; + if (i === "number" && d % 1 == 0) return (l = o.call(g.integers, d)) == -1 && (g.integers.push(r(d)), l = g.integers.length - 1), { type: "integers", index: l }; + if (i === "number") return (l = o.call(g.floats, d)) == -1 && (g.floats.push(d), l = g.floats.length - 1), { type: "floats", index: l }; if (i === "boolean") return { type: "boolean", index: d ? -1 : -2 }; throw new Error("Unexpected argument of type " + typeof d); - }(c), s = y.strings.length, b = y.integers.length; - y.floats.length, m && console.log("Parsing the dictionary"); - var w = y.strings.join("|"); - return w += "^" + y.integers.join("|"), w += "^" + y.floats.join("|"), m && console.log("Parsing the structure"), w += "^" + function E(d) { - if (m && console.log("Calling a recursiveParser with " + this.JSON.stringify(d)), d instanceof Array) { + }(a), s = g.strings.length, b = g.integers.length; + g.floats.length, y && console.log("Parsing the dictionary"); + var w = g.strings.join("|"); + return w += "^" + g.integers.join("|"), w += "^" + g.floats.join("|"), y && console.log("Parsing the structure"), w += "^" + function E(d) { + if (y && console.log("Calling a recursiveParser with " + this.JSON.stringify(d)), d instanceof Array) { var l = d.shift(); for (var i in d) d.hasOwnProperty(i) && (l += E(d[i]) + "|"); return (l[l.length - 1] === "|" ? l.slice(0, -1) : l) + "]"; @@ -1242,31 +1243,31 @@ Ne = er, function(t, e) { if (u === "undefined") return -5; if (u === "empty") return -4; throw new TypeError("The item is alien!"); - }(g), m && console.log("Ending parser"), a.debug ? { dictionary: y, ast: g, packed: w } : w; - }, unpack: function(c, a) { - a = a || {}; - var m = c.split("^"); - a.verbose && console.log("Building dictionary"); - var y = [], g = m[0]; - if (g !== "") { - g = g.split("|"), a.verbose && console.log("Parse the strings dictionary"); - for (var s = 0, b = g.length; s < b; s++) y.push(e(g[s])); + }(m), y && console.log("Ending parser"), c.debug ? { dictionary: g, ast: m, packed: w } : w; + }, unpack: function(a, c) { + c = c || {}; + var y = a.split("^"); + c.verbose && console.log("Building dictionary"); + var g = [], m = y[0]; + if (m !== "") { + m = m.split("|"), c.verbose && console.log("Parse the strings dictionary"); + for (var s = 0, b = m.length; s < b; s++) g.push(e(m[s])); } - if ((g = m[1]) !== "") for (g = g.split("|"), a.verbose && console.log("Parse the integers dictionary"), s = 0, b = g.length; s < b; s++) y.push(n(g[s])); - if ((g = m[2]) !== "") for (g = g.split("|"), a.verbose && console.log("Parse the floats dictionary"), s = 0, b = g.length; s < b; s++) y.push(parseFloat(g[s])); - g = null, a.verbose && console.log("Tokenizing the structure"); - var w = "", E = [], d = m[3].length; + if ((m = y[1]) !== "") for (m = m.split("|"), c.verbose && console.log("Parse the integers dictionary"), s = 0, b = m.length; s < b; s++) g.push(n(m[s])); + if ((m = y[2]) !== "") for (m = m.split("|"), c.verbose && console.log("Parse the floats dictionary"), s = 0, b = m.length; s < b; s++) g.push(parseFloat(m[s])); + m = null, c.verbose && console.log("Tokenizing the structure"); + var w = "", E = [], d = y[3].length; for (s = 0; s < d; s++) { - var l = m[3].charAt(s); + var l = y[3].charAt(s); l === "|" || l === "$" || l === "@" || l === "]" ? (w && (E.push(n(w)), w = ""), l !== "|" && E.push(l)) : w += l; } var i = E.length, u = 0; - return a.verbose && console.log("Starting recursive parser"), function h() { + return c.verbose && console.log("Starting recursive parser"), function h() { var p = E[u++]; - if (a.verbose && console.log("Reading collection type " + (p === "$" ? "object" : "Array")), p === "@") { + if (c.verbose && console.log("Reading collection type " + (p === "$" ? "object" : "Array")), p === "@") { for (var f = []; u < i; u++) { var A = E[u]; - if (a.verbose && console.log("Read " + A + " symbol"), A === "]") return f; + if (c.verbose && console.log("Read " + A + " symbol"), A === "]") return f; if (A === "@" || A === "$") f.push(h()); else switch (A) { case -1: @@ -1285,16 +1286,16 @@ Ne = er, function(t, e) { f.push(""); break; default: - f.push(y[A]); + f.push(g[A]); } } - return a.verbose && console.log("Parsed " + this.JSON.stringify(f)), f; + return c.verbose && console.log("Parsed " + this.JSON.stringify(f)), f; } if (p === "$") { for (f = {}; u < i; u++) { var O = E[u]; if (O === "]") return f; - if (O = O === -4 ? "" : y[O], (A = E[++u]) === "@" || A === "$") f[O] = h(); + if (O = O === -4 ? "" : g[O], (A = E[++u]) === "@" || A === "$") f[O] = h(); else switch (A) { case -1: f[O] = !0; @@ -1312,33 +1313,33 @@ Ne = er, function(t, e) { f[O] = ""; break; default: - f[O] = y[A]; + f[O] = g[A]; } } - return a.verbose && console.log("Parsed " + this.JSON.stringify(f)), f; + return c.verbose && console.log("Parsed " + this.JSON.stringify(f)), f; } throw new TypeError("Bad token " + p + " isn't a type"); }(); } }; }); -const _e = an(er); +const Ne = hn(rr); var tt, et, z, q, Mt, Lt, at, Dt, Ft; class It { - constructor(e, r, n, o, c) { - return x(this, "code", 0), x(this, "message", "操作成功"), x(this, "data", null), x(this, "url", ""), x(this, "res", ""), _(this, tt), _(this, et, !0), _(this, z, !0), _(this, q, { get: (a, m) => S(this, Mt).call(this, m), ownKeys: () => Object.keys(S(this, q).getPrototypeOf() || {}), getPrototypeOf: () => S(this, et) ? this : this.data, getOwnPropertyDescriptor: () => ({ configurable: !0, enumerable: !0, writable: !0, value: S(this, q).getPrototypeOf() }) }), _(this, Mt, (a) => a === "$echoMsg" ? S(this, at) : a === "msg" ? S(this, Lt) : a === "then" || a === "resp" ? (M(this, z, !0), M(this, et, a === "resp"), S(this, Dt)) : a === "catch" ? S(this, Ft) : a === "IS_ECHO_MSG" ? S(this, z) : Reflect.get(this, a)), _(this, Lt, (a = (y) => y, m = !1) => (S(this, at).call(this), M(this, et, m), Promise.resolve(a == null ? void 0 : a(S(this, q).getPrototypeOf())))), _(this, at, () => { + constructor(e, r, n, o, a) { + return T(this, "code", 0), T(this, "message", "操作成功"), T(this, "data", null), T(this, "url", ""), T(this, "res", ""), N(this, tt), N(this, et, !0), N(this, z, !0), N(this, q, { get: (c, y) => S(this, Mt).call(this, y), ownKeys: () => Object.keys(S(this, q).getPrototypeOf() || {}), getPrototypeOf: () => S(this, et) ? this : this.data, getOwnPropertyDescriptor: () => ({ configurable: !0, enumerable: !0, writable: !0, value: S(this, q).getPrototypeOf() }) }), N(this, Mt, (c) => c === "$echoMsg" ? S(this, at) : c === "msg" ? S(this, Lt) : c === "then" || c === "resp" ? (M(this, z, !0), M(this, et, c === "resp"), S(this, Dt)) : c === "catch" ? S(this, Ft) : c === "IS_ECHO_MSG" ? S(this, z) : Reflect.get(this, c)), N(this, Lt, (c = (g) => g, y = !1) => (S(this, at).call(this), M(this, et, y), Promise.resolve(c == null ? void 0 : c(S(this, q).getPrototypeOf())))), N(this, at, () => { S(this, z) && (M(this, z, !1), $t.onMsg(this.code, this.message)); - }), _(this, Dt, (a) => [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(S(this, q).getPrototypeOf())) : Promise.reject(S(this, tt))), _(this, Ft, (a) => Promise.resolve(a(S(this, tt)))), this.code = e, this.message = r, this.data = n, this.url = o, this.res = c, M(this, tt, new Proxy(this, S(this, q))); + }), N(this, Dt, (c) => [0, 1].includes(this.code) ? Promise.resolve(c == null ? void 0 : c(S(this, q).getPrototypeOf())) : Promise.reject(S(this, tt))), N(this, Ft, (c) => Promise.resolve(c(S(this, tt)))), this.code = e, this.message = r, this.data = n, this.url = o, this.res = a, M(this, tt, new Proxy(this, S(this, q))); } } tt = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(); -const Tt = (t, e, r, n = "/", o = "") => new It(t, e, r, n, o); -var Pe = ["utf8", "utf-8", "unicode-1-1-utf-8"], rr = { TextEncoder: function(t) { +const xt = (t, e, r, n = "/", o = "") => new It(t, e, r, n, o); +var Pe = ["utf8", "utf-8", "unicode-1-1-utf-8"], nr = { TextEncoder: function(t) { if (Pe.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); this.encoding = "utf-8", this.encode = function(e) { if (typeof e != "string") throw new TypeError("passed argument must be of tye string"); var r = unescape(encodeURIComponent(e)), n = new Uint8Array(r.length); const o = r.split(""); - for (let c = 0; c < o.length; c++) n[c] = o[c].charCodeAt(0); + for (let a = 0; a < o.length; a++) n[a] = o[a].charCodeAt(0); return n; }; }, TextDecoder: function(t) { @@ -1348,18 +1349,18 @@ var Pe = ["utf8", "utf-8", "unicode-1-1-utf-8"], rr = { TextEncoder: function(t) var n = typeof r < "u" && n in r && r.stream; if (typeof n != "boolean") throw new TypeError("stream option must be boolean"); if (ArrayBuffer.isView(e)) { - var o = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), c = new Array(o.length); - for (let a = 0; a < o.length; a++) c[a] = String.fromCharCode(o[a]); - return decodeURIComponent(escape(c.join(""))); + var o = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), a = new Array(o.length); + for (let c = 0; c < o.length; c++) a[c] = String.fromCharCode(o[c]); + return decodeURIComponent(escape(a.join(""))); } throw new TypeError("passed argument must be an array buffer view"); }; } }; -const cn = new rr.TextEncoder("utf8"); -new rr.TextDecoder("utf8"); -class un { +const dn = new nr.TextEncoder("utf8"); +new nr.TextDecoder("utf8"); +class pn { constructor(e) { - if (x(this, "encodeTable", []), x(this, "decodeMap", new Uint8Array(256).fill(255)), e.length !== 62) throw new Error("Encoding alphabet must be 62 characters long"); + if (T(this, "encodeTable", []), T(this, "decodeMap", new Uint8Array(256).fill(255)), e.length !== 62) throw new Error("Encoding alphabet must be 62 characters long"); if (e.includes(` `) || e.includes("\r")) throw new Error("Encoding alphabet contains newline character"); this.encodeTable = e.split(""), this.decodeMap = new Uint8Array(256).fill(255); @@ -1367,19 +1368,19 @@ class un { } encode(e) { if (!e || e.length === 0) return ""; - const r = new ln(this).encodeV2(e); + const r = new gn(this).encodeV2(e); return String.fromCharCode(...r); } decode(e) { if (!e || e.length === 0) return ""; - const r = new fn(this).decode(e); + const r = new mn(this).decode(e); return new TextDecoder().decode(r); } } var ct, ut, V, W, qt, L, I, K, Wt, lt; -class ln { +class gn { constructor(e) { - _(this, ct), x(this, "src", new Uint8Array()), x(this, "pos", 0), M(this, ct, e); + N(this, ct), T(this, "src", new Uint8Array()), T(this, "pos", 0), M(this, ct, e); } get6bits() { let e = 7 & this.pos, r = this.pos >> 3; @@ -1389,7 +1390,7 @@ class ln { } encodeV2(e) { this.src = function(n) { - return cn.encode(n || ""); + return dn.encode(n || ""); }(e), this.pos = 8 * this.src.length; const r = []; for (; this.pos > 0; ) { @@ -1400,19 +1401,19 @@ class ln { } } ct = /* @__PURE__ */ new WeakMap(); -class fn { +class mn { constructor(e) { - _(this, ut), M(this, ut, e); + N(this, ut), M(this, ut, e); } decode(e) { const r = new Uint8Array(Math.ceil(6 * e.length / 8) + 1); - let n = r.length, o = 0, c = 0; - for (let a = 0; a < e.length; a++) { - const m = e[a].charCodeAt(0), y = S(this, ut).decodeMap[m]; - if (y === 255) throw new Error(`CorruptInputError at index ${a}`); - a === e.length - 1 ? (c |= y << o, o += Math.ceil(Math.log2(y + 1))) : 30 & ~y ? (c |= y << o, o += 6) : (c |= y << o, o += 5), o >= 8 && (n--, r[n] = 255 & c, o %= 8, c >>= 8); + let n = r.length, o = 0, a = 0; + for (let c = 0; c < e.length; c++) { + const y = e[c].charCodeAt(0), g = S(this, ut).decodeMap[y]; + if (g === 255) throw new Error(`CorruptInputError at index ${c}`); + c === e.length - 1 ? (a |= g << o, o += Math.ceil(Math.log2(g + 1))) : 30 & ~g ? (a |= g << o, o += 6) : (a |= g << o, o += 5), o >= 8 && (n--, r[n] = 255 & a, o %= 8, a >>= 8); } - return o > 0 && (n--, r[n] = 255 & c), r.slice(n); + return o > 0 && (n--, r[n] = 255 & a), r.slice(n); } } ut = /* @__PURE__ */ new WeakMap(), Promise.withResolvers || (Promise.withResolvers = function() { @@ -1423,20 +1424,20 @@ ut = /* @__PURE__ */ new WeakMap(), Promise.withResolvers || (Promise.withResolv }); class $t { constructor(e, r, n) { - _(this, V), _(this, W), _(this, qt), _(this, L, { "#": /* @__PURE__ */ new Map(), $: /* @__PURE__ */ new Map() }), _(this, I, /* @__PURE__ */ new Map()), _(this, K, /* @__PURE__ */ new Set()), x(this, "init", (o, c, a) => { - o && M(this, qt, o), a && M(this, V, a), c && M(this, W, new un(c)), S(this, Wt).call(this); - }), _(this, Wt, () => { + N(this, V), N(this, W), N(this, qt), N(this, L, { "#": /* @__PURE__ */ new Map(), $: /* @__PURE__ */ new Map() }), N(this, I, /* @__PURE__ */ new Map()), N(this, K, /* @__PURE__ */ new Set()), T(this, "init", (o, a, c) => { + o && M(this, qt, o), c && M(this, V, c), a && M(this, W, new pn(a)), S(this, Wt).call(this); + }), N(this, Wt, () => { !S(this, K).size || !S(this, V) || (S(this, K).forEach((o) => S(this, lt).call(this, ...o)), S(this, K).clear()); - }), _(this, lt, (o, c, a, m = !1) => { + }), N(this, lt, (o, a, c, y = !1) => { if (S(this, V)) { - const { url: y, method: g, ...s } = a || {}; - S(this, V).call(this, { url: y, method: g, ...s }).then((b) => { - if (![0, 1].includes(b.code)) throw Tt(b.code, b.msg, b.data, y, b == null ? void 0 : b.res); - return [b.code, b.msg, b.data, y, (b == null ? void 0 : b.res) ?? ""]; + const { url: g, method: m, ...s } = c || {}; + S(this, V).call(this, { url: g, method: m, ...s }).then((b) => { + if (![0, 1].includes(b.code)) throw xt(b.code, b.msg, b.data, g, b == null ? void 0 : b.res); + return [b.code, b.msg, b.data, g, (b == null ? void 0 : b.res) ?? ""]; }).then((b) => { const w = b; - return (c == "#" || g == "GET") && S(this, L)[c].set(o, w), c != "#" && g == "GET" && !m && setTimeout(() => { - S(this, L)[c].delete(o); + return (a == "#" || m == "GET") && S(this, L)[a].set(o, w), a != "#" && m == "GET" && !y && setTimeout(() => { + S(this, L)[a].delete(o); }, 300), w; }).then((b) => { var w; @@ -1445,63 +1446,63 @@ class $t { }); }).catch((b) => { var w; - S(this, L)[c].delete(o), (w = S(this, I).get(o)) == null || w.forEach((E, d, l) => { - E && E[1](b instanceof It ? b : Tt(-1, b, null, y)), delete l[d]; + S(this, L)[a].delete(o), (w = S(this, I).get(o)) == null || w.forEach((E, d, l) => { + E && E[1](b instanceof It ? b : xt(-1, b, null, g)), delete l[d]; }); }).finally(() => S(this, I).delete(o)); - } else S(this, K).add([o, c, a, m]); - }), x(this, "request", ({ url: o = "/", method: c = "GET", ...a }, m = !1) => { - var y, g; + } else S(this, K).add([o, a, c, y]); + }), T(this, "request", ({ url: o = "/", method: a = "GET", ...c }, y = !1) => { + var g, m; o = function(i, u) { return i.replace(new RegExp(`^${u}+|${u}+$`, "g"), ""); }(o, "/"); - const s = c.toUpperCase(), b = function(i) { + const s = a.toUpperCase(), b = function(i) { let u = 5381; for (let h = 0; h < i.length; h++) u = 33 * u ^ i.charCodeAt(h); return (u >>> 0).toString(16); - }(JSON.stringify([o, s, a])), w = (y = o == null ? void 0 : o.includes) != null && y.call(o, "/_/") ? "#" : "$", { promise: E, resolve: d, reject: l } = Promise.withResolvers(); - return S(this, L)[w].has(b) ? (console.log("cache", o), d(S(this, L)[w].get(b))) : S(this, I).has(b) ? (g = S(this, I).get(b)) == null || g.push([d, l]) : (S(this, I).set(b, [[d, l]]), S(this, lt).call(this, b, w, { url: o, method: s, ...a }, m)), new Proxy(E, { get: (i, u) => (...h) => i.then((p) => Tt(...p)[u](...h)).catch((p) => { + }(JSON.stringify([o, s, c])), w = (g = o == null ? void 0 : o.includes) != null && g.call(o, "/_/") ? "#" : "$", { promise: E, resolve: d, reject: l } = Promise.withResolvers(); + return S(this, L)[w].has(b) ? (console.log("cache", o), d(S(this, L)[w].get(b))) : S(this, I).has(b) ? (m = S(this, I).get(b)) == null || m.push([d, l]) : (S(this, I).set(b, [[d, l]]), S(this, lt).call(this, b, w, { url: o, method: s, ...c }, y)), new Proxy(E, { get: (i, u) => (...h) => i.then((p) => xt(...p)[u](...h)).catch((p) => { if (!(p instanceof It)) throw p; return typeof p[u] == "function" ? p[u](...h) : p[u]; }) }); - }), x(this, "get", (o, c = {}) => this.request({ url: o, method: "GET", params: c })), x(this, "post", (o, c = {}, a = {}) => this.request({ url: o, method: "POST", data: c, params: a })), x(this, "put", (o, c = {}, a = {}) => this.request({ url: o, method: "PUT", data: c, params: a })), x(this, "del", (o, c = {}, a = {}) => this.request({ url: o, method: "DELETE", data: c, params: a })), x(this, "download", (o, c) => { - }), x(this, "cache", (o, c = {}) => this.request({ url: o, method: "GET", params: c }, !0)), x(this, "list", (o, c = {}) => this.get(`/api/${o}/${this.encode(c)}`)), x(this, "getAppInfo", () => { - }), x(this, "refreshCache", (o = !1) => { + }), T(this, "get", (o, a = {}) => this.request({ url: o, method: "GET", params: a })), T(this, "post", (o, a = {}, c = {}) => this.request({ url: o, method: "POST", data: a, params: c })), T(this, "put", (o, a = {}, c = {}) => this.request({ url: o, method: "PUT", data: a, params: c })), T(this, "del", (o, a = {}, c = {}) => this.request({ url: o, method: "DELETE", data: a, params: c })), T(this, "download", (o, a) => { + }), T(this, "cache", (o, a = {}) => this.request({ url: o, method: "GET", params: a }, !0)), T(this, "list", (o, a = {}) => this.get(`/api/${o}/${this.encode(a)}`)), T(this, "getAppInfo", () => { + }), T(this, "refreshCache", (o = !1) => { o && S(this, L)["#"].clear(), S(this, L).$.clear(); - }), x(this, "decode", (o = "", c = {}) => { - if (o === void 0 || o === "" || o === null) return c; + }), T(this, "decode", (o = "", a = {}) => { + if (o === void 0 || o === "" || o === null) return a; try { if (!S(this, W)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); - const a = S(this, W).decode(o); - return _e.unpack(a); + const c = S(this, W).decode(o); + return Ne.unpack(c); } catch { - return console.warn("core.decode", o), c; + return console.warn("core.decode", o), a; } - }), x(this, "encode", (o = {}) => { + }), T(this, "encode", (o = {}) => { if (!S(this, W)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); - const c = JSON.stringify(o, (a, m) => m === void 0 ? null : m); - return S(this, W).encode(_e.pack(c)); + const a = JSON.stringify(o, (c, y) => y === void 0 ? null : y); + return S(this, W).encode(Ne.pack(a)); }), this.init(e, r, n); } } V = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), qt = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), $t.onUnhandledRejection = (t) => { - var e, r, n, o, c, a; - t != null && t.IS_ECHO_MSG ? ((e = t == null ? void 0 : t.$echoMsg) == null || e.call(t), (r = t == null ? void 0 : t.preventDefault) == null || r.call(t)) : (n = t.reason) != null && n.IS_ECHO_MSG && ((c = (o = t.reason) == null ? void 0 : o.$echoMsg) == null || c.call(o), (a = t == null ? void 0 : t.preventDefault) == null || a.call(t)); + var e, r, n, o, a, c; + t != null && t.IS_ECHO_MSG ? ((e = t == null ? void 0 : t.$echoMsg) == null || e.call(t), (r = t == null ? void 0 : t.preventDefault) == null || r.call(t)) : (n = t.reason) != null && n.IS_ECHO_MSG && ((a = (o = t.reason) == null ? void 0 : o.$echoMsg) == null || a.call(o), (c = t == null ? void 0 : t.preventDefault) == null || c.call(t)); }, $t.onMsg = (t, e) => [0, 1].includes(t) ? console.log(e) : console.warn(e); -var nr = { exports: {} }; +var or = { exports: {} }; /* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress * @license MIT */ -nr.exports = function() { +or.exports = function() { var t, e, r = { version: "0.2.0" }, n = r.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: '
' }; function o(d, l, i) { return d < l ? l : d > i ? i : d; } - function c(d) { + function a(d) { return 100 * (-1 + d); } - function a(d, l, i) { + function c(d, l, i) { var u; - return (u = n.positionUsing === "translate3d" ? { transform: "translate3d(" + c(d) + "%,0,0)" } : n.positionUsing === "translate" ? { transform: "translate(" + c(d) + "%,0)" } : { "margin-left": c(d) + "%" }).transition = "all " + l + "ms " + i, u; + return (u = n.positionUsing === "translate3d" ? { transform: "translate3d(" + a(d) + "%,0,0)" } : n.positionUsing === "translate" ? { transform: "translate(" + a(d) + "%,0)" } : { "margin-left": a(d) + "%" }).transition = "all " + l + "ms " + i, u; } r.configure = function(d) { var l, i; @@ -1511,9 +1512,9 @@ nr.exports = function() { var l = r.isStarted(); d = o(d, n.minimum, 1), r.status = d === 1 ? null : d; var i = r.render(!l), u = i.querySelector(n.barSelector), h = n.speed, p = n.easing; - return i.offsetWidth, m(function(f) { - n.positionUsing === "" && (n.positionUsing = r.getPositioningCSS()), y(u, a(d, h, p)), d === 1 ? (y(i, { transition: "none", opacity: 1 }), i.offsetWidth, setTimeout(function() { - y(i, { transition: "all " + h + "ms linear", opacity: 0 }), setTimeout(function() { + return i.offsetWidth, y(function(f) { + n.positionUsing === "" && (n.positionUsing = r.getPositioningCSS()), g(u, c(d, h, p)), d === 1 ? (g(i, { transition: "none", opacity: 1 }), i.offsetWidth, setTimeout(function() { + g(i, { transition: "all " + h + "ms linear", opacity: 0 }), setTimeout(function() { r.remove(), f(); }, h); }, h)) : setTimeout(f, h); @@ -1544,8 +1545,8 @@ nr.exports = function() { s(document.documentElement, "nprogress-busy"); var l = document.createElement("div"); l.id = "nprogress", l.innerHTML = n.template; - var i, u = l.querySelector(n.barSelector), h = d ? "-100" : c(r.status || 0), p = document.querySelector(n.parent); - return y(u, { transition: "all 0 linear", transform: "translate3d(" + h + "%,0,0)" }), n.showSpinner || (i = l.querySelector(n.spinnerSelector)) && E(i), p != document.body && s(p, "nprogress-custom-parent"), p.appendChild(l), l; + var i, u = l.querySelector(n.barSelector), h = d ? "-100" : a(r.status || 0), p = document.querySelector(n.parent); + return g(u, { transition: "all 0 linear", transform: "translate3d(" + h + "%,0,0)" }), n.showSpinner || (i = l.querySelector(n.spinnerSelector)) && E(i), p != document.body && s(p, "nprogress-custom-parent"), p.appendChild(l), l; }, r.remove = function() { b(document.documentElement, "nprogress-busy"), b(document.querySelector(n.parent), "nprogress-custom-parent"); var d = document.getElementById("nprogress"); @@ -1556,7 +1557,7 @@ nr.exports = function() { var d = document.body.style, l = "WebkitTransform" in d ? "Webkit" : "MozTransform" in d ? "Moz" : "msTransform" in d ? "ms" : "OTransform" in d ? "O" : ""; return l + "Perspective" in d ? "translate3d" : l + "Transform" in d ? "translate" : "margin"; }; - var m = /* @__PURE__ */ function() { + var y = /* @__PURE__ */ function() { var d = []; function l() { var i = d.shift(); @@ -1565,7 +1566,7 @@ nr.exports = function() { return function(i) { d.push(i), d.length == 1 && l(); }; - }(), y = /* @__PURE__ */ function() { + }(), g = /* @__PURE__ */ function() { var d = ["Webkit", "O", "Moz", "ms"], l = {}; function i(f) { return f.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(A, O) { @@ -1575,7 +1576,7 @@ nr.exports = function() { function u(f) { var A = document.body.style; if (f in A) return f; - for (var O, T = d.length, P = f.charAt(0).toUpperCase() + f.slice(1); T--; ) if ((O = d[T] + P) in A) return O; + for (var O, x = d.length, P = f.charAt(0).toUpperCase() + f.slice(1); x--; ) if ((O = d[x] + P) in A) return O; return f; } function h(f) { @@ -1585,21 +1586,21 @@ nr.exports = function() { A = h(A), f.style[A] = O; } return function(f, A) { - var O, T, P = arguments; - if (P.length == 2) for (O in A) (T = A[O]) !== void 0 && A.hasOwnProperty(O) && p(f, O, T); + var O, x, P = arguments; + if (P.length == 2) for (O in A) (x = A[O]) !== void 0 && A.hasOwnProperty(O) && p(f, O, x); else p(f, P[1], P[2]); }; }(); - function g(d, l) { + function m(d, l) { return (typeof d == "string" ? d : w(d)).indexOf(" " + l + " ") >= 0; } function s(d, l) { var i = w(d), u = i + l; - g(i, l) || (d.className = u.substring(1)); + m(i, l) || (d.className = u.substring(1)); } function b(d, l) { var i, u = w(d); - g(d, l) && (i = u.replace(" " + l + " ", " "), d.className = i.substring(1, i.length - 1)); + m(d, l) && (i = u.replace(" " + l + " ", " "), d.className = i.substring(1, i.length - 1)); } function w(d) { return (" " + (d.className || "") + " ").replace(/\s+/gi, " "); @@ -1609,9 +1610,9 @@ nr.exports = function() { } return r; }(); -const dn = mt(nr.exports); -var xt, Nt, Ht = { exports: {} }; -xt = Ht, Nt = Ht.exports, function() { +const En = yt(or.exports); +var Tt, _t, Ht = { exports: {} }; +Tt = Ht, _t = Ht.exports, function() { var t = { version: "3.0.1", x86: {}, x64: {} }; function e(s, b) { return (65535 & s) * b + (((s >>> 16) * b & 65535) << 16); @@ -1627,22 +1628,22 @@ xt = Ht, Nt = Ht.exports, function() { var w = [0, 0, 0, 0]; return w[3] += s[3] + b[3], w[2] += w[3] >>> 16, w[3] &= 65535, w[2] += s[2] + b[2], w[1] += w[2] >>> 16, w[2] &= 65535, w[1] += s[1] + b[1], w[0] += w[1] >>> 16, w[1] &= 65535, w[0] += s[0] + b[0], w[0] &= 65535, [w[0] << 16 | w[1], w[2] << 16 | w[3]]; } - function c(s, b) { + function a(s, b) { s = [s[0] >>> 16, 65535 & s[0], s[1] >>> 16, 65535 & s[1]], b = [b[0] >>> 16, 65535 & b[0], b[1] >>> 16, 65535 & b[1]]; var w = [0, 0, 0, 0]; return w[3] += s[3] * b[3], w[2] += w[3] >>> 16, w[3] &= 65535, w[2] += s[2] * b[3], w[1] += w[2] >>> 16, w[2] &= 65535, w[2] += s[3] * b[2], w[1] += w[2] >>> 16, w[2] &= 65535, w[1] += s[1] * b[3], w[0] += w[1] >>> 16, w[1] &= 65535, w[1] += s[2] * b[2], w[0] += w[1] >>> 16, w[1] &= 65535, w[1] += s[3] * b[1], w[0] += w[1] >>> 16, w[1] &= 65535, w[0] += s[0] * b[3] + s[1] * b[2] + s[2] * b[1] + s[3] * b[0], w[0] &= 65535, [w[0] << 16 | w[1], w[2] << 16 | w[3]]; } - function a(s, b) { + function c(s, b) { return (b %= 64) == 32 ? [s[1], s[0]] : b < 32 ? [s[0] << b | s[1] >>> 32 - b, s[1] << b | s[0] >>> 32 - b] : (b -= 32, [s[1] << b | s[0] >>> 32 - b, s[0] << b | s[1] >>> 32 - b]); } - function m(s, b) { + function y(s, b) { return (b %= 64) == 0 ? s : b < 32 ? [s[0] << b | s[1] >>> 32 - b, s[1] << b] : [s[1] << b - 32, 0]; } - function y(s, b) { + function g(s, b) { return [s[0] ^ b[0], s[1] ^ b[1]]; } - function g(s) { - return s = y(s, [0, s[0] >>> 1]), s = y(s = c(s, [4283543511, 3981806797]), [0, s[0] >>> 1]), s = y(s = c(s, [3301882366, 444984403]), [0, s[0] >>> 1]); + function m(s) { + return s = g(s, [0, s[0] >>> 1]), s = g(s = a(s, [4283543511, 3981806797]), [0, s[0] >>> 1]), s = g(s = a(s, [3301882366, 444984403]), [0, s[0] >>> 1]); } t.x86.hash32 = function(s, b) { b = b || 0; @@ -1658,7 +1659,7 @@ xt = Ht, Nt = Ht.exports, function() { return (d = n(d ^= s.length)) >>> 0; }, t.x86.hash128 = function(s, b) { b = b || 0; - for (var w = (s = s || "").length % 16, E = s.length - w, d = b, l = b, i = b, u = b, h = 0, p = 0, f = 0, A = 0, O = 597399067, T = 2869860233, P = 951274213, nt = 2716044179, R = 0; R < E; R += 16) h = 255 & s.charCodeAt(R) | (255 & s.charCodeAt(R + 1)) << 8 | (255 & s.charCodeAt(R + 2)) << 16 | (255 & s.charCodeAt(R + 3)) << 24, p = 255 & s.charCodeAt(R + 4) | (255 & s.charCodeAt(R + 5)) << 8 | (255 & s.charCodeAt(R + 6)) << 16 | (255 & s.charCodeAt(R + 7)) << 24, f = 255 & s.charCodeAt(R + 8) | (255 & s.charCodeAt(R + 9)) << 8 | (255 & s.charCodeAt(R + 10)) << 16 | (255 & s.charCodeAt(R + 11)) << 24, A = 255 & s.charCodeAt(R + 12) | (255 & s.charCodeAt(R + 13)) << 8 | (255 & s.charCodeAt(R + 14)) << 16 | (255 & s.charCodeAt(R + 15)) << 24, h = r(h = e(h, O), 15), d = r(d ^= h = e(h, T), 19), d = e(d += l, 5) + 1444728091, p = r(p = e(p, T), 16), l = r(l ^= p = e(p, P), 17), l = e(l += i, 5) + 197830471, f = r(f = e(f, P), 17), i = r(i ^= f = e(f, nt), 15), i = e(i += u, 5) + 2530024501, A = r(A = e(A, nt), 18), u = r(u ^= A = e(A, O), 13), u = e(u += d, 5) + 850148119; + for (var w = (s = s || "").length % 16, E = s.length - w, d = b, l = b, i = b, u = b, h = 0, p = 0, f = 0, A = 0, O = 597399067, x = 2869860233, P = 951274213, nt = 2716044179, R = 0; R < E; R += 16) h = 255 & s.charCodeAt(R) | (255 & s.charCodeAt(R + 1)) << 8 | (255 & s.charCodeAt(R + 2)) << 16 | (255 & s.charCodeAt(R + 3)) << 24, p = 255 & s.charCodeAt(R + 4) | (255 & s.charCodeAt(R + 5)) << 8 | (255 & s.charCodeAt(R + 6)) << 16 | (255 & s.charCodeAt(R + 7)) << 24, f = 255 & s.charCodeAt(R + 8) | (255 & s.charCodeAt(R + 9)) << 8 | (255 & s.charCodeAt(R + 10)) << 16 | (255 & s.charCodeAt(R + 11)) << 24, A = 255 & s.charCodeAt(R + 12) | (255 & s.charCodeAt(R + 13)) << 8 | (255 & s.charCodeAt(R + 14)) << 16 | (255 & s.charCodeAt(R + 15)) << 24, h = r(h = e(h, O), 15), d = r(d ^= h = e(h, x), 19), d = e(d += l, 5) + 1444728091, p = r(p = e(p, x), 16), l = r(l ^= p = e(p, P), 17), l = e(l += i, 5) + 197830471, f = r(f = e(f, P), 17), i = r(i ^= f = e(f, nt), 15), i = e(i += u, 5) + 2530024501, A = r(A = e(A, nt), 18), u = r(u ^= A = e(A, O), 13), u = e(u += d, 5) + 850148119; switch (h = 0, p = 0, f = 0, A = 0, w) { case 15: A ^= s.charCodeAt(R + 14) << 16; @@ -1681,7 +1682,7 @@ xt = Ht, Nt = Ht.exports, function() { case 6: p ^= s.charCodeAt(R + 5) << 8; case 5: - p = e(p ^= s.charCodeAt(R + 4), T), l ^= p = e(p = r(p, 16), P); + p = e(p ^= s.charCodeAt(R + 4), x), l ^= p = e(p = r(p, 16), P); case 4: h ^= s.charCodeAt(R + 3) << 24; case 3: @@ -1689,50 +1690,92 @@ xt = Ht, Nt = Ht.exports, function() { case 2: h ^= s.charCodeAt(R + 1) << 8; case 1: - h = e(h ^= s.charCodeAt(R), O), d ^= h = e(h = r(h, 15), T); + h = e(h ^= s.charCodeAt(R), O), d ^= h = e(h = r(h, 15), x); } return d ^= s.length, d += l ^= s.length, d += i ^= s.length, l += d += u ^= s.length, i += d, u += d, d = n(d), d += l = n(l), d += i = n(i), l += d += u = n(u), i += d, u += d, ("00000000" + (d >>> 0).toString(16)).slice(-8) + ("00000000" + (l >>> 0).toString(16)).slice(-8) + ("00000000" + (i >>> 0).toString(16)).slice(-8) + ("00000000" + (u >>> 0).toString(16)).slice(-8); }, t.x64.hash128 = function(s, b) { b = b || 0; - for (var w = (s = s || "").length % 16, E = s.length - w, d = [0, b], l = [0, b], i = [0, 0], u = [0, 0], h = [2277735313, 289559509], p = [1291169091, 658871167], f = 0; f < E; f += 16) i = [255 & s.charCodeAt(f + 4) | (255 & s.charCodeAt(f + 5)) << 8 | (255 & s.charCodeAt(f + 6)) << 16 | (255 & s.charCodeAt(f + 7)) << 24, 255 & s.charCodeAt(f) | (255 & s.charCodeAt(f + 1)) << 8 | (255 & s.charCodeAt(f + 2)) << 16 | (255 & s.charCodeAt(f + 3)) << 24], u = [255 & s.charCodeAt(f + 12) | (255 & s.charCodeAt(f + 13)) << 8 | (255 & s.charCodeAt(f + 14)) << 16 | (255 & s.charCodeAt(f + 15)) << 24, 255 & s.charCodeAt(f + 8) | (255 & s.charCodeAt(f + 9)) << 8 | (255 & s.charCodeAt(f + 10)) << 16 | (255 & s.charCodeAt(f + 11)) << 24], i = a(i = c(i, h), 31), d = o(d = a(d = y(d, i = c(i, p)), 27), l), d = o(c(d, [0, 5]), [0, 1390208809]), u = a(u = c(u, p), 33), l = o(l = a(l = y(l, u = c(u, h)), 31), d), l = o(c(l, [0, 5]), [0, 944331445]); + for (var w = (s = s || "").length % 16, E = s.length - w, d = [0, b], l = [0, b], i = [0, 0], u = [0, 0], h = [2277735313, 289559509], p = [1291169091, 658871167], f = 0; f < E; f += 16) i = [255 & s.charCodeAt(f + 4) | (255 & s.charCodeAt(f + 5)) << 8 | (255 & s.charCodeAt(f + 6)) << 16 | (255 & s.charCodeAt(f + 7)) << 24, 255 & s.charCodeAt(f) | (255 & s.charCodeAt(f + 1)) << 8 | (255 & s.charCodeAt(f + 2)) << 16 | (255 & s.charCodeAt(f + 3)) << 24], u = [255 & s.charCodeAt(f + 12) | (255 & s.charCodeAt(f + 13)) << 8 | (255 & s.charCodeAt(f + 14)) << 16 | (255 & s.charCodeAt(f + 15)) << 24, 255 & s.charCodeAt(f + 8) | (255 & s.charCodeAt(f + 9)) << 8 | (255 & s.charCodeAt(f + 10)) << 16 | (255 & s.charCodeAt(f + 11)) << 24], i = c(i = a(i, h), 31), d = o(d = c(d = g(d, i = a(i, p)), 27), l), d = o(a(d, [0, 5]), [0, 1390208809]), u = c(u = a(u, p), 33), l = o(l = c(l = g(l, u = a(u, h)), 31), d), l = o(a(l, [0, 5]), [0, 944331445]); switch (i = [0, 0], u = [0, 0], w) { case 15: - u = y(u, m([0, s.charCodeAt(f + 14)], 48)); + u = g(u, y([0, s.charCodeAt(f + 14)], 48)); case 14: - u = y(u, m([0, s.charCodeAt(f + 13)], 40)); + u = g(u, y([0, s.charCodeAt(f + 13)], 40)); case 13: - u = y(u, m([0, s.charCodeAt(f + 12)], 32)); + u = g(u, y([0, s.charCodeAt(f + 12)], 32)); case 12: - u = y(u, m([0, s.charCodeAt(f + 11)], 24)); + u = g(u, y([0, s.charCodeAt(f + 11)], 24)); case 11: - u = y(u, m([0, s.charCodeAt(f + 10)], 16)); + u = g(u, y([0, s.charCodeAt(f + 10)], 16)); case 10: - u = y(u, m([0, s.charCodeAt(f + 9)], 8)); + u = g(u, y([0, s.charCodeAt(f + 9)], 8)); case 9: - u = c(u = y(u, [0, s.charCodeAt(f + 8)]), p), l = y(l, u = c(u = a(u, 33), h)); + u = a(u = g(u, [0, s.charCodeAt(f + 8)]), p), l = g(l, u = a(u = c(u, 33), h)); case 8: - i = y(i, m([0, s.charCodeAt(f + 7)], 56)); + i = g(i, y([0, s.charCodeAt(f + 7)], 56)); case 7: - i = y(i, m([0, s.charCodeAt(f + 6)], 48)); + i = g(i, y([0, s.charCodeAt(f + 6)], 48)); case 6: - i = y(i, m([0, s.charCodeAt(f + 5)], 40)); + i = g(i, y([0, s.charCodeAt(f + 5)], 40)); case 5: - i = y(i, m([0, s.charCodeAt(f + 4)], 32)); + i = g(i, y([0, s.charCodeAt(f + 4)], 32)); case 4: - i = y(i, m([0, s.charCodeAt(f + 3)], 24)); + i = g(i, y([0, s.charCodeAt(f + 3)], 24)); case 3: - i = y(i, m([0, s.charCodeAt(f + 2)], 16)); + i = g(i, y([0, s.charCodeAt(f + 2)], 16)); case 2: - i = y(i, m([0, s.charCodeAt(f + 1)], 8)); + i = g(i, y([0, s.charCodeAt(f + 1)], 8)); case 1: - i = c(i = y(i, [0, s.charCodeAt(f)]), h), d = y(d, i = c(i = a(i, 31), p)); + i = a(i = g(i, [0, s.charCodeAt(f)]), h), d = g(d, i = a(i = c(i, 31), p)); } - return d = o(d = y(d, [0, s.length]), l = y(l, [0, s.length])), l = o(l, d), d = o(d = g(d), l = g(l)), l = o(l, d), ("00000000" + (d[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (d[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (l[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (l[1] >>> 0).toString(16)).slice(-8); - }, xt.exports && (Nt = xt.exports = t), Nt.murmurHash3 = t; + return d = o(d = g(d, [0, s.length]), l = g(l, [0, s.length])), l = o(l, d), d = o(d = m(d), l = m(l)), l = o(l, d), ("00000000" + (d[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (d[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (l[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (l[1] >>> 0).toString(16)).slice(-8); + }, Tt.exports && (_t = Tt.exports = t), _t.murmurHash3 = t; }(); -const pn = mt(Ht.exports); -var or = { exports: {} }; -or.exports = function(t) { +const An = yt(Ht.exports); +var sr = {}, ir = { exports: {} }, ar = { exports: {} }; +(function(t) { + function e(r) { + return t.exports = e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) { + return typeof n; + } : function(n) { + return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n; + }, t.exports.__esModule = !0, t.exports.default = t.exports, e(r); + } + t.exports = e, t.exports.__esModule = !0, t.exports.default = t.exports; +})(ar); +var yn = ar.exports; +(function(t) { + var e = yn.default; + function r(n) { + if (typeof WeakMap != "function") return null; + var o = /* @__PURE__ */ new WeakMap(), a = /* @__PURE__ */ new WeakMap(); + return (r = function(c) { + return c ? a : o; + })(n); + } + t.exports = function(n, o) { + if (!o && n && n.__esModule) return n; + if (n === null || e(n) != "object" && typeof n != "function") return { default: n }; + var a = r(o); + if (a && a.has(n)) return a.get(n); + var c = { __proto__: null }, y = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var g in n) if (g !== "default" && {}.hasOwnProperty.call(n, g)) { + var m = y ? Object.getOwnPropertyDescriptor(n, g) : null; + m && (m.get || m.set) ? Object.defineProperty(c, g, m) : c[g] = n[g]; + } + return c.default = n, a && a.set(n, c), c; + }, t.exports.__esModule = !0, t.exports.default = t.exports; +})(ir); +var bn = ir.exports.default; +Object.defineProperty(sr, "__esModule", { value: !0 }); +var On = sr.default = function(t) { + var e = je.useRef(); + return e.current = t, je.useCallback(function() { + for (var r, n = arguments.length, o = new Array(n), a = 0; a < n; a++) o[a] = arguments[a]; + return (r = e.current) === null || r === void 0 ? void 0 : r.call.apply(r, [e].concat(o)); + }, []); +}, je = bn(ur), cr = { exports: {} }; +cr.exports = function(t) { var e = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; function r(l, i) { var u = l[0], h = l[1], p = l[2], f = l[3]; @@ -1748,31 +1791,31 @@ or.exports = function(t) { for (i = 0; i < 64; i += 4) u[i >> 2] = l[i] + (l[i + 1] << 8) + (l[i + 2] << 16) + (l[i + 3] << 24); return u; } - function c(l) { - var i, u, h, p, f, A, O = l.length, T = [1732584193, -271733879, -1732584194, 271733878]; - for (i = 64; i <= O; i += 64) r(T, n(l.substring(i - 64, i))); - for (u = (l = l.substring(i - 64)).length, h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i = 0; i < u; i += 1) h[i >> 2] |= l.charCodeAt(i) << (i % 4 << 3); - if (h[i >> 2] |= 128 << (i % 4 << 3), i > 55) for (r(T, h), i = 0; i < 16; i += 1) h[i] = 0; - return p = (p = 8 * O).toString(16).match(/(.*?)(.{0,8})$/), f = parseInt(p[2], 16), A = parseInt(p[1], 16) || 0, h[14] = f, h[15] = A, r(T, h), T; - } function a(l) { - var i, u, h, p, f, A, O = l.length, T = [1732584193, -271733879, -1732584194, 271733878]; - for (i = 64; i <= O; i += 64) r(T, o(l.subarray(i - 64, i))); - for (u = (l = i - 64 < O ? l.subarray(i - 64) : new Uint8Array(0)).length, h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i = 0; i < u; i += 1) h[i >> 2] |= l[i] << (i % 4 << 3); - if (h[i >> 2] |= 128 << (i % 4 << 3), i > 55) for (r(T, h), i = 0; i < 16; i += 1) h[i] = 0; - return p = (p = 8 * O).toString(16).match(/(.*?)(.{0,8})$/), f = parseInt(p[2], 16), A = parseInt(p[1], 16) || 0, h[14] = f, h[15] = A, r(T, h), T; + var i, u, h, p, f, A, O = l.length, x = [1732584193, -271733879, -1732584194, 271733878]; + for (i = 64; i <= O; i += 64) r(x, n(l.substring(i - 64, i))); + for (u = (l = l.substring(i - 64)).length, h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i = 0; i < u; i += 1) h[i >> 2] |= l.charCodeAt(i) << (i % 4 << 3); + if (h[i >> 2] |= 128 << (i % 4 << 3), i > 55) for (r(x, h), i = 0; i < 16; i += 1) h[i] = 0; + return p = (p = 8 * O).toString(16).match(/(.*?)(.{0,8})$/), f = parseInt(p[2], 16), A = parseInt(p[1], 16) || 0, h[14] = f, h[15] = A, r(x, h), x; } - function m(l) { + function c(l) { + var i, u, h, p, f, A, O = l.length, x = [1732584193, -271733879, -1732584194, 271733878]; + for (i = 64; i <= O; i += 64) r(x, o(l.subarray(i - 64, i))); + for (u = (l = i - 64 < O ? l.subarray(i - 64) : new Uint8Array(0)).length, h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i = 0; i < u; i += 1) h[i >> 2] |= l[i] << (i % 4 << 3); + if (h[i >> 2] |= 128 << (i % 4 << 3), i > 55) for (r(x, h), i = 0; i < 16; i += 1) h[i] = 0; + return p = (p = 8 * O).toString(16).match(/(.*?)(.{0,8})$/), f = parseInt(p[2], 16), A = parseInt(p[1], 16) || 0, h[14] = f, h[15] = A, r(x, h), x; + } + function y(l) { var i, u = ""; for (i = 0; i < 4; i += 1) u += e[l >> 8 * i + 4 & 15] + e[l >> 8 * i & 15]; return u; } - function y(l) { + function g(l) { var i; - for (i = 0; i < l.length; i += 1) l[i] = m(l[i]); + for (i = 0; i < l.length; i += 1) l[i] = y(l[i]); return l.join(""); } - function g(l) { + function m(l) { return /[\u0080-\uFFFF]/.test(l) && (l = unescape(encodeURIComponent(l))), l; } function s(l, i) { @@ -1795,16 +1838,16 @@ or.exports = function(t) { function d() { this.reset(); } - return y(c("hello")), typeof ArrayBuffer > "u" || ArrayBuffer.prototype.slice || function() { + return g(a("hello")), typeof ArrayBuffer > "u" || ArrayBuffer.prototype.slice || function() { function l(i, u) { return (i = 0 | i || 0) < 0 ? Math.max(i + u, 0) : Math.min(i, u); } ArrayBuffer.prototype.slice = function(i, u) { - var h, p, f, A, O = this.byteLength, T = l(i, O), P = O; - return u !== t && (P = l(u, O)), T > P ? new ArrayBuffer(0) : (h = P - T, p = new ArrayBuffer(h), f = new Uint8Array(p), A = new Uint8Array(this, T, h), f.set(A), p); + var h, p, f, A, O = this.byteLength, x = l(i, O), P = O; + return u !== t && (P = l(u, O)), x > P ? new ArrayBuffer(0) : (h = P - x, p = new ArrayBuffer(h), f = new Uint8Array(p), A = new Uint8Array(this, x, h), f.set(A), p); }; }(), d.prototype.append = function(l) { - return this.appendBinary(g(l)), this; + return this.appendBinary(m(l)), this; }, d.prototype.appendBinary = function(l) { this._buff += l, this._length += l.length; var i, u = this._buff.length; @@ -1813,7 +1856,7 @@ or.exports = function(t) { }, d.prototype.end = function(l) { var i, u, h = this._buff, p = h.length, f = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; for (i = 0; i < p; i += 1) f[i >> 2] |= h.charCodeAt(i) << (i % 4 << 3); - return this._finish(f, p), u = y(this._hash), l && (u = E(u)), this.reset(), u; + return this._finish(f, p), u = g(this._hash), l && (u = E(u)), this.reset(), u; }, d.prototype.reset = function() { return this._buff = "", this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this; }, d.prototype.getState = function() { @@ -1827,9 +1870,9 @@ or.exports = function(t) { if (l[f >> 2] |= 128 << (f % 4 << 3), f > 55) for (r(this._hash, l), f = 0; f < 16; f += 1) l[f] = 0; u = (u = 8 * this._length).toString(16).match(/(.*?)(.{0,8})$/), h = parseInt(u[2], 16), p = parseInt(u[1], 16) || 0, l[14] = h, l[15] = p, r(this._hash, l); }, d.hash = function(l, i) { - return d.hashBinary(g(l), i); + return d.hashBinary(m(l), i); }, d.hashBinary = function(l, i) { - var u = y(c(l)); + var u = g(a(l)); return i ? E(u) : u; }, d.ArrayBuffer = function() { this.reset(); @@ -1840,7 +1883,7 @@ or.exports = function(t) { }, d.ArrayBuffer.prototype.end = function(l) { var i, u, h = this._buff, p = h.length, f = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; for (i = 0; i < p; i += 1) f[i >> 2] |= h[i] << (i % 4 << 3); - return this._finish(f, p), u = y(this._hash), l && (u = E(u)), this.reset(), u; + return this._finish(f, p), u = g(this._hash), l && (u = E(u)), this.reset(), u; }, d.ArrayBuffer.prototype.reset = function() { return this._buff = new Uint8Array(0), this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this; }, d.ArrayBuffer.prototype.getState = function() { @@ -1849,16 +1892,17 @@ or.exports = function(t) { }, d.ArrayBuffer.prototype.setState = function(l) { return l.buff = s(l.buff, !0), d.prototype.setState.call(this, l); }, d.ArrayBuffer.prototype.destroy = d.prototype.destroy, d.ArrayBuffer.prototype._finish = d.prototype._finish, d.ArrayBuffer.hash = function(l, i) { - var u = y(a(new Uint8Array(l))); + var u = g(c(new Uint8Array(l))); return i ? E(u) : u; }, d; }(); -const gn = mt(or.exports); +const Sn = yt(cr.exports); export { - pn as M, - dn as N, - gn as S, - N as a, - hn as b, + An as M, + En as N, + Sn as S, + On as _, + _ as a, + vn as b, $t as s }; diff --git a/dist/components.js b/dist/components.js index c6d1e0b..cf8ab78 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { ar as s, ai as p, as as t, at as n, aq as r } from "./common/main-DOuFUIVr.js"; +import { ar as s, ai as p, as as t, at as n, aq as r } from "./common/main-D3Yt2diy.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index 8ced345..1ece12b 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { an as s, ar as e, as as p, at as t, ao as n, aq as d, ap as r, am as u } from "./common/main-DOuFUIVr.js"; +import { an as s, ar as e, as as p, at as t, ao as n, aq as d, ap as r, am as u } from "./common/main-D3Yt2diy.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index 6a314ff..f33678a 100644 --- a/dist/data-converter.js +++ b/dist/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as p } from "./common/main-DOuFUIVr.js"; +import { D as p } from "./common/main-D3Yt2diy.js"; export { p as default }; diff --git a/dist/data-list.js b/dist/data-list.js index 0ffe011..e71ccf2 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { M as t, K as e, C as r, I as o, N as i, J as l, F as u, L as D, E as n, O as L, B as C, Q as m, P as p, X as b, T as c, V as F, U as d, W as O, S } from "./common/main-DOuFUIVr.js"; +import { M as t, K as e, C as r, I as o, N as i, J as l, F as u, L as D, E as n, O as L, B as C, Q as m, P as p, X as b, T as c, V as F, U as d, W as O, S } from "./common/main-D3Yt2diy.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index 7335c35..1d1b0d3 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { q as a } from "../common/main-DOuFUIVr.js"; +import { q as a } from "../common/main-D3Yt2diy.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index 2d72319..af7bffc 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { a8 as s, aa as r, a9 as u, a7 as o, A as t, af as m, ad as d, ae as F, ah as i, ac as g, ab as c, ag as l } from "./common/main-DOuFUIVr.js"; +import { a8 as s, aa as r, a9 as u, a7 as o, A as t, af as m, ad as d, ae as F, ah as i, ac as g, ab as c, ag as l } from "./common/main-D3Yt2diy.js"; export { s as GridLayoutForm, r as GridLayoutFormHelper, diff --git a/dist/grid-layout-form/utils.js b/dist/grid-layout-form/utils.js index dca85a1..f1ca930 100644 --- a/dist/grid-layout-form/utils.js +++ b/dist/grid-layout-form/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { a as o, g } from "../common/main-DOuFUIVr.js"; +import { a as o, g } from "../common/main-D3Yt2diy.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 2a63f1b..b4e1eae 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { s as u, w as e, v as r, H as t, G as d, y as i, A as o, z as y, x as G } from "./common/main-DOuFUIVr.js"; +import { s as u, w as e, v as r, H as t, G as d, y as i, A as o, z as y, x as G } from "./common/main-D3Yt2diy.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index ca974a2..1994a64 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { l as o, o as a, p as s, n as g } from "../common/main-DOuFUIVr.js"; +import { l as o, o as a, p as s, n as g } from "../common/main-D3Yt2diy.js"; export { o as getBoxStyle, a as getEventProps, diff --git a/dist/hooks.js b/dist/hooks.js index 369f556..ddc1ad0 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -1,7 +1,7 @@ import "lodash"; import "rc-field-form"; import "react"; -import { a4 as r, a3 as o, a5 as p, a1 as f, a2 as i, a6 as m, a0 as c } from "./common/main-DOuFUIVr.js"; +import { a4 as r, a3 as o, a5 as p, a1 as f, a2 as i, a6 as m, a0 as c } from "./common/main-D3Yt2diy.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; export { r as useDeepEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index 41a1c3e..1e969ca 100644 --- a/dist/iconfont.js +++ b/dist/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { ai as a } from "./common/main-DOuFUIVr.js"; +import { ai as a } from "./common/main-D3Yt2diy.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index 80b7db9..e4a31d5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { aC as t, aD as e, ay as o, az as n, au as p, aA as r, ax as c, aw as u, av as f, aB as l } from "./common/main-DOuFUIVr.js"; +import { aC as t, aD as e, ay as o, az as n, au as p, aA as r, ax as c, aw as u, av as f, aB as l } from "./common/main-D3Yt2diy.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index c2a9ed4..8b63fa8 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { Z as t, Y as e, _ as o, $ as g } from "./common/main-DOuFUIVr.js"; +import { Z as t, Y as e, _ as o, $ as g } from "./common/main-D3Yt2diy.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index 6009211..f5b9c53 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-DOuFUIVr.js"; +import { R as a } from "./common/main-D3Yt2diy.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index 75ba8e0..e8419b7 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,6 +1,6 @@ import "lodash"; -import { d as s, f as i, e as g, h as m, b as o, k as P, c as p, j as d, i as h, m as k, r as f, t as u, u as l } from "./common/main-DOuFUIVr.js"; -import "./common/vender-BkiRbACr.js"; +import { d as s, f as i, e as g, h as m, b as o, k as P, c as p, j as d, i as h, m as k, r as f, t as u, u as l } from "./common/main-D3Yt2diy.js"; +import "./common/vender-DTKG7Nf1.js"; export { s as deepSome, i as getPkgCategory, diff --git a/dist/virtual-fs.js b/dist/virtual-fs.js index b78645e..0f2065c 100644 --- a/dist/virtual-fs.js +++ b/dist/virtual-fs.js @@ -1,5 +1,5 @@ import "pathe"; -import { aE as o, aF as r } from "./common/main-DOuFUIVr.js"; +import { aE as o, aF as r } from "./common/main-D3Yt2diy.js"; export { o as default, r as toTreePaths diff --git a/package.json b/package.json index c912fed..e78f662 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.6.31", + "version": "0.6.32", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js",