import { Component, OnInit } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { PWAService } from './shared/services/mobile/pwa.service';
import { MobileBehaviorService } from './shared/services/mobile/mobile-behavior.service';
import { UpdateChangelogService } from './shared/services/mobile/update-changelog.service';
import { PWANotificationsComponent } from './shared/components/pwa-notifications/pwa-notifications.component';
import { UpdateSplashComponent } from './shared/components/update-splash/update-splash.component';
import { SnackNotifyContainerComponent } from './shared/components/snack-notify/snack-notify-container.component';
import { ConfirmationDialogComponent } from './shared/components/confirmation-dialog/confirmation-dialog.component';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [RouterOutlet, PWANotificationsComponent, UpdateSplashComponent, SnackNotifyContainerComponent, ConfirmationDialogComponent],
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
  title = 'PraFrota';

  constructor(
    private pwaService: PWAService,
    private mobileBehaviorService: MobileBehaviorService,
    private updateChangelogService: UpdateChangelogService
  ) {}

  ngOnInit(): void {
    // O PWAService já é inicializado automaticamente no constructor
    // O MobileBehaviorService já é inicializado automaticamente no constructor
    // O UpdateChangelogService já é inicializado automaticamente no constructor
    console.log('🚀 App PraFrota inicializado');
    console.log('📱 PWA Suportado:', this.pwaService.isPWASupported());
    console.log('🏠 PWA Instalado:', this.pwaService.isInstalledPWA());
    console.log('📱 Mobile Device:', this.mobileBehaviorService.getDeviceInfo().isMobile);
    console.log('🔒 Zoom Prevention:', 'Ativo');
    console.log('📋 Version Tracking:', this.updateChangelogService.getCurrentVersion());
  }
}
