/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { EventArgs, Base, Type, markType, typeCast, Point_$type, String_$type, runOn, Number_$type, enumGetBox, fromEnum, toEnum, Date_$type, Delegate_$type } from "igniteui-react-core/ES2015/type";
import { IBucketizer_$type } from "./IBucketizer";
import { ArgumentNullException } from "igniteui-react-core/ES2015/ArgumentNullException";
import { IFastItemColumn$1_$type } from "igniteui-react-core/ES2015/IFastItemColumn$1";
import { Series } from "./Series";
import { Rect } from "igniteui-react-core/ES2015/Rect";
import { ScalerParams } from "./ScalerParams";
import { ISortingAxis_$type } from "./ISortingAxis";
import { SeriesView } from "./SeriesView";
import { truncate, intDivide, isInfinity, isNaN_ } from "igniteui-react-core/ES2015/number";
import { IHasCategoryAxis_$type } from "./IHasCategoryAxis";
import { IHasCategoryModePreference_$type } from "./IHasCategoryModePreference";
import { Brush } from "igniteui-react-core/ES2015/Brush";
import { DependencyProperty } from "igniteui-react-core/ES2015/DependencyProperty";
import { CategoryAxisBase } from "./CategoryAxisBase";
import { NumericYAxis } from "./NumericYAxis";
import { HighlightingInfo } from "./HighlightingInfo";
import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode";
import { CategoryTransitionSourceFramePreparer } from "./CategoryTransitionSourceFramePreparer";
import { CategoryFrame } from "./CategoryFrame";
import { CategoryMode_$type } from "./CategoryMode";
import { ITimeRangeSelectorAxis_$type } from "./ITimeRangeSelectorAxis";
import { FastReflectionHelper } from "igniteui-react-core/ES2015/FastReflectionHelper";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Dictionary$2 } from "igniteui-react-core/ES2015/Dictionary$2";
import { CategorySeriesRenderManager } from "./CategorySeriesRenderManager";
import { IFastItemsSource_$type } from "igniteui-react-core/ES2015/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/ES2015/TrendCalculators";
import { ColumnSupportingCalculation } from "./ColumnSupportingCalculation";
import { IDateTimeAxis_$type } from "./IDateTimeAxis";
import { PropertyMetadata } from "igniteui-react-core/ES2015/PropertyMetadata";
import { stringIsNullOrEmpty } from "igniteui-react-core/ES2015/string";
import { dateToStringFormat } from "igniteui-react-core/ES2015/dateExtended";
import { SupportingCalculation$1 } from "./SupportingCalculation$1";
import { SRProvider } from "igniteui-react-core/ES2015/SRProvider";
import { Color } from "igniteui-react-core/ES2015/Color";
/**
 * @hidden
 */
export class FinancialEventArgs extends EventArgs {
    constructor(a, b, c, d, e) {
        super();
        this._position = 0;
        this._count = 0;
        this._dataSource = null;
        this._supportingCalculations = null;
        this._basedOn = null;
        this.position = a;
        this.count = b;
        this.dataSource = c;
        this.supportingCalculations = d;
        if (c != null) {
            c.series = e;
        }
    }
    get position() {
        return this._position;
    }
    set position(a) {
        this._position = a;
    }
    get count() {
        return this._count;
    }
    set count(a) {
        this._count = a;
    }
    get dataSource() {
        return this._dataSource;
    }
    set dataSource(a) {
        this._dataSource = a;
    }
    get supportingCalculations() {
        return this._supportingCalculations;
    }
    set supportingCalculations(a) {
        this._supportingCalculations = a;
    }
    get basedOn() {
        return this._basedOn;
    }
    set basedOn(a) {
        this._basedOn = a;
    }
}
FinancialEventArgs.$t = markType(FinancialEventArgs, 'FinancialEventArgs', EventArgs.$);
/**
 * @hidden
 */
export class FinancialBucketCalculator extends Base {
    constructor(a) {
        super();
        this.a = null;
        this.c = 0;
        this.d = 0;
        this.b = 0;
        if (a == null) {
            throw new ArgumentNullException(0, "view");
        }
        this.a = a;
        this.c = -1;
        this.d = this.d;
        this.b = 0;
    }
    getBucket(a) {
        return null;
    }
    getBucketWithoutUnknowns(a) {
        return this.getBucket(a);
    }
    getErrorBucket(a, b) {
        return NaN;
    }
    getBucketInfo(a, b, c, d) {
        a = this.c;
        b = this.d;
        c = this.b;
        d = this.a.bw.er;
        return {
            p0: a,
            p1: b,
            p2: c,
            p3: d
        };
    }
    e(a) {
        let b = this.a.bs;
        let c = this.a.br;
        let d = this.a.br;
        if (this.a.bw != null) {
            d = this.a.bw.getEffectiveViewport1(this.a);
        }
        if (b.isEmpty || c.isEmpty || this.a.bw.l1 == null) {
            this.b = 0;
            return;
        }
        let e = (this.a.bw.l1 != null) ? this.a.bw.l1.b8 : false;
        let f = new ScalerParams(0, b, c, e, d);
        let g = this.a.bw.lj(this.a);
        let h = typeCast(ISortingAxis_$type, this.a.bw.l1);
        if (h == null || h.i$b == null) {
            let i = Math.floor(this.a.bw.l1.dw(g.left, f));
            let j = Math.ceil(this.a.bw.l1.dw(g.right, f));
            if (this.a.bw.l1.b8) {
                j = Math.ceil(this.a.bw.l1.dw(g.left, f));
                i = Math.floor(this.a.bw.l1.dw(g.right, f));
            }
            let k = Math.floor((j - i + 1) * a / g.width);
            this.b = truncate(Math.max(1, k));
            this.c = truncate(Math.floor(i / this.b));
            this.d = truncate(Math.ceil(j / this.b));
        }
        else {
            this.c = h.i$e(b, c, d, g);
            this.d = h.i$g(b, c, d, g);
            this.b = 1;
        }
    }
    cacheValues() {
    }
    unCacheValues() {
    }
}
FinancialBucketCalculator.$t = markType(FinancialBucketCalculator, 'FinancialBucketCalculator', Base.$, [IBucketizer_$type]);
/**
 * @hidden
 */
