import { E as e, F as t, M as n, Q as r, S as i, V as a, _ as o, b as s, f as c, g as l, h as u, it as d, m as f, p, t as m, u as h } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
import { w as g } from "./useEditorCore-D0uZbPKG.js";
import { E as _ } from "./keys-BeW4IrXP.js";
//#region src/cloud/components/TplModal.vue?vue&type=script&setup=true&lang.ts
var v = ["data-tpl-theme"], y = /* @__PURE__ */ i({
	__name: "TplModal",
	props: { visible: { type: Boolean } },
	emits: ["close", "keydown"],
	setup(i, { emit: y }) {
		let b = i, x = y, S = r(null);
		g(S, p(() => b.visible));
		let C = e(_);
		function w(e) {
			e.key === "Escape" && x("close"), x("keydown", e);
		}
		return (e, r) => (n(), u(c, { to: "body" }, [s(m, {
			"enter-active-class": "tpl:transition tpl:duration-150",
			"enter-from-class": "tpl:opacity-0",
			"enter-to-class": "tpl:opacity-100",
			"leave-active-class": "tpl:transition tpl:duration-100",
			"leave-from-class": "tpl:opacity-100",
			"leave-to-class": "tpl:opacity-0"
		}, {
			default: a(() => [i.visible ? (n(), o("div", {
				key: 0,
				"data-tpl-theme": d(C),
				class: "tpl tpl:fixed tpl:inset-0 tpl:z-modal tpl:flex tpl:items-center tpl:justify-center",
				style: {
					"background-color": "var(--tpl-overlay)",
					"backdrop-filter": "blur(8px)",
					"-webkit-backdrop-filter": "blur(8px)"
				},
				onClick: r[0] ||= h((e) => x("close"), ["self"]),
				onKeydown: w
			}, [f("div", {
				ref_key: "dialogRef",
				ref: S
			}, [t(e.$slots, "default")], 512)], 40, v)) : l("", !0)]),
			_: 3
		})]));
	}
});
//#endregion
export { y as t };
