Every minor who violates this chapter shall be punished as follows:
(a) By imprisonment pursuant to subdivision (h) of Section 1170 or in a county jail if one of the following applies:
- (1) The minor has been found guilty previously of violating this chapter.
- (2) The minor has been found guilty previously of an offense specified in Section 29905, 32625, or 33410, or an offense specified in any provision listed in Section 16590.
- (3) The minor has been found guilty of possessing a handgun in violation of Section 29610.
- (b) Violations of this chapter other than those violations specified in subdivision (a) shall be punishable as a misdemeanor.