{
const { path, checked, type } = e.detail;
if (checked) {
if (file_count === "single") {
value = [path];
} else if (type === "folder") {
if (!path_in_set(path, selected_folders)) {
selected_folders = [...selected_folders, path];
}
} else {
if (!path_in_set(path, value)) {
value = [...value, path];
}
}
} else {
selected_folders = selected_folders.filter(
(folder) => !path_inside(path, folder)
); // deselect all parent folders
if (type === "folder") {
selected_folders = selected_folders.filter(
(folder) => !path_inside(folder, path)
); // deselect all children folders
value = value.filter((file) => !path_inside(file, path)); // deselect all children files
} else {
value = value.filter((x) => !paths_equal(x, path));
}
}
}}
/>