import { defineComponent as g, computed as n, openBlock as o, createElementBlock as m, Fragment as l, renderSlot as c, createBlock as r, resolveDynamicComponent as M, h, withModifiers as C, normalizeClass as B, unref as i, createCommentVNode as S } from "vue";
import { EyeInvisibleOutlined as _, EyeOutlined as b } from "@ant-design/icons-vue";
import "../../../../config-provider/index.mjs";
import { getMaskConfigBySchema as E, getSchemaKey as u } from "../../helper.mjs";
import { useDescriptionsInject as I } from "../../hooks/use-descriptions-context.mjs";
import { useNamespace as N } from "../../../../config-provider/hooks/use-namespace.mjs";
const x = /* @__PURE__ */ g({
  __name: "index",
  props: {
    item: {},
    data: {},
    defaultMask: {}
  },
  setup(p) {
    const t = p, s = n(
      () => E(t.item, t.defaultMask)
    ), { maskStatus: k, setStatusByKey: d } = I() || {}, { e: f } = N("ap-descriptions"), a = n(() => {
      const e = u(t.item);
      return e && k?.value[e];
    }), y = n(() => s.value?.renderMask ? s.value?.renderMask({ record: t.data || {} }) : "****"), v = () => {
      const e = u(t.item);
      e && d?.(e, !a.value);
    };
    return (e, V) => s.value ? (o(), m(l, { key: 0 }, [
      a.value ? (o(), r(M(h(l, [y.value])), { key: 1 })) : c(e.$slots, "default", { key: 0 }),
      s.value.hideIcon ? S("", !0) : (o(), m("span", {
        key: 2,
        class: B(i(f)("mask-wrapper")),
        onClick: C(v, ["stop"])
      }, [
        a.value ? (o(), r(i(_), { key: 0 })) : (o(), r(i(b), { key: 1 }))
      ], 2))
    ], 64)) : c(e.$slots, "default", { key: 1 });
  }
});
export {
  x as default
};
