<!--
*---------------------------------------------------------------------------*
| - Source   : SMM v2.0 by jhonroot                                         |                                                           
| - Facebook : https://fb.me/jhonnborneo                                    |
| - Whatsapp : https://wa.me/6285349680016                                  |
| - Line     : https://line.me/ti/p/jhonroot                                |
*---------------------------------------------------------------------------*
-->
<!doctype html>
<html lang="id">
<head>
    <meta charset="utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,minimal-ui" />
	<meta name="csrf-token" content="{{ csrf_token() }}" />
	<meta name="author" content="{{ website_config('main')->meta_author }}" />
	<meta name="keywords" content="{{ website_config('main')->meta_keywords }}" />
	<meta name="description" content="{{ website_config('main')->meta_description }}" />
	<title>{{ website_config('main')->website_name }} - SMM Panel Indonesia.</title>
	<link rel="shortcut icon" href="{{ url('file/images/'.website_config('main')->website_favicon.'') }}" />
	<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@6.5.95/css/materialdesignicons.min.css">
	<link href="https://cdnjs.cloudflare.com/ajax/libs/Dropify/0.2.2/css/dropify.css" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/summernote/summernote-bs4.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/select2/select2.min.css') }}" rel="stylesheet" type="text/css" /> 
	<link href="{{ asset('assets/libs/sweetalert2/sweetalert2.min.css') }}" rel="stylesheet" type="text/css" />
    <link href="{{ asset('assets/libs/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css') }}" rel="stylesheet">
	<link href="{{ asset('assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css') }}" rel="stylesheet">
	<link href="{{ asset('assets/libs/alertifyjs/build/css/alertify.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/alertifyjs/build/css/themes/default.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/magnific-popup/magnific-popup.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/datatables.net-buttons-bs4/css/buttons.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/libs/datatables.net-responsive-bs4/css/responsive.bootstrap4.min.css') }}" rel="stylesheet" type="text/css" /> 
	@if (Auth::guard('admin')->check() AND Auth::guard('admin')->user()->theme_color == 'dark')
	<link href="{{ asset('assets/css/bootstrap-dark.min.css') }}" id="bootstrap-style" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/css/app-dark.min.css') }}" id="app-style" rel="stylesheet" type="text/css" />
	@else
	<link href="{{ asset('assets/css/bootstrap.min.css') }}" id="bootstrap-style" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/css/icons.min.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/css/app.min.css') }}" id="app-style" rel="stylesheet" type="text/css" />
	@endif
	<script src="{{ asset('assets/libs/jquery/jquery.min.js') }}"></script>
	<script src="{{ asset('assets/libs/bootstrap/js/bootstrap.bundle.min.js') }}"></script>
	<link href="{{ asset('assets/css/header.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/css/prism.css') }}" rel="stylesheet" type="text/css" />
	<link href="{{ asset('assets/css/fab.css') }}" rel="stylesheet" type="text/css" />
	<script src="{{ asset('assets/js/fab.js') }}"></script>
	<script src="{{ asset('assets/js/header.js') }}"></script>
	<style>
		:root {
			--main-color: {{ website_config('template')->color }}; 
		}
		.datepicker {
			z-index: 1600 !important; /* has to be larger than 1050 */
		}
	</style>
	<script>
		$(document).ready(function() {
			$('.custom-text-editor').summernote({
				height: 230
			});
			$('#preloader').delay().fadeOut("slow");
		});
	</script>
	@if (website_config('smartsupp')->key <> '' AND request()->segment(1) <> 'admin')
	<script type="text/javascript">
		var _smartsupp = _smartsupp || {};
		_smartsupp.key = "<?= website_config('smartsupp')->key ?>";
		window.smartsupp||(function(d) {
		var s,c,o=smartsupp=function(){ o._.push(arguments)};o._=[];
		s=d.getElementsByTagName('script')[0];c=d.createElement('script');
		c.type='text/javascript';c.charset='utf-8';c.async=true;
		c.src='https://www.smartsuppchat.com/loader.js?';s.parentNode.insertBefore(c,s);
		})(document);
	</script>
	@endif
