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