Files
ai/charting_library/bundles/2736.0a918284704d00f41592.js

7 lines
21 KiB
JavaScript

"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[2736],{33578:(t,e,i)=>{function o(t,e){return(t&e)===e}i.d(e,{isPlotVisible:()=>o})},54025:(t,e,i)=>{function o(t,e){if(null===t)return e;const i=t.firstIndex,o=e.firstIndex,s=t.clearData||e.clearData;return{firstIndex:s||void 0===i||void 0===o?void 0:Math.min(i,o),clearData:s}}i.d(e,{mergeDataInvalidation:()=>o})},53598:(t,e,i)=>{var o;function s(t){t.lineWidth=void 0,t.lineStyle=void 0;for(let e=0;e<t.colors.length;e++)t.colors[e]=void 0;return t}function n(){return{colors:[void 0,void 0,void 0,void 0,void 0,void 0,void 0],lineWidth:void 0,lineStyle:void 0}}i.d(e,{clearStyle:()=>s,createEmptyStyle:()=>n}),function(t){t[t.Main=0]="Main",t[t.Background=1]="Background",t[t.Text=2]="Text",t[t.Border=3]="Border",t[t.Wick=4]="Wick",t[t.Up=5]="Up",t[t.Down=6]="Down"}(o||(o={}))},24561:(t,e,i)=>{i.d(e,{StudyPlotPaneView:()=>k});var o=i(85842),s=i(55482),n=i(7321),l=i(16905),r=i(85728),a=i(82347),d=i(29142);function c(t,e){const i=new Map;return function(...o){const s=""+(e?e.apply(null,o):o[0]);if(!i.has(s)){const e=t.apply(this,o);return i.set(s,e),e}return i.get(s)}}var h,u=i(18974),_=i(99680),p=i(4111),m=i(71412),f=i(71367),y=i(53598),g=i(57415),v=i(72244),I=i(83077),S=i(57507),P=i(45958);!function(t){t[t.MinCircleRadius=1.5]="MinCircleRadius",t[t.SimplifiedPaintingModeMaxBarSpacing=2]="SimplifiedPaintingModeMaxBarSpacing"}(h||(h={}));class x extends S.BitmapCoordinatesPaneRenderer{constructor(t){super(),this._data=t}hitTest(t){const e=this._data,i=e.lineWidth,o=e.vertOffset||0,s=(0,v.interactionTolerance)().series+i,n=e.visibleItemsRange?.startItemIndex??0,l=e.visibleItemsRange?.endItemIndex??e.items.length;for(let r=n;r<l;r++){const n=e.items[r];if(new g.Point(n.center,n.y+o).subtract(t).length()+i<=s)return new I.HitTestResult(I.HitTarget.Regular)}return null}_drawImpl(t){const e=this._data,{horizontalPixelRatio:i,verticalPixelRatio:o,context:s}=t,l=Math.max(1,Math.floor(i)),r=l%2?.5:0,{vertOffset:a=0,lineColor:d,lineWidth:c,barSpacing:h}=e;let u="",_=!1;const p=e.visibleItemsRange?.startItemIndex??0,m=e.visibleItemsRange?.endItemIndex??e.items.length;for(let t=p;t<m;t++){const p=e.items[t],m=p.center,f=p.y+a;if((0,n.isNaN)(m)||(0,n.isNaN)(f))continue;let y,g;null!=p.style?(y=p.style.color,g=p.style.width):(y=d,g=c),(y!==u||P.isSafari)&&(u=y,_&&s.fill(),s.beginPath(),s.fillStyle=y);const v=Math.round(m*i)+r,I=Math.round(f*o)+r;let S=Math.round(2*Math.max(1.5,g)*i);l%2!=S%2&&(S+=1),h>2||g>1.5?(s.moveTo(v+S/2,I),s.arc(v,I,S/2,0,2*Math.PI,!1)):s.rect(v-S/2,I-S/2,S,S),_=!0}_&&s.fill()}}var C=i(58618),w=i(17086);class b extends S.BitmapCoordinatesPaneRenderer{constructor(t){super(),this._data=t}hitTest(t){const e=(0,v.interactionTolerance)().series+this._data.lineWidth/2;let i,o,s,n;for(let l=1;l<this._data.items.length;++l){i=this._data.items[l-1],o=this._data.items[l],s=i.center,n=o.center;if((0,w.distanceToSegment)(new g.Point(s,i.y),new g.Point(n,o.y),new g.Point(t.x,t.y)).distance<=e)return new I.HitTestResult(I.HitTarget.Regular)}
return null}_drawImpl(t){const{context:e,horizontalPixelRatio:i,verticalPixelRatio:o}=t;let s="",l=!1;const r=this._data.visibleItemsRange?.startItemIndex??0,a=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(let t=r;t<=a;t++){const r=this._data.items[t];if((0,n.isNaN)(r.center)||(0,n.isNaN)(r.y))continue;const a=r.style?.color??this._data.lineColor,d=r.style?.width??this._data.lineWidth,c=Math.max(1,Math.floor(d*i)),h=Math.max(1,Math.floor(d*o));(a!==s||P.isSafari)&&(s=a,l&&e.fill(),e.beginPath(),e.fillStyle=a);let u=3*c;u%2!=c%2&&(u+=1);let _=3*h;_%2!=h%2&&(_+=1);const p=Math.round(Math.round(r.center*i)-u/2),m=Math.round(Math.round(r.y*o)-_/2),f=p+Math.floor(u/2-c/2),y=m+Math.floor(_/2-h/2);e.rect(p,y,u,h),e.rect(f,m,c,_),l=!0}l&&e.fill()}}class N extends S.BitmapCoordinatesPaneRenderer{constructor(t){super(),this._data=t}hitTest(t){const e=(0,v.interactionTolerance)().series+this._data.lineWidth/2,i=new Map;for(const s of this._data.items){const n=s.center,l=s.y;let r=e;s.style&&(i.has(s.style.width)?r=(0,o.ensureDefined)(i.get(s.style.width)):i.set(this._data.lineWidth,r));if((0,w.distanceToSegment)(new g.Point(n,l),new g.Point(n,this._data.histogramBase),new g.Point(t.x,t.y)).distance<=r)return new I.HitTestResult(I.HitTarget.Regular)}return null}_drawImpl(t){if(0===this._data.items.length)return;const{context:e,horizontalPixelRatio:i,verticalPixelRatio:o}=t;e.fillStyle=this._data.lineColor;const s=Math.max(1,Math.floor(this._data.lineWidth*i)),n=s/2,l=Math.max(1,Math.floor(i)),r=Math.round(this._data.histogramBase*o)-Math.floor(l/2),a=r+l,d=this._data.visibleItemsRange?.startItemIndex??0,c=(this._data.visibleItemsRange?.endItemIndex??this._data.items.length)-1;for(let t=d;t<=c;t++){const d=this._data.items[t];let c=s,h=n;d.style?(e.fillStyle=d.style.color,c=Math.max(1,Math.floor(d.style.width*i)),h=c/2):e.fillStyle=this._data.lineColor;const u=c%2?.5:0,_=Math.round(d.center*i)+u,p=Math.round(d.y*o);let m,f;p<=r?(m=p,f=a):(m=r,f=p-Math.floor(l/2)+l),e.fillRect(Math.floor(_-h),m,c,f-m)}}}var M=i(65164),R=i(49545),B=i(21515),D=i(93976),T=i(43787);const L=t=>{const e=(0,s.rgbToHsl)((0,s.parseRgb)(t)),i=e[0]+.05;return e[0]=i-Math.floor(i),(0,s.rgbToHexString)((0,s.hslToRgb)(e))},W=c(L);class k extends D.StudyPaneViewInplaceUpdatable{constructor(t,e,i,o,s=!1){super(e,i,o),this._histogramBase=null,this._lineColor="",this._lineWidth=1,this._color1="",this._color2="",this._renderer=new _.CompositeRenderer,this._isMarkersEnabled=(0,l.isFeaturesetEnabled)("source_selection_markers"),this._study=t,this._plotIndex=t.metaInfo().plots.findIndex((t=>t.id===o)),this._colorProvider=(0,R.createStudyPlotColorProvider)(t.metaInfo(),t.properties(),o),this._extendStepLineToBarsEndings=s,this._isFundamental=!1;const n=this._study.properties().styles[this._plotName].plottype.value();this._isStepLinePlot=n===M.LineStudyPlotStyle.StepLine||n===M.LineStudyPlotStyle.StepLineWithBreaks||n===M.LineStudyPlotStyle.StepLineWithDiamonds}items(){return this._items}renderer(){return this._makeSureRendererIsValid(),
this._renderer}_getTranspValue(){const t=this._study.properties(),e=t.styles[this._plotName];let i=0;const o=this._study.metaInfo();return"Volume@tv-basicstudies"===o.id&&o.version<=46&&"transparency"in t?(i=t.transparency.value(),i=(0,n.isNumber)(i)?i:0,i):(e.transparency&&(i=e.transparency.value(),i=(0,n.isNumber)(i)?i:0),i)}_updateImplFull(t){if(this._renderer.clear(),this._dataInvalidated?.clearData&&(this._items=[]),!this._study.isPlotVisibleAt(this._plotName,1))return!1;const e=this._priceScale();if(!e||e.isEmpty())return!1;if(null===this._study.firstValue(void 0,this.isForceOverlay()))return!1;this._histogramBase=null;const i=this._study.properties().styles[this._plotName],s=i.plottype.value(),n=this._isFundamental&&this._isStepLinePlot,l=this._study.plots().plottableRange(n);if(0===l.size())return!1;const d=this._study.offset(this._plotName),c=(0,M.doesLinePlotStyleSupportFillBreaks)(s),h=this._preallocateItems(l,((t,e)=>({y:NaN,left:NaN,center:NaN,right:NaN,price:e??NaN,timePointIndex:t+d})));let u=NaN,_=NaN;const p=new Map,m=(t,e)=>{let i=p.get(t);void 0===i&&(i=new Map,p.set(t,i));let o=i.get(e);if(void 0===o){const s=!this._plotName||"vol"!==this._plotName;o=(0,a.generateColor)(t,e,s),i.set(e,o)}return o},f=(0,y.createEmptyStyle)(),g=(0,r.clamp)(this._getTranspValue(),0,100),v=this._model.timeScale().visibleBarsStrictRange();if(null===v)return!1;const{startBar:I,endBar:S}=this._calculateStartEnd(v);if(null===I||null===S||0===this._items.length)return!1;const P=h??(0,o.ensureNotNull)(l.firstIndex()),x=(0,o.ensureNotNull)(l.lastIndex())+1,C=l.rangeIterator(P,x);let w,b=(0,B.lowerbound)(this._items,P+d,((t,e)=>t.timePointIndex<e));for(const t of C){let e=t.index;const o=t.value;e+=d,e=Math.floor(e);let s=o[this._plotIndex+1];const n=null==s;if(s=n?NaN:s,c&&n){_=s,u=e,b++;continue}const l=this._items[b];l.valIsNotSameAsPrev=s!==_||e-1!==u;if(this._colorProvider.isColorDefined()&&(l.style={color:m(i.color.value(),100),width:i.linewidth.value(),style:i.linestyle.value()},null!=s)){const t=this._colorProvider.getPlotPointStyle(o,f),e=t.colors[0];void 0!==e&&(l.style.color=(0,a.isHexColor)(e)?m(e,g):e),l.style.width=t.lineWidth??l.style.width,l.style.style=t.lineStyle??l.style.style}!c&&!isNaN(u)&&u!==e-1&&b>0&&(this._items[b].breakBefore=!0),_=s,u=e,b++,w=l}return this._updateImplLight(),!0}_correctVisibleItemIndexes(t,e){return super._correctVisibleItemIndexes(t,e)}_updateRenderer(t,e){this._renderer.clear();const i=this._study.properties().styles.childs()[this._plotName].childs(),s=this._study.metaInfo().styles?.[this._plotName],l=(0,r.clamp)(this._getTranspValue(),0,100);this._lineColor=(0,a.generateColor)(i.color.value(),l),this._lineWidth=i.linewidth.value();let c=i.color.value();const h=this._colorProvider.getDefaultPlotPointStyle();h&&(c=h.colors[0]||c,this._lineWidth=h.lineWidth??this._lineWidth,this._lineColor=c?(0,a.generateColor)(c,l):this._lineColor),this._color2=(0,a.generateColor)(c,l);const _=this._study.metaInfo().isRGB?L(c):W(c);this._color1=(0,a.generateColor)(_,l)
;const y=this._histogramBase?this._histogramBase:(0,o.ensureNotNull)(this._priceScale()).height(),g=i.plottype.value(),v={barSpacing:this._model.timeScale().barSpacing(),items:this._items,histogramBase:y,lineIndex:0,lineStyle:i.linestyle.value(),lineColor:this._lineColor,lineWidth:(0,n.isNumber)(this._lineWidth)?this._lineWidth:1,color1:this._color1,color2:this._color2,bottom:y,visibleItemsRange:{startItemIndex:t,endItemIndex:e},simpleMode:this._colorProvider.singleColor(),skipHoles:(0,M.doesLinePlotStyleSupportFillBreaks)(g)},I=this._renderer,S=Boolean(s?.joinPoints);switch(g){case M.LineStudyPlotStyle.Line:case M.LineStudyPlotStyle.LineWithBreaks:I.append(new p.PaneRendererLine({...v,lineColor:{type:T.ColorType.Solid,color:this._lineColor}}));break;case M.LineStudyPlotStyle.Area:case M.LineStudyPlotStyle.AreaWithBreaks:I.append(new u.PaneRendererArea({...v,lineColor:{type:T.ColorType.Solid,color:this._lineColor}}));break;case M.LineStudyPlotStyle.Histogram:I.append(new N(v));break;case M.LineStudyPlotStyle.Columns:I.append(new C.PaneRendererColumns(v));break;case M.LineStudyPlotStyle.Cross:I.append(new b(v)),S&&I.append(new p.PaneRendererLine({...(0,d.deepCopy)(v),lineWidth:1,lineColor:{type:T.ColorType.Solid,color:this._lineColor},forceLineWidth:!0}));break;case M.LineStudyPlotStyle.Circles:I.append(new x(v)),S&&I.append(new p.PaneRendererLine({...(0,d.deepCopy)(v),lineWidth:1,lineColor:{type:T.ColorType.Solid,color:this._lineColor},ignorePaletteLineWidth:!0}));break;case M.LineStudyPlotStyle.StepLine:case M.LineStudyPlotStyle.StepLineWithBreaks:case M.LineStudyPlotStyle.StepLineWithDiamonds:{const t=new m.PaneRendererStepLine;t.setData({...v,lineColor:{type:T.ColorType.Solid,color:this._lineColor},decoration:i.plottype.value()===M.LineStudyPlotStyle.StepLineWithDiamonds?m.StepLineDecoration.Diamonds:m.StepLineDecoration.None,extendToBarsEndings:this._extendStepLineToBarsEndings}),I.append(t);break}default:I.append(new p.PaneRendererLine({...v,lineColor:{type:T.ColorType.Solid,color:this._lineColor}}))}this._isMarkersEnabled&&this._selectionData&&I.append(new f.SelectionRenderer(this._selectionData))}_updateAdditionalPrices(t,e){const i=this._study.metaInfo().styles?.[this._plotName];void 0!==i?.histogramBase&&(this._histogramBase=t.priceToCoordinate(i.histogramBase,e))}}},93299:(t,e,i)=>{i.d(e,{StudyForceOverlayPlotView:()=>n});var o=i(85842);class s{constructor(t,e,i){this._series=t,this._model=e,this._plotName=i}isPlotHighlighted(){return!!this._study.hasHighlightedPlots()&&(0,o.ensureNotNull)(this._model.highlightedPlotInfo()).plotId===this._plotName}}class n extends s{isForceOverlay(){return!!this._study.metaInfo().isPlotForceOverlay(this._plotName)}_priceScale(){return this.isForceOverlay()?this._model.mainSeries().priceScale():this._study.priceScale()}}},93976:(t,e,i)=>{i.d(e,{StudyPaneViewInplaceUpdatable:()=>u});var o=i(85842),s=i(57415),n=i(7321),l=i(54025),r=i(44850),a=i(21515),d=i(88858),c=i(83077),h=i(93299);class u extends h.StudyForceOverlayPlotView{constructor(t,e,i){super(t,e,i),
this._selectionData=null,this._dataInvalidated=null,this._viewportInvalidated=!1,this._items=[],this._selectionIndexer=new d.SelectionIndexes(e.timeScale())}update(t){if("hover-change"!==t.type){if("global-change"===t.type)return this._dataInvalidated=(0,l.mergeDataInvalidation)(this._dataInvalidated,{}),void(this._viewportInvalidated=!0);if("data-source-change"!==t.type)this._viewportInvalidated=!0;else{if((t.sourceId===this._study.id()||this._dependsOnSeriesData()&&t.sourceId===this._model.mainSeries().id())&&!t.nonSeriesOnly){const e=(0,l.mergeDataInvalidation)(this._dataInvalidated,{firstIndex:t.firstUpdatedTimePointIndex,clearData:t.clearData});this._dataInvalidated=e}}}}_dependsOnSeriesData(){return!1}_makeSureRendererIsValid(){this._dataInvalidated?this._updateImplFull(this._viewportInvalidated)&&(this._dataInvalidated=null):this._viewportInvalidated&&this._updateImplLight(),this._viewportInvalidated=!1}_preallocateItems(t,e){const i=t.size();let s=this._dataInvalidated?.firstIndex;if(0===i)return s;const n=this._study.offset(this._plotName);if(i!==this._items.length){const i=void 0!==s?s+n:void 0;if(void 0===i||0===this._items.length||i<(0,o.ensureDefined)(this._items[0].timePointIndex))return this._items=[],t.each(((t,i)=>{const o=i[this._plotIndex+1];return this._items.push(e(t,o)),!1})),this._items.length?(0,o.ensureDefined)(this._items[0].timePointIndex)-n:void 0;{const i=(0,o.ensureDefined)(s),l=n>=0?0:n,r=n>=0?n:0;let d=(0,a.lowerbound)(this._items,i+l,((t,e)=>t.timePointIndex<e));const c=(0,o.ensureNotNull)(t.lastIndex()),h=t.rangeIterator(i-r,c);for(const t of h)if(void 0!==d&&this._items[d]?.timePointIndex===t.index+n)d=this._updateItem(t,d);else{const i=t.value[this._plotIndex+1];this._items.push(e(t.index,i))}}}else if(s=s??t.firstIndex()??void 0,void 0!==s){const e=n>=0?0:n,i=n>=0?n:0;let l=(0,a.lowerbound)(this._items,s+e,((t,e)=>t.timePointIndex<e));const r=(0,o.ensureNotNull)(t.lastIndex())+1,d=t.rangeIterator(s-i,r);for(const t of d)l=this._updateItem(t,l)}return s}_updateItem(t,e){const i=this._getValueForUpdating(t);return this._items[e].price=i??NaN,e+1}_getValueForUpdating(t){return t.value[this._plotIndex+1]}_calculateStartEnd(t){const e=this._study.offset(this._plotName);let i=t.firstBar()-Math.abs(e)-1,s=t.lastBar()+Math.abs(e)+1;const n=this._study.getMinFirstBarIndexForPlot(this._plotName)+e;if(n>s+1)return{startBar:null,endBar:null};const l=this._study.plots();if(l.isEmpty())return{startBar:null,endBar:null};const a=l.range(n,(0,o.ensureNotNull)(l.lastIndex()));i=Math.max(i,n),s=Math.max(s,n);const d=a.search(i,r.PlotRowSearchMode.NearestLeft,this._plotIndex+1),c=a.search(s,r.PlotRowSearchMode.NearestRight,this._plotIndex+1);return null!==d&&(i=d.index),null!==c&&(s=c.index),i=Math.max(n,i),{startBar:i,endBar:s}}_updateImplLight(){const t=this._study.firstValue(void 0,this.isForceOverlay());if(null===t)return this._selectionData=null,void this._updateRenderer(0,-1);const e=this._priceScale();if(null===e||e.isEmpty())return this._selectionData=null,void this._updateRenderer(0,-1)
;const i=this._model.timeScale().visibleBarsStrictRange();if(null===i)return this._selectionData=null,void this._updateRenderer(0,-1);const{startBar:o,endBar:s}=this._calculateStartEnd(i);if(null===o||null===s||0===this._items.length)return this._selectionData=null,void this._updateRenderer(0,-1);const{startItemIndex:n,endItemIndex:l}=this._correctVisibleItemIndexes(Math.max(0,(0,a.lowerbound)(this._items,o,((t,e)=>t.timePointIndex<e))),Math.min(this._items.length,(0,a.upperbound)(this._items,s,((t,e)=>t<e.timePointIndex))));if(n>=l)return this._selectionData=null,void this._updateRenderer(0,-1);this._convertItemsToCoordinates(e,t,n,l),this._createSelection(t),this._updateRenderer(n,l)}_correctVisibleItemIndexes(t,e){return{startItemIndex:t,endItemIndex:e}}_convertItemsToCoordinates(t,e,i,o){this._convertItemsToCoordinatesImpl(t,e,i,o)}_convertItemsToCoordinatesImpl(t,e,i,o){t.fillYCoordinates(this._items,e,{startItemIndex:i,endItemIndex:o}),this._model.timeScale().fillBarBorders(this._items,{startItemIndex:i,endItemIndex:o},!0),this._updateAdditionalPrices(t,e)}_updateAdditionalPrices(t,e){}_createSelection(t){const e=this._priceScale();if(null===e)return;if(this._selectionData={points:[],bgColors:[],visible:!0,hittestResult:c.HitTarget.Regular,barSpacing:this._model.timeScale().barSpacing()},!this.isPlotHighlighted()&&(!this._model.selection().isSelected(this._study)||this._study.hasHighlightedPlots()))return void this._selectionIndexer.clear();const i=(0,o.ensureNotNull)(this._model.paneForSource(this._study)).height(),s=this._study.offset(this._plotName);for(const o of this._selectionIndexer.indexes()){const l=this._study.plots().valueAt(o);if((0,n.isAbsent)(l))continue;const r=l[this._plotIndex+1];if((0,n.isAbsent)(r))continue;const a=this._createSelectionDataPoint(e,Math.floor(o+s),r,t);this._selectionData.points.push(a),this._selectionData.bgColors.push(this._model.backgroundColorAtYPercentFromTop(a.point.y/i))}}_createSelectionDataPoint(t,e,i,o){const n=this._model.timeScale().indexToCoordinate(e),l=t.priceToCoordinate(i,o);return{point:(0,s.point)(n,l)}}}},49545:(t,e,i)=>{i.d(e,{createStudyPlotColorProvider:()=>p});var o=i(65164),s=i(85842),n=i(53598),l=i(7321);const r=new Map([[0,"color"],[2,"textColor"],[3,"borderColor"],[4,"wickColor"],[5,"colorup"],[6,"colordown"]]);class a{constructor(t){const e=t.childs(),i=[e.color?t=>t.colors[0]=e.color?.value():null,e.colorup?t=>t.colors[5]=e.colorup?.value():null,e.colordown?t=>t.colors[6]=e.colordown?.value():null,e.textColor?t=>t.colors[2]=e.textColor?.value():null,e.borderColor?t=>t.colors[3]=e.borderColor?.value():null,e.wickColor?t=>t.colors[4]=e.wickColor?.value():null,e.linewidth?t=>t.lineWidth=e.linewidth?.value():null,e.linestyle?t=>t.lineStyle=e.linestyle?.value():null].filter(l.notNull);this._fillPlotStyles=t=>{for(const e of i)e(t)}}getPlotPointStyle(t,e){const i=e?(0,n.clearStyle)(e):(0,n.createEmptyStyle)();return this._fillPlotStyles(i),i}isColorDefined(){return!0}singleColor(){return!0}getDefaultPlotPointStyle(){return null}}const d=[0,1,2,3,4,5,6]
;class c{constructor(t,e,i,o){this._palettesColors=new Map,this._defaultPlotColors=new Map,this._indexes=o;const n=e.styles[i];if(n)for(const[t,e]of r)this._defaultPlotColors.set(t,n[e]);const l=(0,s.ensureDefined)(t.palettes),a=t.plots;o.forEach(((t,i)=>{const o=a[t];if(o&&"palette"in o){const t=l[o.palette],s=e.palettes[o.palette];if(t&&s){const{valToIndex:e}=t,{colors:o}=s,n={...o};e&&Object.keys(e).forEach((t=>{const i=e[t];void 0!==i&&(n[t]=o[i])})),this._palettesColors.set(i,n)}}}))}getPlotPointStyle(t,e){const i=e?(0,n.clearStyle)(e):(0,n.createEmptyStyle)();return d.forEach((e=>{if(this._palettesColors.has(e)){const o=t[(0,s.ensureDefined)(this._indexes.get(e))+1];if("number"==typeof o){const t=this._palettesColors.get(e)?.[o];0===e&&t&&(i.lineWidth=t.width.value(),i.lineStyle=t.style.value()),i.colors[e]=t?.color.value()}else i.colors[e]="transparent"}else i.colors[e]=this._defaultPlotColors.get(e)?.value()})),i}getDefaultPlotPointStyle(){const t=this._palettesColors.get(0)?.[0];if(void 0!==t){return{colors:[t.color.value(),void 0,void 0,void 0,void 0,void 0,void 0],lineStyle:void 0,lineWidth:t.width.value()}}return null}isColorDefined(){return!!this._palettesColors.size}singleColor(){return!1}}var h=i(17785);class u{constructor(t){this._rgbaFromInteger=(0,h.rgbaFromIntegerCached)(),this._indexes=t}getPlotPointStyle(t,e){const i=e?(0,n.clearStyle)(e):(0,n.createEmptyStyle)();return this._indexes.forEach(((e,o)=>{const s=t[e+1];if(null!=s){const t=this._rgbaFromInteger(s);i.colors[o]=t}else i.colors[o]="transparent"})),i}isColorDefined(){return!0}singleColor(){return!1}getDefaultPlotPointStyle(){return null}}const _=new Map([[0,function(t,e){const i=(0,o.isColorerPlot)(e)||(0,o.isOhlcColorerPlot)(e);return"target"in e&&e.target===t&&i}],[2,function(t,e){const i=(0,o.isTextColorerPlot)(e);return"target"in e&&e.target===t&&i}],[1,function(t,e){return(0,o.isBgColorerPlot)(e)&&e.id===t}],[3,function(t,e){const i=(0,o.isCandleBorderColorerPlot)(e);return"target"in e&&e.target===t&&i}],[4,function(t,e){const i=(0,o.isCandleWickColorerPlot)(e);return"target"in e&&e.target===t&&i}],[5,function(t,e){const i=(0,o.isUpColorerPlot)(e);return"target"in e&&e.target===t&&i}],[6,function(t,e){const i=(0,o.isDownColorerPlot)(e);return"target"in e&&e.target===t&&i}]]);function p(t,e,i){const{colorers:o}=function(t,e){const i=t.plots,o=i.findIndex((t=>t.id===e)),s=new Map;return i.forEach(((t,i)=>{_.forEach(((o,n)=>{o(e,t)&&s.set(n,i)}))})),{plotIndex:-1===o?null:o,colorers:s}}(t,i);if(o.size)return t.isRGB?new u(o):new c(t,e,i,o);{const t=e.ohlcPlots;if(t&&t[i])return new a(t[i]);const o=e.styles[i];return new a(o)}}},17785:(t,e,i)=>{i.d(e,{rgbaFromIntegerCached:()=>l});var o=i(4003),s=i(82347),n=i(19050);function l(t=1e3){const e=o.default.Cache;o.default.Cache=n.CircularCacheBuffer.bind(n.CircularCacheBuffer,t);const i=(0,o.default)(s.rgbaFromInteger);return o.default.Cache=e,i}}}]);