"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const Vue = require("vue");
const format = require("../utils/format.js");
const props = require("../utils/props.js");
const create = require("../utils/create.js");
const basic = require("../utils/basic.js");
const [name, bem] = create.createNamespace("loading");
const SpinIcon = Array(12).fill(null).map((_, index) => Vue.createVNode("i", {
  "class": bem("line", String(index + 1))
}, null));
const CircularIcon = Vue.createVNode("svg", {
  "class": bem("circular"),
  "viewBox": "25 25 50 50"
}, [Vue.createVNode("circle", {
  "cx": "50",
  "cy": "50",
  "r": "20",
  "fill": "none"
}, null)]);
const loadingProps = {
  size: props.numericProp,
  type: props.makeStringProp("circular"),
  color: String,
  vertical: Boolean,
  textSize: props.numericProp,
  textColor: String
};
var stdin_default = Vue.defineComponent({
  name,
  props: loadingProps,
  setup(props2, {
    slots
  }) {
    const spinnerStyle = Vue.computed(() => basic.extend({
      color: props2.color
    }, format.getSizeStyle(props2.size)));
    const renderIcon = () => {
      const DefaultIcon = props2.type === "spinner" ? SpinIcon : CircularIcon;
      return Vue.createVNode("span", {
        "class": bem("spinner", props2.type),
        "style": spinnerStyle.value
      }, [slots.icon ? slots.icon() : DefaultIcon]);
    };
    const renderText = () => {
      var _a;
      if (slots.default) {
        return Vue.createVNode("span", {
          "class": bem("text"),
          "style": {
            fontSize: format.addUnit(props2.textSize),
            color: (_a = props2.textColor) != null ? _a : props2.color
          }
        }, [slots.default()]);
      }
    };
    return () => {
      const {
        type,
        vertical
      } = props2;
      return Vue.createVNode("div", {
        "class": bem([type, {
          vertical
        }]),
        "aria-live": "polite",
        "aria-busy": true
      }, [renderIcon(), renderText()]);
    };
  }
});
exports.default = stdin_default;
exports.loadingProps = loadingProps;
