|  |  | @ -179,27 +179,62 @@ export default { | 
			
		
	
		
		
			
				
					
					|  |  |  |       this.isDownloading = true |  |  |  |       this.isDownloading = true | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |       fetch(this.baseUrl + `/submitters/${this.submitterSlug}/download`).then((response) => response.json()).then((urls) => { |  |  |  |       fetch(this.baseUrl + `/submitters/${this.submitterSlug}/download`).then((response) => response.json()).then((urls) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |         const fileRequests = urls.map((url) => { |  |  |  |         const isSafariIos = /iPhone|iPad|iPod/i.test(navigator.userAgent) | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           return () => { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |             return fetch(url).then(async (resp) => { |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |               const blobUrl = URL.createObjectURL(await resp.blob()) |  |  |  |  | 
			
		
	
		
		
			
				
					
					|  |  |  |               const link = document.createElement('a') |  |  |  |  | 
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |               link.href = blobUrl |  |  |  |         if (isSafariIos && urls.length > 1) { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |               link.setAttribute('download', decodeURI(url.split('/').pop())) |  |  |  |           this.downloadSafariIos(urls) | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } else { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           this.downloadUrls(urls) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     }, | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |     downloadUrls (urls) { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       const fileRequests = urls.map((url) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return () => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           return fetch(url).then(async (resp) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             const blobUrl = URL.createObjectURL(await resp.blob()) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             const link = document.createElement('a') | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             link.href = blobUrl | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             link.setAttribute('download', decodeURI(url.split('/').pop())) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             link.click() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             URL.revokeObjectURL(blobUrl) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         } | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       }) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |               link.click() |  |  |  |       fileRequests.reduce( | 
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         (prevPromise, request) => prevPromise.then(() => request()), | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         Promise.resolve() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       ) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |               URL.revokeObjectURL(url) |  |  |  |       this.isDownloading = false | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |             }) |  |  |  |     }, | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           } |  |  |  |     downloadSafariIos (urls) { | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       const fileRequests = urls.map((url) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         return fetch(url).then(async (resp) => { | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const blob = await resp.blob() | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const blobUrl = URL.createObjectURL(blob.slice(0, blob.size, 'application/octet-stream')) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           const link = document.createElement('a') | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           link.href = blobUrl | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           link.setAttribute('download', decodeURI(url.split('/').pop())) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           return link | 
			
		
	
		
		
			
				
					
					|  |  |  |         }) |  |  |  |         }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       }) | 
			
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |         fileRequests.reduce( |  |  |  |       Promise.all(fileRequests).then((links) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           (prevPromise, request) => prevPromise.then(() => request()), |  |  |  |         links.forEach((link, index) => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |           Promise.resolve() |  |  |  |           setTimeout(() => { | 
			
				
				
			
		
	
		
		
			
				
					
					|  |  |  |         ) |  |  |  |             link.click() | 
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					|  |  |  | 
 |  |  |  | 
 | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |             URL.revokeObjectURL(link.href) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |           }, index * 50) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |         }) | 
			
		
	
		
		
			
				
					
					|  |  |  |  |  |  |  |       }).finally(() => { | 
			
		
	
		
		
			
				
					
					|  |  |  |         this.isDownloading = false |  |  |  |         this.isDownloading = false | 
			
		
	
		
		
			
				
					
					|  |  |  |       }) |  |  |  |       }) | 
			
		
	
		
		
			
				
					
					|  |  |  |     } |  |  |  |     } | 
			
		
	
	
		
		
			
				
					|  |  | 
 |