import { computed as c, inject as u, getCurrentInstance as F, onBeforeUnmount as I, provide as r, defineComponent as v, ref as C, watch as x } from "vue";
import { bz as y, d as g } from "./index2.js";
const l = Symbol("ContextProps"), m = Symbol("InternalContextProps"), N = function(a) {
  let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : c(() => !0);
  const e = C(/* @__PURE__ */ new Map()), o = (n, s) => {
    e.value.set(n, s), e.value = new Map(e.value);
  }, f = (n) => {
    e.value.delete(n), e.value = new Map(e.value);
  }, p = F();
  x([t, e], () => {
    if (process.env.NODE_ENV !== "production" && t.value && e.value.size > 1) {
      g(!1, "Form.Item", `FormItem can only collect one field item, you haved set ${[...e.value.values()].map((s) => `\`${s.name}\``).join(", ")} ${e.value.size} field items.
        You can set not need to be collected fields into \`a-form-item-rest\``);
      let n = p;
      for (; n.parent; )
        console.warn("at", n.type), n = n.parent;
    }
  }), r(l, a), r(m, {
    addFormItemField: o,
    removeFormItemField: f
  });
}, i = {
  id: c(() => {
  }),
  onFieldBlur: () => {
  },
  onFieldChange: () => {
  },
  clearValidate: () => {
  }
}, d = {
  addFormItemField: () => {
  },
  removeFormItemField: () => {
  }
}, S = () => {
  const a = u(m, d), t = Symbol("FormItemFieldKey"), e = F();
  return a.addFormItemField(t, e.type), I(() => {
    a.removeFormItemField(t);
  }), r(m, d), r(l, i), u(l, i);
}, _ = v({
  compatConfig: {
    MODE: 3
  },
  name: "AFormItemRest",
  setup(a, t) {
    let {
      slots: e
    } = t;
    return r(m, d), r(l, i), () => {
      var o;
      return (o = e.default) === null || o === void 0 ? void 0 : o.call(e);
    };
  }
}), b = y({}), K = v({
  name: "NoFormStatus",
  setup(a, t) {
    let {
      slots: e
    } = t;
    return b.useProvide({}), () => {
      var o;
      return (o = e.default) === null || o === void 0 ? void 0 : o.call(e);
    };
  }
});
export {
  b as F,
  K as N,
  N as a,
  _ as b,
  S as u
};
