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;
};
import { MelodicComponent } from '@melodicdev/core';
import { breadcrumbItemTemplate } from './breadcrumb-item.template.js';
import { breadcrumbItemStyles } from './breadcrumb-item.styles.js';
/**
 * ml-breadcrumb-item - Individual breadcrumb link or label
 *
 * @example
 * ```html
 * <ml-breadcrumb-item href="/settings" icon="gear">Settings</ml-breadcrumb-item>
 * <ml-breadcrumb-item current>Profile</ml-breadcrumb-item>
 * ```
 *
 * @slot default - Item label text
 */
let BreadcrumbItemComponent = class BreadcrumbItemComponent {
    constructor() {
        /** Link URL (omit for current/non-clickable page) */
        this.href = '';
        /** Optional left icon */
        this.icon = '';
        /** Marks as the current/active page */
        this.current = false;
        /** Separator type inherited from parent (set via CSS/attribute) */
        this.separator = 'chevron';
    }
    onCreate() {
        const parent = this.elementRef.closest('ml-breadcrumb');
        if (parent) {
            const sep = parent.getAttribute('separator');
            if (sep === 'slash' || sep === 'chevron') {
                this.separator = sep;
            }
        }
    }
};
BreadcrumbItemComponent = __decorate([
    MelodicComponent({
        selector: 'ml-breadcrumb-item',
        template: breadcrumbItemTemplate,
        styles: breadcrumbItemStyles,
        attributes: ['href', 'icon', 'current', 'separator']
    })
], BreadcrumbItemComponent);
export { BreadcrumbItemComponent };
