<commit_before>import {$, $$, addClass, closest, filter, height, isInView, offset, removeClass, trigger} from 'uikit-util';

export default {

    props: {
        cls: String,
        closest: String,
        scroll: Boolean,
        overflow: Boolean,
        offset: Number
    },

    data: {
        cls: 'uk-active',
        closest: false,
        scroll: false,
        overflow: true,
        offset: 0
    },

    computed: {

        links(_, $el) {
            return $$('a[href^="#"]', $el).filter(el => el.hash);
        },

        elements() {
            return this.closest ? closest(this.links, this.closest) : this.links;
        },

        targets() {
            return $$(this.links.map(el => el.hash).join(','));
        }

    },

    update: [

        {

            read() {
                if (this.scroll) {
                    this.$create('scroll', this.links, {offset: this.offset || 0});
                }
            }

        },

        {

            read(data) {

                const scroll = window.pageYOffset + this.offset + 1;
                const max = height(document) - height(window) + this.offset;<commit_msg>polish: use `*` selector<commit_after>import {$, $$, addClass, closest, filter, height, isInView, offset, removeClass, trigger} from 'uikit-util';

export default {

    props: {
        cls: String,
        closest: String,
        scroll: Boolean,
        overflow: Boolean,
        offset: Number
    },

    data: {
        cls: 'uk-active',
        closest: false,
        scroll: false,
        overflow: true,
        offset: 0
    },

    computed: {

        links(_, $el) {
            return $$('a[href^="#"]', $el).filter(el => el.hash);
        },

        elements({closest: selector}) {
            return closest(this.links, selector || '*');
        },

        targets() {
            return $$(this.links.map(el => el.hash).join(','));
        }

    },

    update: [

        {

            read() {
                if (this.scroll) {
                    this.$create('scroll', this.links, {offset: this.offset || 0});
                }
            }

        },

        {

            read(data) {

                const scroll = window.pageYOffset + this.offset + 1;
                const max = height(document) - height(window) + this.offset;
{'fraction_non_alphanumeric': 0.1489909832546157, 'fraction_numerical': 0.0025762129669386004, 'mean_word_length': 1.4423480083857443, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7632271', 'n_tokens_mistral': 697, 'n_tokens_neox': 654, 'n_words': 144}