import { __decorate, __metadata } from 'tslib';
import { coerceNumberProperty } from '@angular/cdk/coercion';
import * as i0 from '@angular/core';
import { Pipe, EventEmitter, forwardRef, Output, Input, HostBinding, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { NgTemplateOutlet } from '@angular/common';
import { applyCssClass } from '@fundamental-ngx/cdk/utils';
import { registerFormItemControl } from '@fundamental-ngx/core/form';
import { PopoverTriggerDirective, PopoverComponent } from '@fundamental-ngx/core/popover';

const INDICATOR_PREFIX = 'fd-rating-indicator';
const INDICATOR_CLASSES = {
    halves: `${INDICATOR_PREFIX}--half-star`,
    icon: `${INDICATOR_PREFIX}--icon`,
    hideDynamicText: `${INDICATOR_PREFIX}--hide-dynamic-text`
};
const INDICATOR_DEFAULT_CAPACITY = 5;
var RatingIndicatorSizeEnum;
(function (RatingIndicatorSizeEnum) {
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["xs"] = 0] = "xs";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["sm"] = 1] = "sm";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["md"] = 2] = "md";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["lg"] = 3] = "lg";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["cozy"] = 4] = "cozy";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["compact"] = 5] = "compact";
    RatingIndicatorSizeEnum[RatingIndicatorSizeEnum["condensed"] = 6] = "condensed";
})(RatingIndicatorSizeEnum || (RatingIndicatorSizeEnum = {}));

