(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[77165,78775,95063,94949,79274],{683135:e=>{e.exports={"tv-spinner__container-rotate":"tv-spinner__container-rotate-aLqboHuu"}},129592:(e,t,i)=>{"use strict";i.d(t,{createGroup:()=>a,keyboardPressedKeysState:()=>l,pressedKeys:()=>o,registerWindow:()=>c,unregisterWindow:()=>u});var r=i(163586),n=i(764250);i(591800);const s=new r.ActionManager,o=s.pressedKeys(),l=s.keyboardPressedKeysState();function a(e){return new n.ActionGroup(s,e)}function c(e){s.listen(e)}function u(e){s.unlisten(e)}},685023:(e,t,i)=>{"use strict";i.d(t,{DEFAULT_SIZE:()=>r,spinnerSizeMap:()=>n});const r="large",n={mini:"xsmall",xxsmall:"xxsmall",xsmall:"xsmall",small:"small",medium:"medium",large:"large"}},410864:(e,t,i)=>{"use strict";var r;i.d(t,{ToastIntent:()=>r}),function(e){e.Default="default",e.Success="success",e.Warning="warning",e.Danger="danger"}(r||(r={}))},500521:(e,t,i)=>{"use strict";e.exports.pushChartPage=async function(e){const{default:t}=await Promise.all([i.e(76592),i.e(63987),i.e(1888),i.e(35213),i.e(63830),i.e(33371),i.e(54712),i.e(54765),i.e(25977),i.e(90940),i.e(88913),i.e(34629)]).then(i.t.bind(i,55244,23)),r=new t.ChartPage(e);TradingView.historyManager.push(r)}},607436:(e,t,i)=>{"use strict";i.d(t,{DEFAULT_SIZE:()=>r.DEFAULT_SIZE,spinnerSizeMap:()=>r.spinnerSizeMap});var r=i(685023)},941285:(e,t,i)=>{"use strict";i.r(t),i.d(t,{Spinner:()=>l,renderSpinnerTemplate:()=>s});i(683135);var r=i(571690),n=i(607436);function s(e=""){return`
`}const o=(0,r.parseHtmlElement)(s());class l{constructor(e){this._shown=!1,this._el=o.cloneNode(!0),this.setSize(n.spinnerSizeMap[e||n.DEFAULT_SIZE])}spin(e){return this._el.classList.add("tv-spinner--shown"),void 0===this._container&&(this._container=e,void 0!==e&&e.appendChild(this._el)),this._shown=!0,this}stop(e){return e&&void 0!==this._container&&this._container.removeChild(this._el),this._el&&this._el.classList.remove("tv-spinner--shown"),this._shown=!1,this}setStyle(e){return Object.keys(e).forEach((t=>{const i=e[t];void 0!==i&&this._el.style.setProperty(t,i)})),this}style(){return this._el.style}setSize(e){const t=void 0!==e?`tv-spinner--size_${e}`:"";return this._el.className=`tv-spinner ${t} ${this._shown?"tv-spinner--shown":""}`,this}getEl(){return this._el}destroy(){this.stop(),delete this._el,delete this._container}}},43464:(e,t,i)=>{"use strict";i.r(t),i.d(t,{bannerPrivacyPreferenceKey:()=>v,checkCookiePolicy:()=>y,checkCookiePolicyInLs:()=>w,cookieBannerDelegate:()=>m,cookieBannerDomain:()=>h,initCookiesNotification:()=>A,oldBannerKey:()=>p,onAccept:()=>C,removeOldCookieBannerKey:()=>P,setCookiePolicy:()=>b,showCookiesNotification:()=>S});var r=i(49437),n=i(314802),s=(i(659863),i(268222)),o=i(220563),l=i(261030),a=i(634786),c=i(66974),u=i(16188);const d=window.location.hostname.split("."),h=(0,c.isLocal)()?"":"."+d.slice(1,d.length).join("."),p="cookieBanner",v=(0, c.isProd)()?"cookiePrivacyPreferenceBannerProduction":"cookiePrivacyPreferenceBannerLocal",_="accepted",f="ignored",g="notApplicable",m=(0,s.createDeferredPromise)();function P(){return r.TVLocalStorage.removeItem(p)}function y(e){return u.get(e)===_||u.get(e)===g}function w(e){return r.TVLocalStorage.getItem(e)===_||r.TVLocalStorage.getItem(e)===g}function C(){b(_)}function b(e){u.set(v,e,3653,"/",h)}let T=!1;async function S(){if(T)return;const{setCookieStageStatus:e}=await Promise.all([i.e(58768),i.e(92191),i.e(32109),i.e(49205),i.e(56400),i.e(98899),i.e(5919),i.e(59255),i.e(47877),i.e(43447),i.e(38869)]).then(i.bind(i,625551));T=!0;const t=await Promise.all([i.e(58768),i.e(92191),i.e(32109),i.e(49205),i.e(56400),i.e(98899),i.e(5919),i.e(59255),i.e(47877),i.e(43447),i.e(38869)]).then(i.bind(i,718463));await t.showCookiesNotification()&&(C(),(0,a.trackCookies)("click","accept_all")),e(!0),T=!1}const x=["/symbols"];async function A(){const{setCookieStageStatus:e}=await Promise.all([i.e(58768),i.e(92191),i.e(32109),i.e(49205),i.e(56400),i.e(98899),i.e(5919),i.e(59255),i.e(47877),i.e(43447),i.e(38869)]).then(i.bind(i,625551));if(y(v)||((0,n.isOnMobileAppPage)("any")||/^\/streams\/(.+)\/embed/.test(window.location.pathname)||/^\/widget-wizard\//.test(window.location.pathname)))e(!0);else{const i=document.querySelector(".js-main-page-promo-container"),r=x.find((e=>window.location.pathname.includes(e)));if(i||r||m.resolve(),r&&window.addEventListener("scroll",(function e(){window.scrollY>=.2*document.documentElement.scrollHeight&&(m.resolve(),window.removeEventListener("scroll",e))})),u.get(v)===f)return l.cookieSettingsReady.resolve(),m.promise.then((()=>S()));{const i=await(0,o.userGeoInfo)();if(i.is_in_european_union||(t=i.country_code,["is","li","no","gb"].includes(t)))return b(f),l.cookieSettingsReady.resolve(),m.promise.then((()=>S()));e(!0),b(g),(0,l.setCookieSetting)(l.CookieSettings.Analytics,!0),(0,l.setCookieSetting)(l.CookieSettings.Advertising,!0)}}var t;l.cookieSettingsReady.resolve()}},975420:(e,t,i)=>{"use strict";i.d(t,{trackTiming:()=>u});var r=i(251954),n=i(261030),s=i(588948),o=i(638456),l=i(691805);let a=!1;function c(){if(a)return;(0,s.updateInitData)();const e=(0,s.getInitData)();if(!e.gaId)return void(window.gtag=()=>{});a=!0,(0,l.appendScript)(`https://www.googletagmanager.com/gtag/js?id=${(0,s.getInitData)().gaId}`),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},window.gtag("js",new Date);const t={anonymize_ip:!0};window.TVD&&(t.app_name="TVD",t.app_version=(0,o.desktopAppVersion)()),e.gaVars&&window.gtag("set",e.gaVars),window.gtag("consent","default",{analytics_storage:(0,n.getCookieSetting)(n.CookieSettings.Analytics)?"granted":"denied"}),window.gtag("config",e.gaId,t),r.subscribe(n.cookieSettingsChangeEvent,((e,t)=>{e===n.CookieSettings.Analytics&&window.gtag("consent","update",{analytics_storage:t?"granted":"denied"})}),null)}function u(e,t,i,r){c(),window.gtag("event","timing_complete",{name:t,value:i,event_category:e,event_label:r})}}, 963239:(e,t,i)=>{"use strict";i.r(t),i.d(t,{copyToClipboard:()=>n,writeImpl:()=>s,writePromiseUsingApi:()=>l});var r=i(793993);function n(e){return s(e,null)}function s(e,t){const i=e.files&&e.files.length>0;if(!i&&t&&t.eventPhase>0)return o(t,e),Promise.resolve();if(!i){let t=!1;const i=i=>{i.stopImmediatePropagation(),o(i,e),t=!0};try{document.addEventListener("copy",i,!0),document.execCommand("copy")}finally{document.removeEventListener("copy",i,!0)}if(t)return Promise.resolve()}return async function(e){const t=(0,r.getClipboard)();if(!t||!t.write||!window.ClipboardItem)throw new DOMException("ClipboardApi is not supported","NotSupportedError");const i={};for(const t of e.files||[])i[t.type]=t;e.text&&(i["text/plain"]=e.text);e.html&&(i["text/html"]=e.html);return t.write([new window.ClipboardItem(i)])}(e)}function o(e,t){e.preventDefault();const i=e.clipboardData;t.text&&i.setData("text/plain",t.text),t.html&&i.setData("text/html",t.html)}async function l(e,t){const i=(0,r.getClipboard)();if("text/plain"===t&&!i.write){const t=await e;return i.writeText(await t.text())}if(!i||!i.write||!window.ClipboardItem)throw new DOMException("ClipboardApi is not supported","NotSupportedError");let n=null;try{n=new window.ClipboardItem({[t]:e})}catch(i){n=new window.ClipboardItem({[t]:await e})}if(n)return i.write([n]);throw new Error("ClipboardApi is not supported")}},414879:(e,t,i)=>{"use strict";var r,n;i.r(t),i.d(t,{Months:()=>n,WeekDays:()=>r}),function(e){e[e.SUNDAY=1]="SUNDAY",e[e.MONDAY=2]="MONDAY",e[e.TUESDAY=3]="TUESDAY",e[e.WEDNESDAY=4]="WEDNESDAY",e[e.THURSDAY=5]="THURSDAY",e[e.FRIDAY=6]="FRIDAY",e[e.SATURDAY=7]="SATURDAY"}(r||(r={})),function(e){e[e.JANUARY=0]="JANUARY",e[e.FEBRUARY=1]="FEBRUARY",e[e.MARCH=2]="MARCH",e[e.APRIL=3]="APRIL",e[e.MAY=4]="MAY",e[e.JUNE=5]="JUNE",e[e.JULY=6]="JULY",e[e.AUGUST=7]="AUGUST",e[e.SEPTEMBER=8]="SEPTEMBER",e[e.OCTOBER=9]="OCTOBER",e[e.NOVEMBER=10]="NOVEMBER",e[e.DECEMBER=11]="DECEMBER"}(n||(n={}))},936410:(e,t,i)=>{"use strict";i.r(t),i.d(t,{monthsFullNames:()=>s,monthsShortNames:()=>o,weekDaysFullNames:()=>l,weekDaysMiniNames:()=>c,weekDaysShortNames:()=>a});var r=i(444372),n=i(414879);const s={[n.Months.JANUARY]:r.t(null,void 0,i(926910)),[n.Months.FEBRUARY]:r.t(null,void 0,i(316467)),[n.Months.MARCH]:r.t(null,void 0,i(322852)),[n.Months.APRIL]:r.t(null,void 0,i(997637)),[n.Months.MAY]:r.t(null,void 0,i(668327)),[n.Months.JUNE]:r.t(null,void 0,i(49385)),[n.Months.JULY]:r.t(null,void 0,i(323230)),[n.Months.AUGUST]:r.t(null,void 0,i(486797)),[n.Months.SEPTEMBER]:r.t(null,void 0,i(661132)),[n.Months.OCTOBER]:r.t(null,void 0,i(290784)),[n.Months.NOVEMBER]:r.t(null,void 0,i(171194)),[n.Months.DECEMBER]:r.t(null,void 0,i(55669))},o={[n.Months.JANUARY]:r.t(null,void 0,i(795425)),[n.Months.FEBRUARY]:r.t(null,void 0,i(835050)),[n.Months.MARCH]:r.t(null,void 0,i(651369)),[n.Months.APRIL]:r.t(null,void 0,i(442762)),[n.Months.MAY]:r.t(null,{context:"short"},i(227991)),[n.Months.JUNE]:r.t(null,void 0,i(715224)),[n.Months.JULY]:r.t(null,void 0,i(6215)), [n.Months.AUGUST]:r.t(null,void 0,i(38465)),[n.Months.SEPTEMBER]:r.t(null,void 0,i(757902)),[n.Months.OCTOBER]:r.t(null,void 0,i(73546)),[n.Months.NOVEMBER]:r.t(null,void 0,i(671230)),[n.Months.DECEMBER]:r.t(null,void 0,i(92203))},l={[n.WeekDays.SUNDAY]:r.t(null,void 0,i(272149)),[n.WeekDays.MONDAY]:r.t(null,void 0,i(561199)),[n.WeekDays.TUESDAY]:r.t(null,void 0,i(944979)),[n.WeekDays.WEDNESDAY]:r.t(null,void 0,i(107147)),[n.WeekDays.THURSDAY]:r.t(null,void 0,i(107951)),[n.WeekDays.FRIDAY]:r.t(null,void 0,i(772970)),[n.WeekDays.SATURDAY]:r.t(null,void 0,i(101144))},a={[n.WeekDays.SUNDAY]:r.t(null,void 0,i(186577)),[n.WeekDays.MONDAY]:r.t(null,void 0,i(783085)),[n.WeekDays.TUESDAY]:r.t(null,void 0,i(794316)),[n.WeekDays.WEDNESDAY]:r.t(null,void 0,i(875094)),[n.WeekDays.THURSDAY]:r.t(null,void 0,i(409787)),[n.WeekDays.FRIDAY]:r.t(null,void 0,i(300564)),[n.WeekDays.SATURDAY]:r.t(null,void 0,i(936835))},c={[n.WeekDays.SUNDAY]:r.t(null,{context:"day_of_week"},i(85954)),[n.WeekDays.MONDAY]:r.t(null,{context:"day_of_week"},i(11268)),[n.WeekDays.TUESDAY]:r.t(null,{context:"day_of_week"},i(831533)),[n.WeekDays.WEDNESDAY]:r.t(null,{context:"day_of_week"},i(226230)),[n.WeekDays.THURSDAY]:r.t(null,{context:"day_of_week"},i(24793)),[n.WeekDays.FRIDAY]:r.t(null,{context:"day_of_week"},i(519801)),[n.WeekDays.SATURDAY]:r.t(null,{context:"day_of_week"},i(963331))}},359663:(e,t,i)=>{"use strict";i.d(t,{FeatureToggleWatchedValue:()=>s});var r=i(125226),n=i(401580);class s extends n.WatchedValue{constructor(e,t){super(function(e,t){return(0,r.isFeatureEnabled)(e)}(e)),(0,r.onFeaturesStateChanged)().subscribe(this,(t=>{e===t&&this.setValue((0,r.isFeatureEnabled)(e))}))}destroy(){(0,r.onFeaturesStateChanged)().unsubscribeAll(this),super.destroy()}}},793993:(e,t,i)=>{"use strict";function r(){var e;return null!==(e=navigator.androidClipboard)&&void 0!==e?e:navigator.clipboard}i.d(t,{getClipboard:()=>r})},849204:(e,t,i)=>{"use strict";i.r(t),i.d(t,{LogoSize:()=>r,LogoUrlResolver:()=>o,getLogoUrlResolver:()=>a});var r,n=i(650151),s=i(588948);!function(e){e[e.Medium=0]="Medium",e[e.Large=1]="Large"}(r||(r={}));class o{constructor(e){(0,n.assert)(""!==e,"S3 base url must be a non-empty string"),this._baseUrl=e}getSymbolLogoUrl(e,t){switch((0,n.assert)(""!==e,"logo id must be a non-empty string"),t){case r.Medium:return this._baseUrl+`${e}.svg`;case r.Large:return this._baseUrl+`${e}--big.svg`}}getCountryFlagUrl(e,t){return this.getSymbolLogoUrl("country/"+e,t)}getCryptoLogoUrl(e,t){return this.getSymbolLogoUrl("crypto/"+e,t)}getProviderLogoUrl(e,t){return this.getSymbolLogoUrl("provider/"+e,t)}getSourceLogoUrl(e,t){return this.getSymbolLogoUrl("source/"+e,t)}getBlockchainContractLogoUrl(e,t){return this.getSymbolLogoUrl("blockchain/"+e,t)}}let l;function a(){return function(){if(!l){const e=(0,s.getInitData)(),t=e.settings?e.settings.S3_LOGO_SERVICE_BASE_URL:"";l=new o(t)}return l}()}},207678:(e,t,i)=>{"use strict";i.d(t,{breakpoints:()=>r,mobileFirstBreakpoints:()=>n,mobileFirstLegacyBreakpoints:()=>s});const r={desktop:1/0,desktopHd:1919, phone:767,"phone-vertical":479,tablet:1019},n={base:0,"media-mf-phone-vertical":320,"media-mf-phone-landscape":568,"media-mf-tablet-vertical":768,"media-mf-tablet-landscape":1024,"media-mf-laptop":1280,"media-mf-desktop-medium":1440,"media-mf-desktop-large":1920,"media-mf-desktop-extra-large":2560},s={"media-mf-legacy-phone-vertical":330,"media-mf-legacy-phone":480,"media-mf-legacy-notebook":1020,"media-mf-legacy-desktop-medium":1480,"media-mf-legacy-desktop":1531}},76107:(e,t,i)=>{"use strict";i.d(t,{getCSSProperty:()=>l,getCSSPropertyNumericValue:()=>a,getContentWidth:()=>s,getScrollbarWidth:()=>r,matchMediaMinMax:()=>n,setStyle:()=>o});const r=(()=>{let e;return()=>{var t;if(void 0===e){const i=document.createElement("div"),r=i.style;r.visibility="hidden",r.width="100px",r.msOverflowStyle="scrollbar",document.body.appendChild(i);const n=i.offsetWidth;i.style.overflow="scroll";const s=document.createElement("div");s.style.width="100%",i.appendChild(s);const o=s.offsetWidth;null===(t=i.parentNode)||void 0===t||t.removeChild(i),e=n-o}return e}})();function n(e,t){return t===1/0?window.matchMedia(`(min-width: ${e}px)`):window.matchMedia(`(min-width: ${e}px) and (max-width: ${t}px)`)}function s(e){return a(e,"width")-a(e,"padding-left")-a(e,"padding-right")}function o(e,t,i){null!==e&&e.style.setProperty(t,i)}function l(e,t){return getComputedStyle(e,null).getPropertyValue(t)}function a(e,t){return parseInt(l(e,t))}},850775:(e,t,i)=>{"use strict";i.d(t,{mediaState:()=>c});var r=i(685459),n=i.n(r),s=i(49336),o=i(207678),l=i(76107);class a extends(n()){constructor(){super(),this.width=0,this.height=0,this.device=null,this.breakpoints=o.breakpoints,this._checkDevice(),window.addEventListener("resize",this._checkDevice),Object.entries(o.breakpoints).sort((([e,t],[i,r])=>t-r)).forEach((([e,t],i,r)=>{let n;if(0!==i){const[,e]=r[i-1];n=e+1}else n=0;const s=(0,l.matchMediaMinMax)(n,t);s.matches&&this._setNewDevice(e),s.addListener((t=>{t.matches&&(this._checkDevice(),this._setNewDevice(e))}))})),(0,s.whenDocumentReady)(this._checkDevice.bind(this)),this.isPhoneSizeDevice.bind(this)}isPhoneSizeDevice(){return"phone"===this.device||"phone-vertical"===this.device}_checkDevice(){this.width=window.innerWidth,this.height=window.innerHeight}_setNewDevice(e){const t=this.device;this.device=e,this.trigger("changeDevice",[e,t])}}const c=new a},197677:(e,t,i)=>{"use strict";i.d(t,{pineFacadeFetch:()=>d});var r=i(120780),n=i(294142),s=i(881992),o=i(129586),l=i(175203),a=i(791488);function c(e,t){const i=new URL(function(e){return e.split("/").map((e=>encodeURIComponent(e))).join("/")}(e),(0,s.getPineFacadeUrl)());for(const e in t){const r=t[e];(0,o.isAbsentParam)(r)||i.searchParams.set(e,String(r))}return i.toString()}function u(e,t,i=!1){const r={method:e,mode:"cors"};return"POST"===e&&t&&(r.body=function(e){const t=new FormData;for(const i of Object.keys(e))t.append(i,e[i]);return t}(t)),i||(r.credentials="include"),r}async function d({urlPath:e,urlParams:t,data:i,withoutCredentials:o,method:d="GET"}){ const h=c(e,t),p=u(d,i,o),v=function(e){n.log.logNormal(`Requesting pine facade scripts, url: ${e}`);const t=e.split("/")[0],i=a.pineTelemetryGroups.get(t),r=Date.now();return t=>{const s=Date.now()-r;if(l.telemetry.sendReport("pine",`${i}_group_time_frame`,{value:s}),t)return l.telemetry.sendReport("pine",`${i}_group_ok`),void n.log.logNormal(`Requesting pine facade scripts finished, url: ${e}`);l.telemetry.sendReport("pine",`${i}_group_error`),n.log.logError(`Requesting pine facade scripts failed, url: ${e}`)}}(e);try{const e=await(0,r.fetch)(h,p),t=await e.json();if(!e.ok)throw(0,s.safetyGetReason)(t);return v(!0),t}catch(e){throw v(!1),e}}},526225:(e,t,i)=>{"use strict";i.d(t,{syncUserConversionData:()=>d,syncUserData:()=>u});var r=i(201089),n=i(345848),s=i(120780),o=i(290576);const l=(0,r.getLogger)("User.Sync");function a(e){return`${e}_${window.user&&window.user.username||""}`}function c(e,t,i,r=!0){i!==window.user.pro_plan&&(window.user.pro_plan=i,window.user.is_pro=Boolean(i),(0,n.trackEvent)("Sync User Data","Different Pro Plan",a(e))),t!==window.is_authenticated&&(window.is_authenticated=t,r&&window.loginStateChange.fire(),(0,n.trackEvent)("Sync User Data","Different Auth",a(e)))}async function u(e){try{c(e,!0,(await(0,o.getProPlanDetailsForUser)()).pro_plan)}catch(t){!function(e,t){403===t.status&&["not_authenticated","login_required"].includes(t.type||"")?c(e,!1,void 0):l.logError(t.message)}(e,t)}}async function d(e,t=!0){var i;const r=new URL("/pricing/",window.location.origin),n=new URLSearchParams(window.location.search);n.has("_test_country")&&r.searchParams.append("_test_country",null!==(i=n.get("_test_country"))&&void 0!==i?i:"");const o=await(0,s.fetch)(r.href),l=await o.json();return c(e,l.is_authenticated,l.user.pro_plan,t),l}},175203:(e,t,i)=>{"use strict";i.d(t,{telemetry:()=>u});var r=i(707957),n=i(120780),s=i(638456),o=i(314802);i(659863);const l=(0,i(201089).getLogger)("Common.Telemetry"),a={default:15e3,site:3e5},c=["before_websocket_connection_time_frame","websocket_connection_time_frame","first_series_full_time_frame","page_full_load_time_frame","page_load_time_frame"];const u=new class{constructor(){this.reportSent=new r.Delegate,this.timeCounters={series:{marks:[]},study:{},pine:{}},this._timeoutIds={},this._commonAdditionalData={cluster:null,userId:"0"},this._reportStash={}}setSessionInfo(e){const t=this._parseCluster(e);null!==t&&(this._commonAdditionalData.cluster=t)}sendReport(e,t,i){var r;if(!this._isAbleToSendReport(t))return;const n=this._getSubserviceType(e),s=this._getHost(e,n);if(null!==s){if(i=void 0===i?{count:1}:i,this._addReportToStash(i,t,s),!this._timeoutIds[e]){const t=null!==(r=a[e])&&void 0!==r?r:a.default;this._timeoutIds[e]=setTimeout(this._sendTelemetryToService.bind(this,e,s),t)}}else l.logError(`Unable to get host for counter: ${t}, metric type: ${e}, serivce type: ${n}`)}sendChartReport(e,t,i=!0){this._sendServiceSpecifiedReport("charts",e,t,i)}sendLineToolsStorageReport(e,t,i=!0){this._sendServiceSpecifiedReport("line_tools_storage",e,t,i)} _sendServiceSpecifiedReport(e,t,i,r=!0){this._updateUserInfo(),i=void 0===i?{count:1}:i,r&&(i=this._appendCommonAdditionalInfo(i,["cluster","userId"])),this.sendReport(e,t,i)}_updateUserInfo(){const e="user"in window&&"id"in window.user?window.user.id:"0";this._commonAdditionalData.userId=String(e)}_isAbleToSendReport(e){const t=window.TELEMETRY_HOSTS,i=c.includes(e),r=Boolean(window.TradingView.onChartPage||(0,s.onWidget)());return t&&(!i||r)}_sendTelemetryToService(e,t){if(this._reportStash.hasOwnProperty(t)){const e=this._cropParams(this._reportStash[t]),i=this._renameAllParams(e),r={event:"report_stash",params:this._cleanAllParams(i)};l.logDebug(`Report to host: ${t}; stash: ${JSON.stringify(this._reportStash[t])}`),this.reportSent.fire(this._reportStash[t]),delete this._reportStash[t],(0,n.fetch)(`${t}/report`,{method:"POST",body:JSON.stringify(r)})}this._timeoutIds[e]=null}_getHost(e,t){const i=window.TELEMETRY_HOSTS,r=i[e]&&i[e][t];return Boolean(r)?r:null}_getSubserviceType(e){if(!["charts","site"].includes(e))return"all";let t="free";const i=window.user.is_pro;return"charts"===e&&(0,o.isOnMobileAppPage)("old")?t=i?"ios_pro":"ios_free":"charts"===e&&(0,o.isOnMobileAppPage)("new")?t=i?"android_pro":"android_free":(0,s.onWidget)()?t="widget":i&&(t="pro"),t}_parseCluster(e){let t;try{t=JSON.parse(e).session_id}catch(e){return l.logError("Could not parse cluster id (session id)"),null}const i=/(.*@)(.*)/gi.exec(t);return null!==i&&i.length>=3?i[2]:null}_appendCommonAdditionalInfo(e,t){return t.forEach((t=>{t in this._commonAdditionalData&&(e.additional=e.additional||{},e.additional[t]=this._commonAdditionalData[t])})),e}_cropParams(e){var t;for(const i in e)e.hasOwnProperty(i)&&e[i].length>1e3&&(e.too_much_metrics_frame=null!==(t=e.too_much_metrics_frame)&&void 0!==t?t:[],e.too_much_metrics_frame.push({value:e[i].length,additional:{event:i}}),delete e[i]);return e}_renameAllParams(e){const t={};for(const i in e)e.hasOwnProperty(i)&&(t[i]=[],e[i].forEach((e=>{t[i].push(this._renameEntryParams(e))})));return t}_renameEntryParams(e){const t={count:"c",value:"v",text:"t",additional:"a"};return Object.keys(e).reduce(((i,r)=>(i[t[r]]=e[r],i)),{})}_cleanAllParams(e){const t={};for(const i in e)if(e.hasOwnProperty(i)){t[i]=[];const r={c:0};e[i].forEach((e=>{const n=this._cleanEntryParams(e),s=Object.keys(n).length;1===s&&void 0!==n.c?r.c+=n.c:s>0&&t[i].push(n)})),r.c>0&&t[i].push(r),0===t[i].length&&delete t[i]}return t}_cleanEntryParams(e){const t=Object.keys(e).reduce(((t,i)=>"c"!==i&&"t"!==i||e[i]?(t[i]=e[i],t):t),{});return"c"in t||"v"in t||"t"in t?t:{}}_addReportToStash(e,t,i){i in this._reportStash||(this._reportStash[i]={}),t in this._reportStash[i]||(this._reportStash[i][t]=[]),Object.keys(e).length>0&&this._reportStash[i][t].push(e)}}},61499:(e,t,i)=>{"use strict";var r;i.d(t,{StdTheme:()=>r}),function(e){e.Light="light",e.Dark="dark"}(r||(r={}))},226722:(e,t,i)=>{"use strict";i.d(t,{TVXWindowEvents:()=>o});i(586463);var r=i(201089),n=i(49437);const s=(0,r.getLogger)("XWindowEvents");var o;!function(e){ const t="tvxwevents.",i={};let r;window.BroadcastChannel?(r=new BroadcastChannel("tvxwevents"),r.addEventListener("message",(function(e){const{data:{event:t,value:r}}=e;i[t]&&i[t].forEach((e=>{e(r)}))})),function(){const e=[],i=performance.now();for(let i=0;i{t(e.newValue)}));n.TVLocalStorage.removeItem(s)})),e.on=function(e,t){i[e]||(i[e]=[]),i[e].push(t)},e.off=function(e,t){if(!i[e])return;const r=i[e].indexOf(t);-1!==r&&(1===i[e].length?delete i[e]:i[e].splice(r,1))},e.emit=function(e,i=Date.now()){try{r?r.postMessage({event:e,value:i}):n.TVLocalStorage.setItem(t+e,i.toString())}catch(e){s.logError(e.message)}}}(o||(o={}))},440498:(e,t,i)=>{"use strict";i.d(t,{DELETED_SYMBOLS_LIST_ID:()=>r,isDeletedSymbolsList:()=>n});i(49437),i(738600);const r="deleted_symbols_list_id",n=e=>e===r},279274:(e,t,i)=>{e.exports=[{value:"",name:"All Exchanges",desc:i.tf(null,void 0,i(18383)),flag:"",country:"",group:"AllExchanges",providerId:""},{value:"BISWAP",name:"Biswap (BNB chain)",desc:i.tf(null,void 0,i(612392)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"biswap"},{value:"BITHUMB",name:"Bithumb",desc:i.tf(null,void 0,i(906984)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bithumb"},{value:"BITKUB",name:"BITKUB",desc:i.tf(null,void 0,i(973073)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitkub"},{value:"BITRUE",name:"Bitrue",desc:i.tf(null,void 0,i(921076)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitrue"},{value:"BITMART",name:"Bitmart",desc:i.tf(null,void 0,i(193921)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitmart"},{value:"COINMETRICS",name:"Coin Metrics",desc:i.tf(null,void 0,i(476804)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"coinmetrics"},{value:"MEXC",name:"MEXC Global",desc:i.tf(null,void 0,i(42257)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"mexc"},{value:"GATEIO",name:"Gate.io",desc:i.tf(null,void 0,i(434055)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"gateio"},{value:"HTX",name:"HTX",desc:i.tf(null,void 0,i(380187)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"htx"},{value:"796",name:"796",desc:i.tf(null,void 0,i(883762)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"DERIBIT",name:"Deribit",desc:i.tf(null,void 0,i(864518)),flag:"bitcoin",group:"Cryptocurrency", country:"",providerId:"deribit"},{value:"DEFILLAMA",name:"Defi Llama",desc:i.tf(null,void 0,i(70240)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"defillama"},{value:"GLASSNODE",name:"Glassnode",desc:i.tf(null,void 0,i(934859)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"glassnode"},{value:"OKX",name:"OKX",desc:i.tf(null,void 0,i(308995)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"okx"},{value:"OSMOSIS",name:"Osmosis",desc:i.tf(null,void 0,i(220606)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"osmosis"},{value:"PANGOLIN",name:"Pangolin (Avalanche)",desc:i.tf(null,void 0,i(880397)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"pangolin"},{value:"PANCAKESWAP",name:"PancakeSwap (BNB chain)",desc:i.tf(null,void 0,i(672300)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"pancakeswap"},{value:"PIONEX",name:"Pionex",desc:i.tf(null,void 0,i(392381)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"pionex"},{value:"PYTH",name:"Pyth",desc:i.tf(null,void 0,i(403221)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"pyth"},{value:"SPOOKYSWAP",name:"SpookySwap (Fantom)",desc:i.tf(null,void 0,i(746542)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"spookyswap"},{value:"WAGYUSWAP",name:"Wagyuswap (Velas)",desc:i.tf(null,void 0,i(105845)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"wagyuswap"},{value:"WHITEBIT",name:"WhiteBIT",desc:i.tf(null,void 0,i(592774)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"whitebit"},{value:"WOONETWORK",name:"WOO",desc:i.tf(null,void 0,i(839751)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"woonetwork"},{value:"DYDX",name:"dYdX",desc:i.tf(null,void 0,i(105453)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"dydx"},{value:"VERSEETH",name:"Verse (Ethereum)",desc:i.tf(null,void 0,i(173335)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"verseeth"},{value:"VOLMEX",name:"Volmex",desc:i.tf(null,void 0,i(620656)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"volmex"},{value:"ZOOMEX",name:"Zoomex",desc:i.tf(null,void 0,i(825619)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"zoomex"},{value:"ADX",name:"ADX",desc:i.tf(null,void 0,i(936934)),flag:"ae",group:"Middle East / Africa",country:"ae",providerId:"",searchTerms:[i.tf(null,void 0,i(975308)),i.tf(null,void 0,i(287916))]},{value:"DFM",name:"DFM",desc:i.tf(null,void 0,i(535232)),flag:"ae",group:"Middle East / Africa",country:"ae",providerId:"",searchTerms:[i.tf(null,void 0,i(975308)),i.tf(null,void 0,i(287916))]},{value:"NASDAQDUBAI",name:"NASDAQ",desc:i.tf(null,void 0,i(229359)),flag:"ae",group:"Middle East / Africa",country:"ae",priorityInGroup:1,providerId:"",searchTerms:[i.tf(null,void 0,i(975308)),i.tf(null,void 0,i(287916))]},{value:"LSE",name:"LSE",desc:i.tf(null,void 0,i(454623)),flag:"uk",group:"Europe",country:"uk",providerId:"",searchTerms:[i.tf(null,void 0,i(846792)),i.tf(null,void 0,i(606994))]},{ value:"LME",name:"LME",desc:i.tf(null,void 0,i(21353)),flag:"uk",group:"Europe",country:"uk",providerId:"",searchTerms:[i.tf(null,void 0,i(846792)),i.tf(null,void 0,i(606994))]},{value:"LSIN",name:"LSIN",desc:i.tf(null,void 0,i(249934)),flag:"uk",group:"Europe",country:"uk",providerId:"",searchTerms:[i.tf(null,void 0,i(846792)),i.tf(null,void 0,i(606994))]},{value:"TURQUOISE",name:"Turquoise",desc:i.tf(null,void 0,i(258419)),flag:"uk",group:"Europe",country:"uk",providerId:"",searchTerms:[i.tf(null,void 0,i(846792)),i.tf(null,void 0,i(606994))]},{value:"FTSE",name:"FTSE",desc:i.tf(null,void 0,i(749711)),flag:"uk",group:"Europe",country:"uk",providerId:"",searchTerms:[i.tf(null,void 0,i(846792)),i.tf(null,void 0,i(606994))]},{value:"EUREX",name:"EUREX",desc:i.tf(null,void 0,i(376029)),flag:"europe",group:"Europe",country:"eu",providerId:""},{value:"MGEX",name:"MGEX",desc:i.tf(null,void 0,i(14406)),flag:"usa",hideInSymbolSearch:!0,group:"North America",country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"NASDAQ",name:"NASDAQ",desc:i.tf(null,void 0,i(227691)),flag:"usa",group:"North America",country:"us",priorityInGroup:1,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"NYSE",name:"NYSE",desc:i.tf(null,void 0,i(872667)),flag:"usa",group:"North America",country:"us",priorityInGroup:2,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"AMEX",name:"Arca",desc:i.tf(null,void 0,i(468841)),flag:"usa",group:"North America",country:"us",priorityInGroup:3,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"OTC",name:"OTC",desc:i.tf(null,void 0,i(448920)),flag:"usa",group:"North America",country:"us",priorityInGroup:4,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"DJ",name:"DJ",desc:i.tf(null,void 0,i(623778)),flag:"usa",group:"North America",country:"us",priorityInGroup:5,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"SP",name:"SP",desc:i.tf(null,void 0,i(662397)),flag:"usa",group:"North America",country:"us",priorityInGroup:6,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"CBOE",name:"CBOE",desc:i.tf(null,void 0,i(1596)),flag:"usa",group:"North America",country:"us",priorityInGroup:7,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"CBOEEU",name:"CBOE EU",desc:i.tf(null,void 0,i(975674)),flag:"europe",group:"Europe",country:"eu",providerId:""},{value:"CBOT",name:"CBOT",desc:i.tf(null,void 0,i(581563)),flag:"usa",group:"North America",country:"us",priorityInGroup:8,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"CME",name:"CME GLOBEX",desc:i.tf(null,void 0,i(425193)),flag:"usa",group:"North America",country:"us",priorityInGroup:9,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"COMEX", name:"COMEX",desc:i.tf(null,void 0,i(584533)),flag:"usa",group:"North America",country:"us",priorityInGroup:10,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"NYMEX",name:"NYMEX",desc:i.tf(null,void 0,i(336499)),flag:"usa",group:"North America",country:"us",priorityInGroup:11,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"ICEUS",name:"ICEUS",desc:i.tf(null,void 0,i(403509)),flag:"usa",group:"North America",country:"us",priorityInGroup:12,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"FAIRX",name:"FairX",desc:i.tf(null,void 0,i(187464)),flag:"usa",group:"North America",country:"us",priorityInGroup:13,providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"CSE",name:"CSE",desc:i.tf(null,void 0,i(465782)),flag:"canada",group:"North America",country:"ca",priorityInGroup:13,providerId:"",searchTerms:[i.tf(null,void 0,i(280206))]},{value:"NEO",name:"NEO",desc:i.tf(null,void 0,i(278436)),flag:"canada",group:"North America",country:"ca",priorityInGroup:14,providerId:"",searchTerms:[i.tf(null,void 0,i(280206))]},{value:"TSX",name:"TSX",desc:i.tf(null,void 0,i(949042)),flag:"canada",group:"North America",country:"ca",priorityInGroup:15,providerId:"",searchTerms:[i.tf(null,void 0,i(280206))]},{value:"TSXV",name:"TSXV",desc:i.tf(null,void 0,i(12815)),flag:"canada",group:"North America",country:"ca",priorityInGroup:16,providerId:"",searchTerms:[i.tf(null,void 0,i(280206))]},{value:"MOEX",name:"MOEX",desc:i.tf(null,void 0,i(73467)),flag:"russia",group:"Europe",country:"ru",providerId:"",searchTerms:[i.tf(null,void 0,i(238201))]},{value:"MYX",name:"MYX",desc:i.tf(null,void 0,i(887964)),flag:"malaysia",group:"Asia / Pacific",country:"my",providerId:"",searchTerms:[i.tf(null,void 0,i(622622))]},{value:"FTSEMYX",name:"FTSE",desc:i.tf(null,void 0,i(40698)),flag:"malaysia",group:"Asia / Pacific",country:"my",providerId:"",searchTerms:[i.tf(null,void 0,i(622622))]},{value:"HOSE",name:"HOSE",desc:i.tf(null,void 0,i(34416)),flag:"vietnam",group:"Asia / Pacific",country:"vn",providerId:"",searchTerms:[i.tf(null,void 0,i(450049))]},{value:"HNX",name:"HNX",desc:i.tf(null,void 0,i(653194)),flag:"vietnam",group:"Asia / Pacific",country:"vn",providerId:"",searchTerms:[i.tf(null,void 0,i(450049))]},{value:"UPCOM",name:"HNX UPCoM",desc:i.tf(null,void 0,i(696591)),flag:"vietnam",group:"Asia / Pacific",country:"vn",providerId:"",searchTerms:[i.tf(null,void 0,i(450049))]},{value:"CSELK",name:"CSE",desc:i.tf(null,void 0,i(429971)),flag:"sri_lanka",group:"Asia / Pacific",country:"lk",providerId:"",searchTerms:[i.tf(null,void 0,i(567835))]},{value:"BITSTAMP",name:"Bitstamp",desc:i.tf(null,void 0,i(42285)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitstamp"},{value:"ACTIVTRADES",name:"ActivTrades",desc:i.tf(null,void 0,i(34342)),flag:"forex",group:"Forex",country:"",providerId:"activtrades"},{value:"AFTERPRIME",name:"Afterprime",desc:i.tf(null,void 0,i(268986)), flag:"forex",group:"Forex",country:"",providerId:"afterprime"},{value:"BLACKBULL",name:"BlackBull Markets",desc:i.tf(null,void 0,i(802620)),flag:"forex",group:"Forex",country:"",providerId:"blackbullmarkets"},{value:"FPMARKETS",name:"FP Markets",desc:i.tf(null,void 0,i(382398)),flag:"forex",group:"Forex",country:"",providerId:"fpmarkets"},{value:"VELOCITY",name:"Velocity Trade",desc:i.tf(null,void 0,i(650469)),flag:"forex",group:"Forex",country:"",providerId:"velocitytrade"},{value:"FX",name:"FXCM",desc:i.tf(null,void 0,i(592901)),flag:"forex",group:"Forex",country:"",providerId:"fxcm"},{value:"FXOPEN",name:"FXOpen",desc:i.tf(null,void 0,i(638398)),flag:"forex",group:"Forex",country:"",providerId:"fxopen"},{value:"EIGHTCAP",name:"Eightcap",desc:i.tf(null,void 0,i(910807)),flag:"forex",group:"Forex",country:"",providerId:"eightcap"},{value:"BTCE",name:"BTC-e",desc:i.tf(null,void 0,i(675334)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"HONEYSWAP",name:"Honeyswap (xDai)",desc:i.tf(null,void 0,i(499767)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"honeyswap"},{value:"HONEYSWAPPOLYGON",name:"Honeyswap (Polygon)",desc:i.tf(null,void 0,i(880739)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"honeyswap"},{value:"BSE",name:"BSE",desc:i.tf(null,void 0,i(799931)),flag:"india",group:"Asia / Pacific",country:"in",providerId:"",searchTerms:[i.tf(null,void 0,i(16207))]},{value:"MSEI",name:"MSE",desc:i.tf(null,void 0,i(693081)),flag:"india",group:"Asia / Pacific",country:"in",providerId:"",searchTerms:[i.tf(null,void 0,i(16207))]},{value:"NYMEX_MINI",name:"NYMEX",desc:i.tf(null,void 0,i(336499)),flag:"usa",group:"North America",hideInSymbolSearch:!0,country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"COMEX_MINI",name:"COMEX",desc:i.tf(null,void 0,i(584533)),flag:"usa",group:"North America",hideInSymbolSearch:!0,country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"ICEEURFIN",name:"ICEEUR",desc:i.tf(null,void 0,i(845951)),flag:"europe",group:"Europe",country:"eu",providerId:""},{value:"ICEEURCOMM",name:"ICEEUR",desc:i.tf(null,void 0,i(166982)),flag:"europe",group:"Europe",country:"eu",providerId:""},{value:"NSE",name:"NSE",desc:i.tf(null,void 0,i(803867)),flag:"india",group:"Asia / Pacific",country:"in",providerId:"",searchTerms:[i.tf(null,void 0,i(16207))]},{value:"MCX",name:"MCX",desc:i.tf(null,void 0,i(753577)),flag:"india",group:"Asia / Pacific",country:"in",providerId:"",searchTerms:[i.tf(null,void 0,i(16207))]},{value:"NCDEX",name:"NCDEX",desc:i.tf(null,void 0,i(915091)),flag:"india",group:"Asia / Pacific",country:"in",providerId:"",searchTerms:[i.tf(null,void 0,i(16207))]},{value:"KCBT",name:"KCBT",desc:i.tf(null,void 0,i(610871)),flag:"usa",hideInSymbolSearch:!0,group:"North America",country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"OKCOIN",name:"OKCoin", desc:i.tf(null,void 0,i(798361)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"okcoin"},{value:"CBOT_MINI",name:"CBOT",desc:i.tf(null,void 0,i(581563)),flag:"usa",group:"North America",hideInSymbolSearch:!0,country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"KRAKEN",name:"Kraken",desc:i.tf(null,void 0,i(961932)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"kraken"},{value:"KUCOIN",name:"KuCoin",desc:i.tf(null,void 0,i(850627)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"kucoin"},{value:"XEXCHANGE",name:"xExchange",desc:i.tf(null,void 0,i(734830)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"xexchange"},{value:"CME_MINI",name:"CME",desc:i.tf(null,void 0,i(425193)),flag:"usa",group:"North America",hideInSymbolSearch:!0,country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"DJ",name:"DJ",desc:i.tf(null,void 0,i(973151)),flag:"usa",hideInSymbolSearch:!0,group:"North America",country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"SP",name:"SP",desc:i.tf(null,void 0,i(869919)),flag:"usa",hideInSymbolSearch:!0,group:"North America",country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"BTCCHINA",name:"BTC China",desc:i.tf(null,void 0,i(599193)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"TIMEX",name:"TimeX",desc:i.tf(null,void 0,i(773557)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"timex"},{value:"ANX",name:"ANX",desc:i.tf(null,void 0,i(198372)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"MEXBT",name:"meXBT",desc:i.tf(null,void 0,i(668490)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"GEMINI",name:"Gemini",desc:i.tf(null,void 0,i(201367)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"gemini"},{value:"BITVC",name:"BitVC",desc:i.tf(null,void 0,i(357531)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"BITYES",name:"BitYes",desc:i.tf(null,void 0,i(945663)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:""},{value:"BITFLYER",name:"bitFlyer",desc:i.tf(null,void 0,i(704862)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitflyer"},{value:"BYBIT",name:"Bybit",desc:i.tf(null,void 0,i(801800)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bybit"},{value:"BITMEX",name:"BitMEX",desc:i.tf(null,void 0,i(890561)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitmex"},{value:"CAPITALCOM",name:"Capital.com",desc:i.tf(null,void 0,i(148674)),flag:"forex",group:"Forex",country:"",providerId:"capitalcom"},{value:"COINEX",name:"CoinEx",desc:i.tf(null,void 0,i(328681)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"coinex"},{value:"EXMO",name:"EXMO", desc:i.tf(null,void 0,i(924753)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"exmo2"},{value:"INTOTHEBLOCK",name:"IntoTheBlock",desc:i.tf(null,void 0,i(830996)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"intotheblock"},{value:"EASYMARKETS",name:"easyMarkets",desc:i.tf(null,void 0,i(339210)),flag:"forex",group:"Forex",country:"",providerId:"easymarkets"},{value:"FOREXCOM",name:"FOREX.com",desc:i.tf(null,void 0,i(395068)),flag:"forex",group:"Forex",country:"",providerId:"gain"},{value:"FX_IDC",name:"ICE",desc:i.tf(null,void 0,i(89446)),flag:"forex",group:"Forex",country:"",providerId:"ice"},{value:"IBKR",name:"Interactive Brokers",desc:i.tf(null,void 0,i(508662)),flag:"forex",group:"Forex",country:"",providerId:"ibkr"},{value:"IBROKER",name:"iBroker",desc:i.tf(null,void 0,i(51966)),flag:"forex",group:"Forex",country:"",providerId:"ibroker"},{value:"ICMARKETS",name:"IC Markets",desc:i.tf(null,void 0,i(81698)),flag:"forex",group:"Forex",country:"",providerId:"icmarkets"},{value:"BITFINEX",name:"Bitfinex",desc:i.tf(null,void 0,i(572762)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitfinex"},{value:"MTGOX",name:"Mt.Gox",desc:i.tf(null,void 0,i(808754)),flag:"bitcoin",group:"Cryptocurrency",hideInSymbolSearch:!0,country:"",providerId:"mtgox"},{value:"PHEMEX",name:"Phemex",desc:i.tf(null,void 0,i(972718)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"phemex"},{value:"POLONIEX",name:"Poloniex",desc:i.tf(null,void 0,i(311014)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"poloniex"},{value:"QUICKSWAP",name:"QuickSwap (Polygon)",desc:i.tf(null,void 0,i(478675)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"quickswap"},{value:"SUSHISWAP",name:"SushiSwap (Ethereum)",desc:i.tf(null,void 0,i(656920)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"sushiswap"},{value:"SUSHISWAPPOLYGON",name:"SushiSwap (Polygon)",desc:i.tf(null,void 0,i(568905)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"sushiswap"},{value:"TRADERJOE",name:"Trader Joe (Avalanche)",desc:i.tf(null,void 0,i(319746)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"traderjoe"},{value:"TRADESTATION",name:"TradeStation",desc:i.tf(null,void 0,i(437523)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"tradestation"},{value:"UNISWAP",name:"Uniswap v2 (Ethereum)",desc:i.tf(null,void 0,i(725990)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"uniswap"},{value:"UNISWAP3ETH",name:"Uniswap v3 (Ethereum)",desc:i.tf(null,void 0,i(670485)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"uniswap3"},{value:"UNISWAP3POLYGON",name:"Uniswap v3 (Polygon)",desc:i.tf(null,void 0,i(96266)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"uniswap3"},{value:"UNISWAP3ARBITRUM",name:"Uniswap v3 (Arbitrum)",desc:i.tf(null,void 0,i(419861)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"uniswap3"},{value:"UNISWAP3OPTIMISM",name:"Uniswap v3 (Optimism)",desc:i.tf(null,void 0,i(754635)), flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"uniswap3"},{value:"UPBIT",name:"UpBit",desc:i.tf(null,void 0,i(310430)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"upbit"},{value:"BINGX",name:"BingX",desc:i.tf(null,void 0,i(932032)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bingx"},{value:"BTSE",name:"BTSE",desc:i.tf(null,void 0,i(621363)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"btse"},{value:"BITTREX",name:"Bittrex",desc:i.tf(null,void 0,i(611622)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bittrex"},{value:"BINANCE",name:"Binance",desc:i.tf(null,void 0,i(778260)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"binance"},{value:"BITGET",name:"Bitget",desc:i.tf(null,void 0,i(151805)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bitget"},{value:"BINANCEUS",name:"Binance US",desc:i.tf(null,void 0,i(376868)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"binance"},{value:"DELTA",name:"Delta",desc:i.tf(null,void 0,i(527223)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"delta"},{value:"BLOFIN",name:"Blofin",desc:i.tf(null,void 0,i(429494)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"blofin"},{value:"BNC",name:"Brave New Coin",desc:i.tf(null,void 0,i(46336)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"bnc"},{value:"BCBA",name:"BYMA",desc:i.tf(null,void 0,i(731613)),flag:"argentina",group:"Mexico and South America",country:"ar",providerId:"",searchTerms:[i.tf(null,void 0,i(834742))]},{value:"MATBAROFEX",name:"ROFEX",desc:i.tf(null,void 0,i(477911)),flag:"argentina",group:"Mexico and South America",country:"ar",providerId:"",searchTerms:[i.tf(null,void 0,i(834742))]},{value:"BMFBOVESPA",name:"B3",desc:i.tf(null,void 0,i(866247)),flag:"brasil",group:"Mexico and South America",country:"br",providerId:"",searchTerms:[i.tf(null,void 0,i(228867))]},{value:"BMV",name:"BMV",desc:i.tf(null,void 0,i(203947)),flag:"mexico",group:"Mexico and South America",country:"mx",providerId:"",searchTerms:[i.tf(null,void 0,i(555087))]},{value:"BIVA",name:"BIVA",desc:i.tf(null,void 0,i(219594)),flag:"mexico",group:"Mexico and South America",country:"mx",providerId:"",searchTerms:[i.tf(null,void 0,i(555087))]},{value:"BVL",name:"BVL",desc:i.tf(null,void 0,i(505138)),flag:"peru",group:"Mexico and South America",country:"pe",providerId:"",searchTerms:[i.tf(null,void 0,i(622979))]},{value:"BCS",name:"SSE",desc:i.tf(null,void 0,i(949722)),flag:"chile",group:"Mexico and South America",country:"cl",providerId:"",searchTerms:[i.tf(null,void 0,i(141840))]},{value:"BVC",name:"BVC",desc:i.tf(null,void 0,i(388142)),flag:"colombia",group:"Mexico and South America",country:"co",providerId:"",searchTerms:[i.tf(null,void 0,i(731144))]},{value:"BVCV",name:"BVC",desc:i.tf(null,void 0,i(478271)),flag:"venezuela",group:"Mexico and South America",country:"ve",providerId:"",searchTerms:[i.tf(null,void 0,i(739055))]},{value:"NAG",name:"NSE",desc:i.tf(null,void 0,i(862549)),flag:"japan", group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"TSE",name:"TSE",desc:i.tf(null,void 0,i(453617)),flag:"japan",group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"TFEX",name:"TFEX",desc:i.tf(null,void 0,i(197400)),flag:"thailand",group:"Asia / Pacific",country:"th",providerId:"",searchTerms:[i.tf(null,void 0,i(433138))]},{value:"TFX",name:"TFX",desc:i.tf(null,void 0,i(753572)),flag:"japan",group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"TOCOM",name:"TOCOM",desc:i.tf(null,void 0,i(30453)),flag:"japan",group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"OSE",name:"OSE",desc:i.tf(null,void 0,i(517199)),flag:"japan",group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"SGX",name:"SGX",desc:i.tf(null,void 0,i(919973)),flag:"singapore",group:"Asia / Pacific",country:"sg",providerId:"",searchTerms:[i.tf(null,void 0,i(156683))]},{value:"ICESG",name:"ICE Futures Singapore",desc:i.tf(null,void 0,i(448044)),flag:"singapore",group:"Asia / Pacific",country:"sg",providerId:"",searchTerms:[i.tf(null,void 0,i(156683))]},{value:"FTSEST",name:"FTSE ST",desc:i.tf(null,void 0,i(582927)),flag:"singapore",group:"Asia / Pacific",country:"sg",providerId:"",searchTerms:[i.tf(null,void 0,i(156683))]},{value:"SAPSE",name:"SSE",desc:i.tf(null,void 0,i(253961)),flag:"japan",group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"FSE",name:"FSE",desc:i.tf(null,void 0,i(461659)),flag:"japan",group:"Asia / Pacific",country:"jp",providerId:"",searchTerms:[i.tf(null,void 0,i(692443))]},{value:"TPEX",name:"TPEx",desc:i.tf(null,void 0,i(215751)),flag:"taiwan",group:"Asia / Pacific",country:"tw",providerId:"",searchTerms:[i.tf(null,void 0,i(460919))]},{value:"TAIFEX",name:"TAIFEX",desc:i.tf(null,void 0,i(686094)),flag:"taiwan",group:"Asia / Pacific",country:"tw",providerId:"",searchTerms:[i.tf(null,void 0,i(460919))]},{value:"TWSE",name:"TWSE",desc:i.tf(null,void 0,i(974013)),flag:"taiwan",group:"Asia / Pacific",country:"tw",providerId:"",searchTerms:[i.tf(null,void 0,i(460919))]},{value:"SET",name:"SET",desc:i.tf(null,void 0,i(905107)),flag:"thailand",group:"Asia / Pacific",country:"th",providerId:"",searchTerms:[i.tf(null,void 0,i(433138))]},{value:"KRX",name:"KRX",desc:i.tf(null,void 0,i(116699)),flag:"south_korea",group:"Asia / Pacific",country:"kr",providerId:"",searchTerms:[i.tf(null,void 0,i(173160))]},{value:"BAHRAIN",name:"BHB",desc:i.tf(null,void 0,i(98343)),flag:"bahrain",group:"Middle East / Africa",country:"bh",providerId:"",searchTerms:[i.tf(null,void 0,i(53260))]},{value:"KSE",name:"KSE",desc:i.tf(null,void 0,i(542319)),flag:"kuwait",group:"Middle East / Africa",country:"kw",providerId:"",searchTerms:[i.tf(null,void 0,i(872374))]},{value:"CSECY",name:"CSE",desc:i.tf(null,void 0,i(4287)),flag:"cyprus",group:"Europe",country:"cy",providerId:"", searchTerms:[i.tf(null,void 0,i(551017))]},{value:"BVMT",name:"BVMT",desc:i.tf(null,void 0,i(923628)),flag:"tunisia",group:"Middle East / Africa",country:"tn",providerId:"",searchTerms:[i.tf(null,void 0,i(420638))]},{value:"ATHEX",name:"ATHEX",desc:i.tf(null,void 0,i(852002)),flag:"greece",group:"Europe",country:"gr",providerId:""},{value:"BELEX",name:"BELEX",desc:i.tf(null,void 0,i(525246)),flag:"serbia",group:"Europe",country:"rs",providerId:"",searchTerms:[i.tf(null,void 0,i(896573))]},{value:"EGX",name:"EGX",desc:i.tf(null,void 0,i(493792)),flag:"egypt",group:"Middle East / Africa",country:"eg",providerId:"",searchTerms:[i.tf(null,void 0,i(205390))]},{value:"TADAWUL",name:"Tadawul",desc:i.tf(null,void 0,i(401175)),flag:"saudi_arabia",group:"Middle East / Africa",country:"sa",providerId:"",searchTerms:[i.tf(null,void 0,i(936261))]},{value:"CSEMA",name:"CSE",desc:i.tf(null,void 0,i(88329)),flag:"morocco",group:"Middle East / Africa",country:"ma",providerId:"",searchTerms:[i.tf(null,void 0,i(216641))]},{value:"IDX",name:"IDX",desc:i.tf(null,void 0,i(75088)),flag:"indonesia",group:"Asia / Pacific",country:"id",providerId:"",searchTerms:[i.tf(null,void 0,i(609759))]},{value:"HSI",name:"HSI",desc:i.tf(null,void 0,i(259952)),flag:"hong_kong",group:"Asia / Pacific",country:"hk",providerId:"",searchTerms:[i.tf(null,void 0,i(532918))]},{value:"QSE",name:"QSE",desc:i.tf(null,void 0,i(844449)),flag:"qatar",group:"Middle East / Africa",country:"qa",providerId:"",searchTerms:[i.tf(null,void 0,i(619056))]},{value:"OANDA",name:"OANDA",desc:i.tf(null,void 0,i(398585)),flag:"forex",group:"Forex",country:"",providerId:"oanda"},{value:"SAXO",name:"Saxo",desc:i.tf(null,void 0,i(780276)),flag:"forex",group:"Forex",country:"",providerId:"saxobank"},{value:"PEPPERSTONE",name:"Pepperstone",desc:i.tf(null,void 0,i(341557)),flag:"forex",group:"Forex",country:"",providerId:"pepperstone"},{value:"PHILLIPNOVA",name:"Phillip Nova",desc:i.tf(null,void 0,i(574893)),flag:"forex",group:"Forex",country:"",providerId:"phillipnova"},{value:"SKILLING",name:"SKILLING",desc:i.tf(null,void 0,i(434119)),flag:"forex",group:"Forex",country:"",providerId:"skilling"},{value:"SPREADEX",name:"Spreadex",desc:i.tf(null,void 0,i(822963)),flag:"forex",group:"Forex",country:"",providerId:"spreadex"},{value:"GBEBROKERS",name:"GBE brokers",desc:i.tf(null,void 0,i(512579)),flag:"forex",group:"Forex",country:"",providerId:"gbebrokers"},{value:"EURONEXT",name:"Euronext",desc:i.tf(null,void 0,i(70082)),flag:"europe",group:"Europe",country:"eu",providerId:""},{value:"EURONEXTAMS",name:"EURONEXTAMS",desc:i.tf(null,void 0,i(841444)),flag:"netherlands",group:"Europe",country:"nl",providerId:"",searchTerms:[i.tf(null,void 0,i(353770))]},{value:"EURONEXTBRU",name:"EURONEXTBRU",desc:i.tf(null,void 0,i(166201)),flag:"belgium",group:"Europe",country:"be",providerId:"",searchTerms:[i.tf(null,void 0,i(637653))]},{value:"EURONEXTLIS",name:"EURONEXTLIS",desc:i.tf(null,void 0,i(232729)),flag:"portugal",group:"Europe",country:"pt",providerId:"",searchTerms:[i.tf(null,void 0,i(123496))] },{value:"EURONEXTPAR",name:"EURONEXTPAR",desc:i.tf(null,void 0,i(515894)),flag:"france",group:"Europe",country:"fr",providerId:"",searchTerms:[i.tf(null,void 0,i(696013))]},{value:"OSL",name:"EURONEXTOSE",desc:i.tf(null,void 0,i(255361)),flag:"norway",group:"Europe",country:"no",providerId:"",searchTerms:[i.tf(null,void 0,i(145075))]},{value:"OMX",name:"OMX",desc:i.tf(null,void 0,i(74125)),flag:"europe",group:"Europe",country:"eu",providerId:""},{value:"FWB",name:"FWB",desc:i.tf(null,void 0,i(670183)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"FRA",name:"FRA",desc:i.tf(null,void 0,i(551785)),flag:"germany",hideInSymbolSearch:!0,group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"SWB",name:"SWB",desc:i.tf(null,void 0,i(17644)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"XETR",name:"XETR",desc:i.tf(null,void 0,i(141173)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"BME",name:"BME",desc:i.tf(null,void 0,i(889143)),flag:"spain",group:"Europe",country:"es",providerId:"",searchTerms:[i.tf(null,void 0,i(792334))]},{value:"BSSE",name:"BSSE",desc:i.tf(null,void 0,i(433137)),flag:"slovakia",group:"Europe",country:"sk",providerId:"",searchTerms:[i.tf(null,void 0,i(506262))]},{value:"BVB",name:"BVB",desc:i.tf(null,void 0,i(273573)),flag:"romania",group:"Europe",country:"ro",providerId:"",searchTerms:[i.tf(null,void 0,i(385646))]},{value:"BET",name:"BET",desc:i.tf(null,void 0,i(386479)),flag:"hungary",group:"Europe",country:"hu",providerId:"",searchTerms:[i.tf(null,void 0,i(930646))]},{value:"GPW",name:"GPW",desc:i.tf(null,void 0,i(128008)),flag:"poland",group:"Europe",country:"pl",providerId:"",searchTerms:[i.tf(null,void 0,i(210119))]},{value:"NEWCONNECT",name:"GPW — NewConnect",desc:i.tf(null,void 0,i(253127)),flag:"poland",group:"Europe",country:"pl",providerId:"",searchTerms:[i.tf(null,void 0,i(210119))]},{value:"LUXSE",name:"LUXSE",desc:i.tf(null,void 0,i(299724)),flag:"luxembourg",group:"Europe",country:"lu",providerId:"",searchTerms:[i.tf(null,void 0,i(164352))]},{value:"MIL",name:"MIL",desc:i.tf(null,void 0,i(16930)),flag:"italy",group:"Europe",country:"it",providerId:"",searchTerms:[i.tf(null,void 0,i(43246))]},{value:"NGM",name:"NGM",desc:i.tf(null,void 0,i(414327)),flag:"sweden",group:"Europe",country:"se",providerId:"",searchTerms:[i.tf(null,void 0,i(182404))]},{value:"BER",name:"BER",desc:i.tf(null,void 0,i(320197)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"DUS",name:"DUS",desc:i.tf(null,void 0,i(803884)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"HAM",name:"HAM",desc:i.tf(null,void 0,i(373414)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"HAN",name:"HAN",desc:i.tf(null,void 0,i(988211)), flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"MUN",name:"MUN",desc:i.tf(null,void 0,i(186042)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"TRADEGATE",name:"TRADEGATE",desc:i.tf(null,void 0,i(280394)),flag:"germany",group:"Europe",country:"de",providerId:"",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"GETTEX",name:"GETTEX",desc:i.tf(null,void 0,i(881365)),flag:"germany",group:"Europe",country:"de",providerId:"finanzen",searchTerms:[i.tf(null,void 0,i(159985))]},{value:"MILSEDEX",name:"MILSEDEX",desc:i.tf(null,void 0,i(948741)),flag:"italy",group:"Europe",hideInSymbolSearch:!0,country:"it",providerId:"",searchTerms:[i.tf(null,void 0,i(43246))]},{value:"IST",name:"IST",desc:i.tf(null,void 0,i(757451)),flag:"turkey",hideInSymbolSearch:!0,group:"Europe",country:"tr",providerId:"",searchTerms:[i.tf(null,void 0,i(694398))]},{value:"BIST",name:"BIST",desc:i.tf(null,void 0,i(833187)),flag:"turkey",group:"Europe",country:"tr",providerId:"",searchTerms:[i.tf(null,void 0,i(694398))]},{value:"TASE",name:"TASE",desc:i.tf(null,void 0,i(932457)),flag:"israel",group:"Middle East / Africa",country:"il",providerId:"",searchTerms:[i.tf(null,void 0,i(261935))]},{value:"SIX",name:"SIX",desc:i.tf(null,void 0,i(460854)),flag:"switzerland",group:"Europe",country:"ch",providerId:"",searchTerms:[i.tf(null,void 0,i(440414))]},{value:"BX",name:"BX",desc:i.tf(null,void 0,i(283300)),flag:"switzerland",group:"Europe",country:"ch",providerId:"",searchTerms:[i.tf(null,void 0,i(440414))]},{value:"PSECZ",name:"PSE",desc:i.tf(null,void 0,i(475511)),flag:"czech",group:"Europe",country:"cz",providerId:"",searchTerms:[i.tf(null,void 0,i(342054))]},{value:"ASX",name:"ASX",desc:i.tf(null,void 0,i(252673)),flag:"australia",group:"Asia / Pacific",country:"au",providerId:"",searchTerms:[i.tf(null,void 0,i(50132))]},{value:"CHIXAU",name:"Cboe Australia",desc:i.tf(null,void 0,i(685147)),flag:"australia",group:"Asia / Pacific",country:"au",providerId:"",searchTerms:[i.tf(null,void 0,i(50132))]},{value:"VIE",name:"WB",desc:i.tf(null,void 0,i(791370)),flag:"austria",group:"Europe",country:"at",providerId:"",searchTerms:[i.tf(null,void 0,i(226505))]},{value:"DSEBD",name:"DSE",desc:i.tf(null,void 0,i(105736)),flag:"bangladesh",group:"Asia / Pacific",country:"bd",providerId:"",searchTerms:[i.tf(null,void 0,i(61587))]},{value:"NZX",name:"NZX",desc:i.tf(null,void 0,i(164062)),flag:"new_zealand",group:"Asia / Pacific",country:"nz",providerId:"",searchTerms:[i.tf(null,void 0,i(824143))]},{value:"SSE",name:"SSE",desc:i.tf(null,void 0,i(531385)),flag:"china",group:"Asia / Pacific",country:"cn",providerId:"",searchTerms:[i.tf(null,void 0,i(420844))]},{value:"SHFE",name:"SHFE",desc:i.tf(null,void 0,i(19261)),flag:"china",group:"Asia / Pacific",country:"cn",providerId:"",searchTerms:[i.tf(null,void 0,i(420844))]},{value:"SZSE",name:"SZSE",desc:i.tf(null,void 0,i(117992)),flag:"china",group:"Asia / Pacific",country:"cn",providerId:"", searchTerms:[i.tf(null,void 0,i(420844))]},{value:"HKEX",name:"HKEX",desc:i.tf(null,void 0,i(686471)),flag:"hong_kong",group:"Asia / Pacific",country:"hk",providerId:"",searchTerms:[i.tf(null,void 0,i(532918))]},{value:"PSE",name:"PSE",desc:i.tf(null,void 0,i(300290)),flag:"philippines",group:"Asia / Pacific",country:"ph",providerId:"",searchTerms:[i.tf(null,void 0,i(226813))]},{value:"PSX",name:"PSX",desc:i.tf(null,void 0,i(871277)),flag:"pakistan",group:"Asia / Pacific",country:"pk",providerId:"",searchTerms:[i.tf(null,void 0,i(49145))]},{value:"NSENG",name:"NSE",desc:i.tf(null,void 0,i(410100)),flag:"nigeria",group:"Middle East / Africa",country:"ng",providerId:"",searchTerms:[i.tf(null,void 0,i(62410))]},{value:"NSEKE",name:"NSE",desc:i.tf(null,void 0,i(297570)),flag:"kenya",group:"Middle East / Africa",country:"ke",providerId:"",searchTerms:[i.tf(null,void 0,i(89080))]},{value:"JSE",name:"JSE",desc:i.tf(null,void 0,i(456781)),flag:"south_africa",group:"Middle East / Africa",country:"za",providerId:"",searchTerms:[i.tf(null,void 0,i(528900))]},{value:"JFX",name:"JFX",desc:i.tf(null,void 0,i(80661)),flag:"forex",group:"Forex",country:"",providerId:"jfx"},{value:"COINBASE",name:"Coinbase",desc:i.tf(null,void 0,i(740182)),flag:"bitcoin",group:"Cryptocurrency",country:"",providerId:"coinbase"},{value:"CITYINDEX",name:"City Index",desc:i.tf(null,void 0,i(858746)),flag:"forex",group:"Forex",country:"",providerId:"cityindex"},{value:"USI",name:"USI",desc:i.tf(null,void 0,i(787839)),flag:"usa",hideInSymbolSearch:!0,group:"North America",country:"us",providerId:"",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"OMXHEX",name:"HEX",desc:i.tf(null,void 0,i(261969)),flag:"finland",group:"Europe",country:"fi",providerId:"",searchTerms:[i.tf(null,void 0,i(936693))]},{value:"OMXICE",name:"ICEX",desc:i.tf(null,void 0,i(443662)),flag:"iceland",group:"Europe",country:"is",providerId:"",searchTerms:[i.tf(null,void 0,i(664150))]},{value:"OMXCOP",name:"CSE",desc:i.tf(null,void 0,i(290311)),flag:"denmark",group:"Europe",country:"dk",providerId:"",searchTerms:[i.tf(null,void 0,i(64901))]},{value:"OMXSTO",name:"STO",desc:i.tf(null,void 0,i(826846)),flag:"sweden",group:"Europe",country:"se",providerId:"",searchTerms:[i.tf(null,void 0,i(182404))]},{value:"OMXVSE",name:"VSE",desc:i.tf(null,void 0,i(453525)),flag:"lithuania",group:"Europe",country:"lt",providerId:"",searchTerms:[i.tf(null,void 0,i(529113))]},{value:"OMXTSE",name:"TALSE",desc:i.tf(null,void 0,i(807486)),flag:"estonia",group:"Europe",country:"ee",providerId:"",searchTerms:[i.tf(null,void 0,i(959823))]},{value:"OMXRSE",name:"OMXR",desc:i.tf(null,void 0,i(268976)),flag:"latvia",group:"Europe",country:"lv",providerId:"",searchTerms:[i.tf(null,void 0,i(484045))]},{value:"OMXNORDIC",name:"OMXNORDIC",desc:i.tf(null,void 0,i(641835)),flag:"europe",hideInSymbolSearch:!0,group:"Europe",country:"eu",providerId:""},{value:"OMXBALTIC",name:"OMXBALTIC",desc:i.tf(null,void 0,i(220309)),flag:"europe",hideInSymbolSearch:!0,group:"Europe",country:"eu", providerId:""},{value:"FRED",name:"FRED",desc:i.tf(null,void 0,i(90661)),flag:"usa",group:"Economy",country:"",providerId:"fred2",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"ISM",name:"ISM",desc:i.tf(null,void 0,i(647511)),flag:"usa",group:"Economy",country:"",providerId:"quandl_ism",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"FRBNY",name:"FRBNY",desc:i.tf(null,void 0,i(889838)),flag:"usa",group:"Economy",country:"",providerId:"quandl_frbny",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"FRBP",name:"FRBP",desc:i.tf(null,void 0,i(343244)),flag:"usa",group:"Economy",country:"",providerId:"quandl_frbp",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]},{value:"ECONOMICS",name:"Trading Economics",desc:i.tf(null,void 0,i(651425)),flag:"usa",group:"Economy",country:"",providerId:"economics",searchTerms:[i.tf(null,void 0,i(787935)),i.tf(null,void 0,i(216977))]}]},963456:(e,t,i)=>{"use strict";i.d(t,{triesTranslateError:()=>n});var r=i(444372);function n(e){return s.get(e)||e}const s=new Map([["You cannot see this pivot timeframe on this resolution",r.t(null,void 0,i(717126))],["The data vendor doesn't provide volume data for this symbol.",r.t(null,void 0,i(529198))],['Histogram is too large, please increase "Row Size" input.',r.t(null,void 0,i(369085))],["Histogram is too large, please reduce 'Row Size' input.",r.t(null,void 0,i(808122))],["This script is invite-only. To request access, please contact its author.",r.t(null,void 0,i(874986))],["Volume Profile indicator available only on our upgraded plans.",r.t(null,void 0,i(961022))],["VOLUME_BIST_MIXED",r.t(null,void 0,i(482772))]])},401580:(e,t,i)=>{"use strict";i.d(t,{WatchedValue:()=>a});var r=i(428123),n=i(194582),s=i(805377);const o=(0,n.getLogger)("Common.WatchedValue");function l(e){o.logError(`${e&&(e.stack||e.message)}`)}class a{constructor(...e){this._listeners=[],e.length>0&&(this._value=e[0])}destroy(){this.unsubscribe()}value(){return this._owner?this._owner._value:this._value}setValue(e,t){const i=this._owner?this._owner:this;if("function"==typeof i.hook&&(e=i.hook(e)),i.writeLock)return;const r=i._value===e||Number.isNaN(i._value)&&Number.isNaN(e);if(!t&&r&&i.hasOwnProperty("_value"))return;i._value=e;const n=i._listeners.slice();let s=0;for(let t=0;tthis.spawn(e).readonly(),destroy:this.destroy.bind(this)};return this._readonlyInstance=e,e}spawn(e){return new c(this._owner||this,e)}when(e){(0,s.callWhen)(this,(e=>Boolean(e)),(()=>{try{e(this.value())}catch(e){l(e)}}))}assertNoSubscriptions(){0}ownership(){return(0,r.ownership)(this)}spawnOwnership(){return(0,r.ownership)(this.spawn())}weakReference(){return(0,r.weakReference)(this)}}class c extends a{constructor(e,t){super(),delete this._listeners,this._owner=e,this._onDestroy=t}destroy(){var e;try{null===(e=this._onDestroy)||void 0===e||e.call(this)}catch(e){l(e)}super.destroy()}readonly(){return super.readonly()}}},356893:(e,t,i)=>{"use strict";i.d(t,{clipboardDataForSources:()=>a,isLineToolClipboardData:()=>l});var r=i(650151),n=i(982217),s=i(427937),o=i(713473);function l(e){return"drawing"===e.type}function a(e,t){if(1===t.length&&(0,s.isStudy)(t[0])){const e=t[0];return{title:e.title(n.TitleDisplayTarget.StatusLine),sources:[{source:(0,r.ensureNotNull)(e.state()),type:"study"}]}}const i={sources:[],title:""};return i.sources=t.filter((e=>e.copiable()&&(0,o.isLineTool)(e))).map((t=>{const i={type:"drawing",geometry:t.geometry(),source:{...t.state(!1),points:t.normalizedPoints()},modelId:e};return delete i.source.alertId,i})),i.sources.length>0?(1===i.sources.length?i.title=t[0].title(n.TitleDisplayTarget.StatusLine):i.title="Drawings",i):null}},422333:(e,t,i)=>{"use strict";i.r(t),i.d(t,{CHART_FONT_FAMILY:()=>l,CHART_MONOSPACE_FONT_FAMILY:()=>a,setChartFontFamily:()=>o});var r=i(314802);const n="'Trebuchet MS', Roboto, Ubuntu, sans-serif",s=`-apple-system, BlinkMacSystemFont, ${n}`;function o(e){l=e}let l=((0,r.isOnMobileAppPage)("old"),n);const a="monospace";{const e=["U+2E80-2FD5","U+3040-309F","U+1B100-1B12F","U+1AFF0-1AFFF","U+1B000-1B0FF","U+1B130-1B16F","U+3190-319F","U+30A0-30FF","U+31F0-31FF","U+3400-4DBF","U+4E00-9FFF","U+0E00-0E7F"],t=l;(async()=>{if(!/iPhone OS 15_\d+?/.test(navigator.userAgent))return s;{if(["kr","zh_CN","zh_TW"].includes(window.locale))return l;const t=new FontFace("ChartIosFont","local(Helvetica), local(Arial)",{unicodeRange:e.join(", ")});try{return document.fonts.add(await t.load()),`ChartIosFont, ${s}`}catch(e){return l}}})().then((e=>{t===l&&o(e)}))}},208044:(e,t,i)=>{"use strict";i.d(t,{createLayout:()=>l,layoutInitialSizingState:()=>c});var r=i(203308),n=i(822914),s=i(650151);function o(e,t,i){const r=new Set;if("number"==typeof e)return r.add(e),{indices:r,smallestIndex:e,sizer:e=>e,splitters:()=>[],resizeApplier:(e,t,i,r,n)=>n,syncSublayoutsBySplitter:(e,t)=>t};const l=e[0],a=e.slice(1).map((e=>o(e,t)));let c=1/0;for(const e of a)for(const t of Array.from(e.indices))t{const a="h"===o?e.width:e.height;let c,u,d;if(l){const e=t*i+r*a;c=Math.round(e), u=t===s-1?a-c:Math.round(e+n*a)-c}else{const e=(a-(s-1)*i)/s,r=t*(e+i);c=Math.round(r),u=Math.round(r+e)-c}return d="h"===o?{top:e.top,left:e.left+c,height:e.height,width:u}:{top:e.top+c,left:e.left,height:u,width:e.width},d},d=(e,t,i,r,n,s,o)=>{if("number"==typeof i)return[];const l=i[0],a=i.slice(1);return a.reduce(((i,c,h)=>{var p;const v=null==o?void 0:o[h],_=null!==(p=null==v?void 0:v.percent)&&void 0!==p?p:1/a.length,f=u(e,h,t,i.sumOfCoeffsBefore,_,a.length,l,o),g=i.sumOfCoeffsBefore+_;if(h{var _;const f=null==o?void 0:o[v];if("number"==typeof r)return f;if(!c&&v!==n.indexes[a])return f;const g=null!==(_=null==f?void 0:f.percent)&&void 0!==_?_:1/d.length,m=u(e,v,t,p[v],g,d.length,l,o);return{percent:f.percent,substate:h(m,t,i,r,n,(0,s.ensureDefined)(f.substate),a+1,c)}}));{const t=r[0];if(t!==n.orientation||o.length<2)return o;const s=Math.min(n.indexes[a],o.length-2),l="v"===t?e.height:e.width,c=i/l,u=o[s].percent+o[s+1].percent;return o[s].percent+=c,o[s].percent=Math.min(u-.05,Math.max(.05,o[s].percent)),o[s+1].percent-=c,o[s+1].percent=Math.min(u-.05,Math.max(.05,o[s+1].percent)),o}}function p(e,t){if(1===e.length)return t;{const i=(0,s.ensureDefined)(t[e[0]].substate);return p(e.slice(1),i)}}function v(e,t,i,r,o){if("number"==typeof e)return i;const l=e.slice(1);if(o{const l=null==i?void 0:i[n];return"number"==typeof e?l:{percent:l.percent,substate:v(e,t,(0,s.ensureDefined)(l.substate),r,o+1)}}));{const e=t.indexes[o];if(r.lengthi.length){const t=(0,n.default)(r);if(e>=i.length-1){const e=r.length-i.length;for(let i=0;ie.percent=r[t].percent)),i}}return{indices:r,smallestIndex:c,sizer:(e,t,i,r,n)=>{let s,o,c,d=0,h=0,p=0;for(let e=0;e=i||(r.indices.has(t)&&(s=r,c=null==n?void 0:n[e].substate,n&&(p=n[e].percent),o=d),d++,n&&0===p&&(h+=n[e].percent))}const v=u(e,o,r,h,p,d,l,n);return s.sizer(v,t,i,r,c)},splitters:(t,i,r)=>d(t,i,e,0,[],"",r),resizeApplier:(t,i,r,n,s,o)=>h(t,i,r,e,n,s,0,o),syncSublayoutsBySplitter:function(t,i){ const r=p(t.indexes,i);return v(e,t,i,r,0)}}}function l(e,t,i){const r=o(e,t);return{title:i,count:r.indices.size,sizer:r.sizer,splitters:r.splitters,resizeApplier:r.resizeApplier,syncSublayoutsBySplitter:r.syncSublayoutsBySplitter,expression:e,layoutType:t}}function a(e){return e.map((t=>{if((0,r.default)(t))return{percent:1/e.length};{const i=t.slice(1);return{percent:1/e.length,substate:a(i)}}}))}function c(e){return a(e.slice(1))}},533422:(e,t,i)=>{"use strict";i.r(t),i.d(t,{isMultipleLayout:()=>c,isSingleLayout:()=>a,isSupportedLayout:()=>u,layouts:()=>l,tryGuessingTheMostSuitableLayout:()=>d});var r=i(934976),n=i(208044);const s={s:{title:"1 chart",count:1,layoutType:"s",sizer:(e,t)=>{if(0!==t)throw new RangeError("invalid index");return e},splitters:()=>[],resizeApplier:(e,t,i,r,n)=>n,syncSublayoutsBySplitter:(e,t)=>t,expression:["h",0]}};let o;o={"2h":(0,n.createLayout)(r["2h"],"2h","2-up horizontal"),"2v":(0,n.createLayout)(r["2v"],"2v","2-up vertical"),"2-1":(0,n.createLayout)(r["2-1"],"2-1","2 at top and 1 at bottom"),"1-2":(0,n.createLayout)(r["1-2"],"1-2","1 at top and 2 at bottom"),"3s":(0,n.createLayout)(r["3s"],"3s","3-up stacked"),"3r":(0,n.createLayout)(r["3r"],"3r","3-up stacked left"),"3h":(0,n.createLayout)(r["3h"],"3h","3-up horizontal"),"3v":(0,n.createLayout)(r["3v"],"3v","3-up vertical"),4:(0,n.createLayout)(r[4],"4","4-up"),"4h":(0,n.createLayout)(r["4h"],"4h","4-up horizontal"),"4v":(0,n.createLayout)(r["4v"],"4v","4-up vertical"),"4s":(0,n.createLayout)(r["4s"],"4s","4-up stacked"),"5h":(0,n.createLayout)(r["5h"],"5h","5-up horizontal"),"6h":(0,n.createLayout)(r["6h"],"6h","6-up horizontal"),"7h":(0,n.createLayout)(r["7h"],"7h","7-up horizontal"),"8h":(0,n.createLayout)(r["8h"],"8h","8-up horizontal"),"2-2":(0,n.createLayout)(r["2-2"],"2-2","2 at top and 2 at bottom"),"2-3":(0,n.createLayout)(r["2-3"],"2-3","2 at top and 3 at bottom"),"1-3":(0,n.createLayout)(r["1-3"],"1-3","1 at top and 3 at bottom"),"1-4":(0,n.createLayout)(r["1-4"],"1-4","1 at top and 4 at bottom"),"5s":(0,n.createLayout)(r["5s"],"5s","5-up stacked"),6:(0,n.createLayout)(r[6],"6","6-up"),"6c":(0,n.createLayout)(r["6c"],"6c","6-up in two columns"),8:(0,n.createLayout)(r[8],"8","8-up"),"8c":(0,n.createLayout)(r["8c"],"8c","8-up in two columns"),"10c5":(0,n.createLayout)(r["10c5"],"10c5","2-up in 5 columns"),"12c6":(0,n.createLayout)(r["12c6"],"12c6","2-up in 6 columns"),"12c4":(0,n.createLayout)(r["12c4"],"12c4","3-up in 4 columns"),"14c7":(0,n.createLayout)(r["14c7"],"14c7","2-up in 7 columns"),"16c8":(0,n.createLayout)(r["16c8"],"16c8","2-up in 8 columns"),"16c4":(0,n.createLayout)(r["16c4"],"16c4","4-up in 4 columns")};const l={...s,...o};function a(e){return"s"===e}function c(e){return!a(e)}function u(e){return a(e)||o.hasOwnProperty(e)}function d(e){const t=/(\d)-(\d)/.exec(e);let i=1;for(i=3===(null==t?void 0:t.length)?parseInt(t[1])+parseInt(t[2]):parseInt(e);i>1;){const e=Object.keys(o).find((e=>o[e].count===i));if(e)return e;i--}return"s"}},27005:(e,t,i)=>{"use strict";i.d(t,{isUserStudyWithLogs:()=>s, openPineLogsInRightPanel:()=>n});var r=i(971417);function n(e){var t,i,r,n,s,o,l,a;const c=null===(i=null===(t=window.widgetbar)||void 0===t?void 0:t.tradingPanelAccessor)||void 0===i?void 0:i.tradingPanel,u=!(null===(n=null===(r=window.widgetbar)||void 0===r?void 0:r.layout)||void 0===n?void 0:n.canOpen());(null==c?void 0:c.isOpened)&&u&&c.close();const d=null===(s=window.widgetbar)||void 0===s?void 0:s.setPage("pine_logs");null===(a=null===(l=null===(o=window.widgetbar)||void 0===o?void 0:o.layout)||void 0===l?void 0:l.widgetBar)||void 0===a||a.saveToTVSettings();const h=null==d?void 0:d.widget("pine_logs"),p=null==h?void 0:h.widgetObject;e?null==p||p.onSelectStudyFromChart(e):null==p||p.onOpenFromEditor()}function s(e){if(null==e?void 0:e.metaInfo){const t=null==e?void 0:e.metaInfo(),i=t.graphics.logs,n=(0,r.extractPineId)(t.id),s=t.pine;return Boolean(s&&n&&(0,r.isCustomPineId)(n)&&i)}return!1}},811630:(e,t,i)=>{"use strict";i.d(t,{alertsAvailable:()=>r});const r=i(244842).enabled("alerts")},327453:(e,t,i)=>{"use strict";i.d(t,{LimitedPrecisionNumericFormatter:()=>n});var r=i(389137);class n{constructor(e=1){this._precision=e}format(e){(0,r.isNumber)(e)||(e=parseFloat(e));const t=e.toFixed(this._precision),i=Math.pow(10,-this._precision);return Math.max(parseFloat(t),i)+""}parse(e){const t=parseFloat(e);return isNaN(t)?{res:!1}:{res:!0,value:t,suggest:this.format(t)}}}},517336:(e,t,i)=>{"use strict";i.d(t,{LevelsProperty:()=>_});var r=i(822914),n=i(852290),s=i(389137),o=i(853965),l=i(42292);const a={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:()=>Object(),unpack:()=>[]}};function c(e,t,i,r){return r.push(i[t]),r}function u(e,t,i,r){return r[t]=i[e],r}function d(){return[]}function h(){return{}}function p(e,t,i){return i.prefixes.forEach((r=>{const n=r+"level";for(let r=i.range[0];r<=i.range[1];r++)if(e[n+r]&&(0,s.isSameType)(e[n+r],t.typecheck())){let s=t.tpl();i.names.forEach(((i,o)=>{s=t.fill(""+o,i,e[n+r],s)})),e[n+r]=s}})),e}function v(e,t,i){return i(e,{tpl:h,fill:u,typecheck:t.typecheck.unpack},t)}class _ extends o.DefaultProperty{constructor(e,t,i,r,n){n=null!=n?n:p;const s={...a,...null!=r?r:{}};super(e,t?v(t,s,n):t,i),this._map=s,this._levelsIterator=n}state(e,t){const i=super.state(e);return t?i:(r=i,n=this._map,(0,this._levelsIterator)(r,{tpl:d,fill:c,typecheck:n.typecheck.pack},n));var r,n}applyTemplate(e,t){this.mergePreferences((0,n.default)((0,r.default)(t),v(e,this._map,this._levelsIterator)))}saveDefaults(){this._useUserPreferences&&(0,l.saveDefaults)(this._defaultName,this.state(this._exclusions,!0))}clone(){const e=this.state(),t=new _(this._defaultName,e);for(let e=0;e{"use strict";i.d(t,{LineTool5PointsPattern:()=>l});var r=i(650151),n=i(853965),s=i(821979),o=i(31712);class l extends s.LineDataSource{constructor(e,t,i,r){super(e,t||l.createProperties(),i,r), this._loadPaneViews(e)}pointsCount(){return 5}name(){return"XABCD Pattern"}static createProperties(e){const t=new n.DefaultProperty("linetool5pointspattern",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,63124)).then((e=>e.PatternWithBackgroundDefinitionViewModel))}_loadPaneViews(e){Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,382242)).then((t=>{this._setPaneViews([new t.Pattern5pointsPaneView(this,e)])}))}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new o.LineToolColorsProperty([(0,r.ensureDefined)(e.child("color"))])),e.addChild("textsColors",new o.LineToolColorsProperty([(0,r.ensureDefined)(e.child("textcolor"))]))}}},78:(e,t,i)=>{"use strict";i.d(t,{LineToolABCD:()=>l});var r=i(650151),n=i(853965),s=i(821979),o=i(31712);class l extends s.LineDataSource{constructor(e,t,r,n){const s=t||l.createProperties();super(e,s,r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,662657)).then((t=>{this._setPaneViews([new t.ABCDPaneView(this,e)])}))}pointsCount(){return 4}name(){return"ABCD Pattern"}static createProperties(e){const t=new n.DefaultProperty("linetoolabcd",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,669403)).then((e=>e.PatternWithoutBackgroundDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new o.LineToolColorsProperty([(0,r.ensureDefined)(e.child("color"))])),e.addChild("textsColors",new o.LineToolColorsProperty([(0,r.ensureDefined)(e.child("textcolor"))]))}}},907416:(e,t,i)=>{"use strict";i.d(t,{LineToolArc:()=>u});var r=i(650151),n=i(204652),s=i(86441),o=i(625422),l=i(853965),a=i(821979),c=i(31712);class u extends a.LineDataSource{constructor(e,t,r,n){const s=t||u.createProperties();super(e,s,r,n),this.version=2,this._dist=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,953940)).then((({ArcPaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){const e=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),t=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[2]));this._dist=(0,n.distanceToLine)(e,t,i).distance;const o=t.subtract(e),l=new s.Point(-o.y,o.x),a=e.add(t).scaled(.5);i.subtract(a).dotProduct(l)<0&&(this._dist=-this._dist)}}endChanging(e,t){return this._dist=null,super.endChanging(e,t)}pointsCount(){return 3}name(){return"Arc"}hasEditableCoordinates(){return!1}setPoint(e,t){const i={...t},l=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),a=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1]));switch(e){case 0:{const e=(0, r.ensureNotNull)(this._dist),t=(0,r.ensureNotNull)(this.pointToScreenPoint(i)),n=a.subtract(t),o=t.add(a).scaled(.5);let l=new s.Point(-n.y,n.x);l=l.normalized();const c=o.add(l.scaled(e));this._points[0]=i,this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(c));break}case 1:{const e=(0,r.ensureNotNull)(this._dist),t=(0,r.ensureNotNull)(this.pointToScreenPoint(i)),n=t.subtract(l),o=l.add(t).scaled(.5),a=new s.Point(-n.y,n.x).normalized(),c=o.add(a.scaled(e));this._points[1]=i,this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(c));break}case 2:{let e=(0,r.ensureNotNull)(this.pointToScreenPoint(i));const t=(0,n.distanceToLine)(l,a,e).distance,c=a.subtract(l),u=l.add(a).scaled(.5),d=new s.Point(-c.y,c.x).normalized(),h=u.add(d.scaled(t)),p=u.add(d.scaled(-t)),v=c.length(),_=c.x/v,f=c.y/v;let g=Math.acos(_);f<0&&(g=-g);let m=(0,o.translationMatrix)(-u.x,-u.y);e=(0,o.transformPoint)(m,e);let P=(0,o.transformPoint)(m,h);m=(0,o.rotationMatrix)(-g),e=(0,o.transformPoint)(m,e),P=(0,o.transformPoint)(m,P),m=(0,o.scalingMatrix)(1,v/(2*t)),e=(0,o.transformPoint)(m,e),P=(0,o.transformPoint)(m,P);const y=e.y*P.y>=0?new s.Point(h.x,h.y):new s.Point(p.x,p.y);this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(y));break}}this.normalizePoints()}migrateVersion(e,t,i){if(1===e&&2===this._points.length){const e=(2*this._points[0].price+3*this._points[1].price)/5;this._points.push({price:e,index:this._points[1].index})}if(1===e&&2===this._timePoint.length){const e={price:(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t};this._timePoint.push(e)}}static createProperties(e){const t=new l.DefaultProperty("linetoolarc",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,967382))).GeneralFiguresDefinitionsViewModelBase}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new c.LineToolColorsProperty([e.childs().color]))}}},41394:(e,t,i)=>{"use strict";i.d(t,{LineToolArrowMark:()=>l,LineToolArrowMarkDown:()=>d,LineToolArrowMarkLeft:()=>a,LineToolArrowMarkRight:()=>u,LineToolArrowMarkUp:()=>c});var r=i(853965),n=i(821979),s=i(190973),o=i(31712);class l extends n.LineDataSource{constructor(e,t,r,n,s){const o=t||l.createProperties(null,r);super(e,o,n,s),this._textPaneView=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,129022)).then((({ArrowMarkPaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}paneViews(e){const t=super.paneViews();return null!==t&&this._textPaneView&&t.push(this._textPaneView),t}pointsCount(){return 1}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e,t){const i=new r.DefaultProperty(t,e);return this._configureProperties(i),i}_getPropertyDefinitionsViewModelClass(){ return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,952842)).then((e=>e.ArrowMarkDefinitionsViewModel))}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new o.LineToolColorsProperty([e.childs().arrowColor])),e.addChild("textsColors",new o.LineToolColorsProperty([e.childs().color])),e.hasChild("text")||e.addChild("text",new s.default("")),e.addExclusion("text")}}l.version=2;class a extends l{constructor(e,t,i,r){super(e,t,"linetoolarrowmarkleft",i,r)}direction(){return"left"}name(){return"Arrow Mark Left"}textAlignParams(){return{horzAlign:"left",vertAlign:"middle",offsetX:22,offsetY:3}}static createProperties(e){return super.createProperties(e,"linetoolarrowmarkleft")}}class c extends l{constructor(e,t,i,r){super(e,t,"linetoolarrowmarkup",i,r)}direction(){return"up"}name(){return"Arrow Mark Up"}textAlignParams(){return{horzAlign:"center",vertAlign:"top",offsetX:0,offsetY:20}}static createProperties(e){return super.createProperties(e,"linetoolarrowmarkup")}}class u extends l{constructor(e,t,i,r){super(e,t,"linetoolarrowmarkright",i,r)}direction(){return"right"}name(){return"Arrow Mark Right"}textAlignParams(){return{horzAlign:"right",vertAlign:"middle",offsetX:22,offsetY:3,forceTextAlign:!0}}static createProperties(e){return super.createProperties(e,"linetoolarrowmarkright")}}class d extends l{constructor(e,t,i,r){super(e,t,"linetoolarrowmarkdown",i,r)}direction(){return"down"}name(){return"Arrow Mark Down"}textAlignParams(){return{horzAlign:"center",vertAlign:"bottom",offsetX:0,offsetY:20}}static createProperties(e){return super.createProperties(e,"linetoolarrowmarkdown")}}},683396:(e,t,i)=>{"use strict";i.d(t,{LineToolArrowMarker:()=>o});var r=i(821979),n=i(853965),s=i(190973);class o extends r.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:o.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,922514)).then((({ArrowMarkerPaneView:e})=>{this._setPaneViews([new e(this,this.model())])}))}pointsCount(){return 2}name(){return"Trend Line"}static createProperties(e){const t=new n.DefaultProperty("linetoolarrowmarker",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,470719)).then((e=>e.ArrowMarkerDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new s.default("")),e.addExclusion("text")}}},548160:(e,t,i)=>{"use strict";i.d(t,{LineToolArrow:()=>n});var r=i(956268);class n extends r.LineToolTrendLine{constructor(e,t,i,r){super(e,null!=t?t:n.createProperties(),i,r)}name(){return"Arrow"}static createProperties(e){const t=r.LineToolTrendLine._createPropertiesImpl("linetoolarrow",e);return n._configureProperties(t),t}}},179180:(e,t,i)=>{"use strict";i.d(t,{LineToolBalloon:()=>c}) ;var r=i(444372),n=i(853965),s=i(821979),o=i(190973),l=i(31712);const a=r.t(null,void 0,i(119372));class c extends s.LineDataSource{constructor(e,t,i,r){super(e,t||c.createProperties(),i,r),this._createPaneView()}pointsCount(){return 1}name(){return"Balloon"}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}shouldBeRemovedOnDeselect(){return""===this._properties.childs().text.value().trim()}static createProperties(e){const t=new n.DefaultProperty("linetoolballoon",e);return this._configureProperties(t),t}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,417540)).then((e=>e.BalloonDefinitionsViewModel))}_createPaneView(){Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,35986)).then((e=>{this._setPaneViews([new e.BalloonPaneView(this,this._model)])}))}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.default(a)),e.addExclusion("text"),e.addChild("linesColors",new l.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new l.LineToolColorsProperty([e.childs().color]))}}},540598:(e,t,i)=>{"use strict";var r;i.d(t,{LineToolBarsPatternMode:()=>r}),function(e){e[e.Bars=0]="Bars",e[e.Line=1]="Line",e[e.OpenClose=2]="OpenClose",e[e.LineOpen=3]="LineOpen",e[e.LineHigh=4]="LineHigh",e[e.LineLow=5]="LineLow",e[e.LineHL2=6]="LineHL2"}(r||(r={}))},180148:(e,t,i)=>{"use strict";i.d(t,{LineToolBarsPattern:()=>P});var r=i(650151),n=i(444372),s=i(809796),o=i(389137),l=i(373571),a=i(853965),c=i(534741),u=i(821979),d=i(540598),h=i(964824);const p=new s.TranslatedString("mirror bars pattern",n.t(null,void 0,i(881870))),v=new s.TranslatedString("flip bars pattern",n.t(null,void 0,i(559942))),_=n.t(null,void 0,i(363158)),f=n.t(null,void 0,i(892754)),g={0:2,1:4,2:1,3:1,4:2,5:3,6:-1},m={0:3,1:4,2:4,3:1,4:2,5:3,6:-1};class P extends u.LineDataSource{constructor(e,t=P.createProperties(),r,n){super(e,t,r,n),this._pattern=[],this._scale=1,this._pointsCoordinatePricesDiff=null;const s=t.childs().mode.value();(0,o.isString)(s)&&t.childs().mode.setValue(parseInt(s)),t.childs().mirrored.listeners().subscribe(this,this._mirror),t.childs().flipped.listeners().subscribe(this,this._flip),t.childs().mode.subscribe(this,this._updateLastPoint),this.version=2,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,416645)).then((t=>{this._setPaneViews([new t.BarsPatternPaneView(this,e)])}))}pattern(){return this._pattern}isSynchronizable(){return!1}additionalActions(e){return[new l.Action({actionId:"Chart.LineTool.BarsPattern.ToggleMirrored",options:{checked:this.properties().childs().mirrored.value(),checkable:!0,label:_,onExecute:()=>{e.setProperty(this.properties().childs().mirrored,!this.properties().childs().mirrored.value(),p),this.updateAllViews((0, h.sourceChangeEvent)(this.id())),this._model.updateSource(this)}}}),new l.Action({actionId:"Chart.LineTool.BarsPattern.ToggleFlipped",options:{checked:this.properties().childs().flipped.value(),checkable:!0,label:f,onExecute:()=>{e.setProperty(this.properties().childs().flipped,!this.properties().childs().flipped.value(),v),this.updateAllViews((0,h.sourceChangeEvent)(this.id())),this._model.updateSource(this)}}})]}pointsCount(){return 2}state(e){return{...super.state(e),pattern:this._pattern,scale:this._scale,diff:this._pointsCoordinatePricesDiff}}restoreData(e){const{pattern:t=this._pattern,scale:i=this._scale,diff:r=this._pointsCoordinatePricesDiff}=e;this._pattern=t,this._scale=i,this._pointsCoordinatePricesDiff=r}name(){return"Bars Pattern"}hasEditableCoordinates(){return!1}cloneData(e){this._pattern=(0,o.clone)(e._pattern),this._scale=e._scale,this._pointsCoordinatePricesDiff=e._pointsCoordinatePricesDiff}firstPatternPrice(){const{mode:e,flipped:t}=this.properties().childs(),i=this._pattern[0];return e.value()===d.LineToolBarsPatternMode.LineHL2?(i[2]+i[3])/2:t.value()?i[m[e.value()]]:i[g[e.value()]]}lastPatternPrice(){const{mode:e,flipped:t}=this.properties().childs(),i=this._pattern[this._pattern.length-1];return e.value()===d.LineToolBarsPatternMode.LineHL2?(i[2]+i[3])/2:t.value()?i[g[e.value()]]:i[m[e.value()]]}addPoint(e,t,i){const n=super.addPoint(e,t,!0);if(n){const e=this._model.mainSeries(),[{index:t},{index:i}]=this.points(),n=(0,r.ensureDefined)(e.nearestIndex(Math.min(t,i),c.PlotRowSearchMode.NearestRight)),s=(0,r.ensureDefined)(e.nearestIndex(Math.max(t,i),c.PlotRowSearchMode.NearestLeft));this._pattern=this._createPattern(n,s),this._pattern.length>0&&(t>i&&this._points.reverse(),this._points[1].price=this._points[0].price+this._patternPriceDiff(),this._points[1].index=this._points[0].index+(s-n),this.normalizePoints(),this.createServerPoints()),this._updatePointsCoordinatePricesDiff()}return n}setPoint(e,t,i,r){1===e&&t.index<=this._points[0].index&&(t.index=this._points[0].index+1),0===e&&t.index>=this._points[1].index&&(t.index=this._points[1].index-1),super.setPoint(e,t,i),this._updatePointsCoordinatePricesDiff()}move(e,t,i,r){super.move(e,t,i,r),this._updatePointsCoordinatePricesDiff()}migrateVersion(e,t,i){if(1===e&&this._pattern.length>0){const e=this._patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+e),2===this._points.length&&(this._points[1].price=this._points[0].price+e)}}getScale(){return this._scale=this._calculateScale()}static createProperties(e){const t=new a.DefaultProperty("linetoolbarspattern",e);return this._configureProperties(t),t}_preparePoint(e,t){var i;const n=this._alignPointToRangeOfActualData(e),s=this._model.mainSeries(),o=(0,r.ensureNotNull)(s.bars().valueAt(n.index));this.properties().childs().mode.value()===d.LineToolBarsPatternMode.Bars?n.price=(0,r.ensure)(o[2]):n.price=(0,r.ensure)(o[4]);const l=(0,r.ensureNotNull)(this.priceScale()),a=(0, r.ensure)(null===(i=this.ownerSource())||void 0===i?void 0:i.firstValue()),c=.05*l.height(),u=l.priceToCoordinate(n.price,a)-c;return n.price=l.coordinateToPrice(u,a),super._preparePoint(n,t)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,154403))).BarsPatternDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.addExclusion("mirrored"),e.addExclusion("flipped")}_calculatePatternCoordinatePricesDiff(){var e;return this._pattern.length>0&&null!==(e=this._priceCoordinateDiff([this.firstPatternPrice(),this.lastPatternPrice()]))&&void 0!==e?e:null}_updatePointsCoordinatePricesDiff(){this._pointsCoordinatePricesDiff=this._calculatePointsCoordinatePricesDiff()}_calculatePointsCoordinatePricesDiff(){var e;if(2===this._points.length){const[{price:t},{price:i}]=this.points();return null!==(e=this._priceCoordinateDiff([t,i]))&&void 0!==e?e:null}return null}_createPattern(e,t){const i=this._model.mainSeries().data(),n=[];for(let s=e;s<=t;s++)n.push((0,o.clone)((0,r.ensureNotNull)(i.valueAt(s))));return n}_switchPointsPrice(){const e=this._points[0].price;this._timePoint[0].price=this._points[0].price=this._points[1].price,this._timePoint[1].price=this._points[1].price=e}_mirror(){const e=this._pattern;let t=Math.min(e[0][3],e[0][2]),i=Math.max(e[0][3],e[0][2]);for(let r=1;rr-(e-r);for(let t=0;tr.priceToCoordinate(e,n)))}_priceCoordinateDiff(e){const t=this._pricesToCoordinates(e);if(t)return t[1]-t[0]}_calculateScale(){let e=1;if(2===this._points.length){const t=this._calculatePatternCoordinatePricesDiff();if(!t)return e;const i=this._calculatePointsCoordinatePricesDiff();if(t&&null!==i&&(e=+(i/t).toFixed(8)),this._pointsCoordinatePricesDiff!==i){if(this._scale!==e)return this._updateLastPoint(),this._scale;this._updatePointsCoordinatePricesDiff()}}return e}_updateLastPoint(){var e,t;if(this._points.length<2)return;const i=this.priceScale(),r=null!==(t=null===(e=this.ownerSource())||void 0===e?void 0:e.firstValue())&&void 0!==t?t:null;if(null===r||null===i||i.isEmpty())return;const n=this._calculatePatternCoordinatePricesDiff(),s=this._pricesToCoordinates([this.points()[0].price]) ;null!==n&&s&&(this._timePoint[1].price=this._points[1].price=i.coordinateToPrice(+(this._scale*n).toFixed(8)+s[0],r),this._updatePointsCoordinatePricesDiff())}}},511628:(e,t,i)=>{"use strict";i.d(t,{LineToolBezierCubic:()=>o});var r=i(650151),n=i(853965),s=i(821979);class o extends s.LineDataSource{constructor(e,t,r,n){const s=t||o.createProperties();super(e,s,r,n),this._controlPoints=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,98321)).then((t=>{this._setPaneViews([new t.BezierCubicPaneView(this,e)])}))}pointsCount(){return 2}name(){return"Double Curve"}setLastPoint(e,t){const i=super.setLastPoint(e,t);return this._controlPoints=this._calculateControlPoints(),i}addPoint(e,t,i){const r=super.addPoint(e,t,i);if(r){const e=this._calculateControlPoints();this._controlPoints=null,this._points.push(e[0]),this._points.push(e[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)}return r}restorePoints(e,t,i){super.restorePoints(e,t,i),this._createPointProperty(2),this._createPointProperty(3)}controlPoints(){return this._controlPoints}static createProperties(e){const t=new n.DefaultProperty("linetoolbeziercubic",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,383716)).then((e=>e.GeneralBezierDefinitionsViewModel))}_calculateControlPoints(){const e=(0,r.ensureNotNull)(this.pointToScreenPoint(this.points()[0])),t=(0,r.ensureNotNull)(this.pointToScreenPoint(this.points()[1])),i=t.subtract(e).scaled(.5).transposed().scaled(.3),n=e.add(t).scaled(.33),s=e.add(t).scaled(.67),o=n.add(i),l=s.subtract(i);return[(0,r.ensureNotNull)(this.screenPointToPoint(o)),(0,r.ensureNotNull)(this.screenPointToPoint(l))]}}},516487:(e,t,i)=>{"use strict";i.d(t,{LineToolBezierQuadro:()=>o});var r=i(650151),n=i(853965),s=i(821979);class o extends s.LineDataSource{constructor(e,t,r,n){const s=t||o.createProperties();super(e,s,r,n),this._controlPoint=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,545357)).then((t=>{this._setPaneViews([new t.BezierQuadroPaneView(this,e)])}))}pointsCount(){return 2}name(){return"Curve"}setLastPoint(e,t){const i=super.setLastPoint(e,t);return this._controlPoint=this._calculateControlPoint(),i}addPoint(e,t,i){const r=super.addPoint(e,t,i);if(r){const e=this._calculateControlPoint();this._points.push(e),this._controlPoint=null,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)}return r}restorePoints(e,t,i){super.restorePoints(e,t,i),this._createPointProperty(2)}controlPoint(){return this._controlPoint}static createProperties(e){const t=new n.DefaultProperty("linetoolbezierquadro",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,383716)).then((e=>e.GeneralBezierDefinitionsViewModel))} _calculateControlPoint(){const e=(0,r.ensureNotNull)(this.pointToScreenPoint(this.points()[0])),t=(0,r.ensureNotNull)(this.pointToScreenPoint(this.points()[1])),i=t.subtract(e).scaled(.5).transposed().scaled(.3),n=e.add(t).scaled(.5).add(i);return(0,r.ensureNotNull)(this.screenPointToPoint(n))}}},168504:(e,t,i)=>{"use strict";i.d(t,{LineToolBrushBase:()=>s});var r=i(650151),n=i(821979);class s extends n.LineDataSource{constructor(){super(...arguments),this._finished=!1}pointsCount(){return-1}finished(){return this._finished}finish(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()}hasEditableCoordinates(){return!1}addPoint(e,t,i){if(this._finished)return!0;if(this._lastPoint=null,this._points.length>0){const t=this._points[this._points.length-1],i=(0,r.ensureNotNull)(this.pointToScreenPoint(t));if((0,r.ensureNotNull)(this.pointToScreenPoint(e)).subtract(i).length()<2)return this._finished}return super.addPoint(e),this._finished}restorePoints(e,t,i){super.restorePoints(e,t,i),this._finished=!0}}},271133:(e,t,i)=>{"use strict";i.d(t,{LineToolBrush:()=>o});var r=i(853965),n=i(168504),s=i(31712);class o extends n.LineToolBrushBase{constructor(e,t,i,r){super(e,t||o.createProperties(),i,r),this._loadPaneViews(e)}smooth(){return this.properties().childs().smooth.value()}name(){return"Brush"}hasEditableCoordinates(){return!1}static createProperties(e){const t=new r.DefaultProperty("linetoolbrush",e);return this._configureProperties(t),t}_loadPaneViews(e){Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,411733)).then((t=>{this._setPaneViews([new t.BrushPaneView(this,e)])}))}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,351109)).then((e=>e.BrushDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addChild("backgroundsColors",new s.LineToolColorsProperty([e.childs().backgroundColor],e.childs().fillBackground))}}},844295:(e,t,i)=>{"use strict";i.d(t,{LineToolCallout:()=>u});var r=i(790188),n=i(190973),s=i(853965),o=i(31712),l=i(138886);const a={selectionColor:(0,r.getHexColorByName)("color-tv-blue-500"),cursorColor:(0,r.getHexColorByName)("color-black")},c={selectionColor:(0,r.getHexColorByName)("color-white"),cursorColor:(0,r.getHexColorByName)("color-white")};class u extends l.InplaceTextLineDataSource{constructor(e,t,r,n){super(e,t||u.createProperties(),r,n),this._barOffset=0,this._dragStartLeftEdgeIndex=NaN,this._timeScale=e.timeScale(),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,279537)).then((e=>{this._setPaneViews([new e.CalloutPaneView(this,this._model,this._openTextEditor.bind(this),this._closeTextEditor.bind(this),this.onSelectionChange.bind(this))])}))}pointsCount(){return 2}name(){return"Callout"}getBarOffset(){return this._barOffset}getStyle(){return this._model.dark().value()?c:a}shouldBeRemovedOnDeselect(){const e=this._properties.childs().text.value().trim() ;return this._points.length===this.pointsCount()&&""===e}addPoint(e){const t=super.addPoint(e);return t&&this._calculateBarOffset(),t}setLastPoint(e){const t=super.setLastPoint(e);return 2===this.points().length&&this._calculateBarOffset(),t}setPoint(e,t){switch(e){case 0:super.setPoint(e,t),this._calculateBarOffset();break;case 1:const i=this.properties().childs();if(!i.wordWrapWidth)return;const r=this._points,n=this._dragStartLeftEdgeIndex,s=Math.round((t.index-n)/2);if(isFinite(n)&&isFinite(s)){r[1]={index:n+s,price:r[1].price},this._calculateBarOffset(),this.normalizePoints();const e=this._timeScale.indexToCoordinate(n+2*s)-this._timeScale.indexToCoordinate(n)-8-2;if(!isFinite(e))return;i.wordWrapWidth.setValue(Math.max(100,e));break}r[1]=t,this._calculateBarOffset(),this.normalizePoints()}}setPoints(e){super.setPoints(e);const t=this.properties().childs();if(!t.wordWrapWidth)return;const i=this._dragStartLeftEdgeIndex,r=Math.round((e[1].index-i)/2);if(this._calculateBarOffset(),this.normalizePoints(),isFinite(i)&&isFinite(r)){const e=this._timeScale.indexToCoordinate(i+2*r)-this._timeScale.indexToCoordinate(i)-8-2;if(!isFinite(e))return;t.wordWrapWidth.setValue(Math.max(100,e))}}move(e,t,i){super.move(e,t,i),this._calculateBarOffset()}state(e){const t=super.state(e);return t.barOffset=this._barOffset,t}restoreData(e){e.barOffset?this._barOffset=e.barOffset:this._calculateBarOffset(),this.calculatePoint2()}setPriceScale(e){super.setPriceScale(e),e&&e.priceRange()&&this.calculatePoint2()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}calculatePoint2(){if(this._model.lineBeingEdited()===this||this._model.sourcesBeingMoved().includes(this))return;if(this._points.length<2)return;const[e,t]=this.points();this._points[1]={price:t.price,index:e.index+this._barOffset}}static createProperties(e){const t=new s.DefaultProperty("linetoolcallout",e);return this._configureProperties(t),t}_applyTemplateImpl(e){this.properties().childs().text.setValue(e.text),super._applyTemplateImpl(e)}_correctPoints(e,t){if(null===this._currentMovingPoint||void 0===this._currentMovingPoint.logical||null===this._startMovingPoint||void 0===this._startMovingPoint.logical)return!1;const i=this._currentMovingPoint.logical.index-this._startMovingPoint.logical.index,r=this._currentMovingPoint.logical.price-this._startMovingPoint.logical.price,n=e[1];return n.index=n.index+i,n.price+=r,e[1]=n,!0}_onPointsetUpdated(e){super._onPointsetUpdated(e),0!==e.length&&(1===this._points.length&&this._points.push(this._points[0]),this._dragStartLeftEdgeIndex=this.points()[1].index)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,334183))).CalloutDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new n.default("")),e.addExclusion("text"),e.addChild("textsColors",new o.LineToolColorsProperty([e.childs().color]))}_calculateBarOffset(){ this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)}}},638202:(e,t,i)=>{"use strict";i.d(t,{LineToolCircle:()=>l});var r=i(190973),n=i(853965),s=i(821979),o=i(31712);class l extends s.LineDataSource{constructor(e,t,r,n){const s=t||l.createProperties();super(e,s,r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,434475)).then((({CirclePaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}pointsCount(){return 2}name(){return"Circle"}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e){const t=new n.DefaultProperty("linetoolcircle",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,70418))).EllipseCircleDefinitionsViewModel}_snapTo45DegreesAvailable(){return!0}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new r.default("")),e.addChild("linesColors",new o.LineToolColorsProperty([e.childs().color])),e.addChild("linesWidths",new o.LineToolWidthsProperty([e.childs().linewidth])),e.addChild("backgroundsColors",new o.LineToolColorsProperty([e.childs().backgroundColor])),e.addChild("textsColors",new o.LineToolColorsProperty([e.childs().textColor],e.childs().showLabel)),e.addExclusion("linesColors"),e.addExclusion("linesWidths"),e.addExclusion("backgroundsColors"),e.addExclusion("text")}}},768574:(e,t,i)=>{"use strict";i.d(t,{LineToolComment:()=>s});var r=i(853965),n=i(179180);class s extends n.LineToolBalloon{constructor(e,t,i,r){super(e,t||s.createProperties(),i,r)}name(){return"Comment"}static createProperties(e){const t=new r.DefaultProperty("linetoolcomment",e);return s._configureProperties(t),t}_createPaneView(){Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,229548)).then((e=>{this._setPaneViews([new e.CommentPaneView(this,this._model)])}))}}},73217:(e,t,i)=>{"use strict";i.d(t,{LineToolCrossLine:()=>l});var r=i(853965),n=i(682912),s=i(421644),o=i(821979);class l extends o.LineDataSource{constructor(e,t,r,o){super(e,t||l.createProperties(),r,o),this._priceAxisView=new n.LineToolHorzLinePriceAxisView(this),this._timeAxisView=new s.LineToolVertLineTimeAxisView(this),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,533661)).then((({CrossLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}pointsCount(){return 1}name(){return"Cross Line"}priceAxisViews(e,t){return this.isSourceHidden()?null:t===this.priceScale()&&this.properties().childs().showPrice.value()&&this._model.paneForSource(this)===e?[this._priceAxisView]:null}timeAxisViews(){return this.isSourceHidden()?null:this.properties().childs().showTime.value()?[this._timeAxisView]:null}updateAllViews(e){super.updateAllViews(e), this._priceAxisView.update(e),this._timeAxisView.update()}canHasAlert(){return!1}lineColor(){return this.properties().childs().linecolor.value()}lineWidth(){return this.properties().childs().linewidth.value()}lineStyle(){return this.properties().childs().linestyle.value()}static createProperties(e){const t=new r.DefaultProperty("linetoolcrossline",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,184062)).then((e=>e.CrossLineDefinitionsViewModel))}}},70726:(e,t,i)=>{"use strict";i.d(t,{CustomEventItem:()=>s,LineToolCustomUrlEvent:()=>o});var r=i(650151),n=i(776954);class s{constructor(e){this._source=e}position(){return this._props().childs().position.value()}_props(){return this._source.properties()}}class o extends n.LineToolWithRelativePriceCoordinate{constructor(){super(...arguments),this._item=null,this._eventTimePointIndex=null}pointsCount(){return 1}cloneable(){return!1}eventTimePointIndex(){return this._eventTimePointIndex}customEvent(){return this._item}restorePoints(e,t,i){i&&t.length>0&&(this._eventTimePointIndex=t[0].index),super.restorePoints(e,t,i)}priceAxisPoints(){return[]}_baseSeriesIndexForPoint(e){var t;return null!==(t=this._eventTimePointIndex)&&void 0!==t?t:e.index}_alignPointHorizontallyOrVertically(e){var t,i;if(null===this._eventTimePointIndex)return e;const n=this._points[0].index-this._eventTimePointIndex,s=(0,r.ensure)(null===(i=null===(t=this._startMovingPoint)||void 0===t?void 0:t.logical)||void 0===i?void 0:i.index)-n;return{price:e.price,index:s}}_snapPoint45Degree(e,t,i){this._eventTimePointIndex&&(e.index=this._eventTimePointIndex)}_snapTo45DegreesAvailable(){return!0}_allowChangeAnchorHorizontally(){return!0}_pointsForPointset(){return[[(0,r.ensureNotNull)(this._item).time(),0],...super._pointsForPointset()]}_onPointsetUpdated(e){if(0===e.length)return;const t=e.findIndex((e=>0===e.index));-1!==t&&(this._eventTimePointIndex=e[t].value[0]);const i=e.slice(1).map((e=>({value:e.value,index:e.index-1})));super._onPointsetUpdated(i)}_readyToCreatePointset(){return super._readyToCreatePointset()&&null!==this._item}}},224777:(e,t,i)=>{"use strict";i.d(t,{LineToolCypherPattern:()=>s});var r=i(147985),n=i(853965);class s extends r.LineTool5PointsPattern{constructor(e,t,i,r){super(e,t||s.createProperties(),i,r)}name(){return"Cypher Pattern"}static createProperties(e){const t=new n.DefaultProperty("linetoolcypherpattern",e);return this._configureProperties(t),t}_loadPaneViews(e){Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,100417)).then((t=>{this._setPaneViews([new t.CypherPaneView(this,e)])}))}}},836843:(e,t,i)=>{"use strict";i.d(t,{LineToolDateAndPriceRange:()=>m});var r=i(650151),n=i(821979),s=i(3140),o=i(61499),l=i(790188),a=i(738232),c=i(923237),u=i(941883);const d=(0,l.getHexColorByName)("color-tv-blue-500"),h={...u.nonThemedFactoryDefaultsBase,drawBorder:!1,borderWidth:1},p=new Map([[o.StdTheme.Light,{ ...u.themedFactoryDefaultsBase.get(o.StdTheme.Light),borderColor:d}],[o.StdTheme.Dark,{...u.themedFactoryDefaultsBase.get(o.StdTheme.Dark),borderColor:d}]]),v=(0,a.extractAllPropertiesKeys)((0,r.ensureDefined)(p.get(o.StdTheme.Light))),_=(0,a.extractAllPropertiesKeys)(h),f=[...v,..._,...c.commonLineToolPropertiesStateKeys,...u.allPropertiesStateKeysBase];class g extends u.DateAndPriceBaseProperties{static create(e){return new this({defaultName:"linetooldateandpricerange",defaultsSupplier:()=>(0,a.factoryDefaultsForCurrentTheme)(h,p),nonThemedDefaultsKeys:_,themedDefaultsKeys:v,allStateKeys:f,state:e})}}class m extends n.LineDataSource{constructor(e,t,r,n){super(e,t||m.createProperties(),r,n),this._volumeCalculator=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,745062)).then((e=>{this._setPaneViews([new e.DateAndPriceRangePaneView(this,this._model)])}))}destroy(){super.destroy(),null!==this._volumeCalculator&&this._volumeCalculator.destroy()}pointsCount(){return 2}name(){return"Date and Price Range"}template(){return this._properties.template()}volume(){if(null===this._volumeCalculator)return NaN;const e=this.points();return this._volumeCalculator.volume(e[0].index,e[1].index)}setOwnerSource(e){e===this._model.mainSeries()&&((0,r.assert)(null===this._volumeCalculator),this._volumeCalculator=new s.SeriesTimeRangeVolumeCalculator(this._model.mainSeries())),super.setOwnerSource(e)}static createProperties(e){const t=g.create(e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,133954))).GeneralDatePriceRangeDefinitionsViewModel}}},727264:(e,t,i)=>{"use strict";i.d(t,{LineToolDateRange:()=>f});var r=i(650151),n=i(821979),s=i(3140),o=i(61499),l=i(738232),a=i(941883),c=i(923237);const u={...a.nonThemedFactoryDefaultsBase,extendTop:!1,extendBottom:!1},d=a.themedFactoryDefaultsBase,h=(0,l.extractAllPropertiesKeys)((0,r.ensureDefined)(d.get(o.StdTheme.Light))),p=(0,l.extractAllPropertiesKeys)(u),v=[...h,...p,...c.commonLineToolPropertiesStateKeys,...a.allPropertiesStateKeysBase];class _ extends a.DateAndPriceBaseProperties{static create(e){return new this({defaultName:"linetooldaterange",defaultsSupplier:()=>(0,l.factoryDefaultsForCurrentTheme)(u,d),nonThemedDefaultsKeys:p,themedDefaultsKeys:h,allStateKeys:v,state:e})}}class f extends n.LineDataSource{constructor(e,t,r,n){super(e,t||f.createProperties(),r,n),this._volumeCalculator=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,691448)).then((e=>{this._setPaneViews([new e.DateRangePaneView(this,this._model)])}))}destroy(){super.destroy(),null!==this._volumeCalculator&&this._volumeCalculator.destroy()}pointsCount(){return 2}name(){return"Date Range"}template(){return this._properties.template()}volume(){if(null===this._volumeCalculator)return NaN;const e=this.points();return this._volumeCalculator.volume(e[0].index,e[1].index)}setOwnerSource(e){ e===this._model.mainSeries()&&((0,r.assert)(null===this._volumeCalculator),this._volumeCalculator=new s.SeriesTimeRangeVolumeCalculator(this._model.mainSeries())),super.setOwnerSource(e)}static createProperties(e){const t=_.create(e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,133954))).GeneralDatePriceRangeDefinitionsViewModel}}},709638:(e,t,i)=>{"use strict";i.d(t,{LineToolDisjointChannel:()=>l});var r=i(821979),n=i(853965),s=i(389137),o=i(190973);class l extends r.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:l.createProperties(),r,n),this.version=1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,318467)).then((e=>{this._setPaneViews([new e.DisjointChannelPaneView(this,this._model)])}))}pointsCount(){return 3}name(){return"Disjoint Channel"}hasEditableCoordinates(){return!1}addPoint(e,t,i){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),super.addPoint(e)}setLastPoint(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),super.setLastPoint(e)}setPoint(e,t,i,r){const n=.5*(this._points[1].price+this._points[2].price);if(i&&i.shift()&&1===e){const e=0;this._snapPoint45Degree(t,this.points()[e])}if(e<3&&super.setPoint(e,t),0!==e&&2!==e){if(1===e){const e=this._points[1].price-n;this._points[2].price=this._points[1].price-2*e}else if(3===e){const e=t.price-this._points[2].price;this._points[0].price=this._points[1].price-e,this._points[0].index=t.index}this.normalizePoints()}}getPoint(e){if(e<3)return super.getPoint(e);const t=this._points[0].price-this._points[2].price;return{index:this._points[0].index,price:this._points[1].price-t}}canHasAlert(){return!0}template(){const e=super.template();return e.labelText=this.properties().childs().labelText.value(),e}static createProperties(e){const t=new n.DefaultProperty("linetooldisjointangle",e);return this._configureProperties(t),t}_applyTemplateImpl(e){var t;super._applyTemplateImpl(e),this.properties().childs().labelText.setValue(null!==(t=e.labelText)&&void 0!==t?t:"")}_getAlertPlots(){const e=this._points[0],t=this._points[1],i=[];e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e));const r=this._points[2];r.time=t.time,r.index=t.index;const n={price:r.price+(t.price-e.price),time:e.time,index:e.index},o=[];let l,a,c,u;r.index<=n.index?(o.push(r),o.push(n)):(o.push(n),o.push(r)),i[0].price>o[0].price?(l=i,a=o):o[0].price>i[0].price||o[1].price>i[1].price?(l=o,a=i):(l=i,a=o);const d=this.properties().childs().extendLeft.value(),h=this.properties().childs().extendRight.value();return e.index<=t.index?(c=d,u=h):(c=h,u=d),[this._linePointsToAlertPlot(l,"Upper",c,u),this._linePointsToAlertPlot(a,"Lower",c,u)].filter(s.notNull)}async _getPropertyDefinitionsViewModelClass(){ return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,872077))).GeneralTrendFiguresDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.hasChild("labelText")||e.addChild("labelText",new o.default("")),e.addExclusion("labelText")}}},960690:(e,t,i)=>{"use strict";i.d(t,{LineToolElliott:()=>h,LineToolElliottCorrection:()=>C,LineToolElliottDoubleCombo:()=>T,LineToolElliottImpulse:()=>_,LineToolElliottTriangle:()=>g,LineToolElliottTripleCombo:()=>P});var r=i(444372),n=i(809796),s=i(821979),o=i(373571),l=i(853965),a=i(31712);const c=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],u=new n.TranslatedString("change Elliott degree",r.t(null,void 0,i(876020))),d=[{value:0,title:r.t(null,void 0,i(433820))},{value:1,title:r.t(null,void 0,i(558397))},{value:2,title:r.t(null,void 0,i(609753))},{value:3,title:r.t(null,void 0,i(718367))},{value:4,title:r.t(null,void 0,i(591889))},{value:5,title:r.t(null,void 0,i(495176))},{value:6,title:r.t(null,void 0,i(348404))},{value:7,title:r.t(null,void 0,i(671778))},{value:8,title:r.t(null,{context:"wave"},i(266051))},{value:9,title:r.t(null,{context:"wave"},i(486054))},{value:10,title:r.t(null,void 0,i(185884))},{value:11,title:r.t(null,void 0,i(471722))},{value:12,title:r.t(null,void 0,i(210931))},{value:13,title:r.t(null,void 0,i(729662))},{value:14,title:r.t(null,void 0,i(609632))}];class h extends s.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:h.createProperties(),r,n),this.version=4,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,762994)).then((e=>{this._setPaneViews([new e.ElliottLabelsPaneView(this,this._model)])}))}migrateVersion(e,t,i){if(i.properties.hasChild("background")&&i.properties.removeProperty("background"),i.properties.hasChild("backgroundColor")&&i.properties.removeProperty("backgroundColor"),i.properties.hasChild("showBackground")&&i.properties.removeProperty("showBackground"),1===e){const e=Object.assign({},this._timePoint[0]);if(this._timePoint.unshift(e),this._points.length>0){const e=Object.assign({},this._points[0]);this._points.unshift(e)}}}applyTemplate(e){const t=e;delete t.background,delete t.backgroundColor,delete t.showBackground,super.applyTemplate(e)}name(){return"Elliott Labels"}additionalActions(e){return[new o.Action({actionId:"Chart.LineTool.Elliot.ChangeDegreeProperty",options:{label:r.t(null,void 0,i(69479)),subItems:c.map((t=>{const i=d.filter((e=>e.value===t))[0];return new o.Action({actionId:"Chart.LineTool.Elliot.ChangeDegreeProperty",options:{label:i.title,checkable:!0,checked:this.properties().childs().degree.value()===t,onExecute:()=>{e.setProperty(this.properties().childs().degree,t,u)}}})}))}})]}label(e){const t=c.length-this.properties().childs().degree.value()-1,i=Math.floor(t/3);return{group:i,bold:!!(i%2),decoration:["","brackets","circle"][t%3],label:this.labelsGroup()[i][e]}}availableDegreesValues(){return d}static createProperties(e){const t=new l.DefaultProperty("linetoolelliott",e);return this._configureProperties(t),t} static migrateState(e){const t={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinor"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottCircle"===e.type&&(e.type="LineToolElliottImpulse",e.state.degree=t[e.state.wavesize]),"LineToolElliottMinorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize]),"LineToolElliottMajorRetr"===e.type&&(e.type="LineToolElliottCorrection",e.state.degree=i[e.state.wavesize])}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,46971))).ElliottPatternDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new a.LineToolColorsProperty([e.childs().color])),e.addExclusion("linesColors")}}class p extends h{pointsCount(){return 6}}const v=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]];class _ extends p{constructor(e,t,i,r){super(e,t||_.createProperties(),i,r)}name(){return"Elliott Impulse Wave (12345)"}labelsGroup(){return v}static createProperties(e){const t=new l.DefaultProperty("linetoolelliottimpulse",e);return this._configureProperties(t),t}}const f=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]];class g extends p{constructor(e,t,i,r){super(e,t||g.createProperties(),i,r)}name(){return"Elliott Triangle Wave (ABCDE)"}labelsGroup(){return f}static createProperties(e){const t=new l.DefaultProperty("linetoolelliotttriangle",e);return this._configureProperties(t),t}}const m=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]];class P extends p{constructor(e,t,i,r){super(e,null!=t?t:P.createProperties(),i,r)}name(){return"Elliott Triple Combo Wave (WXYXZ)"}labelsGroup(){return m}static createProperties(e){const t=new l.DefaultProperty("linetoolelliotttriplecombo",e);return this._configureProperties(t),t}}class y extends h{pointsCount(){return 4}}const w=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]];class C extends y{constructor(e,t,i,r){super(e,null!=t?t:C.createProperties(),i,r)}name(){return"Elliott Correction Wave (ABC)"}labelsGroup(){return w}static createProperties(e){const t=new l.DefaultProperty("linetoolelliottcorrection",e);return this._configureProperties(t),t}}const b=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]];class T extends y{constructor(e,t,i,r){super(e,null!=t?t:T.createProperties(),i,r)}name(){return"Elliott Double Combo Wave (WXY)"}labelsGroup(){return b}static createProperties(e){const t=new l.DefaultProperty("linetoolelliottdoublecombo",e);return this._configureProperties(t),t}}}, 43853:(e,t,i)=>{"use strict";i.d(t,{LineToolEllipse:()=>u});var r=i(650151),n=i(204652),s=i(86441),o=i(190973),l=i(821979),a=i(853965),c=i(31712);class u extends l.LineDataSource{constructor(e,t,r,n){super(e,t||u.createProperties(),r,n),this.version=2,this._dist=null,this._fakePointAdded=!1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,555422)).then((({EllipsePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){const e=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),t=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[2]));this._dist=(0,n.distanceToLine)(e,t,i).distance||0}}addPoint(e,t,i){const r=super.addPoint(e,t,i);return r&&(this._fakePointAdded=!1),r}setPoint(e,t,i,o){const l={...t};let a=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),c=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),u=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[2]));switch(e){case 0:{if(i&&i.shift()){this._snapPoint45Degree(l,this._points[1]),this._points[0]=l,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}a=(0,r.ensureNotNull)(this.pointToScreenPoint(l));const e=c.subtract(a),t=a.add(c).scaled(.5),n=new s.Point(-e.y,e.x).normalized();u=t.add(n.scaled((0,r.ensureNotNull)(this._dist))),this._points[0]=l,this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(u));break}case 1:{if(i&&i.shift()){this._snapPoint45Degree(l,this._points[0]),this._points[1]=l,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}c=(0,r.ensureNotNull)(this.pointToScreenPoint(l));const e=c.subtract(a),t=a.add(c).scaled(.5),n=new s.Point(-e.y,e.x).normalized();u=t.add(n.scaled((0,r.ensureNotNull)(this._dist))),this._points[1]=l,this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(u));break}case 2:{const e=(0,r.ensureNotNull)(this.pointToScreenPoint(l)),t=(0,n.distanceToLine)(a,c,e).distance,i=c.subtract(a),o=a.add(c).scaled(.5),d=new s.Point(-i.y,i.x).normalized();u=o.add(d.scaled(t)),this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(u));break}case 3:{const e=(0,r.ensureNotNull)(this.pointToScreenPoint(l)),t=(0,n.distanceToLine)(a,c,e).distance,i=c.subtract(a),o=a.add(c).scaled(.5),d=new s.Point(-i.y,i.x).normalized();u=o.add(d.scaled(t)),this._points[2]=(0,r.ensureNotNull)(this.screenPointToPoint(u));break}}this.normalizePoints()}pointsCount(){return 3}name(){return"Ellipse"}hasEditableCoordinates(){return!1}migrateVersion(e,t,i){if(1===e&&2===this._points.length){const e=this._points[0].price,t=.5*(this._points[0].price+this._points[1].price);this._points[0]={price:t,index:this._points[0].index},this._points[1]={ price:t,index:this._points[1].index},this._points.push({price:e,index:this._points[0].index})}if(1===e&&2===this._timePoint.length){const e=this._timePoint[0].price,t=.5*(this._timePoint[0].price+this._timePoint[1].price);this._timePoint[0].price=t,this._timePoint[1].price=t;const i={price:e,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t};this._timePoint.push(i)}}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e){const t=new a.DefaultProperty("linetoolellipse",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,70418))).EllipseCircleDefinitionsViewModel}_preparePoint(e,t){const i=this._preparePointInternal(e,t,!1);return t&&t.shift()&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.default("")),e.addChild("linesColors",new c.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new c.LineToolColorsProperty([e.childs().textColor],e.childs().showLabel)),e.addExclusion("text")}_preparePointInternal(e,t,i){let n={...e};if(t&&t.shift()){const t=this.points().length;if(!this._fakePointAdded&&3===t&&!i)return n;if(this._fakePointAdded||2===t||i){this._snapPoint45Degree(e,this._points[0]),this._fakePointAdded?this._points[1]=e:i||(this._fakePointAdded=!0,super._addPointIntenal(e));const t=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),o=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),l=o.x-t.x,a=o.y-t.y,c=Math.sqrt(l*l+a*a)/2,u=o.subtract(t),d=t.add(o).scaled(.5),h=new s.Point(-u.y,u.x).normalized(),p=d.add(h.scaled(c));n=(0,r.ensureNotNull)(this.screenPointToPoint(p)),(isNaN(n.price)||isNaN(n.index))&&(n=(0,r.ensureNotNull)(this.screenPointToPoint(d)))}}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return n}_fixVerticalDiameterPoints(e,t,i){const n=(0,r.ensureNotNull)(this.pointToScreenPoint(e)),o=(0,r.ensureNotNull)(this.pointToScreenPoint(t)),l=this._model.timeScale(),a=l.indexToCoordinate(e.index),c=l.indexToCoordinate(i.index);let u=2*Math.abs(a-c);u*=t.price>e.price?1:-1,e.price=(0,r.ensureNotNull)(this.screenPointToPoint(new s.Point(n.x,o.y+u))).price}}},167843:(e,t,i)=>{"use strict";i.d(t,{LineToolEmoji:()=>w});var r=i(328530),n=i(201089),s=i(120780),o=i(885482),l=i(760184),a=i(822914),c=i(852290),u=i(404720),d=i(808068),h=i(738232),p=i(923237);const v={intervalsVisibilities:{...d.intervalsVisibilitiesDefaults},size:40},_={emoji:"😀",angle:.5*Math.PI},f=(0,h.extractAllPropertiesKeys)(v),g=(0,h.extractAllPropertiesKeys)(_),m=[...f,...g,...p.commonLineToolPropertiesStateKeys];class P extends u.LineDataSourceThemedProperty{constructor(e){super(e)} static create(e,t){return new this({defaultName:"linetoolemoji",defaultsSupplier:()=>(0,a.default)(v),nonThemedDefaultsKeys:f,themedDefaultsKeys:[],state:(0,c.default)({},_,{emoji:t},null!=e?e:{}),allStateKeys:m})}}const y=(0,n.getLogger)("Chart.LineToolEmoji");class w extends l.LineToolSvgIconBase{constructor(e,t,i,r){super(e,t||w.createProperties(),i,r),this.version=1,this._loadViews()}name(){return"Emoji"}template(){return this.properties().template()}static createProperties(e){const t=P.create(e,o.emojiTool.value());return w._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,282375))).LineDataSourceDefinitionsViewModel}async _loadViews(){const e=this._properties.childs().emoji.value(),t=(0,r.getTwemojiUrl)(e,"svg");try{const[r,{EmojiPaneView:n},{svgRenderer:o}]=await Promise.all([(0,s.fetch)(t).then((e=>e.text())),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,496259)),i.e(72616).then(i.bind(i,500477))]);if(!this._isDestroyed){this._svgContent=r,this._onIconChanged.fire();const t=o(r);null===t&&y.logWarn(`Couldn't create svg renderer for emoji ${e}`),this._setPaneViews([new n(this,this._model,t)])}}catch(t){y.logWarn(`An error ocurred while loading emoji content ${e}: ${t}`)}}}},252598:(e,t,i)=>{"use strict";i.d(t,{LineToolExtended:()=>n});var r=i(956268);class n extends r.LineToolTrendLine{constructor(e,t,i,r){super(e,null!=t?t:n.createProperties(),i,r)}name(){return"Extended Line"}static createProperties(e){const t=r.LineToolTrendLine._createPropertiesImpl("linetoolextended",e);return n._configureProperties(t),t}}},965989:(e,t,i)=>{"use strict";i.d(t,{LineToolFibChannel:()=>u});var r=i(650151),n=i(444372),s=i(809796),o=i(821979),l=i(517336),a=i(31712);const c=new s.TranslatedString("erase level line",n.t(null,void 0,i(812962)));class u extends o.LineDataSource{constructor(e,t,r,n){super(e,t||u.createProperties(),r,n),this.version=2,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,361501)).then((({FibChannelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return 24}migrateVersion(e,t,i){i.properties.removeProperty("reverse")}pointsCount(){return 3}name(){return"Fib Channel"}processErase(e,t){const i="level"+t,r=this.properties().child(i).childs().visible;e.setProperty(r,!1,c)}static createProperties(e){const t=new l.LevelsProperty("linetoolfibchannel",e,!1,{range:[1,24],names:["coeff","color","visible"]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,866406))).FibDrawingsWith24LevelsDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e);const t=[];for(let i=1;i<=24;i++){const n=(0,r.ensureDefined)(e.child("level"+i));t.push((0,r.ensureDefined)(n.child("color")))}e.addChild("linesColors",new a.LineToolColorsProperty(t)) }}},953718:(e,t,i)=>{"use strict";i.d(t,{LineToolFibCircles:()=>u});var r=i(650151),n=i(444372),s=i(809796),o=i(821979),l=i(517336),a=i(31712);const c=new s.TranslatedString("erase level line",n.t(null,void 0,i(812962)));class u extends o.LineDataSource{constructor(e,t,r,n){super(e,t||u.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,889131)).then((e=>{this._setPaneViews([new e.FibCirclesPaneView(this,this._model)])}))}levelsCount(){return 11}pointsCount(){return 2}name(){return"Fib Circles"}processErase(e,t){const i=(0,r.ensureDefined)(this.properties().child(`level${t}`));e.setProperty(i,!1,c)}static createProperties(e){const t=new l.LevelsProperty("linetoolfibcircles",e,!1,{range:[1,11]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,151611))).FibCirclesDefinitionsViewModel}_snapTo45DegreesAvailable(){return!0}static _configureProperties(e){var t,i;super._configureProperties(e);const n=e.childs(),s=[n.trendline.childs().linewidth],o=[n.trendline.childs().color];for(let n=1;n<=11;n++)s.push((0,r.ensureDefined)(null===(t=e.child("level"+n))||void 0===t?void 0:t.child("linewidth"))),o.push((0,r.ensureDefined)(null===(i=e.child("level"+n))||void 0===i?void 0:i.child("color")));e.addChild("linesColors",new a.LineToolColorsProperty(o)),e.addChild("linesWidths",new a.LineToolWidthsProperty(s))}}},498995:(e,t,i)=>{"use strict";i.d(t,{LineToolFibRetracement:()=>c});var r=i(444372),n=i(809796),s=i(517336),o=i(821979),l=i(31712);const a=new n.TranslatedString("erase level line",r.t(null,void 0,i(812962)));class c extends o.LineDataSource{constructor(e,t,r,n){super(e,t||c.createProperties(),r,n),this.version=2,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,832307)).then((e=>{this._setPaneViews([new e.FibRetracementPaneView(this,this._model)])}))}levelsCount(){return 24}pointsCount(){return 2}name(){return"Fib Retracement"}migrateVersion(e){1===e&&this.properties().childs().extendLines.setValue(!0)}processErase(e,t){const i="level"+t,{visible:r}=this.properties().childs()[i].childs();e.setProperty(r,!1,a)}fibLevelsBasedOnLogScale(){var e;return this.properties().childs().fibLevelsBasedOnLogScale.value()&&!!(null===(e=this.priceScale())||void 0===e?void 0:e.isLog())}static createProperties(e){const t=new s.LevelsProperty("linetoolfibretracement",e,!1,{range:[1,24],names:["coeff","color","visible"]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,866406))).FibDrawingsWith24LevelsDefinitionsViewModel}static _configureProperties(e){var t;const i=e;super._configureProperties(i);const r=[i.childs().trendline.childs().linewidth,i.childs().levelsStyle.childs().linewidth],n=[i.childs().trendline.childs().color];for(let e=1;e<=24;e++){ const r=null===(t=i.child("level"+e))||void 0===t?void 0:t.child("color");n.push(r)}i.addChild("linesColors",new l.LineToolColorsProperty(n)),i.addChild("linesWidths",new l.LineToolWidthsProperty(r))}}},974472:(e,t,i)=>{"use strict";i.d(t,{LineToolFibSpeedResistanceArcs:()=>u});var r=i(650151),n=i(444372),s=i(809796),o=i(821979),l=i(517336),a=i(31712);const c=new s.TranslatedString("erase level line",n.t(null,void 0,i(812962)));class u extends o.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:u.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,303842)).then((e=>{this._setPaneViews([new e.FibSpeedResistanceArcsPaneView(this,this._model)])}))}levelsCount(){return 11}pointsCount(){return 2}name(){return"Fib Speed Resistance Arcs"}processErase(e,t){const i=(0,r.ensureDefined)(this.properties().child(`level${t}`)).childs().visible;e.setProperty(i,!1,c)}static createProperties(e){const t=new l.LevelsProperty("linetoolfibspeedresistancearcs",e,!1,{range:[1,11]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,149820))).FibSpeedResistanceArcsDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e);const t=e.childs().trendline.childs(),i=[t.linewidth],n=[t.color];for(let t=1;t<=11;t++){const s=(0,r.ensureDefined)(e.child(`level${t}`)).childs();i.push(s.linewidth),n.push(s.color)}e.addChild("linesColors",new a.LineToolColorsProperty(n)),e.addChild("linesWidths",new a.LineToolWidthsProperty(i))}}},63491:(e,t,i)=>{"use strict";i.d(t,{LineToolFibSpeedResistanceFan:()=>u});var r=i(650151),n=i(444372),s=i(809796),o=i(821979),l=i(517336),a=i(31712);const c=new s.TranslatedString("erase level line",n.t(null,void 0,i(812962)));class u extends o.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:u.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,446261)).then((e=>{this._setPaneViews([new e.FibSpeedResistanceFanPaneView(this,this._model)])}))}hLevelsCount(){return 7}vLevelsCount(){return 7}pointsCount(){return 2}name(){return"Fib Speed Resistance Fan"}processErase(e,t){const i=`${t.type}level${t.index}`,n=(0,r.ensureDefined)(this.properties().child(i)).childs().visible;e.setProperty(n,!1,c)}static createProperties(e){e&&void 0===e.reverse&&(e.reverse=!0);const t=new l.LevelsProperty("linetoolfibspeedresistancefan",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,233169))).FibSpeedResistanceFanDefinitionsViewModel}_snapTo45DegreesAvailable(){return!0}static _configureProperties(e){var t,i;super._configureProperties(e);const n=[e.childs().grid.childs().color];for(let i=1;i<=7;i++)n.push((0, r.ensureDefined)(null===(t=e.child(`hlevel${i}`))||void 0===t?void 0:t.child("color")));for(let t=1;t<=7;t++)n.push((0,r.ensureDefined)(null===(i=e.child(`vlevel${t}`))||void 0===i?void 0:i.child("color")));e.addChild("linesColors",new a.LineToolColorsProperty(n)),e.addExclusion("linesColors")}}},958849:(e,t,i)=>{"use strict";i.d(t,{LineToolFibTimeZone:()=>c});var r=i(444372),n=i(809796),s=i(31712),o=i(517336),l=i(821979);const a=new n.TranslatedString("erase level line",r.t(null,void 0,i(812962)));class c extends l.LineDataSource{constructor(e,t,r,n){super(e,t||c.createProperties(),r,n),this.version=2,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,122613)).then((({FibTimeZonePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return 11}migrateVersion(e,t,i){if(1===e){const e=i.properties.childs(),t=i.properties,r=t.baselinecolor.value(),n=t.linecolor.value(),s=t.linewidth.value(),o=t.linestyle.value();e.level1.childs().color.setValue(r);for(let t=2;t<=11;t++)e["level"+t].childs().color.setValue(n);for(let t=1;t<=11;t++)e["level"+t].childs().linewidth.setValue(s),e["level"+t].childs().linestyle.setValue(o)}}pointsCount(){return 2}name(){return"Fib Time Zone"}processErase(e,t){const i="level"+t,r=this.properties().childs()[i].childs().visible;e.setProperty(r,!1,a)}static createProperties(e){const t=new o.LevelsProperty("linetoolfibtimezone",e,!1,{range:[1,11]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,542375))).FibTimezoneDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e);const t=[],i=[];for(let r=1;r<=11;r++){const n=e.childs()["level"+r].childs();t.push(n.linewidth),i.push(n.color)}e.addChild("linesColors",new s.LineToolColorsProperty(i)),e.addChild("linesWidths",new s.LineToolWidthsProperty(t))}}},672688:(e,t,i)=>{"use strict";i.d(t,{LineToolFibWedgeBase:()=>o});var r=i(650151),n=i(86441),s=i(821979);class o extends s.LineDataSource{pointsCount(){return 3}hasEditableCoordinates(){return!1}setPoint(e,t){if(super.setPoint(e,t),!this._recursiveGuard)try{if(this._recursiveGuard=!0,2===e){const e=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0]));let t=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1]));const i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[2])).subtract(e).length();let s=t.subtract(e);s.length()<=0&&(s=new n.Point(1,0)),t=e.add(s.normalized().scaled(i));const o=(0,r.ensureNotNull)(this.screenPointToPoint(t)),l=this._pointsProperty.childs().points[1];l.childs().price.setValue(o.price),l.childs().bar.setValue(o.index)}else{const e=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),t=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1]));let i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[2]));const s=t.subtract(e).length();let o=i.subtract(e);o.length()<=0&&(o=new n.Point(1,0)), i=e.add(o.normalized().scaled(s));const l=(0,r.ensureNotNull)(this.screenPointToPoint(i)),a=this._pointsProperty.childs().points[2];a.childs().price.setValue(l.price),a.childs().bar.setValue(l.index)}}finally{this._recursiveGuard=!1}}addPoint(e){if(2===this._points.length){const t=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1]));let n=(0,r.ensureNotNull)(this.pointToScreenPoint(e));const s=i.subtract(t).length(),o=n.subtract(t).normalized();n=t.add(o.scaled(s));const l=(0,r.ensureNotNull)(this.ownerSource()),a=(0,r.ensureNotNull)(l.firstValue()),c=(0,r.ensureNotNull)(this.priceScale()).coordinateToPrice(n.y,a);e={index:Math.round(this._model.timeScale().coordinateToIndex(n.x)),price:c}}return super.addPoint(e)}}},781811:(e,t,i)=>{"use strict";i.d(t,{LineToolFibWedge:()=>u});var r=i(650151),n=i(444372),s=i(809796),o=i(672688),l=i(517336),a=i(31712);const c=new s.TranslatedString("erase level line",n.t(null,void 0,i(812962)));class u extends o.LineToolFibWedgeBase{constructor(e,t,r,n){super(e,null!=t?t:u.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,257760)).then((e=>{this._setPaneViews([new e.FibWedgePaneView(this,this._model)])}))}levelsCount(){return 11}isSynchronizable(){return!1}name(){return"Fib Wedge"}processErase(e,t){const i=(0,r.ensureDefined)(this.properties().child(`level${t}`));e.setProperty(i.childs().visible,!1,c)}static createProperties(e){const t=new l.LevelsProperty("linetoolfibwedge",e,!1,{range:[1,11]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,444191))).FibWedgeDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e);const t=[e.childs().trendline.childs().linewidth],i=[e.childs().trendline.childs().color];for(let n=1;n<=11;n++){const s=(0,r.ensureDefined)(e.child(`level${n}`));t.push(s.childs().linewidth),i.push(s.childs().color)}e.addChild("linesColors",new a.LineToolColorsProperty(i)),e.addChild("linesWidths",new a.LineToolWidthsProperty(t))}}},218032:(e,t,i)=>{"use strict";i.d(t,{LineToolFlagMark:()=>l});var r=i(86441),n=i(821979),s=i(853965),o=i(31712);class l extends n.LineDataSource{constructor(e,t,n,s){super(e,t||l.createProperties(),n,s),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,812318)).then((({FlagMarkPaneView:e})=>{const t=new e(this,this.model());t.setAnchors(new r.Point(0,0)),this._setPaneViews([t])}))}pointsCount(){return 1}name(){return"Flag Mark"}static createProperties(e){e&&void 0===e.flagColor&&(e.flagColor="#318757");const t=new s.DefaultProperty("linetoolflagmark",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,268987)).then((e=>e.FlagMarkDefinitionsViewModel))}static _configureProperties(e){ super._configureProperties(e),e.addChild("backgroundsColors",new o.LineToolColorsProperty([e.childs().flagColor])),e.addExclusion("backgroundsColors")}}l.version=2},634659:(e,t,i)=>{"use strict";i.d(t,{LineToolFlatBottom:()=>l});var r=i(821979),n=i(853965),s=i(389137),o=i(190973);class l extends r.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:l.createProperties(),r,n),this.version=1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,767345)).then((e=>{this._setPaneViews([new e.FlatBottomPaneView(this,this._model)])}))}pointsCount(){return 3}name(){return"Flat Bottom"}hasEditableCoordinates(){return!1}addPoint(e,t,i){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),super.addPoint(e)}setLastPoint(e,t){return t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[this.points().length-2]),super.setLastPoint(e)}setPoint(e,t,i,r){if(i&&i.shift()&&1===e){const e=0;this._snapPoint45Degree(t,this.points()[e])}if(2===e)this._points[1].index=t.index;else if(3===e)return this._points[0].index=t.index,this._points[2].price=t.price,void this.normalizePoints();super.setPoint(e,t)}getPoint(e){return e<3?super.getPoint(e):3===e?{index:this._points[0].index,price:this._points[2].price}:null}canHasAlert(){return!0}template(){const e=super.template();return e.labelText=this.properties().childs().labelText.value(),e}static createProperties(e){const t=new n.DefaultProperty("linetoolflatbottom",e);return this._configureProperties(t),t}_applyTemplateImpl(e){var t;super._applyTemplateImpl(e),this.properties().childs().labelText.setValue(null!==(t=e.labelText)&&void 0!==t?t:"")}_getAlertPlots(){const e=this._points[0],t=this._points[1],i=[];e.index<=t.index?(i.push(e),i.push(t)):(i.push(t),i.push(e));const r=this._points[2];r.time=t.time,r.index=t.index;const n={price:r.price,time:e.time,index:e.index},o=[];let l,a,c,u;r.index<=n.index?(o.push(r),o.push(n)):(o.push(n),o.push(r)),i[0].price>o[0].price?(l=i,a=o):o[0].price>i[0].price||o[1].price>i[1].price?(l=o,a=i):(l=i,a=o);const d=this.properties().childs().extendLeft.value(),h=this.properties().childs().extendRight.value();return e.index<=t.index?(c=d,u=h):(c=h,u=d),[this._linePointsToAlertPlot(l,"Upper",c,u),this._linePointsToAlertPlot(a,"Lower",d,u)].filter(s.notNull)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,872077))).GeneralTrendFiguresDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.hasChild("labelText")||e.addChild("labelText",new o.default("")),e.addExclusion("labelText")}}},406182:(e,t,i)=>{"use strict";i.d(t,{createPropertiesObject:()=>l});var r=i(389137),n=i(517336);function s(e,t,i){var n;for(const s of Object.keys(null!==(n=e.levels)&&void 0!==n?n:{}))if(e.levels[s]&&(0,r.isSameType)(e.levels[s],t.typecheck())){let r=t.tpl();i.names.forEach(((i,n)=>{r=t.fill(""+n,i,e.levels[s],r)})),e.levels[s]=r}return e} class o extends n.LevelsProperty{constructor(e,t){super(e,t,!1,{names:["width","color","visible"]},s)}}function l(e,t){return new o(e,t)}},833762:(e,t,i)=>{"use strict";i.d(t,{LineToolGannComplex:()=>d});var r=i(86441),n=i(650151),s=i(327453),o=i(821979),l=i(915179),a=i(406182),c=i(31712),u=i(422333);class d extends o.LineDataSource{constructor(e,t,r,n){super(e,t||d.createProperties(),r,n),this.version=2,this._scaleRatioFormatter=new s.LimitedPrecisionNumericFormatter(7),this.version=2,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,726868)).then((({GannComplexPaneView:e})=>{this._setPaneViews([new e(this,this.model())])}));const o=this.properties();this._adjustScaleRatio(o),o.subscribe(this,this._adjustScaleRatio),o.childs().scaleRatio.subscribe(this,this._correctFirstPoint),this._syncStateExclusions=["scaleRatio"],o.onRestoreFactoryDefaults().subscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.subscribe(this,this._handleTemplateApplying),this._onTemplateApplied.subscribe(this,this._correctFirstPoint)}migrateVersion(e,t,i){1===e&&(this._points.length>=this.pointsCount()?setTimeout((()=>this._migratePoint())):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))}destroy(){const e=this.properties();e.unsubscribe(this,this._adjustScaleRatio),e.childs().scaleRatio.unsubscribe(this,this._correctFirstPoint),e.onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint),super.destroy()}pointsCount(){return 2}name(){return"Gann Square"}addPoint(e,t,i){this._points.length>1&&this._points.pop();const r=super.addPoint(e,t,i),s=this.priceScale();return!(0,n.ensureNotNull)(s).isLog()&&r&&this._correctFirstPoint(),r}setPoint(e,t,i){super.setPoint(e,t,i),void 0!==i&&i.shift()?this._correctPoint(e):this._correctScaleRatio()}setLastPoint(e,t){const i=this.priceScale();return(0,n.ensureNotNull)(i).isLog()||(this._points[1]=e,this._correctPoint(1)),super.setLastPoint(e,t)}isReversed(){return this.properties().childs().reverse.value()}levelsCount(){return this.properties().childs().levels.childCount()}levels(){const e=[],t=this.properties().childs(),i=t.levels.childCount();for(let r=0;re.GannComplexAndFixedDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addExclusion("scaleRatio");const t=[],i=[],r=e.childs();{const e=r.levels.childCount();for(let n=0;n0,o=r.index-n.index>0;let l=s&&!o||!s&&o?-1:1;0===e&&(l=-l),r.price=n.price+l*t*i,this._pointChanged.fire(e)}this.normalizePoints()}_correctFirstPoint(){this._correctPoint(this.isReversed()?0:1)}_handleRestoringFactoryDefaults(){this.properties().childs().scaleRatio.setValue(this._getAdjustedScaleRatio())}_handleTemplateApplying(e){""===e.scaleRatio&&(e.scaleRatio=this._getAdjustedScaleRatio())}_migratePoint(){if(this.points().length0){r=r.normalized();let e=Math.acos(r.x);return r.y>0&&(e=-e),e}return null}}},643442:(e,t,i)=>{"use strict";var r=i(809796).TranslatedString,n=i(821979).LineDataSource,s=i(517336).LevelsProperty,o=i(31712),l=o.LineToolWidthsProperty,a=o.LineToolColorsProperty,c=new r("erase level line",i.tf(null,void 0,i(812962)));class u extends n{constructor(e,t,r,n){super(e,t||u.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,33877)).then((({GannFanPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return u.LevelsCount}pointsCount(){return 2}name(){return"Gann Fan"}processErase(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,c)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,903951))).GannFanDefinitionsViewModel}static createProperties(e){var t=new s("linetoolgannfan",e,!1,{range:[1,9]});return this._configureProperties(t),t}static _configureProperties(e){super._configureProperties(e);for(var t=[],i=[],r=1;r<=this.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new l(t))}}u.LevelsCount=9,t.LineToolGannFan=u},839386:(e,t,i)=>{"use strict";i.d(t,{LineToolGannFixed:()=>a});var r=i(86441),n=i(650151),s=i(821979),o=i(31712),l=i(406182);class a extends s.LineDataSource{constructor(e,t,r,n){super(e,t||a.createProperties(),r,n),this._constructor="LineToolGannFixed",Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,14986)).then((({GannFixedPaneView:e})=>{this._setPaneViews([new e(this,this.model())])})),this.properties().childs().reverse.subscribe(this,this._reversePoints)}pointsCount(){return 2}name(){return"Gann Square Fixed"}axisPoints(){const e=this.points(),t=this.getScreenPoints();return e.length<2||t.length<2?[]:[e[0],(0,n.ensureNotNull)(this.screenPointToPoint(t[1]))]}getScreenPoints(){const e=this.points();if(e.length<2)return[];const t=this._calcAngle();if(null===t)return[];const[i,s]=e,o=(0,n.ensureNotNull)(this.pointToScreenPoint(i)),l=(0, n.ensureNotNull)(this.pointToScreenPoint(s)),a=Math.sqrt(Math.pow(o.x-l.x,2)+Math.pow(o.y-l.y,2)),c=new r.Point(Math.cos(t),-Math.sin(t)),u=c.normalized(),d=u.x<0?-1:1,h=u.y<0?-1:1;return[o.addScaled(c,a),o.add(new r.Point(5*a*d,5*a*h))]}levelsCount(){return this.properties().childs().levels.childCount()}levels(){const e=[],t=this.properties().childs(),i=t.levels.childCount();for(let r=0;re.GannComplexAndFixedDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e);const t=[],i=[],r=e.childs();{const e=r.levels.childCount();for(let n=0;n0&&(o=-o),o}_reversePoints(){const[e,t]=this._points;this._points[0]=t,this._points[1]=e,this.normalizePoints(),this.restart()}}},168853:(e,t,i)=>{"use strict";var r=i(821979).LineDataSource,n=i(517336).LevelsProperty,s=i(31712).LineToolColorsProperty,o=[4.5,9,11.25,18,22.5,36,45],l=function(){for(var e=[],t=o.length-1,i=1,r=0,n=0;n<1e10;)n=o[r]*i,e.push(Math.round(n)),e.push(Math.ceil(-n)),r===t-1&&(i*=10),r=(r+1)%t;return e.sort((function(e,t){return et?1:0})),e}();class a extends r{ constructor(e,t,r,n){super(e,t||a.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.t.bind(i,257794,19)).then((({GannSquarePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}hLevelsCount(){return a.HLevelsCount}vLevelsCount(){return a.VLevelsCount}pointsCount(){return 2}name(){return"Gann Box"}_alignPriceOnPattern(e,t){var i=Math.round(1e6*(e.price-t.price))/1e6;if(0===i)return t.price;for(var r=o[0],n=o[o.length-1],s=1,l=Math.abs(i);l=0&&!(o[c]*s=0?a:-a),e}_alignTimeOnPattern(e,t){var i=e.index-t.index;if(0===i)return 0;for(var r=l.length-2;r>=0&&!(l[r]0?1:0,e.index=t.index+l[r],e}_alignPointsFixedIncrement(e,t){return this._alignTimeOnPattern(e,t),this._alignPriceOnPattern(e,t),e}_preparePoint(e,t){return t&&t.shift()&&0!==this._points.length&&this._alignPointsFixedIncrement(e,this._points[0]),super._preparePoint(e,t)}getPoint(e){if(e<2)return super.getPoint(e);var t=null;switch(e){case 2:case 3:var i=this.points();if(i.length===this.pointsCount()){var r=i[0].index,n=i[1].price;3===e&&(r=i[1].index,n=i[0].price),t={index:r,price:n}}}return t}setPoint(e,t,i){if(i&&i.shift()){var r=e%2==0?this._points[1]:this._points[0];this._alignPointsFixedIncrement(t,r)}switch(e){case 2:this._points[0].index=t.index,this._points[1].price=t.price;break;case 3:this._points[1].index=t.index,this._points[0].price=t.price;break;default:super.setPoint(e,t,i)}}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,114388))).GannSquareDefinitionsViewModel}static createProperties(e){var t=new n("linetoolgannsquare",e,!1,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]});return this._configureProperties(t),t}static _configureProperties(e){super._configureProperties(e);for(var t=[e.child("color"),e.child("fans").child("color")],i=1;i<=this.HLevelsCount;i++)t.push(e.child("hlevel"+i).child("color"));for(i=1;i<=this.VLevelsCount;i++)t.push(e.child("vlevel"+i).child("color"));e.addChild("linesColors",new s(t)),e.addExclusion("linesColors")}}a.HLevelsCount=7,a.VLevelsCount=7,t.LineToolGannSquare=a},711755:(e,t,i)=>{"use strict";i.d(t,{LineToolGhostFeed:()=>c});var r=i(853965),n=i(821979),s=i(650151),o=i(389137);class l{constructor(e,t,i){this._source=e,this._segmentIndex=t,this._bars=null!=i?i:[]}setBars(e){this._bars=e}clone(e){return new l(e,this._segmentIndex,(0,o.clone)(this._bars))}generate(){this._bars=[];const e=this._source.points(),t=e[this._segmentIndex],i=e[this._segmentIndex+1];if(!t||!i||t.index===i.index)return;const r=this._segmentIndex?t.index+1:t.index,n=Math.sign(i.index-t.index);for(let e=r;e!==i.index;e+=n)this._bars.push(this._createBar())}bars(){return this._bars}setSize(e){if(e{this._setPaneViews([new t.GhostFeedPaneView(this,e)])}))}isSynchronizable(){return!1}destroy(){this.properties().onRestoreFactoryDefaults().unsubscribe(this,this._handleRestoringFactoryDefaults),super.destroy()}propertiesChanged(){super.propertiesChanged(),this._currentAverageHL===this.properties().childs().averageHL.value()&&this._currentVariance===this.properties().childs().variance.value()||this._regenerate()}pointsCount(){return-1}name(){return"Ghost Feed"}segmentBars(e){return this._segments[e].bars()}segments(){return this._segments}generateBars(e){this._segments.length<=e&&this._segments.push(new l(this,e)),this._segments[e].generate()}addPoint(e,t,i){if(this._finished)return!0;if(this._points.length>0){const i=this._points[this._points.length-1];if(!(null==t?void 0:t.isApiEvent())&&i.index===e.index){this._lastPoint=null,this.normalizePoints(),this.createServerPoints();for(let e=0;e1&&this.generateBars(this._points.length-2),r}finish(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()}setPoint(e,t,i,r){if(super.setPoint(e,t,i),e>0){const i=this.points()[e-1],r=t.index-i.index;this._segments[e-1].setSize(Math.abs(r))}if(e({bars:[...e.bars()]}))),t}restoreData(e){e.segments&&(this._segments=e.segments.map(((e,t)=>new l(this,t,e.bars)))),this._currentAverageHL=this.properties().childs().averageHL.value(),this._currentVariance=this.properties().childs().variance.value()}onData(e){super.onData(e);if(!this.pointsProperty().childs().points.child("0"))for(let e=0;ee.clone(this)))}startMoving(e,t,i,r){super.startMoving(e,t,i,r),this._preparePixelSegments()}move(e,t,i,r){super.move(e,t,i,r),this._restoreSegmentsFromPixels()}endMoving(e,t){return this._segmentsPixelsWhileMoving=null,super.endMoving(e,t)}static createProperties(e){const t=new r.DefaultProperty("linetoolghostfeed",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,743836))).GhostFeedDefinitionsViewModel}_handleRestoringFactoryDefaults(){const e=Math.round(this._calculateATR());this.properties().childs().averageHL.setValue(e)}_regenerate(){this._currentAverageHL=this.properties().childs().averageHL.value(),this._currentVariance=this.properties().childs().variance.value(),this._segments.forEach((e=>e.generate())),this.updateAllViews((0,a.sourceChangeEvent)(this.id())),this._model.updateSource(this)}_calculateATR(){const e=this._model.mainSeries(),t=[];e.bars().each(((e,i)=>{const r=i[2],n=i[3];return null!=r&&null!=n&&t.push(r-n),!1}));let i=0===t.length?0:t.reduce(((e,t)=>e+t),0)/t.length;return i*=e.base(),i}_preparePixelSegments(){var e,t;const i=this.priceScale(),r=null!==(t=null===(e=this.ownerSource())||void 0===e?void 0:e.firstValue())&&void 0!==t?t:null;if(null===i||null===r||i.isEmpty()||!i.isLog())return;const n=this.points();this._segmentsPixelsWhileMoving=this._segments.map(((e,t)=>{const s=n[t].price,o=n[t+1].price,l=i.priceToCoordinate(s,r),a=(i.priceToCoordinate(o,r)-l)/(e.bars().length-1);return{bars:e.bars().map(((e,t)=>{const n=l+t*a,s=i.coordinateToPrice(n,r);return{open:i.priceToCoordinate(s+e.o,r)-n,high:i.priceToCoordinate(s+e.h,r)-n,low:i.priceToCoordinate(s+e.l,r)-n,close:i.priceToCoordinate(s+e.c,r)-n}}))}}))}_restoreSegmentsFromPixels(){var e,t;const i=this.priceScale(),r=null!==(t=null===(e=this.ownerSource())||void 0===e?void 0:e.firstValue())&&void 0!==t?t:null;if(null===i||null===r||null===this._segmentsPixelsWhileMoving)return;const n=this.points();this._segmentsPixelsWhileMoving.forEach(((e,t)=>{const s=this._segments[t],o=n[t].price,l=n[t+1].price,a=i.priceToCoordinate(o,r),c=(i.priceToCoordinate(l,r)-a)/(e.bars.length-1),u=s.bars().map(((t,n)=>{const s=e.bars[n],o=a+n*c,l=i.coordinateToPrice(o,r);return{...t,o:i.coordinateToPrice(s.open+o,r)-l,h:i.coordinateToPrice(s.high+o,r)-l,l:i.coordinateToPrice(s.low+o,r)-l,c:i.coordinateToPrice(s.close+o,r)-l}}));s.setBars(u)}))}}},336471:(e,t,i)=>{"use strict";i.d(t,{LineToolHeadAndShoulders:()=>o});var r=i(853965),n=i(821979),s=i(31712);class o extends n.LineDataSource{constructor(e,t,r,n){const s=t||o.createProperties();super(e,s,r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,726360)).then((t=>{this._setPaneViews([new t.LineToolHeadAndShouldersPaneView(this,e)])}))}pointsCount(){return 7}name(){return"Head and Shoulders"}static createProperties(e){ const t=new r.DefaultProperty("linetoolheadandshoulders",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,63124)).then((e=>e.PatternWithBackgroundDefinitionViewModel))}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new s.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new s.LineToolColorsProperty([e.childs().textcolor]))}}},680330:(e,t,i)=>{"use strict";i.d(t,{LineToolHighlighter:()=>s});var r=i(853965),n=i(168504);class s extends n.LineToolBrushBase{constructor(e,t,i,r){super(e,t||s.createProperties(),i,r),this._loadPaneViews(e)}smooth(){return this.properties().childs().smooth.value()}name(){return"Highlighter"}static createProperties(e){const t=new r.DefaultProperty("linetoolhighlighter",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,48462)).then((e=>e.HighlighterDefinitionsViewModel))}_loadPaneViews(e){Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,898471)).then((t=>{this._setPaneViews([new t.HighlighterPaneView(this,e)])}))}}},682912:(e,t,i)=>{"use strict";i.d(t,{LineToolHorzLinePriceAxisView:()=>s});var r=i(229765),n=i(246733);class s extends r.PriceAxisView{constructor(e){super(),this._source=e}_updateRendererData(e,t,i){e.visible=!1;const r=this._source.points(),s=this._source.priceScale();if(0===r.length||null===s||s.isEmpty())return;const o=r[0];if(!isFinite(o.price))return;const l=this._source.ownerSource(),a=null!==l?l.firstValue():null;if(null===a)return;const c=(0,n.resetTransparency)(this._source.properties().linecolor.value());i.background=c,i.textColor=this.generateTextColor(c),i.coordinate=s.priceToCoordinate(o.price,a),e.text=s.formatPrice(o.price,a),e.visible=!0}}},994761:(e,t,i)=>{"use strict";i.d(t,{LineToolHorzLine:()=>l});var r=i(190973),n=i(853965),s=i(821979),o=i(682912);class l extends s.LineDataSource{constructor(e,t,r,n){super(e,t||l.createProperties(),r,n),this._priceAxisView=new o.LineToolHorzLinePriceAxisView(this),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,254896)).then((({HorzLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}state(e){const t=super.state(e);return t.points&&0!==t.points.length&&(t.points[0].offset=0),t}pointsCount(){return 1}name(){return"Horizontal Line"}priceAxisViews(e,t){return this.isSourceHidden()||t!==this.priceScale()||!this._model.selection().isSelected(this)&&!this.properties().childs().showPrice.value()||e!==this._model.paneForSource(this)?null:[this._priceAxisView]}timeAxisViews(){return null}timeAxisPoints(){return[]}updateAllViews(e){super.updateAllViews(e),this._priceAxisView.update(e)}canHasAlert(){return!0}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}denormalizeTimePoints(){ this._points=[],this._timePoint.length>0&&this._points.push({price:this._timePoint[0].price,index:0})}clearData(){const e=this._points;super.clearData(),this._points=e}static createProperties(e){const t=new n.DefaultProperty("linetoolhorzline",e);return this._configureProperties(t),t}_getAlertPlots(){return[this.points()[0].price]}_pointsForPointset(){return[]}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,51646)).then((e=>e.HorizontalLineDefinitionsViewModel))}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new r.default("")),e.addExclusion("text")}}},867716:(e,t,i)=>{"use strict";i.d(t,{LineToolHorzRay:()=>l});var r=i(853965),n=i(190973),s=i(682912),o=i(821979);class l extends o.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:l.createProperties(),r,n),this._priceAxisView=new s.LineToolHorzLinePriceAxisView(this),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,658622)).then((({HorzRayPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}pointsCount(){return 1}name(){return"Horizontal Ray"}priceAxisViews(e,t){return this.isSourceHidden()||t!==this.priceScale()||!this._model.selection().isSelected(this)&&!this.properties().childs().showPrice.value()||e!==this._model.paneForSource(this)?null:[this._priceAxisView]}updateAllViews(e){super.updateAllViews(e),this._priceAxisView.update(e)}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}canHasAlert(){return!0}static createProperties(e){const t=new r.DefaultProperty("linetoolhorzray",e);return this._configureProperties(t),t}_getAlertPlots(){const e=this._points[0],t={index:e.index+1,price:e.price},i=this._linePointsToAlertPlot([e,t],null,!1,!0);return null!==i?[i]:[]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,852440))).HorizontalRayDefinitionsViewModel}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new n.default("")),e.addExclusion("text")}}},618117:(e,t,i)=>{"use strict";i.d(t,{LineToolIcon:()=>C});var r=i(885482),n=i(760184),s=i(201089),o=i(822914),l=i(852290),a=i(790188),c=i(404720),u=i(808068),d=i(738232),h=i(923237),p=i(31712);const v=(0,a.getHexColorByName)("color-tv-blue-500"),_={intervalsVisibilities:{...u.intervalsVisibilitiesDefaults},color:v,size:40},f={icon:61720,angle:.5*Math.PI},g=(0,d.extractAllPropertiesKeys)(_),m=(0,d.extractAllPropertiesKeys)(f),P=[...g,...m,...h.commonLineToolPropertiesStateKeys];class y extends c.LineDataSourceThemedProperty{constructor(e){super(e),this.addChild("backgroundsColors",new p.LineToolColorsProperty([this.childs().color]))} static create(e,t){return new this({defaultName:"linetoolicon",defaultsSupplier:()=>(0,o.default)(_),nonThemedDefaultsKeys:g,themedDefaultsKeys:[],state:(0,l.default)({},f,{icon:t},null!=e?e:{}),allStateKeys:P})}}const w=(0,s.getLogger)("Chart.LineToolIcon");class C extends n.LineToolSvgIconBase{constructor(e,t,i,r){super(e,t||C.createProperties(),i,r),this.version=1,this._loadViews()}name(){return"Icon"}template(){return this._properties.template()}static createProperties(e){const t=y.create(e,r.iconTool.value());return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,681791)).then((e=>e.IconsDefinitionsViewModel))}async _loadViews(){const[{getSvgContentForCharCode:e,getSvgRenderer:t},{IconPaneView:r},{svgRenderer:n}]=await Promise.all([i.e(27987).then(i.bind(i,728996)),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,23728)),i.e(72616).then(i.bind(i,500477))]);if(!this._isDestroyed){const i=this._properties.childs().icon.value();this._svgContent=e(i),this._onIconChanged.fire();const s=t(n,i);null===s&&w.logWarn(`Couldn't create svg renderer for icon ${i}`),this._setPaneViews([new r(this,this._model,s)])}}}},627817:(e,t,i)=>{"use strict";i.d(t,{LineToolIdea:()=>c});var r=i(853965),n=i(821979),s=i(396949),o=i(190973),l=i(70726);class a extends l.CustomEventItem{constructor(e,t){super(t),this._data=e}ideaData(){return this._data}index(){return this._source.eventTimePointIndex()}time(){return this._data.createdAt}avatar(){var e;return null===(e=this._data.author)||void 0===e?void 0:e.avatarUrl}}class c extends l.LineToolCustomUrlEvent{constructor(e,t,r,n){super(e,t||c.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,320593)).then((t=>{this._setPaneViews([new t.IdeaPaneView(this,e)])}))}name(){return"Idea"}state(e){const t=super.state(e);return this._item&&(t.ideaData=this._item.ideaData()),e&&(t.eventTimePointIndex=this._eventTimePointIndex),t}restoreData(e){e.ideaData&&(this._item=new a(e.ideaData,this)),void 0!==e.eventTimePointIndex&&(this._eventTimePointIndex=e.eventTimePointIndex)}static createProperties(e){const t=new r.DefaultProperty("linetoolIdea",e);return this._configureProperties(t),t.hasChild("position")||t.addChild("position",new o.default(50)),t.addExclusion("position"),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,325232)).then((e=>e.IdeaDefinitionsViewModel))}static _configureProperties(e){n.LineDataSource._configureProperties(e)}}(0,s.watchingDrawingStateForAddIdeaLineTool)()},922034:(e,t,i)=>{"use strict";i.d(t,{LineToolImage:()=>_,buildAbsoluteUserImageUrl:()=>v});var r=i(650151),n=i(86441),s=i(201089),o=i(853965),l=i(190973),a=i(821979),c=i(964824),u=i(859353);const d=(0,s.getLogger)("Chart.LineToolImage");function h(e){return e.toLowerCase().startsWith("blob:")} const p=window.AWS_BBS3_DOMAIN;function v(e){if(h(e))return e;const t=new URL(e,p),i=new URL(t.pathname,p);if("/"===i.pathname)return null;const r=i.toString();return t.toString()!==r?null:r}class _ extends a.LineDataSource{constructor(e,t,r,n){var s;super(e,t||_.createProperties(),r,n),this._image=null,this._originPoint=4;const o=this.properties().childs().url;this._absoluteUserImageUrl=new l.default(null!==(s=v(this.properties().childs().url.value()))&&void 0!==s?s:""),this._absoluteUserImageUrl.subscribe(this,(e=>{const t=e.value();if(h(t))return;const i=v(t);null!==i&&o.setValue(new URL(i).pathname)})),o.subscribe(this,(()=>{const e=v(o.value());null!==e&&this._absoluteUserImageUrl.setValue(e)})),this._loadImage(),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,102380)).then((({ImagePaneView:t})=>{this._setPaneViews([new t(this,e)])})),this.properties().childs().url.subscribe(this,(()=>{this._loadImage()}))}absoluteUserImageUrl(){return this._absoluteUserImageUrl}cssWidth(){return this.properties().childs().cssWidth.value()}cssHeight(){return this.properties().childs().cssHeight.value()}angle(){return this.properties().childs().angle.value()}originPoint(){return this._originPoint}dOffsetX(){return this._dOffsetX||0}pointsCount(){return 1}name(){return"Image"}image(){return this._image}setBlobImageUrl(e){this._image||(this._createImage(e),this._blobUrl=e)}getChangePointForSync(e){return null}hasEditableCoordinates(){return!1}pointToScreenPoint({index:e,price:t},i=0){const s=this._model.timeScale(),o=(0,r.ensureNotNull)(this.priceScale()),l=(0,r.ensureNotNull)((0,r.ensureNotNull)(this.ownerSource()).firstValue()),a=s.indexToCoordinate(e)+i,c=o.priceToCoordinate(t,l);return new n.Point(a,c)}setPoint(e,t,i){if(null===this._image)return;const{width:n,height:s}=this._image,o=(0,r.ensureNotNull)(this.pointToScreenPoint(t)),l=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0],this.dOffsetX())),a=Math.max(Math.abs(l.x-o.x)/n,Math.abs(l.y-o.y)/s),c=Math.round(n*a),u=Math.round(s*a),d=this.properties().childs();d.cssWidth.setValue(c),d.cssHeight.setValue(u),this.propertiesChanged()}startChanging(e,t){super.startChanging(e,t),this._changeOriginPoint(_._oppositePoints[e])}endChanging(e,t){return this._changeOriginPoint(4),super.endChanging(e,t)}getPoint(){return null}syncLineStyleState(){const e=super.syncLineStyleState();return!e.url&&this._blobUrl&&(e.blobUrl=this._blobUrl),e}restoreExternalState(e){const{blobUrl:t,...i}=e;t&&this.setBlobImageUrl(t),super.restoreExternalState(i)}isSavedInChart(){return super.isSavedInChart()&&""!==this.absoluteUserImageUrl().value()}static createProperties(e){const t=new o.DefaultProperty("linetoolimage",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,69487))).ImageDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.hasChild("url")||e.addChild("url",new l.default("")), e.addExclusion("url"),e.addExclusion("cssWidth"),e.addExclusion("cssHeight"),e.addExclusion("angle")}_loadImage(){const e=this.properties(),t=(0,r.ensureDefined)(e.child("url")).value();t&&this._createImage(t)}_changeOriginPoint(e){const t=this.originPoint(),i=4===t?_._correctOriginDirections[e]:_._correctOriginDirections[_._oppositePoints[t]],s=this.properties().childs().cssWidth.value()/2,o=this.properties().childs().cssHeight.value()/2,[l]=this._points,a=(0,r.ensureNotNull)(this.pointToScreenPoint(l)),c=new n.Point(a.x+s*i[0],a.y+o*i[1]),u=(0,r.ensureNotNull)(this.screenPointToPoint(c));this._dOffsetX=4===t?c.x-(0,r.ensureNotNull)(this.pointToScreenPoint(u)).x:void 0,l.index=u.index,l.price=u.price,this._originPoint=e}_createImage(e){var t;const i=h(e),n=v(e);if(null===n)return void d.logWarn(`Invalid image URL: ${e}`);if(n===(null===(t=this._image)||void 0===t?void 0:t.src))return;const s=document.createElement("img");s.crossOrigin="anonymous",s.src=n,s.addEventListener("load",(()=>{this._image=s;const e=this._model,t=this.properties().childs();if(!i){const e=new URL(n).pathname;t.url.setValue(e),this._blobUrl=void 0}if(t.cssWidth.value()&&t.cssHeight.value())return void this._model.updateSource(this);const o=e.timeScale().width()/4,l=(0,r.ensureNotNull)(this.priceScale()).height()/4,a=s.naturalWidth,u=s.naturalHeight,d=Math.min(1,o/a),h=Math.min(1,l/u),p=Math.min(d,h),v=Math.round(p*a),_=Math.round(p*u);t.cssWidth.setValue(v),t.cssHeight.setValue(_),this.updateAllViews((0,c.sourceChangeEvent)(this.id())),this._model.updateSource(this)})),s.addEventListener("error",(()=>{this.model().removeSource(this)}))}}_._correctOriginDirections=[[-1,-1],[1,-1],[-1,1],[1,1],[0,0]],_._oppositePoints=[3,2,1,0,4],(0,u.watchingDrawingStateForAddImageLineTool)()},933513:(e,t,i)=>{"use strict";i.d(t,{LineToolInfoLine:()=>n});var r=i(956268);class n extends r.LineToolTrendLine{constructor(e,t,i,r){super(e,t||n.createProperties(),i,r)}pointsCount(){return 2}name(){return"Info Line"}static createProperties(e){const t=r.LineToolTrendLine._createPropertiesImpl("linetoolinfoline",e);return n._configureProperties(t),t}}},138886:(e,t,i)=>{"use strict";i.d(t,{InplaceTextLineDataSource:()=>u});var r=i(650151),n=i(86441),s=i(316230),o=i(401580),l=i(821979),a=i(964824),c=i(653657);class u extends l.LineDataSource{constructor(e,t,r,n){super(e,t,r,n),this._container=null,this._activateTextEditingEl=null,this._selectionData={},this._editableText=new o.WatchedValue(this.properties().childs().text.value()),this._editableText.subscribe((()=>{this.updateAllViewsAndRedraw((0,a.sourceChangeEvent)(this.id()))})),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,721683)).then((t=>{this._cursorPaneView=new t.InplaceTextCursorPaneView(this,e)}))}destroy(){this._editableText.unsubscribe(),this._closeTextEditor(),super.destroy()}topPaneViews(){return window.TradingView.printing||!this._cursorPaneView?null:(this._cursorPaneView.update(),[this._cursorPaneView])}editableText(){return this._editableText} textEditingEl(){return this._activateTextEditingEl}activateTextEditingOn(e){this._activateTextEditingEl=e,this.updateAllViewsAndRedraw((0,a.sourceChangeEvent)(this.id()))}onSelectionChange(e){const t={};void 0!==e&&(e.start===e.end?t.cursorPosition=e.start:t.selectionRange=[Math.min(e.start,e.end),Math.max(e.start,e.end)]),(0,s.default)(t,this._selectionData)||(this._selectionData=t,this._paneViews.forEach((e=>{e.forEach((e=>{(0,c.isInplaceTextLineSourcePaneView)(e)&&e.setSelectionRange(t.selectionRange)}))})),this._cursorPaneView.setCursorPosition(t.cursorPosition),this.updateAllViewsAndRedraw((0,a.sourceChangeEvent)(this.id())))}setAdditionalCursorData(e,t){this._cursorPaneView.setAdditionalCursorData(e,t)}async _openTextEditor(e,t,s,o,l){if(null!==this._container)return;this._activateTextEditingEl=null;const c=this.isFixed()?(0,r.ensureDefined)(this.fixedPoint()):(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),u=new n.Point(c.x,c.y);this._container=document.createElement("div"),this._container.style.position="absolute",this._container.style.top="0",this._container.style.bottom="0",this._container.style.left="0",this._container.style.right="0",this._container.style.overflow="hidden",this._container.style.pointerEvents="none",e.appendChild(this._container);const{updateChartEditorText:d,closeChartEditorText:h}=await Promise.all([i.e(3334),i.e(50690),i.e(15592)]).then(i.bind(i,353028));if(null===this._container||this._isDestroyed)return;this._closeChartEditorText=h;const p=this.properties().childs();this._editableText.setValue(p.text.value());const v={position:u,textInfo:t,placeholder:s,text:this._editableText,textColor:p.textsColors,wordWrap:p.wordWrap,onClose:o,onSelectionChange:l};d(this._container,v),this.updateAllViewsAndRedraw((0,a.sourceChangeEvent)(this.id()))}_closeTextEditor(){var e;null===this._container||this._isDestroyed||(this.properties().childs().text.setValue(this._editableText.value()),this.onSelectionChange(),null===(e=this._closeChartEditorText)||void 0===e||e.call(this,this._container),this._closeChartEditorText=void 0,this._container.remove(),this._container=null,this.updateAllViewsAndRedraw((0,a.sourceChangeEvent)(this.id())))}}},478760:(e,t,i)=>{"use strict";var r=i(517336).LevelsProperty,n=i(9093).LineToolPitchfork;class s extends n{constructor(e,t,i,r){super(e,t||s.createProperties(),i,r)}name(){return"Inside Pitchfork"}static createProperties(e){var t=new r("linetoolinsidepitchfork",e,!1,{range:[0,8]});return this._configureProperties(t),t}}t.LineToolInsidePitchfork=s},837202:(e,t,i)=>{"use strict";i.d(t,{LineToolPriceAxisView:()=>o});var r=i(650151),n=i(229765),s=i(246733);class o extends n.PriceAxisView{constructor(e,t){super(),this._source=e,this._data=t,this._properties=e.model().properties().childs().scalesProperties}_updateRendererData(e,t,i){e.visible=!1;const r=this._source.model();if(!r.timeScale()||r.timeScale().isEmpty())return;const n=this._source.priceScale();if(null===n||n.isEmpty())return ;if(!r.selection().isSelected(this._source)&&!this._source.isForcedDrawPriceAxisLabel())return;if(null===r.timeScale().visibleBarsStrictRange())return;const o=this._source.priceAxisPoints(),l=this._data.pointIndex;if(o.length<=l)return;const a=o[l];if(!isFinite(a.price))return;const c=this._source.ownerSource(),u=null!==c?c.firstValue():null;if(null===u)return;let d=this._data.backgroundPropertyGetter?this._data.backgroundPropertyGetter():null;null===d&&(d=this._getBgColor()),i.background=(0,s.resetTransparency)(d),i.borderColor="#2E84A6",i.textColor=this.generateTextColor(i.background),i.coordinate=n.priceToCoordinate(a.price,u),e.text=this._formatPrice(a.price,u),e.visible=!0}_getBgColor(){return this._active?this._properties.childs().axisLineToolLabelBackgroundColorActive.value():this._properties.childs().axisLineToolLabelBackgroundColorCommon.value()}_formatPrice(e,t){return(0,r.ensureNotNull)(this._source.priceScale()).formatPrice(e,t)}}},404720:(e,t,i)=>{"use strict";i.d(t,{LineDataSourceThemedProperty:()=>o});var r=i(822914),n=i(852290),s=i(738232);class o extends s.ThemedDefaultProperty{constructor({templateKeys:e,...t}){super(t),this._templateKeys=e||this._allDefaultsKeys}template(){return(0,s.extractState)(this.state(),this._templateKeys)}applyTemplate(e){this.mergeAndFire((0,s.extractState)((0,n.default)((0,r.default)(this._defaultsSupplier()),e),this._templateKeys))}}},902214:(e,t,i)=>{"use strict";i.d(t,{LineDataSourceTimeAxisView:()=>n});var r=i(161164);class n extends r.TimeAxisView{constructor(e,t){super(e.model()),this._active=!1,this._source=e,this._pointIndex=t,this._properties=e.model().properties().childs().scalesProperties}setActive(e){this._active=e}_getBgColor(){return this._active?this._properties.childs().axisLineToolLabelBackgroundColorActive.value():this._properties.childs().axisLineToolLabelBackgroundColorCommon.value()}_getIndex(){if(!this._model.selection().isSelected(this._source))return null;const e=this._source.timeAxisPoints();return e.length<=this._pointIndex?null:e[this._pointIndex].index}_isVisible(){return!0}}},821979:(e,t,i)=>{"use strict";i.d(t,{LineDataSource:()=>U});var r=i(86441),n=i(650151),s=i(251954),o=i(201089),l=i(244842),a=i(707957),c=i(103221),u=i(389137),d=i(558793),h=i(695242),p=i(735337),v=i(811630),_=i(401580),f=i(572230),g=i(731042),m=i(395098),P=i(808068),y=i(444331),w=i(502141),C=i(223699),b=i(190973),T=i(885482),S=i(996986),x=i(312449),A=i(964824),L=i(981107),I=i(68626),E=i(517067),D=i(902214),V=i(837202),M=i(31712),B=i(918208),k=i(42292);const N=(0,o.getLogger)("Chart.LineDataSource"),R=l.enabled("datasource_copypaste");class F{constructor(){this._states=[]}start(e){this._states.push(e)}finish(e){const t=(0,n.ensureDefined)(this._states.pop());return r=t,(i=e).length!==r.length?{indexesChanged:!0,pricesChanged:!0}:i.reduce(((e,t,i)=>{const n=r[i];return e.indexesChanged=e.indexesChanged||t.index!==n.index,e.pricesChanged=e.pricesChanged||t.price!==n.price,e}),{indexesChanged:!1,pricesChanged:!1});var i,r}isEmpty(){return 0===this._states.length}}let O=0 ;class U extends S.DataSource{constructor(e,t,i,r){if(super(r),this.version=1,this.toolname="",this.customization={forcePriceAxisLabel:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},this._currentPointsetAndSymbolId=null,this._pointChanged=new a.Delegate,this._pointAdded=new a.Delegate,this._priceAxisViews=[],this._timeAxisViews=[],this._timePoint=[],this._points=[],this._lastPoint=null,this._paneViews=new Map,this._normalizedPointsChanged=new a.Delegate,this._fixedPointsChanged=new a.Delegate,this._changeStatesStack=new F,this._startMovingPoint=null,this._currentMovingPoint=null,this._isActualSymbol=!1,this._isActualInterval=!1,this._isActualCurrency=!1,this._isActualUnit=!1,this._sharingMode=new _.WatchedValue(0),this._onTemplateApplying=new a.Delegate,this._onTemplateApplied=new a.Delegate,this._syncStateExclusions=[],this._definitionsViewModel=null,this._syncLineStyleMuted=!1,this._onIsActualIntervalChange=new a.Delegate,this._linkKey=new _.WatchedValue(null),this._serverUpdateTime=null,this._boundCalcIsActualSymbol=this.calcIsActualSymbol.bind(this),this._alertUndoMode=!1,this._model=e,this._properties=t,this._localAndServerAlertsMismatch=!1,this._properties.hasChild("interval")||this._properties.addChild("interval",new b.default(e.mainSeries().interval())),this.calcIsActualSymbol(),this._properties.childs().intervalsVisibilities.listeners().subscribe(this,this.calcIsActualSymbol),this._properties.subscribe(this,(()=>this.propertiesChanged())),this._createPointsProperties(),this.pointsCount()>0)for(let e=0;e{const t=!1===(0,T.hideAllDrawings)().value();e.value()?e.value()&&t&&s.emit("drawing_event",this._id,"show"):(this._model.selection().isSelected(this)&&this._model.selectionMacro((e=>{e.removeSourceFromSelection(this)})),t&&s.emit("drawing_event",this._id,"hide")),this._onSourceHiddenMayChange()})),(0,T.hideAllDrawings)().subscribe(this,this._onSourceHiddenMayChange),this._definitionsViewModel=null}destroy(){this._paneViews.forEach(((e,t)=>this._destroyPanePaneViews(t))),this.stop(),null!==this._definitionsViewModel&&(this._definitionsViewModel.destroy(),this._definitionsViewModel=null),null!==this._ownerSource&&(this._ownerSource.currencyChanged().unsubscribeAll(this),this._ownerSource.unitChanged().unsubscribeAll(this),(0,L.isSymbolSource)(this._ownerSource)&&(this._ownerSource.symbolResolved().subscribe(this,this._boundCalcIsActualSymbol),this._ownerSource.isActingAsSymbolSource().unsubscribe(this._boundCalcIsActualSymbol))),this.ownerSourceChanged().unsubscribeAll(this),(0,T.hideAllDrawings)().unsubscribeAll(this),this.deleteAlert(),super.destroy()}priceScale(){return this._ownerSource?this._ownerSource.priceScale():null}createPriceAxisView(e){return new V.LineToolPriceAxisView(this,{pointIndex:e})}model(){return this._model}symbol(){return this._properties.childs().symbol.value()}linkKey(){ return this._linkKey}serverUpdateTime(){return this._serverUpdateTime}setServerUpdateTime(e){this._serverUpdateTime=e}boundToSymbol(){return!0}isAvailableInFloatingWidget(){return!0}points(){const e=[];for(let t=0;t{const i=(0,n.ensureNotNull)(this.pointToScreenPoint(t)),s=i.x/this._model.timeScale().width(),o=i.y/e.height();return new r.Point(s,o)}))}widthsProperty(){var e;return null!==(e=this._properties.childs().linesWidths)&&void 0!==e?e:null}lineColorsProperty(){var e;return null!==(e=this._properties.childs().linesColors)&&void 0!==e?e:null}backgroundColorsProperty(){var e;return null!==(e=this._properties.childs().backgroundsColors)&&void 0!==e?e:null}textColorsProperty(){var e;return null!==(e=this._properties.childs().textsColors)&&void 0!==e?e:null}pointsProperty(){return this._pointsProperty}hasEditableCoordinates(){return!0}startMoving(e,t,i,r){this.isFixed()&&this.restoreFixedPoint(),this._startMovingPoint=e}move(e,t,i,r){if(i&&(i.shiftOnly()||i.modShift()))if(this.isFixed()){const t=this._alignScreenPointHorizontallyOrVertically((0,n.ensureDefined)(e.screen));this._currentMovingPoint={screen:t}}else{const t=this._alignPointHorizontallyOrVertically((0,n.ensureDefined)(e.logical)),i=(0,n.ensureNotNull)(this.pointToScreenPoint(t));this._currentMovingPoint={logical:t,screen:i}}else this._currentMovingPoint=e;this.updateAllViews((0,A.sourceChangeEvent)(this.id()))}endMoving(e,t,i){let r=!1,o=!1;if(this._currentMovingPoint&&this._startMovingPoint){if(this.isFixed()){const e=this._correctFixedPoint((0,n.ensureDefined)(this._fixedPoint));e.didCorrect&&(this._fixedPoint=e.point,this._fixedPointsChanged.fire())}else{const e=(0,n.ensureDefined)(this._currentMovingPoint.logical),t=(0,n.ensureDefined)(this._startMovingPoint.logical);r=e.index!==t.index,o=e.price!==t.price;if(this._correctPoints(this._points,i)){s.emit("drawing_event",this._id,"move"),s.emit("drawing_event",this._id,"points_changed");for(let e=0;e0&&(this._points=e)}restorePoints(e,t,i){const r=this._timePoint.length>0&&!(0,u.deepEquals)(this._timePoint,e)[0];this._timePoint=(0,c.deepCopy)(e),this._points=t,i||this.denormalizeTimePoints(),r&&this._normalizedPointsChanged.fire()}restorePositionPercents(e){this._positionPercents=e}calcIsActualSymbol(){const e=this.ownerSource();if(null===e)this._isActualSymbol=!1;else{const t=(0,n.ensureNotNull)(e.symbolSource()),i=t.symbolInfo();if(i){this._migrateSymbolProperty(i);const e=this._properties.childs().symbol,r=e.value();if(this._isActualSymbol=t.symbolSameAsCurrent(r),this._isActualSymbol){const n=(0,y.extractLineToolSymbolFromSymbolInfo)(i,t.symbol());(0, w.areEqualSymbols)(r,n)||(N.logWarn('Possible drawing "migrating" detected from "'+r+'" to "'+n+'"'),N.logWarn("Series symbolInfo: "+JSON.stringify(t.symbolInfo())),N.logWarn(`${(new Error).stack}`)),e.setValue(n)}}}this.calcIsActualInterval(),this.calcIsActualCurrency(),this.calcIsActualUnit(),this._onSourceHiddenMayChange()}calcIsActualCurrency(){const e=this.ownerSource();if(null===e)return void(this._isActualCurrency=!1);let t=this._properties.childs().currencyId.value();if(null!==t){const i=e.symbolSource();"pct"===t&&(this._properties.childs().currencyId.setValue(null),t=null),this._isActualCurrency=t===(0,y.symbolCurrency)(i.symbolInfo(),void 0,!0)}else{const t=(0,n.ensureNotNull)(e.symbolSource());this._isActualCurrency=null!==t.symbolInfo()&&!t.isConvertedToOtherCurrency()}this._onSourceHiddenMayChange()}calcIsActualUnit(){const e=this.ownerSource();if(null===e)return void(this._isActualUnit=!1);const t=this._properties.childs().unitId.value();if(null!==t)this._isActualUnit=t===(0,n.ensureNotNull)(e.symbolSource()).unit();else{const t=(0,n.ensureNotNull)(e.symbolSource());this._isActualUnit=null!==t.symbolInfo()&&!t.isConvertedToOtherUnit()}this._onSourceHiddenMayChange()}calcIsActualInterval(){const e=this._isActualInterval,t=this._properties,i=this._model.mainSeries();this._isActualInterval=(0,m.isActualInterval)(C.Interval.parse(i.interval()),t.childs().intervalsVisibilities),!this._isActualInterval&&this._model.selection().isSelected(this)&&this._model.selectionMacro((e=>e.removeSourceFromSelection(this))),this._isActualInterval!==e&&this._onIsActualIntervalChange.fire(),this._onSourceHiddenMayChange()}paneViews(e){if(this.isSourceHidden())return null;const t=this._getPaneViews(this.isMultiPaneAvailable()?e:void 0);if(null===t)return null;if(1===t.length)return[t[0]];const i=[];for(let e=t.length-1;e>=0;--e)i.push(t[e]);return i}priceAxisViews(e,t){if(t!==this.priceScale()||this.isSourceHidden())return null;if(this._model.lineBeingEdited()===this){const e=this._model.linePointBeingEdited();if(null!==e&&e{if(!e)return N.logError("Failed to get alert, alert will not be saved with drawing in chart"),Promise.reject("got_no_alert");if(this._removeAlertSubscriptions(),this._addAlertSubscriptions(e),null==t?void 0:t.syncAlertFocus){const t=this._model.selection().isSelected(this);e.setSelected(t)}else if(null==t?void 0:t.syncFocusFromAlert){const t=e.selected().value();this._model.selectionMacro((e=>{t?e.addSourceToSelection(this):e.removeSourceFromSelection(this)}))}return this._onAlertData(e),e})).then((()=>{const e=this.linkKey().value();null===e||i||(0,T.changeLineStyle)({linkKey:e,model:this._model,state:{},alertId:r})})).catch((e=>{this._removeAlertSubscriptions(),"not_exists"===e?(0,d.getChartAlertsFacade)().then((e=>{e.removeAlertFromAllChartsSilently(this.id(),r)})):N.logError("Getting alert or Saving chart failed: "+e)}))}editAlert(e){this.hasAlert().value()&&(0,d.getChartAlertsFacade)().then((t=>{t.openEditDialog((0,n.ensureDefined)(this._alertId),{actionSource:e,error:e=>{"not_exists"===e&&this.removeAlert()}})}))}getAlert(){return new Promise((async(e,t)=>{(await(0,d.getChartAlertsFacade)()).getAlert((0,n.ensureDefined)(this._alertId),{success:e,error:t})}))}getAlertSync(){var e;if(!this._alertId)return null;const t=(0,d.getChartAlertsFacadeIfCreatedBefore)();return null===t?null:null!==(e=t.getAlertSync(this._alertId))&&void 0!==e?e:null}synchronizeAlert(e){(this.hasAlert().value()||this._pendingAlertIdPromise)&&setTimeout((async()=>{if(!this._isDestroyed)try{await this.waitSettingAlertId(),this._synchronizeAlert(e)}catch(e){}}),0)}syncAlert(e){this.hasAlert().value()||this.setAlert(e,{sync:!0})}stateForAlert(){if(!this.canHasAlert())return null;const e={...this.state(),id:this.idForAlert(),uniqueId:this.idForAlert(),title:this.translatedType(),interval:this._model.mainSeries().interval()},t=this._getAlertPlots();return t&&t.length>0&&(e.plots=t),e}getAlertIsActive(){if(!this._alertId)return!1;const e=this.getAlertSync();return Boolean(e&&e.active().value())}detachAlert(){this._removeAlertSubscriptions(),this._hasAlert.setValue(!1),this._alertId=void 0}removeAlert(){this._alertId=void 0,this._hasAlert.setValue(!1),this._removeAlertSubscriptions()}deleteAlert(){if(!this.hasAlert().value()||void 0===this._alertId)return;const e=(0,d.getChartAlertsFacadeIfCreatedBefore)();e&&e.deleteAlert(this._alertId),this.removeAlert()}areLocalAndServerAlertsMismatch(){return this._localAndServerAlertsMismatch}showInObjectTree(){return this.customization.showInObjectsTree}setShowInObjectsTreeEnabled(e){this.customization.showInObjectsTree=e}start(){this.createServerPoints()}processHibernate(){ this.canBeHibernated()?this.isStarted()&&this.stop():this.isStarted()||this.start()}canBeHibernated(){return this.isSourceHidden()}onData(e){"pointset_error"!==e.method?e.params.customId===this._currentPointsetIdWithPrefix()&&this._onPointsetUpdated(e.params.plots):N.logError(`Error getting pointset: ${e.params[0]} ${e.params[1]}`)}isBeingEdited(){return this===this._model.lineBeingEdited()}isActualSymbol(){return this._isActualSymbol}isActualCurrency(){return this._isActualCurrency}isActualInterval(){return this._isActualInterval}isActualUnit(){return this._isActualUnit}onIsActualIntervalChange(){return this._onIsActualIntervalChange}setOwnerSource(e){null!==this._ownerSource&&(this._ownerSource.currencyChanged().unsubscribeAll(this),this._ownerSource.unitChanged().unsubscribeAll(this)),null!==this._ownerSource&&(0,L.isSymbolSource)(this._ownerSource)&&(this._ownerSource.symbolResolved().unsubscribe(this,this._boundCalcIsActualSymbol),this._ownerSource.isActingAsSymbolSource().unsubscribe(this._boundCalcIsActualSymbol)),super.setOwnerSource(e),e&&(this.setPriceScale(e.priceScale()),e.currencyChanged().subscribe(this,this.calcIsActualCurrency),e.unitChanged().subscribe(this,this.calcIsActualUnit),this.calcIsActualSymbol(),this._migrateZOrder()),(0,L.isSymbolSource)(e)&&(e.symbolResolved().subscribe(this,this._boundCalcIsActualSymbol),e.isActingAsSymbolSource().subscribe(this._boundCalcIsActualSymbol))}dataAndViewsReady(){return this._paneViews.size>0}pointAdded(){return this._pointAdded}pointChanged(){return this._pointChanged}pointToScreenPoint(e){var t;const i=this._model.timeScale(),n=this.priceScale(),s=null===(t=this.ownerSource())||void 0===t?void 0:t.firstValue();if(!n||n.isEmpty()||i.isEmpty()||null==s)return null;const o=i.indexToCoordinate(e.index),l=n.priceToCoordinate(e.price,s);return new r.Point(o,l)}screenPointToPoint(e){var t;const i=this.priceScale(),r=null===(t=this.ownerSource())||void 0===t?void 0:t.firstValue();if(null==r||!isFinite(r)||null===i)return null;const n=this._model.timeScale().coordinateToIndex(e.x);return{price:i.coordinateToPrice(e.y,r),index:n}}calcMiddlePoint(e,t){return new r.Point((e.x+t.x)/2,(e.y+t.y)/2)}addPoint(e,t,i){const r=this._preparePoint(e,t);return this._addPointIntenal(r,t,i)}addFixedPoint(e){return this._fixedPoint=e,this.calcPositionPercents(),!0}calcPositionPercents(){const e=this.priceScale();if(!e||e.isEmpty()||void 0===this._fixedPoint)return;const t=this._fixedPoint.x/this._model.timeScale().width(),i=this._fixedPoint.y/e.height();return this._positionPercents={x:t,y:i},this._positionPercents}restoreFixedPoint(){this._fixedPoint=this.fixedPoint()}propertiesChanged(e){this.calcIsActualInterval(),this.updateAllViewsAndRedraw((0,A.sourceChangeEvent)(this.id())),e||this._syncLineStyleIfNeeded(),void 0===this._pendingPropertyChangedEvent&&(this._pendingPropertyChangedEvent=setTimeout((()=>{this._pendingPropertyChangedEvent=void 0,s.emit("drawing_event",this._id,"properties_changed")}),0))}state(e){var t,i;const r={type:this.toolname,id:this.id(), state:this.properties().state(null!==(t=this._propertiesStateExclusions())&&void 0!==t?t:void 0),points:(0,c.deepCopy)(this._timePoint),zorder:this.zorder(),ownerSource:null===(i=this.ownerSource())||void 0===i?void 0:i.id()};return this.linkKey().value()&&(r.linkKey=this.linkKey().value()),0!==this._sharingMode.value()&&(r.sharingMode=this._sharingMode.value()),delete r.state.points,e&&(r.indexes=this._points),this.isFixed()&&(r.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(r.version=this.version),this._saveAlertIdInState()&&this.hasAlert().value()&&void 0!==this._alertId&&(r.alertId=this._alertId),r}updateAllViews(e){this._isActualSymbol&&this._isActualCurrency&&this._isActualUnit&&this._isActualInterval&&this._properties.childs().visible.value()&&(this._updateAllPaneViews(e),this._priceAxisViews.forEach((t=>t.update(e))),this._timeAxisViews.forEach((t=>t.update(e))))}updateAllViewsAndRedraw(e){this.updateAllViews(e),this._model.updateSource(this)}tags(){return[this.toolname]}properties(){return this._properties}restoreExternalPoints(e,t){if(this._timePoint=(0,c.deepCopy)(e.points),t.indexesChanged){if(this.properties().childs().interval.setValue(e.interval),!this.isActualSymbol())return this._clearServerPoints(),void this._normalizedPointsChanged.fire();this.createServerPoints()}else{const t=Math.min(this._points.length,e.points.length);for(let i=0;i0&&this.normalizePoints(),!this._readyToCreatePointset())return;const e=this._pointsForPointset();if(0===e.length)return;++O,this._currentPointsetAndSymbolId={pointsetId:O,symbolId:(0,n.ensureNotNull)(this._model.mainSeries().seriesSource().symbolInstanceId())};const t=(0,g.getServerInterval)(this.properties().childs().interval.value());this._model.chartApi().createPointset(this._currentPointsetIdWithPrefix(),"turnaround",this._currentPointsetAndSymbolId.symbolId,t,e,this.onData.bind(this))}finish(){}realign(){var e;this.calcIsActualSymbol(),this.isFixed()||this.isSourceHidden()||this._model.lineBeingCreated()===this||this._model.lineBeingEdited()===this||(null===(e=this._currentPointsetAndSymbolId)||void 0===e?void 0:e.symbolId)===this._model.mainSeries().seriesSource().symbolInstanceId()||this._clearServerPoints(),this.updateAllViews((0,A.sourceChangeEvent)(this.id()))}stop(){this._clearServerPoints()}restart(){this.isFixed()||(this._currentPointsetAndSymbolId=null,this.createServerPoints())}isStarted(){return null!==this._currentPointsetAndSymbolId}convertYCoordinateToPriceForMoving(e,t){var i;const r=(0,n.ensureNotNull)(this.priceScale());if(r.isEmpty())return null;const s=this.ownerSource(),o=(0,n.ensure)(null===(i=s||t)||void 0===i?void 0:i.firstValue());return r.coordinateToPrice(e,o)}syncMultichartState(e){const t={points:this._timePoint,interval:this._model.mainSeries().interval()},i=this.linkKey().value();if(null!==i&&this.isSynchronizable()){const r={model:this._model,linkKey:i,symbol:this._model.mainSeries().symbol(),finalState:t,changes:e};(0,T.finishChangingLineTool)(r)}}enableCurrentIntervalVisibility(){const e=this.properties().childs().intervalsVisibilities.state();void 0!==e&&((0,m.makeIntervalsVisibilitiesVisibleAtInterval)(e,C.Interval.parse(this._model.mainSeries().interval())),this.properties().childs().intervalsVisibilities.mergeAndFire(e))}clonePositionOffset(){return this.isFixed()?{barOffset:0,xCoordOffset:20,yCoordOffset:20}:{barOffset:0,xCoordOffset:0,yCoordOffset:-40}}sharingMode(){return this._sharingMode}share(e){this.isSynchronizable()&&this._sharingMode.setValue(e)}syncLineStyleState(){const e=this.properties().state(this._syncStateExclusions);return delete e.interval,e.intervalsVisibilities=(0,m.mergeIntervalVisibilitiesDefaults)(e.intervalsVisibilities),e}moveLineTool(e){e.forEach(((e,t)=>this._setPoint(t,e))),this.normalizePoints()}_setPoint(e,t){this._points[e].index===t.index?this._points[e].price=t.price:this._points[e]=t,this._pointChanged.fire(e)}_correctLastPoint(e){return(0,u.clone)(e)}_pointsForPointset(){return this._timePoint.map((e=>[e.time_t,e.offset]))}_snapPoint45Degree(e,t,i){const r=this._model.timeScale(),s=r.indexToCoordinate(t.index),o=r.indexToCoordinate(e.index)-s,l=(0,n.ensureNotNull)(this.priceScale()),a=t.price,c=e.price,u=(0,n.ensureNotNull)((0,n.ensureNotNull)(this.ownerSource()).firstValue()),d=l.priceToCoordinate(a,u),h=l.priceToCoordinate(c,u)-d,p=Math.round(Math.atan2(o,h)/Math.PI*4) ;if(2===Math.abs(p))i||(e.price=a);else if(0===Math.abs(p)||4===Math.abs(p))i||(e.index=t.index);else{const t=Math.sqrt(o*o+h*h),i=o<0?-1:1,n=h<0?-1:1;let a=Math.max(Math.abs(h),Math.abs(o));a/=a*Math.sqrt(2)/t;const c=Math.round(r.coordinateToIndex(s+a*i)),p=Math.abs(r.indexToCoordinate(c)-s),v=l.coordinateToPrice(d+p*n,u);e.index=c,e.price=v}}normalizePoint(e){return{...this._model.timeScale().normalizeBarIndex(e.index),price:e.price}}normalizePoints(){this._timePoint=[];for(let e=0;ethis._destroyPanePaneViews(t))),this._model.lightUpdate()}_getPaneViews(e){return this._paneViews.get(e)||null}_updateAllPaneViews(e){this._paneViews.forEach((t=>{for(const i of t)i.update(e)}))}_alignPointHorizontallyOrVertically(e){const t=(0,n.ensureNotNull)(this.pointToScreenPoint(e)),i=(0,n.ensureDefined)((0,n.ensureNotNull)(this._startMovingPoint).logical),r=(0,n.ensureDefined)((0,n.ensureNotNull)(this._startMovingPoint).screen),s=Math.abs(r.x-t.x),o=Math.abs(r.y-t.y);if(s<10&&o<10)return e;return{index:s=1?{didCorrect:!0,point:e.add(r)}:{didCorrect:!1,point:e}}_currentPointsetIdWithPrefix(){return"pointset_"+(0,n.ensureNotNull)(this._currentPointsetAndSymbolId).pointsetId}_clearServerPoints(){null!==this._currentPointsetAndSymbolId&&this._model.chartApi().isConnected().value()&&this._model.chartApi().removePointset(this._currentPointsetIdWithPrefix()),this._currentPointsetAndSymbolId=null}_createPointProperty(e){const t=this._pointsProperty.childs().points;t.addProperty(""+e,{});const i=t[e];i.addChild("price",new E.LineDataSourcePointPriceProperty(this,e)),i.addChild("bar",new I.LineDataSourcePointIndexProperty(this,e))}_createPointsProperties(){this._pointsProperty=new b.default, this._pointsProperty.addChild("points",new b.default);for(let e=0;e=2&&this._snapTo45DegreesAvailable()&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),i}_addPointIntenal(e,t,i){this._points.push(e);const r=this._points.length===this.pointsCount();return r?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=e,this._pointAdded.fire(this._points.length-1),r}_onSourceHiddenMayChange(){this._model.invalidate(f.InvalidationMask.validateAction((()=>{this!==this._model.lineBeingCreated()&&(this._isDestroyed||this.processHibernate())})))}_saveAlertIdInState(){return!0}_onPointsetUpdated(e){if(0!==e.length){for(let t=0;t0}_onAlertData(e){}_propertiesStateExclusions(){return null}_syncLineStyleIfNeeded(){const e=this.linkKey().value();!this._syncLineStyleMuted&&e&&(0,T.changeLineStyle)({linkKey:e,state:this.syncLineStyleState(),model:this._model})}_muteSyncLineStyle(){this._syncLineStyleMuted=!0}_unmuteSyncLineStyleWithoutApplyingChanges(){this.propertiesChanged(),this._syncLineStyleMuted=!1}_applyTemplateImpl(e){e.intervalsVisibilities=(0,m.mergeIntervalVisibilitiesDefaults)(e.intervalsVisibilities);const t=this.properties();t.applyTemplate(e,(0,k.factoryDefaults)(this.toolname.toLowerCase())),t.saveDefaults(),this.propertiesChanged()} _getPropertyDefinitionsViewModelClass(){return Promise.resolve(null)}_getAlertPlots(){return[]}_getUndoHistory(){return this._model.undoModel().undoHistory()}_synchronizeAlert(e){const t=this._getUndoHistory();if(!this._undoCheckpointAlert&&!this._alertUndoMode){const e=t.undoStack().pop();this._undoCheckpointAlert=t.createUndoCheckpoint(),e&&t.undoStack().push(e)}const i=e=>{const t=e.description()!==e.defaultDescription(),i=(0,n.ensureNotNull)(e.seriesState()),r=this._model.mainSeries().stateForAlert();"MainSeries"===i.type&&r.actualSymbol===i.actualSymbol&&e.setSeriesState(r),e.setMainSeriesState(r),e.setSymbol(r.symbolString);const s=(0,n.ensureNotNull)(this.stateForAlert());e.setResolution(s.interval),e.setLineState(s),t||e.resetToDefaultDescription(),this._localAndServerAlertsMismatch=!0},r=()=>{this._alertUndoMode=!0,t.undoToCheckpoint((0,n.ensureDefined)(this._undoCheckpointAlert)),setTimeout((()=>{this._alertUndoMode=!1,this._localAndServerAlertsMismatch=!1}),0)},s=e=>{"not_exists"!==e&&(N.logError("Getting alert failed: "+e),r())},o=async e=>{(await(0,d.getChartAlertsFacade)()).restartAlert(e,{success:()=>this._localAndServerAlertsMismatch=!1,error:s,complete:()=>delete this._undoCheckpointAlert,actionSource:"drawing_sync"})};(0,h.canPlaceAlertOnResolution)(this.stateForAlert().interval)?this.getAlert().then((t=>{t?(i(t),e&&(o(t),this._onAlertData(t))):N.logError("Failed to get alert, drawing and alert are not synchronized")})).catch(s):this._alertUndoMode||((0,p.showGoProAlertsOnSecondsDialog)(),r(),delete this._undoCheckpointAlert)}_linePointsToAlertPlot(e,t,i,r){if(2!==e.length)return N.logError("[Drawing Alert] Wrong points"),null;const s=this._model.timeScale();return!s||s.isEmpty()?null:{type:"LinePlot",title:t||this.translatedType(),timestamp:(0,n.ensureNotNull)(s.indexToTimePoint(0)),offset1:e[0].index,offset2:e[1].index,price1:e[0].price,price2:e[1].price,extendBackward:i||!1,extendForward:r||!1}}_getAlertCreationAvailable(){return v.alertsAvailable&&super._getAlertCreationAvailable()&&!this._hasAlert.value()}static _configureProperties(e){if(this._addCollectedProperties(e),e.hasChild("symbolStateVersion")||e.addChild("symbolStateVersion",new b.default(1)),e.hasChild("zOrderVersion")||e.addChild("zOrderVersion",new b.default(1)),e.hasChild("visible")||e.addChild("visible",new b.default(!0)),e.hasChild("frozen")||e.addChild("frozen",new b.default(!1)),e.hasChild("symbol")||e.addChild("symbol",new b.default("")),e.hasChild("currencyId")||e.addChild("currencyId",new b.default(null)),e.hasChild("unitId")||e.addChild("unitId",new b.default(null)),e.addExclusion("symbolStateVersion"),e.addExclusion("zOrderVersion"),e.addExclusion("visible"),e.addExclusion("frozen"),e.addExclusion("symbol"),e.addExclusion("currencyId"),e.addExclusion("unitId"),e.hasChild("intervalsVisibilities")){const t=(0,u.merge)((0,u.clone)(P.intervalsVisibilitiesDefaults),e.childs().intervalsVisibilities.state());e.removeProperty("intervalsVisibilities"),e.addChild("intervalsVisibilities",new x.IntervalsVisibilitiesProperty(t)) }else e.addChild("intervalsVisibilities",new x.IntervalsVisibilitiesProperty(P.intervalsVisibilitiesDefaults));e.hasChild("title")||e.addChild("title",new b.default("")),e.addExclusion("symbolInfo"),e.addExclusion("points"),e.addExclusion("interval"),e.addExclusion("title"),e.hasChild("singleChartOnly")&&e.removeProperty("singleChartOnly"),e.hasChild("font")&&e.removeProperty("font")}static _addCollectedProperties(e){e.hasChild("linewidth")&&e.addChild("linesWidths",new M.LineToolWidthsProperty([(0,n.ensureDefined)(e.child("linewidth"))])),e.hasChild("linecolor")&&e.addChild("linesColors",new M.LineToolColorsProperty([(0,n.ensureDefined)(e.child("linecolor"))])),e.hasChild("backgroundColor")&&e.addChild("backgroundsColors",new M.LineToolColorsProperty([(0,n.ensureDefined)(e.child("backgroundColor"))])),e.hasChild("textColor")&&e.addChild("textsColors",new M.LineToolColorsProperty([(0,n.ensureDefined)(e.child("textColor"))])),e.addExclusion("linesWidths"),e.addExclusion("linesColors"),e.addExclusion("backgroundsColors"),e.addExclusion("textsColors")}_removeAlertSubscriptions(){var e;null===(e=this._unsubscribeAlertCallbacks)||void 0===e||e.call(this),this._unsubscribeAlertCallbacks=void 0}_addAlertSubscriptions(e){if(void 0!==this._unsubscribeAlertCallbacks)return;const t=this.properties().child("extendLeft"),i=this.properties().child("extendRight"),r=e.destroyed().spawn(),n=e.selected().spawn(),s=e.hovered().spawn();r.subscribe(this.removeAlert.bind(this)),n.subscribe((e=>{this._model.selectionMacro((t=>{e?t.addSourceToSelection(this):t.removeSourceFromSelection(this)}))})),s.subscribe((e=>{const t=this._model.hoveredSource();e&&t!==this?this._model.setHoveredSource(this,null):e||t!==this||this._model.setHoveredSource(null,null)})),void 0!==t&&t.subscribe(this,(()=>this.synchronizeAlert(!1))),void 0!==i&&i.subscribe(this,(()=>this.synchronizeAlert(!1))),this._unsubscribeAlertCallbacks=()=>{r.destroy(),s.destroy(),n.destroy(),void 0!==t&&t.unsubscribeAll(this),void 0!==i&&i.unsubscribeAll(this)}}_destroyPanePaneViews(e){const t=this._paneViews.get(e);if(void 0!==t)for(const e of t)e.destroy&&e.destroy();void 0!==e&&e.onDestroyed().unsubscribeAll(this),this._paneViews.delete(e)}_copyPricesWithoutNormalization(){const e=Math.min(this._points.length,this._timePoint.length);for(let t=0;t{"use strict";t.LineToolFibRetracement=i(498995).LineToolFibRetracement,t.LineToolFibChannel=i(965989).LineToolFibChannel,t.LineToolFibSpeedResistanceArcs=i(974472).LineToolFibSpeedResistanceArcs,t.LineToolProjection=i(506416).LineToolProjection,t.LineToolTrendBasedFibExtension=i(882980).LineToolTrendBasedFibExtension,t.LineToolElliott=i(960690).LineToolElliott,t.LineToolFibCircles=i(953718).LineToolFibCircles,t.LineToolVertLine=i(43653).LineToolVertLine,t.LineToolCrossLine=i(73217).LineToolCrossLine,t.LineToolBarsPattern=i(180148).LineToolBarsPattern,t.LineToolTrendBasedFibTime=i(418219).LineToolTrendBasedFibTime,t.LineToolFibTimeZone=i(958849).LineToolFibTimeZone, t.LineToolCircleLines=void 0,t.LineToolDateRange=i(727264).LineToolDateRange,t.LineToolPriceRange=i(830695).LineToolPriceRange,t.LineToolDateAndPriceRange=i(836843).LineToolDateAndPriceRange,t.LineToolParallelChannel=i(247035).LineToolParallelChannel,t.LineToolTrendAngle=i(167723).LineToolTrendAngle,t.LineToolTrendLine=i(956268).LineToolTrendLine,t.LineToolInfoLine=i(933513).LineToolInfoLine,t.LineToolArrowMark=i(41394).LineToolArrowMark,t.LineToolImage=i(922034).LineToolImage,t.LineToolPitchfan=i(932732).LineToolPitchfan,t.LineToolGannSquare=i(168853).LineToolGannSquare,t.LineToolFibSpeedResistanceFan=i(63491).LineToolFibSpeedResistanceFan,t.LineToolGannComplex=i(833762).LineToolGannComplex,t.LineToolGannFixed=i(839386).LineToolGannFixed,t.LineToolGannFan=i(643442).LineToolGannFan,t.LineToolFibWedge=i(781811).LineToolFibWedge,t.LineToolPitchfork=i(9093).LineToolPitchfork,t.LineToolDisjointAngle=i(709638).LineToolDisjointChannel,t.LineToolFlatBottom=i(634659).LineToolFlatBottom,t.LineToolIcon=i(618117).LineToolIcon,t.LineToolEmoji=i(167843).LineToolEmoji,t.LineToolSticker=i(882626).LineToolSticker,t.LineToolRotatedRectangle=i(605703).LineToolRotatedRectangle,t.LineToolFibSpiral=void 0,t.LineToolHeadAndShoulders=i(336471).LineToolHeadAndShoulders,t.LineToolTriangle=i(287743).LineToolTriangle,t.LineToolTrianglePattern=i(948653).LineToolTrianglePattern,t.LineTool5PointsPattern=i(147985).LineTool5PointsPattern,t.LineToolThreeDrivers=i(521600).LineToolThreeDrivers,t.LineToolABCD=i(78).LineToolABCD,t.LineToolPolyline=i(527342).LineToolPolyline,t.LineToolPath=i(999432).LineToolPath,t.LineToolPrediction=i(240569).LineToolPrediction,t.LineToolPriceLabel=i(729443).LineToolPriceLabel,t.LineToolPriceNote=void 0,t.LineToolArrowMarker=i(683396).LineToolArrowMarker,t.LineToolNote=i(619540).LineToolNote,t.LineToolNoteAbsolute=i(619540).LineToolNoteAbsolute,t.LineToolSignpost=i(697548).LineToolSignpost,t.LineToolBrush=i(271133).LineToolBrush,t.LineToolArc=i(907416).LineToolArc,t.LineToolCallout=i(844295).LineToolCallout,t.LineToolBalloon=i(179180).LineToolBalloon,t.LineToolComment=i(768574).LineToolComment,t.LineToolText=i(520259).LineToolText,t.LineToolHorzLine=i(994761).LineToolHorzLine,t.LineToolHorzRay=i(867716).LineToolHorzRay,t.LineToolRectangle=i(442724).LineToolRectangle,t.LineToolCircle=i(638202).LineToolCircle,t.LineToolEllipse=i(43853).LineToolEllipse,t.LineToolTimeCycles=i(36459).LineToolTimeCycles,t.LineToolSineLine=i(305480).LineToolSineLine,t.LineToolGhostFeed=i(711755).LineToolGhostFeed,t.LineToolBezierQuadro=i(516487).LineToolBezierQuadro,t.LineToolBezierCubic=i(511628).LineToolBezierCubic,t.LineToolArrow=i(548160).LineToolArrow,t.LineToolRay=i(352747).LineToolRay,t.LineToolExtended=i(252598).LineToolExtended,t.LineToolSchiffPitchfork=i(115137).LineToolSchiffPitchfork,t.LineToolSchiffPitchfork2=i(126144).LineToolSchiffPitchfork2,t.LineToolInsidePitchfork=i(478760).LineToolInsidePitchfork,t.LineToolTextAbsolute=i(520259).LineToolTextAbsolute,t.LineToolArrowMarkLeft=i(41394).LineToolArrowMarkLeft, t.LineToolArrowMarkRight=i(41394).LineToolArrowMarkRight,t.LineToolArrowMarkUp=i(41394).LineToolArrowMarkUp,t.LineToolArrowMarkDown=i(41394).LineToolArrowMarkDown,t.LineToolFlagMark=i(218032).LineToolFlagMark,t.LineToolCypherPattern=i(224777).LineToolCypherPattern,t.LineToolElliottImpulse=i(960690).LineToolElliottImpulse,t.LineToolElliottTriangle=i(960690).LineToolElliottTriangle,t.LineToolElliottTripleCombo=i(960690).LineToolElliottTripleCombo,t.LineToolElliottCorrection=i(960690).LineToolElliottCorrection,t.LineToolElliottDoubleCombo=i(960690).LineToolElliottDoubleCombo,t.LineToolRiskRewardLong=i(864555).LineToolRiskRewardLong,t.LineToolRiskRewardShort=i(864555).LineToolRiskRewardShort,t.LineToolPosition=i(674053).LineToolPosition,t.LineToolOrder=i(778737).LineToolOrder,t.LineToolHighlighter=i(680330).LineToolHighlighter,t.LineToolTweet=i(14802).LineToolTweet,t.LineToolIdea=i(627817).LineToolIdea},776954:(e,t,i)=>{"use strict";i.d(t,{LineToolWithRelativePriceCoordinate:()=>l});var r=i(650151),n=i(821979),s=i(77338),o=i(885482);class l extends n.LineDataSource{constructor(){super(...arguments),this._startMovingAnchorY=NaN}priceSource(){return this.ownerSource()}addPoint(e,t,i){return super.addPoint(this._updatePositionAndCorrectPoint(e),t,i)}setPoint(e,t,i){super.setPoint(e,this._updatePositionAndCorrectPoint(t,!this.isPhantom()&&!this._allowChangeAnchorHorizontally()),i),this._syncPosition()}setPointAndChangeIndex(e,t,i){super.setPoint(e,this._updatePositionAndCorrectPoint(t,!1),i),this._syncPosition()}startMoving(e,t,i,n){n||(this._startMovingAnchorY=(0,r.ensureNotNull)(this._anchorYCoordinate())),super.startMoving(e,t,i)}move(e,t,i,n){var s;const o=(0,r.ensureDefined)((0,r.ensureNotNull)(this.startMovingPoint()).logical),l=(0,r.ensureDefined)(e.logical);if(!n&&0===t){const e=this._points[0],t=l.index-o.index,i=(0,r.ensureNotNull)(this.priceScale()),n=(0,r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue()),a=i.priceToCoordinate(l.price,n)-i.priceToCoordinate(o.price,n),c=this._startMovingAnchorY+a,u=i.coordinateToPrice(c,n);this._updatePositionAndCorrectPoint({index:e.index+t,price:u})}super.move(e,t,i),n||this._syncPosition()}_allowChangeAnchorHorizontally(){return!1}_updatePositionAndCorrectPoint(e,t){t&&(e.index=this._points[0].index);const i=this.priceSource();if(null===i)return e;const r=i.priceScale(),n=i.firstValue();if(null===r||r.isEmpty()||null===n)return e;const o=r.height();let l=o/2,a=e.price>=r.coordinateToPrice(l,n)?1:-1;const c=this._model.mainSeries();if(i===c){const t=c.data().search(this._baseSeriesIndexForPoint(e));if(null!==t){const i=(0,s.seriesPrice)(c,t,-1),o=(0,s.seriesPrice)(c,t,1);a=e.price>=i?1:-1,l=r.priceToCoordinate(1===a?o:i,n),e.price=1===a?Math.max(o,e.price):e.price}}const u=1===(-1===a!==r.isInverted()?-1:1)?l:o-l,d=r.priceToCoordinate(e.price,n),h=Math.min(o,Math.abs(d-l)),p=Math.max(0,Math.min(100,100*h/u))*a;return this.properties().childs().position.setValue(p),e}_baseSeriesIndexForPoint(e){return e.index}_syncPosition(){const e=this.linkKey().value() ;if(null!==e){const t={position:this.properties().childs().position.value()};(0,o.changeLineStyle)({linkKey:e,state:t,model:this._model})}}_anchorYCoordinate(){const e=this.priceSource();if(null===e)return null;const t=e.priceScale(),i=e.firstValue();if(null===t||t.isEmpty()||null===i)return null;const r=this._model.mainSeries(),n=this.customEvent();if(null===n)return null;let o=null;if(e===r&&(o=(0,s.seriesBasePosition)(r,n)),null===o&&(o=(0,s.noDataBasePosition)(n,t,i)),null===o)return null;const l=n.position(),a=t.priceToCoordinate(o.price,i);return(0,s.positionToCoordinate)(l,t.height(),a,(0,s.positionVisualDirection)(l,t.isInverted()))}}},619540:(e,t,i)=>{"use strict";var r=i(821979).LineDataSource,n=i(190973).default,s=i(853965).DefaultProperty;class o extends r{constructor(e,t,r,n){super(e,t||o.createProperties(),r,n),this.version=o.version,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,6360)).then((({NotePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}pointsCount(){return 1}name(){return"Note"}getTooltipWidth(){return o.TOOLTIP_WIDTH}getTooltipPadding(){return o.TOOLTIP_PADDING}getTooltipLineSpacing(){return o.TOOLTIP_LINESPACING}template(){var e=super.template();return e.text=this.properties().childs().text.value(),e}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}static createProperties(e){void 0!==e&&void 0!==e.markerColor&&void 0===e.borderColor&&(e.borderColor=e.markerColor);var t=new s("linetoolnote",e);return this._configureProperties(t),t}state(e){var t=super.state(e);return e&&(t.state.fixedSize=!1),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,193397))).NoteDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new n(i.tf(null,void 0,i(37229)))),e.addExclusion("text")}}o.TOOLTIP_WIDTH=300,o.TOOLTIP_PADDING=10,o.TOOLTIP_LINESPACING=5,o.version=1;class l extends o{constructor(e,t){super(e,t||l.createProperties())}title(){return i.tf(null,void 0,i(366828))}name(){return"Anchored Note"}isFixed(){return!0}hasEditableCoordinates(){return!1}static createProperties(e){var t=new s("linetoolnoteabsolute",e);return this._configureProperties(t),t}}t.LineToolNote=o,t.LineToolNoteAbsolute=l},778737:(e,t,i)=>{"use strict";var r=i(477227).LineToolTrading,n=i(837202).LineToolPriceAxisView,s=i(586784),o=i(821979).LineDataSource,l=i(853965).DefaultProperty;const a=i(244842);var c=i(888929).sortSourcesPreOrdered.LineToolOrder;function u(e){return null==e?e="":e+="",e}class d{constructor(e){this._line=e,this._data={bodyText:"order",quantityText:"0"},this._editable=!0,this._cancellable=!0,this._mode="",this._direction="buy",this._active=!0}setMode(e){return this._mode=e,this._line.updateAllViewsAndRedraw(),this}setDirection(e){return this._direction=e,this._line.updateAllViewsAndRedraw(),this}setActive(e){return this._active=e, this._line.updateAllViewsAndRedraw(),this}setEditable(e){return this._editable=e,this._line.updateAllViewsAndRedraw(),this}getEditable(){return this._editable}setCancellable(e){return this._cancellable=e,this._line.updateAllViewsAndRedraw(),this}getCancellable(){return this._cancellable}hasMoveCallback(){return this.isFunction(this._onMoveCallback)}hasModifyCallback(){return this.isFunction(this._onModifyCallback)}getPrice(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0}setPrice(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this}getText(){return this._data.bodyText}setText(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this}setTooltip(e){return this._line.properties().tooltip.setValue(u(e)),this}getTooltip(){return this._line.properties().tooltip.value()}setModifyTooltip(e){return this._line.properties().modifyTooltip.setValue(u(e)),this}getModifyTooltip(){return this._line.properties().modifyTooltip.value()}setCancelTooltip(e){return this._line.properties().cancelTooltip.setValue(u(e)),this}getCancelTooltip(){return this._line.properties().cancelTooltip.value()}getQuantity(){return this._data.quantityText}setQuantity(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this}getExtendLeft(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e}setExtendLeft(e){return this._line.properties().extendLeft.setValue(e),this}getLineLength(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e}setLineLength(e,t="percentage"){const i=t&&"pixel"===t?e:Math.max(0,Math.min(e,100));return this._line.properties().lineLength.setValue(i),this._line.properties().lineLengthUnit.setValue(t),this}getLineLengthUnit(){return this._line.properties().lineLengthUnit.value()}getLineColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.lineActiveBuyColor.value():e.lineInactiveBuyColor.value():this._active?e.lineActiveSellColor.value():e.lineInactiveSellColor.value()}setLineColor(e){return"buy"===this._direction?this._active?this.setLineActiveBuyColor(e):this.setLineInactiveBuyColor(e):this._active?this.setLineActiveSellColor(e):this.setLineInactiveSellColor(e),this}setLineActiveBuyColor(e){return this._line.properties().lineActiveBuyColor.setValue(e),this}setLineInactiveBuyColor(e){return this._line.properties().lineInactiveBuyColor.setValue(e),this}setLineActiveSellColor(e){return this._line.properties().lineActiveSellColor.setValue(e),this}setLineInactiveSellColor(e){return this._line.properties().lineInactiveSellColor.setValue(e),this}getLineStyle(){var e=this._line.properties().lineStyle.value() ;return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e}setLineStyle(e){return this._line.properties().lineStyle.setValue(e),this}getLineWidth(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e}setLineWidth(e){return this._line.properties().lineWidth.setValue(e),this}getBodyBorderColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.bodyBorderActiveBuyColor.value():e.bodyBorderInactiveBuyColor.value():this._active?e.bodyBorderActiveSellColor.value():e.bodyBorderInactiveSellColor.value()}setBodyBorderColor(e){return"buy"===this._direction?this._active?this.setBodyBorderActiveBuyColor(e):this.setBodyBorderInactiveBuyColor(e):this._active?this.setBodyBorderActiveSellColor(e):this.setBodyBorderInactiveSellColor(e),this}setBodyBorderActiveBuyColor(e){return this._line.properties().bodyBorderActiveBuyColor.setValue(e),this}setBodyBorderInactiveBuyColor(e){return this._line.properties().bodyBorderInactiveBuyColor.setValue(e),this}setBodyBorderActiveSellColor(e){return this._line.properties().bodyBorderActiveSellColor.setValue(e),this}setBodyBorderInactiveSellColor(e){return this._line.properties().bodyBorderInactiveSellColor.setValue(e),this}getBodyBackgroundColor(){return s.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)}setBodyBackgroundColor(e){return s.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this}getBodyTextColor(){var e=this._line.properties();return"limit"===this._mode?this._active?e.bodyTextActiveLimitColor.value():e.bodyTextInactiveLimitColor.value():"stop"===this._mode?this._active?e.bodyTextActiveStopColor.value():e.bodyTextInactiveStopColor.value():"buy"===this._direction?this._active?e.bodyTextActiveBuyColor.value():e.bodyTextInactiveBuyColor.value():this._active?e.bodyTextActiveSellColor.value():e.bodyTextInactiveSellColor.value()}setBodyTextColor(e){return"limit"===this._mode?this._active?this.setBodyTextActiveLimitColor(e):this.setBodyTextInactiveLimitColor(e):"stop"===this._mode?this._active?this.setBodyTextActiveStopColor(e):this.setBodyTextInactiveStopColor(e):"buy"===this._direction?this._active?this.setBodyTextActiveBuyColor(e):this.setBodyTextInactiveBuyColor(e):this._active?this.setBodyTextActiveSellColor(e):this.setBodyTextInactiveSellColor(e),this}setBodyTextInactiveLimitColor(e){return this._line.properties().bodyTextInactiveLimitColor.setValue(e),this}setBodyTextActiveLimitColor(e){return this._line.properties().bodyTextActiveLimitColor.setValue(e),this}setBodyTextInactiveStopColor(e){return this._line.properties().bodyTextInactiveStopColor.setValue(e),this}setBodyTextActiveStopColor(e){return this._line.properties().bodyTextActiveStopColor.setValue(e),this}setBodyTextInactiveBuyColor(e){return this._line.properties().bodyTextInactiveBuyColor.setValue(e),this}setBodyTextActiveBuyColor(e){ return this._line.properties().bodyTextActiveBuyColor.setValue(e),this}setBodyTextInactiveSellColor(e){return this._line.properties().bodyTextInactiveSellColor.setValue(e),this}setBodyTextActiveSellColor(e){return this._line.properties().bodyTextActiveSellColor.setValue(e),this}getBodyFont(){return s.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)}setBodyFont(e){return s.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this}getQuantityBorderColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.quantityBorderActiveBuyColor.value():e.quantityBorderInactiveBuyColor.value():this._active?e.quantityBorderActiveSellColor.value():e.quantityBorderInactiveSellColor.value()}setQuantityBorderColor(e){return"buy"===this._direction?this._active?this.setQuantityBorderActiveBuyColor(e):this.setQuantityBorderInactiveBuyColor(e):this._active?this.setQuantityBorderActiveSellColor(e):this.setQuantityBorderInactiveSellColor(e),this}setQuantityBorderActiveBuyColor(e){return this._line.properties().quantityBorderActiveBuyColor.setValue(e),this}setQuantityBorderInactiveBuyColor(e){return this._line.properties().quantityBorderInactiveBuyColor.setValue(e),this}setQuantityBorderActiveSellColor(e){return this._line.properties().quantityBorderActiveSellColor.setValue(e),this}setQuantityBorderInactiveSellColor(e){return this._line.properties().quantityBorderInactiveSellColor.setValue(e),this}getQuantityBackgroundColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.quantityBackgroundActiveBuyColor.value():e.quantityBackgroundInactiveBuyColor.value():this._active?e.quantityBackgroundActiveSellColor.value():e.quantityBackgroundInactiveSellColor.value()}setQuantityBackgroundColor(e){return"buy"===this._direction?this._active?this.setQuantityBackgroundActiveBuyColor(e):this.setQuantityBackgroundInactiveBuyColor(e):this._active?this.setQuantityBackgroundActiveSellColor(e):this.setQuantityBackgroundInactiveSellColor(e),this}setQuantityBackgroundActiveBuyColor(e){return this._line.properties().quantityBackgroundActiveBuyColor.setValue(e),this}setQuantityBackgroundInactiveBuyColor(e){return this._line.properties().quantityBackgroundInactiveBuyColor.setValue(e),this}setQuantityBackgroundActiveSellColor(e){return this._line.properties().quantityBackgroundActiveSellColor.setValue(e),this}setQuantityBackgroundInactiveSellColor(e){return this._line.properties().quantityBackgroundInactiveSellColor.setValue(e),this}getQuantityTextColor(){return s.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)}setQuantityTextColor(e){return s.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this}getQuantityFont(){ return s.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)}setQuantityFont(e){return s.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this}getCancelButtonBorderColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.cancelButtonBorderActiveBuyColor.value():e.cancelButtonBorderInactiveBuyColor.value():this._active?e.cancelButtonBorderActiveSellColor.value():e.cancelButtonBorderInactiveSellColor.value()}setCancelButtonBorderColor(e){return"buy"===this._direction?this._active?this.setCancelButtonBorderActiveBuyColor(e):this.setCancelButtonBorderInactiveBuyColor(e):this._active?this.setCancelButtonBorderActiveSellColor(e):this.setCancelButtonBorderInactiveSellColor(e),this}setCancelButtonBorderActiveBuyColor(e){return this._line.properties().cancelButtonBorderActiveBuyColor.setValue(e),this}setCancelButtonBorderInactiveBuyColor(e){return this._line.properties().cancelButtonBorderInactiveBuyColor.setValue(e),this}setCancelButtonBorderActiveSellColor(e){return this._line.properties().cancelButtonBorderActiveSellColor.setValue(e),this}setCancelButtonBorderInactiveSellColor(e){return this._line.properties().cancelButtonBorderInactiveSellColor.setValue(e),this}getCancelButtonBackgroundColor(){return s.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)}setCancelButtonBackgroundColor(e){return s.setColorToProperties(e,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this}getCancelButtonIconColor(){var e=this._line.properties();return"buy"===this._direction?this._active?e.cancelButtonIconActiveBuyColor.value():e.cancelButtonIconInactiveBuyColor.value():this._active?e.cancelButtonIconActiveSellColor.value():e.cancelButtonIconInactiveSellColor.value()}setCancelButtonIconColor(e){return"buy"===this._direction?this._active?this.setCancelButtonIconActiveBuyColor(e):this.setCancelButtonIconInactiveBuyColor(e):this._active?this.setCancelButtonIconActiveSellColor(e):this.setCancelButtonIconInactiveSellColor(e),this}setCancelButtonIconActiveBuyColor(e){return this._line.properties().cancelButtonIconActiveBuyColor.setValue(e),this}setCancelButtonIconInactiveBuyColor(e){return this._line.properties().cancelButtonIconInactiveBuyColor.setValue(e),this}setCancelButtonIconActiveSellColor(e){return this._line.properties().cancelButtonIconActiveSellColor.setValue(e),this}setCancelButtonIconInactiveSellColor(e){return this._line.properties().cancelButtonIconInactiveSellColor.setValue(e),this}block(){this._blocked=!0,this._line.updateAllViewsAndRedraw()}unblock(){this._blocked=!1,this._line.updateAllViewsAndRedraw()}getBlocked(){return this._blocked}isFunction(e){return"function"==typeof e} onCancel(e,t){return t?this.isFunction(t)&&(this._onCancelData=e,this._onCancelCallback=t):this.isFunction(e)&&(this._onCancelCallback=e),this}callOnCancel(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)}isOnCancelCallbackPresent(){return this.isFunction(this._onCancelCallback)}onModify(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this}callOnModify(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)}onMove(e,t){return t?this.isFunction(t)&&(this._onMoveData=e,this._onMoveCallback=t):this.isFunction(e)&&(this._onMoveCallback=e),this}callOnMove(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)}onMoving(e,t){return t?this.isFunction(t)&&(this._onMovingData=e,this._onMovingCallback=t):this.isFunction(e)&&(this._onMovingCallback=e),this}callOnMoving(){this.isFunction(this._onMovingCallback)&&this._onMovingCallback.call(this,this._onMovingData)}onContextMenu(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this}shouldShowContextMenu(){return this.isFunction(this._onContextMenuCallback)}callOnContextMenu(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)}remove(){this._line._model.removeSource(this._line),delete this._line}}class h extends r{constructor(e,t){super(e,t||h.createProperties()),this._adapter=new d(this),this.setSelectionEnabled(!0),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,198918)).then((({OrderPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}zorder(){return c}isSpeciallyZOrderedSource(){return!0}setPoint(e,t,i){this._points[e]=t,this.normalizePoints()}addPoint(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}name(){return"Order"}move(e,t,i,r){var n=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.logical.price!==this._currentMovingPoint.logical.price;super.move(e,t,i,r),n&&this._adapter.callOnMoving()}endMoving(e){var t=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.logical.price!==this._currentMovingPoint.logical.price;super.endMoving(),!e&&t&&this._adapter.callOnMove()}createPriceAxisView(e){var t={pointIndex:e,backgroundPropertyGetter:()=>this._adapter.getLineColor()};return this._priceAxisView=new n(this,t),this._priceAxisView}paneViews(){return TradingView.printing&&!a.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?o.prototype.paneViews.call(this):null}priceAxisViews(e,t){return TradingView.printing&&!a.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?o.prototype.priceAxisViews.call(this,e,t):null}adapter(){return this._adapter}hasContextMenu(){ return this._adapter.shouldShowContextMenu()}contextMenuItems(){return this._adapter.callOnContextMenu()}movable(){return Boolean(this._adapter._onMoveCallback)}static createProperties(e){var t=new l("linetoolorder",e,!1,!1);return this._configureProperties(t),t}}t.LineToolOrder=h},247035:(e,t,i)=>{"use strict";i.d(t,{LineToolParallelChannel:()=>d});var r=i(650151),n=i(86441),s=i(811630),o=i(853965),l=i(885482),a=i(821979),c=i(389137),u=i(190973);class d extends a.LineDataSource{constructor(e,t,r,n){super(e,t||d.createProperties(),r,n),this._priceAxisViews.push(this.createPriceAxisView(3)),this._coordOffsetWhileMovingOrChanging=null,this._pendingPriceOffset=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,570404)).then((({ParallelChannelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])})),s.alertsAvailable&&this._normalizedPointsChanged.subscribe(this,this._updateAlertCreationAvailable)}paneViews(e){return null!==this._pendingPriceOffset&&this._applyPendingPriceOffset(),super.paneViews(e)}setLastPoint(e,t){t&&t.shift()&&2===this.points().length&&this._snapPoint45Degree(e,this.points()[0]);const i=(0,c.clone)(e);return super.setLastPoint(e),i}startMoving(e,t,i,r){super.startMoving(e,t,i,r),this._coordOffsetWhileMovingOrChanging=this._findPixelsHeight()}endMoving(e,t,i){return this._coordOffsetWhileMovingOrChanging=null,super.endMoving(e,t,i)}startChanging(e,t){super.startChanging(e,t),this._coordOffsetWhileMovingOrChanging=this._findPixelsHeight()}endChanging(e,t,i){return this._coordOffsetWhileMovingOrChanging=null,super.endChanging(e,t,i)}restoreExternalPoints(e,t,i){const r=i?e.points:this._timePoint.map(((t,i)=>({price:t.price,offset:e.points[i].offset,time_t:e.points[i].time_t})));if(super.restoreExternalPoints({...e,points:r},t),t.pricesChanged&&this._points.length===r.length)for(let e=0;e=4)return;this._snapPointBeforeChange(e,t,i);const o=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),a=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),c=(0,r.ensureNotNull)(this.pointToScreenPoint(t)),u=(0,r.ensureNotNull)(this._coordOffsetWhileMovingOrChanging),d=(0,r.ensureNotNull)(this.priceScale()),h=(0,r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue());switch(e){case 0:super.setPoint(e,t,i),this._points[2].price=d.coordinateToPrice(c.y+u,h);break;case 1:super.setPoint(e,t,i);break;case 2:super.setPoint(e,t,i),this._points[0].price=d.coordinateToPrice(c.y-u,h),this._points[0].index=t.index;break;case 3:this._points[1].price=d.coordinateToPrice(c.y-u,h),this._points[1].index=t.index;break;case 4:{const e=a.subtract(o),t=(c.x-o.x)/e.x,i=o.addScaled(e,t),r=c.y-i.y;this._points[2].price=d.coordinateToPrice(o.y+r,h);break}case 5:{ const e=a.subtract(o),t=(c.x-o.x)/e.x,i=o.addScaled(e,t),r=c.y-i.y;this._points[0].price=d.coordinateToPrice(o.y+r,h),this._points[1].price=d.coordinateToPrice(a.y+r,h);break}}const p=this.linkKey().value();if(p&&!n&&e<4){const e=this._points.map((e=>e.price));(0,l.changeLineStyle)({model:this._model,linkKey:p,state:{prices:e}})}}state(e){const t=super.state(e);return this._pendingPriceOffset&&(t.priceOffset=this._pendingPriceOffset),t}restoreExternalState(e){const{prices:t,...i}=e;if(t&&this.isActualSymbol())for(let e=0;ee.index<=t.index?[e,t]:[t,e],r=i(t[0],t[1]),n=i(t[2],t[3]);let s,o,l,a;t[2].pricenull!==e))}_correctLastPoint(e){if(this._points.length<2||this._points[1].index===this._points[0].index)return e;const t=(0,r.ensureNotNull)(this.pointToScreenPoint(e)),i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),s=(0, r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),o=i.subtract(s),l=(t.x-s.x)/o.x,a=s.addScaled(o,l),c=t.y-a.y,u=s.add(new n.Point(0,c));return(0,r.ensureNotNull)(this.screenPointToPoint(u))}static _configureProperties(e){super._configureProperties(e),e.hasChild("labelText")||e.addChild("labelText",new u.default("")),e.addExclusion("labelText")}_isTimePointsValid(){return this._timePoint.every((e=>Number.isFinite(e.price)))}_axisPoints(){const e=this.points(),t=this._points[0]?this.pointToScreenPoint(this._points[0]):null,i=this._points[1]?this.pointToScreenPoint(this._points[1]):null,s=this._points[2]?this.pointToScreenPoint(this._points[2]):null;if(t&&i&&s){const o=i.y-t.y,l=s.add(new n.Point(0,o));e.push((0,r.ensureNotNull)(this.screenPointToPoint(l)))}return e}_convertLastPointTo3rdPoint(e){const t=(0,r.ensureNotNull)(this.pointToScreenPoint(e)),i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[1])),s=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),o=i.subtract(s),l=(t.x-s.x)/o.x,a=s.addScaled(o,l),c=t.y-a.y,u=s.add(new n.Point(0,c));return(0,r.ensureNotNull)(this.screenPointToPoint(u))}_findPixelsHeight(){const e=this.pointToScreenPoint(this._points[2]),t=this.pointToScreenPoint(this._points[0]);return e&&t?e.y-t.y:null}_applyPendingPriceOffset(){const e=this._pendingPriceOffset;if(null===e||this._points.length<3)return;const t=this.priceScale(),i=(0,r.ensureNotNull)(this.ownerSource()).firstValue();if(!t||t.isEmpty()||null===i)return;const n=e+this._points[0].price,s=e+this._points[1].price,o=.5*(n+s)-e,l=.5*(n+s),a=t.priceToCoordinate(o,i),c=t.priceToCoordinate(l,i)-a,u=t.priceToCoordinate(this._points[0].price,i)+c,d=t.coordinateToPrice(u,i);this._points[2].price=d,this._timePoint[2].price=d,this._points[2].index=this._points[0].index,this._timePoint[2].time_t=this._timePoint[0].time_t,this._timePoint[2].offset=this._timePoint[0].offset,this._pendingPriceOffset=null}_snapPointBeforeChange(e,t,i){if(i&&i.shift())switch(e){case 0:case 1:this._snapPoint45Degree(t,this._points[1-e]);break;case 2:case 3:const i=(0,r.ensureNotNull)(this.getPoint(5-e));this._snapPoint45Degree(t,i)}}}},999432:(e,t,i)=>{"use strict";i.d(t,{LineToolPath:()=>c});var r=i(650151),n=i(86441),s=i(853965),o=i(9640),l=i(821979),a=i(31712);class c extends l.LineDataSource{constructor(e,t,r,n){const s=t||c.createProperties();super(e,s,r,n),this._finished=!1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,310981)).then((t=>{this._setPaneViews([new t.PathPaneView(this,e)])}))}pointsCount(){return-1}name(){return"Path"}hasEditableCoordinates(){return!1}finish(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()}addPoint(e,t,i){var s;if(this._finished)return!0;const l=(0,r.ensureNotNull)(this.priceScale()),a=this._model.timeScale().indexToCoordinate(e.index),c=e.price,u=(0,r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue()),d=l.priceToCoordinate(c,u);if(this._points.length>0){ const e=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(e.index),r=e.price,s=l.priceToCoordinate(r,u),c=new n.Point(a,d).subtract(new n.Point(i,s)).length();if(!(null==t?void 0:t.isApiEvent())&&c<(0,o.interactionTolerance)().minDistanceBetweenPoints)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}return super.addPoint(e,t,i)}static createProperties(e){const t=new s.DefaultProperty("linetoolpath",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,317115)).then((e=>e.PathDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addChild("linesWidths",new a.LineToolWidthsProperty([(0,r.ensureDefined)(e.child("lineWidth"))])),e.addChild("linesColors",new a.LineToolColorsProperty([e.childs().lineColor]))}}},932732:(e,t,i)=>{"use strict";var r=i(809796).TranslatedString,n=i(821979).LineDataSource,s=i(517336).LevelsProperty,o=i(31712),l=o.LineToolWidthsProperty,a=o.LineToolColorsProperty,c=new r("erase level line",i.tf(null,void 0,i(812962)));class u extends n{constructor(e,t,r,n){super(e,t||u.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,443454)).then((({PitchfanLinePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return u.LevelsCount}pointsCount(){return 3}name(){return"Pitchfan"}processErase(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,c)}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,315340))).PitchBaseDefinitionsViewModel}static createProperties(e){var t=new s("linetoolpitchfan",e,!1,{range:[0,8]});return this._configureProperties(t),t}static _configureProperties(e){super._configureProperties(e);for(var t=[e.child("median").child("linewidth")],i=[e.child("median").child("color")],r=0;r<=this.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new a(i)),e.addChild("linesWidths",new l(t))}}u.LevelsCount=8,t.LineToolPitchfan=u},9093:(e,t,i)=>{"use strict";var r=i(809796).TranslatedString,n=i(821979).LineDataSource,s=i(517336).LevelsProperty,o=i(373571).Action,l=i(607509).ACTION_ID,a=i(642346).LineToolPitchforkStyle,c=null,u=i(31712),d=u.LineToolWidthsProperty,h=u.LineToolColorsProperty,p=new r("erase level line",i.tf(null,void 0,i(812962))),v=new r("change {title} style",i.tf(null,void 0,i(474428)));class _ extends n{constructor(e,t,i,r){super(e,t||_.createProperties(),i,r),this._properties.style.listeners().subscribe(this,this._recreatePaneView),this._recreatePaneView()}levelsCount(){return _.LevelsCount}additionalActions(e){for(var t=[],n=[{title:i.tf(null,void 0,i(825595)),actionId:l.ChartLineToolPitchforkChangeTypeToOriginal},{title:i.tf(null,void 0,i(966276)), actionId:l.ChartLineToolPitchforkChangeTypeToModifiedSchiff},{title:i.tf(null,void 0,i(809114)),actionId:l.ChartLineToolPitchforkChangeTypeToInside},{title:i.tf(null,void 0,i(151464)),actionId:l.ChartLineToolPitchforkChangeTypeToSchiff}],s=0;s<4;s++){var a=new o({actionId:n[s].actionId,options:{checked:this.properties().style.value()===s,checkable:!0,label:n[s].title,payload:{target:this,value:s},onExecute:function(t){var i=t.getPayload(),n=i.target;e.setProperty(n.properties().style,i.value,v.format({title:new r(n.name(),n.title())})),n.updateAllViews(),n._model.updateSource(n)}}});t.push(a)}return[t[0],t[3],t[1],t[2]]}_recreatePaneView(){if(null!==c){var e=[];this._properties.style.value()===a.Original?e=[new c.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===a.Schiff?e=[new c.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===a.Schiff2?e=[new c.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===a.Inside&&(e=[new c.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(e)}else Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,183415)).then((e=>{null===c&&(c=e),this._recreatePaneView()}))}pointsCount(){return 3}name(){return"Pitchfork"}processErase(e,t){var i="level"+t,r=this.properties()[i].visible;e.setProperty(r,!1,p)}static createProperties(e){var t=new s("linetoolpitchfork",e,!1,{range:[0,8]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,61107))).PitchForkDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e);for(var t=[e.child("median").child("linewidth")],i=[e.child("median").child("color")],r=0;r<=this.LevelsCount;r++)t.push(e.child("level"+r).child("linewidth")),i.push(e.child("level"+r).child("color"));e.addChild("linesColors",new h(i)),e.addChild("linesWidths",new d(t))}}_.LevelsCount=8,t.LineToolPitchfork=_},527342:(e,t,i)=>{"use strict";i.d(t,{LineToolPolyline:()=>a});var r=i(650151),n=i(86441),s=i(853965),o=i(9640),l=i(821979);class a extends l.LineDataSource{constructor(e,t,r,n){const s=t||a.createProperties();super(e,s,r,n),this._finished=!1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,623652)).then((t=>{this._setPaneViews([new t.PolylinePaneView(this,e)])}))}pointsCount(){return-1}name(){return"Polyline"}hasEditableCoordinates(){return!1}finish(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()}addPoint(e,t,i){var s;if(this._finished)return!0;const l=(0,r.ensureNotNull)(this.priceScale()),a=this._model.timeScale().indexToCoordinate(e.index),c=e.price,u=(0,r.ensure)(null===(s=this.ownerSource())||void 0===s?void 0:s.firstValue()),d=l.priceToCoordinate(c,u),h=(0,o.interactionTolerance)().minDistanceBetweenPoints;if(this._points.length>0){ const e=this._points[this._points.length-1],i=this._model.timeScale().indexToCoordinate(e.index),r=e.price,s=l.priceToCoordinate(r,u),o=new n.Point(a,d).subtract(new n.Point(i,s)).length();if(!(null==t?void 0:t.isApiEvent())&&oe.PolylinesDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addExclusion("filled")}}},674053:(e,t,i)=>{"use strict";var r=i(477227).LineToolTrading,n=i(821979).LineDataSource,s=i(670023).PositionAveragePriceAxisView,o=i(586784),l=i(853965).DefaultProperty,a=i(624444).PriceFormatter;const c=i(244842);var u=i(888929).sortSourcesPreOrdered.LineToolPosition;function d(e){return null==e?e="":e+="",e}class h{constructor(e){this._line=e,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0,this._direction="buy",this._profitState="neutral"}setDirection(e){return this._direction=e,this._line.updateAllViewsAndRedraw(),this}setProfitState(e){return this._profitState=e,this._line.updateAllViewsAndRedraw(),this}getPrice(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0}setPrice(e){if(this._line.points().length>0){var t=this._line.points()[0];t.price=e,this._line._points[0]=t,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=e),this}getText(){return this._data.bodyText}setText(e){return this._data.bodyText=e||"",this._line.updateAllViewsAndRedraw(),this}setTooltip(e){return this._line.properties().tooltip.setValue(d(e)),this}getTooltip(){return this._line.properties().tooltip.value()}setProtectTooltip(e){ return this._line.properties().protectTooltip.setValue(d(e)),this}getProtectTooltip(){return this._line.properties().protectTooltip.value()}setCloseTooltip(e){return this._line.properties().closeTooltip.setValue(d(e)),this}getCloseTooltip(){return this._line.properties().closeTooltip.value()}setReverseTooltip(e){return this._line.properties().reverseTooltip.setValue(d(e)),this}getReverseTooltip(){return this._line.properties().reverseTooltip.value()}getQuantity(){return this._data.quantityText}setQuantity(e){return this._data.quantityText=e||"",this._line.updateAllViewsAndRedraw(),this}getExtendLeft(){var e=this._line.properties().extendLeft.value();return"inherit"===e?this._line._model.properties().tradingProperties.extendLeft.value():e}setExtendLeft(e){return this._line.properties().extendLeft.setValue(e),this}getLineLength(){var e=this._line.properties().lineLength.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineLength.value():e}getLineLengthUnit(){return this._line.properties().lineLengthUnit.value()}setLineLength(e,t="percentage"){const i=t&&"pixel"===t?e:Math.max(0,Math.min(e,100));return this._line.properties().lineLength.setValue(i),this._line.properties().lineLengthUnit.setValue(t),this}getLineColor(){var e=this._line.properties();return("buy"===this._direction?e.lineBuyColor:e.lineSellColor).value()}setLineColor(e){return"buy"===this._direction?this.setLineBuyColor(e):this.setLineSellColor(e),this}setLineBuyColor(e){return this._line.properties().lineBuyColor.setValue(e),this}setLineSellColor(e){return this._line.properties().lineSellColor.setValue(e),this}getLineStyle(){var e=this._line.properties().lineStyle.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineStyle.value():e}setLineStyle(e){return this._line.properties().lineStyle.setValue(e),this}getLineWidth(){var e=this._line.properties().lineWidth.value();return"inherit"===e?this._line._model.properties().tradingProperties.lineWidth.value():e}setLineWidth(e){return this._line.properties().lineWidth.setValue(e),this}getBodyBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.bodyBorderBuyColor:e.bodyBorderSellColor).value()}setBodyBorderColor(e){return"buy"===this._direction?this.setBodyBorderBuyColor(e):this.setBodyBorderSellColor(e),this}setBodyBorderBuyColor(e){return this._line.properties().bodyBorderBuyColor.setValue(e),this}setBodyBorderSellColor(e){return this._line.properties().bodyBorderSellColor.setValue(e),this}getBodyBackgroundColor(){return o.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)}setBodyBackgroundColor(e){return o.setColorToProperties(e,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this}getBodyTextColor(){var e=this._line.properties();return("positive"===this._profitState?e.bodyTextPositiveColor:"negative"===this._profitState?e.bodyTextNegativeColor:e.bodyTextNeutralColor).value()}setBodyTextColor(e){ return"positive"===this._profitState?this.setBodyTextPositiveColor(e):"negative"===this._profitState?this.setBodyTextNegativeColor(e):this.setBodyTextNeutralColor(e),this}setBodyTextPositiveColor(e){return this._line.properties().bodyTextPositiveColor.setValue(e),this}setBodyTextNegativeColor(e){return this._line.properties().bodyTextNegativeColor.setValue(e),this}setBodyTextNeutralColor(e){return this._line.properties().bodyTextNeutralColor.setValue(e),this}getBodyFont(){return o.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)}setBodyFont(e){return o.setFontToProperties(e,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this}getQuantityBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.quantityBorderBuyColor:e.quantityBorderSellColor).value()}setQuantityBorderColor(e){return"buy"===this._direction?this.setQuantityBorderBuyColor(e):this.setQuantityBorderSellColor(e),this}setQuantityBorderBuyColor(e){return this._line.properties().quantityBorderBuyColor.setValue(e),this}setQuantityBorderSellColor(e){return this._line.properties().quantityBorderSellColor.setValue(e),this}getQuantityBackgroundColor(){var e=this._line.properties();return("buy"===this._direction?e.quantityBackgroundBuyColor:e.quantityBackgroundSellColor).value()}setQuantityBackgroundColor(e){return"buy"===this._direction?this.setQuantityBackgroundBuyColor(e):this.setQuantityBackgroundSellColor(e),this}setQuantityBackgroundBuyColor(e){return this._line.properties().quantityBackgroundBuyColor.setValue(e),this}setQuantityBackgroundSellColor(e){return this._line.properties().quantityBackgroundSellColor.setValue(e),this}getQuantityTextColor(){return o.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)}setQuantityTextColor(e){return o.setColorToProperties(e,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this}getQuantityFont(){return o.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)}setQuantityFont(e){return o.setFontToProperties(e,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this}getReverseButtonBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.reverseButtonBorderBuyColor:e.reverseButtonBorderSellColor).value()}setReverseButtonBorderColor(e){return"buy"===this._direction?this.setReverseButtonBorderBuyColor(e):this.setReverseButtonBorderSellColor(e),this}setReverseButtonBorderBuyColor(e){return this._line.properties().reverseButtonBorderBuyColor.setValue(e),this}setReverseButtonBorderSellColor(e){ return this._line.properties().reverseButtonBorderSellColor.setValue(e),this}getReverseButtonBackgroundColor(){return o.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)}setReverseButtonBackgroundColor(e){return o.setColorToProperties(e,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this}getReverseButtonIconColor(){var e=this._line.properties();return("buy"===this._direction?e.reverseButtonIconBuyColor:e.reverseButtonIconSellColor).value()}setReverseButtonIconColor(e){return"buy"===this._direction?this.setReverseButtonIconBuyColor(e):this.setReverseButtonIconSellColor(e),this}setReverseButtonIconBuyColor(e){return this._line.properties().reverseButtonIconBuyColor.setValue(e),this}setReverseButtonIconSellColor(e){return this._line.properties().reverseButtonIconSellColor.setValue(e),this}getCloseButtonBorderColor(){var e=this._line.properties();return("buy"===this._direction?e.closeButtonBorderBuyColor:e.closeButtonBorderSellColor).value()}setCloseButtonBorderColor(e){return"buy"===this._direction?this.setCloseButtonBorderBuyColor(e):this.setCloseButtonBorderSellColor(e),this}setCloseButtonBorderBuyColor(e){return this._line.properties().closeButtonBorderBuyColor.setValue(e),this}setCloseButtonBorderSellColor(e){return this._line.properties().closeButtonBorderSellColor.setValue(e),this}getCloseButtonBackgroundColor(){return o.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)}setCloseButtonBackgroundColor(e){return o.setColorToProperties(e,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this}getCloseButtonIconColor(){var e=this._line.properties();return("buy"===this._direction?e.closeButtonIconBuyColor:e.closeButtonIconSellColor).value()}setCloseButtonIconColor(e){return"buy"===this._direction?this.setCloseButtonIconBuyColor(e):this.setCloseButtonIconSellColor(e),this}setCloseButtonIconBuyColor(e){return this._line.properties().closeButtonIconBuyColor.setValue(e),this}setCloseButtonIconSellColor(e){return this._line.properties().closeButtonIconSellColor.setValue(e),this}block(){this._blocked=!0,this._line.updateAllViewsAndRedraw()}unblock(){this._blocked=!1,this._line.updateAllViewsAndRedraw()}isFunction(e){return"function"==typeof e}onReverse(e,t){return t?this.isFunction(t)&&(this._onReverseData=e,this._onReverseCallback=t):this.isFunction(e)&&(this._onReverseCallback=e),this}callOnReverse(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)}isOnReverseCallbackPresent(){return this.isFunction(this._onReverseCallback)}onClose(e,t){return t?this.isFunction(t)&&(this._onCloseData=e,this._onCloseCallback=t):this.isFunction(e)&&(this._onCloseCallback=e),this}setCloseEnabled(e){return this._closeEnabled===e||(this._closeEnabled=e, this._onCloseCallback&&this._line.updateAllViewsAndRedraw()),this}isCloseEnabled(){return this._closeEnabled}callOnClose(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)}isOnCloseCallbackPresent(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)}onModify(e,t){return t?this.isFunction(t)&&(this._onModifyData=e,this._onModifyCallback=t):this.isFunction(e)&&(this._onModifyCallback=e),this}callOnModify(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)}onContextMenu(e,t){return t?this.isFunction(t)&&(this._onContextMenuData=e,this._onContextMenuCallback=t):this.isFunction(e)&&(this._onContextMenuCallback=e),this}shouldShowContextMenu(){return this.isFunction(this._onContextMenuCallback)}callOnContextMenu(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)}remove(){this._line._model.removeSource(this._line),delete this._line}}class p extends r{constructor(e,t){super(e,t||p.createProperties()),this._adapter=new h(this),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.t.bind(i,221759,19)).then((({PositionPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}));var r=e.mainSeries().symbolInfo(),n=null!==r?r.pricescale:100,s=null!==r&&r.fractional?r.minmov:1,o=null!==r&&r.fractional,l=null!==r?r.minmove2:void 0;this._formatter=new a(n,s,o,l)}zorder(){return u}isSpeciallyZOrderedSource(){return!0}setPoint(e,t,i){this._points[e]=t,this.normalizePoints()}addPoint(e,t){return this._points.push(e),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}name(){return"Position"}createPriceAxisView(e){return this._priceAxisView=new s(this,{pointIndex:e,backgroundPropertyGetter:()=>this._adapter.getLineColor()}),this._priceAxisView}paneViews(){return TradingView.printing&&!c.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?n.prototype.paneViews.call(this):null}priceAxisViews(e,t){return TradingView.printing&&!c.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?n.prototype.priceAxisViews.call(this,e,t):null}hasContextMenu(){return this._adapter.shouldShowContextMenu()}contextMenuItems(){return this._adapter.callOnContextMenu()}formatter(){return this._formatter}static createProperties(e){var t=new l("linetoolposition",e,!1,!1);return this._configureProperties(t),t}}t.LineToolPosition=p},240569:(e,t,i)=>{"use strict";var r=i(650151).ensureNotNull,n=i(821979).LineDataSource,s=i(853965).DefaultProperty,o=i(917004);class l extends n{constructor(e,t,r,n){super(e,t||l.createProperties(),r,n),this._predictionPaneView=null;const s=this._model.mainSeries();s.properties().interval.subscribe(this,(()=>{this.setStatus(o.AlertStatus.Waiting)})),s.dataEvents().dataUpdated().subscribe(this,this.recalculateStateByData), Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.t.bind(i,133539,19)).then((({PredictionPaneView:e})=>{this._predictionPaneView=new e(this,this._model),this._setPaneViews([this._predictionPaneView])}))}destroy(){const e=this._model.mainSeries();e.properties().interval.unsubscribeAll(this),e.dataEvents().dataUpdated().unsubscribeAll(this),super.destroy()}dataAndViewsReady(){return super.dataAndViewsReady()&&this._predictionPaneView&&this._predictionPaneView.iconsReady()}isSynchronizable(){return!1}status(){return this._properties.status.value()}setStatus(e){return this._properties.status.setValue(e)}pointsCount(){return 2}name(){return"Forecast"}restorePoints(e,t,i){super.restorePoints(e,t,i),this.recalculateStateByData()}recalculateStateByData(){if(!this.isSourceHidden()&&!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){var e=this._points[1];if(this.status())e.index>this._model.timeScale().baseIndex()&&this.setStatus(o.AlertStatus.Waiting);else{var t=this._model.mainSeries().bars().valueAt(e.index);if(null!==t){var i=this.direction();if(i===o.Direction.Up&&t[TradingView.HIGH_PLOT]>=e.price)this.setStatus(o.AlertStatus.Success);else if(i===o.Direction.Down&&t[TradingView.LOW_PLOT]<=e.price)this.setStatus(o.AlertStatus.Success);else{var n=r(this._model.mainSeries().bars().lastIndex());e.index!==n&&this.setStatus(o.AlertStatus.Failure)}}}}}addPoint(e){var t=super.addPoint(e);return t&&this.recalculateStateByData(),t}endChanging(){super.endChanging(),this.setStatus(o.AlertStatus.Waiting),this.recalculateStateByData()}onData(e){super.onData(e),this.recalculateStateByData()}endMoving(e,t,i){super.endMoving(e,t,i),this.setStatus(o.AlertStatus.Waiting),this.recalculateStateByData()}direction(){if(this.points().length<2)return o.Direction.Up;var e=this.points()[0];return this.points()[1].price>e.price?o.Direction.Up:o.Direction.Down}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,87069))).PredictionDefinitionsViewModel}cloneable(){return!1}static createProperties(e){var t=new s("linetoolprediction",e);return this._configureProperties(t),t}static _configureProperties(e){super._configureProperties(e),e.merge({status:o.AlertStatus.Waiting})}}t.LineToolPrediction=l},729443:(e,t,i)=>{"use strict";var r=i(821979).LineDataSource,n=i(853965).DefaultProperty,s=i(31712).LineToolColorsProperty;class o extends r{constructor(e,t,r,n){super(e,t||o.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.t.bind(i,473612,19)).then((({PriceLabelPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}pointsCount(){return 1}name(){return"Price Label"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,732887))).PriceLabelDefinitionsViewModel}static createProperties(e){var t=new n("linetoolpricelabel",e);return this._configureProperties(t),t} static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new s([e.childs().borderColor])),e.addChild("textsColors",new s([e.childs().color]))}}t.LineToolPriceLabel=o},830695:(e,t,i)=>{"use strict";i.d(t,{LineToolPriceRange:()=>_});var r=i(821979),n=i(650151),s=i(61499),o=i(738232),l=i(941883),a=i(923237);const c={...l.nonThemedFactoryDefaultsBase,extendLeft:!1,extendRight:!1},u=l.themedFactoryDefaultsBase,d=(0,o.extractAllPropertiesKeys)((0,n.ensureDefined)(u.get(s.StdTheme.Light))),h=(0,o.extractAllPropertiesKeys)(c),p=[...d,...h,...a.commonLineToolPropertiesStateKeys,...l.allPropertiesStateKeysBase];class v extends l.DateAndPriceBaseProperties{static create(e){return new this({defaultName:"linetoolpricerange",defaultsSupplier:()=>(0,o.factoryDefaultsForCurrentTheme)(c,u),nonThemedDefaultsKeys:h,themedDefaultsKeys:d,allStateKeys:p,state:e})}}class _ extends r.LineDataSource{constructor(e,t,r,n){super(e,t||_.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,425784)).then((e=>{this._setPaneViews([new e.PriceRangePaneView(this,this._model)])}))}pointsCount(){return 2}name(){return"Price Range"}template(){return this._properties.template()}static createProperties(e){const t=v.create(e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,133954))).GeneralDatePriceRangeDefinitionsViewModel}}},506416:(e,t,i)=>{"use strict";i.d(t,{LineToolProjection:()=>o});var r=i(672688),n=i(517336),s=i(31712);class o extends r.LineToolFibWedgeBase{constructor(e,t,r,n){super(e,null!=t?t:o.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,678175)).then((e=>{this._setPaneViews([new e.ProjectionLinePaneView(this,this._model)])}))}levelsCount(){return 1}name(){return"Projection"}static createProperties(e){const t=new n.LevelsProperty("linetoolprojection",e,!1,{range:[1,1]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,758221))).ProjectionDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new s.LineToolColorsProperty([e.childs().trendline.childs().color]))}}},352747:(e,t,i)=>{"use strict";i.d(t,{LineToolRay:()=>n});var r=i(956268);class n extends r.LineToolTrendLine{constructor(e,t,i,r){super(e,null!=t?t:n.createProperties(),i,r)}name(){return"Ray"}static createProperties(e){const t=r.LineToolTrendLine._createPropertiesImpl("linetoolray",e);return n._configureProperties(t),t}}},442724:(e,t,i)=>{"use strict";i.d(t,{LineToolRectangle:()=>c});var r=i(86441),n=i(853965),s=i(190973),o=i(821979),l=i(31712),a=i(650151);class c extends o.LineDataSource{constructor(e,t,r,n){const s=t||c.createProperties();super(e,s,r,n), Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,239631)).then((({RectanglePaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}pointsCount(){return 2}textColorsProperty(){return this.properties().childs().showLabel.value()?super.textColorsProperty():null}name(){return"Rectangle"}setPoint(e,t,i){if(e<2&&super.setPoint(e,t,i),i&&i.shift()){const i=this._getAnchorPointForIndex(e);if(e>=4)return this._correctMiddlePoints(e,t,i),void this.normalizePoints();this._snapPoint45Degree(t,i)}switch(e){case 2:this._points[1].price=t.price,this._points[0].index=t.index;break;case 3:this._points[0].price=t.price,this._points[1].index=t.index;break;case 4:this._points[0].index=t.index;break;case 5:this._points[1].index=t.index;break;case 6:this._points[0].price=t.price;break;case 7:this._points[1].price=t.price}this.normalizePoints()}getPoint(e){return e<2?super.getPoint(e):this._getAnchorPointForIndex(e)}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e,t){const i=new n.DefaultProperty("linetoolrectangle",e,void 0,t);return this._configureProperties(i),i}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,261145)).then((e=>e.RectangleDefinitionsViewModel))}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_snapPoint45Degree(e,t,i){const r=this._priceScale,n=this.ownerSource();if(null===r||null===n)return;const s=n.firstValue();if(null===s)return;const o=this._model.timeScale(),l=(0,a.ensureNotNull)(this.pointToScreenPoint(e)),c=(0,a.ensureNotNull)(this.pointToScreenPoint(t)),u=l.x-c.x,d=l.y-c.y,h=u<0?-1:1,p=d<0?-1:1,v=Math.max(Math.abs(u),Math.abs(d)),_=Math.round(o.coordinateToIndex(c.x+v*h)),f=Math.abs(o.indexToCoordinate(_)-c.x),g=r.coordinateToPrice(c.y+f*p,s);e.index=_,e.price=g}_correctMiddlePoints(e,t,i){e<6?this._correctRightLeftMiddlePoint(e,t,i):this._correctTopBottomMiddlePoint(e,t,i)}_correctRightLeftMiddlePoint(e,t,i){const n=(0,a.ensureNotNull)(this.pointToScreenPoint(t)),s=(0,a.ensureNotNull)(this.pointToScreenPoint(i)),o=(0,a.ensureNotNull)(this.pointToScreenPoint(this._points[0])),l=(0,a.ensureNotNull)(this.pointToScreenPoint(this._points[1]));let c=n.x-s.x;if(0===c)return;const u=o.x{"use strict";var r;i.d(t,{RiskDisplayMode:()=>r}),function(e){e.Percentage="percents",e.Money="money"}(r||(r={}))},514524:(e,t,i)=>{"use strict";var r;i.d(t,{RiskRewardPointIndex:()=>r}),function(e){e[e.Entry=0]="Entry",e[e.Close=1]="Close",e[e.ActualEntry=2]="ActualEntry",e[e.ActualClose=3]="ActualClose"}(r||(r={}))},864555:(e,t,i)=>{"use strict";i.d(t,{LineToolRiskRewardLong:()=>S,LineToolRiskRewardShort:()=>T});var r=i(650151),n=i(182436),s=i(534741),o=i(291784),l=i(821979),a=i(264663),c=i(514524),u=i(229765),d=i(246733);class h extends u.PriceAxisView{constructor(e,t){super(),this._source=e,this._data=t}_updateRendererData(e,t,i){if(e.visible=!1,!this._showAxisLabel())return;const r=this._source.priceScale();if(0===this._source.points().length||null===r||r.isEmpty())return;const n=this._source.ownerSource(),s=null!==n?n.firstValue():null;if(null===s)return;const o=this._data.priceProperty.value(),l=(0,d.resetTransparency)(this._data.colorProperty.value());i.background=l, i.textColor=this.generateTextColor(l),i.coordinate=r.priceToCoordinate(o,s),e.text=r.formatPrice(o,s),e.visible=!0}_showAxisLabel(){return this._source.properties().childs().showPriceLabels.value()}}var p=i(190973);class v extends p.default{constructor(e,t){super(),this._lineSource=e,this._pointIndex=t}value(){const e=this._lineSource.points()[this._pointIndex].price;return this._formatAndParsePrice(e)}state(){return this.value()}merge(e,t){return this.setValue(e),t?[]:null}_formatAndParsePrice(e){const t=(0,r.ensureNotNull)(this._lineSource.ownerSource()).formatter();if(t.parse){const i=t.format(e),r=t.parse(i);return r.res?r.value:e}return e}}class _ extends v{constructor(e){super(e,0)}setValue(e){const t=this._lineSource.points()[this._pointIndex];this._lineSource.startChanging(this._pointIndex,t),t.price=parseFloat(""+e),this._lineSource.setPoint(this._pointIndex,t),this._lineSource.recalculate(),this._lineSource.model().updateSource(this._lineSource),this._listeners.fire(this,""),this._lineSource.endChanging(!1,!1),this._lineSource.syncPriceLevels()}}class f extends v{constructor(e){super(e,1)}value(){const e=this._lineSource.stopPrice();return this._formatAndParsePrice(e)}setValue(e){const t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource.ownerSourceBase());this._lineSource.properties().childs().stopLevel.setValue(t),this._lineSource.syncPriceLevels()}}class g extends v{constructor(e){super(e,2)}value(){const e=this._lineSource.profitPrice();return this._formatAndParsePrice(e)}setValue(e){const t=Math.round(Math.abs(e-this._lineSource.entryPrice())*this._lineSource.ownerSourceBase());this._lineSource.properties().childs().profitLevel.setValue(t),this._lineSource.syncPriceLevels()}}var m=i(389137),P=i(885482),y=i(964824);function w(e){return parseFloat(e.toFixed(2))}class C extends l.LineDataSource{constructor(e,t,s,l){super(e,t,s,l),this._syncStateExclusions=["points","entryPrice","stopPrice","targetPrice","stopLevel","profitLevel","riskSize","qty","amountTarget","amountStop"],this._riskInChange=!1,this.version=2,t.hasChild("stopLevel")||t.hasChild("profitLevel")||(t.addProperty("stopLevel",0),t.addProperty("profitLevel",0),this.ownerSourceChanged().subscribe(this,(()=>{const i=(0,r.ensureNotNull)(e.timeScale().visibleBarsStrictRange()),n=i.firstBar(),s=i.lastBar(),l=(0,r.ensureNotNull)(this.ownerSource()),a=l.priceScale();let c=(0,r.ensureNotNull)(l.priceRange(n,s));if(a&&a.isLog()){const e=a.logicalToPrice(c.minValue()),t=a.logicalToPrice(c.maxValue());c=new o.PriceRange(e,t)}if(c&&!c.isEmpty()){const e=Math.round(.2*c.length()*this.ownerSourceBase());t.merge({stopLevel:e,profitLevel:e})}}),!0));const u=t.childs();u.stopLevel.listeners().subscribe(this,this.recalculate),u.stopLevel.listeners().subscribe(null,(()=>{this.properties().childs().stopPrice.childChanged(null,"")})),u.profitLevel.listeners().subscribe(this,this.recalculate),u.profitLevel.listeners().subscribe(null,(()=>{this.properties().childs().targetPrice.childChanged(null,"")})),t.addChild("entryPrice",new _(this)), t.addChild("stopPrice",new f(this)),t.addChild("targetPrice",new g(this)),t.hasChild("riskSize")||t.addProperty("riskSize",0),t.hasChild("qty")||t.addProperty("qty",0),t.hasChild("amountTarget")||t.addProperty("amountTarget",u.accountSize.value()),t.hasChild("amountStop")||t.addProperty("amountStop",u.accountSize.value()),t.addExclusion("riskSize"),t.addExclusion("qty"),t.addExclusion("amountTarget"),t.addExclusion("amountStop"),this._riskInPercentsFormatter=new n.NumericFormatter(2),this._riskInMoneyFormatter=new n.NumericFormatter,u.risk.subscribe(this,this._recalculateRiskSize),u.accountSize.subscribe(this,this._recalculateRiskSize),u.riskDisplayMode.subscribe(this,this._recalculateRisk),u.riskDisplayMode.subscribe(this,this._recalculateRiskSize),u.entryPrice.subscribe(this,this._recalculateRiskSize),u.stopPrice.subscribe(this,this._recalculateRiskSize),u.profitLevel.subscribe(this,this._recalculateRiskSize),u.profitLevel.subscribe(this,this.syncPriceLevels.bind(this)),u.stopLevel.subscribe(this,this._recalculateRiskSize),u.stopLevel.subscribe(this,this.syncPriceLevels.bind(this)),u.qty.subscribe(this,this._recalculateRiskSize),this.ownerSourceChanged().subscribe(null,((e,t)=>{e&&e.barsProvider().dataUpdated().unsubscribeAll(this),t&&t.barsProvider().dataUpdated().subscribe(this,this._onSeriesUpdated)})),this.pointAdded().subscribe(this,(e=>{switch(e){case c.RiskRewardPointIndex.Entry:case c.RiskRewardPointIndex.Close:this._recalculateRiskSize(),this._recalculateQty()}})),this.pointChanged().subscribe(this,(e=>{switch(e){case c.RiskRewardPointIndex.Entry:case c.RiskRewardPointIndex.Close:this._recalculateRiskSize(),this._recalculateQty()}})),u.riskDisplayMode.value()===a.RiskDisplayMode.Percentage&&u.risk.value()>100&&u.riskDisplayMode.setValueSilently(a.RiskDisplayMode.Money),u.entryPrice.subscribe(this,this._recalculateQty),u.stopPrice.subscribe(this,this._recalculateQty),u.riskSize.subscribe(this,this._recalculateQty),u.entryPrice.subscribe(this,this._recalculateAmount),u.profitLevel.subscribe(this,this._recalculateAmount),u.stopLevel.subscribe(this,this._recalculateAmount),u.accountSize.subscribe(this,this._recalculateAmount),u.riskSize.subscribe(this,this._recalculateAmount),u.qty.subscribe(this,this._recalculateAmount),this._entryPriceAxisView=new h(this,{colorProperty:u.linecolor,priceProperty:u.entryPrice}),this._stopPriceAxisView=new h(this,{colorProperty:u.stopBackground,priceProperty:u.stopPrice}),this._profitPriceAxisView=new h(this,{colorProperty:u.profitBackground,priceProperty:u.targetPrice}),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,7293)).then((({RiskRewardPaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}destroy(){var e;null===(e=this.ownerSource())||void 0===e||e.barsProvider().dataUpdated().unsubscribeAll(this),this.ownerSourceChanged().unsubscribeAll(this),super.destroy()}hasEditableCoordinates(){return!1}setOwnerSource(e){super.setOwnerSource(e);const t=this.ownerSource() ;t&&t.symbolSource().symbolInfo()&&(this._recalculateAmount(),this._recalculateRiskSize(),this._recalculateQty())}pointsCount(){return 2}priceAxisViews(e,t){return this.isSourceHidden()||t!==this.priceScale()||this._model.paneForSource(this)!==e?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]}updateAllViews(e){this.isActualSymbol()&&this.properties().childs().visible.value()&&((0,P.hideAllDrawings)().value()&&this.userEditEnabled()||(super.updateAllViews(e),this._entryPriceAxisView.update(e),this._stopPriceAxisView.update(e),this._profitPriceAxisView.update(e)))}migrateVersion(e,t,i){if(1===e&&this._points.length>=1){const e=[];e.push(this._points[0]);let t=this._points[0];if(t={price:t.price,index:this._getClosePointIndex(t.index)},e.push(t),this._points[1]&&e.push(this._points[1]),this._points[2]&&e.push(this._points[2]),this._points=e,this._timePoint.length>=1){const t=[],i=this._timePoint[0];t.push(i);const r={price:i.price,time_t:i.time_t,offset:this._getClosePointIndex(i.offset)};t.push(r),this._timePoint[1]&&e.push(this._points[1]),this._timePoint[2]&&e.push(this._points[2]),this._timePoint=t}}}restoreExternalState(e){if((0,m.isNumber)(e.entryPrice)){if(e=Object.assign({},e),!this.isActualSymbol()){this._timePoint[0].price=e.entryPrice,delete e.entryPrice}this.properties().merge(e)}else super.restoreExternalState(e)}addPoint(e,t,i){e.price=this._roundPrice(e.price),super.addPoint(e,void 0,!0);const r={price:e.price,index:this._getClosePointIndex(e.index)};super._addPointIntenal(r,void 0,!0);const n=this._calculateActualEntry(e,r);if(n){super._addPointIntenal(n,void 0,!0);const e=this._findClosePoint(n,r);e&&super._addPointIntenal(e,void 0,!0)}return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}setPoint(e,t,i,r){if(!this.isActualSymbol())return;const n=this.properties().childs();switch(this._muteSyncLineStyle(),e){case 0:this._changeEntryPoint(t);break;case 2:n.stopPrice.setValue(this.prepareStopPrice(t.price));break;case 3:n.targetPrice.setValue(this.prepareProfitPrice(t.price));break;case 1:t.price=this._roundPrice(t.price),super.setPoint(1,t),this.recalculate()}this._unmuteSyncLineStyleWithoutApplyingChanges(),this.syncPriceLevels()}getPoint(e){switch(e){case 0:return this._points[0];case 1:return{index:this._points[1].index,price:this._points[0].price};case 2:return{index:this._points[0].index,price:this.stopPrice()};case 3:return{index:this._points[0].index,price:this.profitPrice()}}return null}setPoints(e){this._muteSyncLineStyle(),super.setPoints(e),this.recalculate(),this._unmuteSyncLineStyleWithoutApplyingChanges(),this.syncPriceLevels()}start(){super.start(),this.recalculate()}startMoving(e,t,i,n){const s=(0,r.ensureDefined)(e.logical);s.price=this._roundPrice(s.price),super.startMoving(e,t,i)}move(e,t,i,n){const s=(0,r.ensureDefined)(e.logical);s.price=this._roundPrice(s.price),super.move(e,t,i),this.recalculate(),this._entryPriceAxisView.update((0,y.sourceChangeEvent)(this.id()))}axisPoints(){ if(!this._points[c.RiskRewardPointIndex.ActualEntry])return[];const e=this._points[c.RiskRewardPointIndex.ActualEntry];let t=null;if(4===this._points.length)t=this._points[c.RiskRewardPointIndex.ActualClose];else{const e=this.lastBarData();if(!e)return[];t={index:e.index,price:e.closePrice}}return[e,t]}recalculateStateByData(){this.recalculate()}recalculate(){if(0===this.points().length)return;const e=this.properties().childs(),t=e.targetPrice.value(),i=e.stopPrice.value(),r=[this._points[0],this._points[1]],n=this._calculateActualEntry(this.points()[0],this.points()[1]);if(n){r.push(n);const e=this._findClosePoint(n,this.points()[1]);e&&r.push(e)}this._points=r,t!==e.targetPrice.value()&&e.targetPrice.listeners().fire(e.targetPrice,""),i!==e.stopPrice.value()&&e.stopPrice.listeners().fire(e.stopPrice,"")}syncPriceLevels(){const e=this.linkKey().value();if(e){const t=this.properties().childs(),i={entryPrice:t.entryPrice.value(),stopLevel:t.stopLevel.value(),profitLevel:t.profitLevel.value()};(0,P.changeLineStyle)({linkKey:e,state:i,model:this._model})}}entryPrice(){return this.points()[0].price}lastBarData(){var e;const t=null===(e=this.ownerSource())||void 0===e?void 0:e.barsProvider();if(!t)return null;const i=t.bars().firstIndex(),n=t.bars().lastIndex();if(null===i||null===n||isNaN(i)||isNaN(n))return null;const o=this.points();if(4===o.length){const e=o[c.RiskRewardPointIndex.ActualClose];return e.indexr?(e.risk.setValue(r),e.riskSize.setValue(r)):e.riskSize.setValue(t)}_roundPrice(e){const t=this.ownerSourceBase();return Math.round(e*t)/t}_ownerSourcePointValue(){var e,t,i;return null!==(i=null===(t=null===(e=this.ownerSource())||void 0===e?void 0:e.symbolSource().symbolInfo())||void 0===t?void 0:t.pointvalue)&&void 0!==i?i:1}static _configureProperties(e){l.LineDataSource._configureProperties(e),e.addExclusion("stopLevel"),e.addExclusion("profitLevel"),e.addExclusion("stopPrice"),e.addExclusion("targetPrice"),e.addExclusion("entryPrice")}_onSeriesUpdated(e,t,i){this.isSourceHidden()||this._points.length<2||null!==i&&i.index>Math.max(this._points[0].index,this._points[1].index)||this.recalculateStateByData()}_recalculateRisk(){const e=this.properties().childs(),t=e.riskDisplayMode.value(),i=e.riskSize.value(),r=e.accountSize.value();let n=e.risk.value();n=t===a.RiskDisplayMode.Percentage?w(i/r*100):w(r/100*n),this._riskInChange=!0,e.risk.setValue(+this._riskFormatter(t).format(n)),this._riskInChange=!1}_recalculateAmount(){if(0===this.points().length)return;const e=this.properties().childs(),t=e.accountSize.value(),i=e.entryPrice.value(),r=e.qty.value(),n=e.stopPrice.value(),s=e.targetPrice.value(),o=this._ownerSourcePointValue();e.amountTarget.setValue(this._amountTarget(t,s,i,r,o)),e.amountStop.setValue(this._amountStop(t,n,i,r,o))}_recalculateQty(){if(0===this.points().length)return;const e=this.properties().childs(),t=e.entryPrice.value(),i=e.stopPrice.value(),r=e.riskSize.value()/(Math.abs(t-i)*this._ownerSourcePointValue());e.qty.setValue(r)}_calculateActualEntry(e,t){const i=this.ownerSource();if(!i)return null;const n=i.barsProvider().bars();if(n.isEmpty())return null;const s=(0,r.ensureNotNull)(n.firstIndex()),o=Math.max(e.index,s),l=e.price,a=(0,r.ensureNotNull)(n.lastIndex()),c=Math.min(a,t.index);for(const e of n.rangeIterator(o,c+1)){const t=e.value;if(null!==t&&(0,r.ensure)(t[2])>=l&&(0,r.ensure)(t[3])<=l)return{index:e.index,price:l}}return null}_riskFormatter(e){return e===a.RiskDisplayMode.Percentage?this._riskInPercentsFormatter:this._riskInMoneyFormatter}_getClosePointIndex(e){const t=this._model.timeScale(),i=Math.round(t.width()/t.barSpacing());return e+Math.max(3,Math.round(.15*i))}_findClosePoint(e,t){const i=this.ownerSource();if(!i)return null;const n=i.barsProvider().bars(),s=(0,r.ensureNotNull)(n.firstIndex()),o=Math.max(e.index,s),l=(0,r.ensureNotNull)(n.lastIndex()),a=Math.min(l,t.index);for(const e of n.rangeIterator(o,a+1)){const t=e.value;if(null===t)continue;const i=this._checkStopPrice(t);if(null!=i)return{index:e.index,price:i}}return null}_changeEntryPoint(e){const t=this.properties().childs(),i=t.stopPrice.value(),r=t.targetPrice.value(),n=1/this.ownerSourceBase(),s=Math.min(i,r)+n,o=Math.max(i,r)-n;e.price=Math.max(s,Math.min(o,this._roundPrice(e.price))),super.setPoint(0,e),t.stopPrice.setValue(i),t.targetPrice.setValue(r)}}var b=i(853965);class T extends C{constructor(e,t,i,r){ super(e,null!=t?t:T.createProperties(),i,r)}name(){return"Risk/Reward short"}stopPrice(){return this.entryPrice()+this.properties().childs().stopLevel.value()/this.ownerSourceBase()}calculatePL(e){return this.entryPrice()-e}profitPrice(){return this.entryPrice()-this.properties().childs().profitLevel.value()/this.ownerSourceBase()}prepareStopPrice(e){e=this._roundPrice(e);const t=this.entryPrice()+1/this.ownerSourceBase();return Math.max(e,t)}prepareProfitPrice(e){e=this._roundPrice(e);const t=this.entryPrice()-1/this.ownerSourceBase();return Math.min(e,t)}static createProperties(e){const t=new b.DefaultProperty("linetoolriskrewardshort",e);return this._configureProperties(t),t}_amountTarget(e,t,i,r,n){return w(e+(i-t)*r*n)}_amountStop(e,t,i,r,n){return w(e-(t-i)*r*n)}_checkStopPrice(e){const t=this.stopPrice(),i=this.profitPrice();return(0,r.ensure)(e[2])>=t?this.stopPrice():(0,r.ensure)(e[3])<=i?this.profitPrice():null}_orderSide(){return-1}}class S extends C{constructor(e,t,i,r){super(e,null!=t?t:S.createProperties(),i,r)}name(){return"Risk/Reward long"}stopPrice(){return this.entryPrice()-this.properties().childs().stopLevel.value()/this.ownerSourceBase()}profitPrice(){return this.entryPrice()+this.properties().childs().profitLevel.value()/this.ownerSourceBase()}calculatePL(e){return e-this.entryPrice()}prepareStopPrice(e){e=this._roundPrice(e);const t=this.entryPrice()-1/this.ownerSourceBase();return Math.min(e,t)}prepareProfitPrice(e){e=this._roundPrice(e);const t=this.entryPrice()+1/this.ownerSourceBase();return Math.max(e,t)}static createProperties(e){const t=new b.DefaultProperty("linetoolriskrewardlong",e);return this._configureProperties(t),t}_amountTarget(e,t,i,r,n){return w(e+(t-i)*r*n)}_amountStop(e,t,i,r,n){return w(e-(i-t)*r*n)}_checkStopPrice(e){const t=this.stopPrice(),i=this.profitPrice();return(0,r.ensure)(e[3])<=t?this.stopPrice():(0,r.ensure)(e[2])>=i?this.profitPrice():null}_orderSide(){return 1}}},605703:(e,t,i)=>{"use strict";var r=i(86441).Point,n=i(204652).distanceToLine,s=i(821979).LineDataSource,o=i(853965).DefaultProperty,l=i(31712).LineToolColorsProperty;class a extends s{constructor(e,t,r,n){super(e,t||a.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.t.bind(i,642366,19)).then((({RotatedRectanglePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}startChanging(e,t){if(super.startChanging(e,t),0===e||1===e){var i=this._getPaneViews()[0],r=i._points[0],s=i._points[1],o=i._points[2];this._distance=n(r,s,o).distance}}setPoint(e,t,i){if(super.setPoint(e,t,i),0===e||1===e){var n=this._getPaneViews()[0];n.update();var s=n._points[0],o=n._points[1].subtract(s),l=new r(o.y,-o.x).normalized().scaled(this._distance),a=s.add(l),c=this.screenPointToPoint(a);this._points[2]=c}}endChanging(e,t){delete this._distance,super.endChanging(e,t)}pointsCount(){return 3}name(){return"Rotated Rectangle"}hasEditableCoordinates(){return!1}async _getPropertyDefinitionsViewModelClass(){ return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,967382))).GeneralFiguresDefinitionsViewModel}_snapTo45DegreesAvailable(){return!0}static createProperties(e){var t=new o("linetoolrotatedrectangle",e);return this._configureProperties(t),t}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new l([e.color]))}}t.LineToolRotatedRectangle=a},115137:(e,t,i)=>{"use strict";var r=i(517336).LevelsProperty,n=i(9093).LineToolPitchfork;class s extends n{constructor(e,t,i,r){super(e,t||s.createProperties(),i,r)}name(){return"Modified Schiff Pitchfork"}static createProperties(e){var t=new r("linetoolschiffpitchfork",e,!1,{range:[0,8]});return this._configureProperties(t),t}}t.LineToolSchiffPitchfork=s},126144:(e,t,i)=>{"use strict";var r=i(517336).LevelsProperty,n=i(9093).LineToolPitchfork;class s extends n{constructor(e,t,i,r){super(e,t||s.createProperties(),i,r)}name(){return"Schiff Pitchfork"}static createProperties(e){var t=new r("linetoolschiffpitchfork2",e,!1,{range:[0,8]});return this._configureProperties(t),t}}t.LineToolSchiffPitchfork2=s},697548:(e,t,i)=>{"use strict";i.d(t,{LineToolSignpost:()=>d});var r=i(444372),n=i(853965),s=i(821979),o=i(190973),l=i(585130),a=i(713599),c=i(31712),u=i(776954);class d extends u.LineToolWithRelativePriceCoordinate{constructor(e,t,r,n){super(e,null!=t?t:d.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,944581)).then((t=>{this._setPaneViews([new t.SignpostPaneView(this,e)])}))}pointsCount(){return 1}name(){return"Signpost"}customEvent(){return{index:()=>{var e,t;return null!==(t=null===(e=this.points()[0])||void 0===e?void 0:e.index)&&void 0!==t?t:null},position:()=>this.properties().childs().position.value()}}showInObjectTree(){return!this.isPhantom()&&super.showInObjectTree()}isPhantom(){return this._model.isPhantomLine(this)}clonePositionOffset(){return{barOffset:1,xCoordOffset:0,yCoordOffset:0}}template(){const e=super.template(),t=this.properties().childs();return e.text=t.text.value(),e.position=t.position.value(),e}shouldBeRemovedOnDeselect(){const e=this._properties.childs();if(e.showImage.value())return!1;return""===e.text.value().trim()}static createProperties(e){const t=new n.DefaultProperty("linetoolsignpost",e);return this._configureProperties(t),t.hasChild("text")||t.addChild("text",new o.default(r.t(null,void 0,i(37229)))),t.hasChild("position")||t.addChild("position",new o.default(50)),t.addExclusion("text"),t.addExclusion("position"),t.addChild("backgroundsColors",new c.LineToolColorsProperty([t.childs().plateColor])),t}_createPointProperty(e){super._createPointProperty(e);const t=this._pointsProperty.childs().points[e];t.removeProperty("price"),t.removeProperty("bar"),t.addChild("price",new l.SignpostPointPriceProperty(this)),t.addChild("bar",new a.SignpostPointIndexProperty(this,0))}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text), this.properties().childs().position.setValue(e.position)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,611989)).then((e=>e.SignpostDefinitionsViewModel))}static _configureProperties(e){s.LineDataSource._configureProperties(e)}}d.supportPhantomMode=!0},305480:(e,t,i)=>{"use strict";i.d(t,{LineToolSineLine:()=>s});var r=i(853965),n=i(821979);class s extends n.LineDataSource{constructor(e,t,r,n){super(e,t||s.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,435977)).then((e=>{this._setPaneViews([new e.SineLinePaneView(this,this._model)])}))}pointsCount(){return 2}name(){return"Sine Line"}static createProperties(e){const t=new r.DefaultProperty("linetoolsineline",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,925293))).CyclicAndSineLinesPatternDefinitionsViewModel}}},882626:(e,t,i)=>{"use strict";i.d(t,{LineToolSticker:()=>P});var r=i(885482),n=i(760184),s=i(201089),o=i(822914),l=i(852290),a=i(404720),c=i(808068),u=i(738232),d=i(923237);const h={intervalsVisibilities:{...c.intervalsVisibilitiesDefaults},size:110},p={sticker:"bitcoin",angle:.5*Math.PI},v=(0,u.extractAllPropertiesKeys)(h),_=(0,u.extractAllPropertiesKeys)(p),f=[...v,..._,...d.commonLineToolPropertiesStateKeys];class g extends a.LineDataSourceThemedProperty{constructor(e){super(e)}static create(e,t){return new this({defaultName:"linetoolsticker",defaultsSupplier:()=>(0,o.default)(h),nonThemedDefaultsKeys:v,themedDefaultsKeys:[],allStateKeys:f,state:(0,l.default)({},p,{sticker:t},null!=e?e:{})})}}const m=(0,s.getLogger)("Chart.LineToolSticker");class P extends n.LineToolSvgIconBase{constructor(e,t,i,r){super(e,t||P.createProperties(),i,r),this.version=1,this._loadViews()}name(){return"Sticker"}static createProperties(e){const t=g.create(e,r.stickerTool.value());return P._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,282375))).LineDataSourceDefinitionsViewModel}async _loadViews(){const[{getSvgContentForSticker:e,getSvgRenderer:t},{StickerPaneView:r},{svgRenderer:n}]=await Promise.all([i.e(25598).then(i.bind(i,40038)),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,434576)),i.e(72616).then(i.bind(i,500477))]);if(!this._isDestroyed){const i=this._properties.childs().sticker.value();this._svgContent=e(i),this._onIconChanged.fire();const s=t(n,i);null===s&&m.logWarn(`Couldn't create svg renderer for sticker ${i}`),this._setPaneViews([new r(this,this._model,s)])}}}},760184:(e,t,i)=>{"use strict";i.d(t,{LineToolSvgIconBase:()=>a});var r=i(650151),n=i(86441),s=i(625422),o=i(707957),l=i(821979);class a extends l.LineDataSource{constructor(e,t,i,r){super(e,t,i,r),this._onIconChanged=new o.Delegate,this._svgContent=null, this._changePointData=null,this._loadViews()}pointsCount(){return 1}hasEditableCoordinates(){return!1}getAnchorLimit(){return 80}getChangePointForSync(e){return null}startChanging(e,t){const i=(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),o=this.properties().childs(),l=o.size.value();let a;if(t)a=(0,r.ensureNotNull)(this.pointToScreenPoint(t));else{let e=new n.Point(0,Math.max(80,l)/2);const t=(0,s.rotationMatrix)(o.angle.value());e=(0,s.transformPoint)(t,e),a=i.add(e)}const c=i.subtract(a).length();this._changePointData={centerPoint:i,initialLength:c,initialSize:l},super.startChanging(e,t)}setPoint(e,t,i){const{centerPoint:n,initialLength:s,initialSize:o}=(0,r.ensureNotNull)(this._changePointData),l=(0,r.ensureNotNull)(this.pointToScreenPoint(t)),a=this.properties().childs();if(0===e||1===e){const t=l.subtract(n).normalized();let i=Math.acos(-t.x);Math.asin(t.y)>0&&(i=2*Math.PI-i),0===e&&(i+=Math.PI),a.angle.setValue(i)}else{const e=o*(n.subtract(l).length()/s);a.size.setValue(e)}}getSourceIcon(){const e=this.svgContent();return null===e?null:{type:"svgContent",content:e}}onSourceIconChanged(){return this._onIconChanged}svgContent(){return this._svgContent}static _configureProperties(e){super._configureProperties(e),e.addExclusion("angle")}}},520259:(e,t,i)=>{"use strict";i.d(t,{LineToolText:()=>p,LineToolTextAbsolute:()=>v});var r=i(650151),n=i(86441),s=i(790188),o=i(190973),l=i(853965),a=i(31712),c=i(964824),u=i(138886);const d={selectionColor:(0,s.getHexColorByName)("color-tv-blue-500"),cursorColor:(0,s.getHexColorByName)("color-black")},h={selectionColor:(0,s.getHexColorByName)("color-white"),cursorColor:(0,s.getHexColorByName)("color-white")};class p extends u.InplaceTextLineDataSource{constructor(e,t,r,n){const s=t||p.createProperties();super(e,s,r,n),this._barSpacing=e.timeScale().barSpacing(),this._recalculatePointsOnCenter=!1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,998074)).then((({TextPaneView:t})=>{const i=this._recalculatePointsOnCenter?(e,t)=>{this._recalculatePointsOnCenter&&this._recalculateCenterPosition(e,t)}:void 0;this._setPaneViews([new t(this,e,void 0,void 0,void 0,void 0,void 0,i,this._openTextEditor.bind(this),this._closeTextEditor.bind(this),this.onSelectionChange.bind(this))])}))}centerPosition(){this._recalculatePointsOnCenter=!0}setPoint(e,t,i){const n=this.properties().childs();let s;if(1===e&&n.wordWrapWidth.value()){const e=this.model().timeScale();s=this.isFixed()?(0,r.ensureDefined)(this.fixedPoint()).x:e.indexToCoordinate(this.points()[0].index);const i=e.indexToCoordinate(t.index)-s-~~(n.fontsize.value()/6);if(!isFinite(i))return;n.wordWrapWidth.setValue(Math.max(100,i))}}pointsCount(){return 1}name(){return"Text"}getStyle(){return this._model.dark().value()?h:d}setPriceScale(e){super.setPriceScale(e),e&&e.priceRange()&&(this._priceDencity=e.height()/(0,r.ensureNotNull)(e.priceRange()).length(),this._isPriceDencityLog=e.isLog())}restoreSize(){const e=(0,r.ensureNotNull)(this.priceScale()) ;this._barSpacing=this.model().timeScale().barSpacing(),this._priceDencity=e.height()/(0,r.ensureNotNull)(e.priceRange()).length(),this.updateAllViewsAndRedraw((0,c.sourceChangeEvent)(this.id()))}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}state(e){const t=super.state(e);return e&&(t.state.fixedSize=!1),t}barSpacing(){return this._barSpacing}priceDencity(){return this._priceDencity}isPriceDencityLog(){return this._isPriceDencityLog}hasEditableCoordinates(){return!1}shouldBeRemovedOnDeselect(){return""===this._properties.childs().text.value().trim()}static createProperties(e){const t=new l.DefaultProperty("linetooltext",e);return this._configureProperties(t),t}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text)}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,941117)).then((e=>e.TextDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.default("")),e.addChild("linesColors",new a.LineToolColorsProperty([e.childs().borderColor])),e.addChild("textsColors",new a.LineToolColorsProperty([e.childs().color])),e.addExclusion("text"),e.addExclusion("linesColors"),e.addExclusion("textsColors")}_recalculateCenterPosition(e,t){const i=this.isFixed()?(0,r.ensureDefined)(this.fixedPoint()):(0,r.ensureNotNull)(this.pointToScreenPoint(this._points[0])),s=new n.Point(i.x-e/2,i.y-t/2),o=(0,r.ensureNotNull)(this.screenPointToPoint(s));this.setPoints([o]),this.normalizePoints(),this.createServerPoints(),this.updateAllViewsAndRedraw((0,c.sourceChangeEvent)(this.id()))}}class v extends p{constructor(e,t){super(e,t||v.createProperties())}name(){return"Anchored Text"}hasEditableCoordinates(){return!1}isFixed(){return!0}static createProperties(e){const t=new l.DefaultProperty("linetooltextabsolute",e);return this._configureProperties(t),t}}},521600:(e,t,i)=>{"use strict";i.d(t,{LineToolThreeDrivers:()=>o});var r=i(853965),n=i(821979),s=i(31712);class o extends n.LineDataSource{constructor(e,t,r,n){const s=t||o.createProperties();super(e,s,r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,927913)).then((t=>{this._setPaneViews([new t.LineToolThreeDrivesPaneView(this,e)])}))}pointsCount(){return 7}name(){return"Three Drives Pattern"}static createProperties(e){const t=new r.DefaultProperty("linetoolthreedrivers",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,669403)).then((e=>e.PatternWithoutBackgroundDefinitionsViewModel))}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new s.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new s.LineToolColorsProperty([e.childs().textcolor])),e.addChild("linesWidths",new s.LineToolWidthsProperty([e.childs().linewidth])), e.hasChild("backgroundsColors")&&e.removeProperty("backgroundsColors")}}},36459:(e,t,i)=>{"use strict";i.d(t,{LineToolTimeCycles:()=>o});var r=i(822914),n=i(853965),s=i(821979);class o extends s.LineDataSource{constructor(e,t,r,n){super(e,null!=t?t:o.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,764389)).then((e=>{this._setPaneViews([new e.TimeCyclesPaneView(this,this._model)])}))}pointsCount(){return 2}name(){return"Time Cycles"}setPoint(e,t){const i=(0,r.default)(t),n=this._points[0],s=this._points[1];n.price=i.price,s.price=i.price,this._points[e]=i,this.normalizePoints()}addPoint(e,t,i){const r=super.addPoint(e,t,!0);if(r){const e=this._points[0];this._points[1].price=e.price,i||(this.normalizePoints(),this.createServerPoints())}return r}static createProperties(e){const t=new n.DefaultProperty("linetooltimecycles",e);return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,73900))).TimeCyclesPatternDefinitionsViewModel}}},167723:(e,t,i)=>{"use strict";i.d(t,{LineToolTrendAngle:()=>u});var r=i(86441),n=i(650151),s=i(853965),o=i(821979),l=i(190973),a=i(964824);class c extends l.default{constructor(e){super(),this._lineSource=e}value(){return Math.round(180*this._lineSource.angle()/Math.PI)}setValue(e){const t=e*Math.PI/180,i=(0,n.ensureNotNull)(this._lineSource.pointToScreenPoint(this._lineSource.points()[0])),s=Math.cos(t),o=-Math.sin(t),l=new r.Point(s,o),c=i.addScaled(l,this._lineSource.distance()),u=(0,n.ensureNotNull)(this._lineSource.screenPointToPoint(c));this._lineSource.setPoint(1,u);const d=this._lineSource.model();d.updateSource(this._lineSource),this._lineSource.updateAllViews((0,a.sourceChangeEvent)(this._lineSource.id())),d.updateSource(this._lineSource)}notifyChanged(){this._listeners.fire(this,"")}}class u extends o.LineDataSource{constructor(e,t,r,n){const s=t||u.createProperties();super(e,s,r,n),this._angle=0,this._distance=0,s.addChild("angle",new c(this)),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,528123)).then((({TrendAnglePaneView:t})=>{const i=[new t(this,e)];this._setPaneViews(i)}))}isSynchronizable(){return!1}pointsCount(){return 2}name(){return"Trend Angle"}angle(){return this._angle}distance(){return this._distance}addPoint(e,t){const i=super.addPoint(e,t);return i&&this._calculateAngle(),i}setLastPoint(e,t){const i=super.setLastPoint(e,t);return this.points().length>1&&this._calculateAngle(),i}axisPoints(){if(this.points().length<2)return[];const e=[this.points()[0]],t=(0,n.ensureNotNull)(this.pointToScreenPoint(this.points()[0])),i=Math.cos(this._angle)*this._distance,s=-Math.sin(this._angle)*this._distance,o=t.add(new r.Point(i,s)),l=(0,n.ensureNotNull)(this.screenPointToPoint(o));return e.push(l),e}timeAxisPoints(){return this.axisPoints()}priceAxisPoints(){return this.axisPoints()}setPoint(e,t,i){super.setPoint(e,t,i), this.points().length>1&&1===e&&this._calculateAngle()}restoreData(e){var t,i;this._angle=null!==(t=e.angle)&&void 0!==t?t:0,this._distance=null!==(i=e.distance)&&void 0!==i?i:0}state(e){const t=super.state(e);return t.angle=this._angle,t.distance=this._distance,t}cloneData(e){this._angle=e.angle(),this._distance=e.distance()}canHasAlert(){return!0}static createProperties(e){e&&void 0===e.showPercentPriceRange&&(e.showPercentPriceRange=e.showPriceRange,e.showPipsPriceRange=e.showPriceRange);const t=new s.DefaultProperty("linetooltrendangle",e);return this._configureProperties(t),t}_snapTo45DegreesAvailable(){return!0}_getAlertPlots(){const e=this._linePointsToAlertPlot(this._points,null,this._properties.childs().extendLeft.value(),this._properties.childs().extendRight.value());return null===e?[]:[e]}_calculateAngle(){const e=(0,n.ensureNotNull)(this.pointToScreenPoint(this.points()[0]));let t=(0,n.ensureNotNull)(this.pointToScreenPoint(this.points()[1])).subtract(e);const i=t.length();i>0?(t=t.normalized(),this._angle=Math.acos(t.x),t.y>0&&(this._angle=-this._angle),this._distance=i):this._angle=0;this.properties().childs().angle.notifyChanged()}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,476535)).then((e=>e.TrendAngleDefinitionsViewModel))}}},882980:(e,t,i)=>{"use strict";i.d(t,{LineToolTrendBasedFibExtension:()=>c});var r=i(444372),n=i(809796),s=i(517336),o=i(31712),l=i(821979);const a=new n.TranslatedString("erase level line",r.t(null,void 0,i(812962)));class c extends l.LineDataSource{constructor(e,t,r,n){super(e,t||c.createProperties(),r,n),this.version=2,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,242128)).then((({TrendBasedFibExtensionPaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return 24}pointsCount(){return 3}name(){return"Trend-Based Fib Extension"}migrateVersion(e,t){1===e&&this.properties().childs().extendLines.setValue(!0)}processErase(e,t){const i="level"+t,r=this.properties().childs()[i].childs().visible;e.setProperty(r,!1,a)}fibLevelsBasedOnLogScale(){var e;return this.properties().childs().fibLevelsBasedOnLogScale.value()&&Boolean(null===(e=this.priceScale())||void 0===e?void 0:e.isLog())}static createProperties(e){const t=new s.LevelsProperty("linetooltrendbasedfibextension",e,!1,{range:[0,8]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,866406))).FibDrawingsWith24LevelsDefinitionsViewModel}static _configureProperties(e){const t=e.childs();super._configureProperties(e);const i=[t.trendline.childs().color];for(let e=1;e<=24;e++){const r=t["level"+e].childs().color;i.push(r)}e.addChild("linesColors",new o.LineToolColorsProperty(i));const r=[t.trendline.childs().linewidth,t.levelsStyle.childs().linewidth];e.addChild("linesWidths",new o.LineToolWidthsProperty(r))}}},418219:(e,t,i)=>{"use strict";i.d(t,{ LineToolTrendBasedFibTime:()=>c});var r=i(444372),n=i(809796),s=i(821979),o=i(517336),l=i(31712);const a=new n.TranslatedString("erase level line",r.t(null,void 0,i(812962)));class c extends s.LineDataSource{constructor(e,t,r,n){super(e,t||c.createProperties(),r,n),this.version=1,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,61304)).then((({TrendBasedFibTimePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}levelsCount(){return 11}pointsCount(){return 3}name(){return"Trend-Based Fib Time"}processErase(e,t){const i="level"+t,r=this.properties().childs()[i].childs().visible;e.setProperty(r,!1,a)}static createProperties(e){const t=new o.LevelsProperty("linetooltrendbasedfibtime",e,!1,{range:[1,11]});return this._configureProperties(t),t}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,663394))).TrendBasedFibTimeDefinitionsViewModel}static _configureProperties(e){super._configureProperties(e);const t=e.childs(),i=[t.trendline.childs().linewidth],r=[t.trendline.childs().color];for(let e=1;e<=11;e++)i.push(t["level"+e].childs().linewidth),r.push(t["level"+e].childs().color);e.addChild("linesColors",new l.LineToolColorsProperty(r)),e.addChild("linesWidths",new l.LineToolWidthsProperty(i))}}},956268:(e,t,i)=>{"use strict";i.d(t,{LineToolTrendLine:()=>l});var r=i(853965),n=i(821979),s=i(837202),o=i(190973);class l extends n.LineDataSource{constructor(e,t,r,n){super(e,t||l.createProperties(),r,n),this._trendLinePaneView=null,Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,982446)).then((({TrendLinePaneView:e})=>{this._trendLinePaneView=new e(this,this._model),this._setPaneViews([this._trendLinePaneView])}))}dataAndViewsReady(){return super.dataAndViewsReady()&&null!==this._trendLinePaneView&&this._trendLinePaneView.iconsReady()}pointsCount(){return 2}name(){return"Trend Line"}canHasAlert(){return!0}showPriceLabels(){return this._properties.childs().showPriceLabels.value()}createPriceAxisView(e){return new s.LineToolPriceAxisView(this,{pointIndex:e,backgroundPropertyGetter:()=>this.showPriceLabels()?this._properties.childs().linecolor.value():null})}isForcedDrawPriceAxisLabel(){return this.showPriceLabels()}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}static createProperties(e,t){return l._createPropertiesImpl("linetooltrendline",e,t)}_getAlertPlots(){const e=this._linePointsToAlertPlot(this._points,null,this._properties.childs().extendLeft.value(),this._properties.childs().extendRight.value());return null===e?[]:[e]}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,167738))).TrendLineDefinitionsViewModel}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}_snapTo45DegreesAvailable(){return!0}static _createPropertiesImpl(e,t,i){ t&&void 0===t.showPercentPriceRange&&(t.showPercentPriceRange=t.showPriceRange,t.showPipsPriceRange=t.showPriceRange);const n=new r.DefaultProperty(e,t,void 0,i);return this._configureProperties(n),n}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.default("")),e.addExclusion("text")}}},948653:(e,t,i)=>{"use strict";i.d(t,{LineToolTrianglePattern:()=>o});var r=i(853965),n=i(821979),s=i(31712);class o extends n.LineDataSource{constructor(e,t,r,n){const s=t||o.createProperties();super(e,s,r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,658539)).then((t=>{this._setPaneViews([new t.LineToolTrianglePatternPaneView(this,e)])}))}pointsCount(){return 4}name(){return"Triangle Pattern"}static createProperties(e){const t=new r.DefaultProperty("linetooltrianglepattern",e);return this._configureProperties(t),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,63124)).then((e=>e.PatternWithBackgroundDefinitionViewModel))}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new s.LineToolColorsProperty([e.childs().color])),e.addChild("textsColors",new s.LineToolColorsProperty([e.childs().textcolor])),e.addChild("backgroundsColors",new s.LineToolColorsProperty([e.childs().backgroundColor]))}}},287743:(e,t,i)=>{"use strict";var r=i(821979).LineDataSource,n=i(853965).DefaultProperty,s=i(31712).LineToolColorsProperty;class o extends r{constructor(e,t,r,n){super(e,t||o.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.t.bind(i,560001,19)).then((({TrianglePaneView:e})=>{this._setPaneViews([new e(this,this._model)])}))}pointsCount(){return 3}name(){return"Triangle"}async _getPropertyDefinitionsViewModelClass(){return(await Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,967382))).GeneralFiguresDefinitionsViewModel}static createProperties(e){var t=new n("linetooltriangle",e);return this._configureProperties(t),t}static _configureProperties(e){super._configureProperties(e),e.addChild("linesColors",new s([e.childs().color]))}}t.LineToolTriangle=o},972375:(e,t,i)=>{"use strict";i.d(t,{createTweetLineToolByUrl:()=>d,isTwitterProfileImageUrl:()=>u,isTwitterUrl:()=>c});var r=i(650151),n=i(62802),s=i(541558),o=i(461794),l=i(14802);const a=(0,i(125226).isFeatureEnabled)("mock_tweet_data_for_tests");function c(e){try{const t=new URL(e);return("twitter.com"===t.hostname||t.hostname.endsWith(".twitter.com")||"x.com"===t.hostname||t.hostname.endsWith(".x.com"))&&"https:"===t.protocol}catch(e){return!1}}function u(e){try{const t=new URL(e);return"pbs.twimg.com"===t.hostname&&"https:"===t.protocol&&t.pathname.startsWith("/profile_images/")}catch(e){return!1}}function d(e,t,i=!1){return async function(e){if(a)return{id:0x853cb08cfe8b,created_at:1638107940,text:"𝓭𝓪𝓲𝓵𝔂 𝓻𝓮𝓶𝓲𝓷𝓭𝓮𝓻\r\rAlways do your own research.", username:"tradingview",user:"TradingView",profile_image_url:"https://pbs.twimg.com/profile_images/1598328471729704963/D7slFVZN_400x400.jpg",tweet_url:"https://twitter.com/tradingview/status/1464957065621872641?s=20"};const t=new URL("/api/v1/get-tweet-data/",location.href);return t.searchParams.append("tweet_url",e),fetch(t.toString()).then((e=>{if(!e.ok)throw new Error(`Error processing tweet: ${e.statusText}`);return e.json()}))}(e).then((a=>{const c=function(e,t){var i;return{id:e.id,createdAt:e.created_at,text:(0,o.clean)(e.text,!0),username:`@${e.username}`,user:e.user,profileImageUrl:e.profile_image_url,tweetUrl:null!==(i=e.tweet_url)&&void 0!==i?i:t}}(a,e),u={price:0,time_t:c.createdAt,offset:0},d=t.mainSeries(),h=(0,r.ensureNotNull)(t.model().paneForSource(d)),p=h.newLineToolZOrder(!0),v={type:"drawing",source:{id:(0,s.randomHashN)(6),zorder:p,type:"LineToolTweet",position:50,state:{interval:"1",...l.LineToolTweet.createProperties().state()},tweetData:c,symbol:d.symbol(),ownerSource:d.id(),points:[u]},geometry:[],modelId:t.model().id()},_=t.pasteLineTool(h,v,!0,!0);return i&&n.setValue("hint.pasteTweet",!0,{forceFlush:!0}),_.pointAdded().subscribe(null,(()=>t.scrollToLineTool(_)),!0),_}))}},14802:(e,t,i)=>{"use strict";i.d(t,{LineToolTweet:()=>c});var r=i(853965),n=i(799609),s=i(190973),o=i(70726),l=i(972375);class a extends o.CustomEventItem{constructor(e,t){super(t),this._data=e}tweetData(){return this._data}index(){return this._source.eventTimePointIndex()}time(){return this._data.createdAt}avatar(){return this._data.profileImageUrl}}class c extends o.LineToolCustomUrlEvent{constructor(e,t,r,n){super(e,t||c.createProperties(),r,n),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,123896)).then((t=>{this._setPaneViews([new t.TweetPaneView(this,e)])}))}name(){return"Tweet"}state(e){const t=super.state(e);return this._item&&(t.tweetData=this._item.tweetData()),e&&(t.eventTimePointIndex=this._eventTimePointIndex),t}restoreData(e){if(e.tweetData){if(!(0,l.isTwitterUrl)(e.tweetData.tweetUrl))throw new Error(`Invalid url for tweet line tool: ${e.tweetData.tweetUrl}`);this._item=new a(e.tweetData,this)}void 0!==e.eventTimePointIndex&&(this._eventTimePointIndex=e.eventTimePointIndex)}static createProperties(e){const t=new r.DefaultProperty("linetoolTweet",e);return this._configureProperties(t),t.hasChild("position")||t.addChild("position",new s.default(50)),t.addExclusion("position"),t}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,427491)).then((e=>e.TweetDefinitionsViewModel))}}(0,n.watchingDrawingStateForAddTweetLineTool)()},421644:(e,t,i)=>{"use strict";i.d(t,{LineToolVertLineTimeAxisView:()=>n});var r=i(902214);class n extends r.LineDataSourceTimeAxisView{constructor(e){super(e,0)}_getBgColor(){return this._source.properties().linecolor.value()}_getAlwaysInViewPort(){return!1}_getIndex(){const e=this._source.points();return 0===e.length?null:e[0].index}}},43653:(e,t,i)=>{"use strict" ;i.d(t,{LineToolVertLine:()=>c});var r=i(650151),n=i(86441),s=i(853965),o=i(190973),l=i(821979),a=i(421644);class c extends l.LineDataSource{constructor(e,t,r,n){const s=t||c.createProperties();super(e,s,r,n),this._timeAxisView=new a.LineToolVertLineTimeAxisView(this),this._paneViewFactory=null,this.properties().childs().extendLine.subscribe(this,(()=>e.lightUpdate())),Promise.all([i.e(88548),i.e(6744),i.e(42244),i.e(63240),i.e(77028),i.e(51583)]).then(i.bind(i,590810)).then((t=>{this._paneViewFactory=i=>new t.VertLinePaneView(this,e,i),this._model.lightUpdate()}))}destroy(){this.properties().childs().extendLine.unsubscribeAll(this),super.destroy()}pointsCount(){return 1}name(){return"Vertical Line"}timeAxisViews(){return this.isSourceHidden()?null:this.properties().childs().showTime.value()?[this._timeAxisView]:null}updateAllViews(e){super.updateAllViews(e),this._timeAxisView.update(e)}canHasAlert(){return!0}template(){const e=super.template();return e.text=this.properties().childs().text.value(),e}isMultiPaneAvailable(){return!0}isMultiPaneEnabled(){return this.properties().childs().extendLine.value()}paneViews(e){return e=(0,r.ensureDefined)(e),this.isMultiPaneEnabled()||this._model.paneForSource(this)===e?(null===this._getPaneViews(e)&&null!==this._paneViewFactory&&this._setPaneViews([this._paneViewFactory(e)],e,!0),super.paneViews(e)):null}priceAxisViews(){return null}priceAxisPoints(){return[]}pointToScreenPoint(e){const t=this._model.timeScale();if(t.isEmpty())return null;const i=t.indexToCoordinate(e.index);return new n.Point(i,0)}convertYCoordinateToPriceForMoving(e){return 0}static createProperties(e){null!=e&&(void 0===e.textOrientation&&(e.textOrientation="horizontal"),void 0===e.extendLine&&(e.extendLine=!1));const t=new s.DefaultProperty("linetoolvertline",e);return this._configureProperties(t),t}_getAlertPlots(){const e=this._points[0],t={index:e.index,price:e.price+1},i=this._linePointsToAlertPlot([e,t],null,!0,!0);return null===i?[]:[i]}_getPropertyDefinitionsViewModelClass(){return Promise.all([i.e(96461),i.e(82790),i.e(30154),i.e(82375),i.e(18537)]).then(i.bind(i,480262)).then((e=>e.VerticalLineDefinitionsViewModel))}_applyTemplateImpl(e){super._applyTemplateImpl(e),this.properties().childs().text.setValue(e.text||"")}static _configureProperties(e){super._configureProperties(e),e.hasChild("text")||e.addChild("text",new o.default("")),e.addExclusion("text")}}},9640:(e,t,i)=>{"use strict";i.d(t,{coordinateIsValid:()=>f,extendAndClipLineSegment:()=>u,fillScaledRadius:()=>m,getArrowPoints:()=>d,interactionTolerance:()=>_,optimalBarWidth:()=>h,optimalCandlestickWidth:()=>p,optimalHiLoWidth:()=>v,setValidLineStyle:()=>g,strokeScaledRadius:()=>P});var r=i(86441),n=i(5531),s=i(86121),o=i(389137),l=i(787123);const a={common:13,line:13,minDistanceBetweenPoints:10,series:14,curve:10,anchor:13,esd:4},c={common:3,line:3,minDistanceBetweenPoints:5,series:2,curve:3,anchor:2,esd:0};function u(e,t,i,s,o,l){if((0,r.equalPoints)(e,t))return null;const a=new r.Point(0,0),c=new r.Point(i,s);if(o){if(l){const i=(0, n.intersectLineAndBox)((0,r.lineThroughPoints)(e,t),(0,r.box)(a,c));return Array.isArray(i)?i:null}{const i=(0,n.intersectRayAndBox)(t,e,(0,r.box)(a,c));return null===i||(0,r.equalPoints)(t,i)?null:(0,r.lineSegment)(t,i)}}if(l){const i=(0,n.intersectRayAndBox)(e,t,(0,r.box)(a,c));return null===i||(0,r.equalPoints)(e,i)?null:(0,r.lineSegment)(e,i)}{const i=(0,n.intersectLineSegmentAndBox)((0,r.lineSegment)(e,t),(0,r.box)(a,c));return Array.isArray(i)?i:null}}function d(e,t,i,r,n){const s=.5*i,o=Math.sqrt(2),l=t.subtract(e),a=l.normalized();let c=5*i;r&&(c=Math.min(c,.35*l.length()));const u=1*s;if(c*o*.2<=u)return[];const d=a.scaled(c),h=t.subtract(d),p=a.transposed(),v=1*c,_=p.scaled(v),f=h.add(_),g=h.subtract(_),m=f.subtract(t).normalized().scaled(u),P=g.subtract(t).normalized().scaled(u),y=n?t:t.add(m),w=n?t:t.add(P),C=s*(o-1),b=p.scaled(C),T=Math.min(c-1*s/o,s*o*1),S=a.scaled(T),x=t.subtract(b),A=t.add(b),L=t.subtract(S);return[[f,y],[w,g],[x,L.subtract(b)],[A,L.add(b)]]}function h(e,t){return t=t||1,Math.floor(.3*e*t)}function p(e,t){if(e>=2.5&&e<=4)return Math.floor(3*t);const i=1-.2*Math.atan(Math.max(4,e)-4)/(.5*Math.PI),r=Math.floor(e*i*t),n=Math.floor(e*t),s=Math.min(r,n);return Math.max(Math.floor(t),s)}function v(e){return.4*e}function _(){return(0,s.lastMouseOrTouchEventInfo)().isTouch?a:c}function f(e){return null!=e&&!(0,o.isNaN)(e)}function g(e,t){void 0!==t&&(0,l.setLineStyle)(e,t)}function m(e,t){const i=Math.max(1,Math.floor(t))%2?.5:0;return Math.round(e*t)+i}function P(e,t,i){const r=Math.max(1,Math.floor(t))%2?.5:0;return Math.round(e*t)+(r!==i%2?.5:0)}},915179:(e,t,i)=>{"use strict";i.d(t,{barSpacingByScaleRatio:()=>o,priceRangeByScaleRatio:()=>s,scaleRatio:()=>n});var r=i(291784);function n(e,t){if(t.isLog()||e.isEmpty()||t.isEmpty())return null;const i=function(e){if(e.isEmpty())return null;const t=e.priceRange();if(null===t)return null;const i=t.length();return e.internalHeight()/i}(t);if(null===i)return null;return e.getValidBarSpacing()/Math.max(1e-10,i)}function s(e,t,i){if(e.isLog()||null===i||e.isEmpty())return null;const n=e.priceRange();if(null===n||n.isEmpty())return null;const s=e.internalHeight()/(t/i),o=n.length();if(s===o)return n;const l=(s-o)/2;return new r.PriceRange(n.minValue()-l,n.maxValue()+l)}function o(e,t){if(e.isLog()||null===t||e.isEmpty())return null;const i=e.priceRange();if(null===i)return null;const r=i.length();return e.internalHeight()/r*t}},953725:(e,t,i)=>{"use strict";i.d(t,{getAlertsActionCreators:()=>n});var r=i(895171);const n=(0,r.default)((async()=>new((await Promise.all([i.e(40113),i.e(88104),i.e(31383),i.e(18960),i.e(49502)]).then(i.bind(i,388805))).AlertsActionCreators)));(0,r.default)((async()=>new((await Promise.all([i.e(40113),i.e(88104),i.e(31383),i.e(18960),i.e(68074)]).then(i.bind(i,880190))).FiresActionCreators)))},591427:(e,t,i)=>{"use strict";i.d(t,{getAlertDescription:()=>s});var r=i(919892),n=i(126290);function s(e){return function(e){return"function"==typeof e.name?e.name():e.name}(e)||function(e){ return"description"in e?e.description():e.message}(e)||function(e){const t="function"==typeof e.symbol?(0,r.decodeExtendedSymbol)(e.symbol()):e.symbol,i="function"==typeof e.resolution?e.resolution():e.resolution,s="function"==typeof e.crossInterval?e.crossInterval():e.crossInterval;return(0,n.formatSymbolAndResolution)({symbol:t,resolution:i,crossInterval:s})}(e)}},694839:(e,t,i)=>{"use strict";i.d(t,{getAlertConfig:()=>c});var r=i(895171),n=i(650151),s=i(125226),o=i(588948),l=(i(659863),i(244842));const a={from:3e4,to:18e5},c=(0,r.default)((()=>({priceAlertsFacadeClientUrl:u(),fetchTokenMaxRetriesCount:1,restRequestsMaxRetriesCount:1,permissionProxyEnabled:(0,s.isFeatureEnabled)("alerts-facade-use-permission-proxy"),autoUnsetMaintenanceTimeout:(0,s.isFeatureEnabled)("alerts-maintenance-auto-unset")?a:null,maxAlertExpiration:{type:"days",count:60},defaultAlertExpiration:{type:"months",count:1}})));function u(){return l.enabled("alerts")?(0,n.ensureDefined)((0,o.getFreshInitData)().priceAlertsFacadeClientUrl):""}},949307:(e,t,i)=>{"use strict";i.d(t,{getPriceAlertsDispatcher:()=>n});i(659863);let r=null;function n(){return new Promise((e=>{null===r?Promise.all([i.e(32327),i.e(36876),i.e(69030),i.e(25977),i.e(24951),i.e(68647),i.e(42292),i.e(94949),i.e(42700),i.e(81274),i.e(54253),i.e(61865),i.e(86922),i.e(48158)]).then(i.bind(i,998213)).then((t=>{null===r&&(r=new t.AlertsDispatcher),e(r)})):e(r)}))}},781310:(e,t,i)=>{"use strict";i.d(t,{canPlaceAlertOnResolution:()=>n.canPlaceAlertOnResolution,isAlertResolutionEqual:()=>s});var r=i(223699),n=i(695242);function s(e,t){return e.get("crossInterval")||r.Interval.isEqual(e.get("resolution"),t)}},594949:(e,t,i)=>{"use strict";i.d(t,{getAlertSession:()=>r.getAlertSession,getAlertsTrackers:()=>n.getAlertsTrackers});var r=i(759646),n=i(206242)},759646:(e,t,i)=>{"use strict";i.r(t),i.d(t,{getAlertSession:()=>A});var r=i(895171),n=i(314802),s=(i(659863),i(401580)),o=i(799402);const l=(0,r.default)((()=>new o.AuthToken));var a=i(833813),c=i(778016),u=i(526225),d=i(62802),h=i.n(d),p=i(707957),v=i(199472),_=i(266325);function f(){var e;const t=(0,c.getConfig)(a.ProductFeatures.SERVER_SIDE_ALERTS);return null!==(e=null==t?void 0:t.overall_limit)&&void 0!==e?e:2e3}function g(){var e,t;const i=(0,c.getConfig)(a.ProductFeatures.SERVER_SIDE_ALERTS);return{primitive:null!==(e=null==i?void 0:i.primitive_limit)&&void 0!==e?e:0,complex:null!==(t=null==i?void 0:i.complex_limit)&&void 0!==t?t:0}}var m=i(201089),P=i(694839);const y=(0,m.getLogger)("Alerts.Session.TokenInfo"),w=Date.now();async function C(e){const t=l();e&&t.reset();const i=await b(t),r=Date.now();return{token:i,managerImplementation:1,metadata:{moduleLoadingTimestamp:w,tokenGettingTimestamp:r,isTokenForceReset:Boolean(e),isTokenInitial:i===window.user.auth_token}}}async function b(e,t=0){const i=await e.get();return function(e){const t=JSON.parse(atob(e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")));return Date.now()+3e5>1e3*t.exp}(i)&&t<(0, P.getAlertConfig)().fetchTokenMaxRetriesCount?(y.logWarn("Received token is expired, retrying with a token refresh"),e.reset(),b(e,t+1)):i}class T{constructor(){this._abortController=new AbortController,this._twoFactorState=new s.WatchedValue(!1),this._twoFactorApiModulePromise=i.e(76047).then(i.bind(i,446152)),this._syncPromise=this._sync()}value(){return this._twoFactorState.value()}async sync(e=!1){var t;return e&&(null===(t=this._abortController)||void 0===t||t.abort(),this._abortController=new AbortController,this._syncPromise=this._sync()),this._syncPromise}destroy(){var e;null===(e=this._abortController)||void 0===e||e.abort()}async _sync(){try{const{getTwoFactorStatus:e}=await this._twoFactorApiModulePromise,t=await Promise.race([(0,_.delay)(this._abortController.signal,5e3).then((()=>!0)),(0,_.respectAbort)(this._abortController.signal,e())]);this._twoFactorState.setValue(t)}catch(e){(0,_.isAbortError)(e)||this._twoFactorState.setValue(!0)}}}function S(){if(!window.is_authenticated||!window.user.id)return null;const e=new AbortController,t=new p.Delegate;return(0,v.subscriptionNotification)().on(v.SubscriptionEventType.Subscribe,i),(0,v.subscriptionNotification)().on(v.SubscriptionEventType.Unsubscribe,i),(0,v.subscriptionNotification)().on(v.SubscriptionEventType.Upgrade,i),(0,v.subscriptionNotification)().on(v.SubscriptionEventType.Downgrade,i),{id:window.user.id,username:window.user.username,settings:h(),twoFactorTracker:new T,hasActiveEmail:()=>Boolean(window.user.has_active_email),getSmsEmail:()=>window.user.sms_email,getFeatures:x,getTokenInfo:C,onSubscriptionChanged:t,destroy:function(){(0,v.subscriptionNotification)().off(i),e.abort()}};async function i(){try{await(0,_.respectAbort)(e.signal,(0,u.syncUserData)("price-alerts"))}catch(e){(0,_.skipAbortError)(e)}t.fire()}}function x(){return{overallLimit:f(),activeLimits:g(),alertsWithWebhook:(0,c.enabled)(a.ProductFeatures.ALERTS_WEBHOOK),alertsNoExpiration:(0,c.enabled)(a.ProductFeatures.ALERTS_NO_EXPIRATION),alertsOnSeconds:(0,c.enabled)(a.ProductFeatures.ALERTS_ON_SECONDS)}}const A=(0,r.default)((()=>{const e=new s.WatchedValue(S()),t=l();window.loginStateChange.subscribe(null,(()=>{const i=e.value();null==i||i.destroy();const r=S();r&&t.reset(),e.setValue(r)}));const i=(0,n.isOnMobileAppPage)("any");return{user:e,isOnMobileApp:i}}))},206242:(e,t,i)=>{"use strict";i.r(t),i.d(t,{getAlertsTrackers:()=>c});var r=i(895171),n=i(359663),s=(i(659863),i(694839)),o=i(401580);class l{constructor(e,t){this._unsetMaintenanceTimeoutId=null,this._onAliveMaintenanceChange=e=>{if(e)this._clearMaintenanceUnsetTimeout(),this._lastMaintenanceUnsetReason=null,this._state.setValue(!0);else if(this._config.autoUnsetMaintenanceTimeout){const e=this._config.autoUnsetMaintenanceTimeout;this._unsetMaintenanceTimeoutId=setTimeout((()=>this._syncMaintenanceState("timeout")),(t=e.from,i=e.to,Math.floor(Math.sqrt(Math.random())*(i-t)+t)))}var t,i},this._maintenanceValue=e,this._config=t,this._state=new o.WatchedValue(this._maintenanceValue.value()), this._lastMaintenanceUnsetReason=this._state.value()?null:"initial_operated",this._maintenanceValue.subscribe(this._onAliveMaintenanceChange)}destroy(){this._clearMaintenanceUnsetTimeout(),this._maintenanceValue.unsubscribe(this._onAliveMaintenanceChange)}value(){return this._state.value()}syncOnUserAction(){this._syncMaintenanceState("user_action")}subscribe(e){this._state.subscribe(e)}unsubscribe(e){this._state.unsubscribe(e)}lastMaintenanceUnsetReason(){return this._lastMaintenanceUnsetReason}_syncMaintenanceState(e){this._clearMaintenanceUnsetTimeout();const t=this._state.value(),i=this._maintenanceValue.value();t!==i&&(this._lastMaintenanceUnsetReason=i?null:"user_action"===e?"user_action":"auto_unset",this._state.setValue(i))}_clearMaintenanceUnsetTimeout(){this._unsetMaintenanceTimeoutId&&(clearTimeout(this._unsetMaintenanceTimeoutId),this._unsetMaintenanceTimeoutId=null)}}class a{constructor(e){this._setOfflineTimeout=null,this._onOnline=()=>{this._clearSetOfflineTimeout(),this._state.setValue(!1)},this._onOffline=()=>{this._setOfflineTimeout=setTimeout((()=>this._syncOfflineState()),1e4)},this._isOffline=e,this._state=new o.WatchedValue(this._isOffline()),window.addEventListener("online",this._onOnline),window.addEventListener("offline",this._onOffline)}value(){return this._state.value()}subscribe(e){this._state.subscribe(e)}unsubscribe(e){this._state.unsubscribe(e)}destroy(){this._clearSetOfflineTimeout(),window.removeEventListener("online",this._onOnline),window.removeEventListener("offline",this._onOffline)}_syncOfflineState(){this._clearSetOfflineTimeout(),this._state.setValue(this._isOffline())}_clearSetOfflineTimeout(){this._setOfflineTimeout&&(clearTimeout(this._setOfflineTimeout),this._setOfflineTimeout=null)}}const c=(0,r.default)((()=>{const e=new n.FeatureToggleWatchedValue("alerts-maintenance",!1),t=(0,s.getAlertConfig)(),i=new l(e,t),r=new a((()=>!window.navigator.onLine));return{maintenance:i,offline:r,anyTrackerFired:()=>i.value()||r.value()}}))},461794:(e,t,i)=>{e=i.nmd(e),TradingView.cleanButAmpersand=function(e,t){var i=t?["&"]:["&"];return TradingView.clean(e,t,i)},TradingView.strip_tags=function(e){return e&&e.replace?e.replace(/(<([^>]+)>)/gi,""):e},TradingView.encodeSpread=function(e){return encodeURIComponent(e)},TradingView.clean=function(e,t,i){var r=[["&","&"],["<","<"],[">",">"],['"',"""],["'","'"],["'","'"]],n=e;if(!e||!e.replace)return n;for(var s=0;s{"use strict";i.d(t,{SubscriptionEventType:()=>a,subscriptionNotification:()=>u});var r=i(444372),n=i(226722),s=i(707957);const o=(0,i(201089).getLogger)("SubscriptionNotification"),l="subscriptionPermissionHasChanged";var a;!function(e){e.Subscribe="subscribe",e.Unsubscribe="unsubscribe", e.Downgrade="downgrade",e.Upgrade="upgrade",e.Change="change",e.PaymentMethodChanged="paymentmethodChanged",e.AgreementSigned="agreementSigned"}(a||(a={}));class c{constructor(){this.stateChanged=new s.Delegate,this._handlers=[],this._windowEventsHandlers=[],this._stateChangeHandlers=[]}on(e,t){const i=i=>{let r=null;try{r=JSON.parse(i)}catch(e){return void o.logWarn(`Failed to parse JSON: ${i}`)}e!==a.Change&&e!==r.type||t(r,{currentTab:!1})},r=i=>{e!==a.Change&&e!==i.type||t(i,{currentTab:!0})};n.TVXWindowEvents.on(l,i),this.stateChanged.subscribe(null,r),this._handlers.push(t),this._windowEventsHandlers.push(i),this._stateChangeHandlers.push(r)}off(e){let t;for(;-1!==t;)t=this._handlers.indexOf(e),t>-1&&(n.TVXWindowEvents.off(l,this._windowEventsHandlers[t]),this.stateChanged.unsubscribe(null,this._stateChangeHandlers[t]),this._handlers.splice(t,1),this._windowEventsHandlers=this._windowEventsHandlers.splice(t,1),this._stateChangeHandlers=this._stateChangeHandlers.splice(t,1))}showNotification(){Promise.all([i.e(29303),i.e(62253),i.e(92191),i.e(68992),i.e(81643),i.e(33199),i.e(61298),i.e(967),i.e(36953),i.e(27781),i.e(73151),i.e(61633),i.e(50690),i.e(53490),i.e(32605),i.e(72736),i.e(30870)]).then(i.bind(i,526715)).then((({showSubscriptionHasBeenChangedDialog:e})=>{e({pushReload:!0})}))}showChartNotification(){Promise.all([i.e(29303),i.e(62253),i.e(92191),i.e(68992),i.e(81643),i.e(33199),i.e(61298),i.e(967),i.e(36953),i.e(27781),i.e(73151),i.e(61633),i.e(50690),i.e(53490),i.e(32605),i.e(72736),i.e(30870)]).then(i.bind(i,526715)).then((({showSubscriptionHasBeenChangedDialog:e})=>{e({content:r.t(null,void 0,i(653427))})}))}showChartAgreementNotification(){Promise.all([i.e(29303),i.e(62253),i.e(92191),i.e(68992),i.e(81643),i.e(33199),i.e(61298),i.e(967),i.e(36953),i.e(27781),i.e(73151),i.e(61633),i.e(50690),i.e(53490),i.e(32605),i.e(72736),i.e(30870)]).then(i.bind(i,526715)).then((({showSubscriptionHasBeenChangedDialog:e})=>{e({title:r.t(null,void 0,i(719967)),content:r.t(null,void 0,i(180416))})}))}showBillingTimeoutNotification(){Promise.all([i.e(29303),i.e(62253),i.e(92191),i.e(68992),i.e(81643),i.e(33199),i.e(61298),i.e(967),i.e(36953),i.e(27781),i.e(73151),i.e(61633),i.e(50690),i.e(53490),i.e(32605),i.e(72736),i.e(30870)]).then(i.bind(i,526715)).then((({showSubscriptionHasBeenChangedDialog:e})=>{e({title:r.t(null,void 0,i(323672)),content:r.t(null,void 0,i(436344)),pushReload:!0})}))}xWindowEventsEmit(e){n.TVXWindowEvents.emit(l,JSON.stringify(e))}currentTabEmit(e){this.stateChanged.fire(e)}emit(e){this.currentTabEmit(e),this.xWindowEventsEmit(e)}static getInstance(){return c._instance||(c._instance=new c),c._instance}}function u(){return c.getInstance()}},33900:(e,t,i)=>{"use strict";i.r(t),i.d(t,{createNoticeDialog:()=>n,showNoticeDialog:()=>s});var r=i(444372);async function n(e){return(await Promise.all([i.e(76592),i.e(63987),i.e(1888),i.e(35213),i.e(63830),i.e(33371),i.e(54712),i.e(25977),i.e(88913),i.e(34834)]).then(i.bind(i,814494))).createDialog({width:400,destroyOnClose:!0, title:r.t(null,void 0,i(300963)),content:r.t(null,void 0,i(914031)),contentWrapTemplate:'

',actionsWrapTemplate:'
',actions:[{name:"ok",type:"primary",text:r.t(null,void 0,i(468988)),method:"close",key:[13,32]}],...e})}function s(e){n(e).then((e=>e.open()))}},781666:(e,t,i)=>{"use strict";i.d(t,{isShowPromoVideo:()=>d,isSignModalOpen:()=>u,showSignModal:()=>c});var r=i(586240),n=i(901896),s=i(490778);const o=r["media-mf-tablet-landscape"],l=r["media-mf-tablet-vertical"];let a=()=>!1;async function c(e){const t=Object.assign({},e,{isShowVideo:d()});if(window.TVD&&window.TVD.signIn)return window.TVD.signIn(t);{!function(){const e=window.matchMedia(r["media-mf-tablet-landscape"]).matches?s:n,t=document.createElement("link");t.rel="preload",t.as="image",t.href=e,document.head.appendChild(t)}();const e=await Promise.all([i.e(81465),i.e(62253),i.e(22666),i.e(92108),i.e(92191),i.e(32109),i.e(9817),i.e(34465),i.e(69121),i.e(93502),i.e(66639),i.e(88194),i.e(76592),i.e(72639),i.e(36884),i.e(10990),i.e(6209),i.e(8740),i.e(542),i.e(57285),i.e(7098),i.e(50690),i.e(40619),i.e(85973),i.e(62526),i.e(72465),i.e(33770),i.e(36123)]).then(i.bind(i,296466));return a=e.isSignModalOpen,e.showSignModal(t)}}function u(){return a()}function d(){const e=window.matchMedia(o).matches,t=window.matchMedia(l).matches,i=window.innerWidth,r=window.innerHeight;return!!e||!!t&&!(!e&&r{"use strict";i(586463);var r=i(324951),n=i(414879),s=n.WeekDays,o=n.Months,l=i(936410),a=l.monthsFullNames,c=l.monthsShortNames,u=l.weekDaysFullNames,d=l.weekDaysShortNames,h=l.weekDaysMiniNames;window.language&&(r.locale(window.language,{months:[a[o.JANUARY],a[o.FEBRUARY],a[o.MARCH],a[o.APRIL],a[o.MAY],a[o.JUNE],a[o.JULY],a[o.AUGUST],a[o.SEPTEMBER],a[o.OCTOBER],a[o.NOVEMBER],a[o.DECEMBER]],monthsShort:[c[o.JANUARY],c[o.FEBRUARY],c[o.MARCH],c[o.APRIL],c[o.MAY],c[o.JUNE],c[o.JULY],c[o.AUGUST],c[o.SEPTEMBER],c[o.OCTOBER],c[o.NOVEMBER],c[o.DECEMBER]],weekdays:[u[s.SUNDAY],u[s.MONDAY],u[s.TUESDAY],u[s.WEDNESDAY],u[s.THURSDAY],u[s.FRIDAY],u[s.SATURDAY]],weekdaysShort:[d[s.SUNDAY],d[s.MONDAY],d[s.TUESDAY],d[s.WEDNESDAY],d[s.THURSDAY],d[s.FRIDAY],d[s.SATURDAY]],weekdaysMin:[h[s.SUNDAY],h[s.MONDAY],h[s.TUESDAY],h[s.WEDNESDAY],h[s.THURSDAY],h[s.FRIDAY],h[s.SATURDAY]],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MMM D",l:"M/D/YYYY",LL:"MMM D, YYYY",ll:"MMM D LT",LLL:"LT - LL",lll:"MMM D, YYYY LT",LLLL:"ddd D MMMM YYYY LT",llll:"ddd D MMM YYYY LT"},calendar:{sameDay:i.tf(null,void 0,i(69130)).format({specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextDay:i.tf(null,void 0,i(225744)).format({specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextWeek:i.tf(null,void 0,i(529140)).format({specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),lastDay:i.tf(null,void 0,i(393650)).format({specialSymbolOpen:"[",specialSymbolClose:"]", dayTime:"LT"}),lastWeek:i.tf(null,void 0,i(448948)).format({specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),sameElse:"L"},relativeTime:{future:function(e){return e===i.tf(null,void 0,i(542974))?e:i.tf(null,{context:"time_range"},i(544919)).replace("%s",e)},past:function(e){return e===i.tf(null,void 0,i(542974))?e:i.tf(null,{context:"time_range"},i(692466)).replace("%s",e)},s:i.tf(null,void 0,i(542974)),m:function(e){return i.tf(null,{plural:"%d minutes",count:e},i(425821)).replace("%d",e)},mm:function(e){return i.tf(null,{plural:"%d minutes",count:e},i(425821)).replace("%d",e)},h:i.tf(null,void 0,i(290487)),hh:function(e){return i.tf(null,{plural:"%d hours",count:e},i(189279)).replace("%d",e)},d:i.tf(null,void 0,i(19304)),dd:function(e){return i.tf(null,{plural:"%d days",count:e},i(482792)).replace("%d",e)},M:i.tf(null,void 0,i(268733)),MM:function(e){return i.tf(null,{plural:"%d months",count:e},i(759502)).replace("%d",e)},y:i.tf(null,void 0,i(802730)),yy:function(e){return i.tf(null,{plural:"%d years",count:e},i(406550)).replace("%d",e)}},week:{dow:1,doy:4}}),r.locale(window.language)),e.exports=r},220563:(e,t,i)=>{"use strict";i.d(t,{userGeoInfo:()=>o});var r=i(120780);const n=(0,i(201089).getLogger)("User.GeoInfo");let s;function o(){if(void 0!==s)return s;return s=(0,r.fetch)("/check_language/",{method:"POST"}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})).catch((e=>(n.logWarn(e.message),{}))),s}},167975:(e,t,i)=>{"use strict";function r(e){return e+"…"}i.d(t,{appendEllipsis:()=>r})},328530:(e,t,i)=>{"use strict";i.d(t,{getTwemojiUrl:()=>n,twemoji:()=>r.default});var r=i(818438);function n(e,t){let i="";return r.default.parse(e,(e=>(i=r.default.base+("svg"===t?`svg/${e}.svg`:`72x72/${e}.png`),!1))),i}r.default.base="https://cdnjs.cloudflare.com/ajax/libs/twemoji/13.0.1/"},96080:(e,t,i)=>{"use strict";function r(e){let t,i=0;if(0===e.length)return i;for(var r=0;rr})},449628:(e,t,i)=>{"use strict";i.d(t,{disable:()=>c,enable:()=>u,pushBackListener:()=>a});var r=i(541558);const n=[];let s=null;function o(e){for(let t=0;t=0&&!0!==n[t].func(e);t--);}function a(e,t){const i={name:e,func:t},r=o(i.name);r>-1&&n.splice(r,1),n.unshift(i)}function c(){return s?null:(s=(0,r.randomHashN)(4),s)}function u(e){if(e!==s)throw Error("Lock id is outdated");s=null}window.addEventListener("keypress",l,!1)},919476:(e,t,i)=>{"use strict";i.r(t),i.d(t,{capitalizeFirstLetterInWord:()=>v,decodeHTMLEntities:()=>c,encodeHTMLEntities:()=>u,htmlEscape:()=>d,removeSpaces:()=>p,removeTags:()=>h});const r=/[<"'&>]/g,n=e=>`&#${e.charCodeAt(0)};`,s={"<":"<",">":">",""":'"',"'":"'","&":"&","<":"<",">":">",""":'"',"'":"'","'":"'","&":"&"},o=Object.assign({},...Object.entries(s).map((([e,t])=>({[t]:e })))),l=new RegExp(Object.keys(s).join("|"),"g"),a=new RegExp(Object.keys(o).join("|"),"g");function c(e){return e.replace(l,(e=>s[e]||e))}function u(e){return e.replace(a,(e=>o[e]||e))}function d(e){return e.replace(r,n)}function h(e=""){return e.replace(/(<([^>]+)>)/gi,"")}function p(e=""){return e.replace(/\s+/g,"")}function v(e=""){return e.replace(/\b\w/g,(e=>e.toUpperCase()))}},501437:(e,t,i)=>{"use strict";function r(e){return decodeURIComponent(e.replace(/\+/g," ")).replace(/<\/?[^>]+(>|$)/g,"")}function n(e){const t=/([^&=]+)=?([^&]*)/g,i={};if(!e)return i;let n=t.exec(e);for(;n;)i[r(n[1])]=r(n[2]),n=t.exec(e);return i}function s(){return n(window.location.search.substring(1))}function o(e){const t=[];for(const i in e)e.hasOwnProperty(i)&&null!=e[i]&&t.push({key:i,pair:encodeURIComponent(i)+"="+encodeURIComponent(e[i])});return t.sort(((e,t)=>e.key>t.key?1:e.keye.pair)).join("&")}i.d(t,{createUrlParams:()=>o,getUrlParams:()=>s})},49336:(e,t,i)=>{"use strict";function r(e,t=!1){"loading"!==document.readyState?t?setTimeout((()=>e()),1):e():document.addEventListener("DOMContentLoaded",(()=>e()))}i.d(t,{whenDocumentReady:()=>r});new Promise((e=>{r(e)}))},930003:(e,t,i)=>{"use strict";i.d(t,{Worker:()=>r});class r extends Worker{constructor(e,t){super(function(e){const t=new URL(e),r=new Blob(["self.WEBPACK_PUBLIC_PATH=",JSON.stringify(new URL(i.p,location.href).href),";\n","self.locale=",JSON.stringify(i.g.locale),";\n",window.language?`self.language=${JSON.stringify(window.language)};\n`:"","importScripts(",JSON.stringify(t.href),");"],{type:"application/javascript"});return URL.createObjectURL(r)}(e),t)}}},201457:e=>{e.exports=''},934976:e=>{"use strict";e.exports=JSON.parse('{"4":["v",["h",0,2],["h",1,3]],"6":["v",["h",0,2,4],["h",1,3,5]],"8":["v",["h",0,2,4,6],["h",1,3,5,7]],"2h":["h",0,1],"2v":["v",0,1],"2-1":["v",["h",0,2],1],"3s":["h",0,["v",1,2]],"3h":["h",0,1,2],"3v":["v",0,1,2],"1-2":["v",0,["h",1,2]],"3r":["h",["v",0,1],2],"4h":["h",0,1,2,3],"4v":["v",0,1,2,3],"4s":["h",0,["v",1,2,3]],"5h":["h",0,1,2,3,4],"6h":["h",0,1,2,3,4,5],"7h":["h",0,1,2,3,4,5,6],"8h":["h",0,1,2,3,4,5,6,7],"1-3":["v",0,["h",1,2,3]],"2-2":["v",["h",0,1],["v",2,3]],"2-3":["v",["h",0,1],["h",2,3,4]],"1-4":["v",0,["h",1,2,3,4]],"5s":["h",0,["v",1,2,3,4]],"6c":["v",["h",0,1],["h",2,3],["h",4,5]],"8c":["v",["h",0,1],["h",2,3],["h",4,5],["h",6,7]],"10c5":["v",["h",0,2,4,6,8],["h",1,3,5,7,9]],"12c6":["v",["h",0,2,4,6,8,10],["h",1,3,5,7,9,11]],"12c4":["v",["h",0,4,8],["h",1,5,9],["h",2,6,10],["h",3,7,11]],"14c7":["v",["h",0,2,4,6,8,10,12],["h",1,3,5,7,9,11,13]],"16c8":["v",["h",0,2,4,6,8,10,12,14],["h",1,3,5,7,9,11,13,15]],"16c4":["v",["h",0,4,8,12],["h",1,5,9,13],["h",2,6,10,14],["h",3,7,11,15]],"s":0}')}}]);