import { ChangeDetectionStrategy, Component, forwardRef } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ToggleBaseComponent } from '@ironsource/fusion-ui/components/toggle/common/base';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
function ToggleComponent_span_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 4);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.currentLabel);
} }
const _c0 = (a0, a1, a2, a3) => ({ "animated": a0, disabled: a1, loading: a2, "is-small": a3 });
export class ToggleComponent extends ToggleBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵToggleComponent_BaseFactory; return function ToggleComponent_Factory(t) { return (ɵToggleComponent_BaseFactory || (ɵToggleComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ToggleComponent)))(t || ToggleComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ToggleComponent, selectors: [["fusion-toggle"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => ToggleComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 8, vars: 20, consts: [[1, "is-toggle", 3, "ngClass", "click"], ["type", "checkbox", 3, "ngModel", "disabled", "id", "value", "checked", "ngModelChange"], [1, "slider"], ["class", "label", 4, "ngIf"], [1, "label"]], template: function ToggleComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "label", 0);
            i0.ɵɵlistener("click", function ToggleComponent_Template_label_click_0_listener() { return ctx.propagateTouched(); });
            i0.ɵɵpipe(1, "async");
            i0.ɵɵpipe(2, "async");
            i0.ɵɵelementStart(3, "input", 1);
            i0.ɵɵlistener("ngModelChange", function ToggleComponent_Template_input_ngModelChange_3_listener($event) { return ctx.onChange($event); });
            i0.ɵɵpipe(4, "async");
            i0.ɵɵpipe(5, "async");
            i0.ɵɵelementEnd();
            i0.ɵɵelement(6, "span", 2);
            i0.ɵɵtemplate(7, ToggleComponent_span_7_Template, 2, 1, "span", 3);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction4(15, _c0, i0.ɵɵpipeBind1(1, 7, ctx.animated$), i0.ɵɵpipeBind1(2, 9, ctx.isDisabled$), ctx.loading, ctx.size === "small"));
            i0.ɵɵadvance(3);
            i0.ɵɵproperty("ngModel", ctx.model)("disabled", i0.ɵɵpipeBind1(4, 11, ctx.isDisabled$) || ctx.loading)("id", ctx.id)("value", ctx.value)("checked", i0.ɵɵpipeBind1(5, 13, ctx.isChecked$));
            i0.ɵɵadvance(4);
            i0.ɵɵproperty("ngIf", ctx.currentLabel);
        } }, dependencies: [i1.NgClass, i1.NgIf, i2.CheckboxControlValueAccessor, i2.NgControlStatus, i2.NgModel, i1.AsyncPipe], styles: ["[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]{cursor:pointer;font-size:100%;line-height:1.6em}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{margin-left:4px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{vertical-align:sub;background:var(--light-color-600, #C2CDD7);display:inline-block;width:30px;height:18px;border-radius:40px;position:relative;transition:background-color linear .3s 0s}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{content:\"\";display:block;width:16px;height:16px;background:#fff;position:absolute;top:1px;left:1px;border-radius:8px;box-shadow:0 2px 2px #0000002b;transition:left linear .3s 0s}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]{background-color:var(--positive-color, #13C7C8)}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{left:13px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%] + .toggle-loading[_ngcontent-%COMP%]{padding-left:22px;margin-left:5px;position:relative;display:inline-block;color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%] + .toggle-loading[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]{position:absolute;left:0;top:1px}[_nghost-%COMP%]   .is-toggle[_ngcontent-%COMP%] + .toggle-loading[_ngcontent-%COMP%]   fusion-icon[_ngcontent-%COMP%]     svg{width:15px;height:15px}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{opacity:.5}[_nghost-%COMP%]   .is-toggle.disabled[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-toggle.loading[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]   .is-toggle.loading[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHdpZHRoPScxNXB4JyBoZWlnaHQ9JzE1cHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89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.loading[_ngcontent-%COMP%]   .label[_ngcontent-%COMP%]{color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]{width:22px;height:14px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   .slider[_ngcontent-%COMP%]:before{width:12px;height:12px;border-radius:6px}[_nghost-%COMP%]   .is-toggle.is-small[_ngcontent-%COMP%]   input[type=checkbox][_ngcontent-%COMP%]:checked + .slider[_ngcontent-%COMP%]:before{left:9px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ToggleComponent, [{
        type: Component,
        args: [{ selector: 'fusion-toggle', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => ToggleComponent),
                        multi: true
                    }
                ], template: "<label class=\"is-toggle\" [ngClass]=\"{'animated': (animated$ | async), disabled: (isDisabled$ | async), loading: loading, 'is-small': size === 'small'}\" (click)=\"propagateTouched()\">\n  <input type=\"checkbox\"\n         [ngModel]=\"model\"\n         [disabled]=\"(isDisabled$ | async) || loading\"\n         (ngModelChange)=\"onChange($event)\"\n         [id]='id'\n         [value]=\"value\"\n         [checked]=\"isChecked$ | async\">\n  <span class=\"slider\"></span>\n  <span *ngIf=\"currentLabel\" class=\"label\">{{currentLabel}}</span>\n</label>\n", styles: [":host *{box-sizing:border-box}:host .is-toggle.disabled{pointer-events:none;cursor:default;touch-callout:none;-webkit-user-select:none;user-select:none}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host .is-toggle{cursor:pointer;font-size:100%;line-height:1.6em}:host .is-toggle .label{margin-left:4px}:host .is-toggle .slider{vertical-align:sub;background:var(--light-color-600, #C2CDD7);display:inline-block;width:30px;height:18px;border-radius:40px;position:relative;transition:background-color linear .3s 0s}:host .is-toggle .slider:before{content:\"\";display:block;width:16px;height:16px;background:#fff;position:absolute;top:1px;left:1px;border-radius:8px;box-shadow:0 2px 2px #0000002b;transition:left linear .3s 0s}:host .is-toggle input[type=checkbox]{display:none}:host .is-toggle input[type=checkbox]:checked+.slider{background-color:var(--positive-color, #13C7C8)}:host .is-toggle input[type=checkbox]:checked+.slider:before{left:13px}:host .is-toggle+.toggle-loading{padding-left:22px;margin-left:5px;position:relative;display:inline-block;color:var(--light-color-800, #678099)}:host .is-toggle+.toggle-loading fusion-icon{position:absolute;left:0;top:1px}:host .is-toggle+.toggle-loading fusion-icon ::ng-deep svg{width:15px;height:15px}:host .is-toggle.disabled .slider{opacity:.5}:host .is-toggle.disabled .label{color:var(--light-color-800, #678099)}:host .is-toggle.loading{cursor:default}:host .is-toggle.loading .slider:before{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHdpZHRoPScxNXB4JyBoZWlnaHQ9JzE1cHgnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDEwMCAxMDAiIHByZXNlcnZlQXNwZWN0UmF0aW89InhNaWRZTWlkIiBjbGFzcz0idWlsLXJpcHBsZSI+PGc+IDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIGR1cj0iMnMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMHMiIGtleVRpbWVzPSIwOzAuMzM7MSIgdmFsdWVzPSIxOzE7MCI+PC9hbmltYXRlPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjQwIiBzdHJva2U9IiM4MjhkOWEiIGZpbGw9Im5vbmUiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJyIiBkdXI9IjJzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIiBrZXlUaW1lcz0iMDswLjMzOzEiIHZhbHVlcz0iMDsyMjs0NCI+PC9hbmltYXRlPjwvY2lyY2xlPjwvZz48Zz48YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiBkdXI9IjJzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjFzIiBrZXlUaW1lcz0iMDswLjMzOzEiIHZhbHVlcz0iMTsxOzAiPjwvYW5pbWF0ZT48Y2lyY2xlIGN4PSI1MCIgY3k9IjUwIiByPSI0MCIgc3Ryb2tlPSIjODI4ZDlhIiBmaWxsPSJub25lIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCI+PGFuaW1hdGUgYXR0cmlidXRlTmFtZT0iciIgZHVyPSIycyIgcmVwZWF0Q291bnQ9ImluZGVmaW5pdGUiIGJlZ2luPSIxcyIga2V5VGltZXM9IjA7MC4zMzsxIiB2YWx1ZXM9IjA7MjI7NDQiPjwvYW5pbWF0ZT48L2NpcmNsZT48L2c+PC9zdmc+);background-repeat:no-repeat;background-position:center;background-size:cover}:host .is-toggle.loading .label{color:var(--light-color-800, #678099)}:host .is-toggle.is-small .slider{width:22px;height:14px}:host .is-toggle.is-small .slider:before{width:12px;height:12px;border-radius:6px}:host .is-toggle.is-small input[type=checkbox]:checked+.slider:before{left:9px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ToggleComponent, { className: "ToggleComponent", filePath: "toggle.component.ts", lineNumber: 18 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9nZ2xlLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2Z1c2lvbi11aS9jb21wb25lbnRzL3RvZ2dsZS92MS90b2dnbGUuY29tcG9uZW50LnRzIiwiLi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