<commit_before>/*
 @author <NAME>
 @component UIBasic
 */

screens.ui.basic = function UIBasic(me, packages) {
    const { core } = packages;
    me.tag = {
        get: function (object) {
            return object.tagName.toLowerCase();
        }
    };
    me.elementId = {
        get: function (object) {
            return object.id;
        },
        set: function (object, value) {
            object.id = value;
        }
    };
    me.src = {
        get: function (object) {
            return object.src;
        },
        set: function (object, value) {
            object.src = me.ui.image.get(value);
        }
    };
    me.ref = {
        get: function (object) {
            var ref = null;
            var parent = object.parentNode;
            if (parent) {
                if (!parent.ref) {
                    parent.ref = core.ref.gen();
                }
                ref = parent.ref;
            }
            return ref;
        },
        set: function (object, value) {
            var ref = null;
            var parent = object.parentNode;
            if (parent) {
                parent.ref = ref;
            }
        }
    };
    me.href = {
        get: function (object) {
            return object.href;
        },
        set: function (object, value) {
            object.href = value;
        }
    };
    me.htmlFor = {
        get: function (object) {
            return object.htmlFor;
        },
        set: function (object, value) {
            object.htmlFor = value;
        }
    };
    me.type = {
        get: function (object) {
            return object.type;
        },
        set: function (object, value) {
            object.type = value;
        }
    };
    me.var = {
        set: function (object, value) {
            if (value) {
                var parent = object.parentNode;
                if (object.context) {
                    parent = object.context;
                }
                if (!parent.var) {
                    parent.var = {};
                }
                value.split(",").map(value => {
                    parent.var[value] = object;
                });
            }
        }
    };
    me.context = {
        get: function (object) {
            return object.context;
        },
        set: function (object, value) {
            if (value === "self") {
                object.context = object;
            }
            else {
                object.context = value;
            }
        }
    };
    me.elements = {
        set: function (object, value) {
            if (value) {
                me.ui.element.create(value, object, object.context);
            }
        }
    };
    me.enabled = {
        get: function (object) {
            return !object.getAttribute("disabled");
        },
        set: function (object, value) {
            if (value) {
                object.removeAttribute("disabled");
            }
            else {
                object.setAttribute("disabled", true);
            }
        }
    };
    me.text = {
        get: function (object) {
            if (object.tagName && object.tagName.toLowerCase() === "input") {
                return object.value;
            }
            return object.textContent;
        },
        set: function (object, value) {
            if (typeof value !== "undefined") {
                if (object.tagName && object.tagName.toLowerCase() === "input") {
                    object.value = value;
                }
                else {
                    object.textContent = value;
                }
            }
        }
    };
    me.html = {
        get: function (object) {
            return object.innerHTML;
        },
        set: function (object, value) {
            object.innerHTML = value;
            me.ui.theme.updateElements(object.parentNode);
        }
    };
    me.readOnly = {
        get: function (object) {
            return object.readOnly;
        },
        set: function (object, value) {
            object.readOnly = value;
        }
    };
    me.draggable = {<commit_msg>bug fix<commit_after>/*
 @author <NAME>
 @component UIBasic
 */

screens.ui.basic = function UIBasic(me, packages) {
    const { core } = packages;
    me.tag = {
        get: function (object) {
            return object.tagName.toLowerCase();
        }
    };
    me.elementId = {
        get: function (object) {
            return object.id;
        },
        set: function (object, value) {
            object.id = value;
        }
    };
    me.src = {
        get: function (object) {
            return object.src;
        },
        set: function (object, value) {
            object.src = me.ui.image.get(value);
        }
    };
    me.ref = {
        get: function (object) {
            var ref = null;
            var parent = object.parentNode;
            if (parent) {
                if (!parent.ref) {
                    parent.ref = core.ref.gen();
                }
                ref = parent.ref;
            }
            return ref;
        },
        set: function (object, value) {
            var ref = null;
            var parent = object.parentNode;
            if (parent) {
                parent.ref = ref;
            }
        }
    };
    me.href = {
        get: function (object) {
            return object.href;
        },
        set: function (object, value) {
            object.href = value;
        }
    };
    me.htmlFor = {
        get: function (object) {
            return object.htmlFor;
        },
        set: function (object, value) {
            object.htmlFor = value;
        }
    };
    me.type = {
        get: function (object) {
            return object.type;
        },
        set: function (object, value) {
            object.type = value;
        }
    };
    me.var = {
        set: function (object, value) {
            if (value) {
                var parent = object.parentNode;
                if (object.context) {
                    parent = object.context;
                }
                if (!parent.var) {
                    parent.var = {};
                }
                value.split(",").map(value => {
                    parent.var[value] = object;
                });
            }
        }
    };
    me.context = {
        get: function (object) {
            return object.context;
        },
        set: function (object, value) {
            if (value === "self") {
                object.context = object;
            }
            else {
                object.context = value;
            }
        }
    };
    me.elements = {
        set: function (object, value) {
            if (value) {
                me.ui.element.create(value, object, object.context);
            }
        }
    };
    me.enabled = {
        get: function (object) {
            return !object.getAttribute("disabled");
        },
        set: function (object, value) {
            if (value) {
                object.removeAttribute("disabled");
            }
            else {
                object.setAttribute("disabled", true);
            }
        }
    };
    me.text = {
        get: function (object) {
            if (object.tagName && object.tagName.toLowerCase() === "input") {
                return object.value;
            }
            return object.textContent;
        },
        set: function (object, value) {
            if (typeof value !== "undefined") {
                if (object.tagName && object.tagName.toLowerCase() === "input") {
                    object.value = value;
                }
                else {
                    object.textContent = value;
                }
            }
        }
    };
    me.html = {
        get: function (object) {
            if (object.tagName && object.tagName.toLowerCase() === "input") {
                return object.value;
            }
            return object.innerHTML;
        },
        set: function (object, value) {
            if (object.tagName && object.tagName.toLowerCase() === "input") {
                object.value = value;
            }
            else {
                object.innerHTML = value;
                me.ui.theme.updateElements(object.parentNode);
            }
        }
    };
    me.readOnly = {
        get: function (object) {
            return object.readOnly;
        },
        set: function (object, value) {
            object.readOnly = value;
        }
    };
    me.draggable = {
{'fraction_non_alphanumeric': 0.11993879472693032, 'fraction_numerical': 0.0, 'mean_word_length': 1.0714285714285714, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6173604', 'n_tokens_mistral': 2274, 'n_tokens_neox': 2241, 'n_words': 476}