<commit_before>/**
 * @file NeonMob Enhancer
 * @name Client
 *
 * Extension client script code.
 *
 * @author <NAME> <<EMAIL>>
 */

'use strict';

class ExtensionClient {
    constructor() {
        // Grab the set id integer from the data-set-id data attribute
        var setId = $('[data-set-id]').data('set-id');

        // Did we find a setId?
        if (setId > 0) {
            // Get the Set data from the API based on the setId found
            $.get('https://www.neonmob.com/api/setts/' + setId + '/', {format: 'json'})
                .done(function (data) {
                    var message = '';

                    // Have the free packs been discontinued yet?
                    if (data.freebies_discontinued == null) {
                        message = '<div>' +
                            data.percent_sold_out + '% Total Packs Claimed' +
                            '</div>';

                        // Don't show if Neonmob is already showing it
                        if ($('#status--free-packs').length === 0 || $('#status--free-packs').html().search('Free Packs Claimed Today') !== -1) {
                            message += '<div>' +
                                data.free_packs_claimed_percent + '% Free Packs Claimed' +
                                '</div>';
                        }
                    } else {
                        // If the free packs were sold out then display the date they sold out on
                        var free_soldout = new Date(data.freebies_discontinued);
                        var months = ["January", "February", "March", "April", "May", "June",
                            "July", "August", "September", "October", "November", "December"];
                        message = '<div>' +
                            'The free packs sold out on <br>' +
                            months[free_soldout.getMonth()] + ' ' +
                            free_soldout.getDate() + ', ' +
                            free_soldout.getFullYear() +
                            '</div>';
                    }

                    // Grab the stats for the core and special rarities
                    var stats = data.core_stats;
                    stats.push.apply(stats, data.special_stats);

                    // Loop through each rarity
                    stats.forEach(function (rarity) {
                        // initialize for if we are not on a variant or chase
                        var stat_padding = 'padding-left: 25px';
                        var container_type = 'div';
                        var individual_count = 'Per Print Count: ' + rarity.total_prints / rarity.total;

                        // Find the stat span
                        var stat = $('.rarity-stats--rarity-list .text-rarity-' + rarity.class_name);
                        var stat_html = stat.html();

                        // Update the odd position
                        stat.parent().find('small').css('top', 3);

                        if(rarity.name == 'chase'){
                            if(rarity.total >= 10) {
                                stat_padding = 'padding-left: 85px';
                            }else{
                                stat_padding = 'padding-left: 75px';
                            }
                            container_type = 'span';
                            individual_count = 'Total Print Count: ' + rarity.total_prints;
                        }else if(rarity.name == 'variant'){
                            if(rarity.total >= 10) {
                                stat_padding = 'padding-left: 93px';
                            }else{
                                stat_padding = 'padding-left: 83px';
                            }
                            container_type = 'span';
                            individual_count = 'Total Print Count: ' + rarity.total_prints;
                        }

                        // Build the stat html for the print counts<commit_msg>fix padding for greater than 3 digits in variants or chases<commit_after>/**
 * @file NeonMob Enhancer
 * @name Client
 *
 * Extension client script code.
 *
 * @author <NAME> <<EMAIL>>
 */

'use strict';

class ExtensionClient {
    constructor() {
        // Grab the set id integer from the data-set-id data attribute
        var setId = $('[data-set-id]').data('set-id');

        // Did we find a setId?
        if (setId > 0) {
            // Get the Set data from the API based on the setId found
            $.get('https://www.neonmob.com/api/setts/' + setId + '/', {format: 'json'})
                .done(function (data) {
                    var message = '';

                    // Have the free packs been discontinued yet?
                    if (data.freebies_discontinued == null) {
                        message = '<div>' +
                            data.percent_sold_out + '% Total Packs Claimed' +
                            '</div>';

                        // Don't show if Neonmob is already showing it
                        if ($('#status--free-packs').length === 0 || $('#status--free-packs').html().search('Free Packs Claimed Today') !== -1) {
                            message += '<div>' +
                                data.free_packs_claimed_percent + '% Free Packs Claimed' +
                                '</div>';
                        }
                    } else {
                        // If the free packs were sold out then display the date they sold out on
                        var free_soldout = new Date(data.freebies_discontinued);
                        var months = ["January", "February", "March", "April", "May", "June",
                            "July", "August", "September", "October", "November", "December"];
                        message = '<div>' +
                            'The free packs sold out on <br>' +
                            months[free_soldout.getMonth()] + ' ' +
                            free_soldout.getDate() + ', ' +
                            free_soldout.getFullYear() +
                            '</div>';
                    }

                    // Grab the stats for the core and special rarities
                    var stats = data.core_stats;
                    stats.push.apply(stats, data.special_stats);

                    // Loop through each rarity
                    stats.forEach(function (rarity) {
                        // initialize for if we are not on a variant or chase
                        var stat_padding = 'padding-left: 25px';
                        var container_type = 'div';
                        var individual_count = 'Per Print Count: ' + rarity.total_prints / rarity.total;

                        // Find the stat span
                        var stat = $('.rarity-stats--rarity-list .text-rarity-' + rarity.class_name);
                        var stat_html = stat.html();

                        // Update the odd position
                        stat.parent().find('small').css('top', 3);

                        if(rarity.name == 'chase'){
                            if(rarity.total >= 100){
                                stat_padding = 'padding-left: 95px';
                            }else if(rarity.total >= 10) {
                                stat_padding = 'padding-left: 85px';
                            }else{
                                stat_padding = 'padding-left: 75px';
                            }
                            container_type = 'span';
                            individual_count = 'Total Print Count: ' + rarity.total_prints;
                        }else if(rarity.name == 'variant'){
                            if(rarity.total >= 100) {
                                stat_padding = 'padding-left: 103px';
                            }else if(rarity.total >= 10) {
                                stat_padding = 'padding-left: 93px';
                            }else{
                                stat_padding = 'padding-left: 83px';
                            }
                            container_type = 'span';
                            individual_count = 'Total Print Count: ' + rarity.total_prints;
                        }

                        // Build the stat html for the print counts
{'fraction_non_alphanumeric': 0.10790675318433068, 'fraction_numerical': 0.005767844268204758, 'mean_word_length': 1.037952987267385, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 31, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '460092', 'n_tokens_mistral': 2099, 'n_tokens_neox': 1900, 'n_words': 529}