<commit_before>export default class InactivityMonitor {
  constructor() {
    this.timeout = undefined;

    const inactivityTimeout = 3000;
    const inactivityClass = 'user-inactive';

    const onInactivity = () => {
      document.documentElement.classList.add(inactivityClass);
    };
    const onActivity = () => {
      if (this.timeout !== undefined) {
        window.clearTimeout(this.timeout);
      }
      this.timeout = window.setTimeout(onInactivity, inactivityTimeout);
      document.documentElement.classList.remove(inactivityClass);
    };
    window.onload = onActivity;
    // DOM Events
    document.addEventListener('mousemove', onActivity);
    document.addEventListener('keypress', onActivity);
  }
}<commit_msg>Also listen for clicks when watching for user inactivity<commit_after>export default class InactivityMonitor {
  constructor() {
    this.timeout = undefined;

    const inactivityTimeout = 3000;
    const inactivityClass = 'user-inactive';

    const onInactivity = () => {
      document.documentElement.classList.add(inactivityClass);
    };
    const onActivity = () => {
      if (this.timeout !== undefined) {
        window.clearTimeout(this.timeout);
      }
      this.timeout = window.setTimeout(onInactivity, inactivityTimeout);
      document.documentElement.classList.remove(inactivityClass);
    };
    window.onload = onActivity;
    // DOM Events
    document.addEventListener('mousemove', onActivity);
    document.addEventListener('keypress', onActivity);
    // Touch devices don't have (or at least make us of) mouses or keys
    document.addEventListener('click', onActivity);
  }
}
{'fraction_non_alphanumeric': 0.11226357535082367, 'fraction_numerical': 0.004881025015253203, 'mean_word_length': 3.5555555555555554, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6245363', 'n_tokens_mistral': 442, 'n_tokens_neox': 429, 'n_words': 91}