<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Order Penilaian
        </h3>
        <div class="flex items-center gap-2">
            <a href="{{ url()->previous() }}" class="btn btn-xs btn-info">
                <i class="ki-filled ki-exit-left"></i> Back
            </a>
        </div>
    </div>
    <div class="card-body">
        <div class="grid gap-5 grid-cols-2">

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Tujuan Penilaian</label>
                <div class="flex flex-wrap items-baseline w-full">
                    @if (isset($permohonan->tujuanPenilaian))
                        <p class="text-2sm text-gray-700">{{ $permohonan->tujuanPenilaian->name }}</p>
                    @endif
                </div>
            </div>
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Tanggal Survey</label>
                <div class="flex flex-wrap items-base line w-full">
                    <p class="text-2sm text-gray-700">{{ $permohonan->created_at->format('d/m/Y') }}</p>
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Cab/Direktorat</label>
                <div class="flex flex-wrap items-baseline w-full">
                    @if (isset($permohonan->branch))
                        <p class="text-2sm text-gray-700">{{ $permohonan->branch->name }}</p>
                    @endif
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">AO</label>
                <div class="flex flex-wrap items-baseline w-full">
                    @if (isset($permohonan->user))
                        <p class="text-2sm text-gray-700">{{ $permohonan->user->name }}</p>
                    @endif
                </div>
            </div>

        </div>
    </div>
</div>

<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Identitas Debitur
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Nama Calon Debitur</label>
                <div class="flex flex-wrap items-baseline w-full">
                    @if (isset($permohonan->debiture->name))
                        <p class="text-2sm text-gray-700">{{ $permohonan->debiture->name }}</p>
                    @endif
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Nama Wakil Debitur</label>
                <div class="flex flex-wrap items-baseline w-full">
                    <input type="text" name="nama_wakil" class="input" placeholder="Masukkan Hubungan Calon Debitur"
                        value="{{ old('nama_wakil', $forminspeksi['nama_wakil'] ?? '') }}">

                    <em id="error-nama_wakil" class="alert text-danger text-sm"></em>

                </div>
            </div>
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Hubungan Calon Debitur</label>
                <div class="flex flex-wrap items-baseline w-full">
                    <input type="text" name="hub_calon_debitur" class="input"
                        placeholder="Masukkan Hubungan Calon Debitur"
                        value="{{ old('hub_calon_debitur', $forminspeksi['hub_calon_debitur'] ?? '') }}">


                    <em id="error-hub_calon_debitur" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>

<div class="card border border-agi-100 rounded-lg shadow-md">
    @include('lpj::surveyor.components.lokasi-jaminan')
</div>

