@php $_dec = static fn ($v): string => mws_notice_decode_plain((string) ($v ?? '')); $toRecipients = is_array($noticeLetterState['to_recipients'] ?? null) ? $noticeLetterState['to_recipients'] : []; if ($toRecipients === []) { $toRecipients = [['designation' => '—', 'department' => '']]; } $recipientRows = array_chunk($toRecipients, 2); $headerDeptText = trim((string) ($noticeLetterState['header_dept_text'] ?? '')); $headerLines = $headerDeptText === '' ? [] : preg_split('/\r\n|\r|\n/', $headerDeptText); $headerSection = 'EDUCATION SECTION'; if (count($headerLines) >= 3) { $headerSection = trim(implode("\n", array_slice($headerLines, 2))); } elseif ($headerDeptText !== '') { $headerSection = $headerDeptText; } if ($headerSection === '') { $headerSection = 'EDUCATION SECTION'; } $signer = ($noticeSignersListPdf[0] ?? null); $signerName = trim((string) ($signer['name'] ?? '')); $signerDesignation = trim((string) ($signer['designation'] ?? '')); $sigSrc = trim((string) ($mwsNoticeSignatureSrc ?? '')); @endphp
GOVERNMENT OF SINDH
PLANNING & DEVELOPMENT DEPARTMENT
{!! nl2br(e(mb_strtoupper($headerSection, 'UTF-8'))) !!}
NO. {{ $_dec($noticeLetterState['reference_display'] ?? '') }}
{{ $_dec($noticeLetterState['ref_dated_line'] ?? ($datedLine ?? '')) }}
MEETING NOTICE
{{ $_dec($noticeLetterState['delivery_mode_line'] ?? 'BY SPECIAL MESSENGER') }}
@foreach ($recipientRows as $pair) @foreach ($pair as $recipient) @php $designation = trim((string) ($recipient['designation'] ?? '')); $department = trim((string) ($recipient['department'] ?? '')); @endphp @endforeach @if (count($pair) === 1) @endif @endforeach
{{ $_dec($designation) }} @if ($department !== '')
{!! nl2br(e($_dec($department))) !!} @endif
SUBJECT: {{ $_dec($noticeLetterState['subject_line'] ?? '') }}
@php $generalBodyRows = is_array($noticeLetterState['body_num_rows'] ?? null) ? $noticeLetterState['body_num_rows'] : []; $mwsNlGeneralParaIndentHtml = str_repeat(' ', 15); $mwsNlEnsureGeneralParaIndentHtml = static function (string $html) use ($mwsNlGeneralParaIndentHtml): string { if ($html === '') { return $mwsNlGeneralParaIndentHtml; } $decoded = mws_notice_decode_inline_html($html); if (preg_match('/^(\x{00A0}| )+/u', $decoded, $m) && mb_strlen($m[0]) >= 15) { return $html; } if (trim(strip_tags($decoded)) === '') { return $mwsNlGeneralParaIndentHtml; } return $mwsNlGeneralParaIndentHtml.$html; }; @endphp @foreach ($generalBodyRows as $row) @php $itemHtml = $mwsNlEnsureGeneralParaIndentHtml(trim((string) ($row['item_html'] ?? ''))); @endphp @if ($itemHtml !== '')
{!! $itemHtml !!}
@endif @endforeach
@if ($sigSrc !== '') @else

@endif @if ($signerName !== '' && $signerName !== '—') ({{ $_dec(mb_strtoupper($signerName, 'UTF-8')) }})
@endif @if ($signerDesignation !== '') {{ $_dec(mb_strtoupper($signerDesignation, 'UTF-8')) }} @endif
C.C. to:
@if ($signerDesignation !== '' || $signerName !== '')
@endif