import { defineComponent, inject, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, withCtx, createBlock, resolveDynamicComponent } from 'vue';
import { PsIcon } from '../../icon/index.mjs';
import '../../../utils/index.mjs';
import '../../../tokens/index.mjs';
import { dialogContentProps } from './dialog-content2.mjs';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { CloseComponents } from '../../../utils/vue/icon.mjs';
import { dialogInjectionKey } from '../../../tokens/dialog.mjs';

const _hoisted_1 = ["aria-label", "widget"];
const _hoisted_2 = ["widget"];
const _hoisted_3 = ["widget"];
const _hoisted_4 = ["widget"];
const __default__ = { name: "PsDialogContent" };
const _sfc_main = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: dialogContentProps,
  setup(__props) {
    const { Close } = CloseComponents;
    const { dialogRef, headerRef, ns, style } = inject(dialogInjectionKey);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "dialogRef",
        ref: dialogRef,
        class: normalizeClass([
          unref(ns).b(),
          unref(ns).is("fullscreen", _ctx.fullscreen),
          unref(ns).is("draggable", _ctx.draggable),
          { [unref(ns).m("center")]: _ctx.center },
          _ctx.customClass
        ]),
        "aria-modal": "true",
        role: "dialog",
        "aria-label": _ctx.title || "dialog",
        style: normalizeStyle(unref(style)),
        widget: _ctx.widget
      }, [
        createElementVNode("div", {
          ref_key: "headerRef",
          ref: headerRef,
          class: normalizeClass(unref(ns).e("header")),
          widget: _ctx.widget ? "dialog:title:" + _ctx.widget.split(":")[1] : void 0
        }, [
          renderSlot(_ctx.$slots, "title", {}, () => [
            createElementVNode("span", {
              class: normalizeClass(unref(ns).e("title"))
            }, toDisplayString(_ctx.title), 3)
          ])
        ], 10, _hoisted_2),
        createElementVNode("div", {
          class: normalizeClass(unref(ns).e("body")),
          widget: _ctx.widget ? "dialog:default:" + _ctx.widget.split(":")[1] : void 0
        }, [
          renderSlot(_ctx.$slots, "default")
        ], 10, _hoisted_3),
        _ctx.$slots.footer ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: normalizeClass(unref(ns).e("footer")),
          widget: _ctx.widget ? "dialog:footer:" + _ctx.widget.split(":")[1] : void 0
        }, [
          renderSlot(_ctx.$slots, "footer")
        ], 10, _hoisted_4)) : createCommentVNode("v-if", true),
        _ctx.showClose ? (openBlock(), createElementBlock("button", {
          key: 1,
          "aria-label": "close",
          class: normalizeClass(unref(ns).e("headerbtn")),
          type: "button"
        }, [
          createVNode(unref(PsIcon), {
            class: normalizeClass(unref(ns).e("close"))
          }, {
            default: withCtx(() => [
              (openBlock(), createBlock(resolveDynamicComponent(_ctx.closeIcon || unref(Close))))
            ]),
            _: 1
          }, 8, ["class"])
        ], 2)) : createCommentVNode("v-if", true)
      ], 14, _hoisted_1);
    };
  }
});
var PsDialogContent = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-ps/packages/components/dialog/src/dialog-content.vue"]]);

export { PsDialogContent as default };
//# sourceMappingURL=dialog-content.mjs.map
