import { mV as De, mX as xe, mY as M, mZ as E, m_ as q, m$ as Pe, n0 as Ne, n1 as Ee, n2 as _e, n3 as Ie, n4 as Oe, n5 as Te, a3 as Ve, n6 as ze, V as Me, bX as G, a9 as qe, a5 as je, aG as Ae, gN as Re, H as c, fb as Fe, gP as Le, ad as z, I as O, ae as b, af as D, a4 as d, am as S, c0 as Be, ag as Xe, c6 as Ge, ct as He, ah as Ke, c1 as We, aj as Qe, cs as te, dX as ae, an as Ue, n7 as Je, n8 as Ye, z as Ze, dW as ke, cT as et, e0 as re, n9 as tt, gn as at, eV as rt, _ as ie, fG as K, fd as it, na as nt, nb as ot, ly as st, nc as lt, nd as ct } from "./56c67d3b.js";
import _, { useContext as y } from "react";
import { CreateForm as dt } from "./b6f8d60c.js";
import "react-dom";
import "./f52ee168.js";
import "./de2e4e92.js";
import "./bf2ffa97.js";
import "./90e6d3f7.js";
import "./3eacf14a.js";
import "./a353f3e4.js";
import "./a6ed71f1.js";
var Q = {};
const mt = /* @__PURE__ */ De(xe);
var U = {}, J = {}, Y = {}, de = M.default, ut = E.default;
Object.defineProperty(Y, "__esModule", {
  value: !0
});
Y.default = ft;
var T = ut(_), ne = de(q), pt = de(Pe);
function ft(e) {
  let {
    percent: t,
    prefixCls: a
  } = e;
  const r = `${a}-dot`, i = `${r}-holder`, n = `${i}-hidden`, [o, s] = T.useState(!1);
  (0, pt.default)(() => {
    t !== 0 && s(!0);
  }, [t !== 0]);
  const l = Math.max(Math.min(t, 100), 0), u = 100, h = u / 5, C = u / 2 - h / 2, p = C * 2 * Math.PI, v = (N, I) => /* @__PURE__ */ T.createElement("circle", {
    className: (0, ne.default)(N, `${r}-circle`),
    r: C,
    cx: "50",
    cy: "50",
    strokeWidth: h,
    style: I
  });
  return o ? /* @__PURE__ */ T.createElement("span", {
    className: (0, ne.default)(i, `${r}-progress`, l <= 0 && n)
  }, /* @__PURE__ */ T.createElement("svg", {
    viewBox: `0 0 ${u} ${u}`,
    // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: progressbar could be readonly
    role: "progressbar",
    "aria-valuemin": 0,
    "aria-valuemax": 100,
    "aria-valuenow": l
  }, v(`${r}-circle-bg`), v("", {
    strokeDasharray: `${p * l / 100} ${p * (100 - l) / 100}`,
    strokeDashoffset: `${p / 4}`
  }))) : null;
}
var me = M.default, ht = E.default;
Object.defineProperty(J, "__esModule", {
  value: !0
});
J.default = vt;
var x = ht(_), oe = me(q), yt = me(Y);
function vt(e) {
  const {
    prefixCls: t,
    percent: a = 0
  } = e, r = `${t}-dot`, i = `${r}-holder`, n = `${i}-hidden`;
  return /* @__PURE__ */ x.createElement(x.Fragment, null, /* @__PURE__ */ x.createElement("span", {
    className: (0, oe.default)(i, a > 0 && n)
  }, /* @__PURE__ */ x.createElement("span", {
    className: (0, oe.default)(r, `${t}-dot-spin`)
  }, [1, 2, 3, 4].map((o) => /* @__PURE__ */ x.createElement("i", {
    className: `${t}-dot-item`,
    key: o
  })))), /* @__PURE__ */ x.createElement(yt.default, {
    prefixCls: t,
    percent: a
  }));
}
var ue = M.default, gt = E.default;
Object.defineProperty(U, "__esModule", {
  value: !0
});
U.default = wt;
var se = gt(_), bt = ue(q), St = Ne, Ct = ue(J);
function wt(e) {
  const {
    prefixCls: t,
    indicator: a,
    percent: r
  } = e, i = `${t}-dot`;
  return a && /* @__PURE__ */ se.isValidElement(a) ? (0, St.cloneElement)(a, {
    className: (0, bt.default)(a.props.className, i),
    percent: r
  }) : /* @__PURE__ */ se.createElement(Ct.default, {
    prefixCls: t,
    percent: r
  });
}
var P = {};
Object.defineProperty(P, "__esModule", {
  value: !0
});
P.prepareComponentToken = P.default = void 0;
var pe = Ee, $t = Ie, le = _e;
const Dt = new pe.Keyframes("antSpinMove", {
  to: {
    opacity: 1
  }
}), xt = new pe.Keyframes("antRotate", {
  to: {
    transform: "rotate(405deg)"
  }
}), Pt = (e) => {
  const {
    componentCls: t,
    calc: a
  } = e;
  return {
    [`${t}`]: Object.assign(Object.assign({}, (0, $t.resetComponent)(e)), {
      position: "absolute",
      display: "none",
      color: e.colorPrimary,
      fontSize: 0,
      textAlign: "center",
      verticalAlign: "middle",
      opacity: 0,
      transition: `transform ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`,
      "&-spinning": {
        position: "relative",
        display: "inline-block",
        opacity: 1
      },
      [`${t}-text`]: {
        fontSize: e.fontSize,
        paddingTop: a(a(e.dotSize).sub(e.fontSize)).div(2).add(2).equal()
      },
      "&-fullscreen": {
        position: "fixed",
        width: "100vw",
        height: "100vh",
        backgroundColor: e.colorBgMask,
        zIndex: e.zIndexPopupBase,
        inset: 0,
        display: "flex",
        alignItems: "center",
        flexDirection: "column",
        justifyContent: "center",
        opacity: 0,
        visibility: "hidden",
        transition: `all ${e.motionDurationMid}`,
        "&-show": {
          opacity: 1,
          visibility: "visible"
        },
        [t]: {
          [`${t}-dot-holder`]: {
            color: e.colorWhite
          },
          [`${t}-text`]: {
            color: e.colorTextLightSolid
          }
        }
      },
      "&-nested-loading": {
        position: "relative",
        [`> div > ${t}`]: {
          position: "absolute",
          top: 0,
          insetInlineStart: 0,
          zIndex: 4,
          display: "block",
          width: "100%",
          height: "100%",
          maxHeight: e.contentHeight,
          [`${t}-dot`]: {
            position: "absolute",
            top: "50%",
            insetInlineStart: "50%",
            margin: a(e.dotSize).mul(-1).div(2).equal()
          },
          [`${t}-text`]: {
            position: "absolute",
            top: "50%",
            width: "100%",
            textShadow: `0 1px 2px ${e.colorBgContainer}`
            // FIXME: shadow
          },
          [`&${t}-show-text ${t}-dot`]: {
            marginTop: a(e.dotSize).div(2).mul(-1).sub(10).equal()
          },
          "&-sm": {
            [`${t}-dot`]: {
              margin: a(e.dotSizeSM).mul(-1).div(2).equal()
            },
            [`${t}-text`]: {
              paddingTop: a(a(e.dotSizeSM).sub(e.fontSize)).div(2).add(2).equal()
            },
            [`&${t}-show-text ${t}-dot`]: {
              marginTop: a(e.dotSizeSM).div(2).mul(-1).sub(10).equal()
            }
          },
          "&-lg": {
            [`${t}-dot`]: {
              margin: a(e.dotSizeLG).mul(-1).div(2).equal()
            },
            [`${t}-text`]: {
              paddingTop: a(a(e.dotSizeLG).sub(e.fontSize)).div(2).add(2).equal()
            },
            [`&${t}-show-text ${t}-dot`]: {
              marginTop: a(e.dotSizeLG).div(2).mul(-1).sub(10).equal()
            }
          }
        },
        [`${t}-container`]: {
          position: "relative",
          transition: `opacity ${e.motionDurationSlow}`,
          "&::after": {
            position: "absolute",
            top: 0,
            insetInlineEnd: 0,
            bottom: 0,
            insetInlineStart: 0,
            zIndex: 10,
            width: "100%",
            height: "100%",
            background: e.colorBgContainer,
            opacity: 0,
            transition: `all ${e.motionDurationSlow}`,
            content: '""',
            pointerEvents: "none"
          }
        },
        [`${t}-blur`]: {
          clear: "both",
          opacity: 0.5,
          userSelect: "none",
          pointerEvents: "none",
          "&::after": {
            opacity: 0.4,
            pointerEvents: "auto"
          }
        }
      },
      // tip
      // ------------------------------
      "&-tip": {
        color: e.spinDotDefault
      },
      // holder
      // ------------------------------
      [`${t}-dot-holder`]: {
        width: "1em",
        height: "1em",
        fontSize: e.dotSize,
        display: "inline-block",
        transition: `transform ${e.motionDurationSlow} ease, opacity ${e.motionDurationSlow} ease`,
        transformOrigin: "50% 50%",
        lineHeight: 1,
        color: e.colorPrimary,
        "&-hidden": {
          transform: "scale(0.3)",
          opacity: 0
        }
      },
      // progress
      // ------------------------------
      [`${t}-dot-progress`]: {
        position: "absolute",
        top: "50%",
        transform: "translateY(-50%)",
        insetInlineStart: 0
      },
      // dots
      // ------------------------------
      [`${t}-dot`]: {
        position: "relative",
        display: "inline-block",
        fontSize: e.dotSize,
        width: "1em",
        height: "1em",
        "&-item": {
          position: "absolute",
          display: "block",
          width: a(e.dotSize).sub(a(e.marginXXS).div(2)).div(2).equal(),
          height: a(e.dotSize).sub(a(e.marginXXS).div(2)).div(2).equal(),
          background: "currentColor",
          borderRadius: "100%",
          transform: "scale(0.75)",
          transformOrigin: "50% 50%",
          opacity: 0.3,
          animationName: Dt,
          animationDuration: "1s",
          animationIterationCount: "infinite",
          animationTimingFunction: "linear",
          animationDirection: "alternate",
          "&:nth-child(1)": {
            top: 0,
            insetInlineStart: 0,
            animationDelay: "0s"
          },
          "&:nth-child(2)": {
            top: 0,
            insetInlineEnd: 0,
            animationDelay: "0.4s"
          },
          "&:nth-child(3)": {
            insetInlineEnd: 0,
            bottom: 0,
            animationDelay: "0.8s"
          },
          "&:nth-child(4)": {
            bottom: 0,
            insetInlineStart: 0,
            animationDelay: "1.2s"
          }
        },
        "&-spin": {
          transform: "rotate(45deg)",
          animationName: xt,
          animationDuration: "1.2s",
          animationIterationCount: "infinite",
          animationTimingFunction: "linear"
        },
        "&-circle": {
          strokeLinecap: "round",
          transition: ["stroke-dashoffset", "stroke-dasharray", "stroke", "stroke-width", "opacity"].map((r) => `${r} ${e.motionDurationSlow} ease`).join(","),
          fillOpacity: 0,
          stroke: "currentcolor"
        },
        "&-circle-bg": {
          stroke: e.colorFillSecondary
        }
      },
      // small
      [`&-sm ${t}-dot`]: {
        "&, &-holder": {
          fontSize: e.dotSizeSM
        }
      },
      [`&-sm ${t}-dot-holder`]: {
        i: {
          width: a(a(e.dotSizeSM).sub(a(e.marginXXS).div(2))).div(2).equal(),
          height: a(a(e.dotSizeSM).sub(a(e.marginXXS).div(2))).div(2).equal()
        }
      },
      // large
      [`&-lg ${t}-dot`]: {
        "&, &-holder": {
          fontSize: e.dotSizeLG
        }
      },
      [`&-lg ${t}-dot-holder`]: {
        i: {
          width: a(a(e.dotSizeLG).sub(e.marginXXS)).div(2).equal(),
          height: a(a(e.dotSizeLG).sub(e.marginXXS)).div(2).equal()
        }
      },
      [`&${t}-show-text ${t}-text`]: {
        display: "block"
      }
    })
  };
}, fe = (e) => {
  const {
    controlHeightLG: t,
    controlHeight: a
  } = e;
  return {
    contentHeight: 400,
    dotSize: t / 2,
    dotSizeSM: t * 0.35,
    dotSizeLG: a
  };
};
P.prepareComponentToken = fe;
P.default = (0, le.genStyleHooks)("Spin", (e) => {
  const t = (0, le.mergeToken)(e, {
    spinDotDefault: e.colorTextDescription
  });
  return [Pt(t)];
}, fe);
var Z = {}, Nt = E.default;
Object.defineProperty(Z, "__esModule", {
  value: !0
});
Z.default = _t;
var H = Nt(_);
const Et = 200, ce = [[30, 0.05], [70, 0.03], [96, 0.01]];
function _t(e, t) {
  const [a, r] = H.useState(0), i = H.useRef(), n = t === "auto";
  return H.useEffect(() => (n && e && (r(0), i.current = setInterval(() => {
    r((o) => {
      const s = 100 - o;
      for (let l = 0; l < ce.length; l += 1) {
        const [u, h] = ce[l];
        if (o <= u)
          return o + s * h;
      }
      return o;
    });
  }, Et)), () => {
    clearInterval(i.current);
  }), [n, e]), n ? a : t;
}
var j = M.default, It = E.default;
Object.defineProperty(Q, "__esModule", {
  value: !0
});
var he = Q.default = void 0, f = It(_), V = j(q), Ot = mt, Tt = Oe, Vt = Te, zt = j(U), Mt = j(P), qt = j(Z), jt = function(e, t) {
  var a = {};
  for (var r in e)
    Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (a[r] = e[r]);
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
    for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++)
      t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (a[r[i]] = e[r[i]]);
  return a;
};
let ye;
function At(e, t) {
  return !!e && !!t && !isNaN(Number(t));
}
const k = (e) => {
  var t;
  const {
    prefixCls: a,
    spinning: r = !0,
    delay: i = 0,
    className: n,
    rootClassName: o,
    size: s = "default",
    tip: l,
    wrapperClassName: u,
    style: h,
    children: C,
    fullscreen: p = !1,
    indicator: v,
    percent: N
  } = e, I = jt(e, ["prefixCls", "spinning", "delay", "className", "rootClassName", "size", "tip", "wrapperClassName", "style", "children", "fullscreen", "indicator", "percent"]), {
    getPrefixCls: ve,
    direction: ge,
    spin: g
  } = f.useContext(Vt.ConfigContext), m = ve("spin", a), [A, R, F] = (0, Mt.default)(m), [$, ee] = f.useState(() => r && !At(r, i)), be = (0, qt.default)($, N);
  f.useEffect(() => {
    if (r) {
      const w = (0, Ot.debounce)(i, () => {
        ee(!0);
      });
      return w(), () => {
        var X;
        (X = w == null ? void 0 : w.cancel) === null || X === void 0 || X.call(w);
      };
    }
    ee(!1);
  }, [i, r]);
  const L = f.useMemo(() => typeof C < "u" && !p, [C, p]);
  if (process.env.NODE_ENV !== "production") {
    const w = (0, Tt.devUseWarning)("Spin");
    process.env.NODE_ENV !== "production" && w(!l || L || p, "usage", "`tip` only work in nest or fullscreen pattern.");
  }
  const Se = (0, V.default)(m, g == null ? void 0 : g.className, {
    [`${m}-sm`]: s === "small",
    [`${m}-lg`]: s === "large",
    [`${m}-spinning`]: $,
    [`${m}-show-text`]: !!l,
    [`${m}-rtl`]: ge === "rtl"
  }, n, !p && o, R, F), Ce = (0, V.default)(`${m}-container`, {
    [`${m}-blur`]: $
  }), we = (t = v ?? (g == null ? void 0 : g.indicator)) !== null && t !== void 0 ? t : ye, $e = Object.assign(Object.assign({}, g == null ? void 0 : g.style), h), B = /* @__PURE__ */ f.createElement("div", Object.assign({}, I, {
    style: $e,
    className: Se,
    "aria-live": "polite",
    "aria-busy": $
  }), /* @__PURE__ */ f.createElement(zt.default, {
    prefixCls: m,
    indicator: we,
    percent: be
  }), l && (L || p) ? /* @__PURE__ */ f.createElement("div", {
    className: `${m}-text`
  }, l) : null);
  return A(L ? /* @__PURE__ */ f.createElement("div", Object.assign({}, I, {
    className: (0, V.default)(`${m}-nested-loading`, u, R, F)
  }), $ && /* @__PURE__ */ f.createElement("div", {
    key: "loading"
  }, B), /* @__PURE__ */ f.createElement("div", {
    className: Ce,
    key: "container"
  }, C)) : p ? /* @__PURE__ */ f.createElement("div", {
    className: (0, V.default)(`${m}-fullscreen`, {
      [`${m}-fullscreen-show`]: $
    }, o, R, F)
  }, B) : B);
};
k.setDefaultIndicator = (e) => {
  ye = e;
};
process.env.NODE_ENV !== "production" && (k.displayName = "Spin");
he = Q.default = k;
const Rt = Ve.div`
  height: 100%;
  .ant-spin-nested-loading {
    height: 100%;
    .ant-spin-container {
      height: 100%;
    }
  }
`, Ft = [rt], Lt = {
  initialData: ze,
  resetAfterSubmit: Me,
  disabled: G,
  disableSubmit: G,
  loading: G,
  onEvent: qe(Ft),
  animationStyle: je(Ae)
};
function Bt(e, t) {
  const {
    dispatch: a,
    layout: r,
    positionParams: i
  } = e.container.body[0].children.view.getView();
  let n = 0;
  const o = t.map(({
    column: s,
    compName: l
  }) => {
    const u = {
      i: "",
      h: lt(s.comp.type).h,
      w: i.cols,
      x: 0,
      y: n
    };
    return n = n + u.h, {
      item: {
        compType: s.comp.type,
        name: l,
        comp: {
          ...s.comp.compInitData,
          formDataKey: s.name,
          label: {
            text: s.label
          },
          required: s.required
        }
      },
      layoutItem: u
    };
  });
  a(K(ct(r, o)));
}
function Xt(e) {
  return {
    name: "submit",
    handler: {
      compType: "executeQuery",
      comp: {
        queryName: e
      }
    }
  };
}
function Gt(e, t, a, r) {
  const {
    dispatch: i
  } = t, n = a.getNameGenerator(), o = e.columns.map((v) => {
    const N = n.genItemName("form" + ie.upperFirst(v.comp.type));
    return {
      column: v,
      compName: N
    };
  });
  Bt(t, o);
  const s = e.tableName, l = s.substring(s.lastIndexOf(".") + 1), u = r + "SubmitTo" + l.split("_").map(ie.upperFirst).join(""), h = n.genItemName(u);
  i(K(it("onEvent", nt(Xt(h)))));
  const C = e.dataSourceTypeConfig.getQueryInitData(r, s, o), p = a.getQueriesComp();
  return p.dispatch(K(p.pushAction({
    ...C,
    id: ot(),
    name: h,
    datasourceId: e.dataSourceId,
    triggerType: "manual",
    notification: {
      showSuccess: !0,
      showFail: !0
    }
  }))), a.setSelectedBottomRes(h, st.Query), "";
}
const Ht = (e) => {
  const t = y(S), a = y(Ue);
  return /* @__PURE__ */ z(Je, {
    children: [d("formComp.containerPlaceholder"), /* @__PURE__ */ c("br", {}), /* @__PURE__ */ c(dt, {
      onCreate: (r) => Promise.resolve(Gt(r, e, t, a))
    })]
  });
}, Kt = /* @__PURE__ */ c(Ye, {
  spin: !0
}), Wt = function() {
  return new Re(Lt, (e, t) => /* @__PURE__ */ c(Fe.Provider, {
    value: e.disabled,
    children: /* @__PURE__ */ c(Rt, {
      children: /* @__PURE__ */ c(he, {
        indicator: Kt,
        spinning: e.loading,
        style: {
          height: "100%"
        },
        children: /* @__PURE__ */ c(Le, {
          ...e,
          hintPlaceholder: /* @__PURE__ */ c(Ht, {
            ...e,
            dispatch: t
          })
        })
      })
    })
  })).setPropertyViewFn((e) => /* @__PURE__ */ z(O, {
    children: [/* @__PURE__ */ c(b, {
      name: D.basic,
      children: e.resetAfterSubmit.propertyView({
        label: d("formComp.resetAfterSubmit")
      })
    }), (y(S).editorModeStatus === "logic" || y(S).editorModeStatus === "both") && /* @__PURE__ */ c(O, {
      children: /* @__PURE__ */ z(b, {
        name: D.interaction,
        children: [e.onEvent.getPropertyView(), Be(e), e.disableSubmit.propertyView({
          label: d("formComp.disableSubmit")
        }), Xe(e), Ge(e)]
      })
    }), (y(S).editorModeStatus === "layout" || y(S).editorModeStatus === "both") && /* @__PURE__ */ c(O, {
      children: /* @__PURE__ */ c(b, {
        name: D.layout,
        children: e.container.getPropertyView()
      })
    }), (y(S).editorModeStatus === "logic" || y(S).editorModeStatus === "both") && /* @__PURE__ */ c(b, {
      name: D.advanced,
      children: e.initialData.propertyView({
        label: d("formComp.initialData")
      })
    }), (y(S).editorModeStatus === "layout" || y(S).editorModeStatus === "both") && /* @__PURE__ */ z(O, {
      children: [/* @__PURE__ */ c(b, {
        name: D.style,
        children: e.container.stylePropertyView()
      }), /* @__PURE__ */ c(b, {
        name: D.animationStyle,
        hasTooltip: !0,
        children: e.animationStyle.getPropertyView()
      }), e.container.children.showHeader.getView() && /* @__PURE__ */ c(b, {
        name: "Header Style",
        children: e.container.headerStylePropertyView()
      }), e.container.children.showBody.getView() && /* @__PURE__ */ c(b, {
        name: "Body Style",
        children: e.container.bodyStylePropertyView()
      }), e.container.children.showFooter.getView() && /* @__PURE__ */ c(b, {
        name: "Footer Style",
        children: e.container.footerStylePropertyView()
      })]
    })]
  })).build();
}();
let W = class extends Wt {
  onEventPropertyView(e) {
    return this.children.onEvent.propertyView({
      title: e
    });
  }
  traverseFormItems(e) {
    return Ze(this.getCompTree(), (t) => t.children.comp.children.formDataKey ? e(t) : !0);
  }
  validateFormItems() {
    return this.traverseFormItems((e) => {
      var a;
      return !((a = e.children.comp.exposingValues) != null && a.invalid);
    });
  }
  runMethodOfItems(...e) {
    const t = [];
    return this.traverseFormItems((a) => {
      var n;
      const r = a.children.comp.exposingMethods();
      for (const o of e) {
        const s = (n = r[o.name]) == null ? void 0 : n.func;
        if (s) {
          const l = o.getParams ? o.getParams(a) : [];
          if (l !== void 0)
            return t.push(Promise.resolve(s(...l))), !0;
        }
      }
      const i = a.children.compType.getView();
      return ke.warn(d("form") + i + d("formComp.notSupportMethod") + e.map((o) => o.name)), !0;
    }), Promise.all(t).then(() => {
    });
  }
  setData(e, t) {
    const a = {
      ...t ?? this.children.initialData.getView(),
      ...e
    };
    return this.runMethodOfItems({
      name: "setValue",
      getParams: (r) => {
        var o;
        const i = ((o = r.children.comp.children.formDataKey) == null ? void 0 : o.getView()) || r.children.name.getView(), n = a[i];
        return n !== void 0 ? [n] : void 0;
      }
    }, {
      name: "setRange",
      getParams: (r) => {
        var o;
        const i = ((o = r.children.comp.children.formDataKey) == null ? void 0 : o.getView()) || r.children.name.getView(), n = a[i] ? a[i] : void 0;
        return n !== void 0 ? [n] : void 0;
      }
    }, {
      name: "resetValue"
    }, {
      name: "resetAll"
    }, {
      name: "clearValue"
    }, {
      name: "clearAll"
    });
  }
  reset() {
    return this.setData({});
  }
  submit() {
    return this.disableSubmit() ? Promise.reject("disableSubmit") : this.validateFormItems() ? this.children.onEvent.getView()("submit").then(() => this.children.resetAfterSubmit.getView() ? this.reset() : Promise.resolve()) : (et.error(d("formComp.notValidForm")), Promise.reject("formComp.notValidForm"));
  }
  disableSubmit() {
    return this.children.disabled.getView() || this.children.disableSubmit.getView();
  }
  reduce(e) {
    switch (e.type) {
      case re.UPDATE_NODES_V2: {
        const t = super.reduce(e);
        return t.children.initialData !== this.children.initialData && setTimeout(() => {
          this.dispatch(at({
            type: "setData",
            initialData: e.value.initialData.value || {}
          }, !1));
        }), t;
      }
      case re.CUSTOM:
        if (tt(e, "setData"))
          return this.setData({}, e.value.initialData), this;
    }
    return super.reduce(e);
  }
};
W = He(W, [{
  method: {
    name: "submit",
    description: d("export.submitDesc"),
    params: []
  },
  execute: (e, t) => e.submit()
}, {
  method: {
    name: "reset",
    description: d("formComp.resetDesc"),
    params: []
  },
  execute: (e, t) => e.reset()
}, {
  method: {
    name: "clear",
    description: d("formComp.clearDesc"),
    params: []
  },
  execute: (e, t) => e.runMethodOfItems({
    name: "clearValue"
  })
}, {
  method: {
    name: "setData",
    description: d("formComp.setDataDesc"),
    params: [{
      name: "data",
      type: "JSON"
    }]
  },
  execute: (e, t) => {
    if (t.length !== 1)
      return Promise.reject(d("formComp.valuesLengthError"));
    const a = t[0];
    return typeof a != "object" || a === null || Array.isArray(a) ? Promise.reject(d("formComp.valueTypeError")) : e.setData(a);
  }
}]);
const na = Ke(W, [...We, new Qe("loading", d("formComp.loadingDesc")), te({
  name: "data",
  desc: d("formComp.dataDesc"),
  depKeys: ["container"],
  func: (e) => {
    const t = {};
    return Object.entries(e.container).forEach(([a, r]) => {
      const i = r;
      if (i != null && i.hasOwnProperty("formDataKey")) {
        let n = i.value;
        !n && (i != null && i.hasOwnProperty("start")) && (i != null && i.hasOwnProperty("end")) && (n = {
          start: i.start,
          end: i.end
        }), t[i.formDataKey || a] = n;
      }
    }), t;
  }
}), te({
  name: "invalid",
  desc: d("export.invalidDesc"),
  depKeys: ["container"],
  func: (e) => {
    for (const [, t] of Object.entries(e.container)) {
      const a = t;
      if (a != null && a.hasOwnProperty("formDataKey") && a.invalid)
        return !0;
    }
    return !1;
  }
})]);
function oa(e, t) {
  return {
    container: {
      header: ae([{
        item: {
          compType: "text",
          name: t.genItemName("formTitle"),
          comp: {
            text: "### " + d("formComp.formTitle")
          }
        },
        layoutItem: {
          i: "",
          h: 5,
          w: 24,
          x: 0,
          y: 0
        }
      }]),
      footer: ae([{
        item: {
          compType: "button",
          name: t.genItemName("formButton"),
          comp: {
            text: d("button.submit"),
            type: "submit",
            form: e
          }
        },
        layoutItem: {
          i: "",
          h: 5,
          w: 10,
          x: 14,
          y: 0
        }
      }]),
      showHeader: !0,
      showFooter: !0
    }
  };
}
export {
  na as FormComp,
  oa as defaultFormData
};
