/*
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 { __extends, __generator, __values } from "tslib";
import { EventArgs, Base, markType, typeCast, runOn, delegateCombine, enumGetBox, Point_$type, String_$type, Number_$type, fromEnum, toEnum, Date_$type, markDep, Delegate_$type } from "igniteui-angular-core";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-angular-core";
import { IFastItemColumn$1_$type } from "igniteui-angular-core";
import { Series } from "./Series";
import { Rect } from "igniteui-angular-core";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-angular-core";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-angular-core";
import { DependencyProperty } from "igniteui-angular-core";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "igniteui-angular-core";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-angular-core";
import { List$1 } from "igniteui-angular-core";
import { SeriesLayerPropertyOverlay } from "./SeriesLayerPropertyOverlay";
import { Dictionary$2 } from "igniteui-angular-core";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-angular-core";
import { FinancialValueList } from "./FinancialValueList";
import { CategoryXAxis } from "./CategoryXAxis";
import { SafeSortedReadOnlyDoubleCollection } from "./SafeSortedReadOnlyDoubleCollection";
import { SafeReadOnlyDoubleCollection } from "./SafeReadOnlyDoubleCollection";
import { SafeEnumerable } from "./SafeEnumerable";
import { CalculatedColumn } from "./CalculatedColumn";
import { TrendCalculators } from "igniteui-angular-core";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-angular-core";
import { stringIsNullOrEmpty } from "igniteui-angular-core";
import { dateToStringFormat } from "igniteui-angular-core";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-angular-core";
import { Color } from "igniteui-angular-core";
/**
 * @hidden
 */
