(self.webpackChunktradingview = self.webpackChunktradingview || []).push([
    [64707, 24377, 91317, 99940], {
        150335: (t, i) => {
            "use strict";

            function s(t) {
                return Math.round(1e10 * t) / 1e10
            }
            Object.defineProperty(i, "__esModule", {
                value: !0
            }), i.alignTo = i.fixComputationError = i.isNaN = i.isInteger = i.isNumber = void 0, i.isNumber = function(t) {
                return "number" == typeof t && isFinite(t)
            }, i.isInteger = function(t) {
                return "number" == typeof t && t % 1 == 0
            }, i.isNaN = function(t) {
                return !(t <= 0 || t > 0)
            }, i.fixComputationError = s, i.alignTo = function(t, i) {
                var e = t / i,
                    n = Math.floor(e),
                    h = e - n;
                return h > 2e-10 ? s(h > .5 ? (n + 1) * i : n * i) : t
            }
        },
        130551: (t, i) => {
            "use strict";
            i.hasProperty = i.isObject = void 0, i.isObject = function(t) {
                var i = typeof t;
                return null !== t && ("object" === i || "function" === i)
            }, i.hasProperty = function(t, i) {
                return i in t
            }
        },
        724377: (t, i, s) => {
            "use strict";
            var e = s(150335);

            function n(t, i, s) {
                return e.isNaN(i) || i < t ? t : i > s ? s : Math.round(i)
            }

            function h(t, i, s) {
                return e.isNaN(i) || i < t ? t : i > s ? s : Math.round(1e4 * i) / 1e4
            }

            function r(t) {
                return n(0, t, 255)
            }

            function o(t) {
                return n(0, t, 255)
            }

            function l(t) {
                return n(0, t, 255)
            }

            function a(t) {
                return h(0, t, 1)
            }

            function u(t) {
                return h(0, t, 1)
            }

            function c(t) {
                return h(0, t, 1)
            }

            function f(t) {
                return h(0, t, 1)
            }

            function d(t) {
                return h(0, t, 1)
            }

            function p(t) {
                return h(0, t, 1)
            }

            function m(t) {
                var i = t[0] / 255,
                    s = t[1] / 255,
                    e = t[2] / 255,
                    n = Math.min(i, s, e),
                    h = Math.max(i, s, e),
                    r = 0,
                    o = 0,
                    l = (n + h) / 2;
                if (n === h) r = 0, o = 0;
                else {
                    var a = h - n;
                    switch (o = l > .5 ? a / (2 - h - n) : a / (h + n), h) {
                        case i:
                            r = ((s - e) / a + (s < e ? 6 : 0)) / 6;
                            break;
                        case s:
                            r = ((e - i) / a + 2) / 6;
                            break;
                        case e:
                            r = ((i - s) / a + 4) / 6
                    }
                }
                return [r, o, l]
            }

            function v(t, i, s) {
                return s < 0 && (s += 1), s > 1 && (s -= 1), s < 1 / 6 ? t + 6 * (i - t) * s : s < .5 ? i : s < 2 / 3 ? t + (i - t) * (2 / 3 - s) * 6 : t
            }

            function b(t) {
                var i, s, e, n = t[0],
                    h = t[1],
                    a = t[2];
                if (0 === h) i = s = e = a;
                else {
                    var u = a < .5 ? a * (1 + h) : a + h - a * h,
                        c = 2 * a - u;
                    i = v(c, u, n + 1 / 3), s = v(c, u, n), e = v(c, u, n - 1 / 3)
                }
                return [r(255 * i), o(255 * s), l(255 * e)]
            }
            i.normalizeAlphaComponent = a, i.rgba = function(t, i, s, e) {
                if (Array.isArray(t)) {
                    var n = t;
                    return e = i, [n[0], n[1], n[2], a(e)]
                }
                var h = i;
                return s = s || 0, e = e || 0, [r(t), o(h), l(s), a(e)]
            };
            var g = [.199, .687, .114];

            function w(t) {
                return g[0] * t[0] + g[1] * t[1] + g[2] * t[2]
            }

            function y(t, i, s) {
                void 0 === s && (s = .05);
                var e = m(t),
                    n = e[0] + i * s;
                return e[0] = u(n - Math.floor(n)), b(e)
            }

            function M(t, i, s) {
                void 0 === s && (s = .05);
                var e = t[0],
                    n = t[1],
                    h = t[2],
                    r = t[3],
                    o = y([e, n, h], i, s);
                return [o[0], o[1], o[2], r]
            }
            var S, C, x, z, k = {
                aliceblue: "#f0f8ff",
                antiquewhite: "#faebd7",
                aqua: "#00ffff",
                aquamarine: "#7fffd4",
                azure: "#f0ffff",
                beige: "#f5f5dc",
                bisque: "#ffe4c4",
                black: "#000000",
                blanchedalmond: "#ffebcd",
                blue: "#0000ff",
                blueviolet: "#8a2be2",
                brown: "#a52a2a",
                burlywood: "#deb887",
                cadetblue: "#5f9ea0",
                chartreuse: "#7fff00",
                chocolate: "#d2691e",
                coral: "#ff7f50",
                cornflowerblue: "#6495ed",
                cornsilk: "#fff8dc",
                crimson: "#dc143c",
                cyan: "#00ffff",
                darkblue: "#00008b",
                darkcyan: "#008b8b",
                darkgoldenrod: "#b8860b",
                darkgray: "#a9a9a9",
                darkgreen: "#006400",
                darkkhaki: "#bdb76b",
                darkmagenta: "#8b008b",
                darkolivegreen: "#556b2f",
                darkorange: "#ff8c00",
                darkorchid: "#9932cc",
                darkred: "#8b0000",
                darksalmon: "#e9967a",
                darkseagreen: "#8fbc8f",
                darkslateblue: "#483d8b",
                darkslategray: "#2f4f4f",
                darkturquoise: "#00ced1",
                darkviolet: "#9400d3",
                deeppink: "#ff1493",
                deepskyblue: "#00bfff",
                dimgray: "#696969",
                dodgerblue: "#1e90ff",
                feldspar: "#d19275",
                firebrick: "#b22222",
                floralwhite: "#fffaf0",
                forestgreen: "#228b22",
                fuchsia: "#ff00ff",
                gainsboro: "#dcdcdc",
                ghostwhite: "#f8f8ff",
                gold: "#ffd700",
                goldenrod: "#daa520",
                gray: "#808080",
                green: "#008000",
                greenyellow: "#adff2f",
                honeydew: "#f0fff0",
                hotpink: "#ff69b4",
                indianred: "#cd5c5c",
                indigo: "#4b0082",
                ivory: "#fffff0",
                khaki: "#f0e68c",
                lavender: "#e6e6fa",
                lavenderblush: "#fff0f5",
                lawngreen: "#7cfc00",
                lemonchiffon: "#fffacd",
                lightblue: "#add8e6",
                lightcoral: "#f08080",
                lightcyan: "#e0ffff",
                lightgoldenrodyellow: "#fafad2",
                lightgreen: "#90ee90",
                lightgrey: "#d3d3d3",
                lightpink: "#ffb6c1",
                lightsalmon: "#ffa07a",
                lightseagreen: "#20b2aa",
                lightskyblue: "#87cefa",
                lightslateblue: "#8470ff",
                lightslategray: "#778899",
                lightsteelblue: "#b0c4de",
                lightyellow: "#ffffe0",
                lime: "#00ff00",
                limegreen: "#32cd32",
                linen: "#faf0e6",
                magenta: "#ff00ff",
                maroon: "#800000",
                mediumaquamarine: "#66cdaa",
                mediumblue: "#0000cd",
                mediumorchid: "#ba55d3",
                mediumpurple: "#9370d8",
                mediumseagreen: "#3cb371",
                mediumslateblue: "#7b68ee",
                mediumspringgreen: "#00fa9a",
                mediumturquoise: "#48d1cc",
                mediumvioletred: "#c71585",
                midnightblue: "#191970",
                mintcream: "#f5fffa",
                mistyrose: "#ffe4e1",
                moccasin: "#ffe4b5",
                navajowhite: "#ffdead",
                navy: "#000080",
                oldlace: "#fdf5e6",
                olive: "#808000",
                olivedrab: "#6b8e23",
                orange: "#ffa500",
                orangered: "#ff4500",
                orchid: "#da70d6",
                palegoldenrod: "#eee8aa",
                palegreen: "#98fb98",
                paleturquoise: "#afeeee",
                palevioletred: "#d87093",
                papayawhip: "#ffefd5",
                peachpuff: "#ffdab9",
                peru: "#cd853f",
                pink: "#ffc0cb",
                plum: "#dda0dd",
                powderblue: "#b0e0e6",
                purple: "#800080",
                red: "#ff0000",
                rosybrown: "#bc8f8f",
                royalblue: "#4169e1",
                saddlebrown: "#8b4513",
                salmon: "#fa8072",
                sandybrown: "#f4a460",
                seagreen: "#2e8b57",
                seashell: "#fff5ee",
                sienna: "#a0522d",
                silver: "#c0c0c0",
                skyblue: "#87ceeb",
                slateblue: "#6a5acd",
                slategray: "#708090",
                snow: "#fffafa",
                springgreen: "#00ff7f",
                steelblue: "#4682b4",
                tan: "#d2b48c",
                teal: "#008080",
                thistle: "#d8bfd8",
                tomato: "#ff6347",
                turquoise: "#40e0d0",
                violet: "#ee82ee",
                violetred: "#d02090",
                wheat: "#f5deb3",
                white: "#ffffff",
                whitesmoke: "#f5f5f5",
                yellow: "#ffff00",
                yellowgreen: "#9acd32"
            };

            function _(t, i) {
                return i in t
            }

            function L(t) {
                var i = S.re.exec(t);
                return null !== i ? S.parse(i) : null
            }

            function O(t) {
                var i = C.re.exec(t);
                return null !== i ? C.parse(i) : null
            }

            function T(t) {
                var i = x.re.exec(t);
                return null !== i ? x.parse(i) : null
            }

            function E(t) {
                var i = z.re.exec(t);
                return null !== i ? z.parse(i) : null
            }

            function N(t) {
                return "rgba(" + t[0] + ", " + t[1] + ", " + t[2] + ", " + t[3] + ")"
            }

            function $(t) {
                if (t = t.toLowerCase(), _(k, t)) {
                    var i = O(k[t]);
                    if (null !== i) return i;
                    throw new Error("Invalid named color definition")
                }
                var s = L(t);
                if (null !== s) return s;
                var e = O(t);
                if (null !== e) return e;
                var n = T(t);
                if (null !== n) return n;
                var h = E(t);
                return null !== h ? [h[0], h[1], h[2]] : null
            }

            function W(t) {
                if (t = t.toLowerCase(), _(k, t)) {
                    var i = O(k[t]);
                    if (null !== i) return [i[0], i[1], i[2], 1];
                    throw new Error("Invalid named color definition")
                }
                var s = L(t);
                if (null !== s) return [s[0], s[1], s[2], 1];
                var e = O(t);
                if (null !== e) return [e[0], e[1], e[2], 1];
                var n = T(t);
                if (null !== n) return [n[0], n[1], n[2], 1];
                var h = E(t);
                return null !== h ? h : null
            }

            function P(t) {
                var i = W(t);
                if (null !== i) return i;
                throw new Error("Passed color string does not match any of the known color representations")
            }! function(t) {
                t.re = /^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/, t.parse = function(t) {
                    return [r(parseInt(t[1], 10)), o(parseInt(t[2], 10)), l(parseInt(t[3], 10))]
                }
            }(S || (S = {})),
            function(t) {
                t.re = /^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/, t.parse = function(t) {
                    return [r(parseInt(t[1], 16)), o(parseInt(t[2], 16)), l(parseInt(t[3], 16))]
                }
            }(C || (C = {})),
            function(t) {
                t.re = /^#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])$/, t.parse = function(t) {
                    return [r(parseInt(t[1] + t[1], 16)), o(parseInt(t[2] + t[2], 16)), l(parseInt(t[3] + t[3], 16))]
                }
            }(x || (x = {})),
            function(t) {
                t.re = /^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?[\d]{0,10}(?:\.\d+)?)\s*\)$/, t.parse = function(t) {
                    return [r(parseInt(t[1], 10)), o(parseInt(t[2], 10)), l(parseInt(t[3], 10)), a(parseFloat(t[4]))]
                }
            }(z || (z = {})), i.rgbaToString = N, i.tryParseRgb = $, i.parseRgb = function(t) {
                var i = $(t);
                if (null !== i) return i;
                throw new Error("Passed color string does not match any of the known color representations")
            }, i.tryParseRgba = W, i.parseRgba = P
        },
        64531: (t, i) => {
            "use strict";
            var s, e = !("undefined" == typeof window || !window.document || !window.document.createElement);

            function n() {
                if (s) return s;
                if (!e || !window.document.body) return "indeterminate";
                var t = window.document.createElement("div");
                return t.appendChild(document.createTextNode("ABCD")), t.dir = "rtl", t.style.fontSize = "14px", t.style.width = "4px", t.style.height = "1px", t.style.position = "absolute", t.style.top = "-1000px", t.style.overflow = "scroll", document.body.appendChild(t), s = "reverse", t.scrollLeft > 0 ? s = "default" : (t.scrollLeft = 1, 0 === t.scrollLeft && (s = "negative")), document.body.removeChild(t), s
            }
        },
        638456: (t, i, s) => {
            "use strict";
            s.r(i), s.d(i, {
                CheckMobile: () => f,
                appVersion: () => c,
                checkPageType: () => m,
                desktopAppVersion: () => u,
                isChrome: () => v,
                isDesktopApp: () => l,
                isEdge: () => g,
                isFF: () => b,
                isLinux: () => o,
                isMac: () => h,
                isSafari: () => w,
                isSymphonyEmbed: () => a,
                isWindows: () => r,
                onGoPro: () => y,
                onMainPage: () => M,
                onWidget: () => d,
                supportTouch: () => p
            });
            var e = s(167175);
            const n = window.TradingView = window.TradingView || {};

            function h() {
                return e.isMac
            }

            function r() {
                return e.isWindows
            }

            function o() {
                return e.isLinux
            }

            function l() {
                return /TVDesktop/i.test(navigator.userAgent)
            }

            function a() {
                return n.isSymphony || !1
            }

            function u() {
                const t = navigator.userAgent.match(/TVDesktop\/([^\s]+)/);
                return t && t[1]
            }

            function c() {
                const t = navigator.userAgent.match(/TradingView\/([^\s]+)/);
                return t && t[1]
            }
            const f = {
                Android: () => e.isAndroid,
                BlackBerry: () => e.isBlackBerry,
                iOS: () => e.isIOS,
                Opera: () => e.isOperaMini,
                isIPad: () => e.isIPad,
                any: () => e.isAnyMobile
            };

            function d() {
                const t = ["^widgetembed/?$", "^cmewidgetembed/?$", "^([0-9a-zA-Z-]+)/widgetembed/?$", "^([0-9a-zA-Z-]+)/widgetstatic/?$", "^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$", "^twitter-chart/?$", "^embed/([0-9a-zA-Z]{8})/?$", "^widgetpopup/?$", "^extension/?$", "^idea-popup/?$", "^hotlistswidgetembed/?$", "^([0-9a-zA-Z-]+)/hotlistswidgetembed/?$", "^marketoverviewwidgetembed/?$", "^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$", "^eventswidgetembed/?$", "^tickerswidgetembed/?$", "^forexcrossrateswidgetembed/?$", "^forexheatmapwidgetembed/?$", "^marketquoteswidgetembed/?$", "^screenerwidget/?$", "^cryptomktscreenerwidget/?$", "^([0-9a-zA-Z-]+)/cryptomktscreenerwidget/?$", "^([0-9a-zA-Z-]+)/marketquoteswidgetembed/?$", "^technical-analysis-widget-embed/$", "^singlequotewidgetembed/?$", "^([0-9a-zA-Z-]+)/singlequotewidgetembed/?$", "^embed-widget/([0-9a-zA-Z-]+)/(([0-9a-zA-Z-]+)/)?$"],
                    i = window.location.pathname.replace(/^\//, "");
                let s;
                for (let e = t.length - 1; e >= 0; e--)
                    if (s = new RegExp(t[e]), s.test(i)) return !0;
                return !1
            }

            function p() {
                return e.mobiletouch || e.touch || e.isAnyMobile
            }

            function m(t) {
                return new URLSearchParams(window.location.search).get("page_type") === t
            }
            n.isMobile = f, n.onWidget = d;
            const v = e.isChrome,
                b = e.isFF,
                g = e.isEdge,
                w = e.isSafari;

            function y() {
                return "/pricing/" === window.location.pathname
            }

            function M() {
                return "/" === window.location.pathname
            }
        },
        39654: (t, i, s) => {
            "use strict";
            s.d(i, {
                getIsoLanguageCodeFromLanguage: () => n
            });
            const e = {
                ar_AE: "ar",
                br: "pt",
                de_DE: "de",
                ca_ES: "ca",
                he_IL: "he",
                id_ID: "id",
                in: "en",
                kr: "ko",
                ms_MY: "ms",
                sv_SE: "sv",
                th_TH: "th",
                uk: "en",
                vi_VN: "vi",
                zh_CN: "zh-Hans",
                zh_TW: "zh-Hant",
                zh: "zh-Hans",
                hu_HU: "hu-HU"
            };

            function n(t) {
                return e[t] || t
            }
        },
        124829: function(t, i, s) {
            t = s.nmd(t);
            const {
                clone: e,
                merge: n
            } = s(440837);
            var h, r = Array.isArray || function(t) {
                    return "[object Array]" === Object.prototype.toString.call(t)
                },
                o = function(t) {
                    return "object" == typeof t && null !== t
                };

            function l(t) {
                return "number" == typeof t && isFinite(t)
            }

            function a(t) {
                return null != t && (t.constructor === Function || "[object Function]" === Object.prototype.toString.call(t))
            }

            function u(t, i) {
                t.prototype = Object.create(i.prototype, {
                    constructor: {
                        value: t,
                        enumerable: !1,
                        writable: !0,
                        configurable: !0
                    }
                })
            }
            "undefined" != typeof window ? (h = window.TradingView = window.TradingView || {}, window.isNumber = l, window.isFunction = a, window.inherit = u, window.isArray = r) : h = this.TradingView = this.TradingView || {}, h.isNaN = function(t) {
                    return !(t <= 0 || t > 0)
                }, h.isAbsent = function(t) {
                    return null == t
                }, h.isExistent = function(t) {
                    return null != t
                }, Number.isNaN = Number.isNaN || function(t) {
                    return t != t
                }, h.isSameType = function(t, i) {
                    return Number.isNaN(t) || Number.isNaN(i) ? Number.isNaN(t) === Number.isNaN(i) : {}.toString.call(t) === {}.toString.call(i)
                }, h.isInteger = function(t) {
                    return "number" == typeof t && t % 1 == 0
                }, h.isString = function(t) {
                    return null != t && t.constructor === String
                }, h.isInherited = function(t, i) {
                    if (null == t || null == t.prototype) throw new TypeError("isInherited: child should be a constructor function");
                    if (null == i || null == i.prototype) throw new TypeError("isInherited: parent should be a constructor function");
                    return t.prototype instanceof i || t.prototype === i.prototype
                }, h.clone = e,
                h.deepEquals = function(t, i, s) {
                    if (s || (s = ""), t === i) return [!0, s];
                    if (a(t) && (t = void 0), a(i) && (i = void 0), void 0 === t && void 0 !== i) return [!1, s];
                    if (void 0 === i && void 0 !== t) return [!1, s];
                    if (null === t && null !== i) return [!1, s];
                    if (null === i && null !== t) return [!1, s];
                    if ("object" != typeof t && "object" != typeof i) return [t === i, s];
                    if (Array.isArray(t) && Array.isArray(i)) {
                        var e = t.length;
                        if (e !== i.length) return [!1, s];
                        for (var n = 0; n < e; n++) {
                            if (!(l = h.deepEquals(t[n], i[n], s + "[" + n + "]"))[0]) return l
                        }
                        return [!0, s]
                    }
                    if (r(t) || r(i)) return [!1, s];
                    if (Object.keys(t).length !== Object.keys(i).length) return [!1, s];
                    for (var o in t) {
                        var l;
                        if (!(l = h.deepEquals(t[o], i[o], s + "[" + o + "]"))[0]) return l
                    }
                    return [!0, s]
                }, h.merge = n, t && t.exports && (t.exports = {
                    inherit: u,
                    clone: h.clone,
                    merge: h.merge,
                    isNumber: l,
                    isInteger: h.isInteger,
                    isString: h.isString,
                    isObject: o,
                    isHashObject: function(t) {
                        return o(t) && -1 !== t.constructor.toString().indexOf("function Object")
                    },
                    isPromise: function(t) {
                        return o(t) && t.then
                    },
                    isNaN: h.isNaN,
                    isAbsent: h.isAbsent,
                    isExistent: h.isExistent,
                    isSameType: h.isSameType,
                    isArray: r,
                    isFunction: a,
                    parseBool: h.parseBool,
                    deepEquals: h.deepEquals,
                    notNull: function(t) {
                        return null !== t
                    },
                    notUndefined: function(t) {
                        return void 0 !== t
                    },
                    isEven: function(t) {
                        return t % 2 == 0
                    },
                    declareClassAsPureInterface: function(t, i) {
                        for (var s in t.prototype) "function" == typeof t.prototype[s] && t.prototype.hasOwnProperty(s) && (t.prototype[s] = function() {
                            throw new Error(i + "::" + s + " is an interface member declaration and must be overloaded in order to be called")
                        })
                    },
                    requireFullInterfaceImplementation: function(t, i, s, e) {
                        for (var n in s.prototype)
                            if ("function" == typeof s.prototype[n] && !t.prototype[n]) throw new Error("Interface implementation assertion failed: " + i + " does not implement " + e + "::" + n + " function")
                    }
                })
        },
        751472: (t, i, s) => {
            "use strict";
            s.d(i, {
                tryCreateCanvasRenderingTarget2D: () => n
            });
            var e = function() {
                function t(t, i, s) {
                    if (0 === i.width || 0 === i.height) throw new TypeError("Rendering target could only be created on a media with positive width and height");
                    if (this._mediaSize = i, 0 === s.width || 0 === s.height) throw new TypeError("Rendering target could only be created using a bitmap with positive integer width and height");
                    this._bitmapSize = s, this._context = t
                }
                return t.prototype.useMediaCoordinateSpace = function(t) {
                    try {
                        return this._context.save(), this._context.setTransform(1, 0, 0, 1, 0, 0), this._context.scale(this._horizontalPixelRatio, this._verticalPixelRatio), t({
                            context: this._context,
                            mediaSize: this._mediaSize
                        })
                    } finally {
                        this._context.restore()
                    }
                }, t.prototype.useBitmapCoordinateSpace = function(t) {
                    try {
                        return this._context.save(), this._context.setTransform(1, 0, 0, 1, 0, 0), t({
                            context: this._context,
                            mediaSize: this._mediaSize,
                            bitmapSize: this._bitmapSize,
                            horizontalPixelRatio: this._horizontalPixelRatio,
                            verticalPixelRatio: this._verticalPixelRatio
                        })
                    } finally {
                        this._context.restore()
                    }
                }, Object.defineProperty(t.prototype, "_horizontalPixelRatio", {
                    get: function() {
                        return this._bitmapSize.width / this._mediaSize.width
                    },
                    enumerable: !1,
                    configurable: !0
                }), Object.defineProperty(t.prototype, "_verticalPixelRatio", {
                    get: function() {
                        return this._bitmapSize.height / this._mediaSize.height
                    },
                    enumerable: !1,
                    configurable: !0
                }), t
            }();

            function n(t, i) {
                var s = t.canvasElementClientSize;
                if (0 === s.width || 0 === s.height) return null;
                var n = t.bitmapSize;
                if (0 === n.width || 0 === n.height) return null;
                var h = t.canvasElement.getContext("2d", i);
                return null === h ? null : new e(h, s, n)
            }
        },
        743068: (t, i, s) => {
            "use strict";
            s.d(i, {
                bindCanvasElementBitmapSizeTo: () => n.bindTo,
                equalSizes: () => e.equalSizes,
                size: () => e.size,
                tryCreateCanvasRenderingTarget2D: () => h.tryCreateCanvasRenderingTarget2D
            });
            var e = s(341161),
                n = s(603678),
                h = s(751472)
        },
        431057: (t, i, s) => {
            "use strict";
            s.d(i, {
                ColorType: () => Ts,
                CrosshairMode: () => lt,
                LineStyle: () => d,
                PriceScaleMode: () => fs,
                TickMarkType: () => Es,
                createChartEx: () => yn,
                defaultHorzScaleBehavior: () => Mn
            });
            var e = s(743068);
            const n = {
                    upColor: "#26a69a",
                    downColor: "#ef5350",
                    wickVisible: !0,
                    borderVisible: !0,
                    borderColor: "#378658",
                    borderUpColor: "#26a69a",
                    borderDownColor: "#ef5350",
                    wickColor: "#737375",
                    wickUpColor: "#26a69a",
                    wickDownColor: "#ef5350"
                },
                h = {
                    upColor: "#26a69a",
                    downColor: "#ef5350",
                    openVisible: !0,
                    thinBars: !0
                },
                r = {
                    color: "#2196f3",
                    lineStyle: 0,
                    lineWidth: 3,
                    lineType: 0,
                    lineVisible: !0,
                    crosshairMarkerVisible: !0,
                    crosshairMarkerRadius: 4,
                    crosshairMarkerBorderColor: "",
                    crosshairMarkerBorderWidth: 2,
                    crosshairMarkerBackgroundColor: "",
                    lastPriceAnimation: 0,
                    pointMarkersVisible: !1
                },
                o = {
                    topColor: "rgba( 46, 220, 135, 0.4)",
                    bottomColor: "rgba( 40, 221, 100, 0)",
                    invertFilledArea: !1,
                    lineColor: "#33D778",
                    lineStyle: 0,
                    lineWidth: 3,
                    lineType: 0,
                    lineVisible: !0,
                    crosshairMarkerVisible: !0,
                    crosshairMarkerRadius: 4,
                    crosshairMarkerBorderColor: "",
                    crosshairMarkerBorderWidth: 2,
                    crosshairMarkerBackgroundColor: "",
                    lastPriceAnimation: 0,
                    pointMarkersVisible: !1
                },
                l = {
                    baseValue: {
                        type: "price",
                        price: 0
                    },
                    topFillColor1: "rgba(38, 166, 154, 0.28)",
                    topFillColor2: "rgba(38, 166, 154, 0.05)",
                    topLineColor: "rgba(38, 166, 154, 1)",
                    bottomFillColor1: "rgba(239, 83, 80, 0.05)",
                    bottomFillColor2: "rgba(239, 83, 80, 0.28)",
                    bottomLineColor: "rgba(239, 83, 80, 1)",
                    lineWidth: 3,
                    lineStyle: 0,
                    lineType: 0,
                    lineVisible: !0,
                    crosshairMarkerVisible: !0,
                    crosshairMarkerRadius: 4,
                    crosshairMarkerBorderColor: "",
                    crosshairMarkerBorderWidth: 2,
                    crosshairMarkerBackgroundColor: "",
                    lastPriceAnimation: 0,
                    pointMarkersVisible: !1
                },
                a = {
                    color: "#26a69a",
                    base: 0
                },
                u = {
                    color: "#2196f3"
                },
                c = {
                    title: "",
                    visible: !0,
                    lastValueVisible: !0,
                    priceLineVisible: !0,
                    priceLineSource: 0,
                    priceLineWidth: 1,
                    priceLineColor: "",
                    priceLineStyle: 2,
                    baseLineVisible: !0,
                    baseLineWidth: 1,
                    baseLineColor: "#B2B5BE",
                    baseLineStyle: 0,
                    priceFormat: {
                        type: "price",
                        precision: 2,
                        minMove: .01
                    }
                };
            var f, d, p;

            function m(t, i) {
                const s = {
                    0: [],
                    1: [t.lineWidth, t.lineWidth],
                    2: [2 * t.lineWidth, 2 * t.lineWidth],
                    3: [6 * t.lineWidth, 6 * t.lineWidth],
                    4: [t.lineWidth, 4 * t.lineWidth]
                }[i];
                t.setLineDash(s)
            }

            function v(t, i, s, e) {
                t.beginPath();
                const n = t.lineWidth % 2 ? .5 : 0;
                t.moveTo(s, i + n), t.lineTo(e, i + n), t.stroke()
            }

            function b(t, i) {
                if (!t) throw new Error("Assertion failed" + (i ? ": " + i : ""))
            }

            function g(t) {
                if (void 0 === t) throw new Error("Value is undefined");
                return t
            }

            function w(t) {
                if (null === t) throw new Error("Value is null");
                return t
            }

            function y(t) {
                return w(g(t))
            }(p = f || (f = {}))[p.Simple = 0] = "Simple", p[p.WithSteps = 1] = "WithSteps", p[p.Curved = 2] = "Curved",
                function(t) {
                    t[t.Solid = 0] = "Solid", t[t.Dotted = 1] = "Dotted", t[t.Dashed = 2] = "Dashed", t[t.LargeDashed = 3] = "LargeDashed", t[t.SparseDotted = 4] = "SparseDotted"
                }(d || (d = {}));
            const M = {
                khaki: "#f0e68c",
                azure: "#f0ffff",
                aliceblue: "#f0f8ff",
                ghostwhite: "#f8f8ff",
                gold: "#ffd700",
                goldenrod: "#daa520",
                gainsboro: "#dcdcdc",
                gray: "#808080",
                green: "#008000",
                honeydew: "#f0fff0",
                floralwhite: "#fffaf0",
                lightblue: "#add8e6",
                lightcoral: "#f08080",
                lemonchiffon: "#fffacd",
                hotpink: "#ff69b4",
                lightyellow: "#ffffe0",
                greenyellow: "#adff2f",
                lightgoldenrodyellow: "#fafad2",
                limegreen: "#32cd32",
                linen: "#faf0e6",
                lightcyan: "#e0ffff",
                magenta: "#f0f",
                maroon: "#800000",
                olive: "#808000",
                orange: "#ffa500",
                oldlace: "#fdf5e6",
                mediumblue: "#0000cd",
                transparent: "#0000",
                lime: "#0f0",
                lightpink: "#ffb6c1",
                mistyrose: "#ffe4e1",
                moccasin: "#ffe4b5",
                midnightblue: "#191970",
                orchid: "#da70d6",
                mediumorchid: "#ba55d3",
                mediumturquoise: "#48d1cc",
                orangered: "#ff4500",
                royalblue: "#4169e1",
                powderblue: "#b0e0e6",
                red: "#f00",
                coral: "#ff7f50",
                turquoise: "#40e0d0",
                white: "#fff",
                whitesmoke: "#f5f5f5",
                wheat: "#f5deb3",
                teal: "#008080",
                steelblue: "#4682b4",
                bisque: "#ffe4c4",
                aquamarine: "#7fffd4",
                aqua: "#0ff",
                sienna: "#a0522d",
                silver: "#c0c0c0",
                springgreen: "#00ff7f",
                antiquewhite: "#faebd7",
                burlywood: "#deb887",
                brown: "#a52a2a",
                beige: "#f5f5dc",
                chocolate: "#d2691e",
                chartreuse: "#7fff00",
                cornflowerblue: "#6495ed",
                cornsilk: "#fff8dc",
                crimson: "#dc143c",
                cadetblue: "#5f9ea0",
                tomato: "#ff6347",
                fuchsia: "#f0f",
                blue: "#00f",
                salmon: "#fa8072",
                blanchedalmond: "#ffebcd",
                slateblue: "#6a5acd",
                slategray: "#708090",
                thistle: "#d8bfd8",
                tan: "#d2b48c",
                cyan: "#0ff",
                darkblue: "#00008b",
                darkcyan: "#008b8b",
                darkgoldenrod: "#b8860b",
                darkgray: "#a9a9a9",
                blueviolet: "#8a2be2",
                black: "#000",
                darkmagenta: "#8b008b",
                darkslateblue: "#483d8b",
                darkkhaki: "#bdb76b",
                darkorchid: "#9932cc",
                darkorange: "#ff8c00",
                darkgreen: "#006400",
                darkred: "#8b0000",
                dodgerblue: "#1e90ff",
                darkslategray: "#2f4f4f",
                dimgray: "#696969",
                deepskyblue: "#00bfff",
                firebrick: "#b22222",
                forestgreen: "#228b22",
                indigo: "#4b0082",
                ivory: "#fffff0",
                lavenderblush: "#fff0f5",
                feldspar: "#d19275",
                indianred: "#cd5c5c",
                lightgreen: "#90ee90",
                lightgrey: "#d3d3d3",
                lightskyblue: "#87cefa",
                lightslategray: "#789",
                lightslateblue: "#8470ff",
                snow: "#fffafa",
                lightseagreen: "#20b2aa",
                lightsalmon: "#ffa07a",
                darksalmon: "#e9967a",
                darkviolet: "#9400d3",
                mediumpurple: "#9370d8",
                mediumaquamarine: "#66cdaa",
                skyblue: "#87ceeb",
                lavender: "#e6e6fa",
                lightsteelblue: "#b0c4de",
                mediumvioletred: "#c71585",
                mintcream: "#f5fffa",
                navajowhite: "#ffdead",
                navy: "#000080",
                olivedrab: "#6b8e23",
                palevioletred: "#d87093",
                violetred: "#d02090",
                yellow: "#ff0",
                yellowgreen: "#9acd32",
                lawngreen: "#7cfc00",
                pink: "#ffc0cb",
                paleturquoise: "#afeeee",
                palegoldenrod: "#eee8aa",
                darkolivegreen: "#556b2f",
                darkseagreen: "#8fbc8f",
                darkturquoise: "#00ced1",
                peachpuff: "#ffdab9",
                deeppink: "#ff1493",
                violet: "#ee82ee",
                palegreen: "#98fb98",
                mediumseagreen: "#3cb371",
                peru: "#cd853f",
                saddlebrown: "#8b4513",
                sandybrown: "#f4a460",
                rosybrown: "#bc8f8f",
                purple: "#800080",
                seagreen: "#2e8b57",
                seashell: "#fff5ee",
                papayawhip: "#ffefd5",
                mediumslateblue: "#7b68ee",
                plum: "#dda0dd",
                mediumspringgreen: "#00fa9a"
            };

            function S(t) {
                return t < 0 ? 0 : t > 255 ? 255 : Math.round(t) || 0
            }

            function C(t) {
                return t <= 0 || t > 1 ? Math.min(Math.max(t, 0), 1) : Math.round(1e4 * t) / 1e4
            }
            const x = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,
                z = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,
                k = /^rgb\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*\)$/,
                _ = /^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d*\.?\d+)\s*\)$/;

            function L(t) {
                (t = t.toLowerCase()) in M && (t = M[t]); {
                    const i = _.exec(t) || k.exec(t);
                    if (i) return [S(parseInt(i[1], 10)), S(parseInt(i[2], 10)), S(parseInt(i[3], 10)), C(i.length < 5 ? 1 : parseFloat(i[4]))]
                } {
                    const i = z.exec(t);
                    if (i) return [S(parseInt(i[1], 16)), S(parseInt(i[2], 16)), S(parseInt(i[3], 16)), 1]
                } {
                    const i = x.exec(t);
                    if (i) return [S(17 * parseInt(i[1], 16)), S(17 * parseInt(i[2], 16)), S(17 * parseInt(i[3], 16)), 1]
                }
                throw new Error(`Cannot parse color: ${t}`)
            }

            function O(t) {
                const i = L(t);
                return {
                    t: `rgb(${i[0]}, ${i[1]}, ${i[2]})`,
                    i: (s = i, .199 * s[0] + .687 * s[1] + .114 * s[2] > 160 ? "black" : "white")
                };
                var s
            }
            class T {
                constructor() {
                    this.h = []
                }
                l(t, i, s) {
                    const e = {
                        o: t,
                        _: i,
                        u: !0 === s
                    };
                    this.h.push(e)
                }
                v(t) {
                    const i = this.h.findIndex((i => t === i.o));
                    i > -1 && this.h.splice(i, 1)
                }
                p(t) {
                    this.h = this.h.filter((i => i._ !== t))
                }
                m(t, i, s) {
                    const e = [...this.h];
                    this.h = this.h.filter((t => !t.u)), e.forEach((e => e.o(t, i, s)))
                }
                M() {
                    return this.h.length > 0
                }
                S() {
                    this.h = []
                }
            }

            function E(t, ...i) {
                for (const s of i)
                    for (const i in s) void 0 !== s[i] && ("object" != typeof s[i] || void 0 === t[i] || Array.isArray(s[i]) ? t[i] = s[i] : E(t[i], s[i]));
                return t
            }

            function N(t) {
                return "number" == typeof t && isFinite(t)
            }

            function $(t) {
                return "number" == typeof t && t % 1 == 0
            }

            function W(t) {
                return "string" == typeof t
            }

            function P(t) {
                return "boolean" == typeof t
            }

            function R(t) {
                const i = t;
                if (!i || "object" != typeof i) return i;
                let s, e, n;
                for (e in s = Array.isArray(i) ? [] : {}, i) i.hasOwnProperty(e) && (n = i[e], s[e] = n && "object" == typeof n ? R(n) : n);
                return s
            }

            function D(t) {
                return null !== t
            }

            function F(t) {
                return null === t ? void 0 : t
            }
            const I = "-apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif";

            function A(t, i, s) {
                return void 0 === i && (i = I), `${s=void 0!==s?`${s} `:""}${t}px ${i}`
            }
            class V {
                constructor(t) {
                    this.k = {
                        C: 1,
                        T: 5,
                        P: NaN,
                        R: "",
                        D: "",
                        O: "",
                        A: "",
                        B: 0,
                        V: 0,
                        I: 0,
                        L: 0,
                        N: 0
                    }, this.F = t
                }
                W() {
                    const t = this.k,
                        i = this.j(),
                        s = this.H();
                    return t.P === i && t.D === s || (t.P = i, t.D = s, t.R = A(i, s), t.L = 2.5 / 12 * i, t.B = t.L, t.V = i / 12 * t.T, t.I = i / 12 * t.T, t.N = 0), t.O = this.$(), t.A = this.U(), this.k
                }
                $() {
                    return this.F.W().layout.textColor
                }
                U() {
                    return this.F.q()
                }
                j() {
                    return this.F.W().layout.fontSize
                }
                H() {
                    return this.F.W().layout.fontFamily
                }
            }
            class B {
                constructor() {
                    this.Y = []
                }
                X(t) {
                    this.Y = t
                }
                K(t, i, s) {
                    this.Y.forEach((e => {
                        e.K(t, i, s)
                    }))
                }
            }
            class j {
                K(t, i, s) {
                    t.useBitmapCoordinateSpace((t => this.Z(t, i, s)))
                }
            }
            class U extends j {
                constructor() {
                    super(...arguments), this.G = null
                }
                J(t) {
                    this.G = t
                }
                Z({
                    context: t,
                    horizontalPixelRatio: i,
                    verticalPixelRatio: s
                }) {
                    if (null === this.G || null === this.G.tt) return;
                    const e = this.G.tt,
                        n = this.G,
                        h = Math.max(1, Math.floor(i)) % 2 / 2,
                        r = r => {
                            t.beginPath();
                            for (let o = e.to - 1; o >= e.from; --o) {
                                const e = n.it[o],
                                    l = Math.round(e.nt * i) + h,
                                    a = e.st * s,
                                    u = r * s + h;
                                t.moveTo(l, a), t.arc(l, a, u, 0, 2 * Math.PI)
                            }
                            t.fill()
                        };
                    n.et > 0 && (t.fillStyle = n.rt, r(n.ht + n.et)), t.fillStyle = n.lt, r(n.ht)
                }
            }

            function Z() {
                return {
                    it: [{
                        nt: 0,
                        st: 0,
                        ot: 0,
                        _t: 0
                    }],
                    lt: "",
                    rt: "",
                    ht: 0,
                    et: 0,
                    tt: null
                }
            }
            const J = {
                from: 0,
                to: 1
            };
            class H {
                constructor(t, i) {
                    this.ut = new B, this.ct = [], this.dt = [], this.ft = !0, this.F = t, this.vt = i, this.ut.X(this.ct)
                }
                bt(t) {
                    const i = this.F.wt();
                    i.length !== this.ct.length && (this.dt = i.map(Z), this.ct = this.dt.map((t => {
                        const i = new U;
                        return i.J(t), i
                    })), this.ut.X(this.ct)), this.ft = !0
                }
                gt() {
                    return this.ft && (this.Mt(), this.ft = !1), this.ut
                }
                Mt() {
                    const t = 2 === this.vt.W().mode,
                        i = this.F.wt(),
                        s = this.vt.xt(),
                        e = this.F.St();
                    i.forEach(((i, n) => {
                        var h;
                        const r = this.dt[n],
                            o = i.kt(s);
                        if (t || null === o || !i.yt()) return void(r.tt = null);
                        const l = w(i.Ct());
                        r.lt = o.Tt, r.ht = o.ht, r.et = o.Pt, r.it[0]._t = o._t, r.it[0].st = i.Dt().Rt(o._t, l.Ot), r.rt = null !== (h = o.At) && void 0 !== h ? h : this.F.Bt(r.it[0].st / i.Dt().Vt()), r.it[0].ot = s, r.it[0].nt = e.It(s), r.tt = J
                    }))
                }
            }
            class K extends j {
                constructor(t) {
                    super(), this.zt = t
                }
                Z({
                    context: t,
                    bitmapSize: i,
                    horizontalPixelRatio: s,
                    verticalPixelRatio: e
                }) {
                    if (null === this.zt) return;
                    const n = this.zt.Lt.yt,
                        h = this.zt.Et.yt;
                    if (!n && !h) return;
                    const r = Math.round(this.zt.nt * s),
                        o = Math.round(this.zt.st * e);
                    t.lineCap = "butt", n && r >= 0 && (t.lineWidth = Math.floor(this.zt.Lt.et * s), t.strokeStyle = this.zt.Lt.O, t.fillStyle = this.zt.Lt.O, m(t, this.zt.Lt.Nt), function(t, i, s, e) {
                        t.beginPath();
                        const n = t.lineWidth % 2 ? .5 : 0;
                        t.moveTo(i + n, 0), t.lineTo(i + n, e), t.stroke()
                    }(t, r, 0, i.height)), h && o >= 0 && (t.lineWidth = Math.floor(this.zt.Et.et * e), t.strokeStyle = this.zt.Et.O, t.fillStyle = this.zt.Et.O, m(t, this.zt.Et.Nt), v(t, o, 0, i.width))
                }
            }
            class G {
                constructor(t) {
                    this.ft = !0, this.Ft = {
                        Lt: {
                            et: 1,
                            Nt: 0,
                            O: "",
                            yt: !1
                        },
                        Et: {
                            et: 1,
                            Nt: 0,
                            O: "",
                            yt: !1
                        },
                        nt: 0,
                        st: 0
                    }, this.Wt = new K(this.Ft), this.jt = t
                }
                bt() {
                    this.ft = !0
                }
                gt() {
                    return this.ft && (this.Mt(), this.ft = !1), this.Wt
                }
                Mt() {
                    const t = this.jt.yt(),
                        i = w(this.jt.Ht()),
                        s = i.$t().W().crosshair,
                        e = this.Ft;
                    if (2 === s.mode) return e.Et.yt = !1, void(e.Lt.yt = !1);
                    e.Et.yt = t && this.jt.Ut(i), e.Lt.yt = t && this.jt.qt(), e.Et.et = s.horzLine.width, e.Et.Nt = s.horzLine.style, e.Et.O = s.horzLine.color, e.Lt.et = s.vertLine.width, e.Lt.Nt = s.vertLine.style, e.Lt.O = s.vertLine.color, e.nt = this.jt.Yt(), e.st = this.jt.Xt()
                }
            }

            function X(t, i, s, e, n, h) {
                t.fillRect(i + h, s, e - 2 * h, h), t.fillRect(i + h, s + n - h, e - 2 * h, h), t.fillRect(i, s, h, n), t.fillRect(i + e - h, s, h, n)
            }

            function Y(t, i, s, e, n, h) {
                t.save(), t.globalCompositeOperation = "copy", t.fillStyle = h, t.fillRect(i, s, e, n), t.restore()
            }

            function q(t, i, s, e, n, h) {
                t.beginPath(), t.roundRect ? t.roundRect(i, s, e, n, h) : (t.lineTo(i + e - h[1], s), 0 !== h[1] && t.arcTo(i + e, s, i + e, s + h[1], h[1]), t.lineTo(i + e, s + n - h[2]), 0 !== h[2] && t.arcTo(i + e, s + n, i + e - h[2], s + n, h[2]), t.lineTo(i + h[3], s + n), 0 !== h[3] && t.arcTo(i, s + n, i, s + n - h[3], h[3]), t.lineTo(i, s + h[0]), 0 !== h[0] && t.arcTo(i, s, i + h[0], s, h[0]))
            }

            function Q(t, i, s, e, n, h, r = 0, o = [0, 0, 0, 0], l = "") {
                if (t.save(), !r || !l || l === h) return q(t, i, s, e, n, o), t.fillStyle = h, t.fill(), void t.restore();
                const a = r / 2;
                var u;
                q(t, i + a, s + a, e - r, n - r, (u = -a, o.map((t => 0 === t ? t : t + u)))), "transparent" !== h && (t.fillStyle = h, t.fill()), "transparent" !== l && (t.lineWidth = r, t.strokeStyle = l, t.closePath(), t.stroke()), t.restore()
            }

            function tt(t, i, s, e, n, h, r) {
                t.save(), t.globalCompositeOperation = "copy";
                const o = t.createLinearGradient(0, 0, 0, n);
                o.addColorStop(0, h), o.addColorStop(1, r), t.fillStyle = o, t.fillRect(i, s, e, n),
                    t.restore()
            }
            class it {
                constructor(t, i) {
                    this.J(t, i)
                }
                J(t, i) {
                    this.zt = t, this.Kt = i
                }
                Vt(t, i) {
                    return this.zt.yt ? t.P + t.L + t.B : 0
                }
                K(t, i, s, e) {
                    if (!this.zt.yt || 0 === this.zt.Zt.length) return;
                    const n = this.zt.O,
                        h = this.Kt.t,
                        r = t.useBitmapCoordinateSpace((t => {
                            const r = t.context;
                            r.font = i.R;
                            const o = this.Gt(t, i, s, e),
                                l = o.Jt,
                                a = (t, i) => {
                                    o.Qt ? Q(r, l.ti, l.ii, l.ni, l.si, t, l.ei, [l.ht, 0, 0, l.ht], i) : Q(r, l.ri, l.ii, l.ni, l.si, t, l.ei, [0, l.ht, l.ht, 0], i)
                                };
                            return a(h, "transparent"), this.zt.hi && (r.fillStyle = n, r.fillRect(l.ri, l.li, l.ai - l.ri, l.oi)), a("transparent", h), this.zt._i && (r.fillStyle = i.A, r.fillRect(o.Qt ? l.ui - l.ei : 0, l.ii, l.ei, l.ci - l.ii)), o
                        }));
                    t.useMediaCoordinateSpace((({
                        context: t
                    }) => {
                        const s = r.di;
                        t.font = i.R, t.textAlign = r.Qt ? "right" : "left", t.textBaseline = "middle", t.fillStyle = n, t.fillText(this.zt.Zt, s.fi, (s.ii + s.ci) / 2 + s.pi)
                    }))
                }
                Gt(t, i, s, e) {
                    var n;
                    const {
                        context: h,
                        bitmapSize: r,
                        mediaSize: o,
                        horizontalPixelRatio: l,
                        verticalPixelRatio: a
                    } = t, u = this.zt.hi || !this.zt.mi ? i.T : 0, c = this.zt.bi ? i.C : 0, f = i.L + this.Kt.wi, d = i.B + this.Kt.gi, p = i.V, m = i.I, v = this.zt.Zt, b = i.P, g = s.Mi(h, v), w = Math.ceil(s.xi(h, v)), y = b + f + d, M = i.C + p + m + w + u, S = Math.max(1, Math.floor(a));
                    let C = Math.round(y * a);
                    C % 2 != S % 2 && (C += 1);
                    const x = c > 0 ? Math.max(1, Math.floor(c * l)) : 0,
                        z = Math.round(M * l),
                        k = Math.round(u * l),
                        _ = null !== (n = this.Kt.Si) && void 0 !== n ? n : this.Kt.ki,
                        L = Math.round(_ * a) - Math.floor(.5 * a),
                        O = Math.floor(L + S / 2 - C / 2),
                        T = O + C,
                        E = "right" === e,
                        N = E ? o.width - c : c,
                        $ = E ? r.width - x : x;
                    let W, P, R;
                    return E ? (W = $ - z, P = $ - k, R = N - u - p - c) : (W = $ + z, P = $ + k, R = N + u + p), {
                        Qt: E,
                        Jt: {
                            ii: O,
                            li: L,
                            ci: T,
                            ni: z,
                            si: C,
                            ht: 2 * l,
                            ei: x,
                            ti: W,
                            ri: $,
                            ai: P,
                            oi: S,
                            ui: r.width
                        },
                        di: {
                            ii: O / a,
                            ci: T / a,
                            fi: R,
                            pi: g
                        }
                    }
                }
            }
            class st {
                constructor(t) {
                    this.yi = {
                        ki: 0,
                        t: "#000",
                        gi: 0,
                        wi: 0
                    }, this.Ci = {
                        Zt: "",
                        yt: !1,
                        hi: !0,
                        mi: !1,
                        At: "",
                        O: "#FFF",
                        _i: !1,
                        bi: !1
                    }, this.Ti = {
                        Zt: "",
                        yt: !1,
                        hi: !1,
                        mi: !0,
                        At: "",
                        O: "#FFF",
                        _i: !0,
                        bi: !0
                    }, this.ft = !0, this.Pi = new(t || it)(this.Ci, this.yi), this.Ri = new(t || it)(this.Ti, this.yi)
                }
                Zt() {
                    return this.Di(), this.Ci.Zt
                }
                ki() {
                    return this.Di(), this.yi.ki
                }
                bt() {
                    this.ft = !0
                }
                Vt(t, i = !1) {
                    return Math.max(this.Pi.Vt(t, i), this.Ri.Vt(t, i))
                }
                Oi() {
                    return this.yi.Si || 0
                }
                Ai(t) {
                    this.yi.Si = t
                }
                Bi() {
                    return this.Di(), this.Ci.yt || this.Ti.yt
                }
                Vi() {
                    return this.Di(), this.Ci.yt
                }
                gt(t) {
                    return this.Di(), this.Ci.hi = this.Ci.hi && t.W().ticksVisible, this.Ti.hi = this.Ti.hi && t.W().ticksVisible, this.Pi.J(this.Ci, this.yi), this.Ri.J(this.Ti, this.yi), this.Pi
                }
                Ii() {
                    return this.Di(), this.Pi.J(this.Ci, this.yi), this.Ri.J(this.Ti, this.yi), this.Ri
                }
                Di() {
                    this.ft && (this.Ci.hi = !0, this.Ti.hi = !1, this.zi(this.Ci, this.Ti, this.yi))
                }
            }
            class et extends st {
                constructor(t, i, s) {
                    super(), this.jt = t, this.Li = i, this.Ei = s
                }
                zi(t, i, s) {
                    if (t.yt = !1, 2 === this.jt.W().mode) return;
                    const e = this.jt.W().horzLine;
                    if (!e.labelVisible) return;
                    const n = this.Li.Ct();
                    if (!this.jt.yt() || this.Li.Ni() || null === n) return;
                    const h = O(e.labelBackgroundColor);
                    s.t = h.t, t.O = h.i;
                    const r = 2 / 12 * this.Li.P();
                    s.wi = r, s.gi = r;
                    const o = this.Ei(this.Li);
                    s.ki = o.ki, t.Zt = this.Li.Fi(o._t, n), t.yt = !0
                }
            }
            const nt = /[1-9]/g;
            class ht {
                constructor() {
                    this.zt = null
                }
                J(t) {
                    this.zt = t
                }
                K(t, i) {
                    if (null === this.zt || !1 === this.zt.yt || 0 === this.zt.Zt.length) return;
                    const s = t.useMediaCoordinateSpace((({
                        context: t
                    }) => (t.font = i.R, Math.round(i.Wi.xi(t, w(this.zt).Zt, nt)))));
                    if (s <= 0) return;
                    const e = i.ji,
                        n = s + 2 * e,
                        h = n / 2,
                        r = this.zt.Hi;
                    let o = this.zt.ki,
                        l = Math.floor(o - h) + .5;
                    l < 0 ? (o += Math.abs(0 - l), l = Math.floor(o - h) + .5) : l + n > r && (o -= Math.abs(r - (l + n)), l = Math.floor(o - h) + .5);
                    const a = l + n,
                        u = Math.ceil(0 + i.C + i.T + i.L + i.P + i.B);
                    t.useBitmapCoordinateSpace((({
                        context: t,
                        horizontalPixelRatio: s,
                        verticalPixelRatio: e
                    }) => {
                        const n = w(this.zt);
                        t.fillStyle = n.t;
                        const h = Math.round(l * s),
                            r = Math.round(0 * e),
                            o = Math.round(a * s),
                            c = Math.round(u * e),
                            f = Math.round(2 * s);
                        if (t.beginPath(), t.moveTo(h, r), t.lineTo(h, c - f), t.arcTo(h, c, h + f, c, f), t.lineTo(o - f, c), t.arcTo(o, c, o, c - f, f), t.lineTo(o, r), t.fill(), n.hi) {
                            const h = Math.round(n.ki * s),
                                o = r,
                                l = Math.round((o + i.T) * e);
                            t.fillStyle = n.O;
                            const a = Math.max(1, Math.floor(s)),
                                u = Math.floor(.5 * s);
                            t.fillRect(h - u, o, a, l - o)
                        }
                    })), t.useMediaCoordinateSpace((({
                        context: t
                    }) => {
                        const s = w(this.zt),
                            n = 0 + i.C + i.T + i.L + i.P / 2;
                        t.font = i.R, t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = s.O;
                        const h = i.Wi.Mi(t, "Apr0");
                        t.translate(l + e, n + h), t.fillText(s.Zt, 0, 0)
                    }))
                }
            }
            class rt {
                constructor(t, i, s) {
                    this.ft = !0, this.Wt = new ht, this.Ft = {
                        yt: !1,
                        t: "#4c525e",
                        O: "white",
                        Zt: "",
                        Hi: 0,
                        ki: NaN,
                        hi: !0
                    }, this.vt = t, this.$i = i, this.Ei = s
                }
                bt() {
                    this.ft = !0
                }
                gt() {
                    return this.ft && (this.Mt(), this.ft = !1), this.Wt.J(this.Ft), this.Wt
                }
                Mt() {
                    const t = this.Ft;
                    if (t.yt = !1, 2 === this.vt.W().mode) return;
                    const i = this.vt.W().vertLine;
                    if (!i.labelVisible) return;
                    const s = this.$i.St();
                    if (s.Ni()) return;
                    t.Hi = s.Hi();
                    const e = this.Ei();
                    if (null === e) return;
                    t.ki = e.ki;
                    const n = s.Ui(this.vt.xt());
                    t.Zt = s.qi(w(n)), t.yt = !0;
                    const h = O(i.labelBackgroundColor);
                    t.t = h.t, t.O = h.i, t.hi = s.W().ticksVisible
                }
            }
            class ot {
                constructor() {
                    this.Yi = null, this.Xi = 0
                }
                Ki() {
                    return this.Xi
                }
                Zi(t) {
                    this.Xi = t
                }
                Dt() {
                    return this.Yi
                }
                Gi(t) {
                    this.Yi = t
                }
                Ji(t) {
                    return []
                }
                Qi() {
                    return []
                }
                yt() {
                    return !0
                }
            }
            var lt;
            ! function(t) {
                t[t.Normal = 0] = "Normal", t[t.Magnet = 1] = "Magnet", t[t.Hidden = 2] = "Hidden"
            }(lt || (lt = {}));
            class at extends ot {
                constructor(t, i) {
                    super(), this.tn = null, this.nn = NaN, this.sn = 0, this.en = !0, this.rn = new Map, this.hn = !1, this.ln = NaN, this.an = NaN, this._n = NaN, this.un = NaN, this.$i = t, this.cn = i, this.dn = new H(t, this), this.fn = ((t, i) => s => {
                        const e = i(),
                            n = t();
                        if (s === w(this.tn).vn()) return {
                            _t: n,
                            ki: e
                        }; {
                            const t = w(s.Ct());
                            return {
                                _t: s.pn(e, t),
                                ki: e
                            }
                        }
                    })((() => this.nn), (() => this.an));
                    const s = ((t, i) => () => {
                        const s = this.$i.St().mn(t()),
                            e = i();
                        return s && Number.isFinite(e) ? {
                            ot: s,
                            ki: e
                        } : null
                    })((() => this.sn), (() => this.Yt()));
                    this.bn = new rt(this, t, s), this.wn = new G(this)
                }
                W() {
                    return this.cn
                }
                gn(t, i) {
                    this._n = t, this.un = i
                }
                Mn() {
                    this._n = NaN, this.un = NaN
                }
                xn() {
                    return this._n
                }
                Sn() {
                    return this.un
                }
                kn(t, i, s) {
                    this.hn || (this.hn = !0), this.en = !0, this.yn(t, i, s)
                }
                xt() {
                    return this.sn
                }
                Yt() {
                    return this.ln
                }
                Xt() {
                    return this.an
                }
                yt() {
                    return this.en
                }
                Cn() {
                    this.en = !1, this.Tn(), this.nn = NaN, this.ln = NaN, this.an = NaN, this.tn = null, this.Mn()
                }
                Pn(t) {
                    return null !== this.tn ? [this.wn, this.dn] : []
                }
                Ut(t) {
                    return t === this.tn && this.cn.horzLine.visible
                }
                qt() {
                    return this.cn.vertLine.visible
                }
                Rn(t, i) {
                    this.en && this.tn === t || this.rn.clear();
                    const s = [];
                    return this.tn === t && s.push(this.Dn(this.rn, i, this.fn)), s
                }
                Qi() {
                    return this.en ? [this.bn] : []
                }
                Ht() {
                    return this.tn
                }
                On() {
                    this.wn.bt(), this.rn.forEach((t => t.bt())), this.bn.bt(), this.dn.bt()
                }
                An(t) {
                    return t && !t.vn().Ni() ? t.vn() : null
                }
                yn(t, i, s) {
                    this.Bn(t, i, s) && this.On()
                }
                Bn(t, i, s) {
                    const e = this.ln,
                        n = this.an,
                        h = this.nn,
                        r = this.sn,
                        o = this.tn,
                        l = this.An(s);
                    this.sn = t, this.ln = isNaN(t) ? NaN : this.$i.St().It(t), this.tn = s;
                    const a = null !== l ? l.Ct() : null;
                    return null !== l && null !== a ? (this.nn = i, this.an = l.Rt(i, a)) : (this.nn = NaN, this.an = NaN), e !== this.ln || n !== this.an || r !== this.sn || h !== this.nn || o !== this.tn
                }
                Tn() {
                    const t = this.$i.wt().map((t => t.In().Vn())).filter(D),
                        i = 0 === t.length ? null : Math.max(...t);
                    this.sn = null !== i ? i : NaN
                }
                Dn(t, i, s) {
                    let e = t.get(i);
                    return void 0 === e && (e = new et(this, i, s), t.set(i, e)), e
                }
            }

            function ut(t) {
                return "left" === t || "right" === t
            }
            class ct {
                constructor(t) {
                    this.zn = new Map, this.Ln = [], this.En = t
                }
                Nn(t, i) {
                    const s = function(t, i) {
                        return void 0 === t ? i : {
                            Fn: Math.max(t.Fn, i.Fn),
                            Wn: t.Wn || i.Wn
                        }
                    }(this.zn.get(t), i);
                    this.zn.set(t, s)
                }
                jn() {
                    return this.En
                }
                Hn(t) {
                    const i = this.zn.get(t);
                    return void 0 === i ? {
                        Fn: this.En
                    } : {
                        Fn: Math.max(this.En, i.Fn),
                        Wn: i.Wn
                    }
                }
                $n() {
                    this.Un(), this.Ln = [{
                        qn: 0
                    }]
                }
                Yn(t) {
                    this.Un(), this.Ln = [{
                        qn: 1,
                        Ot: t
                    }]
                }
                Xn(t) {
                    this.Kn(), this.Ln.push({
                        qn: 5,
                        Ot: t
                    })
                }
                Un() {
                    this.Kn(), this.Ln.push({
                        qn: 6
                    })
                }
                Zn() {
                    this.Un(), this.Ln = [{
                        qn: 4
                    }]
                }
                Gn(t) {
                    this.Un(), this.Ln.push({
                        qn: 2,
                        Ot: t
                    })
                }
                Jn(t) {
                    this.Un(), this.Ln.push({
                        qn: 3,
                        Ot: t
                    })
                }
                Qn() {
                    return this.Ln
                }
                ts(t) {
                    for (const i of t.Ln) this.ns(i);
                    this.En = Math.max(this.En, t.En), t.zn.forEach(((t, i) => {
                        this.Nn(i, t)
                    }))
                }
                static ss() {
                    return new ct(2)
                }
                static es() {
                    return new ct(3)
                }
                ns(t) {
                    switch (t.qn) {
                        case 0:
                            this.$n();
                            break;
                        case 1:
                            this.Yn(t.Ot);
                            break;
                        case 2:
                            this.Gn(t.Ot);
                            break;
                        case 3:
                            this.Jn(t.Ot);
                            break;
                        case 4:
                            this.Zn();
                            break;
                        case 5:
                            this.Xn(t.Ot);
                            break;
                        case 6:
                            this.Kn()
                    }
                }
                Kn() {
                    const t = this.Ln.findIndex((t => 5 === t.qn)); - 1 !== t && this.Ln.splice(t, 1)
                }
            }

            function ft(t, i) {
                if (!N(t)) return "n/a";
                if (!$(i)) throw new TypeError("invalid length");
                if (i < 0 || i > 16) throw new TypeError("invalid length");
                return 0 === i ? t.toString() : ("0000000000000000" + t.toString()).slice(-i)
            }
            class dt {
                constructor(t, i) {
                    if (i || (i = 1), N(t) && $(t) || (t = 100), t < 0) throw new TypeError("invalid base");
                    this.Li = t, this.rs = i, this.hs()
                }
                format(t) {
                    const i = t < 0 ? "−" : "";
                    return t = Math.abs(t), i + this.ls(t)
                }
                hs() {
                    if (this.os = 0, this.Li > 0 && this.rs > 0) {
                        let t = this.Li;
                        for (; t > 1;) t /= 10, this.os++
                    }
                }
                ls(t) {
                    const i = this.Li / this.rs;
                    let s = Math.floor(t),
                        e = "";
                    const n = void 0 !== this.os ? this.os : NaN;
                    if (i > 1) {
                        let h = +(Math.round(t * i) - s * i).toFixed(this.os);
                        h >= i && (h -= i, s += 1), e = "." + ft(+h.toFixed(this.os) * this.rs, n)
                    } else s = Math.round(s * i) / i, n > 0 && (e = "." + ft(0, n));
                    return s.toFixed(0) + e
                }
            }
            class pt extends dt {
                constructor(t = 100) {
                    super(t)
                }
                format(t) {
                    return `${super.format(t)}%`
                }
            }
            class mt {
                constructor(t) {
                    this._s = t
                }
                format(t) {
                    let i = "";
                    return t < 0 && (i = "-", t = -t), t < 995 ? i + this.us(t) : t < 999995 ? i + this.us(t / 1e3) + "K" : t < 999999995 ? (t = 1e3 * Math.round(t / 1e3), i + this.us(t / 1e6) + "M") : (t = 1e6 * Math.round(t / 1e6), i + this.us(t / 1e9) + "B")
                }
                us(t) {
                    let i;
                    const s = Math.pow(10, this._s);
                    return i = (t = Math.round(t * s) / s) >= 1e-15 && t < 1 ? t.toFixed(this._s).replace(/\.?0+$/, "") : String(t), i.replace(/(\.[1-9]*)0+$/, ((t, i) => i))
                }
            }

            function vt(t, i, s, e, n, h, r) {
                if (0 === i.length || e.from >= i.length || e.to <= 0) return;
                const {
                    context: o,
                    horizontalPixelRatio: l,
                    verticalPixelRatio: a
                } = t, u = i[e.from];
                let c = h(t, u),
                    f = u;
                if (e.to - e.from < 2) {
                    const i = n / 2;
                    o.beginPath();
                    const s = {
                            nt: u.nt - i,
                            st: u.st
                        },
                        e = {
                            nt: u.nt + i,
                            st: u.st
                        };
                    o.moveTo(s.nt * l, s.st * a), o.lineTo(e.nt * l, e.st * a), r(t, c, s, e)
                } else {
                    const n = (i, s) => {
                        r(t, c, f, s), o.beginPath(), c = i, f = s
                    };
                    let d = f;
                    o.beginPath(), o.moveTo(u.nt * l, u.st * a);
                    for (let r = e.from + 1; r < e.to; ++r) {
                        d = i[r];
                        const e = h(t, d);
                        switch (s) {
                            case 0:
                                o.lineTo(d.nt * l, d.st * a);
                                break;
                            case 1:
                                o.lineTo(d.nt * l, i[r - 1].st * a), e !== c && (n(e, d), o.lineTo(d.nt * l, i[r - 1].st * a)), o.lineTo(d.nt * l, d.st * a);
                                break;
                            case 2:
                                {
                                    const [t, s] = wt(i, r - 1, r);o.bezierCurveTo(t.nt * l, t.st * a, s.nt * l, s.st * a, d.nt * l, d.st * a);
                                    break
                                }
                        }
                        1 !== s && e !== c && (n(e, d), o.moveTo(d.nt * l, d.st * a))
                    }(f !== d || f === d && 1 === s) && r(t, c, f, d)
                }
            }

            function bt(t, i) {
                return {
                    nt: t.nt - i.nt,
                    st: t.st - i.st
                }
            }

            function gt(t, i) {
                return {
                    nt: t.nt / i,
                    st: t.st / i
                }
            }

            function wt(t, i, s) {
                const e = Math.max(0, i - 1),
                    n = Math.min(t.length - 1, s + 1);
                var h, r;
                return [(h = t[i], r = gt(bt(t[s], t[e]), 6), {
                    nt: h.nt + r.nt,
                    st: h.st + r.st
                }), bt(t[s], gt(bt(t[n], t[i]), 6))]
            }

            function yt(t, i, s, e, n) {
                const {
                    context: h,
                    horizontalPixelRatio: r,
                    verticalPixelRatio: o
                } = i;
                h.lineTo(n.nt * r, t * o), h.lineTo(e.nt * r, t * o), h.closePath(), h.fillStyle = s, h.fill()
            }
            class Mt extends j {
                constructor() {
                    super(...arguments), this.G = null
                }
                J(t) {
                    this.G = t
                }
                Z(t) {
                    var i;
                    if (null === this.G) return;
                    const {
                        it: s,
                        tt: e,
                        cs: n,
                        et: h,
                        Nt: r,
                        ds: o
                    } = this.G, l = null !== (i = this.G.fs) && void 0 !== i ? i : this.G.vs ? 0 : t.mediaSize.height;
                    if (null === e) return;
                    const a = t.context;
                    a.lineCap = "butt", a.lineJoin = "round", a.lineWidth = h, m(a, r), a.lineWidth = 1, vt(t, s, o, e, n, this.ps.bind(this), yt.bind(null, l))
                }
            }

            function St(t, i, s) {
                return Math.min(Math.max(t, i), s)
            }

            function Ct(t, i, s) {
                return i - t <= s
            }

            function xt(t) {
                const i = Math.ceil(t);
                return i % 2 == 0 ? i - 1 : i
            }
            class zt {
                bs(t, i) {
                    const s = this.ws,
                        {
                            gs: e,
                            Ms: n,
                            xs: h,
                            Ss: r,
                            ks: o,
                            fs: l
                        } = i;
                    if (void 0 === this.ys || void 0 === s || s.gs !== e || s.Ms !== n || s.xs !== h || s.Ss !== r || s.fs !== l || s.ks !== o) {
                        const s = t.context.createLinearGradient(0, 0, 0, o);
                        if (s.addColorStop(0, e), null != l) {
                            const i = St(l * t.verticalPixelRatio / o, 0, 1);
                            s.addColorStop(i, n), s.addColorStop(i, h)
                        }
                        s.addColorStop(1, r), this.ys = s, this.ws = i
                    }
                    return this.ys
                }
            }
            class kt extends Mt {
                constructor() {
                    super(...arguments), this.Cs = new zt
                }
                ps(t, i) {
                    return this.Cs.bs(t, {
                        gs: i.Ts,
                        Ms: "",
                        xs: "",
                        Ss: i.Ps,
                        ks: t.bitmapSize.height
                    })
                }
            }

            function _t(t, i) {
                const s = t.context;
                s.strokeStyle = i, s.stroke()
            }
            class Lt extends j {
                constructor() {
                    super(...arguments), this.G = null
                }
                J(t) {
                    this.G = t
                }
                Z(t) {
                    if (null === this.G) return;
                    const {
                        it: i,
                        tt: s,
                        cs: e,
                        ds: n,
                        et: h,
                        Nt: r,
                        Rs: o
                    } = this.G;
                    if (null === s) return;
                    const l = t.context;
                    l.lineCap = "butt", l.lineWidth = h * t.verticalPixelRatio, m(l, r), l.lineJoin = "round";
                    const a = this.Ds.bind(this);
                    void 0 !== n && vt(t, i, n, s, e, a, _t), o && function(t, i, s, e, n) {
                        const {
                            horizontalPixelRatio: h,
                            verticalPixelRatio: r,
                            context: o
                        } = t;
                        let l = null;
                        const a = Math.max(1, Math.floor(h)) % 2 / 2,
                            u = s * r + a;
                        for (let s = e.to - 1; s >= e.from; --s) {
                            const e = i[s];
                            if (e) {
                                const i = n(t, e);
                                i !== l && (o.beginPath(), null !== l && o.fill(), o.fillStyle = i, l = i);
                                const s = Math.round(e.nt * h) + a,
                                    c = e.st * r;
                                o.moveTo(s, c), o.arc(s, c, u, 0, 2 * Math.PI)
                            }
                        }
                        o.fill()
                    }(t, i, o, s, a)
                }
            }
            class Ot extends Lt {
                Ds(t, i) {
                    return i.lt
                }
            }

            function Tt(t, i, s, e, n = 0, h = i.length) {
                let r = h - n;
                for (; 0 < r;) {
                    const h = r >> 1,
                        o = n + h;
                    e(i[o], s) === t ? (n = o + 1, r -= h + 1) : r = h
                }
                return n
            }
            const Et = Tt.bind(null, !0),
                Nt = Tt.bind(null, !1);

            function $t(t, i) {
                return t.ot < i
            }

            function Wt(t, i) {
                return i < t.ot
            }

            function Pt(t, i, s) {
                const e = i.Os(),
                    n = i.ui(),
                    h = Et(t, e, $t),
                    r = Nt(t, n, Wt);
                if (!s) return {
                    from: h,
                    to: r
                };
                let o = h,
                    l = r;
                return h > 0 && h < t.length && t[h].ot >= e && (o = h - 1), r > 0 && r < t.length && t[r - 1].ot <= n && (l = r + 1), {
                    from: o,
                    to: l
                }
            }
            class Rt {
                constructor(t, i, s) {
                    this.As = !0, this.Bs = !0, this.Vs = !0, this.Is = [], this.zs = null, this.Ls = t, this.Es = i, this.Ns = s
                }
                bt(t) {
                    this.As = !0, "data" === t && (this.Bs = !0), "options" === t && (this.Vs = !0)
                }
                gt() {
                    return this.Ls.yt() ? (this.Fs(), null === this.zs ? null : this.Ws) : null
                }
                js() {
                    this.Is = this.Is.map((t => Object.assign(Object.assign({}, t), this.Ls.$s().Hs(t.ot))))
                }
                Us() {
                    this.zs = null
                }
                Fs() {
                    this.Bs && (this.qs(), this.Bs = !1), this.Vs && (this.js(), this.Vs = !1), this.As && (this.Ys(), this.As = !1)
                }
                Ys() {
                    const t = this.Ls.Dt(),
                        i = this.Es.St();
                    if (this.Us(), i.Ni() || t.Ni()) return;
                    const s = i.Xs();
                    if (null === s) return;
                    if (0 === this.Ls.In().Ks()) return;
                    const e = this.Ls.Ct();
                    null !== e && (this.zs = Pt(this.Is, s, this.Ns), this.Zs(t, i, e.Ot), this.Gs())
                }
            }
            class Dt extends Rt {
                constructor(t, i) {
                    super(t, i, !0)
                }
                Zs(t, i, s) {
                    i.Js(this.Is, F(this.zs)), t.Qs(this.Is, s, F(this.zs))
                }
                te(t, i) {
                    return {
                        ot: t,
                        _t: i,
                        nt: NaN,
                        st: NaN
                    }
                }
                qs() {
                    const t = this.Ls.$s();
                    this.Is = this.Ls.In().ie().map((i => {
                        const s = i.Ot[3];
                        return this.ne(i.se, s, t)
                    }))
                }
            }
            class Ft extends Dt {
                constructor(t, i) {
                    super(t, i), this.Ws = new B, this.ee = new kt, this.re = new Ot, this.Ws.X([this.ee, this.re])
                }
                ne(t, i, s) {
                    return Object.assign(Object.assign({}, this.te(t, i)), s.Hs(t))
                }
                Gs() {
                    const t = this.Ls.W();
                    this.ee.J({
                        ds: t.lineType,
                        it: this.Is,
                        Nt: t.lineStyle,
                        et: t.lineWidth,
                        fs: null,
                        vs: t.invertFilledArea,
                        tt: this.zs,
                        cs: this.Es.St().he()
                    }), this.re.J({
                        ds: t.lineVisible ? t.lineType : void 0,
                        it: this.Is,
                        Nt: t.lineStyle,
                        et: t.lineWidth,
                        tt: this.zs,
                        cs: this.Es.St().he(),
                        Rs: t.pointMarkersVisible ? t.pointMarkersRadius || t.lineWidth / 2 + 2 : void 0
                    })
                }
            }
            class It extends j {
                constructor() {
                    super(...arguments), this.zt = null, this.le = 0, this.ae = 0
                }
                J(t) {
                    this.zt = t
                }
                Z({
                    context: t,
                    horizontalPixelRatio: i,
                    verticalPixelRatio: s
                }) {
                    if (null === this.zt || 0 === this.zt.In.length || null === this.zt.tt) return;
                    this.le = this.oe(i), this.le >= 2 && Math.max(1, Math.floor(i)) % 2 != this.le % 2 && this.le--, this.ae = this.zt._e ? Math.min(this.le, Math.floor(i)) : this.le;
                    let e = null;
                    const n = this.ae <= this.le && this.zt.he >= Math.floor(1.5 * i);
                    for (let h = this.zt.tt.from; h < this.zt.tt.to; ++h) {
                        const r = this.zt.In[h];
                        e !== r.ue && (t.fillStyle = r.ue, e = r.ue);
                        const o = Math.floor(.5 * this.ae),
                            l = Math.round(r.nt * i),
                            a = l - o,
                            u = this.ae,
                            c = a + u - 1,
                            f = Math.min(r.ce, r.de),
                            d = Math.max(r.ce, r.de),
                            p = Math.round(f * s) - o,
                            m = Math.round(d * s) + o,
                            v = Math.max(m - p, this.ae);
                        t.fillRect(a, p, u, v);
                        const b = Math.ceil(1.5 * this.le);
                        if (n) {
                            if (this.zt.fe) {
                                const i = l - b;
                                let e = Math.max(p, Math.round(r.ve * s) - o),
                                    n = e + u - 1;
                                n > p + v - 1 && (n = p + v - 1, e = n - u + 1), t.fillRect(i, e, a - i, n - e + 1)
                            }
                            const i = l + b;
                            let e = Math.max(p, Math.round(r.pe * s) - o),
                                n = e + u - 1;
                            n > p + v - 1 && (n = p + v - 1, e = n - u + 1), t.fillRect(c + 1, e, i - c, n - e + 1)
                        }
                    }
                }
                oe(t) {
                    const i = Math.floor(t);
                    return Math.max(i, Math.floor(function(t, i) {
                        return Math.floor(.3 * t * i)
                    }(w(this.zt).he, t)))
                }
            }
            class At extends Rt {
                constructor(t, i) {
                    super(t, i, !1)
                }
                Zs(t, i, s) {
                    i.Js(this.Is, F(this.zs)), t.me(this.Is, s, F(this.zs))
                }
                be(t, i, s) {
                    return {
                        ot: t,
                        we: i.Ot[0],
                        ge: i.Ot[1],
                        Me: i.Ot[2],
                        xe: i.Ot[3],
                        nt: NaN,
                        ve: NaN,
                        ce: NaN,
                        de: NaN,
                        pe: NaN
                    }
                }
                qs() {
                    const t = this.Ls.$s();
                    this.Is = this.Ls.In().ie().map((i => this.ne(i.se, i, t)))
                }
            }
            class Vt extends At {
                constructor() {
                    super(...arguments), this.Ws = new It
                }
                ne(t, i, s) {
                    return Object.assign(Object.assign({}, this.be(t, i, s)), s.Hs(t))
                }
                Gs() {
                    const t = this.Ls.W();
                    this.Ws.J({
                        In: this.Is,
                        he: this.Es.St().he(),
                        fe: t.openVisible,
                        _e: t.thinBars,
                        tt: this.zs
                    })
                }
            }
            class Bt extends Mt {
                constructor() {
                    super(...arguments), this.Cs = new zt
                }
                ps(t, i) {
                    const s = this.G;
                    return this.Cs.bs(t, {
                        gs: i.Se,
                        Ms: i.ke,
                        xs: i.ye,
                        Ss: i.Ce,
                        ks: t.bitmapSize.height,
                        fs: s.fs
                    })
                }
            }
            class jt extends Lt {
                constructor() {
                    super(...arguments), this.Te = new zt
                }
                Ds(t, i) {
                    const s = this.G;
                    return this.Te.bs(t, {
                        gs: i.Pe,
                        Ms: i.Pe,
                        xs: i.Re,
                        Ss: i.Re,
                        ks: t.bitmapSize.height,
                        fs: s.fs
                    })
                }
            }
            class Ut extends Dt {
                constructor(t, i) {
                    super(t, i), this.Ws = new B, this.De = new Bt, this.Oe = new jt, this.Ws.X([this.De, this.Oe])
                }
                ne(t, i, s) {
                    return Object.assign(Object.assign({}, this.te(t, i)), s.Hs(t))
                }
                Gs() {
                    const t = this.Ls.Ct();
                    if (null === t) return;
                    const i = this.Ls.W(),
                        s = this.Ls.Dt().Rt(i.baseValue.price, t.Ot),
                        e = this.Es.St().he();
                    this.De.J({
                        it: this.Is,
                        et: i.lineWidth,
                        Nt: i.lineStyle,
                        ds: i.lineType,
                        fs: s,
                        vs: !1,
                        tt: this.zs,
                        cs: e
                    }), this.Oe.J({
                        it: this.Is,
                        et: i.lineWidth,
                        Nt: i.lineStyle,
                        ds: i.lineVisible ? i.lineType : void 0,
                        Rs: i.pointMarkersVisible ? i.pointMarkersRadius || i.lineWidth / 2 + 2 : void 0,
                        fs: s,
                        tt: this.zs,
                        cs: e
                    })
                }
            }
            class Zt extends j {
                constructor() {
                    super(...arguments), this.zt = null, this.le = 0
                }
                J(t) {
                    this.zt = t
                }
                Z(t) {
                    if (null === this.zt || 0 === this.zt.In.length || null === this.zt.tt) return;
                    const {
                        horizontalPixelRatio: i
                    } = t;
                    this.le = function(t, i) {
                        if (t >= 2.5 && t <= 4) return Math.floor(3 * i);
                        const s = 1 - .2 * Math.atan(Math.max(4, t) - 4) / (.5 * Math.PI),
                            e = Math.floor(t * s * i),
                            n = Math.floor(t * i),
                            h = Math.min(e, n);
                        return Math.max(Math.floor(i), h)
                    }(this.zt.he, i), this.le >= 2 && Math.floor(i) % 2 != this.le % 2 && this.le--;
                    const s = this.zt.In;
                    this.zt.Ae && this.Be(t, s, this.zt.tt), this.zt._i && this.Ve(t, s, this.zt.tt);
                    const e = this.Ie(i);
                    (!this.zt._i || this.le > 2 * e) && this.ze(t, s, this.zt.tt)
                }
                Be(t, i, s) {
                    if (null === this.zt) return;
                    const {
                        context: e,
                        horizontalPixelRatio: n,
                        verticalPixelRatio: h
                    } = t;
                    let r = "",
                        o = Math.min(Math.floor(n), Math.floor(this.zt.he * n));
                    o = Math.max(Math.floor(n), Math.min(o, this.le));
                    const l = Math.floor(.5 * o);
                    let a = null;
                    for (let t = s.from; t < s.to; t++) {
                        const s = i[t];
                        s.Le !== r && (e.fillStyle = s.Le, r = s.Le);
                        const u = Math.round(Math.min(s.ve, s.pe) * h),
                            c = Math.round(Math.max(s.ve, s.pe) * h),
                            f = Math.round(s.ce * h),
                            d = Math.round(s.de * h);
                        let p = Math.round(n * s.nt) - l;
                        const m = p + o - 1;
                        null !== a && (p = Math.max(a + 1, p), p = Math.min(p, m));
                        const v = m - p + 1;
                        e.fillRect(p, f, v, u - f), e.fillRect(p, c + 1, v, d - c), a = m
                    }
                }
                Ie(t) {
                    let i = Math.floor(1 * t);
                    this.le <= 2 * i && (i = Math.floor(.5 * (this.le - 1)));
                    const s = Math.max(Math.floor(t), i);
                    return this.le <= 2 * s ? Math.max(Math.floor(t), Math.floor(1 * t)) : s
                }
                Ve(t, i, s) {
                    if (null === this.zt) return;
                    const {
                        context: e,
                        horizontalPixelRatio: n,
                        verticalPixelRatio: h
                    } = t;
                    let r = "";
                    const o = this.Ie(n);
                    let l = null;
                    for (let t = s.from; t < s.to; t++) {
                        const s = i[t];
                        s.Ee !== r && (e.fillStyle = s.Ee, r = s.Ee);
                        let a = Math.round(s.nt * n) - Math.floor(.5 * this.le);
                        const u = a + this.le - 1,
                            c = Math.round(Math.min(s.ve, s.pe) * h),
                            f = Math.round(Math.max(s.ve, s.pe) * h);
                        if (null !== l && (a = Math.max(l + 1, a), a = Math.min(a, u)), this.zt.he * n > 2 * o) X(e, a, c, u - a + 1, f - c + 1, o);
                        else {
                            const t = u - a + 1;
                            e.fillRect(a, c, t, f - c + 1)
                        }
                        l = u
                    }
                }
                ze(t, i, s) {
                    if (null === this.zt) return;
                    const {
                        context: e,
                        horizontalPixelRatio: n,
                        verticalPixelRatio: h
                    } = t;
                    let r = "";
                    const o = this.Ie(n);
                    for (let t = s.from; t < s.to; t++) {
                        const s = i[t];
                        let l = Math.round(Math.min(s.ve, s.pe) * h),
                            a = Math.round(Math.max(s.ve, s.pe) * h),
                            u = Math.round(s.nt * n) - Math.floor(.5 * this.le),
                            c = u + this.le - 1;
                        if (s.ue !== r) {
                            const t = s.ue;
                            e.fillStyle = t, r = t
                        }
                        this.zt._i && (u += o, l += o, c -= o, a -= o), l > a || e.fillRect(u, l, c - u + 1, a - l + 1)
                    }
                }
            }
            class Jt extends At {
                constructor() {
                    super(...arguments), this.Ws = new Zt
                }
                ne(t, i, s) {
                    return Object.assign(Object.assign({}, this.be(t, i, s)), s.Hs(t))
                }
                Gs() {
                    const t = this.Ls.W();
                    this.Ws.J({
                        In: this.Is,
                        he: this.Es.St().he(),
                        Ae: t.wickVisible,
                        _i: t.borderVisible,
                        tt: this.zs
                    })
                }
            }
            class Ht {
                constructor(t, i) {
                    this.Ne = t, this.Li = i
                }
                K(t, i, s) {
                    this.Ne.draw(t, this.Li, i, s)
                }
            }
            class Kt extends Rt {
                constructor(t, i, s) {
                    super(t, i, !1), this.wn = s, this.Ws = new Ht(this.wn.renderer(), (i => {
                        const s = t.Ct();
                        return null === s ? null : t.Dt().Rt(i, s.Ot)
                    }))
                }
                Fe(t) {
                    return this.wn.priceValueBuilder(t)
                }
                We(t) {
                    return this.wn.isWhitespace(t)
                }
                qs() {
                    const t = this.Ls.$s();
                    this.Is = this.Ls.In().ie().map((i => Object.assign(Object.assign({
                        ot: i.se,
                        nt: NaN
                    }, t.Hs(i.se)), {
                        je: i.He
                    })))
                }
                Zs(t, i) {
                    i.Js(this.Is, F(this.zs))
                }
                Gs() {
                    this.wn.update({
                        bars: this.Is.map(Gt),
                        barSpacing: this.Es.St().he(),
                        visibleRange: this.zs
                    }, this.Ls.W())
                }
            }

            function Gt(t) {
                return {
                    x: t.nt,
                    time: t.ot,
                    originalData: t.je,
                    barColor: t.ue
                }
            }
            class Xt extends j {
                constructor() {
                    super(...arguments), this.zt = null, this.$e = []
                }
                J(t) {
                    this.zt = t, this.$e = []
                }
                Z({
                    context: t,
                    horizontalPixelRatio: i,
                    verticalPixelRatio: s
                }) {
                    if (null === this.zt || 0 === this.zt.it.length || null === this.zt.tt) return;
                    this.$e.length || this.Ue(i);
                    const e = Math.max(1, Math.floor(s)),
                        n = Math.round(this.zt.qe * s) - Math.floor(e / 2),
                        h = n + e;
                    for (let i = this.zt.tt.from; i < this.zt.tt.to; i++) {
                        const r = this.zt.it[i],
                            o = this.$e[i - this.zt.tt.from],
                            l = Math.round(r.st * s);
                        let a, u;
                        t.fillStyle = r.ue, l <= n ? (a = l, u = h) : (a = n, u = l - Math.floor(e / 2) + e), t.fillRect(o.Os, a, o.ui - o.Os + 1, u - a)
                    }
                }
                Ue(t) {
                    if (null === this.zt || 0 === this.zt.it.length || null === this.zt.tt) return void(this.$e = []);
                    const i = Math.ceil(this.zt.he * t) <= 1 ? 0 : Math.max(1, Math.floor(t)),
                        s = Math.round(this.zt.he * t) - i;
                    this.$e = new Array(this.zt.tt.to - this.zt.tt.from);
                    for (let i = this.zt.tt.from; i < this.zt.tt.to; i++) {
                        const e = this.zt.it[i],
                            n = Math.round(e.nt * t);
                        let h, r;
                        if (s % 2) {
                            const t = (s - 1) / 2;
                            h = n - t, r = n + t
                        } else {
                            const t = s / 2;
                            h = n - t, r = n + t - 1
                        }
                        this.$e[i - this.zt.tt.from] = {
                            Os: h,
                            ui: r,
                            Ye: n,
                            Xe: e.nt * t,
                            ot: e.ot
                        }
                    }
                    for (let t = this.zt.tt.from + 1; t < this.zt.tt.to; t++) {
                        const s = this.$e[t - this.zt.tt.from],
                            e = this.$e[t - this.zt.tt.from - 1];
                        s.ot === e.ot + 1 && s.Os - e.ui !== i + 1 && (e.Ye > e.Xe ? e.ui = s.Os - i - 1 : s.Os = e.ui + i + 1)
                    }
                    let e = Math.ceil(this.zt.he * t);
                    for (let t = this.zt.tt.from; t < this.zt.tt.to; t++) {
                        const i = this.$e[t - this.zt.tt.from];
                        i.ui < i.Os && (i.ui = i.Os);
                        const s = i.ui - i.Os + 1;
                        e = Math.min(s, e)
                    }
                    if (i > 0 && e < 4)
                        for (let t = this.zt.tt.from; t < this.zt.tt.to; t++) {
                            const i = this.$e[t - this.zt.tt.from];
                            i.ui - i.Os + 1 > e && (i.Ye > i.Xe ? i.ui -= 1 : i.Os += 1)
                        }
                }
            }
            class Yt extends Dt {
                constructor() {
                    super(...arguments), this.Ws = new Xt
                }
                ne(t, i, s) {
                    return Object.assign(Object.assign({}, this.te(t, i)), s.Hs(t))
                }
                Gs() {
                    const t = {
                        it: this.Is,
                        he: this.Es.St().he(),
                        tt: this.zs,
                        qe: this.Ls.Dt().Rt(this.Ls.W().base, w(this.Ls.Ct()).Ot)
                    };
                    this.Ws.J(t)
                }
            }
            class qt extends Dt {
                constructor() {
                    super(...arguments), this.Ws = new Ot
                }
                ne(t, i, s) {
                    return Object.assign(Object.assign({}, this.te(t, i)), s.Hs(t))
                }
                Gs() {
                    const t = this.Ls.W(),
                        i = {
                            it: this.Is,
                            Nt: t.lineStyle,
                            ds: t.lineVisible ? t.lineType : void 0,
                            et: t.lineWidth,
                            Rs: t.pointMarkersVisible ? t.pointMarkersRadius || t.lineWidth / 2 + 2 : void 0,
                            tt: this.zs,
                            cs: this.Es.St().he()
                        };
                    this.Ws.J(i)
                }
            }
            const Qt = /[2-9]/g;
            class ti {
                constructor(t = 50) {
                    this.Ke = 0, this.Ze = 1, this.Ge = 1, this.Je = {}, this.Qe = new Map, this.tr = t
                }
                ir() {
                    this.Ke = 0, this.Qe.clear(), this.Ze = 1, this.Ge = 1, this.Je = {}
                }
                xi(t, i, s) {
                    return this.nr(t, i, s).width
                }
                Mi(t, i, s) {
                    const e = this.nr(t, i, s);
                    return ((e.actualBoundingBoxAscent || 0) - (e.actualBoundingBoxDescent || 0)) / 2
                }
                nr(t, i, s) {
                    const e = s || Qt,
                        n = String(i).replace(e, "0");
                    if (this.Qe.has(n)) return g(this.Qe.get(n)).sr;
                    if (this.Ke === this.tr) {
                        const t = this.Je[this.Ge];
                        delete this.Je[this.Ge], this.Qe.delete(t), this.Ge++, this.Ke--
                    }
                    t.save(), t.textBaseline = "middle";
                    const h = t.measureText(n);
                    return t.restore(), 0 === h.width && i.length || (this.Qe.set(n, {
                        sr: h,
                        er: this.Ze
                    }), this.Je[this.Ze] = n, this.Ke++, this.Ze++), h
                }
            }
            class ii {
                constructor(t) {
                    this.rr = null, this.k = null, this.hr = "right", this.lr = t
                }
                ar(t, i, s) {
                    this.rr = t, this.k = i, this.hr = s
                }
                K(t) {
                    null !== this.k && null !== this.rr && this.rr.K(t, this.k, this.lr, this.hr)
                }
            }
            class si {
                constructor(t, i, s) {
                    this._r = t, this.lr = new ti(50), this.ur = i, this.F = s, this.j = -1, this.Wt = new ii(this.lr)
                }
                gt() {
                    const t = this.F.cr(this.ur);
                    if (null === t) return null;
                    const i = t.dr(this.ur) ? t.vr() : this.ur.Dt();
                    if (null === i) return null;
                    const s = t.pr(i);
                    if ("overlay" === s) return null;
                    const e = this.F.mr();
                    return e.P !== this.j && (this.j = e.P, this.lr.ir()), this.Wt.ar(this._r.Ii(), e, s), this.Wt
                }
            }
            class ei extends j {
                constructor() {
                    super(...arguments), this.zt = null
                }
                J(t) {
                    this.zt = t
                }
                br(t, i) {
                    var s;
                    if (!(null === (s = this.zt) || void 0 === s ? void 0 : s.yt)) return null;
                    const {
                        st: e,
                        et: n,
                        wr: h
                    } = this.zt;
                    return i >= e - n - 7 && i <= e + n + 7 ? {
                        gr: this.zt,
                        wr: h
                    } : null
                }
                Z({
                    context: t,
                    bitmapSize: i,
                    horizontalPixelRatio: s,
                    verticalPixelRatio: e
                }) {
                    if (null === this.zt) return;
                    if (!1 === this.zt.yt) return;
                    const n = Math.round(this.zt.st * e);
                    n < 0 || n > i.height || (t.lineCap = "butt", t.strokeStyle = this.zt.O, t.lineWidth = Math.floor(this.zt.et * s), m(t, this.zt.Nt), v(t, n, 0, i.width))
                }
            }
            class ni {
                constructor(t) {
                    this.Mr = {
                        st: 0,
                        O: "rgba(0, 0, 0, 0)",
                        et: 1,
                        Nt: 0,
                        yt: !1
                    }, this.Sr = new ei, this.ft = !0, this.Ls = t, this.Es = t.$t(), this.Sr.J(this.Mr)
                }
                bt() {
                    this.ft = !0
                }
                gt() {
                    return this.Ls.yt() ? (this.ft && (this.kr(), this.ft = !1), this.Sr) : null
                }
            }
            class hi extends ni {
                constructor(t) {
                    super(t)
                }
                kr() {
                    this.Mr.yt = !1;
                    const t = this.Ls.Dt(),
                        i = t.yr().yr;
                    if (2 !== i && 3 !== i) return;
                    const s = this.Ls.W();
                    if (!s.baseLineVisible || !this.Ls.yt()) return;
                    const e = this.Ls.Ct();
                    null !== e && (this.Mr.yt = !0, this.Mr.st = t.Rt(e.Ot, e.Ot), this.Mr.O = s.baseLineColor, this.Mr.et = s.baseLineWidth, this.Mr.Nt = s.baseLineStyle)
                }
            }
            class ri extends j {
                constructor() {
                    super(...arguments), this.zt = null
                }
                J(t) {
                    this.zt = t
                }
                He() {
                    return this.zt
                }
                Z({
                    context: t,
                    horizontalPixelRatio: i,
                    verticalPixelRatio: s
                }) {
                    const e = this.zt;
                    if (null === e) return;
                    const n = Math.max(1, Math.floor(i)),
                        h = n % 2 / 2,
                        r = Math.round(e.Xe.x * i) + h,
                        o = e.Xe.y * s;
                    t.fillStyle = e.Cr, t.beginPath();
                    const l = Math.max(2, 1.5 * e.Tr) * i;
                    t.arc(r, o, l, 0, 2 * Math.PI, !1), t.fill(), t.fillStyle = e.Pr, t.beginPath(), t.arc(r, o, e.ht * i, 0, 2 * Math.PI, !1), t.fill(), t.lineWidth = n, t.strokeStyle = e.Rr, t.beginPath(), t.arc(r, o, e.ht * i + n / 2, 0, 2 * Math.PI, !1), t.stroke()
                }
            }
            const oi = [{
                Dr: 0,
                Or: .25,
                Ar: 4,
                Br: 10,
                Vr: .25,
                Ir: 0,
                zr: .4,
                Lr: .8
            }, {
                Dr: .25,
                Or: .525,
                Ar: 10,
                Br: 14,
                Vr: 0,
                Ir: 0,
                zr: .8,
                Lr: 0
            }, {
                Dr: .525,
                Or: 1,
                Ar: 14,
                Br: 14,
                Vr: 0,
                Ir: 0,
                zr: 0,
                Lr: 0
            }];

            function li(t, i, s, e) {
                return function(t, i) {
                    if ("transparent" === t) return t;
                    const s = L(t),
                        e = s[3];
                    return `rgba(${s[0]}, ${s[1]}, ${s[2]}, ${i*e})`
                }(t, s + (e - s) * i)
            }

            function ai(t, i) {
                const s = t % 2600 / 2600;
                let e;
                for (const t of oi)
                    if (s >= t.Dr && s <= t.Or) {
                        e = t;
                        break
                    }
                b(void 0 !== e, "Last price animation internal logic error");
                const n = (s - e.Dr) / (e.Or - e.Dr);
                return {
                    Pr: li(i, n, e.Vr, e.Ir),
                    Rr: li(i, n, e.zr, e.Lr),
                    ht: (h = n, r = e.Ar, o = e.Br, r + (o - r) * h)
                };
                var h, r, o
            }
            class ui {
                constructor(t) {
                    this.Wt = new ri, this.ft = !0, this.Er = !0, this.Nr = performance.now(), this.Fr = this.Nr - 1, this.Wr = t
                }
                jr() {
                    this.Fr = this.Nr - 1, this.bt()
                }
                Hr() {
                    if (this.bt(), 2 === this.Wr.W().lastPriceAnimation) {
                        const t = performance.now(),
                            i = this.Fr - t;
                        if (i > 0) return void(i < 650 && (this.Fr += 2600));
                        this.Nr = t, this.Fr = t + 2600
                    }
                }
                bt() {
                    this.ft = !0
                }
                $r() {
                    this.Er = !0
                }
                yt() {
                    return 0 !== this.Wr.W().lastPriceAnimation
                }
                Ur() {
                    switch (this.Wr.W().lastPriceAnimation) {
                        case 0:
                            return !1;
                        case 1:
                            return !0;
                        case 2:
                            return performance.now() <= this.Fr
                    }
                }
                gt() {
                    return this.ft ? (this.Mt(), this.ft = !1, this.Er = !1) : this.Er && (this.qr(), this.Er = !1), this.Wt
                }
                Mt() {
                    this.Wt.J(null);
                    const t = this.Wr.$t().St(),
                        i = t.Xs(),
                        s = this.Wr.Ct();
                    if (null === i || null === s) return;
                    const e = this.Wr.Yr(!0);
                    if (e.Xr || !i.Kr(e.se)) return;
                    const n = {
                            x: t.It(e.se),
                            y: this.Wr.Dt().Rt(e._t, s.Ot)
                        },
                        h = e.O,
                        r = this.Wr.W().lineWidth,
                        o = ai(this.Zr(), h);
                    this.Wt.J({
                        Cr: h,
                        Tr: r,
                        Pr: o.Pr,
                        Rr: o.Rr,
                        ht: o.ht,
                        Xe: n
                    })
                }
                qr() {
                    const t = this.Wt.He();
                    if (null !== t) {
                        const i = ai(this.Zr(), t.Cr);
                        t.Pr = i.Pr, t.Rr = i.Rr, t.ht = i.ht
                    }
                }
                Zr() {
                    return this.Ur() ? performance.now() - this.Nr : 2599
                }
            }

            function ci(t, i) {
                return xt(Math.min(Math.max(t, 12), 30) * i)
            }

            function fi(t, i) {
                switch (t) {
                    case "arrowDown":
                    case "arrowUp":
                        return ci(i, 1);
                    case "circle":
                        return ci(i, .8);
                    case "square":
                        return ci(i, .7)
                }
            }

            function di(t) {
                return function(t) {
                    const i = Math.ceil(t);
                    return i % 2 != 0 ? i - 1 : i
                }(ci(t, 1))
            }

            function pi(t) {
                return Math.max(ci(t, .1), 3)
            }

            function mi(t, i, s) {
                return i ? t : s ? Math.ceil(t / 2) : 0
            }

            function vi(t, i, s, e, n) {
                const h = fi("square", s),
                    r = (h - 1) / 2,
                    o = t - r,
                    l = i - r;
                return e >= o && e <= o + h && n >= l && n <= l + h
            }

            function bi(t, i, s, e) {
                const n = (fi("arrowUp", e) - 1) / 2 * s.Gr,
                    h = (xt(e / 2) - 1) / 2 * s.Gr;
                i.beginPath(), t ? (i.moveTo(s.nt - n, s.st), i.lineTo(s.nt, s.st - n), i.lineTo(s.nt + n, s.st), i.lineTo(s.nt + h, s.st), i.lineTo(s.nt + h, s.st + n), i.lineTo(s.nt - h, s.st + n), i.lineTo(s.nt - h, s.st)) : (i.moveTo(s.nt - n, s.st), i.lineTo(s.nt, s.st + n), i.lineTo(s.nt + n, s.st), i.lineTo(s.nt + h, s.st), i.lineTo(s.nt + h, s.st - n), i.lineTo(s.nt - h, s.st - n), i.lineTo(s.nt - h, s.st)), i.fill()
            }
            class gi extends j {
                constructor() {
                    super(...arguments), this.zt = null, this.lr = new ti, this.j = -1, this.H = "", this.Jr = ""
                }
                J(t) {
                    this.zt = t
                }
                ar(t, i) {
                    this.j === t && this.H === i || (this.j = t, this.H = i, this.Jr = A(t, i), this.lr.ir())
                }
                br(t, i) {
                    if (null === this.zt || null === this.zt.tt) return null;
                    for (let s = this.zt.tt.from; s < this.zt.tt.to; s++) {
                        const e = this.zt.it[s];
                        if (yi(e, t, i)) return {
                            gr: e.Qr,
                            wr: e.wr
                        }
                    }
                    return null
                }
                Z({
                    context: t,
                    horizontalPixelRatio: i,
                    verticalPixelRatio: s
                }, e, n) {
                    if (null !== this.zt && null !== this.zt.tt) {
                        t.textBaseline = "middle", t.font = this.Jr;
                        for (let e = this.zt.tt.from; e < this.zt.tt.to; e++) {
                            const n = this.zt.it[e];
                            void 0 !== n.Zt && (n.Zt.Hi = this.lr.xi(t, n.Zt.th), n.Zt.Vt = this.j, n.Zt.nt = n.nt - n.Zt.Hi / 2), wi(n, t, i, s)
                        }
                    }
                }
            }

            function wi(t, i, s, e) {
                i.fillStyle = t.O, void 0 !== t.Zt && function(t, i, s, e, n, h) {
                        t.save(), t.scale(n, h), t.fillText(i, s, e), t.restore()
                    }(i, t.Zt.th, t.Zt.nt, t.Zt.st, s, e),
                    function(t, i, s) {
                        if (0 !== t.Ks) {
                            switch (t.ih) {
                                case "arrowDown":
                                    return void bi(!1, i, s, t.Ks);
                                case "arrowUp":
                                    return void bi(!0, i, s, t.Ks);
                                case "circle":
                                    return void
                                    function(t, i, s) {
                                        const e = (fi("circle", s) - 1) / 2;
                                        t.beginPath(), t.arc(i.nt, i.st, e * i.Gr, 0, 2 * Math.PI, !1), t.fill()
                                    }(i, s, t.Ks);
                                case "square":
                                    return void
                                    function(t, i, s) {
                                        const e = fi("square", s),
                                            n = (e - 1) * i.Gr / 2,
                                            h = i.nt - n,
                                            r = i.st - n;
                                        t.fillRect(h, r, e * i.Gr, e * i.Gr)
                                    }(i, s, t.Ks)
                            }
                            t.ih
                        }
                    }(t, i, function(t, i, s) {
                        const e = Math.max(1, Math.floor(i)) % 2 / 2;
                        return {
                            nt: Math.round(t.nt * i) + e,
                            st: t.st * s,
                            Gr: i
                        }
                    }(t, s, e))
            }

            function yi(t, i, s) {
                return !(void 0 === t.Zt || ! function(t, i, s, e, n, h) {
                    const r = e / 2;
                    return n >= t && n <= t + s && h >= i - r && h <= i + r
                }(t.Zt.nt, t.Zt.st, t.Zt.Hi, t.Zt.Vt, i, s)) || function(t, i, s) {
                    if (0 === t.Ks) return !1;
                    switch (t.ih) {
                        case "arrowDown":
                        case "arrowUp":
                            return function(t, i, s, e, n, h) {
                                return vi(i, s, e, n, h)
                            }(0, t.nt, t.st, t.Ks, i, s);
                        case "circle":
                            return function(t, i, s, e, n) {
                                const h = 2 + fi("circle", s) / 2,
                                    r = t - e,
                                    o = i - n;
                                return Math.sqrt(r * r + o * o) <= h
                            }(t.nt, t.st, t.Ks, i, s);
                        case "square":
                            return vi(t.nt, t.st, t.Ks, i, s)
                    }
                }(t, i, s)
            }

            function Mi(t, i, s, e, n, h, r, o, l) {
                const a = N(s) ? s : s.xe,
                    u = N(s) ? s : s.ge,
                    c = N(s) ? s : s.Me,
                    f = N(i.size) ? Math.max(i.size, 0) : 1,
                    d = di(o.he()) * f,
                    p = d / 2;
                switch (t.Ks = d, i.position) {
                    case "inBar":
                        return t.st = r.Rt(a, l), void(void 0 !== t.Zt && (t.Zt.st = t.st + p + h + .6 * n));
                    case "aboveBar":
                        return t.st = r.Rt(u, l) - p - e.nh, void 0 !== t.Zt && (t.Zt.st = t.st - p - .6 * n, e.nh += 1.2 * n), void(e.nh += d + h);
                    case "belowBar":
                        return t.st = r.Rt(c, l) + p + e.sh, void 0 !== t.Zt && (t.Zt.st = t.st + p + h + .6 * n, e.sh += 1.2 * n), void(e.sh += d + h)
                }
                i.position
            }
            class Si {
                constructor(t, i) {
                    this.ft = !0, this.eh = !0, this.rh = !0, this.hh = null, this.ah = null, this.Wt = new gi, this.Wr = t, this.$i = i, this.zt = {
                        it: [],
                        tt: null
                    }
                }
                bt(t) {
                    this.ft = !0, this.rh = !0, "data" === t && (this.eh = !0, this.ah = null)
                }
                gt(t) {
                    if (!this.Wr.yt()) return null;
                    this.ft && this.oh();
                    const i = this.$i.W().layout;
                    return this.Wt.ar(i.fontSize, i.fontFamily), this.Wt.J(this.zt), this.Wt
                }
                _h() {
                    if (this.rh) {
                        if (this.Wr.uh().length > 0) {
                            const t = this.$i.St().he(),
                                i = pi(t),
                                s = 1.5 * di(t) + 2 * i,
                                e = this.dh();
                            this.hh = {
                                above: mi(s, e.aboveBar, e.inBar),
                                below: mi(s, e.belowBar, e.inBar)
                            }
                        } else this.hh = null;
                        this.rh = !1
                    }
                    return this.hh
                }
                dh() {
                    return null === this.ah && (this.ah = this.Wr.uh().reduce(((t, i) => (t[i.position] || (t[i.position] = !0), t)), {
                        inBar: !1,
                        aboveBar: !1,
                        belowBar: !1
                    })), this.ah
                }
                oh() {
                    const t = this.Wr.Dt(),
                        i = this.$i.St(),
                        s = this.Wr.uh();
                    this.eh && (this.zt.it = s.map((t => ({
                        ot: t.time,
                        nt: 0,
                        st: 0,
                        Ks: 0,
                        ih: t.shape,
                        O: t.color,
                        Qr: t.Qr,
                        wr: t.id,
                        Zt: void 0
                    }))), this.eh = !1);
                    const e = this.$i.W().layout;
                    this.zt.tt = null;
                    const n = i.Xs();
                    if (null === n) return;
                    const h = this.Wr.Ct();
                    if (null === h) return;
                    if (0 === this.zt.it.length) return;
                    let r = NaN;
                    const o = pi(i.he()),
                        l = {
                            nh: o,
                            sh: o
                        };
                    this.zt.tt = Pt(this.zt.it, n, !0);
                    for (let n = this.zt.tt.from; n < this.zt.tt.to; n++) {
                        const a = s[n];
                        a.time !== r && (l.nh = o, l.sh = o, r = a.time);
                        const u = this.zt.it[n];
                        u.nt = i.It(a.time), void 0 !== a.text && a.text.length > 0 && (u.Zt = {
                            th: a.text,
                            nt: 0,
                            st: 0,
                            Hi: 0,
                            Vt: 0
                        });
                        const c = this.Wr.fh(a.time);
                        null !== c && Mi(u, a, c, l, e.fontSize, o, t, i, h.Ot)
                    }
                    this.ft = !1
                }
            }
            class Ci extends ni {
                constructor(t) {
                    super(t)
                }
                kr() {
                    const t = this.Mr;
                    t.yt = !1;
                    const i = this.Ls.W();
                    if (!i.priceLineVisible || !this.Ls.yt()) return;
                    const s = this.Ls.Yr(0 === i.priceLineSource);
                    s.Xr || (t.yt = !0, t.st = s.ki, t.O = this.Ls.ph(s.O), t.et = i.priceLineWidth, t.Nt = i.priceLineStyle)
                }
            }
            class xi extends st {
                constructor(t) {
                    super(), this.jt = t
                }
                zi(t, i, s) {
                    t.yt = !1, i.yt = !1;
                    const e = this.jt;
                    if (!e.yt()) return;
                    const n = e.W(),
                        h = n.lastValueVisible,
                        r = "" !== e.mh(),
                        o = 0 === n.seriesLastValueMode,
                        l = e.Yr(!1);
                    if (l.Xr) return;
                    h && (t.Zt = this.bh(l, h, o), t.yt = 0 !== t.Zt.length), (r || o) && (i.Zt = this.wh(l, h, r, o), i.yt = i.Zt.length > 0);
                    const a = e.ph(l.O),
                        u = O(a);
                    s.t = u.t, s.ki = l.ki, i.At = e.$t().Bt(l.ki / e.Dt().Vt()), t.At = a, t.O = u.i, i.O = u.i
                }
                wh(t, i, s, e) {
                    let n = "";
                    const h = this.jt.mh();
                    return s && 0 !== h.length && (n += `${h} `), i && e && (n += this.jt.Dt().gh() ? t.Mh : t.xh), n.trim()
                }
                bh(t, i, s) {
                    return i ? s ? this.jt.Dt().gh() ? t.xh : t.Mh : t.Zt : ""
                }
            }

            function zi(t, i, s, e) {
                const n = Number.isFinite(i),
                    h = Number.isFinite(s);
                return n && h ? t(i, s) : n || h ? n ? i : s : e
            }
            class ki {
                constructor(t, i) {
                    this.Sh = t, this.kh = i
                }
                yh(t) {
                    return null !== t && this.Sh === t.Sh && this.kh === t.kh
                }
                Ch() {
                    return new ki(this.Sh, this.kh)
                }
                Th() {
                    return this.Sh
                }
                Ph() {
                    return this.kh
                }
                Rh() {
                    return this.kh - this.Sh
                }
                Ni() {
                    return this.kh === this.Sh || Number.isNaN(this.kh) || Number.isNaN(this.Sh)
                }
                ts(t) {
                    return null === t ? this : new ki(zi(Math.min, this.Th(), t.Th(), -1 / 0), zi(Math.max, this.Ph(), t.Ph(), 1 / 0))
                }
                Dh(t) {
                    if (!N(t)) return;
                    if (0 == this.kh - this.Sh) return;
                    const i = .5 * (this.kh + this.Sh);
                    let s = this.kh - i,
                        e = this.Sh - i;
                    s *= t, e *= t, this.kh = i + s, this.Sh = i + e
                }
                Oh(t) {
                    N(t) && (this.kh += t, this.Sh += t)
                }
                Ah() {
                    return {
                        minValue: this.Sh,
                        maxValue: this.kh
                    }
                }
                static Bh(t) {
                    return null === t ? null : new ki(t.minValue, t.maxValue)
                }
            }
            class _i {
                constructor(t, i) {
                    this.Vh = t, this.Ih = i || null
                }
                zh() {
                    return this.Vh
                }
                Lh() {
                    return this.Ih
                }
                Ah() {
                    return null === this.Vh ? null : {
                        priceRange: this.Vh.Ah(),
                        margins: this.Ih || void 0
                    }
                }
                static Bh(t) {
                    return null === t ? null : new _i(ki.Bh(t.priceRange), t.margins)
                }
            }
            class Li extends ni {
                constructor(t, i) {
                    super(t), this.Eh = i
                }
                kr() {
                    const t = this.Mr;
                    t.yt = !1;
                    const i = this.Eh.W();
                    if (!this.Ls.yt() || !i.lineVisible) return;
                    const s = this.Eh.Nh();
                    null !== s && (t.yt = !0, t.st = s, t.O = i.color, t.et = i.lineWidth, t.Nt = i.lineStyle, t.wr = this.Eh.W().id)
                }
            }
            class Oi extends st {
                constructor(t, i) {
                    super(), this.Wr = t, this.Eh = i
                }
                zi(t, i, s) {
                    t.yt = !1, i.yt = !1;
                    const e = this.Eh.W(),
                        n = e.axisLabelVisible,
                        h = "" !== e.title,
                        r = this.Wr;
                    if (!n || !r.yt()) return;
                    const o = this.Eh.Nh();
                    if (null === o) return;
                    h && (i.Zt = e.title, i.yt = !0), i.At = r.$t().Bt(o / r.Dt().Vt()), t.Zt = this.Fh(e.price), t.yt = !0;
                    const l = O(e.axisLabelColor || e.color);
                    s.t = l.t;
                    const a = e.axisLabelTextColor || l.i;
                    t.O = a, i.O = a, s.ki = o
                }
                Fh(t) {
                    const i = this.Wr.Ct();
                    return null === i ? "" : this.Wr.Dt().Fi(t, i.Ot)
                }
            }
            class Ti {
                constructor(t, i) {
                    this.Wr = t, this.cn = i, this.Wh = new Li(t, this), this._r = new Oi(t, this), this.jh = new si(this._r, t, t.$t())
                }
                Hh(t) {
                    E(this.cn, t), this.bt(), this.Wr.$t().$h()
                }
                W() {
                    return this.cn
                }
                Uh() {
                    return this.Wh
                }
                qh() {
                    return this.jh
                }
                Yh() {
                    return this._r
                }
                bt() {
                    this.Wh.bt(), this._r.bt()
                }
                Nh() {
                    const t = this.Wr,
                        i = t.Dt();
                    if (t.$t().St().Ni() || i.Ni()) return null;
                    const s = t.Ct();
                    return null === s ? null : i.Rt(this.cn.price, s.Ot)
                }
            }
            class Ei extends ot {
                constructor(t) {
                    super(), this.$i = t
                }
                $t() {
                    return this.$i
                }
            }
            const Ni = {
                Bar: (t, i, s, e) => {
                    var n;
                    const h = i.upColor,
                        r = i.downColor,
                        o = w(t(s, e)),
                        l = y(o.Ot[0]) <= y(o.Ot[3]);
                    return {
                        ue: null !== (n = o.O) && void 0 !== n ? n : l ? h : r
                    }
                },
                Candlestick: (t, i, s, e) => {
                    var n, h, r;
                    const o = i.upColor,
                        l = i.downColor,
                        a = i.borderUpColor,
                        u = i.borderDownColor,
                        c = i.wickUpColor,
                        f = i.wickDownColor,
                        d = w(t(s, e)),
                        p = y(d.Ot[0]) <= y(d.Ot[3]);
                    return {
                        ue: null !== (n = d.O) && void 0 !== n ? n : p ? o : l,
                        Ee: null !== (h = d.At) && void 0 !== h ? h : p ? a : u,
                        Le: null !== (r = d.Xh) && void 0 !== r ? r : p ? c : f
                    }
                },
                Custom: (t, i, s, e) => {
                    var n;
                    return {
                        ue: null !== (n = w(t(s, e)).O) && void 0 !== n ? n : i.color
                    }
                },
                Area: (t, i, s, e) => {
                    var n, h, r, o;
                    const l = w(t(s, e));
                    return {
                        ue: null !== (n = l.lt) && void 0 !== n ? n : i.lineColor,
                        lt: null !== (h = l.lt) && void 0 !== h ? h : i.lineColor,
                        Ts: null !== (r = l.Ts) && void 0 !== r ? r : i.topColor,
                        Ps: null !== (o = l.Ps) && void 0 !== o ? o : i.bottomColor
                    }
                },
                Baseline: (t, i, s, e) => {
                    var n, h, r, o, l, a;
                    const u = w(t(s, e));
                    return {
                        ue: u.Ot[3] >= i.baseValue.price ? i.topLineColor : i.bottomLineColor,
                        Pe: null !== (n = u.Pe) && void 0 !== n ? n : i.topLineColor,
                        Re: null !== (h = u.Re) && void 0 !== h ? h : i.bottomLineColor,
                        Se: null !== (r = u.Se) && void 0 !== r ? r : i.topFillColor1,
                        ke: null !== (o = u.ke) && void 0 !== o ? o : i.topFillColor2,
                        ye: null !== (l = u.ye) && void 0 !== l ? l : i.bottomFillColor1,
                        Ce: null !== (a = u.Ce) && void 0 !== a ? a : i.bottomFillColor2
                    }
                },
                Line: (t, i, s, e) => {
                    var n, h;
                    const r = w(t(s, e));
                    return {
                        ue: null !== (n = r.O) && void 0 !== n ? n : i.color,
                        lt: null !== (h = r.O) && void 0 !== h ? h : i.color
                    }
                },
                Histogram: (t, i, s, e) => {
                    var n;
                    return {
                        ue: null !== (n = w(t(s, e)).O) && void 0 !== n ? n : i.color
                    }
                }
            };
            class $i {
                constructor(t) {
                    this.Kh = (t, i) => void 0 !== i ? i.Ot : this.Wr.In().Zh(t), this.Wr = t, this.Gh = Ni[t.Jh()]
                }
                Hs(t, i) {
                    return this.Gh(this.Kh, this.Wr.W(), t, i)
                }
            }
            var Wi;
            ! function(t) {
                t[t.NearestLeft = -1] = "NearestLeft", t[t.None = 0] = "None", t[t.NearestRight = 1] = "NearestRight"
            }(Wi || (Wi = {}));
            const Pi = 30;
            class Ri {
                constructor() {
                    this.Qh = [], this.tl = new Map, this.il = new Map
                }
                nl() {
                    return this.Ks() > 0 ? this.Qh[this.Qh.length - 1] : null
                }
                sl() {
                    return this.Ks() > 0 ? this.el(0) : null
                }
                Vn() {
                    return this.Ks() > 0 ? this.el(this.Qh.length - 1) : null
                }
                Ks() {
                    return this.Qh.length
                }
                Ni() {
                    return 0 === this.Ks()
                }
                Kr(t) {
                    return null !== this.rl(t, 0)
                }
                Zh(t) {
                    return this.hl(t)
                }
                hl(t, i = 0) {
                    const s = this.rl(t, i);
                    return null === s ? null : Object.assign(Object.assign({}, this.ll(s)), {
                        se: this.el(s)
                    })
                }
                ie() {
                    return this.Qh
                }
                al(t, i, s) {
                    if (this.Ni()) return null;
                    let e = null;
                    for (const n of s) e = Di(e, this.ol(t, i, n));
                    return e
                }
                J(t) {
                    this.il.clear(), this.tl.clear(), this.Qh = t
                }
                el(t) {
                    return this.Qh[t].se
                }
                ll(t) {
                    return this.Qh[t]
                }
                rl(t, i) {
                    const s = this._l(t);
                    if (null === s && 0 !== i) switch (i) {
                        case -1:
                            return this.ul(t);
                        case 1:
                            return this.cl(t);
                        default:
                            throw new TypeError("Unknown search mode")
                    }
                    return s
                }
                ul(t) {
                    let i = this.dl(t);
                    return i > 0 && (i -= 1), i !== this.Qh.length && this.el(i) < t ? i : null
                }
                cl(t) {
                    const i = this.fl(t);
                    return i !== this.Qh.length && t < this.el(i) ? i : null
                }
                _l(t) {
                    const i = this.dl(t);
                    return i === this.Qh.length || t < this.Qh[i].se ? null : i
                }
                dl(t) {
                    return Et(this.Qh, t, ((t, i) => t.se < i))
                }
                fl(t) {
                    return Nt(this.Qh, t, ((t, i) => t.se > i))
                }
                vl(t, i, s) {
                    let e = null;
                    for (let n = t; n < i; n++) {
                        const t = this.Qh[n].Ot[s];
                        Number.isNaN(t) || (null === e ? e = {
                            pl: t,
                            ml: t
                        } : (t < e.pl && (e.pl = t), t > e.ml && (e.ml = t)))
                    }
                    return e
                }
                ol(t, i, s) {
                    if (this.Ni()) return null;
                    let e = null;
                    const n = w(this.sl()),
                        h = w(this.Vn()),
                        r = Math.max(t, n),
                        o = Math.min(i, h),
                        l = Math.ceil(r / Pi) * Pi,
                        a = Math.max(l, Math.floor(o / Pi) * Pi); {
                        const t = this.dl(r),
                            n = this.fl(Math.min(o, l, i));
                        e = Di(e, this.vl(t, n, s))
                    }
                    let u = this.tl.get(s);
                    void 0 === u && (u = new Map, this.tl.set(s, u));
                    for (let t = Math.max(l + 1, r); t < a; t += Pi) {
                        const i = Math.floor(t / Pi);
                        let n = u.get(i);
                        if (void 0 === n) {
                            const t = this.dl(i * Pi),
                                e = this.fl((i + 1) * Pi - 1);
                            n = this.vl(t, e, s), u.set(i, n)
                        }
                        e = Di(e, n)
                    } {
                        const t = this.dl(a),
                            i = this.fl(o);
                        e = Di(e, this.vl(t, i, s))
                    }
                    return e
                }
            }

            function Di(t, i) {
                return null === t ? i : null === i ? t : {
                    pl: Math.min(t.pl, i.pl),
                    ml: Math.max(t.ml, i.ml)
                }
            }
            class Fi {
                constructor(t) {
                    this.bl = t
                }
                K(t, i, s) {
                    this.bl.draw(t)
                }
                wl(t, i, s) {
                    var e, n;
                    null === (n = (e = this.bl).drawBackground) || void 0 === n || n.call(e, t)
                }
            }
            class Ii {
                constructor(t) {
                    this.Qe = null, this.wn = t
                }
                gt() {
                    var t;
                    const i = this.wn.renderer();
                    if (null === i) return null;
                    if ((null === (t = this.Qe) || void 0 === t ? void 0 : t.gl) === i) return this.Qe.Ml;
                    const s = new Fi(i);
                    return this.Qe = {
                        gl: i,
                        Ml: s
                    }, s
                }
                xl() {
                    var t, i, s;
                    return null !== (s = null === (i = (t = this.wn).zOrder) || void 0 === i ? void 0 : i.call(t)) && void 0 !== s ? s : "normal"
                }
            }

            function Ai(t) {
                var i, s, e, n, h;
                return {
                    Zt: t.text(),
                    ki: t.coordinate(),
                    Si: null === (i = t.fixedCoordinate) || void 0 === i ? void 0 : i.call(t),
                    O: t.textColor(),
                    t: t.backColor(),
                    yt: null === (e = null === (s = t.visible) || void 0 === s ? void 0 : s.call(t)) || void 0 === e || e,
                    hi: null === (h = null === (n = t.tickVisible) || void 0 === n ? void 0 : n.call(t)) || void 0 === h || h
                }
            }
            class Vi {
                constructor(t, i) {
                    this.Wt = new ht, this.Sl = t, this.kl = i
                }
                gt() {
                    return this.Wt.J(Object.assign({
                        Hi: this.kl.Hi()
                    }, Ai(this.Sl))), this.Wt
                }
            }
            class Bi extends st {
                constructor(t, i) {
                    super(), this.Sl = t, this.Li = i
                }
                zi(t, i, s) {
                    const e = Ai(this.Sl);
                    s.t = e.t, t.O = e.O;
                    const n = 2 / 12 * this.Li.P();
                    s.wi = n, s.gi = n, s.ki = e.ki, s.Si = e.Si, t.Zt = e.Zt, t.yt = e.yt, t.hi = e.hi
                }
            }
            class ji {
                constructor(t, i) {
                    this.yl = null, this.Cl = null, this.Tl = null, this.Pl = null, this.Rl = null, this.Dl = t, this.Wr = i
                }
                Ol() {
                    return this.Dl
                }
                On() {
                    var t, i;
                    null === (i = (t = this.Dl).updateAllViews) || void 0 === i || i.call(t)
                }
                Pn() {
                    var t, i, s, e;
                    const n = null !== (s = null === (i = (t = this.Dl).paneViews) || void 0 === i ? void 0 : i.call(t)) && void 0 !== s ? s : [];
                    if ((null === (e = this.yl) || void 0 === e ? void 0 : e.gl) === n) return this.yl.Ml;
                    const h = n.map((t => new Ii(t)));
                    return this.yl = {
                        gl: n,
                        Ml: h
                    }, h
                }
                Qi() {
                    var t, i, s, e;
                    const n = null !== (s = null === (i = (t = this.Dl).timeAxisViews) || void 0 === i ? void 0 : i.call(t)) && void 0 !== s ? s : [];
                    if ((null === (e = this.Cl) || void 0 === e ? void 0 : e.gl) === n) return this.Cl.Ml;
                    const h = this.Wr.$t().St(),
                        r = n.map((t => new Vi(t, h)));
                    return this.Cl = {
                        gl: n,
                        Ml: r
                    }, r
                }
                Rn() {
                    var t, i, s, e;
                    const n = null !== (s = null === (i = (t = this.Dl).priceAxisViews) || void 0 === i ? void 0 : i.call(t)) && void 0 !== s ? s : [];
                    if ((null === (e = this.Tl) || void 0 === e ? void 0 : e.gl) === n) return this.Tl.Ml;
                    const h = this.Wr.Dt(),
                        r = n.map((t => new Bi(t, h)));
                    return this.Tl = {
                        gl: n,
                        Ml: r
                    }, r
                }
                Al() {
                    var t, i, s, e;
                    const n = null !== (s = null === (i = (t = this.Dl).priceAxisPaneViews) || void 0 === i ? void 0 : i.call(t)) && void 0 !== s ? s : [];
                    if ((null === (e = this.Pl) || void 0 === e ? void 0 : e.gl) === n) return this.Pl.Ml;
                    const h = n.map((t => new Ii(t)));
                    return this.Pl = {
                        gl: n,
                        Ml: h
                    }, h
                }
                Bl() {
                    var t, i, s, e;
                    const n = null !== (s = null === (i = (t = this.Dl).timeAxisPaneViews) || void 0 === i ? void 0 : i.call(t)) && void 0 !== s ? s : [];
                    if ((null === (e = this.Rl) || void 0 === e ? void 0 : e.gl) === n) return this.Rl.Ml;
                    const h = n.map((t => new Ii(t)));
                    return this.Rl = {
                        gl: n,
                        Ml: h
                    }, h
                }
                Vl(t, i) {
                    var s, e, n;
                    return null !== (n = null === (e = (s = this.Dl).autoscaleInfo) || void 0 === e ? void 0 : e.call(s, t, i)) && void 0 !== n ? n : null
                }
                br(t, i) {
                    var s, e, n;
                    return null !== (n = null === (e = (s = this.Dl).hitTest) || void 0 === e ? void 0 : e.call(s, t, i)) && void 0 !== n ? n : null
                }
            }

            function Ui(t, i, s, e) {
                t.forEach((t => {
                    i(t).forEach((t => {
                        t.xl() === s && e.push(t)
                    }))
                }))
            }

            function Zi(t) {
                return t.Pn()
            }

            function Ji(t) {
                return t.Al()
            }

            function Hi(t) {
                return t.Bl()
            }
            class Ki extends Ei {
                constructor(t, i, s, e, n) {
                    super(t), this.zt = new Ri, this.Wh = new Ci(this), this.Il = [], this.zl = new hi(this), this.Ll = null, this.El = null, this.Nl = [], this.Fl = [], this.Wl = null, this.jl = [], this.cn = i, this.Hl = s;
                    const h = new xi(this);
                    this.rn = [h], this.jh = new si(h, this, t), "Area" !== s && "Line" !== s && "Baseline" !== s || (this.Ll = new ui(this)), this.$l(), this.Ul(n)
                }
                S() {
                    null !== this.Wl && clearTimeout(this.Wl)
                }
                ph(t) {
                    return this.cn.priceLineColor || t
                }
                Yr(t) {
                    const i = {
                            Xr: !0
                        },
                        s = this.Dt();
                    if (this.$t().St().Ni() || s.Ni() || this.zt.Ni()) return i;
                    const e = this.$t().St().Xs(),
                        n = this.Ct();
                    if (null === e || null === n) return i;
                    let h, r;
                    if (t) {
                        const t = this.zt.nl();
                        if (null === t) return i;
                        h = t, r = t.se
                    } else {
                        const t = this.zt.hl(e.ui(), -1);
                        if (null === t) return i;
                        if (h = this.zt.Zh(t.se), null === h) return i;
                        r = t.se
                    }
                    const o = h.Ot[3],
                        l = this.$s().Hs(r, {
                            Ot: h
                        }),
                        a = s.Rt(o, n.Ot);
                    return {
                        Xr: !1,
                        _t: o,
                        Zt: s.Fi(o, n.Ot),
                        Mh: s.ql(o),
                        xh: s.Yl(o, n.Ot),
                        O: l.ue,
                        ki: a,
                        se: r
                    }
                }
                $s() {
                    return null !== this.El || (this.El = new $i(this)), this.El
                }
                W() {
                    return this.cn
                }
                Hh(t) {
                    const i = t.priceScaleId;
                    void 0 !== i && i !== this.cn.priceScaleId && this.$t().Xl(this, i), E(this.cn, t), void 0 !== t.priceFormat && (this.$l(), this.$t().Kl()), this.$t().Zl(this), this.$t().Gl(), this.wn.bt("options")
                }
                J(t, i) {
                    this.zt.J(t), this.Jl(), this.wn.bt("data"), this.dn.bt("data"), null !== this.Ll && (i && i.Ql ? this.Ll.Hr() : 0 === t.length && this.Ll.jr());
                    const s = this.$t().cr(this);
                    this.$t().ta(s), this.$t().Zl(this), this.$t().Gl(), this.$t().$h()
                }
                ia(t) {
                    this.Nl = t, this.Jl();
                    const i = this.$t().cr(this);
                    this.dn.bt("data"), this.$t().ta(i), this.$t().Zl(this), this.$t().Gl(), this.$t().$h()
                }
                na() {
                    return this.Nl
                }
                uh() {
                    return this.Fl
                }
                sa(t) {
                    const i = new Ti(this, t);
                    return this.Il.push(i), this.$t().Zl(this), i
                }
                ea(t) {
                    const i = this.Il.indexOf(t); - 1 !== i && this.Il.splice(i, 1),
                        this.$t().Zl(this)
                }
                Jh() {
                    return this.Hl
                }
                Ct() {
                    const t = this.ra();
                    return null === t ? null : {
                        Ot: t.Ot[3],
                        ha: t.ot
                    }
                }
                ra() {
                    const t = this.$t().St().Xs();
                    if (null === t) return null;
                    const i = t.Os();
                    return this.zt.hl(i, 1)
                }
                In() {
                    return this.zt
                }
                fh(t) {
                    const i = this.zt.Zh(t);
                    return null === i ? null : "Bar" === this.Hl || "Candlestick" === this.Hl || "Custom" === this.Hl ? {
                        we: i.Ot[0],
                        ge: i.Ot[1],
                        Me: i.Ot[2],
                        xe: i.Ot[3]
                    } : i.Ot[3]
                }
                la(t) {
                    const i = [];
                    Ui(this.jl, Zi, "top", i);
                    const s = this.Ll;
                    return null !== s && s.yt() ? (null === this.Wl && s.Ur() && (this.Wl = setTimeout((() => {
                        this.Wl = null, this.$t().aa()
                    }), 0)), s.$r(), i.unshift(s), i) : i
                }
                Pn() {
                    const t = [];
                    this.oa() || t.push(this.zl), t.push(this.wn, this.Wh, this.dn);
                    const i = this.Il.map((t => t.Uh()));
                    return t.push(...i), Ui(this.jl, Zi, "normal", t), t
                }
                _a() {
                    return this.ua(Zi, "bottom")
                }
                ca(t) {
                    return this.ua(Ji, t)
                }
                da(t) {
                    return this.ua(Hi, t)
                }
                fa(t, i) {
                    return this.jl.map((s => s.br(t, i))).filter((t => null !== t))
                }
                Ji(t) {
                    return [this.jh, ...this.Il.map((t => t.qh()))]
                }
                Rn(t, i) {
                    if (i !== this.Yi && !this.oa()) return [];
                    const s = [...this.rn];
                    for (const t of this.Il) s.push(t.Yh());
                    return this.jl.forEach((t => {
                        s.push(...t.Rn())
                    })), s
                }
                Qi() {
                    const t = [];
                    return this.jl.forEach((i => {
                        t.push(...i.Qi())
                    })), t
                }
                Vl(t, i) {
                    if (void 0 !== this.cn.autoscaleInfoProvider) {
                        const s = this.cn.autoscaleInfoProvider((() => {
                            const s = this.va(t, i);
                            return null === s ? null : s.Ah()
                        }));
                        return _i.Bh(s)
                    }
                    return this.va(t, i)
                }
                pa() {
                    return this.cn.priceFormat.minMove
                }
                ma() {
                    return this.ba
                }
                On() {
                    var t;
                    this.wn.bt(), this.dn.bt();
                    for (const t of this.rn) t.bt();
                    for (const t of this.Il) t.bt();
                    this.Wh.bt(), this.zl.bt(), null === (t = this.Ll) || void 0 === t || t.bt(), this.jl.forEach((t => t.On()))
                }
                Dt() {
                    return w(super.Dt())
                }
                kt(t) {
                    if ("Line" !== this.Hl && "Area" !== this.Hl && "Baseline" !== this.Hl || !this.cn.crosshairMarkerVisible) return null;
                    const i = this.zt.Zh(t);
                    return null === i ? null : {
                        _t: i.Ot[3],
                        ht: this.wa(),
                        At: this.ga(),
                        Pt: this.Ma(),
                        Tt: this.xa(t)
                    }
                }
                mh() {
                    return this.cn.title
                }
                yt() {
                    return this.cn.visible
                }
                Sa(t) {
                    this.jl.push(new ji(t, this))
                }
                ka(t) {
                    this.jl = this.jl.filter((i => i.Ol() !== t))
                }
                ya() {
                    if (this.wn instanceof Kt != 0) return t => this.wn.Fe(t)
                }
                Ca() {
                    if (this.wn instanceof Kt != 0) return t => this.wn.We(t)
                }
                oa() {
                    return !ut(this.Dt().Ta())
                }
                va(t, i) {
                    if (!$(t) || !$(i) || this.zt.Ni()) return null;
                    const s = "Line" === this.Hl || "Area" === this.Hl || "Baseline" === this.Hl || "Histogram" === this.Hl ? [3] : [2, 1],
                        e = this.zt.al(t, i, s);
                    let n = null !== e ? new ki(e.pl, e.ml) : null;
                    if ("Histogram" === this.Jh()) {
                        const t = this.cn.base,
                            i = new ki(t, t);
                        n = null !== n ? n.ts(i) : i
                    }
                    let h = this.dn._h();
                    return this.jl.forEach((s => {
                        const e = s.Vl(t, i);
                        if (null == e ? void 0 : e.priceRange) {
                            const t = new ki(e.priceRange.minValue, e.priceRange.maxValue);
                            n = null !== n ? n.ts(t) : t
                        }
                        var r, o, l, a;
                        (null == e ? void 0 : e.margins) && (r = h, o = e.margins, h = {
                            above: Math.max(null !== (l = null == r ? void 0 : r.above) && void 0 !== l ? l : 0, o.above),
                            below: Math.max(null !== (a = null == r ? void 0 : r.below) && void 0 !== a ? a : 0, o.below)
                        })
                    })), new _i(n, h)
                }
                wa() {
                    switch (this.Hl) {
                        case "Line":
                        case "Area":
                        case "Baseline":
                            return this.cn.crosshairMarkerRadius
                    }
                    return 0
                }
                ga() {
                    switch (this.Hl) {
                        case "Line":
                        case "Area":
                        case "Baseline":
                            {
                                const t = this.cn.crosshairMarkerBorderColor;
                                if (0 !== t.length) return t
                            }
                    }
                    return null
                }
                Ma() {
                    switch (this.Hl) {
                        case "Line":
                        case "Area":
                        case "Baseline":
                            return this.cn.crosshairMarkerBorderWidth
                    }
                    return 0
                }
                xa(t) {
                    switch (this.Hl) {
                        case "Line":
                        case "Area":
                        case "Baseline":
                            {
                                const t = this.cn.crosshairMarkerBackgroundColor;
                                if (0 !== t.length) return t
                            }
                    }
                    return this.$s().Hs(t).ue
                }
                $l() {
                    switch (this.cn.priceFormat.type) {
                        case "custom":
                            this.ba = {
                                format: this.cn.priceFormat.formatter
                            };
                            break;
                        case "volume":
                            this.ba = new mt(this.cn.priceFormat.precision);
                            break;
                        case "percent":
                            this.ba = new pt(this.cn.priceFormat.precision);
                            break;
                        default:
                            {
                                const t = Math.pow(10, this.cn.priceFormat.precision);this.ba = new dt(t, this.cn.priceFormat.minMove * t)
                            }
                    }
                    null !== this.Yi && this.Yi.Pa()
                }
                Jl() {
                    const t = this.$t().St();
                    if (!t.Ra() || this.zt.Ni()) return void(this.Fl = []);
                    const i = w(this.zt.sl());
                    this.Fl = this.Nl.map(((s, e) => {
                        const n = w(t.Da(s.time, !0)),
                            h = n < i ? 1 : -1;
                        return {
                            time: w(this.zt.hl(n, h)).se,
                            position: s.position,
                            shape: s.shape,
                            color: s.color,
                            id: s.id,
                            Qr: e,
                            text: s.text,
                            size: s.size,
                            originalTime: s.originalTime
                        }
                    }))
                }
                Ul(t) {
                    switch (this.dn = new Si(this, this.$t()), this.Hl) {
                        case "Bar":
                            this.wn = new Vt(this, this.$t());
                            break;
                        case "Candlestick":
                            this.wn = new Jt(this, this.$t());
                            break;
                        case "Line":
                            this.wn = new qt(this, this.$t());
                            break;
                        case "Custom":
                            this.wn = new Kt(this, this.$t(), g(t));
                            break;
                        case "Area":
                            this.wn = new Ft(this, this.$t());
                            break;
                        case "Baseline":
                            this.wn = new Ut(this, this.$t());
                            break;
                        case "Histogram":
                            this.wn = new Yt(this, this.$t());
                            break;
                        default:
                            throw Error("Unknown chart style assigned: " + this.Hl)
                    }
                }
                ua(t, i) {
                    const s = [];
                    return Ui(this.jl, t, i, s), s
                }
            }
            class Gi {
                constructor(t) {
                    this.cn = t
                }
                Oa(t, i, s) {
                    let e = t;
                    if (0 === this.cn.mode) return e;
                    const n = s.vn(),
                        h = n.Ct();
                    if (null === h) return e;
                    const r = n.Rt(t, h),
                        o = s.Aa().filter((t => t instanceof Ki)).reduce(((t, e) => {
                            if (s.dr(e) || !e.yt()) return t;
                            const n = e.Dt(),
                                h = e.In();
                            if (n.Ni() || !h.Kr(i)) return t;
                            const r = h.Zh(i);
                            if (null === r) return t;
                            const o = y(e.Ct());
                            return t.concat([n.Rt(r.Ot[3], o.Ot)])
                        }), []);
                    if (0 === o.length) return e;
                    o.sort(((t, i) => Math.abs(t - r) - Math.abs(i - r)));
                    const l = o[0];
                    return e = n.pn(l, h), e
                }
            }
            class Xi extends j {
                constructor() {
                    super(...arguments), this.zt = null
                }
                J(t) {
                    this.zt = t
                }
                Z({
                    context: t,
                    bitmapSize: i,
                    horizontalPixelRatio: s,
                    verticalPixelRatio: e
                }) {
                    if (null === this.zt) return;
                    const n = Math.max(1, Math.floor(s));
                    t.lineWidth = n,
                        function(t, i) {
                            t.save(), t.lineWidth % 2 && t.translate(.5, .5), i(), t.restore()
                        }(t, (() => {
                            const h = w(this.zt);
                            if (h.Ba) {
                                t.strokeStyle = h.Va, m(t, h.Ia), t.beginPath();
                                for (const e of h.za) {
                                    const h = Math.round(e.La * s);
                                    t.moveTo(h, -n), t.lineTo(h, i.height + n)
                                }
                                t.stroke()
                            }
                            if (h.Ea) {
                                t.strokeStyle = h.Na, m(t, h.Fa), t.beginPath();
                                for (const s of h.Wa) {
                                    const h = Math.round(s.La * e);
                                    t.moveTo(-n, h), t.lineTo(i.width + n, h)
                                }
                                t.stroke()
                            }
                        }))
                }
            }
            class Yi {
                constructor(t) {
                    this.Wt = new Xi, this.ft = !0, this.tn = t
                }
                bt() {
                    this.ft = !0
                }
                gt() {
                    if (this.ft) {
                        const t = this.tn.$t().W().grid,
                            i = {
                                Ea: t.horzLines.visible,
                                Ba: t.vertLines.visible,
                                Na: t.horzLines.color,
                                Va: t.vertLines.color,
                                Fa: t.horzLines.style,
                                Ia: t.vertLines.style,
                                Wa: this.tn.vn().ja(),
                                za: (this.tn.$t().St().ja() || []).map((t => ({
                                    La: t.coord
                                })))
                            };
                        this.Wt.J(i), this.ft = !1
                    }
                    return this.Wt
                }
            }
            class qi {
                constructor(t) {
                    this.wn = new Yi(t)
                }
                Uh() {
                    return this.wn
                }
            }
            const Qi = {
                Ha: 4,
                $a: 1e-4
            };

            function ts(t, i) {
                const s = 100 * (t - i) / i;
                return i < 0 ? -s : s
            }

            function is(t, i) {
                const s = ts(t.Th(), i),
                    e = ts(t.Ph(), i);
                return new ki(s, e)
            }

            function ss(t, i) {
                const s = 100 * (t - i) / i + 100;
                return i < 0 ? -s : s
            }

            function es(t, i) {
                const s = ss(t.Th(), i),
                    e = ss(t.Ph(), i);
                return new ki(s, e)
            }

            function ns(t, i) {
                const s = Math.abs(t);
                if (s < 1e-15) return 0;
                const e = Math.log10(s + i.$a) + i.Ha;
                return t < 0 ? -e : e
            }

            function hs(t, i) {
                const s = Math.abs(t);
                if (s < 1e-15) return 0;
                const e = Math.pow(10, s - i.Ha) - i.$a;
                return t < 0 ? -e : e
            }

            function rs(t, i) {
                if (null === t) return null;
                const s = ns(t.Th(), i),
                    e = ns(t.Ph(), i);
                return new ki(s, e)
            }

            function os(t, i) {
                if (null === t) return null;
                const s = hs(t.Th(), i),
                    e = hs(t.Ph(), i);
                return new ki(s, e)
            }

            function ls(t) {
                if (null === t) return Qi;
                const i = Math.abs(t.Ph() - t.Th());
                if (i >= 1 || i < 1e-15) return Qi;
                const s = Math.ceil(Math.abs(Math.log10(i))),
                    e = Qi.Ha + s;
                return {
                    Ha: e,
                    $a: 1 / Math.pow(10, e)
                }
            }
            class as {
                constructor(t, i) {
                    if (this.Ua = t, this.qa = i, function(t) {
                            if (t < 0) return !1;
                            for (let i = t; i > 1; i /= 10)
                                if (i % 10 != 0) return !1;
                            return !0
                        }(this.Ua)) this.Ya = [2, 2.5, 2];
                    else {
                        this.Ya = [];
                        for (let t = this.Ua; 1 !== t;) {
                            if (t % 2 == 0) this.Ya.push(2), t /= 2;
                            else {
                                if (t % 5 != 0) throw new Error("unexpected base");
                                this.Ya.push(2, 2.5), t /= 5
                            }
                            if (this.Ya.length > 100) throw new Error("something wrong with base")
                        }
                    }
                }
                Xa(t, i, s) {
                    const e = 0 === this.Ua ? 0 : 1 / this.Ua;
                    let n = Math.pow(10, Math.max(0, Math.ceil(Math.log10(t - i)))),
                        h = 0,
                        r = this.qa[0];
                    for (;;) {
                        const t = Ct(n, e, 1e-14) && n > e + 1e-14,
                            i = Ct(n, s * r, 1e-14),
                            o = Ct(n, 1, 1e-14);
                        if (!(t && i && o)) break;
                        n /= r, r = this.qa[++h % this.qa.length]
                    }
                    if (n <= e + 1e-14 && (n = e), n = Math.max(1, n), this.Ya.length > 0 && (o = n, 1, 1e-14, Math.abs(o - 1) < 1e-14))
                        for (h = 0, r = this.Ya[0]; Ct(n, s * r, 1e-14) && n > e + 1e-14;) n /= r, r = this.Ya[++h % this.Ya.length];
                    var o;
                    return n
                }
            }
            class us {
                constructor(t, i, s, e) {
                    this.Ka = [], this.Li = t, this.Ua = i, this.Za = s, this.Ga = e
                }
                Xa(t, i) {
                    if (t < i) throw new Error("high < low");
                    const s = this.Li.Vt(),
                        e = (t - i) * this.Ja() / s,
                        n = new as(this.Ua, [2, 2.5, 2]),
                        h = new as(this.Ua, [2, 2, 2.5]),
                        r = new as(this.Ua, [2.5, 2, 2]),
                        o = [];
                    return o.push(n.Xa(t, i, e), h.Xa(t, i, e), r.Xa(t, i, e)),
                        function(t) {
                            if (t.length < 1) throw Error("array is empty");
                            let i = t[0];
                            for (let s = 1; s < t.length; ++s) t[s] < i && (i = t[s]);
                            return i
                        }(o)
                }
                Qa() {
                    const t = this.Li,
                        i = t.Ct();
                    if (null === i) return void(this.Ka = []);
                    const s = t.Vt(),
                        e = this.Za(s - 1, i),
                        n = this.Za(0, i),
                        h = this.Li.W().entireTextOnly ? this.io() / 2 : 0,
                        r = h,
                        o = s - 1 - h,
                        l = Math.max(e, n),
                        a = Math.min(e, n);
                    if (l === a) return void(this.Ka = []);
                    let u = this.Xa(l, a),
                        c = l % u;
                    c += c < 0 ? u : 0;
                    const f = l >= a ? 1 : -1;
                    let d = null,
                        p = 0;
                    for (let s = l - c; s > a; s -= u) {
                        const e = this.Ga(s, i, !0);
                        null !== d && Math.abs(e - d) < this.Ja() || e < r || e > o || (p < this.Ka.length ? (this.Ka[p].La = e, this.Ka[p].no = t.so(s)) : this.Ka.push({
                            La: e,
                            no: t.so(s)
                        }), p++, d = e, t.eo() && (u = this.Xa(s * f, a)))
                    }
                    this.Ka.length = p
                }
                ja() {
                    return this.Ka
                }
                io() {
                    return this.Li.P()
                }
                Ja() {
                    return Math.ceil(2.5 * this.io())
                }
            }

            function cs(t) {
                return t.slice().sort(((t, i) => w(t.Ki()) - w(i.Ki())))
            }
            var fs;
            ! function(t) {
                t[t.Normal = 0] = "Normal", t[t.Logarithmic = 1] = "Logarithmic", t[t.Percentage = 2] = "Percentage", t[t.IndexedTo100 = 3] = "IndexedTo100"
            }(fs || (fs = {}));
            const ds = new pt,
                ps = new dt(100, 1);
            class ms {
                constructor(t, i, s, e) {
                    this.ro = 0, this.ho = null, this.Vh = null, this.lo = null, this.ao = {
                            oo: !1,
                            _o: null
                        }, this.uo = 0, this.co = 0, this.do = new T, this.fo = new T,
                        this.vo = [], this.po = null, this.mo = null, this.bo = null, this.wo = null, this.ba = ps, this.Mo = ls(null), this.xo = t, this.cn = i, this.So = s, this.ko = e, this.yo = new us(this, 100, this.Co.bind(this), this.To.bind(this))
                }
                Ta() {
                    return this.xo
                }
                W() {
                    return this.cn
                }
                Hh(t) {
                    if (E(this.cn, t), this.Pa(), void 0 !== t.mode && this.Po({
                            yr: t.mode
                        }), void 0 !== t.scaleMargins) {
                        const i = g(t.scaleMargins.top),
                            s = g(t.scaleMargins.bottom);
                        if (i < 0 || i > 1) throw new Error(`Invalid top margin - expect value between 0 and 1, given=${i}`);
                        if (s < 0 || s > 1) throw new Error(`Invalid bottom margin - expect value between 0 and 1, given=${s}`);
                        if (i + s > 1) throw new Error(`Invalid margins - sum of margins must be less than 1, given=${i+s}`);
                        this.Ro(), this.mo = null
                    }
                }
                Do() {
                    return this.cn.autoScale
                }
                eo() {
                    return 1 === this.cn.mode
                }
                gh() {
                    return 2 === this.cn.mode
                }
                Oo() {
                    return 3 === this.cn.mode
                }
                yr() {
                    return {
                        Wn: this.cn.autoScale,
                        Ao: this.cn.invertScale,
                        yr: this.cn.mode
                    }
                }
                Po(t) {
                    const i = this.yr();
                    let s = null;
                    void 0 !== t.Wn && (this.cn.autoScale = t.Wn), void 0 !== t.yr && (this.cn.mode = t.yr, 2 !== t.yr && 3 !== t.yr || (this.cn.autoScale = !0), this.ao.oo = !1), 1 === i.yr && t.yr !== i.yr && (function(t, i) {
                        if (null === t) return !1;
                        const s = hs(t.Th(), i),
                            e = hs(t.Ph(), i);
                        return isFinite(s) && isFinite(e)
                    }(this.Vh, this.Mo) ? (s = os(this.Vh, this.Mo), null !== s && this.Bo(s)) : this.cn.autoScale = !0), 1 === t.yr && t.yr !== i.yr && (s = rs(this.Vh, this.Mo), null !== s && this.Bo(s));
                    const e = i.yr !== this.cn.mode;
                    e && (2 === i.yr || this.gh()) && this.Pa(), e && (3 === i.yr || this.Oo()) && this.Pa(), void 0 !== t.Ao && i.Ao !== t.Ao && (this.cn.invertScale = t.Ao, this.Vo()), this.fo.m(i, this.yr())
                }
                Io() {
                    return this.fo
                }
                P() {
                    return this.So.fontSize
                }
                Vt() {
                    return this.ro
                }
                zo(t) {
                    this.ro !== t && (this.ro = t, this.Ro(), this.mo = null)
                }
                Lo() {
                    if (this.ho) return this.ho;
                    const t = this.Vt() - this.Eo() - this.No();
                    return this.ho = t, t
                }
                zh() {
                    return this.Fo(), this.Vh
                }
                Bo(t, i) {
                    const s = this.Vh;
                    (i || null === s && null !== t || null !== s && !s.yh(t)) && (this.mo = null, this.Vh = t)
                }
                Ni() {
                    return this.Fo(), 0 === this.ro || !this.Vh || this.Vh.Ni()
                }
                Wo(t) {
                    return this.Ao() ? t : this.Vt() - 1 - t
                }
                Rt(t, i) {
                    return this.gh() ? t = ts(t, i) : this.Oo() && (t = ss(t, i)), this.To(t, i)
                }
                Qs(t, i, s) {
                    this.Fo();
                    const e = this.No(),
                        n = w(this.zh()),
                        h = n.Th(),
                        r = n.Ph(),
                        o = this.Lo() - 1,
                        l = this.Ao(),
                        a = o / (r - h),
                        u = void 0 === s ? 0 : s.from,
                        c = void 0 === s ? t.length : s.to,
                        f = this.jo();
                    for (let s = u; s < c; s++) {
                        const n = t[s],
                            r = n._t;
                        if (isNaN(r)) continue;
                        let o = r;
                        null !== f && (o = f(n._t, i));
                        const u = e + a * (o - h),
                            c = l ? u : this.ro - 1 - u;
                        n.st = c
                    }
                }
                me(t, i, s) {
                    this.Fo();
                    const e = this.No(),
                        n = w(this.zh()),
                        h = n.Th(),
                        r = n.Ph(),
                        o = this.Lo() - 1,
                        l = this.Ao(),
                        a = o / (r - h),
                        u = void 0 === s ? 0 : s.from,
                        c = void 0 === s ? t.length : s.to,
                        f = this.jo();
                    for (let s = u; s < c; s++) {
                        const n = t[s];
                        let r = n.we,
                            o = n.ge,
                            u = n.Me,
                            c = n.xe;
                        null !== f && (r = f(n.we, i), o = f(n.ge, i), u = f(n.Me, i), c = f(n.xe, i));
                        let d = e + a * (r - h),
                            p = l ? d : this.ro - 1 - d;
                        n.ve = p, d = e + a * (o - h), p = l ? d : this.ro - 1 - d, n.ce = p, d = e + a * (u - h), p = l ? d : this.ro - 1 - d, n.de = p, d = e + a * (c - h), p = l ? d : this.ro - 1 - d, n.pe = p
                    }
                }
                pn(t, i) {
                    const s = this.Co(t, i);
                    return this.Ho(s, i)
                }
                Ho(t, i) {
                    let s = t;
                    return this.gh() ? s = function(t, i) {
                        return i < 0 && (t = -t), t / 100 * i + i
                    }(s, i) : this.Oo() && (s = function(t, i) {
                        return t -= 100, i < 0 && (t = -t), t / 100 * i + i
                    }(s, i)), s
                }
                Aa() {
                    return this.vo
                }
                $o() {
                    if (this.po) return this.po;
                    let t = [];
                    for (let i = 0; i < this.vo.length; i++) {
                        const s = this.vo[i];
                        null === s.Ki() && s.Zi(i + 1), t.push(s)
                    }
                    return t = cs(t), this.po = t, this.po
                }
                Uo(t) {
                    -1 === this.vo.indexOf(t) && (this.vo.push(t), this.Pa(), this.qo())
                }
                Yo(t) {
                    const i = this.vo.indexOf(t);
                    if (-1 === i) throw new Error("source is not attached to scale");
                    this.vo.splice(i, 1), 0 === this.vo.length && (this.Po({
                        Wn: !0
                    }), this.Bo(null)), this.Pa(), this.qo()
                }
                Ct() {
                    let t = null;
                    for (const i of this.vo) {
                        const s = i.Ct();
                        null !== s && (null === t || s.ha < t.ha) && (t = s)
                    }
                    return null === t ? null : t.Ot
                }
                Ao() {
                    return this.cn.invertScale
                }
                ja() {
                    const t = null === this.Ct();
                    if (null !== this.mo && (t || this.mo.Xo === t)) return this.mo.ja;
                    this.yo.Qa();
                    const i = this.yo.ja();
                    return this.mo = {
                        ja: i,
                        Xo: t
                    }, this.do.m(), i
                }
                Ko() {
                    return this.do
                }
                Zo(t) {
                    this.gh() || this.Oo() || null === this.bo && null === this.lo && (this.Ni() || (this.bo = this.ro - t, this.lo = w(this.zh()).Ch()))
                }
                Go(t) {
                    if (this.gh() || this.Oo()) return;
                    if (null === this.bo) return;
                    this.Po({
                        Wn: !1
                    }), (t = this.ro - t) < 0 && (t = 0);
                    let i = (this.bo + .2 * (this.ro - 1)) / (t + .2 * (this.ro - 1));
                    const s = w(this.lo).Ch();
                    i = Math.max(i, .1), s.Dh(i), this.Bo(s)
                }
                Jo() {
                    this.gh() || this.Oo() || (this.bo = null, this.lo = null)
                }
                Qo(t) {
                    this.Do() || null === this.wo && null === this.lo && (this.Ni() || (this.wo = t, this.lo = w(this.zh()).Ch()))
                }
                t_(t) {
                    if (this.Do()) return;
                    if (null === this.wo) return;
                    const i = w(this.zh()).Rh() / (this.Lo() - 1);
                    let s = t - this.wo;
                    this.Ao() && (s *= -1);
                    const e = s * i,
                        n = w(this.lo).Ch();
                    n.Oh(e), this.Bo(n, !0), this.mo = null
                }
                i_() {
                    this.Do() || null !== this.wo && (this.wo = null, this.lo = null)
                }
                ma() {
                    return this.ba || this.Pa(), this.ba
                }
                Fi(t, i) {
                    switch (this.cn.mode) {
                        case 2:
                            return this.n_(ts(t, i));
                        case 3:
                            return this.ma().format(ss(t, i));
                        default:
                            return this.Fh(t)
                    }
                }
                so(t) {
                    switch (this.cn.mode) {
                        case 2:
                            return this.n_(t);
                        case 3:
                            return this.ma().format(t);
                        default:
                            return this.Fh(t)
                    }
                }
                ql(t) {
                    return this.Fh(t, w(this.s_()).ma())
                }
                Yl(t, i) {
                    return t = ts(t, i), this.n_(t, ds)
                }
                e_() {
                    return this.vo
                }
                r_(t) {
                    this.ao = {
                        _o: t,
                        oo: !1
                    }
                }
                On() {
                    this.vo.forEach((t => t.On()))
                }
                Pa() {
                    this.mo = null;
                    const t = this.s_();
                    let i = 100;
                    null !== t && (i = Math.round(1 / t.pa())), this.ba = ps, this.gh() ? (this.ba = ds, i = 100) : this.Oo() ? (this.ba = new dt(100, 1), i = 100) : null !== t && (this.ba = t.ma()), this.yo = new us(this, i, this.Co.bind(this), this.To.bind(this)), this.yo.Qa()
                }
                qo() {
                    this.po = null
                }
                s_() {
                    return this.vo[0] || null
                }
                Eo() {
                    return this.Ao() ? this.cn.scaleMargins.bottom * this.Vt() + this.co : this.cn.scaleMargins.top * this.Vt() + this.uo
                }
                No() {
                    return this.Ao() ? this.cn.scaleMargins.top * this.Vt() + this.uo : this.cn.scaleMargins.bottom * this.Vt() + this.co
                }
                Fo() {
                    this.ao.oo || (this.ao.oo = !0, this.h_())
                }
                Ro() {
                    this.ho = null
                }
                To(t, i) {
                    if (this.Fo(), this.Ni()) return 0;
                    t = this.eo() && t ? ns(t, this.Mo) : t;
                    const s = w(this.zh()),
                        e = this.No() + (this.Lo() - 1) * (t - s.Th()) / s.Rh();
                    return this.Wo(e)
                }
                Co(t, i) {
                    if (this.Fo(), this.Ni()) return 0;
                    const s = this.Wo(t),
                        e = w(this.zh()),
                        n = e.Th() + e.Rh() * ((s - this.No()) / (this.Lo() - 1));
                    return this.eo() ? hs(n, this.Mo) : n
                }
                Vo() {
                    this.mo = null, this.yo.Qa()
                }
                h_() {
                    const t = this.ao._o;
                    if (null === t) return;
                    let i = null;
                    const s = this.e_();
                    let e = 0,
                        n = 0;
                    for (const h of s) {
                        if (!h.yt()) continue;
                        const s = h.Ct();
                        if (null === s) continue;
                        const r = h.Vl(t.Os(), t.ui());
                        let o = r && r.zh();
                        if (null !== o) {
                            switch (this.cn.mode) {
                                case 1:
                                    o = rs(o, this.Mo);
                                    break;
                                case 2:
                                    o = is(o, s.Ot);
                                    break;
                                case 3:
                                    o = es(o, s.Ot)
                            }
                            if (i = null === i ? o : i.ts(w(o)), null !== r) {
                                const t = r.Lh();
                                null !== t && (e = Math.max(e, t.above), n = Math.max(n, t.below))
                            }
                        }
                    }
                    if (e === this.uo && n === this.co || (this.uo = e, this.co = n, this.mo = null, this.Ro()), null !== i) {
                        if (i.Th() === i.Ph()) {
                            const t = this.s_(),
                                s = 5 * (null === t || this.gh() || this.Oo() ? 1 : t.pa());
                            this.eo() && (i = os(i, this.Mo)), i = new ki(i.Th() - s, i.Ph() + s), this.eo() && (i = rs(i, this.Mo))
                        }
                        if (this.eo()) {
                            const t = os(i, this.Mo),
                                s = ls(t);
                            if (h = s, r = this.Mo, h.Ha !== r.Ha || h.$a !== r.$a) {
                                const e = null !== this.lo ? os(this.lo, this.Mo) : null;
                                this.Mo = s, i = rs(t, s), null !== e && (this.lo = rs(e, s))
                            }
                        }
                        this.Bo(i)
                    } else null === this.Vh && (this.Bo(new ki(-.5, .5)), this.Mo = ls(null));
                    var h, r;
                    this.ao.oo = !0
                }
                jo() {
                    return this.gh() ? ts : this.Oo() ? ss : this.eo() ? t => ns(t, this.Mo) : null
                }
                l_(t, i, s) {
                    return void 0 === i ? (void 0 === s && (s = this.ma()), s.format(t)) : i(t)
                }
                Fh(t, i) {
                    return this.l_(t, this.ko.priceFormatter, i)
                }
                n_(t, i) {
                    return this.l_(t, this.ko.percentageFormatter, i)
                }
            }
            class vs {
                constructor(t, i) {
                    this.vo = [], this.a_ = new Map, this.ro = 0, this.o_ = 0, this.__ = 1e3, this.po = null, this.u_ = new T, this.kl = t, this.$i = i, this.c_ = new qi(this);
                    const s = i.W();
                    this.d_ = this.f_("left", s.leftPriceScale), this.v_ = this.f_("right", s.rightPriceScale), this.d_.Io().l(this.p_.bind(this, this.d_), this), this.v_.Io().l(this.p_.bind(this, this.v_), this), this.m_(s)
                }
                m_(t) {
                    if (t.leftPriceScale && this.d_.Hh(t.leftPriceScale), t.rightPriceScale && this.v_.Hh(t.rightPriceScale), t.localization && (this.d_.Pa(), this.v_.Pa()), t.overlayPriceScales) {
                        const i = Array.from(this.a_.values());
                        for (const s of i) {
                            const i = w(s[0].Dt());
                            i.Hh(t.overlayPriceScales), t.localization && i.Pa()
                        }
                    }
                }
                b_(t) {
                    switch (t) {
                        case "left":
                            return this.d_;
                        case "right":
                            return this.v_
                    }
                    return this.a_.has(t) ? g(this.a_.get(t))[0].Dt() : null
                }
                S() {
                    this.$t().w_().p(this), this.d_.Io().p(this), this.v_.Io().p(this), this.vo.forEach((t => {
                        t.S && t.S()
                    })), this.u_.m()
                }
                g_() {
                    return this.__
                }
                M_(t) {
                    this.__ = t
                }
                $t() {
                    return this.$i
                }
                Hi() {
                    return this.o_
                }
                Vt() {
                    return this.ro
                }
                x_(t) {
                    this.o_ = t, this.S_()
                }
                zo(t) {
                    this.ro = t, this.d_.zo(t), this.v_.zo(t), this.vo.forEach((i => {
                        if (this.dr(i)) {
                            const s = i.Dt();
                            null !== s && s.zo(t)
                        }
                    })), this.S_()
                }
                Aa() {
                    return this.vo
                }
                dr(t) {
                    const i = t.Dt();
                    return null === i || this.d_ !== i && this.v_ !== i
                }
                Uo(t, i, s) {
                    const e = void 0 !== s ? s : this.y_().k_ + 1;
                    this.C_(t, i, e)
                }
                Yo(t) {
                    const i = this.vo.indexOf(t);
                    b(-1 !== i, "removeDataSource: invalid data source"), this.vo.splice(i, 1);
                    const s = w(t.Dt()).Ta();
                    if (this.a_.has(s)) {
                        const i = g(this.a_.get(s)),
                            e = i.indexOf(t); - 1 !== e && (i.splice(e, 1), 0 === i.length && this.a_.delete(s))
                    }
                    const e = t.Dt();
                    e && e.Aa().indexOf(t) >= 0 && e.Yo(t), null !== e && (e.qo(), this.T_(e)), this.po = null
                }
                pr(t) {
                    return t === this.d_ ? "left" : t === this.v_ ? "right" : "overlay"
                }
                P_() {
                    return this.d_
                }
                R_() {
                    return this.v_
                }
                D_(t, i) {
                    t.Zo(i)
                }
                O_(t, i) {
                    t.Go(i), this.S_()
                }
                A_(t) {
                    t.Jo()
                }
                B_(t, i) {
                    t.Qo(i)
                }
                V_(t, i) {
                    t.t_(i), this.S_()
                }
                I_(t) {
                    t.i_()
                }
                S_() {
                    this.vo.forEach((t => {
                        t.On()
                    }))
                }
                vn() {
                    let t = null;
                    return this.$i.W().rightPriceScale.visible && 0 !== this.v_.Aa().length ? t = this.v_ : this.$i.W().leftPriceScale.visible && 0 !== this.d_.Aa().length ? t = this.d_ : 0 !== this.vo.length && (t = this.vo[0].Dt()), null === t && (t = this.v_), t
                }
                vr() {
                    let t = null;
                    return this.$i.W().rightPriceScale.visible ? t = this.v_ : this.$i.W().leftPriceScale.visible && (t = this.d_), t
                }
                T_(t) {
                    null !== t && t.Do() && this.z_(t)
                }
                L_(t) {
                    const i = this.kl.Xs();
                    t.Po({
                        Wn: !0
                    }), null !== i && t.r_(i), this.S_()
                }
                E_() {
                    this.z_(this.d_), this.z_(this.v_)
                }
                N_() {
                    this.T_(this.d_), this.T_(this.v_), this.vo.forEach((t => {
                        this.dr(t) && this.T_(t.Dt())
                    })), this.S_(), this.$i.$h()
                }
                $o() {
                    return null === this.po && (this.po = cs(this.vo)), this.po
                }
                F_() {
                    return this.u_
                }
                W_() {
                    return this.c_
                }
                z_(t) {
                    const i = t.e_();
                    if (i && i.length > 0 && !this.kl.Ni()) {
                        const i = this.kl.Xs();
                        null !== i && t.r_(i)
                    }
                    t.On()
                }
                y_() {
                    const t = this.$o();
                    if (0 === t.length) return {
                        j_: 0,
                        k_: 0
                    };
                    let i = 0,
                        s = 0;
                    for (let e = 0; e < t.length; e++) {
                        const n = t[e].Ki();
                        null !== n && (n < i && (i = n), n > s && (s = n))
                    }
                    return {
                        j_: i,
                        k_: s
                    }
                }
                C_(t, i, s) {
                    let e = this.b_(i);
                    if (null === e && (e = this.f_(i, this.$i.W().overlayPriceScales)), this.vo.push(t), !ut(i)) {
                        const s = this.a_.get(i) || [];
                        s.push(t), this.a_.set(i, s)
                    }
                    e.Uo(t), t.Gi(e), t.Zi(s), this.T_(e), this.po = null
                }
                p_(t, i, s) {
                    i.yr !== s.yr && this.z_(t)
                }
                f_(t, i) {
                    const s = Object.assign({
                            visible: !0,
                            autoScale: !0
                        }, R(i)),
                        e = new ms(t, s, this.$i.W().layout, this.$i.W().localization);
                    return e.zo(this.Vt()), e
                }
            }
            class bs {
                constructor(t, i, s = 50) {
                    this.Ke = 0, this.Ze = 1, this.Ge = 1, this.Qe = new Map, this.Je = new Map, this.H_ = t, this.U_ = i, this.tr = s
                }
                q_(t) {
                    const i = t.time,
                        s = this.U_.cacheKey(i),
                        e = this.Qe.get(s);
                    if (void 0 !== e) return e.Y_;
                    if (this.Ke === this.tr) {
                        const t = this.Je.get(this.Ge);
                        this.Je.delete(this.Ge), this.Qe.delete(g(t)), this.Ge++, this.Ke--
                    }
                    const n = this.H_(t);
                    return this.Qe.set(s, {
                        Y_: n,
                        er: this.Ze
                    }), this.Je.set(this.Ze, s), this.Ke++, this.Ze++, n
                }
            }
            class gs {
                constructor(t, i) {
                    b(t <= i, "right should be >= left"), this.X_ = t, this.K_ = i
                }
                Os() {
                    return this.X_
                }
                ui() {
                    return this.K_
                }
                Z_() {
                    return this.K_ - this.X_ + 1
                }
                Kr(t) {
                    return this.X_ <= t && t <= this.K_
                }
                yh(t) {
                    return this.X_ === t.Os() && this.K_ === t.ui()
                }
            }

            function ws(t, i) {
                return null === t || null === i ? t === i : t.yh(i)
            }
            class ys {
                constructor() {
                    this.G_ = new Map, this.Qe = null, this.J_ = !1
                }
                Q_(t) {
                    this.J_ = t, this.Qe = null
                }
                tu(t, i) {
                    this.iu(i), this.Qe = null;
                    for (let s = i; s < t.length; ++s) {
                        const i = t[s];
                        let e = this.G_.get(i.timeWeight);
                        void 0 === e && (e = [], this.G_.set(i.timeWeight, e)), e.push({
                            index: s,
                            time: i.time,
                            weight: i.timeWeight,
                            originalTime: i.originalTime
                        })
                    }
                }
                nu(t, i) {
                    const s = Math.ceil(i / t);
                    return null !== this.Qe && this.Qe.su === s || (this.Qe = {
                        ja: this.eu(s),
                        su: s
                    }), this.Qe.ja
                }
                iu(t) {
                    if (0 === t) return void this.G_.clear();
                    const i = [];
                    this.G_.forEach(((s, e) => {
                        t <= s[0].index ? i.push(e) : s.splice(Et(s, t, (i => i.index < t)), 1 / 0)
                    }));
                    for (const t of i) this.G_.delete(t)
                }
                eu(t) {
                    let i = [];
                    for (const s of Array.from(this.G_.keys()).sort(((t, i) => i - t))) {
                        if (!this.G_.get(s)) continue;
                        const e = i;
                        i = [];
                        const n = e.length;
                        let h = 0;
                        const r = g(this.G_.get(s)),
                            o = r.length;
                        let l = 1 / 0,
                            a = -1 / 0;
                        for (let s = 0; s < o; s++) {
                            const o = r[s],
                                u = o.index;
                            for (; h < n;) {
                                const t = e[h],
                                    s = t.index;
                                if (!(s < u)) {
                                    l = s;
                                    break
                                }
                                h++, i.push(t), a = s, l = 1 / 0
                            }
                            if (l - u >= t && u - a >= t) i.push(o), a = u;
                            else if (this.J_) return e
                        }
                        for (; h < n; h++) i.push(e[h])
                    }
                    return i
                }
            }
            class Ms {
                constructor(t) {
                    this.ru = t
                }
                hu() {
                    return null === this.ru ? null : new gs(Math.floor(this.ru.Os()), Math.ceil(this.ru.ui()))
                }
                lu() {
                    return this.ru
                }
                static au() {
                    return new Ms(null)
                }
            }

            function Ss(t, i) {
                return t.weight > i.weight ? t : i
            }
            class Cs {
                constructor(t, i, s, e) {
                    this.o_ = 0, this.ou = null, this._u = [], this.wo = null, this.bo = null, this.uu = new ys, this.cu = new Map, this.du = Ms.au(), this.fu = !0, this.vu = new T, this.pu = new T, this.mu = new T, this.bu = null, this.wu = null, this.gu = [], this.cn = i, this.ko = s, this.Mu = i.rightOffset, this.xu = i.barSpacing, this.$i = t, this.U_ = e, this.Su(), this.uu.Q_(i.uniformDistribution)
                }
                W() {
                    return this.cn
                }
                ku(t) {
                    E(this.ko, t), this.yu(), this.Su()
                }
                Hh(t, i) {
                    var s;
                    E(this.cn, t), this.cn.fixLeftEdge && this.Cu(), this.cn.fixRightEdge && this.Tu(), void 0 !== t.barSpacing && this.$i.Gn(t.barSpacing), void 0 !== t.rightOffset && this.$i.Jn(t.rightOffset), void 0 !== t.minBarSpacing && this.$i.Gn(null !== (s = t.barSpacing) && void 0 !== s ? s : this.xu), this.yu(), this.Su(), this.mu.m()
                }
                mn(t) {
                    var i, s;
                    return null !== (s = null === (i = this._u[t]) || void 0 === i ? void 0 : i.time) && void 0 !== s ? s : null
                }
                Ui(t) {
                    var i;
                    return null !== (i = this._u[t]) && void 0 !== i ? i : null
                }
                Da(t, i) {
                    if (this._u.length < 1) return null;
                    if (this.U_.key(t) > this.U_.key(this._u[this._u.length - 1].time)) return i ? this._u.length - 1 : null;
                    const s = Et(this._u, this.U_.key(t), ((t, i) => this.U_.key(t.time) < i));
                    return this.U_.key(t) < this.U_.key(this._u[s].time) ? i ? s : null : s
                }
                Ni() {
                    return 0 === this.o_ || 0 === this._u.length || null === this.ou
                }
                Ra() {
                    return this._u.length > 0
                }
                Xs() {
                    return this.Pu(), this.du.hu()
                }
                Ru() {
                    return this.Pu(), this.du.lu()
                }
                Du() {
                    const t = this.Xs();
                    if (null === t) return null;
                    const i = {
                        from: t.Os(),
                        to: t.ui()
                    };
                    return this.Ou(i)
                }
                Ou(t) {
                    const i = Math.round(t.from),
                        s = Math.round(t.to),
                        e = w(this.Au()),
                        n = w(this.Bu());
                    return {
                        from: w(this.Ui(Math.max(e, i))),
                        to: w(this.Ui(Math.min(n, s)))
                    }
                }
                Vu(t) {
                    return {
                        from: w(this.Da(t.from, !0)),
                        to: w(this.Da(t.to, !0))
                    }
                }
                Hi() {
                    return this.o_
                }
                x_(t) {
                    if (!isFinite(t) || t <= 0) return;
                    if (this.o_ === t) return;
                    const i = this.Ru(),
                        s = this.o_;
                    if (this.o_ = t, this.fu = !0, this.cn.lockVisibleTimeRangeOnResize && 0 !== s) {
                        const i = this.xu * t / s;
                        this.xu = i
                    }
                    if (this.cn.fixLeftEdge && null !== i && i.Os() <= 0) {
                        const i = s - t;
                        this.Mu -= Math.round(i / this.xu) + 1, this.fu = !0
                    }
                    this.Iu(), this.zu()
                }
                It(t) {
                    if (this.Ni() || !$(t)) return 0;
                    const i = this.Lu() + this.Mu - t;
                    return this.o_ - (i + .5) * this.xu - 1
                }
                Js(t, i) {
                    const s = this.Lu(),
                        e = void 0 === i ? 0 : i.from,
                        n = void 0 === i ? t.length : i.to;
                    for (let i = e; i < n; i++) {
                        const e = t[i].ot,
                            n = s + this.Mu - e,
                            h = this.o_ - (n + .5) * this.xu - 1;
                        t[i].nt = h
                    }
                }
                Eu(t) {
                    return Math.ceil(this.Nu(t))
                }
                Jn(t) {
                    this.fu = !0, this.Mu = t, this.zu(), this.$i.Fu(), this.$i.$h()
                }
                he() {
                    return this.xu
                }
                Gn(t) {
                    this.Wu(t), this.zu(), this.$i.Fu(), this.$i.$h()
                }
                ju() {
                    return this.Mu
                }
                ja() {
                    if (this.Ni()) return null;
                    if (null !== this.wu) return this.wu;
                    const t = this.xu,
                        i = 5 * (this.$i.W().layout.fontSize + 4) / 8 * (this.cn.tickMarkMaxCharacterLength || 8),
                        s = Math.round(i / t),
                        e = w(this.Xs()),
                        n = Math.max(e.Os(), e.Os() - s),
                        h = Math.max(e.ui(), e.ui() - s),
                        r = this.uu.nu(t, i),
                        o = this.Au() + s,
                        l = this.Bu() - s,
                        a = this.Hu(),
                        u = this.cn.fixLeftEdge || a,
                        c = this.cn.fixRightEdge || a;
                    let f = 0;
                    for (const t of r) {
                        if (!(n <= t.index && t.index <= h)) continue;
                        let s;
                        f < this.gu.length ? (s = this.gu[f], s.coord = this.It(t.index), s.label = this.$u(t), s.weight = t.weight) : (s = {
                                needAlignCoordinate: !1,
                                coord: this.It(t.index),
                                label: this.$u(t),
                                weight: t.weight
                            }, this.gu.push(s)),
                            this.xu > i / 2 && !a ? s.needAlignCoordinate = !1 : s.needAlignCoordinate = u && t.index <= o || c && t.index >= l, f++
                    }
                    return this.gu.length = f, this.wu = this.gu, this.gu
                }
                Uu() {
                    this.fu = !0, this.Gn(this.cn.barSpacing), this.Jn(this.cn.rightOffset)
                }
                qu(t) {
                    this.fu = !0, this.ou = t, this.zu(), this.Cu()
                }
                Yu(t, i) {
                    const s = this.Nu(t),
                        e = this.he(),
                        n = e + i * (e / 10);
                    this.Gn(n), this.cn.rightBarStaysOnScroll || this.Jn(this.ju() + (s - this.Nu(t)))
                }
                Zo(t) {
                    this.wo && this.i_(), null === this.bo && null === this.bu && (this.Ni() || (this.bo = t, this.Xu()))
                }
                Go(t) {
                    if (null === this.bu) return;
                    const i = St(this.o_ - t, 0, this.o_),
                        s = St(this.o_ - w(this.bo), 0, this.o_);
                    0 !== i && 0 !== s && this.Gn(this.bu.he * i / s)
                }
                Jo() {
                    null !== this.bo && (this.bo = null, this.Ku())
                }
                Qo(t) {
                    null === this.wo && null === this.bu && (this.Ni() || (this.wo = t, this.Xu()))
                }
                t_(t) {
                    if (null === this.wo) return;
                    const i = (this.wo - t) / this.he();
                    this.Mu = w(this.bu).ju + i, this.fu = !0, this.zu()
                }
                i_() {
                    null !== this.wo && (this.wo = null, this.Ku())
                }
                Zu() {
                    this.Gu(this.cn.rightOffset)
                }
                Gu(t, i = 400) {
                    if (!isFinite(t)) throw new RangeError("offset is required and must be finite number");
                    if (!isFinite(i) || i <= 0) throw new RangeError("animationDuration (optional) must be finite positive number");
                    const s = this.Mu,
                        e = performance.now();
                    this.$i.Xn({
                        Ju: t => (t - e) / i >= 1,
                        Qu: n => {
                            const h = (n - e) / i;
                            return h >= 1 ? t : s + (t - s) * h
                        }
                    })
                }
                bt(t, i) {
                    this.fu = !0, this._u = t, this.uu.tu(t, i), this.zu()
                }
                tc() {
                    return this.vu
                }
                nc() {
                    return this.pu
                }
                sc() {
                    return this.mu
                }
                Lu() {
                    return this.ou || 0
                }
                ec(t) {
                    const i = t.Z_();
                    this.Wu(this.o_ / i), this.Mu = t.ui() - this.Lu(), this.zu(), this.fu = !0, this.$i.Fu(), this.$i.$h()
                }
                rc() {
                    const t = this.Au(),
                        i = this.Bu();
                    null !== t && null !== i && this.ec(new gs(t, i + this.cn.rightOffset))
                }
                hc(t) {
                    const i = new gs(t.from, t.to);
                    this.ec(i)
                }
                qi(t) {
                    return void 0 !== this.ko.timeFormatter ? this.ko.timeFormatter(t.originalTime) : this.U_.formatHorzItem(t.time)
                }
                Hu() {
                    const {
                        handleScroll: t,
                        handleScale: i
                    } = this.$i.W();
                    return !(t.horzTouchDrag || t.mouseWheel || t.pressedMouseMove || t.vertTouchDrag || i.axisDoubleClickReset.time || i.axisPressedMouseMove.time || i.mouseWheel || i.pinch)
                }
                Au() {
                    return 0 === this._u.length ? null : 0
                }
                Bu() {
                    return 0 === this._u.length ? null : this._u.length - 1
                }
                lc(t) {
                    return (this.o_ - 1 - t) / this.xu
                }
                Nu(t) {
                    const i = this.lc(t),
                        s = this.Lu() + this.Mu - i;
                    return Math.round(1e6 * s) / 1e6
                }
                Wu(t) {
                    const i = this.xu;
                    this.xu = t, this.Iu(), i !== this.xu && (this.fu = !0, this.ac())
                }
                Pu() {
                    if (!this.fu) return;
                    if (this.fu = !1, this.Ni()) return void this.oc(Ms.au());
                    const t = this.Lu(),
                        i = this.o_ / this.xu,
                        s = this.Mu + t,
                        e = new gs(s - i + 1, s);
                    this.oc(new Ms(e))
                }
                Iu() {
                    const t = this._c();
                    if (this.xu < t && (this.xu = t, this.fu = !0), 0 !== this.o_) {
                        const t = .5 * this.o_;
                        this.xu > t && (this.xu = t, this.fu = !0)
                    }
                }
                _c() {
                    return this.cn.fixLeftEdge && this.cn.fixRightEdge && 0 !== this._u.length ? this.o_ / this._u.length : this.cn.minBarSpacing
                }
                zu() {
                    const t = this.uc();
                    this.Mu > t && (this.Mu = t, this.fu = !0);
                    const i = this.cc();
                    null !== i && this.Mu < i && (this.Mu = i, this.fu = !0)
                }
                cc() {
                    const t = this.Au(),
                        i = this.ou;
                    return null === t || null === i ? null : t - i - 1 + (this.cn.fixLeftEdge ? this.o_ / this.xu : Math.min(2, this._u.length))
                }
                uc() {
                    return this.cn.fixRightEdge ? 0 : this.o_ / this.xu - Math.min(2, this._u.length)
                }
                Xu() {
                    this.bu = {
                        he: this.he(),
                        ju: this.ju()
                    }
                }
                Ku() {
                    this.bu = null
                }
                $u(t) {
                    let i = this.cu.get(t.weight);
                    return void 0 === i && (i = new bs((t => this.dc(t)), this.U_), this.cu.set(t.weight, i)), i.q_(t)
                }
                dc(t) {
                    return this.U_.formatTickmark(t, this.ko)
                }
                oc(t) {
                    const i = this.du;
                    this.du = t, ws(i.hu(), this.du.hu()) || this.vu.m(), ws(i.lu(), this.du.lu()) || this.pu.m(), this.ac()
                }
                ac() {
                    this.wu = null
                }
                yu() {
                    this.ac(), this.cu.clear()
                }
                Su() {
                    this.U_.updateFormatter(this.ko)
                }
                Cu() {
                    if (!this.cn.fixLeftEdge) return;
                    const t = this.Au();
                    if (null === t) return;
                    const i = this.Xs();
                    if (null === i) return;
                    const s = i.Os() - t;
                    if (s < 0) {
                        const t = this.Mu - s - 1;
                        this.Jn(t)
                    }
                    this.Iu()
                }
                Tu() {
                    this.zu(), this.Iu()
                }
            }
            class xs extends class {
                K(t, i, s) {
                    t.useMediaCoordinateSpace((t => this.Z(t, i, s)))
                }
                wl(t, i, s) {
                    t.useMediaCoordinateSpace((t => this.fc(t, i, s)))
                }
                fc(t, i, s) {}
            } {
                constructor(t) {
                    super(), this.vc = new Map, this.zt = t
                }
                Z(t) {}
                fc(t) {
                    if (!this.zt.yt) return;
                    const {
                        context: i,
                        mediaSize: s
                    } = t;
                    let e = 0;
                    for (const t of this.zt.mc) {
                        if (0 === t.Zt.length) continue;
                        i.font = t.R;
                        const n = this.bc(i, t.Zt);
                        n > s.width ? t.Yu = s.width / n : t.Yu = 1, e += t.wc * t.Yu
                    }
                    let n = 0;
                    switch (this.zt.gc) {
                        case "top":
                            n = 0;
                            break;
                        case "center":
                            n = Math.max((s.height - e) / 2, 0);
                            break;
                        case "bottom":
                            n = Math.max(s.height - e, 0)
                    }
                    i.fillStyle = this.zt.O;
                    for (const t of this.zt.mc) {
                        i.save();
                        let e = 0;
                        switch (this.zt.Mc) {
                            case "left":
                                i.textAlign = "left", e = t.wc / 2;
                                break;
                            case "center":
                                i.textAlign = "center", e = s.width / 2;
                                break;
                            case "right":
                                i.textAlign = "right", e = s.width - 1 - t.wc / 2
                        }
                        i.translate(e, n), i.textBaseline = "top", i.font = t.R, i.scale(t.Yu, t.Yu), i.fillText(t.Zt, 0, t.xc), i.restore(), n += t.wc * t.Yu
                    }
                }
                bc(t, i) {
                    const s = this.Sc(t.font);
                    let e = s.get(i);
                    return void 0 === e && (e = t.measureText(i).width, s.set(i, e)), e
                }
                Sc(t) {
                    let i = this.vc.get(t);
                    return void 0 === i && (i = new Map, this.vc.set(t, i)), i
                }
            }
            class zs {
                constructor(t) {
                    this.ft = !0, this.Ft = {
                        yt: !1,
                        O: "",
                        mc: [],
                        gc: "center",
                        Mc: "center"
                    }, this.Wt = new xs(this.Ft), this.jt = t
                }
                bt() {
                    this.ft = !0
                }
                gt() {
                    return this.ft && (this.Mt(), this.ft = !1), this.Wt
                }
                Mt() {
                    const t = this.jt.W(),
                        i = this.Ft;
                    i.yt = t.visible, i.yt && (i.O = t.color, i.Mc = t.horzAlign, i.gc = t.vertAlign, i.mc = [{
                        Zt: t.text,
                        R: A(t.fontSize, t.fontFamily, t.fontStyle),
                        wc: 1.2 * t.fontSize,
                        xc: 0,
                        Yu: 0
                    }])
                }
            }
            class ks extends ot {
                constructor(t, i) {
                    super(), this.cn = i, this.wn = new zs(this)
                }
                Rn() {
                    return []
                }
                Pn() {
                    return [this.wn]
                }
                W() {
                    return this.cn
                }
                On() {
                    this.wn.bt()
                }
            }
            var _s, Ls, Os, Ts, Es;
            ! function(t) {
                t[t.OnTouchEnd = 0] = "OnTouchEnd", t[t.OnNextTap = 1] = "OnNextTap"
            }(_s || (_s = {}));
            class Ns {
                constructor(t, i, s) {
                    this.kc = [], this.yc = [], this.o_ = 0, this.Cc = null, this.Tc = new T, this.Pc = new T, this.Rc = null, this.Dc = t, this.cn = i, this.U_ = s, this.Oc = new V(this), this.kl = new Cs(this, i.timeScale, this.cn.localization, s), this.vt = new at(this, i.crosshair), this.Ac = new Gi(i.crosshair), this.Bc = new ks(this, i.watermark), this.Vc(), this.kc[0].M_(2e3), this.Ic = this.zc(0), this.Lc = this.zc(1)
                }
                Kl() {
                    this.Ec(ct.es())
                }
                $h() {
                    this.Ec(ct.ss())
                }
                aa() {
                    this.Ec(new ct(1))
                }
                Zl(t) {
                    const i = this.Nc(t);
                    this.Ec(i)
                }
                Fc() {
                    return this.Cc
                }
                Wc(t) {
                    const i = this.Cc;
                    this.Cc = t, null !== i && this.Zl(i.jc), null !== t && this.Zl(t.jc)
                }
                W() {
                    return this.cn
                }
                Hh(t) {
                    E(this.cn, t), this.kc.forEach((i => i.m_(t))), void 0 !== t.timeScale && this.kl.Hh(t.timeScale), void 0 !== t.localization && this.kl.ku(t.localization), (t.leftPriceScale || t.rightPriceScale) && this.Tc.m(), this.Ic = this.zc(0),
                        this.Lc = this.zc(1), this.Kl()
                }
                Hc(t, i) {
                    if ("left" === t) return void this.Hh({
                        leftPriceScale: i
                    });
                    if ("right" === t) return void this.Hh({
                        rightPriceScale: i
                    });
                    const s = this.$c(t);
                    null !== s && (s.Dt.Hh(i), this.Tc.m())
                }
                $c(t) {
                    for (const i of this.kc) {
                        const s = i.b_(t);
                        if (null !== s) return {
                            Ht: i,
                            Dt: s
                        }
                    }
                    return null
                }
                St() {
                    return this.kl
                }
                Uc() {
                    return this.kc
                }
                qc() {
                    return this.Bc
                }
                Yc() {
                    return this.vt
                }
                Xc() {
                    return this.Pc
                }
                Kc(t, i) {
                    t.zo(i), this.Fu()
                }
                x_(t) {
                    this.o_ = t, this.kl.x_(this.o_), this.kc.forEach((i => i.x_(t))), this.Fu()
                }
                Vc(t) {
                    const i = new vs(this.kl, this);
                    void 0 !== t ? this.kc.splice(t, 0, i) : this.kc.push(i);
                    const s = void 0 === t ? this.kc.length - 1 : t,
                        e = ct.es();
                    return e.Nn(s, {
                        Fn: 0,
                        Wn: !0
                    }), this.Ec(e), i
                }
                D_(t, i, s) {
                    t.D_(i, s)
                }
                O_(t, i, s) {
                    t.O_(i, s), this.Gl(), this.Ec(this.Zc(t, 2))
                }
                A_(t, i) {
                    t.A_(i), this.Ec(this.Zc(t, 2))
                }
                B_(t, i, s) {
                    i.Do() || t.B_(i, s)
                }
                V_(t, i, s) {
                    i.Do() || (t.V_(i, s), this.Gl(), this.Ec(this.Zc(t, 2)))
                }
                I_(t, i) {
                    i.Do() || (t.I_(i), this.Ec(this.Zc(t, 2)))
                }
                L_(t, i) {
                    t.L_(i), this.Ec(this.Zc(t, 2))
                }
                Gc(t) {
                    this.kl.Zo(t)
                }
                Jc(t, i) {
                    const s = this.St();
                    if (s.Ni() || 0 === i) return;
                    const e = s.Hi();
                    t = Math.max(1, Math.min(t, e)), s.Yu(t, i), this.Fu()
                }
                Qc(t) {
                    this.td(0), this.nd(t), this.sd()
                }
                ed(t) {
                    this.kl.Go(t), this.Fu()
                }
                rd() {
                    this.kl.Jo(), this.$h()
                }
                td(t) {
                    this.kl.Qo(t)
                }
                nd(t) {
                    this.kl.t_(t), this.Fu()
                }
                sd() {
                    this.kl.i_(), this.$h()
                }
                wt() {
                    return this.yc
                }
                hd(t, i, s, e, n) {
                    this.vt.gn(t, i);
                    let h = NaN,
                        r = this.kl.Eu(t);
                    const o = this.kl.Xs();
                    null !== o && (r = Math.min(Math.max(o.Os(), r), o.ui()));
                    const l = e.vn(),
                        a = l.Ct();
                    null !== a && (h = l.pn(i, a)), h = this.Ac.Oa(h, r, e), this.vt.kn(r, h, e), this.aa(), n || this.Pc.m(this.vt.xt(), {
                        x: t,
                        y: i
                    }, s)
                }
                ld(t, i, s) {
                    const e = s.vn(),
                        n = e.Ct(),
                        h = e.Rt(t, w(n)),
                        r = this.kl.Da(i, !0),
                        o = this.kl.It(w(r));
                    this.hd(o, h, null, s, !0)
                }
                ad(t) {
                    this.Yc().Cn(), this.aa(), t || this.Pc.m(null, null, null)
                }
                Gl() {
                    const t = this.vt.Ht();
                    if (null !== t) {
                        const i = this.vt.xn(),
                            s = this.vt.Sn();
                        this.hd(i, s, null, t)
                    }
                    this.vt.On()
                }
                od(t, i, s) {
                    const e = this.kl.mn(0);
                    void 0 !== i && void 0 !== s && this.kl.bt(i, s);
                    const n = this.kl.mn(0),
                        h = this.kl.Lu(),
                        r = this.kl.Xs();
                    if (null !== r && null !== e && null !== n) {
                        const i = r.Kr(h),
                            o = this.U_.key(e) > this.U_.key(n),
                            l = null !== t && t > h && !o,
                            a = this.kl.W().allowShiftVisibleRangeOnWhitespaceReplacement,
                            u = i && (!(void 0 === s) || a) && this.kl.W().shiftVisibleRangeOnNewBar;
                        if (l && !u) {
                            const i = t - h;
                            this.kl.Jn(this.kl.ju() - i)
                        }
                    }
                    this.kl.qu(t)
                }
                ta(t) {
                    null !== t && t.N_()
                }
                cr(t) {
                    const i = this.kc.find((i => i.$o().includes(t)));
                    return void 0 === i ? null : i
                }
                Fu() {
                    this.Bc.On(), this.kc.forEach((t => t.N_())), this.Gl()
                }
                S() {
                    this.kc.forEach((t => t.S())), this.kc.length = 0, this.cn.localization.priceFormatter = void 0, this.cn.localization.percentageFormatter = void 0, this.cn.localization.timeFormatter = void 0
                }
                _d() {
                    return this.Oc
                }
                mr() {
                    return this.Oc.W()
                }
                w_() {
                    return this.Tc
                }
                ud(t, i, s) {
                    const e = this.kc[0],
                        n = this.dd(i, t, e, s);
                    return this.yc.push(n), 1 === this.yc.length ? this.Kl() : this.$h(), n
                }
                fd(t) {
                    const i = this.cr(t),
                        s = this.yc.indexOf(t);
                    b(-1 !== s, "Series not found"), this.yc.splice(s, 1), w(i).Yo(t), t.S && t.S()
                }
                Xl(t, i) {
                    const s = w(this.cr(t));
                    s.Yo(t);
                    const e = this.$c(i);
                    if (null === e) {
                        const e = t.Ki();
                        s.Uo(t, i, e)
                    } else {
                        const n = e.Ht === s ? t.Ki() : void 0;
                        e.Ht.Uo(t, i, n)
                    }
                }
                rc() {
                    const t = ct.ss();
                    t.$n(), this.Ec(t)
                }
                vd(t) {
                    const i = ct.ss();
                    i.Yn(t), this.Ec(i)
                }
                Zn() {
                    const t = ct.ss();
                    t.Zn(), this.Ec(t)
                }
                Gn(t) {
                    const i = ct.ss();
                    i.Gn(t), this.Ec(i)
                }
                Jn(t) {
                    const i = ct.ss();
                    i.Jn(t), this.Ec(i)
                }
                Xn(t) {
                    const i = ct.ss();
                    i.Xn(t), this.Ec(i)
                }
                Un() {
                    const t = ct.ss();
                    t.Un(), this.Ec(t)
                }
                pd() {
                    return this.cn.rightPriceScale.visible ? "right" : "left"
                }
                md() {
                    return this.Lc
                }
                q() {
                    return this.Ic
                }
                Bt(t) {
                    const i = this.Lc,
                        s = this.Ic;
                    if (i === s) return i;
                    if (t = Math.max(0, Math.min(100, Math.round(100 * t))), null === this.Rc || this.Rc.Ts !== s || this.Rc.Ps !== i) this.Rc = {
                        Ts: s,
                        Ps: i,
                        bd: new Map
                    };
                    else {
                        const i = this.Rc.bd.get(t);
                        if (void 0 !== i) return i
                    }
                    const e = function(t, i, s) {
                        const [e, n, h, r] = L(t), [o, l, a, u] = L(i), c = [S(e + s * (o - e)), S(n + s * (l - n)), S(h + s * (a - h)), C(r + s * (u - r))];
                        return `rgba(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`
                    }(s, i, t / 100);
                    return this.Rc.bd.set(t, e), e
                }
                Zc(t, i) {
                    const s = new ct(i);
                    if (null !== t) {
                        const e = this.kc.indexOf(t);
                        s.Nn(e, {
                            Fn: i
                        })
                    }
                    return s
                }
                Nc(t, i) {
                    return void 0 === i && (i = 2), this.Zc(this.cr(t), i)
                }
                Ec(t) {
                    this.Dc && this.Dc(t), this.kc.forEach((t => t.W_().Uh().bt()))
                }
                dd(t, i, s, e) {
                    const n = new Ki(this, t, i, s, e),
                        h = void 0 !== t.priceScaleId ? t.priceScaleId : this.pd();
                    return s.Uo(n, h), ut(h) || n.Hh(t), n
                }
                zc(t) {
                    const i = this.cn.layout;
                    return "gradient" === i.background.type ? 0 === t ? i.background.topColor : i.background.bottomColor : i.background.color
                }
            }

            function $s(t) {
                return !N(t) && !W(t)
            }

            function Ws(t) {
                return N(t)
            }! function(t) {
                t[t.Disabled = 0] = "Disabled", t[t.Continuous = 1] = "Continuous", t[t.OnDataUpdate = 2] = "OnDataUpdate"
            }(Ls || (Ls = {})),
            function(t) {
                t[t.LastBar = 0] = "LastBar", t[t.LastVisible = 1] = "LastVisible"
            }(Os || (Os = {})),
            function(t) {
                t.Solid = "solid", t.VerticalGradient = "gradient"
            }(Ts || (Ts = {})),
            function(t) {
                t[t.Year = 0] = "Year", t[t.Month = 1] = "Month", t[t.DayOfMonth = 2] = "DayOfMonth", t[t.Time = 3] = "Time", t[t.TimeWithSeconds = 4] = "TimeWithSeconds"
            }(Es || (Es = {}));
            const Ps = t => t.getUTCFullYear();
            class Rs {
                constructor(t = "yyyy-MM-dd", i = "default") {
                    this.wd = t, this.gd = i
                }
                q_(t) {
                    return function(t, i, s) {
                        return i.replace(/yyyy/g, (t => ft(Ps(t), 4))(t)).replace(/yy/g, (t => ft(Ps(t) % 100, 2))(t)).replace(/MMMM/g, ((t, i) => new Date(t.getUTCFullYear(), t.getUTCMonth(), 1).toLocaleString(i, {
                            month: "long"
                        }))(t, s)).replace(/MMM/g, ((t, i) => new Date(t.getUTCFullYear(), t.getUTCMonth(), 1).toLocaleString(i, {
                            month: "short"
                        }))(t, s)).replace(/MM/g, (t => ft((t => t.getUTCMonth() + 1)(t), 2))(t)).replace(/dd/g, (t => ft((t => t.getUTCDate())(t), 2))(t))
                    }(t, this.wd, this.gd)
                }
            }
            class Ds {
                constructor(t) {
                    this.Md = t || "%h:%m:%s"
                }
                q_(t) {
                    return this.Md.replace("%h", ft(t.getUTCHours(), 2)).replace("%m", ft(t.getUTCMinutes(), 2)).replace("%s", ft(t.getUTCSeconds(), 2))
                }
            }
            const Fs = {
                xd: "yyyy-MM-dd",
                Sd: "%h:%m:%s",
                kd: " ",
                yd: "default"
            };
            class Is {
                constructor(t = {}) {
                    const i = Object.assign(Object.assign({}, Fs), t);
                    this.Cd = new Rs(i.xd, i.yd), this.Td = new Ds(i.Sd), this.Pd = i.kd
                }
                q_(t) {
                    return `${this.Cd.q_(t)}${this.Pd}${this.Td.q_(t)}`
                }
            }

            function As(t) {
                return 60 * t * 60 * 1e3
            }

            function Vs(t) {
                return 60 * t * 1e3
            }
            const Bs = [{
                Rd: (1, 1e3),
                Dd: 10
            }, {
                Rd: Vs(1),
                Dd: 20
            }, {
                Rd: Vs(5),
                Dd: 21
            }, {
                Rd: Vs(30),
                Dd: 22
            }, {
                Rd: As(1),
                Dd: 30
            }, {
                Rd: As(3),
                Dd: 31
            }, {
                Rd: As(6),
                Dd: 32
            }, {
                Rd: As(12),
                Dd: 33
            }];

            function js(t, i) {
                if (t.getUTCFullYear() !== i.getUTCFullYear()) return 70;
                if (t.getUTCMonth() !== i.getUTCMonth()) return 60;
                if (t.getUTCDate() !== i.getUTCDate()) return 50;
                for (let s = Bs.length - 1; s >= 0; --s)
                    if (Math.floor(i.getTime() / Bs[s].Rd) !== Math.floor(t.getTime() / Bs[s].Rd)) return Bs[s].Dd;
                return 0
            }

            function Us(t) {
                let i = t;
                if (W(t) && (i = Js(t)), !$s(i)) throw new Error("time must be of type BusinessDay");
                const s = new Date(Date.UTC(i.year, i.month - 1, i.day, 0, 0, 0, 0));
                return {
                    Od: Math.round(s.getTime() / 1e3),
                    Ad: i
                }
            }

            function Zs(t) {
                if (!Ws(t)) throw new Error("time must be of type isUTCTimestamp");
                return {
                    Od: t
                }
            }

            function Js(t) {
                const i = new Date(t);
                if (isNaN(i.getTime())) throw new Error(`Invalid date string=${t}, expected format=yyyy-mm-dd`);
                return {
                    day: i.getUTCDate(),
                    month: i.getUTCMonth() + 1,
                    year: i.getUTCFullYear()
                }
            }

            function Hs(t) {
                W(t.time) && (t.time = Js(t.time))
            }
            class Ks {
                options() {
                    return this.cn
                }
                setOptions(t) {
                    this.cn = t, this.updateFormatter(t.localization)
                }
                preprocessData(t) {
                    Array.isArray(t) ? function(t) {
                        t.forEach(Hs)
                    }(t) : Hs(t)
                }
                createConverterToInternalObj(t) {
                    return w(function(t) {
                        return 0 === t.length ? null : $s(t[0].time) || W(t[0].time) ? Us : Zs
                    }(t))
                }
                key(t) {
                    return "object" == typeof t && "Od" in t ? t.Od : this.key(this.convertHorzItemToInternal(t))
                }
                cacheKey(t) {
                    const i = t;
                    return void 0 === i.Ad ? new Date(1e3 * i.Od).getTime() : new Date(Date.UTC(i.Ad.year, i.Ad.month - 1, i.Ad.day)).getTime()
                }
                convertHorzItemToInternal(t) {
                    return Ws(i = t) ? Zs(i) : $s(i) ? Us(i) : Us(Js(i));
                    var i
                }
                updateFormatter(t) {
                    if (!this.cn) return;
                    const i = t.dateFormat;
                    this.cn.timeScale.timeVisible ? this.Bd = new Is({
                        xd: i,
                        Sd: this.cn.timeScale.secondsVisible ? "%h:%m:%s" : "%h:%m",
                        kd: "   ",
                        yd: t.locale
                    }) : this.Bd = new Rs(i, t.locale)
                }
                formatHorzItem(t) {
                    const i = t;
                    return this.Bd.q_(new Date(1e3 * i.Od))
                }
                formatTickmark(t, i) {
                    const s = function(t, i, s) {
                            switch (t) {
                                case 0:
                                case 10:
                                    return i ? s ? 4 : 3 : 2;
                                case 20:
                                case 21:
                                case 22:
                                case 30:
                                case 31:
                                case 32:
                                case 33:
                                    return i ? 3 : 2;
                                case 50:
                                    return 2;
                                case 60:
                                    return 1;
                                case 70:
                                    return 0
                            }
                        }(t.weight, this.cn.timeScale.timeVisible, this.cn.timeScale.secondsVisible),
                        e = this.cn.timeScale;
                    if (void 0 !== e.tickMarkFormatter) {
                        const n = e.tickMarkFormatter(t.originalTime, s, i.locale);
                        if (null !== n) return n
                    }
                    return function(t, i, s) {
                        const e = {};
                        switch (i) {
                            case 0:
                                e.year = "numeric";
                                break;
                            case 1:
                                e.month = "short";
                                break;
                            case 2:
                                e.day = "numeric";
                                break;
                            case 3:
                                e.hour12 = !1, e.hour = "2-digit", e.minute = "2-digit";
                                break;
                            case 4:
                                e.hour12 = !1, e.hour = "2-digit", e.minute = "2-digit", e.second = "2-digit"
                        }
                        const n = void 0 === t.Ad ? new Date(1e3 * t.Od) : new Date(Date.UTC(t.Ad.year, t.Ad.month - 1, t.Ad.day));
                        return new Date(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate(), n.getUTCHours(), n.getUTCMinutes(), n.getUTCSeconds(), n.getUTCMilliseconds()).toLocaleString(s, e)
                    }(t.time, s, i.locale)
                }
                maxTickMarkWeight(t) {
                    let i = t.reduce(Ss, t[0]).weight;
                    return i > 30 && i < 50 && (i = 30), i
                }
                fillWeightsForPoints(t, i) {
                    ! function(t, i = 0) {
                        if (0 === t.length) return;
                        let s = 0 === i ? null : t[i - 1].time.Od,
                            e = null !== s ? new Date(1e3 * s) : null,
                            n = 0;
                        for (let h = i; h < t.length; ++h) {
                            const i = t[h],
                                r = new Date(1e3 * i.time.Od);
                            null !== e && (i.timeWeight = js(r, e)), n += i.time.Od - (s || i.time.Od), s = i.time.Od, e = r
                        }
                        if (0 === i && t.length > 1) {
                            const i = Math.ceil(n / (t.length - 1)),
                                s = new Date(1e3 * (t[0].time.Od - i));
                            t[0].timeWeight = js(new Date(1e3 * t[0].time.Od), s)
                        }
                    }(t, i)
                }
                static Vd(t) {
                    return E({
                        localization: {
                            dateFormat: "dd MMM 'yy"
                        }
                    }, null != t ? t : {})
                }
            }
            const Gs = "undefined" != typeof window;

            function Xs() {
                return !!Gs && window.navigator.userAgent.toLowerCase().indexOf("firefox") > -1
            }

            function Ys() {
                return !!Gs && /iPhone|iPad|iPod/.test(window.navigator.platform)
            }

            function qs(t) {
                return t + t % 2
            }

            function Qs(t, i) {
                return t.Id - i.Id
            }

            function te(t, i, s) {
                const e = (t.Id - i.Id) / (t.ot - i.ot);
                return Math.sign(e) * Math.min(Math.abs(e), s)
            }
            class ie {
                constructor(t, i, s, e) {
                    this.zd = null, this.Ld = null, this.Ed = null, this.Nd = null, this.Fd = null, this.Wd = 0, this.jd = 0, this.Hd = t, this.$d = i, this.Ud = s, this.rs = e
                }
                qd(t, i) {
                    if (null !== this.zd) {
                        if (this.zd.ot === i) return void(this.zd.Id = t);
                        if (Math.abs(this.zd.Id - t) < this.rs) return
                    }
                    this.Nd = this.Ed, this.Ed = this.Ld, this.Ld = this.zd, this.zd = {
                        ot: i,
                        Id: t
                    }
                }
                Dr(t, i) {
                    if (null === this.zd || null === this.Ld) return;
                    if (i - this.zd.ot > 50) return;
                    let s = 0;
                    const e = te(this.zd, this.Ld, this.$d),
                        n = Qs(this.zd, this.Ld),
                        h = [e],
                        r = [n];
                    if (s += n, null !== this.Ed) {
                        const t = te(this.Ld, this.Ed, this.$d);
                        if (Math.sign(t) === Math.sign(e)) {
                            const i = Qs(this.Ld, this.Ed);
                            if (h.push(t), r.push(i), s += i, null !== this.Nd) {
                                const t = te(this.Ed, this.Nd, this.$d);
                                if (Math.sign(t) === Math.sign(e)) {
                                    const i = Qs(this.Ed, this.Nd);
                                    h.push(t), r.push(i), s += i
                                }
                            }
                        }
                    }
                    let o = 0;
                    for (let t = 0; t < h.length; ++t) o += r[t] / s * h[t];
                    Math.abs(o) < this.Hd || (this.Fd = {
                        Id: t,
                        ot: i
                    }, this.jd = o, this.Wd = function(t, i) {
                        const s = Math.log(i);
                        return Math.log(1 * s / -t) / s
                    }(Math.abs(o), this.Ud))
                }
                Qu(t) {
                    const i = w(this.Fd),
                        s = t - i.ot;
                    return i.Id + this.jd * (Math.pow(this.Ud, s) - 1) / Math.log(this.Ud)
                }
                Ju(t) {
                    return null === this.Fd || this.Yd(t) === this.Wd
                }
                Yd(t) {
                    const i = t - w(this.Fd).ot;
                    return Math.min(i, this.Wd)
                }
            }

            function se(t, i) {
                const s = w(t.ownerDocument).createElement("canvas");
                t.appendChild(s);
                const n = (0, e.bindCanvasElementBitmapSizeTo)(s, {
                    type: "device-pixel-content-box",
                    options: {
                        allowResizeObserver: !1
                    },
                    transform: (t, i) => ({
                        width: Math.max(t.width, i.width),
                        height: Math.max(t.height, i.height)
                    })
                });
                return n.resizeCanvasElement(i), n
            }

            function ee(t) {
                var i;
                t.width = 1, t.height = 1, null === (i = t.getContext("2d")) || void 0 === i || i.clearRect(0, 0, 1, 1)
            }

            function ne(t, i, s, e) {
                t.wl && t.wl(i, s, e)
            }

            function he(t, i, s, e) {
                t.K(i, s, e)
            }

            function re(t, i, s, e) {
                const n = t(s, e);
                for (const t of n) {
                    const s = t.gt();
                    null !== s && i(s)
                }
            }
            class oe {
                constructor(t, i, s) {
                    this.Xd = 0, this.Kd = null, this.Zd = {
                        nt: Number.NEGATIVE_INFINITY,
                        st: Number.POSITIVE_INFINITY
                    }, this.Gd = 0, this.Jd = null, this.Qd = {
                        nt: Number.NEGATIVE_INFINITY,
                        st: Number.POSITIVE_INFINITY
                    }, this.tf = null, this.if = !1, this.nf = null, this.sf = null, this.ef = !1, this.rf = !1, this.hf = !1, this.lf = null, this.af = null, this._f = null, this.uf = null, this.cf = null, this.df = null, this.ff = null, this.vf = 0, this.pf = !1, this.mf = !1, this.bf = !1, this.wf = 0, this.gf = null, this.Mf = !Ys(), this.xf = t => {
                        this.Sf(t)
                    }, this.kf = t => {
                        if (this.yf(t)) {
                            const i = this.Cf(t);
                            if (++this.Gd, this.Jd && this.Gd > 1) {
                                const {
                                    Tf: s
                                } = this.Pf(ue(t), this.Qd);
                                s < 30 && !this.hf && this.Rf(i, this.Of.Df), this.Af()
                            }
                        } else {
                            const i = this.Cf(t);
                            if (++this.Xd, this.Kd && this.Xd > 1) {
                                const {
                                    Tf: s
                                } = this.Pf(ue(t), this.Zd);
                                s < 5 && !this.rf && this.Bf(i, this.Of.Vf), this.If()
                            }
                        }
                    }, this.zf = t, this.Of = i, this.cn = s, this.Lf()
                }
                S() {
                    null !== this.lf && (this.lf(), this.lf = null), null !== this.af && (this.af(),
                        this.af = null), null !== this.uf && (this.uf(), this.uf = null), null !== this.cf && (this.cf(), this.cf = null), null !== this.df && (this.df(), this.df = null), null !== this._f && (this._f(), this._f = null), this.Ef(), this.If()
                }
                Nf(t) {
                    this.uf && this.uf();
                    const i = this.Ff.bind(this);
                    if (this.uf = () => {
                            this.zf.removeEventListener("mousemove", i)
                        }, this.zf.addEventListener("mousemove", i), this.yf(t)) return;
                    const s = this.Cf(t);
                    this.Bf(s, this.Of.Wf), this.Mf = !0
                }
                If() {
                    null !== this.Kd && clearTimeout(this.Kd), this.Xd = 0, this.Kd = null, this.Zd = {
                        nt: Number.NEGATIVE_INFINITY,
                        st: Number.POSITIVE_INFINITY
                    }
                }
                Af() {
                    null !== this.Jd && clearTimeout(this.Jd), this.Gd = 0, this.Jd = null, this.Qd = {
                        nt: Number.NEGATIVE_INFINITY,
                        st: Number.POSITIVE_INFINITY
                    }
                }
                Ff(t) {
                    if (this.bf || null !== this.sf) return;
                    if (this.yf(t)) return;
                    const i = this.Cf(t);
                    this.Bf(i, this.Of.jf), this.Mf = !0
                }
                Hf(t) {
                    const i = fe(t.changedTouches, w(this.gf));
                    if (null === i) return;
                    if (this.wf = ce(t), null !== this.ff) return;
                    if (this.mf) return;
                    this.pf = !0;
                    const s = this.Pf(ue(i), w(this.sf)),
                        {
                            $f: e,
                            Uf: n,
                            Tf: h
                        } = s;
                    if (this.ef || !(h < 5)) {
                        if (!this.ef) {
                            const t = .5 * e,
                                i = n >= t && !this.cn.qf(),
                                s = t > n && !this.cn.Yf();
                            i || s || (this.mf = !0), this.ef = !0, this.hf = !0, this.Ef(), this.Af()
                        }
                        if (!this.mf) {
                            const s = this.Cf(t, i);
                            this.Rf(s, this.Of.Xf), ae(t)
                        }
                    }
                }
                Kf(t) {
                    if (0 !== t.button) return;
                    const i = this.Pf(ue(t), w(this.nf)),
                        {
                            Tf: s
                        } = i;
                    if (s >= 5 && (this.rf = !0, this.If()), this.rf) {
                        const i = this.Cf(t);
                        this.Bf(i, this.Of.Zf)
                    }
                }
                Pf(t, i) {
                    const s = Math.abs(i.nt - t.nt),
                        e = Math.abs(i.st - t.st);
                    return {
                        $f: s,
                        Uf: e,
                        Tf: s + e
                    }
                }
                Gf(t) {
                    let i = fe(t.changedTouches, w(this.gf));
                    if (null === i && 0 === t.touches.length && (i = t.changedTouches[0]), null === i) return;
                    this.gf = null, this.wf = ce(t), this.Ef(), this.sf = null, this.df && (this.df(), this.df = null);
                    const s = this.Cf(t, i);
                    if (this.Rf(s, this.Of.Jf), ++this.Gd, this.Jd && this.Gd > 1) {
                        const {
                            Tf: t
                        } = this.Pf(ue(i), this.Qd);
                        t < 30 && !this.hf && this.Rf(s, this.Of.Df), this.Af()
                    } else this.hf || (this.Rf(s, this.Of.Qf), this.Of.Qf && ae(t));
                    0 === this.Gd && ae(t), 0 === t.touches.length && this.if && (this.if = !1, ae(t))
                }
                Sf(t) {
                    if (0 !== t.button) return;
                    const i = this.Cf(t);
                    if (this.nf = null, this.bf = !1, this.cf && (this.cf(), this.cf = null), Xs() && this.zf.ownerDocument.documentElement.removeEventListener("mouseleave", this.xf), !this.yf(t))
                        if (this.Bf(i, this.Of.tv), ++this.Xd, this.Kd && this.Xd > 1) {
                            const {
                                Tf: s
                            } = this.Pf(ue(t), this.Zd);
                            s < 5 && !this.rf && this.Bf(i, this.Of.Vf), this.If()
                        } else this.rf || this.Bf(i, this.Of.iv)
                }
                Ef() {
                    null !== this.tf && (clearTimeout(this.tf), this.tf = null)
                }
                nv(t) {
                    if (null !== this.gf) return;
                    const i = t.changedTouches[0];
                    this.gf = i.identifier, this.wf = ce(t);
                    const s = this.zf.ownerDocument.documentElement;
                    this.hf = !1, this.ef = !1, this.mf = !1, this.sf = ue(i), this.df && (this.df(), this.df = null); {
                        const i = this.Hf.bind(this),
                            e = this.Gf.bind(this);
                        this.df = () => {
                            s.removeEventListener("touchmove", i), s.removeEventListener("touchend", e)
                        }, s.addEventListener("touchmove", i, {
                            passive: !1
                        }), s.addEventListener("touchend", e, {
                            passive: !1
                        }), this.Ef(), this.tf = setTimeout(this.sv.bind(this, t), 240)
                    }
                    const e = this.Cf(t, i);
                    this.Rf(e, this.Of.ev), this.Jd || (this.Gd = 0, this.Jd = setTimeout(this.Af.bind(this), 500), this.Qd = ue(i))
                }
                rv(t) {
                    if (0 !== t.button) return;
                    const i = this.zf.ownerDocument.documentElement;
                    Xs() && i.addEventListener("mouseleave", this.xf), this.rf = !1, this.nf = ue(t), this.cf && (this.cf(), this.cf = null); {
                        const t = this.Kf.bind(this),
                            s = this.Sf.bind(this);
                        this.cf = () => {
                            i.removeEventListener("mousemove", t), i.removeEventListener("mouseup", s)
                        }, i.addEventListener("mousemove", t), i.addEventListener("mouseup", s)
                    }
                    if (this.bf = !0, this.yf(t)) return;
                    const s = this.Cf(t);
                    this.Bf(s, this.Of.hv), this.Kd || (this.Xd = 0, this.Kd = setTimeout(this.If.bind(this), 500), this.Zd = ue(t))
                }
                Lf() {
                    this.zf.addEventListener("mouseenter", this.Nf.bind(this)), this.zf.addEventListener("touchcancel", this.Ef.bind(this)); {
                        const t = this.zf.ownerDocument,
                            i = t => {
                                this.Of.lv && (t.composed && this.zf.contains(t.composedPath()[0]) || t.target && this.zf.contains(t.target) || this.Of.lv())
                            };
                        this.af = () => {
                            t.removeEventListener("touchstart", i)
                        }, this.lf = () => {
                            t.removeEventListener("mousedown", i)
                        }, t.addEventListener("mousedown", i), t.addEventListener("touchstart", i, {
                            passive: !0
                        })
                    }
                    Ys() && (this._f = () => {
                            this.zf.removeEventListener("dblclick", this.kf)
                        }, this.zf.addEventListener("dblclick", this.kf)), this.zf.addEventListener("mouseleave", this.av.bind(this)), this.zf.addEventListener("touchstart", this.nv.bind(this), {
                            passive: !0
                        }),
                        function(t) {
                            Gs && void 0 !== window.chrome && t.addEventListener("mousedown", (t => {
                                if (1 === t.button) return t.preventDefault(), !1
                            }))
                        }(this.zf), this.zf.addEventListener("mousedown", this.rv.bind(this)), this.ov(), this.zf.addEventListener("touchmove", (() => {}), {
                            passive: !1
                        })
                }
                ov() {
                    void 0 === this.Of._v && void 0 === this.Of.uv && void 0 === this.Of.cv || (this.zf.addEventListener("touchstart", (t => this.dv(t.touches)), {
                        passive: !0
                    }), this.zf.addEventListener("touchmove", (t => {
                        if (2 === t.touches.length && null !== this.ff && void 0 !== this.Of.uv) {
                            const i = le(t.touches[0], t.touches[1]) / this.vf;
                            this.Of.uv(this.ff, i), ae(t)
                        }
                    }), {
                        passive: !1
                    }), this.zf.addEventListener("touchend", (t => {
                        this.dv(t.touches)
                    })))
                }
                dv(t) {
                    1 === t.length && (this.pf = !1), 2 !== t.length || this.pf || this.if ? this.fv() : this.vv(t)
                }
                vv(t) {
                    const i = this.zf.getBoundingClientRect() || {
                        left: 0,
                        top: 0
                    };
                    this.ff = {
                        nt: (t[0].clientX - i.left + (t[1].clientX - i.left)) / 2,
                        st: (t[0].clientY - i.top + (t[1].clientY - i.top)) / 2
                    }, this.vf = le(t[0], t[1]), void 0 !== this.Of._v && this.Of._v(), this.Ef()
                }
                fv() {
                    null !== this.ff && (this.ff = null, void 0 !== this.Of.cv && this.Of.cv())
                }
                av(t) {
                    if (this.uf && this.uf(), this.yf(t)) return;
                    if (!this.Mf) return;
                    const i = this.Cf(t);
                    this.Bf(i, this.Of.pv), this.Mf = !Ys()
                }
                sv(t) {
                    const i = fe(t.touches, w(this.gf));
                    if (null === i) return;
                    const s = this.Cf(t, i);
                    this.Rf(s, this.Of.mv), this.hf = !0, this.if = !0
                }
                yf(t) {
                    return t.sourceCapabilities && void 0 !== t.sourceCapabilities.firesTouchEvents ? t.sourceCapabilities.firesTouchEvents : ce(t) < this.wf + 500
                }
                Rf(t, i) {
                    i && i.call(this.Of, t)
                }
                Bf(t, i) {
                    i && i.call(this.Of, t)
                }
                Cf(t, i) {
                    const s = i || t,
                        e = this.zf.getBoundingClientRect() || {
                            left: 0,
                            top: 0
                        };
                    return {
                        clientX: s.clientX,
                        clientY: s.clientY,
                        pageX: s.pageX,
                        pageY: s.pageY,
                        screenX: s.screenX,
                        screenY: s.screenY,
                        localX: s.clientX - e.left,
                        localY: s.clientY - e.top,
                        ctrlKey: t.ctrlKey,
                        altKey: t.altKey,
                        shiftKey: t.shiftKey,
                        metaKey: t.metaKey,
                        bv: !t.type.startsWith("mouse") && "contextmenu" !== t.type && "click" !== t.type,
                        wv: t.type,
                        gv: s.target,
                        Mv: t.view,
                        xv: () => {
                            "touchstart" !== t.type && ae(t)
                        }
                    }
                }
            }

            function le(t, i) {
                const s = t.clientX - i.clientX,
                    e = t.clientY - i.clientY;
                return Math.sqrt(s * s + e * e)
            }

            function ae(t) {
                t.cancelable && t.preventDefault()
            }

            function ue(t) {
                return {
                    nt: t.pageX,
                    st: t.pageY
                }
            }

            function ce(t) {
                return t.timeStamp || performance.now()
            }

            function fe(t, i) {
                for (let s = 0; s < t.length; ++s)
                    if (t[s].identifier === i) return t[s];
                return null
            }

            function de(t) {
                return {
                    jc: t.jc,
                    Sv: {
                        wr: t.kv.externalId
                    },
                    yv: t.kv.cursorStyle
                }
            }

            function pe(t, i, s) {
                for (const e of t) {
                    const t = e.gt();
                    if (null !== t && t.br) {
                        const n = t.br(i, s);
                        if (null !== n) return {
                            Mv: e,
                            Sv: n
                        }
                    }
                }
                return null
            }

            function me(t, i) {
                return s => {
                    var e, n, h, r;
                    return (null !== (n = null === (e = s.Dt()) || void 0 === e ? void 0 : e.Ta()) && void 0 !== n ? n : "") !== i ? [] : null !== (r = null === (h = s.ca) || void 0 === h ? void 0 : h.call(s, t)) && void 0 !== r ? r : []
                }
            }

            function ve(t, i, s, e) {
                if (!t.length) return;
                let n = 0;
                const h = s / 2,
                    r = t[0].Vt(e, !0);
                let o = 1 === i ? h - (t[0].Oi() - r / 2) : t[0].Oi() - r / 2 - h;
                o = Math.max(0, o);
                for (let h = 1; h < t.length; h++) {
                    const r = t[h],
                        l = t[h - 1],
                        a = l.Vt(e, !1),
                        u = r.Oi(),
                        c = l.Oi();
                    if (1 === i ? u > c - a : u < c + a) {
                        const e = c - a * i;
                        r.Ai(e);
                        const h = e - i * a / 2;
                        if ((1 === i ? h < 0 : h > s) && o > 0) {
                            const e = 1 === i ? -1 - h : h - s,
                                r = Math.min(e, o);
                            for (let s = n; s < t.length; s++) t[s].Ai(t[s].Oi() + i * r);
                            o -= r
                        }
                    } else n = h, o = 1 === i ? c - a - u : u - (c + a)
                }
            }
            class be {
                constructor(t, i, s, n) {
                    this.Li = null, this.Cv = null, this.Tv = !1, this.Pv = new ti(200), this.Jr = null, this.Rv = 0, this.Dv = !1, this.Ov = () => {
                        this.Dv || this.tn.Av().$t().$h()
                    }, this.Bv = () => {
                        this.Dv || this.tn.Av().$t().$h()
                    }, this.tn = t, this.cn = i, this.So = i.layout, this.Oc = s, this.Vv = "left" === n, this.Iv = me("normal", n), this.zv = me("top", n), this.Lv = me("bottom", n), this.Ev = document.createElement("div"), this.Ev.style.height = "100%", this.Ev.style.overflow = "hidden", this.Ev.style.width = "25px", this.Ev.style.left = "0", this.Ev.style.position = "relative", this.Nv = se(this.Ev, e.size({
                        width: 16,
                        height: 16
                    })), this.Nv.subscribeSuggestedBitmapSizeChanged(this.Ov);
                    const h = this.Nv.canvasElement;
                    h.style.position = "absolute", h.style.zIndex = "1", h.style.left = "0", h.style.top = "0", this.Fv = se(this.Ev, e.size({
                        width: 16,
                        height: 16
                    })), this.Fv.subscribeSuggestedBitmapSizeChanged(this.Bv);
                    const r = this.Fv.canvasElement;
                    r.style.position = "absolute", r.style.zIndex = "2", r.style.left = "0", r.style.top = "0";
                    const o = {
                        hv: this.Wv.bind(this),
                        ev: this.Wv.bind(this),
                        Zf: this.jv.bind(this),
                        Xf: this.jv.bind(this),
                        lv: this.Hv.bind(this),
                        tv: this.$v.bind(this),
                        Jf: this.$v.bind(this),
                        Vf: this.Uv.bind(this),
                        Df: this.Uv.bind(this),
                        Wf: this.qv.bind(this),
                        pv: this.Yv.bind(this)
                    };
                    this.Xv = new oe(this.Fv.canvasElement, o, {
                        qf: () => !this.cn.handleScroll.vertTouchDrag,
                        Yf: () => !0
                    })
                }
                S() {
                    this.Xv.S(), this.Fv.unsubscribeSuggestedBitmapSizeChanged(this.Bv), ee(this.Fv.canvasElement), this.Fv.dispose(), this.Nv.unsubscribeSuggestedBitmapSizeChanged(this.Ov), ee(this.Nv.canvasElement), this.Nv.dispose(), null !== this.Li && this.Li.Ko().p(this), this.Li = null
                }
                Kv() {
                    return this.Ev
                }
                P() {
                    return this.So.fontSize
                }
                Zv() {
                    const t = this.Oc.W();
                    return this.Jr !== t.R && (this.Pv.ir(), this.Jr = t.R), t
                }
                Gv() {
                    if (null === this.Li) return 0;
                    let t = 0;
                    const i = this.Zv(),
                        s = w(this.Nv.canvasElement.getContext("2d"));
                    s.save();
                    const e = this.Li.ja();
                    s.font = this.Jv(),
                        e.length > 0 && (t = Math.max(this.Pv.xi(s, e[0].no), this.Pv.xi(s, e[e.length - 1].no)));
                    const n = this.Qv();
                    for (let i = n.length; i--;) {
                        const e = this.Pv.xi(s, n[i].Zt());
                        e > t && (t = e)
                    }
                    const h = this.Li.Ct();
                    if (null !== h && null !== this.Cv) {
                        const i = this.Li.pn(1, h),
                            e = this.Li.pn(this.Cv.height - 2, h);
                        t = Math.max(t, this.Pv.xi(s, this.Li.Fi(Math.floor(Math.min(i, e)) + .11111111111111, h)), this.Pv.xi(s, this.Li.Fi(Math.ceil(Math.max(i, e)) - .11111111111111, h)))
                    }
                    s.restore();
                    const r = t || 34;
                    return qs(Math.ceil(i.C + i.T + i.V + i.I + 5 + r))
                }
                tp(t) {
                    null !== this.Cv && (0, e.equalSizes)(this.Cv, t) || (this.Cv = t, this.Dv = !0, this.Nv.resizeCanvasElement(t), this.Fv.resizeCanvasElement(t), this.Dv = !1, this.Ev.style.width = `${t.width}px`, this.Ev.style.height = `${t.height}px`)
                }
                ip() {
                    return w(this.Cv).width
                }
                Gi(t) {
                    this.Li !== t && (null !== this.Li && this.Li.Ko().p(this), this.Li = t, t.Ko().l(this.do.bind(this), this))
                }
                Dt() {
                    return this.Li
                }
                ir() {
                    const t = this.tn.np();
                    this.tn.Av().$t().L_(t, w(this.Dt()))
                }
                sp(t) {
                    if (null === this.Cv) return;
                    if (1 !== t) {
                        this.ep(), this.Nv.applySuggestedBitmapSize();
                        const t = (0, e.tryCreateCanvasRenderingTarget2D)(this.Nv);
                        null !== t && (t.useBitmapCoordinateSpace((t => {
                            this.rp(t), this.Ve(t)
                        })), this.tn.hp(t, this.Lv), this.lp(t), this.tn.hp(t, this.Iv), this.ap(t))
                    }
                    this.Fv.applySuggestedBitmapSize();
                    const i = (0, e.tryCreateCanvasRenderingTarget2D)(this.Fv);
                    null !== i && (i.useBitmapCoordinateSpace((({
                        context: t,
                        bitmapSize: i
                    }) => {
                        t.clearRect(0, 0, i.width, i.height)
                    })), this.op(i), this.tn.hp(i, this.zv))
                }
                _p() {
                    return this.Nv.bitmapSize
                }
                up(t, i, s) {
                    const e = this._p();
                    e.width > 0 && e.height > 0 && t.drawImage(this.Nv.canvasElement, i, s)
                }
                bt() {
                    var t;
                    null === (t = this.Li) || void 0 === t || t.ja()
                }
                Wv(t) {
                    if (null === this.Li || this.Li.Ni() || !this.cn.handleScale.axisPressedMouseMove.price) return;
                    const i = this.tn.Av().$t(),
                        s = this.tn.np();
                    this.Tv = !0, i.D_(s, this.Li, t.localY)
                }
                jv(t) {
                    if (null === this.Li || !this.cn.handleScale.axisPressedMouseMove.price) return;
                    const i = this.tn.Av().$t(),
                        s = this.tn.np(),
                        e = this.Li;
                    i.O_(s, e, t.localY)
                }
                Hv() {
                    if (null === this.Li || !this.cn.handleScale.axisPressedMouseMove.price) return;
                    const t = this.tn.Av().$t(),
                        i = this.tn.np(),
                        s = this.Li;
                    this.Tv && (this.Tv = !1, t.A_(i, s))
                }
                $v(t) {
                    if (null === this.Li || !this.cn.handleScale.axisPressedMouseMove.price) return;
                    const i = this.tn.Av().$t(),
                        s = this.tn.np();
                    this.Tv = !1, i.A_(s, this.Li)
                }
                Uv(t) {
                    this.cn.handleScale.axisDoubleClickReset.price && this.ir()
                }
                qv(t) {
                    null !== this.Li && (!this.tn.Av().$t().W().handleScale.axisPressedMouseMove.price || this.Li.gh() || this.Li.Oo() || this.cp(1))
                }
                Yv(t) {
                    this.cp(0)
                }
                Qv() {
                    const t = [],
                        i = null === this.Li ? void 0 : this.Li;
                    return (s => {
                        for (let e = 0; e < s.length; ++e) {
                            const n = s[e].Rn(this.tn.np(), i);
                            for (let i = 0; i < n.length; i++) t.push(n[i])
                        }
                    })(this.tn.np().$o()), t
                }
                rp({
                    context: t,
                    bitmapSize: i
                }) {
                    const {
                        width: s,
                        height: e
                    } = i, n = this.tn.np().$t(), h = n.q(), r = n.md();
                    h === r ? Y(t, 0, 0, s, e, h) : tt(t, 0, 0, s, e, h, r)
                }
                Ve({
                    context: t,
                    bitmapSize: i,
                    horizontalPixelRatio: s
                }) {
                    if (null === this.Cv || null === this.Li || !this.Li.W().borderVisible) return;
                    t.fillStyle = this.Li.W().borderColor;
                    const e = Math.max(1, Math.floor(this.Zv().C * s));
                    let n;
                    n = this.Vv ? i.width - e : 0, t.fillRect(n, 0, e, i.height)
                }
                lp(t) {
                    if (null === this.Cv || null === this.Li) return;
                    const i = this.Li.ja(),
                        s = this.Li.W(),
                        e = this.Zv(),
                        n = this.Vv ? this.Cv.width - e.T : 0;
                    s.borderVisible && s.ticksVisible && t.useBitmapCoordinateSpace((({
                        context: t,
                        horizontalPixelRatio: h,
                        verticalPixelRatio: r
                    }) => {
                        t.fillStyle = s.borderColor;
                        const o = Math.max(1, Math.floor(r)),
                            l = Math.floor(.5 * r),
                            a = Math.round(e.T * h);
                        t.beginPath();
                        for (const s of i) t.rect(Math.floor(n * h), Math.round(s.La * r) - l, a, o);
                        t.fill()
                    })), t.useMediaCoordinateSpace((({
                        context: t
                    }) => {
                        var h;
                        t.font = this.Jv(), t.fillStyle = null !== (h = s.textColor) && void 0 !== h ? h : this.So.textColor, t.textAlign = this.Vv ? "right" : "left", t.textBaseline = "middle";
                        const r = this.Vv ? Math.round(n - e.V) : Math.round(n + e.T + e.V),
                            o = i.map((i => this.Pv.Mi(t, i.no)));
                        for (let s = i.length; s--;) {
                            const e = i[s];
                            t.fillText(e.no, r, e.La + o[s])
                        }
                    }))
                }
                ep() {
                    if (null === this.Cv || null === this.Li) return;
                    const t = [],
                        i = this.Li.$o().slice(),
                        s = this.tn.np(),
                        e = this.Zv();
                    this.Li === s.vr() && this.tn.np().$o().forEach((t => {
                        s.dr(t) && i.push(t)
                    }));
                    const n = this.Li;
                    i.forEach((i => {
                        i.Rn(s, n).forEach((i => {
                            i.Ai(null), i.Bi() && t.push(i)
                        }))
                    })), t.forEach((t => t.Ai(t.ki()))), this.Li.W().alignLabels && this.dp(t, e)
                }
                dp(t, i) {
                    if (null === this.Cv) return;
                    const s = this.Cv.height / 2,
                        e = t.filter((t => t.ki() <= s)),
                        n = t.filter((t => t.ki() > s));
                    e.sort(((t, i) => i.ki() - t.ki())), n.sort(((t, i) => t.ki() - i.ki()));
                    for (const s of t) {
                        const t = Math.floor(s.Vt(i) / 2),
                            e = s.ki();
                        e > -t && e < t && s.Ai(t), e > this.Cv.height - t && e < this.Cv.height + t && s.Ai(this.Cv.height - t)
                    }
                    ve(e, 1, this.Cv.height, i), ve(n, -1, this.Cv.height, i)
                }
                ap(t) {
                    if (null === this.Cv) return;
                    const i = this.Qv(),
                        s = this.Zv(),
                        e = this.Vv ? "right" : "left";
                    i.forEach((i => {
                        i.Vi() && i.gt(w(this.Li)).K(t, s, this.Pv, e)
                    }))
                }
                op(t) {
                    if (null === this.Cv || null === this.Li) return;
                    const i = this.tn.Av().$t(),
                        s = [],
                        e = this.tn.np(),
                        n = i.Yc().Rn(e, this.Li);
                    n.length && s.push(n);
                    const h = this.Zv(),
                        r = this.Vv ? "right" : "left";
                    s.forEach((i => {
                        i.forEach((i => {
                            i.gt(w(this.Li)).K(t, h, this.Pv, r)
                        }))
                    }))
                }
                cp(t) {
                    this.Ev.style.cursor = 1 === t ? "ns-resize" : "default"
                }
                do() {
                    const t = this.Gv();
                    this.Rv < t && this.tn.Av().$t().Kl(), this.Rv = t
                }
                Jv() {
                    return A(this.So.fontSize, this.So.fontFamily)
                }
            }

            function ge(t, i) {
                var s, e;
                return null !== (e = null === (s = t._a) || void 0 === s ? void 0 : s.call(t, i)) && void 0 !== e ? e : []
            }

            function we(t, i) {
                var s, e;
                return null !== (e = null === (s = t.Pn) || void 0 === s ? void 0 : s.call(t, i)) && void 0 !== e ? e : []
            }

            function ye(t, i) {
                var s, e;
                return null !== (e = null === (s = t.Ji) || void 0 === s ? void 0 : s.call(t, i)) && void 0 !== e ? e : []
            }

            function Me(t, i) {
                var s, e;
                return null !== (e = null === (s = t.la) || void 0 === s ? void 0 : s.call(t, i)) && void 0 !== e ? e : []
            }
            class Se {
                constructor(t, i) {
                    this.Cv = e.size({
                        width: 0,
                        height: 0
                    }), this.fp = null, this.vp = null, this.pp = null, this.mp = !1, this.bp = new T, this.wp = new T, this.gp = 0, this.Mp = !1, this.xp = null, this.Sp = !1, this.kp = null, this.yp = null, this.Dv = !1, this.Ov = () => {
                        this.Dv || null === this.Cp || this.$i().$h()
                    }, this.Bv = () => {
                        this.Dv || null === this.Cp || this.$i().$h()
                    }, this.Tp = t, this.Cp = i, this.Cp.F_().l(this.Pp.bind(this), this, !0), this.Rp = document.createElement("td"), this.Rp.style.padding = "0", this.Rp.style.position = "relative";
                    const s = document.createElement("div");
                    s.style.width = "100%", s.style.height = "100%", s.style.position = "relative", s.style.overflow = "hidden",
                        this.Dp = document.createElement("td"), this.Dp.style.padding = "0", this.Op = document.createElement("td"), this.Op.style.padding = "0", this.Rp.appendChild(s), this.Nv = se(s, e.size({
                            width: 16,
                            height: 16
                        })), this.Nv.subscribeSuggestedBitmapSizeChanged(this.Ov);
                    const n = this.Nv.canvasElement;
                    n.style.position = "absolute", n.style.zIndex = "1", n.style.left = "0", n.style.top = "0", this.Fv = se(s, e.size({
                        width: 16,
                        height: 16
                    })), this.Fv.subscribeSuggestedBitmapSizeChanged(this.Bv);
                    const h = this.Fv.canvasElement;
                    h.style.position = "absolute", h.style.zIndex = "2", h.style.left = "0", h.style.top = "0", this.Ap = document.createElement("tr"), this.Ap.appendChild(this.Dp), this.Ap.appendChild(this.Rp), this.Ap.appendChild(this.Op), this.Bp(), this.Xv = new oe(this.Fv.canvasElement, this, {
                        qf: () => null === this.xp && !this.Tp.W().handleScroll.vertTouchDrag,
                        Yf: () => null === this.xp && !this.Tp.W().handleScroll.horzTouchDrag
                    })
                }
                S() {
                    null !== this.fp && this.fp.S(), null !== this.vp && this.vp.S(), this.Fv.unsubscribeSuggestedBitmapSizeChanged(this.Bv), ee(this.Fv.canvasElement), this.Fv.dispose(), this.Nv.unsubscribeSuggestedBitmapSizeChanged(this.Ov), ee(this.Nv.canvasElement), this.Nv.dispose(), null !== this.Cp && this.Cp.F_().p(this), this.Xv.S()
                }
                np() {
                    return w(this.Cp)
                }
                Vp(t) {
                    null !== this.Cp && this.Cp.F_().p(this), this.Cp = t, null !== this.Cp && this.Cp.F_().l(Se.prototype.Pp.bind(this), this, !0), this.Bp()
                }
                Av() {
                    return this.Tp
                }
                Kv() {
                    return this.Ap
                }
                Bp() {
                    if (null !== this.Cp && (this.Ip(), 0 !== this.$i().wt().length)) {
                        if (null !== this.fp) {
                            const t = this.Cp.P_();
                            this.fp.Gi(w(t))
                        }
                        if (null !== this.vp) {
                            const t = this.Cp.R_();
                            this.vp.Gi(w(t))
                        }
                    }
                }
                zp() {
                    null !== this.fp && this.fp.bt(), null !== this.vp && this.vp.bt()
                }
                g_() {
                    return null !== this.Cp ? this.Cp.g_() : 0
                }
                M_(t) {
                    this.Cp && this.Cp.M_(t)
                }
                Wf(t) {
                    if (!this.Cp) return;
                    this.Lp();
                    const i = t.localX,
                        s = t.localY;
                    this.Ep(i, s, t)
                }
                hv(t) {
                    this.Lp(), this.Np(), this.Ep(t.localX, t.localY, t)
                }
                jf(t) {
                    var i;
                    if (!this.Cp) return;
                    this.Lp();
                    const s = t.localX,
                        e = t.localY;
                    this.Ep(s, e, t);
                    const n = this.br(s, e);
                    this.Tp.Fp(null !== (i = null == n ? void 0 : n.yv) && void 0 !== i ? i : null), this.$i().Wc(n && {
                        jc: n.jc,
                        Sv: n.Sv
                    })
                }
                iv(t) {
                    null !== this.Cp && (this.Lp(), this.Wp(t))
                }
                Vf(t) {
                    null !== this.Cp && this.jp(this.wp, t)
                }
                Df(t) {
                    this.Vf(t)
                }
                Zf(t) {
                    this.Lp(), this.Hp(t), this.Ep(t.localX, t.localY, t)
                }
                tv(t) {
                    null !== this.Cp && (this.Lp(), this.Mp = !1, this.$p(t))
                }
                Qf(t) {
                    null !== this.Cp && this.Wp(t)
                }
                mv(t) {
                    if (this.Mp = !0, null === this.xp) {
                        const i = {
                            x: t.localX,
                            y: t.localY
                        };
                        this.Up(i, i, t)
                    }
                }
                pv(t) {
                    null !== this.Cp && (this.Lp(), this.Cp.$t().Wc(null), this.qp())
                }
                Yp() {
                    return this.bp
                }
                Xp() {
                    return this.wp
                }
                _v() {
                    this.gp = 1, this.$i().Un()
                }
                uv(t, i) {
                    if (!this.Tp.W().handleScale.pinch) return;
                    const s = 5 * (i - this.gp);
                    this.gp = i, this.$i().Jc(t.nt, s)
                }
                ev(t) {
                    this.Mp = !1, this.Sp = null !== this.xp, this.Np();
                    const i = this.$i().Yc();
                    null !== this.xp && i.yt() && (this.kp = {
                        x: i.Yt(),
                        y: i.Xt()
                    }, this.xp = {
                        x: t.localX,
                        y: t.localY
                    })
                }
                Xf(t) {
                    if (null === this.Cp) return;
                    const i = t.localX,
                        s = t.localY;
                    if (null === this.xp) this.Hp(t);
                    else {
                        this.Sp = !1;
                        const e = w(this.kp),
                            n = e.x + (i - this.xp.x),
                            h = e.y + (s - this.xp.y);
                        this.Ep(n, h, t)
                    }
                }
                Jf(t) {
                    0 === this.Av().W().trackingMode.exitMode && (this.Sp = !0), this.Kp(), this.$p(t)
                }
                br(t, i) {
                    const s = this.Cp;
                    return null === s ? null : function(t, i, s) {
                        const e = t.$o(),
                            n = function(t, i, s) {
                                var e, n;
                                let h, r;
                                for (const a of t) {
                                    const t = null !== (n = null === (e = a.fa) || void 0 === e ? void 0 : e.call(a, i, s)) && void 0 !== n ? n : [];
                                    for (const i of t) o = i.zOrder, (!(l = null == h ? void 0 : h.zOrder) || "top" === o && "top" !== l || "normal" === o && "bottom" === l) && (h = i, r = a)
                                }
                                var o, l;
                                return h && r ? {
                                    kv: h,
                                    jc: r
                                } : null
                            }(e, i, s);
                        if ("top" === (null == n ? void 0 : n.kv.zOrder)) return de(n);
                        for (const h of e) {
                            if (n && n.jc === h && "bottom" !== n.kv.zOrder && !n.kv.isBackground) return de(n);
                            const e = pe(h.Pn(t), i, s);
                            if (null !== e) return {
                                jc: h,
                                Mv: e.Mv,
                                Sv: e.Sv
                            };
                            if (n && n.jc === h && "bottom" !== n.kv.zOrder && n.kv.isBackground) return de(n)
                        }
                        return (null == n ? void 0 : n.kv) ? de(n) : null
                    }(s, t, i)
                }
                Zp(t, i) {
                    w("left" === i ? this.fp : this.vp).tp(e.size({
                        width: t,
                        height: this.Cv.height
                    }))
                }
                Gp() {
                    return this.Cv
                }
                tp(t) {
                    (0, e.equalSizes)(this.Cv, t) || (this.Cv = t, this.Dv = !0, this.Nv.resizeCanvasElement(t), this.Fv.resizeCanvasElement(t), this.Dv = !1, this.Rp.style.width = t.width + "px", this.Rp.style.height = t.height + "px")
                }
                Jp() {
                    const t = w(this.Cp);
                    t.T_(t.P_()), t.T_(t.R_());
                    for (const i of t.Aa())
                        if (t.dr(i)) {
                            const s = i.Dt();
                            null !== s && t.T_(s), i.On()
                        }
                }
                _p() {
                    return this.Nv.bitmapSize
                }
                up(t, i, s) {
                    const e = this._p();
                    e.width > 0 && e.height > 0 && t.drawImage(this.Nv.canvasElement, i, s)
                }
                sp(t) {
                    if (0 === t) return;
                    if (null === this.Cp) return;
                    if (t > 1 && this.Jp(), null !== this.fp && this.fp.sp(t), null !== this.vp && this.vp.sp(t), 1 !== t) {
                        this.Nv.applySuggestedBitmapSize();
                        const t = (0, e.tryCreateCanvasRenderingTarget2D)(this.Nv);
                        null !== t && (t.useBitmapCoordinateSpace((t => {
                            this.rp(t)
                        })), this.Cp && (this.Qp(t, ge), this.tm(t), this.im(t), this.Qp(t, we), this.Qp(t, ye)))
                    }
                    this.Fv.applySuggestedBitmapSize();
                    const i = (0, e.tryCreateCanvasRenderingTarget2D)(this.Fv);
                    null !== i && (i.useBitmapCoordinateSpace((({
                        context: t,
                        bitmapSize: i
                    }) => {
                        t.clearRect(0, 0, i.width, i.height)
                    })), this.nm(i), this.Qp(i, Me))
                }
                sm() {
                    return this.fp
                }
                rm() {
                    return this.vp
                }
                hp(t, i) {
                    this.Qp(t, i)
                }
                Pp() {
                    null !== this.Cp && this.Cp.F_().p(this), this.Cp = null
                }
                Wp(t) {
                    this.jp(this.bp, t)
                }
                jp(t, i) {
                    const s = i.localX,
                        e = i.localY;
                    t.M() && t.m(this.$i().St().Eu(s), {
                        x: s,
                        y: e
                    }, i)
                }
                rp({
                    context: t,
                    bitmapSize: i
                }) {
                    const {
                        width: s,
                        height: e
                    } = i, n = this.$i(), h = n.q(), r = n.md();
                    h === r ? Y(t, 0, 0, s, e, r) : tt(t, 0, 0, s, e, h, r)
                }
                tm(t) {
                    const i = w(this.Cp).W_().Uh().gt();
                    null !== i && i.K(t, !1)
                }
                im(t) {
                    const i = this.$i().qc();
                    this.hm(t, we, ne, i), this.hm(t, we, he, i)
                }
                nm(t) {
                    this.hm(t, we, he, this.$i().Yc())
                }
                Qp(t, i) {
                    const s = w(this.Cp).$o();
                    for (const e of s) this.hm(t, i, ne, e);
                    for (const e of s) this.hm(t, i, he, e)
                }
                hm(t, i, s, e) {
                    const n = w(this.Cp),
                        h = n.$t().Fc(),
                        r = null !== h && h.jc === e,
                        o = null !== h && r && void 0 !== h.Sv ? h.Sv.gr : void 0;
                    re(i, (i => s(i, t, r, o)), e, n)
                }
                Ip() {
                    if (null === this.Cp) return;
                    const t = this.Tp,
                        i = this.Cp.P_().W().visible,
                        s = this.Cp.R_().W().visible;
                    i || null === this.fp || (this.Dp.removeChild(this.fp.Kv()), this.fp.S(), this.fp = null), s || null === this.vp || (this.Op.removeChild(this.vp.Kv()), this.vp.S(), this.vp = null);
                    const e = t.$t()._d();
                    i && null === this.fp && (this.fp = new be(this, t.W(), e, "left"), this.Dp.appendChild(this.fp.Kv())), s && null === this.vp && (this.vp = new be(this, t.W(), e, "right"), this.Op.appendChild(this.vp.Kv()))
                }
                lm(t) {
                    return t.bv && this.Mp || null !== this.xp
                }
                am(t) {
                    return Math.max(0, Math.min(t, this.Cv.width - 1))
                }
                om(t) {
                    return Math.max(0, Math.min(t, this.Cv.height - 1))
                }
                Ep(t, i, s) {
                    this.$i().hd(this.am(t), this.om(i), s, w(this.Cp))
                }
                qp() {
                    this.$i().ad()
                }
                Kp() {
                    this.Sp && (this.xp = null, this.qp())
                }
                Up(t, i, s) {
                    this.xp = t, this.Sp = !1, this.Ep(i.x, i.y, s);
                    const e = this.$i().Yc();
                    this.kp = {
                        x: e.Yt(),
                        y: e.Xt()
                    }
                }
                $i() {
                    return this.Tp.$t()
                }
                $p(t) {
                    if (!this.mp) return;
                    const i = this.$i(),
                        s = this.np();
                    if (i.I_(s, s.vn()), this.pp = null, this.mp = !1, i.sd(), null !== this.yp) {
                        const t = performance.now(),
                            s = i.St();
                        this.yp.Dr(s.ju(), t), this.yp.Ju(t) || i.Xn(this.yp)
                    }
                }
                Lp() {
                    this.xp = null
                }
                Np() {
                    if (this.Cp) {
                        if (this.$i().Un(), document.activeElement !== document.body && document.activeElement !== document.documentElement) w(document.activeElement).blur();
                        else {
                            const t = document.getSelection();
                            null !== t && t.removeAllRanges()
                        }!this.Cp.vn().Ni() && this.$i().St().Ni()
                    }
                }
                Hp(t) {
                    if (null === this.Cp) return;
                    const i = this.$i(),
                        s = i.St();
                    if (s.Ni()) return;
                    const e = this.Tp.W(),
                        n = e.handleScroll,
                        h = e.kineticScroll;
                    if ((!n.pressedMouseMove || t.bv) && (!n.horzTouchDrag && !n.vertTouchDrag || !t.bv)) return;
                    const r = this.Cp.vn(),
                        o = performance.now();
                    if (null !== this.pp || this.lm(t) || (this.pp = {
                            x: t.clientX,
                            y: t.clientY,
                            Od: o,
                            _m: t.localX,
                            um: t.localY
                        }), null !== this.pp && !this.mp && (this.pp.x !== t.clientX || this.pp.y !== t.clientY)) {
                        if (t.bv && h.touch || !t.bv && h.mouse) {
                            const t = s.he();
                            this.yp = new ie(.2 / t, 7 / t, .997, 15 / t), this.yp.qd(s.ju(), this.pp.Od)
                        } else this.yp = null;
                        r.Ni() || i.B_(this.Cp, r, t.localY), i.td(t.localX), this.mp = !0
                    }
                    this.mp && (r.Ni() || i.V_(this.Cp, r, t.localY), i.nd(t.localX), null !== this.yp && this.yp.qd(s.ju(), o))
                }
            }
            class Ce {
                constructor(t, i, s, n, h) {
                    this.ft = !0, this.Cv = e.size({
                        width: 0,
                        height: 0
                    }), this.Ov = () => this.sp(3), this.Vv = "left" === t, this.Oc = s._d, this.cn = i, this.dm = n, this.fm = h, this.Ev = document.createElement("div"), this.Ev.style.width = "25px", this.Ev.style.height = "100%", this.Ev.style.overflow = "hidden", this.Nv = se(this.Ev, e.size({
                        width: 16,
                        height: 16
                    })), this.Nv.subscribeSuggestedBitmapSizeChanged(this.Ov)
                }
                S() {
                    this.Nv.unsubscribeSuggestedBitmapSizeChanged(this.Ov), ee(this.Nv.canvasElement), this.Nv.dispose()
                }
                Kv() {
                    return this.Ev
                }
                Gp() {
                    return this.Cv
                }
                tp(t) {
                    (0, e.equalSizes)(this.Cv, t) || (this.Cv = t, this.Nv.resizeCanvasElement(t), this.Ev.style.width = `${t.width}px`, this.Ev.style.height = `${t.height}px`, this.ft = !0)
                }
                sp(t) {
                    if (t < 3 && !this.ft) return;
                    if (0 === this.Cv.width || 0 === this.Cv.height) return;
                    this.ft = !1, this.Nv.applySuggestedBitmapSize();
                    const i = (0, e.tryCreateCanvasRenderingTarget2D)(this.Nv);
                    null !== i && i.useBitmapCoordinateSpace((t => {
                        this.rp(t), this.Ve(t)
                    }))
                }
                _p() {
                    return this.Nv.bitmapSize
                }
                up(t, i, s) {
                    const e = this._p();
                    e.width > 0 && e.height > 0 && t.drawImage(this.Nv.canvasElement, i, s)
                }
                Ve({
                    context: t,
                    bitmapSize: i,
                    horizontalPixelRatio: s,
                    verticalPixelRatio: e
                }) {
                    if (!this.dm()) return;
                    t.fillStyle = this.cn.timeScale.borderColor;
                    const n = Math.floor(this.Oc.W().C * s),
                        h = Math.floor(this.Oc.W().C * e),
                        r = this.Vv ? i.width - n : 0;
                    t.fillRect(r, 0, n, h)
                }
                rp({
                    context: t,
                    bitmapSize: i
                }) {
                    Y(t, 0, 0, i.width, i.height, this.fm())
                }
            }

            function xe(t) {
                return i => {
                    var s, e;
                    return null !== (e = null === (s = i.da) || void 0 === s ? void 0 : s.call(i, t)) && void 0 !== e ? e : []
                }
            }
            const ze = xe("normal"),
                ke = xe("top"),
                _e = xe("bottom");
            class Le {
                constructor(t, i) {
                    this.vm = null, this.pm = null, this.k = null, this.bm = !1, this.Cv = e.size({
                        width: 0,
                        height: 0
                    }), this.wm = new T, this.Pv = new ti(5), this.Dv = !1, this.Ov = () => {
                        this.Dv || this.Tp.$t().$h()
                    }, this.Bv = () => {
                        this.Dv || this.Tp.$t().$h()
                    }, this.Tp = t, this.U_ = i, this.cn = t.W().layout, this.gm = document.createElement("tr"), this.Mm = document.createElement("td"), this.Mm.style.padding = "0", this.xm = document.createElement("td"), this.xm.style.padding = "0", this.Ev = document.createElement("td"), this.Ev.style.height = "25px", this.Ev.style.padding = "0", this.Sm = document.createElement("div"), this.Sm.style.width = "100%", this.Sm.style.height = "100%", this.Sm.style.position = "relative", this.Sm.style.overflow = "hidden", this.Ev.appendChild(this.Sm), this.Nv = se(this.Sm, e.size({
                        width: 16,
                        height: 16
                    })), this.Nv.subscribeSuggestedBitmapSizeChanged(this.Ov);
                    const s = this.Nv.canvasElement;
                    s.style.position = "absolute", s.style.zIndex = "1", s.style.left = "0", s.style.top = "0", this.Fv = se(this.Sm, e.size({
                        width: 16,
                        height: 16
                    })), this.Fv.subscribeSuggestedBitmapSizeChanged(this.Bv);
                    const n = this.Fv.canvasElement;
                    n.style.position = "absolute", n.style.zIndex = "2", n.style.left = "0", n.style.top = "0", this.gm.appendChild(this.Mm), this.gm.appendChild(this.Ev), this.gm.appendChild(this.xm), this.km(), this.Tp.$t().w_().l(this.km.bind(this), this), this.Xv = new oe(this.Fv.canvasElement, this, {
                        qf: () => !0,
                        Yf: () => !this.Tp.W().handleScroll.horzTouchDrag
                    })
                }
                S() {
                    this.Xv.S(), null !== this.vm && this.vm.S(), null !== this.pm && this.pm.S(), this.Fv.unsubscribeSuggestedBitmapSizeChanged(this.Bv), ee(this.Fv.canvasElement), this.Fv.dispose(), this.Nv.unsubscribeSuggestedBitmapSizeChanged(this.Ov), ee(this.Nv.canvasElement), this.Nv.dispose()
                }
                Kv() {
                    return this.gm
                }
                ym() {
                    return this.vm
                }
                Cm() {
                    return this.pm
                }
                hv(t) {
                    if (this.bm) return;
                    this.bm = !0;
                    const i = this.Tp.$t();
                    !i.St().Ni() && this.Tp.W().handleScale.axisPressedMouseMove.time && i.Gc(t.localX)
                }
                ev(t) {
                    this.hv(t)
                }
                lv() {
                    const t = this.Tp.$t();
                    !t.St().Ni() && this.bm && (this.bm = !1, this.Tp.W().handleScale.axisPressedMouseMove.time && t.rd())
                }
                Zf(t) {
                    const i = this.Tp.$t();
                    !i.St().Ni() && this.Tp.W().handleScale.axisPressedMouseMove.time && i.ed(t.localX)
                }
                Xf(t) {
                    this.Zf(t)
                }
                tv() {
                    this.bm = !1;
                    const t = this.Tp.$t();
                    t.St().Ni() && !this.Tp.W().handleScale.axisPressedMouseMove.time || t.rd()
                }
                Jf() {
                    this.tv()
                }
                Vf() {
                    this.Tp.W().handleScale.axisDoubleClickReset.time && this.Tp.$t().Zn()
                }
                Df() {
                    this.Vf()
                }
                Wf() {
                    this.Tp.$t().W().handleScale.axisPressedMouseMove.time && this.cp(1)
                }
                pv() {
                    this.cp(0)
                }
                Gp() {
                    return this.Cv
                }
                Tm() {
                    return this.wm
                }
                Pm(t, i, s) {
                    (0, e.equalSizes)(this.Cv, t) || (this.Cv = t, this.Dv = !0, this.Nv.resizeCanvasElement(t), this.Fv.resizeCanvasElement(t), this.Dv = !1, this.Ev.style.width = `${t.width}px`, this.Ev.style.height = `${t.height}px`, this.wm.m(t)), null !== this.vm && this.vm.tp(e.size({
                        width: i,
                        height: t.height
                    })), null !== this.pm && this.pm.tp(e.size({
                        width: s,
                        height: t.height
                    }))
                }
                Rm() {
                    const t = this.Dm();
                    return Math.ceil(t.C + t.T + t.P + t.L + t.B + t.Om)
                }
                bt() {
                    this.Tp.$t().St().ja()
                }
                _p() {
                    return this.Nv.bitmapSize
                }
                up(t, i, s) {
                    const e = this._p();
                    e.width > 0 && e.height > 0 && t.drawImage(this.Nv.canvasElement, i, s)
                }
                sp(t) {
                    if (0 === t) return;
                    if (1 !== t) {
                        this.Nv.applySuggestedBitmapSize();
                        const i = (0, e.tryCreateCanvasRenderingTarget2D)(this.Nv);
                        null !== i && (i.useBitmapCoordinateSpace((t => {
                            this.rp(t), this.Ve(t), this.Am(i, _e)
                        })), this.lp(i), this.Am(i, ze)), null !== this.vm && this.vm.sp(t), null !== this.pm && this.pm.sp(t)
                    }
                    this.Fv.applySuggestedBitmapSize();
                    const i = (0, e.tryCreateCanvasRenderingTarget2D)(this.Fv);
                    null !== i && (i.useBitmapCoordinateSpace((({
                        context: t,
                        bitmapSize: i
                    }) => {
                        t.clearRect(0, 0, i.width, i.height)
                    })), this.Bm([...this.Tp.$t().wt(), this.Tp.$t().Yc()], i), this.Am(i, ke))
                }
                Am(t, i) {
                    const s = this.Tp.$t().wt();
                    for (const e of s) re(i, (i => ne(i, t, !1, void 0)), e, void 0);
                    for (const e of s) re(i, (i => he(i, t, !1, void 0)), e, void 0)
                }
                rp({
                    context: t,
                    bitmapSize: i
                }) {
                    Y(t, 0, 0, i.width, i.height, this.Tp.$t().md())
                }
                Ve({
                    context: t,
                    bitmapSize: i,
                    verticalPixelRatio: s
                }) {
                    if (this.Tp.W().timeScale.borderVisible) {
                        t.fillStyle = this.Vm();
                        const e = Math.max(1, Math.floor(this.Dm().C * s));
                        t.fillRect(0, 0, i.width, e)
                    }
                }
                lp(t) {
                    const i = this.Tp.$t().St(),
                        s = i.ja();
                    if (!s || 0 === s.length) return;
                    const e = this.U_.maxTickMarkWeight(s),
                        n = this.Dm(),
                        h = i.W();
                    h.borderVisible && h.ticksVisible && t.useBitmapCoordinateSpace((({
                        context: t,
                        horizontalPixelRatio: i,
                        verticalPixelRatio: e
                    }) => {
                        t.strokeStyle = this.Vm(), t.fillStyle = this.Vm();
                        const h = Math.max(1, Math.floor(i)),
                            r = Math.floor(.5 * i);
                        t.beginPath();
                        const o = Math.round(n.T * e);
                        for (let e = s.length; e--;) {
                            const n = Math.round(s[e].coord * i);
                            t.rect(n - r, 0, h, o)
                        }
                        t.fill()
                    })), t.useMediaCoordinateSpace((({
                        context: t
                    }) => {
                        const i = n.C + n.T + n.L + n.P / 2;
                        t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = this.$(), t.font = this.Jv();
                        for (const n of s)
                            if (n.weight < e) {
                                const s = n.needAlignCoordinate ? this.Im(t, n.coord, n.label) : n.coord;
                                t.fillText(n.label, s, i)
                            }
                        this.Tp.W().timeScale.allowBoldLabels && (t.font = this.zm());
                        for (const n of s)
                            if (n.weight >= e) {
                                const s = n.needAlignCoordinate ? this.Im(t, n.coord, n.label) : n.coord;
                                t.fillText(n.label, s, i)
                            }
                    }))
                }
                Im(t, i, s) {
                    const e = this.Pv.xi(t, s),
                        n = e / 2,
                        h = Math.floor(i - n) + .5;
                    return h < 0 ? i += Math.abs(0 - h) : h + e > this.Cv.width && (i -= Math.abs(this.Cv.width - (h + e))), i
                }
                Bm(t, i) {
                    const s = this.Dm();
                    for (const e of t)
                        for (const t of e.Qi()) t.gt().K(i, s)
                }
                Vm() {
                    return this.Tp.W().timeScale.borderColor
                }
                $() {
                    return this.cn.textColor
                }
                j() {
                    return this.cn.fontSize
                }
                Jv() {
                    return A(this.j(), this.cn.fontFamily)
                }
                zm() {
                    return A(this.j(), this.cn.fontFamily, "bold")
                }
                Dm() {
                    null === this.k && (this.k = {
                        C: 1,
                        N: NaN,
                        L: NaN,
                        B: NaN,
                        ji: NaN,
                        T: 5,
                        P: NaN,
                        R: "",
                        Wi: new ti,
                        Om: 0
                    });
                    const t = this.k,
                        i = this.Jv();
                    if (t.R !== i) {
                        const s = this.j();
                        t.P = s, t.R = i, t.L = 3 * s / 12, t.B = 3 * s / 12, t.ji = 9 * s / 12, t.N = 0, t.Om = 4 * s / 12, t.Wi.ir()
                    }
                    return this.k
                }
                cp(t) {
                    this.Ev.style.cursor = 1 === t ? "ew-resize" : "default"
                }
                km() {
                    const t = this.Tp.$t(),
                        i = t.W();
                    i.leftPriceScale.visible || null === this.vm || (this.Mm.removeChild(this.vm.Kv()), this.vm.S(), this.vm = null), i.rightPriceScale.visible || null === this.pm || (this.xm.removeChild(this.pm.Kv()), this.pm.S(), this.pm = null);
                    const s = {
                            _d: this.Tp.$t()._d()
                        },
                        e = () => i.leftPriceScale.borderVisible && t.St().W().borderVisible,
                        n = () => t.md();
                    i.leftPriceScale.visible && null === this.vm && (this.vm = new Ce("left", i, s, e, n), this.Mm.appendChild(this.vm.Kv())),
                        i.rightPriceScale.visible && null === this.pm && (this.pm = new Ce("right", i, s, e, n), this.xm.appendChild(this.pm.Kv()))
                }
            }
            const Oe = !!Gs && !!navigator.userAgentData && navigator.userAgentData.brands.some((t => t.brand.includes("Chromium"))) && !!Gs && ((null === (Te = null === navigator || void 0 === navigator ? void 0 : navigator.userAgentData) || void 0 === Te ? void 0 : Te.platform) ? "Windows" === navigator.userAgentData.platform : navigator.userAgent.toLowerCase().indexOf("win") >= 0);
            var Te;
            class Ee {
                constructor(t, i, s) {
                    var e;
                    this.Lm = [], this.Em = 0, this.ro = 0, this.o_ = 0, this.Nm = 0, this.Fm = 0, this.Wm = null, this.jm = !1, this.bp = new T, this.wp = new T, this.Pc = new T, this.Hm = null, this.$m = null, this.Um = t, this.cn = i, this.U_ = s, this.gm = document.createElement("div"), this.gm.classList.add("tv-lightweight-charts"), this.gm.style.overflow = "hidden", this.gm.style.direction = "ltr", this.gm.style.width = "100%", this.gm.style.height = "100%", (e = this.gm).style.userSelect = "none", e.style.webkitUserSelect = "none", e.style.msUserSelect = "none", e.style.MozUserSelect = "none", e.style.webkitTapHighlightColor = "transparent", this.qm = document.createElement("table"), this.qm.setAttribute("cellspacing", "0"), this.gm.appendChild(this.qm), this.Ym = this.Xm.bind(this), Ne(this.cn) && this.Km(!0), this.$i = new Ns(this.Dc.bind(this), this.cn, s), this.$t().Xc().l(this.Zm.bind(this), this), this.Gm = new Le(this, this.U_), this.qm.appendChild(this.Gm.Kv());
                    const n = i.autoSize && this.Jm();
                    let h = this.cn.width,
                        r = this.cn.height;
                    if (n || 0 === h || 0 === r) {
                        const i = t.getBoundingClientRect();
                        h = h || i.width, r = r || i.height
                    }
                    this.Qm(h, r), this.tb(), t.appendChild(this.gm), this.ib(), this.$i.St().sc().l(this.$i.Kl.bind(this.$i), this), this.$i.w_().l(this.$i.Kl.bind(this.$i), this)
                }
                $t() {
                    return this.$i
                }
                W() {
                    return this.cn
                }
                nb() {
                    return this.Lm
                }
                sb() {
                    return this.Gm
                }
                S() {
                    this.Km(!1), 0 !== this.Em && window.cancelAnimationFrame(this.Em), this.$i.Xc().p(this), this.$i.St().sc().p(this), this.$i.w_().p(this), this.$i.S();
                    for (const t of this.Lm) this.qm.removeChild(t.Kv()), t.Yp().p(this), t.Xp().p(this), t.S();
                    this.Lm = [], w(this.Gm).S(), null !== this.gm.parentElement && this.gm.parentElement.removeChild(this.gm), this.Pc.S(), this.bp.S(), this.wp.S(), this.eb()
                }
                Qm(t, i, s = !1) {
                    if (this.ro === i && this.o_ === t) return;
                    const n = function(t) {
                        const i = Math.floor(t.width),
                            s = Math.floor(t.height);
                        return e.size({
                            width: i - i % 2,
                            height: s - s % 2
                        })
                    }(e.size({
                        width: t,
                        height: i
                    }));
                    this.ro = n.height, this.o_ = n.width;
                    const h = this.ro + "px",
                        r = this.o_ + "px";
                    w(this.gm).style.height = h, w(this.gm).style.width = r, this.qm.style.height = h, this.qm.style.width = r, s ? this.rb(ct.es(), performance.now()) : this.$i.Kl()
                }
                sp(t) {
                    void 0 === t && (t = ct.es());
                    for (let i = 0; i < this.Lm.length; i++) this.Lm[i].sp(t.Hn(i).Fn);
                    this.cn.timeScale.visible && this.Gm.sp(t.jn())
                }
                Hh(t) {
                    const i = Ne(this.cn);
                    this.$i.Hh(t);
                    const s = Ne(this.cn);
                    s !== i && this.Km(s), this.ib(), this.hb(t)
                }
                Yp() {
                    return this.bp
                }
                Xp() {
                    return this.wp
                }
                Xc() {
                    return this.Pc
                }
                lb() {
                    null !== this.Wm && (this.rb(this.Wm, performance.now()), this.Wm = null);
                    const t = this.ab(null),
                        i = document.createElement("canvas");
                    i.width = t.width, i.height = t.height;
                    const s = w(i.getContext("2d"));
                    return this.ab(s), i
                }
                ob(t) {
                    return ("left" !== t || this._b()) && ("right" !== t || this.ub()) ? 0 === this.Lm.length ? 0 : w("left" === t ? this.Lm[0].sm() : this.Lm[0].rm()).ip() : 0
                }
                cb() {
                    return this.cn.autoSize && null !== this.Hm
                }
                fb() {
                    return this.gm
                }
                Fp(t) {
                    this.$m = t, this.$m ? this.fb().style.setProperty("cursor", t) : this.fb().style.removeProperty("cursor")
                }
                pb() {
                    return this.$m
                }
                mb() {
                    return g(this.Lm[0]).Gp()
                }
                hb(t) {
                    (void 0 !== t.autoSize || !this.Hm || void 0 === t.width && void 0 === t.height) && (t.autoSize && !this.Hm && this.Jm(), !1 === t.autoSize && null !== this.Hm && this.eb(), t.autoSize || void 0 === t.width && void 0 === t.height || this.Qm(t.width || this.o_, t.height || this.ro))
                }
                ab(t) {
                    let i = 0,
                        s = 0;
                    const n = this.Lm[0],
                        h = (i, s) => {
                            let e = 0;
                            for (let n = 0; n < this.Lm.length; n++) {
                                const h = this.Lm[n],
                                    r = w("left" === i ? h.sm() : h.rm()),
                                    o = r._p();
                                null !== t && r.up(t, s, e), e += o.height
                            }
                        };
                    this._b() && (h("left", 0), i += w(n.sm())._p().width);
                    for (let e = 0; e < this.Lm.length; e++) {
                        const n = this.Lm[e],
                            h = n._p();
                        null !== t && n.up(t, i, s), s += h.height
                    }
                    i += n._p().width, this.ub() && (h("right", i), i += w(n.rm())._p().width);
                    const r = (i, s, e) => {
                        w("left" === i ? this.Gm.ym() : this.Gm.Cm()).up(w(t), s, e)
                    };
                    if (this.cn.timeScale.visible) {
                        const i = this.Gm._p();
                        if (null !== t) {
                            let e = 0;
                            this._b() && (r("left", e, s), e = w(n.sm())._p().width), this.Gm.up(t, e, s), e += i.width, this.ub() && r("right", e, s)
                        }
                        s += i.height
                    }
                    return e.size({
                        width: i,
                        height: s
                    })
                }
                bb() {
                    let t = 0,
                        i = 0,
                        s = 0;
                    for (const e of this.Lm) this._b() && (i = Math.max(i, w(e.sm()).Gv(), this.cn.leftPriceScale.minimumWidth)), this.ub() && (s = Math.max(s, w(e.rm()).Gv(), this.cn.rightPriceScale.minimumWidth)), t += e.g_();
                    i = qs(i), s = qs(s);
                    const n = this.o_,
                        h = this.ro,
                        r = Math.max(n - i - s, 0),
                        o = this.cn.timeScale.visible;
                    let l = o ? Math.max(this.Gm.Rm(), this.cn.timeScale.minimumHeight) : 0;
                    var a;
                    l = (a = l) + a % 2;
                    const u = 0 + l,
                        c = h < u ? 0 : h - u,
                        f = c / t;
                    let d = 0;
                    for (let t = 0; t < this.Lm.length; ++t) {
                        const n = this.Lm[t];
                        n.Vp(this.$i.Uc()[t]);
                        let h = 0,
                            o = 0;
                        o = t === this.Lm.length - 1 ? c - d : Math.round(n.g_() * f), h = Math.max(o, 2), d += h, n.tp(e.size({
                            width: r,
                            height: h
                        })), this._b() && n.Zp(i, "left"), this.ub() && n.Zp(s, "right"), n.np() && this.$i.Kc(n.np(), h)
                    }
                    this.Gm.Pm(e.size({
                        width: o ? r : 0,
                        height: l
                    }), o ? i : 0, o ? s : 0), this.$i.x_(r), this.Nm !== i && (this.Nm = i), this.Fm !== s && (this.Fm = s)
                }
                Km(t) {
                    t ? this.gm.addEventListener("wheel", this.Ym, {
                        passive: !1
                    }) : this.gm.removeEventListener("wheel", this.Ym)
                }
                wb(t) {
                    switch (t.deltaMode) {
                        case t.DOM_DELTA_PAGE:
                            return 120;
                        case t.DOM_DELTA_LINE:
                            return 32
                    }
                    return Oe ? 1 / window.devicePixelRatio : 1
                }
                Xm(t) {
                    if (!(0 !== t.deltaX && this.cn.handleScroll.mouseWheel || 0 !== t.deltaY && this.cn.handleScale.mouseWheel)) return;
                    const i = this.wb(t),
                        s = i * t.deltaX / 100,
                        e = -i * t.deltaY / 100;
                    if (t.cancelable && t.preventDefault(), 0 !== e && this.cn.handleScale.mouseWheel) {
                        const i = Math.sign(e) * Math.min(1, Math.abs(e)),
                            s = t.clientX - this.gm.getBoundingClientRect().left;
                        this.$t().Jc(s, i)
                    }
                    0 !== s && this.cn.handleScroll.mouseWheel && this.$t().Qc(-80 * s)
                }
                rb(t, i) {
                    var s;
                    const e = t.jn();
                    3 === e && this.gb(), 3 !== e && 2 !== e || (this.Mb(t), this.xb(t, i), this.Gm.bt(), this.Lm.forEach((t => {
                        t.zp()
                    })), 3 === (null === (s = this.Wm) || void 0 === s ? void 0 : s.jn()) && (this.Wm.ts(t), this.gb(), this.Mb(this.Wm), this.xb(this.Wm, i), t = this.Wm, this.Wm = null)), this.sp(t)
                }
                xb(t, i) {
                    for (const s of t.Qn()) this.ns(s, i)
                }
                Mb(t) {
                    const i = this.$i.Uc();
                    for (let s = 0; s < i.length; s++) t.Hn(s).Wn && i[s].E_()
                }
                ns(t, i) {
                    const s = this.$i.St();
                    switch (t.qn) {
                        case 0:
                            s.rc();
                            break;
                        case 1:
                            s.hc(t.Ot);
                            break;
                        case 2:
                            s.Gn(t.Ot);
                            break;
                        case 3:
                            s.Jn(t.Ot);
                            break;
                        case 4:
                            s.Uu();
                            break;
                        case 5:
                            t.Ot.Ju(i) || s.Jn(t.Ot.Qu(i))
                    }
                }
                Dc(t) {
                    null !== this.Wm ? this.Wm.ts(t) : this.Wm = t, this.jm || (this.jm = !0, this.Em = window.requestAnimationFrame((t => {
                        if (this.jm = !1, this.Em = 0, null !== this.Wm) {
                            const i = this.Wm;
                            this.Wm = null, this.rb(i, t);
                            for (const s of i.Qn())
                                if (5 === s.qn && !s.Ot.Ju(t)) {
                                    this.$t().Xn(s.Ot);
                                    break
                                }
                        }
                    })))
                }
                gb() {
                    this.tb()
                }
                tb() {
                    const t = this.$i.Uc(),
                        i = t.length,
                        s = this.Lm.length;
                    for (let t = i; t < s; t++) {
                        const t = g(this.Lm.pop());
                        this.qm.removeChild(t.Kv()), t.Yp().p(this), t.Xp().p(this), t.S()
                    }
                    for (let e = s; e < i; e++) {
                        const i = new Se(this, t[e]);
                        i.Yp().l(this.Sb.bind(this), this), i.Xp().l(this.kb.bind(this), this), this.Lm.push(i), this.qm.insertBefore(i.Kv(), this.Gm.Kv())
                    }
                    for (let s = 0; s < i; s++) {
                        const i = t[s],
                            e = this.Lm[s];
                        e.np() !== i ? e.Vp(i) : e.Bp()
                    }
                    this.ib(), this.bb()
                }
                yb(t, i, s) {
                    var e;
                    const n = new Map;
                    let h;
                    if (null !== t && this.$i.wt().forEach((i => {
                            const s = i.In().hl(t);
                            null !== s && n.set(i, s)
                        })), null !== t) {
                        const i = null === (e = this.$i.St().Ui(t)) || void 0 === e ? void 0 : e.originalTime;
                        void 0 !== i && (h = i)
                    }
                    const r = this.$t().Fc(),
                        o = null !== r && r.jc instanceof Ki ? r.jc : void 0,
                        l = null !== r && void 0 !== r.Sv ? r.Sv.wr : void 0;
                    return {
                        Cb: h,
                        se: null != t ? t : void 0,
                        Tb: null != i ? i : void 0,
                        Pb: o,
                        Rb: n,
                        Db: l,
                        Ob: null != s ? s : void 0
                    }
                }
                Sb(t, i, s) {
                    this.bp.m((() => this.yb(t, i, s)))
                }
                kb(t, i, s) {
                    this.wp.m((() => this.yb(t, i, s)))
                }
                Zm(t, i, s) {
                    this.Pc.m((() => this.yb(t, i, s)))
                }
                ib() {
                    const t = this.cn.timeScale.visible ? "" : "none";
                    this.Gm.Kv().style.display = t
                }
                _b() {
                    return this.Lm[0].np().P_().W().visible
                }
                ub() {
                    return this.Lm[0].np().R_().W().visible
                }
                Jm() {
                    return "ResizeObserver" in window && (this.Hm = new ResizeObserver((t => {
                        const i = t.find((t => t.target === this.Um));
                        i && this.Qm(i.contentRect.width, i.contentRect.height)
                    })), this.Hm.observe(this.Um, {
                        box: "border-box"
                    }), !0)
                }
                eb() {
                    null !== this.Hm && this.Hm.disconnect(), this.Hm = null
                }
            }

            function Ne(t) {
                return Boolean(t.handleScroll.mouseWheel || t.handleScale.mouseWheel)
            }

            function $e(t, i) {
                var s = {};
                for (var e in t) Object.prototype.hasOwnProperty.call(t, e) && i.indexOf(e) < 0 && (s[e] = t[e]);
                if (null != t && "function" == typeof Object.getOwnPropertySymbols) {
                    var n = 0;
                    for (e = Object.getOwnPropertySymbols(t); n < e.length; n++) i.indexOf(e[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, e[n]) && (s[e[n]] = t[e[n]])
                }
                return s
            }

            function We(t, i, s, e) {
                const n = s.value,
                    h = {
                        se: i,
                        ot: t,
                        Ot: [n, n, n, n],
                        Cb: e
                    };
                return void 0 !== s.color && (h.O = s.color), h
            }

            function Pe(t, i, s, e) {
                const n = s.value,
                    h = {
                        se: i,
                        ot: t,
                        Ot: [n, n, n, n],
                        Cb: e
                    };
                return void 0 !== s.lineColor && (h.lt = s.lineColor), void 0 !== s.topColor && (h.Ts = s.topColor), void 0 !== s.bottomColor && (h.Ps = s.bottomColor), h
            }

            function Re(t, i, s, e) {
                const n = s.value,
                    h = {
                        se: i,
                        ot: t,
                        Ot: [n, n, n, n],
                        Cb: e
                    };
                return void 0 !== s.topLineColor && (h.Pe = s.topLineColor), void 0 !== s.bottomLineColor && (h.Re = s.bottomLineColor), void 0 !== s.topFillColor1 && (h.Se = s.topFillColor1), void 0 !== s.topFillColor2 && (h.ke = s.topFillColor2), void 0 !== s.bottomFillColor1 && (h.ye = s.bottomFillColor1),
                    void 0 !== s.bottomFillColor2 && (h.Ce = s.bottomFillColor2), h
            }

            function De(t, i, s, e) {
                const n = {
                    se: i,
                    ot: t,
                    Ot: [s.open, s.high, s.low, s.close],
                    Cb: e
                };
                return void 0 !== s.color && (n.O = s.color), n
            }

            function Fe(t, i, s, e) {
                const n = {
                    se: i,
                    ot: t,
                    Ot: [s.open, s.high, s.low, s.close],
                    Cb: e
                };
                return void 0 !== s.color && (n.O = s.color), void 0 !== s.borderColor && (n.At = s.borderColor), void 0 !== s.wickColor && (n.Xh = s.wickColor), n
            }

            function Ie(t, i, s, e, n) {
                const h = g(n)(s),
                    r = Math.max(...h),
                    o = Math.min(...h),
                    l = h[h.length - 1],
                    a = [l, r, o, l],
                    u = s,
                    {
                        time: c,
                        color: f
                    } = u;
                return {
                    se: i,
                    ot: t,
                    Ot: a,
                    Cb: e,
                    He: $e(u, ["time", "color"]),
                    O: f
                }
            }

            function Ae(t) {
                return void 0 !== t.Ot
            }

            function Ve(t, i) {
                return void 0 !== i.customValues && (t.Ab = i.customValues), t
            }

            function Be(t) {
                return (i, s, e, n, h, r) => function(t, i) {
                    return i ? i(t) : void 0 === (s = t).open && void 0 === s.value;
                    var s
                }(e, r) ? Ve({
                    ot: i,
                    se: s,
                    Cb: n
                }, e) : Ve(t(i, s, e, n, h), e)
            }

            function je(t) {
                return {
                    Candlestick: Be(Fe),
                    Bar: Be(De),
                    Area: Be(Pe),
                    Baseline: Be(Re),
                    Histogram: Be(We),
                    Line: Be(We),
                    Custom: Be(Ie)
                }[t]
            }

            function Ue(t) {
                return {
                    se: 0,
                    Bb: new Map,
                    ha: t
                }
            }

            function Ze(t, i) {
                if (void 0 !== t && 0 !== t.length) return {
                    Vb: i.key(t[0].ot),
                    Ib: i.key(t[t.length - 1].ot)
                }
            }

            function Je(t) {
                let i;
                return t.forEach((t => {
                    void 0 === i && (i = t.Cb)
                })), g(i)
            }
            class He {
                constructor(t) {
                    this.zb = new Map, this.Lb = new Map, this.Eb = new Map, this.Nb = [], this.U_ = t
                }
                S() {
                    this.zb.clear(), this.Lb.clear(), this.Eb.clear(), this.Nb = []
                }
                Fb(t, i) {
                    let s = 0 !== this.zb.size,
                        e = !1;
                    const n = this.Lb.get(t);
                    if (void 0 !== n)
                        if (1 === this.Lb.size) s = !1, e = !0, this.zb.clear();
                        else
                            for (const i of this.Nb) i.pointData.Bb.delete(t) && (e = !0);
                    let h = [];
                    if (0 !== i.length) {
                        const s = i.map((t => t.time)),
                            n = this.U_.createConverterToInternalObj(i),
                            r = je(t.Jh()),
                            o = t.ya(),
                            l = t.Ca();
                        h = i.map(((i, h) => {
                            const a = n(i.time),
                                u = this.U_.key(a);
                            let c = this.zb.get(u);
                            void 0 === c && (c = Ue(a), this.zb.set(u, c), e = !0);
                            const f = r(a, c.se, i, s[h], o, l);
                            return c.Bb.set(t, f), f
                        }))
                    }
                    s && this.Wb(), this.jb(t, h);
                    let r = -1;
                    if (e) {
                        const t = [];
                        this.zb.forEach((i => {
                            t.push({
                                timeWeight: 0,
                                time: i.ha,
                                pointData: i,
                                originalTime: Je(i.Bb)
                            })
                        })), t.sort(((t, i) => this.U_.key(t.time) - this.U_.key(i.time))), r = this.Hb(t)
                    }
                    return this.$b(t, r, function(t, i, s) {
                        const e = Ze(t, s),
                            n = Ze(i, s);
                        if (void 0 !== e && void 0 !== n) return {
                            Ql: e.Ib >= n.Ib && e.Vb >= n.Vb
                        }
                    }(this.Lb.get(t), n, this.U_))
                }
                fd(t) {
                    return this.Fb(t, [])
                }
                Ub(t, i) {
                    const s = i;
                    ! function(t) {
                        void 0 === t.Cb && (t.Cb = t.time)
                    }(s), this.U_.preprocessData(i);
                    const e = this.U_.createConverterToInternalObj([i])(i.time),
                        n = this.Eb.get(t);
                    if (void 0 !== n && this.U_.key(e) < this.U_.key(n)) throw new Error(`Cannot update oldest data, last time=${n}, new time=${e}`);
                    let h = this.zb.get(this.U_.key(e));
                    const r = void 0 === h;
                    void 0 === h && (h = Ue(e), this.zb.set(this.U_.key(e), h));
                    const o = je(t.Jh()),
                        l = t.ya(),
                        a = t.Ca(),
                        u = o(e, h.se, i, s.Cb, l, a);
                    h.Bb.set(t, u), this.qb(t, u);
                    const c = {
                        Ql: Ae(u)
                    };
                    if (!r) return this.$b(t, -1, c);
                    const f = {
                            timeWeight: 0,
                            time: h.ha,
                            pointData: h,
                            originalTime: Je(h.Bb)
                        },
                        d = Et(this.Nb, this.U_.key(f.time), ((t, i) => this.U_.key(t.time) < i));
                    this.Nb.splice(d, 0, f);
                    for (let t = d; t < this.Nb.length; ++t) Ke(this.Nb[t].pointData, t);
                    return this.U_.fillWeightsForPoints(this.Nb, d), this.$b(t, d, c)
                }
                qb(t, i) {
                    let s = this.Lb.get(t);
                    void 0 === s && (s = [], this.Lb.set(t, s));
                    const e = 0 !== s.length ? s[s.length - 1] : null;
                    null === e || this.U_.key(i.ot) > this.U_.key(e.ot) ? Ae(i) && s.push(i) : Ae(i) ? s[s.length - 1] = i : s.splice(-1, 1), this.Eb.set(t, i.ot)
                }
                jb(t, i) {
                    0 !== i.length ? (this.Lb.set(t, i.filter(Ae)), this.Eb.set(t, i[i.length - 1].ot)) : (this.Lb.delete(t), this.Eb.delete(t))
                }
                Wb() {
                    for (const t of this.Nb) 0 === t.pointData.Bb.size && this.zb.delete(this.U_.key(t.time))
                }
                Hb(t) {
                    let i = -1;
                    for (let s = 0; s < this.Nb.length && s < t.length; ++s) {
                        const e = this.Nb[s],
                            n = t[s];
                        if (this.U_.key(e.time) !== this.U_.key(n.time)) {
                            i = s;
                            break
                        }
                        n.timeWeight = e.timeWeight, Ke(n.pointData, s)
                    }
                    if (-1 === i && this.Nb.length !== t.length && (i = Math.min(this.Nb.length, t.length)), -1 === i) return -1;
                    for (let s = i; s < t.length; ++s) Ke(t[s].pointData, s);
                    return this.U_.fillWeightsForPoints(t, i), this.Nb = t, i
                }
                Yb() {
                    if (0 === this.Lb.size) return null;
                    let t = 0;
                    return this.Lb.forEach((i => {
                        0 !== i.length && (t = Math.max(t, i[i.length - 1].se))
                    })), t
                }
                $b(t, i, s) {
                    const e = {
                        Xb: new Map,
                        St: {
                            Lu: this.Yb()
                        }
                    };
                    if (-1 !== i) this.Lb.forEach(((i, n) => {
                        e.Xb.set(n, {
                            He: i,
                            Kb: n === t ? s : void 0
                        })
                    })), this.Lb.has(t) || e.Xb.set(t, {
                        He: [],
                        Kb: s
                    }), e.St.Zb = this.Nb, e.St.Gb = i;
                    else {
                        const i = this.Lb.get(t);
                        e.Xb.set(t, {
                            He: i || [],
                            Kb: s
                        })
                    }
                    return e
                }
            }

            function Ke(t, i) {
                t.se = i, t.Bb.forEach((t => {
                    t.se = i
                }))
            }

            function Ge(t) {
                const i = {
                    value: t.Ot[3],
                    time: t.Cb
                };
                return void 0 !== t.Ab && (i.customValues = t.Ab), i
            }

            function Xe(t) {
                const i = Ge(t);
                return void 0 !== t.O && (i.color = t.O), i
            }

            function Ye(t) {
                const i = Ge(t);
                return void 0 !== t.lt && (i.lineColor = t.lt), void 0 !== t.Ts && (i.topColor = t.Ts), void 0 !== t.Ps && (i.bottomColor = t.Ps), i
            }

            function qe(t) {
                const i = Ge(t);
                return void 0 !== t.Pe && (i.topLineColor = t.Pe), void 0 !== t.Re && (i.bottomLineColor = t.Re), void 0 !== t.Se && (i.topFillColor1 = t.Se), void 0 !== t.ke && (i.topFillColor2 = t.ke), void 0 !== t.ye && (i.bottomFillColor1 = t.ye), void 0 !== t.Ce && (i.bottomFillColor2 = t.Ce), i
            }

            function Qe(t) {
                const i = {
                    open: t.Ot[0],
                    high: t.Ot[1],
                    low: t.Ot[2],
                    close: t.Ot[3],
                    time: t.Cb
                };
                return void 0 !== t.Ab && (i.customValues = t.Ab), i
            }

            function tn(t) {
                const i = Qe(t);
                return void 0 !== t.O && (i.color = t.O), i
            }

            function sn(t) {
                const i = Qe(t),
                    {
                        O: s,
                        At: e,
                        Xh: n
                    } = t;
                return void 0 !== s && (i.color = s), void 0 !== e && (i.borderColor = e), void 0 !== n && (i.wickColor = n), i
            }

            function en(t) {
                return {
                    Area: Ye,
                    Line: Xe,
                    Baseline: qe,
                    Histogram: Xe,
                    Bar: tn,
                    Candlestick: sn,
                    Custom: nn
                }[t]
            }

            function nn(t) {
                const i = t.Cb;
                return Object.assign(Object.assign({}, t.He), {
                    time: i
                })
            }
            const hn = {
                    vertLine: {
                        color: "#9598A1",
                        width: 1,
                        style: 3,
                        visible: !0,
                        labelVisible: !0,
                        labelBackgroundColor: "#131722"
                    },
                    horzLine: {
                        color: "#9598A1",
                        width: 1,
                        style: 3,
                        visible: !0,
                        labelVisible: !0,
                        labelBackgroundColor: "#131722"
                    },
                    mode: 1
                },
                rn = {
                    vertLines: {
                        color: "#D6DCDE",
                        style: 0,
                        visible: !0
                    },
                    horzLines: {
                        color: "#D6DCDE",
                        style: 0,
                        visible: !0
                    }
                },
                on = {
                    background: {
                        type: "solid",
                        color: "#FFFFFF"
                    },
                    textColor: "#191919",
                    fontSize: 12,
                    fontFamily: I
                },
                ln = {
                    autoScale: !0,
                    mode: 0,
                    invertScale: !1,
                    alignLabels: !0,
                    borderVisible: !0,
                    borderColor: "#2B2B43",
                    entireTextOnly: !1,
                    visible: !1,
                    ticksVisible: !1,
                    scaleMargins: {
                        bottom: .1,
                        top: .2
                    },
                    minimumWidth: 0
                },
                an = {
                    rightOffset: 0,
                    barSpacing: 6,
                    minBarSpacing: .5,
                    fixLeftEdge: !1,
                    fixRightEdge: !1,
                    lockVisibleTimeRangeOnResize: !1,
                    rightBarStaysOnScroll: !1,
                    borderVisible: !0,
                    borderColor: "#2B2B43",
                    visible: !0,
                    timeVisible: !1,
                    secondsVisible: !0,
                    shiftVisibleRangeOnNewBar: !0,
                    allowShiftVisibleRangeOnWhitespaceReplacement: !1,
                    ticksVisible: !1,
                    uniformDistribution: !1,
                    minimumHeight: 0,
                    allowBoldLabels: !0
                },
                un = {
                    color: "rgba(0, 0, 0, 0)",
                    visible: !1,
                    fontSize: 48,
                    fontFamily: I,
                    fontStyle: "",
                    text: "",
                    horzAlign: "center",
                    vertAlign: "center"
                };

            function cn() {
                return {
                    width: 0,
                    height: 0,
                    autoSize: !1,
                    layout: on,
                    crosshair: hn,
                    grid: rn,
                    overlayPriceScales: Object.assign({}, ln),
                    leftPriceScale: Object.assign(Object.assign({}, ln), {
                        visible: !1
                    }),
                    rightPriceScale: Object.assign(Object.assign({}, ln), {
                        visible: !0
                    }),
                    timeScale: an,
                    watermark: un,
                    localization: {
                        locale: Gs ? navigator.language : "",
                        dateFormat: "dd MMM 'yy"
                    },
                    handleScroll: {
                        mouseWheel: !0,
                        pressedMouseMove: !0,
                        horzTouchDrag: !0,
                        vertTouchDrag: !0
                    },
                    handleScale: {
                        axisPressedMouseMove: {
                            time: !0,
                            price: !0
                        },
                        axisDoubleClickReset: {
                            time: !0,
                            price: !0
                        },
                        mouseWheel: !0,
                        pinch: !0
                    },
                    kineticScroll: {
                        mouse: !1,
                        touch: !0
                    },
                    trackingMode: {
                        exitMode: 1
                    }
                }
            }
            class fn {
                constructor(t, i) {
                    this.Jb = t, this.Qb = i
                }
                applyOptions(t) {
                    this.Jb.$t().Hc(this.Qb, t)
                }
                options() {
                    return this.Li().W()
                }
                width() {
                    return ut(this.Qb) ? this.Jb.ob(this.Qb) : 0
                }
                Li() {
                    return w(this.Jb.$t().$c(this.Qb)).Dt
                }
            }

            function dn(t, i, s) {
                const e = $e(t, ["time", "originalTime"]),
                    n = Object.assign({
                        time: i
                    }, e);
                return void 0 !== s && (n.originalTime = s), n
            }
            const pn = {
                color: "#FF0000",
                price: 0,
                lineStyle: 2,
                lineWidth: 1,
                lineVisible: !0,
                axisLabelVisible: !0,
                title: "",
                axisLabelColor: "",
                axisLabelTextColor: ""
            };
            class mn {
                constructor(t) {
                    this.Eh = t
                }
                applyOptions(t) {
                    this.Eh.Hh(t)
                }
                options() {
                    return this.Eh.W()
                }
                tw() {
                    return this.Eh
                }
            }
            class vn {
                constructor(t, i, s, e, n) {
                    this.iw = new T, this.Ls = t, this.nw = i, this.sw = s, this.U_ = n, this.ew = e
                }
                S() {
                    this.iw.S()
                }
                priceFormatter() {
                    return this.Ls.ma()
                }
                priceToCoordinate(t) {
                    const i = this.Ls.Ct();
                    return null === i ? null : this.Ls.Dt().Rt(t, i.Ot)
                }
                coordinateToPrice(t) {
                    const i = this.Ls.Ct();
                    return null === i ? null : this.Ls.Dt().pn(t, i.Ot)
                }
                barsInLogicalRange(t) {
                    if (null === t) return null;
                    const i = new Ms(new gs(t.from, t.to)).hu(),
                        s = this.Ls.In();
                    if (s.Ni()) return null;
                    const e = s.hl(i.Os(), 1),
                        n = s.hl(i.ui(), -1),
                        h = w(s.sl()),
                        r = w(s.Vn());
                    if (null !== e && null !== n && e.se > n.se) return {
                        barsBefore: t.from - h,
                        barsAfter: r - t.to
                    };
                    const o = {
                        barsBefore: null === e || e.se === h ? t.from - h : e.se - h,
                        barsAfter: null === n || n.se === r ? r - t.to : r - n.se
                    };
                    return null !== e && null !== n && (o.from = e.Cb, o.to = n.Cb), o
                }
                setData(t) {
                    this.U_, this.Ls.Jh(), this.nw.rw(this.Ls, t), this.hw("full")
                }
                update(t) {
                    this.Ls.Jh(), this.nw.lw(this.Ls, t), this.hw("update")
                }
                dataByIndex(t, i) {
                    const s = this.Ls.In().hl(t, i);
                    return null === s ? null : en(this.seriesType())(s)
                }
                data() {
                    const t = en(this.seriesType());
                    return this.Ls.In().ie().map((i => t(i)))
                }
                subscribeDataChanged(t) {
                    this.iw.l(t)
                }
                unsubscribeDataChanged(t) {
                    this.iw.v(t)
                }
                setMarkers(t) {
                    this.U_;
                    const i = t.map((t => dn(t, this.U_.convertHorzItemToInternal(t.time), t.time)));
                    this.Ls.ia(i)
                }
                markers() {
                    return this.Ls.na().map((t => dn(t, t.originalTime, void 0)))
                }
                applyOptions(t) {
                    this.Ls.Hh(t)
                }
                options() {
                    return R(this.Ls.W())
                }
                priceScale() {
                    return this.sw.priceScale(this.Ls.Dt().Ta())
                }
                createPriceLine(t) {
                    const i = E(R(pn), t),
                        s = this.Ls.sa(i);
                    return new mn(s)
                }
                removePriceLine(t) {
                    this.Ls.ea(t.tw())
                }
                seriesType() {
                    return this.Ls.Jh()
                }
                attachPrimitive(t) {
                    this.Ls.Sa(t), t.attached && t.attached({
                        chart: this.ew,
                        series: this,
                        requestUpdate: () => this.Ls.$t().Kl()
                    })
                }
                detachPrimitive(t) {
                    this.Ls.ka(t), t.detached && t.detached()
                }
                hw(t) {
                    this.iw.M() && this.iw.m(t)
                }
            }
            class bn {
                constructor(t, i, s) {
                    this.aw = new T, this.pu = new T, this.wm = new T, this.$i = t, this.kl = t.St(), this.Gm = i, this.kl.tc().l(this.ow.bind(this)), this.kl.nc().l(this._w.bind(this)), this.Gm.Tm().l(this.uw.bind(this)), this.U_ = s
                }
                S() {
                    this.kl.tc().p(this), this.kl.nc().p(this), this.Gm.Tm().p(this), this.aw.S(), this.pu.S(), this.wm.S()
                }
                scrollPosition() {
                    return this.kl.ju()
                }
                scrollToPosition(t, i) {
                    i ? this.kl.Gu(t, 1e3) : this.$i.Jn(t)
                }
                scrollToRealTime() {
                    this.kl.Zu()
                }
                getVisibleRange() {
                    const t = this.kl.Du();
                    return null === t ? null : {
                        from: t.from.originalTime,
                        to: t.to.originalTime
                    }
                }
                setVisibleRange(t) {
                    const i = {
                            from: this.U_.convertHorzItemToInternal(t.from),
                            to: this.U_.convertHorzItemToInternal(t.to)
                        },
                        s = this.kl.Vu(i);
                    this.$i.vd(s)
                }
                getVisibleLogicalRange() {
                    const t = this.kl.Ru();
                    return null === t ? null : {
                        from: t.Os(),
                        to: t.ui()
                    }
                }
                setVisibleLogicalRange(t) {
                    b(t.from <= t.to, "The from index cannot be after the to index."), this.$i.vd(t)
                }
                resetTimeScale() {
                    this.$i.Zn()
                }
                fitContent() {
                    this.$i.rc()
                }
                logicalToCoordinate(t) {
                    const i = this.$i.St();
                    return i.Ni() ? null : i.It(t)
                }
                coordinateToLogical(t) {
                    return this.kl.Ni() ? null : this.kl.Eu(t)
                }
                timeToCoordinate(t) {
                    const i = this.U_.convertHorzItemToInternal(t),
                        s = this.kl.Da(i, !1);
                    return null === s ? null : this.kl.It(s)
                }
                coordinateToTime(t) {
                    const i = this.$i.St(),
                        s = i.Eu(t),
                        e = i.Ui(s);
                    return null === e ? null : e.originalTime
                }
                width() {
                    return this.Gm.Gp().width
                }
                height() {
                    return this.Gm.Gp().height
                }
                subscribeVisibleTimeRangeChange(t) {
                    this.aw.l(t)
                }
                unsubscribeVisibleTimeRangeChange(t) {
                    this.aw.v(t)
                }
                subscribeVisibleLogicalRangeChange(t) {
                    this.pu.l(t)
                }
                unsubscribeVisibleLogicalRangeChange(t) {
                    this.pu.v(t)
                }
                subscribeSizeChange(t) {
                    this.wm.l(t)
                }
                unsubscribeSizeChange(t) {
                    this.wm.v(t)
                }
                applyOptions(t) {
                    this.kl.Hh(t)
                }
                options() {
                    return Object.assign(Object.assign({}, R(this.kl.W())), {
                        barSpacing: this.kl.he()
                    })
                }
                ow() {
                    this.aw.M() && this.aw.m(this.getVisibleRange())
                }
                _w() {
                    this.pu.M() && this.pu.m(this.getVisibleLogicalRange())
                }
                uw(t) {
                    this.wm.m(t.width, t.height)
                }
            }

            function gn(t) {
                return function(t) {
                    if (P(t.handleScale)) {
                        const i = t.handleScale;
                        t.handleScale = {
                            axisDoubleClickReset: {
                                time: i,
                                price: i
                            },
                            axisPressedMouseMove: {
                                time: i,
                                price: i
                            },
                            mouseWheel: i,
                            pinch: i
                        }
                    } else if (void 0 !== t.handleScale) {
                        const {
                            axisPressedMouseMove: i,
                            axisDoubleClickReset: s
                        } = t.handleScale;
                        P(i) && (t.handleScale.axisPressedMouseMove = {
                            time: i,
                            price: i
                        }), P(s) && (t.handleScale.axisDoubleClickReset = {
                            time: s,
                            price: s
                        })
                    }
                    const i = t.handleScroll;
                    P(i) && (t.handleScroll = {
                        horzTouchDrag: i,
                        vertTouchDrag: i,
                        mouseWheel: i,
                        pressedMouseMove: i
                    })
                }(t), t
            }
            class wn {
                constructor(t, i, s) {
                    this.cw = new Map, this.dw = new Map, this.fw = new T, this.pw = new T, this.mw = new T, this.bw = new He(i);
                    const e = void 0 === s ? R(cn()) : E(R(cn()), gn(s));
                    this.U_ = i, this.Jb = new Ee(t, e, i), this.Jb.Yp().l((t => {
                        this.fw.M() && this.fw.m(this.ww(t()))
                    }), this), this.Jb.Xp().l((t => {
                        this.pw.M() && this.pw.m(this.ww(t()))
                    }), this), this.Jb.Xc().l((t => {
                        this.mw.M() && this.mw.m(this.ww(t()))
                    }), this);
                    const n = this.Jb.$t();
                    this.gw = new bn(n, this.Jb.sb(), this.U_)
                }
                remove() {
                    this.Jb.Yp().p(this), this.Jb.Xp().p(this), this.Jb.Xc().p(this), this.gw.S(), this.Jb.S(), this.cw.clear(), this.dw.clear(), this.fw.S(), this.pw.S(), this.mw.S(), this.bw.S()
                }
                resize(t, i, s) {
                    this.autoSizeActive() || this.Jb.Qm(t, i, s)
                }
                addCustomSeries(t, i) {
                    const s = y(t),
                        e = Object.assign(Object.assign({}, u), s.defaultOptions());
                    return this.Mw("Custom", e, i, s)
                }
                addAreaSeries(t) {
                    return this.Mw("Area", o, t)
                }
                addBaselineSeries(t) {
                    return this.Mw("Baseline", l, t)
                }
                addBarSeries(t) {
                    return this.Mw("Bar", h, t)
                }
                addCandlestickSeries(t = {}) {
                    return function(t) {
                        void 0 !== t.borderColor && (t.borderUpColor = t.borderColor, t.borderDownColor = t.borderColor), void 0 !== t.wickColor && (t.wickUpColor = t.wickColor, t.wickDownColor = t.wickColor)
                    }(t), this.Mw("Candlestick", n, t)
                }
                addHistogramSeries(t) {
                    return this.Mw("Histogram", a, t)
                }
                addLineSeries(t) {
                    return this.Mw("Line", r, t)
                }
                removeSeries(t) {
                    const i = g(this.cw.get(t)),
                        s = this.bw.fd(i);
                    this.Jb.$t().fd(i), this.xw(s), this.cw.delete(t), this.dw.delete(i)
                }
                rw(t, i) {
                    this.xw(this.bw.Fb(t, i))
                }
                lw(t, i) {
                    this.xw(this.bw.Ub(t, i))
                }
                subscribeClick(t) {
                    this.fw.l(t)
                }
                unsubscribeClick(t) {
                    this.fw.v(t)
                }
                subscribeCrosshairMove(t) {
                    this.mw.l(t)
                }
                unsubscribeCrosshairMove(t) {
                    this.mw.v(t)
                }
                subscribeDblClick(t) {
                    this.pw.l(t)
                }
                unsubscribeDblClick(t) {
                    this.pw.v(t)
                }
                priceScale(t) {
                    return new fn(this.Jb, t)
                }
                timeScale() {
                    return this.gw
                }
                applyOptions(t) {
                    this.Jb.Hh(gn(t))
                }
                options() {
                    return this.Jb.W()
                }
                takeScreenshot() {
                    return this.Jb.lb()
                }
                autoSizeActive() {
                    return this.Jb.cb()
                }
                chartElement() {
                    return this.Jb.fb()
                }
                paneSize() {
                    const t = this.Jb.mb();
                    return {
                        height: t.height,
                        width: t.width
                    }
                }
                setCrosshairPosition(t, i, s) {
                    const e = this.cw.get(s);
                    if (void 0 === e) return;
                    const n = this.Jb.$t().cr(e);
                    null !== n && this.Jb.$t().ld(t, i, n)
                }
                clearCrosshairPosition() {
                    this.Jb.$t().ad(!0)
                }
                Mw(t, i, s = {}, e) {
                    ! function(t) {
                        if (void 0 === t || "custom" === t.type) return;
                        const i = t;
                        void 0 !== i.minMove && void 0 === i.precision && (i.precision = function(t) {
                            if (t >= 1) return 0;
                            let i = 0;
                            for (; i < 8; i++) {
                                const s = Math.round(t);
                                if (Math.abs(s - t) < 1e-8) return i;
                                t *= 10
                            }
                            return i
                        }(i.minMove))
                    }(s.priceFormat);
                    const n = E(R(c), R(i), s),
                        h = this.Jb.$t().ud(t, n, e),
                        r = new vn(h, this, this, this, this.U_);
                    return this.cw.set(r, h), this.dw.set(h, r), r
                }
                xw(t) {
                    const i = this.Jb.$t();
                    i.od(t.St.Lu, t.St.Zb, t.St.Gb), t.Xb.forEach(((t, i) => i.J(t.He, t.Kb))), i.Fu()
                }
                Sw(t) {
                    return g(this.dw.get(t))
                }
                ww(t) {
                    const i = new Map;
                    t.Rb.forEach(((t, s) => {
                        const e = s.Jh(),
                            n = en(e)(t);
                        if ("Custom" !== e) b(function(t) {
                            return void 0 !== t.open || void 0 !== t.value
                        }(n));
                        else {
                            const t = s.Ca();
                            b(!t || !1 === t(n))
                        }
                        i.set(this.Sw(s), n)
                    }));
                    const s = void 0 !== t.Pb && this.dw.has(t.Pb) ? this.Sw(t.Pb) : void 0;
                    return {
                        time: t.Cb,
                        logical: t.se,
                        point: t.Tb,
                        hoveredSeries: s,
                        hoveredObjectId: t.Db,
                        seriesData: i,
                        sourceEvent: t.Ob
                    }
                }
            }

            function yn(t, i, s) {
                let e;
                if (W(t)) {
                    const i = document.getElementById(t);
                    b(null !== i, `Cannot find element in DOM with id=${t}`), e = i
                } else e = t;
                const n = new wn(e, i, s);
                return i.setOptions(n.options()), n
            }

            function Mn() {
                return Ks
            }
            Object.assign(Object.assign({}, c), u)
        },
        876507: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => e
            });
            const e = function(t) {
                return function(i, s, e) {
                    for (var n = -1, h = Object(i), r = e(i), o = r.length; o--;) {
                        var l = r[t ? o : ++n];
                        if (!1 === s(h[l], l, h)) break
                    }
                    return i
                }
            }()
        },
        463328: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => z
            });
            var e = s(87593),
                n = s(600857),
                h = s(554523);
            const r = function(t, i, s) {
                (void 0 !== s && !(0, h.default)(t[i], s) || void 0 === s && !(i in t)) && (0, n.default)(t, i, s)
            };
            var o = s(876507),
                l = s(414054),
                a = s(411523),
                u = s(232126),
                c = s(485146),
                f = s(154404),
                d = s(456052),
                p = s(84488),
                m = s(232437),
                v = s(688987),
                b = s(182433),
                g = s(554098),
                w = s(109125);
            const y = function(t, i) {
                if (("constructor" !== i || "function" != typeof t[i]) && "__proto__" != i) return t[i]
            };
            var M = s(652949),
                S = s(602960);
            const C = function(t) {
                return (0, M.default)(t, (0, S.default)(t))
            };
            const x = function(t, i, s, e, n, h, o) {
                var M = y(t, s),
                    S = y(i, s),
                    x = o.get(S);
                if (x) r(t, s, x);
                else {
                    var z = h ? h(M, S, s + "", t, i, o) : void 0,
                        k = void 0 === z;
                    if (k) {
                        var _ = (0, d.default)(S),
                            L = !_ && (0, m.default)(S),
                            O = !_ && !L && (0, w.default)(S);
                        z = S, _ || L || O ? (0, d.default)(M) ? z = M : (0, p.default)(M) ? z = (0, u.default)(M) : L ? (k = !1, z = (0, l.default)(S, !0)) : O ? (k = !1, z = (0, a.default)(S, !0)) : z = [] : (0, g.default)(S) || (0, f.default)(S) ? (z = M, (0, f.default)(M) ? z = C(M) : (0, b.default)(M) && !(0, v.default)(M) || (z = (0, c.default)(S))) : k = !1
                    }
                    k && (o.set(S, z), n(z, S, e, h, o), o.delete(S)), r(t, s, z)
                }
            };
            const z = function t(i, s, n, h, l) {
                i !== s && (0, o.default)(s, (function(o, a) {
                    if (l || (l = new e.default), (0, b.default)(o)) x(i, s, a, n, t, h, l);
                    else {
                        var u = h ? h(y(i, a), o, a + "", i, s, l) : void 0;
                        void 0 === u && (u = o), r(i, a, u)
                    }
                }), S.default)
            }
        },
        919851: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => r
            });
            var e = s(876402),
                n = s(628215),
                h = s(406265);
            const r = function(t, i) {
                return (0, h.default)((0, n.default)(t, i, e.default), t + "")
            }
        },
        631543: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => h
            });
            var e = s(919851),
                n = s(61833);
            const h = function(t) {
                return (0, e.default)((function(i, s) {
                    var e = -1,
                        h = s.length,
                        r = h > 1 ? s[h - 1] : void 0,
                        o = h > 2 ? s[2] : void 0;
                    for (r = t.length > 3 && "function" == typeof r ? (h--, r) : void 0, o && (0, n.default)(s[0], s[1], o) && (r = h < 3 ? void 0 : r, h = 1), i = Object(i); ++e < h;) {
                        var l = s[e];
                        l && t(i, l, e, r)
                    }
                    return i
                }))
            }
        },
        61833: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => o
            });
            var e = s(554523),
                n = s(649634),
                h = s(399313),
                r = s(182433);
            const o = function(t, i, s) {
                if (!(0, r.default)(s)) return !1;
                var o = typeof i;
                return !!("number" == o ? (0, n.default)(s) && (0, h.default)(i, s.length) : "string" == o && i in s) && (0, e.default)(s[i], t)
            }
        },
        628215: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => h
            });
            const e = function(t, i, s) {
                switch (s.length) {
                    case 0:
                        return t.call(i);
                    case 1:
                        return t.call(i, s[0]);
                    case 2:
                        return t.call(i, s[0], s[1]);
                    case 3:
                        return t.call(i, s[0], s[1], s[2])
                }
                return t.apply(i, s)
            };
            var n = Math.max;
            const h = function(t, i, s) {
                return i = n(void 0 === i ? t.length - 1 : i, 0),
                    function() {
                        for (var h = arguments, r = -1, o = n(h.length - i, 0), l = Array(o); ++r < o;) l[r] = h[i + r];
                        r = -1;
                        for (var a = Array(i + 1); ++r < i;) a[r] = h[r];
                        return a[i] = s(l), e(t, this, a)
                    }
            }
        },
        406265: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => l
            });
            const e = function(t) {
                return function() {
                    return t
                }
            };
            var n = s(355136),
                h = s(876402);
            const r = n.default ? function(t, i) {
                return (0, n.default)(t, "toString", {
                    configurable: !0,
                    enumerable: !1,
                    value: e(i),
                    writable: !0
                })
            } : h.default;
            var o = Date.now;
            const l = function(t) {
                var i = 0,
                    s = 0;
                return function() {
                    var e = o(),
                        n = 16 - (e - s);
                    if (s = e, n > 0) {
                        if (++i >= 800) return arguments[0]
                    } else i = 0;
                    return t.apply(void 0, arguments)
                }
            }(r)
        },
        876402: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => e
            });
            const e = function(t) {
                return t
            }
        },
        84488: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => h
            });
            var e = s(649634),
                n = s(513795);
            const h = function(t) {
                return (0, n.default)(t) && (0, e.default)(t)
            }
        },
        554098: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => c
            });
            var e = s(194138),
                n = s(110964),
                h = s(513795),
                r = Function.prototype,
                o = Object.prototype,
                l = r.toString,
                a = o.hasOwnProperty,
                u = l.call(Object);
            const c = function(t) {
                if (!(0, h.default)(t) || "[object Object]" != (0, e.default)(t)) return !1;
                var i = (0, n.default)(t);
                if (null === i) return !0;
                var s = a.call(i, "constructor") && i.constructor;
                return "function" == typeof s && s instanceof s && l.call(s) == u
            }
        },
        283873: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => r
            });
            var e = s(194138),
                n = s(456052),
                h = s(513795);
            const r = function(t) {
                return "string" == typeof t || !(0, n.default)(t) && (0, h.default)(t) && "[object String]" == (0, e.default)(t)
            }
        },
        998034: (t, i, s) => {
            "use strict";
            s.d(i, {
                default: () => n
            });
            var e = s(463328);
            const n = (0, s(631543).default)((function(t, i, s) {
                (0, e.default)(t, i, s)
            }))
        }
    }
]);