</head>
<body data-topbar="dark" data-layout="horizontal">
	<div class="preloader" id="preloader">
		<div class="loader">
			<div class="loader-outter"></div>
			<div class="loader-inner"></div>
			<div class="indicator"> 
				<svg width="16px" height="12px">
					<polyline id="back" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
					<polyline id="front" points="1 6 4 6 6 11 10 1 12 6 15 6"></polyline>
				</svg>
			</div>
		</div>
	</div>
    <div id="layout-wrapper">
        <header id="page-topbar" style="background-color: var(--main-color);">
            <div class="navbar-header">
                <div class="d-flex">
					<div class="navbar-brand-box">
						<a href="{{ url('/') }}" class="logo logo-dark">
							@if (website_config('main')->website_logo_small_dark <> null)
							<span class="logo-sm">
								<img src="{{ url('file/images/'.website_config('main')->website_logo_small_dark.'') }}" class="img-fluid" alt="" style="height: 50px;" />
							</span>
							@else
							<span class="logo-sm text-uppercase text-white" style="font-size: 20px; font-weight: Bold;">
							    <i class="fa fa-globe"></i>
								<!--{{ website_config('main')->website_name }}-->
							</span>
							@endif
							@if (website_config('main')->website_logo_dark <> null)
							<span class="logo-lg">
								<img src="{{ url('file/images/'.website_config('main')->website_logo_dark.'') }}" class="img-fluid" alt="" style="height: 50px;" />
							</span>
							@else
							<span class="logo-lg text-uppercase text-white" style="font-size: 20px; font-weight: Bold;">
								{{ website_config('main')->website_name }}
							</span>
							@endif
						</a>
						<a href="{{ url('/') }}" class="logo logo-light">
							@if (website_config('main')->website_logo_small_light <> null)
							<span class="logo-sm">
								<img src="{{ url('file/images/'.website_config('main')->website_logo_small_light.'') }}" class="img-fluid" alt="" style="height: 50px;" />
							</span>
							@else
							<span class="logo-sm text-uppercase text-white" style="font-size: 20px; font-weight: Bold;">
							    <i class="fa fa-globe"></i>
								<!--{{ website_config('main')->website_name }}-->
							</span>
							@endif
							@if (website_config('main')->website_logo_light <> null)
							<span class="logo-lg">
								<img src="{{ url('file/images/'.website_config('main')->website_logo_light.'') }}" class="img-fluid" alt="" style="height: 50px;" />
							</span>
							@else
							<span class="logo-lg text-uppercase text-white" style="font-size: 20px; font-weight: Bold;">
								{{ website_config('main')->website_name }}
							</span>
							@endif
						</a>
					</div>
					<button type="button" class="btn btn-sm mr-2 font-size-24 d-lg-none header-item waves-effect" data-toggle="collapse" data-target="#topnav-menu-content">
						<i class="mdi mdi-backburger"></i>
					</button>
				</div>
                @if (Auth::guard('admin')->check() == true)
				<div class="d-flex">
					<div class="dropdown d-inline-block">
						<button type="button" class="btn header-item noti-icon right-bar-toggle waves-effect">
							<i class="mdi mdi-cog font-size-18"></i>
						</button>
					</div>
					<div class="dropdown d-inline-block">
						<button type="button" class="btn header-item waves-effect" id="page-header-user-dropdown"
							data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
							<i class="mdi mdi-account font-size-18"></i>
							<span class="ml-1">Hi, {{ Auth::guard('admin')->user()->full_name }}</span>
							<i class="mdi mdi-chevron-down d-none d-sm-inline-block"></i>
						</button>
						<div class="dropdown-menu dropdown-menu-right">
							<a href="{{ url('admin/auth/logout') }}" class="dropdown-item has-icon text-danger"> 
								<i class="mdi mdi-logout"></i> Keluar 
							</a>
						</div>
					</div>
				</div>
				@endif
            </div>
        </header>
        <div class="topnav">
            <div class="container-fluid">
                <nav class="navbar navbar-light navbar-expand-lg topnav-menu">
                    <div class="collapse navbar-collapse" id="topnav-menu-content">
                        <ul class="navbar-nav">
                            @include('admin.layouts.navigation.horizontal') 
                        </ul>
                    </div>
                </nav>
            </div>
        </div>
        <div class="main-content">
            <div class="page-content">
                <div class="container-fluid">
                    <div class="modal fade" id="modal" id="modal-detail" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true" style="display: none;">
                        <div class="modal-dialog modal-dialog-centered modal-lg">
                            <div class="modal-content">
                                <div class="modal-header">
                                    <h5 class="modal-title mt-0" id="modal-title"></h5>
                                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                                </div>
                                <div class="modal-body" id="modal-detail-body">
                                </div>
                                <div class="modal-footer hidden" id="modal-footer">
                                    <button type="button" class="btn btn-light" data-dismiss="modal">Tutup</button>
                                </div>
                            </div>
                        </div>
                    </div>
					@hasSection('breadcrumb-first')
					<div class="row">
						<div class="col-12">
							<div class="page-title-box d-flex align-items-center justify-content-between">
								<h4 class="mb-0 font-size-18">@yield('breadcrumb-first')</h4>
								<div class="page-title-right">
									<ol class="breadcrumb m-0">
										<li class="breadcrumb-item"><a href="javascript: void(0);">@yield('breadcrumb-second')</a></li>
									</ol>
								</div>
							</div>
						</div>
					</div> 
					@endif
					@hasSection('button')
					<div class="row">
						<div class="col-lg-12" style="margin-bottom: 20px; margin-top: -10px;">
							@yield('button')
						</div>
					</div>
					@endif
					@if(View::hasSection('show-alert') == false)
					@include('admin.layouts.alert') 
					@endif
					@yield('content')
                </div>
            </div>
            <footer class="footer">
                <div class="container-fluid">
                    <div class="row">
                        <div class="col-lg-12 text-center">
                            {{ date('Y') }} © {{ website_config('main')->website_name }}
                            <span class="d-none d-sm-inline-block"> - Crafted with <i class="mdi mdi-heart text-danger"></i> by {{ website_config('main')->meta_author }}.</span>
                            {{-- <span class="d-none d-sm-inline-block"> - This page took {{ round(microtime(true) - LARAVEL_START, 3) }} seconds to render Crafted with <i class="mdi mdi-heart text-danger"></i> by {{ website_config('main')->meta_author }}.</span> --}}
                        </div>
                    </div>
                </div>
            </footer>
        </div>
    </div>
	@if (Auth::guard('admin')->check())
	<div class="right-bar">
		<div data-simplebar class="h-100">
			<ul class="nav nav-tabs nav-tabs-custom rightbar-nav-tab nav-justified" role="tablist">
				<li class="nav-item">
					<a class="nav-link py-3" data-toggle="tab" href="#chat-tab" role="tab">
						<i class="mdi mdi-message-text font-size-22"></i>
					</a>
				</li>
				<li class="nav-item">
					<a class="nav-link py-3" data-toggle="tab" href="#tasks-tab" role="tab">
						<i class="mdi mdi-format-list-checkbox font-size-22"></i>
					</a>
				</li>
				<li class="nav-item">
					<a class="nav-link py-3 active" data-toggle="tab" href="#settings-tab" role="tab">
						<span class="d-block d-sm-none"><i class="far fa-envelope"></i></span>
						<i class="mdi mdi-settings font-size-22"></i>
					</a>
				</li>
			</ul>
			<div class="tab-content text-muted">
				<div class="tab-pane active" id="settings-tab" role="tabpanel">
					<h6 class="font-weight-medium px-4 py-3 text-uppercase bg-light">Warna Tema</h6>
					<div class="p-4">
						<div class="custom-control custom-switch mb-1">
							<input type="checkbox" class="custom-control-input" id="light-mode" name="light-mode" @if (Auth::guard('admin')->user()->theme_color == 'light') checked @endif>
							<label class="custom-control-label font-weight-normal" for="light-mode">Mode Terang</label>
						</div>
						<div class="custom-control custom-switch mb-1">
							<input type="checkbox" class="custom-control-input" id="dark-mode" name="dark-mode" @if (Auth::guard('admin')->user()->theme_color == 'dark') checked @endif>
							<label class="custom-control-label font-weight-normal" for="dark-mode">Mode Gelap</label>
						</div>
					</div>
				</div>
			</div>
		</div> 
	</div>
	@endif
	<div class="rightbar-overlay"></div>
	<script src="{{ asset('assets/libs/metismenu/metisMenu.min.js') }}"></script>
	<script src="{{ asset('assets/libs/simplebar/simplebar.min.js') }}"></script>
	<script src="{{ asset('assets/libs/node-waves/waves.min.js') }}"></script>
	<script src="{{ asset('assets/libs/morris.js/morris.min.js') }}"></script>
	<script src="{{ asset('assets/libs/raphael/raphael.min.js') }}"></script>
	<script src="{{ asset('assets/libs/alertifyjs/build/alertify.min.js') }}"></script>
	<script src="{{ asset('assets/libs/magnific-popup/jquery.magnific-popup.min.js') }}"></script>
	<script src="{{ asset('assets/libs/autonumeric/autoNumeric-2-min.js') }}"></script>   
	<script src="https://cdnjs.cloudflare.com/ajax/libs/Dropify/0.2.2/js/dropify.min.js"></script>
	<script src="{{ asset('assets/libs/summernote/summernote-bs4.min.js') }}"></script>
	<script src="{{ asset('assets/libs/select2/select2.min.js') }}"></script>
	<script src="{{ asset('assets/libs/sweetalert2/sweetalert2.min.js') }}"></script>
	<script src="{{ asset('assets/libs/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js') }}"></script>
	<script src="{{ asset('assets/libs/bootstrap-datepicker/js/bootstrap-datepicker.min.js') }}"></script>
	<script src="{{ asset('assets/libs/datatables.net/js/jquery.dataTables.min.js') }}"></script>
	<script src="{{ asset('assets/libs/datatables.net-bs4/js/dataTables.bootstrap4.min.js') }}"></script>
	<script src="{{ asset('assets/libs/datatables.net-responsive/js/dataTables.responsive.min.js') }}"></script>
	<script src="{{ asset('assets/libs/datatables.net-responsive-bs4/js/responsive.bootstrap4.min.js') }}"></script>
	<script src="{{ asset('assets/js/prism.js') }}"></script>
	<script src="{{ asset('assets/js/app.js') }}"></script>
	<script>
		$('#dark-mode').on('click', (event) => {
			if($(event.currentTarget).is(':checked')) {
				$('#light-mode').prop('checked', false);
				change_theme('dark');
			} else {
				$('#light-mode').prop('checked', true);
				change_theme('light');
			}
		});
		$('#light-mode').on('click', (event) => {
			if($(event.currentTarget).is(':checked')) {
				$('#dark-mode').prop('checked', false);
				change_theme('light');
			} else {
				$('#dark-mode').prop('checked', true);
				change_theme('dark');
			}
		});
		function change_theme(theme) {
			$.ajax({
				type: 'GET',
				url: '{{ url('ajax/admin/account/change-theme') }}',
				data: 'theme='+theme,
				dataType: 'json',
				beforeSend: function() {
					$('#preloader').fadeIn("slow");
				},
				success: function(response) {
					if (theme == 'dark') {
						$("#bootstrap-style").attr("href", "{{ asset('assets/css/bootstrap-dark.min.css') }}")
						$("#app-style").attr("href", "{{ asset('assets/css/app-dark.min.css') }}")
					} else if (theme == 'light') {
						$("#bootstrap-style").attr("href", "{{ asset('assets/css/bootstrap.min.css') }}")
						$("#app-style").attr("href", "{{ asset('assets/css/app.min.css') }}")
					}
					$('#preloader').fadeOut("slow");
				},
				error: function() {
					$('#preloader').fadeOut("slow");
					alertify.error('Terjadi kesalahan');
				}
			});
		}
	</script>
</body>
</html>