<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Data Data Umum
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Jenis Pesawat</label>
                <div class="flex-wrap items-stretch">
                    <div class="flex flex-col items-start gap-4">
                        @if (isset($basicData['jenisPesawat']))
                            @foreach ($basicData['jenisPesawat'] as $item)
                                <div class="flex items-center">
                                    <label class="form-label flex items-center gap-2.5 text-nowrap">
                                        <input class="checkbox" name="jenis_pesawat[]" type="checkbox"
                                            value="{{ $item->name }}"
                                            {{ in_array($item->name, old('jenis_pesawat', [])) ||
                                            (isset($forminspeksi['jenis_pesawat']) &&
                                                is_array($forminspeksi['jenis_pesawat']) &&
                                                in_array($item->name, $forminspeksi['jenis_pesawat']))
                                                ? 'checked'
                                                : '' }}
                                            onclick="toggleCheckboxVisibility('jenis_pesawat', 'jenis_pesawat_lainnya', ['lainnya'])" />
                                        {{ $item->name }}
                                    </label>
                                    @if (strcasecmp($item->name, 'lainnya') == 0)
                                        <input id="jenis_pesawat_lainnya" type="text"
                                            style="{{ isset($forminspeksi['jenis_pesawat_lainnya']) && $forminspeksi['jenis_pesawat_lainnya'] ? '' : 'display: none;' }}"
                                            name="jenis_pesawat_lainnya" class="input w-full mt-2"
                                            placeholder="Masukkan bentuk tanah..."
                                            value="{{ old('jenis_pesawat_lainnya', $forminspeksi['jenis_pesawat_lainnya'] ?? '') }}" />
                                    @endif
                                </div>
                            @endforeach
                        @endif
                    </div>
                    <em id="error-jenis_pesawat" class="alert text-danger text-sm"></em>
                </div>
            </div>

            @php
                $inputDataJaminan = [
                    [
                        'label' => 'Size',
                        'value' => ['Small', 'Large'],
                        'name' => 'size',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Kondisi',
                        'value' => ['Laik Terbang', 'Sekrap', 'Rusak', 'Progress'],
                        'name' => 'kondisi',
                        'index' => 1,
                    ],
                ];
            @endphp

            @if (count($inputDataJaminan) > 0)
                @foreach ($inputDataJaminan as $item)
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5 mt-2">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <div class="flex flex-col items-start gap-4">
                                @if (isset($item['value']))
                                    @foreach ($item['value'] as $value)
                                        <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                                            <label class="form-label max-w-56 gap-2.5" style="width: 500px">
                                                <input class="checkbox" name="{{ $item['name'] }}[]" type="checkbox"
                                                    value="{{ $value }}"
                                                    {{ in_array($value, old($item['name'], $forminspeksi[$item['name']] ?? [])) ? 'checked' : '' }} />
                                                {{ $value }}
                                            </label>
                                        </div>
                                    @endforeach
                                @endif
                            </div>
                            <div class="w-full">
                                <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                                <em id="error-{{ $item['name'] }}-input-{{ $loop->index }}"
                                    class="alert text-danger text-sm"></em>
                            </div>
                        </div>
                    </div>
                @endforeach
            @endif

            @php
                $inputDataJaminan = [
                    [
                        'label' => 'Nama Pesawat',
                        'name' => 'nama_pesawat',
                        'value' => old('nama_pesawat', $forminspeksi['nama_pesawat'] ?? ''),
                        'index' => 0,
                    ],
                    [
                        'label' => 'Model',
                        'name' => 'model',
                        'value' => old('model', $forminspeksi['model'] ?? ''),
                        'index' => 1,
                    ],
                    [
                        'label' => 'Nomor Registrasi',
                        'name' => 'nomor_registrasi',
                        'value' => old('nomor_registrasi', $forminspeksi['nomor_registrasi'] ?? ''),
                        'index' => 2,
                    ],
                    [
                        'label' => 'Tahun Pembuatan',
                        'name' => 'tahun_pembuatan',
                        'value' => old('tahun_pembuatan', $forminspeksi['tahun_pembuatan'] ?? ''),
                        'index' => 3,
                    ],
                    [
                        'label' => 'Certificate of Airworthines (C of A)',
                        'name' => 'certificate_of_airworthines',
                        'value' => old(
                            'certificate_of_airworthines',
                            $forminspeksi['certificate_of_airworthines'] ?? '',
                        ),
                        'index' => 4,
                    ],
                    [
                        'label' => 'Certificate of Registration (C of A)',
                        'name' => 'certificate_of_registration',
                        'value' => old(
                            'certificate_of_registration',
                            $forminspeksi['certificate_of_registration'] ?? '',
                        ),
                        'index' => 5,
                    ],

                    [
                        'label' => 'Total Service Hours (TSN - Total Time Since New)',
                        'name' => 'total_service_hours',
                        'value' => old('total_service_hours', $forminspeksi['total_service_hours'] ?? ''),
                        'index' => 6,
                    ],
                    [
                        'label' => 'Total Service Cycles (CSN - Cycle Since New)',
                        'name' => 'total_service_cycles',
                        'value' => old('total_service_cycles', $forminspeksi['total_service_cycles'] ?? ''),
                        'index' => 7,
                    ],
                ];
            @endphp

            @if (count($inputDataJaminan) > 0)
                @foreach ($inputDataJaminan as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}" value="{{ $item['value'] }}">

                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif
        </div>
    </div>
</div>


