(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[87525,80717],{78217:e=>{e.exports={"tv-circle-logo-pair":"tv-circle-logo-pair-ocURKVwI","tv-circle-logo-pair--xxxxsmall":"tv-circle-logo-pair--xxxxsmall-ocURKVwI","tv-circle-logo-pair--xxxsmall":"tv-circle-logo-pair--xxxsmall-ocURKVwI","tv-circle-logo-pair--xxsmall":"tv-circle-logo-pair--xxsmall-ocURKVwI","tv-circle-logo-pair--xsmall":"tv-circle-logo-pair--xsmall-ocURKVwI","tv-circle-logo-pair--small":"tv-circle-logo-pair--small-ocURKVwI","tv-circle-logo-pair--medium":"tv-circle-logo-pair--medium-ocURKVwI","tv-circle-logo-pair--large":"tv-circle-logo-pair--large-ocURKVwI","tv-circle-logo-pair--xlarge":"tv-circle-logo-pair--xlarge-ocURKVwI","tv-circle-logo-pair--xxlarge":"tv-circle-logo-pair--xxlarge-ocURKVwI","tv-circle-logo-pair--xxxlarge":"tv-circle-logo-pair--xxxlarge-ocURKVwI","tv-circle-logo-pair__logo":"tv-circle-logo-pair__logo-ocURKVwI","tv-circle-logo-pair__logo--xxxxsmall":"tv-circle-logo-pair__logo--xxxxsmall-ocURKVwI","tv-circle-logo-pair__logo--xxxsmall":"tv-circle-logo-pair__logo--xxxsmall-ocURKVwI","tv-circle-logo-pair__logo--xxsmall":"tv-circle-logo-pair__logo--xxsmall-ocURKVwI","tv-circle-logo-pair__logo--xsmall":"tv-circle-logo-pair__logo--xsmall-ocURKVwI","tv-circle-logo-pair__logo--small":"tv-circle-logo-pair__logo--small-ocURKVwI","tv-circle-logo-pair__logo--medium":"tv-circle-logo-pair__logo--medium-ocURKVwI","tv-circle-logo-pair__logo--large":"tv-circle-logo-pair__logo--large-ocURKVwI","tv-circle-logo-pair__logo--xlarge":"tv-circle-logo-pair__logo--xlarge-ocURKVwI","tv-circle-logo-pair__logo--xxlarge":"tv-circle-logo-pair__logo--xxlarge-ocURKVwI","tv-circle-logo-pair__logo--xxxlarge":"tv-circle-logo-pair__logo--xxxlarge-ocURKVwI","tv-circle-logo-pair__logo-empty":"tv-circle-logo-pair__logo-empty-ocURKVwI"}},456057:e=>{e.exports={"tv-circle-logo":"tv-circle-logo-PsAlMQQF","tv-circle-logo--xxxsmall":"tv-circle-logo--xxxsmall-PsAlMQQF","tv-circle-logo--xxsmall":"tv-circle-logo--xxsmall-PsAlMQQF","tv-circle-logo--xsmall":"tv-circle-logo--xsmall-PsAlMQQF","tv-circle-logo--small":"tv-circle-logo--small-PsAlMQQF","tv-circle-logo--medium":"tv-circle-logo--medium-PsAlMQQF","tv-circle-logo--large":"tv-circle-logo--large-PsAlMQQF","tv-circle-logo--xlarge":"tv-circle-logo--xlarge-PsAlMQQF","tv-circle-logo--xxlarge":"tv-circle-logo--xxlarge-PsAlMQQF","tv-circle-logo--xxxlarge":"tv-circle-logo--xxxlarge-PsAlMQQF","tv-circle-logo--visually-hidden":"tv-circle-logo--visually-hidden-PsAlMQQF"}},715216:e=>{e.exports={"tv-spinner__container-rotate":"tv-spinner__container-rotate-aLqboHuu"}},72224:e=>{e.exports={fade:"fade-zUA5953i",hidden:"hidden-zUA5953i",floatingTooltip:"floatingTooltip-zUA5953i"}},467236:(e,t,i)=>{"use strict";i.d(t,{getCircleLogoAnyHtml:()=>o});var s=i(857430),r=i(348091);function o(e){const{logoUrls:t,...i}=e;return 1===t.length?(0,s.getCircleLogoHtml)({logoUrl:t[0],...i}):2===t.length?(0,r.getCircleLogoPairHtml)({primaryLogoUrl:t[0],secondaryLogoUrl:t[1],...i}):(0,s.getCircleLogoHtml)({logoUrl:void 0,...i})}}, 348091:(e,t,i)=>{"use strict";i.d(t,{getCircleLogoPairHtml:()=>r});var s=i(115078);function r(e){const{primaryLogoUrl:t,secondaryLogoUrl:i,size:r,className:a}=e;return`\n\t\t\t${o({logoUrl:i,size:r})}\n\t\t\t${o({logoUrl:t,size:r})}\n\t\t`}function o(e){const{logoUrl:t,size:i}=e,r=(0,s.getLogoStyleClasses)(i,Boolean(t));return void 0===t?``:``}},115078:(e,t,i)=>{"use strict";i.d(t,{getBlockStyleClasses:()=>a,getLogoStyleClasses:()=>n});var s=i(497754),r=i(78217),o=i.n(r);function a(e,t){return s(o()["tv-circle-logo-pair"],o()[`tv-circle-logo-pair--${e}`],t)}function n(e,t=!0){return s(o()["tv-circle-logo-pair__logo"],o()[`tv-circle-logo-pair__logo--${e}`],!t&&o()["tv-circle-logo-pair__logo-empty"])}},857430:(e,t,i)=>{"use strict";i.d(t,{getCircleLogoHtml:()=>r});var s=i(842060);i(456057);function r(e){const t=(0,s.getStyleClasses)(e.size,e.className);return(0,s.isCircleLogoWithUrlProps)(e)?``:`${e.placeholderLetter||""}`}},685023:(e,t,i)=>{"use strict";i.d(t,{DEFAULT_SIZE:()=>s,spinnerSizeMap:()=>r});const s="large",r={mini:"xsmall",xxsmall:"xxsmall",xsmall:"xsmall",small:"small",medium:"medium",large:"large"}},293659:(e,t,i)=>{"use strict";i.d(t,{MiniChartPlotBase:()=>F,isTimePointIndex:()=>P});var s=i(259332),r=i(431057),o=i(998034),a=i(283873),n=i(650151),l=i(724377),h=i(444372),c=i(120984),d=i(432059),u=i(643322),m=i(124829),_=i(375397),g=i(942634),p=i(957365),v=i(501571),f=i(338619),y=i(882782),b=i(975179),S=i(566238);const C=(0,f.getLogger)("Chart.MiniChart"),w=new p.VolumeFormatter;function D(e,t,i){return{time:e,color:i,value:t[4]}}function T(e,t){return{time:e,open:t[1],high:t[2],low:t[3],close:t[4]}}function I(e,t,i,s,r){return{time:e,topColor:s,bottomColor:r,lineColor:i,value:t[4]}}function x(e){const t=new Date(e);return Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds())/1e3}function P(e){return(0,m.isInteger)(e)}const M=(0,s.default)(d.resetTransparency);const k={leftLogical:-.5,rightLogical:-.5,leftPx:0,rightPx:4};class F{constructor(e,t,i,s){this._symbolChanged=new g.Delegate,this._seriesChanged=new g.Delegate,this._whitespaces=null,this._symbolResolved=new g.Delegate,this._originalScaleMode=null,this._customPriceFormatter=null,this._isDestroyed=new _.WatchedValue(!1),this._status=new _.WatchedValue(0),this._noData=new _.WatchedValue(null),this._directionBasedColor=new _.WatchedValue(null),this._dataLengthInfo=null,this._sessionId=new _.WatchedValue,this._barBuilderLoader=null,this._symbolInfo=null,this._symbol={symbol:""},this._timeFrameInvalidated=new g.Delegate,this._firstValueCache=null,this._historyUpdateReceived=!1,this._miniChart=e,this._originalSeriesOptions=t,this._currentSeriesOptions=(0,o.default)({},t),this._options=s,this._horzMargins=(0,o.default)({},k,t.horzMargins),this._series=this._createSeries(),this._originalVolumeOptions=i, this._volume=this._createVolume(),this._timeFrame=e.timeframe().spawn(),this._timeFrame.subscribe(this._updateSessionId.bind(this)),this._currentlyShownDataDescription=new S.WatchedObject({timeframe:this._timeFrame.value(),symbol:this.symbol()}),this._isLastSessionInterval=(0,u.combine)((e=>"LASTSESSION"===e.value),this._miniChart.timeframe().weakReference()),this._isLastSessionInterval.subscribe(this._updateSessionId.bind(this)),this._miniChart.timeScaleSizeChanged().subscribe(null,this._timeScaleSizeChanged.bind(this))}destroy(){var e;this._status.unsubscribe(),this._timeFrame.destroy(),this._isDestroyed.setValue(!0),this._isLastSessionInterval.destroy(),null===(e=this._barBuilderLoader)||void 0===e||e.destroy()}status(){return this._status.readonly()}noData(){return this._noData.readonly()}symbolInfo(){return this._symbolInfo}symbol(){return this._symbol.symbol}subSession(){return this._sessionId.value()}setSymbol(e,t){(0,a.default)(e)&&(e={...this._symbol,symbol:e}),void 0!==t&&this._updateSeriesOptions(t),(0,y.compareSymbols)(this._symbol,e)||(this._symbol=e,this._updateSessionId(),this._symbolChanged.fire())}extendedSymbol(){return{...this._symbol,session:this._sessionId.value()}}updateSeriesOptions(e){const t=void 0!==e.chartType&&this._originalSeriesOptions.chartType!==e.chartType;this._updateSeriesOptions(e),t?this._onChartStyleChanged():this._series.applyOptions(e)}applyOptions(e){(0,o.default)(this._options,e)}updateHorzMargins(e){this._horzMargins=(0,o.default)(this._horzMargins,e),this.fitContent()}symbolResolved(){return this._symbolResolved}symbolChanged(){return this._symbolChanged}seriesChanged(){return this._seriesChanged}timeFrameInvalidated(){return this._timeFrameInvalidated}restoreOriginalScaleMode(){null!==this._originalScaleMode&&this._series.priceScale().applyOptions({mode:this._originalScaleMode})}switchToPercentageScaleMode(){null===this._originalScaleMode&&(this._originalScaleMode=this._series.priceScale().options().mode),this._series.priceScale().applyOptions({mode:r.PriceScaleMode.Percentage})}chartSession(){return this._miniChart.chartSession()}currentSeriesOptions(){return this._currentSeriesOptions}volumeOptions(){return this._originalVolumeOptions}series(){return this._series}volume(){return this._originalVolumeOptions.visible?this._volume:null}updateData(e,t,i){var s;e&&this.clearSourceData();const r=this._originalSeriesOptions,o=this._buildViewData(i),a=o.series.length;if(this._historyUpdateReceived=this._historyUpdateReceived||void 0===i,0===a)return void(void 0===i&&(this._dataLengthInfo=null,this._firstValueCache=null));void 0!==i||"area"!==r.chartType&&"line"!==r.chartType||(this._firstValueCache=o.series[0].value);const n=this._historyUpdateReceived&&null===this._dataLengthInfo;if(void 0!==i&&!n){const e=this._dataLengthInfo;if(null===e)return;const t={...e};e.lastBarSession=o.lastBarSession;let i=!1;for(const t of o.series)this._series.update(t),e.lastBarTimet.time>e.lastBarTime));-1===t?(e.whitespaces=0,this._updateWhitespaces([])):0!==t&&(e.whitespaces-=t,this._updateWhitespaces(this._whitespacesData.slice(t)))}return i&&(void 0!==e.fixLeftEdgeUntil?(this._isMainPlot()&&e.fixLeftEdgeUntil>=e.lastBarTime&&this.fitContent(),e.lastBarTime>e.fixLeftEdgeUntil&&(e.history+=e.realtime-1,e.realtime=0,e.fixLeftEdgeUntil=void 0,e.timeFrameInvalidated=!0,this._timeFrameInvalidated.fire())):e.timeFrameInvalidated||(e.timeFrameInvalidated=!0,this._timeFrameInvalidated.fire())),this._updateSeriesColor(o.series[o.series.length-1]),void this._dataUpdated(o,e,t)}const l=o.whitespaces,h=null!==(s=null==l?void 0:l.length)&&void 0!==s?s:0;this._dataLengthInfo={history:a,realtime:0,lastBarIndex:a-1,lastBarTime:o.series[o.series.length-1].time,whitespaces:h,fixLeftEdgeUntil:o.fixLeftEdgeUntil,timeFrameInvalidated:!1,lastBarSession:o.lastBarSession},this._updateSeriesColor(o.series[o.series.length-1]),this._series.applyOptions(this._currentSeriesOptions),this._applyPriceScaleFormatter(),t||this._beforeDataReady(),this._series.setData(o.series),o.additionalSeries&&this._setAdditionalSeriesData(o.additionalSeries),o.volume&&this._volume.setData(o.volume),this._updateWhitespaces(o.whitespaces),this._dataUpdated(o,this._dataLengthInfo)}fitContent(){if(null===this._dataLengthInfo||0===this._dataLengthInfo.history)return;const{history:e,realtime:t,whitespaces:i,lastBarTime:s,fixLeftEdgeUntil:r=0}=this._dataLengthInfo,o=this._miniChart.widget(),a=o.paneSize().width;if(0===a)return;const{leftLogical:n,rightLogical:l,leftPx:h,rightPx:c}=this._horzMargins;let d=-n-(r>=s?0:t),u=e+l+i+t;if(0!==h){d-=h/((a-h)/(u-d+1))}if(0!==c){u+=c/((a-c)/(u-d+1))}u=Math.max(d,u),o.timeScale().setVisibleLogicalRange({from:d,to:u}),o.timeScale().applyOptions({lockVisibleTimeRangeOnResize:!0})}titles(){return this._currentSeriesOptions.title?[this._currentSeriesOptions.title]:[]}deleteView(){var e;this._series.setData([]),null===(e=this._whitespaces)||void 0===e||e.setData([]),this._volume.setData([])}clearData(){this._symbolInfo=null,this._historyUpdateReceived=!1,this._dataLengthInfo=null,this._firstValueCache=null,this._customPriceFormatter=null,this._status.setValue(0),this._noData.setValue(null),this._directionBasedColor.setValue(null)}resolution(){return this._miniChart.resolution()}forcePercentageMode(){return!1}lastBarTime(){var e;return null===(e=this._dataLengthInfo)||void 0===e?void 0:e.lastBarTime}getViewData(e){return this._buildViewData(e)}getLegendData(e,t){var s,r,o,a;const{point:l,time:c,seriesData:u}=e,m=this.series(),_=this.volume();if(void 0===l||void 0===c)return[];const g=u.get(m);if(void 0===g)return[];const p=[],v=m.priceFormatter(),f=this.currentSeriesOptions();if(!1===f.visible)return[];if("Area"===m.seriesType()||"Line"===m.seriesType()){const{value:e,color:t}=g;let i ;"line"===f.chartType?i=t||f.color:"area"===f.chartType&&(i=void 0),p.push({title:f.tooltipTitle||(null===(s=this.symbolInfo())||void 0===s?void 0:s.name)||"",value:v.format(e),color:i,unit:f.showUnit?null===(r=this.symbolInfo())||void 0===r?void 0:r.currency_code:void 0})}else{const{open:e,high:s,low:r,close:o}=g,a=function(e,t){const i=e?t.up:t.down;return M(i)}(o>=e,(0,n.ensureDefined)(t[m.seriesType()]));[[h.t(null,{context:"in_legend"},i(746728)),v.format(e)],[h.t(null,{context:"in_legend"},i(943253)),v.format(s)],[h.t(null,{context:"in_legend"},i(389923)),v.format(r)],[h.t(null,{context:"in_legend"},i(102696)),v.format(o)]].forEach((([e,t])=>{p.push({value:t,title:e,color:a})}))}const y=_&&u.get(_),b=this.volumeOptions();if(y){const{value:e,color:t}=y;p.push({title:null!==(o=b.tooltipTitle)&&void 0!==o?o:h.t(null,{context:"in_legend"},i(971060)),value:w.format(e),color:b.ignoreColor?void 0:t&&(0,d.resetTransparency)(t),unit:b.showUnit?null===(a=this.symbolInfo())||void 0===a?void 0:a.currency_code:void 0})}return p}isDestroyed(){return this._isDestroyed.readonly()}_isMainPlot(){return!1}_onChartStyleChanged(){this._recreateSeries(),3===this._status.value()&&this.updateData(!1,!0)}_beforeDataReady(){this._currentlyShownDataDescription.setValue({timeframe:this._timeFrame.value(),symbol:this.symbol()})}_dataUpdated(e,t,i){}_onSymbolResolved(e){var t;null===(t=this._barBuilderLoader)||void 0===t||t.destroy(),this._barBuilderLoader=null,this._symbolInfo=e,this._symbolResolved.fire(this._symbolInfo)}_getViewData(e,t){const i=[],s={series:[],volume:i};let r=-1/0;const o=this._bars();if(o.isEmpty())return s;const a=this.minBarIndex(),n=this.maxBarIndex();if(null===a||null===n)return s;const l=null!=t?t:P(a)?a:o.firstIndex(),h=o.lastIndex();if(null===l||null===h)return s;let c;const{premarketLineColor:d,postmarketLineColor:u,premarketTopColor:m,premarketBottomColor:_,postmarketTopColor:g,postmarketBottomColor:p}=this._getPrePostMarketColors(),f=e=>{switch(e){case 0:return[d,m,_];case 1:return[u,g,p];default:return[]}};for(const t of o.rangeIterator(l,h)){const{value:o,index:a}=t;if(a<=v.UNPLOTTABLE_TIME_POINT_INDEX)continue;const n=this._miniChart.indexToTime(a);if(null===n){C.logWarn(`Couldn't find time for index ${a}`);continue}const l=x(1e3*n);if(l<=r)continue;r=l,c=l;const h=this._barIndexSession(a);s.lastBarSession=h,s.series.push(e(l,o,...f(h)));const d=o[4]>=o[1]?this._originalVolumeOptions.upColor:this._originalVolumeOptions.downColor;i.push({time:l,value:o[5],color:d})}if(this._isMainPlot()&&void 0===t&&void 0!==c)switch(this._timeFrame.value().value){case"1D":s.fixLeftEdgeUntil=c+86400-1;break;case"LASTSESSION":{let e=[],t=c+87840-1;const i=this._generateBarsToSessionEnd();(null==i?void 0:i.length)&&null!==n&&n>h&&(e=i,t=i[i.length-1].time),s.fixLeftEdgeUntil=t,s.whitespaces=e}}return s}_buildViewData(e){switch(this._originalSeriesOptions.chartType){case"histogram":{const e=this._currentSeriesOptions;return this._getViewData(((t,i)=>function(e,t,i,s){const r=t[4];return{time:e,color:r>0?i:s,value:r} }(t,i,e.upColor,e.downColor)))}case"line":return this._getViewData(D,e);case"area":return this._getViewData(I,e);case"bars":case"candlesticks":return this._getViewData(T,e)}}_setAdditionalSeriesData(e){}_updateAdditionalSeriesData(e){}_barIndexSession(e){}_onSymbolError(e){C.logWarn((0,y.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol)+" symbol resolving error: "+e),this.updateData(!0),this._status.setValue(1)}_onSymbolNotPermitted(){this._noData.setValue(1)}_onSymbolGroupNotPermitted(){this._noData.setValue(1)}_onSymbolInvalid(){this._noData.setValue(0)}_onResolutionOrExchangeNotPermittedError(){C.logError((0,y.encodeExtendedSymbolOrGetSimpleSymbolString)(this._symbol)+" resolution or exchange permission error"),this.updateData(!0),this._isMainPlot()&&this._miniChart.showMessage(h.t(null,void 0,i(284259))),setTimeout((()=>this._miniChart.updateAvailableTimeframes()),1e3)}_onDataError(){1!==this._status.value()&&this._status.setValue(2),this._noData.setValue(3)}_onDataCompleted(){this._status.setValue(3),this._noData.setValue(0===this._bars().size()?2:null),2===this._noData.value()&&this._isMainPlot()&&this._miniChart.showMessage(h.t(null,void 0,i(212938)))}async _onData(e,t){null!==this.minBarIndex()&&null!==this.maxBarIndex()&&this.updateData(!1,void 0,e)}_updateSeriesOptions(e){this._originalSeriesOptions=(0,o.default)(this._originalSeriesOptions,e),this._currentSeriesOptions=(0,o.default)(this._currentSeriesOptions,this._originalSeriesOptions),this._updateSeriesColor(),e.horzMargins&&this.updateHorzMargins(e.horzMargins)}_recreateSeries(){const e=this._miniChart.widget();e.removeSeries(this._series),e.removeSeries(this._volume),this._whitespaces&&(e.removeSeries(this._whitespaces),this._whitespaces=null),this._series=this._createSeries(),this._volume=this._createVolume(),this._seriesChanged.fire()}_initBarBuilder(e){return null===this._barBuilderLoader&&(this._barBuilderLoader=new c.AsyncResourceWrapper(Promise.all([i.e(97525),i.e(65414),i.e(89507),i.e(96003)]).then(i.bind(i,397796)).then((t=>new t.LightweightMiniChartBarBuilder(e))))),this._barBuilderLoader.promise()}_firstAndLastValuesForSeriesColor(e,t){if(null===this._firstValueCache||!this._dataLengthInfo)return null;if("line"!==e&&"area"!==e)return null;const i=this._series.dataByIndex(this._dataLengthInfo.lastBarIndex);return null!==i||t?(t=null!=t?t:i,[this._firstValueCache,t.value]):null}_updateSeriesColor(e){const t=this._originalSeriesOptions,i=t.chartType,s=this._firstAndLastValuesForSeriesColor(i,e);if(null===s)return;const[r,o]=s;if("line"===i||"area"===i){const e="line"===i?o>=r:o>r;if("area"===i){const i=this._currentSeriesOptions;e?(i.lineColor=t.growingLineColor||t.lineColor,i.topColor=t.growingTopColor||t.topColor,i.bottomColor=t.growingBottomColor||t.bottomColor):(i.lineColor=t.fallingLineColor||t.lineColor,i.topColor=t.fallingTopColor||t.topColor,i.bottomColor=t.fallingBottomColor||t.bottomColor),i.lineColor||(i.lineColor=this._series.options().lineColor),this._series.applyOptions({topColor:i.topColor,bottomColor:i.bottomColor, lineColor:i.lineColor}),this._directionBasedColor.setValue(i.lineColor)}else if("line"===i){const{color:i,growingColor:s=i,fallingColor:r=i}=t,o=this._currentSeriesOptions;o.color=e?s:r,o.color||(o.color=this._series.options().color),this._series.applyOptions({color:o.color}),this._directionBasedColor.setValue(o.color)}}}_createSeries(){const e=this._miniChart.widget();let t;switch(this._currentSeriesOptions.chartType){case"line":t=e.addLineSeries(this._currentSeriesOptions);break;case"histogram":t=e.addHistogramSeries(this._currentSeriesOptions);break;case"area":t=e.addAreaSeries(this._currentSeriesOptions);break;case"bars":t=e.addBarSeries(this._currentSeriesOptions);break;case"candlesticks":t=e.addCandlestickSeries(this._currentSeriesOptions)}return null===this._originalScaleMode&&(this._originalScaleMode=t.priceScale().options().mode),t.priceScale().applyOptions({scaleMargins:this._currentSeriesOptions.scaleMargins}),t}_createVolume(){const e=this._miniChart.widget().addHistogramSeries(this._originalVolumeOptions);return e.priceScale().applyOptions({scaleMargins:this._originalVolumeOptions.scaleMargins}),e}_applyPriceScaleFormatter(){var e;if("priceFormat"in this._originalSeriesOptions)return;const t=(0,n.ensureNotNull)(null!==(e=this._symbolInfo)&&void 0!==e?e:this._miniChart.mainPlot().symbolInfo());this._currentSeriesOptions.priceFormat={type:"custom",minMove:t.minmov/t.pricescale,formatter:e=>(0,b.createSeriesFormatter)(t,"default").format(e)},this._series.applyOptions(this._currentSeriesOptions)}_updateSessionId(){this._sessionId.setValue(this._isLastSessionInterval.value()?"extended":this._symbol.session)}_updateWhitespaces(e){void 0===e||0===e.length?null!==this._whitespaces&&(this._miniChart.widget().removeSeries(this._whitespaces),this._whitespaces=null):(null===this._whitespaces&&(this._whitespaces=this._miniChart.widget().addLineSeries()),this._whitespacesData=null===this._whitespaces?void 0:e,this._whitespaces.setData(e))}_generateBarsToSessionEnd(){var e;const t=this.symbolInfo(),i=this._bars().lastIndex(),s=this.maxBarIndex();if(t&&i&&s&&this._isLastSessionInterval.value()){let t=this._miniChart.indexToTime(i);if(null===t)return;const r=[];for(let o=i+1;o<=s;o+=1){const i=null!==(e=this._miniChart.indexToTime(o))&&void 0!==e?e:t+60;r.push({time:x(1e3*i)}),t=i}return r}}_getPrePostMarketColors(){if(!this._isMainPlot())return{};let e,t,i,s;const r=this._originalSeriesOptions.premarketLineColor,o=this._originalSeriesOptions.postmarketLineColor;if("area"===this._originalSeriesOptions.chartType&&r&&o){const a=this._currentSeriesOptions,n=a.growingTopColor||a.fallingTopColor||a.topColor;if(void 0!==n){const t=(0,l.tryParseRgba)(n);if(null!==t){const s=t[3];e=(0,d.applyAlpha)(r,s),i=(0,d.applyAlpha)(o,s)}}const h=a.growingBottomColor||a.fallingBottomColor||a.bottomColor;if(void 0!==h){const e=(0,l.tryParseRgba)(h);if(null!==e){const i=e[3];t=(0,d.applyAlpha)(r,i),s=(0,d.applyAlpha)(o,i)}}}return{premarketLineColor:r,postmarketLineColor:o,premarketTopColor:e,postmarketTopColor:i,premarketBottomColor:t, postmarketBottomColor:s}}_timeScaleSizeChanged(){this._isMainPlot()&&Promise.resolve().then((()=>this.fitContent()))}}},195317:(e,t,i)=>{"use strict";i.d(t,{MiniChartPlot:()=>h});var s=i(650151),r=i(55243),o=i(518439),a=i(501372),n=i(293659),l=i(264552);class h extends n.MiniChartPlotBase{constructor(e,t,i,s,r,o){super(e,t,i,r),this._seriesDataSource=null,this._cachedData=null,this._minBarIndex=null,this._maxBarIndex=null,this._studyPlots=s,this._options=r,o&&this._loadCache(o)}destroy(){var e;null===(e=this._seriesDataSource)||void 0===e||e.destroy(),super.destroy()}reloadCache(e){this._cache=e,e?this._loadCache(e):(this._minBarIndex=null,this._maxBarIndex=null,this._cachedData=null,this._onData().then((()=>{this.fitContent()})))}requestData(){const e=this._getSeriesDataSource();this._status.setValue(0),this._noData.setValue(null),e.modifySeries(this.extendedSymbol(),(0,l.getServerInterval)(this.resolution()),this._miniChart.timeframe().value()),e.isStarted()||e.start()}clearSourceData(){var e;null===(e=this._seriesDataSource)||void 0===e||e.clearData(),this._studyPlots().forEach((e=>e.clearSourceData()))}moveSourceData(e){var t;null===(t=this._seriesDataSource)||void 0===t||t.moveData(e)}onTickmarksAdded(e,t){const i=this.maxBarIndex();this._isLastSessionInterval.value()&&null!==i&&i>=e&&i<=t&&(this.updateData(!1,!0),this.fitContent())}disconnect(){var e;null===(e=this._seriesDataSource)||void 0===e||e.stop()}isConnected(){var e;return Boolean(null===(e=this._seriesDataSource)||void 0===e?void 0:e.isStarted())}clearData(){if(super.clearData(),this._minBarIndex=null,this._maxBarIndex=null,null!==this._seriesDataSource&&(this._seriesDataSource.stop(),this.clearSourceData()),this._cache){const{minBarIndex:e,maxBarIndex:t,symbolInfo:i}=this._cache;this._minBarIndex=e,this._maxBarIndex=t,i&&(this._symbolInfo=i,this._initBarBuilder(i).then((()=>{this._isDestroyed.value()||this._onData().then((()=>{this.fitContent()}))})))}}seriesDataSource(){return this._getSeriesDataSource()}firstBar(){return(0,n.isTimePointIndex)(this._minBarIndex)?this._bars().search(this._minBarIndex):this._bars().first()}lastBar(){return(0,n.isTimePointIndex)(this._maxBarIndex)?this._bars().search(this._maxBarIndex,o.PlotRowSearchMode.NearestLeft):this._bars().last()}minBarIndex(){return this._minBarIndex}maxBarIndex(){return this._maxBarIndex}cacheData(){var e,t;const i=null===(t=null===(e=this._seriesDataSource)||void 0===e?void 0:e.data())||void 0===t?void 0:t.clone(),s=this._symbolInfo,r=this._minBarIndex,o=this._maxBarIndex;return i&&null!==s&&null!==r&&null!==o?{data:i,symbolInfo:s,minBarIndex:r,maxBarIndex:o}:null}_isMainPlot(){return!0}_dataUpdated(e,t,i){if(super._dataUpdated(e,t,i),!this._isLastSessionInterval.value()||!this._miniChart.supportRealtimeUpdates()||!i)return;const s=i.lastBarSession;0!==s&&1!==s||2!==t.lastBarSession||Promise.resolve().then((()=>{this._miniChart.setTimeframe(this._miniChart.timeframe().value(),!1,!0)}))}_onChartStyleChanged(){(0, s.assert)(0===this._studyPlots().length,"Dynamic style change is not supported if there are additional plots"),super._onChartStyleChanged()}_beforeDataReady(){super._beforeDataReady(),this._studyPlots().forEach((e=>e.deleteView()))}_getSeriesDataSource(){if(null===this._seriesDataSource){const e=this._seriesDataSource=new a.SeriesDataSource(this.chartSession(),"s"),t=e.dataEvents();t.symbolResolved().subscribe(this,this._onSymbolResolved),t.symbolNotPermitted().subscribe(this,this._onSymbolNotPermitted),t.symbolGroupNotPermitted().subscribe(this,this._onSymbolGroupNotPermitted),t.symbolInvalid().subscribe(this,this._onSymbolInvalid),t.symbolError().subscribe(this,this._onSymbolError),t.intradayExchangeNotPermitted().subscribe(this,this._onResolutionOrExchangeNotPermittedError),t.customIntervalNotPermitted().subscribe(this,this._onResolutionOrExchangeNotPermittedError),t.completed().subscribe(this,this._onDataCompleted),t.seriesError().subscribe(this,this._onDataError),t.seriesTimeFrame().subscribe(this,this._onTimeFrame),t.dataUpdated().subscribe(this,this._onDataInternal),t.created().subscribe(null,(()=>performance.mark("RFD",{detail:"Request first data"})),!0),t.created().subscribe(null,(()=>e.setFutureTickmarksMode("full_single_session"))),t.dataUpdated().subscribe(null,(()=>{performance.mark("FDR",{detail:"First data response"}),performance.measure("Response idle","RFD","FDR")}),!0)}return this._seriesDataSource}_bars(){var e,t;return this._cachedData?this._cachedData.seriesData.bars():null!==(t=null===(e=this._seriesDataSource)||void 0===e?void 0:e.data().bars())&&void 0!==t?t:new r.PlotList}_onTimeFrame(e,t){this._cachedData||(this._minBarIndex=e,this._maxBarIndex=t),this.updateData(!1),this._studyPlots().forEach((e=>e.updateData(!1,!0)))}_onDataCompleted(){this._cachedData&&(this._cachedData=null),super._onDataCompleted(),this.updateData(!1,!0),this.fitContent()}_onDataInternal(e,t,i){this._onData(t||null==i?void 0:i.index)}async _loadCache(e){const{data:t,symbolInfo:i,minBarIndex:s,maxBarIndex:r}=e;this._minBarIndex=s,this._maxBarIndex=r,this._cachedData={symbol:this.extendedSymbol(),resolution:this.resolution(),timeFrame:this._miniChart.timeframe().value(),seriesData:t},this._symbolInfo=i;const o=await this._initBarBuilder(i);!this._isDestroyed.value()&&this._symbolInfo&&(this._symbolInfo!==i&&o.update(this._symbolInfo),await this._onData(),this._status.setValue(3),this.fitContent())}}},254688:(e,t,i)=>{"use strict";i.d(t,{LightweightMiniChart:()=>H});var s=i(431057),r=i(998034),o=i(650151),a=i(960095),n=i(444372),l=i(338619),h=i(242238),c=i(81951),d=i(378975),u=i(432059),m=i(941285),_=i(553220),g=i(319448),p=i(69184),v=i(195317);const f=(0,s.defaultHorzScaleBehavior)();class y extends f{constructor(){super(...arguments),this._lastHash=""}shouldResetTickmarkLabels(e){const t=this.calculateItemsHash(e),i=t!==this._lastHash;return this._lastHash=t,i}calculateItemsHash(e){return e.reduce(((e,t)=>e+t.index),"")}}var b=i(942634),S=i(805578),C=i(375397),w=i(566238),D=i(72224);const T=(0, l.getLogger)("Chart.MiniChart"),I={value:"12M",type:"period-back"},x={top:.01,bottom:.01},P={chartType:"area",lineWidth:2,priceLineVisible:!1,crosshairMarkerVisible:!1,lastValueVisible:!1,scaleMargins:x},M={lineWidth:2,priceLineVisible:!1,crosshairMarkerVisible:!1,lastValueVisible:!1,scaleMargins:x},k={priceLineVisible:!1,lastValueVisible:!1,scaleMargins:x},F={priceLineVisible:!1,lastValueVisible:!1,scaleMargins:x},R={scaleMargins:x},L={scaleMargins:{top:.8,bottom:0},priceScaleId:"overlay",upColor:(0,u.applyTransparency)(a.colorsPalette["color-minty-green-500"],50),downColor:(0,u.applyTransparency)(a.colorsPalette["color-ripe-red-500"],50),visible:!1,lastValueVisible:!1,priceLineVisible:!1},O={visible:!1,color:a.colorsPalette["color-tv-blue-500"],lineWidth:1,length:9,lastValueVisible:!1,priceLineVisible:!1},V={spinner:{visible:!1,width:4,color:a.colorsPalette["color-brand"]},fade:{visible:!1},clearDataOnSymbolChange:!0,clearDataOnTimeframeChange:!0},E={onFirstData:null,description:"",showDescription:!0,valuesTracking:"0",timeframe:{visible:!1,value:I.value},chartOptions:{minWidth:0,minHeight:0,chart:{grid:{horzLines:{color:"rgba(120, 123, 134, 0.1)",visible:!1},vertLines:{color:"#ffffff",visible:!1}},crosshair:{horzLine:{visible:!1,style:3,width:1,labelVisible:!1},vertLine:{visible:!1,style:3,width:1,labelVisible:!1}},layout:{fontFamily:"Trebuchet MS",fontSize:10,textColor:"#83888D",background:{type:s.ColorType.Solid,color:"transparent"}},watermark:{visible:!1,color:"#83888D",fontSize:12},rightPriceScale:{visible:!0,borderVisible:!1,entireTextOnly:!0,mode:s.PriceScaleMode.Normal},leftPriceScale:{visible:!1,borderVisible:!1,entireTextOnly:!0,mode:s.PriceScaleMode.Normal},timeScale:{borderVisible:!1,timeVisible:!0,secondsVisible:!1,lockVisibleTimeRangeOnResize:!0},handleScale:!1,handleScroll:!1},series:P,volume:L,ma:O,loading:V}},A={"1y":{value:"12M",type:"period-back"},"5y":{value:"60M",type:"period-back"},max:{value:"ALL",type:"period-back"}};function B(e,t,i,r,o,a){return!!e.dayAndTimeTickMarkFixEnabled&&(r===s.TickMarkType.Time?function(e){return e.value.endsWith("M")||e.value.endsWith("Y")||["YTD","ALL"].includes(e.value)}(t):!(!o||!a||r<=a)&&(r===s.TickMarkType.DayOfMonth&&(i.getMonth()!==o.getMonth()||i.getFullYear()!==o.getFullYear())))}const N=(()=>{let e=null,t=null,i=null;return(r,o,a,n,l,h)=>{var c;const d={},u=new Date(1e3*n);i!==a.value&&(e=null,t=null,i=a.value);let m=!1;if(o){m=(null!==(c=o.suppressFn)&&void 0!==c?c:B)(o,a,u,l,e,t)}if(e=u,t=l,m)return"";switch(l){case s.TickMarkType.Year:(null==o?void 0:o.hideYearsTickMarks)?d.month="short":d.year="numeric";break;case s.TickMarkType.Month:d.month="short";break;case s.TickMarkType.DayOfMonth:d.day="numeric";break;case s.TickMarkType.Time:d.hour12="12-hours"===r,d.hour="2-digit",d.minute="2-digit";break;case s.TickMarkType.TimeWithSeconds:d.hour12="12-hours"===r,d.hour="2-digit",d.minute="2-digit",d.second="2-digit"} const _=new Date(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate(),u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds());return e=u,t=l,_.toLocaleString(h,d)}})();window.lightweightMiniChartInstances=window.lightweightMiniChartInstances||{};const U=window.lightweightMiniChartInstances;let z=0;const W={acquire:()=>(0,S.ownership)(new h.ChartSession(window.ChartApiInstance,!0))};class H{constructor(e,t,i,o,a){var n,l,h,d;this._isDestroyed=!1,this._studyPlots=[],this._elTimeframe=null,this._timeframeView=null,this._tickmarks=new Map,this._cachedTickmarks=new Map,this._chartSession=null,this._chartSessionConnected=null,this._connectCallback=null,this._connected=!1,this._loadErrorTimeout=null,this._isLoading=!1,this._spinner=null,this._floatingTooltip=null,this._onCrosshairMoveBound=null,this._atomicUpdateIsGoing=!1,this._seriesUpDownColors={},this._isDWMResolution=!1,this._updateTimerId=null,this._width=new C.WatchedValue(0),this._height=new C.WatchedValue(0),this._status=new C.WatchedValue("loading"),this._timeScaleSizeChanged=new b.Delegate,this._onPlotStatusChanged=()=>{const e=this._mainPlot.status().value(),t=this._studyPlots.every((e=>0!==e.status().value()));switch(e){case 3:t&&this._onPlotsDataReady();break;case 2:this._onMainPlotDataError();break;case 1:this._onMainPlotSymbolResolvingError()}if(this._options.chartOptions.loading.fade.visible)switch(this._cachedTickmarks.size>0||e){case 0:this._innerContainer.classList.add(D.fade);break;case 2:case 1:case 3:case!0:this._innerContainer.classList.remove(D.fade)}this._updateStatus()},this._timeFrameOptions=null!==(l=null===(n=null==o?void 0:o.timeframe)||void 0===n?void 0:n.options)&&void 0!==l?l:(0,c.getMiniTimeFrameOptions)(),this._options=(0,r.default)({},E,o),this._chartSessionProvider=null!=a?a:W,this._container=t,this._innerContainer=t.ownerDocument.createElement("div"),this._innerContainer.style.width="100%",this._innerContainer.style.height="100%",this._innerContainer.style.minHeight="inherit",this._innerContainer.style.minWidth="inherit",t.appendChild(this._innerContainer),this._widget=(0,s.createChartEx)(this._innerContainer,new y,{...null===(h=this._options.chartOptions)||void 0===h?void 0:h.chart,autoSize:!0}),this._tooltipContainer=i,this._timeframe=new w.WatchedObject({type:"period-back",value:this._options.timeframe.value}),this._mainPlot=this._createMainPlot(e),this.setTimeframe(this._timeframe.value(),!0);const u=null===(d=this._options.cache)||void 0===d?void 0:d.loadData(this._timeframe.value().value);u?(this._cachedTickmarks=u.tickmarks,this._tickmarks=new Map(this._cachedTickmarks),this._createTooltipDateFormatter()):this.connect(),this._parentResizeObserver=new ResizeObserver((e=>{this._mainPlot.fitContent();for(const t of e)if(t.contentBoxSize){const e=t.contentBoxSize[0];this._width.setValue(e.inlineSize),this._height.setValue(e.blockSize)}})),this._parentResizeObserver.observe(t);const m=t.getBoundingClientRect();this._width.setValue(m.width),this._height.setValue(m.height),this._createFloatingTooltip(), this._createLegend(),this._updateSeriesUpDownColors(),this._boundTimeScaleSizeChangedHandler=this._timeScaleSizeChangedHandler.bind(this),this._widget.timeScale().subscribeSizeChange(this._boundTimeScaleSizeChangedHandler),z+=1,this._innerContainer.dataset.lightweightMiniChartId=`${z}`,U[this._innerContainer.dataset.lightweightMiniChartId]=this}container(){return this._container}getChartContainer(){var e,t,i,s,r;return null!==(r=null===(s=null===(i=null===(t=null===(e=this._container.getElementsByTagName("div").item(0))||void 0===e?void 0:e.getElementsByTagName("table").item(0))||void 0===t?void 0:t.getElementsByTagName("tr").item(0))||void 0===i?void 0:i.getElementsByTagName("td").item(1))||void 0===s?void 0:s.getElementsByTagName("div").item(0))&&void 0!==r?r:null}width(){return this._width.readonly()}height(){return this._height.readonly()}status(){return this._status.readonly()}seriesDataSource(){return this._mainPlot.seriesDataSource()}supportRealtimeUpdates(){return Boolean(this._options.doNotDisconnectOnDataReady)}connect(e){var t;(0,o.assert)(!(null===(t=this._options.cache)||void 0===t?void 0:t.loadData(this._timeframe.value().value)),"Chart can not to connect if there is an existing cache data"),"function"==typeof e&&(this._connectCallback=e),this._clearReconnectionTimeout(),this.connected()||(this._showLoading(),this._mainPlot.clearData(),this._studyPlots.forEach((e=>e.clearData())),this._chartSession||(this._chartSession=this._chartSessionProvider.acquire(),this._chartSession.criticalError().subscribe(this,this._onChartSessionCriticalError),this._chartSessionConnected=this._chartSession.isConnected().spawn(),this._chartSessionConnected.subscribe(this._onChartSessionIsConnectedChanged.bind(this),{callWithLast:!0})),this._chartSession.connect(this._onData.bind(this)),this._chartSession.isConnected().value()&&this._requestData(),this._clearLoadErrorTimeout(),this._loadErrorTimeout=setTimeout((()=>{this.showMessage(n.t(null,void 0,i(653273))),"function"==typeof this._options.onFirstData&&(this._options.onFirstData(),this._options.onFirstData=null)}),15e3))}disconnect(){var e;this._studyPlots.forEach((e=>e.disconnect())),this._mainPlot.disconnect(),null===(e=this._chartSession)||void 0===e||e.disconnect(),this._connected=!1,this._clearLoadErrorTimeout()}connected(){return Boolean(this._connected&&this._chartSession&&this._chartSession.isConnected().value())}setTimeframe(e,t,i){var s;const r=this._timeframe.value();let o=e;const a=A[o.value];void 0!==a&&(o=a);const n=this._timeframeIsAvailable(o)?o:I;this._timeframe.setValue(n),this._activeRange=this._timeframe.value().value,this._timeframeView&&this._options.timeframe.visible&&this._timeframeView.update({activeRange:this._activeRange});const l=null===(s=this._options.cache)||void 0===s?void 0:s.loadData(this._timeframe.value().value);if(l)return this._cachedTickmarks=l.tickmarks,this._tickmarks=new Map(this._cachedTickmarks),this._createTooltipDateFormatter(),void this._mainPlot.reloadCache(l.mainPlot) ;this._cachedTickmarks.size&&(this._cachedTickmarks=new Map,this._tickmarks=new Map,this._mainPlot.reloadCache(),this._mainPlot.clearData()),(!t&&r!==this._timeframe.value()||i)&&this._requestDataOnTimeframeChange()}chartSession(){return(0,o.ensureNotNull)(this._chartSession)}widget(){return this._widget}timeframe(){return this._timeframe.readonly()}setTimeFrameOptions(e,t){if(e===this._timeFrameOptions)return;const i=this.resolution();this._timeFrameOptions=e,t?this.setTimeframe(t):this.resolution()!==i&&this._requestDataOnTimeframeChange(),this._initTimeframesRenderer()}timeFrameOptions(){return this._timeFrameOptions}resolution(){const e=this._timeFrameOptions.find((e=>e.value.value===this.timeframe().value().value));return(0,o.ensureDefined)(null==e?void 0:e.targetResolution)}changeSymbol(e,t){void 0!==t&&this._updateSeriesOptions(t),this._options.chartOptions.loading.clearDataOnSymbolChange&&(this._mainPlot.clearData(),this._mainPlot.deleteView(),this._studyPlots.forEach((e=>e.clearData())),this._studyPlots.forEach((e=>e.deleteView()))),this._mainPlot.setSymbol(e,this._options.chartOptions.series),this._mainPlot.requestData(),this._studyPlots.forEach((e=>e.requestData())),this.connect()}updateSeriesOptions(e){this._atomicUpdateIsGoing=!0,this._updateSeriesOptions(e),this._updateSeriesUpDownColors(),this._mainPlot.updateSeriesOptions(e),this._atomicUpdateIsGoing=!1}getSeriesOptions(){return this._mainPlot.currentSeriesOptions()}showMessage(e){this._hideLoading(),this._mainPlot.deleteView(),this._studyPlots.forEach((e=>e.deleteView())),this._widget.applyOptions({watermark:{visible:!0,text:e}})}hideMessage(){this._widget.applyOptions({watermark:{visible:!1}})}from(){const e=this._timeFrameOptions.find((e=>e.value.value===this.timeframe().value().value));return[null==e?void 0:e.from]}enable(e){this.connect(e)}disable(){this.disconnect()}destroy(){var e,t,i,s;this._boundTimeScaleSizeChangedHandler&&(this._widget.timeScale().unsubscribeSizeChange(this._boundTimeScaleSizeChangedHandler),this._boundTimeScaleSizeChangedHandler=void 0),this._parentResizeObserver.disconnect(),this.disconnect(),this._destroyFloatingTooltip(),this._widget.remove(),this._mainPlot.symbolResolved().unsubscribeAll(null),this._mainPlot.timeFrameInvalidated().unsubscribeAll(this),this._mainPlot.destroy(),this._studyPlots.forEach((e=>e.destroy())),null===(e=this._timeframeView)||void 0===e||e.destroy(),null===(t=this._chartSessionConnected)||void 0===t||t.destroy(),null===(i=this._chartSession)||void 0===i||i.criticalError().unsubscribeAll(this),null===(s=this._chartSession)||void 0===s||s.release(),delete U[this._innerContainer.dataset.lightweightMiniChartId],this._innerContainer.remove(),this._isDestroyed=!0}updateAvailableTimeframes(){this._mainPlot.symbolInfo()?(this._timeframeView&&this._options.timeframe.visible&&this._timeframeView.update({ranges:this._getAvailableTimeFrames()}),this.setTimeframe(this._timeframe.value())):T.logWarn("Updating available resolutions without full symbol info")}mainPlot(){return this._mainPlot}hasStudyPlots(){ return this._studyPlots.length>0}studyPlots(){return this._studyPlots}addStudyPlot(e){return this._studyPlots.push(e),e.status().subscribe(this._onPlotStatusChanged),this.connected()?e.requestData():this.connect(),e.forcePercentageMode()&&this._mainPlot.switchToPercentageScaleMode(),this._updateStatus(),{noData:e.noData(),status:e.status(),remove:()=>{this._removeStudyPlot(e)},symbol:()=>e.symbol(),extendedSymbol:()=>e.extendedSymbol(),options:()=>e.currentSeriesOptions()}}indexToTime(e){var t,i;return null!==(i=null===(t=(this._tickmarks.size?this._tickmarks:this._cachedTickmarks).get(e))||void 0===t?void 0:t.time)&&void 0!==i?i:null}subscribeCrosshairMove(e){this.unsubscribeCrosshairMove(),this._onCrosshairMoveBound=t=>{e(this._onCrosshairMoveHandler(t))},this._widget.subscribeCrosshairMove(this._onCrosshairMoveBound)}unsubscribeCrosshairMove(){this._onCrosshairMoveBound&&this._widget.unsubscribeCrosshairMove(this._onCrosshairMoveBound)}updateChartRightMarginAccordingToTitles(){var e;const t=null===(e=this.mainPlot().currentSeriesOptions().horzMargins)||void 0===e?void 0:e.rightPx;if(t)this.mainPlot().updateHorzMargins({rightPx:t});else{const e=[this.mainPlot(),...this._studyPlots];let t=0;for(const i of e)for(const e of i.titles())t=Math.max(t,e.length);this.mainPlot().updateHorzMargins({rightPx:12*t})}this.mainPlot().fitContent()}activeRange(){return this._activeRange}timeScaleSizeChanged(){return this._timeScaleSizeChanged}_getChartPlotClass(){return v.MiniChartPlot}_createMainPlot(e){var t,i;const s=new(this._getChartPlotClass())(this,this._options.chartOptions.series,this._options.chartOptions.volume,(()=>this._studyPlots),this._options.mainPlotOptions,null===(i=null===(t=this._options.cache)||void 0===t?void 0:t.loadData(this._timeframe.value().value))||void 0===i?void 0:i.mainPlot);return s.setSymbol(e),s.symbolResolved().subscribe(this,this._onSymbolResolved),s.timeFrameInvalidated().subscribe(this,this._onTimeFrameInvalidated),s.status().subscribe(this._onPlotStatusChanged),s}_onCrosshairMoveHandler(e){if(this._atomicUpdateIsGoing)return;const{point:t,time:i,seriesData:s}=e;if(void 0===t||void 0===i)return;const r=this._mainPlot.series();if(void 0===s.get(r))return;let o;const a=[],n=this._mainPlot.currentSeriesOptions();if(o="Area"===r.seriesType()||"Line"===r.seriesType()?n.tooltipType||"line":"ohlc",a.push(...this._mainPlot.getLegendData(e,this._seriesUpDownColors)),this._studyPlots.forEach((t=>{a.push(...t.getLegendData(e))})),0===a.length)return;const l=n.tooltipLegendColorOrder;(null==l?void 0:l.size)&&a.sort(((e,t)=>{var i,s;const r=null!==(i=l.get(e.color))&&void 0!==i?i:-1,o=null!==(s=l.get(t.color))&&void 0!==s?s:-1;return(r>-1?r:1/0)-(o>-1?o:1/0)}));const h=new Date(1e3*i);let c=this._tooltipDateTimeFormatter.format(h);return this._isDWMResolution||(c+=" "+function(e){if(0===e)return"UTC";const t=Math.abs(e),i=Math.floor(t/60),s=t-60*i;return`UTC${Math.sign(e)<=0?"+":"-"}${i}${s>0?`:${s}`:""}`}(h.getTimezoneOffset())),{point:t,time:c,prices:a,type:o}}_removeStudyPlot(e){ const t=this._studyPlots.indexOf(e);(0,o.assert)(-1!==t),this._studyPlots.splice(t,1),e.status().unsubscribe(this._onPlotStatusChanged),e.deleteView(),e.clearData(),e.destroy(),this._studyPlots.every((e=>!e.forcePercentageMode()))&&this._mainPlot.restoreOriginalScaleMode(),this._updateStatus()}_updateSeriesUpDownColors(){var e,t;const i=this._options.chartOptions.series;switch(i.chartType){case"candlesticks":this._seriesUpDownColors.Candlestick={up:null!==(e=i.borderUpColor)&&void 0!==e?e:i.upColor,down:null!==(t=i.borderDownColor)&&void 0!==t?t:i.downColor};break;case"bars":this._seriesUpDownColors.Bar={up:i.upColor,down:i.downColor}}}_updateSeriesOptions(e){this._options.chartOptions.series=function(e){var t;let i;switch(null!==(t=e.chartType)&&void 0!==t?t:"area"){case"bars":i=k;break;case"candlesticks":i=F;break;case"area":i=P;break;case"line":i=M;break;case"histogram":i=R}return(0,r.default)({},i,e)}(e)}_onPlotsDataReady(){"function"==typeof this._options.onFirstData&&(this._options.onFirstData(),this._options.onFirstData=null),this._hideLoading(),this.hideMessage(),this._clearLoadErrorTimeout(),this._options.doNotDisconnectOnDataReady||this.disconnect(),this._createReconnectionTimeout(),this._saveCache()}_saveCache(){const{cache:e}=this._options;if(!e)return;const t=this._prepareCacheData();t&&(e.saveData(this._timeframe.value().value,t),this._cachedTickmarks=t.tickmarks)}_prepareCacheData(){if(!this._tickmarks.size)return null;const e=this._mainPlot.cacheData();return e?{mainPlot:e,tickmarks:new Map(this._tickmarks)}:null}_onMainPlotDataError(){this._hideLoading(),this.showMessage(n.t(null,void 0,i(57335))),this._clearLoadErrorTimeout(),this.disconnect()}_onMainPlotSymbolResolvingError(){this._hideLoading(),this.showMessage(n.t(null,void 0,i(653273))),this._clearLoadErrorTimeout(),this.disconnect()}_createReconnectionTimeout(){if(this._options.doNotDisconnectOnDataReady)return;const e=this._options.updateTimeout;void 0!==e&&e>0&&(this._updateTimerId=setTimeout((()=>{this._updateTimerId=null,this.connected()?this._requestData():this.connect()}),e))}_clearReconnectionTimeout(){null!==this._updateTimerId&&(clearInterval(this._updateTimerId),this._updateTimerId=null)}_clearLoadErrorTimeout(){this._loadErrorTimeout&&(clearTimeout(this._loadErrorTimeout),this._loadErrorTimeout=null)}_initTimeframesRenderer(){var e,t,s;if(!this._options.timeframe.visible)return;{const i=this._timeFrameOptions.length<2;if(null===(e=this._timeframeView)||void 0===e||e.update({hidden:i}),null===(s=null!==(t=this._elTimeframe)&&void 0!==t?t:this._options.timeframe.container)||void 0===s||s.classList.toggle(D.hidden,i),i)return}if(this._elTimeframe)return;this._options.timeframe.container?this._elTimeframe=this._options.timeframe.container:(this._elTimeframe=document.createElement("div"),this._container.appendChild(this._elTimeframe));const r=(e,t)=>{const i=this._timeFrameOptions.length<2,s=(0,o.ensureNotNull)(this._elTimeframe);s.classList.toggle(D.hidden,i),this._timeframeView=new e.TimeFrameViewRenderer(s,{name:"minichart_timeframe", activeRange:this._activeRange,ranges:this._getAvailableTimeFrames(),onSelectRange:e=>{this.setTimeframe({value:e,type:"period-back"})},size:this._options.timeframe.size,hidden:i,theme:t})};Promise.all([i.e(62564),i.e(79874),i.e(82321),i.e(31891)]).then(i.bind(i,957001)).then((e=>{(this._options.timeframe.getTheme||(()=>Promise.resolve(void 0)))().then((t=>r(e,t)))}))}_createLegend(){this._options.legend&&this._options.legend.visible&&Promise.all([i.e(13427),i.e(22748),i.e(24806),i.e(82321),i.e(42980)]).then(i.bind(i,718520)).then((e=>e.createLegend(this._options.legend.container,this._options.legend.items)))}_getAvailableTimeFrames(){const e=[];for(const t of this._timeFrameOptions)this._timeframeIsAvailable(t.value)&&e.push({value:t.value.value,text:t.text,description:t.description});return e}_timeframeIsAvailable(e){const t=this._timeFrameOptions.find((t=>t.value.value===e.value));if(!t)return!1;const i=this.mainPlot().symbolInfo();if(!i||i.pro_name!==this._mainPlot.symbol())return!0;if(i.has_intraday)return!0;return!d.Interval.parse(t.targetResolution).isIntraday()}_onChartSessionIsConnectedChanged(e){var t;e!==this._connected&&(e?(this._connected=!0,"function"==typeof this._connectCallback&&this._connectCallback(),null===(t=this._chartSession)||void 0===t||t.switchTimezone("Etc/UTC"),this._requestData()):(this._connected=!1,this._mainPlot.disconnect(),this._studyPlots.forEach((e=>e.disconnect()))))}_onChartSessionCriticalError(){this._connected=!1}_createTooltipDateFormatter(){const e=d.Interval.parse(this.resolution());let t,i;this._isDWMResolution=e.isDWM(),this._widget.timeScale().applyOptions({timeVisible:!this._isDWMResolution,secondsVisible:e.isSeconds()});const{dateFormat:s="dd MMM 'yy",timeHoursFormat:r="24-hours",suppressTickMarks:o}=this._options.chartOptions;this._isDWMResolution?t=i=new _.DateFormatter(s):(t=new g.DateTimeFormatter({dateFormat:s,timeFormat:(0,p.getTimeFormatForInterval)(e,r)}),i=new g.DateTimeFormatter({dateFormat:s,timeFormat:(0,p.getTimeFormatForInterval)(e,r),dateTimeSeparator:"\n"})),this._tooltipDateTimeFormatter=i,this._widget.applyOptions({localization:{timeFormatter:e=>t.format(new Date(1e3*e))},timeScale:{tickMarkFormatter:N.bind(null,r,o,this._timeframe.value())}}),this._widget.applyOptions({timeScale:{timeVisible:!d.Interval.parse(this._mainPlot.resolution()).isDWM()}})}_requestData(){this._createTooltipDateFormatter(),this._clearReconnectionTimeout(),this._mainPlot.requestData(),this._studyPlots.forEach((e=>e.requestData()))}_onData(e){if(this._mainPlot.isConnected())switch(e.method){case"timescale_update":{const t=e.params;if(t.clear){this._tickmarks.clear(),this._mainPlot.clearSourceData();for(const e of this._studyPlots)e.clearSourceData()}if(t.index_diff.length>0){this._mainPlot.moveSourceData(t.index_diff);for(const e of this._studyPlots)e.moveSourceData(t.index_diff)}const i=t.marks;let s=1/0,r=-1/0;for(const e of i)this._tickmarks.has(e.index)||(s=Math.min(s,e.index),r=Math.max(r,e.index)),this._tickmarks.set(e.index,e) ;Number.isFinite(s)&&this._mainPlot.onTickmarksAdded(s,r),this._saveCache();break}}}_onSymbolResolved(){this.updateAvailableTimeframes(),this._initTimeframesRenderer()}_onTimeFrameInvalidated(){var e;this._activeRange=void 0,null===(e=this._timeframeView)||void 0===e||e.update({activeRange:void 0})}_showLoading(){if(this._isLoading)return;this.hideMessage();const e=this._options.chartOptions.loading;e.spinner.visible&&(null===this._spinner&&(this._spinner=new m.Spinner("mini").setStyle({color:e.spinner.color,width:e.spinner.width.toString(),zIndex:"10"})),this._spinner.spin(this._innerContainer)),e.fade.visible&&this._innerContainer.classList.add(D.fade),this._isLoading=!0}_hideLoading(){this._isLoading&&(this._spinner&&this._spinner.stop(),this._isLoading=!1)}_createFloatingTooltip(){const e=this._options.valuesTracking;if("3"===e||"0"===e)return;if(this._tooltipContainer){const{position:e}=window.getComputedStyle(this._tooltipContainer),t=["relative","fixed","absolute"];t.includes(e)||T.logWarn("Container position property must be: "+t.join(", "))}const t=async()=>{var e;const t=await Promise.all([i.e(18077),i.e(82321),i.e(10748)]).then(i.bind(i,667704));this._isDestroyed||(this._floatingTooltip=new t.FloatingPriceTimeTooltipRenderer(null!==(e=this._tooltipContainer)&&void 0!==e?e:void 0,this._innerContainer,D.floatingTooltip))};let s;this.subscribeCrosshairMove((i=>{var r;let o;if(i){const{point:t,...s}=i;o={...s,cursorPosition:{x:this._widget.priceScale("left").width()+t.x,y:t.y},lineColor:"2"===e?null===(r=s.prices[0])||void 0===r?void 0:r.color:void 0}}null===this._floatingTooltip?(s=s||t(),s.then((()=>{var e;return null===(e=this._floatingTooltip)||void 0===e?void 0:e.update(o)}))):this._floatingTooltip.update(o)}))}_destroyFloatingTooltip(){this._floatingTooltip&&(this._floatingTooltip.destroy(),this.unsubscribeCrosshairMove(),this._floatingTooltip=null)}_requestDataOnTimeframeChange(){this._options.chartOptions.loading.clearDataOnTimeframeChange&&(this.mainPlot().clearData(),this.mainPlot().deleteView(),this._studyPlots.forEach((e=>e.clearData())),this._studyPlots.forEach((e=>e.deleteView()))),this.connected()?this._requestData():this.connect()}_updateStatus(){const e=[this._mainPlot.status().value(),...this._studyPlots.map((e=>e.status().value()))],t=e.every((e=>0!==e))?3===e[0]?"ready":"error":"loading";this._status.setValue(t)}_timeScaleSizeChangedHandler(e,t){this._timeScaleSizeChanged.fire(e,t)}}},607436:(e,t,i)=>{"use strict";i.d(t,{DEFAULT_SIZE:()=>s.DEFAULT_SIZE,spinnerSizeMap:()=>s.spinnerSizeMap});var s=i(685023)},192784:(e,t,i)=>{"use strict";i.r(t),i.d(t,{flushDelegate:()=>s});const s=new(i(942634).Delegate)},62802:(e,t,i)=>{"use strict";e=i.nmd(e),i(638456);var s=i(702598).fetch,r=i(873428).regExpEscape,o=i(226722).TVXWindowEvents,a=i(49437).TVLocalStorage,n=i(942634).Delegate,l=i(764829),h=i(125226).isFeatureEnabled,{flushDelegate:c}=i(192784),d=i(338619).getLogger("Lib.TVSettings"),u=["s.tradingview.com","betacdn.tradingview.com"],m=(l.enabled("use_localstorage_for_settings"), window.TVSettings=function(){var e=!1,t=null,i=!1;function _(){return!(t||window.is_authenticated)}try{e=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(e){}if(e){var g={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},p=function(e,t,i){var s=g[e];return null==s?t:s},v=function(){};return{loaded:!1,loadedModel:!1,getValue:p,getJSON:p,getBool:p,getFloat:p,getInt:p,setValue:v,setJSON:v,remove:v,keys:function(){return Object.keys(g)},keysMask:function(){return[]},sync:v,onSync:{subscribe:function(){}}}}var f=12e4;"local"===window.environment&&(f=5e3);var y,b,S,C=TradingView.onWidget()?"tradingview-widget":"tradingview",w=C+".",D={},T=[],I=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^chart\.favoriteLibraryIndicators$/,/^loadChartDialog.favorites$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/,/^trading\.orderWidgetMode\./,/^symbolWatermark$/,/^pinereference\.size$/,/^pinereference\.position$/,/^hint\.+/,/^ChartDrawingToolbarWidget\.visible/];function x(e){return w+e}function P(e){return e.substring(w.length)}function M(e,t){var i=D[e];return null==i?t:i}function k(e,t,i){i=i||{};var s=""+t;return D[e]!==s&&(D[e]=s,L(e)),i.forceFlush&&!b&&(b=setTimeout((function(){b=void 0,O()}),10)),m}function F(e,t){return t=t||{},null!=D[e]&&(delete D[e],L(e)),t.forceFlush&&O(),m}function R(){y=void 0,T.length&&O()}function L(e){if(t)null==D[e]?t.removeValue(e):t.setValue(e,D[e]);else if(_())try{null==D[e]?a.removeItem(x(e)):a.setItem(x(e),D[e])}catch(e){}else T.push(e),y||(y=setTimeout(R,f));o.emit("settings",JSON.stringify({key:e,value:D[e]}))}function O(e){if(!i&&!S)if(h("disable_save_settings"))d.logWarn("Settings flashing has been skipped because of disable_save_settings featuretoggle");else if(!l.enabled("widget")&&!_()&&0!==T.length){var t=T;T=[];for(var r={},o=t.length;o--;){var a=t[o],n=D[a];void 0===n&&(n=null),r[a]=n}var c=new FormData;c.append("delta",JSON.stringify(r)),e&&navigator.sendBeacon?navigator.sendBeacon("/savesettings/",c):s("/savesettings/",{method:"POST",credentials:"include",body:c}).then((function(i){if(i.ok||(T=T.concat(t)),[429,503].includes(i.status)){var s=1e3*+i.headers.get("retry-after")||3e5;S=setTimeout((()=>{S=void 0,O(e)}),s)}})).catch((function(){T=T.concat(t)}))}}function V(){return Object.keys(D)}function E(e){for(var t=0;t{O()})),{loaded:!1,loadedModel:!1,getValue:M,getJSON:function(e,t){var i=M(e,void 0);if(null==i)return t;try{return JSON.parse(i)}catch(i){return F(e),t}},getBool:function(e,t){var i=M(e);return null==i?t:!(!i||"false"===i||0==+i)},getFloat:function(e,t,i){var s=M(e,void 0);if(null==s)return t;var r=parseFloat(s);if(!isFinite(r))throw new TypeError('"'+s+'" is not float (key: "'+e+'")');return r},getInt:function(e,t,i){var s=M(e,void 0);if(null==s)return t;var r=parseInt(s,10);if(!isFinite(r))throw new TypeError('"'+s+'" is not int (key: "'+e+'")');return r},setValue:k,setJSON:function(e,t,i){return k(e,JSON.stringify(t),i),m},remove:F,keys:V,keysMask:function(e,t){for(var i=V(),s=[],o=(e=new RegExp("^"+r(e).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),i.length-1);o>=0;o--)e.test(i[o])&&s.push(i[o]),e.lastIndex=0;return s},sync:function(e){null!==e?(t?B(t.initialSettings||{}):_()?(function(){if(TradingView.onWidget()&&u.includes(window.location.host))for(var e="tradingview.",t=a.length;t--;){var i=a.key(t);if(0===i.indexOf(e)){var s=i.replace(e,C+".");a.setItem(s,a.getItem(i)),a.removeItem(i)}}}(),function(){D={};for(var e=!l.enabled("save_chart_properties_to_local_storage"),t=a.length;t--;){var i=a.key(t);if(i&&A(i)){var s=i.substring(w.length);e&&!E(s)||(D[s]=a.getItem(i))}}}()):B(e||{}),N.fire()):i=!0},onSync:N,setSettingsAdapter:function(e){t=e}}}());setTimeout((function(){i.e(30362).then(i.bind(i,276141)).then((e=>{e.clearOldSettings()}))}),3e4),e&&e.exports&&(e.exports=m)},17966:(e,t,i)=>{"use strict";i.d(t,{getCircleLogoAnyHtml:()=>s.getCircleLogoAnyHtml});var s=i(467236)},242238:(e,t,i)=>{"use strict";i.d(t,{ChartSession:()=>o});var s=i(942634),r=i(607016);class o extends r.Session{constructor(e,t=!1){super(e,"cs",!1),this._sessionDisabled=!1,this._handler=null,this._criticalError=new s.Delegate,this._symbolResolveMap=new Map,this._lastSymbolResolveInfoMap=new Map,this._disableStatistics=t}destroy(){this._criticalError.destroy(),this._handler=null,this._symbolResolveMap.clear(),super.destroy()}switchTimezone(e){return this._getChartApi().switchTimezone(this.sessionId(),e)}defaultResolutions(){return this._getChartApi().defaultResolutions()}availableCurrencies(){return this._getChartApi().availableCurrencies()}availableUnits(){return this._getChartApi().availableUnits()}availablePriceSources(e){return this._getChartApi().availablePriceSources(e)}resolveSymbol(e,t,i){if(this._symbolResolveMap.has(t)){const[e,s]=this._symbolResolveMap.get(t);return Array.isArray(s)?s.push(i):s.then(i),e}{const s=[i];return this._getChartApi().resolveSymbol(this.sessionId(),e,t,(i=>{if("symbol_error"===i.method)this._symbolResolveMap.delete(t);else{this._symbolResolveMap.set(t,[e,Promise.resolve(i)]);const[,s]=i.params,r={pro_name:s.pro_name, ticker:s.ticker};this._lastSymbolResolveInfoMap.set(t,r),r.pro_name&&this._lastSymbolResolveInfoMap.set(r.pro_name,r),s.full_name&&this._lastSymbolResolveInfoMap.set(s.full_name,r),r.ticker&&this._lastSymbolResolveInfoMap.set(r.ticker,r)}s.forEach((e=>e(i)))})),this._symbolResolveMap.set(t,[e,s]),e}}requestFirstBarTime(e,t,i){return this._getChartApi().requestFirstBarTime(this.sessionId(),e,t,i)}lastSymbolResolveInfo(e){var t;return null!==(t=this._lastSymbolResolveInfoMap.get(e))&&void 0!==t?t:null}createSeries(e,t,i,s,r,o,a){return this._getChartApi().createSeries(this.sessionId(),e,t,i,s,r,o,a)}modifySeries(e,t,i,s,r,o,a){return this._getChartApi().modifySeries(this.sessionId(),e,t,i,s,r,o,a)}removeSeries(e){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),e)}requestMoreData(e,t,i){return"number"==typeof e?this._getChartApi().requestMoreData(this.sessionId(),e):this._getChartApi().requestMoreData(this.sessionId(),e,t,i)}requestMoreTickmarks(e,t,i){return this._getChartApi().requestMoreTickmarks(this.sessionId(),e,t,i)}setFutureTickmarksMode(e){return this._getChartApi().setFutureTickmarksMode(this.sessionId(),e)}canCreateStudy(e,t){return this._getChartApi().canCreateStudy(this.sessionId(),e,t)}getStudyCounter(){return this._getChartApi().getStudyCounter(this.sessionId())}getFundamentalCounter(){return this._getChartApi().getFundamentalCounter(this.sessionId())}createStudy(e,t,i,s,r,o,a){return this._getChartApi().createStudy(this.sessionId(),e,t,i,s,r,o,a)}modifyStudy(e,t,i,s,r){return this._getChartApi().modifyStudy(this.sessionId(),e,t,i,s,r)}notifyStudy(e,t,i){return this._getChartApi().notifyStudy(this.sessionId(),e,t,i)}removeStudy(e){return this._getChartApi().removeStudy(this.sessionId(),e)}createPointset(e,t,i,s,r,o){return this._getChartApi().createPointset(this.sessionId(),e,t,i,s,r,o)}modifyPointset(e,t,i,s){return this._getChartApi().modifyPointset(this.sessionId(),e,t,i,s)}removePointset(e){return this._getChartApi().removePointset(this.sessionId(),e)}setVisibleTimeRange(e,t,i,s,r,o){0}criticalError(){return this._criticalError}connect(e=null){null!==e&&(this._handler=e),this._symbolResolveMap.clear(),super.connect()}setHandler(e){this._handler=e}connected(){return this.isConnected().value()&&!this._sessionDisabled}disable(){this._sessionDisabled=!0}chartApi(){return this._getChartApi()}_sendCreateSession(){Object.keys(this).forEach((e=>{/^(s|st|symbol_)\d+$/.test(e)&&delete this[e]})),this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)}_sendRemoveSession(){this._getChartApi().chartDeleteSession(this.sessionId())}_onMessage(e){this._handler&&this._handler(e)}_onCriticalError(e,t){this._criticalError.fire(e,t),super._onCriticalError(e,t)}}},264552:(e,t,i)=>{"use strict";i.d(t,{getServerInterval:()=>r});var s=i(378975);function r(e){return s.Interval.isRange(e)?"1":e}},942634:(e,t,i)=>{"use strict";i.d(t,{Delegate:()=>o});const s=(0,i(692558).getLogger)("Common.Delegate");function r(e){return!e.singleShot}class o{constructor(){ this.fire=this._fireImpl.bind(this),this._listeners=[]}subscribe(e,t,i){this._listeners.push({object:e,member:t,singleShot:!!i,skip:!1})}unsubscribe(e,t){for(let i=0;i=0;--t){const i=this._listeners[t];i.object===e&&(i.skip=!0,this._listeners.splice(t,1))}}destroy(){this._listeners=[]}_fireImpl(...e){const t=this._listeners;this._listeners=this._listeners.filter(r);const i=t.length;for(let r=0;r{"use strict";i.d(t,{WatchedObject:()=>a});var s=i(375397),r=i(124829);function o(e,t){return(0,r.deepEquals)(e,t)[0]}class a extends s.WatchedValue{constructor(e,t=o){super(e),this._comparator=t}setValue(e,t){(t||!1===this._comparator(this.value(),e))&&super.setValue(e,t)}}},553220:(e,t,i)=>{"use strict";i.d(t,{DateFormatter:()=>o});var s=i(339709),r=i(246125);class o{constructor(e="yyyy-MM-dd",t=!1){this._dateFormatFunc=t?(0,r.getDateFormatWithWeekday)(e):r.dateFormatFunctions[e]}format(e){return s.customFormatters&&s.customFormatters.dateFormatter?s.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!1)}formatLocal(e){return s.customFormatters.dateFormatter?s.customFormatters.dateFormatter.formatLocal?s.customFormatters.dateFormatter.formatLocal(e):s.customFormatters.dateFormatter.format(e):this._dateFormatFunc(e,!0)}parse(e){if(""===e)return{res:!1};let t=e;return s.customFormatters&&s.customFormatters.dateFormatter&&!s.customFormatters.dateFormatter.parse&&console.warn("You need to provide a `parse` function as part of `dateFormatter`"),s.customFormatters&&s.customFormatters.dateFormatter&&s.customFormatters.dateFormatter.parse&&(t=String(s.customFormatters.dateFormatter.parse(e))),{res:!0,value:t}}}},319448:(e,t,i)=>{"use strict";i.d(t,{DateTimeFormatter:()=>a});var s=i(300484),r=i(553220);const o={dateFormat:"yyyy-MM-dd",withWeekday:!1,timeFormat:s.hourMinuteSecondFormat,dateTimeSeparator:" "};class a{constructor(e={}){const t=Object.assign({},o,e);this._dateFormatter=new r.DateFormatter(t.dateFormat,t.withWeekday),this._timeFormatter=new s.TimeFormatter(t.timeFormat),this._separator=t.dateTimeSeparator}format(e){return`${this._dateFormatter.format(e)}${this._separator}${this._timeFormatter.format(e)}`}formatLocal(e){return`${this._dateFormatter.formatLocal(e)}${this._separator}${this._timeFormatter.formatLocal(e)}`}}},411559:(e,t,i)=>{"use strict";i.d(t,{hourMinuteFormat:()=>a,hourMinuteNonZeroSecondFormat:()=>r,hourMinuteSecondFormat:()=>s,hourMinuteSecondMillisecFormat:()=>o,twelveHourMinuteFormat:()=>h,twelveHourMinuteNonZeroSecondFormat:()=>l,twelveHourMinuteSecondFormat:()=>n});const s="%h:%m:%s",r="%h:%m:%s+",o="%h:%m:%s.%ss+",a="%h:%m",n="%h:%m:%s %ampm",l="%h:%m:%s+ %ampm",h="%h:%m %ampm"},300484:(e,t,i)=>{"use strict";i.d(t,{TimeFormatter:()=>a, hourMinuteFormat:()=>o.hourMinuteFormat,hourMinuteNonZeroSecondFormat:()=>o.hourMinuteNonZeroSecondFormat,hourMinuteSecondFormat:()=>o.hourMinuteSecondFormat,hourMinuteSecondMillisecFormat:()=>o.hourMinuteSecondMillisecFormat,twelveHourMinuteFormat:()=>o.twelveHourMinuteFormat,twelveHourMinuteNonZeroSecondFormat:()=>o.twelveHourMinuteNonZeroSecondFormat,twelveHourMinuteSecondFormat:()=>o.twelveHourMinuteSecondFormat});var s=i(339709),r=i(574313),o=i(411559);class a{constructor(e){this._isTwelveHoursFormat=!1,this._valuesAndDelimeters=[];const t=e||o.hourMinuteSecondFormat,i=new RegExp("%h|%m|%s\\+|%ss\\+|%ss|%ampm|%s","g");let s=i.exec(t),r=0;for(;null!==s;){const e=s[0];"%ampm"===e&&(this._isTwelveHoursFormat=!0);const o=t.substring(r,s.index);""!==o&&this._valuesAndDelimeters.push(o),this._valuesAndDelimeters.push(e),r=s.index+e.length,s=i.exec(t)}}format(e){return s.customFormatters.timeFormatter?s.customFormatters.timeFormatter.format(e):this._formatTime(e,!1)}formatLocal(e){return s.customFormatters.timeFormatter?s.customFormatters.timeFormatter.formatLocal?s.customFormatters.timeFormatter.formatLocal(e):s.customFormatters.timeFormatter.format(e):this._formatTime(e,!0)}_formatTime(e,t){let i=t?e.getHours():e.getUTCHours();const s=t?e.getMinutes():e.getUTCMinutes(),o=t?e.getSeconds():e.getUTCSeconds(),a=t?e.getMilliseconds():e.getUTCMilliseconds();let n="";this._isTwelveHoursFormat&&(n=i>=12?"PM":"AM",i%=12,i=i||12);let l="",h=!1;for(let e=this._valuesAndDelimeters.length-1;e>=0;e--){const t=this._valuesAndDelimeters[e];let c;switch(t){case"%h":c=(0,r.numberToStringWithLeadingZero)(i,2);break;case"%m":c=(0,r.numberToStringWithLeadingZero)(s,2);break;case"%s+":0!==o?c=(0,r.numberToStringWithLeadingZero)(o,2):(c="",h=!0);break;case"%s":c=(0,r.numberToStringWithLeadingZero)(o,2);break;case"%ss":c=(0,r.numberToStringWithLeadingZero)(a,3);break;case"%ss+":0!==a?c=(0,r.numberToStringWithLeadingZero)(a,3):(c="",h=!0);break;case"%ampm":c=n;break;default:if(h){h=!1;continue}c=t}l=c+l}return l}}},124066:(e,t,i)=>{"use strict";var s;i.d(t,{SymbolErrorPermissionDeniedReason:()=>s,invalidSymbol:()=>o,permissionDenied:()=>r}),function(e){e.Symbol="symbol",e.GroupPermission="group"}(s||(s={}));const r="permission denied",o="invalid symbol"},320771:(e,t,i)=>{"use strict";i.d(t,{SeriesDataEvents:()=>r});var s=i(942634);class r{constructor(){this._created=new s.Delegate,this._modified=new s.Delegate,this._loading=new s.Delegate,this._completed=new s.Delegate,this._error=new s.Delegate,this._symbolError=new s.Delegate,this._symbolResolved=new s.Delegate,this._seriesError=new s.Delegate,this._symbolNotPermitted=new s.Delegate,this._symbolInvalid=new s.Delegate,this._symbolGroupNotPermitted=new s.Delegate,this._chartTypeNotPermitted=new s.Delegate,this._intradaySpreadNotPermitted=new s.Delegate,this._intradayExchangeNotPermitted=new s.Delegate,this._customIntervalNotPermitted=new s.Delegate,this._secondsIntervalNotPermitted=new s.Delegate,this._ticksIntervalNotPermitted=new s.Delegate,this._barReceived=new s.Delegate, this._seriesTimeFrame=new s.Delegate,this._dataUpdated=new s.Delegate,this._unsupportedResolutionRequested=new s.Delegate}destroy(){this._created.destroy(),this._modified.destroy(),this._loading.destroy(),this._completed.destroy(),this._error.destroy(),this._symbolError.destroy(),this._symbolResolved.destroy(),this._seriesError.destroy(),this._symbolInvalid.destroy(),this._symbolNotPermitted.destroy(),this._symbolGroupNotPermitted.destroy(),this._chartTypeNotPermitted.destroy(),this._intradaySpreadNotPermitted.destroy(),this._intradayExchangeNotPermitted.destroy(),this._customIntervalNotPermitted.destroy(),this._secondsIntervalNotPermitted.destroy(),this._ticksIntervalNotPermitted.destroy(),this._barReceived.destroy(),this._seriesTimeFrame.destroy(),this._dataUpdated.destroy(),this._unsupportedResolutionRequested.destroy()}created(){return this._created}modified(){return this._modified}loading(){return this._loading}completed(){return this._completed}error(){return this._error}symbolError(){return this._symbolError}symbolResolved(){return this._symbolResolved}seriesError(){return this._seriesError}symbolInvalid(){return this._symbolInvalid}symbolNotPermitted(){return this._symbolNotPermitted}symbolGroupNotPermitted(){return this._symbolGroupNotPermitted}chartTypeNotPermitted(){return this._chartTypeNotPermitted}intradaySpreadNotPermitted(){return this._intradaySpreadNotPermitted}intradayExchangeNotPermitted(){return this._intradayExchangeNotPermitted}customIntervalNotPermitted(){return this._customIntervalNotPermitted}secondsIntervalNotPermitted(){return this._secondsIntervalNotPermitted}ticksIntervalNotPermitted(){return this._ticksIntervalNotPermitted}barReceived(){return this._barReceived}seriesTimeFrame(){return this._seriesTimeFrame}dataUpdated(){return this._dataUpdated}unsupportedResolutionRequested(){return this._unsupportedResolutionRequested}fireCompleted(e){this._completed.fire(e)}fireCreated(e){this._created.fire(e)}fireModified(){this._modified.fire()}fireLoading(e){this._loading.fire(e)}fireError(){this._error.fire()}fireSymbolError(e){this._symbolError.fire(e),this.fireError()}fireSymbolResolved(e){this._symbolResolved.fire(e)}fireSeriesError(e){this._seriesError.fire(e),this.fireError()}fireSymbolInvalid(){this._symbolInvalid.fire()}fireSymbolNotPermitted(e){this._symbolNotPermitted.fire(e)}fireSymbolGroupNotPermitted(e){this._symbolGroupNotPermitted.fire(e)}fireChartTypeNotPermitted(e){this._chartTypeNotPermitted.fire(e),this.fireError()}fireIntradaySpreadNotPermitted(){this._intradaySpreadNotPermitted.fire(),this.fireError()}fireIntradayExchangeNotPermitted(){this._intradayExchangeNotPermitted.fire(),this.fireError()}fireCustomIntervalNotPermitted(e){this._customIntervalNotPermitted.fire(e),this.fireError()}fireSecondsIntervalNotPermitted(){this._secondsIntervalNotPermitted.fire(),this.fireError()}fireTicksIntervalNotPermitted(){this._ticksIntervalNotPermitted.fire(),this.fireError()}fireBarReceived(e){this._barReceived.fire(e)}fireSeriesTimeFrame(e,t,i,s,r){this._seriesTimeFrame.fire(e,t,i,s,r)} fireDataUpdated(e,t,i,s){this._dataUpdated.fire(e,t,i,s)}fireUnsupportedResolutionRequested(){this._unsupportedResolutionRequested.fire()}}},607016:(e,t,i)=>{"use strict";i.d(t,{Session:()=>l});var s=i(650151),r=i(375397),o=i(942634),a=i(79342);const n=(0,i(338619).getLogger)("ChartApi.AbstractSession");class l{constructor(e,t,i){this._isConnected=new r.WatchedValue(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId="",this._sessionIdChanged=new o.Delegate,this._chartApi=e,this._sessionPrefix=t,this._shouldReconnectAfterCriticalError=i}destroy(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")}isConnected(){return this._isConnected}sessionId(){return this._sessionId}onSessionIdChanged(){return this._sessionIdChanged}connect(){0===this._state&&((0,s.assert)(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(`${this._sessionPrefix}_${(0,a.randomHash)()}`),this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))}disconnect(){0!==this._state&&((0,s.assert)(""!==this._sessionId,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile((()=>{this._chartApi.connected()&&this._sendRemoveSession(),this._processDestroyingOnServer()})))}onMessage(e){switch(e.method){case"connected":return void this._onChartApiConnected();case"disconnected":return void this._onChartApiDisconnected();case"critical_error":const t=String(e.params[0]),i=String(e.params[1]);return void this._onCriticalError(t,i)}this._onMessage(e)}serverTime(){return this._chartApi.serverTime()}_getChartApi(){return this._chartApi}_generateLogMessage(e){return`[${this._sessionId}] ${e}`}_onCriticalError(e,t){this._logError(`Critical error. Reason=${e}, info=${t}.`),this._forbidConnectWhile((()=>{this._processDestroyingOnServer()})),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")}_onChartApiConnected(){(0,s.assert)(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)}_onChartApiDisconnected(){this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile((()=>{this._processDestroyingOnServer()})),this.connect()}_setSessionId(e){const t=this._sessionId;this._logNormal(`Changing sessionId: old=${t}, new=${e}`),this._sessionId=e,this._sessionIdChanged.fire(e,t)}_logNormal(e){n.logNormal(this._generateLogMessage(e))}_logError(e){n.logError(this._generateLogMessage(e))}_processDestroyingOnServer(){this._state=0,this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId("")}_forbidConnectWhile(e){this._isConnectForbidden=!0, e(),this._isConnectForbidden=!1}}},61625:(e,t,i)=>{"use strict";function s(e,t,i){return e===t||e===i}i.d(t,{symbolSameAsResolved:()=>s})},501571:(e,t,i)=>{"use strict";i.d(t,{INVALID_TIME_POINT_INDEX:()=>s,UNPLOTTABLE_TIME_POINT_INDEX:()=>r});const s=-2e6,r=-1e6},120984:(e,t,i)=>{"use strict";i.d(t,{AsyncResourceWrapper:()=>s});class s{constructor(e,t){this._destroyed=!1,this._callbacks=[],this._resource={pendingResource:e},e.then((e=>{var t;if(this._destroyed)null===(t=this._destroyFn)||void 0===t||t.call(this,e);else{for(const t of this._callbacks)t(e);this._resource.resource=e}})).finally((()=>{this._callbacks=[]}))}destroy(){var e;this._resource.resource&&(null===(e=this._destroyFn)||void 0===e||e.call(this,this._resource.resource)),this._resource={pendingResource:Promise.reject("Resource is destroyed").catch((()=>{}))},this._callbacks=[],this._destroyed=!0}callFunction(e){this._destroyed||(this._resource.resource?e(this._resource.resource):this._callbacks.push(e))}get(){return this._destroyed||!this._resource.resource?null:this._resource.resource}promise(){return this._resource.pendingResource}}},873428:(e,t,i)=>{"use strict";function s(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}i.d(t,{regExpEscape:()=>s})},467332:(e,t,i)=>{"use strict";i.d(t,{getTimeFrames:()=>o});var s=i(444372),r=i(855016);function o(){return{"1d":{text:s.t(null,void 0,i(207075)),value:{value:"1D",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1"),description:(0,r.daysStringLiteral)(1)},"5d":{text:s.t(null,void 0,i(558628)),value:{value:"5D",type:"period-back"},targetResolution:(0,r.stringAsResolution)("5"),description:(0,r.daysStringLiteral)(5)},"1w":{text:s.t(null,void 0,i(189696)),value:{value:"7D",type:"period-back"},targetResolution:(0,r.stringAsResolution)("15"),description:(0,r.weeksStringLiteral)(1)},"1m":{text:s.t(null,void 0,i(333493)),value:{value:"1M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("30"),description:(0,r.monthsStringLiteral)(1)},"3m":{text:s.t(null,void 0,i(318717)),value:{value:"3M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("60"),description:(0,r.monthsStringLiteral)(3)},"6m":{text:s.t(null,void 0,i(869411)),value:{value:"6M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("120"),description:(0,r.monthsStringLiteral)(6)},"12m":{text:s.t(null,void 0,i(186322)),value:{value:"12M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1D"),description:(0,r.yearsStringLiteral)(1)},"24m":{text:s.t(null,void 0,i(745391)),value:{value:"24M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1W"),description:(0,r.yearsStringLiteral)(2)},"36m":{text:s.t(null,void 0,i(189992)),value:{value:"36M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1W"),description:(0,r.yearsStringLiteral)(3)},"60m":{text:s.t(null,void 0,i(772834)),value:{value:"60M",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1W"),description:(0,r.yearsStringLiteral)(5)},"120m":{text:s.t(null,void 0,i(27969)),value:{value:"120M", type:"period-back"},targetResolution:(0,r.stringAsResolution)("1M"),description:(0,r.yearsStringLiteral)(10)},ytd:{text:s.t(null,void 0,i(168881)),value:{value:"YTD",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1D"),description:s.t(null,void 0,i(251478))},all:{text:s.t(null,void 0,i(580066)),value:{value:"ALL",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1M")},lastsession:{text:s.t(null,void 0,i(207075)),value:{value:"LASTSESSION",type:"period-back"},targetResolution:(0,r.stringAsResolution)("1"),description:(0,r.daysStringLiteral)(1)}}}},471771:(e,t,i)=>{"use strict";i.d(t,{getActualTimeFrame:()=>r});var s=i(467332);function r(e){const t=new Set(Object.values((0,s.getTimeFrames)()).map((e=>e.value.value)));if(t.has(e))return e;const i=e.toUpperCase();return t.has(i)?i:"12M"}},135732:(e,t,i)=>{"use strict";i.d(t,{trackWidgetLoadMetaInfo:()=>r});var s=i(439563);async function r(e){var t;Math.random()>.005||null===(t=await(0,s.getEmbedWidgetTracker)())||void 0===t||t.trackWidgetLoadMetaInfo(e)}}}]);