diff --git a/changelog.md b/changelog.md index 5f2bf021..c1c08758 100644 --- a/changelog.md +++ b/changelog.md @@ -5,6 +5,14 @@ +## Version 27.006 + +*Date: Tue May 21 2024* + +**Bug Fixes** + +- **Resolve quotes with ticker instead of symbol name.** The library will now request quote data using the [`ticker`](https://www.tradingview.com/charting-library-docs/latest/api/interfaces/Charting_Library.LibrarySymbolInfo#ticker) property. If `ticker` is not provided in the `LibrarySymbolInfo` object, the `name` property will be used instead. This should resolve an issue some customers were experiencing where quote data was not being properly displayed in the [Watchlist](https://www.tradingview.com/charting-library-docs/latest/trading_terminal/Watch-List) and [Legend](https://www.tradingview.com/charting-library-docs/latest/ui_elements/Legend). + ## Version 27.005 *Date: Tue May 07 2024* diff --git a/charting_library/bundles/library.53d7b371803f8096a4cd.js b/charting_library/bundles/library.ed30e653462ab0610aff.js similarity index 99% rename from charting_library/bundles/library.53d7b371803f8096a4cd.js rename to charting_library/bundles/library.ed30e653462ab0610aff.js index 15715f2c..be0fef11 100644 --- a/charting_library/bundles/library.53d7b371803f8096a4cd.js +++ b/charting_library/bundles/library.ed30e653462ab0610aff.js @@ -140,12 +140,12 @@ this._timeScales[e].setCompleted(!1);var m=this._computeStudyCounter++;function ;if(!h)throw Error("This should never happen");if(h.symbolInfo=l,h.firstLoadedTimeMs=c.firstLoadedTimeMs,h.completed=!0,m._updateMainTsBuilder(e),a&&m._pointsetsManagers[e].invalidatePointsetsForSymbol(l.full_name,r),0!==n.length){var d=m._symbolIdToSymbolRequestString.get(V(e,s)),u=m._barsCoefficients(d,r);u.expectedBarsCount&&u.barsCount&&(u.barsCoefficient=Math.min(Math.max(u.barsCoefficient||1,parseInt(u.expectedBarsCount/(n.length-u.barsCount)+.5)),100)),u.barsCount=n.length,m._clearSeriesData(e,t)}else!c.endOfData&&h.isMain&&setTimeout((function(){m._studiesCache[e]&&m._recreateSourcesForDataRange(e,{countBack:10})}),0);g(l),c.endOfData&&(m._logMessage("Series has no more data on server: {0}".format(l.full_name)),m._setEndOfData(e,t,i)),0===n.length&&m._clearSeriesData(e,t),TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(t,i,l.data_status),m._updateTimeScaleState(e)},onRealtimeCallback:function(s,n,o,a,l){g(l,s),m._timeScales[e].fillIndexesInRows(s);var c=s[s.length-1];if(n){if(!m._studiesCache[e][t])throw Error("This should never happen");m._logMessage("New bar arrived: symbol {0}, resolution {1}, bar {2}".format(l.full_name,r,JSON.stringify(c)))}else m._logMessage("Last bar update: symbol {0}, resolution {1}, bar {2}".format(l.full_name,r,JSON.stringify(c))),TradingView.ChartapiMessagerInstances[e].onDataUpdate(t,i,s,null);m._fireEvent("realtime_tick",s[s.length-1],!0)},onSymbolErrorCallback:function(e){m._logMessage("Series symbol resolve error: "+e),f(e||"resolve error")},onErrorCallback:function(e){m._logMessage("Series error: "+e),f(e)},onNonSeriesDataUpdate:function(s,r){if("projection"!==s.type)throw new Error("unexpected non-series data type for series "+s.type);var n=m._getSeriesData(e,t);if(null!==n)g(r,0===n.length?void 0:[n[n.length-1]],s);else{s=m._prepareSeriesNonSeriesData(e,t,s);TradingView.ChartapiMessagerInstances[e].onDataUpdate(t,i,[],s)}}})}function g(s,n,o){var a=[];if(void 0!==o){var l=(o.data||[]).reduce((function(e,t){return Math.max(e,t[0]||0)}),-1);if(null!=o.projectionTime)for(var c=0;c<=l;++c)a.push(o.projectionTime+c)}var h=null,d=null,u=s?m._getSymbolExtrapolator(e,s,r):null;if(void 0!==n){var p=n.map((function(e){return e.timeMs})).concat(a);null!==u&&u.replaceBarsTimesTail(p,n.length),d=m._timeScales[e].replaceBarsTimesTail(t,p),h=n}else{var _=m._getSeriesData(e,t)||[],g=_.map((function(e){return e.timeMs})).concat(a);null!==u&&u.setBarsTimes(g,_.length),d=m._timeScales[e].setSeriesBarsTimes(t,g),h=_}if(m._applyTimeScaleUpdate(e,d),0!==h.length||void 0!==o){m._timeScales[e].fillIndexesInRows(h);var f=void 0!==o?m._prepareSeriesNonSeriesData(e,t,o):null;TradingView.ChartapiMessagerInstances[e].onDataUpdate(t,i,h,f)}}function f(s){var r=m._studiesCache[e][t];r.completed=!0,TradingView.ChartapiMessagerInstances[e].onSeriesError(t,i,s),P.enabled("clear_bars_on_series_error")&&(r.isMain?m.onSessionSeriesError(e):m._clearSeriesData(e,t))}},N.prototype._clearSeriesData=function(e,t){var i={};for(var s in i[t]={turnaround:this._studiesCache[e][t].turnaround}, this._studiesCache[e]){var r=this._studiesCache[e][s];"study"===r.type&&this._studyCanExtendTimeScale(e,s)||("study"!==r.type||r.parentId!==t||this._studyCanExtendTimeScale(e,s)||(i[s]={turnaround:r.turnaround}))}TradingView.ChartapiMessagerInstances[e].onClearData(i)},N.prototype.requestMoreTickmarks=function(e,t){var i=this._timeScales[e];i.setMinFutureBarsCount(i.minFutureBarsCount()+t);var s=i.firstFutureBarIndex(),r=i.tickMarks(s);TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(s,r)},N.prototype.chartCreateSession=function(e){this._pointsetsManagers[e]=new c,this._timeScales[e]=new l,this._studiesNonSeriesTimes[e]={}},N.prototype.chartDeleteSession=function(e){this._pointsetsManagers[e].destroy(),delete this._pointsetsManagers[e],this._timeScales[e].destroy(),delete this._timeScales[e],delete this._studiesNonSeriesTimes[e]},N.prototype.removePointset=function(e,t){this._pointsetsManagers[e].removePointset(t)},N.prototype.createPointset=async function(e,t,i,s,r){var n,o=this._resolvePromisesBySymbolId.get(V(e,i));try{n=(await o).symbolInfo}catch(e){return}var a=this._getSymbolExtrapolator(e,n,s);if(this._pointsetsManagers[e].createPointset(t,n.full_name,s,r,a),null===this._refreshPointsetsTimerId){var l=this;this._refreshPointsetsTimerId=setTimeout((function(){l._refreshPointsetsTimerId=null,l._refreshPointsets(l._invalidatedPointsetSessions),l._invalidatedPointsetSessions.clear()}),0)}this._invalidatedPointsetSessions.add(e)},N.prototype._refreshPointsets=function(e){var t=this;e.forEach((function(e){var i=t._studiesCache[e];if(null!=i){var s=null;for(var r in i){var n=i[r];if("series"===n.type){s=n;break}}if(null!==s&&null!=s.symbolInfo){var o=t._getSymbolExtrapolator(e,s.symbolInfo,s.resolution);t._pointsetsManagers[e].getUpdatesForSymbol(s.symbolInfo.full_name,s.resolution,o,t._timeScales[e]).forEach((function(t,i){TradingView.ChartapiMessagerInstances[e].onPointsetDataUpdate(i,null,t)}))}}}))},N.prototype.studiesMetadata=function(){return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map((function(e){return e.metainfo})),this._metainfoCache.push({palettes:{},inputs:[],plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"},{id:"volume",type:"line"}],graphics:{},_metainfoVersion:48,description:"Unnamed Study",format:{type:"inherit"},is_hidden_study:!0,is_price_study:!1,shortDescription:"Unnamed Study",description_localized:"Unnamed Study",id:"BarSetHeikenAshi@tv-prostudies",shortId:"BarSetHeikenAshi",packageId:"tv-basicstudies",version:"13",fullId:"BarSetHeikenAshi@tv-basicstudies-13",productId:"tv-basicstudies",name:"BarSetHeikenAshi@tv-basicstudies"})),this._metainfoCache},N.prototype.searchSymbols=function(e,t,i,s){this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(e,t,i));var r=this;this._externalDatafeed.searchSymbols(e,t,i,(function(e){r._logMessage("Symbol search response: {0}".format(JSON.stringify(e))),e.forEach((e=>{E(e.logo_urls,e.exchange_logo,e)})),s(e)}))}, N.prototype.resolveSymbol=function(e,t,i){var s=this;this._symbolIdToSymbolRequestString.set(V(e,t),i),this._resolvePromisesBySymbolId.set(V(e,t),new Promise((function(r,n){s._resolveSymbolImpl(i,(function(s){TradingView.ChartapiMessagerInstances[e].onSymbolResolved(t,s),r({symbolInfo:s,requestedSymbol:i})}),(function(i){TradingView.ChartapiMessagerInstances[e].onSymbolError(t,i),n(i)}))})))},N.prototype._resolveSymbolImpl=function(e,t,i){S(e)||console.error("Expect to get symbol encoded string, but got the following instead: "+e);const[s,r]=R(e);this._resolveSymbolByName(s,r,t,i)},N.prototype._resolveSymbolByName=function(e,t,i,s){var r,n=t&&t.currency,o=t&&t.unit,a=t&&t.session,l=F(e,n,o,a);if(this._resolveRequests[l])r=this._resolveRequests[l];else{r=this._resolveSymbolInternal(e,n||void 0,o||void 0,a||void 0),this._resolveRequests[l]=r;var c=this;r.then((function(t){c._resolveRequests[F(e,t.currency_id,t.unit_id,t.subsession_id)]=r,c._resolveRequests[F(w(t,null),t.currency_id,t.unit_id,t.subsession_id)]=r,c._resolveRequests[F(w(t,null),n,o,a)]=r})).catch((function(){}))}r.then(i).catch(s)},N.prototype._resolveSymbolInternal=function(e,t,i,s){var r=this;return new Promise(function(n,o){const a=L(e,t,i,s);this._logMessage("Symbol resolve requested: `{0}` ".format(a));var l=!0;this._externalDatafeed.resolveSymbol(e,(function(e){l&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),r._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(a,JSON.stringify(e))),function(e){const t=e.exchange+":"+e.name;if(e.full_name=t,e.pro_name=t,e.base_name||(e.base_name=[e.name]),e.legs||(e.legs=[e.name]),e.exchange||(e.exchange=e["exchange-listed"]),e.ticker||(e.ticker=e.symbol||e.name),e.data_status||(e.data_status="streaming"),!e.session&&e["session-regular"]&&(e.session=e["session-regular"]),!e.minmov&&e.minmovement&&(e.minmov=e.minmovement),e.currency_code&&(e.currency_id=e.currency_code),e.original_currency_code&&(e.original_currency_id=e.original_currency_code),e.holidays&&(e.session_holidays=e.holidays),void 0!==e.has_no_volume&&(e.visible_plots_set=e.has_no_volume?"ohlc":"ohlcv"),void 0===e.visible_plots_set&&(e.visible_plots_set="ohlcv"),e.supported_resolutions)for(var i=0;ithis._resolveSymbolByName(t,i,o,(s=>{console.warn(`Error resolving for market status watcher ${L(t,i.currency,i.unit,i.session)}:\n${s}`),this.quoteRemoveSymbols(e,[r]),a(s)}))),e,r)}}},N.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach((function(i){t._marketStatusWatchers[e][i].stop()})),this._marketStatusWatchers[e]={}},N.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)},N.prototype._startQuotesSubscription=function(e){var t={},i=this;function s(t,s){var r=i._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,t.values.current_session=t.v.cs||r&&r.marketStatus(),t.values.pricescale=s.pricescale, -t.values.minmov=s.minmov,t.values.minmove2=s.minmove2||0,t.values.fractional=s.fractional||!1,E(s.logo_urls,s.exchange_logo,t.values),r&&t.v.cs&&r.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}function r(e){e.forEach((function(e){if(void 0!==t[e.n])null!==t[e.n]&&s(e,t[e.n]);else{const[r,n]=R(e.n);i._resolveSymbolByName(r,n,(function(i){t[e.n]=i,s(e,i)}),(function(){t[e.n]=null}))}}))}var n=this._quotesInfo[e].symbols;if(0===n.length)return;const o=n.map((e=>R(e)[0])),a=this._quotesInfo[e].fastSymbols.map((e=>R(e)[0]));this._externalDatafeed.getQuotes&&!P.enabled("charting_library")?this._externalDatafeed.getQuotes(o,(function(t){i._quotesInfo[e]&&0!==i._quotesInfo[e].symbols.length&&(r(t),i._quotesInfo[e].listenerGUID=e,i._externalDatafeed.subscribeQuotes(o,a,r,i._quotesInfo[e].listenerGUID))}),(function(e){})):!this._externalDatafeed.getQuotes&&P.enabled("trading_terminal")&&setTimeout((function(){r(o.map((function(e){return{n:e,s:"ok",v:{}}})))})),this._createMarketStatusWatchers(e,n)},N.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},N.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},N.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},N.prototype.quoteSetFields=function(e,t){},N.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},N.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter((function(e){return t.indexOf(e)<0})),this._restartQuotesSubscription(e)},N.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},N.prototype.quoteHibernateAll=function(e){},N.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},N.prototype._startDepthSubscription=function(e){var t=this,i=this._depthInfo[e].symbol;function s(e){return e.map((function(e){return{p:e.price,v:e.volume}}))}function r(e){var t={};return t.s=i,t.bids=s(e.bids),t.asks=s(e.asks),t}i&&this._externalDatafeed.subscribeDepth&&(t._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(i,(function(i){var s;t._depthInfo[e]&&((s=i).snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([r(s)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([r(s)])))})))},N.prototype._restartDepthSubscription=function(e){this._stopDepthSubscription(e),this._startDepthSubscription(e)},N.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},N.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},N.prototype.depthSetSymbol=function(e,t){ -this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},N.prototype._filteredSymbols=function(e){var t=[];return e.forEach((function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)})),t},N.prototype._isEndOfData=function(e,t,i){var s=e+"!"+t+"@"+i;return!!this._endOfData[s]},N.prototype._setEndOfData=function(e,t,i,s){var r=e+"!"+t+"@"+i;this._endOfData[r]=!1!==s},N.prototype.serverTimeOffset=function(){return this._serverTimeOffset},N.prototype.serverTime=function(){return 1e3*this.getCurrentUTCTime()},N.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},N.prototype.switchTimezone=function(e,t){this._timeScales[e].setTimezone(t);var i=this._timeScales[e].tickMarks();null!==i&&TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(0,i)},N.prototype._studyCanExtendTimeScale=function(e,t){const i=this._studiesCache[e][t]?.metainfo;return void 0!==i&&(P.enabled("studies_extend_time_scale")&&i.canExtendTimeScale||P.enabled("secondary_series_extend_time_scale")&&"Overlay@tv-basicstudies-1"===i.id)},e.exports=N},76537:(e,t,i)=>{"use strict";i.d(t,{SymbolExtrapolator:()=>c});var s=i(50151),r=i(78071),n=i(60156),o=i(94421),a=i(36274);function l(e,t){return e.length>t}class c{constructor(e,t,i=2e5){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._projectionFirstIndex=1/0,this._barsTimes=[],this._minFutureBarsCount=0,this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._symbolInfo=e,this._interval=a.Interval.parse(t),this._extrapolateLimit=i,this._barBuilder=(0,n.newBarBuilder)(t,new n.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),null)}destroy(){this.clear()}interval(){return this._interval}barBuilder(){return this._barBuilder}symbolInfo(){return this._symbolInfo}clear(){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._barsTimes=[],this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._minFutureBarsCount=0,this._projectionFirstIndex=1/0}firstFutureBarIndex(){return this._barsTimes.length}futureBars(){return this._futureBarsCache}replaceBarsTimesTail(e,t=e.length){if(0===e.length)return;if(0===this._barsTimes.length)return void this.setBarsTimes(e,t);const i=e[0],n=this._barsTimes[this._barsTimes.length-1],o=i>n?this._barsTimes.length:(0,r.lowerbound_int)(this._barsTimes,i);0!==o?(this._barsTimes.splice(o,this._barsTimes.length,...e),this._projectionFirstIndex=t===e.length?this._barsTimes.length:this._barsTimes.indexOf(e[t]),(0,s.assert)(-1!==this._projectionFirstIndex,"something went wrong"),n!==e[e.length-1]&&this._setLastRealBarTime(e[e.length-1])):this.setBarsTimes(e,t)}setBarsTimes(e,t=e.length){const i=this._barsTimes;if(this._barsTimes=e.slice(),this._projectionFirstIndex=0===this._barsTimes.length?1/0:t,0===e.length)return this._historyBarsCache=[],this._futureBarsCache=[],this._firstRealBarTimeMs=null,void(this._lastRealBarTimeMs=null);0!==i.length&&i[i.length-1]===e[e.length-1]||this._setLastRealBarTime(e[e.length-1]),0!==i.length&&i[0]===e[0]||(this._historyBarsCache=[],this._firstRealBarTimeMs=e[0])} -extrapolateTimeWithOffsetToTime(e,t){if(0===t)return{timeMs:e,exact:!0};0===this._barsTimes.length&&(t<0?null===this._firstRealBarTimeMs?this._firstRealBarTimeMs=e:(this._extendHistoryCacheToTimeFromRight(Math.min(e,null!==this._lastRealBarTimeMs?this._lastRealBarTimeMs:1/0)),this._ensureExtrapolatedToHistoryTime(e)):null===this._lastRealBarTimeMs?this._lastRealBarTimeMs=e:(this._extendFutureCacheToTimeFromLeft(Math.max(e,null!==this._firstRealBarTimeMs?this._firstRealBarTimeMs:1/0)),this._ensureExtrapolatedToFutureTime(e)));const i=this.indexOfTime(e);if(null===i)return null;const s=this._timeOfBarIndex(i.index+t);return null===s?null:((i.index<0||this._projectionFirstIndex<=i.index)&&(s.exact=!1),s)}indexOfTime(e){if(null!==this._firstRealBarTimeMs&&ethis._lastRealBarTimeMs){this._ensureExtrapolatedToFutureTime(e);let t=(0,r.lowerbound_int)(this._futureBarsCache,e);if(0!==this._futureBarsCache.length&&t===this._futureBarsCache.length&&e>this._futureBarsCache[this._futureBarsCache.length-1])return null;this._futureBarsCache[t]!==e&&(t-=1);const i=Math.max(1,this._barsTimes.length)+t;return{index:i,timeMs:i===this._barsTimes.length-1?(0,s.ensureNotNull)(this._lastRealBarTimeMs):this._futureBarsCache[t]}}if(0===this._barsTimes.length)return null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||null!==this._lastRealBarTimeMs&&e<=this._lastRealBarTimeMs?{index:0,timeMs:(0,s.ensureNotNull)(this._timeOfBarIndex(0)).timeMs}:null;let t=(0,r.lowerbound_int)(this._barsTimes,e);return this._barsTimes[t]!==e&&(t-=1),{index:t,timeMs:this._barsTimes[t]}}setMinFutureBarsCount(e){this._minFutureBarsCount=e,0!==this._barsTimes.length&&this._ensureExtrapolatedToFutureBar(e)}ensureExtrapolatedToFutureTime(e){this._ensureExtrapolatedToFutureTime(e)}_setLastRealBarTime(e){const t=this._futureBarsCache.length,i=(0,r.upperbound_int)(this._futureBarsCache,e);0===i?this._extendFutureCacheToTimeFromLeft(e):(this._lastRealBarTimeMs=e,this._futureBarsCache=this._futureBarsCache.slice(i)),this._ensureExtrapolatedToFutureBar(Math.max(t,this._minFutureBarsCount))}_timeOfBarIndex(e){var t;if(e<0){const t=Math.abs(e);this._ensureExtrapolatedToHistoryBar(t);const i=this._historyBarsCache.length-t;return i<0?null:{timeMs:this._historyBarsCache[i],exact:!1}}if(0===e&&0===this._barsTimes.length)return{timeMs:(0,s.ensureNotNull)(null!==(t=this._firstRealBarTimeMs)&&void 0!==t?t:this._lastRealBarTimeMs),exact:!1};if(e>=this._barsTimes.length){const t=e-Math.max(1,this._barsTimes.length);return this._ensureExtrapolatedToFutureBar(t+1),t>=this._futureBarsCache.length?null:{timeMs:this._futureBarsCache[t],exact:!1}}return{timeMs:this._barsTimes[e], -exact:e=e)return;if((0,s.assert)(0===this._barsTimes.length,"bars should be empty"),this._firstRealBarTimeMs=e,0===this._historyBarsCache.length)return;const t=(0,o.extrapolateBarsFrontToTime)(this._barBuilder,this._historyBarsCache[this._historyBarsCache.length-1],e-1,this._extrapolateLimit,!0).times;this._historyBarsCache=this._historyBarsCache.concat(t)}_ensureExtrapolatedToFutureBar(e){return!(this._futureBarsCache.length>=e||l(this._futureBarsCache,this._extrapolateLimit))&&this._extendFutureCacheFromRight(((t,i)=>(0,o.extrapolateBarsFrontByCount)(this._barBuilder,t,e-i,!0).times))}_ensureExtrapolatedToFutureTime(e){null!==this._lastRealBarTimeMs&&this._lastRealBarTimeMs>=e||l(this._futureBarsCache,this._extrapolateLimit)||0!==this._futureBarsCache.length&&this._futureBarsCache[this._futureBarsCache.length-1]>=e||(this._extendFutureCacheFromRight(((t,i)=>(0,o.extrapolateBarsFrontToTime)(this._barBuilder,t,e,this._extrapolateLimit,!0).times)),this._futureBarsCache[this._futureBarsCache.length-1]=e||l(this._historyBarsCache,this._extrapolateLimit)||this._extendHistoryCacheFromLeft(((t,i)=>(0,o.extrapolateBarsFrontByCount)(this._barBuilder,t,-(e-i),!0).times.reverse()))}_ensureExtrapolatedToHistoryTime(e){null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||l(this._historyBarsCache,this._extrapolateLimit)||0!==this._historyBarsCache.length&&this._historyBarsCache[0]<=e||(this._extendHistoryCacheFromLeft(((t,i)=>{const s=(0,o.extrapolateBarsFrontToTime)(this._barBuilder,t-1,e-1,this._extrapolateLimit,!0).times;return s[s.length-1]===t?s.slice(0,-1):s})),(0===this._historyBarsCache.length||this._historyBarsCache[0]>e)&&this._ensureExtrapolatedToHistoryBar(this._historyBarsCache.length+1))}}},61595:(e,t,i)=>{"use strict";i.d(t,{backend:()=>s});const s=i(58844)},47327:(e,t,i)=>{ -"use strict";i.d(t,{HandlerInfo:()=>s});class s{constructor(e,t){this.handler=e,this.customId=t}}},17133:(e,t,i)=>{"use strict";var s,r;function n(e,t){return"period-back"===e.type&&"period-back"===t.type?e.value===t.value:"time-range"===e.type&&"time-range"===t.type&&(e.from===t.from&&e.to===t.to)}i.d(t,{TIMEFRAMETYPE:()=>r,areEqualTimeFrames:()=>n}),function(e){e.extractErrorReason=function(e){return e.params[1]}}(s||(s={})),function(e){e.PeriodBack="period-back",e.TimeRange="time-range"}(r||(r={}))},89173:()=>{"use strict";TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.isPaidPro=function(){return!1},TradingView.Pro.prototype.isSupportAvailable=function(){return!1},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]}},67545:(e,t,i)=>{"use strict";i.r(t),i.d(t,{QUOTE_FIELDS:()=>n,QUOTE_FIELDS_CACHE:()=>o,QuoteCache:()=>r});var s=i(50151);class r{constructor(e){this._cache=new Map,this._fields=[...e.fields]}update(e,t,i){const r=(0,s.ensureDefined)(e.symbolname);if(this._cache.has(r)||this._cache.set(r,{symbolname:r,status:e.status,values:{}}),"error"===e.status)return;const n=(0,s.ensureDefined)(this._cache.get(r));n.status=e.status;for(const s of this._fields)t.has(s)&&(i||void 0!==e.values[s])&&(n.values[s]=e.values[s])}get(e){var t;return null!==(t=this._cache.get(e))&&void 0!==t?t:null}fields(){return this._fields}} +e.has_empty_bars&&!v()&&t('both has_empty_bars field and featureset "disable_resolution_rebuild" are enabled and may cause data issues (see #3329)'),(void 0===e.minmov||e.minmov<=0)&&t("minmov must be positive"),(void 0===e.pricescale||e.pricescale<=0)&&t("pricescale must be positive"),void 0!==e.name&&0!==e.name.length||t("name must be non-empty string"),void 0!==e.session&&0!==e.session.length||t("session must be non-empty string"),void 0!==e.holidays&&t("field holidays is deprecated, use session_holidays instead"),void 0!==e.has_no_volume&&t("field has_no_volume is deprecated, use visible_plots_set instead"),void 0===e.timezone||0===e.timezone.length?t("timezone must be non-empty string"):"exchange"!==e.timezone&&f(e.timezone)||"UTC"!==e.timezone&&t('unsupported timezone "{0}"'.format(e.timezone)),void 0!==e.intraday_multipliers){var i=e.intraday_multipliers;if(Array.isArray(i))for(var s=0;sthis._resolveSymbolByName(t,i,o,(s=>{console.warn(`Error resolving for market status watcher ${L(t,i.currency,i.unit,i.session)}:\n${s}`),this.quoteRemoveSymbols(e,[r]),a(s)}))),e,r)}}},N.prototype._removeMarketStatusWatchers=function(e){var t=this;Object.keys(this._marketStatusWatchers[e]||{}).forEach((function(i){t._marketStatusWatchers[e][i].stop()})),this._marketStatusWatchers[e]={}},N.prototype._stopQuotesSubscription=function(e){this._quotesInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[e].listenerGUID),this._quotesInfo[e].listenerGUID=void 0),this._removeMarketStatusWatchers(e)},N.prototype._startQuotesSubscription=async function(e){var t={},i=this;const s=async e=>{const i=new Map,s=new Set;for(const r of e){const[e,n]=R(r),o=await new Promise((t=>this._resolveSymbolByName(e,n,(e=>t(e)),(()=>t(null)))));null!==o&&(t[o.ticker]=o,t[r]=o,s.add(o.ticker),o.ticker!==r&&(i.has(o.ticker)||i.set(o.ticker,[]), +i.get(o.ticker).push(r)))}return[i,[...s]]},[r,n]=await s(this._quotesInfo[e].symbols),[o,a]=await s(this._quotesInfo[e].fastSymbols);function l(s){s.forEach((function(s){const n=s.n;if(r.has(n)||o.has(n)){const e=(r.get(n)??o.get(n)).map((e=>({...s,n:e})));setTimeout((()=>l(e)),0)}void 0!==t[s.n]&&null!==t[s.n]&&function(t,s){var r=i._marketStatusWatchers[e][t.n];t.symbolname=t.n,t.status=t.s,t.values=t.v,t.values.change=t.v.ch,t.values.last_price=t.v.lp,t.values.change_percent=t.v.chp,t.values.current_session=t.v.cs||r&&r.marketStatus(),t.values.pricescale=s.pricescale,t.values.minmov=s.minmov,t.values.minmove2=s.minmove2||0,t.values.fractional=s.fractional||!1,E(s.logo_urls,s.exchange_logo,t.values),r&&t.v.cs&&r.stop(),TradingView.ChartapiMessagerInstances[e].onQuotesData([e].concat([t]))}(s,t[s.n])}))}this._externalDatafeed.getQuotes&&!P.enabled("charting_library")?this._externalDatafeed.getQuotes(n,(function(t){i._quotesInfo[e]&&0!==i._quotesInfo[e].symbols.length&&(l(t),i._quotesInfo[e].listenerGUID=e,i._externalDatafeed.subscribeQuotes(n,a,l,i._quotesInfo[e].listenerGUID))}),(function(e){})):!this._externalDatafeed.getQuotes&&P.enabled("trading_terminal")&&setTimeout((function(){l(this._quotesInfo[e].symbols.map((function(e){return{n:e,s:"ok",v:{}}})))})),this._createMarketStatusWatchers(e,this._quotesInfo[e].symbols)},N.prototype._restartQuotesSubscription=function(e){this._stopQuotesSubscription(e),this._startQuotesSubscription(e)},N.prototype.quoteCreateSession=function(e){this._quotesInfo[e]={symbols:[],fastSymbols:[],listenerGUID:void 0}},N.prototype.quoteDeleteSession=function(e){this._stopQuotesSubscription(e),this._quotesInfo[e]=null},N.prototype.quoteSetFields=function(e,t){},N.prototype.quoteAddSymbols=function(e,t){this._quotesInfo[e].symbols=this._filteredSymbols(this._quotesInfo[e].symbols.concat(t)),this._restartQuotesSubscription(e)},N.prototype.quoteRemoveSymbols=function(e,t){this._quotesInfo[e].symbols=this._quotesInfo[e].symbols.filter((function(e){return t.indexOf(e)<0})),this._restartQuotesSubscription(e)},N.prototype.quoteFastSymbols=function(e,t){this._quotesInfo[e].fastSymbols=this._filteredSymbols(t),this._restartQuotesSubscription(e)},N.prototype.quoteHibernateAll=function(e){},N.prototype._stopDepthSubscription=function(e){this._depthInfo[e].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[e].listenerGUID),this._depthInfo[e].listenerGUID=void 0)},N.prototype._startDepthSubscription=function(e){var t=this,i=this._depthInfo[e].symbol;function s(e){return e.map((function(e){return{p:e.price,v:e.volume}}))}function r(e){var t={};return t.s=i,t.bids=s(e.bids),t.asks=s(e.asks),t}i&&this._externalDatafeed.subscribeDepth&&(t._depthInfo[e].listenerGUID=this._externalDatafeed.subscribeDepth(i,(function(i){var s;t._depthInfo[e]&&((s=i).snapshot?TradingView.ChartapiMessagerInstances[e].onDepthData([e].concat([r(s)])):TradingView.ChartapiMessagerInstances[e].onDepthUpdate([e].concat([r(s)])))})))},N.prototype._restartDepthSubscription=function(e){ +this._stopDepthSubscription(e),this._startDepthSubscription(e)},N.prototype.depthCreateSession=function(e){this._depthInfo[e]={symbol:null,listenerGUID:void 0}},N.prototype.depthDeleteSession=function(e){this._depthInfo[e].symbol=null,this._stopDepthSubscription(e),delete this._depthInfo[e]},N.prototype.depthSetSymbol=function(e,t){this._depthInfo[e].symbol=t,this._restartDepthSubscription(e)},N.prototype._filteredSymbols=function(e){var t=[];return e.forEach((function(e){e instanceof Object||t.indexOf(e)<0&&t.push(e)})),t},N.prototype._isEndOfData=function(e,t,i){var s=e+"!"+t+"@"+i;return!!this._endOfData[s]},N.prototype._setEndOfData=function(e,t,i,s){var r=e+"!"+t+"@"+i;this._endOfData[r]=!1!==s},N.prototype.serverTimeOffset=function(){return this._serverTimeOffset},N.prototype.serverTime=function(){return 1e3*this.getCurrentUTCTime()},N.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},N.prototype.switchTimezone=function(e,t){this._timeScales[e].setTimezone(t);var i=this._timeScales[e].tickMarks();null!==i&&TradingView.ChartapiMessagerInstances[e].onTickmarksUpdated(0,i)},N.prototype._studyCanExtendTimeScale=function(e,t){const i=this._studiesCache[e][t]?.metainfo;return void 0!==i&&(P.enabled("studies_extend_time_scale")&&i.canExtendTimeScale||P.enabled("secondary_series_extend_time_scale")&&"Overlay@tv-basicstudies-1"===i.id)},e.exports=N},76537:(e,t,i)=>{"use strict";i.d(t,{SymbolExtrapolator:()=>c});var s=i(50151),r=i(78071),n=i(60156),o=i(94421),a=i(36274);function l(e,t){return e.length>t}class c{constructor(e,t,i=2e5){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._projectionFirstIndex=1/0,this._barsTimes=[],this._minFutureBarsCount=0,this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._symbolInfo=e,this._interval=a.Interval.parse(t),this._extrapolateLimit=i,this._barBuilder=(0,n.newBarBuilder)(t,new n.SessionInfo(e.timezone,e.session,e.session_holidays,e.corrections),null)}destroy(){this.clear()}interval(){return this._interval}barBuilder(){return this._barBuilder}symbolInfo(){return this._symbolInfo}clear(){this._firstRealBarTimeMs=null,this._historyBarsCache=[],this._barsTimes=[],this._lastRealBarTimeMs=null,this._futureBarsCache=[],this._minFutureBarsCount=0,this._projectionFirstIndex=1/0}firstFutureBarIndex(){return this._barsTimes.length}futureBars(){return this._futureBarsCache}replaceBarsTimesTail(e,t=e.length){if(0===e.length)return;if(0===this._barsTimes.length)return void this.setBarsTimes(e,t);const i=e[0],n=this._barsTimes[this._barsTimes.length-1],o=i>n?this._barsTimes.length:(0,r.lowerbound_int)(this._barsTimes,i);0!==o?(this._barsTimes.splice(o,this._barsTimes.length,...e),this._projectionFirstIndex=t===e.length?this._barsTimes.length:this._barsTimes.indexOf(e[t]),(0,s.assert)(-1!==this._projectionFirstIndex,"something went wrong"),n!==e[e.length-1]&&this._setLastRealBarTime(e[e.length-1])):this.setBarsTimes(e,t)}setBarsTimes(e,t=e.length){const i=this._barsTimes;if(this._barsTimes=e.slice(), +this._projectionFirstIndex=0===this._barsTimes.length?1/0:t,0===e.length)return this._historyBarsCache=[],this._futureBarsCache=[],this._firstRealBarTimeMs=null,void(this._lastRealBarTimeMs=null);0!==i.length&&i[i.length-1]===e[e.length-1]||this._setLastRealBarTime(e[e.length-1]),0!==i.length&&i[0]===e[0]||(this._historyBarsCache=[],this._firstRealBarTimeMs=e[0])}extrapolateTimeWithOffsetToTime(e,t){if(0===t)return{timeMs:e,exact:!0};0===this._barsTimes.length&&(t<0?null===this._firstRealBarTimeMs?this._firstRealBarTimeMs=e:(this._extendHistoryCacheToTimeFromRight(Math.min(e,null!==this._lastRealBarTimeMs?this._lastRealBarTimeMs:1/0)),this._ensureExtrapolatedToHistoryTime(e)):null===this._lastRealBarTimeMs?this._lastRealBarTimeMs=e:(this._extendFutureCacheToTimeFromLeft(Math.max(e,null!==this._firstRealBarTimeMs?this._firstRealBarTimeMs:1/0)),this._ensureExtrapolatedToFutureTime(e)));const i=this.indexOfTime(e);if(null===i)return null;const s=this._timeOfBarIndex(i.index+t);return null===s?null:((i.index<0||this._projectionFirstIndex<=i.index)&&(s.exact=!1),s)}indexOfTime(e){if(null!==this._firstRealBarTimeMs&&ethis._lastRealBarTimeMs){this._ensureExtrapolatedToFutureTime(e);let t=(0,r.lowerbound_int)(this._futureBarsCache,e);if(0!==this._futureBarsCache.length&&t===this._futureBarsCache.length&&e>this._futureBarsCache[this._futureBarsCache.length-1])return null;this._futureBarsCache[t]!==e&&(t-=1);const i=Math.max(1,this._barsTimes.length)+t;return{index:i,timeMs:i===this._barsTimes.length-1?(0,s.ensureNotNull)(this._lastRealBarTimeMs):this._futureBarsCache[t]}}if(0===this._barsTimes.length)return null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||null!==this._lastRealBarTimeMs&&e<=this._lastRealBarTimeMs?{index:0,timeMs:(0,s.ensureNotNull)(this._timeOfBarIndex(0)).timeMs}:null;let t=(0,r.lowerbound_int)(this._barsTimes,e);return this._barsTimes[t]!==e&&(t-=1),{index:t,timeMs:this._barsTimes[t]}}setMinFutureBarsCount(e){this._minFutureBarsCount=e,0!==this._barsTimes.length&&this._ensureExtrapolatedToFutureBar(e)}ensureExtrapolatedToFutureTime(e){this._ensureExtrapolatedToFutureTime(e)}_setLastRealBarTime(e){const t=this._futureBarsCache.length,i=(0,r.upperbound_int)(this._futureBarsCache,e);0===i?this._extendFutureCacheToTimeFromLeft(e):(this._lastRealBarTimeMs=e,this._futureBarsCache=this._futureBarsCache.slice(i)),this._ensureExtrapolatedToFutureBar(Math.max(t,this._minFutureBarsCount))}_timeOfBarIndex(e){var t;if(e<0){const t=Math.abs(e);this._ensureExtrapolatedToHistoryBar(t);const i=this._historyBarsCache.length-t;return i<0?null:{timeMs:this._historyBarsCache[i],exact:!1}} +if(0===e&&0===this._barsTimes.length)return{timeMs:(0,s.ensureNotNull)(null!==(t=this._firstRealBarTimeMs)&&void 0!==t?t:this._lastRealBarTimeMs),exact:!1};if(e>=this._barsTimes.length){const t=e-Math.max(1,this._barsTimes.length);return this._ensureExtrapolatedToFutureBar(t+1),t>=this._futureBarsCache.length?null:{timeMs:this._futureBarsCache[t],exact:!1}}return{timeMs:this._barsTimes[e],exact:e=e)return;if((0,s.assert)(0===this._barsTimes.length,"bars should be empty"),this._firstRealBarTimeMs=e,0===this._historyBarsCache.length)return;const t=(0,o.extrapolateBarsFrontToTime)(this._barBuilder,this._historyBarsCache[this._historyBarsCache.length-1],e-1,this._extrapolateLimit,!0).times;this._historyBarsCache=this._historyBarsCache.concat(t)}_ensureExtrapolatedToFutureBar(e){return!(this._futureBarsCache.length>=e||l(this._futureBarsCache,this._extrapolateLimit))&&this._extendFutureCacheFromRight(((t,i)=>(0,o.extrapolateBarsFrontByCount)(this._barBuilder,t,e-i,!0).times))}_ensureExtrapolatedToFutureTime(e){null!==this._lastRealBarTimeMs&&this._lastRealBarTimeMs>=e||l(this._futureBarsCache,this._extrapolateLimit)||0!==this._futureBarsCache.length&&this._futureBarsCache[this._futureBarsCache.length-1]>=e||(this._extendFutureCacheFromRight(((t,i)=>(0,o.extrapolateBarsFrontToTime)(this._barBuilder,t,e,this._extrapolateLimit,!0).times)),this._futureBarsCache[this._futureBarsCache.length-1]=e||l(this._historyBarsCache,this._extrapolateLimit)||this._extendHistoryCacheFromLeft(((t,i)=>(0,o.extrapolateBarsFrontByCount)(this._barBuilder,t,-(e-i),!0).times.reverse()))}_ensureExtrapolatedToHistoryTime(e){ +null!==this._firstRealBarTimeMs&&this._firstRealBarTimeMs<=e||l(this._historyBarsCache,this._extrapolateLimit)||0!==this._historyBarsCache.length&&this._historyBarsCache[0]<=e||(this._extendHistoryCacheFromLeft(((t,i)=>{const s=(0,o.extrapolateBarsFrontToTime)(this._barBuilder,t-1,e-1,this._extrapolateLimit,!0).times;return s[s.length-1]===t?s.slice(0,-1):s})),(0===this._historyBarsCache.length||this._historyBarsCache[0]>e)&&this._ensureExtrapolatedToHistoryBar(this._historyBarsCache.length+1))}}},61595:(e,t,i)=>{"use strict";i.d(t,{backend:()=>s});const s=i(58844)},47327:(e,t,i)=>{"use strict";i.d(t,{HandlerInfo:()=>s});class s{constructor(e,t){this.handler=e,this.customId=t}}},17133:(e,t,i)=>{"use strict";var s,r;function n(e,t){return"period-back"===e.type&&"period-back"===t.type?e.value===t.value:"time-range"===e.type&&"time-range"===t.type&&(e.from===t.from&&e.to===t.to)}i.d(t,{TIMEFRAMETYPE:()=>r,areEqualTimeFrames:()=>n}),function(e){e.extractErrorReason=function(e){return e.params[1]}}(s||(s={})),function(e){e.PeriodBack="period-back",e.TimeRange="time-range"}(r||(r={}))},89173:()=>{"use strict";TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.isPaidPro=function(){return!1},TradingView.Pro.prototype.isSupportAvailable=function(){return!1},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]}},67545:(e,t,i)=>{"use strict";i.r(t),i.d(t,{QUOTE_FIELDS:()=>n,QUOTE_FIELDS_CACHE:()=>o,QuoteCache:()=>r});var s=i(50151);class r{constructor(e){this._cache=new Map,this._fields=[...e.fields]}update(e,t,i){const r=(0,s.ensureDefined)(e.symbolname);if(this._cache.has(r)||this._cache.set(r,{symbolname:r,status:e.status,values:{}}),"error"===e.status)return;const n=(0,s.ensureDefined)(this._cache.get(r));n.status=e.status;for(const s of this._fields)t.has(s)&&(i||void 0!==e.values[s])&&(n.values[s]=e.values[s])}get(e){var t;return null!==(t=this._cache.get(e))&&void 0!==t?t:null}fields(){return this._fields}} const n=new Set(["pro_name","base_name","logoid","currency-logoid","base-currency-logoid","source-logoid","short_name","timezone","current_session","last_price","lp_time","prev_close_price","open_price","high_price","low_price","price_52_week_high","price_52_week_low","ask","ask_size","bid","bid_size","rch","rchp","rtc","data_frequency","reference-last-period-start","business_description","web_site_url","number_of_employees","float_shares_outstanding","earnings_release_next_calendar_date","root","description","exchange","listed_exchange","type","country_code","provider_id","sector","typespecs","visible-plots-set","industry","currency_id","last_price","fractional","minmov","minmove2","pricescale","variable_tick_size","change","change_percent","volume","average_volume","market_cap_basic","total_revenue","earnings_per_share_basic_ttm","price_earnings_ttm","beta_1_year","dps_common_stock_prim_issue_fy","dividends_yield","earnings_release_next_date","earnings_per_share_forecast_next_fq","earnings_release_date","earnings_per_share_fq","fundamental_currency_code","number_of_employees","web_site_url","business_description","founded","ceo","float_shares_outstanding","total_shares_outstanding","dividend_payout_ratio_ttm","dividends_yield_current","dividend_ex_date_upcoming","dividend_amount_upcoming","dividend_amount_recent","dividend_ex_date_recent","total_revenue_fq_h","total_revenue_fy_h","net_income_fy_h","net_income_fq_h","total_assets_fy_h","total_assets_fq_h","total_liabilities_fy_h","total_liabilities_fq_h","cash_f_operating_activities_fy_h","cash_f_operating_activities_fq_h","cash_f_investing_activities_fy_h","cash_f_investing_activities_fq_h","cash_f_financing_activities_fy_h","cash_f_financing_activities_fq_h","fiscal_period_fy_h","fiscal_period_fq_h","fiscal_period_fh_h","earnings_release_date_fq_h","earnings_release_next_date_fq","earnings_per_share_forecast_next_fq","earnings_per_share_forecast_fq_h","earnings_per_share_fq_h","earnings_fiscal_period_fq_h","next_earnings_fiscal_period_fq","earnings_release_next_time","is_next_earnings_release_date_estimated","symbol-primaryname","currency_code","rates_mc","rates_fy","rates_ttm","measure","value_unit_id","value-unit-id","update_mode","language","local_description","short_description","source","source2","format","recommendation_mark","last_report_frequency","price_target_estimates_num","price_target_average","update_mode_seconds","recommendation_total","recommendation_buy","recommendation_over","recommendation_hold","recommendation_under","recommendation_sell","recommendation_total","price_target_high","price_target_low","rates_pt","rates_pt","total_revenue_fy_h","total_revenue_fq_h","total_revenue_fh_h","net_income_fy_h","net_income_fq_h","net_income_fh_h","total_assets_fy_h","total_assets_fq_h","total_assets_fh_h","total_liabilities_fy_h","total_liabilities_fq_h","total_liabilities_fh_h","cash_f_operating_activities_fy_h","cash_f_operating_activities_fq_h","cash_f_operating_activities_fh_h","cash_f_investing_activities_fy_h","cash_f_investing_activities_fq_h","cash_f_investing_activities_fh_h","cash_f_financing_activities_fy_h","cash_f_financing_activities_fq_h","cash_f_financing_activities_fh_h","fiscal_period_fy","fiscal_period_fq","fiscal_period_fh","earnings_release_date_fq_h","earnings_release_date_fy_h","earnings_release_date_fh_h","earnings_release_next_date_fq","earnings_release_next_date_fy","earnings_release_next_date_fh","earnings_release_next_time","is_next_earnings_release_date_estimated","earnings_per_share_forecast_next_fq","earnings_per_share_forecast_next_fy","earnings_per_share_forecast_next_fh","earnings_per_share_forecast_fq_h","earnings_per_share_forecast_fy_h","earnings_per_share_forecast_fh_h","earnings_per_share_fq_h","earnings_per_share_fy_h","earnings_per_share_fh_h","earnings_fiscal_period_fq_h","earnings_fiscal_period_fy_h","earnings_fiscal_period_fh_h","next_earnings_fiscal_period_fq","next_earnings_fiscal_period_fy","next_earnings_fiscal_period_fh","revenue_fq_h","revenue_fy_h","revenue_fh_h","revenue_forecast_fq_h","revenue_forecast_fy_h","revenue_forecast_fh_h","revenue_forecast_next_fq","revenue_forecast_next_fy","revenue_forecast_next_fh","revenue_seg_by_business_h","revenue_seg_by_region_h","dividend_payout_ratio_ttm","dividends_yield_current","dividend_ex_date_upcoming","dividend_amount_upcoming","dividend_amount_recent","dividend_ex_date_recent","dividend_amount_h","total_revenue_fy","total_revenue_fq","total_revenue_fh","gross_profit_fy","gross_profit_fq","gross_profit_fh","ebitda_fy","ebit_fy","net_income_fy","net_income_fq","net_income_fh","total_debt_fy_h","total_debt_fq_h","total_debt_fh_h","free_cash_flow_fy_h","free_cash_flow_fq_h","free_cash_flow_fh_h","cash_n_equivalents_fy_h","cash_n_equivalents_fq_h","cash_n_equivalents_fh_h","total_current_assets_fy","total_current_assets_fq","total_current_assets_fh","total_current_liabilities_fy","total_current_liabilities_fq","total_current_liabilities_fh","total_non_current_assets_fy","total_non_current_assets_fq","total_non_current_assets_fh","total_non_current_liabilities_fy","total_non_current_liabilities_fq","total_non_current_liabilities_fh","loans_net_fy","total_deposits_fy","loan_loss_allowances_fy","price_earnings_fq_h","price_earnings_fy_h","price_earnings_fh_h","price_sales_fq_h","price_sales_fy_h","price_sales_fh_h","diluted_net_income_ttm","total_revenue_ttm","price_earnings_current","price_sales_current","isin","interest_income_fy_h","interest_income_fq_h","interest_income_fh_h","non_interest_income_fy_h","non_interest_income_fq_h","non_interest_income_fh_h","website","doc","explorer","sources","contracts","crypto_common_categories","crypto_asset","community","dividends_availability","earnings_availability","financials_availability","etf_asset_type_exposure","etf_region_exposure","top_holdings","unit-id","options-info","interest_income_fy","interest_income_fq","interest_income_fh","non_interest_income_fy","non_interest_income_fq","non_interest_income_fh","interest_expense_fy","interest_expense_fq","interest_expense_fh","loan_loss_provision_fy","loan_loss_provision_fq","loan_loss_provision_fh","non_interest_expense_fy","non_interest_expense_fq","non_interest_expense_fh","non_oper_income_fy","non_oper_income_fq","non_oper_income_fh","unusual_expense_inc_fy","unusual_expense_inc_fq","unusual_expense_inc_fh","pretax_income_fy","pretax_income_fq","pretax_income_fh","income_tax_fy","income_tax_fq","income_tax_fh","after_tax_other_income_fy","after_tax_other_income_fq","after_tax_other_income_fh","total_non_oper_income_fy","total_non_oper_income_fq","total_non_oper_income_fh","oper_income_fy","oper_income_fq","oper_income_fh","operating_expenses_fy","operating_expenses_fq","operating_expenses_fh","cost_of_goods_fy","cost_of_goods_fq","cost_of_goods_fh","equity_in_earnings_fy","equity_in_earnings_fq","equity_in_earnings_fh","minority_interest_exp_fy","minority_interest_exp_fq","minority_interest_exp_fh","discontinued_operations_fy","discontinued_operations_fq","discontinued_operations_fh","front_contract","pointvalue","unit_id","expiration","aum","asset_class","focus","expense_ratio","launch_date","issuer","brand","homepage","index_tracked","fund_view_mode","common_equity_tier1_ratio_fy_h","common_equity_tier1_ratio_fq_h","common_equity_tier1_ratio_fh_h","tier1_capital_ratio_fy_h","tier1_capital_ratio_fq_h","tier1_capital_ratio_fh_h","total_capital_ratio_fy_h","total_capital_ratio_fq_h","total_capital_ratio_fh_h","etf_holdings_count","contract-description"]),o=new r({ fields:n})},2438:(e,t,i)=>{"use strict";i.d(t,{destroyQuoteSessions:()=>a,getQuoteSessionInstance:()=>o});var s=i(49326),r=i.n(s);const n={};function o(e="full"){return n[e]||function(e="full",t){n[e]=t}(e,new(r())(e)),n[e]}function a(){for(const e in n)if(n.hasOwnProperty(e)){const t=n[e];void 0!==t&&t.destroy(),delete n[e]}}},47562:(e,t,i)=>{"use strict";i.d(t,{QuoteSession:()=>r});var s=i(36174);class r{constructor(e,t=(0,s.randomHash)()){this._sessionstarted=!1,this._globalHandler=null,this._chartApi=e,this._sessionid="qs_"+t}destroy(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionstarted=!1)}connected(){return this._chartApi.connected()}connect(e){this._globalHandler=e,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()}disconnect(){this._chartApi.disconnect()}quoteAddSymbols(e){this._chartApi.quoteAddSymbols(this._sessionid,e)}quoteRemoveSymbols(e){this._chartApi.quoteRemoveSymbols(this._sessionid,e)}quoteFastSymbols(e){this._chartApi.quoteFastSymbols(this._sessionid,e)}quoteSetFields(e){this._chartApi.quoteSetFields(this._sessionid,e)}onMessage(e){var t;switch(e.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}null===(t=this._globalHandler)||void 0===t||t.call(this,e)}quoteHibernateAll(){this._chartApi.quoteHibernateAll(this._sessionid)}}window.TradingView.QuoteSession=r},49326:(e,t,i)=>{"use strict";e=i.nmd(e);var s=i(43370).default,r=i(12481).default,n=i(71766).PriceFormatter;const{uniq:o}=i(15051);var a=i(36174);const{normalizeUpdateMode:l}=i(5370);var c=i(30888).deepExtend;const{QUOTE_FIELDS_CACHE:h,QUOTE_FIELDS:d}=i(67545);var u,p=i(57898).Delegate;function _(e,t){this.options=Object.assign({throttleTimeout:125},t),this._connected=!1,this._symbol_data={},this._subscriptions={},this.onConnect=new p,this.onDisconnect=new p,this._quoteApi=new u(window.ChartApiInstance),this._type=e||"full",this._delayUpdateFastSymbols=r(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},this._snapshotValuesCache={},this._waitingForSnapshot={},this.connect()}u=i(47562).QuoteSession,_.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},_.prototype.typeFields={},_.prototype.typeFields.simple=["base-currency-logoid","ch","chp","currency-logoid","currency_code","currency_id","base_currency_id","current_session","description","exchange","format","fractional","is_tradable","language","local_description","listed_exchange","logoid","lp","lp_time","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","typespecs","update_mode","volume","variable_tick_size","value_unit_id"], _.prototype.typeFields.simpleDetailed=[].concat(_.prototype.typeFields.simple,["ask","bid","fundamentals","high_price","is_tradable","low_price","open_price","prev_close_price","rch","rchp","rtc","rtc_time","status","basic_eps_net_income","beta_1_year","earnings_per_share_basic_ttm","industry","market_cap_basic","price_earnings_ttm","sector","volume","dividends_yield","timezone"]),_.prototype.typeFields.full=[],_.prototype.typeFields.watchlist=[].concat(_.prototype.typeFields.simple,["rchp","rtc","country_code","provider_id"]),_.prototype.typeFields.portfolio=["pro_name","short_name","exchange","listed_exchange","description","sector","type","typespecs","industry","currency_code","currency_id","ch","chp","logoid","currency-logoid","base-currency-logoid","earnings_per_share_forecast_next_fq","earnings_release_next_date","earnings_release_date","earnings_per_share_fq","lp","fractional","minmov","minmove2","pricescale","volume","average_volume","market_cap_basic","total_revenue","earnings_per_share_basic_ttm","price_earnings_ttm","beta_1_year","dps_common_stock_prim_issue_fy","dividends_yield","fundamental_currency_code","rates_mc","rates_fy","rates_ttm","format","value_unit_id"],_.prototype.typeFields.notes=["short_name","pro_name","logoid","currency-logoid","base-currency-logoid","symbol-primaryname","type","typespecs"],_.prototype.typeFields.estimates=["fundamental_data","type","typespecs","earnings_per_share_forecast_next_symbol_currency_fq","earnings_release_next_aligned_date","earnings_release_next_calendar_date","earnings_release_next_date"],_.prototype.connect=function(e){this._quoteApi.connect(this.quoteHandler.bind(this))},_.prototype.quoteHandler=function(e){var t=e.method,i=e.params;switch(t){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"quote_completed":this._connected&&this.onSymbolData({symbolname:i[0],complete:performance.now(),values:{}});break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},_.prototype.onConnected=function(){this.setFields();var e=Object.keys(this._symbol_data);e.length&&(this._quoteApi.quoteAddSymbols(e),this._delayUpdateFastSymbols()),this.onConnect.fire()},_.prototype.setFields=function(){var e=_.prototype.typeFields[this._type];e&&e.length&&this._quoteApi.quoteSetFields(e)},_.prototype.onSymbolData=function(e){try{e.status&&h.update(e,d,!1)}catch(e){}var t=e.symbolname,i=this._throttledSymbolData[t];i||(i=this._throttledSymbolData[t]={fnDispatch:s(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?c(i.cache,e):i.cache=e,i.fnDispatch(t)},_.prototype._parseUpdateMode=function(e){l(e)},_.prototype.dipatchSymbolData=function(e){var t=this._symbol_data[e],i=this._throttledSymbolData[e].cache;if(delete this._throttledSymbolData[e].cache,this._symbol_data[e])for(var s in c(t,i),t.values&&this._parseUpdateMode(t.values),this._subscriptions){var r=this._subscriptions[s] diff --git a/charting_library/charting_library.cjs.js b/charting_library/charting_library.cjs.js index 7c67623e..5768532c 100644 --- a/charting_library/charting_library.cjs.js +++ b/charting_library/charting_library.cjs.js @@ -1 +1 @@ -"use strict";function t(e,n){const i={...e};for(const o in n)"object"!=typeof e[o]||null===e[o]||Array.isArray(e[o])?void 0!==n[o]&&(i[o]=n[o]):i[o]=t(e[o],n[o]);return i}Object.defineProperty(exports,"__esModule",{value:!0});const e={width:800,height:500,interval:"1D",timezone:"Etc/UTC",container:"",library_path:"",locale:"en",widgetbar:{details:!1,watchlist:!1,news:!1,datawindow:!1,watchlist_settings:{default_symbols:[]}},overrides:{"mainSeriesProperties.showCountdown":!1},studies_overrides:{},trading_customization:{position:{},order:{}},brokerConfig:{configFlags:{}},fullscreen:!1,autosize:!1,disabled_features:[],enabled_features:[],debug:!1,logo:{},time_frames:[{text:"5y",resolution:"1W"},{text:"1y",resolution:"1W"},{text:"6m",resolution:"120"},{text:"3m",resolution:"60"},{text:"1m",resolution:"30"},{text:"5d",resolution:"5"},{text:"1d",resolution:"1"}],client_id:"0",user_id:"0",charts_storage_api_version:"1.0",favorites:{intervals:[],chartTypes:[],indicators:[],drawingTools:[]}},n=JSON.parse('[{"iso":"ar","dir":"rtl","language":"ar"},{"iso":"pt","dir":"ltr","language":"pt"},{"iso":"ca","dir":"ltr","language":"ca_ES"},{"iso":"cs","dir":"ltr","language":"cs"},{"iso":"de","dir":"ltr","language":"de"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"es","dir":"ltr","language":"es"},{"iso":"fa","dir":"rtl","language":"fa"},{"iso":"fr","dir":"ltr","language":"fr"},{"iso":"he","dir":"rtl","language":"he_IL"},{"iso":"hu","dir":"ltr","language":"hu_HU"},{"iso":"id","dir":"ltr","language":"id_ID"},{"iso":"en","dir":"ltr","language":"en"},{"iso":"it","dir":"ltr","language":"it"},{"iso":"ja","dir":"ltr","language":"ja"},{"iso":"ko","dir":"ltr","language":"ko"},{"iso":"ms","dir":"ltr","language":"ms_MY"},{"iso":"pl","dir":"ltr","language":"pl"},{"iso":"ru","dir":"ltr","language":"ru"},{"iso":"sv","dir":"ltr","language":"sv"},{"iso":"th","dir":"ltr","language":"th"},{"iso":"tr","dir":"ltr","language":"tr"},{"iso":"vi","dir":"ltr","language":"vi"},{"iso":"zh-Hans","dir":"ltr","language":"zh"},{"iso":"zh-Hant","dir":"ltr","language":"zh_TW"},{"iso":"el","dir":"ltr","language":"el"},{"iso":"nl","dir":"ltr","language":"nl_NL"},{"iso":"ro","dir":"ltr","language":"ro"}]');let i=!1;function o(){return"CL v27.005 (internal id d937bee0 @ 2024-05-07T15:20:48.667Z)"}const s=class{constructor(n){var o,s;if(this._id=`tradingview_${(1048576*(1+Math.random())|0).toString(16).substring(1)}`,this._ready=!1,this._readyHandlers=[],this._onWindowResize=this._autoResizeChart.bind(this),!n.datafeed)throw new Error("Datafeed is not defined");(null===(o=n.overrides)||void 0===o?void 0:o["mainSeriesProperties.priceAxisProperties.lockScale"])&&(console.warn("mainSeriesProperties.priceAxisProperties.lockScale can not be set to true within the widget constructor"),delete n.overrides["mainSeriesProperties.priceAxisProperties.lockScale"]),this._options=t(e,n);"dark"===(null!==(s=this._options.theme)&&void 0!==s?s:"light").toLowerCase()&&void 0===this._options.loading_screen&&(this._options.loading_screen={backgroundColor:"#131722"}),this._options.debug&&(i||(i=!0,console.log("Using CL v27.005 (internal id d937bee0 @ 2024-05-07T15:20:48.667Z)"))),this._create()}setDebugMode(t){this._innerAPI().setDebugMode(t)}onChartReady(t){this._ready?t.call(this):this._readyHandlers.push(t)}headerReady(){return this._innerWindowLoaded.then((()=>this._innerWindow().headerReady()))}onGrayedObjectClicked(t){this._doWhenInnerApiLoaded((e=>{e.onGrayedObjectClicked(t)}))}onShortcut(t,e){this._doWhenInnerWindowLoaded((n=>{n.createShortcutAction(t,e)}))}subscribe(t,e){this._doWhenInnerApiLoaded((n=>{n.subscribe(t,e)}))}unsubscribe(t,e){this._doWhenInnerApiLoaded((n=>{n.unsubscribe(t,e)}))}chart(t){return this._innerAPI().chart(t)}getLanguage(){return this._options.locale}setSymbol(t,e,n){this._innerAPI().changeSymbol(t,e,n)}remove(){window.removeEventListener("resize",this._onWindowResize),this._readyHandlers.splice(0,this._readyHandlers.length),delete window[this._id],this._iFrame.parentNode&&this._iFrame.parentNode.removeChild(this._iFrame)}closePopupsAndDialogs(){this._doWhenInnerApiLoaded((t=>{t.closePopupsAndDialogs()}))}selectLineTool(t,e){this._innerAPI().selectLineTool(t,e)}selectedLineTool(){return this._innerAPI().selectedLineTool()}save(t,e){this._innerAPI().saveChart(t,e)}load(t,e){this._innerAPI().loadChart({json:t,extendedData:e})}getSavedCharts(t){this._innerAPI().getSavedCharts(t)}loadChartFromServer(t){this._innerAPI().loadChartFromServer(t)}saveChartToServer(t,e,n){this._innerAPI().saveChartToServer(t,e,n)}removeChartFromServer(t,e){this._innerAPI().removeChartFromServer(t,e)}onContextMenu(t){this._doWhenInnerApiLoaded((e=>{e.onContextMenu(t)}))}createButton(t){return this._innerWindow().createButton(t)}createDropdown(t){return this._innerWindow().createDropdown(t)}showNoticeDialog(t){this._doWhenInnerApiLoaded((e=>{e.showNoticeDialog(t)}))}showConfirmDialog(t){this._doWhenInnerApiLoaded((e=>{e.showConfirmDialog(t)}))}showLoadChartDialog(){this._innerAPI().showLoadChartDialog()}showSaveAsChartDialog(){this._innerAPI().showSaveAsChartDialog()}symbolInterval(){return this._innerAPI().getSymbolInterval()}mainSeriesPriceFormatter(){return this._innerAPI().mainSeriesPriceFormatter()}getIntervals(){return this._innerAPI().getIntervals()}getStudiesList(){return this._innerAPI().getStudiesList()}getStudyInputs(t){return this._innerAPI().getStudyInputs(t)}getStudyStyles(t){return this._innerAPI().getStudyStyles(t)}addCustomCSSFile(t){this._innerWindow().addCustomCSSFile(t)}applyOverrides(e){this._options=t(this._options,{overrides:e}),this._doWhenInnerWindowLoaded((t=>{t.applyOverrides(e)}))}applyStudiesOverrides(t){this._doWhenInnerWindowLoaded((e=>{e.applyStudiesOverrides(t)}))}watchList(){return this._innerAPI().watchlist()}news(){return this._innerAPI().news()}widgetbar(){return this._innerAPI().widgetbar()}activeChart(){return this._innerAPI().activeChart()}activeChartIndex(){return this._innerAPI().activeChartIndex()}setActiveChart(t){return this._innerAPI().setActiveChart(t)}chartsCount(){return this._innerAPI().chartsCount()}layout(){return this._innerAPI().layout()}setLayout(t){this._innerAPI().setLayout(t)}layoutName(){return this._innerAPI().layoutName()}resetLayoutSizes(t){this._innerAPI().resetLayoutSizes(t)}changeTheme(t,e){return this._innerWindow().changeTheme(t,e)}getTheme(){return this._innerWindow().getTheme()}takeScreenshot(){this._doWhenInnerApiLoaded((t=>{t.takeScreenshot()}))}lockAllDrawingTools(){return this._innerAPI().lockAllDrawingTools()}hideAllDrawingTools(){return this._innerAPI().hideAllDrawingTools()}drawOnAllChartsEnabled(){return this._innerAPI().drawOnAllChartsEnabled()}drawOnAllCharts(t){this._innerAPI().drawOnAllCharts(t)}magnetEnabled(){return this._innerAPI().magnetEnabled()}magnetMode(){return this._innerAPI().magnetMode()}undoRedoState(){return this._innerAPI().undoRedoState()}setIntervalLinkingEnabled(t){this._innerAPI().setIntervalLinkingEnabled(t)}setDateRangeLinkingEnabled(t){this._innerAPI().setDateRangeLinkingEnabled(t)}setTimeFrame(t){this._innerAPI().setTimeFrame(t)}symbolSync(){return this._innerAPI().symbolSync()}intervalSync(){return this._innerAPI().intervalSync()}crosshairSync(){return this._innerAPI().crosshairSync()}timeSync(){return this._innerAPI().timeSync()}dateRangeSync(){return this._innerAPI().dateRangeSync()}setFeatureEnabled(t,e){this._innerAPI().setFeatureEnabled(t,e)}getAllFeatures(){return this._innerWindow().getAllFeatures()}clearUndoHistory(){return this._innerAPI().clearUndoHistory()}undo(){return this._innerAPI().undo()}redo(){return this._innerAPI().redo()}startFullscreen(){this._innerAPI().startFullscreen()}exitFullscreen(){this._innerAPI().exitFullscreen()}takeClientScreenshot(t){return this._innerAPI().takeClientScreenshot(t)}navigationButtonsVisibility(){return this._innerWindow().getNavigationButtonsVisibility()}paneButtonsVisibility(){return this._innerWindow().getPaneButtonsVisibility()}dateFormat(){return this._innerWindow().getDateFormat()}timeHoursFormat(){return this._innerWindow().getTimeHoursFormat()}currencyAndUnitVisibility(){return this._innerWindow().getCurrencyAndUnitVisibility()}supportedChartTypes(){return this._innerAPI().supportedChartTypes()}watermark(){return this._innerAPI().watermark()}customSymbolStatus(){return this._innerWindow().customSymbolStatus()}setCSSCustomProperty(t,e){if(!1===t.startsWith("--"))throw new Error("customPropertyName should begin with a double hyphen");this._innerWindow().document.body.style.setProperty(t,e)}getCSSCustomPropertyValue(t){if(!1===t.startsWith("--"))throw new Error("customPropertyName should begin with a double hyphen");const e=this._innerWindow().document.body,n=e.style.getPropertyValue(t);if(n)return n;return getComputedStyle(e).getPropertyValue(t)}unloadUnusedCharts(){this._innerAPI().unloadUnusedCharts()}linking(){return this._innerAPI().linking}_innerAPI(){return this._innerWindow().tradingViewApi}_innerWindow(){return this._iFrame.contentWindow}_doWhenInnerWindowLoaded(t){this._ready?t(this._innerWindow()):this._innerWindowLoaded.then((()=>{t(this._innerWindow())}))}_doWhenInnerApiLoaded(t){this._doWhenInnerWindowLoaded((e=>{e.doWhenApiIsReady((()=>t(this._innerAPI())))}))}_autoResizeChart(){this._options.fullscreen&&(this._iFrame.style.height=window.innerHeight+"px",r&&setTimeout((()=>{this._iFrame.style.height=window.innerHeight+"px"}),30))}_create(){var t,e;const n=null!==(e=null===(t=this._options.enabled_features)||void 0===t?void 0:t.includes("iframe_loading_compatibility_mode"))&&void 0!==e&&e,[i,o]=this._render(!n),s=this._options.container,r="string"==typeof s?document.getElementById(s):s;if(null===r)throw new Error(`There is no such element - #${this._options.container}`);r.innerHTML=i,this._iFrame=r.querySelector(`#${this._id}`);const a=this._iFrame;this._innerWindowLoaded=new Promise((t=>{const e=()=>{a.removeEventListener("load",e,!1),t()};a.addEventListener("load",e,!1)})),n&&(a.contentWindow?(a.contentWindow.document.open(),a.contentWindow.document.write(o),a.contentWindow.document.close()):console.warn("Unable to locate contentWindow for the created iframe. Please try disabling the `iframe_loading_compatibility_mode` featureset.")),(this._options.autosize||this._options.fullscreen)&&(a.style.width="100%",this._options.fullscreen||(a.style.height="100%")),window.addEventListener("resize",this._onWindowResize),this._onWindowResize(),this._innerWindowLoaded.then((()=>{try{this._innerWindow().widgetReady((()=>{this._ready=!0;for(const t of this._readyHandlers)try{t.call(this)}catch(t){console.error(t)}this._innerWindow().initializationFinished()}))}catch(t){if(t instanceof Error&&/widgetReady is not a function/.test(t.message))throw new Error(`There was an error when loading the library. Usually this error means the library failed to load its static files. Check that the library files are available at ${window.location.host}/${this._options.library_path||""} or correct the library_path option.`)}}))}_render(t){const e=window;if(e[this._id]={datafeed:this._options.datafeed,customFormatters:this._options.custom_formatters,brokerFactory:this._options.broker_factory,overrides:this._options.overrides,studiesOverrides:this._options.studies_overrides,tradingCustomization:this._options.trading_customization,disabledFeatures:this._options.disabled_features,enabledFeatures:this._options.enabled_features,brokerConfig:this._options.broker_config||this._options.brokerConfig,restConfig:this._options.restConfig,favorites:this._options.favorites,logo:this._options.logo,numeric_formatting:this._options.numeric_formatting,rss_news_feed:this._options.rss_news_feed,rss_news_title:this._options.rss_news_title,newsProvider:this._options.news_provider,loadLastChart:this._options.load_last_chart,saveLoadAdapter:this._options.save_load_adapter,loading_screen:this._options.loading_screen,settingsAdapter:this._options.settings_adapter,getCustomIndicators:this._options.custom_indicators_getter,additionalSymbolInfoFields:this._options.additional_symbol_info_fields,headerWidgetButtonsMode:this._options.header_widget_buttons_mode,customTranslateFunction:this._options.custom_translate_function,symbolSearchComplete:this._options.symbol_search_complete,contextMenu:this._options.context_menu,settingsOverrides:this._options.settings_overrides,timeframe:this._options.timeframe,customTimezones:this._options.custom_timezones,customChartDescriptionFunction:this._options.custom_chart_description_function},this._options.saved_data)e[this._id].chartContent={json:this._options.saved_data},this._options.saved_data_meta_info&&(e[this._id].chartContentExtendedData=this._options.saved_data_meta_info);else if(!this._options.load_last_chart&&!this._options.symbol)throw new Error("Symbol is not defined: either 'symbol' or 'load_last_chart' option must be set");if(this._options.library_path&&!this._options.library_path.endsWith("/")&&console.warn("library_path option should contain a trailing forward slash"),this._options.locale){const t=encodeURIComponent(this._options.locale);n.findIndex((e=>e.language===t))>=0||(console.warn("locale isn't supported. Using default of `en`."),this._options.locale="en")}const i=function(t,e){var i;const o=new URL(`${t||""}`,location.href).href,s=JSON.parse('["bundles/runtime.1f6691a05496db116913.js","bundles/__LANG__.4716.e4ac74dfc9ec5374b00c.js","bundles/6150.bda60280b05cea478076.css","bundles/5142.2c34c8656148cc5203b7.js","bundles/library.53d7b371803f8096a4cd.js"]'),r=encodeURIComponent(e),a=null!==(i=n.find((t=>t.language===r)))&&void 0!==i?i:{iso:"en",dir:"ltr"},d=`lang="${a.iso}" dir="${a.dir}"`,l=`\n${function(t,e,n){if(void 0===t)return"";const i=[],o=[];for(const s of t)s.endsWith(".js")?i.push(`