<!DOCTYPE html>
<!--[if lt IE 7 ]><html lang="{{ config('app.locale') }}" class="no-js ie6"><![endif]-->
<!--[if IE 7 ]><html lang="{{ config('app.locale') }}" class="no-js ie7"><![endif]-->
<!--[if IE 8 ]><html lang="{{ config('app.locale') }}" class="no-js ie8"><![endif]-->
<!--[if IE 9 ]><html lang="{{ config('app.locale') }}" class="no-js ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="{{ config('app.locale') }}" class="no-js"><!--<![endif]-->
<head>
    <title>{{ config('site_title', env('app.name')) }}</title>

    <!-- Metas -->
    <meta charset="UTF-8"/>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
    <meta name="csrf-token" content="{{ csrf_token() }}"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>

    <!-- 구글 검색 차단 -->
    <meta name="google" content="nositelinkssearchbox"/>
    <meta name="googlebot" content="noindex,nofollow,nosnippet,noodp,noarchive,noimageindex"/>

    <!-- Styles -->
    @if($siteFavicon = config('site_favicon'))
    <link rel="icon" type="image/x-icon" href="{{ asset($siteFavicon) }}"/>
    <link rel="shortcut icon" type="image/x-icon" href="{{ asset($siteFavicon) }}"/>
    @endif

    <!-- Scripts -->
    @vite(['resources/sass/admin.scss', 'resources/js/app.js'])
    @stack('styles')

    <script>
        // 자바스크립트에서 사용하는 전역변수 선언
        var UID = {{ UID }};
        var BASE_URL = "{{ BASE_URL }}";
        var FULL_URL = "{{ FULL_URL }}";
        var ADMIN_URL = "{{ ADMIN_URL }}";
        var CHARSET = "{{ CHARSET }}";
        var DATE = "{{ DATE }}";
        var DATETIME = "{{ DATETIME }}";
        var IP_ADDRESS = "{{ IP_ADDRESS }}";
        var REFERER = "{{ REFERER }}";
        var USER_AGENT = "{{ USER_AGENT }}";
        var DEVICE = "{{ DEVICE }}";
        var PLATFORM = "{{ PLATFORM }}";
        var BROWSER = "{{ BROWSER }}";
        var IS_USER = {{ IS_USER }};
        var IS_ADMIN = {{ IS_ADMIN }};
        var IS_FRONT = 1;
        var CSRF = "{{ csrf_token() }}";
    </script>

    <!--[if lt IE 9]>
    <script src="{{ asset('js/common/html5shiv.min.js') }}"></script>
    <script src="{{ asset('js/common/respond.min.js') }}"></script>
    <script src="{{ asset('js/common/ie8-responsive-file-warning.js') }}"></script>
    <![endif]-->

    <script src="/js/common/common.js" defer></script>
    <script src="/js/admin.js" defer></script>
    <script src="/js/common/jquery.validate.extension.js" defer></script>
    <script src="/plugin/editor/tinymce/tinymce.min.js" defer></script>
    <script src="/plugin/editor/tinymce/config.js" defer></script>
</head>
<body class="overflow-hidden">

    <!-- 좌측 -->
    <aside id="aside">

        <!-- 로고, 프로필 -->
        <div class="text-center">
            <a href="/{{ ADMIN_PATH }}" class="logo">
                {{ strtoupper(config('app.name')) }}
            </a>
            <a href="#" id="profile" class="nav-link dropdown-toggle" data-bs-toggle="dropdown" data-bs-offset="35,5">
                <i class="fa fa-user"></i> {{ ($user->name ?? $user->nickname) }}
            </a>
            <div class="dropdown-menu text-small shadow">
                <a href="{{ url('logout') }}" id="logout" class="dropdown-item">
                    <i class="fas fa-sign-out-alt"></i> {{ __('Logout') }}
                </a>
            </div>
        </div>

        <hr/>

        <!-- 메뉴 -->
        {!! $menus->render() !!}

        <!-- Copyright -->
        <footer id="footer">
            <p>
                <a href="#" id="btnScrollTop">맨 위로 <i class="fas fa-arrow-circle-up"></i></a>
            </p>
            <cite>@ 2018 {{ config('site_title') }}, All Rights Reserved.</cite>
        </footer>
    </aside>

    <!-- 컨텐츠 -->
    <main id="main">
        @yield('content')
    </main>

    {{-- 처리중 1 --}}
    <div id="processing" class="modal" tabindex="-1" role="dialog" data-backdrop="static" data-keyboard="false" aria-hidden="true" aria-labelledby="contentsExplainTitle">
        <div class="modal-dialog modal-dialog-centered" role="progressbar">
            <div class="modal-content text-center">
                <div class="modal-header">
                    <h5 class="modal-title" id="contentsExplainTitle">잠시만 기다려 주세요.</h5>
                </div>
                <div class="modal-body">
                    <br/><p>회원님께서 요청하신 내용을 처리 중입니다.</p>
                    <img src="/images/default/loading.gif" width="20%" alt="loading..."/>
                </div>
            </div>
        </div>
    </div>

    {{-- 처리중 2 --}}
    <div id="loading">
        <figure class="figure">
            <img src="/images/default/loading.gif" class="figure-img img-fluid" alt="loading..."/>
            <figcaption class="figure-caption">처리 중...</figcaption>
        </figure>
    </div>

    @stack('scripts')
</body>
</html>
