{% block layout_header %}
{% set isoCode = page.header.activeLanguage.translationCode.code|lower|split('-') %}
{% set flagCountry = isoCode[1] %}
{% set flagLanguage = isoCode[0] %}
{% set categories = page.extensions.swmUI.categories %}
{% set countNotViewNotification = page.extensions.swmUI.countNotViewNotification %}
{% set totalQuantityCart = page.extensions.swmUI.totalQuantityCart %}
{# {% if context.customer %}
{% set amityUserLoginData = amityLogin(context.customer) %}
{% set amityLock = false %}
{% else %}
{% set amityUserLoginData = amityLoginGuest() %}
{% set amityLock = true %}
{% endif %} #}
{% set redirectUrl = app.request.get('_route') %}
{% set redirectParams = app.request.attributes.get('_route_params') %}
{% set redirectParameters = redirectParams|json_encode %}
{% set noti = page.header.extensions.swmUIHeader.notificationCount %}
<div class="amity-client" data-econsor-amity="true" data-api-key="{{ amityUserLoginData.apiKey }}" data-user-id="{{ amityUserLoginData.users|first.userId }}" data-user-auth="{{ amityUserLoginData.auth }}" data-lock="{{ amityLock }}"></div>
<div id="swm-header" class="row align-items-center"
data-path="{{ path('frontend.notification.list') }}"
data-csrf="{{ sw_csrf('frontend.notification.list', {'mode': 'token'}) }}"
>
<section class="home_header_container_section position-relative width-full" style="margin: 0;">
<div id="home_header_container" class="d-flex justify-between items-center">
<div class="banner_img home_header_center_logo">
<a href="{{ seoUrl('frontend.home.page') }}">
<img src="{{ asset('bundles/shopwithmeui/assets/imgs/shopwithme.png') }}" style="width: 131.38px"/>
</a>
</div>
<div id="home_header_center_view" class="d-flex justify-center items-center mobile:d-none" style="gap:32px">
<div id="home_header_show_products" class="home_header_center_view-item d-flex">
<span class="typo-sub-text-3-pr">{{ "app.header.navigation.product"|trans|sw_sanitize }}</span>
<img src="{{ asset('bundles/shopwithmeui/assets/imgs/chevron-down.png') }}"/>
<div id="home_header_show_products__menu__layer">
<div id="home_header_show_products__menu">
{% for category in categories %}
<a class="home_header_show_products__menu__item"{% if category.id == '4b9877842d644023a899643e1cd8548f' and flagCountry not in ['vn'] %} href="{{ seoUrl('frontend.shop4free') }}" {% else %} href="{{ seoUrl('frontend.current-deals', { category: category.id }) }}"{% endif %}>
<img class="home_header_show_products__menu__item__icon" src="{{ asset('bundles/shopwithmeui/assets/icons/category-' ~ category.id ~ '-icon.svg') }}"/>
{{ category.name }}
</a>
{% endfor %}
</div>
</div>
</div>
{% if flagCountry not in ['vn'] %}
<a class="home_header_center_view-item" href="{{ seoUrl('frontend.shop4free') }}">
<span class="typo-sub-text-3-pr">{{ "app.header.navigation.shop4free"|trans|sw_sanitize }}</span>
</a>
{% endif %}
<a class="home_header_center_view-item" href="{{ seoUrl('frontend.ai.stream') }}">
<span class="typo-sub-text-3-pr">{{ "app.header.navigation.aiStream"|trans|sw_sanitize }}</span>
</a>
<a class="home_header_center_view-item" href="{{ seoUrl('frontend.my.deals') }}">
<span class="typo-sub-text-3-pr">{{"app.myDeals"|trans|sw_sanitize}}</span>
</a>
</div>
<div class="home_header_right_view d-flex justify-center items-center" style="gap:16px">
{% set isVnCustomer = context.customer is not null and context.customer.defaultShippingAddress.country.iso|upper == 'VN' %}
{% if not (isVnCustomer and flagCountry|upper == 'VN') %}
<div id="home_header_language" class="dzb-select">
<div class="dzb-select__label-value d-flex items-center justify-center" style="gap:8px">
<img src="{{ asset('bundles/shopwithmeui/assets/imgs/flag_' ~ flagCountry ~ '.png') }}" alt="English Flag" style="width: 20px;"/>
<img src="{{ asset('bundles/shopwithmeui/assets/imgs/chevron-down.png') }}"/>
</div>
<div class="dzb-select__options">
<form method="post" action="{{ path('frontend.checkout.switch-language') }}" class="w-100" data-form-auto-submit="true">
<div class="home_header_languge_container-content d-flex flex-col">
{% block layout_header_actions_language_widget_form_csrf %}
{{ sw_csrf('frontend.checkout.switch-language') }}
{% endblock %}
{% for language in page.header.languages %}
{% set isoCode = language.translationCode.code|lower|split('-') %}
{% set flagCountry = isoCode[1] %}
{% set flagLanguage = isoCode[0] %}
{% if flagCountry not in ['in', 'sk', 'cz'] %}
<button class="dzb-select__options__option swm-btn-no-style home_header_languge_container-item d-flex items-center justify-between border-radius-7" type="submit" name="languageId" value="{{ language.id }}" {% if language.id is same as(page.header.activeLanguage.id) %} disabled {% endif %}>
<div class="home_header_languge_container-item-left d-flex items-center justify-start" style="gap: 8px">
<img src="{{ asset('bundles/shopwithmeui/assets/imgs/flag_'~ flagCountry ~'.png') }}" alt="home_header_language_container-item-left-img" class="home_header_language_container-item-left-img">
<div class="home_header_languge_container-item-left-title">
<div class="home_header_languge_container-item-left-title-name typo-sub-text-4-smb">
{{("app.header.language." ~ flagLanguage)|trans|sw_sanitize }}
</div>
</div>
</div>
</button>
{% endif %}
{% endfor %}
<input name="redirectTo" type="hidden" value="{{ app.request.get('_route') }}"/>
{% for key, value in app.request.attributes.get('_route_params') %}
<input name="redirectParameters[{{ key }}]" type="hidden" value="{{ value }}">
{% endfor %}
</div>
</form>
</div>
</div>
{% endif %}
<img id="home_header_search" class="cursor-pointer" src="{{ asset('bundles/shopwithmeui/assets/icons/ic_search.svg') }}"/>
<a id="home_header_cart" href="{{ context.customer is not null ? seoUrl('frontend.checkout.cart.page') : seoUrl('frontend.account.login', { redirectTo: 'frontend.checkout.cart.page' }) }}">
<img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_cart.svg') }}"/>
<div class="quantity_cart {% if totalQuantityCart == 0 %}d-none{% endif %}">{{ totalQuantityCart }}</div>
</a>
{% if context.customer is not null %}
<div id="home_header_noti" class="position-relative">
<img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_bell.svg') }}"/>
<!-- Noti red dot -->
<div class="position-absolute home_header_noti_red-dot {% if countNotViewNotification <= 0 %}d-none{% endif %}"></div>
</div>
<div id="home_header_user" class="swm_ccs_none_mobile">
<img src="{{ context.customer.extensions.avatar.url ?: asset('bundles/shopwithmeui/assets/imgs/no_avatar.jpeg') }}"/>
</div>
{% else %}
<div class="home_header_center_view-item text-decoration-none">
<a href="{{ seoUrl('frontend.account.login', { redirectTo: redirectUrl, redirectParameters: redirectParameters }) }}" class="mobile:d-none typo-sub-text-3 swm-btn swm-btn-shop4free-secondary swm_button_extra_for_small text-decoration-none">
<div class="d-flex items-center justify-between" style="gap: 4px">
<span class="button-title" style="font-size: 16px;">{{'app.header.navigation.loginSignup'|trans}}</span>
<svg width="18" height="18" viewbox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 17C11.1217 17 13.1566 16.1571 14.6569 14.6569C16.1571 13.1566 17 11.1217 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<path d="M1 9H11M11 9L8 6M11 9L8 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</a>
<a href="{{ seoUrl('frontend.account.login', { redirectTo: redirectUrl, redirectParameters: redirectParameters }) }}" class="mobile:d-block" style="display: none">
<svg width="18" height="18" viewbox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 17C11.1217 17 13.1566 16.1571 14.6569 14.6569C16.1571 13.1566 17 11.1217 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1" stroke="#000" stroke-width="1.5" stroke-linecap="round"/>
<path d="M1 9H11M11 9L8 6M11 9L8 12" stroke="#000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</a>
</div>
{% endif %}
</div>
<div id="home_header_notification_rl_container" class="position-absolute">
<div class="d-flex justify-between align-center items-center">
<div class="d-flex" style="gap: 12px;">
<img src="{{ asset('bundles/shopwithmeui/assets/imgs/img_wheel.png') }}" width="50px" height="50px"/>
<div class="d-flex" style="gap:4px">
<span class="swm_home_header_text_base color_green">
{{ "app.header.notification.titleSpin"|trans|sw_sanitize }}</span>
</div>
</div>
<div class="d-flex flex-col">
<div class="typo-sub-text-3 swm-btn swm-btn-shop4free-secondary">
<span id="swm_btn_next_step" class="signup__button text-body-m white-space-nowrap">
{{ "app.header.notification.spinNow"|trans|sw_sanitize }}
</span>
</div>
</div>
<img id="home_header_notification_rl_icon_close" src="{{ asset('bundles/shopwithmeui/assets/icons/ic_close_circle.svg') }}"/>
</div>
</div>
<div id="home_header_notification_container" class="position-absolute">
<div class="d-flex justify-between flex-col width-full" style="gap: 18px">
<div class="justify-between d-flex">
<span class="home_header_title">
{{ "app.header.notification.title"|trans|sw_sanitize }}
</span>
<div class="items-center d-flex" style="gap:10px">
<img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_double_check_green.svg') }}"/>
<span class="home_header_noti_read">
{{ "app.header.notification.markAsRead"|trans|sw_sanitize }}
</span>
</div>
</div>
<div id="home_header_noti_option_container" class="d-flex items-center width-full">
<div class="d-flex justify-center noti_option_each active" data-id="">
<span class="swm_home_header_text_base">
{{ "app.header.notification.viewAll"|trans|sw_sanitize }}
</span>
<div class="justify-center align-center d-flex noti_option_each_count_container active">
<span class="swm_home_header_text_base">
{{ noti.all }}
</span>
</div>
</div>
<div class="d-flex justify-center noti_option_each" data-id="like">
<span class="swm_home_header_text_base">
{{ "app.header.notification.activity"|trans|sw_sanitize }}
</span>
<div class="justify-center align-center d-flex noti_option_each_count_container">
<span class="swm_home_header_text_base">
{{ noti.like }}
</span>
</div>
</div>
<div class="d-flex justify-center noti_option_each" data-id="followers">
<span class="swm_home_header_text_base">
{{ "app.header.notification.followers"|trans|sw_sanitize }}
</span>
<div class="justify-center align-center d-flex noti_option_each_count_container">
<span class="swm_home_header_text_base">
{{ noti.followers }}
</span>
</div>
</div>
<div class="d-flex justify-center noti_option_each" data-id="invites">
<span class="swm_home_header_text_base">
{{ "app.header.notification.invites"|trans|sw_sanitize }}
</span>
<div class="justify-center align-center d-flex noti_option_each_count_container">
<span class="swm_home_header_text_base">
{{ noti.invites }}
</span>
</div>
</div>
</div>
<div id="home_header_notification_container_list" class="width-full">
{# {% sw_include '@Storefront/storefront/component/header/notification.html.twig' %} #}
</div>
</div>
</div>
<div id="home_header_search_container" class="position-absolute" data-path="{{ path('frontend.product.search') }}" data-csrf="{{ sw_csrf('frontend.product.search', {"mode": "token"}) }}">
<div class="home_header_search_container-content position-relative" style="gap: 12px; max-width: 100%;">
<input class="swm_search_form-input width-full " type="text" id="searchProduct" name="search" placeholder="{{ "app.header.search.searchProduct"|trans|sw_sanitize }}"/>
<img src="{{ asset('bundles/shopwithmeui/assets/icons/ic_search.svg') }}" alt="Search" class="position-absolute home_header_search_container-content-icon swm_search_form-button">
<div class="home_header_search_container-product d-flex flex-col" style="max-height: 50vh; overflow-y: auto;"></div>
</div>
</div>
<div id="home_header_profile_container" class="position-absolute">
<div class="home_header_profile_container-box-content d-flex flex-col">
<a class="home_header_profile_container-content-profile text-decoration-none" href="{{ seoUrl('frontend.account.home.page') }}">
<div class="home_header_profile_container-content position-relative d-flex items-center" style="gap: 12px;">
<div class="home_header_profile_container-content-img d-flex">
<img src="{{ context.customer.extensions.avatar.url ?: asset('bundles/shopwithmeui/assets/imgs/no_avatar.jpeg') }}" width="100%"/>
</div>
<div class="home_header_profile_container-item-left-title">
<div class="home_header_profile_container-item-left-title-name typo-sub-text-3-pr">
{{context.customer.firstName}}
{{context.customer.lastName}}
</div>
</div>
</div>
</a>
<a id="logout_btn--header" href="{{ seoUrl('frontend.account.logout.page') }}" class="typo-sub-text-3 swm-btn swm-btn-shop4free-secondary swm_button_extra_for_small text-decoration-none">
<div class="d-flex items-center justify-between" style="gap: 4px">
<span class="button-title" style="font-size: 16px;">{{ "app.logout"|trans|sw_sanitize }}</span>
<svg width="18" height="18" viewbox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9 17C11.1217 17 13.1566 16.1571 14.6569 14.6569C16.1571 13.1566 17 11.1217 17 9C17 6.87827 16.1571 4.84344 14.6569 3.34315C13.1566 1.84285 11.1217 1 9 1" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
<path d="M1 9H11M11 9L8 6M11 9L8 12" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
</svg>
</div>
</a>
</div>
</div>
</div>
</section>
</div>
{% endblock %}