{% set isPiwikDemo %}{{ piwikUrl == 'http://demo.matomo.org/' or piwikUrl == 'https://demo.matomo.org/' or piwikUrl == 'https://demo.matomo.cloud/' or piwikUrl == 'http://demo.matomo.cloud/' }}{% endset %}

{% set updateCheck %}
    <span id="updateCheckLinkContainer">
        <span class="icon icon-fixed icon-reload"></span>
        {{ (lastUpdateCheckFailed|default(false) ? 'General_ErrorTryAgain' : 'CoreHome_CheckForUpdates')|translate }}
    </span>
{% endset %}

{% if
    isAutoUpdateEnabled and (
        (latest_version_available and not isPiwikDemo and hasSomeViewAccess and not isUserIsAnonymous and showUpdateNotificationToUser)
        or (
            isSuperUser
            and (
                (isManualUpdateCheck is defined and isManualUpdateCheck and lastUpdateCheckFailed is defined and lastUpdateCheckFailed)
                or (isAdminArea is defined and isAdminArea)
            )
        )
    ) %}
<div
    vue-entry="CoreHome.VersionInfoHeaderMessage"
    last-update-check-failed="{{ lastUpdateCheckFailed|default(false)|json_encode }}"
    latest-version-available="{{ latest_version_available|default(null)|json_encode }}"
    is-multi-server-environment="{{ isMultiServerEnvironment|default(false)|json_encode }}"
    is-piwik-demo="{{ isPiwikDemo|default(false)|json_encode }}"
    is-super-user="{{ isSuperUser|default(false)|json_encode }}"
    is-admin-area="{{ isAdminArea|default(false)|json_encode }}"
    is-internet-enabled="{{ isInternetEnabled|default(false)|json_encode }}"
    update-check="{{ updateCheck|default|json_encode }}"
    has-some-view-access="{{ hasSomeViewAccess|default(false)|json_encode }}"
    is-anonymous="{{ isUserIsAnonymous|default(false)|json_encode }}"
    contact-email="{{ contactEmail|json_encode }}"
    piwik-version="{{ piwik_version|default(null)|json_encode }}"
    class="borderedControl piwikTopControl"
></div>

<span class="icon icon-arrowup"></span>
<div style="clear:right"></div>
{% else %}
<span class="icon icon-arrowup"></span>
{% endif %}
