',actions:[{name:"ok",type:"primary",text:window.t("Ok"),method:"close",key:[13,32]}]});function o(e){return new Promise((function(t){Promise.all([i.e("dialogs-core"),i.e(55),i.e(0),i.e(15),i.e("create-dialog")]).then(function(o){var s=i("YDhE").createDialog;t(s(Object(n.__assign)(Object(n.__assign)({},r),e)))}.bind(null,i)).catch(void 0)}))}function s(e){o(e).then((function(e){return e.open()}))}},"bv/X":function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,o=window.t("Sine Line");function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("piZW").SineLinePaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.prototype.pointsCount=function(){return 2},s.prototype.translatedType=function(){return o},s.prototype.name=function(){return"Sine Line"},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("LX4V").CyclicAndSineLinesPatternDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetoolsineline",e);return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e)},t.LineToolSineLine=s},
c2JX:function(e,t,i){"use strict";i.r(t),i.d(t,"renderSpinnerTemplate",(function(){return o})),i.d(t,"Spinner",(function(){return a}));i("SzKR");var n=i("gWrr"),r=i("Owlf");function o(e){return void 0===e&&(e=""),'\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\x3c!--\n\t\t\t\t--\x3e
\n\t\t\t
\n\t\t
\n\t'}var s=Object(n.b)(o()),a=function(){function e(e){this._shown=!1,this._el=s.cloneNode(!0),this.setSize(e||r.a)}return e.prototype.spin=function(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,void 0!==e&&e.appendChild(this._el)),this._shown=!0,this},e.prototype.stop=function(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this},e.prototype.setStyle=function(e){var t=this;return Object.keys(e).forEach((function(i){var n=e[i];void 0!==n&&t._el.style.setProperty(i,n)})),this},e.prototype.setSize=function(e){var t=void 0!==e?"tv-spinner--size_"+e:"";return this._el.className="tv-spinner "+t+" "+(this._shown?"tv-spinner--shown":""),this},e.prototype.getEl=function(){return this._el},e.prototype.destroy=function(){this.stop(),delete this._el,delete this._container},e}()},c44N:function(e,t,i){"use strict";function n(e,t){return e.pixelRatio===t.pixelRatio}i.r(t),i.d(t,"areEqualPaneRenderParams",(function(){return n}))},cBZt:function(e,t,i){"use strict";function n(e,t){return e+"@"+t}function r(e){return e.replace(/(@[^-]+-[^-]+).*$/,"$1")}i.r(t),i.d(t,"studyIdString",(function(){return n})),i.d(t,"extractStudyId",(function(){return r}))},cKqi:function(e,t,i){"use strict";(function(e){
var n=i("aO4+").Point,r=i("qJq3").Series,o=i("GVHu").Study,s=i("k9/m").PlotRowSearchMode,a=i("FBsw").OverlayPriceAxisView,l=i("KtbP").PanePriceAxisView,c=i("x0JF"),u=c.SeriesAreaPaneView,h=c.SeriesLinePaneView,d=c.SeriesHollowCandlesPaneView,p=c.SeriesCandlesPaneView,_=c.SeriesBarsPaneView,f=c.SeriesBaselinePaneView,m=i("biIa").SeriesWaterlinePaneView,v=i("2kV1").StudyStatusView,y=i("JjUe").OverlayDataWindowView,g=i("z8/4").OverlayLegendView,b=i("qXYw").OverlayLegendValuesProvider,S=i("ZsYR").OverlayStatusProvider,w=i("38az").SeriesBarColorer,P=i("l4sv").HorizontalLineRenderer,C=i("Kxc7"),x=i("6sst").OverlayStudyPriceLineAxisView,T=i("Qb4w").PriceRange,I=i("XPit").barFunction,M=i("XPit").seriesPlotFunctionMap,L=i("k9/m").PlotList,O=i("n5al").createSeriesFormatter,k=i("n5al").seriesCurrency,A=i("n5al").extractSymbolNameFromSymbolInfo,E=i("wOSo").QuotesProvider,V=i("qFKp").CheckMobile.any()&&!1,D=!C.enabled("hide_study_overlay_legend_item"),B=C.enabled("uppercase_instrument_names"),R=i("txPx").getLogger("Chart.StudyOverlay"),N=C.enabled("study_overlay_compare_legend_option");function F(e,t){this._source=e,this._model=t,this._points=[new n(0,0)],this._lineRenderer=new P}function j(e,t){return null==e[t]}function W(t,i,n,r){this._waterlineView=null,i.hasChild("currencyId")||i.addChild("currencyId",new e(null)),o.call(this,t,i,n,r),this.m_data=new L(M(),j),this._formatter=null,this._paneView=null;var s=this;this.properties().minTick.listeners().subscribe(null,(function(){s._recreatePriceFormattingDependencies(),s.updateAllViews(),s._model.fullUpdate()})),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().currencyId.subscribe(this,this._onCurrencyChanged),this._updateBarFunction(),this._quotesProvider=new E,V&&this._quotesProvider.quotesUpdate().subscribe(this,this._onQuotesUpdate)}F.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var e=this._source.lastValueData(void 0,!0);e.noData||(this._visible=!0,this._points=[new n(0,e.coordinate)],this._color=e.color)}},F.prototype.renderer=function(){var e={};return e.width=this._model.timeScale().width(),e.height=this._source.priceScale().height(),e.y=this._points[0].y,e.color=this._color,e.linewidth=1,e.linestyle=CanvasEx.LINESTYLE_DOTTED,e.visible=this._visible,this._lineRenderer.setData(e),this._lineRenderer},inherit(W,o),W.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},W.prototype.symbol=function(){var e,t=this.properties().inputs.symbol.value(),i=this.symbolInfo();return e=i?i.name:t,B?e.toUpperCase():e},W.prototype.currency=function(){return this._properties.currencyId.value()||null},W.prototype.setCurrency=function(e){
this._properties.currencyId.setValue(e)},W.prototype.symbolSource=function(){return this},W.prototype.lastValueData=function(e,t,i){var n={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return n;var o=this._model.timeScale().visibleBarsStrictRange();if(null===o)return n;if(!this.properties().visible.value())return n;var a=this.nearestIndex(o.lastBar(),s.NearestLeft,TradingView.OPEN_PLOT);if(null==a)return n;var l=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),c=null!==l&&o.contains(l.index),u=null!==l?l.value:null,h=t||c?u:this.data().valueAt(a);if(null===h)return n;var d=this._barFunction(h);if(!isNumber(d))return n;var p={noData:!1};i&&(p.price=d);var _=this.firstValue();if(!isNumber(_))return n;p.text=this.priceScale().formatPrice(d,_),p.text=this.priceScale().formatPrice(d,_),p.formattedPriceAbsolute=this.priceScale().formatPriceAbsolute(d),p.formattedPricePercentage=this.priceScale().formatPricePercentage(d,_),p.floatCoordinate=this.priceScale().priceToCoordinate(d,_),p.coordinate=p.floatCoordinate,p.item=h;var f=this.properties();switch(f.style.value()){case r.STYLE_BARS:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?f.barStyle.upColor.value():f.barStyle.downColor.value();break;case r.STYLE_CANDLES:case r.STYLE_HOLLOW_CANDLES:p.color=h[TradingView.OPEN_PLOT]<=h[TradingView.CLOSE_PLOT]?f.candleStyle.upColor.value():f.candleStyle.downColor.value();break;case r.STYLE_LINE:p.color=f.lineStyle.color.value();break;case r.STYLE_AREA:p.color=f.areaStyle.color1.value();break;case r.STYLE_BASELINE:var m=f.baselineStyle,v=this.priceScale(),y=Math.round(v.height()*(Math.abs(100-m.baseLevelPercentage.value())/100));p.color=p.coordinate
0),o?{left:0,right:1,totallySlots:i}:{left:1,right:0,totallySlots:i}}return{left:e,right:t,totallySlots:e+t}},re.prototype.startScalePrice=function(e,t,i){e.startScalePrice(t,i)},re.prototype.scalePriceTo=function(e,t,i){e.scalePriceTo(t,i),this.mainSeries().priceScale().isLockScale()?this.lightUpdate():this.invalidate(this._paneInvalidationMask(e,x.Light)),this._setScalesResetAvailable(!0)},re.prototype.endScalePrice=function(e,t){e.endScalePrice(t),
this.invalidate(this._paneInvalidationMask(e,x.Light))},re.prototype.startScrollPrice=function(e,t,i){e.startScrollPrice(t,i)},re.prototype.scrollPriceTo=function(e,t,i){e.scrollPriceTo(t,i),this.invalidate(this._paneInvalidationMask(e,x.Light))},re.prototype.endScrollPrice=function(e,t){e.endScrollPrice(t),this.invalidate(this._paneInvalidationMask(e,x.Light))},re.prototype.setPriceAutoScale=function(e,t,i){e.setPriceAutoScale(t,i),this.invalidate(this._paneInvalidationMask(e,x.Light))},re.prototype.restorePriceScaleState=function(e,t,i){e.restorePriceScaleState(t,i),this.invalidate(this._paneInvalidationMask(e,x.Light))},re.prototype.resetPriceScale=function(e,t){this._setScalesResetAvailable(!1),e.resetPriceScale(t),this.invalidate(this._paneInvalidationMask(e,x.Light))},re.prototype.updateScales=function(e,t){this._undoModel._chartWidget._updateScalesActions()},re.prototype.startScaleTime=function(e){this._timeScale.startScale(e)},re.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},re.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},re.prototype.mainSeriesScaleRatio=function(){return z(this._timeScale,this.m_mainSeries.priceScale())},re.prototype.setMainSeriesScaleRatio=function(e){this.paneForSource(this.m_mainSeries).applyPriceScaleRatio(this.m_mainSeries.priceScale(),e)},re.prototype.scaleTimeTo=function(e){this._timeScale.scaleTo(e),this.recalculateAllPanes(),this.lightUpdate(),this._setScalesResetAvailable(!0)},re.prototype.endScaleTime=function(){this._timeScale.endScale(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies()},re.prototype.startScrollTime=function(e){this._timeScale.startScroll(e),this._isTimeScrolling=!0},re.prototype.scrollTimeTo=function(e){this._timeScale.scrollTo(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},re.prototype.endScrollTime=function(){this._timeScale.endScroll(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this._isTimeScrolling=!1},re.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach((function(e){m(e)&&e.recalcStudyIfNeeded&&e.recalcStudyIfNeeded()}))},re.prototype.onResetScales=function(){return this._resetScales},re.prototype.resetTimeScale=function(){this._timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this.updateCrossHair(),this.lightUpdate(),this._resetScales.fire(),this._setScalesResetAvailable(!1)},re.prototype.restoreTimeScaleState=function(e){this._timeScale.restoreState(e),this.recalculateAllPanes(),this.updateCrossHair(),this.lightUpdate(),this._setScalesResetAvailable(!0)},re.prototype.restoreFactoryDefaults=function(e){e.restoreFactoryDefaults(),this.recalcVisibleRangeStudies(!0)},re.prototype.selectionMacro=function(e){var t=this.selection().sources();e({
removeSourceFromSelection:se.bind(this),addSourceToSelection:ae.bind(this),clearSelection:oe.bind(this),selection:this.selection.bind(this)});var i=G(t,this.selection().sources()),n=G(this.selection().sources(),t);n.concat(t).forEach((function(e){e.updateAllViews()})),i.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!1)})),n.forEach((function(e){var t=e.hasAlert&&e.hasAlert.value()&&e.getAlertSync();t&&t.set("selected",!0)})),this.lightUpdate(),this.setHoveredSource(null),(i.length>0||n.length>0)&&this._selectedSourceChanged.fire()},re.prototype.checkLineToolSelection=function(){this._selection.checkLineToolSelection()},re.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},re.prototype.selection=function(){return this._selection},re.prototype.invalidate=function(e){this._invalidateHandler&&this._invalidateHandler(e)},re.prototype.dataSources=function(){var e=[];e.push(this.m_crossHairSource);for(var t=0;t0)for(s=this.dataSources(),a=0;a0){var c=r-n,u=l?null:i.rightOffset()-c;if(!this._options.shiftVisibleRangeOnNewBar&&l){var h=i.width()/(a.length()+c);h>=i.minBarSpacing()?(i.setBarSpacing(h),u=i.rightOffset()+c):s.lastBar()!==n&&(u=i.rightOffset()-c)}null!==u&&i.setRightOffset(u)}}i.setBaseIndex(r)}},re.prototype.recalculatePane=function(e){e&&e.recalculate()},re.prototype.paneForSource=function(e){for(var t=this._panes.length-1;t>=0;t--)if(-1!==this._panes[t].dataSources().indexOf(e))return this._panes[t];return e instanceof w?this.paneForSource(this.m_mainSeries):null},re.prototype.recalculateAllPanes=function(){for(var e=0;e1},re.prototype.createLineTool=function(e,t,i,n,r,o){if(!_(i))return null;if("LineToolExecution"!==i&&Z("drawings","Study_Drawing_"+i),n){
var a=n.state();n=p(i,a)}var l=d(i,this,n,null),c=!l.linkKey&&!r;B.drawOnAllCharts().value()?l.linkKey=r||j.randomHash():l.linkKey=r,o=o||e.mainDataSource(),n||l.properties().currencyId.setValue(o.symbolSource().currency()),l.setOwnerSource(o);var u,h=e.defaultPriceScale();if(e.addDataSource(l,h),l.isFixed()){var f=e.mainDataSource().firstValue(),m=this._timeScale.indexToCoordinate(t.index),v=h.priceToCoordinate(t.price,f);u=l.addFixedPoint(new s(m,v))}else u=l.addPoint(t);return u||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=e),c&&l.enableCurrentIntervalVisibility(),this.fullUpdate(),l},re.prototype.lineBeingCreated=function(){return this._lineBeingCreated},re.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},re.prototype.continueCreatingLine=function(e,t,i,n){var r=this._lineBeingCreated.addPoint(e,t,i);this._lineBeingCreated.updateAllViews();var o=new C(x.Light);return r&&(this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null),this.invalidate(o),r},re.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var e=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),B.drawOnAllCharts().value()&&e.isSynchronizable()&&B.cancelLineTool({model:this})}},re.prototype.startChangingLinetool=function(e,t,i,n,r){if(this._lineBeingEdited=e,B.isToolEditingNow.setValue(!0),!r){this._linePointBeingEdited=i,void 0!==t&&void 0!==i&&(this._lineBeingEdited.startChanging(i,t),this._lineBeingEdited.setPoint(i,t,n)),this._lineBeingEdited.updateAllViews();var o=this.paneForSource(e),s=this._paneInvalidationMask(o,x.Light);s.force=!0,this.invalidate(s),e.linkKey&&e.isSynchronizable()&&B.startChangingLineTool({linkKey:e.linkKey,model:this,symbol:this.mainSeries().symbol()})}},re.prototype.lineBeingEdited=function(){return this._lineBeingEdited},re.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},re.prototype.changeLinePoint=function(e,t){var i=this.paneForSource(this._lineBeingEdited),n=e.price,r=e.index;if(void 0!==e.x&&void 0!==e.y){var o=this._lineBeingEdited.priceScale(),s=i.mainDataSource().firstValue();n=o.coordinateToPrice(e.y,s),r=Math.round(this.timeScale().coordinateToIndex(e.x)),n=this._magnet.align(n,r,i),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:n,index:r},t)}else this._lineBeingEdited.setPoint(this._linePointBeingEdited,e,t);this._lineBeingEdited.updateAllViews(),this.lightUpdate(),this._lineBeingEdited.linkKey&&this._lineBeingEdited.isSynchronizable()&&B.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),points:this._lineBeingEdited.normalizedPoints()})},re.prototype.endChangingLinetool=function(e,t){var i=this._lineBeingEdited;if(this._lineBeingEdited=null,B.isToolEditingNow.setValue(!1),t)i.updateAllViewsAndRedraw();else{this._linePointBeingEdited=null,i.endChanging(!1,e),this.lightUpdate();var n={points:i._timePoint,interval:this.mainSeries().interval()}
;i.linkKey&&i.isSynchronizable()&&B.finishChangingLineTool({model:this,linkKey:i.linkKey,symbol:this.mainSeries().symbol(),finalState:n})}},re.prototype.finishLineTool=function(e){B.drawOnAllCharts().value()&&e.linkKey&&e.isSynchronizable()&&B.finishLineTool({linkKey:e.linkKey,model:this})},re.prototype.calculateDefaultTags=function(){for(var e=[],t=this.dataSources(),i=0;i-1&&this._modelIntervals.splice(t,1)},re.prototype.clearIntervals=function(){
for(var e=0;eu&&(h-=Math.abs(u-(d+l)),d=Math.floor(h-c)+.5);var p=d+l,_=0+t.borderSize+t.paddingTop+t.fontSize+t.paddingBottom;e.fillStyle=n.background;var f=Math.round(d*i),m=Math.round(0*i),v=Math.round(p*i),y=Math.round(_*i);e.fillRect(f,m,v-f,y-m);var g=Math.round(n.coordinate*i),b=m,S=Math.round((b+t.borderSize+t.tickLength)*i);e.fillStyle=n.color;var w=Math.max(1,Math.floor(i)),P=Math.floor(.5*i);e.fillRect(g-P,b,w,S-b);var C=_-t.baselineOffset-t.paddingBottom;e.textAlign="left",e.fillStyle=n.color,Object(r.drawScaled)(e,i,(function(){return e.fillText(n.text,d+a,C)})),e.restore()}}},e}();i.d(t,"a",(function(){return a}));var a=function(){function e(e){this._renderer=new s,this._rendererData={background:"",color:"",coordinate:0,text:"",visible:!1,width:0},this._invalidated=!0,this._model=e,this._renderer.setData(this._rendererData)}return e.prototype.update=function(){this._invalidated=!0},e.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer},e.prototype.coordinate=function(){return this._rendererData.coordinate},e.prototype._updateImpl=function(){var e=this._rendererData;if(e.visible=!1,!this._model.timeScale().isEmpty()){var t=this._getIndex();if(null!==t){e.visible=!0,e.width=this._model.timeScale().width(),e.background=this._getBgColor(),e.color=Object(n.colorFromBackground)(e.background),e.coordinate=this._model.timeScale().indexToCoordinate(t);var i=this._model.timeScale().indexToUserTime(t);e.text=null!==i?this._model.dateTimeFormatter().format(i):"",this._invalidated=!1}}},e}()},d1Pk:function(e,t,i){"use strict";i.r(t),i.d(t,"fibLevelCoordinate",(function(){return r})),i.d(t,"fibLevelPrice",(function(){return o}));var n=i("Eyy1");function r(e,t,i,r,o,s){if(s)return Math.round(Object(n.ensureDefined)(e.coordinate)+Object(n.ensureDefined)(t.coordinate)*i);var a=e.price+t.price*i;return r.priceToCoordinate(a,o)}function o(e,t,i,r,o,s){if(!s)return e.price+t.price*i;var a=Object(n.ensureDefined)(e.coordinate)+Object(n.ensureDefined)(t.coordinate)*i;return r.coordinateToPrice(a,o)}},d700:function(e,t,i){"use strict"
;i.d(t,"b",(function(){return r})),i.d(t,"a",(function(){return o}));var n=i("/3z9");function r(e){if("INPUT"===e.tagName){var t=e.type;return"text"===t||"email"===t||"number"===t||"password"===t||"search"===t||"tel"===t||"url"===t}return"TEXTAREA"===e.tagName||e.isContentEditable}function o(e,t){if(!t)return!1;var i=255&e;if(27===i||i>>>4==7)return!1;switch(e^i){case n.Modifiers.Alt:return(38===i||40===i)&&"SELECT"===t.tagName||r(t);case n.Modifiers.Alt+n.Modifiers.Shift:return r(t);case n.Modifiers.Mod:if(67===i||!n.isMacKeyboard&&45===i){var o=t.ownerDocument&&t.ownerDocument.getSelection();if(o&&!o.isCollapsed)return!0}return r(t);case n.Modifiers.Mod+n.Modifiers.Shift:return i>=33&&i<=40&&r(t);case n.Modifiers.Shift:case 0:return!!(9!==i||t.ownerDocument&&t!==t.ownerDocument.body&&t!==t.ownerDocument.documentElement)&&((13===i||32===i||!function(e){if("BUTTON"===e.tagName)return!0;if("INPUT"===e.tagName){var t=e.type;if("submit"===t||"button"===t||"reset"===t||"checkbox"===t||"radio"===t)return!0}return!1}(t))&&("form"in t||t.isContentEditable))}return!1}},dBsn:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererCross",(function(){return l}));var n=i("aO4+"),r=i("GEp6"),o=i("ogJP"),s=i("Zp/P"),a=i("VdBB"),l=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){for(var i,n,r,s,a=t.pixelRatio,l="",c=!1,u=0,h=this._data.items;u0?"Forward":"Backward")),this._model=e,this._sourcesIds=t.map((function(e){return e.id()})),this._shift=i}function E(e,t,i,n,r,o){_.call(this,"Zoom"),this._model=e,this._startBar=t,this._endBar=i,this._startPrice=n,this._endPrice=r,this._pane=o}function V(e,t,i){_.call(this,"Zoom"),this._baseCmd=e,this._zoomStack=t,this._inOut=i}function D(e,t,i){_.call(this,"Apply Chart Theme"),this._model=e,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),this._newSessionProps=t.sessions||TradingView.factoryDefaults("sessions"),["candleStyle","hollowCandleStyle","haStyle"].forEach((function(e){t.mainSourceProperties[e].wickUpColor=t.mainSourceProperties[e].wickUpColor||t.mainSourceProperties[e].wickColor,t.mainSourceProperties[e].wickDownColor=t.mainSourceProperties[e].wickDownColor||t.mainSourceProperties[e].wickColor})),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||t.chartProperties.paneProperties.gridProperties,
t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||t.chartProperties.paneProperties.gridProperties,t.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=o({},this._newChartProps,t.chartProperties),delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showBidAskLabels,delete this._newChartProps.scalesProperties.showPrePostMarketPriceLabel,delete this._newChartProps.scalesProperties.showStudyPlotLabels,delete this._newChartProps.scalesProperties.showFundamentalNameLabel,delete this._newChartProps.scalesProperties.showFundamentalLastValue,e.timeScale().preserveBarSpacing()&&delete this._newChartProps.scalesProperties.barSpacing,this._newSeriesProps=o({},this._newSeriesProps,t.mainSourceProperties),this._oldChartProps=e.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=e.mainSeries().properties().state(),this._oldSessionsProps=this._model.sessions().properties().state(),i||(delete this._oldSeriesProps.style,delete this._oldSeriesProps.symbol,delete this._oldSeriesProps.interval,delete this._oldSeriesProps.extendedHours,delete this._newSeriesProps.style,delete this._newSeriesProps.symbol,delete this._newSeriesProps.interval,delete this._newSeriesProps.extendedHours,delete this._newSeriesProps.bidAsk.visible,delete this._newSeriesProps.prePostMarket.visible)}function B(e,t){_.call(this,"Stop Sincing Drawing"),this._model=e,this._sourceId=t.id(),this._linkKey=t.linkKey}inherit(I,l),I.prototype.version=function(){return this.m_model._version},I.prototype.onData=function(e){switch(e.method){case"timescale_update":var t=e.params;this.m_model.updateTimeScale(t.index,t.zoffset,t.changes,t.index_diff,t.marks,t.clear)}},I.prototype.paneForSource=function(e){return this.m_model.paneForSource(e)},I.prototype.createPane=function(e){return this.m_model.createPane(e)},I.prototype.readOnly=function(){return this.m_model.readOnly()},I.prototype.restart=function(){this.m_model.restart()},I.prototype.disconnect=function(){this.m_model.disconnect()},I.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},I.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},I.prototype.chartModel=function(){return this._model()},I.prototype._model=function(){return this.m_model},I.prototype.pushUndoCommand=function(e){this._pushUndoCommand(e)},I.prototype._pushUndoCommand=function(e){this._undoHistory.pushUndoCommand(e)},I.prototype.startScalePrice=function(e,t,i){this.pushUndoCommand(new O(this.m_model,e,t,t.state())),
this.chartModel().startScalePrice(e,t,i)},I.prototype.scalePriceTo=function(e,t,i){this.chartModel().scalePriceTo(e,t,i)},I.prototype.endScalePrice=function(e,t){this.chartModel().endScalePrice(e,t)},I.prototype.startScrollPrice=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollState=t.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(e,t,i))},I.prototype.scrollPriceTo=function(e,t,i){t.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new O(this.m_model,e,t,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(e,t,i))},I.prototype.endScrollPrice=function(e,t){t.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(e,t))},I.prototype.setPriceAutoScale=function(e,t,i){this.pushUndoCommand(new O(this.m_model,e,t,t.state())),this.chartModel().setPriceAutoScale(e,t,i)},I.prototype.resetPriceScale=function(e,t){this.pushUndoCommand(new O(this.m_model,e,t,t.state())),this.chartModel().resetPriceScale(e,t)},I.prototype.setWidth=function(e){this.m_model.setWidth(e)},I.prototype.setPaneHeight=function(e,t){this.m_model.setPaneHeight(e,t)},I.prototype.gridSource=function(){return this.m_model.gridSource()},I.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},I.prototype.addAlertsSource=function(e){return this.m_model.addAlertsSource(e)},I.prototype.alertsSources=function(){return this.m_model.alertsSources()},I.prototype.publishedChartsTimelineSource=function(){return this.m_model.publishedChartsTimelineSource()},I.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},I.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},I.prototype.model=function(){return this.m_model},I.prototype.chartWidget=function(){return this._chartWidget},I.prototype.mainSeries=function(){return this.m_model.m_mainSeries},I.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},I.prototype.panes=function(){return this.m_model.panes()},I.prototype.timeScale=function(){return this.m_model.timeScale()},I.prototype.selectionMacro=function(e){return this.m_model.selectionMacro(e)},I.prototype.setHoveredSource=function(e,t){this.m_model.setHoveredSource(e,t)},I.prototype.selection=function(){return this.m_model.selection()},I.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},I.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},I.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},I.prototype.invalidate=function(e){this.m_model.invalidate(e)},I.prototype.setCurrentPosition=function(e,t,i,n){this.m_model.setCurrentPosition(e,t,i,n)},I.prototype.setAndSaveCurrentPosition=function(e,t,i,n){this.m_model.setAndSaveCurrentPosition(e,t,i,n)},I.prototype.modifySeries=function(e,t,i){var n=new k(this.m_model,e,t,i)
;this.pushUndoCommand(n)},I.prototype.canCreateStudy=function(e){return this.model().chartApi().chartApi().isCanCreateStudy(e)},I.prototype.checkIfFeatureAvailable=function(e,t){var i=this.canCreateStudy(),n=t&&t instanceof u;return!this.readOnly()&&n&&(i=this.canCreateStudy(!0)),!!i||(n||d(),!1)},I.prototype._insertStudy=function(e,t,i,n,r,o,s,a,l){var c=new g(this.m_model,e,t,i,n,r,o,s,a,l||null,"Insert "+e.description);return this.pushUndoCommand(c),c.insertedStudy()},I.prototype.insertStudyWithoutCheck=function(e){return this._insertStudy(e)},I.prototype.createStudyInserter=function(e,t,i){var n=this,r=null,o={createStudy:function(e,t,i,o,s,a,l,c,u){return n.checkIfFeatureAvailable(e,a)?(w("studies","Study_"+e.id),"Compare@tv-basicstudies"===e.id&&w("compare","symbol:"+t.symbol),n._insertStudy(e,t,o,s,a,l,c,u,r)):(P.logNormal("Cannot insert study "+e.id),null)}};void 0!==i&&(o.createStub=function(){var e=n.m_model.insertStudyStub(i);return r={targetPaneId:n.m_model.paneForSource(e).id(),targetZOrder:e.zorder()},e.id()},o.removeStub=function(e){return n.m_model.removeStudyStub(e)});var s=new S(e,this.m_model._studiesMetaInfoRepository,o);return s.setParentSource(t),s},I.prototype.setProperty=function(e,t,i,n){if(e&&e.value()!==t){var r=new x(e,t,i,this.m_model,n);this.pushUndoCommand(r),this.emitEvent("setProperty")}},I.prototype.setProperties=function(e,t,i){var n=this;this.beginUndoMacro(i),this.m_model.selectionMacro((function(){for(var r=0;r0&&t.reverse(),t.forEach((function(t){e._model.changeZOrder(t,e._shift)}))},I.prototype.removePane=function(e){var t=this.m_model.panes()[e].dataSources().slice();this.removeSources(t,!1,"Remove pane")},inherit(E,_),E.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},E.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.lightUpdate()},inherit(V,_),V.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void P.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)
},V.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void P.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(D,_),D.prototype._merge=function(e,t,i){var n=this._model;c(!0),e&&(n.properties().paneProperties.mergeAndFire(e.paneProperties),n.properties().scalesProperties.mergeAndFire(e.scalesProperties)),n.mainSeries().priceScale().setMode({autoScale:t.priceAxisProperties.autoScale,percentage:t.priceAxisProperties.percentage,log:t.priceAxisProperties.log,lockScale:t.priceAxisProperties.lockScale}),n.mainSeries().properties().mergeAndFire(t),n.mainSeries().properties().saveDefaults(),n.mainSeries().createPaneView(),n.mainSeries().invalidateBarStylesCache(),n._version=t.version,n.recalculateAllPanes(),n.fullUpdate(),n.properties().saveDefaults(),n.sessions().restoreState({properties:i}),c(!1)},D.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps,this._oldSessionsProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},D.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps,this._newSessionProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(B,_),B.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},B.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},t.ChartUndoModel=I,t.PriceScaleChangeUndoCommand=O}).call(this,i("aIyQ"))},dTSQ:function(e,t,i){"use strict";function n(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}i.r(t),i.d(t,"regExpEscape",(function(){return n}))},dfhE:function(e,t,i){"use strict";var n,r,o;i.r(t),i.d(t,"STATUS_OFFLINE",(function(){return s})),i.d(t,"STATUS_RESOLVING",(function(){return a})),i.d(t,"STATUS_LOADING",(function(){return l})),i.d(t,"STATUS_READY",(function(){return c})),i.d(t,"STATUS_INVALID_SYMBOL",(function(){return u})),i.d(t,"STATUS_SNAPSHOT",(function(){return h})),i.d(t,"STATUS_EOD",(function(){return d})),i.d(t,"STATUS_PULSE",(function(){return p})),i.d(t,"STATUS_DELAYED",(function(){return _})),i.d(t,"STATUS_DELAYED_STREAMING",(function(){return f})),i.d(t,"STATUS_NO_BARS",(function(){return m})),i.d(t,"STATUS_REPLAY",(function(){return v})),i.d(t,"SERIES_STATUS_TEXT",(function(){return y})),i.d(t,"STYLE_LINE_TYPE_MARKERS",(function(){return g})),i.d(t,"STYLE_LINE_TYPE_STEP",(function(){return b})),i.d(t,"STYLE_LINE_TYPE_SIMPLE",(function(){return S})),i.d(t,"STYLE_BARS",(function(){return w})),i.d(t,"STYLE_CANDLES",(function(){return P})),i.d(t,"STYLE_LINE",(function(){return C})),i.d(t,"STYLE_AREA",(function(){return x})),i.d(t,"STYLE_RENKO",(function(){return T})),i.d(t,"STYLE_KAGI",(function(){return I})),i.d(t,"STYLE_PNF",(function(){return M})),i.d(t,"STYLE_PB",(function(){return L})),i.d(t,"STYLE_HEIKEN_ASHI",(function(){return O})),i.d(t,"STYLE_HOLLOW_CANDLES",(function(){return k
})),i.d(t,"STYLE_BASELINE",(function(){return A})),i.d(t,"STYLE_RANGE",(function(){return E})),i.d(t,"STYLE_HILO",(function(){return V})),i.d(t,"STYLE_SHORT_NAMES",(function(){return D})),i.d(t,"SYMBOL_STRING_DATA",(function(){return B}));var s=0,a=1,l=2,c=3,u=4,h=5,d=6,p=7,_=8,f=9,m=10,v=11,y=((n={})[s]="connecting",n[a]="loading",n[l]="loading",n[c]="realtime",n[u]="invalid",n[h]="snapshot",n[d]="endofday",n[p]="endofday",n[_]="delayed",n[f]="delayed_streaming",n[m]="forbidden",n[v]="replay",n),g=0,b=1,S=2,w=0,P=1,C=2,x=3,T=4,I=5,M=6,L=7,O=8,k=9,A=10,E=11,V=12,D=((r={})[0]="bar",r[1]="candle",r[9]="hollowCandle",r[2]="line",r[3]="area",r[4]="renko",r[7]="pb",r[5]="kagi",r[6]="pnf",r[8]="ha",r[10]="baseline",r[11]="range",r[12]="hilo",r),B=((o={})[4]={type:"BarSetRenko@tv-prostudies",basicStudyVersion:40},o[7]={type:"BarSetPriceBreak@tv-prostudies",basicStudyVersion:34},o[5]={type:"BarSetKagi@tv-prostudies",basicStudyVersion:34},o[6]={type:"BarSetPnF@tv-prostudies",basicStudyVersion:34},o[8]={type:"BarSetHeikenAshi@tv-basicstudies",basicStudyVersion:60},o[11]={type:"BarSetRange@tv-basicstudies",basicStudyVersion:72},o)},di4O:function(e,t,i){"use strict";i.r(t),i.d(t,"watermarkProperty",(function(){return u})),i.d(t,"restoreWatermarkPropertyDefaults",(function(){return h}));var n=i("eJTA"),r=i("Vdly"),o=i("tc+8"),s=i.n(o),a={visibility:!1,color:"rgba(80, 83, 94, 0.25)"};function l(){var e=r.getJSON("symbolWatermark"),t=Object.assign({},a,e);if(void 0===e){if(void 0!==r.getJSON("chartproperties")){var i=r.getJSON("chartproperties").symbolWatermarkProperties;if(void 0!==i){var o=Object(n.tryParseRgba)(i.color);t=Object.assign(t,i),null!==o&&(0!==o[3]?t.visibility=!0:(o[3]=.25,t.color=Object(n.rgbaToString)(o)))}}delete t.transparency}return t}var c=null;function u(){return null===c&&(c=new s.a(l()),r.onSync.subscribe(null,(function(){null!==c&&c.mergeAndFire(l())})),c.listeners().subscribe(null,(function(){null!==c&&r.setJSON("symbolWatermark",c.state())}))),c}function h(){null!==c&&c.mergeAndFire(a)}},e1Hy:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t,i){var n=e.call(this,t,i)||this;return n._showStudyValues=i.properties().paneProperties.legendProperties.showStudyValues,n}return Object(n.__extends)(t,e),t.prototype.getValues=function(t){for(var i=e.prototype.getValues.call(this,t),n=this._showStudyValues.value(),r=0,o=i;ri?i:Math.round(t)}function o(e,t,i){return n.isNaN(t)||ti?i:Math.round(1e4*t)/1e4}function s(e){return r(0,e,255)}function a(e){return r(0,e,255)}function l(e){return r(0,e,255)}function c(e){return o(0,e,1)}function u(e){return o(0,e,1)}function h(e){return o(0,e,1)}function d(e){return o(0,e,1)}function p(e){return o(0,e,1)}function _(e){return o(0,e,1)}function f(e){var t=e[0]/255,i=e[1]/255,n=e[2]/255,r=Math.min(t,i,n),o=Math.max(t,i,n),s=0,a=0,l=(r+o)/2;if(r===o)s=0,a=0;else{var c=o-r;switch(a=l>.5?c/(2-o-r):c/(o+r),o){case t:s=((i-n)/c+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?t:i<2/3?e+(t-e)*(2/3-i)*6:e}function v(e){var t,i,n,r=e[0],o=e[1],c=e[2];if(0===o)t=i=n=c;else{var u=c<.5?c*(1+o):c+o-c*o,h=2*c-u;t=m(h,u,r+1/3),i=m(h,u,r),
n=m(h,u,r-1/3)}return[s(255*t),a(255*i),l(255*n)]}t.normalizeRedComponent=s,t.normalizeGreenComponent=a,t.normalizeBlueComponent=l,t.normalizeAlphaComponent=c,t.rgb=function(e,t,i){return[s(e),a(t),l(i)]},t.areEqualRgb=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgba=function(e,t,i,n){if(Array.isArray(e)){var r=e;return n=t,[r[0],r[1],r[2],c(n)]}var o=t;return i=i||0,n=n||0,[s(e),a(o),l(i),c(n)]},t.areEqualRgba=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]},t.normalizeHue=u,t.normalizeHslSaturation=h,t.normalizeHsvSaturation=d,t.normalizeLightness=p,t.normalizeValue=_,t.hsl=function(e,t,i){return[u(e),h(t),p(i)]},t.areEqualHsl=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.hsv=function(e,t,i){return[u(e),d(t),_(i)]},t.areEqualHsv=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]},t.rgbToHsl=f,t.hslToRgb=v,t.rgbToHsv=function(e){var t=e[0],i=e[1],n=e[2],r=t/255,o=i/255,s=n/255,a=Math.min(r,o,s),l=Math.max(r,o,s),c=l-a,u=0,h=0===l?0:c/l,d=l;if(l===a)u=0;else switch(l){case t:u=((o-s)/c+(o255)throw new Error("invalid threshold value, valid values are [0, 255]");return g(e)>=t?"white":"black"},t.tryParseRgb=E,t.parseRgb=function(e){var t=E(e);if(null!==t)return t;throw new Error("Passed color string does not match any of the known color representations")},t.tryParseRgba=V,t.parseRgba=D},ePL1:function(e,t,i){"use strict";i.r(t),i.d(t,"types",(function(){return n}));var n={ECONOMIC:"economic",QUANDL:"quandl"}},eqEH:function(e,t,i){"use strict";i.d(t,"b",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"c",(function(){return l})),i.d(t,"d",(function(){return c}));var n=i("jofe"),r={},o=new Map;function s(e,t){if(a(e))throw new Error("Service already registered");r[e.id]=t;var i=o.get(e.id);void 0!==i&&(o.delete(e.id),i.resolve(t))}function a(e){return void 0!==r[e.id]}function l(e){var t=r[e.id];if(void 0===t)throw new Error("ServiceLocator: Service "+e.id+" not found");return t}function c(e){if(a(e))return Promise.resolve(l(e));var t=o.get(e.id);return void 0===t&&(t=Object(n.createDeferredPromise)(),o.set(e.id,t)),t.promise}},"f+Sq":function(e,t,i){"use strict";function n(e){if(void 0===e)throw new Error("Value is undefined");return e}function r(e){if(null===e)throw new Error("Value is null");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.assert=function(e,t){if(!e)throw new Error("Assertion failed"+(t?": "+t:""))},t.ensureDefined=n,t.ensureNotNull=r,t.ensure=function(e){return r(n(e))}},f3xO:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererUnicodeChar",(function(){return p}));var n=i("mrSG"),r=i("/SnT"),o=i.n(r),s=i("Eyy1"),a=i("aO4+"),l=i("2WC2"),c=i("VdBB"),u=i("Zp/P"),h=i("zDbI"),d=i("gBDZ"),p=function(e){function t(t,i){var n=e.call(this,t,i)||this;n._heightEnsured=Object(s.ensureDefined)(n._height);var r=t.char.slice(0,40);return n._ch=o()(r)[0]||" ",
n._fontFamily=t.fontFamily||h.CHART_FONT_FAMILY,n._charCache=new d.b(n._ch,!1,!1,n._fontFamily,n._heightEnsured),n}return Object(n.__extends)(t,e),t.prototype.hitTest=function(e){for(var t=Object(u.selectionTolerance)(this._heightEnsured),i=0,n=this._items;i0?1:-1,s=i.y+i.vertOffset-o*Math.round(this._heightEnsured/2);n=i.style&&void 0!==i.style.color?i.style.color:this._color,this._charCache.paintTo(e,t,n,r,s,d.a.Center,i.vertOffset>0?d.c.Top:d.c.Bottom)},t.prototype._startPath=function(e,t,i,n){},t.prototype._endPath=function(e){},t}(l.b)},f6yo:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("hBTJ");t.pointInHalfplane=function(e,t){var i=t.edge;return i.A*e.x+i.B*e.y+i.C>0===t.isPositive},t.pointInTriangle=function(e,t,i,r){var o=t.add(i).scaled(.5).add(r).scaled(.5),s=n.intersectLineSegments(t,i,o,e);return null===s&&(null===(s=n.intersectLineSegments(i,r,o,e))&&null===(s=n.intersectLineSegments(r,t,o,e)))},t.pointInBox=function(e,t){return e.x>=t.min.x&&e.x<=t.max.x&&e.y>=t.min.y&&e.y<=t.max.y},t.pointInPolygon=function(e,t){for(var i=t.length-1,n=!1,r=e.x,o=e.y,s=0;s=o||l.y=o)&&a.x+(o-a.y)/(l.y-a.y)*(l.x-a.x)=t.length||e.endIndex>=t.length)return null;var i=t[e.startIndex],n=t[e.endIndex];return i===o.a||n===o.a?null:(Object(r.assert)(i<=n,"startIndex should not exceed endIndex"),{startIndex:i,endIndex:n,level:e.level,extendLeft:e.extendLeft,extendRight:e.extendRight})}function l(e,t,i){var r=Object(s.ensureTimePointIndexIndex)(i.indexOf(e.startIndex)),o=Object(s.ensureTimePointIndexIndex)(i.indexOf(e.endIndex));return Object(n.__assign)(Object(n.__assign)({id:t},e),{startIndex:r,endIndex:o})}},fJhV:function(e,t,i){"use strict";i.r(t),i.d(t,"LineDataSourceTimeAxisView",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t,i){var n=e.call(this,t.model())||this;return n._active=!1,n._source=t,n._pointIndex=i,n}return Object(n.__extends)(t,e),t.prototype.setActive=function(e){this._active=e},t.prototype._getBgColor=function(){return this._active?"#1565C0":this._model.isDark()?"#1E88E5":"#2196F3"},t.prototype._getIndex=function(){if(!this._model.selection().isSelected(this._source))return null;var e=this._source.axisPoints();return e.length<=this._pointIndex?null:e[this._pointIndex].index},t}(i("cgFQ").a)},fPdn:function(e,t,i){"use strict";window.TradingView=window.TradingView||{},window.requireAll=function(e){return e.keys().map(e)},i("6jKD"),i("bZMm"),i("P5fv"),i("YFKU"),i("VUhU"),i("si6p"),i("EsMY"),
i("jjqu"),i("OV6q"),i("SpsL"),i("eqD+"),i("iA8Q"),i("32f0"),i("MApU"),i("w9cH").install(),i("QYoC"),i("oA7e"),i("qFKp"),i("1oAu"),i("ogJP"),i("jFln"),i("HbRj"),i("VVxS"),i("CLNU"),i("mZrn"),i("Vdly"),i("+GxX")},fTGZ:function(e,t,i){"use strict";(function(e,n,r){var o=i("Ss5c").LineDataSource,s=i("ogJP").isNumber,a=i("BOPY").BarsMarksContainerPaneView,l=i("BOPY").BarsMarksContainerRenderer,c=i("Bt3k").TooltipRenderer,u=i("LxhU").Interval,h=i("n5al").isPriceSourceStyle,d=i("txPx").getLogger("Chart.BarsMarksContainer");function p(t,i){this.toolname="Child class must override this member";var s=t._undoModel._chartWidget,a=s.onWidget(),l=!1;l=a?s._options&&!s._options.hideIdeas:!!e.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:l,frozen:!1}):i=new n({visible:l,frozen:!1});var u=this;i.visible.listeners().subscribe(null,(function(t){a||s._containsData||!e.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!t.value()),u._tooltip&&u._tooltip.removeAll()})),o._configureProperties(i),o.call(this,t,i),this.onNeedRepaint=new r,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().symbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().dataEvents().tickMarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new c(this._createTooltip.bind(this),this)}inherit(p,o),p.prototype._initialize=function(e){throw new Error("Child class must override this member")},p.prototype.onClicked=function(){throw new Error("Child class must override this member")},p.prototype._getData=function(e){throw new Error("Child class must override this member")},p.prototype._createTooltip=function(){throw new Error("Child class must override this member")},p.prototype.updateDotData=function(e,t){return t},p.prototype.updatePlateData=function(e,t){},p.prototype.isAvailableInFloatingWidget=function(){return!1},p.prototype._plateViewData=function(e){return{}},p.prototype.pinTooltip=function(e,t){this.pinnedTooltips[e]=t},p.prototype.timeScale=function(){return this._model.timeScale()},p.prototype.getIntervalInTicks=function(){var e=this._model.mainSeries().properties().interval.value(),t=u.parse(e);if(!t.isValid())throw new TypeError("Unexpected interval");return t.isRange()?60:t.inMilliseconds()/1e3},p.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),p.prototype.getVisibleTickMarksRange=function(){if(this.timeScale().isEmpty())return{start:0,end:0};var e,t=this.timeScale().visibleBarsStrictRange();return t.lastBar()>this.timeScale().points().firstIndex()&&t.firstBar()=t.start&&o<=t.end+i&&e.push(r)}),this),e},p.prototype.getPublishedPlates=function(){var e={},t=this;return is_authenticated?(this.getVisibleRangePlates().forEach((function(i){i.is_public&&(t.pinnedTooltips[i.id]||i.user__id===user.id)&&(e[i.id]=i)})),e):e},p.prototype._maxPlatesPerBar=10,p.prototype.filterDisplayedPlates=function(e){return e=e.reduce(function(e,t){var i=this._getIndex(t.tickmark);return e[i]=e[i]||[],e[i].push(t),e}.bind(this),{}),e=Object.keys(e).reduce(function(t,i){var n=e[i];return n=(n=n.sort((function(e,t){return t.views_count-e.views_count}))).slice(0,this._maxPlatesPerBar),t.concat(n)}.bind(this),[])},p.prototype._layout=function(e){switch(e){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},p.prototype._theme=function(e){switch(e){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}},p.prototype._offset=function(e,t,i){var n;switch(e){default:case"up":n=null===i?t[TradingView.HIGH_PLOT]:i(t);break;case"down":n=null===i?t[TradingView.LOW_PLOT]:i(t)}return this.priceScale().priceToCoordinate(n,this.ownerSource().firstValue())},p.prototype._getIndex=function(e){return this.timeScale().timePointToIndex(e)},p.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},p.prototype.barWidth=function(){return this.timeScale().barSpacing()},p.prototype.getPlatesViewData=function(){var e=this._model.mainSeries();if(e.data().isEmpty())return[];for(var t=h(e.style())?e.barFunction():null,i=this.filterDisplayedPlates(this.getVisibleRangePlates()),n=this,r={},o=this._model.lastHittestData(),s=(i=(i=i.map(function(e){var i=this._getIndex(e.tickmark),s=this._getBar(i);if(null===s)return!1;var a,l=this._layout(e.direction),c=this._theme(e.direction),u=o&&o.id===e.id,h=this.timeScale().indexToCoordinate(i),d=this._offset(l,s,t),p=this.priceScale().isInverted();return i in r||(r[i]={up:0,down:0}),a=r[i][l]++,TradingView.merge({id:e.id,x:h,y:d,yInverted:p,order:a,direction:l,theme:c,hovered:u,pinned:!0===n.pinnedTooltips[e.id],user__id:e.user__id,label:e.label,labelFontColor:e.labelFontColor||"#444",minSize:e.minSize||5},this._plateViewData(e))}.bind(this))).filter((function(e){return!!e}))).filter((function(e){return!0===e.hovered})),a=0;athis._loadedRange.end&&(e.start=this._loadedRange.end)),e},p.prototype._rangeUnion=function(e,t){return e=Object.assign({},e),t&&(e.start=Math.min(t.start,e.start),e.end=Math.max(t.end,e.end)),e},p.prototype._pushGetDataStack=function(e){s(e.start)&&s(e.end)?(this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(e,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)):d.logError("Wrong tickmark range")},p.prototype.roundRange=function(e){return{start:Math.round(e.start),end:Math.round(e.end)}},p.prototype.refreshData=function(){this.getData(this._lastRange)},p.prototype.getData=function(e){s(e.start)&&s(e.end)?(this._lastRange=e,(e=Object.assign({},e)).end=this._maxDate,this._pushGetDataStack(e)):d.logError("Wrong range")},p.prototype._abortAllRequests=function(){this._requests.forEach((function(e){e.abort()})),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},p.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},t.BarsMarksContainer=p}).call(this,i("Kxc7"),i("tc+8"),i("aIyQ"))},fYB8:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneSeparator",(function(){return a}));var n=i("Eyy1"),r=i("Hr11"),o=i("S8xo"),s=i("ikwP"),a=(i("bc0y"),function(){function e(e,t,i,n){if(this._handleEl=null,this._startY=0,this._deltaY=0,this._totalHeight=0,this._totalStretch=0,this._prevStretchA=0,this._minPaneHeight=0,this._maxPaneHeight=0,this._pixelStretchFactor=0,this._mouseEventHandler=null,this._chart=e,this._paneA=e.paneWidgets()[t],this._paneB=e.paneWidgets()[i],this._row=document.createElement("tr"),this._row.style.height="1px",this._cell=document.createElement("td"),this._row.appendChild(this._cell),this._cell.classList.add("pane-separator"),this._cell.setAttribute("colspan","3"),this._cell.style.background=(this._chart.properties().childs().scalesProperties.childs().lineColor.value()||"").toString(),this._cell.addEventListener("click",(function(){})),n)this._mouseEventHandler=null;else{var r=document.createElement("div");r.classList.add("handle"),this._cell.appendChild(r),this._mouseEventHandler=new o.MouseEventHandler(r,this,{treatVertTouchDragAsPageScroll:!1,treatHorzTouchDragAsPageScroll:!0}),this._handleEl=r}}return e.prototype.destroy=function(){null!==this._mouseEventHandler&&this._mouseEventHandler.destroy(),this._row.parentElement&&this._row.parentElement.removeChild(this._row)},e.prototype.getElement=function(){
return this._row},e.prototype.hide=function(){this._row.classList.add("js-hidden")},e.prototype.show=function(){this._row.classList.remove("js-hidden")},e.prototype.mouseDownEvent=function(e){this._mouseDownOrTouchStartEvent(e)},e.prototype.touchStartEvent=function(e){this._mouseDownOrTouchStartEvent(e)},e.prototype.pressedMouseMoveEvent=function(e){this._pressedMouseOrTouchMoveEvent(e)},e.prototype.touchMoveEvent=function(e){this._pressedMouseOrTouchMoveEvent(e)},e.prototype.mouseUpEvent=function(e){this._mouseUpOrTouchEndEvent(e)},e.prototype.touchEndEvent=function(e){this._mouseUpOrTouchEndEvent(e)},e.prototype.update=function(){this._cell.style.background=this._color().toString()},e.prototype.paint=function(){},e.prototype.image=function(){var e=this._paneA.leftPriceAxisesContainer().getWidth(),t=this._paneA.width(),i=this._paneA.rightPriceAxisesContainer().getWidth(),n=this._color(),r=Object(s.createDisconnectedCanvas)(document,new s.Size(e,1)),o=Object(s.getPrescaledContext2D)(r);o.fillStyle=n,o.fillRect(0,0,e,1);var a=Object(s.createDisconnectedCanvas)(document,new s.Size(t,1)),l=Object(s.getPrescaledContext2D)(a);l.fillStyle=n,l.fillRect(0,0,t,1);var c=Object(s.createDisconnectedCanvas)(document,new s.Size(i,1)),u=Object(s.getPrescaledContext2D)(c);return u.fillStyle=n,u.fillRect(0,0,i,1),{type:"separator",leftAxis:{content:r.toDataURL(),canvas:r,contentWidth:e,contentHeight:1},rightAxis:{content:c.toDataURL(),canvas:c,contentWidth:i,contentHeight:1},content:a.toDataURL(),canvas:a,contentWidth:t,contentHeight:1}},e.height=function(){return 1},e.prototype._mouseDownOrTouchStartEvent=function(e){this._startY=e.pageY,this._deltaY=0,this._totalHeight=this._paneA.height()+this._paneB.height(),this._totalStretch=this._paneA.state().stretchFactor()+this._paneB.state().stretchFactor(),this._prevStretchA=this._paneA.state().stretchFactor(),this._minPaneHeight=30,this._maxPaneHeight=this._totalHeight-this._minPaneHeight,this._pixelStretchFactor=this._totalStretch/this._totalHeight,Object(n.ensureNotNull)(this._handleEl).classList.add("i-active")},e.prototype._pressedMouseOrTouchMoveEvent=function(e){this._deltaY=e.pageY-this._startY;var t=this._paneA.height(),i=Object(r.clamp)(t+this._deltaY,this._minPaneHeight,this._maxPaneHeight)*this._pixelStretchFactor,n=this._totalStretch-i;this._paneA.state().setStretchFactor(i),this._paneB.state().setStretchFactor(n),this._chart.adjustSize(),this._paneA.height()!==t&&(this._startY=e.pageY),this._chart.model().model().fullUpdate()},e.prototype._mouseUpOrTouchEndEvent=function(e){this._chart.model().addPaneStretchFactorUndoCommand(this._paneA.state(),this._paneB.state(),this._prevStretchA,this._paneA.state().stretchFactor()),this._startY=0,this._deltaY=0,this._totalHeight=0,this._totalStretch=0,this._minPaneHeight=0,this._maxPaneHeight=0,this._pixelStretchFactor=0,Object(n.ensureNotNull)(this._handleEl).classList.remove("i-active")},e.prototype._color=function(){return this._chart.properties().childs().scalesProperties.childs().lineColor.value()||""},e}())},fgLi:function(e,t,i){
"use strict";i.r(t),i.d(t,"DataSource",(function(){return l}));var n=i("hY0g"),r=i.n(n),o=i("e3/o"),s=i("aIyQ"),a=i.n(s),l=function(){function e(){this.hasAlert=new r.a(!1),this._zorder=0,this.m_priceScale=null,this._id=Object(o.randomHashN)(6),this._ownerSource=null,this._userEditEnabled=!0,this._onPriceScaleChanged=new a.a,this._ownerSourceChanged=new a.a}return e.prototype.id=function(){return this._id},e.prototype.preferNoScale=function(){return!1},e.prototype.idForAlert=function(){return this._id},e.prototype.setId=function(e){this._id=e},e.prototype.zorder=function(){return this._zorder},e.prototype.setZorder=function(e){"number"==typeof e&&this._zorder!==e&&(this._zorder=e)},e.prototype.title=function(){throw new Error("Implement this fun in a subclass")},e.prototype.priceScale=function(){return this.m_priceScale},e.prototype.setPriceScale=function(e){this.m_priceScale=e,this._onPriceScaleChanged.fire()},e.prototype.ownerSource=function(){return this._ownerSource},e.prototype.setOwnerSource=function(e){this._ownerSource=e,this._ownerSourceChanged.fire()},e.prototype.ownerSourceChanged=function(){return this._ownerSourceChanged},e.prototype.isSavedInChart=function(e){return!0},e.prototype.isSavedInStudyTemplates=function(){return!0},e.prototype.isRemovedByStudyTemplates=function(){return!0},e.prototype.hasContextMenu=function(){return!0},e.prototype.showInObjectTree=function(){return!0},e.prototype.setUserEditEnabled=function(e){this._userEditEnabled=e},e.prototype.userEditEnabled=function(){return this._userEditEnabled},e.prototype.canBeHidden=function(){return this.userEditEnabled()},e.prototype.isUserDeletable=function(){return this.userEditEnabled()},e.prototype.canHasAlert=function(){return!1},e.prototype.properties=function(){throw new Error("Implement this fun in a subclass")},e.prototype.isVisible=function(){return this.properties().visible.value()},e.prototype.statusView=function(){return null},e.prototype.dataWindowView=function(){return null},e.prototype.legendView=function(){return null},e.prototype.marketStatusModel=function(){return null},e.prototype.dataUpdatedModeModel=function(){return null},e.prototype.dataProblemModel=function(){return null},e.prototype.priceAxisViews=function(e,t){return null},e.prototype.updateAllViews=function(){},e.prototype.paneViews=function(){return null},e.prototype.labelPaneViews=function(){return null},e.prototype.isFailed=function(){return!1},e.prototype.isLoading=function(){return!1},e.prototype.isChildStudy=function(){return!1},e.prototype.hasChildren=function(){return!1},e.prototype.canHaveChildren=function(){return!1},e.prototype.onClickOutside=function(){},e.prototype.getInputsPropertyPage=function(){return null},e.prototype.getStylesPropertyPage=function(){return null},e.prototype.getDisplayPropertyPage=function(){return null},e.prototype.getVisibilitiesPropertyPage=function(){return null},e.prototype.getSourceIcon=function(){return null},e.prototype.state=function(e){throw new Error("Implement this fun in a subclass")},
e.prototype.onPriceScaleChanged=function(){return this._onPriceScaleChanged},e.prototype.doesMovingAffectsUndo=function(){return!0},e.prototype.copiable=function(){return!1},e.prototype.cloneable=function(){return!1},e.prototype.movable=function(){return!1},e.prototype.isIncludedInAutoScale=function(){return!1},e.prototype.priceRange=function(e,t){return null},e.prototype.autoScaleInfo=function(e,t){return{range:this.priceRange(e,t)}},e}()},fs3R:function(e,t){e.exports=''},fxzW:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererDiamond",(function(){return s}));var n=i("mrSG"),r=i("2WC2"),o=i("aO4+"),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._drawItemShapeUsingCSSPixels=function(e,t){var i=Math.round(t.height/2),n=t.x,r=t.vertOffset,o=t.y+r;e.moveTo(n,o-i),e.lineTo(n+i,o),e.lineTo(n,o+i),e.lineTo(n-i,o),e.lineTo(n,o-i)},t.prototype._calcBoundingBox=function(t){var i=Math.round(t.height/2),n=t.x,r=t.vertOffset,s=t.y+r,a=n-i,l=n+i,c=s-i,u=s+i,h=new o.Point(a,c),d=new o.Point(l,u),p=Object(o.box)(h,d),_=e.prototype._calcBoundingBox.call(this,t);return _&&(p=this._unionBox(p,_)),p},t}(r.a)},g5Qf:function(e,t,i){"use strict";i.r(t),i.d(t,"getFavoriteDrawingToolbarPromise",(function(){return s})),i.d(t,"createFavoriteDrawingToolbar",(function(){return a}));i("YFKU");var n=i("yMne"),r=null,o=null;function s(){return o}function a(){null===o&&(o=new Promise((function(e){Promise.all([i.e(32),i.e(39),i.e(63),i.e(77),i.e(15),i.e(30),i.e(35),i.e(47),i.e(57),i.e("floating-toolbars")]).then(function(t){if(null===r){var o=i("gmn6").FavoriteDrawingToolbar;r=new o({left:window.innerWidth/2,top:n.HEADER_TOOLBAR_HEIGHT_EXPANDED+61}),e(r)}}.bind(null,i)).catch(void 0)})))}},gAom:function(e,t,i){"use strict";function n(e,t,i,n,r,o,s){e.save(),e.globalCompositeOperation="copy";var a=e.createLinearGradient(0,0,0,r);a.addColorStop(0,o),a.addColorStop(1,s),e.fillStyle=a,e.fillRect(t,i,n,r),e.restore()}function r(e,t,i,n,r,o){e.fillRect(t+o,i,n-2*o,o),e.fillRect(t+o,i+r-o,n-2*o,o),e.fillRect(t,i,o,r),e.fillRect(t+n-o,i,o,r)}function o(e,t,i,n){e.beginPath();var r=e.lineWidth%2?.5:0;e.moveTo(i,t+r),e.lineTo(n,t+r),e.stroke()}function s(e,t,i,n){e.beginPath();var r=e.lineWidth%2?.5:0;e.moveTo(t+r,i),e.lineTo(t+r,n),e.stroke()}i.r(t),i.d(t,"clearRectWithGradient",(function(){return n})),i.d(t,"fillRectInnerBorder",(function(){return r})),i.d(t,"drawHorizontalLine",(function(){return o})),i.d(t,"drawVerticalLine",(function(){return s}))},gBDZ:function(e,t,i){"use strict";i.d(t,"a",(function(){return n})),i.d(t,"c",(function(){return r})),i.d(t,"b",(function(){return c}));var n,r,o=i("Eyy1"),s=i("XlJ7"),a=i("c44N"),l=i("ikwP");!function(e){e.Left="left",
e.Right="right",e.Center="center"}(n||(n={})),function(e){e.Top="top",e.Bottom="bottom",e.Middle="middle"}(r||(r={}));var c=function(){function e(e,t,i,n,r,a){void 0===a&&(a="center"),this._cacheRenderParams=null,this._canvasesMap={},this._lines=e.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=function(e,t,i,n){return Object(s.makeFont)(n,i,(e?"bold ":"")+(t?"italic ":""))}(t,i,n,r),this._fontSize=r,this._verticalPadding=~~(r/6),this._textAlign=a;var c=Object(l.createDisconnectedCanvas)(document,new l.Size(0,0),1),u=Object(o.ensureNotNull)(c.getContext("2d"));u.font=this._font;for(var h=0,d=0,p=this._lines;d0){var i=this._strategySources[this._strategySources.length-1];this.setActiveStrategySource(i)}this._strategySourcesChange.fire()}},e.prototype.setActiveStrategySource=function(e){-1!==this._strategySources.indexOf(e)&&this._activeStrategySource.setValue(e)},e.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},e.prototype.activeStrategySource=function(){return this._activeStrategySource},e.prototype.strategySources=function(){return this._strategySources},e.prototype.strategySourcesChange=function(){return this._strategySourcesChange},e.prototype.setScrollEnabled=function(e){this._scrollEnabled=e},e.prototype.scrollEnabled=function(){return this._scrollEnabled},e.prototype.setZoomEnabled=function(e){this._zoomEnabled=e},e.prototype.zoomEnabled=function(){return this._zoomEnabled},e.prototype.onTagsChanged=function(){return this._tagsChanged},e.prototype.canZoomIn=function(){return this._timeScale.canZoomIn()&&this._zoomEnabled},e.prototype.canZoomOut=function(){return this._timeScale.canZoomOut()&&this._zoomEnabled},e.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},e.prototype.panesCollectionChanged=function(){return this._panesCollectionChanged},e.prototype.dataSourceCollectionChanged=function(){return this._dataSourceCollectionChanged},e.prototype.sourceProperitesChanged=function(){return this._sourceProperitesChanged},e.prototype.updateCrosshair=function(){var e=this.crossHairSource(),t=e.pane;if(null!==t){var i=e.originCoordX(),n=e.originCoordY();this.setAndSaveCurrentPosition(i,n,t)}},e.prototype.zoomTime=function(e,t,i){if(this._zoomEnabled){var n=this.timeScale();if(!n.isEmpty()&&0!==t){var r=n.width();e=Math.max(1,Math.min(e,r-2)),n.zoom(e,t,i),this.updateCrosshair(),this.recalculateAllPanes(),this.lightUpdate(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudies(),this._setScalesResetAvailable(!0)}}},e.prototype.lineToolsGroupModel=function(){return this._lineToolsGroupModel},e.prototype.restoreLineToolsGroups=function(e){this._lineToolsGroupModel=C.LineToolsGroupModel.fromState(this,e)},e.prototype.updateSource=function(e){var t=this._invalidationMaskForSource(e);null!==t&&this.invalidate(t)},e.prototype.updateSourcePriceScale=function(e){var t=this._invalidationMaskForSourcePriceScale(e);null!==t&&this.invalidate(t)},e.prototype.replaceStudyStub=function(e,t){var i=this.paneForSource(e);if(null===i)return!1;var n=e.priceScale(),r=e.zorder(),o=e.ownerSource();return this.paneForSource(e)===i?i.replaceSource(e,t,n):(i.insertDataSource(t,n,r),this.removeSource(e)),
t.setOwnerSource(o),this.dataSources().forEach((function(i){i.ownerSource()===e&&i.setOwnerSource(t)})),t.start(),this.recalculatePane(i),this.fullUpdate(),!0},e.prototype.insertStudyStub=function(e){var t=this.mainSeries(),i=Object(n.ensureNotNull)(this.paneForSource(t)),r=new a.StudyStub(this,null,e),o=i.createPriceScaleAtPosition("overlay");return i.addDataSource(r,o,!1),this.recalculatePane(i),this.fullUpdate(),r},e.prototype.removeStudyStub=function(e){var t=this.dataSourceForId(e);return null===t?(E.logNormal("StudyStub id="+e+" is not found in chart model"),!1):(this.removeSource(t),!0)},e.prototype.setHoveredSource=function(e,t){var i=this._hoveredSource!==e;if(i||this._lastHittestData!==t){this._lastHittestData=t;var n,r=null;if(this._hoveredSource)this._hoveredSource.updateAllViews(),r=new v.InvalidationMask(v.InvalidationLevel.Cursor),null!==(n=this._invalidationMaskForSource(this._hoveredSource,v.InvalidationLevel.Light))&&r.merge(n);if(this._hoveredSource=e,e)e.updateAllViews(),r||(r=new v.InvalidationMask(v.InvalidationLevel.Cursor)),null!==(n=this._invalidationMaskForSource(e,v.InvalidationLevel.Light))&&r.merge(n);r&&this.invalidate(r),i&&this._hoveredSourceChanged.fire(e)}},e.prototype.hoveredSource=function(){return this._hoveredSource},e.prototype.hoveredSourceChanged=function(){return this._hoveredSourceChanged},e.prototype.lastHittestData=function(){return this._lastHittestData},e.prototype.findNonOverlayStudyWithGroupingKey=function(e,t){for(var i=function(t){var i=t.dataSources().find((function(i){return Object(d.isStudy)(i)&&i.metaInfo().groupingKey===e&&!t.isOverlay(i)}));if(void 0!==i)return{value:{pane:t,study:i}}},n=0,r=void 0!==t?[t]:this._panes;n=0&&e1)return void t.setValue(!1)}t.setValue(!0)}},e.prototype._pointToPercentPosition=function(e,t){return{x:e.x/this._timeScale.width(),y:e.y/Object(n.ensureNotNull)(Object(n.ensureNotNull)(t.mainDataSource()).priceScale()).height()}},e.prototype._percentPositionToPoint=function(e,t){var i=e.x*this._timeScale.width(),o=e.y*Object(n.ensureNotNull)(Object(n.ensureNotNull)(t.mainDataSource()).priceScale()).height();return new r.Point(i,o)},e.prototype._recalcVisibleRangeStudiesImpl=function(){if(this._recalcVRStudiesParams.timerId=null,!this.timeScale().isEmpty()){var e=this.timeScale().visibleBarsStrictRange();if(null!==e){var t=this.mainSeries().nearestData(e.firstBar(),A.PlotRowSearchMode.NearestRight),i=this.mainSeries().nearestData(e.lastBar(),A.PlotRowSearchMode.NearestLeft),n=this.mainSeries().bars().lastIndex(),r=t?t.index:void 0,o=i?i.index:void 0,s=r===this._oldStartVisibleIndex,a=o===this._oldEndVisibleIndex;if(!s||!a||this._recalcVRStudiesParams.force){this._recalcVRStudiesParams.force=!1;var l={
first_visible_bar_time:1e3*Math.floor(t&&t.value?t.value[0]:0),last_visible_bar_time:1e3*Math.floor(i&&i.value?i.value[0]:0),subscribeRealtime:i&&i.index===n},c=this._recalcVRStudiesParams.studies||this.dataSources();this._recalcVRStudiesParams.studies=void 0;for(var u=0,h=c;u0&&y.listeners().fire(y)}}}}}},e.prototype._getAvailableCurrencies=function(){var e=this;return this._options.currencyLabelEnabled?Object(L.isArray)(this._availableCurrencies)?this._availableCurrencies:(null!==this._availableCurrencies||(this._availableCurrencies=this.chartApi().availableCurrencies(),this._availableCurrencies.then((function(t){e._destroyed||(e._availableCurrencies=t,e.lightUpdate())})).catch((function(t){E.logWarn("An error occurred while getting available currencies: "+t),e._availableCurrencies=null}))),[]):[]},e.prototype._getBackgroundColor=function(e){var t=this._properties.childs().paneProperties.childs();return t.backgroundType.value()===k.ColorType.Gradient?e?t.backgroundGradientStartColor.value():t.backgroundGradientEndColor.value():t.background.value()},e.prototype._updateBackgroundColor=function(){this._backgroundColor.setValue(this._getBackgroundColor()),this._backgroundTopColor.setValue(this._getBackgroundColor(!0))},e}()},gQ5K:function(e,t,i){"use strict";i.r(t),i.d(t,"DateFormatter",(function(){return o}));var n=i("kcTO"),r=i("e1ZQ"),o=function(){function e(e){void 0===e&&(e="yyyy-MM-dd"),this._dateFormatFunc=r.b[e]}return e.prototype.format=function(e){return n.customFormatters&&n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)},e.prototype.formatLocal=function(e){return n.customFormatters.dateFormatter?n.customFormatters.dateFormatter.formatLocal?n.customFormatters.dateFormatter.formatLocal(e):n.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)},e}()},gTEF:function(e,t,i){"use strict";i.r(t),i.d(t,"SelectionRendererArrowsUpDown",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=i("vq8G"),s=i("6Fc/"),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return Object(n.__extends)(t,e),t.prototype._drawMarker=function(e,t,i,n,o){var a=Object(r.ensureNotNull)(this._data),l=t.isUp?1:-1,c=i+l*Object(s.calculateVerticalOffset)(a.barSpacing)+l*Object(s.calculateMinHeight)(a.barSpacing),u=Math.round(3.5*o*2);u%2!=n%2&&(u+=1);var h=n%2/2,d=Math.round(t.x*o)+h,p=Math.round((t.y+c)*o)+h;e.beginPath(),e.arc(d,p,u/2,0,2*Math.PI,!0),e.closePath(),e.fill(),e.stroke()},t}(o.SelectionRenderer)},gVWb:function(e,t,i){"use strict";i.r(t),i.d(t,"PaneRendererBackground",(function(){return n}));var n=function(){function e(e){this._data=e}return e.prototype.draw=function(e,t){},e.prototype.drawBackground=function(e,t){e.save();for(var i=this._data,n=t.pixelRatio,r=0;r2;){var d=Math.round((h+u)/2);this.items[d].x<=e.x?u=d:h=d}u=Math.max(1,u-1),h=Math.min(this.items.length-1,h+1);for(var p=u;p<=h;++p)if(t=this.items[p-1],i=this.items[p],a=t.x,l=i.x,r(new n(a,t.y),new n(l,i.y),new n(e.x,e.y)).distance<=c)return this.hittest?this.hittest:new s(s.REGULAR);return null},t.PaneRendererLine=TradingView.PaneRendererLine=l},h24c:function(e,t,i){"use strict";i.r(t),i.d(t,"parseIntervalValue",(function(){return c})),i.d(t,"intervalIsSupported",(function(){return u})),i.d(t,"canShowSpreadActions",(function(){return h})),i.d(t,"globalKeypressMatches",(function(){return d})),i.d(t,"skipAccept",(function(){return p})),i.d(t,"syncSymbolSearch",(function(){return _})),i.d(t,"setLinkingResolution",(function(){return f}));var n=i("Kxc7"),r=i("pPtI"),o=i("PT1i"),s=i("LxhU"),a=i("ePL1"),l=new RegExp("^"+a.types.QUANDL,"i");function c(e){var t=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(e)||[],i=~~t[1],n=t[2]&&t[2].toUpperCase()||null,r={qty:!i&&n?1:i,unit:n};return r.error=!i&&!n,r.intraday=!(r.error||r.unit&&"H"!==r.unit),r}function u(e){if(n.enabled("allow_supported_resolutions_set_only")){var t=s.Interval.normalize(e);return null!==t&&Object(r.isAvailable)(t)
}var i=c(e);if(i.error)return!1;if(i.intraday)return o.linking.intraday.value();var a=o.linking.supportedResolutions.value();return!a||null!==i.unit&&!!~a.indexOf(i.unit)}function h(){return!1}function d(e){return!e.ctrlKey&&(!e.metaKey&&(!!e.charCode&&(!(!e.which||e.which<=32)&&(null===e.target||!/^(input|textarea)$/i.test(e.target.tagName)))))}function p(e,t){return!t&&(e===o.linking.symbol.value()||e===o.linking.seriesShortSymbol.value())}function _(e,t){var i=o.linking.symbol.value()||"";i=function(e,t){if(!t)return e;if(l.test(e)){var i=e.split(/\//);i.length&&(e=i[i.length-1])}else e=o.linking.seriesShortSymbol.value()||e;return e}(i,t),e.val(i)}function f(e){Object(r.setLastUsedResolution)(e),o.linking.interval.setValue(e)}},hBTJ:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("Eyy1"),r=i("aO4+"),o=i("GEp6"),s=i("f6yo");function a(e,t){var i=e.A,n=t.A,o=e.B,s=t.B,a=e.C,l=t.C,c=i*s-n*o;if(Math.abs(c)<1e-6)return null;var u=(o*l-s*a)/c,h=(n*a-i*l)/c;return new r.Point(u,h)}function l(e,t,i,n){var r=function(e,t,i,n){var r=t.subtract(e),o=n.subtract(i),s=r.x*o.y-r.y*o.x;if(Math.abs(s)<1e-6)return null;var a=e.subtract(i);return(a.y*o.x-a.x*o.y)/s}(e,t,i,n);if(null===r)return null;var s=t.subtract(e).scaled(r).add(e),a=o.distanceToSegment(i,n,s);return Math.abs(a.distance)<1e-6?r:null}function c(e,t){for(var i=0,n=e;i0&&r.equalPoints(e[e.length-1],t))&&(e.push(t),!0)}function h(e,t){for(var i=[],n=0;n=3?i:null}t.intersectLineSegmentAndBox=function(e,t){var i=e[0].x,n=e[0].y,o=e[1].x,s=e[1].y,a=t.min.x,l=t.min.y,c=t.max.x,u=t.max.y;function h(e,t,i,n,r,o){var s=0;return er&&(s|=2),to&&(s|=8),s}for(var d=h(i,n,a,l,c,u),p=h(o,s,a,l,c,u),_=!1,f=0;;){if(f>1e3)throw new Error("Cohen - Sutherland algorithm: infinity loop");if(f++,!(d|p)){_=!0;break}if(d&p)break;var m=d||p,v=void 0,y=void 0;8&m?(v=i+(o-i)*(u-n)/(s-n),y=u):4&m?(v=i+(o-i)*(l-n)/(s-n),y=l):2&m?(y=n+(s-n)*(c-i)/(o-i),v=c):(y=n+(s-n)*(a-i)/(o-i),v=a),m===d?d=h(i=v,n=y,a,l,c,u):p=h(o=v,s=y,a,l,c,u)}return _?r.equalPoints(r.point(i,n),r.point(o,s))?r.point(i,n):r.lineSegment(r.point(i,n),r.point(o,s)):null},t.intersectLines=a,t.intersectLineSegments=l,t.intersectLineAndBox=function(e,t){var i=t.min.x,o=t.min.y,s=t.max.x,a=t.max.y;if(0===e.A){var l=-e.C/e.B;return o<=l&&l<=a?r.lineSegment(r.point(i,l),r.point(s,l)):null}if(0===e.B){var u=-e.C/e.A;return i<=u&&u<=s?r.lineSegment(r.point(u,o),r.point(u,a)):null}var h=[],d=function(t){var i=function(e,t){return-(e.C+e.A*t)/e.B}(e,t);o<=i&&i<=a&&c(h,new r.Point(t,i))},p=function(t){var n=function(e,t){return-(e.C+e.B*t)/e.A}(e,t);i<=n&&n<=s&&c(h,new r.Point(n,t))};switch(d(i),p(o),d(s),p(a),h.length){
case 0:return null;case 1:return h[0];case 2:return r.equalPoints(h[0],h[1])?h[0]:r.lineSegment(h[0],h[1])}return n.assert(!1,"We should have at most two intersection points"),null},t.intersectRayAndBox=function(e,t,i){var n=l(e,t,i.min,new r.Point(i.max.x,i.min.y)),o=l(e,t,new r.Point(i.max.x,i.min.y),i.max),a=l(e,t,i.max,new r.Point(i.min.x,i.max.y)),c=l(e,t,new r.Point(i.min.x,i.max.y),i.min),u=[];if(null!==n&&n>=0&&u.push(n),null!==o&&o>=0&&u.push(o),null!==a&&a>=0&&u.push(a),null!==c&&c>=0&&u.push(c),0===u.length)return null;u.sort((function(e,t){return e-t}));var h=s.pointInBox(e,i)?u[0]:u[u.length-1];return e.addScaled(t.subtract(e),h)},t.intersectPolygonAndHalfplane=h,t.intersectPolygons=function(e,t){for(var i=e,n=0;n0){var d=this._points[this._points.length-1],p=this._model.timeScale().indexToCoordinate(d.index),_=d.price,f=a.priceToCoordinate(_,u);if(new o.Point(l,h).subtract(new o.Point(p,f)).length()<5)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;var m=this._points[0],v=this._model.timeScale().indexToCoordinate(m.index),y=m.price,g=a.priceToCoordinate(y,u);if(new o.Point(l,h).subtract(new o.Point(v,g)).length()<5)return this.properties().childs().filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return e.prototype.addPoint.call(this,t,i,n)},t.prototype.setPoint=function(t,i,n){var s;e.prototype.setPoint.call(this,t,i,n);var a=this.priceScale();if(!(this._model.timeScale().isEmpty()||null===a||a.isEmpty()||t!==this._points.length-1&&0!==t)){
var l=Object(r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue()),c=this._model.timeScale().indexToCoordinate(i.index),u=a.priceToCoordinate(i.price,l),h=t===this._points.length-1?this._points[0]:this._points[this._points.length-1],d=this._model.timeScale().indexToCoordinate(h.index),p=a.priceToCoordinate(h.price,l);new o.Point(c,u).subtract(new o.Point(d,p)).length()<5&&this.properties().childs().filled.setValue(!0)}},t.createProperties=function(e){var i=new a.DefaultProperty("linetoolpolyline",e);return t._configureProperties(i),i},t.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(i.bind(null,"91EF")).then((function(e){return e.PolylinesDefinitionsViewModel}))},t._configureProperties=function(e){l.LineDataSource._configureProperties(e),e.addExclusion("filled")},t}(l.LineDataSource)},hY0g:function(e,t,i){"use strict";(function(e){var t=i("txPx").getLogger("Common.WatchedValue");function n(){}function r(e){if(!(this instanceof r))return new r(e);arguments.length>0&&(this._value=e),this._listeners=[]}r.prototype.value=function(){return this._owner?this._owner._value:this._value},r.prototype.setValue=function(e,i){var n=this._owner?this._owner:this;if("function"==typeof n.hook&&(e=n.hook(e)),n.writeLock)return n._value;if(!i&&n._value===e&&n.hasOwnProperty("_value"))return e;n._value=e;for(var r=n._listeners.slice(),o=0,s=0;s=1&&t<=15?"1D":"1W"}throw new Error("Unexpected resolution type: "+e.symbol.resolution)}(e);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw new Error("No such pivTimeFrame: "+t)}}var u={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:function(){function e(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return e.prototype.init=function(e,t){var i=t(0),r=t(1),o=t(2),a=t(3);this._data=new s,this._firstMainSeriesBarTime=NaN,this._kindPP=function(e){switch(e){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw new Error("Unknown kind "+e)}}(i),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=o,this._isValidResolution=function(e,t){return(!n.Std.isdaily(e)||"Daily"!==t)&&((!n.Std.isweekly(e)||"Daily"!==t&&"Weekly"!==t)&&(!n.Std.ismonthly(e)||"Daily"!==t&&"Weekly"!==t&&"Monthly"!==t))}(e,this._pivTimeFrame),this._isValidResolution||n.Std.error("You cannot see this pivot timeframe on this resolution"),this._isValidResolution&&(this._secondaryRes=c(e,this._pivTimeFrame));var l=""===e.symbol.resolution?String(Math.max(30,2*e.symbol.interval)):e.symbol.period;e.new_sym(e.symbol.tickerid,this._secondaryRes,this._secondaryRes,l)},e.prototype.main=function(e){if(!this._isValidResolution)return null;if(e.symbol.time)return isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=e.symbol.time,this._removeUnusedPivots()),e.symbol.isLastBar&&e.symbol.isNewBar?this._createResponse():null;e.select_sym(1);var t=e.new_var(n.Std.open(e)),i=e.new_var(n.Std.high(e)),r=e.new_var(n.Std.low(e)),s=e.new_var(n.Std.close(e)),a=e.new_var(n.Std.time(e)),c=this._data,u=t.get(0),h=a.get(0),d=t.get(1),p=i.get(1),_=r.get(1),f=s.get(1),m=e.symbol.isLastBar;if(0!==c.pivots.length&&e.symbol.isNewBar){var v=c.pivots[c.pivots.length-1];v.endIndex__t!==h&&(v.endIndex__t=h)}if(0===e.symbol.index||!e.symbol.isNewBar)return e.select_sym(0),null;var y=function(e,t,i,r,s,a,l,c){var u=new o,h=NaN,d=i-r;switch(c){case 0:h=(i+r+s)/3,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+(i-r),u.s2=h-(i-r),u.r3=2*h+(i-2*r),u.s3=2*h-(2*i-r),
u.r4=3*h+(i-3*r),u.s4=3*h-(3*i-r),u.r5=4*h+(i-4*r),u.s5=4*h-(4*i-r);break;case 1:h=(i+r+s)/3,u.p=h,u.r1=h+.382*d,u.s1=h-.382*d,u.r2=h+.618*d,u.s2=h-.618*d,u.r3=h+d,u.s3=h-d;break;case 2:h=(i+r+2*e)/4,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+d,u.s2=h-d,u.r3=i+2*(h-r),u.s3=r-2*(i-h),u.r4=u.r3+d,u.s4=u.s3-d;break;case 3:h=(i+r+s)/3,u.p=h,u.r1=2*h-r,u.s1=2*h-i,u.r2=h+d,u.s2=h-d,u.r3=h+2*d,u.s3=h-2*d,u.r4=h+3*d,u.s4=h-3*d;break;case 4:var p=NaN;h=(p=n.Std.equal(t,s)?i+r+2*s:n.Std.greater(s,t)?2*i+r+s:2*r+i+s)/4,u.p=h,u.r1=p/2-r,u.s1=p/2-i;break;case 5:h=(i+r+s)/3,u.p=h,u.r1=s+1.1*d/12,u.s1=s-1.1*d/12,u.r2=s+1.1*d/6,u.s2=s-1.1*d/6,u.r3=s+1.1*d/4,u.s3=s-1.1*d/4,u.r4=s+1.1*d/2,u.s4=s-1.1*d/2;break;default:throw new Error("Unknown kind")}return u.startIndex__t=a,u.endIndex__t=l,u}(u,d,p,_,f,h,l(e,h),this._kindPP);return e.select_sym(0),this._showHistoricalPivots||(c.pivots=[]),c.pivots.push(y),c.pivots.length>this._historicalPivotsToKeep&&c.pivots.shift(),m?this._createResponse():null},e.prototype._createResponse=function(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},e.prototype._removeUnusedPivots=function(){var e=this,t=Math.max(this._data.pivots.findIndex((function(t){return t.startIndex__t>e._firstMainSeriesBarTime}))-1,0);t>0&&this._data.pivots.splice(0,t)},e}()}},"i/Bj":function(e,t,i){"use strict";function n(e){if(void 0===e)return null;var t=e.match(/(delayed_streaming)_([\d]{1,4})/);return null===t?null:{mode:t[1],interval:parseInt(t[2])}}i.r(t),i.d(t,"parseUpdateMode",(function(){return n}))},i126:function(e,t,i){"use strict";i.r(t),i.d(t,"StudyColorRotatorFactory",(function(){return u}));var n=i("eJTA"),r=i("Tmoa"),o=i("HGP3"),s=i("3ClC"),a=["color-sky-blue-400","color-banana-yellow-700","color-deep-blue-500","color-grapes-purple-a700","color-iguana-green-500","color-minty-green-a700","color-ripe-red-a200","color-berry-pink-200","color-tv-blue-a100","color-tan-orange-a200","color-sky-blue-a400","color-deep-blue-a100","color-grapes-purple-400","color-iguana-green-a700","color-minty-green-200","color-ripe-red-200","color-berry-pink-a200","color-ripe-red-500","color-grapes-purple-500","color-deep-blue-400","color-tv-blue-a200","color-sky-blue-500","color-iguana-green-400","color-minty-green-400","color-banana-yellow-600","color-tan-orange-500","color-berry-pink-400","color-ripe-red-300","color-grapes-purple-300","color-deep-blue-300","color-tv-blue-300","color-sky-blue-300","color-iguana-green-300","color-minty-green-300","color-banana-yellow-400","color-tan-orange-300","color-berry-pink-300","color-tan-orange-a700"],l=function(){function e(e){this._offset=0,this._offset=e}return e.prototype.getColor=function(e){if(0===this._offset)return e;var t=a[(this._offset-1)%a.length],i=o.colorsPalette[t],s=Object(r.isHexColor)(e)?1:Object(n.parseRgba)(e)[3];return Object(r.generateColor)(i,Object(r.alphaToTransparency)(s))},e}(),c=function(){function e(e,t){this._offset=e,this._modelStartOffset=t}return e.prototype.getColor=function(e){if(Object(r.isHexColor)(e)){
var t=Object(n.parseRgb)(e);return Object(n.rgbToHexString)(Object(n.shiftRgb)(t,this._offset,this._modelStartOffset))}var i=Object(n.parseRgba)(e);return Object(n.rgbaToString)(Object(n.shiftRgba)(i,this._offset,this._modelStartOffset))},e}();var u=function(){function e(e){this._chartModel=e}return e.prototype.getColorRotator=function(e){var t=Object(s.studyColorRotationMode)(e),i=this._calcDefaultColorsOffset(e);switch(t){case"loop":return new l(i);case"shift":var n=this._chartModel.getStudyShiftColorStartOffset();return new c(i,n)}},e.prototype._calcDefaultColorsOffset=function(e){var t=0;return this._chartModel.dataSources().filter(s.isStudy).forEach((function(i){var n,r,o=i.metaInfo().id===e.id,s=(n=i.metaInfo(),r=e,(n.pine?n.pine.version:void 0)===(r.pine?r.pine.version:void 0));o&&s&&t++})),t},e}()},i80N:function(e,t,i){"use strict";var n=i("Ss5c").LineDataSource,r=i("Ocx9").DefaultProperty,o=window.t("Fib Spiral");function s(e,t){var r=t||s.createProperties();n.call(this,e,r),i.e("lt-pane-views").then(function(e){var t=i("8MBc").FibSpiralPaneView;this._setPaneViews([new t(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}inherit(s,n),s.prototype.pointsCount=function(){return 2},s.prototype.translatedType=function(){return o},s.prototype.name=function(){return"Fib Spiral"},s.prototype._getPropertyDefinitionsViewModelClass=function(){return Promise.all([i.e(21),i.e("lt-property-pages-with-definitions")]).then(function(e){return i("nBUU").FibSpiralDefinitionsViewModel}.bind(null,i)).catch(i.oe)},s.createProperties=function(e){var t=new r("linetoolfibspiral",e);return s._configureProperties(t),t},s._configureProperties=function(e){n._configureProperties(e)},t.LineToolFibSpiral=s},iDOr:function(e,t,i){"use strict";(function(e){var n=i("Eyy1").assert,r=i("Y7w9").moveToHead,o=i("704P").ExecutionsPositionController,s=i("Ss5c").LineDataSource,a=i("Qb4w").PriceRange,l=i("7ktv").PriceDataSource,c=i("txPx").getLogger("Chart.Pane"),u=i("CW80").isLineTool,h=i("s1Gx").isSpeciallyZOrderedSource,d=i("1Wlv").PriceScale,p=i("FaJS").scaleRatio,_=i("FaJS").priceRangeByScaleRatio,f=i("FaJS").barSpacingByScaleRatio,m=i("MWAT").createPriceScaleSelectionStrategy,v=i("yfAl").PaneBase,y=i("s1Gx").sortSources;function g(t,i,n){v.call(this,t,i,n),this.m_timeScale=t,this._rightPriceScales=[],this._leftPriceScales=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=n,this._destroyed=new e,this._priceScaleRatioChanged=new e,this._priceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),n.properties().priceScaleSelectionStrategyName.listeners().subscribe(null,function(e){this._priceScaleSelectionStrategy=m(e.value()),this._priceScaleSelectionStrategy.apply(this)}.bind(this)),this.m_timeScale.barSpacingChanged().subscribe(this,function(){this.m_mainDataSource===this._model.mainSeries()&&this._recalculatePriceScaleByScaleRatio(this.m_mainDataSource.priceScale())}.bind(this)),this._lockedPriceScale=null,this._currentPriceScaleRatio=null,
i.topMargin.listeners().subscribe(this,g.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,g.prototype._updateMargins),this._updateMargins(),this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,this._maximized=!1,this._isMainPane=!1,this._onPriceScalesChanged=new e}inherit(g,v),g.DEFAULT_STRETCH_FACTOR=1e3,g.PANE_ANIMATION_DURATION=500,g.prototype.destroy=function(){this._properties.topMargin.listeners().unsubscribe(this,g.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,g.prototype._updateMargins),this._model.properties().priceScaleSelectionStrategyName.listeners().unsubscribeAll(this),this.m_timeScale.barSpacingChanged().unsubscribeAll(this),this._leftPriceScales.concat(this._rightPriceScales).forEach((function(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this)}),this),this._priceScaleRatioChanged.unsubscribeAll(this);for(var e=0;ee.left){var t=r(this._leftPriceScales,this.mainDataSource().priceScale());return t.splice(e.left),t}return this._leftPriceScales},
g.prototype.visibleRightPriceScales=function(){var e=this._model.priceScaleSlotsCount();if(this._rightPriceScales.length>e.right){var t=r(this._rightPriceScales,this.mainDataSource().priceScale());return t.splice(e.right),t}return this._rightPriceScales},g.prototype.timeScale=function(){return this.m_timeScale},g.prototype.dataSources=function(){return this.m_dataSources},g.prototype.isOverlay=function(e){var t=e.priceScale();return"overlay"===this.priceScalePosition(t)},g.prototype._processMainSourceChange=function(){var e;if(null===this.m_mainDataSource)for(var t=0;te)&&(e=n)}}return null===e&&(e=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach((function(t){t.zorder()>e&&t.setZorder(t.zorder()+1)})),e+1},g.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},g.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},g.prototype.addDataSource=function(e,t,i){var n;u(e)&&!i?(n=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=n)):n=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(e,t,n)},g.prototype.insertDataSource=function(e,t,i){t||(t=this.findSuitableScale(e)),this._addSourceToCollections(e);var n=!1;(e===this._model.mainSeries()||null===this.m_mainDataSource)&&(this.m_mainDataSource=e,n=!0),t.addDataSource(e,this._isInInsertManyDataSourcesState),e.setPriceScale(t),e.onTagsChanged&&e.onTagsChanged().subscribe(this,g.prototype.onSourceTagsChanged),e.setZorder(i),n&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(e.constructor,l)&&this.recalculatePriceScale(t),this._invalidateSourcesCache()},g.prototype.priceScalePosition=function(e){return this._leftPriceScales.includes(e)?"left":this._rightPriceScales.includes(e)?"right":"overlay"},g.prototype.createPriceScaleAtPosition=function(e,t){
var i=this._properties.axisProperties.state();i.autoScale=!0;var n=new d(this._model.properties().scalesProperties,i);return n.setHeight(this.height()),n.setTopMargin(this._defaultTopMargin()),n.setBottomMargin(this._defaultBottomMargin()),this._placePriceScale(n,e,t),n},g.prototype._placePriceScale=function(e,t,i){if("overlay"!==t){var r="left"===t?this._leftPriceScales:this._rightPriceScales,o=void 0===i?r.length:i;r.splice(o,0,e),e.modeChanged().subscribe(this,this._onPriceScaleModeChanged.bind(this,e)),e.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio.bind(this,e)),e.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByScaleRatio.bind(this,e)),e.priceRangeChanged().subscribe(this,this._onPriceScaleSetMinMaxPriceRange.bind(this,e)),e.isLockScale()&&(n(null===this._lockedPriceScale),this._lockedPriceScale=e,this._currentPriceScaleRatio=null),this._onPriceScalesChanged.fire()}},g.prototype.removePriceScale=function(e){e.modeChanged().unsubscribeAll(this),e.priceRangeChanged().unsubscribeAll(this),e.internalHeightChanged().unsubscribeAll(this),e===this._lockedPriceScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null);var t=this._leftPriceScales.indexOf(e);-1!==t&&this._leftPriceScales.splice(t,1);var i=this._rightPriceScales.indexOf(e);-1!==i&&this._rightPriceScales.splice(i,1),this._onPriceScalesChanged.fire()},g.prototype.removeDataSource=function(e,t,i){var n=this.m_dataSources.indexOf(e);if(-1!==n){0,this._removeSourceFromCollections(n,i),e!==this.m_mainDataSource||t||(this.m_mainDataSource=null);var r=e.priceScale();if(r&&r.dataSources().indexOf(e)>=0&&r.removeDataSource(e),r&&null===r.mainSource()){var o=r.dataSources().length;0!==o&&c.logError("Invalid priceScale state: empty mainSource but non-empty data sources="+o),this.removePriceScale(r)}e.onTagsChanged&&e.onTagsChanged().unsubscribe(this,g.prototype.onSourceTagsChanged),e instanceof l&&!t&&this._processMainSourceChange(),this._tagsChanged.fire(),r&&e instanceof l&&this.recalculatePriceScale(r),this._invalidateSourcesCache()}else c.logDebug("removeDataSource: invalid data source")},g.prototype.startScalePrice=function(e,t){e.startScale(t)},g.prototype.scalePriceTo=function(e,t){e.scaleTo(t),this.updateAllViews()},g.prototype.endScalePrice=function(e){e.endScale()},g.prototype.startScrollPrice=function(e,t){e.startScroll(t)},g.prototype.scrollPriceTo=function(e,t){e.scrollTo(t),this.updateAllViews()},g.prototype.endScrollPrice=function(e){e.endScroll()},g.prototype.setPriceAutoScale=function(e,t){e.setMode({autoScale:t}),this.timeScale().isEmpty()?e.setPriceRange(null):this.recalculatePriceScale(e)},g.prototype.restorePriceScaleState=function(e,t){e.restoreState(t),this.updateAllViews()},g.prototype._updateCustomSourceAllViews=function(e){e.paneViews(this).length>0&&e.updateAllViews()},g.prototype.updateAllViews=function(){for(var e=0;e0&&!this.timeScale().isEmpty()){var i=this.timeScale().visibleBarsStrictRange();e.recalculatePriceRange(i)}e.updatePaneViews()}},g.prototype.resetPriceScale=function(e){var t=this.timeScale().visibleBarsStrictRange();e.isLockScale()||e.setMode({autoScale:!0}),e.recalculatePriceRange(t),this.updateAllViews()},g.prototype.recalculate=function(){this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale);for(var e=0;ei&&(i=r.zorder())}return{minZOrder:t,maxZOrder:i}},g.prototype.isZOrderAvailable=function(e){for(var t=0;t0&&t<0){var s=i[n-1].zorder(),a=e.zorder();i[n-1].setZorder(a),e.setZorder(s)}else if(n0){var l=i[n+1].zorder();a=e.zorder();i[n+1].setZorder(a),e.setZorder(l)}this._invalidateSourcesCache(),this._dataSourcesCollectionChanged.fire()},g.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},g.prototype.onDestroyed=function(){return this._destroyed},g.prototype.clearSeries=function(e){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this._removeSourceFromCollections(t,e)},g.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter((function(e){return(!e.properties().linkedToSeries||!e.properties().linkedToSeries.value())&&(TradingView.isInherited(e.constructor,l)&&e.showInObjectTree()&&!this.isOverlay(e))}),this).length},g.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},g.prototype.actionNoScaleIsEnabled=function(e){return!(!this.isOverlay(e)&&TradingView.isInherited(e.constructor,l))||this.canHaveMoreNoScaleSources()},g.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new o(this,this._model.timeScale())),this._executionsPositionController},g.prototype.isLast=function(){var e=this._model.panes();return e[e.length-1]===this},g.prototype.setMaximized=function(e){this._maximized=e},g.prototype.isMaximized=function(){return this._maximized},g.prototype.isMainPane=function(){var e=this._model.mainSeries(),t=!1;return this.m_dataSources.forEach((function(i){t||(t=i===e)})),this._isMainPane=t,t},g.prototype.properties=function(){return this._properties},g.prototype._mainSourceVisiblePriceRange=function(e){var t=this.m_timeScale.visibleBarsStrictRange();return null!==t?e.mainSource().priceRange(t.firstBar(),t.lastBar()):new a(-.5,.5)},g.prototype.priceScaleRatio=function(){return this._currentPriceScaleRatio},g.prototype.applyPriceScaleRatio=function(e,t){
null!==this._lockedPriceScale&&this._lockedPriceScale!==e||this._currentPriceScaleRatio===t||!this.isMainPane()||null===this._lockedPriceScale&&e!==this.mainDataSource().priceScale()||(this._setNewPriceRangeByScaleRatio(e,t,this._mainSourceVisiblePriceRange(e),!0,!0),null!==this._lockedPriceScale?this._tryToApplyNewPriceScaleRatio():e.isLog()||this._model.mainSeriesScaleRatioPropertyOnChanged())},g.prototype._mainSeriesPaneScaleRatioOnChange=function(){this.isMainPane()&&this._model.mainSeriesScaleRatioPropertyOnChanged()},g.prototype._applyOldScaleRatioToPriceScale=function(){if(this._isRecalculatingScales||null===this._currentPriceScaleRatio)return!1;this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(this._lockedPriceScale,this._currentPriceScaleRatio,this._mainSourceVisiblePriceRange(this._lockedPriceScale)),this._isRecalculatingScales=!1},g.prototype._applyOldScaleRatioToTimeScale=function(){if(this._isRecalculatingScales||null===this._currentPriceScaleRatio)return!1;this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(),this._isRecalculatingScales=!1},g.prototype._tryToApplyNewPriceScaleRatio=function(){var e=p(this.m_timeScale,this._lockedPriceScale);this._currentPriceScaleRatio===e||this._lockedPriceScale.isLog()||(this._priceScaleRatioChanged.fire(this._currentPriceScaleRatio,e),this._currentPriceScaleRatio=e)},g.prototype._recalculatePriceScaleByScaleRatio=function(e){this.isMainPane()&&e===this._lockedPriceScale&&(null!==this._currentPriceScaleRatio?this._applyOldScaleRatioToPriceScale():this._tryToApplyNewPriceScaleRatio())},g.prototype._recalculateTimeScaleByScaleRatio=function(e){e===this._lockedPriceScale&&(null!==this._currentPriceScaleRatio?this._applyOldScaleRatioToTimeScale():this._tryToApplyNewPriceScaleRatio())},g.prototype._setNewPriceRangeByScaleRatio=function(e,t,i,n,r){var o=_(e,this.m_timeScale.barSpacing(),t);e.setPriceRange(null!==o?o:i,n,r)},g.prototype._setMinMaxPriceRange=function(){var e=_(this._lockedPriceScale,this.m_timeScale.maxBarSpacing(),this._currentPriceScaleRatio),t=_(this._lockedPriceScale,this.m_timeScale.minBarSpacing(),this._currentPriceScaleRatio);null!==e&&this._lockedPriceScale.setMaxPriceRange(e),null!==t&&this._lockedPriceScale.setMinPriceRange(t)},g.prototype._onPriceScaleSetMinMaxPriceRange=function(e){e===this._lockedPriceScale&&this._setMinMaxPriceRange()},g.prototype._setNewBarSpacingByScaleRatio=function(){var e=this.m_timeScale.getValidBarSpacing(f(this._lockedPriceScale,this._currentPriceScaleRatio));this.m_timeScale.isValidBarSpacing(e)&&this.m_timeScale.setBarSpacing(e)},g.prototype._onPriceScaleModeChanged=function(e,t,i){if(i.lockScale&&(this._lockedPriceScale!==e&&null!==this._lockedPriceScale&&this._lockedPriceScale.setMode({lockScale:!1}),this._lockedPriceScale=e,this._currentPriceScaleRatio=p(this.m_timeScale,e)),t.lockScale&&!i.lockScale&&(this._lockedPriceScale=null,this._currentPriceScaleRatio=null),t.percentage!==i.percentage||t.indexedTo100!==i.indexedTo100){var n=this.timeScale().visibleBarsStrictRange()
;null!==n&&(e.recalculatePriceRange(n),e.updatePaneViews())}},g.prototype.lineToolsForArea=function(e){var t=this.m_height,i=this.m_width,n=this.logicalRectToPixels(e);return this.m_dataSources.filter((function(e){return u(e)})).filter((function(e){return(e.paneViews()||[]).some((function(e){var r=e.renderer(t,i,!0);return r&&r.doesIntersectWithBox&&r.doesIntersectWithBox(n)}))}))},g.prototype.getPriceScaleById=function(e){var t=this.m_dataSources.find((function(t){return null!==t.priceScale()&&t.priceScale().id()===e}));return void 0===t?null:t.priceScale()},g.prototype.setPriceScaleSelectionStrategy=function(e){this._priceScaleSelectionStrategy=e,e.apply(this)},g.prototype.movePriceScale=function(e,t,i){var n=this.priceScalePosition(e);if(n!==t)this.removePriceScale(e),this._placePriceScale(e,t,i),this._invalidateSourcesCache();else if(void 0!==i&&"overlay"!==n){var r="left"===n?this._leftPriceScales:this._rightPriceScales,o=r.indexOf(e);r.splice(o,1),r.splice(i,0,e)}},g.prototype.onPriceScalesChanged=function(){return this._onPriceScalesChanged},g.prototype.priceScaleIndex=function(e,t){switch(t){case"left":return this.leftPriceScales().indexOf(e);case"right":return this.rightPriceScales().indexOf(e)}},g.prototype.realignLineTools=function(){for(var e=0;e0&&(u=2*Math.PI-u),0===e&&(u+=Math.PI),this._properties.angle.setValue(u)}else{var h=this._startChangeWidth,d=o.subtract(r).length();if(this._origScale*h0)},t.fixComputationError=n,t.alignTo=function(e,t){var i=e/t,r=Math.floor(i),o=i-r;return o>2e-10?n(o>.5?(r+1)*t:r*t):e}},jA0t:function(e,t,i){"use strict";var n=function(){var e={};function t(e){return e.is_price_study}function i(e,t){var i=t.slice(0).toLowerCase();if(e){for(var n=0;nt){if((r=o-1)0&&e-t[n-1]<=r)return r;return 0},r.prototype.is_valid=function(){return!this._invalid},r._offset=function(e,t,i){var n=o(e,i);return-1===n?0:t[n]};var s=function(e){return 0|e},a=function(e){return 60*e*1e3};function l(e){return e%4==0&&(e%100!=0||e%400==0)}var c={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},u={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,FEBRUARY:1,MARCH:2,APRIL:3,MAY:4,JUNE:5,JULY:6,AUGUST:7,SEPTEMBER:8,OCTOBER:9,NOVEMBER:10,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:a(1440),get_minutes_from_hhmm:function(e){return-1!==e.indexOf(":")&&(e=e.split(":").join("")),e%100+60*s(e/100)},get_year:function(e){return e.getUTCFullYear()},get_month:function(e){return e.getUTCMonth()},get_hours:function(e){return e.getUTCHours()},get_minutes:function(e){return e.getUTCMinutes()},get_seconds:function(e){return e.getUTCSeconds()},get_day_of_month:function(e){return e.getUTCDate()},get_day_of_week:function(e){return e.getUTCDay()+1},get_day_of_year:function(e){var t=e.getUTCMonth(),i=c[t];return t>u.JANUARY+1&&l(e.getUTCFullYear())&&(i+=1),i+e.getUTCDate()},get_week_of_year:function(e){var t=new Date(Date.UTC(e.getUTCFullYear(),0,1)).getUTCDay(),i=0===t?1:8-t,n=u.get_day_of_year(e)-i;return Math.ceil(n/7)+1},get_minutes_from_midnight:function(e){return 60*u.get_hours(e)+u.get_minutes(e)},set_hms:function(e,t,i,n,r,o){e.setUTCHours(t),e.setUTCMinutes(i),e.setUTCSeconds(n),e.setUTCMilliseconds(r),u.correct_time(e,o)},correct_time:function(e,t){var i=e.getTime(),n=t.correction_loc(i);e.setTime(i+n)},add_days_considering_dst:function(e,t,i){var n=e.offset_utc(t),r=this.clone(t);this.add_date(r,i);var o=e.offset_utc(r);return r.setTime(r.getTime()+n-o),r},add_date:function(e,t){e.setTime(e.getTime()+t*u.secondsPerDay)},add_minutes:function(e,t){e.setTime(e.getTime()+a(t))},clone:function(e){return new Date(e.getTime())},get_days_per_year:function(e){var t=e.getUTCFullYear();return this.days_per_year(t)},days_per_year:function(e){return l(e)?366:365},get_part:function(e,t){switch(t){case u.YEAR:return u.get_year(e);case u.MONTH:return u.get_month(e);case u.DAY_OF_MONTH:return u.get_day_of_month(e);case u.WEEK_OF_YEAR:return u.get_week_of_year(e);case u.DAY_OF_WEEK:return u.get_day_of_week(e);case u.HOUR_OF_DAY:return u.get_hours(e);case u.MINUTE:return u.get_minutes(e);case u.DAY_OF_YEAR:return u.get_day_of_year(e);case u.SECOND:return u.get_seconds(e);default:return e.getTime()}},time_minutes:a,time_seconds:function(e){return 1e3*e},time_minutes_diff:function(e,t){return s((s(e/1e3)-s(t/1e3))/60)},time_seconds_diff:function(e,t){return s(s(e/1e3)-s(t/1e3))},utc_to_cal:function(e,t){var i=e.offset_utc(t);return new Date(t+i)},get_cal:function(e,t,i,n,r,o,s){var a=new Date(Date.UTC(t,i,n,r||0,o||0,s||0)),l=e.offset_utc(+a)
;return new Date(a.valueOf()-l)},get_cal_from_unix_timestamp_ms:function(e,t){return new Date(t+e.offset_utc(t))},get_cal_utc:function(e,t,i){return new Date(Date.UTC(e,t,i))},cal_to_utc:function(e,t){var i=t.getTime();return i-e.offset_loc(i)},get_timezone:function(e){return new r(e)},shift_day:function(e,t){var i=e-1;return(i+=t)>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}};e.exports=u},jFln:function(e,t,i){"use strict";var n=i("Hr11"),r=n.greaterThan,o=n.lessThan,s=window.CanvasEx=i("8Uy/");s.computeDashPattern=function(e){return[[e.lineWidth,2*e.lineWidth],[5*e.lineWidth,6*e.lineWidth],[6*e.lineWidth,6*e.lineWidth],[e.lineWidth,4*e.lineWidth],[2*e.lineWidth,e.lineWidth]][e.lineStyle-1]},s.drawLine=function(e,t,i,n,r){isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(r)&&(e.lineStyle!==s.LINESTYLE_SOLID?s.drawDashedLine(e,t,i,n,r):s.drawSolidLine(e,t,i,n,r))},s.drawArrow=function(e,t,i,n,r,o){if(o=void 0===o?2:o,isFinite(t)&&isFinite(n)&&isFinite(i)&&isFinite(r)){var s=Math.round(o/2);e.beginPath(),e.moveTo(n,r),e.lineTo(t,i),e.moveTo(t+o,i+o),e.lineTo(t-o,i+o),e.moveTo(t-s,i+s),e.lineTo(t+s,i+s),e.stroke()}},s.drawSolidLine=function(e,t,i,n,r){e.beginPath(),e.moveTo(t,i),e.lineTo(n,r),e.stroke()},s.setLineStyle=function(e,t){e.lineStyle=t;var i=[];t!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(e)),s.setLineDash(e,i)},s.setLineDash=function(e,t){"function"==typeof e.setLineDash?e.setLineDash(t):void 0!==e.mozDash?e.mozDash=t:void 0!==e.webkitLineDash&&(e.webkitLineDash=t)},s.drawPoly=function(e,t,i){e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var n=0;n0&&(c.thereYet=o,c.cap=Math.max),t-n>0&&(l.thereYet=o,l.cap=Math.max),e.moveTo(t,i);for(var u=t,h=i,d=0,p=!0;!l.thereYet(u,n)||!c.thereYet(h,s);){var _=Math.atan2(s-i,n-t),f=a[d];u=l.cap(n,u+Math.cos(_)*f),h=c.cap(s,h+Math.sin(_)*f),p?e.lineTo(u,h):e.moveTo(u,h),
d=(d+1)%a.length,p=!p}},s.setFont=function(e,t){if(e.font!==t)try{e.font=t}catch(i){}},"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(e){s.setFont(this,e)},CanvasRenderingContext2D.prototype.lineStyle=s.LINESTYLE_SOLID),e.exports=s},jJ9X:function(e,t,i){},jRfx:function(e,t,i){"use strict";i.d(t,"c",(function(){return s})),i.d(t,"a",(function(){return a})),i.d(t,"b",(function(){return l}));var n=i("mrSG"),r=i("Eyy1"),o=function(e){function t(t,i,n){var r=e.call(this,t,i,n)||this;return r._restorePane=!1,r}return Object(n.__extends)(t,e),t.prototype.redo=function(){var e=this,t=this._chartModel.panes().length,i=this._chartModel.panes()[this._targetPaneIndex()],n=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),o=this._chartModel.children(n,!0);o.forEach((function(t){return e._chartModel.detachSource(t)})),this._restorePane=this._chartModel.detachSource(n);var s=i.findSuitableScale(n);if(i.addDataSource(n,s,!1),o.forEach((function(e){return i.addDataSource(e,s,!1)})),n===this._chartModel.mainSeries()){var a=i.priceScalePosition(s);i.movePriceScale(s,a,0)}this._chartModel.fullUpdate(),t!==this._chartModel.panes().length&&this._chartModel.setShouldBeSavedEvenIfHidden(!0)},t.prototype.undo=function(){var e,t=this;e=this._restorePane?this._chartModel.createPane(this._initialPaneIndex):this._chartModel.panes()[this._initialPaneIndex];var i=Object(r.ensureNotNull)(this._chartModel.dataSourceForId(this._sourceId)),n=this._chartModel.children(i,!0);n.forEach((function(e){return t._chartModel.detachSource(e)})),this._chartModel.detachSource(i);var o=e.getPriceScaleById(this._initialPriceScaleId);null===o&&(o=e.createPriceScaleAtPosition(this._initialPriceScalePosition,this._initialPriceScaleIndex)),e.addDataSource(i,o,!0),n.forEach((function(t){return e.addDataSource(t,o,!1)})),this._chartModel.fullUpdate()},t}(i("3u3j").a),s=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex-1},t}(o),a=function(e){function t(t,i,n){return e.call(this,t,i,n)||this}return Object(n.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._initialPaneIndex+1},t}(o),l=function(e){function t(t,i,n,r){var o=e.call(this,t,i,r)||this;return o._targetPane=n,o}return Object(n.__extends)(t,e),t.prototype._targetPaneIndex=function(){return this._targetPane},t}(o)},jTis:function(e,t,i){"use strict";var n;i.r(t),i.d(t,"CalloutConsts",(function(){return n})),function(e){e[e.RoundRadius=8]="RoundRadius",e[e.TextMargins=2]="TextMargins",e[e.MinWidth=100]="MinWidth"}(n||(n={}))},jeZR:function(e,t,i){"use strict";i.r(t),i.d(t,"AppliedTimeFrame",(function(){return r}));var n=i("QfUd"),r=function(){function e(e){this._appliedTimeFrame=new n.a(null),this._appliedTimeFrameInfo=null,this._model=e,e.mainSeries().dataEvents().messageReceived().subscribe(this,this._onSeriesMessageReceived)}return e.prototype.destroy=function(){
this._model.timeScale().logicalRangeChanged().unsubscribeAll(this),this._model.mainSeries().dataEvents().messageReceived().unsubscribeAll(this)},e.prototype.appliedTimeFrame=function(){return this._appliedTimeFrame},e.prototype._onSeriesMessageReceived=function(e){if("series_timeframe"===e.method){var t=this._model.timeScale();t.logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame),(null==e.params[5]||e.params[5])&&(this._appliedTimeFrameInfo={logicalRange:t.logicalRange(),baseIndex:t.baseIndex()},t.logicalRangeChanged().subscribe(this,this._invalidateAppliedTimeFrame))}},e.prototype._invalidateAppliedTimeFrame=function(){if(null!==this._appliedTimeFrameInfo){var e=this._model.timeScale(),t=e.logicalRange(),i=e.baseIndex(),n=this._appliedTimeFrameInfo.logicalRange,r=this._appliedTimeFrameInfo.baseIndex;null!==t&&null!==n&&i-t.left()==r-n.left()&&i-t.right()==r-n.right()||(this._appliedTimeFrame.setValue(null),e.logicalRangeChanged().unsubscribe(this,this._invalidateAppliedTimeFrame))}},e}()},jenN:function(e,t,i){"use strict";i.r(t);var n=i("txPx"),r=i("7Fue"),o=i("xWfy"),s=i("qySK"),a=i("mrSG"),l=function(e){function t(t,i){var n=e.call(this)||this;return n._source=t,n._data=i,n}return Object(a.__extends)(t,e),t.prototype._updateRendererData=function(e,t,i){e.visible=!1;var n=this._source.priceScale(),r=this._source.properties().visible.value();if(n&&!n.isEmpty()&&r){var o=this._source.properties().graphics[this._data.lineType][this._data.styleId];if(o.visible&&o.visible.value()&&o.showPrice&&o.showPrice.value()){var s=this._source.firstValue();if(null!==s){var a=this._data.line.level,l=o.color.value();i.background=l,i.color=this.generateTextColor(l),i.coordinate=n.priceToCoordinate(a,s),e.text=n.formatPrice(a,s),e.visible=!0}}}},t}(i("KcY8").a);i.d(t,"createGraphicsPaneViews",(function(){return u})),i.d(t,"createGraphicsPriceAxisViews",(function(){return d})),i.d(t,"isStudyGraphicsEmpty",(function(){return r.a})),i.d(t,"StaticStudyGraphics",(function(){return o.a})),i.d(t,"emptyStudyGraphics",(function(){return o.b})),i.d(t,"loadStudyGraphics",(function(){return o.c})),i.d(t,"saveStudyGraphics",(function(){return o.d})),i.d(t,"LiveStudyGraphics",(function(){return s.a}));var c=Object(n.getLogger)("Chart.StudyGraphics");function u(e,t,n){return new Promise((function(r){i.e("study-pane-views").then(function(o){var s=Object.keys(e.graphicsInfo());s.sort((function(e,t){return h(e)-h(t)})),r(s.map((function(r){var o=i("psYU").VertLinePaneView,s={backgrounds:null,hhists:null,horizlines:i("1sos").HorizLinePaneView,hlines:null,lines:null,polygons:null,shapemarks:null,textmarks:null,trendchannels:null,vertlines:o,dwglabels:null,dwglines:null}[r];return null===s?(c.logWarn(r+" is not supported by this build of graphics subsystem, skipping"),null):new s(e,t,n)})).filter((function(e){return null!==e})))}.bind(null,i)).catch(void 0)}))}function h(e){switch(e){case"polygons":return-100;case"trendchannels":return-90;default:return 0}}function d(e){for(var t=Object.keys(e.graphicsInfo()),i=[],n=function(t){
switch(t){case"hlines":e.graphics().hlines().forEach((function(n,r){n.forEach((function(n){void 0!==n.level&&i.push(new l(e,{line:{level:n.level},styleId:r,lineType:t}))}))}));break;case"horizlines":e.graphics().horizlines().forEach((function(n,r){n.forEach((function(n){void 0!==n.level&&i.push(new l(e,{line:{level:n.level},styleId:r,lineType:t}))}))}))}},r=0,o=t;r0&&t.setValue(a.family),i.setValue(a.size),n.setValue(a.bold),s.setValue(a.italic)):o.logError("Invalid font: "+e)},fontHeight:function(e){if(!this._fontHeightCache[e]){var t=document.createElement("span");t.appendChild(document.createTextNode("height")),document.body.appendChild(t),t.style.cssText="font: "+e+"; white-space: nowrap; display: inline;";var i=t.offsetHeight;document.body.removeChild(t),this._fontHeightCache[e]=Math.ceil(i)}return this._fontHeightCache[e]},drawPolyHoverOrPress:function(e,t,i,n){n?(e.save(),e.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(e,t,!0),e.restore()):i&&(e.save(),e.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(e,t,!0),e.restore())},repaint:function(e){e.lightUpdate()},roundToMinTick:function(e,t){var i=1/e.mainSource().base();return i*Math.round(t/i)}};e.exports=s},jofe:function(e,t,i){"use strict";function n(){var e,t;return{promise:new Promise((function(i,n){e=i,t=n})),reject:t,resolve:e}}i.r(t),i.d(t,"createDeferredPromise",(function(){return n}))},jpZi:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));var n=i("mrSG"),r=i("Eyy1"),o=(i("YFKU"),i("HbRj"),i("RDU5")),s=window.t("Exclude line tools from group {group}"),a=function(e){function t(t,i,n){var r=e.call(this,s.format({group:i.name()}))||this;return r._model=t,r._groupId=i.id,r._groupName=i.name(),r._lineToolsIds=n.map((function(e){return e.id()})),r}return Object(n.__extends)(t,e),t.prototype.redo=function(){var e=this,t=Object(r.ensureNotNull)(this._model.lineToolsGroupModel().groupForId(this._groupId)),i=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)}))
;t.excludeLineTools(i),0===t.lineTools().length&&this._model.lineToolsGroupModel().removeGroup(t)},t.prototype.undo=function(){var e=this,t=this._lineToolsIds.map((function(t){return e._model.dataSourceForId(t)})),i=this._model.lineToolsGroupModel().groupForId(this._groupId);null!==i?i.addLineTools(t):this._model.lineToolsGroupModel().createGroup(t,this._groupName,this._groupId)},t}(o.UndoCommand)},jy4L:function(e,t,i){"use strict";i.r(t),i.d(t,"makeNextSymbolId",(function(){return r})),i.d(t,"makeNextStudyId",(function(){return s}));var n=0;function r(){return"ss_"+ ++n}var o=0;function s(){return"st"+ ++o}},k4w6:function(e,t,i){"use strict";i.d(t,"a",(function(){return r}));var n=i("mrSG"),r=function(e){function t(t){var i=e.call(this)||this;return i._series=t,i._model=t.model(),i}return Object(n.__extends)(t,e),t}(i("2ijp").a)},"k9/m":function(e,t,i){"use strict";i.r(t),i.d(t,"PlotRowSearchMode",(function(){return n})),i.d(t,"PlotList",(function(){return c})),i.d(t,"mergeMinMax",(function(){return u})),i.d(t,"mergePlotRows",(function(){return h}));var n,r=i("Eyy1"),o=i("Y7w9"),s=i("tqok"),a=i("txPx"),l=Object(a.getLogger)("Chart.PlotList");!function(e){e[e.NearestLeft=-1]="NearestLeft",e[e.Exact=0]="Exact",e[e.NearestRight=1]="NearestRight"}(n||(n={}));var c=function(){function e(e,t){void 0===e&&(e=null),void 0===t&&(t=null),this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCache=new Map,this._rowSearchCacheWithoutEmptyValues=new Map,this._plotFunctions=e||new Map,this._emptyValuePredicate=t}return e.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()},e.prototype.first=function(){return this.size()>0?this._items[this._start]:null},e.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},e.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},e.prototype.lastIndex=function(){return this.size()>0?this._indexAt(this._end-1):null},e.prototype.size=function(){return this._end-this._start},e.prototype.isEmpty=function(){return 0===this.size()},e.prototype.contains=function(e){return null!==this._search(e,n.Exact)},e.prototype.valueAt=function(e){var t=this.search(e);return null!==t?t.value:null},e.prototype.add=function(e,t){if(this._shareRead)return l.logDebug("add: readonly collection modification attempt"),!1;var i={index:e,value:t},r=this._search(e,n.Exact);return this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear(),null===r?(this._items.splice(this._lowerbound(e),0,i),this._start=0,this._end=this._items.length,!0):(this._items[r]=i,!1)},e.prototype.search=function(e,t,i){void 0===t&&(t=n.Exact);var r=void 0!==i?this._rowSearchCacheWithoutEmptyValues:this._rowSearchCache,o=void 0!==i?1e4*(t+1)+i:t,s=r.get(e);if(void 0!==s){var a=s.get(o);if(void 0!==a)return a}var l=this._search(e,t,i);if(null===l)return null;var c={index:this._indexAt(l),
value:this._valueAt(l)};return void 0===s&&(s=new Map,r.set(e,s)),s.set(o,c),c},e.prototype.fold=function(e,t){for(var i=t,n=this._start;n=i;--n){var r=this._indexAt(n),o=this._valueAt(n);if(e(r,o))return{index:r,value:o}}return null},e.prototype.each=function(e){for(var t=this._start;tthis._items[this._items.length-1].index?this._append(e):1===e.length&&e[0].index===this._items[this._items.length-1].index?(this._updateLast(e[0]),e[0]):this._merge(e)},e.prototype.addTail=function(e,t){void 0===t&&(t=!1);var i=0;t&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=e[0].value);for(var n=i;n0?i[0]:null},e.prototype.state=function(){return{start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},e.prototype.restoreState=function(e){e?(this._start=e.start,this._end=e.end,this._shareRead=e.shareread,this._items=e.data,this._minMaxCache.clear(),this._rowSearchCache.clear(),this._rowSearchCacheWithoutEmptyValues.clear()):this.clear()},e.prototype._indexAt=function(e){return this._items[e].index},e.prototype._valueAt=function(e){return this._items[e].value},e.prototype._length=function(){return this._items.length},e.prototype._search=function(e,t,i){var r=this._bsearch(e);if(null===r&&t!==n.Exact)switch(t){case n.NearestLeft:return this._searchNearestLeft(e,i);case n.NearestRight:return this._searchNearestRight(e,i);default:throw new TypeError("Unknown search mode")}if(void 0===i||null===r||t===n.Exact)return r;switch(t){case n.NearestLeft:return this._nonEmptyNearestLeft(r,i);case n.NearestRight:return this._nonEmptyNearestRight(r,i);default:throw new TypeError("Unknown search mode")}},e.prototype._nonEmptyNearestRight=function(e,t){for(var i=Object(r.ensure)(this._emptyValuePredicate),n=Object(r.ensure)(t);e=this._start&&i(this._valueAt(e),n);)e-=1;return ethis._start&&(i-=1);var n=i!==this._end&&this._indexAt(i)e}),this._start,this._end)},e.prototype._plotMinMax=function(e,t,i){var n=null,r=this._plotFunctions.get(i);if(void 0===r)throw new Error('Plot "'+i+'" is not registered');for(var o=e;o