"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[372],{3871:function(t,e,i){i.d(e,{B9:function(){return e6},J:function(){return I},KH:function(){return w},OH:function(){return E},S1:function(){return e5},SP:function(){return y},Us:function(){return P},YP:function(){return x}});/**
     * @license
     * KLineChart v9.8.10
     * Copyright (c) 2019 lihu.
     * Licensed under Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
     */var n,o,r,a,s,l,c,u,h,d,p,g,v,f,m,y,_,x,S,C,b,w,I,E,T,P,M,D,k,A,F,L=function(t,e){return(L=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)};function R(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function i(){this.constructor=t}L(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var B=function(){return(B=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function N(t,e,i,n){return new(i||(i=Promise))(function(o,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function s(t){try{l(n.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?o(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(a,s)}l((n=n.apply(t,e||[])).next())})}function O(t,e){var i,n,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(l){return function(s){if(i)throw TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(i=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{i=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function V(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function z(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,r=i.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=r.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return a}function W(t,e,i){if(i||2==arguments.length)for(var n,o=0,r=e.length;o<r;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,(n=y||(y={})).Dashed="dashed",n.Solid="solid",(o=_||(_={})).Stroke="stroke",o.Fill="fill",o.StrokeFill="stroke_fill",(r=x||(x={})).Always="always",r.FollowCross="follow_cross",r.None="none",(a=S||(S={})).Standard="standard",a.Rect="rect",(s=C||(C={})).Left="left",s.Middle="middle",s.Right="right",(l=b||(b={})).Fixed="fixed",l.Pointer="pointer",(c=w||(w={})).CandleSolid="candle_solid",c.CandleStroke="candle_stroke",c.CandleUpStroke="candle_up_stroke",c.CandleDownStroke="candle_down_stroke",c.Ohlc="ohlc",c.Area="area",(u=I||(I={})).Left="left",u.Right="right",(h=E||(E={})).Normal="normal",h.Percentage="percentage",h.Log="log";var X="#F92855",Y="rgba(249, 40, 85, .7)",H="#2DC08E",G="rgba(45, 192, 142, .7)",j="#888888",K="#FFFFFF",Z="#1677FF",U="#76808F",q="#DDDDDD";function $(t){return"rgba(22, 119, 255, ".concat(t,")")}function Q(){return{show:!0,size:"auto",axisLine:{show:!0,color:q,size:1},tickText:{show:!0,color:U,size:12,family:"Helvetica Neue",weight:"normal",marginStart:4,marginEnd:4},tickLine:{show:!0,size:1,length:3,color:q}}}function J(t,e,i,n,o,r){}function tt(t,e,i){}function te(t,e){if(tr(t)||tr(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=t[i],o=e[i];tr(o)&&tr(n)?te(n,o):ts(e[i])&&(t[i]=ti(e[i]))}}}function ti(t){if(!tr(t))return t;for(var e in i=tn(t)?[]:{},t)if(Object.prototype.hasOwnProperty.call(t,e)){var i,n=t[e];tr(n)?i[e]=ti(n):i[e]=n}return i}function tn(t){return"[object Array]"===Object.prototype.toString.call(t)}function to(t){return"function"==typeof t}function tr(t){return"object"==typeof t&&ts(t)}function ta(t){return"number"==typeof t&&!isNaN(t)}function ts(t){return null!=t}function tl(t){return"boolean"==typeof t}function tc(t){return"string"==typeof t}var tu=/\\(\\)?/g,th=RegExp("[^.[\\]]+|\\[(?:([^\"'][^[]*)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))","g");function td(t,e,i){if(ts(t)){var n=[];e.replace(th,function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];var o=t;return ts(e[1])?o=e[2].replace(tu,"$1"):ts(e[0])&&(o=e[0].trim()),n.push(o),""});for(var o=t,r=0,a=n.length;ts(o)&&r<a;)o=null==o?void 0:o[n[r++]];return ts(o)?o:null!=i?i:"--"}return null!=i?i:"--"}function tp(t,e,i){var n={};return t.formatToParts(new Date(e)).forEach(function(t){var e=t.type,i=t.value;switch(e){case"year":n.YYYY=i;break;case"month":n.MM=i;break;case"day":n.DD=i;break;case"hour":n.HH="24"===i?"00":i;break;case"minute":n.mm=i;break;case"second":n.ss=i}}),i.replace(/YYYY|MM|DD|HH|mm|ss/g,function(t){return n[t]})}function tg(t,e){var i=+t;return ta(i)?i.toFixed(null!=e?e:2):"".concat(t)}function tv(t){var e=+t;if(ta(e)){if(e>1e9)return"".concat(+(e/1e9).toFixed(3),"B");if(e>1e6)return"".concat(+(e/1e6).toFixed(3),"M");if(e>1e3)return"".concat(+(e/1e3).toFixed(3),"K")}return"".concat(t)}function tf(t,e){var i="".concat(t);if(0===e.length)return i;if(i.includes(".")){var n=i.split(".");return"".concat(n[0].replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)}),".").concat(n[1])}return i.replace(/(\d)(?=(\d{3})+$)/g,function(t){return"".concat(t).concat(e)})}function tm(t,e){var i="".concat(t);if(RegExp("\\.0{"+e+",}[1-9][0-9]*$").test(i)){var n=i.split("."),o=n[n.length-1],r=o.match(/0*/);if(ts(r)){var a=r[0].length;return n[n.length-1]=o.replace(/0*/,"0{".concat(a,"}")),n.join(".")}}return i}function ty(t){var e,i,n;return null!==(n=null===(i=null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)||void 0===i?void 0:i.devicePixelRatio)&&void 0!==n?n:1}function t_(t,e,i){return"".concat(null!=e?e:"normal"," ").concat(null!=t?t:12,"px ").concat(null!=i?i:"Helvetica Neue")}function tx(t,e,i,n){if(!ts(T)){var o=document.createElement("canvas"),r=ty(o);(T=o.getContext("2d")).scale(r,r)}return T.font=t_(e,i,n),Math.round(T.measureText(t).width)}(d=P||(P={})).OnDataReady="onDataReady",d.OnZoom="onZoom",d.OnScroll="onScroll",d.OnVisibleRangeChange="onVisibleRangeChange",d.OnTooltipIconClick="onTooltipIconClick",d.OnCrosshairChange="onCrosshairChange",d.OnCandleBarClick="onCandleBarClick",d.OnPaneDrag="onPaneDrag";var tS=function(){function t(){this._callbacks=[]}return t.prototype.subscribe=function(t){var e;(null!==(e=this._callbacks.indexOf(t))&&void 0!==e?e:-1)<0&&this._callbacks.push(t)},t.prototype.unsubscribe=function(t){var e;if(to(t)){var i=null!==(e=this._callbacks.indexOf(t))&&void 0!==e?e:-1;i>-1&&this._callbacks.splice(i,1)}else this._callbacks=[]},t.prototype.execute=function(t){this._callbacks.forEach(function(e){e(t)})},t.prototype.isEmpty=function(){return 0===this._callbacks.length},t}();function tC(t,e,i,n,o){var r,a=e.result,s=e.figures,l=e.styles,c=td(l,"circles",n.circles),u=c.length,h=td(l,"bars",n.bars),d=h.length,p=td(l,"lines",n.lines),g=p.length,v=0,f=0,m=0,y=0;s.forEach(function(s){var l;switch(s.type){case"circle":y=v;var _=c[v%u];r=B(B({},_),{color:_.noChangeColor}),v++;break;case"bar":y=f;var x=h[f%d];r=B(B({},x),{color:x.noChangeColor}),f++;break;case"line":y=m,r=p[m%g],m++}if(ts(r)){var S={prev:{kLineData:t[i-1],indicatorData:a[i-1]},current:{kLineData:t[i],indicatorData:a[i]},next:{kLineData:t[i+1],indicatorData:a[i+1]}},C=null===(l=s.styles)||void 0===l?void 0:l.call(s,S,e,n);o(s,B(B({},r),C),y)}})}(p=M||(M={})).Normal="normal",p.Price="price",p.Volume="volume";var tb=function(){function t(t){this.result=[],this._precisionFlag=!1;var e=t.name,i=t.shortName,n=t.series,o=t.calcParams,r=t.figures,a=t.precision,s=t.shouldOhlc,l=t.shouldFormatBigNumber,c=t.visible,u=t.zLevel,h=t.minValue,d=t.maxValue,p=t.styles,g=t.extendData,v=t.regenerateFigures,f=t.createTooltipDataSource,m=t.draw;this.name=e,this.shortName=null!=i?i:e,this.series=null!=n?n:M.Normal,this.precision=null!=a?a:4,this.calcParams=null!=o?o:[],this.figures=null!=r?r:[],this.shouldOhlc=null!=s&&s,this.shouldFormatBigNumber=null!=l&&l,this.visible=null==c||c,this.zLevel=null!=u?u:0,this.minValue=null!=h?h:null,this.maxValue=null!=d?d:null,this.styles=ti(null!=p?p:{}),this.extendData=g,this.regenerateFigures=null!=v?v:null,this.createTooltipDataSource=null!=f?f:null,this.draw=null!=m?m:null}return t.prototype.setShortName=function(t){return this.shortName!==t&&(this.shortName=t,!0)},t.prototype.setSeries=function(t){return this.series!==t&&(this.series=t,!0)},t.prototype.setPrecision=function(t,e){var i=null!=e&&e,n=Math.floor(t);return n!==this.precision&&t>=0&&(!i||!!i&&!this._precisionFlag)&&(this.precision=n,i||(this._precisionFlag=!0),!0)},t.prototype.setCalcParams=function(t){var e,i;return this.calcParams=t,this.figures=null!==(i=null===(e=this.regenerateFigures)||void 0===e?void 0:e.call(this,t))&&void 0!==i?i:this.figures,!0},t.prototype.setShouldOhlc=function(t){return this.shouldOhlc!==t&&(this.shouldOhlc=t,!0)},t.prototype.setShouldFormatBigNumber=function(t){return this.shouldFormatBigNumber!==t&&(this.shouldFormatBigNumber=t,!0)},t.prototype.setVisible=function(t){return this.visible!==t&&(this.visible=t,!0)},t.prototype.setZLevel=function(t){return this.zLevel!==t&&(this.zLevel=t,!0)},t.prototype.setStyles=function(t){return te(this.styles,t),!0},t.prototype.setExtendData=function(t){return this.extendData!==t&&(this.extendData=t,!0)},t.prototype.setFigures=function(t){return this.figures!==t&&(this.figures=t,!0)},t.prototype.setMinValue=function(t){return this.minValue!==t&&(this.minValue=t,!0)},t.prototype.setMaxValue=function(t){return this.maxValue!==t&&(this.maxValue=t,!0)},t.prototype.setRegenerateFigures=function(t){return this.regenerateFigures!==t&&(this.regenerateFigures=t,!0)},t.prototype.setCreateTooltipDataSource=function(t){return this.createTooltipDataSource!==t&&(this.createTooltipDataSource=t,!0)},t.prototype.setDraw=function(t){return this.draw!==t&&(this.draw=t,!0)},t.prototype.calcIndicator=function(t){return N(this,void 0,void 0,function(){var e;return O(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.calc(t,this)];case 1:return e=i.sent(),this.result=e,[2,!0];case 2:return i.sent(),[2,!1];case 3:return[2]}})})},t.extend=function(e){return function(t){function i(){return t.call(this,e)||this}return R(i,t),i.prototype.calc=function(t,i){return e.calc(t,i)},i}(t)},t}();(g=D||(D={})).Normal="normal",g.WeakMagnet="weak_magnet",g.StrongMagnet="strong_magnet";var tw="overlay_figure_",tI=Number.MAX_SAFE_INTEGER,tE=function(){function t(t){this.currentStep=1,this.points=[],this._prevPressedPoint=null,this._prevPressedPoints=[];var e=t.mode,i=t.modeSensitivity,n=t.extendData,o=t.styles,r=t.name,a=t.totalStep,s=t.lock,l=t.visible,c=t.zLevel,u=t.needDefaultPointFigure,h=t.needDefaultXAxisFigure,d=t.needDefaultYAxisFigure,p=t.createPointFigures,g=t.createXAxisFigures,v=t.createYAxisFigures,f=t.performEventPressedMove,m=t.performEventMoveForDrawing,y=t.onDrawStart,_=t.onDrawing,x=t.onDrawEnd,S=t.onClick,C=t.onDoubleClick,b=t.onRightClick,w=t.onPressedMoveStart,I=t.onPressedMoving,E=t.onPressedMoveEnd,T=t.onMouseEnter,P=t.onMouseLeave,M=t.onRemoved,k=t.onSelected,A=t.onDeselected;this.name=r,this.totalStep=!ta(a)||a<2?1:a,this.lock=null!=s&&s,this.visible=null==l||l,this.zLevel=null!=c?c:0,this.needDefaultPointFigure=null!=u&&u,this.needDefaultXAxisFigure=null!=h&&h,this.needDefaultYAxisFigure=null!=d&&d,this.mode=null!=e?e:D.Normal,this.modeSensitivity=null!=i?i:8,this.extendData=n,this.styles=ti(null!=o?o:{}),this.createPointFigures=null!=p?p:null,this.createXAxisFigures=null!=g?g:null,this.createYAxisFigures=null!=v?v:null,this.performEventPressedMove=null!=f?f:null,this.performEventMoveForDrawing=null!=m?m:null,this.onDrawStart=null!=y?y:null,this.onDrawing=null!=_?_:null,this.onDrawEnd=null!=x?x:null,this.onClick=null!=S?S:null,this.onDoubleClick=null!=C?C:null,this.onRightClick=null!=b?b:null,this.onPressedMoveStart=null!=w?w:null,this.onPressedMoving=null!=I?I:null,this.onPressedMoveEnd=null!=E?E:null,this.onMouseEnter=null!=T?T:null,this.onMouseLeave=null!=P?P:null,this.onRemoved=null!=M?M:null,this.onSelected=null!=k?k:null,this.onDeselected=null!=A?A:null}return t.prototype.setId=function(t){return!tc(this.id)&&(this.id=t,!0)},t.prototype.setGroupId=function(t){return!tc(this.groupId)&&(this.groupId=t,!0)},t.prototype.setPaneId=function(t){this.paneId=t},t.prototype.setExtendData=function(t){return t!==this.extendData&&(this.extendData=t,!0)},t.prototype.setStyles=function(t){return te(this.styles,t),!0},t.prototype.setPoints=function(t){if(t.length>0){var e=void 0;if(this.points=W([],z(t),!1),t.length>=this.totalStep-1?(this.currentStep=-1,e=this.totalStep-1):(this.currentStep=t.length+1,e=t.length),null!==this.performEventMoveForDrawing)for(var i=0;i<e;i++)this.performEventMoveForDrawing({currentStep:i+2,mode:this.mode,points:this.points,performPointIndex:i,performPoint:this.points[i]});return -1===this.currentStep&&null!==this.performEventPressedMove&&this.performEventPressedMove({currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:this.points.length-1,performPoint:this.points[this.points.length-1]}),!0}return!1},t.prototype.setLock=function(t){return this.lock!==t&&(this.lock=t,!0)},t.prototype.setVisible=function(t){return this.visible!==t&&(this.visible=t,!0)},t.prototype.setZLevel=function(t){return this.zLevel!==t&&(this.zLevel=t,!0)},t.prototype.setMode=function(t){return this.mode!==t&&(this.mode=t,!0)},t.prototype.setModeSensitivity=function(t){return this.modeSensitivity!==t&&(this.modeSensitivity=t,!0)},t.prototype.setOnDrawStartCallback=function(t){return this.onDrawStart!==t&&(this.onDrawStart=t,!0)},t.prototype.setOnDrawingCallback=function(t){return this.onDrawing!==t&&(this.onDrawing=t,!0)},t.prototype.setOnDrawEndCallback=function(t){return this.onDrawEnd!==t&&(this.onDrawEnd=t,!0)},t.prototype.setOnClickCallback=function(t){return this.onClick!==t&&(this.onClick=t,!0)},t.prototype.setOnDoubleClickCallback=function(t){return this.onDoubleClick!==t&&(this.onDoubleClick=t,!0)},t.prototype.setOnRightClickCallback=function(t){return this.onRightClick!==t&&(this.onRightClick=t,!0)},t.prototype.setOnPressedMoveStartCallback=function(t){return this.onPressedMoveStart!==t&&(this.onPressedMoveStart=t,!0)},t.prototype.setOnPressedMovingCallback=function(t){return this.onPressedMoving!==t&&(this.onPressedMoving=t,!0)},t.prototype.setOnPressedMoveEndCallback=function(t){return this.onPressedMoveEnd!==t&&(this.onPressedMoveEnd=t,!0)},t.prototype.setOnMouseEnterCallback=function(t){return this.onMouseEnter!==t&&(this.onMouseEnter=t,!0)},t.prototype.setOnMouseLeaveCallback=function(t){return this.onMouseLeave!==t&&(this.onMouseLeave=t,!0)},t.prototype.setOnRemovedCallback=function(t){return this.onRemoved!==t&&(this.onRemoved=t,!0)},t.prototype.setOnSelectedCallback=function(t){return this.onSelected!==t&&(this.onSelected=t,!0)},t.prototype.setOnDeselectedCallback=function(t){return this.onDeselected!==t&&(this.onDeselected=t,!0)},t.prototype.nextStep=function(){this.currentStep===this.totalStep-1?this.currentStep=-1:this.currentStep++},t.prototype.forceComplete=function(){this.currentStep=-1},t.prototype.isDrawing=function(){return -1!==this.currentStep},t.prototype.isStart=function(){return 1===this.currentStep},t.prototype.eventMoveForDrawing=function(t){var e,i=this.currentStep-1,n={};ta(t.timestamp)&&(n.timestamp=t.timestamp),ta(t.dataIndex)&&(n.dataIndex=t.dataIndex),ta(t.value)&&(n.value=t.value),this.points[i]=n,null===(e=this.performEventMoveForDrawing)||void 0===e||e.call(this,{currentStep:this.currentStep,mode:this.mode,points:this.points,performPointIndex:i,performPoint:n})},t.prototype.eventPressedPointMove=function(t,e){var i;ta(t.dataIndex)&&(this.points[e].dataIndex=t.dataIndex,this.points[e].timestamp=t.timestamp),ta(t.value)&&(this.points[e].value=t.value),null===(i=this.performEventPressedMove)||void 0===i||i.call(this,{currentStep:this.currentStep,points:this.points,mode:this.mode,performPointIndex:e,performPoint:this.points[e]})},t.prototype.startPressedMove=function(t){this._prevPressedPoint=B({},t),this._prevPressedPoints=ti(this.points)},t.prototype.eventPressedOtherMove=function(t,e){if(null!==this._prevPressedPoint){var i,n;ta(t.dataIndex)&&ta(this._prevPressedPoint.dataIndex)&&(i=t.dataIndex-this._prevPressedPoint.dataIndex),ta(t.value)&&ta(this._prevPressedPoint.value)&&(n=t.value-this._prevPressedPoint.value),this.points=this._prevPressedPoints.map(function(t){ta(t.timestamp)&&(t.dataIndex=e.timestampToDataIndex(t.timestamp));var o,r=B({},t);return ta(i)&&ta(t.dataIndex)&&(r.dataIndex=t.dataIndex+i,r.timestamp=null!==(o=e.dataIndexToTimestamp(r.dataIndex))&&void 0!==o?o:void 0),ta(n)&&ta(t.value)&&(r.value=t.value+n),r})}},t.extend=function(e){return function(t){function i(){return t.call(this,e)||this}return R(i,t),i}(t)},t}();function tT(t){return to(window.requestAnimationFrame)?window.requestAnimationFrame(t):window.setTimeout(t,20)}function tP(t){to(window.cancelAnimationFrame)?window.cancelAnimationFrame(t):window.clearTimeout(t)}(v=k||(k={}))[v.Tooltip=0]="Tooltip",v[v.Crosshair=1]="Crosshair",v[v.XAxis=2]="XAxis";var tM=function(){function t(t){this._options={duration:500,iterationCount:1},this._currentIterationCount=0,this._running=!1,this._time=0,te(this._options,t)}return t.prototype._loop=function(){var t=this;this._running=!0;var e=function(){var i;if(t._running){var n=new Date().getTime()-t._time;n<t._options.duration?(null===(i=t._doFrameCallback)||void 0===i||i.call(t,n),tT(e)):(t.stop(),t._currentIterationCount++,t._currentIterationCount<t._options.iterationCount&&t.start())}};tT(e)},t.prototype.doFrame=function(t){return this._doFrameCallback=t,this},t.prototype.setDuration=function(t){return this._options.duration=t,this},t.prototype.setIterationCount=function(t){return this._options.iterationCount=t,this},t.prototype.start=function(){this._running||(this._time=new Date().getTime(),this._loop())},t.prototype.stop=function(){var t;this._running&&(null===(t=this._doFrameCallback)||void 0===t||t.call(this,this._options.duration)),this._running=!1},t}(),tD=1,tk=new Date().getTime();function tA(t){var e=new Date().getTime();return e===tk?++tD:tD=1,tk=e,"".concat(null!=t?t:"").concat(e,"_").concat(tD)}function tF(t,e){var i,n=document.createElement(t),o=null!=e?e:{};for(var r in o)n.style[r]=null!==(i=o[r])&&void 0!==i?i:"";return n}function tL(t,e,i){var n=0,o=0;for(o=t.length-1;n!==o;){var r=Math.floor((o+n)/2),a=o-n,s=t[r][e];if(i===t[n][e])break;if(i===t[o][e])return o;if(i===s)return r;if(i>s?n=r:o=r,a<=2)break}return n}function tR(t,e){return null==e&&(e=10),e=Math.min(Math.max(0,e),20),+(+t).toFixed(e)}function tB(t,e,i){var n=[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER];return t.forEach(function(t){var o,r;n[0]=Math.max(null!==(o=t[e])&&void 0!==o?o:t,n[0]),n[1]=Math.min(null!==(r=t[i])&&void 0!==r?r:t,n[1])}),n}function tN(t){return Math.log(t)/Math.log(10)}function tO(t){return Math.pow(10,t)}function tV(){return{from:0,to:0,realFrom:0,realTo:0}}(f=A||(A={})).Init="init",f.Forward="forward",f.Backward="backward";var tz={MIN:1,MAX:50},tW=function(){function t(t){this._dateTimeFormat=this._buildDateTimeFormat(),this._zoomEnabled=!0,this._scrollEnabled=!0,this._totalBarSpace=0,this._barSpace=8,this._offsetRightDistance=80,this._startLastBarRightSideDiffBarCount=0,this._scrollLimitRole=0,this._minVisibleBarCount={left:2,right:2},this._maxOffsetDistance={left:50,right:50},this._visibleRange=tV(),this._chartStore=t,this._gapBarSpace=this._calcGapBarSpace(),this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace}return t.prototype._calcGapBarSpace=function(){var t;return this._barSpace>3?t=Math.floor(.88*this._barSpace):(t=Math.floor(this._barSpace))===this._barSpace&&t--,t%2==0&&t--,t=Math.max(1,t)},t.prototype.adjustVisibleRange=function(){var t,e,i,n,o=this._chartStore.getDataList(),r=o.length,a=this._totalBarSpace/this._barSpace;1===this._scrollLimitRole?(i=(this._totalBarSpace-this._maxOffsetDistance.right)/this._barSpace,n=(this._totalBarSpace-this._maxOffsetDistance.left)/this._barSpace):(i=this._minVisibleBarCount.left,n=this._minVisibleBarCount.right),i=Math.max(0,i),n=Math.max(0,n);var s=a-Math.min(i,r);this._lastBarRightSideDiffBarCount>s&&(this._lastBarRightSideDiffBarCount=s);var l=-r+Math.min(n,r);this._lastBarRightSideDiffBarCount<l&&(this._lastBarRightSideDiffBarCount=l);var c=Math.round(this._lastBarRightSideDiffBarCount+r+.5),u=c;c>r&&(c=r);var h=Math.round(c-a)-1;h<0&&(h=0);var d=this._lastBarRightSideDiffBarCount>0?Math.round(r+this._lastBarRightSideDiffBarCount-a)-1:h;if(this._visibleRange={from:h,to:c,realFrom:d,realTo:u},this._chartStore.getActionStore().execute(P.OnVisibleRangeChange,this._visibleRange),this._chartStore.adjustVisibleDataList(),0===h){var p=o[0];this._chartStore.executeLoadMoreCallback(null!==(t=null==p?void 0:p.timestamp)&&void 0!==t?t:null),this._chartStore.executeLoadDataCallback({type:A.Forward,data:null!=p?p:null})}c===r&&this._chartStore.executeLoadDataCallback({type:A.Backward,data:null!==(e=o[r-1])&&void 0!==e?e:null})},t.prototype.getDateTimeFormat=function(){return this._dateTimeFormat},t.prototype._buildDateTimeFormat=function(t){var e={hour12:!1,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"};tc(t)&&(e.timeZone=t);var i=null;try{i=new Intl.DateTimeFormat("en",e)}catch(t){tt("","","Timezone is error!!!")}return i},t.prototype.setTimezone=function(t){var e=this._buildDateTimeFormat(t);null!==e&&(this._dateTimeFormat=e)},t.prototype.getTimezone=function(){return this._dateTimeFormat.resolvedOptions().timeZone},t.prototype.getBarSpace=function(){return{bar:this._barSpace,halfBar:this._barSpace/2,gapBar:this._gapBarSpace,halfGapBar:Math.floor(this._gapBarSpace/2)}},t.prototype.setBarSpace=function(t,e){t<tz.MIN||t>tz.MAX||this._barSpace===t||(this._barSpace=t,this._gapBarSpace=this._calcGapBarSpace(),null==e||e(),this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0))},t.prototype.setTotalBarSpace=function(t){return this._totalBarSpace!==t&&(this._totalBarSpace=t,this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0)),this},t.prototype.setOffsetRightDistance=function(t,e){return this._offsetRightDistance=1===this._scrollLimitRole?Math.min(this._maxOffsetDistance.right,t):t,this._lastBarRightSideDiffBarCount=this._offsetRightDistance/this._barSpace,null!=e&&e&&(this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0)),this},t.prototype.resetOffsetRightDistance=function(){this.setOffsetRightDistance(this._offsetRightDistance)},t.prototype.getInitialOffsetRightDistance=function(){return this._offsetRightDistance},t.prototype.getOffsetRightDistance=function(){return Math.max(0,this._lastBarRightSideDiffBarCount*this._barSpace)},t.prototype.getLastBarRightSideDiffBarCount=function(){return this._lastBarRightSideDiffBarCount},t.prototype.setLastBarRightSideDiffBarCount=function(t){return this._lastBarRightSideDiffBarCount=t,this},t.prototype.setMaxOffsetLeftDistance=function(t){return this._scrollLimitRole=1,this._maxOffsetDistance.left=t,this},t.prototype.setMaxOffsetRightDistance=function(t){return this._scrollLimitRole=1,this._maxOffsetDistance.right=t,this},t.prototype.setLeftMinVisibleBarCount=function(t){return this._scrollLimitRole=0,this._minVisibleBarCount.left=t,this},t.prototype.setRightMinVisibleBarCount=function(t){return this._scrollLimitRole=0,this._minVisibleBarCount.right=t,this},t.prototype.getVisibleRange=function(){return this._visibleRange},t.prototype.startScroll=function(){this._startLastBarRightSideDiffBarCount=this._lastBarRightSideDiffBarCount},t.prototype.scroll=function(t){if(this._scrollEnabled){var e=t/this._barSpace,i=this._lastBarRightSideDiffBarCount*this._barSpace;this._lastBarRightSideDiffBarCount=this._startLastBarRightSideDiffBarCount-e,this.adjustVisibleRange(),this._chartStore.getTooltipStore().recalculateCrosshair(!0),this._chartStore.getChart().adjustPaneViewport(!1,!0,!0,!0);var n=Math.round(i-this._lastBarRightSideDiffBarCount*this._barSpace);0!==n&&this._chartStore.getActionStore().execute(P.OnScroll,{distance:n})}},t.prototype.getDataByDataIndex=function(t){var e;return null!==(e=this._chartStore.getDataList()[t])&&void 0!==e?e:null},t.prototype.coordinateToFloatIndex=function(t){var e=this._chartStore.getDataList().length,i=(this._totalBarSpace-t)/this._barSpace;return Math.round(1e6*(e+this._lastBarRightSideDiffBarCount-i))/1e6},t.prototype.dataIndexToTimestamp=function(t){var e,i=this.getDataByDataIndex(t);return null!==(e=null==i?void 0:i.timestamp)&&void 0!==e?e:null},t.prototype.timestampToDataIndex=function(t){var e=this._chartStore.getDataList();return 0===e.length?0:tL(e,"timestamp",t)},t.prototype.dataIndexToCoordinate=function(t){var e=this._chartStore.getDataList().length+this._lastBarRightSideDiffBarCount-t;return Math.floor(this._totalBarSpace-(e-.5)*this._barSpace)},t.prototype.coordinateToDataIndex=function(t){return Math.ceil(this.coordinateToFloatIndex(t))-1},t.prototype.zoom=function(t,e){var i,n=this;if(this._zoomEnabled){var o=null!=e?e:null;if(!ta(null==o?void 0:o.x)){var r=this._chartStore.getTooltipStore().getCrosshair();o={x:null!==(i=null==r?void 0:r.x)&&void 0!==i?i:this._totalBarSpace/2}}var a=o.x,s=this.coordinateToFloatIndex(a),l=this._barSpace,c=this._barSpace+this._barSpace/10*t;this.setBarSpace(c,function(){n._lastBarRightSideDiffBarCount+=s-n.coordinateToFloatIndex(a)});var u=this._barSpace/l;1!==u&&this._chartStore.getActionStore().execute(P.OnZoom,{scale:u})}},t.prototype.setZoomEnabled=function(t){return this._zoomEnabled=t,this},t.prototype.getZoomEnabled=function(){return this._zoomEnabled},t.prototype.setScrollEnabled=function(t){return this._scrollEnabled=t,this},t.prototype.getScrollEnabled=function(){return this._scrollEnabled},t.prototype.clear=function(){this._visibleRange=tV()},t}(),tX={name:"AVP",shortName:"AVP",series:M.Price,precision:2,figures:[{key:"avp",title:"AVP: ",type:"line"}],calc:function(t){var e=0,i=0;return t.map(function(t){var n,o,r={},a=null!==(n=null==t?void 0:t.turnover)&&void 0!==n?n:0,s=null!==(o=null==t?void 0:t.volume)&&void 0!==o?o:0;return e+=a,0!==(i+=s)&&(r.avp=e/i),r})}},tY={name:"BOLL",shortName:"BOLL",series:M.Price,calcParams:[20,2],precision:2,shouldOhlc:!0,figures:[{key:"up",title:"UP: ",type:"line"},{key:"mid",title:"MID: ",type:"line"},{key:"dn",title:"DN: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=i[0]-1,o=0;return t.map(function(e,r){var a=e.close,s={};if(o+=a,r>=n){s.mid=o/i[0];var l,c,u,h,d=(l=t.slice(r-n,r+1),c=s.mid,u=l.length,h=0,l.forEach(function(t){var e=t.close-c;h+=e*e}),Math.sqrt((h=Math.abs(h))/u));s.up=s.mid+i[1]*d,s.dn=s.mid-i[1]*d,o-=t[r-n].close}return s})}},tH={name:"BBI",shortName:"BBI",series:M.Price,precision:2,calcParams:[3,6,12,24],shouldOhlc:!0,figures:[{key:"bbi",title:"BBI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=Math.max.apply(Math,W([],z(i),!1)),o=[],r=[];return t.map(function(e,a){var s={},l=e.close;if(i.forEach(function(e,i){var n;o[i]=(null!==(n=o[i])&&void 0!==n?n:0)+l,a>=e-1&&(r[i]=o[i]/e,o[i]-=t[a-(e-1)].close)}),a>=n-1){var c=0;r.forEach(function(t){c+=t}),s.bbi=c/4}return s})}},tG={name:"EMA",shortName:"EMA",series:M.Price,calcParams:[6,12,20],precision:2,shouldOhlc:!0,figures:[{key:"ema1",title:"EMA6: ",type:"line"},{key:"ema2",title:"EMA12: ",type:"line"},{key:"ema3",title:"EMA20: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"ema".concat(e+1),title:"EMA".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,o=0,r=[];return t.map(function(t,e){var a={},s=t.close;return o+=s,i.forEach(function(t,i){e>=t-1&&(e>t-1?r[i]=(2*s+(t-1)*r[i])/(t+1):r[i]=o/t,a[n[i].key]=r[i])}),a})}},tj={name:"MA",shortName:"MA",series:M.Price,calcParams:[5,10,30,60],precision:2,shouldOhlc:!0,figures:[{key:"ma5",title:"MA5: ",type:"line"},{key:"ma10",title:"MA10: ",type:"line"},{key:"ma30",title:"MA30: ",type:"line"},{key:"ma60",title:"MA60: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"ma".concat(e+1),title:"MA".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,o=[];return t.map(function(e,r){var a={},s=e.close;return i.forEach(function(e,i){var l;o[i]=(null!==(l=o[i])&&void 0!==l?l:0)+s,r>=e-1&&(a[n[i].key]=o[i]/e,o[i]-=t[r-(e-1)].close)}),a})}},tK={name:"SMA",shortName:"SMA",series:M.Price,calcParams:[12,2],precision:2,figures:[{key:"sma",title:"SMA: ",type:"line"}],shouldOhlc:!0,calc:function(t,e){var i=e.calcParams,n=0,o=0;return t.map(function(t,e){var r={},a=t.close;return n+=a,e>=i[0]-1&&(o=e>i[0]-1?(a*i[1]+o*(i[0]-i[1]+1))/(i[0]+1):n/i[0],r.sma=o),r})}},tZ={name:"SAR",shortName:"SAR",series:M.Price,calcParams:[2,2,20],precision:2,shouldOhlc:!0,figures:[{key:"sar",title:"SAR: ",type:"circle",styles:function(t,e,i){var n,o,r=t.current,a=null!==(o=null===(n=r.indicatorData)||void 0===n?void 0:n.sar)&&void 0!==o?o:Number.MIN_SAFE_INTEGER,s=r.kLineData;return{color:a<((null==s?void 0:s.high)+(null==s?void 0:s.low))/2?td(e.styles,"circles[0].upColor",i.circles[0].upColor):td(e.styles,"circles[0].downColor",i.circles[0].downColor)}}}],calc:function(t,e){var i=e.calcParams,n=i[0]/100,o=i[1]/100,r=i[2]/100,a=n,s=-100,l=!1,c=0;return t.map(function(e,i){var u=c,h=e.high,d=e.low;if(l){(-100===s||s<h)&&(s=h,a=Math.min(a+o,r)),c=u+a*(s-u);var p=Math.min(t[Math.max(1,i)-1].low,d);c>e.low?(c=s,a=n,s=-100,l=!l):c>p&&(c=p)}else{(-100===s||s>d)&&(s=d,a=Math.min(a+o,r)),c=u+a*(s-u);var g=Math.max(t[Math.max(1,i)-1].high,h);c<e.high?(c=s,a=0,s=-100,l=!l):c<g&&(c=g)}return{sar:c}})}};function tU(){return{key:"volume",title:"VOLUME: ",type:"bar",baseValue:0,styles:function(t,e,i){var n=t.current.kLineData,o=td(e.styles,"bars[0].noChangeColor",i.bars[0].noChangeColor);return ts(n)&&(n.close>n.open?o=td(e.styles,"bars[0].upColor",i.bars[0].upColor):n.close<n.open&&(o=td(e.styles,"bars[0].downColor",i.bars[0].downColor))),{color:o}}}}var tq={name:"VOL",shortName:"VOL",series:M.Volume,calcParams:[5,10,20],shouldFormatBigNumber:!0,precision:0,minValue:0,figures:[{key:"ma1",title:"MA5: ",type:"line"},{key:"ma2",title:"MA10: ",type:"line"},{key:"ma3",title:"MA20: ",type:"line"},tU()],regenerateFigures:function(t){var e=t.map(function(t,e){return{key:"ma".concat(e+1),title:"MA".concat(t,": "),type:"line"}});return e.push(tU()),e},calc:function(t,e){var i=e.calcParams,n=e.figures,o=[];return t.map(function(e,r){var a,s=null!==(a=e.volume)&&void 0!==a?a:0,l={volume:s};return i.forEach(function(e,i){var a,c;o[i]=(null!==(a=o[i])&&void 0!==a?a:0)+s,r>=e-1&&(l[n[i].key]=o[i]/e,o[i]-=null!==(c=t[r-(e-1)].volume)&&void 0!==c?c:0)}),l})}},t$={};function tQ(t){var e;return null!==(e=t$[t])&&void 0!==e?e:null}[tX,{name:"AO",shortName:"AO",calcParams:[5,34],figures:[{key:"ao",title:"AO: ",type:"bar",baseValue:0,styles:function(t,e,i){var n,o,r,a,s,l=t.prev,c=t.current,u=null!==(o=null===(n=l.indicatorData)||void 0===n?void 0:n.ao)&&void 0!==o?o:Number.MIN_SAFE_INTEGER,h=null!==(a=null===(r=c.indicatorData)||void 0===r?void 0:r.ao)&&void 0!==a?a:Number.MIN_SAFE_INTEGER;return{color:s=h>u?td(e.styles,"bars[0].upColor",i.bars[0].upColor):td(e.styles,"bars[0].downColor",i.bars[0].downColor),style:h>u?_.Stroke:_.Fill,borderColor:s}}}],calc:function(t,e){var i=e.calcParams,n=Math.max(i[0],i[1]),o=0,r=0,a=0,s=0;return t.map(function(e,l){var c={},u=(e.low+e.high)/2;if(o+=u,r+=u,l>=i[0]-1){a=o/i[0];var h=t[l-(i[0]-1)];o-=(h.low+h.high)/2}if(l>=i[1]-1){s=r/i[1];var h=t[l-(i[1]-1)];r-=(h.low+h.high)/2}return l>=n-1&&(c.ao=a-s),c})}},{name:"BIAS",shortName:"BIAS",calcParams:[6,12,24],figures:[{key:"bias1",title:"BIAS6: ",type:"line"},{key:"bias2",title:"BIAS12: ",type:"line"},{key:"bias3",title:"BIAS24: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"bias".concat(e+1),title:"BIAS".concat(t,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,o=[];return t.map(function(e,r){var a={},s=e.close;return i.forEach(function(e,l){var c;if(o[l]=(null!==(c=o[l])&&void 0!==c?c:0)+s,r>=e-1){var u=o[l]/i[l];a[n[l].key]=(s-u)/u*100,o[l]-=t[r-(e-1)].close}}),a})}},tY,{name:"BRAR",shortName:"BRAR",calcParams:[26],figures:[{key:"br",title:"BR: ",type:"line"},{key:"ar",title:"AR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=0,r=0,a=0;return t.map(function(e,s){var l,c,u={},h=e.high,d=e.low,p=e.open,g=(null!==(l=t[s-1])&&void 0!==l?l:e).close;if(r+=h-p,a+=p-d,n+=h-g,o+=g-d,s>=i[0]-1){0!==a?u.ar=r/a*100:u.ar=0,0!==o?u.br=n/o*100:u.br=0;var v=t[s-(i[0]-1)],f=v.high,m=v.low,y=v.open,_=(null!==(c=t[s-i[0]])&&void 0!==c?c:t[s-(i[0]-1)]).close;n-=f-_,o-=_-m,r-=f-y,a-=y-m}return u})}},tH,{name:"CCI",shortName:"CCI",calcParams:[20],figures:[{key:"cci",title:"CCI: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=i[0]-1,o=0,r=[];return t.map(function(e,a){var s={},l=(e.high+e.low+e.close)/3;if(o+=l,r.push(l),a>=n){var c=o/i[0],u=r.slice(a-n,a+1),h=0;u.forEach(function(t){h+=Math.abs(t-c)});var d=h/i[0];s.cci=0!==d?(l-c)/d/.015:0;var p=(t[a-n].high+t[a-n].low+t[a-n].close)/3;o-=p}return s})}},{name:"CR",shortName:"CR",calcParams:[26,10,20,40,60],figures:[{key:"cr",title:"CR: ",type:"line"},{key:"ma1",title:"MA1: ",type:"line"},{key:"ma2",title:"MA2: ",type:"line"},{key:"ma3",title:"MA3: ",type:"line"},{key:"ma4",title:"MA4: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=Math.ceil(i[1]/2.5+1),o=Math.ceil(i[2]/2.5+1),r=Math.ceil(i[3]/2.5+1),a=Math.ceil(i[4]/2.5+1),s=0,l=[],c=0,u=[],h=0,d=[],p=0,g=[],v=[];return t.forEach(function(e,f){var m,y,_,x,S,C={},b=null!==(m=t[f-1])&&void 0!==m?m:e,w=(b.high+b.close+b.low+b.open)/4,I=Math.max(0,e.high-w),E=Math.max(0,w-e.low);f>=i[0]-1&&(0!==E?C.cr=I/E*100:C.cr=0,s+=C.cr,c+=C.cr,h+=C.cr,p+=C.cr,f>=i[0]+i[1]-2&&(l.push(s/i[1]),f>=i[0]+i[1]+n-3&&(C.ma1=l[l.length-1-n]),s-=null!==(y=v[f-(i[1]-1)].cr)&&void 0!==y?y:0),f>=i[0]+i[2]-2&&(u.push(c/i[2]),f>=i[0]+i[2]+o-3&&(C.ma2=u[u.length-1-o]),c-=null!==(_=v[f-(i[2]-1)].cr)&&void 0!==_?_:0),f>=i[0]+i[3]-2&&(d.push(h/i[3]),f>=i[0]+i[3]+r-3&&(C.ma3=d[d.length-1-r]),h-=null!==(x=v[f-(i[3]-1)].cr)&&void 0!==x?x:0),f>=i[0]+i[4]-2&&(g.push(p/i[4]),f>=i[0]+i[4]+a-3&&(C.ma4=g[g.length-1-a]),p-=null!==(S=v[f-(i[4]-1)].cr)&&void 0!==S?S:0)),v.push(C)}),v}},{name:"DMA",shortName:"DMA",calcParams:[10,50,10],figures:[{key:"dma",title:"DMA: ",type:"line"},{key:"ama",title:"AMA: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=Math.max(i[0],i[1]),o=0,r=0,a=0,s=[];return t.forEach(function(e,l){var c,u={},h=e.close;o+=h,r+=h;var d=0,p=0;if(l>=i[0]-1&&(d=o/i[0],o-=t[l-(i[0]-1)].close),l>=i[1]-1&&(p=r/i[1],r-=t[l-(i[1]-1)].close),l>=n-1){var g=d-p;u.dma=g,a+=g,l>=n+i[2]-2&&(u.ama=a/i[2],a-=null!==(c=s[l-(i[2]-1)].dma)&&void 0!==c?c:0)}s.push(u)}),s}},{name:"DMI",shortName:"DMI",calcParams:[14,6],figures:[{key:"pdi",title:"PDI: ",type:"line"},{key:"mdi",title:"MDI: ",type:"line"},{key:"adx",title:"ADX: ",type:"line"},{key:"adxr",title:"ADXR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=0,r=0,a=0,s=0,l=0,c=0,u=0,h=[];return t.forEach(function(e,d){var p,g,v={},f=null!==(p=t[d-1])&&void 0!==p?p:e,m=f.close,y=e.high,_=e.low,x=Math.abs(y-m),S=Math.abs(m-_),C=y-f.high,b=f.low-_,w=Math.max(Math.max(y-_,x),S),I=C>0&&C>b?C:0,E=b>0&&b>C?b:0;if(n+=w,o+=I,r+=E,d>=i[0]-1){d>i[0]-1?(a=a-a/i[0]+w,s=s-s/i[0]+I,l=l-l/i[0]+E):(a=n,s=o,l=r);var T=0,P=0;0!==a&&(T=100*s/a,P=100*l/a),v.pdi=T,v.mdi=P;var M=0;P+T!==0&&(M=Math.abs(P-T)/(P+T)*100),c+=M,d>=2*i[0]-2&&(u=d>2*i[0]-2?(u*(i[0]-1)+M)/i[0]:c/i[0],v.adx=u,d>=2*i[0]+i[1]-3&&(v.adxr=((null!==(g=h[d-(i[1]-1)].adx)&&void 0!==g?g:0)+u)/2))}h.push(v)}),h}},{name:"EMV",shortName:"EMV",calcParams:[14,9],figures:[{key:"emv",title:"EMV: ",type:"line"},{key:"maEmv",title:"MAEMV: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=[];return t.map(function(e,r){var a,s={};if(r>0){var l=t[r-1],c=e.high,u=e.low,h=null!==(a=e.volume)&&void 0!==a?a:0,d=(c+u)/2-(l.high+l.low)/2;0===h||c-u==0?s.emv=0:s.emv=d/(h/1e8/(c-u)),n+=s.emv,o.push(s.emv),r>=i[0]&&(s.maEmv=n/i[0],n-=o[r-i[0]])}return s})}},tG,{name:"MTM",shortName:"MTM",calcParams:[12,6],figures:[{key:"mtm",title:"MTM: ",type:"line"},{key:"maMtm",title:"MAMTM: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=[];return t.forEach(function(e,r){var a,s={};if(r>=i[0]){var l=e.close,c=t[r-i[0]].close;s.mtm=l-c,n+=s.mtm,r>=i[0]+i[1]-1&&(s.maMtm=n/i[1],n-=null!==(a=o[r-(i[1]-1)].mtm)&&void 0!==a?a:0)}o.push(s)}),o}},tj,{name:"MACD",shortName:"MACD",calcParams:[12,26,9],figures:[{key:"dif",title:"DIF: ",type:"line"},{key:"dea",title:"DEA: ",type:"line"},{key:"macd",title:"MACD: ",type:"bar",baseValue:0,styles:function(t,e,i){var n,o,r,a,s,l=t.prev,c=t.current,u=null!==(o=null===(n=l.indicatorData)||void 0===n?void 0:n.macd)&&void 0!==o?o:Number.MIN_SAFE_INTEGER,h=null!==(a=null===(r=c.indicatorData)||void 0===r?void 0:r.macd)&&void 0!==a?a:Number.MIN_SAFE_INTEGER;return s=h>0?td(e.styles,"bars[0].upColor",i.bars[0].upColor):h<0?td(e.styles,"bars[0].downColor",i.bars[0].downColor):td(e.styles,"bars[0].noChangeColor",i.bars[0].noChangeColor),{style:u<h?_.Stroke:_.Fill,color:s,borderColor:s}}}],calc:function(t,e){var i,n,o=e.calcParams,r=0,a=0,s=0,l=0,c=Math.max(o[0],o[1]);return t.map(function(t,e){var u={},h=t.close;return r+=h,e>=o[0]-1&&(i=e>o[0]-1?(2*h+(o[0]-1)*i)/(o[0]+1):r/o[0]),e>=o[1]-1&&(n=e>o[1]-1?(2*h+(o[1]-1)*n)/(o[1]+1):r/o[1]),e>=c-1&&(a=i-n,u.dif=a,s+=a,e>=c+o[2]-2&&(l=e>c+o[2]-2?(2*a+l*(o[2]-1))/(o[2]+1):s/o[2],u.macd=(a-l)*2,u.dea=l)),u})}},{name:"OBV",shortName:"OBV",calcParams:[30],figures:[{key:"obv",title:"OBV: ",type:"line"},{key:"maObv",title:"MAOBV: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=0,r=[];return t.forEach(function(e,a){var s,l,c,u,h=null!==(s=t[a-1])&&void 0!==s?s:e;e.close<h.close?o-=null!==(l=e.volume)&&void 0!==l?l:0:e.close>h.close&&(o+=null!==(c=e.volume)&&void 0!==c?c:0);var d={obv:o};n+=o,a>=i[0]-1&&(d.maObv=n/i[0],n-=null!==(u=r[a-(i[0]-1)].obv)&&void 0!==u?u:0),r.push(d)}),r}},{name:"PVT",shortName:"PVT",figures:[{key:"pvt",title:"PVT: ",type:"line"}],calc:function(t){var e=0;return t.map(function(i,n){var o,r,a={},s=i.close,l=null!==(o=i.volume)&&void 0!==o?o:1,c=(null!==(r=t[n-1])&&void 0!==r?r:i).close,u=0,h=c*l;return 0!==h&&(u=(s-c)/h),e+=u,a.pvt=e,a})}},{name:"PSY",shortName:"PSY",calcParams:[12,6],figures:[{key:"psy",title:"PSY: ",type:"line"},{key:"maPsy",title:"MAPSY: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=0,r=[],a=[];return t.forEach(function(e,s){var l,c,u={},h=(null!==(l=t[s-1])&&void 0!==l?l:e).close,d=e.close-h>0?1:0;r.push(d),n+=d,s>=i[0]-1&&(u.psy=n/i[0]*100,o+=u.psy,s>=i[0]+i[1]-2&&(u.maPsy=o/i[1],o-=null!==(c=a[s-(i[1]-1)].psy)&&void 0!==c?c:0),n-=r[s-(i[0]-1)]),a.push(u)}),a}},{name:"ROC",shortName:"ROC",calcParams:[12,6],figures:[{key:"roc",title:"ROC: ",type:"line"},{key:"maRoc",title:"MAROC: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=[],o=0;return t.forEach(function(e,r){var a,s,l={};if(r>=i[0]-1){var c=e.close,u=(null!==(a=t[r-i[0]])&&void 0!==a?a:t[r-(i[0]-1)]).close;0!==u?l.roc=(c-u)/u*100:l.roc=0,o+=l.roc,r>=i[0]-1+i[1]-1&&(l.maRoc=o/i[1],o-=null!==(s=n[r-(i[1]-1)].roc)&&void 0!==s?s:0)}n.push(l)}),n}},{name:"RSI",shortName:"RSI",calcParams:[6,12,24],figures:[{key:"rsi1",title:"RSI1: ",type:"line"},{key:"rsi2",title:"RSI2: ",type:"line"},{key:"rsi3",title:"RSI3: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){var i=e+1;return{key:"rsi".concat(i),title:"RSI".concat(i,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures,o=[],r=[];return t.map(function(e,a){var s,l={},c=(null!==(s=t[a-1])&&void 0!==s?s:e).close,u=e.close-c;return i.forEach(function(e,i){var s,c,h;if(u>0?o[i]=(null!==(s=o[i])&&void 0!==s?s:0)+u:r[i]=(null!==(c=r[i])&&void 0!==c?c:0)+Math.abs(u),a>=e-1){0!==r[i]?l[n[i].key]=100-100/(1+o[i]/r[i]):l[n[i].key]=0;var d=t[a-(e-1)],p=null!==(h=t[a-e])&&void 0!==h?h:d,g=d.close-p.close;g>0?o[i]-=g:r[i]-=Math.abs(g)}}),l})}},tK,{name:"KDJ",shortName:"KDJ",calcParams:[9,3,3],figures:[{key:"k",title:"K: ",type:"line"},{key:"d",title:"D: ",type:"line"},{key:"j",title:"J: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=[];return t.forEach(function(e,o){var r,a,s,l,c={},u=e.close;if(o>=i[0]-1){var h=tB(t.slice(o-(i[0]-1),o+1),"high","low"),d=h[0],p=h[1],g=d-p;c.k=((i[1]-1)*(null!==(a=null===(r=n[o-1])||void 0===r?void 0:r.k)&&void 0!==a?a:50)+(u-p)/(0===g?1:g)*100)/i[1],c.d=((i[2]-1)*(null!==(l=null===(s=n[o-1])||void 0===s?void 0:s.d)&&void 0!==l?l:50)+c.k)/i[2],c.j=3*c.k-2*c.d}n.push(c)}),n}},tZ,{name:"TRIX",shortName:"TRIX",calcParams:[12,9],figures:[{key:"trix",title:"TRIX: ",type:"line"},{key:"maTrix",title:"MATRIX: ",type:"line"}],calc:function(t,e){var i,n,o,r=e.calcParams,a=0,s=0,l=0,c=0,u=[];return t.forEach(function(t,e){var h,d={},p=t.close;if(a+=p,e>=r[0]-1&&(i=e>r[0]-1?(2*p+(r[0]-1)*i)/(r[0]+1):a/r[0],s+=i,e>=2*r[0]-2&&(n=e>2*r[0]-2?(2*i+(r[0]-1)*n)/(r[0]+1):s/r[0],l+=n,e>=3*r[0]-3))){var g=void 0,v=0;e>3*r[0]-3?v=((g=(2*n+(r[0]-1)*o)/(r[0]+1))-o)/o*100:g=l/r[0],o=g,d.trix=v,c+=v,e>=3*r[0]+r[1]-4&&(d.maTrix=c/r[1],c-=null!==(h=u[e-(r[1]-1)].trix)&&void 0!==h?h:0)}u.push(d)}),u}},tq,{name:"VR",shortName:"VR",calcParams:[26,6],figures:[{key:"vr",title:"VR: ",type:"line"},{key:"maVr",title:"MAVR: ",type:"line"}],calc:function(t,e){var i=e.calcParams,n=0,o=0,r=0,a=0,s=[];return t.forEach(function(e,l){var c,u,h,d,p,g={},v=e.close,f=(null!==(c=t[l-1])&&void 0!==c?c:e).close,m=null!==(u=e.volume)&&void 0!==u?u:0;if(v>f?n+=m:v<f?o+=m:r+=m,l>=i[0]-1){var y=r/2;o+y===0?g.vr=0:g.vr=(n+y)/(o+y)*100,a+=g.vr,l>=i[0]+i[1]-2&&(g.maVr=a/i[1],a-=null!==(h=s[l-(i[1]-1)].vr)&&void 0!==h?h:0);var _=t[l-(i[0]-1)],x=null!==(d=t[l-i[0]])&&void 0!==d?d:_,S=_.close,C=null!==(p=_.volume)&&void 0!==p?p:0;S>x.close?n-=C:S<x.close?o-=C:r-=C}s.push(g)}),s}},{name:"WR",shortName:"WR",calcParams:[6,10,14],figures:[{key:"wr1",title:"WR1: ",type:"line"},{key:"wr2",title:"WR2: ",type:"line"},{key:"wr3",title:"WR3: ",type:"line"}],regenerateFigures:function(t){return t.map(function(t,e){return{key:"wr".concat(e+1),title:"WR".concat(e+1,": "),type:"line"}})},calc:function(t,e){var i=e.calcParams,n=e.figures;return t.map(function(e,o){var r={},a=e.close;return i.forEach(function(e,i){var s=e-1;if(o>=s){var l=tB(t.slice(o-s,o+1),"high","low"),c=l[0],u=c-l[1];r[n[i].key]=0===u?0:(a-c)/u*100}}),r})}}].forEach(function(t){t$[t.name]=tb.extend(t)});var tJ=function(){function t(t){this._instances=new Map,this._chartStore=t}return t.prototype._overrideInstance=function(t,e){var i=e.shortName,n=e.series,o=e.calcParams,r=e.precision,a=e.figures,s=e.minValue,l=e.maxValue,c=e.shouldOhlc,u=e.shouldFormatBigNumber,h=e.visible,d=e.zLevel,p=e.styles,g=e.extendData,v=e.regenerateFigures,f=e.createTooltipDataSource,m=e.draw,y=e.calc,_=!1;tc(i)&&t.setShortName(i)&&(_=!0),ts(n)&&t.setSeries(n)&&(_=!0);var x=!1;tn(o)&&t.setCalcParams(o)&&(_=!0,x=!0),tn(a)&&t.setFigures(a)&&(_=!0,x=!0),void 0!==s&&t.setMinValue(s)&&(_=!0),void 0!==l&&t.setMinValue(l)&&(_=!0),ta(r)&&t.setPrecision(r)&&(_=!0),tl(c)&&t.setShouldOhlc(c)&&(_=!0),tl(u)&&t.setShouldFormatBigNumber(u)&&(_=!0),tl(h)&&t.setVisible(h)&&(_=!0);var S=!1;return ta(d)&&t.setZLevel(d)&&(_=!0,S=!0),ts(p)&&t.setStyles(p)&&(_=!0),void 0!==g&&t.setExtendData(g)&&(_=!0,x=!0),void 0!==v&&t.setRegenerateFigures(v)&&(_=!0),void 0!==f&&t.setCreateTooltipDataSource(f)&&(_=!0),void 0!==m&&t.setDraw(m)&&(_=!0),to(y)&&(t.calc=y,x=!0),[_,x,S]},t.prototype._sort=function(t){var e;tc(t)?null===(e=this._instances.get(t))||void 0===e||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._instances.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addInstance=function(t,e,i){return N(this,void 0,void 0,function(){var n,o,r;return O(this,function(a){switch(a.label){case 0:if(n=t.name,!ts(o=this._instances.get(e))||!ts(o.find(function(t){return t.name===n})))return[3,2];return[4,Promise.reject(Error("Duplicate indicators."))];case 1:case 3:return[2,a.sent()];case 2:return ts(o)||(o=[]),r=new(tQ(n)),this.synchronizeSeriesPrecision(r),this._overrideInstance(r,t),i||(o=[]),o.push(r),this._instances.set(e,o),this._sort(e),[4,r.calcIndicator(this._chartStore.getDataList())]}})})},t.prototype.getInstances=function(t){var e;return null!==(e=this._instances.get(t))&&void 0!==e?e:[]},t.prototype.removeInstance=function(t,e){var i,n=!1,o=this._instances.get(t);if(ts(o)){if(tc(e)){var r=o.findIndex(function(t){return t.name===e});r>-1&&(o.splice(r,1),n=!0)}else this._instances.set(t,[]),n=!0;(null===(i=this._instances.get(t))||void 0===i?void 0:i.length)===0&&this._instances.delete(t)}return n},t.prototype.hasInstances=function(t){return this._instances.has(t)},t.prototype.calcInstance=function(t,e){return N(this,void 0,void 0,function(){var i,n,o,r=this;return O(this,function(a){switch(a.label){case 0:return i=[],tc(t)?tc(e)?ts(n=this._instances.get(e))&&ts(o=n.find(function(e){return e.name===t}))&&i.push(o.calcIndicator(this._chartStore.getDataList())):this._instances.forEach(function(e){var n=e.find(function(e){return e.name===t});ts(n)&&i.push(n.calcIndicator(r._chartStore.getDataList()))}):this._instances.forEach(function(t){t.forEach(function(t){i.push(t.calcIndicator(r._chartStore.getDataList()))})}),[4,Promise.all(i)];case 1:return[2,a.sent().includes(!0)]}})})},t.prototype.getInstanceByPaneId=function(t,e){var i,n,o=function(t){var e=new Map;return t.forEach(function(t){e.set(t.name,t)}),e};if(tc(t)){var r=null!==(i=this._instances.get(t))&&void 0!==i?i:[];return tc(e)?null!==(n=null==r?void 0:r.find(function(t){return t.name===e}))&&void 0!==n?n:null:o(r)}var a=new Map;return this._instances.forEach(function(t,e){a.set(e,o(t))}),a},t.prototype.synchronizeSeriesPrecision=function(t){var e=this._chartStore.getPrecision(),i=e.price,n=e.volume,o=function(t){switch(t.series){case M.Price:t.setPrecision(i,!0);break;case M.Volume:t.setPrecision(n,!0)}};ts(t)?o(t):this._instances.forEach(function(t){t.forEach(function(t){o(t)})})},t.prototype.override=function(t,e){return N(this,void 0,void 0,function(){var i,n,o,r,a,s,l,c=this;return O(this,function(u){switch(u.label){case 0:return i=t.name,n=new Map,null!==e?ts(o=this._instances.get(e))&&n.set(e,o):n=this._instances,r=!1,a=[],s=!1,n.forEach(function(e){var n=e.find(function(t){return t.name===i});if(ts(n)){var o=c._overrideInstance(n,t);o[2]&&(s=!0),o[1]?a.push(n.calcIndicator(c._chartStore.getDataList())):o[0]&&(r=!0)}}),s&&this._sort(),[4,Promise.all(a)];case 1:return l=u.sent(),[2,[r,l.includes(!0)]]}})})},t}(),t0=function(){function t(t){this._crosshair={},this._activeIcon=null,this._chartStore=t}return t.prototype.setCrosshair=function(t,e){var i,n,o=this._chartStore.getDataList(),r=null!=t?t:{};n=ta(r.x)?(i=this._chartStore.getTimeScaleStore().coordinateToDataIndex(r.x))<0?0:i>o.length-1?o.length-1:i:i=o.length-1;var a=o[n],s=this._chartStore.getTimeScaleStore().dataIndexToCoordinate(i),l={x:this._crosshair.x,y:this._crosshair.y,paneId:this._crosshair.paneId};this._crosshair=B(B({},r),{realX:s,kLineData:a,realDataIndex:i,dataIndex:n}),l.x===r.x&&l.y===r.y&&l.paneId===r.paneId||(null!==a&&this._chartStore.getChart().crosshairChange(this._crosshair),null!=e&&e||this._chartStore.getChart().updatePane(1))},t.prototype.recalculateCrosshair=function(t){this.setCrosshair(this._crosshair,t)},t.prototype.getCrosshair=function(){return this._crosshair},t.prototype.setActiveIcon=function(t){this._activeIcon=null!=t?t:null},t.prototype.getActiveIcon=function(){return this._activeIcon},t.prototype.clear=function(){this.setCrosshair({},!0),this.setActiveIcon()},t}(),t1=function(){function t(){this._children=[],this._callbacks=new Map}return t.prototype.registerEvent=function(t,e){return this._callbacks.set(t,e),this},t.prototype.onEvent=function(t,e,i){var n=this._callbacks.get(t);return!!(ts(n)&&this.checkEventOn(e))&&n(e,i)},t.prototype.checkEventOn=function(t){var e,i;try{for(var n=V(this._children),o=n.next();!o.done;o=n.next())if(o.value.checkEventOn(t))return!0}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return!1},t.prototype.dispatchEvent=function(t,e,i){var n=this._children.length-1;if(n>-1){for(var o=n;o>-1;o--)if(this._children[o].dispatchEvent(t,e,i))return!0}return this.onEvent(t,e,i)},t.prototype.addChild=function(t){return this._children.push(t),this},t.prototype.clear=function(){this._children=[]},t}(),t2=function(t){function e(e){var i=t.call(this)||this;return i.attrs=e.attrs,i.styles=e.styles,i}return R(e,t),e.prototype.checkEventOn=function(t){return this.checkEventOnImp(t,this.attrs,this.styles)},e.prototype.setAttrs=function(t){return this.attrs=t,this},e.prototype.setStyles=function(t){return this.styles=t,this},e.prototype.draw=function(t){this.drawImp(t,this.attrs,this.styles)},e.extend=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),i.prototype.checkEventOnImp=function(e,i,n){return t.checkEventOn(e,i,n)},i.prototype.drawImp=function(e,i,n){t.draw(e,i,n)},i}(e)},e}(t1);function t3(t,e){return null!==t?e.x*t[0]+t[1]:e.y}function t4(t,e){var i=t.x-e.x;if(0!==i){var n=(t.y-e.y)/i,o=t.y-n*t.x;return[n,o]}return null}function t5(t,e,i){var n=e.length,o=ta(i)?i>0&&i<1?i:0:i?.5:0;if(o>0&&n>2){for(var r=e[0].x,a=e[0].y,s=1;s<n-1;s++){var l=e[s-1],c=e[s],u=e[s+1],h=c.x-l.x,d=c.y-l.y,p=u.x-c.x,g=u.y-c.y,v=u.x-l.x,f=u.y-l.y,m=Math.sqrt(h*h+d*d),y=Math.sqrt(p*p+g*g),_=y/(y+m),x=c.x+v*o*_,S=c.y+f*o*_;x=Math.min(x,Math.max(u.x,c.x)),S=Math.min(S,Math.max(u.y,c.y)),x=Math.max(x,Math.min(u.x,c.x)),S=Math.max(S,Math.min(u.y,c.y)),v=x-c.x,f=S-c.y;var C=c.x-v*m/y,b=c.y-f*m/y;C=Math.min(C,Math.max(l.x,c.x)),b=Math.min(b,Math.max(l.y,c.y)),C=Math.max(C,Math.min(l.x,c.x)),b=Math.max(b,Math.min(l.y,c.y)),v=c.x-C,f=c.y-b,x=c.x+v*y/m,S=c.y+f*y/m,t.bezierCurveTo(r,a,C,b,c.x,c.y),r=x,a=S}var w=e[n-1];t.bezierCurveTo(r,a,w.x,w.y,w.x,w.y)}else for(var s=1;s<n;s++)t.lineTo(e[s].x,e[s].y)}function t6(t,e,i){var n=null!=i?i:0,o=[];if(t.length>1){if(t[0].x===t[1].x){var r=e.height;if(o.push({coordinates:[{x:t[0].x,y:0},{x:t[0].x,y:r}]}),t.length>2){o.push({coordinates:[{x:t[2].x,y:0},{x:t[2].x,y:r}]});for(var a=t[0].x-t[2].x,s=0;s<n;s++){var l=a*(s+1);o.push({coordinates:[{x:t[0].x+l,y:0},{x:t[0].x+l,y:r}]})}}}else{var c=e.width,u=t4(t[0],t[1]),h=u[0],d=u[1];if(o.push({coordinates:[{x:0,y:0*h+d},{x:c,y:c*h+d}]}),t.length>2){var p=t[2].y-h*t[2].x;o.push({coordinates:[{x:0,y:0*h+p},{x:c,y:c*h+p}]});for(var a=d-p,s=0;s<n;s++){var g=d+a*(s+1);o.push({coordinates:[{x:0,y:0*h+g},{x:c,y:c*h+g}]})}}}}return o}var t8={name:"simpleAnnotation",totalStep:2,styles:{line:{style:y.Dashed}},createPointFigures:function(t){var e,i,n=t.overlay,o=t.coordinates;ts(n.extendData)&&(i=to(n.extendData)?n.extendData(n):null!==(e=n.extendData)&&void 0!==e?e:"");var r=o[0].x,a=o[0].y-6,s=a-50,l=s-5;return[{type:"line",attrs:{coordinates:[{x:r,y:a},{x:r,y:s}]},ignoreEvent:!0},{type:"polygon",attrs:{coordinates:[{x:r,y:s},{x:r-4,y:l},{x:r+4,y:l}]},ignoreEvent:!0},{type:"text",attrs:{x:r,y:l,text:null!=i?i:"",align:"center",baseline:"bottom"},ignoreEvent:!0}]}},t9={name:"simpleTag",totalStep:2,styles:{line:{style:y.Dashed}},createPointFigures:function(t){var e=t.bounding,i=t.coordinates;return{type:"line",attrs:{coordinates:[{x:0,y:i[0].y},{x:e.width,y:i[0].y}]},ignoreEvent:!0}},createYAxisFigures:function(t){var e,i,n,o,r,a=t.overlay,s=t.coordinates,l=t.bounding,c=t.yAxis,u=t.precision;return null!==(e=null==c?void 0:c.isFromZero())&&void 0!==e&&e?(n="left",o=0):(n="right",o=l.width),ts(a.extendData)&&(r=to(a.extendData)?a.extendData(a):null!==(i=a.extendData)&&void 0!==i?i:""),!ts(r)&&ta(a.points[0].value)&&(r=tg(a.points[0].value,u.price)),{type:"text",attrs:{x:o,y:s[0].y,text:null!=r?r:"",align:n,baseline:"middle"}}}},t7={};[{name:"fibonacciLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i=t.coordinates,n=t.bounding,o=t.overlay,r=t.precision,a=t.thousandsSeparator,s=t.decimalFoldThreshold,l=t.yAxis,c=o.points;if(i.length>0){var u=null===(e=null==l?void 0:l.isInCandle())||void 0===e||e?r.price:r.excludePriceVolumeMax,h=[],d=[],p=n.width;if(i.length>1&&ta(c[0].value)&&ta(c[1].value)){var g=i[0].y-i[1].y,v=c[0].value-c[1].value;[1,.786,.618,.5,.382,.236,0].forEach(function(t){var e,n=i[1].y+g*t,o=tm(tf(((null!==(e=c[1].value)&&void 0!==e?e:0)+v*t).toFixed(u),a),s);h.push({coordinates:[{x:0,y:n},{x:p,y:n}]}),d.push({x:0,y:n,text:"".concat(o," (").concat((100*t).toFixed(1),"%)"),baseline:"bottom"})})}return[{type:"line",attrs:h},{type:"text",isCheckEvent:!1,attrs:d}]}return[]}},{name:"horizontalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding,n={x:0,y:e[0].y};return ts(e[1])&&e[0].x<e[1].x&&(n.x=i.width),[{type:"line",attrs:{coordinates:[e[0],n]}}]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].value=n.value)}},{name:"horizontalSegment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=[];return 2===e.length&&i.push({coordinates:e}),[{type:"line",attrs:i}]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].value=i.value,e[1].value=i.value},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].value=n.value)}},{name:"horizontalStraightLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:{coordinates:[{x:0,y:e[0].y},{x:i.width,y:e[0].y}]}}]}},{name:"parallelStraightLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:t6(t.coordinates,t.bounding)}]}},{name:"priceChannelLine",totalStep:4,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:t6(t.coordinates,t.bounding,1)}]}},{name:"priceLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i=t.coordinates,n=t.bounding,o=t.precision,r=t.overlay,a=t.thousandsSeparator,s=t.decimalFoldThreshold,l=t.yAxis,c=r.points[0].value,u=null===(e=null==l?void 0:l.isInCandle())||void 0===e||e?o.price:o.excludePriceVolumeMax;return[{type:"line",attrs:{coordinates:[i[0],{x:n.width,y:i[0].y}]}},{type:"text",ignoreEvent:!0,attrs:{x:i[0].x,y:i[0].y,text:tm(tf((void 0===c?0:c).toFixed(u),a),s),baseline:"bottom"}}]}},{name:"rayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){return[{type:"line",attrs:function(t,e){if(t.length>1){var i,n,o,r,a,s,l=void 0;return l=t[0].x===t[1].x&&t[0].y!==t[1].y?t[0].y<t[1].y?{x:t[0].x,y:e.height}:{x:t[0].x,y:0}:t[0].x>t[1].x?{x:0,y:(i=t[0],n=t[1],o={x:0,y:t[0].y},t3(t4(i,n),o))}:{x:e.width,y:(r=t[0],a=t[1],s={x:e.width,y:t[0].y},t3(t4(r,a),s))},{coordinates:[t[0],l]}}return[]}(t.coordinates,t.bounding)}]}},{name:"segment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates;return 2===e.length?[{type:"line",attrs:{coordinates:e}}]:[]}},{name:"straightLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e,i,n,o,r,a,s=t.coordinates,l=t.bounding;return 2===s.length?s[0].x===s[1].x?[{type:"line",attrs:{coordinates:[{x:s[0].x,y:0},{x:s[0].x,y:l.height}]}}]:[{type:"line",attrs:{coordinates:[{x:0,y:(e=s[0],i=s[1],n={x:0,y:s[0].y},t3(t4(e,i),n))},{x:l.width,y:(o=s[0],r=s[1],a={x:l.width,y:s[0].y},t3(t4(o,r),a))}]}}]:[]}},{name:"verticalRayLine",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;if(2===e.length){var n={x:e[0].x,y:0};return e[0].y<e[1].y&&(n.y=i.height),[{type:"line",attrs:{coordinates:[e[0],n]}}]}return[]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].timestamp=n.timestamp,i[0].dataIndex=n.dataIndex)}},{name:"verticalSegment",totalStep:3,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates;return 2===e.length?[{type:"line",attrs:{coordinates:e}}]:[]},performEventPressedMove:function(t){var e=t.points,i=t.performPoint;e[0].timestamp=i.timestamp,e[0].dataIndex=i.dataIndex,e[1].timestamp=i.timestamp,e[1].dataIndex=i.dataIndex},performEventMoveForDrawing:function(t){var e=t.currentStep,i=t.points,n=t.performPoint;2===e&&(i[0].timestamp=n.timestamp,i[0].dataIndex=n.dataIndex)}},{name:"verticalStraightLine",totalStep:2,needDefaultPointFigure:!0,needDefaultXAxisFigure:!0,needDefaultYAxisFigure:!0,createPointFigures:function(t){var e=t.coordinates,i=t.bounding;return[{type:"line",attrs:{coordinates:[{x:e[0].x,y:0},{x:e[0].x,y:i.height}]}}]}},t8,t9].forEach(function(t){t7[t.name]=tE.extend(t)});var et={CANDLE:"candle_pane",INDICATOR:"indicator_pane_",X_AXIS:"x_axis_pane"},ee=function(){function t(t){this._instances=new Map,this._progressInstanceInfo=null,this._pressedInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._hoverInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._clickInstanceInfo={paneId:"",instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},this._chartStore=t}return t.prototype._overrideInstance=function(t,e){var i=e.id,n=e.groupId,o=e.points,r=e.styles,a=e.lock,s=e.visible,l=e.zLevel,c=e.mode,u=e.modeSensitivity,h=e.extendData,d=e.onDrawStart,p=e.onDrawing,g=e.onDrawEnd,v=e.onClick,f=e.onDoubleClick,m=e.onRightClick,y=e.onPressedMoveStart,_=e.onPressedMoving,x=e.onPressedMoveEnd,S=e.onMouseEnter,C=e.onMouseLeave,b=e.onRemoved,w=e.onSelected,I=e.onDeselected,E=!1,T=!1;return tc(i)&&t.setId(i),tc(n)&&t.setGroupId(n),tn(o)&&t.setPoints(o)&&(E=!0),ts(r)&&t.setStyles(r)&&(E=!0),tl(a)&&t.setLock(a),tl(s)&&t.setVisible(s)&&(E=!0),ta(l)&&t.setZLevel(l)&&(E=!0,T=!0),ts(c)&&t.setMode(c),ta(u)&&t.setModeSensitivity(u),void 0!==h&&t.setExtendData(h)&&(E=!0),void 0!==d&&t.setOnDrawStartCallback(d),void 0!==p&&t.setOnDrawingCallback(p),void 0!==g&&t.setOnDrawEndCallback(g),void 0!==v&&t.setOnClickCallback(v),void 0!==f&&t.setOnDoubleClickCallback(f),void 0!==m&&t.setOnRightClickCallback(m),void 0!==y&&t.setOnPressedMoveStartCallback(y),void 0!==_&&t.setOnPressedMovingCallback(_),void 0!==x&&t.setOnPressedMoveEndCallback(x),void 0!==S&&t.setOnMouseEnterCallback(S),void 0!==C&&t.setOnMouseLeaveCallback(C),void 0!==b&&t.setOnRemovedCallback(b),void 0!==w&&t.setOnSelectedCallback(w),void 0!==I&&t.setOnDeselectedCallback(I),[E,T]},t.prototype.getInstanceById=function(t){var e,i;try{for(var n=V(this._instances),o=n.next();!o.done;o=n.next()){var r=o.value[1].find(function(e){return e.id===t});if(ts(r))return r}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return null!==this._progressInstanceInfo&&this._progressInstanceInfo.instance.id===t?this._progressInstanceInfo.instance:null},t.prototype._sort=function(t){var e;tc(t)?null===(e=this._instances.get(t))||void 0===e||e.sort(function(t,e){return t.zLevel-e.zLevel}):this._instances.forEach(function(t){t.sort(function(t,e){return t.zLevel-e.zLevel})})},t.prototype.addInstances=function(t,e,i){var n=this,o=t.map(function(t){var o,r,a,s,l=null!==(o=t.id)&&void 0!==o?o:tA("overlay_");if(null===n.getInstanceById(l)){var c,u=null!==(c=t7[t.name])&&void 0!==c?c:null;if(null!==u){var h=new u;h.setPaneId(e);var d=null!==(r=t.groupId)&&void 0!==r?r:l;return t.id=l,t.groupId=d,n._overrideInstance(h,t),h.isDrawing()?n._progressInstanceInfo={paneId:e,instance:h,appointPaneFlag:i}:(n._instances.has(e)||n._instances.set(e,[]),null===(a=n._instances.get(e))||void 0===a||a.push(h)),h.isStart()&&(null===(s=h.onDrawStart)||void 0===s||s.call(h,{overlay:h})),l}}return null});if(o.some(function(t){return null!==t})){this._sort();var r=this._chartStore.getChart();r.updatePane(1,e),r.updatePane(1,et.X_AXIS)}return o},t.prototype.getProgressInstanceInfo=function(){return this._progressInstanceInfo},t.prototype.progressInstanceComplete=function(){var t;if(null!==this._progressInstanceInfo){var e=this._progressInstanceInfo,i=e.instance,n=e.paneId;i.isDrawing()||(this._instances.has(n)||this._instances.set(n,[]),null===(t=this._instances.get(n))||void 0===t||t.push(i),this._sort(n),this._progressInstanceInfo=null)}},t.prototype.updateProgressInstanceInfo=function(t,e){null!==this._progressInstanceInfo&&(tl(e)&&e&&(this._progressInstanceInfo.appointPaneFlag=e),this._progressInstanceInfo.paneId=t,this._progressInstanceInfo.instance.setPaneId(t))},t.prototype.getInstances=function(t){var e;if(!tc(t)){var i=[];return this._instances.forEach(function(t){i=i.concat(t)}),i}return null!==(e=this._instances.get(t))&&void 0!==e?e:[]},t.prototype.override=function(t){var e=this,i=t.id,n=t.groupId,o=t.name,r=!1,a=!1,s=function(i){var n=e._overrideInstance(i,t);n[0]&&(r=!0),n[1]&&(a=!0)};if(tc(i)){var l=this.getInstanceById(i);null!==l&&s(l)}else{var c=tc(o),u=tc(n);if(this._instances.forEach(function(t){t.forEach(function(t){(c&&t.name===o||u&&t.groupId===n||!c&&!u)&&s(t)})}),null!==this._progressInstanceInfo){var h=this._progressInstanceInfo.instance;(c&&h.name===o||u&&h.groupId===n||!c&&!u)&&s(h)}}a&&this._sort(),r&&this._chartStore.getChart().updatePane(1)},t.prototype.removeInstance=function(t){var e,i,n,o=function(t,e){if(tc(t.id)){if(e.id!==t.id)return!1}else if(tc(t.groupId)){if(e.groupId!==t.groupId)return!1}else if(tc(t.name)&&e.name!==t.name)return!1;return!0},r=[],a=ts(t);if(null!==this._progressInstanceInfo){var s=this._progressInstanceInfo.instance;(!a||a&&o(t,s))&&(r.push(this._progressInstanceInfo.paneId),null===(n=s.onRemoved)||void 0===n||n.call(s,{overlay:s}),this._progressInstanceInfo=null)}if(a){var l=new Map,c=function(e){var i=e[1].filter(function(i){var n;return!o(t,i)||(r.includes(e[0])||r.push(e[0]),null===(n=i.onRemoved)||void 0===n||n.call(i,{overlay:i}),!1)});i.length>0&&l.set(e[0],i)};try{for(var u=V(this._instances),h=u.next();!h.done;h=u.next()){var d=h.value;c(d)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(i=u.return)&&i.call(u)}finally{if(e)throw e.error}}this._instances=l}else this._instances.forEach(function(t,e){r.push(e),t.forEach(function(t){var e;null===(e=t.onRemoved)||void 0===e||e.call(t,{overlay:t})})}),this._instances.clear();if(r.length>0){var p=this._chartStore.getChart();r.forEach(function(t){p.updatePane(1,t)}),p.updatePane(1,et.X_AXIS)}},t.prototype.setPressedInstanceInfo=function(t){this._pressedInstanceInfo=t},t.prototype.getPressedInstanceInfo=function(){return this._pressedInstanceInfo},t.prototype.updatePointPosition=function(t,e){if(t>0){var i=this._chartStore.getDataList();this._instances.forEach(function(n){n.forEach(function(n){n.points.forEach(function(n){if(!ts(n.timestamp)&&ts(n.dataIndex)){e===A.Forward&&(n.dataIndex=n.dataIndex+t);var o=i[n.dataIndex];n.timestamp=null==o?void 0:o.timestamp}})})})}},t.prototype.setHoverInstanceInfo=function(t,e){var i,n,o=this._hoverInstanceInfo,r=o.instance,a=o.figureType,s=o.figureKey,l=o.figureIndex;if(((null==r?void 0:r.id)!==(null===(i=t.instance)||void 0===i?void 0:i.id)||a!==t.figureType||l!==t.figureIndex)&&(this._hoverInstanceInfo=t,(null==r?void 0:r.id)!==(null===(n=t.instance)||void 0===n?void 0:n.id))){var c=!1,u=!1;null!==r&&(u=!0,to(r.onMouseLeave)&&(r.onMouseLeave(B({overlay:r,figureKey:s,figureIndex:l},e)),c=!0)),null!==t.instance&&(u=!0,t.instance.setZLevel(tI),to(t.instance.onMouseEnter)&&(t.instance.onMouseEnter(B({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e)),c=!0)),u&&this._sort(),c||this._chartStore.getChart().updatePane(1)}},t.prototype.getHoverInstanceInfo=function(){return this._hoverInstanceInfo},t.prototype.setClickInstanceInfo=function(t,e){var i,n,o,r,a,s,l,c,u,h=this._clickInstanceInfo,d=h.paneId,p=h.instance,g=h.figureType,v=h.figureKey,f=h.figureIndex;if(null!==(n=null===(i=t.instance)||void 0===i?void 0:i.isDrawing())&&void 0!==n&&n||null===(r=null===(o=t.instance)||void 0===o?void 0:o.onClick)||void 0===r||r.call(o,B({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e)),((null==p?void 0:p.id)!==(null===(a=t.instance)||void 0===a?void 0:a.id)||g!==t.figureType||f!==t.figureIndex)&&(this._clickInstanceInfo=t,(null==p?void 0:p.id)!==(null===(s=t.instance)||void 0===s?void 0:s.id))){null===(l=null==p?void 0:p.onDeselected)||void 0===l||l.call(p,B({overlay:p,figureKey:v,figureIndex:f},e)),null===(u=null===(c=t.instance)||void 0===c?void 0:c.onSelected)||void 0===u||u.call(c,B({overlay:t.instance,figureKey:t.figureKey,figureIndex:t.figureIndex},e));var m=this._chartStore.getChart();m.updatePane(1,t.paneId),d!==t.paneId&&m.updatePane(1,d),m.updatePane(1,et.X_AXIS)}},t.prototype.getClickInstanceInfo=function(){return this._clickInstanceInfo},t.prototype.isEmpty=function(){return 0===this._instances.size&&null===this._progressInstanceInfo},t.prototype.isDrawing=function(){var t,e;return null!==this._progressInstanceInfo&&null!==(e=null===(t=this._progressInstanceInfo)||void 0===t?void 0:t.instance.isDrawing())&&void 0!==e&&e},t}(),ei=function(){function t(){this._actions=new Map}return t.prototype.execute=function(t,e){var i;null===(i=this._actions.get(t))||void 0===i||i.execute(e)},t.prototype.subscribe=function(t,e){var i;this._actions.has(t)||this._actions.set(t,new tS),null===(i=this._actions.get(t))||void 0===i||i.subscribe(e)},t.prototype.unsubscribe=function(t,e){var i=this._actions.get(t);ts(i)&&(i.unsubscribe(e),i.isEmpty()&&this._actions.delete(t))},t.prototype.has=function(t){var e=this._actions.get(t);return ts(e)&&!e.isEmpty()},t}(),en={light:{grid:{horizontal:{color:"#EDEDED"},vertical:{color:"#EDEDED"}},candle:{priceMark:{high:{color:"#76808F"},low:{color:"#76808F"}},tooltip:{rect:{color:"#FEFEFE",borderColor:"#F2F3F5"},text:{color:"#76808F"}}},indicator:{tooltip:{text:{color:"#76808F"}}},xAxis:{axisLine:{color:"#DDDDDD"},tickText:{color:"#76808F"},tickLine:{color:"#DDDDDD"}},yAxis:{axisLine:{color:"#DDDDDD"},tickText:{color:"#76808F"},tickLine:{color:"#DDDDDD"}},separator:{color:"#DDDDDD"},crosshair:{horizontal:{line:{color:"#76808F"},text:{borderColor:"#686D76",backgroundColor:"#686D76"}},vertical:{line:{color:"#76808F"},text:{borderColor:"#686D76",backgroundColor:"#686D76"}}}},dark:{grid:{horizontal:{color:"#292929"},vertical:{color:"#292929"}},candle:{priceMark:{high:{color:"#929AA5"},low:{color:"#929AA5"}},tooltip:{rect:{color:"rgba(10, 10, 10, .6)",borderColor:"rgba(10, 10, 10, .6)"},text:{color:"#929AA5"}}},indicator:{tooltip:{text:{color:"#929AA5"}}},xAxis:{axisLine:{color:"#333333"},tickText:{color:"#929AA5"},tickLine:{color:"#333333"}},yAxis:{axisLine:{color:"#333333"},tickText:{color:"#929AA5"},tickLine:{color:"#333333"}},separator:{color:"#333333"},crosshair:{horizontal:{line:{color:"#929AA5"},text:{borderColor:"#373a40",backgroundColor:"#373a40"}},vertical:{line:{color:"#929AA5"},text:{borderColor:"#373a40",backgroundColor:"#373a40"}}}}};function eo(t){var e;return null!==(e=en[t])&&void 0!==e?e:null}var er=function(){function t(t,e){var i,n,o;this._styles={grid:function(){function t(){return{show:!0,size:1,color:"#EDEDED",style:y.Dashed,dashedValue:[2,2]}}return{show:!0,horizontal:t(),vertical:t()}}(),candle:(i={show:!0,color:U,textOffset:5,textSize:10,textFamily:"Helvetica Neue",textWeight:"normal"},{type:w.CandleSolid,bar:{upColor:H,downColor:X,noChangeColor:j,upBorderColor:H,downBorderColor:X,noChangeBorderColor:j,upWickColor:H,downWickColor:X,noChangeWickColor:j},area:{lineSize:2,lineColor:Z,smooth:!1,value:"close",backgroundColor:[{offset:0,color:$(.01)},{offset:1,color:$(.2)}],point:{show:!0,color:Z,radius:4,rippleColor:$(.3),rippleRadius:8,animation:!0,animationDuration:1e3}},priceMark:{show:!0,high:B({},i),low:B({},i),last:{show:!0,upColor:H,downColor:X,noChangeColor:j,line:{show:!0,style:y.Dashed,dashedValue:[4,4],size:1},text:{show:!0,style:_.Fill,size:12,paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderColor:"transparent",borderStyle:y.Solid,borderSize:0,borderDashedValue:[2,2],color:K,family:"Helvetica Neue",weight:"normal",borderRadius:2}}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:x.Always,showType:S.Standard,custom:[{title:"time",value:"{time}"},{title:"open",value:"{open}"},{title:"high",value:"{high}"},{title:"low",value:"{low}"},{title:"close",value:"{close}"},{title:"volume",value:"{volume}"}],defaultValue:"n/a",rect:{position:b.Fixed,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,offsetLeft:4,offsetTop:4,offsetRight:4,offsetBottom:4,borderRadius:4,borderSize:1,borderColor:"#F2F3F5",color:"#FEFEFE"},text:{size:12,family:"Helvetica Neue",weight:"normal",color:U,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},icons:[]}}),indicator:(n=["#FF9600","#935EBD",Z,"#E11D74","#01C5C4"].map(function(t){return{style:y.Solid,smooth:!1,size:1,dashedValue:[2,2],color:t}}),{ohlc:{upColor:G,downColor:Y,noChangeColor:j},bars:[{style:_.Fill,borderStyle:y.Solid,borderSize:1,borderDashedValue:[2,2],upColor:G,downColor:Y,noChangeColor:j}],lines:n,circles:[{style:_.Fill,borderStyle:y.Solid,borderSize:1,borderDashedValue:[2,2],upColor:G,downColor:Y,noChangeColor:j}],lastValueMark:{show:!1,text:{show:!1,style:_.Fill,color:K,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:y.Solid,borderColor:"transparent",borderSize:0,borderDashedValue:[2,2],paddingLeft:4,paddingTop:4,paddingRight:4,paddingBottom:4,borderRadius:2}},tooltip:{offsetLeft:4,offsetTop:6,offsetRight:4,offsetBottom:6,showRule:x.Always,showType:S.Standard,showName:!0,showParams:!0,defaultValue:"n/a",text:{size:12,family:"Helvetica Neue",weight:"normal",color:U,marginLeft:8,marginTop:4,marginRight:8,marginBottom:4},icons:[]}}),xAxis:Q(),yAxis:((o=Q()).type=E.Normal,o.position=I.Right,o.inside=!1,o.reverse=!1,o),separator:{size:1,color:q,fill:!0,activeBackgroundColor:$(.08)},crosshair:function(){function t(){return{show:!0,line:{show:!0,style:y.Dashed,dashedValue:[4,2],size:1,color:U},text:{show:!0,style:_.Fill,color:K,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:y.Solid,borderDashedValue:[2,2],borderSize:1,borderColor:U,borderRadius:2,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:U}}}return{show:!0,horizontal:t(),vertical:t()}}(),overlay:function(){var t=$(.35),e=$(.25);function i(){return{style:_.Fill,color:K,size:12,family:"Helvetica Neue",weight:"normal",borderStyle:y.Solid,borderDashedValue:[2,2],borderSize:1,borderRadius:2,borderColor:Z,paddingLeft:4,paddingRight:4,paddingTop:4,paddingBottom:4,backgroundColor:Z}}return{point:{color:Z,borderColor:t,borderSize:1,radius:5,activeColor:Z,activeBorderColor:t,activeBorderSize:3,activeRadius:5},line:{style:y.Solid,smooth:!1,color:Z,size:1,dashedValue:[2,2]},rect:{style:_.Fill,color:e,borderColor:Z,borderSize:1,borderRadius:0,borderStyle:y.Solid,borderDashedValue:[2,2]},polygon:{style:_.Fill,color:Z,borderColor:Z,borderSize:1,borderStyle:y.Solid,borderDashedValue:[2,2]},circle:{style:_.Fill,color:e,borderColor:Z,borderSize:1,borderStyle:y.Solid,borderDashedValue:[2,2]},arc:{style:y.Solid,color:Z,size:1,dashedValue:[2,2]},text:i(),rectText:i()}}()},this._customApi={formatDate:tp,formatBigNumber:tv},this._locale="en-US",this._precision={price:2,volume:0},this._thousandsSeparator=",",this._decimalFoldThreshold=3,this._dataList=[],this._loadMoreCallback=null,this._loadDataCallback=null,this._loading=!0,this._forwardMore=!0,this._backwardMore=!0,this._timeScaleStore=new tW(this),this._indicatorStore=new tJ(this),this._overlayStore=new ee(this),this._tooltipStore=new t0(this),this._actionStore=new ei,this._visibleDataList=[],this._chart=t,this.setOptions(e)}return t.prototype.adjustVisibleDataList=function(){this._visibleDataList=[];for(var t=this._timeScaleStore.getVisibleRange(),e=t.realFrom,i=t.realTo,n=e;n<i;n++){var o=this._dataList[n],r=this._timeScaleStore.dataIndexToCoordinate(n);this._visibleDataList.push({dataIndex:n,x:r,data:o})}},t.prototype.setOptions=function(t){var e,i,n,o;if(ts(t)){var r=t.locale,a=t.timezone,s=t.styles,l=t.customApi,c=t.thousandsSeparator,u=t.decimalFoldThreshold;if(tc(r)&&(this._locale=r),tc(a)&&this._timeScaleStore.setTimezone(a),ts(s)){var h=null;h=tc(s)?eo(s):s,te(this._styles,h),tn(null===(i=null===(e=null==h?void 0:h.candle)||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.custom)&&(this._styles.candle.tooltip.custom=null===(o=null===(n=null==h?void 0:h.candle)||void 0===n?void 0:n.tooltip)||void 0===o?void 0:o.custom)}ts(l)&&te(this._customApi,l),tc(c)&&(this._thousandsSeparator=c),ta(u)&&u>0&&(this._decimalFoldThreshold=u)}return this},t.prototype.getStyles=function(){return this._styles},t.prototype.getLocale=function(){return this._locale},t.prototype.getCustomApi=function(){return this._customApi},t.prototype.getThousandsSeparator=function(){return this._thousandsSeparator},t.prototype.getDecimalFoldThreshold=function(){return this._decimalFoldThreshold},t.prototype.getPrecision=function(){return this._precision},t.prototype.setPrecision=function(t){return this._precision=t,this._indicatorStore.synchronizeSeriesPrecision(),this},t.prototype.getDataList=function(){return this._dataList},t.prototype.getVisibleFirstData=function(){var t,e=this._timeScaleStore.getVisibleRange().from;return null!==(t=this._dataList[e])&&void 0!==t?t:null},t.prototype.getVisibleDataList=function(){return this._visibleDataList},t.prototype.addData=function(t,e,i){return N(this,void 0,void 0,function(){var n,o,r,a,s,l,c;return O(this,function(u){switch(u.label){case 0:if(n=!1,o=!1,r=0,tn(t)){switch(r=t.length,e){case A.Init:this.clear(),this._dataList=t,this._forwardMore=null==i||i,this._timeScaleStore.resetOffsetRightDistance(),o=!0;break;case A.Backward:this._dataList=this._dataList.concat(t),this._backwardMore=null!=i&&i,o=r>0;break;case A.Forward:this._dataList=t.concat(this._dataList),this._forwardMore=null!=i&&i,o=r>0}this._loading=!1,n=!0}else a=this._dataList.length,(s=t.timestamp)>(l=td(this._dataList[a-1],"timestamp",0))?(this._dataList.push(t),(c=this._timeScaleStore.getLastBarRightSideDiffBarCount())<0&&this._timeScaleStore.setLastBarRightSideDiffBarCount(--c),r=1,n=!0,o=!0):s===l&&(this._dataList[a-1]=t,n=!0,o=!0);if(!n)return[3,5];u.label=1;case 1:if(u.trys.push([1,4,,5]),this._overlayStore.updatePointPosition(r,e),!o)return[3,3];return this._timeScaleStore.adjustVisibleRange(),this._tooltipStore.recalculateCrosshair(!0),[4,this._indicatorStore.calcInstance()];case 2:u.sent(),this._chart.adjustPaneViewport(!1,!0,!0,!0),u.label=3;case 3:return this._actionStore.execute(P.OnDataReady),[3,5];case 4:return u.sent(),[3,5];case 5:return[2]}})})},t.prototype.setLoadMoreCallback=function(t){this._loadMoreCallback=t},t.prototype.executeLoadMoreCallback=function(t){this._forwardMore&&!this._loading&&ts(this._loadMoreCallback)&&(this._loading=!0,this._loadMoreCallback(t))},t.prototype.setLoadDataCallback=function(t){this._loadDataCallback=t},t.prototype.executeLoadDataCallback=function(t){var e=this;!this._loading&&ts(this._loadDataCallback)&&(this._forwardMore&&t.type===A.Forward||this._backwardMore&&t.type===A.Backward)&&(this._loading=!0,this._loadDataCallback(B(B({},t),{callback:function(i,n){e.addData(i,t.type,n).then(function(){}).catch(function(){})}})))},t.prototype.clear=function(){this._forwardMore=!0,this._backwardMore=!0,this._loading=!0,this._dataList=[],this._visibleDataList=[],this._timeScaleStore.clear(),this._tooltipStore.clear()},t.prototype.getTimeScaleStore=function(){return this._timeScaleStore},t.prototype.getIndicatorStore=function(){return this._indicatorStore},t.prototype.getOverlayStore=function(){return this._overlayStore},t.prototype.getTooltipStore=function(){return this._tooltipStore},t.prototype.getActionStore=function(){return this._actionStore},t.prototype.getChart=function(){return this._chart},t}(),ea={MAIN:"main",X_AXIS:"xAxis",Y_AXIS:"yAxis",SEPARATOR:"separator"},es=function(){function t(t,e){var i=this;this._supportedDevicePixelContentBox=!1,this._width=0,this._height=0,this._pixelWidth=0,this._pixelHeight=0,this._nextPixelWidth=0,this._nextPixelHeight=0,this._requestAnimationId=-1,this._mediaQueryListener=function(){var t=ty(i._element);i._nextPixelWidth=Math.round(i._element.clientWidth*t),i._nextPixelHeight=Math.round(i._element.clientHeight*t),i._resetPixelRatio()},this._listener=e,this._element=tF("canvas",t),this._ctx=this._element.getContext("2d",{willReadFrequently:!0}),(function(){return N(this,void 0,void 0,function(){return O(this,function(t){switch(t.label){case 0:return[4,new Promise(function(t){var e=new ResizeObserver(function(i){t(i.every(function(t){return"devicePixelContentBoxSize"in t})),e.disconnect()});e.observe(document.body,{box:"device-pixel-content-box"})}).catch(function(){return!1})];case 1:return[2,t.sent()]}})})})().then(function(t){i._supportedDevicePixelContentBox=t,t?(i._resizeObserver=new ResizeObserver(function(t){var e,n=t.find(function(t){return t.target===i._element}),o=null===(e=null==n?void 0:n.devicePixelContentBoxSize)||void 0===e?void 0:e[0];ts(o)&&(i._nextPixelWidth=o.inlineSize,i._nextPixelHeight=o.blockSize,(i._pixelWidth!==i._nextPixelWidth||i._pixelHeight!==i._nextPixelHeight)&&i._resetPixelRatio())}),i._resizeObserver.observe(i._element,{box:"device-pixel-content-box"})):(i._mediaQueryList=window.matchMedia("(resolution: ".concat(ty(i._element),"dppx)")),i._mediaQueryList.addListener(i._mediaQueryListener))}).catch(function(t){return!1})}return t.prototype._resetPixelRatio=function(){var t=this;this._executeListener(function(){var e=t._element.clientWidth,i=t._element.clientHeight,n=t._nextPixelWidth/e,o=t._nextPixelHeight/i;t._width=e,t._height=i,t._pixelWidth=t._nextPixelWidth,t._pixelHeight=t._nextPixelHeight,t._element.width=t._nextPixelWidth,t._element.height=t._nextPixelHeight,t._ctx.scale(n,o)})},t.prototype._executeListener=function(t){var e=this;-1===this._requestAnimationId&&(this._requestAnimationId=tT(function(){e._ctx.clearRect(0,0,e._width,e._height),null==t||t(),e._listener(),e._requestAnimationId=-1}))},t.prototype.update=function(t,e){if(this._width!==t||this._height!==e){if(this._element.style.width="".concat(t,"px"),this._element.style.height="".concat(e,"px"),!this._supportedDevicePixelContentBox){var i=ty(this._element);this._nextPixelWidth=Math.round(t*i),this._nextPixelHeight=Math.round(e*i),this._resetPixelRatio()}}else this._executeListener()},t.prototype.getElement=function(){return this._element},t.prototype.getContext=function(){return this._ctx},t.prototype.destroy=function(){var t,e;null===(t=this._resizeObserver)||void 0===t||t.unobserve(this._element),null===(e=this._mediaQueryList)||void 0===e||e.removeListener(this._mediaQueryListener)},t}();function el(t){var e={width:0,height:0,left:0,right:0,top:0,bottom:0};return ts(t)&&te(e,t),e}var ec=function(t){function e(e,i){var n=t.call(this)||this;return n._bounding=el(),n._pane=i,n.init(e),n}return R(e,t),e.prototype.init=function(t){this._rootContainer=t,this._container=this.createContainer(),t.appendChild(this._container)},e.prototype.setBounding=function(t){return te(this._bounding,t),this},e.prototype.getContainer=function(){return this._container},e.prototype.getBounding=function(){return this._bounding},e.prototype.getPane=function(){return this._pane},e.prototype.update=function(t){this.updateImp(this._container,this._bounding,null!=t?t:3)},e.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},e}(t1),eu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.init=function(e){var i=this;t.prototype.init.call(this,e),this._mainCanvas=new es({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){i.updateMain(i._mainCanvas.getContext())}),this._overlayCanvas=new es({position:"absolute",top:"0",left:"0",zIndex:"2",boxSizing:"border-box"},function(){i.updateOverlay(i._overlayCanvas.getContext())});var n=this.getContainer();n.appendChild(this._mainCanvas.getElement()),n.appendChild(this._overlayCanvas.getElement())},e.prototype.createContainer=function(){return tF("div",{margin:"0",padding:"0",position:"absolute",top:"0",overflow:"hidden",boxSizing:"border-box",zIndex:"1"})},e.prototype.updateImp=function(t,e,i){var n=e.width,o=e.height,r=e.left;t.style.left="".concat(r,"px");var a=i,s=t.clientWidth,l=t.clientHeight;switch((n!==s||o!==l)&&(t.style.width="".concat(n,"px"),t.style.height="".concat(o,"px"),a=3),a){case 0:this._mainCanvas.update(n,o);break;case 1:this._overlayCanvas.update(n,o);break;case 3:case 4:this._mainCanvas.update(n,o),this._overlayCanvas.update(n,o)}},e.prototype.destroy=function(){this._mainCanvas.destroy(),this._overlayCanvas.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,o=tF("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),r=o.getContext("2d"),a=ty(o);return o.width=i*a,o.height=n*a,r.scale(a,a),r.drawImage(this._mainCanvas.getElement(),0,0,i,n),t&&r.drawImage(this._overlayCanvas.getElement(),0,0,i,n),o},e}(ec);function eh(t){return"transparent"===t||"none"===t||/^[rR][gG][Bb][Aa]\(([\s]*(2[0-4][0-9]|25[0-5]|[01]?[0-9][0-9]?)[\s]*,){3}[\s]*0[\s]*\)$/.test(t)||/^[hH][Ss][Ll][Aa]\(([\s]*(360｜3[0-5][0-9]|[012]?[0-9][0-9]?)[\s]*,)([\s]*((100|[0-9][0-9]?)%|0)[\s]*,){2}([\s]*0[\s]*)\)$/.test(t)}function ed(t,e,i){var n,o=[];o=o.concat(e);var r=i.style,a=void 0===r?_.Fill:r,s=i.color,l=void 0===s?"transparent":s,c=i.borderSize,u=void 0===c?1:c,h=i.borderColor,d=void 0===h?"transparent":h,p=i.borderStyle,g=void 0===p?y.Solid:p,v=i.borderRadius,f=void 0===v?0:v,m=i.borderDashedValue,x=null!==(n=t.roundRect)&&void 0!==n?n:t.rect,S=(a===_.Fill||i.style===_.StrokeFill)&&(!tc(l)||!eh(l));if(S&&(t.fillStyle=l,o.forEach(function(e){var i=e.x,n=e.y,o=e.width,r=e.height;t.beginPath(),x.call(t,i,n,o,r,f),t.closePath(),t.fill()})),(a===_.Stroke||i.style===_.StrokeFill)&&u>0&&!eh(d)){t.strokeStyle=d,t.fillStyle=d,t.lineWidth=u,g===y.Dashed?t.setLineDash(void 0===m?[2,2]:m):t.setLineDash([]);var C=u%2==1?.5:0,b=Math.round(2*C);o.forEach(function(e){var i=e.x,n=e.y,o=e.width,r=e.height;o>2*u&&r>2*u?(t.beginPath(),x.call(t,i+C,n+C,o-b,r-b,f),t.closePath(),t.stroke()):S||t.fillRect(i,n,o,r)})}}function ep(t,e){var i,n,o=e.size,r=void 0===o?12:o,a=e.paddingLeft,s=e.paddingTop,l=e.paddingRight,c=e.paddingBottom,u=e.weight,h=e.family,d=t.x,p=t.y,g=t.text,v=t.align,f=t.baseline,m=t.width,y=t.height,_=null!=m?m:(void 0===a?0:a)+tx(g,r,void 0===u?"normal":u,h)+(void 0===l?0:l),x=null!=y?y:(void 0===s?0:s)+r+(void 0===c?0:c);switch(void 0===v?"left":v){case"left":case"start":i=d;break;case"right":case"end":i=d-_;break;default:i=d-_/2}switch(void 0===f?"top":f){case"top":case"hanging":n=p;break;case"bottom":case"ideographic":case"alphabetic":n=p-x;break;default:n=p-x/2}return{x:i,y:n,width:_,height:x}}var eg={name:"text",checkEventOn:function(t,e,i){var n=[];n=n.concat(e);for(var o=0;o<n.length;o++){var r=ep(n[o],i),a=r.x,s=r.y,l=r.width,c=r.height;if(t.x>=a&&t.x<=a+l&&t.y>=s&&t.y<=s+c)return!0}return!1},draw:function(t,e,i){var n,o,r,a,s,l,c,u,h,d,p,g;n=(n=[]).concat(e),o=i.color,r=i.size,a=i.family,s=i.weight,c=void 0===(l=i.paddingLeft)?0:l,h=void 0===(u=i.paddingTop)?0:u,p=void 0===(d=i.paddingRight)?0:d,ed(t,g=n.map(function(t){return ep(t,i)}),B(B({},i),{color:i.backgroundColor})),t.textAlign="left",t.textBaseline="top",t.font=t_(void 0===r?12:r,s,a),t.fillStyle=void 0===o?"currentColor":o,n.forEach(function(e,i){var n=g[i];t.fillText(e.text,n.x+c,n.y+h,n.width-c-p)})}},ev={};[{name:"circle",checkEventOn:function(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n],r=o.x,a=o.y,s=o.r,l=t.x-r,c=t.y-a;if(!(l*l+c*c>s*s))return!0}return!1},draw:function(t,e,i){var n,o,r,a,s,l,c,u,h,d,p,g,v;n=(n=[]).concat(e),r=void 0===(o=i.style)?_.Fill:o,s=void 0===(a=i.color)?"currentColor":a,c=void 0===(l=i.borderSize)?1:l,h=void 0===(u=i.borderColor)?"currentColor":u,p=void 0===(d=i.borderStyle)?y.Solid:d,g=i.borderDashedValue,(v=(r===_.Fill||i.style===_.StrokeFill)&&(!tc(s)||!eh(s)))&&(t.fillStyle=s,n.forEach(function(e){var i=e.x,n=e.y,o=e.r;t.beginPath(),t.arc(i,n,o,0,2*Math.PI),t.closePath(),t.fill()})),(r===_.Stroke||i.style===_.StrokeFill)&&c>0&&!eh(h)&&(t.strokeStyle=h,t.lineWidth=c,p===y.Dashed?t.setLineDash(void 0===g?[2,2]:g):t.setLineDash([]),n.forEach(function(e){var i=e.x,n=e.y,o=e.r;(!v||o>c)&&(t.beginPath(),t.arc(i,n,o,0,2*Math.PI),t.closePath(),t.stroke())}))}},{name:"line",checkEventOn:function(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n].coordinates;if(o.length>1)for(var r=1;r<o.length;r++){var a=o[r-1],s=o[r];if(a.x===s.x){if(Math.abs(a.y-t.y)+Math.abs(s.y-t.y)-Math.abs(a.y-s.y)<4&&2>Math.abs(t.x-a.x))return!0}else{var l=t4(a,s),c=Math.abs(t3(l,t)-t.y);if(Math.abs(a.x-t.x)+Math.abs(s.x-t.x)-Math.abs(a.x-s.x)<4&&c*c/(l[0]*l[0]+1)<4)return!0}}}return!1},draw:function(t,e,i){var n,o,r,a,s,l,c,u,h,d;n=(n=[]).concat(e),r=void 0===(o=i.style)?y.Solid:o,s=void 0!==(a=i.smooth)&&a,c=void 0===(l=i.size)?1:l,u=i.color,h=i.dashedValue,t.lineWidth=c,t.strokeStyle=void 0===u?"currentColor":u,r===y.Dashed?t.setLineDash(void 0===h?[2,2]:h):t.setLineDash([]),d=c%2==1?.5:0,n.forEach(function(e){var i=e.coordinates;i.length>1&&(2===i.length&&(i[0].x===i[1].x||i[0].y===i[1].y)?(t.beginPath(),i[0].x===i[1].x?(t.moveTo(i[0].x+d,i[0].y),t.lineTo(i[1].x+d,i[1].y)):(t.moveTo(i[0].x,i[0].y+d),t.lineTo(i[1].x,i[1].y+d)),t.stroke(),t.closePath()):(t.save(),c%2==1&&t.translate(.5,.5),t.beginPath(),t.moveTo(i[0].x,i[0].y),t5(t,i,s),t.stroke(),t.closePath(),t.restore()))})}},{name:"polygon",checkEventOn:function(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){for(var o=!1,r=i[n].coordinates,a=0,s=r.length-1;a<r.length;s=a++)r[a].y>t.y!=r[s].y>t.y&&t.x<(r[s].x-r[a].x)*(t.y-r[a].y)/(r[s].y-r[a].y)+r[a].x&&(o=!o);if(o)return!0}return!1},draw:function(t,e,i){var n,o,r,a,s,l,c,u,h,d,p,g;n=(n=[]).concat(e),r=void 0===(o=i.style)?_.Fill:o,s=void 0===(a=i.color)?"currentColor":a,c=void 0===(l=i.borderSize)?1:l,h=void 0===(u=i.borderColor)?"currentColor":u,p=void 0===(d=i.borderStyle)?y.Solid:d,g=i.borderDashedValue,r!==_.Fill&&i.style!==_.StrokeFill||tc(s)&&eh(s)||(t.fillStyle=s,n.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),t.fill()})),(r===_.Stroke||i.style===_.StrokeFill)&&c>0&&!eh(h)&&(t.strokeStyle=h,t.lineWidth=c,p===y.Dashed?t.setLineDash(void 0===g?[2,2]:g):t.setLineDash([]),n.forEach(function(e){var i=e.coordinates;t.beginPath(),t.moveTo(i[0].x,i[0].y);for(var n=1;n<i.length;n++)t.lineTo(i[n].x,i[n].y);t.closePath(),t.stroke()}))}},{name:"rect",checkEventOn:function(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n],r=o.x,a=o.width;a<4&&(r-=2,a=4);var s=o.y,l=o.height;if(l<4&&(s-=2,l=4),t.x>=r&&t.x<=r+a&&t.y>=s&&t.y<=s+l)return!0}return!1},draw:function(t,e,i){ed(t,e,i)}},eg,eg,{name:"arc",checkEventOn:function(t,e){var i=[];i=i.concat(e);for(var n=0;n<i.length;n++){var o=i[n];if(2>Math.abs(function(t,e){var i=t.x-e.x,n=t.y-e.y;return Math.sqrt(i*i+n*n)}(t,o)-o.r)){var r=o.r,a=o.startAngle,s=o.endAngle,l=r*Math.cos(a)+o.x,c=r*Math.sin(a)+o.y,u=r*Math.cos(s)+o.x,h=r*Math.sin(s)+o.y;if(t.x<=Math.max(l,u)+2&&t.x>=Math.min(l,u)-2&&t.y<=Math.max(c,h)+2&&t.y>=Math.min(c,h)-2)return!0}}return!1},draw:function(t,e,i){var n,o,r,a,s,l;n=(n=[]).concat(e),r=void 0===(o=i.style)?y.Solid:o,a=i.size,s=i.color,l=i.dashedValue,t.lineWidth=void 0===a?1:a,t.strokeStyle=void 0===s?"currentColor":s,r===y.Dashed?t.setLineDash(void 0===l?[2,2]:l):t.setLineDash([]),n.forEach(function(e){var i=e.x,n=e.y,o=e.r,r=e.startAngle,a=e.endAngle;t.beginPath(),t.arc(i,n,o,r,a),t.stroke(),t.closePath()})}}].forEach(function(t){ev[t.name]=t2.extend(t)});var ef=function(t){function e(e){var i=t.call(this)||this;return i._widget=e,i}return R(e,t),e.prototype.getWidget=function(){return this._widget},e.prototype.createFigure=function(t,e){var i,n=null!==(i=ev[t.name])&&void 0!==i?i:null;if(null!==n){var o=new n(t);if(ts(e)){for(var r in e)e.hasOwnProperty(r)&&o.registerEvent(r,e[r]);this.addChild(o)}return o}return null},e.prototype.draw=function(t){this.clear(),this.drawImp(t)},e}(t1),em=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e,i,n=this.getWidget(),o=this.getWidget().getPane(),r=o.getChart(),a=n.getBounding(),s=r.getStyles().grid;if(s.show){t.save(),t.globalCompositeOperation="destination-over";var l=s.horizontal;if(l.show){var c=o.getAxisComponent().getTicks().map(function(t){return{coordinates:[{x:0,y:t.coord},{x:a.width,y:t.coord}]}});null===(e=this.createFigure({name:"line",attrs:c,styles:l}))||void 0===e||e.draw(t)}var u=s.vertical;if(u.show){var c=r.getXAxisPane().getAxisComponent().getTicks().map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:a.height}]}});null===(i=this.createFigure({name:"line",attrs:c,styles:u}))||void 0===i||i.draw(t)}t.restore()}},e}(ef),ey=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.eachChildren=function(t){var e=this.getWidget().getPane().getChart().getChartStore(),i=e.getVisibleDataList(),n=e.getTimeScaleStore().getBarSpace();i.forEach(function(e,i){t(e,n,i)})},e}(ef),e_=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundCandleBarClickEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getActionStore().execute(P.OnCandleBarClick,t),!1}},e}return R(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget().getPane(),n=i.getId()===et.CANDLE,o=i.getChart().getChartStore(),r=this.getCandleBarOptions(o);if(null!==r){var a=0,s=0;r.type===w.Ohlc&&((a=Math.min(Math.max(Math.round(.2*o.getTimeScaleStore().getBarSpace().gapBar),1),8))>2&&a%2==1&&a--,s=Math.floor(s/2));var l=i.getAxisComponent();this.eachChildren(function(i,o){var c=i.data,u=i.x;if(ts(c)){var h=c.open,d=c.high,p=c.low,g=c.close,v=r.type,f=r.styles,m=[];g>h?(m[0]=f.upColor,m[1]=f.upBorderColor,m[2]=f.upWickColor):g<h?(m[0]=f.downColor,m[1]=f.downBorderColor,m[2]=f.downWickColor):(m[0]=f.noChangeColor,m[1]=f.noChangeBorderColor,m[2]=f.noChangeWickColor);var y=l.convertToPixel(h),_=l.convertToPixel(g),x=[y,_,l.convertToPixel(d),l.convertToPixel(p)];x.sort(function(t,e){return t-e});var S=[];switch(v){case w.CandleSolid:S=e._createSolidBar(u,x,o,m);break;case w.CandleStroke:S=e._createStrokeBar(u,x,o,m);break;case w.CandleUpStroke:S=g>h?e._createStrokeBar(u,x,o,m):e._createSolidBar(u,x,o,m);break;case w.CandleDownStroke:S=h>g?e._createStrokeBar(u,x,o,m):e._createSolidBar(u,x,o,m);break;case w.Ohlc:S=[{name:"rect",attrs:[{x:u-s,y:x[0],width:a,height:x[3]-x[0]},{x:u-o.halfGapBar,y:y+a>x[3]?x[3]-a:y,width:o.halfGapBar,height:a},{x:u+s,y:_+a>x[3]?x[3]-a:_,width:o.halfGapBar-s,height:a}],styles:{color:m[0]}}]}S.forEach(function(o){var r,a;n&&(a={mouseClickEvent:e._boundCandleBarClickEvent(i)}),null===(r=e.createFigure(o,a))||void 0===r||r.draw(t)})}})}},e.prototype.getCandleBarOptions=function(t){var e=t.getStyles().candle;return{type:e.type,styles:e.bar}},e.prototype._createSolidBar=function(t,e,i,n){return[{name:"rect",attrs:{x:t,y:e[0],width:1,height:e[3]-e[0]},styles:{color:n[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar,height:Math.max(1,e[2]-e[1])},styles:{style:_.StrokeFill,color:n[0],borderColor:n[1]}}]},e.prototype._createStrokeBar=function(t,e,i,n){return[{name:"rect",attrs:[{x:t,y:e[0],width:1,height:e[1]-e[0]},{x:t,y:e[2],width:1,height:e[3]-e[2]}],styles:{color:n[2]}},{name:"rect",attrs:{x:t-i.halfGapBar,y:e[1],width:i.gapBar,height:Math.max(1,e[2]-e[1])},styles:{style:_.Stroke,borderColor:n[1]}}]},e}(ey),ex=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getCandleBarOptions=function(t){var e,i,n=this.getWidget().getPane();if(!n.getAxisComponent().isInCandle()){var o=t.getIndicatorStore().getInstances(n.getId());try{for(var r=V(o),a=r.next();!a.done;a=r.next()){var s=a.value;if(s.shouldOhlc&&s.visible){var l=s.styles,c=t.getStyles().indicator,u=td(l,"ohlc.upColor",c.ohlc.upColor),h=td(l,"ohlc.downColor",c.ohlc.downColor),d=td(l,"ohlc.noChangeColor",c.ohlc.noChangeColor);return{type:w.Ohlc,styles:{upColor:u,downColor:h,noChangeColor:d,upBorderColor:u,downBorderColor:h,noChangeBorderColor:d,upWickColor:u,downWickColor:h,noChangeWickColor:d}}}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}}return null},e.prototype.drawImp=function(e){var i=this;t.prototype.drawImp.call(this,e);var n=this.getWidget(),o=n.getPane(),r=o.getChart(),a=n.getBounding(),s=r.getXAxisPane().getAxisComponent(),l=o.getAxisComponent(),c=r.getChartStore(),u=c.getDataList(),h=c.getTimeScaleStore(),d=h.getVisibleRange(),p=c.getIndicatorStore().getInstances(o.getId()),g=c.getStyles().indicator;e.save(),p.forEach(function(t){var n;if(t.visible){t.zLevel<0?e.globalCompositeOperation="destination-over":e.globalCompositeOperation="source-over";var o=!1;if(null!==t.draw&&(e.save(),o=null!==(n=t.draw({ctx:e,kLineDataList:u,indicator:t,visibleRange:d,bounding:a,barSpace:h.getBarSpace(),defaultStyles:g,xAxis:s,yAxis:l}))&&void 0!==n&&n,e.restore()),!o){var r=t.result,c=[];i.eachChildren(function(n,o){var h,d,p,v=o.halfGapBar,f=n.dataIndex,m=n.x,y=s.convertToPixel(f-1),_=s.convertToPixel(f+1),x=null!==(h=r[f-1])&&void 0!==h?h:null,S=null!==(d=r[f])&&void 0!==d?d:null,C=null!==(p=r[f+1])&&void 0!==p?p:null,b={x:y},w={x:m},I={x:_};t.figures.forEach(function(t){var e=t.key,i=null==x?void 0:x[e];ta(i)&&(b[e]=l.convertToPixel(i));var n=null==S?void 0:S[e];ta(n)&&(w[e]=l.convertToPixel(n));var o=null==C?void 0:C[e];ta(o)&&(I[e]=l.convertToPixel(o))}),tC(u,t,f,g,function(t,n,r){var u,h,d;if(ts(null==S?void 0:S[t.key])){var p=w[t.key],g=null===(u=t.attrs)||void 0===u?void 0:u.call(t,{data:{prev:x,current:S,next:C},coordinate:{prev:b,current:w,next:I},bounding:a,barSpace:o,xAxis:s,yAxis:l});if(!ts(g))switch(t.type){case"circle":g={x:m,y:p,r:Math.max(1,v)};break;case"rect":case"bar":var f=null!==(h=t.baseValue)&&void 0!==h?h:l.getRange().from,y=l.convertToPixel(f),_=Math.abs(y-p);f!==(null==S?void 0:S[t.key])&&(_=Math.max(1,_));g={x:m-v,y:p>y?y:p,width:Math.max(1,2*v),height:_};break;case"line":ts(c[r])||(c[r]=[]),ta(w[t.key])&&ta(I[t.key])&&c[r].push({coordinates:[{x:w.x,y:w[t.key]},{x:I.x,y:I[t.key]}],styles:n})}var E=t.type;ts(g)&&"line"!==E&&(null===(d=i.createFigure({name:"bar"===E?"rect":E,attrs:g,styles:n}))||void 0===d||d.draw(e))}})}),c.forEach(function(t){if(t.length>1){for(var n=[{coordinates:[t[0].coordinates[0],t[0].coordinates[1]],styles:t[0].styles}],o=1;o<t.length;o++){var r=n[n.length-1],a=t[o],s=r.coordinates[r.coordinates.length-1];s.x===a.coordinates[0].x&&s.y===a.coordinates[0].y&&r.styles.style===a.styles.style&&r.styles.color===a.styles.color&&r.styles.size===a.styles.size&&r.styles.smooth===a.styles.smooth&&r.styles.dashedValue[0]===a.styles.dashedValue[0]&&r.styles.dashedValue[1]===a.styles.dashedValue[1]?r.coordinates.push(a.coordinates[1]):n.push({coordinates:[a.coordinates[0],a.coordinates[1]],styles:a.styles})}n.forEach(function(t){var n,o=t.coordinates,r=t.styles;null===(n=i.createFigure({name:"line",attrs:{coordinates:o},styles:r}))||void 0===n||n.draw(e)})}})}}}),e.restore()},e}(e_),eS=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=e.getBounding(),o=e.getPane().getChart().getChartStore(),r=o.getTooltipStore().getCrosshair(),a=o.getStyles().crosshair;if(tc(r.paneId)&&a.show){if(r.paneId===i.getId()){var s=r.y;this._drawLine(t,[{x:0,y:s},{x:n.width,y:s}],a.horizontal)}var l=r.realX;this._drawLine(t,[{x:l,y:0},{x:l,y:n.height}],a.vertical)}},e.prototype._drawLine=function(t,e,i){var n;if(i.show){var o=i.line;o.show&&(null===(n=this.createFigure({name:"line",attrs:{coordinates:e},styles:o}))||void 0===n||n.draw(t))}},e}(ef),eC=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._boundIconClickEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getActionStore().execute(P.OnTooltipIconClick,B({},t)),!0}},e._boundIconMouseMoveEvent=function(t){return function(){return e.getWidget().getPane().getChart().getChartStore().getTooltipStore().setActiveIcon(B({},t)),!0}},e}return R(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getChart().getChartStore(),o=n.getTooltipStore().getCrosshair();if(ts(o.kLineData)){var r=e.getBounding(),a=n.getCustomApi(),s=n.getThousandsSeparator(),l=n.getDecimalFoldThreshold(),c=n.getIndicatorStore().getInstances(i.getId()),u=n.getTooltipStore().getActiveIcon(),h=n.getStyles().indicator,d=h.tooltip,p=d.offsetLeft,g=d.offsetTop,v=d.offsetRight;this.drawIndicatorTooltip(t,i.getId(),n.getDataList(),o,u,c,a,s,l,p,g,r.width-v,h)}},e.prototype.drawIndicatorTooltip=function(t,e,i,n,o,r,a,s,l,c,u,h,d){var p=this,g=d.tooltip;if(this.isDrawTooltip(n,g)){var v=g.text;r.forEach(function(r){var f=0,m={x:c,y:u},y=p.getIndicatorTooltipData(i,n,r,a,s,l,d),_=y.name,x=y.calcParamsText,S=y.values,C=y.icons,b=_.length>0,w=S.length>0;if(b||w){var I=z(p.classifyTooltipIcons(C),3),E=I[0],T=I[1],P=I[2];if(f=p.drawStandardTooltipIcons(t,o,E,m,e,r.name,c,f,h),b){var M=_;x.length>0&&(M="".concat(M).concat(x)),f=p.drawStandardTooltipLegends(t,[{title:{text:"",color:v.color},value:{text:M,color:v.color}}],m,c,f,h,v)}f=p.drawStandardTooltipIcons(t,o,T,m,e,r.name,c,f,h),w&&(f=p.drawStandardTooltipLegends(t,S,m,c,f,h,g.text)),f=p.drawStandardTooltipIcons(t,o,P,m,e,r.name,c,f,h),u=m.y+f}})}return u},e.prototype.drawStandardTooltipIcons=function(t,e,i,n,o,r,a,s,l){var c=this;if(i.length>0){var u=0,h=0;i.forEach(function(e){var i=e.marginLeft,n=e.marginTop,o=e.marginRight,r=e.marginBottom,a=e.paddingLeft,s=e.paddingTop,l=e.paddingRight,c=e.paddingBottom,d=e.size,p=e.fontFamily,g=e.icon;t.font=t_(d,"normal",p),u+=(void 0===i?0:i)+(void 0===a?0:a)+t.measureText(g).width+(void 0===l?0:l)+(void 0===o?0:o),h=Math.max(h,(void 0===n?0:n)+(void 0===s?0:s)+d+(void 0===c?0:c)+(void 0===r?0:r))}),n.x+u>l?(n.x=a,n.y+=s,s=h):s=Math.max(s,h),i.forEach(function(i){var a,s=i.marginLeft,l=void 0===s?0:s,u=i.marginTop,h=i.marginRight,d=i.paddingLeft,p=void 0===d?0:d,g=i.paddingTop,v=i.paddingRight,f=void 0===v?0:v,m=i.paddingBottom,y=i.color,_=i.activeColor,x=i.size,S=i.fontFamily,C=i.icon,b=i.backgroundColor,w=i.activeBackgroundColor,I=(null==e?void 0:e.paneId)===o&&(null==e?void 0:e.indicatorName)===r&&(null==e?void 0:e.iconId)===i.id;null===(a=c.createFigure({name:"text",attrs:{text:C,x:n.x+l,y:n.y+(void 0===u?0:u)},styles:{paddingLeft:p,paddingTop:void 0===g?0:g,paddingRight:f,paddingBottom:void 0===m?0:m,color:I?_:y,size:x,family:S,backgroundColor:I?w:b}},{mouseClickEvent:c._boundIconClickEvent({paneId:o,indicatorName:r,iconId:i.id}),mouseMoveEvent:c._boundIconMouseMoveEvent({paneId:o,indicatorName:r,iconId:i.id})}))||void 0===a||a.draw(t),n.x+=l+p+t.measureText(C).width+f+(void 0===h?0:h)})}return s},e.prototype.drawStandardTooltipLegends=function(t,e,i,n,o,r,a){var s=this;if(e.length>0){var l=a.marginLeft,c=a.marginTop,u=a.marginRight,h=a.marginBottom,d=a.size,p=a.family,g=a.weight;t.font=t_(d,g,p),e.forEach(function(e){var a,v,f=e.title,m=e.value,y=t.measureText(f.text).width,_=y+t.measureText(m.text).width,x=c+d+h;i.x+l+_+u>r?(i.x=n,i.y+=o,o=x):o=Math.max(o,x),f.text.length>0&&(null===(a=s.createFigure({name:"text",attrs:{x:i.x+l,y:i.y+c,text:f.text},styles:{color:f.color,size:d,family:p,weight:g}}))||void 0===a||a.draw(t)),null===(v=s.createFigure({name:"text",attrs:{x:i.x+l+y,y:i.y+c,text:m.text},styles:{color:m.color,size:d,family:p,weight:g}}))||void 0===v||v.draw(t),i.x+=l+_+u})}return o},e.prototype.isDrawTooltip=function(t,e){var i=e.showRule;return i===x.Always||i===x.FollowCross&&tc(t.paneId)},e.prototype.getIndicatorTooltipData=function(t,e,i,n,o,r,a){var s,l,c=a.tooltip,u=c.showName?i.shortName:"",h="",d=i.calcParams;d.length>0&&c.showParams&&(h="(".concat(d.join(","),")"));var p={name:u,calcParamsText:h,values:[],icons:c.icons},g=e.dataIndex,v=null!==(s=i.result)&&void 0!==s?s:[],f=[];if(i.visible){var m=null!==(l=v[g])&&void 0!==l?l:{};tC(t,i,g,a,function(t,e){if(tc(t.title)){var a=e.color,s=m[t.key];ta(s)&&(s=tg(s,i.precision),i.shouldFormatBigNumber&&(s=n.formatBigNumber(s))),f.push({title:{text:t.title,color:a},value:{text:tm(tf(null!=s?s:c.defaultValue,o),r),color:a}})}}),p.values=f}if(null!==i.createTooltipDataSource){var y=this.getWidget(),_=y.getPane(),x=_.getChart().getChartStore(),S=i.createTooltipDataSource({kLineDataList:t,indicator:i,visibleRange:x.getTimeScaleStore().getVisibleRange(),bounding:y.getBounding(),crosshair:e,defaultStyles:a,xAxis:_.getChart().getXAxisPane().getAxisComponent(),yAxis:_.getAxisComponent()}),C=S.name,b=S.calcParamsText,w=S.values,I=S.icons;if(tc(C)&&c.showName&&(p.name=C),tc(b)&&c.showParams&&(p.calcParamsText=b),ts(I)&&(p.icons=I),ts(w)&&i.visible){var E=[],T=a.tooltip.text.color;w.forEach(function(t){var e={text:"",color:T};tr(t.title)?e=t.title:e.text=t.title;var i={text:"",color:T};tr(t.value)?i=t.value:i.text=t.value,i.text=tm(tf(i.text,o),r),E.push({title:e,value:i})}),p.values=E}}return p},e.prototype.classifyTooltipIcons=function(t){var e=[],i=[],n=[];return t.forEach(function(t){switch(t.position){case C.Left:e.push(t);break;case C.Middle:i.push(t);break;case C.Right:n.push(t)}}),[e,i,n]},e}(ef),eb=function(t){function e(e){var i=t.call(this,e)||this;return i._initEvent(),i}return R(e,t),e.prototype._initEvent=function(){var t=this,e=this.getWidget().getPane(),i=e.getId(),n=e.getChart().getChartStore().getOverlayStore();this.registerEvent("mouseMoveEvent",function(e){var o,r=n.getProgressInstanceInfo();if(null!==r){var a=r.instance,s=r.paneId;a.isStart()&&(n.updateProgressInstanceInfo(i),s=i);var l=a.points.length-1,c="".concat(tw,"point_").concat(l);return a.isDrawing()&&s===i&&(a.eventMoveForDrawing(t._coordinateToPoint(r.instance,e)),null===(o=a.onDrawing)||void 0===o||o.call(a,B({overlay:a,figureKey:c,figureIndex:l},e))),t._figureMouseMoveEvent(a,1,c,l,0)(e)}return n.setHoverInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},e),!1}).registerEvent("mouseClickEvent",function(e){var o,r,a=n.getProgressInstanceInfo();if(null!==a){var s=a.instance,l=a.paneId;s.isStart()&&(n.updateProgressInstanceInfo(i,!0),l=i);var c=s.points.length-1,u="".concat(tw,"point_").concat(c);return s.isDrawing()&&l===i&&(s.eventMoveForDrawing(t._coordinateToPoint(s,e)),null===(o=s.onDrawing)||void 0===o||o.call(s,B({overlay:s,figureKey:u,figureIndex:c},e)),s.nextStep(),s.isDrawing()||(n.progressInstanceComplete(),null===(r=s.onDrawEnd)||void 0===r||r.call(s,B({overlay:s,figureKey:u,figureIndex:c},e)))),t._figureMouseClickEvent(s,1,u,c,0)(e)}return n.setClickInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1},e),!1}).registerEvent("mouseDoubleClickEvent",function(e){var o,r=n.getProgressInstanceInfo();if(null!==r){var a=r.instance,s=r.paneId;if(a.isDrawing()&&s===i&&(a.forceComplete(),!a.isDrawing())){n.progressInstanceComplete();var l=a.points.length-1,c="".concat(tw,"point_").concat(l);null===(o=a.onDrawEnd)||void 0===o||o.call(a,B({overlay:a,figureKey:c,figureIndex:l},e))}var u=a.points.length-1;return t._figureMouseClickEvent(a,1,"".concat(tw,"point_").concat(u),u,0)(e)}return!1}).registerEvent("mouseRightClickEvent",function(e){var i=n.getProgressInstanceInfo();if(null!==i){var o=i.instance;if(o.isDrawing()){var r=o.points.length-1;return t._figureMouseRightClickEvent(o,1,"".concat(tw,"point_").concat(r),r,0)(e)}}return!1}).registerEvent("mouseUpEvent",function(t){var e,o=n.getPressedInstanceInfo(),r=o.instance,a=o.figureIndex,s=o.figureKey;return null!==r&&(null===(e=r.onPressedMoveEnd)||void 0===e||e.call(r,B({overlay:r,figureKey:s,figureIndex:a},t))),n.setPressedInstanceInfo({paneId:i,instance:null,figureType:0,figureKey:"",figureIndex:-1,attrsIndex:-1}),!1}).registerEvent("pressedMouseMoveEvent",function(e){var i,o,r=n.getPressedInstanceInfo(),a=r.instance,s=r.figureType,l=r.figureIndex,c=r.figureKey;if(null!==a){if(!a.lock&&!(null!==(o=null===(i=a.onPressedMoving)||void 0===i?void 0:i.call(a,B({overlay:a,figureIndex:l,figureKey:c},e)))&&void 0!==o&&o)){var u=t._coordinateToPoint(a,e);1===s?a.eventPressedPointMove(u,l):a.eventPressedOtherMove(u,t.getWidget().getPane().getChart().getChartStore().getTimeScaleStore())}return!0}return!1})},e.prototype._createFigureEvents=function(t,e,i,n,o,r){var a;if(!t.isDrawing()){var s=[];if(ts(r)&&(tl(r)?r&&(s=["mouseClickEvent","mouseDoubleClickEvent","mouseRightClickEvent","tapEvent","doubleTapEvent","mouseDownEvent","touchStartEvent","mouseMoveEvent","touchMoveEvent"]):s=r),0===s.length)return{mouseMoveEvent:this._figureMouseMoveEvent(t,e,i,n,o),mouseDownEvent:this._figureMouseDownEvent(t,e,i,n,o),mouseClickEvent:this._figureMouseClickEvent(t,e,i,n,o),mouseRightClickEvent:this._figureMouseRightClickEvent(t,e,i,n,o),mouseDoubleClickEvent:this._figureMouseDoubleClickEvent(t,e,i,n,o)};a={},s.includes("mouseMoveEvent")||s.includes("touchMoveEvent")||(a.mouseMoveEvent=this._figureMouseMoveEvent(t,e,i,n,o)),s.includes("mouseDownEvent")||s.includes("touchStartEvent")||(a.mouseDownEvent=this._figureMouseDownEvent(t,e,i,n,o)),s.includes("mouseClickEvent")||s.includes("tapEvent")||(a.mouseClickEvent=this._figureMouseClickEvent(t,e,i,n,o)),s.includes("mouseDoubleClickEvent")||s.includes("doubleTapEvent")||(a.mouseDoubleClickEvent=this._figureMouseDoubleClickEvent(t,e,i,n,o)),s.includes("mouseRightClickEvent")||(a.mouseRightClickEvent=this._figureMouseRightClickEvent(t,e,i,n,o))}return a},e.prototype._figureMouseMoveEvent=function(t,e,i,n,o){var r=this;return function(a){var s=r.getWidget().getPane();return s.getChart().getChartStore().getOverlayStore().setHoverInstanceInfo({paneId:s.getId(),instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:o},a),!0}},e.prototype._figureMouseDownEvent=function(t,e,i,n,o){var r=this;return function(a){var s,l=r.getWidget().getPane(),c=l.getId(),u=l.getChart().getChartStore().getOverlayStore();return t.startPressedMove(r._coordinateToPoint(t,a)),null===(s=t.onPressedMoveStart)||void 0===s||s.call(t,B({overlay:t,figureIndex:n,figureKey:i},a)),u.setPressedInstanceInfo({paneId:c,instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:o}),!0}},e.prototype._figureMouseClickEvent=function(t,e,i,n,o){var r=this;return function(a){var s=r.getWidget().getPane(),l=s.getId();return s.getChart().getChartStore().getOverlayStore().setClickInstanceInfo({paneId:l,instance:t,figureType:e,figureKey:i,figureIndex:n,attrsIndex:o},a),!0}},e.prototype._figureMouseDoubleClickEvent=function(t,e,i,n,o){return function(e){var o;return null===(o=t.onDoubleClick)||void 0===o||o.call(t,B(B({},e),{figureIndex:n,figureKey:i,overlay:t})),!0}},e.prototype._figureMouseRightClickEvent=function(t,e,i,n,o){var r=this;return function(e){var o,a;return null!==(a=null===(o=t.onRightClick)||void 0===o?void 0:o.call(t,B({overlay:t,figureIndex:n,figureKey:i},e)))&&void 0!==a&&a||r.getWidget().getPane().getChart().getChartStore().getOverlayStore().removeInstance(t),!0}},e.prototype._coordinateToPoint=function(t,e){var i,n={},o=this.getWidget().getPane(),r=o.getChart(),a=o.getId(),s=r.getChartStore().getTimeScaleStore();if(this.coordinateToPointTimestampDataIndexFlag()){var l=r.getXAxisPane().getAxisComponent().convertFromPixel(e.x),c=null!==(i=s.dataIndexToTimestamp(l))&&void 0!==i?i:void 0;n.dataIndex=l,n.timestamp=c}if(this.coordinateToPointValueFlag()){var u=o.getAxisComponent(),h=u.convertFromPixel(e.y);if(t.mode!==D.Normal&&a===et.CANDLE&&ta(n.dataIndex)){var d=s.getDataByDataIndex(n.dataIndex);if(null!==d){var p=t.modeSensitivity;if(h>d.high){if(t.mode===D.WeakMagnet){var g=u.convertToPixel(d.high),v=u.convertFromPixel(g-p);h<v&&(h=d.high)}else h=d.high}else if(h<d.low){if(t.mode===D.WeakMagnet){var f=u.convertToPixel(d.low),v=u.convertFromPixel(f-p);h>v&&(h=d.low)}else h=d.low}else{var m=Math.max(d.open,d.close),y=Math.min(d.open,d.close);h=h>m?h-m<d.high-h?m:d.high:h<y?h-d.low<y-h?d.low:y:m-h<h-y?m:y}}}n.value=h}return n},e.prototype.coordinateToPointValueFlag=function(){return!0},e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.dispatchEvent=function(e,i,n){return this.getWidget().getPane().getChart().getChartStore().getOverlayStore().isDrawing()?this.onEvent(e,i,n):t.prototype.dispatchEvent.call(this,e,i,n)},e.prototype.checkEventOn=function(){return!0},e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),n=i.getPane(),o=n.getId(),r=n.getChart(),a=n.getAxisComponent(),s=r.getXAxisPane().getAxisComponent(),l=i.getBounding(),c=r.getChartStore(),u=c.getCustomApi(),h=c.getThousandsSeparator(),d=c.getDecimalFoldThreshold(),p=c.getTimeScaleStore(),g=p.getDateTimeFormat(),v=p.getBarSpace(),f=c.getPrecision(),m=c.getStyles().overlay,y=c.getOverlayStore(),_=y.getHoverInstanceInfo(),x=y.getClickInstanceInfo(),S=this.getCompleteOverlays(y,o),C=c.getIndicatorStore().getInstances(o).reduce(function(t,e){var i=e.precision;return t[e.name]=i,t.max=Math.max(t.max,i),t.min=Math.min(t.min,i),t.excludePriceVolumeMax=Math.max(t.excludePriceVolumeMax,i),t.excludePriceVolumeMin=Math.min(t.excludePriceVolumeMin,i),t},B(B({},f),{max:Math.max(f.price,f.volume),min:Math.min(f.price,f.volume),excludePriceVolumeMax:Number.MIN_SAFE_INTEGER,excludePriceVolumeMin:Number.MAX_SAFE_INTEGER}));S.forEach(function(i){i.visible&&e._drawOverlay(t,i,l,v,C,g,u,h,d,m,s,a,_,x,p)});var b=y.getProgressInstanceInfo();if(null!==b){var w=this.getProgressOverlay(b,o);null!==w&&w.visible&&this._drawOverlay(t,w,l,v,C,g,u,h,d,m,s,a,_,x,p)}},e.prototype._drawOverlay=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p,g){var v=e.points.map(function(t){var e,i,n=t.dataIndex;ta(t.timestamp)&&(n=g.timestampToDataIndex(t.timestamp));var o={x:0,y:0};return ta(n)&&(o.x=null!==(e=null==u?void 0:u.convertToPixel(n))&&void 0!==e?e:0),ta(t.value)&&(o.y=null!==(i=null==h?void 0:h.convertToPixel(t.value))&&void 0!==i?i:0),o});if(v.length>0){var f=[].concat(this.getFigures(e,v,i,n,o,s,l,r,c,u,h));this.drawFigures(t,e,f,c)}this.drawDefaultFigures(t,e,v,i,o,r,a,s,l,c,u,h,d,p)},e.prototype.drawFigures=function(t,e,i,n){var o=this;i.forEach(function(i,r){var a=i.type,s=i.styles,l=i.attrs,c=i.ignoreEvent;[].concat(l).forEach(function(l,u){var h,d,p,g=o._createFigureEvents(e,2,null!==(h=i.key)&&void 0!==h?h:"",r,u,c),v=B(B(B({},n[a]),null===(d=e.styles)||void 0===d?void 0:d[a]),s);null===(p=o.createFigure({name:a,attrs:l,styles:v},g))||void 0===p||p.draw(t)})})},e.prototype.getCompleteOverlays=function(t,e){return t.getInstances(e)},e.prototype.getProgressOverlay=function(t,e){return t.paneId===e?t.instance:null},e.prototype.getFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d;return null!==(d=null===(h=t.createPointFigures)||void 0===h?void 0:h.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:o,thousandsSeparator:r,decimalFoldThreshold:a,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==d?d:[]},e.prototype.drawDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p){var g,v,f=this;if(e.needDefaultPointFigure&&((null===(g=d.instance)||void 0===g?void 0:g.id)===e.id&&0!==d.figureType||(null===(v=p.instance)||void 0===v?void 0:v.id)===e.id&&0!==p.figureType)){var m=e.styles,y=B(B({},c.point),null==m?void 0:m.point);i.forEach(function(i,n){var o,r,a,s=i.x,l=i.y,c=y.radius,u=y.color,h=y.borderColor,p=y.borderSize;(null===(o=d.instance)||void 0===o?void 0:o.id)===e.id&&1===d.figureType&&d.figureIndex===n&&(c=y.activeRadius,u=y.activeColor,h=y.activeBorderColor,p=y.activeBorderSize),null===(r=f.createFigure({name:"circle",attrs:{x:s,y:l,r:c+p},styles:{color:h}},f._createFigureEvents(e,1,"".concat(tw,"point_").concat(n),n,0)))||void 0===r||r.draw(t),null===(a=f.createFigure({name:"circle",attrs:{x:s,y:l,r:c},styles:{color:u}}))||void 0===a||a.draw(t)})}},e}(ef),ew=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._gridView=new em(n),n._indicatorView=new ex(n),n._crosshairLineView=new eS(n),n._tooltipView=n.createTooltipView(),n._overlayView=new eb(n),n.addChild(n._tooltipView),n.addChild(n._overlayView),n.getContainer().style.cursor="crosshair",n.registerEvent("mouseMoveEvent",function(){return i.getChart().getChartStore().getTooltipStore().setActiveIcon(),!1}),n}return R(e,t),e.prototype.getName=function(){return ea.MAIN},e.prototype.updateMain=function(t){this.updateMainContent(t),this._indicatorView.draw(t),this._gridView.draw(t)},e.prototype.createTooltipView=function(){return new eC(this)},e.prototype.updateMainContent=function(t){},e.prototype.updateOverlay=function(t){this._overlayView.draw(t),this._crosshairLineView.draw(t),this._tooltipView.draw(t)},e}(eu),eI=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._ripplePoint=e.createFigure({name:"circle",attrs:{x:0,y:0,r:0},styles:{style:"fill"}}),e._animationFrameTime=0,e._animation=new tM({iterationCount:1/0}).doFrame(function(t){e._animationFrameTime=t;var i=e.getWidget().getPane();i.getChart().updatePane(0,i.getId())}),e}return R(e,t),e.prototype.drawImp=function(t){var e,i,n,o=this.getWidget(),r=o.getPane(),a=r.getChart(),s=a.getDataList().length-1,l=o.getBounding(),c=r.getAxisComponent(),u=a.getStyles().candle.area,h=[],d=Number.MAX_SAFE_INTEGER,p=Number.MIN_SAFE_INTEGER,g=null;if(this.eachChildren(function(t){var e=t.data,i=t.x,n=null==e?void 0:e[u.value];if(ta(n)){var o=c.convertToPixel(n);p===Number.MIN_SAFE_INTEGER&&(p=i),h.push({x:i,y:o}),d=Math.min(d,o),t.dataIndex===s&&(g={x:i,y:o})}}),h.length>0){null===(e=this.createFigure({name:"line",attrs:{coordinates:h},styles:{color:u.lineColor,size:u.lineSize,smooth:u.smooth}}))||void 0===e||e.draw(t);var v=u.backgroundColor,f=void 0;if(tn(v)){var m=t.createLinearGradient(0,l.height,0,d);try{v.forEach(function(t){var e=t.offset,i=t.color;m.addColorStop(e,i)})}catch(t){}f=m}else f=v;t.fillStyle=f,t.beginPath(),t.moveTo(p,l.height),t.lineTo(h[0].x,h[0].y),t5(t,h,u.smooth),t.lineTo(h[h.length-1].x,l.height),t.closePath(),t.fill()}var y=u.point;if(y.show&&ts(g)){null===(i=this.createFigure({name:"circle",attrs:{x:g.x,y:g.y,r:y.radius},styles:{style:"fill",color:y.color}}))||void 0===i||i.draw(t);var _=y.rippleRadius;y.animation&&(_=y.radius+this._animationFrameTime/y.animationDuration*(y.rippleRadius-y.radius),this._animation.setDuration(y.animationDuration).start()),null===(n=this._ripplePoint)||void 0===n||n.setAttrs({x:g.x,y:g.y,r:_}).setStyles({style:"fill",color:y.rippleColor}).draw(t)}else this.stopAnimation()},e.prototype.stopAnimation=function(){this._animation.stop()},e}(ey),eE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e=this.getWidget().getPane(),i=e.getChart().getChartStore(),n=i.getStyles().candle.priceMark,o=n.high,r=n.low;if(n.show&&(o.show||r.show)){var a=i.getThousandsSeparator(),s=i.getDecimalFoldThreshold(),l=i.getPrecision(),c=e.getAxisComponent(),u=Number.MIN_SAFE_INTEGER,h=0,d=Number.MAX_SAFE_INTEGER,p=0;this.eachChildren(function(t){var e=t.data,i=t.x;ts(e)&&(u<e.high&&(u=e.high,h=i),d>e.low&&(d=e.low,p=i))});var g=c.convertToPixel(u),v=c.convertToPixel(d);o.show&&u!==Number.MIN_SAFE_INTEGER&&this._drawMark(t,tm(tf(tg(u,l.price),a),s),{x:h,y:g},g<v?[-2,-5]:[2,5],o),r.show&&d!==Number.MAX_SAFE_INTEGER&&this._drawMark(t,tm(tf(tg(d,l.price),a),s),{x:p,y:v},g<v?[2,5]:[-2,-5],r)}},e.prototype._drawMark=function(t,e,i,n,o){var r,a,s,l,c,u,h=i.x,d=i.y+n[0];null===(r=this.createFigure({name:"line",attrs:{coordinates:[{x:h-2,y:d+n[0]},{x:h,y:d},{x:h+2,y:d+n[0]}]},styles:{color:o.color}}))||void 0===r||r.draw(t),h>this.getWidget().getBounding().width/2?(c=(l=h-5)-o.textOffset,u="right"):(u="left",c=(l=h+5)+o.textOffset);var p=d+n[1];null===(a=this.createFigure({name:"line",attrs:{coordinates:[{x:h,y:d},{x:h,y:p},{x:l,y:p}]},styles:{color:o.color}}))||void 0===a||a.draw(t),null===(s=this.createFigure({name:"text",attrs:{x:c,y:p,text:e,align:u,baseline:"middle"},styles:{color:o.color,size:o.textSize,family:o.textFamily,weight:o.textWeight}}))||void 0===s||s.draw(t)},e}(ey),eT=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=n.getChart().getChartStore(),a=r.getStyles().candle.priceMark,s=a.last,l=s.line;if(a.show&&s.show&&l.show){var c=n.getAxisComponent(),u=r.getDataList(),h=u[u.length-1];if(null!=h){var d=h.close,p=h.open,g=c.convertToNicePixel(d),v=void 0;v=d>p?s.upColor:d<p?s.downColor:s.noChangeColor,null===(e=this.createFigure({name:"line",attrs:{coordinates:[{x:0,y:g},{x:o.width,y:g}]},styles:{style:l.style,color:v,size:l.size,dashedValue:l.dashedValue}}))||void 0===e||e.draw(t)}}},e}(ef),eP={"zh-CN":{time:"时间：",open:"开：",high:"高：",low:"低：",close:"收：",volume:"成交量：",turnover:"成交额：",change:"涨幅："},"en-US":{time:"Time: ",open:"Open: ",high:"High: ",low:"Low: ",close:"Close: ",volume:"Volume: ",turnover:"Turnover: ",change:"Change: "}},eM=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e=this.getWidget(),i=e.getPane(),n=i.getId(),o=i.getChart().getChartStore(),r=o.getTooltipStore().getCrosshair();if(ts(r.kLineData)){var a=e.getBounding(),s=i.getYAxisWidget().getBounding(),l=o.getDataList(),c=o.getPrecision(),u=o.getLocale(),h=o.getCustomApi(),d=o.getThousandsSeparator(),p=o.getDecimalFoldThreshold(),g=o.getTooltipStore().getActiveIcon(),v=o.getIndicatorStore().getInstances(i.getId()),f=o.getTimeScaleStore().getDateTimeFormat(),m=o.getStyles(),y=m.candle,_=m.indicator;if(y.tooltip.showType===S.Rect&&_.tooltip.showType===S.Rect){var x=this.isDrawTooltip(r,y.tooltip),C=this.isDrawTooltip(r,_.tooltip);this._drawRectTooltip(t,l,v,a,s,r,c,f,u,h,d,p,x,C,y.tooltip.offsetTop,m)}else if(y.tooltip.showType===S.Standard&&_.tooltip.showType===S.Standard){var b=y.tooltip,w=b.offsetLeft,I=b.offsetTop,E=b.offsetRight,T=a.width-E,P=this._drawCandleStandardTooltip(t,l,n,r,g,c,f,u,h,d,p,w,I,T,y);this.drawIndicatorTooltip(t,n,l,r,g,v,h,d,p,w,P,T,_)}else if(y.tooltip.showType===S.Rect&&_.tooltip.showType===S.Standard){var M=y.tooltip,w=M.offsetLeft,I=M.offsetTop,E=M.offsetRight,T=a.width-E,D=this.drawIndicatorTooltip(t,n,l,r,g,v,h,d,p,w,I,T,_),x=this.isDrawTooltip(r,y.tooltip);this._drawRectTooltip(t,l,v,a,s,r,c,f,u,h,d,p,x,!1,D,m)}else{var k=y.tooltip,w=k.offsetLeft,I=k.offsetTop,E=k.offsetRight,T=a.width-E,A=this._drawCandleStandardTooltip(t,l,n,r,g,c,f,u,h,d,p,w,I,T,y),C=this.isDrawTooltip(r,_.tooltip);this._drawRectTooltip(t,l,v,a,s,r,c,f,u,h,d,p,!1,C,A,m)}}},e.prototype._drawCandleStandardTooltip=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p,g){var v,f,m,y=g.tooltip,_=y.text,x=0,S={x:h,y:d};if(this.isDrawTooltip(n,y)){var C=null!==(v=n.dataIndex)&&void 0!==v?v:0,b=this._getCandleTooltipLegends({prev:null!==(f=e[C-1])&&void 0!==f?f:null,current:n.kLineData,next:null!==(m=e[C+1])&&void 0!==m?m:null},r,a,s,l,c,u,g),w=z(this.classifyTooltipIcons(y.icons),3),I=w[0],E=w[1],T=w[2];x=this.drawStandardTooltipIcons(t,o,I,S,i,"",h,x,p),x=this.drawStandardTooltipIcons(t,o,E,S,i,"",h,x,p),b.length>0&&(x=this.drawStandardTooltipLegends(t,b,S,h,x,p,_)),x=this.drawStandardTooltipIcons(t,o,T,S,i,"",h,x,p)}return S.y+x},e.prototype._drawRectTooltip=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p,g,v){var f,m,y,x,S,C=this,w=v.candle,E=v.indicator,T=w.tooltip,P=E.tooltip;if(d||p){var M=null!==(f=r.dataIndex)&&void 0!==f?f:0,D=this._getCandleTooltipLegends({prev:null!==(m=e[M-1])&&void 0!==m?m:null,current:r.kLineData,next:null!==(y=e[M+1])&&void 0!==y?y:null},a,s,l,c,u,h,w),k=T.offsetLeft,A=T.offsetTop,F=T.offsetRight,L=T.offsetBottom,R=T.text,B=R.marginLeft,N=R.marginRight,O=R.marginTop,V=R.marginBottom,z=R.size,W=R.weight,X=R.family,Y=T.rect,H=Y.position,G=Y.paddingLeft,j=Y.paddingRight,K=Y.paddingTop,Z=Y.paddingBottom,U=Y.offsetLeft,q=Y.offsetRight,$=Y.offsetTop,Q=Y.offsetBottom,J=Y.borderSize,tt=Y.borderRadius,te=Y.borderColor,ti=Y.color,tn=0,to=0,tr=0;d&&(t.font=t_(z,W,X),D.forEach(function(e){var i=e.title,n=e.value,o="".concat(i.text).concat(n.text),r=t.measureText(o).width+B+N;tn=Math.max(tn,r)}),tr+=(V+O+z)*D.length);var ta=P.text,ts=ta.marginLeft,tl=ta.marginRight,tc=ta.marginTop,tu=ta.marginBottom,th=ta.size,td=ta.weight,tp=ta.family,tg=[];if(p&&(t.font=t_(th,td,tp),i.forEach(function(i){var n,o=null!==(n=C.getIndicatorTooltipData(e,r,i,c,u,h,E).values)&&void 0!==n?n:[];tg.push(o),o.forEach(function(e){var i=e.title,n=e.value,o="".concat(i.text).concat(n.text),r=t.measureText(o).width+ts+tl;tn=Math.max(tn,r),tr+=tc+tu+th})})),0!==(to+=tn)&&0!==tr){to+=2*J+G+j,tr+=2*J+K+Z;var tv=n.width/2,tf=H===b.Pointer&&r.paneId===et.CANDLE,tm=(null!==(x=r.realX)&&void 0!==x?x:0)>tv,ty=0;if(tf){var tx=r.realX;ty=tm?tx-q-to:tx+U}else tm?(ty=U+k,v.yAxis.inside&&v.yAxis.position===I.Left&&(ty+=o.width)):(ty=n.width-q-to-F,v.yAxis.inside&&v.yAxis.position===I.Right&&(ty-=o.width));var tS=g+$;tf&&((tS=r.y-tr/2)+tr>n.height-Q-L&&(tS=n.height-Q-tr-L),tS<g+$&&(tS=g+$+A)),null===(S=this.createFigure({name:"rect",attrs:{x:ty,y:tS,width:to,height:tr},styles:{style:_.StrokeFill,color:ti,borderColor:te,borderSize:J,borderRadius:tt}}))||void 0===S||S.draw(t);var tC=ty+J+G+B,tb=tS+J+K;if(d&&D.forEach(function(e){tb+=O;var i,n,o=e.title;null===(i=C.createFigure({name:"text",attrs:{x:tC,y:tb,text:o.text},styles:{color:o.color,size:z,family:X,weight:W}}))||void 0===i||i.draw(t);var r=e.value;null===(n=C.createFigure({name:"text",attrs:{x:ty+to-J-N-j,y:tb,text:r.text,align:"right"},styles:{color:r.color,size:z,family:X,weight:W}}))||void 0===n||n.draw(t),tb+=z+V}),p){var tw=ty+J+G+ts;tg.forEach(function(e){e.forEach(function(e){tb+=tc;var i,n,o=e.title,r=e.value;null===(i=C.createFigure({name:"text",attrs:{x:tw,y:tb,text:o.text},styles:{color:o.color,size:th,family:tp,weight:td}}))||void 0===i||i.draw(t),null===(n=C.createFigure({name:"text",attrs:{x:ty+to-J-tl-j,y:tb,text:r.text,align:"right"},styles:{color:r.color,size:th,family:tp,weight:td}}))||void 0===n||n.draw(t),tb+=th+tu})})}}}},e.prototype._getCandleTooltipLegends=function(t,e,i,n,o,r,a,s){var l,c,u,h,d,p=s.tooltip,g=p.text.color,v=t.current,f=null!==(c=null===(l=t.prev)||void 0===l?void 0:l.close)&&void 0!==c?c:v.close,m=v.close-f,y=e.price,_=e.volume,x={"{time}":o.formatDate(i,v.timestamp,"YYYY-MM-DD HH:mm",k.Tooltip),"{open}":tm(tf(tg(v.open,y),r),a),"{high}":tm(tf(tg(v.high,y),r),a),"{low}":tm(tf(tg(v.low,y),r),a),"{close}":tm(tf(tg(v.close,y),r),a),"{volume}":tm(tf(o.formatBigNumber(tg(null!==(u=v.volume)&&void 0!==u?u:p.defaultValue,_)),r),a),"{turnover}":tm(tf(tg(null!==(h=v.turnover)&&void 0!==h?h:p.defaultValue,y),r),a),"{change}":0===f?p.defaultValue:"".concat(tf(tg(m/f*100),r),"%")};return(null!==(d=to(p.custom)?p.custom(t,s):p.custom)&&void 0!==d?d:[]).map(function(t){var e,i,o,r,a=t.title,l=t.value,c={text:"",color:""};tr(a)?c=B({},a):(c.text=a,c.color=g),c.text=(e=c.text,null!==(o=null===(i=eP[n])||void 0===i?void 0:i[e])&&void 0!==o?o:e);var u={text:p.defaultValue,color:""};tr(l)?u=B({},l):(u.text=l,u.color=g);var h=u.text.match(/{(\S*)}/);if(null!==h&&h.length>1){var d="{".concat(h[1],"}");u.text=u.text.replace(d,null!==(r=x[d])&&void 0!==r?r:p.defaultValue),"{change}"===d&&(u.color=0===m?s.priceMark.last.noChangeColor:m>0?s.priceMark.last.upColor:s.priceMark.last.downColor)}return{title:c,value:u}})},e}(eC),eD=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._candleBarView=new e_(n),n._candleAreaView=new eI(n),n._candleHighLowPriceView=new eE(n),n._candleLastPriceLineView=new eT(n),n.addChild(n._candleBarView),n}return R(e,t),e.prototype.updateMainContent=function(t){this.getPane().getChart().getStyles().candle.type!==w.Area?(this._candleBarView.draw(t),this._candleHighLowPriceView.draw(t),this._candleAreaView.stopAnimation()):this._candleAreaView.draw(t),this._candleLastPriceLineView.draw(t)},e.prototype.createTooltipView=function(){return new eM(this)},e}(ew),ek=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e,i,n=this,o=this.getWidget(),r=o.getPane(),a=o.getBounding(),s=r.getAxisComponent(),l=this.getAxisStyles(r.getChart().getStyles());if(l.show){l.axisLine.show&&(null===(e=this.createFigure({name:"line",attrs:this.createAxisLine(a,l),styles:l.axisLine}))||void 0===e||e.draw(t));var c=s.getTicks();if(l.tickLine.show&&this.createTickLines(c,a,l).forEach(function(e){var i;null===(i=n.createFigure({name:"line",attrs:e,styles:l.tickLine}))||void 0===i||i.draw(t)}),l.tickText.show){var u=this.createTickTexts(c,a,l);null===(i=this.createFigure({name:"text",attrs:u,styles:l.tickText}))||void 0===i||i.draw(t)}}},e}(ef),eA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getAxisStyles=function(t){return t.yAxis},e.prototype.createAxisLine=function(t,e){var i,n=this.getWidget().getPane().getAxisComponent(),o=e.axisLine.size;return{coordinates:[{x:i=n.isFromZero()?0:t.width-o,y:0},{x:i,y:t.height}]}},e.prototype.createTickLines=function(t,e,i){var n=this.getWidget().getPane().getAxisComponent(),o=i.axisLine,r=i.tickLine,a=0,s=0;return n.isFromZero()?(a=0,o.show&&(a+=o.size),s=a+r.length):(a=e.width,o.show&&(a-=o.size),s=a-r.length),t.map(function(t){return{coordinates:[{x:a,y:t.coord},{x:s,y:t.coord}]}})},e.prototype.createTickTexts=function(t,e,i){var n=this.getWidget().getPane().getAxisComponent(),o=i.axisLine,r=i.tickLine,a=i.tickText,s=0;n.isFromZero()?(s=a.marginStart,o.show&&(s+=o.size),r.show&&(s+=r.length)):(s=e.width-a.marginEnd,o.show&&(s-=o.size),r.show&&(s-=r.length));var l=this.getWidget().getPane().getAxisComponent().isFromZero()?"left":"right";return t.map(function(t){return{x:s,y:t.coord,text:t.text,align:l,baseline:"middle"}})},e}(ek),eF=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=n.getChart().getChartStore(),a=r.getStyles().candle.priceMark,s=a.last,l=s.text;if(a.show&&s.show&&l.show){var c=r.getPrecision(),u=n.getAxisComponent(),h=r.getDataList(),d=h[h.length-1];if(ts(d)){var p=d.close,g=d.open,v=u.convertToNicePixel(p),f=void 0;f=p>g?s.upColor:p<g?s.downColor:s.noChangeColor;var m=void 0;if(u.getType()===E.Percentage){var y=r.getVisibleFirstData().close;m="".concat(((p-y)/y*100).toFixed(2),"%")}else m=tg(p,c.price);m=tm(tf(m,r.getThousandsSeparator()),r.getDecimalFoldThreshold());var _=void 0,x=void 0;u.isFromZero()?(_=0,x="left"):(_=o.width,x="right"),null===(e=this.createFigure({name:"text",attrs:{x:_,y:v,text:m,align:x,baseline:"middle"},styles:B(B({},l),{backgroundColor:f})}))||void 0===e||e.draw(t)}}},e}(ef),eL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e=this,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=n.getChart().getChartStore(),a=r.getCustomApi(),s=r.getStyles().indicator,l=s.lastValueMark,c=l.text;if(l.show){var u=n.getAxisComponent(),h=r.getDataList(),d=h.length-1,p=r.getIndicatorStore().getInstances(n.getId()),g=r.getThousandsSeparator(),v=r.getDecimalFoldThreshold();p.forEach(function(i){var n=i.result[d];if(ts(n)&&i.visible){var r=i.precision;tC(h,i,d,s,function(s,l){var h,d=n[s.key];if(ta(d)){var p=u.convertToNicePixel(d),f=tg(d,r);i.shouldFormatBigNumber&&(f=a.formatBigNumber(f)),f=tm(tf(f,g),v);var m=void 0,y=void 0;u.isFromZero()?(m=0,y="left"):(m=o.width,y="right"),null===(h=e.createFigure({name:"text",attrs:{x:m,y:p,text:f,align:y,baseline:"middle"},styles:B(B({},c),{backgroundColor:l.color})}))||void 0===h||h.draw(t)}})}})}},e}(ef),eR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!1},e.prototype.drawDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u,h,d,p){this.drawFigures(t,e,this.getDefaultFigures(e,i,n,o,r,a,s,l,u,h,p),c)},e.prototype.getDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h=[];if(t.needDefaultYAxisFigure&&t.id===(null===(d=u.instance)||void 0===d?void 0:d.id)&&u.paneId===this.getWidget().getPane().getId()){var d,p,g,v,f=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;null!==(p=null==c?void 0:c.isFromZero())&&void 0!==p&&p?(g="left",v=0):(g="right",v=i.width),e.forEach(function(e,i){var o=t.points[i];if(ta(o.value)){f=Math.min(f,e.y),m=Math.max(m,e.y);var r=tm(tf(tg(o.value,n.price),a),s);h.push({type:"text",attrs:{x:v,y:e.y,text:r,align:g,baseline:"middle"},ignoreEvent:!0})}}),e.length>1&&h.unshift({type:"rect",attrs:{x:0,y:f,width:i.width,height:m-f},ignoreEvent:!0})}return h},e.prototype.getFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d;return null!==(d=null===(h=t.createYAxisFigures)||void 0===h?void 0:h.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:o,thousandsSeparator:r,decimalFoldThreshold:a,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==d?d:[]},e}(eb),eB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.drawImp=function(t){var e,i=this.getWidget(),n=i.getPane(),o=i.getBounding(),r=i.getPane().getChart().getChartStore(),a=r.getTooltipStore().getCrosshair(),s=r.getStyles().crosshair;if(tc(a.paneId)&&this.compare(a,n.getId())&&s.show){var l=this.getDirectionStyles(s),c=l.text;if(l.show&&c.show){var u=n.getAxisComponent(),h=this.getText(a,r,u);t.font=t_(c.size,c.weight,c.family),null===(e=this.createFigure({name:"text",attrs:this.getTextAttrs(h,t.measureText(h).width,a,o,u,c),styles:c}))||void 0===e||e.draw(t)}}},e.prototype.compare=function(t,e){return t.paneId===e},e.prototype.getDirectionStyles=function(t){return t.horizontal},e.prototype.getText=function(t,e,i){var n,o=i.convertFromPixel(t.y);if(i.getType()===E.Percentage){var r=e.getVisibleFirstData();n="".concat(((o-r.close)/r.close*100).toFixed(2),"%")}else{var a=e.getIndicatorStore().getInstances(t.paneId),s=0,l=!1;i.isInCandle()?s=e.getPrecision().price:a.forEach(function(t){s=Math.max(t.precision,s),l||(l=t.shouldFormatBigNumber)}),n=tg(o,s),l&&(n=e.getCustomApi().formatBigNumber(n))}return tm(tf(n,e.getThousandsSeparator()),e.getDecimalFoldThreshold())},e.prototype.getTextAttrs=function(t,e,i,n,o,r){var a,s;return o.isFromZero()?(a=0,s="left"):(a=n.width,s="right"),{x:a,y:i.y,text:t,align:s,baseline:"middle"}},e}(ef),eN=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._yAxisView=new eA(n),n._candleLastPriceLabelView=new eF(n),n._indicatorLastValueView=new eL(n),n._overlayYAxisView=new eR(n),n._crosshairHorizontalLabelView=new eB(n),n.getContainer().style.cursor="ns-resize",n.addChild(n._overlayYAxisView),n}return R(e,t),e.prototype.getName=function(){return ea.Y_AXIS},e.prototype.updateMain=function(t){this._yAxisView.draw(t),this.getPane().getAxisComponent().isInCandle()&&this._candleLastPriceLabelView.draw(t),this._indicatorLastValueView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayYAxisView.draw(t),this._crosshairHorizontalLabelView.draw(t)},e}(eu),eO=function(){function t(t){this._range={from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0},this._prevRange={from:0,to:0,range:0,realFrom:0,realTo:0,realRange:0},this._ticks=[],this._autoCalcTickFlag=!0,this._parent=t}return t.prototype.getParent=function(){return this._parent},t.prototype.buildTicks=function(t){if(this._autoCalcTickFlag&&(this._range=this.calcRange()),this._prevRange.from!==this._range.from||this._prevRange.to!==this._range.to||t){this._prevRange=this._range;var e=this.optimalTicks(this._calcTicks());return this._ticks=this.createTicks({range:this._range,bounding:this.getSelfBounding(),defaultTicks:e}),!0}return!1},t.prototype.getTicks=function(){return this._ticks},t.prototype.getScrollZoomEnabled=function(){var t;return null===(t=this.getParent().getOptions().axisOptions.scrollZoomEnabled)||void 0===t||t},t.prototype.setRange=function(t){this._autoCalcTickFlag=!1,this._range=t},t.prototype.getRange=function(){return this._range},t.prototype.setAutoCalcTickFlag=function(t){this._autoCalcTickFlag=t},t.prototype.getAutoCalcTickFlag=function(){return this._autoCalcTickFlag},t.prototype._calcTicks=function(){var t=this._range,e=t.realFrom,i=t.realTo,n=t.realRange,o=[];if(n>=0){var r=z(this._calcTickInterval(n),2),a=r[0],s=r[1],l=tR(Math.ceil(e/a)*a,s),c=tR(Math.floor(i/a)*a,s),u=0,h=l;if(0!==a)for(;h<=c;){var d=h.toFixed(s);o[u]={text:d,coord:0,value:d},++u,h+=a}}return o},t.prototype._calcTickInterval=function(t){var e,i,n,o,r=(n=tO(i=Math.floor(tN(e=t/8))),e=((o=e/n)<1.5?1:o<2.5?2:o<3.5?3:o<4.5?4:o<5.5?5:o<6.5?6:8)*n,i>=-20?+e.toFixed(i<0?-i:0):e),a=function(t){var e=t.toString(),i=e.indexOf("e");if(i>0){var n=+e.slice(i+1);return n<0?-n:0}var o=e.indexOf(".");return o<0?0:e.length-1-o}(r);return[r,a]},t}(),eV={default:(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.calcRange=function(){var t,e,i,n,o,r,a,s,l=this.getParent(),c=l.getChart(),u=c.getChartStore(),h=Number.MAX_SAFE_INTEGER,d=Number.MIN_SAFE_INTEGER,p=[],g=!1,v=Number.MAX_SAFE_INTEGER,f=Number.MIN_SAFE_INTEGER,m=Number.MAX_SAFE_INTEGER;u.getIndicatorStore().getInstances(l.getId()).forEach(function(t){var e,i,n;g||(g=null!==(e=t.shouldOhlc)&&void 0!==e&&e),m=Math.min(m,t.precision),ta(t.minValue)&&(v=Math.min(v,t.minValue)),ta(t.maxValue)&&(f=Math.max(f,t.maxValue)),p.push({figures:null!==(i=t.figures)&&void 0!==i?i:[],result:null!==(n=t.result)&&void 0!==n?n:[]})});var y=4,_=this.isInCandle();if(_){var x=u.getPrecision().price;y=m!==Number.MAX_SAFE_INTEGER?Math.min(m,x):x}else m!==Number.MAX_SAFE_INTEGER&&(y=m);var S=u.getVisibleDataList(),C=c.getStyles().candle,b=C.type===w.Area,I=C.area.value,T=_&&!b||!_&&g;S.forEach(function(t){var e=t.dataIndex,i=t.data;if(ts(i)&&(T&&(h=Math.min(h,i.low),d=Math.max(d,i.high)),_&&b)){var n=i[I];ta(n)&&(h=Math.min(h,n),d=Math.max(d,n))}p.forEach(function(t){var i,n=t.figures,o=null!==(i=t.result[e])&&void 0!==i?i:{};n.forEach(function(t){var e=o[t.key];ta(e)&&(h=Math.min(h,e),d=Math.max(d,e))})})}),h!==Number.MAX_SAFE_INTEGER&&d!==Number.MIN_SAFE_INTEGER?(h=Math.min(v,h),d=Math.max(f,d)):(h=0,d=10);var P=this.getType();switch(P){case E.Percentage:var M=u.getVisibleFirstData();ts(M)&&ta(M.close)&&(h=(h-M.close)/M.close*100,d=(d-M.close)/M.close*100),o=.01;break;case E.Log:h=tN(h),d=tN(d),o=.05*tO(-y);break;default:o=tO(-y)}if(h===d||Math.abs(h-d)<o){var D=v===h,k=f===d;h=D?h:k?h-8*o:h-4*o,d=k?d:D?d+8*o:d+4*o}var A=null!==(e=null===(t=this.getParent().getYAxisWidget())||void 0===t?void 0:t.getBounding().height)&&void 0!==e?e:0,F=l.getOptions().gap,L=null!==(i=null==F?void 0:F.top)&&void 0!==i?i:.2;L>=1&&(L/=A);var R=null!==(n=null==F?void 0:F.bottom)&&void 0!==n?n:.1;R>=1&&(R/=A);var B=Math.abs(d-h);return h-=B*R,d+=B*L,B=Math.abs(d-h),P===E.Log?(r=tO(h),s=Math.abs((a=tO(d))-r)):(r=h,a=d,s=B),{from:h,to:d,range:B,realFrom:r,realTo:a,realRange:s}},e.prototype._innerConvertToPixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,o=this.getRange(),r=(t-o.from)/o.range;return this.isReverse()?Math.round(r*n):Math.round((1-r)*n)},e.prototype.isInCandle=function(){return this.getParent().getId()===et.CANDLE},e.prototype.getType=function(){return this.isInCandle()?this.getParent().getChart().getStyles().yAxis.type:E.Normal},e.prototype.getPosition=function(){return this.getParent().getChart().getStyles().yAxis.position},e.prototype.isReverse=function(){return!!this.isInCandle()&&this.getParent().getChart().getStyles().yAxis.reverse},e.prototype.isFromZero=function(){var t=this.getParent().getChart().getStyles().yAxis,e=t.inside;return t.position===I.Left&&e||t.position===I.Right&&!e},e.prototype.optimalTicks=function(t){var e,i,n,o=this,r=this.getParent(),a=null!==(i=null===(e=r.getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,s=r.getChart().getChartStore(),l=s.getCustomApi(),c=[],u=this.getType(),h=s.getIndicatorStore().getInstances(r.getId()),d=s.getThousandsSeparator(),p=s.getDecimalFoldThreshold(),g=0,v=!1;this.isInCandle()?g=s.getPrecision().price:h.forEach(function(t){g=Math.max(g,t.precision),v||(v=t.shouldFormatBigNumber)});var f=s.getStyles().xAxis.tickText.size;return t.forEach(function(t){var e,i=t.value,r=o._innerConvertToPixel(+i);switch(u){case E.Percentage:e="".concat(tg(i,2),"%");break;case E.Log:r=o._innerConvertToPixel(tN(+i)),e=tg(i,g);break;default:e=tg(i,g),v&&(e=l.formatBigNumber(i))}e=tm(tf(e,d),p);var s=ta(n);r>f&&r<a-f&&(s&&Math.abs(n-r)>2*f||!s)&&(c.push({text:e,coord:r,value:i}),n=r)}),c},e.prototype.getAutoSize=function(){var t=this.getParent(),e=t.getChart(),i=e.getStyles(),n=i.yAxis,o=n.size;if("auto"!==o)return o;var r=e.getChartStore(),a=r.getCustomApi(),s=0;if(n.show&&(n.axisLine.show&&(s+=n.axisLine.size),n.tickLine.show&&(s+=n.tickLine.length),n.tickText.show)){var l=0;this.getTicks().forEach(function(t){l=Math.max(l,tx(t.text,n.tickText.size,n.tickText.weight,n.tickText.family))}),s+=n.tickText.marginStart+n.tickText.marginEnd+l}var c=i.crosshair,u=0;if(c.show&&c.horizontal.show&&c.horizontal.text.show){var h=r.getIndicatorStore().getInstances(t.getId()),d=0,p=!1;h.forEach(function(t){d=Math.max(t.precision,d),p||(p=t.shouldFormatBigNumber)});var g=2;if(this.getType()!==E.Percentage){if(this.isInCandle()){var v=r.getPrecision().price,f=i.indicator.lastValueMark;g=f.show&&f.text.show?Math.max(d,v):v}else g=d}var m=tg(this.getRange().to,g);p&&(m=a.formatBigNumber(m)),m=tm(m,r.getDecimalFoldThreshold()),u+=c.horizontal.text.paddingLeft+c.horizontal.text.paddingRight+2*c.horizontal.text.borderSize+tx(m,c.horizontal.text.size,c.horizontal.text.weight,c.horizontal.text.family)}return Math.max(s,u)},e.prototype.getSelfBounding=function(){return this.getParent().getYAxisWidget().getBounding()},e.prototype.convertFromPixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0,o=this.getRange(),r=o.from,a=o.range,s=(this.isReverse()?t/n:1-t/n)*a+r;switch(this.getType()){case E.Percentage:var l=this.getParent().getChart().getChartStore().getVisibleFirstData();if(ts(l)&&ta(l.close))return l.close*s/100+l.close;return 0;case E.Log:return tO(s);default:return s}},e.prototype.convertToRealValue=function(t){var e=t;return this.getType()===E.Log&&(e=tO(t)),e},e.prototype.convertToPixel=function(t){var e=t;switch(this.getType()){case E.Percentage:var i=this.getParent().getChart().getChartStore().getVisibleFirstData();ts(i)&&ta(i.close)&&(e=(t-i.close)/i.close*100);break;case E.Log:e=tN(t);break;default:e=t}return this._innerConvertToPixel(e)},e.prototype.convertToNicePixel=function(t){var e,i,n=null!==(i=null===(e=this.getParent().getYAxisWidget())||void 0===e?void 0:e.getBounding().height)&&void 0!==i?i:0;return Math.round(Math.max(.05*n,Math.min(this.convertToPixel(t),.98*n)))},e.extend=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),i.prototype.createTicks=function(e){return t.createTicks(e)},i}(e)},e})(eO).extend({name:"default",createTicks:function(t){return t.defaultTicks}})},ez=function(){function t(t,e,i,n){this._bounding=el(),this._chart=i,this._id=n,this._init(t,e)}return t.prototype._init=function(t,e){this._rootContainer=t,this._container=tF("div",{width:"100%",margin:"0",padding:"0",position:"relative",overflow:"hidden",boxSizing:"border-box"}),null!==e?t.insertBefore(this._container,e):t.appendChild(this._container)},t.prototype.getContainer=function(){return this._container},t.prototype.getId=function(){return this._id},t.prototype.getChart=function(){return this._chart},t.prototype.getBounding=function(){return this._bounding},t.prototype.update=function(t){this._bounding.height!==this._container.clientHeight&&(this._container.style.height="".concat(this._bounding.height,"px")),this.updateImp(null!=t?t:3,this._container,this._bounding)},t.prototype.destroy=function(){this._rootContainer.removeChild(this._container)},t}(),eW=function(t){function e(e,i,n,o,r){var a=t.call(this,e,i,n,o)||this;a._yAxisWidget=null,a._options={minHeight:30,dragEnabled:!0,gap:{top:.2,bottom:.1},axisOptions:{name:"default",scrollZoomEnabled:!0}};var s=a.getContainer();return a._mainWidget=a.createMainWidget(s),a._yAxisWidget=a.createYAxisWidget(s),a.setOptions(r),a}return R(e,t),e.prototype.setOptions=function(t){var e,i,n,o,r,a=null===(e=t.axisOptions)||void 0===e?void 0:e.name;return(this._options.axisOptions.name!==a&&tc(a)||!ts(this._axis))&&(this._axis=this.createAxisComponent(null!=a?a:"default")),te(this._options,t),this.getId()===et.X_AXIS?(o=this.getMainWidget().getContainer(),r="ew-resize"):(o=this.getYAxisWidget().getContainer(),r="ns-resize"),null===(n=null===(i=t.axisOptions)||void 0===i?void 0:i.scrollZoomEnabled)||void 0===n||n?o.style.cursor=r:o.style.cursor="default",this},e.prototype.getOptions=function(){return this._options},e.prototype.getAxisComponent=function(){return this._axis},e.prototype.setBounding=function(t,e,i){te(this.getBounding(),t);var n,o,r={};return ts(t.height)&&(r.height=t.height),ts(t.top)&&(r.top=t.top),this._mainWidget.setBounding(r),null===(n=this._yAxisWidget)||void 0===n||n.setBounding(r),ts(e)&&this._mainWidget.setBounding(e),ts(i)&&(null===(o=this._yAxisWidget)||void 0===o||o.setBounding(i)),this},e.prototype.getMainWidget=function(){return this._mainWidget},e.prototype.getYAxisWidget=function(){return this._yAxisWidget},e.prototype.updateImp=function(t){var e;this._mainWidget.update(t),null===(e=this._yAxisWidget)||void 0===e||e.update(t)},e.prototype.destroy=function(){var e;t.prototype.destroy.call(this),this._mainWidget.destroy(),null===(e=this._yAxisWidget)||void 0===e||e.destroy()},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,o=tF("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),r=o.getContext("2d"),a=ty(o);o.width=i*a,o.height=n*a,r.scale(a,a);var s=this._mainWidget.getBounding();if(r.drawImage(this._mainWidget.getImage(t),s.left,0,s.width,s.height),null!==this._yAxisWidget){var l=this._yAxisWidget.getBounding();r.drawImage(this._yAxisWidget.getImage(t),l.left,0,l.width,l.height)}return o},e.prototype.createYAxisWidget=function(t){return null},e}(ez),eX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.createAxisComponent=function(t){var e;return new(null!==(e=eV[null!=t?t:"default"])&&void 0!==e?e:eV.default)(this)},e.prototype.createMainWidget=function(t){return new ew(t,this)},e.prototype.createYAxisWidget=function(t){return new eN(t,this)},e}(eW),eY=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.createMainWidget=function(t){return new eD(t,this)},e}(eX),eH=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.getAxisStyles=function(t){return t.xAxis},e.prototype.createAxisLine=function(t){return{coordinates:[{x:0,y:0},{x:t.width,y:0}]}},e.prototype.createTickLines=function(t,e,i){var n=i.tickLine,o=i.axisLine.size;return t.map(function(t){return{coordinates:[{x:t.coord,y:0},{x:t.coord,y:o+n.length}]}})},e.prototype.createTickTexts=function(t,e,i){var n=i.tickText,o=i.axisLine.size,r=i.tickLine.length;return t.map(function(t){return{x:t.coord,y:o+r+n.marginStart,text:t.text,align:"center",baseline:"top"}})},e}(ek),eG=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.coordinateToPointTimestampDataIndexFlag=function(){return!0},e.prototype.coordinateToPointValueFlag=function(){return!1},e.prototype.getCompleteOverlays=function(t){return t.getInstances()},e.prototype.getProgressOverlay=function(t){return t.instance},e.prototype.getDefaultFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d=[];if(t.needDefaultXAxisFigure&&t.id===(null===(h=u.instance)||void 0===h?void 0:h.id)){var p=Number.MAX_SAFE_INTEGER,g=Number.MIN_SAFE_INTEGER;e.forEach(function(e,i){p=Math.min(p,e.x),g=Math.max(g,e.x);var n=t.points[i];if(ta(n.timestamp)){var a=r.formatDate(o,n.timestamp,"YYYY-MM-DD HH:mm",k.Crosshair);d.push({type:"text",attrs:{x:e.x,y:0,text:a,align:"center"},ignoreEvent:!0})}}),e.length>1&&d.unshift({type:"rect",attrs:{x:p,y:0,width:g-p,height:i.height},ignoreEvent:!0})}return d},e.prototype.getFigures=function(t,e,i,n,o,r,a,s,l,c,u){var h,d;return null!==(d=null===(h=t.createXAxisFigures)||void 0===h?void 0:h.call(t,{overlay:t,coordinates:e,bounding:i,barSpace:n,precision:o,thousandsSeparator:r,decimalFoldThreshold:a,dateTimeFormat:s,defaultStyles:l,xAxis:c,yAxis:u}))&&void 0!==d?d:[]},e}(eR),ej=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.compare=function(t){return ts(t.kLineData)&&t.dataIndex===t.realDataIndex},e.prototype.getDirectionStyles=function(t){return t.vertical},e.prototype.getText=function(t,e){var i,n=null===(i=t.kLineData)||void 0===i?void 0:i.timestamp;return e.getCustomApi().formatDate(e.getTimeScaleStore().getDateTimeFormat(),n,"YYYY-MM-DD HH:mm",k.Crosshair)},e.prototype.getTextAttrs=function(t,e,i,n,o,r){var a,s=i.realX,l="center";return s-e/2-r.paddingLeft<0?(a=0,l="left"):s+e/2+r.paddingRight>n.width?(a=n.width,l="right"):a=s,{x:a,y:0,text:t,align:l,baseline:"top"}},e}(eB),eK=function(t){function e(e,i){var n=t.call(this,e,i)||this;return n._xAxisView=new eH(n),n._overlayXAxisView=new eG(n),n._crosshairVerticalLabelView=new ej(n),n.getContainer().style.cursor="ew-resize",n.addChild(n._overlayXAxisView),n}return R(e,t),e.prototype.getName=function(){return ea.X_AXIS},e.prototype.updateMain=function(t){this._xAxisView.draw(t)},e.prototype.updateOverlay=function(t){this._overlayXAxisView.draw(t),this._crosshairVerticalLabelView.draw(t)},e}(eu),eZ={default:(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.calcRange=function(){var t=this.getParent().getChart().getChartStore().getTimeScaleStore().getVisibleRange(),e=t.from,i=t.to,n=i-1,o=i-e;return{from:e,to:n,range:o,realFrom:e,realTo:n,realRange:o}},e.prototype.optimalTicks=function(t){var e,i,n=this.getParent().getChart(),o=n.getChartStore(),r=o.getCustomApi().formatDate,a=[],s=t.length,l=o.getDataList();if(s>0){var c=o.getTimeScaleStore().getDateTimeFormat(),u=n.getStyles().xAxis.tickText,h=tx("00-00 00:00",u.size,u.weight,u.family),d=parseInt(t[0].value,10),p=this.convertToPixel(d),g=1;if(s>1){var v=parseInt(t[1].value,10),f=Math.abs(this.convertToPixel(v)-p);f<h&&(g=Math.ceil(h/f))}for(var m=0;m<s;m+=g){var y=parseInt(t[m].value,10),_=l[y].timestamp,x=r(c,_,"HH:mm",k.XAxis);if(0!==m){var S=l[parseInt(t[m-g].value,10)].timestamp;x=null!==(e=this._optimalTickLabel(r,c,_,S))&&void 0!==e?e:x}var C=this.convertToPixel(y);a.push({text:x,coord:C,value:_})}if(1===a.length)a[0].text=r(c,a[0].value,"YYYY-MM-DD HH:mm",k.XAxis);else{var b=a[0].value,w=a[1].value;if(ts(a[2])){var I=a[2].text;/^[0-9]{2}-[0-9]{2}$/.test(I)?a[0].text=r(c,b,"MM-DD",k.XAxis):/^[0-9]{4}-[0-9]{2}$/.test(I)?a[0].text=r(c,b,"YYYY-MM",k.XAxis):/^[0-9]{4}$/.test(I)&&(a[0].text=r(c,b,"YYYY",k.XAxis))}else a[0].text=null!==(i=this._optimalTickLabel(r,c,b,w))&&void 0!==i?i:a[0].text}}return a},e.prototype._optimalTickLabel=function(t,e,i,n){var o=t(e,i,"YYYY",k.XAxis),r=t(e,i,"YYYY-MM",k.XAxis),a=t(e,i,"MM-DD",k.XAxis);return o!==t(e,n,"YYYY",k.XAxis)?o:r!==t(e,n,"YYYY-MM",k.XAxis)?r:a!==t(e,n,"MM-DD",k.XAxis)?a:null},e.prototype.getAutoSize=function(){var t=this.getParent().getChart().getStyles(),e=t.xAxis,i=e.size;if("auto"!==i)return i;var n=t.crosshair,o=0;e.show&&(e.axisLine.show&&(o+=e.axisLine.size),e.tickLine.show&&(o+=e.tickLine.length),e.tickText.show&&(o+=e.tickText.marginStart+e.tickText.marginEnd+e.tickText.size));var r=0;return n.show&&n.vertical.show&&n.vertical.text.show&&(r+=n.vertical.text.paddingTop+n.vertical.text.paddingBottom+2*n.vertical.text.borderSize+n.vertical.text.size),Math.max(o,r)},e.prototype.getSelfBounding=function(){return this.getParent().getMainWidget().getBounding()},e.prototype.convertTimestampFromPixel=function(t){var e=this.getParent().getChart().getChartStore().getTimeScaleStore(),i=e.coordinateToDataIndex(t);return e.dataIndexToTimestamp(i)},e.prototype.convertTimestampToPixel=function(t){var e=this.getParent().getChart().getChartStore().getTimeScaleStore(),i=e.timestampToDataIndex(t);return e.dataIndexToCoordinate(i)},e.prototype.convertFromPixel=function(t){return this.getParent().getChart().getChartStore().getTimeScaleStore().coordinateToDataIndex(t)},e.prototype.convertToPixel=function(t){return this.getParent().getChart().getChartStore().getTimeScaleStore().dataIndexToCoordinate(t)},e.extend=function(t){return function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return R(i,e),i.prototype.createTicks=function(e){return t.createTicks(e)},i}(e)},e})(eO).extend({name:"default",createTicks:function(t){return t.defaultTicks}})},eU=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.createAxisComponent=function(t){var e;return new(null!==(e=eZ[t])&&void 0!==e?e:eZ.default)(this)},e.prototype.createMainWidget=function(t){return new eK(t,this)},e}(eW),eq=function(t){function e(e,i){var n,o,r=t.call(this,e,i)||this;return r._dragFlag=!1,r._dragStartY=0,r._topPaneHeight=0,r._bottomPaneHeight=0,r._pressedMouseMoveEvent=(n=r._pressedTouchMouseMoveEvent,o=0,function(){var t=Date.now();t-o>20&&(n.apply(this,arguments),o=t)}),r.registerEvent("touchStartEvent",r._mouseDownEvent.bind(r)).registerEvent("touchMoveEvent",r._pressedMouseMoveEvent.bind(r)).registerEvent("touchEndEvent",r._mouseUpEvent.bind(r)).registerEvent("mouseDownEvent",r._mouseDownEvent.bind(r)).registerEvent("mouseUpEvent",r._mouseUpEvent.bind(r)).registerEvent("pressedMouseMoveEvent",r._pressedMouseMoveEvent.bind(r)).registerEvent("mouseEnterEvent",r._mouseEnterEvent.bind(r)).registerEvent("mouseLeaveEvent",r._mouseLeaveEvent.bind(r)),r}return R(e,t),e.prototype.getName=function(){return ea.SEPARATOR},e.prototype.checkEventOn=function(){return!0},e.prototype._mouseDownEvent=function(t){this._dragFlag=!0,this._dragStartY=t.pageY;var e=this.getPane();return this._topPaneHeight=e.getTopPane().getBounding().height,this._bottomPaneHeight=e.getBottomPane().getBounding().height,!0},e.prototype._mouseUpEvent=function(){return this._dragFlag=!1,this._mouseLeaveEvent()},e.prototype._pressedTouchMouseMoveEvent=function(t){var e=t.pageY-this._dragStartY,i=this.getPane(),n=i.getTopPane(),o=i.getBottomPane(),r=e<0;if(null!==n&&(null==o?void 0:o.getOptions().dragEnabled)){var a=void 0,s=void 0,l=void 0,c=void 0;r?(a=n,s=o,l=this._topPaneHeight,c=this._bottomPaneHeight):(a=o,s=n,l=this._bottomPaneHeight,c=this._topPaneHeight);var u=a.getOptions().minHeight;if(l>u){var h=Math.max(l-Math.abs(e),u),d=l-h;a.setBounding({height:h}),s.setBounding({height:c+d});var p=i.getChart();p.getChartStore().getActionStore().execute(P.OnPaneDrag,{paneId:i.getId()}),p.adjustPaneViewport(!0,!0,!0,!0,!0)}}return!0},e.prototype._mouseEnterEvent=function(){var t,e=this.getPane(),i=e.getBottomPane();if(null!==(t=null==i?void 0:i.getOptions().dragEnabled)&&void 0!==t&&t){var n=e.getChart().getStyles().separator;return this.getContainer().style.background=n.activeBackgroundColor,!0}return!1},e.prototype._mouseLeaveEvent=function(){return!this._dragFlag&&(this.getContainer().style.background="",!0)},e.prototype.createContainer=function(){return tF("div",{width:"100%",height:"".concat(7,"px"),margin:"0",padding:"0",position:"absolute",top:"-3px",zIndex:"20",boxSizing:"border-box",cursor:"ns-resize"})},e.prototype.updateImp=function(t,e,i){if(4===i||2===i){var n=this.getPane().getChart().getStyles().separator;t.style.top="".concat(-Math.floor((7-n.size)/2),"px"),t.style.height="".concat(7,"px")}},e}(ec),e$=function(t){function e(e,i,n,o,r,a){var s=t.call(this,e,i,n,o)||this;return s.getContainer().style.overflow="",s._topPane=r,s._bottomPane=a,s._separatorWidget=new eq(s.getContainer(),s),s}return R(e,t),e.prototype.setBounding=function(t){return te(this.getBounding(),t),this},e.prototype.getTopPane=function(){return this._topPane},e.prototype.setTopPane=function(t){return this._topPane=t,this},e.prototype.getBottomPane=function(){return this._bottomPane},e.prototype.setBottomPane=function(t){return this._bottomPane=t,this},e.prototype.getWidget=function(){return this._separatorWidget},e.prototype.getImage=function(t){var e=this.getBounding(),i=e.width,n=e.height,o=this.getChart().getStyles().separator,r=tF("canvas",{width:"".concat(i,"px"),height:"".concat(n,"px"),boxSizing:"border-box"}),a=r.getContext("2d"),s=ty(r);return r.width=i*s,r.height=n*s,a.scale(s,s),a.fillStyle=o.color,a.fillRect(0,0,i,n),r},e.prototype.updateImp=function(t,e,i){if(4===t||2===t){var n=this.getChart().getStyles().separator;e.style.backgroundColor=n.color,e.style.height="".concat(i.height,"px"),e.style.marginLeft="".concat(i.left,"px"),e.style.width="".concat(i.width,"px"),this._separatorWidget.update(t)}},e}(ez);function eQ(){var t;return"undefined"!=typeof window&&(null!==(t=window.navigator.userAgent.toLowerCase().indexOf("firefox"))&&void 0!==t?t:-1)>-1}function eJ(){return"undefined"!=typeof window&&/iPhone|iPad|iPod/.test(window.navigator.platform)}var e0=function(){function t(t,e,i){var n=this;this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY},this._longTapTimeoutId=null,this._longTapActive=!1,this._mouseMoveStartCoordinate=null,this._touchMoveStartCoordinate=null,this._touchMoveExceededManhattanDistance=!1,this._cancelClick=!1,this._cancelTap=!1,this._unsubscribeOutsideMouseEvents=null,this._unsubscribeOutsideTouchEvents=null,this._unsubscribeMobileSafariEvents=null,this._unsubscribeMousemove=null,this._unsubscribeMouseWheel=null,this._unsubscribeContextMenu=null,this._unsubscribeRootMouseEvents=null,this._unsubscribeRootTouchEvents=null,this._startPinchMiddleCoordinate=null,this._startPinchDistance=0,this._pinchPrevented=!1,this._preventTouchDragProcess=!1,this._mousePressed=!1,this._lastTouchEventTimeStamp=0,this._activeTouchId=null,this._acceptMouseLeave=!eJ(),this._onFirefoxOutsideMouseUp=function(t){n._mouseUpHandler(t)},this._onMobileSafariDoubleClick=function(t){if(n._firesTouchEvents(t)){if(++n._tapCount,null!==n._tapTimeoutId&&n._tapCount>1){var e=n._mouseTouchMoveWithDownInfo(n._getCoordinate(t),n._tapCoordinate).manhattanDistance;e<30&&!n._cancelTap&&n._processEvent(n._makeCompatEvent(t),n._handler.doubleTapEvent),n._resetTapTimeout()}}else if(++n._clickCount,null!==n._clickTimeoutId&&n._clickCount>1){var e=n._mouseTouchMoveWithDownInfo(n._getCoordinate(t),n._clickCoordinate).manhattanDistance;e<5&&!n._cancelClick&&n._processEvent(n._makeCompatEvent(t),n._handler.mouseDoubleClickEvent),n._resetClickTimeout()}},this._target=t,this._handler=e,this._options=i,this._init()}return t.prototype.destroy=function(){null!==this._unsubscribeOutsideMouseEvents&&(this._unsubscribeOutsideMouseEvents(),this._unsubscribeOutsideMouseEvents=null),null!==this._unsubscribeOutsideTouchEvents&&(this._unsubscribeOutsideTouchEvents(),this._unsubscribeOutsideTouchEvents=null),null!==this._unsubscribeMousemove&&(this._unsubscribeMousemove(),this._unsubscribeMousemove=null),null!==this._unsubscribeMouseWheel&&(this._unsubscribeMouseWheel(),this._unsubscribeMouseWheel=null),null!==this._unsubscribeContextMenu&&(this._unsubscribeContextMenu(),this._unsubscribeContextMenu=null),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null),null!==this._unsubscribeMobileSafariEvents&&(this._unsubscribeMobileSafariEvents(),this._unsubscribeMobileSafariEvents=null),this._clearLongTapTimeout(),this._resetClickTimeout()},t.prototype._mouseEnterHandler=function(t){var e,i,n,o=this;null===(e=this._unsubscribeMousemove)||void 0===e||e.call(this),null===(i=this._unsubscribeMouseWheel)||void 0===i||i.call(this),null===(n=this._unsubscribeContextMenu)||void 0===n||n.call(this);var r=this._mouseMoveHandler.bind(this);this._unsubscribeMousemove=function(){o._target.removeEventListener("mousemove",r)},this._target.addEventListener("mousemove",r);var a=this._mouseWheelHandler.bind(this);this._unsubscribeMouseWheel=function(){o._target.removeEventListener("wheel",a)},this._target.addEventListener("wheel",a,{passive:!1});var s=this._contextMenuHandler.bind(this);this._unsubscribeContextMenu=function(){o._target.removeEventListener("contextmenu",s)},this._target.addEventListener("contextmenu",s,{passive:!1}),this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseEnterEvent),this._acceptMouseLeave=!0)},t.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null,this._clickCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},t.prototype._resetTapTimeout=function(){null!==this._tapTimeoutId&&clearTimeout(this._tapTimeoutId),this._tapCount=0,this._tapTimeoutId=null,this._tapCoordinate={x:Number.NEGATIVE_INFINITY,y:Number.POSITIVE_INFINITY}},t.prototype._mouseMoveHandler=function(t){this._mousePressed||null!==this._touchMoveStartCoordinate||this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseMoveEvent),this._acceptMouseLeave=!0)},t.prototype._mouseWheelHandler=function(t){if(Math.abs(t.deltaX)>Math.abs(t.deltaY))ts(this._handler.mouseWheelHortEvent)&&(this._preventDefault(t),0!==Math.abs(t.deltaX)&&this._handler.mouseWheelHortEvent(this._makeCompatEvent(t),-t.deltaX));else{if(!ts(this._handler.mouseWheelVertEvent))return;var e=-(t.deltaY/100);if(0===e)return;switch(this._preventDefault(t),t.deltaMode){case t.DOM_DELTA_PAGE:e*=120;break;case t.DOM_DELTA_LINE:e*=32}if(0!==e){var i=Math.sign(e)*Math.min(1,Math.abs(e));this._handler.mouseWheelVertEvent(this._makeCompatEvent(t),i)}}},t.prototype._contextMenuHandler=function(t){this._preventDefault(t)},t.prototype._touchMoveHandler=function(t){var e=this._touchWithId(t.changedTouches,this._activeTouchId);if(null!==e&&(this._lastTouchEventTimeStamp=this._eventTimeStamp(t),null===this._startPinchMiddleCoordinate&&!this._preventTouchDragProcess)){this._pinchPrevented=!0;var i=this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._touchMoveStartCoordinate),n=i.xOffset,o=i.yOffset,r=i.manhattanDistance;if(this._touchMoveExceededManhattanDistance||!(r<5)){if(!this._touchMoveExceededManhattanDistance){var a=.5*n,s=o>=a&&!this._options.treatVertDragAsPageScroll(),l=a>o&&!this._options.treatHorzDragAsPageScroll();s||l||(this._preventTouchDragProcess=!0),this._touchMoveExceededManhattanDistance=!0,this._cancelTap=!0,this._clearLongTapTimeout(),this._resetTapTimeout()}this._preventTouchDragProcess||this._processEvent(this._makeCompatEvent(t,e),this._handler.touchMoveEvent)}}},t.prototype._mouseMoveWithDownHandler=function(t){0===t.button&&(this._mouseTouchMoveWithDownInfo(this._getCoordinate(t),this._mouseMoveStartCoordinate).manhattanDistance>=5&&(this._cancelClick=!0,this._resetClickTimeout()),this._cancelClick&&this._processEvent(this._makeCompatEvent(t),this._handler.pressedMouseMoveEvent))},t.prototype._mouseTouchMoveWithDownInfo=function(t,e){var i=Math.abs(e.x-t.x),n=Math.abs(e.y-t.y);return{xOffset:i,yOffset:n,manhattanDistance:i+n}},t.prototype._touchEndHandler=function(t){var e=this._touchWithId(t.changedTouches,this._activeTouchId);if(null===e&&0===t.touches.length&&(e=t.changedTouches[0]),null!==e){this._activeTouchId=null,this._lastTouchEventTimeStamp=this._eventTimeStamp(t),this._clearLongTapTimeout(),this._touchMoveStartCoordinate=null,null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var i=this._makeCompatEvent(t,e);this._processEvent(i,this._handler.touchEndEvent),++this._tapCount,null!==this._tapTimeoutId&&this._tapCount>1?(this._mouseTouchMoveWithDownInfo(this._getCoordinate(e),this._tapCoordinate).manhattanDistance<30&&!this._cancelTap&&this._processEvent(i,this._handler.doubleTapEvent),this._resetTapTimeout()):!this._cancelTap&&(this._processEvent(i,this._handler.tapEvent),ts(this._handler.tapEvent)&&this._preventDefault(t)),0===this._tapCount&&this._preventDefault(t),0===t.touches.length&&this._longTapActive&&(this._longTapActive=!1,this._preventDefault(t))}},t.prototype._mouseUpHandler=function(t){if(0===t.button){var e=this._makeCompatEvent(t);this._mouseMoveStartCoordinate=null,this._mousePressed=!1,null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null),eQ()&&this._target.ownerDocument.documentElement.removeEventListener("mouseleave",this._onFirefoxOutsideMouseUp),!this._firesTouchEvents(t)&&(this._processEvent(e,this._handler.mouseUpEvent),++this._clickCount,null!==this._clickTimeoutId&&this._clickCount>1?(this._mouseTouchMoveWithDownInfo(this._getCoordinate(t),this._clickCoordinate).manhattanDistance<5&&!this._cancelClick&&this._processEvent(e,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(e,this._handler.mouseClickEvent))}},t.prototype._clearLongTapTimeout=function(){null!==this._longTapTimeoutId&&(clearTimeout(this._longTapTimeoutId),this._longTapTimeoutId=null)},t.prototype._touchStartHandler=function(t){if(null===this._activeTouchId){var e=t.changedTouches[0];this._activeTouchId=e.identifier,this._lastTouchEventTimeStamp=this._eventTimeStamp(t);var i=this._target.ownerDocument.documentElement;this._cancelTap=!1,this._touchMoveExceededManhattanDistance=!1,this._preventTouchDragProcess=!1,this._touchMoveStartCoordinate=this._getCoordinate(e),null!==this._unsubscribeRootTouchEvents&&(this._unsubscribeRootTouchEvents(),this._unsubscribeRootTouchEvents=null);var n=this._touchMoveHandler.bind(this),o=this._touchEndHandler.bind(this);this._unsubscribeRootTouchEvents=function(){i.removeEventListener("touchmove",n),i.removeEventListener("touchend",o)},i.addEventListener("touchmove",n,{passive:!1}),i.addEventListener("touchend",o,{passive:!1}),this._clearLongTapTimeout(),this._longTapTimeoutId=setTimeout(this._longTapHandler.bind(this,t),500),this._processEvent(this._makeCompatEvent(t,e),this._handler.touchStartEvent),null===this._tapTimeoutId&&(this._tapCount=0,this._tapTimeoutId=setTimeout(this._resetTapTimeout.bind(this),500),this._tapCoordinate=this._getCoordinate(e))}},t.prototype._mouseDownHandler=function(t){if(2===t.button){this._preventDefault(t),this._processEvent(this._makeCompatEvent(t),this._handler.mouseRightClickEvent);return}if(0===t.button){var e=this._target.ownerDocument.documentElement;eQ()&&e.addEventListener("mouseleave",this._onFirefoxOutsideMouseUp),this._cancelClick=!1,this._mouseMoveStartCoordinate=this._getCoordinate(t),null!==this._unsubscribeRootMouseEvents&&(this._unsubscribeRootMouseEvents(),this._unsubscribeRootMouseEvents=null);var i=this._mouseMoveWithDownHandler.bind(this),n=this._mouseUpHandler.bind(this);this._unsubscribeRootMouseEvents=function(){e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",n)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",n),this._mousePressed=!0,this._firesTouchEvents(t)||(this._processEvent(this._makeCompatEvent(t),this._handler.mouseDownEvent),null===this._clickTimeoutId&&(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500),this._clickCoordinate=this._getCoordinate(t)))}},t.prototype._init=function(){var t=this;this._target.addEventListener("mouseenter",this._mouseEnterHandler.bind(this)),this._target.addEventListener("touchcancel",this._clearLongTapTimeout.bind(this));var e=this._target.ownerDocument,i=function(e){null==t._handler.mouseDownOutsideEvent||e.composed&&t._target.contains(e.composedPath()[0])||null!==e.target&&t._target.contains(e.target)||t._handler.mouseDownOutsideEvent({x:0,y:0,pageX:0,pageY:0})};this._unsubscribeOutsideTouchEvents=function(){e.removeEventListener("touchstart",i)},this._unsubscribeOutsideMouseEvents=function(){e.removeEventListener("mousedown",i)},e.addEventListener("mousedown",i),e.addEventListener("touchstart",i,{passive:!0}),eJ()&&(this._unsubscribeMobileSafariEvents=function(){t._target.removeEventListener("dblclick",t._onMobileSafariDoubleClick)},this._target.addEventListener("dblclick",this._onMobileSafariDoubleClick)),this._target.addEventListener("mouseleave",this._mouseLeaveHandler.bind(this)),this._target.addEventListener("touchstart",this._touchStartHandler.bind(this),{passive:!0}),this._target.addEventListener("mousedown",function(t){if(1===t.button)return t.preventDefault(),!1}),this._target.addEventListener("mousedown",this._mouseDownHandler.bind(this)),this._initPinch(),this._target.addEventListener("touchmove",function(){},{passive:!1})},t.prototype._initPinch=function(){var t=this;(ts(this._handler.pinchStartEvent)||ts(this._handler.pinchEvent)||ts(this._handler.pinchEndEvent))&&(this._target.addEventListener("touchstart",function(e){t._checkPinchState(e.touches)},{passive:!0}),this._target.addEventListener("touchmove",function(e){if(2===e.touches.length&&null!==t._startPinchMiddleCoordinate&&ts(t._handler.pinchEvent)){var i=t._getTouchDistance(e.touches[0],e.touches[1])/t._startPinchDistance;t._handler.pinchEvent(B(B({},t._startPinchMiddleCoordinate),{pageX:0,pageY:0}),i),t._preventDefault(e)}},{passive:!1}),this._target.addEventListener("touchend",function(e){t._checkPinchState(e.touches)}))},t.prototype._checkPinchState=function(t){1===t.length&&(this._pinchPrevented=!1),2!==t.length||this._pinchPrevented||this._longTapActive?this._stopPinch():this._startPinch(t)},t.prototype._startPinch=function(t){var e,i=null!==(e=this._target.getBoundingClientRect())&&void 0!==e?e:{left:0,top:0};this._startPinchMiddleCoordinate={x:(t[0].clientX-i.left+(t[1].clientX-i.left))/2,y:(t[0].clientY-i.top+(t[1].clientY-i.top))/2},this._startPinchDistance=this._getTouchDistance(t[0],t[1]),ts(this._handler.pinchStartEvent)&&this._handler.pinchStartEvent({x:0,y:0,pageX:0,pageY:0}),this._clearLongTapTimeout()},t.prototype._stopPinch=function(){null!==this._startPinchMiddleCoordinate&&(this._startPinchMiddleCoordinate=null,ts(this._handler.pinchEndEvent)&&this._handler.pinchEndEvent({x:0,y:0,pageX:0,pageY:0}))},t.prototype._mouseLeaveHandler=function(t){var e,i,n;null===(e=this._unsubscribeMousemove)||void 0===e||e.call(this),null===(i=this._unsubscribeMouseWheel)||void 0===i||i.call(this),null===(n=this._unsubscribeContextMenu)||void 0===n||n.call(this),!this._firesTouchEvents(t)&&this._acceptMouseLeave&&(this._processEvent(this._makeCompatEvent(t),this._handler.mouseLeaveEvent),this._acceptMouseLeave=!eJ())},t.prototype._longTapHandler=function(t){var e=this._touchWithId(t.touches,this._activeTouchId);null!==e&&(this._processEvent(this._makeCompatEvent(t,e),this._handler.longTapEvent),this._cancelTap=!0,this._longTapActive=!0)},t.prototype._firesTouchEvents=function(t){var e;return ts(null===(e=t.sourceCapabilities)||void 0===e?void 0:e.firesTouchEvents)?t.sourceCapabilities.firesTouchEvents:this._eventTimeStamp(t)<this._lastTouchEventTimeStamp+500},t.prototype._processEvent=function(t,e){null==e||e.call(this._handler,t)},t.prototype._makeCompatEvent=function(t,e){var i,n=this,o=null!=e?e:t,r=null!==(i=this._target.getBoundingClientRect())&&void 0!==i?i:{left:0,top:0};return{x:o.clientX-r.left,y:o.clientY-r.top,pageX:o.pageX,pageY:o.pageY,isTouch:!t.type.startsWith("mouse")&&"contextmenu"!==t.type&&"click"!==t.type&&"wheel"!==t.type,preventDefault:function(){"touchstart"!==t.type&&n._preventDefault(t)}}},t.prototype._getTouchDistance=function(t,e){var i=t.clientX-e.clientX,n=t.clientY-e.clientY;return Math.sqrt(i*i+n*n)},t.prototype._preventDefault=function(t){t.cancelable&&t.preventDefault()},t.prototype._getCoordinate=function(t){return{x:t.pageX,y:t.pageY}},t.prototype._eventTimeStamp=function(t){var e;return null!==(e=t.timeStamp)&&void 0!==e?e:performance.now()},t.prototype._touchWithId=function(t,e){for(var i=0;i<t.length;++i)if(t[i].identifier===e)return t[i];return null},t}(),e1=function(){function t(t,e){var i=this;this._flingStartTime=new Date().getTime(),this._flingScrollRequestId=null,this._startScrollCoordinate=null,this._touchCoordinate=null,this._touchCancelCrosshair=!1,this._touchZoomed=!1,this._pinchScale=1,this._mouseDownWidget=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0,this._mouseMoveTriggerWidgetInfo={pane:null,widget:null},this._boundKeyBoardDownEvent=function(t){if(t.shiftKey)switch(t.code){case"Equal":i._chart.getChartStore().getTimeScaleStore().zoom(.5);break;case"Minus":i._chart.getChartStore().getTimeScaleStore().zoom(-.5);break;case"ArrowLeft":var e=i._chart.getChartStore().getTimeScaleStore();e.startScroll(),e.scroll(-3*e.getBarSpace().bar);break;case"ArrowRight":var e=i._chart.getChartStore().getTimeScaleStore();e.startScroll(),e.scroll(3*e.getBarSpace().bar)}},this._container=t,this._chart=e,this._event=new e0(t,this,{treatVertDragAsPageScroll:function(){return!1},treatHorzDragAsPageScroll:function(){return!1}}),t.addEventListener("keydown",this._boundKeyBoardDownEvent)}return t.prototype.pinchStartEvent=function(){return this._touchZoomed=!0,this._pinchScale=1,!0},t.prototype.pinchEvent=function(t,e){var i=this._findWidgetByEvent(t),n=i.pane,o=i.widget;if((null==n?void 0:n.getId())!==et.X_AXIS&&(null==o?void 0:o.getName())===ea.MAIN){var r=this._makeWidgetEvent(t,o),a=(e-this._pinchScale)*5;return this._pinchScale=e,this._chart.getChartStore().getTimeScaleStore().zoom(a,{x:r.x,y:r.y}),!0}return!1},t.prototype.mouseWheelHortEvent=function(t,e){var i=this._chart.getChartStore().getTimeScaleStore();return i.startScroll(),i.scroll(e),!0},t.prototype.mouseWheelVertEvent=function(t,e){var i=this._findWidgetByEvent(t).widget,n=this._makeWidgetEvent(t,i);return(null==i?void 0:i.getName())===ea.MAIN&&(this._chart.getChartStore().getTimeScaleStore().zoom(e,{x:n.x,y:n.y}),!0)},t.prototype.mouseDownEvent=function(t){var e,i,n=this._findWidgetByEvent(t),o=n.pane,r=n.widget;if(this._mouseDownWidget=r,null!==r){var a=this._makeWidgetEvent(t,r);switch(r.getName()){case ea.SEPARATOR:return r.dispatchEvent("mouseDownEvent",a);case ea.MAIN:var s=null!==(e=o.getAxisComponent().getRange())&&void 0!==e?e:null;return this._prevYAxisRange=null===s?s:B({},s),this._startScrollCoordinate={x:a.x,y:a.y},this._chart.getChartStore().getTimeScaleStore().startScroll(),r.dispatchEvent("mouseDownEvent",a);case ea.X_AXIS:var l=r.dispatchEvent("mouseDownEvent",a);return l&&this._chart.updatePane(1),this._xAxisStartScaleCoordinate={x:a.x,y:a.y},this._xAxisStartScaleDistance=a.pageX,l;case ea.Y_AXIS:var l=r.dispatchEvent("mouseDownEvent",a);l&&this._chart.updatePane(1);var s=null!==(i=o.getAxisComponent().getRange())&&void 0!==i?i:null;return this._prevYAxisRange=null===s?s:B({},s),this._yAxisStartScaleDistance=a.pageY,l}}return!1},t.prototype.mouseMoveEvent=function(t){var e,i,n,o=this._findWidgetByEvent(t),r=o.pane,a=o.widget,s=this._makeWidgetEvent(t,a);if(((null===(e=this._mouseMoveTriggerWidgetInfo.pane)||void 0===e?void 0:e.getId())!==(null==r?void 0:r.getId())||(null===(i=this._mouseMoveTriggerWidgetInfo.widget)||void 0===i?void 0:i.getName())!==(null==a?void 0:a.getName()))&&(null==a||a.dispatchEvent("mouseEnterEvent",s),null===(n=this._mouseMoveTriggerWidgetInfo.widget)||void 0===n||n.dispatchEvent("mouseLeaveEvent",s),this._mouseMoveTriggerWidgetInfo={pane:r,widget:a}),null!==a)switch(a.getName()){case ea.MAIN:var l=a.dispatchEvent("mouseMoveEvent",s),c=this._chart.getChartStore(),u={x:s.x,y:s.y,paneId:null==r?void 0:r.getId()};return l&&null!==c.getTooltipStore().getActiveIcon()&&(u=void 0,null!==a&&(a.getContainer().style.cursor="pointer")),this._chart.getChartStore().getTooltipStore().setCrosshair(u),l;case ea.SEPARATOR:case ea.X_AXIS:case ea.Y_AXIS:var l=a.dispatchEvent("mouseMoveEvent",s);return this._chart.getChartStore().getTooltipStore().setCrosshair(),l}return!1},t.prototype.pressedMouseMoveEvent=function(t){if(null!==this._mouseDownWidget&&this._mouseDownWidget.getName()===ea.SEPARATOR)return this._mouseDownWidget.dispatchEvent("pressedMouseMoveEvent",t);var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n&&(null===(l=this._mouseDownWidget)||void 0===l?void 0:l.getPane().getId())===(null==i?void 0:i.getId())&&(null===(c=this._mouseDownWidget)||void 0===c?void 0:c.getName())===n.getName()){var o=this._makeWidgetEvent(t,n);switch(n.getName()){case ea.MAIN:var r=n.getBounding(),a=n.dispatchEvent("pressedMouseMoveEvent",o);if(!a&&null!==this._startScrollCoordinate){var s=i.getAxisComponent();if(null!==this._prevYAxisRange&&!s.getAutoCalcTickFlag()&&s.getScrollZoomEnabled()){var l,c,u,h,d,p=this._prevYAxisRange,g=p.from,v=p.to,f=p.range,m=(null!==(u=null==s?void 0:s.isReverse())&&void 0!==u&&u?this._startScrollCoordinate.y-o.y:o.y-this._startScrollCoordinate.y)/r.height,y=f*m,_=g+y,x=v+y,S=s.convertToRealValue(_),C=s.convertToRealValue(x);s.setRange({from:_,to:x,range:x-_,realFrom:S,realTo:C,realRange:C-S})}var b=o.x-this._startScrollCoordinate.x;this._chart.getChartStore().getTimeScaleStore().scroll(b)}return this._chart.getChartStore().getTooltipStore().setCrosshair({x:o.x,y:o.y,paneId:null==i?void 0:i.getId()}),a;case ea.X_AXIS:var a=n.dispatchEvent("pressedMouseMoveEvent",o);if(a)this._chart.updatePane(1);else{var w=i.getAxisComponent();if(null===(h=null==w?void 0:w.getScrollZoomEnabled())||void 0===h||h){var m=this._xAxisStartScaleDistance/o.pageX;if(Number.isFinite(m)){var I=(m-this._xAxisScale)*10;this._xAxisScale=m,this._chart.getChartStore().getTimeScaleStore().zoom(I,null!==(d=this._xAxisStartScaleCoordinate)&&void 0!==d?d:void 0)}}}return a;case ea.Y_AXIS:var a=n.dispatchEvent("pressedMouseMoveEvent",o);if(a)this._chart.updatePane(1);else{var s=i.getAxisComponent();if(null!==this._prevYAxisRange&&s.getScrollZoomEnabled()){var E=this._prevYAxisRange,g=E.from,v=E.to,f=E.range,m=o.pageY/this._yAxisStartScaleDistance,T=f*m,y=(T-f)/2,_=g-y,x=v+y,S=s.convertToRealValue(_),C=s.convertToRealValue(x);s.setRange({from:_,to:x,range:T,realFrom:S,realTo:C,realRange:C-S}),this._chart.adjustPaneViewport(!1,!0,!0,!0)}}return a}}return!1},t.prototype.mouseUpEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var n=this._makeWidgetEvent(t,e);switch(e.getName()){case ea.MAIN:case ea.SEPARATOR:case ea.X_AXIS:case ea.Y_AXIS:i=e.dispatchEvent("mouseUpEvent",n)}i&&this._chart.updatePane(1)}return this._mouseDownWidget=null,this._startScrollCoordinate=null,this._prevYAxisRange=null,this._xAxisStartScaleCoordinate=null,this._xAxisStartScaleDistance=0,this._xAxisScale=1,this._yAxisStartScaleDistance=0,i},t.prototype.mouseClickEvent=function(t){var e=this._findWidgetByEvent(t).widget;if(null!==e){var i=this._makeWidgetEvent(t,e);return e.dispatchEvent("mouseClickEvent",i)}return!1},t.prototype.mouseRightClickEvent=function(t){var e=this._findWidgetByEvent(t).widget,i=!1;if(null!==e){var n=this._makeWidgetEvent(t,e);switch(e.getName()){case ea.MAIN:case ea.X_AXIS:case ea.Y_AXIS:i=e.dispatchEvent("mouseRightClickEvent",n)}i&&this._chart.updatePane(1)}return!1},t.prototype.mouseDoubleClickEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n)switch(n.getName()){case ea.MAIN:var o=this._makeWidgetEvent(t,n);return n.dispatchEvent("mouseDoubleClickEvent",o);case ea.Y_AXIS:var r=i.getAxisComponent();if(!r.getAutoCalcTickFlag())return r.setAutoCalcTickFlag(!0),this._chart.adjustPaneViewport(!1,!0,!0,!0),!0}return!1},t.prototype.mouseLeaveEvent=function(){return this._chart.getChartStore().getTooltipStore().setCrosshair(),!0},t.prototype.touchStartEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n){var o=this._makeWidgetEvent(t,n);switch(n.getName()){case ea.MAIN:var r=this._chart.getChartStore(),a=r.getTooltipStore();if(n.dispatchEvent("mouseDownEvent",o))return this._touchCancelCrosshair=!0,this._touchCoordinate=null,a.setCrosshair(void 0,!0),this._chart.updatePane(1),!0;if(null!==this._flingScrollRequestId&&(tP(this._flingScrollRequestId),this._flingScrollRequestId=null),this._flingStartTime=new Date().getTime(),this._startScrollCoordinate={x:o.x,y:o.y},r.getTimeScaleStore().startScroll(),this._touchZoomed=!1,null!==this._touchCoordinate){var s=o.x-this._touchCoordinate.x,l=o.y-this._touchCoordinate.y;10>Math.sqrt(s*s+l*l)?(this._touchCoordinate={x:o.x,y:o.y},a.setCrosshair({x:o.x,y:o.y,paneId:null==i?void 0:i.getId()})):(this._touchCoordinate=null,this._touchCancelCrosshair=!0,a.setCrosshair())}return!0;case ea.X_AXIS:case ea.Y_AXIS:var c=n.dispatchEvent("mouseDownEvent",o);return c&&this._chart.updatePane(1),c}}return!1},t.prototype.touchMoveEvent=function(t){var e,i,n,o=this._findWidgetByEvent(t),r=o.pane,a=o.widget;if(null!==a){var s=this._makeWidgetEvent(t,a),l=a.getName(),c=this._chart.getChartStore(),u=c.getTooltipStore();switch(l){case ea.MAIN:if(a.dispatchEvent("pressedMouseMoveEvent",s))return null===(e=s.preventDefault)||void 0===e||e.call(s),u.setCrosshair(void 0,!0),this._chart.updatePane(1),!0;if(null!==this._touchCoordinate)null===(i=s.preventDefault)||void 0===i||i.call(s),u.setCrosshair({x:s.x,y:s.y,paneId:null==r?void 0:r.getId()});else if(null!==this._startScrollCoordinate&&Math.abs(this._startScrollCoordinate.x-s.x)>this._startScrollCoordinate.y-s.y){var h=s.x-this._startScrollCoordinate.x;c.getTimeScaleStore().scroll(h)}return!0;case ea.X_AXIS:case ea.Y_AXIS:var d=a.dispatchEvent("pressedMouseMoveEvent",s);return d&&(null===(n=s.preventDefault)||void 0===n||n.call(s),this._chart.updatePane(1)),d}}return!1},t.prototype.touchEndEvent=function(t){var e=this,i=this._findWidgetByEvent(t).widget;if(null!==i){var n=this._makeWidgetEvent(t,i);switch(i.getName()){case ea.MAIN:if(i.dispatchEvent("mouseUpEvent",n),null!==this._startScrollCoordinate){var o=new Date().getTime()-this._flingStartTime,r=(n.x-this._startScrollCoordinate.x)/(o>0?o:1)*20;if(o<200&&Math.abs(r)>0){var a=this._chart.getChartStore().getTimeScaleStore(),s=function(){e._flingScrollRequestId=tT(function(){a.startScroll(),a.scroll(r),1>Math.abs(r*=.975)?null!==e._flingScrollRequestId&&(tP(e._flingScrollRequestId),e._flingScrollRequestId=null):s()})};s()}}return!0;case ea.X_AXIS:case ea.Y_AXIS:i.dispatchEvent("mouseUpEvent",n)&&this._chart.updatePane(1)}}return!1},t.prototype.tapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget,o=!1;if(null!==n){var r=this._makeWidgetEvent(t,n),a=n.dispatchEvent("mouseClickEvent",r);if(n.getName()===ea.MAIN){var s=this._makeWidgetEvent(t,n),l=this._chart.getChartStore().getTooltipStore();a?(this._touchCancelCrosshair=!0,this._touchCoordinate=null,l.setCrosshair(void 0,!0),o=!0):(this._touchCancelCrosshair||this._touchZoomed||(this._touchCoordinate={x:s.x,y:s.y},l.setCrosshair({x:s.x,y:s.y,paneId:null==i?void 0:i.getId()},!0),o=!0),this._touchCancelCrosshair=!1)}(o||a)&&this._chart.updatePane(1)}return o},t.prototype.doubleTapEvent=function(t){return this.mouseDoubleClickEvent(t)},t.prototype.longTapEvent=function(t){var e=this._findWidgetByEvent(t),i=e.pane,n=e.widget;if(null!==n&&n.getName()===ea.MAIN){var o=this._makeWidgetEvent(t,n);return this._touchCoordinate={x:o.x,y:o.y},this._chart.getChartStore().getTooltipStore().setCrosshair({x:o.x,y:o.y,paneId:null==i?void 0:i.getId()}),!0}return!1},t.prototype._findWidgetByEvent=function(t){var e,i,n,o,r=t.x,a=t.y,s=this._chart.getAllSeparatorPanes(),l=this._chart.getChartStore().getStyles().separator.size;try{for(var c=V(s),u=c.next();!u.done;u=c.next()){var h=z(u.value,2)[1],d=h.getBounding(),p=d.top-Math.round((7-l)/2);if(r>=d.left&&r<=d.left+d.width&&a>=p&&a<=p+7)return{pane:h,widget:h.getWidget()}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}var g=this._chart.getAllDrawPanes(),v=null;try{for(var f=V(g),m=f.next();!m.done;m=f.next()){var y=m.value,d=y.getBounding();if(r>=d.left&&r<=d.left+d.width&&a>=d.top&&a<=d.top+d.height){v=y;break}}}catch(t){n={error:t}}finally{try{m&&!m.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}var _=null;if(null!==v){if(null===_){var x=v.getMainWidget(),S=x.getBounding();r>=S.left&&r<=S.left+S.width&&a>=S.top&&a<=S.top+S.height&&(_=x)}if(null===_){var C=v.getYAxisWidget();if(null!==C){var b=C.getBounding();r>=b.left&&r<=b.left+b.width&&a>=b.top&&a<=b.top+b.height&&(_=C)}}}return{pane:v,widget:_}},t.prototype._makeWidgetEvent=function(t,e){var i,n,o,r=null!==(i=null==e?void 0:e.getBounding())&&void 0!==i?i:null;return B(B({},t),{x:t.x-(null!==(n=null==r?void 0:r.left)&&void 0!==n?n:0),y:t.y-(null!==(o=null==r?void 0:r.top)&&void 0!==o?o:0)})},t.prototype.destroy=function(){this._container.removeEventListener("keydown",this._boundKeyBoardDownEvent),this._event.destroy()},t}();(m=F||(F={})).Root="root",m.Main="main",m.YAxis="yAxis";var e2=function(){function t(t,e){this._drawPanes=[],this._separatorPanes=new Map,this._initContainer(t),this._chartEvent=new e1(this._chartContainer,this),this._chartStore=new er(this,e),this._initPanes(e),this.adjustPaneViewport(!0,!0,!0)}return t.prototype._initContainer=function(t){this._container=t,this._chartContainer=tF("div",{position:"relative",width:"100%",outline:"none",borderStyle:"none",cursor:"crosshair",boxSizing:"border-box",userSelect:"none",webkitUserSelect:"none",msUserSelect:"none",MozUserSelect:"none",webkitTapHighlightColor:"transparent"}),this._chartContainer.tabIndex=1,t.appendChild(this._chartContainer)},t.prototype._initPanes=function(t){var e,i=this,n=null!==(e=null==t?void 0:t.layout)&&void 0!==e?e:[{type:"candle"}],o=!1,r=!1,a=function(t){if(!r){var e=i._createPane(eU,et.X_AXIS,null!=t?t:{});i._xAxisPane=e,r=!0}};n.forEach(function(t){var e,n,r;switch(t.type){case"candle":if(!o){var s=null!==(e=t.options)&&void 0!==e?e:{};te(s,{id:et.CANDLE}),i._candlePane=i._createPane(eY,et.CANDLE,s);var l=null!==(n=t.content)&&void 0!==n?n:[];l.forEach(function(t){i.createIndicator(t,!0,s)}),o=!0}break;case"indicator":var c,l=null!==(r=t.content)&&void 0!==r?r:[];l.length>0&&l.forEach(function(e){ts(c)?i.createIndicator(e,!0,{id:c}):c=i.createIndicator(e,!0,t.options)});break;case"xAxis":a(t.options)}}),a({position:"bottom"})},t.prototype._createPane=function(t,e,i){var n,o=null,r=null;switch(null==i?void 0:i.position){case"top":var a=this._drawPanes[0];ts(a)&&(r=new t(this._chartContainer,a.getContainer(),this,e,null!=i?i:{}),o=0);break;case"bottom":break;default:for(var s=this._drawPanes.length-1;s>-1;s--){var l=this._drawPanes[s],c=this._drawPanes[s-1];if((null==l?void 0:l.getOptions().position)==="bottom"&&(null==c?void 0:c.getOptions().position)!=="bottom"){r=new t(this._chartContainer,l.getContainer(),this,e,null!=i?i:{}),o=s;break}}}if(ts(r)||(r=new t(this._chartContainer,null,this,e,null!=i?i:{})),ta(o)?(this._drawPanes.splice(o,0,r),n=o):(this._drawPanes.push(r),n=this._drawPanes.length-1),r.getId()!==et.X_AXIS){var u=this._drawPanes[n+1];if(ts(u)&&u.getId()===et.X_AXIS&&(u=this._drawPanes[n+2]),ts(u)){var h=this._separatorPanes.get(u);ts(h)?h.setTopPane(r):(h=new e$(this._chartContainer,u.getContainer(),this,"",r,u),this._separatorPanes.set(u,h))}var d=this._drawPanes[n-1];if(ts(d)&&d.getId()===et.X_AXIS&&(d=this._drawPanes[n-2]),ts(d)){var h=new e$(this._chartContainer,r.getContainer(),this,"",d,r);this._separatorPanes.set(r,h)}}return r},t.prototype._measurePaneHeight=function(){var t,e=this,i=Math.floor(this._container.clientHeight),n=this._chartStore.getStyles().separator.size,o=this._xAxisPane.getAxisComponent().getAutoSize(),r=i-o-this._separatorPanes.size*n;r<0&&(r=0);var a=0;this._drawPanes.forEach(function(t){if(t.getId()!==et.CANDLE&&t.getId()!==et.X_AXIS){var e=t.getBounding().height,i=t.getOptions().minHeight;e<i&&(e=i),a+e>r?(a=r,e=Math.max(r-a,0)):a+=e,t.setBounding({height:e})}});var s=r-a;null===(t=this._candlePane)||void 0===t||t.setBounding({height:s}),this._xAxisPane.setBounding({height:o});var l=0;this._drawPanes.forEach(function(t){var i=e._separatorPanes.get(t);ts(i)&&(i.setBounding({height:n,top:l}),l+=n),t.setBounding({top:l}),l+=t.getBounding().height})},t.prototype._measurePaneWidth=function(){var t,e=this,i=Math.floor(this._container.clientWidth),n=this._chartStore.getStyles(),o=n.yAxis,r=o.position===I.Left,a=!o.inside,s=0,l=0,c=0,u=0;this._drawPanes.forEach(function(t){t.getId()!==et.X_AXIS&&(l=Math.max(l,t.getAxisComponent().getAutoSize()))}),l>i&&(l=i),a?(s=i-l,r?(c=0,u=l):(c=i-l,u=0)):(s=i,u=0,c=r?0:i-l),this._chartStore.getTimeScaleStore().setTotalBarSpace(s);var h={width:i},d={width:s,left:u},p={width:l,left:c},g=n.separator.fill;t=a&&!g?d:h,this._drawPanes.forEach(function(i){var n;null===(n=e._separatorPanes.get(i))||void 0===n||n.setBounding(t),i.setBounding(h,d,p)})},t.prototype._setPaneOptions=function(t,e){var i,n;if(tc(t.id)){var o=this.getDrawPaneById(t.id),r=!1;if(null!==o){var a=e;if(t.id!==et.CANDLE&&ta(t.height)&&t.height>0){var s=Math.max(Math.max(null!==(i=t.minHeight)&&void 0!==i?i:o.getOptions().minHeight,0),t.height);o.setBounding({height:s}),a=!0,r=!0}(tc(null===(n=t.axisOptions)||void 0===n?void 0:n.name)||ts(t.gap))&&(a=!0),o.setOptions(t),a&&this.adjustPaneViewport(r,!0,!0,!0,!0)}}},t.prototype.getDrawPaneById=function(t){if(t===et.CANDLE)return this._candlePane;if(t===et.X_AXIS)return this._xAxisPane;var e=this._drawPanes.find(function(e){return e.getId()===t});return null!=e?e:null},t.prototype.getContainer=function(){return this._container},t.prototype.getChartStore=function(){return this._chartStore},t.prototype.getXAxisPane=function(){return this._xAxisPane},t.prototype.getAllDrawPanes=function(){return this._drawPanes},t.prototype.getAllSeparatorPanes=function(){return this._separatorPanes},t.prototype.adjustPaneViewport=function(t,e,i,n,o){t&&this._measurePaneHeight();var r=e,a=null!=o&&o;(null!=n&&n||a)&&this._drawPanes.forEach(function(t){var e=t.getAxisComponent().buildTicks(a);r||(r=e)}),r&&this._measurePaneWidth(),null!=i&&i&&(this._xAxisPane.getAxisComponent().buildTicks(!0),this.updatePane(4))},t.prototype.updatePane=function(t,e){if(ts(e)){var i=this.getDrawPaneById(e);null==i||i.update(t)}else this._separatorPanes.forEach(function(e){e.update(t)}),this._drawPanes.forEach(function(e){e.update(t)})},t.prototype.crosshairChange=function(t){var e=this,i=this._chartStore.getActionStore();if(i.has(P.OnCrosshairChange)){var n={};this._drawPanes.forEach(function(i){var o=i.getId(),r={};e._chartStore.getIndicatorStore().getInstances(o).forEach(function(e){var i,n=e.result;r[e.name]=n[null!==(i=t.dataIndex)&&void 0!==i?i:n.length-1]}),n[o]=r}),tc(t.paneId)&&i.execute(P.OnCrosshairChange,B(B({},t),{indicatorData:n}))}},t.prototype.getDom=function(t,e){if(!tc(t))return this._chartContainer;var i,n,o=this.getDrawPaneById(t);if(null!==o)switch(null!=e?e:F.Root){case F.Root:return o.getContainer();case F.Main:return o.getMainWidget().getContainer();case F.YAxis:return null!==(n=null===(i=o.getYAxisWidget())||void 0===i?void 0:i.getContainer())&&void 0!==n?n:null}return null},t.prototype.getSize=function(t,e){if(!ts(t))return{width:Math.floor(this._chartContainer.clientWidth),height:Math.floor(this._chartContainer.clientHeight),left:0,top:0,right:0,bottom:0};var i,n,o=this.getDrawPaneById(t);if(null!==o)switch(null!=e?e:F.Root){case F.Root:return o.getBounding();case F.Main:return o.getMainWidget().getBounding();case F.YAxis:return null!==(n=null===(i=o.getYAxisWidget())||void 0===i?void 0:i.getBounding())&&void 0!==n?n:null}return null},t.prototype.setStyles=function(t){var e,i,n;this._chartStore.setOptions({styles:t}),ts(null===(e=null==(n=tc(t)?eo(t):t)?void 0:n.yAxis)||void 0===e?void 0:e.type)&&(null===(i=this._candlePane)||void 0===i||i.getAxisComponent().setAutoCalcTickFlag(!0)),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.getStyles=function(){return this._chartStore.getStyles()},t.prototype.setLocale=function(t){this._chartStore.setOptions({locale:t}),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.getLocale=function(){return this._chartStore.getLocale()},t.prototype.setCustomApi=function(t){this._chartStore.setOptions({customApi:t}),this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.setPriceVolumePrecision=function(t,e){this._chartStore.setPrecision({price:t,volume:e})},t.prototype.getPriceVolumePrecision=function(){return this._chartStore.getPrecision()},t.prototype.setTimezone=function(t){this._chartStore.setOptions({timezone:t}),this._xAxisPane.getAxisComponent().buildTicks(!0),this._xAxisPane.update(3)},t.prototype.getTimezone=function(){return this._chartStore.getTimeScaleStore().getTimezone()},t.prototype.setOffsetRightDistance=function(t){this._chartStore.getTimeScaleStore().setOffsetRightDistance(t,!0)},t.prototype.getOffsetRightDistance=function(){return this._chartStore.getTimeScaleStore().getOffsetRightDistance()},t.prototype.setMaxOffsetLeftDistance=function(t){if(t<0){tt("setMaxOffsetLeftDistance","distance","distance must greater than zero!!!");return}this._chartStore.getTimeScaleStore().setMaxOffsetLeftDistance(t)},t.prototype.setMaxOffsetRightDistance=function(t){if(t<0){tt("setMaxOffsetRightDistance","distance","distance must greater than zero!!!");return}this._chartStore.getTimeScaleStore().setMaxOffsetRightDistance(t)},t.prototype.setLeftMinVisibleBarCount=function(t){if(t<0){tt("setLeftMinVisibleBarCount","barCount","barCount must greater than zero!!!");return}this._chartStore.getTimeScaleStore().setLeftMinVisibleBarCount(Math.ceil(t))},t.prototype.setRightMinVisibleBarCount=function(t){if(t<0){tt("setRightMinVisibleBarCount","barCount","barCount must greater than zero!!!");return}this._chartStore.getTimeScaleStore().setRightMinVisibleBarCount(Math.ceil(t))},t.prototype.setBarSpace=function(t){this._chartStore.getTimeScaleStore().setBarSpace(t)},t.prototype.getBarSpace=function(){return this._chartStore.getTimeScaleStore().getBarSpace().bar},t.prototype.getVisibleRange=function(){return this._chartStore.getTimeScaleStore().getVisibleRange()},t.prototype.clearData=function(){this._chartStore.clear()},t.prototype.getDataList=function(){return this._chartStore.getDataList()},t.prototype.applyNewData=function(t,e,i){ts(i)&&tt("applyNewData","","param `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady')` instead."),this._chartStore.addData(t,A.Init,e).then(function(){}).catch(function(){}).finally(function(){null==i||i()})},t.prototype.applyMoreData=function(t,e,i){tt("","","Api `applyMoreData` has been deprecated since version 9.8.0."),this._chartStore.addData(t,A.Forward,null==e||e).then(function(){}).catch(function(){}).finally(function(){null==i||i()})},t.prototype.updateData=function(t,e){ts(e)&&tt("updateData","","param `callback` has been deprecated since version 9.8.0, use `subscribeAction('onDataReady')` instead."),this._chartStore.addData(t).then(function(){}).catch(function(){}).finally(function(){null==e||e()})},t.prototype.loadMore=function(t){tt("","","Api `loadMore` has been deprecated since version 9.8.0, use `setLoadDataCallback` instead."),this._chartStore.setLoadMoreCallback(t)},t.prototype.setLoadDataCallback=function(t){this._chartStore.setLoadDataCallback(t)},t.prototype.createIndicator=function(t,e,i,n){var o,r=this,a=tc(t)?{name:t}:t;if(null===tQ(a.name))return tt("createIndicator","value","indicator not supported, you may need to use registerIndicator to add one!!!"),null;var s=null==i?void 0:i.id,l=this.getDrawPaneById(null!=s?s:"");if(null!==l)this._chartStore.getIndicatorStore().addInstance(a,null!=s?s:"",null!=e&&e).then(function(t){var e;r._setPaneOptions(null!=i?i:{},null!==(e=l.getAxisComponent().buildTicks(!0))&&void 0!==e&&e)}).catch(function(t){});else{null!=s||(s=tA(et.INDICATOR));var c=this._createPane(eX,s,null!=i?i:{}),u=null!==(o=null==i?void 0:i.height)&&void 0!==o?o:100;c.setBounding({height:u}),this._chartStore.getIndicatorStore().addInstance(a,s,null!=e&&e).finally(function(){r.adjustPaneViewport(!0,!0,!0,!0,!0),null==n||n()})}return null!=s?s:null},t.prototype.overrideIndicator=function(t,e,i){var n=this;this._chartStore.getIndicatorStore().override(t,null!=e?e:null).then(function(t){var e=z(t,2),o=e[0],r=e[1];(o||r)&&(n.adjustPaneViewport(!1,r,!0,r),null==i||i())}).catch(function(){})},t.prototype.getIndicatorByPaneId=function(t,e){return this._chartStore.getIndicatorStore().getInstanceByPaneId(t,e)},t.prototype.removeIndicator=function(t,e){var i,n,o,r=this._chartStore.getIndicatorStore();if(r.removeInstance(t,e)){var a=!1;if(t!==et.CANDLE&&!r.hasInstances(t)){var s=this.getDrawPaneById(t),l=this._drawPanes.findIndex(function(e){return e.getId()===t});if(null!==s){a=!0;var c=this._separatorPanes.get(s);if(ts(c)){var u=null==c?void 0:c.getTopPane();try{for(var h=V(this._separatorPanes),d=h.next();!d.done;d=h.next()){var p=d.value;if(p[1].getTopPane().getId()===s.getId()){p[1].setTopPane(u);break}}}catch(t){i={error:t}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}c.destroy(),this._separatorPanes.delete(s)}this._drawPanes.splice(l,1),s.destroy();var g=this._drawPanes[0];ts(g)&&g.getId()===et.X_AXIS&&(g=this._drawPanes[1]),null===(o=this._separatorPanes.get(g))||void 0===o||o.destroy(),this._separatorPanes.delete(g)}}this.adjustPaneViewport(a,!0,!0,!0,!0)}},t.prototype.createOverlay=function(t,e){var i=[];i=tc(t)?[{name:t}]:tn(t)?t.map(function(t){return tc(t)?{name:t}:t}):[t];var n=!0;ts(e)&&null!==this.getDrawPaneById(e)||(e=et.CANDLE,n=!1);var o=this._chartStore.getOverlayStore().addInstances(i,e,n);return tn(t)?o:o[0]},t.prototype.getOverlayById=function(t){return this._chartStore.getOverlayStore().getInstanceById(t)},t.prototype.overrideOverlay=function(t){this._chartStore.getOverlayStore().override(t)},t.prototype.removeOverlay=function(t){var e;ts(t)&&(e=tc(t)?{id:t}:t),this._chartStore.getOverlayStore().removeInstance(e)},t.prototype.setPaneOptions=function(t){this._setPaneOptions(t,!1)},t.prototype.setZoomEnabled=function(t){this._chartStore.getTimeScaleStore().setZoomEnabled(t)},t.prototype.isZoomEnabled=function(){return this._chartStore.getTimeScaleStore().getZoomEnabled()},t.prototype.setScrollEnabled=function(t){this._chartStore.getTimeScaleStore().setScrollEnabled(t)},t.prototype.isScrollEnabled=function(){return this._chartStore.getTimeScaleStore().getScrollEnabled()},t.prototype.scrollByDistance=function(t,e){var i=ta(e)&&e>0?e:0,n=this._chartStore.getTimeScaleStore();if(n.startScroll(),i>0){var o=new tM({duration:i});o.doFrame(function(e){n.scroll(e/i*t)}),o.start()}else n.scroll(t)},t.prototype.scrollToRealTime=function(t){var e=this._chartStore.getTimeScaleStore(),i=e.getBarSpace().bar,n=e.getLastBarRightSideDiffBarCount()-e.getInitialOffsetRightDistance()/i;this.scrollByDistance(n*i,t)},t.prototype.scrollToDataIndex=function(t,e){var i=this._chartStore.getTimeScaleStore(),n=(i.getLastBarRightSideDiffBarCount()+(this.getDataList().length-1-t))*i.getBarSpace().bar;this.scrollByDistance(n,e)},t.prototype.scrollToTimestamp=function(t,e){var i=tL(this.getDataList(),"timestamp",t);this.scrollToDataIndex(i,e)},t.prototype.zoomAtCoordinate=function(t,e,i){var n=ta(i)&&i>0?i:0,o=this._chartStore.getTimeScaleStore(),r=o.getBarSpace().bar,a=r*t-r;if(n>0){var s=0,l=new tM({duration:n});l.doFrame(function(t){var i=t/n*a,r=(i-s)/o.getBarSpace().bar*10;o.zoom(r,e),s=i}),l.start()}else o.zoom(a/r*10,e)},t.prototype.zoomAtDataIndex=function(t,e,i){var n=this._chartStore.getTimeScaleStore().dataIndexToCoordinate(e);this.zoomAtCoordinate(t,{x:n,y:0},i)},t.prototype.zoomAtTimestamp=function(t,e,i){var n=tL(this.getDataList(),"timestamp",e);this.zoomAtDataIndex(t,n,i)},t.prototype.convertToPixel=function(t,e){var i,n=e.paneId,o=void 0===n?et.CANDLE:n,r=e.absolute,a=void 0!==r&&r,s=[];if(o!==et.X_AXIS){var l=this.getDrawPaneById(o);if(null!==l){var c=this._chartStore.getTimeScaleStore(),u=l.getBounding(),h=[].concat(t),d=this._xAxisPane.getAxisComponent(),p=l.getAxisComponent();s=h.map(function(t){var e={},i=t.dataIndex;if(ta(t.timestamp)&&(i=c.timestampToDataIndex(t.timestamp)),ta(i)&&(e.x=null==d?void 0:d.convertToPixel(i)),ta(t.value)){var n=null==p?void 0:p.convertToPixel(t.value);e.y=a?u.top+n:n}return e})}}return tn(t)?s:null!==(i=s[0])&&void 0!==i?i:{}},t.prototype.convertFromPixel=function(t,e){var i,n=e.paneId,o=void 0===n?et.CANDLE:n,r=e.absolute,a=void 0!==r&&r,s=[];if(o!==et.X_AXIS){var l=this.getDrawPaneById(o);if(null!==l){var c=this._chartStore.getTimeScaleStore(),u=l.getBounding(),h=[].concat(t),d=this._xAxisPane.getAxisComponent(),p=l.getAxisComponent();s=h.map(function(t){var e,i,n={};if(ta(t.x)){var o=null!==(e=null==d?void 0:d.convertFromPixel(t.x))&&void 0!==e?e:-1;n.dataIndex=o,n.timestamp=null!==(i=c.dataIndexToTimestamp(o))&&void 0!==i?i:void 0}if(ta(t.y)){var r=a?t.y-u.top:t.y;n.value=p.convertFromPixel(r)}return n})}}return tn(t)?s:null!==(i=s[0])&&void 0!==i?i:{}},t.prototype.executeAction=function(t,e){var i;if(t===P.OnCrosshairChange){var n=B({},e);n.paneId=null!==(i=n.paneId)&&void 0!==i?i:et.CANDLE,this._chartStore.getTooltipStore().setCrosshair(n)}},t.prototype.subscribeAction=function(t,e){this._chartStore.getActionStore().subscribe(t,e)},t.prototype.unsubscribeAction=function(t,e){this._chartStore.getActionStore().unsubscribe(t,e)},t.prototype.getConvertPictureUrl=function(t,e,i){var n=this,o=this._chartContainer.clientWidth,r=this._chartContainer.clientHeight,a=tF("canvas",{width:"".concat(o,"px"),height:"".concat(r,"px"),boxSizing:"border-box"}),s=a.getContext("2d"),l=ty(a);a.width=o*l,a.height=r*l,s.scale(l,l),s.fillStyle=null!=i?i:"#FFFFFF",s.fillRect(0,0,o,r);var c=null!=t&&t;return this._drawPanes.forEach(function(t){var e=n._separatorPanes.get(t);if(ts(e)){var i=e.getBounding();s.drawImage(e.getImage(c),i.left,i.top,i.width,i.height)}var r=t.getBounding();s.drawImage(t.getImage(c),0,r.top,o,r.height)}),a.toDataURL("image/".concat(null!=e?e:"jpeg"))},t.prototype.resize=function(){this.adjustPaneViewport(!0,!0,!0,!0,!0)},t.prototype.destroy=function(){this._chartEvent.destroy(),this._drawPanes.forEach(function(t){t.destroy()}),this._drawPanes=[],this._separatorPanes.forEach(function(t){t.destroy()}),this._separatorPanes.clear(),this._container.removeChild(this._chartContainer)},t}(),e3=new Map,e4=1;function e5(t,e){if(null===(i=tc(t)?document.getElementById(t):t))return null;var i,n=e3.get(i.id);if(ts(n))return tt("","","The chart has been initialized on the dom！！！"),n;var o="k_line_chart_".concat(e4++);return(n=new e2(i,e)).id=o,i.setAttribute("k-line-chart-id",o),e3.set(o,n),n}function e6(t){if(t instanceof e2)n=t.id;else{var e,i,n,o=void 0;n=null!==(e=null==(o=tc(t)?document.getElementById(t):t)?void 0:o.getAttribute("k-line-chart-id"))&&void 0!==e?e:null}null!==n&&(null===(i=e3.get(n))||void 0===i||i.destroy(),e3.delete(n))}}}]);