class RatingStarLabelPipe {
    /** Transforms the value to a rating value string. */
    transform(index, controlsCount, useHalves) {
        if (useHalves) {
            return `${index / 2 + 0.5} of ${controlsCount / 2}`;
        }
        return `${index + 1} of ${controlsCount}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: RatingStarLabelPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
    static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.0.2", ngImport: i0, type: RatingStarLabelPipe, isStandalone: true, name: "ratingStarLabel" }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: RatingStarLabelPipe, decorators: [{
            type: Pipe,
            args: [{
                    name: 'ratingStarLabel',
                    standalone: true
                }]
        }] });

let ratingUID = 0;
class RatingIndicatorComponent {
    /**
     * Number of rates to display
     */
    set indicatorCapacity(value) {
        const val = coerceNumberProperty(value, INDICATOR_DEFAULT_CAPACITY);
        this._indicatorCapacity = val < 1 ? INDICATOR_DEFAULT_CAPACITY : val;
    }
    /** @hidden */
    get viewRatingUID() {
        return this._ratingUID;
    }
    /** @hidden */
    get indicatorCount() {
        return this._indicatorCapacity;
    }
    /** @hidden */
    get viewValue() {
        return this._value;
    }
    /** @hidden */
    constructor(elementRef, _changeDetectorRef) {
        this.elementRef = elementRef;
        this._changeDetectorRef = _changeDetectorRef;
        /**
         * Sets the aria-disabled attribute to the element.
         * Sets the is-disabled class to the element.
         * Whether the rating indicator is disabled
         */
        this.disabled = false;
        /**
         * Whether the rating indicator is in displayMode
         */
        this.displayMode = false;
        /**
         * Whether the rating indicator is in non-interactive state.
         */
        this.nonInteractive = false;
        /**
         * Whether or not to display half values.
         */
        this.allowHalves = false;
        /**
         * User's value number of ratings. If provided, Overrides ratingAverage.
         */
        this.value = 0;
        /**
         * Whether or not to display the popover that shows the sum of each rating. Requires [ratings] object.
         */
        this.displayAllRatings = false;
        /**
         * Possible values are 'xs', 'sm', 'md', 'lg', 'cozy', 'compact', 'condensed'
         */
        this.size = 'md';
        /**
         * Text divider label between view value and indicator count.
         */
        this.dynamicTextIndicator = 'of';
        /**
         * Fired when the user sets or changes their rating.
         */
        this.ratingChanged = new EventEmitter();
        /** @hidden */
        this.sizeClass = this._getSizeClass(this.size);
        /** @hidden */
        this._rates = [];
        /** @hidden */
        this._ratingItems = [];
        /** @hidden */
        this._ratingUID = ratingUID++;
        /** @hidden */
        this._indicatorCapacity = INDICATOR_DEFAULT_CAPACITY;
        /** @hidden */
        this._value = 0;
        /** @hidden */
        this._hideDynamicText = false;
        /** @hidden */
        this.onChange = () => { };
        /** @hidden */
        this.onTouched = () => { };
    }
    /** @hidden
     * CssClassBuilder interface implementation
     * function must return single string
     * function is responsible for order which css classes are applied
     */
    buildComponentCssClass() {
        this.sizeClass = this._getSizeClass(this.size);
        return [
            INDICATOR_PREFIX,
            this.sizeClass,
            this.allowHalves ? INDICATOR_CLASSES.halves : '',
            !!this.ratedIcon && !!this.unratedIcon ? INDICATOR_CLASSES.icon : '',
            this._hideDynamicText || !this._value ? INDICATOR_CLASSES.hideDynamicText : '',
            this.class
        ];
    }
    /** @hidden */
    ngOnInit() {
        this._value = this._convertToValue();
        this._rates = this._getRates();
        this.buildComponentCssClass();
        this._generateRatings();
    }
    /** @hidden */
    ngOnChanges(changes) {
        if ('class' in changes ||
            'size' in changes ||
            'ratedIcon' in changes ||
            'unratedIcon' in changes ||
            'allowHalves' in changes) {
            this.buildComponentCssClass();
        }
        if ('value' in changes) {
            this._value = this._convertToValue();
        }
        if ('indicatorCapacity' in changes) {
            this._rates = this._getRates();
        }
        if ('allowHalves' in changes) {
            this._value = this._convertToValue();
            this._rates = this._getRates();
        }
        if ('ratings' in changes) {
            this._generateRatings();
        }
    }
    /** @hidden */
    writeValue(value) {
        this._value = this._parseValue(value);
        this._changeDetectorRef.markForCheck();
    }
    /** @hidden */
    registerOnChange(fn) {
        this.onChange = fn;
    }
    /** @hidden */
    registerOnTouched(fn) {
        this.onTouched = fn;
    }
    /** @hidden */
    setDisabledState(isDisabled) {
        this.disabled = isDisabled;
    }
    /** @hidden */
    onSelect(value) {
        this.value = this._value = value;
        this.onChange(value);
        this.onTouched();
        this.ratingChanged.emit(value);
    }
    /**
     * @hidden
     * Generate rating items for popover content if rating object was defined
     */
    _generateRatings() {
        if (!this.ratings) {
            return;
        }
        const ratings = Object.entries(this.ratings)
            .filter(([rate, vote]) => {
            const _rate = +rate;
            return !isNaN(_rate) && !isNaN(+vote) && _rate > 0;
        })
            .map(([rate, votes]) => ({ rate: +rate, votes }));
        if (ratings.length === 0) {
            return;
        }
        const { totalVotes, totalRating } = ratings.reduce((total, rating) => ({
            totalVotes: total.totalVotes + rating.votes,
            totalRating: total.totalRating + rating.rate * rating.votes
        }), { totalVotes: 0, totalRating: 0 });
        this._ratingItems = ratings;
        this.ratingAverage = totalRating / totalVotes;
        this.totalRatings = totalVotes;
        this._value = this._convertToValue();
    }
    /**
     * @hidden
     * get converted viewValue for render in component template from original value if it still exists, or ratingAverage.
     */
    _convertToValue() {
        return this._parseValue(this.value || this.ratingAverage);
    }
    /**
     * @hidden
     * get converted value from original to view value with depends on halves
     * For example,
     *  original value is equal to 2.34, you will get and render 2
     *  original value is equal to 3.74, you will get and render 4
     */
    _parseValue(value) {
        if (!value || value === 0) {
            return 0;
        }
        const integer = Math.floor(value);
        const fractional = value % 1;
        let v = integer;
        if (this.allowHalves && fractional > 0.25 && fractional <= 0.5) {
            v = integer + 0.5;
        }
        else if (fractional > 0.5) {
            v = integer + 1;
        }
        return Math.min(this.indicatorCount, v);
    }
    /**
     * @hidden
     * get rating icons array with value and unic id
     */
    _getRates() {
        const withHalves = this.allowHalves ? 2 : 1;
        return Array(this.indicatorCount * withHalves)
            .fill(`rating-${this._ratingUID}`)
            .map((name, index) => ({
            id: `${name}-${index + 1}`,
            value: (index + 1) / withHalves
        }));
    }
    /**
     * @hidden
     * get rating icons array with value and unic id
     */
    _getSizeClass(size) {
        return `${INDICATOR_PREFIX}--${size in RatingIndicatorSizeEnum ? size : 'md'}`;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: RatingIndicatorComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.2", type: RatingIndicatorComponent, isStandalone: true, selector: "fd-rating-indicator", inputs: { class: "class", name: "name", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", disabled: "disabled", displayMode: "displayMode", nonInteractive: "nonInteractive", indicatorCapacity: "indicatorCapacity", allowHalves: "allowHalves", value: "value", totalRatings: "totalRatings", ratingAverage: "ratingAverage", ratings: "ratings", displayAllRatings: "displayAllRatings", ratedIcon: "ratedIcon", unratedIcon: "unratedIcon", size: "size", dynamicTextIndicator: "dynamicTextIndicator" }, outputs: { ratingChanged: "ratingChanged" }, host: { properties: { "attr.aria-label": "this.ariaLabelledBy", "class.is-disabled": "this.disabled", "attr.aria-disabled": "this.disabled", "class.fd-rating-indicator--display-mode": "this.displayMode", "class.fd-rating-indicator--non-interactive": "this.nonInteractive" } }, providers: [
            {
                provide: NG_VALUE_ACCESSOR,
                useExisting: forwardRef(() => RatingIndicatorComponent),
                multi: true
            },
            registerFormItemControl(RatingIndicatorComponent)
        ], usesOnChanges: true, ngImport: i0, template: "<ng-template #zeroRate let-halves=\"halves\">\n    <input\n        aria-label=\"Reset to zero\"\n        role=\"button\"\n        type=\"radio\"\n        class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n        (click)=\"onSelect(0)\"\n        [disabled]=\"disabled || nonInteractive || displayMode\"\n        name=\"rating-{{ viewRatingUID }}{{ halves ? '-halves' : '' }}\"\n        [checked]=\"viewValue === 0\"\n    />\n    <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!--  role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div class=\"fd-rating-indicator__container\" role=\"application\" aria-roledescription=\"Rating indicator\">\n    <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n    <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n    <!-- Available rate values -->\n    @for (rate of _rates; track rate.id; let i = $index) {\n        <input\n            [attr.aria-label]=\"i | ratingStarLabel: _rates.length : allowHalves\"\n            role=\"button\"\n            type=\"radio\"\n            class=\"fd-rating-indicator__input\"\n            [disabled]=\"disabled || nonInteractive || displayMode\"\n            [id]=\"rate.id\"\n            name=\"rating-{{ viewRatingUID }}\"\n            [value]=\"rate.value\"\n            [checked]=\"viewValue === rate.value\"\n            (click)=\"onSelect(rate.value)\"\n        />\n        <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n            @if (ratedIcon) {\n                <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon\"></i>\n            }\n            @if (unratedIcon) {\n                <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon\"></i>\n            }\n        </label>\n    }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (displayAllRatings && _ratingItems.length) {\n    <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n        (<span aria-label=\"Total raiting\" fd-link>{{ totalRatings }}</span\n        >)\n    </span>\n} @else {\n    @if (totalRatings) {\n        <span class=\"fd-rating-indicator__dynamic-text\">({{ totalRatings }})</span>\n    } @else {\n        <span class=\"fd-rating-indicator__dynamic-text\"\n            >({{ viewValue }} {{ dynamicTextIndicator }} {{ indicatorCount }})</span\n        >\n    }\n}\n<fd-popover\n    #allRatingContent\n    [triggers]=\"['mouseenter', 'mouseleave']\"\n    [noArrow]=\"false\"\n    placement=\"top\"\n    additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n    @for (rating of _ratingItems; track rating) {\n        <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass\">\n            <div class=\"fd-rating-indicator__container\">\n                @for (rate of _rates; track rate.id) {\n                    <span\n                        [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n                        class=\"fd-rating-indicator__input\"\n                    ></span>\n                    <label class=\"fd-rating-indicator__label\">\n                        @if (ratedIcon) {\n                            <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon\"></i>\n                        }\n                        @if (unratedIcon) {\n                            <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon\"></i>\n                        }\n                    </label>\n                }\n            </div>\n            ({{ rating.votes }})\n        </div>\n    }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-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-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.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: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig", "preventSpaceKeyScroll"] }, { kind: "pipe", type: RatingStarLabelPipe, name: "ratingStarLabel" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
__decorate([
    applyCssClass,
    __metadata("design:type", Function),
    __metadata("design:paramtypes", []),
    __metadata("design:returntype", Array)
], RatingIndicatorComponent.prototype, "buildComponentCssClass", null);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.2", ngImport: i0, type: RatingIndicatorComponent, decorators: [{
            type: Component,
            args: [{ selector: 'fd-rating-indicator', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                        {
                            provide: NG_VALUE_ACCESSOR,
                            useExisting: forwardRef(() => RatingIndicatorComponent),
                            multi: true
                        },
                        registerFormItemControl(RatingIndicatorComponent)
                    ], imports: [NgTemplateOutlet, PopoverTriggerDirective, PopoverComponent, RatingStarLabelPipe], template: "<ng-template #zeroRate let-halves=\"halves\">\n    <input\n        aria-label=\"Reset to zero\"\n        role=\"button\"\n        type=\"radio\"\n        class=\"fd-rating-indicator__input fd-rating-indicator__input--zero-rating\"\n        (click)=\"onSelect(0)\"\n        [disabled]=\"disabled || nonInteractive || displayMode\"\n        name=\"rating-{{ viewRatingUID }}{{ halves ? '-halves' : '' }}\"\n        [checked]=\"viewValue === 0\"\n    />\n    <label class=\"fd-rating-indicator__label fd-rating-indicator__label--zero-rating\" aria-hidden=\"true\"></label>\n</ng-template>\n<!--  role=\"application\" is used in order to let user to change value with left/right arrows in JAWS, since JAWS ovverrides these actions -->\n<div class=\"fd-rating-indicator__container\" role=\"application\" aria-roledescription=\"Rating indicator\">\n    <!-- Zero value if we don't have provided value from user, `ratingAverage` or `ratings` -->\n    <ng-template [ngTemplateOutlet]=\"zeroRate\"></ng-template>\n    <!-- Available rate values -->\n    @for (rate of _rates; track rate.id; let i = $index) {\n        <input\n            [attr.aria-label]=\"i | ratingStarLabel: _rates.length : allowHalves\"\n            role=\"button\"\n            type=\"radio\"\n            class=\"fd-rating-indicator__input\"\n            [disabled]=\"disabled || nonInteractive || displayMode\"\n            [id]=\"rate.id\"\n            name=\"rating-{{ viewRatingUID }}\"\n            [value]=\"rate.value\"\n            [checked]=\"viewValue === rate.value\"\n            (click)=\"onSelect(rate.value)\"\n        />\n        <label class=\"fd-rating-indicator__label\" [for]=\"rate.id\" aria-hidden=\"true\">\n            @if (ratedIcon) {\n                <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon\"></i>\n            }\n            @if (unratedIcon) {\n                <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon\"></i>\n            }\n        </label>\n    }\n</div>\n<!-- Popover if displayAllRatings is true and we have ratings object -->\n@if (displayAllRatings && _ratingItems.length) {\n    <span [fdPopoverTrigger]=\"allRatingContent\" class=\"fd-rating-indicator__dynamic-text\">\n        (<span aria-label=\"Total raiting\" fd-link>{{ totalRatings }}</span\n        >)\n    </span>\n} @else {\n    @if (totalRatings) {\n        <span class=\"fd-rating-indicator__dynamic-text\">({{ totalRatings }})</span>\n    } @else {\n        <span class=\"fd-rating-indicator__dynamic-text\"\n            >({{ viewValue }} {{ dynamicTextIndicator }} {{ indicatorCount }})</span\n        >\n    }\n}\n<fd-popover\n    #allRatingContent\n    [triggers]=\"['mouseenter', 'mouseleave']\"\n    [noArrow]=\"false\"\n    placement=\"top\"\n    additionalBodyClass=\"fd-rating-indicator__popover\"\n>\n    @for (rating of _ratingItems; track rating) {\n        <div class=\"fd-rating-indicator__sum-row\" [class]=\"sizeClass\">\n            <div class=\"fd-rating-indicator__container\">\n                @for (rate of _rates; track rate.id) {\n                    <span\n                        [class.fd-rating-indicator__input-checked]=\"rate.value === rating.rate\"\n                        class=\"fd-rating-indicator__input\"\n                    ></span>\n                    <label class=\"fd-rating-indicator__label\">\n                        @if (ratedIcon) {\n                            <i class=\"fd-rating-indicator__label-rated\" [class]=\"unratedIcon\"></i>\n                        }\n                        @if (unratedIcon) {\n                            <i class=\"fd-rating-indicator__label-unrated\" [class]=\"ratedIcon\"></i>\n                        }\n                    </label>\n                }\n            </div>\n            ({{ rating.votes }})\n        </div>\n    }\n</fd-popover>\n", styles: [".fd-rating-indicator{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem;border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;position:relative}.fd-rating-indicator:after,.fd-rating-indicator:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--cozy{--fontSize:1.5rem;--spacingBetweenIcons:.1875rem;margin-block:.8125rem;margin-inline:0}.fd-rating-indicator--compact{margin-block:.5rem;margin-inline:0}.fd-rating-indicator--compact,.fd-rating-indicator--condensed{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--xs{--fontSize:.75rem;--spacingBetweenIcons:1px}.fd-rating-indicator--sm{--fontSize:1rem;--spacingBetweenIcons:.125rem}.fd-rating-indicator--md{--fontSize:1.375rem;--spacingBetweenIcons:.1875rem}.fd-rating-indicator--lg{--fontSize:2rem;--spacingBetweenIcons:.25rem}.fd-rating-indicator__container{border:0;border-radius:var(--fdRating_Indicator_Border_Radius);-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0}.fd-rating-indicator__container:after,.fd-rating-indicator__container:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__container:focus-within{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:var(--fdRating_Indicator_Focus_Outline_Offset,0)}.fd-rating-indicator__container:focus-within .fd-rating-indicator__input,.fd-rating-indicator__container:focus-within .fd-rating-indicator__label{outline:none!important}.fd-rating-indicator__input{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;height:var(--fontSize);line-height:normal;margin-block:0;margin-inline:0;opacity:.0001;padding-block:0;padding-inline:0;position:absolute;top:0;width:var(--fontSize);z-index:-1}.fd-rating-indicator__input:after,.fd-rating-indicator__input:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__input:checked.is-focus,.fd-rating-indicator__input:checked:focus{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth)}.fd-rating-indicator__input:checked.is-focus+.fd-rating-indicator__label,.fd-rating-indicator__input:checked:focus+.fd-rating-indicator__label{outline:var(--sapContent_FocusColor) var(--sapContent_FocusStyle) var(--sapContent_FocusWidth);outline-offset:0}.fd-rating-indicator__label{border:0;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--sapTextColor);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-family:var(--sapFontFamily);font-size:var(--sapFontSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;padding-block:0;padding-inline:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;float:left;height:var(--fontSize);opacity:1;-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons)}.fd-rating-indicator__label:after,.fd-rating-indicator__label:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator__label:before{color:var(--sapContent_RatedColor);content:\"\\e065\";font-family:SAP-icons;font-size:var(--fontSize)}.fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator__label:hover:before{opacity:var(--fdRating_Indicator_Selected_Hover_Opacity);-webkit-transition:opacity .125s ease-in;transition:opacity .125s ease-in}.fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e0a1\"}.fd-rating-indicator__dynamic-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-size:var(--sapFontSmallSize);font-weight:400;forced-color-adjust:none;line-height:normal;margin-block:0;margin-inline:0;overflow:hidden;padding-block:0;padding-inline:0;text-overflow:ellipsis;white-space:nowrap;-webkit-margin-start:.5rem;margin-inline-start:.5rem}.fd-rating-indicator__dynamic-text:after,.fd-rating-indicator__dynamic-text:before{-webkit-box-sizing:inherit;box-sizing:inherit;font-size:inherit}.fd-rating-indicator--hide-dynamic-text>.fd-rating-indicator__dynamic-text{display:none}.fd-rating-indicator[dir=rtl] .fd-rating-indicator__label,[dir=rtl] .fd-rating-indicator .fd-rating-indicator__label{float:right}.fd-rating-indicator.is-disabled,.fd-rating-indicator:disabled,.fd-rating-indicator[aria-disabled=true]{opacity:var(--fdRating_Indicator_Disabled_Control_Opacity);pointer-events:none}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:before{color:var(--fdRating_Indicator_Disabled_Selected_Color);content:\"\\e065\"}.fd-rating-indicator.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Disabled_Unselected_Color);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--display-mode{--fontSize:1rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label{-webkit-margin-end:.125rem;margin-inline-end:.125rem}.fd-rating-indicator--display-mode .fd-rating-indicator__label:before{color:var(--fdRating_Indicator_Display_Only_Selected_Color);content:\"\\e065\";font-size:var(--fontSize)}.fd-rating-indicator--display-mode,.fd-rating-indicator--non-interactive{pointer-events:none}.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label:before{color:var(--sapContent_UnratedColor);content:\"\\e065\";font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator--icon .fd-rating-indicator__label{height:var(--fontSize);width:var(--fontSize)}.fd-rating-indicator--icon .fd-rating-indicator__label:after,.fd-rating-indicator--icon .fd-rating-indicator__label:before{content:none!important}.fd-rating-indicator--icon .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{font-size:var(--fontSize);height:100%;line-height:1}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-rated,.fd-rating-indicator--icon .fd-rating-indicator__label-unrated{display:none}.fd-rating-indicator--icon .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated{display:block}.fd-rating-indicator--half-star .fd-rating-indicator__input{height:var(--fontSize);width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label{-webkit-margin-end:0;margin-inline-end:0;overflow:hidden;width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator__label:nth-child(4n+6){-webkit-margin-end:var(--spacingBetweenIcons);margin-inline-end:var(--spacingBetweenIcons);-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.fd-rating-indicator--half-star .fd-rating-indicator__label:last-child{-webkit-margin-end:0;margin-inline-end:0}.fd-rating-indicator--half-star .fd-rating-indicator--icon .fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star .fd-rating-indicator .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:nth-child(4n+3):checked+.fd-rating-indicator__label+.fd-rating-indicator__input+.fd-rating-indicator__label:before{font-size:var(--fontSize)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label{width:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio)*.5)}.fd-rating-indicator--half-star.fd-rating-indicator--display-mode .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.fd-rating-indicator--non-interactive .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star.is-disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star:disabled .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before,.fd-rating-indicator--half-star[aria-disabled=true] .fd-rating-indicator__input:checked~.fd-rating-indicator__input+.fd-rating-indicator__label .fd-rating-indicator__label-unrated:before{font-size:calc(var(--fontSize)*var(--fdRating_Indicator_View_Mode_Unselected_Icon_Size_Ratio))}.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__input--zero-rating,.fd-rating-indicator[class*=fd-rating-indicator--] .fd-rating-indicator__label--zero-rating,.fd-rating-indicator__input--zero-rating,.fd-rating-indicator__label--zero-rating{margin-block:0;margin-inline:0;opacity:.0001;overflow:hidden;padding-block:0;padding-inline:0;width:0}.fd-rating-indicator__popover{padding:.5rem 0!important}.fd-rating-indicator__popover .fd-rating-indicator__sum-row{display:flex;align-items:center;padding:.5rem 1rem;margin:0}.fd-rating-indicator__popover .fd-rating-indicator__sum-row .fd-rating-indicator__container{margin-right:.5rem}\n/*! Bundled license information:\n\nfundamental-styles/dist/rating-indicator.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: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { class: [{
                type: Input
            }], name: [{
                type: Input
            }], ariaLabel: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['attr.aria-label']
            }], ariaLabelledBy: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['attr.aria-label']
            }], disabled: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['class.is-disabled']
            }, {
                type: HostBinding,
                args: ['attr.aria-disabled']
            }], displayMode: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['class.fd-rating-indicator--display-mode']
            }], nonInteractive: [{
                type: Input
            }, {
                type: HostBinding,
                args: ['class.fd-rating-indicator--non-interactive']
            }], indicatorCapacity: [{
                type: Input
            }], allowHalves: [{
                type: Input
            }], value: [{
                type: Input
            }], totalRatings: [{
                type: Input
            }], ratingAverage: [{
                type: Input
            }], ratings: [{
                type: Input
            }], displayAllRatings: [{
                type: Input
            }], ratedIcon: [{
                type: Input
            }], unratedIcon: [{
                type: Input
            }], size: [{
                type: Input
            }], dynamicTextIndicator: [{
                type: Input
            }], ratingChanged: [{
                type: Output
            }], buildComponentCssClass: [] } });

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

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

export { INDICATOR_CLASSES, INDICATOR_DEFAULT_CAPACITY, INDICATOR_PREFIX, RatingIndicatorComponent, RatingIndicatorModule, RatingIndicatorSizeEnum, RatingStarLabelPipe };
//# sourceMappingURL=fundamental-ngx-core-rating-indicator.mjs.map
