/*
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, Type, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, Delegate_$type } from "igniteui-angular-core/ES5/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core/ES5/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-angular-core/ES5/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core/ES5/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core/ES5/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core/ES5/Brush";
import { DependencyProperty } from "igniteui-angular-core/ES5/DependencyProperty";
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-angular-core/ES5/FastReflectionHelper";
import { List$1 } from "igniteui-angular-core/ES5/List$1";
import { Dictionary$2 } from "igniteui-angular-core/ES5/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-core/ES5/IFastItemsSource";
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-angular-core/ES5/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core/ES5/PropertyMetadata";
import { stringIsNullOrEmpty } from "igniteui-angular-core/ES5/string";
import { dateToStringFormat } from "igniteui-angular-core/ES5/dateExtended";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core/ES5/SRProvider";
import { Color } from "igniteui-angular-core/ES5/Color";
/**
 * @hidden
 */
var FinancialEventArgs = /** @class */ (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 */ (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.l7 == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bw.l7 != null) ? this.a.bw.l7.b8 : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bw.lp(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bw.l7);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bw.l7.dy(g.left, f));
            var j = Math.ceil(this.a.bw.l7.dy(g.right, f));
            if (this.a.bw.l7.b8) {
                j = Math.ceil(this.a.bw.l7.dy(g.left, f));
                i = Math.floor(this.a.bw.l7.dy(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 */ (function (_super) {
    tslib_1.__extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.m0 = null;
        _this.mw = null;
        _this.my = null;
        _this.mu = null;
        _this.m3 = null;
        _this.m7 = false;
        _this.assigningCategoryStyle = null;
        _this.mf = null;
        _this.ni = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.nj = new Dictionary$2(String_$type, String_$type, 0);
        _this.m6 = false;
        _this.mq = null;
        _this.ma = null;
        _this.mc = null;
        _this.l9 = null;
        _this.mi = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.m5 = false;
        _this.nv = null;
        _this.nt = null;
        _this.nu = null;
        _this.ns = null;
        _this.nw = null;
        _this.mb = null;
        _this.l8 = null;
        _this.md = 0;
        _this.mr = null;
        _this.mt = null;
        _this.mf = new CategorySeriesRenderManager();
        _this.m7 = false;
        _this.mi = new CategoryTransitionSourceFramePreparer();
        _this.mb = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.me = 0;
        return _this;
    }
    FinancialSeries.prototype.it = function (a) {
        _super.prototype.it.call(this, a);
        this.mn = a;
    };
    FinancialSeries.prototype.get_cr = function () {
        return true;
    };
    FinancialSeries.prototype.ag = function () {
        return [this.l7, this.ms];
    };
    FinancialSeries.prototype.fs = function (a, b) {
        var c = this.gu(b);
        if (c == FinancialSeries.$$p[6]) {
            return this.ft(a, b, this.on);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.ft(a, b, this.oe);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.ft(a, b, this.oj);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.ft(a, b, this.ob);
        }
        if (c == FinancialSeries.$$p[8]) {
            return this.ft(a, b, this.or);
        }
        return _super.prototype.fs.call(this, a, b);
    };
    FinancialSeries.prototype.n7 = function () {
        return 2;
    };
    FinancialSeries.prototype.n5 = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.l7, this.l9.f, this.n4(this.bi), this.n6(this.bi), this.ln(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.n7();
        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.l7, this.l9.f, this.n4(this.bi), this.n6(this.bi), this.ln(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.k8 = function () {
        return this.pd;
    };
    FinancialSeries.prototype.ht = function () {
        _super.prototype.ht.call(this);
        this.l7 = null;
        this.ms = null;
    };
    Object.defineProperty(FinancialSeries.prototype, "m1", {
        get: function () {
            return this.m0;
        },
        set: function (a) {
            if (this.m0 != a) {
                var b = this.m0;
                this.m0 = a;
                this.raisePropertyChanged("OpenColumn", b, this.m0);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mx", {
        get: function () {
            return this.mw;
        },
        set: function (a) {
            if (this.mw != a) {
                var b = this.mw;
                this.mw = a;
                this.raisePropertyChanged("HighColumn", b, this.mw);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mz", {
        get: function () {
            return this.my;
        },
        set: function (a) {
            if (this.my != a) {
                var b = this.my;
                this.my = a;
                this.raisePropertyChanged("LowColumn", b, this.my);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mv", {
        get: function () {
            return this.mu;
        },
        set: function (a) {
            if (this.mu != a) {
                var b = this.mu;
                this.mu = a;
                this.raisePropertyChanged("CloseColumn", b, this.mu);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "m4", {
        get: function () {
            return this.m3;
        },
        set: function (a) {
            if (this.m3 != a) {
                var b = this.m3;
                this.m3 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.m3);
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.nf = function () {
        return (this.assigningCategoryStyle != null && this.m7) || this.cu;
    };
    FinancialSeries.prototype.oz = function (a) {
        if (this.assigningCategoryStyle != null && this.m7) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.ox = function (a, b, c, d, e, f) {
        var g = this.b9;
        this.mf.ac(a, b, c, d, e, f, g);
        var h = this.mf.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.oz(h);
        this.mf.aa(i, f, g);
    };
    FinancialSeries.prototype.nx = function (a) {
        return this.ed(a, this.l7);
    };
    FinancialSeries.prototype.fe = function (a, b) {
        return this.ff(a, b, this.l7, runOn(this, this.nx), new FinancialValueList(this.m1, this.mx, this.mz, this.mv, this.m4));
    };
    FinancialSeries.prototype.fc = function (a, b) {
        return this.fd(a, b, this.l7, runOn(this, this.nx), new FinancialValueList(this.m1, this.mx, this.mz, this.mv, this.m4));
    };
    FinancialSeries.prototype.d9 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.l7.jx;
        return this.ea(a, b, this.l7, d, e, f, runOn(this, this.nx));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.l7.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.lk = function (a, b, c) {
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, null, null, null);
    };
    FinancialSeries.prototype.en = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.ny(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(new FinancialValueList(this.m1, this.mx, this.mz, this.mv, this.m4), a, this.l7, f, e, runOn(this, this.nx), b, c);
    };
    FinancialSeries.prototype.ej = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.ny(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.mx, a, this.l7, f, e, runOn(this, this.nx), b, c);
    };
    FinancialSeries.prototype.el = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.ny(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.mz, a, this.l7, f, e, runOn(this, this.nx), b, c);
    };
    FinancialSeries.prototype.nz = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.ny(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.mv, a, this.l7, f, e, runOn(this, this.nx), b, c);
    };
    FinancialSeries.prototype.n0 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.ny(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.m1, a, this.l7, f, e, runOn(this, this.nx), b, c);
    };
    FinancialSeries.prototype.n1 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.ny(this.bi.bs, this.bi.br, d);
        var f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l7.b8, d);
        return this.ep(this.m4, a, this.l7, f, e, runOn(this, this.nx), b, c);
    };
    FinancialSeries.prototype.lg = function (a, b, c) {
        var _this = this;
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.ej), function (d, e) { return _this.ff(d, e, _this.l7, runOn(_this, _this.nx), _this.mx); }, function (d, e) { return _this.fd(d, e, _this.l7, runOn(_this, _this.nx), _this.mx); });
    };
    FinancialSeries.prototype.li = function (a, b, c) {
        var _this = this;
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.el), function (d, e) { return _this.ff(d, e, _this.l7, runOn(_this, _this.nx), _this.mz); }, function (d, e) { return _this.fd(d, e, _this.l7, runOn(_this, _this.nx), _this.mz); });
    };
    FinancialSeries.prototype.pf = function (a, b, c) {
        var _this = this;
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.n0), function (d, e) { return _this.ff(d, e, _this.l7, runOn(_this, _this.nx), _this.m1); }, function (d, e) { return _this.fd(d, e, _this.l7, runOn(_this, _this.nx), _this.m1); });
    };
    FinancialSeries.prototype.pe = function (a, b, c) {
        var _this = this;
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.nz), function (d, e) { return _this.ff(d, e, _this.l7, runOn(_this, _this.nx), _this.mv); }, function (d, e) { return _this.fd(d, e, _this.l7, runOn(_this, _this.nx), _this.mv); });
    };
    FinancialSeries.prototype.pg = function (a, b, c) {
        var _this = this;
        return this.lm(a, b, c, this.ny(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.ms, this.l7, runOn(this, this.n1), function (d, e) { return _this.ff(d, e, _this.l7, runOn(_this, _this.nx), _this.m4); }, function (d, e) { return _this.fd(d, e, _this.l7, runOn(_this, _this.nx), _this.m4); });
    };
    FinancialSeries.prototype.ia = function () {
        _super.prototype.ia.call(this);
        if (this.l7 != null) {
            this.l7.g5(false);
        }
        if (this.ms != null) {
            this.ms.g5(false);
        }
    };
    FinancialSeries.prototype.js = function (a, b) {
        this.mn.bu.e(this.eu);
        this.jc(false);
    };
    FinancialSeries.prototype.jr = function (a, b) {
        if (this.dm && this.ez < 0.05) {
            this.dn = true;
        }
        this.mn.bu.e(this.eu);
        this.jc(false);
    };
    FinancialSeries.prototype.m2 = function (a, b, c) {
        var d = this.bw(b);
        this.ni.addItem(d, b);
        this.nj.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.ow = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.ni.item(b);
        this.nj.removeItem(c);
        this.ni.removeItem(b);
    };
    FinancialSeries.prototype.iy = function (a, b, c, d) {
        _super.prototype.iy.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.l7 != null) {
                        this.l7.bv(this);
                    }
                    if (this.ms != null) {
                        this.ms.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.l7 != null) {
                        this.l7.ch(this);
                    }
                    if (this.ms != null) {
                        this.ms.ch(this);
                    }
                }
                this.mn.bu.e(this.eu);
                this.jc(false);
                break;
            case "FastItemsSource":
                this.m6 = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.ow(typeCast(IFastItemsSource_$type, c), this.m1);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.mx);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.mz);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.mv);
                    this.ow(typeCast(IFastItemsSource_$type, c), this.m4);
                    this.m1 = null;
                    this.mx = null;
                    this.mz = null;
                    this.mv = null;
                    this.m4 = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.on) == false) {
                        this.m1 = this.m2(typeCast(IFastItemsSource_$type, d), this.on, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.oe) == false) {
                        this.mx = this.m2(typeCast(IFastItemsSource_$type, d), this.oe, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.oj) == false) {
                        this.mz = this.m2(typeCast(IFastItemsSource_$type, d), this.oj, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.ob) == false) {
                        this.mv = this.m2(typeCast(IFastItemsSource_$type, d), this.ob, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.or) == false) {
                        this.m4 = this.m2(typeCast(IFastItemsSource_$type, d), this.or, "VolumeColumn");
                    }
                }
                this.m6 = false;
                if (this.ms != null && !this.ms.ck()) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.ow(this.bz, this.m1);
                    this.m1 = this.m2(this.bz, this.on, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.ow(this.bz, this.mx);
                    this.mx = this.m2(this.bz, this.oe, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.ow(this.bz, this.mz);
                    this.mz = this.m2(this.bz, this.oj, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.ow(this.bz, this.mv);
                    this.mv = this.m2(this.bz, this.ob, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                this.o1();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.ow(this.bz, this.m4);
                    this.m4 = this.m2(this.bz, this.or, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.ms != null && !this.ms.ck() && !this.m6) {
                    this.mn.bu.e(this.eu);
                    this.jc(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mn.bu.e(this.eu);
                this.jc(false);
                this.ij();
                this.mr = typeCast(ITimeRangeSelectorAxis_$type, this.l7);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mn.bu.e(this.eu);
                if (this.ms != null) {
                    this.ms.ck();
                }
                {
                    this.jc(false);
                }
                this.ij();
                break;
            case "TransitionProgress":
                this.mc.c(this.ez, this.ma, this.l9);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ez == 1) {
                    this.l9.v();
                    this.o0(this.l9, this.mn);
                    if (this.dm) {
                        this.dm = false;
                        this.hw();
                        this.bt.r = truncate(this.eq());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.o0(this.mc, this.mn);
                }
                if (this.bs != null) {
                    this.bs.jj(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.jc(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.m7 = this.na();
                this.jc(false);
                break;
            case "CategoryMode":
                if (this.l7 != null) {
                    this.l7.km(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.m9 = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.m8 = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.l0 = 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.cc;
        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.n4 = function (a) {
        return a.bu.b;
    };
    FinancialSeries.prototype.n6 = function (a) {
        return a.bu.c;
    };
    FinancialSeries.prototype.lz = function (a, b) {
        return this.l0(a, b, this.ms);
    };
    FinancialSeries.prototype.get_nb = function () {
        return false;
    };
    Object.defineProperty(FinancialSeries.prototype, "nb", {
        get: function () {
            return this.get_nb();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cv = function () {
        return true;
    };
    FinancialSeries.prototype.at = function (a, b) {
        if (this.nb) {
            var c = this.mp(a, b, this.mq);
            this.mq = c;
            return c;
        }
        else {
            var d = this.mo(a, b, this.mq);
            this.mq = d;
            return d;
        }
    };
    FinancialSeries.prototype.n8 = function (a) {
        var b = this.l9;
        if (this.ca()) {
            b = this.mc;
        }
        var c = this.bi.br;
        var d = this.bi.bs;
        var e = this.l7;
        var f = 0;
        if (e.ce) {
            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.mp = function (a, b, c) {
        var d = this.bz.count;
        var e = this.mn.bu.c;
        var f = this.mn.bu.d;
        var g = this.mn.bu.b;
        var h = this.l7;
        var i = -1;
        var j = -1;
        if (h.cc) {
            var k = this.l9;
            if (this.ca()) {
                k = this.mc;
            }
            var l = this.n8(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.mo = 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.na = function () {
        return this.nd;
    };
    FinancialSeries.prototype.eb = function (a) {
        var b = this.bi.bs;
        var c = this.bi.br;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.l7 != null) {
            var e = this.getEffectiveViewport1(this.bi);
            var f = new ScalerParams(0, b, c, this.l7.b8, e);
            var g = this.lp(this.bi);
            var h = this.l7.dy(g.left, f);
            var i = this.l7.dy(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.l7.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.l7) !== null;
    };
    FinancialSeries.prototype.ap = function () {
        return this.l7;
    };
    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.l7.b8, d);
        var g = typeCast(ISortingAxis_$type, this.l7);
        var h = this.lp(this.bi);
        var i = h.left;
        var j = h.right;
        var k = this.lf(a).x;
        var l = this.l7.dy(k, f);
        var m = this.l7.dy(i, f);
        var n = this.l7.dy(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.l7) !== 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.ny = function (a, b, c) {
        if (this.l7 == null) {
            return 0;
        }
        return this.l7.jr(a, b, c, this.fh);
    };
    FinancialSeries.prototype.dc = function () {
        return this.ne;
    };
    FinancialSeries.prototype.mg = function () {
        return 11;
    };
    FinancialSeries.prototype.bo = function () {
        return 3;
    };
    FinancialSeries.prototype.o0 = function (a, b) {
        this.lo = a.aa;
        b.ar();
    };
    FinancialSeries.prototype.oy = 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.l7 == null || this.ms == null || e.bu.b < 1 || this.l7.bf == null || this.ms.bf == null || this.ms.j3 == this.ms.j2 || this.l7.itemsSource == null || this.l7.jx < 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.n2 = 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.ms != null) {
            var f = new ScalerParams(0, c, d, this.ms.b8, e);
            f.b = this.eh();
            b = this.ms.dv(this.ms.kd, f);
        }
        return b;
    };
    FinancialSeries.prototype.hw = function () {
        _super.prototype.hw.call(this);
        this.ma.v();
        this.l9.v();
        this.mc.v();
    };
    FinancialSeries.prototype.jd = function (a) {
        var _this = this;
        _super.prototype.jd.call(this, a);
        this.mn.bu.e(this.eu);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.de) {
            if (this.ca()) {
                this.o0(this.mc, this.mn);
            }
            else {
                this.o0(this.l9, this.mn);
            }
            return;
        }
        if (this.da(a)) {
            var b = this.ma;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.ma = this.mc;
                this.mc = b;
            }
            else {
                this.ma = this.l9;
                this.l9 = b;
            }
            this.oy(this.l9, this.mn);
            if (this.dp) {
                this.bt.w();
                this.bt.r = truncate(this.er());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.mi.p(this.ma, this.l9, this.isVertical, this.l7, this.ms, this.mh, this.mg(), this.bp, this.bo(), function () { return _this.n2(_this.mn); }, this.mn.br);
            }
            this.hs();
            this.jk();
            if (this.dp) {
                this.dn = false;
                this.dm = true;
            }
        }
        else {
            this.oy(this.l9, this.mn);
            this.o0(this.l9, this.mn);
        }
    };
    FinancialSeries.prototype.ng = 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.mx == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.mz == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.m1 == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.mv == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.m4 == 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, "nh", {
        get: function () {
            return this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.nc = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.ov = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "np", {
        get: function () {
            return this.nm();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nm = function () {
        var e_2, _a, a, b, _b, _c, c, e_2_1, d, e, f, g, h;
        return tslib_1.__generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.nc()) return [3 /*break*/, 8];
                    b = this.mj(0, this.bz.count);
                    this.ov(new FinancialEventArgs(0, this.bz.count, b, this.mk(b), this));
                    if (!(b.typicalColumn != null)) return [3 /*break*/, 8];
                    a = true;
                    _d.label = 1;
                case 1:
                    _d.trys.push([1, 6, 7, 8]);
                    _b = tslib_1.__values(fromEnum(b.typicalColumn)), _c = _b.next();
                    _d.label = 2;
                case 2:
                    if (!!_c.done) return [3 /*break*/, 5];
                    c = _c.value;
                    return [4 /*yield*/, c];
                case 3:
                    _d.sent();
                    _d.label = 4;
                case 4:
                    _c = _b.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 (_c && !_c.done && (_a = _b.return)) _a.call(_b);
                    }
                    finally { if (e_2) throw e_2.error; }
                    return [7 /*endfinally*/];
                case 8:
                    if (!!a) return [3 /*break*/, 17];
                    if (!(this.nh && this.l7.i$b != null)) return [3 /*break*/, 13];
                    d = this.bz.count;
                    e = this.l7.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d)) return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.mx.item(e.item(f)) + this.mz.item(e.item(f)) + this.mv.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.mx.item(h) + this.mz.item(h) + this.mv.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nm = function () {
        var _this = this;
        return toEnum(function () { return _this._nm(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "no", {
        get: function () {
            return this.nl();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nl = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.nh && this.l7.i$b != null)) return [3 /*break*/, 7];
                    a = this.mx.count;
                    b = this.l7.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.n3(this.mx.item(b.item(0)) - this.mz.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.n3(this.mx.item(b.item(c)) - this.mz.item(b.item(c))), Math.max(this.n3(Math.abs(this.mx.item(b.item(c)) - this.mv.item(b.item(c - 1)))), this.n3(Math.abs(this.mz.item(b.item(c)) - this.mv.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.mx.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.n3(this.mx.item(0) - this.mz.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.n3(this.mx.item(e) - this.mz.item(e)), Math.max(this.n3(Math.abs(this.mx.item(e) - this.mv.item(e - 1))), this.n3(Math.abs(this.mz.item(e) - this.mv.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nl = function () {
        var _this = this;
        return toEnum(function () { return _this._nl(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "nn", {
        get: function () {
            return this.nk();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._nk = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.nh && this.l7.i$b != null)) return [3 /*break*/, 7];
                    a = this.mz.count;
                    b = this.l7.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.n3(this.mz.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.n3(this.mz.item(b.item(c))), this.n3(this.mv.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.mz.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.n3(this.mz.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.n3(this.mz.item(e)), this.n3(this.mv.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.nk = function () {
        var _this = this;
        return toEnum(function () { return _this._nk(); });
    };
    FinancialSeries.prototype.nr = function (a) {
        if (a == null) {
            return null;
        }
        if (this.nh && this.l7.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.l7.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.nq = 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.m5) {
            this.m5 = true;
            var b = this.mj(0, this.bz.count);
            this.m5 = false;
            var c = new FinancialEventArgs(0, this.bz.count, b, this.mk(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.m1 == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nv != null) {
                return this.nv.asArray();
            }
            var a = new List$1(Number_$type, 2, this.m1.count);
            var b = this.l7.i$b;
            var c = this.m1.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nv = a;
            return this.nv.asArray();
        }
        else {
            return this.m1.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.mx == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nt != null) {
                return this.nt.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mx.count);
            var b = this.l7.i$b;
            var c = this.mx.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nt = a;
            return this.nt.asArray();
        }
        else {
            return this.mx.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.mz == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nu != null) {
                return this.nu.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mz.count);
            var b = this.l7.i$b;
            var c = this.mz.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nu = a;
            return this.nu.asArray();
        }
        else {
            return this.mz.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.mv == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.ns != null) {
                return this.ns.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mv.count);
            var b = this.l7.i$b;
            var c = this.mv.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ns = a;
            return this.ns.asArray();
        }
        else {
            return this.mv.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.m4 == null) {
            return null;
        }
        if (this.l7 != null && typeCast(ISortingAxis_$type, this.l7) !== null) {
            if (this.nw != null) {
                return this.nw.asArray();
            }
            var a = new List$1(Number_$type, 2, this.m4.count);
            var b = this.l7.i$b;
            var c = this.m4.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nw = a;
            return this.nw.asArray();
        }
        else {
            return this.m4.asArray();
        }
    };
    FinancialSeries.prototype.hy = function (a, b, c, d) {
        _super.prototype.hy.call(this, a, b, c, d);
        if (this.l7 == null || !(typeCast(ISortingAxis_$type, this.l7) !== null)) {
            return;
        }
        var e = this.l7.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.nv != null) {
                        this.nv.insert(f, this.m1.item(g));
                    }
                    if (this.nt != null) {
                        this.nt.insert(f, this.mx.item(g));
                    }
                    if (this.nu != null) {
                        this.nu.insert(f, this.mz.item(g));
                    }
                    if (this.ns != null) {
                        this.ns.insert(f, this.mv.item(g));
                    }
                    if (this.nw != null) {
                        this.nw.insert(f, this.m4.item(g));
                    }
                }
                break;
            case 0:
                if (this.nv != null) {
                    this.nv.v(b, c);
                }
                if (this.nt != null) {
                    this.nt.v(b, c);
                }
                if (this.nu != null) {
                    this.nu.v(b, c);
                }
                if (this.ns != null) {
                    this.ns.v(b, c);
                }
                if (this.nw != null) {
                    this.nw.v(b, c);
                }
                break;
            case 4:
                if (this.nv != null) {
                    this.nv = new List$1(Number_$type, 0);
                }
                if (this.nt != null) {
                    this.nt = new List$1(Number_$type, 0);
                }
                if (this.nu != null) {
                    this.nu = new List$1(Number_$type, 0);
                }
                if (this.ns != null) {
                    this.ns = new List$1(Number_$type, 0);
                }
                if (this.nw != null) {
                    this.nw = 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.nv != null) {
                        this.nv._inner[h] = this.m1.item(i);
                    }
                    if (this.nt != null) {
                        this.nt._inner[h] = this.mx.item(i);
                    }
                    if (this.nu != null) {
                        this.nu._inner[h] = this.mz.item(i);
                    }
                    if (this.ns != null) {
                        this.ns._inner[h] = this.mv.item(i);
                    }
                    if (this.nw != null) {
                        this.nw._inner[h] = this.m4.item(i);
                    }
                }
                break;
        }
        this.o1();
        this.jp();
    };
    FinancialSeries.prototype.mj = function (a, b) {
        var _this = this;
        var c = this.nr(this.m1);
        var d = this.nr(this.mv);
        var e = this.nr(this.mx);
        var f = this.nr(this.mz);
        var g = this.nr(this.m4);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.np), _this.nq());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.no), ((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.nn), ((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.n3 = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.mk = 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.n3);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.l7;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.je = function (a, b) {
        _super.prototype.je.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.oy(this.mb, c);
        }
        this.df = false;
        this.o0(this.mb, c);
        this.dl = false;
    };
    FinancialSeries.prototype.jb = function (a, b, c, d, e) {
        _super.prototype.jb.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.l8 == null) {
            this.l8 = new CategoryFrame(3);
        }
        this.l8.u();
        this.oy(this.l8, g);
        this.o0(this.l8, g);
    };
    FinancialSeries.prototype.am = function (a) {
        if (this.l7 == a) {
            return this.ms;
        }
        if (this.ms == a) {
            return this.l7;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.l7);
        return b != null ? b.preferredCategoryMode(this) : this.me;
    };
    Object.defineProperty(FinancialSeries.prototype, "me", {
        get: function () {
            return this.md;
        },
        set: function (a) {
            var b = this.me;
            if (a != b) {
                this.md = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.me));
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cz = function () {
        return true;
    };
    FinancialSeries.prototype.jh = function (a, b) {
        _super.prototype.jh.call(this, a, b);
        this.pd = a;
    };
    FinancialSeries.prototype.o1 = function () {
        this.d8 = this.mv == null || this.mv.count == 0 ? NaN : this.mv.item(this.mv.count - 1);
    };
    FinancialSeries.prototype.fr = function (a) {
        if (this.mr != null && a != null) {
            if (this.mt == null || this.mt.propertyName != this.mr.dateTimeMemberPath) {
                this.mt = new FastReflectionHelper(false, this.mr.dateTimeMemberPath);
            }
            var b = this.mt.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.mr.itemLabelFormat());
            }
        }
        return _super.prototype.fr.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:ob:o2', [2, null], 'HighMemberPath:oe:o3', [2, null], 'IsCustomCategoryStyleAllowed:nd:o4', [0, false], 'IsTransitionInEnabled:ne:o5', [0, false], 'LowMemberPath:oj:o6', [2, null], 'NegativeBrush:pd:o7', [Brush.$, null], 'OpenMemberPath:on:o8', [2, null], 'TransitionInMode:mh:o9', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:or:pa', [2, null], 'XAxis:l7:pb', [CategoryAxisBase.$, null], 'YAxis:ms:pc', [NumericYAxis.$, null]]);
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ (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 */ (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 */ (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 */ (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.l7.b5) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.l7.e6 != null) {
            a += "<span>${item." + this.bw.l7.e6 + "}</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.al("financialSeries_Open");
        var e = c.al("financialSeries_High");
        var f = c.al("financialSeries_Low");
        var g = c.al("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.on + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.oe + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.oj + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.ob + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.or)) {
            var h = c.al("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.or + "}</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.k9 = 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