<?php
include_once __DIR__ . '/../user/common.php';
/*
 * @author: CloudZA(云之安) <2922619853@qq.com>
 * @hitokoto: 一场秋雨一场凉，秋心酌满泪为霜。
 * Copyright (c) 2022 by CloudZA, All Rights Reserved.
 */
ob_start();
?>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title><?php echo WEB_NAME ?> - <?php echo ( isset($title) ) ? $title : '首页' ?></title>
    <meta name="description" content="<?php echo WEB_DESC ?>">
    <meta name="keywords" content="<?php echo WEB_KEY ?>">
    <link rel="shortcut icon" href="/assets/media/favicon.png" type="image/x-icon">
    <!-- 框架核心样式 -->
    <link rel="stylesheet" id="css-main" href="<?php echo __CSS__ ?>oneui.min-5.6.css">
    <!-- 图片预览 -->
    <link rel="stylesheet" href="<?php echo __JS__ ?>plugins/magnific-popup/magnific-popup.css">
    <!-- nprogress -->
    <link href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-0-M/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">
    <style>
        .nav-main-link.active {
            color: #4c78dd !important;
        }

        .nav-main-link:hover .nav-main-link-icon {
            color: #4c78dd;
        }

        .nav-main-link.active > .nav-main-link-icon {
            color: var(--bs-link-color);
        }
    </style>

    <!-- jquery -->
    <script src="<?php echo __JS__ ?>lib/jquery.min.js"></script>
    <!-- jquery pjax-->
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery.pjax/2.0.1/jquery.pjax.min.js"></script>
    <!--nprogress-->
    <script src="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-0-M/nprogress/0.2.0/nprogress.min.js"></script>
    <!-- layer -->
    <script src="<?php echo __JS__ ?>lib/layer.min.js"></script>
    <!-- 框架核心js -->
    <script src="<?php echo __JS__ ?>oneui.app.min-5.6.js"></script>
    <!-- 通知库 -->
    <script src="<?php echo __JS__ ?>plugins/bootstrap-notify/bootstrap-notify.min.js"></script>
    <!-- 图片预览 -->
    <script src="<?php echo __JS__ ?>plugins/magnific-popup/jquery.magnific-popup.min.js"></script>
    <script src="<?php echo __JS__ ?>app.js"></script>
    <!-- CHAT -->
    <script src="<?php echo __JS__ ?>plugins/remarkable/remarkable.js"></script>
    <script src="<?php echo __JS__ ?>plugins/highlight/highlight.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML-full"></script>
    <script src="<?php echo __JS__ ?>chat.js"></script>
    <script type="text/javascript">
        MathJax.Hub.Config({
            showProcessingMessages: false,
            messageStyle          : "none",
            extensions            : ["tex2jax.js"],
            jax                   : ["input/TeX", "output/HTML-CSS"],
            tex2jax               : {
                inlineMath : [["$", "$"]],
                displayMath: [["$$", "$$"]],
                skipTags   : ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'a'],
                ignoreClass: "comment-content"
            },
            "HTML-CSS"            : {
                availableFonts: ["STIX", "TeX"],
                showMathMenu  : false
            }
        });
    </script>

</head>
<body>
<div class="sidebar-dark enable-page-overlay side-scroll page-header-fixed main-content-boxed side-trans-enabled " id="page-container">
    <header id="page-header">
        <div class="content-header">
            <div class="d-flex align-items-center">
                <a class="fw-bold fs-lg tracking-wider text-dual me-2" data-pjax href="../index.php"><?php echo WEB_NAME ?></span></a>
            </div>
            <div class="d-flex align-items-center">
                <button type="button" class="btn btn-alt-secondary me-1" data-toggle="layout" data-action="dark_mode_toggle">
                    <i class="far fa-moon"></i>
                </button>
                <div class="dropdown">
                    <button type="button" class="btn btn-alt-secondary me-2" id="sidebar-themes-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                        <i class="si si-settings"></i>
                        <span class="text-danger" id="set_not" style="display:none;">•</span>
                    </button>
                    <div class="dropdown-menu dropdown-menu-end fs-sm smini-hide border-0" aria-labelledby="sidebar-themes-dropdown">
                        <?php if (__ENABLE_LOCAL_KEY_INPUT__ && !$user_info['plans']): ?>
                            <a class="dropdown-item d-flex align-items-center justify-content-between fw-medium" href="javascript:openModalById('add_key')">
                                <span>设置API Key</span>
                                <i class="si si-key text-amethyst"></i>
                            </a>
                            <div class="dropdown-divider"></div>
                        <?php endif; ?>
                        <a class="dropdown-item d-flex align-items-center justify-content-between fw-medium" href="javascript:openModalById('preset')">
                            <span>预设话术</span>
                            <i class="si si-star text-amethyst"></i>
                        </a>
                         <a class="dropdown-item d-flex align-items-center justify-content-between fw-medium">
                            <span>连续对话</span>
                            <input class="form-check-input" type="checkbox" value="" id="keep" name="keep" checked>
                        </a>

                    </div>
                </div>
                <?php if ($islogin): ?>
                    <a class="btn btn-alt-primary fs-sm" data-pjax href="../user/index.php">
                        <i class="fa fa-fw fa-user"></i>
                        <span class="d-none d-sm-inline-block ms-1">个人中心</span>
                    </a>
                <?php else: ?>
                    <a class="btn btn-alt-primary fs-sm" href="../user/login.php">
                        <i class="fa fa-fw fa-user"></i>
                        <span class="d-none d-sm-inline-block ms-1">登录/注册</span>
                    </a>
                <?php endif; ?>
            </div>
        </div>
        <div id="page-header-loader" class="overlay-header bg-primary">
            <div class="content-header">
                <div class="w-100 text-center">
                    <i class="far fa-sun fa-spin text-white"></i>
                </div>
            </div>
        </div>
    </header>
    <main id="main-container">