<commit_before>define(['lodash', 'jquery', 'knockout'], function ( _, $, ko) {
    var Pager = function (logger) {
        this.logger = logger;
        this.pages = ko.observableArray();
        this.currentPage = ko.observable();
        this.last_page = ko.observable();
    };

    Pager.prototype.ensurePageLoaded = function (id, path, params, forceRefresh) {
        var pageHolder = _.find(this.pages(), { id: id });
        if (pageHolder) {
            pageHolder.params = params;
            if (pageHolder.model() && pageHolder.model().refresh) {
                pageHolder.model().refresh(params, forceRefresh);
            }
        } else {
            this.loadPage(path, id, params);
        }
    };

    Pager.prototype.goToPage = function (path, params, originalPath) {
        var id = path.replace(/\//g, '-');
        this.ensurePageLoaded(id, path, params, true);
        this.last_page(this.currentPage());
        this.currentPage({
            id: id,
            path: path,
            originalPath: originalPath
        });
    };

    Pager.prototype.loadPage = function (path, id, params) {
        var pageHolder = {<commit_msg>Ensure page doesn't load incorrect params cause of hover while it's shown/being loaded<commit_after>define(['lodash', 'jquery', 'knockout'], function ( _, $, ko) {
    var Pager = function (logger) {
        this.logger = logger;
        this.pages = ko.observableArray();
        this.currentPage = ko.observable();
        this.last_page = ko.observable();
    };

    Pager.prototype.ensurePageLoaded = function (id, path, params, forceRefresh) {
        var pageHolder = _.find(this.pages(), { id: id });
        if (pageHolder) {
            pageHolder.params = params;
            if (pageHolder.model() && pageHolder.model().refresh) {
                if (forceRefresh || !pageHolder.isCurrentPage()) {
                    pageHolder.model().refresh(params, forceRefresh);
                }
            }
        } else {
            this.loadPage(path, id, params);
        }
    };

    Pager.prototype.goToPage = function (path, params, originalPath) {
        var id = path.replace(/\//g, '-');
        this.ensurePageLoaded(id, path, params, true);
        this.last_page(this.currentPage());
        this.currentPage({
            id: id,
            path: path,
            originalPath: originalPath
        });
    };

    Pager.prototype.loadPage = function (path, id, params) {
        var pageHolder = {
{'fraction_non_alphanumeric': 0.13819500402900886, 'fraction_numerical': 0.0, 'mean_word_length': 2.061652281134402, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7008983', 'n_tokens_mistral': 705, 'n_tokens_neox': 689, 'n_words': 151}