// #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 { Appearanceable } from '../../../Behaviors/Appearanceable';
import { Disableable } from '../../../Behaviors/Disableable';
import { Focusable } from '../../../Behaviors/Focusable';
import { Sizeable } from '../../../Behaviors/Sizeable';
import { Valueable } from '../../../Behaviors/Valueable';
import { Variantable } from '../../../Behaviors/Variantable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { ButtonType } from '../../../Types/ButtonType';
import { CustomElement } from '../../Abstracts/CustomElement';
// #endregion
/**
 * Button Base Element - The foundational base class for all button-type components.
 *
 * @description
 * ButtonBaseElement provides the core functionality and behavior patterns for all button-like
 * interactive controls in the Mosaik design system. It combines essential behaviors including
 * focus management, disabled states, visual variants, sizing, appearance modes, and value tracking.
 * This abstract class establishes the common API surface for buttons, icon buttons, toggle buttons,
 * and other clickable controls. It manages the button type attribute (button/submit/reset) which
 * determines how the button interacts with parent forms. All concrete button implementations
 * extend this base class to inherit consistent behavioral patterns and styling hooks.
 *
 * @remarks
 * The class applies multiple behavior mixins in a specific composition order: Focusable (innermost)
 * → Disableable → Valueable → Sizeable → Appearanceable → Variantable (outermost). This layering
 * ensures proper inheritance of lifecycle hooks and property override patterns.
 *
 * @name ButtonBaseElement
 * @category Abstract Elements
 *
 * @slot [dynamic] - Slots are defined by concrete button implementations
 *
 * @csspart [dynamic] - Parts are defined by concrete button implementations
 *
 * @fires connected {ConnectedEvent} - Emitted when the element is connected to the DOM
 * @fires disconnected {DisconnectedEvent} - Emitted when the element is disconnected from the DOM
 * @fires changed {PropertyChangedEvent} - Emitted when any attribute changes before update
 *
 * @example
 * Extending ButtonBaseElement to create a custom button:
 * ```typescript
 * export class IconButtonElement extends ButtonBaseElement {
 *   constructor() {
 *     super();
 *   }
 *
 *   protected override render() {
 *     return html`<button type="${this.type}"><slot></slot></button>`;
 *   }
 * }
 * ```
 *
 * @example
 * Using type property for form integration:
 * ```typescript
 * <mosaik-button type="submit">Submit Form</mosaik-button>
 * <mosaik-button type="reset">Reset Form</mosaik-button>
 * <mosaik-button type="button">Regular Button</mosaik-button>
 * ```
 *
 * @example
 * Leveraging inherited behaviors:
 * ```html
 * <custom-button
 *   variant="primary"
 *   appearance="solid"
 *   size="large"
 *   disabled
 *   value="action-id">
 *   Action
 * </custom-button>
 * ```
 *
 * @abstract
 * @public
 */
export class ButtonBaseElement extends Variantable(Appearanceable(Sizeable(Valueable(Disableable(Focusable(CustomElement)))))) {
    // #region Fields
    _type;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._type = ButtonType.Button;
    }
    // #endregion
    // #region Properties
    /**
     * Gets or sets the `type` property.
     * It modifies the classification and default behavior of the {@link ButtonElement}.
     * `submit` and `reset` are only necessary when the {@link ButtonElement} is located in a from and should control this actions.
     *
     * @public
     * @attr
     */
    get type() {
        return this._type;
    }
    set type(value) {
        if (this._type !== value) {
            this._type = value;
            this.requestUpdate('type');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @protected
     * @override
     */
    onApplyTemplate() {
        super.onApplyTemplate();
    }
}
__decorate([
    Attribute({ type: ButtonType }),
    __metadata("design:type", String),
    __metadata("design:paramtypes", [String])
], ButtonBaseElement.prototype, "type", null);
//# sourceMappingURL=ButtonBaseElement.js.map