export class FinancialSeries extends Series {
    constructor() {
        super();
        this.mu = null;
        this.mq = null;
        this.ms = null;
        this.mo = null;
        this.mx = null;
        this.m1 = false;
        this.assigningCategoryStyle = null;
        this.l9 = null;
        this.nc = new Dictionary$2(IFastItemColumn$1_$type.specialize(Number_$type), String_$type, 0);
        this.nd = new Dictionary$2(String_$type, String_$type, 0);
        this.m0 = false;
        this.mk = null;
        this.l4 = null;
        this.l6 = null;
        this.l3 = null;
        this.mc = null;
        this.typical = null;
        this.typicalBasedOn = null;
        this.mz = false;
        this.np = null;
        this.nn = null;
        this.no = null;
        this.nm = null;
        this.nq = null;
        this.l5 = null;
        this.l2 = null;
        this.l7 = 0;
        this.ml = null;
        this.mn = null;
        this.l9 = new CategorySeriesRenderManager();
        this.m1 = false;
        this.mc = new CategoryTransitionSourceFramePreparer();
        this.l5 = new CategoryFrame(3);
        this.ab = FinancialSeries.$;
        this.l8 = 0;
    }
    im(a) {
        super.im(a);
        this.mh = a;
    }
    get_cr() {
        return true;
    }
    ag() {
        return [this.l1, this.mm];
    }
    n1() {
        return 2;
    }
    nz() {
        return 4;
    }
    ah(a) {
        let b = this.aj(this.l1, this.l3.f, this.ny(this.bi), this.n0(this.bi), this.lh(a), true);
        if (b == null) {
            return null;
        }
        let c = b[0];
        let d = b[1];
        let e = new Array(1);
        let f = new Array(2);
        let g = this.n1();
        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;
    }
    ai(a) {
        let b = this.aj(this.l1, this.l3.f, this.ny(this.bi), this.n0(this.bi), this.lh(a), true);
        if (b == null) {
            return null;
        }
        let c = b[0];
        let d = b[1];
        let e = new Array(1);
        let f = new Array(2);
        f[0] = { $type: Point_$type, x: c[0], y: c[1] };
        f[1] = { $type: Point_$type, x: d[0], y: d[1] };
        e[0] = f;
        return e;
    }
    k2() {
        return this.o7;
    }
    hn() {
        super.hn();
        this.l1 = null;
        this.mm = null;
    }
    get mv() {
        return this.mu;
    }
    set mv(a) {
        if (this.mu != a) {
            let b = this.mu;
            this.mu = a;
            this.raisePropertyChanged("OpenColumn", b, this.mu);
        }
    }
    get mr() {
        return this.mq;
    }
    set mr(a) {
        if (this.mq != a) {
            let b = this.mq;
            this.mq = a;
            this.raisePropertyChanged("HighColumn", b, this.mq);
        }
    }
    get mt() {
        return this.ms;
    }
    set mt(a) {
        if (this.ms != a) {
            let b = this.ms;
            this.ms = a;
            this.raisePropertyChanged("LowColumn", b, this.ms);
        }
    }
    get mp() {
        return this.mo;
    }
    set mp(a) {
        if (this.mo != a) {
            let b = this.mo;
            this.mo = a;
            this.raisePropertyChanged("CloseColumn", b, this.mo);
        }
    }
    get my() {
        return this.mx;
    }
    set my(a) {
        if (this.mx != a) {
            let b = this.mx;
            this.mx = a;
            this.raisePropertyChanged("VolumeColumn", b, this.mx);
        }
    }
    m9() {
        return (this.assigningCategoryStyle != null && this.m1) || this.cu;
    }
    ot(a) {
        if (this.assigningCategoryStyle != null && this.m1) {
            this.assigningCategoryStyle(this, a);
        }
    }
    or(a, b, c, d, e, f) {
        let g = this.b9;
        this.l9.ac(a, b, c, d, e, f, g);
        let h = this.l9.c;
        let i = null;
        let 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.ot(h);
        this.l9.aa(i, f, g);
    }
    nr(a) {
        return this.ea(a, this.l1);
    }
    fb(a, b) {
        return this.fc(a, b, this.l1, runOn(this, this.nr), new FinancialValueList(this.mv, this.mr, this.mt, this.mp, this.my));
    }
    e9(a, b) {
        return this.fa(a, b, this.l1, runOn(this, this.nr), new FinancialValueList(this.mv, this.mr, this.mt, this.mp, this.my));
    }
    d6(a, b, c, d, e) {
        if (c == null) {
            return Number.POSITIVE_INFINITY;
        }
        let f = this.l1.jr;
        return this.d7(a, b, this.l1, d, e, f, runOn(this, this.nr));
    }
    getOffsetValue() {
        return this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    getCategoryWidth() {
        return this.l1.getCategorySize(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi));
    }
    le(a, b, c) {
        return this.lg(a, b, c, this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mm, this.l1, null, null, null);
    }
    ek(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ns(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l1.b8, d);
        return this.em(new FinancialValueList(this.mv, this.mr, this.mt, this.mp, this.my), a, this.l1, f, e, runOn(this, this.nr), b, c);
    }
    eg(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ns(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l1.b8, d);
        return this.em(this.mr, a, this.l1, f, e, runOn(this, this.nr), b, c);
    }
    ei(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ns(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l1.b8, d);
        return this.em(this.mt, a, this.l1, f, e, runOn(this, this.nr), b, c);
    }
    nt(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ns(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l1.b8, d);
        return this.em(this.mp, a, this.l1, f, e, runOn(this, this.nr), b, c);
    }
    nu(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ns(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l1.b8, d);
        return this.em(this.mv, a, this.l1, f, e, runOn(this, this.nr), b, c);
    }
    nv(a, b, c) {
        let d = this.getEffectiveViewport1(this.bi);
        let e = this.ns(this.bi.bs, this.bi.br, d);
        let f = new ScalerParams(0, this.bi.bs, this.bi.br, this.l1.b8, d);
        return this.em(this.my, a, this.l1, f, e, runOn(this, this.nr), b, c);
    }
    la(a, b, c) {
        return this.lg(a, b, c, this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mm, this.l1, runOn(this, this.eg), (d, e) => this.fc(d, e, this.l1, runOn(this, this.nr), this.mr), (d, e) => this.fa(d, e, this.l1, runOn(this, this.nr), this.mr));
    }
    lc(a, b, c) {
        return this.lg(a, b, c, this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mm, this.l1, runOn(this, this.ei), (d, e) => this.fc(d, e, this.l1, runOn(this, this.nr), this.mt), (d, e) => this.fa(d, e, this.l1, runOn(this, this.nr), this.mt));
    }
    o9(a, b, c) {
        return this.lg(a, b, c, this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mm, this.l1, runOn(this, this.nu), (d, e) => this.fc(d, e, this.l1, runOn(this, this.nr), this.mv), (d, e) => this.fa(d, e, this.l1, runOn(this, this.nr), this.mv));
    }
    o8(a, b, c) {
        return this.lg(a, b, c, this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mm, this.l1, runOn(this, this.nt), (d, e) => this.fc(d, e, this.l1, runOn(this, this.nr), this.mp), (d, e) => this.fa(d, e, this.l1, runOn(this, this.nr), this.mp));
    }
    pa(a, b, c) {
        return this.lg(a, b, c, this.ns(this.bi.bs, this.bi.br, this.getEffectiveViewport1(this.bi)), this.mm, this.l1, runOn(this, this.nv), (d, e) => this.fc(d, e, this.l1, runOn(this, this.nr), this.my), (d, e) => this.fa(d, e, this.l1, runOn(this, this.nr), this.my));
    }
    h4() {
        super.h4();
        if (this.l1 != null) {
            this.l1.g0(false);
        }
        if (this.mm != null) {
            this.mm.g0(false);
        }
    }
    jm(a, b) {
        this.mh.bu.e(this.er);
        this.i6(false);
    }
    jl(a, b) {
        if (this.dl && this.ew < 0.05) {
            this.dm = true;
        }
        this.mh.bu.e(this.er);
        this.i6(false);
    }
    mw(a, b, c) {
        let d = this.bw(b);
        this.nc.addItem(d, b);
        this.nd.addItem(b, c);
        return d;
    }
    oq(a, b) {
        if (b == null) {
            return;
        }
        a.deregisterColumn(b);
        let c = this.nc.item(b);
        this.nd.removeItem(c);
        this.nc.removeItem(b);
    }
    is(a, b, c, d) {
        super.is(a, b, c, d);
        switch (b) {
            case "SyncLink":
                if (this.bn != null && this.bs != null) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                break;
            case "SeriesViewer":
                if (c != null && d == null) {
                    if (this.l1 != null) {
                        this.l1.bv(this);
                    }
                    if (this.mm != null) {
                        this.mm.bv(this);
                    }
                }
                if (c == null && d != null) {
                    if (this.l1 != null) {
                        this.l1.ch(this);
                    }
                    if (this.mm != null) {
                        this.mm.ch(this);
                    }
                }
                this.mh.bu.e(this.er);
                this.i6(false);
                break;
            case "FastItemsSource":
                this.m0 = true;
                if (typeCast(IFastItemsSource_$type, c) != null) {
                    this.oq(typeCast(IFastItemsSource_$type, c), this.mv);
                    this.oq(typeCast(IFastItemsSource_$type, c), this.mr);
                    this.oq(typeCast(IFastItemsSource_$type, c), this.mt);
                    this.oq(typeCast(IFastItemsSource_$type, c), this.mp);
                    this.oq(typeCast(IFastItemsSource_$type, c), this.my);
                    this.mv = null;
                    this.mr = null;
                    this.mt = null;
                    this.mp = null;
                    this.my = null;
                }
                if (typeCast(IFastItemsSource_$type, d) != null) {
                    if (stringIsNullOrEmpty(this.oh) == false) {
                        this.mv = this.mw(typeCast(IFastItemsSource_$type, d), this.oh, "OpenColumn");
                    }
                    if (stringIsNullOrEmpty(this.n8) == false) {
                        this.mr = this.mw(typeCast(IFastItemsSource_$type, d), this.n8, "HighColumn");
                    }
                    if (stringIsNullOrEmpty(this.od) == false) {
                        this.mt = this.mw(typeCast(IFastItemsSource_$type, d), this.od, "LowColumn");
                    }
                    if (stringIsNullOrEmpty(this.n5) == false) {
                        this.mp = this.mw(typeCast(IFastItemsSource_$type, d), this.n5, "CloseColumn");
                    }
                    if (stringIsNullOrEmpty(this.ol) == false) {
                        this.my = this.mw(typeCast(IFastItemsSource_$type, d), this.ol, "VolumeColumn");
                    }
                }
                this.m0 = false;
                if (this.mm != null && !this.mm.ck()) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                break;
            case FinancialSeries.$$p[6]:
                if (this.bz != null) {
                    this.oq(this.bz, this.mv);
                    this.mv = this.mw(this.bz, this.oh, "OpenColumn");
                }
                break;
            case "OpenColumn":
                if (this.mm != null && !this.mm.ck() && !this.m0) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                break;
            case FinancialSeries.$$p[1]:
                if (this.bz != null) {
                    this.oq(this.bz, this.mr);
                    this.mr = this.mw(this.bz, this.n8, "HighColumn");
                }
                break;
            case "HighColumn":
                if (this.mm != null && !this.mm.ck() && !this.m0) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                break;
            case FinancialSeries.$$p[4]:
                if (this.bz != null) {
                    this.oq(this.bz, this.mt);
                    this.mt = this.mw(this.bz, this.od, "LowColumn");
                }
                break;
            case "LowColumn":
                if (this.mm != null && !this.mm.ck() && !this.m0) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                break;
            case FinancialSeries.$$p[0]:
                if (this.bz != null) {
                    this.oq(this.bz, this.mp);
                    this.mp = this.mw(this.bz, this.n5, "CloseColumn");
                }
                break;
            case "CloseColumn":
                if (this.mm != null && !this.mm.ck() && !this.m0) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                this.ov();
                break;
            case FinancialSeries.$$p[8]:
                if (this.bz != null) {
                    this.oq(this.bz, this.my);
                    this.my = this.mw(this.bz, this.ol, "VolumeColumn");
                }
                break;
            case "VolumeColumn":
                if (this.mm != null && !this.mm.ck() && !this.m0) {
                    this.mh.bu.e(this.er);
                    this.i6(false);
                }
                break;
            case FinancialSeries.$$p[9]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mh.bu.e(this.er);
                this.i6(false);
                this.ic();
                this.ml = typeCast(ITimeRangeSelectorAxis_$type, this.l1);
                break;
            case FinancialSeries.$$p[10]:
                if (c != null) {
                    c.bv(this);
                }
                if (d != null) {
                    d.ch(this);
                }
                this.mh.bu.e(this.er);
                if (this.mm != null) {
                    this.mm.ck();
                }
                {
                    this.i6(false);
                }
                this.ic();
                break;
            case "TransitionProgress":
                this.l6.c(this.ew, this.l4, this.l3);
                if (this.cc(this.bi)) {
                    return;
                }
                if (this.ew == 1) {
                    this.l3.v();
                    this.ou(this.l3, this.mh);
                    if (this.dl) {
                        this.dl = false;
                        this.hq();
                        this.bt.r = truncate(this.en());
                        this.bt.b = this.bu;
                    }
                }
                else {
                    this.ou(this.l6, this.mh);
                }
                if (this.bs != null) {
                    this.bs.jj(this);
                }
                break;
            case FinancialSeries.$$p[5]:
                this.i6(false);
                break;
            case "IsCustomCategoryStyleAllowed":
                this.m1 = this.m4();
                this.i6(false);
                break;
            case "CategoryMode":
                if (this.l1 != null) {
                    this.l1.kg(true);
                }
                break;
        }
    }
    m3(a) {
        if (typeCast(NumericYAxis.$, a) !== null) {
            return true;
        }
        return false;
    }
    m2(a) {
        if (typeCast(CategoryXAxis.$, a) !== null || a.b5) {
            return true;
        }
        return false;
    }
    lu(a, b, c) {
        if (b < a || a < 0 || a > this.bz.count || b < 0 || b > this.bz.count || c == null) {
            return null;
        }
        let d = new Array((b - a) + 1);
        let e = c.cc;
        let f = null;
        if (e) {
            f = c.i$b;
        }
        for (let g = a; g <= b; g++) {
            let h = g;
            if (e) {
                h = f._inner[h];
            }
            d[g - a] = this.bz.item(g);
        }
        return d;
    }
    ny(a) {
        return a.bu.b;
    }
    n0(a) {
        return a.bu.c;
    }
    lt(a, b) {
        return this.lu(a, b, this.mm);
    }
    get_m5() {
        return false;
    }
    get m5() {
        return this.get_m5();
    }
    get_cv() {
        return true;
    }
    at(a, b) {
        if (this.m5) {
            let c = this.mj(a, b, this.mk);
            this.mk = c;
            return c;
        }
        else {
            let d = this.mi(a, b, this.mk);
            this.mk = d;
            return d;
        }
    }
    n2(a) {
        let b = this.l3;
        if (this.ca()) {
            b = this.l6;
        }
        let c = this.bi.br;
        let d = this.bi.bs;
        let e = this.l1;
        let f = 0;
        if (e.ce) {
            let g = (a.y - d.top) / d.height;
            f = g * c.height + c.top;
        }
        else {
            let h = (a.x - d.left) / d.width;
            f = h * c.width + c.left;
        }
        let i = b.f.count;
        let j = 0;
        for (j = 0; j < i; j++) {
            let k = b.f._inner[j];
            let l = null;
            if (j < i - 1) {
                l = b.f._inner[j + 1];
            }
            if (k[0] <= f && l == null || l[0] >= f) {
                if (l != null) {
                    if (Math.abs(k[0] - f) < Math.abs(l[0] - f)) {
                        return j;
                    }
                    else {
                        return j + 1;
                    }
                }
                else {
                    return j;
                }
            }
        }
        return j;
    }
    mj(a, b, c) {
        let d = this.bz.count;
        let e = this.mh.bu.c;
        let f = this.mh.bu.d;
        let g = this.mh.bu.b;
        let h = this.l1;
        let i = -1;
        let j = -1;
        if (h.cc) {
            let k = this.l3;
            if (this.ca()) {
                k = this.l6;
            }
            let l = this.n2(b);
            i = l;
            j = l;
        }
        else {
            let m = this.e5(b);
            i = truncate(Math.floor((intDivide(m, g)))) * g;
            j = i + (g - 1);
        }
        if (c != null && c.f == i && c.e == j) {
            return c;
        }
        let n = new HighlightingInfo();
        n.b = this;
        n.f = i;
        n.e = j;
        return n;
    }
    mi(a, b, c) {
        let 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;
    }
    m4() {
        return this.m7;
    }
    d8(a) {
        let b = this.bi.bs;
        let c = this.bi.br;
        let d = -1;
        if (!b.isEmpty && !c.isEmpty && this.l1 != null) {
            let e = this.getEffectiveViewport1(this.bi);
            let f = new ScalerParams(0, b, c, this.l1.b8, e);
            let g = this.lj(this.bi);
            let h = this.l1.dw(g.left, f);
            let i = this.l1.dw(g.right, f);
            let j = (a.x - b.left) / b.width;
            let k = h + (j * (i - h));
            if (this.l1.categoryMode != 0) {
                k -= 0.5;
            }
            d = k;
        }
        return d;
    }
    e5(a) {
        return truncate(Math.round(this.d8(a)));
    }
    get_c1() {
        return typeCast(ISortingAxis_$type, this.l1) !== null;
    }
    ap() {
        return this.l1;
    }
    e7(a) {
        let b = this.bi.bs;
        let c = this.bi.br;
        let d = this.getEffectiveViewport1(this.bi);
        if (b.isEmpty || c.isEmpty) {
            return -1;
        }
        let e = new Rect(0, 0, 0, 1, 1);
        let f = new ScalerParams(0, b, c, this.l1.b8, d);
        let g = typeCast(ISortingAxis_$type, this.l1);
        let h = this.lj(this.bi);
        let i = h.left;
        let j = h.right;
        let k = this.k9(a).x;
        let l = this.l1.dw(k, f);
        let m = this.l1.dw(i, f);
        let n = this.l1.dw(j, f);
        l = Math.max(m, Math.min(n, l));
        let o = g.i$f(l);
        return o;
    }
    fm(a) {
        let b = 0;
        if (typeCast(ISortingAxis_$type, this.l1) !== null) {
            b = this.e7(a);
            if (b == -1) {
                return null;
            }
        }
        else {
            b = this.e5(a);
        }
        return b >= 0 && this.bz != null && b < this.bz.count ? this.bz.item(b) : null;
    }
    ns(a, b, c) {
        if (this.l1 == null) {
            return 0;
        }
        return this.l1.jl(a, b, c, this.fe);
    }
    db() {
        return this.m8;
    }
    ma() {
        return 11;
    }
    bo() {
        return 3;
    }
    ou(a, b) {
        this.li = a.aa;
        b.ar();
    }
    os(a, b) {
        a.u();
    }
    dv(a, b, c) {
        let d = super.dv(a, b, c);
        let e = c;
        if (this.bz == null || this.bz.count == 0 || !c.l() || b.isEmpty || a.isEmpty || this.l1 == null || this.mm == null || e.bu.b < 1 || this.l1.bf == null || this.mm.bf == null || this.mm.jx == this.mm.jw || this.l1.itemsSource == null || this.l1.jr < 1) {
            e.bu.b = 0;
            d = false;
        }
        return d;
    }
    getViewInfo(a, b) {
        b = this.bi.bs;
        a = this.bi.br;
        return {
            p0: a,
            p1: b
        };
    }
    nw(a) {
        let b = 0;
        let c = a.bs;
        let d = a.br;
        let e = this.getEffectiveViewport1(this.bi);
        if (!c.isEmpty && !d.isEmpty && this.mm != null) {
            let f = new ScalerParams(0, c, d, this.mm.b8, e);
            f.b = this.ee();
            b = this.mm.dt(this.mm.j7, f);
        }
        return b;
    }
    hq() {
        super.hq();
        this.l4.v();
        this.l3.v();
        this.l6.v();
    }
    i7(a) {
        super.i7(a);
        this.mh.bu.e(this.er);
        if (this.cc(this.bi)) {
            return;
        }
        if (this.dd) {
            if (this.ca()) {
                this.ou(this.l6, this.mh);
            }
            else {
                this.ou(this.l3, this.mh);
            }
            return;
        }
        if (this.c9(a)) {
            let b = this.l4;
            if (this.ca()) {
                if (this.bt.g) {
                    this.bt.t();
                }
                this.l4 = this.l6;
                this.l6 = b;
            }
            else {
                this.l4 = this.l3;
                this.l3 = b;
            }
            this.os(this.l3, this.mh);
            if (this.dn) {
                this.bt.w();
                this.bt.r = truncate(this.eo());
                this.bt.b = this.bv != null ? this.bv : this.bu;
                this.mc.p(this.l4, this.l3, this.isVertical, this.l1, this.mm, this.mb, this.ma(), this.bp, this.bo(), () => this.nw(this.mh), this.mh.br);
            }
            this.hm();
            this.je();
            if (this.dn) {
                this.dm = false;
                this.dl = true;
            }
        }
        else {
            this.os(this.l3, this.mh);
            this.ou(this.l3, this.mh);
        }
    }
    na(a) {
        for (let b of fromEnum(a)) {
            switch (b) {
                case "HighColumn":
                    if (this.mr == null) {
                        return false;
                    }
                    break;
                case "LowColumn":
                    if (this.mt == null) {
                        return false;
                    }
                    break;
                case "OpenColumn":
                    if (this.mv == null) {
                        return false;
                    }
                    break;
                case "CloseColumn":
                    if (this.mp == null) {
                        return false;
                    }
                    break;
                case "VolumeColumn":
                    if (this.my == null) {
                        return false;
                    }
                    break;
            }
        }
        return true;
    }
    get nb() {
        return this.l1 != null && typeCast(ISortingAxis_$type, this.l1) !== null;
    }
    m6() {
        return this.typical != null;
    }
    op(a) {
        this.typical(this, a);
    }
    get nj() {
        return this.ng();
    }
    *_ng() {
        let a = false;
        if (this.m6()) {
            let b = this.md(0, this.bz.count);
            this.op(new FinancialEventArgs(0, this.bz.count, b, this.me(b), this));
            if (b.typicalColumn != null) {
                a = true;
                for (let c of fromEnum(b.typicalColumn)) {
                    yield c;
                }
            }
        }
        if (!a) {
            if (this.nb && this.l1.i$b != null) {
                let d = this.bz.count;
                let e = this.l1.i$b;
                for (let f = 0; f < d; ++f) {
                    yield (this.mr.item(e.item(f)) + this.mt.item(e.item(f)) + this.mp.item(e.item(f))) / 3;
                }
            }
            else {
                let g = this.bz.count;
                for (let h = 0; h < g; ++h) {
                    yield (this.mr.item(h) + this.mt.item(h) + this.mp.item(h)) / 3;
                }
            }
        }
    }
    ng() {
        return toEnum(() => this._ng());
    }
    get ni() {
        return this.nf();
    }
    *_nf() {
        if (this.nb && this.l1.i$b != null) {
            let a = this.mr.count;
            let b = this.l1.i$b;
            if (a > 0) {
                yield this.nx(this.mr.item(b.item(0)) - this.mt.item(b.item(0)));
            }
            for (let c = 1; c < a; ++c) {
                yield Math.max(this.nx(this.mr.item(b.item(c)) - this.mt.item(b.item(c))), Math.max(this.nx(Math.abs(this.mr.item(b.item(c)) - this.mp.item(b.item(c - 1)))), this.nx(Math.abs(this.mt.item(b.item(c)) - this.mp.item(b.item(c - 1))))));
            }
        }
        else {
            let d = this.mr.count;
            if (d > 0) {
                yield this.nx(this.mr.item(0) - this.mt.item(0));
            }
            for (let e = 1; e < d; ++e) {
                yield Math.max(this.nx(this.mr.item(e) - this.mt.item(e)), Math.max(this.nx(Math.abs(this.mr.item(e) - this.mp.item(e - 1))), this.nx(Math.abs(this.mt.item(e) - this.mp.item(e - 1)))));
            }
        }
    }
    nf() {
        return toEnum(() => this._nf());
    }
    get nh() {
        return this.ne();
    }
    *_ne() {
        if (this.nb && this.l1.i$b != null) {
            let a = this.mt.count;
            let b = this.l1.i$b;
            if (a > 0) {
                yield this.nx(this.mt.item(b.item(0)));
            }
            for (let c = 1; c < a; c++) {
                yield Math.min(this.nx(this.mt.item(b.item(c))), this.nx(this.mp.item(b.item(c - 1))));
            }
        }
        else {
            let d = this.mt.count;
            if (d > 0) {
                yield this.nx(this.mt.item(0));
            }
            for (let e = 1; e < d; e++) {
                yield Math.min(this.nx(this.mt.item(e)), this.nx(this.mp.item(e - 1)));
            }
        }
    }
    ne() {
        return toEnum(() => this._ne());
    }
    nl(a) {
        if (a == null) {
            return null;
        }
        if (this.nb && this.l1.i$b != null) {
            return new SafeSortedReadOnlyDoubleCollection(0, a, this.l1.i$b);
        }
        return new SafeReadOnlyDoubleCollection(0, a);
    }
    nk() {
        let a = new List$1(String_$type, 0);
        a.add("HighColumn");
        a.add("LowColumn");
        a.add("CloseColumn");
        if (this.typicalBasedOn != null && this.bz != null && !this.mz) {
            this.mz = true;
            let b = this.md(0, this.bz.count);
            this.mz = false;
            let c = new FinancialEventArgs(0, this.bz.count, b, this.me(b), this);
            this.typicalBasedOn(this, c);
            if (c.basedOn != null && c.basedOn.count > 0) {
                return c.basedOn;
            }
        }
        return a;
    }
    getOpenColumnAsArray() {
        if (this.mv == null) {
            return null;
        }
        if (this.l1 != null && typeCast(ISortingAxis_$type, this.l1) !== null) {
            if (this.np != null) {
                return this.np.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mv.count);
            let b = this.l1.i$b;
            let c = this.mv.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.np = a;
            return this.np.asArray();
        }
        else {
            return this.mv.asArray();
        }
    }
    getHighColumnAsArray() {
        if (this.mr == null) {
            return null;
        }
        if (this.l1 != null && typeCast(ISortingAxis_$type, this.l1) !== null) {
            if (this.nn != null) {
                return this.nn.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mr.count);
            let b = this.l1.i$b;
            let c = this.mr.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nn = a;
            return this.nn.asArray();
        }
        else {
            return this.mr.asArray();
        }
    }
    getLowColumnAsArray() {
        if (this.mt == null) {
            return null;
        }
        if (this.l1 != null && typeCast(ISortingAxis_$type, this.l1) !== null) {
            if (this.no != null) {
                return this.no.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mt.count);
            let b = this.l1.i$b;
            let c = this.mt.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.no = a;
            return this.no.asArray();
        }
        else {
            return this.mt.asArray();
        }
    }
    getCloseColumnAsArray() {
        if (this.mp == null) {
            return null;
        }
        if (this.l1 != null && typeCast(ISortingAxis_$type, this.l1) !== null) {
            if (this.nm != null) {
                return this.nm.asArray();
            }
            let a = new List$1(Number_$type, 2, this.mp.count);
            let b = this.l1.i$b;
            let c = this.mp.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nm = a;
            return this.nm.asArray();
        }
        else {
            return this.mp.asArray();
        }
    }
    getVolumeColumnAsArray() {
        if (this.my == null) {
            return null;
        }
        if (this.l1 != null && typeCast(ISortingAxis_$type, this.l1) !== null) {
            if (this.nq != null) {
                return this.nq.asArray();
            }
            let a = new List$1(Number_$type, 2, this.my.count);
            let b = this.l1.i$b;
            let c = this.my.asArray();
            for (let d = 0; d < b.count; d++) {
                a.add(c[b._inner[d]]);
            }
            this.nq = a;
            return this.nq.asArray();
        }
        else {
            return this.my.asArray();
        }
    }
    hs(a, b, c, d) {
        super.hs(a, b, c, d);
        if (this.l1 == null || !(typeCast(ISortingAxis_$type, this.l1) !== null)) {
            return;
        }
        let e = this.l1.i$b;
        switch (a) {
            case 1:
                for (let f = b; f < c; f++) {
                    let g = e._inner[f];
                    if (this.np != null) {
                        this.np.insert(f, this.mv.item(g));
                    }
                    if (this.nn != null) {
                        this.nn.insert(f, this.mr.item(g));
                    }
                    if (this.no != null) {
                        this.no.insert(f, this.mt.item(g));
                    }
                    if (this.nm != null) {
                        this.nm.insert(f, this.mp.item(g));
                    }
                    if (this.nq != null) {
                        this.nq.insert(f, this.my.item(g));
                    }
                }
                break;
            case 0:
                if (this.np != null) {
                    this.np.v(b, c);
                }
                if (this.nn != null) {
                    this.nn.v(b, c);
                }
                if (this.no != null) {
                    this.no.v(b, c);
                }
                if (this.nm != null) {
                    this.nm.v(b, c);
                }
                if (this.nq != null) {
                    this.nq.v(b, c);
                }
                break;
            case 4:
                if (this.np != null) {
                    this.np = new List$1(Number_$type, 0);
                }
                if (this.nn != null) {
                    this.nn = new List$1(Number_$type, 0);
                }
                if (this.no != null) {
                    this.no = new List$1(Number_$type, 0);
                }
                if (this.nm != null) {
                    this.nm = new List$1(Number_$type, 0);
                }
                if (this.nq != null) {
                    this.nq = new List$1(Number_$type, 0);
                }
                break;
            case 3:
            case 2:
                for (let h = b; h < c; h++) {
                    let i = e._inner[h];
                    if (this.np != null) {
                        this.np._inner[h] = this.mv.item(i);
                    }
                    if (this.nn != null) {
                        this.nn._inner[h] = this.mr.item(i);
                    }
                    if (this.no != null) {
                        this.no._inner[h] = this.mt.item(i);
                    }
                    if (this.nm != null) {
                        this.nm._inner[h] = this.mp.item(i);
                    }
                    if (this.nq != null) {
                        this.nq._inner[h] = this.my.item(i);
                    }
                }
                break;
        }
        this.ov();
        this.jj();
    }
    md(a, b) {
        let c = this.nl(this.mv);
        let d = this.nl(this.mp);
        let e = this.nl(this.mr);
        let f = this.nl(this.mt);
        let g = this.nl(this.my);
        let h = ((() => {
            let $ret = new FinancialCalculationDataSource();
            $ret.typicalColumn = new CalculatedColumn(1, new SafeEnumerable(this.nj), this.nk());
            $ret.trueRange = new CalculatedColumn(1, new SafeEnumerable(this.ni), ((() => {
                let $ret = new List$1(String_$type, 0);
                $ret.add("HighColumn");
                $ret.add("LowColumn");
                $ret.add("CloseColumn");
                return $ret;
            })()));
            $ret.trueLow = new CalculatedColumn(1, new SafeEnumerable(this.nh), ((() => {
                let $ret = new List$1(String_$type, 0);
                $ret.add("LowColumn");
                $ret.add("CloseColumn");
                return $ret;
            })()));
            $ret.openColumn = c;
            $ret.closeColumn = d;
            $ret.highColumn = e;
            $ret.lowColumn = f;
            $ret.volumeColumn = g;
            $ret.calculateFrom = a;
            $ret.calculateCount = b;
            $ret.minimumValue = NaN;
            $ret.maximumValue = NaN;
            $ret.count = this.bz != null ? this.bz.count : 0;
            return $ret;
        })());
        return h;
    }
    nx(a) {
        if (isInfinity(a) || isNaN_(a)) {
            return 0;
        }
        return a;
    }
    me(a) {
        return ((() => {
            let $ret = new FinancialCalculationSupportingCalculations();
            $ret.a = new ColumnSupportingCalculation(1, TrendCalculators.b, new List$1(String_$type, 0));
            $ret.c = new ColumnSupportingCalculation(1, TrendCalculators.e, new List$1(String_$type, 0));
            $ret.d = new ColumnSupportingCalculation(1, TrendCalculators.f, new List$1(String_$type, 0));
            $ret.b = new ColumnSupportingCalculation(1, TrendCalculators.d, new List$1(String_$type, 0));
            $ret.h = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.volumeColumn, b.shortPeriod), ((() => {
                let $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.f = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.volumeColumn, b.longPeriod), ((() => {
                let $ret = new List$1(String_$type, 0);
                $ret.add("VolumeColumn");
                return $ret;
            })()));
            $ret.g = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.shortPeriod), a.typicalColumn.basedOn);
            $ret.e = new DataSourceSupportingCalculation(1, (b) => TrendCalculators.b(b.typicalColumn, b.longPeriod), a.typicalColumn.basedOn);
            $ret.k = Series.dy;
            $ret.j = Series.dx;
            $ret.i = runOn(this, this.nx);
            return $ret;
        })());
    }
    get categoryAxis() {
        return this.l1;
    }
    i8(a, b) {
        super.i8(a, b);
        if (!this.dk) {
            this.bi.az(b);
            return;
        }
        let c = typeCast(FinancialSeriesView.$, this.bh);
        this.bi.az(b);
        c.bu.e(this.er);
        if (this.cc(this.bh)) {
            return;
        }
        if (!this.de) {
            this.os(this.l5, c);
        }
        this.de = false;
        this.ou(this.l5, c);
        this.dk = false;
    }
    i5(a, b, c, d, e) {
        super.i5(a, b, c, d, e);
        let f = this.a0.a$h.item(d);
        let g = f;
        g.bu.e(this.er);
        f.ay(c);
        if (this.cc(g)) {
            return;
        }
        if (this.l2 == null) {
            this.l2 = new CategoryFrame(3);
        }
        this.l2.u();
        this.os(this.l2, g);
        this.ou(this.l2, g);
    }
    am(a) {
        if (this.l1 == a) {
            return this.mm;
        }
        if (this.mm == a) {
            return this.l1;
        }
        return null;
    }
    preferredCategoryMode(a) {
        let b = typeCast(IDateTimeAxis_$type, this.l1);
        return b != null ? b.preferredCategoryMode(this) : this.l8;
    }
    get l8() {
        return this.l7;
    }
    set l8(a) {
        let b = this.l8;
        if (a != b) {
            this.l7 = a;
            this.raisePropertyChanged("CategoryMode", enumGetBox(CategoryMode_$type, b), enumGetBox(CategoryMode_$type, this.l8));
        }
    }
    get_cz() {
        return true;
    }
    jb(a, b) {
        super.jb(a, b);
        this.o7 = a;
    }
    ov() {
        this.d5 = this.mp == null || this.mp.count == 0 ? NaN : this.mp.item(this.mp.count - 1);
    }
    fo(a) {
        if (this.ml != null && a != null) {
            if (this.mn == null || this.mn.f != this.ml.dateTimeMemberPath) {
                this.mn = new FastReflectionHelper(false, this.ml.dateTimeMemberPath);
            }
            let b = this.mn.d(a);
            if (typeCast(Date_$type, b) !== null) {
                return dateToStringFormat(b, this.ml.itemLabelFormat());
            }
        }
        return super.fo(a);
    }
}
FinancialSeries.$t = markType(FinancialSeries, 'FinancialSeries', Series.$, [IHasCategoryAxis_$type, IHasCategoryModePreference_$type]);
Type.dep(DependencyProperty, PropertyMetadata, FinancialSeries, 'raisePropertyChanged', ['CloseMemberPath:n5:ow', [2, null], 'HighMemberPath:n8:ox', [2, null], 'IsCustomCategoryStyleAllowed:m7:oy', [0, false], 'IsTransitionInEnabled:m8:oz', [0, false], 'LowMemberPath:od:o0', [2, null], 'NegativeBrush:o7:o1', [Brush.$, null], 'OpenMemberPath:oh:o2', [2, null], 'TransitionInMode:mb:o3', [CategoryTransitionInMode_$type, enumGetBox(CategoryTransitionInMode_$type, 0)], 'VolumeMemberPath:ol:o4', [2, null], 'XAxis:l1:o5', [CategoryAxisBase.$, null], 'YAxis:mm:o6', [NumericYAxis.$, null]]);
/**
 * @hidden
 */
