import { onMounted as m, onUnmounted as u, createElementBlock as d, openBlock as i, withKeys as _, createElementVNode as o, renderSlot as f, createCommentVNode as p, toDisplayString as v } from "vue";
/* empty css                     */
import y from "../../../_virtual/_plugin-vue_export-helper.js";
const k = ["data-theme"], h = { class: "modal__container" }, E = { class: "modal__header" }, g = ["title"], M = {
  __name: "ModalFullscreen",
  props: {
    theme: {
      type: String,
      required: !1,
      default: "light"
    },
    title: {
      type: String,
      required: !1,
      default: void 0
    }
  },
  emits: ["close"],
  setup(s, { emit: a }) {
    const n = a, c = (t) => {
      t.target.classList.contains("modal__overlay") && n("close");
    }, l = (t) => {
      t.key === "Escape" && n("close");
    };
    return m(() => {
      document.addEventListener("keydown", l);
    }), u(() => {
      document.removeEventListener("keydown", l);
    }), (t, e) => (i(), d("div", {
      class: "modal__overlay",
      "data-theme": s.theme,
      onClick: c,
      onKeyup: e[1] || (e[1] = _((r) => n("close"), ["esc"]))
    }, [
      o("div", h, [
        o("div", E, [
          s.title ? (i(), d("div", {
            key: 0,
            class: "modal__caption",
            title: s.title
          }, v(s.title), 9, g)) : p("", !0),
          o("button", {
            class: "modal__close-button",
            onClick: e[0] || (e[0] = (r) => n("close"))
          }, [...e[2] || (e[2] = [
            o("span", null, [
              o("i", { class: "pi pi-times" })
            ], -1)
          ])])
        ]),
        f(t.$slots, "default", {}, void 0, !0)
      ])
    ], 40, k));
  }
}, C = /* @__PURE__ */ y(M, [["__scopeId", "data-v-b7da79e5"]]);
export {
  C as default
};
