import { defineComponent as f, openBlock as o, createBlock as t, resolveDynamicComponent as s, normalizeStyle as b, unref as l, normalizeClass as n, withCtx as r, createElementVNode as y, toDisplayString as g, createCommentVNode as i, renderSlot as B } from "vue";
import { useTheme as C } from "../../composables/useTheme.js";
import { useCommon as p } from "../../composables/useCommon.js";
import S from "../tooltip/ToggleTip.vue.js";
const k = {
  ...p.props(),
  label: String,
  disabled: Boolean,
  required: Boolean,
  block: Boolean,
  isInsideForm: Boolean,
  tag: {
    type: String,
    default: "label"
  },
  tooltip: String
}, _ = {
  name: "XLabel",
  validators: {
    ...p.validators()
  }
}, D = /* @__PURE__ */ f({
  ..._,
  props: k,
  setup(m) {
    const d = m, { styles: c, classes: a, className: u } = C("Label", {}, d);
    return (e, h) => (o(), t(s(e.tag), {
      style: b(l(c)),
      class: n([l(u), l(a).wrapper])
    }, {
      default: r(() => [
        e.label ? (o(), t(s(e.tag === "fieldset" ? "legend" : "p"), {
          key: 0,
          title: e.label,
          class: n(l(a).label)
        }, {
          default: r(() => [
            y("span", null, g(e.label), 1),
            e.tooltip ? (o(), t(S, {
              key: 0,
              content: e.tooltip
            }, null, 8, ["content"])) : i("", !0)
          ]),
          _: 1
        }, 8, ["title", "class"])) : i("", !0),
        B(e.$slots, "default")
      ]),
      _: 3
    }, 8, ["style", "class"]));
  }
});
export {
  D as default
};
