import { Component, Input } from '@angular/core';
import { SimpoElementsModule } from './../../elements/index';
import { CommonModule } from '@angular/common';
import { SimpoComponentModule } from '../../components/index';
import { BackgroundDirective } from '../../directive/background-directive';
import { ContentFitDirective } from '../../directive/content-fit-directive';
import { BorderDirective } from '../../directive/border-directive';
import { HoverDirective } from '../../directive/hover-element-directive';
import { OverlayDirective } from '../../directive/overlay-directive';
import BaseSection from '../BaseSection';
import { SpacingHorizontalDirective } from '../../directive/spacing-horizontal.directive';
import { ImageEditorDirective } from '../../directive/image-editor.directive';
import { TextEditorComponent } from '../../elements/text-editor/text-editor.component';
import { IconDirectiveDirective } from '../../directive/icon-directive.directive';
import { MatIconModule } from '@angular/material/icon';
import { GradientDirection } from '../../styles/index';
import { CornerDirective } from '../../directive/corner-directive';
import { AnimationDirective } from '../../directive/animation-directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "../../elements/svg-divider/svg-divider.component";
import * as i3 from "../../components/hover-elements/hover-elements.component";
import * as i4 from "../../components/delete-hover-element/delete-hover-element.component";
export class FourFeaturesCenteredImageComponent extends BaseSection {
    constructor() {
        super(...arguments);
        this.leftInputText = [];
        this.rightInputText = [];
    }
    get stylesLayout() {
        return { ...this.style?.layout };
    }
    ngOnInit() {
        this.initializeSection();
    }
    ngOnChanges(changes) {
        if (changes['data']) {
            this.initializeSection();
        }
    }
    initializeSection() {
        if (!this.data)
            return;
        this.content = this.data.content || {};
        this.style = this.data.styles || {};
        this.splitFeatures();
    }
    splitFeatures() {
        if (!this.content?.inputText?.length) {
            this.leftInputText = [];
            this.rightInputText = [];
            return;
        }
        const mid = Math.ceil(this.content.inputText.length / 2);
        this.leftInputText = this.content.inputText.slice(0, mid);
        this.rightInputText = this.content.inputText.slice(mid);
    }
    getIconBackground(icon) {
        if (icon?.backgroundType === 'Gradient') {
            const direction = GradientDirection[icon?.backgroundGradientDirection] || GradientDirection.DOWN;
            return `linear-gradient(${direction}, ${icon?.backgroundColor}, ${icon?.secondaryColor})`;
        }
        else {
            return icon?.backgroundColor;
        }
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FourFeaturesCenteredImageComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: FourFeaturesCenteredImageComponent, isStandalone: true, selector: "simpo-four-features-centered-image", inputs: { edit: "edit", data: "data", customClass: "customClass", nextComponentColor: "nextComponentColor", index: "index", delete: "delete" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<section>\r\n  <div [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" class=\"total-container\" [attr.style]=\"customClass\"\r\n    [simpoBackground]=\"style?.background\">\r\n    <div [id]=\"data?.id\" #mainContainer [simpoBorder]=\"style?.border\" [spacingHorizontal]=\"stylesLayout\"\r\n      [simpoLayout]=\"style?.layout\" class=\"sale-bar\" [simpoOverlay]=\"style?.background\">\r\n      <div class=\"features-wrapper\" [simpoAnimation]=\"style?.animation\">\r\n        <div>\r\n          <!-- Heading -->\r\n          <simpo-text-editor class=\"main-heading fs-1 fw-semibold\" [(value)]=\"content.heading.value\"\r\n            [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\">\r\n          </simpo-text-editor>\r\n\r\n          <!-- Description -->\r\n          <simpo-text-editor class=\"main-subheading description\" [(value)]=\"content.description.value\"\r\n            [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\">\r\n          </simpo-text-editor>\r\n        </div>\r\n\r\n        <!-- GRID -->\r\n        <div class=\"feature-grid\">\r\n          <!-- LEFT FEATURES -->\r\n          <div class=\"feature-column\">\r\n            <div class=\"feature-item d-flex flex-column\" *ngFor=\"let item of leftInputText; let i = index\">\r\n              <!-- <div class=\"logo-img\" [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\"> -->\r\n              <div class=\"logo-img\"\r\n                [style.background]=\"item?.icon?.showBackground ? getIconBackground(item?.icon) : 'transparent'\"\r\n                [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\">\r\n                <div [iconId]=\"data?.id + item.icon?.id\" [simpoIconDirective]=\"item.icon\" class=\"w-50 h-50\">\r\n                </div>\r\n              </div>\r\n\r\n              <simpo-text-editor class=\"feature-title my-2 fs-5 fw-semibold\" [(value)]=\"item.label\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\">\r\n              </simpo-text-editor>\r\n              <simpo-text-editor class=\"feature-text\" [(value)]=\"item.value\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\"></simpo-text-editor>\r\n            </div>\r\n          </div>\r\n\r\n          <!-- CENTER IMAGE -->\r\n          <div class=\"cta-image center-image\" [simpoCorner]=\"style?.corners\" style=\"overflow:hidden;\">\r\n\r\n            <img [src]=\"content?.image?.url\" [simpoCorner]=\"style?.corners\" [appImageEditor]=\"edit || false\"\r\n              [imageData]=\"content?.image\" [sectionId]=\"data?.id\" style=\"width:100%; height:100%; object-fit:cover;\">\r\n          </div>\r\n\r\n          <!-- RIGHT FEATURES -->\r\n          <div class=\"feature-column\">\r\n            <div class=\"feature-item d-flex flex-column align-items-start text-start\"\r\n              *ngFor=\"let item of rightInputText; let i = index\">\r\n              <!-- <div class=\"logo-img\" [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\"> -->\r\n              <div class=\"logo-img\"\r\n                [style.background]=\"item?.icon?.showBackground ? getIconBackground(item?.icon) : 'transparent'\"\r\n                [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\">\r\n                <div [iconId]=\"data?.id + item.icon?.id\" [simpoIconDirective]=\"item.icon\" class=\"w-50 h-50\">\r\n                </div>\r\n              </div>\r\n\r\n              <simpo-text-editor class=\"feature-title my-2 fs-5 fw-semibold\" [(value)]=\"item.label\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\">\r\n              </simpo-text-editor>\r\n              <simpo-text-editor class=\"feature-text\" [(value)]=\"item.value\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\"></simpo-text-editor>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n\r\n    <!-- Divider -->\r\n    <ng-container *ngIf=\"style?.devider?.display\">\r\n      <simpo-svg-divider [dividerType]=\"style?.devider?.deviderType\" [color]=\"nextComponentColor?.color\">\r\n      </simpo-svg-divider>\r\n    </ng-container>\r\n\r\n    <!-- EDIT SELECTOR -->\r\n    <div [ngClass]=\"{ hover_effect: edit }\" *ngIf=\"showEditors\">\r\n      <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\">\r\n      </simpo-hover-elements>\r\n    </div>\r\n\r\n    <!-- DELETE -->\r\n    <div *ngIf=\"showDelete\" [ngClass]=\"{ hover_effect: delete }\">\r\n      <simpo-delete-hover-element [data]=\"data\" [index]=\"index\">\r\n      </simpo-delete-hover-element>\r\n    </div>\r\n\r\n  </div>\r\n</section>", styles: [".total-container{position:relative}.sale-bar{padding:45px}.feature-text,.feature-title{width:100%}.main-heading{margin:0 auto;text-align:center}.main-subheading{margin:15px auto 0;text-align:center;line-height:1.6}.features-wrapper{text-align:center;margin-top:15px;width:100%}.feature-grid{display:flex;justify-content:space-between;align-items:center;width:100%;margin:45px 0 40px}.feature-column{display:flex;flex-direction:column;gap:60px;width:35%}.feature-item{width:100%;align-items:end}.feature-column:first-child .feature-item{text-align:right}.feature-column:last-child .feature-item{text-align:left}.logo-img{display:flex;justify-content:center;align-items:center}.logotype-boxed{box-shadow:0 2px 4px #0000002e;padding:10px}.cta-image{width:30%;display:flex;justify-content:center;align-items:center;margin:0 40px}.center-image{display:flex;justify-content:center;align-items:center;overflow:hidden}.center-image img{display:block;max-width:100%;height:auto}.description{display:flex;justify-content:center;text-align:center;padding:0 15%}@media (max-width: 992px){.feature-grid{flex-direction:column;align-items:center;gap:40px;margin:25px 0}.center-image{order:3;width:280px;margin:10px 0 25px}.feature-column{width:100%;align-items:center;gap:35px}.feature-item{text-align:center!important;align-items:center}.description{padding:0 8%}}@media (max-width: 768px){.sale-bar{padding:30px 20px}.center-image{width:230px}.description{padding:0 6%}.feature-column{gap:28px}}@media (max-width: 480px){.sale-bar{padding:25px 15px}.center-image{width:80%}.logo-img{height:70px!important;align-items:center!important;text-align:center!important}simpo-text-editor.fs-1{font-size:28px!important}.feature-item{display:flex;flex-direction:column;gap:8px;text-align:center!important;align-items:center!important}.main-subheading{margin:5px auto 0!important;padding:0!important}.feature-item{gap:0px!important}.cta-image{width:100%!important;height:100%!important}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: SimpoElementsModule }, { kind: "component", type: i2.SvgDividerComponent, selector: "simpo-svg-divider", inputs: ["dividerType", "color"] }, { kind: "ngmodule", type: SimpoComponentModule }, { kind: "component", type: i3.HoverElementsComponent, selector: "simpo-hover-elements", inputs: ["data", "index", "editOptions", "isMerged", "isEcommerce"], outputs: ["edit"] }, { kind: "component", type: i4.DeleteHoverElementComponent, selector: "simpo-delete-hover-element", inputs: ["index", "data"], outputs: ["edit"] }, { kind: "component", type: TextEditorComponent, selector: "simpo-text-editor", inputs: ["value", "editable", "isRTE", "sectionId", "label", "type", "inputTextIndex", "itemIndex"], outputs: ["valueChange"] }, { kind: "directive", type: BackgroundDirective, selector: "[simpoBackground]", inputs: ["simpoBackground", "scrollValue"] }, { kind: "directive", type: HoverDirective, selector: "[simpoHover]", outputs: ["hovering"] }, { kind: "directive", type: OverlayDirective, selector: "[simpoOverlay]", inputs: ["simpoOverlay"] }, { kind: "directive", type: SpacingHorizontalDirective, selector: "[spacingHorizontal]", inputs: ["spacingHorizontal", "isHeader"] }, { kind: "directive", type: BorderDirective, selector: "[simpoBorder]", inputs: ["simpoBorder"] }, { kind: "directive", type: ContentFitDirective, selector: "[simpoLayout]", inputs: ["simpoLayout"] }, { kind: "directive", type: ImageEditorDirective, selector: "[appImageEditor]", inputs: ["appImageEditor", "imageData", "sectionId", "showIcon", "iconData", "itemIndex"] }, { kind: "directive", type: IconDirectiveDirective, selector: "[simpoIconDirective]", inputs: ["simpoIconDirective", "iconId"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "directive", type: CornerDirective, selector: "[simpoCorner]", inputs: ["simpoCorner"] }, { kind: "directive", type: AnimationDirective, selector: "[simpoAnimation]", inputs: ["simpoAnimation"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: FourFeaturesCenteredImageComponent, decorators: [{
            type: Component,
            args: [{ selector: 'simpo-four-features-centered-image', standalone: true, imports: [
                        CommonModule,
                        SimpoElementsModule,
                        SimpoComponentModule,
                        TextEditorComponent,
                        BackgroundDirective,
                        HoverDirective,
                        OverlayDirective,
                        SpacingHorizontalDirective,
                        BorderDirective,
                        ContentFitDirective,
                        ImageEditorDirective,
                        IconDirectiveDirective,
                        MatIconModule,
                        CornerDirective,
                        AnimationDirective,
                    ], template: "<section>\r\n  <div [id]=\"data?.id\" simpoHover (hovering)=\"showEditTabs($event)\" class=\"total-container\" [attr.style]=\"customClass\"\r\n    [simpoBackground]=\"style?.background\">\r\n    <div [id]=\"data?.id\" #mainContainer [simpoBorder]=\"style?.border\" [spacingHorizontal]=\"stylesLayout\"\r\n      [simpoLayout]=\"style?.layout\" class=\"sale-bar\" [simpoOverlay]=\"style?.background\">\r\n      <div class=\"features-wrapper\" [simpoAnimation]=\"style?.animation\">\r\n        <div>\r\n          <!-- Heading -->\r\n          <simpo-text-editor class=\"main-heading fs-1 fw-semibold\" [(value)]=\"content.heading.value\"\r\n            [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\">\r\n          </simpo-text-editor>\r\n\r\n          <!-- Description -->\r\n          <simpo-text-editor class=\"main-subheading description\" [(value)]=\"content.description.value\"\r\n            [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\">\r\n          </simpo-text-editor>\r\n        </div>\r\n\r\n        <!-- GRID -->\r\n        <div class=\"feature-grid\">\r\n          <!-- LEFT FEATURES -->\r\n          <div class=\"feature-column\">\r\n            <div class=\"feature-item d-flex flex-column\" *ngFor=\"let item of leftInputText; let i = index\">\r\n              <!-- <div class=\"logo-img\" [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\"> -->\r\n              <div class=\"logo-img\"\r\n                [style.background]=\"item?.icon?.showBackground ? getIconBackground(item?.icon) : 'transparent'\"\r\n                [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\">\r\n                <div [iconId]=\"data?.id + item.icon?.id\" [simpoIconDirective]=\"item.icon\" class=\"w-50 h-50\">\r\n                </div>\r\n              </div>\r\n\r\n              <simpo-text-editor class=\"feature-title my-2 fs-5 fw-semibold\" [(value)]=\"item.label\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\">\r\n              </simpo-text-editor>\r\n              <simpo-text-editor class=\"feature-text\" [(value)]=\"item.value\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\"></simpo-text-editor>\r\n            </div>\r\n          </div>\r\n\r\n          <!-- CENTER IMAGE -->\r\n          <div class=\"cta-image center-image\" [simpoCorner]=\"style?.corners\" style=\"overflow:hidden;\">\r\n\r\n            <img [src]=\"content?.image?.url\" [simpoCorner]=\"style?.corners\" [appImageEditor]=\"edit || false\"\r\n              [imageData]=\"content?.image\" [sectionId]=\"data?.id\" style=\"width:100%; height:100%; object-fit:cover;\">\r\n          </div>\r\n\r\n          <!-- RIGHT FEATURES -->\r\n          <div class=\"feature-column\">\r\n            <div class=\"feature-item d-flex flex-column align-items-start text-start\"\r\n              *ngFor=\"let item of rightInputText; let i = index\">\r\n              <!-- <div class=\"logo-img\" [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\"> -->\r\n              <div class=\"logo-img\"\r\n                [style.background]=\"item?.icon?.showBackground ? getIconBackground(item?.icon) : 'transparent'\"\r\n                [simpoCorner]=\"style?.corners\" [style.height.px]=\"style?.containerHeight\"\r\n                [style.width.px]=\"style?.containerWidth\" [appImageEditor]=\"edit || false\" [iconData]=\"item.icon\"\r\n                [sectionId]=\"data?.id\" [showIcon]=\"true\">\r\n                <div [iconId]=\"data?.id + item.icon?.id\" [simpoIconDirective]=\"item.icon\" class=\"w-50 h-50\">\r\n                </div>\r\n              </div>\r\n\r\n              <simpo-text-editor class=\"feature-title my-2 fs-5 fw-semibold\" [(value)]=\"item.label\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"0\" [itemIndex]=\"i\">\r\n              </simpo-text-editor>\r\n              <simpo-text-editor class=\"feature-text\" [(value)]=\"item.value\"\r\n                [editable]=\"edit || false\" [sectionId]=\"data?.id\" [inputTextIndex]=\"1\" [itemIndex]=\"i\"></simpo-text-editor>\r\n            </div>\r\n          </div>\r\n        </div>\r\n      </div>\r\n    </div>\r\n\r\n    <!-- Divider -->\r\n    <ng-container *ngIf=\"style?.devider?.display\">\r\n      <simpo-svg-divider [dividerType]=\"style?.devider?.deviderType\" [color]=\"nextComponentColor?.color\">\r\n      </simpo-svg-divider>\r\n    </ng-container>\r\n\r\n    <!-- EDIT SELECTOR -->\r\n    <div [ngClass]=\"{ hover_effect: edit }\" *ngIf=\"showEditors\">\r\n      <simpo-hover-elements [data]=\"data\" [index]=\"index\" [editOptions]=\"edit\">\r\n      </simpo-hover-elements>\r\n    </div>\r\n\r\n    <!-- DELETE -->\r\n    <div *ngIf=\"showDelete\" [ngClass]=\"{ hover_effect: delete }\">\r\n      <simpo-delete-hover-element [data]=\"data\" [index]=\"index\">\r\n      </simpo-delete-hover-element>\r\n    </div>\r\n\r\n  </div>\r\n</section>", styles: [".total-container{position:relative}.sale-bar{padding:45px}.feature-text,.feature-title{width:100%}.main-heading{margin:0 auto;text-align:center}.main-subheading{margin:15px auto 0;text-align:center;line-height:1.6}.features-wrapper{text-align:center;margin-top:15px;width:100%}.feature-grid{display:flex;justify-content:space-between;align-items:center;width:100%;margin:45px 0 40px}.feature-column{display:flex;flex-direction:column;gap:60px;width:35%}.feature-item{width:100%;align-items:end}.feature-column:first-child .feature-item{text-align:right}.feature-column:last-child .feature-item{text-align:left}.logo-img{display:flex;justify-content:center;align-items:center}.logotype-boxed{box-shadow:0 2px 4px #0000002e;padding:10px}.cta-image{width:30%;display:flex;justify-content:center;align-items:center;margin:0 40px}.center-image{display:flex;justify-content:center;align-items:center;overflow:hidden}.center-image img{display:block;max-width:100%;height:auto}.description{display:flex;justify-content:center;text-align:center;padding:0 15%}@media (max-width: 992px){.feature-grid{flex-direction:column;align-items:center;gap:40px;margin:25px 0}.center-image{order:3;width:280px;margin:10px 0 25px}.feature-column{width:100%;align-items:center;gap:35px}.feature-item{text-align:center!important;align-items:center}.description{padding:0 8%}}@media (max-width: 768px){.sale-bar{padding:30px 20px}.center-image{width:230px}.description{padding:0 6%}.feature-column{gap:28px}}@media (max-width: 480px){.sale-bar{padding:25px 15px}.center-image{width:80%}.logo-img{height:70px!important;align-items:center!important;text-align:center!important}simpo-text-editor.fs-1{font-size:28px!important}.feature-item{display:flex;flex-direction:column;gap:8px;text-align:center!important;align-items:center!important}.main-subheading{margin:5px auto 0!important;padding:0!important}.feature-item{gap:0px!important}.cta-image{width:100%!important;height:100%!important}}\n"] }]
        }], propDecorators: { edit: [{
                type: Input
            }], data: [{
                type: Input
            }], customClass: [{
                type: Input
            }], nextComponentColor: [{
                type: Input
            }], index: [{
                type: Input
            }], delete: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 