{{#timeout}}
    <progress id="timeout-bar" value="{{timeout}}" max="{{timeout}}" style="width: 100%;"></progress>

    <script>
        let elem = document.getElementById("timeout-bar");
        let id = setInterval(function () {
            elem.value--;
            if (elem.value <= 0) {
                clearInterval(id);
                window.terminate(1);
            }
        }, 1000);
    </script>
{{/timeout}}