/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, Point_$type, markType } from "igniteui-angular-core";
import { LegendItemHelper } from "igniteui-angular-core";
import { RenderingContext } from "igniteui-angular-core";
import { EllipseGeometry } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { CanvasViewRenderer } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
/**
 * @hidden
 */
export let PieLegendTemplates = /*@__PURE__*/ (() => {
    class PieLegendTemplates extends Base {
        static h(a) {
            let b = a.data;
            let c = b.series;
            let d = c.legendItemBadgeTemplate;
            let e = b.legendLabel != null ? b.legendLabel : b.itemLabel;
            if (e == null) {
                e = "Pie Item";
            }
            LegendItemHelper.c(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo);
        }
        static e(a) {
            let b = a.data;
            let c = b.series;
            let d = c.legendItemBadgeTemplate;
            let e = b.legendLabel != null ? b.legendLabel : b.itemLabel;
            if (e == null) {
                e = "Doughnut Item";
            }
            LegendItemHelper.c(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo);
        }
        static c(a) {
        }
        static f(a) {
        }
        static g(a) {
            let b = a.data;
            let c = a.context;
            let d = new RenderingContext(new CanvasViewRenderer(), c);
            let e = DeviceUtils.g(9);
            let f = DeviceUtils.g(9);
            let g = e / 2;
            let h = f / 2;
            let i = PieLegendTemplates.a(g, e, a.availableWidth);
            let j = PieLegendTemplates.b(h, f, a.availableHeight);
            let k = new EllipseGeometry();
            k.e = { $type: Point_$type, x: i, y: j };
            k.c = g;
            k.d = h;
            let l = new Path();
            l.ak = k;
            l._fill = b.itemBrush;
            l._stroke = b.outline;
            l.ac = isNaN_(b.thickness) ? 1 : b.thickness;
            d.t(l);
        }
        static d(a) {
            let b = a.data;
            let c = a.context;
            let d = new RenderingContext(new CanvasViewRenderer(), c);
            let e = DeviceUtils.g(9);
            let f = DeviceUtils.g(9);
            let g = e / 2;
            let h = f / 2;
            let i = PieLegendTemplates.a(g, e, a.availableWidth);
            let j = PieLegendTemplates.b(h, f, a.availableHeight);
            let k = new EllipseGeometry();
            k.e = { $type: Point_$type, x: i, y: j };
            k.c = g;
            k.d = h;
            let l = new Path();
            l.ak = k;
            l._fill = b.itemBrush;
            l._stroke = b.outline;
            l.ac = isNaN_(b.thickness) ? 1 : b.thickness;
            d.t(l);
        }
        static a(a, b, c) {
            let d = (c - b) / 2;
            return a + d;
        }
        static b(a, b, c) {
            let d = (c - b) / 2;
            return a + d;
        }
    }
    PieLegendTemplates.$t = markType(PieLegendTemplates, 'PieLegendTemplates');
    return PieLegendTemplates;
})();
