import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostBinding, Injector, Input, Output } from '@angular/core';
import { TableService } from '@ironsource/fusion-ui/components/table/common/services';
import { isNullOrUndefined } from '@ironsource/fusion-ui/utils';
import { of } from 'rxjs';
import { TableTestIdModifiers } from '@ironsource/fusion-ui/entities';
import { TestIdsService } from '@ironsource/fusion-ui/services/test-ids';
import * as i0 from "@angular/core";
import * as i1 from "@ironsource/fusion-ui/components/table/common/services";
import * as i2 from "@angular/common";
import * as i3 from "@ironsource/fusion-ui/components/icon/v1";
import * as i4 from "@ironsource/fusion-ui/components/tooltip/v3";
import * as i5 from "../table-cell/table-cell.component";
import * as i6 from "@ironsource/fusion-ui/pipes/generic";
const _c0 = ["fusionTableRow", ""];
function TableRowComponent_ng_container_0_td_1_fusion_icon_3_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-icon", 5);
    i0.ɵɵlistener("click", function TableRowComponent_ng_container_0_td_1_fusion_icon_3_Template_fusion_icon_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r7.expandRow.emit({ rowIndex: ctx_r7.rowIndex, row: ctx_r7.row, isExpanded: !ctx_r7.isExpanded })); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("name", ctx_r6.expandArrowIconName);
} }
function TableRowComponent_ng_container_0_td_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 3);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵtemplate(3, TableRowComponent_ng_container_0_td_1_fusion_icon_3_Template, 1, 1, "fusion-icon", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r9 = i0.ɵɵnextContext();
    const idx_r4 = ctx_r9.index;
    const isLast_r3 = ctx_r9.last;
    const ctx_r5 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("total-row", ctx_r5.isRowTotal)("expanded", ctx_r5.isExpanded)("inner-row", ctx_r5.isInnerRow)("sticky-left", ctx_r5.options == null ? null : ctx_r5.options.rowsExpandableOptions == null ? null : ctx_r5.options.rowsExpandableOptions.sticky);
    i0.ɵɵattribute("rowspan", i0.ɵɵpipeBind2(1, 11, ctx_r5.attrRowspan, "cell-expand"))("data-testid", i0.ɵɵpipeBind3(2, 14, ctx_r5.testIdsService.getTestAttribute.bind(ctx_r5), ctx_r5.testId, ctx_r5.tableTestIdModifiers.CELL + "-r" + ctx_r5.rowIndex + "-c" + idx_r4));
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", isLast_r3 && ctx_r5.showExpandIcon());
} }
function TableRowComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableRowComponent_ng_container_0_td_1_Template, 4, 18, "td", 2);
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(2, 1, ctx_r0.cellShown, "cell-expand"));
} }
const _c1 = (a0, a1) => ({ x: a0, y: a1 });
function TableRowComponent_ng_container_2_td_1_Template(rf, ctx) { if (rf & 1) {
    const _r16 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "td", 7);
    i0.ɵɵlistener("remove", function TableRowComponent_ng_container_2_td_1_Template_td_remove_0_listener() { i0.ɵɵrestoreView(_r16); const ctx_r15 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r15.rowRemoved.emit()); })("selectedChange", function TableRowComponent_ng_container_2_td_1_Template_td_selectedChange_0_listener($event) { i0.ɵɵrestoreView(_r16); const ctx_r17 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r17.selectedChange.emit($event)); })("dataChange", function TableRowComponent_ng_container_2_td_1_Template_td_dataChange_0_listener($event) { i0.ɵɵrestoreView(_r16); const column_r10 = i0.ɵɵnextContext().$implicit; const ctx_r18 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r18.onDataChange($event, column_r10.key)); });
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r20 = i0.ɵɵnextContext();
    const columnIndex_r11 = ctx_r20.index;
    const column_r10 = ctx_r20.$implicit;
    const isLast_r12 = ctx_r20.last;
    const idx_r13 = ctx_r20.index;
    const ctx_r14 = i0.ɵɵnextContext();
    i0.ɵɵclassMap(ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].classes);
    i0.ɵɵstyleProp("width", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].width);
    i0.ɵɵclassProp("cell-tooltip", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].hasTooltip)("after-sticky", ctx_r14.hasAfterSticky)("inner-row", ctx_r14.isInnerRow);
    i0.ɵɵproperty("fusionTooltip", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].tooltip)("data", ctx_r14.row[column_r10.key])("row", ctx_r14.row)("rowIndex", ctx_r14.rowIndex)("rowSpanIndex", ctx_r14.rowSpanIndex)("column", column_r10)("options", ctx_r14.options)("position", i0.ɵɵpureFunction2(35, _c1, ctx_r14.rowIndex, columnIndex_r11))("isRemove", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].isRemove)("infoIconTooltip", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].infoIconOnHoverTooltip)("isRowSelected", ctx_r14.isRowSelected)("isLastColumn", isLast_r12)("isReadOnly", ctx_r14.isRowReadOnly)("customClass", ctx_r14.row["customClass"])("ngStyle", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].styles);
    i0.ɵɵattribute("colspan", ctx_r14.columnsData[columnIndex_r11] == null ? null : ctx_r14.columnsData[columnIndex_r11].colspan)("rowspan", i0.ɵɵpipeBind2(1, 28, ctx_r14.attrRowspan, column_r10.key))("data-testid", i0.ɵɵpipeBind3(2, 31, ctx_r14.testIdsService.getTestAttribute.bind(ctx_r14), ctx_r14.testId, ctx_r14.tableTestIdModifiers.CELL + "-r" + ctx_r14.rowIndex + "-c" + idx_r13));
} }
function TableRowComponent_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableRowComponent_ng_container_2_td_1_Template, 3, 38, "td", 6);
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const column_r10 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind2(2, 1, ctx_r1.cellShown, column_r10.key));
} }
export class TableRowComponent {
    get isRowExpanded() {
        return this.isExpanded;
    }
    get isInnerRowExpandable() {
        return (this.options &&
            this.options.rowsExpandableOptions &&
            this.tableService.expandLevels &&
            this.tableService.getExpandLevelByRowIndex(this.rowIndex) <= this.tableService.expandLevels);
    }
    get isRowTotal() {
        return !isNullOrUndefined(this.options.hasTotalsRow) && this.options.hasTotalsRow && this.rowIndex === 0;
    }
    get isRowReadOnly() {
        return this.tableService.isRowReadOnly(this.row);
    }
    get expandCellCount() {
        if (!!this.options && !!this.options.rowsExpandableOptions && !!this.tableService.expandLevels) {
            const expandLevelsByIndex = this.tableService.getExpandLevelByRowIndex(this.rowIndex);
            const expandLevels = expandLevelsByIndex <= this.tableService.expandLevels ? expandLevelsByIndex : this.tableService.expandLevels;
            return of([...Array(expandLevels).keys()]);
        }
        return of([]);
    }
    hasTooltip(key, row) {
        return !isNullOrUndefined(this.getCellTooltip(key, row));
    }
    getCellTooltip(key, row) {
        // eslint-disable-next-line
        const rowMetaData = row['rowMetaData'];
        return !!rowMetaData && !!rowMetaData.cellToolTip ? rowMetaData.cellToolTip[key] : null;
    }
    infoIconOnHooverToolTip(options, row) {
        return options?.infoIconForRowOnHover ? options?.infoIconForRowOnHover(row) : '';
    }
    rowRemoveIconOptions(options, row) {
        return {
            hideRemoveIcon: options?.remove && options?.isRemoveIconHiddenForRow && options?.isRemoveIconHiddenForRow(row)
        };
    }
    constructor(tableService, cdRef, injector) {
        this.tableService = tableService;
        this.cdRef = cdRef;
        this.injector = injector;
        this.rowRemoved = new EventEmitter();
        this.selectedChange = new EventEmitter();
        this.expandRow = new EventEmitter();
        this.columnsData = [];
        this.cellShown = this.showCell.bind(this);
        this.attrRowspan = this.getAttrRowspan.bind(this);
        /** @internal */
        this.tableTestIdModifiers = TableTestIdModifiers;
        /** @internal */
        this.testIdsService = this.injector.get(TestIdsService);
    }
    ngOnInit() {
        this.dataRowIndex = this.rowIndex;
        this.expandArrowIconName = { iconName: 'arrow-right', iconVersion: 'v3' };
        if (this.isRowTotal) {
            Object.assign(this.row, { isRowTotal: true });
        }
    }
    ngOnChanges({ options, columns, row }) {
        const activeOptions = options?.currentValue || this.options;
        const activeColumns = columns?.currentValue || this.columns;
        const activeRow = row?.currentValue || this.row;
        if (options?.currentValue || columns?.currentValue || row?.currentValue) {
            this.columnsData = this.getColumnsData(activeColumns, activeOptions, activeRow);
        }
    }
    onDataChange(options, rowKey) {
        this.tableService.toggleRowInRequest(this.row, true);
        this.tableService.rowModelChange.emit({
            rowIndex: this.rowIndex,
            rowSpanIndex: this.rowSpanIndex ?? 0,
            rowModel: this.row,
            keyChanged: rowKey,
            newValue: options.newValue,
            prevValue: options.prevValue,
            onRequestDone: (state, error, stayInEditOnCancel = false) => {
                this.tableService.toggleRowInRequest(this.row, false);
                if (options.onCellRequestDone) {
                    options.onCellRequestDone(state, error, stayInEditOnCancel);
                }
                this.cdRef.markForCheck();
            }
        });
    }
    trackByFn(index, item) {
        if (!item) {
            return null;
        }
        return item.key ? item.key : index;
    }
    showExpandIcon() {
        const hasKeyToIgnore = this.options && this.options.rowsExpandableOptions && this.options.rowsExpandableOptions.keyToIgnore;
        if (!hasKeyToIgnore) {
            return this.isInnerRow ? this.isInnerRowExpandable : !this.isRowTotal;
        }
        return !this.isRowTotal && !this.row[this.options.rowsExpandableOptions.keyToIgnore] && this.isInnerRowExpandable;
    }
    getCellColspan(isFirstDataCell, cellColspan, expandLevel) {
        if (isFirstDataCell && expandLevel) {
            if (this.isInnerRow) {
                const colspan = !isNullOrUndefined(cellColspan) ? cellColspan : 0;
                return colspan + (expandLevel + 1 - this.tableService.getExpandLevelByRowIndex(this.rowIndex));
            }
            return expandLevel + 1 - this.tableService.getExpandLevelByRowIndex(this.rowIndex);
        }
        return cellColspan;
    }
    getAttrRowspan(columnKey) {
        let rowSpan = 0;
        const maxRowspan = this.tableService.getMaxRowspanInColumn(this.row);
        if (columnKey === 'cell-expand') {
            rowSpan = maxRowspan;
        }
        else {
            const multiRowsKeys = this.tableService.getRowspanColumnsData(this.row);
            if (!isNullOrUndefined(multiRowsKeys) && isNullOrUndefined(this.rowSpanIndex)) {
                rowSpan = maxRowspan - multiRowsKeys[columnKey];
            }
        }
        return rowSpan > 0 ? rowSpan : null;
    }
    /**
     * Show regular cell "isNullOrUndefined(this.rowSpanIndex)"
     * or if cell has rowspan index "!isNullOrUndefined(this.rowSpanIndex)" and key for multirow
     * @internal
     */
    showCell(columnKey) {
        if (columnKey.startsWith('cell-expand')) {
            return isNullOrUndefined(this.rowSpanIndex);
        }
        const multiRowsKeys = this.tableService.getRowspanColumnsData(this.row);
        return isNullOrUndefined(this.rowSpanIndex) || (!isNullOrUndefined(this.rowSpanIndex) && multiRowsKeys[columnKey] !== 0);
    }
    getColumnsData(columns, options, row) {
        return columns.map((column, index) => {
            const isLast = index === columns.length - 1;
            const isFirst = index === 0;
            return {
                classes: this.tableService.getColumnClasses(column),
                tooltip: this.getCellTooltip(column.key, row),
                hasTooltip: this.hasTooltip(column.key, row),
                isRemove: this.tableService.isRemove(isLast, options, this.rowRemoveIconOptions(options, row)),
                infoIconOnHoverTooltip: isLast ? this.infoIconOnHooverToolTip(options, row) : '',
                styles: this.tableService.getColumnStyle(column),
                colspan: this.getCellColspan(isFirst, column.colspan, this.tableService.expandLevels),
                width: this.tableService.setWidth(isLast, column.width)
            };
        });
    }
    static { this.ɵfac = function TableRowComponent_Factory(t) { return new (t || TableRowComponent)(i0.ɵɵdirectiveInject(i1.TableService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Injector)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableRowComponent, selectors: [["", "fusionTableRow", ""]], hostVars: 9, hostBindings: function TableRowComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵattribute("data-row-idx", ctx.dataRowIndex);
            i0.ɵɵclassProp("is-row-expanded", ctx.isRowExpanded)("is-inner-row-expandable", ctx.isInnerRowExpandable)("is-with-totals", ctx.isRowTotal)("is-row-readonly", ctx.isRowReadOnly);
        } }, inputs: { rowIndex: "rowIndex", rowSpanIndex: "rowSpanIndex", row: "row", options: "options", columns: "columns", isRemovableOnHover: "isRemovableOnHover", isRowSelected: "isRowSelected", isExpanded: "isExpanded", isInnerRow: "isInnerRow", hasAfterSticky: "hasAfterSticky", testId: "testId" }, outputs: { rowRemoved: "rowRemoved", selectedChange: "selectedChange", expandRow: "expandRow" }, features: [i0.ɵɵNgOnChangesFeature], attrs: _c0, decls: 3, vars: 5, consts: [[4, "ngFor", "ngForOf"], [4, "ngFor", "ngForOf", "ngForTrackBy"], ["class", "expand-cell", 3, "total-row", "expanded", "inner-row", "sticky-left", 4, "ngIf"], [1, "expand-cell"], ["class", "icon-expand", 3, "name", "click", 4, "ngIf"], [1, "icon-expand", 3, "name", "click"], ["fusionTableCell", "", 3, "fusionTooltip", "data", "row", "rowIndex", "rowSpanIndex", "column", "options", "position", "isRemove", "infoIconTooltip", "isRowSelected", "isLastColumn", "isReadOnly", "customClass", "class", "cell-tooltip", "after-sticky", "inner-row", "ngStyle", "width", "remove", "selectedChange", "dataChange", 4, "ngIf"], ["fusionTableCell", "", 3, "fusionTooltip", "data", "row", "rowIndex", "rowSpanIndex", "column", "options", "position", "isRemove", "infoIconTooltip", "isRowSelected", "isLastColumn", "isReadOnly", "customClass", "ngStyle", "remove", "selectedChange", "dataChange"]], template: function TableRowComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, TableRowComponent_ng_container_0_Template, 3, 4, "ng-container", 0);
            i0.ɵɵpipe(1, "async");
            i0.ɵɵtemplate(2, TableRowComponent_ng_container_2_Template, 3, 4, "ng-container", 1);
        } if (rf & 2) {
            i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(1, 3, ctx.expandCellCount));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngForOf", ctx.columns)("ngForTrackBy", ctx.trackByFn);
        } }, dependencies: [i2.NgForOf, i2.NgIf, i2.NgStyle, i3.IconComponent, i4.TooltipDirective, i5.TableCellComponent, i2.AsyncPipe, i6.GenericPipe], styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}.font-heading-6[_ngcontent-%COMP%], .font-heading-5[_ngcontent-%COMP%], .font-heading-4[_ngcontent-%COMP%], .font-heading-3[_ngcontent-%COMP%], .font-heading-2[_ngcontent-%COMP%], .font-heading-1[_ngcontent-%COMP%]{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1[_ngcontent-%COMP%]{font-size:60px}.font-heading-2[_ngcontent-%COMP%]{font-size:32px}.font-heading-3[_ngcontent-%COMP%]{font-size:22px}.font-heading-4[_ngcontent-%COMP%]{font-size:18px}.font-heading-5[_ngcontent-%COMP%]{font-size:15px}.font-heading-6[_ngcontent-%COMP%]{font-size:13px}.font-heading-label[_ngcontent-%COMP%]{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}.font-caption[_ngcontent-%COMP%], .font-bodyXSmall[_ngcontent-%COMP%], .font-bodySmall[_ngcontent-%COMP%], .font-bodyMedium[_ngcontent-%COMP%], .font-bodyLarge[_ngcontent-%COMP%]{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong[_ngcontent-%COMP%], .font-bodySmallStrong[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge[_ngcontent-%COMP%], .font-bodyLargeStrong[_ngcontent-%COMP%]{font-size:16px}.font-bodyMedium[_ngcontent-%COMP%], .font-bodyMediumStrong[_ngcontent-%COMP%]{font-size:14px}.font-bodySmall[_ngcontent-%COMP%], .font-bodySmallStrong[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.font-bodyXSmall[_ngcontent-%COMP%], .font-bodyXSmallStrong[_ngcontent-%COMP%]{font-size:12px;letter-spacing:.24px}.font-caption[_ngcontent-%COMP%]{font-size:11px}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}.on-scroll-right[_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll[_ngcontent-%COMP%]:after, .on-scroll-right   [_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll[_ngcontent-%COMP%]:after{content:\"\";position:absolute;top:0;height:100%}[_nghost-%COMP%]   td[_ngcontent-%COMP%]:not(:last-child){border-right:var(--table-body-border, none)}[_nghost-%COMP%]:nth-child(odd){background-color:var(--table-odd-row-background-color, var(--fu-white, #ffffff))}[_nghost-%COMP%]:nth-child(2n){background-color:var(--table-even-row-background-color, var(--fu-white, #ffffff))}[_nghost-%COMP%]:hover   td[_ngcontent-%COMP%], .fu-hovered[_nghost-%COMP%]   td[_ngcontent-%COMP%], [_nghost-%COMP%]:has(.fu-button-holder.fu-row-menu-shown)   td[_ngcontent-%COMP%]{background-color:var(--fu-light-50, #F7F8F9)}[_nghost-%COMP%]:hover   td.inner-row[_ngcontent-%COMP%], [_nghost-%COMP%]:hover   td.sticky-left[_ngcontent-%COMP%], .fu-hovered[_nghost-%COMP%]   td.inner-row[_ngcontent-%COMP%], .fu-hovered[_nghost-%COMP%]   td.sticky-left[_ngcontent-%COMP%], [_nghost-%COMP%]:has(.fu-button-holder.fu-row-menu-shown)   td.inner-row[_ngcontent-%COMP%], [_nghost-%COMP%]:has(.fu-button-holder.fu-row-menu-shown)   td.sticky-left[_ngcontent-%COMP%]{background-color:var(--fu-light-50, #F7F8F9)}.is-row-in-request[_nghost-%COMP%]   td[_ngcontent-%COMP%], .is-row-disabled[_nghost-%COMP%]   td[_ngcontent-%COMP%]{position:relative}.is-row-in-request[_nghost-%COMP%]   td[_ngcontent-%COMP%]:after, .is-row-disabled[_nghost-%COMP%]   td[_ngcontent-%COMP%]:after{content:\"\";background-color:var(--fu-white, #ffffff);width:100%;height:100%;top:0;left:0;position:absolute;opacity:.3}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%]{width:32px;padding-left:16px;text-align:center;border-top:1px solid var(--fu-light-400, #DDDFE1);border-bottom:1px solid var(--fu-light-400, #DDDFE1)}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%]   fusion-icon[class^=icon-expand][_ngcontent-%COMP%]{width:16px;height:16px;cursor:pointer;display:block;margin-top:3px}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%]   fusion-icon[class^=icon-expand][_ngcontent-%COMP%]     svg{width:16px;height:16px}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%]   fusion-icon[class^=icon-expand][_ngcontent-%COMP%]     svg *{fill:var(--fu-black-500, #53575B)}[_nghost-%COMP%]   td.expand-cell.expanded[_ngcontent-%COMP%]   fusion-icon[class^=icon-expand][_ngcontent-%COMP%]     svg{width:16px;height:16px;transform:rotate(90deg)}[_nghost-%COMP%]   td.expand-cell.expanded[_ngcontent-%COMP%]   fusion-icon[class^=icon-expand][_ngcontent-%COMP%]     svg *{fill:var(--fu-black-500, #53575B)}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%] + td[_ngcontent-%COMP%]{padding-left:8px;border-left:none}[_nghost-%COMP%]   td.sticky-left[_ngcontent-%COMP%]{background-color:var(--fu-white, #ffffff);position:sticky;left:0;z-index:2}[_nghost-%COMP%]   td.fu-border-left[_ngcontent-%COMP%]{border-left:solid 1px var(--fu-light-400, #DDDFE1)}.is-with-totals[_nghost-%COMP%]:hover   td[_ngcontent-%COMP%]{background-color:var(--fu-white, #ffffff)}.is-inner-row-expandable[_nghost-%COMP%]   td.expand-cell.inner-row[_ngcontent-%COMP%]{border-top:1px solid var(--fu-light-400, #DDDFE1);border-bottom:1px solid var(--fu-light-400, #DDDFE1)}.is-inner-row-expandable[_nghost-%COMP%]   td.inner-row[_ngcontent-%COMP%]{background-color:var(--fu-light-200, #EDEFF0)}.on-scroll-right[_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll[_ngcontent-%COMP%]:after, .on-scroll-right   [_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll[_ngcontent-%COMP%]:after{width:1px;right:0;box-shadow:2px 3px 5px #0009}.on-scroll-right[_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll.after-sticky[_ngcontent-%COMP%]:before, .on-scroll-right   [_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll.after-sticky[_ngcontent-%COMP%]:before{content:\"\";width:100%;height:26px;position:absolute;bottom:-27px;left:0;box-shadow:4px 3px 5px 0 var(--fu-light-500, #D2D5D8);background-color:var(--fu-light-100, #F1F3F4)}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableRowComponent, [{
        type: Component,
        args: [{ selector: '[fusionTableRow]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let expandCell of expandCellCount | async; let isLast = last; let idx=index\">\n    <td *ngIf=\"cellShown | generic:'cell-expand'\"\n        class=\"expand-cell\"\n        [class.total-row]=\"isRowTotal\"\n        [class.expanded]=\"isExpanded\"\n        [class.inner-row]=\"isInnerRow\"\n        [class.sticky-left]=\"options?.rowsExpandableOptions?.sticky\"\n        [attr.rowspan]=\"attrRowspan | generic:'cell-expand'\"\n        [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.CELL+'-r'+rowIndex+'-c'+idx)\"\n    >\n        <fusion-icon\n            *ngIf=\"isLast && showExpandIcon()\"\n            class=\"icon-expand\"\n            [name]=\"expandArrowIconName\"\n            (click)=\"expandRow.emit({rowIndex: rowIndex, row: row, isExpanded: !isExpanded})\"\n        >\n        </fusion-icon>\n    </td>\n</ng-container>\n<ng-container *ngFor=\"let column of columns; trackBy: trackByFn; let columnIndex = index; let isLast = last; let idx=index\">\n    <td *ngIf=\"cellShown | generic:column.key\"\n        fusionTableCell\n        [fusionTooltip]=\"columnsData[columnIndex]?.tooltip\"\n        [data]=\"row[column.key]\"\n        [row]=\"row\"\n        [rowIndex]=\"rowIndex\"\n        [rowSpanIndex]=\"rowSpanIndex\"\n        [column]=\"column\"\n        [options]=\"options\"\n        [position]=\"{x: rowIndex, y: columnIndex}\"\n        [isRemove]=\"columnsData[columnIndex]?.isRemove\"\n        [infoIconTooltip]=\"columnsData[columnIndex]?.infoIconOnHoverTooltip\"\n        [isRowSelected]=\"isRowSelected\"\n        [isLastColumn]=\"isLast\"\n        [isReadOnly]=\"isRowReadOnly\"\n        [customClass]=\"row['customClass']\"\n        [class]=\"columnsData[columnIndex]?.classes\"\n        [class.cell-tooltip]=\"columnsData[columnIndex]?.hasTooltip\"\n        [class.after-sticky]=\"hasAfterSticky\"\n        [class.inner-row]=\"isInnerRow\"\n        [ngStyle]=\"columnsData[columnIndex]?.styles\"\n        [style.width]=\"columnsData[columnIndex]?.width\"\n        [attr.colspan]=\"columnsData[columnIndex]?.colspan\"\n        [attr.rowspan]=\"attrRowspan | generic:column.key\"\n        [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.CELL+'-r'+rowIndex+'-c'+idx)\"\n        (remove)=\"rowRemoved.emit()\"\n        (selectedChange)=\"selectedChange.emit($event)\"\n        (dataChange)=\"onDataChange($event, column.key)\"\n    ></td>\n</ng-container>\n", styles: ["@font-face{font-family:NHaasGroteskDSPro;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-75Bd.ttf) format(\"truetype\")}@font-face{font-family:NHaasGroteskDSPro-65Md;src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot);src:url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/NHaasGroteskDSPro-65Md.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue.ttf) format(\"truetype\")}@font-face{font-family:HelveticaNeue-Medium;src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot);src:url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.eot?#iefix) format(\"embedded-opentype\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff2) format(\"woff2\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.woff) format(\"woff\"),url(https://fusion.ironsrc.net/assets/fonts/HelveticaNeue-Medium.ttf) format(\"truetype\")}.font-heading-6,.font-heading-5,.font-heading-4,.font-heading-3,.font-heading-2,.font-heading-1{font-family:NHaasGroteskDSPro,sans-serif}.font-heading-1{font-size:60px}.font-heading-2{font-size:32px}.font-heading-3{font-size:22px}.font-heading-4{font-size:18px}.font-heading-5{font-size:15px}.font-heading-6{font-size:13px}.font-heading-label{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;letter-spacing:.25px}.font-caption,.font-bodyXSmall,.font-bodySmall,.font-bodyMedium,.font-bodyLarge{font-family:HelveticaNeue,helvetica,sans-serif;line-height:1.5}.font-bodyXSmallStrong,.font-bodySmallStrong,.font-bodyMediumStrong,.font-bodyLargeStrong{font-family:HelveticaNeue-Medium,helvetica,sans-serif;line-height:1.5}.font-bodyLarge,.font-bodyLargeStrong{font-size:16px}.font-bodyMedium,.font-bodyMediumStrong{font-size:14px}.font-bodySmall,.font-bodySmallStrong{font-size:13px;letter-spacing:.24px}.font-bodyXSmall,.font-bodyXSmallStrong{font-size:12px;letter-spacing:.24px}.font-caption{font-size:11px}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host-context(.on-scroll-right) .sticky-left.display-shadow-on-scroll:after{content:\"\";position:absolute;top:0;height:100%}:host td:not(:last-child){border-right:var(--table-body-border, none)}:host:nth-child(odd){background-color:var(--table-odd-row-background-color, var(--fu-white, #ffffff))}:host:nth-child(2n){background-color:var(--table-even-row-background-color, var(--fu-white, #ffffff))}:host:hover td,:host.fu-hovered td,:host:has(.fu-button-holder.fu-row-menu-shown) td{background-color:var(--fu-light-50, #F7F8F9)}:host:hover td.inner-row,:host:hover td.sticky-left,:host.fu-hovered td.inner-row,:host.fu-hovered td.sticky-left,:host:has(.fu-button-holder.fu-row-menu-shown) td.inner-row,:host:has(.fu-button-holder.fu-row-menu-shown) td.sticky-left{background-color:var(--fu-light-50, #F7F8F9)}:host.is-row-in-request td,:host.is-row-disabled td{position:relative}:host.is-row-in-request td:after,:host.is-row-disabled td:after{content:\"\";background-color:var(--fu-white, #ffffff);width:100%;height:100%;top:0;left:0;position:absolute;opacity:.3}:host td.expand-cell{width:32px;padding-left:16px;text-align:center;border-top:1px solid var(--fu-light-400, #DDDFE1);border-bottom:1px solid var(--fu-light-400, #DDDFE1)}:host td.expand-cell fusion-icon[class^=icon-expand]{width:16px;height:16px;cursor:pointer;display:block;margin-top:3px}:host td.expand-cell fusion-icon[class^=icon-expand] ::ng-deep svg{width:16px;height:16px}:host td.expand-cell fusion-icon[class^=icon-expand] ::ng-deep svg *{fill:var(--fu-black-500, #53575B)}:host td.expand-cell.expanded fusion-icon[class^=icon-expand] ::ng-deep svg{width:16px;height:16px;transform:rotate(90deg)}:host td.expand-cell.expanded fusion-icon[class^=icon-expand] ::ng-deep svg *{fill:var(--fu-black-500, #53575B)}:host td.expand-cell+td{padding-left:8px;border-left:none}:host td.sticky-left{background-color:var(--fu-white, #ffffff);position:sticky;left:0;z-index:2}:host td.fu-border-left{border-left:solid 1px var(--fu-light-400, #DDDFE1)}:host.is-with-totals:hover td{background-color:var(--fu-white, #ffffff)}:host.is-inner-row-expandable td.expand-cell.inner-row{border-top:1px solid var(--fu-light-400, #DDDFE1);border-bottom:1px solid var(--fu-light-400, #DDDFE1)}:host.is-inner-row-expandable td.inner-row{background-color:var(--fu-light-200, #EDEFF0)}:host-context(.on-scroll-right) .sticky-left.display-shadow-on-scroll:after{width:1px;right:0;box-shadow:2px 3px 5px #0009}:host-context(.on-scroll-right) .sticky-left.display-shadow-on-scroll.after-sticky:before{content:\"\";width:100%;height:26px;position:absolute;bottom:-27px;left:0;box-shadow:4px 3px 5px 0 var(--fu-light-500, #D2D5D8);background-color:var(--fu-light-100, #F1F3F4)}\n"] }]
    }], () => [{ type: i1.TableService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], { rowIndex: [{
            type: Input
        }], rowSpanIndex: [{
            type: Input
        }], row: [{
            type: Input
        }], options: [{
            type: Input
        }], columns: [{
            type: Input
        }], isRemovableOnHover: [{
            type: Input
        }], isRowSelected: [{
            type: Input
        }], isExpanded: [{
            type: Input
        }], isInnerRow: [{
            type: Input
        }], hasAfterSticky: [{
            type: Input
        }], testId: [{
            type: Input
        }], rowRemoved: [{
            type: Output
        }], selectedChange: [{
            type: Output
        }], expandRow: [{
            type: Output
        }], dataRowIndex: [{
            type: HostBinding,
            args: ['attr.data-row-idx']
        }], isRowExpanded: [{
            type: HostBinding,
            args: ['class.is-row-expanded']
        }], isInnerRowExpandable: [{
            type: HostBinding,
            args: ['class.is-inner-row-expandable']
        }], isRowTotal: [{
            type: HostBinding,
            args: ['class.is-with-totals']
        }], isRowReadOnly: [{
            type: HostBinding,
            args: ['class.is-row-readonly']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableRowComponent, { className: "TableRowComponent", filePath: "components/table-row/table-row.component.ts", lineNumber: 31 }); })();
//# sourceMappingURL=data:application/json;base64, 