UNPKG

igniteui-angular-gauges

Version:

Ignite UI Angular gauge components.

2,700 lines 102 kB
/*
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 { Control } from "igniteui-angular-core";
import { INotifyPropertyChanged_$type, Base, PropertyChangedEventArgs, runOn, delegateCombine, Point_$type, Number_$type, enumGetBox, Delegate_$type, typeCast, String_$type, Array_$type, delegateRemove, fromEn, fromEnum, markType, markDep, TypeRegistrar } from "igniteui-angular-core";
import { DoubleAnimator } from "igniteui-angular-core";
import { BrushCollection } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { HighlightedValueDisplayMode_$type } from "igniteui-angular-core";
import { SweepDirection_$type } from "igniteui-angular-core";
import { Brush } from "igniteui-angular-core";
import { RadialGaugeNeedleShape_$type } from "./RadialGaugeNeedleShape";
import { RadialGaugePivotShape_$type } from "./RadialGaugePivotShape";
import { RadialGaugeScaleOversweepShape_$type } from "./RadialGaugeScaleOversweepShape";
import { RadialGaugeBackingShape_$type } from "./RadialGaugeBackingShape";
import { RadialGaugeRangeCollection } from "./RadialGaugeRangeCollection";
import { RadialGaugeDuplicateLabelOmissionStrategy_$type } from "./RadialGaugeDuplicateLabelOmissionStrategy";
import { BindingFormatter } from "igniteui-angular-core";
import { RadialGaugeScaler } from "./RadialGaugeScaler";
import { Rect } from "igniteui-angular-core";
import { RadialGaugeFrame } from "./RadialGaugeFrame";
import { StackPool$1 } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { TextBlock } from "igniteui-angular-core";
import { FontInfo } from "igniteui-angular-core";
import { FontUtil } from "igniteui-angular-core";
import { FontDefaults } from "igniteui-angular-core";
import { AlignRadialGaugeLabelEventArgs } from "./AlignRadialGaugeLabelEventArgs";
import { FormatRadialGaugeLabelEventArgs } from "./FormatRadialGaugeLabelEventArgs";
import { MathUtil } from "igniteui-angular-core";
import { Size } from "igniteui-angular-core";
import { Stack$1 } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { GeometryUtil } from "igniteui-angular-core";
import { DoubleValueChangedEventArgs } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { XamRadialGaugeRange } from "./XamRadialGaugeRange";
import { PathGeometry } from "igniteui-angular-core";
import { PolygonUtil } from "igniteui-angular-core";
import { TransformGroup } from "igniteui-angular-core";
import { RotateTransform } from "igniteui-angular-core";
import { RadialGaugeNeedleParameters } from "./RadialGaugeNeedleParameters";
import { RadialGaugeNeedlePreparer } from "./RadialGaugeNeedlePreparer";
import { BrushUtil } from "igniteui-angular-core";
import { PathFigure } from "igniteui-angular-core";
import { Tuple$2 } from "igniteui-angular-core";
import { RadialGaugeRangeFrame } from "./RadialGaugeRangeFrame";
import { ArcSegment } from "igniteui-angular-core";
import { LineSegment } from "igniteui-angular-core";
import { GaugeVisualData } from "./GaugeVisualData";
import { RectData } from "igniteui-angular-core";
import { ScaleLabelVisualDataList } from "./ScaleLabelVisualDataList";
import { ScaleTickmarkVisualDataList } from "./ScaleTickmarkVisualDataList";
import { RangeVisualDataList } from "./RangeVisualDataList";
import { NeedleVisualData } from "./NeedleVisualData";
import { PropertyMetadata } from "igniteui-angular-core";
import { isNaN_, isInfinity, truncate } from "igniteui-angular-core";
import { EventProxy } from "igniteui-angular-core";
import { RenderingContext } from "igniteui-angular-core";
import { Dictionary$2 } from "igniteui-angular-core";
import { CanvasScalingHelpers } from "igniteui-angular-core";
import { CanvasViewRenderer } from "igniteui-angular-core";
import { ScaleLabelVisualData } from "./ScaleLabelVisualData";
import { ScaleTickmarkVisualData } from "./ScaleTickmarkVisualData";
import { RangeVisualData } from "./RangeVisualData";
import { PathVisualData } from "igniteui-angular-core";
import { PointData } from "igniteui-angular-core";
import { SizeData } from "igniteui-angular-core";
import { AppearanceHelper } from "igniteui-angular-core";
import { arrayCopy1 } from "igniteui-angular-core";
/**
 * @hidden
 */
