"use strict";
const vue = require("vue");
const dom = require("./dom-BgEUZpKg.js");
const useDefaults = require("./useDefaults-YXpmugKp.js");
const useColorVariantClasses = require("./useColorVariantClasses-BjkZZDqD.js");
const _hoisted_1 = {
  key: 0,
  class: "visually-hidden"
};
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
  __name: "BSpinner",
  props: {
    label: { default: void 0 },
    role: { default: "status" },
    small: { type: Boolean, default: false },
    tag: { default: "span" },
    type: { default: "border" },
    variant: { default: null }
  },
  setup(__props) {
    const _props = __props;
    const props = useDefaults.useDefaults(_props, "BSpinner");
    const slots = vue.useSlots();
    const colorClasses = useColorVariantClasses.useColorVariantClasses(
      vue.computed(() => ({
        textVariant: props.variant
      }))
    );
    const computedClasses = vue.computed(() => [
      `spinner-${props.type}`,
      colorClasses.value,
      {
        [`spinner-${props.type}-sm`]: props.small
      }
    ]);
    const hasLabelSlot = vue.computed(() => !dom.isEmptySlot(slots.label));
    return (_ctx, _cache) => {
      return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(props).tag), {
        class: vue.normalizeClass(computedClasses.value),
        role: vue.unref(props).label || hasLabelSlot.value ? vue.unref(props).role : null,
        "aria-hidden": vue.unref(props).label || hasLabelSlot.value ? null : true
      }, {
        default: vue.withCtx(() => [
          vue.unref(props).label || hasLabelSlot.value ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [
            vue.renderSlot(_ctx.$slots, "label", {}, () => [
              vue.createTextVNode(vue.toDisplayString(vue.unref(props).label), 1)
            ])
          ])) : vue.createCommentVNode("", true)
        ]),
        _: 3
      }, 8, ["class", "role", "aria-hidden"]);
    };
  }
});
exports._sfc_main = _sfc_main;
//# sourceMappingURL=BSpinner.vue_vue_type_script_setup_true_lang-CKRhsbDa.js.map
