<script th:inline="javascript">
    /*<![CDATA[*/

    var policyPattern = /*[[${policyPattern}]]*/ ;
    
    /*]]>*/
</script>

<div class="alert alert-info">
    <h2 th:utext="${expiredPass} ? #{screen.expiredpass.heading} : #{screen.mustchangepass.heading}"/>
    <p/>
    <br/>

    <form id="passwordManagementForm" th:if="${passwordManagementEnabled}" method="post" th:object="${password}">
        <p>
        <div class="alert alert-danger" th:if="${#fields.hasErrors('*')}">
            <span th:each="err : ${#fields.errors('*')}" th:utext="${err}"/>
        </div>

        <table>
            <tr>
                <td class="pm">
                    <label for="password" th:utext="#{screen.pm.enterpsw}" />
                </td>
                <td class="pm">
                    <input class="required" type="password" id="password" th:field="*{password}"/>
                </td>
            </tr>
            <tr>
                <td class="pm">
                    <label for="confirmedPassword" th:utext="#{screen.pm.confirmpsw}" />
                </td>
                <td class="pm">
                    <input class="required" type="password" id="confirmedPassword" th:field="*{confirmedPassword}" />
                </td>
            </tr>
        </table>

        <div>
            <br/>
            <meter max="4" id="password-strength-meter"/>
        </div>
        </p>
        <p id="password-strength-text"></p>
        
        <input type="hidden" name="execution" th:value="${flowExecutionKey}"/>
        <input type="hidden" name="_eventId" value="submit"/>
        <input class="btn btn-success"
               name="submit"
               accesskey="s"
               th:value="#{screen.pm.button.submit}"
               id="submit"
               type="submit"
               disabled="true"/>
        <input
                class="btn-reset"
                name="cancel"
                accesskey="c"
                th:value="#{screen.pm.button.cancel}"
                type="button"
                onclick="location.href = location.href;"/>
    </form>
        <p th:unless="${passwordManagementEnabled}" th:utext="${expiredPass} ? #{screen.expiredpass.message} : #{screen.mustchangepass.message}"/>
</div>
