<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache" />
<meta name="robots" content="noindex" />
<meta http-equiv="pragma" content="no-cache" />
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('backoffice.title') }}</title>

<!-- FAVICON -->
<link href="{{ path_asset('backoffice.favicon') }}" rel="shortcut icon">
<!-- For third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="{{ path_asset('path.backoffice.images_path') }}/apple-touch-icon-144x144-precomposed.png">
<!-- For iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="{{ path_asset('path.backoffice.images_path') }}/apple-touch-icon-114x114-precomposed.png">
<!-- For first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="{{ path_asset('path.backoffice.images_path') }}/apple-touch-icon-72x72-precomposed.png">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed" href="{{ path_asset('path.backoffice.images_path') }}/apple-touch-icon-precomposed.png">

<link href='https://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,300,600,700' rel='stylesheet' type='text/css'>

<script>
    var adminCssUrl = '';
    adminCssUrl = '{{ Vite::asset('resources/sass/editor.scss') }}';
</script>

<link href="{{ path_asset('path.backoffice.css_path') }}/bootstrap.min.css" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/bootstrap-datetimepicker.css" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/jquery.bootgrid.min.css" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/bootstrap-select.min.css" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/bootstrap-colorpicker.css" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/bootstrap-tagsinput.css" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/style.css{{ '?ver=' . config('app.adminCssVer') }}" rel="stylesheet" type="text/css" media="screen" >
<link href="{{ path_asset('path.backoffice.css_path') }}/typeaheadjs.css" rel="stylesheet" type="text/css" media="screen" >
@vite(['resources/sass/admin/admin.scss'])
@foreach ($styles as $style)
<link href="{{ $style }}" rel="stylesheet" type="text/css" media="screen">
@endforeach

@php
    $langs = getSupportedLanguages();
    $langsData = [];
    foreach ($langs as $lang) {
        $langsData[$lang->id] = [
            'name' => $lang->name,
            'img' => path_asset('path.backoffice.images_path') . '/flags/' . $lang->id . '.png'
        ];
    }
@endphp
<script>
    /**
    * JAVASCRIPT GLOBAL ENVIRONMENT SETUP
    */
    window.Eae = {Config: {}, View: {}, Model: {}};
    window.Eae.Config = {
        url : "{{ lang_url('/') }}",
        base_url: "{{ url('/') }}",
        defaultLang : "{{ getDefaultLocale() }}",
        langs : @json($langsData)
    };
</script>

<script src="{{ path_asset('path.common.js_path') }}/jquery-2.1.0.min.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/moment-with-locales.min.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/bootstrap.min.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/bootstrap-datetimepicker.min.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/jquery.nestable.js"></script>
<script src="{{ path_asset('path.common.js_path') }}/jquery.sortable.min.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/bootbox.min.js"></script>


<script src="{{ path_asset('path.common.js_path') }}/underscore-min.js"></script>
<script src="{{ path_asset('path.common.js_path') }}/backbone-min.js"></script>
<script src="{{ path_asset('path.common.js_path') }}/jquery.lazyload.min.js"></script>
<script src="{{ path_asset('path.common.js_path') }}/utils.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/tinymce/tinymce.min.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/view/backend-all-pages.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/view/media-manager.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/typeahead.js"></script>
<script src="{{ path_asset('path.backoffice.js_path') }}/bootstrap-tagsinput.min.js"></script>


@foreach ($scripts as $script)
<script src="{{ $script . (strpos($script, '?') ? '' : ('?ver=' . config('app.adminJsVer'))) }}"></script>
@endforeach



<script>
    var baseUrl = '{{ url('/') }}';
    var websiteLanguages = @json(getWebsite()->languages);
    var imageUrl ='{{ path_asset("path.frontend.images_path") }}';


    $(function() {
        $.ajaxSetup({
            headers: {
                'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content'),
                'X-Requested-With': 'XMLHttpRequest'
            }
        });
    });
</script>
