import { ApplicationConfig, provideZoneChangeDetection, importProvidersFrom } from '@angular/core';
import { provideRouter } from '@angular/router';

import { routes } from './app.routes';
import { UiAccessibilityModule } from '../../../ui-accessibility/src/lib/ui-accessibility.module';

export const appConfig: ApplicationConfig = {
  providers: [
    provideZoneChangeDetection({ eventCoalescing: true }), 
    provideRouter(routes),
    importProvidersFrom(
      UiAccessibilityModule.forRoot({
        announcer: {
          defaultPoliteness: 'polite',
          defaultDuration: 4000,
          enabled: true
        },
        focusManagement: {
          trapFocus: true,
          restoreFocus: true,
          focusVisibleEnabled: true
        },
        keyboard: {
          enableShortcuts: true,
          enableArrowNavigation: true
        },
        skipLinks: {
          enabled: true,
          position: 'top',
          links: [
            { href: '#main', text: 'Skip to main content' },
            { href: '#nav', text: 'Skip to navigation' }
          ]
        },
        accessibility: {
          respectReducedMotion: true,
          respectHighContrast: true,
          injectAccessibilityStyles: true,
          addBodyClasses: true
        },
        development: {
          warnings: true,
          logging: true
        }
      })
    )
  ]
};
