import { A as e, N as t, X as n, b as r, c as i, d as a, f as o, h as s, m as c, p as l, rt as u, t as d, u as f, v as p, w as m, z as h } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
import { w as g } from "./useEditorCore-uCU9Ny0M.js";
import { k as _ } from "./keys-B5SJtPWf.js";
import { t as v } from "./usePopoverRoot-BxJrqnMD.js";
//#region src/cloud/components/TplModal.vue?vue&type=script&setup=true&lang.ts
var y = ["data-tpl-theme"], b = /* @__PURE__ */ r({
	__name: "TplModal",
	props: { visible: { type: Boolean } },
	emits: ["close", "keydown"],
	setup(r, { emit: b }) {
		let x = r, S = b, C = n(null);
		g(C, a(() => x.visible));
		let w = m(_), T = v();
		function E(e) {
			e.key === "Escape" && S("close"), S("keydown", e);
		}
		return (n, a) => u(T) ? (e(), l(f, {
			key: 0,
			to: u(T)
		}, [p(d, {
			"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: h(() => [r.visible ? (e(), s("div", {
				key: 0,
				"data-tpl-theme": u(w),
				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: a[0] ||= i((e) => S("close"), ["self"]),
				onKeydown: E
			}, [o("div", {
				ref_key: "dialogRef",
				ref: C
			}, [t(n.$slots, "default")], 512)], 40, y)) : c("", !0)]),
			_: 3
		})], 8, ["to"])) : c("", !0);
	}
});
//#endregion
export { b as t };
