<commit_before>import instantsearch from 'instantsearch.js';
import {searchBox, hits, pagination, currentRefinedValues, menu, refinementList} from "instantsearch.js/es/widgets";

document.getElementById('search_query_query').addEventListener('keydown', function (e) {
    if (e.keyCode === 13) {
        e.preventDefault();
    }
});

// Add accessibility functionality:
// "Press '/' to focus the searchbar".
document.addEventListener('keydown', function (e) {
    if (e.code !== 'Slash') {
        return;
    }
    var searchInput = document.getElementById('search_query_query');
    // Just ignore if we can't find the search input for some reason maybe we are on a page without it.
    if (!searchInput) {
        return;
    }
    // If we already have input focus ignore.
    if (document.activeElement.tagName === 'INPUT') {
        return;
    }
    searchInput.focus();
    // Prevent '/' being inserted on focus.
    e.preventDefault();
});

var searchParameters = {};

if (decodeURI(location.search).match(/[<>]/)) {
    location.replace(location.pathname);
}

var searchThrottle = null;
var search = instantsearch({
    appId: algoliaConfig.app_id,
    apiKey: algoliaConfig.search_key,
    indexName: algoliaConfig.index_name,
    routing: {
        stateMapping: {<commit_msg>Fix slash hotkey on non-US keyboard layouts<commit_after>import instantsearch from 'instantsearch.js';
import {searchBox, hits, pagination, currentRefinedValues, menu, refinementList} from "instantsearch.js/es/widgets";

document.getElementById('search_query_query').addEventListener('keydown', function (e) {
    if (e.keyCode === 13) {
        e.preventDefault();
    }
});

// Add accessibility functionality:
// "Press '/' to focus the searchbar".
document.addEventListener('keydown', function (e) {
    if (e.key !== '/') {
        return;
    }
    var searchInput = document.getElementById('search_query_query');
    // Just ignore if we can't find the search input for some reason maybe we are on a page without it.
    if (!searchInput) {
        return;
    }
    // If we already have input focus ignore.
    if (document.activeElement.tagName === 'INPUT') {
        return;
    }
    searchInput.focus();
    // Prevent '/' being inserted on focus.
    e.preventDefault();
});

var searchParameters = {};

if (decodeURI(location.search).match(/[<>]/)) {
    location.replace(location.pathname);
}

var searchThrottle = null;
var search = instantsearch({
    appId: algoliaConfig.app_id,
    apiKey: algoliaConfig.search_key,
    indexName: algoliaConfig.index_name,
    routing: {
        stateMapping: {
{'fraction_non_alphanumeric': 0.13118527042577677, 'fraction_numerical': 0.0015343306482546988, 'mean_word_length': 3.442930153321976, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2071074', 'n_tokens_mistral': 766, 'n_tokens_neox': 751, 'n_words': 201}