@if($edit)
    <div class="mceNonEditable component-container" data-component-key="promoBanners">
        <a href="#" class="btn btn-danger pull-right delete-component">X</a>
        <h4>@lang('hilco::app.promotions')</h4>
        <p>@lang('hilco::app.displays_promotion_banner_across_the_entire_width_of_the_page_that_rotate')</p>
    </div>
@endif

@if($script)
    <script type="text/javascript">
        registerComponent('promoBanners', {
            menuText: 'hilco::app.promotions',
            bladeTemplate: 'hilco::components.promoBanners',
            init: function (body) {
            },
            serialize: function (componentNode) {
                return {};
            },
        });
    </script>
@endif

@if($view)
    <div id="qualified-promotions-carousel" class="owl-carousel owl-theme">
        @foreach(Arr::get($cartStatus, 'customerTriggeredPromotions', []) as $promotion)
            @if (strlen($promotion->homepage_banner_text))
                <div class="alert text-center" style="background-color: black; color: white; font-size: 14pt;">
                    @if (strlen($promotion->homepage_banner_link))
                        <a style="color: white;" href="{!! $promotion->homepage_banner_link !!}"><strong>{!! $promotion->homepage_banner_text !!}</strong></a>
                    @else
                        <strong>{!! $promotion->homepage_banner_text !!}</strong>
                    @endif
                </div>
            @endif
        @endforeach
    </div>

    <script type="text/javascript">
        $(document).ready(function () {
            $('#qualified-promotions-carousel').owlCarousel({
                center: true,
                items: 1,
                @if(count(Arr::get($cartStatus, 'triggeredPromotions', [])) > 1)
                loop: true,
                @endif
                autoplay: true,
                autoplayTimeout: {{ isset($bannerTimeout) ? $bannerTimeout : '3000' }},
                autoplayHoverPause: true,
                dots: true,
                smartSpeed: 1250,
            });
        });
    </script>
@endif