<commit_before>const html = require('choo/html');

module.exports = function(state, emit) {
  const file = state.storage.getFileById(state.params.id);
  const div = html`
  <div class="selectPassword">
    <div id="addPasswordWrapper">
      <input id="addPassword" type="checkbox" onchange=${togglePasswordInput}/>
      <label for="addPassword">
        ${state.translate('requirePasswordCheckbox')}</label>
    </div>
    <form class="setPassword hidden" onsubmit=${setPassword}>
      <input id="unlock-input"
        maxlength="64"
        autocomplete="off"
        placeholder="${state.translate('unlockInputPlaceholder')}"/>
      <input type="submit"
        id="unlock-btn"
        class="btn"
        value="${state.translate('addPasswordButton')}"/>
    </form>
  </div>`;

  function togglePasswordInput(e) {
    const unlockInput = document.getElementById('unlock-input');
    const boxChecked = e.target.checked;
    document
      .querySelector('.setPassword')
      .classList.toggle('hidden', !boxChecked);
    document
      .getElementById('copy')
      .classList.toggle('wait-password', boxChecked);
    document.getElementById('copy-btn').disabled = boxChecked;
    if (boxChecked) {
      unlockInput.focus();
    } else {
      unlockInput.value = '';
    }
  }<commit_msg>set autocomplete off for addPassword checkbox<commit_after>const html = require('choo/html');

module.exports = function(state, emit) {
  const file = state.storage.getFileById(state.params.id);
  const div = html`
  <div class="selectPassword">
    <div id="addPasswordWrapper">
      <input id="addPassword" type="checkbox" autocomplete="off" onchange=${togglePasswordInput}/>
      <label for="addPassword">
        ${state.translate('requirePasswordCheckbox')}</label>
    </div>
    <form class="setPassword hidden" onsubmit=${setPassword}>
      <input id="unlock-input"
        maxlength="64"
        autocomplete="off"
        placeholder="${state.translate('unlockInputPlaceholder')}"/>
      <input type="submit"
        id="unlock-btn"
        class="btn"
        value="${state.translate('addPasswordButton')}"/>
    </form>
  </div>`;

  function togglePasswordInput(e) {
    const unlockInput = document.getElementById('unlock-input');
    const boxChecked = e.target.checked;
    document
      .querySelector('.setPassword')
      .classList.toggle('hidden', !boxChecked);
    document
      .getElementById('copy')
      .classList.toggle('wait-password', boxChecked);
    document.getElementById('copy-btn').disabled = boxChecked;
    if (boxChecked) {
      unlockInput.focus();
    } else {
      unlockInput.value = '';
    }
  }
{'fraction_non_alphanumeric': 0.15364288410721028, 'fraction_numerical': 0.0015100037750094375, 'mean_word_length': 3.499151103565365, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '2112027', 'n_tokens_mistral': 746, 'n_tokens_neox': 741, 'n_words': 132}