(window.webpackJsonp=window.webpackJsonp||[]).push([["ds-property-pages"],{"/4PT":function(t,e,i){"use strict";i.r(e);i("P5fv"),i("oA7e");var o=function(){function t(t,e){this.value=t,this.html=e,this.jqItem=this._render()}return t.prototype.eq=function(t){return this.value===t},t.prototype.width=function(){return this.jqItem.width()},t.prototype.render=function(){return this.jqItem},t.prototype.select=function(t){this.jqItem.toggleClass("selected",!!t)},t.prototype.selectAndReturnIfValueMatch=function(t){return this.eq(t)?(this.select(!0),this):(this.select(!1),null)},t.prototype._render=function(){return $('
').append($("").html(this.html))},t}(),n=function(){function t(t){var e=this;this._disabled=!1,this._closeCb=null,this.opened=!1,this._value=null,this.items=[],this.width=0,this._jqWrapper=$('
'),this._jqWrapper.data({disable:this.disable.bind(this),enable:this.enable.bind(this)}),this._jqWrapper.selectable(!1),this._jqSwitcher=$('
').appendTo(this._jqWrapper),this._jqSwitcher.on("click",(function(){e.toggleItems()})),this._jqTitle=$('').appendTo(this._jqSwitcher),$('').appendTo(this._jqSwitcher),this._jqItems=$('
').appendTo(this._jqWrapper),this._callback=null,t&&this.addItems(t)}return t.prototype.toggleItems=function(){this.opened?this._close():this._open()},t.prototype.setWidth=function(){this._jqWrapper.width(this.width)},t.prototype.render=function(){return this._jqWrapper},t.prototype.selectItemByValue=function(t){for(var e=null,i=0,o=this.items;i',value:a.LINESTYLE_SOLID},{html:'
',value:a.LINESTYLE_DOTTED},{html:'
',value:a.LINESTYLE_DASHED}])}i.d(e,"createLineStyleEditor",(function(){return s}))},A3Hk:function(t,e,i){"use strict";i.r(e);var o,n;i("P5fv"),i("YFKU"),i("mrSG"),i("Eyy1"),i("tqok"),i("hsV8");function a(){var t=$("");l.appendTo(p),l.addClass("ticker");var d=this._linetool.pointsProperty().points[o];this.bindBarIndex(d.bar,l,this.model(),"Change "+this._linetool.title()+" point bar index")}var h=this._model.model().studyMetaInfoRepository().findByIdSync({type:"java",studyId:this._linetool.studyId()});n.prototype.prepareLayoutImpl.call(this,h,e)},r.prototype.widget=function(){return this._table},t.exports=r},L9lC:function(t,e,i){(function(t){var o=i("DxCR"),n=o.UppercaseTransformer,a=o.SymbolBinder,s=o.BarTimeBinder,r=o.SessionBinder,p=o.PropertyPage,l=o.GreateTransformer,d=o.LessTransformer,h=o.ToIntTransformer,c=o.ToFloatTransformer,u=o.SymbolInfoSymbolTransformer,y=o.SimpleComboBinder,v=o.BooleanBinder,b=o.SimpleStringBinder,f=i("zXvd").NumericFormatter,C=i("0YCj"),m=i("txPx").getLogger("Chart.Study.PropertyPage.Inputs"),_=i("pZll").symbolSearchUIService;function T(t,e,i,o,n){p.call(this,t,e),this._study=i,this._showOnlyConfirmInputs=o,this._symbolSearchZindex=n,this.prepareLayout(),this._$symbolSearchPopup=null}inherit(T,p),T.prototype._addSessionEditor=function(t,e,i,o){ if("session"===i.type){var n=function(t,e){var i=$("");i.appendTo(t),i.css("padding-left","0px"),i.css("padding-right","0px");var o=$("");o.attr("type","text"),o.addClass("ticker"),o.css("width","40px"),o.attr("id",e),o.appendTo(i)},a=function(t,e,i){var o=$("");o.css("padding-left",i),o.css("padding-right",i),o.appendTo(t);var n=$("
");n.appendTo(o),n.append(e),n.css("font-size","150%")},s=$("");s.appendTo(t);var p=$("");p.appendTo(s);var l=["start_hours","start_minutes","end_hours","end_minutes"];n.call(this,p,l[0]),a.call(this,p,":",0),n.call(this,p,l[1]),a.call(this,p,"-",4),n.call(this,p,l[2]),a.call(this,p,":",0),n.call(this,p,l[3]);this.bindControl(new r(p,l,e,!1,this.model(),o))}else m.logError("Session editor adding FAILED: wrong input type.")},T.prototype.prepareControl=function(e,i,o){var n=this;var a=null,s=null,r=null;if("resolution"===e.type)a=$('");else if("symbol"===e.type)a=$(''),_().bindToInput(a,{onPopupOpen:function(t){this._$symbolSearchPopup=t,this._symbolSearchZindex&&t.css("z-index",this._symbolSearchZindex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this),callback:function(t){e.value=t}}),i.attr("colspan",5);else if("session"===e.type)this._addSessionEditor(i,this._property.inputs[e.id],e,o);else if("source"===e.type){for(var p={},l={open:window.t("open"),high:window.t("high"),low:window.t("low"),close:window.t("close"),hl2:window.t("hl2"),hlc3:window.t("hlc3"),ohlc4:window.t("ohlc4")},d=Object.keys(l),h=0;h").attr("value",I).text(B).appendTo(a)}i.addClass("js-value-cell")}else if(e.options){a=$(""),"bool"===e.type?a.attr("type","checkbox"):a.attr("type","text");return a&&(a.appendTo(i),a.is(":checkbox")||"symbol"===e.type||a.css("width","100px")),{valueEditor:a,valueSetter:s,propertyChangedHook:r}},T.prototype._symbolInfoBySymbolProperty=function(t){return this._study.resolvedSymbolInfoBySymbol(t.value())},T.prototype._sortInputs=function(t){return t},T.prototype.prepareLayoutImpl=function(t,e){function i(t){return(new f).format(t)}for(var o=this._sortInputs(t.inputs),r=0;r");_.appendTo(e);var T=$("
");T.appendTo(_),T.addClass("propertypage-name-label"),T.text(window.t(F,{context:"input"}));var g=$("");g.appendTo(_);var w=this.prepareControl(p,g,m),k=w.valueEditor,P=w.valueSetter,L=w.propertyChangedHook;if(p.options)this.bindControl(new y(k,this._property.inputs[C],null,!0,this.model(),m,P,L));else if("bar_time"===p.type){this.bindControl(new s(k,this._property.inputs[C],!0,this.model(),m,this.model().mainSeries(),10)),k.addClass("ticker")}else if("integer"===p.type){var x=[h(p.defval)];(0===p.min||p.min)&&x.push(l(p.min)),(0===p.max||p.max)&&x.push(d(p.max)),this.bindControl(new b(k,this._property.inputs[C],x,!1,this.model(),m)),k.addClass("ticker"),isFinite(p.step)&&p.step>0&&k.attr("data-step",p.step)}else if("float"===p.type){x=[c(p.defval)];(0===p.min||p.min)&&x.push(l(p.min)),(0===p.max||p.max)&&x.push(d(p.max));var S=new b(k,this._property.inputs[C],x,!1,this.model(),m);S.addFormatter(i),this.bindControl(S),k.addClass("ticker"),isFinite(p.step)&&p.step>0&&k.attr("data-step",p.step) }else if("text"===p.type)this.bindControl(new b(k,this._property.inputs[C],null,!1,this.model(),m));else if("bool"===p.type)this.bindControl(new v(k,this._property.inputs[C],!0,this.model(),m));else if("resolution"===p.type)this.bindControl(new y(k,this._property.inputs[C],n,!0,this.model(),"Change Interval"));else if("symbol"===p.type){var I=this._symbolInfoBySymbolProperty.bind(this,this._property.inputs[C]),B=u(I,this._property.inputs[C]),E=new a(k,this._property.inputs[C],!0,this.model(),"Change Symbol",B,this._study.symbolsResolved());this.bindControl(E)}}}if(this._property.offset){var F=this._property.offset.title?this._property.offset.title.value():window.t("Offset");k=this.addOffsetEditorRow(e,F),(x=[h(this._property.offset.val)]).push(l(this._property.offset.min)),x.push(d(this._property.offset.max)),this.bindControl(new b(k,this._property.offset.val,x,!1,this.model(),"Undo "+F))}this._property.offsets&&$.each(t.plots,function(t,i){if(this._property.offsets[i.id]){var o=this._property.offsets[i.id];if(void 0===o.isHidden||!o.isHidden.value()){var n=o.title.value();k=this.addOffsetEditorRow(e,n);var a=[h(o.val)];a.push(l(o.min)),a.push(d(o.max)),this.bindControl(new b(k,o.val,a,!1,this.model(),"Undo "+n))}}}.bind(this))},T.prototype.prepareLayout=function(){this._table=$(""),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2");var t=this._study.metaInfo();this.prepareLayoutImpl(t,this._table),this.loadData()},T.prototype.symbolSearchPopup=function(){return this._$symbolSearchPopup},T.prototype.widget=function(){return this._table},e.StudyInputsPropertyPage=T}).call(this,i("Kxc7"))},PVgW:function(t,e,i){"use strict";i.r(e);i("P5fv"),i("si6p");var o=i("ogJP"),n=i("R4+T");function a(t){return t=Math.abs(t),!Object(o.isInteger)(t)&&t>1&&(t=parseFloat(t.toString().replace(/^.+\./,"0."))),0').appendTo(i.parent()),s=$('
').html(n).appendTo(a),l=$('
').html(n).appendTo(a);a.on("mousedown",(function(t){t.preventDefault(),i.focus()})),s.click((function(){i.is(":disabled")||r(i)})),l.click((function(){i.is(":disabled")||p(i)})),i.keydown((function(t){i.is(":disabled")||(38===t.keyCode?s.addClass("i-active"):40===t.keyCode&&l.addClass("i-active"))})),i.keyup((function(t){i.is(":disabled")||(38===t.keyCode?(r(i),s.removeClass("i-active")):40===t.keyCode&&(p(i),l.removeClass("i-active")))})),i.mousewheel((function(t){t.deltaY*(t.deltaFactor/100)>0?s.click():l.click()}))}}))}},"R4+T":function(t,e){t.exports=''},RTm2:function(t,e,i){"use strict";var o=i("DxCR"),n=o.PropertyPage,a=o.BooleanBinder,s=o.RangeBinder,r=i("Kxc7"),p=i("Ialn").isRtl;function l(t,e,i){n.call(this,t,e),this._linetool=i,this.prepareLayout()}inherit(l,n),l.prototype.prepareLayout=function(){this._block=$('
');var t=this._linetool.properties().intervalsVisibilities;if(r.enabled("seconds_resolution")){var e=$("").appendTo(this._block),i=$("").appendTo(this._block),i=$("").appendTo(this._block),i=$("").appendTo(this._block),i=$("").css("height","29px").appendTo(this._block),i=$("").css("height","29px").appendTo(this._block),i=$(""),n=$("
").css("padding-right","15px").append(i).appendTo(e);var n=$("").addClass("ticker-text");$("").append(n).appendTo(e);var l=$("
").addClass("slider-range ui-slider-horizontal").slider();$("
").append(l).appendTo(e);var d=$("").addClass("ticker-text");$("").append(d).appendTo(e),this.bindControl(new a(o,t.seconds,!0,this.model(),"Change Line Tool Visibility On Seconds")),this.bindControl(new s(l,[t.secondsFrom,t.secondsTo],[1,59],!1,this.model(),[n,d],[$.t("Change Seconds From"),$.t("Change Seconds To")],o))}e=$("
").css(c,"15px").append(i).appendTo(e);n=$("").addClass("ticker-text");$("").append(n).appendTo(e);l=$("
").addClass("slider-range ui-slider-horizontal").slider();$("
").append(l).appendTo(e);d=$("").addClass("ticker-text");$("").append(d).appendTo(e),this.bindControl(new a(h,t.minutes,!0,this.model(),"Change Line Tool Visibility On Minutes")),this.bindControl(new s(l,[t.minutesFrom,t.minutesTo],[1,59],!1,this.model(),[n,d],[$.t("Change Minutes From"),$.t("Change Minutes To")],h));e=$("
").append(i).appendTo(e);n=$("").addClass("ticker-text");$("").append(n).appendTo(e) ;l=$("
").addClass("slider-range ui-slider-horizontal").slider();$("
").append(l).appendTo(e);d=$("").addClass("ticker-text");$("").append(d).appendTo(e),this.bindControl(new a(u,t.hours,!0,this.model(),"Change Line Tool Visibility On Hours")),this.bindControl(new s(l,[t.hoursFrom,t.hoursTo],[1,24],!1,this.model(),[n,d],[$.t("Change Minutes From"),$.t("Change Hours To")],u));e=$("
").append(i).appendTo(e);n=$("").addClass("ticker-text");$("").append(n).appendTo(e);l=$("
").addClass("slider-range ui-slider-horizontal").slider();$("
").append(l).appendTo(e);d=$("").addClass("ticker-text");$("").append(d).appendTo(e),this.bindControl(new a(y,t.days,!0,this.model(),"Change Line Tool Visibility On Days")),this.bindControl(new s(l,[t.daysFrom,t.daysTo],[1,366],!1,this.model(),[n,d],[$.t("Change Minutes From"),$.t("Change Days To")],y));e=$("
").append(i).appendTo(e),this.bindControl(new a(v,t.weeks,!0,this.model(),"Change Line Tool Visibility On Weeks"));e=$("
").append(i).appendTo(e),this.bindControl(new a(b,t.months,!0,this.model(),"Change Line Tool Visibility On Months")),this.loadData()},l.prototype.widget=function(){return this._block},t.exports=l},SA6f:function(t,e,i){"use strict";i.r(e),i.d(e,"createShapeStyleEditor",(function(){return n}));i("P5fv");var o=i("Nu4p");function n(){var t="",$(t)}},XgUb:function(t,e,i){"use strict";i.r(e),i.d(e,"createShapeLocationEditor",(function(){return n}));i("P5fv"),i("YFKU");var o=i("972a");function n(){return $('")}},a0Rg:function(t,e,i){"use strict";i.r(e),i.d(e,"createPlotEditor",(function(){return n}));i("P5fv"),i("YFKU");var o=i("23IT");function n(){var t=$("')}},n3Kh:function(t,e,i){"use strict";var o=i("DxCR"),n=o.PropertyPage,a=o.GreateTransformer,s=o.LessTransformer,r=o.ToIntTransformer,p=o.SimpleStringBinder;function l(t,e,i){n.call(this,t,e),this._linetool=i,this.prepareLayout()}i("PVgW"),inherit(l,n),l.BarIndexPastLimit=-5e4,l.BarIndexFutureLimit=15e3,l.prototype.bindBarIndex=function(t,e,i,o){var n=[r(t.value()),a(l.BarIndexPastLimit),s(l.BarIndexFutureLimit)];this.bindControl(this.createStringBinder(e,t,n,!0,i,o))},l.prototype.createPriceEditor=function(t){var e=this._linetool,i=e.ownerSource().formatter(),o=function(t){var e=i.parse(t);if(e.res)return e.value},n=$("");if(n.TVTicker({step:i._minMove/i._priceScale||1,formatter:function(t){return i.format(t)},parser:o}),t){var a=[function(e){var i=o(e);return void 0===i?t.value():i}],s="Change "+e.title()+" point price",r=this.createStringBinder(n,t,a,!1,this.model(),s);r.addFormatter((function(t){return i.format(t)})),this.bindControl(r)}return n},l.prototype._createPointRow=function(t,e,i){var o=$("
");n.html($.t("Price")+i),n.appendTo(o);var a=$("");a.appendTo(o),this.createPriceEditor(e.price).appendTo(a);var s=$("");s.html($.t("Bar #")),s.appendTo(o);var r=$("");r.appendTo(o);var p=$("");return p.appendTo(r),p.addClass("ticker"),this.bindBarIndex(e.bar,p,this.model(),"Change "+this._linetool.title()+" point bar index"),o},l.prototype.prepareLayoutForTable=function(t){for(var e=this._linetool.points(),i=e.length,o=0;o1?" "+(o+1):"";this._createPointRow(n,a,s).appendTo(t)}}},l.prototype.prepareLayout=function(){this._table=$(document.createElement("table")),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2"),this.prepareLayoutForTable(this._table),this.loadData()},l.prototype.widget=function(){return this._table},l.prototype.createStringBinder=function(t,e,i,o,n,a){return new p(t,e,i,o,n,a)},t.exports=l},o6hY:function(t,e,i){"use strict" ;var o=i("DxCR"),n=o.PropertyPage,a=o.GreateTransformer,s=o.LessTransformer,r=o.ToIntTransformer,p=o.ToFloatTransformer,l=o.SimpleComboBinder,d=o.BooleanBinder,h=o.DisabledBinder,c=o.ColorBinding,u=o.SliderBinder,y=o.SimpleStringBinder,v=i("jNEI").addColorPicker,b=i("/4PT").createLineStyleEditor,f=i("XgUb").createShapeLocationEditor,C=i("SA6f").createShapeStyleEditor,m=i("mBo9").createVisibilityEditor,_=i("A3Hk").createHHistDirectionEditor,T=i("a0Rg").createPlotEditor,g=i("zXvd").NumericFormatter,w=i("0YCj"),k=i("txPx").getLogger("Chart.Study.PropertyPage"),P=i("JWMC").trackEvent;function L(t,e,i){n.call(this,t,e),this._study=i,this.prepareLayout()}function x(t,e,i){n.call(this,t,e),this._study=i,this._property=t,this.prepareLayout()}inherit(L,n),L.prototype.prepareLayout=function(){this._table=$(""),this._table.addClass("property-page"),this._table.attr("cellspacing","0"),this._table.attr("cellpadding","2");var t=this._study.metaInfo(),e={};function i(t){return(new g).format(t)}for(var o=0;o0)for(o=0;o')).appendTo(this._table),(Y=$("
")).appendTo(W),(V=$("")).appendTo(Y);var f=$.t(R.name.value(),{context:"input"}),C=this.createLabeledCell(f,V).appendTo(W).addClass("propertypage-name-label"),m=$("");m.appendTo(W),m.addClass("colorpicker-cell");var _=v(m),T=$("");T.appendTo(W);var P=this.createLineWidthEditor();P.appendTo(T);var x=$('').css({whiteSpace:"nowrap"});x.appendTo(W);var S=b();S.render().appendTo(x);var I=$("");I.appendTo(x);var B=[p(R.value.value())],E="Change band",F=new y(I,R.value,B,!1,this.model(),E);F.addFormatter(i),this.bindControl(F),this.bindControl(new d(V,R.visible,!0,this.model(),E)),this.bindControl(new c(_,R.color,!0,this.model(),E)), this.bindControl(new l(S,R.linestyle,parseInt,!0,this.model(),E)),this.bindControl(new u(P,R.linewidth,!0,this.model(),E))}}if(this._study.properties().bandsBackground){var R=this._study.properties().bandsBackground,O=$.t("Background");E=$.t("Change band background");(W=this._prepareFilledAreaBackground(R.fillBackground,R.backgroundColor,R.transparency,O,E)).appendTo(this._table)}if(this._study.properties().areaBackground){R=this._study.properties().areaBackground,O=$.t("Background"),E=$.t("Change area background");(W=this._prepareFilledAreaBackground(R.fillBackground,R.backgroundColor,R.transparency,O,E)).appendTo(this._table)}var j=t.filledAreas;if(void 0!==j)for(o=0;o');(Y=$("")).appendTo(W),(V=$("")).appendTo(Y),this.bindControl(new d(V,R.visible,!0,this.model(),E+" visibility"));var A=$.t(O,{context:"study"});this.createLabeledCell(A,V).appendTo(W).addClass("propertypage-name-label"),W.appendTo(this._table);var H=this._findPlotPalette(o,D),M=H.palette,q=H.paletteProps;this._prepareLayoutForPalette(0,D,M,q,E)}else{(W=this._prepareFilledAreaBackground(R.visible,R.color,R.transparency,O,E)).appendTo(this._table)}}}for(var z in t.graphics){var N=t.graphics[z];for(var U in N){R=this._property.graphics[z][U];L["_createRow_"+z].call(this,this._table,R)}}var Y,K=this._table.find(".visibility-switch.plot-visibility-switch");1===K.length&&((Y=K.parent()).css("display","none"),1===(C=this._table.find(".propertypage-plot-with-palette")).length?C.css("display","none"):((C=this._table.find(".propertypage-name-label")).css("padding-left",0),C.find("label").attr("for","")));var G=this._prepareStudyPropertiesLayout();if(this._table=this._table.add(G),w.isScriptStrategy(t)){var Q=this._prepareOrdersSwitches();this._table=this._table.add(Q)}this.loadData()},L.prototype._prepareOrdersSwitches=function(){var t=$(''),e="chart-orders-switch_"+Date.now().toString(36),i=$("").appendTo(t),o=$('').appendTo($("").appendTo(t),s=$('').appendTo($("").appendTo(t),l=$('').appendTo($("')).appendTo(this._table),(y=$("')).appendTo(this._table),(y=$("');p.appendTo(this._table);var l=$("');a.appendTo(this._table);var s=$("')).appendTo(this._table);var p=$("')).appendTo(this._table),$("')).appendTo(this._table);var p=$("')).appendTo(this._table),$("');C.appendTo(this._table),$("');a.appendTo(this._table);var s=$("")).appendTo(t),$("").appendTo(i),$("")).appendTo(t),$("").appendTo(i),$("'),s=$("
").appendTo(i));$('").appendTo($("").appendTo(i));var n="chart-orders-labels-switch_"+Date.now().toString(36),a=$("
").appendTo(a));$('").appendTo($("").appendTo(a));var r="chart-orders-qty-switch_"+Date.now().toString(36),p=$("
").appendTo(p));$('").appendTo($("").appendTo(p));var c=this._study.properties();return this.bindControl(new d(o,c.strategy.orders.visible,!0,this.model(),"Trades on chart visibility")), this.bindControl(new d(s,c.strategy.orders.showLabels,!0,this.model(),"Signal labels visibility")),this.bindControl(new h(s,c.strategy.orders.visible,!0,this.model(),"Signal labels visibility",!0)),this.bindControl(new d(l,c.strategy.orders.showQty,!0,this.model(),"Quantity visibility")),this.bindControl(new h(l,c.strategy.orders.visible,!0,this.model(),"Quantity visibility",!0)),t},L.prototype._prepareLayoutForPlot=function(t,e){var i=e.id,o=this._study.properties().styles[i],n=this._findPlotPalette(t,e),a=n.palette,s=n.paletteProps,r="Change "+i;if(a){(h=$('
")).appendTo(h),y.addClass("visibility-cell"),(b=$("")).appendTo(y),this.bindControl(new d(b,o.visible,!0,this.model(),r));var p=$.t(o.title.value(),{context:"input"});this.createLabeledCell(p,b).appendTo(h).addClass("propertypage-name-label propertypage-plot-with-palette"),this._prepareLayoutForPalette(t,e,a,s,r)}else{var h,y,b;(h=$('
")).appendTo(h),y.addClass("visibility-cell"),(b=$("")).appendTo(y);p=$.t(this._study.properties().styles[i].title.value(),{context:"input"});this.createLabeledCell(p,b).appendTo(h).addClass("propertypage-name-label");var f=$("");f.appendTo(h),f.addClass("colorpicker-cell");var C=v(f),m=$("");m.appendTo(h);var _=this.createLineWidthEditor();_.appendTo(m);var g=$("");g.appendTo(h);var w=T();w.appendTo(g);var k=$("");k.appendTo(h);var P=$("");P.on("change",this._trackPriceLine.bind(this)).appendTo(k),this.createLabeledCell("Price Line",P).appendTo(h),this.bindControl(new d(b,o.visible,!0,this.model(),r)),this.bindControl(new c(C,o.color,!0,this.model(),r,o.transparency)),this.bindControl(new u(_,o.linewidth,!0,this.model(),r,this._study.metaInfo().isTVScript)),this.bindControl(new l(w,o.plottype,parseInt,!0,this.model(),r)),this.bindControl(new d(P,o.trackPrice,!0,this.model(),"Change Price Line"))}},L.prototype._prepareLayoutForBarsPlot=function(t,e){var i=e.id,o=this._study.properties().ohlcPlots[i],n=this._findPlotPalette(t,e),a=n.palette,s=n.paletteProps,r="Change "+i,p=$('
");l.appendTo(p),l.addClass("visibility-cell");var h=$("");h.appendTo(l),this.bindControl(new d(h,o.visible,!0,this.model(),r));var u=o.title.value();if(this.createLabeledCell(u,h).appendTo(p).addClass("propertypage-name-label"),a){this._prepareLayoutForPalette(t,e,a,s,r,!0)}else{var y=$("");y.appendTo(p),y.addClass("colorpicker-cell");var b=v(y);this.bindControl(new c(b,o.color,!0,this.model(),r))}},L.prototype._prepareLayoutForCandlesPlot=function(t,e){this._prepareLayoutForBarsPlot(t,e);var i=e.id,o=this._study.properties().ohlcPlots[i],n="Change "+i,a=$('
");s.appendTo(a), s.addClass("visibility-cell");var r=$("");r.appendTo(s),this.bindControl(new d(r,o.drawWick,!0,this.model(),n));this.createLabeledCell("Wick",r).appendTo(a);var p=$("");p.appendTo(a),p.addClass("colorpicker-cell");var l=v(p);this.bindControl(new c(l,o.wickColor,!0,this.model(),n))},L.prototype._prepareLayoutForShapesPlot=function(t,e){var i=e.id,o=this._study.properties().styles[i],n=this._findPlotPalette(t,e),a=n.palette,s=n.paletteProps,r="Change "+i;(T=$('
");p.appendTo(T),p.addClass("visibility-cell");var h=$("");h.appendTo(p),this.bindControl(new d(h,o.visible,!0,this.model(),r));var u=$.t(this._study.properties().styles[i].title.value(),{context:"input"});this.createLabeledCell(u,h).appendTo(T).addClass("propertypage-name-label");var y=$("");y.appendTo(T);var b=C();b.appendTo(y),this.bindControl(new l(b,o.plottype,null,!0,this.model(),r));var m=$("");m.appendTo(T);var _=f();if(_.appendTo(m),this.bindControl(new l(_,o.location,null,!0,this.model(),r)),a)this._prepareLayoutForPalette(t,e,a,s,r);else{var T;(T=$('
").appendTo(T),$("").appendTo(T);var g=$("");g.appendTo(T),g.addClass("colorpicker-cell");var w=v(g);this.bindControl(new c(w,o.color,!0,this.model(),r,o.transparency))}},L.prototype._prepareLayoutForCharsPlot=function(t,e){var i=e.id,o=this._study.properties().styles[i],n=this._findPlotPalette(t,e),a=n.palette,s=n.paletteProps,r="Change "+i;(T=$('
");p.appendTo(T),p.addClass("visibility-cell");var h=$("");h.appendTo(p),this.bindControl(new d(h,o.visible,!0,this.model(),r));var u=$.t(this._study.properties().styles[i].title.value(),{context:"input"});this.createLabeledCell(u,h).appendTo(T).addClass("propertypage-name-label");var b=$("");b.appendTo(T);var C=$('');C.appendTo(b),C.keyup((function(){var t=$(this),e=t.val();e&&(t.val(e.split("")[e.length-1]),t.change())})),this.bindControl(new y(C,o.char,null,!1,this.model(),r));var m=$("");m.appendTo(T);var _=f();if(_.appendTo(m),this.bindControl(new l(_,o.location,null,!0,this.model(),r)),a)this._prepareLayoutForPalette(t,e,a,s,r);else{var T;(T=$('
").appendTo(T),$("").appendTo(T);var g=$("");g.appendTo(T),g.addClass("colorpicker-cell");var w=v(g);this.bindControl(new c(w,o.color,!0,this.model(),r,o.transparency))}},L.prototype._prepareLayoutForPalette=function(t,e,i,o,n,a){var s=t,r=e.id,p=null,h=r.startsWith("fill");p=a?this._study.properties().ohlcPlots[r]:h?this._study.properties().filledAreasStyle[r]:this._study.properties().styles[r];var y=0;for(var b in i.colors){var f=o.colors[b],C=$('
").appendTo(C);var m=$("");m.appendTo(C),m.addClass("propertypage-name-label"), m.html($.t(f.name.value(),{context:"input"}));var _=$("");_.appendTo(C),_.addClass("colorpicker-cell");var g=v(_);if(this.bindControl(new c(g,f.color,!0,this.model(),n,p.transparency)),!h&&this._study.isLinePlot(s)){var w=$("");w.appendTo(C);var k=this.createLineWidthEditor();k.appendTo(w),this.bindControl(new u(k,f.width,!0,this.model(),n,this._study.metaInfo().isTVScript));var P=$("");if(P.appendTo(C),0===y){var L=T();L.appendTo(P),this.bindControl(new l(L,p.plottype,parseInt,!0,this.model(),n));var x=$("");x.appendTo(C);var S=$("");S.on("change",this._trackPriceLine.bind(this)).appendTo(x),this.createLabeledCell("Price Line",S).appendTo(C),this.bindControl(new d(S,p.trackPrice,!0,this.model(),"Change Price Line"))}}y++}},L.prototype._trackPriceLine=function(){P("GUI","Add Price Line",this._study.properties().description.value())},L.prototype._prepareLayoutForArrowsPlot=function(t,e){var i=e.id,o=this._study.properties().styles[i],n="Change "+i,a=$('
");s.appendTo(a),s.addClass("visibility-cell");var r=$("");r.appendTo(s);var p=$.t(this._study.properties().styles[i].title.value(),{context:"input"});this.createLabeledCell(p,r).appendTo(a).addClass("propertypage-name-label");var l=$("");l.appendTo(a),l.addClass("colorpicker-cell");var h=v(l),u=$("");u.appendTo(a),u.addClass("colorpicker-cell");var y=v(u);this.bindControl(new d(r,o.visible,!0,this.model(),n)),this.bindControl(new c(h,o.colorup,!0,this.model(),n,o.transparency)),this.bindControl(new c(y,o.colordown,!0,this.model(),n,o.transparency))},L.prototype._findPlotPalette=function(t,e){var i=t,o=e.id,n=null,a=null,s=this._study.metaInfo().plots;if(this._study.isBarColorerPlot(i)||this._study.isBgColorerPlot(i))n=this._study.metaInfo().palettes[e.palette],a=this._study.properties().palettes[e.palette];else for(var r=0;r'),e=this.createPrecisionEditor();if((i=$("
"+$.t("Precision")+"").append(e).appendTo(i),this.bindControl(new l(e,this._study.properties().precision,null,!0,this.model(),"Change Precision")),"Compare@tv-basicstudies"===this._study.metaInfo().id){var i;e=this.createSeriesMinTickEditor();(i=$("
"+$.t("Override Min Tick")+"").append(e).appendTo(i),this.bindControl(new l(e,this._study.properties().minTick,null,!0,this.model(),"Change MinTick"))}return this._putStudyDefaultStyles(t),t},L.prototype._putStudyDefaultStyles=function(t,e){var i=null,o=this._study ;return(!o.properties().linkedToSeries||!o.properties().linkedToSeries.value())&&($.each(this._model.m_model.panes(),(function(t,e){$.each(e.dataSources(),(function(t,n){if(n===o)return i=e,!1}))})),this._pane=i,t)},L.prototype.widget=function(){return this._table},L.prototype._prepareFilledAreaBackground=function(t,e,i,o,n){var a=$('
");s.appendTo(a);var r=$("");r.appendTo(s),this.createLabeledCell(o,r).appendTo(a).addClass("propertypage-name-label");var p=$("");p.appendTo(a),p.addClass("colorpicker-cell");var l=v(p);return this.bindControl(new d(r,t,!0,this.model(),n+" visibility")),this.bindControl(new c(l,e,!0,this.model(),n+" color",i)),a},inherit(x,n),x.prototype.prepareLayout=function(){this._study.properties().linkedToSeries&&this._study.properties().linkedToSeries.value(),this._table=$()},x.prototype.widget=function(){return this._table},L._createRow_horizlines=function(t,e){var i=this.addRow(t),o=e.name.value(),n=$(""),a=this.createColorPicker(),s=this.createLineWidthEditor(),r=b();$("").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("").append(a).appendTo(i),$("").append(s).appendTo(i),$("").append(r.render()).appendTo(i),this.bindControl(new d(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new c(a,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new l(r,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new u(s,e.width,!0,this.model(),"Change "+o+" width"))},L._createRow_vertlines=function(t,e){var i=this.addRow(t),o=e.name.value(),n=$(""),a=this.createColorPicker(),s=this.createLineWidthEditor(),r=b();$("").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("").append(a).appendTo(i),$("").append(s).appendTo(i),$("").append(r.render()).appendTo(i),this.bindControl(new d(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new c(a,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new l(r,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new u(s,e.width,!0,this.model(),"Change "+o+" width"))},L._createRow_lines=function(t,e){var i=this.addRow(t),o=e.title.value(),n=$(""),a=this.createColorPicker(),s=this.createLineWidthEditor(),r=b();$("").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("").append(a).appendTo(i),$("").append(s).appendTo(i),$("").append(r.render()).appendTo(i),this.bindControl(new d(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new c(a,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new l(r,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new u(s,e.width,!0,this.model(),"Change "+o+" width"))},L._createRow_hlines=function(t,e){ var i=this.addRow(t),o=e.name.value(),n=$(""),a=this.createColorPicker(),s=this.createLineWidthEditor(),r=b(),p=$("");if($("").append(n).appendTo(i),this.createLabeledCell(o,n).appendTo(i),$("").append(a).appendTo(i),$("").append(s).appendTo(i),$("").append(r.render()).appendTo(i),$("").appendTo(i),$("").append(p).appendTo(i),this.createLabeledCell("Show Price",p).appendTo(i),this.bindControl(new d(n,e.visible,!0,this.model(),"Change "+o+" visibility")),this.bindControl(new c(a,e.color,!0,this.model(),"Change "+o+" color")),this.bindControl(new l(r,e.style,parseInt,!0,this.model(),"Change "+o+" style")),this.bindControl(new u(s,e.width,!0,this.model(),"Change "+o+" width")),this.bindControl(new d(p,e.showPrice,!0,this.model(),"Change "+o+" show price")),e.enableText.value()){i=this.addRow(t);$('').appendTo(i);var h=$("");$('').append(h).appendTo(i),this.createLabeledCell("Show Text",h).appendTo(i),this.bindControl(new d(h,e.showText,!0,this.model(),"Change "+o+" show text"));var y=TradingView.createTextPosEditor();$("").append(y.render()).appendTo(i),this.bindControl(new l(y,e.textPos,parseInt,!0,this.model(),"Change "+o+" text position"));var v=this.createFontSizeEditor();$('').append(v).appendTo(i),this.bindControl(new l(v,e.fontSize,parseInt,!0,this.model(),"Change "+o+" font size"))}},L._createRow_hhists=function(t,e){var i=e.title.value(),o=[],n=[],p=this.addRow(t),h=m();$("").append(h).appendTo(p),this.createLabeledCell(i,h).appendTo(p),this.bindControl(new d(h,e.visible,!0,this.model(),"Change "+i+" Visibility"));p=this.addRow(t);var u=$("");u.attr("type","text"),u.addClass("ticker"),this.createLabeledCell($.t("Width (% of the Box)"),u).appendTo(p),$("").append(u).appendTo(p);var v=[r(40)];v.push(a(0)),v.push(s(100)),this.bindControl(new y(u,e.percentWidth,v,!1,this.model(),"Change Percent Width"));p=this.addLabeledRow(t,"Placement");var b=_();$("").append(b).appendTo(p),this.bindControl(new l(b,e.direction,null,!0,this.model(),"Change "+i+" Placement"));p=this.addRow(t);var f=$("");$("").append(f).appendTo(p),this.createLabeledCell($.t("Show Values"),f).appendTo(p),this.bindControl(new d(f,e.showValues,!0,this.model(),"Change "+i+" Show Values"));p=this.addRow(t);var C=this.createColorPicker();for(var T in this.createLabeledCell($.t("Text Color"),C).appendTo(p),$("").append(C).appendTo(p),this.bindControl(new c(C,e.valuesColor,!0,this.model(),"Change "+i+" Text Color")),e.colors)if(isNumber(parseInt(T,10))){p=this.addRow(t);o[T]=e.titles[T].value(),n[T]=this.createColorPicker(),$("").append(o[T]).appendTo(p),$("").append(n[T]).appendTo(p),this.bindControl(new c(n[T],e.colors[T],!0,this.model(),"Change "+o[T]+" color"))}},L._createRow_backgrounds=function(t,e){ var i=this.addRow(t),o=$(""),n=e.name.value(),a=this.createColorPicker();$("").append(o).appendTo(i),this.createLabeledCell(n,o).appendTo(i),$("").append(a).appendTo(i),this.bindControl(new d(o,e.visible,!0,this.model(),"Change "+n+" visibility")),this.bindControl(new c(a,e.color,!0,this.model(),"Change "+n+" color",e.transparency))},L._createRow_polygons=function(t,e){var i=this.addRow(t),o=e.name.value(),n=this.createColorPicker();$("").append(o).appendTo(i),$("").append(n).appendTo(i),this.bindControl(new c(n,e.color,!0,this.model(),"Change "+o+" color"))},L._createRow_trendchannels=function(t,e){var i=this.addRow(t),o=e.name.value(),n=this.createColorPicker();$("").append(o).appendTo(i),$("").append(n).appendTo(i),this.bindControl(new c(n,e.color,!0,this.model(),"Change "+o+" color",e.transparency))},L._createRow_textmarks=function(t,e){var i=this.addLabeledRow(t),o=e.name.value(),n=this.createColorPicker(),a=this.createColorPicker(),s=this.createFontEditor(),r=this.createFontSizeEditor(),p=$(''),h=$('');$("").append(o).appendTo(i),"rectangle"!==e.shape.value()&&$("").append(n).appendTo(i),$("").append(a).appendTo(i),$("").append(s).appendTo(i),$("").append(r).appendTo(i),$("").append(p).appendTo(i),$("").append(h).appendTo(i),this.bindControl(new c(n,e.color,!0,this.model(),"Change "+o+" color",e.transparency)),this.bindControl(new c(a,e.fontColor,!0,this.model(),"Change "+o+" text color",e.transparency)),this.bindControl(new l(r,e.fontSize,parseInt,!0,this.model(),"Change "+o+" font size")),this.bindControl(new l(s,e.fontFamily,null,!0,this.model(),"Change "+o+" font")),this.bindControl(new d(p,e.fontBold,!0,this.model(),"Change Text Font Bold")),this.bindControl(new d(h,e.fontItalic,!0,this.model(),"Change Text Font Italic"))},L._createRow_shapemarks=function(t,e){var i=this.addRow(t),o=$(""),n=e.name.value(),a=this.createColorPicker(),s=$("");s.attr("type","text"),s.addClass("ticker"),$("").append(o).appendTo(i),this.createLabeledCell(n,o).appendTo(i),$("").append(a).appendTo(i),this.createLabeledCell("Size",s).appendTo(i),$("").append(s).appendTo(i),this.bindControl(new d(o,e.visible,!0,this.model(),"Change "+n+" visibility")),this.bindControl(new c(a,e.color,!0,this.model(),"Change "+n+" back color",e.transparency)),this.bindControl(new y(s,e.size,null,!1,this.model(),"Change size"))},e.StudyStylesPropertyPage=L,e.StudyDisplayPropertyPage=x},qbxA:function(t,e,i){},"y1L/":function(t,e,i){}}]);