/*
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 { EventArgs, Base, markType, typeCast, runOn, delegateCombine, enumGetBox, Point_$type, String_$type, Number_$type, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-react-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core";
import { IFastItemColumn$1_$type } from "igniteui-react-core";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core";
import { DependencyProperty } from "igniteui-react-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "igniteui-react-core";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-react-core";
import { List$1 } from "igniteui-react-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { Dictionary$2 } from "igniteui-react-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-react-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core";
import { stringIsNullOrEmpty } from "igniteui-react-core";
import { dateToStringFormat } from "igniteui-react-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core";
import { Color } from "igniteui-react-core";
/**
 * @hidden
 */
export let FinancialEventArgs = /*@__PURE__*/ (() => {
    class FinancialEventArgs extends EventArgs {
        constructor(a, b, c, d, e) {
            super();
            this._position = 0;
            this._count = 0;
            this._dataSource = null;
            this._supportingCalculations = null;
            this._basedOn = null;
            this.position = a;
            this.count = b;
            this.dataSource = c;
            this.supportingCalculations = d;
            if (c != null) {
                c.series = e;
            }
        }
        get position() {
            return this._position;
        }
        set position(a) {
            this._position = a;
        }
        get count() {
            return this._count;
        }
        set count(a) {
            this._count = a;
        }
        get dataSource() {
            return this._dataSource;
        }
        set dataSource(a) {
            this._dataSource = a;
        }
        get supportingCalculations() {
            return this._supportingCalculations;
        }
        set supportingCalculations(a) {
            this._supportingCalculations = a;
        }
        get basedOn() {
            return this._basedOn;
        }
        set basedOn(a) {
            this._basedOn = a;
        }
    }
    FinancialEventArgs.$t = /*@__PURE__*/ markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
})();
/**
 * @hidden
 */
export let FinancialBucketCalculator = /*@__PURE__*/ (() => {
    class FinancialBucketCalculator extends Base {
        constructor(a) {
            super();
            this.a = null;
            this.c = 0;
            this.d = 0;
            this.b = 0;
            if (a == null) {
                throw new ArgumentNullException(0, "view");
            }
            this.a = a;
            this.c = -1;
            this.d = this.d;
            this.b = 0;
        }
        getBucket(a) {
            return null;
        }
        getBucketWithoutUnknowns(a) {
            return this.getBucket(a);
        }
        getErrorBucket(a, b) {
            return NaN;
        }
        getBucketInfo(a, b, c, d) {
            a = this.c;
            b = this.d;
            c = this.b;
            d = this.a.b2.ib;
            return {
                p0: a,
                p1: b,
                p2: c,
                p3: d
            };
        }
        e(a) {
            let b = this.a.by;
            let c = this.a.bx;
            let d = this.a.bx;
            if (this.a.b2 != null) {
                d = this.a.b2.getEffectiveViewport1(this.a);
            }
            if (b.isEmpty || c.isEmpty || this.a.b2.wx == null) {
                this.b = 0;
                return;
            }
            let e = (this.a.b2.wx != null) ? this.a.b2.wx.ch : false;
            let f = new ScalerParams(0, b, c, e, d);
            let g = this.a.b2.wc(this.a);
            let h = typeCast(ISortingAxis_$type, this.a.b2.wx);
            if (h == null || h.i$b == null) {
                let i = Math.floor(this.a.b2.wx.en(g.left, f));
                let j = Math.ceil(this.a.b2.wx.en(g.right, f));
                if (this.a.b2.wx.ch) {
                    j = Math.ceil(this.a.b2.wx.en(g.left, f));
                    i = Math.floor(this.a.b2.wx.en(g.right, f));
                }
                let k = Math.floor((j - i + 1) * a / g.width);
                this.b = truncate(Math.max(1, k));
                this.c = truncate(Math.floor(i / this.b));
                this.d = truncate(Math.ceil(j / this.b));
            }
            else {
                this.c = h.i$e(b, c, d, g);
                this.d = h.i$g(b, c, d, g);
                this.b = 1;
            }
        }
        cacheValues() {
        }
        unCacheValues() {
        }
    }
    FinancialBucketCalculator.$t = /*@__PURE__*/ markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
})();
/**
 * @hidden
 */
