import { c } from "react-compiler-runtime";
import React, { createRef, useEffect } from "react";
//#region src/UI/iframe/Iframe.jsx
const Iframe = (props) => {
	const $ = c(12);
	let containerRef;
	let other;
	let src;
	if ($[0] !== props) {
		({containerRef, src, ...other} = props);
		$[0] = props;
		$[1] = containerRef;
		$[2] = other;
		$[3] = src;
	} else {
		containerRef = $[1];
		other = $[2];
		src = $[3];
	}
	let t0;
	if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
		t0 = createRef();
		$[4] = t0;
	} else t0 = $[4];
	const iframeRef = t0;
	let t1;
	let t2;
	if ($[5] !== containerRef) {
		t1 = () => {
			const container = containerRef.current;
			const iframe = iframeRef.current;
			const resizeIframe = () => {
				iframe.style.height = `${container.scrollHeight}px`;
			};
			resizeIframe();
			window.addEventListener("resize", resizeIframe);
			return () => {
				window.removeEventListener("resize", resizeIframe);
			};
		};
		t2 = [containerRef, iframeRef];
		$[5] = containerRef;
		$[6] = t1;
		$[7] = t2;
	} else {
		t1 = $[6];
		t2 = $[7];
	}
	useEffect(t1, t2);
	let t3;
	if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
		t3 = { border: "none" };
		$[8] = t3;
	} else t3 = $[8];
	let t4;
	if ($[9] !== other || $[10] !== src) {
		t4 = /* @__PURE__ */ React.createElement("iframe", {
			ref: iframeRef,
			src,
			title: "udpIframe",
			width: "100%",
			style: t3,
			...other
		});
		$[9] = other;
		$[10] = src;
		$[11] = t4;
	} else t4 = $[11];
	return t4;
};
//#endregion
export { Iframe };

//# sourceMappingURL=Iframe.mjs.map