export class FinancialCalculationSupportingCalculations extends Base {
    constructor() {
        super(...arguments);
        this.a = null;
        this.c = null;
        this.d = null;
        this.b = null;
        this.h = null;
        this.f = null;
        this.g = null;
        this.e = null;
        this.k = null;
        this.j = null;
        this.i = null;
    }
}
FinancialCalculationSupportingCalculations.$t = markType(FinancialCalculationSupportingCalculations, 'FinancialCalculationSupportingCalculations');
/**
 * @hidden
 */
export class DataSourceSupportingCalculation extends SupportingCalculation$1 {
    constructor(a, ..._rest) {
        a = (a == void 0) ? 0 : a;
        switch (a) {
            case 0:
                {
                    let c = _rest[0];
                    super(Delegate_$type, 0, c);
                }
                break;
            case 1:
                {
                    let c = _rest[0];
                    let d = _rest[1];
                    super(Delegate_$type, 1, c, d);
                }
                break;
        }
    }
}
DataSourceSupportingCalculation.$t = markType(DataSourceSupportingCalculation, 'DataSourceSupportingCalculation', SupportingCalculation$1.$.specialize(Delegate_$type));
/**
 * @hidden
 */
export class FinancialCalculationDataSource extends Base {
    constructor() {
        super(...arguments);
        this._openColumn = null;
        this._closeColumn = null;
        this._highColumn = null;
        this._lowColumn = null;
        this._volumeColumn = null;
        this._indicatorColumn = null;
        this._typicalColumn = null;
        this._trueRange = null;
        this._trueLow = null;
        this._period = 0;
        this._shortPeriod = 0;
        this._longPeriod = 0;
        this._count = 0;
        this._calculateFrom = 0;
        this._calculateCount = 0;
        this._multiplier = 0;
        this._minimumValue = 0;
        this._maximumValue = 0;
        this._specifiesRange = false;
        this._series = null;
    }
    get openColumn() {
        return this._openColumn;
    }
    set openColumn(a) {
        this._openColumn = a;
    }
    get closeColumn() {
        return this._closeColumn;
    }
    set closeColumn(a) {
        this._closeColumn = a;
    }
    get highColumn() {
        return this._highColumn;
    }
    set highColumn(a) {
        this._highColumn = a;
    }
    get lowColumn() {
        return this._lowColumn;
    }
    set lowColumn(a) {
        this._lowColumn = a;
    }
    get volumeColumn() {
        return this._volumeColumn;
    }
    set volumeColumn(a) {
        this._volumeColumn = a;
    }
    get indicatorColumn() {
        return this._indicatorColumn;
    }
    set indicatorColumn(a) {
        this._indicatorColumn = a;
    }
    get typicalColumn() {
        return this._typicalColumn;
    }
    set typicalColumn(a) {
        this._typicalColumn = a;
    }
    get trueRange() {
        return this._trueRange;
    }
    set trueRange(a) {
        this._trueRange = a;
    }
    get trueLow() {
        return this._trueLow;
    }
    set trueLow(a) {
        this._trueLow = a;
    }
    get period() {
        return this._period;
    }
    set period(a) {
        this._period = a;
    }
    get shortPeriod() {
        return this._shortPeriod;
    }
    set shortPeriod(a) {
        this._shortPeriod = a;
    }
    get longPeriod() {
        return this._longPeriod;
    }
    set longPeriod(a) {
        this._longPeriod = a;
    }
    get count() {
        return this._count;
    }
    set count(a) {
        this._count = a;
    }
    get calculateFrom() {
        return this._calculateFrom;
    }
    set calculateFrom(a) {
        this._calculateFrom = a;
    }
    get calculateCount() {
        return this._calculateCount;
    }
    set calculateCount(a) {
        this._calculateCount = a;
    }
    get multiplier() {
        return this._multiplier;
    }
    set multiplier(a) {
        this._multiplier = a;
    }
    get minimumValue() {
        return this._minimumValue;
    }
    set minimumValue(a) {
        this._minimumValue = a;
    }
    get maximumValue() {
        return this._maximumValue;
    }
    set maximumValue(a) {
        this._maximumValue = a;
    }
    get specifiesRange() {
        return this._specifiesRange;
    }
    set specifiesRange(a) {
        this._specifiesRange = a;
    }
    get series() {
        return this._series;
    }
    set series(a) {
        this._series = a;
    }
}
FinancialCalculationDataSource.$t = markType(FinancialCalculationDataSource, 'FinancialCalculationDataSource');
/**
 * @hidden
 */
