<commit_before>import Id from 'septima-utils/id';
import Ui from 'kenga/utils';
import Container from 'kenga/container';

class Box extends Container {
    constructor(orientation, hgap, vgap) {
        super();

        const self = this;

        if (arguments.length < 3)
            vgap = 0;
        if (arguments.length < 2)
            hgap = 0;
        if (arguments.length < 1)
            orientation = Ui.Orientation.HORIZONTAL;

        this.element.classList.add('p-box-horizontal');
        this.element.classList.add('p-vertical-scroll-filler');
        this.element.id = `p-${Id.generate()}`;

        const gapsStyle = document.createElement('style');
        this.element.appendChild(gapsStyle);

        function formatChildren() {
            if (orientation === Ui.Orientation.HORIZONTAL) {
                self.element.classList.remove('p-box-vertical');
                self.element.classList.remove('p-horizontal-scroll-filler');
                self.element.classList.add('p-box-horizontal');
                self.element.classList.add('p-vertical-scroll-filler');
                gapsStyle.innerHTML =
                    `div#${self.element.id} > .p-widget {height: 100%;display: inline-block;}div#${self.element.id} > .p-widget:nth-child(n + ${3}) {margin-left: ${hgap}px;}`;
            } else {
                self.element.classList.remove('p-box-horizontal');
                self.element.classList.remove('p-vertical-scroll-filler');
                self.element.classList.add('p-box-vertical');
                self.element.classList.add('p-horizontal-scroll-filler');
                gapsStyle.innerHTML =
                    `div#${self.element.id} > .p-widget {display: block;}div#${self.element.id} > .p-widget:nth-child(n + ${3}) {margin-top: ${vgap}px;}`;
            }
        }
        formatChildren();

        Object.defineProperty(this, "hgap", {
            get: function() {
                return hgap;
            },
            set: function(aValue) {
                if (hgap >= 0 && hgap !== aValue) {
                    hgap = aValue;
                    formatChildren();
                }
            }
        });
        Object.defineProperty(this, "vgap", {
            configurable: true,
            get: function() {
                return vgap;
            },
            set: function(aValue) {
                if (vgap >= 0 && vgap !== aValue) {
                    vgap = aValue;
                    formatChildren();
                }
            }
        });
        Object.defineProperty(this, "orientation", {
            configurable: true,
            get: function() {
                return orientation;
            },
            set: function(aValue) {
                if (orientation !== aValue) {
                    orientation = aValue;
                    formatChildren();
                }
            }
        });

        const superAdd = this.add;

        function add(w) {
            if (orientation === Ui.Orientation.HORIZONTAL) {
                superAdd(w);
            } else {
                superAdd(w);
            }
        }
        Object.defineProperty(this, 'add', {
            get: function() {
                return add;
            }
        });

        function ajustLeft(w, aValue) {}
        Object.defineProperty(this, 'ajustLeft', {
            get: function() {
                return ajustLeft;
            }
        });

        function ajustWidth(w, aValue) {
            if (orientation === Ui.Orientation.HORIZONTAL) {
                w.element.style.width = `${aValue}px`;
            }
        }
        Object.defineProperty(this, 'ajustWidth', {
            get: function() {
                return ajustWidth;<commit_msg>Ensuring commit<commit_after>import Id from 'septima-utils/id';
import Ui from 'kenga/utils';
import Container from 'kenga/container';

class Box extends Container {
    constructor(orientation, hgap, vgap) {
        super();

        const self = this;

        if (arguments.length < 3)
            vgap = 0;
        if (arguments.length < 2)
            hgap = 0;
        if (arguments.length < 1)
            orientation = Ui.Orientation.HORIZONTAL;

        this.element.classList.add('p-box-horizontal');
        this.element.classList.add('p-vertical-scroll-filler');
        this.element.id = `p-${Id.generate()}`;

        const gapsStyle = document.createElement('style');
        this.element.appendChild(gapsStyle);

        function formatChildren() {
            if (orientation === Ui.Orientation.HORIZONTAL) {
                self.element.classList.remove('p-box-vertical');
                self.element.classList.remove('p-horizontal-scroll-filler');
                self.element.classList.add('p-box-horizontal');
                self.element.classList.add('p-vertical-scroll-filler');
                gapsStyle.innerHTML =
                    `div#${self.element.id} > .p-widget {height: 100%;display: inline-block;}div#${self.element.id} > .p-widget:nth-child(n + ${3}) {margin-left: ${hgap}px;}`;
            } else {
                self.element.classList.remove('p-box-horizontal');
                self.element.classList.remove('p-vertical-scroll-filler');
                self.element.classList.add('p-box-vertical');
                self.element.classList.add('p-horizontal-scroll-filler');
                gapsStyle.innerHTML =
                    `div#${self.element.id} > .p-widget {display: block;}div#${self.element.id} > .p-widget:nth-child(n + ${3}) {margin-top: ${vgap}px;}`;
            }
        }
        formatChildren();

        Object.defineProperty(this, 'hgap', {
            get: function() {
                return hgap;
            },
            set: function(aValue) {
                if (hgap >= 0 && hgap !== aValue) {
                    hgap = aValue;
                    formatChildren();
                }
            }
        });
        Object.defineProperty(this, 'vgap', {
            configurable: true,
            get: function() {
                return vgap;
            },
            set: function(aValue) {
                if (vgap >= 0 && vgap !== aValue) {
                    vgap = aValue;
                    formatChildren();
                }
            }
        });
        Object.defineProperty(this, 'orientation', {
            configurable: true,
            get: function() {
                return orientation;
            },
            set: function(aValue) {
                if (orientation !== aValue) {
                    orientation = aValue;
                    formatChildren();
                }
            }
        });

        function ajustLeft(w, aValue) {}
        Object.defineProperty(this, 'ajustLeft', {
            get: function() {
                return ajustLeft;
            }
        });

        function ajustWidth(w, aValue) {
            if (orientation === Ui.Orientation.HORIZONTAL) {
                w.element.style.width = `${aValue}px`;
            }
        }
        Object.defineProperty(this, 'ajustWidth', {
            get: function() {
                return ajustWidth;
{'fraction_non_alphanumeric': 0.13322138259165967, 'fraction_numerical': 0.0033585222502099076, 'mean_word_length': 1.4670348636520538, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '6462153', 'n_tokens_mistral': 2049, 'n_tokens_neox': 1924, 'n_words': 323}