export let XamRadialGauge = /*@__PURE__*/ (() => {
    class XamRadialGauge extends Control {
        constructor() {
            super();
            this.propertyChanged = null;
            this.alignTitle = null;
            this.alignSubtitle = null;
            this.alignHighlightLabel = null;
            this.formatTitle = null;
            this.formatSubtitle = null;
            this.formatHighlightLabel = null;
            this._view = null;
            this.bc = null;
            this.c4 = 0;
            this.c3 = 100;
            this.bw = 0;
            this.c2 = 0.5;
            this.bt = 1;
            this.bx = 0;
            this.formatLabel = null;
            this.am = null;
            this.alignLabel = null;
            this.valueChanged = null;
            this.highlightValueChanged = null;
            this.cb = false;
            this.a9 = null;
            this.mn = new Size(1, NaN, NaN);
            this.ml = null;
            this.cw = null;
            this.cx = null;
            this.cu = null;
            this.cv = null;
            this.a4 = null;
            this.a3 = null;
            this.a2 = null;
            this.cz = new Stack$1(TextBlock.$);
            this.c0 = new Stack$1(TextBlock.$);
            this.c1 = new Stack$1(TextBlock.$);
            this.cy = new Stack$1(TextBlock.$);
            this.ct = new List$1(Path.$, 0);
            this.cs = new List$1(Path.$, 0);
            this.cr = new List$1(Path.$, 0);
            this.c7 = 0;
            this.b3 = null;
            this.b0 = null;
            this.bz = null;
            this.b2 = null;
            this.b4 = null;
            this.by = null;
            this.b1 = null;
            this.c6 = NaN;
            this.c5 = 1;
            this.em = 0;
            this.ao = null;
            this.ap = null;
            this.an = null;
            this.bj = XamRadialGauge.bm();
            this.bk = XamRadialGauge.bn();
            this.bl = XamRadialGauge.bo();
            this.view = new XamRadialGaugeView(this);
            this.view.az();
            this.ml = Rect.empty;
            this.a4 = new RadialGaugeFrame();
            this.a3 = new RadialGaugeFrame();
            this.a2 = new RadialGaugeFrame();
            this.ranges = new RadialGaugeRangeCollection();
            this.cb = true;
            this.bc = new DoubleAnimator(0, 1, this.fg);
            let a = this.bc;
            a.propertyChanged = delegateCombine(a.propertyChanged, runOn(this, this.il));
            this.ab = XamRadialGauge.$;
            this.bz = ((() => {
                let $ret = new StackPool$1(TextBlock.$);
                $ret.b = runOn(this.view, this.view.ar);
                $ret.c = runOn(this.view, this.view.as);
                $ret.d = runOn(this.view, this.view.at);
                $ret.j = runOn(this.view, this.view.bm);
                return $ret;
            })());
            this.b4 = ((() => {
                let $ret = new StackPool$1(TextBlock.$);
                $ret.b = runOn(this.view, this.view.ar);
                $ret.c = runOn(this.view, this.view.as);
                $ret.d = runOn(this.view, this.view.bh);
                $ret.j = runOn(this.view, this.view.bo);
                return $ret;
            })());
            this.b2 = ((() => {
                let $ret = new StackPool$1(TextBlock.$);
                $ret.b = runOn(this.view, this.view.ar);
                $ret.c = runOn(this.view, this.view.as);
                $ret.d = runOn(this.view, this.view.bg);
                $ret.j = runOn(this.view, this.view.bn);
                return $ret;
            })());
            this.by = ((() => {
                let $ret = new StackPool$1(TextBlock.$);
                $ret.b = runOn(this.view, this.view.ar);
                $ret.c = runOn(this.view, this.view.as);
                $ret.d = runOn(this.view, this.view.ap);
                $ret.j = runOn(this.view, this.view.bl);
                return $ret;
            })());
            this.b3 = ((() => {
                let $ret = new StackPool$1(Path.$);
                $ret.b = runOn(this.view, this.view.a2);
                $ret.c = runOn(this.view, this.view.a3);
                $ret.d = runOn(this.view, this.view.a4);
                $ret.j = runOn(this.view, this.view.ce);
                return $ret;
            })());
            this.b0 = ((() => {
                let $ret = new StackPool$1(Path.$);
                $ret.b = runOn(this.view, this.view.a2);
                $ret.c = runOn(this.view, this.view.a3);
                $ret.d = runOn(this.view, this.view.a4);
                $ret.j = runOn(this.view, this.view.ce);
                return $ret;
            })());
            this.b1 = ((() => {
                let $ret = new StackPool$1(Path.$);
                $ret.b = runOn(this.view, this.view.a7);
                $ret.c = runOn(this.view, this.view.a8);
                $ret.d = runOn(this.view, this.view.a9);
                $ret.j = runOn(this.view, this.view.cf);
                return $ret;
            })());
            this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
        }
        iz(a) {
            this.i5(a);
        }
        i5(a) {
            let b = this.propertyChanged;
            if (b != null) {
                b(this, new PropertyChangedEventArgs(a));
            }
        }
        static bn() {
            if (XamRadialGauge.bh != null) {
                return XamRadialGauge.bh;
            }
            XamRadialGauge.bh = ((() => {
                let $ret = new FontInfo();
                $ret.f = FontDefaults.gaugesSubtitleSize;
                $ret.t = FontDefaults.gaugesFontStyle;
                $ret.q = FontDefaults.gaugesFontFamily;
                $ret.v = FontDefaults.gaugesFontWeight;
                $ret.r = FontDefaults.gaugesFontStretch;
                $ret.u = FontDefaults.gaugesFontVariant;
                return $ret;
            })());
            return XamRadialGauge.bh;
        }
        static bo() {
            if (XamRadialGauge.bi != null) {
                return XamRadialGauge.bi;
            }
            XamRadialGauge.bi = ((() => {
                let $ret = new FontInfo();
                $ret.f = FontDefaults.gaugesTitleSize;
                $ret.t = FontDefaults.gaugesFontStyle;
                $ret.q = FontDefaults.gaugesFontFamily;
                $ret.v = FontDefaults.gaugesFontWeight;
                $ret.r = FontDefaults.gaugesFontStretch;
                $ret.u = FontDefaults.gaugesFontVariant;
                return $ret;
            })());
            return XamRadialGauge.bi;
        }
        static bm() {
            if (XamRadialGauge.bg != null) {
                return XamRadialGauge.bg;
            }
            XamRadialGauge.bg = ((() => {
                let $ret = new FontInfo();
                $ret.f = FontDefaults.gaugesTitleSize;
                $ret.t = FontDefaults.gaugesFontStyle;
                $ret.q = FontDefaults.gaugesFontFamily;
                $ret.v = FontDefaults.gaugesFontWeight;
                $ret.r = FontDefaults.gaugesFontStretch;
                $ret.u = FontDefaults.gaugesFontVariant;
                return $ret;
            })());
            return XamRadialGauge.bg;
        }
        av(a, b, c, d, e, f) {
            let g = new FormatRadialGaugeLabelEventArgs();
            g.startAngle = this.a9.i;
            g.endAngle = this.a9.g;
            g.actualMinimumValue = this.da;
            g.actualMaximumValue = this.c9;
            g.angle = MathUtil.p(b);
            g.value = a;
            let h = a;
            if (!d) {
                g.label = c;
            }
            else {
                if (e == null) {
                    h = Math.round(g.value * 100) / 100;
                }
                g.label = (h).toString();
                if (e != null) {
                    g.label = e.i(h);
                }
            }
            if (f != null) {
                f(this, g);
            }
            return g;
        }
        aq(a, b, c, d, e, f) {
            let g = c.h(this.em);
            let h = new AlignRadialGaugeLabelEventArgs();
            h.startAngle = this.a9.i;
            h.endAngle = this.a9.g;
            h.actualMinimumValue = this.da;
            h.actualMaximumValue = this.c9;
            h.angle = d.angle;
            h.value = d.value;
            h.label = d.label;
            h.extent = a;
            h.brush = b;
            h.font = g;
            let i = c.b(h.font);
            let j = f(((() => {
                let $ret = new TextBlock();
                $ret.al = h.label;
                return $ret;
            })()), i);
            h.width = j.width;
            h.height = j.height;
            h.offsetX = -1 * (j.width / 2);
            h.offsetY = -1 * (j.height / 2);
            let k = h.offsetX;
            let l = h.offsetY;
            if (e != null) {
                e(this, h);
                if (h.font != g) {
                    h.font *= this.em;
                    i = i.b(h.font);
                    j = f(((() => {
                        let $ret = new TextBlock();
                        $ret.al = h.label;
                        return $ret;
                    })()), i);
                    h.width = j.width;
                    h.height = j.height;
                    h.offsetX = -1 * (j.width / 2) + (h.offsetX - k);
                    h.offsetY = -1 * (j.height / 2) + (h.offsetY - l);
                }
            }
            return h;
        }
        onDetachedFromUI() {
            this.view.ay();
        }
        onAttachedToUI() {
            this.view.au();
        }
        e2(a) {
            return this.a9.h(a);
        }
        fe(a) {
            return this.a9.j(a);
        }
        dn(a) {
            let b = this.mm;
            let c = Math.min(b.width / 2, b.height / 2) * this.ep;
            let d = this.mj();
            let e = d.x;
            let f = d.y;
            let g = GeometryUtil.g({ $type: Point_$type, x: e, y: f }, a);
            if (this.a9 != null && g < this.a9.i) {
                g += Math.PI * 2;
            }
            if (this.a9 != null && g > this.a9.g) {
                g -= Math.PI * 2;
            }
            let h = this.fe(g);
            return h;
        }
        mk(a, b) {
            let c = this.e2(a);
            let d = Math.min(this.mm.width / 2, this.mm.height / 2) * this.ep * b;
            let e = this.mj();
            let f = e.x + Math.cos(c) * d;
            let g = e.y + Math.sin(c) * d;
            return { $type: Point_$type, x: f, y: g };
        }
        l7(a, b) {
            if (b != null && b.count > 0) {
                return b.item(a % b.count);
            }
            else {
                return null;
            }
        }
        get view() {
            return this._view;
        }
        set view(a) {
            this._view = a;
        }
        il(a, b) {
            this.fd = this.bc.o;
        }
        get da() {
            return this.c4;
        }
        set da(a) {
            this.c4 = a;
        }
        get c9() {
            return this.c3;
        }
        set c9(a) {
            this.c3 = a;
        }
        get c8() {
            return this.c2;
        }
        set c8(a) {
            let b = this.c2;
            this.c2 = a;
            if (b != this.c2) {
                this.iy("ActualHighlightValueOpacity", b, a);
            }
        }
        get ds() {
            return this.c(XamRadialGauge.j3);
        }
        set ds(a) {
            this.h(XamRadialGauge.j3, a);
        }
        jg() {
            this.c8 = isNaN_(this.ds) ? 0.5 : Math.max(0, Math.min(this.ds, 1));
        }
        get bu() {
            return this.bt;
        }
        set bu(a) {
            this.bt = a;
        }
        jf() {
            if (this.bv != 1) {
                if (isNaN_(this.dr) || isInfinity(this.dr)) {
                    this.bu = 1;
                }
                else {
                    this.bu = 2;
                }
            }
            else {
                this.bu = 1;
            }
        }
        is() {
            this.bw = 0;
            this.view.b9().an = null;
        }
        get ej() {
            return this.c(XamRadialGauge.k1);
        }
        set ej(a) {
            this.h(XamRadialGauge.k1, a);
        }
        refresh() {
            this.cb = true;
            this.view.bb();
        }
        iy(a, b, c) {
            switch (a) {
                case XamRadialGauge.$$p[41]:
                case XamRadialGauge.$$p[44]:
                case XamRadialGauge.$$p[45]:
                case XamRadialGauge.$$p[47]:
                case XamRadialGauge.$$p[0]:
                case XamRadialGauge.$$p[4]:
                case XamRadialGauge.$$p[62]:
                case XamRadialGauge.$$p[78]:
                case XamRadialGauge.$$p[34]:
                case XamRadialGauge.$$p[83]:
                case XamRadialGauge.$$p[71]:
                    this.view.av(a, b, c);
                    break;
                case XamRadialGauge.$$p[59]:
                    this.view.a0(b, c);
                    break;
                case XamRadialGauge.$$p[60]:
                    this.view.a1(b, c);
                    break;
                case "PixelScalingRatio":
                    if (isNaN_(DeviceUtils.a(this.eo))) {
                        this.db = 1;
                    }
                    else {
                        this.db = DeviceUtils.a(this.eo);
                    }
                    break;
                case "ActualPixelScalingRatio":
                    this.view.a5();
                    break;
            }
            switch (a) {
                case XamRadialGauge.$$p[29]:
                case XamRadialGauge.$$p[30]:
                    if (this.gi != null) {
                        this.am = new BindingFormatter();
                        this.am.j = this.gi;
                        this.am.d = this.ah;
                    }
                    else {
                        this.am = null;
                    }
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[74]:
                case XamRadialGauge.$$p[75]:
                    if (this.hu != null) {
                        this.ao = new BindingFormatter();
                        this.ao.j = this.hu;
                        this.ao.d = this.ai;
                    }
                    else {
                        this.ao = null;
                    }
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[86]:
                case XamRadialGauge.$$p[87]:
                    if (this.h9 != null) {
                        this.ap = new BindingFormatter();
                        this.ap.j = this.h9;
                        this.ap.d = this.aj;
                    }
                    else {
                        this.ap = null;
                    }
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[17]:
                case XamRadialGauge.$$p[18]:
                    if (this.f2 != null) {
                        this.an = new BindingFormatter();
                        this.an.j = this.f2;
                        this.an.d = this.ag;
                    }
                    else {
                        this.an = null;
                    }
                    this.cb = true;
                    this.view.bb();
                    break;
                case "SubtitleTextStyle":
                    this.cb = true;
                    this.view.bb();
                    break;
                case "TitleTextStyle":
                    this.cb = true;
                    this.view.bb();
                    break;
                case "HighlightLabelTextStyle":
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[92]:
                    if (this.valueChanged != null) {
                        this.valueChanged(this, new DoubleValueChangedEventArgs(b, c));
                    }
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[22]:
                    {
                        if (this.highlightValueChanged != null) {
                            this.highlightValueChanged(this, new DoubleValueChangedEventArgs(b, c));
                        }
                        let d = this.bu == 2;
                        this.jf();
                        let e = this.bu == 2;
                        this.cb = true;
                        if (!d && e) {
                            this.bw = 1;
                        }
                        else if (d && !e) {
                            this.bw = 4;
                        }
                        this.view.bb();
                        break;
                    }
                case XamRadialGauge.$$p[21]:
                    {
                        let f = this.bu == 2;
                        this.jf();
                        let g = this.bu == 2;
                        this.cb = true;
                        if (!f && g) {
                            this.bw = 1;
                        }
                        else if (f && !g) {
                            this.bw = 4;
                        }
                        this.view.bb();
                        break;
                    }
                case "HighlighValueOpacity":
                    this.jg();
                    break;
                case "ActualHighlightValueOpacity":
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[0]:
                case XamRadialGauge.$$p[4]:
                case XamRadialGauge.$$p[7]:
                case XamRadialGauge.$$p[6]:
                case XamRadialGauge.$$p[2]:
                case XamRadialGauge.$$p[3]:
                case XamRadialGauge.$$p[5]:
                case XamRadialGauge.$$p[1]:
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[69]:
                case XamRadialGauge.$$p[67]:
                case XamRadialGauge.$$p[63]:
                case XamRadialGauge.$$p[65]:
                case XamRadialGauge.$$p[66]:
                    this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[33]:
                case XamRadialGauge.$$p[32]:
                    let h = this.dz;
                    let i = this.dx;
                    if (isInfinity(h) || isNaN_(h)) {
                        h = 0;
                    }
                    if (isInfinity(i) || isNaN_(i)) {
                        i = 100;
                    }
                    this.da = Math.min(h, i);
                    this.c9 = Math.max(h, i);
                    this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[23]:
                case XamRadialGauge.$$p[68]:
                case XamRadialGauge.$$p[64]:
                case XamRadialGauge.$$p[28]:
                case XamRadialGauge.$$p[80]:
                case XamRadialGauge.$$p[79]:
                case XamRadialGauge.$$p[78]:
                case XamRadialGauge.$$p[62]:
                case XamRadialGauge.$$p[31]:
                case XamRadialGauge.$$p[35]:
                case XamRadialGauge.$$p[81]:
                case XamRadialGauge.$$p[38]:
                case XamRadialGauge.$$p[34]:
                case XamRadialGauge.$$p[37]:
                case XamRadialGauge.$$p[36]:
                case XamRadialGauge.$$p[8]:
                case XamRadialGauge.$$p[9]:
                case XamRadialGauge.$$p[58]:
                case XamRadialGauge.$$p[10]:
                    this.a9 = new RadialGaugeScaler(this.da, this.c9, this.ez, this.eu, this.mi);
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[82]:
                case XamRadialGauge.$$p[70]:
                case XamRadialGauge.$$p[13]:
                case XamRadialGauge.$$p[85]:
                case XamRadialGauge.$$p[73]:
                case XamRadialGauge.$$p[16]:
                case XamRadialGauge.$$p[83]:
                case XamRadialGauge.$$p[71]:
                case XamRadialGauge.$$p[14]:
                case XamRadialGauge.$$p[84]:
                case XamRadialGauge.$$p[72]:
                case XamRadialGauge.$$p[15]:
                case XamRadialGauge.$$p[88]:
                case XamRadialGauge.$$p[76]:
                case XamRadialGauge.$$p[19]:
                case XamRadialGauge.$$p[57]:
                case XamRadialGauge.$$p[56]:
                case XamRadialGauge.$$p[54]:
                case XamRadialGauge.$$p[42]:
                case XamRadialGauge.$$p[41]:
                case XamRadialGauge.$$p[44]:
                case "NeedleStartWidth":
                case XamRadialGauge.$$p[43]:
                case XamRadialGauge.$$p[45]:
                case XamRadialGauge.$$p[47]:
                case XamRadialGauge.$$p[55]:
                case XamRadialGauge.$$p[49]:
                case XamRadialGauge.$$p[39]:
                case XamRadialGauge.$$p[40]:
                case XamRadialGauge.$$p[51]:
                case XamRadialGauge.$$p[52]:
                case XamRadialGauge.$$p[50]:
                case XamRadialGauge.$$p[46]:
                case XamRadialGauge.$$p[48]:
                case XamRadialGauge.$$p[53]:
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[90]:
                    this.bc.r = this.fg;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[91]:
                    this.bc.b = this.bf;
                    break;
                case "TransitionProgress":
                    if (this.fd >= 1) {
                        this.bc.w();
                        let j = this.a3;
                        this.a3 = this.a4;
                        this.a4 = j;
                        this.i1();
                        this.i2();
                        this.i4();
                        this.ja(this.a3);
                        this.jb(this.a3, this.a3.b, true);
                        this.jb(this.a3, this.a3.c, false);
                        this.jc(this.a3);
                        if (this.bw == 5) {
                            this.is();
                        }
                        else if (this.bw == 2) {
                            this.bw = 3;
                        }
                        this.view.ah();
                        return;
                    }
                    this.a2.f(this.fd, this.a4, this.a3);
                    this.ja(this.a2);
                    this.jb(this.a2, this.a2.b, true);
                    this.jb(this.a2, this.a2.c, false);
                    this.jc(this.a2);
                    this.view.ah();
                    break;
                case XamRadialGauge.$$p[61]:
                    let k = b;
                    let l = c;
                    if (k != null) {
                        let m = k;
                        m.collectionChanged = delegateRemove(m.collectionChanged, runOn(this, this.i8));
                    }
                    if (l != null) {
                        let n = l;
                        n.collectionChanged = delegateCombine(n.collectionChanged, runOn(this, this.i8));
                    }
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[60]:
                case XamRadialGauge.$$p[59]:
                    this.cb = true;
                    this.view.bb();
                    break;
                case XamRadialGauge.$$p[11]:
                case XamRadialGauge.$$p[12]:
                    this.cb = true;
                    this.view.bk();
                    this.view.bb();
                    break;
            }
            this.iz(a);
        }
        je() {
            this.view.bf();
        }
        i8(a, b) {
            if (b.oldItems != null) {
                for (let c of fromEn(b.oldItems)) {
                    c.propertyChanged = delegateRemove(c.propertyChanged, runOn(this, this.i7));
                }
            }
            if (b.newItems != null) {
                for (let d of fromEn(b.newItems)) {
                    d.propertyChanged = delegateCombine(d.propertyChanged, runOn(this, this.i7));
                }
            }
            this.cb = true;
            this.view.bb();
        }
        i7(a, b) {
            this.cb = true;
            this.view.bb();
        }
        get mm() {
            return this.ml;
        }
        set mm(a) {
            let b = this.ml;
            this.ml = a;
            if (!b.equals1(this.ml)) {
                this.i0(b, this.ml);
            }
        }
        i0(a, b) {
            this.cb = true;
            this.view.bb();
        }
        cg() {
            return !isNaN_(this.da) && !isNaN_(this.c9) && !isNaN_(this.ff) && !this.mm.isEmpty && this.view.n();
        }
        im() {
            if (!this.cg()) {
                return;
            }
            if (this.cb) {
                if (this.b5) {
                    if (this.bc.g) {
                        this.bc.t();
                    }
                    let a = this.a4;
                    this.a4 = this.a2;
                    this.a2 = a;
                }
                else {
                    let b = this.a4;
                    this.a4 = this.a3;
                    this.a3 = b;
                }
            }
            else if (this.b5) {
                this.a2.f(this.fd, this.a4, this.a3);
                this.ja(this.a2);
                this.jb(this.a2, this.a2.b, true);
                this.jb(this.a2, this.a2.c, false);
                this.jc(this.a2);
            }
            if (this.cb) {
                if (this.bw == 1) {
                    this.bw = 2;
                    let c = this.et(this.ff, 0);
                    this.i3(c, this.a4.b, false);
                }
                else if (this.bw == 4) {
                    if (this.fg > 0) {
                        this.bw = 5;
                        let d = this.et(this.ff, 0);
                        this.i3(d, this.a3.b, false);
                    }
                    else {
                        this.is();
                    }
                }
                this.i2();
                this.i4();
                this.i1();
            }
            if (this.cb && this.cl) {
                this.jd();
                this.a2.f(this.fd, this.a4, this.a3);
                this.ja(this.a2);
                this.jb(this.a2, this.a2.b, true);
                this.jb(this.a2, this.a2.c, false);
                this.jc(this.a2);
            }
            else {
                if (this.cb) {
                    this.ja(this.a3);
                    this.jb(this.a3, this.a3.b, true);
                    this.jb(this.a3, this.a3.c, false);
                    this.jc(this.a3);
                }
            }
            this.cb = false;
            this.view.ah();
        }
        jd() {
            this.c7 = 0;
            this.bc.w();
            this.bc.v();
        }
        get cl() {
            return this.fg > 0;
        }
        ja(a) {
            let b = this.mm;
            let c = this.view.b8();
            let d = a.a;
            let e = Math.min(b.width / 2, b.height / 2) * a.e;
            let f = this.mj();
            let g = f.x;
            let h = f.y;
            let i = d.n(e, g, h);
            c.an = i;
            c._fill = d.l;
            c._stroke = d.m;
            c.ad = d.h;
        }
        ch(a) {
            return this.cj(a, false, false);
        }
        needleContainsPoint(a, b) {
            return this.cj(a, b, false);
        }
        b9(a) {
            return this.cj(a, false, true);
        }
        highlightNeedleContainsPoint(a, b) {
            return this.cj(a, b, true);
        }
        cj(a, b, c) {
            let d;
            let e;
            if (c) {
                d = this.cu;
                e = this.cv;
            }
            else {
                d = this.cw;
                e = this.cx;
            }
            if (d == null) {
                return false;
            }
            return b ? PolygonUtil.b(e, a) : PolygonUtil.b(d, a);
        }
        jb(a, b, c) {
            if (c) {
                if (this.bw == 0) {
                    return;
                }
                this.cu = new List$1(Point_$type, 0);
                this.cv = new List$1(Point_$type, 0);
            }
            else {
                this.cw = new List$1(Point_$type, 0);
                this.cx = new List$1(Point_$type, 0);
            }
            let d = c ? this.cu : this.cw;
            let e = c ? this.cv : this.cx;
            let f = this.mm;
            let g = b.ab;
            let h = b.aj;
            let i = b.ak;
            let j = b.ae;
            let k = b.ah;
            let l = b.ai;
            let m = b.aa;
            let n = c ? this.view.b9() : this.view.ca();
            let o = this.view.cd();
            let p = this.view.cb();
            let q = Math.min(f.width / 2, f.height / 2) * a.e;
            let r = this.mj();
            let s = r.x;
            let t = r.y;
            let u = b.am(q, s, t);
            let v = g * 180 / Math.PI;
            n.an = u;
            let w = new TransformGroup();
            w.j.add(((() => {
                let $ret = new RotateTransform();
                $ret.k = s;
                $ret.l = t;
                $ret.j = v;
                return $ret;
            })()));
            n.j = w;
            n._fill = h;
            n._stroke = i;
            n.ad = j;
            o.an = b.an(q, s, t);
            p.an = b.al(q, s, t);
            o._fill = k;
            o._stroke = l;
            o.ad = m;
            p._fill = k;
            p._stroke = l;
            p.ad = m;
            let x = Math.cos(g);
            let y = Math.sin(g);
            let z = b.af / 2;
            let aa = { $type: Point_$type, x: b.ad * q, y: z * q };
            let ab = { $type: Point_$type, x: b.ac * q, y: z * q };
            let ac = { $type: Point_$type, x: b.ac * q, y: -z * q };
            let ad = { $type: Point_$type, x: b.ad * q, y: -z * q };
            aa = { $type: Point_$type, x: aa.x * x - aa.y * y + s, y: aa.y * x + aa.x * y + t };
            ab = { $type: Point_$type, x: ab.x * x - ab.y * y + s, y: ab.y * x + ab.x * y + t };
            ac = { $type: Point_$type, x: ac.x * x - ac.y * y + s, y: ac.y * x + ac.x * y + t };
            ad = { $type: Point_$type, x: ad.x * x - ad.y * y + s, y: ad.y * x + ad.x * y + t };
            d.add(aa);
            d.add(ab);
            d.add(ac);
            d.add(ad);
            z = (b.af / 2) * q;
            let ae = { $type: Point_$type, x: b.ad * q, y: z };
            let af = { $type: Point_$type, x: b.ac * q, y: z };
            let ag = { $type: Point_$type, x: b.ac * q, y: -z };
            let ah = { $type: Point_$type, x: b.ad * q, y: -z };
            ae = { $type: Point_$type, x: ae.x * x - ae.y * y + s, y: ae.y * x + ae.x * y + t };
            af = { $type: Point_$type, x: af.x * x - af.y * y + s, y: af.y * x + af.x * y + t };
            ag = { $type: Point_$type, x: ag.x * x - ag.y * y + s, y: ag.y * x + ag.x * y + t };
            ah = { $type: Point_$type, x: ah.x * x - ah.y * y + s, y: ah.y * x + ah.x * y + t };
            e.add(ae);
            e.add(af);
            e.add(ag);
            e.add(ah);
        }
        mj() {
            let a = this.mm;
            let b = isNaN_(this.dl) ? 0.5 : this.dl;
            let c = isNaN_(this.dm) ? 0.5 : this.dm;
            let d = a.left + b * a.width;
            let e = a.top + c * a.height;
            return { $type: Point_$type, x: d, y: e };
        }
        er(a) {
            if (isInfinity(a)) {
                return NaN;
            }
            return a;
        }
        i2() {
            let a = this.a3;
            a.e = this.ep;
            let b = this.mm;
            let c = !(this.bw == 0 || this.bw == 5);
            let d = this.et(this.ff, 0);
            this.i3(d, a.c, c);
            if (c) {
                let e = this.er(this.dr);
                this.i3(e, a.b, false);
            }
        }
        i3(a, b, c) {
            let d = this.a9;
            let e = d.h(a);
            let f = new RadialGaugeNeedlePreparer();
            let g = new RadialGaugeNeedleParameters();
            g.b = this.a5;
            g.o = this.er(this.ek);
            let h = this.ma;
            let i = this.mb;
            if (c) {
                h = BrushUtil.s(h, this.c8);
                i = BrushUtil.s(i, this.c8);
            }
            g.t = h;
            g.u = i;
            g.m = this.er(this.ei);
            g.k = this.er(this.ea);
            g.d = this.er(this.d8);
            g.e = this.er(this.d9);
            g.p = this.er(this.eg);
            g.q = this.er(this.eh);
            g.i = this.er(this.ef);
            g.f = this.er(this.ec);
            g.r = this.mc;
            g.s = this.md;
            g.c = this.a6;
            g.h = this.er(this.ed);
            g.n = this.er(this.ej);
            g.l = this.er(this.eb);
            if (isNaN_(g.o)) {
                g.o = XamRadialGauge.el;
            }
            if (isNaN_(g.h)) {
                g.h = XamRadialGauge.ee;
            }
            f.b = g;
            f.e(b);
            b.ab = e;
        }
        jc(a) {
            let b = this.mm;
            let c = a.d;
            let d = c.g;
            let e = c.c;
            let f = c.i;
            let g = c.j;
            let h = c.h;
            let i = c.f;
            let j = c.t;
            let k = c.e;
            let l = c.d;
            let m = c.ab;
            let n = c.y;
            let o = c.l;
            let p = c.k;
            let q = c.ad;
            let r = c.ac;
            let s = c.aa;
            let t = c.x;
            let u = c.aj;
            let v = c.ak;
            let w = c.ae;
            let x = c.ai;
            let y = c.v;
            let z = c.u;
            let aa = c.w;
            let ab = this.view.cc();
            let ac = c.z;
            m = Math.max(0, m);
            n = Math.max(0, n);
            let ad = true;
            if (this.a8 == 1 || (this.a8 == 0 && this.a0 == 0)) {
                ad = false;
            }
            let ae = Math.min(b.width / 2, b.height / 2) * a.e;
            let af = this.mj();
            let ag = af.x;
            let ah = af.y;
            let ai = s;
            let aj = t;
            s -= ac;
            t += ac;
            let ak = false;
            if ((t - s) >= 2 * Math.PI) {
                ak = true;
                s = 0;
                t = Math.PI;
            }
            let al = new PathGeometry();
            let am = new PathFigure();
            let an = Math.cos(s);
            let ao = Math.sin(s);
            let ap = Math.cos(t);
            let aq = Math.sin(t);
            let ar = ag + (ae * m) * an;
            let as = ah + (ae * m) * ao;
            let at = ag + (ae * n) * an;
            let au = ah + (ae * n) * ao;
            let av = ag + (ae * m) * ap;
            let aw = ah + (ae * m) * aq;
            let ax = ag + (ae * n) * ap;
            let ay = ah + (ae * n) * aq;
            let az = ak;
            if (ac != 0 && !ak && ad) {
                let a0 = Math.cos(ai);
                let a1 = Math.sin(ai);
                let a2 = Math.cos(aj);
                let a3 = Math.sin(aj);
                let a4 = ag + (ae * m) * a0;
                let a5 = ah + (ae * m) * a1;
                let a6 = ag + (ae * n) * a0;
                let a7 = ah + (ae * n) * a1;
                let a8 = ag + (ae * m) * a2;
                let a9 = ah + (ae * m) * a3;
                let ba = ag + (ae * n) * a2;
                let bb = ah + (ae * n) * a3;
                let bc = as;
                let bd = at;
                if (a6 - a4 != 0) {
                    bd = ag;
                    let be = (a7 - a5) / (a6 - a4);
                    bc = be * (ag - at) + au;
                }
                let bf = { $type: Point_$type, x: bd, y: bc };
                let bg = GeometryUtil.o(bf, { $type: Point_$type, x: at, y: au }, { $type: Point_$type, x: ag, y: ah }, ae * m);
                let bh = aw;
                let bi = ax;
                if (ba - a8 != 0) {
                    bi = ag;
                    let bj = (bb - a9) / (ba - a8);
                    bh = bj * (ag - ax) + ay;
                }
                let bk = { $type: Point_$type, x: bi, y: bh };
                let bl = GeometryUtil.o(bk, { $type: Point_$type, x: ax, y: ay }, { $type: Point_$type, x: ag, y: ah }, ae * m);
                if (isNaN_(bg.c.x) || isNaN_(bg.c.y) || isNaN_(bg.d.x) || isNaN_(bg.d.y) || isNaN_(bl.c.x) || isNaN_(bl.c.y) || isNaN_(bl.d.x) || isNaN_(bl.d.y)) {
                    ak = true;
                    s = 0;
                    t = Math.PI;
                }
                else {
                    let bm;
                    let bn;
                    if ((Math.pow(bg.c.x - at, 2) + Math.pow(bg.c.y - au, 2)) < (Math.pow(bg.d.x - at, 2) + Math.pow(bg.d.y - au, 2))) {
                        bm = bg.c;
                    }
                    else {
                        bm = bg.d;
                    }
                    if ((Math.pow(bl.c.x - ax, 2) + Math.pow(bl.c.y - ay, 2)) < (Math.pow(bl.d.x - ax, 2) + Math.pow(bl.d.y - ay, 2))) {
                        bn = bl.c;
                    }
                    else {
                        bn = bl.d;
                    }
                    if ((Math.pow(bn.x - at, 2) + Math.pow(bn.y - au, 2)) <= (Math.pow(bm.x - at, 2) + Math.pow(bm.y - au, 2))) {
                        ak = true;
                        s = 0;
                        t = Math.PI;
                    }
                    else {
                        let bo = GeometryUtil.g({ $type: Point_$type, x: ag, y: ah }, bm);
                        let bp = GeometryUtil.g({ $type: Point_$type, x: ag, y: ah }, bn);
                        let bq = s;
                        let br = t;
                        while (bq > Math.PI * 2) {
                            bq -= Math.PI * 2;
                        }
                        while (br > Math.PI * 2) {
                            br -= Math.PI * 2;
                        }
                        let bs = Math.min(Math.abs(bo - bq), Math.abs((Math.PI * 2 - bo) - bq));
                        let bt = Math.min(Math.abs(bp - br), Math.abs((Math.PI * 2 - bp) - br));
                        if ((t - s) + bs + bt >= 2 * Math.PI) {
                            ak = true;
                            s = 0;
                            t = Math.PI;
                        }
                        else {
                            ar = bm.x;
                            as = bm.y;
                            av = bn.x;
                            aw = bn.y;
                        }
                    }
                }
            }
            if (ak && !az) {
                an = Math.cos(s);
                ao = Math.sin(s);
                ap = Math.cos(t);
                aq = Math.sin(t);
                ar = ag + (ae * m) * an;
                as = ah + (ae * m) * ao;
                at = ag + (ae * n) * an;
                au = ah + (ae * n) * ao;
                av = ag + (ae * m) * ap;
                aw = ah + (ae * m) * aq;
                ax = ag + (ae * n) * ap;
                ay = ah + (ae * n) * aq;
            }
            if (ak) {
                am._startPoint = { $type: Point_$type, x: at, y: au };
                am._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = { $type: Point_$type, x: ax, y: ay };
                    $ret.b = false;
                    $ret.d = 1;
                    $ret.f = new Size(1, ae * n, ae * n);
                    return $ret;
                })()));
                am._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = { $type: Point_$type, x: at, y: au };
                    $ret.b = false;
                    $ret.d = 1;
                    $ret.f = new Size(1, ae * n, ae * n);
                    return $ret;
                })()));
                let bu = new PathFigure();
                bu._startPoint = { $type: Point_$type, x: ar, y: as };
                bu._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = { $type: Point_$type, x: av, y: aw };
                    $ret.b = false;
                    $ret.d = 0;
                    $ret.f = new Size(1, ae * m, ae * m);
                    return $ret;
                })()));
                bu._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = { $type: Point_$type, x: ar, y: as };
                    $ret.b = false;
                    $ret.d = 0;
                    $ret.f = new Size(1, ae * m, ae * m);
                    return $ret;
                })()));
                al.c.add(am);
                al.c.add(bu);
            }
            else {
                am._startPoint = { $type: Point_$type, x: ar, y: as };
                am._segments.add(((() => {
                    let $ret = new LineSegment(1);
                    $ret.c = { $type: Point_$type, x: at, y: au };
                    return $ret;
                })()));
                am._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = { $type: Point_$type, x: ax, y: ay };
                    $ret.b = (t - s) > Math.PI;
                    $ret.d = 1;
                    $ret.f = new Size(1, ae * n, ae * n);
                    return $ret;
                })()));
                am._segments.add(((() => {
                    let $ret = new LineSegment(1);
                    $ret.c = { $type: Point_$type, x: av, y: aw };
                    return $ret;
                })()));
                am._segments.add(((() => {
                    let $ret = new ArcSegment();
                    $ret.e = { $type: Point_$type, x: ar, y: as };
                    $ret.b = (t - s) > Math.PI;
                    $ret.d = 0;
                    $ret.f = new Size(1, ae * m, ae * m);
                    return $ret;
                })()));
                al.c.add(am);
            }
            ab.an = al;
            ab._fill = u;
            let bv = this.bz;
            bv.f = true;
            for (let bw of fromEnum(this.cz)) {
                bv.n(bw);
            }
            this.cz.g();
            let bx = this.b2;
            bx.f = true;
            for (let by of fromEnum(this.c0)) {
                bx.n(by);
            }
            this.c0.g();
            let bz = this.b4;
            bz.f = true;
            for (let b0 of fromEnum(this.c1)) {
                bz.n(b0);
            }
            this.c1.g();
            let b1 = this.by;
            b1.f = true;
            for (let b2 of fromEnum(this.cy)) {
                b1.n(b2);
            }
            this.cy.g();
            let b3 = ae * j;
            for (let b4 = 0; b4 < e.length; b4++) {
                let b5 = ag + b3 * Math.cos(e[b4]);
                let b6 = ah + b3 * Math.sin(e[b4]);
                let b7 = bv.a();
                if (b7.al != d[b4]) {
                    b7.al = d[b4];
                }
                this.view.bd(b7, l[b4]);
                this.view.be(b7, k[b4]);
                let b8 = h[b4];
                let b9 = i[b4];
                let ca = f[b4];
                let cb = g[b4];
                this.view.a6(b7, b5 + ca, b6 + cb);
                this.cz.h(b7);
            }
            bv.f = false;
            if (!isNaN_(c.p.c) && !isNaN_(c.p.b)) {
                let cc = ag + (ae * c.p.c) * Math.cos(c.p.b);
                let cd = ah + (ae * c.p.c) * Math.sin(c.p.b);
                let ce = bz.a();
                if (ce.al != c.p.h) {
                    ce.al = c.p.h;
                }
                this.view.bd(ce, c.p.i);
                this.view.be(ce, c.p.a);
                this.view.a6(ce, cc + c.p.f, cd + c.p.g);
                this.c1.h(ce);
            }
            bz.f = false;
            if (!isNaN_(c.o.c) && !isNaN_(c.o.b)) {
                let cf = ag + (ae * c.o.c) * Math.cos(c.o.b);
                let cg = ah + (ae * c.o.c) * Math.sin(c.o.b);
                let ch = bx.a();
                if (ch.al != c.o.h) {
                    ch.al = c.o.h;
                }
                this.view.bd(ch, c.o.i);
                this.view.be(ch, c.o.a);
                this.view.a6(ch, cf + c.o.f, cg + c.o.g);
                this.c0.h(ch);
            }
            bx.f = false;
            if (this.bw != 0) {
                if (!isNaN_(c.m.c) && !isNaN_(c.m.b)) {
                    let ci = ag + (ae * c.m.c) * Math.cos(c.m.b);
                    let cj = ah + (ae * c.m.c) * Math.sin(c.m.b);
                    let ck = b1.a();
                    if (ck.al != c.m.h) {
                        ck.al = c.m.h;
                    }
                    this.view.bd(ck, c.m.i);
                    this.view.be(ck, c.m.a);
                    this.view.a6(ck, ci + c.m.f, cj + c.m.g);
                    this.cy.h(ck);
                }
                b1.f = false;
            }
            let cl = this.b3;
            cl.f = true;
            for (let cm = 0; cm < this.ct.count; cm++) {
                cl.n(this.ct._inner[cm]);
            }
            this.ct.clear();
            for (let cn = 0; cn < o.length; cn++) {
                let co = ag + (ae * q) * Math.cos(o[cn]);
                let cp = ah + (ae * q) * Math.sin(o[cn]);
                let cq = ag + (ae * r) * Math.cos(o[cn]);
                let cr = ah + (ae * r) * Math.sin(o[cn]);
                let cs = cl.a();
                let ct = new PathGeometry();
                let cu = new PathFigure();
                cu._startPoint = { $type: Point_$type, x: co, y: cp };
                cu._segments.add(((() => {
                    let $ret = new LineSegment(1);
                    $ret.c = { $type: Point_$type, x: cq, y: cr };
                    return $ret;
                })()));
                ct.c.add(cu);
                cs.an = ct;
                cs._stroke = v;
                cs.ad = w;
                this.ct.add(cs);
            }
            cl.f = false;
            let cv = this.b0;
            cv.f = true;
            for (let cw = 0; cw < this.cr.count; cw++) {
                cv.n(this.cr._inner[cw]);
            }
            this.cr.clear();
            for (let cx = 0; cx < p.length; cx++) {
                let cy = ag + (ae * y) * Math.cos(p[cx]);
                let cz = ah + (ae * y) * Math.sin(p[cx]);
                let c0 = ag + (ae * z) * Math.cos(p[cx]);
                let c1 = ah + (ae * z) * Math.sin(p[cx]);
                let c2 = cv.a();
                let c3 = new PathGeometry();
                let c4 = new PathFigure();
                c4._startPoint = { $type: Point_$type, x: cy, y: cz };
                c4._segments.add(((() => {
                    let $ret = new LineSegment(1);
                    $ret.c = { $type: Point_$type, x: c0, y: c1 };
                    return $ret;
                })()));
                c3.c.add(c4);
                c2.an = c3;
                c2._stroke = x;
                c2.ad = aa;
                this.cr.add(c2);
            }
            cv.f = false;
            let c5 = this.b1;
            c5.f = true;
            for (let c6 = this.cs.count - 1; c6 >= 0; c6--) {
                c5.n(this.cs._inner[c6]);
            }
            this.cs.clear();
            for (let c7 = 0; c7 < c.r.count; c7++) {
                let c8 = c.r._inner[c7];
                let c9 = c5.a();
                c9.an = c8.m(ae, ag, ah);
                c9._fill = c8.k;
                c9._stroke = c8.l;
                c9.ad = c8.h;
                this.cs.add(c9);
            }
            this.view.bc(this.cs);
            c5.f = false;
        }
        cq(a, b, c) {
            let d = c / 10000;
            if (isNaN_(d)) {
                d = 1E-05;
            }
            let e = Math.abs(a - b);
            if (e < d) {
                return true;
            }
            return false;
        }
        es(a) {
            if (isInfinity(a)) {
                return NaN;
            }
            return a;
        }
        eq(a, b) {
            if (isInfinity(a)) {
                return b;
            }
            return a;
        }
        et(a, b) {
            if (isInfinity(a) || isNaN_(a)) {
                return b;
            }
            return a;
        }
        i4() {
            let a = this.a3;
            a.e = this.es(this.ep);
            if (isNaN_(a.e)) {
                a.e = 1;
            }
            if (this.ck && !isNaN_(this.en) && this.en > 0) {
                let b = Math.min(this.mm.width, this.mm.height);
                this.em = b / this.en;
            }
            else {
                this.em = 1;
            }
            let c = this.mm;
            let d = this.a9;
            let e = this.es(this.dt);
            let f = this.es(this.dw);
            let g = this.es(this.d1);
            if (isNaN_(e)) {
                e = (this.c9 - this.da) / 10;
            }
            if (isNaN_(f)) {
                f = e;
            }
            if (isNaN_(g)) {
                g = 3;
            }
            let h = new List$1(Tuple$2.$.specialize(Number_$type, Number_$type), 0);
            let i = d.i;
            let j = d.g;
            while (i >= Math.PI * 2) {
                i -= Math.PI * 2;
            }
            while (j >= Math.PI * 2) {
                j -= Math.PI * 2;
            }
            let k = Math.abs(j - i) < 0.0001;
            let l = this.a1 == 1 || this.a1 == 3;
            let m = this.a1 == 0 || this.a1 == 3;
            for (let n = this.da; n <= this.c9 || this.cq(n, this.c9, f); n += f) {
                if (k && this.cq(n, this.da, f) && l) {
                    continue;
                }
                if (k && this.cq(n, this.c9, f) && m) {
                    continue;
                }
                h.add(new Tuple$2(Number_$type, Number_$type, n, MathUtil.g(d.h(n))));
                if (f == 0) {
                    break;
                }
            }
            let o = new List$1(Number_$type, 0);
            let p = new List$1(Number_$type, 0);
            for (let q = this.da; q <= this.c9 || this.cq(q, this.c9, e); q += e) {
                o.add(d.h(q));
                for (let r = 0; r < g; r++) {
                    let s = (e / (g + 1)) * (r + 1);
                    if (s + q > this.c9) {
                        continue;
                    }
                    p.add(d.h(s + q));
                }
                if (e == 0) {
                    break;
                }
            }
            if (a.d.c.length != h.count) {
                a.d.g = new Array(h.count);
                a.d.c = new Array(h.count);
                a.d.h = new Array(h.count);
                a.d.f = new Array(h.count);
                a.d.i = new Array(h.count);
                a.d.j = new Array(h.count);
                a.d.e = new Array(h.count);
                a.d.d = new Array(h.count);
            }
            if (a.d.l.length != o.count || a.d.k.length != p.count) {
                a.d.l = new Array(o.count);
                a.d.k = new Array(p.count);
            }
            let t = this.bp();
            for (let u = 0; u < h.count; u++) {
                let v = h._inner[u].c;
                let w = h._inner[u].d;
                let x = this.av(v, w, "Label", true, this.am, this.formatLabel);
                let y = this.aq(this.du, this.l6, t, x, this.alignLabel, runOn(this.view, this.view.ch));
                a.d.c[u] = y.angle;
                a.d.h[u] = y.width;
                a.d.f[u] = y.height;
                a.d.i[u] = y.offsetX;
                a.d.j[u] = y.offsetY;
                a.d.g[u] = y.label;
                a.d.e[u] = t.b(y.font);
                a.d.d[u] = y.brush;
            }
            let z = this.fb;
            if (this.cp) {
                z = (MathUtil.g(this.a9.h(this.ff)) + 180) % 360;
            }
            let aa = this.av(this.ff, z, this.id, this.co, this.ap, this.formatTitle);
            let ab = this.bs.a();
            let ac = this.aq(this.fc, this.mh, ab, aa, this.alignTitle, runOn(this.view, this.view.cj));
            a.d.p.b = ac.angle;
            a.d.p.e = ac.width;
            a.d.p.d = ac.height;
            a.d.p.f = ac.offsetX;
            a.d.p.g = ac.offsetY;
            a.d.p.c = ac.extent;
            a.d.p.i = ac.brush;
            a.d.p.h = ac.label;
            a.d.p.a = ab.b(ac.font);
            let ad = this.e3;
            if (this.cn) {
                ad = (MathUtil.g(this.a9.h(this.ff)) + 180) % 360;
            }
            let ae = this.av(this.ff, ad, this.hy, this.cm, this.ao, this.formatSubtitle);
            let af = this.br.a();
            let ag = this.aq(this.e4, this.mf, af, ae, this.alignSubtitle, runOn(this.view, this.view.ci));
            a.d.o.b = ag.angle;
            a.d.o.e = ag.width;
            a.d.o.d = ag.height;
            a.d.o.f = ag.offsetX;
            a.d.o.g = ag.offsetY;
            a.d.o.c = ag.extent;
            a.d.o.i = ag.brush;
            a.d.o.h = ag.label;
            a.d.o.a = af.b(ag.font);
            let ah = this.dp;
            if (this.b8) {
                ah = (MathUtil.g(this.a9.h(this.dr)) + 180) % 360;
            }
            let ai = this.av(this.dr, ah, this.f6, this.b7, this.an, this.formatHighlightLabel);
            let aj = this.bq.a();
            let ak = this.aq(this.dq, this.l8, aj, ai, this.alignHighlightLabel, runOn(this.view, this.view.cg));
            a.d.m.b = ak.angle;
            a.d.m.e = ak.width;
            a.d.m.d = ak.height;
            a.d.m.f = ak.offsetX;
            a.d.m.g = ak.offsetY;
            a.d.m.c = ak.extent;
            a.d.m.i = ak.brush;
            let al = !(this.bw == 0 || this.bw == 5);
            a.d.m.h = al ? ak.label : null;
            a.d.m.a = aj.b(ak.font);
            for (let am = 0; am < o.count; am++) {
                a.d.l[am] = o._inner[am];
            }
            for (let an = 0; an < p.count; an++) {
                a.d.k[an] = p._inner[an];
            }
            a.d.ab = this.et(this.e0, 0.5);
            a.d.y = this.et(this.ev, 0.57);
            a.d.t = this.et(this.du, 0.65);
            a.d.ad = this.et(this.e7, 0.5);
            a.d.ac = this.et(this.e5, 0.57);
            a.d.v = this.et(this.d4, 0.54);
            a.d.u = this.et(this.d2, 0.57);
            a.d.aa = d.i;
            a.d.x = d.g;
            let ao = this.ex;
            if (isNaN_((ao))) {
                ao = 2.8;
            }
            let ap = ao * Math.PI / 180;
            if (ap < 0) {
                ap = 0;
            }
            a.d.z = ap;
            a.d.ak = this.mg;
            a.d.ai = this.l9;
            a.d.aj = this.me;
            a.d.ae = this.es(this.e9);
            a.d.w = this.es(this.d6);
            if (isNaN_(a.d.ae)) {
                a.d.ae = XamRadialGauge.fa;
            }
            if (isNaN_(a.d.w)) {
                a.d.w = XamRadialGauge.d7;
            }
            a.d.r.clear();
            for (let aq = 0; aq < this.ranges.count; aq++) {
                let ar = this.ranges._inner[aq];
                let as = this.es(Math.min(ar.o, ar.j));
                let at = this.es(Math.max(ar.o, ar.j));
                if (isNaN_(as) || isNaN_(at)) {
                    continue;
                }
                let au = d.h(as);
                let av = d.h(at);
                let aw = RadialGaugeScaler.k(au, av, this.mi);
                au = aw.c;
                av = aw.d;
                let ax = new RadialGaugeRangeFrame();
                ax.e = au;
                ax.b = av;
                ax.k = ar.ao != null ? ar.ao : this.l7(aq, this.ak);
                ax.l = ar.ap != null ? ar.ap : this.l7(aq, this.al);
                ax.h = this.et(ar.p, XamRadialGaugeRange.q);
                ax.f = this.es(ar.l);
                if (isNaN_(ax.f)) {
                    ax.f = Math.max(0, this.e0);
                }
                ax.c = this.es(ar.k);
                if (isNaN_(ax.c)) {
                    ax.c = Math.max(0, this.e0);
                }
                ax.g = this.es(ar.n);
                if (isNaN_(ax.g)) {
                    ax.g = Math.max(0, this.ev);
                }
                ax.d = this.es(ar.m);
                if (isNaN_(ax.d)) {
                    ax.d = Math.max(0, this.ev);
                }
                if (this.mi == 0) {
                    let ay = ax.f;
                    ax.f = ax.c;
                    ax.c = ay;
                    ay = ax.g;
                    ax.g = ax.d;
                    ax.d = ay;
                }
                a.d.r.add(ax);
            }
        }
        i1() {
            let a = this.a3;
            a.e = this.ep;
            let b = a.a;
            let c = this.l4;
            let d = this.l5;
            let e = this.eq(this.dj, XamRadialGauge.dk);
            let f = this.a0;
            let g = this.dg;
            let h = this.de;
            if (isInfinity(h) || isNaN_(h)) {
                h = 0.12;
            }
            if (isInfinity(g) || isNaN_(g)) {
                g = 0.82;
            }
            let i = this.dc;
            if (isInfinity(i) || isNaN_(i)) {
                i = 4;
            }
            if (h > g) {
                let j = g;
                g = h;
                h = j;
            }
            let k = this.a9;
            let l = k.i;
            let m = k.g;
            b.l = c;
            b.m = d;
            b.h = e;
            if (f == 0) {
                b.b = 0;
                b.g = 0;
                b.c = 0;
                b.d = 0;
                b.e = this.dg;
            }
            else {
                b.b = i;
                let n = this.di * Math.PI / 180;
                if (n < 0) {
                    n = 0;
                }
                if ((Math.PI * 2) - (m - l) < n) {
                    b.f = 0;
                    b.b = 0;
                    b.g = 0;
                    b.c = 0;
                    b.d = 0;
                    b.e = g;
                }
                else {
                    b.f = n;
                    b.g = l;
                    b.c = m;
                    b.b = i;
                    b.d = h;
                    b.e = g;
                }
            }
        }
        get b5() {
            return this.bc.f();
        }
        get fd() {
            return this.c7;
        }
        set fd(a) {
            let b = this.c7;
            this.c7 = a;
            this.iy("TransitionProgress", b, this.c7);
        }
        iq(a, b) {
            let c = this.dn(a);
            let d = this.bx == 2;
            let e = d ? this.cc : this.ce;
            if (e) {
                let f = this.fe(this.a9.g - Math.PI * 2);
                switch (this.mi) {
                    case 1:
                        if (c < this.da) {
                            c = c < f * 0.5 ? this.c9 : this.da;
                        }
                        break;
                    case 0:
                        if (c > this.c9) {
                            c = c < (f + this.c9) * 0.5 ? this.c9 : this.da;
                        }
                        break;
                }
            }
            if (d) {
                if (c != this.dr) {
                    this.dr = c;
                }
            }
            else {
                if (c != this.ff) {
                    this.ff = c;
                }
            }
        }
        destroy() {
            this.provideContainer(null);
        }
        provideContainer(a) {
            this.view.aw(a);
        }
        onMouseMove(a, b) {
            if (this.bx != 0) {
                this.iq(a, b);
            }
        }
        onMouseDown(a, b = false) {
            if (this.cf && this.needleContainsPoint(a, b) && this.bx == 0) {
                this.bx = 1;
            }
            if (this.cd && this.highlightNeedleContainsPoint(a, b) && this.bx == 0) {
                this.bx = 2;
            }
        }
        onMouseUp(a) {
            if (this.bx != 0) {
                this.bx = 0;
            }
        }
        containerResized() {
            this.view.ax();
        }
        ir() {
            this.view.flush();
        }
        ba() {
            let a = new GaugeVisualData();
            a.viewport = new RectData(this.mm.left, this.mm.top, this.mm.width, this.mm.height);
            a.scaleLabels = new ScaleLabelVisualDataList();
            a.scaleTickmarks = new ScaleTickmarkVisualDataList();
            a.ranges = new RangeVisualDataList();
            a.needle = new NeedleVisualData();
            a.highlightNeedle = new NeedleVisualData();
            a.titleLabels = new ScaleLabelVisualDataList();
            a.subtitleLabels = new ScaleLabelVisualDataList();
            a.highlightLabels = new ScaleLabelVisualDataList();
            this.view.am(a);
            return a;
        }
        fu() {
            let a = this.ba();
            a.scaleByViewport();
            return a.serialize();
        }
        bp() {
            if (this.fv == null) {
                return FontUtil.getFont(this.view.ac);
            }
            else {
                return FontUtil.toFontInfo(this.view.ac, this.fv);
            }
        }
        get eo() {
            return this.c6;
        }
        set eo(a) {
            let b = this.c6;
            this.c6 = a;
            this.iy("PixelScalingRatio", b, this.c6);
        }
        get db() {
            return this.c5;
        }
        set db(a) {
            let b = this.c5;
            this.c5 = a;
            this.iy("ActualPixelScalingRatio", b, this.c5);
        }
        get bq() {
            return this.bj;
        }
        set bq(a) {
            let b = this.bj;
            if (a == null || !this.b6(a)) {
                a = XamRadialGauge.bm();
            }
            else {
                a = FontUtil.getFontInfoFromString(this.view.ac, a.fontString);
            }
            this.bj = a;
            if (b != this.bj) {
                this.iy("HighlightLabelTextStyle", b, this.bj);
            }
        }
        b6(a) {
            if (a == null) {
                return false;
            }
            return a.fontString != null && a.fontString != "NaNpx/normal";
        }
        get br() {
            return this.bk;
        }
        set br(a) {
            let b = this.bk;
            if (a == null || !this.b6(a)) {
                a = XamRadialGauge.bn();
            }
            else {
                a = FontUtil.getFontInfoFromString(this.view.ac, a.fontString);
            }
            this.bk = a;
            if (b != this.bk) {
                this.iy("SubtitleTextStyle", b, this.bk);
            }
        }
        get bs() {
            return this.bl;
        }
        set bs(a) {
            let b = this.bl;
            if (a == null || !this.b6(a)) {
                a = XamRadialGauge.bo();
            }
            else {
                a = FontUtil.getFontInfoFromString(this.view.ac, a.fontString);
            }
            this.bl = a;
            if (b != this.bl) {
                this.iy("TitleTextStyle", b, this.bl);
            }
        }
    }
    XamRadialGauge.$t = markType(XamRadialGauge, 'XamRadialGauge', Control.$, [INotifyPropertyChanged_$type]);
    XamRadialGauge.bh = null;
    XamRadialGauge.bi = null;
    XamRadialGauge.bg = null;
    XamRadialGauge.j3 = DependencyProperty.i("HighlighValueOpacity", Number_$type, XamRadialGauge.$, new PropertyMetadata(2, 0.5, (a, b) => a.iy("HighlighValueOpacity", b.oldValue, b.newValue)));
    XamRadialGauge.k1 = DependencyProperty.i("NeedleStartWidth", Number_$type, XamRadialGauge.$, new PropertyMetadata(2, NaN, (a, b) => a.iy("NeedleStartWidth", b.oldValue, b.newValue)));
    XamRadialGauge.el = DeviceUtils.g(1);
    XamRadialGauge.ee = DeviceUtils.g(1);
    XamRadialGauge.fa = DeviceUtils.g(3);
    XamRadialGauge.d7 = DeviceUtils.g(2);
    XamRadialGauge.dk = DeviceUtils.g(12);
    XamRadialGauge.$$p = markDep(DependencyProperty, PropertyMetadata, XamRadialGauge, 'iy', ['BackingBrush:l4:jh', [Brush.$, null], 'BackingCornerRadius:dc:ji', [1, 4], 'BackingInnerExtent:de:jj', [1, 0.12], 'BackingOuterExtent:dg:jk', [1, 0.82], 'BackingOutline:l5:jl', [Brush.$, null], 'BackingOversweep:di:jm', [1, 3], 'BackingShape:a0:jn', [RadialGaugeBackingShape_$type, enumGetBox(RadialGaugeBackingShape_$type, 0)], 'BackingStrokeThickness:dj:jo', [1, XamRadialGauge.dk], 'CenterX:dl:jp', [1, 0.5], 'CenterY:dm:jq', [1, 0.5], 'DuplicateLabelOmissionStrategy:a1:jr', [RadialGaugeDuplicateLabelOmissionStrategy_$type, enumGetBox(RadialGaugeDuplicateLabelOmissionStrategy_$type, 0)], 'FontBrush:l6:js', [Brush.$, null], 'Font:fv:jt', [2, null], 'HighlightLabelAngle:dp:ju', [1, 90], 'HighlightLabelBrush:l8:jv', [Brush.$, null], 'HighlightLabelDisplaysValue:b7:jw', [0, false], 'HighlightLabelExtent:dq:jx', [1, 0.2], 'HighlightLabelFormat:f2:jy', [2, null], 'HighlightLabelFormatSpecifiers:ag:jz', [Array_$type, null], 'HighlightLabelSnapsToNeedlePivot:b8:j0', [0, false], 'HighlightLabelText:f6:j1', [2, null], 'HighlightValueDisplayMode:bv:j2', [HighlightedValueDisplayMode_$type, enumGetBox(HighlightedValueDisplayMode_$type, 0)], 'HighlightValue:dr:j4', [1, NaN], 'Interval:dt:j5', [1, NaN], 'IsHighlightNeedleDraggingConstrained:cc:j6', [0, true], 'IsHighlightNeedleDraggingEnabled:cd:j7', [0, false], 'IsNeedleDraggingConstrained:ce:j8', [0, true], 'IsNeedleDraggingEnabled:cf:j9', [0, false], 'LabelExtent:du:ka', [1, 0.65], 'LabelFormat:gi:kb', [2, null], 'LabelFormatSpecifiers:ah:kc', [Array_$type, null], 'LabelInterval:dw:kd', [1, NaN], 'MaximumValue:dx:ke', [1, 100], 'MinimumValue:dz:kf', [1, 0], 'MinorTickBrush:l9:kg', [Brush.$, null], 'MinorTickCount:d1:kh', [1, 3], 'MinorTickEndExtent:d2:ki', [1, 0.57], 'MinorTickStartExtent:d4:kj', [1, 0.54], 'MinorTickStrokeThickness:d6:kk', [1, XamRadialGauge.d7], 'NeedleBaseFeatureExtent:d8:kl', [1, NaN], 'NeedleBaseFeatureWidthRatio:d9:km', [1, NaN], 'NeedleBrush:ma:kn', [Brush.$, null], 'NeedleEndExtent:ea:ko', [1, NaN], 'NeedleEndWidthRatio:eb:kp', [1, NaN], 'NeedleOutline:mb:kq', [Brush.$, null], 'NeedlePivotBrush:mc:kr', [Brush.$, null], 'NeedlePivotInnerWidthRatio:ec:ks', [1, NaN], 'NeedlePivotOutline:md:kt', [Brush.$, null], 'NeedlePivotShape:a6:ku', [RadialGaugePivotShape_$type, enumGetBox(RadialGaugePivotShape_$type, 3)], 'NeedlePivotStrokeThickness:ed:kv', [1, XamRadialGauge.ee], 'NeedlePivotWidthRatio:ef:kw', [1, NaN], 'NeedlePointFeatureExtent:eg:kx', [1, NaN], 'NeedlePointFeatureWidthRatio:eh:ky', [1, NaN], 'NeedleShape:a5:kz', [RadialGaugeNeedleShape_$type, enumGetBox(RadialGaugeNeedleShape_$type, 4)], 'NeedleStartExtent:ei:k0', [1, NaN], 'NeedleStrokeThickness:ek:k2', [1, XamRadialGauge.el], 'OpticalScalingEnabled:ck:k3', [0, false], 'OpticalScalingSize:en:k4', [1, 500], 'RadiusMultiplier:ep:k5', [1, 1], 'RangeBrushes:ak:k6', [BrushCollection.$, null], 'RangeOutlines:al:k7', [BrushCollection.$, null], 'Ranges::k8', [RadialGaugeRangeCollection.$, null], 'ScaleBrush:me:k9', [Brush.$, null], 'ScaleEndAngle:eu:la', [1, 45], 'ScaleEndExtent:ev:lb', [1, 0.57], 'ScaleOversweep:ex:lc', [1, 2.8], 'ScaleOversweepShape:a8:ld', [RadialGaugeScaleOversweepShape_$type, enumGetBox(RadialGaugeScaleOversweepShape_$type, 0)], 'ScaleStartAngle:ez:le', [1, 135], 'ScaleStartExtent:e0:lf', [1, 0.5], 'ScaleSweepDirection:mi:lg', [SweepDirection_$type, enumGetBox(SweepDirection_$type, 1)], 'SubtitleAngle:e3:lh', [1, 90], 'SubtitleBrush:mf:li', [Brush.$, null], 'SubtitleDisplaysValue:cm:lj', [0, false], 'SubtitleExtent:e4:lk', [1, 0.5], 'SubtitleFormat:hu:ll', [2, null], 'SubtitleFormatSpecifiers:ai:lm', [Array_$type, null], 'SubtitleSnapsToNeedlePivot:cn:ln', [0, false], 'SubtitleText:hy:lo', [2, null], 'TickBrush:mg:lp', [Brush.$, null], 'TickEndExtent:e5:lq', [1, 0.57], 'TickStartExtent:e7:lr', [1, 0.5], 'TickStrokeThickness:e9:ls', [1, XamRadialGauge.fa], 'TitleAngle:fb:lt', [1, 90], 'TitleBrush:mh:lu', [Brush.$, null], 'TitleDisplaysValue:co:lv', [0, false], 'TitleExtent:fc:lw', [1, 0.38], 'TitleFormat:h9:lx', [2, null], 'TitleFormatSpecifiers:aj:ly', [Array_$type, null], 'TitleSnapsToNeedlePivot:cp:lz', [0, false], 'TitleText:id:l0', [2, null], 'TransitionDuration:fg:l1', [1, 0], 'TransitionEasingFunction:bf:l2', [Delegate_$type, null], 'Value:ff:l3', [1, 0]]);
    return XamRadialGauge;
})();
/**
 * @hidden
 */
