@inject('callApiService', 'App\Services\CallApiService')

@php
    $headerPart = $callApiService->callApi([
        'url' => 'list-type1-book',
        'data' => [
            'Book' => [
                [
                    'QueryVars' => [
                        'QueryName' => 'pro:shop/wish',
                        'SubSimpleFilter' => "image_type = 'thumb'",
                        'IsntPagination' => true,
                    ],
                    'PageVars' => [
                        'Limit' => 100000
                    ]
                ],
                [
                    'QueryVars' => [
                        'QueryName' => 'point2u::pro:shop/cart',
                        'SubSimpleFilter' => "image_type = 'thumb'",
                        'IsntPagination' => true,
                    ],
                    'PageVars' => [
                        'Limit' => 100000
                    ]
                ]
            ]

        ],
    ]);
    $wishCount = collect($headerPart['Book'][0]['Page'])->count();
    $cartCount = collect($headerPart['Book'][1]['Page'])->count();
@endphp

<!--=====================================
    HEADER PART START
=======================================-->

<header class="header-part">
  <div class="container">
    <div class="header-content">
      <div class="header-media-group">
        <button class="header-user"><i class="fas fa-bars"></i></button>
        <a href="{{ route('index') }}"><img src="{{ '/themes/pro/modunawa/resources/images/logo.png' }}" alt="logo"></a>
        <button class="header-src"><i class="fas fa-search"></i></button>
      </div>
      <a href="/" class="header-logo"> <img src="{{ '/themes/pro/modunawa/resources/images/logo.png' }}" alt="logo"> </a>
      <form id="search-form" action="{{ route('item-gallery', 'all') }}" class="header-form">
        <input type="text" name="p" placeholder="Search anything...">
        <button type="submit"><i class="fas fa-search"></i></button>
      </form>
      <div class="header-widget-group">
          @if (session()->missing('member.is_member'))
              <a href="{{ route('member-login') }}" class="header-widget" title="Login"> <span class="icn"><i class="fas fa-sign-in-alt"></i></span> <span>Login</span> </a>
              <a href="{{ route('member-signup-verify.index') }}" class="header-widget" title="My Account"> <span class="icn"><i class="fas fa-user"></i></span> <span>Join</span> </a>
          @else
              <a href="{{ route('member-logout') }}" class="header-widget" title="Logout"> <span class="icn"><i class="fas fa-sign-out-alt"></i></span> <span>Logout</span> </a>
          @endif
      </div>

      <div class="header-widget-group">
			<!--
			<a href="compare.html" class="header-widget" title="Compare List">
				<i class="fas fa-random"></i>
				<sup>0</sup>
			</a>
			-->
			<a href="{{ route('wish-list.index') }}" class="header-widget" title="Wishlist">
				<i class="far fa-heart"></i>
				<sup>{{ $wishCount }}</sup>
			</a>

			<button class="header-widget header-cart" title="Cartlist">
				<i class="fas fa-shopping-basket"></i>
				<sup class="cart-item-num">{{ $cartCount }}</sup>
				<!--<span>total price<small>$345.00</small></span>-->
			</button>
      </div>

    </div>
  </div>
</header>
<!--=====================================
    HEADER PART END
 =======================================-->
