import i from "./html2canvas.esm-d2sM-0Wm.js";
function l({ domElement: n, fileName: t, format: o = "png" }) {
  if (n)
    return new Promise((r, c) => {
      const e = document.createElement("a");
      i(n, { scale: 2 }).then((a) => {
        e.href = a.toDataURL(`image/${o}`), e.download = `${t}.${o}`, e.click(), e && e.remove(), r();
      }).catch((a) => {
        console.error("Error generating image:", a), c(a);
      });
    });
}
export {
  l as default
};
