The present application provides the compounds of formula (J), or pharmaceutically acceptable salts, isomers, tautomer, or a mixture thereof wherein n, m, R1, R2, R3, R4, and R5 are described herein. The compounds are inhibitors to the activities of phosphatidylinositol 3-kinase (ΡI3Κ) and are useful for treating conditions mediated by one or more PI3K isoforms. The present application further provides pharmaceutical compositions that include a compound of formula (I), or pharmaceutically acceptable salts, isomers, tautomer, or mixture thereof, and methods of using these compounds and compositions for treating conditions mediated by one or more ΡI3Κ isoforms.