First-principle study of the basal-plane stacking fault energies of ternary Mg alloys