Solvent effect on the spectral properties of dipolar laser dyes: Evaluation of ground and excited state dipole moments