import { ChangeDetectionStrategy, Component } from '@angular/core';
import { PopupBaseComponent } from '@ironsource/fusion-ui/components/popup/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/directives/click-outside";
import * as i3 from "@ironsource/fusion-ui/components/dynamic-components/v1";
const _c0 = ["*"];
function PopupComponent_fusion_dynamic_components_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-dynamic-components", 5, 2);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("element", ctx_r1.popupData == null ? null : ctx_r1.popupData.element)("component", ctx_r1.popupData == null ? null : ctx_r1.popupData.component.type)("componentData", ctx_r1.popupData == null ? null : ctx_r1.popupData.component.data);
} }
function PopupComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0);
} }
export class PopupComponent extends PopupBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵPopupComponent_BaseFactory; return function PopupComponent_Factory(__ngFactoryType__) { return (ɵPopupComponent_BaseFactory || (ɵPopupComponent_BaseFactory = i0.ɵɵgetInheritedFactory(PopupComponent)))(__ngFactoryType__ || PopupComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PopupComponent, selectors: [["fusion-popup"]], features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 5, vars: 7, consts: [["popupContainer", ""], ["template", ""], ["dynamicContent", ""], [1, "popupContainer", 3, "fusionClickOutside", "resize", "ngClass"], [3, "element", "component", "componentData", 4, "ngIf", "ngIfElse"], [3, "element", "component", "componentData"]], template: function PopupComponent_Template(rf, ctx) { if (rf & 1) {
            const _r1 = i0.ɵɵgetCurrentView();
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "div", 3, 0);
            i0.ɵɵlistener("fusionClickOutside", function PopupComponent_Template_div_fusionClickOutside_0_listener($event) { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onClickOutside($event)); })("resize", function PopupComponent_Template_div_resize_0_listener() { i0.ɵɵrestoreView(_r1); return i0.ɵɵresetView(ctx.onResize()); }, false, i0.ɵɵresolveWindow);
            i0.ɵɵtemplate(2, PopupComponent_fusion_dynamic_components_2_Template, 2, 3, "fusion-dynamic-components", 4)(3, PopupComponent_ng_template_3_Template, 1, 0, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            const template_r3 = i0.ɵɵreference(4);
            i0.ɵɵstyleProp("width", ctx.popupData == null ? null : ctx.popupData.size == null ? null : ctx.popupData.size.width, "px")("height", ctx.popupData == null ? null : ctx.popupData.size == null ? null : ctx.popupData.size.height, "px");
            i0.ɵɵproperty("ngClass", ctx.popupData == null ? null : ctx.popupData.location);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", (ctx.popupData == null ? null : ctx.popupData.component == null ? null : ctx.popupData.component.type) || (ctx.popupData == null ? null : ctx.popupData.element))("ngIfElse", template_r3);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.ClickOutsideDirective, i3.DynamicComponentsComponent], styles: ["[_nghost-%COMP%]   .popupContainer.element-related[_ngcontent-%COMP%]:after{margin-left:0;position:absolute;left:50%;transform:translate(-50%)}[_nghost-%COMP%]   .popupContainer[_ngcontent-%COMP%]{position:fixed;background-color:var(--background-color);z-index:3011}[_nghost-%COMP%]   .popupContainer.top-right[_ngcontent-%COMP%]{top:5px;right:5px}[_nghost-%COMP%]   .popupContainer.top-left[_ngcontent-%COMP%]{top:5px;left:5px}[_nghost-%COMP%]   .popupContainer.bottom-right[_ngcontent-%COMP%]{bottom:5px;right:5px}[_nghost-%COMP%]   .popupContainer.bottom-left[_ngcontent-%COMP%]{bottom:5px;left:5px}[_nghost-%COMP%]   .popupContainer.element-related[_ngcontent-%COMP%]{position:absolute}[_nghost-%COMP%]   .popupContainer.element-related[_ngcontent-%COMP%]:after{border:solid;border-color:transparent transparent var(--background-color) transparent;border-width:0 7px 4px;content:\"\";position:absolute;bottom:100%}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PopupComponent, [{
        type: Component,
        args: [{ selector: 'fusion-popup', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n    #popupContainer\n    class=\"popupContainer\"\n    [ngClass]=\"popupData?.location\"\n    [style.width.px]=\"popupData?.size?.width\"\n    [style.height.px]=\"popupData?.size?.height\"\n    (fusionClickOutside)=\"onClickOutside($event)\"\n    (window:resize)=\"onResize()\"\n>\n    <fusion-dynamic-components\n        #dynamicContent\n        *ngIf=\"popupData?.component?.type || popupData?.element; else template\"\n        [element]=\"popupData?.element\"\n        [component]=\"popupData?.component.type\"\n        [componentData]=\"popupData?.component.data\"\n    >\n    </fusion-dynamic-components>\n\n    <ng-template #template>\n        <ng-content></ng-content>\n    </ng-template>\n</div>\n", styles: [":host .popupContainer.element-related:after{margin-left:0;position:absolute;left:50%;transform:translate(-50%)}:host .popupContainer{position:fixed;background-color:var(--background-color);z-index:3011}:host .popupContainer.top-right{top:5px;right:5px}:host .popupContainer.top-left{top:5px;left:5px}:host .popupContainer.bottom-right{bottom:5px;right:5px}:host .popupContainer.bottom-left{bottom:5px;left:5px}:host .popupContainer.element-related{position:absolute}:host .popupContainer.element-related:after{border:solid;border-color:transparent transparent var(--background-color) transparent;border-width:0 7px 4px;content:\"\";position:absolute;bottom:100%}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PopupComponent, { className: "PopupComponent", filePath: "popup.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicG9wdXAuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvZnVzaW9uLXVpL2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