export let FinancialSeries = /*@__PURE__*/ (() => {
    class FinancialSeries extends Series {
        hr() {
            let a = super.hr();
            {
                let b = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "OpenMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedOpenMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.z0));
                a.add(b);
            }
            {
                let c = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "HighMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedHighMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.zy));
                a.add(c);
            }
            {
                let d = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "LowMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedLowMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.zz));
                a.add(d);
            }
            {
                let e = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "CloseMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedCloseMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.zx));
                a.add(e);
            }
            {
                let f = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.ad = "VolumeMemberPath";
                    $ret.p = true;
                    $ret.y = "HighlightedVolumeMemberPath";
                    $ret.q = true;
                    return $ret;
                })());
                f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.z1));
                a.add(f);
            }
            {
                let g = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Brush";
                    $ret.p = true;
                    $ret.y = "ActualBrush";
                    $ret.q = true;
                    return $ret;
                })());
                g.valueResolving = delegateCombine(g.valueResolving, runOn(this, this.ru));
                a.add(g);
            }
            {
                let h = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "Outline";
                    $ret.p = true;
                    $ret.y = "ActualOutline";
                    $ret.q = true;
                    return $ret;
                })());
                h.valueResolving = delegateCombine(h.valueResolving, runOn(this, this.ru));
                a.add(h);
            }
            {
                let i = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "NegativeBrush";
                    $ret.p = true;
                    $ret.q = true;
                    return $ret;
                })());
                i.valueResolving = delegateCombine(i.valueResolving, runOn(this, this.ru));
                a.add(i);
            }
            {
                let j = ((() => {
                    let $ret = new SeriesLayerPropertyOverlay();
                    $ret.r = true;
                    $ret.ad = "NegativeOutline";
                    $ret.p = true;
                    $ret.q = true;
                    return $ret;
                })());
                j.valueResolving = delegateCombine(j.valueResolving, runOn(this, this.ru));
                a.add(j);
            }
            let k = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.p = true;
                $ret.ad = "IsTransitionInEnabled";
                $ret.x = true;
                $ret.q = true;
                return $ret;
            })());
            a.add(k);
            let l = ((() => {
                let $ret = new SeriesLayerPropertyOverlay();
                $ret.p = true;
                $ret.ad = "TransitionInMode";
                $ret.x = enumGetBox(CategoryTransitionInMode_$type, 20);
                $ret.q = true;
                return $ret;
            })());
            a.add(l);
            return a;
        }
        z0(a, b) {
            if (this.za != null) {
                b.value = this.za;
                return;
            }
            b.value = this.zn;
        }
        zy(a, b) {
            if (this.y6 != null) {
                b.value = this.y6;
                return;
            }
            b.value = this.ze;
        }
        zz(a, b) {
            if (this.y8 != null) {
                b.value = this.y8;
                return;
            }
            b.value = this.zj;
        }
        zx(a, b) {
            if (this.y4 != null) {
                b.value = this.y4;
                return;
            }
            b.value = this.y1;
        }
        z1(a, b) {
            if (this.zc != null) {
                b.value = this.zc;
                return;
            }
            b.value = this.zr;
        }
        ks() {
            if (this.d1()) {
                return this.bl.w3;
            }
            else {
                return this.bl.wz;
            }
        }
        qw(a) {
            super.qw(a);
            this.xe = a;
        }
        get_e4() {
            return true;
        }
        ai() {
            return [this.wx, this.xg];
        }
        ko(a, b) {
            let c = this.na(b);
            if (c == FinancialSeries.$$p[11]) {
                return this.kp(a, b, this.zn);
            }
            if (c == FinancialSeries.$$p[1]) {
                return this.kp(a, b, this.ze);
            }
            if (c == FinancialSeries.$$p[9]) {
                return this.kp(a, b, this.zj);
            }
            if (c == FinancialSeries.$$p[0]) {
                return this.kp(a, b, this.y1);
            }
            if (c == FinancialSeries.$$p[13]) {
                return this.kp(a, b, this.zr);
            }
            if (c == FinancialSeries.$$p[5]) {
                return this.kp(a, b, this.za);
            }
            if (c == FinancialSeries.$$p[3]) {
                return this.kp(a, b, this.y6);
            }
            if (c == FinancialSeries.$$p[4]) {
                return this.kp(a, b, this.y8);
            }
            if (c == FinancialSeries.$$p[2]) {
                return this.kp(a, b, this.y4);
            }
            if (c == FinancialSeries.$$p[6]) {
                return this.kp(a, b, this.zc);
            }
            return super.ko(a, b);
        }
        ma(a) {
            let b = this.na(a);
            if (b == FinancialSeries.$$p[11]) {
                return this.zn;
            }
            if (b == FinancialSeries.$$p[1]) {
                return this.ze;
            }
            if (b == FinancialSeries.$$p[9]) {
                return this.zj;
            }
            if (b == FinancialSeries.$$p[0]) {
                return this.y1;
            }
            if (b == FinancialSeries.$$p[13]) {
                return this.zr;
            }
            if (b == FinancialSeries.$$p[5]) {
                return this.za;
            }
            if (b == FinancialSeries.$$p[3]) {
                return this.y6;
            }
            if (b == FinancialSeries.$$p[4]) {
                return this.y8;
            }
            if (b == FinancialSeries.$$p[2]) {
                return this.y4;
            }
            if (b == FinancialSeries.$$p[6]) {
                return this.zc;
            }
            return super.ma(a);
        }
        yx() {
            return 2;
        }
        yv() {
            return 4;
        }
        aj(a) {
            let b = this.am(this.wx, this.wz.f, this.yu(this.ct), this.yw(this.ct), this.wa(a), true);
            if (b == null) {
                return null;
            }
            let c = b[0];
            let d = b[1];
            let e = new Array(1);
            let f = new Array(2);
            let g = this.yx();
            f[0] = { $type: Point_$type, x: c[0], y: c[g] };
            f[1] = { $type: Point_$type, x: d[0], y: d[g] };
            e[0] = f;
            return e;
        }
        ak(a) {
            let b = this.am(this.wx, this.wz.f, this.yu(this.ct), this.yw(this.ct), this.wa(a), true);
            if (b == null) {
                return null;
            }
            let c = b[0];
            let d = b[1];
            let e = new Array(1);
            let f = new Array(2);
            f[0] = { $type: Point_$type, x: c[0], y: c[1] };
            f[1] = { $type: Point_$type, x: d[0], y: d[1] };
            e[0] = f;
            return e;
        }
        constructor() {
            super();
            this.xo = null;
            this.xm = null;
            this.xn = null;
            this.xl = null;
            this.xp = null;
            this.xy = false;
            this.assigningCategoryStyle = null;
            this.w6 = null;
            this.x8 = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
            this.x9 = new Dictionary$2(String_$type, String_$type, 0);
            this.xx = false;
            this.xk = null;
            this.w1 = null;
            this.w3 = null;
            this.wz = null;
            this.w9 = null;
            this.typical = null;
            this.typicalBasedOn = null;
            this.xw = false;
            this.yl = null;
            this.yj = null;
            this.yk = null;
            this.yi = null;
            this.ym = null;
            this.w2 = null;
            this.wy = null;
            this.w4 = 0;
            this.xf = null;
            this.xh = null;
            this.w6 = new CategorySeriesRenderManager();
            this.xy = false;
            this.w9 = new CategoryTransitionSourceFramePreparer();
            this.w2 = new CategoryFrame(3);
            this.ab = FinancialSeries.$;
            this.w5 = 0;
        }
        vp() {
            return this.aan;
        }
        vq() {
            return this.aan;
        }
        oz() {
            super.oz();
            this.wx = null;
            this.xg = null;
        }
        get_ei() {
            return true;
        }
        get_f3() {
            return this.xg != null && this.xg.ch;
        }
        get xt() {
            return this.xo;
        }
        set xt(a) {
            if (this.xo != a) {
                let b = this.xo;
                this.xo = a;
                this.raisePropertyChanged("OpenColumn", b, this.xo);
            }
        }
        get xr() {
            return this.xm;
        }
        set xr(a) {
            if (this.xm != a) {
                let b = this.xm;
                this.xm = a;
                this.raisePropertyChanged("HighColumn", b, this.xm);
            }
        }
        get xs() {
            return this.xn;
        }
        set xs(a) {
            if (this.xn != a) {
                let b = this.xn;
                this.xn = a;
                this.raisePropertyChanged("LowColumn", b, this.xn);
            }
        }
        get xq() {
            return this.xl;
        }
        set xq(a) {
            if (this.xl != a) {
                let b = this.xl;
                this.xl = a;
                this.raisePropertyChanged("CloseColumn", b, this.xl);
            }
        }
        get xv() {
            return this.xp;
        }
        set xv(a) {
            if (this.xp != a) {
                let b = this.xp;
                this.xp = a;
                this.raisePropertyChanged("VolumeColumn", b, this.xp);
            }
        }
        f9() {
            return this.highlightedItemsSource != null || (this.za != null && this.y6 != null && this.y8 != null && this.y4 != null);
        }
        x5() {
            return (this.assigningCategoryStyle != null && this.xy) || this.bv != 1 || this.cn != 1 || this.cm != 1;
        }
        z4(a) {
            if (this.assigningCategoryStyle != null && this.xy) {
                this.assigningCategoryStyle(this, a);
            }
        }
        z2(a, b, c, d, e, f, g) {
            let h = this.bv != 1;
            let i = this.cn != 1;
            let j = this.cm != 1;
            this.w6.a3(this.w6.b, d.cn, a, b, c, d, e, f, false, g);
            this.w6.ab(this.h9);
            let k = this.w6.ay;
            let l = null;
            let m = null;
            let n = null;
            let o = this.dl;
            if (h && this.c9 != null) {
                l = this.c9.dj.getHighlightingInfo(this, o, k.z, k.y, false);
                k.c = l;
            }
            if (i && this.c9 != null) {
                m = this.c9.dk.getHighlightingInfo(this, o, k.z, k.y, false);
                if (m == null && this.bl != null) {
                    m = this.c9.dk.getHighlightingInfo(this.bl, this.bl.dl, k.z, k.y, false);
                }
                k.d = m;
            }
            if (j && this.c9 != null) {
                n = this.c9.di.getHighlightingInfo(this, o, k.z, k.y, false);
                k.b = n;
            }
            k.h = f;
            this.z4(k);
            this.w6.z(this, l, m, n, f, h, i, j, b < 0);
        }
        yn(a) {
            return this.ir(a, this.wx);
        }
        j8(a, b) {
            return this.j9(a, b, this.wx, runOn(this, this.yn), new FinancialValueList(this.xt, this.xr, this.xs, this.xq, this.xv));
        }
        j6(a, b) {
            return this.j7(a, b, this.wx, runOn(this, this.yn), new FinancialValueList(this.xt, this.xr, this.xs, this.xq, this.xv));
        }
        im(a, b, c, d, e) {
            if (c == null) {
                return Number.POSITIVE_INFINITY;
            }
            let f = this.wx.lg;
            return this.io(a, b, this.wx, d, e, f, runOn(this, this.yn));
        }
        getOffsetValue() {
            return this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        getCategoryWidth() {
            return this.wx.getCategorySize(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct));
        }
        v5(a, b, c) {
            return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, null, null, null);
        }
        i3(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yo(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
            return this.i5(new FinancialValueList(this.xt, this.xr, this.xs, this.xq, this.xv), a, this.wx, f, e, runOn(this, this.yn), b, c);
        }
        iz(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yo(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
            return this.i5(this.xr, a, this.wx, f, e, runOn(this, this.yn), b, c);
        }
        i1(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yo(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
            return this.i5(this.xs, a, this.wx, f, e, runOn(this, this.yn), b, c);
        }
        yp(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yo(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
            return this.i5(this.xq, a, this.wx, f, e, runOn(this, this.yn), b, c);
        }
        yq(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yo(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
            return this.i5(this.xt, a, this.wx, f, e, runOn(this, this.yn), b, c);
        }
        yr(a, b, c) {
            let d = this.getEffectiveViewport1(this.ct);
            let e = this.yo(this.ct.by, this.ct.bx, d);
            let f = new ScalerParams(0, this.ct.by, this.ct.bx, this.wx.ch, d);
            return this.i5(this.xv, a, this.wx, f, e, runOn(this, this.yn), b, c);
        }
        v1(a, b, c) {
            return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.iz), (d, e) => this.j9(d, e, this.wx, runOn(this, this.yn), this.xr), (d, e) => this.j7(d, e, this.wx, runOn(this, this.yn), this.xr));
        }
        v3(a, b, c) {
            return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.i1), (d, e) => this.j9(d, e, this.wx, runOn(this, this.yn), this.xs), (d, e) => this.j7(d, e, this.wx, runOn(this, this.yn), this.xs));
        }
        aap(a, b, c) {
            return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.yq), (d, e) => this.j9(d, e, this.wx, runOn(this, this.yn), this.xt), (d, e) => this.j7(d, e, this.wx, runOn(this, this.yn), this.xt));
        }
        aao(a, b, c) {
            return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.yp), (d, e) => this.j9(d, e, this.wx, runOn(this, this.yn), this.xq), (d, e) => this.j7(d, e, this.wx, runOn(this, this.yn), this.xq));
        }
        aaq(a, b, c) {
            return this.v7(a, b, c, this.yo(this.ct.by, this.ct.bx, this.getEffectiveViewport1(this.ct)), this.xg, this.wx, runOn(this, this.yr), (d, e) => this.j9(d, e, this.wx, runOn(this, this.yn), this.xv), (d, e) => this.j7(d, e, this.wx, runOn(this, this.yn), this.xv));
        }
        p5() {
            super.p5();
            if (this.wx != null) {
                this.wx.h9(false);
            }
            if (this.xg != null) {
                this.xg.h9(false);
            }
        }
        sk(a, b) {
            this.xe.b0.e(this.ib);
            this.rm(false);
        }
        sj(a, b) {
            if (this.gz && this.jo < 0.05) {
                this.g0 = true;
                this.g3 = false;
                this.gi = false;
            }
            this.xe.b0.e(this.ib);
            this.rm(false);
        }
        xu(a, b, c) {
            let d = this.di(b);
            this.x8.addItem(d, b);
            this.x9.addItem(b, c);
            return d;
        }
        zw(a, b) {
            if (b == null) {
                return;
            }
            a.deregisterColumn(b);
            let c = this.x8.item(b);
            this.x9.removeItem(c);
            this.x8.removeItem(b);
        }
        q4(a, b, c, d) {
            super.q4(a, b, c, d);
            switch (b) {
                case "SyncLink":
                    if (this.c1 != null && this.c9 != null) {
                        this.xe.b0.e(this.ib);
                        this.rm(false);
                    }
                    break;
                case "SeriesViewer":
                    if (c != null && d == null) {
                        if (this.wx != null) {
                            this.wx.b0(this);
                        }
                        if (this.xg != null) {
                            this.xg.b0(this);
                        }
                    }
                    if (c == null && d != null) {
                        if (this.wx != null) {
                            this.wx.ct(this);
                        }
                        if (this.xg != null) {
                            this.xg.ct(this);
                        }
                    }
                    this.xe.b0.e(this.ib);
                    this.rm(false);
                    break;
                case "FastItemsSource":
                    this.xx = true;
                    if (typeCast(IFastItemsSource_$type, c) != null) {
                        this.zw(typeCast(IFastItemsSource_$type, c), this.xt);
                        this.zw(typeCast(IFastItemsSource_$type, c), this.xr);
                        this.zw(typeCast(IFastItemsSource_$type, c), this.xs);
                        this.zw(typeCast(IFastItemsSource_$type, c), this.xq);
                        this.zw(typeCast(IFastItemsSource_$type, c), this.xv);
                        this.xt = null;
                        this.xr = null;
                        this.xs = null;
                        this.xq = null;
                        this.xv = null;
                    }
                    if (typeCast(IFastItemsSource_$type, d) != null) {
                        if (stringIsNullOrEmpty(this.zn) == false) {
                            this.xt = this.xu(typeCast(IFastItemsSource_$type, d), this.zn, "OpenColumn");
                        }
                        if (stringIsNullOrEmpty(this.ze) == false) {
                            this.xr = this.xu(typeCast(IFastItemsSource_$type, d), this.ze, "HighColumn");
                        }
                        if (stringIsNullOrEmpty(this.zj) == false) {
                            this.xs = this.xu(typeCast(IFastItemsSource_$type, d), this.zj, "LowColumn");
                        }
                        if (stringIsNullOrEmpty(this.y1) == false) {
                            this.xq = this.xu(typeCast(IFastItemsSource_$type, d), this.y1, "CloseColumn");
                        }
                        if (stringIsNullOrEmpty(this.zr) == false) {
                            this.xv = this.xu(typeCast(IFastItemsSource_$type, d), this.zr, "VolumeColumn");
                        }
                    }
                    this.xx = false;
                    if (this.xg != null && !this.xg.c1()) {
                        this.xe.b0.e(this.ib);
                        this.rm(this.ge && c != null);
                    }
                    break;
                case FinancialSeries.$$p[11]:
                    if (this.dl != null) {
                        this.zw(this.dl, this.xt);
                        this.xt = this.xu(this.dl, this.zn, "OpenColumn");
                    }
                    break;
                case "OpenColumn":
                    if (this.xg != null && !this.xg.c1() && !this.xx) {
                        this.xe.b0.e(this.ib);
                        this.rm(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[1]:
                    if (this.dl != null) {
                        this.zw(this.dl, this.xr);
                        this.xr = this.xu(this.dl, this.ze, "HighColumn");
                    }
                    break;
                case "HighColumn":
                    if (this.xg != null && !this.xg.c1() && !this.xx) {
                        this.xe.b0.e(this.ib);
                        this.rm(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[9]:
                    if (this.dl != null) {
                        this.zw(this.dl, this.xs);
                        this.xs = this.xu(this.dl, this.zj, "LowColumn");
                    }
                    break;
                case "LowColumn":
                    if (this.xg != null && !this.xg.c1() && !this.xx) {
                        this.xe.b0.e(this.ib);
                        this.rm(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[0]:
                    if (this.dl != null) {
                        this.zw(this.dl, this.xq);
                        this.xq = this.xu(this.dl, this.y1, "CloseColumn");
                    }
                    break;
                case "CloseColumn":
                    if (this.xg != null && !this.xg.c1() && !this.xx) {
                        this.xe.b0.e(this.ib);
                        this.rm(this.ge && this.d5);
                    }
                    this.z6();
                    break;
                case FinancialSeries.$$p[13]:
                    if (this.dl != null) {
                        this.zw(this.dl, this.xv);
                        this.xv = this.xu(this.dl, this.zr, "VolumeColumn");
                    }
                    break;
                case "VolumeColumn":
                    if (this.xg != null && !this.xg.c1() && !this.xx) {
                        this.xe.b0.e(this.ib);
                        this.rm(this.ge && this.d5);
                    }
                    break;
                case FinancialSeries.$$p[14]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.xe.b0.e(this.ib);
                    this.rm(false);
                    this.qg();
                    this.xf = typeCast(ITimeRangeSelectorAxis_$type, this.wx);
                    break;
                case FinancialSeries.$$p[15]:
                    if (c != null) {
                        c.b0(this);
                    }
                    if (d != null) {
                        d.ct(this);
                    }
                    this.xe.b0.e(this.ib);
                    if (this.xg != null) {
                        this.xg.c1();
                    }
                    {
                        this.rm(false);
                    }
                    this.qg();
                    break;
                case "TransitionProgress":
                    this.w3.c(this.jo, this.w1, this.wz);
                    if (this.d3(this.ct)) {
                        return;
                    }
                    if (this.jo == 1) {
                        this.wz.w();
                        this.z5(this.wz, this.xe);
                        if (this.gz) {
                            this.gz = false;
                            this.o3();
                            this.da.r = truncate(this.i7());
                            this.da.b = this.db;
                        }
                        if (this.g2) {
                            this.g2 = false;
                            this.o3();
                            this.da.r = truncate(this.i7());
                            this.da.b = this.db;
                            this.qv();
                        }
                        this.qj();
                    }
                    else {
                        this.z5(this.w3, this.xe);
                    }
                    if (this.c9 != null) {
                        this.c9.qa(this);
                    }
                    break;
                case FinancialSeries.$$p[10]:
                    this.rm(false);
                    break;
                case "IsCustomCategoryStyleAllowed":
                    this.xy = this.x1();
                    this.rm(false);
                    break;
                case "CategoryMode":
                    if (this.wx != null) {
                        this.wx.l7(true);
                    }
                    break;
            }
        }
        x0(a) {
            if (typeCast(NumericYAxis.$, a) !== null) {
                return true;
            }
            return false;
        }
        xz(a) {
            if (typeCast(CategoryXAxis.$, a) !== null || a.ce) {
                return true;
            }
            return false;
        }
        wq(a, b, c) {
            if (b < a || a < 0 || a > this.dl.count || b < 0 || b > this.dl.count || c == null) {
                return null;
            }
            let d = new Array((b - a) + 1);
            let e = c.cn;
            let f = null;
            if (e) {
                f = c.i$b;
            }
            for (let g = a; g <= b; g++) {
                let h = g;
                if (e) {
                    h = f._inner[h];
                }
                d[g - a] = this.dl.item(g);
            }
            return d;
        }
        yu(a) {
            return a.b0.b;
        }
        yw(a) {
            return a.b0.c;
        }
        wp(a, b) {
            return this.wq(a, b, this.xg);
        }
        get_fc() {
            return true;
        }
        o0() {
            super.o0();
            this.xk = null;
        }
        de(a, b, c) {
            if (this.eb && this.fx(this.bv) && !c) {
                let d = this.xj(a, b, this.xk);
                this.xk = d;
                return d;
            }
            else {
                let e = this.xi(a, b, this.xk);
                this.xk = e;
                return e;
            }
        }
        yy(a) {
            let b = this.w0();
            let c = this.ct.bx;
            let d = this.ct.by;
            let e = this.wx;
            let f = 0;
            if (e.cp) {
                let g = (a.y - d.top) / d.height;
                f = g * c.height + c.top;
            }
            else {
                let h = (a.x - d.left) / d.width;
                f = h * c.width + c.left;
            }
            let i = b.f.count;
            let j = 0;
            for (j = 0; j < i; j++) {
                let k = b.f._inner[j];
                let l = null;
                if (j < i - 1) {
                    l = b.f._inner[j + 1];
                }
                if (k[0] <= f && l == null || l[0] >= f) {
                    if (l != null) {
                        if (Math.abs(k[0] - f) < Math.abs(l[0] - f)) {
                            return j;
                        }
                        else {
                            return j + 1;
                        }
                    }
                    else {
                        return j;
                    }
                }
            }
            return j;
        }
        xj(a, b, c) {
            if (this.dl == null) {
                return null;
            }
            let d = this.dl.count;
            let e = this.xe.b0.c;
            let f = this.xe.b0.d;
            let g = this.xe.b0.b;
            let h = this.wx;
            let i = -1;
            let j = -1;
            if (h.cn) {
                let k = this.w0();
                let l = this.yy(b);
                if (k.m != null && l >= 0 && l < k.m.count) {
                    l = truncate(Math.round(k.m._inner[l]));
                }
                i = l;
                j = l;
            }
            else {
                let m = this.j1(b);
                i = truncate(Math.floor((intDivide(m, g)))) * g;
                j = i + (g - 1);
            }
            if (c != null && c.g == i && c.f == j) {
                return c;
            }
            let n = new HighlightingInfo();
            n.i = this;
            n.g = i;
            n.f = j;
            return n;
        }
        xi(a, b, c) {
            let d = new HighlightingInfo();
            d.i = this;
            d.g = 0;
            d.f = this.dl.count - 1;
            d.c = true;
            if (c != null && c.g == d.g && c.f == d.f) {
                return c;
            }
            return d;
        }
        x1() {
            return this.x3;
        }
        ip(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = -1;
            if (!b.isEmpty && !c.isEmpty && this.wx != null) {
                let e = this.getEffectiveViewport1(this.ct);
                let f = new ScalerParams(0, b, c, this.wx.ch, e);
                let g = this.wc(this.ct);
                let h = this.wx.en(g.left, f);
                let i = this.wx.en(g.right, f);
                let j = (a.x - b.left) / b.width;
                let k = h + (j * (i - h));
                if (this.wx.categoryMode != 0) {
                    k -= 0.5;
                }
                d = k;
            }
            return d;
        }
        j1(a) {
            return truncate(Math.round(this.ip(a)));
        }
        get_fq() {
            return typeCast(ISortingAxis_$type, this.wx) !== null;
        }
        az() {
            return this.wx;
        }
        j3(a) {
            let b = this.ct.by;
            let c = this.ct.bx;
            let d = this.getEffectiveViewport1(this.ct);
            if (b.isEmpty || c.isEmpty) {
                return -1;
            }
            let e = new Rect(0, 0, 0, 1, 1);
            let f = new ScalerParams(0, b, c, this.wx.ch, d);
            let g = typeCast(ISortingAxis_$type, this.wx);
            let h = this.wc(this.ct);
            let i = h.left;
            let j = h.right;
            let k = this.v0(a).x;
            let l = this.wx.en(k, f);
            let m = this.wx.en(i, f);
            let n = this.wx.en(j, f);
            l = Math.max(m, Math.min(n, l));
            let o = g.i$f(l);
            return o;
        }
        kl(a) {
            let b = 0;
            if (typeCast(ISortingAxis_$type, this.wx) !== null) {
                b = this.j3(a);
                if (b == -1) {
                    return null;
                }
            }
            else {
                b = this.j1(a);
            }
            return b >= 0 && this.dl != null && b < this.dl.count ? this.dl.item(b) : null;
        }
        w0() {
            let a = this.wz;
            if (this.d1()) {
                if (this.da.g) {
                    this.da.t();
                }
                a = this.w3;
            }
            return a;
        }
        yo(a, b, c) {
            if (this.wx == null) {
                return 0;
            }
            return this.wx.k6(a, b, c, this.index);
        }
        gl() {
            return this.x4;
        }
        w7() {
            return 11;
        }
        c2() {
            return 3;
        }
        c5() {
            return 3;
        }
        z5(a, b) {
            this.qs();
            this.wb = a.ab;
            b.aw();
        }
        z3(a, b) {
            a.v();
        }
        hc(a, b, c) {
            let d = super.hc(a, b, c);
            let e = c;
            if (this.dl == null || this.dl.count == 0 || !c.o() || b.isEmpty || a.isEmpty || this.wx == null || this.xg == null || e.b0.b < 1 || this.wx.bi == null || this.xg.bi == null || this.xg.ly == this.xg.lx || this.wx.itemsSource == null || this.wx.lg < 1) {
                e.b0.b = 0;
                d = false;
            }
            return d;
        }
        getViewInfo(a, b) {
            b = this.ct.by;
            a = this.ct.bx;
            return {
                p0: a,
                p1: b
            };
        }
        ys(a) {
            let b = 0;
            let c = a.by;
            let d = a.bx;
            let e = this.getEffectiveViewport1(this.ct);
            if (!c.isEmpty && !d.isEmpty && this.xg != null) {
                let f = new ScalerParams(0, c, d, this.xg.ch, e);
                f.b = this.iw();
                b = this.xg.ek(this.xg.l8, f);
            }
            return b;
        }
        o3() {
            super.o3();
            this.w1.w();
            this.wz.w();
            this.w3.w();
        }
        rn(a) {
            super.rn(a);
            this.xe.b0.e(this.ib);
            if (this.d3(this.ct)) {
                return;
            }
            if (this.gp) {
                if (this.d1()) {
                    this.z5(this.w3, this.xe);
                }
                else {
                    this.z5(this.wz, this.xe);
                }
                return;
            }
            if (this.gd(a)) {
                let b = this.w1;
                if (this.d1()) {
                    if (this.da.g) {
                        this.da.t();
                    }
                    this.w1 = this.w3;
                    this.w3 = b;
                }
                else {
                    this.w1 = this.wz;
                    this.wz = b;
                }
                this.z3(this.wz, this.xe);
                let c = false;
                if (this.g1) {
                    this.da.w();
                    this.da.r = truncate(this.i8());
                    this.da.b = this.dc != null ? this.dc : this.db;
                    if (this.g2) {
                        let d = this.w3;
                        this.w3 = this.w1;
                        this.w1 = d;
                        c = true;
                    }
                    this.w9.s(this, this.w1, this.wz, this.isVertical, this.wx, this.xg, this.w8, this.w7(), this.c3, this.c2(), () => this.ys(this.xe), this.xe.bx);
                    if (this.g2) {
                        let e = this.w3;
                        this.w3 = this.w1;
                        this.w1 = e;
                    }
                    this.g2 = false;
                }
                if (this.g4) {
                    this.da.w();
                    this.da.r = truncate(this.i9());
                    this.da.b = this.dd != null ? this.dd : this.db;
                    if (this.gz) {
                        let f = this.w3;
                        this.w3 = this.w1;
                        this.w1 = f;
                        c = true;
                    }
                    this.w9.s(this, this.w1, this.wz, this.isVertical, this.wx, this.xg, this.w8, this.w7(), this.c3, this.c2(), () => this.ys(this.xe), this.xe.bx);
                    let g = this.wz;
                    this.wz = this.w1;
                    this.w1 = g;
                    if (this.gz) {
                        let h = this.w3;
                        this.w3 = this.w1;
                        this.w1 = h;
                    }
                    this.gz = false;
                }
                this.d7 = false;
                if (!c) {
                    this.oy();
                }
                this.r0();
                if (this.g1) {
                    this.g0 = false;
                    this.g3 = false;
                    this.gi = false;
                    this.gz = true;
                }
                if (this.g4) {
                    this.g3 = false;
                    this.g2 = true;
                }
            }
            else {
                this.z3(this.wz, this.xe);
                this.z5(this.wz, this.xe);
            }
        }
        gm() {
            return true;
        }
        x6(a) {
            for (let b of fromEnum(a)) {
                switch (b) {
                    case "HighColumn":
                        if (this.xr == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.xs == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.xt == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.xq == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.xv == null) {
                            return false;
                        }
                        break;
                }
            }
            return true;
        }
        get x7() {
            return this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null;
        }
        x2() {
            return this.typical != null;
        }
        zv(a) {
            this.typical(this, a);
        }
        get yf() {
            return this.yc();
        }
        *_yc() {
            let a = false;
            if (this.x2()) {
                let b = this.xa(0, this.dl.count);
                this.zv(new FinancialEventArgs(0, this.dl.count, b, this.xb(b), this));
                if (b.typicalColumn != null) {
                    a = true;
                    for (let c of fromEnum(b.typicalColumn)) {
                        yield c;
                    }
                }
            }
            if (!a) {
                if (this.x7 && this.wx.i$b != null) {
                    let d = this.dl.count;
                    let e = this.wx.i$b;
                    for (let f = 0; f < d; ++f) {
                        yield (this.xr.item(e.item(f)) + this.xs.item(e.item(f)) + this.xq.item(e.item(f))) / 3;
                    }
                }
                else {
                    let g = this.dl.count;
                    for (let h = 0; h < g; ++h) {
                        yield (this.xr.item(h) + this.xs.item(h) + this.xq.item(h)) / 3;
                    }
                }
            }
        }
        yc() {
            return toEnum(() => this._yc());
        }
        get ye() {
            return this.yb();
        }
        *_yb() {
            if (this.x7 && this.wx.i$b != null) {
                let a = this.xr.count;
                let b = this.wx.i$b;
                if (a > 0) {
                    yield this.yt(this.xr.item(b.item(0)) - this.xs.item(b.item(0)));
                }
                for (let c = 1; c < a; ++c) {
                    yield Math.max(this.yt(this.xr.item(b.item(c)) - this.xs.item(b.item(c))), Math.max(this.yt(Math.abs(this.xr.item(b.item(c)) - this.xq.item(b.item(c - 1)))), this.yt(Math.abs(this.xs.item(b.item(c)) - this.xq.item(b.item(c - 1))))));
                }
            }
            else {
                let d = this.xr.count;
                if (d > 0) {
                    yield this.yt(this.xr.item(0) - this.xs.item(0));
                }
                for (let e = 1; e < d; ++e) {
                    yield Math.max(this.yt(this.xr.item(e) - this.xs.item(e)), Math.max(this.yt(Math.abs(this.xr.item(e) - this.xq.item(e - 1))), this.yt(Math.abs(this.xs.item(e) - this.xq.item(e - 1)))));
                }
            }
        }
        yb() {
            return toEnum(() => this._yb());
        }
        get yd() {
            return this.ya();
        }
        *_ya() {
            if (this.x7 && this.wx.i$b != null) {
                let a = this.xs.count;
                let b = this.wx.i$b;
                if (a > 0) {
                    yield this.yt(this.xs.item(b.item(0)));
                }
                for (let c = 1; c < a; c++) {
                    yield Math.min(this.yt(this.xs.item(b.item(c))), this.yt(this.xq.item(b.item(c - 1))));
                }
            }
            else {
                let d = this.xs.count;
                if (d > 0) {
                    yield this.yt(this.xs.item(0));
                }
                for (let e = 1; e < d; e++) {
                    yield Math.min(this.yt(this.xs.item(e)), this.yt(this.xq.item(e - 1)));
                }
            }
        }
        ya() {
            return toEnum(() => this._ya());
        }
        yh(a) {
            if (a == null) {
                return null;
            }
            if (this.x7 && this.wx.i$b != null) {
                return new SafeSortedReadOnlyDoubleCollection(0, a, this.wx.i$b);
            }
            return new SafeReadOnlyDoubleCollection(0, a);
        }
        yg() {
            let a = new List$1(String_$type, 0);
            a.add("HighColumn");
            a.add("LowColumn");
            a.add("CloseColumn");
            if (this.typicalBasedOn != null && this.dl != null && !this.xw) {
                this.xw = true;
                let b = this.xa(0, this.dl.count);
                this.xw = false;
                let c = new FinancialEventArgs(0, this.dl.count, b, this.xb(b), this);
                this.typicalBasedOn(this, c);
                if (c.basedOn != null && c.basedOn.count > 0) {
                    return c.basedOn;
                }
            }
            return a;
        }
        getOpenColumnAsArray() {
            if (this.xt == null) {
                return null;
            }
            if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
                if (this.yl != null) {
                    return this.yl.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xt.count);
                let b = this.wx.i$b;
                let c = this.xt.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yl = a;
                return this.yl.asArray();
            }
            else {
                return this.xt.asArray();
            }
        }
        getHighColumnAsArray() {
            if (this.xr == null) {
                return null;
            }
            if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
                if (this.yj != null) {
                    return this.yj.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xr.count);
                let b = this.wx.i$b;
                let c = this.xr.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yj = a;
                return this.yj.asArray();
            }
            else {
                return this.xr.asArray();
            }
        }
        getLowColumnAsArray() {
            if (this.xs == null) {
                return null;
            }
            if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
                if (this.yk != null) {
                    return this.yk.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xs.count);
                let b = this.wx.i$b;
                let c = this.xs.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yk = a;
                return this.yk.asArray();
            }
            else {
                return this.xs.asArray();
            }
        }
        getCloseColumnAsArray() {
            if (this.xq == null) {
                return null;
            }
            if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
                if (this.yi != null) {
                    return this.yi.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xq.count);
                let b = this.wx.i$b;
                let c = this.xq.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.yi = a;
                return this.yi.asArray();
            }
            else {
                return this.xq.asArray();
            }
        }
        getVolumeColumnAsArray() {
            if (this.xv == null) {
                return null;
            }
            if (this.wx != null && typeCast(ISortingAxis_$type, this.wx) !== null) {
                if (this.ym != null) {
                    return this.ym.asArray();
                }
                let a = new List$1(Number_$type, 2, this.xv.count);
                let b = this.wx.i$b;
                let c = this.xv.asArray();
                for (let d = 0; d < b.count; d++) {
                    a.add(c[b._inner[d]]);
                }
                this.ym = a;
                return this.ym.asArray();
            }
            else {
                return this.xv.asArray();
            }
        }
        o8(a, b, c, d) {
            super.o8(a, b, c, d);
            if (this.wx == null || !(typeCast(ISortingAxis_$type, this.wx) !== null)) {
                return;
            }
            let e = this.wx.i$b;
            switch (a) {
                case 1:
                    for (let f = b; f < c; f++) {
                        let g = e._inner[f];
                        if (this.yl != null) {
                            this.yl.insert(f, this.xt.item(g));
                        }
                        if (this.yj != null) {
                            this.yj.insert(f, this.xr.item(g));
                        }
                        if (this.yk != null) {
                            this.yk.insert(f, this.xs.item(g));
                        }
                        if (this.yi != null) {
                            this.yi.insert(f, this.xq.item(g));
                        }
                        if (this.ym != null) {
                            this.ym.insert(f, this.xv.item(g));
                        }
                    }
                    break;
                case 0:
                    if (this.yl != null) {
                        this.yl.v(b, c);
                    }
                    if (this.yj != null) {
                        this.yj.v(b, c);
                    }
                    if (this.yk != null) {
                        this.yk.v(b, c);
                    }
                    if (this.yi != null) {
                        this.yi.v(b, c);
                    }
                    if (this.ym != null) {
                        this.ym.v(b, c);
                    }
                    break;
                case 4:
                    if (this.yl != null) {
                        this.yl = new List$1(Number_$type, 0);
                    }
                    if (this.yj != null) {
                        this.yj = new List$1(Number_$type, 0);
                    }
                    if (this.yk != null) {
                        this.yk = new List$1(Number_$type, 0);
                    }
                    if (this.yi != null) {
                        this.yi = new List$1(Number_$type, 0);
                    }
                    if (this.ym != null) {
                        this.ym = new List$1(Number_$type, 0);
                    }
                    break;
                case 3:
                case 2:
                    for (let h = b; h < c; h++) {
                        let i = e._inner[h];
                        if (this.yl != null) {
                            this.yl._inner[h] = this.xt.item(i);
                        }
                        if (this.yj != null) {
                            this.yj._inner[h] = this.xr.item(i);
                        }
                        if (this.yk != null) {
                            this.yk._inner[h] = this.xs.item(i);
                        }
                        if (this.yi != null) {
                            this.yi._inner[h] = this.xq.item(i);
                        }
                        if (this.ym != null) {
                            this.ym._inner[h] = this.xv.item(i);
                        }
                    }
                    break;
            }
            this.z6();
            this.sg();
        }
        xa(a, b) {
            let c = this.yh(this.xt);
            let d = this.yh(this.xq);
            let e = this.yh(this.xr);
            let f = this.yh(this.xs);
            let g = this.yh(this.xv);
            let h = ((() => {
                let $ret = new FinancialCalculationDataSource();
                $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.yf), this.yg());
                $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.ye), ((() => {
                    let $ret = new List$1(String_$type, 0);
                    $ret.add("HighColumn");
                    $ret.add("LowColumn");
                    $ret.add("CloseColumn");
                    return $ret;
                })()));
                $ret.trueLow = new CalculatedColumn(1, new SafeEnumerable(this.yd), ((() => {
                    let $ret = new List$1(String_$type, 0);
                    $ret.add("LowColumn");
                    $ret.add("CloseColumn");
                    return $ret;
                })()));
                $ret.openColumn = c;
                $ret.closeColumn = d;
                $ret.highColumn = e;
                $ret.lowColumn = f;
                $ret.volumeColumn = g;
                $ret.calculateFrom = a;
                $ret.calculateCount = b;
                $ret.minimumValue = NaN;
                $ret.maximumValue = NaN;
                $ret.count = this.dl != null ? this.dl.count : 0;
                return $ret;
            })());
            return h;
        }
        yt(a) {
            if (isInfinity(a) || isNaN_(a)) {
                return 0;
            }
            return a;
        }
        xb(a) {
            return ((() => {
                let $ret = new FinancialCalculationSupportingCalculations();
                $ret.a = new ColumnSupportingCalculation(1, TrendCalculators.b, new List$1(String_$type, 0));
                $ret.c = new ColumnSupportingCalculation(1, TrendCalculators.e, new List$1(String_$type, 0));
                $ret.d = new ColumnSupportingCalculation(1, TrendCalculators.f, new List$1(String_$type, 0));
                $ret.b = new ColumnSupportingCalculation(1, TrendCalculators.d, new List$1(String_$type, 0));
                $ret.h = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.volumeColumn, b.shortPeriod), ((() => {
                    let $ret = new List$1(String_$type, 0);
                    $ret.add("VolumeColumn");
                    return $ret;
                })()));
                $ret.f = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.volumeColumn, b.longPeriod), ((() => {
                    let $ret = new List$1(String_$type, 0);
                    $ret.add("VolumeColumn");
                    return $ret;
                })()));
                $ret.g = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.shortPeriod), a.typicalColumn.basedOn);
                $ret.e = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.longPeriod), a.typicalColumn.basedOn);
                $ret.k = Series.ho;
                $ret.j = Series.hn;
                $ret.i = runOn(this, this.yt);
                return $ret;
            })());
        }
        get categoryAxis() {
            return this.wx;
        }
        ro(a, b) {
            super.ro(a, b);
            if (!this.gy) {
                this.ct.a4(b);
                return;
            }
            let c = typeCast(FinancialSeriesView.$, this.cs);
            this.ct.a4(b);
            c.b0.e(this.ib);
            if (this.d3(this.cs)) {
                return;
            }
            if (!this.gq) {
                this.z3(this.w2, c);
            }
            this.gq = false;
            this.z5(this.w2, c);
            this.gy = false;
        }
        rl(a, b, c, d, e) {
            super.rl(a, b, c, d, e);
            let f = this.a9.a$j.item(d);
            let g = f;
            g.b0.e(this.ib);
            f.a3(c);
            if (this.d3(g)) {
                return;
            }
            if (this.wy == null) {
                this.wy = new CategoryFrame(3);
            }
            this.wy.v();
            this.z3(this.wy, g);
            this.z5(this.wy, g);
        }
        av(a) {
            if (this.wx == a) {
                return this.xg;
            }
            if (this.xg == a) {
                return this.wx;
            }
            return null;
        }
        preferredCategoryMode(a) {
            let b = typeCast(IDateTimeAxis_$type, this.wx);
            return b != null ? b.preferredCategoryMode(this) : this.w5;
        }
        get w5() {
            return this.w4;
        }
        set w5(a) {
            let b = this.w5;
            if (a != b) {
                this.w4 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.w5));
            }
        }
        get_fk() {
            return true;
        }
        rw(a, b) {
            super.rw(a, b);
            this.aan = a;
        }
        z6() {
            this.ik = this.xq == null || this.xq.count == 0 ? NaN : this.xq.item(this.xq.count - 1);
        }
        kn(a) {
            if (this.xf != null && a != null) {
                if (this.xh == null || this.xh.propertyName != this.xf.dateTimeMemberPath) {
                    this.xh = new FastReflectionHelper(false, this.xf.dateTimeMemberPath);
                }
                let b = this.xh.getPropertyValue(a);
                if (typeCast(Date_$type, b) !== null) {
                    return dateToStringFormat(b, this.xf.itemLabelFormat());
                }
            }
            return super.kn(a);
        }
    }
    FinancialSeries.$t = /*@__PURE__*/ markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = /*@__PURE__*/ markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:y1:z7', [2, null], 'HighMemberPath:ze:aad', [2, null], 'HighlightedCloseMemberPath:y4:z8', [2, null], 'HighlightedHighMemberPath:y6:z9', [2, null], 'HighlightedLowMemberPath:y8:aaa', [2, null], 'HighlightedOpenMemberPath:za:aab', [2, null], 'HighlightedVolumeMemberPath:zc:aac', [2, null], 'IsCustomCategoryStyleAllowed:x3:aae', [0, false], 'IsTransitionInEnabled:x4:aaf', [0, false], 'LowMemberPath:zj:aag', [2, null], 'NegativeBrush:aan:aah', [Brush.$, null], 'OpenMemberPath:zn:aai', [2, null], 'TransitionInMode:w8:aaj', [CategoryTransitionInMode_$type, /*@__PURE__*/ enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:zr:aak', [2, null], 'XAxis:wx:aal', [CategoryAxisBase.$, null], 'YAxis:xg:aam', [NumericYAxis.$, null]]);
    return FinancialSeries;
})();
/**
 * @hidden
 */
