import * as i0 from '@angular/core';
import { input, booleanAttribute, computed, contentChildren, ElementRef, effect, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { FD_LINK_COMPONENT } from '@fundamental-ngx/core/link';
import { FdTranslatePipe } from '@fundamental-ngx/i18n';

let objectIdentifierId = 0;
class ObjectIdentifierComponent {
    /** @hidden */
    constructor() {
        /**
         * Object Identifier ID
         * If not set, a default value is provided
         */
        this.id = input('fd-object-identifier-' + ++objectIdentifierId, ...(ngDevMode ? [{ debugName: "id" }] : []));
        /**
         * Optional description text to display below the title.
         * When provided, renders as a paragraph with the class `fd-object-identifier__text`.
         */
        this.description = input(...(ngDevMode ? [undefined, { debugName: "description" }] : []));
        /**
         * Accessible label for screen readers.
         * Used in the screen-reader-only span element to provide context for assistive technologies.
         */
        this.ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
        /**
         * Whether to apply bold styling to the title.
         * When true, adds the `fd-object-identifier__title--bold` class to the title element.
         * @default false
         */
        this.bold = input(false, { ...(ngDevMode ? { debugName: "bold" } : {}), transform: booleanAttribute });
        /**
         * Whether to apply medium sizing to the component.
         * When true, adds the `fd-object-identifier--medium` class to the host element.
         * @default false
         */
        this.medium = input(false, { ...(ngDevMode ? { debugName: "medium" } : {}), transform: booleanAttribute });
        /** Computed ID for the description text element */
        this.textId = computed(() => `${this.id()}-text`, ...(ngDevMode ? [{ debugName: "textId" }] : []));
        /** Computed ID for the title element */
        this.titleId = computed(() => `${this.id()}-title`, ...(ngDevMode ? [{ debugName: "titleId" }] : []));
        /** Computed ID for the screen-reader only description element */
        this.descriptionId = computed(() => `${this.id()}-description`, ...(ngDevMode ? [{ debugName: "descriptionId" }] : []));
        /** Whether any link components are projected via content projection */
        this.hasLinks = computed(() => this._linkComponents().length > 0, ...(ngDevMode ? [{ debugName: "hasLinks" }] : []));
        /** Query for all projected link components to apply identifier-specific styling and ARIA attributes */
        this._linkComponents = contentChildren(FD_LINK_COMPONENT, { ...(ngDevMode ? { debugName: "_linkComponents" } : {}), read: ElementRef });
        effect(() => {
            this._applyLinkAttributes();
        });
    }
    /** Applies identifier-specific CSS class and ARIA attributes to all link components */
    _applyLinkAttributes() {
        const ariaLabelledBy = this.description() ? `${this.descriptionId()} ${this.textId()}` : this.descriptionId();
        this._linkComponents().forEach((link) => {
            link.nativeElement.classList.add('fd-object-identifier__link');
            link.nativeElement.setAttribute('aria-labelledby', ariaLabelledBy);
        });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ObjectIdentifierComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: ObjectIdentifierComponent, isStandalone: true, selector: "fd-object-identifier", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, bold: { classPropertyName: "bold", publicName: "bold", isSignal: true, isRequired: false, transformFunction: null }, medium: { classPropertyName: "medium", publicName: "medium", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "class.fd-object-identifier--medium": "medium()" }, classAttribute: "fd-object-identifier" }, queries: [{ propertyName: "_linkComponents", predicate: FD_LINK_COMPONENT, read: ElementRef, isSignal: true }], ngImport: i0, template: `
        <p class="fd-object-identifier__title" [class.fd-object-identifier__title--bold]="bold()" [attr.id]="titleId()">
            <ng-content></ng-content>
        </p>
        @if (description()) {
            <p class="fd-object-identifier__text" [attr.id]="textId()">
                {{ description() }}
            </p>
        }
        <span
            class="fd-object-identifier__sr-only"
            [attr.id]="descriptionId()"
            [attr.aria-hidden]="hasLinks() ? 'true' : null"
        >
            {{ ariaLabel() || ('coreObjectIdentifier.srOnlyAriaLabel' | fdTranslate) }}
        </span>
    `, isInline: true, styles: [".fd-object-identifier .fd-object-identifier__link{font-size:inherit;font-weight:inherit}.fd-object-identifier__title{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapList_TextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontLargeSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-object-identifier__title:after,.fd-object-identifier__title:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-identifier__title--bold{font-weight:700}.fd-object-identifier__text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;margin-top:.5rem;padding-block:0;padding-inline:0}.fd-object-identifier__text:after,.fd-object-identifier__text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-identifier--medium .fd-object-identifier__title{font-size:var(--sapFontSize)}.fd-object-identifier__sr-only{position:absolute;clip:rect(0 0 0 0);height:1px;width:1px;border:0;margin-inline:-1px;margin-block:-1px;padding-inline:0;padding-block:0;overflow:hidden;white-space:nowrap}\n/*! Bundled license information:\n\nfundamental-styles/dist/object-identifier.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"], dependencies: [{ kind: "pipe", type: FdTranslatePipe, name: "fdTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ObjectIdentifierComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-object-identifier', template: `
        <p class="fd-object-identifier__title" [class.fd-object-identifier__title--bold]="bold()" [attr.id]="titleId()">
            <ng-content></ng-content>
        </p>
        @if (description()) {
            <p class="fd-object-identifier__text" [attr.id]="textId()">
                {{ description() }}
            </p>
        }
        <span
            class="fd-object-identifier__sr-only"
            [attr.id]="descriptionId()"
            [attr.aria-hidden]="hasLinks() ? 'true' : null"
        >
            {{ ariaLabel() || ('coreObjectIdentifier.srOnlyAriaLabel' | fdTranslate) }}
        </span>
    `, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, imports: [FdTranslatePipe], host: {
                        class: 'fd-object-identifier',
                        '[attr.id]': 'id()',
                        '[class.fd-object-identifier--medium]': 'medium()'
                    }, styles: [".fd-object-identifier .fd-object-identifier__link{font-size:inherit;font-weight:inherit}.fd-object-identifier__title{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapList_TextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-size:var(--sapFontLargeSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-object-identifier__title:after,.fd-object-identifier__title:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-identifier__title--bold{font-weight:700}.fd-object-identifier__text{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);color:var(--sapContent_LabelColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;margin-top:.5rem;padding-block:0;padding-inline:0}.fd-object-identifier__text:after,.fd-object-identifier__text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-object-identifier--medium .fd-object-identifier__title{font-size:var(--sapFontSize)}.fd-object-identifier__sr-only{position:absolute;clip:rect(0 0 0 0);height:1px;width:1px;border:0;margin-inline:-1px;margin-block:-1px;padding-inline:0;padding-block:0;overflow:hidden;white-space:nowrap}\n/*! Bundled license information:\n\nfundamental-styles/dist/object-identifier.css:\n  (*!\n   * Fundamental Library Styles v0.40.1\n   * Copyright (c) 2025 SAP SE or an SAP affiliate company.\n   * Licensed under Apache License 2.0 (https://github.com/SAP/fundamental-styles/blob/main/LICENSE)\n   *)\n*/\n"] }]
        }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], description: [{ type: i0.Input, args: [{ isSignal: true, alias: "description", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], bold: [{ type: i0.Input, args: [{ isSignal: true, alias: "bold", required: false }] }], medium: [{ type: i0.Input, args: [{ isSignal: true, alias: "medium", required: false }] }], _linkComponents: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => FD_LINK_COMPONENT), { ...{ read: ElementRef }, isSignal: true }] }] } });

/**
 * @deprecated
 * Use direct import of `ObjectIdentifierComponent`.
 */
class ObjectIdentifierModule {
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ObjectIdentifierModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
    static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.0", ngImport: i0, type: ObjectIdentifierModule, imports: [ObjectIdentifierComponent], exports: [ObjectIdentifierComponent] }); }
    static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ObjectIdentifierModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: ObjectIdentifierModule, decorators: [{
            type: NgModule,
            args: [{
                    imports: [ObjectIdentifierComponent],
                    exports: [ObjectIdentifierComponent]
                }]
        }] });

/**
 * Generated bundle index. Do not edit.
 */

export { ObjectIdentifierComponent, ObjectIdentifierModule };
//# sourceMappingURL=fundamental-ngx-core-object-identifier.mjs.map
