<commit_before>(function ($) {

    /**
     * UI object for the live event view
     *
     */
    var liveEntry = {


        /**
         * Stores the ID for the current event
         * this is pulled from the url and dumped on the page
         * then stored in this variable
         *
         * @type integer
         */
        currentEventId: null,

        /**
         * When you type in a bib number into the live entry form this is set
         *
         * @type integer
         */
        currentEffortId: null,

        eventLiveEntryData: null,

        lastReportedSplitId: null,

        lastReportedBitkey: null,

        splitId: null,


        getEventLiveEntryData: function () {
            return $.get('/live/events/' + liveEntry.currentEventId + '/get_event_data', function (response) {
                liveEntry.eventLiveEntryData = response

            })

        },

        /**
         * This kicks off the full UI
         *
         */
        init: function () {
            // localStorage.clear();

            // Sets the currentEventId once
            liveEntry.currentEventId = $('#js-event-id').text();
            liveEntry.getEventLiveEntryData().done(function () {
                liveEntry.effortsCache.init();
                liveEntry.header.init();
                liveEntry.liveEntryForm.init();
                liveEntry.effortsDataTable.init();
                liveEntry.splitSlider.init();
            });
        },

        /**
         * Contains functionality for the efforts cache
         *
         */
        effortsCache: {

            /**
             * Inits the efforts cache
             *
             */
            init: function () {

                // Set the initial cache object in local storage
                var effortsCache = localStorage.getItem('effortsCache');
                if (effortsCache === null || effortsCache.length == 0) {
                    localStorage.setItem('effortsCache', JSON.stringify([]));
                }
            },

            /**
             * Get local data Efforts Storage Object
             *
             * @return object Returns object from local storage
             */
            getStoredEfforts: function () {
                return JSON.parse(localStorage.getItem('effortsCache'))
            },

            /**
             * Stringify then Save/Push all efforts to local object
             *
             * @param object effortsObject Pass in the object of the updated object with all added or removed objects.
             * @return null
             */
            setStoredEfforts: function (effortsObject) {
                localStorage.setItem('effortsCache', JSON.stringify(effortsObject));
                return null;
            },

            /**
             * Delete the matching effort
             *
             * @param object    effort    Pass in the object/effort we want to delete.
             * @return null
             */
            deleteStoredEffort: function (effort) {
                var storedEfforts = liveEntry.effortsCache.getStoredEfforts();
                $.each(storedEfforts, function (index) {
                    if (this.uniqueId == effort.uniqueId) {
                        storedEfforts = storedEfforts.slice(index + 1);
                        return false;
                    }
                });
                localStorage.setItem('effortsCache', JSON.stringify(storedEfforts));
                return null;
            },

            /**
             * Compare effort to all efforts in local storage. Add if it doesn't already exist, or throw an error message.
             *
             * @param  object effort Pass in Object of the effort to check it against the stored objects         *
             * @return boolean    True if match found, False if no match found
             */
            isMatchedEffort: function (effort) {
                var storedEfforts = liveEntry.effortsCache.getStoredEfforts();
                var tempEffort = JSON.stringify(effort);
                var flag = false;

                $.each(storedEfforts, function () {
                    var loopedEffort = JSON.stringify($(this));
                    if (loopedEffort == tempEffort) {
                        flag = true;
                    }
                });

                if (flag == false) {
                    return false;
                } else {
                    return true;
                }
                ;
            },
        },
        /**
         * Functionality to build header lives here
         *
         */
        header: {
            init: function () {
                liveEntry.header.updateEventName();
                liveEntry.header.buildSplitSelect();
            },

            /**
             * Populate the h2 with the eventName
             *
             */
            updateEventName: function () {
                $('.page-title h2').text(liveEntry.eventLiveEntryData.eventName);
            },

            /**
             * Add the Splits data to the select drop down table on the page
             *
             */
            buildSplitSelect: function () {

                // Populate select list with event splits
                // Sub_split_in and sub_split_out are boolean fields indicating the existence of in and out time fields respectively.
                var splitItems = '';
                for (var i = 0; i < liveEntry.eventLiveEntryData.splits.length; i++) {
                    splitItems += '<option value="' + liveEntry.eventLiveEntryData.splits[i].base_name + '" data-sub-split-in="' + liveEntry.eventLiveEntryData.splits[i].sub_split_in + '" data-sub-split-out="' + liveEntry.eventLiveEntryData.splits[i].sub_split_out + '" data-split-id="' + liveEntry.eventLiveEntryData.splits[i].id + '" >' + liveEntry.eventLiveEntryData.splits[i].base_name + '</option>';
                }
                $('#split-select').html(splitItems);
            },
        },

        /**
         * Contains functionality for the effort form
         *
         */
        liveEntryForm: {
            init: function () {
                // Apply input masks on time in / out
                var maskOptions = {<commit_msg>Remove start from dropdown menu on live_entry page.<commit_after>(function ($) {

    /**
     * UI object for the live event view
     *
     */
    var liveEntry = {


        /**
         * Stores the ID for the current event
         * this is pulled from the url and dumped on the page
         * then stored in this variable
         *
         * @type integer
         */
        currentEventId: null,

        /**
         * When you type in a bib number into the live entry form this is set
         *
         * @type integer
         */
        currentEffortId: null,

        eventLiveEntryData: null,

        lastReportedSplitId: null,

        lastReportedBitkey: null,

        splitId: null,


        getEventLiveEntryData: function () {
            return $.get('/live/events/' + liveEntry.currentEventId + '/get_event_data', function (response) {
                liveEntry.eventLiveEntryData = response

            })

        },

        /**
         * This kicks off the full UI
         *
         */
        init: function () {
            // localStorage.clear();

            // Sets the currentEventId once
            liveEntry.currentEventId = $('#js-event-id').text();
            liveEntry.getEventLiveEntryData().done(function () {
                liveEntry.effortsCache.init();
                liveEntry.header.init();
                liveEntry.liveEntryForm.init();
                liveEntry.effortsDataTable.init();
                liveEntry.splitSlider.init();
            });
        },

        /**
         * Contains functionality for the efforts cache
         *
         */
        effortsCache: {

            /**
             * Inits the efforts cache
             *
             */
            init: function () {

                // Set the initial cache object in local storage
                var effortsCache = localStorage.getItem('effortsCache');
                if (effortsCache === null || effortsCache.length == 0) {
                    localStorage.setItem('effortsCache', JSON.stringify([]));
                }
            },

            /**
             * Get local data Efforts Storage Object
             *
             * @return object Returns object from local storage
             */
            getStoredEfforts: function () {
                return JSON.parse(localStorage.getItem('effortsCache'))
            },

            /**
             * Stringify then Save/Push all efforts to local object
             *
             * @param object effortsObject Pass in the object of the updated object with all added or removed objects.
             * @return null
             */
            setStoredEfforts: function (effortsObject) {
                localStorage.setItem('effortsCache', JSON.stringify(effortsObject));
                return null;
            },

            /**
             * Delete the matching effort
             *
             * @param object    effort    Pass in the object/effort we want to delete.
             * @return null
             */
            deleteStoredEffort: function (effort) {
                var storedEfforts = liveEntry.effortsCache.getStoredEfforts();
                $.each(storedEfforts, function (index) {
                    if (this.uniqueId == effort.uniqueId) {
                        storedEfforts = storedEfforts.slice(index + 1);
                        return false;
                    }
                });
                localStorage.setItem('effortsCache', JSON.stringify(storedEfforts));
                return null;
            },

            /**
             * Compare effort to all efforts in local storage. Add if it doesn't already exist, or throw an error message.
             *
             * @param  object effort Pass in Object of the effort to check it against the stored objects         *
             * @return boolean    True if match found, False if no match found
             */
            isMatchedEffort: function (effort) {
                var storedEfforts = liveEntry.effortsCache.getStoredEfforts();
                var tempEffort = JSON.stringify(effort);
                var flag = false;

                $.each(storedEfforts, function () {
                    var loopedEffort = JSON.stringify($(this));
                    if (loopedEffort == tempEffort) {
                        flag = true;
                    }
                });

                if (flag == false) {
                    return false;
                } else {
                    return true;
                }
                ;
            },
        },
        /**
         * Functionality to build header lives here
         *
         */
        header: {
            init: function () {
                liveEntry.header.updateEventName();
                liveEntry.header.buildSplitSelect();
            },

            /**
             * Populate the h2 with the eventName
             *
             */
            updateEventName: function () {
                $('.page-title h2').text(liveEntry.eventLiveEntryData.eventName);
            },

            /**
             * Add the Splits data to the select drop down table on the page
             *
             */
            buildSplitSelect: function () {

                // Populate select list with event splits
                // Sub_split_in and sub_split_out are boolean fields indicating the existence of in and out time fields respectively.
                var splitItems = '';
                for (var i = 1; i < liveEntry.eventLiveEntryData.splits.length; i++) {
                    splitItems += '<option value="' + liveEntry.eventLiveEntryData.splits[i].base_name + '" data-sub-split-in="' + liveEntry.eventLiveEntryData.splits[i].sub_split_in + '" data-sub-split-out="' + liveEntry.eventLiveEntryData.splits[i].sub_split_out + '" data-split-id="' + liveEntry.eventLiveEntryData.splits[i].id + '" >' + liveEntry.eventLiveEntryData.splits[i].base_name + '</option>';
                }
                $('#split-select').html(splitItems);
            },
        },

        /**
         * Contains functionality for the effort form
         *
         */
        liveEntryForm: {
            init: function () {
                // Apply input masks on time in / out
                var maskOptions = {
{'fraction_non_alphanumeric': 0.09295483460559796, 'fraction_numerical': 0.0007951653944020356, 'mean_word_length': 1.303058047976561, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2631068', 'n_tokens_mistral': 3113, 'n_tokens_neox': 2941, 'n_words': 785}