diff --git a/dist/button.js b/dist/button.js index b0a3fdc..abba377 100644 --- a/dist/button.js +++ b/dist/button.js @@ -1,4 +1,4 @@ -import { am as s, al as u, an as e } from "./common/main-TLNRXor8.js"; +import { am as s, al as u, an as e } from "./common/main-DcQsUE57.js"; export { s as auth, u as default, diff --git a/dist/common/main-DcQsUE57.js b/dist/common/main-DcQsUE57.js new file mode 100644 index 0000000..c99ef93 --- /dev/null +++ b/dist/common/main-DcQsUE57.js @@ -0,0 +1,1569 @@ +var Tn = Object.defineProperty; +var fr = (t) => { + throw TypeError(t); +}; +var On = (t, e, r) => e in t ? Tn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r; +var O = (t, e, r) => On(t, typeof e != "symbol" ? e + "" : e, r), yr = (t, e, r) => e.has(t) || fr("Cannot " + r); +var d = (t, e, r) => (yr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), v = (t, e, r) => e.has(t) ? fr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), q = (t, e, r, n) => (yr(t, e, "write to private field"), n ? n.call(t, r) : e.set(t, r), r); +import { jsx as h, jsxs as I } from "react/jsx-runtime"; +import x, { useEffect as W, useState as L, useCallback as J, useRef as H, useContext as pe, useMemo as U, useId as Vt, isValidElement as Rn, useLayoutEffect as Fn } from "react"; +import ge from "pathe"; +import C from "prop-types"; +import j from "classnames"; +import { useNotification as jn } from "rc-notification"; +import w from "lodash"; +import { useMountedState as An, useDeepCompareEffect as Yt, useUpdateEffect as Xt, usePrevious as Fr } from "react-use"; +import oe, { Field as Qt, FieldContext as jr } from "rc-field-form"; +import { _ as wr, C as Qe, L as In, M as Ft, N as Xe, b as Ve, o as Dt, c as Ln, S as Vn } from "./vender-C5RbewOc.js"; +import Dn from "rc-util/lib/hooks/useMergedState"; +import Ar from "immutability-helper"; +import { Space as Mt, Form as yt, Input as Mn, Button as bt, Pagination as zn, Tree as Bn, Breadcrumb as Un, Empty as zt, Table as br, Popover as Wn, Popconfirm as _n, Tooltip as qn, Divider as Kn } from "antd"; +import { useMergedState as Hn } from "rc-util"; +import { generatePath as Jn, useInRouterContext as Ir, useParams as Gn, useLocation as Yn, createBrowserRouter as Xn, Navigate as Qn } from "react-router-dom"; +import Zn from "rc-drawer"; +import ei from "rc-dialog"; +import * as Cr from "react-is"; +var We, et, _e, Ee, De, Me; +class Lr { + constructor(e, r) { + v(this, We, /* @__PURE__ */ new Map()); + v(this, et, !0); + v(this, _e, []); + v(this, Ee); + v(this, De, () => d(this, Ee)); + v(this, Me, () => Promise.resolve()); + O(this, "get", (...e) => new Promise((r, n) => { + const i = JSON.stringify(e); + if (d(this, We).has(i)) return r(d(this, Me).call(this, d(this, Ee), ...e)); + if (d(this, Ee) === void 0) d(this, _e).push([e, r, n]), d(this, et) && (q(this, et, !1), Promise.resolve(typeof d(this, De) == "function" ? d(this, De).call(this) : d(this, De)).then((o) => q(this, Ee, o || null)).finally(() => { + d(this, _e).forEach(([o, a, s]) => { + try { + const l = d(this, Me).call(this, d(this, Ee), ...o); + d(this, We).set(JSON.stringify(o), l), a(l); + } catch (l) { + s(l); + } + }), d(this, _e).length = 0; + })); + else { + const o = d(this, Me).call(this, d(this, Ee), ...e); + d(this, We).set(i, o), r(o); + } + })); + q(this, Me, r), q(this, De, e); + } +} +We = new WeakMap(), et = new WeakMap(), _e = new WeakMap(), Ee = new WeakMap(), De = new WeakMap(), Me = new WeakMap(); +const $o = () => h("div", { children: "Empty" }), pt = x.createContext({ ele: {}, mount: () => { +}, unmount: () => { +} }), re = ({ rootClassName: t, className: e, children: r, actions: n, title: i, subTitle: o, extras: a, style: s = {} }) => { + const { mount: l, unmount: c } = x.useContext(pt); + return re.Action({ children: n }), re.Title({ children: i }), re.SubTitle({ children: o }), re.Extra({ children: a }), W(() => (l("rootClassName", t), () => c(t)), [t]), h("div", { className: j("ff-container", e), style: s, children: r }); +}, ft = (t) => ({ children: e, className: r }) => { + const { mount: n, unmount: i } = x.useContext(pt); + return W(() => (e && n(t, x.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, r) }, e)), () => i(t)), [r, e]), null; +}; +re.Action = ft("actions"), re.Title = ft("title"), re.SubTitle = ft("sub-title"), re.Extra = ft("extras"), re.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; +const vo = () => h(re, { className: "ff-loading", children: I("div", { className: "loader", children: [I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), No = () => h("div", { children: "NotFound" }), Vr = ({ children: t }) => { + const [e, r] = L({}), n = J((o, a) => r((s) => ({ ...s, [o]: a })), []), i = J((o) => r((a) => ({ ...a, [o]: void 0 })), []); + return typeof (t == null ? void 0 : t.type) == "string" ? t : h(pt.Provider, { value: { ele: e, mount: n, unmount: i }, children: x.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); +}; +Vr.propTypes = { children: C.element.isRequired }; +const Sr = { close: ["M563.8 512l262.5-312.9c4.4-5.2 0.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9c-4.4 5.2-0.7 13.1 6.1 13.1h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"], check: ["M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474c-6.1-7.7-15.3-12.2-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1 0.4-12.8-6.3-12.8z"], info: ["M512 224m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z", "M544 392h-64c-4.4 0-8 3.6-8 8v464c0 4.4 3.6 8 8 8h64c4.4 0 8-3.6 8-8V400c0-4.4-3.6-8-8-8z"] }, Zt = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Sr[t] || Sr.info).map((r, n) => h("path", { d: r }, n)) }) }), Dr = ({ className: t, content: e, icon: r, $close: n }) => I(x.Fragment, { children: [r && h("div", { className: j("ff-notification-icon", t), children: h(Zt, { type: r }) }), e] }), ti = ({}) => h(re, { children: "Confirm" }); +var Te, qe; +const he = class he { + constructor() { + v(this, qe, /* @__PURE__ */ new Map()); + O(this, "init", (e) => q(this, qe, new Map(e))); + O(this, "check", (e) => !d(this, qe).has(e) || d(this, qe).get(e)); + if (d(he, Te)) return d(he, Te); + } +}; +Te = new WeakMap(), qe = new WeakMap(), v(he, Te, null), O(he, "getInstance", () => (d(he, Te) || q(he, Te, new he()), d(he, Te))); +let Bt = he; +const Mr = Bt.getInstance(), ri = (t, e, r = "children") => { + if (w.isEmpty(t)) return {}; + const n = w.find(t, ["value", e]); + if (!w.isEmpty(n)) return n; + const i = t.length; + for (let o = 0; o < i; o++) { + const { [r]: a } = t[o], s = ri(a, e, r); + if (!w.isEmpty(s)) return s; + } + return {}; +}, zr = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; +var Oe, tt; +const me = class me { + constructor() { + v(this, tt, null); + O(this, "init", (e) => q(this, tt, e)); + O(this, "get", (e, r) => w.get(d(this, tt), e, r)); + if (d(me, Oe)) return d(me, Oe); + } +}; +Oe = new WeakMap(), tt = new WeakMap(), v(me, Oe, null), O(me, "getInstance", () => (d(me, Oe) || q(me, Oe, new me()), d(me, Oe))); +let Ut = me; +const Ue = Ut.getInstance(); +var Ke, kt, rt, nt, xt; +const Ne = class Ne { + constructor(...e) { + v(this, rt, []); + v(this, nt, (e) => { + var r; + for (let n of e) Array.isArray(n[0]) ? d(this, nt).call(this, n) : d(this, rt).push(d(r = Ne, kt).call(r, n[0], n[1])); + }); + O(this, "toValue", async (e, r = null) => { + const n = { getValue: () => e, getRecord: () => r }; + let i = e; + for (const o of d(this, rt)) try { + const a = await o; + if (typeof a != "function") { + console.warn("middleware is not a function, skip:", a); + continue; + } + i = await a.call(n, i); + } catch (a) { + console.error("middleware error, skip:", a); + } + return i; + }); + O(this, "toRender", (e, r, n = null) => x.createElement(d(this, xt), { value: e, record: r }, n)); + v(this, xt, ({ value: e, record: r, children: n }) => { + const [i, o] = L(n), a = An(); + return Yt(() => { + o(n), this.toValue(e, r).then((s) => a() && o(s)).catch((s) => a() && o(`${s}`)); + }, [e, r]), i; + }); + d(this, nt).call(this, e); + } +}; +Ke = new WeakMap(), kt = new WeakMap(), rt = new WeakMap(), nt = new WeakMap(), xt = new WeakMap(), v(Ne, Ke, null), v(Ne, kt, w.memoize((e, r) => { + if (typeof e == "function") return e(r); + if (typeof e == "string") return ae.getWidgetComponent(e).then((n) => { + var i; + return ((i = n.default) == null ? void 0 : i.call(n, r)) || ((o) => o); + }); + throw new TypeError("middleware must be a string or a function"); +}, (...e) => { + var r; + return d(Ne, Ke) || q(Ne, Ke, Oi()), d(r = Ne, Ke).call(r, ...e); +})); +let Ct = Ne; +const se = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { +}, getSelectedRows: () => [], onReload: () => { +}, onClickCallback: () => { +}, onConditionChange: () => { +}, onTabChange: () => { +}, onSiderChange: () => { +}, onKeywordChange: () => { +}, onPageChange: () => { +}, onPageSizeChange: () => { +}, reload: () => { +}, setPage: () => { +}, setPageSize: () => { +}, setTab: () => { +}, setSider: () => { +}, setKeyword: () => { +}, setCondition: () => { +} }), kr = ({ className: t, record: e, column: r, ...n }) => { + if (r != null && r.editableByJs && (r != null && r.uuid)) { + const { formSetting: i = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (r == null ? void 0 : r.editableByJsSetting) || {}; + return h(R.Popover, { widget: Br, widgetData: { record: e, column: r }, widgetSetting: { widgetSetting: o, formSetting: i }, widgetContainerProps: { title: r != null && r.title ? `${r.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...a }, children: h("td", { className: j("ff-data-list-cell-editable", t), ...n }) }); + } + return h("td", { className: t, ...n }); +}, Br = ({ record: t, column: e, $close: r, $setting: n }) => { + const i = H(Ni(w.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = pe(se), [s] = oe.useForm(), { formSetting: l, widgetSetting: c } = n, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { + s.setFieldsValue({ value: w.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); + }; + return Nt(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(re, { actions: I(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), I(Mt.Compact, { block: !0, children: [h(R, { size: "small", widget: r, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: f }) => { + const y = w.get(t, u.substring(u.indexOf(".") + 1)); + if (!y) throw "获取更新主键失败!"; + z.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${y}`, { value: f }).msg(() => a(2, t)).then(r); + }).catch(console.warn), children: "保存" })] })] }), children: I(oe, { form: s, children: [h(rr, { label: "", code: "value", type: i.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(Qt, { noStyle: !0, name: ["__PROPS__"], children: () => { + } })] }) }); +}; +Br.displayName = "DataListCellEditableContainer"; +const ni = (t) => function(e) { + return t(e, getRecord()); +}, ii = async ({ widgetByJs: t, widgetByJsSetting: e }) => { + const r = await ae.getWidgetComponent(t).then((n) => n.default || ((i) => i)); + return function(n) { + return h(r, { value: n, $setting: e }); + }; +}, oi = (t, e = {}) => U(() => { + var r; + return (r = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : r.map(({ widgetByJs: n, widgetByJsSetting: i, middlewares: o, ...a }, s) => { + const l = (c) => ({ record: c, column: a }); + return o || (o = []), n && o.push([ii, { widgetByJs: n, widgetByJsSetting: i }]), o.length > 0 ? (a != null && a.render && o.push([ni, a.render]), { ...a, onCell: l, render: (c, u) => new Ct(o).toRender(c, u, "-") }) : { ...a, onCell: l }; + }); +}, [t, e]), ai = (t = {}) => U(() => { + var e; + return t.body ?? (t.body = { cell: kr }), (e = t.body).cell ?? (e.cell = kr), t; +}, [t]), To = (t) => { + const [e, r] = L({}); + return W(() => { + let n = !1; + return t && z.get(`/api/_/${t}`).then((i) => w.pick(i, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((i) => !n && r(i)), () => n = !0; + }, [t]), e; +}, Oo = (t, e = {}) => { + const [r, n] = L({ dataSource: [] }); + return gt(() => { + let i = !1; + return t && z.get(`/api/${t}/${z.encode({ page: 1, ...e })}`).then((o) => !i && n(o)), () => i = !0; + }, [t, e]), r; +}, Ur = (t = [], e = /* @__PURE__ */ new Map(), r = "id", n) => { + const i = J(n ? (o) => w.get(o, r, w.get(o, [n, r])) : (o) => w.get(o, r), [r, n]); + return J((o) => t == null ? void 0 : t.filter((a) => !a.uuid || !e.has(a.uuid) || e.get(a.uuid).some((s) => s == i(o))), [t, e, i]); +}, Wt = (t = [], e = /* @__PURE__ */ new Map(), r = [], n = "id", i) => { + const o = J(i ? (a) => w.get(a, n, w.get(a, [i, n])) : (a) => w.get(a, n), [n, i]); + return U(() => { + if (w.isEmpty(t) || !t.some(({ uuid: s }) => Mr.check(s))) return !1; + if (w.isEmpty(e) || w.isEmpty(r)) return !0; + const a = r.map((s) => o(s)); + return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((c) => c == l))); + }, [t, r, e, o]); +}, si = (t, e, r = "id", n = null) => { + const i = vt(), o = H(!1), a = H(t.dataSource), s = H(t.itemOperationsAccess); + return W(() => (a.current = t.dataSource, s.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = a.current, t.itemOperationsAccess = s.current), [t, (l = 0, c = null) => { + var u, p; + if (o.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); + if (l === 2) { + const m = w.get(c, "__PARENT_ID__", ""), g = w.get(c, r, w.get(c, [n, r], "")), f = w.findIndex(a.current, ["__PARENT_ID__", m]), y = w.findIndex(f > -1 ? w.get(a.current, [f, "children"]) : a.current, [r, g]); + if (y === -1) return (p = t.onReload) == null ? void 0 : p.call(t); + Promise.all([z.get(`/api/${e}/detail/${g}`), z.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([k, b]) => { + const E = w.get(a.current, f > -1 ? [f, "children", y, "children"] : [y, "children"]); + a.current = Ar(a.current, f > -1 ? { [f]: { children: { $splice: [[y, 1, { ...k, children: E }]] } } } : { $splice: [[y, 1, { ...k, children: E }]] }); + const S = new Map(b); + s.current.forEach((P, F) => { + var A; + (A = S.get(F)) != null && A.some((T) => T == g) || s.current.set(F, P.filter((T) => T !== g)); + }), S.forEach((P, F) => { + s.current.has(F) ? s.current.set(F, w.uniq([...s.current.get(F) || [], ...P])) : s.current.set(F, P); + }); + }).then(() => { + o.current = !0, i(); + }); + } + }]; +}, li = (t, e) => { + const r = vt(), n = H(e), i = H(/* @__PURE__ */ new Map()), o = H([]), a = w.throttle((l) => { + o.current = [], z.list(t, w.pick({ ...n.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: f, pageSize: y, operationsAccess: k, dataSource: b }) => { + n.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: y, page: b != null && b.length ? f : 1 }, o.current = b, i.current = new Map(k), r(); + }); + }, 380, { leading: !1, trailing: !0 }); + Nt(() => { + o.current = [], t && a(e); + }, [t, e]); + const s = U(() => w.pick(n.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword", "primaryKey"]), [n.current]); + return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, c) => a({ page: l, pageSize: c }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, c) => a({ keyword: c, condition: Ar(n.current.condition || {}, { $merge: l || {} }), page: 1 }), onSiderChange: (l) => a({ sider: l, page: 1 }), onKeywordChange: (l) => a({ keyword: l, page: 1 }), itemOperationsAccess: i.current, dataSource: o.current, onReload: a, payload: e == null ? void 0 : e.payload }); +}, ci = ({ listCode: t, className: e, layouts: r = {}, dataSource: n, isPaginate: i, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: f, tabs: y, isConditionFormLayout: k, isTreeSider: b, treeSiderConfig: E, rowSelection: S }) => { + const { classNames: P, onClickCallback: F } = pe(se), A = w.pick(f, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), T = f == null ? void 0 : f.isMarkSelected, N = Ur(l, c, p, u), D = J(($, V, M) => h(di, { isMarkSelected: T, className: j("ff-data-list-framework-item", P == null ? void 0 : P.item), operations: o ? N(V) : [], data: u ? { [u]: V } : V, children: $, onClickCallback: F }), [T, u, p, o, F, l, c]); + return I("div", { className: j("ff-data-list-framework", e), children: [h(r.sider, { isTreeSider: b, ...E }), I("div", { className: j("ff-data-list-container", P == null ? void 0 : P.container), children: [h(r.filter, { isConditionFormLayout: k }), h(r.toolbar, { title: m, tabs: y }), h(Ei, { ...g, ...A, rowSelection: S, empty: h(r.empty, { className: P == null ? void 0 : P.empty }), primaryKey: p, itemRender: D, dataSource: n }), h(r.footer, { isPaginate: i, isOperations: a, operations: s })] })] }); +}, di = ({ className: t, operations: e, children: r, data: n, onClickCallback: i, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => I("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: r }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => h("span", { className: "data-list-grid-layout-item-action", children: h(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: n, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (i == null ? void 0 : i(c.isRefresh, n)) }, c.uuid || Vt()) }, (c == null ? void 0 : c.uuid) || Vt())) })] }), ui = ({ listCode: t, className: e, layouts: r = {}, dataSource: n, columns: i, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: f, rowSelection: y, isTreeSider: k, treeSiderConfig: b, isConditionFormLayout: E, ...S }) => { + const { classNames: P, onClickCallback: F } = pe(se), A = Ur(l, c, p, u), T = Wt(l, c, n, p, u); + return I("div", { className: j("ff-data-table-framework", e), children: [h(r.sider, { isTreeSider: k, ...b }), I("div", { className: j("ff-data-table-container", P == null ? void 0 : P.container), children: [h(r.filter, { isConditionFormLayout: E }), h(r.toolbar, { title: m, tabs: g }), h(wi, { ...S, primaryKey: p, className: "ff-data-table-content", columns: i, dataSource: n, rowSelection: y, operationRender: T ? (N) => { + var D; + return h("div", { className: "ff-data-table-actions", children: (D = A(N)) == null ? void 0 : D.map(($, V) => h(R, { size: "small", uuid: $.uuid, type: $.type, name: $.name, widget: $.widget, widgetType: $.widgetType, widgetProps: $.widgetProps, widgetData: $.widgetData, widgetSetting: $.widgetSetting, widgetContainerProps: $.widgetContainerSetting, data: N, confirm: $.confirm, onAfterClick: (M) => M !== !1 && (F == null ? void 0 : F($.isRefresh, N)) }, $.uuid || V)) }); + } : null }), h(r.footer, { isPaginate: f, isOperations: a, operations: s })] })] }); +}, er = (t = [], e, r = null) => { + var n; + return (n = w.sortBy(t, ["y", "x"])) == null ? void 0 : n.map(({ i, x: o, y: a, w: s, h: l, field: { boxStyle: c, ...u } = {} }, p) => h("div", { className: "grid-layout-item", style: Wr(o, a, s, l, c), children: h(e, { ...u, basicForm: r }) }, i ?? p)); +}, Wr = (t, e, r, n, i = {}, o = 0) => { + const a = { "--grid-layout-h": `${n}`, "--grid-layout-w": `${r}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; + return i != null && i.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${n}`, i != null && i.alignItems && (a["--grid-layout-box-align-items"] = i.alignItems), i != null && i.justifyContent && (a["--grid-layout-box-justify-content"] = i.justifyContent), a["--grid-layout-box-margin"] = xr(i == null ? void 0 : i.marginTop, i == null ? void 0 : i.marginRight, i == null ? void 0 : i.marginBottom, i == null ? void 0 : i.marginLeft), a["--grid-layout-box-padding"] = xr(i == null ? void 0 : i.paddingTop, i == null ? void 0 : i.paddingRight, i == null ? void 0 : i.paddingBottom, i == null ? void 0 : i.paddingLeft), o && (a.height = `${o}px`), a; +}, xr = (t, e, r, n) => `${t || 0}px ${e || 0}px ${r || 0}px ${n || 0}px`, Ro = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, _r = (t) => Object.keys(t).reduce((e, r) => (/^on[A-Z]/.test(r) && (e[r] = t[r]), e), {}), qr = ({ className: t, isConditionFormLayout: e }) => { + var m, g; + const [r, n] = L({}), { listCode: i, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = x.useContext(se), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = yt.useForm(); + return W(() => { + i && e && z.get(`/api/_/${i}/list-condition-form-layout`).then(({ resource: f, marginX: y, marginY: k, rowHeight: b, cols: E, fields: S }) => { + n({ resource: f, itemMargin: [y, k], rowHeight: b, cols: E, fields: S }); + }).catch(() => n({})); + }, [i, e]), W(() => { + p.setFieldsValue({ keyword: c, ...u }); + }, [JSON.stringify([c, u])]), h("div", { className: j("ff-data-list-filter", l.filter, t), children: h(yt, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((m = r.fields) == null ? void 0 : m.length) > 1 ? (f) => a({ [r.resource]: f[r.resource] }, f.keyword) : () => { + }, onValuesChange: (f) => { + w.isEmpty(w.omit(f, ["keyword"])) || p.submit(); + }, children: ((g = r.fields) == null ? void 0 : g.length) > 1 ? h(nr, { ...r, children: h(pi, { onReset: () => { + const { keyword: f, condition: y } = s("init") || {}; + p.setFieldsValue({ keyword: f, ...y }); + } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Wr(20, 0, 5, 2), children: h(yt.Item, { name: ["keyword"], children: h(Mn.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (f) => o(f) }) }) }) }) }) }); +}, pi = ({ cols: t, fields: e, onReset: r }) => { + const [n, i] = L(!1), o = U(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]); + return I(yt.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: n }), children: [h(bt, { onClick: r, children: "重置" }), h(bt, { type: "primary", htmlType: "submit", children: "查询" }), o && h(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => i((a) => !a), type: "primary", name: n ? "关闭" : "展开", icon: n ? "icon-up" : "icon-down", iconPosition: "end" })] }); +}; +qr.reservedFields = [{ x: 0, y: 0, h: 3, w: 5, field: { isVirtual: !0, widgetPrefix: "@pkg/ff/grid-layout-forms", widget: "Input", code: "keyword", label: "关键字", placeholder: "多关键字 | 分割", extras: { prefix: "icon-search" } } }]; +const gi = ({ className: t, operations: e, isOperations: r, isPaginate: n }) => { + const { onPageChange: i, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = x.useContext(se), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; + return r && !w.isEmpty(e) || n ? I("div", { className: j("ff-data-list-footer", t), children: [h("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, m) => h(R, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || m)) }), n && h(zn, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: i, onShowSizeChange: o })] }) : null; +}, hi = [{ 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" }] }] }], mi = ({ className: t, width: e = 280, isTreeSider: r }) => { + const { classNames: n } = pe(se); + return r ? h(Bn.DirectoryTree, { className: j("ff-data-list-sider", n.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: hi }) : null; +}, fi = ({ className: t, title: e, tabs: r }) => { + const { getBase62params: n, onTabChange: i, onReload: o, classNames: a } = pe(se), { tab: s } = (n == null ? void 0 : n()) || {}, [l, c] = Hn((r == null ? void 0 : r[0].value) ?? (r == null ? void 0 : r[0].code), { value: s, onChange: i }); + return I("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(Un, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: m }) => h("span", { onClick: () => c(m ?? p), className: j("ff-data-list-tab", { active: (m ?? p) == l }), children: u }), items: r }), I("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); +}, yi = ({ className: t, ...e }) => h(zt, { className: j(t, "ff-data-list-empty"), image: zt.PRESENTED_IMAGE_SIMPLE, ...e }), Kr = ({ isItemGridLayout: t, theme: e, themeProps: r, onClickCallback: n, onReload: i, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: f, condition: y, onConditionChange: k, sider: b, onSiderChange: E, layouts: S, classNames: P = {}, payload: F = {}, dataSource: A = [], rowSelection: T, getSelectedRows: N, primaryKey: D, ...$ }) => { + const [V, M] = L(), B = N ?? (() => A), X = J((_, le) => { + const K = { tab: p, page: s, pageSize: c, keyword: g, sider: b, condition: y, total: a, payload: F }; + return _ && _ != "init" ? w.get(K, _, le) : K; + }, [JSON.stringify(y), JSON.stringify(F), p, s, c, g, b, a]), xe = U(() => { + let _ = { sider: mi, filter: qr, footer: gi, toolbar: fi, empty: yi }; + S === !1 ? _ = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : w.isPlainObject(S) && (_ = Object.assign({}, _, S)); + for (const le in _) if (_[le]) { + if (Rn(_[le])) { + const K = _[le]; + _[le] = (mt) => x.cloneElement(K, mt); + } + } else _[le] = () => h(x.Fragment, {}); + return _; + }, [S]); + return W(() => { + e ? ae.getWidgetComponent(e).then((_) => { + if (!_) throw `${e} not found`; + return _; + }).catch((_) => ({ default: () => `${_}` })).then((_) => M(x.createElement(_.default, { ...$, layouts: xe, $setting: r }))) : M(h(t ? ci : ui, { ...$, layouts: xe, $setting: r })); + }, [e, r]), h(se.Provider, { value: { classNames: P, listCode: o, onClickCallback: n, onReload: i, getBase62params: X, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: f, onConditionChange: k, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: f, setCondition: k, getSelectedRows: B }, children: V && x.cloneElement(V, { dataSource: A, primaryKey: D, rowSelection: T, ...$ }) }); +}; +Kr.propTypes = { classNames: C.exact({ sider: C.string, filter: C.string, footer: C.string, toolbar: C.string, container: C.string, content: C.string, item: C.string, empty: C.string }), layouts: C.oneOfType([C.exact({ sider: C.oneOfType([C.elementType, C.element]), filter: C.oneOfType([C.elementType, C.element]), footer: C.oneOfType([C.elementType, C.element]), toolbar: C.oneOfType([C.elementType, C.element]), empty: C.oneOfType([C.elementType, C.element]) }), C.bool]) }; +var Re, Pe, ze, Et; +const fe = class fe { + constructor() { + v(this, Pe, null); + v(this, ze, /* @__PURE__ */ new Map()); + v(this, Et, () => { + if (d(this, Pe)) return d(this, Pe).port.postMessage({ command: "status", data: [] }); + q(this, Pe, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), d(this, Pe).port.onmessage = (e) => { + var r, n; + (r = e.data) != null && r.uuid ? d(this, ze).forEach((i, o) => { + var a; + (i == "*" || (a = i == null ? void 0 : i.includes) != null && a.call(i, e.data.uuid)) && o(e.data); + }) : ((n = e.data) == null ? void 0 : n.readyState) == WebSocket.CLOSED && z.get("/api/user-api-token").then(({ token: i, expire_at: o }) => { + d(this, Pe).port.postMessage({ command: "initWs", data: [`ws${w.trimStart(z.appUrl, "http")}api/user-resource-status-ws?token=${i}`] }); + }); + }, d(this, Pe).port.postMessage({ command: "status", data: [] }); + }); + O(this, "subscribe", (e, r = []) => (r ? Array.isArray(r) && r.length == 0 ? r = "*" : Array.isArray(r) || (r = [r].flat()) : r = "*", d(this, ze).set(e, r), d(this, ze).size == 1 && d(this, Et).call(this), () => this.unsubscribe(e))); + O(this, "unsubscribe", (e) => d(this, ze).delete(e)); + if (d(fe, Re)) return d(fe, Re); + } +}; +Re = new WeakMap(), Pe = new WeakMap(), ze = new WeakMap(), Et = new WeakMap(), v(fe, Re, null), O(fe, "getInstance", () => (d(fe, Re) || q(fe, Re, new fe()), d(fe, Re))); +let _t = fe; +const Hr = _t.getInstance(), tr = x.forwardRef(({ listCode: t, base62params: e, className: r, theme: n, themeProps: i, layouts: o, classNames: a, rowSelection: s = null, onDataSourceChange: l }, c) => { + const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: f = [], isConditionFormLayout: y = !1, isTreeSider: k, treeSiderConfig: b, theme: E, themeConfig: S, isItemGridLayout: P, itemGridLayout: { themeConfig: F, ...A } = {}, title: T, isPaginate: N, tabs: D, selectionType: $ }, V] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: M = $, selectedRowKeys: B, defaultSelectedRowKeys: X, onChange: xe, ..._ } = s ?? {}, le = li(t, e), [{ dataSource: K, itemOperationsAccess: mt, condition: cn, tab: dn, keyword: un, page: sr, total: lr, pageSize: cr, sider: pn, onConditionChange: gn, onTabChange: hn, onKeywordChange: mn, onPageChange: fn, onPageSizeChange: yn, onSiderChange: wn, onReload: Ot, payload: bn }, dr] = si(le, t, p, u), Cn = wr(l); + Xt(() => { + Cn(K, { primaryKey: p, page: sr, pageSize: cr, total: lr }); + }, [K]); + const [ur, Sn] = Dn([], { defaultValue: X ?? [], value: B }), [pr, kn] = L([]), gr = J(() => M ? pr : K, [M, pr, K]), xn = Wt(g, mt, K, p), En = Wt(m); + W(() => { + let Q = null; + return t && z.get(`/api/_/${t}`).resp(({ data: Le, res: Rt }) => { + Le != null && Le.isDynamicRefresh && (Q = Hr.subscribe(() => Ot(), Rt)), V(Le); + }).catch(() => V({})), () => Q == null ? void 0 : Q(); + }, [t]), x.useImperativeHandle(c, () => ({ onReload: Ot, onClickCallback: dr, getSelectedRows: gr })); + const hr = wr((Q, Le) => { + kn((Rt) => { + const mr = new Map(Rt.map((ce) => [ce == null ? void 0 : ce[p], ce])); + return Le.forEach((ce) => mr.set(ce == null ? void 0 : ce[p], ce)), Q.map((ce) => mr.get(ce)).filter(Boolean); + }), Sn(Q), xe == null || xe(Q, Le); + }), Pn = U(() => M ? { columnWidth: 80, ..._, type: M, selectedRowKeys: ur, onChange: hr } : void 0, [M, ur, hr, s]), $n = U(() => w.merge({}, S, i), [S, i]), vn = U(() => g == null ? void 0 : g.map((Q) => w.isEmpty(Q == null ? void 0 : Q.confirm) ? Q : { ...Q, confirm: Object.assign({}, Q.confirm, { getPopupContainer: () => document.body }) }), [g]), Nn = U(() => ({ ...A, themeProps: F }), [A, F]); + return h(Kr, { listCode: t, title: T, classNames: a, layouts: o, resource: u, primaryKey: p, theme: n || E, themeProps: $n, isTreeSider: k, treeSiderConfig: b, isPaginate: N, rowSelection: Pn, getSelectedRows: gr, tabs: D, isItemOperations: xn, itemOperations: vn, isBatchOperations: En, batchOperations: m, isItemGridLayout: P, columns: f, itemGridLayout: Nn, isConditionFormLayout: y, itemOperationsAccess: mt, dataSource: K, onConditionChange: gn, onTabChange: hn, onKeywordChange: mn, onPageChange: fn, onPageSizeChange: yn, onSiderChange: wn, condition: cn, tab: dn, keyword: un, page: sr, total: lr, pageSize: cr, sider: pn, payload: bn, className: j("ff-data-list-helper", r), onReload: Ot, onClickCallback: dr }); +}), Jr = (t, e, r = !0) => r !== !0 && r-- <= 0 ? [] : w.isArray(t) && !w.isEmpty(t) ? t.reduce((n, i) => (Reflect.has(i, e) && Reflect.has(i, "children") && n.push(i[e]), Reflect.has(i, "children") && !w.isEmpty(i.children) ? n.concat(Jr(i.children, e, r)) : n), []) : [], wi = ({ className: t, primaryKey: e, columns: r = [], dataSource: n = [], operationRender: i, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { + const { classNames: c } = pe(se), u = H(null), p = H(null), [m, g] = L([]), [f, y] = L({ width: 0, height: 0 }); + W(() => { + g(Jr(n, e)); + }, [n, e]), Fn(() => { + const S = new ResizeObserver(() => { + var P; + y({ width: ((P = u.current) == null ? void 0 : P.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); + }); + return p.current && S.observe(p.current), () => { + p.current && S.unobserve(p.current); + }; + }, []); + const k = U(() => { + if (!(f != null && f.width) || !(r != null && r.length)) return r; + const S = (s ? s.columnWidth ?? 32 : 0) + (i ? o : 0), P = r.reduce((T, N) => T + (N != null && N.isWidthFixed && N.width ? N.width : 0), 0), F = r.filter((T) => !(T != null && T.isWidthFixed)).reduce((T, N) => T + ((N == null ? void 0 : N.width) ?? 100), 0); + if (P + F + S >= f.width) return r; + const A = f.width - P - S; + return r.map((T) => T != null && T.isWidthFixed ? T : { ...T, width: Math.floor(A * ((T == null ? void 0 : T.width) ?? 100) / F) }); + }, [r, f.width, s, i, o]), b = oi(k), E = ai(a); + return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: f.height ? h(br, { bordered: !0, ...l, components: E, ref: u, rowKey: (S) => (S == null ? void 0 : S[e]) ?? Math.random(), rowSelection: s, columns: (() => { + var P, F; + const S = [...b ?? []]; + return s && S.splice((F = (P = S[0]) == null ? void 0 : P.key) != null && F.startsWith("__") ? 1 : 0, 0, br.SELECTION_COLUMN), i && S.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / f.width * 100).toFixed(2)}%`, render: (A, T, N) => i(T, N) }), S; + })(), dataSource: n, size: "middle", scroll: { x: "max-content", y: f.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: m } }) : null }); +}, bi = "RC_FORM_INTERNAL_HOOKS", Ci = (t) => { + const [e, r] = x.useState({ items: [] }); + return W(() => { + t && z.get(`/api/_/${t}`).then(({ uuid: n, code: i, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, fields: m, theme: g, themeSetting: f, groups: y }) => ({ uuid: n, code: i, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: f, groups: y, items: m })).then(r); + }, [t]), e; +}, Si = (t, { initialValue: e, initialValueLanguage: r, convertJs: n, convertJsSetting: i, type: o = "string" }, a = null) => { + const s = H(!1), l = pe(jr), [c, u] = L(), [p, m] = L(r != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks(bi) || {}; + return W(() => g == null ? void 0 : g((f, y, k) => { + if (!s.current) return; + const b = w.get(y, t); + w.isEqual(b, p) || m(ue(b, o)); + }), [p]), W(() => { + r == "javascript" && e ? Ie.exec(e, {}, { getFieldValueForBasicForm: (f) => a ? a.getFieldValue(f) : l.getFieldValue(f), getFieldValue: (f) => l.getFieldValue(f) }).then((f) => m(ue(f, o))).catch((f) => notification.error({ message: `布局数据错误: ${JSON.stringify(f)}` })).finally(() => s.current = !0) : (e && m(ue(e ?? l.getFieldValue(t), o)), s.current = !0); + }, [e, r]), gt(() => { + s.current && n && new Ct([n, i]).toValue(p, l.getFieldsValue(!0)).then(u).catch((f) => { + u(f), console.error("布局数据转换错误: ", f, n); + }); + }, [p, n, i]), [c ?? p, p]; +}, Fo = (t, e, r = null) => U(() => er(t, e, r), [t]), Gr = (t, e, r = {}, n = {}, i = {}, o = null) => { + const a = pe(jr), s = vt(), l = H(!0), c = H([]), [u, p] = L(e), [m, g] = L(), f = oe.useWatch((y) => JSON.stringify(w.pick(y, c.current)), a) || "{}"; + return Nt(() => { + t && Ie.exec(t, r, { ...n, getFieldValueForBasicForm: (y) => i ? i.getFieldValue(y) : null, getFieldValue: w.wrap(a.getFieldValue, (y, k) => (c.current.some((b) => w.isEqual(b, k)) || (c.current.push(k), s()), y == null ? void 0 : y(k))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((y) => { + l.current && (p(y), g(null)); + }).catch((y) => { + l.current && (p(e), g(y)); + }); + }, [t, f, a, r, n]), W(() => () => l.current = !1, []), t ? [o ? ue(u, o) : u, m] : [o ? ue(e, o) : e, null]; +}, ki = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: r, ...n }) => { + const i = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = L(); + return W(() => { + i && ae.getWidgetComponent(i).then(({ defaultProps: s = {}, default: l }) => ({ default: xi(l, s, r) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, n))); + }, [i]), o; +}, xi = (t, e = {}, r = null) => (n) => { + const { code: i, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = w.merge({}, e, n), [f, y] = Si(s ? null : i, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, r), k = U(() => { + const S = Object.keys((e == null ? void 0 : e.extras) || {}); + return w.over([w.partialRight(w.pick, S), w.partialRight(w.omit, S)]); + }, [e == null ? void 0 : e.extras]), [b, E] = k(g); + return h(t, { ...E, value: f, rawValue: y, $setting: Object.assign({}, a, b) }); +}, Yr = ({ theme: t, basicForm: e, items: r = [{ key: "default", label: "默认" }], fields: n = [], itemRender: i, chunks: o = [], children: a, $setting: s = {}, ...l }) => { + const [c, u] = L(); + W(() => { + t ? ae.getWidgetComponent(t).then((m) => { + if (!(m != null && m.default)) throw "not found"; + return m; + }).catch((m) => ({ default: () => `${t} ${m}` })).then((m) => u(x.createElement(m.default, {}))) : u(null); + }, [t]); + const p = U(() => r == null ? void 0 : r.map((m) => ({ ...m, children: i(m, n == null ? void 0 : n.filter((g) => !(g != null && g.group) && m.key == "default" || g.group == m.key), m.key == "default" ? a : null) })).concat(o), [r, a, o]); + return c && x.cloneElement(c, { items: p, basicForm: e, $setting: { ...s, ...l } }); +}, Xr = ({ name: t, form: e = null, basicForm: r = null, style: n = {}, className: i, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: f = {}, groups: y = [{ key: "default", label: "默认" }], children: k, ...b }) => { + const [E] = oe.useForm(e), S = U(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); + gt(() => (E.setFieldsValue(m), () => E.resetFields()), [m]); + const P = (F, A, T) => { + const N = er(A, ki, r), D = _r(b); + return I("div", { ...D, className: j("ff-grid-layout", i), 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: [N, T && x.cloneElement(T, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: A, basicForm: r })] }); + }; + return h(oe, { ...b, fields: S, form: E, component: !1, children: g ? h(Yr, { ...f, items: y, theme: g, itemRender: P, fields: p, children: k, basicForm: r }) : P(0, p, k) }); +}, jo = /* @__PURE__ */ ((t) => function({ code: e, data: r, ...n }) { + const { uuid: i, resource: o, items: a, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: m, themeProps: g, groups: f } = Ci(e) || {}, y = U(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: i }], [e, i, o]); + return o && h(t, { name: e, theme: m, themeProps: g, groups: f, ...n, fields: a, formFields: y, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: r } : r }); +})(Xr), Ei = ({ column: t = 0, colWidth: e = 0, cols: r, rowHeight: n, itemMargin: i, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = (P, F, A) => P, empty: g = h(zt, { description: null }), className: f, style: y = {}, theme: k, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: S }) => { + const { classNames: P } = pe(se), F = J((N) => { + if (!S) return; + const { selectedRowKeys: D = [], onChange: $, type: V = "checkbox" } = S, M = N == null ? void 0 : N[s]; + let B; + B = V === "radio" ? [M] : D.includes(M) ? D.filter((X) => X !== M) : [...D, M], $ == null || $(B, l.filter((X) => B.includes(X == null ? void 0 : X[s]))); + }, [S, s, l]), A = U(() => h(Xr, { groups: E, theme: k, themeProps: b, cols: r, rowHeight: n, itemMargin: i, containerPadding: o, fields: a, className: p }), [a, r, n, i, o, E, k, b]), T = w.isEmpty(l); + return I("div", { className: j("ff-data-list-content", P.content, f), style: Object.assign({}, y, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), T ? g : l.map((N, D) => { + var B; + const $ = (N == null ? void 0 : N[s]) ?? D, V = `${$}-${Ti(N)}`, M = m(x.cloneElement(A, { data: N }), N, D); + return x.cloneElement(M, { key: V, ...S && { isSelected: (B = S == null ? void 0 : S.selectedRowKeys) == null ? void 0 : B.includes($), selectionType: S.type ?? "checkbox", onSelect: () => F(N) } }); + }), u == null ? void 0 : u(l)] }); +}, Pi = ({ component: t, $props: e }) => { + const { base62params: r } = $t(e, {}); + return h(re, { children: h(tr, { listCode: t, base62params: z.decode(r) }) }); +}, Ao = () => h(Qr, {}), Qr = () => "Empty", $i = ({ component: t, $setting: e, $props: r }) => { + const [n, i] = L(), [o, a] = nn(r); + return W(() => { + if (!t) return i(h(Qr, { description: null })); + ae.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => x.createElement(s.default, { $setting: e })).then(i); + }, [t]), n ? x.cloneElement(n, { ...o, $setProps: a }) : null; +}, Io = () => "NotFoundPage"; +var Fe, de, je, be, it, ot; +const ye = class ye { + constructor() { + v(this, de, /* @__PURE__ */ new Map()); + v(this, je, {}); + v(this, be, null); + O(this, "init", (e, r) => { + q(this, de, e), q(this, je, r); + }); + O(this, "get", (e) => (d(this, de).has(e) || (e = Array.from(d(this, de).keys()).find((r) => d(this, de).get(r).uri === e)), d(this, de).get(e) || {})); + O(this, "redirect", (e, r, n = {}) => { + var f; + const { uri: i, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...c } = r || {}, u = Object.assign({}, c, s), p = Object.assign({}, c, l); + o == "list" && (u.base62params = z.encode(u != null && u.base62params ? u.base62params : u)); + let m = Jn(i || e, u); + const g = new URLSearchParams(); + for (const y in a || {}) ((f = a[y]) == null ? void 0 : f.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) : d(this, be).navigate(m, { replace: !!(n != null && n.isReplaceRouteHistory) }); + }); + O(this, "getMenus", (e) => { + var r; + return ((r = d(this, je)) == null ? void 0 : r[e]) || []; + }); + O(this, "findMenuPathByUuid", (e) => { + let r = []; + for (const n in d(this, je)) if (r = d(this, it).call(this, d(this, je)[n], e, [n]), r.length > 1) return r; + return r; + }); + O(this, "getMenusByRouteUuid", (e) => d(this, ot).call(this, e, Object.values(d(this, je)).flat())); + v(this, it, (e, r, n = []) => { + if (w.isEmpty(e)) return n; + for (const { uuid: i, children: o } of e) { + if (i == r) return n.concat(i); + if (!w.isEmpty(o)) return n.concat(i, d(this, it).call(this, o, r)); + } + return n; + }); + v(this, ot, (e, r) => { + var i; + let n = []; + for (const o of r) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? n.push(o) : (i = o.children) != null && i.length && (n = n.concat(d(this, ot).call(this, e, o.children)))); + return n; + }); + O(this, "getCurrentMenu", () => { + const { uuid: e } = this.getCurrentRoute() || {}; + if (!e) return; + const r = this.getMenusByRouteUuid(e); + return w.isEmpty(r) ? void 0 : r[0]; + }); + O(this, "getCurrentRoute", (e = 0) => { + var n; + const r = (n = d(this, be).state.matches[d(this, be).state.matches.length - 1 - e]) == null ? void 0 : n.route; + if (!r) return null; + for (let [i, o] of d(this, de)) if (o.uri === r.path) return o; + return null; + }); + O(this, "getPageParams", (e) => { + var a, s; + const { location: r = {}, matches: n = [] } = ((a = d(this, be)) == null ? void 0 : a.state) || {}, i = { ...((s = n[n.length - 1]) == null ? void 0 : s.params) || {} }, o = r.search; + return o && new URLSearchParams(o).forEach((l, c) => { + i[c] = l; + }), e ? w.get(i, e) : i; + }); + O(this, "usePageParams", (e) => { + var n; + let r = Ir() ? { ...Gn(), ...Object.fromEntries(new URLSearchParams(((n = Yn()) == null ? void 0 : n.search) ?? "")) } : this.getPageParams(); + return e ? w.get(r, e) : r; + }); + O(this, "createBrowserRouter", (e = {}) => { + if (d(this, de).size == 0) return null; + if (d(this, be)) return d(this, be); + const r = Ue.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), n = Ue.get(ae.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), i = { [r]: 0 }, o = (s, l) => () => Promise.all([ae.getWidgetComponent(s), $t(l)]).then(([c, u]) => [c.default || function() { + return `${s}`; + }, u]).then(([c, u]) => ({ Component: () => x.createElement(Vr, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, de).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: f, isLogin: y, isLayout: k, extra: b }) => { + let E = {}, S = 0; + switch (p) { + case "list": + E.element = x.createElement(Pi, { component: m, $props: f }); + break; + case "fsdpf-component": + E.element = x.createElement($i, { key: c, component: m, $setting: g, $props: f }); + } + const P = (b == null ? void 0 : b.theme) ?? (b == null ? void 0 : b.layout); + if (P) { + const F = (b == null ? void 0 : b.themeProps) ?? (b == null ? void 0 : b.layoutProps); + if (!i[P]) return i[P] = s.length, [...s, { path: "/", lazy: o(P, F), children: [{ path: c, ...E }] }]; + S = i[P]; + } + return k && S > -1 ? (s[S].children.push({ path: c, ...E }), s) : [...s, { path: c, ...E }]; + }, [{ path: "/", lazy: o(r, {}), children: [] }]); + return a.push({ index: !0, element: x.createElement(vi, { to: n, replace: !0 }) }), q(this, be, Xn(a, e)); + }); + if (d(ye, Fe)) return d(ye, Fe); + } +}; +Fe = new WeakMap(), de = new WeakMap(), je = new WeakMap(), be = new WeakMap(), it = new WeakMap(), ot = new WeakMap(), v(ye, Fe, null), O(ye, "getInstance", () => (d(ye, Fe) || q(ye, Fe, new ye()), d(ye, Fe))); +let qt = ye; +const vi = ({ to: t, replace: e }) => Ir() ? x.createElement(Qn, { to: t, replace: e }) : (window.document.location = t, "redirect"), ie = qt.getInstance(); +Qe.chainableTypes = [In]; +const Ie = Qe.getInstance(new URL("/ff-worker-pipe/worker.js", self.location), { type: "module" }); +Qe.fns = { getConfigure: (t) => Ue.get(t), route: { redirect: (...t) => ie.redirect(...t), getPageParams: (...t) => ie.getPageParams(...t), getCurrentRoute: () => ie.getCurrentRoute() }, popup: { notification: (...t) => te.notification(...t), success: (...t) => te.success(...t), error: (...t) => te.error(...t), form: (...t) => te.form(...t), modal: (...t) => te.modal(...t), confirm: (...t) => te.confirm(...t) } }, Promise.resolve().then(() => oo).then((t) => { + Qe.fns.http = t.http, Qe.fns.generateUUID = () => t.generateUUID(); +}); +const Er = { null2json: (t) => Object.create(), null2array: (t) => [], null2number: (t) => 0, null2bool: (t) => !1, null2string: (t) => "", null2integer: (t) => 0, null2float: (t) => 0, string2json: (t) => t ? JSON.parse(t) : "{}", string2array: (t) => t.substr(0, 1) === "[" && t.substr(-1) === "]" ? JSON.parse(t) : t.split(","), string2number: (t) => t == "" ? 0 : +t, string2integer: (t) => t == "" ? 0 : +t, string2float: (t) => t == "" ? 0 : +t, string2bool: (t) => { + switch (`${t}`.toLowerCase()) { + case "0": + case "false": + case "[]": + case "{}": + return !1; + } + return !!t; +}, string2string: (t) => t, json2json: (t) => t, json2array: (t) => t ? Object.values(t) : [], json2number: (t) => Object.keys(t).length, json2integer: (t) => Object.keys(t).length, json2float: (t) => Object.keys(t).length, json2bool: (t) => Object.keys(t).length > 0, json2string: (t) => t ? JSON.stringify(t) : "", array2json: (t) => ({ ...t }), array2array: (t) => t, array2number: (t) => t.length, array2integer: (t) => t.length, array2float: (t) => t.length, array2bool: (t) => t.length > 0, array2string: (t) => JSON.stringify(t), number2json: (t) => ({}), number2array: (t) => [t], number2number: (t) => t, number2integer: (t) => t, number2float: (t) => t, number2bool: (t) => !!t, number2string: (t) => t.toString(), boolean2json: (t) => ({}), boolean2array: (t) => [], boolean2number: (t) => +t, boolean2integer: (t) => +t, boolean2float: (t) => +t, boolean2bool: (t) => t, boolean2string: (t) => t ? "true" : "false" }, ue = (t, e) => { + let r = "string"; + r = Array.isArray(t) ? "array" : typeof t, w.isObject(t) && (r = "json"); + const n = `${r}2${e}`; + return Reflect.has(Er, n) ? Er[n](t) : t; +}, Ni = (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, $t = (t = {}, e = {}, r = {}, n = "") => Zr(t, (i, o) => o === "type" && i === "code") ? en(t, e, r, n) : tn(t, e, n), Zr = (t, e = () => !1) => w.some(t, (r) => !!w.some(r, e) || (w.isEmpty(r) || !w.isPlainObject(r) && !w.isArray(r) ? void 0 : Zr(r, e))), en = async (t = {}, e = {}, r = {}, n = "") => { + let i = /* @__PURE__ */ Object.create(null); + for (let o in t) { + let a; + if (Reflect.has(t[o], "type") && ["code", "field", "router", "query", "string"].includes(t[o].type)) { + const { type: s, value: l = "", default: c = n } = t[o]; + switch (s) { + case "code": + try { + a = await Ie.exec(l, e, r); + } catch (u) { + console.error("getWidgetPropsData", u); + } + break; + case "field": + a = w.get(e, l) ?? w.get(e, l.substring(l.indexOf(".") + 1)); + break; + case "router": + case "query": + a = ie.getPageParams(l); + break; + case "string": + a = l; + } + a ?? (a = c); + } else a = await en(t[o], e, r, n); + w.set(i, o, a); + } + return i; +}, tn = (t = {}, e = {}, r = "") => Object.keys(t || {}).reduce((n, i) => { + if (w.isPlainObject(t[i])) { + let o; + if (Reflect.has(t[i], "type") && ["field", "router", "query", "string"].includes(t[i].type)) { + const { type: a, value: s = "", default: l = r } = t[i]; + switch (a) { + case "field": + o = w.get(e, s) ?? w.get(e, s.substring(s.indexOf(".") + 1)); + break; + case "router": + case "query": + o = ie.getPageParams(s); + break; + case "string": + o = s; + } + o ?? (o = l); + } else o = tn(t[i], e, r); + w.set(n, i, o); + } + return n; +}, {}), jt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((r) => jt(r, e)) : Object.keys(t).reduce((r, n) => (e[n] ? r[e[n]] = jt(t[n], e) : r[n] = jt(t[n], e), r), {}) : t, Lo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { + const e = 16 * Math.random() | 0; + return (t === "x" ? e : 3 & e | 8).toString(16); +}), Vo = (t) => { + var e, r; + return t ? (r = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : r.name : ""; +}, Do = (t) => { + var e, r; + return t ? (r = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : r.category : ""; +}, Mo = (t) => { + var e, r; + return t ? (r = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : r.owner : ""; +}, Ti = (t, e = 32, r = "auto") => { + const n = Kt(t), i = r === "auto" ? "x64" : r; + if (e === 32) return Ft.x86.hash32(n).toString(); + if (e === 128) return i === "x64" ? Ft.x64.hash128(n) : Ft.x86.hash128(n); + throw new Error("bits 只能是 32 或 128"); +}, Kt = (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(Kt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Kt(t[e])}`).join(",") + "}" : String(t), Oi = () => { + let t = 1; + const e = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new Map(); + return (...n) => n.length === 0 ? "" : n.map((i) => { + return String((o = i) === null || typeof o != "object" && typeof o != "function" ? (r.has(o) || r.set(o, t++), r.get(o)) : (e.has(o) || e.set(o, t++), e.get(o))); + var o; + }).join("::"); +}, Ri = (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; + } +}, zo = (t, e = "") => { + if (!t || typeof t != "string" || Ri(t)) return t; + let r = e; + return !r && typeof window < "u" && window.location && (r = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? r ? `${r}${t}` : t : r ? `${r}/${t}` : t; +}, Bo = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : typeof crypto < "u" && crypto.getRandomValues ? "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)) : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { + const e = 16 * Math.random() | 0; + return (t === "x" ? e : 3 & e | 8).toString(16); +}), vt = () => { + const t = H(!0), [, e] = x.useReducer((r) => r + 1, 0); + return W(() => () => t.current = !1, []), () => t.current && e(); +}, Uo = (t) => { + const [e, r] = L(t), n = H(null), i = J((o, a) => { + n.current = a, r(o); + }, []); + return W(() => { + n.current && (n.current(e), n.current = null); + }, [e]), [e, i]; +}, gt = (t = (n) => { +}, e, r = w.isEqual) => { + const n = x.useRef(); + r(e, n.current) || (n.current = w.cloneDeep(e)), x.useEffect(t, [n.current]); +}, Nt = gt, rn = (t, e = "string") => { + var r; + if (!Array.isArray(t)) return t; + for (let n = 0; n < t.length; n++) t[n].value = ue((r = t[n]) == null ? void 0 : r.value, e), t[n] && Reflect.has(t[n], "children") && (t[n].children = rn(t[n].children, e)); + return t; +}, Wo = (t, e = "json", r = "string", n, i = null) => { + const [o] = oe.useForm(n), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = H([]), c = oe.useWatch((u) => l.current.length === 0 ? null : w.pick(u, l.current), o) || null; + return W(() => { + 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), i ? i.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => { + s(ue(u, "array")); + }).catch((u) => console.error("useOptions", u)) : t && s(ue(t, "array")); + }, [t, e, c]), rn(a, r); +}, _o = (t) => { + const [e, r] = L(), n = { type: "GET" }; + if (typeof t == "string" ? n.url = t : w.isPlainObject(t) && Object.assign(n, t), !(n != null && n.url)) throw "url is required"; + const i = (o) => z.request(n, !1).resp((a) => (console.log("useSubscribeRequest", o), r(a), a)); + return gt(() => { + let o = null; + return i().then((a) => { + o = Hr.subscribe(w.throttle(i, 180, { leading: !1, trailing: !0 }), a.res); + }), () => o == null ? void 0 : o(); + }, n), e; +}, Fi = (t, e) => J((r) => { + const n = {}; + for (const [i, o] of Object.entries(r)) { + const a = t == null ? void 0 : t[i]; + if ((a == null ? void 0 : a.type) === "router" || (a == null ? void 0 : a.type) === "query") { + const s = ie.getCurrentRoute(); + s != null && s.uuid && ie.redirect(s.uuid, { ...ie.getPageParams(), [a.type]: { [a.value || i]: o } }, { isReplaceRouteHistory: !0 }); + } else n[i] = o; + } + Object.keys(n).length > 0 && e(n); +}, [t, e]), nn = (t, e = {}, r = {}, n = []) => { + const [i, o] = L({}), [a, s] = L({}), l = Fr(a), c = ie.usePageParams(); + Yt(() => { + Promise.resolve($t(t, e, r)).then(s); + }, [t, e, c, ...n]), Xt(() => { + const m = l ?? {}, g = Object.keys({ ...m, ...a }).reduce((f, y) => (m[y] !== a[y] && (f[y] = a[y]), f), {}); + Object.keys(g).length > 0 && o((f) => ({ ...f, ...g })); + }, [a]); + const u = Fi(t, (m) => { + o((g) => ({ ...g, ...m })); + }), p = U(() => Object.fromEntries(Object.entries(i).filter(([m, g]) => g !== a[m])), [i, a]); + return [i, u, p]; +}, ji = (t) => { + const [e, r] = x.useState({ items: [], hides: [] }); + return x.useEffect(() => { + t && z.get(`/api/_/${t}`).then(({ pk: n, uuid: i, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: f, theme: y, themeSetting: k, groups: b }) => ({ pk: n, uuid: i, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: y, themeProps: k, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...f.reduce((E, S) => { + var P; + return (P = S == null ? void 0 : S.field) != null && P.hidden ? E.hides.push(S == null ? void 0 : S.field) : E.items.push(S), E; + }, { items: [], hides: [] }) })).then(r); + }, [t]), e; +}, Ai = ({ max: t = 0, min: e = 0, type: r = "", message: n, pattern: i, required: o = !1, validator: a } = {}, s, l) => { + const [c, u] = L([]); + return W(() => { + const p = []; + if (o) { + 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 (r) { + case "string": + p.push({ type: r, max: t, min: e, message: n || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); + break; + case "pattern": + p.push({ type: "string", pattern: i, message: n }); + break; + case "validator": + a && p.push(({ getFieldValue: m }) => ({ validator: async (g, f) => { + const y = await Ie.exec(a, { value: f, fieldName: s }, { getFieldValue: m }); + return w.isString(y) && y ? Promise.reject(y) : w.isBoolean(y) && !y ? Promise.reject(n) : Promise.resolve(); + } })); + } + u(p); + }, [t, e, r, n, i, o, a]), c; +}, Ii = (t, e, r) => { + const [n, i] = L(null); + return W(() => { + const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = r || {}; + e && z.request({ method: a, url: w.trimEnd(`${o}/${e}`, "/") }).then((s) => { + i(s); + }); + }, [t, e, r]), n; +}, Li = (t, e, r) => J((n, i = { serialize: (o) => o, onSuccess: () => { +}, onFail: (o) => (o == null ? void 0 : o.errorFields) && te.error("请先完善表单信息", { duration: 2e3 }) }) => { + const o = n.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = r || {}; + return n.validateFields().then((l) => o ? w.pick(l, [o]) : l).then(i.serialize).then((l) => z.request({ method: s, url: w.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(i.onSuccess)).catch(i.onFail); +}, [t, e, r]), Vi = (t, e, r, n) => { + const i = Ii(e, r, n); + W(() => { + i ? t.setFieldsValue(i) : t.resetFields(); + }, [t, i]); + const o = Li(e, r, n); + return w.partial(o, t); +}, Di = (t, e, r = [], n = {}) => { + const i = H({}), o = H(), a = w.debounce(vt(), 180), s = ["disabled", "required"], l = (m, g) => { + s.includes(m) && (i.current[m] = g), a(); + }, c = U(() => ({ setDisabled: (m) => l("disabled", m), setRequired: (m) => l("required", m), getDisabled: () => i.current.disabled, getRequired: () => i.current.required }), [e]), [u, p] = Gr(e, -1, {}, c, n); + if (!p && o.current != u && (u >= 0 || !w.isEmpty(r == null ? void 0 : r[u]))) { + o.current = u; + const { widget: m, widgetPrefix: g, props: f } = r == null ? void 0 : r[u]; + t = zr(m, g), i.current = w.merge(f, w.pick(i.current, s)); + } + return [t, i.current]; +}, Pr = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), qo = ({ value: t, onChange: e }, r = null) => { + const n = H(), [i] = oe.useForm(r), o = H({}); + return Nt(() => { + w.isEqual(n.current, t) || i.setFieldsValue(t); + }, [t]), W(() => () => i.resetFields(), []), [U(() => i.__INTERNAL__ ? i : { ...i, __INTERNAL__: { itemRef: (a) => (s) => { + const l = Pr(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 = Pr(a); + return o.current[s]; + } }, [i]), (a, s) => { + n.current = s, e == null || e(s); + }]; +}, rr = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: r, subWidgets: n = [], basicForm: i, ...o }) => { + const a = zr(t, e), [s, l] = Di(a, r, n, i), [c, u] = L(); + return W(() => { + s && ae.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: Mi(m, p, i) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); + }, [s]), c && x.cloneElement(c, { ...o, ...l }); +}, Mi = (t, e = {}, r = null) => (n) => { + const { type: i, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: f, $isReserved: y, initialValue: k, initialValueLanguage: b, ...E } = w.omit(w.merge({}, e, n), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), S = Ai(Object.assign({}, m, u ? { required: !0 } : {}), o, i), P = U(() => { + const D = Object.keys((e == null ? void 0 : e.extras) || {}); + return w.over([w.partialRight(w.pick, D), w.partialRight(w.omit, D)]); + }, [e == null ? void 0 : e.extras]), [F, A] = P(E), T = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, N = J((D) => D == null ? void 0 : ue(D, i), [i]); + return h(Qt, { name: o, rules: S, initialValue: N(k), normalize: N, children: (D, $, V) => { + var M; + return h(t, { type: i, rcform: V, basicForm: r, itemProps: { validateStatus: $.errors.length > 0 ? "error" : "success", tooltip: g || null, help: $.errors.length > 0 ? $.errors.join("、") : null, required: ((M = S == null ? void 0 : S[0]) == null ? void 0 : M.required) || !1, ...T }, fieldProps: { placeholder: c, ...A, ...D }, $setting: Object.assign({}, p, F) }); + } }); +}, nr = ({ name: t, form: e = null, basicForm: r = null, style: n = {}, className: i, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: f, listenChangeFieldsFunc: y, onValuesChange: k, theme: b, themeProps: E = {}, groups: S = [{ key: "default", label: "默认" }], children: P, ...F }) => { + const [A] = oe.useForm(e), T = J(($, V) => { + k == null || k($, V), y && Array.isArray(f) && Ie.exec(y, { changedValues: $, allValues: V }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((M) => console.error("onFormValuesChange", t, M)); + }, [t, A, k, f, y]), N = U(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), D = ($, V, M) => { + const B = er(V, rr, r), X = _r(F); + return I("div", { ...X, className: j("ff-grid-layout-form", i), 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: [B, M && x.cloneElement(M, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: V, basicForm: r })] }); + }; + return I(oe, { ...F, form: A, fields: N, onValuesChange: T, children: [b ? h(Yr, { ...E, items: S, theme: b, itemRender: D, fields: c, children: P, basicForm: r }) : D(0, c, P), u == null ? void 0 : u.map(($) => { + var V; + return h(Qt, { name: $.code, children: h(zi, { form: A, basicForm: r, name: $.code, type: $.type, initialValue: $.initialValue, initialValueLanguage: (V = $.extras) == null ? void 0 : V.initialValueLanguage }) }, JSON.stringify($.code)); + })] }); +}, zi = ({ type: t, initialValue: e, initialValueLanguage: r, onChange: n, basicForm: i }) => { + const [o, a] = Gr(r == "javascript" && e, r == "javascript" ? void 0 : e, {}, {}, i); + return W(() => { + r == "javascript" ? n(ue(o, t)) : e && n(ue(e, t)); + }, [t, e, o]), null; +}; +nr.propTypes = { fields: C.array, hides: C.array }; +const Bi = /* @__PURE__ */ ((t) => ({ code: e, isPreview: r = !1, ...n }) => { + const { align: i, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: f, pk: y, uuid: k, theme: b, themeProps: E, groups: S } = ji(e), P = U(() => [{ name: "__PK__", value: y }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: k }], [y, e, k, a]); + return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: S, ...n, formFields: P, listenChangeFields: g, listenChangeFieldsFunc: f, fields: s, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); +})(nr), on = ({ $setting: t, $close: e, extras: r, code: n, primaryKey: i, ...o }) => { + const [a] = oe.useForm(), s = Vi(a, n, i, t); + return h(re, { actions: I(x.Fragment, { children: [h(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: r, children: h(Bi, { form: a, code: n, primaryKey: i, ...o }) }); +}, $r = /* @__PURE__ */ new Set(), Ht = (t = [], e = 0) => { + const r = t[e]; + if (r.length && !$r.has(r)) { + const n = document.createElement("script"); + n.setAttribute("src", r), n.setAttribute("data-namespace", r), t.length > e + 1 && (n.onload = () => { + Ht(t, e + 1); + }, n.onerror = () => { + Ht(t, e + 1); + }), $r.add(r), document.body.appendChild(n); + } +}, St = ({ className: t, type: e, style: r = {}, ...n }) => h("span", { role: "img", className: j("ff-iconfont", t), style: r, ...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: C.string, type: C.string.isRequired, style: C.object }, St.init = Ht; +const Ui = (t, e, r, n) => ie.redirect(r, e, n), Wi = (t, e = {}, r, n = {}) => { + var o; + const i = (o = n.router) == null ? void 0 : o.reduce((a, [s, l, c]) => { + const u = w.get(e, ["router", s]); + if (!u && u !== 0 && l) throw `请传入 ${c}`; + return `${a}/${u}`; + }, `/api/${r}`); + return z.del(i, e.param).msg(); +}, vr = (t, e, r, { status: { loading: n, disabled: i }, setStatus: o, listFn: a }) => { + const s = { loading: (l) => l === void 0 ? n : o((c) => ({ ...c, loading: l })), disabled: (l) => l === void 0 ? i : o((c) => ({ ...c, disabled: l })), list: a }; + return w.isFunction(r) ? r.call(null, e, s) : w.isString(r) && r ? Ie.exec(r, e, s) : null; +}, Nr = (t, e, r, n, i) => w.isString(r) && r ? ae.getWidgetComponent(r).then(({ default: o }) => te.modal(o, { ...e, $setting: n }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i)).catch((o) => { + te.error(r, { content: o.toString() }); +}) : te.modal(r, { ...e, $setting: n }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), _i = (t, e, r, n, i) => te.modal(on, { ...e, $setting: n, code: r }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), qi = (t, e, r, n, i) => te.modal(tr, { ...n, base62params: e, listCode: r }, i != null && i.title ? { ...i, title: w.template(i.title)(t) } : i), Ki = ({ widget: t, widgetType: e, widgetData: r, widgetProps: n, widgetSetting: i, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { + const l = pe(se), [c, u] = L({ leading: !0, trailing: !1 }), p = H(null), [m, g] = U(() => { + switch (e) { + case "redirect": + return [w.partialRight(Ui, t, i), null]; + case "func": + return [w.partialRight(vr, (i == null ? void 0 : i.code) ?? t, { status: c, setStatus: u, listFn: l }), null]; + case "component": + case "fsdpf-component": + return [w.partialRight(Nr, t, i, o), (y) => ({ $setting: y })]; + case "grid-layout-form": + return [w.partialRight(_i, t, i, o), (y) => ({ $setting: y })]; + case "data-list": + return [w.partialRight(qi, t, i, o), (y) => y]; + case "destroy": + return [w.partialRight(Wi, t, i, o), null]; + default: + if (or(t) || x.isValidElement(t)) return [w.partialRight(Nr, t, i, o), (y) => ({ $setting: y })]; + if (w.isFunction(t)) return [w.partialRight(vr, (i == null ? void 0 : i.code) || t, { status: c, setStatus: u }), null]; + } + return [(...y) => console.error("useButton unknown widgetType", e, ...y), null]; + }, [t, e, i, o, l.getBase62params, l.getSelectedRows]), f = w.debounce((y) => (s == null || s(y), Promise.resolve($t(n, y, { list: l })).then((k) => { + const b = m(y, { ...r, ...k }); + return b != null && b.update && g && (p.current = (E, S) => b.update(g(E), S)), b; + }).then((k) => a == null ? void 0 : a(k)).catch(console.error)), 300, { leading: !0, trailing: !1 }); + return Xt(() => { + var y; + (y = p.current) == null || y.call(p, i, o); + }, [i, o]), [f, c]; +}, an = ({ type: t, name: e, className: r, icon: n, iconPosition: i, size: o }, a = "default") => U(() => { + const s = { type: "primary", className: j("ff-button", r), iconPosition: i, size: o }; + return t === "danger" ? s.danger = !0 : t === "default" && (s.type = t), a === "link" || a === "dashed" ? (s.type = a, t === "default" && (s.className = j(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), n && (s.icon = h(St, { type: n })), e && (s.children = e), s; +}, [a, t, r, n, i]), Tt = ({ data: t, widget: e, widgetType: r = "fsdpf-component", widgetData: n, widgetProps: i, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: c, extras: u }) => { + const p = pe(se), [m, g] = L(!1), [f, y] = L("hover"), [k, b] = nn(i, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, S] = L(), { placement: P, align: F, zIndex: A, arrow: T = { pointAtCenter: !0 }, getPopupContainer: N, isPopupMountBodyContainer: D = !0, ...$ } = a || {}; + W(() => { + r == "grid-layout-form" ? S(x.createElement(on, { ...n, $setting: o, code: e })) : r == "data-list" ? S(x.createElement(tr, { base62params: t, $setting: o, listCode: e })) : w.isString(e) ? ae.getWidgetComponent(e).then(({ default: B }) => { + S(x.createElement(B, { ...n, $setting: o })); + }).catch((B) => S(B.toString())) : x.isValidElement(e) ? S(x.cloneElement(e, { ...n, $setting: o })) : (or(e) || w.isFunction(e) && ["component", "fsdpf-component"].includes(r)) && S(x.createElement(e, { ...n, $setting: o })); + }, [e, r, n]); + const V = (B, X = !1) => (g(B), !B && y("hover"), B ? l == null ? void 0 : l(k) : s == null ? void 0 : s(X)), M = (B) => { + g(!0), y("click"); + }; + return h(Wn, { zIndex: A, placement: P, onPopupClick: M, onClick: M, open: m, align: F, arrow: T, trigger: f, getPopupContainer: N || D ? void 0 : (B) => B, content: h(Hi, { ...$, extras: u, children: E && x.cloneElement(E, { ...k, $setProps: b, $close: (B) => V(!1, B) }) }), children: c, onOpenChange: V }); +}, Hi = ({ title: t, className: e, classNames: r, children: n, extras: i, width: o, height: a, ...s }) => { + const [l, c] = L({}), u = J((f, y) => c((k) => ({ ...k, [f]: y })), []), p = J((f) => c((y) => ({ ...y, [f]: void 0 })), []), m = t ? x.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = i ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, i); + return h(pt.Provider, { value: { ele: l, mount: u, unmount: p }, children: I("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [I("div", { className: j("ff-popup-header", "ff-popover-header", r == null ? void 0 : r.header), children: [m, l == null ? void 0 : l["sub-title"]] }), h("div", { className: j("ff-popup-body", "ff-popover-body", r == null ? void 0 : r.body), children: n }), I("div", { className: j("ff-popup-footer", "ff-popover-footer", r == null ? void 0 : r.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); +}; +Tt.propTypes = { widgetType: C.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; +const ht = (t) => function({ className: e, variant: r, children: n, name: i, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: f, confirm: y, widget: k = () => { +}, widgetType: b, widgetData: E, widgetProps: S, widgetSetting: P, widgetContainerProps: F, ...A }) { + const { mode: T, ...N } = F || {}, D = an({ className: e, name: i, type: a, icon: o, iconPosition: s }, r ?? t), $ = h(bt, { ...D, ...A, children: n || i }); + if (T === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(Tt, { data: p, widget: k, widgetType: b, widgetData: E, widgetProps: S, widgetSetting: P, widgetContainerProps: N, onAfterClick: c, onBeforeClick: u, children: $ }); + const V = w.isEmpty(f) || !f.enabled ? {} : f, M = w.isEmpty(y) ? { enabled: !1 } : Object.assign({ enabled: !0 }, y), [B, X] = L(!1), [xe, { disabled: _, loading: le }] = Ki({ widget: k, widgetType: b, widgetData: E, widgetProps: S, widgetSetting: P, widgetContainerProps: N }, { onAfterClick: c, onBeforeClick: u }); + return h(_n, { okText: "确定", cancelText: "取消", getPopupContainer: (K) => K, ...M, disabled: _ || g, open: B, onOpenChange: (K) => { + if (!K) return X(K); + M.enabled ? X(K) : xe(p); + }, onConfirm: (K) => { + xe(p, K); + }, onClick: (K) => { + K.stopPropagation(); + }, children: h(qn, { getPopupContainer: (K) => K, ...V, title: B ? null : V == null ? void 0 : V.title, trigger: ["hover", "click"], children: x.cloneElement($, { loading: le || m, disabled: _ || g }) }) }); +}, R = ht("default"); +R.propTypes = { type: C.oneOf(["primary", "default", "danger", ""]), size: C.oneOf(["large", "middle", "small"]), name: C.string, icon: C.string, iconPosition: C.oneOf(["start", "end"]), data: C.any, widget: C.any, widgetType: C.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: C.object, widgetProps: C.object, widgetSetting: C.object, widgetContainerProps: C.object, tooltip: C.exact({ title: C.string.isRequired, placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func }), confirm: C.exact({ title: C.string.isRequired, cancelText: C.string, okText: C.string, okType: C.oneOf(["primary", "default", "danger", ""]), placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func, arrow: C.oneOfType([C.bool, C.exact({ pointAtCenter: C.bool })]) }) }; +const Ji = ht("link"), Gi = ht("circle"), Yi = ht("round"), Xi = ht("dashed"), Tr = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: r = (g, f, y) => { +}, onBeforeClick: n = (g, f, y) => { +}, labelVariant: i = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: c = (g, f) => h(R, { ...g, data: f }, g.uuid || Vt()), widgetContainerProps: u = {}, children: p, data: m }) => { + if (w.isEmpty(t)) return p; + l ?? (l = o), s ?? (s = i); + const [g, f] = U(() => (t || []).reduce((b, E) => { + const S = e.indexOf(E.widgetType); + return S === -1 ? b[1].push(E) : b[0] ? S < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = E) : b[1].push(E) : b[0] = E, b; + }, [null, []]), [t, e]); + a ? p = a(g, m) || p : p || (p = h(bt, { ...an(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), i) })); + const y = f.map((b) => c(Object.assign({ uuid: b.uuid, type: b.type, name: b.name, widget: b.widget, widgetType: b.widgetType, widgetProps: b.widgetProps, widgetData: b.widgetData, widgetSetting: b.widgetSetting, widgetContainerProps: b.widgetContainerSetting, confirm: b.confirm, onAfterClick: w.partialRight(r, b, m), onBeforeClick: w.partialRight(n, b, m) }, { size: l, variant: s }), m)); + let k = y; + return (y == null ? void 0 : y.length) > 1 && (k = s == "link" ? h(Mt, { split: h(Kn, { type: "vertical" }), size: l, children: y }) : h(Mt.Compact, { size: l, children: y })), g ? h(Tt, { 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: k, onAfterClick: w.partialRight(r, g, m), onBeforeClick: w.partialRight(n, g, m), children: p }) : k; +}; +Tr.propTypes = { triggerWeights: C.array, options: C.arrayOf(C.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: C.func, btnVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: C.func, labelSize: R.propTypes.size, onAfterClick: C.func, onBeforeClick: C.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = Ji, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = Gi, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = Yi, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = Xi, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = Tt, R.GroupPopover = Tr; +const Qi = ({ fields: t, formProps: e, $close: r }) => { + const [n] = oe.useForm(), i = U(() => [{ name: "__PROPS__", value: e }], [e]); + return h(re, { actions: I(x.Fragment, { children: [h(R, { name: "取消", widget: () => r(!1) }), h(R, { name: "确定", type: "primary", widget: () => n.validateFields(!0).then(r) })] }), children: h(oe, { fields: i, form: n, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => h(rr, { code: o, ...a }, o)) }) }); +}, Zi = ({ className: t, classNames: e, $close: r, children: n, title: i, subTitle: o, actions: a, extras: s, ...l }) => I(Zn, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [I("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(Zt, { type: "close" }) }), i, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: n }), I("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), eo = ({ className: t, classNames: e, $close: r, $event: n, children: i, title: o, subTitle: a, actions: s, extras: l, placement: c, ...u }) => { + const { style: p, rest: m } = ((f, y = ["height", "width", "style"]) => { + const k = { ...f }, b = {}; + for (const E of y) E === "style" ? Object.assign(b, k.style) : k[E] !== void 0 && (b[E] = k[E]), delete k[E]; + return { style: b, rest: k }; + })(u), g = (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(ei, { ...m, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => I(x.Fragment, { children: [h("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: m.onClose, children: h(Zt, { type: "close" }) }), I("div", { className: j("ff-modal-content"), style: p, children: [I("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [o, a] }), h("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] })] }) }); +}, sn = ({ placement: t, $close: e, $event: r, children: n, title: i, ...o }) => { + const [a, s] = L({}), [l, c] = L(!0), u = J((f, y) => s((k) => ({ ...k, [f]: y })), []), p = J((f) => s((y) => ({ ...y, [f]: void 0 })), []); + let m = { ...o, className: a.rootClassName, title: a.title || i && x.createElement("div", { className: j("ff-popup-title") }, i), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: n, $close: e, $event: r, onClose: () => c(!1) }; + const g = () => { + e(!1); + }; + return h(pt.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? h(Zi, { ...m, placement: t, open: l, afterOpenChange: (f) => !f && g() }) : h(eo, { ...m, visible: l, afterClose: g }) }); +}; +sn.propTypes = { placement: C.oneOf(["center", "left", "top", "right", "bottom"]) }; +const to = ({ widget: t, widgetProps: e, $close: r, onSetProps: n }) => { + const [i, o] = L(e || {}), a = Fr(e); + Yt(() => { + const l = a ?? {}, c = e ?? {}, u = Object.keys({ ...l, ...c }).reduce((p, m) => (l[m] !== c[m] && (p[m] = c[m]), p), {}); + Object.keys(u).length > 0 && o((p) => ({ ...p, ...u })); + }, [e]); + const s = J((l) => { + o((c) => ({ ...c, ...l })), n == null || n(l); + }, [n]); + return x.isValidElement(t) ? x.cloneElement(t, { ...i, $close: r, $setProps: s }) : t != null && t.name || Cr.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === Cr.ForwardRef ? x.createElement(t, { ...i, $close: r, $setProps: s }) : t; +}, Y = () => { + const [t, e] = jn({ maxCount: 6, motion: { motionName: "ff-notification-fade", motionAppear: !0, motionEnter: !0, motionLeave: !0, onLeaveStart: (o) => { + const { offsetHeight: a } = o; + return { height: a }; + }, onLeaveActive: () => ({ height: 0, opacity: 0, margin: 0 }) }, prefixCls: "ff-notification" }), [, r] = x.useReducer((o) => o + 1, 0); + W(() => { + Y.$onClick = n, Y.$queue.forEach(([o, a, s, l]) => { + l == null || l(i([a, s], ...o)); + }), Y.$queue = []; + }, []); + const n = (o, a = {}, s = {}) => { + let l; + const c = new Promise((u, p) => { + l = i([u, p], o, a, s); + }); + return c.update = l, c; + }, i = ([o, a], s, l = {}, c = {}) => { + const u = Y.$index++, p = (f) => ((y, k) => (Y.$popups.delete(y), r(), k == null ? void 0 : k()))(u, () => o(f)); + if (s === Dr) return t.open({ ...c, key: u, content: x.createElement(s, { ...l, $close: () => t.close(u) }), onClose: () => p() }), () => { + }; + const { $setProps: m, ...g } = l; + return Y.$popups.set(u, { widget: s, widgetProps: g, widgetContainerProps: c, $close: p, onSetProps: m }), r(), (f, y) => { + const k = Y.$popups.get(u); + k && (Y.$popups.set(u, { ...k, widgetProps: f ? { ...k.widgetProps, ...f } : k.widgetProps, widgetContainerProps: y ? { ...k.widgetContainerProps, ...y } : k.widgetContainerProps }), r()); + }; + }; + return I(x.Fragment, { children: [Array.from(Y.$popups).map(([o, { widget: a, widgetProps: s, widgetContainerProps: l, $close: c, onSetProps: u }]) => h(sn, { maskClosable: !1, $event: s == null ? void 0 : s.$event, ...l, $close: c, children: h(to, { widget: a, widgetProps: s, $close: c, onSetProps: u }) }, o)), e] }); +}; +Y.$popups = /* @__PURE__ */ new Map(), Y.$index = 0, Y.$queue = [], Y.$onClick = (...t) => { + const e = new Promise((r, n) => { + Y.$queue.push([t, r, n, (i) => { + e.update = i; + }]); + }); + return e; +}; +const Or = (t, e, r = {}) => Y.$onClick(t, e, r), At = (t, { showProgress: e, duration: r, ...n } = { duration: 1.5 }) => Y.$onClick(Dr, { content: t, ...n }, { showProgress: e, duration: r }), te = { modal: Or, confirm: (t, e = {}) => Y.$onClick(ti, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, r = {}) => Or(Qi, { formProps: r, fields: t }, { placement: "center", ...e }).then((n) => { + if (n === !1) throw !1; + return n; +}), notification: At, success: (t, e = { duration: 1.5 }) => At(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => At(t, { ...e, className: "ff-notification-error", icon: "close" }) }; +Xe.configure({ showSpinner: !1 }); +const ln = () => { + const t = window.localStorage.getItem(wt); + 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, ln()), Xe.inc(), t), (t) => (Xe.done(), Promise.reject({ code: -1, msg: t }))), Ve.interceptors.response.use(({ data: t, headers: e }) => (Xe.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { + return Xe.done(), Promise.reject(t.message); +}), window.addEventListener("unhandledrejection", Dt.onUnhandledRejection), Dt.onMsg = (t, e) => te[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && ie.redirect(Ue.get("Common.WEBSITE_LOGIN_PAGE"))); +var He, Be, Je; +const Z = class Z { + constructor() { + O(this, "appUrl", ""); + v(this, He, null); + return d(Z, Be) || (q(Z, Je, new Dt()), q(Z, Be, new Proxy(this, { get(e, r) { + if (r in e) { + const n = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), r); + return n != null && n.get ? Reflect.get(e, r, e) : typeof e[r] == "function" ? e[r].bind(e) : e[r]; + } + return d(Z, Je)[r]; + } }))), d(Z, Be); + } + init(e, r, n) { + Ve.defaults.baseURL = this.appUrl = n, Ve.defaults.timeout = 15e3, d(Z, Je).init(e, r, Ve); + } + get driver() { + return Ve; + } + get headers() { + return ln(); + } + mock(e = {}) { + return d(this, He) ?? q(this, He, new Ln(Ve, { onNoMatch: "passthrough", ...e })); + } + unmock() { + var e; + (e = d(this, He)) == null || e.restore(), q(this, He, null); + } +}; +He = new WeakMap(), Be = new WeakMap(), Je = new WeakMap(), v(Z, Be), v(Z, Je), O(Z, "getInstance", () => d(Z, Be) ?? q(Z, Be, new Z())); +let Jt = Z; +const z = Jt.getInstance(); +class ir extends Error { + constructor(e, r) { + super(r), Error.captureStackTrace && Error.captureStackTrace(this, ir), !r instanceof Ze && (this.name = `${e} Error Runtime`); + } +} +class Ze extends Error { + constructor(e, ...r) { + super(...r), Error.captureStackTrace && Error.captureStackTrace(this, Ze), this.name = `${e} Not Found`; + } +} +const It = "mine", wt = "token", Lt = "user-login-intended-url"; +var Ae, Ge, at; +const we = class we { + constructor() { + v(this, Ge, /* @__PURE__ */ new Map()); + v(this, at, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)); + O(this, "setPkgVersion", (e) => { + q(this, at, e); + }); + O(this, "setVendor", (e, r) => d(this, Ge).set(e, new Lr(r, async (n, i) => { + var a, s; + if (!(n != null && n.default)) throw "@pkg not found"; + let o = () => i; + switch ("function") { + case typeof (o = (a = n.default) == null ? void 0 : a[`./${i}/index.jsx`]): + case typeof (o = (s = n.default) == null ? void 0 : s[`./${i}/index.js`]): + return o(); + } + throw new Ze(i); + }))); + O(this, "getWidgetComponent", async (e) => { + if (!e) throw "getWidgetComponent widget is required"; + if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); + const [, r] = e == null ? void 0 : e.split("@pkg/"); + if (!r) throw new Ze(e); + try { + return d(this, Ge).has("pkg") ? await d(this, Ge).get("pkg").get(r) : await import(`${z.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, at)}`); + } catch (n) { + throw new ir(e, n); + } + }); + O(this, "getRoutes", () => z.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: r, ...n }) => [r, { uuid: r, ...n }])).then((e) => new Map(e))); + O(this, "getMenus", () => z.get("/api/my-menu")); + O(this, "getConfigure", () => z.get("api/init-configure")); + O(this, "getWidgetOperationAuth", () => z.get("/api/init-widget-operation-auth").then((e) => e.reduce((r, { uuid: n, auth: i }) => [...r, [n, i]], []))); + O(this, "getPhoneNumber", (e) => z.get(`/api/user-wx-phone-number/${e}`)); + O(this, "getUserToken", () => { + const e = window.localStorage.getItem(wt); + if (!e) return ""; + const r = e.split("."); + if (!Array.isArray(r) || r.length !== 3) throw "登录令牌无效!"; + const { iat: n } = JSON.parse(window.atob(r[1])); + if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - n > 2592e3) throw "登录令牌已过期, 请重新登录!"; + return e; + }); + O(this, "checkUserToken", () => { + try { + return !!this.getUserToken(); + } catch { + return !1; + } + }); + O(this, "getUserInfo", (e = !0) => { + var r; + try { + const n = this.getUserToken(); + if (!n) return Promise.resolve(null); + const { iat: i } = JSON.parse(window.atob((r = n == null ? void 0 : n.split(".")) == null ? void 0 : r[1])), { iat: o, ...a } = z.decode(window.localStorage.getItem(It) || "", {}); + return o === i ? Promise.resolve(a) : z.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(It, z.encode({ ...s, iat: i })), s)).catch((s) => (console.error(s), e && te.error("请登录").then(this.logout), null)); + } catch (n) { + console.error(n), e && te.error("请登录").then(this.logout); + } + return Promise.resolve(null); + }); + O(this, "login", (e, r, n = {}) => z.post("/api/user-token", { username: e, passwd: Vn.hash(r), platform: "web", ...n }).then(({ token: i }) => (window.localStorage.setItem(wt, i), i)).then(async (i) => (await this.initAppEnv(), i))); + O(this, "setLoginIntendedUrl", (e) => sessionStorage.setItem(Lt, e)); + O(this, "getLoginIntendedUrl", (e = !1) => { + const r = sessionStorage.getItem(Lt); + return e && sessionStorage.removeItem(Lt), r; + }); + O(this, "logout", (e) => (window.localStorage.removeItem(It), window.localStorage.removeItem(wt), e == null ? void 0 : e())); + O(this, "initAppEnv", async () => { + const [e, r, n, i] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); + return Mr.init(e), Ue.init(i), ie.init(r, n), St.init(Ue.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: r, menus: n, configures: i }; + }); + if (d(we, Ae)) return d(we, Ae); + } +}; +Ae = new WeakMap(), Ge = new WeakMap(), at = new WeakMap(), v(we, Ae, null), O(we, "getInstance", () => (d(we, Ae) || q(we, Ae, new we()), d(we, Ae))); +let Gt = we; +const ae = Gt.getInstance(), ro = x.createContext({ user: {}, initUser: () => { +}, initUserComplete: !1 }), no = x.createContext({ set: () => { +}, get: () => { +}, assign: () => { +}, currentRoute: () => { +} }), or = (t) => { + if (!t) return !1; + if (t.prototype instanceof x.Component || t.$$typeof) return !0; + if (typeof t == "function") { + const e = t.displayName || t.name; + return !e || /^[A-Z]/.test(e); + } + return !1; +}, io = (t, e) => { + if (!t || typeof window > "u") return; + let r = document.querySelector(`style[ff-style-token="${e}"]`); + return r ? (r.innerHTML = t, t) : (r = document.createElement("style"), r.setAttribute("ff-style-token", e), r.setAttribute("type", "text/css"), r.innerHTML = t, document.head.appendChild(r), t); +}, oo = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: ro, AppGlobalParamsContext: no, cache: Lr, configure: Ue, default: ae, func: Ie, http: z, insertStyle: io, isReactComponent: or, route: ie }, Symbol.toStringTag, { value: "Module" })); +var $e, Ye, ve, Ce, Se, ne, ee, G, ke, st, lt, ct, dt, Pt, ut; +const ar = class ar { + constructor(e, r = "/") { + v(this, $e, "/"); + v(this, Ye, /* @__PURE__ */ new Set()); + v(this, ve, (e) => { + for (const r of d(this, Ye)) try { + r(e); + } catch (n) { + console.error("Error in VirtualFS event listener:", n); + } + }); + v(this, Ce, (e) => { + const r = Date.now(); + if (e && (e.lastModified = r), d(this, $e) != "/") { + const n = d(this, G).call(this, d(this, $e)); + n && (n.lastModified = r); + } + this.root.lastModified = r; + }); + v(this, Se, (e) => { + let r = ge.normalize(e); + return r.startsWith("/") || (r = "/" + r), r.length > 1 && r.endsWith("/") && (r = r.slice(0, -1)), r; + }); + v(this, ne, (e) => { + const r = ge.join(d(this, $e), e); + return d(this, Se).call(this, r); + }); + v(this, ee, (e) => { + if (!e || typeof e != "string") return !1; + const r = d(this, Se).call(this, e); + return !r.includes("..") && r.startsWith("/"); + }); + v(this, G, (e) => { + var o; + const r = d(this, Se).call(this, e); + if (r === "/") return this.root; + const n = r.split("/").filter((a) => a); + let i = this.root; + for (const a of n) { + if (i.type !== "dir") return null; + const s = (o = i.children) == null ? void 0 : o.find((l) => l.name === a); + if (!s) return null; + i = s; + } + return i; + }); + v(this, ke, (e) => { + const r = d(this, Se).call(this, e), n = ge.basename(r), i = ge.dirname(r); + return { parent: d(this, G).call(this, i), name: n }; + }); + v(this, st, (e, r, n) => n === !1 ? e : n === "root" ? e.map((i) => ge.join(r, i)) : n === !0 || n === "working" ? e.map((i) => ge.relative(d(this, $e), ge.join(r, i))) : e); + v(this, lt, async (e, r, n, i = "") => { + const o = [], a = d(this, G).call(this, e); + if (!a || a.type !== "dir") return o; + const s = a.children; + for (const l of s) { + const c = l.name, u = e === "/" ? `/${c}` : `${e}/${c}`, p = i ? `${i}/${c}` : c; + try { + if (l.type === "file") r(n ? p : c) && o.push(p); + else if (l.type === "dir" && n) { + const m = await d(this, lt).call(this, u, r, n, p); + o.push(...m); + } + } catch { + continue; + } + } + return o; + }); + v(this, ct, async (e, r, n, i = "") => { + const o = [], a = Array.isArray(r) ? r : [r], s = d(this, G).call(this, e); + if (!s || s.type !== "dir") return o; + if (!n) { + for (const c of a) if (d(this, dt).call(this, c)) { + const u = await d(this, Pt).call(this, e, c); + o.push(...u); + } else { + const u = ge.join(e, c), p = d(this, Se).call(this, u); + d(this, G).call(this, p) && o.push(c); + } + return o; + } + const l = s.children; + for (const c of l) { + const u = c.name, p = e === "/" ? `/${u}` : `${e}/${u}`, m = i ? `${i}/${u}` : u; + try { + if (c.type === "file") for (const g of a) { + let f = !1; + if (f = d(this, dt).call(this, g) ? d(this, ut).call(this, u, g) : u === g, f) { + o.push(m); + break; + } + } + else if (c.type === "dir") { + const g = await d(this, ct).call(this, p, r, n, m); + o.push(...g); + } + } catch { + continue; + } + } + return o; + }); + v(this, dt, (e) => /[*?[\]{}]/.test(e)); + v(this, Pt, async (e, r) => { + const n = [], i = d(this, G).call(this, e); + if (!i || i.type !== "dir") return n; + const o = i.children.map((a) => a.name); + for (const a of o) d(this, ut).call(this, a, r) && n.push(a); + return n; + }); + v(this, ut, (e, r) => { + const n = r.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (i, o) => "(" + o.split(",").join("|") + ")"); + return new RegExp(`^${n}$`).test(e); + }); + var n, i, o; + q(this, $e, r), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (n = this.root).name ?? (n.name = "/"), (i = this.root).children ?? (i.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now()))); + } + async stat(e) { + const r = d(this, ne).call(this, e); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = d(this, G).call(this, r); + 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 r = d(this, ne).call(this, e); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = d(this, G).call(this, r); + 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((i) => i.name); + } + async readFile(e) { + const r = d(this, ne).call(this, e); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = d(this, G).call(this, r); + 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, r) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: i, name: o } = d(this, ke).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); + if (i.type !== "dir") throw new Error("ENOTDIR: not a directory"); + const a = i.children.findIndex((c) => c.name === o), s = a >= 0, l = { name: o, type: "file", content: r, lastModified: Date.now() }; + s ? i.children[a] = l : i.children.push(l), d(this, Ce).call(this, i), d(this, ve).call(this, { action: s ? "update" : "create", path: n, type: "file", timestamp: Date.now() }); + } + async mkdir(e, r = {}) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { recursive: i } = r; + if (i) { + const o = n.split("/").filter((s) => s); + let a = "/"; + for (const s of o) + if (a = ge.join(a, s), !d(this, G).call(this, a)) { + const { parent: l, name: c } = d(this, ke).call(this, a); + if (l && l.type === "dir") { + const u = { name: c, type: "dir", children: [], lastModified: Date.now() }; + l.children.push(u), d(this, Ce).call(this, l), d(this, ve).call(this, { action: "create", path: d(this, Se).call(this, a), type: "dir", timestamp: Date.now() }); + } + } + } else { + const { parent: o, name: a } = d(this, ke).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), d(this, Ce).call(this, o), d(this, ve).call(this, { action: "create", path: n, type: "dir", timestamp: Date.now() }); + } + } + async unlink(e) { + const r = d(this, ne).call(this, e); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: n, name: i } = d(this, ke).call(this, r); + if (!n) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); + const o = n.children.findIndex((a) => a.name === i); + 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), d(this, Ce).call(this, n), d(this, ve).call(this, { action: "delete", path: r, type: "file", timestamp: Date.now() }); + } + async rmdir(e, r = {}) { + const n = d(this, ne).call(this, e); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + const { parent: i, name: o } = d(this, ke).call(this, n); + if (!i) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const a = i.children.findIndex((l) => l.name === o); + if (a < 0) throw new Error(`ENOENT: no such file or directory, rmdir '${e}'`); + const s = i.children[a]; + if (s.type !== "dir") throw new Error(`ENOTDIR: not a directory, rmdir '${e}'`); + if (!r.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); + i.children.splice(a, 1), d(this, Ce).call(this, i), d(this, ve).call(this, { action: "delete", path: n, type: "dir", timestamp: Date.now() }); + } + async rename(e, r) { + const n = d(this, ne).call(this, e), i = d(this, ne).call(this, r); + if (!d(this, ee).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); + if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${r}'`); + if (!d(this, G).call(this, n)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${r}'`); + const { parent: o, name: a } = d(this, ke).call(this, n), { parent: s, name: l } = d(this, ke).call(this, i); + if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${r}'`); + if (d(this, G).call(this, i)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${r}'`); + const c = o.children.findIndex((p) => p.name === a), u = { ...o.children[c], name: l, lastModified: Date.now() }; + o.children.splice(c, 1), s.children.push(u), d(this, Ce).call(this, o), o !== s && d(this, Ce).call(this, s), d(this, ve).call(this, { action: "rename", path: i, oldPath: n, type: u.type, timestamp: Date.now() }); + } + async exists(e) { + const r = d(this, ne).call(this, e); + return d(this, ee).call(this, r) ? d(this, G).call(this, r) !== null : !1; + } + getLastModified() { + return this.root.lastModified; + } + subscribe(e) { + if (typeof e != "function") throw new Error("Callback must be a function"); + return d(this, Ye).add(e), () => { + d(this, Ye).delete(e); + }; + } + getWorkingDirectory() { + return d(this, $e); + } + scope(e = "/") { + const r = d(this, Se).call(this, e); + if (!d(this, ee).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); + const n = d(this, G).call(this, r); + 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 ar(this.root, r); + } + async findFiles(e, r, n = {}) { + const i = d(this, ne).call(this, e); + if (!d(this, ee).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); + const o = d(this, G).call(this, i); + 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 r == "function") { + const c = await d(this, lt).call(this, i, r, a); + return d(this, st).call(this, c, i, s); + } + const l = await d(this, ct).call(this, i, r, a); + return d(this, st).call(this, l, i, s); + } +}; +$e = new WeakMap(), Ye = new WeakMap(), ve = new WeakMap(), Ce = new WeakMap(), Se = new WeakMap(), ne = new WeakMap(), ee = 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 Rr = ar; +const ao = async (t, e = "/", r = "") => { + try { + const n = await t.stat(e), i = e === "/" ? "/" : ge.basename(e), o = { title: i, key: r ? `${r}${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 c of a) { + const u = e === "/" ? `/${c}` : `${e}/${c}`; + try { + (await t.stat(u)).isDirectory() ? s.push(c) : l.push(c); + } catch (p) { + console.warn(`Failed to stat ${u}:`, p.message); + } + } + s.sort(), l.sort(); + for (const c of [...s, ...l]) { + const u = e === "/" ? `/${c}` : `${e}/${c}`; + try { + const p = await ao(t, u, r); + o.children.push(p); + } catch (p) { + console.warn(`Failed to process ${u}:`, p.message); + } + } + } + } + return o; + } catch { + return null; + } +}; +export { + zo as $, + ai as A, + To as B, + Oo as C, + Ct as D, + Ur as E, + Wt as F, + jo as G, + bi as H, + si as I, + li as J, + Pi as K, + $i as L, + Ao as M, + Io as N, + ue as O, + Ni as P, + $t as Q, + Hr as R, + Zr as S, + jt as T, + Lo as U, + Vo as V, + Do as W, + Mo as X, + Ti as Y, + Oi as Z, + Ri as _, + zr as a, + Bo as a0, + vt as a1, + Uo as a2, + gt as a3, + Nt as a4, + Wo as a5, + _o as a6, + Fi as a7, + nn as a8, + Bi as a9, + Lr as aA, + Ue as aB, + Ie as aC, + ie as aD, + ro as aE, + no as aF, + Rr as aG, + ao as aH, + to as aI, + nr as aa, + rr as ab, + on as ac, + ji as ad, + Ai as ae, + Ii as af, + Li as ag, + Vi as ah, + Di as ai, + qo as aj, + St as ak, + R as al, + Mr as am, + Ki as an, + re as ao, + pt as ap, + Vr as aq, + Y as ar, + te as as, + $o as at, + vo as au, + No as av, + ae as aw, + or as ax, + io as ay, + z as az, + Wr as b, + Ro as c, + _r as d, + er as e, + Jr as f, + ri as g, + Xr as h, + ki as i, + Yr as j, + Si as k, + Fo as l, + Gr as m, + Kr as n, + qr as o, + fi as p, + mi as q, + gi as r, + tr as s, + se as t, + Ci as u, + wi as v, + Ei as w, + ci as x, + ui as y, + oi as z +}; diff --git a/dist/common/main-TLNRXor8.js b/dist/common/main-TLNRXor8.js deleted file mode 100644 index 9604d30..0000000 --- a/dist/common/main-TLNRXor8.js +++ /dev/null @@ -1,1602 +0,0 @@ -var Li = Object.defineProperty; -var Sn = (t) => { - throw TypeError(t); -}; -var Mi = (t, e, n) => e in t ? Li(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n; -var v = (t, e, n) => Mi(t, typeof e != "symbol" ? e + "" : e, n), xn = (t, e, n) => e.has(t) || Sn("Cannot " + n); -var d = (t, e, n) => (xn(t, e, "read from private field"), n ? n.call(t) : e.get(t)), P = (t, e, n) => e.has(t) ? Sn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), K = (t, e, n, i) => (xn(t, e, "write to private field"), i ? i.call(t, n) : e.set(t, n), n); -var En = (t, e, n, i) => ({ - set _(r) { - K(t, e, r, n); - }, - get _() { - return d(t, e, i); - } -}); -import { jsx as h, jsxs as I } from "react/jsx-runtime"; -import x, { useEffect as U, useState as L, useCallback as G, useRef as _, useContext as ge, useMemo as z, useId as Bt, isValidElement as Vi, useLayoutEffect as Di } from "react"; -import he from "pathe"; -import C from "prop-types"; -import j from "classnames"; -import { useNotification as Wi } from "rc-notification"; -import y from "lodash"; -import { useMountedState as Bi, useDeepCompareEffect as tn, useUpdateEffect as nn, usePrevious as Wn } from "react-use"; -import ae, { Field as rn, FieldContext as Bn } from "rc-field-form"; -import { _ as $n, M as Lt, N as tt, b as De, i as zt, c as zi, S as Ui } from "./vender-hQk7ADWo.js"; -import qi from "rc-util/lib/hooks/useMergedState"; -import zn from "immutability-helper"; -import { Space as Ut, Form as Ct, Input as Ki, Button as St, Pagination as Hi, Tree as Ji, Breadcrumb as _i, Empty as qt, Table as Pn, Popover as Gi, Popconfirm as Yi, Tooltip as Xi, Divider as Qi } from "antd"; -import { useMergedState as Zi } from "rc-util"; -import { generatePath as er, useInRouterContext as Un, useParams as tr, useLocation as nr, createBrowserRouter as ir, Navigate as rr } from "react-router-dom"; -import or from "rc-drawer"; -import ar from "rc-dialog"; -import * as vn from "react-is"; -var He, it, Je, $e, We, Be; -class qn { - constructor(e, n) { - P(this, He, /* @__PURE__ */ new Map()); - P(this, it, !0); - P(this, Je, []); - P(this, $e); - P(this, We, () => d(this, $e)); - P(this, Be, () => Promise.resolve()); - v(this, "get", (...e) => new Promise((n, i) => { - const r = JSON.stringify(e); - if (d(this, He).has(r)) return n(d(this, Be).call(this, d(this, $e), ...e)); - if (d(this, $e) === void 0) d(this, Je).push([e, n, i]), d(this, it) && (K(this, it, !1), Promise.resolve(typeof d(this, We) == "function" ? d(this, We).call(this) : d(this, We)).then((o) => K(this, $e, o || null)).finally(() => { - d(this, Je).forEach(([o, a, s]) => { - try { - const l = d(this, Be).call(this, d(this, $e), ...o); - d(this, He).set(JSON.stringify(o), l), a(l); - } catch (l) { - s(l); - } - }), d(this, Je).length = 0; - })); - else { - const o = d(this, Be).call(this, d(this, $e), ...e); - d(this, He).set(r, o), n(o); - } - })); - K(this, Be, n), K(this, We, e); - } -} -He = new WeakMap(), it = new WeakMap(), Je = new WeakMap(), $e = new WeakMap(), We = new WeakMap(), Be = new WeakMap(); -const jo = () => h("div", { children: "Empty" }), mt = x.createContext({ ele: {}, mount: () => { -}, unmount: () => { -} }), ie = ({ rootClassName: t, className: e, children: n, actions: i, title: r, subTitle: o, extras: a, style: s = {} }) => { - const { mount: l, unmount: c } = x.useContext(mt); - return ie.Action({ children: i }), ie.Title({ children: r }), ie.SubTitle({ children: o }), ie.Extra({ children: a }), U(() => (l("rootClassName", t), () => c(t)), [t]), h("div", { className: j("ff-container", e), style: s, children: n }); -}, bt = (t) => ({ children: e, className: n }) => { - const { mount: i, unmount: r } = x.useContext(mt); - return U(() => (e && i(t, x.createElement("div", { key: `ff-${t}`, className: j(`ff-popup-${t}`, n) }, e)), () => r(t)), [n, e]), null; -}; -ie.Action = bt("actions"), ie.Title = bt("title"), ie.SubTitle = bt("sub-title"), ie.Extra = bt("extras"), ie.propTypes = { className: C.string, style: C.object, title: C.any, subTitle: C.any, actions: C.any, extras: C.any }; -const Ao = () => h(ie, { className: "ff-loading", children: I("div", { className: "loader", children: [I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] }), I("div", { className: "square", children: [h("span", {}), h("span", {}), h("span", {})] })] }) }), Io = () => h("div", { children: "NotFound" }), Kn = ({ children: t }) => { - const [e, n] = L({}), i = G((o, a) => n((s) => ({ ...s, [o]: a })), []), r = G((o) => n((a) => ({ ...a, [o]: void 0 })), []); - return typeof (t == null ? void 0 : t.type) == "string" ? t : h(mt.Provider, { value: { ele: e, mount: i, unmount: r }, children: x.cloneElement(t, { className: e.rootClassName, title: e.title, subTitle: e["sub-title"], actions: e.actions, extras: e.extras }) }); -}; -Kn.propTypes = { children: C.element.isRequired }; -const Nn = { 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"] }, on = ({ type: t, props: e }) => h("i", { ...e, children: h("svg", { viewBox: "0 0 1024 1024", width: "1em", height: "1em", fill: "currentColor", children: (Nn[t] || Nn.info).map((n, i) => h("path", { d: n }, i)) }) }), Hn = ({ className: t, content: e, icon: n, $close: i }) => I(x.Fragment, { children: [n && h("div", { className: j("ff-notification-icon", t), children: h(on, { type: n }) }), e] }), sr = ({}) => h(ie, { children: "Confirm" }); -var Oe, _e; -const me = class me { - constructor() { - P(this, _e, /* @__PURE__ */ new Map()); - v(this, "init", (e) => K(this, _e, new Map(e))); - v(this, "check", (e) => !d(this, _e).has(e) || d(this, _e).get(e)); - if (d(me, Oe)) return d(me, Oe); - } -}; -Oe = new WeakMap(), _e = new WeakMap(), P(me, Oe, null), v(me, "getInstance", () => (d(me, Oe) || K(me, Oe, new me()), d(me, Oe))); -let Kt = me; -const Jn = Kt.getInstance(), lr = (t, e, n = "children") => { - if (y.isEmpty(t)) return {}; - const i = y.find(t, ["value", e]); - if (!y.isEmpty(i)) return i; - const r = t.length; - for (let o = 0; o < r; o++) { - const { [n]: a } = t[o], s = lr(a, e, n); - if (!y.isEmpty(s)) return s; - } - return {}; -}, _n = (t = "Input", e = "@pkg/ff/grid-layout-forms") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`; -var Re, rt; -const fe = class fe { - constructor() { - P(this, rt, null); - v(this, "init", (e) => K(this, rt, e)); - v(this, "get", (e, n) => y.get(d(this, rt), e, n)); - if (d(fe, Re)) return d(fe, Re); - } -}; -Re = new WeakMap(), rt = new WeakMap(), P(fe, Re, null), v(fe, "getInstance", () => (d(fe, Re) || K(fe, Re, new fe()), d(fe, Re))); -let Ht = fe; -const qe = Ht.getInstance(); -var Ge, $t, ot, at, Pt; -const Te = class Te { - constructor(...e) { - P(this, ot, []); - P(this, at, (e) => { - var n; - for (let i of e) Array.isArray(i[0]) ? d(this, at).call(this, i) : d(this, ot).push(d(n = Te, $t).call(n, i[0], i[1])); - }); - v(this, "toValue", async (e, n = null) => { - const i = { getValue: () => e, getRecord: () => n }; - let r = e; - for (const o of d(this, ot)) try { - const a = await o; - if (typeof a != "function") { - console.warn("middleware is not a function, skip:", a); - continue; - } - r = await a.call(i, r); - } catch (a) { - console.error("middleware error, skip:", a); - } - return r; - }); - v(this, "toRender", (e, n, i = null) => x.createElement(d(this, Pt), { value: e, record: n }, i)); - P(this, Pt, ({ value: e, record: n, children: i }) => { - const [r, o] = L(i), a = Bi(); - return tn(() => { - o(i), this.toValue(e, n).then((s) => a() && o(s)).catch((s) => a() && o(`${s}`)); - }, [e, n]), r; - }); - d(this, at).call(this, e); - } -}; -Ge = new WeakMap(), $t = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), Pt = new WeakMap(), P(Te, Ge, null), P(Te, $t, y.memoize((e, n) => { - if (typeof e == "function") return e(n); - if (typeof e == "string") return se.getWidgetComponent(e).then((i) => { - var r; - return ((r = i.default) == null ? void 0 : r.call(i, n)) || ((o) => o); - }); - throw new TypeError("middleware must be a string or a function"); -}, (...e) => { - var n; - return d(Te, Ge) || K(Te, Ge, Lr()), d(n = Te, Ge).call(n, ...e); -})); -let xt = Te; -const le = x.createContext({ listCode: "", classNames: {}, getBase62params: (t, e) => { -}, getSelectedRows: () => [], onReload: () => { -}, onClickCallback: () => { -}, onConditionChange: () => { -}, onTabChange: () => { -}, onSiderChange: () => { -}, onKeywordChange: () => { -}, onPageChange: () => { -}, onPageSizeChange: () => { -}, reload: () => { -}, setPage: () => { -}, setPageSize: () => { -}, setTab: () => { -}, setSider: () => { -}, setKeyword: () => { -}, setCondition: () => { -} }), Tn = ({ className: t, record: e, column: n, ...i }) => { - if (n != null && n.editableByJs && (n != null && n.uuid)) { - const { formSetting: r = { primaryKey: "id" }, widgetSetting: o = {}, widgetContainerSetting: a = {} } = (n == null ? void 0 : n.editableByJsSetting) || {}; - return h(R.Popover, { widget: Gn, widgetData: { record: e, column: n }, widgetSetting: { widgetSetting: o, formSetting: r }, widgetContainerProps: { title: n != null && n.title ? `${n.title} - 编辑` : "编辑", width: 260, zIndex: 1050, arrow: !0, ...a }, children: h("td", { className: j("ff-data-list-cell-editable", t), ...i }) }); - } - return h("td", { className: t, ...i }); -}, Gn = ({ record: t, column: e, $close: n, $setting: i }) => { - const r = _(Ar(y.get(t, e == null ? void 0 : e.dataIndex))), { listCode: o, onClickCallback: a } = ge(le), [s] = ae.useForm(), { formSetting: l, widgetSetting: c } = i, { primaryKey: u = "id", help: p, validators: m } = l || {}, g = () => { - s.setFieldsValue({ value: y.get(t, e == null ? void 0 : e.dataIndex), __PROPS__: t }); - }; - return Ft(() => g(), [t, e == null ? void 0 : e.dataIndex, o]), h(ie, { actions: I(x.Fragment, { children: [h(R, { size: "small", onClick: g, children: "重置" }), I(Ut.Compact, { block: !0, children: [h(R, { size: "small", widget: n, children: "取消" }), h(R, { type: "primary", size: "small", widget: () => s.validateFields().then(({ value: w }) => { - const f = y.get(t, u.substring(u.indexOf(".") + 1)); - if (!f) throw "获取更新主键失败!"; - W.put(`/api/${o}-storeBy-${e == null ? void 0 : e.uuid}/${f}`, { value: w }).msg(() => a(2, t)).then(n); - }).catch(console.warn), children: "保存" })] })] }), children: I(ae, { form: s, children: [h(ln, { label: "", code: "value", type: r.current, widget: e == null ? void 0 : e.editableByJs, help: p, extras: c, validators: m }), h(rn, { noStyle: !0, name: ["__PROPS__"], children: () => { - } })] }) }); -}; -Gn.displayName = "DataListCellEditableContainer"; -const cr = (t) => function(e) { - return t(e, getRecord()); -}, dr = async ({ widgetByJs: t, widgetByJsSetting: e }) => { - const n = await se.getWidgetComponent(t).then((i) => i.default || ((r) => r)); - return function(i) { - return h(n, { value: i, $setting: e }); - }; -}, ur = (t, e = {}) => z(() => { - var n; - return (n = t == null ? void 0 : t.filter(Boolean)) == null ? void 0 : n.map(({ widgetByJs: i, widgetByJsSetting: r, middlewares: o, ...a }, s) => { - const l = (c) => ({ record: c, column: a }); - return o || (o = []), i && o.push([dr, { widgetByJs: i, widgetByJsSetting: r }]), o.length > 0 ? (a != null && a.render && o.push([cr, a.render]), { ...a, onCell: l, render: (c, u) => new xt(o).toRender(c, u, "-") }) : { ...a, onCell: l }; - }); -}, [t, e]), pr = (t = {}) => z(() => { - var e; - return t.body ?? (t.body = { cell: Tn }), (e = t.body).cell ?? (e.cell = Tn), t; -}, [t]), Lo = (t) => { - const [e, n] = L({}); - return U(() => { - let i = !1; - return t && W.get(`/api/_/${t}`).then((r) => y.pick(r, ["uuid", "name", "code", "resource", "marginX", "marginY", "cols", "rowHeight", "primaryKey", "columns", "itemOperations", "batchOperations", "isConditionFormLayout", "layout", "tabs", "pageSize", "layoutConfig", "selectionType"])).then((r) => !i && n(r)), () => i = !0; - }, [t]), e; -}, Mo = (t, e = {}) => { - const [n, i] = L({ dataSource: [] }); - return ft(() => { - let r = !1; - return t && W.get(`/api/${t}/${W.encode({ page: 1, ...e })}`).then((o) => !r && i(o)), () => r = !0; - }, [t, e]), n; -}, Yn = (t = [], e = /* @__PURE__ */ new Map(), n = "id", i) => { - const r = G(i ? (o) => y.get(o, n, y.get(o, [i, n])) : (o) => y.get(o, n), [n, i]); - return G((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]); -}, Jt = (t = [], e = /* @__PURE__ */ new Map(), n = [], i = "id", r) => { - const o = G(r ? (a) => y.get(a, i, y.get(a, [r, i])) : (a) => y.get(a, i), [i, r]); - return z(() => { - if (y.isEmpty(t) || !t.some(({ uuid: s }) => Jn.check(s))) return !1; - if (y.isEmpty(e) || y.isEmpty(n)) return !0; - const a = n.map((s) => o(s)); - return t.some(({ uuid: s }) => !s || !e.has(s) || e.get(s).some((l) => a.some((c) => c == l))); - }, [t, n, e, o]); -}, gr = (t, e, n = "id", i = null) => { - const r = Rt(), o = _(!1), a = _(t.dataSource), s = _(t.itemOperationsAccess); - return U(() => (a.current = t.dataSource, s.current = t.itemOperationsAccess, () => o.current = !1), [t.dataSource, t.itemOperationsAccess]), o.current && (t.dataSource = a.current, t.itemOperationsAccess = s.current), [t, (l = 0, c = null) => { - var u, p; - if (o.current = !1, l === 1) return (u = t.onReload) == null ? void 0 : u.call(t); - if (l === 2) { - const m = y.get(c, "__PARENT_ID__", ""), g = y.get(c, n, y.get(c, [i, n], "")), w = y.findIndex(a.current, ["__PARENT_ID__", m]), f = y.findIndex(w > -1 ? y.get(a.current, [w, "children"]) : a.current, [n, g]); - if (f === -1) return (p = t.onReload) == null ? void 0 : p.call(t); - Promise.all([W.get(`/api/${e}/detail/${g}`), W.post(`/api/${e}/list-operations-access`, { ids: g })]).then(([S, b]) => { - const E = y.get(a.current, w > -1 ? [w, "children", f, "children"] : [f, "children"]); - a.current = zn(a.current, w > -1 ? { [w]: { children: { $splice: [[f, 1, { ...S, children: E }]] } } } : { $splice: [[f, 1, { ...S, children: E }]] }); - const k = new Map(b); - s.current.forEach(($, F) => { - var A; - (A = k.get(F)) != null && A.some((O) => O == g) || s.current.set(F, $.filter((O) => O !== g)); - }), k.forEach(($, F) => { - s.current.has(F) ? s.current.set(F, y.uniq([...s.current.get(F) || [], ...$])) : s.current.set(F, $); - }); - }).then(() => { - o.current = !0, r(); - }); - } - }]; -}, hr = (t, e) => { - const n = Rt(), i = _(e), r = _(/* @__PURE__ */ new Map()), o = _([]), a = y.throttle((l) => { - o.current = [], W.list(t, y.pick({ ...i.current, ...l }, ["tab", "page", "pageSize", "condition", "sider", "keyword"])).then(({ keyword: c, condition: u, total: p, tab: m, sider: g, page: w, pageSize: f, operationsAccess: S, dataSource: b }) => { - i.current = { tab: m, condition: u, sider: g, keyword: c, total: p, pageSize: f, page: b != null && b.length ? w : 1 }, o.current = b, r.current = new Map(S), n(); - }); - }, 380, { leading: !1, trailing: !0 }); - Ft(() => { - o.current = [], t && a(e); - }, [t, e]); - const s = z(() => y.pick(i.current, ["total", "tab", "page", "pageSize", "condition", "sider", "keyword", "primaryKey"]), [i.current]); - return Object.assign(s, { onTabChange: (l) => a({ tab: l, page: 1 }), onPageChange: (l, c) => a({ page: l, pageSize: c }), onPageSizeChange: (l) => a({ pageSize: l, page: 1 }), onConditionChange: (l, c) => a({ keyword: c, condition: zn(i.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 }); -}, mr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, isPaginate: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, itemGridLayout: g, $setting: w, tabs: f, isConditionFormLayout: S, isTreeSider: b, treeSiderConfig: E, rowSelection: k }) => { - const { classNames: $, onClickCallback: F } = ge(le), A = y.pick(w, ["column", "colWidth", "beforeRender", "afterRender", "style", "itemMargin", "containerPadding"]), O = w == null ? void 0 : w.isMarkSelected, T = Yn(l, c, p, u), V = G((N, M, D) => h(fr, { isMarkSelected: O, className: j("ff-data-list-framework-item", $ == null ? void 0 : $.item), operations: o ? T(M) : [], data: u ? { [u]: M } : M, children: N, onClickCallback: F }), [O, u, p, o, F, l, c]); - return I("div", { className: j("ff-data-list-framework", e), children: [h(n.sider, { isTreeSider: b, ...E }), I("div", { className: j("ff-data-list-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: S }), h(n.toolbar, { title: m, tabs: f }), h(Or, { ...g, ...A, rowSelection: k, empty: h(n.empty, { className: $ == null ? void 0 : $.empty }), primaryKey: p, itemRender: V, dataSource: i }), h(n.footer, { isPaginate: r, isOperations: a, operations: s })] })] }); -}, fr = ({ className: t, operations: e, children: n, data: i, onClickCallback: r, onSelect: o, isMarkSelected: a, isSelected: s, selectionType: l }) => I("div", { className: j("data-list-grid-layout-item", { "is-mark-selected": a, "is-selected": s, "is-selectable": !!l }, t), onClick: o, children: [h("div", { className: "data-list-grid-layout-item-container", children: n }), !!(e != null && e.length) && h("div", { className: "data-list-grid-layout-item-actions", children: e.map((c) => h("span", { className: "data-list-grid-layout-item-action", children: h(R.Link, { uuid: c.uuid, type: c.type, name: c.name, widget: c.widget, widgetType: c.widgetType, widgetProps: c.widgetProps, widgetSetting: c.widgetSetting, widgetContainerProps: c.widgetContainerSetting, data: i, confirm: c.confirm, onAfterClick: (u) => u !== !1 && (r == null ? void 0 : r(c.isRefresh, i)) }, c.uuid || Bt()) }, (c == null ? void 0 : c.uuid) || Bt())) })] }), yr = ({ listCode: t, className: e, layouts: n = {}, dataSource: i, columns: r, isItemOperations: o, isBatchOperations: a, batchOperations: s, itemOperations: l, itemOperationsAccess: c, resource: u, primaryKey: p, title: m, tabs: g, isPaginate: w, rowSelection: f, isTreeSider: S, treeSiderConfig: b, isConditionFormLayout: E, ...k }) => { - const { classNames: $, onClickCallback: F } = ge(le), A = Yn(l, c, p, u), O = Jt(l, c, i, p, u); - return I("div", { className: j("ff-data-table-framework", e), children: [h(n.sider, { isTreeSider: S, ...b }), I("div", { className: j("ff-data-table-container", $ == null ? void 0 : $.container), children: [h(n.filter, { isConditionFormLayout: E }), h(n.toolbar, { title: m, tabs: g }), h(Er, { ...k, primaryKey: p, className: "ff-data-table-content", columns: r, dataSource: i, rowSelection: f, operationRender: O ? (T) => { - var V; - return h("div", { className: "ff-data-table-actions", children: (V = A(T)) == null ? void 0 : V.map((N, M) => h(R, { size: "small", uuid: N.uuid, type: N.type, name: N.name, widget: N.widget, widgetType: N.widgetType, widgetProps: N.widgetProps, widgetData: N.widgetData, widgetSetting: N.widgetSetting, widgetContainerProps: N.widgetContainerSetting, data: T, confirm: N.confirm, onAfterClick: (D) => D !== !1 && (F == null ? void 0 : F(N.isRefresh, T)) }, N.uuid || M)) }); - } : null }), h(n.footer, { isPaginate: w, isOperations: a, operations: s })] })] }); -}, an = (t = [], e, n = null) => { - var i; - return (i = y.sortBy(t, ["y", "x"])) == null ? void 0 : i.map(({ i: r, x: o, y: a, w: s, h: l, field: { boxStyle: c, ...u } = {} }, p) => h("div", { className: "grid-layout-item", style: Xn(o, a, s, l, c), children: h(e, { ...u, basicForm: n }) }, r ?? p)); -}, Xn = (t, e, n, i, r = {}, o = 0) => { - const a = { "--grid-layout-h": `${i}`, "--grid-layout-w": `${n}`, "--grid-layout-x": `${t}`, "--grid-layout-y": `${e}`, "--grid-layout-row-height-offset": "0px" }; - return r != null && r.autoHeight ? a.height = "fit-content" : a["--grid-layout-row"] = `${i}`, 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"] = On(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"] = On(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; -}, On = (t, e, n, i) => `${t || 0}px ${e || 0}px ${n || 0}px ${i || 0}px`, Vo = (t = "Text", e = "@pkg/ff/grid-layouts") => t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, Qn = (t) => Object.keys(t).reduce((e, n) => (/^on[A-Z]/.test(n) && (e[n] = t[n]), e), {}), Zn = ({ className: t, isConditionFormLayout: e }) => { - var m, g; - const [n, i] = L({}), { listCode: r, onKeywordChange: o, onConditionChange: a, getBase62params: s, classNames: l } = x.useContext(le), { keyword: c, condition: u } = (s == null ? void 0 : s()) || {}, [p] = Ct.useForm(); - return U(() => { - r && e && W.get(`/api/_/${r}/list-condition-form-layout`).then(({ resource: w, marginX: f, marginY: S, rowHeight: b, cols: E, fields: k }) => { - i({ resource: w, itemMargin: [f, S], rowHeight: b, cols: E, fields: k }); - }).catch(() => i({})); - }, [r, e]), U(() => { - p.setFieldsValue({ keyword: c, ...u }); - }, [JSON.stringify([c, u])]), h("div", { className: j("ff-data-list-filter", l.filter, t), children: h(Ct, { form: p, layout: "vertical", autoComplete: "off", onFinish: ((m = n.fields) == null ? void 0 : m.length) > 1 ? (w) => a({ [n.resource]: w[n.resource] }, w.keyword) : () => { - }, onValuesChange: (w) => { - y.isEmpty(y.omit(w, ["keyword"])) || p.submit(); - }, children: ((g = n.fields) == null ? void 0 : g.length) > 1 ? h(cn, { ...n, children: h(wr, { onReset: () => { - const { keyword: w, condition: f } = s("init") || {}; - p.setFieldsValue({ keyword: w, ...f }); - } }) }) : h("div", { className: "ff-data-list-filter-default-form ff-grid-layout-form", children: h("div", { className: "grid-layout-item", style: Xn(20, 0, 5, 2), children: h(Ct.Item, { name: ["keyword"], children: h(Ki.Search, { allowClear: !0, enterButton: "搜索", placeholder: "多关键字 | 分割", onSearch: (w) => o(w) }) }) }) }) }) }); -}, wr = ({ cols: t, fields: e, onReset: n }) => { - const [i, r] = L(!1), o = z(() => e == null ? void 0 : e.toReversed().some((a) => a.y > 1 || a.x + a.w >= t - 5), [t, e]); - return I(Ct.Item, { label: " ", style: { "--item-span": 5 }, className: j("ff-data-list-filter-actions", { expanded: i }), children: [h(St, { onClick: n, children: "重置" }), h(St, { type: "primary", htmlType: "submit", children: "查询" }), o && h(R.Link, { className: "ff-data-list-filter-expanded-button", widget: () => r((a) => !a), type: "primary", name: i ? "关闭" : "展开", icon: i ? "icon-up" : "icon-down", iconPosition: "end" })] }); -}; -Zn.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 br = ({ className: t, operations: e, isOperations: n, isPaginate: i }) => { - const { onPageChange: r, onPageSizeChange: o, onClickCallback: a, getBase62params: s } = x.useContext(le), { total: l, page: c, pageSize: u } = (s == null ? void 0 : s()) || {}; - return n && !y.isEmpty(e) || i ? I("div", { className: j("ff-data-list-footer", t), children: [h("div", { className: "ff-data-list-actions", children: e == null ? void 0 : e.map((p, m) => h(R, { uuid: p.uuid, type: p.type, name: p.name, widget: p.widget, widgetType: p.widgetType, widgetProps: p.widgetProps, widgetData: p.widgetData, widgetSetting: p.widgetSetting, widgetContainerProps: p.widgetContainerSetting, onAfterClick: (g) => g !== !1 && (a == null ? void 0 : a(p.isRefresh, null)) }, p.uuid || m)) }), i && h(Hi, { size: "small", total: l, pageSize: u, showSizeChanger: !1, showTotal: (p) => `第 ${c} 页 / 总共 ${p} 条`, onChange: r, onShowSizeChange: o })] }) : null; -}, Cr = [{ 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" }] }] }], kr = ({ className: t, width: e = 280, isTreeSider: n }) => { - const { classNames: i } = ge(le); - return n ? h(Ji.DirectoryTree, { className: j("ff-data-list-sider", i.sider, t), style: { "--sider-width": e }, showLine: !0, showIcon: !1, treeData: Cr }) : null; -}, Sr = ({ className: t, title: e, tabs: n }) => { - const { getBase62params: i, onTabChange: r, onReload: o, classNames: a } = ge(le), { tab: s } = (i == null ? void 0 : i()) || {}, [l, c] = Zi((n == null ? void 0 : n[0].value) ?? (n == null ? void 0 : n[0].code), { value: s, onChange: r }); - return I("div", { className: j("ff-data-list-toolbar", a.toolbar, t), children: [h("div", { className: "ff-data-list-title", children: e }), h(_i, { className: "ff-data-list-tabs", itemRender: ({ label: u, code: p, value: m }) => h("span", { onClick: () => c(m ?? p), className: j("ff-data-list-tab", { active: (m ?? p) == l }), children: u }), items: n }), I("div", { className: "ff-data-list-actions", children: [h(R.Link, { icon: "icon-reload", widget: () => o() }), h(R.Link, { icon: "icon-setting" })] })] }); -}, xr = ({ className: t, ...e }) => h(qt, { className: j(t, "ff-data-list-empty"), image: qt.PRESENTED_IMAGE_SIMPLE, ...e }), ei = ({ isItemGridLayout: t, theme: e, themeProps: n, onClickCallback: i, onReload: r, listCode: o, total: a = 0, page: s = 0, onPageChange: l, pageSize: c = 30, onPageSizeChange: u, tab: p, onTabChange: m, keyword: g, onKeywordChange: w, condition: f, onConditionChange: S, sider: b, onSiderChange: E, layouts: k, classNames: $ = {}, payload: F = {}, dataSource: A = [], rowSelection: O, getSelectedRows: T, primaryKey: V, ...N }) => { - const [M, D] = L(), B = T ?? (() => A), Q = G((q, ce) => { - const H = { tab: p, page: s, pageSize: c, keyword: g, sider: b, condition: f, total: a, payload: F }; - return q && q != "init" ? y.get(H, q, ce) : H; - }, [JSON.stringify(f), JSON.stringify(F), p, s, c, g, b, a]), Ee = z(() => { - let q = { sider: kr, filter: Zn, footer: br, toolbar: Sr, empty: xr }; - k === !1 ? q = { sider: null, filter: null, footer: null, toolbar: null, empty: null } : y.isPlainObject(k) && (q = Object.assign({}, q, k)); - for (const ce in q) if (q[ce]) { - if (Vi(q[ce])) { - const H = q[ce]; - q[ce] = (wt) => x.cloneElement(H, wt); - } - } else q[ce] = () => h(x.Fragment, {}); - return q; - }, [k]); - return U(() => { - e ? se.getWidgetComponent(e).then((q) => { - if (!q) throw `${e} not found`; - return q; - }).catch((q) => ({ default: () => `${q}` })).then((q) => D(x.createElement(q.default, { ...N, layouts: Ee, $setting: n }))) : D(h(t ? mr : yr, { ...N, layouts: Ee, $setting: n })); - }, [e, n]), h(le.Provider, { value: { classNames: $, listCode: o, onClickCallback: i, onReload: r, getBase62params: Q, onPageChange: l, onPageSizeChange: u, onTabChange: m, onSiderChange: E, onKeywordChange: w, onConditionChange: S, setPage: l, setPageSize: u, setTab: m, setSider: E, setKeyword: w, setCondition: S, getSelectedRows: B }, children: M && x.cloneElement(M, { dataSource: A, primaryKey: V, rowSelection: O, ...N }) }); -}; -ei.propTypes = { classNames: C.exact({ sider: C.string, filter: C.string, footer: C.string, toolbar: C.string, container: C.string, content: C.string, item: C.string, empty: C.string }), layouts: C.oneOfType([C.exact({ sider: C.oneOfType([C.elementType, C.element]), filter: C.oneOfType([C.elementType, C.element]), footer: C.oneOfType([C.elementType, C.element]), toolbar: C.oneOfType([C.elementType, C.element]), empty: C.oneOfType([C.elementType, C.element]) }), C.bool]) }; -var Fe, Pe, ze, vt; -const ye = class ye { - constructor() { - P(this, Pe, null); - P(this, ze, /* @__PURE__ */ new Map()); - P(this, vt, () => { - if (d(this, Pe)) return d(this, Pe).port.postMessage({ command: "status", data: [] }); - K(this, Pe, new SharedWorker(new URL("/ff-worker/res-ws.js", self.location))), d(this, Pe).port.onmessage = (e) => { - var n, i; - (n = e.data) != null && n.uuid ? d(this, ze).forEach((r, o) => { - var a; - (r == "*" || (a = r == null ? void 0 : r.includes) != null && a.call(r, e.data.uuid)) && o(e.data); - }) : ((i = e.data) == null ? void 0 : i.readyState) == WebSocket.CLOSED && W.get("/api/user-api-token").then(({ token: r, expire_at: o }) => { - d(this, Pe).port.postMessage({ command: "initWs", data: [`ws${y.trimStart(W.appUrl, "http")}api/user-resource-status-ws?token=${r}`] }); - }); - }, d(this, Pe).port.postMessage({ command: "status", data: [] }); - }); - v(this, "subscribe", (e, n = []) => (n ? Array.isArray(n) && n.length == 0 ? n = "*" : Array.isArray(n) || (n = [n].flat()) : n = "*", d(this, ze).set(e, n), d(this, ze).size == 1 && d(this, vt).call(this), () => this.unsubscribe(e))); - v(this, "unsubscribe", (e) => d(this, ze).delete(e)); - if (d(ye, Fe)) return d(ye, Fe); - } -}; -Fe = new WeakMap(), Pe = new WeakMap(), ze = new WeakMap(), vt = new WeakMap(), P(ye, Fe, null), v(ye, "getInstance", () => (d(ye, Fe) || K(ye, Fe, new ye()), d(ye, Fe))); -let _t = ye; -const ti = _t.getInstance(), sn = x.forwardRef(({ listCode: t, base62params: e, className: n, theme: i, themeProps: r, layouts: o, classNames: a, rowSelection: s = null, onDataSourceChange: l }, c) => { - const [{ resource: u, primaryKey: p, batchOperations: m = [], itemOperations: g = [], columns: w = [], isConditionFormLayout: f = !1, isTreeSider: S, treeSiderConfig: b, theme: E, themeConfig: k, isItemGridLayout: $, itemGridLayout: { themeConfig: F, ...A } = {}, title: O, isPaginate: T, tabs: V, selectionType: N }, M] = L({ isItemGridLayout: !1, itemGridLayout: {} }), { type: D = N, selectedRowKeys: B, defaultSelectedRowKeys: Q, onChange: Ee, ...q } = s ?? {}, ce = hr(t, e), [{ dataSource: H, itemOperationsAccess: wt, condition: fi, tab: yi, keyword: wi, page: gn, total: hn, pageSize: mn, sider: bi, onConditionChange: Ci, onTabChange: ki, onKeywordChange: Si, onPageChange: xi, onPageSizeChange: Ei, onSiderChange: $i, onReload: At, payload: Pi }, fn] = gr(ce, t, p, u), vi = $n(l); - nn(() => { - vi(H, { primaryKey: p, page: gn, pageSize: mn, total: hn }); - }, [H]); - const [yn, Ni] = qi([], { defaultValue: Q ?? [], value: B }), [wn, Ti] = L([]), bn = G(() => D ? wn : H, [D, wn, H]), Oi = Jt(g, wt, H, p), Ri = Jt(m); - U(() => { - let Z = null; - return t && W.get(`/api/_/${t}`).resp(({ data: Ve, res: It }) => { - Ve != null && Ve.isDynamicRefresh && (Z = ti.subscribe(() => At(), It)), M(Ve); - }).catch(() => M({})), () => Z == null ? void 0 : Z(); - }, [t]), x.useImperativeHandle(c, () => ({ onReload: At, onClickCallback: fn, getSelectedRows: bn })); - const Cn = $n((Z, Ve) => { - Ti((It) => { - const kn = new Map(It.map((de) => [de == null ? void 0 : de[p], de])); - return Ve.forEach((de) => kn.set(de == null ? void 0 : de[p], de)), Z.map((de) => kn.get(de)).filter(Boolean); - }), Ni(Z), Ee == null || Ee(Z, Ve); - }), Fi = z(() => D ? { columnWidth: 80, ...q, type: D, selectedRowKeys: yn, onChange: Cn } : void 0, [D, yn, Cn, s]), ji = z(() => y.merge({}, k, r), [k, r]), Ai = z(() => g == null ? void 0 : g.map((Z) => y.isEmpty(Z == null ? void 0 : Z.confirm) ? Z : { ...Z, confirm: Object.assign({}, Z.confirm, { getPopupContainer: () => document.body }) }), [g]), Ii = z(() => ({ ...A, themeProps: F }), [A, F]); - return h(ei, { listCode: t, title: O, classNames: a, layouts: o, resource: u, primaryKey: p, theme: i || E, themeProps: ji, isTreeSider: S, treeSiderConfig: b, isPaginate: T, rowSelection: Fi, getSelectedRows: bn, tabs: V, isItemOperations: Oi, itemOperations: Ai, isBatchOperations: Ri, batchOperations: m, isItemGridLayout: $, columns: w, itemGridLayout: Ii, isConditionFormLayout: f, itemOperationsAccess: wt, dataSource: H, onConditionChange: Ci, onTabChange: ki, onKeywordChange: Si, onPageChange: xi, onPageSizeChange: Ei, onSiderChange: $i, condition: fi, tab: yi, keyword: wi, page: gn, total: hn, pageSize: mn, sider: bi, payload: Pi, className: j("ff-data-list-helper", n), onReload: At, onClickCallback: fn }); -}), ni = (t, e, n = !0) => n !== !0 && n-- <= 0 ? [] : y.isArray(t) && !y.isEmpty(t) ? t.reduce((i, r) => (Reflect.has(r, e) && Reflect.has(r, "children") && i.push(r[e]), Reflect.has(r, "children") && !y.isEmpty(r.children) ? i.concat(ni(r.children, e, n)) : i), []) : [], Er = ({ className: t, primaryKey: e, columns: n = [], dataSource: i = [], operationRender: r, operationWidth: o = 180, components: a = {}, rowSelection: s, ...l }) => { - const { classNames: c } = ge(le), u = _(null), p = _(null), [m, g] = L([]), [w, f] = L({ width: 0, height: 0 }); - U(() => { - g(ni(i, e)); - }, [i, e]), Di(() => { - const k = new ResizeObserver(() => { - var $; - f({ width: (($ = u.current) == null ? void 0 : $.nativeElement.querySelector(".ant-table-body").scrollWidth) || p.current.offsetWidth, height: p.current.offsetHeight }); - }); - return p.current && k.observe(p.current), () => { - p.current && k.unobserve(p.current); - }; - }, []); - const S = z(() => { - if (!(w != null && w.width) || !(n != null && n.length)) return n; - const k = (s ? s.columnWidth ?? 32 : 0) + (r ? o : 0), $ = n.reduce((O, T) => O + (T != null && T.isWidthFixed && T.width ? T.width : 0), 0), F = n.filter((O) => !(O != null && O.isWidthFixed)).reduce((O, T) => O + ((T == null ? void 0 : T.width) ?? 100), 0); - if ($ + F + k >= w.width) return n; - const A = w.width - $ - k; - return n.map((O) => O != null && O.isWidthFixed ? O : { ...O, width: Math.floor(A * ((O == null ? void 0 : O.width) ?? 100) / F) }); - }, [n, w.width, s, r, o]), b = ur(S), E = pr(a); - return h("div", { ref: p, className: j("ff-data-list-table", c.content, t), children: w.height ? h(Pn, { bordered: !0, ...l, components: E, ref: u, rowKey: (k) => (k == null ? void 0 : k[e]) ?? Math.random(), rowSelection: s, columns: (() => { - var $, F; - const k = [...b ?? []]; - return s && k.splice((F = ($ = k[0]) == null ? void 0 : $.key) != null && F.startsWith("__") ? 1 : 0, 0, Pn.SELECTION_COLUMN), r && k.push({ title: "操作", align: "center", fixed: "right", className: "ff-data-list-table-operations", width: `${Math.ceil(o / w.width * 100).toFixed(2)}%`, render: (A, O, T) => r(O, T) }), k; - })(), dataSource: i, size: "middle", scroll: { x: "max-content", y: w.height - 50 }, pagination: !1, expandable: { defaultExpandAllRows: !0, expandRowByClick: !0, onExpandedRowsChange: g, expandedRowKeys: m } }) : null }); -}, $r = "RC_FORM_INTERNAL_HOOKS", Pr = (t) => { - const [e, n] = x.useState({ items: [] }); - return U(() => { - t && W.get(`/api/_/${t}`).then(({ uuid: i, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, fields: m, theme: g, themeSetting: w, groups: f }) => ({ uuid: i, code: r, name: o, resource: a, primaryKey: s, marginX: l, marginY: c, cols: u, rowHeight: p, theme: g, themeProps: w, groups: f, items: m })).then(n); - }, [t]), e; -}, vr = (t, { initialValue: e, initialValueLanguage: n, convertJs: i, convertJsSetting: r, type: o = "string" }, a = null) => { - const s = _(!1), l = ge(Bn), [c, u] = L(), [p, m] = L(n != "javascript" && t ? l.getFieldValue(t) : void 0), { registerWatch: g } = l.getInternalHooks($r) || {}; - return U(() => g == null ? void 0 : g((w, f, S) => { - if (!s.current) return; - const b = y.get(f, t); - y.isEqual(b, p) || m(pe(b, o)); - }), [p]), U(() => { - n == "javascript" && e ? Me.exec(e, {}, { getFieldValueForBasicForm: (w) => a ? a.getFieldValue(w) : l.getFieldValue(w), getFieldValue: (w) => l.getFieldValue(w) }).then((w) => m(pe(w, o))).catch((w) => notification.error({ message: `布局数据错误: ${JSON.stringify(w)}` })).finally(() => s.current = !0) : (e && m(pe(e ?? l.getFieldValue(t), o)), s.current = !0); - }, [e, n]), ft(() => { - s.current && i && new xt([i, r]).toValue(p, l.getFieldsValue(!0)).then(u).catch((w) => { - u(w), console.error("布局数据转换错误: ", w, i); - }); - }, [p, i, r]), [c ?? p, p]; -}, Do = (t, e, n = null) => z(() => an(t, e, n), [t]), ii = (t, e, n = {}, i = {}, r = {}, o = null) => { - const a = ge(Bn), s = Rt(), l = _(!0), c = _([]), [u, p] = L(e), [m, g] = L(), w = ae.useWatch((f) => JSON.stringify(y.pick(f, c.current)), a) || "{}"; - return Ft(() => { - t && Me.exec(t, n, { ...i, getFieldValueForBasicForm: (f) => r ? r.getFieldValue(f) : null, getFieldValue: y.wrap(a.getFieldValue, (f, S) => (c.current.some((b) => y.isEqual(b, S)) || (c.current.push(S), s()), f == null ? void 0 : f(S))), isFieldTouched: a.isFieldTouched, isFieldsTouched: a.isFieldsTouched }).then((f) => { - l.current && (p(f), g(null)); - }).catch((f) => { - l.current && (p(e), g(f)); - }); - }, [t, w, a, n, i]), U(() => () => l.current = !1, []), t ? [o ? pe(u, o) : u, m] : [o ? pe(e, o) : e, null]; -}, Nr = ({ widget: t, widgetPrefix: e = "@pkg/ff/grid-layouts", basicForm: n, ...i }) => { - const r = t != null && t.startsWith("@") || t != null && t.startsWith("blob:") ? t : `${e}/${t}`, [o, a] = L(); - return U(() => { - r && se.getWidgetComponent(r).then(({ defaultProps: s = {}, default: l }) => ({ default: Tr(l, s, n) })).catch((s) => ({ default: () => `${s}` })).then((s) => a(x.createElement(s.default, i))); - }, [r]), o; -}, Tr = (t, e = {}, n = null) => (i) => { - const { code: r, label: o, extras: a, isVirtual: s, initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, value: m, ...g } = y.merge({}, e, i), [w, f] = vr(s ? null : r, { initialValue: l, initialValueLanguage: c, convertJs: u, convertJsSetting: p, type: (g == null ? void 0 : g.type) || "string" }, n), S = z(() => { - const k = Object.keys((e == null ? void 0 : e.extras) || {}); - return y.over([y.partialRight(y.pick, k), y.partialRight(y.omit, k)]); - }, [e == null ? void 0 : e.extras]), [b, E] = S(g); - return h(t, { ...E, value: w, rawValue: f, $setting: Object.assign({}, a, b) }); -}, ri = ({ theme: t, basicForm: e, items: n = [{ key: "default", label: "默认" }], fields: i = [], itemRender: r, chunks: o = [], children: a, $setting: s = {}, ...l }) => { - const [c, u] = L(); - U(() => { - t ? se.getWidgetComponent(t).then((m) => { - if (!(m != null && m.default)) throw "not found"; - return m; - }).catch((m) => ({ default: () => `${t} ${m}` })).then((m) => u(x.createElement(m.default, {}))) : u(null); - }, [t]); - const p = z(() => n == null ? void 0 : n.map((m) => ({ ...m, children: r(m, i == null ? void 0 : i.filter((g) => !(g != null && g.group) && m.key == "default" || g.group == m.key), m.key == "default" ? a : null) })).concat(o), [n, a, o]); - return c && x.cloneElement(c, { items: p, basicForm: e, $setting: { ...s, ...l } }); -}, oi = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 12, rowHeight: a = 21, containerPadding: s = [0, 0], itemMargin: l = [4, 0], formProps: c = {}, formFields: u = [], fields: p = [], data: m, theme: g, themeProps: w = {}, groups: f = [{ key: "default", label: "默认" }], children: S, ...b }) => { - const [E] = ae.useForm(e), k = z(() => [{ name: "__PROPS__", value: c }].concat(u), [c, u]); - ft(() => (E.setFieldsValue(m), () => E.resetFields()), [m]); - const $ = (F, A, O) => { - const T = an(A, Nr, n), V = Qn(b); - return I("div", { ...V, className: j("ff-grid-layout", r), style: { ...i, "--grid-layout-item-margin-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-item-margin-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-container-padding-y": `${(s == null ? void 0 : s[0]) || 0}px`, "--grid-layout-container-padding-x": `${(s == null ? void 0 : s[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [T, O && x.cloneElement(O, { cols: o, rowHeight: a, itemMargin: l, containerPadding: s, fields: A, basicForm: n })] }); - }; - return h(ae, { ...b, fields: k, form: E, component: !1, children: g ? h(ri, { ...w, items: f, theme: g, itemRender: $, fields: p, children: S, basicForm: n }) : $(0, p, S) }); -}, Wo = /* @__PURE__ */ ((t) => function({ code: e, data: n, ...i }) { - const { uuid: r, resource: o, items: a, hides: s, rowHeight: l, marginX: c, marginY: u, cols: p, theme: m, themeProps: g, groups: w } = Pr(e) || {}, f = z(() => [{ name: "__RESOURCE__", value: o }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: r }], [e, r, o]); - return o && h(t, { name: e, theme: m, themeProps: g, groups: w, ...i, fields: a, formFields: f, rowHeight: l, cols: p, itemMargin: [c, u], data: o ? { [o]: n } : n }); -})(oi), Or = ({ column: t = 0, colWidth: e = 0, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, primaryKey: s, dataSource: l, beforeRender: c = null, afterRender: u = null, itemClassName: p, itemRender: m = ($, F, A) => $, empty: g = h(qt, { description: null }), className: w, style: f = {}, theme: S, themeProps: b = {}, groups: E = [{ key: "default", label: "默认" }], rowSelection: k }) => { - const { classNames: $ } = ge(le), F = G((T) => { - if (!k) return; - const { selectedRowKeys: V = [], onChange: N, type: M = "checkbox" } = k, D = T == null ? void 0 : T[s]; - let B; - B = M === "radio" ? [D] : V.includes(D) ? V.filter((Q) => Q !== D) : [...V, D], N == null || N(B, l.filter((Q) => B.includes(Q == null ? void 0 : Q[s]))); - }, [k, s, l]), A = z(() => h(oi, { groups: E, theme: S, themeProps: b, cols: n, rowHeight: i, itemMargin: r, containerPadding: o, fields: a, className: p }), [a, n, i, r, o, E, S, b]), O = y.isEmpty(l); - return I("div", { className: j("ff-data-list-content", $.content, w), style: Object.assign({}, f, t && { "--col-num": t }, e && { "--col-width": e }), children: [c == null ? void 0 : c(l), O ? g : l.map((T, V) => { - var B; - const N = (T == null ? void 0 : T[s]) ?? V, M = `${N}-${Ir(T)}`, D = m(x.cloneElement(A, { data: T }), T, V); - return x.cloneElement(D, { key: M, ...k && { isSelected: (B = k == null ? void 0 : k.selectedRowKeys) == null ? void 0 : B.includes(N), selectionType: k.type ?? "checkbox", onSelect: () => F(T) } }); - }), u == null ? void 0 : u(l)] }); -}, Rr = ({ component: t, $props: e }) => { - const { base62params: n } = Ot(e, {}); - return h(ie, { children: h(sn, { listCode: t, base62params: W.decode(n) }) }); -}, Bo = () => h(ai, {}), ai = () => "Empty", Fr = ({ component: t, $setting: e, $props: n }) => { - const [i, r] = L(), [o, a] = ui(n); - return U(() => { - if (!t) return r(h(ai, { description: null })); - se.getWidgetComponent(t).catch((s) => ({ default: () => `${s}` })).then((s) => x.createElement(s.default, { $setting: e })).then(r); - }, [t]), i ? x.cloneElement(i, { ...o, $setProps: a }) : null; -}, zo = () => "NotFoundPage"; -var je, ue, Ae, Ce, st, lt; -const we = class we { - constructor() { - P(this, ue, /* @__PURE__ */ new Map()); - P(this, Ae, {}); - P(this, Ce, null); - v(this, "init", (e, n) => { - K(this, ue, e), K(this, Ae, n); - }); - v(this, "get", (e) => (d(this, ue).has(e) || (e = Array.from(d(this, ue).keys()).find((n) => d(this, ue).get(n).uri === e)), d(this, ue).get(e) || {})); - v(this, "redirect", (e, n, i = {}) => { - var w; - const { uri: r, type: o, widgetProps: a } = this.get(e) || {}, { router: s, query: l, ...c } = n || {}, u = Object.assign({}, c, s), p = Object.assign({}, c, l); - o == "list" && (u.base62params = W.encode(u != null && u.base62params ? u.base62params : u)); - let m = er(r || e, u); - const g = new URLSearchParams(); - for (const f in a || {}) ((w = a[f]) == null ? void 0 : w.type) == "query" && Object.has(p, f) && g.append(f, JSON.stringify(p[f])); - return g.size > 0 && (m = `${m}?${g.toString()}`), i != null && i.isOpenWindow ? window.open(m) : d(this, Ce).navigate(m, { replace: !!(i != null && i.isReplaceRouteHistory) }); - }); - v(this, "getMenus", (e) => { - var n; - return ((n = d(this, Ae)) == null ? void 0 : n[e]) || []; - }); - v(this, "findMenuPathByUuid", (e) => { - let n = []; - for (const i in d(this, Ae)) if (n = d(this, st).call(this, d(this, Ae)[i], e, [i]), n.length > 1) return n; - return n; - }); - v(this, "getMenusByRouteUuid", (e) => d(this, lt).call(this, e, Object.values(d(this, Ae)).flat())); - P(this, st, (e, n, i = []) => { - if (y.isEmpty(e)) return i; - for (const { uuid: r, children: o } of e) { - if (r == n) return i.concat(r); - if (!y.isEmpty(o)) return i.concat(r, d(this, st).call(this, o, n)); - } - return i; - }); - P(this, lt, (e, n) => { - var r; - let i = []; - for (const o of n) o.widgetType == "redirect" && (o.uuid == e || o.widget == e ? i.push(o) : (r = o.children) != null && r.length && (i = i.concat(d(this, lt).call(this, e, o.children)))); - return i; - }); - v(this, "getCurrentMenu", () => { - const { uuid: e } = this.getCurrentRoute() || {}; - if (!e) return; - const n = this.getMenusByRouteUuid(e); - return y.isEmpty(n) ? void 0 : n[0]; - }); - v(this, "getCurrentRoute", (e = 0) => { - var i; - const n = (i = d(this, Ce).state.matches[d(this, Ce).state.matches.length - 1 - e]) == null ? void 0 : i.route; - if (!n) return null; - for (let [r, o] of d(this, ue)) if (o.uri === n.path) return o; - return null; - }); - v(this, "getPageParams", (e) => { - var a, s; - const { location: n = {}, matches: i = [] } = ((a = d(this, Ce)) == null ? void 0 : a.state) || {}, r = { ...((s = i[i.length - 1]) == null ? void 0 : s.params) || {} }, o = n.search; - return o && new URLSearchParams(o).forEach((l, c) => { - r[c] = l; - }), e ? y.get(r, e) : r; - }); - v(this, "usePageParams", (e) => { - var i; - let n = Un() ? { ...tr(), ...Object.fromEntries(new URLSearchParams(((i = nr()) == null ? void 0 : i.search) ?? "")) } : this.getPageParams(); - return e ? y.get(n, e) : n; - }); - v(this, "createBrowserRouter", (e = {}) => { - if (d(this, ue).size == 0) return null; - if (d(this, Ce)) return d(this, Ce); - const n = qe.get("Common.WEBSITE_DEFAULT_THEME", "@pkg/ff/frameworks/DefaultTheme"), i = qe.get(se.checkUserToken() ? "Common.WEBSITE_LOGIN_REDIRECT" : "Common.WEBSITE_DEFAULT", "/index"), r = { [n]: 0 }, o = (s, l) => () => Promise.all([se.getWidgetComponent(s), Ot(l)]).then(([c, u]) => [c.default || function() { - return `${s}`; - }, u]).then(([c, u]) => ({ Component: () => x.createElement(Kn, {}, x.createElement(c, { $setting: u })) })), a = Array.from(d(this, ue).values()).reduce((s, { uuid: l, uri: c, name: u, type: p, component: m, widgetSetting: g, widgetProps: w, isLogin: f, isLayout: S, extra: b }) => { - let E = {}, k = 0; - switch (p) { - case "list": - E.element = x.createElement(Rr, { component: m, $props: w }); - break; - case "fsdpf-component": - E.element = x.createElement(Fr, { key: c, component: m, $setting: g, $props: w }); - } - const $ = (b == null ? void 0 : b.theme) ?? (b == null ? void 0 : b.layout); - if ($) { - const F = (b == null ? void 0 : b.themeProps) ?? (b == null ? void 0 : b.layoutProps); - if (!r[$]) return r[$] = s.length, [...s, { path: "/", lazy: o($, F), children: [{ path: c, ...E }] }]; - k = r[$]; - } - return S && k > -1 ? (s[k].children.push({ path: c, ...E }), s) : [...s, { path: c, ...E }]; - }, [{ path: "/", lazy: o(n, {}), children: [] }]); - return a.push({ index: !0, element: x.createElement(jr, { to: i, replace: !0 }) }), K(this, Ce, ir(a, e)); - }); - if (d(we, je)) return d(we, je); - } -}; -je = new WeakMap(), ue = new WeakMap(), Ae = new WeakMap(), Ce = new WeakMap(), st = new WeakMap(), lt = new WeakMap(), P(we, je, null), v(we, "getInstance", () => (d(we, je) || K(we, je, new we()), d(we, je))); -let Gt = we; -const jr = ({ to: t, replace: e }) => Un() ? x.createElement(rr, { to: t, replace: e }) : (window.document.location = t, "redirect"), oe = Gt.getInstance(), Ke = new Worker(new URL("/ff-worker/index.js", self.location)), Rn = { generateUUID: () => Vr(), getConfigure: (t) => qe.get(t), route: { redirect: (...t) => oe.redirect(...t), getPageParams: (...t) => oe.getPageParams(...t), getCurrentRoute: () => oe.getCurrentRoute() }, popup: { notification: (...t) => ne.notification(...t), success: (...t) => ne.success(...t), error: (...t) => ne.error(...t), form: (...t) => ne.form(...t), modal: (...t) => ne.modal(...t), confirm: (...t) => ne.confirm(...t) } }; -var Nt, Ye, Ie; -const J = class J { - constructor() { - v(this, "exec", (e, n = {}, i = {}, r = "") => new Promise((o, a) => { - if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(e)) return o(); - const s = En(J, Nt)._++; - d(J, Ye).set(s, i), J.mQueue.set(s, [o, a]), Ke.postMessage({ id: s, session: r, category: "eval", method: e, args: n }); - })); - v(this, "clear", (e) => Ke.postMessage({ session: e, category: "clear" })); - if (d(J, Ie)) return d(J, Ie); - Promise.resolve().then(() => go).then((e) => { - Rn.http = e.http; - }), Ke.addEventListener("message", ({ data: { id: e, task_id: n, method: i, args: r, category: o, data: a, error: s, session: l } }) => { - if (o === "eval" && J.mQueue.has(e)) s !== null ? J.mQueue.get(e)[1](s) : J.mQueue.get(e)[0](a), d(J, Ye).delete(e), J.mQueue.delete(e); - else if (o === "util") try { - const c = y.get(Rn, i.split("/")) || y.get(d(J, Ye).get(n), i.split("/")); - if (!y.isFunction(c)) throw `${i} not found`; - Promise.resolve(Reflect.apply(c, void 0, r)).then((u) => { - Ke.postMessage({ id: e, task_id: n, category: o, method: i, args: r, session: l, data: u, error: null }); - }).catch((u) => { - Ke.postMessage({ id: e, task_id: n, category: o, method: i, args: r, session: l, data: null, error: u }); - }); - } catch (c) { - Ke.postMessage({ id: e, task_id: n, category: o, method: i, args: r, session: l, data: null, error: c }); - } - }, !1); - } -}; -Nt = new WeakMap(), Ye = new WeakMap(), Ie = new WeakMap(), v(J, "mQueue", /* @__PURE__ */ new Map()), P(J, Nt, 0), P(J, Ye, /* @__PURE__ */ new Map()), P(J, Ie, null), v(J, "getInstance", () => (d(J, Ie) || K(J, Ie, new J()), d(J, Ie))); -let Yt = J; -const Me = Yt.getInstance(), Fn = { 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" }, pe = (t, e) => { - let n = "string"; - n = Array.isArray(t) ? "array" : typeof t, y.isObject(t) && (n = "json"); - const i = `${n}2${e}`; - return Reflect.has(Fn, i) ? Fn[i](t) : t; -}, Ar = (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, Ot = (t = {}, e = {}, n = {}, i = "") => si(t, (r, o) => o === "type" && r === "code") ? li(t, e, n, i) : ci(t, e, i), si = (t, e = () => !1) => y.some(t, (n) => !!y.some(n, e) || (y.isEmpty(n) || !y.isPlainObject(n) && !y.isArray(n) ? void 0 : si(n, e))), li = async (t = {}, e = {}, n = {}, i = "") => { - 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: c = i } = t[o]; - switch (s) { - case "code": - try { - a = await Me.exec(l, e, n); - } catch (u) { - console.error("getWidgetPropsData", u); - } - break; - case "field": - a = y.get(e, l) ?? y.get(e, l.substring(l.indexOf(".") + 1)); - break; - case "router": - case "query": - a = oe.getPageParams(l); - break; - case "string": - a = l; - } - a ?? (a = c); - } else a = await li(t[o], e, n, i); - y.set(r, o, a); - } - return r; -}, ci = (t = {}, e = {}, n = "") => Object.keys(t || {}).reduce((i, r) => { - if (y.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 = n } = t[r]; - switch (a) { - case "field": - o = y.get(e, s) ?? y.get(e, s.substring(s.indexOf(".") + 1)); - break; - case "router": - case "query": - o = oe.getPageParams(s); - break; - case "string": - o = s; - } - o ?? (o = l); - } else o = ci(t[r], e, n); - y.set(i, r, o); - } - return i; -}, {}), Mt = (t, e) => t && typeof t == "object" ? Array.isArray(t) ? t.map((n) => Mt(n, e)) : Object.keys(t).reduce((n, i) => (e[i] ? n[e[i]] = Mt(t[i], e) : n[i] = Mt(t[i], e), n), {}) : t, Uo = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { - const e = 16 * Math.random() | 0; - return (t === "x" ? e : 3 & e | 8).toString(16); -}), qo = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){3}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.name : ""; -}, Ko = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){2}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.category : ""; -}, Ho = (t) => { - var e, n; - return t ? (n = (e = t.match(/^@pkg(?:[^\/]*\/){1}(?[^\/]+)/)) == null ? void 0 : e.groups) == null ? void 0 : n.owner : ""; -}, Ir = (t, e = 32, n = "auto") => { - const i = Xt(t), r = n === "auto" ? "x64" : n; - if (e === 32) return Lt.x86.hash32(i).toString(); - if (e === 128) return r === "x64" ? Lt.x64.hash128(i) : Lt.x86.hash128(i); - throw new Error("bits 只能是 32 或 128"); -}, Xt = (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(Xt).join(",") + "]" : typeof t == "object" ? "{" + Object.keys(t).sort().map((e) => `${e}:${Xt(t[e])}`).join(",") + "}" : String(t), Lr = () => { - let t = 1; - const e = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new Map(); - return (...i) => i.length === 0 ? "" : i.map((r) => { - return String((o = r) === null || typeof o != "object" && typeof o != "function" ? (n.has(o) || n.set(o, t++), n.get(o)) : (e.has(o) || e.set(o, t++), e.get(o))); - var o; - }).join("::"); -}, Mr = (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; - } -}, Jo = (t, e = "") => { - if (!t || typeof t != "string" || Mr(t)) return t; - let n = e; - return !n && typeof window < "u" && window.location && (n = `${window.location.protocol}//${window.location.host}`), t.startsWith("/") ? n ? `${n}${t}` : t : n ? `${n}/${t}` : t; -}, Vr = () => typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : typeof crypto < "u" && crypto.getRandomValues ? "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (t) => (+t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> +t / 4).toString(16)) : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => { - const e = 16 * Math.random() | 0; - return (t === "x" ? e : 3 & e | 8).toString(16); -}), Rt = () => { - const t = _(!0), [, e] = x.useReducer((n) => n + 1, 0); - return U(() => () => t.current = !1, []), () => t.current && e(); -}, _o = (t) => { - const [e, n] = L(t), i = _(null), r = G((o, a) => { - i.current = a, n(o); - }, []); - return U(() => { - i.current && (i.current(e), i.current = null); - }, [e]), [e, r]; -}, ft = (t = (i) => { -}, e, n = y.isEqual) => { - const i = x.useRef(); - n(e, i.current) || (i.current = y.cloneDeep(e)), x.useEffect(t, [i.current]); -}, Ft = ft, di = (t, e = "string") => { - var n; - if (!Array.isArray(t)) return t; - for (let i = 0; i < t.length; i++) t[i].value = pe((n = t[i]) == null ? void 0 : n.value, e), t[i] && Reflect.has(t[i], "children") && (t[i].children = di(t[i].children, e)); - return t; -}, Go = (t, e = "json", n = "string", i, r = null) => { - const [o] = ae.useForm(i), [a, s] = L([{ label: "无", value: "", disabled: !0 }]), l = _([]), c = ae.useWatch((u) => l.current.length === 0 ? null : y.pick(u, l.current), o) || null; - return U(() => { - Array.isArray(t) ? s(t) : e === "javascript" && t ? Me.exec(t, {}, { getFieldValue: (u) => (l.current.includes(u) || l.current.push(u), o.getFieldValue(u)), getFieldValueForBasicForm: (u) => (l.current.includes(u) || l.current.push(u), r ? r.getFieldValue(u) : o.getFieldValue(u)) }).then((u) => { - s(pe(u, "array")); - }).catch((u) => console.error("useOptions", u)) : t && s(pe(t, "array")); - }, [t, e, c]), di(a, n); -}, Yo = (t) => { - const [e, n] = L(), i = { type: "GET" }; - if (typeof t == "string" ? i.url = t : y.isPlainObject(t) && Object.assign(i, t), !(i != null && i.url)) throw "url is required"; - const r = (o) => W.request(i, !1).resp((a) => (console.log("useSubscribeRequest", o), n(a), a)); - return ft(() => { - let o = null; - return r().then((a) => { - o = ti.subscribe(y.throttle(r, 180, { leading: !1, trailing: !0 }), a.res); - }), () => o == null ? void 0 : o(); - }, i), e; -}, Dr = (t, e) => G((n) => { - const i = {}; - for (const [r, o] of Object.entries(n)) { - const a = t == null ? void 0 : t[r]; - if ((a == null ? void 0 : a.type) === "router" || (a == null ? void 0 : a.type) === "query") { - const s = oe.getCurrentRoute(); - s != null && s.uuid && oe.redirect(s.uuid, { ...oe.getPageParams(), [a.type]: { [a.value || r]: o } }, { isReplaceRouteHistory: !0 }); - } else i[r] = o; - } - Object.keys(i).length > 0 && e(i); -}, [t, e]), ui = (t, e = {}, n = {}, i = []) => { - const [r, o] = L({}), [a, s] = L({}), l = Wn(a), c = oe.usePageParams(); - tn(() => { - Promise.resolve(Ot(t, e, n)).then(s); - }, [t, e, c, ...i]), nn(() => { - const m = l ?? {}, g = Object.keys({ ...m, ...a }).reduce((w, f) => (m[f] !== a[f] && (w[f] = a[f]), w), {}); - Object.keys(g).length > 0 && o((w) => ({ ...w, ...g })); - }, [a]); - const u = Dr(t, (m) => { - o((g) => ({ ...g, ...m })); - }), p = z(() => Object.fromEntries(Object.entries(r).filter(([m, g]) => g !== a[m])), [r, a]); - return [r, u, p]; -}, Wr = (t) => { - const [e, n] = x.useState({ items: [], hides: [] }); - return x.useEffect(() => { - t && W.get(`/api/_/${t}`).then(({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, listenChangeFields: m, listenChangeFieldsFunc: g, fields: w, theme: f, themeSetting: S, groups: b }) => ({ pk: i, uuid: r, code: o, resource: a, align: s, cols: l, rowHeight: c, marginX: u, marginY: p, theme: f, themeProps: S, groups: b, listenChangeFields: m, listenChangeFieldsFunc: g, ...w.reduce((E, k) => { - var $; - return ($ = k == null ? void 0 : k.field) != null && $.hidden ? E.hides.push(k == null ? void 0 : k.field) : E.items.push(k), E; - }, { items: [], hides: [] }) })).then(n); - }, [t]), e; -}, Br = ({ max: t = 0, min: e = 0, type: n = "", message: i, pattern: r, required: o = !1, validator: a } = {}, s, l) => { - const [c, u] = L([]); - return U(() => { - const p = []; - if (o) { - 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 (n) { - case "string": - p.push({ type: n, max: t, min: e, message: i || (e && t ? `字符必须在 ${e} ~ ${t} 之间` : `${t ? "最多能有" : "最少要有"} ${e || t} 个字符`) }); - break; - case "pattern": - p.push({ type: "string", pattern: r, message: i }); - break; - case "validator": - a && p.push(({ getFieldValue: m }) => ({ validator: async (g, w) => { - const f = await Me.exec(a, { value: w, fieldName: s }, { getFieldValue: m }); - return y.isString(f) && f ? Promise.reject(f) : y.isBoolean(f) && !f ? Promise.reject(i) : Promise.resolve(); - } })); - } - u(p); - }, [t, e, n, i, r, o, a]), c; -}, zr = (t, e, n) => { - const [i, r] = L(null); - return U(() => { - const { initDataUri: o = `/api/${t}`, initDataMethod: a = "GET" } = n || {}; - e && W.request({ method: a, url: y.trimEnd(`${o}/${e}`, "/") }).then((s) => { - r(s); - }); - }, [t, e, n]), i; -}, Ur = (t, e, n) => G((i, r = { serialize: (o) => o, onSuccess: () => { -}, onFail: (o) => (o == null ? void 0 : o.errorFields) && ne.error("请先完善表单信息", { duration: 2e3 }) }) => { - const o = i.getFieldValue("__RESOURCE__"), { submitDataUri: a = `/api/${t}`, submitDataMethod: s = "POST" } = n || {}; - return i.validateFields().then((l) => o ? y.pick(l, [o]) : l).then(r.serialize).then((l) => W.request({ method: s, url: y.trimEnd(`${a}/${e || ""}`, "/"), data: l }).msg(r.onSuccess)).catch(r.onFail); -}, [t, e, n]), qr = (t, e, n, i) => { - const r = zr(e, n, i); - U(() => { - r ? t.setFieldsValue(r) : t.resetFields(); - }, [t, r]); - const o = Ur(e, n, i); - return y.partial(o, t); -}, Kr = (t, e, n = [], i = {}) => { - const r = _({}), o = _(), a = y.debounce(Rt(), 180), s = ["disabled", "required"], l = (m, g) => { - s.includes(m) && (r.current[m] = g), a(); - }, c = z(() => ({ setDisabled: (m) => l("disabled", m), setRequired: (m) => l("required", m), getDisabled: () => r.current.disabled, getRequired: () => r.current.required }), [e]), [u, p] = ii(e, -1, {}, c, i); - if (!p && o.current != u && (u >= 0 || !y.isEmpty(n == null ? void 0 : n[u]))) { - o.current = u; - const { widget: m, widgetPrefix: g, props: w } = n == null ? void 0 : n[u]; - t = _n(m, g), r.current = y.merge(w, y.pick(r.current, s)); - } - return [t, r.current]; -}, jn = (t) => t === void 0 || t === !1 ? "" : (Array.isArray(t) ? t : [t]).join("_"), Xo = ({ value: t, onChange: e }, n = null) => { - const i = _(), [r] = ae.useForm(n), o = _({}); - return Ft(() => { - y.isEqual(i.current, t) || r.setFieldsValue(t); - }, [t]), U(() => () => r.resetFields(), []), [z(() => r.__INTERNAL__ ? r : { ...r, __INTERNAL__: { itemRef: (a) => (s) => { - const l = jn(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 = jn(a); - return o.current[s]; - } }, [r]), (a, s) => { - i.current = s, e == null || e(s); - }]; -}, ln = ({ widget: t = "Input", widgetPrefix: e = "@pkg/ff/grid-layout-forms", widgetDecorator: n, subWidgets: i = [], basicForm: r, ...o }) => { - const a = _n(t, e), [s, l] = Kr(a, n, i, r), [c, u] = L(); - return U(() => { - s && se.getWidgetComponent(s).then(({ defaultProps: p = {}, default: m }) => ({ default: Hr(m, p, r) })).catch((p) => ({ default: () => `${p}` })).then((p) => u(x.createElement(p.default, o))); - }, [s]), c && x.cloneElement(c, { ...o, ...l }); -}, Hr = (t, e = {}, n = null) => (i) => { - const { type: r, code: o, label: a, noStyle: s, style: l, placeholder: c, required: u = !1, extras: p, validators: m, help: g, isVirtual: w, $isReserved: f, initialValue: S, initialValueLanguage: b, ...E } = y.omit(y.merge({}, e, i), ["convertJs", "convertJsSetting", "widget", "widgetPerfix", "widgetDecorator", "subWidgets", "boxStyle"]), k = Br(Object.assign({}, m, u ? { required: !0 } : {}), o, r), $ = z(() => { - const V = Object.keys((e == null ? void 0 : e.extras) || {}); - return y.over([y.partialRight(y.pick, V), y.partialRight(y.omit, V)]); - }, [e == null ? void 0 : e.extras]), [F, A] = $(E), O = { label: a, noStyle: s, style: l, colon: !1, layout: "vertical" }, T = G((V) => V == null ? void 0 : pe(V, r), [r]); - return h(rn, { name: o, rules: k, initialValue: T(S), normalize: T, children: (V, N, M) => { - var D; - return h(t, { type: r, rcform: M, basicForm: n, itemProps: { validateStatus: N.errors.length > 0 ? "error" : "success", tooltip: g || null, help: N.errors.length > 0 ? N.errors.join("、") : null, required: ((D = k == null ? void 0 : k[0]) == null ? void 0 : D.required) || !1, ...O }, fieldProps: { placeholder: c, ...A, ...V }, $setting: Object.assign({}, p, F) }); - } }); -}, cn = ({ name: t, form: e = null, basicForm: n = null, style: i = {}, className: r, cols: o = 24, rowHeight: a = 16, itemMargin: s = [8, 16], containerPadding: l = [0, 0], fields: c = [], hides: u = [], primaryKey: p = 0, formProps: m = {}, formFields: g = [], listenChangeFields: w, listenChangeFieldsFunc: f, onValuesChange: S, theme: b, themeProps: E = {}, groups: k = [{ key: "default", label: "默认" }], children: $, ...F }) => { - const [A] = ae.useForm(e), O = G((N, M) => { - S == null || S(N, M), f && Array.isArray(w) && Me.exec(f, { changedValues: N, allValues: M }, { getFieldValue: A.getFieldValue, setFieldValue: A.setFieldValue, setFieldsValue: A.setFieldsValue, isFieldTouched: A.isFieldTouched, isFieldsTouched: A.isFieldsTouched }).catch((D) => console.error("onFormValuesChange", t, D)); - }, [t, A, S, w, f]), T = z(() => [{ name: "__PROPS__", value: m }, { name: "__PRIMARY_KEY__", value: p }].concat(g), [p, m, g]), V = (N, M, D) => { - const B = an(M, ln, n), Q = Qn(F); - return I("div", { ...Q, className: j("ff-grid-layout-form", r), style: { ...i, "--grid-layout-item-margin-x": `${(s == null ? void 0 : s[0]) ?? 8}px`, "--grid-layout-item-margin-y": `${(s == null ? void 0 : s[1]) ?? 16}px`, "--grid-layout-container-padding-y": `${(l == null ? void 0 : l[0]) || 0}px`, "--grid-layout-container-padding-x": `${(l == null ? void 0 : l[1]) || 0}px`, "--grid-layout-cols": o, "--grid-layout-row-height": `${a}px` }, children: [B, D && x.cloneElement(D, { cols: o, rowHeight: a, itemMargin: s, containerPadding: l, fields: M, basicForm: n })] }); - }; - return I(ae, { ...F, form: A, fields: T, onValuesChange: O, children: [b ? h(ri, { ...E, items: k, theme: b, itemRender: V, fields: c, children: $, basicForm: n }) : V(0, c, $), u == null ? void 0 : u.map((N) => { - var M; - return h(rn, { name: N.code, children: h(Jr, { form: A, basicForm: n, name: N.code, type: N.type, initialValue: N.initialValue, initialValueLanguage: (M = N.extras) == null ? void 0 : M.initialValueLanguage }) }, JSON.stringify(N.code)); - })] }); -}, Jr = ({ type: t, initialValue: e, initialValueLanguage: n, onChange: i, basicForm: r }) => { - const [o, a] = ii(n == "javascript" && e, n == "javascript" ? void 0 : e, {}, {}, r); - return U(() => { - n == "javascript" ? i(pe(o, t)) : e && i(pe(e, t)); - }, [t, e, o]), null; -}; -cn.propTypes = { fields: C.array, hides: C.array }; -const _r = /* @__PURE__ */ ((t) => ({ code: e, isPreview: n = !1, ...i }) => { - const { align: r, autoComplete: o, resource: a, items: s, hides: l, rowHeight: c, marginX: u, marginY: p, cols: m, listenChangeFields: g, listenChangeFieldsFunc: w, pk: f, uuid: S, theme: b, themeProps: E, groups: k } = Wr(e), $ = z(() => [{ name: "__PK__", value: f }, { name: "__RESOURCE__", value: a }, { name: "__LAYOUT_KEY__", value: e }, { name: "__LAYOUT_UUID__", value: S }], [f, e, S, a]); - return h(t, { name: e, autoComplete: o, theme: b, themeProps: E, groups: k, ...i, formFields: $, listenChangeFields: g, listenChangeFieldsFunc: w, fields: s, hides: l, cols: m, rowHeight: c, itemMargin: [u, p] }); -})(cn), pi = ({ $setting: t, $close: e, extras: n, code: i, primaryKey: r, ...o }) => { - const [a] = ae.useForm(), s = qr(a, i, r, t); - return h(ie, { actions: I(x.Fragment, { children: [h(R, { name: (t == null ? void 0 : t.okText) || "保存", type: "primary", widget: () => s({ onSuccess: e }) }), h(R, { name: (t == null ? void 0 : t.cancelText) || "取消", widget: () => e(!1) })] }), extras: n, children: h(_r, { form: a, code: i, primaryKey: r, ...o }) }); -}, An = /* @__PURE__ */ new Set(), Qt = (t = [], e = 0) => { - const n = t[e]; - if (n.length && !An.has(n)) { - const i = document.createElement("script"); - i.setAttribute("src", n), i.setAttribute("data-namespace", n), t.length > e + 1 && (i.onload = () => { - Qt(t, e + 1); - }, i.onerror = () => { - Qt(t, e + 1); - }), An.add(n), document.body.appendChild(i); - } -}, Et = ({ className: t, type: e, style: n = {}, ...i }) => h("span", { role: "img", className: j("ff-iconfont", t), style: n, ...i, children: h("svg", { style: { width: "1em", height: "1em", fill: "currentColor", overflow: "hidden" }, viewBox: "0 0 1024 1024", children: h("use", { xlinkHref: `#${e}` }) }) }); -Et.propTypes = { className: C.string, type: C.string.isRequired, style: C.object }, Et.init = Qt; -const Gr = (t, e, n, i) => oe.redirect(n, e, i), Yr = (t, e = {}, n, i = {}) => { - var o; - const r = (o = i.router) == null ? void 0 : o.reduce((a, [s, l, c]) => { - const u = y.get(e, ["router", s]); - if (!u && u !== 0 && l) throw `请传入 ${c}`; - return `${a}/${u}`; - }, `/api/${n}`); - return W.del(r, e.param).msg(); -}, In = (t, e, n, { status: { loading: i, disabled: r }, setStatus: o, listFn: a }) => { - const s = { loading: (l) => l === void 0 ? i : o((c) => ({ ...c, loading: l })), disabled: (l) => l === void 0 ? r : o((c) => ({ ...c, disabled: l })), list: a }; - return y.isFunction(n) ? n.call(null, e, s) : y.isString(n) && n ? Me.exec(n, e, s) : null; -}, Ln = (t, e, n, i, r) => y.isString(n) && n ? se.getWidgetComponent(n).then(({ default: o }) => ne.modal(o, { ...e, $setting: i }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r)).catch((o) => { - ne.error(n, { content: o.toString() }); -}) : ne.modal(n, { ...e, $setting: i }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Xr = (t, e, n, i, r) => ne.modal(pi, { ...e, $setting: i, code: n }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Qr = (t, e, n, i, r) => ne.modal(sn, { ...i, base62params: e, listCode: n }, r != null && r.title ? { ...r, title: y.template(r.title)(t) } : r), Zr = ({ widget: t, widgetType: e, widgetData: n, widgetProps: i, widgetSetting: r, widgetContainerProps: o }, { onAfterClick: a, onBeforeClick: s } = {}) => { - const l = ge(le), [c, u] = L({ leading: !0, trailing: !1 }), p = _(null), [m, g] = z(() => { - switch (e) { - case "redirect": - return [y.partialRight(Gr, t, r), null]; - case "func": - return [y.partialRight(In, (r == null ? void 0 : r.code) ?? t, { status: c, setStatus: u, listFn: l }), null]; - case "component": - case "fsdpf-component": - return [y.partialRight(Ln, t, r, o), (f) => ({ $setting: f })]; - case "grid-layout-form": - return [y.partialRight(Xr, t, r, o), (f) => ({ $setting: f })]; - case "data-list": - return [y.partialRight(Qr, t, r, o), (f) => f]; - case "destroy": - return [y.partialRight(Yr, t, r, o), null]; - default: - if (un(t) || x.isValidElement(t)) return [y.partialRight(Ln, t, r, o), (f) => ({ $setting: f })]; - if (y.isFunction(t)) return [y.partialRight(In, (r == null ? void 0 : r.code) || t, { status: c, setStatus: u }), null]; - } - return [(...f) => console.error("useButton unknown widgetType", e, ...f), null]; - }, [t, e, r, o, l.getBase62params, l.getSelectedRows]), w = y.debounce((f) => (s == null || s(f), Promise.resolve(Ot(i, f, { list: l })).then((S) => { - const b = m(f, { ...n, ...S }); - return b != null && b.update && g && (p.current = (E, k) => b.update(g(E), k)), b; - }).then((S) => a == null ? void 0 : a(S)).catch(console.error)), 300, { leading: !0, trailing: !1 }); - return nn(() => { - var f; - (f = p.current) == null || f.call(p, r, o); - }, [r, o]), [w, c]; -}, gi = ({ type: t, name: e, className: n, icon: i, iconPosition: r, size: o }, a = "default") => z(() => { - const s = { type: "primary", className: j("ff-button", n), 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 = j(s.className, "ff-default"))) : a !== "circle" && a !== "round" || (s.shape = a), i && (s.icon = h(Et, { type: i })), e && (s.children = e), s; -}, [a, t, n, i, r]), jt = ({ data: t, widget: e, widgetType: n = "fsdpf-component", widgetData: i, widgetProps: r, widgetSetting: o, widgetContainerProps: a, onAfterClick: s, onBeforeClick: l, children: c, extras: u }) => { - const p = ge(le), [m, g] = L(!1), [w, f] = L("hover"), [S, b] = ui(r, t, { list: p }, [p.getBase62params, p.getSelectedRows]), [E, k] = L(), { placement: $, align: F, zIndex: A, arrow: O = { pointAtCenter: !0 }, getPopupContainer: T, isPopupMountBodyContainer: V = !0, ...N } = a || {}; - U(() => { - n == "grid-layout-form" ? k(x.createElement(pi, { ...i, $setting: o, code: e })) : n == "data-list" ? k(x.createElement(sn, { base62params: t, $setting: o, listCode: e })) : y.isString(e) ? se.getWidgetComponent(e).then(({ default: B }) => { - k(x.createElement(B, { ...i, $setting: o })); - }).catch((B) => k(B.toString())) : x.isValidElement(e) ? k(x.cloneElement(e, { ...i, $setting: o })) : (un(e) || y.isFunction(e) && ["component", "fsdpf-component"].includes(n)) && k(x.createElement(e, { ...i, $setting: o })); - }, [e, n, i]); - const M = (B, Q = !1) => (g(B), !B && f("hover"), B ? l == null ? void 0 : l(S) : s == null ? void 0 : s(Q)), D = (B) => { - g(!0), f("click"); - }; - return h(Gi, { zIndex: A, placement: $, onPopupClick: D, onClick: D, open: m, align: F, arrow: O, trigger: w, getPopupContainer: T || V ? void 0 : (B) => B, content: h(eo, { ...N, extras: u, children: E && x.cloneElement(E, { ...S, $setProps: b, $close: (B) => M(!1, B) }) }), children: c, onOpenChange: M }); -}, eo = ({ title: t, className: e, classNames: n, children: i, extras: r, width: o, height: a, ...s }) => { - const [l, c] = L({}), u = G((w, f) => c((S) => ({ ...S, [w]: f })), []), p = G((w) => c((f) => ({ ...f, [w]: void 0 })), []), m = t ? x.createElement("div", { className: "ff-popup-title" }, t) : l == null ? void 0 : l.title, g = r ?? x.createElement("div", { className: "ff-popup-reserved-extras" }, r); - return h(mt.Provider, { value: { ele: l, mount: u, unmount: p }, children: I("div", { className: j("ff-popup ff-popover", e, l.rootClassName), style: { width: o ?? 260, height: a }, ...s, children: [I("div", { className: j("ff-popup-header", "ff-popover-header", n == null ? void 0 : n.header), children: [m, l == null ? void 0 : l["sub-title"]] }), h("div", { className: j("ff-popup-body", "ff-popover-body", n == null ? void 0 : n.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-popover-footer", n == null ? void 0 : n.footer), children: [g, l == null ? void 0 : l.extras, l == null ? void 0 : l.actions] })] }) }); -}; -jt.propTypes = { widgetType: C.oneOf(["fsdpf-component", "grid-layout-form", "data-list"]) }; -const yt = (t) => function({ className: e, variant: n, children: i, name: r, icon: o, type: a = "default", iconPosition: s = "start", noAuthType: l, onAfterClick: c, onBeforeClick: u, data: p, loading: m, disabled: g, tooltip: w, confirm: f, widget: S = () => { -}, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: F, ...A }) { - const { mode: O, ...T } = F || {}, V = gi({ className: e, name: r, type: a, icon: o, iconPosition: s }, n ?? t), N = h(St, { ...V, ...A, children: i || r }); - if (O === "popover" && !["destroy", "redirect", "func"].includes(b)) return h(jt, { data: p, widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: T, onAfterClick: c, onBeforeClick: u, children: N }); - const M = y.isEmpty(w) || !w.enabled ? {} : w, D = y.isEmpty(f) ? { enabled: !1 } : Object.assign({ enabled: !0 }, f), [B, Q] = L(!1), [Ee, { disabled: q, loading: ce }] = Zr({ widget: S, widgetType: b, widgetData: E, widgetProps: k, widgetSetting: $, widgetContainerProps: T }, { onAfterClick: c, onBeforeClick: u }); - return h(Yi, { okText: "确定", cancelText: "取消", getPopupContainer: (H) => H, ...D, disabled: q || g, open: B, onOpenChange: (H) => { - if (!H) return Q(H); - D.enabled ? Q(H) : Ee(p); - }, onConfirm: (H) => { - Ee(p, H); - }, onClick: (H) => { - H.stopPropagation(); - }, children: h(Xi, { getPopupContainer: (H) => H, ...M, title: B ? null : M == null ? void 0 : M.title, trigger: ["hover", "click"], children: x.cloneElement(N, { loading: ce || m, disabled: q || g }) }) }); -}, R = yt("default"); -R.propTypes = { type: C.oneOf(["primary", "default", "danger", ""]), size: C.oneOf(["large", "middle", "small"]), name: C.string, icon: C.string, iconPosition: C.oneOf(["start", "end"]), data: C.any, widget: C.any, widgetType: C.oneOf(["destroy", "redirect", "func", "component", "fsdpf-component", "grid-layout-form", "grid-layout", "data-list"]), widgetData: C.object, widgetProps: C.object, widgetSetting: C.object, widgetContainerProps: C.object, tooltip: C.exact({ title: C.string.isRequired, placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func }), confirm: C.exact({ title: C.string.isRequired, cancelText: C.string, okText: C.string, okType: C.oneOf(["primary", "default", "danger", ""]), placement: C.oneOf(["top", "left", "right", "bottom", "topLeft", "topRight", "bottomLeft", "bottomRight", "leftTop", "leftBottom", "rightTop", "rightBottom"]), enabled: C.oneOfType([C.bool, C.number]), getPopupContainer: C.func, arrow: C.oneOfType([C.bool, C.exact({ pointAtCenter: C.bool })]) }) }; -const to = yt("link"), no = yt("circle"), io = yt("round"), ro = yt("dashed"), Mn = ({ options: t = [], triggerWeights: e = ["grid-layout-form", "grid-layout", "fsdpf-component", "print"], onAfterClick: n = (g, w, f) => { -}, onBeforeClick: i = (g, w, f) => { -}, labelVariant: r = "link", labelSize: o, labelRender: a, btnVariant: s, btnSize: l, btnRender: c = (g, w) => h(R, { ...g, data: w }, g.uuid || Bt()), widgetContainerProps: u = {}, children: p, data: m }) => { - if (y.isEmpty(t)) return p; - l ?? (l = o), s ?? (s = r); - const [g, w] = z(() => (t || []).reduce((b, E) => { - const k = e.indexOf(E.widgetType); - return k === -1 ? b[1].push(E) : b[0] ? k < e.indexOf(b[0].widgetType) ? (b[1].push(b[0]), b[0] = E) : b[1].push(E) : b[0] = E, b; - }, [null, []]), [t, e]); - a ? p = a(g, m) || p : p || (p = h(St, { ...gi(Object.assign(g != null && g.name || g != null && g.icon ? {} : { icon: "icon-location" }, g, { size: o }), r) })); - const f = w.map((b) => c(Object.assign({ uuid: b.uuid, type: b.type, name: b.name, widget: b.widget, widgetType: b.widgetType, widgetProps: b.widgetProps, widgetData: b.widgetData, widgetSetting: b.widgetSetting, widgetContainerProps: b.widgetContainerSetting, confirm: b.confirm, onAfterClick: y.partialRight(n, b, m), onBeforeClick: y.partialRight(i, b, m) }, { size: l, variant: s }), m)); - let S = f; - return (f == null ? void 0 : f.length) > 1 && (S = s == "link" ? h(Ut, { split: h(Qi, { type: "vertical" }), size: l, children: f }) : h(Ut.Compact, { size: l, children: f })), g ? h(jt, { 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: S, onAfterClick: y.partialRight(n, g, m), onBeforeClick: y.partialRight(i, g, m), children: p }) : S; -}; -Mn.propTypes = { triggerWeights: C.array, options: C.arrayOf(C.shape({ ...R.propTypes, widgetType: R.propTypes.widgetType.isRequired })), btnSize: R.propTypes.size, btnRender: C.func, btnVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelVariant: C.oneOf(["", "default", "link", "circle", "round", "dashed"]), labelRender: C.func, labelSize: R.propTypes.size, onAfterClick: C.func, onBeforeClick: C.func, widgetContainerProps: R.propTypes.widgetContainerProps, data: R.propTypes.data }, R.Link = to, R.Link.defaultProps = R.defaultProps, R.Link.propTypes = R.propTypes, R.Circle = no, R.Circle.defaultProps = R.defaultProps, R.Circle.propTypes = R.propTypes, R.Round = io, R.Round.defaultProps = R.defaultProps, R.Round.propTypes = R.propTypes, R.Dashed = ro, R.Dashed.defaultProps = R.defaultProps, R.Dashed.propTypes = R.propTypes, R.Popover = jt, R.GroupPopover = Mn; -const oo = ({ fields: t, formProps: e, $close: n }) => { - const [i] = ae.useForm(), r = z(() => [{ name: "__PROPS__", value: e }], [e]); - return h(ie, { actions: I(x.Fragment, { children: [h(R, { name: "取消", widget: () => n(!1) }), h(R, { name: "确定", type: "primary", widget: () => i.validateFields(!0).then(n) })] }), children: h(ae, { fields: r, form: i, className: "ff-modal-form", children: t == null ? void 0 : t.map(({ code: o, ...a }) => h(ln, { code: o, ...a }, o)) }) }); -}, ao = ({ className: t, classNames: e, $close: n, children: i, title: r, subTitle: o, actions: a, extras: s, ...l }) => I(or, { ...l, prefixCls: "ff-drawer", className: j("ff-popup", t), maskMotion: { motionAppear: !0, motionName: "mask-motion" }, motion: (c) => ({ motionAppear: !0, motionName: `panel-motion-${c}` }), children: [I("div", { className: j("ff-popup-header", "ff-drawer-header", e == null ? void 0 : e.header), children: [h("button", { "aria-label": "Close", className: j("ff-popup-close", "ff-drawer-close", e == null ? void 0 : e.close), onClick: l.onClose, children: h(on, { type: "close" }) }), r, o] }), h("div", { className: j("ff-popup-body", "ff-drawer-body", e == null ? void 0 : e.body), children: i }), I("div", { className: j("ff-popup-footer", "ff-drawer-footer", e == null ? void 0 : e.footer), children: [s, a] })] }), so = ({ className: t, classNames: e, $close: n, $event: i, children: r, title: o, subTitle: a, actions: s, extras: l, placement: c, ...u }) => { - const { style: p, rest: m } = ((w, f = ["height", "width", "style"]) => { - const S = { ...w }, b = {}; - for (const E of f) E === "style" ? Object.assign(b, S.style) : S[E] !== void 0 && (b[E] = S[E]), delete S[E]; - return { style: b, rest: S }; - })(u), g = (i == null ? void 0 : i.pageX) === void 0 ? { animation: null, maskAnimation: null, mousePosition: { x: null, y: null } } : { animation: "zoom", maskAnimation: "fade", mousePosition: { x: i == null ? void 0 : i.pageX, y: i == null ? void 0 : i.pageY } }; - return h(ar, { ...m, ...g, prefixCls: "ff-modal", className: j("ff-popup", t), modalRender: () => I(x.Fragment, { children: [h("button", { className: j("ff-popup-close", "ff-modal-close", e == null ? void 0 : e.close), onClick: m.onClose, children: h(on, { type: "close" }) }), I("div", { className: j("ff-modal-content"), style: p, children: [I("div", { className: j("ff-popup-header", "ff-modal-header", e == null ? void 0 : e.header), children: [o, a] }), h("div", { className: j("ff-popup-body", "ff-modal-body", e == null ? void 0 : e.body), children: r }), I("div", { className: j("ff-popup-footer", "ff-modal-footer", e == null ? void 0 : e.footer), children: [l, s] })] })] }) }); -}, hi = ({ placement: t, $close: e, $event: n, children: i, title: r, ...o }) => { - const [a, s] = L({}), [l, c] = L(!0), u = G((w, f) => s((S) => ({ ...S, [w]: f })), []), p = G((w) => s((f) => ({ ...f, [w]: void 0 })), []); - let m = { ...o, className: a.rootClassName, title: a.title || r && x.createElement("div", { className: j("ff-popup-title") }, r), subTitle: a["sub-title"], actions: a.actions, extras: a.extras, children: i, $close: e, $event: n, onClose: () => c(!1) }; - const g = () => { - e(!1); - }; - return h(mt.Provider, { value: { ele: a, mount: u, unmount: p }, children: t && t !== "center" ? h(ao, { ...m, placement: t, open: l, afterOpenChange: (w) => !w && g() }) : h(so, { ...m, visible: l, afterClose: g }) }); -}; -hi.propTypes = { placement: C.oneOf(["center", "left", "top", "right", "bottom"]) }; -const lo = ({ widget: t, widgetProps: e, $close: n, onSetProps: i }) => { - const [r, o] = L(e || {}), a = Wn(e); - tn(() => { - const l = a ?? {}, c = e ?? {}, u = Object.keys({ ...l, ...c }).reduce((p, m) => (l[m] !== c[m] && (p[m] = c[m]), p), {}); - Object.keys(u).length > 0 && o((p) => ({ ...p, ...u })); - }, [e]); - const s = G((l) => { - o((c) => ({ ...c, ...l })), i == null || i(l); - }, [i]); - return x.isValidElement(t) ? x.cloneElement(t, { ...r, $close: n, $setProps: s }) : t != null && t.name || vn.isForwardRef(t) || (t == null ? void 0 : t.$$typeof) === vn.ForwardRef ? x.createElement(t, { ...r, $close: n, $setProps: s }) : t; -}, X = () => { - const [t, e] = Wi({ 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" }), [, n] = x.useReducer((o) => o + 1, 0); - U(() => { - X.$onClick = i, X.$queue.forEach(([o, a, s, l]) => { - l == null || l(r([a, s], ...o)); - }), X.$queue = []; - }, []); - const i = (o, a = {}, s = {}) => { - let l; - const c = new Promise((u, p) => { - l = r([u, p], o, a, s); - }); - return c.update = l, c; - }, r = ([o, a], s, l = {}, c = {}) => { - const u = X.$index++; - if (s === Hn) return t.open({ ...c, key: u, content: x.createElement(s, { ...l, $close: () => t.close(u) }) }), () => { - }; - const { $setProps: p, ...m } = l; - return X.$popups.set(u, { widget: s, widgetProps: m, widgetContainerProps: c, $close: (g) => ((w, f) => (X.$popups.delete(w), n(), f == null ? void 0 : f()))(u, () => o(g)), onSetProps: p }), n(), (g, w) => { - const f = X.$popups.get(u); - f && (X.$popups.set(u, { ...f, widgetProps: g ? { ...f.widgetProps, ...g } : f.widgetProps, widgetContainerProps: w ? { ...f.widgetContainerProps, ...w } : f.widgetContainerProps }), n()); - }; - }; - return I(x.Fragment, { children: [Array.from(X.$popups).map(([o, { widget: a, widgetProps: s, widgetContainerProps: l, $close: c, onSetProps: u }]) => h(hi, { maskClosable: !1, $event: s == null ? void 0 : s.$event, ...l, $close: c, children: h(lo, { widget: a, widgetProps: s, $close: c, onSetProps: u }) }, o)), e] }); -}; -X.$popups = /* @__PURE__ */ new Map(), X.$index = 0, X.$queue = [], X.$onClick = (...t) => { - const e = new Promise((n, i) => { - X.$queue.push([t, n, i, (r) => { - e.update = r; - }]); - }); - return e; -}; -const Vn = (t, e, n = {}) => X.$onClick(t, e, n), Vt = (t, { showProgress: e, duration: n, ...i } = { duration: 1.5 }) => X.$onClick(Hn, { content: t, ...i }, { showProgress: e, duration: n }), ne = { modal: Vn, confirm: (t, e = {}) => X.$onClick(sr, { content: t, ...e }, { placement: "center" }), form: (t, e = {}, n = {}) => Vn(oo, { formProps: n, fields: t }, { placement: "center", ...e }).then((i) => { - if (i === !1) throw !1; - return i; -}), notification: Vt, success: (t, e = { duration: 1.5 }) => Vt(t, { ...e, className: "ff-notification-success", icon: "check" }), error: (t, e = { duration: 1.5 }) => Vt(t, { ...e, className: "ff-notification-error", icon: "close" }) }; -tt.configure({ showSpinner: !1 }); -const mi = () => { - const t = window.localStorage.getItem(kt); - return Object.freeze({ Platform: "web", SaaS: window.localStorage.getItem("SaaS"), Authorization: t ? `Bearer ${t} ` : void 0 }); -}; -De.interceptors.request.use((t) => (Object.assign(t.headers, mi()), tt.inc(), t), (t) => (tt.done(), Promise.reject({ code: -1, msg: t }))), De.interceptors.response.use(({ data: t, headers: e }) => (tt.done(), { ...t, res: e == null ? void 0 : e.res }), function(t) { - return tt.done(), Promise.reject(t.message); -}), window.addEventListener("unhandledrejection", zt.onUnhandledRejection), zt.onMsg = (t, e) => ne[[0, 1].includes(t) ? "success" : "error"](e).then(() => t === 20300 && oe.redirect(qe.get("Common.WEBSITE_LOGIN_PAGE"))); -var Xe, Ue, Qe; -const ee = class ee { - constructor() { - v(this, "appUrl", ""); - P(this, Xe, null); - return d(ee, Ue) || (K(ee, Qe, new zt()), K(ee, Ue, new Proxy(this, { get(e, n) { - if (n in e) { - const i = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(e), n); - return i != null && i.get ? Reflect.get(e, n, e) : typeof e[n] == "function" ? e[n].bind(e) : e[n]; - } - return d(ee, Qe)[n]; - } }))), d(ee, Ue); - } - init(e, n, i) { - De.defaults.baseURL = this.appUrl = i, De.defaults.timeout = 15e3, d(ee, Qe).init(e, n, De); - } - get driver() { - return De; - } - get headers() { - return mi(); - } - mock(e = {}) { - return d(this, Xe) ?? K(this, Xe, new zi(De, { onNoMatch: "passthrough", ...e })); - } - unmock() { - var e; - (e = d(this, Xe)) == null || e.restore(), K(this, Xe, null); - } -}; -Xe = new WeakMap(), Ue = new WeakMap(), Qe = new WeakMap(), P(ee, Ue), P(ee, Qe), v(ee, "getInstance", () => d(ee, Ue) ?? K(ee, Ue, new ee())); -let Zt = ee; -const W = Zt.getInstance(); -class dn extends Error { - constructor(e, n) { - super(n), Error.captureStackTrace && Error.captureStackTrace(this, dn), !n instanceof nt && (this.name = `${e} Error Runtime`); - } -} -class nt extends Error { - constructor(e, ...n) { - super(...n), Error.captureStackTrace && Error.captureStackTrace(this, nt), this.name = `${e} Not Found`; - } -} -const Dt = "mine", kt = "token", Wt = "user-login-intended-url"; -var Le, Ze, ct; -const be = class be { - constructor() { - P(this, Ze, /* @__PURE__ */ new Map()); - P(this, ct, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10)); - v(this, "setPkgVersion", (e) => { - K(this, ct, e); - }); - v(this, "setVendor", (e, n) => d(this, Ze).set(e, new qn(n, async (i, r) => { - var a, s; - if (!(i != null && i.default)) throw "@pkg not found"; - let o = () => r; - switch ("function") { - case typeof (o = (a = i.default) == null ? void 0 : a[`./${r}/index.jsx`]): - case typeof (o = (s = i.default) == null ? void 0 : s[`./${r}/index.js`]): - return o(); - } - throw new nt(r); - }))); - v(this, "getWidgetComponent", async (e) => { - if (!e) throw "getWidgetComponent widget is required"; - if (e != null && e.startsWith("blob:") || e != null && e.startsWith("http:") || e != null && e.startsWith("https:")) return await import(e); - const [, n] = e == null ? void 0 : e.split("@pkg/"); - if (!n) throw new nt(e); - try { - return d(this, Ze).has("pkg") ? await d(this, Ze).get("pkg").get(n) : await import(`${W.appUrl}/api/pkg-import/web?name=${e}&v=${d(this, ct)}`); - } catch (i) { - throw new dn(e, i); - } - }); - v(this, "getRoutes", () => W.get("/api/my-router").then((e) => [...e, { uuid: "data-list-setting", isLayout: !0, uri: "/data-list-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/DataListSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-setting", isLayout: !0, uri: "/grid-layout-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "grid-layout-form-setting", isLayout: !0, uri: "/grid-layout-form-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/GridLayoutFormSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "resource-api-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ResourceApiSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "charts-setting", isLayout: !0, uri: "/resource-api-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ChartsSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "fsm-setting", isLayout: !0, uri: "/fsm-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/FsmSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "component-setting", isLayout: !0, uri: "/component-setting/:category/:categoryUuid", type: "fsdpf-component", component: "@pkg/ff-design/components/ComponentSetting", extra: { layout: "@pkg/ff-design/frameworks/DesignTheme" } }, { uuid: "login", uri: "/login", name: "登录", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/Login" }, { uuid: "not-found", uri: "*", name: "Not Found", type: "fsdpf-component", isLogin: !1, component: "@pkg/ff/components/NotFound" }].map(({ uuid: n, ...i }) => [n, { uuid: n, ...i }])).then((e) => new Map(e))); - v(this, "getMenus", () => W.get("/api/my-menu")); - v(this, "getConfigure", () => W.get("api/init-configure")); - v(this, "getWidgetOperationAuth", () => W.get("/api/init-widget-operation-auth").then((e) => e.reduce((n, { uuid: i, auth: r }) => [...n, [i, r]], []))); - v(this, "getPhoneNumber", (e) => W.get(`/api/user-wx-phone-number/${e}`)); - v(this, "getUserToken", () => { - const e = window.localStorage.getItem(kt); - if (!e) return ""; - const n = e.split("."); - if (!Array.isArray(n) || n.length !== 3) throw "登录令牌无效!"; - const { iat: i } = JSON.parse(window.atob(n[1])); - if (Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3) - i > 2592e3) throw "登录令牌已过期, 请重新登录!"; - return e; - }); - v(this, "checkUserToken", () => { - try { - return !!this.getUserToken(); - } catch { - return !1; - } - }); - v(this, "getUserInfo", (e = !0) => { - var n; - try { - const i = this.getUserToken(); - if (!i) return Promise.resolve(null); - const { iat: r } = JSON.parse(window.atob((n = i == null ? void 0 : i.split(".")) == null ? void 0 : n[1])), { iat: o, ...a } = W.decode(window.localStorage.getItem(Dt) || "", {}); - return o === r ? Promise.resolve(a) : W.get("/api/mine-info").then(({ User: s = null }) => (window.localStorage.setItem(Dt, W.encode({ ...s, iat: r })), s)).catch((s) => (console.error(s), e && ne.error("请登录").then(this.logout), null)); - } catch (i) { - console.error(i), e && ne.error("请登录").then(this.logout); - } - return Promise.resolve(null); - }); - v(this, "login", (e, n, i = {}) => W.post("/api/user-token", { username: e, passwd: Ui.hash(n), platform: "web", ...i }).then(({ token: r }) => (window.localStorage.setItem(kt, r), r)).then(async (r) => (await this.initAppEnv(), r))); - v(this, "setLoginIntendedUrl", (e) => sessionStorage.setItem(Wt, e)); - v(this, "getLoginIntendedUrl", (e = !1) => { - const n = sessionStorage.getItem(Wt); - return e && sessionStorage.removeItem(Wt), n; - }); - v(this, "logout", (e) => (window.localStorage.removeItem(Dt), window.localStorage.removeItem(kt), e == null ? void 0 : e())); - v(this, "initAppEnv", async () => { - const [e, n, i, r] = await Promise.all([this.getWidgetOperationAuth(), this.getRoutes(), this.getMenus(), this.getConfigure()]); - return Jn.init(e), qe.init(r), oe.init(n, i), Et.init(qe.get("Common.ICONFONT")), { widgetOperationAuth: e, routes: n, menus: i, configures: r }; - }); - if (d(be, Le)) return d(be, Le); - } -}; -Le = new WeakMap(), Ze = new WeakMap(), ct = new WeakMap(), P(be, Le, null), v(be, "getInstance", () => (d(be, Le) || K(be, Le, new be()), d(be, Le))); -let en = be; -const se = en.getInstance(), co = x.createContext({ user: {}, initUser: () => { -}, initUserComplete: !1 }), uo = x.createContext({ set: () => { -}, get: () => { -}, assign: () => { -}, currentRoute: () => { -} }), un = (t) => { - if (!t) return !1; - if (t.prototype instanceof x.Component || t.$$typeof) return !0; - if (typeof t == "function") { - const e = t.displayName || t.name; - return !e || /^[A-Z]/.test(e); - } - return !1; -}, po = (t, e) => { - if (!t || typeof window > "u") return; - let n = document.querySelector(`style[ff-style-token="${e}"]`); - return n ? (n.innerHTML = t, t) : (n = document.createElement("style"), n.setAttribute("ff-style-token", e), n.setAttribute("type", "text/css"), n.innerHTML = t, document.head.appendChild(n), t); -}, go = Object.freeze(Object.defineProperty({ __proto__: null, AppContext: co, AppGlobalParamsContext: uo, cache: qn, configure: qe, default: se, func: Me, http: W, insertStyle: po, isReactComponent: un, route: oe }, Symbol.toStringTag, { value: "Module" })); -var ve, et, Ne, ke, Se, re, te, Y, xe, dt, ut, pt, gt, Tt, ht; -const pn = class pn { - constructor(e, n = "/") { - P(this, ve, "/"); - P(this, et, /* @__PURE__ */ new Set()); - P(this, Ne, (e) => { - for (const n of d(this, et)) try { - n(e); - } catch (i) { - console.error("Error in VirtualFS event listener:", i); - } - }); - P(this, ke, (e) => { - const n = Date.now(); - if (e && (e.lastModified = n), d(this, ve) != "/") { - const i = d(this, Y).call(this, d(this, ve)); - i && (i.lastModified = n); - } - this.root.lastModified = n; - }); - P(this, Se, (e) => { - let n = he.normalize(e); - return n.startsWith("/") || (n = "/" + n), n.length > 1 && n.endsWith("/") && (n = n.slice(0, -1)), n; - }); - P(this, re, (e) => { - const n = he.join(d(this, ve), e); - return d(this, Se).call(this, n); - }); - P(this, te, (e) => { - if (!e || typeof e != "string") return !1; - const n = d(this, Se).call(this, e); - return !n.includes("..") && n.startsWith("/"); - }); - P(this, Y, (e) => { - var o; - const n = d(this, Se).call(this, e); - if (n === "/") return this.root; - const i = n.split("/").filter((a) => a); - let r = this.root; - for (const a of i) { - 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; - }); - P(this, xe, (e) => { - const n = d(this, Se).call(this, e), i = he.basename(n), r = he.dirname(n); - return { parent: d(this, Y).call(this, r), name: i }; - }); - P(this, dt, (e, n, i) => i === !1 ? e : i === "root" ? e.map((r) => he.join(n, r)) : i === !0 || i === "working" ? e.map((r) => he.relative(d(this, ve), he.join(n, r))) : e); - P(this, ut, async (e, n, i, r = "") => { - const o = [], a = d(this, Y).call(this, e); - if (!a || a.type !== "dir") return o; - const s = a.children; - for (const l of s) { - const c = l.name, u = e === "/" ? `/${c}` : `${e}/${c}`, p = r ? `${r}/${c}` : c; - try { - if (l.type === "file") n(i ? p : c) && o.push(p); - else if (l.type === "dir" && i) { - const m = await d(this, ut).call(this, u, n, i, p); - o.push(...m); - } - } catch { - continue; - } - } - return o; - }); - P(this, pt, async (e, n, i, r = "") => { - const o = [], a = Array.isArray(n) ? n : [n], s = d(this, Y).call(this, e); - if (!s || s.type !== "dir") return o; - if (!i) { - for (const c of a) if (d(this, gt).call(this, c)) { - const u = await d(this, Tt).call(this, e, c); - o.push(...u); - } else { - const u = he.join(e, c), p = d(this, Se).call(this, u); - d(this, Y).call(this, p) && o.push(c); - } - return o; - } - const l = s.children; - for (const c of l) { - const u = c.name, p = e === "/" ? `/${u}` : `${e}/${u}`, m = r ? `${r}/${u}` : u; - try { - if (c.type === "file") for (const g of a) { - let w = !1; - if (w = d(this, gt).call(this, g) ? d(this, ht).call(this, u, g) : u === g, w) { - o.push(m); - break; - } - } - else if (c.type === "dir") { - const g = await d(this, pt).call(this, p, n, i, m); - o.push(...g); - } - } catch { - continue; - } - } - return o; - }); - P(this, gt, (e) => /[*?[\]{}]/.test(e)); - P(this, Tt, async (e, n) => { - const i = [], r = d(this, Y).call(this, e); - if (!r || r.type !== "dir") return i; - const o = r.children.map((a) => a.name); - for (const a of o) d(this, ht).call(this, a, n) && i.push(a); - return i; - }); - P(this, ht, (e, n) => { - const i = n.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".").replace(/\{([^}]+)\}/g, (r, o) => "(" + o.split(",").join("|") + ")"); - return new RegExp(`^${i}$`).test(e); - }); - var i, r, o; - K(this, ve, n), this.root = { name: "/", type: "dir", children: [], lastModified: Date.now() }, Array.isArray(e) ? this.root.children = e : e && typeof e == "object" && (e.name && e.name !== "/" ? this.root.children.push(e) : (this.root = e, (i = this.root).name ?? (i.name = "/"), (r = this.root).children ?? (r.children = []), (o = this.root).lastModified ?? (o.lastModified = Date.now()))); - } - async stat(e) { - const n = d(this, re).call(this, e); - if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = d(this, Y).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, stat '${e}'`); - return { isFile: () => i.type === "file", isDirectory: () => i.type === "dir", lastModified: i.lastModified }; - } - async dir(e) { - const n = d(this, re).call(this, e); - if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = d(this, Y).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, scandir '${e}'`); - if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory, scandir '${e}'`); - return i.children.map((r) => r.name); - } - async readFile(e) { - const n = d(this, re).call(this, e); - if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = d(this, Y).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (i.type !== "file") throw new Error("EISDIR: illegal operation on a directory, read"); - return i.content || ""; - } - async writeFile(e, n) { - const i = d(this, re).call(this, e); - if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: o } = d(this, xe).call(this, i); - if (!r) throw new Error(`ENOENT: no such file or directory, open '${e}'`); - if (r.type !== "dir") throw new Error("ENOTDIR: not a directory"); - const a = r.children.findIndex((c) => c.name === o), s = a >= 0, l = { name: o, type: "file", content: n, lastModified: Date.now() }; - s ? r.children[a] = l : r.children.push(l), d(this, ke).call(this, r), d(this, Ne).call(this, { action: s ? "update" : "create", path: i, type: "file", timestamp: Date.now() }); - } - async mkdir(e, n = {}) { - const i = d(this, re).call(this, e); - if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { recursive: r } = n; - if (r) { - const o = i.split("/").filter((s) => s); - let a = "/"; - for (const s of o) - if (a = he.join(a, s), !d(this, Y).call(this, a)) { - const { parent: l, name: c } = d(this, xe).call(this, a); - if (l && l.type === "dir") { - const u = { name: c, type: "dir", children: [], lastModified: Date.now() }; - l.children.push(u), d(this, ke).call(this, l), d(this, Ne).call(this, { action: "create", path: d(this, Se).call(this, a), type: "dir", timestamp: Date.now() }); - } - } - } else { - const { parent: o, name: a } = d(this, xe).call(this, i); - if (!o) throw new Error(`ENOENT: no such file or directory, mkdir '${e}'`); - if (o.type !== "dir") throw new Error("ENOTDIR: not a directory"); - if (o.children.find((l) => l.name === a)) throw new Error(`EEXIST: file already exists, mkdir '${e}'`); - const s = { name: a, type: "dir", children: [], lastModified: Date.now() }; - o.children.push(s), d(this, ke).call(this, o), d(this, Ne).call(this, { action: "create", path: i, type: "dir", timestamp: Date.now() }); - } - } - async unlink(e) { - const n = d(this, re).call(this, e); - if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: i, name: r } = d(this, xe).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - const o = i.children.findIndex((a) => a.name === r); - if (o < 0) throw new Error(`ENOENT: no such file or directory, unlink '${e}'`); - if (i.children[o].type !== "file") throw new Error(`EISDIR: illegal operation on a directory, unlink '${e}'`); - i.children.splice(o, 1), d(this, ke).call(this, i), d(this, Ne).call(this, { action: "delete", path: n, type: "file", timestamp: Date.now() }); - } - async rmdir(e, n = {}) { - const i = d(this, re).call(this, e); - if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - const { parent: r, name: o } = d(this, xe).call(this, i); - 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 (!n.recursive && s.children.length > 0) throw new Error(`ENOTEMPTY: directory not empty, rmdir '${e}'`); - r.children.splice(a, 1), d(this, ke).call(this, r), d(this, Ne).call(this, { action: "delete", path: i, type: "dir", timestamp: Date.now() }); - } - async rename(e, n) { - const i = d(this, re).call(this, e), r = d(this, re).call(this, n); - if (!d(this, te).call(this, i)) throw new Error(`EINVAL: invalid path '${e}'`); - if (!d(this, te).call(this, r)) throw new Error(`EINVAL: invalid path '${n}'`); - if (!d(this, Y).call(this, i)) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); - const { parent: o, name: a } = d(this, xe).call(this, i), { parent: s, name: l } = d(this, xe).call(this, r); - if (!s) throw new Error(`ENOENT: no such file or directory, rename '${e}' -> '${n}'`); - if (d(this, Y).call(this, r)) throw new Error(`EEXIST: file already exists, rename '${e}' -> '${n}'`); - const c = o.children.findIndex((p) => p.name === a), u = { ...o.children[c], name: l, lastModified: Date.now() }; - o.children.splice(c, 1), s.children.push(u), d(this, ke).call(this, o), o !== s && d(this, ke).call(this, s), d(this, Ne).call(this, { action: "rename", path: r, oldPath: i, type: u.type, timestamp: Date.now() }); - } - async exists(e) { - const n = d(this, re).call(this, e); - return d(this, te).call(this, n) ? d(this, Y).call(this, n) !== null : !1; - } - getLastModified() { - return this.root.lastModified; - } - subscribe(e) { - if (typeof e != "function") throw new Error("Callback must be a function"); - return d(this, et).add(e), () => { - d(this, et).delete(e); - }; - } - getWorkingDirectory() { - return d(this, ve); - } - scope(e = "/") { - const n = d(this, Se).call(this, e); - if (!d(this, te).call(this, n)) throw new Error(`EINVAL: invalid path '${e}'`); - const i = d(this, Y).call(this, n); - if (!i) throw new Error(`ENOENT: no such file or directory '${e}'`); - if (i.type !== "dir") throw new Error(`ENOTDIR: not a directory '${e}'`); - return i.children ?? (i.children = []), i.lastModified ?? (i.lastModified = Date.now()), new pn(this.root, n); - } - async findFiles(e, n, i = {}) { - const r = d(this, re).call(this, e); - if (!d(this, te).call(this, r)) throw new Error(`EINVAL: invalid path '${e}'`); - const o = d(this, Y).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 } = i; - if (typeof n == "function") { - const c = await d(this, ut).call(this, r, n, a); - return d(this, dt).call(this, c, r, s); - } - const l = await d(this, pt).call(this, r, n, a); - return d(this, dt).call(this, l, r, s); - } -}; -ve = new WeakMap(), et = new WeakMap(), Ne = new WeakMap(), ke = new WeakMap(), Se = new WeakMap(), re = new WeakMap(), te = new WeakMap(), Y = new WeakMap(), xe = new WeakMap(), dt = new WeakMap(), ut = new WeakMap(), pt = new WeakMap(), gt = new WeakMap(), Tt = new WeakMap(), ht = new WeakMap(); -let Dn = pn; -const ho = async (t, e = "/", n = "") => { - try { - const i = await t.stat(e), r = e === "/" ? "/" : he.basename(e), o = { title: r, key: n ? `${n}${e}` : e, isLeaf: i.isFile() }; - if (i.isDirectory()) { - const a = await t.dir(e); - if (a.length > 0) { - o.children = []; - const s = [], l = []; - for (const c of a) { - const u = e === "/" ? `/${c}` : `${e}/${c}`; - try { - (await t.stat(u)).isDirectory() ? s.push(c) : l.push(c); - } catch (p) { - console.warn(`Failed to stat ${u}:`, p.message); - } - } - s.sort(), l.sort(); - for (const c of [...s, ...l]) { - const u = e === "/" ? `/${c}` : `${e}/${c}`; - try { - const p = await ho(t, u, n); - o.children.push(p); - } catch (p) { - console.warn(`Failed to process ${u}:`, p.message); - } - } - } - } - return o; - } catch { - return null; - } -}; -export { - Jo as $, - pr as A, - Lo as B, - Mo as C, - xt as D, - Yn as E, - Jt as F, - Wo as G, - $r as H, - gr as I, - hr as J, - Rr as K, - Fr as L, - Bo as M, - zo as N, - pe as O, - Ar as P, - Ot as Q, - ti as R, - si as S, - Mt as T, - Uo as U, - qo as V, - Ko as W, - Ho as X, - Ir as Y, - Lr as Z, - Mr as _, - _n as a, - Vr as a0, - Rt as a1, - _o as a2, - ft as a3, - Ft as a4, - Go as a5, - Yo as a6, - Dr as a7, - ui as a8, - _r as a9, - qn as aA, - qe as aB, - Me as aC, - oe as aD, - co as aE, - uo as aF, - Dn as aG, - ho as aH, - lo as aI, - cn as aa, - ln as ab, - pi as ac, - Wr as ad, - Br as ae, - zr as af, - Ur as ag, - qr as ah, - Kr as ai, - Xo as aj, - Et as ak, - R as al, - Jn as am, - Zr as an, - ie as ao, - mt as ap, - Kn as aq, - X as ar, - ne as as, - jo as at, - Ao as au, - Io as av, - se as aw, - un as ax, - po as ay, - W as az, - Xn as b, - Vo as c, - Qn as d, - an as e, - ni as f, - lr as g, - oi as h, - Nr as i, - ri as j, - vr as k, - Do as l, - ii as m, - ei as n, - Zn as o, - Sr as p, - kr as q, - br as r, - sn as s, - le as t, - Pr as u, - Er as v, - Or as w, - mr as x, - yr as y, - ur as z -}; diff --git a/dist/common/vender-C5RbewOc.js b/dist/common/vender-C5RbewOc.js new file mode 100644 index 0000000..2a22577 --- /dev/null +++ b/dist/common/vender-C5RbewOc.js @@ -0,0 +1,2041 @@ +import ze from "react"; +function Ve(t, e) { + return function() { + return t.apply(e, arguments); + }; +} +const { toString: _r } = Object.prototype, { getPrototypeOf: ne } = Object, vt = (xt = /* @__PURE__ */ Object.create(null), (t) => { + const e = _r.call(t); + return xt[e] || (xt[e] = e.slice(8, -1).toLowerCase()); +}); +var xt; +const D = (t) => (t = t.toLowerCase(), (e) => vt(e) === t), St = (t) => (e) => typeof e === t, { isArray: Z } = Array, st = St("undefined"), ce = D("ArrayBuffer"), Pr = St("string"), U = St("function"), ue = St("number"), ft = (t) => t !== null && typeof t == "object", ht = (t) => { + if (vt(t) !== "object") return !1; + const e = ne(t); + return !(e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null || Symbol.toStringTag in t || Symbol.iterator in t); +}, kr = D("Date"), jr = D("File"), Nr = D("Blob"), Mr = D("FileList"), Ur = D("URLSearchParams"), [Br, Lr, Dr, Fr] = ["ReadableStream", "Request", "Response", "Headers"].map(D); +function it(t, e, { allOwnKeys: r = !1 } = {}) { + if (t == null) return; + let n, o; + if (typeof t != "object" && (t = [t]), Z(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 g; + for (n = 0; n < a; n++) g = c[n], e.call(null, t[g], g, t); + } +} +function le(t, e) { + e = e.toLowerCase(); + const r = Object.keys(t); + let n, o = r.length; + 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, fe = (t) => !st(t) && t !== Ke, Ir = (Tt = typeof Uint8Array < "u" && ne(Uint8Array), (t) => Tt && t instanceof Tt); +var Tt; +const qr = D("HTMLFormElement"), he = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Wr = D("RegExp"), de = (t, e) => { + const r = Object.getOwnPropertyDescriptors(t), n = {}; + it(r, (o, c) => { + let a; + (a = e(o, c, t)) !== !1 && (n[c] = a || o); + }), Object.defineProperties(t, n); +}, _t = "abcdefghijklmnopqrstuvwxyz", pe = "0123456789", ye = { DIGIT: pe, ALPHA: _t, ALPHA_DIGIT: _t + _t.toUpperCase() + pe }, $r = D("AsyncFunction"), v = { isArray: Z, isArrayBuffer: ce, isBuffer: function(t) { + return t !== null && !st(t) && t.constructor !== null && !st(t.constructor) && U(t.constructor.isBuffer) && t.constructor.isBuffer(t); +}, isFormData: (t) => { + let e; + return t && (typeof FormData == "function" && t instanceof FormData || U(t.append) && ((e = vt(t)) === "formdata" || e === "object" && U(t.toString) && t.toString() === "[object FormData]")); +}, isArrayBufferView: function(t) { + let e; + return e = typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer && ce(t.buffer), e; +}, isString: Pr, isNumber: ue, isBoolean: (t) => t === !0 || t === !1, isObject: ft, isPlainObject: ht, isReadableStream: Br, isRequest: Lr, isResponse: Dr, isHeaders: Fr, isUndefined: st, isDate: kr, isFile: jr, isBlob: Nr, isRegExp: Wr, isFunction: U, isStream: (t) => ft(t) && U(t.pipe), isURLSearchParams: Ur, isTypedArray: Ir, isFileList: Mr, forEach: it, merge: function t() { + const { caseless: e } = fe(this) && this || {}, r = {}, n = (o, c) => { + const a = e && le(r, c) || c; + ht(r[a]) && ht(o) ? r[a] = t(r[a], o) : ht(o) ? r[a] = t({}, o) : Z(o) ? r[a] = o.slice() : r[a] = o; + }; + for (let o = 0, c = arguments.length; o < c; o++) arguments[o] && it(arguments[o], n); + return r; +}, extend: (t, e, r, { allOwnKeys: n } = {}) => (it(e, (o, c) => { + r && U(o) ? t[c] = Ve(o, r) : t[c] = 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 g = {}; + 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) || g[a] || (e[a] = t[a], g[a] = !0); + t = r !== !1 && ne(t); + } while (t && (!r || r(t, e)) && t !== Object.prototype); + return e; +}, kindOf: vt, kindOfTest: D, endsWith: (t, e, r) => { + t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length; + const n = t.indexOf(e, r); + return n !== -1 && n === r; +}, toArray: (t) => { + if (!t) return null; + if (Z(t)) return t; + let e = t.length; + if (!ue(e)) return null; + const r = new Array(e); + for (; e-- > 0; ) r[e] = t[e]; + return r; +}, forEachEntry: (t, e) => { + const r = (t && t[Symbol.iterator]).call(t); + let n; + for (; (n = r.next()) && !n.done; ) { + const o = n.value; + e.call(t, o[0], o[1]); + } +}, matchAll: (t, e) => { + let r; + const n = []; + for (; (r = t.exec(e)) !== null; ) n.push(r); + return n; +}, isHTMLForm: qr, hasOwnProperty: he, hasOwnProp: he, reduceDescriptors: de, freezeMethods: (t) => { + de(t, (e, r) => { + if (U(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1) return !1; + const n = t[r]; + U(n) && (e.enumerable = !1, "writable" in e ? e.writable = !1 : e.set || (e.set = () => { + throw Error("Can not rewrite read-only method '" + r + "'"); + })); + }); +}, toObjectSet: (t, e) => { + const r = {}, n = (o) => { + o.forEach((c) => { + r[c] = !0; + }); + }; + return Z(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: le, global: Ke, isContextDefined: fe, ALPHABET: ye, generateString: (t = 16, e = ye.ALPHA_DIGIT) => { + let r = ""; + const { length: n } = e; + for (; t--; ) r += e[Math.random() * n | 0]; + return r; +}, isSpecCompliantForm: function(t) { + return !!(t && U(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]); +}, toJSONObject: (t) => { + const e = new Array(10), r = (n, o) => { + if (ft(n)) { + if (e.indexOf(n) >= 0) return; + if (!("toJSON" in n)) { + e[o] = n; + const c = Z(n) ? [] : {}; + return it(n, (a, g) => { + const b = r(a, o + 1); + !st(b) && (c[g] = b); + }), e[o] = void 0, c; + } + } + return n; + }; + return r(t, 0); +}, isAsyncFn: $r, isThenable: (t) => t && (ft(t) || U(t)) && U(t.then) && U(t.catch) }; +function R(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); +} +v.inherits(R, Error, { toJSON: function() { + 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: v.toJSONObject(this.config), code: this.code, status: this.response && this.response.status ? this.response.status : null }; +} }); +const me = R.prototype, ge = {}; +["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) => { + ge[t] = { value: t }; +}), Object.defineProperties(R, ge), Object.defineProperty(me, "isAxiosError", { value: !0 }), R.from = (t, e, r, n, o, c) => { + const a = Object.create(me); + return v.toFlatObject(t, a, function(g) { + return g !== Error.prototype; + }, (g) => g !== "isAxiosError"), R.call(a, t.message, e, r, n, o), a.cause = t, a.name = t.name, c && Object.assign(a, c), a; +}; +function Pt(t) { + return v.isPlainObject(t) || v.isArray(t); +} +function Ge(t) { + return v.endsWith(t, "[]") ? t.slice(0, -2) : t; +} +function be(t, e, r) { + return t ? t.concat(e).map(function(n, o) { + return n = Ge(n), !r && o ? "[" + n + "]" : n; + }).join(r ? "." : "") : e; +} +const Hr = v.toFlatObject(v, {}, null, function(t) { + return /^is[A-Z]/.test(t); +}); +function Ot(t, e, r) { + if (!v.isObject(t)) throw new TypeError("target must be an object"); + e = e || new FormData(); + const n = (r = v.toFlatObject(r, { metaTokens: !0, dots: !1, indexes: !1 }, !1, function(w, O) { + return !v.isUndefined(O[w]); + })).metaTokens, o = r.visitor || y, c = r.dots, a = r.indexes, g = (r.Blob || typeof Blob < "u" && Blob) && v.isSpecCompliantForm(e); + if (!v.isFunction(o)) throw new TypeError("visitor must be a function"); + function b(w) { + if (w === null) return ""; + if (v.isDate(w)) return w.toISOString(); + if (!g && v.isBlob(w)) throw new R("Blob is not supported. Use a Buffer instead."); + return v.isArrayBuffer(w) || v.isTypedArray(w) ? g && typeof Blob == "function" ? new Blob([w]) : Buffer.from(w) : w; + } + function y(w, O, m) { + let f = w; + if (w && !m && typeof w == "object") { + if (v.endsWith(O, "{}")) O = n ? O : O.slice(0, -2), w = JSON.stringify(w); + else if (v.isArray(w) && function(i) { + return v.isArray(i) && !i.some(Pt); + }(w) || (v.isFileList(w) || v.endsWith(O, "[]")) && (f = v.toArray(w))) return O = Ge(O), f.forEach(function(i, u) { + !v.isUndefined(i) && i !== null && e.append(a === !0 ? be([O], u, c) : a === null ? O : O + "[]", b(i)); + }), !1; + } + return !!Pt(w) || (e.append(be(m, O, c), b(w)), !1); + } + const s = [], d = Object.assign(Hr, { defaultVisitor: y, convertValue: b, isVisitable: Pt }); + if (!v.isObject(t)) throw new TypeError("data must be an object"); + return function w(O, m) { + if (!v.isUndefined(O)) { + if (s.indexOf(O) !== -1) throw Error("Circular reference detected in " + m.join(".")); + s.push(O), v.forEach(O, function(f, i) { + (!(v.isUndefined(f) || f === null) && o.call(e, f, v.isString(i) ? i.trim() : i, m, d)) === !0 && w(f, m ? m.concat(i) : [i]); + }), s.pop(); + } + }(t), e; +} +function we(t) { + const e = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; + return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) { + return e[r]; + }); +} +function oe(t, e) { + this._pairs = [], t && Ot(t, this, e); +} +const ve = oe.prototype; +function Jr(t) { + return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); +} +function Qe(t, e, r) { + if (!e) return t; + const n = r && r.encode || Jr, o = r && r.serialize; + let c; + if (c = o ? o(e, r) : v.isURLSearchParams(e) ? e.toString() : new oe(e, r).toString(n), c) { + const a = t.indexOf("#"); + a !== -1 && (t = t.slice(0, a)), t += (t.indexOf("?") === -1 ? "?" : "&") + c; + } + return t; +} +ve.append = function(t, e) { + this._pairs.push([t, e]); +}, ve.toString = function(t) { + const e = t ? function(r) { + return t.call(this, r, we); + } : we; + return this._pairs.map(function(r) { + return e(r[0]) + "=" + e(r[1]); + }, "").join("&"); +}; +class Oe { + constructor() { + this.handlers = []; + } + use(e, r, n) { + return this.handlers.push({ fulfilled: e, rejected: r, synchronous: !!n && n.synchronous, runWhen: n ? n.runWhen : null }), this.handlers.length - 1; + } + eject(e) { + this.handlers[e] && (this.handlers[e] = null); + } + clear() { + this.handlers && (this.handlers = []); + } + forEach(e) { + v.forEach(this.handlers, function(r) { + r !== null && e(r); + }); + } +} +const Xe = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, zr = { isBrowser: !0, classes: { URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : oe, FormData: typeof FormData < "u" ? FormData : null, Blob: typeof Blob < "u" ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, se = typeof window < "u" && typeof document < "u", Vr = (Ee = typeof navigator < "u" && navigator.product, se && ["ReactNative", "NativeScript", "NS"].indexOf(Ee) < 0); +var Ee; +const Kr = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Gr = se && window.location.href || "http://localhost", L = { ...Object.freeze(Object.defineProperty({ __proto__: null, hasBrowserEnv: se, hasStandardBrowserEnv: Vr, hasStandardBrowserWebWorkerEnv: Kr, origin: Gr }, Symbol.toStringTag, { value: "Module" })), ...zr }; +function Ze(t) { + function e(r, n, o, c) { + let a = r[c++]; + if (a === "__proto__") return !0; + const g = Number.isFinite(+a), b = c >= r.length; + return a = !a && v.isArray(o) ? o.length : a, b ? (v.hasOwnProp(o, a) ? o[a] = [o[a], n] : o[a] = n, !g) : (o[a] && v.isObject(o[a]) || (o[a] = []), e(r, n, o[a], c) && v.isArray(o[a]) && (o[a] = function(y) { + const s = {}, d = Object.keys(y); + let w; + const O = d.length; + let m; + for (w = 0; w < O; w++) m = d[w], s[m] = y[m]; + return s; + }(o[a])), !g); + } + 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]); + }(n), o, r, 0); + }), r; + } + return null; +} +const ut = { transitional: Xe, 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(Ze(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; + if (o) { + if (r.indexOf("application/x-www-form-urlencoded") > -1) return function(a, g) { + return Ot(a, new L.classes.URLSearchParams(), Object.assign({ visitor: function(b, y, s, d) { + return L.isNode && v.isBuffer(b) ? (this.append(y, b.toString("base64")), !1) : d.defaultVisitor.apply(this, arguments); + } }, g)); + }(t, this.formSerializer).toString(); + if ((c = v.isFileList(t)) || r.indexOf("multipart/form-data") > -1) { + const a = this.env && this.env.FormData; + return Ot(c ? { "files[]": t } : t, a && new a(), this.formSerializer); + } + } + return o || n ? (e.setContentType("application/json", !1), function(a, g, b) { + if (v.isString(a)) try { + return (g || JSON.parse)(a), v.trim(a); + } catch (y) { + if (y.name !== "SyntaxError") throw y; + } + return (b || JSON.stringify)(a); + }(t)) : t; +}], transformResponse: [function(t) { + const e = this.transitional || ut.transitional, r = e && e.forcedJSONParsing, n = this.responseType === "json"; + if (v.isResponse(t) || v.isReadableStream(t)) return t; + if (t && v.isString(t) && (r && !this.responseType || n)) { + const o = !(e && e.silentJSONParsing) && n; + try { + return JSON.parse(t); + } catch (c) { + if (o) + throw c.name === "SyntaxError" ? R.from(c, R.ERR_BAD_RESPONSE, this, null, this.response) : c; + } + } + return t; +}], timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", maxContentLength: -1, maxBodyLength: -1, env: { FormData: L.classes.FormData, Blob: L.classes.Blob }, validateStatus: function(t) { + return t >= 200 && t < 300; +}, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; +v.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => { + ut.headers[t] = {}; +}); +const Qr = 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"]), Ae = Symbol("internals"); +function nt(t) { + return t && String(t).trim().toLowerCase(); +} +function dt(t) { + return t === !1 || t == null ? t : v.isArray(t) ? t.map(dt) : String(t); +} +function kt(t, e, r, n, o) { + return v.isFunction(n) ? n.call(this, e, r) : (o && (e = r), v.isString(e) ? v.isString(n) ? e.indexOf(n) !== -1 : v.isRegExp(n) ? n.test(e) : void 0 : void 0); +} +let M = class { + constructor(t) { + t && this.set(t); + } + set(t, e, r) { + const n = this; + function o(a, g, b) { + const y = nt(g); + if (!y) throw new Error("header name must be a non-empty string"); + const s = v.findKey(n, y); + (!s || n[s] === void 0 || b === !0 || b === void 0 && n[s] !== !1) && (n[s || g] = dt(a)); + } + const c = (a, g) => v.forEach(a, (b, y) => o(b, y, g)); + 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 g = {}; + let b, y, s; + return a && a.split(` +`).forEach(function(d) { + s = d.indexOf(":"), b = d.substring(0, s).trim().toLowerCase(), y = d.substring(s + 1).trim(), !b || g[b] && Qr[b] || (b === "set-cookie" ? g[b] ? g[b].push(y) : g[b] = [y] : g[b] = g[b] ? g[b] + ", " + y : y); + }), g; + })(t), e); + else if (v.isHeaders(t)) for (const [a, g] of t.entries()) o(g, a, r); + else t != null && o(e, t, r); + return this; + } + get(t, e) { + if (t = nt(t)) { + const r = v.findKey(this, t); + if (r) { + 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 g; + for (; g = a.exec(o); ) c[g[1]] = g[2]; + return c; + }(n); + if (v.isFunction(e)) return e.call(this, n, r); + if (v.isRegExp(e)) return e.exec(n); + throw new TypeError("parser must be boolean|regexp|function"); + } + } + } + has(t, e) { + if (t = nt(t)) { + const r = v.findKey(this, t); + return !(!r || this[r] === void 0 || e && !kt(0, this[r], r, e)); + } + return !1; + } + delete(t, e) { + const r = this; + let n = !1; + function o(c) { + if (c = nt(c)) { + const a = v.findKey(r, c); + !a || e && !kt(0, r[a], a, e) || (delete r[a], n = !0); + } + } + return v.isArray(t) ? t.forEach(o) : o(t), n; + } + clear(t) { + const e = Object.keys(this); + let r = e.length, n = !1; + for (; r--; ) { + const o = e[r]; + t && !kt(0, this[o], o, t, !0) || (delete this[o], n = !0); + } + return n; + } + normalize(t) { + const e = this, r = {}; + return v.forEach(this, (n, o) => { + const c = v.findKey(r, o); + if (c) return e[c] = dt(n), void delete e[o]; + const a = t ? function(g) { + return g.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (b, y, s) => y.toUpperCase() + s); + }(o) : String(o).trim(); + a !== o && delete e[o], e[a] = dt(n), r[a] = !0; + }), this; + } + concat(...t) { + return this.constructor.concat(this, ...t); + } + toJSON(t) { + const e = /* @__PURE__ */ Object.create(null); + return v.forEach(this, (r, n) => { + r != null && r !== !1 && (e[n] = t && v.isArray(r) ? r.join(", ") : r); + }), e; + } + [Symbol.iterator]() { + return Object.entries(this.toJSON())[Symbol.iterator](); + } + toString() { + return Object.entries(this.toJSON()).map(([t, e]) => t + ": " + e).join(` +`); + } + get [Symbol.toStringTag]() { + return "AxiosHeaders"; + } + static from(t) { + return t instanceof this ? t : new this(t); + } + static concat(t, ...e) { + const r = new this(t); + return e.forEach((n) => r.set(n)), r; + } + static accessor(t) { + const e = (this[Ae] = this[Ae] = { accessors: {} }).accessors, r = this.prototype; + function n(o) { + const c = nt(o); + e[c] || (function(a, g) { + const b = v.toCamelCase(" " + g); + ["get", "set", "has"].forEach((y) => { + Object.defineProperty(a, y + b, { value: function(s, d, w) { + return this[y].call(this, g, s, d, w); + }, configurable: !0 }); + }); + }(r, o), e[c] = !0); + } + return v.isArray(t) ? t.forEach(n) : n(t), this; + } +}; +function jt(t, e) { + const r = this || ut, n = e || r, o = M.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; +} +function Ye(t) { + return !(!t || !t.__CANCEL__); +} +function rt(t, e, r) { + R.call(this, t ?? "canceled", R.ERR_CANCELED, e, r), this.name = "CanceledError"; +} +function tr(t, e, r) { + const n = r.config.validateStatus; + r.status && n && !n(r.status) ? e(new R("Request failed with status code " + r.status, [R.ERR_BAD_REQUEST, R.ERR_BAD_RESPONSE][Math.floor(r.status / 100) - 4], r.config, r.request, r)) : t(r); +} +M.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]), v.reduceDescriptors(M.prototype, ({ value: t }, e) => { + let r = e[0].toUpperCase() + e.slice(1); + return { get: () => t, set(n) { + this[r] = n; + } }; +}), v.freezeMethods(M), v.inherits(rt, R, { __CANCEL__: !0 }); +const Et = (t, e, r = 3) => { + let n = 0; + const o = function(c, a) { + c = c || 10; + const g = new Array(c), b = new Array(c); + let y, s = 0, d = 0; + return a = a !== void 0 ? a : 1e3, function(w) { + const O = Date.now(), m = b[d]; + y || (y = O), g[s] = w, b[s] = O; + let f = d, i = 0; + for (; f !== s; ) i += g[f++], f %= c; + if (s = (s + 1) % c, s === d && (d = (d + 1) % c), O - y < a) return; + const u = m && O - m; + return u ? Math.round(1e3 * i / u) : void 0; + }; + }(50, 250); + return function(c, a) { + let g = 0; + const b = 1e3 / a; + let y = null; + return function() { + const s = this === !0, d = Date.now(); + if (s || d - g > b) return y && (clearTimeout(y), y = null), g = d, c.apply(null, arguments); + y || (y = setTimeout(() => (y = null, g = Date.now(), c.apply(null, arguments)), b - (d - g))); + }; + }((c) => { + const a = c.loaded, g = c.lengthComputable ? c.total : void 0, b = a - n, y = o(b); + n = a; + const s = { loaded: a, total: g, progress: g ? a / g : void 0, bytes: b, rate: y || void 0, estimated: y && g && a <= g ? (g - a) / y : void 0, event: c, lengthComputable: g != null }; + s[e ? "download" : "upload"] = !0, t(s); + }, r); +}, Xr = L.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 }; + } + 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; + }; +}() : function() { + return !0; +}, Zr = L.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("; "); +}, read(t) { + const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)")); + return e ? decodeURIComponent(e[3]) : null; +}, remove(t) { + this.write(t, "", Date.now() - 864e5); +} } : { write() { +}, read: () => null, remove() { +} }; +function er(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; +} +const Se = (t) => t instanceof M ? { ...t } : t; +function X(t, e) { + e = e || {}; + const r = {}; + function n(y, s, d) { + return v.isPlainObject(y) && v.isPlainObject(s) ? v.merge.call({ caseless: d }, y, s) : v.isPlainObject(s) ? v.merge({}, s) : v.isArray(s) ? s.slice() : s; + } + function o(y, s, d) { + return v.isUndefined(s) ? v.isUndefined(y) ? void 0 : n(void 0, y, d) : n(y, s, d); + } + function c(y, s) { + if (!v.isUndefined(s)) return n(void 0, s); + } + function a(y, s) { + return v.isUndefined(s) ? v.isUndefined(y) ? void 0 : n(void 0, y) : n(void 0, s); + } + function g(y, s, d) { + return d in e ? n(y, s) : d in t ? n(void 0, y) : void 0; + } + const b = { 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: g, headers: (y, s) => o(Se(y), Se(s), !0) }; + return v.forEach(Object.keys(Object.assign({}, t, e)), function(y) { + const s = b[y] || o, d = s(t[y], e[y], y); + v.isUndefined(d) && s !== g || (r[y] = d); + }), r; +} +const rr = (t) => { + const e = X({}, t); + let r, { data: n, withXSRFToken: o, xsrfHeaderName: c, xsrfCookieName: a, headers: g, auth: b } = e; + if (e.headers = g = M.from(g), e.url = Qe(er(e.baseURL, e.url), t.params, t.paramsSerializer), b && g.set("Authorization", "Basic " + btoa((b.username || "") + ":" + (b.password ? unescape(encodeURIComponent(b.password)) : ""))), v.isFormData(n)) { + if (L.hasStandardBrowserEnv || L.hasStandardBrowserWebWorkerEnv) g.setContentType(void 0); + else if ((r = g.getContentType()) !== !1) { + const [y, ...s] = r ? r.split(";").map((d) => d.trim()).filter(Boolean) : []; + g.setContentType([y || "multipart/form-data", ...s].join("; ")); + } + } + if (L.hasStandardBrowserEnv && (o && v.isFunction(o) && (o = o(e)), o || o !== !1 && Xr(e.url))) { + const y = c && a && Zr.read(a); + y && g.set(c, y); + } + return e; +}, Yr = typeof XMLHttpRequest < "u" && function(t) { + return new Promise(function(e, r) { + const n = rr(t); + let o = n.data; + const c = M.from(n.headers).normalize(); + let a, { responseType: g } = n; + function b() { + n.cancelToken && n.cancelToken.unsubscribe(a), n.signal && n.signal.removeEventListener("abort", a); + } + let y = new XMLHttpRequest(); + function s() { + if (!y) return; + const w = M.from("getAllResponseHeaders" in y && y.getAllResponseHeaders()); + tr(function(O) { + e(O), b(); + }, function(O) { + r(O), b(); + }, { data: g && g !== "text" && g !== "json" ? y.response : y.responseText, status: y.status, statusText: y.statusText, headers: w, config: t, request: y }), y = null; + } + y.open(n.method.toUpperCase(), n.url, !0), y.timeout = n.timeout, "onloadend" in y ? y.onloadend = s : y.onreadystatechange = function() { + y && y.readyState === 4 && (y.status !== 0 || y.responseURL && y.responseURL.indexOf("file:") === 0) && setTimeout(s); + }, y.onabort = function() { + y && (r(new R("Request aborted", R.ECONNABORTED, n, y)), y = null); + }, y.onerror = function() { + r(new R("Network Error", R.ERR_NETWORK, n, y)), y = null; + }, y.ontimeout = function() { + let w = n.timeout ? "timeout of " + n.timeout + "ms exceeded" : "timeout exceeded"; + const O = n.transitional || Xe; + n.timeoutErrorMessage && (w = n.timeoutErrorMessage), r(new R(w, O.clarifyTimeoutError ? R.ETIMEDOUT : R.ECONNABORTED, n, y)), y = null; + }, o === void 0 && c.setContentType(null), "setRequestHeader" in y && v.forEach(c.toJSON(), function(w, O) { + y.setRequestHeader(O, w); + }), v.isUndefined(n.withCredentials) || (y.withCredentials = !!n.withCredentials), g && g !== "json" && (y.responseType = n.responseType), typeof n.onDownloadProgress == "function" && y.addEventListener("progress", Et(n.onDownloadProgress, !0)), typeof n.onUploadProgress == "function" && y.upload && y.upload.addEventListener("progress", Et(n.onUploadProgress)), (n.cancelToken || n.signal) && (a = (w) => { + y && (r(!w || w.type ? new rt(null, t, y) : w), y.abort(), y = null); + }, n.cancelToken && n.cancelToken.subscribe(a), n.signal && (n.signal.aborted ? a() : n.signal.addEventListener("abort", a))); + const d = function(w) { + const O = /^([-+\w]{1,25})(:?\/\/|:)/.exec(w); + return O && O[1] || ""; + }(n.url); + d && L.protocols.indexOf(d) === -1 ? r(new R("Unsupported protocol " + d + ":", R.ERR_BAD_REQUEST, t)) : y.send(o || null); + }); +}, tn = (t, e) => { + let r, n = new AbortController(); + const o = function(b) { + if (!r) { + r = !0, a(); + const y = b instanceof Error ? b : this.reason; + n.abort(y instanceof R ? y : new rt(y instanceof Error ? y.message : y)); + } + }; + let c = e && setTimeout(() => { + o(new R(`timeout ${e} of ms exceeded`, R.ETIMEDOUT)); + }, e); + const a = () => { + t && (c && clearTimeout(c), c = null, t.forEach((b) => { + b && (b.removeEventListener ? b.removeEventListener("abort", o) : b.unsubscribe(o)); + }), t = null); + }; + t.forEach((b) => b && b.addEventListener && b.addEventListener("abort", o)); + const { signal: g } = n; + return g.unsubscribe = a, [g, () => { + c && clearTimeout(c), c = null; + }]; +}, en = 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; +}, Ce = (t, e, r, n, o) => { + const c = async function* (g, b, y) { + for await (const s of g) yield* en(ArrayBuffer.isView(s) ? s : await y(String(s)), b); + }(t, e, o); + let a = 0; + return new ReadableStream({ type: "bytes", async pull(g) { + const { done: b, value: y } = await c.next(); + if (b) return g.close(), void n(); + let s = y.byteLength; + r && r(a += s), g.enqueue(new Uint8Array(y)); + }, cancel: (g) => (n(g), c.return()) }, { highWaterMark: 2 }); +}, Re = (t, e) => { + const r = t != null; + return (n) => setTimeout(() => e({ lengthComputable: r, total: t, loaded: n })); +}, Ct = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", nr = Ct && typeof ReadableStream == "function", It = Ct && (typeof TextEncoder == "function" ? (xe = new TextEncoder(), (t) => xe.encode(t)) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())); +var xe; +const rn = nr && (() => { + let t = !1; + const e = new Request(L.origin, { body: new ReadableStream(), method: "POST", get duplex() { + return t = !0, "half"; + } }).headers.has("Content-Type"); + return t && !e; +})(), qt = nr && !!(() => { + try { + return v.isReadableStream(new Response("").body); + } catch { + } +})(), At = { stream: qt && ((t) => t.body) }; +var Te; +Ct && (Te = new Response(), ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { + !At[t] && (At[t] = v.isFunction(Te[t]) ? (e) => e[t]() : (e, r) => { + throw new R(`Response type '${t}' is not supported`, R.ERR_NOT_SUPPORT, r); + }); +})); +const nn = 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 It(n)).byteLength : void 0))(e); +}, or = { http: null, xhr: Yr, fetch: Ct && (async (t) => { + let { url: e, method: r, data: n, signal: o, cancelToken: c, timeout: a, onDownloadProgress: g, onUploadProgress: b, responseType: y, headers: s, withCredentials: d = "same-origin", fetchOptions: w } = rr(t); + y = y ? (y + "").toLowerCase() : "text"; + let O, m, [f, i] = o || c || a ? tn([o, c], a) : []; + const u = () => { + !O && setTimeout(() => { + f && f.unsubscribe(); + }), O = !0; + }; + let l; + try { + if (b && rn && r !== "get" && r !== "head" && (l = await nn(s, n)) !== 0) { + let S, C = new Request(e, { method: "POST", body: n, duplex: "half" }); + v.isFormData(n) && (S = C.headers.get("content-type")) && s.setContentType(S), C.body && (n = Ce(C.body, 65536, Re(l, Et(b)), null, It)); + } + v.isString(d) || (d = d ? "cors" : "omit"), m = new Request(e, { ...w, signal: f, method: r.toUpperCase(), headers: s.normalize().toJSON(), body: n, duplex: "half", withCredentials: d }); + let p = await fetch(m); + const h = qt && (y === "stream" || y === "response"); + if (qt && (g || h)) { + const S = {}; + ["status", "statusText", "headers"].forEach((j) => { + S[j] = p[j]; + }); + const C = v.toFiniteNumber(p.headers.get("content-length")); + p = new Response(Ce(p.body, 65536, g && Re(C, Et(g, !0)), h && u, It), S); + } + y = y || "text"; + let E = await At[v.findKey(At, y) || "text"](p, t); + return !h && u(), i && i(), await new Promise((S, C) => { + tr(S, C, { data: E, headers: M.from(p.headers), status: p.status, statusText: p.statusText, config: t, request: m }); + }); + } catch (p) { + throw u(), p && p.name === "TypeError" && /fetch/i.test(p.message) ? Object.assign(new R("Network Error", R.ERR_NETWORK, t, m), { cause: p.cause || p }) : R.from(p, p && p.code, t, m); + } +}) }; +v.forEach(or, (t, e) => { + if (t) { + try { + Object.defineProperty(t, "name", { value: e }); + } catch { + } + Object.defineProperty(t, "adapterName", { value: e }); + } +}); +const _e = (t) => `- ${t}`, on = (t) => v.isFunction(t) || t === null || t === !1, sr = (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, !on(r) && (n = or[(a = String(r)).toLowerCase()], n === void 0)) throw new R(`Unknown adapter '${a}'`); + if (n) break; + o[a || "#" + c] = n; + } + if (!n) { + const c = Object.entries(o).map(([a, g]) => `adapter ${a} ` + (g === !1 ? "is not supported by the environment" : "is not available in the build")); + throw new R("There is no suitable adapter to dispatch the request " + (e ? c.length > 1 ? `since : +` + c.map(_e).join(` +`) : " " + _e(c[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); + } + return n; +}; +function Nt(t) { + if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted) throw new rt(null, t); +} +function Pe(t) { + return Nt(t), t.headers = M.from(t.headers), t.data = jt.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), sr(t.adapter || ut.adapter)(t).then(function(e) { + return Nt(t), e.data = jt.call(t, t.transformResponse, e), e.headers = M.from(e.headers), e; + }, function(e) { + return Ye(e) || (Nt(t), e && e.response && (e.response.data = jt.call(t, t.transformResponse, e.response), e.response.headers = M.from(e.response.headers))), Promise.reject(e); + }); +} +const sn = "1.7.2", ie = {}; +["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => { + ie[t] = function(r) { + return typeof r === t || "a" + (e < 1 ? "n " : " ") + t; + }; +}); +const ke = {}; +ie.transitional = function(t, e, r) { + function n(o, c) { + return "[Axios v1.7.2] Transitional option '" + o + "'" + c + (r ? ". " + r : ""); + } + return (o, c, a) => { + if (t === !1) throw new R(n(c, " has been removed" + (e ? " in " + e : "")), R.ERR_DEPRECATED); + return e && !ke[c] && (ke[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); + }; +}; +const Wt = { assertOptions: function(t, e, r) { + if (typeof t != "object") throw new R("options must be an object", R.ERR_BAD_OPTION_VALUE); + const n = Object.keys(t); + let o = n.length; + for (; o-- > 0; ) { + const c = n[o], a = e[c]; + if (a) { + const g = t[c], b = g === void 0 || a(g, c, t); + if (b !== !0) throw new R("option " + c + " must be " + b, R.ERR_BAD_OPTION_VALUE); + } else if (r !== !0) throw new R("Unknown option " + c, R.ERR_BAD_OPTION); + } +}, validators: ie }, $ = Wt.validators; +let Q = class { + constructor(t) { + this.defaults = t, this.interceptors = { request: new Oe(), response: new Oe() }; + } + async request(t, e) { + try { + return await this._request(t, e); + } catch (r) { + if (r instanceof Error) { + let n; + Error.captureStackTrace ? Error.captureStackTrace(n = {}) : n = new Error(); + const o = n.stack ? n.stack.replace(/^.+\n/, "") : ""; + try { + r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += ` +` + o) : r.stack = o; + } catch { + } + } + throw r; + } + } + _request(t, e) { + typeof t == "string" ? (e = e || {}).url = t : e = t || {}, e = X(this.defaults, e); + const { transitional: r, paramsSerializer: n, headers: o } = e; + r !== void 0 && Wt.assertOptions(r, { silentJSONParsing: $.transitional($.boolean), forcedJSONParsing: $.transitional($.boolean), clarifyTimeoutError: $.transitional($.boolean) }, !1), n != null && (v.isFunction(n) ? e.paramsSerializer = { serialize: n } : Wt.assertOptions(n, { encode: $.function, serialize: $.function }, !0)), e.method = (e.method || this.defaults.method || "get").toLowerCase(); + let c = o && v.merge(o.common, o[e.method]); + o && v.forEach(["delete", "get", "head", "post", "put", "patch", "common"], (O) => { + delete o[O]; + }), e.headers = M.concat(c, o); + const a = []; + let g = !0; + this.interceptors.request.forEach(function(O) { + typeof O.runWhen == "function" && O.runWhen(e) === !1 || (g = g && O.synchronous, a.unshift(O.fulfilled, O.rejected)); + }); + const b = []; + let y; + this.interceptors.response.forEach(function(O) { + b.push(O.fulfilled, O.rejected); + }); + let s, d = 0; + if (!g) { + const O = [Pe.bind(this), void 0]; + for (O.unshift.apply(O, a), O.push.apply(O, b), s = O.length, y = Promise.resolve(e); d < s; ) y = y.then(O[d++], O[d++]); + return y; + } + s = a.length; + let w = e; + for (d = 0; d < s; ) { + const O = a[d++], m = a[d++]; + try { + w = O(w); + } catch (f) { + m.call(this, f); + break; + } + } + try { + y = Pe.call(this, w); + } catch (O) { + return Promise.reject(O); + } + for (d = 0, s = b.length; d < s; ) y = y.then(b[d++], b[d++]); + return y; + } + getUri(t) { + return Qe(er((t = X(this.defaults, t)).baseURL, t.url), t.params, t.paramsSerializer); + } +}; +v.forEach(["delete", "get", "head", "options"], function(t) { + Q.prototype[t] = function(e, r) { + return this.request(X(r || {}, { method: t, url: e, data: (r || {}).data })); + }; +}), v.forEach(["post", "put", "patch"], function(t) { + function e(r) { + return function(n, o, c) { + return this.request(X(c || {}, { method: t, headers: r ? { "Content-Type": "multipart/form-data" } : {}, url: n, data: o })); + }; + } + Q.prototype[t] = e(), Q.prototype[t + "Form"] = e(!0); +}); +const $t = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511 }; +Object.entries($t).forEach(([t, e]) => { + $t[e] = t; +}); +const _ = function t(e) { + const r = new Q(e), n = Ve(Q.prototype.request, r); + return v.extend(n, Q.prototype, r, { allOwnKeys: !0 }), v.extend(n, r, null, { allOwnKeys: !0 }), n.create = function(o) { + return t(X(e, o)); + }, n; +}(ut); +_.Axios = Q, _.CanceledError = rt, _.CancelToken = class ir { + constructor(e) { + if (typeof e != "function") throw new TypeError("executor must be a function."); + let r; + this.promise = new Promise(function(o) { + r = o; + }); + const n = this; + this.promise.then((o) => { + if (!n._listeners) return; + let c = n._listeners.length; + for (; c-- > 0; ) n._listeners[c](o); + n._listeners = null; + }), this.promise.then = (o) => { + let c; + const a = new Promise((g) => { + n.subscribe(g), c = g; + }).then(o); + return a.cancel = function() { + n.unsubscribe(c); + }, a; + }, e(function(o, c, a) { + n.reason || (n.reason = new rt(o, c, a), r(n.reason)); + }); + } + throwIfRequested() { + if (this.reason) throw this.reason; + } + subscribe(e) { + this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [e]; + } + unsubscribe(e) { + if (!this._listeners) return; + const r = this._listeners.indexOf(e); + r !== -1 && this._listeners.splice(r, 1); + } + static source() { + let e; + return { token: new ir(function(n) { + e = n; + }), cancel: e }; + } +}, _.isCancel = Ye, _.VERSION = sn, _.toFormData = Ot, _.AxiosError = R, _.Cancel = _.CanceledError, _.all = function(t) { + return Promise.all(t); +}, _.spread = function(t) { + return function(e) { + return t.apply(null, e); + }; +}, _.isAxiosError = function(t) { + return v.isObject(t) && t.isAxiosError === !0; +}, _.mergeConfig = X, _.AxiosHeaders = M, _.formToJSON = (t) => Ze(v.isHTMLForm(t) ? new FormData(t) : t), _.getAdapter = sr, _.HttpStatusCode = $t, _.default = _; +const { Axios: an, AxiosError: cn, CanceledError: un, isCancel: ln, CancelToken: fn, VERSION: hn, all: dn, Cancel: pn, isAxiosError: yn, spread: mn, toFormData: gn, AxiosHeaders: bn, HttpStatusCode: wn, formToJSON: vn, getAdapter: On, mergeConfig: En } = _, An = Object.freeze(Object.defineProperty({ __proto__: null, Axios: an, AxiosError: cn, AxiosHeaders: bn, Cancel: pn, CancelToken: fn, CanceledError: un, HttpStatusCode: wn, VERSION: hn, all: dn, default: _, formToJSON: vn, getAdapter: On, isAxiosError: yn, isCancel: ln, mergeConfig: En, spread: mn, toFormData: gn }, Symbol.toStringTag, { value: "Module" })); +function Rt(t) { + return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; +} +function Sn(t) { + if (t.__esModule) return t; + var e = t.default; + if (typeof e == "function") { + var r = function n() { + return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); + }; + r.prototype = e.prototype; + } else r = {}; + return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) { + var o = Object.getOwnPropertyDescriptor(t, n); + Object.defineProperty(r, n, o.get ? o : { enumerable: !0, get: function() { + return t[n]; + } }); + }), r; +} +var Ht = { exports: {} }; +const je = Sn(An), ar = 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; + 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; + return !0; + } + 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; + for (o = n; o-- != 0; ) { + var a = c[o]; + if (!t(e[a], r[a])) return !1; + } + return !0; + } + return e != e && r != r; +}, cr = function(t) { + return t != null && t.constructor != null && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t); +}, ur = ( + /*! + * MIT License + * + * Copyright (c) Sindre Sorhus (https://sindresorhus.com) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit + * persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + function(t) { + return typeof Blob < "u" && (t instanceof Blob || Object.prototype.toString.call(t) === "[object Blob]"); + } +), lr = Object.prototype.toString; +function Ne(t, e) { + const r = t.length; + for (let n = 0; n < r; n++) { + const o = t[n]; + if (e(o)) return o; + } +} +function ae(t) { + return t !== null && typeof t == "object"; +} +function Cn(t) { + return ae(t) && function(e) { + return lr.call(e) === "[object Function]"; + }(t.pipe); +} +function Me(t, e) { + return t ? `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}` : e; +} +function Ue(t, e) { + return (t[0] === "/" ? t.substr(1) : t) === (e[0] === "/" ? e.substr(1) : e); +} +function Be(t, e, r) { + return Jt(e, r.params) && function(n, o) { + if (o === void 0) return !0; + let c; + try { + c = JSON.parse(n); + } catch { + } + return Jt(c || n, o); + }(t, r.data); +} +function Jt(t, e) { + return e === void 0 || (typeof e.asymmetricMatch == "function" ? e.asymmetricMatch(t) : ar(t, e)); +} +function Rn(t) { + return e = t, lr.call(e) === "[object ArrayBuffer]" || cr(t) || Cn(t) || ur(t) ? t : ae(t) ? JSON.parse(JSON.stringify(t)) : t; + var e; +} +function Le(t, e, r, n) { + if (typeof je.AxiosError == "function") return je.AxiosError.from(new Error(t), n, e, null, r); + const o = new Error(t); + return o.isAxiosError = !0, o.config = e, r !== void 0 && (o.response = r), n !== void 0 && (o.code = n), o.toJSON = function() { + 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 fr = { find: Ne, findHandler: function(t, e, r, n, o, c, a) { + return Ne(t[e.toLowerCase()], function(g) { + let b = !1; + return typeof g.url == "string" ? b = Ue(r, g.url) || Ue(Me(a, r), g.url) : g.url instanceof RegExp && (b = g.url.test(r) || g.url.test(Me(a, r))), b && Be(n, o, g) && Jt(c, g.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], g = Rn(o.data || o[1]), b = o.headers || o[2]; + return o.config && (c = o.config), { status: a, data: g, headers: b, config: c, request: { responseURL: c.url } }; + }(e, t); + if (!n.config.validateStatus || n.config.validateStatus(n.status)) return n; + throw Le(`Request failed with status code ${n.status}`, n.config, n); +}, isObjectOrArray: ae, isBuffer: cr, isBlob: ur, isBodyOrParametersMatching: Be, isEqual: ar, createAxiosError: Le, 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 ot = fr; +function De(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 xn = 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 = ot.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 && ot.purgeIfReplyOnce(t, n), n.passThrough ? De(t, e) : ot.settle(e, n.response, function(o, c) { + return typeof c.delay == "number" ? c.delay : o.delayResponse; + }(t, n)); + switch (t.onNoMatch) { + case "passthrough": + return De(t, e); + case "throwException": + throw ot.createCouldNotFindMockError(e); + default: + return ot.settle(e, { status: 404 }, t.delayResponse); + } +}, W = fr, hr = ["get", "post", "head", "delete", "patch", "put", "options", "list", "link", "unlink"]; +function Fe() { + const t = []; + return hr.forEach(function(e) { + Object.defineProperty(t, e, { get: () => t.filter(function(r) { + return !r.method || r.method === e; + }) }); + }), t; +} +class Mt { + constructor(e, r = {}) { + if (this.reset(), !e) throw new Error("Please provide an instance of axios to mock"); + 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) => xn(this, e); + } + restore() { + this.axiosInstance && (this.axiosInstance.defaults.adapter = this.originalAdapter, this.axiosInstance = void 0); + } + reset() { + this.resetHandlers(), this.resetHistory(); + } + resetHandlers() { + this.handlers ? this.handlers.length = 0 : this.handlers = Fe(); + } + resetHistory() { + this.history ? this.history.length = 0 : this.history = Fe(); + } +} +const Tn = ["any", "get", "delete", "head", "options"], _n = ["headers", "params", "data"]; +function Ie(t, e) { + for (const r in e) if (!_n.includes(r)) throw new Error(`Invalid config property ${JSON.stringify(r)} provided to ${dr(t)}. Config: ${JSON.stringify(e)}`); + return e; +} +function dr(t) { + return `on${t.charAt(0).toUpperCase()}${t.slice(1)}`; +} +function Ut(t, e, r) { + if (t === "any") e.push(r); + else { + const n = function(o, c) { + let a = -1; + for (let g = 0; g < o.length; g += 1) { + const b = o[g], y = b.url instanceof RegExp && c.url instanceof RegExp ? String(b.url) === String(c.url) : b.url === c.url; + (!b.method || b.method === c.method) && y && W.isEqual(b.params, c.params) && W.isEqual(b.data, c.data) && W.isEqual(b.headers, c.headers) && !b.replyOnce && (a = g); + } + return a; + }(e, r); + n > -1 && !r.replyOnce ? e.splice(n, 1, r) : e.push(r); + } +} +hr.concat("any").forEach(function(t) { + Mt.prototype[dr(t)] = function(e, r, n) { + const o = this; + let c; + e = e === void 0 ? /.*/ : e; + const a = function(s, d, w) { + return Tn.includes(s) ? Ie(s, d || {}) : Ie(s, Object.assign({}, w, { data: d })); + }(t, r, n); + function g(s, d, w) { + const O = { 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, d, w] }; + return Ut(t, o.handlers, O), o; + } + function b(s, d, w) { + const O = { 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, d, w] }; + return Ut(t, o.handlers, O), o; + } + const y = { reply: g, replyOnce: b, withDelayInMs: function(s) { + c = s; + const d = y.reply.bind(y); + return Object.assign(d, y), d; + }, passThrough() { + const s = { passThrough: !0, method: t === "any" ? void 0 : t, url: e, params: a.params, data: a.data, headers: a.headers }; + return Ut(t, o.handlers, s), o; + }, abortRequest: () => g(async function(s) { + throw W.createAxiosError("Request aborted", s, void 0, "ECONNABORTED"); + }), abortRequestOnce: () => b(async function(s) { + throw W.createAxiosError("Request aborted", s, void 0, "ECONNABORTED"); + }), networkError: () => g(async function(s) { + throw W.createAxiosError("Network Error", s); + }), networkErrorOnce: () => b(async function(s) { + throw W.createAxiosError("Network Error", s); + }), timeout: () => g(async function(s) { + throw W.createAxiosError(s.timeoutErrorMessage || `timeout of ${s.timeout}ms exceeded`, s, void 0, s.transitional && s.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"); + }), timeoutOnce: () => b(async function(s) { + throw W.createAxiosError(s.timeoutErrorMessage || `timeout of ${s.timeout}ms exceeded`, s, void 0, s.transitional && s.transitional.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED"); + }) }; + return y; + }; +}), Ht.exports = Mt, Ht.exports.default = Mt; +const $n = Rt(Ht.exports); +var Pn = Object.defineProperty, pr = (t) => { + throw TypeError(t); +}, T = (t, e, r) => ((n, o, c) => o in n ? Pn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[o] = c)(t, typeof e != "symbol" ? e + "" : e, r), yr = (t, e, r) => e.has(t) || pr("Cannot " + r), A = (t, e, r) => (yr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), P = (t, e, r) => e.has(t) ? pr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), F = (t, e, r, n) => (yr(t, e, "write to private field"), e.set(t, r), r); +function kn(t) { + return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; +} +var mr = {}; +(function(t) { + (function(e, r) { + var n = r(); + for (var o in n) t[o] = n[o]; + })(0, function() { + var e = function(a) { + return typeof a != "string" ? a : a.replace(/[\+ \|\^\%]/g, function(g) { + return { " ": "+", "+": "%2B", "|": "%7C", "^": "%5E", "%": "%25" }[g]; + }); + }, r = function(a) { + return typeof a != "string" ? a : a.replace(/\+|%2B|%7C|%5E|%25/g, function(g) { + return { "+": " ", "%2B": "+", "%7C": "|", "%5E": "^", "%25": "%" }[g]; + }); + }, n = function(a) { + return Number.prototype.toString.call(a, 36).toUpperCase(); + }, o = function(a) { + return parseInt(a, 36); + }, c = Array.prototype.indexOf || function(a, g) { + for (var b = g || 0, y = this.length; b < y; b++) if (this[b] === a) return b; + return -1; + }; + return { JSON, pack: function(a, g) { + var b = (g = g || {}).verbose || !1; + b && console.log("Normalize the JSON Object"), a = typeof a == "string" ? this.JSON.parse(a) : a, b && console.log("Creating a empty dictionary"); + var y = { strings: [], integers: [], floats: [] }; + b && console.log("Creating the AST"); + var s = function m(f) { + b && console.log("Calling recursiveAstBuilder with " + this.JSON.stringify(f)); + var i, u = typeof f; + if (f === null) return { type: "null", index: -3 }; + if (typeof f > "u") return { type: "undefined", index: -5 }; + if (f instanceof Array) { + var l = ["@"]; + for (var p in f) f.hasOwnProperty(p) && l.push(m(f[p])); + return l; + } + if (u === "object") { + for (var h in l = ["$"], f) f.hasOwnProperty(h) && (l.push(m(h)), l.push(m(f[h]))); + return l; + } + if (f === "") return { type: "empty", index: -4 }; + if (u === "string") return (i = c.call(y.strings, f)) == -1 && (y.strings.push(e(f)), i = y.strings.length - 1), { type: "strings", index: i }; + if (u === "number" && f % 1 == 0) return (i = c.call(y.integers, f)) == -1 && (y.integers.push(n(f)), i = y.integers.length - 1), { type: "integers", index: i }; + if (u === "number") return (i = c.call(y.floats, f)) == -1 && (y.floats.push(f), i = y.floats.length - 1), { type: "floats", index: i }; + if (u === "boolean") return { type: "boolean", index: f ? -1 : -2 }; + throw new Error("Unexpected argument of type " + typeof f); + }(a), d = y.strings.length, w = y.integers.length; + y.floats.length, b && console.log("Parsing the dictionary"); + var O = y.strings.join("|"); + return O += "^" + y.integers.join("|"), O += "^" + y.floats.join("|"), b && console.log("Parsing the structure"), O += "^" + function m(f) { + if (b && console.log("Calling a recursiveParser with " + this.JSON.stringify(f)), f instanceof Array) { + var i = f.shift(); + for (var u in f) f.hasOwnProperty(u) && (i += m(f[u]) + "|"); + return (i[i.length - 1] === "|" ? i.slice(0, -1) : i) + "]"; + } + var l = f.type, p = f.index; + if (l === "strings") return n(p); + if (l === "integers") return n(d + p); + if (l === "floats") return n(d + w + p); + if (l === "boolean") return f.index; + if (l === "null") return -3; + if (l === "undefined") return -5; + if (l === "empty") return -4; + throw new TypeError("The item is alien!"); + }(s), b && console.log("Ending parser"), g.debug ? { dictionary: y, ast: s, packed: O } : O; + }, unpack: function(a, g) { + g = g || {}; + var b = a.split("^"); + g.verbose && console.log("Building dictionary"); + var y = [], s = b[0]; + if (s !== "") { + s = s.split("|"), g.verbose && console.log("Parse the strings dictionary"); + for (var d = 0, w = s.length; d < w; d++) y.push(r(s[d])); + } + if ((s = b[1]) !== "") for (s = s.split("|"), g.verbose && console.log("Parse the integers dictionary"), d = 0, w = s.length; d < w; d++) y.push(o(s[d])); + if ((s = b[2]) !== "") for (s = s.split("|"), g.verbose && console.log("Parse the floats dictionary"), d = 0, w = s.length; d < w; d++) y.push(parseFloat(s[d])); + s = null, g.verbose && console.log("Tokenizing the structure"); + var O = "", m = [], f = b[3].length; + for (d = 0; d < f; d++) { + var i = b[3].charAt(d); + i === "|" || i === "$" || i === "@" || i === "]" ? (O && (m.push(o(O)), O = ""), i !== "|" && m.push(i)) : O += i; + } + var u = m.length, l = 0; + return g.verbose && console.log("Starting recursive parser"), function p() { + var h = m[l++]; + if (g.verbose && console.log("Reading collection type " + (h === "$" ? "object" : "Array")), h === "@") { + for (var E = []; l < u; l++) { + var S = m[l]; + if (g.verbose && console.log("Read " + S + " symbol"), S === "]") return E; + if (S === "@" || S === "$") E.push(p()); + else switch (S) { + case -1: + E.push(!0); + break; + case -2: + E.push(!1); + break; + case -3: + E.push(null); + break; + case -5: + E.push(void 0); + break; + case -4: + E.push(""); + break; + default: + E.push(y[S]); + } + } + return g.verbose && console.log("Parsed " + this.JSON.stringify(E)), E; + } + if (h === "$") { + for (E = {}; l < u; l++) { + var C = m[l]; + if (C === "]") return E; + if (C = C === -4 ? "" : y[C], (S = m[++l]) === "@" || S === "$") E[C] = p(); + else switch (S) { + case -1: + E[C] = !0; + break; + case -2: + E[C] = !1; + break; + case -3: + E[C] = null; + break; + case -5: + E[C] = void 0; + break; + case -4: + E[C] = ""; + break; + default: + E[C] = y[S]; + } + } + return g.verbose && console.log("Parsed " + this.JSON.stringify(E)), E; + } + throw new TypeError("Bad token " + h + " isn't a type"); + }(); + } }; + }); +})(mr); +const qe = kn(mr); +var I, pt, z, V, zt, Vt, yt, Kt, Gt, Qt, Xt; +const jn = class gr { + constructor(e, r, n, o, c) { + return T(this, "code", 0), T(this, "message", "操作成功"), T(this, "data", null), T(this, "url", ""), T(this, "res", ""), P(this, I), P(this, pt, !0), P(this, z, !0), P(this, V, { get: (a, g) => A(this, zt).call(this, g), set: (a, g) => { + throw new TypeError(`HttpResponse 是只读的,不能设置属性 "${g}"`); + }, ownKeys: () => Object.keys(A(this, V).getPrototypeOf() || {}), getPrototypeOf: () => A(this, pt) ? this : this.data, getOwnPropertyDescriptor: () => ({ configurable: !0, enumerable: !0, writable: !0, value: A(this, V).getPrototypeOf() }) }), P(this, zt, (a) => a === "$echoMsg" ? A(this, yt) : a === "msg" ? A(this, Vt) : a === "then" ? (F(this, z, !0), A(this, Kt)) : a === "resp" ? (F(this, z, !0), A(this, Gt)) : a === "catch" ? A(this, Qt) : a === "finally" ? A(this, Xt) : a === "IS_ECHO_MSG" ? A(this, z) : Reflect.get(this, a)), P(this, Vt, (a = (b) => b, g = !1) => (A(this, yt).call(this), F(this, pt, g), Promise.resolve(a == null ? void 0 : a(A(this, V).getPrototypeOf())))), T(this, "toJSON", () => ({ code: this.code, message: this.message, data: this.data, url: this.url, res: this.res })), T(this, "toString", () => this.message), P(this, yt, () => { + A(this, z) && (F(this, z, !1), te.onMsg(this.code, this.message)); + }), P(this, Kt, (a, g) => [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(this.data)) : g ? Promise.resolve(g(A(this, I))) : Promise.reject(A(this, I))), P(this, Gt, (a, g) => [0, 1].includes(this.code) ? Promise.resolve(a == null ? void 0 : a(this)) : g ? Promise.resolve(g(A(this, I))) : Promise.reject(A(this, I))), P(this, Qt, (a) => Promise.resolve(a(A(this, I)))), P(this, Xt, (a) => (a == null || a(), [0, 1].includes(this.code) ? Promise.resolve(A(this, V).getPrototypeOf()) : Promise.reject(A(this, I)))), this.code = e, this.message = r, this.data = n, this.url = o, this.res = c, F(this, I, new Proxy(this, A(this, V))); + } + static [Symbol.hasInstance](e) { + return (e == null ? void 0 : e.constructor) === gr || (e == null ? void 0 : e[Symbol.for("HttpResponse")]) === !0; + } +}; +I = /* @__PURE__ */ new WeakMap(), pt = /* @__PURE__ */ new WeakMap(), z = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), zt = /* @__PURE__ */ new WeakMap(), Vt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap(), Kt = /* @__PURE__ */ new WeakMap(), Gt = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), Xt = /* @__PURE__ */ new WeakMap(); +let ct = jn; +const Bt = (t, e, r, n = "/", o = "") => new ct(t, e, r, n, o); +var We = ["utf8", "utf-8", "unicode-1-1-utf-8"], br = { TextEncoder: function(t) { + if (We.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); + return n; + }; +}, TextDecoder: function(t) { + if (We.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); + this.encoding = "utf-8", this.decode = function(e, r) { + if (typeof e > "u") return ""; + 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(""))); + } + throw new TypeError("passed argument must be an array buffer view"); + }; +} }; +const Nn = new br.TextEncoder("utf8"); +new br.TextDecoder("utf8"); +class Mn { + constructor(e) { + 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); + for (let r = 0; r < e.length; r++) this.decodeMap[e.charCodeAt(r)] = r; + } + encode(e) { + if (!e || e.length === 0) return ""; + const r = new Un(this).encodeV2(e); + return String.fromCharCode(...r); + } + decode(e) { + if (!e || e.length === 0) return ""; + const r = new Bn(this).decode(e); + return new TextDecoder().decode(r); + } +} +var mt, gt, Y, K, Zt, q, H, tt, Yt, bt; +class Un { + constructor(e) { + P(this, mt), T(this, "src", new Uint8Array()), T(this, "pos", 0), F(this, mt, e); + } + get6bits() { + let e = 7 & this.pos, r = this.pos >> 3; + e === 0 && (r -= 1, e = 8); + let n = this.src[r] >> 8 - e; + return e < 6 && r > 0 && (n |= this.src[r - 1] << e), 63 & n; + } + encodeV2(e) { + this.src = function(n) { + return Nn.encode(n || ""); + }(e), this.pos = 8 * this.src.length; + const r = []; + for (; this.pos > 0; ) { + let n = 6, o = this.get6bits(); + !(30 & ~o) && ((this.pos > 6 || o > 31) && (n = 5), o &= 31), r.push(A(this, mt).encodeTable[o].charCodeAt(0)), this.pos -= n; + } + return r; + } +} +mt = /* @__PURE__ */ new WeakMap(); +class Bn { + constructor(e) { + P(this, gt), F(this, gt, 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 g = e[a].charCodeAt(0), b = A(this, gt).decodeMap[g]; + if (b === 255) throw new Error(`CorruptInputError at index ${a}`); + a === e.length - 1 ? (c |= b << o, o += Math.ceil(Math.log2(b + 1))) : 30 & ~b ? (c |= b << o, o += 6) : (c |= b << o, o += 5), o >= 8 && (n--, r[n] = 255 & c, o %= 8, c >>= 8); + } + return o > 0 && (n--, r[n] = 255 & c), r.slice(n); + } +} +gt = /* @__PURE__ */ new WeakMap(), Promise.withResolvers || (Promise.withResolvers = function() { + let t, e; + return { promise: new Promise((r, n) => { + t = r, e = n; + }), resolve: t, reject: e }; +}); +class te { + constructor(e, r, n) { + P(this, Y), P(this, K), P(this, Zt), P(this, q, { "#": /* @__PURE__ */ new Map(), $: /* @__PURE__ */ new Map() }), P(this, H, /* @__PURE__ */ new Map()), P(this, tt, /* @__PURE__ */ new Set()), T(this, "init", (o, c, a) => { + o && F(this, Zt, o), a && F(this, Y, a), c && F(this, K, new Mn(c)), A(this, Yt).call(this); + }), P(this, Yt, () => { + !A(this, tt).size || !A(this, Y) || (A(this, tt).forEach((o) => A(this, bt).call(this, ...o)), A(this, tt).clear()); + }), P(this, bt, (o, c, a, g = !1) => { + if (A(this, Y)) { + const { url: b, method: y, ...s } = a || {}; + A(this, Y).call(this, { url: b, method: y, ...s }).then((d) => { + if (![0, 1].includes(d.code)) throw Bt(d.code ?? -1, d.msg ?? "响应格式错误", d.data, b, d == null ? void 0 : d.res); + return [d.code, d.msg, d.data, b, (d == null ? void 0 : d.res) ?? ""]; + }).then((d) => { + const w = d; + return (c == "#" || y == "GET") && A(this, q)[c].set(o, w), c != "#" && y == "GET" && !g && setTimeout(() => { + A(this, q)[c].delete(o); + }, 300), w; + }).then((d) => { + var w; + return (w = A(this, H).get(o)) == null ? void 0 : w.forEach((O, m, f) => { + O && O[0](d), delete f[m]; + }); + }).catch((d) => { + var w; + A(this, q)[c].delete(o), (w = A(this, H).get(o)) == null || w.forEach((O, m, f) => { + O && O[1](d instanceof ct ? d : Bt(-1, d, null, b)), delete f[m]; + }); + }).finally(() => A(this, H).delete(o)); + } else A(this, tt).add([o, c, a, g]); + }), T(this, "request", ({ url: o = "/", method: c = "GET", ...a }, g = !1) => { + var b, y; + o = function(i, u) { + return i.replace(new RegExp(`^${u}+|${u}+$`, "g"), ""); + }(o, "/"); + const s = c.toUpperCase(), d = function(i) { + let u = 5381; + for (let l = 0; l < i.length; l++) u = 33 * u ^ i.charCodeAt(l); + return (u >>> 0).toString(16); + }(JSON.stringify([o, s, a])), w = (b = o == null ? void 0 : o.includes) != null && b.call(o, "/_/") ? "#" : "$", { promise: O, resolve: m, reject: f } = Promise.withResolvers(); + return A(this, q)[w].has(d) ? (console.log("cache", o), m(A(this, q)[w].get(d))) : A(this, H).has(d) ? (y = A(this, H).get(d)) == null || y.push([m, f]) : (A(this, H).set(d, [[m, f]]), A(this, bt).call(this, d, w, { url: o, method: s, ...a }, g)), new Proxy(O, { get: (i, u) => u === Symbol.for("HttpResponse") || ((...l) => i.then((p) => Bt(...p)[u](...l)).catch((p) => { + if (!(p instanceof ct)) throw p; + return typeof p[u] == "function" ? p[u](...l) : p[u]; + })) }); + }), T(this, "get", (o, c = {}) => this.request({ url: o, method: "GET", params: c })), T(this, "post", (o, c = {}, a = {}) => this.request({ url: o, method: "POST", data: c, params: a })), T(this, "put", (o, c = {}, a = {}) => this.request({ url: o, method: "PUT", data: c, params: a })), T(this, "del", (o, c = {}, a = {}) => this.request({ url: o, method: "DELETE", data: c, params: a })), T(this, "download", (o, c) => { + }), T(this, "cache", (o, c = {}) => this.request({ url: o, method: "GET", params: c }, !0)), T(this, "list", (o, c = {}) => this.get(`/api/${o}/${this.encode(c)}`)), T(this, "getAppInfo", () => { + }), T(this, "refreshCache", (o = !1) => { + o && A(this, q)["#"].clear(), A(this, q).$.clear(); + }), T(this, "decode", (o = "", c = {}) => { + if (o === void 0 || o === "" || o === null) return c; + try { + if (!A(this, K)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); + const a = A(this, K).decode(o); + return qe.unpack(a); + } catch { + return console.warn("core.decode", o), c; + } + }), T(this, "encode", (o = {}) => { + if (!A(this, K)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); + const c = JSON.stringify(o, (a, g) => g === void 0 ? null : g); + return A(this, K).encode(qe.pack(c)); + }), this.init(e, r, n); + } +} +Y = /* @__PURE__ */ new WeakMap(), K = /* @__PURE__ */ new WeakMap(), Zt = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), H = /* @__PURE__ */ new WeakMap(), tt = /* @__PURE__ */ new WeakMap(), Yt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), te.onUnhandledRejection = (t) => { + var e; + const r = t instanceof ct ? t : (t == null ? void 0 : t.reason) instanceof ct ? t.reason : null; + r != null && r.IS_ECHO_MSG && (r.$echoMsg(), (e = t == null ? void 0 : t.preventDefault) == null || e.call(t)); +}, te.onMsg = (t, e) => [0, 1].includes(t) ? console.log(e) : console.warn(e); +var wr = { exports: {} }; +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */ +wr.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(m, f, i) { + return m < f ? f : m > i ? i : m; + } + function c(m) { + return 100 * (-1 + m); + } + function a(m, f, i) { + var u; + return (u = n.positionUsing === "translate3d" ? { transform: "translate3d(" + c(m) + "%,0,0)" } : n.positionUsing === "translate" ? { transform: "translate(" + c(m) + "%,0)" } : { "margin-left": c(m) + "%" }).transition = "all " + f + "ms " + i, u; + } + r.configure = function(m) { + var f, i; + for (f in m) (i = m[f]) !== void 0 && m.hasOwnProperty(f) && (n[f] = i); + return this; + }, r.status = null, r.set = function(m) { + var f = r.isStarted(); + m = o(m, n.minimum, 1), r.status = m === 1 ? null : m; + var i = r.render(!f), u = i.querySelector(n.barSelector), l = n.speed, p = n.easing; + return i.offsetWidth, g(function(h) { + n.positionUsing === "" && (n.positionUsing = r.getPositioningCSS()), b(u, a(m, l, p)), m === 1 ? (b(i, { transition: "none", opacity: 1 }), i.offsetWidth, setTimeout(function() { + b(i, { transition: "all " + l + "ms linear", opacity: 0 }), setTimeout(function() { + r.remove(), h(); + }, l); + }, l)) : setTimeout(h, l); + }), this; + }, r.isStarted = function() { + return typeof r.status == "number"; + }, r.start = function() { + r.status || r.set(0); + var m = function() { + setTimeout(function() { + r.status && (r.trickle(), m()); + }, n.trickleSpeed); + }; + return n.trickle && m(), this; + }, r.done = function(m) { + return m || r.status ? r.inc(0.3 + 0.5 * Math.random()).set(1) : this; + }, r.inc = function(m) { + var f = r.status; + return f ? (typeof m != "number" && (m = (1 - f) * o(Math.random() * f, 0.1, 0.95)), f = o(f + m, 0, 0.994), r.set(f)) : r.start(); + }, r.trickle = function() { + return r.inc(Math.random() * n.trickleRate); + }, t = 0, e = 0, r.promise = function(m) { + return m && m.state() !== "resolved" ? (e === 0 && r.start(), t++, e++, m.always(function() { + --e == 0 ? (t = 0, r.done()) : r.set((t - e) / t); + }), this) : this; + }, r.render = function(m) { + if (r.isRendered()) return document.getElementById("nprogress"); + s(document.documentElement, "nprogress-busy"); + var f = document.createElement("div"); + f.id = "nprogress", f.innerHTML = n.template; + var i, u = f.querySelector(n.barSelector), l = m ? "-100" : c(r.status || 0), p = document.querySelector(n.parent); + return b(u, { transition: "all 0 linear", transform: "translate3d(" + l + "%,0,0)" }), n.showSpinner || (i = f.querySelector(n.spinnerSelector)) && O(i), p != document.body && s(p, "nprogress-custom-parent"), p.appendChild(f), f; + }, r.remove = function() { + d(document.documentElement, "nprogress-busy"), d(document.querySelector(n.parent), "nprogress-custom-parent"); + var m = document.getElementById("nprogress"); + m && O(m); + }, r.isRendered = function() { + return !!document.getElementById("nprogress"); + }, r.getPositioningCSS = function() { + var m = document.body.style, f = "WebkitTransform" in m ? "Webkit" : "MozTransform" in m ? "Moz" : "msTransform" in m ? "ms" : "OTransform" in m ? "O" : ""; + return f + "Perspective" in m ? "translate3d" : f + "Transform" in m ? "translate" : "margin"; + }; + var g = /* @__PURE__ */ function() { + var m = []; + function f() { + var i = m.shift(); + i && i(f); + } + return function(i) { + m.push(i), m.length == 1 && f(); + }; + }(), b = /* @__PURE__ */ function() { + var m = ["Webkit", "O", "Moz", "ms"], f = {}; + function i(h) { + return h.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(E, S) { + return S.toUpperCase(); + }); + } + function u(h) { + var E = document.body.style; + if (h in E) return h; + for (var S, C = m.length, j = h.charAt(0).toUpperCase() + h.slice(1); C--; ) if ((S = m[C] + j) in E) return S; + return h; + } + function l(h) { + return h = i(h), f[h] || (f[h] = u(h)); + } + function p(h, E, S) { + E = l(E), h.style[E] = S; + } + return function(h, E) { + var S, C, j = arguments; + if (j.length == 2) for (S in E) (C = E[S]) !== void 0 && E.hasOwnProperty(S) && p(h, S, C); + else p(h, j[1], j[2]); + }; + }(); + function y(m, f) { + return (typeof m == "string" ? m : w(m)).indexOf(" " + f + " ") >= 0; + } + function s(m, f) { + var i = w(m), u = i + f; + y(i, f) || (m.className = u.substring(1)); + } + function d(m, f) { + var i, u = w(m); + y(m, f) && (i = u.replace(" " + f + " ", " "), m.className = i.substring(1, i.length - 1)); + } + function w(m) { + return (" " + (m.className || "") + " ").replace(/\s+/gi, " "); + } + function O(m) { + m && m.parentNode && m.parentNode.removeChild(m); + } + return r; +}(); +const Hn = Rt(wr.exports); +var vr = {}, Or = { exports: {} }, Er = { 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; +})(Er); +var Ln = Er.exports; +(function(t) { + var e = Ln.default; + function r(n) { + if (typeof WeakMap != "function") return null; + var o = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(); + return (r = function(a) { + return a ? c : 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 c = r(o); + if (c && c.has(n)) return c.get(n); + var a = { __proto__: null }, g = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var b in n) if (b !== "default" && {}.hasOwnProperty.call(n, b)) { + var y = g ? Object.getOwnPropertyDescriptor(n, b) : null; + y && (y.get || y.set) ? Object.defineProperty(a, b, y) : a[b] = n[b]; + } + return a.default = n, c && c.set(n, a), a; + }, t.exports.__esModule = !0, t.exports.default = t.exports; +})(Or); +var Dn = Or.exports.default; +Object.defineProperty(vr, "__esModule", { value: !0 }); +var Jn = vr.default = function(t) { + var e = $e.useRef(); + return e.current = t, $e.useCallback(function() { + for (var r, n = arguments.length, o = new Array(n), c = 0; c < n; c++) o[c] = arguments[c]; + return (r = e.current) === null || r === void 0 ? void 0 : r.call.apply(r, [e].concat(o)); + }, []); +}, $e = Dn(ze), Fn = Object.defineProperty, Ar = (t) => { + throw TypeError(t); +}, et = (t, e, r) => ((n, o, c) => o in n ? Fn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: c }) : n[o] = c)(t, typeof e != "symbol" ? e + "" : e, r), Sr = (t, e, r) => e.has(t) || Ar("Cannot " + r), N = (t, e, r) => (Sr(t, e, "read from private field"), r ? r.call(t) : e.get(t)), wt = (t, e, r) => e.has(t) ? Ar("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), Lt = (t, e, r, n) => (Sr(t, e, "write to private field"), e.set(t, r), r); +const He = (t, e) => e.reduce((r, n) => r == null ? void 0 : r[n], t); +var ee, at, G, B; +const J = class k { + constructor(e, r = {}) { + if (wt(this, B), et(this, "exec", (s, d = {}, w = {}, O = "") => new Promise((m, f) => { + if (!/^(?!\s*(\/\/|\/\*|\*)).*?\S+/m.test(s)) return m(); + const i = (/* @__PURE__ */ ((u, l, p, h) => ({ set _(E) { + Lt(u, l, E); + }, get _() { + return N(u, l, h); + } }))(k, ee))._++; + N(k, at).set(i, w), k.mQueue.set(i, [m, f]), N(this, B).postMessage({ id: i, session: O, category: "eval", method: s, args: d }); + })), et(this, "clear", (s) => N(this, B).postMessage({ session: s, category: "clear" })), N(k, G)) return N(k, G); + Lt(this, B, new Worker(e, r)); + const n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(); + let c = 0; + const a = (s) => { + const d = crypto.randomUUID(); + return n.set(d, s), setTimeout(() => n.delete(d), 3e4), d; + }; + k.invokeWorkerFn = (s, d) => new Promise((w, O) => { + const m = c++; + o.set(m, [w, O]), N(this, B).postMessage({ category: "invoke_fn", fn_id: s, cb_id: m, args: d }); + }); + const g = (s) => { + if (s === null || typeof s != "object" || Object.getPrototypeOf(s) !== Object.prototype || !Object.values(s).some((w) => typeof w == "function")) return s; + const d = a(s); + return { ...Object.fromEntries(Object.entries(s).filter(([, w]) => typeof w != "function")), __chain_id__: d }; + }, b = (s) => s != null && s.__fn_id__ ? new Proxy(function() { + }, { apply: (d, w, O) => k.invokeWorkerFn(s.__fn_id__, O) }) : s, y = ({ id: s, task_id: d, method: w, args: O, session: m, chain_id: f }) => { + try { + let i; + if (f) { + const l = n.get(f); + if (!l) throw `chain state '${f}' not found or expired`; + if (i = l[w], typeof i != "function") throw `${w} is not a function in chain state`; + i = i.bind(l); + } else { + const l = w.split("/"); + if (i = He(k.fns, l) || He(N(k, at).get(d), l), typeof i != "function") throw `${w} not found`; + } + const u = Reflect.apply(i, void 0, O.map(b)); + if (k.chainableTypes.some((l) => u instanceof l)) { + const l = a(u); + return void N(this, B).postMessage({ id: s, task_id: d, category: "util", method: w, args: O, session: m, data: { __chain_id__: l }, error: null }); + } + Promise.resolve(u).then((l) => { + N(this, B).postMessage({ id: s, task_id: d, category: "util", method: w, args: O, session: m, data: g(l), error: null }); + }).catch((l) => { + let p; + try { + p = JSON.parse(JSON.stringify(l)), typeof p == "object" && !Array.isArray(p) && !Object.keys(p).length && (p = String(l)); + } catch { + p = String(l); + } + N(this, B).postMessage({ id: s, task_id: d, category: "util", method: w, args: O, session: m, data: null, error: p }); + }); + } catch (i) { + N(this, B).postMessage({ id: s, task_id: d, category: "util", method: w, args: O, session: m, data: null, error: String(i) }); + } + }; + N(this, B).addEventListener("message", ({ data: s }) => { + if (s.category === "util") y(s); + else if (s.category === "invoke_fn_result") { + const d = o.get(s.cb_id); + if (!d) return; + o.delete(s.cb_id), s.error !== null ? d[1](s.error) : d[0](s.result); + } else s.category === "eval" && k.mQueue.has(s.id) && (s.error !== null ? k.mQueue.get(s.id)[1](s.error) : k.mQueue.get(s.id)[0](s.data), N(k, at).delete(s.id), k.mQueue.delete(s.id)); + }, !1), Lt(k, G, this); + } + static getInstance(e, r = {}) { + return N(k, G) || new k(e, r), N(k, G); + } +}; +ee = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap(), et(J, "fns", {}), et(J, "mQueue", /* @__PURE__ */ new Map()), et(J, "chainableTypes", []), wt(J, ee, 0), wt(J, at, /* @__PURE__ */ new Map()), wt(J, G, null), et(J, "invokeWorkerFn", null); +let zn = J; +var Dt, Ft, re = { exports: {} }; +Dt = re, Ft = re.exports, function() { + var t = { version: "3.0.1", x86: {}, x64: {} }; + function e(s, d) { + return (65535 & s) * d + (((s >>> 16) * d & 65535) << 16); + } + function r(s, d) { + return s << d | s >>> 32 - d; + } + function n(s) { + return s = e(s ^= s >>> 16, 2246822507), s = e(s ^= s >>> 13, 3266489909), s ^= s >>> 16; + } + function o(s, d) { + s = [s[0] >>> 16, 65535 & s[0], s[1] >>> 16, 65535 & s[1]], d = [d[0] >>> 16, 65535 & d[0], d[1] >>> 16, 65535 & d[1]]; + var w = [0, 0, 0, 0]; + return w[3] += s[3] + d[3], w[2] += w[3] >>> 16, w[3] &= 65535, w[2] += s[2] + d[2], w[1] += w[2] >>> 16, w[2] &= 65535, w[1] += s[1] + d[1], w[0] += w[1] >>> 16, w[1] &= 65535, w[0] += s[0] + d[0], w[0] &= 65535, [w[0] << 16 | w[1], w[2] << 16 | w[3]]; + } + function c(s, d) { + s = [s[0] >>> 16, 65535 & s[0], s[1] >>> 16, 65535 & s[1]], d = [d[0] >>> 16, 65535 & d[0], d[1] >>> 16, 65535 & d[1]]; + var w = [0, 0, 0, 0]; + return w[3] += s[3] * d[3], w[2] += w[3] >>> 16, w[3] &= 65535, w[2] += s[2] * d[3], w[1] += w[2] >>> 16, w[2] &= 65535, w[2] += s[3] * d[2], w[1] += w[2] >>> 16, w[2] &= 65535, w[1] += s[1] * d[3], w[0] += w[1] >>> 16, w[1] &= 65535, w[1] += s[2] * d[2], w[0] += w[1] >>> 16, w[1] &= 65535, w[1] += s[3] * d[1], w[0] += w[1] >>> 16, w[1] &= 65535, w[0] += s[0] * d[3] + s[1] * d[2] + s[2] * d[1] + s[3] * d[0], w[0] &= 65535, [w[0] << 16 | w[1], w[2] << 16 | w[3]]; + } + function a(s, d) { + return (d %= 64) == 32 ? [s[1], s[0]] : d < 32 ? [s[0] << d | s[1] >>> 32 - d, s[1] << d | s[0] >>> 32 - d] : (d -= 32, [s[1] << d | s[0] >>> 32 - d, s[0] << d | s[1] >>> 32 - d]); + } + function g(s, d) { + return (d %= 64) == 0 ? s : d < 32 ? [s[0] << d | s[1] >>> 32 - d, s[1] << d] : [s[1] << d - 32, 0]; + } + function b(s, d) { + return [s[0] ^ d[0], s[1] ^ d[1]]; + } + function y(s) { + return s = b(s, [0, s[0] >>> 1]), s = b(s = c(s, [4283543511, 3981806797]), [0, s[0] >>> 1]), s = b(s = c(s, [3301882366, 444984403]), [0, s[0] >>> 1]); + } + t.x86.hash32 = function(s, d) { + d = d || 0; + for (var w = (s = s || "").length % 4, O = s.length - w, m = d, f = 0, i = 3432918353, u = 461845907, l = 0; l < O; l += 4) f = e(f = 255 & s.charCodeAt(l) | (255 & s.charCodeAt(l + 1)) << 8 | (255 & s.charCodeAt(l + 2)) << 16 | (255 & s.charCodeAt(l + 3)) << 24, i), f = e(f = r(f, 15), u), m = e(m = r(m ^= f, 13), 5) + 3864292196; + switch (f = 0, w) { + case 3: + f ^= (255 & s.charCodeAt(l + 2)) << 16; + case 2: + f ^= (255 & s.charCodeAt(l + 1)) << 8; + case 1: + f = e(f ^= 255 & s.charCodeAt(l), i), m ^= f = e(f = r(f, 15), u); + } + return (m = n(m ^= s.length)) >>> 0; + }, t.x86.hash128 = function(s, d) { + d = d || 0; + for (var w = (s = s || "").length % 16, O = s.length - w, m = d, f = d, i = d, u = d, l = 0, p = 0, h = 0, E = 0, S = 597399067, C = 2869860233, j = 951274213, lt = 2716044179, x = 0; x < O; x += 16) l = 255 & s.charCodeAt(x) | (255 & s.charCodeAt(x + 1)) << 8 | (255 & s.charCodeAt(x + 2)) << 16 | (255 & s.charCodeAt(x + 3)) << 24, p = 255 & s.charCodeAt(x + 4) | (255 & s.charCodeAt(x + 5)) << 8 | (255 & s.charCodeAt(x + 6)) << 16 | (255 & s.charCodeAt(x + 7)) << 24, h = 255 & s.charCodeAt(x + 8) | (255 & s.charCodeAt(x + 9)) << 8 | (255 & s.charCodeAt(x + 10)) << 16 | (255 & s.charCodeAt(x + 11)) << 24, E = 255 & s.charCodeAt(x + 12) | (255 & s.charCodeAt(x + 13)) << 8 | (255 & s.charCodeAt(x + 14)) << 16 | (255 & s.charCodeAt(x + 15)) << 24, l = r(l = e(l, S), 15), m = r(m ^= l = e(l, C), 19), m = e(m += f, 5) + 1444728091, p = r(p = e(p, C), 16), f = r(f ^= p = e(p, j), 17), f = e(f += i, 5) + 197830471, h = r(h = e(h, j), 17), i = r(i ^= h = e(h, lt), 15), i = e(i += u, 5) + 2530024501, E = r(E = e(E, lt), 18), u = r(u ^= E = e(E, S), 13), u = e(u += m, 5) + 850148119; + switch (l = 0, p = 0, h = 0, E = 0, w) { + case 15: + E ^= s.charCodeAt(x + 14) << 16; + case 14: + E ^= s.charCodeAt(x + 13) << 8; + case 13: + E = e(E ^= s.charCodeAt(x + 12), lt), u ^= E = e(E = r(E, 18), S); + case 12: + h ^= s.charCodeAt(x + 11) << 24; + case 11: + h ^= s.charCodeAt(x + 10) << 16; + case 10: + h ^= s.charCodeAt(x + 9) << 8; + case 9: + h = e(h ^= s.charCodeAt(x + 8), j), i ^= h = e(h = r(h, 17), lt); + case 8: + p ^= s.charCodeAt(x + 7) << 24; + case 7: + p ^= s.charCodeAt(x + 6) << 16; + case 6: + p ^= s.charCodeAt(x + 5) << 8; + case 5: + p = e(p ^= s.charCodeAt(x + 4), C), f ^= p = e(p = r(p, 16), j); + case 4: + l ^= s.charCodeAt(x + 3) << 24; + case 3: + l ^= s.charCodeAt(x + 2) << 16; + case 2: + l ^= s.charCodeAt(x + 1) << 8; + case 1: + l = e(l ^= s.charCodeAt(x), S), m ^= l = e(l = r(l, 15), C); + } + return m ^= s.length, m += f ^= s.length, m += i ^= s.length, f += m += u ^= s.length, i += m, u += m, m = n(m), m += f = n(f), m += i = n(i), f += m += u = n(u), i += m, u += m, ("00000000" + (m >>> 0).toString(16)).slice(-8) + ("00000000" + (f >>> 0).toString(16)).slice(-8) + ("00000000" + (i >>> 0).toString(16)).slice(-8) + ("00000000" + (u >>> 0).toString(16)).slice(-8); + }, t.x64.hash128 = function(s, d) { + d = d || 0; + for (var w = (s = s || "").length % 16, O = s.length - w, m = [0, d], f = [0, d], i = [0, 0], u = [0, 0], l = [2277735313, 289559509], p = [1291169091, 658871167], h = 0; h < O; h += 16) i = [255 & s.charCodeAt(h + 4) | (255 & s.charCodeAt(h + 5)) << 8 | (255 & s.charCodeAt(h + 6)) << 16 | (255 & s.charCodeAt(h + 7)) << 24, 255 & s.charCodeAt(h) | (255 & s.charCodeAt(h + 1)) << 8 | (255 & s.charCodeAt(h + 2)) << 16 | (255 & s.charCodeAt(h + 3)) << 24], u = [255 & s.charCodeAt(h + 12) | (255 & s.charCodeAt(h + 13)) << 8 | (255 & s.charCodeAt(h + 14)) << 16 | (255 & s.charCodeAt(h + 15)) << 24, 255 & s.charCodeAt(h + 8) | (255 & s.charCodeAt(h + 9)) << 8 | (255 & s.charCodeAt(h + 10)) << 16 | (255 & s.charCodeAt(h + 11)) << 24], i = a(i = c(i, l), 31), m = o(m = a(m = b(m, i = c(i, p)), 27), f), m = o(c(m, [0, 5]), [0, 1390208809]), u = a(u = c(u, p), 33), f = o(f = a(f = b(f, u = c(u, l)), 31), m), f = o(c(f, [0, 5]), [0, 944331445]); + switch (i = [0, 0], u = [0, 0], w) { + case 15: + u = b(u, g([0, s.charCodeAt(h + 14)], 48)); + case 14: + u = b(u, g([0, s.charCodeAt(h + 13)], 40)); + case 13: + u = b(u, g([0, s.charCodeAt(h + 12)], 32)); + case 12: + u = b(u, g([0, s.charCodeAt(h + 11)], 24)); + case 11: + u = b(u, g([0, s.charCodeAt(h + 10)], 16)); + case 10: + u = b(u, g([0, s.charCodeAt(h + 9)], 8)); + case 9: + u = c(u = b(u, [0, s.charCodeAt(h + 8)]), p), f = b(f, u = c(u = a(u, 33), l)); + case 8: + i = b(i, g([0, s.charCodeAt(h + 7)], 56)); + case 7: + i = b(i, g([0, s.charCodeAt(h + 6)], 48)); + case 6: + i = b(i, g([0, s.charCodeAt(h + 5)], 40)); + case 5: + i = b(i, g([0, s.charCodeAt(h + 4)], 32)); + case 4: + i = b(i, g([0, s.charCodeAt(h + 3)], 24)); + case 3: + i = b(i, g([0, s.charCodeAt(h + 2)], 16)); + case 2: + i = b(i, g([0, s.charCodeAt(h + 1)], 8)); + case 1: + i = c(i = b(i, [0, s.charCodeAt(h)]), l), m = b(m, i = c(i = a(i, 31), p)); + } + return m = o(m = b(m, [0, s.length]), f = b(f, [0, s.length])), f = o(f, m), m = o(m = y(m), f = y(f)), f = o(f, m), ("00000000" + (m[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (m[1] >>> 0).toString(16)).slice(-8) + ("00000000" + (f[0] >>> 0).toString(16)).slice(-8) + ("00000000" + (f[1] >>> 0).toString(16)).slice(-8); + }, Dt.exports && (Ft = Dt.exports = t), Ft.murmurHash3 = t; +}(); +const Vn = Rt(re.exports); +var Cr = {}, Rr = { exports: {} }, xr = { 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; +})(xr); +var In = xr.exports; +(function(t) { + var e = In.default; + function r(n) { + if (typeof WeakMap != "function") return null; + var o = /* @__PURE__ */ new WeakMap(), c = /* @__PURE__ */ new WeakMap(); + return (r = function(a) { + return a ? c : 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 c = r(o); + if (c && c.has(n)) return c.get(n); + var a = { __proto__: null }, g = Object.defineProperty && Object.getOwnPropertyDescriptor; + for (var b in n) if (b !== "default" && {}.hasOwnProperty.call(n, b)) { + var y = g ? Object.getOwnPropertyDescriptor(n, b) : null; + y && (y.get || y.set) ? Object.defineProperty(a, b, y) : a[b] = n[b]; + } + return a.default = n, c && c.set(n, a), a; + }, t.exports.__esModule = !0, t.exports.default = t.exports; +})(Rr); +var qn = Rr.exports.default; +Object.defineProperty(Cr, "__esModule", { value: !0 }); +var Kn = Cr.default = function(t) { + var e = Je.useRef(); + return e.current = t, Je.useCallback(function() { + for (var r, n = arguments.length, o = new Array(n), c = 0; c < n; c++) o[c] = arguments[c]; + return (r = e.current) === null || r === void 0 ? void 0 : r.call.apply(r, [e].concat(o)); + }, []); +}, Je = qn(ze), Tr = { exports: {} }; +Tr.exports = function(t) { + var e = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]; + function r(f, i) { + var u = f[0], l = f[1], p = f[2], h = f[3]; + l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & p | ~l & h) + i[0] - 680876936 | 0) << 7 | u >>> 25) + l | 0) & l | ~u & p) + i[1] - 389564586 | 0) << 12 | h >>> 20) + u | 0) & u | ~h & l) + i[2] + 606105819 | 0) << 17 | p >>> 15) + h | 0) & h | ~p & u) + i[3] - 1044525330 | 0) << 22 | l >>> 10) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & p | ~l & h) + i[4] - 176418897 | 0) << 7 | u >>> 25) + l | 0) & l | ~u & p) + i[5] + 1200080426 | 0) << 12 | h >>> 20) + u | 0) & u | ~h & l) + i[6] - 1473231341 | 0) << 17 | p >>> 15) + h | 0) & h | ~p & u) + i[7] - 45705983 | 0) << 22 | l >>> 10) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & p | ~l & h) + i[8] + 1770035416 | 0) << 7 | u >>> 25) + l | 0) & l | ~u & p) + i[9] - 1958414417 | 0) << 12 | h >>> 20) + u | 0) & u | ~h & l) + i[10] - 42063 | 0) << 17 | p >>> 15) + h | 0) & h | ~p & u) + i[11] - 1990404162 | 0) << 22 | l >>> 10) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & p | ~l & h) + i[12] + 1804603682 | 0) << 7 | u >>> 25) + l | 0) & l | ~u & p) + i[13] - 40341101 | 0) << 12 | h >>> 20) + u | 0) & u | ~h & l) + i[14] - 1502002290 | 0) << 17 | p >>> 15) + h | 0) & h | ~p & u) + i[15] + 1236535329 | 0) << 22 | l >>> 10) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & h | p & ~h) + i[1] - 165796510 | 0) << 5 | u >>> 27) + l | 0) & p | l & ~p) + i[6] - 1069501632 | 0) << 9 | h >>> 23) + u | 0) & l | u & ~l) + i[11] + 643717713 | 0) << 14 | p >>> 18) + h | 0) & u | h & ~u) + i[0] - 373897302 | 0) << 20 | l >>> 12) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & h | p & ~h) + i[5] - 701558691 | 0) << 5 | u >>> 27) + l | 0) & p | l & ~p) + i[10] + 38016083 | 0) << 9 | h >>> 23) + u | 0) & l | u & ~l) + i[15] - 660478335 | 0) << 14 | p >>> 18) + h | 0) & u | h & ~u) + i[4] - 405537848 | 0) << 20 | l >>> 12) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & h | p & ~h) + i[9] + 568446438 | 0) << 5 | u >>> 27) + l | 0) & p | l & ~p) + i[14] - 1019803690 | 0) << 9 | h >>> 23) + u | 0) & l | u & ~l) + i[3] - 187363961 | 0) << 14 | p >>> 18) + h | 0) & u | h & ~u) + i[8] + 1163531501 | 0) << 20 | l >>> 12) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l & h | p & ~h) + i[13] - 1444681467 | 0) << 5 | u >>> 27) + l | 0) & p | l & ~p) + i[2] - 51403784 | 0) << 9 | h >>> 23) + u | 0) & l | u & ~l) + i[7] + 1735328473 | 0) << 14 | p >>> 18) + h | 0) & u | h & ~u) + i[12] - 1926607734 | 0) << 20 | l >>> 12) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l ^ p ^ h) + i[5] - 378558 | 0) << 4 | u >>> 28) + l | 0) ^ l ^ p) + i[8] - 2022574463 | 0) << 11 | h >>> 21) + u | 0) ^ u ^ l) + i[11] + 1839030562 | 0) << 16 | p >>> 16) + h | 0) ^ h ^ u) + i[14] - 35309556 | 0) << 23 | l >>> 9) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l ^ p ^ h) + i[1] - 1530992060 | 0) << 4 | u >>> 28) + l | 0) ^ l ^ p) + i[4] + 1272893353 | 0) << 11 | h >>> 21) + u | 0) ^ u ^ l) + i[7] - 155497632 | 0) << 16 | p >>> 16) + h | 0) ^ h ^ u) + i[10] - 1094730640 | 0) << 23 | l >>> 9) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l ^ p ^ h) + i[13] + 681279174 | 0) << 4 | u >>> 28) + l | 0) ^ l ^ p) + i[0] - 358537222 | 0) << 11 | h >>> 21) + u | 0) ^ u ^ l) + i[3] - 722521979 | 0) << 16 | p >>> 16) + h | 0) ^ h ^ u) + i[6] + 76029189 | 0) << 23 | l >>> 9) + p | 0, l = ((l += ((p = ((p += ((h = ((h += ((u = ((u += (l ^ p ^ h) + i[9] - 640364487 | 0) << 4 | u >>> 28) + l | 0) ^ l ^ p) + i[12] - 421815835 | 0) << 11 | h >>> 21) + u | 0) ^ u ^ l) + i[15] + 530742520 | 0) << 16 | p >>> 16) + h | 0) ^ h ^ u) + i[2] - 995338651 | 0) << 23 | l >>> 9) + p | 0, l = ((l += ((h = ((h += (l ^ ((u = ((u += (p ^ (l | ~h)) + i[0] - 198630844 | 0) << 6 | u >>> 26) + l | 0) | ~p)) + i[7] + 1126891415 | 0) << 10 | h >>> 22) + u | 0) ^ ((p = ((p += (u ^ (h | ~l)) + i[14] - 1416354905 | 0) << 15 | p >>> 17) + h | 0) | ~u)) + i[5] - 57434055 | 0) << 21 | l >>> 11) + p | 0, l = ((l += ((h = ((h += (l ^ ((u = ((u += (p ^ (l | ~h)) + i[12] + 1700485571 | 0) << 6 | u >>> 26) + l | 0) | ~p)) + i[3] - 1894986606 | 0) << 10 | h >>> 22) + u | 0) ^ ((p = ((p += (u ^ (h | ~l)) + i[10] - 1051523 | 0) << 15 | p >>> 17) + h | 0) | ~u)) + i[1] - 2054922799 | 0) << 21 | l >>> 11) + p | 0, l = ((l += ((h = ((h += (l ^ ((u = ((u += (p ^ (l | ~h)) + i[8] + 1873313359 | 0) << 6 | u >>> 26) + l | 0) | ~p)) + i[15] - 30611744 | 0) << 10 | h >>> 22) + u | 0) ^ ((p = ((p += (u ^ (h | ~l)) + i[6] - 1560198380 | 0) << 15 | p >>> 17) + h | 0) | ~u)) + i[13] + 1309151649 | 0) << 21 | l >>> 11) + p | 0, l = ((l += ((h = ((h += (l ^ ((u = ((u += (p ^ (l | ~h)) + i[4] - 145523070 | 0) << 6 | u >>> 26) + l | 0) | ~p)) + i[11] - 1120210379 | 0) << 10 | h >>> 22) + u | 0) ^ ((p = ((p += (u ^ (h | ~l)) + i[2] + 718787259 | 0) << 15 | p >>> 17) + h | 0) | ~u)) + i[9] - 343485551 | 0) << 21 | l >>> 11) + p | 0, f[0] = u + f[0] | 0, f[1] = l + f[1] | 0, f[2] = p + f[2] | 0, f[3] = h + f[3] | 0; + } + function n(f) { + var i, u = []; + for (i = 0; i < 64; i += 4) u[i >> 2] = f.charCodeAt(i) + (f.charCodeAt(i + 1) << 8) + (f.charCodeAt(i + 2) << 16) + (f.charCodeAt(i + 3) << 24); + return u; + } + function o(f) { + var i, u = []; + for (i = 0; i < 64; i += 4) u[i >> 2] = f[i] + (f[i + 1] << 8) + (f[i + 2] << 16) + (f[i + 3] << 24); + return u; + } + function c(f) { + var i, u, l, p, h, E, S = f.length, C = [1732584193, -271733879, -1732584194, 271733878]; + for (i = 64; i <= S; i += 64) r(C, n(f.substring(i - 64, i))); + for (u = (f = f.substring(i - 64)).length, l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i = 0; i < u; i += 1) l[i >> 2] |= f.charCodeAt(i) << (i % 4 << 3); + if (l[i >> 2] |= 128 << (i % 4 << 3), i > 55) for (r(C, l), i = 0; i < 16; i += 1) l[i] = 0; + return p = (p = 8 * S).toString(16).match(/(.*?)(.{0,8})$/), h = parseInt(p[2], 16), E = parseInt(p[1], 16) || 0, l[14] = h, l[15] = E, r(C, l), C; + } + function a(f) { + var i, u, l, p, h, E, S = f.length, C = [1732584193, -271733879, -1732584194, 271733878]; + for (i = 64; i <= S; i += 64) r(C, o(f.subarray(i - 64, i))); + for (u = (f = i - 64 < S ? f.subarray(i - 64) : new Uint8Array(0)).length, l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i = 0; i < u; i += 1) l[i >> 2] |= f[i] << (i % 4 << 3); + if (l[i >> 2] |= 128 << (i % 4 << 3), i > 55) for (r(C, l), i = 0; i < 16; i += 1) l[i] = 0; + return p = (p = 8 * S).toString(16).match(/(.*?)(.{0,8})$/), h = parseInt(p[2], 16), E = parseInt(p[1], 16) || 0, l[14] = h, l[15] = E, r(C, l), C; + } + function g(f) { + var i, u = ""; + for (i = 0; i < 4; i += 1) u += e[f >> 8 * i + 4 & 15] + e[f >> 8 * i & 15]; + return u; + } + function b(f) { + var i; + for (i = 0; i < f.length; i += 1) f[i] = g(f[i]); + return f.join(""); + } + function y(f) { + return /[\u0080-\uFFFF]/.test(f) && (f = unescape(encodeURIComponent(f))), f; + } + function s(f, i) { + var u, l = f.length, p = new ArrayBuffer(l), h = new Uint8Array(p); + for (u = 0; u < l; u += 1) h[u] = f.charCodeAt(u); + return i ? h : p; + } + function d(f) { + return String.fromCharCode.apply(null, new Uint8Array(f)); + } + function w(f, i, u) { + var l = new Uint8Array(f.byteLength + i.byteLength); + return l.set(new Uint8Array(f)), l.set(new Uint8Array(i), f.byteLength), l; + } + function O(f) { + var i, u = [], l = f.length; + for (i = 0; i < l - 1; i += 2) u.push(parseInt(f.substr(i, 2), 16)); + return String.fromCharCode.apply(String, u); + } + function m() { + this.reset(); + } + return b(c("hello")), typeof ArrayBuffer > "u" || ArrayBuffer.prototype.slice || function() { + function f(i, u) { + return (i = 0 | i || 0) < 0 ? Math.max(i + u, 0) : Math.min(i, u); + } + ArrayBuffer.prototype.slice = function(i, u) { + var l, p, h, E, S = this.byteLength, C = f(i, S), j = S; + return u !== t && (j = f(u, S)), C > j ? new ArrayBuffer(0) : (l = j - C, p = new ArrayBuffer(l), h = new Uint8Array(p), E = new Uint8Array(this, C, l), h.set(E), p); + }; + }(), m.prototype.append = function(f) { + return this.appendBinary(y(f)), this; + }, m.prototype.appendBinary = function(f) { + this._buff += f, this._length += f.length; + var i, u = this._buff.length; + for (i = 64; i <= u; i += 64) r(this._hash, n(this._buff.substring(i - 64, i))); + return this._buff = this._buff.substring(i - 64), this; + }, m.prototype.end = function(f) { + var i, u, l = this._buff, p = l.length, h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (i = 0; i < p; i += 1) h[i >> 2] |= l.charCodeAt(i) << (i % 4 << 3); + return this._finish(h, p), u = b(this._hash), f && (u = O(u)), this.reset(), u; + }, m.prototype.reset = function() { + return this._buff = "", this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this; + }, m.prototype.getState = function() { + return { buff: this._buff, length: this._length, hash: this._hash.slice() }; + }, m.prototype.setState = function(f) { + return this._buff = f.buff, this._length = f.length, this._hash = f.hash, this; + }, m.prototype.destroy = function() { + delete this._hash, delete this._buff, delete this._length; + }, m.prototype._finish = function(f, i) { + var u, l, p, h = i; + if (f[h >> 2] |= 128 << (h % 4 << 3), h > 55) for (r(this._hash, f), h = 0; h < 16; h += 1) f[h] = 0; + u = (u = 8 * this._length).toString(16).match(/(.*?)(.{0,8})$/), l = parseInt(u[2], 16), p = parseInt(u[1], 16) || 0, f[14] = l, f[15] = p, r(this._hash, f); + }, m.hash = function(f, i) { + return m.hashBinary(y(f), i); + }, m.hashBinary = function(f, i) { + var u = b(c(f)); + return i ? O(u) : u; + }, m.ArrayBuffer = function() { + this.reset(); + }, m.ArrayBuffer.prototype.append = function(f) { + var i, u = w(this._buff.buffer, f), l = u.length; + for (this._length += f.byteLength, i = 64; i <= l; i += 64) r(this._hash, o(u.subarray(i - 64, i))); + return this._buff = i - 64 < l ? new Uint8Array(u.buffer.slice(i - 64)) : new Uint8Array(0), this; + }, m.ArrayBuffer.prototype.end = function(f) { + var i, u, l = this._buff, p = l.length, h = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + for (i = 0; i < p; i += 1) h[i >> 2] |= l[i] << (i % 4 << 3); + return this._finish(h, p), u = b(this._hash), f && (u = O(u)), this.reset(), u; + }, m.ArrayBuffer.prototype.reset = function() { + return this._buff = new Uint8Array(0), this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this; + }, m.ArrayBuffer.prototype.getState = function() { + var f = m.prototype.getState.call(this); + return f.buff = d(f.buff), f; + }, m.ArrayBuffer.prototype.setState = function(f) { + return f.buff = s(f.buff, !0), m.prototype.setState.call(this, f); + }, m.ArrayBuffer.prototype.destroy = m.prototype.destroy, m.ArrayBuffer.prototype._finish = m.prototype._finish, m.ArrayBuffer.hash = function(f, i) { + var u = b(a(new Uint8Array(f))); + return i ? O(u) : u; + }, m; +}(); +const Gn = Rt(Tr.exports); +export { + zn as C, + ct as L, + Vn as M, + Hn as N, + Gn as S, + Jn as _, + Kn as a, + _ as b, + $n as c, + te as o +}; diff --git a/dist/common/vender-hQk7ADWo.js b/dist/common/vender-hQk7ADWo.js deleted file mode 100644 index baa8c7e..0000000 --- a/dist/common/vender-hQk7ADWo.js +++ /dev/null @@ -1,1951 +0,0 @@ -import Me from "react"; -function Be(t, e) { - return function() { - return t.apply(e, arguments); - }; -} -const { toString: yr } = Object.prototype, { getPrototypeOf: zt } = Object, ft = (bt = /* @__PURE__ */ Object.create(null), (t) => { - const e = yr.call(t); - return bt[e] || (bt[e] = e.slice(8, -1).toLowerCase()); -}); -var bt; -const M = (t) => (t = t.toLowerCase(), (e) => ft(e) === t), yt = (t) => (e) => typeof e === t, { isArray: J } = Array, Y = yt("undefined"), Qt = M("ArrayBuffer"), mr = yt("string"), k = yt("function"), Zt = yt("number"), ot = (t) => t !== null && typeof t == "object", st = (t) => { - if (ft(t) !== "object") return !1; - const e = zt(t); - return !(e !== null && e !== Object.prototype && Object.getPrototypeOf(e) !== null || Symbol.toStringTag in t || Symbol.iterator in t); -}, gr = M("Date"), br = M("File"), wr = M("Blob"), vr = M("FileList"), Er = M("URLSearchParams"), [Or, Ar, Sr, Cr] = ["ReadableStream", "Request", "Response", "Headers"].map(M); -function tt(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 a = r ? Object.getOwnPropertyNames(t) : Object.keys(t), c = a.length; - let g; - for (n = 0; n < c; n++) g = a[n], e.call(null, t[g], g, t); - } -} -function Yt(t, e) { - e = e.toLowerCase(); - const r = Object.keys(t); - let n, o = r.length; - for (; o-- > 0; ) if (n = r[o], e === n.toLowerCase()) return n; - return null; -} -const Le = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, te = (t) => !Y(t) && t !== Le, Rr = (wt = typeof Uint8Array < "u" && zt(Uint8Array), (t) => wt && t instanceof wt); -var wt; -const xr = M("HTMLFormElement"), ee = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Tr = M("RegExp"), re = (t, e) => { - const r = Object.getOwnPropertyDescriptors(t), n = {}; - tt(r, (o, a) => { - let c; - (c = e(o, a, t)) !== !1 && (n[a] = c || o); - }), Object.defineProperties(t, n); -}, vt = "abcdefghijklmnopqrstuvwxyz", ne = "0123456789", oe = { DIGIT: ne, ALPHA: vt, ALPHA_DIGIT: vt + vt.toUpperCase() + ne }, _r = M("AsyncFunction"), v = { isArray: J, isArrayBuffer: Qt, isBuffer: function(t) { - return t !== null && !Y(t) && t.constructor !== null && !Y(t.constructor) && k(t.constructor.isBuffer) && t.constructor.isBuffer(t); -}, isFormData: (t) => { - let e; - return t && (typeof FormData == "function" && t instanceof FormData || k(t.append) && ((e = ft(t)) === "formdata" || e === "object" && k(t.toString) && t.toString() === "[object FormData]")); -}, isArrayBufferView: function(t) { - let e; - return e = typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer && Qt(t.buffer), e; -}, isString: mr, isNumber: Zt, isBoolean: (t) => t === !0 || t === !1, isObject: ot, isPlainObject: st, isReadableStream: Or, isRequest: Ar, isResponse: Sr, isHeaders: Cr, isUndefined: Y, isDate: gr, isFile: br, isBlob: wr, isRegExp: Tr, isFunction: k, isStream: (t) => ot(t) && k(t.pipe), isURLSearchParams: Er, isTypedArray: Rr, isFileList: vr, forEach: tt, merge: function t() { - const { caseless: e } = te(this) && this || {}, r = {}, n = (o, a) => { - const c = e && Yt(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, a = arguments.length; o < a; o++) arguments[o] && tt(arguments[o], n); - return r; -}, extend: (t, e, r, { allOwnKeys: n } = {}) => (tt(e, (o, a) => { - r && k(o) ? t[a] = Be(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, a, c; - const g = {}; - if (e = e || {}, t == null) return e; - do { - for (o = Object.getOwnPropertyNames(t), a = o.length; a-- > 0; ) c = o[a], n && !n(c, t, e) || g[c] || (e[c] = t[c], g[c] = !0); - t = r !== !1 && zt(t); - } while (t && (!r || r(t, e)) && t !== Object.prototype); - return e; -}, kindOf: ft, kindOfTest: M, endsWith: (t, e, r) => { - t = String(t), (r === void 0 || r > t.length) && (r = t.length), r -= e.length; - const n = t.indexOf(e, r); - return n !== -1 && n === r; -}, toArray: (t) => { - if (!t) return null; - if (J(t)) return t; - let e = t.length; - if (!Zt(e)) return null; - const r = new Array(e); - for (; e-- > 0; ) r[e] = t[e]; - return r; -}, forEachEntry: (t, e) => { - const r = (t && t[Symbol.iterator]).call(t); - let n; - for (; (n = r.next()) && !n.done; ) { - const o = n.value; - e.call(t, o[0], o[1]); - } -}, matchAll: (t, e) => { - let r; - const n = []; - for (; (r = t.exec(e)) !== null; ) n.push(r); - return n; -}, isHTMLForm: xr, hasOwnProperty: ee, hasOwnProp: ee, reduceDescriptors: re, freezeMethods: (t) => { - re(t, (e, r) => { - if (k(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1) return !1; - const n = t[r]; - k(n) && (e.enumerable = !1, "writable" in e ? e.writable = !1 : e.set || (e.set = () => { - throw Error("Can not rewrite read-only method '" + r + "'"); - })); - }); -}, toObjectSet: (t, e) => { - const r = {}, n = (o) => { - 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: Yt, global: Le, isContextDefined: te, ALPHABET: oe, generateString: (t = 16, e = oe.ALPHA_DIGIT) => { - let r = ""; - const { length: n } = e; - for (; t--; ) r += e[Math.random() * n | 0]; - return r; -}, isSpecCompliantForm: function(t) { - return !!(t && k(t.append) && t[Symbol.toStringTag] === "FormData" && t[Symbol.iterator]); -}, toJSONObject: (t) => { - const e = new Array(10), r = (n, o) => { - if (ot(n)) { - if (e.indexOf(n) >= 0) return; - if (!("toJSON" in n)) { - e[o] = n; - const a = J(n) ? [] : {}; - return tt(n, (c, g) => { - const y = r(c, o + 1); - !Y(y) && (a[g] = y); - }), e[o] = void 0, a; - } - } - return n; - }; - return r(t, 0); -}, isAsyncFn: _r, 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); -} -v.inherits(C, Error, { toJSON: function() { - 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: v.toJSONObject(this.config), code: this.code, status: this.response && this.response.status ? this.response.status : null }; -} }); -const se = C.prototype, ie = {}; -["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) => { - ie[t] = { value: t }; -}), Object.defineProperties(C, ie), Object.defineProperty(se, "isAxiosError", { value: !0 }), C.from = (t, e, r, n, o, a) => { - const c = Object.create(se); - return v.toFlatObject(t, c, function(g) { - return g !== Error.prototype; - }, (g) => g !== "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 De(t) { - return v.endsWith(t, "[]") ? t.slice(0, -2) : t; -} -function ae(t, e, r) { - return t ? t.concat(e).map(function(n, o) { - return n = De(n), !r && o ? "[" + n + "]" : n; - }).join(r ? "." : "") : e; -} -const Pr = v.toFlatObject(v, {}, null, function(t) { - return /^is[A-Z]/.test(t); -}); -function ht(t, e, r) { - if (!v.isObject(t)) throw new TypeError("target must be an object"); - 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 || m, a = r.dots, c = r.indexes, g = (r.Blob || typeof Blob < "u" && Blob) && v.isSpecCompliantForm(e); - if (!v.isFunction(o)) throw new TypeError("visitor must be a function"); - function y(w) { - if (w === null) return ""; - if (v.isDate(w)) return w.toISOString(); - if (!g && v.isBlob(w)) throw new C("Blob is not supported. Use a Buffer instead."); - return v.isArrayBuffer(w) || v.isTypedArray(w) ? g && typeof Blob == "function" ? new Blob([w]) : Buffer.from(w) : w; - } - 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 = De(E), l.forEach(function(i, u) { - !v.isUndefined(i) && i !== null && e.append(c === !0 ? ae([E], u, a) : c === null ? E : E + "[]", y(i)); - }), !1; - } - return !!Et(w) || (e.append(ae(d, E, a), y(w)), !1); - } - const s = [], b = Object.assign(Pr, { defaultVisitor: m, convertValue: y, isVisitable: Et }); - if (!v.isObject(t)) throw new TypeError("data must be an object"); - return function w(E, d) { - if (!v.isUndefined(E)) { - if (s.indexOf(E) !== -1) throw Error("Circular reference detected in " + d.join(".")); - s.push(E), v.forEach(E, function(l, i) { - (!(v.isUndefined(l) || l === null) && o.call(e, l, v.isString(i) ? i.trim() : i, d, b)) === !0 && w(l, d ? d.concat(i) : [i]); - }), s.pop(); - } - }(t), e; -} -function ce(t) { - const e = { "!": "%21", "'": "%27", "(": "%28", ")": "%29", "~": "%7E", "%20": "+", "%00": "\0" }; - return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g, function(r) { - return e[r]; - }); -} -function Vt(t, e) { - this._pairs = [], t && ht(t, this, e); -} -const ue = Vt.prototype; -function jr(t) { - return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); -} -function Fe(t, e, r) { - if (!e) return t; - const n = r && r.encode || jr, o = r && r.serialize; - let a; - if (a = o ? o(e, r) : v.isURLSearchParams(e) ? e.toString() : new Vt(e, r).toString(n), a) { - const c = t.indexOf("#"); - c !== -1 && (t = t.slice(0, c)), t += (t.indexOf("?") === -1 ? "?" : "&") + a; - } - return t; -} -ue.append = function(t, e) { - this._pairs.push([t, e]); -}, ue.toString = function(t) { - const e = t ? function(r) { - return t.call(this, r, ce); - } : ce; - return this._pairs.map(function(r) { - return e(r[0]) + "=" + e(r[1]); - }, "").join("&"); -}; -class le { - constructor() { - this.handlers = []; - } - use(e, r, n) { - return this.handlers.push({ fulfilled: e, rejected: r, synchronous: !!n && n.synchronous, runWhen: n ? n.runWhen : null }), this.handlers.length - 1; - } - eject(e) { - this.handlers[e] && (this.handlers[e] = null); - } - clear() { - this.handlers && (this.handlers = []); - } - forEach(e) { - v.forEach(this.handlers, function(r) { - r !== null && e(r); - }); - } -} -const Ie = { silentJSONParsing: !0, forcedJSONParsing: !0, clarifyTimeoutError: !1 }, Nr = { isBrowser: !0, classes: { URLSearchParams: typeof URLSearchParams < "u" ? URLSearchParams : Vt, FormData: typeof FormData < "u" ? FormData : null, Blob: typeof Blob < "u" ? Blob : null }, protocols: ["http", "https", "file", "blob", "url", "data"] }, Kt = typeof window < "u" && typeof document < "u", kr = (fe = typeof navigator < "u" && navigator.product, Kt && ["ReactNative", "NativeScript", "NS"].indexOf(fe) < 0); -var fe; -const Ur = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Mr = Kt && window.location.href || "http://localhost", U = { ...Object.freeze(Object.defineProperty({ __proto__: null, hasBrowserEnv: Kt, hasStandardBrowserEnv: kr, hasStandardBrowserWebWorkerEnv: Ur, origin: Mr }, Symbol.toStringTag, { value: "Module" })), ...Nr }; -function qe(t) { - function e(r, n, o, a) { - let c = r[a++]; - if (c === "__proto__") return !0; - const g = Number.isFinite(+c), y = a >= r.length; - return c = !c && v.isArray(o) ? o.length : c, y ? (v.hasOwnProp(o, c) ? o[c] = [o[c], n] : o[c] = n, !g) : (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] = m[d]; - return s; - }(o[c])), !g); - } - if (v.isFormData(t) && v.isFunction(t.entries)) { - const r = {}; - return v.forEachEntry(t, (n, o) => { - 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: Ie, 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(qe(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 a; - if (o) { - if (r.indexOf("application/x-www-form-urlencoded") > -1) return function(c, g) { - return ht(c, new U.classes.URLSearchParams(), Object.assign({ visitor: function(y, m, s, b) { - return U.isNode && v.isBuffer(y) ? (this.append(m, y.toString("base64")), !1) : b.defaultVisitor.apply(this, arguments); - } }, g)); - }(t, this.formSerializer).toString(); - 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(c, g, y) { - if (v.isString(c)) try { - return (g || JSON.parse)(c), v.trim(c); - } catch (m) { - if (m.name !== "SyntaxError") throw m; - } - return (y || JSON.stringify)(c); - }(t)) : t; -}], transformResponse: [function(t) { - const e = this.transitional || rt.transitional, r = e && e.forcedJSONParsing, n = this.responseType === "json"; - if (v.isResponse(t) || v.isReadableStream(t)) return t; - if (t && v.isString(t) && (r && !this.responseType || n)) { - const o = !(e && e.silentJSONParsing) && n; - try { - return JSON.parse(t); - } catch (a) { - if (o) - throw a.name === "SyntaxError" ? C.from(a, C.ERR_BAD_RESPONSE, this, null, this.response) : a; - } - } - return t; -}], timeout: 0, xsrfCookieName: "XSRF-TOKEN", xsrfHeaderName: "X-XSRF-TOKEN", maxContentLength: -1, maxBodyLength: -1, env: { FormData: U.classes.FormData, Blob: U.classes.Blob }, validateStatus: function(t) { - return t >= 200 && t < 300; -}, headers: { common: { Accept: "application/json, text/plain, */*", "Content-Type": void 0 } } }; -v.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => { - rt.headers[t] = {}; -}); -const Br = 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"]), he = Symbol("internals"); -function Q(t) { - return t && String(t).trim().toLowerCase(); -} -function it(t) { - return t === !1 || t == null ? t : v.isArray(t) ? t.map(it) : String(t); -} -function Ot(t, e, r, n, o) { - return v.isFunction(n) ? n.call(this, e, r) : (o && (e = r), v.isString(e) ? v.isString(n) ? e.indexOf(n) !== -1 : v.isRegExp(n) ? n.test(e) : void 0 : void 0); -} -let N = class { - constructor(t) { - t && this.set(t); - } - set(t, e, r) { - const n = this; - function o(c, g, y) { - const m = Q(g); - if (!m) throw new Error("header name must be a non-empty string"); - const s = v.findKey(n, m); - (!s || n[s] === void 0 || y === !0 || y === void 0 && n[s] !== !1) && (n[s || g] = it(c)); - } - const a = (c, g) => v.forEach(c, (y, m) => o(y, m, g)); - 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 g = {}; - let y, m, s; - return c && c.split(` -`).forEach(function(b) { - s = b.indexOf(":"), y = b.substring(0, s).trim().toLowerCase(), m = b.substring(s + 1).trim(), !y || g[y] && Br[y] || (y === "set-cookie" ? g[y] ? g[y].push(m) : g[y] = [m] : g[y] = g[y] ? g[y] + ", " + m : m); - }), g; - })(t), e); - else if (v.isHeaders(t)) for (const [c, g] of t.entries()) o(g, c, r); - else t != null && o(e, t, r); - return this; - } - get(t, e) { - if (t = Q(t)) { - const r = v.findKey(this, t); - if (r) { - const n = this[r]; - if (!e) return n; - if (e === !0) return function(o) { - const a = /* @__PURE__ */ Object.create(null), c = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g; - let g; - for (; g = c.exec(o); ) a[g[1]] = g[2]; - return a; - }(n); - if (v.isFunction(e)) return e.call(this, n, r); - if (v.isRegExp(e)) return e.exec(n); - throw new TypeError("parser must be boolean|regexp|function"); - } - } - } - has(t, e) { - if (t = Q(t)) { - const r = v.findKey(this, t); - return !(!r || this[r] === void 0 || e && !Ot(0, this[r], r, e)); - } - return !1; - } - delete(t, e) { - const r = this; - let n = !1; - function o(a) { - if (a = Q(a)) { - const c = v.findKey(r, a); - !c || e && !Ot(0, r[c], c, e) || (delete r[c], n = !0); - } - } - return v.isArray(t) ? t.forEach(o) : o(t), n; - } - clear(t) { - const e = Object.keys(this); - let r = e.length, n = !1; - for (; r--; ) { - const o = e[r]; - t && !Ot(0, this[o], o, t, !0) || (delete this[o], n = !0); - } - return n; - } - normalize(t) { - const e = this, r = {}; - return v.forEach(this, (n, o) => { - const a = v.findKey(r, o); - if (a) return e[a] = it(n), void delete e[o]; - const c = t ? function(g) { - return g.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (y, m, s) => m.toUpperCase() + s); - }(o) : String(o).trim(); - c !== o && delete e[o], e[c] = it(n), r[c] = !0; - }), this; - } - concat(...t) { - return this.constructor.concat(this, ...t); - } - toJSON(t) { - const e = /* @__PURE__ */ Object.create(null); - return v.forEach(this, (r, n) => { - r != null && r !== !1 && (e[n] = t && v.isArray(r) ? r.join(", ") : r); - }), e; - } - [Symbol.iterator]() { - return Object.entries(this.toJSON())[Symbol.iterator](); - } - toString() { - return Object.entries(this.toJSON()).map(([t, e]) => t + ": " + e).join(` -`); - } - get [Symbol.toStringTag]() { - return "AxiosHeaders"; - } - static from(t) { - return t instanceof this ? t : new this(t); - } - static concat(t, ...e) { - const r = new this(t); - return e.forEach((n) => r.set(n)), r; - } - static accessor(t) { - const e = (this[he] = this[he] = { accessors: {} }).accessors, r = this.prototype; - function n(o) { - const a = Q(o); - e[a] || (function(c, g) { - const y = v.toCamelCase(" " + g); - ["get", "set", "has"].forEach((m) => { - Object.defineProperty(c, m + y, { value: function(s, b, w) { - return this[m].call(this, g, s, b, w); - }, configurable: !0 }); - }); - }(r, o), e[a] = !0); - } - return v.isArray(t) ? t.forEach(n) : n(t), this; - } -}; -function At(t, e) { - const r = this || rt, n = e || r, o = N.from(n.headers); - 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 We(t) { - return !(!t || !t.__CANCEL__); -} -function X(t, e, r) { - C.call(this, t ?? "canceled", C.ERR_CANCELED, e, r), this.name = "CanceledError"; -} -function $e(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); -} -N.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]), v.reduceDescriptors(N.prototype, ({ value: t }, e) => { - let r = e[0].toUpperCase() + e.slice(1); - return { get: () => t, set(n) { - this[r] = n; - } }; -}), v.freezeMethods(N), v.inherits(X, C, { __CANCEL__: !0 }); -const dt = (t, e, r = 3) => { - let n = 0; - const o = function(a, c) { - a = a || 10; - const g = new Array(a), y = new Array(a); - let m, s = 0, b = 0; - return c = c !== void 0 ? c : 1e3, function(w) { - const E = Date.now(), d = y[b]; - m || (m = E), g[s] = w, y[s] = E; - let l = b, i = 0; - for (; l !== s; ) i += g[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(a, c) { - let g = 0; - const y = 1e3 / c; - let m = null; - return function() { - const s = this === !0, b = Date.now(); - if (s || b - g > y) return m && (clearTimeout(m), m = null), g = b, a.apply(null, arguments); - m || (m = setTimeout(() => (m = null, g = Date.now(), a.apply(null, arguments)), y - (b - g))); - }; - }((a) => { - const c = a.loaded, g = a.lengthComputable ? a.total : void 0, y = c - n, m = o(y); - n = c; - const s = { loaded: c, total: g, progress: g ? c / g : void 0, bytes: y, rate: m || void 0, estimated: m && g && c <= g ? (g - c) / m : void 0, event: a, lengthComputable: g != null }; - s[e ? "download" : "upload"] = !0, t(s); - }, r); -}, Lr = U.hasStandardBrowserEnv ? function() { - const t = /(msie|trident)/i.test(navigator.userAgent), e = document.createElement("a"); - let r; - function n(o) { - 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 a = v.isString(o) ? n(o) : o; - return a.protocol === r.protocol && a.host === r.host; - }; -}() : function() { - return !0; -}, Dr = 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; -}, remove(t) { - this.write(t, "", Date.now() - 864e5); -} } : { write() { -}, read: () => null, remove() { -} }; -function He(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; -} -const de = (t) => t instanceof N ? { ...t } : t; -function H(t, e) { - e = e || {}; - const r = {}; - 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(m, s, b) { - return v.isUndefined(s) ? v.isUndefined(m) ? void 0 : n(void 0, m, b) : n(m, s, b); - } - function a(m, s) { - if (!v.isUndefined(s)) return 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 g(m, s, b) { - return b in e ? n(m, s) : b in t ? n(void 0, m) : void 0; - } - const y = { 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: g, headers: (m, s) => o(de(m), de(s), !0) }; - return v.forEach(Object.keys(Object.assign({}, t, e)), function(m) { - const s = y[m] || o, b = s(t[m], e[m], m); - v.isUndefined(b) && s !== g || (r[m] = b); - }), r; -} -const Je = (t) => { - const e = H({}, t); - let r, { data: n, withXSRFToken: o, xsrfHeaderName: a, xsrfCookieName: c, headers: g, auth: y } = e; - if (e.headers = g = N.from(g), e.url = Fe(He(e.baseURL, e.url), t.params, t.paramsSerializer), y && g.set("Authorization", "Basic " + btoa((y.username || "") + ":" + (y.password ? unescape(encodeURIComponent(y.password)) : ""))), v.isFormData(n)) { - if (U.hasStandardBrowserEnv || U.hasStandardBrowserWebWorkerEnv) g.setContentType(void 0); - else if ((r = g.getContentType()) !== !1) { - const [m, ...s] = r ? r.split(";").map((b) => b.trim()).filter(Boolean) : []; - g.setContentType([m || "multipart/form-data", ...s].join("; ")); - } - } - if (U.hasStandardBrowserEnv && (o && v.isFunction(o) && (o = o(e)), o || o !== !1 && Lr(e.url))) { - const m = a && c && Dr.read(c); - m && g.set(a, m); - } - return e; -}, Fr = typeof XMLHttpRequest < "u" && function(t) { - return new Promise(function(e, r) { - const n = Je(t); - let o = n.data; - const a = N.from(n.headers).normalize(); - let c, { responseType: g } = n; - function y() { - n.cancelToken && n.cancelToken.unsubscribe(c), n.signal && n.signal.removeEventListener("abort", c); - } - let m = new XMLHttpRequest(); - function s() { - if (!m) return; - const w = N.from("getAllResponseHeaders" in m && m.getAllResponseHeaders()); - $e(function(E) { - e(E), y(); - }, function(E) { - r(E), y(); - }, { data: g && g !== "text" && g !== "json" ? m.response : m.responseText, status: m.status, statusText: m.statusText, headers: w, config: t, request: m }), m = null; - } - 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 || Ie; - 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), g && g !== "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 X(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)) : m.send(o || null); - }); -}, Ir = (t, e) => { - let r, n = new AbortController(); - const o = function(y) { - if (!r) { - r = !0, c(); - const m = y instanceof Error ? y : this.reason; - n.abort(m instanceof C ? m : new X(m instanceof Error ? m.message : m)); - } - }; - let a = e && setTimeout(() => { - o(new C(`timeout ${e} of ms exceeded`, C.ETIMEDOUT)); - }, e); - const c = () => { - t && (a && clearTimeout(a), a = null, t.forEach((y) => { - y && (y.removeEventListener ? y.removeEventListener("abort", o) : y.unsubscribe(o)); - }), t = null); - }; - t.forEach((y) => y && y.addEventListener && y.addEventListener("abort", o)); - const { signal: g } = n; - return g.unsubscribe = c, [g, () => { - a && clearTimeout(a), a = null; - }]; -}, qr = 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; -}, pe = (t, e, r, n, o) => { - const a = async function* (g, y, m) { - for await (const s of g) yield* qr(ArrayBuffer.isView(s) ? s : await m(String(s)), y); - }(t, e, o); - let c = 0; - return new ReadableStream({ type: "bytes", async pull(g) { - const { done: y, value: m } = await a.next(); - if (y) return g.close(), void n(); - let s = m.byteLength; - r && r(c += s), g.enqueue(new Uint8Array(m)); - }, cancel: (g) => (n(g), a.return()) }, { highWaterMark: 2 }); -}, ye = (t, e) => { - const r = t != null; - return (n) => setTimeout(() => e({ lengthComputable: r, total: t, loaded: n })); -}, mt = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", ze = mt && typeof ReadableStream == "function", Pt = mt && (typeof TextEncoder == "function" ? (me = new TextEncoder(), (t) => me.encode(t)) : async (t) => new Uint8Array(await new Response(t).arrayBuffer())); -var me; -const Wr = ze && (() => { - 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; -})(), jt = ze && !!(() => { - try { - return v.isReadableStream(new Response("").body); - } catch { - } -})(), pt = { stream: jt && ((t) => t.body) }; -var ge; -mt && (ge = new Response(), ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => { - !pt[t] && (pt[t] = v.isFunction(ge[t]) ? (e) => e[t]() : (e, r) => { - throw new C(`Response type '${t}' is not supported`, C.ERR_NOT_SUPPORT, r); - }); -})); -const $r = 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 Pt(n)).byteLength : void 0))(e); -}, Ve = { http: null, xhr: Fr, fetch: mt && (async (t) => { - let { url: e, method: r, data: n, signal: o, cancelToken: a, timeout: c, onDownloadProgress: g, onUploadProgress: y, responseType: m, headers: s, withCredentials: b = "same-origin", fetchOptions: w } = Je(t); - m = m ? (m + "").toLowerCase() : "text"; - let E, d, [l, i] = o || a || c ? Ir([o, a], c) : []; - const u = () => { - !E && setTimeout(() => { - l && l.unsubscribe(); - }), E = !0; - }; - let h; - try { - if (y && Wr && r !== "get" && r !== "head" && (h = await $r(s, n)) !== 0) { - let S, x = new Request(e, { method: "POST", body: n, duplex: "half" }); - v.isFormData(n) && (S = x.headers.get("content-type")) && s.setContentType(S), x.body && (n = pe(x.body, 65536, ye(h, dt(y)), null, Pt)); - } - 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 = jt && (m === "stream" || m === "response"); - if (jt && (g || f)) { - const S = {}; - ["status", "statusText", "headers"].forEach((j) => { - S[j] = p[j]; - }); - const x = v.toFiniteNumber(p.headers.get("content-length")); - p = new Response(pe(p.body, 65536, g && ye(x, dt(g, !0)), f && u, Pt), S); - } - m = m || "text"; - let O = await pt[v.findKey(pt, m) || "text"](p, t); - return !f && u(), i && i(), await new Promise((S, x) => { - $e(S, x, { data: O, headers: N.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(Ve, (t, e) => { - if (t) { - try { - Object.defineProperty(t, "name", { value: e }); - } catch { - } - Object.defineProperty(t, "adapterName", { value: e }); - } -}); -const be = (t) => `- ${t}`, Hr = (t) => v.isFunction(t) || t === null || t === !1, Ke = (t) => { - t = v.isArray(t) ? t : [t]; - const { length: e } = t; - let r, n; - const o = {}; - for (let a = 0; a < e; a++) { - let c; - if (r = t[a], n = r, !Hr(r) && (n = Ve[(c = String(r)).toLowerCase()], n === void 0)) throw new C(`Unknown adapter '${c}'`); - if (n) break; - o[c || "#" + a] = n; - } - if (!n) { - const a = Object.entries(o).map(([c, g]) => `adapter ${c} ` + (g === !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(be).join(` -`) : " " + be(a[0]) : "as no adapter specified"), "ERR_NOT_SUPPORT"); - } - return n; -}; -function St(t) { - if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted) throw new X(null, t); -} -function we(t) { - return St(t), t.headers = N.from(t.headers), t.data = At.call(t, t.transformRequest), ["post", "put", "patch"].indexOf(t.method) !== -1 && t.headers.setContentType("application/x-www-form-urlencoded", !1), Ke(t.adapter || rt.adapter)(t).then(function(e) { - return St(t), e.data = At.call(t, t.transformResponse, e), e.headers = N.from(e.headers), e; - }, function(e) { - return We(e) || (St(t), e && e.response && (e.response.data = At.call(t, t.transformResponse, e.response), e.response.headers = N.from(e.response.headers))), Promise.reject(e); - }); -} -const Jr = "1.7.2", Gt = {}; -["object", "boolean", "number", "function", "string", "symbol"].forEach((t, e) => { - Gt[t] = function(r) { - return typeof r === t || "a" + (e < 1 ? "n " : " ") + t; - }; -}); -const ve = {}; -Gt.transitional = function(t, e, r) { - function n(o, a) { - return "[Axios v1.7.2] Transitional option '" + o + "'" + a + (r ? ". " + r : ""); - } - return (o, a, c) => { - if (t === !1) throw new C(n(a, " has been removed" + (e ? " in " + e : "")), C.ERR_DEPRECATED); - return e && !ve[a] && (ve[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 Nt = { assertOptions: function(t, e, r) { - if (typeof t != "object") throw new C("options must be an object", C.ERR_BAD_OPTION_VALUE); - const n = Object.keys(t); - let o = n.length; - for (; o-- > 0; ) { - const a = n[o], c = e[a]; - if (c) { - const g = t[a], y = g === void 0 || c(g, a, t); - if (y !== !0) throw new C("option " + a + " must be " + y, C.ERR_BAD_OPTION_VALUE); - } else if (r !== !0) throw new C("Unknown option " + a, C.ERR_BAD_OPTION); - } -}, validators: Gt }, F = Nt.validators; -let $ = class { - constructor(t) { - this.defaults = t, this.interceptors = { request: new le(), response: new le() }; - } - async request(t, e) { - try { - return await this._request(t, e); - } catch (r) { - if (r instanceof Error) { - let n; - Error.captureStackTrace ? Error.captureStackTrace(n = {}) : n = new Error(); - const o = n.stack ? n.stack.replace(/^.+\n/, "") : ""; - try { - r.stack ? o && !String(r.stack).endsWith(o.replace(/^.+\n.+\n/, "")) && (r.stack += ` -` + o) : r.stack = o; - } catch { - } - } - throw r; - } - } - _request(t, e) { - 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 && Nt.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 } : Nt.assertOptions(n, { encode: F.function, serialize: F.function }, !0)), e.method = (e.method || this.defaults.method || "get").toLowerCase(); - 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 = N.concat(a, o); - const c = []; - let g = !0; - this.interceptors.request.forEach(function(E) { - typeof E.runWhen == "function" && E.runWhen(e) === !1 || (g = g && E.synchronous, c.unshift(E.fulfilled, E.rejected)); - }); - const y = []; - let m; - this.interceptors.response.forEach(function(E) { - y.push(E.fulfilled, E.rejected); - }); - let s, b = 0; - if (!g) { - const E = [we.bind(this), void 0]; - for (E.unshift.apply(E, c), E.push.apply(E, y), s = E.length, m = Promise.resolve(e); b < s; ) m = m.then(E[b++], E[b++]); - return m; - } - s = c.length; - let w = e; - for (b = 0; b < s; ) { - const E = c[b++], d = c[b++]; - try { - w = E(w); - } catch (l) { - d.call(this, l); - break; - } - } - try { - m = we.call(this, w); - } catch (E) { - return Promise.reject(E); - } - for (b = 0, s = y.length; b < s; ) m = m.then(y[b++], y[b++]); - return m; - } - getUri(t) { - return Fe(He((t = H(this.defaults, t)).baseURL, t.url), t.params, t.paramsSerializer); - } -}; -v.forEach(["delete", "get", "head", "options"], function(t) { - $.prototype[t] = function(e, r) { - return this.request(H(r || {}, { method: t, url: e, data: (r || {}).data })); - }; -}), v.forEach(["post", "put", "patch"], function(t) { - function e(r) { - 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); -}); -const kt = { Continue: 100, SwitchingProtocols: 101, Processing: 102, EarlyHints: 103, Ok: 200, Created: 201, Accepted: 202, NonAuthoritativeInformation: 203, NoContent: 204, ResetContent: 205, PartialContent: 206, MultiStatus: 207, AlreadyReported: 208, ImUsed: 226, MultipleChoices: 300, MovedPermanently: 301, Found: 302, SeeOther: 303, NotModified: 304, UseProxy: 305, Unused: 306, TemporaryRedirect: 307, PermanentRedirect: 308, BadRequest: 400, Unauthorized: 401, PaymentRequired: 402, Forbidden: 403, NotFound: 404, MethodNotAllowed: 405, NotAcceptable: 406, ProxyAuthenticationRequired: 407, RequestTimeout: 408, Conflict: 409, Gone: 410, LengthRequired: 411, PreconditionFailed: 412, PayloadTooLarge: 413, UriTooLong: 414, UnsupportedMediaType: 415, RangeNotSatisfiable: 416, ExpectationFailed: 417, ImATeapot: 418, MisdirectedRequest: 421, UnprocessableEntity: 422, Locked: 423, FailedDependency: 424, TooEarly: 425, UpgradeRequired: 426, PreconditionRequired: 428, TooManyRequests: 429, RequestHeaderFieldsTooLarge: 431, UnavailableForLegalReasons: 451, InternalServerError: 500, NotImplemented: 501, BadGateway: 502, ServiceUnavailable: 503, GatewayTimeout: 504, HttpVersionNotSupported: 505, VariantAlsoNegotiates: 506, InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, NetworkAuthenticationRequired: 511 }; -Object.entries(kt).forEach(([t, e]) => { - kt[e] = t; -}); -const _ = function t(e) { - const r = new $(e), n = Be($.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); -_.Axios = $, _.CanceledError = X, _.CancelToken = class Ge { - constructor(e) { - if (typeof e != "function") throw new TypeError("executor must be a function."); - let r; - this.promise = new Promise(function(o) { - r = o; - }); - const n = this; - this.promise.then((o) => { - if (!n._listeners) return; - let a = n._listeners.length; - for (; a-- > 0; ) n._listeners[a](o); - n._listeners = null; - }), this.promise.then = (o) => { - let a; - const c = new Promise((g) => { - n.subscribe(g), a = g; - }).then(o); - return c.cancel = function() { - n.unsubscribe(a); - }, c; - }, e(function(o, a, c) { - n.reason || (n.reason = new X(o, a, c), r(n.reason)); - }); - } - throwIfRequested() { - if (this.reason) throw this.reason; - } - subscribe(e) { - this.reason ? e(this.reason) : this._listeners ? this._listeners.push(e) : this._listeners = [e]; - } - unsubscribe(e) { - if (!this._listeners) return; - const r = this._listeners.indexOf(e); - r !== -1 && this._listeners.splice(r, 1); - } - static source() { - let e; - return { token: new Ge(function(r) { - e = r; - }), cancel: e }; - } -}, _.isCancel = We, _.VERSION = Jr, _.toFormData = ht, _.AxiosError = C, _.Cancel = _.CanceledError, _.all = function(t) { - return Promise.all(t); -}, _.spread = function(t) { - return function(e) { - return t.apply(null, e); - }; -}, _.isAxiosError = function(t) { - return v.isObject(t) && t.isAxiosError === !0; -}, _.mergeConfig = H, _.AxiosHeaders = N, _.formToJSON = (t) => qe(v.isHTMLForm(t) ? new FormData(t) : t), _.getAdapter = Ke, _.HttpStatusCode = kt, _.default = _; -const { Axios: zr, AxiosError: Vr, CanceledError: Kr, isCancel: Gr, CancelToken: Xr, VERSION: Qr, all: Zr, Cancel: Yr, isAxiosError: tn, spread: en, toFormData: rn, AxiosHeaders: nn, HttpStatusCode: on, formToJSON: sn, getAdapter: an, mergeConfig: cn } = _, un = Object.freeze(Object.defineProperty({ __proto__: null, Axios: zr, AxiosError: Vr, AxiosHeaders: nn, Cancel: Yr, CancelToken: Xr, CanceledError: Kr, HttpStatusCode: on, VERSION: Qr, all: Zr, default: _, formToJSON: sn, getAdapter: an, isAxiosError: tn, isCancel: Gr, mergeConfig: cn, spread: en, toFormData: rn }, Symbol.toStringTag, { value: "Module" })); -function gt(t) { - return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; -} -function ln(t) { - if (t.__esModule) return t; - var e = t.default; - if (typeof e == "function") { - var r = function n() { - return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments); - }; - r.prototype = e.prototype; - } else r = {}; - return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) { - var o = Object.getOwnPropertyDescriptor(t, n); - Object.defineProperty(r, n, o.get ? o : { enumerable: !0, get: function() { - return t[n]; - } }); - }), r; -} -var Ut = { exports: {} }; -const Ee = ln(un), Xe = 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, 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; - return !0; - } - 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 = (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 c = a[o]; - if (!t(e[c], r[c])) return !1; - } - return !0; - } - return e != e && r != r; -}, Qe = function(t) { - return t != null && t.constructor != null && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t); -}, Ze = ( - /*! - * MIT License - * - * Copyright (c) Sindre Sorhus (https://sindresorhus.com) - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated - * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the - * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit - * persons to whom the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE - * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - function(t) { - return typeof Blob < "u" && (t instanceof Blob || Object.prototype.toString.call(t) === "[object Blob]"); - } -), Ye = Object.prototype.toString; -function Oe(t, e) { - const r = t.length; - for (let n = 0; n < r; n++) { - const o = t[n]; - if (e(o)) return o; - } -} -function Xt(t) { - return t !== null && typeof t == "object"; -} -function fn(t) { - return Xt(t) && function(e) { - return Ye.call(e) === "[object Function]"; - }(t.pipe); -} -function Ae(t, e) { - return t ? `${t.replace(/\/+$/, "")}/${e.replace(/^\/+/, "")}` : e; -} -function Se(t, e) { - return (t[0] === "/" ? t.substr(1) : t) === (e[0] === "/" ? e.substr(1) : e); -} -function Ce(t, e, r) { - return Mt(e, r.params) && function(n, o) { - if (o === void 0) return !0; - let a; - try { - a = JSON.parse(n); - } catch { - } - return Mt(a || n, o); - }(t, r.data); -} -function Mt(t, e) { - return e === void 0 || (typeof e.asymmetricMatch == "function" ? e.asymmetricMatch(t) : Xe(t, e)); -} -function hn(t) { - return e = t, Ye.call(e) === "[object ArrayBuffer]" || Qe(t) || fn(t) || Ze(t) ? t : Xt(t) ? JSON.parse(JSON.stringify(t)) : t; - var e; -} -function Re(t, e, r, n) { - if (typeof Ee.AxiosError == "function") return Ee.AxiosError.from(new Error(t), n, e, null, r); - const o = new Error(t); - return o.isAxiosError = !0, o.config = e, r !== void 0 && (o.response = r), n !== void 0 && (o.code = n), o.toJSON = function() { - 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 tr = { find: Oe, findHandler: function(t, e, r, n, o, a, c) { - return Oe(t[e.toLowerCase()], function(g) { - let y = !1; - return typeof g.url == "string" ? y = Se(r, g.url) || Se(Ae(c, r), g.url) : g.url instanceof RegExp && (y = g.url.test(r) || g.url.test(Ae(c, r))), y && Ce(n, o, g) && Mt(a, g.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, a) { - typeof o == "function" && (o = await o(a)); - const c = o.status || o[0], g = hn(o.data || o[1]), y = o.headers || o[2]; - return o.config && (a = o.config), { status: c, data: g, headers: y, config: a, request: { responseURL: a.url } }; - }(e, t); - if (!n.config.validateStatus || n.config.validateStatus(n.status)) return n; - throw Re(`Request failed with status code ${n.status}`, n.config, n); -}, isObjectOrArray: Xt, isBuffer: Qe, isBlob: Ze, isBodyOrParametersMatching: Ce, isEqual: Xe, createAxiosError: Re, 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 Z = tr; -function xe(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 dn = 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 = Z.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 && Z.purgeIfReplyOnce(t, n), n.passThrough ? xe(t, e) : Z.settle(e, n.response, function(o, a) { - return typeof a.delay == "number" ? a.delay : o.delayResponse; - }(t, n)); - switch (t.onNoMatch) { - case "passthrough": - return xe(t, e); - case "throwException": - throw Z.createCouldNotFindMockError(e); - default: - return Z.settle(e, { status: 404 }, t.delayResponse); - } -}, D = tr, er = ["get", "post", "head", "delete", "patch", "put", "options", "list", "link", "unlink"]; -function Te() { - const t = []; - return er.forEach(function(e) { - Object.defineProperty(t, e, { get: () => t.filter(function(r) { - return !r.method || r.method === e; - }) }); - }), t; -} -class Ct { - constructor(e, r = {}) { - if (this.reset(), !e) throw new Error("Please provide an instance of axios to mock"); - 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) => dn(this, e); - } - restore() { - this.axiosInstance && (this.axiosInstance.defaults.adapter = this.originalAdapter, this.axiosInstance = void 0); - } - reset() { - this.resetHandlers(), this.resetHistory(); - } - resetHandlers() { - this.handlers ? this.handlers.length = 0 : this.handlers = Te(); - } - resetHistory() { - this.history ? this.history.length = 0 : this.history = Te(); - } -} -const pn = ["any", "get", "delete", "head", "options"], yn = ["headers", "params", "data"]; -function _e(t, e) { - for (const r in e) if (!yn.includes(r)) throw new Error(`Invalid config property ${JSON.stringify(r)} provided to ${rr(t)}. Config: ${JSON.stringify(e)}`); - return e; -} -function rr(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, a) { - let c = -1; - for (let g = 0; g < o.length; g += 1) { - const y = o[g], m = y.url instanceof RegExp && a.url instanceof RegExp ? String(y.url) === String(a.url) : y.url === a.url; - (!y.method || y.method === a.method) && m && D.isEqual(y.params, a.params) && D.isEqual(y.data, a.data) && D.isEqual(y.headers, a.headers) && !y.replyOnce && (c = g); - } - return c; - }(e, r); - n > -1 && !r.replyOnce ? e.splice(n, 1, r) : e.push(r); - } -} -er.concat("any").forEach(function(t) { - Ct.prototype[rr(t)] = function(e, r, n) { - const o = this; - let a; - e = e === void 0 ? /.*/ : e; - const c = function(s, b, w) { - return pn.includes(s) ? _e(s, b || {}) : _e(s, Object.assign({}, w, { data: b })); - }(t, r, n); - 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: !1, delay: a, 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: 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: g, replyOnce: y, 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: c.params, data: c.data, headers: c.headers }; - return Rt(t, o.handlers, s), o; - }, abortRequest: () => g(async function(s) { - throw D.createAxiosError("Request aborted", s, void 0, "ECONNABORTED"); - }), abortRequestOnce: () => y(async function(s) { - throw D.createAxiosError("Request aborted", s, void 0, "ECONNABORTED"); - }), networkError: () => g(async function(s) { - throw D.createAxiosError("Network Error", s); - }), networkErrorOnce: () => y(async function(s) { - throw D.createAxiosError("Network Error", s); - }), timeout: () => 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"); - }), timeoutOnce: () => 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"); - }) }; - return m; - }; -}), Ut.exports = Ct, Ut.exports.default = Ct; -const xn = gt(Ut.exports); -var mn = Object.defineProperty, nr = (t) => { - throw TypeError(t); -}, T = (t, e, r) => ((n, o, a) => o in n ? mn(n, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : n[o] = a)(t, typeof e != "symbol" ? e + "" : e, r), or = (t, e, r) => e.has(t) || nr("Cannot " + r), A = (t, e, r) => (or(t, e, "read from private field"), r ? r.call(t) : e.get(t)), P = (t, e, r) => e.has(t) ? nr("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, r), B = (t, e, r, n) => (or(t, e, "write to private field"), e.set(t, r), r); -function gn(t) { - return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t; -} -var Pe, sr = {}; -Pe = sr, function(t, e) { - var r = e(); - for (var n in r) Pe[n] = r[n]; -}(0, function() { - var t = function(a) { - return typeof a != "string" ? a : a.replace(/[\+ \|\^\%]/g, function(c) { - return { " ": "+", "+": "%2B", "|": "%7C", "^": "%5E", "%": "%25" }[c]; - }); - }, 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(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 g = c || 0, y = this.length; g < y; g++) if (this[g] === a) return g; - return -1; - }; - return { JSON, pack: function(a, c) { - var g = (c = c || {}).verbose || !1; - g && console.log("Normalize the JSON Object"), a = typeof a == "string" ? this.JSON.parse(a) : a, g && console.log("Creating a empty dictionary"); - var y = { strings: [], integers: [], floats: [] }; - g && console.log("Creating the AST"); - var m = function E(d) { - g && 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 }; - if (d instanceof Array) { - var u = ["@"]; - for (var h in d) d.hasOwnProperty(h) && u.push(E(d[h])); - return u; - } - if (i === "object") { - for (var p in u = ["$"], d) d.hasOwnProperty(p) && (u.push(E(p)), u.push(E(d[p]))); - 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 === "boolean") return { type: "boolean", index: d ? -1 : -2 }; - throw new Error("Unexpected argument of type " + typeof d); - }(a), s = y.strings.length, b = y.integers.length; - y.floats.length, g && console.log("Parsing the dictionary"); - var w = y.strings.join("|"); - return w += "^" + y.integers.join("|"), w += "^" + y.floats.join("|"), g && console.log("Parsing the structure"), w += "^" + function E(d) { - if (g && 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) + "]"; - } - var u = d.type, h = d.index; - if (u === "strings") return r(h); - if (u === "integers") return r(s + h); - if (u === "floats") return r(s + b + h); - if (u === "boolean") return d.index; - if (u === "null") return -3; - if (u === "undefined") return -5; - if (u === "empty") return -4; - throw new TypeError("The item is alien!"); - }(m), g && console.log("Ending parser"), c.debug ? { dictionary: y, ast: m, packed: w } : w; - }, unpack: function(a, c) { - c = c || {}; - var g = a.split("^"); - c.verbose && console.log("Building dictionary"); - var y = [], m = g[0]; - if (m !== "") { - m = m.split("|"), c.verbose && console.log("Parse the strings dictionary"); - for (var s = 0, b = m.length; s < b; s++) y.push(e(m[s])); - } - if ((m = g[1]) !== "") for (m = m.split("|"), c.verbose && console.log("Parse the integers dictionary"), s = 0, b = m.length; s < b; s++) y.push(n(m[s])); - if ((m = g[2]) !== "") for (m = m.split("|"), c.verbose && console.log("Parse the floats dictionary"), s = 0, b = m.length; s < b; s++) y.push(parseFloat(m[s])); - m = null, c.verbose && console.log("Tokenizing the structure"); - var w = "", E = [], d = g[3].length; - for (s = 0; s < d; s++) { - var l = g[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 c.verbose && console.log("Starting recursive parser"), function h() { - var p = E[u++]; - if (c.verbose && console.log("Reading collection type " + (p === "$" ? "object" : "Array")), p === "@") { - for (var f = []; u < i; u++) { - var O = E[u]; - if (c.verbose && console.log("Read " + O + " symbol"), O === "]") return f; - if (O === "@" || O === "$") f.push(h()); - else switch (O) { - case -1: - f.push(!0); - break; - case -2: - f.push(!1); - break; - case -3: - f.push(null); - break; - case -5: - f.push(void 0); - break; - case -4: - f.push(""); - break; - default: - f.push(y[O]); - } - } - return c.verbose && console.log("Parsed " + this.JSON.stringify(f)), f; - } - if (p === "$") { - for (f = {}; u < i; u++) { - var S = E[u]; - if (S === "]") return f; - if (S = S === -4 ? "" : y[S], (O = E[++u]) === "@" || O === "$") f[S] = h(); - else switch (O) { - case -1: - f[S] = !0; - break; - case -2: - f[S] = !1; - break; - case -3: - f[S] = null; - break; - case -5: - f[S] = void 0; - break; - case -4: - f[S] = ""; - break; - default: - f[S] = y[O]; - } - } - return c.verbose && console.log("Parsed " + this.JSON.stringify(f)), f; - } - throw new TypeError("Bad token " + p + " isn't a type"); - }(); - } }; -}); -const je = gn(sr); -var z, et, V, I, Bt, Lt, at, Dt, Ft, It; -class qt { - constructor(e, r, n, o, a) { - return T(this, "code", 0), T(this, "message", "操作成功"), T(this, "data", null), T(this, "url", ""), T(this, "res", ""), P(this, z), P(this, et, !0), P(this, V, !0), P(this, I, { get: (c, g) => A(this, Bt).call(this, g), ownKeys: () => Object.keys(A(this, I).getPrototypeOf() || {}), getPrototypeOf: () => A(this, et) ? this : this.data, getOwnPropertyDescriptor: () => ({ configurable: !0, enumerable: !0, writable: !0, value: A(this, I).getPrototypeOf() }) }), P(this, Bt, (c) => c === "$echoMsg" ? A(this, at) : c === "msg" ? A(this, Lt) : c === "then" || c === "resp" ? (B(this, V, !0), B(this, et, c === "resp"), A(this, Dt)) : c === "catch" ? A(this, Ft) : c === "finally" ? A(this, It) : c === "IS_ECHO_MSG" ? A(this, V) : Reflect.get(this, c)), P(this, Lt, (c = (y) => y, g = !1) => (A(this, at).call(this), B(this, et, g), Promise.resolve(c == null ? void 0 : c(A(this, I).getPrototypeOf())))), P(this, at, () => { - A(this, V) && (B(this, V, !1), Ht.onMsg(this.code, this.message)); - }), P(this, Dt, (c) => [0, 1].includes(this.code) ? Promise.resolve(c == null ? void 0 : c(A(this, I).getPrototypeOf())) : Promise.reject(A(this, z))), P(this, Ft, (c) => Promise.resolve(c(A(this, z)))), P(this, It, (c) => (c == null || c(), [0, 1].includes(this.code) ? Promise.resolve(A(this, I).getPrototypeOf()) : Promise.reject(A(this, z)))), this.code = e, this.message = r, this.data = n, this.url = o, this.res = a, B(this, z, new Proxy(this, A(this, I))); - } -} -z = /* @__PURE__ */ new WeakMap(), et = /* @__PURE__ */ new WeakMap(), V = /* @__PURE__ */ new WeakMap(), I = /* @__PURE__ */ new WeakMap(), Bt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), at = /* @__PURE__ */ new WeakMap(), Dt = /* @__PURE__ */ new WeakMap(), Ft = /* @__PURE__ */ new WeakMap(), It = /* @__PURE__ */ new WeakMap(); -const xt = (t, e, r, n = "/", o = "") => new qt(t, e, r, n, o); -var Ne = ["utf8", "utf-8", "unicode-1-1-utf-8"], ir = { TextEncoder: function(t) { - if (Ne.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 a = 0; a < o.length; a++) n[a] = o[a].charCodeAt(0); - return n; - }; -}, TextDecoder: function(t) { - if (Ne.indexOf(t) < 0 && typeof t < "u" && t != null) throw new RangeError("Invalid encoding type. Only utf-8 is supported"); - this.encoding = "utf-8", this.decode = function(e, r) { - if (typeof e > "u") return ""; - 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), 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 bn = new ir.TextEncoder("utf8"); -new ir.TextDecoder("utf8"); -class wn { - constructor(e) { - 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); - for (let r = 0; r < e.length; r++) this.decodeMap[e.charCodeAt(r)] = r; - } - encode(e) { - if (!e || e.length === 0) return ""; - const r = new vn(this).encodeV2(e); - return String.fromCharCode(...r); - } - decode(e) { - if (!e || e.length === 0) return ""; - const r = new En(this).decode(e); - return new TextDecoder().decode(r); - } -} -var ct, ut, K, W, Wt, L, q, G, $t, lt; -class vn { - constructor(e) { - P(this, ct), T(this, "src", new Uint8Array()), T(this, "pos", 0), B(this, ct, e); - } - get6bits() { - let e = 7 & this.pos, r = this.pos >> 3; - e === 0 && (r -= 1, e = 8); - let n = this.src[r] >> 8 - e; - return e < 6 && r > 0 && (n |= this.src[r - 1] << e), 63 & n; - } - encodeV2(e) { - this.src = function(n) { - return bn.encode(n || ""); - }(e), this.pos = 8 * this.src.length; - const r = []; - for (; this.pos > 0; ) { - let n = 6, o = this.get6bits(); - !(30 & ~o) && ((this.pos > 6 || o > 31) && (n = 5), o &= 31), r.push(A(this, ct).encodeTable[o].charCodeAt(0)), this.pos -= n; - } - return r; - } -} -ct = /* @__PURE__ */ new WeakMap(); -class En { - constructor(e) { - P(this, ut), B(this, ut, e); - } - decode(e) { - const r = new Uint8Array(Math.ceil(6 * e.length / 8) + 1); - let n = r.length, o = 0, a = 0; - for (let c = 0; c < e.length; c++) { - const g = e[c].charCodeAt(0), y = A(this, ut).decodeMap[g]; - if (y === 255) throw new Error(`CorruptInputError at index ${c}`); - c === e.length - 1 ? (a |= y << o, o += Math.ceil(Math.log2(y + 1))) : 30 & ~y ? (a |= y << o, o += 6) : (a |= y << o, o += 5), o >= 8 && (n--, r[n] = 255 & a, o %= 8, a >>= 8); - } - return o > 0 && (n--, r[n] = 255 & a), r.slice(n); - } -} -ut = /* @__PURE__ */ new WeakMap(), Promise.withResolvers || (Promise.withResolvers = function() { - let t, e; - return { promise: new Promise((r, n) => { - t = r, e = n; - }), resolve: t, reject: e }; -}); -class Ht { - constructor(e, r, n) { - P(this, K), P(this, W), P(this, Wt), P(this, L, { "#": /* @__PURE__ */ new Map(), $: /* @__PURE__ */ new Map() }), P(this, q, /* @__PURE__ */ new Map()), P(this, G, /* @__PURE__ */ new Set()), T(this, "init", (o, a, c) => { - o && B(this, Wt, o), c && B(this, K, c), a && B(this, W, new wn(a)), A(this, $t).call(this); - }), P(this, $t, () => { - !A(this, G).size || !A(this, K) || (A(this, G).forEach((o) => A(this, lt).call(this, ...o)), A(this, G).clear()); - }), P(this, lt, (o, a, c, g = !1) => { - if (A(this, K)) { - const { url: y, method: m, ...s } = c || {}; - A(this, K).call(this, { url: y, method: m, ...s }).then((b) => { - if (![0, 1].includes(b.code)) throw xt(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) ?? ""]; - }).then((b) => { - const w = b; - return (a == "#" || m == "GET") && A(this, L)[a].set(o, w), a != "#" && m == "GET" && !g && setTimeout(() => { - A(this, L)[a].delete(o); - }, 300), w; - }).then((b) => { - var w; - return (w = A(this, q).get(o)) == null ? void 0 : w.forEach((E, d, l) => { - E && E[0](b), delete l[d]; - }); - }).catch((b) => { - var w; - A(this, L)[a].delete(o), (w = A(this, q).get(o)) == null || w.forEach((E, d, l) => { - E && E[1](b instanceof qt ? b : xt(-1, b, null, y)), delete l[d]; - }); - }).finally(() => A(this, q).delete(o)); - } else A(this, G).add([o, a, c, g]); - }), T(this, "request", ({ url: o = "/", method: a = "GET", ...c }, g = !1) => { - var y, m; - o = function(i, u) { - return i.replace(new RegExp(`^${u}+|${u}+$`, "g"), ""); - }(o, "/"); - 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, c])), w = (y = o == null ? void 0 : o.includes) != null && y.call(o, "/_/") ? "#" : "$", { promise: E, resolve: d, reject: l } = Promise.withResolvers(); - return A(this, L)[w].has(b) ? (console.log("cache", o), d(A(this, L)[w].get(b))) : A(this, q).has(b) ? (m = A(this, q).get(b)) == null || m.push([d, l]) : (A(this, q).set(b, [[d, l]]), A(this, lt).call(this, b, w, { url: o, method: s, ...c }, g)), new Proxy(E, { get: (i, u) => (...h) => i.then((p) => xt(...p)[u](...h)).catch((p) => { - if (!(p instanceof qt)) throw p; - return typeof p[u] == "function" ? p[u](...h) : p[u]; - }) }); - }), 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 && A(this, L)["#"].clear(), A(this, L).$.clear(); - }), T(this, "decode", (o = "", a = {}) => { - if (o === void 0 || o === "" || o === null) return a; - try { - if (!A(this, W)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); - const c = A(this, W).decode(o); - return je.unpack(c); - } catch { - return console.warn("core.decode", o), a; - } - }), T(this, "encode", (o = {}) => { - if (!A(this, W)) throw new Error("未初始化 appSecret,请先通过 init 设置 appSecret"); - const a = JSON.stringify(o, (c, g) => g === void 0 ? null : g); - return A(this, W).encode(je.pack(a)); - }), this.init(e, r, n); - } -} -K = /* @__PURE__ */ new WeakMap(), W = /* @__PURE__ */ new WeakMap(), Wt = /* @__PURE__ */ new WeakMap(), L = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), G = /* @__PURE__ */ new WeakMap(), $t = /* @__PURE__ */ new WeakMap(), lt = /* @__PURE__ */ new WeakMap(), Ht.onUnhandledRejection = (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)); -}, Ht.onMsg = (t, e) => [0, 1].includes(t) ? console.log(e) : console.warn(e); -var ar = { exports: {} }; -/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */ -ar.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 a(d) { - return 100 * (-1 + d); - } - function c(d, l, i) { - var 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; - for (l in d) (i = d[l]) !== void 0 && d.hasOwnProperty(l) && (n[l] = i); - return this; - }, r.status = null, r.set = function(d) { - 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, g(function(f) { - n.positionUsing === "" && (n.positionUsing = r.getPositioningCSS()), y(u, c(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() { - r.remove(), f(); - }, h); - }, h)) : setTimeout(f, h); - }), this; - }, r.isStarted = function() { - return typeof r.status == "number"; - }, r.start = function() { - r.status || r.set(0); - var d = function() { - setTimeout(function() { - r.status && (r.trickle(), d()); - }, n.trickleSpeed); - }; - return n.trickle && d(), this; - }, r.done = function(d) { - return d || r.status ? r.inc(0.3 + 0.5 * Math.random()).set(1) : this; - }, r.inc = function(d) { - var l = r.status; - return l ? (typeof d != "number" && (d = (1 - l) * o(Math.random() * l, 0.1, 0.95)), l = o(l + d, 0, 0.994), r.set(l)) : r.start(); - }, r.trickle = function() { - return r.inc(Math.random() * n.trickleRate); - }, t = 0, e = 0, r.promise = function(d) { - return d && d.state() !== "resolved" ? (e === 0 && r.start(), t++, e++, d.always(function() { - --e == 0 ? (t = 0, r.done()) : r.set((t - e) / t); - }), this) : this; - }, r.render = function(d) { - if (r.isRendered()) return document.getElementById("nprogress"); - 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" : a(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; - }, r.remove = function() { - b(document.documentElement, "nprogress-busy"), b(document.querySelector(n.parent), "nprogress-custom-parent"); - var d = document.getElementById("nprogress"); - d && E(d); - }, r.isRendered = function() { - return !!document.getElementById("nprogress"); - }, r.getPositioningCSS = 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 g = /* @__PURE__ */ function() { - var d = []; - function l() { - var i = d.shift(); - i && i(l); - } - return function(i) { - d.push(i), d.length == 1 && l(); - }; - }(), y = /* @__PURE__ */ function() { - var d = ["Webkit", "O", "Moz", "ms"], l = {}; - function i(f) { - return f.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function(O, S) { - return S.toUpperCase(); - }); - } - function u(f) { - var O = document.body.style; - if (f in O) return f; - for (var S, x = d.length, j = f.charAt(0).toUpperCase() + f.slice(1); x--; ) if ((S = d[x] + j) in O) return S; - return f; - } - function h(f) { - return f = i(f), l[f] || (l[f] = u(f)); - } - function p(f, O, S) { - O = h(O), f.style[O] = S; - } - return function(f, O) { - var S, x, j = arguments; - if (j.length == 2) for (S in O) (x = O[S]) !== void 0 && O.hasOwnProperty(S) && p(f, S, x); - else p(f, j[1], j[2]); - }; - }(); - 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; - m(i, l) || (d.className = u.substring(1)); - } - function b(d, l) { - var i, u = w(d); - m(d, l) && (i = u.replace(" " + l + " ", " "), d.className = i.substring(1, i.length - 1)); - } - function w(d) { - return (" " + (d.className || "") + " ").replace(/\s+/gi, " "); - } - function E(d) { - d && d.parentNode && d.parentNode.removeChild(d); - } - return r; -}(); -const Tn = gt(ar.exports); -var cr = {}, ur = { exports: {} }, lr = { 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; -})(lr); -var On = lr.exports; -(function(t) { - var e = On.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 }, g = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var y in n) if (y !== "default" && {}.hasOwnProperty.call(n, y)) { - var m = g ? Object.getOwnPropertyDescriptor(n, y) : null; - m && (m.get || m.set) ? Object.defineProperty(c, y, m) : c[y] = n[y]; - } - return c.default = n, a && a.set(n, c), c; - }, t.exports.__esModule = !0, t.exports.default = t.exports; -})(ur); -var An = ur.exports.default; -Object.defineProperty(cr, "__esModule", { value: !0 }); -var _n = cr.default = function(t) { - var e = ke.useRef(); - return e.current = t, ke.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)); - }, []); -}, ke = An(Me), Tt, _t, Jt = { exports: {} }; -Tt = Jt, _t = Jt.exports, function() { - var t = { version: "3.0.1", x86: {}, x64: {} }; - function e(s, b) { - return (65535 & s) * b + (((s >>> 16) * b & 65535) << 16); - } - function r(s, b) { - return s << b | s >>> 32 - b; - } - function n(s) { - return s = e(s ^= s >>> 16, 2246822507), s = e(s ^= s >>> 13, 3266489909), s ^= s >>> 16; - } - function o(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[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 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 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 g(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) { - return [s[0] ^ b[0], s[1] ^ b[1]]; - } - function m(s) { - return s = y(s, [0, s[0] >>> 1]), s = y(s = a(s, [4283543511, 3981806797]), [0, s[0] >>> 1]), s = y(s = a(s, [3301882366, 444984403]), [0, s[0] >>> 1]); - } - t.x86.hash32 = function(s, b) { - b = b || 0; - for (var w = (s = s || "").length % 4, E = s.length - w, d = b, l = 0, i = 3432918353, u = 461845907, h = 0; h < E; h += 4) l = e(l = 255 & s.charCodeAt(h) | (255 & s.charCodeAt(h + 1)) << 8 | (255 & s.charCodeAt(h + 2)) << 16 | (255 & s.charCodeAt(h + 3)) << 24, i), l = e(l = r(l, 15), u), d = e(d = r(d ^= l, 13), 5) + 3864292196; - switch (l = 0, w) { - case 3: - l ^= (255 & s.charCodeAt(h + 2)) << 16; - case 2: - l ^= (255 & s.charCodeAt(h + 1)) << 8; - case 1: - l = e(l ^= 255 & s.charCodeAt(h), i), d ^= l = e(l = r(l, 15), u); - } - 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, O = 0, S = 597399067, x = 2869860233, j = 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, O = 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, S), 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, j), 17), l = e(l += i, 5) + 197830471, f = r(f = e(f, j), 17), i = r(i ^= f = e(f, nt), 15), i = e(i += u, 5) + 2530024501, O = r(O = e(O, nt), 18), u = r(u ^= O = e(O, S), 13), u = e(u += d, 5) + 850148119; - switch (h = 0, p = 0, f = 0, O = 0, w) { - case 15: - O ^= s.charCodeAt(R + 14) << 16; - case 14: - O ^= s.charCodeAt(R + 13) << 8; - case 13: - O = e(O ^= s.charCodeAt(R + 12), nt), u ^= O = e(O = r(O, 18), S); - case 12: - f ^= s.charCodeAt(R + 11) << 24; - case 11: - f ^= s.charCodeAt(R + 10) << 16; - case 10: - f ^= s.charCodeAt(R + 9) << 8; - case 9: - f = e(f ^= s.charCodeAt(R + 8), j), i ^= f = e(f = r(f, 17), nt); - case 8: - p ^= s.charCodeAt(R + 7) << 24; - case 7: - p ^= s.charCodeAt(R + 6) << 16; - case 6: - p ^= s.charCodeAt(R + 5) << 8; - case 5: - p = e(p ^= s.charCodeAt(R + 4), x), l ^= p = e(p = r(p, 16), j); - case 4: - h ^= s.charCodeAt(R + 3) << 24; - case 3: - h ^= s.charCodeAt(R + 2) << 16; - case 2: - h ^= s.charCodeAt(R + 1) << 8; - case 1: - h = e(h ^= s.charCodeAt(R), S), 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 = c(i = a(i, h), 31), d = o(d = c(d = y(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 = y(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, g([0, s.charCodeAt(f + 14)], 48)); - case 14: - u = y(u, g([0, s.charCodeAt(f + 13)], 40)); - case 13: - u = y(u, g([0, s.charCodeAt(f + 12)], 32)); - case 12: - u = y(u, g([0, s.charCodeAt(f + 11)], 24)); - case 11: - u = y(u, g([0, s.charCodeAt(f + 10)], 16)); - case 10: - u = y(u, g([0, s.charCodeAt(f + 9)], 8)); - case 9: - u = a(u = y(u, [0, s.charCodeAt(f + 8)]), p), l = y(l, u = a(u = c(u, 33), h)); - case 8: - i = y(i, g([0, s.charCodeAt(f + 7)], 56)); - case 7: - i = y(i, g([0, s.charCodeAt(f + 6)], 48)); - case 6: - i = y(i, g([0, s.charCodeAt(f + 5)], 40)); - case 5: - i = y(i, g([0, s.charCodeAt(f + 4)], 32)); - case 4: - i = y(i, g([0, s.charCodeAt(f + 3)], 24)); - case 3: - i = y(i, g([0, s.charCodeAt(f + 2)], 16)); - case 2: - i = y(i, g([0, s.charCodeAt(f + 1)], 8)); - case 1: - i = a(i = y(i, [0, s.charCodeAt(f)]), h), d = y(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 = 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 = gt(Jt.exports); -var fr = {}, hr = { exports: {} }, dr = { 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; -})(dr); -var Sn = dr.exports; -(function(t) { - var e = Sn.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 }, g = Object.defineProperty && Object.getOwnPropertyDescriptor; - for (var y in n) if (y !== "default" && {}.hasOwnProperty.call(n, y)) { - var m = g ? Object.getOwnPropertyDescriptor(n, y) : null; - m && (m.get || m.set) ? Object.defineProperty(c, y, m) : c[y] = n[y]; - } - return c.default = n, a && a.set(n, c), c; - }, t.exports.__esModule = !0, t.exports.default = t.exports; -})(hr); -var Cn = hr.exports.default; -Object.defineProperty(fr, "__esModule", { value: !0 }); -var jn = fr.default = function(t) { - var e = Ue.useRef(); - return e.current = t, Ue.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)); - }, []); -}, Ue = Cn(Me), pr = { exports: {} }; -pr.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]; - h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & p | ~h & f) + i[0] - 680876936 | 0) << 7 | u >>> 25) + h | 0) & h | ~u & p) + i[1] - 389564586 | 0) << 12 | f >>> 20) + u | 0) & u | ~f & h) + i[2] + 606105819 | 0) << 17 | p >>> 15) + f | 0) & f | ~p & u) + i[3] - 1044525330 | 0) << 22 | h >>> 10) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & p | ~h & f) + i[4] - 176418897 | 0) << 7 | u >>> 25) + h | 0) & h | ~u & p) + i[5] + 1200080426 | 0) << 12 | f >>> 20) + u | 0) & u | ~f & h) + i[6] - 1473231341 | 0) << 17 | p >>> 15) + f | 0) & f | ~p & u) + i[7] - 45705983 | 0) << 22 | h >>> 10) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & p | ~h & f) + i[8] + 1770035416 | 0) << 7 | u >>> 25) + h | 0) & h | ~u & p) + i[9] - 1958414417 | 0) << 12 | f >>> 20) + u | 0) & u | ~f & h) + i[10] - 42063 | 0) << 17 | p >>> 15) + f | 0) & f | ~p & u) + i[11] - 1990404162 | 0) << 22 | h >>> 10) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & p | ~h & f) + i[12] + 1804603682 | 0) << 7 | u >>> 25) + h | 0) & h | ~u & p) + i[13] - 40341101 | 0) << 12 | f >>> 20) + u | 0) & u | ~f & h) + i[14] - 1502002290 | 0) << 17 | p >>> 15) + f | 0) & f | ~p & u) + i[15] + 1236535329 | 0) << 22 | h >>> 10) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & f | p & ~f) + i[1] - 165796510 | 0) << 5 | u >>> 27) + h | 0) & p | h & ~p) + i[6] - 1069501632 | 0) << 9 | f >>> 23) + u | 0) & h | u & ~h) + i[11] + 643717713 | 0) << 14 | p >>> 18) + f | 0) & u | f & ~u) + i[0] - 373897302 | 0) << 20 | h >>> 12) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & f | p & ~f) + i[5] - 701558691 | 0) << 5 | u >>> 27) + h | 0) & p | h & ~p) + i[10] + 38016083 | 0) << 9 | f >>> 23) + u | 0) & h | u & ~h) + i[15] - 660478335 | 0) << 14 | p >>> 18) + f | 0) & u | f & ~u) + i[4] - 405537848 | 0) << 20 | h >>> 12) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & f | p & ~f) + i[9] + 568446438 | 0) << 5 | u >>> 27) + h | 0) & p | h & ~p) + i[14] - 1019803690 | 0) << 9 | f >>> 23) + u | 0) & h | u & ~h) + i[3] - 187363961 | 0) << 14 | p >>> 18) + f | 0) & u | f & ~u) + i[8] + 1163531501 | 0) << 20 | h >>> 12) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h & f | p & ~f) + i[13] - 1444681467 | 0) << 5 | u >>> 27) + h | 0) & p | h & ~p) + i[2] - 51403784 | 0) << 9 | f >>> 23) + u | 0) & h | u & ~h) + i[7] + 1735328473 | 0) << 14 | p >>> 18) + f | 0) & u | f & ~u) + i[12] - 1926607734 | 0) << 20 | h >>> 12) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h ^ p ^ f) + i[5] - 378558 | 0) << 4 | u >>> 28) + h | 0) ^ h ^ p) + i[8] - 2022574463 | 0) << 11 | f >>> 21) + u | 0) ^ u ^ h) + i[11] + 1839030562 | 0) << 16 | p >>> 16) + f | 0) ^ f ^ u) + i[14] - 35309556 | 0) << 23 | h >>> 9) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h ^ p ^ f) + i[1] - 1530992060 | 0) << 4 | u >>> 28) + h | 0) ^ h ^ p) + i[4] + 1272893353 | 0) << 11 | f >>> 21) + u | 0) ^ u ^ h) + i[7] - 155497632 | 0) << 16 | p >>> 16) + f | 0) ^ f ^ u) + i[10] - 1094730640 | 0) << 23 | h >>> 9) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h ^ p ^ f) + i[13] + 681279174 | 0) << 4 | u >>> 28) + h | 0) ^ h ^ p) + i[0] - 358537222 | 0) << 11 | f >>> 21) + u | 0) ^ u ^ h) + i[3] - 722521979 | 0) << 16 | p >>> 16) + f | 0) ^ f ^ u) + i[6] + 76029189 | 0) << 23 | h >>> 9) + p | 0, h = ((h += ((p = ((p += ((f = ((f += ((u = ((u += (h ^ p ^ f) + i[9] - 640364487 | 0) << 4 | u >>> 28) + h | 0) ^ h ^ p) + i[12] - 421815835 | 0) << 11 | f >>> 21) + u | 0) ^ u ^ h) + i[15] + 530742520 | 0) << 16 | p >>> 16) + f | 0) ^ f ^ u) + i[2] - 995338651 | 0) << 23 | h >>> 9) + p | 0, h = ((h += ((f = ((f += (h ^ ((u = ((u += (p ^ (h | ~f)) + i[0] - 198630844 | 0) << 6 | u >>> 26) + h | 0) | ~p)) + i[7] + 1126891415 | 0) << 10 | f >>> 22) + u | 0) ^ ((p = ((p += (u ^ (f | ~h)) + i[14] - 1416354905 | 0) << 15 | p >>> 17) + f | 0) | ~u)) + i[5] - 57434055 | 0) << 21 | h >>> 11) + p | 0, h = ((h += ((f = ((f += (h ^ ((u = ((u += (p ^ (h | ~f)) + i[12] + 1700485571 | 0) << 6 | u >>> 26) + h | 0) | ~p)) + i[3] - 1894986606 | 0) << 10 | f >>> 22) + u | 0) ^ ((p = ((p += (u ^ (f | ~h)) + i[10] - 1051523 | 0) << 15 | p >>> 17) + f | 0) | ~u)) + i[1] - 2054922799 | 0) << 21 | h >>> 11) + p | 0, h = ((h += ((f = ((f += (h ^ ((u = ((u += (p ^ (h | ~f)) + i[8] + 1873313359 | 0) << 6 | u >>> 26) + h | 0) | ~p)) + i[15] - 30611744 | 0) << 10 | f >>> 22) + u | 0) ^ ((p = ((p += (u ^ (f | ~h)) + i[6] - 1560198380 | 0) << 15 | p >>> 17) + f | 0) | ~u)) + i[13] + 1309151649 | 0) << 21 | h >>> 11) + p | 0, h = ((h += ((f = ((f += (h ^ ((u = ((u += (p ^ (h | ~f)) + i[4] - 145523070 | 0) << 6 | u >>> 26) + h | 0) | ~p)) + i[11] - 1120210379 | 0) << 10 | f >>> 22) + u | 0) ^ ((p = ((p += (u ^ (f | ~h)) + i[2] + 718787259 | 0) << 15 | p >>> 17) + f | 0) | ~u)) + i[9] - 343485551 | 0) << 21 | h >>> 11) + p | 0, l[0] = u + l[0] | 0, l[1] = h + l[1] | 0, l[2] = p + l[2] | 0, l[3] = f + l[3] | 0; - } - function n(l) { - var i, u = []; - for (i = 0; i < 64; i += 4) u[i >> 2] = l.charCodeAt(i) + (l.charCodeAt(i + 1) << 8) + (l.charCodeAt(i + 2) << 16) + (l.charCodeAt(i + 3) << 24); - return u; - } - function o(l) { - var i, u = []; - 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 a(l) { - var i, u, h, p, f, O, S = l.length, x = [1732584193, -271733879, -1732584194, 271733878]; - for (i = 64; i <= S; 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 * S).toString(16).match(/(.*?)(.{0,8})$/), f = parseInt(p[2], 16), O = parseInt(p[1], 16) || 0, h[14] = f, h[15] = O, r(x, h), x; - } - function c(l) { - var i, u, h, p, f, O, S = l.length, x = [1732584193, -271733879, -1732584194, 271733878]; - for (i = 64; i <= S; i += 64) r(x, o(l.subarray(i - 64, i))); - for (u = (l = i - 64 < S ? 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 * S).toString(16).match(/(.*?)(.{0,8})$/), f = parseInt(p[2], 16), O = parseInt(p[1], 16) || 0, h[14] = f, h[15] = O, r(x, h), x; - } - function g(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) { - var i; - for (i = 0; i < l.length; i += 1) l[i] = g(l[i]); - return l.join(""); - } - function m(l) { - return /[\u0080-\uFFFF]/.test(l) && (l = unescape(encodeURIComponent(l))), l; - } - function s(l, i) { - var u, h = l.length, p = new ArrayBuffer(h), f = new Uint8Array(p); - for (u = 0; u < h; u += 1) f[u] = l.charCodeAt(u); - return i ? f : p; - } - function b(l) { - return String.fromCharCode.apply(null, new Uint8Array(l)); - } - function w(l, i, u) { - var h = new Uint8Array(l.byteLength + i.byteLength); - return h.set(new Uint8Array(l)), h.set(new Uint8Array(i), l.byteLength), h; - } - function E(l) { - var i, u = [], h = l.length; - for (i = 0; i < h - 1; i += 2) u.push(parseInt(l.substr(i, 2), 16)); - return String.fromCharCode.apply(String, u); - } - function d() { - this.reset(); - } - return y(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, O, S = this.byteLength, x = l(i, S), j = S; - return u !== t && (j = l(u, S)), x > j ? new ArrayBuffer(0) : (h = j - x, p = new ArrayBuffer(h), f = new Uint8Array(p), O = new Uint8Array(this, x, h), f.set(O), p); - }; - }(), d.prototype.append = function(l) { - return this.appendBinary(m(l)), this; - }, d.prototype.appendBinary = function(l) { - this._buff += l, this._length += l.length; - var i, u = this._buff.length; - for (i = 64; i <= u; i += 64) r(this._hash, n(this._buff.substring(i - 64, i))); - return this._buff = this._buff.substring(i - 64), this; - }, 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; - }, d.prototype.reset = function() { - return this._buff = "", this._length = 0, this._hash = [1732584193, -271733879, -1732584194, 271733878], this; - }, d.prototype.getState = function() { - return { buff: this._buff, length: this._length, hash: this._hash.slice() }; - }, d.prototype.setState = function(l) { - return this._buff = l.buff, this._length = l.length, this._hash = l.hash, this; - }, d.prototype.destroy = function() { - delete this._hash, delete this._buff, delete this._length; - }, d.prototype._finish = function(l, i) { - var u, h, p, f = i; - 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(m(l), i); - }, d.hashBinary = function(l, i) { - var u = y(a(l)); - return i ? E(u) : u; - }, d.ArrayBuffer = function() { - this.reset(); - }, d.ArrayBuffer.prototype.append = function(l) { - var i, u = w(this._buff.buffer, l), h = u.length; - for (this._length += l.byteLength, i = 64; i <= h; i += 64) r(this._hash, o(u.subarray(i - 64, i))); - return this._buff = i - 64 < h ? new Uint8Array(u.buffer.slice(i - 64)) : new Uint8Array(0), this; - }, 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; - }, 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() { - var l = d.prototype.getState.call(this); - return l.buff = b(l.buff), l; - }, 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(c(new Uint8Array(l))); - return i ? E(u) : u; - }, d; -}(); -const Nn = gt(pr.exports); -export { - Pn as M, - Tn as N, - Nn as S, - _n as _, - jn as a, - _ as b, - xn as c, - Ht as i -}; diff --git a/dist/components.js b/dist/components.js index fcb9702..c1e8186 100644 --- a/dist/components.js +++ b/dist/components.js @@ -1,4 +1,4 @@ -import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-TLNRXor8.js"; +import { at as s, ak as p, au as r, av as t, as as e, aI as n } from "./common/main-DcQsUE57.js"; export { s as Empty, p as Icon, diff --git a/dist/container.js b/dist/container.js index bbdb9dd..163c2b3 100644 --- a/dist/container.js +++ b/dist/container.js @@ -1,4 +1,4 @@ -import { ap as s, at as e, au as p, av as t, aq as d, as as n, ar as r, ao as u } from "./common/main-TLNRXor8.js"; +import { ap as s, at as e, au as p, av as t, aq as d, as as n, ar as r, ao as u } from "./common/main-DcQsUE57.js"; export { s as Context, e as Empty, diff --git a/dist/data-converter.js b/dist/data-converter.js index dee7346..8fa7fe5 100644 --- a/dist/data-converter.js +++ b/dist/data-converter.js @@ -1,6 +1,6 @@ import "lodash"; import "react"; -import { D as i } from "./common/main-TLNRXor8.js"; +import { D as i } from "./common/main-DcQsUE57.js"; import "react-use"; export { i as default diff --git a/dist/data-list.js b/dist/data-list.js index a94cf10..bbd740b 100644 --- a/dist/data-list.js +++ b/dist/data-list.js @@ -1,4 +1,4 @@ -import { w as t, t as e, o as r, r as o, x as i, s as l, q as u, v as n, p as D, y as L, n as p, A as C, z as m, J as b, C as c, F, E as d, I as k, B as w } from "./common/main-TLNRXor8.js"; +import { w as t, t as e, o as r, r as o, x as i, s as l, q as u, v as n, p as D, y as L, n as p, A as C, z as m, J as b, C as c, F, E as d, I as k, B as w } from "./common/main-DcQsUE57.js"; export { t as DataListContent, e as DataListContext, diff --git a/dist/data-list/utils.js b/dist/data-list/utils.js index f3bd0a5..d71dbe3 100644 --- a/dist/data-list/utils.js +++ b/dist/data-list/utils.js @@ -1,5 +1,5 @@ import "lodash"; -import { f as a } from "../common/main-TLNRXor8.js"; +import { f as a } from "../common/main-DcQsUE57.js"; export { a as getDefaultExpandRowKeys }; diff --git a/dist/grid-layout-form.js b/dist/grid-layout-form.js index c0169cc..33900e5 100644 --- a/dist/grid-layout-form.js +++ b/dist/grid-layout-form.js @@ -1,4 +1,4 @@ -import { aa as s, ac as r, ab as u, a9 as o, m as t, ah as m, af as d, ag as i, aj as F, ae as g, ad as c, ai as l } from "./common/main-TLNRXor8.js"; +import { aa as s, ac as r, ab as u, a9 as o, m as t, ah as m, af as d, ag as i, aj as F, ae as g, ad as c, ai as l } from "./common/main-DcQsUE57.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 1ea434d..9211ab2 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-TLNRXor8.js"; +import { a as o, g } from "../common/main-DcQsUE57.js"; export { o as getNormalizeWidget, g as getOptionItemByValue diff --git a/dist/grid-layout.js b/dist/grid-layout.js index 2216657..5cd7a9a 100644 --- a/dist/grid-layout.js +++ b/dist/grid-layout.js @@ -1,4 +1,4 @@ -import { h as u, j as e, i as r, H as t, G as d, k as i, m as o, l as G, u as l } from "./common/main-TLNRXor8.js"; +import { h as u, j as e, i as r, H as t, G as d, k as i, m as o, l as G, u as l } from "./common/main-DcQsUE57.js"; export { u as GridLayout, e as GridLayoutFramework, diff --git a/dist/grid-layout/utils.js b/dist/grid-layout/utils.js index 8c67cf7..8f163a0 100644 --- a/dist/grid-layout/utils.js +++ b/dist/grid-layout/utils.js @@ -1,4 +1,4 @@ -import { b as a, d as o, e as s, c as g } from "../common/main-TLNRXor8.js"; +import { b as a, d as o, e as s, c as g } from "../common/main-DcQsUE57.js"; export { a as getBoxStyle, o as getEventProps, diff --git a/dist/hooks.js b/dist/hooks.js index f56fc73..8f97070 100644 --- a/dist/hooks.js +++ b/dist/hooks.js @@ -2,9 +2,9 @@ import "lodash"; import "rc-field-form"; import "react"; import "react-use"; -import { a4 as u, a3 as o, a5 as i, a2 as f, a6 as m, a1 as d, a8 as c, a7 as l } from "./common/main-TLNRXor8.js"; +import { a4 as u, a3 as o, a5 as i, a2 as f, a6 as m, a1 as d, a8 as c, a7 as l } from "./common/main-DcQsUE57.js"; import { default as b } from "rc-util/lib/hooks/useMergedState"; -import { a as x } from "./common/vender-hQk7ADWo.js"; +import { a as x } from "./common/vender-C5RbewOc.js"; export { u as useDeepEffect, o as useDeepEqualEffect, diff --git a/dist/iconfont.js b/dist/iconfont.js index 090a6b0..a984da0 100644 --- a/dist/iconfont.js +++ b/dist/iconfont.js @@ -2,7 +2,7 @@ import "react/jsx-runtime"; import "react"; import "prop-types"; import "classnames"; -import { ak as a } from "./common/main-TLNRXor8.js"; +import { ak as a } from "./common/main-DcQsUE57.js"; export { a as default }; diff --git a/dist/index.js b/dist/index.js index 109191e..483d818 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,4 +1,4 @@ -import { aE as t, aF as e, aA as o, aB as n, aw as p, aC as r, az as c, ay as f, ax as l, aD as u } from "./common/main-TLNRXor8.js"; +import { aE as t, aF as e, aA as o, aB as n, aw as p, aC as r, az as c, ay as f, ax as l, aD as u } from "./common/main-DcQsUE57.js"; export { t as AppContext, e as AppGlobalParamsContext, diff --git a/dist/pages.js b/dist/pages.js index aa8b9b3..3898da6 100644 --- a/dist/pages.js +++ b/dist/pages.js @@ -1,4 +1,4 @@ -import { L as t, K as e, M as o, N as g } from "./common/main-TLNRXor8.js"; +import { L as t, K as e, M as o, N as g } from "./common/main-DcQsUE57.js"; export { t as CustomPage, e as DataListPage, diff --git a/dist/res-ws.js b/dist/res-ws.js index ac8b2b0..075c17f 100644 --- a/dist/res-ws.js +++ b/dist/res-ws.js @@ -1,5 +1,5 @@ import "lodash"; -import { R as a } from "./common/main-TLNRXor8.js"; +import { R as a } from "./common/main-DcQsUE57.js"; export { a as default }; diff --git a/dist/utils.js b/dist/utils.js index af8f8fc..9e27f07 100644 --- a/dist/utils.js +++ b/dist/utils.js @@ -1,6 +1,6 @@ import "lodash"; -import { S as r, a0 as i, W as g, V as o, X as P, P as m, $ as p, Q as U, _ as d, Y as h, Z as k, T as n, O as f, U as l } from "./common/main-TLNRXor8.js"; -import "./common/vender-hQk7ADWo.js"; +import { S as r, a0 as i, W as g, V as o, X as P, P as m, $ as p, Q as U, _ as d, Y as h, Z as k, T as n, O as f, U as l } from "./common/main-DcQsUE57.js"; +import "./common/vender-C5RbewOc.js"; export { r as deepSome, i as generateUUID, diff --git a/dist/virtual-fs.js b/dist/virtual-fs.js index 582a1ac..5394a81 100644 --- a/dist/virtual-fs.js +++ b/dist/virtual-fs.js @@ -1,5 +1,5 @@ import "pathe"; -import { aG as o, aH as r } from "./common/main-TLNRXor8.js"; +import { aG as o, aH as r } from "./common/main-DcQsUE57.js"; export { o as default, r as toTreePaths diff --git a/package.json b/package.json index 9d5c4d3..f977f4e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ff", "private": true, - "version": "0.6.58", + "version": "0.7.1", "author": "www.fsdpf.com", "type": "module", "main": "./dist/index.js", @@ -17,6 +17,7 @@ "dependencies": { "axios": "^1.7.2", "ff-request": "git+https://git.fsdpf.net/npm/ff-request-dist.git", + "ff-worker-pipe": "git+https://git.fsdpf.net/npm/ff-worker-pipe.git", "nprogress": "^0.2.0", "pathe": "^2.0.3", "spark-md5": "^3.0.2"