// #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 { HTMLElementEventEmitter } from '@breadstone/mosaik-elements';
import { Emit } from '../../../../events/Decorators/EmitDecorator';
import { Disableable } from '../../../Behaviors/Disableable';
import { Orientable } from '../../../Behaviors/Orientable';
import { Themeable } from '../../../Behaviors/Themeable';
import { Variantable } from '../../../Behaviors/Variantable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { CustomElement } from '../../Abstracts/CustomElement';
import { indicatorElementTemplate } from './IndicatorElementTemplate';
import { indicatorElementCosmopolitanStyle } from './Themes/IndicatorElement.Cosmopolitan';
import { indicatorElementJoyStyle } from './Themes/IndicatorElement.Joy';
import { indicatorElementMemphisStyle } from './Themes/IndicatorElement.Memphis';
// #endregion
/**
 * Indicator - A visual navigation element showing current position within a set of items.
 *
 * @description
 * The Indicator element displays a series of clickable dots or markers representing pagination,
 * carousel positions, or step progress. Users can click individual indicators to navigate directly
 * to specific items. The active indicator is visually distinguished to show the current position.
 * Commonly used in image carousels, onboarding flows, multi-step forms, and slideshow components.
 *
 * @name Indicator
 * @element mosaik-indicator
 * @category Primitives
 *
 * @csspart list - The container list element for all indicator items
 * @csspart listItem - Individual indicator dot/marker element
 *
 * @cssprop {String} --indicator-background-color - Background color of inactive indicators
 * @cssprop {String} --indicator-border-color - Border color of indicators
 * @cssprop {String} --indicator-border-radius - Border radius of indicator dots
 * @cssprop {String} --indicator-border-style - Border style (solid, dashed, etc.)
 * @cssprop {String} --indicator-border-width - Border width of indicators
 * @cssprop {String} --indicator-font-family - Font family for indicator text (if any)
 * @cssprop {String} --indicator-font-size - Font size for indicator numbers
 * @cssprop {String} --indicator-font-weight - Font weight for indicator text
 * @cssprop {String} --indicator-foreground-color - Color of active/text indicators
 * @cssprop {String} --indicator-gap - Spacing between individual indicators
 * @cssprop {String} --indicator-shadow - Shadow applied to indicator dots
 * @cssprop {String} --indicator-transition-duration - Duration of state change animations
 * @cssprop {String} --indicator-transition-mode - Timing function for transitions
 * @cssprop {String} --indicator-transition-property - CSS properties to animate
 *
 * @fires indicated {IndicatedEvent} - Fired when user clicks an indicator, includes selected index
 *
 * @example
 * Basic carousel indicator:
 * ```html
 * <div class="carousel">
 *   <div class="carousel-track" id="track">
 *     <div class="slide">Slide 1</div>
 *     <div class="slide">Slide 2</div>
 *     <div class="slide">Slide 3</div>
 *     <div class="slide">Slide 4</div>
 *   </div>
 *   <mosaik-indicator id="carouselIndicator" total="4" selected="0"></mosaik-indicator>
 * </div>
 *
 * <script>
 *   const indicator = document.getElementById('carouselIndicator');
 *   indicator.addEventListener('indicated', (e) => {
 *     document.getElementById('track').scrollTo({
 *       left: e.detail.index * 300,
 *       behavior: 'smooth'
 *     });
 *   });
 * </script>
 * ```
 *
 * @example
 * Onboarding stepper:
 * ```html
 * <div class="onboarding">
 *   <div id="step-content">Welcome to Step 1</div>
 *   <mosaik-indicator
 *     id="stepper"
 *     total="5"
 *     selected="0"
 *     variant="primary"
 *     orientation="horizontal">
 *   </mosaik-indicator>
 * </div>
 *
 * <script>
 *   const stepper = document.getElementById('stepper');
 *   stepper.addEventListener('indicated', (e) => {
 *     loadStep(e.detail.index);
 *   });
 * </script>
 * ```
 *
 * @example
 * Vertical progress indicator:
 * ```html
 * <mosaik-indicator
 *   total="6"
 *   selected="2"
 *   orientation="vertical"
 *   variant="success">
 * </mosaik-indicator>
 * ```
 *
 * @public
 */
let IndicatorElement = class IndicatorElement extends Themeable(Disableable(Variantable(Orientable(CustomElement)))) {
    // #region Fields
    _indicated;
    _total;
    _selected;
    // #endregion
    // #region Ctor
    constructor() {
        super();
        this._total = 0;
        this._selected = 0;
        this._indicated = new HTMLElementEventEmitter(this, 'indicated');
    }
    // #endregion
    // #region Properties
    /**
     * Returns the `is` property.
     *
     * @public
     * @static
     * @readonly
    */
    static get is() {
        return 'mosaik-indicator';
    }
    /**
     * Gets or sets the `total` count of indicators.
     *
     * @attr
     * @public
     */
    get total() {
        return this._total;
    }
    set total(value) {
        if (this._total !== value) {
            this._total = value;
            this.requestUpdate('total');
        }
    }
    /**
     * Gets or sets the `selected` indicator.
     *
     * @attr
     * @public
     */
    get selected() {
        return this._selected;
    }
    set selected(value) {
        if (this._selected !== value) {
            this._selected = value;
            this.requestUpdate('selected');
        }
    }
    /**
     * Called when the indicated value changes.
     * Provides reference to `any` as event argument.
     *
     * @public
     * @readonly
     * @eventProperty
     * @type EventEmitter<any>
     */
    get indicated() {
        return this._indicated;
    }
    // #endregion
    // #region Methods
    /**
     * @private
     * @template
     */
    onItemClick(index) {
        if (this.disabled || index < 0 || index >= this.total) {
            return;
        }
        this.selected = index;
        this.onIndicated({ index: index });
    }
    /**
     * Emits the {@link indicated} event.
     *
     * @protected
     */
    onIndicated(args) {
        this._indicated.emit(args);
    }
};
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], IndicatorElement.prototype, "total", null);
__decorate([
    Attribute({ type: Number }),
    __metadata("design:type", Number),
    __metadata("design:paramtypes", [Number])
], IndicatorElement.prototype, "selected", null);
__decorate([
    Emit({ eventName: 'indicated' }),
    __metadata("design:type", Object),
    __metadata("design:paramtypes", [])
], IndicatorElement.prototype, "indicated", null);
IndicatorElement = __decorate([
    Component({
        selector: 'mosaik-indicator',
        template: indicatorElementTemplate,
        themes: {
            joy: indicatorElementJoyStyle,
            memphis: indicatorElementMemphisStyle,
            cosmopolitan: indicatorElementCosmopolitanStyle
        }
    }),
    __metadata("design:paramtypes", [])
], IndicatorElement);
export { IndicatorElement };
//# sourceMappingURL=IndicatorElement.js.map