    <!-- jQuery -->
    <script src="{{ global_asset('vendors/') }}/jquery/jquery-3.6.0.min.js"></script>
    <!--  Bootstrap 5 -->
    <script src="{{ global_asset('vendors/') }}/bootstrap/js/popper.min.js"></script>
    <script src="{{ global_asset('vendors/') }}/bootstrap/js/bootstrap.min.js"></script>
    <!-- Metis Menu -->
    <script src="{{ global_asset('vendors/') }}/metis-menu/js/metis-menu.min.js"></script>
    <!-- date ranger -->
    <script src="{{ global_asset('vendors/') }}/daterangepicker/js/moment.min.js"></script>
    <script src="{{ global_asset('vendors/') }}/daterangepicker/js/daterangepicker.min.js"></script>
    <!-- Swwet alert -->
    <script src="{{ global_asset('vendors/') }}/sweet-alert/js/sweetalert2@11.min.js"></script>
    <script src="{{ global_asset('vendors/') }}/select2/js/select2.min.js"></script>
    {{-- Js --}}
    <script src="{{ global_asset('backend/') }}/js/jquery-ui.js"></script>
    {{-- toastr --}}
    <script src="{{ global_asset('js/toastr.js') }}"></script>
    {!! Toastr::message() !!}
    @if (Session::has('toastr'))
        @dd(Session::get('toastr'))
    @endif
    {{-- toastr --}}
    <script src="{{ global_asset('js/') }}/newmain.js"></script>
    <script src="{{ global_asset('js/') }}/theme.js" async></script>
    <!-- Input Tags -->
    <script src="{{ global_asset('vendors/') }}/inputtags/tagsinput.js"></script>
    <script src="{{ global_asset('backend/js/main.js') }}"></script>
    <script src="{{ global_asset('js/') }}/select2-init.js"></script>
    @stack('scripts')
    {{-- axios load --}}
    <script src="{{ global_asset('js/axios.js') }}"></script>
    {{-- axios load --}}
    <script>
        $.ajaxSetup({
            headers: {
                "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
            },
        });
    </script>
    <script src="{{ global_asset('backend/js/fs_d_ecma/configuration/configuration.js') }}"></script>

    <script>
        $(document).ready(function() {
            $.ajax({
                url: "{{ route('award.unseen') }}",
                type: "GET",
                dataType: "json",
                success: function(response) {
                    if (response.success && response.data) {
                        $("#awardGiftInfo").text(response.data.gift_info);
                        $("#awardDetailsId").data("award-id", response.data.id);

                        // Update View Details button link
                        let awardViewRoute = "{{ route('award.view', ':id') }}".replace(':id', response
                            .data.id);
                        $("#awardDetailsId").attr("href", awardViewRoute);

                        // Show the modal
                        $('#awardModal').modal('show');
                    }
                },
                error: function(xhr, status, error) {
                    console.error("AJAX Error:", error);
                }
            });
        });

        $(document).on("click", "#awardDetailsId", function(e) {
            e.preventDefault();

            let awardId = $(this).data("award-id");

            // Hide the modal
            $('#awardModal').modal('hide');

            $.ajax({
                url: "{{ route('award.seen') }}",
                type: "POST",
                data: {
                    _token: "{{ csrf_token() }}",
                    id: awardId
                },
                dataType: "json",
                success: function(response) {
                    if (response.success) {
                        window.location.href = $("#awardDetailsId").attr("href");
                    }
                },
                error: function(xhr, status, error) {
                    console.error("Error marking award as seen:", error);
                }
            });
        });
    </script>
