import { useQRReader } from "./hooks.js";
import { styles } from "./styles.js";
import { jsx } from "@emotion/react/jsx-runtime";
//#region src/components/QRReader/QRReader.tsx
function QRReader({ videoContainerStyle = {}, containerStyle = {}, videoStyle = {}, constraints, scanDelay, className, onResult, videoId }) {
	useQRReader({
		constraints,
		scanDelay,
		onResult,
		videoId
	});
	return /* @__PURE__ */ jsx("section", {
		className,
		style: containerStyle,
		children: /* @__PURE__ */ jsx("div", {
			style: {
				...styles.container,
				...videoContainerStyle
			},
			children: /* @__PURE__ */ jsx("video", {
				muted: true,
				id: videoId,
				style: {
					...styles.video,
					...videoStyle,
					transform: constraints?.facingMode === "user" ? "scaleX(-1)" : void 0
				}
			})
		})
	});
}
QRReader.displayName = "QRReader";
QRReader.defaultProps = {
	constraints: { facingMode: "user" },
	videoId: "video",
	scanDelay: 500
};
//#endregion
export { QRReader };
