Release v31.0.0 (from 028f81fbf6fef55e9694e5df4bd5106cc04c188a)

This commit is contained in:
jenkins
2026-03-05 21:03:46 +00:00
committed by Edward Dewhurst
parent 6fe5436603
commit c8eebb69a4
3622 changed files with 7663 additions and 6956 deletions

View File

@@ -0,0 +1,11 @@
"use strict";(self.webpackChunktradingview=self.webpackChunktradingview||[]).push([[7723],{25740:(e,t,n)=>{var o;n.d(t,{ToolboxType:()=>o}),function(e){e[e.Delete=0]="Delete"}(o||(o={}))},82648:(e,t,n)=>{n.r(t),n.d(t,{ActionsProvider:()=>st,createActionCopyPrice:()=>ot,createActionOrder:()=>Xe,createActionToggleVisibilityDataSources:()=>rt,createActionTrade:()=>Ke,createChangeIntervalsVisibilitiesAction:()=>nt,createCreateOrderAction:()=>Qe,createDrawHorizontalLineAction:()=>lt,createLinesAction:()=>it,createPasteAction:()=>et,createSyncDrawingActions:()=>at,createVisualOrderAction:()=>tt});var o=n(85842),i=n(73775),a=(n(12745),n(7321)),r=n(91599),l=n(72445),s=n(16905),c=n(10308),d=n(13274),u=n(65366),h=n(62352),p=n(5003),g=(n(10156),n(23351)),S=(n(25740),n(16790)),m=n(25543),b=n(14650),v=n(49104),_=n(95786),w=n(25838),f=n(72769),I=(n(54951),n(97792)),A=n(34773),T=n(96532),y=n(47121),C=n(16570),W=n(22384),F=n(68317),E=n(70817),N=n(90232),P=n(37007);n(18816);(0,i.getLogger)("Chart.ActionsProvider");const x=new f.TranslatedString("change visibility",r.t(null,void 0,n(25187))),L=new f.TranslatedString("pin to scale {label}",r.t(null,void 0,n(66214))),M=new f.TranslatedString("pin to right scale",r.t(null,void 0,n(1831))),k=new f.TranslatedString("pin to left scale",r.t(null,void 0,n(61413))),O=(new f.TranslatedString("change earnings visibility",r.t(null,void 0,n(80195))),new f.TranslatedString("change dividends visibility",r.t(null,void 0,n(93010))),new f.TranslatedString("change splits visibility",r.t(null,void 0,n(77448))),new f.TranslatedString("change continuous contract switch visibility",r.t(null,void 0,n(86174))),new f.TranslatedString("change futures contract expiration visibility",r.t(null,void 0,n(6178))),new f.TranslatedString("change latest news and Minds visibility",r.t(null,void 0,n(52482))),new f.TranslatedString("show all ideas",r.t(null,void 0,n(31318)))),D=new f.TranslatedString("show ideas of followed users",r.t(null,void 0,n(53966))),U=new f.TranslatedString("show my ideas only",r.t(null,void 0,n(99036))),j=(new f.TranslatedString("change events visibility on chart",r.t(null,void 0,n(3235))),new f.TranslatedString("add this symbol to entire layout",r.t(null,void 0,n(90695)))),R=new f.TranslatedString("add this indicator to entire layout",r.t(null,void 0,n(13710))),V=(new f.TranslatedString("add this strategy to entire layout",r.t(null,void 0,n(64430))),new f.TranslatedString("add this financial metric to entire layout",r.t(null,void 0,n(35556))),
new f.TranslatedString("lock objects",r.t(null,void 0,n(26561)))),H=new f.TranslatedString("unlock objects",r.t(null,void 0,n(87923))),B=new f.TranslatedString("anchor objects",r.t(null,void 0,n(1027))),z=new f.TranslatedString("unanchor objects",r.t(null,void 0,n(31852))),q=new f.TranslatedString("change visibility at current interval and above",r.t(null,void 0,n(11623))),G=new f.TranslatedString("change visibility at current interval and below",r.t(null,void 0,n(28208))),$=new f.TranslatedString("change visibility at current interval",r.t(null,void 0,n(93124))),Y=new f.TranslatedString("change visibility at all intervals",r.t(null,void 0,n(19521))),Z=(r.t(null,void 0,n(30685)),(0,w.appendEllipsis)(r.t(null,void 0,n(10775))),r.t(null,void 0,n(97309))),J=r.t(null,void 0,n(69391)),K=r.t(null,void 0,n(29030)),Q=r.t(null,void 0,n(45708)),X=r.t(null,void 0,n(51952)),ee=r.t(null,void 0,n(67674)),te=r.t(null,void 0,n(56402)),ne=r.t(null,void 0,n(68899)),oe=r.t(null,void 0,n(14260)),ie=r.t(null,void 0,n(58469)),ae=r.t(null,void 0,n(6618)),re=r.t(null,void 0,n(63980)),le=r.t(null,void 0,n(87270)),se=r.t(null,void 0,n(9392)),ce=r.t(null,void 0,n(96456)),de=r.t(null,void 0,n(87645)),ue=r.t(null,void 0,n(27184)),he=r.t(null,void 0,n(33985)),pe=r.t(null,void 0,n(17142)),ge=r.t(null,void 0,n(44952)),Se=r.t(null,void 0,n(84314)),me=r.t(null,void 0,n(67217)),be=r.t(null,void 0,n(43932)),ve=r.t(null,void 0,n(21755)),_e=r.t(null,void 0,n(82770)),we=r.t(null,void 0,n(61580)),fe=r.t(null,void 0,n(592)),Ie=r.t(null,void 0,n(2560)),Ae=r.t(null,void 0,n(9536)),Te=r.t(null,void 0,n(27435)),ye=r.t(null,void 0,n(81298)),Ce=r.t(null,void 0,n(84460)),We=r.t(null,void 0,n(86655)),Fe=r.t(null,void 0,n(99608)),Ee=r.t(null,void 0,n(83696)),Ne=r.t(null,void 0,n(2681)),Pe=r.t(null,void 0,n(99758)),xe=((0,w.appendEllipsis)(r.t(null,void 0,n(36151))),(0,w.appendEllipsis)(r.t(null,void 0,n(91297))),(0,w.appendEllipsis)(r.t(null,void 0,n(30586)))),Le=(r.t(null,void 0,n(16066)),(0,w.appendEllipsis)(r.t(null,void 0,n(84741))),r.t(null,void 0,n(29214))),Me=r.t(null,void 0,n(20582)),ke=(r.t(null,void 0,n(15256)),r.t(null,void 0,n(16006))),Oe=r.t(null,void 0,n(71160)),De=r.t(null,void 0,n(29307)),Ue=r.t(null,void 0,n(20534)),je=(r.t(null,void 0,n(45466)),r.t(null,void 0,n(33024)),r.t(null,void 0,n(79650)),r.t(null,void 0,n(14921)),r.t(null,void 0,n(67632)),r.t(null,void 0,n(81737)),r.t(null,void 0,n(27096))),Re=r.t(null,void 0,n(39376)),Ve=r.t(null,void 0,n(90590)),He=((0,w.appendEllipsis)(r.t(null,void 0,n(30586))),r.t(null,void 0,n(19265)),r.t(null,void 0,n(4271))),Be=r.t(null,void 0,n(66150)),ze=(r.t(null,void 0,n(61910)),r.t(null,void 0,n(2316)),r.t(null,void 0,n(54236)),r.t(null,void 0,n(39936)),r.t(null,void 0,n(74208)),(0,w.appendEllipsis)(r.t(null,void 0,n(9299)))),qe=(0,w.appendEllipsis)(r.t(null,void 0,n(40560))),Ge=r.t(null,void 0,n(97011)),$e=r.t(null,void 0,n(2052)),Ye=r.t(null,void 0,n(83463)),Ze=r.t(null,void 0,n(24307)),Je=(r.t(null,void 0,n(84284)),r.t(null,void 0,n(55347)),!l.mobiletouch);async function Ke(e,t,n){return null}
async function Qe(e){e.model();return null}function Xe(e){throw new Error("not supported")}function et(e,t){return!t.isEmpty()&&(0,s.isFeaturesetEnabled)("datasource_copypaste")?new E.ActionWithStandardIcon({actionId:"Chart.Clipboard.PasteSource",options:{label:Ge.trim(),shortcutHint:(0,g.humanReadableHash)(g.Modifiers.Mod+86),statName:"Paste",onExecute:()=>e.chartWidgetCollection().clipboard.uiRequestPaste(t)}}):null}function tt(e,t){const n=e.model(),o=n.availableZOrderOperations(t),i=[new E.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringToFront",options:{label:fe,statName:"BringToFront",disabled:!o.bringToFrontEnabled,onExecute:()=>n.bringToFront(t)}}),new E.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendToBack",options:{label:Ie,statName:"SendToBack",disabled:!o.sendToBackEnabled,onExecute:()=>n.sendToBack(t)}}),new E.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.BringForward",options:{label:Ae,statName:"BringForward",disabled:!o.bringForwardEnabled,onExecute:()=>n.bringForward(t)}}),new E.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder.SendBackward",options:{label:Te,statName:"SendBackward",disabled:!o.sendBackwardEnabled,onExecute:()=>n.sendBackward(t)}})];return new E.ActionWithStandardIcon({actionId:"Chart.Source.VisualOrder",options:{label:ye,iconId:"Chart.VisualOrder",statName:"VisualOrder",subItems:i}})}function nt(e,t){const n=e.model(),o=(e,o)=>{const i=I.Interval.parse(n.mainSeries().interval()),a=(0,T.getIntervalsVisibilitiesForMode)(i,e),r=[],l=[];t.forEach((e=>{const t=e.properties().intervalsVisibilities.childs();r.push(t.ticks),l.push(a.ticks),r.push(t.seconds),l.push(a.seconds),r.push(t.secondsFrom),l.push(a.secondsFrom),r.push(t.secondsTo),l.push(a.secondsTo),r.push(t.minutes),l.push(a.minutes),r.push(t.minutesFrom),l.push(a.minutesFrom),r.push(t.minutesTo),l.push(a.minutesTo),r.push(t.hours),l.push(a.hours),r.push(t.hoursFrom),l.push(a.hoursFrom),r.push(t.hoursTo),l.push(a.hoursTo),r.push(t.days),l.push(a.days),r.push(t.daysFrom),l.push(a.daysFrom),r.push(t.daysTo),l.push(a.daysTo),r.push(t.weeks),l.push(a.weeks),r.push(t.weeksFrom),l.push(a.weeksFrom),r.push(t.weeksTo),l.push(a.weeksTo),r.push(t.months),l.push(a.months),r.push(t.monthsFrom),l.push(a.monthsFrom),r.push(t.monthsTo),l.push(a.monthsTo),r.push(t.ranges),l.push(a.ranges)})),n.setProperties(r,l,o,(0,F.sourcesAffectState)(t))},i=[new E.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndAbove",options:{label:We,statName:"currentAndAboveIntervals",onExecute:()=>o(3,q)}}),new E.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.CurrentAndBelow",options:{label:Fe,statName:"currentAndBelowIntervals",onExecute:()=>o(2,G)}}),new E.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.Current",options:{label:Ee,statName:"currentInterval",onExecute:()=>o(1,$)}}),new E.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility.All",options:{label:Ne,statName:"allIntervals",onExecute:()=>o(0,Y)}})]
;return new E.ActionWithStandardIcon({actionId:"Chart.Source.IntervalsVisibility",options:{label:Ce,statName:"IntervalsVisibility",subItems:i}})}function ot(e,t){const n=e.defaultPriceScale(),o=void 0!==t?n.coordinateToPrice(t,e.mainDataSource()?.firstValue()??0):e.model().mainSeries().lastValueData(4,!0,!0).price,i=e.mainDataSource()?.formatter();if(void 0===o||!i)return null;const a=i.format(o),r=i.format(o,{ignoreLocaleNumberFormat:!0,noExponentialForm:!0});return new E.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopyPrice",options:{label:`${$e} ${a}`,statName:"CopyPrice",onExecute:()=>(0,y.getClipboard)().writeText(r)}})}function it(e){const t=e.actions(),n=[t.showPriceLine];return n.push(t.showHighLowPriceLines),(0,s.isFeaturesetEnabled)("show_average_close_price_line_and_label")&&n.push(t.showAverageClosePriceLine),new E.ActionWithStandardIcon({actionId:"Chart.Lines",options:{label:Pe,statName:"Lines",subItems:n}})}function at(e,t){return[]}function rt(e,t){const n=t[0].properties().visible.value(),o=n?J:Z,i=n?"Chart.Hide":"Chart.ShowObject",a=n?"Chart.SelectedObject.Hide":"Chart.SelectedObject.Show";return new E.ActionWithStandardIcon({actionId:a,options:{checkable:!0,statName:"ToggleVisibilitySelectedObject",label:o,iconId:i,onExecute:()=>{const o=e.model();o.withMacro(x,(()=>{t.forEach((e=>{o.setProperty(e.properties().visible,!n,x,A.lineToolsDoNotAffectChartInvalidation&&(0,v.isLineTool)(e))}))}))}}})}function lt(e,t,i){let a;if(i)a=i.price;else{const n=e.crosshairSource();a=e.model().magnet().align(n.price,n.index,t)}const l=(0,o.ensureNotNull)(t.mainDataSource()).formatter().format(a);return new E.ActionWithStandardIcon({actionId:"Chart.Crosshair.PlusButton.DrawHorizontalLine",options:{label:r.t(null,{replace:{price:l}},n(65462)),statName:"DrawHorizontalLineAtPrice",iconId:"Chart.AddHorzLine",shortcutHint:(0,g.humanReadableHash)(g.Modifiers.Alt+72),onExecute:async()=>{await(0,N.ensureLineToolLoaded)("LineToolHorzLine"),e.drawRightThere("LineToolHorzLine",t,i,"ContextMenu")}}})}class st{constructor(e,t){this._chartWidget=e,this._options=(0,a.merge)((0,a.clone)(P.defaultChartWidgetActionsOptions),t||{})}async contextMenuActionsForSources(e,t,n,i,a){const r=e[0],l=this._options,s=[];if(r===this._chartWidget.model().mainSeries()&&l.mainSeries)s.push(...await this._contextMenuActionsForSeries(r,n));else if((0,h.isStudy)(r)&&l.studies)s.push(...await this._contextMenuActionsForStudy(r,(0,o.ensureDefined)(t),n));else if((0,v.isLineTool)(r)&&l.lineTools){const t=e.filter(v.isLineTool);s.push(...await this._contextMenuActionsForLineTool(t))}else 0;return s.length&&a?.length&&s.push(new c.Separator),s.push(...a??[]),s}async actionForLineTools(e,t){switch(t){case"Chart.SelectedObject.ToggleAnchored":return this._createActionToggleAnchorLineTools(e);case"Chart.SelectedObject.InsertRowTable":{if(1!==e.length)return null;const t=e[0];return((await(t.additionalActions?.(this._chartWidget.model())))?.actions??[]).filter((e=>"action"===e.type&&"Chart.SelectedObject.InsertRowTable"===e.getState().actionId))[0]??null}
case"Chart.SelectedObject.InsertColumnTable":{if(1!==e.length)return null;const t=e[0];return((await(t.additionalActions?.(this._chartWidget.model())))?.actions??[]).filter((e=>"action"===e.type&&"Chart.SelectedObject.InsertColumnTable"===e.getState().actionId))[0]??null}}throw new Error(`Unsupported actionId: ${t}`)}_isReadOnly(){return this._chartWidget.readOnly()}_createActionScale(e){const t=(0,o.ensureNotNull)(e.priceScale()),n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(e)),a=i.priceScalePosition(t),r=("left"===a?i.leftPriceScales():i.rightPriceScales()).indexOf(t),l=n.priceScaleSlotsCount().totallySlots<2?"dontneedname":"needname",s="overlay"===a?"":(0,d.getPriceAxisNameInfo)(a,r).label,c=ue.format({label:s}),u={"left-needname":c,"left-dontneedname":pe,"right-needname":c,"right-dontneedname":ge,"overlay-needname":he,"overlay-dontneedname":he}[a+"-"+l];return new E.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{label:u,iconId:"Chart.PriceScale",subItems:this._createActionScaleItems(e)}})}_createActionResetInputPoints(e){const t=e.metaInfo(),o=t.inputs.filter(C.isTimeOrPriceNotHiddenInput);return 0===o.length?null:new E.ActionWithStandardIcon({actionId:"Chart.Source.ResetInputPoints",options:{label:qe,onExecute:async()=>{let i;try{const a=e.properties().childs().inputs.state();for(const e of Object.keys(a))o.find((t=>t.id===e))||delete a[e];const r=new W.Property({inputs:a}),l=await Promise.all([n.e(5095),n.e(3159),n.e(4219),n.e(7356),n.e(3946),n.e(7039),n.e(2593),n.e(6651),n.e(9389),n.e(162),n.e(5578),n.e(779),n.e(5715),n.e(8378),n.e(8566),n.e(9437),n.e(4500),n.e(6868),n.e(5043),n.e(4551),n.e(7351),n.e(7839),n.e(9921),n.e(5921),n.e(5868),n.e(5211),n.e(7649),n.e(6266),n.e(4853),n.e(3819),n.e(2414),n.e(3827),n.e(2735),n.e(701),n.e(9365),n.e(2961),n.e(5088),n.e(9510),n.e(7107),n.e(5343),n.e(3895),n.e(294),n.e(3039)]).then(n.bind(n,97593));i=(await l.selectInputValuesOnChart(this._chartWidget,o,r,t.shortDescription,t.inputs)).customSourceId,e.properties().mergeAndFire(r.state())}finally{void 0!==i&&this._chartWidget.model().model().removeCustomSource(i)}}}})}_createActionLayoutChartsSync(){return new LayoutChartsSyncContextMenuAction(this._chartWidget.linkingGroupIndex().readonly(),(e=>this._chartWidget.model().setLinkingGroupIndex(e)))}_createActionScaleDetach(e,t,n,i){const a=this._chartWidget.model().model(),r=(0,o.ensureNotNull)(a.paneForSource(e));if(!r.canCreateNewPriceScale())return null;const l=(0,o.ensureNotNull)(e.priceScale()),s=l.canDetachSource(e),c=r.priceScalePosition(l),u=s||c!==t;if(!u)return null;const h=a.priceScaleSlotsCount(),p={left:{labelled:oe,sided:ce},right:{labelled:oe,sided:de}},g="left"===t?r.leftPriceScales().length:r.rightPriceScales().length,S=h[t]>g?"labelled":"sided",m=(0,d.getPriceAxisNameInfo)(t,g).label,b=p[t][S].format({label:m});return new E.ActionWithStandardIcon({actionId:"Chart.Source.ChangePriceScale",options:{checkable:!1,disabled:!u,label:b,statName:i,payload:e,onExecute:n}})}_onDetachLeft(e){
const t=e.getPayload(),n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t));this._chartWidget.model().detachToLeft(t,i)}_onDetachRight(e){const t=e.getPayload(),n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t));this._chartWidget.model().detachToRight(t,i)}_createActionScaleDetachLeft(e){return this._createActionScaleDetach(e,"left",this._onDetachLeft.bind(this),"ToggleScaleLeft")}_createActionScaleDetachRight(e){return this._createActionScaleDetach(e,"right",this._onDetachRight.bind(this),"ToggleScaleRight")}_onMoveToScale(e){const t=e.getPayload();if(t.datasource.priceScale()===t.priceScale)return;const n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t.datasource));this._chartWidget.model().moveToScale(t.datasource,i,t.priceScale,t.undoText)}_createMoveToScaleAction(e,t,n,o){const i=e.priceScale()===t;return new E.ActionWithStandardIcon({actionId:"Chart.Source.MoveToOtherScale",options:{checkable:!0,checked:i,label:n,statName:"ToggleScale",payload:{datasource:e,priceScale:t,undoText:o},onExecute:this._onMoveToScale.bind(this)}})}_onNoScale(e){const t=e.getPayload().datasource,n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(t));i.isOverlay(t)||this._chartWidget.model().detachNoScale(t,i)}_createActionNoScale(e){const t=this._chartWidget.model().model(),n=(0,o.ensureNotNull)(t.paneForSource(e)),i=n.actionNoScaleIsEnabled(e);return new E.ActionWithStandardIcon({actionId:"Chart.Source.MoveToNoScale",options:{checkable:!0,checked:n.isOverlay(e),label:Se,disabled:!i,statName:"ToggleNoScale",payload:{datasource:e},onExecute:this._onNoScale.bind(this)}})}_createActionScaleItems(e){const t=[],n=this._chartWidget.model().model(),i=(0,o.ensureNotNull)(n.paneForSource(e)),a=n.priceScaleSlotsCount().totallySlots>1,r=i.rightPriceScales(),l=i.leftPriceScales(),s=this._createActionScaleDetachRight(e),u=this._createActionScaleDetachLeft(e),h=r.length+l.length+(null===s?0:1)+(null===u?0:1)>2,p={right:{hidden:{checked:{labelled:K,sided:Q},unchecked:{labelled:X,sided:ee}},visible:{checked:{labelled:te,sided:ne},unchecked:{labelled:oe,sided:ie}}},left:{hidden:{checked:{labelled:K,sided:ae},unchecked:{labelled:X,sided:re}},visible:{checked:{labelled:te,sided:le},unchecked:{labelled:oe,sided:se}}}},g={right:M,left:k},S={left:i.visibleLeftPriceScales(),right:i.visibleRightPriceScales()},m=(t,n)=>{const o=("right"===n?r:l)[t],i=S[n].includes(o)?"visible":"hidden",s=e.priceScale()===o?"checked":"unchecked",c=a?"labelled":"sided",u=p[n],h=(0,d.getPriceAxisNameInfo)(n,t).label;return{actionText:u[i][s][c].format({label:h}),undoText:a?L.format({label:h}):g[n]}};t.push(...r.map(((t,n)=>{const o=m(n,"right");return this._createMoveToScaleAction(e,t,o.actionText,o.undoText)}))),null!==s&&t.push(s);h&&(r.length>0||null!==s)&&t.push(new c.Separator);t.push(...l.map(((t,n)=>{const o=m(n,"left");return this._createMoveToScaleAction(e,t,o.actionText,o.undoText)}))),null!==u&&t.push(u);h&&(l.length>0||null!==u)&&t.push(new c.Separator)
;return t.push(this._createActionNoScale(e)),t}_createActionMergeUp(e){const t=this._chartWidget.model();return t.model().isMergeUpAvailableForSource(e)?new E.ActionWithStandardIcon({actionId:"Chart.Source.MergeUp",options:{label:be,statName:"MergeUp",onExecute:()=>t.mergeSourceUp(e)}}):null}_createActionUnmergeUp(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new E.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeUp",options:{label:ve,statName:"UnmergeUp",onExecute:()=>t.unmergeSourceUp(e)}}):null}_createActionMergeDown(e){const t=this._chartWidget.model();return t.model().isMergeDownAvailableForSource(e)?new E.ActionWithStandardIcon({actionId:"Chart.Source.MergeDown",options:{label:_e,statName:"MergeDown",onExecute:()=>t.mergeSourceDown(e)}}):null}_createActionUnmergeDown(e){const t=this._chartWidget.model();return t.model().isUnmergeAvailableForSource(e)?new E.ActionWithStandardIcon({actionId:"Chart.Source.UnmergeDown",options:{label:we,statName:"UnmergeDown",onExecute:()=>t.unmergeSourceDown(e)}}):null}_mergeContentMenuItems(e){return[this._createActionMergeUp(e),this._createActionUnmergeUp(e),this._createActionMergeDown(e),this._createActionUnmergeDown(e)].filter(a.notNull)}_createActionMove(e){const t=this._mergeContentMenuItems(e);return t.length>0?new E.ActionWithStandardIcon({actionId:"Chart.Source.MoveToPane",options:{label:me,iconId:"Chart.Move",subItems:t}}):null}async _createDetailsMetricsAction(e){return null}async _contextMenuActionsForSeries(e,t){const n=[],i=this._chartWidget.model().model(),a=(0,o.ensureNotNull)(i.paneForSource(e)),r=this._chartWidget.actions(),l=t&&"localY"in t?t.localY:void 0;if(this._isReadOnly())n.push(rt(this._chartWidget,[e])),n.push(new c.Separator),n.push(this._createActionScale(e));else{0,n.length>0&&!(n[n.length-1]instanceof c.Separator)&&n.push(new c.Separator),(0,s.isFeaturesetEnabled)("symbol_info")&&n.push(r.showSymbolInfoDialog);const t=await this._createDetailsMetricsAction(e);if(t&&n.push(t),n.length>0&&!(n[n.length-1]instanceof c.Separator)&&n.push(new c.Separator),!a.isEmpty()&&(0,s.isFeaturesetEnabled)("datasource_copypaste")){const e=ot(a,l),t=et(this._chartWidget,a);(e||t)&&(e&&n.push(e),t&&n.push(t),n.push(new c.Separator))}Je&&r.openTableView&&(n.length>0&&!(n[n.length-1]instanceof c.Separator)&&n.push(new c.Separator),n.push(r.openTableView),n.push(new c.Separator)),n.push(tt(this._chartWidget,[e]));const o=this._createActionMove(e);null!==o&&n.push(o),n.push(this._createActionScale(e)),n.push(rt(this._chartWidget,[e])),n.push(new c.Separator),r.addToWatchlist&&(r.addToWatchlist.prepare(),n.push(r.addToWatchlist)),(0,s.isFeaturesetEnabled)("text_notes")&&n.push(r.addToTextNotes),n[n.length-1]instanceof c.Separator||n.push(new c.Separator),(0,s.isFeaturesetEnabled)("show_chart_property_page")&&!this._chartWidget.onWidget()&&n.push(r.mainSeriesPropertiesAction),n[n.length-1]instanceof c.Separator&&n.pop()}return n}_createActionAddChildStudy(e){throw new Error("unsupported")}_createActionAddFundamentals(e){return null}
_createActionShowSymbolInfoDialog(e,t){const n=this._chartWidget.model().model();return new E.ActionWithStandardIcon({actionId:"Chart.Dialogs.ShowSymbolInfo",options:{label:ze,iconId:"Chart.SymbolInfo",checkable:!1,statName:"SymbolInfo",onExecute:()=>{const o={symbolInfo:e.symbolInfo(),unitDescription:e=>e?t.description(e):"",dateFormatter:n.dateFormatter()};(0,m.showSymbolInfoDialog)(o)}}})}_createActionShowProperties(e){return new E.ActionWithStandardIcon({actionId:"Chart.Indicator.ShowSettingsDialog",options:{label:xe,iconId:"Settings",statName:"EditSelectedObject",onExecute:()=>this._chartWidget.showSourceProperties(e)}})}async _contextMenuActionsForStudy(e,t,n){const o=t!==this._chartWidget.model().paneForSource(e),i=this._chartWidget.actions(),a=(n&&"localY"in n&&n.localY,[]);if(!e.userEditEnabled())return a;if(this._chartWidget.readOnly())a.push(rt(this._chartWidget,[e])),a.push(new c.Separator),e.isLinkedToSeries()||a.push(this._createActionScale(e));else{0,(0,s.isFeaturesetEnabled)("study_on_study")&&e.canHaveChildren()&&a.push(this._createActionAddChildStudy(e));const t=this._createApplyToEntireLayoutCommand(e);null!==t&&a.push(t);const n=this._createAddIndicatorToFavoritesCommand(e);if(n&&a.push(n),a.length>0&&!(a[a.length-1]instanceof c.Separator)&&a.push(new c.Separator),(0,s.isFeaturesetEnabled)("symbol_info")&&(0,h.isCompareOrOverlayStudy)(e)&&null!==e.symbolInfo()&&(a.push(this._createActionShowSymbolInfoDialog(e,this._chartWidget.model().model().availableUnits())),a.push(new c.Separator)),o||a.push(tt(this._chartWidget,[e])),a.push(nt(this._chartWidget,[e])),!e.isLinkedToSeries()&&!o){const t=this._createActionMove(e);null!==t&&a.push(t),a.push(this._createActionScale(e))}a.push(new c.Separator);const r=e.metaInfo();if(e.copiable()){const t=new E.ActionWithStandardIcon({actionId:"Chart.Clipboard.CopySource",options:{label:Le,shortcutHint:(0,g.humanReadableHash)(g.Modifiers.Mod+67),statName:"Copy",onExecute:()=>{this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy([e])}}});a.push(t)}a.push(rt(this._chartWidget,[e])),a.push(i.studyRemove);this._options.objectTree&&i.paneObjectTree&&a.push(new c.Separator,i.paneObjectTree),(0,s.isFeaturesetEnabled)("property_pages")&&new p.MetaInfoHelper(r).hasUserEditableOptions()&&a.push(new c.Separator,this._createActionShowProperties(e)),a[a.length-1]instanceof c.Separator&&a.pop()}return a}_createLineToolTemplateAction(e){return e.length,null}_createActionToggleLockLineTools(e){const t=e[0].properties().frozen.value(),n=t?Oe:De;return new E.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleLocked",options:{label:n,statName:"ToggleLockSelectedObject",checkable:!0,iconId:t?"Chart.UnlockObject":"Chart.LockObject",onExecute:()=>{if(1===e.length)this._chartWidget.toggleLockSelectedObject();else{const n=t?H:V,o=this._chartWidget.model();o.withMacro(n,(()=>{e.forEach((e=>{o.setProperty(e.properties().frozen,!t,n,A.lineToolsDoNotAffectChartInvalidation)}))}))}}}})}_createActionToggleAnchorLineTools(e){const t=e.filter((e=>e.anchorable()))
;if(0===t.length)return null;const n=t[0].properties().anchored.value();return new E.ActionWithStandardIcon({actionId:"Chart.SelectedObject.ToggleAnchored",options:{label:Ue,statName:"ToggleAnchoredSelectedObject",checkable:!0,checked:n,onExecute:()=>{const e=n?z:B,o=this._chartWidget.model();o.withMacro(e,(()=>{t.forEach((t=>{o.setProperty(t.properties().childs().anchored,!n,e,A.lineToolsDoNotAffectChartInvalidation)}))}))}}})}async _contextMenuActionsForLineTool(e){const t=[],n=this._chartWidget.actions(),o=()=>{t.push(tt(this._chartWidget,e))},i=()=>{t.push(nt(this._chartWidget,e))},a=()=>{const n=e.filter((e=>e.cloneable()));if(n.length>0){const e=new E.ActionWithStandardIcon({actionId:"Chart.LineTool.Clone",options:{label:Me,iconId:"Chart.Clone",shortcutHint:(0,g.humanReadableModifiers)(g.Modifiers.Mod)+"Drag",statName:"Clone",onExecute:()=>this._chartWidget.model().cloneLineTools(n,!1)},id:"Clone"});t.push(e)}return!!n.length},r=()=>{const n=e.filter((e=>e.copiable()));if(n.length>0){const e=new c.Action({actionId:"Chart.Clipboard.CopyLineTools",options:{label:Le,shortcutHint:(0,g.humanReadableHash)(g.Modifiers.Mod+67),statName:"Copy",onExecute:()=>this._chartWidget.chartWidgetCollection().clipboard.uiRequestCopy(n)},id:"Copy"});t.push(e)}return!!n.length},l=()=>{const e=(this._chartWidget,[]);return t.push(...e),e.length>0},d=e=>{const n=new E.ActionWithStandardIcon({actionId:"Chart.ScrollToLineTool",options:{label:ke.format({lineToolName:e.title(u.TitleDisplayTarget.StatusLine)}),statName:"GoToLineTool",checkable:!1,onExecute:async()=>this._chartWidget.model().scrollToLineTool(e)}});t.push(n)},h=e=>{const t=this._chartWidget.model().model().lineToolsGroupModel(),n=e.map((e=>t.groupForLineTool(e)));return new Set(n).size<=1};if(1===e.length){const u=e[0];let h={actions:[],placement:"CustomAction"};if(u.additionalActions&&(h=await u.additionalActions(this._chartWidget.model())),h.actions.length>0&&"BeforeAll"===h.placement&&(t.push(...h.actions),t.push(new c.Separator)),this._chartWidget.readOnly())t.push(rt(this._chartWidget,[u]));else if(u.userEditEnabled()){0,o(),i(),this._options.objectTree&&n.paneObjectTree&&t.push(n.paneObjectTree),t.push(new c.Separator);let e=a();e=r()||e,e&&t.push(new c.Separator),e=l(),e&&t.push(new c.Separator),h.actions.length>0&&"CustomAction"===h.placement&&(t.push(...h.actions),t.push(new c.Separator));const p=this._createActionToggleAnchorLineTools([u]);p&&(t.push(p),t.push(new c.Separator)),t.push(this._createActionToggleLockLineTools([u])),t.push(rt(this._chartWidget,[u])),t.push(n.lineRemove),u.points().length>0&&this._options.gotoLineTool&&(t.push(new c.Separator),d(u));const g=await this._chartWidget.propertiesDefinitionsForSource(u);(0,s.isFeaturesetEnabled)("property_pages")&&null!==g&&(t.push(new c.Separator),t.push(n.format))}}else{const d=this._createLineToolTemplateAction(e);null!==d&&t.push(d),this._options.objectTree&&n.paneObjectTree&&t.push(n.paneObjectTree),h(e)&&o(),i(),t.length>0&&t.push(new c.Separator);let u=a();u=r()||u,u&&t.push(new c.Separator),u=l(),
u&&t.push(new c.Separator),t.push(this._createActionToggleLockLineTools(e)),t.push(rt(this._chartWidget,e)),t.push(n.lineRemove),(0,s.isFeaturesetEnabled)("property_pages")&&(t.push(new c.Separator),t.push(n.format))}return t}_createEarningsShow(){return null}_createDividendsShow(){return null}_createSplitsShow(){return null}_contextMenuActionsForESD(){return[]}_contextMenuActionsForRollDates(){return[]}_contextMenuActionsForFuturesContractExpiration(){return[]}_contextMenuActionsForisLatestUpdates(){return[]}_contextMenuActionsForPublishedTimeline(e){const t=this._chartWidget.actions(),n=[];if(n.push(t.lineHide),window.is_authenticated){const t=e.properties().childs().filter,o=new c.Action({actionId:"Chart.ShowAllIdeas",options:{checked:t.value()===PublishedChartsFilter.None,checkable:!0,label:je,name:"ToggleAllIdeas",statName:"ToggleAllIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.None,O)}}),i=new c.Action({actionId:"Chart.ShowIdeasOfFollowedUsers",options:{checked:t.value()===PublishedChartsFilter.Following,checkable:!0,label:Re,name:"ToggleIdeasOfPeopleAndUser",statName:"ToggleIdeasOfPeopleAndUser",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Following,D)}}),a=new c.Action({actionId:"Chart.ShowMyIdeasOnly",options:{checked:t.value()===PublishedChartsFilter.Private,checkable:!0,label:Ve,name:"ToggleUserIdeas",statName:"ToggleUserIdeas",onExecute:()=>this._chartWidget.model().setProperty(t,PublishedChartsFilter.Private,U)}});n.push(new c.Separator,o,i,a)}return n}_contextMenuActionsForTradingDrawings(e){return e.contextMenuItems()}async _contextMenuActionsForAlertLabel(e,t){return[]}_contextMenuActionsForChartEvents(e){return[]}_createApplyToEntireLayoutCommand(e){if(!this._chartWidget.chartWidgetCollection().applyIndicatorsToAllChartsAvailable())return null;const t=this._chartWidget.model().model();if(e.parentSources().length>0)return null;const n=(0,o.ensureNotNull)(t.paneForSource(e)),i=t.paneForSource(t.mainSeries())===n,a=e instanceof S.StudyCompare&&e.priceScale()===t.mainSeries().priceScale()&&(0,o.ensureNotNull)(e.priceScale()).isPercentage(),r=i?void 0:t.panes().indexOf(n);let l=Be,s=R,d="AddStudyToEntireLayout";return(0,_.isActingAsSymbolSource)(e)&&(l=He,s=j,d="AddSymbolToEntireLayout"),new c.Action({actionId:"Chart.AddIndicatorToAllCharts",options:{label:l,statName:d,onExecute:()=>{const n=(0,o.ensureNotNull)((0,b.clipboardDataForSources)(t.id(),[e])),l=this._chartWidget.chartWidgetCollection(),c={isOnMainPane:i,asCompare:a,paneIndex:r};l.applyIndicatorToAllCharts(this._chartWidget,n,c,s)}},id:"applyStudyToEntireLayout"})}_createAddIndicatorToFavoritesCommand(e){const t=e.metaInfo();let o;if(!(0,s.isFeaturesetEnabled)("items_favoriting")||(0,h.isCompareOrOverlayStudy)(e))return null;{const{description_localized:e,description:i}=t,a=e||r.t(i,{context:"study"},n(84693));o=()=>n.e(5922).then(n.bind(n,67985)).then((({isFavorite:e,toggleFavorite:t})=>({label:e(a)?Ze:Ye,onExecute:()=>t(a)})))}return new E.ActionWithStandardIcon({
actionId:"Chart.Indicator.AddFavorites",id:"addIndicatorToFavorites",optionsLoader:o,options:{statName:"AddIndicatorToFavorites",iconId:"Indicator.AddToFavorites"}})}}},20714:(e,t,n)=>{n.d(t,{isCustomStudy:()=>i});const o={VbPFixed:!0,PivotPointsStandard:!0,VbPVisible:!0,VbPAnchored:!0};function i(e){return e in o}},5003:(e,t,n)=>{n.d(t,{MetaInfoHelper:()=>h});var o=n(85842),i=n(73775),a=n(6620),r=n(65164),l=n(7321),s=n(16570);function c(e){return!e.groupId&&!e.isHidden&&e.id!==s.RangeDependentStudyInputNames.FirstBar&&e.id!==s.RangeDependentStudyInputNames.LastBar}var d=n(20714);const u=(0,i.getLogger)("Platform.GUI.PropertyDialog.Indicators.MetaInfo");class h{constructor(e){this._metaInfo=e}hasUserEditableInputs(){return this._metaInfo.inputs.some(c)}getUserEditableInputs(){return this._metaInfo.inputs.filter(c)}hasUserEditableProperties(){return a.StudyMetaInfo.isScriptStrategy(this._metaInfo)}hasUserEditableStyles(){const e=this._metaInfo;return e.plots.length>0||void 0!==e.bands||void 0!==e.filledAreas||(0,d.isCustomStudy)(e.shortId)||a.StudyMetaInfo.isScriptStrategy(this._metaInfo)||Object.values(e.graphics).some((e=>void 0!==e))}getUserEditablePlots(){const e=new Set,t=this._metaInfo;return t.plots.filter((n=>{if((0,r.isColorerPlot)(n)||(0,r.isTextColorerPlot)(n)||(0,r.isDataOffsetPlot)(n)||(0,r.isOhlcColorerPlot)(n)||(0,r.isAlertConditionPlot)(n)||(0,r.isDataPlot)(n))return!1;if((0,r.isOhlcPlot)(n)){const i=n.target;if(e.has(i))return!1;e.add(i);const a=(0,o.ensureDefined)(t.ohlcPlots);return!(0,o.ensureDefined)(a[i]).isHidden}{const e=t.styles?t.styles[n.id]:void 0;return void 0===e||!e.isHidden}}))}hasUserEditableOptions(){return this.hasUserEditableInputs()||this.hasUserEditableProperties()||this.hasUserEditableStyles()}getStrategyProperties(){const e=this._metaInfo,t=e.inputs.filter(g),n={...p};for(const o of t){const t=o.internalID;n[t]=o,p.hasOwnProperty(t)||u.logWarn(`Unknown strategy input internal id ${t} in ${e.fullId}`)}return(0,l.clone)(n)}}const p={currency:void 0,backtest_fill_limits_assumption:void 0,calc_on_every_tick:void 0,calc_on_order_fills:void 0,commission_value:void 0,commission_type:void 0,initial_capital:void 0,pyramiding:void 0,slippage:void 0,default_qty_type:void 0,default_qty_value:void 0,margin_long:void 0,margin_short:void 0,use_bar_magnifier:void 0,process_orders_on_close:void 0,fill_orders_on_standard_ohlc:void 0};function g(e){return"strategy_props"===e.groupId}}}]);