<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Maintainence Data
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">

            @php

                $inputMaintenece = [
                    [
                        'label' => 'Last A Check',
                        'name' => 'last_a_check',
                        'value' => old('last_a_check', $forminspeksi['last_a_check'] ?? ''),
                        'index' => 0,
                    ],
                    [
                        'label' => 'Next A Check',
                        'name' => 'next_a_check',
                        'value' => old('next_a_check', $forminspeksi['next_a_check'] ?? ''),
                        'index' => 1,
                    ],
                    [
                        'label' => 'Last B Check',
                        'name' => 'last_b_check',
                        'value' => old('last_b_check', $forminspeksi['last_b_check'] ?? ''),
                        'index' => 2,
                    ],
                    [
                        'label' => 'Next B Check',
                        'name' => 'next_b_check',
                        'value' => old('next_b_check', $forminspeksi['next_b_check'] ?? ''),
                        'index' => 3,
                    ],
                    [
                        'label' => 'Last C Check',
                        'name' => 'last_c_check',
                        'value' => old('last_c_check', $forminspeksi['last_c_check'] ?? ''),
                        'index' => 4,
                    ],
                    [
                        'label' => 'Next C Check',
                        'name' => 'next_c_check',
                        'value' => old('next_c_check', $forminspeksi['next_c_check'] ?? ''),
                        'index' => 5,
                    ],
                    [
                        'label' => 'Next D Check (Overhaul)',
                        'name' => 'next_d_check',
                        'value' => old('next_d_check', $forminspeksi['next_d_check'] ?? ''),
                        'index' => 6,
                    ],
                    [
                        'label' => 'Last D Check (Overhaul)',
                        'name' => 'last_d_check',
                        'value' => old('last_d_check', $forminspeksi['last_d_check'] ?? ''),
                        'index' => 7,
                    ],
                ];
            @endphp

            @if (count($inputMaintenece) > 0)
                @foreach ($inputMaintenece as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}" value="{{ $item['value'] }}"">


                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_maintenence" id="" class="textarea">{{ $forminspeksi['deskripsi_maintenence'] ?? '' }}</textarea>

                    <em id="error-deskripsi_maintenence" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>

    </div>
</div>



