@php $maintenanceWindows = collect(); if (auth()->check()) { $portalCustomer = \App\Models\Customer::query()->where('user_id', auth()->id())->first() ?? \App\Models\Customer::query()->where('email', auth()->user()->email)->first(); if ($portalCustomer) { $maintenanceWindows = \App\Models\MaintenanceWindow::bannerFor($portalCustomer); } } @endphp @if (auth()->check() && ! ($portalCustomer ?? null)) {{-- No customer behind this login (e.g. an operator account): say so, or every customer action on these pages looks like a dead button. --}}
{{ __('dashboard.no_customer_title') }} {{ __('dashboard.no_customer_hint') }} {{-- The console link is gone: a portal account is never an operator (R21). --}}
@endif
{{-- Impersonation is a MODE, not a notice: it stays visible rather than hiding in a dropdown, because acting as someone else without noticing is how mistakes happen. --}} @if (session('impersonator_id'))
{{ __('impersonate.banner', ['name' => auth()->user()->name]) }}
@csrf
@endif @if ($maintenanceWindows->isNotEmpty())

{{ __('maintenance.notices') }}

@foreach ($maintenanceWindows as $mw) @php $isActive = now()->betweenIncluded($mw->starts_at, $mw->ends_at); @endphp

{{ $mw->title }}

{{ $isActive ? __('maintenance.banner_active', ['end' => $mw->ends_at->local()->isoFormat('LT')]) : __('maintenance.banner_upcoming', ['start' => $mw->starts_at->local()->isoFormat('LLL'), 'end' => $mw->ends_at->local()->isoFormat('LT')]) }}

@endforeach
@endif @auth
@csrf
@endauth
{{ $slot }}
{{-- Global toast — any element can trigger it with $dispatch('notify', { message }) --}}
@livewire('wire-elements-modal') @livewireScripts