function download(blobUrl, filename) {
  if (filename == null) {
    filename = blobUrl.split('/').pop();
  }
  const anchorDownload = document.createElement('a');
  document.body.appendChild(anchorDownload);
  anchorDownload.href = blobUrl;
  anchorDownload.download = filename;
  anchorDownload.style.display = 'none';
  anchorDownload.click();

  setTimeout(() => {
    URL.revokeObjectURL(blobUrl);
    document.body.removeChild(anchorDownload);
  }, 10);
}
