<!DOCTYPE html>
<html lang="{{ trans('config.html_language') }}">
<head>
    <!--
    If the base href URL begins with "http://" but you are sure it should start with "https://",
    please visit the following page: https://bit.ly/FF3-broken-base-href
    -->
    <base href="{{ route('index', null, true) }}/">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta name="robots" content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="color-scheme" content="light dark">

    <title>
        {% if pageTitle %}
            {{ pageTitle }} »
        {% endif %}
        {% if subTitle and not pageTitle %}
            {{ subTitle }} »
        {% endif %}
        {% if title != "Firefly III" %}
            {{ title }} »
        {% endif %}

        Firefly III

    </title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    {# CSS things #}
    <link href="v1/lib/bs/css/bootstrap.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
          nonce="{{ JS_NONCE }}">
    <link href="v1/lib/fa/css/font-awesome.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
          nonce="{{ JS_NONCE }}">


    {# the theme #}
    <link href="v1/lib/adminlte/css/AdminLTE.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
          nonce="{{ JS_NONCE }}">
    {% if 'browser' == darkMode %}
        <script nonce="{{ JS_NONCE }}">
            // If `prefers-color-scheme` is not supported, fall back to light mode.
            // In this case, light.css will be downloaded with `highest` priority.
            if (window.matchMedia('(prefers-color-scheme: dark)').media === 'not all') {
                document.documentElement.style.display = 'none';
                document.head.insertAdjacentHTML(
                    'beforeend',
                    '<link rel="stylesheet" href="v1/lib/adminlte/css/skins/skin-light.min.css?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}" onload="document.documentElement.style.display = \'\'">',
                );
            }
        </script>
        <link href="v1/css/daterangepicker-default.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}">
        <link href="v1/lib/adminlte/css/skins/skin-dark.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}" media="(prefers-color-scheme: dark)">
        <link href="v1/lib/adminlte/css/skins/skin-light.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}" media="(prefers-color-scheme: light)">
    {% endif %}
    {% if 'dark' == darkMode %}
        <link href="v1/css/daterangepicker-dark.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}">
        <link href="v1/lib/adminlte/css/skins/skin-dark.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}">
    {% endif %}
    {% if 'light' == darkMode %}
        <link href="v1/css/daterangepicker-light.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}">
        <link href="v1/lib/adminlte/css/skins/skin-light.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}">
    {% endif %}
    {# Firefly III customisations #}
    <link href="v1/css/firefly.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css" nonce="{{ JS_NONCE }}">

    {# Extra CSS for the demo: #}
    {% if not shownDemo %}
        <link href="v1/lib/intro/introjs.min.css?v={{ FF_BUILD_TIME }}" rel="stylesheet" type="text/css"
              nonce="{{ JS_NONCE }}">
    {% endif %}

    {# Any local custom CSS.  #}
    {% block styles %}{% endblock %}
    <!--[if lt IE 9]>
    <script src="v1/js/lib/html5shiv.min.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
    <script src="v1/js/lib/respond.min.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
    <![endif]-->

    {# this entry is in the header so it's loaded early #}
    <script type="text/javascript" nonce="{{ JS_NONCE }}">var forceDemoOff = false;</script>

    {# favicons #}
    {% include 'partials.favicons' %}

</head>
<body class="skin-firefly-iii sidebar-mini hold-transition">
<div class="wrapper" id="app">

    <header class="main-header">

        {# Logo #}
        <a href="{{ route('index') }}" class="logo">
            {# mini logo for sidebar mini 50x50 pixels #}
            <span class="logo-mini">FF</span>
            {# logo for regular state and mobile devices #}
            <span class="logo-lg"><strong>Firefly</strong>III</span>
        </a>

        <nav class="navbar navbar-static-top" role="navigation">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">{{ 'toggleNavigation'|_ }}</span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="hidden-sm hidden-xs">
                        <a href="#" id="anonymous">
                            {% if anonymous %}
                                <span class="text-danger fa fa-eye-slash"></span>
                            {% endif %}
                            {% if not anonymous %}
                                <span class="text-success fa fa-eye"></span>
                            {% endif %}
                        </a>
                    </li>
                    <li class="hidden-sm hidden-xs">
                        <a href="#" id="help" data-route="{{ original_route_name }}"
                           data-extra="{{ objectType|default("") }}">
                            <span class="fa fa-question-circle" data-route="{{ original_route_name }}"
                                  data-extra="{{ objectType|default("") }}"></span>
                        </a>
                    </li>

                    <li>
                        <span style="color:#fff;padding: 15px;display: block;line-height: 20px;">
                            <span id="daterange"></span>
                        </span>
                    </li>

                    <li class="dropdown user user-menu">
                    <span style="cursor:default;color:#fff;padding: 15px;display: block;line-height: 20px;">
                        <span class="hidden-xs">{{ Auth.user.email }}</span>
                    </span>
                    </li>
                    <li id="sidebar-toggle">
                        <a href="#" data-toggle="control-sidebar"><span class="fa fa-plus-circle"></span></a>
                    </li>
                </ul>
            </div>

        </nav>
    </header>
    <aside class="main-sidebar">
        <section class="sidebar">
            <form action="{{ route('search.index') }}" method="get" class="sidebar-form">
                <div class="input-group">
                    <input autocomplete="off" type="text" name="search" class="form-control"
                           placeholder="{{ 'searchPlaceholder'|_ }}" value="{{ query }}" spellcheck="false"/>
                    <span class="input-group-btn">
                <button type='submit' name='go' id='search-btn' class="btn btn-flat"><span class="fa fa-search"></span></button>
              </span>
                </div>
            </form>
            {% include('partials.menu-sidebar') %}
        </section>
    </aside>

    <div class="content-wrapper">
        <section class="content-header">
            {% include('partials.page-header') %}
            {% block breadcrumbs %}{% endblock %}
        </section>

        <section class="content">
            {% if IS_DEMO_SITE %}
                <div class="row no-print">
                    <div class="col-lg-12">
                        <p class="well">
                            {% include ['demo.' ~ Route.getCurrentRoute.getName, 'demo.no-demo-text'] %}
                        </p>
                    </div>
                </div>
            {% endif %}

            {% include('partials.flashes') %}

            {% block content %}{% endblock %}
        </section>
    </div>
    <footer class="main-footer">
        <div class="pull-right">
            <b class="hidden-xs">{{ 'version'|_ }}</b> <a
                href="{{ route('debug') }}">{{ Config.get('firefly.version') }}</a>
        </div>
        <strong><a href="https://github.com/firefly-iii/firefly-iii">Firefly III</a></strong>
        <small class="text-muted">&copy; James Cole, <a href="https://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0-or-later</a>.</small>
        {% if FF_IS_ALPHA %}<small class="text-danger hidden-xs"><br>{{ 'is_alpha_warning'|_ }}</small>{% endif %}
        {% if FF_IS_BETA %}<small class="text-warning hidden-xs"><br>{{ 'is_beta_warning'|_ }}</small>{% endif %}
    </footer>

    {% include('partials.control-bar') %}

</div>
<div class="modal fade" id="defaultModal" tabindex="-1" role="dialog">
</div>

<div class="modal fade" tabindex="-1" role="dialog" id="helpModal">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title" id="helpTitle">&nbsp;</h4>
            </div>
            <div class="modal-body" id="helpBody">&nbsp;</div>
            <div class="modal-footer">
                <small class="pull-left">
                    {{ 'need_more_help'|_ }}
                </small>
                <br/>
                <small class="pull-left">
                    {{ trans('firefly.reenable_intro_text')|raw }}
                </small>
                <button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>
            </div>
        </div>
    </div>
</div>

{# Java libraries and stuff: #}

{% block definitions %}{% endblock %}

{# Moment JS #}
<script src="v1/js/lib/moment.min.js?v={{ FF_BUILD_TIME }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
<script src="v1/js/lib/moment/{{ language|replace({'-':'_'}) }}.js?v={{ FF_BUILD_TIME }}" type="text/javascript"
        nonce="{{ JS_NONCE }}"></script>

{# All kinds of variables. #}
<script
    src="{{ route('javascript.variables') }}?ext=.js&amp;v={{ FF_VERSION }}{% if account %}&amp;account={{ account.id }}{% endif %}"
    type="text/javascript" nonce="{{ JS_NONCE }}"></script>

{# Base script: jquery and bootstrap #}
<script src="v1/js/app.js?v={{ FF_BUILD_TIME }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>

{# Vue scripts and components. Only loaded when needed #}
{% if VUE_SCRIPT_NAME %}
    <script src="v1/js/app_vue.js?v={{ FF_BUILD_TIME }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
    <script src="v1/js/{{ VUE_SCRIPT_NAME }}.js?v={{ FF_BUILD_TIME }}" type="text/javascript"
            nonce="{{ JS_NONCE }}"></script>
{% endif %}

{# date range picker, current template, etc. #}
<script src="v1/js/lib/daterangepicker.js?v={{ FF_BUILD_TIME }}" type="text/javascript" nonce="{{ JS_NONCE }}"></script>
<script src="v1/lib/adminlte/js/adminlte.min.js?v={{ FF_BUILD_TIME }}" type="text/javascript"
        nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/lib/accounting.min.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>

{# Firefly III code #}
<script type="text/javascript" src="v1/js/ff/firefly.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
<script type="text/javascript" src="v1/js/ff/help.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
{% if not shownDemo %}
    <script type="text/javascript" nonce="{{ JS_NONCE }}">
        var routeForTour = "{{ current_route_name }}";
        var routeStepsUrl = "{{ route('json.intro', [current_route_name, objectType|default("")]) }}";
        var routeForFinishedTour = "{{ route('json.intro.finished', [current_route_name, objectType|default("")]) }}";
    </script>
    <script type="text/javascript" src="v1/lib/intro/intro.min.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
    <script type="text/javascript" src="v1/js/ff/intro/intro.js?v={{ FF_BUILD_TIME }}" nonce="{{ JS_NONCE }}"></script>
{% endif %}

{% block scripts %}{% endblock %}

{% if config('firefly.tracker_site_id') != '' and config('firefly.tracker_url') != '' %}
    <!-- This tracker tag is only here because this instance of Firefly III was purposefully configured to include it -->
    <!-- Your own installation will NOT include it, unless you explicitly configure it to have it. -->
    <script type="text/javascript" nonce="{{ JS_NONCE }}">
        var _paq = window._paq || [];
        _paq.push(['trackPageView']);
        _paq.push(['enableLinkTracking']);
        (function () {
            var u = "//{{ config('firefly.tracker_url') }}/";
            _paq.push(['setTrackerUrl', u + 'matomo.php']);
            _paq.push(['setSiteId', '{{ config('firefly.tracker_site_id') }}']);
            var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
            g.type = 'text/javascript';
            g.async = true;
            g.defer = true;
            g.src = u + 'matomo.js';
            s.parentNode.insertBefore(g, s);
        })();
    </script>
    <noscript><p><img
                src="//{{ config('firefly.tracker_url') }}/matomo.php?idsite={{ config('firefly.tracker_site_id') }}&amp;rec=1"
                style="border:0;" alt=""/></p></noscript>
{% endif %}

<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
    <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
</form>

</body>
</html>
