{% load ledger %}
{% load i18n %}
{% load static %}

<script type="application/javascript">
    // Extract the 'main' parameter from the current URL
    const urlParams = new URLSearchParams(window.location.search);
    const mainParam = urlParams.get('single');

    let singleViewParam = false;
    if (mainParam) {
        singleViewParam = true;
    }

    let ledgersettings = {
        entity_pk: {{ entity_pk }},
        entity_type: "{{ entity_type }}",
        altShow: singleViewParam,
        overviewText: '{% translate "Overview" %}',
        planetaryText: '{% translate "Show Planetary Interaction" %}',
    };
</script>

<script>
    // Embed translations in a global JavaScript object
    window.translations = {
        months: [
            "{% trans 'January' %}", "{% trans 'February' %}", "{% trans 'March' %}", "{% trans 'April' %}",
            "{% trans 'May' %}", "{% trans 'June' %}", "{% trans 'July' %}", "{% trans 'August' %}",
            "{% trans 'September' %}", "{% trans 'October' %}", "{% trans 'November' %}", "{% trans 'December' %}"
        ],
        dayText: "{% trans 'Day' %}",
        monthText: "{% trans 'Month' %}"
    };
</script>

<!-- Chart Resources -->
{% ledger_static 'assets/index.js' %}
{% ledger_static 'assets/xy.js' %}
{% ledger_static 'assets/percent.js' %}
{% ledger_static 'assets/flow.js' %}
{% ledger_static 'assets/Animated.js' %}
{% ledger_static 'assets/Dark.js' %}

<!-- Ledger Resources -->
{% ledger_static 'js/charts.js' %}
{% ledger_static 'js/ledger-common.js' %}
{% ledger_static 'js/character.js' %}
