You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
1.2 KiB
2 lines
1.2 KiB
import{bj as r}from"./index-f4658ae7.js";import{urlToBase64 as s,dataURLtoBlob as l}from"./base64Conver-f3be3d44.js";function m(e,t,d,n){s(e).then(a=>{f(a,t,d,n)})}function f(e,t,d,n){const a=l(e);w(a,t,d,n)}function w(e,t,d,n){const a=typeof n!="undefined"?[n,e]:[e],i=new Blob(a,{type:d||"application/octet-stream"}),c=window.URL.createObjectURL(i),o=document.createElement("a");o.style.display="none",o.href=c,o.setAttribute("download",t),typeof o.download=="undefined"&&o.setAttribute("target","_blank"),document.body.appendChild(o),o.click(),document.body.removeChild(o),window.URL.revokeObjectURL(c)}function p({url:e,target:t="_blank",fileName:d}){const n=window.navigator.userAgent.toLowerCase().indexOf("chrome")>-1,a=window.navigator.userAgent.toLowerCase().indexOf("safari")>-1;if(n||a){const i=document.createElement("a");if(i.href=e,i.target=t,i.download!==void 0&&(i.download=d||e.substring(e.lastIndexOf("/")+1,e.length)),document.createEvent){const c=document.createEvent("MouseEvents");return c.initEvent("click",!0,!0),i.dispatchEvent(c),!0}}return e.indexOf("?")===-1&&(e+="?download"),r(e,{target:t}),!0}export{f as downloadByBase64,w as downloadByData,m as downloadByOnlineUrl,p as downloadByUrl};
|