// #region Imports
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { RendererServiceLocator } from '../../../../Dom/Renderer';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { Watch } from '../../../Decorators/WatchDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { absoluteItemElementJoyStyle } from './Themes/AbsoluteItemElement.Joy';
import { absoluteItemElementTemplate } from './AbsoluteItemElementTemplate';
import { Themeable } from '../../../Behaviors/Themeable';
import { absoluteItemElementRetroStyle } from './Themes/AbsoluteItemElement.Retro';
import { absoluteItemElementCosmopolitanStyle } from './Themes/AbsoluteItemElement.Cosmopolitan';
// #endregion
/**
 * The `{@link AbsoluteItemElement}` element.
 *
 * @slot - The default slot for placing child elements.
 *
 * @public
 */
let AbsoluteItemElement = class AbsoluteItemElement extends Themeable(CustomElement) {
    // #region Fields
    _left;
    _top;
    _bottom;
    _right;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._left = undefined;
        this._top = undefined;
        this._bottom = undefined;
        this._right = undefined;
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `{@link is}` property.
     * The `{@link is}` property represents natural name of this element.
     *
     * @public
     * @static
     * @readonly
     */
    static get is() {
        return 'mosaik-absolute-item';
    }
    /**
     * Gets or sets the `left` property.
     *
     * @public
     * @attr
     */
    get left() {
        return this._left;
    }
    set left(value) {
        if (this._left !== value) {
            this._left = value;
            this.requestUpdate('left');
        }
    }
    /**
     * Gets or sets the `top` property.
     *
     * @public
     * @attr
     */
    get top() {
        return this._top;
    }
    set top(value) {
        if (this._top !== value) {
            this._top = value;
            this.requestUpdate('top');
        }
    }
    /**
     * Gets or sets the `bottom` property.
     *
     * @public
     * @attr
     */
    get bottom() {
        return this._bottom;
    }
    set bottom(value) {
        if (this._bottom !== value) {
            this._bottom = value;
            this.requestUpdate('bottom');
        }
    }
    /**
     * Gets or sets the `right` property.
     *
     * @public
     * @attr
     */
    get right() {
        return this._right;
    }
    set right(value) {
        if (this._right !== value) {
            this._right = value;
            this.requestUpdate('right');
        }
    }
    // #endregion
    // #region Methods
    /**
     * The onLeftPropertyChanged will be called when the `left` property changes.
     *
     * @protected
     */
    onLeftPropertyChanged(prev, next) {
        if (prev !== next) {
            if (next !== null && next !== undefined) {
                RendererServiceLocator.current.setStyle(this, 'left', next.toString());
            }
        }
    }
    /**
     * The property change callback for the `top` property.
     *
     * @protected
     */
    onTopPropertyChanged(prev, next) {
        if (prev !== next) {
            if (next !== null && next !== undefined) {
                RendererServiceLocator.current.setStyle(this, 'top', next.toString());
            }
        }
    }
    /**
     * The property change callback for the `bottom` property.
     *
     * @protected
     */
    onBottomPropertyChanged(prev, next) {
        if (prev !== next) {
            if (next !== null && next !== undefined) {
                RendererServiceLocator.current.setStyle(this, 'bottom', next.toString());
            }
        }
    }
    /**
     * The property change callback for the `right` property.
     *
     * @protected
     */
    onRightPropertyChanged(prev, next) {
        if (prev !== next) {
            if (next !== null && next !== undefined) {
                RendererServiceLocator.current.setStyle(this, 'right', next.toString());
            }
        }
    }
};
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], AbsoluteItemElement.prototype, "left", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], AbsoluteItemElement.prototype, "top", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], AbsoluteItemElement.prototype, "bottom", null);
__decorate([
    Attribute({ type: String }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [Object])
], AbsoluteItemElement.prototype, "right", null);
__decorate([
    Watch('left'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], AbsoluteItemElement.prototype, "onLeftPropertyChanged", null);
__decorate([
    Watch('top'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], AbsoluteItemElement.prototype, "onTopPropertyChanged", null);
__decorate([
    Watch('bottom'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], AbsoluteItemElement.prototype, "onBottomPropertyChanged", null);
__decorate([
    Watch('right'),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object, Object]),
    __metadata("design:returntype", void 0)
], AbsoluteItemElement.prototype, "onRightPropertyChanged", null);
AbsoluteItemElement = __decorate([
    Component({
        selector: 'mosaik-absolute-item',
        template: absoluteItemElementTemplate,
        themes: {
            joy: absoluteItemElementJoyStyle,
            retro: absoluteItemElementRetroStyle,
            cosmopolitan: absoluteItemElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], AbsoluteItemElement);
export { AbsoluteItemElement };
//# sourceMappingURL=AbsoluteItemElement.js.map