import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { MONTH_PICKER_PLACEHOLDER } from '@ironsource/fusion-ui/components/month-picker/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@ironsource/fusion-ui/components/icon/v1";
function MonthPickerPlaceholderComponent_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 4);
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(ctx_r0.placeholder == null ? null : ctx_r0.placeholder.text);
} }
function MonthPickerPlaceholderComponent_fusion_icon_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 5);
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r1.arrowIconName);
} }
function MonthPickerPlaceholderComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 4);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "div", 6);
    i0.ɵɵtext(3);
    i0.ɵɵpipe(4, "date");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r2.placeholder == null ? null : ctx_r2.placeholder.prefix);
    i0.ɵɵadvance(2);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind2(4, 2, ctx_r2.selectedDate, ctx_r2.placeholder == null ? null : ctx_r2.placeholder.format));
} }
const _c0 = () => ({ iconName: "calendar-2", iconVersion: "v2" });
export class MonthPickerPlaceholderComponent {
    constructor() {
        this.placeholder = MONTH_PICKER_PLACEHOLDER;
        this.arrowIconName = { iconName: 'arrow-down', iconVersion: 'v2' };
    }
    get selectedDate() {
        return new Date(`${this.selected?.year}-${this.selected?.month + 1}-10`);
    }
    static { this.ɵfac = function MonthPickerPlaceholderComponent_Factory(t) { return new (t || MonthPickerPlaceholderComponent)(); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MonthPickerPlaceholderComponent, selectors: [["fusion-month-picker-placeholder"]], inputs: { placeholder: "placeholder", selected: "selected" }, decls: 5, vars: 5, consts: [[1, "fu-calendar-icon", 3, "name"], [4, "ngIf", "ngIfElse"], ["class", "icon-arrow", 3, "name", 4, "ngIf"], ["selectedMonth", ""], [1, "fu-placeholder"], [1, "icon-arrow", 3, "name"], [1, "fu-value-selected"]], template: function MonthPickerPlaceholderComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelement(0, "fusion-icon", 0);
            i0.ɵɵtemplate(1, MonthPickerPlaceholderComponent_ng_container_1_Template, 3, 1, "ng-container", 1)(2, MonthPickerPlaceholderComponent_fusion_icon_2_Template, 1, 1, "fusion-icon", 2)(3, MonthPickerPlaceholderComponent_ng_template_3_Template, 5, 5, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
        } if (rf & 2) {
            const _r3 = i0.ɵɵreference(4);
            i0.ɵɵproperty("name", i0.ɵɵpureFunction0(4, _c0));
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.selected && ctx.placeholder)("ngIfElse", _r3);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.arrowIconName);
        } }, dependencies: [i1.NgIf, i2.IconComponent, i1.DatePipe], styles: ["[_nghost-%COMP%]{position:relative;width:100%;display:flex;align-items:center;cursor:pointer}.fu-disabled[_nghost-%COMP%]{cursor:default;pointer-events:none}", "[_nghost-%COMP%]{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{height:var(--fu-month-picker-height, 40px);border:none;border-radius:var(--fu-month-picker-border-radius, 4px);color:var(--fu-month-picker-color, var(--fu-dark-500, #0d148c));background-color:var(--fu-month-picker-background-color, var(--fu-light-100, #f7f8f9));padding:12px}[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]{position:absolute;right:12px}[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px)}[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--fu-dark-200, #4c548e))}[_nghost-%COMP%]   .fu-calendar-icon[_ngcontent-%COMP%]{display:none}.fu-opened[_nghost-%COMP%]{border-bottom:var(--fu-month-picker-opened-border-bottom, solid 2px var(--fu-primary-500, #3083ff));padding-bottom:10px}.fu-opened[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px);transform:rotate(180deg)}.fu-opened[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--fu-dark-200, #4c548e))}.fu-disabled[_nghost-%COMP%]{color:var(--fu-month-picker-disabled-color, var(--fu-light-900, #7b838c))}.fu-disabled[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px)}.fu-disabled[_nghost-%COMP%]   fusion-icon[class^=icon-arrow][_ngcontent-%COMP%]     svg *{fill:var(--fu-month-picker-arrow-icon-disabled-color, var(--fu-light-700, #a9afb4))}[_nghost-%COMP%]   .fu-value-selected[_ngcontent-%COMP%]{margin-left:3px}.ng-invalid[_nghost-%COMP%], .ng-invalid   [_nghost-%COMP%]{background-color:var(--fu-month-picker-invalid-background-color, var(--fu-negative-100, #ffefee))}.ng-invalid.fu-opened[_nghost-%COMP%], .ng-invalid   .fu-opened[_nghost-%COMP%]{background-color:var(--fu-month-picker-background-color, var(--fu-light-100, #f7f8f9))}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MonthPickerPlaceholderComponent, [{
        type: Component,
        args: [{ selector: 'fusion-month-picker-placeholder', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fusion-icon class=\"fu-calendar-icon\" [name]=\"{iconName: 'calendar-2', iconVersion: 'v2'}\"></fusion-icon>\n<ng-container *ngIf=\"!selected && placeholder; else selectedMonth\">\n    <div class=\"fu-placeholder\">{{ placeholder?.text }}</div>\n</ng-container>\n<fusion-icon *ngIf=\"arrowIconName\" class=\"icon-arrow\" [name]=\"arrowIconName\"></fusion-icon>\n\n<ng-template #selectedMonth>\n    <div class=\"fu-placeholder\">{{ placeholder?.prefix }}</div>\n    <div class=\"fu-value-selected\">{{ selectedDate | date: placeholder?.format }}</div>\n</ng-template>\n", styles: [":host{position:relative;width:100%;display:flex;align-items:center;cursor:pointer}:host.fu-disabled{cursor:default;pointer-events:none}\n", ":host{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host *{box-sizing:border-box}:host{height:var(--fu-month-picker-height, 40px);border:none;border-radius:var(--fu-month-picker-border-radius, 4px);color:var(--fu-month-picker-color, var(--fu-dark-500, #0d148c));background-color:var(--fu-month-picker-background-color, var(--fu-light-100, #f7f8f9));padding:12px}:host fusion-icon[class^=icon-arrow]{position:absolute;right:12px}:host fusion-icon[class^=icon-arrow] ::ng-deep svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px)}:host fusion-icon[class^=icon-arrow] ::ng-deep svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--fu-dark-200, #4c548e))}:host .fu-calendar-icon{display:none}:host.fu-opened{border-bottom:var(--fu-month-picker-opened-border-bottom, solid 2px var(--fu-primary-500, #3083ff));padding-bottom:10px}:host.fu-opened fusion-icon[class^=icon-arrow] ::ng-deep svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px);transform:rotate(180deg)}:host.fu-opened fusion-icon[class^=icon-arrow] ::ng-deep svg *{fill:var(--fu-month-picker-arrow-icon-color, var(--fu-dark-200, #4c548e))}:host.fu-disabled{color:var(--fu-month-picker-disabled-color, var(--fu-light-900, #7b838c))}:host.fu-disabled fusion-icon[class^=icon-arrow] ::ng-deep svg{width:var(--fu-month-picker-arrow-icon-size, 8px);height:var(--fu-month-picker-arrow-icon-size, 8px)}:host.fu-disabled fusion-icon[class^=icon-arrow] ::ng-deep svg *{fill:var(--fu-month-picker-arrow-icon-disabled-color, var(--fu-light-700, #a9afb4))}:host .fu-value-selected{margin-left:3px}:host-context(.ng-invalid){background-color:var(--fu-month-picker-invalid-background-color, var(--fu-negative-100, #ffefee))}:host-context(.ng-invalid).fu-opened{background-color:var(--fu-month-picker-background-color, var(--fu-light-100, #f7f8f9))}\n"] }]
    }], null, { placeholder: [{
            type: Input
        }], selected: [{
            type: Input
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MonthPickerPlaceholderComponent, { className: "MonthPickerPlaceholderComponent", filePath: "components/month-picker-placeholder/month-picker-placeholder.component.ts", lineNumber: 10 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW9udGgtcGlja2VyLXBsYWNlaG9sZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL21vbnRoLXBpY2tlci92Mi9jb21wb25lbnRzL21vbnRoLXBpY2tlci1wbGFjZWhv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