// #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 { Themeable } from '../../../../Controls/Behaviors/Themeable';
import { Attribute } from '../../../Decorators/AttributeDecorator';
import { Component } from '../../../Decorators/ComponentDecorator';
import { QueryAssignedElements } from '../../../Decorators/Decorators';
import { CustomElement } from '../../Abstracts/CustomElement';
import { breadcrumbElementTemplate } from './BreadcrumbElementTemplate';
import { BreadcrumbItemElement } from './BreadcrumbItemElement';
import { breadcrumbElementJoyStyle } from './Themes/BreadcrumbElement.Joy';
import { breadcrumbElementMemphisStyle } from './Themes/BreadcrumbElement.Memphis';
import { breadcrumbElementCosmopolitanStyle } from './Themes/BreadcrumbElement.Cosmopolitan';
// #endregion
/**
 * Breadcrumb - A component for displaying a navigational trail to indicate the user's current location within a hierarchy.
 *
 * @description
 * The `Breadcrumb` component is used to provide a visual representation of the user's navigation path within an application.
 * It allows users to navigate back to a previous level or section in the hierarchy by interacting with the breadcrumb links.
 * This component is commonly used in applications with hierarchical structures like websites, file explorers, or navigation systems.
 *
 * @name Breadcrumb
 * @element mosaik-breadcrumb
 * @category Navigation
 *
 * @dependency {BreadcrumbElement} - The Breadcrumb element.
 *
 * @example
 * ```html
 * <mosaik-breadcrumb>
 *   <mosaik-breadcrumb-item href="/home">Home</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item href="/category">Category</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item href="/subcategory">Subcategory</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item>Current Page</mosaik-breadcrumb-item>
 * </mosaik-breadcrumb>
 * ```
 *
 * @public
 */
let BreadcrumbElement = class BreadcrumbElement extends Themeable(CustomElement) {
    // #region Fields
    _breadcrumbs;
    _wrap;
    // #endregion
    // #region Ctor
    /**
     * @public
     */
    constructor() {
        super();
        this._wrap = false;
    }
    // #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-breadcrumb';
    }
    /**
     * Gets or sets the `wrap` property.
     *
     * @public
     * @attr
     */
    get wrap() {
        return this._wrap;
    }
    set wrap(value) {
        if (this._wrap !== value) {
            this._wrap = value;
            this.requestUpdate('wrap');
        }
    }
    // #endregion
    // #region Methods
    /**
     * @internal
     * @template
     */
    onSlotChange(event) {
        const assignedElements = event.target.assignedElements();
        assignedElements.forEach((x, i) => {
            if (x.tagName.toLowerCase().includes(BreadcrumbItemElement.is)) {
                x.requestUpdate();
                x.classList.add('breadcrumb-item');
                x.classList.toggle('first', i === 0);
                x.classList.toggle('inner', i > 0 && i < assignedElements.length - 1);
                x.classList.toggle('last', i === assignedElements.length - 1);
            }
        });
    }
};
__decorate([
    QueryAssignedElements({
        slot: 'actions',
        selector: BreadcrumbItemElement.is
    }),
    __metadata("design:type", Array)
], BreadcrumbElement.prototype, "_breadcrumbs", void 0);
__decorate([
    Attribute({
        type: Boolean,
        useDefault: true
    }),
    __metadata("design:type", Boolean),
    __metadata("design:paramtypes", [Boolean])
], BreadcrumbElement.prototype, "wrap", null);
BreadcrumbElement = __decorate([
    Component({
        selector: 'mosaik-breadcrumb',
        template: breadcrumbElementTemplate,
        themes: {
            joy: breadcrumbElementJoyStyle,
            memphis: breadcrumbElementMemphisStyle,
            cosmopolitan: breadcrumbElementCosmopolitanStyle
        },
        imports: [
            BreadcrumbElement
        ]
    }),
    __metadata("design:paramtypes", [])
], BreadcrumbElement);
export { BreadcrumbElement };
//# sourceMappingURL=BreadcrumbElement.js.map