export let XamRadialGaugeView = /*@__PURE__*/ (() => {
    class XamRadialGaugeView extends Base {
        constructor(a) {
            super();
            this.h = null;
            this.s = null;
            this.r = null;
            this.q = null;
            this.v = null;
            this.u = null;
            this.t = null;
            this.b4 = new Path();
            this.b3 = new Path();
            this.b6 = new Path();
            this.b2 = new Path();
            this.b5 = new Path();
            this.b7 = new Path();
            this.o = null;
            this.a = ["needle", "needlePivot", "backing", "scale", "tick", "minorTick", "label"];
            this.c = null;
            this.d = null;
            this.l = false;
            this.m = false;
            this.g = null;
            this.ad = null;
            this.k = null;
            this.ac = null;
            this.i = null;
            this.bp = new Brush();
            this.bq = ((() => {
                let $ret = new Brush();
                $ret.fill = "black";
                return $ret;
            })());
            this.w = NaN;
            this.p = null;
            this.af = -1;
            this.ae = -1;
            this.bu = null;
            this.bv = null;
            this.bw = null;
            this.bx = null;
            this.br = null;
            this.bs = null;
            this.by = null;
            this.b0 = null;
            this.bt = null;
            this.bz = null;
            this.b1 = null;
            this.e = null;
            this.f = null;
            this.x = 0;
            this.h = a;
            this.o = new Dictionary$2(String_$type, Dictionary$2.$.specialize(String_$type, String_$type), 0);
            this.q = new List$1(TextBlock.$, 0);
            this.r = new List$1(Path.$, 0);
            this.s = new List$1(Path.$, 0);
            this.v = new List$1(TextBlock.$, 0);
            this.u = new List$1(TextBlock.$, 0);
            this.t = new List$1(TextBlock.$, 0);
        }
        ar(a) {
            a._visibility = 0;
        }
        as(a) {
            a._visibility = 1;
        }
        at(a) {
            this.q.remove(a);
        }
        bm() {
            let a = new TextBlock();
            this.q.add(a);
            return a;
        }
        bh(a) {
            this.v.remove(a);
        }
        bo() {
            let a = new TextBlock();
            this.v.add(a);
            return a;
        }
        bg(a) {
            this.u.remove(a);
        }
        bn() {
            let a = new TextBlock();
            this.u.add(a);
            return a;
        }
        ap(a) {
            this.t.remove(a);
        }
        bl() {
            let a = new TextBlock();
            this.t.add(a);
            return a;
        }
        a2(a) {
            a._visibility = 0;
        }
        a3(a) {
            a._visibility = 1;
        }
        a4(a) {
            this.r.remove(a);
        }
        ce() {
            let a = new Path();
            this.r.add(a);
            return a;
        }
        a7(a) {
            a._visibility = 0;
        }
        a8(a) {
            a._visibility = 1;
        }
        a9(a) {
            this.s.remove(a);
        }
        cf() {
            let a = new Path();
            this.s.add(a);
            return a;
        }
        n() {
            return true;
        }
        ca() {
            return this.b4;
        }
        b9() {
            return this.b3;
        }
        cc() {
            return this.b6;
        }
        z(a, b) {
            let c = typeCast(TextBlock.$, a);
            if (c != null && c.al != null) {
                this.k.af(b);
                return this.k.f(c) + 0;
            }
            return 0;
        }
        ch(a, b) {
            if (b == null) {
                b = this.h.bp();
            }
            let c = this.z(a, b);
            let d = this.y(b);
            return new Size(1, c, d);
        }
        cj(a, b) {
            let c = this.z(a, b);
            let d = this.y(b);
            return new Size(1, c, d);
        }
        ci(a, b) {
            let c = this.z(a, b);
            let d = this.y(b);
            return new Size(1, c, d);
        }
        cg(a, b) {
            let c = this.z(a, b);
            let d = this.y(b);
            return new Size(1, c, d);
        }
        ao() {
            this.l = true;
            let a = ["#CED3D8", "#CED3D8", "#EBEDEF", "#FFC73C", "#617583", "rgba(100,107,114,.74)", "rgba(100,107,114,.74)"];
            let b = ["#B2B9C0", "#B2B9C0", "#B2B9C0", null, null, null, null];
            let c = ["background-color", "border-top-color"];
            let d = ((() => {
                let $ret = new List$1(Array_$type, 0);
                $ret.add(a);
                $ret.add(b);
                return $ret;
            })());
            this.o.clear();
            let e = this.a.length;
            for (let f = 0; f < e; f++) {
                let g = new Dictionary$2(String_$type, String_$type, 0);
                let h = this.a[f];
                let i = new Array(c.length);
                arrayCopy1(c, 0, i, 0, c.length);
                this.b("ui-radialgauge-" + h, i);
                for (let j = 0; j < i.length; j++) {
                    g.item(c[j], (i[j] == null) ? d._inner[j][f] : i[j]);
                }
                this.o.item(h, g);
            }
            this.bj();
            let k;
            let l;
            let m = BrushUtil.h("radialgauge-range", this.ac, k, l);
            k = m.p2;
            l = m.p3;
            this.c = k;
            this.d = l;
            if (this.e == null) {
                this.h.ak = this.c;
            }
            if (this.f == null) {
                this.h.al = this.d;
            }
            this.l = false;
        }
        au() {
            this.aq();
            if (this.g != null) {
                this.g.au(this.ac.rootWrapper, "");
            }
        }
        ay() {
            if (this.g != null && this.ac != null) {
                this.g.bi(this.ac.rootWrapper, "");
            }
        }
        bj() {
            this.l = true;
            let a = this.a.length;
            for (let b = 0; b < a; b++) {
                let c = this.a[b];
                this.bi(c, this.o.item(c));
            }
            this.l = false;
        }
        bi(a, b) {
            let c = null;
            let d = null;
            let e = b.count;
            for (let f of fromEnum(b.keys)) {
                switch (f) {
                    case "background-color":
                        c = new Brush();
                        if (b.item(f) != null) {
                            c._fill = b.item(f);
                        }
                        break;
                    case "border-top-color":
                        d = new Brush();
                        if (b.item(f) != null) {
                            d._fill = b.item(f);
                        }
                        break;
                }
            }
            switch (a) {
                case "needle":
                    if (this.bu == null) {
                        this.h.ma = c;
                    }
                    if (this.bv == null) {
                        this.h.mb = d;
                    }
                    break;
                case "needlePivot":
                    if (this.bw == null) {
                        this.h.mc = c;
                    }
                    if (this.bx == null) {
                        this.h.md = d;
                    }
                    break;
                case "backing":
                    if (this.br == null) {
                        this.h.l4 = c;
                    }
                    if (this.bs == null) {
                        this.h.l5 = d;
                    }
                    break;
                case "scale":
                    if (this.by == null) {
                        this.h.me = c;
                    }
                    break;
                case "tick":
                    if (this.b0 == null) {
                        this.h.mg = c;
                    }
                    break;
                case "minorTick":
                    if (this.bt == null) {
                        this.h.l9 = c;
                    }
                    break;
                case "label":
                    this.bq = c;
                    break;
            }
        }
        b(a, b) {
            this.ac.startCSSQuery();
            for (let c = 0; c < b.length; c++) {
                b[c] = this.ac.getCssDefaultPropertyValue(a, b[c]);
            }
            this.ac.endCSSQuery();
            return b;
        }
        static ab(a, b) {
            let c = a == null ? 0 : a.length;
            if (c < 1) {
                return b;
            }
            let d = a.split('.');
            let e = (d[0].length > 0) ? parseInt(d[0]) : 0;
            if (d.length != 2) {
                return e;
            }
            c = d[1].length;
            let f = parseInt(d[1]);
            while (c-- > 0) {
                f /= 10;
            }
            return f + e;
        }
        az() {
            this.l = true;
            this.h.ma = ((() => {
                let $ret = new Brush();
                $ret.fill = "#CED3D8";
                return $ret;
            })());
            this.h.mb = ((() => {
                let $ret = new Brush();
                $ret.fill = "#B2B9C0";
                return $ret;
            })());
            this.h.mg = ((() => {
                let $ret = new Brush();
                $ret.fill = "#617583";
                return $ret;
            })());
            this.h.me = ((() => {
                let $ret = new Brush();
                $ret.fill = "#FFC73C";
                return $ret;
            })());
            this.h.l4 = ((() => {
                let $ret = new Brush();
                $ret.fill = "#EBEDEF";
                return $ret;
            })());
            this.h.l5 = ((() => {
                let $ret = new Brush();
                $ret.fill = "#B2B9C0";
                return $ret;
            })());
            this.h.mc = ((() => {
                let $ret = new Brush();
                $ret.fill = "#CED3D8";
                return $ret;
            })());
            this.h.md = ((() => {
                let $ret = new Brush();
                $ret.fill = "#B2B9C0";
                return $ret;
            })());
            this.h.l9 = ((() => {
                let $ret = new Brush();
                $ret.fill = "rgba(100,107,114,.74)";
                return $ret;
            })());
            this.l = false;
            this.aq();
        }
        aq() {
            let a = CanvasScalingHelpers.b(this.ac);
            this.h.db = CanvasScalingHelpers.a(this.h.eo, this.h.db, a);
            if (this.g != null) {
                CanvasScalingHelpers.h(this.g, a);
            }
        }
        bb() {
            if (!this.m) {
                this.m = true;
                if (this.ac != null) {
                    this.ac.setTimeout(runOn(this, this.ag), 0);
                }
                else {
                    window.setTimeout(runOn(this, this.ag), 0);
                }
            }
        }
        ag() {
            if (this.m) {
                this.m = false;
                this.h.im();
            }
        }
        flush() {
            if (this.m) {
                this.ag();
            }
        }
        a6(a, b, c) {
            a.n = b;
            a.o = c;
        }
        aw(a) {
            if (a == null) {
                this.ad = null;
                this.ac = null;
                this.k = null;
                if (this.h.b5) {
                    this.h.bc.w();
                }
                this.ai();
                return;
            }
            this.x = (isNaN_(this.h.eo) ? this.h.db : this.h.eo);
            let b = a;
            this.ac = b;
            this.h.bc.u(this.ac);
            this.ac.rootWrapper.addClass("ui-radialgauge-container");
            let c = this.x;
            let d = Math.round(b.rootWrapper.width());
            let e = Math.round(b.rootWrapper.height());
            let f = d * c;
            let g = e * c;
            this.ac.rootWrapper.setStyleProperty("position", "relative");
            let h = this.ac.createElement("canvas");
            h.setStyleProperty("position", "absolute");
            this.ac.append(h);
            this.af = truncate(Math.round(f));
            this.ae = truncate(Math.round(g));
            h.setAttribute("width", f.toString());
            h.setAttribute("height", g.toString());
            h.setStyleProperty("width", d.toString() + "px");
            h.setStyleProperty("height", e.toString() + "px");
            h.setStyleProperty("left", "0px");
            h.setStyleProperty("top", "0px");
            this.h.mm = new Rect(0, 0, 0, d, e);
            this.ad = h;
            let i = this.ac.get2DCanvasContext(this.ad);
            this.k = new RenderingContext(new CanvasViewRenderer(), i);
            this.ao();
            this.bk();
            this.k.af(this.i);
            this.ai();
            if (TypeRegistrar.isRegistered("CanvasGestureDOMEventProxy")) {
                this.g = typeCast(EventProxy.$, TypeRegistrar.create("CanvasGestureDOMEventProxy", this.ac.rootWrapper, this.ac, false));
            }
            if (this.g != null) {
                let j = this.g;
                j.onContactStarted = delegateCombine(j.onContactStarted, runOn(this, this.al));
                let k = this.g;
                k.onContactMoved = delegateCombine(k.onContactMoved, runOn(this, this.ak));
                let l = this.g;
                l.onContactCompleted = delegateCombine(l.onContactCompleted, runOn(this, this.aj));
                this.g.ap = (m) => (this.h.cf && (this.h.bx == 1 || this.h.ch(m))) || (this.h.cd && (this.h.bx == 2 || this.h.b9(m)));
            }
            this.ba();
        }
        aj(a, b) {
            if (this.h != null) {
                this.h.onMouseUp(a);
            }
        }
        ak(a, b) {
            if (this.h != null) {
                this.h.onMouseMove(a, b);
            }
        }
        al(a, b) {
            if (this.h != null) {
                this.h.onMouseDown(a);
            }
        }
        ai() {
            if (this.g != null) {
                let a = this.g;
                a.onContactStarted = delegateRemove(a.onContactStarted, runOn(this, this.al));
                let b = this.g;
                b.onContactMoved = delegateRemove(b.onContactMoved, runOn(this, this.ak));
                let c = this.g;
                c.onContactCompleted = delegateRemove(c.onContactCompleted, runOn(this, this.aj));
                this.g.ap = null;
                this.g.aw();
            }
        }
        bd(a, b) {
            if (b != null) {
                a.ao = b;
            }
            else {
                a.ao = this.bq;
            }
        }
        be(a, b) {
            if (a == null) {
                return;
            }
            if (b == null) {
                return;
            }
            a.dataContext = b;
        }
        bf() {
            this.ao();
            this.bk();
            this.bb();
        }
        bk() {
            this.i = FontUtil.getFont(this.ac);
            if (this.h.fv != null) {
                this.i = this.h.bp();
            }
            this.w = this.y(this.i);
            this.bp = new Brush();
            this.bp._fill = this.ac.rootWrapper.getStyleProperty("color");
            if (this.k != null) {
                this.k.af(this.i);
            }
        }
        ah() {
            this.ba();
        }
        ba() {
            let a = this.h.mm.width;
            let b = this.h.mm.height;
            let c = Math.round(a * this.x);
            let d = Math.round(b * this.x);
            if (this.af != c || this.ae != d) {
                this.ad.setAttribute("width", c.toString());
                this.ad.setAttribute("height", d.toString());
                this.ad.setStyleProperty("width", a.toString() + "px");
                this.ad.setStyleProperty("height", b.toString() + "px");
                this.af = truncate(Math.round(c));
                this.ae = truncate(Math.round(d));
            }
            if (this.k.d && this.x != 1) {
                this.k.aa();
                this.k.ab(this.x, this.x);
            }
            this.k.l(this.h.mm.left, this.h.mm.top, this.h.mm.width, this.h.mm.height);
            this.k.t(this.b2);
            this.k.t(this.b6);
            if (this.p != null) {
                for (let e = 0; e < this.p.count; e++) {
                    this.k.t(this.p._inner[e]);
                }
            }
            for (let f = 0; f < this.q.count; f++) {
                let g = this.q._inner[f];
                this.k.af(g.dataContext);
                this.k.x(g);
            }
            for (let h = 0; h < this.v.count; h++) {
                let i = this.v._inner[h];
                this.k.af(i.dataContext);
                this.k.x(i);
            }
            for (let j = 0; j < this.u.count; j++) {
                let k = this.u._inner[j];
                this.k.af(k.dataContext);
                this.k.x(k);
            }
            for (let l = 0; l < this.t.count; l++) {
                let m = this.t._inner[l];
                this.k.af(m.dataContext);
                this.k.x(m);
            }
            for (let n = 0; n < this.r.count; n++) {
                this.k.t(this.r._inner[n]);
            }
            this.k.t(this.b7);
            if (this.b4.j != null) {
                this.k.aa();
                this.k.k(this.b4.j);
            }
            this.k.t(this.b4);
            if (this.b4.j != null) {
                this.k.z();
            }
            if (this.b3.j != null) {
                this.k.aa();
                this.k.k(this.b3.j);
            }
            this.k.t(this.b3);
            if (this.b3.j != null) {
                this.k.z();
            }
            this.k.t(this.b5);
            if (this.k.d && this.x != 1) {
                this.k.z();
            }
        }
        y(a) {
            return FontUtil.getCurrentFontHeight(this.ac, a);
        }
        bc(a) {
            this.p = a;
        }
        b8() {
            return this.b2;
        }
        cd() {
            return this.b7;
        }
        cb() {
            return this.b5;
        }
        ax() {
            this.aq();
            let a = Math.round(this.ac.rootWrapper.width());
            let b = Math.round(this.ac.rootWrapper.height());
            this.h.mm = new Rect(0, 0, 0, a, b);
            if (this.g != null) {
                this.g.bm = this.h.mm;
            }
        }
        j(a, b) {
            return FontUtil.getFontInfo(this.ac, a, b);
        }
        am(a) {
            a.scalePath = new PathVisualData(1, "Scale", this.b6);
            a.needlePath = new PathVisualData(1, "Needle", this.b4);
            a.highlightNeedlePath = new PathVisualData(1, "HighlightNeedle", this.b3);
            let b = this.b4.j.j._inner[0].j;
            a.needle.angle = b;
            if (this.b3 != null && typeCast(TransformGroup.$, this.b3.j) !== null) {
                let c = this.b3.j.j._inner[0].j;
                a.highlightNeedle.angle = c;
            }
            else {
                a.highlightNeedle.angle = NaN;
            }
            a.backingPath = new PathVisualData(1, "Backing", this.b2);
            a.overlayPath = new PathVisualData(1, "Overlay", this.b5);
            a.underlayPath = new PathVisualData(1, "Underlay", this.b7);
            let d = this.i;
            for (let e of fromEnum(this.q)) {
                if (e._visibility == 0) {
                    let f = e.dataContext;
                    let g = new ScaleLabelVisualData();
                    g.labelValue = e.al;
                    g.labelPosition = PointData.b({ $type: Point_$type, x: e.n, y: e.o });
                    g.labelSize = SizeData.b(this.ch(e, f));
                    g.appearance = AppearanceHelper.c(e, f);
                    a.scaleLabels.add(g);
                }
            }
            for (let h of fromEnum(this.v)) {
                if (h._visibility == 0) {
                    let i = h.dataContext;
                    let j = new ScaleLabelVisualData();
                    j.labelValue = h.al;
                    j.labelPosition = PointData.b({ $type: Point_$type, x: h.n, y: h.o });
                    j.labelSize = SizeData.b(this.ch(h, i));
                    j.appearance = AppearanceHelper.c(h, i);
                    a.titleLabels.add(j);
                }
            }
            for (let k of fromEnum(this.u)) {
                if (k._visibility == 0) {
                    let l = k.dataContext;
                    let m = new ScaleLabelVisualData();
                    m.labelValue = k.al;
                    m.labelPosition = PointData.b({ $type: Point_$type, x: k.n, y: k.o });
                    m.labelSize = SizeData.b(this.ch(k, l));
                    m.appearance = AppearanceHelper.c(k, l);
                    a.subtitleLabels.add(m);
                }
            }
            for (let n of fromEnum(this.t)) {
                if (n._visibility == 0) {
                    let o = n.dataContext;
                    let p = new ScaleLabelVisualData();
                    p.labelValue = n.al;
                    p.labelPosition = PointData.b({ $type: Point_$type, x: n.n, y: n.o });
                    p.labelSize = SizeData.b(this.ch(n, o));
                    p.appearance = AppearanceHelper.c(n, o);
                    a.highlightLabels.add(p);
                }
            }
            for (let q of fromEnum(this.r)) {
                if (q._visibility == 0) {
                    let r = new ScaleTickmarkVisualData();
                    r.tickPath = new PathVisualData(1, "tickmarks", q);
                    a.scaleTickmarks.add(r);
                }
            }
            for (let s of fromEnum(this.s)) {
                if (s._visibility == 0) {
                    let t = new RangeVisualData();
                    let u = new PathVisualData(1, "range", s);
                    t.rangePath = u;
                    a.ranges.add(t);
                }
            }
        }
        av(a, b, c) {
            let d = b;
            let e = c;
            if (!this.l) {
                switch (a) {
                    case XamRadialGauge.$$p[41]:
                        this.bu = e;
                        break;
                    case XamRadialGauge.$$p[44]:
                        this.bv = e;
                        break;
                    case XamRadialGauge.$$p[45]:
                        this.bw = e;
                        break;
                    case XamRadialGauge.$$p[47]:
                        this.bx = e;
                        break;
                    case XamRadialGauge.$$p[0]:
                        this.br = e;
                        break;
                    case XamRadialGauge.$$p[4]:
                        this.bs = e;
                        break;
                    case XamRadialGauge.$$p[62]:
                        this.by = e;
                        break;
                    case XamRadialGauge.$$p[78]:
                        this.b0 = e;
                        break;
                    case XamRadialGauge.$$p[34]:
                        this.bt = e;
                        break;
                }
                if (e == null) {
                    this.bj();
                }
            }
        }
        a0(a, b) {
            if (!this.l) {
                this.e = b;
                if (this.e == null) {
                    this.h.ak = this.c;
                }
            }
        }
        a1(a, b) {
            if (!this.l) {
                this.f = b;
                if (this.f == null) {
                    this.h.al = this.d;
                }
            }
        }
        a5() {
            this.x = this.h.db;
        }
    }
    XamRadialGaugeView.$t = markType(XamRadialGaugeView, 'XamRadialGaugeView');
    return XamRadialGaugeView;
})();