{#
 # For the full copyright and license information, please view the
 # docs/licenses/LICENSE.txt file that was distributed with this source code.
 #}
<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 }}
