/*
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 * as tslib_1 from "tslib";
import { EventArgs, Base, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, 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 "./HighlightingInfo";
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 { 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
 */
var FinancialEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialEventArgs, _super);
    function FinancialEventArgs(a, b, c, d, e) {
        var _this = _super.call(this) || this;
        _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;
        }
        return _this;
    }
    Object.defineProperty(FinancialEventArgs.prototype, "position", {
        get: function () {
            return this._position;
        },
        set: function (a) {
            this._position = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "supportingCalculations", {
        get: function () {
            return this._supportingCalculations;
        },
        set: function (a) {
            this._supportingCalculations = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "basedOn", {
        get: function () {
            return this._basedOn;
        },
        set: function (a) {
            this._basedOn = a;
        },
        enumerable: true,
        configurable: true
    });
    FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
}(EventArgs));
export { FinancialEventArgs };
/**
 * @hidden
 */
var FinancialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialBucketCalculator, _super);
    function FinancialBucketCalculator(a) {
        var _this = _super.call(this) || this;
        _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;
        return _this;
    }
    FinancialBucketCalculator.prototype.getBucket = function (a) {
        return null;
    };
    FinancialBucketCalculator.prototype.getBucketWithoutUnknowns = function (a) {
        return this.getBucket(a);
    };
    FinancialBucketCalculator.prototype.getErrorBucket = function (a, b) {
        return NaN;
    };
    FinancialBucketCalculator.prototype.getBucketInfo = function (a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.bw.eu;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.bs;
        var c = this.a.br;
        var d = this.a.br;
        if (this.a.bw != null) {
            d = this.a.bw.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bw.mi == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bw.mi != null) ? this.a.bw.mi.ca : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bw.l0(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bw.mi);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bw.mi.d1(g.left, f));
            var j = Math.ceil(this.a.bw.mi.d1(g.right, f));
            if (this.a.bw.mi.ca) {
                j = Math.ceil(this.a.bw.mi.d1(g.left, f));
                i = Math.floor(this.a.bw.mi.d1(g.right, f));
            }
            var 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;
        }
    };
    FinancialBucketCalculator.prototype.cacheValues = function () {
    };
    FinancialBucketCalculator.prototype.unCacheValues = function () {
    };
    FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
}(Base));
export { FinancialBucketCalculator };
/**
 * @hidden
 */
var FinancialSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.m8 = null;
        _this.m6 = null;
        _this.m7 = null;
        _this.m5 = null;
        _this.m9 = null;
        _this.ni = false;
        _this.assigningCategoryStyle = null;
        _this.mq = null;
        _this.nt = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.nu = new Dictionary$2(String_$type, String_$type, 0);
        _this.nh = false;
        _this.m1 = null;
        _this.ml = null;
        _this.mn = null;
        _this.mk = null;
        _this.mt = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.ng = false;
        _this.n6 = null;
        _this.n4 = null;
        _this.n5 = null;
        _this.n3 = null;
        _this.n7 = null;
        _this.mm = null;
        _this.mj = null;
        _this.mo = 0;
        _this.m2 = null;
        _this.m4 = null;
        _this.mq = new CategorySeriesRenderManager();
        _this.ni = false;
        _this.mt = new CategoryTransitionSourceFramePreparer();
        _this.mm = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.mp = 0;
        return _this;
    }
    FinancialSeries.prototype.i2 = function (a) {
        _super.prototype.i2.call(this, a);
        this.my = a;
    };
    FinancialSeries.prototype.get_cr = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.mi, this.m3];
    };
    FinancialSeries.prototype.fs = function (a, b) {
        var c = this.g2(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.ft(a, b, this.oy);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.ft(a, b, this.op);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.ft(a, b, this.ou);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.ft(a, b, this.om);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.ft(a, b, this.o2);
        }
        return _super.prototype.fs.call(this, a, b);
    };
    FinancialSeries.prototype.oi = function () {
        return 2;
    };
    FinancialSeries.prototype.og = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.mi, this.mk.f, this.of(this.bi), this.oh(this.bi), this.ly(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var f = new Array(2);
        var g = this.oi();
        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;
    };
    FinancialSeries.prototype.ai = function (a) {
        var b = this.aj(this.mi, this.mk.f, this.of(this.bi), this.oh(this.bi), this.ly(a), true);
        if (b == null) {
            return null;
        }
        var c = b[0];
        var d = b[1];
        var e = new Array(1);
        var 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;
    };
    FinancialSeries.prototype.lj = function () {
        return this.po;
    };
    FinancialSeries.prototype.h1 = function () {
        _super.prototype.h1.call(this);
        this.mi = null;
        this.m3 = null;
    };
    Object.defineProperty(FinancialSeries.prototype, "nd", {
        get: function () {
            return this.m8;
        },
        set: function (a) {
            if (this.m8 != a) {
                var b = this.m8;
                this.m8 = a;
                this.raisePropertyChanged("OpenColumn", b, this.m8);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "nb", {
        get: function () {
            return this.m6;
        },
        set: function (a) {
            if (this.m6 != a) {
                var b = this.m6;
                this.m6 = a;
                this.raisePropertyChanged("HighColumn", b, this.m6);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "nc", {
        get: function () {
            return this.m7;
        },
        set: function (a) {
            if (this.m7 != a) {
                var b = this.m7;
                this.m7 = a;
                this.raisePropertyChanged("LowColumn", b, this.m7);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "na", {
        get: function () {
            return this.m5;
        },
        set: function (a) {
            if (this.m5 != a) {
                var b = this.m5;
                this.m5 = a;
                this.raisePropertyChanged("CloseColumn", b, this.m5);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "nf", {
        get: function () {
            return this.m9;
        },
        set: function (a) {
            if (this.m9 != a) {
                var b = this.m9;
                this.m9 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.m9);
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.nq = function () {
        return (this.assigningCategoryStyle != null && this.ni) || this.cu;
    };
    FinancialSeries.prototype.pa = function (a) {
        if (this.assigningCategoryStyle != null && this.ni) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.o8 = function (a, b, c, d, e, f) {
        var g = this.b9;
        this.mq.ac(a, b, c, d, e, f, g);
        var h = this.mq.c;
        var i = null;
        var j = this.bz;
        if (g && this.bs != null) {
            i = this.bs.az.getHighlightingInfo(this, j, d, h.m, h.l, false);
            h.b = i;
        }
        h.f = f;
        this.pa(h);
        this.mq.aa(i, f, g);
    };
    FinancialSeries.prototype.n8 = function (a) {
        return this.ed(a, this.mi);
    };
    FinancialSeries.prototype.fe = function (a, b) {
        return this.ff(a, b, this.mi, runOn(this, this.n8), new FinancialValueList(this.nd, this.nb, this.nc, this.na, this.nf));
    };
    FinancialSeries.prototype.fc = function (a, b) {
        return this.fd(a, b, this.mi, runOn(this, this.n8), new FinancialValueList(this.nd, this.nb, this.nc, this.na, this.nf));
    };
    FinancialSeries.prototype.d9 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.mi.j7;
        return this.ea(a, b, this.mi, d, e, f, runOn(this, this.n8));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.mi.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.lv = function (a, b, c) {
        return this.lx(a, b, c, this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.m3, this.mi, null, null, null);
    };
    FinancialSeries.prototype.en = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.n9(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.mi.ca, d);
        return this.ep(new FinancialValueList(this.nd, this.nb, this.nc, this.na, this.nf), a, this.mi, f, e, runOn(this, this.n8), b, c);
    };
    FinancialSeries.prototype.ej = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.n9(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.mi.ca, d);
        return this.ep(this.nb, a, this.mi, f, e, runOn(this, this.n8), b, c);
    };
    FinancialSeries.prototype.el = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.n9(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.mi.ca, d);
        return this.ep(this.nc, a, this.mi, f, e, runOn(this, this.n8), b, c);
    };
    FinancialSeries.prototype.oa = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.n9(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.mi.ca, d);
        return this.ep(this.na, a, this.mi, f, e, runOn(this, this.n8), b, c);
    };
    FinancialSeries.prototype.ob = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.n9(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.mi.ca, d);
        return this.ep(this.nd, a, this.mi, f, e, runOn(this, this.n8), b, c);
    };
    FinancialSeries.prototype.oc = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.n9(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.mi.ca, d);
        return this.ep(this.nf, a, this.mi, f, e, runOn(this, this.n8), b, c);
    };
    FinancialSeries.prototype.lr = function (a, b, c) {
        var _this = this;
        return this.lx(a, b, c, this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.m3, this.mi, runOn(this, this.ej), function (d, e) { return _this.ff(d, e, _this.mi, runOn(_this, _this.n8), _this.nb); }, function (d, e) { return _this.fd(d, e, _this.mi, runOn(_this, _this.n8), _this.nb); });
    };
    FinancialSeries.prototype.lt = function (a, b, c) {
        var _this = this;
        return this.lx(a, b, c, this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.m3, this.mi, runOn(this, this.el), function (d, e) { return _this.ff(d, e, _this.mi, runOn(_this, _this.n8), _this.nc); }, function (d, e) { return _this.fd(d, e, _this.mi, runOn(_this, _this.n8), _this.nc); });
    };
    FinancialSeries.prototype.pq = function (a, b, c) {
        var _this = this;
        return this.lx(a, b, c, this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.m3, this.mi, runOn(this, this.ob), function (d, e) { return _this.ff(d, e, _this.mi, runOn(_this, _this.n8), _this.nd); }, function (d, e) { return _this.fd(d, e, _this.mi, runOn(_this, _this.n8), _this.nd); });
    };
    FinancialSeries.prototype.pp = function (a, b, c) {
        var _this = this;
        return this.lx(a, b, c, this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.m3, this.mi, runOn(this, this.oa), function (d, e) { return _this.ff(d, e, _this.mi, runOn(_this, _this.n8), _this.na); }, function (d, e) { return _this.fd(d, e, _this.mi, runOn(_this, _this.n8), _this.na); });
    };
    FinancialSeries.prototype.pr = function (a, b, c) {
        var _this = this;
        return this.lx(a, b, c, this.n9(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.m3, this.mi, runOn(this, this.oc), function (d, e) { return _this.ff(d, e, _this.mi, runOn(_this, _this.n8), _this.nf); }, function (d, e) { return _this.fd(d, e, _this.mi, runOn(_this, _this.n8), _this.nf); });
    };
    FinancialSeries.prototype.ik = function () {
        _super.prototype.ik.call(this);
        if (this.mi != null) {
            this.mi.hb(false);
        }
        if (this.m3 != null) {
            this.m3.hb(false);
        }
    };
    FinancialSeries.prototype.j1 = function (a, b) {
        this.my.bu.e(this.eu);
        this.jl(false);
    };
    FinancialSeries.prototype.j0 = function (a, b) {
        if (this.dm && this.ez < 0.05) {
            this.dn = true;
        }
        this.my.bu.e(this.eu);
        this.jl(false);
    };
    FinancialSeries.prototype.ne = function (a, b, c) {
        var d = this.bw(b);
        this.nt.addItem(d, b);
        this.nu.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.o7 = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.nt.item(b);
        this.nu.removeItem(c);
        this.nt.removeItem(b);
    };
    FinancialSeries.prototype.i7 = function (a, b, c, d) {
        _super.prototype.i7.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.mi != null) {
                        this.mi.bx(this);
                    }
                    if (this.m3 != null) {
                        this.m3.bx(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.mi != null) {
                        this.mi.ck(this);
                    }
                    if (this.m3 != null) {
                        this.m3.ck(this);
                    }
                }
                this.my.bu.e(this.eu);
                this.jl(false);
                break;
            case "FastItemsSource":
                this.nh = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.o7(typeCast(IFastItemsSource_$type, c), this.nd);
                    this.o7(typeCast(IFastItemsSource_$type, c), this.nb);
                    this.o7(typeCast(IFastItemsSource_$type, c), this.nc);
                    this.o7(typeCast(IFastItemsSource_$type, c), this.na);
                    this.o7(typeCast(IFastItemsSource_$type, c), this.nf);
                    this.nd = null;
                    this.nb = null;
                    this.nc = null;
                    this.na = null;
                    this.nf = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.oy) == false) {
                        this.nd = this.ne(typeCast(IFastItemsSource_$type, d), this.oy, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.op) == false) {
                        this.nb = this.ne(typeCast(IFastItemsSource_$type, d), this.op, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.ou) == false) {
                        this.nc = this.ne(typeCast(IFastItemsSource_$type, d), this.ou, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.om) == false) {
                        this.na = this.ne(typeCast(IFastItemsSource_$type, d), this.om, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.o2) == false) {
                        this.nf = this.ne(typeCast(IFastItemsSource_$type, d), this.o2, "VolumeColumn");
                    }
                }
                this.nh = false;
                if (this.m3 != null && !this.m3.cn()) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.o7(this.bz, this.nd);
                    this.nd = this.ne(this.bz, this.oy, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.m3 != null && !this.m3.cn() && !this.nh) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.o7(this.bz, this.nb);
                    this.nb = this.ne(this.bz, this.op, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.m3 != null && !this.m3.cn() && !this.nh) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.o7(this.bz, this.nc);
                    this.nc = this.ne(this.bz, this.ou, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.m3 != null && !this.m3.cn() && !this.nh) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.o7(this.bz, this.na);
                    this.na = this.ne(this.bz, this.om, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.m3 != null && !this.m3.cn() && !this.nh) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                this.pc();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.o7(this.bz, this.nf);
                    this.nf = this.ne(this.bz, this.o2, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.m3 != null && !this.m3.cn() && !this.nh) {
                    this.my.bu.e(this.eu);
                    this.jl(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bx(this);
                }
                if (d != null) {
                    d.ck(this);
                }
                this.my.bu.e(this.eu);
                this.jl(false);
                this.it();
                this.m2 = typeCast(ITimeRangeSelectorAxis_$type, this.mi);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bx(this);
                }
                if (d != null) {
                    d.ck(this);
                }
                this.my.bu.e(this.eu);
                if (this.m3 != null) {
                    this.m3.cn();
                }
                {
                    this.jl(false);
                }
                this.it();
                break;
            case "TransitionProgress":
                this.mn.c(this.ez, this.ml, this.mk);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ez == 1) {
                    this.mk.v();
                    this.pb(this.mk, this.my);
                    if (this.dm) {
                        this.dm = false;
                        this.h4();
                        this.bt.r = truncate(this.eq());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.pb(this.mn, this.my);
                }
                if (this.bs != null) {
                    this.bs.ko(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.jl(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.ni = this.nl();
                this.jl(false);
                break;
            case "CategoryMode":
                if (this.mi != null) {
                    this.mi.kv(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.nk = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.nj = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b7) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.mb = function (a, b, c) {
        if (b < a || a < 0 || a > this.bz.count || b < 0 || b > this.bz.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.cf;
        var f = null;
        if (e) {
            f = c.i$b;
        }
        for (var g = a; g <= b; g++) {
            var h = g;
            if (e) {
                h = f._inner[h];
            }
            d[g - a] = this.bz.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.of = function (a) {
        return a.bu.b;
    };
    FinancialSeries.prototype.oh = function (a) {
        return a.bu.c;
    };
    FinancialSeries.prototype.ma = function (a, b) {
        return this.mb(a, b, this.m3);
    };
    FinancialSeries.prototype.get_nm = function () {
        return false;
    };
    Object.defineProperty(FinancialSeries.prototype, "nm", {
        get: function () {
            return this.get_nm();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cv = function () {
        return true;
    };
    FinancialSeries.prototype.at = function (a, b) {
        if (this.nm) {
            var c = this.m0(a, b, this.m1);
            this.m1 = c;
            return c;
        }
        else {
            var d = this.mz(a, b, this.m1);
            this.m1 = d;
            return d;
        }
    };
    FinancialSeries.prototype.oj = function (a) {
        var b = this.mk;
        if (this.ca()) {
            b = this.mn;
        }
        var c = this.bi.br;
        var d = this.bi.bs;
        var e = this.mi;
        var f = 0;
        if (e.ch) {
            var g = (a.y - d.top) / d.height;
            f = g * c.height + c.top;
        }
        else {
            var h = (a.x - d.left) / d.width;
            f = h * c.width + c.left;
        }
        var i = b.f.count;
        var j = 0;
        for (j = 0; j < i; j++) {
            var k = b.f._inner[j];
            var 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;
    };
    FinancialSeries.prototype.m0 = function (a, b, c) {
        var d = this.bz.count;
        var e = this.my.bu.c;
        var f = this.my.bu.d;
        var g = this.my.bu.b;
        var h = this.mi;
        var i = -1;
        var j = -1;
        if (h.cf) {
            var k = this.mk;
            if (this.ca()) {
                k = this.mn;
            }
            var l = this.oj(b);
            i = l;
            j = l;
        }
        else {
            var m = this.e8(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.f == i && c.e == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.b = this;
        n.f = i;
        n.e = j;
        return n;
    };
    FinancialSeries.prototype.mz = function (a, b, c) {
        var d = new HighlightingInfo();
        d.b = this;
        d.f = 0;
        d.e = this.bz.count - 1;
        if (c != null && c.f == d.f && c.e == d.e) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.nl = function () {
        return this.no;
    };
    FinancialSeries.prototype.eb = function (a) {
        var b = this.bi.bs;
        var c = this.bi.br;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.mi != null) {
            var e = this.getEffectiveViewport1(this.bi);
            var f = new ScalerParams(0, b, c, this.mi.ca, e);
            var g = this.l0(this.bi);
            var h = this.mi.d1(g.left, f);
            var i = this.mi.d1(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.mi.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.e8 = function (a) {
        return truncate(Math.round(this.eb(a)));
    };
    FinancialSeries.prototype.get_c1 = function () {
        return typeCast(ISortingAxis_$type, this.mi) !== null;
    };
    FinancialSeries.prototype.ap = function () {
        return this.mi;
    };
    FinancialSeries.prototype.fa = function (a) {
        var b = this.bi.bs;
        var c = this.bi.br;
        var d = this.getEffectiveViewport1(this.bi);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.mi.ca, d);
        var g = typeCast(ISortingAxis_$type, this.mi);
        var h = this.l0(this.bi);
        var i = h.left;
        var j = h.right;
        var k = this.lq(a).x;
        var l = this.mi.d1(k, f);
        var m = this.mi.d1(i, f);
        var n = this.mi.d1(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.fp = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.mi) !== null) {
            b = this.fa(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e8(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    };
    FinancialSeries.prototype.n9 = function (a, b, c) {
        if (this.mi == null) {
            return 0;
        }
        return this.mi.j0(a, b, c, this.fh);
    };
    FinancialSeries.prototype.dc = function () {
        return this.np;
    };
    FinancialSeries.prototype.mr = function () {
        return 11;
    };
    FinancialSeries.prototype.bo = function () {
        return 3;
    };
    FinancialSeries.prototype.pb = function (a, b) {
        this.lz = a.aa;
        b.ar();
    };
    FinancialSeries.prototype.o9 = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.dw = function (a, b, c) {
        var d = _super.prototype.dw.call(this, a, b, c);
        var e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.mi == null || this.m3 == null || e.bu.b < 1 || this.mi.bh == null || this.m3.bh == null || this.m3.kc == this.m3.kb || this.mi.itemsSource == null || this.mi.j7 < 1) {
            e.bu.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.bi.bs;
        a = this.bi.br;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.od = function (a) {
        var b = 0;
        var c = a.bs;
        var d = a.br;
        var e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.m3 != null) {
            var f = new ScalerParams(0, c, d, this.m3.ca, e);
            f.b = this.eh();
            b = this.m3.dy(this.m3.km, f);
        }
        return b;
    };
    FinancialSeries.prototype.h4 = function () {
        _super.prototype.h4.call(this);
        this.ml.v();
        this.mk.v();
        this.mn.v();
    };
    FinancialSeries.prototype.jm = function (a) {
        var _this = this;
        _super.prototype.jm.call(this, a);
        this.my.bu.e(this.eu);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.de) {
            if (this.ca()) {
                this.pb(this.mn, this.my);
            }
            else {
                this.pb(this.mk, this.my);
            }
            return;
        }
        if (this.da(a)) {
            var b = this.ml;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.ml = this.mn;
                this.mn = b;
            }
            else {
                this.ml = this.mk;
                this.mk = b;
            }
            this.o9(this.mk, this.my);
            if (this.dp) {
                this.bt.w();
                this.bt.r = truncate(this.er());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.mt.p(this.ml, this.mk, this.isVertical, this.mi, this.m3, this.ms, this.mr(), this.bp, this.bo(), function () { return _this.od(_this.my); }, this.my.br);
            }
            this.h0();
            this.jt();
            if (this.dp) {
                this.dn = false;
                this.dm = true;
            }
        }
        else {
            this.o9(this.mk, this.my);
            this.pb(this.mk, this.my);
        }
    };
    FinancialSeries.prototype.nr = function (a) {
        var e_1, _a;
        try {
            for (var _b = tslib_1.__values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                switch (b) {
                    case "HighColumn":
                        if (this.nb == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.nc == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.nd == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.na == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.nf == null) {
                            return false;
                        }
                        break;
                }
            }
        }
        catch (e_1_1) {
            e_1 = { error: e_1_1 };
        }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return))
                    _a.call(_b);
            }
            finally {
                if (e_1)
                    throw e_1.error;
            }
        }
        return true;
    };
    Object.defineProperty(FinancialSeries.prototype, "ns", {
        get: function () {
            return this.mi != null && typeCast(ISortingAxis_$type, this.mi) !== null;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.nn = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.o6 = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "n0", {
        get: function () {
            return this.nx();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nx = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h;
        var e_2, _c;
        return tslib_1.__generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.nn())
                        return [3 /*break*/, 8];
                    b = this.mu(0, this.bz.count);
                    this.o6(new FinancialEventArgs(0, this.bz.count, b, this.mv(b), this));
                    if (!(b.typicalColumn != null))
                        return [3 /*break*/, 8];
                    a = true;
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _a = tslib_1.__values(fromEnum(b.typicalColumn)), _b = _a.next();
                    _d.label = 2;
                case 2:
                    if (!!_b.done)
                        return [3 /*break*/, 5];
                    c = _b.value;
                    return [4 /*yield*/, c];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _b = _a.next();
                    return [3 /*break*/, 2];
                case 5: return [3 /*break*/, 8];
                case 6:
                    e_2_1 = _d.sent();
                    e_2 = { error: e_2_1 };
                    return [3 /*break*/, 8];
                case 7:
                    try {
                        if (_b && !_b.done && (_c = _a.return))
                            _c.call(_a);
                    }
                    finally {
                        if (e_2)
                            throw e_2.error;
                    }
                    return [7 /*endfinally*/];
                case 8:
                    if (!!a)
                        return [3 /*break*/, 17];
                    if (!(this.ns && this.mi.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.bz.count;
                    e = this.mi.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.nb.item(e.item(f)) + this.nc.item(e.item(f)) + this.na.item(e.item(f))) / 3];
                case 10:
                    _d.sent();
                    _d.label = 11;
                case 11:
                    ++f;
                    return [3 /*break*/, 9];
                case 12: return [3 /*break*/, 17];
                case 13:
                    g = this.bz.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.nb.item(h) + this.nc.item(h) + this.na.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nx = function () {
        var _this = this;
        return toEnum(function () { return _this._nx(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "nz", {
        get: function () {
            return this.nw();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nw = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.ns && this.mi.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.nb.count;
                    b = this.mi.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.oe(this.nb.item(b.item(0)) - this.nc.item(b.item(0)))];
                case 1:
                    _a.sent();
                    _a.label = 2;
                case 2:
                    c = 1;
                    _a.label = 3;
                case 3:
                    if (!(c < a))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, Math.max(this.oe(this.nb.item(b.item(c)) - this.nc.item(b.item(c))), Math.max(this.oe(Math.abs(this.nb.item(b.item(c)) - this.na.item(b.item(c - 1)))), this.oe(Math.abs(this.nc.item(b.item(c)) - this.na.item(b.item(c - 1))))))];
                case 4:
                    _a.sent();
                    _a.label = 5;
                case 5:
                    ++c;
                    return [3 /*break*/, 3];
                case 6: return [3 /*break*/, 13];
                case 7:
                    d = this.nb.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.oe(this.nb.item(0) - this.nc.item(0))];
                case 8:
                    _a.sent();
                    _a.label = 9;
                case 9:
                    e = 1;
                    _a.label = 10;
                case 10:
                    if (!(e < d))
                        return [3 /*break*/, 13];
                    return [4 /*yield*/, Math.max(this.oe(this.nb.item(e) - this.nc.item(e)), Math.max(this.oe(Math.abs(this.nb.item(e) - this.na.item(e - 1))), this.oe(Math.abs(this.nc.item(e) - this.na.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nw = function () {
        var _this = this;
        return toEnum(function () { return _this._nw(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "ny", {
        get: function () {
            return this.nv();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nv = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.ns && this.mi.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.nc.count;
                    b = this.mi.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.oe(this.nc.item(b.item(0)))];
                case 1:
                    _a.sent();
                    _a.label = 2;
                case 2:
                    c = 1;
                    _a.label = 3;
                case 3:
                    if (!(c < a))
                        return [3 /*break*/, 6];
                    return [4 /*yield*/, Math.min(this.oe(this.nc.item(b.item(c))), this.oe(this.na.item(b.item(c - 1))))];
                case 4:
                    _a.sent();
                    _a.label = 5;
                case 5:
                    c++;
                    return [3 /*break*/, 3];
                case 6: return [3 /*break*/, 13];
                case 7:
                    d = this.nc.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.oe(this.nc.item(0))];
                case 8:
                    _a.sent();
                    _a.label = 9;
                case 9:
                    e = 1;
                    _a.label = 10;
                case 10:
                    if (!(e < d))
                        return [3 /*break*/, 13];
                    return [4 /*yield*/, Math.min(this.oe(this.nc.item(e)), this.oe(this.na.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nv = function () {
        var _this = this;
        return toEnum(function () { return _this._nv(); });
    };
    FinancialSeries.prototype.n2 = function (a) {
        if (a == null) {
            return null;
        }
        if (this.ns && this.mi.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.mi.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.n1 = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.bz != null && !this.ng) {
            this.ng = true;
            var b = this.mu(0, this.bz.count);
            this.ng = false;
            var c = new FinancialEventArgs(0, this.bz.count, b, this.mv(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    };
    FinancialSeries.prototype.getOpenColumnAsArray = function () {
        if (this.nd == null) {
            return null;
        }
        if (this.mi != null && typeCast(ISortingAxis_$type, this.mi) !== null) {
            if (this.n6 != null) {
                return this.n6.asArray();
            }
            var a = new List$1(Number_$type, 2, this.nd.count);
            var b = this.mi.i$b;
            var c = this.nd.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.n6 = a;
            return this.n6.asArray();
        }
        else {
            return this.nd.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.nb == null) {
            return null;
        }
        if (this.mi != null && typeCast(ISortingAxis_$type, this.mi) !== null) {
            if (this.n4 != null) {
                return this.n4.asArray();
            }
            var a = new List$1(Number_$type, 2, this.nb.count);
            var b = this.mi.i$b;
            var c = this.nb.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.n4 = a;
            return this.n4.asArray();
        }
        else {
            return this.nb.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.nc == null) {
            return null;
        }
        if (this.mi != null && typeCast(ISortingAxis_$type, this.mi) !== null) {
            if (this.n5 != null) {
                return this.n5.asArray();
            }
            var a = new List$1(Number_$type, 2, this.nc.count);
            var b = this.mi.i$b;
            var c = this.nc.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.n5 = a;
            return this.n5.asArray();
        }
        else {
            return this.nc.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.na == null) {
            return null;
        }
        if (this.mi != null && typeCast(ISortingAxis_$type, this.mi) !== null) {
            if (this.n3 != null) {
                return this.n3.asArray();
            }
            var a = new List$1(Number_$type, 2, this.na.count);
            var b = this.mi.i$b;
            var c = this.na.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.n3 = a;
            return this.n3.asArray();
        }
        else {
            return this.na.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.nf == null) {
            return null;
        }
        if (this.mi != null && typeCast(ISortingAxis_$type, this.mi) !== null) {
            if (this.n7 != null) {
                return this.n7.asArray();
            }
            var a = new List$1(Number_$type, 2, this.nf.count);
            var b = this.mi.i$b;
            var c = this.nf.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.n7 = a;
            return this.n7.asArray();
        }
        else {
            return this.nf.asArray();
        }
    };
    FinancialSeries.prototype.h6 = function (a, b, c, d) {
        _super.prototype.h6.call(this, a, b, c, d);
        if (this.mi == null || !(typeCast(ISortingAxis_$type, this.mi) !== null)) {
            return;
        }
        var e = this.mi.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.n6 != null) {
                        this.n6.insert(f, this.nd.item(g));
                    }
                    if (this.n4 != null) {
                        this.n4.insert(f, this.nb.item(g));
                    }
                    if (this.n5 != null) {
                        this.n5.insert(f, this.nc.item(g));
                    }
                    if (this.n3 != null) {
                        this.n3.insert(f, this.na.item(g));
                    }
                    if (this.n7 != null) {
                        this.n7.insert(f, this.nf.item(g));
                    }
                }
                break;
            case 0:
                if (this.n6 != null) {
                    this.n6.v(b, c);
                }
                if (this.n4 != null) {
                    this.n4.v(b, c);
                }
                if (this.n5 != null) {
                    this.n5.v(b, c);
                }
                if (this.n3 != null) {
                    this.n3.v(b, c);
                }
                if (this.n7 != null) {
                    this.n7.v(b, c);
                }
                break;
            case 4:
                if (this.n6 != null) {
                    this.n6 = new List$1(Number_$type, 0);
                }
                if (this.n4 != null) {
                    this.n4 = new List$1(Number_$type, 0);
                }
                if (this.n5 != null) {
                    this.n5 = new List$1(Number_$type, 0);
                }
                if (this.n3 != null) {
                    this.n3 = new List$1(Number_$type, 0);
                }
                if (this.n7 != null) {
                    this.n7 = new List$1(Number_$type, 0);
                }
                break;
            case 3:
            case 2:
                for (var h = b; h < c; h++) {
                    var i = e._inner[h];
                    if (this.n6 != null) {
                        this.n6._inner[h] = this.nd.item(i);
                    }
                    if (this.n4 != null) {
                        this.n4._inner[h] = this.nb.item(i);
                    }
                    if (this.n5 != null) {
                        this.n5._inner[h] = this.nc.item(i);
                    }
                    if (this.n3 != null) {
                        this.n3._inner[h] = this.na.item(i);
                    }
                    if (this.n7 != null) {
                        this.n7._inner[h] = this.nf.item(i);
                    }
                }
                break;
        }
        this.pc();
        this.jy();
    };
    FinancialSeries.prototype.mu = function (a, b) {
        var _this = this;
        var c = this.n2(this.nd);
        var d = this.n2(this.na);
        var e = this.n2(this.nb);
        var f = this.n2(this.nc);
        var g = this.n2(this.nf);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.n0), _this.n1());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.nz), ((function () {
                var $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.ny), ((function () {
                var $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.bz != null ? _this.bz.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.oe = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.mv = function (a) {
        var _this = this;
        return ((function () {
            var $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, function (b) { return TrendCalculators.b(b.volumeColumn, b.shortPeriod); }, ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.f = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.volumeColumn, b.longPeriod); }, ((function () {
                var $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.g = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.typicalColumn, b.shortPeriod); }, a.typicalColumn.basedOn);
            $ret.e = new DataSourceSupportingCalculation(1, function (b) { return TrendCalculators.b(b.typicalColumn, b.longPeriod); }, a.typicalColumn.basedOn);
            $ret.k = Series.d1;
            $ret.j = Series.d0;
            $ret.i = runOn(_this, _this.oe);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.mi;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.jn = function (a, b) {
        _super.prototype.jn.call(this, a, b);
        if (!this.dl) {
            this.bi.az(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bu.e(this.eu);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.df) {
            this.o9(this.mm, c);
        }
        this.df = false;
        this.pb(this.mm, c);
        this.dl = false;
    };
    FinancialSeries.prototype.jk = function (a, b, c, d, e) {
        _super.prototype.jk.call(this, a, b, c, d, e);
        var f = this.a0.a$h.item(d);
        var g = f;
        g.bu.e(this.eu);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.mj == null) {
            this.mj = new CategoryFrame(3);
        }
        this.mj.u();
        this.o9(this.mj, g);
        this.pb(this.mj, g);
    };
    FinancialSeries.prototype.am = function (a) {
        if (this.mi == a) {
            return this.m3;
        }
        if (this.m3 == a) {
            return this.mi;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.mi);
        return b != null ? b.preferredCategoryMode(this) : this.mp;
    };
    Object.defineProperty(FinancialSeries.prototype, "mp", {
        get: function () {
            return this.mo;
        },
        set: function (a) {
            var b = this.mp;
            if (a != b) {
                this.mo = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.mp));
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cz = function () {
        return true;
    };
    FinancialSeries.prototype.jq = function (a, b) {
        _super.prototype.jq.call(this, a, b);
        this.po = a;
    };
    FinancialSeries.prototype.pc = function () {
        this.d8 = this.na == null || this.na.count == 0 ? NaN : this.na.item(this.na.count - 1);
    };
    FinancialSeries.prototype.fr = function (a) {
        if (this.m2 != null && a != null) {
            if (this.m4 == null || this.m4.propertyName != this.m2.dateTimeMemberPath) {
                this.m4 = new FastReflectionHelper(false, this.m2.dateTimeMemberPath);
            }
            var b = this.m4.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.m2.itemLabelFormat());
            }
        }
        return _super.prototype.fr.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:om:pd', [2, null], 'HighMemberPath:op:pe', [2, null], 'IsCustomCategoryStyleAllowed:no:pf', [0, false], 'IsTransitionInEnabled:np:pg', [0, false], 'LowMemberPath:ou:ph', [2, null], 'NegativeBrush:po:pi', [Brush.$, null], 'OpenMemberPath:oy:pj', [2, null], 'TransitionInMode:ms:pk', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:o2:pl', [2, null], 'XAxis:mi:pm', [CategoryAxisBase.$, null], 'YAxis:m3:pn', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialCalculationSupportingCalculations, _super);
    function FinancialCalculationSupportingCalculations() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _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;
        return _this;
    }
    FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
}(Base));
export { FinancialCalculationSupportingCalculations };
/**
 * @hidden
 */
var DataSourceSupportingCalculation = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(DataSourceSupportingCalculation, _super);
    function DataSourceSupportingCalculation(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = this;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    _this = _super.call(this, Delegate_$type, 0, c) || this;
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this = _super.call(this, Delegate_$type, 1, c, d) || this;
                }
                break;
        }
        return _this;
    }
    DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
}(SupportingCalculation$1));
export { DataSourceSupportingCalculation };
/**
 * @hidden
 */
var FinancialCalculationDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialCalculationDataSource, _super);
    function FinancialCalculationDataSource() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _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;
        return _this;
    }
    Object.defineProperty(FinancialCalculationDataSource.prototype, "openColumn", {
        get: function () {
            return this._openColumn;
        },
        set: function (a) {
            this._openColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "closeColumn", {
        get: function () {
            return this._closeColumn;
        },
        set: function (a) {
            this._closeColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "highColumn", {
        get: function () {
            return this._highColumn;
        },
        set: function (a) {
            this._highColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "lowColumn", {
        get: function () {
            return this._lowColumn;
        },
        set: function (a) {
            this._lowColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "volumeColumn", {
        get: function () {
            return this._volumeColumn;
        },
        set: function (a) {
            this._volumeColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "indicatorColumn", {
        get: function () {
            return this._indicatorColumn;
        },
        set: function (a) {
            this._indicatorColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "typicalColumn", {
        get: function () {
            return this._typicalColumn;
        },
        set: function (a) {
            this._typicalColumn = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueRange", {
        get: function () {
            return this._trueRange;
        },
        set: function (a) {
            this._trueRange = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueLow", {
        get: function () {
            return this._trueLow;
        },
        set: function (a) {
            this._trueLow = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "period", {
        get: function () {
            return this._period;
        },
        set: function (a) {
            this._period = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "shortPeriod", {
        get: function () {
            return this._shortPeriod;
        },
        set: function (a) {
            this._shortPeriod = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "longPeriod", {
        get: function () {
            return this._longPeriod;
        },
        set: function (a) {
            this._longPeriod = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateFrom", {
        get: function () {
            return this._calculateFrom;
        },
        set: function (a) {
            this._calculateFrom = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateCount", {
        get: function () {
            return this._calculateCount;
        },
        set: function (a) {
            this._calculateCount = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "multiplier", {
        get: function () {
            return this._multiplier;
        },
        set: function (a) {
            this._multiplier = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "specifiesRange", {
        get: function () {
            return this._specifiesRange;
        },
        set: function (a) {
            this._specifiesRange = a;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: true,
        configurable: true
    });
    FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
}(Base));
export { FinancialCalculationDataSource };
/**
 * @hidden
 */
var FinancialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.bw = null;
        _this.bu = null;
        _this.by = 0;
        _this.by = -1;
        _this.bw = a;
        _this.bu = _this.bv();
        return _this;
    }
    FinancialSeriesView.prototype.bx = function (a) {
        if (this.by != a.t) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.bz = function (a) {
        this.by = a.t;
    };
    FinancialSeriesView.prototype.ap = function () {
        _super.prototype.ap.call(this);
        if (!this.n) {
            this.e.bj = 6;
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bw.mi.b7) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.mi.e9 != null) {
            a += "<span>${item." + this.bw.mi.e9 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        var c = new SRProvider(this.t);
        var d = c.b1("financialSeries_Open");
        var e = c.b1("financialSeries_High");
        var f = c.b1("financialSeries_Low");
        var 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.bw.fx + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bw.oy + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.op + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.ou + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.om + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.o2)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.o2 + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    };
    FinancialSeriesView.prototype.ac = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.lk = a;
        this.e.ev = 5;
        this.e.ew = 2;
        this.e.ex = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
//# sourceMappingURL=FinancialEventArgs_combined.js.map
