// #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 { flipElementMemphisStyle } from './Themes/FlipElement.Memphis';
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.
 *
 * @element mosaik-flip
 * @category Primitives
 *
 * @slot back - the back slot.
 * @slot front - the front slot.
 *
 * @csspart back - The back part.
 * @csspart front - The front part.
 * @csspart root - The root part.
 *
 * @cssprop {String} --flip-font-family - The font family CSS custom property.
 * @cssprop {String} --flip-font-letter-spacing - The font letter spacing CSS custom property.
 * @cssprop {String} --flip-font-line-height - The font line height CSS custom property.
 * @cssprop {String} --flip-font-size - The font size CSS custom property.
 * @cssprop {String} --flip-font-text-decoration - The font text decoration CSS custom property.
 * @cssprop {String} --flip-font-text-transform - The font text transform CSS custom property.
 * @cssprop {String} --flip-font-weight - The font weight CSS custom property.
 * @cssprop {String} --flip-gap - The gap CSS custom property.
 * @cssprop {String} --flip-padding-bottom - The padding bottom CSS custom property.
 * @cssprop {String} --flip-padding-left - The padding left CSS custom property.
 * @cssprop {String} --flip-padding-right - The padding right CSS custom property.
 * @cssprop {String} --flip-padding-top - The padding top CSS custom property.
 * @cssprop {String} --flip-shadow - The shadow CSS custom property.
 * @cssprop {String} --flip-shadow-blur - The shadow blur CSS custom property.
 * @cssprop {String} --flip-shadow-color - The shadow color CSS custom property.
 * @cssprop {String} --flip-shadow-offset-x - The shadow offset x CSS custom property.
 * @cssprop {String} --flip-shadow-offset-y - The shadow offset y CSS custom property.
 * @cssprop {String} --flip-shadow-spread - The shadow spread CSS custom property.
 * @cssprop {String} --flip-transition-duration - The transition duration CSS custom property.
 * @cssprop {String} --flip-transition-mode - The transition mode CSS custom property.
 * @cssprop {String} --flip-transition-property - The transition property CSS custom property.
 * @cssprop {String} --flip-translate - The translate CSS custom property.
 *
 * @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 `is` property.
     * The `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,
            memphis: flipElementMemphisStyle,
            cosmopolitan: flipElementCosmopolitanStyle
        },
        imports: []
    }),
    __metadata("design:paramtypes", [])
], FlipElement);
export { FlipElement };
//# sourceMappingURL=FlipElement.js.map