import { ChangeDetectionStrategy, Component, Input, TemplateRef, } from '@angular/core';
import * as i0 from "@angular/core";
const _c0 = function () { return []; };
const _c1 = function (a0) { return { data: a0 }; };
function LegendDropdownComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "aui-icon", 3);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const _r3 = i0.ɵɵreference(4);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("auiTooltip", _r3)("auiTooltipContext", i0.ɵɵpureFunction1(3, _c1, i0.ɵɵpureFunction0(2, _c0)));
} }
function LegendDropdownComponent_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "button", 4);
    i0.ɵɵelement(1, "aui-icon", 5);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵnextContext();
    const _r3 = i0.ɵɵreference(4);
    i0.ɵɵproperty("square", true)("auiTooltip", _r3)("auiTooltipContext", i0.ɵɵpureFunction1(4, _c1, i0.ɵɵpureFunction0(3, _c0)));
} }
function LegendDropdownComponent_ng_template_3_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 7);
    i0.ɵɵelementContainer(2, 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r5.legendTemplate);
} }
function LegendDropdownComponent_ng_template_3_ng_template_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 9);
    i0.ɵɵtext(1);
    i0.ɵɵpipe(2, "translate");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(2, 1, "no_data"));
} }
function LegendDropdownComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, LegendDropdownComponent_ng_template_3_ng_container_0_Template, 3, 1, "ng-container", 0);
    i0.ɵɵtemplate(1, LegendDropdownComponent_ng_template_3_ng_template_1_Template, 3, 3, "ng-template", null, 6, i0.ɵɵtemplateRefExtractor);
} if (rf & 2) {
    const _r6 = i0.ɵɵreference(2);
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngIf", ctx_r4.data.length && !ctx_r4.noData)("ngIfElse", _r6);
} }
export class LegendDropdownComponent {
}
LegendDropdownComponent.ɵfac = function LegendDropdownComponent_Factory(t) { return new (t || LegendDropdownComponent)(); };
LegendDropdownComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LegendDropdownComponent, selectors: [["acl-legend-dropdown"]], inputs: { data: "data", legendTemplate: "legendTemplate", noData: "noData", isCard: "isCard" }, decls: 5, vars: 2, consts: [[4, "ngIf", "ngIfElse"], ["elseTemplate", ""], ["dropdownItemTemplate", ""], ["icon", "basic:chart_legend", "auiTooltipType", "info", "auiTooltipPosition", "bottom end", "auiTooltipTrigger", "click", "auiTooltipActive", "legendActive", 1, "btn", 3, "auiTooltip", "auiTooltipContext"], ["aui-button", "", "icon", "basic:chart_legend", "auiTooltipType", "info", "auiTooltipPosition", "bottom end", "auiTooltipTrigger", "click", "auiTooltipActive", "legendActive", 1, "btn", 3, "square", "auiTooltip", "auiTooltipContext"], ["icon", "basic:chart_legend"], ["noDataTemplate", ""], [1, "legend-vertical"], [3, "ngTemplateOutlet"], [1, "no-data"]], template: function LegendDropdownComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, LegendDropdownComponent_ng_container_0_Template, 2, 5, "ng-container", 0);
        i0.ɵɵtemplate(1, LegendDropdownComponent_ng_template_1_Template, 2, 6, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵtemplate(3, LegendDropdownComponent_ng_template_3_Template, 3, 2, "ng-template", null, 2, i0.ɵɵtemplateRefExtractor);
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(2);
        i0.ɵɵproperty("ngIf", !ctx.isCard)("ngIfElse", _r1);
    } }, styles: [".btn[_ngcontent-%COMP%]{color:#999;cursor:pointer}  .legend-label{padding:0;margin:0;list-style:none;display:flex;align-items:center;cursor:pointer;justify-content:flex-start}  .legend-label:not(:last-child){margin-bottom:8px}  .label-name{color:rgb(var(--aui-color-secondary-text))}  .label-symbol{margin-right:4px}[_nghost-%COMP%]   .legend-labels[_ngcontent-%COMP%]{padding:0;margin:0;list-style:none;display:flex;flex-direction:column}.legendActive[_ngcontent-%COMP%]{color:rgb(var(--aui-color-primary))}.no-data[_ngcontent-%COMP%]{color:rgb(var(--aui-color-n-4));font-size:14px}"], changeDetection: 0 });
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LegendDropdownComponent, [{
        type: Component,
        args: [{ selector: 'acl-legend-dropdown', template: `
    <ng-container *ngIf="!isCard; else elseTemplate">
      <aui-icon
        class="btn"
        icon="basic:chart_legend"
        [auiTooltip]="dropdownItemTemplate"
        [auiTooltipContext]="{ data: [] }"
        auiTooltipType="info"
        auiTooltipPosition="bottom end"
        auiTooltipTrigger="click"
        auiTooltipActive="legendActive"
      ></aui-icon>
    </ng-container>
    <ng-template #elseTemplate>
      <button
        aui-button
        [square]="true"
        class="btn"
        icon="basic:chart_legend"
        [auiTooltip]="dropdownItemTemplate"
        [auiTooltipContext]="{ data: [] }"
        auiTooltipType="info"
        auiTooltipPosition="bottom end"
        auiTooltipTrigger="click"
        auiTooltipActive="legendActive"
      >
        <aui-icon icon="basic:chart_legend"></aui-icon>
      </button>
    </ng-template>

    <ng-template #dropdownItemTemplate>
      <ng-container *ngIf="data.length && !noData; else noDataTemplate">
        <div class="legend-vertical">
          <ng-container [ngTemplateOutlet]="legendTemplate"></ng-container>
        </div>
      </ng-container>
      <ng-template #noDataTemplate>
        <span class="no-data">{{ 'no_data' | translate }}</span>
      </ng-template>
    </ng-template>
  `, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".btn{color:#999;cursor:pointer}::ng-deep .legend-label{padding:0;margin:0;list-style:none;display:flex;align-items:center;cursor:pointer;justify-content:flex-start}::ng-deep .legend-label:not(:last-child){margin-bottom:8px}::ng-deep .label-name{color:rgb(var(--aui-color-secondary-text))}::ng-deep .label-symbol{margin-right:4px}:host .legend-labels{padding:0;margin:0;list-style:none;display:flex;flex-direction:column}.legendActive{color:rgb(var(--aui-color-primary))}.no-data{color:rgb(var(--aui-color-n-4));font-size:14px}\n"] }]
    }], null, { data: [{
            type: Input
        }], legendTemplate: [{
            type: Input
        }], noData: [{
            type: Input
        }], isCard: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZHJvcGRvd24tbGVnZW5kLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21tb24vc3JjL3ZpZXctY2hhcnQvY3VzdG9tLXRlbXBsYXRlL2Ryb3Bkb3duLWxlZ2VuZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxLQUFLLEVBQ0wsV0FBVyxHQUNaLE1BQU0sZUFBZSxDQUFDOzs7OztJQU9uQiw2QkFBaUQ7SUFDL0MsOEJBU1k7SUFDZCwwQkFBZTs7OztJQVBYLGVBQW1DO0lBQW5DLGdDQUFtQyw2RUFBQTs7O0lBU3JDLGlDQVdDO0lBQ0MsOEJBQStDO0lBQ2pELGlCQUFTOzs7O0lBWFAsNkJBQWUsbUJBQUEsNkVBQUE7OztJQWVqQiw2QkFBa0U7SUFDaEUsOEJBQTZCO0lBQzNCLDJCQUFpRTtJQUNuRSxpQkFBTTtJQUNSLDBCQUFlOzs7SUFGRyxlQUFtQztJQU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