import * as i0 from '@angular/core';
import { forwardRef, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { SwitcherBaseComponent } from '@ironsource/fusion-ui/components/switcher/common/base';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
export * from '@ironsource/fusion-ui/components/switcher/common/entities';

const _c0 = (a0, a1) => ({ selected: a0, "not-allowed": a1 });
function SwitcherComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 2)(1, "input", 3);
    i0.ɵɵlistener("change", function SwitcherComponent_div_1_Template_input_change_1_listener() { const item_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.setSelected(item_r2)); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(2, "label", 4);
    i0.ɵɵtext(3);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const item_r2 = ctx.$implicit;
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(12, _c0, ctx_r2.isSelected(item_r2), item_r2.disabled || ctx_r2.isDisabled));
    i0.ɵɵadvance();
    i0.ɵɵpropertyInterpolate2("id", "", ctx_r2.name, "_", item_r2.id, "");
    i0.ɵɵproperty("name", ctx_r2.name)("checked", ctx_r2.isSelected(item_r2))("disabled", item_r2.disabled);
    i0.ɵɵadvance();
    i0.ɵɵpropertyInterpolate2("for", "", ctx_r2.name, "_", item_r2.id, "");
    i0.ɵɵpropertyInterpolate("title", item_r2.title);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(item_r2.title);
} }
function SwitcherComponent_div_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 5);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r2.error);
} }
class SwitcherComponent extends SwitcherBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵSwitcherComponent_BaseFactory; return function SwitcherComponent_Factory(__ngFactoryType__) { return (ɵSwitcherComponent_BaseFactory || (ɵSwitcherComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SwitcherComponent)))(__ngFactoryType__ || SwitcherComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SwitcherComponent, selectors: [["fusion-switcher"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => SwitcherComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 3, vars: 4, consts: [["class", "is-switcher-holder", 3, "ngClass", 4, "ngFor", "ngForOf"], ["class", "error-msg", 4, "ngIf"], [1, "is-switcher-holder", 3, "ngClass"], ["type", "radio", 3, "change", "id", "name", "checked", "disabled"], [3, "for", "title"], [1, "error-msg"]], template: function SwitcherComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div");
            i0.ɵɵtemplate(1, SwitcherComponent_div_1_Template, 4, 15, "div", 0);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(2, SwitcherComponent_div_2_Template, 2, 1, "div", 1);
        } if (rf & 2) {
            i0.ɵɵclassMap("is-switcher " + ctx.mode);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngForOf", ctx.options);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.error);
        } }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf], styles: ["[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:400}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%], [_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]{border:1px solid var(--light-color, #E1E6EB)}[_nghost-%COMP%]{width:inherit}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]{width:inherit;display:inline-flex}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]{min-width:70px;flex-grow:1;flex-basis:0;display:inline-block;text-align:center;color:var(--dark-color-300, #172D4C);background-color:var(--light-color-100, #F9FAFB);border-left-width:0}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%]{display:none}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{cursor:pointer;display:inherit;font-size:12px;line-height:32px;padding:0 15px;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:first-child{border-left-width:1px;border-radius:3px 0 0 3px}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:last-child{border-radius:0 3px 3px 0}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.selected[_ngcontent-%COMP%]{border:solid 1px var(--primary-color, #3091F6);background-color:var(--primary-color, #3091F6);color:#fff}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.not-allowed[_ngcontent-%COMP%]{background-color:var(--light-color-400, #E4E9ED);color:var(--light-color-800, #678099)}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]{border-radius:21px;padding:4px;min-width:134px}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{border-radius:15px;padding:0 10px}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]{flex-basis:auto;min-width:0;border:none;border-radius:15px;background-color:#fff;margin-right:4px}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:last-child{margin-right:0}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:hover{background-color:var(--light-color-200, #F3F5F7)}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]   .is-switcher-holder.selected[_ngcontent-%COMP%]{background-color:var(--primary-color, #3091F6)}[_nghost-%COMP%]   .is-switcher.circle[_ngcontent-%COMP%]   .is-switcher-holder.selected[_ngcontent-%COMP%]:hover{background-color:var(--primary-color, #3091F6)}[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{color:var(--negative-color, #e1174c);margin-top:3px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SwitcherComponent, [{
        type: Component,
        args: [{ selector: 'fusion-switcher', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => SwitcherComponent),
                        multi: true
                    }
                ], template: "<div [class]=\"'is-switcher ' + mode\">\n    <div class=\"is-switcher-holder\" *ngFor=\"let item of options\" [ngClass]=\"{selected: isSelected(item), 'not-allowed': (item.disabled || isDisabled)}\">\n        <input\n            type=\"radio\"\n            id=\"{{ name }}_{{ item.id }}\"\n            [name]=\"name\"\n            [checked]=\"isSelected(item)\"\n            (change)=\"setSelected(item)\"\n            [disabled]=\"item.disabled\"\n        />\n        <label for=\"{{ name }}_{{ item.id }}\" title=\"{{ item.title }}\">{{ item.title }}</label>\n    </div>\n</div>\n<div class=\"error-msg\" *ngIf=\"error\">{{ error }}</div>\n", styles: [":host .error-msg{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:400}:host .is-switcher .is-switcher-holder{font-size:13px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host .is-switcher.circle,:host .is-switcher .is-switcher-holder{border:1px solid var(--light-color, #E1E6EB)}:host{width:inherit}:host .is-switcher{width:inherit;display:inline-flex}:host .is-switcher .is-switcher-holder{min-width:70px;flex-grow:1;flex-basis:0;display:inline-block;text-align:center;color:var(--dark-color-300, #172D4C);background-color:var(--light-color-100, #F9FAFB);border-left-width:0}:host .is-switcher .is-switcher-holder input[type=radio]{display:none}:host .is-switcher .is-switcher-holder input[type=radio]+label{cursor:pointer;display:inherit;font-size:12px;line-height:32px;padding:0 15px;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host .is-switcher .is-switcher-holder:first-child{border-left-width:1px;border-radius:3px 0 0 3px}:host .is-switcher .is-switcher-holder:last-child{border-radius:0 3px 3px 0}:host .is-switcher .is-switcher-holder.selected{border:solid 1px var(--primary-color, #3091F6);background-color:var(--primary-color, #3091F6);color:#fff}:host .is-switcher .is-switcher-holder.not-allowed{background-color:var(--light-color-400, #E4E9ED);color:var(--light-color-800, #678099)}:host .is-switcher.circle{border-radius:21px;padding:4px;min-width:134px}:host .is-switcher.circle input[type=radio]+label{border-radius:15px;padding:0 10px}:host .is-switcher.circle .is-switcher-holder{flex-basis:auto;min-width:0;border:none;border-radius:15px;background-color:#fff;margin-right:4px}:host .is-switcher.circle .is-switcher-holder:last-child{margin-right:0}:host .is-switcher.circle .is-switcher-holder:hover{background-color:var(--light-color-200, #F3F5F7)}:host .is-switcher.circle .is-switcher-holder.selected{background-color:var(--primary-color, #3091F6)}:host .is-switcher.circle .is-switcher-holder.selected:hover{background-color:var(--primary-color, #3091F6)}:host .error-msg{color:var(--negative-color, #e1174c);margin-top:3px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SwitcherComponent, { className: "SwitcherComponent", filePath: "switcher.component.ts", lineNumber: 18 }); })();

class SwitcherModule {
    static { this.ɵfac = function SwitcherModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || SwitcherModule)(); }; }
    static { this.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: SwitcherModule }); }
    static { this.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule] }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SwitcherModule, [{
        type: NgModule,
        args: [{
                declarations: [SwitcherComponent],
                imports: [CommonModule],
                exports: [SwitcherComponent]
            }]
    }], null, null); })();
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(SwitcherModule, { declarations: [SwitcherComponent], imports: [CommonModule], exports: [SwitcherComponent] }); })();

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

export { SwitcherComponent, SwitcherModule };
//# sourceMappingURL=ironsource-fusion-ui-components-switcher-v1.mjs.map
