// #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 { breadcrumbElementCosmopolitanStyle } from './Themes/BreadcrumbElement.Cosmopolitan';
import { breadcrumbElementJoyStyle } from './Themes/BreadcrumbElement.Joy';
import { breadcrumbElementMemphisStyle } from './Themes/BreadcrumbElement.Memphis';
// #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
 *
 * @slot  - The default slot.
 *
 * @cssprop {String} --breadcrumb-font-family - The font family CSS custom property.
 * @cssprop {String} --breadcrumb-font-letter-spacing - The font letter spacing CSS custom property.
 * @cssprop {String} --breadcrumb-font-line-height - The font line height CSS custom property.
 * @cssprop {String} --breadcrumb-font-size - The font size CSS custom property.
 * @cssprop {String} --breadcrumb-font-text-decoration - The font text decoration CSS custom property.
 * @cssprop {String} --breadcrumb-font-text-transform - The font text transform CSS custom property.
 * @cssprop {String} --breadcrumb-font-weight - The font weight CSS custom property.
 * @cssprop {String} --breadcrumb-gap - The gap CSS custom property.
 * @cssprop {String} --breadcrumb-padding-bottom - The padding bottom CSS custom property.
 * @cssprop {String} --breadcrumb-padding-left - The padding left CSS custom property.
 * @cssprop {String} --breadcrumb-padding-right - The padding right CSS custom property.
 * @cssprop {String} --breadcrumb-padding-top - The padding top CSS custom property.
 * @cssprop {String} --breadcrumb-shadow - The shadow CSS custom property.
 * @cssprop {String} --breadcrumb-shadow-blur - The shadow blur CSS custom property.
 * @cssprop {String} --breadcrumb-shadow-color - The shadow color CSS custom property.
 * @cssprop {String} --breadcrumb-shadow-offset-x - The shadow offset x CSS custom property.
 * @cssprop {String} --breadcrumb-shadow-offset-y - The shadow offset y CSS custom property.
 * @cssprop {String} --breadcrumb-shadow-spread - The shadow spread CSS custom property.
 * @cssprop {String} --breadcrumb-transition-duration - The transition duration CSS custom property.
 * @cssprop {String} --breadcrumb-transition-mode - The transition mode CSS custom property.
 * @cssprop {String} --breadcrumb-transition-property - The transition property CSS custom property.
 * @cssprop {String} --breadcrumb-translate - The translate CSS custom property.
 *
 * @example
 * Basic breadcrumb navigation trail:
 * ```html
 * <mosaik-breadcrumb>
 *   <mosaik-breadcrumb-item>Home</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item>Category</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item>Subcategory</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item is-active>Current Page</mosaik-breadcrumb-item>
 * </mosaik-breadcrumb>
 * ```
 *
 * @example
 * Breadcrumb with wrapping enabled:
 * ```html
 * <mosaik-breadcrumb wrap>
 *   <mosaik-breadcrumb-item>Home</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item>Products</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item>Electronics</mosaik-breadcrumb-item>
 *   <mosaik-breadcrumb-item is-active>Headphones</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 `is` property.
     * The `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