<commit_before>define([
    'knockout',
    'views/components/search/base-filter'
], function(ko, BaseFilter) {
    var componentName = 'provisional-filter';
    return ko.components.register(componentName, {
        viewModel: BaseFilter.extend({
            initialize: function(options) {
                options.name = 'Provisional Filter';
                BaseFilter.prototype.initialize.call(this, options);
                this.filter = ko.observableArray();
                this.provisionalOptions = [{'name': 'Authoritative'},{'name': 'Provisional'}];

                this.restoreState();

                var filterUpdated = ko.computed(function() {
                    return JSON.stringify(ko.toJS(this.filter()));
                }, this);
                filterUpdated.subscribe(function() {
                    this.updateQuery();
                }, this);

                this.filters[componentName](this);
            },<commit_msg>Checks for the availablity of required filters before restoring state. re #6637<commit_after>define([
    'knockout',
    'views/components/search/base-filter'
], function(ko, BaseFilter) {
    var componentName = 'provisional-filter';
    return ko.components.register(componentName, {
        viewModel: BaseFilter.extend({
            initialize: function(options) {
                options.name = 'Provisional Filter';
                this.requiredFilters = ['term-filter'];
                BaseFilter.prototype.initialize.call(this, options);
                this.filter = ko.observableArray();
                this.provisionalOptions = [{'name': 'Authoritative'},{'name': 'Provisional'}];

                if (this.requiredFiltersLoaded() === false) {
                    this.requiredFiltersLoaded.subscribe(function() {
                        this.restoreState();
                    }, this);
                } else {
                    this.restoreState();
                }

                var filterUpdated = ko.computed(function() {
                    return JSON.stringify(ko.toJS(this.filter()));
                }, this);
                filterUpdated.subscribe(function() {
                    this.updateQuery();
                }, this);

                this.filters[componentName](this);
            },
{'fraction_non_alphanumeric': 0.12203687445127305, 'fraction_numerical': 0.001755926251097454, 'mean_word_length': 1.7997542997542997, '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': '4669725', 'n_tokens_mistral': 574, 'n_tokens_neox': 535, 'n_words': 92}