(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[85482,8775,5069],{111980:t=>{t.exports={"common-tooltip":"common-tooltip-EJBD96zX","common-tooltip--hidden":"common-tooltip--hidden-EJBD96zX","common-tooltip--horizontal":"common-tooltip--horizontal-EJBD96zX","common-tooltip--farther":"common-tooltip--farther-EJBD96zX","common-tooltip--vertical":"common-tooltip--vertical-EJBD96zX","common-tooltip-farther":"common-tooltip-farther-EJBD96zX","common-tooltip--direction_normal":"common-tooltip--direction_normal-EJBD96zX","common-tooltip__body":"common-tooltip__body-EJBD96zX","common-tooltip__button-container":"common-tooltip__button-container-EJBD96zX","common-tooltip__body--no-buttons":"common-tooltip__body--no-buttons-EJBD96zX","common-tooltip__button":"common-tooltip__button-EJBD96zX","common-tooltip--direction_reversed":"common-tooltip--direction_reversed-EJBD96zX","common-tooltip__ear-holder":"common-tooltip__ear-holder-EJBD96zX","common-tooltip__ear-holder--below":"common-tooltip__ear-holder--below-EJBD96zX","common-tooltip__ear-holder--above":"common-tooltip__ear-holder--above-EJBD96zX","common-tooltip__ear-holder--before":"common-tooltip__ear-holder--before-EJBD96zX","common-tooltip__ear-holder--after":"common-tooltip__ear-holder--after-EJBD96zX","common-tooltip__body--with-hotkey":"common-tooltip__body--with-hotkey-EJBD96zX","common-tooltip__body--width_wide":"common-tooltip__body--width_wide-EJBD96zX","common-tooltip__body--width_narrow":"common-tooltip__body--width_narrow-EJBD96zX","common-tooltip__body--no-padding":"common-tooltip__body--no-padding-EJBD96zX","common-tooltip__hotkey-block":"common-tooltip__hotkey-block-EJBD96zX","common-tooltip__hotkey-block--divider":"common-tooltip__hotkey-block--divider-EJBD96zX","common-tooltip__hotkey-text":"common-tooltip__hotkey-text-EJBD96zX","common-tooltip__hotkey-button":"common-tooltip__hotkey-button-EJBD96zX","common-tooltip__plus-sign":"common-tooltip__plus-sign-EJBD96zX"}},615559:(t,e,n)=>{"use strict";n.d(e,{ActionGroup:()=>o});var s=n(697939);class o{constructor(t,e){this._actions=new Map,this._manager=t,this.modal=!(!e||!e.modal),e&&(this.desc=e.desc),e&&e.isDisabled?"function"==typeof e.isDisabled?this.isDisabled=e.isDisabled:this.isDisabled=()=>!0:this.isDisabled=()=>!1,this._manager.registerGroup(this)}add(t){let e=this._actions.get(t.hotkey);e||(e=[],this._actions.set(t.hotkey,e));const n=new s.Action(this,t);return e.push(n),n}remove(t){const e=this._actions.get(t.hotkey);if(!e)return;const n=e.findIndex((e=>e===t));n>=0&&(1===e.length?this._actions.delete(t.hotkey):e.splice(n,1))}handleHotkey(t,e){const n=this._actions.get(t);if(!n)return!1;for(const s of n)if((!s.element||e.target&&s.element.contains(e.target))&&!s.isDisabled())return e.repeat&&!s.isRepeatAccepted||(s.handler(e),this._callMatchedHotkeyHandler(t)),e.preventDefault(),!0;return!1}promote(){this._manager.promoteGroup(this)}destroy(){for(const[,t]of this._actions)for(const e of t)e.destroy();this._actions.clear(),this._manager.unregisterGroup(this)} static setMatchedHotkeyHandler(t){o._matchedHotkeyHandler=t}_callMatchedHotkeyHandler(t){o._matchedHotkeyHandler&&o._matchedHotkeyHandler(t)}}},347136:(t,e,n)=>{"use strict";n.d(e,{ActionManager:()=>c});var s=n(91679),o=n(591800),i=n(607423),r=n(735594);class a extends s.WatchedValue{setValue(t,e){const n=this.value();(e||void 0===n||n.code!==t.code||n.modifiers!==t.modifiers)&&super.setValue(t)}}class c{constructor(){this._groups=[],this._pressedKeys=new s.WatchedValue(0),this._keyboardPressedKeysState=new a(new r.KeyboardPressedKeysState(0)),this._keyDownListener=t=>{if(t.defaultPrevented)return;const e=(0,o.hashFromEvent)(t);if(this._pressedKeys.setValue(e),this._keyboardPressedKeysState.setValue(new r.KeyboardPressedKeysState((0,o.modifiersFromEvent)(t),t.code)),!(0,i.isNativeUIInteraction)(e,t.target))for(let n=this._groups.length;n-- >0;){const s=this._groups[n];if(!s.isDisabled()){if(s.handleHotkey(e,t))return;if(s.modal)return}}},this._keyUpListener=t=>{const e=(0,o.hashFromEvent)(t);this._pressedKeys.setValue(e),this._keyboardPressedKeysState.setValue(new r.KeyboardPressedKeysState((0,o.modifiersFromEvent)(t),""))},this._blurEvent=()=>{this._pressedKeys.setValue(0),this._keyboardPressedKeysState.setValue(new r.KeyboardPressedKeysState(0,""))},this._mouseEvent=t=>{var e;const n=(0,o.modifiersFromEvent)(t),s=255&(null!==(e=this._pressedKeys.value())&&void 0!==e?e:0);this._pressedKeys.setValue(n|s)}}listen(t){t.addEventListener("keydown",this._keyDownListener),t.addEventListener("keyup",this._keyUpListener),t.addEventListener("blur",this._blurEvent),t.addEventListener("mousemove",this._mouseEvent)}unlisten(t){t.removeEventListener("keydown",this._keyDownListener),t.removeEventListener("keyup",this._keyUpListener),t.removeEventListener("blur",this._blurEvent),t.removeEventListener("mousemove",this._mouseEvent)}registerGroup(t){this._groups.push(t)}unregisterGroup(t){for(let e=this._groups.length;e--;)this._groups[e]===t&&this._groups.splice(e,1)}promoteGroup(t){let e=this._groups.length-1;for(let n=this._groups.length;n--;){if(this._groups[n]===t)return void(n!==e&&(this._groups.splice(n,1),this._groups.splice(e,0,t)));this._groups[n].modal&&(e=n-1)}}pressedKeys(){return this._pressedKeys.readonly()}keyboardPressedKeysState(){return this._keyboardPressedKeysState.readonly()}}},697939:(t,e,n)=>{"use strict";n.d(e,{Action:()=>s});class s{constructor(t,e){this._group=t;const{hotkey:n,handler:s,desc:o,isDisabled:i,element:r=null,isRepeatAccepted:a=!1}=e;this.hotkey=n,this.handler=s,this.desc=o,this.element=r,this.isRepeatAccepted=a,this.isDisabled=i?"function"==typeof i?i:()=>!0:()=>!1}destroy(){this._group&&(this._group.remove(this),this._group=null)}}},591800:(t,e,n)=>{"use strict";n.d(e,{Modifiers:()=>i,hashFromEvent:()=>a,hashShiftPlusEnter:()=>c,hotkeyHashToAriaKeyshortcuts:()=>m,humanReadableHash:()=>d,humanReadableModifiers:()=>l,isMacKeyboard:()=>o,modifiersFromEvent:()=>r});var s=n(167175);const o=s.isMac||s.isIOS;var i;function r(t){let e=0;return t.shiftKey&&(e+=1024),t.altKey&&(e+=512), t.ctrlKey&&(e+=256),t.metaKey&&(e+=2048),e}function a(t){return r(t)|t.keyCode}!function(t){t[t.None=0]="None",t[t.Alt=512]="Alt",t[t.Shift=1024]="Shift",t[t.Mod=o?2048:256]="Mod",t[t.Control=256]="Control",t[t.Meta=2048]="Meta"}(i||(i={}));const c=/^(25242|32026|99362)$/.test(n.j)?1037:null;function l(t,e=!o){let n="";return 256&t&&(n+=_(o?"^":"Ctrl",e)),512&t&&(n+=_(o?"⌥":"Alt",e)),1024&t&&(n+=_(o?"⇧":"Shift",e)),2048&t&&(n+=_(o?"⌘":"Win",e)),n}const h={9:"⇥",13:"↵",27:"Esc",8:o?"⌫":"Backspace",32:"Space",35:"End",36:"Home",37:"←",38:"↑",39:"→",40:"↓",45:"Ins",46:"Del",188:",",191:"/"},u={9:"Tab",13:"Enter",27:"Esc",8:"Backspace",32:"Space",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Ins",46:"Del",188:",",191:"/"};for(let t=1;t<=16;t++)h[t+111]=`F${t}`,u[t+111]=`F${t}`;function d(t){let e=l(t);const n=255&t;return e+=n in h?h[n]:String.fromCharCode(n),e}function _(t,e){return`${t}${e?" + ":o?" ":""}`}function m(t){const e=[];256&t&&e.push("Ctrl"),512&t&&e.push("Alt"),1024&t&&e.push("Shift"),2048&t&&e.push("Meta");const n=255&t;return n in h?e.push(h[n]):e.push(String.fromCharCode(n)),e.join("+")}},735594:(t,e,n)=>{"use strict";n.d(e,{KeyboardPressedKeysState:()=>o});var s=n(591800);class o{constructor(t,e){this.modifiers=t,this.code=e}altOrOptionCode(){return"AltLeft"===this.code||"AltRight"===this.code}controlOrMetaCode(){return s.isMacKeyboard?"MetaLeft"===this.code||"MetaRight"===this.code||"OSLeft"===this.code||"OSRight"===this.code:"ControlLeft"===this.code||"ControlRight"===this.code}}},607423:(t,e,n)=>{"use strict";n.d(e,{isNativeUIInteraction:()=>i,isTextEditingField:()=>o});var s=n(591800);function o(t){if("INPUT"===t.tagName){const e=t.type;return"text"===e||"email"===e||"number"===e||"password"===e||"search"===e||"tel"===e||"url"===e}return"TEXTAREA"===t.tagName||t.isContentEditable}function i(t,e){if(!e)return!1;const n=255&t;if(27===n||n>>>4==7)return!1;switch(t^n){case s.Modifiers.Alt:return(38===n||40===n)&&"SELECT"===e.tagName||o(e);case s.Modifiers.Alt+s.Modifiers.Shift:return o(e);case s.Modifiers.Mod:if(67===n||!s.isMacKeyboard&&45===n){const t=e.ownerDocument&&e.ownerDocument.getSelection();if(t&&!t.isCollapsed)return!0}return o(e);case s.Modifiers.Mod+s.Modifiers.Shift:return n>=33&&n<=40&&o(e);case s.Modifiers.Shift:case 0:return 9===n?!(!e.ownerDocument||e===e.ownerDocument.body||e===e.ownerDocument.documentElement):(!function(t){if("BUTTON"===t.tagName)return!0;if("INPUT"===t.tagName){const e=t.type;if("submit"===e||"button"===e||"reset"===e||"checkbox"===e||"radio"===e)return!0}return!1}(e)||13===n||32===n||9===n)&&("form"in e||e.isContentEditable)}return!1}},745269:(t,e,n)=>{"use strict";n.d(e,{CubicBezier:()=>i,color:()=>r,dur:()=>s,easingFunc:()=>o});const s=350,o={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t, easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};class i{constructor(t,e,n,s){this._mX1=t,this._mY1=e,this._mX2=n,this._mY2=s}easingFunc(t){return this._mX1===this._mY1&&this._mX2===this._mY2?t:this._calcBezier(this._getTForX(t))}_a(t,e){return 1-3*e+3*t}_b(t,e){return 3*e-6*t}_c(t){return 3*t}_calcBezier(t){return((this._a(this._mY1,this._mY2)*t+this._b(this._mY1,this._mY2))*t+this._c(this._mY1))*t}_getSlope(t){return 3*this._a(this._mX1,this._mX2)*t*t+2*this._b(this._mX1,this._mX2)*t+this._c(this._mX1)}_getTForX(t){let e=t;for(let n=0;n<4;++n){const n=this._getSlope(e);if(0===n)return e;e-=(this._calcBezier(e)-t)/n}return e}}const r={black70:"#4A4A4A",black80:"#535353"}},184277:(t,e,n)=>{"use strict";function s(t){return 0===t.detail}n.d(e,{isKeyboardClick:()=>s})},223124:(t,e,n)=>{"use strict";n.d(e,{isCancelled:()=>i,makeCancelable:()=>o});class s extends Error{constructor(){super("CancelToken")}}function o(t){let e=!1;return{promise:new Promise(((n,o)=>{t.then((t=>e?o(new s):n(t))),t.catch((t=>o(e?new s:t)))})),cancel(){e=!0}}}function i(t){return t instanceof s}},499994:(t,e,n)=>{"use strict";n.d(e,{getTooltipData:()=>o,setTooltipData:()=>i});const s=new WeakMap;function o(t,e){const n=s.get(t);return n instanceof Function?n(e):n&&n[e]}function i(t,e,n){if(n instanceof Function)return void s.set(t,n);const o=s.get(t),i=void 0===o||o instanceof Function?{}:o;i[e]=n,s.set(t,i)}},779527:(t,e,n)=>{"use strict";n.d(e,{getDataFromTarget:()=>m,getTooltip:()=>p,hideTooltip:()=>f,setStyle:()=>g,showTooltip:()=>v,updateTooltipTextFromTarget:()=>_});var s=n(650151),o=n(571690),i=n(31341),r=(n(586463),n(777466)),a=n(678515),c=n(638456),l=n(529111),h=n(499994),u=n(604286),d=n(111980);function _(t){const e=t.hasAttribute("data-tooltip")?t.getAttribute("data-tooltip"):t.getAttribute("title");return e&&((0,h.setTooltipData)(t,"text",e),t.removeAttribute("title")),(0,h.getTooltipData)(t,"text")||""}function m(t){const e=_(t),n=t.getBoundingClientRect(),s={h:n.height,w:n.width,x:n.left,y:n.top},o=t.getAttribute("data-color-theme")||"",i=t.classList.contains("common-tooltip-html"),r=parseInt(t.getAttribute("data-tooltip-delay")||""),a=parseInt(t.getAttribute("data-tooltip-debounce")||"");let c={type:"none"};return e&&(c={type:i?"html":"text",data:e}),{above:t.classList.contains("common-tooltip-above"),below:t.classList.contains("common-tooltip-below"),otl:t.classList.contains("common-tooltip-otl"),otr:t.classList.contains("common-tooltip-otr"),vertical:t.classList.contains("common-tooltip-vertical"),hotkey:t.getAttribute("data-tooltip-hotkey"),narrow:t.classList.contains("common-tooltip-narrow"),wide:t.classList.contains("common-tooltip-wide"),colorTheme:o,tooltipDelay:r,tooltipDebounce:a,rect:s,content:c,target:t}}function p(t){const e=(0,s.ensureNotNull)(C).cloneNode(!0),n=P(e),{content:o}=t;switch(o.type){case"element":n.innerHTML="",n.appendChild(o.data);break;case"html":n.innerHTML=o.data;break;case"text":if(t.hotkey){ const t=(0,s.ensureNotNull)(k).cloneNode(!0);t.innerText=o.data,n.appendChild(t)}else n.innerText=o.data}if(t.hotkey){const e="none"!==o.type,i=(0,s.ensureNotNull)(E).cloneNode(!0),r=(0,u.hotKeyDeserialize)(t.hotkey),a=r.keys.map((t=>`${t}`));i.innerHTML=function(t,e){const n=/{\d}|{hotkey_\d}/gi;return t.replace(n,(t=>{const n=Number(t.match(/\d/));return e[n]}))}(r.text,a).replace(/\s\+\s/g,`+`),n.classList.add(d["common-tooltip__body--with-hotkey"]),e&&i.classList.add(d["common-tooltip__hotkey-block--divider"]),n.appendChild(i)}return e.addEventListener("contextmenu",r.preventDefault),e}function g(t,e){const n=e.rect;if(!n)return;(0,l.setTooltipColorTheme)(t,e.colorTheme||"default"),e.addClass&&t.classList.add(e.addClass);const s=P(t),o=t.querySelector(`.${d["common-tooltip__button-container"]}`);s.classList.toggle(d["common-tooltip__body--width_wide"],Boolean(e.wide)),s.classList.toggle(d["common-tooltip__body--no-padding"],Boolean(e.noPadding)),s.classList.toggle(d["common-tooltip__body--width_narrow"],Boolean(e.narrow)),s.classList.toggle(d["common-tooltip__body--no-buttons"],!0),s.style.left=b(0),s.style.width=b(s.clientWidth+(Boolean(e.noPadding)?0:2));const r=document.body.clientWidth,h=c.CheckMobile.iOS()||c.CheckMobile.Android()||(0,c.supportTouch)()&&(0,c.isMac)()?window.innerHeight:document.body.clientHeight,u=e.vertical,_=e.extendMargin||u&&n.w<20||!u&&n.h<20;t.classList.toggle(d["common-tooltip--farther"],_),t.classList.toggle(d["common-tooltip--vertical"],u),t.classList.toggle(d["common-tooltip--horizontal"],!u);const m=function(t){return t.querySelector(`.${d["common-tooltip__ear-holder"]}`)}(t),p=t.offsetHeight;if(u){const c=10,l=h-10,u=12,_=c+u,g=l-u,v=(0,a.clamp)(n.y+n.h/2,_,g)-p/2,f=v+p;t.style.left=b(n.x+n.w),t.style.top=b(v),vl&&(s.style.top=o.style.top=b(l-f));const{right:y}=(t.querySelector(":last-child")||s).getBoundingClientRect(),S=y+10>r;t.classList.toggle(d["common-tooltip--direction_reversed"],S),t.classList.toggle(d["common-tooltip--direction_normal"],!S);let w=S?"after":"before";(0,i.isRtl)()?(w=e.otr?"after":w,w=e.otl?"before":w):(w=e.otr?"before":w,w=e.otl?"after":w),m.classList.toggle(d["common-tooltip__ear-holder--before"],"before"===w),m.classList.toggle(d["common-tooltip__ear-holder--after"],"after"===w),"after"===w&&(t.style.left="auto",t.style.right=b(r-n.x))}else{const i=n.x-(s.offsetWidth-n.w)/2,a=r-t.offsetWidth-20<=0?(r-t.offsetWidth)/2:10,c=r-a-t.offsetWidth,l=Math.max(a,Math.min(i,c));t.style.left=b(l);const u=c\n\t\t
\n\t\t\t
\n\t\t
\n\t\t
\n\t\n`,S=`\n\t
\n`,w=`\n\t
\n`,C=(0,o.parseHtmlElement)(y),E=(0,o.parseHtmlElement)(S),k=(0,o.parseHtmlElement)(w);function P(t){return t.querySelector(`.${d["common-tooltip__body"]}`)}function T(t,e){return 10+t{"use strict";n.d(e,{hotKeyDeserialize:()=>i,hotKeySerialize:()=>o});var s=n(919476);function o(t){return(0,s.htmlEscape)(JSON.stringify(t))}function i(t){return JSON.parse((0,s.decodeHTMLEntities)(t))}},630112:(t,e,n)=>{"use strict";n.d(e,{empty:()=>r,setTooltip:()=>a});const s="tooltip-root-element";let o;function i(){const t=document.getElementById(s);t?o=t:(o=document.createElement("div"),o.id=s,document.body.appendChild(o))}function r(){o&&(o.innerHTML="")}function a(t){r(),o&&o.appendChild(t)}"interactive"===document.readyState?i():document.addEventListener("DOMContentLoaded",i)},112539:(t,e,n)=>{"use strict";n.d(e,{clearSchedule:()=>r,scheduleHide:()=>c,scheduleRemove:()=>a,scheduleRender:()=>l});let s=0,o=0,i=0;function r(){clearTimeout(s),clearTimeout(o),clearTimeout(i)}function a(t,e){i=setTimeout(t,e)}function c(t,e){o=setTimeout(t,e)}function l(t,e){s=setTimeout(t,e)}},529111:(t,e,n)=>{"use strict";n.d(e,{setTooltipColorTheme:()=>i});const s={default:"",white:"theme-white",chart:"theme-chart","round-shadow":"theme-round-shadow"},o=Object.keys(s);function i(t,e){const n=o.includes(e)?s[e]:"";t.classList.remove(...o.map((t=>s[t])).filter((t=>!!t))),n&&!t.classList.contains(n)&&t.classList.add(n)}},673747:(t,e,n)=>{"use strict";n.r(e),n.d(e,{hide:()=>y,show:()=>m,showOnElement:()=>_,tempForceHide:()=>b,tooltipClickHandler:()=>g,updateTooltipText:()=>p});var s=n(778785),o=n(650151),i=n(799786),r=n(112539),a=n(630112),c=n(779527);let l=!1,h=null,u=null;s.mobiletouch||document.addEventListener("mouseover",(function(t){var e;if(null===(e=t.sourceCapabilities)||void 0===e?void 0:e.firesTouchEvents)return;const n=t.target,s=t.currentTarget,o=function(t,e,n){const s=[];for(;t&&t!==e;)t.classList&&t.classList.contains(n)&&s.push(t),t=t.parentElement||w(t.parentNode);return s}(n,s,"apply-common-tooltip"),r=()=>{u&&(u.destroy(),u=null)};for(const e of o){if("buttons"in t){if(1&t.buttons)continue }else if(1===t.which)continue;const n=()=>_(e);if(n()){const t=t=>s(null,!0),s=(o,i=!1)=>{e.removeEventListener("common-tooltip-update",n),e.removeEventListener("mouseleave",s),e.removeEventListener("mousedown",s),document.removeEventListener("scroll",t,{capture:!0}),r(),y(i)};e.addEventListener("common-tooltip-update",n),e.addEventListener("mouseleave",s),e.addEventListener("mousedown",s),document.addEventListener("scroll",t,{capture:!0}),null===u&&(u=(0,i.createGroup)({desc:"Tooltip"}),u.add({desc:"Hide",hotkey:27,handler:s}));break}}}),!0);const d=new MutationObserver((()=>{if(h&&h.options.target){let t;t="isConnected"in h.options.target?h.options.target.isConnected:document.body.contains(h.options.target),t||y()}})),_=(t,e={})=>{const{content:n,...s}=C(e),o=c.getDataFromTarget(t),i=Object.assign(o,s);return"none"!==n.type&&(i.content=n),!("none"===i.content.type&&!i.hotkey)&&(i.target=t,m(i),!0)},m=t=>{const e=C(t),n=c.getTooltip(e);if(h={options:e,element:n},(0,a.setTooltip)(n),(0,r.clearSchedule)(),!l)return c.hideTooltip(n),void(0,r.scheduleRender)((()=>S(n)),function(t){return"number"!=typeof t.tooltipDelay||isNaN(t.tooltipDelay)?500:t.tooltipDelay}(e));const{tooltipDebounce:s}=t;"number"!=typeof s||isNaN(s)?S(n):(0,r.scheduleRender)((()=>S(n)),s)},p=t=>c.updateTooltipTextFromTarget(t);function g(t){var e;s.mobiletouch&&(_(t.currentTarget,{tooltipDelay:0}),document.addEventListener("scroll",v),document.addEventListener("touchstart",v),window.addEventListener("orientationchange",v),null===(e=window.screen.orientation)||void 0===e||e.addEventListener("change",v))}function v(){var t;document.removeEventListener("scroll",v),document.removeEventListener("touchstart",v),window.removeEventListener("orientationchange",v),null===(t=window.screen.orientation)||void 0===t||t.removeEventListener("change",v),y()}function f(){(0,a.empty)(),l=!1,h=null}const b=()=>{if((0,r.clearSchedule)(),(0,o.ensureNotNull)(d).disconnect(),!h||!l)return;const{element:t}=h;c.hideTooltip(t),f()},y=(t,e)=>{if((0,r.clearSchedule)(),(0,o.ensureNotNull)(d).disconnect(),!h)return;if(!t&&!l)return;const{element:n,options:s}=h,i=()=>{n.removeEventListener("mouseleave",i),c.hideTooltip(n),t?f():(0,r.scheduleRemove)((()=>{f()}),250),null==e||e()};s.tooltipHideDelay?(0,r.scheduleHide)((()=>{n.querySelector(":hover")?n.addEventListener("mouseleave",i):i()}),s.tooltipHideDelay):i()};function S(t){const{options:e}=(0,o.ensureNotNull)(h);if(c.setStyle(t,e),c.showTooltip(t),(0,o.ensureNotNull)(d).observe(document,{childList:!0,subtree:!0}),l=!0,e.forceHideOnMove){const t=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),y()};document.addEventListener("mousemove",t),document.addEventListener("touchmove",t)}}function w(t){return t&&(t.nodeType===Node.ELEMENT_NODE?t:null)}function C(t){if(function(t){return"content"in t}(t))return t;const{inner:e,html:n,text:s,...o}=t;let i={type:"none"};return e&&(i={type:"element",data:e}),s&&(i={type:n?"html":"text",data:s}),{content:i,...o}}},347402:(t,e,n)=>{"use strict" ;n.d(e,{desktopVersionIsLess:()=>r,lessThan:()=>i});var s=n(638456);function o(t){const e=t.match(/^(\d+).(\d+).(\d+)/);if(!e)return null;const[,n,s,o]=e;return[parseInt(n),parseInt(s),parseInt(o)]}function i(t,e){const n=o(t),s=o(e);if(!n||!s)return!1;const[i,r,a]=n,[c,l,h]=s;return i!==c?i{"use strict";n.r(e),n.d(e,{Modifiers:()=>i.Modifiers,createGroup:()=>s.createGroup,keyboardPressedKeysState:()=>s.keyboardPressedKeysState,pressedKeys:()=>s.pressedKeys,registerWindow:()=>s.registerWindow,unregisterWindow:()=>s.unregisterWindow});var s=n(129592),o=n(615559),i=n(591800),r=n(345848);(0,s.registerWindow)(window),o.ActionGroup.setMatchedHotkeyHandler((t=>{(0,r.trackEvent)("Keyboard Shortcuts",(0,i.humanReadableHash)(t))}))},470316:(t,e,n)=>{"use strict";n.r(e),n.d(e,{Modifiers:()=>s.Modifiers,hashFromEvent:()=>s.hashFromEvent,hashShiftPlusEnter:()=>s.hashShiftPlusEnter,hotkeyHashToAriaKeyshortcuts:()=>s.hotkeyHashToAriaKeyshortcuts,humanReadableHash:()=>s.humanReadableHash,humanReadableModifiers:()=>s.humanReadableModifiers,isMacKeyboard:()=>s.isMacKeyboard,modifiersFromEvent:()=>s.modifiersFromEvent});var s=n(591800)},405069:(t,e,n)=>{"use strict";n.r(e),n.d(e,{pushStreamMultiplexer:()=>O});var s=n(226722),o=n(345848),i=n(49437),r=n(944454),a=n(175203),c=n(201089),l=n(650151),h=n(368654),u=n(440150);const d=(0,c.getLogger)("PersistentWebsocketTransport");class _ extends u.PersistentTransport{constructor(t,e){super(t,d,e)}sendMessage(t){this._connectionStatus.value()===r.ConnectionStatus.Open?this._socket?this._socket.send(t):d.logError("Something went wrong - code 0x3"):d.logWarn("Attempt to send message but connection is not opened")}_createNativeTransport(t){const e=new WebSocket(t);return e.binaryType="arraybuffer",e.addEventListener("error",this._socketErrorHandler),e.addEventListener("close",this._socketCloseHandler),e.addEventListener("open",this._socketOpenHandler),e.addEventListener("message",this._socketMessageHandler),e}_disconnectTransport(){if(null===this._socket)return;this._socket.removeEventListener("error",this._socketErrorHandler),this._socket.removeEventListener("close",this._socketCloseHandler),this._socket.removeEventListener("open",this._socketOpenHandler),this._socket.removeEventListener("message",this._socketMessageHandler),this._removeOnOfflineListener();const t=this._socket;this._socket=null,this._connectionStatus.setValue(r.ConnectionStatus.Closed),t.readyState!==WebSocket.CLOSED&&t.close()}}class m{constructor(t){this._queue=[],this._isWorking=!1,this._onResolve=()=>{this._queue.length>0&&this._createPromise(this._queue[0])},this._logger=t}enqueue(t){this._logger.logNormal(`Adding channel in stack. Queue size: ${this._queue.length}`),this._isWorking||this._createPromise(t),this._queue.push(t)}_createPromise(t){this._isWorking=!0,this._wrap(t).then(this._onResolve)}_wrap(t){return new Promise((e=>{ t().catch((t=>this._logger.logNormal(`Error when trying handling channel: ${t.message}`))).finally((()=>{this._isWorking=!1,this._queue.shift(),e()}))}))}}const p="PushStream",g=(0,c.getLogger)(p);var v;!function(t){t[t.EventSource=0]="EventSource",t[t.WebSocket=1]="WebSocket"}(v||(v={}));class f{constructor(t,e){this._channels=[],this._queue=new m(g),this._transport=e.transportType===v.EventSource?new h.PersistentEventSourceTransport(this._onPushStreamMessage.bind(this)):new _(this._onPushStreamMessage.bind(this),this._onPushStreamClose.bind(this)),this._settings=e,this._messageHandler=t}addChannel(t){this._queue.enqueue((()=>this._addChannel(t)))}removeChannel(t){this._queue.enqueue((()=>this._removeChannel(t)))}getChannels(){return this._channels}hasChannel(t){return-1!==this._channels.indexOf(t)}connectionStatus(){return this._transport.connectionStatus()}reconnectEvent(){return this._transport.successReconnectReachedEvent()}connect(){(0,l.assert)(0!==this._channels.length,"There is no channels"),this._transport.connect()}disconnect(){this._transport.disconnect()}getLogs(t){return(0,c.getRawLogHistory)(t,p)}async _addChannel(t){(0,l.assert)(!this.hasChannel(t),`Channel with name ${t} has already been subscribed`),g.logNormal(`Adding channel ${t}`),this._channels.push(t);const{maxSize:e}=this._settings;return void 0!==e&&this._channels.length>e&&(this._channels=this._channels.slice(this._channels.length-e)),this._transport.setUrl(this._generateUrl())}async _removeChannel(t){const e=this._channels.indexOf(t);return(0,l.assert)(-1!==e,`There is no channel with name ${t}`),g.logNormal(`Removing channel ${t}`),this._channels.splice(e,1),this._transport.setUrl(this._generateUrl())}_onPushStreamMessage(t){if("string"!=typeof t)throw new Error("Wrong message type, expected string");const e=JSON.parse(t),n=e.id,s=e.channel;-2===n?g.logWarn("Received unexpected message: about removed the channel"):n>0&&(g.logDebug(`Received message: id="${n}" channel="${s}"`),this._messageHandler(e.text,n,s))}_onPushStreamClose(t){1005===t.code&&a.telemetry.sendChartReport("websocket_code_1005")}_generateUrl(){const t=this._channels.join("/");return g.logNormal(`Generate pushstream url - ${t}`),`${this._settings.url}/${this._settings.urlPath}/${t}`}}n(659863);class b{constructor(){this._handlers={},this._specialHandlers={}}on(t,e){const n=this._isSpecialChannel(t)?this._specialHandlers:this._handlers;n[t]||(n[t]=[]),n[t].push(e)}off(t,e){const n=this._isSpecialChannel(t)?this._specialHandlers:this._handlers;if(!(t in n))return;if(void 0===e)return void delete n[t];const s=n[t].indexOf(e);s>=0&&n[t].splice(s,1)}emit(t,e,n,s){this._handlers[n]&&this._handlers[n].forEach((o=>{o(t,e,n,s)}));for(const o of Object.keys(this._specialHandlers)){const i="^"+o.replace(/\*/g,".*?")+"$";new RegExp(i).test(n)&&this._specialHandlers[o].forEach((o=>{o(t,e,n,s)}))}}_isSpecialChannel(t){return/\*/.test(t)}}var y=n(125226),S=n(541558),w=n(314802),C=n(707957),E=n(268222),k=n(167175);function P(){return!k.isIOS&&!k.isIPad&&void 0!==navigator.locks}class T{ constructor(){this._id=(0,S.guid)(),this._state={[this._id]:{}},this._xEventPrefix="multiplexer-state-",this._xEventCreateTab=this._xEventPrefix+"create-new-tab",this._xEventShareState=this._xEventPrefix+"share-state",this._lockName="tab_destruction",this._stateChangeDelegate=new C.Delegate,this._createdLocks={},this._lockEnabled=P(),this._lockPromise=(0,E.createDeferredPromise)(),this._onTabCreateCb=null,this._onTabCreate=t=>{this._onTabCreateCb&&this._onTabCreateCb();const e=JSON.parse(t);this._state[e]={},this._shareState(),this._requestTabRemoveLock(e)},this._shareState=()=>{const t=JSON.stringify([this._id,this._state[this._id]]);s.TVXWindowEvents.emit(this._xEventShareState,t)},this._requestTabRemoveLock=t=>{!this._createdLocks[t]&&this._lockEnabled&&(this._createdLocks[t]=1,navigator.locks.request(`${this._lockName}_${t}`,(async()=>{const e=this._state[t]||{};this._compareTabState(t,{},e,"add"),this._compareTabState(t,e,{},"remove"),delete this._state[t],delete this._createdLocks[t]})))},this._onShareStateFromOther=t=>{const[e,n]=JSON.parse(t),s=this._state[e]||{};this._compareTabState(e,n,s,"add"),this._compareTabState(e,s,n,"remove"),this._state[e]=n,this._requestTabRemoveLock(e)},this._removeChannel=(t,e)=>{delete this._state[this._id][t][e],this._isListenByAnotherTab(t,e)||this._stateChangeDelegate.fire("remove",t,e);0===Object.keys(this._state[this._id][t]).length&&delete this._state[this._id][t]},s.TVXWindowEvents.on(this._xEventCreateTab,this._onTabCreate),s.TVXWindowEvents.on(this._xEventShareState,this._onShareStateFromOther),this._lockEnabled&&navigator.locks.request(`${this._lockName}_${this._id}`,(async()=>(s.TVXWindowEvents.emit(this._xEventCreateTab,JSON.stringify(this._id)),window.addEventListener("beforeunload",(()=>this._lockPromise.resolve())),this._lockPromise.promise)))}addChannel(t,e){this._isNotEmpty(t,e)?this._state[this._id][t][e]++:(this._state[this._id][t]||(this._state[this._id][t]={}),this._state[this._id][t][e]=1),this._isListenByAnotherTab(t,e)||this._stateChangeDelegate.fire("add",t,e),this._shareState()}removeChannel(t,e){this._isExist(t,e)&&(this._state[this._id][t][e]--,this._isNotEmpty(t,e)||this._removeChannel(t,e),this._shareState())}collectPushStreamChannels(t){const e=new Set;return Object.keys(this._state).forEach((n=>{const s=this._state[n][t];this._state[n][t]&&Object.keys(s).forEach((t=>e.add(t)))})),Array.from(e)}onStateChange(t){this._stateChangeDelegate.subscribe(null,t)}offStateChange(t){this._stateChangeDelegate.unsubscribe(null,t)}onTabCreate(t){this._onTabCreateCb=t}_isExist(t,e,n=this._id){return void 0!==this._state[n]&&void 0!==this._state[n][t]&&void 0!==this._state[n][t][e]}_isNotEmpty(t,e,n=this._id){return this._isExist(t,e,n)&&this._state[n][t][e]>0}_compareTabState(t,e,n,s){Object.keys(e).forEach((o=>{Object.keys(e[o]).forEach((e=>{this._isListenByAnotherTab(o,e,t)||n[o]&&n[o][e]||this._stateChangeDelegate.fire(s,o,e)}))}))}_isListenByAnotherTab(t,e,n=this._id){return Object.keys(this._state).some((s=>s!==n&&this._isNotEmpty(t,e,s)))}}const L=(0, c.getLogger)(p),x={url:window.PUSHSTREAM_URL,urlPath:"message-pipe-ws",transportType:v.WebSocket},R={url:window.PUSHSTREAM_URL.replace("wss://","https://"),urlPath:"message-pipe-es",transportType:v.EventSource};class D{constructor(){var t;this.guid=(0,S.guid)(),this._pushStreamPublic=null,this._pushStreamPrivate=null,this._statusHandlers=[],this._reconnectHandlers=[],this._userPrivateChannel=null,this._channelMultiplexer=new b,this._xEventPrefix="multiplexer-bc-",this._storagePrefix="pushStreamMultiplexerState.",this._userChannelPrefix="private_",this._statusPublic=r.ConnectionStatus.Closed,this._statusPrivate=r.ConnectionStatus.Closed,this._xEventSend=this._xEventPrefix+"send",this._xEventConnectionStatus=this._xEventPrefix+"connectionStatus",this._xEventReconnectCommand=this._xEventPrefix+"reconnectCommand",this._xEventReconnectSuccess=this._xEventPrefix+"reconnectSuccess",this._xEventRequestLogs=this._xEventPrefix+"requestLogs",this._xEventShareLogs=this._xEventPrefix+"shareLogs",this._state=new T,this._shareLogsKey=this._storagePrefix+"shareLogs",this._lockName="pushstream",this._lockPromise=(0,E.createDeferredPromise)(),this._dispatchReconnectSuccessCommandFromOther=t=>{if(this.ownPushStream())return;const[e]=this._decodeParams(t);this._callReconnectHandlers(e)},this._dispatchMessage=(t,e,n)=>{this._dispatchMessageToOthers(t,e,n),this._dispatchMessageToSelf(t,e,n,!1)},this._dispatchMessageFromOther=t=>{if(this.ownPushStream())return;const[e,n,s]=this._decodeParams(t);this._dispatchMessageToSelf(e,n,s,!0)},this._dispatchStatusChangeFromOther=t=>{const e=this._decodeConnectionStatus(t),n=e[0],s=e[1];this.ownPushStream()||this._dispatchStatusChangeToSelf(n,s)},this._dispatchReconnectCommandFromOther=()=>{this.ownPushStream()&&this.forceConnect()},this._onRequestLogs=()=>{if(this.ownPushStream()){const t=this._getOwnLogs();let e="";try{e=JSON.stringify(t)}catch(t){L.logError("Failed to stringify own pushstream logs")}i.TVLocalStorage.setItem(this._shareLogsKey,e),s.TVXWindowEvents.emit(this._xEventShareLogs,e)}},this._onStateChange=(t,e,n)=>{const s="private"===e?this._pushStreamPrivate:this._pushStreamPublic;"add"===t?null==s||s.addChannel(n):null==s||s.removeChannel(n)},this._onNewTabCreate=()=>{this._dispatchStatusChangeToOthers(this._statusPublic,this._statusPrivate)},P()?navigator.locks.request(this._lockName,(async()=>(this._state.onStateChange(this._onStateChange),this._state.onTabCreate(this._onNewTabCreate),this._instantiatePushStream(),window.addEventListener("beforeunload",(()=>this._lockPromise.resolve())),this._lockPromise.promise))):(this._state.onStateChange(this._onStateChange),this._instantiatePushStream()),s.TVXWindowEvents.on(this._xEventSend,this._dispatchMessageFromOther),s.TVXWindowEvents.on(this._xEventConnectionStatus,this._dispatchStatusChangeFromOther),s.TVXWindowEvents.on(this._xEventReconnectCommand,this._dispatchReconnectCommandFromOther),s.TVXWindowEvents.on(this._xEventReconnectSuccess,this._dispatchReconnectSuccessCommandFromOther), s.TVXWindowEvents.on(this._xEventRequestLogs,this._onRequestLogs),t=()=>{window.loginStateChange&&window.loginStateChange.subscribe(this,this._changeLoginState)},"loading"!==document.readyState?t():document.addEventListener("DOMContentLoaded",t)}on(t,e){this._channelMultiplexer.on(t,e)}off(t,e){this._channelMultiplexer.off(t,e)}onStatus(t){this._statusHandlers.push({handler:t,isPrivate:!1}),setTimeout((()=>t(this._statusPublic)),0)}onPrivateStatus(t){this._statusHandlers.push({handler:t,isPrivate:!0}),setTimeout((()=>t(this._statusPrivate)),0)}onReconnect(t,e=!1){this._reconnectHandlers.push({handler:t,isPrivate:e})}offReconnect(t){this._reconnectHandlers=this._reconnectHandlers.filter((e=>e.handler!==t))}offStatus(t){this._statusHandlers=this._statusHandlers.filter((e=>e.handler!==t))}forceConnect(){var t,e;L.logNormal(`Creating pushstream connection after force connect. Main tab: ${this.ownPushStream()}`),this.ownPushStream()?(null===(t=this._pushStreamPublic)||void 0===t||t.disconnect(),null===(e=this._pushStreamPrivate)||void 0===e||e.disconnect(),this._instantiatePushStream()):s.TVXWindowEvents.emit(this._xEventReconnectCommand)}disconnect(){this.ownPushStream()&&this._destructPushStream()}getLogs(t){return new Promise((e=>{const n=setTimeout((()=>{const t=i.TVLocalStorage.getItem(this._shareLogsKey);e(null!==t?JSON.parse(t):[])}),1e3),o=t=>{let i;s.TVXWindowEvents.off(this._xEventShareLogs,o),s.TVXWindowEvents.emit(this._xEventShareLogs,""),clearTimeout(n);try{i=JSON.parse(t)}catch(t){i=[],L.logError("Failed to parse logs received from master tab")}e(i)};this.ownPushStream()?e(this._getOwnLogs(t)):(s.TVXWindowEvents.on(this._xEventShareLogs,o),s.TVXWindowEvents.emit(this._xEventRequestLogs))}))}ownPushStream(){return!!this._pushStreamPublic||!!this._pushStreamPrivate}pushStream(){if(!this.ownPushStream())throw new Error("Not own PushStream");return this._pushStreamPublic}isConnected(){return this._statusPublic>0}status(){var t;return null!==(t=this._statusPublic)&&void 0!==t?t:r.ConnectionStatus.Closed}statusPrivate(){var t;return null!==(t=this._statusPrivate)&&void 0!==t?t:r.ConnectionStatus.Closed}userChannel(){if(!this._userPrivateChannel)throw new Error("No user channel");return this._userChannel(this._userPrivateChannel)}addChannel(t){this._state.addChannel(t.startsWith(this._userChannelPrefix)?"private":"public",t)}removeChannel(t){this._state.removeChannel(t.startsWith(this._userChannelPrefix)?"private":"public",t)}static getInstance(){return null===this._instance&&(this._instance=new D),this._instance}_userChannel(t){return this._userChannelPrefix+t}_codeParams(t){const e=[...t];return e.push((new Date).getTime()),JSON.stringify(e)}_decodeParams(t){const e=JSON.parse(t);return e.pop(),e}_instantiatePushStream(){this._pushStreamPublic&&((0,o.trackEvent)("PushstreamDoublePublic",window.user&&window.user.username||"Guest",navigator.userAgent),this._pushStreamPublic.disconnect());const t=this._getPushStreamSettings();this._pushStreamPublic=new f(this._dispatchMessage,t), this._pushStreamPublic.connectionStatus().subscribe((t=>{this._dispatchStatusChange(t,this._statusPrivate)})),this._pushStreamPublic.reconnectEvent().subscribe(null,(()=>{this._dispatchReconnectSuccessCommand()})),this._pushStreamPrivate&&((0,o.trackEvent)("PushstreamDoublePrivate",window.user&&window.user.username||"Guest",navigator.userAgent),this._pushStreamPrivate.disconnect()),this._pushStreamPrivate=new f(this._dispatchMessage,{...t,maxSize:1}),this._pushStreamPrivate.connectionStatus().subscribe((t=>{this._dispatchStatusChange(this._statusPublic,t)})),this._pushStreamPrivate.reconnectEvent().subscribe(null,(()=>{this._dispatchReconnectSuccessCommand(!0)})),this.on("pushstream_set_user_channel",(t=>{this._setUserChannel(t)})),this._connectChannels()}_destructPushStream(){const t=this._pushStreamPublic;this._pushStreamPublic=null,null==t||t.disconnect();const e=this._pushStreamPrivate;this._pushStreamPrivate=null,null==e||e.disconnect(),this._dispatchStatusChangeFromOther(this._codeParams([r.ConnectionStatus.Closed,r.ConnectionStatus.Closed]))}_connectChannels(){var t,e;null===(t=this._pushStreamPublic)||void 0===t||t.addChannel("public");const n=this._state.collectPushStreamChannels("public");void 0!==n&&n.length>0&&n.map((t=>{var e;return null===(e=this._pushStreamPublic)||void 0===e?void 0:e.addChannel(t)})),"is_authenticated"in window?this._connectUserChannelInitial(!0):window.loginStateChange&&window.loginStateChange.subscribe(this,this._connectUserChannelInitial),this._isPublicPushstreamEnabled()&&(null===(e=this._pushStreamPublic)||void 0===e||e.connect())}_getPushStreamSettings(){return(0,w.isOnMobileAppPage)("any")?(0,y.isFeatureEnabled)("enable_eventsource_pushstream_mobile")?R:x:(0,y.isFeatureEnabled)("enable_eventsource_pushstream_transport")?R:x}_isPublicPushstreamEnabled(){return(0,w.isOnMobileAppPage)("any")||!(0,y.isFeatureEnabled)("disable_pushstream_connections_for_anonymous_users")||window.is_authenticated||window.TradingView.onChartPage}_connectUserChannelInitial(t){var e,n,s;t&&(window.is_authenticated?(this._userPrivateChannel=null!==(e=window.user.private_channel)&&void 0!==e?e:null,null===(n=this._pushStreamPrivate)||void 0===n||n.addChannel(this.userChannel()),null===(s=this._pushStreamPrivate)||void 0===s||s.connect()):this._userPrivateChannel=null)}_changeLoginState(t){var e,n,s,o,i,r;t||(this._isPublicPushstreamEnabled()&&(null===(e=this._pushStreamPublic)||void 0===e||e.connect()),window.is_authenticated?(this._userPrivateChannel=null!==(n=window.user.private_channel)&&void 0!==n?n:null,this.ownPushStream()&&(null===(s=this._pushStreamPrivate)||void 0===s||s.addChannel(this.userChannel()),null===(o=this._pushStreamPrivate)||void 0===o||o.connect())):(this.ownPushStream()&&(null===(i=this._pushStreamPrivate)||void 0===i||i.removeChannel(this.userChannel()),null===(r=this._pushStreamPrivate)||void 0===r||r.disconnect()),this._userPrivateChannel=null))}_setUserChannel(t){var e,n;L.logNormal("Set user channel "+t), t!==this._userPrivateChannel&&(this.ownPushStream()&&this._userPrivateChannel&&(null===(e=this._pushStreamPrivate)||void 0===e||e.removeChannel(this.userChannel())),this._userPrivateChannel=t,this.ownPushStream()&&this._userPrivateChannel&&(null===(n=this._pushStreamPrivate)||void 0===n||n.addChannel(this.userChannel())))}_dispatchStatusChange(t,e){this._dispatchStatusChangeToOthers(t,e),this._dispatchStatusChangeToSelf(t,e)}_dispatchStatusChangeToSelf(t,e){t!==this._statusPublic&&(this._statusPublic=t,this._callStatusHandlers(t,!1)),e!==this._statusPrivate&&(this._statusPrivate=e,this._callStatusHandlers(e,!0))}_callStatusHandlers(t,e){L.logNormal("Connection status change: "+t+", private "+e+", is main tab "+this.ownPushStream()),a.telemetry.sendReport("site","pushstream_status_change"),this._statusHandlers.forEach((n=>{n.isPrivate===e&&n.handler(t)}))}_callReconnectHandlers(t){L.logNormal("Reconnection has been made"),this._reconnectHandlers.forEach((e=>{e.isPrivate===t&&e.handler()}))}_dispatchReconnectSuccessCommand(t=!1){if(this.ownPushStream()){this._callReconnectHandlers(t);const e=this._codeParams([t]);s.TVXWindowEvents.emit(this._xEventReconnectSuccess,e)}}_decodeConnectionStatus(t){const e=parseInt(t,10);return isNaN(e)?this._decodeParams(t):[e,e]}_dispatchStatusChangeToOthers(t,e){if(this.ownPushStream()){const n=this._codeParams([t,e]);s.TVXWindowEvents.emit(this._xEventConnectionStatus,n)}}_dispatchMessageToSelf(t,e,n,s){const o=t.channel,i=t.content;this._emit(i,e,o,s)}_dispatchMessageToOthers(t,e,n){const o=[t,e,n];s.TVXWindowEvents.emit(this._xEventSend,this._codeParams(o))}_emit(t,e,n,s){this._channelMultiplexer.emit(t,e,n,s)}_getOwnLogs(t){var e;if(this.ownPushStream()){const n=(0,c.getRawLogHistory)(t,p),s=null===(e=this.pushStream())||void 0===e?void 0:e.getLogs();return[].concat(n,null!=s?s:[])}return[]}}D._instance=null;const O=D.getInstance()},776734:(t,e,n)=>{"use strict";async function s(){if(!window.user||window.user.do_not_track)return null;{const t=(await Promise.all([n.e(70056),n.e(24081)]).then(n.bind(n,823623))).getTrackerInstance();return t||null}}n.d(e,{getTracker:()=>s})},86746:(t,e,n)=>{"use strict";n.r(e),n.d(e,{StdTheme:()=>a.StdTheme,getStdChartTheme:()=>m,getStdThemeNames:()=>_,getThemeNameIfStdTheme:()=>v,isStdTheme:()=>g,overrideStdTheme:()=>u,translateThemeName:()=>p});var s=n(444372),o=n(724377),i=n(979706),r=n(746518),a=n(61499);let c=/^(25242|32026|99362)$/.test(n.j)?i:null,l=/^(25242|32026|99362)$/.test(n.j)?r:null;function h(t,e){const n={...t};for(const s in e)"object"!=typeof t[s]||null===t[s]||Array.isArray(t[s])?void 0!==e[s]&&(n[s]=e[s]):n[s]=h(t[s],e[s]);return n}function u(t,e){switch(t){case a.StdTheme.Light:c=h(c,e);break;case a.StdTheme.Dark:l=h(l,e)}}function d(){return{[a.StdTheme.Light]:JSON.parse(JSON.stringify(c)),[a.StdTheme.Dark]:JSON.parse(JSON.stringify(l))}}function _(){return[a.StdTheme.Light,a.StdTheme.Dark]}function m(t){return d()[t]}function p(t){return{[a.StdTheme.Light]:s.t(null,{context:"colorThemeName"},n(669841)), [a.StdTheme.Dark]:s.t(null,{context:"colorThemeName"},n(14642))}[t]||t}function g(t){const e=d();return _().some((n=>f(e[n],t)))}function v(t){const e=d(),n=_();for(const s of n)if(f(e[s],t))return s;return null}function f(t,e){let n=t.content===e.content;return function(t={},e){try{b(t,[],e)}catch(t){return}}(t.content,((t,s)=>{const i=function(t,e={}){let n=e;for(let e=0;e{"use strict";n.d(e,{trackEvent:()=>c});var s=n(251954),o=n(244842);const i=(0,n(201089).getLogger)("Common.TrackEvent"),r=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/];let a=!1;const c=(t,e,n)=>{if(a)return;if(o.enabled("charting_library_base"))return void((t,e,n)=>{e=e||t||n||"";let o="";for(let t=0;t{"use strict";n.d(e,{tradingService:()=>i,waitTradingService:()=>r});var s=n(564894);const o={id:"TradingService"};function i(){return(0,s.hasService)(o)?(0,s.service)(o):null}function r(){return(0,s.waitServiceRegistered)(o)}},368654:(t,e,n)=>{"use strict";n.d(e,{PersistentEventSourceTransport:()=>r});var s=n(944454),o=n(440150);const i=(0,n(201089).getLogger)("PersistentWebsocketTransport");class r extends o.PersistentTransport{constructor(t){super(t,i),this._specializedErrorHandlerBound=this._specializedErrorHandler.bind(this)}_createNativeTransport(t){const e=new EventSource(t,{withCredentials:!0});return e.addEventListener("error",this._specializedErrorHandlerBound),e.addEventListener("open",this._socketOpenHandler),e.addEventListener("message",this._socketMessageHandler),e}_disconnectTransport(){if(null===this._socket)return;this._socket.removeEventListener("error",this._specializedErrorHandlerBound),this._socket.removeEventListener("open",this._socketOpenHandler),this._socket.removeEventListener("message",this._socketMessageHandler),this._removeOnOfflineListener();const t=this._socket;this._socket=null,this._connectionStatus.setValue(s.ConnectionStatus.Closed),t.readyState!==WebSocket.CLOSED&&t.close()}_specializedErrorHandler(t){ t.eventPhase===EventSource.CLOSED?this._socketCloseHandler(t):this._socketErrorHandler()}}},440150:(t,e,n)=>{"use strict";n.d(e,{PersistentTransport:()=>c});var s=n(944454),o=n(978137),i=n(401580),r=n(707957),a=n(266325);class c{constructor(t,e,n){this._url="",this._socket=null,this._reconnectCount=0,this._onlineCancellationToken=null,this._connectionStatus=new i.WatchedValue(s.ConnectionStatus.Closed),this._socketCloseHandler=this._onCloseCallback.bind(this),this._socketErrorHandler=this._onErrorCallback.bind(this),this._socketOpenHandler=this._onOpenCallback.bind(this),this._socketMessageHandler=this._onMessageCallback.bind(this),this._maxReconnectReachedEventDelegate=new r.Delegate,this._successReconnectReachedEventDelegate=new r.Delegate,this._shouldReconnect=!0,this._maxReconnectCount=null,this._reconnectTimeoutId=0,this._connectAbortController=null,this._tryReconnect=()=>{if(this._disconnect(),this._shouldReconnect){const t=this._getReconnectTimeout();this._logger.logNormal(`Sleeping some time before reconnect ${t}ms`),this._reconnectTimeoutId=setTimeout(this._tryReconnectImpl.bind(this),t)}else this._logger.logNormal("Skip reconnecting because of shouldReconnect state")},this._onOfflineHandler=()=>{this._removeOnOfflineListener(),this._logger.logInfo("Network status changed to offline - trying to reconnect"),this._tryReconnect()},this._logger=e,this._messageHandler=t,this._closeHandler=n,window.addEventListener("unload",(()=>{e.logNormal("Unload event comes - disconnecting without reconnect after that..."),this._shouldReconnect=!1,this._disconnect()}),!1)}setUrl(t){if(this._url===t)return Promise.resolve();const e=this._connectionStatus.value()!==s.ConnectionStatus.Closed;return e&&this._disconnect(),this._url=t,e?this.connect():Promise.resolve()}url(){return this._url}connect(){return this._connectImpl()}setMaxReconnectCount(t){this._maxReconnectCount=t}connectionStatus(){return this._connectionStatus.readonly()}disconnect(){this._shouldReconnect=!1,this._disconnect()}maxReconnectReachedEvent(){return this._maxReconnectReachedEventDelegate}successReconnectReachedEvent(){return this._successReconnectReachedEventDelegate}async _prepareParamsForConnection(t){}_disconnect(){var t;null===(t=this._connectAbortController)||void 0===t||t.abort(),this._connectAbortController=null,clearTimeout(this._reconnectTimeoutId),this._reconnectTimeoutId=0,this._connectionStatus.value()!==s.ConnectionStatus.Closed?this._socket?(this._logger.logNormal(`Closing connection to: ${this._socket.url}, currentStatus: ${s.ConnectionStatus[this._connectionStatus.value()]}`),this._disconnectTransport()):this._logger.logNormal("Disconnecting without socket - probably within preparing, it should be already scheduled for aborting"):this._logger.logNormal("Attempt to close connection but it is closed already")}_onErrorCallback(){this._logger.logInfo("Connection is closed by error"),this._tryReconnect()}_onCloseCallback(t){var e;this._logger.logInfo(`Connection is closed - code=${t.code} msg=${t.reason}`), null===(e=this._closeHandler)||void 0===e||e.call(this,t),this._tryReconnect()}_tryReconnectImpl(){return null!==this._maxReconnectCount&&this._reconnectCount===this._maxReconnectCount?(this._logger.logWarn("Maximum attempts to reconnect to websocket reached"),void this._maxReconnectReachedEventDelegate.fire()):(this._reconnectCount+=1,this._logger.logInfo(`Reconnecting count: ${this._reconnectCount}`),navigator.onLine?(this._logger.logInfo("Network status: online - trying to connect"),void this.connect()):(this._logger.logInfo("Network status: offline - wait until online"),void(this._onlineCancellationToken=(0,o.callWhenOnline)((()=>{this._logger.logInfo("Network status changed to online - trying to connect"),this.connect()})))))}_onOpenCallback(){this._logger.logNormal("Connection opened"),this._reconnectCount>0&&this._successReconnectReachedEventDelegate.fire(),this._reconnectCount=0,this._connectionStatus.setValue(s.ConnectionStatus.Open)}_onMessageCallback(t){this._messageHandler(t.data)}_getReconnectTimeout(){return this._reconnectCount<5?300:5e3}_setOnOfflineListener(){window.addEventListener("offline",this._onOfflineHandler)}_removeOnOfflineListener(){window.removeEventListener("offline",this._onOfflineHandler)}async _connectImpl(){if(this._connectionStatus.value()!==s.ConnectionStatus.Closed)return void this._logger.logNormal("Attempt to open connection but it is not closed");this._socket&&(this._logger.logError("Something went wrong - code 0x2"),this.disconnect()),this._onlineCancellationToken&&(this._onlineCancellationToken(),this._onlineCancellationToken=null),this._logger.logNormal(`Connecting to ${this._url}`),this._shouldReconnect=!0,this._connectAbortController=new AbortController;const t=this._connectAbortController.signal;try{if(this._connectionStatus.setValue(s.ConnectionStatus.Connecting),await this._prepareParamsForConnection(t),t.aborted)throw(0,a.createAbortError)();this._socket=this._createNativeTransport(this._url),this._setOnOfflineListener()}catch(t){this._connectionStatus.setValue(s.ConnectionStatus.Closed),(0,a.skipAbortError)(t)}finally{this._connectAbortController=null}}}},81979:(t,e,n)=>{"use strict";n.r(e),n.d(e,{CubicBezier:()=>s.CubicBezier,color:()=>s.color,dur:()=>s.dur,easingFunc:()=>s.easingFunc});var s=n(745269)},924335:(t,e,n)=>{"use strict";n.d(e,{LastChanceType:()=>i,OFFERS:()=>s,OfferKind:()=>o});const s={trial:"trial",early_access:"early_access",black_friday:"black_friday",cyber_monday:"cyber_monday",custom_discount:"custom_discount",longer_cycle:"longer_cycle",upgrade:"upgrade",extend:"extend",last_chance:"last_chance",one_usd:"one_usd",three_months:"three_months",unsubscribe:"unsubscribe",six_months:"six_months",coupon:"coupon"},o={early_access:"early_access",black_friday:"black_friday",last_chance:"last_chance",one_usd:"1 usd offer",three_months:"3 months offer",six_months:"six_months",unsubscribe:"unsubscribe",custom_discount:"custom_discount"};var i;!function(t){t.TwoWeeks="LastChance_2w",t.TwoDays="LastChance_2d",t.Hours="LastChance_24h"}(i||(i={}))}, 403009:(t,e,n)=>{"use strict";var s;function o(t){return!(!t||!Object.keys(t).length)}function i(t){return!!t.is_trial}function r(t){return!!(null==t?void 0:t.pro_plan)}function a(t){return r(t)&&!i(t)}function c(t){return t.type===s.ProPlan}function l(t){return t.type===s.Exchange}function h(t){return t.type===s.Coins}function u(t){var e,n,s;return t?l(t)||h(t)?null!==(e=t.text_id)&&void 0!==e?e:"":null!==(s=null!==(n=t.discount_text_id)&&void 0!==n?n:t.text_id)&&void 0!==s?s:"":""}n.d(e,{ProductType:()=>s,getProductId:()=>u,isCoinsProduct:()=>h,isExchange:()=>l,isPaidPro:()=>a,isPlan:()=>c,isPro:()=>r,isProductDefined:()=>o,isTrial:()=>i}),function(t){t[t.ProPlan=1]="ProPlan",t[t.NewsFeed=3]="NewsFeed",t[t.Exchange=4]="Exchange",t[t.Connection=6]="Connection",t[t.Coins=8]="Coins"}(s||(s={}))},957879:(t,e,n)=>{const s=n(823127);t.exports=s,s(document).ajaxSend(((t,e,n)=>{n.crossDomain&&!n.forceLanguageHeader||(window.locale?e.setRequestHeader("X-Language",window.locale):console.warn("window.locale is not defined"))}))},266325:(t,e,n)=>{"use strict";function s(t){let e=null;return(n,...s)=>(null==e||e.abort(),e=new AbortController,null==n||n.addEventListener("error",(()=>null==e?void 0:e.abort()),{once:!0}),t(e.signal,...s))}function o(t){if(!c(t))throw t}function i(t){if(c(t))throw t}function r(t){return(null==t?void 0:t.aborted)?Promise.reject(a()):new Promise(((e,n)=>{null==t||t.addEventListener("abort",(()=>n(a())),{once:!0})}))}function a(){return new DOMException("Aborted","AbortError")}function c(t){return t instanceof Error&&"AbortError"===t.name}function l(t,e){return Promise.race([r(t),e])}async function h(t,e){let n;try{await l(t,new Promise((t=>{n=setTimeout(t,e)})))}finally{clearTimeout(n)}}n.d(e,{createAbortError:()=>a,delay:()=>h,isAbortError:()=>c,respectAbort:()=>l,respectLatest:()=>s,rethrowAbortError:()=>i,skipAbortError:()=>o})},978137:(t,e,n)=>{"use strict";function s(t){let e=t;const n=()=>{window.removeEventListener("online",n),e&&e()};return window.addEventListener("online",n),()=>{e=null}}n.d(e,{callWhenOnline:()=>s})},777466:(t,e,n)=>{"use strict";function s(t){t.preventDefault()}n.d(e,{preventDefault:()=>s,preventDefaultForContextMenu:()=>i});const o=["input:not([type])",'input[type="text"]','input[type="email"]','input[type="password"]','input[type="search"]','input[type="number"]','input[type="url"]',"textarea","a[href]",'*[contenteditable="true"]',"[data-allow-context-menu]"];function i(t){const e=t.target;e&&!e.closest(o.join(", "))&&t.preventDefault()}},490778:(t,e,n)=>{"use strict";t.exports=n.p+"desktop.48bb0acc31aeb2422416.webp"},901896:(t,e,n)=>{"use strict";t.exports=n.p+"tablet.5ed26c209de7e1b5845d.webp"}}]);