<commit_before>import { focusAuto } from 'vue-focus';

module.exports = {

    directives: {
        focusAuto: focusAuto
    },

    data: function () {
        return {
            user: {
                name: null,
                email: null,
                mobile: null
            },
            messages: [],
            map_src: config.api.base_url + '/graphics/members-map-norway.svg',
            config: window.config,
            statistics: Object
        }
    },

    ready: function() {

        var that = this;

        client({ path: '/statistics/users' }).then(function(response) {
            that.$set('statistics', response.entity);
        });
    },

    methods: {
        registerUser: function (e) {
            e.preventDefault()
            var that = this

            client({ path: '/register', entity: this.user }).then(
                function (response) {
                    that.getUserData()
                },
                function (response, status) {
                    that.messages = []
                    if (response.status && response.status.code === 422) {
                        that.messages = []
                        for (var key in response.entity) {
                            that.messages.push({type: 'danger', message: response.entity[key]})
                        }
                    }
                }
            )

        },

        getUserData: function () {
            var that = this
            client({ path: '/users/me' }).then(
                function (response) {
                    that.$dispatch('userHasLoggedIn', response.entity.user)<commit_msg>initial release<commit_after>import { focusAuto } from 'vue-focus';

module.exports = {

    directives: {
        focusAuto: focusAuto
    },

    data: function () {
        return {
            user: {
                name: null,
                email: null,
                mobile: null
            },
            messages: [],
            map_src: config.api.base_url + '/graphics/members-map-norway.svg',
            config: window.config,
            statistics: Object
        }
    },

    ready: function() {

        var that = this;

        client({ path: '/statistics/users' }).then(function(response) {
            that.$set('statistics', response.entity);
        });
    },

    methods: {
        registerUser: function (e) {
            e.preventDefault()
            var that = this

            client({ path: '/register', entity: this.user }).then(
                function (response) {
                    that.getUserData()
                },
                function (response, status) {
                    that.messages = []
                    if (response.status && response.status.code === 422) {
                        that.messages = []
                        for (var key in response.entity) {
                            that.messages.push({type: 'danger', message: response.entity[key]})
                        }
                    }
                }
            )
        },

        getUserData: function () {
            var that = this
            client({ path: '/users/me' }).then(
                function (response) {
                    that.$dispatch('userHasLoggedIn', response.entity.user)
{'fraction_non_alphanumeric': 0.11825662907650107, 'fraction_numerical': 0.001828710758914965, 'mean_word_length': 1.1692002643754131, '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': '5704411', 'n_tokens_mistral': 833, 'n_tokens_neox': 778, 'n_words': 170}