"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[4482],{74343:(e,i,t)=>{t.d(i,{basePriceSources:()=>d,createPriceSourceDefinition:()=>u});var o=t(11542),n=t(14139),r=t(64147),l=t(4116),s=t(23869),a=t(68805);const c=o.t(null,void 0,t(84684)),d=[{title:o.t(null,void 0,t(16610)),value:"open",id:"price-source-open"},{title:o.t(null,void 0,t(78254)),value:"high",id:"price-source-high"},{title:o.t(null,void 0,t(65318)),value:"low",id:"price-source-low"},{title:o.t(null,void 0,t(62578)),value:"close",id:"price-source-close"},{title:o.t(null,void 0,t(69303)),value:"hl2",id:"price-source-hl2"},{title:o.t(null,void 0,t(27311)),value:"hlc3",id:"price-source-hlc3"},{title:o.t(null,void 0,t(4348)),value:"ohlc4",id:"price-source-ohlc4"}];function u(e,i,t,o,d,u){const p=void 0,h=(0,s.createWVFromGetterAndSubscriptions)((()=>!(0,a.isCloseBasedSymbol)(e.mainSeries().symbolInfo())),[e.mainSeries().dataEvents().symbolResolved(),e.mainSeries().dataEvents().symbolError()]);return(0,n.createOptionsPropertyDefinition)({disabled:p&&(0,l.convertFromReadonlyWVToDefinitionProperty)(p.weakReference()),option:(0,l.convertToDefinitionProperty)(e,i.priceSource,u),visible:(0,l.convertFromReadonlyWVToDefinitionProperty)(h.ownership())},{id:`${o}${d}`,title:c,options:new r.WatchedValue(t)})}},18653:(e,i,t)=>{t.d(i,{getSeriesStylePropertiesDefinitions:()=>Pe});var o=t(11542),n=t(45126),r=t(4116),l=(t(20596),t(64147)),s=t(56570),a=t(37265),c=t(52305),d=t(49406),u=t(74343);const p=new n.TranslatedString("change line price source",o.t(null,void 0,t(41837))),h=new n.TranslatedString("change line color",o.t(null,void 0,t(88640))),y=new n.TranslatedString("change line width",o.t(null,void 0,t(48339))),f=o.t(null,void 0,t(3554));function v(e,i,t,o){return[(0,u.createPriceSourceDefinition)(e,i,t,o,"SymbolLinePriceSource",p),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.color,null,h),width:(0,r.convertToDefinitionProperty)(e,i.linewidth,y)},{id:`${o}SymbolLineStyle`,title:f})]}
const g=new n.TranslatedString("change color bars based on previous close",o.t(null,void 0,t(43090))),S=new n.TranslatedString("change HLC bars",o.t(null,void 0,t(27068))),b=new n.TranslatedString("change bar up color",o.t(null,void 0,t(33464))),w=new n.TranslatedString("change bar down color",o.t(null,void 0,t(59622))),P=new n.TranslatedString("change thin bars",o.t(null,void 0,t(60834))),m=new n.TranslatedString("change area price source",o.t(null,void 0,t(4640))),T=new n.TranslatedString("change area line color",o.t(null,void 0,t(29605))),D=new n.TranslatedString("change area line width",o.t(null,void 0,t(89346))),_=new n.TranslatedString("change area fill color",o.t(null,void 0,t(86866))),C=new n.TranslatedString("change baseline price source",o.t(null,void 0,t(68609))),k=new n.TranslatedString("change baseline top line color",o.t(null,void 0,t(69044))),W=new n.TranslatedString("change baseline top line width",o.t(null,void 0,t(68197))),$=new n.TranslatedString("change baseline bottom line color",o.t(null,void 0,t(71785))),M=new n.TranslatedString("change baseline bottom line width",o.t(null,void 0,t(56175))),V=new n.TranslatedString("change baseline fill top area color",o.t(null,void 0,t(92873))),L=new n.TranslatedString("change baseline fill bottom area color",o.t(null,void 0,t(97216))),I=new n.TranslatedString("change base level",o.t(null,void 0,t(42190))),O=new n.TranslatedString("change high-low body visibility",o.t(null,void 0,t(73021))),x=new n.TranslatedString("change high-low body color",o.t(null,void 0,t(6026))),B=new n.TranslatedString("change high-low borders visibility",o.t(null,void 0,t(15801))),A=new n.TranslatedString("change high-low border color",o.t(null,void 0,t(46844))),E=new n.TranslatedString("change high-low labels visibility",o.t(null,void 0,t(72399))),F=new n.TranslatedString("change high-low labels color",o.t(null,void 0,t(56961))),N=(new n.TranslatedString("change renko wick visibility",o.t(null,void 0,t(79604))),new n.TranslatedString("change renko wick up color",o.t(null,void 0,t(92277))),new n.TranslatedString("change renko wick down color",o.t(null,void 0,t(75487))),new n.TranslatedString("change the display of real prices on price scale (instead of Heiken-Ashi price)",o.t(null,void 0,t(16660))),new n.TranslatedString("change range thin bars",o.t(null,void 0,t(65821))),new n.TranslatedString("change range bars style",o.t(null,void 0,t(16241))),
new n.TranslatedString("change {candleType} body visibility",o.t(null,void 0,t(60608)))),R=new n.TranslatedString("change {candleType} up color",o.t(null,void 0,t(36697))),H=new n.TranslatedString("change {candleType} down color",o.t(null,void 0,t(64571))),U=new n.TranslatedString("change {candleType} border visibility",o.t(null,void 0,t(11114))),j=new n.TranslatedString("change {candleType} up border color",o.t(null,void 0,t(17214))),z=new n.TranslatedString("change {candleType} down border color",o.t(null,void 0,t(20291))),G=new n.TranslatedString("change {candleType} wick visibility",o.t(null,void 0,t(94750))),J=new n.TranslatedString("change {candleType} wick up color",o.t(null,void 0,t(97546))),q=new n.TranslatedString("change {candleType} wick down color",o.t(null,void 0,t(48091))),K=(new n.TranslatedString("change {chartType} up color",o.t(null,void 0,t(6970))),new n.TranslatedString("change {chartType} down color",o.t(null,void 0,t(5012))),new n.TranslatedString("change {chartType} projection bar up color",o.t(null,void 0,t(85032))),new n.TranslatedString("change {chartType} projection bar down color",o.t(null,void 0,t(72545))),new n.TranslatedString("change {chartType} border bar up color",o.t(null,void 0,t(28394))),new n.TranslatedString("change {chartType} border bar down color",o.t(null,void 0,t(23053))),new n.TranslatedString("change {chartType} projection border bar up color",o.t(null,void 0,t(42826))),new n.TranslatedString("change {chartType} projection border bar up color",o.t(null,void 0,t(42826))),new n.TranslatedString("change column up color",o.t(null,void 0,t(88324)))),Q=new n.TranslatedString("change column down color",o.t(null,void 0,t(93890))),X=new n.TranslatedString("change column price source",o.t(null,void 0,t(4727))),Y=o.t(null,void 0,t(23111)),Z=o.t(null,void 0,t(886)),ee=o.t(null,void 0,t(23091)),ie=o.t(null,void 0,t(23743)),te=o.t(null,void 0,t(20215)),oe=o.t(null,void 0,t(74406)),ne=o.t(null,void 0,t(333)),re=o.t(null,void 0,t(32163)),le=o.t(null,void 0,t(3554)),se=o.t(null,void 0,t(89349)),ae=o.t(null,void 0,t(3159)),ce=o.t(null,void 0,t(41129)),de=o.t(null,void 0,t(61112)),ue=o.t(null,void 0,t(73185)),pe=(o.t(null,void 0,t(36957)),o.t(null,void 0,t(17611)),o.t(null,void 0,t(77430)),o.t(null,void 0,t(73466)),o.t(null,void 0,t(88367)),o.t(null,void 0,t(6160)),o.t(null,void 0,t(28975))),he=o.t(null,void 0,t(74406)),ye=o.t(null,void 0,t(333)),fe=o.t(null,void 0,t(5119)),ve=o.t(null,void 0,t(56359)),ge=o.t(null,void 0,t(84831)),Se=o.t(null,void 0,t(34579));o.t(null,void 0,t(92516)),o.t(null,void 0,t(27377)),o.t(null,void 0,t(45054));function be(e,i,t,o){return(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.barColorsOnPrevClose,g)},{id:`${t}${o}`,title:Y})}function we(e,i,t,o){const n=(0,d.removeSpaces)(t.originalText());return[(0,r.createTwoColorsPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.drawBody,N.format({candleType:t})),color1:(0,r.getColorDefinitionProperty)(e,i.upColor,null,R.format({candleType:t})),color2:(0,
r.getColorDefinitionProperty)(e,i.downColor,null,H.format({candleType:t}))},{id:`${o}Symbol${n}CandlesColor`,title:oe}),(0,r.createTwoColorsPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.drawBorder,U.format({candleType:t})),color1:(0,r.getColorDefinitionProperty)(e,i.borderUpColor,null,j.format({candleType:t})),color2:(0,r.getColorDefinitionProperty)(e,i.borderDownColor,null,z.format({candleType:t}))},{id:`${o}Symbol${n}BordersColor`,title:ne}),(0,r.createTwoColorsPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.drawWick,G.format({candleType:t})),color1:(0,r.getColorDefinitionProperty)(e,i.wickUpColor,null,J.format({candleType:t})),color2:(0,r.getColorDefinitionProperty)(e,i.wickDownColor,null,q.format({candleType:t}))},{id:`${o}Symbol${n}WickColors`,title:re})]}function Pe(e,i,d,p,h){switch(d){case 0:return function(e,i,t){return[be(e,i,t,"SymbolBarStyleBarColorsOnPrevClose"),(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.dontDrawOpen,S)},{id:`${t}SymbolDontDrawOpen`,title:Z}),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.upColor,null,b)},{id:`${t}SymbolUpColor`,title:ee}),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.downColor,null,w)},{id:`${t}SymbolDownColor`,title:ie}),(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.thinBars,P)},{id:`${t}SymbolBarThinBars`,title:te})].filter(a.isExistent)}(e,i.barStyle.childs(),h);case 1:case 19:return function(e,i,r){return[be(e,i,r,"SymbolCandleStyleBarColorsOnPrevClose"),...we(e,i,new n.TranslatedString("candle",o.t(null,void 0,t(21105))),r)].filter(a.isExistent)}(e,1===d?i.candleStyle.childs():i.volCandlesStyle.childs(),h);case 2:return v(e,i.lineStyle.childs(),p.seriesPriceSources,h);case 14:return v(e,i.lineWithMarkersStyle.childs(),p.seriesPriceSources,h);case 15:return v(e,i.steplineStyle.childs(),p.seriesPriceSources,h);case 3:return function(e,i,t,o){return[(0,u.createPriceSourceDefinition)(e,i,t,o,"SymbolAreaPriceSource",m),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.linecolor,null,T),width:(0,r.convertToDefinitionProperty)(e,i.linewidth,D)},{id:`${o}SymbolAreaLineStyle`,title:le}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.color1,i.transparency,_),color2:(0,r.getColorDefinitionProperty)(e,i.color2,i.transparency,_)},{id:`${o}SymbolAreaFills`,title:ce})]}(e,i.areaStyle.childs(),p.seriesPriceSources,h);case 16:return function(e,i,t,o){return[(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.highLineColor,null,T),width:(0,r.convertToDefinitionProperty)(e,i.highLineWidth,D)},{id:`${o}SymbolHLCAreaHighLineStyle`,title:ve}),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.lowLineColor,null,T),width:(0,r.convertToDefinitionProperty)(e,i.lowLineWidth,D)},{id:`${o}SymbolHLCAreaLowLineStyle`,title:Se}),(0,r.createLinePropertyDefinition)({color:(0,
r.getColorDefinitionProperty)(e,i.closeLineColor,null,T),width:(0,r.convertToDefinitionProperty)(e,i.closeLineWidth,D)},{id:`${o}SymbolHLCAreaCloseLineStyle`,title:ge}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.highCloseFillColor,null,_),color2:(0,r.getColorDefinitionProperty)(e,i.closeLowFillColor,null,_)},{id:`${o}SymbolHLCAreaFills`,title:ce})]}(e,i.hlcAreaStyle.childs(),p.seriesPriceSources,h);case 9:return we(e,i.hollowCandleStyle.childs(),new n.TranslatedString("hollow candles",o.t(null,void 0,t(92598))),h);case 10:return function(e,i,t,o){return[(0,u.createPriceSourceDefinition)(e,i,t,o,"SymbolBaseLinePriceSource",C),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.topLineColor,null,k),width:(0,r.convertToDefinitionProperty)(e,i.topLineWidth,W)},{id:`${o}SymbolBaseLineTopLine`,title:se}),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.bottomLineColor,null,$),width:(0,r.convertToDefinitionProperty)(e,i.bottomLineWidth,M)},{id:`${o}SymbolBaseLineBottomLine`,title:ae}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.topFillColor1,null,V),color2:(0,r.getColorDefinitionProperty)(e,i.topFillColor2,null,V)},{id:`${o}SymbolBaseLineTopFills`,title:de}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.bottomFillColor1,null,L),color2:(0,r.getColorDefinitionProperty)(e,i.bottomFillColor2,null,L)},{id:`${o}SymbolBaseLineBottomFills`,title:ue}),(0,r.createNumberPropertyDefinition)({value:(0,r.convertToDefinitionProperty)(e,i.baseLevelPercentage,I,[c.floor])},{id:`${o}SymbolBaseLevelPercentage`,title:pe,type:0,min:new l.WatchedValue(0),max:new l.WatchedValue(100),step:new l.WatchedValue(1),unit:new l.WatchedValue("%")})]}(e,i.baselineStyle.childs(),p.seriesPriceSources,h);case 13:return function(e,i,t,o){return[(0,u.createPriceSourceDefinition)(e,i,t,o,"SymbolColumnPriceSource",X),be(e,i,o,"SymbolColumnStyleColumnColorsOnPrevClose"),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.upColor,null,K)},{id:`${o}SymbolUpColor`,title:ee}),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.downColor,null,Q)},{id:`${o}SymbolDownColor`,title:ie})].filter(a.isExistent)}(e,i.columnStyle.childs(),p.seriesPriceSources,h)}if(12===d&&s.enabled("chart_style_hilo")){return function(e,i,t){return[(0,r.createColorPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.drawBody,O),color:(0,r.getColorDefinitionProperty)(e,i.color,null,x)},{id:`${t}SymbolBodiesColor`,title:he}),(0,r.createColorPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.showBorders,B),color:(0,r.getColorDefinitionProperty)(e,i.borderColor,null,A)},{id:`${t}SymbolBorderColor`,title:ye}),(0,r.createTextPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.showLabels,E),color:(0,r.getColorDefinitionProperty)(e,i.labelColor,null,F)},{id:`${t}SymbolLabels`,title:fe,isEditable:!1,isMultiLine:!1})]
}(e,i.hiloStyle.childs(),h)}if(!i.hasOwnProperty("haStyle"))return[];if(p.isJapaneseChartsAvailable&&8===d){return function(e,i,r){const l=[];return l.push(be(e,i,r,"SymbolHAStyleBarColorsOnPrevClose"),...we(e,i,new n.TranslatedString("Heikin Ashi",o.t(null,void 0,t(63876))),r)),l}(e,i.haStyle.childs(),h)}return p.isJapaneseChartsAvailable&&s.enabled("japanese_chart_styles"),[]}},64482:(e,i,t)=>{t.d(i,{SeriesPropertyDefinitionsViewModel:()=>F,seriesPrecisionValues:()=>E});var o=t(50151),n=t(11542),r=t(45126),l=t(56570),s=t(4116),a=t(5171),c=t(64147),d=t(16638),u=t(68805),p=t(18653),h=t(52305);const y=new r.TranslatedString("change {inputName} property",n.t(null,void 0,t(66110)));function f(e){return e.map((e=>({value:e,title:n.t(e,{context:"input"},t(32856))})))}const v=new Set(["percentageLTP"]);function g(e,i,l,a,d,p,g){const S=[];return l.forEach((l=>{if(!function(e,i){return!e.isHidden&&(void 0===e.visible||function(e,i){if(!e)return!0;const t=e.split("==");return!(t.length<2)&&i[t[0]].value()===t[1]}(e.visible,i))}(l,a))return;const b=l.id;if(!a.hasOwnProperty(b))return;const w=a[b],P=function(e,i){return"style"===e.id?"Box size assignment method":"boxSize"===e.id?"Box size":i.childs().name.value()}(l,d[b]),m=function(e){return n.t(e,{context:"input"},t(32856))}(P),T=new r.TranslatedString(P,m);if("options"in l){const i=(0,o.ensure)(l.options);S.push((0,s.createOptionsPropertyDefinition)({option:(0,s.convertToDefinitionProperty)(e,w,y.format({inputName:T}))},{id:`${g}${l.name}`,title:m,options:new c.WatchedValue(f(i))}))}else if("integer"!==l.type){if("float"===l.type){let t;return t=function(e,i){return!((i===(0,u.chartStyleStudyId)(4)||i===(0,u.chartStyleStudyId)(6))&&"boxSize"===e||i===(0,u.chartStyleStudyId)(5)&&"reversalAmount"===e)}(b,i)||null===p.value()?new c.WatchedValue(l.min):p,void S.push((0,s.createNumberPropertyDefinition)({value:(0,s.convertToDefinitionProperty)(e,w,y.format({inputName:T}))},{id:`${g}${l.name}`,title:m,type:1,min:t,max:new c.WatchedValue(l.max),unit:v.has(l.id)?new c.WatchedValue("%"):void 0,defval:l.defval}))}"text"!==l.type?"bool"!==l.type||S.push((0,s.createCheckablePropertyDefinition)({checked:(0,s.convertToDefinitionProperty)(e,w,y.format({inputName:T}))},{id:`${g}${l.name}`,title:m})):S.push((0,s.createTextPropertyDefinition)({text:(0,s.convertToDefinitionProperty)(e,w,y.format({inputName:T}))},{id:`${g}${l.name}`,title:m,isEditable:!0,isMultiLine:!1}))}else S.push((0,s.createNumberPropertyDefinition)({value:(0,s.convertToDefinitionProperty)(e,w,y.format({inputName:T}),[h.floor])},{id:`${g}${l.name}`,title:m,type:0,min:new c.WatchedValue(l.min),max:new c.WatchedValue(l.max),unit:v.has(l.id)?new c.WatchedValue("%"):void 0,defval:l.defval}))})),S}var S=t(31955),b=t(14712),w=t(99531),P=t(88960),m=t(95700),T=t(74343);const D=(0,
S.getLogger)("Chart.Definitions.Series"),_=l.enabled("pre_post_market_sessions"),C=new r.TranslatedString("change decimal places",n.t(null,void 0,t(82063))),k=new r.TranslatedString("change timezone",n.t(null,void 0,t(20137))),W=(new r.TranslatedString("adjust data for dividends",n.t(null,void 0,t(18077))),new r.TranslatedString("use settlement as close on daily interval",n.t(null,void 0,t(92978))),new r.TranslatedString("adjust for contract changes",n.t(null,void 0,t(1433))),new r.TranslatedString("change session",n.t(null,void 0,t(87041)))),$=new r.TranslatedString("change extended hours color",n.t(null,void 0,t(44223))),M=new r.TranslatedString("change pre market color",n.t(null,void 0,t(44371))),V=new r.TranslatedString("change post market color",n.t(null,void 0,t(38730))),L=(n.t(null,void 0,t(93020)),n.t(null,void 0,t(94031))),I=(n.t(null,void 0,t(68921)),n.t(null,void 0,t(49545)),n.t(null,void 0,t(88327))),O=n.t(null,void 0,t(59766)),x=n.t(null,void 0,t(77073)),B=n.t(null,void 0,t(16564)),A=[{priceScale:2,minMove:1,frac:!0},{priceScale:4,minMove:1,frac:!0},{priceScale:8,minMove:1,frac:!0},{priceScale:16,minMove:1,frac:!0},{priceScale:32,minMove:1,frac:!0},{priceScale:64,minMove:1,frac:!0},{priceScale:128,minMove:1,frac:!0},{priceScale:320,minMove:1,frac:!0}];function E(){const e=[{title:B,value:"default"}],i=function(e=15){const i=[];for(let t=0;t<=e;t++)i.push({priceScale:Math.pow(10,t),minMove:1,frac:!1});return i}();for(let o=0;o<i.length;o++){const r=Math.log10(i[o].priceScale),l=0===r?n.t(null,void 0,t(47326)):n.t(null,{plural:"{value} decimals",count:r,replace:{value:r.toString()}},t(59644));e.push({title:l,value:`${i[o].priceScale},${i[o].minMove},${i[o].frac}`})}for(let i=0;i<A.length;i++)e.push({title:`${A[i].minMove}/${A[i].priceScale}`,value:`${A[i].priceScale},${A[i].minMove},${A[i].frac}`});return e}class F{constructor(e,i,t,o,n,r){this._definitions=null,this._inputsSubscriptions=null,this._isDestroyed=!1,this._propertyPages=null,this._seriesMinTickWV=null,this._sessionIdOptionsWV=new c.WatchedValue([]),this._series=e,this._undoModel=i,this._model=this._undoModel.model(),this._propertyPageId=t,this._propertyPageName=o,this._propertyPageIcon=n,this._timezonePropertyObj=r,this._series.onStyleChanged().subscribe(this,this._updateDefinitions),this._series.properties().childs().rangeStyle.childs().barStyle.listeners().subscribe(this,this._updateDefinitions),this._series.dataEvents().symbolResolved().subscribe(this,this._updateSeriesMinTickWV),this._series.dataEvents().symbolResolved().subscribe(this,this._updateSessionIdOptionsWV),this._updateSeriesMinTickWV(),this._updateSessionIdOptionsWV()}destroy(){null!==this._propertyPages&&this._propertyPages.forEach((e=>{(0,s.destroyDefinitions)(e.definitions.value())})),this._series.onStyleChanged().unsubscribe(this,this._updateDefinitions),this._series.properties().childs().rangeStyle.childs().barStyle.listeners().unsubscribeAll(this),this._series.dataEvents().symbolResolved().unsubscribeAll(this),this._unsubscribeInputsUpdate(),this._isDestroyed=!0}
propertyPages(){return null===this._propertyPages?this._getDefinitions().then((e=>{var i;if(this._isDestroyed)throw new Error("SeriesPropertyDefinitionsViewModel already destroyed");return null===this._propertyPages&&(this._propertyPages=[{id:this._propertyPageId,title:this._propertyPageName,icon:this._propertyPageIcon,definitions:new c.WatchedValue(e.definitions),visible:null!==(i=e.visible)&&void 0!==i?i:new c.WatchedValue(!0).readonly()}]),this._propertyPages})):Promise.resolve(this._propertyPages)}_seriesMinTick(){const e=this._series.symbolInfo();return null!==e?e.minmov/e.pricescale:null}_updateSeriesMinTickWV(){null===this._seriesMinTickWV?this._seriesMinTickWV=new c.WatchedValue(this._seriesMinTick()):this._seriesMinTickWV.setValue(this._seriesMinTick())}_updateSessionIdOptionsWV(){if(!_)return;const e=this._series.symbolInfo();if(null===e)return;const i=(e.subsessions||[]).filter((e=>!e.private)).map((e=>({title:(0,m.translateSessionDescription)(e.description),value:e.id})));this._sessionIdOptionsWV.setValue(i)}_updateDefinitions(){null!==this._definitions&&(0,s.destroyDefinitions)(this._definitions.definitions),this._definitions=null,this._createSeriesDefinitions().then((e=>{if(this._isDestroyed)throw new Error("SeriesPropertyDefinitionsViewModel already destroyed");(0,o.ensureNotNull)(this._propertyPages)[0].definitions.setValue(e.definitions)}))}_getDefinitions(){return null===this._definitions?this._createSeriesDefinitions():Promise.resolve(this._definitions)}_unsubscribeInputsUpdate(){null!==this._inputsSubscriptions&&(this._inputsSubscriptions.forEach((e=>{e.unsubscribeAll(this)})),this._inputsSubscriptions=null)}_subscribeInputsUpdate(e,i){this._unsubscribeInputsUpdate();const t=[];e.forEach((e=>{if(void 0!==e.visible){const o=e.visible.split("==");if(2===o.length){const e=i[o[0]];-1===t.indexOf(e)&&(e.subscribe(this,this._updateDefinitions),t.push(e))}}})),t.length>0?this._inputsSubscriptions=t:this._inputsSubscriptions=null}async _createSeriesDefinitions(){const e=this._series.properties().childs(),i=this._series.getInputsProperties(),r=this._series.getInputsInfoProperties(),l=e.style.value(),h=this._series.getStyleShortName(),y=a.chartStylesWithAttachedStudies.includes(l)?null:(0,u.chartStyleStudyId)(l);let f,v=null;if(null!==y){let e;try{e=await(0,d.studyMetaInfoRepository)().findById({type:"java",studyId:y});const t=(0,o.ensureNotNull)(this._seriesMinTickWV);v=g(this._undoModel,e.id,e.inputs,i,r,t,h),this._subscribeInputsUpdate(e.inputs,i)}catch(i){D.logWarn(`Find meta info for create series definitions with error - ${(0,b.errorToString)(i)}`),e=null}if(this._isDestroyed)throw new Error("SeriesPropertyDefinitionsViewModel already destroyed")}else this._unsubscribeInputsUpdate();if(this._isDestroyed)throw new Error("SeriesPropertyDefinitionsViewModel already destroyed");if(a.chartStylesWithAttachedStudies.includes(l))throw new Error("unexpected chart style");{const i=(0,p.getSeriesStylePropertiesDefinitions)(this._undoModel,e,l,{seriesPriceSources:T.basePriceSources,isJapaneseChartsAvailable:true
},"mainSeries");null!==v&&i.push(...v),f=(0,s.createPropertyDefinitionsGeneralGroup)(i,"generalSymbolStylesGroup",(0,u.getTranslatedChartStyleName)(l))}const S=(0,s.createOptionsPropertyDefinition)({option:(0,s.convertToDefinitionProperty)(this._undoModel,e.minTick,C),visible:(0,s.convertFromReadonlyWVToDefinitionProperty)(new c.WatchedValue(!0).ownership())},{id:`${h}SymbolMinTick`,title:O,options:new c.WatchedValue(E())}),w=(0,s.createOptionsPropertyDefinition)({option:(0,s.convertToDefinitionProperty)(this._undoModel,this._timezonePropertyObj.property,k)},{id:`${h}SymbolTimezone`,title:x,options:new c.WatchedValue(this._timezonePropertyObj.values)});return this._definitions={definitions:[f,(0,s.createPropertyDefinitionsGeneralGroup)([...await this._seriesDataDefinitions(h),S,w],"dataModififcationGroup",n.t(null,void 0,t(48225)))]},this._definitions}async _seriesDataDefinitions(e){const i=[];if(_){const t=this._series.sessionIdProxyProperty(),o=(0,P.combineWithFilteredUpdate)(((e,i)=>!i&&(0,u.symbolHasSeveralSessions)(this._series.symbolInfo())),((e,i)=>i||!e),this._series.symbolResolvingActive().weakReference(),(0,w.createWVFromProperty)(this._series.isDWMProperty()).ownership()),n=(0,s.createOptionsPropertyDefinition)({option:(0,s.convertToDefinitionProperty)(this._undoModel,t,W),visible:(0,s.convertFromReadonlyWVToDefinitionProperty)(o.ownership())},{id:"sessionId",title:L,options:this._sessionIdOptionsWV});i.push(n);const r=(await this._model.sessions().promise()).graphicsInfo();let l=!1;r.backgrounds&&(l=void 0!==r.backgrounds.outOfSession);const a=await(l?this._createOutOfSessionDefinition(e):this._createPrePostMarketDefinition(e));i.push(a)}return i}async _createOutOfSessionDefinition(e){const i=(await this._model.sessions().promise()).properties().childs().graphics.childs().backgrounds.childs().outOfSession.childs();return(0,s.createColorPropertyDefinition)({color:(0,s.getColorDefinitionProperty)(this._undoModel,i.color,i.transparency,$)},{id:`${e}SymbolExtendedHoursColors`,title:I})}async _createPrePostMarketDefinition(e){const i=(0,P.combineWithFilteredUpdate)(((e,i)=>!i&&(0,u.symbolHasPreOrPostMarket)(this._series.symbolInfo())&&!(0,u.isRegularSessionId)(this._series.sessionIdProxyProperty().value())),((e,i)=>i||!e),this._series.symbolResolvingActive().weakReference(),(0,w.createWVFromProperty)(this._series.isDWMProperty()).ownership()),t=await this._model.sessions().promise(),o=t.properties().childs().graphics.childs().backgrounds.childs().preMarket.childs(),n=t.properties().childs().graphics.childs().backgrounds.childs().postMarket.childs();return(0,s.createTwoColorsPropertyDefinition)({color1:(0,s.getColorDefinitionProperty)(this._undoModel,o.color,o.transparency,M),color2:(0,s.getColorDefinitionProperty)(this._undoModel,n.color,n.transparency,V),visible:(0,s.convertFromReadonlyWVToDefinitionProperty)(i.ownership())},{id:`${e}SymbolExtendedHoursColors`,title:I})}}}}]);