export let FinancialCalculationSupportingCalculations = /*@__PURE__*/ (() => {
    class FinancialCalculationSupportingCalculations extends Base {
        constructor() {
            super(...arguments);
            this.a = null;
            this.c = null;
            this.d = null;
            this.b = null;
            this.h = null;
            this.f = null;
            this.g = null;
            this.e = null;
            this.k = null;
            this.j = null;
            this.i = null;
        }
    }
    FinancialCalculationSupportingCalculations.$t = /*@__PURE__*/ markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
})();
/**
 * @hidden
 */
export let DataSourceSupportingCalculation = /*@__PURE__*/ (() => {
    class DataSourceSupportingCalculation extends SupportingCalculation$1 {
        constructor(a, ..._rest) {
            a = (a == void 0) ? 0 : a;
            switch (a) {
                case 0:
                    {
                        let c = _rest[0];
                        super(Delegate_$type, 0, c);
                    }
                    break;
                case 1:
                    {
                        let c = _rest[0];
                        let d = _rest[1];
                        super(Delegate_$type, 1, c, d);
                    }
                    break;
            }
        }
    }
    DataSourceSupportingCalculation.$t = /*@__PURE__*/ markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', /*@__PURE__*/ SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
})();
/**
 * @hidden
 */
export let FinancialCalculationDataSource = /*@__PURE__*/ (() => {
    class FinancialCalculationDataSource extends Base {
        constructor() {
            super(...arguments);
            this._openColumn = null;
            this._closeColumn = null;
            this._highColumn = null;
            this._lowColumn = null;
            this._volumeColumn = null;
            this._indicatorColumn = null;
            this._typicalColumn = null;
            this._trueRange = null;
            this._trueLow = null;
            this._period = 0;
            this._shortPeriod = 0;
            this._longPeriod = 0;
            this._count = 0;
            this._calculateFrom = 0;
            this._calculateCount = 0;
            this._multiplier = 0;
            this._minimumValue = 0;
            this._maximumValue = 0;
            this._specifiesRange = false;
            this._series = null;
        }
        get openColumn() {
            return this._openColumn;
        }
        set openColumn(a) {
            this._openColumn = a;
        }
        get closeColumn() {
            return this._closeColumn;
        }
        set closeColumn(a) {
            this._closeColumn = a;
        }
        get highColumn() {
            return this._highColumn;
        }
        set highColumn(a) {
            this._highColumn = a;
        }
        get lowColumn() {
            return this._lowColumn;
        }
        set lowColumn(a) {
            this._lowColumn = a;
        }
        get volumeColumn() {
            return this._volumeColumn;
        }
        set volumeColumn(a) {
            this._volumeColumn = a;
        }
        get indicatorColumn() {
            return this._indicatorColumn;
        }
        set indicatorColumn(a) {
            this._indicatorColumn = a;
        }
        get typicalColumn() {
            return this._typicalColumn;
        }
        set typicalColumn(a) {
            this._typicalColumn = a;
        }
        get trueRange() {
            return this._trueRange;
        }
        set trueRange(a) {
            this._trueRange = a;
        }
        get trueLow() {
            return this._trueLow;
        }
        set trueLow(a) {
            this._trueLow = a;
        }
        get period() {
            return this._period;
        }
        set period(a) {
            this._period = a;
        }
        get shortPeriod() {
            return this._shortPeriod;
        }
        set shortPeriod(a) {
            this._shortPeriod = a;
        }
        get longPeriod() {
            return this._longPeriod;
        }
        set longPeriod(a) {
            this._longPeriod = a;
        }
        get count() {
            return this._count;
        }
        set count(a) {
            this._count = a;
        }
        get calculateFrom() {
            return this._calculateFrom;
        }
        set calculateFrom(a) {
            this._calculateFrom = a;
        }
        get calculateCount() {
            return this._calculateCount;
        }
        set calculateCount(a) {
            this._calculateCount = a;
        }
        get multiplier() {
            return this._multiplier;
        }
        set multiplier(a) {
            this._multiplier = a;
        }
        get minimumValue() {
            return this._minimumValue;
        }
        set minimumValue(a) {
            this._minimumValue = a;
        }
        get maximumValue() {
            return this._maximumValue;
        }
        set maximumValue(a) {
            this._maximumValue = a;
        }
        get specifiesRange() {
            return this._specifiesRange;
        }
        set specifiesRange(a) {
            this._specifiesRange = a;
        }
        get series() {
            return this._series;
        }
        set series(a) {
            this._series = a;
        }
    }
    FinancialCalculationDataSource.$t = /*@__PURE__*/ markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
})();
/**
 * @hidden
 */
