import * as i0 from '@angular/core';
import { forwardRef, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import * as i2 from '@angular/forms';
import { NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';
import { InputInlineBaseComponent, CONFIG_INPUT_INLINE_BY_UI_STYLE } from '@ironsource/fusion-ui/components/input-inline/common/base';
export { InlineInputType } from '@ironsource/fusion-ui/components/input-inline/common/base';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import * as i3 from '@ironsource/fusion-ui/components/loader/v1';
import { LoaderModule } from '@ironsource/fusion-ui/components/loader/v1';
import * as i4 from '@ironsource/fusion-ui/components/icon/v1';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import * as i5 from '@ironsource/fusion-ui/components/input/v1';
import { InputModule } from '@ironsource/fusion-ui/components/input/v1';
import * as i6 from '@ironsource/fusion-ui/components/tooltip/v1';
import { TooltipModule } from '@ironsource/fusion-ui/components/tooltip/v1';
import { ClickOutsideModule } from '@ironsource/fusion-ui/directives/click-outside';

function InputInlineComponent_span_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 10);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.viewOnlyText);
} }
function InputInlineComponent_fusion_icon_6_Template(rf, ctx) { if (rf & 1) {
    const _r5 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-icon", 11);
    i0.ɵɵlistener("click", function InputInlineComponent_fusion_icon_6_Template_fusion_icon_click_0_listener() { i0.ɵɵrestoreView(_r5); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.goToEditMode()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r1.configByStyle.iconEdit);
} }
function InputInlineComponent_fusion_icon_12_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-icon", 12);
    i0.ɵɵlistener("click", function InputInlineComponent_fusion_icon_12_Template_fusion_icon_click_0_listener() { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r6.save()); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵproperty("name", ctx_r3.configByStyle.iconSave);
} }
const _c0 = (a0, a1, a2) => ({ "is-currency": a0, hidden: a1, "is-readonly": a2 });
const _c1 = (a0, a1) => ({ "is-edit-mode": a0, "is-loading": a1 });
const _c2 = () => ({ size: "small" });
class InputInlineComponent extends InputInlineBaseComponent {
    ngOnInit() {
        super.ngOnInit();
        this.configByStyle = CONFIG_INPUT_INLINE_BY_UI_STYLE[`style_v1`];
    }
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵInputInlineComponent_BaseFactory; return function InputInlineComponent_Factory(t) { return (ɵInputInlineComponent_BaseFactory || (ɵInputInlineComponent_BaseFactory = i0.ɵɵgetInheritedFactory(InputInlineComponent)))(t || InputInlineComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: InputInlineComponent, selectors: [["fusion-input-inline"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => InputInlineComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 14, vars: 33, consts: [[1, "inline-input-wrapper"], [1, "truncate", "is-label", 3, "ngClass", "fusionTooltip"], ["class", "viewOnlyText", 4, "ngIf"], [3, "ngClass"], ["class", "icon-edit", "fusionTooltip", "Edit", 3, "name", "click", 4, "ngIf"], [3, "hidden", "ngClass"], ["unitPos", "left", 1, "is-underline", 3, "type", "sanitationRegex", "error", "fusionTooltip", "units", "options", "isDisabled", "formControl", "ngEscape"], ["inputComponent", ""], ["class", "icon-save", 3, "name", "click", 4, "ngIf"], [3, "status", "size"], [1, "viewOnlyText"], ["fusionTooltip", "Edit", 1, "icon-edit", 3, "name", "click"], [1, "icon-save", 3, "name", "click"]], template: function InputInlineComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
            i0.ɵɵpipe(2, "async");
            i0.ɵɵtemplate(3, InputInlineComponent_span_3_Template, 2, 1, "span", 2);
            i0.ɵɵelementStart(4, "span", 3);
            i0.ɵɵtext(5);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(6, InputInlineComponent_fusion_icon_6_Template, 1, 1, "fusion-icon", 4);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(7, "div", 5);
            i0.ɵɵpipe(8, "async");
            i0.ɵɵpipe(9, "async");
            i0.ɵɵelementStart(10, "fusion-input", 6, 7);
            i0.ɵɵlistener("ngEscape", function InputInlineComponent_Template_fusion_input_ngEscape_10_listener() { return ctx.cancel(); });
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(12, InputInlineComponent_fusion_icon_12_Template, 1, 1, "fusion-icon", 8);
            i0.ɵɵelement(13, "fusion-loader", 9);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction3(25, _c0, ctx.isTypeCurrency, i0.ɵɵpipeBind1(2, 19, ctx.isEditMode$), ctx.readOnly))("fusionTooltip", ctx.viewOnlyText + ctx.savedValueToString);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.viewOnlyText);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngClass", ctx.textClass);
            i0.ɵɵadvance();
            i0.ɵɵtextInterpolate(ctx.savedValueToString);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", !ctx.readOnly);
            i0.ɵɵadvance();
            i0.ɵɵproperty("hidden", i0.ɵɵpipeBind1(8, 21, ctx.isEditMode$) === false)("ngClass", i0.ɵɵpureFunction2(29, _c1, i0.ɵɵpipeBind1(9, 23, ctx.isEditMode$), ctx.loading));
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("type", ctx.inputType)("sanitationRegex", ctx.sanitationRegex)("error", ctx.error)("fusionTooltip", ctx.error)("units", ctx.inputUnits)("options", i0.ɵɵpureFunction0(32, _c2))("isDisabled", ctx.loading)("formControl", ctx.inputControl);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", !ctx.loading);
            i0.ɵɵadvance();
            i0.ɵɵproperty("status", ctx.loading)("size", ctx.configByStyle.loadingSize);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.NgControlStatus, i2.FormControlDirective, i3.LoaderComponent, i4.IconComponent, i5.InputComponent, i6.TooltipDirective, i1.AsyncPipe], styles: ["[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%]   .viewOnlyText[_ngcontent-%COMP%]{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:700}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%]   .truncate[_ngcontent-%COMP%]{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}[_nghost-%COMP%]   fusion-icon.check-v-2[_ngcontent-%COMP%], [_nghost-%COMP%]   fusion-icon.edit[_ngcontent-%COMP%]{margin-top:0!important;position:absolute;top:50%;transform:translateY(-50%)}[_nghost-%COMP%]   fusion-icon.edit[_ngcontent-%COMP%]{height:14px;visibility:hidden;right:8px;cursor:pointer}[_nghost-%COMP%]   fusion-icon.edit[_ngcontent-%COMP%]     svg{width:12px;height:14px}[_nghost-%COMP%]   fusion-icon.edit[_ngcontent-%COMP%]     svg *{fill:var(--light-color-800, #678099)}[_nghost-%COMP%]   fusion-icon.edit[_ngcontent-%COMP%]:hover     svg{width:12px;height:14px}[_nghost-%COMP%]   fusion-icon.edit[_ngcontent-%COMP%]:hover     svg *{fill:var(--primary-color, #3091F6)}[_nghost-%COMP%]   fusion-icon.check-v-2[_ngcontent-%COMP%]{right:10px;cursor:pointer}[_nghost-%COMP%]   fusion-icon.check-v-2[_ngcontent-%COMP%]     svg{width:12px;height:10px}[_nghost-%COMP%]   fusion-icon.check-v-2[_ngcontent-%COMP%]     svg *{fill:var(--light-color-800, #678099)}[_nghost-%COMP%]   fusion-icon.check-v-2[_ngcontent-%COMP%]:hover     svg{width:12px;height:10px}[_nghost-%COMP%]   fusion-icon.check-v-2[_ngcontent-%COMP%]:hover     svg *{fill:var(--primary-color, #3091F6)}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%]   .truncate.hidden[_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%]   .is-readonly[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%]   .is-currency[_ngcontent-%COMP%]:first-letter{padding-right:.3em}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{vertical-align:middle;padding-right:15px}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div.is-edit-mode[_ngcontent-%COMP%]{padding-right:0}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div.is-edit-mode[_ngcontent-%COMP%]     input.fu-input{padding-right:14px}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div.is-edit-mode[_ngcontent-%COMP%]     input.fu-input[type=number]{text-align:right}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div.is-loading[_ngcontent-%COMP%]     .fu-input-units{border-color:var(--light-color, #E1E6EB)}[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]   .default[_ngcontent-%COMP%]{color:var(--light-color-800, #678099)}[_nghost-%COMP%]:hover   fusion-icon.edit[_ngcontent-%COMP%]{visibility:visible}[_nghost-%COMP%]   fusion-loader[_ngcontent-%COMP%]{position:absolute;right:15px;top:24px}is-creative-table-cell[_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div.is-edit-mode[_ngcontent-%COMP%]     input.fu-input, is-creative-table-cell   [_nghost-%COMP%]   .inline-input-wrapper[_ngcontent-%COMP%] > div.is-edit-mode[_ngcontent-%COMP%]     input.fu-input{padding-right:24px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputInlineComponent, [{
        type: Component,
        args: [{ selector: 'fusion-input-inline', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => InputInlineComponent),
                        multi: true
                    }
                ], template: "<div class=\"inline-input-wrapper\">\n    <div\n        [ngClass]=\"{'is-currency': isTypeCurrency, hidden: isEditMode$ | async, 'is-readonly': readOnly}\"\n        class=\"truncate is-label\"\n        [fusionTooltip]=\"viewOnlyText + savedValueToString\"\n    >\n        <span class=\"viewOnlyText\" *ngIf=\"viewOnlyText\">{{ viewOnlyText }}</span\n        ><span [ngClass]=\"textClass\">{{ savedValueToString }}</span>\n        <fusion-icon\n            *ngIf=\"!readOnly\"\n            class=\"icon-edit\"\n            fusionTooltip=\"Edit\"\n            [name]=\"configByStyle.iconEdit\"\n            (click)=\"goToEditMode()\"\n        ></fusion-icon>\n    </div>\n    <div [hidden]=\"(isEditMode$ | async) === false\" [ngClass]=\"{'is-edit-mode': isEditMode$ | async, 'is-loading': loading}\">\n        <fusion-input\n            #inputComponent\n            class=\"is-underline\"\n            [type]=\"inputType\"\n            [sanitationRegex]=\"sanitationRegex\"\n            [error]=\"error\"\n            [fusionTooltip]=\"error\"\n            [units]=\"inputUnits\"\n            unitPos=\"left\"\n            [options]=\"{size: 'small'}\"\n            (ngEscape)=\"cancel()\"\n            [isDisabled]=\"loading\"\n            [formControl]=\"inputControl\"\n        ></fusion-input>\n        <fusion-icon class=\"icon-save\" [name]=\"configByStyle.iconSave\" (click)=\"save()\" *ngIf=\"!loading\"></fusion-icon>\n        <fusion-loader [status]=\"loading\" [size]=\"configByStyle.loadingSize\"></fusion-loader>\n    </div>\n</div>\n", styles: [":host .inline-input-wrapper .viewOnlyText{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:700}:host *{box-sizing:border-box}:host .inline-input-wrapper .truncate{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host fusion-icon.check-v-2,:host fusion-icon.edit{margin-top:0!important;position:absolute;top:50%;transform:translateY(-50%)}:host fusion-icon.edit{height:14px;visibility:hidden;right:8px;cursor:pointer}:host fusion-icon.edit ::ng-deep svg{width:12px;height:14px}:host fusion-icon.edit ::ng-deep svg *{fill:var(--light-color-800, #678099)}:host fusion-icon.edit:hover ::ng-deep svg{width:12px;height:14px}:host fusion-icon.edit:hover ::ng-deep svg *{fill:var(--primary-color, #3091F6)}:host fusion-icon.check-v-2{right:10px;cursor:pointer}:host fusion-icon.check-v-2 ::ng-deep svg{width:12px;height:10px}:host fusion-icon.check-v-2 ::ng-deep svg *{fill:var(--light-color-800, #678099)}:host fusion-icon.check-v-2:hover ::ng-deep svg{width:12px;height:10px}:host fusion-icon.check-v-2:hover ::ng-deep svg *{fill:var(--primary-color, #3091F6)}:host .inline-input-wrapper .truncate.hidden{display:none}:host .inline-input-wrapper .is-readonly{cursor:default}:host .inline-input-wrapper .is-currency:first-letter{padding-right:.3em}:host .inline-input-wrapper>div{vertical-align:middle;padding-right:15px}:host .inline-input-wrapper>div.is-edit-mode{padding-right:0}:host .inline-input-wrapper>div.is-edit-mode ::ng-deep input.fu-input{padding-right:14px}:host .inline-input-wrapper>div.is-edit-mode ::ng-deep input.fu-input[type=number]{text-align:right}:host .inline-input-wrapper>div.is-loading ::ng-deep .fu-input-units{border-color:var(--light-color, #E1E6EB)}:host .inline-input-wrapper>div .default{color:var(--light-color-800, #678099)}:host:hover fusion-icon.edit{visibility:visible}:host fusion-loader{position:absolute;right:15px;top:24px}:host-context(is-creative-table-cell) .inline-input-wrapper>div.is-edit-mode ::ng-deep input.fu-input{padding-right:24px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(InputInlineComponent, { className: "InputInlineComponent", filePath: "input-inline.component.ts", lineNumber: 18 }); })();

class InputInlineModule {
    static { this.ɵfac = function InputInlineModule_Factory(t) { return new (t || InputInlineModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: InputInlineModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule, ReactiveFormsModule, LoaderModule, IconModule, InputModule, TooltipModule, ClickOutsideModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(InputInlineModule, [{
        type: NgModule,
        args: [{
                declarations: [InputInlineComponent],
                exports: [InputInlineComponent],
                imports: [CommonModule, ReactiveFormsModule, LoaderModule, IconModule, InputModule, TooltipModule, ClickOutsideModule]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(InputInlineModule, { declarations: [InputInlineComponent], imports: [CommonModule, ReactiveFormsModule, LoaderModule, IconModule, InputModule, TooltipModule, ClickOutsideModule], exports: [InputInlineComponent] }); })();

/**
 * Generated bundle index. Do not edit.
 */

export { InputInlineComponent, InputInlineModule };
//# sourceMappingURL=ironsource-fusion-ui-components-input-inline-v1.mjs.map
