<title>
    <?= $page_meta["title"] ?> - <?= config('app.name') ?> Admin
</title>

<meta charset="utf-8" />
<meta name="robots" content="noindex,nofollow" />
<meta name="author" content="mtc." />
<meta name="viewport" content="width=device-width">

<!-- Favicon -->
<link rel="icon"
    type="image/x-icon"
    href="<?= THEME_URL; ?>/images/favicon/favicon.ico"
/>

<script type="text/javascript" src="/core/admin/js/libs/xds.js"></script>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="/core/js/jquery.js"><\/script>')</script>

<link rel="stylesheet/less" href="/core/admin/css/mtc_admin_style.less?_<?= hash_file('crc32', SITE_PATH . '/core/admin/css/mtc_admin_style.less'); ?>" media="screen, print" />
<script src="/core/js/less.js"></script>
<script type="text/javascript">
    // less.watch(); //ajax request that keeps running to check for less errors
</script>

<script src="/core/js/vue<?= (DEV_MODE == false) ? '.min' : '' ?>.js"></script>

<?php
    if (!empty($admin_js_files)) {
        foreach ($admin_js_files as $js_file) {
            ?><script src="<?= $js_file . '?_' . hash_file('crc32', SITE_PATH . $js_file) ?>" type="text/javascript" ></script><?php
        }
    }
?>

<script type="text/javascript">
    $(function(){
        init_tinymce();
    });
</script>

<?php
if (config('app.env') === 'production' && !empty($_SESSION['adminId'])
    && defined("MTC_ADMIN_GOOGLE_ANALYTICS_USERAGENT")
    && !empty(MTC_ADMIN_GOOGLE_ANALYTICS_USERAGENT)) {
    ?>
    <!-- GOOGLE ANALYTICS -->
    <script type="text/javascript" data-cfasync="false">
        (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
            m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
        })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
        ga('create', '<?= MTC_ADMIN_GOOGLE_ANALYTICS_USERAGENT ?>', 'auto');
        ga('send', 'pageview');
    </script>
    <?php
}
