import { Component, HostBinding, Inject, Injector, Optional } from '@angular/core';
import { provideAsWidgetRef, StylableComponent, styler } from '@wm/components/base';
import { registerProps } from './icon.props';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@wm/components/base";
const _c0 = ["wmIcon", ""];
function IconComponent_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 2);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate(ctx_r0.arialabel || ctx_r0.caption || ctx_r0.appLocale.LABEL_ICON);
} }
function IconComponent_label_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "label", 3);
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("textContent", ctx_r0.caption);
} }
const DEFAULT_CLS = 'app-icon-wrapper';
const WIDGET_CONFIG = {
    widgetType: 'wm-icon',
    hostClass: DEFAULT_CLS
};
export class IconComponent extends StylableComponent {
    static { this.initializeProps = registerProps(); }
    constructor(inj, explicitContext) {
        super(inj, WIDGET_CONFIG, explicitContext);
        styler(this.nativeElement, this);
    }
    static { this.ɵfac = function IconComponent_Factory(t) { return new (t || IconComponent)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: IconComponent, selectors: [["", "wmIcon", ""]], hostVars: 3, hostBindings: function IconComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵattribute("icon-position", ctx.iconposition);
            i0.ɵɵstyleProp("font-size", ctx.iconsize);
        } }, features: [i0.ɵɵProvidersFeature([
                provideAsWidgetRef(IconComponent)
            ]), i0.ɵɵInheritDefinitionFeature], attrs: _c0, decls: 3, vars: 5, consts: [["class", "sr-only", 4, "ngIf"], ["aria-hidden", "true", "class", "app-label", 3, "textContent", 4, "ngIf"], [1, "sr-only"], ["aria-hidden", "true", 1, "app-label", 3, "textContent"]], template: function IconComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelement(0, "i");
            i0.ɵɵtemplate(1, IconComponent_span_1_Template, 2, 1, "span", 0)(2, IconComponent_label_2_Template, 1, 1, "label", 1);
        } if (rf & 2) {
            i0.ɵɵclassMapInterpolate1("app-icon ", ctx.iconclass, "");
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.iconclass);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.caption);
        } }, dependencies: [i1.NgIf, i2.TextContentDirective], encapsulation: 2 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(IconComponent, [{
        type: Component,
        args: [{ selector: '[wmIcon]', providers: [
                    provideAsWidgetRef(IconComponent)
                ], template: "<i class=\"app-icon {{iconclass}}\"></i>\n<span *ngIf=\"iconclass\" class=\"sr-only\">{{ arialabel || caption || appLocale.LABEL_ICON }}</span>\n<label *ngIf=\"caption\" [textContent]=\"caption\" aria-hidden=\"true\" class=\"app-label\"></label>\n" }]
    }], () => [{ type: i0.Injector }, { type: undefined, decorators: [{
                type: Inject,
                args: ['EXPLICIT_CONTEXT']
            }, {
                type: Optional
            }] }], { iconposition: [{
            type: HostBinding,
            args: ['attr.icon-position']
        }], iconsize: [{
            type: HostBinding,
            args: ['style.fontSize']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(IconComponent, { className: "IconComponent", filePath: "icon/icon.component.ts", lineNumber: 19 }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWNvbi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jb21wb25lbnRzL3dpZGdldHMvYmFzaWMvZGVmY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