"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;
