import {
  useQRReader
} from "./chunk-VR77KDOM.js";
import {
  styles
} from "./chunk-7ZBJZ4GA.js";
import {
  __spreadProps,
  __spreadValues
} from "./chunk-W7FAWX6T.js";

// src/components/QRReader/QRReader.tsx
import { jsx } from "@emotion/react/jsx-runtime";
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: __spreadValues(__spreadValues({}, styles.container), videoContainerStyle),
      children: /* @__PURE__ */ jsx(
        "video",
        {
          muted: true,
          id: videoId,
          style: __spreadProps(__spreadValues(__spreadValues({}, styles.video), videoStyle), {
            transform: (constraints == null ? void 0 : constraints.facingMode) === "user" ? "scaleX(-1)" : void 0
          })
        }
      )
    }
  ) });
}
QRReader.displayName = "QRReader";
QRReader.defaultProps = {
  constraints: {
    facingMode: "user"
  },
  videoId: "video",
  scanDelay: 500
};

export {
  QRReader
};
