@php use Illuminate\Support\Str; /** @var array $bundle */ $summary = is_array($bundle['summary'] ?? null) ? $bundle['summary'] : []; $context = is_array($bundle['context'] ?? null) ? $bundle['context'] : []; $sections = is_array($bundle['sections'] ?? null) ? $bundle['sections'] : []; $redaction = is_array($bundle['redaction'] ?? null) ? $bundle['redaction'] : []; $notes = is_array($bundle['notes'] ?? null) ? $bundle['notes'] : []; $availabilityColor = static function (?string $availability): string { return match ($availability) { 'available', 'current', 'fresh', 'ready' => 'success', 'partial', 'stale' => 'warning', 'error', 'missing', 'unavailable' => 'danger', default => 'gray', }; }; $referenceDescription = static function (array $reference): string { $parts = [ is_string($reference['type'] ?? null) && trim((string) $reference['type']) !== '' ? (string) $reference['type'] : 'reference', is_string($reference['availability'] ?? null) && trim((string) $reference['availability']) !== '' ? (string) $reference['availability'] : 'missing', ]; if (is_string($reference['freshness_note'] ?? null) && trim((string) $reference['freshness_note']) !== '') { $parts[] = (string) $reference['freshness_note']; } return implode(' - ', $parts); }; @endphp
{{ data_get($context, 'type', data_get($bundle, 'context_type', 'tenant')) }} {{ data_get($summary, 'freshness_state', data_get($bundle, 'freshness_state', 'mixed')) }} {{ str_replace('_', '-', (string) data_get($redaction, 'mode', data_get($bundle, 'redaction_mode', 'default-redacted'))) }}
Workspace
{{ data_get($context, 'workspace_label', 'Workspace unavailable') }}
Tenant
{{ data_get($context, 'tenant_label', 'Tenant unavailable') }}
@if ($notes !== [])
@foreach ($notes as $note) @if (is_string($note) && trim($note) !== '')
Note

{{ $note }}

@endif @endforeach
@endif
@foreach ($sections as $section) @php $references = is_array($section['references'] ?? null) ? $section['references'] : []; $markers = is_array($section['redaction_markers'] ?? null) ? $section['redaction_markers'] : []; $availability = is_string($section['availability'] ?? null) && trim((string) $section['availability']) !== '' ? (string) $section['availability'] : 'missing'; $sectionLabel = $section['label'] ?? $section['key'] ?? 'Section'; $sectionSummary = $section['summary'] ?? 'No summary available.'; @endphp {{ $availability }}
@if (is_string($section['freshness_note'] ?? null) && trim((string) $section['freshness_note']) !== '')

{{ $section['freshness_note'] }}

@endif @if ($references !== [])
@foreach ($references as $reference) @php $referenceLabel = $reference['label'] ?? 'Reference unavailable'; $referenceUrl = is_string($reference['url'] ?? null) && trim((string) $reference['url']) !== '' ? (string) $reference['url'] : null; $referenceActionLabel = $reference['action_label'] ?? ($referenceUrl ? 'Open' : 'Unavailable'); @endphp @if ($referenceUrl) {{ $referenceActionLabel }} @else {{ $referenceActionLabel }} @endif @endforeach
@endif @if ($markers !== [])
@foreach ($markers as $marker) {{ trim((string) (($marker['replacement_text'] ?? '[REDACTED]').' '.Str::of((string) ($marker['reason'] ?? 'redacted'))->replace('_', ' '))) }} @endforeach
@endif
@endforeach