<commit_before>import { remote } from 'electron';

Emitter.on('error', (event, details) => {
  const toast = document.createElement('paper-toast');
  toast.setAttribute('text', `An uncaught error has occurred inside GPMDP.`);
  toast.duration = 0;
  const issueButton = document.createElement('a');
  issueButton.innerHTML = 'Click here to report this as an issue on GitHub';
  issueButton.style.color = '#E53935';
  issueButton.style.margin = '0';
  issueButton.style.padding = '0';
  issueButton.style.marginLeft = '10px';
  issueButton.style.cursor = 'pointer';
  issueButton.addEventListener('click', (e) => {
    const title = 'Uncaught Exception: ' + details.error.message.split(/\n/g)[0].substring(0, 100);
    const body = `
An uncaught exception was reported.  %0A
%23%23%23%23 Info:%0A
**OS:** ${process.platform}%0A<commit_msg>Issue #748: Make interface error paper-toast dismissable via click outside the element (https://elements.polymer-project.org/elements/paper-toast#property-noCancelOnOutsideClick)<commit_after>import { remote } from 'electron';

Emitter.on('error', (event, details) => {
  const toast = document.createElement('paper-toast');
  toast.setAttribute('text', `An uncaught error has occurred inside GPMDP.`);
  toast.duration = 0;
  toast.noCancelOnOutsideClick = false;
  const issueButton = document.createElement('a');
  issueButton.innerHTML = 'Click here to report this as an issue on GitHub';
  issueButton.style.color = '#E53935';
  issueButton.style.margin = '0';
  issueButton.style.padding = '0';
  issueButton.style.marginLeft = '10px';
  issueButton.style.cursor = 'pointer';
  issueButton.addEventListener('click', (e) => {
    const title = 'Uncaught Exception: ' + details.error.message.split(/\n/g)[0].substring(0, 100);
    const body = `
An uncaught exception was reported.  %0A
%23%23%23%23 Info:%0A
**OS:** ${process.platform}%0A
{'fraction_non_alphanumeric': 0.15151515151515152, 'fraction_numerical': 0.029239766081871343, 'mean_word_length': 4.974603174603175, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 1, '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': '2882135', 'n_tokens_mistral': 610, 'n_tokens_neox': 584, 'n_words': 141}