If I understand right, after repolarization, much of the potassium is outside the membrane and much of the sodium / calcium is inside. How does it get back to the original concentrations (i.e. potassium inside and sodium/calcium outside)?
During the repolarization, relatively few ions need to cross the membrane for the membrane voltage to change and therefore the change in ions concentration outside and inside the cell is neglible. After repolarization, the concentrations are restored by the continuous action of Na⁺/K⁺-ATPase. The same happens for calcium, but I don't know exactly what kind of pump is used.