import{dV as s}from"./index-9PRMimni.js";import{d as c,u as l}from"./base64Conver-4Xd-Hzyx.js";function u(e,o,i,r){l(e).then(a=>{w(a,o)})}function w(e,o,i,r){const a=c(e);m(a,o)}function m(e,o,i,r){const a=[e],t=new Blob(a,{type:"application/octet-stream"});if(typeof window.navigator.msSaveBlob<"u")window.navigator.msSaveBlob(t,o);else{const d=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=d,n.setAttribute("download",o),typeof n.download>"u"&&n.setAttribute("target","_blank"),document.body.appendChild(n),n.click(),document.body.removeChild(n),window.URL.revokeObjectURL(d)}}function p({url:e,target:o="_blank",fileName:i}){const r=window.navigator.userAgent.toLowerCase().indexOf("chrome")>-1,a=window.navigator.userAgent.toLowerCase().indexOf("safari")>-1;if(/(iP)/g.test(window.navigator.userAgent))return console.error("Your browser does not support download!"),!1;if(r||a){const t=document.createElement("a");if(t.href=e,t.target=o,t.download!==void 0&&(t.download=i||e.substring(e.lastIndexOf("/")+1,e.length)),document.createEvent){const d=document.createEvent("MouseEvents");return d.initEvent("click",!0,!0),t.dispatchEvent(d),!0}}return e.indexOf("?")===-1&&(e+="?download"),s(e,{target:o}),!0}export{m as a,w as b,u as c,p as d};