<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Fungsi konfigurasi
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">

            @php

                $inputFungsiKonfigurasi = [
                    [
                        'label' => 'Instrument Landing System (ILS)',
                        'name' => 'instrument_landing_system',
                        'value' => $forminspeksi['instrument_landing_system'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Traffic Collision Avoidance System (TCAS)',
                        'name' => 'traffic_collision_avoidance_system',
                        'value' => $forminspeksi['traffic_collision_avoidance_system'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Windshear',
                        'name' => 'windshear',
                        'value' => $forminspeksi['windshear'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Electronic Flight Instrument System (EFIS)',
                        'name' => 'electronic_flight',
                        'value' => $forminspeksi['electronic_flight'] ?? '',
                        'index' => 3,
                    ],
                    [
                        'label' => 'Winglets ',
                        'name' => 'winglets',
                        'value' => $forminspeksi['winglets'] ?? '',
                        'index' => 4,
                    ],
                ];
            @endphp

            @if (count($inputFungsiKonfigurasi) > 0)
                @foreach ($inputFungsiKonfigurasi as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_konfigurasi" id="" class="textarea">{{ $forminspeksi['deskripsi_konfigurasi'] ?? '' }}</textarea>
                    <em id="error_deskripsi_konfigurasi" class="alert text-danger text-sm"></em>
                </div>
            </div>
        </div>
    </div>
</div>


<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Kondisi Kabin pesawat
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">

            @php
                $kondisiKabin = [
                    [
                        'label' => 'Maksimal Penumpang',
                        'name' => 'maksimal_penumpang',
                        'value' => $forminspeksi['maksimal_penumpang'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Jumlah Kursi',
                        'name' => 'jumlah_kursi',
                        'value' => $forminspeksi['jumlah_kursi'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Kursi Pramugari/Pramugara',
                        'name' => 'kursi_pramugari_pramugara',
                        'value' => $forminspeksi['kursi_pramugari_pramugara'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Kartu Fitur keselamatan',
                        'name' => 'kartu_fitur_keselamatan',
                        'value' => $forminspeksi['kartu_fitur_keselamatan'] ?? '',
                        'index' => 3,
                    ],
                    [
                        'label' => 'Sabuk Pengaman',
                        'name' => 'sabuk_pengaman',
                        'value' => $forminspeksi['sabuk_pengaman'] ?? '',
                        'index' => 4,
                    ],
                    [
                        'label' => 'Lampu Kabin',
                        'name' => 'lampu_kabin',
                        'value' => $forminspeksi['lampu_kabin'] ?? '',
                        'index' => 5,
                    ],
                    [
                        'label' => 'Lampu Pintu Keluar',
                        'name' => 'lampu_pintu_keluar',
                        'value' => $forminspeksi['lampu_pintu_keluar'] ?? '',
                        'index' => 6,
                    ],
                    [
                        'label' => 'Intercom Kabin',
                        'name' => 'intercom_kabin',
                        'value' => $forminspeksi['intercom_kabin'] ?? '',
                        'index' => 7,
                    ],
                ];
            @endphp

            @if (count($kondisiKabin) > 0)
                @foreach ($kondisiKabin as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>

                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_kabin" id="" class="textarea">{{ $forminspeksi['deskripsi_kabin'] ?? '' }}</textarea>

                    <em id="error_deskripsi_kabin" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>


<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Kondisi Struktur Pesawat
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">

            @php

                $kondisiStrukturPesawat = [
                    [
                        'label' => 'Badan pesawat',
                        'name' => 'badan_pesawat',
                        'value' => $forminspeksi['badan_pesawat'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Sayap Pesawat',
                        'name' => 'sayap_pesawat',
                        'value' => $forminspeksi['sayap_pesawat'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Ekor peswat',
                        'name' => 'ekor_pesawat',
                        'value' => $forminspeksi['ekor_pesawat'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Landing Gear',
                        'name' => 'landing_gear',
                        'value' => $forminspeksi['landing_gear'] ?? '',
                        'index' => 3,
                    ],
                    [
                        'label' => 'Sabuk Pengaman',
                        'name' => 'sabuk_pengaman',
                        'value' => $forminspeksi['sabuk_pengaman'] ?? '',
                        'index' => 4,
                    ],
                    [
                        'label' => 'Sistem Pengelasan',
                        'name' => 'sistem_pengelasan',
                        'value' => $forminspeksi['sistem_pengelasan'] ?? '',
                        'index' => 5,
                    ],
                ];
            @endphp

            @if (count($kondisiStrukturPesawat) > 0)
                @foreach ($kondisiStrukturPesawat as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_struktur" id="" class="textarea">{{ $forminspeksi['deskripsi_struktur'] ?? '' }}</textarea>
                    <em id="error-deskripsi_struktur" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>



<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Fungsi Navigasi dan Komunikasi
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">
            @php

                $fungsiNavigasi = [
                    [
                        'label' => 'Gps',
                        'name' => 'gps',
                        'value' => $forminspeksi['gps'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Radar',
                        'name' => 'radar',
                        'value' => $forminspeksi['radar'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Radio Komunikasi',
                        'name' => 'radio_komunikasi',
                        'value' => $forminspeksi['radio_komunikasi'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Lampu Navigasi',
                        'name' => 'lampu_navigasi',
                        'value' => $forminspeksi['lampu_navigasi'] ?? '',
                        'index' => 3,
                    ],
                    [
                        'label' => 'Sistem Autopilot',
                        'name' => 'sistem_autopilot',
                        'value' => $forminspeksi['sistem_autopilot'] ?? '',
                        'index' => 4,
                    ],
                ];
            @endphp
            @if (count($fungsiNavigasi) > 0)
                @foreach ($fungsiNavigasi as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_navigasi" class="textarea">{{ $forminspeksi['deskripsi_navigasi'] ?? '' }}</textarea>

                    <em id="error-deskripsi_navigasi" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>



<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Kondisi Sistem Bahan Bakar dan Hidrolic
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">
            @php

                $kondisiSistem = [
                    [
                        'label' => 'Tangki Bahan Bakar',
                        'name' => 'tangki_bahan_bakar',
                        'value' => $forminspeksi['tangki_bahan_bakar'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Saluran & Pipa Bahan Bakar',
                        'name' => 'saluran_pipa_bahan_bakar',
                        'value' => $forminspeksi['saluran_pipa_bahan_bakar'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Pompa Bahan Bakar',
                        'name' => 'pompa_bahan_bakar',
                        'value' => $forminspeksi['pompa_bahan_bakar'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Sistem Hidrolik Utama',
                        'name' => 'sistem_hidrolik_utama',
                        'value' => $forminspeksi['sistem_hidrolik_utama'] ?? '',
                        'index' => 3,
                    ],
                    [
                        'label' => 'Sistem Pendigin Hidrolik',
                        'name' => 'sistem_pendigin_hidrolik',
                        'value' => $forminspeksi['sistem_pendigin_hidrolik'] ?? '',
                        'index' => 4,
                    ],
                ];
            @endphp
            @if (count($kondisiSistem) > 0)
                @foreach ($kondisiSistem as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_hidrolik" id="" class="textarea">{{ $forminspeksi['deskripsi_hidrolik'] ?? '' }}</textarea>
                    <em id="error-deskripsi_hidrolik" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>


<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Kondisi Mesin dan Propulis
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">
            @php

                $kondisiMesin = [
                    [
                        'label' => 'Mesin Utama',
                        'name' => 'mesin_utama',
                        'value' => $forminspeksi['mesin_utama'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Sistem Pendorong',
                        'name' => 'sistem_pendorong',
                        'value' => $forminspeksi['sistem_pendorong'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Sistem Pendigin Mesin',
                        'name' => 'sistem_pendigin_mesin',
                        'value' => $forminspeksi['sistem_pendigin_mesin'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Sistem pelumasan',
                        'name' => 'sistem_pelumasan',
                        'value' => $forminspeksi['sistem_pelumasan'] ?? '',
                        'index' => 3,
                    ],
                    [
                        'label' => 'Filter dan Perangkat Pendukung',
                        'name' => 'filter_dan_perangkat_pendukung',
                        'value' => $forminspeksi['filter_dan_perangkat_pendukung'] ?? '',
                        'index' => 4,
                    ],
                ];
            @endphp
            @if (count($kondisiMesin) > 0)
                @foreach ($kondisiMesin as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_kondisi_mesin" id="" class="textarea">{{ $forminspeksi['deskripsi_kondisi_mesin'] ?? '' }}</textarea>
                    <em id="error-deskripsi_kondisi_mesin" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>


<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Fungsi keselamatan dan darurat
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">
            @php

                $fungsiKeselamatan = [
                    [
                        'label' => 'Jaket pelampung',
                        'name' => 'jaket_pelampung',
                        'value' => $forminspeksi['jaket_pelampung'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Pintu darurat',
                        'name' => 'pintu_darurat',
                        'value' => $forminspeksi['pintu_darurat'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Alat Pemadaman Kebakaran',
                        'name' => 'alat_pemadaman_kebakaran',
                        'value' => $forminspeksi['alat_pemadaman_kebakaran'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Sistem Alaram Darurat',
                        'name' => 'sistem_alaram_darurat',
                        'value' => $forminspeksi['sistem_alaram_darurat'] ?? '',
                        'index' => 3,
                        'index' => 3,
                    ],
                    [
                        'label' => 'Sekoci',
                        'name' => 'sekoci',
                        'value' => $forminspeksi['sekoci'] ?? '',
                        'index' => 4,
                    ],
                    [
                        'label' => 'Masker Oksigen',
                        'name' => 'masker_oxigen',
                        'value' => $forminspeksi['masker_oxigen'] ?? '',
                        'index' => 5,
                    ],
                    [
                        'label' => 'Sabuk Pengaman',
                        'name' => 'sabuk_pengaman',
                        'value' => $forminspeksi['sabuk_pengaman'] ?? '',
                        'index' => 6,
                    ],
                ];
            @endphp
            @if (count($fungsiKeselamatan) > 0)
                @foreach ($fungsiKeselamatan as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_fungsi_keselamatan" id="" class="textarea">{{ $forminspeksi['deskripsi_fungsi_keselamatan'] ?? '' }}</textarea>

                    <em id="error_deskripsi_fungsi_keselamatan" class="alert text-danger text-sm"></em>

                </div>
            </div>
        </div>
    </div>
</div>



<div class="card border border-agi-100  rounded-lg shadow-md overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Interior dan Sistem Pendukung Kabin
        </h3>
    </div>
    <div class="card-body">

        <div class="grid gap-5">
            @php

                $inputStrukturPeswat = [
                    [
                        'label' => 'Sistem ventilasi & AC',
                        'name' => 'sistem_ventilasi_ac',
                        'value' => $forminspeksi['sistem_ventilasi_ac'] ?? '',
                        'index' => 0,
                    ],
                    [
                        'label' => 'Sistem Penerangan Kabin',
                        'name' => 'sistem_penerangan_kabin',
                        'value' => $forminspeksi['sistem_penerangan_kabin'] ?? '',
                        'index' => 1,
                    ],
                    [
                        'label' => 'Panel Informasi Penumpang',
                        'name' => 'panel_informasi_penumpang',
                        'value' => $forminspeksi['panel_informasi_penumpang'] ?? '',
                        'index' => 2,
                    ],
                    [
                        'label' => 'Sistem Hiburan Kabin',
                        'name' => 'sistem_hiburan_kabin',
                        'value' => $forminspeksi['sistem_hiburan_kabin'] ?? '',
                        'index' => 3,
                    ],
                ];
            @endphp
            @if (count($inputStrukturPeswat) > 0)
                @foreach ($inputStrukturPeswat as $item)
                    <!-- Nomor Lambung -->
                    <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                        <label class="form-label max-w-56">{{ $item['label'] }}</label>
                        <div class="flex flex-wrap items-baseline w-full">
                            <input type="text" name="{{ $item['name'] }}" class="input"
                                placeholder="Masukkan {{ $item['label'] }}"
                                value="{{ old($item['name'], $item['value'] ?? '') }}">
                            <em id="error-{{ $item['name'] }}" class="alert text-danger text-sm"></em>
                        </div>
                    </div>
                @endforeach
            @endif

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Deskripsi/Keterangan Lain Lain </label>
                <div class="flex flex-wrap items-baseline w-full">
                    <textarea name="deskripsi_Interior" id="" class="textarea">{{ $forminspeksi['deskripsi_Interior'] ?? '' }}</textarea>
                    <em id="error-deskripsi_Interior" class="alert text-danger text-sm"></em>
                </div>
            </div>
        </div>
    </div>
</div>



<div class="card border border-agi-100 rounded-lg  overflow-hidden">
    <div class="card-header bg-agi-50">
        <h3 class="card-title uppercase">
            Analisis Fakta
        </h3>
    </div>
    <div class="card-body">
        <div class="grid gap-5">
            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Faktor Positif</label>
                <div id="fakta-positif-container" class="flex flex-wrap items-baseline w-full">
                    @if (!empty($forminspeksi['fakta_positif']))
                        @foreach ($forminspeksi['fakta_positif'] as $index => $positif)
                            <div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
                                <textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old("fakta_positif.$index", $positif) }}</textarea>
                                <button class="btn btn-danger btn-sm remove-btn" type="button"
                                    style="display: none;">
                                    <i class="ki-outline ki-trash"></i>
                                </button>
                            </div>
                        @endforeach
                    @else
                        <div class="fakta_positif flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="fakta_positif[]" rows="10">{{ old('fakta_positif.0', '') }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                        </div>
                    @endif
                    <button type="button" class="btn btn-primary btn-sm mt-5"
                        onclick="addClonableItem('fakta-positif-container', 'fakta_positif')">
                        <i class="ki-outline ki-plus"></i>
                    </button>
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Faktor Negatif</label>
                <div id="fakta-negatif-container" class="flex flex-wrap items-baseline w-full">

                    @if (!empty($forminspeksi['fakta_negatif']))
                        @foreach ($forminspeksi['fakta_negatif'] as $index => $negatif)
                            <div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
                                <textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old("fakta_negatif.$index", $negatif) }}</textarea>
                                <button class="btn btn-danger btn-sm remove-btn" type="button"
                                    style="display: none;">
                                    <i class="ki-outline ki-trash"></i>
                                </button>
                            </div>
                        @endforeach
                    @else
                        <div class="fakta_negatif flex items-center gap-2 mt-2 textarea-group w-full">
                            <textarea class="textarea mt-2" name="fakta_negatif[]" rows="10">{{ old('fakta_negatif.0', $forminspeksi['fakta_negatif'][0] ?? '') }}</textarea>
                            <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                                <i class="ki-outline ki-trash"></i>
                            </button>
                            <em id="error-fakta_negatif" class="alert text-danger text-sm"></em>
                        </div>
                    @endif
                    <button type="button" class="btn btn-primary btn-sm mt-5"
                        onclick="addClonableItem('fakta-negatif-container', 'fakta_negatif')">
                        <i class="ki-outline ki-plus"></i>
                    </button>
                </div>
            </div>

            <div class="flex items-baseline flex-wrap lg:flex-nowrap gap-2.5">
                <label class="form-label max-w-56">Catatan Yang Perlu Diperhatikan</label>
                <div id="catatan-container" class="flex flex-wrap items-baseline w-full">
                    <div class="catatan flex items-center gap-2 mt-2 textarea-group w-full">
                        <textarea class="textarea mt-2" name="catatan[]" rows="10">{{ old('catatan.0', $forminspeksi['catatan'][0] ?? '') }}</textarea>
                        <button class="btn btn-danger btn-sm remove-btn" type="button" style="display: none;">
                            <i class="ki-outline ki-trash"></i>
                        </button>
                        <em id="error-catatan" class="alert text-danger text-sm"></em>
                    </div>
                    <button type="button" onclick="addClonableItem('catatan-container', 'catatan')"
                        class="btn btn-primary btn-sm mt-5 ">
                        <i class="ki-outline ki-plus"></i>
                    </button>
                </div>

            </div>

        </div>
    </div>
</div>
