").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}(t,"tv-linetool-properties-toolbar__icon--line-props")}o("m/4m"),o("nSyy"),T.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},T.prototype.selectedSources=function(){return this._chartWidgetCollection.selectedSources.value()},T.prototype._init=function(){this._floatingToolbar=new p({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:g.HEADER_TOOLBAR_HEIGHT_EXPANDED+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position",positionStorageType:"server"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach((function(t){this._floatingToolbar.addWidget(t.button)}),this)},T.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},T.prototype._onPropertyChangedInToolbar=function(t,e){if(("linewidth"===t||t.endsWith(".linewidth"))&&this._lineWidthsProperty){var o=this.activeChartWidget().model(),i=1===this.selectedSources().length?window.t("Set line tool width"):window.t("Set line tool widths");return o.beginUndoMacro(i),this._lineWidthsProperty.setValue(e,{applyValue:function(t,e){o.setProperty(t,e)}}),o.endUndoMacro(),void this._trackContextAction(t)}this._currentProperties&&(this._trackContextAction(t),this.activeChartWidget().model().setProperty(this._currentProperties[t],e))},T.prototype._onPropertyChanged=function(t,e){"linewidth"===t&&e!==this._lineWidthsProperty||this._floatingToolbar.setGroupedWidgetState(t,e.value())},T.prototype._hideAllSourceActions=function(){this._sourceActions.forEach((function(t){this._floatingToolbar.hideWidget(t.button)}),this),this._sourceActionsVisible=!1},T.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,this._sourceActions.forEach((function(e){
!e.isVisibleForSources||e.isVisibleForSources(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)}),this)},T.prototype.attachHandlers=function(){l.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSources.subscribe(this.onSourceChanged.bind(this)),this._chartWidgetCollection.layout.subscribe(this._updateCloneButtonTitle.bind(this))},T.prototype._updateCloneButtonTitle=function(){this._setButtonTitle(this._cloneButton,this._cloneButtonTitle())},T.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){var o=e instanceof c;e=o?e:f(t);this._hideAllSourceActions(),this.showPropertiesOf(t,e,o),this.showTemplatesOf({tool:t,properties:e}),this._updateVisibility()}else this.selectedSources()?this.onSourceChanged(this.selectedSources()):this.hide()},T.prototype.findSourceOnWidget=function(t){for(var e=0;e
0}},{button:this._createLockButton()},{button:this._createHideButton()},{button:this._createRemoveButton()}),t},T.prototype._getCloneActions=function(){var t=this.activeChartWidget().model(),e=this.selectedSources(),o=[],i=e.filter((function(t){return t.cloneable()}));i.length>0&&o.push({name:"clone",title:window.t("Clone"),action:function(){t.cloneLineTools(i)}});var n=e.filter((function(t){return t.copiable()}));return n.length>0&&o.push({name:"copy",title:window.t("Copy"),shortcut:"Ctrl-C",action:function(){t.copySourcesToClip(n)}}),this._isSyncOperationAvailable()?(e.filter((function(t){return!!t.linkKey})).length?o.push({name:"stop-sync",title:$.t("Stop syncing"),action:function(){t.unlinkLines(e)}}):o.push({name:"sync",title:$.t("Sync to all charts"),action:function(){t.copyToOtherCharts(e)}}),o):o},T.prototype._getZOrderActions=function(){var t=[],e=this.selectedSources(),o=this.activeChartWidget().model(),i={name:"bring-to-front",title:$.t("Bring to Front"),action:function(){o.bringToFront(e)}},n={name:"send-to-back",title:$.t("Send to Back"),action:function(){o.sendToBack(e)}},r={name:"bring-forward",title:$.t("Bring Forward"),action:function(){o.bringForward(e)}},s={name:"send-backward",title:$.t("Send Backward"),action:function(){o.sendBackward(e)}},a=o.paneForSource(e[0]).getZOrderMinMax();return 1===e.length&&e[0].zorder()===a.minZOrder&&(n.disabled=!0,s.disabled=!0),1===e.length&&e[0].zorder()===a.maxZOrder&&(r.disabled=!0,i.disabled=!0),t.push(i,n,r,s),t},T.prototype._getPossibleProperty=function(t,e){for(var o=[],i=this._defaultToolProperties(),n=0;n=0;--r){
for(var s=i[r],a=e,l=s.name.split("."),d=0;d{n.data("tvcolorpicker")?(n.addClass("i-active"),this._trackContextAction(e.name)):n.removeClass("i-active")}),n.after(r);var l=this;return this.bindControl(new a(i,t,!0,this.activeChartWidget().model(),null,T.getTransparency(e,o),(function(t){var e=l.activeChartWidget().model();e.beginUndoMacro(this._undoText),e.setProperty(this.property(),t),e.endUndoMacro()}))),"string"==typeof e.addClass&&i.addClass(e.addClass),i},T.getTransparency=function(t,e){if(t.transparency)return t.transparencyField?e[t.transparencyField].value():e.transparency.value()},T.prototype.createLineEndPropertyProxy=function(t,e){return function(o,n){var r;r=o[e]&&o[e].value()?T.LINE_EXTEND:o[t].value();var s=new i(r);return s.subscribe(this,(function(i){var r=i.value();r<2?(n.beginUndoMacro(""),o[t].setValue(r),o[e]&&o[e].setValue(!1),n.endUndoMacro()):(n.beginUndoMacro(""),o[t].setValue(u.Normal),o[e]&&o[e].setValue(!0),n.endUndoMacro())})),s}},T.LINE_EXTEND=42;var E=$(o("noRL"))[0],V=k(o("wLZl")),z=k(o("XqDt")),M=k(o("znEV")),I=k(o("NDCK")),A=k(o("9On3")),O=k(o("Nz7V")),H=k(o("dhuF")),F=k(o("n2Ch")),R=k(o("eHtW")),D=k(o("BiGZ")),N=k(o("fUH/")),j=k(o("BsMi")),G=o("HKvk"),U=o("2JFs"),Z=o("Kjbl"),K=window.t("Color");T.prototype._defaultToolProperties=function(){return[{name:"linesColors",inputType:"colorPicker",iconSvgCode:G,title:K,factory:T.prototype._createColorsButton},{name:"backgroundsColors",inputType:"colorPicker",iconSvgCode:U,title:$.t("Background Color"),transparency:!0,factory:T.prototype._createBackgroundsButton},{name:"textsColors",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:Z,factory:T.prototype._createTextColorsButton},{name:"linesWidths",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:V},{value:2,iconSvgCode:z},{value:3,iconSvgCode:M},{value:4,iconSvgCode:I}],title:$.t("Width"),factory:T.prototype._createWidthsButton},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:V},{value:1,iconSvgCode:A},{value:2,iconSvgCode:O}]},{name:"lineStyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:V},{value:1,iconSvgCode:A},{value:2,iconSvgCode:O}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:u.Normal,iconSvgCode:H},{value:u.Arrow,iconSvgCode:F},{value:T.LINE_EXTEND,iconSvgCode:R}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",
title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:u.Normal,iconSvgCode:D},{value:u.Arrow,iconSvgCode:N},{value:T.LINE_EXTEND,iconSvgCode:j}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},T.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:Z},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",iconSvgCode:U,transparency:!0,transparencyField:"profitBackgroundTransparency"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",iconSvgCode:U,transparency:!0,transparencyField:"stopBackgroundTransparency"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",iconSvgCode:G}]},T.prototype._rangeExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:G,title:K},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:U,title:$.t("Background Color"),transparency:!0,transparencyField:"backgroundTransparency"},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:V},{value:2,iconSvgCode:z},{value:3,iconSvgCode:M},{value:4,iconSvgCode:I}],title:"Width"}]},T.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:Z},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",iconSvgCode:U,showIf:function(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:G},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:G},{name:"fontsize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},T.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",iconSvgCode:G},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:Z},{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]}]},T.prototype._trackContextAction=function(t){const e=l.tool.value();if(_(e)){const o=this.selectedSources().filter(t=>_(t.toolname)),i=0===o.length||o[0].toolname!==e?"Context action before finishing drawings":"Context action on drawings";return void b("GUI",i,t)}const o=null===this.activeChartWidget().model().lineBeingCreated()&&l.toolIsCursor(e)?"Context action on drawings":"Context action before finishing drawings";b("GUI",o,t)},T.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolText:T.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:T.prototype._textPropertiesExceptionCases(),LineToolBalloon:T.prototype._textPropertiesExceptionCases(),LineToolCallout:T.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:T.prototype._textPropertiesExceptionCases(),
LineToolDateRange:T.prototype._rangeExceptionCases(),LineToolPriceRange:T.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:T.prototype._rangeExceptionCases(),LineToolNote:T.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:T.prototype._notePropertiesExceptionCases(),LineToolRiskRewardLong:T.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:T.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:K,inputType:"colorPicker",iconSvgCode:U}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",iconSvgCode:U,transparency:!0},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",iconSvgCode:U,transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:V},{value:2,iconSvgCode:z},{value:3,iconSvgCode:M},{value:4,iconSvgCode:I}]}],LineToolSignpost:[{name:"fontSize",title:$.t("Font Size"),inputType:"combobox",simple:!0,addClass:"simple fontsize-dropdown",comboboxOptions:[10,11,12,14,16,20,24,28,32,40]},{name:"linesColors",inputType:"colorPicker",iconSvgCode:U,title:K,factory:T.prototype._createBackgroundsButton,showIf:function(t,e){return e&&e.showImage.value()}}]}},t.exports=T}).call(this,o("Kxc7"),o("tc+8"))},turx:function(t,e,o){"use strict";o.r(e),o.d(e,"CollectibleColorPropertyUndoWrapper",(function(){return a})),o.d(e,"CollectibleColorPropertyDirectWrapper",(function(){return l}));var i=o("mrSG"),n=o("Eyy1"),r=o("tc+8"),s=function(t){function e(e){var o=t.call(this)||this;return o._listenersMappers=[],o._isProcess=!1,o._baseProperty=e,o}return Object(i.c)(e,t),e.prototype.destroy=function(){this._baseProperty.destroy()},e.prototype.value=function(){var t=this._baseProperty.value();return"mixed"===t?"":t},e.prototype.visible=function(){return this._baseProperty.visible()},e.prototype.setValue=function(t){var e=this;this._isProcess=!0,this._baseProperty.setValue(""===t?"mixed":t,void 0,{applyValue:this._applyValue.bind(this)}),this._isProcess=!1,this._listenersMappers.forEach((function(t){t.method.call(t.obj,e)}))},e.prototype.subscribe=function(t,e){var o=this,i=function(i){o._isProcess||e.call(t,o)},n={obj:t,method:e,callback:i};this._listenersMappers.push(n),this._baseProperty.subscribe(t,i)},e.prototype.unsubscribe=function(t,e){var o,i=Object(n.ensureDefined)(null===(o=this._listenersMappers.find((function(o){return o.obj===t&&o.method===e})))||void 0===o?void 0:o.callback);this._baseProperty.unsubscribe(t,i)},e.prototype.unsubscribeAll=function(t){this._baseProperty.unsubscribeAll(t)},e}(o.n(r).a),a=function(t){function e(e,o,i){var n=t.call(this,e)||this;return n._undoModel=o,n._undoText=i,n}return Object(i.c)(e,t),e.prototype._applyValue=function(t,e){this._undoModel.setProperty(t,e,this._undoText)},e}(s),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(i.c)(e,t),e.prototype._applyValue=function(t,e){t.setValue(e)},e}(s)},tzjn:function(t,e){
t.exports=''},wLZl:function(t,e){t.exports=''},yB98:function(t,e){t.exports=''},znEV:function(t,e){t.exports=''}}]);