<commit_before>section.col-xs-12.content(ng-controller="RegisterCtrl")
  .row.auth-form-container.col-sm-offset-2.col-sm-8.col-md-offset-3.col-md-6(ng-show='mode=="migration"')
    .auth-form-wrapper
      h2 Migrate your account
      .sign-up-steps-list
        li.active(l10n) Step
          span  1
        li(l10n) Step
          span  2
        li(l10n) Step
          span  3
      .alert.alert-info You are now migrating your account. You will retain all of your balances, contact information, and history. Your account will use the same secret key that you had before. If you have already saved your secret key, please continue your migration.
      .secret-key-container If you have not saved your secret key, write it down and store in a secure location. If you forget your password, there is no way to reaccess your funds without your secret key.
        div.secret-key
          span.fa.fa-key
          span(ng-hide="showSecret") •••••••••••••••••••••••••••••
          span(ng-show="showSecret") {{oldUserBlob.data.master_seed}}
        a(href="", ng-click="showSecret=!showSecret")
          span(l10n, ng-hide="showSecret") Show secret key
          span(l10n, ng-show="showSecret") Hide secret key
      .submit-btn-container
        button.btn.btn-block.btn-success(ng-click='mode="form"')
          span(l10n) Migrate account

  .row.auth-form-container.col-sm-offset-2.col-sm-8.col-md-offset-3.col-md-6(ng-show='mode=="form"')
    .auth-form-wrapper
      form(name='registerForm', ng-submit='submitForm()')
        h2(l10n) Sign Up
        .sign-up-steps-list
          li.active(l10n) Step
            span  1
          li(l10n) Step
            span  2
          li(l10n) Step
            span  3
        .form-group(
          ng-class="{'field-error': 'invalid' == usernameStatus || 'reserved' == usernameStatus || 'exists' == usernameStatus, 'field-ok': 'ok' == usernameStatus}"
          )
          label(for='register_username', l10n) Create Ripple name
          .input-group
            span.input-group-addon.ripple-addon ~
            input.form-control#register_username(
              name='register_username', type='text', ng-model="username"
              required, rp-focus, autocomplete="off")
          p(ng-switch on="usernameStatus", class="{{usernameStatus}}", rp-spinner="{{usernameStatus == 'loading' ? 4 : null}}")
            span(ng-switch-when="exists", l10n) Already taken!
            span(ng-switch-when="reserved", l10n) Reserved for {{usernameReservedFor}}
              span &#32;
            i.fa.fa-question-circle(
              rp-popover
              rp-popover-placement="bottom"
              rp-popover-title='Reserved domain'
              rp-popover-trigger="click"
              ng-switch-when="reserved"
              data-content='This name belongs to a high-traffic website and has been reserved to prevent phishing. <a href="#" target="_blank">More information</a>')
            span(ng-switch-when="loading", l10n) Checking...
            span(ng-switch-when="ok", l10n) Available
            span(ng-switch-when="invalid", ng-switch on="usernameInvalidReason")
              span(ng-switch-when="tooshort", l10n) Must be at least 2 characters
              span(ng-switch-when="toolong", l10n) Must be at most 15 characters
              span(ng-switch-when="charset", l10n) Only a-z, 0-9 and hyphen (-)
              span(ng-switch-when="starthyphen", l10n) Cannot start with hyphen (-)
              span(ng-switch-when="endhyphen", l10n) Cannot end with hyphen (-)
              span(ng-switch-when="multhyphen", l10n) Cannot bundle hyphens (--)
        .form-group(ng-class="{'field-error': 'weak' === strength}")
          label(for='register_password', l10n) Password
          input.form-control#register_password(
            name='register_password1', type='password', autocomplete="off"
            ng-model="<PASSWORD>"
            rp-strong-password, required, rp-same-in-set="<PASSWORD>")
          p(ng-show="strength=='weak'")
            span(l10n) Your password is weak. It does not contain numbers and symbols or it is too short.
        .form-group(ng-class="{'field-error': registerForm.register_password1.$error.rpSameInSet && registerForm.register_password2.$dirty}")
          label(for='register_password2', l10n) Confirm password
          input.form-control#register_password2(
            name='register_password2', autocomplete="off"
            type='password'
            ng-model="<PASSWORD>"
            required, rp-same-in-set="password<PASSWORD>")
          p(ng-show="registerForm.register_password1.$error.rpSameInSet && registerForm.register_password2.$dirty")
            span(l10n) Passwords do not match
        div(ng-show="")
          .form-group
            div(class="strength {{strength}}") {{strength}}
        .form-group(ng-class="{'field-error': registerForm.email.$error.email && registerForm.email.$dirty}")
          label(for='email') Email
          input.form-control(type="email", name="email", id="email"
            placeholder="", ng-model="email", required)
          p(ng-show="registerForm.email.$error.email && registerForm.email.$dirty")
            span(l10n) Email address is invalid
        //- TODO focus on field when clicked
        div(ng-hide="showSecretField || oldUserBlob")
          a(href="", ng-click="showSecretField=true", l10n) Use secret key
          | &#32;
          i.fa.fa-question-circle(
            rp-popover
            rp-popover-placement="bottom"
            rp-popover-title="Using a secret key"
            rp-popover-trigger="hover"
            l10n-data-content="This will create a new Ripple name and password combination for your existing account.")
        .form-group(ng-show="showSecretField"
          ng-class="{'field-error': registerForm.secret.$error.rpMasterKey && registerForm.secret.$dirty}")
          label(for='masterkey') Secret Key
          input.form-control(type="text", name="masterkey", id="masterkey"
            l10n-placeholder="Leave blank if you don't have a secret key."
            ng-model="masterkey", rp-master-key)
          p(ng-show="registerForm.secret.$error.rpMasterKey && registerForm.secret.$dirty")
            span(l10n) Secret is invalid
        .submit-btn-container
          button.btn.btn-block.btn-success(type='submit'
            ng-disabled='registerForm.$invalid || submitLoading || "ok" !== usernameStatus'
            rp-spinner='{{submitLoading ? 4 : null}}')
            span(ng-show="submitLoading", l10n) Loading...
            span(ng-hide="submitLoading", l10n) Sign Up
    .switch-mode-link-container Have an account?&#32;
      a(href='#login', l10n) Log In

  .row.mode-masterkeyerror(ng-show='mode=="failed"')
    .col-xs-12.col-md-10.col-md-offset-1
      p.literal(l10n) An error occurred during registration. Please try again later.
      p.literal(l10n) The reported error was:
        | &#32;
        span(ng-bind="error_detail")
      p<commit_msg>Register- move the secret key form field description to the top<commit_after>section.col-xs-12.content(ng-controller="RegisterCtrl")
  .row.auth-form-container.col-sm-offset-2.col-sm-8.col-md-offset-3.col-md-6(ng-show='mode=="migration"')
    .auth-form-wrapper
      h2 Migrate your account
      .sign-up-steps-list
        li.active(l10n) Step
          span  1
        li(l10n) Step
          span  2
        li(l10n) Step
          span  3
      .alert.alert-info You are now migrating your account. You will retain all of your balances, contact information, and history. Your account will use the same  that you had before. If you have already saved your secret key, please continue your migration.
      .secret-key-container If you have not saved your secret key, write it down and store in a secure location. If you forget your password, there is no way to reaccess your funds without your secret key.
        div.secret-key
          span.fa.fa-key
          span(ng-hide="showSecret") •••••••••••••••••••••••••••••
          span(ng-show="showSecret") {{oldUserBlob.data.master_seed}}
        a(href="", ng-click="showSecret=!showSecret")
          span(l10n, ng-hide="showSecret") Show secret key
          span(l10n, ng-show="showSecret") Hide secret key
      .submit-btn-container
        button.btn.btn-block.btn-success(ng-click='mode="form"')
          span(l10n) Migrate account

  .row.auth-form-container.col-sm-offset-2.col-sm-8.col-md-offset-3.col-md-6(ng-show='mode=="form"')
    .auth-form-wrapper
      form(name='registerForm', ng-submit='submitForm()')
        h2(l10n) Sign Up
        .sign-up-steps-list
          li.active(l10n) Step
            span  1
          li(l10n) Step
            span  2
          li(l10n) Step
            span  3
        .form-group(
          ng-class="{'field-error': 'invalid' == usernameStatus || 'reserved' == usernameStatus || 'exists' == usernameStatus, 'field-ok': 'ok' == usernameStatus}"
          )
          label(for='register_username', l10n) Create Ripple name
          .input-group
            span.input-group-addon.ripple-addon ~
            input.form-control#register_username(
              name='register_username', type='text', ng-model="username"
              required, rp-focus, autocomplete="off")
          p(ng-switch on="usernameStatus", class="{{usernameStatus}}", rp-spinner="{{usernameStatus == 'loading' ? 4 : null}}")
            span(ng-switch-when="exists", l10n) Already taken!
            span(ng-switch-when="reserved", l10n) Reserved for {{usernameReservedFor}}
              span &#32;
            i.fa.fa-question-circle(
              rp-popover
              rp-popover-placement="bottom"
              rp-popover-title='Reserved domain'
              rp-popover-trigger="click"
              ng-switch-when="reserved"
              data-content='This name belongs to a high-traffic website and has been reserved to prevent phishing. <a href="#" target="_blank">More information</a>')
            span(ng-switch-when="loading", l10n) Checking...
            span(ng-switch-when="ok", l10n) Available
            span(ng-switch-when="invalid", ng-switch on="usernameInvalidReason")
              span(ng-switch-when="tooshort", l10n) Must be at least 2 characters
              span(ng-switch-when="toolong", l10n) Must be at most 15 characters
              span(ng-switch-when="charset", l10n) Only a-z, 0-9 and hyphen (-)
              span(ng-switch-when="starthyphen", l10n) Cannot start with hyphen (-)
              span(ng-switch-when="endhyphen", l10n) Cannot end with hyphen (-)
              span(ng-switch-when="multhyphen", l10n) Cannot bundle hyphens (--)
        .form-group(ng-class="{'field-error': 'weak' === strength}")
          label(for='register_password', l10n) Password
          input.form-control#register_password(
            name='register_password1', type='password', autocomplete="off"
            ng-model="password1"
            rp-strong-password, required, rp-same-in-set="passwordSet")
          p(ng-show="strength=='weak'")
            span(l10n) Your password is weak. It does not contain numbers and symbols or it is too short.
        .form-group(ng-class="{'field-error': registerForm.register_password1.$error.rpSameInSet && registerForm.register_password2.$dirty}")
          label(for='register_password2', l10n) Confirm password
          input.form-control#register_password2(
            name='register_password2', autocomplete="off"
            type='password'
            ng-model="password2"
            required, rp-same-in-set="passwordSet")
          p(ng-show="registerForm.register_password1.$error.rpSameInSet && registerForm.register_password2.$dirty")
            span(l10n) Passwords do not match
        div(ng-show="")
          .form-group
            div(class="strength {{strength}}") {{strength}}
        .form-group(ng-class="{'field-error': registerForm.email.$error.email && registerForm.email.$dirty}")
          label(for='email') Email
          input.form-control(type="email", name="email", id="email"
            placeholder="", ng-model="email", required)
          p(ng-show="registerForm.email.$error.email && registerForm.email.$dirty")
            span(l10n) Email address is invalid
        //- TODO focus on field when clicked
        div(ng-hide="showSecretField || oldUserBlob")
          a(href="", ng-click="showSecretField=true", l10n) Use secret key
          | &#32;
          i.fa.fa-question-circle(
            rp-popover
            rp-popover-placement="bottom"
            rp-popover-title="Using a secret key"
            rp-popover-trigger="hover"
            l10n-data-content="This will create a new Ripple name and password combination for your existing account.")
        .form-group(ng-show="showSecretField"
          ng-class="{'field-error': registerForm.secret.$error.rpMasterKey && registerForm.secret.$dirty}")
          label(for='masterkey') Secret Key - leave blank if you don't have a secret key
          input.form-control(type="text", name="masterkey", id="masterkey"
            l10n-placeholder=""
            ng-model="masterkey", rp-master-key)
          p(ng-show="registerForm.secret.$error.rpMasterKey && registerForm.secret.$dirty")
            span(l10n) Secret is invalid
        .submit-btn-container
          button.btn.btn-block.btn-success(type='submit'
            ng-disabled='registerForm.$invalid || submitLoading || "ok" !== usernameStatus'
            rp-spinner='{{submitLoading ? 4 : null}}')
            span(ng-show="submitLoading", l10n) Loading...
            span(ng-hide="submitLoading", l10n) Sign Up
    .switch-mode-link-container Have an account?&#32;
      a(href='#login', l10n) Log In

  .row.mode-masterkeyerror(ng-show='mode=="failed"')
    .col-xs-12.col-md-10.col-md-offset-1
      p.literal(l10n) An error occurred during registration. Please try again later.
      p.literal(l10n) The reported error was:
        | &#32;
        span(ng-bind="error_detail")
      p
{'fraction_non_alphanumeric': 0.13885323063756955, 'fraction_numerical': 0.01668806161745828, 'mean_word_length': 2.5083812859644734, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7432177', 'n_tokens_mistral': 4292, 'n_tokens_neox': 4127, 'n_words': 896}