<commit_before>(function() {
	'use strict';

	var $ = require('zepto-browserify').Zepto,
	    _ = require('underscore')._,
	    Telepathy = require('telepathy'),
	    telepathy = new Telepathy();

	// Populate values for index/length select boxes
	var i;
	for (i=4; i<=100; i+=(i<30?1:(i<50?5:10)))
		$('#length,#default-length').append('<option value="' + i +'">' + i + '</option>');

	for (i=0; i<=50; i++)
		$('#index,#default-index').append('<option value="' + i + '">' + i + '</option>');

	$('#domain').on('keydown', _.debounce(function() {
		var domain = this.value.replace(/^\s+|\s+$/g, '');

		if (!domain.length) {
			$('#password').html('&nbsp;');
			return;
		}

		$('#password').text(telepathy.password({
			domain: domain,
			algorithm: UI.settings['algorithm'],
			user: UI.settings['default-username'],
			secret: UI.settings['shared-secret'],
			length: (+$('#length').val()) || UI.settings['default-length'],
			index: (+$('#index').val()) || UI.settings['default-index'],

			alphabet: $('input[name=lax]:checked').val() == 'yes' ?
			            Telepathy.alphabet.base62 :
			            Telepathy.alphabet.base94
		}));
	}));

	$('.modal-close').on('click', function() {
		$(this).parents('.modal').removeClass('open');
	});

	$('.modal-close, input[name=lax], #index, #length').on('click change keydown', function() {
		$('#domain').trigger('keydown');
	});

	$('#open-settings').on('click', function(event) {
		event.preventDefault();
		$('#settings').addClass('open');
	});

	// Disable scroll if iOS standalone is happening
	if (window.navigator.standalone) {
		$(document).on('touchmove', function(event) {
			if ($('#settings').hasClass('open'))
				return;

			event.preventDefault();
			return false;
		});
	}

	$('#settings input, #settings select').each(function() {
		var $this = $(this);

		$this.on('change', function() {
			if (!$this.prop('name'))
				return;

			UI.settings[$this.prop('name')] = $this.val();
		});
	});

	$('.save-settings').on('click', function() {
		UI.save();
		UI.load();
	});

	$('.reset-settings').on('click', function() {
		UI.load();
	});

	var UI = {
		settings: {
		},

		_settings: {
			'default-username': '',
			'shared-secret': '',
			'save-secret': 'no',
			'algorithm': 'SHA256',
			'default-length': 10,
			'default-index': 0<commit_msg>Clear domain when page blurs<commit_after>(function() {
	'use strict';

	var $ = require('zepto-browserify').Zepto,
	    _ = require('underscore')._,
	    Telepathy = require('telepathy'),
	    telepathy = new Telepathy();

	// Populate values for index/length select boxes
	var i;
	for (i=4; i<=100; i+=(i<30?1:(i<50?5:10)))
		$('#length,#default-length').append('<option value="' + i +'">' + i + '</option>');

	for (i=0; i<=50; i++)
		$('#index,#default-index').append('<option value="' + i + '">' + i + '</option>');

	$('#domain').on('keydown', _.debounce(function() {
		var domain = this.value.replace(/^\s+|\s+$/g, '');

		if (!domain.length) {
			$('#password').html('&nbsp;');
			return;
		}

		$('#password').text(telepathy.password({
			domain: domain,
			algorithm: UI.settings['algorithm'],
			user: UI.settings['default-username'],
			secret: UI.settings['shared-secret'],
			length: (+$('#length').val()) || UI.settings['default-length'],
			index: (+$('#index').val()) || UI.settings['default-index'],

			alphabet: $('input[name=lax]:checked').val() == 'yes' ?
			            Telepathy.alphabet.base62 :
			            Telepathy.alphabet.base94
		}));
	}));

	$('.modal-close').on('click', function() {
		$(this).parents('.modal').removeClass('open');
	});

	$('.modal-close, input[name=lax], #index, #length').on('click change keydown', function() {
		$('#domain').trigger('keydown');
	});

	$('#open-settings').on('click', function(event) {
		event.preventDefault();
		$('#settings').addClass('open');
	});

	// Disable scroll if iOS standalone is happening
	if (window.navigator.standalone) {
		$(document).on('touchmove', function(event) {
			if ($('#settings').hasClass('open'))
				return;

			event.preventDefault();
			return false;
		});
	}

	$('#settings input, #settings select').each(function() {
		var $this = $(this);

		$this.on('change', function() {
			if (!$this.prop('name'))
				return;

			UI.settings[$this.prop('name')] = $this.val();
		});
	});

	$('.save-settings').on('click', function() {
		UI.save();
		UI.load();
	});

	$('.reset-settings').on('click', function() {
		UI.load();
	});

	$(window).on('blur', function() {
		$('#domain').val('').trigger('keydown');
	});

	var UI = {
		settings: {
		},

		_settings: {
			'default-username': '',
			'shared-secret': '',
			'save-secret': 'no',
			'algorithm': 'SHA256',
			'default-length': 10,
			'default-index': 0
{'fraction_non_alphanumeric': 0.2578936215299852, 'fraction_numerical': 0.010595465140919686, 'mean_word_length': 3.9269311064718164, 'pattern_counts': {'":': 0, '<': 19, '<?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': '297343', 'n_tokens_mistral': 1807, 'n_tokens_neox': 1600, 'n_words': 272}