import * as i0 from '@angular/core';
import { forwardRef, Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
import * as i1 from '@angular/common';
import { CommonModule } from '@angular/common';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { ListBoxBaseComponent } from '@ironsource/fusion-ui/components/list-box/common/base';
export { ListBoxModes } from '@ironsource/fusion-ui/components/list-box/common/base';
import * as i2 from '@ironsource/fusion-ui/components/icon/v1';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import * as i3 from '@ironsource/fusion-ui/components/tooltip/v2';
import { TooltipModule } from '@ironsource/fusion-ui/components/tooltip/v2';

function ListBoxComponent_div_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate2("", ctx_r0.title, " (", ctx_r0.options && ctx_r0.options.length, ")");
} }
function ListBoxComponent_li_3_fusion_icon_5_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-icon", 8);
    i0.ɵɵlistener("click", function ListBoxComponent_li_3_fusion_icon_5_Template_fusion_icon_click_0_listener($event) { i0.ɵɵrestoreView(_r6); const option_r2 = i0.ɵɵnextContext().$implicit; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.removeOption(option_r2, $event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("name", ctx_r3.removeIconName);
} }
function ListBoxComponent_li_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li")(1, "div", 4);
    i0.ɵɵelement(2, "fusion-icon", 5);
    i0.ɵɵelementStart(3, "span", 6);
    i0.ɵɵtext(4);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(5, ListBoxComponent_li_3_fusion_icon_5_Template, 1, 1, "fusion-icon", 7);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const option_r2 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("name", ctx_r1.checkIconName);
    i0.ɵɵadvance();
    i0.ɵɵproperty("fusionTooltip", option_r2[ctx_r1.mappingOptions == null ? null : ctx_r1.mappingOptions.displayText]);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(option_r2[ctx_r1.mappingOptions == null ? null : ctx_r1.mappingOptions.displayText]);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !ctx_r1.isDisabled);
} }
const _c0 = a0 => ({ "is-disabled": a0 });
class ListBoxComponent extends ListBoxBaseComponent {
    ngOnInit() {
        super.ngOnInit();
        this.checkIconName = { iconName: 'check', iconVersion: 'v2' };
        this.removeIconName = { iconName: 'close-circle', iconVersion: 'v2' };
    }
    static { this.ɵfac = /*@__PURE__*/ (() => { let ɵListBoxComponent_BaseFactory; return function ListBoxComponent_Factory(t) { return (ɵListBoxComponent_BaseFactory || (ɵListBoxComponent_BaseFactory = i0.ɵɵgetInheritedFactory(ListBoxComponent)))(t || ListBoxComponent); }; })(); }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ListBoxComponent, selectors: [["fusion-list-box"]], features: [i0.ɵɵProvidersFeature([
                {
                    provide: NG_VALUE_ACCESSOR,
                    useExisting: forwardRef(() => ListBoxComponent),
                    multi: true
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 4, vars: 9, consts: [["class", "title", 4, "ngIf"], [1, "is-list-holder", 3, "id", "ngClass"], [4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "title"], [1, "option"], [1, "checkIcon", 3, "name"], [1, "option-label", "truncate", 3, "fusionTooltip"], ["class", "removeIcon", 3, "name", "click", 4, "ngIf"], [1, "removeIcon", 3, "name", "click"]], template: function ListBoxComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, ListBoxComponent_div_0_Template, 2, 2, "div", 0);
            i0.ɵɵelementStart(1, "div", 1)(2, "ul");
            i0.ɵɵtemplate(3, ListBoxComponent_li_3_Template, 6, 4, "li", 2);
            i0.ɵɵelementEnd()();
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.title);
            i0.ɵɵadvance();
            i0.ɵɵclassMap(ctx.options && ctx.options.length ? ctx.mode : "");
            i0.ɵɵproperty("id", ctx.id)("ngClass", i0.ɵɵpureFunction1(7, _c0, ctx.isDisabled));
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngForOf", ctx.options)("ngForTrackBy", ctx.trackByOption);
        } }, dependencies: [i1.NgClass, i1.NgForOf, i1.NgIf, i2.IconComponent, i3.TooltipDirective], styles: ["[_nghost-%COMP%]   .title[_ngcontent-%COMP%]{font-size:12px;font-family:HelveticaNeue-Medium,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   .option-label[_ngcontent-%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%]   .truncate[_ngcontent-%COMP%]{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}[_nghost-%COMP%]   ul[_ngcontent-%COMP%], [_nghost-%COMP%]   ol[_ngcontent-%COMP%]{padding:0;margin:0}[_nghost-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%], [_nghost-%COMP%]   ol[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{list-style:none}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]::-webkit-scrollbar-track, [_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:4px;background-color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]::-webkit-scrollbar, [_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]::-webkit-scrollbar{width:12px;height:12px;background-color:var(--fu-white, #ffffff)}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]::-webkit-scrollbar-thumb, [_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:4px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:2px;background-color:var(--fu-light-500, #d2d5d8)}[_nghost-%COMP%]{height:100%;width:100%}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]{overflow-y:scroll;overflow-x:hidden;height:100%;display:block}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]{height:32px;border-bottom:1px solid var(--fu-light-300, #e5e7e9);padding:0 10px;color:var(--fu-light-800, #8e959d);display:flex;align-items:center}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.removeIcon[_ngcontent-%COMP%]{height:14px;cursor:pointer;margin-left:auto;margin-right:-1px;display:flex;align-items:center}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.removeIcon[_ngcontent-%COMP%]     svg{width:14px;height:14px}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.removeIcon[_ngcontent-%COMP%]     svg *{fill:var(--fu-light-500, #d2d5d8)}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.removeIcon[_ngcontent-%COMP%]:hover     svg{width:14px;height:14px}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.removeIcon[_ngcontent-%COMP%]:hover     svg *{fill:var(--fu-light-800, #8e959d)}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.checkIcon[_ngcontent-%COMP%]{margin-right:10px;height:14px;display:flex;align-items:center}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.checkIcon[_ngcontent-%COMP%]     svg{width:12px;height:12px}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   fusion-icon.checkIcon[_ngcontent-%COMP%]     svg *{fill:var(--fu-light-800, #8e959d)}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]   .option-label[_ngcontent-%COMP%]{letter-spacing:.04px;width:calc(100% - 46px);line-height:14px}[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]:hover{background-color:var(--fu-light-100, #f7f8f9)}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]{border-radius:10px;border:solid 1px var(--fu-light-300, #e5e7e9);padding:5px 0 6px 11px;overflow:initial}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]{overflow-y:scroll;overflow-x:hidden;height:100%}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]{margin-right:-10px}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .removeIcon[_ngcontent-%COMP%]{margin-right:8px}[_nghost-%COMP%]   .is-list-holder.frame[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]:last-child   .option[_ngcontent-%COMP%]{border-bottom:none}[_nghost-%COMP%]   .title[_ngcontent-%COMP%]{line-height:1.33;color:var(--fu-light-900, #7b838c);margin-bottom:8px}[_nghost-%COMP%]   .is-disabled[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]:hover{background-color:var(--fu-white, #ffffff)}.large[_nghost-%COMP%]   .is-list-holder[_ngcontent-%COMP%]   ul[_ngcontent-%COMP%]   li[_ngcontent-%COMP%]   .option[_ngcontent-%COMP%]{height:40px;padding:10px}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ListBoxComponent, [{
        type: Component,
        args: [{ selector: 'fusion-list-box', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
                    {
                        provide: NG_VALUE_ACCESSOR,
                        useExisting: forwardRef(() => ListBoxComponent),
                        multi: true
                    }
                ], template: " <div class=\"title\" *ngIf=\"title\">{{ title }} ({{ options && options.length }})</div>\n<div [id]=\"id\" class=\"is-list-holder\" [class]=\"options && options.length ? mode : ''\" [ngClass]=\"{'is-disabled': isDisabled}\">\n    <ul>\n        <li *ngFor=\"let option of options; trackBy: trackByOption\">\n            <div class=\"option\">\n                <fusion-icon [name]=\"checkIconName\" class=\"checkIcon\"></fusion-icon>\n                <span class=\"option-label truncate\" [fusionTooltip]=\"option[mappingOptions?.displayText]\">{{\n                    option[mappingOptions?.displayText]\n                }}</span>\n                <fusion-icon\n                    [name]=\"removeIconName\"\n                    class=\"removeIcon\"\n                    (click)=\"removeOption(option, $event)\"\n                    *ngIf=\"!isDisabled\"\n                ></fusion-icon>\n            </div>\n        </li>\n    </ul>\n</div>\n", styles: [":host .title{font-size:12px;font-family:HelveticaNeue-Medium,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host .is-list-holder .option .option-label{font-size:12px;font-family:HelveticaNeue,helvetica,sans-serif;font-weight:400;letter-spacing:.04px}:host *{box-sizing:border-box}:host .truncate{width:100%;display:inline-block;white-space:nowrap;overflow:hidden!important;text-overflow:ellipsis}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host ul,:host ol{padding:0;margin:0}:host ul li,:host ol li{list-style:none}:host .is-list-holder.frame ul::-webkit-scrollbar-track,:host .is-list-holder::-webkit-scrollbar-track{border-radius:4px;background-color:var(--fu-white, #ffffff)}:host .is-list-holder.frame ul::-webkit-scrollbar,:host .is-list-holder::-webkit-scrollbar{width:12px;height:12px;background-color:var(--fu-white, #ffffff)}:host .is-list-holder.frame ul::-webkit-scrollbar-thumb,:host .is-list-holder::-webkit-scrollbar-thumb{border:4px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:2px;background-color:var(--fu-light-500, #d2d5d8)}:host{height:100%;width:100%}:host .is-list-holder{overflow-y:scroll;overflow-x:hidden;height:100%;display:block}:host .is-list-holder .option{height:32px;border-bottom:1px solid var(--fu-light-300, #e5e7e9);padding:0 10px;color:var(--fu-light-800, #8e959d);display:flex;align-items:center}:host .is-list-holder .option fusion-icon.removeIcon{height:14px;cursor:pointer;margin-left:auto;margin-right:-1px;display:flex;align-items:center}:host .is-list-holder .option fusion-icon.removeIcon ::ng-deep svg{width:14px;height:14px}:host .is-list-holder .option fusion-icon.removeIcon ::ng-deep svg *{fill:var(--fu-light-500, #d2d5d8)}:host .is-list-holder .option fusion-icon.removeIcon:hover ::ng-deep svg{width:14px;height:14px}:host .is-list-holder .option fusion-icon.removeIcon:hover ::ng-deep svg *{fill:var(--fu-light-800, #8e959d)}:host .is-list-holder .option fusion-icon.checkIcon{margin-right:10px;height:14px;display:flex;align-items:center}:host .is-list-holder .option fusion-icon.checkIcon ::ng-deep svg{width:12px;height:12px}:host .is-list-holder .option fusion-icon.checkIcon ::ng-deep svg *{fill:var(--fu-light-800, #8e959d)}:host .is-list-holder .option .option-label{letter-spacing:.04px;width:calc(100% - 46px);line-height:14px}:host .is-list-holder .option:hover{background-color:var(--fu-light-100, #f7f8f9)}:host .is-list-holder.frame{border-radius:10px;border:solid 1px var(--fu-light-300, #e5e7e9);padding:5px 0 6px 11px;overflow:initial}:host .is-list-holder.frame ul{overflow-y:scroll;overflow-x:hidden;height:100%}:host .is-list-holder.frame ul li{margin-right:-10px}:host .is-list-holder.frame ul li .removeIcon{margin-right:8px}:host .is-list-holder.frame ul li:last-child .option{border-bottom:none}:host .title{line-height:1.33;color:var(--fu-light-900, #7b838c);margin-bottom:8px}:host .is-disabled .option:hover{background-color:var(--fu-white, #ffffff)}:host.large .is-list-holder ul li .option{height:40px;padding:10px}\n"] }]
    }], null, null); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ListBoxComponent, { className: "ListBoxComponent", filePath: "list-box.component.ts", lineNumber: 18 }); })();

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

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

export { ListBoxComponent, ListBoxModule };
//# sourceMappingURL=ironsource-fusion-ui-components-list-box-v2.mjs.map
