import{toBlob as d}from"./toBlob-D8DlSTQc.js";import{toCanvas as f}from"./toCanvas-7_PhvHvY.js";import"./index-CgQG7qql.js";async function L(m,e){let n=(e?.format||e?.type||"").toLowerCase(),a=n==="jpg"?"jpeg":n||"png",i=e?.filename||`snapdom.${a}`,t={...e||{},format:a,type:a};if(t.dpr=1,a==="svg"){let p=await d(m,{...t,type:"svg"}),l=URL.createObjectURL(p),r=document.createElement("a");r.href=l,r.download=i,r.click(),URL.revokeObjectURL(l);return}let c=await f(m,t),o=document.createElement("a");o.href=c.toDataURL(`image/${a}`,e?.quality),o.download=i,o.click()}export{L as download};
