First: don’t panic. Remember hermit crabs are wild animals and are use to other wild animals doing things like this around them.
Second: I’m assuming your hermit crabs are all below the substrate molting? Because if all of them are above then simply remove all of them from the habitat, clean out the habitat and put new substrate in before putting your hermit crabs back in the habitat.
But if they are below there are still some things you can do. If this is a large habitat, can you identify where the cat peed and remove that section of substrate without upsetting the molting hermit crabs? Usually these situations only happen in large habitats of 55+ gallons so if you know where the cat peed try and remove just that substrate and replace it.
If you don’t know how many times the cats have peed in the habitat and you have molting hermit crabs but can’t find them, then you should carefully remove as much of the solid substrate as possible without disturbing the hermit crabs and replace it with fresh substrate.
if you need more help, please join the Hermit Crab Owners facebook group https://www.facebook.com/groups/HermitCrabOwners/