{# **
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 * #}
<meta charset="utf-8">

<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<link rel="icon" type="image/x-icon" href="{{ this.imgDir }}favicon.ico" />
<link rel="apple-touch-icon" href="{{ this.imgDir }}app_icon.png" />

<meta name="robots" content="NOFOLLOW, NOINDEX">
<title>{% if this.metaTitle %}{{ this.metaTitle }} • {% endif %}{{ this.shopName }}</title>

<script type="text/javascript">
  var help_class_name = '{{ this.controllerName }}';
  var iso_user = '{{ this.isoUser }}';
  var lang_is_rtl = '{{ this.langIsRtl|intCast }}';
  var full_language_code = '{{ this.fullLanguageCode }}';
  var full_cldr_language_code = '{{ this.fullCldrLanguageCode }}';
  var country_iso_code = '{{ this.countryIsoCode }}';
  var _PS_VERSION_ = '{{ this.psVersion }}';
  var roundMode = {{ this.roundMode|intCast }};
  var youEditFieldFor = '{{ this.editForLabel }}';
  var new_order_msg = '{{ 'A new order has been placed on your store.'|trans({}, 'Admin.Navigation.Header') }}';
  var order_number_msg = '{{ 'Order number:'|trans({}, 'Admin.Navigation.Header') }} ';
  var total_msg = '{{ 'Total:'|trans({}, 'Admin.Global') }} ';
  var from_msg = '{{ 'From:'|trans({}, 'Admin.Global') }} ';
  var see_order_msg = '{{ 'View this order'|trans({}, 'Admin.Orderscustomers.Feature') }}';
  var new_customer_msg = '{{ 'A new customer registered on your store.'|trans({}, 'Admin.Navigation.Header') }}';
  var customer_name_msg = '{{ 'Registered on:'|trans({}, 'Admin.Navigation.Header') }} ';
  var new_msg = '{{ 'A new message was posted on your store.'|trans({}, 'Admin.Navigation.Header') }}';
  var see_msg = '{{ 'Read this message'|trans({}, 'Admin.Navigation.Header') }}';
  var token = '{{ this.legacyToken }}';
  var token_admin_orders = tokenAdminOrders = '{{ legacy_admin_token('AdminOrders') }}';
  var token_admin_customers = tokenAdminCustomers = '{{ legacy_admin_token('AdminCustomers') }}';
  var token_admin_customer_threads = tokenAdminCustomerThreads = '{{ legacy_admin_token('AdminCustomerThreads') }}';
  var currentIndex = '{{ this.currentIndex }}';
  var employee_token = '{{ this.employeeToken }}';
  var choose_language_translate = '{{ 'Choose language:'|trans({}, 'Admin.Actions') }}';
  var default_language = '{{ this.defaultLanguage|intCast }}';
  var admin_modules_link = '{{ path('admin_module_manage') }}';
  var admin_notification_get_link = '{{ path('admin_common_notifications') }}';
  var admin_notification_push_link = adminNotificationPushLink = '{{ path('admin_common_notifications_ack') }}';
  var update_success_msg = '{{ 'Successful update'|trans({}, 'Admin.Notifications.Success') }}';
  var search_product_msg = '{{ 'Search for a product'|trans({}, 'Admin.Orderscustomers.Feature') }}';
</script>

{# It is ok to load this file from new theme because the content needed is the same for default theme, so no need to generate two identical files #}
{{ include('@AdminNewTheme/public/preload.html.twig') }}

{# Many modules register on this hook to add their assets, they use addCss and/or addJs methods to do that
(even if this is supposed to be a display hook). These methods must be executed before we loop through the
list of assets which is why it must be executed before the loop, its content is temporarily stored to be
then correctly appended in the output (after the loops). This little hack is necessary to avoid a breaking change
and keep backward compatibility for this use case even if it's not very clean. #}
{% set displayBackOfficeHeaderRendered = renderhook('displayBackOfficeHeader') %}

{% for css_uri, css_media in this.cssFiles %}
  <link href="{{ css_uri }}" rel="stylesheet" type="text/css" media="{{ css_media }}"/>
{% endfor %}

{% if this.jsDef %}
  <script type="text/javascript">
    {% for k, def in this.jsDef %}
    var {{ k }} = {{ def|json_encode|raw }};
    {% endfor %}
  </script>
{% endif %}

{% for js_uri in this.jsFiles %}
  <script type="text/javascript" src="{{ js_uri }}"></script>
{% endfor %}

{# After some CSS/JS files inclusion (that can be added in 'displayBackOfficeHeader' hook), we need to display the html compiled that are returned for this hook. #}
{{ displayBackOfficeHeaderRendered|raw }}
