"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[32679],{988124:(t,e,s)=>{var n=s(414879),r=s(783433).tzData;let i;function a(t){this._name=t;var e=r[t];if(e||(e={time:[],offset:[]},this._invalid=!0),e.time.length!==e.offset.length&&(e={time:[],offset:[]},this._invalid=!0),!e.time_utc){for(var s=e.time,n=e.offset,i=s.length,a=new Array(i),o=0;oe){if((r=i-1)0&&t-e[n-1]<=r)return r;return 0},a.prototype.is_valid=function(){return!this._invalid},a._offset=function(t,e,s){var n=o(t,s);return-1===n?0:e[n]};var h=function(t){return 0|t},u=function(t){return 60*t*1e3},l=function(t,e){return c(t)-c(e)},c=function(t){return t<0?h(t/1e3)-(t%1e3!=0?1:0):h(t/1e3)};function _(t){return t%4==0&&(t%100!=0||t%400==0)}var d={0:0,1:31,2:59,3:90,4:120,5:151,6:181,7:212,8:243,9:273,10:304,11:334},m={...n.WeekDays,...n.Months,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,millisecondsPerDay:u(1440),get_minutes_from_hhmm:function(t){return-1!==t.indexOf(":")&&(t=t.split(":").join("")),t%100+60*h(t/100)},get_year:function(t){return t.getUTCFullYear()},get_month:function(t){return t.getUTCMonth()},get_hours:function(t){return t.getUTCHours()},get_minutes:function(t){return t.getUTCMinutes()},get_seconds:function(t){return t.getUTCSeconds()},get_day_of_month:function(t){return t.getUTCDate()},get_day_of_week:function(t){return t.getUTCDay()+1},get_day_of_year:function(t){var e=t.getUTCMonth(),s=d[e];return e>m.JANUARY+1&&_(t.getUTCFullYear())&&(s+=1),s+t.getUTCDate()},get_week_of_year:function(t){var e=new Date(Date.UTC(t.getUTCFullYear(),0,1)).getUTCDay(),s=0===e?1:8-e,n=m.get_day_of_year(t)-s;return Math.ceil(n/7)+1},get_minutes_from_midnight:function(t){return 60*m.get_hours(t)+m.get_minutes(t)},set_hms:function(t,e,s,n,r,i){t.setUTCHours(e),t.setUTCMinutes(s),t.setUTCSeconds(n),t.setUTCMilliseconds(r),void 0!==i&&m.correct_time(t,i)},correct_time:function(t,e){var s=t.getTime(),n=e.correction_loc(s);t.setTime(s+n)},add_days_considering_dst:function(t,e,s){var n=t.offset_utc(e),r=this.clone(e);this.add_date(r,s);var i=t.offset_utc(r);return r.setTime(r.getTime()+n-i),r},add_years_considering_dst:function(t,e,s){let n=e;for(let e=Math.abs(s);e>0;e--)n=this.add_days_considering_dst(t,n,this.get_days_per_year(n)*Math.sign(s));return n},add_date:function(t,e){t.setTime(t.getTime()+e*m.millisecondsPerDay)},add_minutes:function(t,e){ t.setTime(t.getTime()+u(e))},clone:function(t){return new Date(t.getTime())},get_days_per_year:function(t){var e=t.getUTCFullYear();return this.days_per_year(e)},days_per_year:function(t){return _(t)?366:365},get_days_in_month:function(t,e){let s;switch(t){case 0:case 2:case 4:case 6:case 7:case 9:case 11:s=31;break;case 1:s=28,_(e)&&s++;break;default:s=30}return s},get_part:function(t,e){switch(e){case m.YEAR:return m.get_year(t);case m.MONTH:return m.get_month(t);case m.DAY_OF_MONTH:return m.get_day_of_month(t);case m.WEEK_OF_YEAR:return m.get_week_of_year(t);case m.DAY_OF_WEEK:return m.get_day_of_week(t);case m.HOUR_OF_DAY:return m.get_hours(t);case m.MINUTE:return m.get_minutes(t);case m.DAY_OF_YEAR:return m.get_day_of_year(t);case m.SECOND:return m.get_seconds(t);default:return t.getTime()}},time_minutes:u,time_seconds:function(t){return 1e3*t},time_minutes_diff:function(t,e){return h(l(t,e)/60)},time_seconds_diff:l,utc_to_cal:function(t,e){return new Date(m.utc_to_cal_ts(t,e))},utc_to_cal_ts:function(t,e){return e+t.offset_utc(e)},get_cal:function(t,e,s,n,r,i,a){var o=new Date(Date.UTC(e,s,n,r||0,i||0,a||0)),h=t.offset_utc(+o);return new Date(o.valueOf()-h)},get_cal_from_unix_timestamp_ms:function(t,e){return new Date(e+t.offset_utc(e))},get_cal_utc:function(t,e,s){return new Date(Date.UTC(t,e,s))},cal_to_utc:function(t,e){var s=e.getTime();return s-t.offset_loc(s)},get_timezone:function(t){return new a(t)},shift_day:function(t,e){var s=t-1;return(s+=e)>6?s%=7:s<0&&(s=(7+s%7)%7),s+1},setCustomTimezones:function(t){i=t}};t.exports=m},534741:(t,e,s)=>{var n;s.d(e,{PlotRowSearchMode:()=>n}),function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.Exact=0]="Exact",t[t.NearestRight=1]="NearestRight"}(n||(n={}))},826989:(t,e,s)=>{var n;s.d(e,{SymbolErrorPermissionDeniedReason:()=>n,invalidSymbol:()=>i,permissionDenied:()=>r}),function(t){t.Symbol="symbol",t.GroupPermission="group"}(n||(n={}));const r="permission denied",i="invalid symbol"},459685:(t,e,s)=>{s.d(e,{unpackNonSeriesData:()=>a});var n=s(130551),r=s(650151);function i(t){if(!(0,n.isObject)(t))throw new Error("Graphics commands should be wrapped in an object");if((0,n.hasProperty)(t,"create"),(0,n.hasProperty)(t,"erase")){const e=t.erase;(0,r.assert)(Array.isArray(e),"Collection of erase commands should be array");for(const t of e){if(!(0,n.isObject)(t)||!(0,n.hasProperty)(t,"action"))throw new Error("Command should be an object with 'action' property");(0,r.assert)("all"===t.action||"one"===t.action,"Erase command action should be 'all' or 'one'")}}return t}async function a(t){if(""===t)return null;const e=JSON.parse(t);if(!(0,n.isObject)(e)||"function"==typeof e)throw new Error("Non-object content in the non-series envelope");if((0,n.hasProperty)(e,"indexes_replace"))return{indexes_replace:!0};const r={indexes_replace:!1};if((0,n.hasProperty)(e,"offsets")&&(r.offsets=e.offsets),(0,n.hasProperty)(e,"isUpdate")){if("boolean"!=typeof e.isUpdate)throw new Error('Invalid type of "isUpdate" field');r.isUpdate=e.isUpdate}if((0,n.hasProperty)(e,"data")&&(r.data=e.data), (0,n.hasProperty)(e,"graphicsCmds")&&(r.graphicsCmds=i(e.graphicsCmds)),(0,n.hasProperty)(e,"dataCompressed")||(0,n.hasProperty)(e,"graphicsCmdsCompressed")){const{default:t}=await Promise.all([s.e(93194),s.e(81578)]).then(s.t.bind(s,593194,23));if((0,n.hasProperty)(e,"dataCompressed")){const s=await(new t).loadAsync(e.dataCompressed,{base64:!0});r.data=JSON.parse(await s.file("").async("text"))}if((0,n.hasProperty)(e,"graphicsCmdsCompressed")){const s=await(new t).loadAsync(e.graphicsCmdsCompressed,{base64:!0});r.graphicsCmds=i(JSON.parse(await s.file("").async("text")))}return r}return r}},195447:(t,e,s)=>{s.d(e,{PlotList:()=>_,mergeMinMax:()=>d});var n=s(650151),r=s(674981),i=s(732149),a=s(201089),o=s(534741);const h=(0,a.getLogger)("Chart.PlotList"),u=30;function l(t){return t.index}function c(t){return t.value[0]}class _{constructor(t=null,e=null){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache=new Map,this._rowSearchCacheByIndex=new Map,this._rowSearchCacheByIndexWithoutEmptyValues=new Map,this._rowSearchCacheByTime=new Map,this._rowSearchCacheByTimeWithoutEmptyValues=new Map,this._plotFunctions=t||new Map,this._emptyValuePredicate=e}clear(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache.clear(),this._invalidateSearchCaches()}first(){return this.size()>0?this._items[this._start]:null}last(){return this.size()>0?this._items[this._end-1]:null}firstIndex(){return this.size()>0?this._indexAt(this._start):null}lastIndex(){return this.size()>0?this._indexAt(this._end-1):null}size(){return this._end-this._start}isEmpty(){return 0===this.size()}contains(t){return null!==this.search(t,o.PlotRowSearchMode.Exact)}valueAt(t){const e=this.search(t);return null!==e?e.value:null}add(t,e){if(this._shareRead)return h.logDebug("add: readonly collection modification attempt"),!1;const s={index:t,value:e},n=this._nonCachedSearch(t,o.PlotRowSearchMode.Exact,l);return this._invalidateSearchCaches(),null===n?(this._items.splice(this._lowerbound(t,l),0,s),this._start=0,this._end=this._items.length,!0):(this._items[n]=s,!1)}search(t,e=o.PlotRowSearchMode.Exact,s){return this._searchImpl(t,e,this._rowSearchCacheByIndex,this._rowSearchCacheByIndexWithoutEmptyValues,l,s)}searchByTime(t,e=o.PlotRowSearchMode.Exact,s){return this._searchImpl(t,e,this._rowSearchCacheByTime,this._rowSearchCacheByTimeWithoutEmptyValues,c,s)}fold(t,e){let s=e;for(let e=this._start;e=s;--e){const s=this._indexAt(e),n=this._valueAt(e);if(t(s,n))return{index:s,value:n}}return null}each(t){for(let e=this._start;ethis._start&&(e._start-=1),e}rangeIterator(t,e){const s=this._lowerbound(t,l),n=this._upperbound(e);return this._rangeIteratorImpl(s,n)}fullRangeIterator(){return this._rangeIteratorImpl(this._start,this._end)}minMaxOnRangeCached(t,e,s){if(this.isEmpty())return null;let n=null;for(const r of s){n=d(n,this._minMaxOnRangeCachedImpl(t-r.offset,e-r.offset,r.name))}return n}minMaxOnRange(t,e,s){if(this.isEmpty())return null;let n=null;for(const r of s){n=d(n,this._minMaxOnRange(t-r.offset,e-r.offset,r.name))}return n}merge(t){return this._shareRead?(h.logDebug("merge: readonly collection modification attempt"),null):0===t.length?null:this.isEmpty()||t[t.length-1].indexthis._items[this._items.length-1].index?this._append(t):1===t.length&&t[0].index===this._items[this._items.length-1].index?(this._updateLast(t[0]),t[0]):this._merge(t)}addTail(t,e=!1){if(0===t.length)return;let s=0;e&&this._end-this._start>0&&(s=1,this._items[this._end-this._start-1].value=t[0].value);for(let e=s;evoid 0!==t)).sort(((t,e)=>t.index-e.index)),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._start=0,this._end=this._items.length}remove(t){if(this._shareRead)return h.logDebug("remove: readonly collection modification attempt"),null;const e=this._nonCachedSearch(t,o.PlotRowSearchMode.NearestRight,l);if(null===e)return null;const s=this._items.splice(e);return this._end=this._items.length,this._minMaxCache.clear(),this._invalidateSearchCaches(),s.length>0?s[0]:null}state(){const t=this._items.slice(this._start,this._end);return{start:0,end:t.length,data:t}}restoreState(t){t?(this._start=t.start,this._end=t.end,this._shareRead=!1,this._items=t.data,this._minMaxCache.clear(),this._invalidateSearchCaches()):this.clear()}_indexAt(t){return this._items[t].index}_valueAt(t){return this._items[t].value}_length(){return this._items.length}_searchImpl(t,e,s,n,r,i){const a=void 0!==i?s:n,o=void 0!==i?1e4*(e+1)+i:e;let h=a.get(t);if(void 0!==h){const t=h.get(o) ;if(void 0!==t)return t}const u=this._nonCachedSearch(t,e,r,i);if(null===u)return null;const l={index:this._indexAt(u),value:this._valueAt(u)};return void 0===h&&(h=new Map,a.set(t,h)),h.set(o,l),l}_nonCachedSearch(t,e,s,n){const r=this._lowerbound(t,s),i=r===this._end||t!==s(this._items[r]);if(i&&e!==o.PlotRowSearchMode.Exact)switch(e){case o.PlotRowSearchMode.NearestLeft:return this._searchNearestLeft(r,n);case o.PlotRowSearchMode.NearestRight:return this._searchNearestRight(r,n);default:throw new TypeError("Unknown search mode")}if(void 0===n||i||e===o.PlotRowSearchMode.Exact)return i?null:r;switch(e){case o.PlotRowSearchMode.NearestLeft:return this._nonEmptyNearestLeft(r,n);case o.PlotRowSearchMode.NearestRight:return this._nonEmptyNearestRight(r,n);default:throw new TypeError("Unknown search mode")}}_nonEmptyNearestRight(t,e){const s=(0,n.ensure)(this._emptyValuePredicate),r=(0,n.ensure)(e);for(;t=this._start&&s(this._valueAt(t),r);)t-=1;return te(t)e.index>t),this._start,this._end)}_plotMinMax(t,e,s){let n=null;const r=this._plotFunctions.get(s);if(void 0===r)throw new Error(`Plot "${s}" is not registered`);for(let s=t;sn.max&&(n.max=t)))}return n}_invalidateCacheForRow(t){const e=Math.floor(t.index/u);this._minMaxCache.forEach((t=>t.delete(e)))}_prepend(t){return(0,n.assert)(!this._shareRead,"collection should not be readonly"),(0,n.assert)(0!==t.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=t.concat(this._items),this._start=0,this._end=this._items.length,t[0]}_append(t){return(0,n.assert)(!this._shareRead,"collection should not be readonly"),(0,n.assert)(0!==t.length,"plotRows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(),this._items=this._items.concat(t),this._start=0,this._end=this._items.length,t[0]}_updateLast(t){(0,n.assert)(!this.isEmpty(),"plot list should not be empty");const e=this._items[this._end-1];(0,n.assert)(e.index===t.index,"last row index should match new row index"),this._invalidateCacheForRow(t),this._invalidateSearchCaches(),this._items[this._end-1]=t}_merge(t){return(0,n.assert)(0!==t.length,"plot rows should not be empty"),this._invalidateSearchCaches(),this._minMaxCache.clear(), this._items=function(t,e){const s=function(t,e){const s=t.length,n=e.length;let r=s+n,i=0,a=0;for(;ie[a].index?a++:(i++,a++,r--);return r}(t,e),n=new Array(s);let r=0,i=0;const a=t.length,o=e.length;let h=0;for(;re[i].index?(n[h]=e[i],i++):(n[h]=e[i],r++,i++),h++;for(;r(s+=1,s>=e?{done:!0,value:void 0}:{done:!1,value:this._items[s]})}}_invalidateSearchCaches(){this._rowSearchCacheByIndex.clear(),this._rowSearchCacheByIndexWithoutEmptyValues.clear(),this._rowSearchCacheByTime.clear(),this._rowSearchCacheByTimeWithoutEmptyValues.clear()}}function d(t,e){if(null===t)return e;if(null===e)return t;return{min:Math.min(t.min,e.min),max:Math.max(t.max,e.max)}}},544421:(t,e,s)=>{s.d(e,{SeriesData:()=>d,barFunction:()=>l,seriesPlotFunctionMap:()=>u});var n,r=s(650151),i=s(195447),a=s(674981);!function(t){t[t.FromLeft=-1]="FromLeft",t[t.FromRight=1]="FromRight"}(n||(n={}));const o={open:t=>t[1],high:t=>t[2],low:t=>t[3],close:t=>t[4],hl2:t=>(t[2]+t[3])/2,hlc3:t=>(t[2]+t[3]+t[4])/3,ohlc4:t=>(t[1]+t[2]+t[3]+t[4])/4},h=["open","high","low","close","hl2","hlc3","ohlc4"];function u(){const t=new Map;return h.forEach(((e,s)=>{t.set(e,l(e))})),t}function l(t,e,s){const n=o[null!=e?e:t],r=o[t],i=o[null!=s?s:t];return(t,e)=>{switch(e){case 0:return n(t);case 2:return i(t);default:return r(t)}}}function c(t,e){return null==t[e]}const _=[{barsToMerge:10,forBarspacingLargerThen:.03},{barsToMerge:30,forBarspacingLargerThen:.01},{barsToMerge:100,forBarspacingLargerThen:.003},{barsToMerge:500,forBarspacingLargerThen:0}];class d{constructor(){this._pressedChunks={chunks:new Map,priceSource:"uninitialized"},this.m_bars=new i.PlotList(u(),c),this.m_nsBars=new i.PlotList(u(),c),this._clearPressedChunks()}bars(){return this.m_bars}nsBars(){return this.m_nsBars}pressedChunks(t,e){if(e!==this._pressedChunks.priceSource){this._pressedChunks.priceSource=e;const t=this.m_bars.first();t&&(this._clearPressedChunks(),this._rebuildPressedChunks(t))}const s=(0,r.ensureDefined)(_.find((e=>e.forBarspacingLargerThen<=t)));return(0,r.ensureDefined)(this._pressedChunks.chunks.get(s.barsToMerge))} mergeRegularBars(t){const e=this.m_bars.size(),s=this.m_bars.merge(t);return s&&"uninitialized"!==this._pressedChunks.priceSource&&(e===this.m_bars.size()&&s.index===this.m_bars.lastIndex()?this._updateLatestChunks():this._rebuildPressedChunks(s)),s}size(){return this.m_bars.size()+this.m_nsBars.size()}each(t){this.m_bars.each(t),this.m_nsBars.each(t)}clear(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0,this._clearPressedChunks()}isEmpty(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()}first(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()}last(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()}search(t,e,s){return this.nsBars().isEmpty()?this.bars().search(t,e,s):this.bars().isEmpty()||(0,r.ensureNotNull)(this.nsBars().firstIndex())<=t?this.nsBars().search(t,e,s):this.bars().search(t,e,s)}valueAt(t){const e=this.search(t);return null!==e?e.value:null}plotValueToTimePointIndex(t,e,s){if(s===n.FromRight){const s=(s,n)=>{const r=n[e];return null!=r&&t>=r},n=this.m_bars.findLast(s);if(null!==n)return n.index;const r=this.m_nsBars.findLast(s);return null!==r?r.index:this.m_bars.firstIndex()}if(s===n.FromLeft){const s=(s,n)=>{const r=n[e];return null!=r&&t<=r},n=this.m_bars.findFirst(s);if(null!==n)return n.index;const r=this.m_nsBars.findFirst(s);return null!==r?r.index:this.m_bars.lastIndex()}throw new Error("plotValueToTimePointIndex: unsupported search mode")}moveData(t){this.m_bars.move(t),this.m_nsBars.move(t),this.m_bars.size()>0&&this._rebuildPressedChunks((0,r.ensureNotNull)(this.m_bars.first()))}_rebuildPressedChunks(t){const e=this._pressedChunks.priceSource;if("uninitialized"===e)return;const s=t.index,n=o[e],i=(t,e,s)=>{let r=null;for(const i of t){const t=n(i.value);r&&i.index-r.startTime>=s.barsToMerge&&(e.push(r),r=null),r?(r.endTime=i.index,r.high=Math.max(r.high,t),r.low=Math.min(r.low,t),r.close=t):r={startTime:i.index,endTime:i.index,open:t,high:t,low:t,close:t}}r&&e.push(r)};_.forEach((t=>{const e=(0,r.ensureDefined)(this._pressedChunks.chunks.get(t.barsToMerge)),n=(0,a.lowerbound)(e,s,((t,e)=>t.endTime0){const s=e[0].startTime-1,n=(0,r.ensureNotNull)(this.m_bars.firstIndex()),a=this.m_bars.rangeIterator(n,s),o=[];i(a,o,t);const h=o.concat(e);this._pressedChunks.chunks.set(t.barsToMerge,h)}else{const s=(0,r.ensureNotNull)(this.m_bars.lastIndex());e.splice(n);let a=(0,r.ensureNotNull)(this.m_bars.firstIndex());e.length&&(a=e[e.length-1].endTime+1);const o=this.m_bars.rangeIterator(a,s);i(o,e,t)}}))}_updateLatestChunks(){const t=(0,r.ensureNotNull)(this.m_bars.last());_.forEach((e=>{const s=(0,r.ensureDefined)(this._pressedChunks.chunks.get(e.barsToMerge)),n=t.value[4],i=s[s.length-1];i.high=Math.max(i.high,n),i.low=Math.min(i.low,n),i.close=n,i.endTime=t.index}))}_clearPressedChunks(){_.forEach((t=>this._pressedChunks.chunks.set(t.barsToMerge,[])))}}},25e4:(t,e,s)=>{function n(t,e,s){return t===e||t===s}s.d(e,{symbolSameAsResolved:()=>n})}}]);