/* One action control for the Downloads page and Settings download manager. */ (function(root) { 'use strict'; const paths = { retry: '', cancel: '', pause: '', resume: '', }; function create(doc, action, title) { if (!paths[action]) throw new Error('Unknown download action'); const label = action[0].toUpperCase() + action.slice(1); const button = doc.createElement('button'); button.type = 'button'; button.className = `dl-act download-action${action === 'cancel' ? ' danger' : ''}`; button.setAttribute('aria-label', `${label} ${title}`); const icon = doc.createElementNS('http://www.w3.org/2000/svg', 'svg'); icon.setAttribute('viewBox', '0 0 24 24'); icon.setAttribute('aria-hidden', 'true'); icon.setAttribute('focusable', 'false'); icon.classList.add('download-action-icon'); icon.innerHTML = paths[action]; const text = doc.createElement('span'); text.textContent = label; button.append(icon, text); return button; } const api = { create }; if (typeof module !== 'undefined' && module.exports) module.exports = api; else root.DownloadActions = api; })(globalThis);