(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7123],{818142:e=>{e.exports={}},517806:(e,t,n)=>{"use strict";function s(e,t,n){return Math.min(Math.max(e,t),n)}function i(e){return e>0?Math.floor(e):Math.ceil(e)}function o(e){return e%2==0}n.d(t,{clamp:()=>s,isEven:()=>o,toInt:()=>i})},478316:(e,t,n)=>{"use strict";n.d(t,{disable:()=>d,enable:()=>l,enabled:()=>a});var s=n(527665);const i=new Map,o=new Map,r=new Set;function a(e){const t=i.get(e);if(void 0!==t)return t;const n=o.get(e);return!!n&&n.some(a)}function c(e,t){i.set(String(e),Boolean(t))}function l(e){c(e,!0)}function d(e){c(e,!1)}!function(){for(const[e,t]of Object.entries(s))if(r.add(e),"subsets"in t)for(const n of t.subsets){r.add(n);let t=o.get(n);void 0===t&&(t=[],o.set(n,t)),t.push(e)}}()},86464:(e,t,n)=>{"use strict";n.d(t,{SEPARATOR_PREFIX:()=>s});const s="###"},835537:(e,t,n)=>{"use strict";n.d(t,{t:()=>s});const s=n.i18next},323140:(e,t,n)=>{"use strict";function s(e){const t=function(e){if(void 0===e)return null;const t=e.match(/(delayed_streaming)_(\d+)/);return null===t?null:{mode:t[1],interval:parseInt(t[2])}}(e.update_mode);return null===t||(e.update_mode=t.mode,e.update_mode_seconds=t.interval),e}n.d(t,{normalizeUpdateMode:()=>s})},798027:(e,t,n)=>{"use strict";function s(e,t){return e&&e.utm_campaign&&(e.utm_campaign+=`-${t}`),e}async function i(e,t,s,i){if("lentaru"===e){const{getLentaCopyrightData:e}=await Promise.all([n.e(19696),n.e(85038)]).then(n.bind(n,933103));return e()}if("cmoneycomtw"===e){const{getCmoneycomtwCopyrightData:e}=await Promise.all([n.e(21648),n.e(40008),n.e(71394)]).then(n.bind(n,11711));return e(t,s)}if("new"===i){const{getTradingViewCopyrightData:e}=await Promise.all([n.e(76256),n.e(76040)]).then(n.bind(n,152659));return e(t,s)}if("with_border"===i){const{getTradingViewCopyrightData:e}=await Promise.all([n.e(20868),n.e(16813)]).then(n.bind(n,167595));return e(t,s)}if("large_trade"===i){const{getTradingViewCopyrightData:e}=await Promise.all([n.e(23714),n.e(79041)]).then(n.bind(n,783613));return e(t,s)}{const{getTradingViewCopyrightData:e}=await Promise.all([n.e(21648),n.e(97509)]).then(n.bind(n,599695));return e(t,s)}}n.d(t,{addUtmCampaignSource:()=>s,getCustomerCopyrightData:()=>i})},127376:(e,t,n)=>{"use strict";n.d(t,{getWidgetSheriffActions:()=>l});var s=n(77357),i=n(131890),o=n(302986);const r=window.WIDGET_SHERIFF_HOST||"https://widget-sheriff.xstaging-widget.tv",a=(0,s.getLogger)("WidgetSheriff.Widget");let c=null;async function l(){return null===c&&(c=await async function(){const e=function(){if(document.location.ancestorOrigins&&document.location.ancestorOrigins.length)return document.location.ancestorOrigins[document.location.ancestorOrigins.length-1];try{return new URL(document.referrer).origin}catch(e){return document.location.origin||null}}();if(null===e)return a.logWarn("ancestorOrigin is undefined"),Promise.resolve([]);const t=new URL("/sheriff/api/v1/rules/search",r);t.searchParams.append("origin",e);return(await(0,i.fetch)(t.toJSON()).then((e=>{
if(!e.ok)throw new Error("Guard request error occured");return 204===e.status?Promise.resolve({actions:[]}):e.json()})).catch((e=>(a.logWarn(e.message),Promise.resolve({actions:[]}))))).actions.filter((e=>o.widgetSheriffActions.has(e)))}()),Promise.resolve(c)}},939758:(e,t,n)=>{"use strict";n.d(t,{createEmbedWidgetWrapper:()=>c});var s=n(185842),i=n(127376),o=n(323219),r=n(798027),a=n(302986);function c(e,t,n,c={}){if(null===e.parentElement)return console.warn("Can not wrap 'elWidgetContainer' because it has no parentElement"),e;let l=null,d=document.querySelector(".js-embed-widget-body");const u=null!==d;if(u){d=(0,s.ensureNotNull)(d),l=(0,s.ensureNotNull)(d.parentElement);let e=document.querySelector(".js-embed-widget-head");null===e&&(e=document.createElement("div"),e.classList.add("tv-embed-widget-wrapper__header"),e.classList.add("js-embed-widget-head"),l.insertBefore(e,d))}else l=document.createElement("div"),l.classList.add("tv-embed-widget-wrapper"),l.innerHTML='
',d=l.querySelector(".js-embed-widget-body");if(c.overflowAuto&&d.classList.add("tv-embed-widget-wrapper__body--overflow_auto"),c.showBorderOnTransparent&&d.classList.add("tv-embed-widget-wrapper__body--border-on-transparent"),!c.isWhiteLabel){!async function(e,t,n,c,l={}){const d=l.isSheriffDisabled?[]:await(0,i.getWidgetSheriffActions)(),u=d.includes(a.KnownAction.LargeTradeLogo),h=function(e){return["crypto-coins-heatmap","forex-cross-rates","market-overview","symbol-overview","market-quotes","stock-heatmap","screener","forex-heat-map","crypto-mkt-screener","events","hotlists"].includes(e)}(t),m=u&&h?"large_trade":void 0,_=await(0,r.getCustomerCopyrightData)(l.customer,l.locale,(0,r.addUtmCampaignSource)({...c},"logo"),m),g=m??l.copyrightOptions?.mode??"small_old";(0,s.ensureNotNull)(e).appendChild((0,o.createCopyrightLabel)({sheriffOptions:d,snapToEdge:n,...l.copyrightOptions,..._,mode:g}))}(d,t,!document.documentElement.classList.contains("is-transparent")||Boolean(c.showBorderOnTransparent),n,c)}return u||(e.parentElement.insertBefore(l,e),d.appendChild(e)),e}},587347:(e,t,n)=>{"use strict";n.d(t,{createEmbedWidgetWrapper:()=>s.createEmbedWidgetWrapper});n(818142);var s=n(939758)},537244:(e,t,n)=>{"use strict";n.d(t,{enabled:()=>a,getConfig:()=>l});n(185842);var s=n(233938),i=n(663750),o=n(376596),r=n(641077);function a(e,t,n){let s=window.user;n&&(s=n);const i=l(e,t,s);if(!i)return!1;if(i.disable_on_trial&&(!s||s.is_trial))return!1;const r=i.disable_on_lite_plan;if(r&&s.is_lite_plan){if("all"===r)return!1;if("exclude_mobile"===r&&!o.CheckMobile.any())return!1}return!0}function c(e){const t=s[e];return t?t.extends?Object.assign({},c(t.extends),t):t:null}function l(e,t,n){let s=c(t||(function(e){let t=window.user;"undefined"!=typeof window&&window.user&&(t=window.user),e&&(t=e);let n=t?.pro_plan||"free";return"free"!==n&&!(0,r.isTrialProduct)(n)||(n=(0,r.getProductForTrial)(n)),n}(n)??""));if(!s)return null
;const o=window.TradingView?.widgetCustomer;return o&&i[o]&&(s=Object.assign({},s,i[o])),s&&s[e]||null}},266150:(e,t,n)=>{"use strict";n.d(t,{isFeaturesetEnabled:()=>s.enabled});var s=n(478316);"object"==typeof __initialDisabledFeaturesets&&Array.isArray(__initialDisabledFeaturesets)&&__initialDisabledFeaturesets.forEach(s.disable),"object"==typeof __initialEnabledFeaturesets&&Array.isArray(__initialEnabledFeaturesets)&&__initialEnabledFeaturesets.forEach(s.enable)},788312:(e,t,n)=>{"use strict";n.d(t,{isFeatureEnabled:()=>d});var s=n(724226),i=n(875500),o=n(276978);n(376596);const r=new i.Delegate,a="forcefeaturetoggle.";const c=new class{enableFeature(e){s.TVLocalStorage.setItem(a+e,"true"),r.fire(e)}disableFeature(e){s.TVLocalStorage.setItem(a+e,"false"),r.fire(e)}resetFeature(e){s.TVLocalStorage.removeItem(a+e),r.fire(e)}onFeaturesStateChanged(){return r}};function l(e,t){return(!e[t]||-1!==e[t])&&(!!("true"===s.TVLocalStorage.getItem(a+t)||window.is_authenticated&&"true"===window.user?.settings?.[a+t])||!("false"===s.TVLocalStorage.getItem(a+t)||window.is_authenticated&&"false"===window.user?.settings?.[a+t])&&(!!e[t]&&(1===e[t]||(0,o.shouldAffectUser)(t,e[t]))))}window.TradingView=window.TradingView||{},window.TradingView.FeatureToggle=c;const d=(u=window.featureToggleState||{},window.TradingView.onWidget?.()||Promise.all([n.e(26395),n.e(13993)]).then(n.bind(n,726395)).then((e=>{e.pushStreamMultiplexer.on("featuretoggle",(e=>{const t=l(u,e.name);u[e.name]=e.state,t!==l(u,e.name)&&r.fire(e.name)}))})),l.bind(null,u));var u;window.TradingView.isFeatureEnabled=d},598944:(e,t,n)=>{"use strict";n.d(t,{getInitData:()=>i});n(185842);(0,n(77357).getLogger)("Common.InitData");const s=window.initData||{};function i(){return s}},724226:(e,t,n)=>{"use strict";const{getLogger:s}=n(77357),i=s("TVLocalStorage");var o=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(e){delete this.isAvailable,delete this.localStorage}this._updateLength();try{this._report()}catch(e){}};o.prototype._report=function(){if(this.isAvailable){const e=10,t=[];for(let e=0;et.length-e.length));const n=t.slice(0,e);t.sort(((e,t)=>t.key.length-e.key.length));const s=t.slice(0,e);i.logNormal(`Total amount of keys in Local Storage: ${this.length}`),i.logNormal(`Top ${e} keys with longest values: ${JSON.stringify(n)}`),i.logNormal(`Top ${e} longest key names: ${JSON.stringify(s)}`);try{navigator.storage.estimate().then((e=>{i.logNormal(`Storage estimate: ${JSON.stringify(e)}`)}))}catch(e){}}},o.prototype.length=0,o.prototype.isAvailable=!1,o.prototype.localStorage={"tvlocalstorage.available":"false"},o.prototype._updateLength=function(){if(this.isAvailable)this.length=this.localStorage.length;else{var e,t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},o.prototype.key=function(e){
return this.isAvailable?this.localStorage.key(e):Object.keys(this.localStorage)[e]},o.prototype.getItem=function(e){return this.isAvailable?this.localStorage.getItem(e):void 0===this.localStorage[e]?null:this.localStorage[e]},o.prototype.setItem=function(e,t){this.isAvailable?this.localStorage.setItem(e,t):this.localStorage[e]=t,this._updateLength()},o.prototype.removeItem=function(e){this.isAvailable?this.localStorage.removeItem(e):delete this.localStorage[e],this._updateLength()},o.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},window.TVLocalStorage=new o,e.exports.TVLocalStorage=window.TVLocalStorage},795491:(e,t,n)=>{"use strict";n.d(t,{LogoSize:()=>s,getLogoUrlResolver:()=>c});var s,i=n(185842),o=n(598944);!function(e){e[e.Medium=0]="Medium",e[e.Large=1]="Large"}(s||(s={}));class r{constructor(e){(0,i.assert)(""!==e,"S3 base url must be a non-empty string"),this._baseUrl=e}getSymbolLogoUrl(e,t){switch((0,i.assert)(""!==e,"logo id must be a non-empty string"),t){case s.Medium:return this._baseUrl+`${e}.svg`;case s.Large:return this._baseUrl+`${e}--big.svg`}}collectSymbolLogoUrls(e,t){const{logoId:n,baseCurrencyLogoId:s,currencyLogoId:i,dexCurrencyLogoId:o}=e;if(n)return[this.getSymbolLogoUrl(n,t)];const r=[];if(s&&r.push(this.getSymbolLogoUrl(s,t)),o?r.push(this.getSymbolLogoUrl(o,t)):i&&r.push(this.getSymbolLogoUrl(i,t)),r.length<2)return r;const a=r.some(l),c=r.every((e=>!e.includes("country")||l(e)));return a&&c?r.filter((e=>!l(e))):r;function l(e){return e.includes("country/US")}}getCountryFlagUrl(e,t){return this.getSymbolLogoUrl("country/"+e,t)}getCryptoLogoUrl(e,t){return this.getSymbolLogoUrl("crypto/"+e,t)}getProviderLogoUrl(e,t){return this.getSymbolLogoUrl("provider/"+e,t)}getSourceLogoUrl(e,t){return this.getSymbolLogoUrl("source/"+e,t)}getBlockchainContractLogoUrl(e,t){return this.getSymbolLogoUrl("blockchain/"+e,t)}}let a;function c(){return function(){if(!a){const e=(0,o.getInitData)(),t=e.settings?e.settings.S3_LOGO_SERVICE_BASE_URL:"";a=new r(t)}return a}()}},702203:(e,t,n)=>{"use strict";n.d(t,{isOnMobileAppPage:()=>i});var s=n(648567);function i(e,t=!1){const{searchParams:n}=new URL(String(location));let i="true"===n.get("mobileapp_new"),o="true"===n.get("mobileapp");if(!t){const e=s.get("tv_app")||"";i||=["android","android_nps"].includes(e),o||="ios"===e}return!("new"!==e&&"any"!==e||!i)||!("new"===e||!o)}},503888:(e,t,n)=>{"use strict";async function s(){const e=(await Promise.all([n.e(70644),n.e(66224),n.e(19886)]).then(n.bind(n,237529))).getTrackerInstance();return e||null}n.d(t,{getEmbedWidgetTracker:()=>s})},276978:(e,t,n)=>{"use strict";n.d(t,{shouldAffectUser:()=>c});var s=n(100595),i=n.n(s),o=n(724226);const r="featuretoggle_seed";function a(e){try{const t=i()(e+function(){if(window.user&&window.user.id)return window.user.id;const e=o.TVLocalStorage.getItem(r);if(null!==e)return e;const t=Math.floor(1e6*Math.random());return o.TVLocalStorage.setItem(r,`${t}`),t}()),n=new DataView(t);return n.getUint32(0,!0)/4294967296
}catch(e){return.5}}function c(e,t){return a(e)<=t}},298147:(e,t,n)=>{"use strict";function s(e){return void 0!==e&&e.includes("crypto")}n.d(t,{hasCryptoTypespec:()=>s})},474422:(e,t,n)=>{"use strict";async function s(e,t){const s=await Promise.all([n.e(28831),n.e(64116),n.e(57032),n.e(98115),n.e(46970),n.e(50865),n.e(48072),n.e(63665),n.e(74528),n.e(5709),n.e(15365),n.e(18257),n.e(48011),n.e(44589),n.e(75649),n.e(26729),n.e(25947),n.e(49515),n.e(11644),n.e(78399),n.e(69631),n.e(41819),n.e(85294),n.e(80915),n.e(1534),n.e(99331),n.e(66277),n.e(5553),n.e(13925),n.e(42706)]).then(n.bind(n,610319));return s.showSimpleDialog(e,s.warningModule,t)}n.d(t,{showWarning:()=>s})},10665:(e,t,n)=>{"use strict";function s(e,t,n={}){return Object.assign({},e,function(e,t,n={}){const s=Object.assign({},t);for(const i of Object.keys(t)){const o=n[i]||i;o in e&&(s[i]=[e[o],t[i]].join(" "))}return s}(e,t,n))}n.d(t,{mergeThemes:()=>s})},780927:(e,t,n)=>{"use strict";var s=n(436492),i=n(88434),o=n(385955),r=n(393418),a=n(750586),c=n(415155),l=n(185842),d=n(77357),u=n(524257),h=n(266150),m=n(350710),_=n(229321),g=n(453843),p=n(409758),f=n(661858),w=n(131890),y=n(813915),b=n(222993),v=n(244007),S=n(342264),C=n(537244),k=n(788312),M=n(795491),R=n(702203),T=n(254236),N=n(517806),L=n(168509),q=n(702),D=n(868971),I=n(797315),P=n(998963);const E=(0,d.getLogger)("Chart.Studies.StudyMetaInfoRepository",{color:"#606"}),O=(0,d.getLogger)("ChartApi.TrafficMeter",{maxCount:20,color:"#268"}),F=(0,d.getLogger)("ChartApi.Core",{color:"#706"}),A=(0,d.getLogger)("ChartApi.ChartSession",{color:"#706"}),x=(0,d.getLogger)("ChartApi.ChartSession",{highRate:!0,maxCount:100,color:"#706"}),U=(0,d.getLogger)("ChartApi.ChartSession",{maxCount:0,color:"#706"}),H=(0,d.getLogger)("ChartApi.ChartSession",{maxCount:50,color:"#706"}),B=(0,d.getLogger)("ChartApi.QuoteSession",{maxCount:50,color:"#660"}),V=(0,d.getLogger)("ChartApi.QuoteSession",{highRate:!0,maxCount:10,color:"#660"}),W=!(0,R.isOnMobileAppPage)("any"),$=(0,k.isFeatureEnabled)("broker_id_session");let j=!1,Q=!1,G=!1;const z=["","KB","MB","GB","TB"];function J(e){if(0===e)return"0";const t=(0,N.toInt)(Math.floor(Math.log(e)/Math.log(1024)));return(e/Math.pow(1024,t)).toFixed(2)+z[t]}function Y(e,t){return`${e}__${t}`}function K(e,t,n){const s=t[n]??0;t[n]=s+e}const X=K.bind(null,1),Z=K.bind(null,-1),ee=(0,h.isFeaturesetEnabled)("widget")?"studies_metadata_widget":"studies_metadata",te="/chart-api/pro_hash",ne=(0,h.isFeaturesetEnabled)("widget")?"/chart-api/studies_metadata_widget":"/chart-api/studies_metadata";function se(e){if(null===e)return"";if("period-back"===e.type){let t=e.value;return"YTD"!==t&&"D"===t.slice(-1)&&(t=t.slice(0,-1)),t}return"r,"+e.from+":"+e.to}let ie=null;function oe(){if(null===ie){const e=document.querySelector('link[rel~="conversions-config"]'),t=new URL((0,l.ensureNotNull)(e).href);ie=(0,w.fetch)(t.toString(),{method:"GET"}).then((e=>{if(!e.ok)throw new Error("Response status is not success");return e.json()})).then((e=>{const t=(0,M.getLogoUrlResolver)()
;return e.currencies.forEach((e=>{void 0!==e.logoid&&(e.logoUrl=t.getSymbolLogoUrl(e.logoid,M.LogoSize.Medium))})),e}))}return ie}let re=null;class ae{constructor(e){this.sessionid=null,this._banInfo=new L.WatchedValue(null),this._isAuthTokenLoaded=!1,this._authTokenDfd=null,this._serverTimeBasePoint=Date.now()-performance.now(),this._initCachePromise=(0,S.createCache)("TVChartApi"),this._trafficStats={total:0,sinceConnect:0,lastChunk:0},this._lowQualityEnabled=!1,this._brokerId="",this._sendingQueuedRequestsCount=0,this._modifyStudyMap=new Map,this._disconnectCount=0,this._isConnected=!1,this._metadataDeferredPromise=null,this._dataHandleModule=new I.JSONDataHandler,this._sessions={},this._notificationHandlers={},this._pendingMessagesQueue=[],this._loadNewBars=!1,this._metadataRequestNextNumber=1,this._fundamentalCounter={},this._studyCounter={},this._childStudyCounter={},this._studySpecs=new Map,this._connectionsLimitReached=new L.WatchedValue(!1),this._sentMethodsCounters=new Map,this._receivedMethodsCounters=new Map,this._requestDataProblemsPromise=null,this._wsBackendConnection=e,this._wsBackendConnection.onReconnect(this._bindSocketEvents.bind(this)),this._wsBackendConnection.setLogger(F,d.getLogHistory),this._wsBackendConnection.setTelemetry(T.telemetry),this._bindSocketEvents(),this._isNonCountedStudy=()=>!0,window?.TradingView?.onChartPage||this._enableLowQualityMode(),setInterval((()=>{O.logNormal("Last 30 seconds:"+J(this._trafficStats.lastChunk)+" Since last connect:"+J(this._trafficStats.sinceConnect)+" Total traffic:"+J(this._trafficStats.total)),this._trafficStats.lastChunk=0}),3e4),this._connectionsLimitReached.subscribe((e=>{e&&this.disconnect()}))}connect(e){this._connectOnlyOptions=e,this._wsBackendConnection.isConnected()||this._wsBackendConnection.isConnecting()||this._wsBackendConnection.connect()}disconnect(){this._wsBackendConnection.disconnect()}sentMethodsCounters(){return this._sentMethodsCounters}receivedMethodsCounters(){return this._receivedMethodsCounters}defaultResolutions(){return(0,_.getDefaultResolutions)()}availableCurrencies(){return oe().then((e=>e.currencies))}availableUnits(){return oe().then((e=>{const t={};for(const n of e.units)t[n.type]||(t[n.type]=[]),t[n.type].push(n);return t}))}async availableMetrics(){return function(){if(null===re){const e=document.querySelector('link[rel~="metrics-config"]'),t=new URL((0,l.ensureNotNull)(e).href);re=(0,w.fetch)(t.toString(),{method:"GET"}).then((async e=>{if(!e.ok)throw new Error("Response status is not success");const t=await e.json();return t.metrics_full_name?.forEach((e=>{const n=t.metrics.find((t=>t.id===e.id));n&&(n.description=e.name)})),t}))}return re}().then((e=>e.metrics))}availablePriceSources(){return Promise.resolve([])}supportedSymbolsTypes(){const e=window.TradingView?.widgetCustomer??"";return"bovespa"===e?f.filter((e=>["","stock","futures","index"].includes(e.value))):"cme"===e?f.filter((e=>e.value!==g.types.QUANDL)):f}symbolsGrouping(){return{futures:/^(.+?)([12]!|\w\d{4})?$/}}connected(){return!!this._isConnected}
authTokenManager(){return(0,l.ensureDefined)(this._authTokenManager)}createSession(e,t){this._sessions[e]=t,this._notificationHandlers[e]={},this.connected()&&this._isAuthTokenLoaded&&t.onMessage({method:u.ChartApiMessageMethod.Connected,params:[]})}removeSession(e){delete this._sessions[e],delete this._notificationHandlers[e]}disconnectCount(){return this._disconnectCount||0}getPingInfo(){return this._wsBackendConnection.getPingInfo()}connectionBanInfo(){return this._banInfo.readonly()}connectionsLimitReached(){return this._connectionsLimitReached.readonly()}serverTime(){return Math.round(this._serverTimeBasePoint+performance.now())}compensateConnectionLag(e){const t=this.serverTime(),n=Math.floor(e-t);n>0&&(this._serverTimeBasePoint+=n)}setBroker(e){return e===this._brokerId||(this._brokerId=e,this._sendBrokerIdToSession(this._brokerId))}chartCreateSession(e,t){return this._sendRequest("chart_create_session",[e,t])}chartDeleteSession(e){return this._sendRequest("chart_delete_session",[e])}switchTimezone(e,t){return this._sendRequest("switch_timezone",[e,t])}resolveSymbol(e,t,n,s){return T.telemetry.timeCounters.series["resolve_symbol_"+e]=window.performance.now(),this._notificationHandlers[e][t]=new P.HandlerInfo(s,t,!0),this._sendRequest("resolve_symbol",[e,t,n])}requestFirstBarTime(e,t,n,s){return this._notificationHandlers[e][t]=new P.HandlerInfo(s,t,!0),this._sendRequest("get_first_bar_time",[e,t,n])}createSeries(e,t,n,s,i,o,r,a){T.telemetry.timeCounters.series.marks.push("create_series_"+e),this._notificationHandlers[e][t]=new P.HandlerInfo(a,t);const c=se(r);return this._sendRequest("create_series",[e,t,n,s,i,o,c])}removeSeries(e,t){return delete this._notificationHandlers[e][t],this._sendRequest("remove_series",[e,t])}modifySeries(e,t,n,s,i,o,r,a){this._notificationHandlers[e][t]=new P.HandlerInfo(a,t);const c=se(r);return this._sendRequest("modify_series",[e,t,n,s,i,c])}getStudyCounter(e){return this._studyCounter[e]??0}getFundamentalCounter(e){return this._fundamentalCounter[e]??0}getChildStudyCounter(e){return this._childStudyCounter[e]??0}requestMoreData(e,t,n,s){if(void 0===n||void 0===s)throw new Error("unsupported request to load more data, bars="+n);const i=t;return this._notificationHandlers[e][i]=new P.HandlerInfo(s,i),this._sendRequest("request_more_data",[e,i,n])}requestMoreTickmarks(e,t,n,s){return s&&(this._notificationHandlers[e][t]=new P.HandlerInfo(s,t)),this._sendRequest("request_more_tickmarks",[e,t,n])}setFutureTickmarksMode(e,t){this._sendRequest("set_future_tickmarks_mode",[e,t])}requestDataProblems(){return this._requestDataProblemsPromise||(this._requestDataProblemsPromise=this.connectDfd.then((()=>new Promise(((e,t)=>{this._onDataProblemsPromiseErrback=t,this._sendRequest("request_data_problems",[])?this._onDataProblemsPromiseCb=e:t()})))).finally((()=>{this._requestDataProblemsPromise=null}))),this._requestDataProblemsPromise}async requestMetadata(){return null===this._metadataDeferredPromise&&(this._metadataDeferredPromise=(0,b.createDeferredPromise)(),
this._metadataDeferredPromise.promise.finally((()=>{this._metadataDeferredPromise=null})),this._requestMetadata()),this._metadataDeferredPromise.promise}allStudiesMetadata(){throw new Error("This method is not implemented")}setLoadNew(e){this._loadNewBars=!!e}setIsNonCountedStudyFn(e){this._isNonCountedStudy=e}canCreateStudy(e,t,n){const{id:s,child:i,fundamental:o}=t,r=(0,l.ensureNotNull)((0,C.getConfig)("STUDY_ON_STUDY")).child_limit;if(i&&(!(0,C.enabled)("STUDY_ON_STUDY")||(this._childStudyCounter[e]??0)>=r))return{success:!1,reason:"child",limitValue:r};if(n)return{success:!0};const a=(0,l.ensureNotNull)((0,C.getConfig)("FUNDAMENTALS_ON_CHART")).limit;if(o&&(!(0,C.enabled)("FUNDAMENTALS_ON_CHART")||this.getFundamentalCounter(e)>=a))return{success:!1,reason:"fundamental",limitValue:a};const c=(0,l.ensureNotNull)((0,C.getConfig)("INDICATORS_ON_CHART")).limit;return o||this._isNonCountedStudy(s)||(0,C.enabled)("INDICATORS_ON_CHART")&&!(this.getStudyCounter(e)>=c)?{success:!0}:{success:!1,reason:"general",limitValue:c}}createStudy(e,t,n,s,i,o,r,a){const c=this.canCreateStudy(e,a);return c.success||"child"!==c.reason?(this._notificationHandlers[e][t]=new P.HandlerInfo(r,t),this._sendRequest("create_study",[e,t,n,s,i,o]),a.fundamental?X(this._fundamentalCounter,e):this._isNonCountedStudy(a.id)||X(this._studyCounter,e),a.child&&X(this._childStudyCounter,e),this._studySpecs.set(Y(e,t),a),!0):((0,y.showTooManyStudiesNotice)(c.limitValue),!1)}modifyStudy(e,t,n,s,o,r){K(r=r??0,this._childStudyCounter,e),0!==r&&((0,l.ensureDefined)(this._studySpecs.get(Y(e,t))).child=r>0),this._notificationHandlers[e][t]=new P.HandlerInfo(o,t);const a=e+t;if(this._modifyStudyMap.has(a)){return(0,l.ensureDefined)(this._modifyStudyMap.get(a))(e,t,n,s)??!0}{const o=(0,i.default)(((e,t,n,s)=>this._sendRequest("modify_study",[e,t,n,s])),500,{maxWait:550});return this._modifyStudyMap.set(a,o),o(e,t,n,s)??!0}}notifyStudy(e,t,n,s){return F.logNormal(`Send notify_study, [${e}, ${t}, ${n}, ${JSON.stringify(s)}]`),this._sendRequest("notify_study",[e,t,n,JSON.stringify(s)])}removeStudy(e,t){const n=e+t;delete this._notificationHandlers[e][t],this._modifyStudyMap.get(n)?.flush();const s=this._sendRequest("remove_study",[e,t]);if(!1===s)return!1;this._modifyStudyMap.delete(n);const i=Y(e,t),o=(0,l.ensureDefined)(this._studySpecs.get(i));return this._studySpecs.delete(i),o.fundamental?Z(this._fundamentalCounter,e):this._isNonCountedStudy(o.id)||Z(this._studyCounter,e),o.child&&Z(this._childStudyCounter,e),s}createPointset(e,t,n,s,i,o,r){return this._notificationHandlers[e][t]=new P.HandlerInfo(r,t),this._sendRequest("create_pointset",[e,t,n,s,i,o])}modifyPointset(e,t,n,s,i){return this._notificationHandlers[e][t]=new P.HandlerInfo(i,t),this._sendRequest("modify_pointset",[e,t,n,s])}removePointset(e,t){return delete this._notificationHandlers[e][t],this._sendRequest("remove_pointset",[e,t])}getMarks(e,t,n,s,i){throw Error("This method is not implemented")}getTimescaleMarks(e,t,n,s,i){throw Error("This method is not implemented")}quoteCreateSession(e){
return this._sendRequest("quote_create_session",[e])}quoteDeleteSession(e){return this._sendRequest("quote_delete_session",[e])}quoteAddSymbols(e,t){return this._sendRequest("quote_add_symbols",[e,t])}quoteRemoveSymbols(e,t){return this._sendRequest("quote_remove_symbols",[e,t])}quoteFastSymbols(e,t){return this._sendRequest("quote_fast_symbols",[e,t])}quoteSetFields(e,t){return this._sendRequest("quote_set_fields",[e,t])}quoteHibernateAll(e){return this._sendRequest("quote_hibernate_all",[e])}depthCreateSession(e,t,n){return this._sendRequest("depth_create_session",[e,t,n])}depthDeleteSession(e){return this._sendRequest("depth_delete_session",[e])}depthSetSymbol(e,t){return this._sendRequest("depth_set_symbol",[e,t])}depthClearSymbol(e){return this._sendRequest("depth_clear_symbol",[e])}depthSetScale(e,t){return this._sendRequest("depth_set_scale",[e,t])}unpack(e){return this._dataHandleModule.unpack(e)}sendRequest(e,t){return this._sendRequest(e,t)}_init(){this._notificationHandlers={},this._studyCounter={},this._childStudyCounter={},this._fundamentalCounter={},this._modifyStudyMap=new Map}_sendRequest(e,t){const n=this._sentMethodsCounters.get(e)??0;if(this._sentMethodsCounters.set(e,n+1),0!==this._sendingQueuedRequestsCount)return this._pendingMessagesQueue.push({method:e,args:t}),!0;const i=this._dataHandleModule[e].apply(this._dataHandleModule,t),l={m:e,p:(0,s.default)(i)},d=l.m.includes("study")&&l.p[5];d&&function(e){if(!(0,o.isObject)(e))return!1;for(const t of Object.keys(e)){const n=e[t];if(!((0,o.isObject)(n)||(0,a.default)(n)||(0,r.default)(n)||(0,c.default)(n)))return!1}return!0}(d)&&"text"in d&&(d.text=d.text.slice(0,10));const u=JSON.stringify(l);if(i.length>0){const e=i[0];e.startsWith("qs_")?B.logNormal("send: "+u):e.startsWith("cs_")&&A.logNormal("send: "+u)}else F.logNormal("send: "+u);const h=this._dataHandleModule.prepareEncodeMessage(e,i);return this._wsBackendConnection.send(h)}_onConnect(){if(this.connected())return;if(this._trafficStats.sinceConnect=0,this._isAuthTokenLoaded=!1,this._connectOnlyOptions=this._connectOnlyOptions||{},this._authTokenDfd=this._getAuthTokenDfd(this._connectOnlyOptions.tokenGrabSession),this._connectOnlyOptions={},this.sessionid=this._wsBackendConnection.getSessionId(),!this.sessionid||this._isConnected)return;this._pendingMessagesQueue=[],this._sendingQueuedRequestsCount=0,this._studyCounter={},this._childStudyCounter={},this._fundamentalCounter={},this._studySpecs.clear(),this._isConnected=!0,this._banInfo.setValue(null),this._connectionsLimitReached.setValue(!1);const e=JSON.parse(this.sessionid);this._sendLowQualityModeIfEnabled(),this._metadataServerHash=e.studies_metadata_hash||null;const t=this._wsBackendConnection.getConnectionEstablished();try{this._serverTimeBasePoint=Math.round(e.timestampMs-t)}catch(e){this._serverTimeBasePoint=Date.now()-performance.now()}if(F.logInfo("Time shift with server: "+this._formatTime(this.serverTime()-Date.now())),this._authTokenDfd){this._sendingQueuedRequestsCount+=1,F.logInfo("Wait for auth token before send messages")
;const e=this._authTokenDfd;e.then((t=>{if(null!==this._authTokenDfd&&this._authTokenDfd===e){if(F.logNormal("Auth token request is finished, token: "+Boolean(t)),this._authTokenDfd=null,t){const e=[{method:"set_auth_token",args:[t]}];if(W){const t=window.initData&&window.initData.currentLocaleInfo;t&&e.push({method:"set_locale",args:[t.iso,t.flag.toUpperCase()]})}this._pendingMessagesQueue.unshift(...e)}this._onSendingQueueRequestFinished(),this._isAuthTokenLoaded=!0,this._notifySessions({method:u.ChartApiMessageMethod.Connected,params:[]})}else F.logNormal("Comes auth token after requesting new token or after socket disconnected")})).catch((e=>{F.logNormal((0,v.errorToString)(e))}))}else F.logWarn("Deferred auth token object is not valid"),this._isAuthTokenLoaded=!0;""!==this._brokerId&&this._sendBrokerIdToSession(this._brokerId);const n=this._wsBackendConnection.getConnectionStart();T.telemetry.setSessionInfo(this.sessionid),T.telemetry.sendChartReport("websocket_connected"),T.telemetry.sendChartReport("websocket_connection_time_frame",{value:t-n}),T.telemetry.sendChartReport("reconnect_count_frame",{value:this._wsBackendConnection.getReconnectCount()}),T.telemetry.sendChartReport("redirect_count_frame",{value:this._wsBackendConnection.getRedirectCount()}),j||(j=!0,T.telemetry.sendChartReport("before_websocket_connection_time_frame",{value:n})),this._wsBackendConnection.resetCounters(),clearTimeout(this._telemetryDisconnectTimeout)}_formatTime(e){return`${(e/1e3).toFixed(2)} seconds.`}_dispatchNotification(e,t){if("request_data_problems"===e.method&&this._onDataProblemsPromiseCb)return void this._onDataProblemsPromiseCb(e.params);if(e.method===D.WebchartChartSessionResponseMethod.StudiesMetadata&&null!==this._metadataDeferredPromise)return void this._processedMetadata(e);const n=e.params.shift();if(!this._notificationHandlers[n])return;if("symbol_resolved"===e.method){const t=e.params[1].full_name;T.telemetry.sendChartReport("symbol_resolved",{count:1,additional:{symbol:t}});const s=T.telemetry.timeCounters.series["resolve_symbol_"+n];"number"==typeof s&&T.telemetry.sendChartReport("symbol_resolve_time_frame",{value:window.performance.now()-s,additional:{symbol:t}})}if(["series_error","series_completed"].includes(e.method)&&T.telemetry.timeCounters.series.marks.length>0){const e="create_series_"+n,t=T.telemetry.timeCounters.series.marks.indexOf(e);t>=0&&T.telemetry.timeCounters.series.marks.splice(t,1)}G||"series_error"!==e.method||(G=!0);const s=this._wsBackendConnection.getConnectionEstablished();if(null!==s&&"series_completed"===e.method&&(G||(G=!0,T.telemetry.sendChartReport("first_series_full_time_frame",{value:window.performance.now()-s}),T.telemetry.timeCounters.series.marks=[]),Q||(Q=!0,T.telemetry.sendChartReport("page_full_load_time_frame",{value:window.performance.now()}))),n.startsWith("cs_")){let n="recv: "+t;"data_update"===e.method?(n=(0,d.isHighRateEnabled)()?n:n.slice(0,500),
x.logNormal(this._appendDuration(n,e.time))):"study_loading"===e.method?U.logNormal(this._appendDuration(n,e.time)):"tickmark_update"===e.method?H.logNormal(this._appendDuration(n,e.time)):A.logNormal(this._appendDuration(n,e.time))}if(n.startsWith("qs_")){("quote_symbol_data"===e.method?V.logNormal:B.logNormal)("recv: "+t)}switch(e.method){case D.WebchartChartSessionResponseMethod.TimeScaleUpdate:{const t=this._dataHandleModule.getTimescaleObjects(e),s=this._dataHandleModule.getTimescaleChangeset(e),i=this._convertTimescaleResponse(s);this._sessions[n].onMessage({method:D.WebchartChartSessionResponseMethod.TimeScaleUpdate,params:i}),this._dataHandleModule.prepareDataUpdateObjects(n,t,((e,t,n)=>{this._invokeNotificationHandler(e,t,n)}));break}case"tickmark_update":const t={...this._convertTimescaleResponse(e.params[0]),changes:[]};this._sessions[n].onMessage({method:D.WebchartChartSessionResponseMethod.TimeScaleUpdate,params:t});break;case D.WebchartChartSessionResponseMethod.DataUpdate:{const t=this._dataHandleModule.getDataUpdateObjects(e);this._dataHandleModule.prepareDataUpdateObjects(n,t,((e,t,n)=>{this._invokeNotificationHandler(e,t,n)}));break}case"index_update":for(const t in e.params[0])if(e.params[0].hasOwnProperty(t)){const s={method:"index_update",params:e.params[0][t]};this._invokeNotificationHandler(n,t,s)}break;case D.WebchartResponseMethod.CriticalError:F.logInfo(new Date+" critical_error session:"+this.sessionid+" reason:"+e.params[0]),T.telemetry.sendChartReport("critical_error"),this._sessions[n].onMessage({method:D.WebchartResponseMethod.CriticalError,params:e.params});break;case"timescale_completed":case"quote_symbol_data":case"quote_list_fields":case"quote_completed":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":this._sessions[n].onMessage({method:e.method,params:e.params});break;case"clear_data":for(const t in e.params[0])e.params[0].hasOwnProperty(t)&&this._invokeNotificationHandler(n,t,{method:D.WebchartChartSessionResponseMethod.ClearData,params:e.params[0][t]});break;case D.WebchartReplaySessionResponseMethod.ReplayPoint:case D.WebchartReplaySessionResponseMethod.ReplayResolutions:case D.WebchartReplaySessionResponseMethod.ReplayDataEnd:case D.WebchartReplaySessionResponseMethod.ReplayInstanceId:case D.WebchartReplaySessionResponseMethod.ReplayDepth:case D.WebchartReplaySessionResponseMethod.ReplayError:case D.WebchartReplaySessionResponseMethod.ReplayOk:this._sessions[n].onMessage(e);break;case"series_timeframe":e.params[4]=function(e){if(null==e)return null;const t=/r,(\d+):(\d+)/.exec(e);return null!==t?{from:Number(t[1]),to:Number(t[2]),type:"time-range"}:{value:e,type:"period-back"}}(e.params[4]),this._invokeNotificationHandler(n,e.params[0],e);break;case"symbol_resolved":!function(e){if(void 0===e.corrections){const t=(e.subsessions??[]).find((t=>t.id===e.subsession_id));void 0!==t&&(e.corrections=t["session-correction"])}}(e.params[1]),this._invokeNotificationHandler(n,e.params[0],e);break;default:
this._invokeNotificationHandler(n,e.params[0],e)}}_notifySessions(e){for(const t in this._sessions)if(this._sessions.hasOwnProperty(t)){const n=this._sessions[t];"function"==typeof n.onMessage&&n.onMessage(e)}}_onMessage(e){this._calcTrafficStats(e);const t=this.unpack(e);this._receivedMethodsCounters.set(t.method,(this._receivedMethodsCounters.get(t.method)??0)+1),"t_ms"in t&&(0,r.default)(t.t_ms)&&window.ChartApiInstance.compensateConnectionLag(t.t_ms),"protocol_switched"!==t.method?"protocol_error"!==t.method?this._dispatchNotification(t,e):this._processProtocolError(t):F.logError("Unexpected protocol changing request, try skipping. Requested protocol:"+t.params[0])}async _processedMetadata(e){const t=(0,l.ensureNotNull)(this._metadataDeferredPromise),n=await this._initCachePromise,i=window.pro.hash(),o=(0,h.isFeaturesetEnabled)("widget");try{await n.setValue(ne,(0,s.default)(e));const r=Array.from(new Set(e.params[1].metainfo.map((e=>{return`${(t=(0,q.parseIdString)(e.id)).packageId}-${t.version}`;var t}))));if(F.logNormal(`Updated studies_metadata cache, unique package ids: ${r.join(", ")}`),!o)try{await n.setValue(te,(0,s.default)(i)),F.logNormal("Updated pro_hash cache")}catch(e){t.reject(),F.logError("Cannot update pro_hash cache, reason: "+e)}}catch(e){t.reject(),F.logError("Cannot update studies_metadata cache, reason: "+e)}t.resolve((0,s.default)(e))}_invokeNotificationHandler(e,t,n){if(void 0===t)return;const s=this._notificationHandlers[e][t];void 0!==s&&(s.singleShot&&delete this._notificationHandlers[e][t],s.handler?.(n))}_convertTimescaleResponse(e){return this._dataHandleModule.convertTimescaleResponse(e)}_appendDuration(e,t){return t?`${e}, duration: ${this._formatTime(this.serverTime()-1e3*t)}`:e}async _requestMetadata(){const e=this._makeNextRequestId();E.logNormal(`Requesting metainfo #${e}`);const t=(0,l.ensureNotNull)(this._metadataDeferredPromise),n=window.pro,i=n.hash(),o=(0,h.isFeaturesetEnabled)("widget");F.logNormal("Requesting pro hash");try{const r=await this._initCachePromise;await r.migrateValue("pro_hash",te),await r.migrateValue(ee,ne);const a=await r.getValue(te);if(null!==a&&a===i||o){F.logNormal("Pro hash has not changed, requesting from local");const o=await r.getValue(ne),a=null!==o&&o.params[1].hash||null;if(null===a||null===this._metadataServerHash||this._metadataServerHash!==a)F.logNormal(`Metadata hash has changed (cached: '${a}', server: '${this._metadataServerHash}')`),this._requestMetadataFromServer(e);else{if(!n.hasPackage("tv-volumebyprice")||void 0!==o.params[1].metainfo.find((e=>e.id.includes("@tv-volumebyprice"))))return F.logNormal("Using studies_metadata from browser cache"),void t.resolve((0,s.default)(o));F.logNormal(`De-sync detected! pro.hash contains VbPR studies, but data from cache doesn't and pro.hash isn't changed, pro.hash=${i}`),this._requestMetadataFromServer(e)}}else F.logNormal(`Pro hash has changed (cached: '${a}', current: '${i}')`),this._requestMetadataFromServer(e)}catch(t){F.logError("Cannot get studies_metadata, reason: "+t),
this._requestMetadataFromServer(e)}finally{E.logNormal(`Requesting studies metadata #${e} finished`)}}_makeNextRequestId(){return"metadata_"+this._metadataRequestNextNumber++}_processProtocolError(e){const t=e.params[0];F.logError(`Protocol error. Reason=${t}.`),"banned"!==t&&"banned by user_id"!==t&&"banned by ip"!==t||(this._banInfo.setValue({reason:t}),this.disconnect()),this._connectionsLimitReached.setValue("user connections limit reached"===t)}_requestMetadataFromServer(e){return F.logNormal("Request studies_metadata from server"),this._sendRequest("request_studies_metadata",[e])}_bindSocketEvents(){this.connectDfd=new Promise(((e,t)=>{this._wsBackendConnection.on("connect",(()=>{this._onConnect(),e()})),this._wsBackendConnection.on("message",this._onMessage.bind(this)),this._wsBackendConnection.on("disconnect",(()=>{this._authTokenDfd&&(this._authTokenDfd=null),this._onDataProblemsPromiseErrback&&this._onDataProblemsPromiseErrback(),this._isConnected=!1,this._notifySessions({method:u.ChartApiMessageMethod.Disconnected,params:[]}),this._banInfo.value()||(this._metadataDeferredPromise=null),this._disconnectCount=(this._disconnectCount||0)+1,this._wsBackendConnection.isConnected()&&(this._telemetryDisconnectTimeout=setTimeout((()=>{T.telemetry.sendChartReport("disconnect")}),5e3),this._wsBackendConnection.isMaxReconnects()&&(this._notifySessions({method:u.ChartApiMessageMethod.ReconnectBailout,params:[]}),t(),T.telemetry.sendChartReport("reconnect_bailout")))}))}))}_calcTrafficStats(e){const t=e.length;this._trafficStats.total+=t,this._trafficStats.sinceConnect+=t,this._trafficStats.lastChunk+=t}_sendBrokerIdToSession(e){return!$||this._sendRequest("set_broker",[e])}_enableLowQualityMode(){F.logNormal("low quality mode is enabled"),this._lowQualityEnabled=!0,this._sendLowQualityModeIfEnabled()}_sendLowQualityModeIfEnabled(){this._lowQualityEnabled&&this.connected()&&this._sendRequest("set_data_quality",[])}_getAuthTokenDfd(e){if(this._loadNewBars)return Promise.resolve("load_new_token");if((0,h.isFeaturesetEnabled)("widget")||-1!==window.location.search.indexOf("widget_token")||-1!==window.location.hash.indexOf("widget_token")){const e=window.TradingView&&window.TradingView.widgetCustomer||"";return Promise.resolve(p[e]||"widget_user_token")}return window.is_authenticated?(this._authTokenManager||(this._authTokenManager=new m.AuthToken,this._authTokenManager.invalidated.subscribe(null,(()=>{this._authTokenManager?.get().then((e=>{e&&this.connected()&&this._sendRequest("set_auth_token",[e])}))}))),this._authTokenManager.get(e)):Promise.resolve("unauthorized_user_token")}_onSendingQueueRequestFinished(){this._sendingQueuedRequestsCount-=1,F.logInfo(`Sending queue request finished. Remaining pending requests=${this._sendingQueuedRequestsCount}`),this._sendingQueuedRequestsCount<0&&F.logError(`Invalid queue state=${this._sendingQueuedRequestsCount}`),0===this._sendingQueuedRequestsCount&&this._flushPendingMessages()}_flushPendingMessages(){
F.logInfo(`Flush pending messages. Count=${this._pendingMessagesQueue.length}`),this._pendingMessagesQueue.forEach((e=>this._sendRequest(e.method,e.args))),this._pendingMessagesQueue=[]}}"undefined"!=typeof window&&(window.ChartApiInstance=new ae(window.WSBackendConnection))},124401:(e,t,n)=>{"use strict";n.d(t,{getQuoteSessionInstance:()=>a});var s=n(287984),i=n(605434),o=n(584104);const r={};function a(e="full"){return r[e]||function(e="full",t){r[e]=t}(e,new s.QuoteSessionMultiplexer({name:e,api:window.ChartApiInstance,fields:c[e],extensions:{formatter:e=>new l(e).formatter,snapshot:e=>new d(e).snapshot}})),r[e]}const c={simple:["base-currency-logoid","logo","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","unit_id","measure"]};c.simpleDetailed=[...c.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"],c.full=[],c.watchlist=[...c.simple,"rchp","rtc","country_code","provider_id","dividends_availability","financials_availability","earnings_availability"],c.portfolio=["pro_name","short_name","exchange","listed_exchange","description","local_description","language","sector","type","typespecs","industry","currency_code","currency_id","ch","chp","logo","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_calc","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","unit_id","measure"],c.notes=["short_name","pro_name","logoid","currency-logoid","base-currency-logoid","logo","symbol-primaryname","type","typespecs"],c.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"],c.economic=["reference-last-period","lp","currency_code","value_unit_id","unit_id","measure"],c.options=["ask","bid","lp","volume"];class l{constructor(e){this._formatterValuesCache={},this._waitingForFormatters={},this.formatter=(e,t)=>{if(this._waitingForFormatters[e])return this._waitingForFormatters[e];function n(e){const n=t&&!e.fractional?1:e.minmov;return new i.PriceFormatter({priceScale:e.pricescale,minMove:n,fractional:e.fractional,
minMove2:e.minmove2})}const s=new Promise(((t,s)=>{if(this._formatterValuesCache[e])t(n(this._formatterValuesCache[e]));else{const i=(0,o.guid)();this._multiplexer.subscribe(i,[e],(o=>{"error"===o.status&&(this._waitingForFormatters[e]=null,s("Quotes snapshot is not received")),function(e){return e&&null!=e.pricescale&&null!=e.minmov}(o.values)&&(this._waitingForFormatters[e]=null,this._formatterValuesCache[e]=o.values,t(n(o.values)),this._multiplexer.unsubscribe(i,e))}))}}));return this._waitingForFormatters[e]=s,s},this._multiplexer=e}}class d{constructor(e){this._snapshotValuesCache={},this._waitingForSnapshot={},this.snapshot=e=>{if(this._waitingForSnapshot[e])return this._waitingForSnapshot[e];const t=new Promise(((t,n)=>{if(this._snapshotValuesCache[e])t(this._snapshotValuesCache[e]);else{const s=(0,o.guid)();this._multiplexer.subscribe(s,[e],(i=>{"error"===i.status&&(this._waitingForSnapshot[e]=null,n("Quotes snapshot is not received"));const o=i.values;o&&o.minmov&&o.pricescale&&o.description&&(this._waitingForSnapshot[e]=null,this._snapshotValuesCache[e]=o,t(o),this._multiplexer.unsubscribe(s,e))}))}}));return this._waitingForSnapshot[e]=t,t},this._multiplexer=e}}"undefined"!=typeof window&&(window.getQuoteSessionInstance=a)},875500:(e,t,n)=>{"use strict";n.d(t,{Delegate:()=>s.Delegate});var s=n(992438)},157898:(e,t,n)=>{"use strict";n.d(t,{getMinTickData:()=>c,makeVariableMinTickData:()=>d});var s=n(712745),i=n(197486),o=n(999178),r=n(517806);function a(e){return e?(0,s.Big)(e.minMove).div(e.priceScale).toNumber():NaN}function c(e){const{minTick:t,price:n,variableMinTickData:s,shouldCheckForEquality:o}=e,r=(0,i.isNumber)(t)?l(t):t;return void 0===s?r:function(e,t,n=!1){for(let s=0;s(0,r.isEven)(t)?function(e){const t=Number(e);if(Number.isFinite(t))return l(t);{const t=e.split("/");if(t.length<2||t.length>3)throw new Error(`Unexpected mintick: ${e}`);const n=Number(t[1]),s=Number(t[0]);if(!Number.isFinite(n)||!Number.isFinite(s))throw new Error(`Unexpected mintick: ${e}`);const i=3===t.length?Number(t[2]):void 0;if(void 0!==i&&!Number.isFinite(i))throw new Error(`Unexpected mintick: ${e}`);const o={priceScale:n,minMove:s};return void 0!==i&&(o.minMove2=i),o}}(e):function(e){const t=Number(e);if(Number.isNaN(t))throw new Error(`Unexpected price limit: ${e}`);return t}(e)));if((0,r.isEven)(e.length))throw new Error("Theme must not be event number of elements");const n=[];for(let t=0;t{"use strict"
;n.d(t,{numberToStringWithLeadingZero:()=>i});var s=n(385955);function i(e,t){if(!(0,s.isNumber)(e))return"n/a";if(!(0,s.isInteger)(t))throw new TypeError("invalid length");if(t<0||t>24)throw new TypeError("invalid length");if(0===t)return e.toString();return("00000000000000000000"+e.toString()).slice(-t)}},605434:(e,t,n)=>{"use strict";n.d(t,{PriceFormatter:()=>a});var s=n(15914),i=n(124588),o=n(385955),r=n(895085);class a{constructor(e={}){this.type="price";const{minMove2:t,fractional:n,variableMinTick:a,ignoreMinMove:c,ignoreLocaleNumberFormat:l}=e,d=!e.minMove||c?1:e.minMove,u=(0,o.isNumber)(e.priceScale)&&(0,o.isInteger)(e.priceScale)?e.priceScale:100,h=(0,r.calculateDecimal)(u,d,n,t),m={...e,minMove:d,priceScale:u,fractionalLength:h};if(u<0)throw new TypeError("invalid base");this._priceScale=u,this._minMove=d,this._minMove2=t,this._fractional=n,this._variableMinTick=a,this._ignoreMinMove=c,this._fractionalLength=h,this._ignoreLocaleNumberFormat=l,this._noExponentialForm=e.noExponentialForm,this._implementation=n?new i.FractionalPriceFormatterImpl(m):new s.DecimalPriceFormatterImpl(m)}isFractional(){return!!this._fractional}state(){return{minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale,variableMinTick:this._variableMinTick,ignoreMinMove:this._ignoreMinMove,fractional:this._fractional,noExponentialForm:this._noExponentialForm}}formatChange(e,t,n){return this._implementation.formatImpl(e-t,{...n,variableMinTickDataPrice:Math.min(Math.abs(e),Math.abs(t))})}format(e,t){return this._implementation.formatImpl(e,t)}parse(e,t){return this._implementation.parse(e,t)}hasForexAdditionalPrecision(){return this._implementation.hasForexAdditionalPrecision()}static serialize(e){return e.state()}static deserialize(e){return new a(e)}}},205356:(e,t,n)=>{"use strict";n.d(t,{isTicksEnabled:()=>i});var s=n(376596);n(266150);function i(){return!(0,s.onWidget)()}},301416:(e,t,n)=>{n(952375).setClasses();var s=n(539424).whenDocumentReady,i=n(685678).handleTVLinksClick;s((()=>{i()}))},945592:(e,t,n)=>{"use strict";var s;!function(e){e.Monthly="m",e.ThreeMonths="3m",e.OneYear="y"}(s||(s={}))},451041:(e,t,n)=>{"use strict";function s(e,t){const n=t||window.locale||"en";let s=e[n]?e[n]:e.en;return s="tradingview.com"===s?"www.tradingview.com":s,s?document.location.protocol+"//"+s:""}n.d(t,{determineBaseUrl:()=>s})},813915:(e,t,n)=>{"use strict";n.d(t,{showTooManyStudiesNotice:()=>o});var s=n(729193),i=n(474422);function o(e){(0,i.showWarning)({title:s.t(null,void 0,n(937017)),text:s.t(null,{replace:{number:`${e}`}},n(992362))})}},641077:(e,t,n)=>{"use strict";n.d(t,{getProductForTrial:()=>o,isTrialProduct:()=>i});n(686923),n(729193),n(945592);const s="_trial";function i(e){return new RegExp(s+"$").test(e)}function o(e){return e.split(s)[0]}},222993:(e,t,n)=>{"use strict";function s(){let e,t;return{promise:new Promise(((n,s)=>{e=n,t=s})),reject:t,resolve:e}}n.d(t,{createDeferredPromise:()=>s})},484280:(e,t,n)=>{"use strict";function s(e){const t=[];for(const n in e)e.hasOwnProperty(n)&&null!=e[n]&&t.push({key:n,
pair:encodeURIComponent(n)+"="+encodeURIComponent(e[n])});return t.sort(((e,t)=>e.key>t.key?1:e.keye.pair)).join("&")}n.d(t,{createUrlParams:()=>s})},890533:(e,t,n)=>{"use strict";function s(e){const t=new URL(e,document.baseURI);return o(t)&&i(t)}n.d(t,{isInternalHost:()=>r,isSafeUrl:()=>s});const i=e=>!e.username,o=e=>"http:"===e.protocol||"https:"===e.protocol;function r(e,t=window.location.hostname){const n="."===t.slice(-1)?3:2,s=t.toLowerCase().split(".").slice(-n),i=e.toLowerCase().split(".").slice(-s.length);return s.join(".")===i.join(".")}},77357:(e,t,n)=>{"use strict";var s;n.r(t),n.d(t,{LOGLEVEL:()=>s,getLogHistory:()=>y,getLogLevel:()=>m,getLogger:()=>v,getRawLogHistory:()=>f,isHighRateEnabled:()=>_,loggingOff:()=>C,loggingOn:()=>S,serializeLogHistoryEntry:()=>w,setHighRateStatus:()=>p,setLogLevel:()=>g}),function(e){e[e.ERROR=1]="ERROR",e[e.WARNING=2]="WARNING",e[e.INFO=3]="INFO",e[e.NORMAL=4]="NORMAL",e[e.DEBUG=5]="DEBUG"}(s||(s={}));let i=0;const o=1e3,r=[];let a=null,c=null,l=null,d=null,u=s.WARNING,h=!1;function m(){return u}function _(){return h}function g(e){e=Math.max(s.ERROR,Math.min(s.DEBUG,e)),u=e}function p(e){h=e}function f(e,t){let n=r.reduce(((e,t)=>e.concat(t)),[]);return n.sort(((e,t)=>e.id-t.id)),void 0!==t&&(n=n.filter((e=>e.subSystemId===t))),"number"==typeof e&&(n=n.slice(-e)),n}function w(e){return new Date(e.timestamp).toISOString()+":"+e.subSystemId+":"+e.message.replace(/"/g,"'")}const y=(e,t)=>function(e,t){let n,s=0,i=0;for(n=e.length-1;n>=1&&(s+=8*(1+encodeURIComponent(e[n]).length),!(n-1>0&&(i=8*(1+encodeURIComponent(e[n-1]).length),s+i>t)));n--);return e.slice(n)}(f(e,t).map(w),75497472);function b(e,t,n,r){if(t===c&&r.id===l)return;const h=new Date;if(e<=s.NORMAL&&function(e,t,n,s,r){"function"==typeof structuredClone&&(t=structuredClone(t)),t=t.slice(0,o);const a={id:i,message:t,subSystemId:s,timestamp:Number(e)};i+=1,n.push(a),void 0!==r&&n.length>r&&n.splice(0,1)}(h,t,n,r.id,r.maxCount),e<=u&&(!r.highRate||_())&&(!a||r.id.match(a))){const n=h.toISOString()+":"+r.id+":"+t;switch(e){case s.DEBUG:console.debug(n);break;case s.INFO:case s.NORMAL:r.color?console.log("%c"+n,"color: "+r.color):console.log(n);break;case s.WARNING:console.warn(n);break;case s.ERROR:console.error(n)}c=t,l=r.id,null!==d&&clearTimeout(d),d=setTimeout((()=>{c=null,l=null,d=null}),1e3)}}function v(e,t={}){const n=[];r.push(n);const i=Object.assign(t,{id:e});function o(e){return t=>b(e,String(t),n,i)}return{logDebug:o(s.DEBUG),logError:o(s.ERROR),logInfo:o(s.INFO),logNormal:o(s.NORMAL),logWarn:o(s.WARNING)}}const S=(e,t)=>{g(s.DEBUG),h=Boolean(e),a=t||null},C=()=>{g(s.INFO)}},384530:(e,t,n)=>{"use strict";n.d(t,{isAndroid:()=>h,isAnyMobile:()=>f,isBlackBerry:()=>m,isChrome:()=>a,isEdge:()=>l,isFF:()=>c,isIOS:()=>_,isIPad:()=>p,isMac:()=>u,isOperaMini:()=>g,isSafari:()=>d,mobiletouch:()=>o,touch:()=>r})
;const s="undefined"!=typeof window&&"undefined"!=typeof navigator,i=s&&"ontouchstart"in window,o=s&&i&&"onorientationchange"in window,r=s&&(i||!!navigator.maxTouchPoints),a=s&&window.chrome&&window.chrome.runtime,c=s&&window.navigator.userAgent.toLowerCase().indexOf("firefox")>-1,l=s&&/\sEdge\/\d\d\b/.test(navigator.userAgent),d=s&&Boolean(navigator.vendor)&&navigator.vendor.indexOf("Apple")>-1&&-1===navigator.userAgent.indexOf("CriOS")&&-1===navigator.userAgent.indexOf("FxiOS"),u=s&&/mac/i.test(navigator.platform),h=(s&&/Win32|Win64/i.test(navigator.platform),s&&/Linux/i.test(navigator.platform),s&&/Android/i.test(navigator.userAgent)),m=s&&/BlackBerry/i.test(navigator.userAgent),_=s&&/iPhone|iPad|iPod/.test(navigator.platform),g=s&&/Opera Mini/i.test(navigator.userAgent),p=s&&("MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/iPad/.test(navigator.platform)),f=h||m||_||g}}]);