/*
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, Delegate_$type } from "igniteui-react-core/ES5/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core/ES5/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-react-core/ES5/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core/ES5/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core/ES5/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core/ES5/Brush";
import { DependencyProperty } from "igniteui-react-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 { List$1 } from "igniteui-react-core/ES5/List$1";
import { Dictionary$2 } from "igniteui-react-core/ES5/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-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-react-core/ES5/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core/ES5/PropertyMetadata";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core/ES5/SRProvider";
import { Color } from "igniteui-react-core/ES5/Color";
import { stringIsNullOrEmpty } from "igniteui-react-core/ES5/string";
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 };
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.bu.eo;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.bq;
        var c = this.a.bp;
        var d = this.a.bp;
        if (this.a.bu != null) {
            d = this.a.bu.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bu.lw == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.bu.lw != null) ? this.a.bu.lw.b8 : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.bu.le(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.bu.lw);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.bu.lw.dw(g.left, f));
            var j = Math.ceil(this.a.bu.lw.dw(g.right, f));
            if (this.a.bu.lw.b8) {
                j = Math.ceil(this.a.bu.lw.dw(g.left, f));
                i = Math.floor(this.a.bu.lw.dw(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 };
var FinancialSeries = /** @class */ (function (_super) {
    tslib_1.__extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.mn = null;
        _this.mj = null;
        _this.ml = null;
        _this.mh = null;
        _this.mq = null;
        _this.mu = false;
        _this.assigningCategoryStyle = null;
        _this.l4 = null;
        _this.m5 = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.m6 = new Dictionary$2(String_$type, String_$type, 0);
        _this.mt = false;
        _this.mf = null;
        _this.lz = null;
        _this.l1 = null;
        _this.ly = null;
        _this.o4 = null;
        _this.l7 = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.ms = false;
        _this.ni = null;
        _this.ng = null;
        _this.nh = null;
        _this.nf = null;
        _this.nj = null;
        _this.l0 = null;
        _this.lx = null;
        _this.l2 = 0;
        _this.l4 = new CategorySeriesRenderManager();
        _this.mu = false;
        _this.l7 = new CategoryTransitionSourceFramePreparer();
        _this.l0 = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.l3 = 0;
        return _this;
    }
    FinancialSeries.prototype.ii = function (a) {
        _super.prototype.ii.call(this, a);
        this.mc = a;
    };
    FinancialSeries.prototype.get_cq = function () {
        return true;
    };
    Object.defineProperty(FinancialSeries.prototype, "cq", {
        get: function () {
            return this.get_cq();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.ag = function () {
        return [this.lw, this.mg];
    };
    FinancialSeries.prototype.nu = function () {
        return 2;
    };
    FinancialSeries.prototype.ns = function () {
        return 4;
    };
    FinancialSeries.prototype.ah = function (a) {
        var b = this.aj(this.lw, this.ly.f, this.nr(this.bi), this.nt(this.bi), this.lc(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.nu();
        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.lw, this.ly.f, this.nr(this.bi), this.nt(this.bi), this.lc(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.kx = function () {
        return this.o0;
    };
    FinancialSeries.prototype.hj = function () {
        _super.prototype.hj.call(this);
        this.lw = null;
        this.mg = null;
    };
    Object.defineProperty(FinancialSeries.prototype, "mo", {
        get: function () {
            return this.mn;
        },
        set: function (a) {
            if (this.mn != a) {
                var b = this.mn;
                this.mn = a;
                this.raisePropertyChanged("OpenColumn", b, this.mn);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mk", {
        get: function () {
            return this.mj;
        },
        set: function (a) {
            if (this.mj != a) {
                var b = this.mj;
                this.mj = a;
                this.raisePropertyChanged("HighColumn", b, this.mj);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mm", {
        get: function () {
            return this.ml;
        },
        set: function (a) {
            if (this.ml != a) {
                var b = this.ml;
                this.ml = a;
                this.raisePropertyChanged("LowColumn", b, this.ml);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mi", {
        get: function () {
            return this.mh;
        },
        set: function (a) {
            if (this.mh != a) {
                var b = this.mh;
                this.mh = a;
                this.raisePropertyChanged("CloseColumn", b, this.mh);
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "mr", {
        get: function () {
            return this.mq;
        },
        set: function (a) {
            if (this.mq != a) {
                var b = this.mq;
                this.mq = a;
                this.raisePropertyChanged("VolumeColumn", b, this.mq);
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.m2 = function () {
        return (this.assigningCategoryStyle != null && this.mu) || this.ct;
    };
    FinancialSeries.prototype.om = function (a) {
        if (this.assigningCategoryStyle != null && this.mu) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.ok = function (a, b, c, d, e, f) {
        var g = this.b9;
        this.l4.ac(a, b, c, d, e, f, g);
        var h = this.l4.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.om(h);
        this.l4.aa(i, f, g);
    };
    FinancialSeries.prototype.nk = function (a) {
        return this.d8(a, this.lw);
    };
    FinancialSeries.prototype.e8 = function (a, b) {
        return this.e9(a, b, this.lw, runOn(this, this.nk), new FinancialValueList(this.mo, this.mk, this.mm, this.mi, this.mr));
    };
    FinancialSeries.prototype.e6 = function (a, b) {
        return this.e7(a, b, this.lw, runOn(this, this.nk), new FinancialValueList(this.mo, this.mk, this.mm, this.mi, this.mr));
    };
    FinancialSeries.prototype.d4 = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.lw.jq;
        return this.d5(a, b, this.lw, d, e, f, runOn(this, this.nk));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.lw.getCategorySize(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi));
    };
    FinancialSeries.prototype.k9 = function (a, b, c) {
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, null, null, null);
    };
    FinancialSeries.prototype.eh = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nl(this.bi.bq, this.bi.bp, d);
        var f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(new FinancialValueList(this.mo, this.mk, this.mm, this.mi, this.mr), a, this.lw, f, e, runOn(this, this.nk), b, c);
    };
    FinancialSeries.prototype.ed = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nl(this.bi.bq, this.bi.bp, d);
        var f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mk, a, this.lw, f, e, runOn(this, this.nk), b, c);
    };
    FinancialSeries.prototype.ef = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nl(this.bi.bq, this.bi.bp, d);
        var f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mm, a, this.lw, f, e, runOn(this, this.nk), b, c);
    };
    FinancialSeries.prototype.nm = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nl(this.bi.bq, this.bi.bp, d);
        var f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mi, a, this.lw, f, e, runOn(this, this.nk), b, c);
    };
    FinancialSeries.prototype.nn = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nl(this.bi.bq, this.bi.bp, d);
        var f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mo, a, this.lw, f, e, runOn(this, this.nk), b, c);
    };
    FinancialSeries.prototype.no = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.bi);
        var e = this.nl(this.bi.bq, this.bi.bp, d);
        var f = new ScalerParams(0, this.bi.bq, this.bi.bp, this.lw.b8, d);
        return this.ej(this.mr, a, this.lw, f, e, runOn(this, this.nk), b, c);
    };
    FinancialSeries.prototype.k5 = function (a, b, c) {
        var _this = this;
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.ed), function (d, e) { return _this.e9(d, e, _this.lw, runOn(_this, _this.nk), _this.mk); }, function (d, e) { return _this.e7(d, e, _this.lw, runOn(_this, _this.nk), _this.mk); });
    };
    FinancialSeries.prototype.k7 = function (a, b, c) {
        var _this = this;
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.ef), function (d, e) { return _this.e9(d, e, _this.lw, runOn(_this, _this.nk), _this.mm); }, function (d, e) { return _this.e7(d, e, _this.lw, runOn(_this, _this.nk), _this.mm); });
    };
    FinancialSeries.prototype.o2 = function (a, b, c) {
        var _this = this;
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.nn), function (d, e) { return _this.e9(d, e, _this.lw, runOn(_this, _this.nk), _this.mo); }, function (d, e) { return _this.e7(d, e, _this.lw, runOn(_this, _this.nk), _this.mo); });
    };
    FinancialSeries.prototype.o1 = function (a, b, c) {
        var _this = this;
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.nm), function (d, e) { return _this.e9(d, e, _this.lw, runOn(_this, _this.nk), _this.mi); }, function (d, e) { return _this.e7(d, e, _this.lw, runOn(_this, _this.nk), _this.mi); });
    };
    FinancialSeries.prototype.o3 = function (a, b, c) {
        var _this = this;
        return this.lb(a, b, c, this.nl(this.bi.bq, this.bi.bp, this.getEffectiveViewport1(this.bi)), this.mg, this.lw, runOn(this, this.no), function (d, e) { return _this.e9(d, e, _this.lw, runOn(_this, _this.nk), _this.mr); }, function (d, e) { return _this.e7(d, e, _this.lw, runOn(_this, _this.nk), _this.mr); });
    };
    FinancialSeries.prototype.h0 = function () {
        _super.prototype.h0.call(this);
        if (this.lw != null) {
            this.lw.gz(false);
        }
        if (this.mg != null) {
            this.mg.gz(false);
        }
    };
    FinancialSeries.prototype.jh = function (a, b) {
        this.mc.bs.e(this.eo);
        this.i1(false);
    };
    FinancialSeries.prototype.jg = function (a, b) {
        if (this.dj && this.et < 0.05) {
            this.dk = true;
        }
        this.mc.bs.e(this.eo);
        this.i1(false);
    };
    FinancialSeries.prototype.mp = function (a, b, c) {
        var d = this.bw(b);
        this.m5.addItem(d, b);
        this.m6.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.oj = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.m5.item(b);
        this.m6.removeItem(c);
        this.m5.removeItem(b);
    };
    FinancialSeries.prototype.io = function (a, b, c, d) {
        _super.prototype.io.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.lw != null) {
                        this.lw.bv(this);
                    }
                    if (this.mg != null) {
                        this.mg.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.lw != null) {
                        this.lw.ch(this);
                    }
                    if (this.mg != null) {
                        this.mg.ch(this);
                    }
                }
                this.mc.bs.e(this.eo);
                this.i1(false);
                break;
            case "FastItemsSource":
                this.mt = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mo);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mk);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mm);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mi);
                    this.oj(typeCast(IFastItemsSource_$type, c), this.mr);
                    this.mo = null;
                    this.mk = null;
                    this.mm = null;
                    this.mi = null;
                    this.mr = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (this.oa != null) {
                        this.mo = this.mp(typeCast(IFastItemsSource_$type, d), this.oa, "OpenColumn");
                    }
                    if (this.n1 != null) {
                        this.mk = this.mp(typeCast(IFastItemsSource_$type, d), this.n1, "HighColumn");
                    }
                    if (this.n6 != null) {
                        this.mm = this.mp(typeCast(IFastItemsSource_$type, d), this.n6, "LowColumn");
                    }
                    if (this.ny != null) {
                        this.mi = this.mp(typeCast(IFastItemsSource_$type, d), this.ny, "CloseColumn");
                    }
                    if (this.oe != null) {
                        this.mr = this.mp(typeCast(IFastItemsSource_$type, d), this.oe, "VolumeColumn");
                    }
                }
                this.mt = false;
                if (this.mg != null && !this.mg.ck()) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mo);
                    this.mo = this.mp(this.bz, this.oa, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mk);
                    this.mk = this.mp(this.bz, this.n1, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mm);
                    this.mm = this.mp(this.bz, this.n6, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mi);
                    this.mi = this.mp(this.bz, this.ny, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                this.oo();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.oj(this.bz, this.mr);
                    this.mr = this.mp(this.bz, this.oe, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.mg != null && !this.mg.ck() && !this.mt) {
                    this.mc.bs.e(this.eo);
                    this.i1(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mc.bs.e(this.eo);
                this.i1(false);
                this.h8();
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mc.bs.e(this.eo);
                if (this.mg != null) {
                    this.mg.ck();
                }
                {
                    this.i1(false);
                }
                this.h8();
                break;
            case "TransitionProgress":
                this.l1.c(this.et, this.lz, this.ly);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.et == 1) {
                    this.ly.v();
                    this.on(this.ly, this.mc);
                    if (this.dj) {
                        this.dj = false;
                        this.hm();
                        this.bt.r = truncate(this.ek());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.on(this.l1, this.mc);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.i1(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.mu = this.mx();
                this.i1(false);
                break;
            case "CategoryMode":
                if (this.lw != null) {
                    this.lw.kf(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.mw = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.mv = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.lp = 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.nr = function (a) {
        return a.bs.b;
    };
    FinancialSeries.prototype.nt = function (a) {
        return a.bs.c;
    };
    FinancialSeries.prototype.lo = function (a, b) {
        return this.lp(a, b, this.mg);
    };
    FinancialSeries.prototype.get_my = function () {
        return false;
    };
    Object.defineProperty(FinancialSeries.prototype, "my", {
        get: function () {
            return this.get_my();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cu = function () {
        return true;
    };
    Object.defineProperty(FinancialSeries.prototype, "cu", {
        get: function () {
            return this.get_cu();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.at = function (a, b) {
        if (this.my) {
            var c = this.me(a, b, this.mf);
            this.mf = c;
            return c;
        }
        else {
            var d = this.md(a, b, this.mf);
            this.mf = d;
            return d;
        }
    };
    FinancialSeries.prototype.nv = function (a) {
        var b = this.ly;
        if (this.ca()) {
            b = this.l1;
        }
        var c = this.bi.bp;
        var d = this.bi.bq;
        var e = this.lw;
        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.me = function (a, b, c) {
        var d = this.bz.count;
        var e = this.mc.bs.c;
        var f = this.mc.bs.d;
        var g = this.mc.bs.b;
        var h = this.lw;
        var i = -1;
        var j = -1;
        if (h.cc) {
            var k = this.ly;
            if (this.ca()) {
                k = this.l1;
            }
            var l = this.nv(b);
            i = l;
            j = l;
        }
        else {
            var m = this.e2(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.md = 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.mx = function () {
        return this.m0;
    };
    FinancialSeries.prototype.d6 = function (a) {
        var b = this.bi.bq;
        var c = this.bi.bp;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.lw != null) {
            var e = this.getEffectiveViewport1(this.bi);
            var f = new ScalerParams(0, b, c, this.lw.b8, e);
            var g = this.le(this.bi);
            var h = this.lw.dw(g.left, f);
            var i = this.lw.dw(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.lw.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.e2 = function (a) {
        return truncate(Math.round(this.d6(a)));
    };
    FinancialSeries.prototype.get_c0 = function () {
        return typeCast(ISortingAxis_$type, this.lw) !== null;
    };
    Object.defineProperty(FinancialSeries.prototype, "c0", {
        get: function () {
            return this.get_c0();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.ap = function () {
        return this.lw;
    };
    FinancialSeries.prototype.e4 = function (a) {
        var b = this.bi.bq;
        var c = this.bi.bp;
        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.lw.b8, d);
        var g = typeCast(ISortingAxis_$type, this.lw);
        var h = this.le(this.bi);
        var i = h.left;
        var j = h.right;
        var k = this.k4(a).x;
        var l = this.lw.dw(k, f);
        var m = this.lw.dw(i, f);
        var n = this.lw.dw(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.fj = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.lw) !== null) {
            b = this.e4(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e2(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    };
    FinancialSeries.prototype.nl = function (a, b, c) {
        if (this.lw == null) {
            return 0;
        }
        return this.lw.getOffset(a, b, c, this.fb);
    };
    FinancialSeries.prototype.c9 = function () {
        return this.m1;
    };
    FinancialSeries.prototype.l5 = function () {
        return 11;
    };
    FinancialSeries.prototype.bo = function () {
        return 3;
    };
    FinancialSeries.prototype.on = function (a, b) {
        this.ld = a.aa;
        b.ar();
    };
    Object.defineProperty(FinancialSeries.prototype, "o5", {
        get: function () {
            return this.o4;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.ol = function (a, b) {
        a.u();
    };
    FinancialSeries.prototype.dt = function (a, b, c) {
        var d = _super.prototype.dt.call(this, a, b, c);
        var e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.lw == null || this.mg == null || e.bs.b < 1 || this.lw.bf == null || this.mg.bf == null || this.mg.jw == this.mg.jv || this.lw.itemsSource == null || this.lw.jq < 1) {
            e.bs.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.bi.bq;
        a = this.bi.bp;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.np = function (a) {
        var b = 0;
        var c = a.bq;
        var d = a.bp;
        var e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.mg != null) {
            var f = new ScalerParams(0, c, d, this.mg.b8, e);
            b = this.mg.dt(this.mg.j6, f);
        }
        return b;
    };
    FinancialSeries.prototype.hm = function () {
        _super.prototype.hm.call(this);
        this.lz.v();
        this.ly.v();
        this.l1.v();
    };
    FinancialSeries.prototype.i2 = function (a) {
        var _this = this;
        _super.prototype.i2.call(this, a);
        this.mc.bs.e(this.eo);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.db) {
            if (this.ca()) {
                this.on(this.l1, this.mc);
            }
            else {
                this.on(this.ly, this.mc);
            }
            return;
        }
        if (this.c7(a)) {
            var b = this.lz;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.lz = this.l1;
                this.l1 = b;
            }
            else {
                this.lz = this.ly;
                this.ly = b;
            }
            this.ol(this.ly, this.mc);
            if (this.dl) {
                this.bt.w();
                this.bt.r = truncate(this.el());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.l7.p(this.lz, this.ly, this.isVertical, this.lw, this.mg, this.l6, this.l5(), this.bp, this.bo(), function () { return _this.np(_this.mc); }, this.mc.bp);
            }
            this.hi();
            this.i9();
            if (this.dl) {
                this.dk = false;
                this.dj = true;
            }
        }
        else {
            this.ol(this.ly, this.mc);
            this.on(this.ly, this.mc);
        }
    };
    FinancialSeries.prototype.m3 = function (a) {
        try {
            for (var _a = tslib_1.__values(fromEnum(a)), _b = _a.next(); !_b.done; _b = _a.next()) {
                var b = _b.value;
                switch (b) {
                    case "HighColumn":
                        if (this.mk == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.mm == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.mo == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.mi == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.mr == null) {
                            return false;
                        }
                        break;
                }
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
            }
            finally { if (e_1) throw e_1.error; }
        }
        return true;
        var e_1, _c;
    };
    Object.defineProperty(FinancialSeries.prototype, "m4", {
        get: function () {
            return this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.mz = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.oi = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "nc", {
        get: function () {
            return this.m9();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._m9 = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h, e_2, _c;
        return tslib_1.__generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.mz()) return [3 /*break*/, 8];
                    b = this.l8(0, this.bz.count);
                    this.oi(new FinancialEventArgs(0, this.bz.count, b, this.l9(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.m4 && this.lw.i$b != null)) return [3 /*break*/, 13];
                    d = this.bz.count;
                    e = this.lw.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d)) return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.mk.item(e.item(f)) + this.mm.item(e.item(f)) + this.mi.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.mk.item(h) + this.mm.item(h) + this.mi.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.m9 = function () {
        var _this = this;
        return toEnum(function () { return _this._m9(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "nb", {
        get: function () {
            return this.m8();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._m8 = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.m4 && this.lw.i$b != null)) return [3 /*break*/, 7];
                    a = this.mk.count;
                    b = this.lw.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.nq(this.mk.item(b.item(0)) - this.mm.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.nq(this.mk.item(b.item(c)) - this.mm.item(b.item(c))), Math.max(this.nq(Math.abs(this.mk.item(b.item(c)) - this.mi.item(b.item(c - 1)))), this.nq(Math.abs(this.mm.item(b.item(c)) - this.mi.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.mk.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.nq(this.mk.item(0) - this.mm.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.nq(this.mk.item(e) - this.mm.item(e)), Math.max(this.nq(Math.abs(this.mk.item(e) - this.mi.item(e - 1))), this.nq(Math.abs(this.mm.item(e) - this.mi.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.m8 = function () {
        var _this = this;
        return toEnum(function () { return _this._m8(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "na", {
        get: function () {
            return this.m7();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype._m7 = function () {
        var a, b, c, d, e;
        return tslib_1.__generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.m4 && this.lw.i$b != null)) return [3 /*break*/, 7];
                    a = this.mm.count;
                    b = this.lw.i$b;
                    if (!(a > 0)) return [3 /*break*/, 2];
                    return [4 /*yield*/, this.nq(this.mm.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.nq(this.mm.item(b.item(c))), this.nq(this.mi.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.mm.count;
                    if (!(d > 0)) return [3 /*break*/, 9];
                    return [4 /*yield*/, this.nq(this.mm.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.nq(this.mm.item(e)), this.nq(this.mi.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.m7 = function () {
        var _this = this;
        return toEnum(function () { return _this._m7(); });
    };
    FinancialSeries.prototype.ne = function (a) {
        if (a == null) {
            return null;
        }
        if (this.m4 && this.lw.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.lw.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.nd = 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.ms) {
            this.ms = true;
            var b = this.l8(0, this.bz.count);
            this.ms = false;
            var c = new FinancialEventArgs(0, this.bz.count, b, this.l9(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.mo == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.ni != null) {
                return this.ni.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mo.count);
            var b = this.lw.i$b;
            var c = this.mo.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ni = a;
            return this.ni.asArray();
        }
        else {
            return this.mo.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.mk == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.ng != null) {
                return this.ng.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mk.count);
            var b = this.lw.i$b;
            var c = this.mk.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.ng = a;
            return this.ng.asArray();
        }
        else {
            return this.mk.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.mm == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.nh != null) {
                return this.nh.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mm.count);
            var b = this.lw.i$b;
            var c = this.mm.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nh = a;
            return this.nh.asArray();
        }
        else {
            return this.mm.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.mi == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.nf != null) {
                return this.nf.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mi.count);
            var b = this.lw.i$b;
            var c = this.mi.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nf = a;
            return this.nf.asArray();
        }
        else {
            return this.mi.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.mr == null) {
            return null;
        }
        if (this.lw != null && typeCast(ISortingAxis_$type, this.lw) !== null) {
            if (this.nj != null) {
                return this.nj.asArray();
            }
            var a = new List$1(Number_$type, 2, this.mr.count);
            var b = this.lw.i$b;
            var c = this.mr.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nj = a;
            return this.nj.asArray();
        }
        else {
            return this.mr.asArray();
        }
    };
    FinancialSeries.prototype.ho = function (a, b, c, d) {
        _super.prototype.ho.call(this, a, b, c, d);
        if (this.lw == null || !(typeCast(ISortingAxis_$type, this.lw) !== null)) {
            return;
        }
        var e = this.lw.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.ni != null) {
                        this.ni.insert(f, this.mo.item(g));
                    }
                    if (this.ng != null) {
                        this.ng.insert(f, this.mk.item(g));
                    }
                    if (this.nh != null) {
                        this.nh.insert(f, this.mm.item(g));
                    }
                    if (this.nf != null) {
                        this.nf.insert(f, this.mi.item(g));
                    }
                    if (this.nj != null) {
                        this.nj.insert(f, this.mr.item(g));
                    }
                }
                break;
            case 0:
                if (this.ni != null) {
                    this.ni.v(b, c);
                }
                if (this.ng != null) {
                    this.ng.v(b, c);
                }
                if (this.nh != null) {
                    this.nh.v(b, c);
                }
                if (this.nf != null) {
                    this.nf.v(b, c);
                }
                if (this.nj != null) {
                    this.nj.v(b, c);
                }
                break;
            case 4:
                if (this.ni != null) {
                    this.ni = new List$1(Number_$type, 0);
                }
                if (this.ng != null) {
                    this.ng = new List$1(Number_$type, 0);
                }
                if (this.nh != null) {
                    this.nh = new List$1(Number_$type, 0);
                }
                if (this.nf != null) {
                    this.nf = new List$1(Number_$type, 0);
                }
                if (this.nj != null) {
                    this.nj = 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.ni != null) {
                        this.ni._inner[h] = this.mo.item(i);
                    }
                    if (this.ng != null) {
                        this.ng._inner[h] = this.mk.item(i);
                    }
                    if (this.nh != null) {
                        this.nh._inner[h] = this.mm.item(i);
                    }
                    if (this.nf != null) {
                        this.nf._inner[h] = this.mi.item(i);
                    }
                    if (this.nj != null) {
                        this.nj._inner[h] = this.mr.item(i);
                    }
                }
                break;
        }
        this.oo();
    };
    FinancialSeries.prototype.l8 = function (a, b) {
        var _this = this;
        var c = this.ne(this.mo);
        var d = this.ne(this.mi);
        var e = this.ne(this.mk);
        var f = this.ne(this.mm);
        var g = this.ne(this.mr);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.nc), _this.nd());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.nb), ((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.na), ((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.nq = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.l9 = 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.dw;
            $ret.j = Series.dv;
            $ret.i = runOn(_this, _this.nq);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.lw;
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.i3 = function (a, b) {
        _super.prototype.i3.call(this, a, b);
        if (!this.di) {
            this.bi.az(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bs.e(this.eo);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.dc) {
            this.ol(this.l0, c);
        }
        this.dc = false;
        this.on(this.l0, c);
        this.di = false;
    };
    FinancialSeries.prototype.i0 = function (a, b, c, d, e) {
        _super.prototype.i0.call(this, a, b, c, d, e);
        var f = this.a0.a$h.item(d);
        var g = f;
        g.bs.e(this.eo);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.lx == null) {
            this.lx = new CategoryFrame(3);
        }
        this.lx.u();
        this.ol(this.lx, g);
        this.on(this.lx, g);
    };
    FinancialSeries.prototype.am = function (a) {
        if (this.lw == a) {
            return this.mg;
        }
        if (this.mg == a) {
            return this.lw;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.lw);
        return b != null ? b.preferredCategoryMode(this) : this.l3;
    };
    Object.defineProperty(FinancialSeries.prototype, "l3", {
        get: function () {
            return this.l2;
        },
        set: function (a) {
            var b = this.l3;
            if (a != b) {
                this.l2 = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.l3));
            }
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.get_cy = function () {
        return true;
    };
    Object.defineProperty(FinancialSeries.prototype, "cy", {
        get: function () {
            return this.get_cy();
        },
        enumerable: true,
        configurable: true
    });
    FinancialSeries.prototype.i6 = function (a, b) {
        _super.prototype.i6.call(this, a, b);
        this.o0 = a;
    };
    FinancialSeries.prototype.oo = function () {
        this.d3 = this.mi == null || this.mi.count == 0 ? NaN : this.mi.item(this.mi.count - 1);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:ny:op', [2, null], 'HighMemberPath:n1:oq', [2, null], 'IsCustomCategoryStyleAllowed:m0:or', [0, false], 'IsTransitionInEnabled:m1:os', [0, false], 'LowMemberPath:n6:ot', [2, null], 'NegativeBrush:o0:ou', [Brush.$, null], 'OpenMemberPath:oa:ov', [2, null], 'TransitionInMode:l6:ow', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:oe:ox', [2, null], 'XAxis:lw:oy', [CategoryAxisBase.$, null], 'YAxis:mg:oz', [NumericYAxis.$, null]]);
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 };
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 };
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 };
var FinancialSeriesView = /** @class */ (function (_super) {
    tslib_1.__extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.bu = null;
        _this.bs = null;
        _this.bw = 0;
        _this.bw = -1;
        _this.bu = a;
        _this.bs = _this.bt();
        return _this;
    }
    FinancialSeriesView.prototype.bv = function (a) {
        if (this.bw != a.t) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.bx = function (a) {
        this.bw = 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.bu.lw.b5) {
            var b = this.bu.lw;
            a += "<span>${item." + b.dateTimeMemberPath + "}</span><br/>";
        }
        else if (this.bu.lw.e1 != null) {
            a += "<span>${item." + this.bu.lw.e1 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var c = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(c)) {
            a += " style='color:" + c + "'";
        }
        var d = new SRProvider(this.t);
        var e = d.al("financialSeries_Open");
        var f = d.al("financialSeries_High");
        var g = d.al("financialSeries_Low");
        var h = d.al("financialSeries_Close");
        e = stringIsNullOrEmpty(e) ? "Open" : e;
        f = stringIsNullOrEmpty(f) ? "High" : f;
        g = stringIsNullOrEmpty(g) ? "Low" : g;
        h = stringIsNullOrEmpty(h) ? "Close" : h;
        a += ">" + this.bu.fo + "</span><table><tr><td>" + e + ":</td><td>" + "${item." + this.bu.oa + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bu.n1 + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bu.n6 + "}</td></tr><tr><td>" + h + ":</td><td>" + "${item." + this.bu.ny + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bu.oe)) {
            var i = d.al("financialSeries_Volume");
            i = stringIsNullOrEmpty(i) ? "Volume" : i;
            a += "<tr><td>" + i + ":</td><td>" + "${item." + this.bu.oe + "}</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.ky = a;
        this.e.ep = 5;
        this.e.eq = 2;
        this.e.er = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
/*<BeginStatics Name="Infragistics.Controls.Charts.FinancialSeries" />*/
/*<EndStatics Name="Infragistics.Controls.Charts.FinancialSeries" />*/
