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 _r4 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div", 2)(1, "input", 3);
    i0.ɵɵlistener("change", function SwitcherComponent_div_1_Template_input_change_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r4); const item_r2 = restoredCtx.$implicit; const ctx_r3 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r3.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_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(10, _c0, ctx_r0.isSelected(item_r2), item_r2.disabled || ctx_r0.isDisabled));
    i0.ɵɵadvance();
    i0.ɵɵpropertyInterpolate2("id", "", ctx_r0.name, "_", item_r2.id, "");
    i0.ɵɵproperty("name", ctx_r0.name)("checked", ctx_r0.isSelected(item_r2))("disabled", item_r2.disabled);
    i0.ɵɵadvance();
    i0.ɵɵpropertyInterpolate2("for", "", ctx_r0.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_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r1.error);
} }
class SwitcherComponent extends SwitcherBaseComponent {
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵSwitcherComponent_BaseFactory; return function SwitcherComponent_Factory(t) { return (ɵSwitcherComponent_BaseFactory || (ɵSwitcherComponent_BaseFactory = i0.ɵɵgetInheritedFactory(SwitcherComponent)))(t || 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, "id", "name", "checked", "disabled", "change"], [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, 13, "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:11px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;font-weight:400;letter-spacing:.25px}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]{line-height:20px}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]{display:inline-flex}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]{height:24px;min-width:68px;text-align:center;color:var(--fu-primary-500, #3083ff);background-color:var(--fu-primary-100, #e2eeff)}[_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%]{display:inherit;padding:3px 8px;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:hover{background-color:var(--fu-primary-200, #c9dfff)}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:hover   label[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:hover.selected   label[_ngcontent-%COMP%]{cursor:default}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:first-child{border-radius:12px 0 0 12px}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder[_ngcontent-%COMP%]:last-child{border-radius:0 12px 12px 0}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.selected[_ngcontent-%COMP%]{background-color:var(--fu-primary-500, #3083ff);color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.selected.not-allowed[_ngcontent-%COMP%]{color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.selected.not-allowed[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{opacity:.8}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.selected.not-allowed[_ngcontent-%COMP%]:hover{background-color:var(--fu-primary-500, #3083ff)}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.not-allowed[_ngcontent-%COMP%]{cursor:not-allowed;color:var(--fu-primary-400, #68a5ff)}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.not-allowed[_ngcontent-%COMP%]   input[type=radio][_ngcontent-%COMP%] + label[_ngcontent-%COMP%]{pointer-events:none}[_nghost-%COMP%]   .is-switcher[_ngcontent-%COMP%]   .is-switcher-holder.not-allowed[_ngcontent-%COMP%]:hover{background-color:var(--fu-primary-100, #e2eeff)}[_nghost-%COMP%]   .error-msg[_ngcontent-%COMP%]{color:var(--fu-negative-500, #ff6a63);margin-top:-2px}"], 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:11px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400}:host .is-switcher .is-switcher-holder input[type=radio]+label{font-size:11px;font-family:NHaasGroteskDSPro-65Md,sans-serif;font-weight:400;letter-spacing:.25px}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host{line-height:20px}:host .is-switcher{display:inline-flex}:host .is-switcher .is-switcher-holder{height:24px;min-width:68px;text-align:center;color:var(--fu-primary-500, #3083ff);background-color:var(--fu-primary-100, #e2eeff)}:host .is-switcher .is-switcher-holder input[type=radio]{display:none}:host .is-switcher .is-switcher-holder input[type=radio]+label{display:inherit;padding:3px 8px;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host .is-switcher .is-switcher-holder:hover{background-color:var(--fu-primary-200, #c9dfff)}:host .is-switcher .is-switcher-holder:hover label{cursor:pointer}:host .is-switcher .is-switcher-holder:hover.selected label{cursor:default}:host .is-switcher .is-switcher-holder:first-child{border-radius:12px 0 0 12px}:host .is-switcher .is-switcher-holder:last-child{border-radius:0 12px 12px 0}:host .is-switcher .is-switcher-holder.selected{background-color:var(--fu-primary-500, #3083ff);color:var(--fu-white, #ffffff)}:host .is-switcher .is-switcher-holder.selected.not-allowed{color:var(--fu-white, #ffffff)}:host .is-switcher .is-switcher-holder.selected.not-allowed input[type=radio]+label{opacity:.8}:host .is-switcher .is-switcher-holder.selected.not-allowed:hover{background-color:var(--fu-primary-500, #3083ff)}:host .is-switcher .is-switcher-holder.not-allowed{cursor:not-allowed;color:var(--fu-primary-400, #68a5ff)}:host .is-switcher .is-switcher-holder.not-allowed input[type=radio]+label{pointer-events:none}:host .is-switcher .is-switcher-holder.not-allowed:hover{background-color:var(--fu-primary-100, #e2eeff)}:host .error-msg{color:var(--fu-negative-500, #ff6a63);margin-top:-2px}\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(t) { return new (t || 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-v2.mjs.map
