import { Component, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/button/v1";
function ModalFooterComponent_button_4_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 5);
    i0.ɵɵlistener("click", function ModalFooterComponent_button_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeButtonClicked.emit()); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassMap(ctx_r1.cancelButtonClass);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", ctx_r1.cancelButtonText, " ");
} }
export class ModalFooterComponent {
    constructor() {
        this.loading = false;
        this.error = '';
        this.saveButtonText = 'Save';
        this.saveButtonClass = 'primary';
        this.saveButtonDisabled = false;
        this.saveButtonLoading = false;
        this.cancelButtonText = 'Cancel';
        this.cancelButtonClass = 'secondary';
        // eslint-disable-next-line
        this.onSave = new EventEmitter();
        // eslint-disable-next-line
        this.closeButtonClicked = new EventEmitter();
    }
    static { this.ɵfac = function ModalFooterComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ModalFooterComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ModalFooterComponent, selectors: [["fusion-modal-footer"]], inputs: { loading: "loading", error: "error", saveButtonText: "saveButtonText", saveButtonClass: "saveButtonClass", saveButtonDisabled: "saveButtonDisabled", saveButtonLoading: "saveButtonLoading", cancelButtonText: "cancelButtonText", cancelButtonClass: "cancelButtonClass", cancelButtonHidden: "cancelButtonHidden", notificationFooter: "notificationFooter" }, outputs: { onSave: "onSave", closeButtonClicked: "closeButtonClicked" }, decls: 7, vars: 7, consts: [[1, "modal-footer"], [1, "footer"], [1, "fu-error-message"], ["fusion-button", "", 3, "class", "click", 4, "ngIf"], ["fusion-button", "", 3, "click", "loading", "disabled"], ["fusion-button", "", 3, "click"]], template: function ModalFooterComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "span", 2);
            i0.ɵɵtext(3);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(4, ModalFooterComponent_button_4_Template, 2, 3, "button", 3);
            i0.ɵɵelementStart(5, "button", 4);
            i0.ɵɵlistener("click", function ModalFooterComponent_Template_button_click_5_listener() { return ctx.onSave.emit(); });
            i0.ɵɵtext(6);
            i0.ɵɵelementEnd()()();
        } if (rf & 2) {
            i0.ɵɵadvance(3);
            i0.ɵɵtextInterpolate(ctx.error);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.cancelButtonHidden);
            i0.ɵɵadvance();
            i0.ɵɵclassMap(ctx.saveButtonClass);
            i0.ɵɵproperty("loading", ctx.saveButtonLoading)("disabled", ctx.saveButtonDisabled || ctx.loading || !!ctx.error);
            i0.ɵɵadvance();
            i0.ɵɵtextInterpolate1(" ", ctx.saveButtonText, " ");
        } }, dependencies: [i1.NgIf, i2.ButtonComponent], styles: ["[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-radius:var(--border-radius, 3px)}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top:1px solid var(--light-color, #E1E6EB)}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top-right-radius:0!important}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{border-top-left-radius:0!important}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{height:62px;background-color:var(--light-color-100, #F9FAFB);padding:15px 30px 15px 15px;box-sizing:border-box}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]{text-align:right}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   button[_ngcontent-%COMP%]{vertical-align:middle}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   button[_ngcontent-%COMP%] + button[_ngcontent-%COMP%]{margin-left:10px}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   div[_ngcontent-%COMP%]   .fu-error-message[_ngcontent-%COMP%]{color:var(--negative-color, #e1174c);margin-right:15px}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModalFooterComponent, [{
        type: Component,
        args: [{ selector: 'fusion-modal-footer', template: "<div class=\"modal-footer\">\n    <div class=\"footer\">\n        <span class=\"fu-error-message\">{{ error }}</span>\n        <button\n            fusion-button\n            [class]=\"cancelButtonClass\"\n            (click)=\"closeButtonClicked.emit()\"\n            *ngIf=\"!cancelButtonHidden\"\n        >\n            {{ cancelButtonText }}\n        </button>\n        <button\n            fusion-button\n            [class]=\"saveButtonClass\"\n            [loading]=\"saveButtonLoading\"\n            [disabled]=\"saveButtonDisabled || loading || !!error\"\n            (click)=\"onSave.emit()\"\n        >\n            {{ saveButtonText }}\n        </button>\n    </div>\n</div>\n", styles: [":host .modal-footer{border-radius:var(--border-radius, 3px)}:host .modal-footer{border-top:1px solid var(--light-color, #E1E6EB)}:host .modal-footer{border-top-right-radius:0!important}:host .modal-footer{border-top-left-radius:0!important}:host .modal-footer{height:62px;background-color:var(--light-color-100, #F9FAFB);padding:15px 30px 15px 15px;box-sizing:border-box}:host .modal-footer div{text-align:right}:host .modal-footer div button{vertical-align:middle}:host .modal-footer div button+button{margin-left:10px}:host .modal-footer div .fu-error-message{color:var(--negative-color, #e1174c);margin-right:15px}\n"] }]
    }], null, { loading: [{
            type: Input
        }], error: [{
            type: Input
        }], saveButtonText: [{
            type: Input
        }], saveButtonClass: [{
            type: Input
        }], saveButtonDisabled: [{
            type: Input
        }], saveButtonLoading: [{
            type: Input
        }], cancelButtonText: [{
            type: Input
        }], cancelButtonClass: [{
            type: Input
        }], cancelButtonHidden: [{
            type: Input
        }], notificationFooter: [{
            type: Input
        }], onSave: [{
            type: Output
        }], closeButtonClicked: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ModalFooterComponent, { className: "ModalFooterComponent", filePath: "components/modal-footer/modal-footer.component.ts", lineNumber: 8 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9kYWwtZm9vdGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21vZGFsL3YxL2NvbXBvbmVudHMvbW9kYWwtZm9vdGVyL21vZGFsLWZvb3Rlci5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9mdXNpb24tdWkvY29tcG9uZW50cy9tb2RhbC92MS9jb21wb25lbnRzL21vZGFsLWZvb3Rlci9tb2RhbC1mb290ZXIuY29tcG9uZW50Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFDLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBQyxNQUFNLGVBQWUsQ0FBQzs7Ozs7O0lDRzdELGlDQUtDO0lBRkcsbUxBQVMsZ0NBQXlCLEtBQUM7SUFHbkMsWUFDSjtJQUFBLGlCQUFTOzs7SUFMTCx1Q0FBMkI7SUFJM0IsY0FDSjtJQURJLHdEQUNKOztBREhSLE1BQU0sT0FBTyxvQkFBb0I7SUFMakM7UUFNYSxZQUFPLEdBQUcsS0FBSyxDQUFDO1FBQ2hCLFVBQUssR0FBRyxFQUFFLENBQUM7UUFDWCxtQkFBYyxHQUFHLE1BQU0sQ0FBQztRQUN4QixvQkFBZSxHQUFHLFNBQV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