From prompt to direct $$\mathrm{J}/\psi $$ production: new insights on the $$\chi _{{c}1} $$ and $$\chi _{{c}2} $$ polarizations and feed-down contributions from a global-fit analysis of mid-rapidity LHC data