export let FinancialSeriesView = /*@__PURE__*/ (() => {
    class FinancialSeriesView extends SeriesView {
        b3(a) {
            if (this.b4 != a.u) {
                return true;
            }
            return false;
        }
        b5(a) {
            this.b4 = a.u;
        }
        constructor(a) {
            super(a);
            this.b2 = null;
            this.b0 = null;
            this.b4 = 0;
            this.b4 = -1;
            this.b2 = a;
            this.b0 = this.b1();
        }
        au() {
            super.au();
            if (!this.q) {
            }
        }
        getDefaultTooltipTemplate() {
            let a = "<div class='ui-chart-default-tooltip-content'>";
            if (this.b2.wx.ce) {
                a += "<span>${itemLabel}</span><br/>";
            }
            else if (this.b2.wx.f1 != null) {
                a += "<span>${item." + this.b2.wx.f1 + "}</span><br/>";
            }
            a += "<span class='ui-priority-primary'";
            let b = this.e.a9.a$u(this.e);
            if (!stringIsNullOrEmpty(b)) {
                a += " style='color:" + b + "'";
            }
            let c = new SRProvider(this.w);
            let d = c.b1("financialSeries_Open");
            let e = c.b1("financialSeries_High");
            let f = c.b1("financialSeries_Low");
            let g = c.b1("financialSeries_Close");
            d = stringIsNullOrEmpty(d) ? "Open" : d;
            e = stringIsNullOrEmpty(e) ? "High" : e;
            f = stringIsNullOrEmpty(f) ? "Low" : f;
            g = stringIsNullOrEmpty(g) ? "Close" : g;
            a += ">" + this.b2.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.b2.zn + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.b2.ze + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.b2.zj + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.b2.y1 + "}</td></tr>";
            if (!stringIsNullOrEmpty(this.b2.zr)) {
                let h = c.b1("financialSeries_Volume");
                h = stringIsNullOrEmpty(h) ? "Volume" : h;
                a += "<tr><td>" + h + ":</td><td>" + "${item." + this.b2.zr + "}</td></tr>";
            }
            a += "</table></div>";
            return a;
        }
        af() {
            let a = new Color();
            a.colorString = "rgba(95,95,95,0.5)";
            this.e.vu = a;
            this.e.jk = 5;
            this.e.jl = 2;
            this.e.jm = 2;
        }
    }
    FinancialSeriesView.$t = /*@__PURE__*/ markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
})();