export class FinancialSeriesView extends SeriesView {
    constructor(a) {
        super(a);
        this.bw = null;
        this.bu = null;
        this.by = 0;
        this.by = -1;
        this.bw = a;
        this.bu = this.bv();
    }
    bx(a) {
        if (this.by != a.t) {
            return true;
        }
        return false;
    }
    bz(a) {
        this.by = a.t;
    }
    ap() {
        super.ap();
        if (!this.n) {
            this.e.bj = 6;
        }
    }
    getDefaultTooltipTemplate() {
        let a = "<div class='ui-chart-default-tooltip-content'>";
        if (this.bw.l1.b5) {
            a += "<span>${itemLabel}</span><br/>";
        }
        else if (this.bw.l1.e2 != null) {
            a += "<span>${item." + this.bw.l1.e2 + "}</span><br/>";
        }
        a += "<span class='ui-priority-primary'";
        let b = this.e.a0.a$q(this.e);
        if (!stringIsNullOrEmpty(b)) {
            a += " style='color:" + b + "'";
        }
        let c = new SRProvider(this.t);
        let d = c.al("financialSeries_Open");
        let e = c.al("financialSeries_High");
        let f = c.al("financialSeries_Low");
        let g = c.al("financialSeries_Close");
        d = stringIsNullOrEmpty(d) ? "Open" : d;
        e = stringIsNullOrEmpty(e) ? "High" : e;
        f = stringIsNullOrEmpty(f) ? "Low" : f;
        g = stringIsNullOrEmpty(g) ? "Close" : g;
        a += ">" + this.bw.fs + "</span><table><tr><td>" + d + ":</td><td>" + "${item." + this.bw.oh + "}</td></tr><tr><td>" + e + ":</td><td>" + "${item." + this.bw.n8 + "}</td></tr><tr><td>" + f + ":</td><td>" + "${item." + this.bw.od + "}</td></tr><tr><td>" + g + ":</td><td>" + "${item." + this.bw.n5 + "}</td></tr>";
        if (!stringIsNullOrEmpty(this.bw.ol)) {
            let h = c.al("financialSeries_Volume");
            h = stringIsNullOrEmpty(h) ? "Volume" : h;
            a += "<tr><td>" + h + ":</td><td>" + "${item." + this.bw.ol + "}</td></tr>";
        }
        a += "</table></div>";
        return a;
    }
    ac() {
        let a = new Color();
        a.colorString = "rgba(95,95,95,0.5)";
        this.e.k3 = a;
        this.e.es = 5;
        this.e.et = 2;
        this.e.eu = 2;
    }
}
FinancialSeriesView.$t = markType(FinancialSeriesView, 'FinancialSeriesView', SeriesView.$);
