High-voltage and overvoltage protection