/*
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, fromEnum, toEnum, markType } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { PathGeometry } from "igniteui-angular-core";
import { NaNSegmenter } from "./NaNSegmenter";
import { PolyLineSegment } from "igniteui-angular-core";
/**
 * @hidden
 */
export let PathRenderer = /*@__PURE__*/ (() => {
    class PathRenderer extends Base {
        constructor(a, ..._rest) {
            super();
            this.a = null;
            this.b = 0;
            a = (a == void 0) ? 0 : a;
            switch (a) {
                case 0:
                    {
                        this.b = 1;
                    }
                    break;
                case 1:
                    {
                        let c = _rest[0];
                        this.a = c;
                    }
                    break;
            }
        }
        d(a, b, c) {
            let d = NaNSegmenter.c(b, this.b);
            let e = this.c(d, c);
            let f = new PathGeometry();
            for (let g of fromEnum(e)) {
                f.c.add(g);
            }
            a.ak = f;
        }
        *_c(a, b) {
            for (let c = 0; c < a.count; c++) {
                let d = a.item(c);
                if (d.count >= 2) {
                    let e = new PathFigure();
                    let f = d.item(0);
                    e._startPoint = f;
                    let g = this.e(d, b);
                    e._segments.add(g);
                    yield e;
                }
            }
        }
        c(a, b) {
            return toEnum(() => this._c(a, b));
        }
        e(a, b) {
            let c = new PolyLineSegment();
            if (this.a == null) {
                for (let d = 1; d < a.count; d++) {
                    let e = a.item(d);
                    c._points.add(e);
                }
            }
            else {
                let f = this.a.flatten(a, b);
                for (let g = 1; g < f.count; g++) {
                    let h = f.item(g);
                    c._points.add(h);
                }
            }
            return c;
        }
    }
    PathRenderer.$t = markType(PathRenderer, 'PathRenderer');
    return PathRenderer;
})();
