script.jsexport const getLocalFiles = ({accept, multiple = false} = {}) => new Promise((resolve, reject) => {
const input = document.createElement('input');
input.type = 'file';
input.accept = accept;
input.multiple = multiple;
input.addEventListener('change', async () => {
resolve(multiple ? input.files : input.files?.[0]);
});
input.addEventListener('error', e => {
reject(e);
});
input.click();
});