import { Component, EventEmitter, Injector, Input, Output } from '@angular/core';
import { ModalTestIdModifiers } from '@ironsource/fusion-ui/entities';
import { TestIdsService } from '@ironsource/fusion-ui/services/test-ids';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/button/v3";
import * as i3 from "@ironsource/fusion-ui/pipes/generic";
function ModalFooterComponent_fusion_button_4_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-button", 4);
    i0.ɵɵlistener("click", function ModalFooterComponent_fusion_button_4_Template_fusion_button_click_0_listener() { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.closeButtonClicked.emit()); });
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵclassMap(ctx_r0.cancelButtonClass);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 4, ctx_r0.testIdsService.getTestAttribute.bind(ctx_r0), ctx_r0.testId, ctx_r0.modalTestIdModifiers.MODAL_CANCEL_BUTTON));
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate1(" ", ctx_r0.cancelButtonText, " ");
} }
export class ModalFooterComponent {
    set cancelButton(config) {
        this.cancelButtonText = config?.cancelButtonText;
        this.cancelButtonClass = config?.cancelButtonClass;
        this.cancelButtonHidden = config?.cancelButtonHidden;
    }
    set submitButton(config) {
        this.submitButtonText = config?.submitButtonText;
        this.submitButtonClass = config?.submitButtonClass;
        this.submitButtonDisabled = config?.submitButtonDisabled;
    }
    constructor(injector) {
        this.injector = injector;
        this.submitButtonPending = false;
        this.primaryButtonClicked = new EventEmitter();
        this.closeButtonClicked = new EventEmitter();
        /** @internal */
        this.modalTestIdModifiers = ModalTestIdModifiers;
        /** @internal */
        this.testIdsService = this.injector.get(TestIdsService);
        /** @internal */
        this.submitButtonDisabled = false;
    }
    static { this.ɵfac = function ModalFooterComponent_Factory(t) { return new (t || ModalFooterComponent)(i0.ɵɵdirectiveInject(i0.Injector)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ModalFooterComponent, selectors: [["fusion-modal-footer"]], inputs: { submitButtonPending: "submitButtonPending", cancelButton: "cancelButton", submitButton: "submitButton", error: "error", testId: "testId" }, outputs: { primaryButtonClicked: "primaryButtonClicked", closeButtonClicked: "closeButtonClicked" }, decls: 8, vars: 17, consts: [[1, "modal-footer"], [1, "fu-error-message"], ["class", "fu-secondary-button", 3, "class", "click", 4, "ngIf"], [1, "fu-primary-button", 3, "loading", "disabled", "click"], [1, "fu-secondary-button", 3, "click"]], template: function ModalFooterComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "span", 1);
            i0.ɵɵpipe(2, "generic");
            i0.ɵɵtext(3);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(4, ModalFooterComponent_fusion_button_4_Template, 3, 8, "fusion-button", 2);
            i0.ɵɵelementStart(5, "fusion-button", 3);
            i0.ɵɵlistener("click", function ModalFooterComponent_Template_fusion_button_click_5_listener() { return ctx.primaryButtonClicked.emit(); });
            i0.ɵɵpipe(6, "generic");
            i0.ɵɵtext(7);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(2, 9, ctx.testIdsService.getTestAttribute.bind(ctx), ctx.testId, ctx.modalTestIdModifiers.MODAL_ERROR));
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate(ctx.error);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.cancelButtonHidden);
            i0.ɵɵadvance();
            i0.ɵɵclassMap(ctx.submitButtonClass);
            i0.ɵɵproperty("loading", ctx.submitButtonPending)("disabled", ctx.submitButtonDisabled || !!ctx.error);
            i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(6, 13, ctx.testIdsService.getTestAttribute.bind(ctx), ctx.testId, ctx.modalTestIdModifiers.MODAL_SUBMIT_BUTTON));
            i0.ɵɵadvance(2);
            i0.ɵɵtextInterpolate1(" ", ctx.submitButtonText, " ");
        } }, dependencies: [i1.NgIf, i2.ButtonComponent, i3.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%], [_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   .fu-error-message[_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}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   .fu-error-message[_ngcontent-%COMP%], .font-bodySmall[_ngcontent-%COMP%]{font-size:13px;letter-spacing:.24px}.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}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}@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}}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{display:flex;align-items:center;gap:4px;border-top:1px solid var(--fu-light-400, #DDDFE1);height:56px;width:100%;padding:12px 16px;box-sizing:border-box}[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   .fu-error-message[_ngcontent-%COMP%]{color:var(--fu-negative-500, #FF6A63);flex-grow:1}.fu-small[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{height:48px}.fu-alignment-left[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]{flex-direction:row-reverse}.fu-alignment-left[_nghost-%COMP%]   .modal-footer[_ngcontent-%COMP%]   .fu-error-message[_ngcontent-%COMP%]{text-align:right}"] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModalFooterComponent, [{
        type: Component,
        args: [{ selector: 'fusion-modal-footer', template: "<div class=\"modal-footer\">\n    <span class=\"fu-error-message\" [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:modalTestIdModifiers.MODAL_ERROR\">{{ error }}</span>\n    <fusion-button class=\"fu-secondary-button\"\n        [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:modalTestIdModifiers.MODAL_CANCEL_BUTTON\"\n        [class]=\"cancelButtonClass\"\n        (click)=\"closeButtonClicked.emit()\"\n        *ngIf=\"!cancelButtonHidden\"\n    >\n        {{ cancelButtonText }}\n    </fusion-button>\n    <fusion-button class=\"fu-primary-button\"\n        [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:modalTestIdModifiers.MODAL_SUBMIT_BUTTON\"\n        [class]=\"submitButtonClass\"\n        [loading]=\"submitButtonPending\"\n        [disabled]=\"submitButtonDisabled || !!error\"\n        (click)=\"primaryButtonClicked.emit()\"\n    >\n        {{ submitButtonText }}\n    </fusion-button>\n</div>\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,:host .modal-footer .fu-error-message,.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}:host .modal-footer .fu-error-message,.font-bodySmall{font-size:13px;letter-spacing:.24px}.font-bodySmallStrong{font-size:13px;letter-spacing:.24px}.font-bodyXSmall,.font-bodyXSmallStrong{font-size:12px;letter-spacing:.24px}.font-caption{font-size:11px}:host .modal-footer *{box-sizing:border-box}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host .modal-footer{display:flex;align-items:center;gap:4px;border-top:1px solid var(--fu-light-400, #DDDFE1);height:56px;width:100%;padding:12px 16px;box-sizing:border-box}:host .modal-footer .fu-error-message{color:var(--fu-negative-500, #FF6A63);flex-grow:1}:host.fu-small .modal-footer{height:48px}:host.fu-alignment-left .modal-footer{flex-direction:row-reverse}:host.fu-alignment-left .modal-footer .fu-error-message{text-align:right}\n"] }]
    }], () => [{ type: i0.Injector }], { submitButtonPending: [{
            type: Input
        }], cancelButton: [{
            type: Input
        }], submitButton: [{
            type: Input
        }], error: [{
            type: Input
        }], testId: [{
            type: Input
        }], primaryButtonClicked: [{
            type: Output
        }], closeButtonClicked: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ModalFooterComponent, { className: "ModalFooterComponent", filePath: "components/modal-footer/modal-footer.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64, 