var FinancialEventArgs = /** @class */ /*@__PURE__*/ (function (_super) {
    __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: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (a) {
            this._dataSource = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "supportingCalculations", {
        get: function () {
            return this._supportingCalculations;
        },
        set: function (a) {
            this._supportingCalculations = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialEventArgs.prototype, "basedOn", {
        get: function () {
            return this._basedOn;
        },
        set: function (a) {
            this._basedOn = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
    return FinancialEventArgs;
}(EventArgs));
export { FinancialEventArgs };
/**
 * @hidden
 */
var FinancialBucketCalculator = /** @class */ /*@__PURE__*/ (function (_super) {
    __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.cf.ie;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    };
    FinancialBucketCalculator.prototype.e = function (a) {
        var b = this.a.ca;
        var c = this.a.b9;
        var d = this.a.b9;
        if (this.a.cf != null) {
            d = this.a.cf.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.cf.xg == null) {
            this.b = 0;
            return;
        }
        var e = (this.a.cf.xg != null) ? this.a.cf.xg.df : false;
        var f = new ScalerParams(0, b, c, e, d);
        var g = this.a.cf.wt(this.a);
        var h = typeCast(ISortingAxis_$type, this.a.cf.xg);
        if (h == null || h.i$b == null) {
            var i = Math.floor(this.a.cf.xg.fw(g.left, f));
            var j = Math.ceil(this.a.cf.xg.fw(g.right, f));
            if (this.a.cf.xg.df) {
                j = Math.ceil(this.a.cf.xg.fw(g.left, f));
                i = Math.floor(this.a.cf.xg.fw(g.right, f));
            }
            var k = Math.floor((j - i + 1) * a / g.width);
            this.b = truncate(Math.max(1, k));
            this.c = truncate(Math.floor(i / this.b));
            this.d = truncate(Math.ceil(j / this.b));
        }
        else {
            this.c = h.i$e(b, c, d, g);
            this.d = h.i$g(b, c, d, g);
            this.b = 1;
        }
    };
    FinancialBucketCalculator.prototype.cacheValues = function () {
    };
    FinancialBucketCalculator.prototype.unCacheValues = function () {
    };
    FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
    return FinancialBucketCalculator;
}(Base));
export { FinancialBucketCalculator };
/**
 * @hidden
 */
var FinancialSeries = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeries, _super);
    function FinancialSeries() {
        var _this = _super.call(this) || this;
        _this.x7 = null;
        _this.x5 = null;
        _this.x6 = null;
        _this.x4 = null;
        _this.x8 = null;
        _this.yh = false;
        _this.assigningCategoryStyle = null;
        _this.xp = null;
        _this.yr = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        _this.ys = new Dictionary$2(String_$type, String_$type, 0);
        _this.yg = false;
        _this.x3 = null;
        _this.xk = null;
        _this.xm = null;
        _this.xi = null;
        _this.xs = null;
        _this.typical = null;
        _this.typicalBasedOn = null;
        _this.yf = false;
        _this.y4 = null;
        _this.y2 = null;
        _this.y3 = null;
        _this.y1 = null;
        _this.y5 = null;
        _this.xl = null;
        _this.xh = null;
        _this.xn = 0;
        _this.xy = null;
        _this.x0 = null;
        _this.xp = new CategorySeriesRenderManager();
        _this.yh = false;
        _this.xs = new CategoryTransitionSourceFramePreparer();
        _this.xl = new CategoryFrame(3);
        _this.ab = FinancialSeries.$;
        _this.xo = 0;
        return _this;
    }
    FinancialSeries.prototype.hu = function () {
        var a = _super.prototype.hu.call(this);
        {
            var b = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "OpenMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedOpenMemberPath";
                $ret.q = true;
                return $ret;
            })());
            b.valueResolving = delegateCombine(b.valueResolving, runOn(this, this.aaj));
            a.add(b);
        }
        {
            var c = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "HighMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedHighMemberPath";
                $ret.q = true;
                return $ret;
            })());
            c.valueResolving = delegateCombine(c.valueResolving, runOn(this, this.aah));
            a.add(c);
        }
        {
            var d = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "LowMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedLowMemberPath";
                $ret.q = true;
                return $ret;
            })());
            d.valueResolving = delegateCombine(d.valueResolving, runOn(this, this.aai));
            a.add(d);
        }
        {
            var e = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "CloseMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedCloseMemberPath";
                $ret.q = true;
                return $ret;
            })());
            e.valueResolving = delegateCombine(e.valueResolving, runOn(this, this.aag));
            a.add(e);
        }
        {
            var f = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.ad = "VolumeMemberPath";
                $ret.p = true;
                $ret.y = "HighlightedVolumeMemberPath";
                $ret.q = true;
                return $ret;
            })());
            f.valueResolving = delegateCombine(f.valueResolving, runOn(this, this.aak));
            a.add(f);
        }
        {
            var g = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Brush";
                $ret.p = true;
                $ret.y = "ActualBrush";
                $ret.q = true;
                return $ret;
            })());
            g.valueResolving = delegateCombine(g.valueResolving, runOn(this, this.r8));
            a.add(g);
        }
        {
            var h = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "Outline";
                $ret.p = true;
                $ret.y = "ActualOutline";
                $ret.q = true;
                return $ret;
            })());
            h.valueResolving = delegateCombine(h.valueResolving, runOn(this, this.r8));
            a.add(h);
        }
        {
            var i = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "NegativeBrush";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            i.valueResolving = delegateCombine(i.valueResolving, runOn(this, this.r8));
            a.add(i);
        }
        {
            var j = ((function () {
                var $ret = new SeriesLayerPropertyOverlay();
                $ret.r = true;
                $ret.ad = "NegativeOutline";
                $ret.p = true;
                $ret.q = true;
                return $ret;
            })());
            j.valueResolving = delegateCombine(j.valueResolving, runOn(this, this.r8));
            a.add(j);
        }
        var k = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "IsTransitionInEnabled";
            $ret.x = true;
            $ret.q = true;
            return $ret;
        })());
        a.add(k);
        var l = ((function () {
            var $ret = new SeriesLayerPropertyOverlay();
            $ret.p = true;
            $ret.ad = "TransitionInMode";
            $ret.x = enumGetBox(CategoryTransitionInMode_$type, 20);
            $ret.q = true;
            return $ret;
        })());
        a.add(l);
        return a;
    };
    FinancialSeries.prototype.aaj = function (a, b) {
        if (this.zt != null) {
            b.value = this.zt;
            return;
        }
        b.value = this.z6;
    };
    FinancialSeries.prototype.aah = function (a, b) {
        if (this.zp != null) {
            b.value = this.zp;
            return;
        }
        b.value = this.zx;
    };
    FinancialSeries.prototype.aai = function (a, b) {
        if (this.zr != null) {
            b.value = this.zr;
            return;
        }
        b.value = this.z2;
    };
    FinancialSeries.prototype.aag = function (a, b) {
        if (this.zn != null) {
            b.value = this.zn;
            return;
        }
        b.value = this.zk;
    };
    FinancialSeries.prototype.aak = function (a, b) {
        if (this.zv != null) {
            b.value = this.zv;
            return;
        }
        b.value = this.aaa;
    };
    FinancialSeries.prototype.kz = function () {
        if (this.d4()) {
            return this.bo.xm;
        }
        else {
            return this.bo.xi;
        }
    };
    FinancialSeries.prototype.q7 = function (a) {
        _super.prototype.q7.call(this, a);
        this.xx = a;
    };
    FinancialSeries.prototype.get_e8 = function () {
        return true;
    };
    FinancialSeries.prototype.ai = function () {
        return [this.xg, this.xz];
    };
    FinancialSeries.prototype.ku = function (a, b) {
        var c = this.ni(b);
        if (c == FinancialSeries.$$p[11]) {
            return this.kv(a, b, this.z6);
        }
        if (c == FinancialSeries.$$p[1]) {
            return this.kv(a, b, this.zx);
        }
        if (c == FinancialSeries.$$p[9]) {
            return this.kv(a, b, this.z2);
        }
        if (c == FinancialSeries.$$p[0]) {
            return this.kv(a, b, this.zk);
        }
        if (c == FinancialSeries.$$p[13]) {
            return this.kv(a, b, this.aaa);
        }
        if (c == FinancialSeries.$$p[5]) {
            return this.kv(a, b, this.zt);
        }
        if (c == FinancialSeries.$$p[3]) {
            return this.kv(a, b, this.zp);
        }
        if (c == FinancialSeries.$$p[4]) {
            return this.kv(a, b, this.zr);
        }
        if (c == FinancialSeries.$$p[2]) {
            return this.kv(a, b, this.zn);
        }
        if (c == FinancialSeries.$$p[6]) {
            return this.kv(a, b, this.zv);
        }
        return _super.prototype.ku.call(this, a, b);
    };
    FinancialSeries.prototype.mi = function (a) {
        var b = this.ni(a);
        if (b == FinancialSeries.$$p[11]) {
            return this.z6;
        }
        if (b == FinancialSeries.$$p[1]) {
            return this.zx;
        }
        if (b == FinancialSeries.$$p[9]) {
            return this.z2;
        }
        if (b == FinancialSeries.$$p[0]) {
            return this.zk;
        }
        if (b == FinancialSeries.$$p[13]) {
            return this.aaa;
        }
        if (b == FinancialSeries.$$p[5]) {
            return this.zt;
        }
        if (b == FinancialSeries.$$p[3]) {
            return this.zp;
        }
        if (b == FinancialSeries.$$p[4]) {
            return this.zr;
        }
        if (b == FinancialSeries.$$p[2]) {
            return this.zn;
        }
        if (b == FinancialSeries.$$p[6]) {
            return this.zv;
        }
        return _super.prototype.mi.call(this, a);
    };
    FinancialSeries.prototype.zg = function () {
        return 2;
    };
    FinancialSeries.prototype.ze = function () {
        return 4;
    };
    FinancialSeries.prototype.aj = function (a) {
        var b = this.an(this.xg, this.xi.h, this.zd(this.cw), this.zf(this.cw), this.wr(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.zg();
        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.al = function (a) {
        var b = this.an(this.xg, this.xi.h, this.zd(this.cw), this.zf(this.cw), this.wr(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.v6 = function () {
        return this.aa6;
    };
    FinancialSeries.prototype.v7 = function () {
        return this.aa6;
    };
    FinancialSeries.prototype.o8 = function () {
        _super.prototype.o8.call(this);
        this.xg = null;
        this.xz = null;
    };
    FinancialSeries.prototype.get_em = function () {
        return true;
    };
    FinancialSeries.prototype.get_f6 = function () {
        return this.xz != null && this.xz.df;
    };
    Object.defineProperty(FinancialSeries.prototype, "yc", {
        get: function () {
            return this.x7;
        },
        set: function (a) {
            if (this.x7 != a) {
                var b = this.x7;
                this.x7 = a;
                this.raisePropertyChanged("OpenColumn", b, this.x7);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "ya", {
        get: function () {
            return this.x5;
        },
        set: function (a) {
            if (this.x5 != a) {
                var b = this.x5;
                this.x5 = a;
                this.raisePropertyChanged("HighColumn", b, this.x5);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "yb", {
        get: function () {
            return this.x6;
        },
        set: function (a) {
            if (this.x6 != a) {
                var b = this.x6;
                this.x6 = a;
                this.raisePropertyChanged("LowColumn", b, this.x6);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "x9", {
        get: function () {
            return this.x4;
        },
        set: function (a) {
            if (this.x4 != a) {
                var b = this.x4;
                this.x4 = a;
                this.raisePropertyChanged("CloseColumn", b, this.x4);
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialSeries.prototype, "ye", {
        get: function () {
            return this.x8;
        },
        set: function (a) {
            if (this.x8 != a) {
                var b = this.x8;
                this.x8 = a;
                this.raisePropertyChanged("VolumeColumn", b, this.x8);
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.gc = function () {
        return this.highlightedItemsSource != null || (this.zt != null && this.zp != null && this.zr != null && this.zn != null);
    };
    FinancialSeries.prototype.yo = function () {
        return (this.assigningCategoryStyle != null && this.yh) || this.by != 1 || this.cq != 1 || this.cp != 1;
    };
    FinancialSeries.prototype.aan = function (a) {
        if (this.assigningCategoryStyle != null && this.yh) {
            this.assigningCategoryStyle(this, a);
        }
    };
    FinancialSeries.prototype.aal = function (a, b, c, d, e, f, g) {
        var h = this.by != 1;
        var i = this.cq != 1;
        var j = this.cp != 1;
        this.xp.a3(this.xp.b, d.dm, a, b, c, d, e, f, false, g);
        this.xp.ab(this.ic);
        var k = this.xp.ay;
        var l = null;
        var m = null;
        var n = null;
        var o = this.dp;
        if (h && this.dc != null) {
            l = this.dc.d0.getHighlightingInfo(this, o, k.z, k.y, false);
            k.c = l;
        }
        if (i && this.dc != null) {
            m = this.dc.d1.getHighlightingInfo(this, o, k.z, k.y, false);
            if (m == null && this.bo != null) {
                m = this.dc.d1.getHighlightingInfo(this.bo, this.bo.dp, k.z, k.y, false);
            }
            k.d = m;
        }
        if (j && this.dc != null) {
            n = this.dc.dz.getHighlightingInfo(this, o, k.z, k.y, false);
            k.b = n;
        }
        k.h = f;
        this.aan(k);
        this.xp.z(this, l, m, n, f, h, i, j, b < 0);
    };
    FinancialSeries.prototype.y6 = function (a) {
        return this.iv(a, this.xg);
    };
    FinancialSeries.prototype.ke = function (a, b) {
        return this.kf(a, b, this.xg, runOn(this, this.y6), new FinancialValueList(this.yc, this.ya, this.yb, this.x9, this.ye));
    };
    FinancialSeries.prototype.kc = function (a, b) {
        return this.kd(a, b, this.xg, runOn(this, this.y6), new FinancialValueList(this.yc, this.ya, this.yb, this.x9, this.ye));
    };
    FinancialSeries.prototype.ir = function (a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        var f = this.xg.o5;
        return this.is(a, b, this.xg, d, e, f, runOn(this, this.y6));
    };
    FinancialSeries.prototype.getOffsetValue = function () {
        return this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
    };
    FinancialSeries.prototype.getCategoryWidth = function () {
        return this.xg.getCategorySize(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw));
    };
    FinancialSeries.prototype.wm = function (a, b, c) {
        return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, null, null, null);
    };
    FinancialSeries.prototype.i8 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cw);
        var e = this.y7(this.cw.ca, this.cw.b9, d);
        var f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
        return this.ja(new FinancialValueList(this.yc, this.ya, this.yb, this.x9, this.ye), a, this.xg, f, e, runOn(this, this.y6), b, c);
    };
    FinancialSeries.prototype.i4 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cw);
        var e = this.y7(this.cw.ca, this.cw.b9, d);
        var f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
        return this.ja(this.ya, a, this.xg, f, e, runOn(this, this.y6), b, c);
    };
    FinancialSeries.prototype.i6 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cw);
        var e = this.y7(this.cw.ca, this.cw.b9, d);
        var f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
        return this.ja(this.yb, a, this.xg, f, e, runOn(this, this.y6), b, c);
    };
    FinancialSeries.prototype.y8 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cw);
        var e = this.y7(this.cw.ca, this.cw.b9, d);
        var f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
        return this.ja(this.x9, a, this.xg, f, e, runOn(this, this.y6), b, c);
    };
    FinancialSeries.prototype.y9 = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cw);
        var e = this.y7(this.cw.ca, this.cw.b9, d);
        var f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
        return this.ja(this.yc, a, this.xg, f, e, runOn(this, this.y6), b, c);
    };
    FinancialSeries.prototype.za = function (a, b, c) {
        var d = this.getEffectiveViewport1(this.cw);
        var e = this.y7(this.cw.ca, this.cw.b9, d);
        var f = new ScalerParams(0, this.cw.ca, this.cw.b9, this.xg.df, d);
        return this.ja(this.ye, a, this.xg, f, e, runOn(this, this.y6), b, c);
    };
    FinancialSeries.prototype.wi = function (a, b, c) {
        var _this = this;
        return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.i4), function (d, e) { return _this.kf(d, e, _this.xg, runOn(_this, _this.y6), _this.ya); }, function (d, e) { return _this.kd(d, e, _this.xg, runOn(_this, _this.y6), _this.ya); });
    };
    FinancialSeries.prototype.wk = function (a, b, c) {
        var _this = this;
        return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.i6), function (d, e) { return _this.kf(d, e, _this.xg, runOn(_this, _this.y6), _this.yb); }, function (d, e) { return _this.kd(d, e, _this.xg, runOn(_this, _this.y6), _this.yb); });
    };
    FinancialSeries.prototype.aa8 = function (a, b, c) {
        var _this = this;
        return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.y9), function (d, e) { return _this.kf(d, e, _this.xg, runOn(_this, _this.y6), _this.yc); }, function (d, e) { return _this.kd(d, e, _this.xg, runOn(_this, _this.y6), _this.yc); });
    };
    FinancialSeries.prototype.aa7 = function (a, b, c) {
        var _this = this;
        return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.y8), function (d, e) { return _this.kf(d, e, _this.xg, runOn(_this, _this.y6), _this.x9); }, function (d, e) { return _this.kd(d, e, _this.xg, runOn(_this, _this.y6), _this.x9); });
    };
    FinancialSeries.prototype.aa9 = function (a, b, c) {
        var _this = this;
        return this.wo(a, b, c, this.y7(this.cw.ca, this.cw.b9, this.getEffectiveViewport1(this.cw)), this.xz, this.xg, runOn(this, this.za), function (d, e) { return _this.kf(d, e, _this.xg, runOn(_this, _this.y6), _this.ye); }, function (d, e) { return _this.kd(d, e, _this.xg, runOn(_this, _this.y6), _this.ye); });
    };
    FinancialSeries.prototype.qh = function () {
        _super.prototype.qh.call(this);
        if (this.xg != null) {
            this.xg.k3(false);
        }
        if (this.xz != null) {
            this.xz.k3(false);
        }
    };
    FinancialSeries.prototype.sz = function (a, b) {
        this.xx.cd.e(this.ie);
        this.ry(false);
    };
    FinancialSeries.prototype.sy = function (a, b) {
        if (this.g2 && this.ju < 0.05) {
            this.g3 = true;
            this.g6 = false;
            this.gl = false;
        }
        this.xx.cd.e(this.ie);
        this.ry(false);
    };
    FinancialSeries.prototype.yd = function (a, b, c) {
        var d = this.dl(b);
        this.yr.addItem(d, b);
        this.ys.addItem(b, c);
        return d;
    };
    FinancialSeries.prototype.aaf = function (a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        var c = this.yr.item(b);
        this.ys.removeItem(c);
        this.yr.removeItem(b);
    };
    FinancialSeries.prototype.rg = function (a, b, c, d) {
        _super.prototype.rg.call(this, a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.c4 != null && this.dc != null) {
                    this.xx.cd.e(this.ie);
                    this.ry(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.xg != null) {
                        this.xg.cq(this);
                    }
                    if (this.xz != null) {
                        this.xz.cq(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.xg != null) {
                        this.xg.du(this);
                    }
                    if (this.xz != null) {
                        this.xz.du(this);
                    }
                }
                this.xx.cd.e(this.ie);
                this.ry(false);
                break;
            case "FastItemsSource":
                this.yg = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.aaf(typeCast(IFastItemsSource_$type, c), this.yc);
                    this.aaf(typeCast(IFastItemsSource_$type, c), this.ya);
                    this.aaf(typeCast(IFastItemsSource_$type, c), this.yb);
                    this.aaf(typeCast(IFastItemsSource_$type, c), this.x9);
                    this.aaf(typeCast(IFastItemsSource_$type, c), this.ye);
                    this.yc = null;
                    this.ya = null;
                    this.yb = null;
                    this.x9 = null;
                    this.ye = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.z6) == false) {
                        this.yc = this.yd(typeCast(IFastItemsSource_$type, d), this.z6, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.zx) == false) {
                        this.ya = this.yd(typeCast(IFastItemsSource_$type, d), this.zx, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.z2) == false) {
                        this.yb = this.yd(typeCast(IFastItemsSource_$type, d), this.z2, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.zk) == false) {
                        this.x9 = this.yd(typeCast(IFastItemsSource_$type, d), this.zk, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.aaa) == false) {
                        this.ye = this.yd(typeCast(IFastItemsSource_$type, d), this.aaa, "VolumeColumn");
                    }
                }
                this.yg = false;
                if (this.xz != null && !this.xz.d2()) {
                    this.xx.cd.e(this.ie);
                    this.ry(this.gh && c != null);
                }
                break;
            case FinancialSeries.$$p[11]:
                if (this.dp != null) {
                    this.aaf(this.dp, this.yc);
                    this.yc = this.yd(this.dp, this.z6, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.xz != null && !this.xz.d2() && !this.yg) {
                    this.xx.cd.e(this.ie);
                    this.ry(this.gh && this.d9);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.dp != null) {
                    this.aaf(this.dp, this.ya);
                    this.ya = this.yd(this.dp, this.zx, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.xz != null && !this.xz.d2() && !this.yg) {
                    this.xx.cd.e(this.ie);
                    this.ry(this.gh && this.d9);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (this.dp != null) {
                    this.aaf(this.dp, this.yb);
                    this.yb = this.yd(this.dp, this.z2, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.xz != null && !this.xz.d2() && !this.yg) {
                    this.xx.cd.e(this.ie);
                    this.ry(this.gh && this.d9);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.dp != null) {
                    this.aaf(this.dp, this.x9);
                    this.x9 = this.yd(this.dp, this.zk, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.xz != null && !this.xz.d2() && !this.yg) {
                    this.xx.cd.e(this.ie);
                    this.ry(this.gh && this.d9);
                }
                this.aap();
                break;
            case FinancialSeries.$$p[13]:
                if (this.dp != null) {
                    this.aaf(this.dp, this.ye);
                    this.ye = this.yd(this.dp, this.aaa, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.xz != null && !this.xz.d2() && !this.yg) {
                    this.xx.cd.e(this.ie);
                    this.ry(this.gh && this.d9);
                }
                break;
            case FinancialSeries.$$p[14]:
                if (c != null) {
                    c.cq(this);
                }
                if (d != null) {
                    d.du(this);
                }
                this.xx.cd.e(this.ie);
                this.ry(false);
                this.qr();
                this.xy = typeCast(ITimeRangeSelectorAxis_$type, this.xg);
                break;
            case FinancialSeries.$$p[15]:
                if (c != null) {
                    c.cq(this);
                }
                if (d != null) {
                    d.du(this);
                }
                this.xx.cd.e(this.ie);
                if (this.xz != null) {
                    this.xz.d2();
                }
                {
                    this.ry(false);
                }
                this.qr();
                break;
            case "TransitionProgress":
                this.xm.c(this.ju, this.xk, this.xi);
                if (this.d7(this.cw)) {
                    return;
                }
                if (this.ju == 1) {
                    this.xi.y();
                    this.aao(this.xi, this.xx);
                    if (this.g2) {
                        this.g2 = false;
                        this.pc();
                        this.dd.r = truncate(this.jc());
                        this.dd.b = this.de;
                    }
                    if (this.g5) {
                        this.g5 = false;
                        this.pc();
                        this.dd.r = truncate(this.jc());
                        this.dd.b = this.de;
                        this.q6();
                    }
                    this.qu();
                }
                else {
                    this.aao(this.xm, this.xx);
                }
                if (this.dc != null) {
                    this.dc.rz(this);
                }
                break;
            case FinancialSeries.$$p[10]:
                this.ry(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.yh = this.yk();
                this.ry(false);
                break;
            case "CategoryMode":
                if (this.xg != null) {
                    this.xg.pw(true);
                }
                break;
        }
    };
    FinancialSeries.prototype.yj = function (a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.yi = function (a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.dc) {
            return true;
        }
        return false;
    };
    FinancialSeries.prototype.w9 = function (a, b, c) {
        if (b < a || a < 0 || a > this.dp.count || b < 0 || b > this.dp.count || c == null) {
            return null;
        }
        var d = new Array((b - a) + 1);
        var e = c.dm;
        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.dp.item(g);
        }
        return d;
    };
    FinancialSeries.prototype.zd = function (a) {
        return a.cd.b;
    };
    FinancialSeries.prototype.zf = function (a) {
        return a.cd.c;
    };
    FinancialSeries.prototype.w8 = function (a, b) {
        return this.w9(a, b, this.xz);
    };
    FinancialSeries.prototype.get_ff = function () {
        return true;
    };
    FinancialSeries.prototype.o9 = function () {
        _super.prototype.o9.call(this);
        this.x3 = null;
    };
    FinancialSeries.prototype.dh = function (a, b, c) {
        if (this.ef && this.f0(this.by) && !c) {
            var d = this.x2(a, b, this.x3);
            this.x3 = d;
            return d;
        }
        else {
            var e = this.x1(a, b, this.x3);
            this.x3 = e;
            return e;
        }
    };
    FinancialSeries.prototype.zh = function (a) {
        var b = this.xj();
        var c = this.cw.b9;
        var d = this.cw.ca;
        var e = this.xg;
        var f = 0;
        if (e.dq) {
            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.h.count;
        var j = 0;
        for (j = 0; j < i; j++) {
            var k = b.h._inner[j];
            var l = null;
            if (j < i - 1) {
                l = b.h._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.x2 = function (a, b, c) {
        if (this.dp == null) {
            return null;
        }
        var d = this.dp.count;
        var e = this.xx.cd.c;
        var f = this.xx.cd.d;
        var g = this.xx.cd.b;
        var h = this.xg;
        var i = -1;
        var j = -1;
        if (h.dm) {
            var k = this.xj();
            var l = this.zh(b);
            if (k.o != null && l >= 0 && l < k.o.count) {
                l = truncate(Math.round(k.o._inner[l]));
            }
            i = l;
            j = l;
        }
        else {
            var m = this.j7(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.g == i && c.f == j) {
            return c;
        }
        var n = new HighlightingInfo();
        n.i = this;
        n.g = i;
        n.f = j;
        return n;
    };
    FinancialSeries.prototype.x1 = function (a, b, c) {
        var d = new HighlightingInfo();
        d.i = this;
        d.g = 0;
        d.f = this.dp.count - 1;
        d.c = true;
        if (c != null && c.g == d.g && c.f == d.f) {
            return c;
        }
        return d;
    };
    FinancialSeries.prototype.yk = function () {
        return this.ym;
    };
    FinancialSeries.prototype.it = function (a) {
        var b = this.cw.ca;
        var c = this.cw.b9;
        var d = -1;
        if (!b.isEmpty && !c.isEmpty && this.xg != null) {
            var e = this.getEffectiveViewport1(this.cw);
            var f = new ScalerParams(0, b, c, this.xg.df, e);
            var g = this.wt(this.cw);
            var h = this.xg.fw(g.left, f);
            var i = this.xg.fw(g.right, f);
            var j = (a.x - b.left) / b.width;
            var k = h + (j * (i - h));
            if (this.xg.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    };
    FinancialSeries.prototype.j7 = function (a) {
        return truncate(Math.round(this.it(a)));
    };
    FinancialSeries.prototype.get_ft = function () {
        return typeCast(ISortingAxis_$type, this.xg) !== null;
    };
    FinancialSeries.prototype.a0 = function () {
        return this.xg;
    };
    FinancialSeries.prototype.j9 = function (a) {
        var b = this.cw.ca;
        var c = this.cw.b9;
        var d = this.getEffectiveViewport1(this.cw);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        var e = new Rect(0, 0, 0, 1, 1);
        var f = new ScalerParams(0, b, c, this.xg.df, d);
        var g = typeCast(ISortingAxis_$type, this.xg);
        var h = this.wt(this.cw);
        var i = h.left;
        var j = h.right;
        var k = this.wh(a).x;
        var l = this.xg.fw(k, f);
        var m = this.xg.fw(i, f);
        var n = this.xg.fw(j, f);
        l = Math.max(m, Math.min(n, l));
        var o = g.i$f(l);
        return o;
    };
    FinancialSeries.prototype.kr = function (a) {
        var b = 0;
        if (typeCast(ISortingAxis_$type, this.xg) !== null) {
            b = this.j9(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.j7(a);
        }
        return b >= 0 && this.dp != null && b < this.dp.count ? this.dp.item(b) : null;
    };
    FinancialSeries.prototype.xj = function () {
        var a = this.xi;
        if (this.d4()) {
            if (this.dd.g) {
                this.dd.t();
            }
            a = this.xm;
        }
        return a;
    };
    FinancialSeries.prototype.y7 = function (a, b, c) {
        if (this.xg == null) {
            return 0;
        }
        return this.xg.ov(a, b, c, this.index);
    };
    FinancialSeries.prototype.go = function () {
        return this.yn;
    };
    FinancialSeries.prototype.xq = function () {
        return 11;
    };
    FinancialSeries.prototype.c5 = function () {
        return 3;
    };
    FinancialSeries.prototype.c8 = function () {
        return 3;
    };
    FinancialSeries.prototype.aao = function (a, b) {
        this.q3();
        this.ws = a.ad;
        b.a6();
    };
    FinancialSeries.prototype.aam = function (a, b) {
        a.x();
    };
    FinancialSeries.prototype.hf = function (a, b, c) {
        var d = _super.prototype.hf.call(this, a, b, c);
        var e = c;
        if (this.dp == null || this.dp.count == 0 || !c.r() || b.isEmpty || a.isEmpty || this.xg == null || this.xz == null || e.cd.b < 1 || this.xg.b0 == null || this.xz.b0 == null || this.xz.pr == this.xz.pq || this.xg.itemsSource == null || this.xg.o5 < 1) {
            e.cd.b = 0;
            d = false;
        }
        return d;
    };
    FinancialSeries.prototype.getViewInfo = function (a, b) {
        b = this.cw.ca;
        a = this.cw.b9;
        return {
            p0: a,
            p1: b
        };
    };
    FinancialSeries.prototype.zb = function (a) {
        var b = 0;
        var c = a.ca;
        var d = a.b9;
        var e = this.getEffectiveViewport1(this.cw);
        if (!c.isEmpty && !d.isEmpty && this.xz != null) {
            var f = new ScalerParams(0, c, d, this.xz.df, e);
            f.b = this.i0();
            b = this.xz.ft(this.xz.p5, f);
        }
        return b;
    };
    FinancialSeries.prototype.pc = function () {
        _super.prototype.pc.call(this);
        this.xk.y();
        this.xi.y();
        this.xm.y();
    };
    FinancialSeries.prototype.rz = function (a) {
        var _this = this;
        _super.prototype.rz.call(this, a);
        this.xx.cd.e(this.ie);
        if (this.d7(this.cw)) {
            return;
        }
        if (this.gs) {
            if (this.d4()) {
                this.aao(this.xm, this.xx);
            }
            else {
                this.aao(this.xi, this.xx);
            }
            return;
        }
        if (this.gg(a)) {
            var b = this.xk;
            if (this.d4()) {
                if (this.dd.g) {
                    this.dd.t();
                }
                this.xk = this.xm;
                this.xm = b;
            }
            else {
                this.xk = this.xi;
                this.xi = b;
            }
            this.aam(this.xi, this.xx);
            var c = false;
            if (this.g4) {
                this.dd.w();
                this.dd.r = truncate(this.jd());
                this.dd.b = this.df != null ? this.df : this.de;
                if (this.g5) {
                    var d = this.xm;
                    this.xm = this.xk;
                    this.xk = d;
                    c = true;
                }
                this.xs.x(this, this.xk, this.xi, this.isVertical, this.xg, this.xz, this.xr, this.xq(), this.c6, this.c5(), function () { return _this.zb(_this.xx); }, this.xx.b9);
                if (this.g5) {
                    var e = this.xm;
                    this.xm = this.xk;
                    this.xk = e;
                }
                this.g5 = false;
            }
            if (this.g7) {
                this.dd.w();
                this.dd.r = truncate(this.je());
                this.dd.b = this.dg != null ? this.dg : this.de;
                if (this.g2) {
                    var f = this.xm;
                    this.xm = this.xk;
                    this.xk = f;
                    c = true;
                }
                this.xs.x(this, this.xk, this.xi, this.isVertical, this.xg, this.xz, this.xr, this.xq(), this.c6, this.c5(), function () { return _this.zb(_this.xx); }, this.xx.b9);
                var g = this.xi;
                this.xi = this.xk;
                this.xk = g;
                if (this.g2) {
                    var h = this.xm;
                    this.xm = this.xk;
                    this.xk = h;
                }
                this.g2 = false;
            }
            this.eb = false;
            if (!c) {
                this.o7();
            }
            this.sf();
            if (this.g4) {
                this.g3 = false;
                this.g6 = false;
                this.gl = false;
                this.g2 = true;
            }
            if (this.g7) {
                this.g6 = false;
                this.g5 = true;
            }
        }
        else {
            this.aam(this.xi, this.xx);
            this.aao(this.xi, this.xx);
        }
    };
    FinancialSeries.prototype.gp = function () {
        return true;
    };
    FinancialSeries.prototype.yp = function (a) {
        var e_1, _a;
        try {
            for (var _b = __values(fromEnum(a)), _c = _b.next(); !_c.done; _c = _b.next()) {
                var b = _c.value;
                switch (b) {
                    case "HighColumn":
                        if (this.ya == null) {
                            return false;
                        }
                        break;
                    case "LowColumn":
                        if (this.yb == null) {
                            return false;
                        }
                        break;
                    case "OpenColumn":
                        if (this.yc == null) {
                            return false;
                        }
                        break;
                    case "CloseColumn":
                        if (this.x9 == null) {
                            return false;
                        }
                        break;
                    case "VolumeColumn":
                        if (this.ye == 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, "yq", {
        get: function () {
            return this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.yl = function () {
        return this.typical != null;
    };
    FinancialSeries.prototype.aae = function (a) {
        this.typical(this, a);
    };
    Object.defineProperty(FinancialSeries.prototype, "yy", {
        get: function () {
            return this.yv();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yv = function () {
        var a, b, _a, _b, c, e_2_1, d, e, f, g, h;
        var e_2, _c;
        return __generator(this, function (_d) {
            switch (_d.label) {
                case 0:
                    a = false;
                    if (!this.yl())
                        return [3 /*break*/, 8];
                    b = this.xt(0, this.dp.count);
                    this.aae(new FinancialEventArgs(0, this.dp.count, b, this.xu(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 = __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.yq && this.xg.i$b != null))
                        return [3 /*break*/, 13];
                    d = this.dp.count;
                    e = this.xg.i$b;
                    f = 0;
                    _d.label = 9;
                case 9:
                    if (!(f < d))
                        return [3 /*break*/, 12];
                    return [4 /*yield*/, (this.ya.item(e.item(f)) + this.yb.item(e.item(f)) + this.x9.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.dp.count;
                    h = 0;
                    _d.label = 14;
                case 14:
                    if (!(h < g))
                        return [3 /*break*/, 17];
                    return [4 /*yield*/, (this.ya.item(h) + this.yb.item(h) + this.x9.item(h)) / 3];
                case 15:
                    _d.sent();
                    _d.label = 16;
                case 16:
                    ++h;
                    return [3 /*break*/, 14];
                case 17: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yv = function () {
        var _this = this;
        return toEnum(function () { return _this._yv(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "yx", {
        get: function () {
            return this.yu();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yu = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.yq && this.xg.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.ya.count;
                    b = this.xg.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.zc(this.ya.item(b.item(0)) - this.yb.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.zc(this.ya.item(b.item(c)) - this.yb.item(b.item(c))), Math.max(this.zc(Math.abs(this.ya.item(b.item(c)) - this.x9.item(b.item(c - 1)))), this.zc(Math.abs(this.yb.item(b.item(c)) - this.x9.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.ya.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.zc(this.ya.item(0) - this.yb.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.zc(this.ya.item(e) - this.yb.item(e)), Math.max(this.zc(Math.abs(this.ya.item(e) - this.x9.item(e - 1))), this.zc(Math.abs(this.yb.item(e) - this.x9.item(e - 1)))))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    ++e;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yu = function () {
        var _this = this;
        return toEnum(function () { return _this._yu(); });
    };
    Object.defineProperty(FinancialSeries.prototype, "yw", {
        get: function () {
            return this.yt();
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype._yt = function () {
        var a, b, c, d, e;
        return __generator(this, function (_a) {
            switch (_a.label) {
                case 0:
                    if (!(this.yq && this.xg.i$b != null))
                        return [3 /*break*/, 7];
                    a = this.yb.count;
                    b = this.xg.i$b;
                    if (!(a > 0))
                        return [3 /*break*/, 2];
                    return [4 /*yield*/, this.zc(this.yb.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.zc(this.yb.item(b.item(c))), this.zc(this.x9.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.yb.count;
                    if (!(d > 0))
                        return [3 /*break*/, 9];
                    return [4 /*yield*/, this.zc(this.yb.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.zc(this.yb.item(e)), this.zc(this.x9.item(e - 1)))];
                case 11:
                    _a.sent();
                    _a.label = 12;
                case 12:
                    e++;
                    return [3 /*break*/, 10];
                case 13: return [2 /*return*/];
            }
        });
    };
    FinancialSeries.prototype.yt = function () {
        var _this = this;
        return toEnum(function () { return _this._yt(); });
    };
    FinancialSeries.prototype.y0 = function (a) {
        if (a == null) {
            return null;
        }
        if (this.yq && this.xg.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.xg.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    };
    FinancialSeries.prototype.yz = function () {
        var a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.dp != null && !this.yf) {
            this.yf = true;
            var b = this.xt(0, this.dp.count);
            this.yf = false;
            var c = new FinancialEventArgs(0, this.dp.count, b, this.xu(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.yc == null) {
            return null;
        }
        if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
            if (this.y4 != null) {
                return this.y4.asArray();
            }
            var a = new List$1(Number_$type, 2, this.yc.count);
            var b = this.xg.i$b;
            var c = this.yc.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.y4 = a;
            return this.y4.asArray();
        }
        else {
            return this.yc.asArray();
        }
    };
    FinancialSeries.prototype.getHighColumnAsArray = function () {
        if (this.ya == null) {
            return null;
        }
        if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
            if (this.y2 != null) {
                return this.y2.asArray();
            }
            var a = new List$1(Number_$type, 2, this.ya.count);
            var b = this.xg.i$b;
            var c = this.ya.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.y2 = a;
            return this.y2.asArray();
        }
        else {
            return this.ya.asArray();
        }
    };
    FinancialSeries.prototype.getLowColumnAsArray = function () {
        if (this.yb == null) {
            return null;
        }
        if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
            if (this.y3 != null) {
                return this.y3.asArray();
            }
            var a = new List$1(Number_$type, 2, this.yb.count);
            var b = this.xg.i$b;
            var c = this.yb.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.y3 = a;
            return this.y3.asArray();
        }
        else {
            return this.yb.asArray();
        }
    };
    FinancialSeries.prototype.getCloseColumnAsArray = function () {
        if (this.x9 == null) {
            return null;
        }
        if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
            if (this.y1 != null) {
                return this.y1.asArray();
            }
            var a = new List$1(Number_$type, 2, this.x9.count);
            var b = this.xg.i$b;
            var c = this.x9.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.y1 = a;
            return this.y1.asArray();
        }
        else {
            return this.x9.asArray();
        }
    };
    FinancialSeries.prototype.getVolumeColumnAsArray = function () {
        if (this.ye == null) {
            return null;
        }
        if (this.xg != null && typeCast(ISortingAxis_$type, this.xg) !== null) {
            if (this.y5 != null) {
                return this.y5.asArray();
            }
            var a = new List$1(Number_$type, 2, this.ye.count);
            var b = this.xg.i$b;
            var c = this.ye.asArray();
            for (var d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.y5 = a;
            return this.y5.asArray();
        }
        else {
            return this.ye.asArray();
        }
    };
    FinancialSeries.prototype.ph = function (a, b, c, d) {
        _super.prototype.ph.call(this, a, b, c, d);
        if (this.xg == null || !(typeCast(ISortingAxis_$type, this.xg) !== null)) {
            return;
        }
        var e = this.xg.i$b;
        switch (a) {
            case 1:
                for (var f = b; f < c; f++) {
                    var g = e._inner[f];
                    if (this.y4 != null) {
                        this.y4.insert(f, this.yc.item(g));
                    }
                    if (this.y2 != null) {
                        this.y2.insert(f, this.ya.item(g));
                    }
                    if (this.y3 != null) {
                        this.y3.insert(f, this.yb.item(g));
                    }
                    if (this.y1 != null) {
                        this.y1.insert(f, this.x9.item(g));
                    }
                    if (this.y5 != null) {
                        this.y5.insert(f, this.ye.item(g));
                    }
                }
                break;
            case 0:
                if (this.y4 != null) {
                    this.y4.v(b, c);
                }
                if (this.y2 != null) {
                    this.y2.v(b, c);
                }
                if (this.y3 != null) {
                    this.y3.v(b, c);
                }
                if (this.y1 != null) {
                    this.y1.v(b, c);
                }
                if (this.y5 != null) {
                    this.y5.v(b, c);
                }
                break;
            case 4:
                if (this.y4 != null) {
                    this.y4 = new List$1(Number_$type, 0);
                }
                if (this.y2 != null) {
                    this.y2 = new List$1(Number_$type, 0);
                }
                if (this.y3 != null) {
                    this.y3 = new List$1(Number_$type, 0);
                }
                if (this.y1 != null) {
                    this.y1 = new List$1(Number_$type, 0);
                }
                if (this.y5 != null) {
                    this.y5 = 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.y4 != null) {
                        this.y4._inner[h] = this.yc.item(i);
                    }
                    if (this.y2 != null) {
                        this.y2._inner[h] = this.ya.item(i);
                    }
                    if (this.y3 != null) {
                        this.y3._inner[h] = this.yb.item(i);
                    }
                    if (this.y1 != null) {
                        this.y1._inner[h] = this.x9.item(i);
                    }
                    if (this.y5 != null) {
                        this.y5._inner[h] = this.ye.item(i);
                    }
                }
                break;
        }
        this.aap();
        this.sv();
    };
    FinancialSeries.prototype.xt = function (a, b) {
        var _this = this;
        var c = this.y0(this.yc);
        var d = this.y0(this.x9);
        var e = this.y0(this.ya);
        var f = this.y0(this.yb);
        var g = this.y0(this.ye);
        var h = ((function () {
            var $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(_this.yy), _this.yz());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(_this.yx), ((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.yw), ((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.dp != null ? _this.dp.count : 0;
            return $ret;
        })());
        return h;
    };
    FinancialSeries.prototype.zc = function (a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    };
    FinancialSeries.prototype.xu = 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.hr;
            $ret.j = Series.hq;
            $ret.i = runOn(_this, _this.zc);
            return $ret;
        })());
    };
    Object.defineProperty(FinancialSeries.prototype, "categoryAxis", {
        get: function () {
            return this.xg;
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.r0 = function (a, b) {
        _super.prototype.r0.call(this, a, b);
        if (!this.g1) {
            this.cw.be(b);
            return;
        }
        var c = typeCast(FinancialSeriesView.$, this.cv);
        this.cw.be(b);
        c.cd.e(this.ie);
        if (this.d7(this.cv)) {
            return;
        }
        this.r1();
        this.g1 = false;
    };
    FinancialSeries.prototype.r1 = function () {
        _super.prototype.r1.call(this);
        var a = typeCast(FinancialSeriesView.$, this.cv);
        if (!this.gt) {
            this.aam(this.xl, a);
        }
        this.gt = false;
        this.aao(this.xl, a);
    };
    FinancialSeries.prototype.rx = function (a, b, c, d, e) {
        _super.prototype.rx.call(this, a, b, c, d, e);
        var f = this.ba.a$j.item(d);
        var g = f;
        g.cd.e(this.ie);
        f.bd(c);
        if (this.d7(g)) {
            return;
        }
        if (this.xh == null) {
            this.xh = new CategoryFrame(3);
        }
        this.xh.x();
        this.aam(this.xh, g);
        this.aao(this.xh, g);
    };
    FinancialSeries.prototype.aw = function (a) {
        if (this.xg == a) {
            return this.xz;
        }
        if (this.xz == a) {
            return this.xg;
        }
        return null;
    };
    FinancialSeries.prototype.preferredCategoryMode = function (a) {
        var b = typeCast(IDateTimeAxis_$type, this.xg);
        return b != null ? b.preferredCategoryMode(this) : this.xo;
    };
    Object.defineProperty(FinancialSeries.prototype, "xo", {
        get: function () {
            return this.xn;
        },
        set: function (a) {
            var b = this.xo;
            if (a != b) {
                this.xn = a;
                this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.xo));
            }
        },
        enumerable: false,
        configurable: true
    });
    FinancialSeries.prototype.get_fn = function () {
        return true;
    };
    FinancialSeries.prototype.sb = function (a, b) {
        _super.prototype.sb.call(this, a, b);
        this.aa6 = a;
    };
    FinancialSeries.prototype.aap = function () {
        this.io = this.x9 == null || this.x9.count == 0 ? NaN : this.x9.item(this.x9.count - 1);
    };
    FinancialSeries.prototype.kt = function (a) {
        if (this.xy != null && a != null) {
            if (this.x0 == null || this.x0.propertyName != this.xy.dateTimeMemberPath) {
                this.x0 = new FastReflectionHelper(false, this.xy.dateTimeMemberPath);
            }
            var b = this.x0.getPropertyValue(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.xy.itemLabelFormat());
            }
        }
        return _super.prototype.kt.call(this, a);
    };
    FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
    FinancialSeries.$$p = markDep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:zk:aaq', [2, null], 'HighMemberPath:zx:aaw', [2, null], 'HighlightedCloseMemberPath:zn:aar', [2, null], 'HighlightedHighMemberPath:zp:aas', [2, null], 'HighlightedLowMemberPath:zr:aat', [2, null], 'HighlightedOpenMemberPath:zt:aau', [2, null], 'HighlightedVolumeMemberPath:zv:aav', [2, null], 'IsCustomCategoryStyleAllowed:ym:aax', [0, false], 'IsTransitionInEnabled:yn:aay', [0, false], 'LowMemberPath:z2:aaz', [2, null], 'NegativeBrush:aa6:aa0', [Brush.$, null], 'OpenMemberPath:z6:aa1', [2, null], 'TransitionInMode:xr:aa2', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:aaa:aa3', [2, null], 'XAxis:xg:aa4', [CategoryAxisBase.$, null], 'YAxis:xz:aa5', [NumericYAxis.$, null]]);
    return FinancialSeries;
}(Series));
export { FinancialSeries };
/**
 * @hidden
 */
var FinancialCalculationSupportingCalculations = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialCalculationSupportingCalculations, _super);
    function FinancialCalculationSupportingCalculations() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.a = null;
        _this.c = null;
        _this.d = null;
        _this.b = null;
        _this.h = null;
        _this.f = null;
        _this.g = null;
        _this.e = null;
        _this.k = null;
        _this.j = null;
        _this.i = null;
        return _this;
    }
    FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
    return FinancialCalculationSupportingCalculations;
}(Base));
export { FinancialCalculationSupportingCalculations };
/**
 * @hidden
 */
var DataSourceSupportingCalculation = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(DataSourceSupportingCalculation, _super);
    function DataSourceSupportingCalculation(a) {
        var _rest = [];
        for (var _i = 1; _i < arguments.length; _i++) {
            _rest[_i - 1] = arguments[_i];
        }
        var _this = this;
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    var c = _rest[0];
                    _this = _super.call(this, Delegate_$type, 0, c) || this;
                }
                break;
            case 1:
                {
                    var c = _rest[0];
                    var d = _rest[1];
                    _this = _super.call(this, Delegate_$type, 1, c, d) || this;
                }
                break;
        }
        return _this;
    }
    DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
    return DataSourceSupportingCalculation;
}(SupportingCalculation$1));
export { DataSourceSupportingCalculation };
/**
 * @hidden
 */
var FinancialCalculationDataSource = /** @class */ /*@__PURE__*/ (function (_super) {
    __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: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "closeColumn", {
        get: function () {
            return this._closeColumn;
        },
        set: function (a) {
            this._closeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "highColumn", {
        get: function () {
            return this._highColumn;
        },
        set: function (a) {
            this._highColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "lowColumn", {
        get: function () {
            return this._lowColumn;
        },
        set: function (a) {
            this._lowColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "volumeColumn", {
        get: function () {
            return this._volumeColumn;
        },
        set: function (a) {
            this._volumeColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "indicatorColumn", {
        get: function () {
            return this._indicatorColumn;
        },
        set: function (a) {
            this._indicatorColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "typicalColumn", {
        get: function () {
            return this._typicalColumn;
        },
        set: function (a) {
            this._typicalColumn = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueRange", {
        get: function () {
            return this._trueRange;
        },
        set: function (a) {
            this._trueRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "trueLow", {
        get: function () {
            return this._trueLow;
        },
        set: function (a) {
            this._trueLow = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "period", {
        get: function () {
            return this._period;
        },
        set: function (a) {
            this._period = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "shortPeriod", {
        get: function () {
            return this._shortPeriod;
        },
        set: function (a) {
            this._shortPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "longPeriod", {
        get: function () {
            return this._longPeriod;
        },
        set: function (a) {
            this._longPeriod = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "count", {
        get: function () {
            return this._count;
        },
        set: function (a) {
            this._count = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateFrom", {
        get: function () {
            return this._calculateFrom;
        },
        set: function (a) {
            this._calculateFrom = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "calculateCount", {
        get: function () {
            return this._calculateCount;
        },
        set: function (a) {
            this._calculateCount = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "multiplier", {
        get: function () {
            return this._multiplier;
        },
        set: function (a) {
            this._multiplier = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "minimumValue", {
        get: function () {
            return this._minimumValue;
        },
        set: function (a) {
            this._minimumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "maximumValue", {
        get: function () {
            return this._maximumValue;
        },
        set: function (a) {
            this._maximumValue = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "specifiesRange", {
        get: function () {
            return this._specifiesRange;
        },
        set: function (a) {
            this._specifiesRange = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FinancialCalculationDataSource.prototype, "series", {
        get: function () {
            return this._series;
        },
        set: function (a) {
            this._series = a;
        },
        enumerable: false,
        configurable: true
    });
    FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
    return FinancialCalculationDataSource;
}(Base));
export { FinancialCalculationDataSource };
/**
 * @hidden
 */
var FinancialSeriesView = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FinancialSeriesView, _super);
    function FinancialSeriesView(a) {
        var _this = _super.call(this, a) || this;
        _this.cf = null;
        _this.cd = null;
        _this.ch = 0;
        _this.ch = -1;
        _this.cf = a;
        _this.cd = _this.ce();
        return _this;
    }
    FinancialSeriesView.prototype.cg = function (a) {
        if (this.ch != a.w) {
            return true;
        }
        return false;
    };
    FinancialSeriesView.prototype.ci = function (a) {
        this.ch = a.w;
    };
    FinancialSeriesView.prototype.a4 = function () {
        _super.prototype.a4.call(this);
        if (!this.t) {
        }
    };
    FinancialSeriesView.prototype.getDefaultTooltipTemplate = function () {
        var a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.cf.xg.dc) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.cf.xg.hg != null) {
            a += "<span>${item." + this.cf.xg.hg + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        var b = this.f.ba.a$u(this.f);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        var c = new SRProvider(this.ae);
        var d = c.b1("financialSeries_Open");
        var e = c.b1("financialSeries_High");
        var f = c.b1("financialSeries_Low");
        var g = c.b1("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.cf.title + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.cf.z6 + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.cf.zx + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.cf.z2 + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.cf.zk + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.cf.aaa)) {
            var h = c.b1("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.cf.aaa + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    };
    FinancialSeriesView.prototype.an = function () {
        var a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.f.wb = a;
        this.f.jq = 5;
        this.f.jr = 2;
        this.f.js = 2;
    };
    FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
    return FinancialSeriesView;
}(SeriesView));
export { FinancialSeriesView };
