"use strict";
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
const index = require("../../../hooks/use-namespace/index.js");
const index$1 = require("../../../hooks/use-throttle-render/index.js");
const skeleton = require("./skeleton.js");
const skeletonItem2 = require("./skeleton-item2.js");
const vue = require("vue");
var skeleton_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ vue.defineComponent({
  name: "ElSkeleton",
  __name: "skeleton",
  props: skeleton.skeletonProps,
  setup(__props, { expose: __expose }) {
    const props = __props;
    const ns = index.useNamespace("skeleton");
    const uiLoading = index$1.useThrottleRender(vue.toRef(props, "loading"), props.throttle);
    __expose({ uiLoading });
    return (_ctx, _cache) => {
      return vue.unref(uiLoading) ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
        key: 0,
        class: [vue.unref(ns).b(), vue.unref(ns).is("animated", __props.animated)]
      }, _ctx.$attrs), [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.count, (i) => {
        return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: i }, [vue.unref(uiLoading) ? vue.renderSlot(_ctx.$slots, "template", { key: i }, () => [vue.createVNode(skeletonItem2.default, {
          class: vue.normalizeClass(vue.unref(ns).is("first")),
          variant: "p"
        }, null, 8, ["class"]), (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.rows, (item) => {
          return vue.openBlock(), vue.createBlock(skeletonItem2.default, {
            key: item,
            class: vue.normalizeClass([vue.unref(ns).e("paragraph"), vue.unref(ns).is("last", item === __props.rows && __props.rows > 1)]),
            variant: "p"
          }, null, 8, ["class"]);
        }), 128))]) : vue.createCommentVNode("v-if", true)], 64);
      }), 128))], 16)) : vue.renderSlot(_ctx.$slots, "default", vue.normalizeProps(vue.mergeProps({ key: 1 }, _ctx.$attrs)));
    };
  }
});
exports.default = skeleton_vue_vue_type_script_setup_true_lang_default;
