"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const attr_1 = require("./attr");
const element_1 = require("./element");
const propHandler_1 = require("./propHandler");
const style_1 = require("./style");
class HTMLElement_ extends element_1.Element {
    constructor($props, $system, $element, $defaultStyle, $defaultAttr = {}, $propHandlers = {}) {
        super({ ...$props, style: { ...$defaultStyle, ...$props.style } }, $system);
        const { className, style, attr } = this.$props;
        this.$element = $element;
        this.$defaultStyle = $defaultStyle;
        if (className) {
            this.$element.className = className;
        }
        (0, attr_1.applyAttr)(this.$element, { ...$defaultAttr, ...attr }, {});
        (0, style_1.applyDynamicStyle)(this, this.$element, { ...$defaultStyle, ...style });
        this.$propHandler = {
            ...(0, propHandler_1.htmlPropHandler)(this, this.$element, $defaultStyle, $defaultAttr),
            ...$propHandlers,
        };
    }
    onPropChanged(prop, current, prev) {
        this.$propHandler[prop](current, prev);
    }
}
exports.default = HTMLElement_;
//# sourceMappingURL=html.js.map