initial commit with charts and assistant chat

This commit is contained in:
2026-03-02 00:08:19 -04:00
commit d907c5765e
1828 changed files with 50054 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7903],{45838:(e,i,t)=>{t.d(i,{convertToInt:()=>r,floor:()=>n,limitedPrecision:()=>l});var o=t(9860);function n(e){return Math.floor(e)}function r(e){return parseInt(String(e))}function l(e){const i=new o.LimitedPrecisionNumericFormatter(e,!0);return e=>{if(null===e)return e;const t=i.parse(i.format(e));return t.res?t.value:null}}},14032:(e,i,t)=>{t.d(i,{LineStylePropertyDefinitionsMode:()=>p,lineStylePropertyDefinitions:()=>h});var o=t(11542),n=t(95804),r=t(95338),l=t(44360);const s=new n.TranslatedString("change line price source",o.t(null,void 0,t(41837))),a=new n.TranslatedString("change line color",o.t(null,void 0,t(88640))),c=new n.TranslatedString("change line width",o.t(null,void 0,t(48339))),d=new n.TranslatedString("change line style",o.t(null,void 0,t(28818))),u=o.t(null,void 0,t(3554));var p;function h(e,i,t,o,n){const h=(0,l.createPriceSourceDefinition)(e,i,t,o,"SymbolLinePriceSource",s);let y;return y=n===p.Simple?(0,r.createLinePropertyDefinition)({color:i.color,width:i.linewidth,style:i.linestyle},{id:`${o}SymbolLineStyle`,title:u}):(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.color,null,a),gradientColor1:i.gradientStartColor&&(0,r.getColorDefinitionProperty)(e,i.gradientStartColor,null,a),gradientColor2:i.gradientEndColor&&(0,r.getColorDefinitionProperty)(e,i.gradientEndColor,null,a),type:i.colorType&&(0,r.convertToDefinitionProperty)(e,i.colorType,a),width:(0,r.convertToDefinitionProperty)(e,i.linewidth,c),style:(0,r.convertToDefinitionProperty)(e,i.linestyle,d)},{id:`${o}SymbolLineStyle`,title:u}),[h,y]}!function(e){e[e.Gradient=0]="Gradient",e[e.Simple=1]="Simple"}(p||(p={}))},44360:(e,i,t)=>{t.d(i,{basePriceSources:()=>u,createPriceSourceDefinition:()=>p});var o=t(11542),n=t(41321),r=t(22613),l=t(95338),s=t(11751),a=t(95059),c=t(31789);const d=o.t(null,void 0,t(84684)),u=["open","high","low","close","hl2","hlc3","ohlc4"].map((e=>({title:c.priceSourceTitles[e],value:e,id:`price-source-${e}`})));function p(e,i,t,o,c,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}${c}`,title:d,options:new r.WatchedValue(t)})}},42258:(e,i,t)=>{t.d(i,{getSeriesStylePropertiesDefinitions:()=>Te});var o=t(11542),n=t(95804),r=t(95338),l=(t(22033),t(22613)),s=t(37103),a=t(87465),c=t(45838),d=t(91682),u=t(14032),p=t(44360)
;const h=new n.TranslatedString("change color bars based on previous close",o.t(null,void 0,t(43090))),y=new n.TranslatedString("change HLC bars",o.t(null,void 0,t(27068))),f=new n.TranslatedString("change bar up color",o.t(null,void 0,t(33464))),v=new n.TranslatedString("change bar down color",o.t(null,void 0,t(59622))),g=new n.TranslatedString("change thin bars",o.t(null,void 0,t(60834))),S=new n.TranslatedString("change area price source",o.t(null,void 0,t(4640))),b=new n.TranslatedString("change area line color",o.t(null,void 0,t(29605))),w=new n.TranslatedString("change area line visibility",o.t(null,void 0,t(27059))),P=new n.TranslatedString("change area line width",o.t(null,void 0,t(89346))),m=new n.TranslatedString("change area line style",o.t(null,void 0,t(56864))),T=new n.TranslatedString("change area fill color",o.t(null,void 0,t(29281))),D=new n.TranslatedString("change baseline price source",o.t(null,void 0,t(68609))),C=new n.TranslatedString("change baseline top line color",o.t(null,void 0,t(69044))),_=new n.TranslatedString("change baseline top line width",o.t(null,void 0,t(68197))),k=new n.TranslatedString("change baseline top line style",o.t(null,void 0,t(4425))),$=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))),W=new n.TranslatedString("change baseline bottom line style",o.t(null,void 0,t(85684))),L=new n.TranslatedString("change baseline fill top area color",o.t(null,void 0,t(92873))),V=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))),B=new n.TranslatedString("change high-low body color",o.t(null,void 0,t(6026))),E=new n.TranslatedString("change high-low borders visibility",o.t(null,void 0,t(15801))),x=new n.TranslatedString("change high-low border color",o.t(null,void 0,t(46844))),A=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)))),H=new n.TranslatedString("change {candleType} up color",o.t(null,void 0,t(36697))),R=new n.TranslatedString("change {candleType} down color",o.t(null,void 0,t(64571))),G=new n.TranslatedString("change {candleType} border visibility",o.t(null,void 0,t(11114))),U=new n.TranslatedString("change {candleType} up border color",o.t(null,void 0,t(17214))),j=new n.TranslatedString("change {candleType} down border color",o.t(null,void 0,t(20291))),z=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=new n.TranslatedString("change HLC bars color",o.t(null,void 0,t(21201))),Z=o.t(null,void 0,t(23111)),ee=o.t(null,void 0,t(886)),ie=o.t(null,void 0,t(23091)),te=o.t(null,void 0,t(23743)),oe=o.t(null,void 0,t(20215)),ne=o.t(null,void 0,t(74406)),re=o.t(null,void 0,t(333)),le=o.t(null,void 0,t(32163)),se=o.t(null,void 0,t(3554)),ae=o.t(null,void 0,t(89349)),ce=o.t(null,void 0,t(3159)),de=o.t(null,void 0,t(41129)),ue=o.t(null,void 0,t(61112)),pe=o.t(null,void 0,t(73185)),he=(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))),ye=o.t(null,void 0,t(74406)),fe=o.t(null,void 0,t(333)),ve=o.t(null,void 0,t(5119)),ge=o.t(null,void 0,t(56359)),Se=o.t(null,void 0,t(84831)),be=o.t(null,void 0,t(34579)),we=(o.t(null,void 0,t(92516)),o.t(null,void 0,t(27377)),o.t(null,void 0,t(45054)),o.t(null,void 0,t(27377)));function Pe(e,i,t,o){return(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.barColorsOnPrevClose,h)},{id:`${t}${o}`,title:Z})}function me(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,H.format({candleType:t})),color2:(0,r.getColorDefinitionProperty)(e,i.downColor,null,R.format({candleType:t}))},{id:`${o}Symbol${n}CandlesColor`,title:ne}),(0,r.createTwoColorsPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.drawBorder,G.format({candleType:t})),color1:(0,r.getColorDefinitionProperty)(e,i.borderUpColor,null,U.format({candleType:t})),color2:(0,r.getColorDefinitionProperty)(e,i.borderDownColor,null,j.format({candleType:t}))},{id:`${o}Symbol${n}BordersColor`,title:re}),(0,r.createTwoColorsPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.drawWick,z.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:le})]}function Te(e,i,d,h,N,H){switch(d){case 0:return function(e,i,t){return[Pe(e,i,t,"SymbolBarStyleBarColorsOnPrevClose"),(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.dontDrawOpen,y)},{id:`${t}SymbolDontDrawOpen`,title:ee}),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.upColor,null,f)},{id:`${t}SymbolUpColor`,title:ie}),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.downColor,null,v)},{id:`${t}SymbolDownColor`,title:te}),(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.thinBars,g)},{id:`${t}SymbolBarThinBars`,title:oe})].filter(a.isExistent)}(e,i.barStyle.childs(),N);case 1:case 19:return function(e,i,r){return[Pe(e,i,r,"SymbolCandleStyleBarColorsOnPrevClose"),...me(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(),N);case 2:const s=i.lineStyle.childs();return(0,u.lineStylePropertyDefinitions)(e,s,h.seriesPriceSources,N,H);case 14:const O=i.lineWithMarkersStyle.childs();return(0,u.lineStylePropertyDefinitions)(e,O,h.seriesPriceSources,N,H);case 15:const B=i.steplineStyle.childs();return(0,u.lineStylePropertyDefinitions)(e,B,h.seriesPriceSources,N,H);case 3:return function(e,i,t,o){return[(0,p.createPriceSourceDefinition)(e,i,t,o,"SymbolAreaPriceSource",S),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.linecolor,null,b),width:(0,r.convertToDefinitionProperty)(e,i.linewidth,P),style:(0,r.convertToDefinitionProperty)(e,i.linestyle,m)},{id:`${o}SymbolAreaLineStyle`,title:se}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.color1,i.transparency,T),color2:(0,r.getColorDefinitionProperty)(e,i.color2,i.transparency,T)},{id:`${o}SymbolAreaFills`,title:de})]}(e,i.areaStyle.childs(),h.seriesPriceSources,N);case 16:return function(e,i,t,o){return[(0,r.createLinePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.highLineVisible,w),color:(0,r.getColorDefinitionProperty)(e,i.highLineColor,null,b),width:(0,
r.convertToDefinitionProperty)(e,i.highLineWidth,P)},{id:`${o}SymbolHLCAreaHighLineStyle`,title:ge}),(0,r.createLinePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.lowLineVisible,w),color:(0,r.getColorDefinitionProperty)(e,i.lowLineColor,null,b),width:(0,r.convertToDefinitionProperty)(e,i.lowLineWidth,P)},{id:`${o}SymbolHLCAreaLowLineStyle`,title:be}),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.closeLineColor,null,b),width:(0,r.convertToDefinitionProperty)(e,i.closeLineWidth,P)},{id:`${o}SymbolHLCAreaCloseLineStyle`,title:Se}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.highCloseFillColor,null,T),color2:(0,r.getColorDefinitionProperty)(e,i.closeLowFillColor,null,T)},{id:`${o}SymbolHLCAreaFills`,title:de})]}(e,i.hlcAreaStyle.childs(),h.seriesPriceSources,N);case 9:return me(e,i.hollowCandleStyle.childs(),new n.TranslatedString("hollow candles",o.t(null,void 0,t(92598))),N);case 10:return function(e,i,t,o){return[(0,p.createPriceSourceDefinition)(e,i,t,o,"SymbolBaseLinePriceSource",D),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.topLineColor,null,C),width:(0,r.convertToDefinitionProperty)(e,i.topLineWidth,_),style:(0,r.convertToDefinitionProperty)(e,i.topLineStyle,k)},{id:`${o}SymbolBaseLineTopLine`,title:ae}),(0,r.createLinePropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.bottomLineColor,null,$),width:(0,r.convertToDefinitionProperty)(e,i.bottomLineWidth,M),style:(0,r.convertToDefinitionProperty)(e,i.bottomLineStyle,W)},{id:`${o}SymbolBaseLineBottomLine`,title:ce}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.topFillColor1,null,L),color2:(0,r.getColorDefinitionProperty)(e,i.topFillColor2,null,L)},{id:`${o}SymbolBaseLineTopFills`,title:ue}),(0,r.createTwoColorsPropertyDefinition)({color1:(0,r.getColorDefinitionProperty)(e,i.bottomFillColor1,null,V),color2:(0,r.getColorDefinitionProperty)(e,i.bottomFillColor2,null,V)},{id:`${o}SymbolBaseLineBottomFills`,title:pe}),(0,r.createNumberPropertyDefinition)({value:(0,r.convertToDefinitionProperty)(e,i.baseLevelPercentage,I,[c.floor])},{id:`${o}SymbolBaseLevelPercentage`,title:he,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(),h.seriesPriceSources,N);case 13:return function(e,i,t,o){return[(0,p.createPriceSourceDefinition)(e,i,t,o,"SymbolColumnPriceSource",X),Pe(e,i,o,"SymbolColumnStyleColumnColorsOnPrevClose"),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.upColor,null,K)},{id:`${o}SymbolUpColor`,title:ie}),(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.downColor,null,Q)},{id:`${o}SymbolDownColor`,title:te})].filter(a.isExistent)}(e,i.columnStyle.childs(),h.seriesPriceSources,N);case 21:return function(e,i,t){return[(0,r.createColorPropertyDefinition)({color:(0,r.getColorDefinitionProperty)(e,i.color,null,Y)},{id:`${t}SymbolColor`,
title:we}),(0,r.createCheckablePropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.thinBars,g)},{id:`${t}SymbolBarThinBars`,title:oe})].filter(a.isExistent)}(e,i.hlcBarsStyle.childs(),N)}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,B)},{id:`${t}SymbolBodiesColor`,title:ye}),(0,r.createColorPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.showBorders,E),color:(0,r.getColorDefinitionProperty)(e,i.borderColor,null,x)},{id:`${t}SymbolBorderColor`,title:fe}),(0,r.createTextPropertyDefinition)({checked:(0,r.convertToDefinitionProperty)(e,i.showLabels,A),color:(0,r.getColorDefinitionProperty)(e,i.labelColor,null,F)},{id:`${t}SymbolLabels`,title:ve,isEditable:!1,isMultiLine:!1})]}(e,i.hiloStyle.childs(),N)}if(!i.hasOwnProperty("haStyle"))return[];if(h.isJapaneseChartsAvailable&&8===d){return function(e,i,r){const l=[];return l.push(Pe(e,i,r,"SymbolHAStyleBarColorsOnPrevClose"),...me(e,i,new n.TranslatedString("Heikin Ashi",o.t(null,void 0,t(63876))),r)),l}(e,i.haStyle.childs(),N)}return h.isJapaneseChartsAvailable&&s.enabled("japanese_chart_styles"),[]}},37903:(e,i,t)=>{t.d(i,{SeriesPropertyDefinitionsViewModel:()=>G,seriesPrecisionValues:()=>R});var o=t(50151),n=t(9343),r=t(11542),l=t(95804),s=t(37103),a=t(95338),c=t(82095),d=t(22613),u=t(72972),p=t(95059),h=t(42258),y=t(3618),f=t(45838);const v=new l.TranslatedString("change {inputName} property",r.t(null,void 0,t(66110)));function g(e){return e.map((e=>({value:e,title:(0,y.getTranslatedInputTitle)(e)})))}const S=new Set(["percentageLTP"]);function b(e,i,t,n,r,s,c){const u=[];return t.forEach((t=>{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))}(t,n))return;const h=t.id;if(!n.hasOwnProperty(h))return;const b=n[h],w=function(e,i){return"style"===e.id?"Box size assignment method":"boxSize"===e.id?"Box size":i.childs().name.value()}(t,r[h]),P=(0,y.getTranslatedInputTitle)(w),m=new l.TranslatedString(w,P);if("options"in t){const i=(0,o.ensure)(t.options);u.push((0,a.createOptionsPropertyDefinition)({option:(0,a.convertToDefinitionProperty)(e,b,v.format({inputName:m}))},{id:`${c}${t.name}`,title:P,options:new d.WatchedValue(g(i))}))}else if("integer"!==t.type){if("float"===t.type){let o;return o=function(e,i){return!((i===(0,p.chartStyleStudyId)(4)||i===(0,p.chartStyleStudyId)(6))&&"boxSize"===e||i===(0,p.chartStyleStudyId)(5)&&"reversalAmount"===e)}(h,i)||null===s.value()?new d.WatchedValue(t.min):s,void u.push((0,a.createNumberPropertyDefinition)({value:(0,a.convertToDefinitionProperty)(e,b,v.format({inputName:m}))},{id:`${c}${t.name}`,title:P,type:1,min:o,max:new d.WatchedValue(t.max),unit:S.has(t.id)?new d.WatchedValue("%"):void 0,defval:t.defval}))}"text"!==t.type?"bool"!==t.type||u.push((0,a.createCheckablePropertyDefinition)({checked:(0,
a.convertToDefinitionProperty)(e,b,v.format({inputName:m}))},{id:`${c}${t.name}`,title:P})):u.push((0,a.createTextPropertyDefinition)({text:(0,a.convertToDefinitionProperty)(e,b,v.format({inputName:m}))},{id:`${c}${t.name}`,title:P,isEditable:!0,isMultiLine:!1}))}else u.push((0,a.createNumberPropertyDefinition)({value:(0,a.convertToDefinitionProperty)(e,b,v.format({inputName:m}),[f.floor])},{id:`${c}${t.name}`,title:P,type:0,min:new d.WatchedValue(t.min),max:new d.WatchedValue(t.max),unit:S.has(t.id)?new d.WatchedValue("%"):void 0,defval:t.defval}))})),u}var w=t(39058),P=t(67455),m=t(48943),T=t(95772),D=t(14032),C=t(44360);const _=(0,n.getLogger)("Chart.Definitions.Series"),k=s.enabled("pre_post_market_sessions"),$=new l.TranslatedString("change decimal places",r.t(null,void 0,t(82063))),M=new l.TranslatedString("change timezone",r.t(null,void 0,t(20137))),W=new l.TranslatedString("toggle inactivity gaps",r.t(null,void 0,t(18917))),L=(new l.TranslatedString("adjust data for dividends",r.t(null,void 0,t(18077))),new l.TranslatedString("use settlement as close on daily interval",r.t(null,void 0,t(92978))),new l.TranslatedString("adjust for contract changes",r.t(null,void 0,t(1433))),new l.TranslatedString("change session",r.t(null,void 0,t(87041)))),V=new l.TranslatedString("change extended hours color",r.t(null,void 0,t(45397))),I=new l.TranslatedString("change pre market color",r.t(null,void 0,t(44371))),O=new l.TranslatedString("change post market color",r.t(null,void 0,t(38730))),B=(new l.TranslatedString("change electronic trading hours",r.t(null,void 0,t(47393))),r.t(null,void 0,t(93020)),r.t(null,void 0,t(94031))),E=(r.t(null,void 0,t(68921)),r.t(null,void 0,t(49545)),r.t(null,void 0,t(88327))),x=(r.t(null,void 0,t(59777)),r.t(null,void 0,t(59766))),A=r.t(null,void 0,t(77073)),F=r.t(null,void 0,t(16564)),N=r.t(null,void 0,t(67036)),H=[{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 R(){const e=[{title:F,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 n=Math.log10(i[o].priceScale),l=0===n?r.t(null,void 0,t(47326)):r.t(null,{plural:"{value} decimals",count:n,replace:{value:n.toString()}},t(59644));e.push({title:l,value:`${i[o].priceScale},${i[o].minMove},${i[o].frac}`})}for(let i=0;i<H.length;i++)e.push({title:`${H[i].minMove}/${H[i].priceScale}`,value:`${H[i].priceScale},${H[i].minMove},${H[i].frac}`});return e}class G{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 d.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.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,a.destroyDefinitions)(e.definitions.value())})),this._series.onStyleChanged().unsubscribe(this,this._updateDefinitions),this._series.properties().childs().rangeStyle.childs().barStyle.unsubscribeAll(this),this._series.dataEvents().symbolResolved().unsubscribeAll(this),this._unsubscribeInputsUpdate(),this._isDestroyed=!0}propertyPages(){return null===this._propertyPages?this._getDefinitions().then((e=>{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 d.WatchedValue(e.definitions),visible:e.visible??new d.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 d.WatchedValue(this._seriesMinTick()):this._seriesMinTickWV.setValue(this._seriesMinTick())}_updateSessionIdOptionsWV(){if(!k)return;const e=this._series.symbolInfo();if(null===e)return;const i=(e.subsessions||[]).filter((e=>!e.private)).map((e=>({title:(0,T.translateSessionDescription)(e.description),value:e.id})));this._sessionIdOptionsWV.setValue(i)}_updateDefinitions(){null!==this._definitions&&(0,a.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(),n=this._series.getInputsInfoProperties(),l=e.style.value(),y=this._series.getStyleShortName(),f=c.chartStylesWithAttachedStudies.includes(l)?null:(0,p.chartStyleStudyId)(l)
;let v,g=null;if(null!==f){let e;try{e=await(0,u.studyMetaInfoRepository)().findById({type:"java",studyId:f});const t=(0,o.ensureNotNull)(this._seriesMinTickWV);g=b(this._undoModel,e.id,e.inputs,i,n,t,y),this._subscribeInputsUpdate(e.inputs,i)}catch(i){_.logWarn(`Find meta info for create series definitions with error - ${(0,w.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(c.chartStylesWithAttachedStudies.includes(l))throw new Error("unexpected chart style");{const i=(0,h.getSeriesStylePropertiesDefinitions)(this._undoModel,e,l,{seriesPriceSources:C.basePriceSources,isJapaneseChartsAvailable:true},"mainSeries",D.LineStylePropertyDefinitionsMode.Gradient);null!==g&&i.push(...g),v=(0,a.createPropertyDefinitionsGeneralGroup)(i,"generalSymbolStylesGroup",(0,p.getTranslatedChartStyleName)(l))}const S=(0,a.createOptionsPropertyDefinition)({option:(0,a.convertToDefinitionProperty)(this._undoModel,e.minTick,$),visible:(0,a.convertFromReadonlyWVToDefinitionProperty)(new d.WatchedValue(!0).ownership())},{id:`${y}SymbolMinTick`,title:x,options:new d.WatchedValue(R())}),P=(0,a.createOptionsPropertyDefinition)({option:(0,a.convertToDefinitionProperty)(this._undoModel,this._timezonePropertyObj.property,M)},{id:`${y}SymbolTimezone`,title:A,options:new d.WatchedValue(this._timezonePropertyObj.values)}),m=[...await this._seriesDataDefinitions(y),S,P];return s.enabled("inactivity_gaps")&&m.push((0,a.createCheckablePropertyDefinition)({checked:(0,a.convertToDefinitionProperty)(this._undoModel,this._undoModel.model().properties().childs().inactivityGaps,W)},{id:`${y}InactivityGap`,title:N})),this._definitions={definitions:[v,(0,a.createPropertyDefinitionsGeneralGroup)(m,"dataModififcationGroup",r.t(null,void 0,t(48225)))]},this._definitions}async _seriesDataDefinitions(e){const i=[];if(k){const t=this._series.sessionIdProxyProperty(),o=(0,m.combineWithFilteredUpdate)(((e,i)=>!i&&(0,p.symbolHasSeveralSessions)(this._series.symbolInfo())),((e,i)=>i||!e),this._series.symbolResolvingActive().weakReference(),(0,P.createWVFromProperty)(this._series.isDWMProperty()).ownership()),n=(0,a.createOptionsPropertyDefinition)({option:(0,a.convertToDefinitionProperty)(this._undoModel,t,L),visible:(0,a.convertFromReadonlyWVToDefinitionProperty)(o.ownership())},{id:"sessionId",title:B,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 s=await(l?this._createOutOfSessionDefinition(e):this._createPrePostMarketDefinition(e));i.push(s);const c=this._createElectronicSessionDefinition(e);c&&i.push(c)}return i}_createOutOfSessionDefinition(e){const i=this._model.sessions().properties().childs().sessionHighlight.childs().backgrounds.childs().outOfSession.childs();return(0,a.createColorPropertyDefinition)({color:(0,
a.getColorDefinitionProperty)(this._undoModel,i.color,i.transparency,V)},{id:`${e}SymbolExtendedHoursColors`,title:E})}_createPrePostMarketDefinition(e){const i=(0,P.createWVFromGetterAndSubscription)((()=>this._series.symbolInfo()),this._series.dataEvents().symbolResolved()),t=(0,m.combineWithFilteredUpdate)(((e,i)=>!e&&!!i&&(0,p.symbolHasPreOrPostMarket)(i)&&!(0,p.isRegularSessionId)(this._series.sessionIdProxyProperty().value(),i)),((e,i)=>e||!!i),(0,P.createWVFromProperty)(this._series.isDWMProperty()).ownership(),i.ownership()),o=this._model.sessions().properties().childs().sessionHighlight.childs(),n=o.backgrounds.childs().preMarket.childs(),r=o.backgrounds.childs().postMarket.childs();return(0,a.createTwoColorsPropertyDefinition)({color1:(0,a.getColorDefinitionProperty)(this._undoModel,n.color,n.transparency,I),color2:(0,a.getColorDefinitionProperty)(this._undoModel,r.color,r.transparency,O),visible:(0,a.convertFromReadonlyWVToDefinitionProperty)(t.ownership())},{id:`${e}SymbolExtendedHoursColors`,title:E})}_createElectronicSessionDefinition(e){return null}}}}]);