Extinction times and phase transitions for spatially structured closed epidemics