Replace the pre-evaluated isServer check with a direct typeof window === 'undefined' check to properly handle test scenarios where window is stubbed after module load.
Co-authored-by: lyzno1 <92089059+lyzno1@users.noreply.github.com>
Centralize server/client environment detection by introducing a dedicated utility
file instead of repeating `typeof window === 'undefined'` checks across the codebase.
This improves code maintainability and consistency across 8 files with 15 occurrences.
Closes#30802