Ostatnio oglądane

USD/PLN
3,8323
+0,07%0,0027
2024-09-20 03:23
Dodaj do portfelaUSD/PLN

USD/PLN ‑ notowania

Przejdź do Analizy TechnicznejSprawdź
USD/PLN
Okres:
1D
1T
1M
3M
1R
Max
Własny okres
Pokaż
Interwał:
1 min
5 min
15 min
30 min
1 h
1 dzień
1 tydzień
1 miesiąc
1 rok
Okres:
Interwał:
Powered by TradingView
Liniowy
Świecowy
Słupkowy
Powiązane artykuły
    ParaŚredniZmianaZmiana (%)Kupno (bid)Sprzedaż (ask)Czas
    EUR/PLN4,27680,0021+0,05%4,27554,27822024-09-20 03:23
    CHF/PLN4,52520,0072+0,16%4,52304,52752024-09-20 03:23
    GBP/PLN5,08740,0007+0,01%5,08415,09072024-09-20 03:22
    EUR/USD1,1159-0,0004-0,03%1,11591,11602024-09-20 03:23

    "),yn(this.referenceElement.ownerDocument,t,A),n.replaceChild(n.adoptNode(this.documentElement),n.documentElement),n.close(),e):Promise.reject("Unable to find iframe window")},Q.prototype.createElementClone=function(A){var t;return Ci(A,2),Yr(A)?this.createCanvasClone(A):Er(A)?this.createVideoClone(A):Sr(A)?this.createStyleClone(A):(t=A.cloneNode(!1),Xr(t)&&(Xr(A)&&A.currentSrc&&A.currentSrc!==A.src&&(t.src=A.currentSrc,t.srcset=""),"lazy"===t.loading)&&(t.loading="eager"),Hr(t)?this.createCustomElementClone(t):t)},Q.prototype.createCustomElementClone=function(A){var t=document.createElement("html2canvascustomelement");return Fn(A.style,t),t},Q.prototype.createStyleClone=function(A){try{var t,e,i=A.sheet;if(i&&i.cssRules)return t=[].slice.call(i.cssRules,0).reduce(function(A,t){return t&&"string"==typeof t.cssText?A+t.cssText:A},""),(e=A.cloneNode(!1)).textContent=t,e}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},Q.prototype.createCanvasClone=function(t){var A;if(this.options.inlineImages&&t.ownerDocument){var e=t.ownerDocument.createElement("img");try{return e.src=t.toDataURL(),e}catch(A){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}e=t.cloneNode(!1);try{e.width=t.width,e.height=t.height;var i,r,n=t.getContext("2d"),a=e.getContext("2d");a&&(!this.options.allowTaint&&n?a.putImageData(n.getImageData(0,0,t.width,t.height),0,0):((i=null!=(A=t.getContext("webgl2"))?A:t.getContext("webgl"))&&!1===(null==(r=i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t),a.drawImage(t,0,0)))}catch(A){this.context.logger.info("Unable to clone canvas as it is tainted",t)}return e},Q.prototype.createVideoClone=function(t){var A=t.ownerDocument.createElement("canvas"),e=(A.width=t.offsetWidth,A.height=t.offsetHeight,A.getContext("2d"));try{return e&&(e.drawImage(t,0,0,A.width,A.height),this.options.allowTaint||e.getImageData(0,0,A.width,A.height)),A}catch(A){this.context.logger.info("Unable to clone video as it is tainted",t)}e=t.ownerDocument.createElement("canvas");return e.width=t.offsetWidth,e.height=t.offsetHeight,e},Q.prototype.appendChildNode=function(A,t,e){kr(t)&&("SCRIPT"===t.tagName||t.hasAttribute(gn)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&kr(t)&&Sr(t)||A.appendChild(this.cloneNode(t,e))},Q.prototype.cloneChildNodes=function(A,t,e){for(var i,r=this,n=(A.shadowRoot||A).firstChild;n;n=n.nextSibling)kr(n)&&qr(n)&&"function"==typeof n.assignedNodes?(i=n.assignedNodes()).length&&i.forEach(function(A){return r.appendChildNode(t,A,e)}):this.appendChildNode(t,n,e)},Q.prototype.cloneNode=function(A,t){var e,i,r,n,a;return Kr(A)?document.createTextNode(A.data):A.ownerDocument&&(r=A.ownerDocument.defaultView)&&kr(A)&&(Or(A)||Vr(A))?((e=this.createElementClone(A)).style.transitionProperty="none",i=r.getComputedStyle(A),a=r.getComputedStyle(A,":before"),r=r.getComputedStyle(A,":after"),this.referenceElement===A&&Or(e)&&(this.clonedReferenceElement=e),zr(e)&&In(e),n=this.counters.parse(new wi(this.context,i)),a=this.resolvePseudoContent(A,e,a,nn.BEFORE),Hr(A)&&(t=!0),Er(A)||this.cloneChildNodes(A,e,t),a&&e.insertBefore(a,e.firstChild),(a=this.resolvePseudoContent(A,e,r,nn.AFTER))&&e.appendChild(a),this.counters.pop(n),(i&&(this.options.copyStyles||Vr(A))&&!Jr(A)||t)&&Fn(i,e),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([e,A.scrollLeft,A.scrollTop]),(Zr(A)||jr(A))&&(Zr(e)||jr(e))&&(e.value=A.value),e):A.cloneNode(!1)},Q.prototype.resolvePseudoContent=function(a,A,t,e){var s=this;if(t){var o,l,i=t.content,_=A.ownerDocument;if(_&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==t.display)return this.counters.parse(new wi(this.context,t)),o=new fi(this.context,t),l=_.createElement("html2canvaspseudoelement"),Fn(t,l),o.content.forEach(function(A){if(0===A.type)l.appendChild(_.createTextNode(A.value));else if(22===A.type){var t=_.createElement("img");t.src=A.value,t.style.opacity="1",l.appendChild(t)}else if(18===A.type){var e,i,r,n;"attr"===A.name?(t=A.values.filter(p)).length&&l.appendChild(_.createTextNode(a.getAttribute(t[0].value)||"")):"counter"===A.name?(r=(t=A.values.filter($A))[0],n=t[1],r&&p(r)&&(t=s.counters.getCounterValue(r.value),e=n&&p(n)?Ie.parse(s.context,n.value):3,l.appendChild(_.createTextNode(Bn(t,e,!1))))):"counters"===A.name&&(r=(t=A.values.filter($A))[0],e=t[1],n=t[2],r)&&p(r)&&(t=s.counters.getCounterValues(r.value),i=n&&p(n)?Ie.parse(s.context,n.value):3,r=e&&0===e.type?e.value:"",n=t.map(function(A){return Bn(A,i,!1)}).join(r),l.appendChild(_.createTextNode(n)))}else if(20===A.type)switch(A.value){case"open-quote":l.appendChild(_.createTextNode(zt(o.quotes,s.quoteDepth++,!0)));break;case"close-quote":l.appendChild(_.createTextNode(zt(o.quotes,--s.quoteDepth,!1)));break;default:l.appendChild(_.createTextNode(A.value))}}),l.className=En+" "+Sn,i=e===nn.BEFORE?" "+En:" "+Sn,Vr(A)?A.className.baseValue+=i:A.className+=i,l}},Q.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},Q);function Q(A,t,e){if(this.context=A,this.options=e,this.scrolledElements=[],this.referenceElement=t,this.counters=new $r,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}(C=nn=nn||{})[C.BEFORE=0]="BEFORE",C[C.AFTER=1]="AFTER";function fn(t){return new Promise(function(A){!t.complete&&t.src?(t.onload=A,t.onerror=A):A()})}var wn=function(A,t){var e=A.createElement("iframe");return e.className="html2canvas-container",e.style.visibility="hidden",e.style.position="fixed",e.style.left="-10000px",e.style.top="0px",e.style.border="0",e.width=t.width.toString(),e.height=t.height.toString(),e.scrolling="no",e.setAttribute(gn,"true"),A.body.appendChild(e),e},mn=function(A){return Promise.all([].slice.call(A.images,0).map(fn))},Cn=function(r){return new Promise(function(t,A){var e=r.contentWindow;if(!e)return A("No window assigned for iframe");var i=e.document;e.onload=r.onload=function(){e.onload=r.onload=null;var A=setInterval(function(){0"),t},yn=function(A,t,e){A&&A.defaultView&&(t!==A.defaultView.pageXOffset||e!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(t,e)},bn=function(A){var t=A[0],e=A[1],A=A[2];t.scrollLeft=e,t.scrollTop=A},En="___html2canvas___pseudoelement_before",Sn="___html2canvas___pseudoelement_after",Hn='{\n content: "" !important;\n display: none !important;\n}',In=function(A){Mn(A,"."+En+":before"+Hn+"\n ."+Sn+":after"+Hn)},Mn=function(A,t){var e=A.ownerDocument;e&&((e=e.createElement("style")).textContent=t,A.appendChild(e))},Dn=(F.getOrigin=function(A){var t=F._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},F.isSameOrigin=function(A){return F.getOrigin(A)===F._origin},F.setContext=function(A){F._link=A.document.createElement("a"),F._origin=F.getOrigin(A.location.href)},F._origin="about:blank",F);function F(){}Tn.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(Rn(A)||On(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},Tn.prototype.match=function(A){return this._cache[A]},Tn.prototype.loadImage=function(a){return h(this,void 0,void 0,function(){var t,i,e,r,n=this;return M(this,function(A){switch(A.label){case 0:return(t=Dn.isSameOrigin(a),i=!Vn(a)&&!0===this._options.useCORS&&w.SUPPORT_CORS_IMAGES&&!t,e=!Vn(a)&&!t&&!Rn(a)&&"string"==typeof this._options.proxy&&w.SUPPORT_CORS_XHR&&!i,t||!1!==this._options.allowTaint||Vn(a)||Rn(a)||e||i)?(r=a,e?[4,this.proxy(r)]:[3,2]):[2];case 1:r=A.sent(),A.label=2;case 2:return this.context.logger.debug("Added image "+a.substring(0,256)),[4,new Promise(function(A,t){var e=new Image;e.onload=function(){return A(e)},e.onerror=t,(Pn(r)||i)&&(e.crossOrigin="anonymous"),e.src=r,!0===e.complete&&setTimeout(function(){return A(e)},500),0e.width+B?0:Math.max(0,n-B),Math.max(0,a-p),y.TOP_RIGHT):new U(e.left+e.width-B,e.top+p),this.bottomRightPaddingBox=0e.width+v+t?0:n-v+t,a-(p+f),y.TOP_RIGHT):new U(e.left+e.width-(B+w),e.top+p+f),this.bottomRightContentBox=0A.element.container.styles.zIndex.order?(i=t,!1):0=A.element.container.styles.zIndex.order?(r=t+1,!1):0t===A._internal_callback);-1A._internal_linkedObject!==t)}_internal_fire(t,e,i){var A=[...this._private__listeners];this._private__listeners=this._private__listeners.filter(A=>!A._internal_singleshot),A.forEach(A=>A._internal_callback(t,e,i))}_internal_hasListeners(){return 0{A._internal_draw(t,e,i)})}}class e{_internal_draw(A,t,e){A.useMediaCoordinateSpace(A=>this._internal__drawImpl(A,t,e))}_internal_drawBackground(A,t,e){A.useMediaCoordinateSpace(A=>this._internal__drawBackgroundImpl(A,t,e))}_internal__drawBackgroundImpl(A,t,e){}}class $ extends e{constructor(){super(...arguments),this._internal__data=null}_internal_setData(A){this._internal__data=A}_internal__drawImpl({context:i}){if(null!==this._internal__data&&null!==this._internal__data._internal_visibleRange){const r=this._internal__data._internal_visibleRange,n=this._internal__data;var A=t=>{i.beginPath();for(let A=r.to-1;A>=r.from;--A){var e=n._internal_items[A];i.moveTo(e._internal_x,e._internal_y),i.arc(e._internal_x,e._internal_y,t,0,2*Math.PI)}i.fill()};0{var t=new $;return t._internal_setData(A),t}),this._private__compositeRenderer._internal_setRenderers(this._private__markersRenderers)),this._private__invalidated=!0}_internal_renderer(){return this._private__invalidated&&(this._private__updateImpl(),this._private__invalidated=!1),this._private__compositeRenderer}_private__updateImpl(){var A=this._private__chartModel._internal_serieses();const r=this._private__crosshair._internal_appliedIndex(),n=this._private__chartModel._internal_timeScale();A.forEach((A,t)=>{var e,t=this._private__markersData[t],i=A._internal_markerDataAtIndex(r);null!==i&&A._internal_visible()?(e=B(A._internal_firstValue()),t._internal_lineColor=i._internal_backgroundColor,t._internal_radius=i._internal_radius,t._internal_lineWidth=i._internal_borderWidth,t._internal_items[0]._internal_price=i._internal_price,t._internal_items[0]._internal_y=A._internal_priceScale()._internal_priceToCoordinate(i._internal_price,e._internal_value),t._internal_backColor=null!=(e=i._internal_borderColor)?e:this._private__chartModel._internal_backgroundColorAtYPercentFromTop(t._internal_items[0]._internal_y/A._internal_priceScale()._internal_height()),t._internal_items[0]._internal_time=r,t._internal_items[0]._internal_x=n._internal_indexToCoordinate(r),t._internal_visibleRange=tA):t._internal_visibleRange=null})}}class c{_internal_draw(A,t,e){A.useBitmapCoordinateSpace(A=>this._internal__drawImpl(A,t,e))}}class iA extends c{constructor(A){super(),this._private__data=A}_internal__drawImpl({context:A,bitmapSize:t,horizontalPixelRatio:e,verticalPixelRatio:i}){var r,n,a,s,o,l;null!==this._private__data&&(a=this._private__data._internal_vertLine._internal_visible,r=this._private__data._internal_horzLine._internal_visible,a||r)&&(s=Math.round(this._private__data._internal_x*e),n=Math.round(this._private__data._internal_y*i),A.lineCap="butt",a&&00===A?A:A+t):A+t}function sA(A,t,e,i,r,n){let a,s,o,l;if(Array.isArray(n))if(2===n.length){var _=Math.max(0,n[0]),h=Math.max(0,n[1]);a=_,s=_,o=h,l=h}else{if(4!==n.length)throw new Error("Wrong border radius - it should be like css border radius");a=Math.max(0,n[0]),s=Math.max(0,n[1]),o=Math.max(0,n[2]),l=Math.max(0,n[3])}else{_=Math.max(0,n);a=_,s=_,o=_,l=_}A.beginPath(),A.moveTo(t+a,e),A.lineTo(t+i-s,e),0!==s&&A.arcTo(t+i,e,t+i,e+s,s),A.lineTo(t+i,e+r-o),0!==o&&A.arcTo(t+i,e+r,t+i-o,e+r,o),A.lineTo(t+l,e+r),0!==l&&A.arcTo(t,e+r,t,e+r-l,l),A.lineTo(t,e+a),0!==a&&A.arcTo(t,e,t+a,e,a)}function oA(A,t,e,i,r,n,a=0,s=0,o=""){var l;A.save(),a&&o&&o!==n?(l=a/2,"transparent"!==n&&(sA(A,t+a,e+a,i-2*a,r-2*a,aA(s,-a)),A.fillStyle=n,A.fill()),"transparent"!==o&&(sA(A,t+l,e+l,i-a,r-a,aA(s,-l)),A.lineWidth=a,A.strokeStyle=o,A.closePath(),A.stroke())):(sA(A,t,e,i,r,s),A.fillStyle=n,A.fill()),A.restore()}function lA(A,t,e,i,r,n,a){A.save(),A.globalCompositeOperation="copy";var s=A.createLinearGradient(0,0,0,r);s.addColorStop(0,n),s.addColorStop(1,a),A.fillStyle=s,A.fillRect(t,e,i,r),A.restore()}class _A{constructor(A,t){this._internal_setData(A,t)}_internal_setData(A,t){this._private__data=A,this._private__commonData=t}_internal_height(A,t){return this._private__data._internal_visible?A._internal_fontSize+A._internal_paddingTop+A._internal_paddingBottom:0}_internal_draw(A,n,t,a){if(this._private__data._internal_visible&&0!==this._private__data._internal_text.length){const s=this._private__data._internal_color,o=this._private__commonData._internal_background,e=A.useBitmapCoordinateSpace(A=>{const e=A.context,i=(e.font=n._internal_font,this._private__calculateGeometry(A,n,t,a)),r=i._internal_bitmap;A=(A,t)=>{i._internal_alignRight?oA(e,r._internal_xOutside,r._internal_yTop,r._internal_totalWidth,r._internal_totalHeight,A,r._internal_horzBorder,[r._internal_radius,0,0,r._internal_radius],t):oA(e,r._internal_xInside,r._internal_yTop,r._internal_totalWidth,r._internal_totalHeight,A,r._internal_horzBorder,[0,r._internal_radius,r._internal_radius,0],t)};return A(o,"transparent"),this._private__data._internal_tickVisible&&(e.fillStyle=s,e.fillRect(r._internal_xInside,r._internal_yMid,r._internal_xTick-r._internal_xInside,r._internal_tickHeight)),A("transparent",o),this._private__data._internal_borderVisible&&(e.fillStyle=n._internal_paneBackgroundColor,e.fillRect(i._internal_alignRight?r._internal_right-r._internal_horzBorder:0,r._internal_yTop,r._internal_horzBorder,r._internal_yBottom-r._internal_yTop)),i});A.useMediaCoordinateSpace(({context:A})=>{var t=e._internal_media;A.font=n._internal_font,A.textAlign=e._internal_alignRight?"right":"left",A.textBaseline="middle",A.fillStyle=s,A.fillText(this._private__data._internal_text,t._internal_xText,(t._internal_yTop+t._internal_yBottom)/2+t._internal_textMidCorrection)})}}_private__calculateGeometry(A,t,e,i){var{context:A,bitmapSize:r,mediaSize:n,horizontalPixelRatio:a,verticalPixelRatio:s}=A,o=this._private__data._internal_tickVisible||!this._private__data._internal_moveTextToInvisibleTick?t._internal_tickLength:0,l=this._private__data._internal_separatorVisible?t._internal_borderSize:0,_=t._internal_paddingTop+this._private__commonData._internal_additionalPaddingTop,h=t._internal_paddingBottom+this._private__commonData._internal_additionalPaddingBottom,c=t._internal_paddingInner,u=t._internal_paddingOuter,d=this._private__data._internal_text,p=t._internal_fontSize,B=e._internal_yMidCorrection(A,d),e=Math.ceil(e._internal_measureText(A,d)),A=p+_+h,d=t._internal_borderSize+c+u+e+o,p=Math.max(1,Math.floor(s));let g=Math.round(A*s);g%2!=p%2&&(g+=1);_=0(A.font=_._internal_font,Math.round(_._internal_widthCache._internal_measureText(A,B(this._private__data)._internal_text,uA))));if(!(er&&(A-=Math.abs(r-(l+e)),l=Math.floor(A-i)+.5);const h=l+e,c=Math.ceil(0+_._internal_borderSize+_._internal_tickLength+_._internal_paddingTop+_._internal_fontSize+_._internal_paddingBottom);t.useBitmapCoordinateSpace(({context:A,horizontalPixelRatio:t,verticalPixelRatio:e})=>{var i=B(this._private__data),r=(A.fillStyle=i._internal_background,Math.round(l*t)),n=Math.round(0*e),a=Math.round(h*t),s=Math.round(c*e),o=Math.round(2*t);A.beginPath(),A.moveTo(r,n),A.lineTo(r,s-o),A.arcTo(r,s,r+o,s,o),A.lineTo(a-o,s),A.arcTo(a,s,a,s-o,o),A.lineTo(a,n),A.fill(),i._internal_tickVisible&&(r=Math.round(i._internal_coordinate*t),s=n,o=Math.round((s+_._internal_tickLength)*e),A.fillStyle=i._internal_color,a=Math.max(1,Math.floor(t)),n=Math.floor(.5*t),A.fillRect(r-n,s,a,o-s))}),t.useMediaCoordinateSpace(({context:A})=>{var t=B(this._private__data),e=0+_._internal_borderSize+_._internal_tickLength+_._internal_paddingTop+_._internal_fontSize/2,i=(A.font=_._internal_font,A.textAlign="left",A.textBaseline="middle",A.fillStyle=t._internal_color,_._internal_widthCache._internal_yMidCorrection(A,"Apr0"));A.translate(l+n,e+i),A.fillText(t._internal_text,0,0)})}}}}class pA{constructor(A,t,e){this._private__invalidated=!0,this._private__renderer=new dA,this._private__rendererData={_internal_visible:!1,_internal_background:"#4c525e",_internal_color:"white",_internal_text:"",_internal_width:0,_internal_coordinate:NaN,_internal_tickVisible:!0},this._private__crosshair=A,this._private__model=t,this._private__valueProvider=e}_internal_update(){this._private__invalidated=!0}_internal_renderer(){return this._private__invalidated&&(this._private__updateImpl(),this._private__invalidated=!1),this._private__renderer._internal_setData(this._private__rendererData),this._private__renderer}_private__updateImpl(){var A,t,e=this._private__rendererData,i=(e._internal_visible=!1,this._private__crosshair._internal_options().vertLine);!i.labelVisible||(A=this._private__model._internal_timeScale())._internal_isEmpty()||(e._internal_width=A._internal_width(),null!==(t=this._private__valueProvider())&&(e._internal_coordinate=t._internal_coordinate,t=A._internal_indexToTimeScalePoint(this._private__crosshair._internal_appliedIndex()),e._internal_text=A._internal_formatDateTime(B(t)),e._internal_visible=!0,t=W(i.labelBackgroundColor),e._internal_background=t._internal_background,e._internal_color=t._internal_foreground,e._internal_tickVisible=A._internal_options().ticksVisible))}}class BA{constructor(){this._internal__priceScale=null,this._private__zorder=0}_internal_zorder(){return this._private__zorder}_internal_setZorder(A){this._private__zorder=A}_internal_priceScale(){return this._internal__priceScale}_internal_setPriceScale(A){this._internal__priceScale=A}_internal_labelPaneViews(A){return[]}_internal_timeAxisViews(){return[]}_internal_visible(){return!0}}t.CrosshairMode=void 0,(A=t.CrosshairMode||(t.CrosshairMode={}))[A.Normal=0]="Normal",A[A.Magnet=1]="Magnet";class gA extends BA{constructor(A,t){super(),this._private__pane=null,this._private__price=NaN,this._private__index=0,this._private__visible=!0,this._private__priceAxisViews=new Map,this._private__subscribed=!1,this._private__x=NaN,this._private__y=NaN,this._private__originX=NaN,this._private__originY=NaN,this._private__model=A,this._private__options=t,this._private__markersPaneView=new eA(A,this);this._private__currentPosPriceProvider=(i=()=>this._private__price,r=()=>this._private__y,A=>{var t=r(),e=i();return A===B(this._private__pane)._internal_defaultPriceScale()?{_internal_price:e,_internal_coordinate:t}:(e=B(A._internal_firstValue()),{_internal_price:A._internal_coordinateToPrice(t,e),_internal_coordinate:t})}),e=()=>this._private__index,n=()=>this._internal_appliedX();var i,r,e,n,t=()=>{var A=this._private__model._internal_timeScale()._internal_indexToTime(e()),t=n();return A&&Number.isFinite(t)?{_internal_time:A,_internal_coordinate:t}:null};this._private__timeAxisView=new pA(this,A,t),this._private__paneView=new rA(this)}_internal_options(){return this._private__options}_internal_saveOriginCoord(A,t){this._private__originX=A,this._private__originY=t}_internal_clearOriginCoord(){this._private__originX=NaN,this._private__originY=NaN}_internal_originCoordX(){return this._private__originX}_internal_originCoordY(){return this._private__originY}_internal_setPosition(A,t,e){this._private__subscribed||(this._private__subscribed=!0),this._private__visible=!0,this._private__tryToUpdateViews(A,t,e)}_internal_appliedIndex(){return this._private__index}_internal_appliedX(){return this._private__x}_internal_appliedY(){return this._private__y}_internal_visible(){return this._private__visible}_internal_clearPosition(){this._private__visible=!1,this._private__setIndexToLastSeriesBarIndex(),this._private__price=NaN,this._private__x=NaN,this._private__y=NaN,this._private__pane=null,this._internal_clearOriginCoord()}_internal_paneViews(A){return null!==this._private__pane?[this._private__paneView,this._private__markersPaneView]:[]}_internal_horzLineVisible(A){return A===this._private__pane&&this._private__options.horzLine.visible}_internal_vertLineVisible(){return this._private__options.vertLine.visible}_internal_priceAxisViews(A,t){this._private__visible&&this._private__pane===A||this._private__priceAxisViews.clear();var e=[];return this._private__pane===A&&e.push(this._private__createPriceAxisViewOnDemand(this._private__priceAxisViews,t,this._private__currentPosPriceProvider)),e}_internal_timeAxisViews(){return this._private__visible?[this._private__timeAxisView]:[]}_internal_pane(){return this._private__pane}_internal_updateAllViews(){this._private__paneView._internal_update(),this._private__priceAxisViews.forEach(A=>A._internal_update()),this._private__timeAxisView._internal_update(),this._private__markersPaneView._internal_update()}_private__priceScaleByPane(A){return A&&!A._internal_defaultPriceScale()._internal_isEmpty()?A._internal_defaultPriceScale():null}_private__tryToUpdateViews(A,t,e){this._private__tryToUpdateData(A,t,e)&&this._internal_updateAllViews()}_private__tryToUpdateData(A,t,e){var i=this._private__x,r=this._private__y,n=this._private__price,a=this._private__index,s=this._private__pane,o=this._private__priceScaleByPane(e),A=(this._private__index=A,this._private__x=isNaN(A)?NaN:this._private__model._internal_timeScale()._internal_indexToCoordinate(A),this._private__pane=e,null!==o?o._internal_firstValue():null);return null!==o&&null!==A?(this._private__price=t,this._private__y=o._internal_priceToCoordinate(t,A)):(this._private__price=NaN,this._private__y=NaN),i!==this._private__x||r!==this._private__y||a!==this._private__index||n!==this._private__price||s!==this._private__pane}_private__setIndexToLastSeriesBarIndex(){var A=this._private__model._internal_serieses().map(A=>A._internal_bars()._internal_lastIndex()).filter(X),A=0===A.length?null:Math.max(...A);this._private__index=null!==A?A:NaN}_private__createPriceAxisViewOnDemand(A,t,e){let i=A.get(t);return void 0===i&&(i=new cA(this,t,e),A.set(t,i)),i}}function vA(A){return"left"===A||"right"===A}class u{constructor(A){this._private__invalidatedPanes=new Map,this._private__timeScaleInvalidations=[],this._private__globalLevel=A}_internal_invalidatePane(A,t){var e=this._private__invalidatedPanes.get(A),e=(t=t,void 0===(e=e)?t:{_internal_level:Math.max(e._internal_level,t._internal_level),_internal_autoScale:e._internal_autoScale||t._internal_autoScale});this._private__invalidatedPanes.set(A,e)}_internal_fullInvalidation(){return this._private__globalLevel}_internal_invalidateForPane(A){A=this._private__invalidatedPanes.get(A);return void 0===A?{_internal_level:this._private__globalLevel}:{_internal_level:Math.max(this._private__globalLevel,A._internal_level),_internal_autoScale:A._internal_autoScale}}_internal_setFitContent(){this._internal_stopTimeScaleAnimation(),this._private__timeScaleInvalidations=[{_internal_type:0}]}_internal_applyRange(A){this._internal_stopTimeScaleAnimation(),this._private__timeScaleInvalidations=[{_internal_type:1,_internal_value:A}]}_internal_setTimeScaleAnimation(A){this._private__removeTimeScaleAnimation(),this._private__timeScaleInvalidations.push({_internal_type:5,_internal_value:A})}_internal_stopTimeScaleAnimation(){this._private__removeTimeScaleAnimation(),this._private__timeScaleInvalidations.push({_internal_type:6})}_internal_resetTimeScale(){this._internal_stopTimeScaleAnimation(),this._private__timeScaleInvalidations=[{_internal_type:4}]}_internal_setBarSpacing(A){this._internal_stopTimeScaleAnimation(),this._private__timeScaleInvalidations.push({_internal_type:2,_internal_value:A})}_internal_setRightOffset(A){this._internal_stopTimeScaleAnimation(),this._private__timeScaleInvalidations.push({_internal_type:3,_internal_value:A})}_internal_timeScaleInvalidations(){return this._private__timeScaleInvalidations}_internal_merge(A){for(const t of A._private__timeScaleInvalidations)this._private__applyTimeScaleInvalidation(t);this._private__globalLevel=Math.max(this._private__globalLevel,A._private__globalLevel),A._private__invalidatedPanes.forEach((A,t)=>{this._internal_invalidatePane(t,A)})}static _internal_light(){return new u(2)}static _internal_full(){return new u(3)}_private__applyTimeScaleInvalidation(A){switch(A._internal_type){case 0:this._internal_setFitContent();break;case 1:this._internal_applyRange(A._internal_value);break;case 2:this._internal_setBarSpacing(A._internal_value);break;case 3:this._internal_setRightOffset(A._internal_value);break;case 4:this._internal_resetTimeScale();break;case 5:this._internal_setTimeScaleAnimation(A._internal_value);break;case 6:this._private__removeTimeScaleAnimation()}}_private__removeTimeScaleAnimation(){var A=this._private__timeScaleInvalidations.findIndex(A=>5===A._internal_type);-1!==A&&this._private__timeScaleInvalidations.splice(A,1)}}const fA={_internal_decimalSign:".",_internal_decimalSignFractional:"'"};function v(A,t){if(!g(A))return"n/a";if(!s(t))throw new TypeError("invalid length");if(t=e&&(A-=e,i+=1),r=fA._internal_decimalSign+v(+A.toFixed(this._internal__fractionalLength)*this._private__minMove,n)}else i=Math.round(i*e)/e,0t)}}function QA(r,n,a,s,A,o,l){if(!(0===n.length||s.from>=n.length||s.to{l(v,e,i,t),v.beginPath(),e=A,i=t};let t=i;v.beginPath(),v.moveTo(_._internal_x,_._internal_y);for(let A=s.from+1;A>1,s=i+a;e(A[s],t)?(i=s+1,n-=1+a):n=a}return i}function MA(A,t,e,i=0,r=A.length){let n=r-i;for(;0>1,s=i+a;e(t,A[s])?n=a:(i=s+1,n-=1+a)}return i}function DA(A,t){return A._internal_time=i&&(a=r-1),0Object.assign(Object.assign({},A),this._internal__series._internal_barColorer()._internal_barStyle(A._internal_time)))}_internal__clearVisibleRange(){this._internal__itemsVisibleRange=null}_private__makeValid(){this._internal__dataInvalidated&&(this._internal__fillRawPoints(),this._internal__dataInvalidated=!1),this._internal__optionsInvalidated&&(this._internal__updateOptions(),this._internal__optionsInvalidated=!1),this._internal__invalidated&&(this._private__makeValidImpl(),this._internal__invalidated=!1)}_private__makeValidImpl(){var A,t,e=this._internal__series._internal_priceScale(),i=this._internal__model._internal_timeScale();this._internal__clearVisibleRange(),i._internal_isEmpty()||e._internal_isEmpty()||null!==(A=i._internal_visibleStrictRange())&&0!==this._internal__series._internal_bars()._internal_size()&&null!==(t=this._internal__series._internal_firstValue())&&(this._internal__itemsVisibleRange=TA(this._internal__items,A,this._private__extendedVisibleRange),this._internal__convertToCoordinates(e,i,t._internal_value),this._internal__prepareRendererData())}}class KA extends LA{constructor(A,t){super(A,t,!0)}_internal__convertToCoordinates(A,t,e){t._internal_indexesToCoordinates(this._internal__items,J(this._internal__itemsVisibleRange)),A._internal_pointsArrayToCoordinates(this._internal__items,e,J(this._internal__itemsVisibleRange))}_internal__createRawItemBase(A,t){return{_internal_time:A,_internal_price:t,_internal_x:NaN,_internal_y:NaN}}_internal__fillRawPoints(){const e=this._internal__series._internal_barColorer();this._internal__items=this._internal__series._internal_bars()._internal_rows().map(A=>{var t=A._internal_value[3];return this._internal__createRawItem(A._internal_index,t,e)})}}class kA extends KA{constructor(A,t){super(A,t),this._internal__renderer=new q,this._private__areaRenderer=new EA,this._private__lineRenderer=new IA,this._internal__renderer._internal_setRenderers([this._private__areaRenderer,this._private__lineRenderer])}_internal__createRawItem(A,t,e){return Object.assign(Object.assign({},this._internal__createRawItemBase(A,t)),e._internal_barStyle(A))}_internal__prepareRendererData(){var A=this._internal__series._internal_options();this._private__areaRenderer._internal_setData({_internal_lineType:A.lineType,_internal_items:this._internal__items,_internal_lineStyle:A.lineStyle,_internal_lineWidth:A.lineWidth,_internal_baseLevelCoordinate:null,_internal_invertFilledArea:A.invertFilledArea,_internal_visibleRange:this._internal__itemsVisibleRange,_internal_barWidth:this._internal__model._internal_timeScale()._internal_barSpacing()}),this._private__lineRenderer._internal_setData({_internal_lineType:A.lineType,_internal_items:this._internal__items,_internal_lineStyle:A.lineStyle,_internal_lineWidth:A.lineWidth,_internal_visibleRange:this._internal__itemsVisibleRange,_internal_barWidth:this._internal__model._internal_timeScale()._internal_barSpacing()})}}class OA extends c{constructor(){super(...arguments),this._private__data=null,this._private__barWidth=0,this._private__barLineWidth=0}_internal_setData(A){this._private__data=A}_internal__drawImpl({context:e,horizontalPixelRatio:i,verticalPixelRatio:r}){if(null!==this._private__data&&0!==this._private__data._internal_bars.length&&null!==this._private__data._internal_visibleRange){this._private__barWidth=this._private__calcBarWidth(i),2=Math.floor(1.5*i);for(let A=this._private__data._internal_visibleRange.from;Ac+u-1&&(t=c+u-1,A=t-_+1),e.fillRect(p,A,l-p,t-A+1)}l=o+d;let A=Math.max(c,Math.round(a._internal_closeY*r)-s),t=A+_-1;t>c+u-1&&(t=c+u-1,A=t-_+1),e.fillRect(1+h,A,l-h,t-A+1)}}}}_private__calcBarWidth(A){var t=Math.floor(A);return Math.max(t,Math.floor((t=B(this._private__data)._internal_barSpacing,Math.floor(.3*t*A))))}}class VA extends LA{constructor(A,t){super(A,t,!1)}_internal__convertToCoordinates(A,t,e){t._internal_indexesToCoordinates(this._internal__items,J(this._internal__itemsVisibleRange)),A._internal_barPricesToCoordinates(this._internal__items,e,J(this._internal__itemsVisibleRange))}_internal__createDefaultItem(A,t,e){return{_internal_time:A,_internal_open:t._internal_value[0],_internal_high:t._internal_value[1],_internal_low:t._internal_value[2],_internal_close:t._internal_value[3],_internal_x:NaN,_internal_openY:NaN,_internal_highY:NaN,_internal_lowY:NaN,_internal_closeY:NaN}}_internal__fillRawPoints(){const t=this._internal__series._internal_barColorer();this._internal__items=this._internal__series._internal_bars()._internal_rows().map(A=>this._internal__createRawItem(A._internal_index,A,t))}}class PA extends VA{constructor(){super(...arguments),this._internal__renderer=new OA}_internal__createRawItem(A,t,e){return Object.assign(Object.assign({},this._internal__createDefaultItem(A,t,e)),e._internal_barStyle(A))}_internal__prepareRendererData(){var A=this._internal__series._internal_options();this._internal__renderer._internal_setData({_internal_bars:this._internal__items,_internal_barSpacing:this._internal__model._internal_timeScale()._internal_barSpacing(),_internal_openVisible:A.openVisible,_internal_thinBars:A.thinBars,_internal_visibleRange:this._internal__itemsVisibleRange})}}function RA(A,t,e){return Math.min(Math.max(A,t),e)}function NA(A,t,e){return t-A2*r)&&this._private__drawCandles(A,i,this._private__data._internal_visibleRange)}_private__drawWicks(A,r,n){if(null!==this._private__data){var{context:a,horizontalPixelRatio:s,verticalPixelRatio:o}=A;let e="";var l=Math.min(Math.floor(s),Math.floor(this._private__data._internal_barSpacing*s)),l=Math.max(Math.floor(s),Math.min(l,this._private__barWidth)),_=Math.floor(.5*l);let i=null;for(let t=n.from;t2*d?(B=a,l=A,_=v,h=g-A+1,c=p-v+1,u=d,B.fillRect(l+u,_,h-2*u,u),B.fillRect(l+u,_+c-u,h-2*u,u),B.fillRect(l,_,u,c),B.fillRect(l+h-u,_,u,c)):(B=g-A+1,a.fillRect(A,v,B,p-v+1)),i=g}}}_private__drawCandles(A,a,t){if(null!==this._private__data){var{context:s,horizontalPixelRatio:o,verticalPixelRatio:l}=A;let n="";var _=this._private__calculateBorderWidth(o);for(let r=t.from;rt||s.fillRect(e,A,i-e+1,t-A+1)}}}}class ZA extends VA{constructor(){super(...arguments),this._internal__renderer=new JA}_internal__createRawItem(A,t,e){return Object.assign(Object.assign({},this._internal__createDefaultItem(A,t,e)),e._internal_barStyle(A))}_internal__prepareRendererData(){var A=this._internal__series._internal_options();this._internal__renderer._internal_setData({_internal_bars:this._internal__items,_internal_barSpacing:this._internal__model._internal_timeScale()._internal_barSpacing(),_internal_wickVisible:A.wickVisible,_internal_borderVisible:A.borderVisible,_internal_visibleRange:this._internal__itemsVisibleRange})}}class jA extends c{constructor(){super(...arguments),this._private__data=null,this._private__precalculatedCache=[]}_internal_setData(A){this._private__data=A,this._private__precalculatedCache=[]}_internal__drawImpl({context:i,horizontalPixelRatio:A,verticalPixelRatio:r}){if(null!==this._private__data&&0!==this._private__data._internal_items.length&&null!==this._private__data._internal_visibleRange){this._private__precalculatedCache.length||this._private__fillPrecalculatedCache(A);var n=Math.max(1,Math.floor(r)),a=Math.round(this._private__data._internal_histogramBase*r)-Math.floor(n/2),s=a+n;for(let e=this._private__data._internal_visibleRange.from;el._internal_center?l._internal_right=o._internal_left-e-1:o._internal_left=l._internal_right+e+1)}let t=Math.ceil(this._private__data._internal_barSpacing*i);for(let A=this._private__data._internal_visibleRange.from;At&&(h._internal_roundedCenter>h._internal_center?--h._internal_right:h._internal_left+=1)}}}}class qA extends KA{constructor(){super(...arguments),this._internal__renderer=new jA}_internal__createRawItem(A,t,e){return Object.assign(Object.assign({},this._internal__createRawItemBase(A,t)),e._internal_barStyle(A))}_internal__prepareRendererData(){var A={_internal_items:this._internal__items,_internal_barSpacing:this._internal__model._internal_timeScale()._internal_barSpacing(),_internal_visibleRange:this._internal__itemsVisibleRange,_internal_histogramBase:this._internal__series._internal_priceScale()._internal_priceToCoordinate(this._internal__series._internal_options().base,B(this._internal__series._internal_firstValue())._internal_value)};this._internal__renderer._internal_setData(A)}}class $A extends KA{constructor(){super(...arguments),this._internal__renderer=new IA}_internal__createRawItem(A,t,e){return Object.assign(Object.assign({},this._internal__createRawItemBase(A,t)),e._internal_barStyle(A))}_internal__prepareRendererData(){var A=this._internal__series._internal_options(),A={_internal_items:this._internal__items,_internal_lineStyle:A.lineStyle,_internal_lineType:A.lineType,_internal_lineWidth:A.lineWidth,_internal_visibleRange:this._internal__itemsVisibleRange,_internal_barWidth:this._internal__model._internal_timeScale()._internal_barSpacing()};this._internal__renderer._internal_setData(A)}}const At=/[2-9]/g;class w{constructor(A=50){this._private__actualSize=0,this._private__usageTick=1,this._private__oldestTick=1,this._private__tick2Labels={},this._private__cache=new Map,this._private__maxSize=A}_internal_reset(){this._private__actualSize=0,this._private__cache.clear(),this._private__usageTick=1,this._private__oldestTick=1,this._private__tick2Labels={}}_internal_measureText(A,t,e){return this._private__getMetrics(A,t,e).width}_internal_yMidCorrection(A,t,e){A=this._private__getMetrics(A,t,e);return((A.actualBoundingBoxAscent||0)-(A.actualBoundingBoxDescent||0))/2}_private__getMetrics(A,t,e){e=e||At,e=String(t).replace(e,"0");if(this._private__cache.has(e))return p(this._private__cache.get(e))._internal_metrics;this._private__actualSize===this._private__maxSize&&(i=this._private__tick2Labels[this._private__oldestTick],delete this._private__tick2Labels[this._private__oldestTick],this._private__cache.delete(i),this._private__oldestTick++,this._private__actualSize--),A.save(),A.textBaseline="middle";var i=A.measureText(e);return A.restore(),0===i.width&&t.length||(this._private__cache.set(e,{_internal_metrics:i,_internal_tick:this._private__usageTick}),this._private__tick2Labels[this._private__usageTick]=e,this._private__actualSize++,this._private__usageTick++),i}}class tt{constructor(A){this._private__priceAxisViewRenderer=null,this._private__rendererOptions=null,this._private__align="right",this._private__textWidthCache=A}_internal_setParams(A,t,e){this._private__priceAxisViewRenderer=A,this._private__rendererOptions=t,this._private__align=e}_internal_draw(A){null!==this._private__rendererOptions&&null!==this._private__priceAxisViewRenderer&&this._private__priceAxisViewRenderer._internal_draw(A,this._private__rendererOptions,this._private__textWidthCache,this._private__align)}}class et{constructor(A,t,e){this._private__priceAxisView=A,this._private__textWidthCache=new w(50),this._private__dataSource=t,this._private__chartModel=e,this._private__fontSize=-1,this._private__renderer=new tt(this._private__textWidthCache)}_internal_renderer(){var A,t=this._private__chartModel._internal_paneForSource(this._private__dataSource);return null===t||null===(A=t._internal_isOverlay(this._private__dataSource)?t._internal_defaultVisiblePriceScale():this._private__dataSource._internal_priceScale())||"overlay"===(t=t._internal_priceScalePosition(A))?null:((A=this._private__chartModel._internal_priceAxisRendererOptions())._internal_fontSize!==this._private__fontSize&&(this._private__fontSize=A._internal_fontSize,this._private__textWidthCache._internal_reset()),this._private__renderer._internal_setParams(this._private__priceAxisView._internal_paneRenderer(),A,t),this._private__renderer)}}class it extends c{constructor(){super(...arguments),this._private__data=null}_internal_setData(A){this._private__data=A}_internal_hitTest(A,t){var e,i,r;return null!=(e=this._private__data)&&e._internal_visible&&({_internal_y:e,_internal_lineWidth:i,_internal_externalId:r}=this._private__data,e-i-7t.height||(A.lineCap="butt",A.strokeStyle=this._private__data._internal_color,A.lineWidth=Math.floor(this._private__data._internal_lineWidth*e),_(A,this._private__data._internal_lineStyle),K(A,i,0,t.width))}}class rt{constructor(A){this._internal__lineRendererData={_internal_y:0,_internal_color:"rgba(0, 0, 0, 0)",_internal_lineWidth:1,_internal_lineStyle:0,_internal_visible:!1},this._internal__lineRenderer=new it,this._private__invalidated=!0,this._internal__series=A,this._internal__model=A._internal_model(),this._internal__lineRenderer._internal_setData(this._internal__lineRendererData)}_internal_update(){this._private__invalidated=!0}_internal_renderer(){return this._internal__series._internal_visible()?(this._private__invalidated&&(this._internal__updateImpl(),this._private__invalidated=!1),this._internal__lineRenderer):null}}class nt extends rt{constructor(A){super(A)}_internal__updateImpl(){this._internal__lineRendererData._internal_visible=!1;var A,t=this._internal__series._internal_priceScale(),e=t._internal_mode()._internal_mode;2!==e&&3!==e||(e=this._internal__series._internal_options()).baseLineVisible&&this._internal__series._internal_visible()&&null!==(A=this._internal__series._internal_firstValue())&&(this._internal__lineRendererData._internal_visible=!0,this._internal__lineRendererData._internal_y=t._internal_priceToCoordinate(A._internal_value,A._internal_value),this._internal__lineRendererData._internal_color=e.baseLineColor,this._internal__lineRendererData._internal_lineWidth=e.baseLineWidth,this._internal__lineRendererData._internal_lineStyle=e.baseLineStyle)}}class at extends c{constructor(){super(...arguments),this._private__data=null}_internal_setData(A){this._private__data=A}_internal_data(){return this._private__data}_internal__drawImpl({context:A,horizontalPixelRatio:t,verticalPixelRatio:e}){var i,r,n,a=this._private__data;null!==a&&(r=(i=Math.max(1,Math.floor(t)))%2/2,r=Math.round(a._internal_center.x*t)+r,e=a._internal_center.y*e,A.fillStyle=a._internal_seriesLineColor,A.beginPath(),n=Math.max(2,1.5*a._internal_seriesLineWidth)*t,A.arc(r,e,n,0,2*Math.PI,!1),A.fill(),A.fillStyle=a._internal_fillColor,A.beginPath(),A.arc(r,e,a._internal_radius*t,0,2*Math.PI,!1),A.fill(),A.lineWidth=i,A.strokeStyle=a._internal_strokeColor,A.beginPath(),A.arc(r,e,a._internal_radius*t+i/2,0,2*Math.PI,!1),A.stroke())}}const st=[{_internal_start:0,_internal_end:.25,_internal_startRadius:4,_internal_endRadius:10,_internal_startFillAlpha:.25,_internal_endFillAlpha:0,_internal_startStrokeAlpha:.4,_internal_endStrokeAlpha:.8},{_internal_start:.25,_internal_end:.525,_internal_startRadius:10,_internal_endRadius:14,_internal_startFillAlpha:0,_internal_endFillAlpha:0,_internal_startStrokeAlpha:.8,_internal_endStrokeAlpha:0},{_internal_start:.525,_internal_end:1,_internal_startRadius:14,_internal_endRadius:14,_internal_startFillAlpha:0,_internal_endFillAlpha:0,_internal_startStrokeAlpha:0,_internal_endStrokeAlpha:0}];function ot(A,t,e,i){return i=e+(i-e)*t,"transparent"===(e=A)?e:(t=(e=G(e))[3],`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${i*t})`)}function lt(A,t){var e=A%2600/2600;let i;for(const n of st)if(e>=n._internal_start&&e({_internal_time:A.time,_internal_x:0,_internal_y:0,_internal_size:0,_internal_shape:A.shape,_internal_color:A.color,_internal_internalId:A.internalId,_internal_externalId:A.id,_internal_text:void 0})),this._private__dataInvalidated=!1),this._private__model._internal_options().layout),A=(this._private__data._internal_visibleRange=null,i._internal_visibleStrictRange());if(null!==A){var a=this._private__series._internal_firstValue();if(null!==a&&0!==this._private__data._internal_items.length){let t=NaN;var s=ct(i._internal_barSpacing()),o={_internal_aboveBar:s,_internal_belowBar:s};this._private__data._internal_visibleRange=TA(this._private__data._internal_items,A,!0);for(let A=this._private__data._internal_visibleRange.from;A{var r=t.upColor,t=t.downColor,A=B(A(e,i)),e=l(A._internal_value[0]){var r=t.upColor,n=t.downColor,a=t.borderUpColor,s=t.borderDownColor,o=t.wickUpColor,t=t.wickDownColor,A=B(A(e,i)),e=l(A._internal_value[0]){A=B(A(e,i));return{_internal_barColor:null!=(e=A._internal_lineColor)?e:t.lineColor,_internal_lineColor:null!=(i=A._internal_lineColor)?i:t.lineColor,_internal_topColor:null!=(e=A._internal_topColor)?e:t.topColor,_internal_bottomColor:null!=(i=A._internal_bottomColor)?i:t.bottomColor}},Baseline:(A,t,e,i)=>{A=B(A(e,i));return{_internal_barColor:A._internal_value[3]>=t.baseValue.price?t.topLineColor:t.bottomLineColor,_internal_topLineColor:null!=(e=A._internal_topLineColor)?e:t.topLineColor,_internal_bottomLineColor:null!=(i=A._internal_bottomLineColor)?i:t.bottomLineColor,_internal_topFillColor1:null!=(e=A._internal_topFillColor1)?e:t.topFillColor1,_internal_topFillColor2:null!=(i=A._internal_topFillColor2)?i:t.topFillColor2,_internal_bottomFillColor1:null!=(e=A._internal_bottomFillColor1)?e:t.bottomFillColor1,_internal_bottomFillColor2:null!=(i=A._internal_bottomFillColor2)?i:t.bottomFillColor2}},Line:(A,t,e,i)=>{A=B(A(e,i));return{_internal_barColor:null!=(e=A._internal_color)?e:t.color,_internal_lineColor:null!=(i=A._internal_color)?i:t.color}},Histogram:(A,t,e,i)=>{return{_internal_barColor:null!=(A=B(A(e,i))._internal_color)?A:t.color}}};class yt{constructor(A){this._private__findBar=(A,t)=>void 0!==t?t._internal_value:this._private__series._internal_bars()._internal_valueAt(A),this._private__series=A,this._private__styleGetter=Ut[A._internal_seriesType()]}_internal_barStyle(A,t){return this._private__styleGetter(this._private__findBar,this._private__series._internal_options(),A,t)}}t.MismatchDirection=void 0,(A=t.MismatchDirection||(t.MismatchDirection={}))[A.NearestLeft=-1]="NearestLeft",A[A.None=0]="None",A[A.NearestRight=1]="NearestRight";class bt{constructor(){this._private__items=[],this._private__minMaxCache=new Map,this._private__rowSearchCache=new Map}_internal_last(){return 0A._internal_indext._internal_index>A)}_private__plotMinMax(t,e,i){let r=null;for(let A=t;Ar._internal_max&&(r._internal_max=n)))}return r}_private__minMaxOnRangeCachedImpl(A,t,e){if(this._internal_isEmpty())return null;let i=null;var r=B(this._internal_firstIndex()),n=B(this._internal_lastIndex()),A=Math.max(A,r),r=Math.min(t,n),n=30*Math.ceil(A/30),a=Math.max(n,30*Math.floor(r/30)),s=this._private__lowerbound(A),t=this._private__upperbound(Math.min(r,n,t)),s=this._private__plotMinMax(s,t,e);i=Et(i,s);let o=this._private__minMaxCache.get(e);void 0===o&&(o=new Map,this._private__minMaxCache.set(e,o));for(let t=Math.max(1+n,A);t{this._private__animationTimeoutId=null,this._internal_model()._internal_cursorUpdate()},0)),t._internal_invalidateStage(),[t]):[]}_internal_paneViews(){var A=[],t=(this._private__isOverlay()||A.push(this._private__baseHorizontalLineView),A.push(this._private__paneView,this._private__priceLineView,this._private__markersPaneView),this._private__customPriceLines.map(A=>A._internal_paneView()));return A.push(...t),A}_internal_labelPaneViews(A){return[this._private__panePriceAxisView,...this._private__customPriceLines.map(A=>A._internal_labelPaneView())]}_internal_priceAxisViews(A,t){if(t!==this._internal__priceScale&&!this._private__isOverlay())return[];var e=[...this._private__priceAxisViews];for(const i of this._private__customPriceLines)e.push(i._internal_priceAxisView());return e}_internal_autoscaleInfo(t,e){var A;return void 0!==this._private__options.autoscaleInfoProvider?(A=this._private__options.autoscaleInfoProvider(()=>{var A=this._private__autoscaleInfoImpl(t,e);return null===A?null:A._internal_toRaw()}),wt._internal_fromRaw(A)):this._private__autoscaleInfoImpl(t,e)}_internal_minMove(){return this._private__options.priceFormat.minMove}_internal_formatter(){return this._private__formatter}_internal_updateAllViews(){var A;this._private__paneView._internal_update(),this._private__markersPaneView._internal_update();for(const t of this._private__priceAxisViews)t._internal_update();for(const e of this._private__customPriceLines)e._internal_update();this._private__priceLineView._internal_update(),this._private__baseHorizontalLineView._internal_update(),null!=(A=this._private__lastPriceAnimationPaneView)&&A._internal_update()}_internal_priceScale(){return B(super._internal_priceScale())}_internal_markerDataAtIndex(A){var t;return"Line"!==this._private__seriesType&&"Area"!==this._private__seriesType&&"Baseline"!==this._private__seriesType||!this._private__options.crosshairMarkerVisible||null===(t=this._private__data._internal_valueAt(A))?null:{_internal_price:t._internal_value[3],_internal_radius:this._private__markerRadius(),_internal_borderColor:this._private__markerBorderColor(),_internal_borderWidth:this._private__markerBorderWidth(),_internal_backgroundColor:this._private__markerBackgroundColor(A)}}_internal_title(){return this._private__options.title}_internal_visible(){return this._private__options.visible}_private__isOverlay(){return!vA(this._internal_priceScale()._internal_id())}_private__autoscaleInfoImpl(A,t){if(!s(A)||!s(t)||this._private__data._internal_isEmpty())return null;var e="Line"===this._private__seriesType||"Area"===this._private__seriesType||"Baseline"===this._private__seriesType||"Histogram"===this._private__seriesType?[3]:[2,1],A=this._private__data._internal_minMaxOnRangeCached(A,t,e);let i=null!==A?new Q(A._internal_min,A._internal_max):null;return"Histogram"===this._internal_seriesType()&&(t=this._private__options.base,e=new Q(t,t),i=null!==i?i._internal_merge(e):e),new wt(i,this._private__markersPaneView._internal_autoScaleMargins())}_private__markerRadius(){switch(this._private__seriesType){case"Line":case"Area":case"Baseline":return this._private__options.crosshairMarkerRadius}return 0}_private__markerBorderColor(){switch(this._private__seriesType){case"Line":case"Area":case"Baseline":var A=this._private__options.crosshairMarkerBorderColor;if(0!==A.length)return A}return null}_private__markerBorderWidth(){switch(this._private__seriesType){case"Line":case"Area":case"Baseline":return this._private__options.crosshairMarkerBorderWidth}return 0}_private__markerBackgroundColor(A){switch(this._private__seriesType){case"Line":case"Area":case"Baseline":var t=this._private__options.crosshairMarkerBackgroundColor;if(0!==t.length)return t}return this._internal_barColorer()._internal_barStyle(A)._internal_barColor}_private__recreateFormatter(){switch(this._private__options.priceFormat.type){case"custom":this._private__formatter={format:this._private__options.priceFormat.formatter};break;case"volume":this._private__formatter=new CA(this._private__options.priceFormat.precision);break;case"percent":this._private__formatter=new mA(this._private__options.priceFormat.precision);break;default:var A=Math.pow(10,this._private__options.priceFormat.precision);this._private__formatter=new wA(A,this._private__options.priceFormat.minMove*A)}null!==this._internal__priceScale&&this._internal__priceScale._internal_updateFormatter()}_private__recalculateMarkers(){const r=this._internal_model()._internal_timeScale();if(!r._internal_hasPoints()||this._private__data._internal_isEmpty())this._private__indexedMarkers=[];else{const n=B(this._private__data._internal_firstIndex());this._private__indexedMarkers=this._private__markers.map((A,t)=>{var e=B(r._internal_timeToIndex(A.time,!0)),i=eA instanceof St).reduce((A,t)=>{var e,i;return n._internal_isOverlay(t)||!t._internal_visible()||(e=t._internal_priceScale(),i=t._internal_bars(),e._internal_isEmpty())||!i._internal_contains(r)||null===(i=i._internal_valueAt(r))?A:(t=l(t._internal_firstValue()),A.concat([e._internal_priceToCoordinate(i._internal_value[3],t._internal_value)]))},[]);0!==A.length&&(A.sort((A,t)=>Math.abs(A-a)-Math.abs(t-a)),A=A[0],t=e._internal_coordinateToPrice(A,i))}}return t}}class It extends c{constructor(){super(...arguments),this._private__data=null}_internal_setData(A){this._private__data=A}_internal__drawImpl({context:n,bitmapSize:a,horizontalPixelRatio:s,verticalPixelRatio:o}){if(null!==this._private__data){const l=Math.max(1,Math.floor(s));var A,t;n.lineWidth=l,t=()=>{var A=B(this._private__data);if(A._internal_vertLinesVisible){n.strokeStyle=A._internal_vertLinesColor,_(n,A._internal_vertLineStyle),n.beginPath();for(const i of A._internal_timeMarks){var t=Math.round(i._internal_coord*s);n.moveTo(t,-l),n.lineTo(t,a.height+l)}n.stroke()}if(A._internal_horzLinesVisible){n.strokeStyle=A._internal_horzLinesColor,_(n,A._internal_horzLineStyle),n.beginPath();for(const r of A._internal_priceMarks){var e=Math.round(r._internal_coord*o);n.moveTo(-l,e),n.lineTo(a.width+l,e)}n.stroke()}},(A=n).save(),A.lineWidth%2&&A.translate(.5,.5),t(),A.restore()}}}class Mt{constructor(A){this._private__renderer=new It,this._private__invalidated=!0,this._private__pane=A}_internal_update(){this._private__invalidated=!0}_internal_renderer(){var A;return this._private__invalidated&&(A={_internal_horzLinesVisible:(A=this._private__pane._internal_model()._internal_options().grid).horzLines.visible,_internal_vertLinesVisible:A.vertLines.visible,_internal_horzLinesColor:A.horzLines.color,_internal_vertLinesColor:A.vertLines.color,_internal_horzLineStyle:A.horzLines.style,_internal_vertLineStyle:A.vertLines.style,_internal_priceMarks:this._private__pane._internal_defaultPriceScale()._internal_marks(),_internal_timeMarks:this._private__pane._internal_model()._internal_timeScale()._internal_marks()||[]},this._private__renderer._internal_setData(A),this._private__invalidated=!1),this._private__renderer}}class Dt{constructor(A){this._private__paneView=new Mt(A)}_internal_paneView(){return this._private__paneView}}const xt={_internal_logicalOffset:4,_internal_coordOffset:1e-4};function F(A,t){A=100*(A-t)/t;return t1e-14+r,l=NA(n,e*s,1e-14),_=NA(n,1,1e-14);if(!(o&&l&&_))break;n/=s,s=this._private__integralDividers[++a%this._private__integralDividers.length]}if(n1e-14+r;)n/=s,s=this._private__fractionalDividers[++a%this._private__fractionalDividers.length];return n}}class Ot{constructor(A,t,e,i){this._private__marks=[],this._private__priceScale=A,this._private__base=t,this._private__coordinateToLogicalFunc=e,this._private__logicalToCoordinateFunc=i}_internal_tickSpan(A,t){if(A_;A-=t){var c=this._private__logicalToCoordinateFunc(A,n,!0);null!==e&&Math.abs(c-e)B(A._internal_zorder())-B(t._internal_zorder()))}t.PriceScaleMode=void 0,(A=t.PriceScaleMode||(t.PriceScaleMode={}))[A.Normal=0]="Normal",A[A.Logarithmic=1]="Logarithmic",A[A.Percentage=2]="Percentage",A[A.IndexedTo100=3]="IndexedTo100";const Pt=new mA,Rt=new wA(100,1);class Nt{constructor(A,t,e,i){this._private__height=0,this._private__internalHeightCache=null,this._private__priceRange=null,this._private__priceRangeSnapshot=null,this._private__invalidatedForRange={_internal_isValid:!1,_internal_visibleBars:null},this._private__marginAbove=0,this._private__marginBelow=0,this._private__onMarksChanged=new n,this._private__modeChanged=new n,this._private__dataSources=[],this._private__cachedOrderedSources=null,this._private__marksCache=null,this._private__scaleStartPoint=null,this._private__scrollStartPoint=null,this._private__formatter=Rt,this._private__logFormula=Kt(null),this._private__id=A,this._private__options=t,this._private__layoutOptions=e,this._private__localizationOptions=i,this._private__markBuilder=new Ot(this,100,this._private__coordinateToLogical.bind(this),this._private__logicalToCoordinate.bind(this))}_internal_id(){return this._private__id}_internal_options(){return this._private__options}_internal_applyOptions(A){if(r(this._private__options,A),this._internal_updateFormatter(),void 0!==A.mode&&this._internal_setMode({_internal_mode:A.mode}),void 0!==A.scaleMargins){var t=p(A.scaleMargins.top),A=p(A.scaleMargins.bottom);if(tA._internal_updateAllViews())}_internal_updateFormatter(){this._private__marksCache=null;var A=this._private__formatterSource();let t=100;null!==A&&(t=Math.round(1/A._internal_minMove())),this._private__formatter=Rt,this._internal_isPercentage()?(this._private__formatter=Pt,t=100):this._internal_isIndexedTo100()?(this._private__formatter=new wA(100,1),t=100):null!==A&&(this._private__formatter=A._internal_formatter()),this._private__markBuilder=new Ot(this,t,this._private__coordinateToLogical.bind(this),this._private__logicalToCoordinate.bind(this)),this._private__markBuilder._internal_rebuildTickMarks()}_internal_invalidateSourcesCache(){this._private__cachedOrderedSources=null}_private__formatterSource(){return this._private__dataSources[0]||null}_private__topMarginPx(){return this._internal_isInverted()?this._private__options.scaleMargins.bottom*this._internal_height()+this._private__marginBelow:this._private__options.scaleMargins.top*this._internal_height()+this._private__marginAbove}_private__bottomMarginPx(){return this._internal_isInverted()?this._private__options.scaleMargins.top*this._internal_height()+this._private__marginAbove:this._private__options.scaleMargins.bottom*this._internal_height()+this._private__marginBelow}_private__makeSureItIsValid(){this._private__invalidatedForRange._internal_isValid||(this._private__invalidatedForRange._internal_isValid=!0,this._private__recalculatePriceRangeImpl())}_private__invalidateInternalHeightCache(){this._private__internalHeightCache=null}_private__logicalToCoordinate(A,t){if(this._private__makeSureItIsValid(),this._internal_isEmpty())return 0;A=this._internal_isLog()&&A?Tt(A,this._private__logFormula):A;var e=B(this._internal_priceRange()),A=this._private__bottomMarginPx()+(this._internal_internalHeight()-1)*(A-e._internal_minValue())/e._internal_length();return this._internal_invertedCoordinate(A)}_private__coordinateToLogical(A,t){var e;return this._private__makeSureItIsValid(),this._internal_isEmpty()?0:(A=this._internal_invertedCoordinate(A),e=(e=B(this._internal_priceRange()))._internal_minValue()+e._internal_length()*((A-this._private__bottomMarginPx())/(this._internal_internalHeight()-1)),this._internal_isLog()?y(e,this._private__logFormula):e)}_private__onIsInvertedChanged(){this._private__marksCache=null,this._private__markBuilder._internal_rebuildTickMarks()}_private__recalculatePriceRangeImpl(){var r,n,a,A,s,o,l,_=this._private__invalidatedForRange._internal_visibleBars;if(null!==_){let t=null;let e=0,i=0;for(const u of this._internal_sourcesForAutoScale())if(u._internal_visible()){var h=u._internal_firstValue();if(null!==h){var c=u._internal_autoscaleInfo(_._internal_left(),_._internal_right());let A=c&&c._internal_priceRange();if(null!==A){switch(this._private__options.mode){case 1:A=b(A,this._private__logFormula);break;case 2:A=(r=A,n=h._internal_value,a=void 0,a=F(r._internal_minValue(),n),r=F(r._internal_maxValue(),n),new Q(a,r));break;case 3:A=(n=A,a=h._internal_value,r=void 0,r=U(n._internal_minValue(),a),n=U(n._internal_maxValue(),a),new Q(r,n))}t=null===t?A:t._internal_merge(B(A)),null!==c&&null!==(c=c._internal_margins())&&(e=Math.max(e,c.above),i=Math.max(e,c.below))}}}e===this._private__marginAbove&&i===this._private__marginBelow||(this._private__marginAbove=e,this._private__marginBelow=i,this._private__marksCache=null,this._private__invalidateInternalHeightCache()),null!==t?(t._internal_minValue()===t._internal_maxValue()&&(A=5*(null===(A=this._private__formatterSource())||this._internal_isPercentage()||this._internal_isIndexedTo100()?1:A._internal_minMove()),this._internal_isLog()&&(t=Lt(t,this._private__logFormula)),t=new Q(t._internal_minValue()-A,t._internal_maxValue()+A),this._internal_isLog())&&(t=b(t,this._private__logFormula)),this._internal_isLog()&&(s=Kt(A=Lt(t,this._private__logFormula)),o=s,l=this._private__logFormula,o._internal_logicalOffset===l._internal_logicalOffset&&o._internal_coordOffset===l._internal_coordOffset||(o=null!==this._private__priceRangeSnapshot?Lt(this._private__priceRangeSnapshot,this._private__logFormula):null,this._private__logFormula=s,t=b(A,s),null!==o&&(this._private__priceRangeSnapshot=b(o,s)))),this._internal_setPriceRange(t)):null===this._private__priceRange&&(this._internal_setPriceRange(new Q(-.5,.5)),this._private__logFormula=Kt(null)),this._private__invalidatedForRange._internal_isValid=!0}}_private__getCoordinateTransformer(){return this._internal_isPercentage()?F:this._internal_isIndexedTo100()?U:this._internal_isLog()?A=>Tt(A,this._private__logFormula):null}_private__formatPrice(A,t){return void 0===this._private__localizationOptions.priceFormatter?(t=void 0===t?this._internal_formatter():t).format(A):this._private__localizationOptions.priceFormatter(A)}}class Gt{constructor(A,t){this._private__dataSources=[],this._private__overlaySourcesByScaleId=new Map,this._private__height=0,this._private__width=0,this._private__stretchFactor=1e3,this._private__cachedOrderedSources=null,this._private__destroyed=new n,this._private__timeScale=A,this._private__model=t,this._private__grid=new Dt(this);A=t._internal_options();this._private__leftPriceScale=this._private__createPriceScale("left",A.leftPriceScale),this._private__rightPriceScale=this._private__createPriceScale("right",A.rightPriceScale),this._private__leftPriceScale._internal_modeChanged()._internal_subscribe(this._private__onPriceScaleModeChanged.bind(this,this._private__leftPriceScale),this),this._private__rightPriceScale._internal_modeChanged()._internal_subscribe(this._private__onPriceScaleModeChanged.bind(this,this._private__rightPriceScale),this),this._internal_applyScaleOptions(A)}_internal_applyScaleOptions(A){if(A.leftPriceScale&&this._private__leftPriceScale._internal_applyOptions(A.leftPriceScale),A.rightPriceScale&&this._private__rightPriceScale._internal_applyOptions(A.rightPriceScale),A.localization&&(this._private__leftPriceScale._internal_updateFormatter(),this._private__rightPriceScale._internal_updateFormatter()),A.overlayPriceScales)for(const e of Array.from(this._private__overlaySourcesByScaleId.values())){var t=B(e[0]._internal_priceScale());t._internal_applyOptions(A.overlayPriceScales),A.localization&&t._internal_updateFormatter()}}_internal_priceScaleById(A){switch(A){case"left":return this._private__leftPriceScale;case"right":return this._private__rightPriceScale}return this._private__overlaySourcesByScaleId.has(A)?p(this._private__overlaySourcesByScaleId.get(A))[0]._internal_priceScale():null}_internal_destroy(){this._internal_model()._internal_priceScalesOptionsChanged()._internal_unsubscribeAll(this),this._private__leftPriceScale._internal_modeChanged()._internal_unsubscribeAll(this),this._private__rightPriceScale._internal_modeChanged()._internal_unsubscribeAll(this),this._private__dataSources.forEach(A=>{A._internal_destroy&&A._internal_destroy()}),this._private__destroyed._internal_fire()}_internal_stretchFactor(){return this._private__stretchFactor}_internal_setStretchFactor(A){this._private__stretchFactor=A}_internal_model(){return this._private__model}_internal_width(){return this._private__width}_internal_height(){return this._private__height}_internal_setWidth(A){this._private__width=A,this._internal_updateAllSources()}_internal_setHeight(t){this._private__height=t,this._private__leftPriceScale._internal_setHeight(t),this._private__rightPriceScale._internal_setHeight(t),this._private__dataSources.forEach(A=>{this._internal_isOverlay(A)&&null!==(A=A._internal_priceScale())&&A._internal_setHeight(t)}),this._internal_updateAllSources()}_internal_dataSources(){return this._private__dataSources}_internal_isOverlay(A){A=A._internal_priceScale();return null===A||this._private__leftPriceScale!==A&&this._private__rightPriceScale!==A}_internal_addDataSource(A,t,e){e=void 0!==e?e:this._private__getZOrderMinMax()._internal_maxZOrder+1;this._private__insertDataSource(A,t,e)}_internal_removeDataSource(A){var t,e=this._private__dataSources.indexOf(A),e=(a(-1!==e,"removeDataSource: invalid data source"),this._private__dataSources.splice(e,1),B(A._internal_priceScale())._internal_id()),i=(this._private__overlaySourcesByScaleId.has(e)&&-1!==(i=(t=p(this._private__overlaySourcesByScaleId.get(e))).indexOf(A))&&(t.splice(i,1),0===t.length)&&this._private__overlaySourcesByScaleId.delete(e),A._internal_priceScale());i&&0{A._internal_updateAllViews()})}_internal_defaultPriceScale(){let A=null;return this._private__model._internal_options().rightPriceScale.visible&&0!==this._private__rightPriceScale._internal_dataSources().length?A=this._private__rightPriceScale:this._private__model._internal_options().leftPriceScale.visible&&0!==this._private__leftPriceScale._internal_dataSources().length?A=this._private__leftPriceScale:0!==this._private__dataSources.length&&(A=this._private__dataSources[0]._internal_priceScale()),A=null===A?this._private__rightPriceScale:A}_internal_defaultVisiblePriceScale(){let A=null;return this._private__model._internal_options().rightPriceScale.visible?A=this._private__rightPriceScale:this._private__model._internal_options().leftPriceScale.visible&&(A=this._private__leftPriceScale),A}_internal_recalculatePriceScale(A){null!==A&&A._internal_isAutoScale()&&this._private__recalculatePriceScaleImpl(A)}_internal_resetPriceScale(A){var t=this._private__timeScale._internal_visibleStrictRange();A._internal_setMode({_internal_autoScale:!0}),null!==t&&A._internal_recalculatePriceRange(t),this._internal_updateAllSources()}_internal_momentaryAutoScale(){this._private__recalculatePriceScaleImpl(this._private__leftPriceScale),this._private__recalculatePriceScaleImpl(this._private__rightPriceScale)}_internal_recalculate(){this._internal_recalculatePriceScale(this._private__leftPriceScale),this._internal_recalculatePriceScale(this._private__rightPriceScale),this._private__dataSources.forEach(A=>{this._internal_isOverlay(A)&&this._internal_recalculatePriceScale(A._internal_priceScale())}),this._internal_updateAllSources(),this._private__model._internal_lightUpdate()}_internal_orderedSources(){return null===this._private__cachedOrderedSources&&(this._private__cachedOrderedSources=Vt(this._private__dataSources)),this._private__cachedOrderedSources}_internal_onDestroyed(){return this._private__destroyed}_internal_grid(){return this._private__grid}_private__recalculatePriceScaleImpl(A){var t=A._internal_sourcesForAutoScale();t&&0i)&&(i=r)}return{_internal_minZOrder:e,_internal_maxZOrder:i}}_private__insertDataSource(A,t,e){let i=this._internal_priceScaleById(t);var r;null===i&&(i=this._private__createPriceScale(t,this._private__model._internal_options().overlayPriceScales)),this._private__dataSources.push(A),vA(t)||((r=this._private__overlaySourcesByScaleId.get(t)||[]).push(A),this._private__overlaySourcesByScaleId.set(t,r)),i._internal_addDataSource(A),A._internal_setPriceScale(i),A._internal_setZorder(e),this._internal_recalculatePriceScale(i),this._private__cachedOrderedSources=null}_private__onPriceScaleModeChanged(A,t,e){t._internal_mode!==e._internal_mode&&this._private__recalculatePriceScaleImpl(A)}_private__createPriceScale(A,t){t=Object.assign({visible:!0,autoScale:!0},o(t)),A=new Nt(A,t,this._private__model._internal_options().layout,this._private__model._internal_options().localization);return A._internal_setHeight(this._internal_height()),A}}const Wt=A=>A.getUTCMonth()+1,zt=A=>A.getUTCDate(),Yt=A=>A.getUTCFullYear();function Xt(A,t,e){return t.replace(/yyyy/g,(t=A,v(Yt(t),4))).replace(/yy/g,(t=A,v(Yt(t)%100,2))).replace(/MMMM/g,(t=A,i=e,new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"}))).replace(/MMM/g,(t=A,i=e,new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"}))).replace(/MM/g,(e=A,v(Wt(e),2))).replace(/dd/g,(t=A,v(zt(t),2)));var i}class Jt{constructor(A="yyyy-MM-dd",t="default"){this._private__dateFormat=A,this._private__locale=t}_internal_format(A){return Xt(A,this._private__dateFormat,this._private__locale)}}class Zt{constructor(A){this._private__formatStr=A||"%h:%m:%s"}_internal_format(A){return this._private__formatStr.replace("%h",v(A.getUTCHours(),2)).replace("%m",v(A.getUTCMinutes(),2)).replace("%s",v(A.getUTCSeconds(),2))}}const jt={_internal_dateFormat:"yyyy-MM-dd",_internal_timeFormat:"%h:%m:%s",_internal_dateTimeSeparator:" ",_internal_locale:"default"};class qt{constructor(A={}){A=Object.assign(Object.assign({},jt),A);this._private__dateFormatter=new Jt(A._internal_dateFormat,A._internal_locale),this._private__timeFormatter=new Zt(A._internal_timeFormat),this._private__separator=A._internal_dateTimeSeparator}_internal_format(A){return""+this._private__dateFormatter._internal_format(A)+this._private__separator+this._private__timeFormatter._internal_format(A)}}class $t{constructor(A,t=50){this._private__actualSize=0,this._private__usageTick=1,this._private__oldestTick=1,this._private__cache=new Map,this._private__tick2Labels=new Map,this._private__format=A,this._private__maxSize=t}_internal_format(A){var t=A._internal_time,t=(void 0===t._internal_businessDay?new Date(1e3*t._internal_timestamp):new Date(Date.UTC(t._internal_businessDay.year,t._internal_businessDay.month-1,t._internal_businessDay.day))).getTime(),e=this._private__cache.get(t);if(void 0!==e)return e._internal_string;this._private__actualSize===this._private__maxSize&&(e=this._private__tick2Labels.get(this._private__oldestTick),this._private__tick2Labels.delete(this._private__oldestTick),this._private__cache.delete(p(e)),this._private__oldestTick++,this._private__actualSize--);e=this._private__format(A);return this._private__cache.set(t,{_internal_string:e,_internal_tick:this._private__usageTick}),this._private__tick2Labels.set(this._private__usageTick,t),this._private__actualSize++,this._private__usageTick++,e}}class E{constructor(A,t){a(A= left"),this._private__left=A,this._private__right=t}_internal_left(){return this._private__left}_internal_right(){return this._private__right}_internal_count(){return this._private__right-this._private__left+1}_internal_contains(A){return this._private__left{eA._internal_indext-A))if(this._private__marksByWeight.get(A)){var a=n,s=(n=[],a.length);let t=0;var o=p(this._private__marksByWeight.get(A)),l=o.length;let e=1/0,i=-1/0;for(let A=0;A=r&&h-i>=r&&(n.push(_),i=h)}for(;tthis._private__points[this._private__points.length-1]._internal_time._internal_timestamp?t?this._private__points.length-1:null:(e=f(this._private__points,A._internal_timestamp,(A,t)=>A._internal_time._internal_timestampt/2&&!o?A._internal_needAlignCoordinate=!1:A._internal_needAlignCoordinate=l&&c._internal_index=s,h++}return this._private__labels.length=h,this._private__timeMarksCache=this._private__labels,this._private__labels}_internal_restoreDefault(){this._private__visibleRangeInvalidated=!0,this._internal_setBarSpacing(this._private__options.barSpacing),this._internal_setRightOffset(this._private__options.rightOffset)}_internal_setBaseIndex(A){this._private__visibleRangeInvalidated=!0,this._private__baseIndexOrNull=A,this._private__correctOffset(),this._private__doFixLeftEdge()}_internal_zoom(A,t){var e=this._private__coordinateToFloatIndex(A),i=this._internal_barSpacing();this._internal_setBarSpacing(i+t*(i/10)),this._private__options.rightBarStaysOnScroll||this._internal_setRightOffset(this._internal_rightOffset()+(e-this._private__coordinateToFloatIndex(A)))}_internal_startScale(A){this._private__scrollStartPoint&&this._internal_endScroll(),null!==this._private__scaleStartPoint||null!==this._private__commonTransitionStartState||this._internal_isEmpty()||(this._private__scaleStartPoint=A,this._private__saveCommonTransitionsStartState())}_internal_scaleTo(A){var t;null!==this._private__commonTransitionStartState&&(A=RA(this._private__width-A,0,this._private__width),t=RA(this._private__width-B(this._private__scaleStartPoint),0,this._private__width),0!==A)&&0!==t&&this._internal_setBarSpacing(this._private__commonTransitionStartState._internal_barSpacing*A/t)}_internal_endScale(){null!==this._private__scaleStartPoint&&(this._private__scaleStartPoint=null,this._private__clearCommonTransitionsStartState())}_internal_startScroll(A){null!==this._private__scrollStartPoint||null!==this._private__commonTransitionStartState||this._internal_isEmpty()||(this._private__scrollStartPoint=A,this._private__saveCommonTransitionsStartState())}_internal_scrollTo(A){null!==this._private__scrollStartPoint&&(A=(this._private__scrollStartPoint-A)/this._internal_barSpacing(),this._private__rightOffset=B(this._private__commonTransitionStartState)._internal_rightOffset+A,this._private__visibleRangeInvalidated=!0,this._private__correctOffset())}_internal_endScroll(){null!==this._private__scrollStartPoint&&(this._private__scrollStartPoint=null,this._private__clearCommonTransitionsStartState())}_internal_scrollToRealTime(){this._internal_scrollToOffsetAnimated(this._private__options.rightOffset)}_internal_scrollToOffsetAnimated(t,e=400){if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(!isFinite(e)||e1{A=(A-r)/e;return 1A)&&(this._private__barSpacing=A,this._private__visibleRangeInvalidated=!0)}_private__minBarSpacing(){return this._private__options.fixLeftEdge&&this._private__options.fixRightEdge&&0!==this._private__points.length?this._private__width/this._private__points.length:this._private__options.minBarSpacing}_private__correctOffset(){var A=this._private__maxRightOffset(),A=(this._private__rightOffset>A&&(this._private__rightOffset=A,this._private__visibleRangeInvalidated=!0),this._private__minRightOffset());null!==A&&this._private__rightOffsetthis._private__formatLabelImpl(A)),this._private__formattedByWeight.set(A._internal_weight,t)),t._internal_format(A)}_private__formatLabelImpl(A){var t=function(A,t,e){switch(A){case 0:case 10:return t?e?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return t?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(A._internal_weight,this._private__options.timeVisible,this._private__options.secondsVisible);if(void 0!==this._private__options.tickMarkFormatter){var e=this._private__options.tickMarkFormatter(A._internal_originalTime,t,this._private__localizationOptions.locale);if(null!==e)return e}var e=A._internal_time,A=t,t=this._private__localizationOptions.locale,i={};switch(A){case 0:i.year="numeric";break;case 1:i.month="short";break;case 2:i.day="numeric";break;case 3:i.hour12=!1,i.hour="2-digit",i.minute="2-digit";break;case 4:i.hour12=!1,i.hour="2-digit",i.minute="2-digit",i.second="2-digit"}return A=void 0===e._internal_businessDay?new Date(1e3*e._internal_timestamp):new Date(Date.UTC(e._internal_businessDay.year,e._internal_businessDay.month-1,e._internal_businessDay.day)),new Date(A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate(),A.getUTCHours(),A.getUTCMinutes(),A.getUTCSeconds(),A.getUTCMilliseconds()).toLocaleString(t,i)}_private__setVisibleRange(A){var t=this._private__visibleRange;this._private__visibleRange=A,Ae(t._internal_strictRange(),this._private__visibleRange._internal_strictRange())||this._private__visibleBarsChanged._internal_fire(),Ae(t._internal_logicalRange(),this._private__visibleRange._internal_logicalRange())||this._private__logicalRangeChanged._internal_fire(),this._private__resetTimeMarksCache()}_private__resetTimeMarksCache(){this._private__timeMarksCache=null}_private__invalidateTickMarks(){this._private__resetTimeMarksCache(),this._private__formattedByWeight.clear()}_private__updateDateTimeFormatter(){var A=this._private__localizationOptions.dateFormat;this._private__options.timeVisible?this._private__dateTimeFormatter=new qt({_internal_dateFormat:A,_internal_timeFormat:this._private__options.secondsVisible?"%h:%m:%s":"%h:%m",_internal_dateTimeSeparator:" ",_internal_locale:this._private__localizationOptions.locale}):this._private__dateTimeFormatter=new Jt(A,this._private__localizationOptions.locale)}_private__doFixLeftEdge(){var A,t;this._private__options.fixLeftEdge&&null!==(t=this._private__firstIndex())&&null!==(A=this._internal_visibleStrictRange())&&((A=A._internal_left()-t)n.width?a._internal_zoom=n.width/i:a._internal_zoom=1,A+=a._internal_lineHeight*a._internal_zoom);let t=0;switch(this._private__data._internal_vertAlign){case"top":t=0;break;case"center":t=Math.max((n.height-A)/2,0);break;case"bottom":t=Math.max(n.height-A,0)}r.fillStyle=this._private__data._internal_color;for(const s of this._private__data._internal_lines){r.save();let A=0;switch(this._private__data._internal_horzAlign){case"left":r.textAlign="left",A=s._internal_lineHeight/2;break;case"center":r.textAlign="center",A=n.width/2;break;case"right":r.textAlign="right",A=n.width-1-s._internal_lineHeight/2}r.translate(A,t),r.textBaseline="top",r.font=s._internal_font,r.scale(s._internal_zoom,s._internal_zoom),r.fillText(s._internal_text,0,s._internal_vertOffset),r.restore(),t+=s._internal_lineHeight*s._internal_zoom}}}_private__metrics(A,t){var e=this._private__fontCache(A.font);let i=e.get(t);return void 0===i&&(i=A.measureText(t).width,e.set(t,i)),i}_private__fontCache(A){let t=this._private__metricsCache.get(A);return void 0===t&&(t=new Map,this._private__metricsCache.set(A,t)),t}}class re{constructor(A){this._private__invalidated=!0,this._private__rendererData={_internal_visible:!1,_internal_color:"",_internal_lines:[],_internal_vertAlign:"center",_internal_horzAlign:"center"},this._private__renderer=new ie(this._private__rendererData),this._private__source=A}_internal_update(){this._private__invalidated=!0}_internal_renderer(){return this._private__invalidated&&(this._private__updateImpl(),this._private__invalidated=!1),this._private__renderer}_private__updateImpl(){var A=this._private__source._internal_options(),t=this._private__rendererData;t._internal_visible=A.visible,t._internal_visible&&(t._internal_color=A.color,t._internal_horzAlign=A.horzAlign,t._internal_vertAlign=A.vertAlign,t._internal_lines=[{_internal_text:A.text,_internal_font:i(A.fontSize,A.fontFamily,A.fontStyle),_internal_lineHeight:1.2*A.fontSize,_internal_vertOffset:0,_internal_zoom:0}])}}class ne extends BA{constructor(A,t){super(),this._private__options=t,this._private__paneView=new re(this)}_internal_priceAxisViews(){return[]}_internal_paneViews(){return[this._private__paneView]}_internal_options(){return this._private__options}_internal_updateAllViews(){this._private__paneView._internal_update()}}t.TrackingModeExitMode=void 0,(A=t.TrackingModeExitMode||(t.TrackingModeExitMode={}))[A.OnTouchEnd=0]="OnTouchEnd",A[A.OnNextTap=1]="OnNextTap";class ae{constructor(A,t){this._private__panes=[],this._private__serieses=[],this._private__width=0,this._private__hoveredSource=null,this._private__priceScalesOptionsChanged=new n,this._private__crosshairMoved=new n,this._private__gradientColorsCache=null,this._private__invalidateHandler=A,this._private__options=t,this._private__rendererOptionsProvider=new j(this),this._private__timeScale=new ee(this,t.timeScale,this._private__options.localization),this._private__crosshair=new gA(this,t.crosshair),this._private__magnet=new Ht(t.crosshair),this._private__watermark=new ne(this,t.watermark),this._internal_createPane(),this._private__panes[0]._internal_setStretchFactor(2e3),this._private__backgroundTopColor=this._private__getBackgroundColor(0),this._private__backgroundBottomColor=this._private__getBackgroundColor(1)}_internal_fullUpdate(){this._private__invalidate(u._internal_full())}_internal_lightUpdate(){this._private__invalidate(u._internal_light())}_internal_cursorUpdate(){this._private__invalidate(new u(1))}_internal_updateSource(A){A=this._private__invalidationMaskForSource(A);this._private__invalidate(A)}_internal_hoveredSource(){return this._private__hoveredSource}_internal_setHoveredSource(A){var t=this._private__hoveredSource;this._private__hoveredSource=A,null!==t&&this._internal_updateSource(t._internal_source),null!==A&&this._internal_updateSource(A._internal_source)}_internal_options(){return this._private__options}_internal_applyOptions(t){r(this._private__options,t),this._private__panes.forEach(A=>A._internal_applyScaleOptions(t)),void 0!==t.timeScale&&this._private__timeScale._internal_applyOptions(t.timeScale),void 0!==t.localization&&this._private__timeScale._internal_applyLocalizationOptions(t.localization),(t.leftPriceScale||t.rightPriceScale)&&this._private__priceScalesOptionsChanged._internal_fire(),this._private__backgroundTopColor=this._private__getBackgroundColor(0),this._private__backgroundBottomColor=this._private__getBackgroundColor(1),this._internal_fullUpdate()}_internal_applyPriceScaleOptions(A,t){if("left"===A)this._internal_applyOptions({leftPriceScale:t});else if("right"===A)this._internal_applyOptions({rightPriceScale:t});else{var e=this._internal_findPriceScale(A);if(null===e)throw new Error("Trying to apply price scale options with incorrect ID: "+A);e._internal_priceScale._internal_applyOptions(t),this._private__priceScalesOptionsChanged._internal_fire()}}_internal_findPriceScale(A){for(const e of this._private__panes){var t=e._internal_priceScaleById(A);if(null!==t)return{_internal_pane:e,_internal_priceScale:t}}return null}_internal_timeScale(){return this._private__timeScale}_internal_panes(){return this._private__panes}_internal_watermarkSource(){return this._private__watermark}_internal_crosshairSource(){return this._private__crosshair}_internal_crosshairMoved(){return this._private__crosshairMoved}_internal_setPaneHeight(A,t){A._internal_setHeight(t),this._internal_recalculateAllPanes()}_internal_setWidth(t){this._private__width=t,this._private__timeScale._internal_setWidth(this._private__width),this._private__panes.forEach(A=>A._internal_setWidth(t)),this._internal_recalculateAllPanes()}_internal_createPane(A){var t=new Gt(this._private__timeScale,this),A=(void 0!==A?this._private__panes.splice(A,0,t):this._private__panes.push(t),void 0===A?this._private__panes.length-1:A),e=u._internal_full();return e._internal_invalidatePane(A,{_internal_level:0,_internal_autoScale:!0}),this._private__invalidate(e),t}_internal_startScalePrice(A,t,e){A._internal_startScalePrice(t,e)}_internal_scalePriceTo(A,t,e){A._internal_scalePriceTo(t,e),this._internal_updateCrosshair(),this._private__invalidate(this._private__paneInvalidationMask(A,2))}_internal_endScalePrice(A,t){A._internal_endScalePrice(t),this._private__invalidate(this._private__paneInvalidationMask(A,2))}_internal_startScrollPrice(A,t,e){t._internal_isAutoScale()||A._internal_startScrollPrice(t,e)}_internal_scrollPriceTo(A,t,e){t._internal_isAutoScale()||(A._internal_scrollPriceTo(t,e),this._internal_updateCrosshair(),this._private__invalidate(this._private__paneInvalidationMask(A,2)))}_internal_endScrollPrice(A,t){t._internal_isAutoScale()||(A._internal_endScrollPrice(t),this._private__invalidate(this._private__paneInvalidationMask(A,2)))}_internal_resetPriceScale(A,t){A._internal_resetPriceScale(t),this._private__invalidate(this._private__paneInvalidationMask(A,2))}_internal_startScaleTime(A){this._private__timeScale._internal_startScale(A)}_internal_zoomTime(A,t){var e,i=this._internal_timeScale();i._internal_isEmpty()||0===t||(e=i._internal_width(),A=Math.max(1,Math.min(A,e)),i._internal_zoom(A,t),this._internal_recalculateAllPanes())}_internal_scrollChart(A){this._internal_startScrollTime(0),this._internal_scrollTimeTo(A),this._internal_endScrollTime()}_internal_scaleTimeTo(A){this._private__timeScale._internal_scaleTo(A),this._internal_recalculateAllPanes()}_internal_endScaleTime(){this._private__timeScale._internal_endScale(),this._internal_lightUpdate()}_internal_startScrollTime(A){this._private__timeScale._internal_startScroll(A)}_internal_scrollTimeTo(A){this._private__timeScale._internal_scrollTo(A),this._internal_recalculateAllPanes()}_internal_endScrollTime(){this._private__timeScale._internal_endScroll(),this._internal_lightUpdate()}_internal_serieses(){return this._private__serieses}_internal_setAndSaveCurrentPosition(A,t,e,i){this._private__crosshair._internal_saveOriginCoord(A,t);let r=NaN,n=this._private__timeScale._internal_coordinateToIndex(A);var a=this._private__timeScale._internal_visibleStrictRange(),a=(null!==a&&(n=Math.min(Math.max(a._internal_left(),n),a._internal_right())),i._internal_defaultPriceScale()),s=a._internal_firstValue();null!==s&&(r=a._internal_coordinateToPrice(t,s)),r=this._private__magnet._internal_align(r,n,i),this._private__crosshair._internal_setPosition(n,r,i),this._internal_cursorUpdate(),this._private__crosshairMoved._internal_fire(this._private__crosshair._internal_appliedIndex(),{x:A,y:t},e)}_internal_clearCurrentPosition(){this._internal_crosshairSource()._internal_clearPosition(),this._internal_cursorUpdate(),this._private__crosshairMoved._internal_fire(null,null,null)}_internal_updateCrosshair(){var A,t,e=this._private__crosshair._internal_pane();null!==e&&(A=this._private__crosshair._internal_originCoordX(),t=this._private__crosshair._internal_originCoordY(),this._internal_setAndSaveCurrentPosition(A,t,null,e)),this._private__crosshair._internal_updateAllViews()}_internal_updateTimeScale(A,t,e){var i=this._private__timeScale._internal_indexToTime(0),t=(void 0!==t&&void 0!==e&&this._private__timeScale._internal_update(t,e),this._private__timeScale._internal_indexToTime(0)),e=this._private__timeScale._internal_baseIndex(),r=this._private__timeScale._internal_visibleStrictRange();null!==r&&null!==i&&null!==t&&(r=r._internal_contains(e),i=i._internal_timestamp>t._internal_timestamp,t=null!==A&&eA._internal_orderedSources().includes(t));return void 0===A?null:A}_internal_recalculateAllPanes(){this._private__watermark._internal_updateAllViews(),this._private__panes.forEach(A=>A._internal_recalculate()),this._internal_updateCrosshair()}_internal_destroy(){this._private__panes.forEach(A=>A._internal_destroy()),this._private__panes.length=0,this._private__options.localization.priceFormatter=void 0,this._private__options.localization.timeFormatter=void 0}_internal_rendererOptionsProvider(){return this._private__rendererOptionsProvider}_internal_priceAxisRendererOptions(){return this._private__rendererOptionsProvider._internal_options()}_internal_priceScalesOptionsChanged(){return this._private__priceScalesOptionsChanged}_internal_createSeries(A,t){var e=this._private__panes[0],t=this._private__createSeries(t,A,e);return this._private__serieses.push(t),1===this._private__serieses.length?this._internal_fullUpdate():this._internal_lightUpdate(),t}_internal_removeSeries(A){var t=this._internal_paneForSource(A),e=this._private__serieses.indexOf(A);a(-1!==e,"Series not found"),this._private__serieses.splice(e,1),B(t)._internal_removeDataSource(A),A._internal_destroy&&A._internal_destroy()}_internal_moveSeriesToScale(A,t){var e,i=B(this._internal_paneForSource(A)),r=(i._internal_removeDataSource(A),this._internal_findPriceScale(t));null===r?(e=A._internal_zorder(),i._internal_addDataSource(A,t,e)):(e=r._internal_pane===i?A._internal_zorder():void 0,r._internal_pane._internal_addDataSource(A,t,e))}_internal_fitContent(){var A=u._internal_light();A._internal_setFitContent(),this._private__invalidate(A)}_internal_setTargetLogicalRange(A){var t=u._internal_light();t._internal_applyRange(A),this._private__invalidate(t)}_internal_resetTimeScale(){var A=u._internal_light();A._internal_resetTimeScale(),this._private__invalidate(A)}_internal_setBarSpacing(A){var t=u._internal_light();t._internal_setBarSpacing(A),this._private__invalidate(t)}_internal_setRightOffset(A){var t=u._internal_light();t._internal_setRightOffset(A),this._private__invalidate(t)}_internal_setTimeScaleAnimation(A){var t=u._internal_light();t._internal_setTimeScaleAnimation(A),this._private__invalidate(t)}_internal_stopTimeScaleAnimation(){var A=u._internal_light();A._internal_stopTimeScaleAnimation(),this._private__invalidate(A)}_internal_defaultVisiblePriceScaleId(){return this._private__options.rightPriceScale.visible?"right":"left"}_internal_backgroundBottomColor(){return this._private__backgroundBottomColor}_internal_backgroundTopColor(){return this._private__backgroundTopColor}_internal_backgroundColorAtYPercentFromTop(A){var t=this._private__backgroundBottomColor,e=this._private__backgroundTopColor;if(t===e)return t;if(A=Math.max(0,Math.min(100,Math.round(100*A))),null===this._private__gradientColorsCache||this._private__gradientColorsCache._internal_topColor!==e||this._private__gradientColorsCache._internal_bottomColor!==t)this._private__gradientColorsCache={_internal_topColor:e,_internal_bottomColor:t,_internal_colors:new Map};else{var i=this._private__gradientColorsCache._internal_colors.get(A);if(void 0!==i)return i}i=function(A,t,e){var[A,i,r,n]=G(A),[t,a,s,o]=G(t);return`rgba(${(t=[h(A+e*(t-A)),h(i+e*(a-i)),h(r+e*(s-r)),O(n+e*(o-n))])[0]}, ${t[1]}, ${t[2]}, ${t[3]})`}(e,t,A/100);return this._private__gradientColorsCache._internal_colors.set(A,i),i}_private__paneInvalidationMask(A,t){var e=new u(t);return null!==A&&(A=this._private__panes.indexOf(A),e._internal_invalidatePane(A,{_internal_level:t})),e}_private__invalidationMaskForSource(A,t){return void 0===t&&(t=2),this._private__paneInvalidationMask(this._internal_paneForSource(A),t)}_private__invalidate(A){this._private__invalidateHandler&&this._private__invalidateHandler(A),this._private__panes.forEach(A=>A._internal_grid()._internal_paneView()._internal_update())}_private__createSeries(A,t,e){var t=new St(this,A,t),i=void 0!==A.priceScaleId?A.priceScaleId:this._internal_defaultVisiblePriceScaleId();return e._internal_addDataSource(t,i),vA(i)||t._internal_applyOptions(A),t}_private__getBackgroundColor(A){var t=this._private__options.layout;return"gradient"===t.background.type?0===A?t.background.topColor:t.background.bottomColor:t.background.color}}function se(A){return!g(A)&&!z(A)}function oe(A){return g(A)}function le(A){return void 0!==A.open||void 0!==A.value}t.LastPriceAnimationMode=void 0,(A=t.LastPriceAnimationMode||(t.LastPriceAnimationMode={}))[A.Disabled=0]="Disabled",A[A.Continuous=1]="Continuous",A[A.OnDataUpdate=2]="OnDataUpdate",t.PriceLineSource=void 0,(A=t.PriceLineSource||(t.PriceLineSource={}))[A.LastBar=0]="LastBar",A[A.LastVisible=1]="LastVisible",t.ColorType=void 0,(A=t.ColorType||(t.ColorType={})).Solid="solid",A.VerticalGradient="gradient";const H="undefined"!=typeof window;function _e(){return H&&-1({width:Math.max(A.width,t.width),height:Math.max(A.height,t.height)})}));return A.resizeCanvasElement(t),A}function ge(A){H&&void 0!==window.chrome&&A.addEventListener("mousedown",A=>{if(1===A.button)return A.preventDefault(),!1})}class ve{constructor(A,t,e){this._private__clickCount=0,this._private__clickTimeoutId=null,this._private__clickPosition={_internal_x:Number.NEGATIVE_INFINITY,_internal_y:Number.POSITIVE_INFINITY},this._private__tapCount=0,this._private__tapTimeoutId=null,this._private__tapPosition={_internal_x:Number.NEGATIVE_INFINITY,_internal_y:Number.POSITIVE_INFINITY},this._private__longTapTimeoutId=null,this._private__longTapActive=!1,this._private__mouseMoveStartPosition=null,this._private__touchMoveStartPosition=null,this._private__touchMoveExceededManhattanDistance=!1,this._private__cancelClick=!1,this._private__cancelTap=!1,this._private__unsubscribeOutsideMouseEvents=null,this._private__unsubscribeOutsideTouchEvents=null,this._private__unsubscribeMobileSafariEvents=null,this._private__unsubscribeMousemove=null,this._private__unsubscribeRootMouseEvents=null,this._private__unsubscribeRootTouchEvents=null,this._private__startPinchMiddlePoint=null,this._private__startPinchDistance=0,this._private__pinchPrevented=!1,this._private__preventTouchDragProcess=!1,this._private__mousePressed=!1,this._private__lastTouchEventTimeStamp=0,this._private__activeTouchId=null,this._private__acceptMouseLeave=!he(),this._private__onFirefoxOutsideMouseUp=A=>{this._private__mouseUpHandler(A)},this._private__onMobileSafariDoubleClick=A=>{var t,e;this._private__firesTouchEvents(A)?(e=this._private__makeCompatEvent(A),++this._private__tapCount,this._private__tapTimeoutId&&1{this._private__target.removeEventListener("mousemove",t)},this._private__target.addEventListener("mousemove",t),this._private__firesTouchEvents(A)||(A=this._private__makeCompatEvent(A),this._private__processMouseEvent(A,this._private__handler._internal_mouseEnterEvent),this._private__acceptMouseLeave=!0)}_private__resetClickTimeout(){null!==this._private__clickTimeoutId&&clearTimeout(this._private__clickTimeoutId),this._private__clickCount=0,this._private__clickTimeoutId=null,this._private__clickPosition={_internal_x:Number.NEGATIVE_INFINITY,_internal_y:Number.POSITIVE_INFINITY}}_private__resetTapTimeout(){null!==this._private__tapTimeoutId&&clearTimeout(this._private__tapTimeoutId),this._private__tapCount=0,this._private__tapTimeoutId=null,this._private__tapPosition={_internal_x:Number.NEGATIVE_INFINITY,_internal_y:Number.POSITIVE_INFINITY}}_private__mouseMoveHandler(A){this._private__mousePressed||null!==this._private__touchMoveStartPosition||this._private__firesTouchEvents(A)||(A=this._private__makeCompatEvent(A),this._private__processMouseEvent(A,this._private__handler._internal_mouseMoveEvent),this._private__acceptMouseLeave=!0)}_private__touchMoveHandler(A){var t,e,i,r=me(A.changedTouches,B(this._private__activeTouchId));null===r||(this._private__lastTouchEventTimeStamp=we(A),null!==this._private__startPinchMiddlePoint)||this._private__preventTouchDragProcess||(this._private__pinchPrevented=!0,{_internal_xOffset:t,_internal_yOffset:e,_internal_manhattanDistance:i}=this._private__touchMouseMoveWithDownInfo(D(r),B(this._private__touchMoveStartPosition)),!this._private__touchMoveExceededManhattanDistance&&i{e.removeEventListener("touchmove",i),e.removeEventListener("touchend",r)},e.addEventListener("touchmove",i,{passive:!1}),e.addEventListener("touchend",r,{passive:!1}),this._private__clearLongTapTimeout(),this._private__longTapTimeoutId=setTimeout(this._private__longTapHandler.bind(this,A),240)}A=this._private__makeCompatEvent(A,t);this._private__processTouchEvent(A,this._private__handler._internal_touchStartEvent),this._private__tapTimeoutId||(this._private__tapCount=0,this._private__tapTimeoutId=setTimeout(this._private__resetTapTimeout.bind(this),500),this._private__tapPosition=D(t))}}_private__mouseDownHandler(A){if(0===A.button){const e=this._private__target.ownerDocument.documentElement;_e()&&e.addEventListener("mouseleave",this._private__onFirefoxOutsideMouseUp),this._private__cancelClick=!1,this._private__mouseMoveStartPosition=D(A),this._private__unsubscribeRootMouseEvents&&(this._private__unsubscribeRootMouseEvents(),this._private__unsubscribeRootMouseEvents=null);{const i=this._private__mouseMoveWithDownHandler.bind(this),r=this._private__mouseUpHandler.bind(this);this._private__unsubscribeRootMouseEvents=()=>{e.removeEventListener("mousemove",i),e.removeEventListener("mouseup",r)},e.addEventListener("mousemove",i),e.addEventListener("mouseup",r)}var t;this._private__mousePressed=!0,this._private__firesTouchEvents(A)||(t=this._private__makeCompatEvent(A),this._private__processMouseEvent(t,this._private__handler._internal_mouseDownEvent),this._private__clickTimeoutId)||(this._private__clickCount=0,this._private__clickTimeoutId=setTimeout(this._private__resetClickTimeout.bind(this),500),this._private__clickPosition=D(A))}}_private__init(){this._private__target.addEventListener("mouseenter",this._private__mouseEnterHandler.bind(this)),this._private__target.addEventListener("touchcancel",this._private__clearLongTapTimeout.bind(this));{const A=this._private__target.ownerDocument,t=A=>{!this._private__handler._internal_mouseDownOutsideEvent||A.composed&&this._private__target.contains(A.composedPath()[0])||A.target&&this._private__target.contains(A.target)||this._private__handler._internal_mouseDownOutsideEvent()};this._private__unsubscribeOutsideTouchEvents=()=>{A.removeEventListener("touchstart",t)},this._private__unsubscribeOutsideMouseEvents=()=>{A.removeEventListener("mousedown",t)},A.addEventListener("mousedown",t),A.addEventListener("touchstart",t,{passive:!0})}he()&&(this._private__unsubscribeMobileSafariEvents=()=>{this._private__target.removeEventListener("dblclick",this._private__onMobileSafariDoubleClick)},this._private__target.addEventListener("dblclick",this._private__onMobileSafariDoubleClick)),this._private__target.addEventListener("mouseleave",this._private__mouseLeaveHandler.bind(this)),this._private__target.addEventListener("touchstart",this._private__touchStartHandler.bind(this),{passive:!0}),ge(this._private__target),this._private__target.addEventListener("mousedown",this._private__mouseDownHandler.bind(this)),this._private__initPinch(),this._private__target.addEventListener("touchmove",()=>{},{passive:!1})}_private__initPinch(){void 0===this._private__handler._internal_pinchStartEvent&&void 0===this._private__handler._internal_pinchEvent&&void 0===this._private__handler._internal_pinchEndEvent||(this._private__target.addEventListener("touchstart",A=>this._private__checkPinchState(A.touches),{passive:!0}),this._private__target.addEventListener("touchmove",A=>{var t;2===A.touches.length&&null!==this._private__startPinchMiddlePoint&&void 0!==this._private__handler._internal_pinchEvent&&(t=fe(A.touches[0],A.touches[1])/this._private__startPinchDistance,this._private__handler._internal_pinchEvent(this._private__startPinchMiddlePoint,t),M(A))},{passive:!1}),this._private__target.addEventListener("touchend",A=>{this._private__checkPinchState(A.touches)}))}_private__checkPinchState(A){1===A.length&&(this._private__pinchPrevented=!1),2!==A.length||this._private__pinchPrevented||this._private__longTapActive?this._private__stopPinch():this._private__startPinch(A)}_private__startPinch(A){var t=this._private__target.getBoundingClientRect()||{left:0,top:0};this._private__startPinchMiddlePoint={_internal_x:(A[0].clientX-t.left+(A[1].clientX-t.left))/2,_internal_y:(A[0].clientY-t.top+(A[1].clientY-t.top))/2},this._private__startPinchDistance=fe(A[0],A[1]),void 0!==this._private__handler._internal_pinchStartEvent&&this._private__handler._internal_pinchStartEvent(),this._private__clearLongTapTimeout()}_private__stopPinch(){null!==this._private__startPinchMiddlePoint&&(this._private__startPinchMiddlePoint=null,void 0!==this._private__handler._internal_pinchEndEvent)&&this._private__handler._internal_pinchEndEvent()}_private__mouseLeaveHandler(A){this._private__unsubscribeMousemove&&this._private__unsubscribeMousemove(),this._private__firesTouchEvents(A)||this._private__acceptMouseLeave&&(A=this._private__makeCompatEvent(A),this._private__processMouseEvent(A,this._private__handler._internal_mouseLeaveEvent),this._private__acceptMouseLeave=!he())}_private__longTapHandler(A){var t=me(A.touches,B(this._private__activeTouchId));null!==t&&(A=this._private__makeCompatEvent(A,t),this._private__processTouchEvent(A,this._private__handler._internal_longTapEvent),this._private__cancelTap=!0,this._private__longTapActive=!0)}_private__firesTouchEvents(A){return A.sourceCapabilities&&void 0!==A.sourceCapabilities.firesTouchEvents?A.sourceCapabilities.firesTouchEvents:we(A){"touchstart"!==A.type&&M(A)}}}}function fe(A,t){var e=A.clientX-t.clientX,A=A.clientY-t.clientY;return Math.sqrt(e*e+A*A)}function M(A){A.cancelable&&A.preventDefault()}function D(A){return{_internal_x:A.pageX,_internal_y:A.pageY}}function we(A){return A.timeStamp||performance.now()}function me(t,e){for(let A=0;A{this._private__isSettingSize||this._private__pane._internal_chart()._internal_model()._internal_lightUpdate()},this._private__topCanvasSuggestedBitmapSizeChangedHandler=()=>{this._private__isSettingSize||this._private__pane._internal_chart()._internal_model()._internal_lightUpdate()},this._private__pane=A,this._private__options=t,this._private__layoutOptions=t.layout,this._private__rendererOptionsProvider=e,this._private__isLeft="left"===i,this._private__cell=document.createElement("div"),this._private__cell.style.height="100%",this._private__cell.style.overflow="hidden",this._private__cell.style.width="25px",this._private__cell.style.left="0",this._private__cell.style.position="relative",this._private__canvasBinding=I(this._private__cell,d.size({width:16,height:16})),this._private__canvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler);A=this._private__canvasBinding.canvasElement,A.style.position="absolute",A.style.zIndex="1",A.style.left="0",A.style.top="0",this._private__topCanvasBinding=I(this._private__cell,d.size({width:16,height:16})),this._private__topCanvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__topCanvasSuggestedBitmapSizeChangedHandler),t=this._private__topCanvasBinding.canvasElement,t.style.position="absolute",t.style.zIndex="2",t.style.left="0",t.style.top="0",e={_internal_mouseDownEvent:this._private__mouseDownEvent.bind(this),_internal_touchStartEvent:this._private__mouseDownEvent.bind(this),_internal_pressedMouseMoveEvent:this._private__pressedMouseMoveEvent.bind(this),_internal_touchMoveEvent:this._private__pressedMouseMoveEvent.bind(this),_internal_mouseDownOutsideEvent:this._private__mouseDownOutsideEvent.bind(this),_internal_mouseUpEvent:this._private__mouseUpEvent.bind(this),_internal_touchEndEvent:this._private__mouseUpEvent.bind(this),_internal_mouseDoubleClickEvent:this._private__mouseDoubleClickEvent.bind(this),_internal_doubleTapEvent:this._private__mouseDoubleClickEvent.bind(this),_internal_mouseEnterEvent:this._private__mouseEnterEvent.bind(this),_internal_mouseLeaveEvent:this._private__mouseLeaveEvent.bind(this)};this._private__mouseEventHandler=new ve(this._private__topCanvasBinding.canvasElement,e,{_internal_treatVertTouchDragAsPageScroll:()=>!1,_internal_treatHorzTouchDragAsPageScroll:()=>!0})}_internal_destroy(){this._private__mouseEventHandler._internal_destroy(),this._private__topCanvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__topCanvasSuggestedBitmapSizeChangedHandler),this._private__topCanvasBinding.dispose(),this._private__canvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler),this._private__canvasBinding.dispose(),null!==this._private__priceScale&&this._private__priceScale._internal_onMarksChanged()._internal_unsubscribeAll(this),this._private__priceScale=null}_internal_getElement(){return this._private__cell}_internal_fontSize(){return this._private__layoutOptions.fontSize}_internal_rendererOptions(){var A=this._private__rendererOptionsProvider._internal_options();return this._private__font!==A._internal_font&&(this._private__widthCache._internal_reset(),this._private__font=A._internal_font),A}_internal_optimalWidth(){if(null===this._private__priceScale)return 0;let t=0;var A=this._internal_rendererOptions(),e=B(this._private__canvasBinding.canvasElement.getContext("2d")),i=(e.save(),this._private__priceScale._internal_marks()),r=(e.font=this._private__baseFont(),0t&&(t=n)}var a,i=this._private__priceScale._internal_firstValue(),s=(null!==i&&null!==this._private__size&&(s=this._private__priceScale._internal_coordinateToPrice(1,i),a=this._private__priceScale._internal_coordinateToPrice(this._private__size.height-2,i),t=Math.max(t,this._private__widthCache._internal_measureText(e,this._private__priceScale._internal_formatPrice(Math.floor(Math.min(s,a))+.11111111111111,i)),this._private__widthCache._internal_measureText(e,this._private__priceScale._internal_formatPrice(Math.ceil(Math.max(s,a))-.11111111111111,i)))),e.restore(),t||34);return ue(Math.ceil(A._internal_borderSize+A._internal_tickLength+A._internal_paddingInner+A._internal_paddingOuter+5+s))}_internal_setSize(A){null!==this._private__size&&d.equalSizes(this._private__size,A)||(this._private__size=A,this._private__isSettingSize=!0,this._private__canvasBinding.resizeCanvasElement(A),this._private__topCanvasBinding.resizeCanvasElement(A),this._private__isSettingSize=!1,this._private__cell.style.width=A.width+"px",this._private__cell.style.height=A.height+"px")}_internal_getWidth(){return B(this._private__size).width}_internal_setPriceScale(A){this._private__priceScale!==A&&(null!==this._private__priceScale&&this._private__priceScale._internal_onMarksChanged()._internal_unsubscribeAll(this),(this._private__priceScale=A)._internal_onMarksChanged()._internal_subscribe(this._private__onMarksChanged.bind(this),this))}_internal_priceScale(){return this._private__priceScale}_internal_reset(){var A=this._private__pane._internal_state();this._private__pane._internal_chart()._internal_model()._internal_resetPriceScale(A,B(this._internal_priceScale()))}_internal_paint(A){null!==this._private__size&&(1!==A&&(this._private__alignLabels(),this._private__canvasBinding.applySuggestedBitmapSize(),null!==(A=d.tryCreateCanvasRenderingTarget2D(this._private__canvasBinding)))&&(A.useBitmapCoordinateSpace(A=>{this._private__drawBackground(A),this._private__drawBorder(A)}),this._private__drawTickMarks(A),this._private__drawBackLabels(A)),this._private__topCanvasBinding.applySuggestedBitmapSize(),null!==(A=d.tryCreateCanvasRenderingTarget2D(this._private__topCanvasBinding)))&&(A.useBitmapCoordinateSpace(({context:A,bitmapSize:t})=>{A.clearRect(0,0,t.width,t.height)}),this._private__drawCrosshairLabel(A))}_internal_getBitmapSize(){return this._private__canvasBinding.bitmapSize}_internal_drawBitmap(A,t,e){var i=this._internal_getBitmapSize();0{A.fillStyle=o.borderColor;var i=Math.max(1,Math.floor(e)),r=Math.floor(.5*e),n=Math.round(l._internal_tickLength*t);A.beginPath();for(const a of s)A.rect(Math.floor(_*t),Math.round(a._internal_coord*e)-r,n,i);A.fill()}),A.useMediaCoordinateSpace(({context:t})=>{t.font=this._private__baseFont(),t.fillStyle=null!=(A=o.textColor)?A:this._private__layoutOptions.textColor,t.textAlign=this._private__isLeft?"right":"left",t.textBaseline="middle";var A,e=this._private__isLeft?Math.round(_-l._internal_paddingInner):Math.round(_+l._internal_tickLength+l._internal_paddingInner),i=s.map(A=>this._private__widthCache._internal_yMidCorrection(t,A._internal_label));for(let A=s.length;A--;){var r=s[A];t.fillText(r._internal_label,e,r._internal_coord+i[A])}})}}_private__alignLabels(){if(null!==this._private__size&&null!==this._private__priceScale){let e=this._private__size.height/2;const i=[],r=this._private__priceScale._internal_orderedSources().slice();const n=this._private__pane._internal_state();var A=this._internal_rendererOptions();this._private__priceScale===n._internal_defaultVisiblePriceScale()&&this._private__pane._internal_state()._internal_orderedSources().forEach(A=>{n._internal_isOverlay(A)&&r.push(A)});const a=this._private__priceScale._internal_dataSources()[0],s=this._private__priceScale;r.forEach(A=>{var t=A._internal_priceAxisViews(n,s);t.forEach(A=>{A._internal_setFixedCoordinate(null),A._internal_isVisible()&&i.push(A)}),a===A&&0A._internal_setFixedCoordinate(A._internal_coordinate()));var t=this._private__priceScale._internal_options();t.alignLabels&&this._private__fixLabelOverlap(i,A,e)}}_private__fixLabelOverlap(A,t,e){if(null!==this._private__size){var i=A.filter(A=>A._internal_coordinate()A._internal_coordinate()>e);i.sort((A,t)=>t._internal_coordinate()-A._internal_coordinate()),i.length&&r.length&&r.push(i[0]),r.sort((A,t)=>A._internal_coordinate()-t._internal_coordinate());for(const p of A){var n=Math.floor(p._internal_height(t)/2),a=p._internal_coordinate();-nthis._private__size.height-n&&a{A._internal_isAxisLabelVisible()&&A._internal_renderer(B(this._private__priceScale))._internal_draw(t,e,this._private__widthCache,i)})}}_private__drawCrosshairLabel(t){if(null!==this._private__size&&null!==this._private__priceScale){var A=this._private__pane._internal_chart()._internal_model(),e=[],i=this._private__pane._internal_state(),A=A._internal_crosshairSource()._internal_priceAxisViews(i,this._private__priceScale);A.length&&e.push(A);const r=this._internal_rendererOptions(),n=this._private__isLeft?"right":"left";e.forEach(A=>{A.forEach(A=>{A._internal_renderer(B(this._private__priceScale))._internal_draw(t,r,this._private__widthCache,n)})})}}_private__setCursor(A){this._private__cell.style.cursor=1===A?"ns-resize":"default"}_private__onMarksChanged(){var A=this._internal_optimalWidth();this._private__prevOptimalWidth{this._private__isSettingSize||null===this._private__state||this._private__model()._internal_lightUpdate()},this._private__topCanvasSuggestedBitmapSizeChangedHandler=()=>{this._private__isSettingSize||null===this._private__state||this._private__model()._internal_lightUpdate()},this._private__chart=A,this._private__state=t,this._private__state._internal_onDestroyed()._internal_subscribe(this._private__onStateDestroyed.bind(this),this,!0),this._private__paneCell=document.createElement("td"),this._private__paneCell.style.padding="0",this._private__paneCell.style.position="relative";A=document.createElement("div"),A.style.width="100%",A.style.height="100%",A.style.position="relative",A.style.overflow="hidden",this._private__leftAxisCell=document.createElement("td"),this._private__leftAxisCell.style.padding="0",this._private__rightAxisCell=document.createElement("td"),this._private__rightAxisCell.style.padding="0",this._private__paneCell.appendChild(A),this._private__canvasBinding=I(A,d.size({width:16,height:16})),this._private__canvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler),t=this._private__canvasBinding.canvasElement,t.style.position="absolute",t.style.zIndex="1",t.style.left="0",t.style.top="0",this._private__topCanvasBinding=I(A,d.size({width:16,height:16})),this._private__topCanvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__topCanvasSuggestedBitmapSizeChangedHandler),t=this._private__topCanvasBinding.canvasElement;t.style.position="absolute",t.style.zIndex="2",t.style.left="0",t.style.top="0",this._private__rowElement=document.createElement("tr"),this._private__rowElement.appendChild(this._private__leftAxisCell),this._private__rowElement.appendChild(this._private__paneCell),this._private__rowElement.appendChild(this._private__rightAxisCell),this._internal_updatePriceAxisWidgetsStates(),this._private__mouseEventHandler=new ve(this._private__topCanvasBinding.canvasElement,this,{_internal_treatVertTouchDragAsPageScroll:()=>null===this._private__startTrackPoint&&!this._private__chart._internal_options().handleScroll.vertTouchDrag,_internal_treatHorzTouchDragAsPageScroll:()=>null===this._private__startTrackPoint&&!this._private__chart._internal_options().handleScroll.horzTouchDrag})}_internal_destroy(){null!==this._private__leftPriceAxisWidget&&this._private__leftPriceAxisWidget._internal_destroy(),null!==this._private__rightPriceAxisWidget&&this._private__rightPriceAxisWidget._internal_destroy(),this._private__topCanvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__topCanvasSuggestedBitmapSizeChangedHandler),this._private__topCanvasBinding.dispose(),this._private__canvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler),this._private__canvasBinding.dispose(),null!==this._private__state&&this._private__state._internal_onDestroyed()._internal_unsubscribeAll(this),this._private__mouseEventHandler._internal_destroy()}_internal_state(){return B(this._private__state)}_internal_setState(A){null!==this._private__state&&this._private__state._internal_onDestroyed()._internal_unsubscribeAll(this),this._private__state=A,null!==this._private__state&&this._private__state._internal_onDestroyed()._internal_subscribe(Ee.prototype._private__onStateDestroyed.bind(this),this,!0),this._internal_updatePriceAxisWidgetsStates()}_internal_chart(){return this._private__chart}_internal_getElement(){return this._private__rowElement}_internal_updatePriceAxisWidgetsStates(){var A;null!==this._private__state&&(this._private__recreatePriceAxisWidgets(),0!==this._private__model()._internal_serieses().length)&&(null!==this._private__leftPriceAxisWidget&&(A=this._private__state._internal_leftPriceScale(),this._private__leftPriceAxisWidget._internal_setPriceScale(B(A))),null!==this._private__rightPriceAxisWidget)&&(A=this._private__state._internal_rightPriceScale(),this._private__rightPriceAxisWidget._internal_setPriceScale(B(A)))}_internal_updatePriceAxisWidgets(){null!==this._private__leftPriceAxisWidget&&this._private__leftPriceAxisWidget._internal_update(),null!==this._private__rightPriceAxisWidget&&this._private__rightPriceAxisWidget._internal_update()}_internal_stretchFactor(){return null!==this._private__state?this._private__state._internal_stretchFactor():0}_internal_setStretchFactor(A){this._private__state&&this._private__state._internal_setStretchFactor(A)}_internal_mouseEnterEvent(A){var t,e;this._private__state&&(this._private__onMouseEvent(),t=A.localX,e=A.localY,this._private__setCrosshairPosition(t,e,A))}_internal_mouseDownEvent(A){this._private__onMouseEvent(),this._private__mouseTouchDownEvent(),this._private__setCrosshairPosition(A.localX,A.localY,A)}_internal_mouseMoveEvent(A){var t,e;this._private__state&&(this._private__onMouseEvent(),t=A.localX,e=A.localY,this._private__setCrosshairPosition(t,e,A),A=this._internal_hitTest(t,e),this._private__model()._internal_setHoveredSource(A&&{_internal_source:A._internal_source,_internal_object:A._internal_object}))}_internal_mouseClickEvent(A){null!==this._private__state&&(this._private__onMouseEvent(),this._private__fireClickedDelegate(A))}_internal_pressedMouseMoveEvent(A){this._private__onMouseEvent(),this._private__pressedMouseTouchMoveEvent(A),this._private__setCrosshairPosition(A.localX,A.localY,A)}_internal_mouseUpEvent(A){null!==this._private__state&&(this._private__onMouseEvent(),this._private__longTap=!1,this._private__endScroll(A))}_internal_tapEvent(A){null!==this._private__state&&this._private__fireClickedDelegate(A)}_internal_longTapEvent(A){var t;this._private__longTap=!0,null===this._private__startTrackPoint&&(t={x:A.localX,y:A.localY},this._private__startTrackingMode(t,t,A))}_internal_mouseLeaveEvent(A){null!==this._private__state&&(this._private__onMouseEvent(),this._private__state._internal_model()._internal_setHoveredSource(null),this._private__clearCrosshairPosition())}_internal_clicked(){return this._private__clicked}_internal_pinchStartEvent(){this._private__prevPinchScale=1,this._private__model()._internal_stopTimeScaleAnimation()}_internal_pinchEvent(A,t){var e;this._private__chart._internal_options().handleScale.pinch&&(e=5*(t-this._private__prevPinchScale),this._private__prevPinchScale=t,this._private__model()._internal_zoomTime(A._internal_x,e))}_internal_touchStartEvent(A){var t;this._private__longTap=!1,this._private__exitTrackingModeOnNextTry=null!==this._private__startTrackPoint,this._private__mouseTouchDownEvent(),null!==this._private__startTrackPoint&&(t=this._private__model()._internal_crosshairSource(),this._private__initCrosshairPosition={x:t._internal_appliedX(),y:t._internal_appliedY()},this._private__startTrackPoint={x:A.localX,y:A.localY})}_internal_touchMoveEvent(A){var t,e,i;null!==this._private__state&&(e=A.localX,t=A.localY,null!==this._private__startTrackPoint?(this._private__exitTrackingModeOnNextTry=!1,e=(i=B(this._private__initCrosshairPosition)).x+(e-this._private__startTrackPoint.x),i=i.y+(t-this._private__startTrackPoint.y),this._private__setCrosshairPosition(e,i,A)):this._private__pressedMouseTouchMoveEvent(A))}_internal_touchEndEvent(A){0===this._internal_chart()._internal_options().trackingMode.exitMode&&(this._private__exitTrackingModeOnNextTry=!0),this._private__tryExitTrackingMode(),this._private__endScroll(A)}_internal_hitTest(A,t){var e=this._private__state;if(null!==e)for(const r of e._internal_orderedSources()){var i=this._private__hitTestPaneView(r._internal_paneViews(e),A,t);if(null!==i)return{_internal_source:r,_internal_view:i._internal_view,_internal_object:i._internal_object}}return null}_internal_setPriceAxisSize(A,t){B("left"===t?this._private__leftPriceAxisWidget:this._private__rightPriceAxisWidget)._internal_setSize(d.size({width:A,height:this._private__size.height}))}_internal_getSize(){return this._private__size}_internal_setSize(A){d.equalSizes(this._private__size,A)||(this._private__size=A,this._private__isSettingSize=!0,this._private__canvasBinding.resizeCanvasElement(A),this._private__topCanvasBinding.resizeCanvasElement(A),this._private__isSettingSize=!1,this._private__paneCell.style.width=A.width+"px",this._private__paneCell.style.height=A.height+"px")}_internal_recalculatePriceScales(){var A,t=B(this._private__state);t._internal_recalculatePriceScale(t._internal_leftPriceScale()),t._internal_recalculatePriceScale(t._internal_rightPriceScale());for(const e of t._internal_dataSources())t._internal_isOverlay(e)&&(null!==(A=e._internal_priceScale())&&t._internal_recalculatePriceScale(A),e._internal_updateAllViews())}_internal_getBitmapSize(){return this._private__canvasBinding.bitmapSize}_internal_drawBitmap(A,t,e){var i=this._internal_getBitmapSize();0{this._private__drawBackground(A)}),this._private__state)&&(this._private__drawGrid(A),this._private__drawWatermark(A),this._private__drawSources(A,Ue),this._private__drawSources(A,ye)),this._private__topCanvasBinding.applySuggestedBitmapSize(),null!==(A=d.tryCreateCanvasRenderingTarget2D(this._private__topCanvasBinding)))&&(A.useBitmapCoordinateSpace(({context:A,bitmapSize:t})=>{A.clearRect(0,0,t.width,t.height)}),this._private__drawSources(A,be),this._private__drawCrosshair(A))}_internal_leftPriceAxisWidget(){return this._private__leftPriceAxisWidget}_internal_rightPriceAxisWidget(){return this._private__rightPriceAxisWidget}_private__onStateDestroyed(){null!==this._private__state&&this._private__state._internal_onDestroyed()._internal_unsubscribeAll(this),this._private__state=null}_private__fireClickedDelegate(A){var t=A.localX,e=A.localY;this._private__clicked._internal_hasListeners()&&this._private__clicked._internal_fire(this._private__model()._internal_timeScale()._internal_coordinateToIndex(t),{x:t,y:e},A)}_private__drawBackground({context:A,bitmapSize:t}){var{width:t,height:e}=t,i=this._private__model(),r=i._internal_backgroundTopColor(),i=i._internal_backgroundBottomColor();r===i?nA(A,0,0,t,e,i):lA(A,0,0,t,e,r,i)}_private__drawGrid(A){var t=B(this._private__state)._internal_grid()._internal_paneView()._internal_renderer();null!==t&&t._internal_draw(A,!1)}_private__drawWatermark(A){var t=this._private__model()._internal_watermarkSource();this._private__drawSourceImpl(A,Ue,Qe,t),this._private__drawSourceImpl(A,Ue,Fe,t)}_private__drawCrosshair(A){this._private__drawSourceImpl(A,Ue,Fe,this._private__model()._internal_crosshairSource())}_private__drawSources(A,t){var e=B(this._private__state)._internal_orderedSources();for(const i of e)this._private__drawSourceImpl(A,t,Qe,i);for(const r of e)this._private__drawSourceImpl(A,t,Fe,r)}_private__drawSourceImpl(A,t,e,i){var r=B(this._private__state),t=t(i,r),r=r._internal_model()._internal_hoveredSource(),n=null!==r&&r._internal_source===i,a=null!==r&&n&&void 0!==r._internal_object?r._internal_object._internal_hitTestData:void 0;for(const o of t){var s=o._internal_renderer();null!==s&&e(s,A,n,a)}}_private__hitTestPaneView(A,t,e){for(const r of A){var i=r._internal_renderer();if(null!==i&&i._internal_hitTest){i=i._internal_hitTest(t,e);if(null!==i)return{_internal_view:r,_internal_object:i}}}return null}_private__recreatePriceAxisWidgets(){var A,t,e,i;null!==this._private__state&&(A=this._private__chart,t=this._private__state._internal_leftPriceScale()._internal_options().visible,e=this._private__state._internal_rightPriceScale()._internal_options().visible,t||null===this._private__leftPriceAxisWidget||(this._private__leftAxisCell.removeChild(this._private__leftPriceAxisWidget._internal_getElement()),this._private__leftPriceAxisWidget._internal_destroy(),this._private__leftPriceAxisWidget=null),e||null===this._private__rightPriceAxisWidget||(this._private__rightAxisCell.removeChild(this._private__rightPriceAxisWidget._internal_getElement()),this._private__rightPriceAxisWidget._internal_destroy(),this._private__rightPriceAxisWidget=null),i=A._internal_model()._internal_rendererOptionsProvider(),t&&null===this._private__leftPriceAxisWidget&&(this._private__leftPriceAxisWidget=new Ce(this,A._internal_options(),i,"left"),this._private__leftAxisCell.appendChild(this._private__leftPriceAxisWidget._internal_getElement())),e)&&null===this._private__rightPriceAxisWidget&&(this._private__rightPriceAxisWidget=new Ce(this,A._internal_options(),i,"right"),this._private__rightAxisCell.appendChild(this._private__rightPriceAxisWidget._internal_getElement()))}_private__preventScroll(A){return A._internal_isTouch&&this._private__longTap||null!==this._private__startTrackPoint}_private__correctXCoord(A){return Math.max(0,Math.min(A,this._private__size.width-1))}_private__correctYCoord(A){return Math.max(0,Math.min(A,this._private__size.height-1))}_private__setCrosshairPosition(A,t,e){this._private__model()._internal_setAndSaveCurrentPosition(this._private__correctXCoord(A),this._private__correctYCoord(t),e,B(this._private__state))}_private__clearCrosshairPosition(){this._private__model()._internal_clearCurrentPosition()}_private__tryExitTrackingMode(){this._private__exitTrackingModeOnNextTry&&(this._private__startTrackPoint=null,this._private__clearCrosshairPosition())}_private__startTrackingMode(A,t,e){this._private__startTrackPoint=A,this._private__exitTrackingModeOnNextTry=!1,this._private__setCrosshairPosition(t.x,t.y,e);A=this._private__model()._internal_crosshairSource();this._private__initCrosshairPosition={x:A._internal_appliedX(),y:A._internal_appliedY()}}_private__model(){return this._private__chart._internal_model()}_private__endScroll(A){var t,e,i;this._private__isScrolling&&(t=this._private__model(),e=this._internal_state(),t._internal_endScrollPrice(e,e._internal_defaultPriceScale()),this._private__startScrollingPos=null,this._private__isScrolling=!1,t._internal_endScrollTime(),null!==this._private__scrollXAnimation)&&(e=performance.now(),i=t._internal_timeScale(),this._private__scrollXAnimation._internal_start(i._internal_rightOffset(),e),this._private__scrollXAnimation._internal_finished(e)||t._internal_setTimeScaleAnimation(this._private__scrollXAnimation))}_private__onMouseEvent(){this._private__startTrackPoint=null}_private__mouseTouchDownEvent(){var A;this._private__state&&(this._private__model()._internal_stopTimeScaleAnimation(),document.activeElement!==document.body&&document.activeElement!==document.documentElement?B(document.activeElement).blur():null!==(A=document.getSelection())&&A.removeAllRanges(),this._private__state._internal_defaultPriceScale()._internal_isEmpty()||this._private__model()._internal_timeScale()._internal_isEmpty())}_private__pressedMouseTouchMoveEvent(A){var t,e,i,r,n;null===this._private__state||(e=(t=this._private__model())._internal_timeScale())._internal_isEmpty()||(i=(n=this._private__chart._internal_options()).handleScroll,n=n.kineticScroll,(i.pressedMouseMove&&!A._internal_isTouch||(i.horzTouchDrag||i.vertTouchDrag)&&A._internal_isTouch)&&(i=this._private__state._internal_defaultPriceScale(),r=performance.now(),null!==this._private__startScrollingPos||this._private__preventScroll(A)||(this._private__startScrollingPos={x:A.clientX,y:A.clientY,_internal_timestamp:r,_internal_localX:A.localX,_internal_localY:A.localY}),null===this._private__startScrollingPos||this._private__isScrolling||this._private__startScrollingPos.x===A.clientX&&this._private__startScrollingPos.y===A.clientY||(A._internal_isTouch&&n.touch||!A._internal_isTouch&&n.mouse?(n=e._internal_barSpacing(),this._private__scrollXAnimation=new Be(.2/n,7/n,.997,15/n),this._private__scrollXAnimation._internal_addPosition(e._internal_rightOffset(),this._private__startScrollingPos._internal_timestamp)):this._private__scrollXAnimation=null,i._internal_isEmpty()||t._internal_startScrollPrice(this._private__state,i,A.localY),t._internal_startScrollTime(A.localX),this._private__isScrolling=!0),this._private__isScrolling)&&(i._internal_isEmpty()||t._internal_scrollPriceTo(this._private__state,i,A.localY),t._internal_scrollTimeTo(A.localX),null!==this._private__scrollXAnimation)&&this._private__scrollXAnimation._internal_addPosition(e._internal_rightOffset(),r))}}class Se{constructor(A,t,e,i,r){this._private__invalidated=!0,this._private__size=d.size({width:0,height:0}),this._private__canvasSuggestedBitmapSizeChangedHandler=()=>this._internal_paint(3),this._private__isLeft="left"===A,this._private__rendererOptionsProvider=e._internal_rendererOptionsProvider,this._private__options=t,this._private__borderVisible=i,this._private__bottomColor=r,this._private__cell=document.createElement("div"),this._private__cell.style.width="25px",this._private__cell.style.height="100%",this._private__cell.style.overflow="hidden",this._private__canvasBinding=I(this._private__cell,d.size({width:16,height:16})),this._private__canvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler)}_internal_destroy(){this._private__canvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler),this._private__canvasBinding.dispose()}_internal_getElement(){return this._private__cell}_internal_getSize(){return this._private__size}_internal_setSize(A){d.equalSizes(this._private__size,A)||(this._private__size=A,this._private__canvasBinding.resizeCanvasElement(A),this._private__cell.style.width=A.width+"px",this._private__cell.style.height=A.height+"px",this._private__invalidated=!0)}_internal_paint(A){A{this._private__drawBackground(A),this._private__drawBorder(A)})}_internal_getBitmapSize(){return this._private__canvasBinding.bitmapSize}_internal_drawBitmap(A,t,e){var i=this._internal_getBitmapSize();0t._internal_weight?A:t}class Ie{constructor(A){this._private__leftStub=null,this._private__rightStub=null,this._private__rendererOptions=null,this._private__mouseDown=!1,this._private__size=d.size({width:0,height:0}),this._private__sizeChanged=new n,this._private__widthCache=new w(5),this._private__isSettingSize=!1,this._private__canvasSuggestedBitmapSizeChangedHandler=()=>{this._private__isSettingSize||this._private__chart._internal_model()._internal_lightUpdate()},this._private__topCanvasSuggestedBitmapSizeChangedHandler=()=>{this._private__isSettingSize||this._private__chart._internal_model()._internal_lightUpdate()},this._private__chart=A,this._private__options=A._internal_options().layout,this._private__element=document.createElement("tr"),this._private__leftStubCell=document.createElement("td"),this._private__leftStubCell.style.padding="0",this._private__rightStubCell=document.createElement("td"),this._private__rightStubCell.style.padding="0",this._private__cell=document.createElement("td"),this._private__cell.style.height="25px",this._private__cell.style.padding="0",this._private__dv=document.createElement("div"),this._private__dv.style.width="100%",this._private__dv.style.height="100%",this._private__dv.style.position="relative",this._private__dv.style.overflow="hidden",this._private__cell.appendChild(this._private__dv),this._private__canvasBinding=I(this._private__dv,d.size({width:16,height:16})),this._private__canvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler);A=this._private__canvasBinding.canvasElement,A.style.position="absolute",A.style.zIndex="1",A.style.left="0",A.style.top="0",this._private__topCanvasBinding=I(this._private__dv,d.size({width:16,height:16})),this._private__topCanvasBinding.subscribeSuggestedBitmapSizeChanged(this._private__topCanvasSuggestedBitmapSizeChangedHandler),A=this._private__topCanvasBinding.canvasElement;A.style.position="absolute",A.style.zIndex="2",A.style.left="0",A.style.top="0",this._private__element.appendChild(this._private__leftStubCell),this._private__element.appendChild(this._private__cell),this._private__element.appendChild(this._private__rightStubCell),this._private__recreateStubs(),this._private__chart._internal_model()._internal_priceScalesOptionsChanged()._internal_subscribe(this._private__recreateStubs.bind(this),this),this._private__mouseEventHandler=new ve(this._private__topCanvasBinding.canvasElement,this,{_internal_treatVertTouchDragAsPageScroll:()=>!0,_internal_treatHorzTouchDragAsPageScroll:()=>!1})}_internal_destroy(){this._private__mouseEventHandler._internal_destroy(),null!==this._private__leftStub&&this._private__leftStub._internal_destroy(),null!==this._private__rightStub&&this._private__rightStub._internal_destroy(),this._private__topCanvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__topCanvasSuggestedBitmapSizeChangedHandler),this._private__topCanvasBinding.dispose(),this._private__canvasBinding.unsubscribeSuggestedBitmapSizeChanged(this._private__canvasSuggestedBitmapSizeChangedHandler),this._private__canvasBinding.dispose()}_internal_getElement(){return this._private__element}_internal_leftStub(){return this._private__leftStub}_internal_rightStub(){return this._private__rightStub}_internal_mouseDownEvent(A){var t;this._private__mouseDown||(this._private__mouseDown=!0,!(t=this._private__chart._internal_model())._internal_timeScale()._internal_isEmpty()&&this._private__chart._internal_options().handleScale.axisPressedMouseMove.time&&t._internal_startScaleTime(A.localX))}_internal_touchStartEvent(A){this._internal_mouseDownEvent(A)}_internal_mouseDownOutsideEvent(){var A=this._private__chart._internal_model();!A._internal_timeScale()._internal_isEmpty()&&this._private__mouseDown&&(this._private__mouseDown=!1,this._private__chart._internal_options().handleScale.axisPressedMouseMove.time)&&A._internal_endScaleTime()}_internal_pressedMouseMoveEvent(A){var t=this._private__chart._internal_model();!t._internal_timeScale()._internal_isEmpty()&&this._private__chart._internal_options().handleScale.axisPressedMouseMove.time&&t._internal_scaleTimeTo(A.localX)}_internal_touchMoveEvent(A){this._internal_pressedMouseMoveEvent(A)}_internal_mouseUpEvent(){this._private__mouseDown=!1;var A=this._private__chart._internal_model();A._internal_timeScale()._internal_isEmpty()&&!this._private__chart._internal_options().handleScale.axisPressedMouseMove.time||A._internal_endScaleTime()}_internal_touchEndEvent(){this._internal_mouseUpEvent()}_internal_mouseDoubleClickEvent(){this._private__chart._internal_options().handleScale.axisDoubleClickReset.time&&this._private__chart._internal_model()._internal_resetTimeScale()}_internal_doubleTapEvent(){this._internal_mouseDoubleClickEvent()}_internal_mouseEnterEvent(){this._private__chart._internal_model()._internal_options().handleScale.axisPressedMouseMove.time&&this._private__setCursor(1)}_internal_mouseLeaveEvent(){this._private__setCursor(0)}_internal_getSize(){return this._private__size}_internal_sizeChanged(){return this._private__sizeChanged}_internal_setSizes(A,t,e){d.equalSizes(this._private__size,A)||(this._private__size=A,this._private__isSettingSize=!0,this._private__canvasBinding.resizeCanvasElement(A),this._private__topCanvasBinding.resizeCanvasElement(A),this._private__isSettingSize=!1,this._private__cell.style.width=A.width+"px",this._private__cell.style.height=A.height+"px",this._private__sizeChanged._internal_fire(A)),null!==this._private__leftStub&&this._private__leftStub._internal_setSize(d.size({width:t,height:A.height})),null!==this._private__rightStub&&this._private__rightStub._internal_setSize(d.size({width:e,height:A.height}))}_internal_optimalHeight(){var A=this._private__getRendererOptions();return Math.ceil(A._internal_borderSize+A._internal_tickLength+A._internal_fontSize+A._internal_paddingTop+A._internal_paddingBottom+A._internal_labelBottomOffset)}_internal_update(){this._private__chart._internal_model()._internal_timeScale()._internal_marks()}_internal_getBitmapSize(){return this._private__canvasBinding.bitmapSize}_internal_drawBitmap(A,t,e){var i=this._internal_getBitmapSize();0{this._private__drawBackground(A),this._private__drawBorder(A)}),this._private__drawTickMarks(t)),null!==this._private__leftStub&&this._private__leftStub._internal_paint(A),null!==this._private__rightStub)&&this._private__rightStub._internal_paint(A),this._private__topCanvasBinding.applySuggestedBitmapSize(),null!==(t=d.tryCreateCanvasRenderingTarget2D(this._private__topCanvasBinding)))&&(t.useBitmapCoordinateSpace(({context:A,bitmapSize:t})=>{A.clearRect(0,0,t.width,t.height)}),this._private__drawLabels([this._private__chart._internal_model()._internal_crosshairSource()],t))}_private__drawBackground({context:A,bitmapSize:t}){nA(A,0,0,t.width,t.height,this._private__chart._internal_model()._internal_backgroundBottomColor())}_private__drawBorder({context:A,bitmapSize:t,verticalPixelRatio:e}){this._private__chart._internal_options().timeScale.borderVisible&&(A.fillStyle=this._private__lineColor(),e=Math.max(1,Math.floor(this._private__getRendererOptions()._internal_borderSize*e)),A.fillRect(0,0,t.width,e))}_private__drawTickMarks(A){var t=this._private__chart._internal_model()._internal_timeScale();const s=t._internal_marks();if(s&&0!==s.length){let a=s.reduce(He,s[0])._internal_weight;30{t.strokeStyle=this._private__lineColor(),t.fillStyle=this._private__lineColor();var i=Math.max(1,Math.floor(e)),r=Math.floor(.5*e),n=(t.beginPath(),Math.round(o._internal_tickLength*A));for(let A=s.length;A--;){var a=Math.round(s[A]._internal_coord*e);t.rect(a-r,0,i,n)}t.fill()}),A.useMediaCoordinateSpace(({context:A})=>{var t,e,i=o._internal_borderSize+o._internal_tickLength+o._internal_paddingTop+o._internal_fontSize/2;A.textAlign="center",A.textBaseline="middle",A.fillStyle=this._private__textColor(),A.font=this._private__baseFont();for(const r of s)r._internal_weight=a&&(e=n._internal_needAlignCoordinate?this._private__alignTickMarkLabelCoordinate(A,n._internal_coord,n._internal_label):n._internal_coord,A.fillText(n._internal_label,e,i))})}}_private__alignTickMarkLabelCoordinate(A,t,e){A=this._private__widthCache._internal_measureText(A,e),e=Math.floor(t-A/2)+.5;return ethis._private__size.width&&(t-=Math.abs(this._private__size.width-(e+A))),t}_private__drawLabels(A,t){var e=this._private__getRendererOptions();for(const i of A)for(const r of i._internal_timeAxisViews())r._internal_renderer()._internal_draw(t,e)}_private__lineColor(){return this._private__chart._internal_options().timeScale.borderColor}_private__textColor(){return this._private__options.textColor}_private__fontSize(){return this._private__options.fontSize}_private__baseFont(){return i(this._private__fontSize(),this._private__options.fontFamily)}_private__baseBoldFont(){return i(this._private__fontSize(),this._private__options.fontFamily,"bold")}_private__getRendererOptions(){null===this._private__rendererOptions&&(this._private__rendererOptions={_internal_borderSize:1,_internal_baselineOffset:NaN,_internal_paddingTop:NaN,_internal_paddingBottom:NaN,_internal_paddingHorizontal:NaN,_internal_tickLength:5,_internal_fontSize:NaN,_internal_font:"",_internal_widthCache:new w,_internal_labelBottomOffset:0});var A,t=this._private__rendererOptions,e=this._private__baseFont();return t._internal_font!==e&&(A=this._private__fontSize(),t._internal_fontSize=A,t._internal_font=e,t._internal_paddingTop=3*A/12,t._internal_paddingBottom=3*A/12,t._internal_paddingHorizontal=9*A/12,t._internal_baselineOffset=0,t._internal_labelBottomOffset=4*A/12,t._internal_widthCache._internal_reset()),this._private__rendererOptions}_private__setCursor(A){this._private__cell.style.cursor=1===A?"ew-resize":"default"}_private__recreateStubs(){const A=this._private__chart._internal_model(),t=A._internal_options();t.leftPriceScale.visible||null===this._private__leftStub||(this._private__leftStubCell.removeChild(this._private__leftStub._internal_getElement()),this._private__leftStub._internal_destroy(),this._private__leftStub=null),t.rightPriceScale.visible||null===this._private__rightStub||(this._private__rightStubCell.removeChild(this._private__rightStub._internal_getElement()),this._private__rightStub._internal_destroy(),this._private__rightStub=null);var e={_internal_rendererOptionsProvider:this._private__chart._internal_model()._internal_rendererOptionsProvider()},i=()=>t.leftPriceScale.borderVisible&&A._internal_timeScale()._internal_options().borderVisible,r=()=>A._internal_backgroundBottomColor();t.leftPriceScale.visible&&null===this._private__leftStub&&(this._private__leftStub=new Se("left",t,e,i,r),this._private__leftStubCell.appendChild(this._private__leftStub._internal_getElement())),t.rightPriceScale.visible&&null===this._private__rightStub&&(this._private__rightStub=new Se("right",t,e,i,r),this._private__rightStubCell.appendChild(this._private__rightStub._internal_getElement()))}}const Me=!!H&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(A=>A.brand.includes("Chromium"))&&!!H&&(null!=(A=null===navigator||void 0===navigator?void 0:navigator.userAgentData)&&A.platform?"Windows"===navigator.userAgentData.platform:0{let i=0;for(let A=0;A{B("left"===A?this._private__timeAxisWidget._internal_leftStub():this._private__timeAxisWidget._internal_rightStub())._internal_drawBitmap(B(a),t,e)});if(this._private__options.timeScale.visible){o=this._private__timeAxisWidget._internal_getBitmapSize();if(null!==a){let A=0;this._private__isLeftAxisVisible()&&(r("left",A,e),A=B(i._internal_leftPriceAxisWidget())._internal_getBitmapSize().width),this._private__timeAxisWidget._internal_drawBitmap(a,A,e),A+=o.width,this._private__isRightAxisVisible()&&r("right",A,e)}e+=o.height}return d.size({width:t,height:e})}_private__adjustSizeImpl(){let A=0,e=0,i=0;for(const u of this._private__paneWidgets)this._private__isLeftAxisVisible()&&(e=Math.max(e,B(u._internal_leftPriceAxisWidget())._internal_optimalWidth())),this._private__isRightAxisVisible()&&(i=Math.max(i,B(u._internal_rightPriceAxisWidget())._internal_optimalWidth())),A+=u._internal_stretchFactor();e=ue(e),i=ue(i);var t=this._private__width,r=this._private__height,n=Math.max(t-e-i,0),t=this._private__options.timeScale.visible,a=t?this._private__timeAxisWidget._internal_optimalHeight():0,s=0+(a=a+a%2),o=r{A._internal_updatePriceAxisWidgets()}),3===(null==(e=this._private__invalidateMask)?void 0:e._internal_fullInvalidation())&&(this._private__invalidateMask._internal_merge(A),this._private__updateGui(),this._private__applyMomentaryAutoScale(this._private__invalidateMask),this._private__applyTimeScaleInvalidations(this._private__invalidateMask,t),A=this._private__invalidateMask,this._private__invalidateMask=null)),this._internal_paint(A)}_private__applyTimeScaleInvalidations(A,t){for(const e of A._internal_timeScaleInvalidations())this._private__applyTimeScaleInvalidation(e,t)}_private__applyMomentaryAutoScale(t){var e=this._private__model._internal_panes();for(let A=0;A{if(this._private__drawPlanned=!1,this._private__drawRafId=0,null!==this._private__invalidateMask){var t=this._private__invalidateMask;this._private__invalidateMask=null,this._private__drawImpl(t,A);for(const e of t._internal_timeScaleInvalidations())if(5===e._internal_type&&!e._internal_value._internal_finished(A)){this._internal_model()._internal_setTimeScaleAnimation(e._internal_value);break}}}))}_private__updateGui(){this._private__syncGuiWithModel()}_private__syncGuiWithModel(){var t=this._private__model._internal_panes(),e=t.length,i=this._private__paneWidgets.length;for(let A=e;A{var t=A._internal_bars()._internal_search(e);null!==t&&i.set(A,t)});let r;null!==e&&void 0!==(n=null==(n=this._private__model._internal_timeScale()._internal_indexToTimeScalePoint(e))?void 0:n._internal_originalTime)&&(r=n);var n=this._internal_model()._internal_hoveredSource(),a=null!==n&&n._internal_source instanceof St?n._internal_source:void 0,n=null!==n&&void 0!==n._internal_object?n._internal_object._internal_externalId:void 0;return{_internal_time:r,_internal_index:null!=e?e:void 0,_internal_point:null!=A?A:void 0,_internal_hoveredSeries:a,_internal_seriesData:i,_internal_hoveredObject:n,_internal_touchMouseEventData:null!=t?t:void 0}}_private__onPaneWidgetClicked(A,t,e){this._private__clicked._internal_fire(()=>this._private__getMouseEventParamsImpl(A,t,e))}_private__onPaneWidgetCrosshairMoved(A,t,e){this._private__crosshairMoved._internal_fire(()=>this._private__getMouseEventParamsImpl(A,t,e))}_private__updateTimeAxisVisibility(){var A=this._private__options.timeScale.visible?"":"none";this._private__timeAxisWidget._internal_getElement().style.display=A}_private__isLeftAxisVisible(){return this._private__paneWidgets[0]._internal_state()._internal_leftPriceScale()._internal_options().visible}_private__isRightAxisVisible(){return this._private__paneWidgets[0]._internal_state()._internal_rightPriceScale()._internal_options().visible}_private__installObserver(){return"ResizeObserver"in window?(this._private__observer=new ResizeObserver(A=>{A=A.find(A=>A.target===this._private__container);A&&this._internal_resize(A.contentRect.width,A.contentRect.height)}),this._private__observer.observe(this._private__container,{box:"border-box"}),!0):(ce('Options contains "autoSize" flag, but the browser does not support ResizeObserver feature. Please provide polyfill.'),!1)}_private__uninstallObserver(){null!==this._private__observer&&this._private__observer.disconnect()}}function xe(A){return Boolean(A.handleScroll.mouseWheel||A.handleScale.mouseWheel)}function Te(A,t,e,i){var r=e.value,t={_internal_index:t,_internal_time:A,_internal_value:[r,r,r,r],_internal_originalTime:i};return void 0!==e.color&&(t._internal_color=e.color),t}function Le(A){return void 0!==A._internal_value}function x(n){return(A,t,e,i)=>{var r;return void 0===(r=e).open&&void 0===r.value?{_internal_time:A,_internal_index:t,_internal_originalTime:i}:n(A,t,e,i)}}const Ke={Candlestick:x(function(A,t,e,i){return t={_internal_index:t,_internal_time:A,_internal_value:[e.open,e.high,e.low,e.close],_internal_originalTime:i},void 0!==e.color&&(t._internal_color=e.color),void 0!==e.borderColor&&(t._internal_borderColor=e.borderColor),void 0!==e.wickColor&&(t._internal_wickColor=e.wickColor),t}),Bar:x(function(A,t,e,i){return t={_internal_index:t,_internal_time:A,_internal_value:[e.open,e.high,e.low,e.close],_internal_originalTime:i},void 0!==e.color&&(t._internal_color=e.color),t}),Area:x(function(A,t,e,i){var r=e.value,t={_internal_index:t,_internal_time:A,_internal_value:[r,r,r,r],_internal_originalTime:i};return void 0!==e.lineColor&&(t._internal_lineColor=e.lineColor),void 0!==e.topColor&&(t._internal_topColor=e.topColor),void 0!==e.bottomColor&&(t._internal_bottomColor=e.bottomColor),t}),Baseline:x(function(A,t,e,i){var r=e.value,t={_internal_index:t,_internal_time:A,_internal_value:[r,r,r,r],_internal_originalTime:i};return void 0!==e.topLineColor&&(t._internal_topLineColor=e.topLineColor),void 0!==e.bottomLineColor&&(t._internal_bottomLineColor=e.bottomLineColor),void 0!==e.topFillColor1&&(t._internal_topFillColor1=e.topFillColor1),void 0!==e.topFillColor2&&(t._internal_topFillColor2=e.topFillColor2),void 0!==e.bottomFillColor1&&(t._internal_bottomFillColor1=e.bottomFillColor1),void 0!==e.bottomFillColor2&&(t._internal_bottomFillColor2=e.bottomFillColor2),t}),Histogram:x(Te),Line:x(Te)};function ke(A){return Ke[A]}const Oe=[{_internal_divisor:1e3,_internal_weight:10},{_internal_divisor:6e4,_internal_weight:20},{_internal_divisor:3e5,_internal_weight:21},{_internal_divisor:18e5,_internal_weight:22},{_internal_divisor:36e5,_internal_weight:30},{_internal_divisor:108e5,_internal_weight:31},{_internal_divisor:216e5,_internal_weight:32},{_internal_divisor:432e5,_internal_weight:33}];function Ve(t,e){if(t.getUTCFullYear()!==e.getUTCFullYear())return 70;if(t.getUTCMonth()!==e.getUTCMonth())return 60;if(t.getUTCDate()!==e.getUTCDate())return 50;for(let A=Oe.length-1;0{void 0===t&&(t=A._internal_originalTime)}),p(t)}function je(A){void 0===A._internal_originalTime&&(A._internal_originalTime=A.time)}class qe{constructor(){this._private__pointDataByTimePoint=new Map,this._private__seriesRowsBySeries=new Map,this._private__seriesLastTimePoint=new Map,this._private__sortedTimePoints=[]}_internal_destroy(){this._private__pointDataByTimePoint.clear(),this._private__seriesRowsBySeries.clear(),this._private__seriesLastTimePoint.clear(),this._private__sortedTimePoints=[]}_internal_setSeriesData(i,A){let t=0!==this._private__pointDataByTimePoint.size,r=!1;var e=this._private__seriesRowsBySeries.get(i);if(void 0!==e)if(1===this._private__seriesRowsBySeries.size)t=!1,r=!0,this._private__pointDataByTimePoint.clear();else for(const o of this._private__sortedTimePoints)o.pointData._internal_mapping.delete(i)&&(r=!0);let n=[];if(0!==A.length){var a=A;a.forEach(A=>je(A)),A.forEach(Ye);const l=B(Ge(A)),_=ke(i._internal_seriesType());n=a.map(A=>{var t=l(A.time);let e=this._private__pointDataByTimePoint.get(t._internal_timestamp);void 0===e&&(e=Xe(t),this._private__pointDataByTimePoint.set(t._internal_timestamp,e),r=!0);t=_(t,e._internal_index,A,A._internal_originalTime);return e._internal_mapping.set(i,t),t})}t&&this._private__cleanupPointsData(),this._private__setRowsToSeries(i,n);let s=-1;if(r){const h=[];this._private__pointDataByTimePoint.forEach(A=>{h.push({_internal_timeWeight:0,_internal_time:A._internal_timePoint,pointData:A,_internal_originalTime:Ze(A._internal_mapping)})}),h.sort((A,t)=>A._internal_time._internal_timestamp-t._internal_time._internal_timestamp),s=this._private__replaceTimeScalePoints(h)}return this._private__getUpdateResponse(i,s,function(A,t){if(A=Je(A),t=Je(t),void 0!==A&&void 0!==t)return{_internal_lastBarUpdatedOrNewBarsAddedToTheRight:A._internal_lastTime>=t._internal_lastTime&&A._internal_firstTime>=t._internal_firstTime}}(this._private__seriesRowsBySeries.get(i),e))}_internal_removeSeries(A){return this._internal_setSeriesData(A,[])}_internal_updateSeriesData(A,t){var e=t,i=(je(e),Ye(t),B(Ge([t]))(t.time)),r=this._private__seriesLastTimePoint.get(A);if(void 0!==r&&i._internal_timestampA._internal_time._internal_timestampi._internal_time._internal_timestamp?Le(t)&&e.push(t):Le(t)?e[e.length-1]=t:e.splice(-1,1),this._private__seriesLastTimePoint.set(A,t._internal_time)}_private__setRowsToSeries(A,t){0!==t.length?(this._private__seriesRowsBySeries.set(A,t.filter(Le)),this._private__seriesLastTimePoint.set(A,t[t.length-1]._internal_time)):(this._private__seriesRowsBySeries.delete(A),this._private__seriesLastTimePoint.delete(A))}_private__cleanupPointsData(){for(const A of this._private__sortedTimePoints)0===A.pointData._internal_mapping.size&&this._private__pointDataByTimePoint.delete(A._internal_time._internal_timestamp)}_private__replaceTimeScalePoints(t){let e=-1;for(let A=0;A{0!==A.length&&(t=Math.max(t,A[A.length-1]._internal_index))}),t}_private__getUpdateResponse(e,A,i){const r={_internal_series:new Map,_internal_timeScale:{_internal_baseIndex:this._private__getBaseIndex()}};return-1!==A?(this._private__seriesRowsBySeries.forEach((A,t)=>{r._internal_series.set(t,{_internal_data:A,_internal_info:t===e?i:void 0})}),this._private__seriesRowsBySeries.has(e)||r._internal_series.set(e,{_internal_data:[],_internal_info:i}),r._internal_timeScale._internal_points=this._private__sortedTimePoints,r._internal_timeScale._internal_firstChangedPointIndex=A):(A=this._private__seriesRowsBySeries.get(e),r._internal_series.set(e,{_internal_data:A||[],_internal_info:i})),r}}function $e(A,t){A._internal_index=t,A._internal_mapping.forEach(A=>{A._internal_index=t})}function Ai(A){return{value:A._internal_value[3],time:A._internal_originalTime}}function ti(A){var t=Ai(A);return void 0!==A._internal_color&&(t.color=A._internal_color),t}function ei(A){return{open:A._internal_value[0],high:A._internal_value[1],low:A._internal_value[2],close:A._internal_value[3],time:A._internal_originalTime}}const ii={Area:function(A){var t=Ai(A);return void 0!==A._internal_lineColor&&(t.lineColor=A._internal_lineColor),void 0!==A._internal_topColor&&(t.topColor=A._internal_topColor),void 0!==A._internal_bottomColor&&(t.bottomColor=A._internal_bottomColor),t},Line:ti,Baseline:function(A){var t=Ai(A);return void 0!==A._internal_topLineColor&&(t.topLineColor=A._internal_topLineColor),void 0!==A._internal_bottomLineColor&&(t.bottomLineColor=A._internal_bottomLineColor),void 0!==A._internal_topFillColor1&&(t.topFillColor1=A._internal_topFillColor1),void 0!==A._internal_topFillColor2&&(t.topFillColor2=A._internal_topFillColor2),void 0!==A._internal_bottomFillColor1&&(t.bottomFillColor1=A._internal_bottomFillColor1),void 0!==A._internal_bottomFillColor2&&(t.bottomFillColor2=A._internal_bottomFillColor2),t},Histogram:ti,Bar:function(A){var t=ei(A);return void 0!==A._internal_color&&(t.color=A._internal_color),t},Candlestick:function(A){var t=ei(A),{_internal_color:A,_internal_borderColor:e,_internal_wickColor:i}=A;return void 0!==A&&(t.color=A),void 0!==e&&(t.borderColor=e),void 0!==i&&(t.wickColor=i),t}};function ri(A){return ii[A]}var A={background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:Z},ni={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2}},ai={color:"rgba(0, 0, 0, 0)",visible:!1,fontSize:48,fontFamily:Z,fontStyle:"",text:"",horzAlign:"center",vertAlign:"center"};const si={width:0,height:0,autoSize:!1,layout:A,crosshair:{vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},grid:{vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},overlayPriceScales:Object.assign({},ni),leftPriceScale:Object.assign(Object.assign({},ni),{visible:!1}),rightPriceScale:Object.assign(Object.assign({},ni),{visible:!0}),timeScale:{rightOffset:0,barSpacing:6,minBarSpacing:.5,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,ticksVisible:!1},watermark:ai,localization:{locale:H?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}},oi={upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},li={upColor:"#26a69a",downColor:"#ef5350",openVisible:!0,thinBars:!0},_i={color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},hi={topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},ci={baseValue:{type:"price",price:0},topFillColor1:"rgba(38, 166, 154, 0.28)",topFillColor2:"rgba(38, 166, 154, 0.05)",topLineColor:"rgba(38, 166, 154, 1)",bottomFillColor1:"rgba(239, 83, 80, 0.05)",bottomFillColor2:"rgba(239, 83, 80, 0.28)",bottomLineColor:"rgba(239, 83, 80, 1)",lineWidth:3,lineStyle:0,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},ui={color:"#26a69a",base:0},di={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};class pi{constructor(A,t){this._private__chartWidget=A,this._private__priceScaleId=t}applyOptions(A){this._private__chartWidget._internal_model()._internal_applyPriceScaleOptions(this._private__priceScaleId,A)}options(){return this._private__priceScale()._internal_options()}width(){return vA(this._private__priceScaleId)?this._private__chartWidget._internal_getPriceAxisWidth(this._private__priceScaleId):0}_private__priceScale(){return B(this._private__chartWidget._internal_model()._internal_findPriceScale(this._private__priceScaleId))._internal_priceScale}}function Bi(e,i=!1){if(0!==e.length){let t=T(e[0].time)._internal_timestamp;for(let A=1;Ae._internal_index?{barsBefore:A.from-r,barsAfter:i-A.to}:(r={barsBefore:null===t||t._internal_index===r?A.from-r:t._internal_index-r,barsAfter:null===e||e._internal_index===i?i-A.to:i-e._internal_index},null!==t&&null!==e&&(r.from=t._internal_time._internal_businessDay||t._internal_time._internal_timestamp,r.to=e._internal_time._internal_businessDay||e._internal_time._internal_timestamp),r))}setData(A){Bi(A),gi(this._internal__series._internal_seriesType(),A),this._internal__dataUpdatesConsumer._internal_applyNewData(this._internal__series,A)}update(A){gi(this._internal__series._internal_seriesType(),[A]),this._internal__dataUpdatesConsumer._internal_updateData(this._internal__series,A)}dataByIndex(A,t){A=this._internal__series._internal_bars()._internal_search(A,t);return null===A?null:ri(this.seriesType())(A)}setMarkers(A){Bi(A,!0);A=A.map(A=>Object.assign(Object.assign({},A),{originalTime:A.time,time:T(A.time)}));this._internal__series._internal_setMarkers(A)}markers(){return this._internal__series._internal_markers().map(A=>{var t=A["originalTime"],A=function(A,t){var e={};for(r in A)Object.prototype.hasOwnProperty.call(A,r)&&t.indexOf(r){this._private__clickedDelegate._internal_hasListeners()&&this._private__clickedDelegate._internal_fire(this._private__convertMouseParams(A()))},this),this._private__chartWidget._internal_crosshairMoved()._internal_subscribe(A=>{this._private__crosshairMovedDelegate._internal_hasListeners()&&this._private__crosshairMovedDelegate._internal_fire(this._private__convertMouseParams(A()))},this),A=this._private__chartWidget._internal_model();this._private__timeScaleApi=new mi(A,this._private__chartWidget._internal_timeAxisWidget())}remove(){this._private__chartWidget._internal_clicked()._internal_unsubscribeAll(this),this._private__chartWidget._internal_crosshairMoved()._internal_unsubscribeAll(this),this._private__timeScaleApi._internal_destroy(),this._private__chartWidget._internal_destroy(),this._private__seriesMap.clear(),this._private__seriesMapReversed.clear(),this._private__clickedDelegate._internal_destroy(),this._private__crosshairMovedDelegate._internal_destroy(),this._private__dataLayer._internal_destroy()}resize(A,t,e){this.autoSizeActive()?ce("Height and width values ignored because 'autoSize' option is enabled."):this._private__chartWidget._internal_resize(A,t,e)}addAreaSeries(A){return this._private__addSeriesImpl("Area",hi,A)}addBaselineSeries(A){return this._private__addSeriesImpl("Baseline",ci,A)}addBarSeries(A){return this._private__addSeriesImpl("Bar",li,A)}addCandlestickSeries(A={}){var t;return void 0!==(t=A).borderColor&&(t.borderUpColor=t.borderColor,t.borderDownColor=t.borderColor),void 0!==t.wickColor&&(t.wickUpColor=t.wickColor,t.wickDownColor=t.wickColor),this._private__addSeriesImpl("Candlestick",oi,A)}addHistogramSeries(A){return this._private__addSeriesImpl("Histogram",ui,A)}addLineSeries(A){return this._private__addSeriesImpl("Line",_i,A)}removeSeries(A){var t=p(this._private__seriesMap.get(A)),e=this._private__dataLayer._internal_removeSeries(t);this._private__chartWidget._internal_model()._internal_removeSeries(t),this._private__sendUpdateToChart(e),this._private__seriesMap.delete(A),this._private__seriesMapReversed.delete(t)}_internal_applyNewData(A,t){this._private__sendUpdateToChart(this._private__dataLayer._internal_setSeriesData(A,t))}_internal_updateData(A,t){this._private__sendUpdateToChart(this._private__dataLayer._internal_updateSeriesData(A,t))}subscribeClick(A){this._private__clickedDelegate._internal_subscribe(A)}unsubscribeClick(A){this._private__clickedDelegate._internal_unsubscribe(A)}subscribeCrosshairMove(A){this._private__crosshairMovedDelegate._internal_subscribe(A)}unsubscribeCrosshairMove(A){this._private__crosshairMovedDelegate._internal_unsubscribe(A)}priceScale(A){return new pi(this._private__chartWidget,A)}timeScale(){return this._private__timeScaleApi}applyOptions(A){this._private__chartWidget._internal_applyOptions(Qi(A))}options(){return this._private__chartWidget._internal_options()}takeScreenshot(){return this._private__chartWidget._internal_takeScreenshot()}autoSizeActive(){return this._private__chartWidget._internal_autoSizeActive()}_private__addSeriesImpl(A,t,e={}){Ci(e.priceFormat);t=r(o(di),o(t),e),e=this._private__chartWidget._internal_model()._internal_createSeries(A,t),A=new wi(e,this,this);return this._private__seriesMap.set(A,e),this._private__seriesMapReversed.set(e,A),A}_private__sendUpdateToChart(A){var t=this._private__chartWidget._internal_model();t._internal_updateTimeScale(A._internal_timeScale._internal_baseIndex,A._internal_timeScale._internal_points,A._internal_timeScale._internal_firstChangedPointIndex),A._internal_series.forEach((A,t)=>t._internal_setData(A._internal_data,A._internal_info)),t._internal_recalculateAllPanes()}_private__mapSeriesToApi(A){return p(this._private__seriesMapReversed.get(A))}_private__convertMouseParams(A){const e=new Map;A._internal_seriesData.forEach((A,t)=>{A=ri(t._internal_seriesType())(A);a(le(A)),e.set(this._private__mapSeriesToApi(t),A)});var t=void 0===A._internal_hoveredSeries?void 0:this._private__mapSeriesToApi(A._internal_hoveredSeries);return{time:A._internal_time,logical:A._internal_index,point:A._internal_point,hoveredSeries:t,hoveredObjectId:A._internal_hoveredObject,seriesData:e,sourceEvent:A._internal_touchMouseEventData}}}t.createChart=function(A,t){let e;var i;return e=z(A)?(a(null!==(i=document.getElementById(A)),"Cannot find element in DOM with id="+A),i):A,new Fi(e,t)},t.isBusinessDay=se,t.isUTCTimestamp=oe,t.version=function(){return"4.0.1"}},{"fancy-canvas":4}],8:[function(A,L,t){"use strict";var u=A("fancy-canvas");function l(A,t){t={0:[],1:[A.lineWidth,A.lineWidth],2:[2*A.lineWidth,2*A.lineWidth],3:[6*A.lineWidth,6*A.lineWidth],4:[A.lineWidth,4*A.lineWidth]}[t];A.setLineDash(t)}function K(A,t,e,i){A.beginPath();var r=A.lineWidth%2?.5:0;A.moveTo(e,t+r),A.lineTo(i,t+r),A.stroke()}function r(A,t){if(!A)throw new Error("Assertion failed"+(t?": "+t:""))}function c(A){if(void 0===A)throw new Error("Value is undefined");return A}function B(A){if(null===A)throw new Error("Value is null");return A}function _(A){return B(c(A))}t.LineType=void 0,(A=t.LineType||(t.LineType={}))[A.Simple=0]="Simple",A[A.WithSteps=1]="WithSteps",A[A.Curved=2]="Curved",t.LineStyle=void 0,(A=t.LineStyle||(t.LineStyle={}))[A.Solid=0]="Solid",A[A.Dotted=1]="Dotted",A[A.Dashed=2]="Dashed",A[A.LargeDashed=3]="LargeDashed",A[A.SparseDotted=4]="SparseDotted";const k={khaki:"#f0e68c",azure:"#f0ffff",aliceblue:"#f0f8ff",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",gray:"#808080",green:"#008000",honeydew:"#f0fff0",floralwhite:"#fffaf0",lightblue:"#add8e6",lightcoral:"#f08080",lemonchiffon:"#fffacd",hotpink:"#ff69b4",lightyellow:"#ffffe0",greenyellow:"#adff2f",lightgoldenrodyellow:"#fafad2",limegreen:"#32cd32",linen:"#faf0e6",lightcyan:"#e0ffff",magenta:"#f0f",maroon:"#800000",olive:"#808000",orange:"#ffa500",oldlace:"#fdf5e6",mediumblue:"#0000cd",transparent:"#0000",lime:"#0f0",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",midnightblue:"#191970",orchid:"#da70d6",mediumorchid:"#ba55d3",mediumturquoise:"#48d1cc",orangered:"#ff4500",royalblue:"#4169e1",powderblue:"#b0e0e6",red:"#f00",coral:"#ff7f50",turquoise:"#40e0d0",white:"#fff",whitesmoke:"#f5f5f5",wheat:"#f5deb3",teal:"#008080",steelblue:"#4682b4",bisque:"#ffe4c4",aquamarine:"#7fffd4",aqua:"#0ff",sienna:"#a0522d",silver:"#c0c0c0",springgreen:"#00ff7f",antiquewhite:"#faebd7",burlywood:"#deb887",brown:"#a52a2a",beige:"#f5f5dc",chocolate:"#d2691e",chartreuse:"#7fff00",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cadetblue:"#5f9ea0",tomato:"#ff6347",fuchsia:"#f0f",blue:"#00f",salmon:"#fa8072",blanchedalmond:"#ffebcd",slateblue:"#6a5acd",slategray:"#708090",thistle:"#d8bfd8",tan:"#d2b48c",cyan:"#0ff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",blueviolet:"#8a2be2",black:"#000",darkmagenta:"#8b008b",darkslateblue:"#483d8b",darkkhaki:"#bdb76b",darkorchid:"#9932cc",darkorange:"#ff8c00",darkgreen:"#006400",darkred:"#8b0000",dodgerblue:"#1e90ff",darkslategray:"#2f4f4f",dimgray:"#696969",deepskyblue:"#00bfff",firebrick:"#b22222",forestgreen:"#228b22",indigo:"#4b0082",ivory:"#fffff0",lavenderblush:"#fff0f5",feldspar:"#d19275",indianred:"#cd5c5c",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightskyblue:"#87cefa",lightslategray:"#789",lightslateblue:"#8470ff",snow:"#fffafa",lightseagreen:"#20b2aa",lightsalmon:"#ffa07a",darksalmon:"#e9967a",darkviolet:"#9400d3",mediumpurple:"#9370d8",mediumaquamarine:"#66cdaa",skyblue:"#87ceeb",lavender:"#e6e6fa",lightsteelblue:"#b0c4de",mediumvioletred:"#c71585",mintcream:"#f5fffa",navajowhite:"#ffdead",navy:"#000080",olivedrab:"#6b8e23",palevioletred:"#d87093",violetred:"#d02090",yellow:"#ff0",yellowgreen:"#9acd32",lawngreen:"#7cfc00",pink:"#ffc0cb",paleturquoise:"#afeeee",palegoldenrod:"#eee8aa",darkolivegreen:"#556b2f",darkseagreen:"#8fbc8f",darkturquoise:"#00ced1",peachpuff:"#ffdab9",deeppink:"#ff1493",violet:"#ee82ee",palegreen:"#98fb98",mediumseagreen:"#3cb371",peru:"#cd853f",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",purple:"#800080",seagreen:"#2e8b57",seashell:"#fff5ee",papayawhip:"#ffefd5",mediumslateblue:"#7b68ee",plum:"#dda0dd",mediumspringgreen:"#00fa9a"};function h(A){return At===A.o);-1A._!==t)}m(t,e,i){var A=[...this.h];this.h=this.h.filter(A=>!A.u),A.forEach(A=>A.o(t,e,i))}g(){return 0{A.X(t,e,i)})}}class e{X(A,t,e){A.useMediaCoordinateSpace(A=>this.Z(A,t,e))}K(A,t,e){A.useMediaCoordinateSpace(A=>this.G(A,t,e))}G(A,t,e){}}class q extends e{constructor(){super(...arguments),this.J=null}tt(A){this.J=A}Z({context:e}){if(null!==this.J&&null!==this.J.it){const i=this.J.it,r=this.J,A=t=>{e.beginPath();for(let A=i.to-1;A>=i.from;--A){const i=r.st[A];e.moveTo(i.nt,i.et),e.arc(i.nt,i.et,t,0,2*Math.PI)}e.fill()};0{var t=new q;return t.tt(A),t}),this.ct.Y(this.dt)),this.vt=!0}Mt(){return this.vt&&(this.xt(),this.vt=!1),this.ct}xt(){const A=this.N.wt(),r=this.bt.St(),n=this.N.yt();A.forEach((A,t)=>{var e,t=this.ft[t],i=A.kt(r);null!==i&&A.Ct()?(e=B(A.Tt()),t.ot=i.Pt,t.lt=i.lt,t.rt=i.Rt,t.st[0].ut=i.ut,t.st[0].et=A.Bt().Dt(i.ut,e.At),t.ht=null!=(e=i.Ot)?e:this.N.Lt(t.st[0].et/A.Bt().It()),t.st[0]._t=r,t.st[0].nt=n.Et(r),t.it=AA):t.it=null})}}class g{X(A,t,e){A.useBitmapCoordinateSpace(A=>this.Z(A,t,e))}}class eA extends g{constructor(A){super(),this.Vt=A}Z({context:A,bitmapSize:t,horizontalPixelRatio:e,verticalPixelRatio:i}){var r,n,a,s,o;null!==this.Vt&&(a=this.Vt.zt.Ct,r=this.Vt.Nt.Ct,a||r)&&(s=Math.round(this.Vt.nt*e),n=Math.round(this.Vt.et*i),A.lineCap="butt",a&&00===A?A:A+t):A+t}function aA(A,t,e,i,r,n){let a,s,o,l;if(Array.isArray(n))if(2===n.length){const A=Math.max(0,n[0]),t=Math.max(0,n[1]);a=A,s=A,o=t,l=t}else{if(4!==n.length)throw new Error("Wrong border radius - it should be like css border radius");a=Math.max(0,n[0]),s=Math.max(0,n[1]),o=Math.max(0,n[2]),l=Math.max(0,n[3])}else{const A=Math.max(0,n);a=A,s=A,o=A,l=A}A.beginPath(),A.moveTo(t+a,e),A.lineTo(t+i-s,e),0!==s&&A.arcTo(t+i,e,t+i,e+s,s),A.lineTo(t+i,e+r-o),0!==o&&A.arcTo(t+i,e+r,t+i-o,e+r,o),A.lineTo(t+l,e+r),0!==l&&A.arcTo(t,e+r,t,e+r-l,l),A.lineTo(t,e+a),0!==a&&A.arcTo(t,e,t+a,e,a)}function sA(A,t,e,i,r,n,a=0,s=0,o=""){if(A.save(),!a||!o||o===n)return aA(A,t,e,i,r,s),A.fillStyle=n,A.fill(),A.restore();var l=a/2;"transparent"!==n&&(aA(A,t+a,e+a,i-2*a,r-2*a,nA(s,-a)),A.fillStyle=n,A.fill()),"transparent"!==o&&(aA(A,t+l,e+l,i-a,r-a,nA(s,-l)),A.lineWidth=a,A.strokeStyle=o,A.closePath(),A.stroke()),A.restore()}function oA(A,t,e,i,r,n,a){A.save(),A.globalCompositeOperation="copy";var s=A.createLinearGradient(0,0,0,r);s.addColorStop(0,n),s.addColorStop(1,a),A.fillStyle=s,A.fillRect(t,e,i,r),A.restore()}class lA{constructor(A,t){this.tt(A,t)}tt(A,t){this.Vt=A,this.Kt=t}It(A,t){return this.Vt.Ct?A.T+A.I+A.A:0}X(A,n,a,s){if(this.Vt.Ct&&0!==this.Vt.Gt.length){const o=this.Vt.D,l=this.Kt.t,e=A.useBitmapCoordinateSpace(A=>{const e=A.context,i=(e.font=n.P,this.Jt(A,n,a,s)),r=i.Qt,t=(A,t)=>{i.ti?sA(e,r.ii,r.si,r.ni,r.ei,A,r.ri,[r.lt,0,0,r.lt],t):sA(e,r.hi,r.si,r.ni,r.ei,A,r.ri,[0,r.lt,r.lt,0],t)};return t(l,"transparent"),this.Vt.li&&(e.fillStyle=o,e.fillRect(r.hi,r.ai,r.oi-r.hi,r._i)),t("transparent",l),this.Vt.ui&&(e.fillStyle=n.B,e.fillRect(i.ti?r.ci-r.ri:0,r.si,r.ri,r.di-r.si)),i});A.useMediaCoordinateSpace(({context:A})=>{var t=e.fi;A.font=n.P,A.textAlign=e.ti?"right":"left",A.textBaseline="middle",A.fillStyle=o,A.fillText(this.Vt.Gt,t.pi,(t.si+t.di)/2+t.vi)})}}Jt(A,t,e,i){var{context:A,bitmapSize:r,mediaSize:n,horizontalPixelRatio:a,verticalPixelRatio:s}=A,o=this.Vt.li||!this.Vt.mi?t.C:0,l=this.Vt.bi?t.k:0,_=t.I+this.Kt.gi,h=t.A+this.Kt.wi,c=t.O,u=t.L,d=this.Vt.Gt,p=t.T,B=e.Mi(A,d),e=Math.ceil(e.xi(A,d)),A=p+_+h,d=t.k+c+u+e+o,p=Math.max(1,Math.floor(s));let g=Math.round(A*s);g%2!=p%2&&(g+=1);_=0(A.font=_.P,Math.round(_.Wi.xi(A,B(this.Vt).Gt,cA))));if(!(ea&&(A-=Math.abs(a-(l+i)),l=Math.floor(A-n)+.5);const h=l+i,c=Math.ceil(0+_.k+_.C+_.I+_.T+_.A);t.useBitmapCoordinateSpace(({context:A,horizontalPixelRatio:t,verticalPixelRatio:e})=>{var i=B(this.Vt);A.fillStyle=i.t;const r=Math.round(l*t),n=Math.round(0*e),a=Math.round(h*t),s=Math.round(c*e),o=Math.round(2*t);if(A.beginPath(),A.moveTo(r,n),A.lineTo(r,s-o),A.arcTo(r,s,r+o,s,o),A.lineTo(a-o,s),A.arcTo(a,s,a,s-o,o),A.lineTo(a,n),A.fill(),i.li){const r=Math.round(i.yi*t),B=n,a=Math.round((B+_.C)*e),l=(A.fillStyle=i.D,Math.max(1,Math.floor(t))),h=Math.floor(.5*t);A.fillRect(r-h,B,l,a-B)}}),t.useMediaCoordinateSpace(({context:A})=>{var t=B(this.Vt),e=0+_.k+_.C+_.I+_.T/2,i=(A.font=_.P,A.textAlign="left",A.textBaseline="middle",A.fillStyle=t.D,_.Wi.Mi(A,"Apr0"));A.translate(l+r,e+i),A.fillText(t.Gt,0,0)})}}}}class dA{constructor(A,t,e){this.vt=!0,this.jt=new uA,this.Wt={Ct:!1,t:"#4c525e",D:"white",Gt:"",$i:0,yi:NaN,li:!0},this.bt=A,this.Hi=t,this.zi=e}gt(){this.vt=!0}Mt(){return this.vt&&(this.xt(),this.vt=!1),this.jt.tt(this.Wt),this.jt}xt(){var A,t,e=this.Wt,i=(e.Ct=!1,this.bt.F().vertLine);!i.labelVisible||(A=this.Hi.yt()).Ni()||(e.$i=A.$i(),null!==(t=this.zi())&&(e.yi=t.yi,t=A.Ui(this.bt.St()),e.Gt=A.qi(B(t)),e.Ct=!0,t=G(i.labelBackgroundColor),e.t=t.t,e.D=t.i,e.li=A.F().ticksVisible))}}class pA{constructor(){this.Yi=null,this.Xi=0}Zi(){return this.Xi}Ki(A){this.Xi=A}Bt(){return this.Yi}Gi(A){this.Yi=A}Ji(A){return[]}Qi(){return[]}Ct(){return!0}}t.CrosshairMode=void 0,(A=t.CrosshairMode||(t.CrosshairMode={}))[A.Normal=0]="Normal",A[A.Magnet=1]="Magnet";class BA extends pA{constructor(A,t){super(),this.ts=null,this.ss=NaN,this.ns=0,this.es=!0,this.rs=new Map,this.hs=!1,this.ls=NaN,this.os=NaN,this._s=NaN,this.us=NaN,this.Hi=A,this.cs=t,this.ds=new tA(A,this),this.fs=(i=()=>this.ss,r=()=>this.os,A=>{var t=r(),e=i();if(A===B(this.ts).ps())return{ut:e,yi:t};{const i=B(A.Tt());return{ut:A.vs(t,i),yi:t}}}),e=()=>this.ns,n=()=>this.Xt();var i,r,e,n,t=()=>{var A=this.Hi.yt().bs(e()),t=n();return A&&Number.isFinite(t)?{_t:A,yi:t}:null};this.gs=new dA(this,A,t),this.ws=new iA(this)}F(){return this.cs}Ms(A,t){this._s=A,this.us=t}xs(){this._s=NaN,this.us=NaN}Ss(){return this._s}ys(){return this.us}ks(A,t,e){this.hs||(this.hs=!0),this.es=!0,this.Cs(A,t,e)}St(){return this.ns}Xt(){return this.ls}Zt(){return this.os}Ct(){return this.es}Ts(){this.es=!1,this.Ps(),this.ss=NaN,this.ls=NaN,this.os=NaN,this.ts=null,this.xs()}Rs(A){return null!==this.ts?[this.ws,this.ds]:[]}qt(A){return A===this.ts&&this.cs.horzLine.visible}Yt(){return this.cs.vertLine.visible}Ds(A,t){this.es&&this.ts===A||this.rs.clear();var e=[];return this.ts===A&&e.push(this.Bs(this.rs,t,this.fs)),e}Qi(){return this.es?[this.gs]:[]}Ht(){return this.ts}As(){this.ws.gt(),this.rs.forEach(A=>A.gt()),this.gs.gt(),this.ds.gt()}Os(A){return A&&!A.ps().Ni()?A.ps():null}Cs(A,t,e){this.Ls(A,t,e)&&this.As()}Ls(A,t,e){var i=this.ls,r=this.os,n=this.ss,a=this.ns,s=this.ts,o=this.Os(e),A=(this.ns=A,this.ls=isNaN(A)?NaN:this.Hi.yt().Et(A),this.ts=e,null!==o?o.Tt():null);return null!==o&&null!==A?(this.ss=t,this.os=o.Dt(t,A)):(this.ss=NaN,this.os=NaN),i!==this.ls||r!==this.os||a!==this.ns||n!==this.ss||s!==this.ts}Ps(){var A=this.Hi.wt().map(A=>A.Es().Is()).filter(Y),A=0===A.length?null:Math.max(...A);this.ns=null!==A?A:NaN}Bs(A,t,e){let i=A.get(t);return void 0===i&&(i=new hA(this,t,e),A.set(t,i)),i}}function gA(A){return"left"===A||"right"===A}class v{constructor(A){this.Vs=new Map,this.zs=[],this.Ns=A}Fs(A,t){e=this.Vs.get(A),t=t;var e=void 0===e?t:{Ws:Math.max(e.Ws,t.Ws),js:e.js||t.js};this.Vs.set(A,e)}$s(){return this.Ns}Hs(A){A=this.Vs.get(A);return void 0===A?{Ws:this.Ns}:{Ws:Math.max(this.Ns,A.Ws),js:A.js}}Us(){this.qs(),this.zs=[{Ys:0}]}Xs(A){this.qs(),this.zs=[{Ys:1,At:A}]}Zs(A){this.Ks(),this.zs.push({Ys:5,At:A})}qs(){this.Ks(),this.zs.push({Ys:6})}Gs(){this.qs(),this.zs=[{Ys:4}]}Js(A){this.qs(),this.zs.push({Ys:2,At:A})}Qs(A){this.qs(),this.zs.push({Ys:3,At:A})}tn(){return this.zs}sn(A){for(const t of A.zs)this.nn(t);this.Ns=Math.max(this.Ns,A.Ns),A.Vs.forEach((A,t)=>{this.Fs(t,A)})}static en(){return new v(2)}static rn(){return new v(3)}nn(A){switch(A.Ys){case 0:this.Us();break;case 1:this.Xs(A.At);break;case 2:this.Js(A.At);break;case 3:this.Qs(A.At);break;case 4:this.Gs();break;case 5:this.Zs(A.At);break;case 6:this.Ks()}}Ks(){var A=this.zs.findIndex(A=>5===A.Ys);-1!==A&&this.zs.splice(A,1)}}function f(A,t){if(!p(A))return"n/a";if(!s(t))throw new TypeError("invalid length");if(t=e&&(A-=e,i+=1),r="."+f(+A.toFixed(this.on)*this.hn,n)}else i=Math.round(i*e)/e,0t)}}function mA(r,n,a,s,A,o,l){if(!(0===n.length||s.from>=n.length||s.to{l(g,e,i,t),g.beginPath(),e=A,i=t};let t=i;g.beginPath(),g.moveTo(v.nt,v.et);for(let A=s.from+1;A>1,a=i+r;e(A[a],t)?(i=a+1,n-=1+r):n=r}return i}function HA(A,t,e,i=0,r=A.length){let n=r-i;for(;0>1,a=i+r;e(t,A[a])?n=r:(i=a+1,n-=1+r)}return i}function IA(A,t){return A._t=i&&(a=r-1),0Object.assign(Object.assign({},A),this.Tn.Ln().On(A._t)))}In(){this.Cn=null}Dn(){this.Sn&&(this.En(),this.Sn=!1),this.yn&&(this.An(),this.yn=!1),this.xn&&(this.Vn(),this.xn=!1)}Vn(){var A,t,e=this.Tn.Bt(),i=this.Pn.yt();this.In(),i.Ni()||e.Ni()||null!==(A=i.zn())&&0!==this.Tn.Es().Nn()&&null!==(t=this.Tn.Tt())&&(this.Cn=DA(this.kn,A,this.Rn),this.Fn(e,i,t.At),this.Wn())}}class TA extends xA{constructor(A,t){super(A,t,!0)}Fn(A,t,e){t.jn(this.kn,X(this.Cn)),A.$n(this.kn,e,X(this.Cn))}Hn(A,t){return{_t:A,ut:t,nt:NaN,et:NaN}}En(){const e=this.Tn.Ln();this.kn=this.Tn.Es().Un().map(A=>{var t=A.At[3];return this.qn(A.Yn,t,e)})}}class LA extends TA{constructor(A,t){super(A,t),this.Bn=new j,this.Xn=new yA,this.Zn=new SA,this.Bn.Y([this.Xn,this.Zn])}qn(A,t,e){return Object.assign(Object.assign({},this.Hn(A,t)),e.On(A))}Wn(){var A=this.Tn.F();this.Xn.tt({dn:A.lineType,st:this.kn,Ft:A.lineStyle,rt:A.lineWidth,fn:null,pn:A.invertFilledArea,it:this.Cn,cn:this.Pn.yt().Kn()}),this.Zn.tt({dn:A.lineType,st:this.kn,Ft:A.lineStyle,rt:A.lineWidth,it:this.Cn,cn:this.Pn.yt().Kn()})}}class KA extends g{constructor(){super(...arguments),this.Vt=null,this.Gn=0,this.Jn=0}tt(A){this.Vt=A}Z({context:e,horizontalPixelRatio:i,verticalPixelRatio:r}){if(null!==this.Vt&&0!==this.Vt.Es.length&&null!==this.Vt.it){this.Gn=this.Qn(i),2=Math.floor(1.5*i);for(let A=this.Vt.it.from;Ac+u-1&&(t=c+u-1,A=t-_+1),e.fillRect(i,A,l-i,t-A+1)}const i=o+d;let A=Math.max(c,Math.round(a.he*r)-s),t=A+_-1;t>c+u-1&&(t=c+u-1,A=t-_+1),e.fillRect(1+h,A,i-h,t-A+1)}}}}Qn(A){var t=Math.floor(A);return Math.max(t,Math.floor((t=B(this.Vt).Kn,Math.floor(.3*t*A))))}}class kA extends xA{constructor(A,t){super(A,t,!1)}Fn(A,t,e){t.jn(this.kn,X(this.Cn)),A.le(this.kn,e,X(this.Cn))}ae(A,t,e){return{_t:A,oe:t.At[0],_e:t.At[1],ue:t.At[2],ce:t.At[3],nt:NaN,re:NaN,se:NaN,ne:NaN,he:NaN}}En(){const t=this.Tn.Ln();this.kn=this.Tn.Es().Un().map(A=>this.qn(A.Yn,A,t))}}class OA extends kA{constructor(){super(...arguments),this.Bn=new KA}qn(A,t,e){return Object.assign(Object.assign({},this.ae(A,t,e)),e.On(A))}Wn(){var A=this.Tn.F();this.Bn.tt({Es:this.kn,Kn:this.Pn.yt().Kn(),ee:A.openVisible,te:A.thinBars,it:this.Cn})}}function VA(A,t,e){return Math.min(Math.max(A,t),e)}function PA(A,t,e){return t-A2*r)&&this.Ce(A,i,this.Vt.it)}Se(A,n,a){if(null!==this.Vt){var{context:s,horizontalPixelRatio:o,verticalPixelRatio:l}=A;let e="",i=Math.min(Math.floor(o),Math.floor(this.Vt.Kn*o));i=Math.max(Math.floor(o),Math.min(i,this.Gn));var _=Math.floor(.5*i);let r=null;for(let t=a.from;t2*B)_=s,h=A,c=v,u=g-A+1,d=f-v+1,p=B,_.fillRect(h+p,c,u-2*p,p),_.fillRect(h+p,c+d-p,u-2*p,p),_.fillRect(h,c,p,d),_.fillRect(h+u-p,c,p,d);else{const r=g-A+1;s.fillRect(A,v,r,f-v+1)}i=g}}}Ce(a,s,o){if(null!==this.Vt){var{context:l,horizontalPixelRatio:_,verticalPixelRatio:h}=a;let n="";var c=this.ke(_);for(let r=o.from;rt||l.fillRect(e,A,i-e+1,t-A+1)}}}}class XA extends kA{constructor(){super(...arguments),this.Bn=new YA}qn(A,t,e){return Object.assign(Object.assign({},this.ae(A,t,e)),e.On(A))}Wn(){var A=this.Tn.F();this.Bn.tt({Es:this.kn,Kn:this.Pn.yt().Kn(),xe:A.wickVisible,ui:A.borderVisible,it:this.Cn})}}class JA extends g{constructor(){super(...arguments),this.Vt=null,this.Re=[]}tt(A){this.Vt=A,this.Re=[]}Z({context:i,horizontalPixelRatio:A,verticalPixelRatio:r}){if(null!==this.Vt&&0!==this.Vt.st.length&&null!==this.Vt.it){this.Re.length||this.De(A);var n=Math.max(1,Math.floor(r)),a=Math.round(this.Vt.Be*r)-Math.floor(n/2),s=a+n;for(let e=this.Vt.it.from;eA.Oe?A.ci=n.Mn-e-1:n.Mn=A.ci+e+1)}let t=Math.ceil(this.Vt.Kn*r);for(let A=this.Vt.it.from;At&&(e.Ae>e.Oe?--e.ci:e.Mn+=1)}}}}class ZA extends TA{constructor(){super(...arguments),this.Bn=new JA}qn(A,t,e){return Object.assign(Object.assign({},this.Hn(A,t)),e.On(A))}Wn(){var A={st:this.kn,Kn:this.Pn.yt().Kn(),it:this.Cn,Be:this.Tn.Bt().Dt(this.Tn.F().base,B(this.Tn.Tt()).At)};this.Bn.tt(A)}}class jA extends TA{constructor(){super(...arguments),this.Bn=new SA}qn(A,t,e){return Object.assign(Object.assign({},this.Hn(A,t)),e.On(A))}Wn(){var A=this.Tn.F(),A={st:this.kn,Ft:A.lineStyle,dn:A.lineType,rt:A.lineWidth,it:this.Cn,cn:this.Pn.yt().Kn()};this.Bn.tt(A)}}const qA=/[2-9]/g;class m{constructor(A=50){this.Le=0,this.Ie=1,this.Ee=1,this.Ve={},this.ze=new Map,this.Ne=A}Fe(){this.Le=0,this.ze.clear(),this.Ie=1,this.Ee=1,this.Ve={}}xi(A,t,e){return this.We(A,t,e).width}Mi(A,t,e){A=this.We(A,t,e);return((A.actualBoundingBoxAscent||0)-(A.actualBoundingBoxDescent||0))/2}We(A,t,e){e=e||qA,e=String(t).replace(e,"0");if(this.ze.has(e))return c(this.ze.get(e)).je;if(this.Le===this.Ne){const A=this.Ve[this.Ee];delete this.Ve[this.Ee],this.ze.delete(A),this.Ee++,this.Le--}A.save(),A.textBaseline="middle";var i=A.measureText(e);return A.restore(),0===i.width&&t.length||(this.ze.set(e,{je:i,$e:this.Ie}),this.Ve[this.Ie]=e,this.Le++,this.Ie++),i}}class $A{constructor(A){this.He=null,this.S=null,this.Ue="right",this.qe=A}Ye(A,t,e){this.He=A,this.S=t,this.Ue=e}X(A){null!==this.S&&null!==this.He&&this.He.X(A,this.S,this.qe,this.Ue)}}class At{constructor(A,t,e){this.Xe=A,this.qe=new m(50),this.Ze=t,this.N=e,this.W=-1,this.jt=new $A(this.qe)}Mt(){var A,t=this.N.Ke(this.Ze);return null===t||null===(A=t.Ge(this.Ze)?t.Je():this.Ze.Bt())||"overlay"===(t=t.Qe(A))?null:((A=this.N.tr()).T!==this.W&&(this.W=A.T,this.qe.Fe()),this.jt.Ye(this.Xe.Ii(),A,t),this.jt)}}class tt extends g{constructor(){super(...arguments),this.Vt=null}tt(A){this.Vt=A}ir(A,t){var e,i,r;return null!=(e=this.Vt)&&e.Ct&&({et:e,rt:i,sr:r}=this.Vt,e-i-7t.height||(A.lineCap="butt",A.strokeStyle=this.Vt.D,A.lineWidth=Math.floor(this.Vt.rt*e),l(A,this.Vt.Ft),K(A,i,0,t.width))}}class et{constructor(A){this.er={et:0,D:"rgba(0, 0, 0, 0)",rt:1,Ft:0,Ct:!1},this.rr=new tt,this.vt=!0,this.Tn=A,this.Pn=A.Ut(),this.rr.tt(this.er)}gt(){this.vt=!0}Mt(){return this.Tn.Ct()?(this.vt&&(this.hr(),this.vt=!1),this.rr):null}}class it extends et{constructor(A){super(A)}hr(){this.er.Ct=!1;var A,t=this.Tn.Bt(),e=t.lr().lr;2!==e&&3!==e||(e=this.Tn.F()).baseLineVisible&&this.Tn.Ct()&&null!==(A=this.Tn.Tt())&&(this.er.Ct=!0,this.er.et=t.Dt(A.At,A.At),this.er.D=e.baseLineColor,this.er.rt=e.baseLineWidth,this.er.Ft=e.baseLineStyle)}}class rt extends g{constructor(){super(...arguments),this.Vt=null}tt(A){this.Vt=A}ar(){return this.Vt}Z({context:A,horizontalPixelRatio:t,verticalPixelRatio:e}){var i,r,n,a=this.Vt;null!==a&&(r=(i=Math.max(1,Math.floor(t)))%2/2,r=Math.round(a.Oe.x*t)+r,e=a.Oe.y*e,A.fillStyle=a._r,A.beginPath(),n=Math.max(2,1.5*a.ur)*t,A.arc(r,e,n,0,2*Math.PI,!1),A.fill(),A.fillStyle=a.cr,A.beginPath(),A.arc(r,e,a.lt*t,0,2*Math.PI,!1),A.fill(),A.lineWidth=i,A.strokeStyle=a.dr,A.beginPath(),A.arc(r,e,a.lt*t+i/2,0,2*Math.PI,!1),A.stroke())}}const nt=[{pr:0,vr:.25,mr:4,br:10,gr:.25,wr:0,Mr:.4,Sr:.8},{pr:.25,vr:.525,mr:10,br:14,gr:0,wr:0,Mr:.8,Sr:0},{pr:.525,vr:1,mr:14,br:14,gr:0,wr:0,Mr:0,Sr:0}];function at(A,t,e,i){return i=e+(i-e)*t,"transparent"===A?A:(t=(e=d(A))[3],`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${i*t})`)}function st(A,t){var e=A%2600/2600;let i;for(const A of nt)if(e>=A.pr&&e({_t:A.time,nt:0,et:0,Nn:0,Fr:A.shape,D:A.color,zr:A.internalId,sr:A.id,Gt:void 0})),this.$r=!1),this.Hi.F().layout),A=(this.Vt.it=null,i.zn());if(null!==A){var a=this.Tr.Tt();if(null!==a&&0!==this.Vt.st.length){let t=NaN;var s=_t(i.Kn()),o={Wr:s,jr:s};this.Vt.it=DA(this.Vt.st,A,!0);for(let A=this.Vt.it.from;A{var r=t.upColor,t=t.downColor,A=B(A(e,i)),e=_(A.At[0]){var r=t.upColor,n=t.downColor,a=t.borderUpColor,s=t.borderDownColor,o=t.wickUpColor,t=t.wickDownColor,A=B(A(e,i)),e=_(A.At[0]){A=B(A(e,i));return{ie:null!=(e=A.ot)?e:t.lineColor,ot:null!=(i=A.ot)?i:t.lineColor,bn:null!=(e=A.bn)?e:t.topColor,gn:null!=(i=A.gn)?i:t.bottomColor}},Baseline:(A,t,e,i)=>{A=B(A(e,i));return{ie:A.At[3]>=t.baseValue.price?t.topLineColor:t.bottomLineColor,be:null!=(e=A.be)?e:t.topLineColor,ge:null!=(i=A.ge)?i:t.bottomLineColor,de:null!=(e=A.de)?e:t.topFillColor1,fe:null!=(i=A.fe)?i:t.topFillColor2,pe:null!=(e=A.pe)?e:t.bottomFillColor1,ve:null!=(i=A.ve)?i:t.bottomFillColor2}},Line:(A,t,e,i)=>{A=B(A(e,i));return{ie:null!=(e=A.D)?e:t.color,ot:null!=(i=A.D)?i:t.color}},Histogram:(A,t,e,i)=>{return{ie:null!=(A=B(A(e,i)).D)?A:t.color}}};class Qt{constructor(A){this.Bh=(A,t)=>void 0!==t?t.At:this.Tr.Es().Ah(A),this.Tr=A,this.Oh=Ct[A.Lh()]}On(A,t){return this.Oh(this.Bh,this.Tr.F(),A,t)}}t.MismatchDirection=void 0,(A=t.MismatchDirection||(t.MismatchDirection={}))[A.NearestLeft=-1]="NearestLeft",A[A.None=0]="None",A[A.NearestRight=1]="NearestRight";class Ft{constructor(){this.Ih=[],this.Eh=new Map,this.Vh=new Map}zh(){return 0A.Ynt.Yn>A)}Gh(t,e,i){let r=null;for(let A=t;Ar.Qh&&(r.Qh=t)))}return r}Uh(e,i,r){if(this.Ni())return null;let n=null;const A=B(this.Nh()),t=B(this.Is()),a=Math.max(e,A),s=Math.min(i,t),o=30*Math.ceil(a/30),l=Math.max(o,30*Math.floor(s/30));{const e=this.Zh(a),A=this.Kh(Math.min(s,o,i));n=Ut(n,this.Gh(e,A,r))}let _=this.Eh.get(r);void 0===_&&(_=new Map,this.Eh.set(r,_));for(let t=Math.max(1+o,a);t{this.hl=null,this.Ut().Cl()},0)),t.Dr(),[t]):[]}Rs(){var A=[],t=(this.Tl()||A.push(this.il),A.push(this.ws,this.Sh,this.ds),this.tl.map(A=>A.Th()));return A.push(...t),A}Ji(A){return[this.yh,...this.tl.map(A=>A.Ph())]}Ds(A,t){if(t!==this.Yi&&!this.Tl())return[];var e=[...this.rs];for(const A of this.tl)e.push(A.Rh());return e}Pl(t,e){var A;return void 0!==this.cs.autoscaleInfoProvider?(A=this.cs.autoscaleInfoProvider(()=>{var A=this.Rl(t,e);return null===A?null:A.dh()}),gt.fh(A)):this.Rl(t,e)}Dl(){return this.cs.priceFormat.minMove}Bl(){return this.Al}As(){var A;this.ws.gt(),this.ds.gt();for(const A of this.rs)A.gt();for(const A of this.tl)A.gt();this.Sh.gt(),this.il.gt(),null!=(A=this.sl)&&A.gt()}Bt(){return B(super.Bt())}kt(A){var t;return"Line"!==this.ll&&"Area"!==this.ll&&"Baseline"!==this.ll||!this.cs.crosshairMarkerVisible||null===(t=this.Vt.Ah(A))?null:{ut:t.At[3],lt:this.Ol(),Ot:this.Ll(),Rt:this.Il(),Pt:this.El(A)}}Gr(){return this.cs.title}Ct(){return this.cs.visible}Tl(){return!gA(this.Bt().Vl())}Rl(A,t){if(!s(A)||!s(t)||this.Vt.Ni())return null;var e="Line"===this.ll||"Area"===this.ll||"Baseline"===this.ll||"Histogram"===this.ll?[3]:[2,1],A=this.Vt.Hh(A,t,e);let i=null!==A?new F(A.Jh,A.Qh):null;if("Histogram"===this.Lh()){const A=this.cs.base,t=new F(A,A);i=null!==i?i.sn(t):t}return new gt(i,this.ds.Yr())}Ol(){switch(this.ll){case"Line":case"Area":case"Baseline":return this.cs.crosshairMarkerRadius}return 0}Ll(){switch(this.ll){case"Line":case"Area":case"Baseline":var A=this.cs.crosshairMarkerBorderColor;if(0!==A.length)return A}return null}Il(){switch(this.ll){case"Line":case"Area":case"Baseline":return this.cs.crosshairMarkerBorderWidth}return 0}El(A){switch(this.ll){case"Line":case"Area":case"Baseline":{const A=this.cs.crosshairMarkerBackgroundColor;if(0!==A.length)return A}}return this.Ln().On(A).ie}al(){switch(this.cs.priceFormat.type){case"custom":this.Al={format:this.cs.priceFormat.formatter};break;case"volume":this.Al=new wA(this.cs.priceFormat.precision);break;case"percent":this.Al=new fA(this.cs.priceFormat.precision);break;default:var A=Math.pow(10,this.cs.priceFormat.precision);this.Al=new vA(A,this.cs.priceFormat.minMove*A)}null!==this.Yi&&this.Yi.zl()}vl(){const r=this.Ut().yt();if(!r.Nl()||this.Vt.Ni())this.rl=[];else{const n=B(this.Vt.Nh());this.rl=this.el.map((A,t)=>{var e=B(r.Fl(A.time,!0)),i=eA instanceof yt).reduce((A,t)=>{var e,i;return n.Ge(t)||!t.Ct()||(e=t.Bt(),i=t.Es(),e.Ni())||!i.Ir(r)||null===(i=i.Ah(r))?A:(t=_(t.Tt()),A.concat([e.Dt(i.At[3],t.At)]))},[]);0!==s.length&&(s.sort((A,t)=>Math.abs(A-a)-Math.abs(t-a)),A=s[0],t=e.vs(A,i))}}return t}}class Et extends g{constructor(){super(...arguments),this.Vt=null}tt(A){this.Vt=A}Z({context:t,bitmapSize:e,horizontalPixelRatio:i,verticalPixelRatio:r}){if(null!==this.Vt){const a=Math.max(1,Math.floor(i));var A,n;t.lineWidth=a,n=()=>{var A=B(this.Vt);if(A.$l){t.strokeStyle=A.Hl,l(t,A.Ul),t.beginPath();for(const l of A.ql){const r=Math.round(l.Yl*i);t.moveTo(r,-a),t.lineTo(r,e.height+a)}t.stroke()}if(A.Xl){t.strokeStyle=A.Zl,l(t,A.Kl),t.beginPath();for(const i of A.Gl){const l=Math.round(i.Yl*r);t.moveTo(-a,l),t.lineTo(e.width+a,l)}t.stroke()}},(A=t).save(),A.lineWidth%2&&A.translate(.5,.5),n(),A.restore()}}}class St{constructor(A){this.jt=new Et,this.vt=!0,this.ts=A}gt(){this.vt=!0}Mt(){var A;return this.vt&&(A={Xl:(A=this.ts.Ut().F().grid).horzLines.visible,$l:A.vertLines.visible,Zl:A.horzLines.color,Hl:A.vertLines.color,Kl:A.horzLines.style,Ul:A.vertLines.style,Gl:this.ts.ps().Jl(),ql:this.ts.Ut().yt().Jl()||[]},this.jt.tt(A),this.vt=!1),this.jt}}class Ht{constructor(A){this.ws=new St(A)}Th(){return this.ws}}const It={Ql:4,ta:1e-4};function U(A,t){A=100*(A-t)/t;return t1e-14+r,t=PA(n,e*s,1e-14),i=PA(n,1,1e-14);if(!(A&&t&&i))break;n/=s,s=this.sa[++a%this.sa.length]}if(n1e-14+r;)n/=s,s=this.na[++a%this.na.length];return n}}class Lt{constructor(A,t,e,i){this.ra=[],this.Vi=A,this.ia=t,this.ha=e,this.la=i}ea(A,t){if(Ac;A-=t){const o=this.la(A,a,!0);null!==i&&Math.abs(o-i)_||(rB(A.Zi())-B(t.Zi()))}t.PriceScaleMode=void 0,(A=t.PriceScaleMode||(t.PriceScaleMode={}))[A.Normal=0]="Normal",A[A.Logarithmic=1]="Logarithmic",A[A.Percentage=2]="Percentage",A[A.IndexedTo100=3]="IndexedTo100";const kt=new fA,Ot=new vA(100,1);class Vt{constructor(A,t,e,i){this.fa=0,this.pa=null,this.ph=null,this.va=null,this.ma={ba:!1,ga:null},this.wa=0,this.Ma=0,this.xa=new n,this.Sa=new n,this.ya=[],this.ka=null,this.Ca=null,this.Ta=null,this.Pa=null,this.Al=Ot,this.Ra=xt(null),this.Da=A,this.cs=t,this.Ba=e,this.Aa=i,this.Oa=new Lt(this,100,this.La.bind(this),this.Ia.bind(this))}Vl(){return this.Da}F(){return this.cs}kh(A){if(a(this.cs,A),this.zl(),void 0!==A.mode&&this.Ea({lr:A.mode}),void 0!==A.scaleMargins){var t=c(A.scaleMargins.top),A=c(A.scaleMargins.bottom);if(tA.As())}zl(){this.Ca=null;var A=this.uo();let t=100;null!==A&&(t=Math.round(1/A.Dl())),this.Al=Ot,this.th()?(this.Al=kt,t=100):this.Na()?(this.Al=new vA(100,1),t=100):null!==A&&(this.Al=A.Bl()),this.Oa=new Lt(this,t,this.La.bind(this),this.Ia.bind(this)),this.Oa.oa()}io(){this.ka=null}uo(){return this.ya[0]||null}qa(){return this.Fa()?this.cs.scaleMargins.bottom*this.It()+this.Ma:this.cs.scaleMargins.top*this.It()+this.wa}Ya(){return this.Fa()?this.cs.scaleMargins.top*this.It()+this.wa:this.cs.scaleMargins.bottom*this.It()+this.Ma}Xa(){this.ma.ba||(this.ma.ba=!0,this.fo())}Va(){this.pa=null}Ia(A,t){if(this.Xa(),this.Ni())return 0;A=this.da()&&A?Mt(A,this.Ra):A;var e=B(this.bh()),A=this.Ya()+(this.Ua()-1)*(A-e.lh())/e.oh();return this.Za(A)}La(A,t){var e;return this.Xa(),this.Ni()?0:(A=this.Za(A),e=(e=B(this.bh())).lh()+e.oh()*((A-this.Ya())/(this.Ua()-1)),this.da()?b(e,this.Ra):e)}ja(){this.Ca=null,this.Oa.oa()}fo(){const r=this.ma.ga;if(null!==r){let t=null;const _=this.co();let e=0,i=0;for(const o of _)if(o.Ct()){const _=o.Tt();if(null!==_){const l=o.Pl(r.Mn(),r.ci());let A=l&&l.bh();if(null!==A){switch(this.cs.mode){case 1:A=E(A,this.Ra);break;case 2:A=(n=A,a=_.At,s=void 0,s=U(n.lh(),a),n=U(n.ah(),a),new F(s,n));break;case 3:A=(a=A,s=_.At,n=void 0,n=y(a.lh(),s),a=y(a.ah(),s),new F(n,a))}if(t=null===t?A:t.sn(B(A)),null!==l){const r=l.gh();null!==r&&(e=Math.max(e,r.above),i=Math.max(e,r.below))}}}}var n,a,s,o,l;if(e===this.wa&&i===this.Ma||(this.wa=e,this.Ma=i,this.Ca=null,this.Va()),null!==t){if(t.lh()===t.ah()){const r=this.uo(),_=5*(null===r||this.th()||this.Na()?1:r.Dl());this.da()&&(t=Dt(t,this.Ra)),t=new F(t.lh()-_,t.ah()+_),this.da()&&(t=E(t,this.Ra))}if(this.da()){const r=Dt(t,this.Ra),_=xt(r);if(o=_,l=this.Ra,o.Ql!==l.Ql||o.ta!==l.ta){const A=null!==this.va?Dt(this.va,this.Ra):null;this.Ra=_,t=E(r,_),null!==A&&(this.va=E(A,_))}}this.Wa(t)}else null===this.ph&&(this.Wa(new F(-.5,.5)),this.Ra=xt(null));this.ma.ba=!0}}Ka(){return this.th()?U:this.Na()?y:this.da()?A=>Mt(A,this.Ra):null}xh(A,t){return void 0===this.Aa.priceFormatter?(t=void 0===t?this.Bl():t).format(A):this.Aa.priceFormatter(A)}}class Pt{constructor(A,t){this.ya=[],this.po=new Map,this.fa=0,this.vo=0,this.mo=1e3,this.ka=null,this.bo=new n,this.wo=A,this.Hi=t,this.Mo=new Ht(this);A=t.F();this.xo=this.So("left",A.leftPriceScale),this.yo=this.So("right",A.rightPriceScale),this.xo.$a().l(this.ko.bind(this,this.xo),this),this.yo.$a().l(this.ko.bind(this,this.yo),this),this.Co(A)}Co(A){if(A.leftPriceScale&&this.xo.kh(A.leftPriceScale),A.rightPriceScale&&this.yo.kh(A.rightPriceScale),A.localization&&(this.xo.zl(),this.yo.zl()),A.overlayPriceScales)for(const e of Array.from(this.po.values())){var t=B(e[0].Bt());t.kh(A.overlayPriceScales),A.localization&&t.zl()}}To(A){switch(A){case"left":return this.xo;case"right":return this.yo}return this.po.has(A)?c(this.po.get(A))[0].Bt():null}M(){this.Ut().Po().v(this),this.xo.$a().v(this),this.yo.$a().v(this),this.ya.forEach(A=>{A.M&&A.M()}),this.bo.m()}Ro(){return this.mo}Do(A){this.mo=A}Ut(){return this.Hi}$i(){return this.vo}It(){return this.fa}Bo(A){this.vo=A,this.Ao()}Ha(t){this.fa=t,this.xo.Ha(t),this.yo.Ha(t),this.ya.forEach(A=>{this.Ge(A)&&null!==(A=A.Bt())&&A.Ha(t)}),this.Ao()}jl(){return this.ya}Ge(A){A=A.Bt();return null===A||this.xo!==A&&this.yo!==A}Qa(A,t,e){e=void 0!==e?e:this.Lo().Oo+1;this.Io(A,t,e)}so(A){const t=this.ya.indexOf(A);r(-1!==t,"removeDataSource: invalid data source"),this.ya.splice(t,1);var e=B(A.Bt()).Vl();if(this.po.has(e)){const t=c(this.po.get(e)),i=t.indexOf(A);-1!==i&&(t.splice(i,1),0===t.length)&&this.po.delete(e)}const i=A.Bt();i&&0{A.As()})}ps(){let A=null;return this.Hi.F().rightPriceScale.visible&&0!==this.yo.jl().length?A=this.yo:this.Hi.F().leftPriceScale.visible&&0!==this.xo.jl().length?A=this.xo:0!==this.ya.length&&(A=this.ya[0].Bt()),A=null===A?this.yo:A}Je(){let A=null;return this.Hi.F().rightPriceScale.visible?A=this.yo:this.Hi.F().leftPriceScale.visible&&(A=this.xo),A}Eo(A){null!==A&&A.za()&&this.Uo(A)}qo(A){var t=this.wo.zn();A.Ea({js:!0}),null!==t&&A.do(t),this.Ao()}Yo(){this.Uo(this.xo),this.Uo(this.yo)}Xo(){this.Eo(this.xo),this.Eo(this.yo),this.ya.forEach(A=>{this.Ge(A)&&this.Eo(A.Bt())}),this.Ao(),this.Hi.Ch()}Ja(){return null===this.ka&&(this.ka=Kt(this.ya)),this.ka}Zo(){return this.bo}Ko(){return this.Mo}Uo(A){const t=A.co();if(t&&0i)&&(i=r)}return{Go:e,Oo:i}}Io(A,t,e){let i=this.To(t);if(null===i&&(i=this.So(t,this.Hi.F().overlayPriceScales)),this.ya.push(A),!gA(t)){const e=this.po.get(t)||[];e.push(A),this.po.set(t,e)}i.Qa(A),A.Gi(i),A.Ki(e),this.Eo(i),this.ka=null}ko(A,t,e){t.lr!==e.lr&&this.Uo(A)}So(A,t){t=Object.assign({visible:!0,autoScale:!0},o(t)),A=new Vt(A,t,this.Hi.F().layout,this.Hi.F().localization);return A.Ha(this.It()),A}}const Rt=A=>A.getUTCFullYear();class Nt{constructor(A="yyyy-MM-dd",t="default"){this.Jo=A,this.Qo=t}t_(A){return A=A,t=this.Jo,e=this.Qo,t.replace(/yyyy/g,(t=A,f(Rt(t),4))).replace(/yy/g,(t=A,f(Rt(t)%100,2))).replace(/MMMM/g,(t=A,i=e,new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"long"}))).replace(/MMM/g,(t=A,i=e,new Date(t.getUTCFullYear(),t.getUTCMonth(),1).toLocaleString(i,{month:"short"}))).replace(/MM/g,f(A.getUTCMonth()+1,2)).replace(/dd/g,f(A.getUTCDate(),2));var t,e,i}}class Gt{constructor(A){this.i_=A||"%h:%m:%s"}t_(A){return this.i_.replace("%h",f(A.getUTCHours(),2)).replace("%m",f(A.getUTCMinutes(),2)).replace("%s",f(A.getUTCSeconds(),2))}}const Wt={s_:"yyyy-MM-dd",n_:"%h:%m:%s",e_:" ",r_:"default"};class zt{constructor(A={}){A=Object.assign(Object.assign({},Wt),A);this.h_=new Nt(A.s_,A.r_),this.l_=new Gt(A.n_),this.a_=A.e_}t_(A){return""+this.h_.t_(A)+this.a_+this.l_.t_(A)}}class Yt{constructor(A,t=50){this.Le=0,this.Ie=1,this.Ee=1,this.ze=new Map,this.Ve=new Map,this.o_=A,this.Ne=t}t_(A){var t=A._t,t=(void 0===t.__?new Date(1e3*t.u_):new Date(Date.UTC(t.__.year,t.__.month-1,t.__.day))).getTime(),e=this.ze.get(t);if(void 0!==e)return e.c_;if(this.Le===this.Ne){const A=this.Ve.get(this.Ee);this.Ve.delete(this.Ee),this.ze.delete(c(A)),this.Ee++,this.Le--}e=this.o_(A);return this.ze.set(t,{c_:e,$e:this.Ie}),this.Ve.set(this.Ie,t),this.Le++,this.Ie++,e}}class S{constructor(A,t){r(A= left"),this.d_=A,this.f_=t}Mn(){return this.d_}ci(){return this.f_}p_(){return this.f_-this.d_+1}Ir(A){return this.d_{eA.Ynt-A))if(this.v_.get(A)){var a=n,s=(n=[],a.length);let t=0;var o=c(this.v_.get(A)),l=o.length;let e=1/0,i=-1/0;for(let A=0;A=r&&_-i>=r&&(n.push(c),i=_)}for(;tthis.D_[this.D_.length-1]._t.u_?t?this.D_.length-1:null:(e=w(this.D_,A.u_,(A,t)=>A._t.u_e/2&&!l?A.cu=!1:A.cu=_&&t.Yn=o,c++}return this.F_.length=c,this.N_=this.F_,this.F_}du(){this.L_=!0,this.Js(this.cs.barSpacing),this.Qs(this.cs.rightOffset)}fu(A){this.L_=!0,this.R_=A,this.nu(),this.Y_()}pu(A,t){var e=this.hu(A),i=this.Kn();this.Js(i+t*(i/10)),this.cs.rightBarStaysOnScroll||this.Qs(this.ou()+(e-this.hu(A)))}ro(A){this.Pa&&this._o(),null!==this.Ta||null!==this.z_||this.Ni()||(this.Ta=A,this.vu())}ho(A){var t;null!==this.z_&&(A=VA(this.vo-A,0,this.vo),t=VA(this.vo-B(this.Ta),0,this.vo),0!==A)&&0!==t&&this.Js(this.z_.Kn*A/t)}lo(){null!==this.Ta&&(this.Ta=null,this.mu())}ao(A){null!==this.Pa||null!==this.z_||this.Ni()||(this.Pa=A,this.vu())}oo(A){null!==this.Pa&&(A=(this.Pa-A)/this.Kn(),this.W_=B(this.z_).ou+A,this.L_=!0,this.nu())}_o(){null!==this.Pa&&(this.Pa=null,this.mu())}bu(){this.gu(this.cs.rightOffset)}gu(t,e=400){if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(!isFinite(e)||e1{A=(A-r)/e;return 1A&&(this.j_=A,this.L_=!0)}}Au(){return this.cs.fixLeftEdge&&this.cs.fixRightEdge&&0!==this.D_.length?this.vo/this.D_.length:this.cs.minBarSpacing}nu(){var A=this.Ou(),A=(this.W_>A&&(this.W_=A,this.L_=!0),this.Lu());null!==A&&this.W_this.Iu(A)),this.A_.set(A.w_,t)),t.t_(A)}Iu(A){var t=function(A,t,e){switch(A){case 0:case 10:return t?e?4:3:2;case 20:case 21:case 22:case 30:case 31:case 32:case 33:return t?3:2;case 50:return 2;case 60:return 1;case 70:return 0}}(A.w_,this.cs.timeVisible,this.cs.secondsVisible);if(void 0!==this.cs.tickMarkFormatter){var e=this.cs.tickMarkFormatter(A.M_,t,this.Aa.locale);if(null!==e)return e}var e=A._t,A=this.Aa.locale,i={};switch(t){case 0:i.year="numeric";break;case 1:i.month="short";break;case 2:i.day="numeric";break;case 3:i.hour12=!1,i.hour="2-digit",i.minute="2-digit";break;case 4:i.hour12=!1,i.hour="2-digit",i.minute="2-digit",i.second="2-digit"}return e=void 0===e.__?new Date(1e3*e.u_):new Date(Date.UTC(e.__.year,e.__.month-1,e.__.day)),new Date(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()).toLocaleString(A,i)}Bu(A){var t=this.O_;this.O_=A,Xt(t.C_(),this.O_.C_())||this.I_.m(),Xt(t.T_(),this.O_.T_())||this.E_.m(),this.Du()}Du(){this.N_=null}q_(){this.Du(),this.A_.clear()}H_(){var A=this.Aa.dateFormat;this.cs.timeVisible?this.Pu=new zt({s_:A,n_:this.cs.secondsVisible?"%h:%m:%s":"%h:%m",e_:" ",r_:this.Aa.locale}):this.Pu=new Nt(A,this.Aa.locale)}Y_(){if(this.cs.fixLeftEdge){const t=this.Q_();if(null!==t){var A=this.zn();if(null!==A){A=A.Mn()-t;if(An.width?i.pu=n.width/A:i.pu=1,t+=i.Nu*i.pu}let e=0;switch(this.Vt.Fu){case"top":e=0;break;case"center":e=Math.max((n.height-t)/2,0);break;case"bottom":e=Math.max(n.height-t,0)}r.fillStyle=this.Vt.D;for(const i of this.Vt.Vu){r.save();let A=0;switch(this.Vt.Wu){case"left":r.textAlign="left",A=i.Nu/2;break;case"center":r.textAlign="center",A=n.width/2;break;case"right":r.textAlign="right",A=n.width-1-i.Nu/2}r.translate(A,e),r.textBaseline="top",r.font=i.P,r.scale(i.pu,i.pu),r.fillText(i.Gt,0,i.ju),r.restore(),e+=i.Nu*i.pu}}}zu(A,t){var e=this.$u(A.font);let i=e.get(t);return void 0===i&&(i=A.measureText(t).width,e.set(t,i)),i}$u(A){let t=this.Eu.get(A);return void 0===t&&(t=new Map,this.Eu.set(A,t)),t}}class qt{constructor(A){this.vt=!0,this.Wt={Ct:!1,D:"",Vu:[],Fu:"center",Wu:"center"},this.jt=new jt(this.Wt),this.$t=A}gt(){this.vt=!0}Mt(){return this.vt&&(this.xt(),this.vt=!1),this.jt}xt(){var A=this.$t.F(),t=this.Wt;t.Ct=A.visible,t.Ct&&(t.D=A.color,t.Wu=A.horzAlign,t.Fu=A.vertAlign,t.Vu=[{Gt:A.text,P:i(A.fontSize,A.fontFamily,A.fontStyle),Nu:1.2*A.fontSize,ju:0,pu:0}])}}class $t extends pA{constructor(A,t){super(),this.cs=t,this.ws=new qt(this)}Ds(){return[]}Rs(){return[this.ws]}F(){return this.cs}As(){this.ws.gt()}}t.TrackingModeExitMode=void 0,(A=t.TrackingModeExitMode||(t.TrackingModeExitMode={}))[A.OnTouchEnd=0]="OnTouchEnd",A[A.OnNextTap=1]="OnNextTap";class Ae{constructor(A,t){this.Hu=[],this.Uu=[],this.vo=0,this.qu=null,this.Yu=new n,this.Xu=new n,this.Zu=null,this.Ku=A,this.cs=t,this.Gu=new Z(this),this.wo=new Zt(this,t.timeScale,this.cs.localization),this.bt=new BA(this,t.crosshair),this.Ju=new bt(t.crosshair),this.Qu=new $t(this,t.watermark),this.tc(),this.Hu[0].Do(2e3),this.ic=this.sc(0),this.nc=this.sc(1)}dl(){this.ec(v.rn())}Ch(){this.ec(v.en())}Cl(){this.ec(new v(1))}fl(A){A=this.rc(A);this.ec(A)}hc(){return this.qu}lc(A){var t=this.qu;this.qu=A,null!==t&&this.fl(t.ac),null!==A&&this.fl(A.ac)}F(){return this.cs}kh(t){a(this.cs,t),this.Hu.forEach(A=>A.Co(t)),void 0!==t.timeScale&&this.wo.kh(t.timeScale),void 0!==t.localization&&this.wo.U_(t.localization),(t.leftPriceScale||t.rightPriceScale)&&this.Yu.m(),this.ic=this.sc(0),this.nc=this.sc(1),this.dl()}oc(A,t){"left"===A?this.kh({leftPriceScale:t}):"right"===A?this.kh({rightPriceScale:t}):null!==(A=this._c(A))&&(A.Bt.kh(t),this.Yu.m())}_c(A){for(const e of this.Hu){var t=e.To(A);if(null!==t)return{Ht:e,Bt:t}}return null}yt(){return this.wo}uc(){return this.Hu}cc(){return this.Qu}dc(){return this.bt}fc(){return this.Xu}vc(A,t){A.Ha(t),this.lu()}Bo(t){this.vo=t,this.wo.Bo(this.vo),this.Hu.forEach(A=>A.Bo(t)),this.lu()}tc(A){var t=new Pt(this.wo,this),A=(void 0!==A?this.Hu.splice(A,0,t):this.Hu.push(t),void 0===A?this.Hu.length-1:A),e=v.rn();return e.Fs(A,{Ws:0,js:!0}),this.ec(e),t}No(A,t,e){A.No(t,e)}Fo(A,t,e){A.Fo(t,e),this.pl(),this.ec(this.mc(A,2))}Wo(A,t){A.Wo(t),this.ec(this.mc(A,2))}jo(A,t,e){t.za()||A.jo(t,e)}$o(A,t,e){t.za()||(A.$o(t,e),this.pl(),this.ec(this.mc(A,2)))}Ho(A,t){t.za()||(A.Ho(t),this.ec(this.mc(A,2)))}qo(A,t){A.qo(t),this.ec(this.mc(A,2))}bc(A){this.wo.ro(A)}gc(A,t){var e,i=this.yt();i.Ni()||0===t||(e=i.$i(),A=Math.max(1,Math.min(A,e)),i.pu(A,t),this.lu())}wc(A){this.Mc(0),this.xc(A),this.Sc()}yc(A){this.wo.ho(A),this.lu()}kc(){this.wo.lo(),this.Ch()}Mc(A){this.wo.ao(A)}xc(A){this.wo.oo(A),this.lu()}Sc(){this.wo._o(),this.Ch()}wt(){return this.Uu}Cc(A,t,e,i){this.bt.Ms(A,t);let r=NaN,n=this.wo.ru(A);var a=this.wo.zn(),a=(null!==a&&(n=Math.min(Math.max(a.Mn(),n),a.ci())),i.ps()),s=a.Tt();null!==s&&(r=a.vs(t,s)),r=this.Ju.Wl(r,n,i),this.bt.ks(n,r,i),this.Cl(),this.Xu.m(this.bt.St(),{x:A,y:t},e)}Tc(){this.dc().Ts(),this.Cl(),this.Xu.m(null,null,null)}pl(){var A,t,e=this.bt.Ht();null!==e&&(A=this.bt.Ss(),t=this.bt.ys(),this.Cc(A,t,null,e)),this.bt.As()}Pc(A,t,e){var i=this.wo.bs(0),r=(void 0!==t&&void 0!==e&&this.wo.gt(t,e),this.wo.bs(0)),n=this.wo.eu(),a=this.wo.zn();if(null!==a&&null!==i&&null!==r){const t=a.Ir(n),e=i.u_>r.u_,s=null!==A&&nA.Ja().includes(t));return void 0===A?null:A}lu(){this.Qu.As(),this.Hu.forEach(A=>A.Xo()),this.pl()}M(){this.Hu.forEach(A=>A.M()),this.Hu.length=0,this.cs.localization.priceFormatter=void 0,this.cs.localization.timeFormatter=void 0}Rc(){return this.Gu}tr(){return this.Gu.F()}Po(){return this.Yu}Dc(A,t){var e=this.Hu[0],t=this.Bc(t,A,e);return this.Uu.push(t),1===this.Uu.length?this.dl():this.Ch(),t}Ac(A){var t=this.Ke(A),e=this.Uu.indexOf(A);r(-1!==e,"Series not found"),this.Uu.splice(e,1),B(t).so(A),A.M&&A.M()}cl(A,t){var e=B(this.Ke(A));e.so(A);const i=this._c(t);if(null===i){const i=A.Zi();e.Qa(A,t,i)}else{e=i.Ht===e?A.Zi():void 0;i.Ht.Qa(A,t,e)}}Cu(){var A=v.en();A.Us(),this.ec(A)}Oc(A){var t=v.en();t.Xs(A),this.ec(t)}Gs(){var A=v.en();A.Gs(),this.ec(A)}Js(A){var t=v.en();t.Js(A),this.ec(t)}Qs(A){var t=v.en();t.Qs(A),this.ec(t)}Zs(A){var t=v.en();t.Zs(A),this.ec(t)}qs(){var A=v.en();A.qs(),this.ec(A)}Lc(){return this.cs.rightPriceScale.visible?"right":"left"}Ic(){return this.nc}U(){return this.ic}Lt(A){const t=this.nc,e=this.ic;if(t===e)return t;if(A=Math.max(0,Math.min(100,Math.round(100*A))),null===this.Zu||this.Zu.bn!==e||this.Zu.gn!==t)this.Zu={bn:e,gn:t,Ec:new Map};else{const t=this.Zu.Ec.get(A);if(void 0!==t)return t}var i=function(A,t,e){var[A,i,r,n]=d(A),[t,a,s,o]=d(t),t=[h(A+e*(t-A)),h(i+e*(a-i)),h(r+e*(s-r)),O(n+e*(o-n))];return`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]})`}(e,t,A/100);return this.Zu.Ec.set(A,i),i}mc(A,t){var e=new v(t);return null!==A&&(A=this.Hu.indexOf(A),e.Fs(A,{Ws:t})),e}rc(A,t){return void 0===t&&(t=2),this.mc(this.Ke(A),t)}ec(A){this.Ku&&this.Ku(A),this.Hu.forEach(A=>A.Ko().Th().gt())}Bc(A,t,e){var t=new yt(this,A,t),i=void 0!==A.priceScaleId?A.priceScaleId:this.Lc();return e.Qa(t,i),gA(i)||t.kh(A),t}sc(A){var t=this.cs.layout;return"gradient"===t.background.type?0===A?t.background.topColor:t.background.bottomColor:t.background.color}}function te(A){return!p(A)&&!W(A)}function ee(A){return p(A)}t.LastPriceAnimationMode=void 0,(A=t.LastPriceAnimationMode||(t.LastPriceAnimationMode={}))[A.Disabled=0]="Disabled",A[A.Continuous=1]="Continuous",A[A.OnDataUpdate=2]="OnDataUpdate",t.PriceLineSource=void 0,(A=t.PriceLineSource||(t.PriceLineSource={}))[A.LastBar=0]="LastBar",A[A.LastVisible=1]="LastVisible",t.ColorType=void 0,(A=t.ColorType||(t.ColorType={})).Solid="solid",A.VerticalGradient="gradient";const I="undefined"!=typeof window;function ie(){return I&&-1({width:Math.max(A.width,t.width),height:Math.max(A.height,t.height)})}));return A.resizeCanvasElement(t),A}class le{constructor(A,t,e){this.Kc=0,this.Gc=null,this.Jc={nt:Number.NEGATIVE_INFINITY,et:Number.POSITIVE_INFINITY},this.Qc=0,this.td=null,this.sd={nt:Number.NEGATIVE_INFINITY,et:Number.POSITIVE_INFINITY},this.nd=null,this.ed=!1,this.rd=null,this.hd=null,this.ld=!1,this.ad=!1,this.od=!1,this._d=null,this.ud=null,this.dd=null,this.fd=null,this.pd=null,this.vd=null,this.md=null,this.bd=0,this.gd=!1,this.wd=!1,this.Md=!1,this.xd=0,this.Sd=null,this.yd=!re(),this.kd=A=>{this.Cd(A)},this.Td=A=>{var t,e;this.Pd(A)?(e=this.Rd(A),++this.Qc,this.td&&1{this.Nd.removeEventListener("mousemove",t)},this.Nd.addEventListener("mousemove",t),this.Pd(A)||(A=this.Rd(A),this.Ed(A,this.Ld.Hd),this.yd=!0)}zd(){null!==this.Gc&&clearTimeout(this.Gc),this.Kc=0,this.Gc=null,this.Jc={nt:Number.NEGATIVE_INFINITY,et:Number.POSITIVE_INFINITY}}Id(){null!==this.td&&clearTimeout(this.td),this.Qc=0,this.td=null,this.sd={nt:Number.NEGATIVE_INFINITY,et:Number.POSITIVE_INFINITY}}$d(A){this.Md||null!==this.hd||this.Pd(A)||(A=this.Rd(A),this.Ed(A,this.Ld.Ud),this.yd=!0)}qd(A){const t=ce(A.changedTouches,B(this.Sd));if(null!==t&&(this.xd=he(A),null===this.md)&&!this.wd){this.gd=!0;const e=this.Bd(x(t),B(this.hd)),{Yd:i,Xd:r,Dd:n}=e;if(this.ld||!(n=A&&!this.cs.Zd(),e=A>r&&!this.cs.Kd();t||e||(this.wd=!0),this.ld=!0,this.od=!0,this.Wd(),this.Id()}if(!this.wd){const e=this.Rd(A,t);this.Ad(e,this.Ld.Gd),D(A)}}}}Jd(A){if(0===A.button){const t=this.Bd(x(A),B(this.rd)),e=t["Dd"];if(5{e.removeEventListener("touchmove",t),e.removeEventListener("touchend",i)},e.addEventListener("touchmove",t,{passive:!1}),e.addEventListener("touchend",i,{passive:!1}),this.Wd(),this.nd=setTimeout(this.hf.bind(this,A),240)}const i=this.Rd(A,t);this.Ad(i,this.Ld.lf),this.td||(this.Qc=0,this.td=setTimeout(this.Id.bind(this),500),this.sd=x(t))}}af(A){if(0===A.button){const t=this.Nd.ownerDocument.documentElement;ie()&&t.addEventListener("mouseleave",this.kd),this.ad=!1,this.rd=x(A),this.pd&&(this.pd(),this.pd=null);{const A=this.Jd.bind(this),e=this.Cd.bind(this);this.pd=()=>{t.removeEventListener("mousemove",A),t.removeEventListener("mouseup",e)},t.addEventListener("mousemove",A),t.addEventListener("mouseup",e)}if(this.Md=!0,!this.Pd(A)){const e=this.Rd(A);this.Ed(e,this.Ld._f),this.Gc||(this.Kc=0,this.Gc=setTimeout(this.zd.bind(this),500),this.Jc=x(A))}}}Fd(){this.Nd.addEventListener("mouseenter",this.jd.bind(this)),this.Nd.addEventListener("touchcancel",this.Wd.bind(this));{const t=this.Nd.ownerDocument,e=A=>{!this.Ld.uf||A.composed&&this.Nd.contains(A.composedPath()[0])||A.target&&this.Nd.contains(A.target)||this.Ld.uf()};this.ud=()=>{t.removeEventListener("touchstart",e)},this._d=()=>{t.removeEventListener("mousedown",e)},t.addEventListener("mousedown",e),t.addEventListener("touchstart",e,{passive:!0})}var A;re()&&(this.dd=()=>{this.Nd.removeEventListener("dblclick",this.Td)},this.Nd.addEventListener("dblclick",this.Td)),this.Nd.addEventListener("mouseleave",this.cf.bind(this)),this.Nd.addEventListener("touchstart",this.rf.bind(this),{passive:!0}),A=this.Nd,I&&void 0!==window.chrome&&A.addEventListener("mousedown",A=>{if(1===A.button)return A.preventDefault(),!1}),this.Nd.addEventListener("mousedown",this.af.bind(this)),this.df(),this.Nd.addEventListener("touchmove",()=>{},{passive:!1})}df(){void 0===this.Ld.ff&&void 0===this.Ld.pf&&void 0===this.Ld.vf||(this.Nd.addEventListener("touchstart",A=>this.mf(A.touches),{passive:!0}),this.Nd.addEventListener("touchmove",A=>{var t;2===A.touches.length&&null!==this.md&&void 0!==this.Ld.pf&&(t=_e(A.touches[0],A.touches[1])/this.bd,this.Ld.pf(this.md,t),D(A))},{passive:!1}),this.Nd.addEventListener("touchend",A=>{this.mf(A.touches)}))}mf(A){1===A.length&&(this.gd=!1),2!==A.length||this.gd||this.ed?this.bf():this.gf(A)}gf(A){var t=this.Nd.getBoundingClientRect()||{left:0,top:0};this.md={nt:(A[0].clientX-t.left+(A[1].clientX-t.left))/2,et:(A[0].clientY-t.top+(A[1].clientY-t.top))/2},this.bd=_e(A[0],A[1]),void 0!==this.Ld.ff&&this.Ld.ff(),this.Wd()}bf(){null!==this.md&&(this.md=null,void 0!==this.Ld.vf)&&this.Ld.vf()}cf(A){this.fd&&this.fd(),this.Pd(A)||this.yd&&(A=this.Rd(A),this.Ed(A,this.Ld.wf),this.yd=!re())}hf(A){var t=ce(A.touches,B(this.Sd));null!==t&&(A=this.Rd(A,t),this.Ad(A,this.Ld.Mf),this.od=!0,this.ed=!0)}Pd(A){return A.sourceCapabilities&&void 0!==A.sourceCapabilities.firesTouchEvents?A.sourceCapabilities.firesTouchEvents:he(A){"touchstart"!==A.type&&D(A)}}}}function _e(A,t){var e=A.clientX-t.clientX,A=A.clientY-t.clientY;return Math.sqrt(e*e+A*A)}function D(A){A.cancelable&&A.preventDefault()}function x(A){return{nt:A.pageX,et:A.pageY}}function he(A){return A.timeStamp||performance.now()}function ce(t,e){for(let A=0;A{this.Bf||this.ts.Of().Ut().Ch()},this.Lf=()=>{this.Bf||this.ts.Of().Ut().Ch()},this.ts=A,this.cs=t,this.Ba=t.layout,this.Gu=e,this.If="left"===i,this.Ef=document.createElement("div"),this.Ef.style.height="100%",this.Ef.style.overflow="hidden",this.Ef.style.width="25px",this.Ef.style.left="0",this.Ef.style.position="relative",this.Vf=M(this.Ef,u.size({width:16,height:16})),this.Vf.subscribeSuggestedBitmapSizeChanged(this.Af);A=this.Vf.canvasElement,A.style.position="absolute",A.style.zIndex="1",A.style.left="0",A.style.top="0",this.zf=M(this.Ef,u.size({width:16,height:16})),this.zf.subscribeSuggestedBitmapSizeChanged(this.Lf),t=this.zf.canvasElement,t.style.position="absolute",t.style.zIndex="2",t.style.left="0",t.style.top="0",e={_f:this.Nf.bind(this),lf:this.Nf.bind(this),Qd:this.Ff.bind(this),Gd:this.Ff.bind(this),uf:this.Wf.bind(this),nf:this.jf.bind(this),if:this.jf.bind(this),Vd:this.$f.bind(this),Od:this.$f.bind(this),Hd:this.Hf.bind(this),wf:this.Uf.bind(this)};this.qf=new le(this.zf.canvasElement,e,{Zd:()=>!1,Kd:()=>!0})}M(){this.qf.M(),this.zf.unsubscribeSuggestedBitmapSizeChanged(this.Lf),this.zf.dispose(),this.Vf.unsubscribeSuggestedBitmapSizeChanged(this.Af),this.Vf.dispose(),null!==this.Vi&&this.Vi.eo().v(this),this.Vi=null}Yf(){return this.Ef}T(){return this.Ba.fontSize}Xf(){var A=this.Gu.F();return this.Vr!==A.P&&(this.Rf.Fe(),this.Vr=A.P),A}Zf(){if(null===this.Vi)return 0;let t=0;const A=this.Xf(),e=B(this.Vf.canvasElement.getContext("2d")),i=(e.save(),this.Vi.Jl());e.font=this.Kf(),0t&&(t=i)}var n=this.Vi.Tt();if(null!==n&&null!==this.Tf){const A=this.Vi.vs(1,n),i=this.Vi.vs(this.Tf.height-2,n);t=Math.max(t,this.Rf.xi(e,this.Vi.Fi(Math.floor(Math.min(A,i))+.11111111111111,n)),this.Rf.xi(e,this.Vi.Fi(Math.ceil(Math.max(A,i))-.11111111111111,n)))}e.restore();n=t||34;return ne(Math.ceil(A.k+A.C+A.O+A.L+5+n))}Jf(A){null!==this.Tf&&u.equalSizes(this.Tf,A)||(this.Tf=A,this.Bf=!0,this.Vf.resizeCanvasElement(A),this.zf.resizeCanvasElement(A),this.Bf=!1,this.Ef.style.width=A.width+"px",this.Ef.style.height=A.height+"px")}Qf(){return B(this.Tf).width}Gi(A){this.Vi!==A&&(null!==this.Vi&&this.Vi.eo().v(this),(this.Vi=A).eo().l(this.xa.bind(this),this))}Bt(){return this.Vi}Fe(){var A=this.ts.tp();this.ts.Of().Ut().qo(A,B(this.Bt()))}ip(A){if(null!==this.Tf){if(1!==A){this.sp(),this.Vf.applySuggestedBitmapSize();const A=u.tryCreateCanvasRenderingTarget2D(this.Vf);null!==A&&(A.useBitmapCoordinateSpace(A=>{this.np(A),this.ye(A)}),this.ep(A),this.rp(A))}this.zf.applySuggestedBitmapSize();A=u.tryCreateCanvasRenderingTarget2D(this.zf);null!==A&&(A.useBitmapCoordinateSpace(({context:A,bitmapSize:t})=>{A.clearRect(0,0,t.width,t.height)}),this.hp(A))}}lp(){return this.Vf.bitmapSize}ap(A,t,e){var i=this.lp();0{A.fillStyle=s.borderColor;var i=Math.max(1,Math.floor(e)),r=Math.floor(.5*e),n=Math.round(o.C*t);A.beginPath();for(const s of a)A.rect(Math.floor(l*t),Math.round(s.Yl*e)-r,n,i);A.fill()}),A.useMediaCoordinateSpace(({context:t})=>{t.font=this.Kf(),t.fillStyle=null!=(A=s.textColor)?A:this.Ba.textColor,t.textAlign=this.If?"right":"left",t.textBaseline="middle";var A,e=this.If?Math.round(l-o.O):Math.round(l+o.C+o.O),i=a.map(A=>this.Rf.Mi(t,A.ua));for(let A=a.length;A--;){const o=a[A];t.fillText(o.ua,e,o.Yl+i[A])}})}}sp(){if(null!==this.Tf&&null!==this.Vi){let e=this.Tf.height/2;const i=[],t=this.Vi.Ja().slice(),r=this.ts.tp(),A=this.Xf(),n=(this.Vi===r.Je()&&this.ts.tp().Ja().forEach(A=>{r.Ge(A)&&t.push(A)}),this.Vi.jl()[0]),a=this.Vi;t.forEach(A=>{var t=A.Ds(r,a);t.forEach(A=>{A.Ai(null),A.Oi()&&i.push(A)}),n===A&&0A.Ai(A.yi())),this.Vi.F().alignLabels&&this._p(i,A,e)}}_p(A,t,e){if(null!==this.Tf){const i=A.filter(A=>A.yi()A.yi()>e);i.sort((A,t)=>t.yi()-A.yi()),i.length&&r.length&&r.push(i[0]),r.sort((A,t)=>A.yi()-t.yi());for(const e of A){const A=Math.floor(e.It(t)/2),i=e.yi();i>-A&&ithis.Tf.height-A&&i{A.Li()&&A.Mt(B(this.Vi)).X(t,e,this.Rf,i)})}}hp(t){if(null!==this.Tf&&null!==this.Vi){var A=this.ts.Of().Ut(),e=[],i=this.ts.tp(),A=A.dc().Ds(i,this.Vi);A.length&&e.push(A);const r=this.Xf(),n=this.If?"right":"left";e.forEach(A=>{A.forEach(A=>{A.Mt(B(this.Vi)).X(t,r,this.Rf,n)})})}}op(A){this.Ef.style.cursor=1===A?"ns-resize":"default"}xa(){var A=this.Zf();this.Df{this.Bf||null===this.xp||this.Hi().Ch()},this.Lf=()=>{this.Bf||null===this.xp||this.Hi().Ch()},this.Sp=A,this.xp=t,this.xp.Zo().l(this.yp.bind(this),this,!0),this.kp=document.createElement("td"),this.kp.style.padding="0",this.kp.style.position="relative";A=document.createElement("div"),A.style.width="100%",A.style.height="100%",A.style.position="relative",A.style.overflow="hidden",this.Cp=document.createElement("td"),this.Cp.style.padding="0",this.Tp=document.createElement("td"),this.Tp.style.padding="0",this.kp.appendChild(A),this.Vf=M(A,u.size({width:16,height:16})),this.Vf.subscribeSuggestedBitmapSizeChanged(this.Af),t=this.Vf.canvasElement,t.style.position="absolute",t.style.zIndex="1",t.style.left="0",t.style.top="0",this.zf=M(A,u.size({width:16,height:16})),this.zf.subscribeSuggestedBitmapSizeChanged(this.Lf),t=this.zf.canvasElement;t.style.position="absolute",t.style.zIndex="2",t.style.left="0",t.style.top="0",this.Pp=document.createElement("tr"),this.Pp.appendChild(this.Cp),this.Pp.appendChild(this.kp),this.Pp.appendChild(this.Tp),this.Rp(),this.qf=new le(this.zf.canvasElement,this,{Zd:()=>null===this.bp&&!this.Sp.F().handleScroll.vertTouchDrag,Kd:()=>null===this.bp&&!this.Sp.F().handleScroll.horzTouchDrag})}M(){null!==this.up&&this.up.M(),null!==this.cp&&this.cp.M(),this.zf.unsubscribeSuggestedBitmapSizeChanged(this.Lf),this.zf.dispose(),this.Vf.unsubscribeSuggestedBitmapSizeChanged(this.Af),this.Vf.dispose(),null!==this.xp&&this.xp.Zo().v(this),this.qf.M()}tp(){return B(this.xp)}Dp(A){null!==this.xp&&this.xp.Zo().v(this),this.xp=A,null!==this.xp&&this.xp.Zo().l(fe.prototype.yp.bind(this),this,!0),this.Rp()}Of(){return this.Sp}Yf(){return this.Pp}Rp(){var A;null!==this.xp&&(this.Bp(),0!==this.Hi().wt().length)&&(null!==this.up&&(A=this.xp.Vo(),this.up.Gi(B(A))),null!==this.cp&&(A=this.xp.zo(),this.cp.Gi(B(A))))}Ap(){null!==this.up&&this.up.gt(),null!==this.cp&&this.cp.gt()}Ro(){return null!==this.xp?this.xp.Ro():0}Do(A){this.xp&&this.xp.Do(A)}Hd(A){var t,e;this.xp&&(this.Op(),t=A.localX,e=A.localY,this.Lp(t,e,A))}_f(A){this.Op(),this.Ip(),this.Lp(A.localX,A.localY,A)}Ud(A){var t,e;this.xp&&(this.Op(),t=A.localX,e=A.localY,this.Lp(t,e,A),A=this.ir(t,e),this.Hi().lc(A&&{ac:A.ac,Ep:A.Ep}))}ef(A){null!==this.xp&&(this.Op(),this.Vp(A))}Qd(A){this.Op(),this.zp(A),this.Lp(A.localX,A.localY,A)}nf(A){null!==this.xp&&(this.Op(),this.mp=!1,this.Np(A))}sf(A){null!==this.xp&&this.Vp(A)}Mf(A){var t;this.mp=!0,null===this.bp&&(t={x:A.localX,y:A.localY},this.Fp(t,t,A))}wf(A){null!==this.xp&&(this.Op(),this.xp.Ut().lc(null),this.Wp())}jp(){return this.pp}ff(){this.vp=1,this.Hi().qs()}pf(A,t){var e;this.Sp.F().handleScale.pinch&&(e=5*(t-this.vp),this.vp=t,this.Hi().gc(A.nt,e))}lf(A){var t;this.mp=!1,this.gp=null!==this.bp,this.Ip(),null!==this.bp&&(t=this.Hi().dc(),this.wp={x:t.Xt(),y:t.Zt()},this.bp={x:A.localX,y:A.localY})}Gd(A){var t,e,i;null!==this.xp&&(e=A.localX,t=A.localY,null===this.bp?this.zp(A):(this.gp=!1,e=(i=B(this.wp)).x+(e-this.bp.x),i=i.y+(t-this.bp.y),this.Lp(e,i,A)))}if(A){0===this.Of().F().trackingMode.exitMode&&(this.gp=!0),this.$p(),this.Np(A)}ir(A,t){var e=this.xp;if(null!==e){const i=e.Ja();for(const r of i){const i=this.Hp(r.Rs(e),A,t);if(null!==i)return{ac:r,kf:i.kf,Ep:i.Ep}}}return null}Up(A,t){B("left"===t?this.up:this.cp).Jf(u.size({width:A,height:this.Tf.height}))}qp(){return this.Tf}Jf(A){u.equalSizes(this.Tf,A)||(this.Tf=A,this.Bf=!0,this.Vf.resizeCanvasElement(A),this.zf.resizeCanvasElement(A),this.Bf=!1,this.kp.style.width=A.width+"px",this.kp.style.height=A.height+"px")}Yp(){var A,t=B(this.xp);t.Eo(t.Vo()),t.Eo(t.zo());for(const e of t.jl())t.Ge(e)&&(null!==(A=e.Bt())&&t.Eo(A),e.As())}lp(){return this.Vf.bitmapSize}ap(A,t,e){var i=this.lp();0{this.np(A)}),this.xp)&&(this.Xp(A),this.Zp(A),this.Kp(A,Be),this.Kp(A,ge))}this.zf.applySuggestedBitmapSize();A=u.tryCreateCanvasRenderingTarget2D(this.zf);null!==A&&(A.useBitmapCoordinateSpace(({context:A,bitmapSize:t})=>{A.clearRect(0,0,t.width,t.height)}),this.Kp(A,ve),this.Gp(A))}}Jp(){return this.up}Qp(){return this.cp}yp(){null!==this.xp&&this.xp.Zo().v(this),this.xp=null}Vp(A){var t=A.localX,e=A.localY;this.pp.g()&&this.pp.m(this.Hi().yt().ru(t),{x:t,y:e},A)}np({context:A,bitmapSize:t}){var{width:t,height:e}=t,i=this.Hi(),r=i.U(),i=i.Ic();r===i?rA(A,0,0,t,e,i):oA(A,0,0,t,e,r,i)}Xp(A){var t=B(this.xp).Ko().Th().Mt();null!==t&&t.X(A,!1)}Zp(A){var t=this.Hi().cc();this.tv(A,Be,de,t),this.tv(A,Be,pe,t)}Gp(A){this.tv(A,Be,pe,this.Hi().dc())}Kp(A,t){var e=B(this.xp).Ja();for(const i of e)this.tv(A,t,de,i);for(const r of e)this.tv(A,t,pe,r)}tv(A,t,e,i){var r=B(this.xp),n=t(i,r),t=r.Ut().hc(),a=null!==t&&t.ac===i,s=null!==t&&a&&void 0!==t.Ep?t.Ep.nr:void 0;for(const t of n){const i=t.Mt();null!==i&&e(i,A,a,s)}}Hp(A,t,e){for(const r of A){const A=r.Mt();if(null!==A&&A.ir){var i=A.ir(t,e);if(null!==i)return{kf:r,Ep:i}}}return null}Bp(){var A,t,e,i;null!==this.xp&&(A=this.Sp,t=this.xp.Vo().F().visible,e=this.xp.zo().F().visible,t||null===this.up||(this.Cp.removeChild(this.up.Yf()),this.up.M(),this.up=null),e||null===this.cp||(this.Tp.removeChild(this.cp.Yf()),this.cp.M(),this.cp=null),i=A.Ut().Rc(),t&&null===this.up&&(this.up=new ue(this,A.F(),i,"left"),this.Cp.appendChild(this.up.Yf())),e)&&null===this.cp&&(this.cp=new ue(this,A.F(),i,"right"),this.Tp.appendChild(this.cp.Yf()))}iv(A){return A.xf&&this.mp||null!==this.bp}sv(A){return Math.max(0,Math.min(A,this.Tf.width-1))}nv(A){return Math.max(0,Math.min(A,this.Tf.height-1))}Lp(A,t,e){this.Hi().Cc(this.sv(A),this.nv(t),e,B(this.xp))}Wp(){this.Hi().Tc()}$p(){this.gp&&(this.bp=null,this.Wp())}Fp(A,t,e){this.bp=A,this.gp=!1,this.Lp(t.x,t.y,e);A=this.Hi().dc();this.wp={x:A.Xt(),y:A.Zt()}}Hi(){return this.Sp.Ut()}Np(A){if(this.fp){const t=this.Hi(),e=this.tp();if(t.Ho(e,e.ps()),this.dp=null,this.fp=!1,t.Sc(),null!==this.Mp){const A=performance.now(),e=t.yt();this.Mp.pr(e.ou(),A),this.Mp.wu(A)||t.Zs(this.Mp)}}}Op(){this.bp=null}Ip(){var A;this.xp&&(this.Hi().qs(),document.activeElement!==document.body&&document.activeElement!==document.documentElement?B(document.activeElement).blur():null!==(A=document.getSelection())&&A.removeAllRanges(),this.xp.ps().Ni()||this.Hi().yt().Ni())}zp(A){if(null!==this.xp){var t=this.Hi(),e=t.yt();if(!e.Ni()){var i=this.Sp.F(),r=i.handleScroll,i=i.kineticScroll;if(r.pressedMouseMove&&!A.xf||(r.horzTouchDrag||r.vertTouchDrag)&&A.xf){var r=this.xp.ps(),n=performance.now();if(null!==this.dp||this.iv(A)||(this.dp={x:A.clientX,y:A.clientY,u_:n,ev:A.localX,rv:A.localY}),null!==this.dp&&!this.fp&&(this.dp.x!==A.clientX||this.dp.y!==A.clientY)){if(A.xf&&i.touch||!A.xf&&i.mouse){const A=e.Kn();this.Mp=new oe(.2/A,7/A,.997,15/A),this.Mp.Xc(e.ou(),this.dp.u_)}else this.Mp=null;r.Ni()||t.jo(this.xp,r,A.localY),t.Mc(A.localX),this.fp=!0}this.fp&&(r.Ni()||t.$o(this.xp,r,A.localY),t.xc(A.localX),null!==this.Mp)&&this.Mp.Xc(e.ou(),n)}}}}}class we{constructor(A,t,e,i,r){this.vt=!0,this.Tf=u.size({width:0,height:0}),this.Af=()=>this.ip(3),this.If="left"===A,this.Gu=e.Rc,this.cs=t,this.hv=i,this.lv=r,this.Ef=document.createElement("div"),this.Ef.style.width="25px",this.Ef.style.height="100%",this.Ef.style.overflow="hidden",this.Vf=M(this.Ef,u.size({width:16,height:16})),this.Vf.subscribeSuggestedBitmapSizeChanged(this.Af)}M(){this.Vf.unsubscribeSuggestedBitmapSizeChanged(this.Af),this.Vf.dispose()}Yf(){return this.Ef}qp(){return this.Tf}Jf(A){u.equalSizes(this.Tf,A)||(this.Tf=A,this.Vf.resizeCanvasElement(A),this.Ef.style.width=A.width+"px",this.Ef.style.height=A.height+"px",this.vt=!0)}ip(A){A{this.np(A),this.ye(A)})}lp(){return this.Vf.bitmapSize}ap(A,t,e){var i=this.lp();0t.w_?A:t}class Ce{constructor(A){this.av=null,this.ov=null,this.S=null,this._v=!1,this.Tf=u.size({width:0,height:0}),this.uv=new n,this.Rf=new m(5),this.Bf=!1,this.Af=()=>{this.Bf||this.Sp.Ut().Ch()},this.Lf=()=>{this.Bf||this.Sp.Ut().Ch()},this.Sp=A,this.cs=A.F().layout,this.cv=document.createElement("tr"),this.dv=document.createElement("td"),this.dv.style.padding="0",this.fv=document.createElement("td"),this.fv.style.padding="0",this.Ef=document.createElement("td"),this.Ef.style.height="25px",this.Ef.style.padding="0",this.pv=document.createElement("div"),this.pv.style.width="100%",this.pv.style.height="100%",this.pv.style.position="relative",this.pv.style.overflow="hidden",this.Ef.appendChild(this.pv),this.Vf=M(this.pv,u.size({width:16,height:16})),this.Vf.subscribeSuggestedBitmapSizeChanged(this.Af);A=this.Vf.canvasElement,A.style.position="absolute",A.style.zIndex="1",A.style.left="0",A.style.top="0",this.zf=M(this.pv,u.size({width:16,height:16})),this.zf.subscribeSuggestedBitmapSizeChanged(this.Lf),A=this.zf.canvasElement;A.style.position="absolute",A.style.zIndex="2",A.style.left="0",A.style.top="0",this.cv.appendChild(this.dv),this.cv.appendChild(this.Ef),this.cv.appendChild(this.fv),this.vv(),this.Sp.Ut().Po().l(this.vv.bind(this),this),this.qf=new le(this.zf.canvasElement,this,{Zd:()=>!0,Kd:()=>!1})}M(){this.qf.M(),null!==this.av&&this.av.M(),null!==this.ov&&this.ov.M(),this.zf.unsubscribeSuggestedBitmapSizeChanged(this.Lf),this.zf.dispose(),this.Vf.unsubscribeSuggestedBitmapSizeChanged(this.Af),this.Vf.dispose()}Yf(){return this.cv}mv(){return this.av}bv(){return this.ov}_f(A){var t;this._v||(this._v=!0,!(t=this.Sp.Ut()).yt().Ni()&&this.Sp.F().handleScale.axisPressedMouseMove.time&&t.bc(A.localX))}lf(A){this._f(A)}uf(){var A=this.Sp.Ut();!A.yt().Ni()&&this._v&&(this._v=!1,this.Sp.F().handleScale.axisPressedMouseMove.time)&&A.kc()}Qd(A){var t=this.Sp.Ut();!t.yt().Ni()&&this.Sp.F().handleScale.axisPressedMouseMove.time&&t.yc(A.localX)}Gd(A){this.Qd(A)}nf(){this._v=!1;var A=this.Sp.Ut();A.yt().Ni()&&!this.Sp.F().handleScale.axisPressedMouseMove.time||A.kc()}if(){this.nf()}Vd(){this.Sp.F().handleScale.axisDoubleClickReset.time&&this.Sp.Ut().Gs()}Od(){this.Vd()}Hd(){this.Sp.Ut().F().handleScale.axisPressedMouseMove.time&&this.op(1)}wf(){this.op(0)}qp(){return this.Tf}gv(){return this.uv}wv(A,t,e){u.equalSizes(this.Tf,A)||(this.Tf=A,this.Bf=!0,this.Vf.resizeCanvasElement(A),this.zf.resizeCanvasElement(A),this.Bf=!1,this.Ef.style.width=A.width+"px",this.Ef.style.height=A.height+"px",this.uv.m(A)),null!==this.av&&this.av.Jf(u.size({width:t,height:A.height})),null!==this.ov&&this.ov.Jf(u.size({width:e,height:A.height}))}Mv(){var A=this.xv();return Math.ceil(A.k+A.C+A.T+A.I+A.A+A.Sv)}gt(){this.Sp.Ut().yt().Jl()}lp(){return this.Vf.bitmapSize}ap(A,t,e){var i=this.lp();0{this.np(A),this.ye(A)}),this.ep(t)),null!==this.av&&this.av.ip(A),null!==this.ov&&this.ov.ip(A)}this.zf.applySuggestedBitmapSize();const t=u.tryCreateCanvasRenderingTarget2D(this.zf);null!==t&&(t.useBitmapCoordinateSpace(({context:A,bitmapSize:t})=>{A.clearRect(0,0,t.width,t.height)}),this.yv([this.Sp.Ut().dc()],t))}}np({context:A,bitmapSize:t}){rA(A,0,0,t.width,t.height,this.Sp.Ut().Ic())}ye({context:A,bitmapSize:t,verticalPixelRatio:e}){this.Sp.F().timeScale.borderVisible&&(A.fillStyle=this.kv(),e=Math.max(1,Math.floor(this.xv().k*e)),A.fillRect(0,0,t.width,e))}ep(A){const t=this.Sp.Ut().yt(),a=t.Jl();if(a&&0!==a.length){let e=a.reduce(me,a[0]).w_;30{t.strokeStyle=this.kv(),t.fillStyle=this.kv();var i=Math.max(1,Math.floor(e)),r=Math.floor(.5*e),n=(t.beginPath(),Math.round(s.C*A));for(let A=a.length;A--;){const s=Math.round(a[A].Yl*e);t.rect(s-r,0,i,n)}t.fill()}),A.useMediaCoordinateSpace(({context:A})=>{var t=s.k+s.C+s.I+s.T/2;A.textAlign="center",A.textBaseline="middle",A.fillStyle=this.$(),A.font=this.Kf();for(const s of a)if(s.w_=e){const a=s.cu?this.Cv(A,s.Yl,s.ua):s.Yl;A.fillText(s.ua,a,t)}})}}Cv(A,t,e){A=this.Rf.xi(A,e),e=Math.floor(t-A/2)+.5;return ethis.Tf.width&&(t-=Math.abs(this.Tf.width-(e+A))),t}yv(A,t){var e=this.xv();for(const i of A)for(const A of i.Qi())A.Mt().X(t,e)}kv(){return this.Sp.F().timeScale.borderColor}$(){return this.cs.textColor}W(){return this.cs.fontSize}Kf(){return i(this.W(),this.cs.fontFamily)}Tv(){return i(this.W(),this.cs.fontFamily,"bold")}xv(){null===this.S&&(this.S={k:1,V:NaN,I:NaN,A:NaN,ji:NaN,C:5,T:NaN,P:"",Wi:new m,Sv:0});var A,t=this.S,e=this.Kf();return t.P!==e&&(A=this.W(),t.T=A,t.P=e,t.I=3*A/12,t.A=3*A/12,t.ji=9*A/12,t.V=0,t.Sv=4*A/12,t.Wi.Fe()),this.S}op(A){this.Ef.style.cursor=1===A?"ew-resize":"default"}vv(){const A=this.Sp.Ut(),t=A.F();t.leftPriceScale.visible||null===this.av||(this.dv.removeChild(this.av.Yf()),this.av.M(),this.av=null),t.rightPriceScale.visible||null===this.ov||(this.fv.removeChild(this.ov.Yf()),this.ov.M(),this.ov=null);var e={Rc:this.Sp.Ut().Rc()},i=()=>t.leftPriceScale.borderVisible&&A.yt().F().borderVisible,r=()=>A.Ic();t.leftPriceScale.visible&&null===this.av&&(this.av=new we("left",t,e,i,r),this.dv.appendChild(this.av.Yf())),t.rightPriceScale.visible&&null===this.ov&&(this.ov=new we("right",t,e,i,r),this.fv.appendChild(this.ov.Yf()))}}const Qe=!!I&&!!navigator.userAgentData&&navigator.userAgentData.brands.some(A=>A.brand.includes("Chromium"))&&!!I&&(null!=(A=null===navigator||void 0===navigator?void 0:navigator.userAgentData)&&A.platform?"Windows"===navigator.userAgentData.platform:0{let i=0;for(let A=0;A{B("left"===A?this.Wv.mv():this.Wv.bv()).ap(B(a),t,e)};if(this.cs.timeScale.visible){const t=this.Wv.lp();if(null!==a){let A=0;this.tm()&&(n("left",A,e),A=B(i.Jp()).lp().width),this.Wv.ap(a,A,e),A+=t.width,this.im()&&n("right",A,e)}e+=t.height}return u.size({width:t,height:e})}nm(){let A=0,t=0,e=0;for(const u of this.Pv)this.tm()&&(t=Math.max(t,B(u.Jp()).Zf())),this.im()&&(e=Math.max(e,B(u.Qp()).Zf())),A+=u.Ro();t=ne(t),e=ne(e);const i=this.vo,r=this.fa,n=Math.max(i-t-e,0),a=this.cs.timeScale.visible;var s=a?this.Wv.Mv():0,o=0+(s=s+s%2),l=r{A.Ap()}),3===(null==(e=this.Av)?void 0:e.$s())&&(this.Av.sn(A),this.hm(),this.lm(this.Av),this.am(this.Av,t),A=this.Av,this.Av=null)),this.ip(A)}am(A,t){for(const e of A.tn())this.nn(e,t)}lm(t){var e=this.Hi.uc();for(let A=0;A{if(this.Ov=!1,this.Rv=0,null!==this.Av){var t=this.Av;this.Av=null,this.Zv(t,A);for(const e of t.tn())if(5===e.Ys&&!e.At.wu(A)){this.Ut().Zs(e.At);break}}}))}hm(){this.Hv()}Hv(){const t=this.Hi.uc(),e=t.length,i=this.Pv.length;for(let A=e;A{var t=A.Es().jh(e);null!==t&&i.set(A,t)});let r;if(null!==e){const A=null==(n=this.Hi.yt().Ui(e))?void 0:n.M_;void 0!==A&&(r=A)}var n=this.Ut().hc(),a=null!==n&&n.ac instanceof yt?n.ac:void 0,n=null!==n&&void 0!==n.Ep?n.Ep.sr:void 0;return{_t:r,Yn:null!=e?e:void 0,um:null!=A?A:void 0,dm:a,fm:i,pm:n,vm:null!=t?t:void 0}}om(A,t,e){this.pp.m(()=>this._m(A,t,e))}Fv(A,t,e){this.Xu.m(()=>this._m(A,t,e))}Uv(){var A=this.cs.timeScale.visible?"":"none";this.Wv.Yf().style.display=A}tm(){return this.Pv[0].tp().Vo().F().visible}im(){return this.Pv[0].tp().zo().F().visible}jv(){return"ResizeObserver"in window&&(this.Lv=new ResizeObserver(A=>{A=A.find(A=>A.target===this.Iv);A&&this.$v(A.contentRect.width,A.contentRect.height)}),this.Lv.observe(this.Iv,{box:"border-box"}),!0)}Xv(){null!==this.Lv&&this.Lv.disconnect()}}function Ue(A){return Boolean(A.handleScroll.mouseWheel||A.handleScale.mouseWheel)}function ye(A,t,e,i){var r=e.value,t={Yn:t,_t:A,At:[r,r,r,r],M_:i};return void 0!==e.color&&(t.D=e.color),t}function be(A){return void 0!==A.At}function T(r){return(A,t,e,i)=>{return void 0===e.open&&void 0===e.value?{_t:A,Yn:t,M_:i}:r(A,t,e,i)}}const Ee={Candlestick:T(function(A,t,e,i){t={Yn:t,_t:A,At:[e.open,e.high,e.low,e.close],M_:i};return void 0!==e.color&&(t.D=e.color),void 0!==e.borderColor&&(t.Ot=e.borderColor),void 0!==e.wickColor&&(t.Dh=e.wickColor),t}),Bar:T(function(A,t,e,i){t={Yn:t,_t:A,At:[e.open,e.high,e.low,e.close],M_:i};return void 0!==e.color&&(t.D=e.color),t}),Area:T(function(A,t,e,i){var r=e.value,t={Yn:t,_t:A,At:[r,r,r,r],M_:i};return void 0!==e.lineColor&&(t.ot=e.lineColor),void 0!==e.topColor&&(t.bn=e.topColor),void 0!==e.bottomColor&&(t.gn=e.bottomColor),t}),Baseline:T(function(A,t,e,i){var r=e.value,t={Yn:t,_t:A,At:[r,r,r,r],M_:i};return void 0!==e.topLineColor&&(t.be=e.topLineColor),void 0!==e.bottomLineColor&&(t.ge=e.bottomLineColor),void 0!==e.topFillColor1&&(t.de=e.topFillColor1),void 0!==e.topFillColor2&&(t.fe=e.topFillColor2),void 0!==e.bottomFillColor1&&(t.pe=e.bottomFillColor1),void 0!==e.bottomFillColor2&&(t.ve=e.bottomFillColor2),t}),Histogram:T(ye),Line:T(ye)};function Se(A){return Ee[A]}const He=[{bm:1e3,w_:10},{bm:6e4,w_:20},{bm:3e5,w_:21},{bm:18e5,w_:22},{bm:36e5,w_:30},{bm:108e5,w_:31},{bm:216e5,w_:32},{bm:432e5,w_:33}];function Ie(t,e){if(t.getUTCFullYear()!==e.getUTCFullYear())return 70;if(t.getUTCMonth()!==e.getUTCMonth())return 60;if(t.getUTCDate()!==e.getUTCDate())return 50;for(let A=He.length-1;0{void 0===t&&(t=A.M_)}),c(t)}function Re(A){void 0===A.M_&&(A.M_=A.time)}class Ne{constructor(){this.xm=new Map,this.Sm=new Map,this.ym=new Map,this.km=[]}M(){this.xm.clear(),this.Sm.clear(),this.ym.clear(),this.km=[]}Cm(i,A){let t=0!==this.xm.size,r=!1;const n=this.Sm.get(i);if(void 0!==n)if(1===this.Sm.size)t=!1,r=!0,this.xm.clear();else for(const A of this.km)A.pointData.gm.delete(i)&&(r=!0);let e=[];if(0!==A.length){const t=A,n=(t.forEach(A=>Re(A)),A.forEach(ke),B(Te(A))),a=Se(i.Lh());e=t.map(A=>{var t=n(A.time);let e=this.xm.get(t.u_);void 0===e&&(e=Oe(t),this.xm.set(t.u_,e),r=!0);t=a(t,e.Yn,A,A.M_);return e.gm.set(i,t),t})}t&&this.Tm(),this.Pm(i,e);let a=-1;if(r){const i=[];this.xm.forEach(A=>{i.push({g_:0,_t:A.yl,pointData:A,M_:Pe(A.gm)})}),i.sort((A,t)=>A._t.u_-t._t.u_),a=this.Rm(i)}return this.Dm(i,a,function(A,t){A=Ve(A),t=Ve(t);if(void 0!==A&&void 0!==t)return{ml:A.Mm>=t.Mm&&A.wm>=t.wm}}(this.Sm.get(i),n))}Ac(A){return this.Cm(A,[])}Bm(A,t){var e=t,i=(Re(e),ke(t),B(Te([t]))(t.time)),r=this.ym.get(A);if(void 0!==r&&i.u_A._t.u_i._t.u_?be(t)&&e.push(t):be(t)?e[e.length-1]=t:e.splice(-1,1),this.ym.set(A,t._t)}Pm(A,t){0!==t.length?(this.Sm.set(A,t.filter(be)),this.ym.set(A,t[t.length-1]._t)):(this.Sm.delete(A),this.ym.delete(A))}Tm(){for(const A of this.km)0===A.pointData.gm.size&&this.xm.delete(A._t.u_)}Rm(t){let e=-1;for(let A=0;A{0!==A.length&&(t=Math.max(t,A[A.length-1].Yn))}),t}Dm(e,A,i){const r={Lm:new Map,yt:{eu:this.Om()}};if(-1!==A)this.Sm.forEach((A,t)=>{r.Lm.set(t,{ar:A,Im:t===e?i:void 0})}),this.Sm.has(e)||r.Lm.set(e,{ar:[],Im:i}),r.yt.Em=this.km,r.yt.Vm=A;else{const A=this.Sm.get(e);r.Lm.set(e,{ar:A||[],Im:i})}return r}}function Ge(A,t){A.Yn=t,A.gm.forEach(A=>{A.Yn=t})}function We(A){return{value:A.At[3],time:A.M_}}function ze(A){var t=We(A);return void 0!==A.D&&(t.color=A.D),t}function Ye(A){return{open:A.At[0],high:A.At[1],low:A.At[2],close:A.At[3],time:A.M_}}const Xe={Area:function(A){var t=We(A);return void 0!==A.ot&&(t.lineColor=A.ot),void 0!==A.bn&&(t.topColor=A.bn),void 0!==A.gn&&(t.bottomColor=A.gn),t},Line:ze,Baseline:function(A){var t=We(A);return void 0!==A.be&&(t.topLineColor=A.be),void 0!==A.ge&&(t.bottomLineColor=A.ge),void 0!==A.de&&(t.topFillColor1=A.de),void 0!==A.fe&&(t.topFillColor2=A.fe),void 0!==A.pe&&(t.bottomFillColor1=A.pe),void 0!==A.ve&&(t.bottomFillColor2=A.ve),t},Histogram:ze,Bar:function(A){var t=Ye(A);return void 0!==A.D&&(t.color=A.D),t},Candlestick:function(A){var t=Ye(A),{D:A,Ot:e,Dh:i}=A;return void 0!==A&&(t.color=A),void 0!==e&&(t.borderColor=e),void 0!==i&&(t.wickColor=i),t}};function Je(A){return Xe[A]}const Ze={autoScale:!0,mode:0,invertScale:!1,alignLabels:!0,borderVisible:!0,borderColor:"#2B2B43",entireTextOnly:!1,visible:!1,ticksVisible:!1,scaleMargins:{bottom:.1,top:.2}},je={color:"rgba(0, 0, 0, 0)",visible:!1,fontSize:48,fontFamily:J,fontStyle:"",text:"",horzAlign:"center",vertAlign:"center"},qe={width:0,height:0,autoSize:!1,layout:{background:{type:"solid",color:"#FFFFFF"},textColor:"#191919",fontSize:12,fontFamily:J},crosshair:{vertLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},horzLine:{color:"#9598A1",width:1,style:3,visible:!0,labelVisible:!0,labelBackgroundColor:"#131722"},mode:1},grid:{vertLines:{color:"#D6DCDE",style:0,visible:!0},horzLines:{color:"#D6DCDE",style:0,visible:!0}},overlayPriceScales:Object.assign({},Ze),leftPriceScale:Object.assign(Object.assign({},Ze),{visible:!1}),rightPriceScale:Object.assign(Object.assign({},Ze),{visible:!0}),timeScale:{rightOffset:0,barSpacing:6,minBarSpacing:.5,fixLeftEdge:!1,fixRightEdge:!1,lockVisibleTimeRangeOnResize:!1,rightBarStaysOnScroll:!1,borderVisible:!0,borderColor:"#2B2B43",visible:!0,timeVisible:!1,secondsVisible:!0,shiftVisibleRangeOnNewBar:!0,ticksVisible:!1},watermark:je,localization:{locale:I?navigator.language:"",dateFormat:"dd MMM 'yy"},handleScroll:{mouseWheel:!0,pressedMouseMove:!0,horzTouchDrag:!0,vertTouchDrag:!0},handleScale:{axisPressedMouseMove:{time:!0,price:!0},axisDoubleClickReset:{time:!0,price:!0},mouseWheel:!0,pinch:!0},kineticScroll:{mouse:!1,touch:!0},trackingMode:{exitMode:1}},$e={upColor:"#26a69a",downColor:"#ef5350",wickVisible:!0,borderVisible:!0,borderColor:"#378658",borderUpColor:"#26a69a",borderDownColor:"#ef5350",wickColor:"#737375",wickUpColor:"#26a69a",wickDownColor:"#ef5350"},Ai={upColor:"#26a69a",downColor:"#ef5350",openVisible:!0,thinBars:!0},ti={color:"#2196f3",lineStyle:0,lineWidth:3,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},ei={topColor:"rgba( 46, 220, 135, 0.4)",bottomColor:"rgba( 40, 221, 100, 0)",invertFilledArea:!1,lineColor:"#33D778",lineStyle:0,lineWidth:3,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},ii={baseValue:{type:"price",price:0},topFillColor1:"rgba(38, 166, 154, 0.28)",topFillColor2:"rgba(38, 166, 154, 0.05)",topLineColor:"rgba(38, 166, 154, 1)",bottomFillColor1:"rgba(239, 83, 80, 0.05)",bottomFillColor2:"rgba(239, 83, 80, 0.28)",bottomLineColor:"rgba(239, 83, 80, 1)",lineWidth:3,lineStyle:0,lineType:0,crosshairMarkerVisible:!0,crosshairMarkerRadius:4,crosshairMarkerBorderColor:"",crosshairMarkerBorderWidth:2,crosshairMarkerBackgroundColor:"",lastPriceAnimation:0},ri={color:"#26a69a",base:0},ni={title:"",visible:!0,lastValueVisible:!0,priceLineVisible:!0,priceLineSource:0,priceLineWidth:1,priceLineColor:"",priceLineStyle:2,baseLineVisible:!0,baseLineWidth:1,baseLineColor:"#B2B5BE",baseLineStyle:0,priceFormat:{type:"price",precision:2,minMove:.01}};class ai{constructor(A,t){this.zm=A,this.Nm=t}applyOptions(A){this.zm.Ut().oc(this.Nm,A)}options(){return this.Vi().F()}width(){return gA(this.Nm)?this.zm.Qv(this.Nm):0}Vi(){return B(this.zm.Ut()._c(this.Nm)).Bt}}const si={color:"#FF0000",price:0,lineStyle:2,lineWidth:1,lineVisible:!0,axisLabelVisible:!0,title:"",axisLabelColor:"",axisLabelTextColor:""};class oi{constructor(A){this.wh=A}applyOptions(A){this.wh.kh(A)}options(){return this.wh.F()}Fm(){return this.wh}}class li{constructor(A,t,e){this.Tn=A,this.Wm=t,this.jm=e}priceFormatter(){return this.Tn.Bl()}priceToCoordinate(A){var t=this.Tn.Tt();return null===t?null:this.Tn.Bt().Dt(A,t.At)}coordinateToPrice(A){var t=this.Tn.Tt();return null===t?null:this.Tn.Bt().vs(A,t.At)}barsInLogicalRange(A){var t,e,i,r;return null===A||(e=new H(new S(A.from,A.to)).C_(),(i=this.Tn.Es()).Ni())?null:(t=i.jh(e.Mn(),1),e=i.jh(e.ci(),-1),r=B(i.Nh()),i=B(i.Is()),null!==t&&null!==e&&t.Yn>e.Yn?{barsBefore:A.from-r,barsAfter:i-A.to}:(r={barsBefore:null===t||t.Yn===r?A.from-r:t.Yn-r,barsAfter:null===e||e.Yn===i?i-A.to:i-e.Yn},null!==t&&null!==e&&(r.from=t._t.__||t._t.u_,r.to=e._t.__||e._t.u_),r))}setData(A){this.Tn.Lh(),this.Wm.$m(this.Tn,A)}update(A){this.Tn.Lh(),this.Wm.Hm(this.Tn,A)}dataByIndex(A,t){A=this.Tn.Es().jh(A,t);return null===A?null:Je(this.seriesType())(A)}setMarkers(A){A=A.map(A=>Object.assign(Object.assign({},A),{originalTime:A.time,time:Le(A.time)}));this.Tn.gl(A)}markers(){return this.Tn.wl().map(A=>{var t=A["originalTime"],A=function(A,t){var e={};for(r in A)Object.prototype.hasOwnProperty.call(A,r)&&t.indexOf(r){this.Jm.g()&&this.Jm.m(this.tb(A()))},this),this.zm.fc().l(A=>{this.Qm.g()&&this.Qm.m(this.tb(A()))},this),A=this.zm.Ut();this.ib=new _i(A,this.zm.Yv())}remove(){this.zm.jp().v(this),this.zm.fc().v(this),this.ib.M(),this.zm.M(),this.Km.clear(),this.Gm.clear(),this.Jm.M(),this.Qm.M(),this.Zm.M()}resize(A,t,e){this.autoSizeActive()||this.zm.$v(A,t,e)}addAreaSeries(A){return this.sb("Area",ei,A)}addBaselineSeries(A){return this.sb("Baseline",ii,A)}addBarSeries(A){return this.sb("Bar",Ai,A)}addCandlestickSeries(A={}){return void 0!==(t=A).borderColor&&(t.borderUpColor=t.borderColor,t.borderDownColor=t.borderColor),void 0!==t.wickColor&&(t.wickUpColor=t.wickColor,t.wickDownColor=t.wickColor),this.sb("Candlestick",$e,A);var t}addHistogramSeries(A){return this.sb("Histogram",ri,A)}addLineSeries(A){return this.sb("Line",ti,A)}removeSeries(A){var t=c(this.Km.get(A)),e=this.Zm.Ac(t);this.zm.Ut().Ac(t),this.nb(e),this.Km.delete(A),this.Gm.delete(t)}$m(A,t){this.nb(this.Zm.Cm(A,t))}Hm(A,t){this.nb(this.Zm.Bm(A,t))}subscribeClick(A){this.Jm.l(A)}unsubscribeClick(A){this.Jm.p(A)}subscribeCrosshairMove(A){this.Qm.l(A)}unsubscribeCrosshairMove(A){this.Qm.p(A)}priceScale(A){return new ai(this.zm,A)}timeScale(){return this.ib}applyOptions(A){this.zm.kh(hi(A))}options(){return this.zm.F()}takeScreenshot(){return this.zm.Gv()}autoSizeActive(){return this.zm.sm()}sb(A,t,e={}){void 0!==(i=e.priceFormat)&&"custom"!==i.type&&void 0!==(i=i).minMove&&void 0===i.precision&&(i.precision=function(A){if(1t.tt(A.ar,A.Im)),t.lu()}eb(A){return c(this.Gm.get(A))}tb(A){const e=new Map;A.fm.forEach((A,t)=>{A=Je(t.Lh())(A);r(void 0!==A.open||void 0!==A.value),e.set(this.eb(t),A)});var t=void 0===A.dm?void 0:this.eb(A.dm);return{time:A._t,logical:A.Yn,point:A.um,hoveredSeries:t,hoveredObjectId:A.pm,seriesData:e,sourceEvent:A.vm}}}t.createChart=function(A,t){let e;if(W(A)){const t=document.getElementById(A);r(null!==t,"Cannot find element in DOM with id="+A),e=t}else e=A;return new ci(e,t)},t.isBusinessDay=te,t.isUTCTimestamp=ee,t.version=function(){return"4.0.1"}},{"fancy-canvas":4}],9:[function(t,e,A){!function(A){!function(){"use strict";"production"===A.env.NODE_ENV?e.exports=t("./dist/lightweight-charts.production.cjs"):e.exports=t("./dist/lightweight-charts.development.cjs")}.call(this)}.call(this,t("_process"))},{"./dist/lightweight-charts.development.cjs":7,"./dist/lightweight-charts.production.cjs":8,_process:10}],10:[function(A,t,e){var i,r,t=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}try{i="function"==typeof setTimeout?setTimeout:n}catch(A){i=n}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(A){r=a}function s(t){if(i===setTimeout)return setTimeout(t,0);if((i===n||!i)&&setTimeout)return(i=setTimeout)(t,0);try{return i(t,0)}catch(A){try{return i.call(null,t,0)}catch(A){return i.call(this,t,0)}}}var o,l=[],_=!1,h=-1;function c(){_&&o&&(_=!1,o.length?l=o.concat(l):h=-1,l.length)&&u()}function u(){if(!_){for(var A=s(c),t=(_=!0,l.length);t;){for(o=l,l=[];++hs[0]&&t[1]>10),a%1024+56320),(r+1===e||16384>5],this.data[t=(t>5)],this.data[t=(t>11)],t=this.index[t+=A>>5&63],this.data[t=(t>4,o[s++]=(15&e)>2,o[s++]=(3&i)=this._value.length?-1:this._value[A]},t.prototype.consumeUnicodeRangeToken=function(){for(var A=[],t=this.consumeCodePoint();uA(t)&&A.length>8,i=255&A>>16,A=255&A>>24;return t>>0};function vt(A,t,e){return eA.optimumDistance)?{optimumCorner:t,optimumDistance:e}:A},{optimumDistance:a?1/0:-1/0,optimumCorner:null}).optimumCorner},Ht="closest-side",It="farthest-side",Mt="closest-corner",Dt="farthest-corner",xt=function(A,t){if(22===t.type)return e={url:t.value,type:0},A.cache.addImage(t.value),e;if(18!==t.type)throw new Error("Unsupported image type "+t.type);var e=Yt[t.name];if(void 0===e)throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return e(A,t.values)};function Tt(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}}function Lt(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,t){return $A(t.filter(_))}}}function Kt(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}}function kt(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,t){return nt(t)?t.number:0}}}function Ot(A,t){return p(A)&&"normal"===A.value?1.2*t:17===A.type?t*A.number:_(A)?x(A,t):t}function Vt(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}}function Pt(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}}function Rt(A,t,e){return A&&(t=A[Math.min(t,A.length-1)])?e?t.open:t.close:""}var Nt,Gt,Wt,zt,Yt={"linear-gradient":function(e,A){var i=a(180),r=[];return l(A).forEach(function(A,t){if(0===t){t=A[0];if(20===t.type&&"to"===t.value)return void(i=tt(A));if(At(t))return void(i=pt(e,t))}t=mt(e,A);r.push(t)}),{angle:i,stops:r,type:1}},"-moz-linear-gradient":Qt,"-ms-linear-gradient":Qt,"-o-linear-gradient":Qt,"-webkit-linear-gradient":Qt,"radial-gradient":function(r,A){var n=0,a=3,s=[],o=[];return l(A).forEach(function(A,t){var e,i=!0;0===t&&(e=!1,i=A.reduce(function(A,t){if(e)if(p(t))switch(t.value){case"center":return o.push(ot),A;case"top":case"left":return o.push(B),A;case"right":case"bottom":return o.push(lt),A}else(_(t)||st(t))&&o.push(t);else if(p(t))switch(t.value){case"circle":return n=0,!1;case"ellipse":return!(n=1);case"at":return!(e=!0);case Ht:return a=0,!1;case"cover":case It:return!(a=1);case"contain":case Mt:return!(a=2);case Dt:return!(a=3)}else if(st(t)||_(t))return(a=Array.isArray(a)?a:[]).push(t),!1;return A},i)),i&&(t=mt(r,A),s.push(t))}),{size:a,shape:n,stops:s,position:o,type:2}},"-moz-radial-gradient":Ft,"-ms-radial-gradient":Ft,"-o-radial-gradient":Ft,"-webkit-radial-gradient":Ft,"-webkit-gradient":function(i,A){var t=a(180),r=[],n=1;return l(A).forEach(function(A,t){var e,A=A[0];if(0===t){if(p(A)&&"linear"===A.value)return void(n=1);if(p(A)&&"radial"===A.value)return void(n=2)}18===A.type&&("from"===A.name?(e=Bt.parse(i,A.values[0]),r.push({stop:B,color:e})):"to"===A.name?(e=Bt.parse(i,A.values[0]),r.push({stop:lt,color:e})):"color-stop"===A.name&&2===(t=A.values.filter(qA)).length&&(e=Bt.parse(i,t[1]),A=t[0],XA(A))&&r.push({stop:{type:16,number:100*A.number,flags:A.flags},color:e}))}),1===n?{angle:(t+a(180))%a(360),stops:r,type:n}:{size:3,shape:0,stops:r,position:[],type:n}}},Xt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(t,A){var e;return 0===A.length||20===(e=A[0]).type&&"none"===e.value?[]:A.filter(function(A){return qA(A)&&!(20===(A=A).type&&"none"===A.value||18===A.type&&!Yt[A.name])}).map(function(A){return xt(t,A)})}},Jt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,t){return t.map(function(A){if(p(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Zt={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,t){return l(t).map(function(A){return A.filter(_)}).map($A)}},jt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,t){return l(t).map(function(A){return A.filter(p).map(function(A){return A.value}).join(" ")}).map(qt)}},qt=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}},$t=((Gt=Nt=Nt||{}).AUTO="auto",Gt.CONTAIN="contain",{name:"background-size",initialValue:"0",prefix:!(Gt.COVER="cover"),type:1,parse:function(A,t){return l(t).map(function(A){return A.filter(Ae)})}}),Ae=function(A){return p(A)||_(A)},te=Tt("top"),ee=Tt("right"),ie=Tt("bottom"),re=Tt("left"),ne=Lt("top-left"),ae=Lt("top-right"),se=Lt("bottom-right"),oe=Lt("bottom-left"),le=Kt("top"),_e=Kt("right"),he=Kt("bottom"),ce=Kt("left"),ue=kt("top"),de=kt("right"),pe=kt("bottom"),Be=kt("left"),ge={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ve={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,t){return"rtl"!==t?0:1}},fe={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,t){return t.filter(p).reduce(function(A,t){return A|we(t.value)},0)}},we=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},me={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Ce={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,t){return!(20===t.type&&"normal"===t.value||17!==t.type&&15!==t.type)?t.number:0}},Qe={name:"line-break",initialValue:(o=Wt=Wt||{}).NORMAL="normal",prefix:!(o.STRICT="strict"),type:2,parse:function(A,t){return"strict"!==t?Wt.NORMAL:Wt.STRICT}},Fe={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ue={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,t){return 20===t.type&&"none"===t.value?null:xt(A,t)}},ye={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,t){return"inside"!==t?1:0}},be={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Ee=Vt("top"),Se=Vt("right"),He=Vt("bottom"),Ie=Vt("left"),Me={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,t){return t.filter(p).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},De={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,t){return"break-word"!==t?"normal":"break-word"}},xe=Pt("top"),Te=Pt("right"),Le=Pt("bottom"),Ke=Pt("left"),ke={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Oe={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Ve={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(n,A){return 1===A.length&&ZA(A[0],"none")?[]:l(A).map(function(A){for(var t={color:w.TRANSPARENT,offsetX:B,offsetY:B,blur:B},e=0,i=0;i>5],this.data[t=(t>5)],this.data[t=(t>11)],t=this.index[t+=A>>5&63],this.data[t=(t>4,o[s++]=(15&e)>2,o[s++]=(3&i)>10),a%1024+56320),(r+1===e||16384a.x||e.y>a.y);return a=e,0===t||A}),e.body.removeChild(A),t);return Object.defineProperty(v,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var A=function(A){var t=new Image,A=A.createElement("canvas"),e=A.getContext("2d");if(!e)return!1;t.src="data:image/svg+xml,";try{e.drawImage(t,0,0),A.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(v,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var A=e.createElement("canvas"),i=(A.width=100,A.height=100,A.getContext("2d"));if(!i)return Promise.reject(!1);i.fillStyle="rgb(0, 255, 0)",i.fillRect(0,0,100,100);var t=new Image,r=A.toDataURL(),A=(t.src=r,Hi(100,100,0,0,t));return i.fillStyle="red",i.fillRect(0,0,100,100),Ii(A).then(function(A){i.drawImage(A,0,0);var A=i.getImageData(0,0,100,100).data,t=(i.fillStyle="red",i.fillRect(0,0,100,100),e.createElement("div"));return t.style.backgroundImage="url("+r+")",t.style.height="100px",Si(A)?Ii(Hi(100,100,0,0,t)):Promise.reject(!1)}).then(function(A){return i.drawImage(A,0,0),Si(i.getImageData(0,0,100,100).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(v,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(v,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(v,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(v,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(v,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},Li=function(A,t){this.text=A,this.bounds=t},Ki=function(A,t){var e=t.ownerDocument;if(e){var e=e.createElement("html2canvaswrapper"),i=(e.appendChild(t.cloneNode(!0)),t.parentNode);if(i)return i.replaceChild(e,t),t=O(A,e),e.firstChild&&i.replaceChild(e.firstChild,e),t}return f.EMPTY},ki=function(A,t,e){var i=A.ownerDocument;if(i)return(i=i.createRange()).setStart(A,t),i.setEnd(A,t+e),i;throw new Error("Node has no owner document")},Oi=function(A){var t;if(v.SUPPORT_NATIVE_TEXT_SEGMENTATION)return t=new Intl.Segmenter(void 0,{granularity:"grapheme"}),Array.from(t.segment(A)).map(function(A){return A.segment});for(var e,i=Ti(A),r=[];!(e=i.next()).done;)e.value&&r.push(e.value.slice());return r},Vi=function(A,t){return 0!==t.letterSpacing?Oi(A):(A=A,t=t,v.SUPPORT_NATIVE_TEXT_SEGMENTATION?(e=new Intl.Segmenter(void 0,{granularity:"word"}),Array.from(e.segment(A)).map(function(A){return A.segment})):Mi(A,t));var e},Pi=[32,160,4961,65792,65793,4153,4241],Ri=function(A,t,e){var r,n,a,s,o;this.text=Ni(t.data,e.textTransform),this.textBounds=(r=A,A=this.text,a=t,A=Vi(A,n=e),s=[],o=0,A.forEach(function(A){var t,e,i;n.textDecorationLine.length||0A.height?new f(A.left+(A.width-A.height)/2,A.top,A.height,A.height):A.width

    "),wn(this.referenceElement.ownerDocument,t,A),n.replaceChild(n.adoptNode(this.documentElement),n.documentElement),n.close(),e):Promise.reject("Unable to find iframe window")},Q.prototype.createElementClone=function(A){var t;return vi(A,2),Rr(A)?this.createCanvasClone(A):Fr(A)?this.createVideoClone(A):Ur(A)?this.createStyleClone(A):(t=A.cloneNode(!1),Nr(t)&&(Nr(A)&&A.currentSrc&&A.currentSrc!==A.src&&(t.src=A.currentSrc,t.srcset=""),"lazy"===t.loading)&&(t.loading="eager"),yr(t)?this.createCustomElementClone(t):t)},Q.prototype.createCustomElementClone=function(A){var t=document.createElement("html2canvascustomelement");return vn(A.style,t),t},Q.prototype.createStyleClone=function(A){try{var t,e,i=A.sheet;if(i&&i.cssRules)return t=[].slice.call(i.cssRules,0).reduce(function(A,t){return t&&"string"==typeof t.cssText?A+t.cssText:A},""),(e=A.cloneNode(!1)).textContent=t,e}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},Q.prototype.createCanvasClone=function(t){var A;if(this.options.inlineImages&&t.ownerDocument){var e=t.ownerDocument.createElement("img");try{return e.src=t.toDataURL(),e}catch(A){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",t)}}e=t.cloneNode(!1);try{e.width=t.width,e.height=t.height;var i,r,n=t.getContext("2d"),a=e.getContext("2d");a&&(!this.options.allowTaint&&n?a.putImageData(n.getImageData(0,0,t.width,t.height),0,0):((i=null!=(A=t.getContext("webgl2"))?A:t.getContext("webgl"))&&!1===(null==(r=i.getContextAttributes())?void 0:r.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",t),a.drawImage(t,0,0)))}catch(A){this.context.logger.info("Unable to clone canvas as it is tainted",t)}return e},Q.prototype.createVideoClone=function(t){var A=t.ownerDocument.createElement("canvas"),e=(A.width=t.offsetWidth,A.height=t.offsetHeight,A.getContext("2d"));try{return e&&(e.drawImage(t,0,0,A.width,A.height),this.options.allowTaint||e.getImageData(0,0,A.width,A.height)),A}catch(A){this.context.logger.info("Unable to clone video as it is tainted",t)}e=t.ownerDocument.createElement("canvas");return e.width=t.offsetWidth,e.height=t.offsetHeight,e},Q.prototype.appendChildNode=function(A,t,e){Dr(t)&&("SCRIPT"===t.tagName||t.hasAttribute(hn)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(t))||this.options.copyStyles&&Dr(t)&&Ur(t)||A.appendChild(this.cloneNode(t,e))},Q.prototype.cloneChildNodes=function(A,t,e){for(var i,r=this,n=(A.shadowRoot||A).firstChild;n;n=n.nextSibling)Dr(n)&&Yr(n)&&"function"==typeof n.assignedNodes?(i=n.assignedNodes()).length&&i.forEach(function(A){return r.appendChildNode(t,A,e)}):this.appendChildNode(t,n,e)},Q.prototype.cloneNode=function(A,t){var e,i,r,n,a;return Mr(A)?document.createTextNode(A.data):A.ownerDocument&&(r=A.ownerDocument.defaultView)&&Dr(A)&&(xr(A)||Tr(A))?((e=this.createElementClone(A)).style.transitionProperty="none",i=r.getComputedStyle(A),a=r.getComputedStyle(A,":before"),r=r.getComputedStyle(A,":after"),this.referenceElement===A&&xr(e)&&(this.clonedReferenceElement=e),Pr(e)&&Un(e),n=this.counters.parse(new Bi(this.context,i)),a=this.resolvePseudoContent(A,e,a,$r.BEFORE),yr(A)&&(t=!0),Fr(A)||this.cloneChildNodes(A,e,t),a&&e.insertBefore(a,e.firstChild),(a=this.resolvePseudoContent(A,e,r,$r.AFTER))&&e.appendChild(a),this.counters.pop(n),(i&&(this.options.copyStyles||Tr(A))&&!Gr(A)||t)&&vn(i,e),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([e,A.scrollLeft,A.scrollTop]),(Wr(A)||zr(A))&&(Wr(e)||zr(e))&&(e.value=A.value),e):A.cloneNode(!1)},Q.prototype.resolvePseudoContent=function(a,A,t,e){var s=this;if(t){var o,l,i=t.content,_=A.ownerDocument;if(_&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==t.display)return this.counters.parse(new Bi(this.context,t)),o=new pi(this.context,t),l=_.createElement("html2canvaspseudoelement"),vn(t,l),o.content.forEach(function(A){if(0===A.type)l.appendChild(_.createTextNode(A.value));else if(22===A.type){var t=_.createElement("img");t.src=A.value,t.style.opacity="1",l.appendChild(t)}else if(18===A.type){var e,i,r,n;"attr"===A.name?(t=A.values.filter(p)).length&&l.appendChild(_.createTextNode(a.getAttribute(t[0].value)||"")):"counter"===A.name?(r=(t=A.values.filter(qA))[0],n=t[1],r&&p(r)&&(t=s.counters.getCounterValue(r.value),e=n&&p(n)?be.parse(s.context,n.value):3,l.appendChild(_.createTextNode(_n(t,e,!1))))):"counters"===A.name&&(r=(t=A.values.filter(qA))[0],e=t[1],n=t[2],r)&&p(r)&&(t=s.counters.getCounterValues(r.value),i=n&&p(n)?be.parse(s.context,n.value):3,r=e&&0===e.type?e.value:"",n=t.map(function(A){return _n(A,i,!1)}).join(r),l.appendChild(_.createTextNode(n)))}else if(20===A.type)switch(A.value){case"open-quote":l.appendChild(_.createTextNode(Rt(o.quotes,s.quoteDepth++,!0)));break;case"close-quote":l.appendChild(_.createTextNode(Rt(o.quotes,--s.quoteDepth,!1)));break;default:l.appendChild(_.createTextNode(A.value))}}),l.className=Cn+" "+Qn,i=e===$r.BEFORE?" "+Cn:" "+Qn,Tr(A)?A.className.baseValue+=i:A.className+=i,l}},Q.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},Q);function Q(A,t,e){if(this.context=A,this.options=e,this.scrolledElements=[],this.referenceElement=t,this.counters=new Xr,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}(C=$r=$r||{})[C.BEFORE=0]="BEFORE",C[C.AFTER=1]="AFTER";function un(t){return new Promise(function(A){!t.complete&&t.src?(t.onload=A,t.onerror=A):A()})}var dn=function(A,t){var e=A.createElement("iframe");return e.className="html2canvas-container",e.style.visibility="hidden",e.style.position="fixed",e.style.left="-10000px",e.style.top="0px",e.style.border="0",e.width=t.width.toString(),e.height=t.height.toString(),e.scrolling="no",e.setAttribute(hn,"true"),A.body.appendChild(e),e},pn=function(A){return Promise.all([].slice.call(A.images,0).map(un))},Bn=function(r){return new Promise(function(t,A){var e=r.contentWindow;if(!e)return A("No window assigned for iframe");var i=e.document;e.onload=r.onload=function(){e.onload=r.onload=null;var A=setInterval(function(){0"),t},wn=function(A,t,e){A&&A.defaultView&&(t!==A.defaultView.pageXOffset||e!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(t,e)},mn=function(A){var t=A[0],e=A[1],A=A[2];t.scrollLeft=e,t.scrollTop=A},Cn="___html2canvas___pseudoelement_before",Qn="___html2canvas___pseudoelement_after",Fn='{\n content: "" !important;\n display: none !important;\n}',Un=function(A){yn(A,"."+Cn+":before"+Fn+"\n ."+Qn+":after"+Fn)},yn=function(A,t){var e=A.ownerDocument;e&&((e=e.createElement("style")).textContent=t,A.appendChild(e))},bn=(F.getOrigin=function(A){var t=F._link;return t?(t.href=A,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},F.isSameOrigin=function(A){return F.getOrigin(A)===F._origin},F.setContext=function(A){F._link=A.document.createElement("a"),F._origin=F.getOrigin(A.location.href)},F._origin="about:blank",F);function F(){}Sn.prototype.addImage=function(A){var t=Promise.resolve();return this.has(A)||(Ln(A)||Dn(A))&&(this._cache[A]=this.loadImage(A)).catch(function(){}),t},Sn.prototype.match=function(A){return this._cache[A]},Sn.prototype.loadImage=function(a){return h(this,void 0,void 0,function(){var t,i,e,r,n=this;return M(this,function(A){switch(A.label){case 0:return(t=bn.isSameOrigin(a),i=!xn(a)&&!0===this._options.useCORS&&v.SUPPORT_CORS_IMAGES&&!t,e=!xn(a)&&!t&&!Ln(a)&&"string"==typeof this._options.proxy&&v.SUPPORT_CORS_XHR&&!i,t||!1!==this._options.allowTaint||xn(a)||Ln(a)||e||i)?(r=a,e?[4,this.proxy(r)]:[3,2]):[2];case 1:r=A.sent(),A.label=2;case 2:return this.context.logger.debug("Added image "+a.substring(0,256)),[4,new Promise(function(A,t){var e=new Image;e.onload=function(){return A(e)},e.onerror=t,(Tn(r)||i)&&(e.crossOrigin="anonymous"),e.src=r,!0===e.complete&&setTimeout(function(){return A(e)},500),0e.width+B?0:Math.max(0,n-B),Math.max(0,a-p),y.TOP_RIGHT):new U(e.left+e.width-B,e.top+p),this.bottomRightPaddingBox=0e.width+v+t?0:n-v+t,a-(p+f),y.TOP_RIGHT):new U(e.left+e.width-(B+w),e.top+p+f),this.bottomRightContentBox=0A.element.container.styles.zIndex.order?(i=t,!1):0=A.element.container.styles.zIndex.order?(r=t+1,!1):0=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);e=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);eA.Max_wolumen_z_3M&&(r=A.Wolumen_obrotu_szt),e+=h("Wolumen",A.Wolumen_obrotu_szt,0,r,["Średnia z 3M: ".concat((0,d.getMld)(A.Sredni_wolumen_z_3M," szt",0))],A.Sredni_wolumen_z_3M));A.Minimum&&A.Maximum&&A.Ostatnia_wartosc&&(r=A.Ostatnia_wartosc>A.Maximum?A.Ostatnia_wartosc:A.Maximum,i=A.Ostatnia_wartoscA.MAX_kurs_z_1R?A.Ostatnia_wartosc:A.MAX_kurs_z_1R,r=A.Ostatnia_wartoscNumber(A.max_1_day_value)?Number(A.last_value):Number(A.max_1_day_value),a=Number(A.last_value)Number(A.max_1_year_value)?Number(A.last_value):Number(A.max_1_year_value),s=Number(A.last_value)Number(A.range_max_value)?Number(A.last_value):Number(A.range_max_value),t=Number(A.last_value)Number(A.all_max)?Number(A.last_value):Number(A.all_max),a=Number(A.last_value)'.concat(e,"")),'\n

    \n
    '.concat(A,'
    \n
    \n ').concat(t,"\n ").concat(i,"\n
    \n
    ")}function _(A,t,e,i){var r="-neutral",n="";0\n
    '.concat(A,'
    \n
    \n \n \n ').concat(n).concat((0,d.getMld)(e,"",4),'\n \n '.concat(t,""):"",'\n
    \n
    '.concat(A,'
    \n
    \n ').concat(i,'\n \n \n ').concat(n).concat((0,d.getMld)(e,"%",2),'\n \n \n \n \n \n
    \n
    ')}function h(A,t,e,i,r,n){var a,s,n=5\n ').concat(a,'% vs Średnia\n
    \n
    '),l='\n
    \n '.concat((0,d.getMld)(t," szt",0),"\n
    ")):o='\n
    \n
    \n
    '),""),h=u(r);try{for(h.s();!(s=h.n()).done;){var c=s.value;_+="".concat(c,"")}}catch(A){h.e(A)}finally{h.f()}return'\n
    \n
    \n
    '.concat(A,"
    \n ").concat(l,"\n
    \n ").concat(o,'\n
    ').concat(_,"
    \n
    ")}function c(A,t){return'\n
    \n
    Zakres dat
    \n
    \n '.concat(A,'\n ').concat(t,"\n
    \n
    ")}function p(A,t,e,i){var r="--";i=Math.floor(i),("12m"===e||"36m"===e)&&!isNaN(i)&&0'.concat(t,""):"",r=''.concat((e=e,i=i,'\n \n \n \n ').concat(i,'\n ')),"").concat(t));return'\n
    \n
    '.concat(A,"
    ").concat('\n
    \n
    \n \n
    \n
    \n Ranking Analiz Online to narzędzie bazujące na parametrach ilościowych w prosty sposób wskazujące inwestorom najlepsze i najgorsze fundusze w ramach jednorodnej grupy produktowej.\n Fundusze otrzymują oceny w rocznym i trzyletnim okresie inwestycji. Fundusze które charakteryzują się wysoką efektywnością zarządzania to takie, które posiadają ocenę 5a lub 4a. Ocena na poziomie 3a oznacza przeciętną efektywność, a noty na poziomie 2a i 1a ‑ niską efektywność zarządzania\n
    \n
    ','
    \n
    \n ').concat(r,"\n
    \n
    ")}e.default=A},{"../utilities/date-time":2,"../utilities/series":3}],2:[function(l,i,r){!function(e){!function(){function t(A){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}!function(A){"object"===(void 0===r?"undefined":t(r))&&void 0!==i?i.exports=A():("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).n2pb=A()}(function(){return function i(r,n,a){function s(t,A){if(!n[t]){if(!r[t]){var e="function"==typeof l&&l;if(!A&&e)return e(t,!0);if(o)return o(t,!0);throw(A=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",A}e=n[t]={exports:{}},r[t][0].call(e.exports,function(A){return s(r[t][1][A]||A)},e,e.exports,i,r,n,a)}return n[t].exports}for(var o="function"==typeof l&&l,A=0;A=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);et.low?t:A).low,close:t.close}}function l(A,t){var e=[];if(!A||A.length=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]=g(a[p],d))}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){for(var" i="v(t),t=new" date l h="l.value,c=Math.floor((h.time-a/1e3)/i);0<=c&&e[c]&&(e[c]=g(e[c],h))}}catch(A){_.e(A)}finally{_.f()}}return" s="v(t),t=new">=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]={time:a[p].time,value:a[p].value?a[p].value+d.value:d.value})}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){var" i='v(t);if("1min"===t)e=l(A,16);else' if r s="r.value,o=new" date o="r.value,l=new" _="e.toReversed(),h=0;h<a.length;h++)!function(){var" t="a[h],A=_.find(function(A){return" a.time mld self window global strict symbol symbol.iterator typeof a.length n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);ethis.container.clientWidth||t.point.ythis.container.clientHeight?(this.tooltip.classList.add("-hide"),this.container.style.cursor="auto"):((e={}).intraday="fund"!==this.dataType&&(0,l.getIntraday)(this.params.startDate),e.main=t.seriesData.get(this.series[this.symbol]),"fund"===this.dataType&&(A=this.seriesData.find(function(A){return A.time===t.time}),e.originMain=A?A.value:null),this.series.volume&&(e.volume=t.seriesData.get(this.series.volume)),this.series.benchmark&&this.seriesVisibility.benchmark&&(e.benchmark=t.seriesData.get(this.series.benchmark),A=this.benchmarkData.find(function(A){return A.time===t.time}),e.originBenchmark=A?A.value:null),t.hoveredObjectId?(this.container.style.cursor="pointer",(A=this.markers.filter(function(A){return A.id===t.hoveredObjectId}))&&(e.markerType=A[0].type)):this.container.style.cursor="auto",e.param=t,e.interval=this.params.interval,e.lastValue=this.lastValue,e.prevClose=this.prevClose,e.range=this.params.range,e.dataType=this.dataType,e.unit=this.unit,""!==(A=(0,h.getTooltipHtml)(e))&&(this.tooltip.innerHTML=A,e=(0,h.getTooltipCoordinatePointer)(t,this.container,this.tooltip),this.tooltip.style.left=e.left+"px",this.tooltip.style.top=e.top+"px",this.tooltip.classList.remove("-hide")))}},{key:"subscribeClick",value:function(){var h=this;this.view.subscribeClick(function(t){var e,A=null,i=(document.documentElement.clientWidth=Number(t.time)-e&&Number(A.time)=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){var e;if(A)return"string"==typeof A?i(A,t):"Map"===(e="Object"===(e=Object.prototype.toString.call(A).slice(8,-1))&&A.constructor?A.constructor.name:e)||"Set"===e?Array.from(A):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?i(A,t):void 0}function i(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);e'.concat(s,""):"Brak danych"),i&&(a=null,"bond"===this.dataType?a=A.change_value:A.Zmiana_procentowa||0===A.Zmiana_procentowa?a=A.Zmiana_procentowa:A.rate_of_return||0===A.rate_of_return?a=A.rate_of_return:!A.return_rate&&0!==A.return_rate||(a=A.return_rate),t="-neutral",s=e="",!a&&0!==a||(0').concat(e).concat(s,""):"Brak danych");var u=A.Data_poczatkowa||A.date_from,a=A.Data_koncowa||A.date_to,i=(0,T.getDateInFormat)(u,this.params.intraday),t=(0,T.getDateInFormat)(a,this.params.intraday);r&&(r.textContent=i&&t?"".concat(i," - ").concat(t):"Brak danych"),this.chartDateContainer&&(this.chartDateContainer.textContent=i&&t?"".concat(i," - ").concat(t):""),n&&(n.textContent=this.params.interval)}},{key:"setHeader",value:function(A){var t,e,i,r,n=document.querySelector(".o-quotes-profile-header-box");n&&((r=A.header_data)?(t=r.current_rate,e=r.change_percent,i=r.change,r=r.datetime,(0,h.udateHeader)(n,this.dataType,t,e,i,r)):"1D"===this.params.range&&(e=(t=A.profile_data).Ostatnia_wartosc||t.last_value,i=t.Zmiana_procentowa||t.rate_of_return||t.return_rate,r=t.Zmiana_zl||t.change_value||t.exchange_rate,A=t.Data_koncowa||t.date_to,(0,h.udateHeader)(n,this.dataType,e,i,r,A)))}},{key:"fetchDataStocks",value:function(){var r=0'.concat((0,u.getMld)(e,o,l="foreign_indicy"===t||"indicy"===t?2:4),""),s.innerHTML=(e=i,s=r,i=o,r=l,o="neutral",_=l="",!(e="bond"===(t=t)?s:e)&&0!==e||(0').concat((0,u.getMld)(s,i,r),""),'\n \n ').concat(l).concat(_,'\n \n \n \n \n \n \n ').concat(h)),A.textContent=(0,c.getDateInFormat)(n,a))}},{"./date-time":1,"./series":3}],3:[function(l,i,r){!function(e){!function(){function t(A){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}!function(A){"object"===(void 0===r?"undefined":t(r))&&void 0!==i?i.exports=A():("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).n2pb=A()}(function(){return function i(r,n,a){function s(t,A){if(!n[t]){if(!r[t]){var e="function"==typeof l&&l;if(!A&&e)return e(t,!0);if(o)return o(t,!0);throw(A=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",A}e=n[t]={exports:{}},r[t][0].call(e.exports,function(A){return s(r[t][1][A]||A)},e,e.exports,i,r,n,a)}return n[t].exports}for(var o="function"==typeof l&&l,A=0;A=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);et.low?t:A).low,close:t.close}}function l(A,t){var e=[];if(!A||A.length=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]=g(a[p],d))}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){for(var" i="v(t),t=new" date l h="l.value,c=Math.floor((h.time-a/1e3)/i);0<=c&&e[c]&&(e[c]=g(e[c],h))}}catch(A){_.e(A)}finally{_.f()}}return" s="v(t),t=new">=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]={time:a[p].time,value:a[p].value?a[p].value+d.value:d.value})}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){var" i='v(t);if("1min"===t)e=l(A,16);else' if r s="r.value,o=new" date o="r.value,l=new" _="e.toReversed(),h=0;h<a.length;h++)!function(){var" t="a[h],A=_.find(function(A){return" a.time mld self window global strict symbol symbol.iterator typeof function l error find module n range a.length>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);e',A.image.picture){var e,i=_(A.image.picture.sources);try{for(i.s();!(e=i.n()).done;){var r=e.value;t+=''):t+=">"}}catch(A){i.e(A)}finally{i.f()}}A.image.img&&(t+=''.concat(A.image.img.alt,'"),t+=""}var n="";{var a;A.link&&A.title&&(a=(0,o.getDateInFormat)(1e3*A.time,!0),n+='\n
  • \n \n ').concat(t,' \n
    \n ').concat(a,' \n
    ').concat(A.title,"
    \n
    \n
    \n
  • "))}return n}:function(A){var t=i[A.type],e="";t&&(e+='\n
  • \n
    '.concat(A.text,'
    \n \n
    ').concat(t.text," - link
    \n
    \n
  • "));return e})(A)};var l={W:"#C00",K:"#0A122A",D:"#137333",S:"#CC9300",E:"#058ED9",P:"#0C0",A:"#00C",F:"#CC0"},i={D:{text:"Więcej o dywidendach",link:"#dywidendy"},S:{text:"Więcej wydarzeń ze spółki",link:"#kalendarium"},E:{text:"Więcej o emisjach akcji spółki”",link:"#akcjonariat"},P:{text:"Więcej o emisjach akcji spółki",link:"#akcjonariat"},A:{text:"Więcej wydarzeń ze spółki",link:"#kalendarium"},F:{text:"Więcej o finansach spółki",link:"#wyniki-finansowe"}}},{"./date-time":1}]},{},[2])(2)})}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./date-time":18}],21:[function(l,i,r){!function(e){!function(){"use strict";function t(A){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A})(A)}!function(A){"object"===(void 0===r?"undefined":t(r))&&void 0!==i?i.exports=A():("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:this).n2pb=A()}(function(){return function i(r,n,a){function s(t,A){if(!n[t]){if(!r[t]){var e="function"==typeof l&&l;if(!A&&e)return e(t,!0);if(o)return o(t,!0);throw(A=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",A}e=n[t]={exports:{}},r[t][0].call(e.exports,function(A){return s(r[t][1][A]||A)},e,e.exports,i,r,n,a)}return n[t].exports}for(var o="function"==typeof l&&l,A=0;A=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);et.low?t:A).low,close:t.close}}function l(A,t){var e=[];if(!A||A.length=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]=g(a[p],d))}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){for(var" i="v(t),t=new" date l h="l.value,c=Math.floor((h.time-a/1e3)/i);0<=c&&e[c]&&(e[c]=g(e[c],h))}}catch(A){_.e(A)}finally{_.f()}}return" s="v(t),t=new">=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]={time:a[p].time,value:a[p].value?a[p].value+d.value:d.value})}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){var" i='v(t);if("1min"===t)e=l(A,16);else' if r s="r.value,o=new" date o="r.value,l=new" _="e.toReversed(),h=0;h<a.length;h++)!function(){var" t="a[h],A=_.find(function(A){return" a.time mld global self window strict symbol symbol.iterator typeof function l error find module n range b a.length>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);et.low?t:A).low,close:t.close}}function l(A,t){var e=[];if(!A||A.length=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]=g(a[p],d))}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){for(var" i="v(t),t=new" date l h="l.value,c=Math.floor((h.time-a/1e3)/i);0<=c&&e[c]&&(e[c]=g(e[c],h))}}catch(A){_.e(A)}finally{_.f()}}return" s="v(t),t=new">=e?e:e-864e5,n=t.getTime()>=e?i:i-864e5,l=new Date(r-o).getTime(),_=new Date(n-o).getTime(),h=l/1e3;h<_ c d="c.value,p=Math.floor((d.time-l/1e3)/s);0<=p&&a[p]&&(a[p]={time:a[p].time,value:a[p].value?a[p].value+d.value:d.value})}}catch(A){u.e(A)}finally{u.f()}}return" a e="[];if(A&&!(A.length<1)){var" i='v(t);if("1min"===t)e=l(A,16);else' if r s="r.value,o=new" date o="r.value,l=new" _="e.toReversed(),h=0;h<a.length;h++)!function(){var" t="a[h],A=_.find(function(A){return" a.time mld self window symbol a.length n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:t};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,i=new Array(t);et.clientWidth-e.clientWidth-20&&(i=A.point.x-e.clientWidth-20)t.clientHeight-e.clientHeight-20?A.point.y-e.clientHeight-20:r}},e.getTooltipCoordinatePoint=function(A,t,e,i){var r=e.clientHeight,e=e.clientWidth,n=i.clientHeight,i=i.clientWidth,a=A+10+56;return a".concat(a,"")),' \n
    \n
    Kurs:
    \n
    '.concat(l,'').concat(n,"
    \n
    ")):(a="bond"===A.dataType?"Rentowność":"Kurs",' \n
    \n
    '.concat(a,':
    \n
    ').concat((0,u.getMld)(A.main.value,i,r),"
    \n
    "));else if(null!=(l=A.main)&&l.open||0===(null==(_=A.main)?void 0:_.open)){var n="bond"===A.dataType?"Najwyższa":"Najwyższy",a="bond"===A.dataType?"Najniższa":"Najniższy";e=' \n
    \n
    Otwarcie:
    \n
    '.concat((0,u.getMld)(A.main.open,i,r),'
    \n
    \n
    \n
    ').concat(n,':
    \n
    ').concat((0,u.getMld)(A.main.high,i,r),'
    \n
    \n
    \n
    ').concat(a,':
    \n
    ').concat((0,u.getMld)(A.main.low,i,r),'
    \n
    \n
    \n
    Zamknięcie:
    \n
    ').concat((0,u.getMld)(A.main.close,i,r),"
    \n
    ")}else if("fund"!==A.dataType)return"";var s,o,l="",_=(A.volume&&(l="fund"===A.dataType?'\n
    \n
    Aktywa:
    \n
    '.concat((0,u.getMld)(A.volume.value,i,2),"
    \n
    "):'\n
    \n
    Wolumen:
    \n
    '.concat((0,u.getMld)(A.volume.value," szt",0),"
    \n
    ")),"");return A.benchmark&&(n="--",n=(a="",u.getMld)(A.benchmark.value,"%",2),0".concat(i,"")),_='\n
    \n
    Benchmark:
    \n
    '.concat(r,'').concat(n,"
    \n
    ")),e||l||_?(r=i="",a=null,A.lastValue&&(null!=(n=A.main)&&n.value||0===(null==(n=A.main)?void 0:n.value))&&"fund"!==A.dataType&&(n=A.main.value,n="bond"===A.dataType?A.lastValue-n:100*(A.lastValue/n-1),o="bond"===A.dataType?(0,u.getMld)(n):(0,u.getMld)(n,"%",2),s="",0\n \n
    Zmiana do końca:
    \n
    ').concat(o,"
    \n ")),A.prevClose&&(null!=(n=A.main)&&n.value||0===(null==(s=A.main)?void 0:s.value))&&"fund"!==A.dataType&&(o=A.main.value,a="bond"===A.dataType?o-A.prevClose:100*(o/A.prevClose-1),n="bond"===A.dataType?(0,u.getMld)(a):(0,u.getMld)(a,"%",2),s="",0\n \n
    Zmiana od początku:
    \n
    ').concat(n,"
    \n ")),o="",A.markerType&&(a=h[A.markerType]||"Zdarzenie",o+='\n
    \n
    \n '.concat(a,"\n
    ")),'\n
    '.concat(t,'
    \n
    \n ').concat(e,"\n ").concat(_,"\n ").concat(l,"\n ").concat(r,"\n ").concat(i,"\n ").concat(o,"\n
    \n ")):""},e.getSeriesTooltipHtml=function(A){var t,e=d(A.param.time,A.intraday,A.interval),i="foreign_indicy"===A.dataType||"indicy"===A.dataType?2:4,r="",n=c(A.items);try{for(n.s();!(t=n.n()).done;){var a,s=t.value,o="--",l="",_=("number"==typeof s.change&&(o=(0,u.getMld)(s.change,"%",2),0".concat(a,"")),"");s.color&&(h='
    ')),r+=' \n
    \n '.concat(h,'\n
    ').concat(s.label||s.symbol,'
    \n
    ').concat(_,'').concat(o,"
    \n
    ")}}catch(A){n.e(A)}finally{n.f()}return A="",A=r?'\n
    '.concat(e,'
    \n
    \n ').concat(r,"\n
    \n "):A};var h={W:"Kliknij ⓘ - zobacz wiadomości",K:"Komunikat ESPI/EBI",D:"Dywidendy",S:"Split",E:"Emisja",P:"Prawo Poboru",A:"Walne Zgromadzenie Akcjonariuszy",F:"Wyniki Finansowe"}},{"./date-time":1,"./series":2}]},{},[3])(3)})}.call(this)}.call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./date-time":18,"./series":22}]},{},[11])(11)});