// #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 { Disableable } from '../../../Behaviors/Disableable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { flipElementTemplate } from './FlipElementTemplate';
import { flipElementJoyStyle } from './Themes/FlipElement.Joy';
import { flipElementRetroStyle } from './Themes/FlipElement.Retro';
import { flipElementCosmopolitanStyle } from './Themes/FlipElement.Cosmopolitan';
import { Themeable } from '../../../Behaviors/Themeable';
import { FlipSide } from '../../../Types/FlipSide';
// #endregion
/**
 * Flip - A UI element that can be flipped by 180 degrees when activated.
 *
 * @description
 * The Flip component is designed to visually flip or rotate by 180 degrees when checked or activated. It's often used
 * to toggle between two different views or states, providing a dynamic user interface element.
 *
 * @category Primitives
 *
 * @element mosaik-flip
 *
 * @slot front - the front slot.
 * @slot back - the back slot.
 *
 * @csspart root - The root part.
 * @csspart front - The front part.
 * @csspart back - The back part.
 *
 * @example
 * ```html
 * <mosaik-flip>
 *     <!-- swipe content -->
 *     <div slot="front">Front</div>
 *     <!-- back content -->
 *     <div slot="back">Back</div>
 * </mosaik-flip>
 * ```
 *
 * @public
 */
let FlipElement = class FlipElement extends Themeable(Disableable(CustomElement)) {
    // #region Fields
    _side;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._side = FlipSide.Front;
    }
    // #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-flip';
    }
    /**
     * Gets or sets the `isFlipped` property.
     *
     * @public
     * @attr
     */
    get side() {
        return this._side;
    }
    set side(value) {
        if (this.disabled) {
            return;
        }
        if (this._side !== value) {
            this._side = value;
            this.requestUpdate('side');
        }
    }
    // #endregion
    // #region Methods
    /**
     * Toggles the flip state of the element.
     *
     * @public
     */
    toggle() {
        if (this.disabled) {
            return;
        }
        this.side = this._side === FlipSide.Front
            ? FlipSide.Back
            : FlipSide.Front;
    }
};
__decorate([
    Attribute({ type: FlipSide }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], FlipElement.prototype, "side", null);
FlipElement = __decorate([
    Component({
        selector: 'mosaik-flip',
        template: flipElementTemplate,
        themes: {
            joy: flipElementJoyStyle,
            retro: flipElementRetroStyle,
            cosmopolitan: flipElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], FlipElement);
export { FlipElement };
//# sourceMappingURL=FlipElement.js.map