You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

743 lines
2.1 MiB

webpackJsonp([14],[function(t,e,i){"use strict";function o(t,e){function i(){this.constructor=t}v(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}function n(t,e){var i,o,n={};for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(n[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(o=0,i=Object.getOwnPropertySymbols(t);o<i.length;o++)e.indexOf(i[o])<0&&(n[i[o]]=t[i[o]]);return n}function r(t,e,i,o){var n,r,s=arguments.length,a=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,o);else for(r=t.length-1;r>=0;r--)(n=t[r])&&(a=(s<3?n(a):s>3?n(e,i,a):n(e,i))||a);return s>3&&a&&Object.defineProperty(e,i,a),a}function s(t,e){return function(i,o){e(i,o,t)}}function a(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function l(t,e,i,o){return new(i||(i=Promise))(function(n,r){function s(t){try{l(o.next(t))}catch(t){r(t)}}function a(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){t.done?n(t.value):new i(function(e){e(t.value)}).then(s,a)}l((o=o.apply(t,e||[])).next())})}function c(t,e){function i(t){return function(e){return o([t,e])}}function o(i){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(s=r[2&i[0]?"return":i[0]?"throw":"next"])&&!(s=s.call(r,i[1])).done)return s;switch(r=0,s&&(i=[0,s.value]),i[0]){case 0:case 1:s=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,r=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(s=l.trys,!(s=s.length>0&&s[s.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!s||i[1]>s[0]&&i[1]<s[3])){l.label=i[1];break}if(6===i[0]&&l.label<s[1]){l.label=s[1],s=i;break}if(s&&l.label<s[2]){l.label=s[2],l.ops.push(i);break}s[2]&&l.ops.pop(),l.trys.pop();continue}i=e.call(t,l)}catch(t){i=[6,t],r=0}finally{n=s=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var n,r,s,a,l={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a}function h(t,e){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}function u(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}}function d(t,e){var i,o,n,r,s="function"==typeof Symbol&&t[Symbol.iterator];if(!s)return t;i=s.call(t),n=[];try{for(;(void 0===e||e-- >0)&&!(o=i.next()).done;)n.push(o.value)}catch(t){r={error:t}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(r)throw r.error}}return n}function p(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t}function _(t){return this instanceof _?(this.v=t,this):new _(t)}function f(t,e,i){function o(t){h[t]&&(c[t]=function(e){return new Promise(function(i,o){u.push([t,e,i,o])>1||n(t,e)})})}function n(t,e){try{r(h[t](e))}catch(t){l(u[0][3],t)}}
function r(t){t.value instanceof _?Promise.resolve(t.value.v).then(s,a):l(u[0][2],t)}function s(t){n("next",t)}function a(t){n("throw",t)}function l(t,e){t(e),u.shift(),u.length&&n(u[0][0],u[0][1])}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var c,h=i.apply(t,e||[]),u=[];return c={},o("next"),o("throw"),o("return"),c[Symbol.asyncIterator]=function(){return this},c}function m(t){function e(e,n){t[e]&&(i[e]=function(i){return(o=!o)?{value:_(t[e](i)),done:"return"===e}:n?n(i):i})}var i,o;return i={},e("next"),e("throw",function(t){throw t}),e("return"),i[Symbol.iterator]=function(){return this},i}function g(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator];return e?e.call(t):"function"==typeof u?u(t):t[Symbol.iterator]()}var v,y;Object.defineProperty(e,"__esModule",{value:!0}),e.__extends=o,i.d(e,"__assign",function(){return y}),e.__rest=n,e.__decorate=r,e.__param=s,e.__metadata=a,e.__awaiter=l,e.__generator=c,e.__exportStar=h,e.__values=u,e.__read=d,e.__spread=p,e.__await=_,e.__asyncGenerator=f,e.__asyncDelegator=m,e.__asyncValues=g,v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])},y=Object.assign||function(t){var e,i,o,n;for(i=1,o=arguments.length;i<o;i++){e=arguments[i];for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t}},function(t,e,i){"use strict";(function(t){function o(t,e){a.call(this),this._linetool=t,this._pointindex=e,this._model=t._model,this._text="",this._coordinate=0,this._background="#5592C9",this._activeBackground="#0F6DBF",this._borderColor="#2E84A6",this._color="white",this._visible=!1,this._invalidated=!0,this._renderer=new l}function n(t,e){var i,r,s;if(c.call(this),this._model=t,this._properties=e,this._pointAdded=new m,this._pointChanged=new m,this._onRestoringFactoryDefaults=new m,this._onTemplateApplying=new m,this._onTemplateApplied=new m,e.visible&&e.frozen||this._properties.merge(defaults("linetool")),i=defaults("linetoolvisibilities"),e.intervalsVisibilities)for(r in i.intervalsVisibilities)this._properties.intervalsVisibilities[r]||this._properties.intervalsVisibilities.addProperty(r,i.intervalsVisibilities[r]);else this._properties.merge(i);if(this._paneViews=[],this._points=[],this._fixedPoints=[],this._timePoint=[],this._currentPointsetId=null,this._properties.symbol||this._properties.merge({symbol:t.mainSeries().symbol()}),this._properties.interval||this._properties.merge({interval:t.mainSeries().interval()}),this._properties.addExclusion&&(this._properties.addExclusion("symbol"),this._properties.addExclusion("symbolInfo"),this._properties.addExclusion("points"),this._properties.addExclusion("interval"),this._properties.addExclusion("visible"),this._properties.addExclusion("lastUpdateTime")),this.calcIsActualSymbol(),this._properties.intervalsVisibilities.listeners().subscribe(this,n.prototype.calcIsActualSymbol),
this._properties.listeners().subscribe(this,n.prototype.propertiesChanged),this._createPointsProperties(),"_tooltipFieldsHash"in this&&!this.hasOwnProperty("_tooltipFieldsHash")&&(this._tooltipFieldsHash=$.extend(!0,{},this._tooltipFieldsHash)),this.m_priceAxisViews=[],this.m_timeAxisViews=[],this.pointsCount()>0)for(s=0;s<this.pointsCount();s++)this.m_priceAxisViews.push(this.createPriceAxisView(s)),this.m_timeAxisViews.push(new o(this,s));this._properties.visible.listeners().subscribe(this,function(t){t.value()||this._model.selectedSource()!==this||this._model.setSelectedSource(null)}),this.customization=this.customization||{forcePriceAxisLabel:!1,disableSelection:!1,disableErasing:!1,disableSave:!1,showInObjectsTree:!0},this._properties.lastUpdateTime||this._properties.addProperty("lastUpdateTime",0),this._syncStateExclusions=[]}var r=i(8).Point,s=i(221).LineToolPriceAxisView,a=i(222).TimeAxisView,l=i(223),c=i(46).DataSource,h=i(26),u=i(34).Interval,d=i(127).DateTimeFormatter,p=i(810),_=i(22),f=i(7).getLogger("Chart.LineDataSource"),m=i(10),g=i(3).propertyPages,v=i(66).lineToolsInfo;inherit(o,a),o.prototype.setActive=function(t){this._active=t},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i;this._visible=!1,this._model.timeScale().isEmpty()||(t=this._linetool.axisPoints(),t.length<=this._pointindex||this._linetool===this._model.selectedSource()&&(this._text="",e=t[this._pointindex].index,this._coordinate=this._model.timeScale().indexToCoordinate(e),i=this._model.timeScale().indexToUserTime(e),i&&(this._text=new d(this._model.mainSeries().isDWM()).format(i)),this._visible=!0,this._invalidated=!1))},o.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={text:this._text,coordinate:this._coordinate,color:this._color,background:this._active?this._activeBackground:this._background,borderColor:this._borderColor,visible:this._visible};return this._renderer.setData(t),this._renderer},inherit(n,c),n.prototype.pointAdded=function(){return this._pointAdded},n.prototype.pointChanged=function(){return this._pointChanged},n.PointPriceProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i,e.pointAdded().subscribe(this,function(t){this._pointIndex===t&&this._listeners.fire(this)}),e.pointChanged().subscribe(this,function(t){this._pointIndex===t&&this._listeners.fire(this)})},inherit(n.PointPriceProperty,t),n.prototype.enableCurrentIntervalVisibility=function(){var t,e,i,o,n,r,s,a=u.parse(this._model.mainSeries().interval());a.kind()===u.SECONDS&&(a.multiplier()<60?(this.properties().intervalsVisibilities.seconds.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.secondsFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.secondsTo.value(),a.multiplier()),this.properties().intervalsVisibilities.secondsTo.setValue(e)):a=new u(u.MINUTES,a.multiplier()/60)),
a.kind()===u.MINUTES&&(a.multiplier()<60?(this.properties().intervalsVisibilities.minutes.setValue(!0),t=Math.min(this.properties().intervalsVisibilities.minutesFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesFrom.setValue(t),e=Math.max(this.properties().intervalsVisibilities.minutesTo.value(),a.multiplier()),this.properties().intervalsVisibilities.minutesTo.setValue(e)):(i=Math.floor(a.multiplier()/60),this.properties().intervalsVisibilities.hours.setValue(!0),o=Math.min(this.properties().intervalsVisibilities.hoursFrom.value(),i),this.properties().intervalsVisibilities.hoursFrom.setValue(o),n=Math.max(this.properties().intervalsVisibilities.hoursTo.value(),i),this.properties().intervalsVisibilities.hoursTo.setValue(n))),a.kind()===u.DAYS&&(this.properties().intervalsVisibilities.days.setValue(!0),r=Math.min(this.properties().intervalsVisibilities.daysFrom.value(),a.multiplier()),this.properties().intervalsVisibilities.daysFrom.setValue(r),s=Math.max(this.properties().intervalsVisibilities.daysTo.value(),a.multiplier()),this.properties().intervalsVisibilities.daysTo.setValue(s)),a.kind()===u.WEEKS&&this.properties().intervalsVisibilities.weeks.setValue(!0),a.kind()===u.MONTHS&&this.properties().intervalsVisibilities.months.setValue(!0)},n.prototype.getType=function(){return TradingView.className(this.constructor)},n.prototype.getConstructor=function(){return this._constructor||null},n.prototype.isActualSymbol=function(){return this._isActualSymbol},n.prototype.isActualInterval=function(){return this._isActualInterval},n.prototype.isSavedInChart=function(t){return!this.customization.disableSave},n.prototype.setSavingInChartEnabled=function(t){this.customization.disableSave=!t},n.prototype.showInObjectTree=function(){return this.customization.showInObjectsTree},n.prototype.setShowInObjectsTreeEnabled=function(t){this.customization.showInObjectsTree=t},n.prototype.isSelectionEnabled=function(){return!this.customization.disableSelection},n.prototype.setSelectionEnabled=function(t){this.customization.disableSelection=!t},n.prototype.visibilityKeyByInterval=function(t){var e,i=u.parse(t);return n.IntervalsVisibilities.forEach(function(t){t.kind===i.kind()&&t.from<=i.multiplier()&&t.to>=i.multiplier()&&(e=t.key)}),e},n.prototype.calcIsActualSymbol=function(){var t,e=this._properties.symbol,i=this._model.mainSeries(),o=e.value();this._isActualSymbol=i.symbolSameAsCurrent(o),this._isActualSymbol&&(t=i.symbol(),o!==t&&(f.logWarn('Possible drawing "migrating" detected from "'+o+'" to "'+t+'"'),f.logWarn("Series symbolInfo: "+JSON.stringify(i.symbolInfo())),f.logWarn(Error().stack)),e.setValue(t)),this.calcIsActualInterval()},n.prototype.calcIsActualInterval=function(){var t,e,i,o,n,r=this._properties,s=this._model.mainSeries(),a=u.parse(s.interval()),l=r.intervalsVisibilities;this._isActualInterval=!1,a.kind()===u.SECONDS&&a.multiplier()<60&&(t=l.seconds.value(),e=l.secondsFrom.value(),i=l.secondsTo.value(),this._isActualInterval=t&&a.multiplier()>=e&&a.multiplier()<=i),
a.kind()===u.SECONDS&&a.multiplier()>=60&&(o=Math.floor(a.multiplier()/60),t=l.minutes.value(),e=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=t&&o>=e&&o<=i),a.kind()===u.MINUTES&&a.multiplier()<60&&(t=l.minutes.value(),e=l.minutesFrom.value(),i=l.minutesTo.value(),this._isActualInterval=t&&a.multiplier()>=e&&a.multiplier()<=i),a.kind()===u.MINUTES&&a.multiplier()>=60&&(n=Math.floor(a.multiplier()/60),t=l.hours.value(),e=l.hoursFrom.value(),i=l.hoursTo.value(),this._isActualInterval=t&&n>=e&&n<=i),a.kind()===u.DAYS&&(t=l.days.value(),e=l.daysFrom.value(),i=l.daysTo.value(),this._isActualInterval=t&&a.multiplier()>=e&&a.multiplier()<=i),a.kind()===u.WEEKS&&(this._isActualInterval=l.weeks.value()),a.kind()===u.MONTHS&&(this._isActualInterval=l.months.value()),this._isActualInterval||this._model.selectedSource()!==this||this._model.setSelectedSource(null)},n.PointPriceProperty.prototype.value=function(){var t=this._lineSource.points()[this._pointIndex].price,e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},n.PointPriceProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.price=parseFloat(t),e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},n.PointIndexProperty=function(e,i){t.call(this),this._lineSource=e,this._pointIndex=i},inherit(n.PointIndexProperty,t),n.PointIndexProperty.prototype.value=function(){return this._lineSource.points()[this._pointIndex].index},n.PointIndexProperty.prototype.setValue=function(t){var e,i,o=this._lineSource.points()[this._pointIndex];o.index=t,e=this._lineSource.priceScale(),e.isPercent()&&(i=this._lineSource.ownerSource().firstValue(),o.price=e.priceRange().convertToPercent(o.price,i)),this._lineSource.setPoint(this._pointIndex,o),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(!0),this._lineSource._syncMultichartState(),this._lineSource._properties.lastUpdateTime.setValue((new Date).valueOf())},n.prototype._syncMultichartState=function(){var t={points:this._timePoint,interval:this._model.mainSeries().interval()};this.linkKey&&!this.properties().singleChartOnly&&h.finishChangingLineTool({model:this._model,linkKey:this.linkKey,symbol:this._model.mainSeries().symbol(),finalState:t})},n.prototype._createPointProperty=function(t){var e,i=this._properties.points;i.addProperty(t),e=i[t],e.addChild("price",new n.PointPriceProperty(this,t)),e.addChild("bar",new n.PointIndexProperty(this,t))},n.prototype._createPointsProperties=function(){this._properties.addProperty("points");for(var t=0;t<this.pointsCount();t++)this._createPointProperty(t)},
n.prototype.priceScale=function(){return this._ownerSource?this._ownerSource.m_priceScale:null},n.prototype.symbol=function(){return this._properties.symbol.value()},n.prototype.properties=function(){return this._properties},n.prototype.isSavedInStudyTemplates=function(){return!1},n.prototype.state=function(t){var e=TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),points:this._timePoint,zorder:this.zorder(),linkKey:this.linkKey};return i.state._isActualInterval=this.isActualInterval(),delete i.state.points,t&&(i.indexes=this._points),this.ownerSource()&&(i.ownerSource=this.ownerSource().id()),this.isFixed()&&(i.positionPercents=this._positionPercents||this.calcPositionPercents()),"version"in this&&1!==this.version&&(i.version=this.version),this.hasAlert.value()&&(i.alertId=this._alertId),i},n.prototype.template=function(){var t=this.properties().state();return delete t.points,delete t.symbol,delete t.symbolInfo,t},n.prototype.applyTemplate=function(t){delete t.symbolInfo,this._onTemplateApplying.fire(t);var e=this.properties();e.merge(t),e.saveDefaults(),this.propertiesChanged(),this.calcIsActualSymbol(),this.updateAllViews(),this.model().invalidate(new _(_.LIGHT_UPDATE)),this._onTemplateApplied.fire()},n.prototype.restoreFactoryDefaults=function(){this.properties().restoreFactoryDefaults(),this._onRestoringFactoryDefaults.fire(),this.model().updateSource(this)},n.prototype.clearData=function(){this._points=[]},n.prototype.currentPointsetId=function(){return"pointset_"+this._currentPointsetId},n.prototype.stop=function(){this.clearServerPoints(),this.hasAlert.value()&&TradingView.alertsDispatcher&&TradingView.alertsDispatcher.deleteAlert(this._alertId)},n.prototype.isStarted=function(){return null!==this._currentPointsetId},n.prototype.restart=function(){this.isFixed()||(this._currentPointsetId=null,this.createServerPoints())},n.prototype.tryCreateServerPoints=function(){this.isFixed()||null===this._currentPointsetId&&this.createServerPoints()},n.prototype.normalizePoint=function(t){var e=this._model.timeScale().normalizeBarIndex(t.index);return e.price=t.price,e},n.prototype.normalizePoints=function(){var t,e;for(this._timePoint=[],t=0;t<this._points.length;t++){if(e=this._model.timeScale().normalizeBarIndex(this._points[t].index),!e.time_t){this._timePoint=[];break}e.price=this._points[t].price,this._timePoint.push(e)}},n.prototype.denormalizeTimePoints=function(){var t,e,i=[];for(t=0;t<this._timePoint.length;t++){if(void 0===(e=this._model.timeScale().denormalizeTimePoint(this._timePoint[t]))){i=[];break}i.push({index:e,price:this._timePoint[t].price})}i.length>0&&(this._points=i)},n.prototype.restorePoints=function(t,e,i){this._timePoint=t,this._points=e,i||this.denormalizeTimePoints()},n.prototype.restoreExternalPoints=function(t){if(this.properties().interval.setValue(t.interval),this._timePoint=t.points,this.denormalizeTimePoints(),!this.isActualSymbol())return void this.clearServerPoints();this.createServerPoints()},n.prototype.restorePositionPercents=function(t){
this._positionPercents=t},n.prototype.updateAllViewsAndRedraw=function(){this.updateAllViews(),this._model.updateSource(this)},n.prototype.propertiesChanged=function(){if(this.calcIsActualInterval(),this.updateAllViewsAndRedraw(),this.linkKey){var t=this.properties().state(this._syncStateExclusions);delete t.interval,h.changeLineStyle({linkKey:this.linkKey,state:t,model:this._model})}},n.prototype.points=function(){var t,e,i=[];for(t=0;t<this._points.length;t++)e=this._points[t],i.push({index:e.index,price:e.price,time:e.time});return this._lastPoint&&i.push({index:this._lastPoint.index,price:this._lastPoint.price,time:this._lastPoint.time}),this._currentMovingPoint&&this._startMovingPoint&&this.correctPoints(i),i},n.prototype.axisPoints=function(){return this.points()},n.prototype.fixedPoints=function(){var t,e,i,o,n=[];if(this._positionPercents&&!this.priceScale().isEmpty())for(t=0;t<this._positionPercents.length;t++)e=this._positionPercents[t],i=this._model.timeScale().width()*e.x,o=this.priceScale().height()*e.y,n.push(new r(i,o));else for(t=0;t<this._fixedPoints.length;t++)n.push(this._fixedPoints[t].clone());return this._lastPoint&&n.push(this._lastPoint.clone()),this._currentMovingPoint&&this._startMovingPoint&&this.correctFixedPoints(n),n},n.prototype._convertPriceFromPercentIfNeeded=function(t){var e,i=this.priceScale();i.isPercent()&&(e=this.ownerSource().firstValue(),t.price=i.priceRange().convertFromPercent(t.price,e))},n.prototype._convertPriceToPercentIfNeeded=function(t){var e,i=this.priceScale();i.isPercent()&&(e=this.ownerSource().firstValue(),t.price=i.priceRange().convertToPercent(t.price,e))},n.prototype._preparePoint=function(t,e){var i=t;return e&&e.shift&&this.points().length>=2&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(i,this.points()[this.points().length-2]),this._convertPriceFromPercentIfNeeded(i),i},n.prototype.addPoint=function(t,e,i){var o=this._preparePoint(t,e);return this._addPointIntenal(o,e,i)},n.prototype._addPointIntenal=function(t,e,i){this._points.push(t);var o=this._points.length===this.pointsCount();return o?(this._lastPoint=null,i||(this.normalizePoints(),this.createServerPoints())):this._lastPoint=t,this._pointAdded.fire(this._points.length-1),o},n.prototype.addFixedPoint=function(t){this._fixedPoints.push(t);var e=this._fixedPoints.length===this.pointsCount();return e&&this.calcPositionPercents(),e},n.prototype.calcPositionPercents=function(){var t,e,i,o;if(!this.priceScale()||this.priceScale().isEmpty())return[];for(this._positionPercents=[],t=0;t<this._fixedPoints.length;t++)e=this._fixedPoints[0],i=e.x/this._model.timeScale().width(),o=e.y/this.priceScale().height(),this._positionPercents.push({x:i,y:o});return this._positionPercents},n.prototype.calcMiddlePoint=function(t,e){return new r((t.x+e.x)/2,(t.y+e.y)/2)},n.prototype.restoreFixedPoints=function(){this._fixedPoints=this.fixedPoints()},n.prototype.onData=function(t){var e,i,o,n,r,s;if(t.params.customId===this.currentPointsetId()&&0!==t.params.plots.length){
for(e=0;e<t.params.plots.length;e++)i=t.params.plots[e],o=this._timePoint[i.index],n=i.value[0],r=new Date(1e3*i.value[1]),s={index:n,time:r,price:o.price},this._points.length<=i.index?(this._points.push(s),this._pointAdded.fire(this._points.length-1)):(this._points[i.index]=s,this._pointChanged.fire(i.index));this.checkAlert&&this.checkAlert(),this.updateAllViewsAndRedraw()}},n.prototype.correctPricesToPercents=function(){var t,e,i=this.priceScale(),o=this.ownerSource().firstValue();for(t=0;t<this._points.length;t++)e=this._points[t],e.price=i.priceRange().convertFromPercent(e.price,o),this._pointChanged.fire(t)},n.prototype.startChanging=function(t,e){t<this.m_priceAxisViews.length&&this.m_priceAxisViews[t].setActive(!0),t<this.m_timeAxisViews.length&&this.m_timeAxisViews[t].setActive(!0),this._properties.lastUpdateTime.setValue((new Date).valueOf())},n.prototype.setPoint=function(t,e,i){if(i&&i.shift&&this._properties.snapTo45Degrees){var o=0===t?1:t-1;this._snapPoint45Degree(e,this.points()[o])}this._convertPriceFromPercentIfNeeded(e),this._points[t]=e,this._pointChanged.fire(t),this.normalizePoints()},n.prototype.startMoving=function(t){this.isFixed()&&this.restoreFixedPoints(),this._convertPriceFromPercentIfNeeded(t),this._startMovingPoint=t,this._properties.lastUpdateTime.setValue((new Date).valueOf())},n.prototype.move=function(t){this._convertPriceFromPercentIfNeeded(t),this._currentMovingPoint=t,this.updateAllViews()},n.prototype.correctPoints=function(t){var e,i,o=this._currentMovingPoint.index-this._startMovingPoint.index,n=this._currentMovingPoint.price-this._startMovingPoint.price;if(0===o&&0===n)return!1;for(e=0;e<t.length;e++)i=t[e],i.index+=o,i.price+=n,t[e]=i;return!0},n.prototype.correctFixedPoints=function(t){var e,i=this._currentMovingPoint.subtract(this._startMovingPoint);for(e=0;e<t.length;e++)t[e]=t[e].add(i)},n.prototype.endMoving=function(t){var e,i,o;if(this._properties.interval.setValue(this._model.mainSeries().interval()),e=!1,i=!1,this._currentMovingPoint&&this._startMovingPoint){if(e=this._currentMovingPoint.index!==this._startMovingPoint.index,i=this._currentMovingPoint.price!==this._startMovingPoint.price,this.isFixed())this.correctFixedPoints(this._fixedPoints);else if(this.correctPoints(this._points))for(o=0;o<this._points.length;o++)this._pointChanged.fire(o);this._startMovingPoint=null,this._currentMovingPoint=null}if(this.isFixed())return this.calcPositionPercents(),void this.updateAllViews();this.normalizePoints(),this.updateAllViews(),e&&!t&&this.createServerPoints(),(i||e)&&this.synchronizeAlert(!this._alertUndoMode)},n.prototype.endChanging=function(t,e){var i;for(this._properties.interval.setValue(this._model.mainSeries().interval()),e||(this.normalizePoints(),this.createServerPoints()),i=0;i<this.m_priceAxisViews.length;i++)this.m_priceAxisViews[i].setActive(!1);for(i=0;i<this.m_timeAxisViews.length;i++)this.m_timeAxisViews[i].setActive(!1);this.synchronizeAlert(!t)},n.prototype.paneViews=function(t){var e,i;if(this.isSourceHidden())return null;for(e=[],
i=this._paneViews.length-1;i>=0;--i)e.push(this._paneViews[i]);return e},n.prototype._setPaneViews=function(t){this._paneViews=t,this._model.invalidate(new _(_.LIGHT_UPDATE))},n.prototype.dataWindowView=function(){return null},n.prototype.statusView=function(){return null},n.prototype.isSourceHidden=function(){return!this._properties.visible.value()||h.hideAllDrawings().value()&&this.canBeHidden()||!this._isActualInterval||!this._isActualSymbol},n.prototype.priceAxisViews=function(t,e){var i,o,n;return this.isSourceHidden()?null:-1!==t.dataSources().indexOf(this)&&e===this.priceScale()?this._model.lineBeingEdited()===this?(i=this._model.linePointBeingEdited(),i<this.m_priceAxisViews.length?(o=this.m_priceAxisViews.slice(),n=o[i],o.splice(i,1),o.push(n),o):this.m_priceAxisViews):this.m_priceAxisViews:null},n.prototype.timeAxisViews=function(){var t,e,i;return this.isSourceHidden()?null:this._model.lineBeingEdited()===this?(t=this._model.linePointBeingEdited(),t<this.m_timeAxisViews.length?(e=this.m_timeAxisViews.slice(),i=e[t],e.splice(t,1),e.push(i),e):this.m_timeAxisViews):this.m_timeAxisViews},n.prototype.updateAllViews=function(){var t,e,i;if(!this._isActualSymbol)return null;if(!this._properties.visible.value())return null;if(null!==(t=this.paneViews()))for(e=t,i=0;i<e.length;i++)e[i].update();for(e=this.m_priceAxisViews,i=0;i<e.length;i++)e[i].update();for(e=this.m_timeAxisViews,i=0;i<e.length;i++)e[i].update()},n.prototype.setLastPoint=function(t,e){this._lastPoint=this._preparePoint(t,e),this.updateAllViews()},n.prototype.setLastFixedPoint=function(t){this._lastFixedPoint=t,this.updateAllViews()},n.prototype.title=function(){return"Line Tool"},n._pointSetId=1,n.prototype.start=function(){this.createServerPoints()},n.prototype.createServerPoints=function(){var t,e,i,o,r,s;if(!this._recursiveGuard&&this._isActualSymbol&&this._model.chartApi().connected()&&(this.clearServerPoints(),!this._model.timeScale().isEmpty()&&(0===this._timePoint.length&&this.normalizePoints(),0!==this._timePoint.length))){for(this._currentPointsetId=++n._pointSetId,t=this._model.mainSeries().symbolId(),e=this.properties().interval.value(),i=[],o=0;o<this._timePoint.length;o++)r=this._timePoint[o],i.push([r.time_t,r.offset]);s=this,this._model.chartApi().createPointset(this.currentPointsetId(),"turnaround",t,e,i,function(t){s.onData(t)})}},n.prototype.clearServerPoints=function(){null!==this._currentPointsetId&&(this._model.chartApi().removePointset(this.currentPointsetId()),this._currentPointsetId=null)},n.prototype.isBeingEdited=function(){return this===this._model.lineBeingEdited()||this===this._model.sourceBeingMoved},n.prototype.isFixed=function(){return this.properties().locked&&this.properties().locked.value()},n.prototype.isLocked=n.prototype.isFrozen=function(){return this.properties().frozen&&this.properties().frozen.value()},n.prototype._tooltipFieldsHash={},
n.prototype._tooltipFieldsOrder=["time","price","index","time0","price0","time1","price1","time2","price2","time3","price3","time4","price4","distance","term","pointsPerBar"],n.prototype._tooltipFieldsOrdered=null,n.prototype._formatTooltip=function(){return null===this._tooltipFieldsOrdered&&(this._tooltipFieldsOrdered=new p(this._tooltipFieldsHash,p.byOrder(this._tooltipFieldsOrder))),this._tooltipFieldsOrdered.array.filter(function(t){return null!==t.value&&""!==t.value}).map(function(t){return"<span>"+t.title+":</span> "+t.value}).join("<br />")},n.prototype.pointToScreenPoint=function(t){var e,i,o,n,s,a,l=this._model.timeScale(),c=this.priceScale();if(!c||c.isEmpty()||l.isEmpty())return[new r(0,0),new r(0,0)];if(e=null,c.isPercent()){if(!this.ownerSource())return;if(null===(e=this.ownerSource().firstValue())||!isFinite(e))return}return i=l.indexToCoordinate(t.index,!0),o=t.price,c.isPercent()&&(o=c.priceRange().convertToPercent(o,e)),n=c.priceToCoordinate(o,!0),s=new r(i,n),i=l.indexToCoordinate(t.index,!1),n=c.priceToCoordinate(o,!1),a=new r(i,n),[s,a]},n.prototype.screenPointToPoint=function(t){var e=this._model.timeScale(),i=this.priceScale(),o=e.coordinateToIndex(t.x),n=i.coordinateToPrice(t.y),r=null;if(i.isPercent()){if(!this.ownerSource())return;if(null===(r=this.ownerSource().firstValue())||!isFinite(r))return}return i.isPercent()&&(n=i.priceRange().convertFromPercent(n,r)),{price:n,index:o}},n.prototype.tags=function(){return[this._constructor]},n.prototype._snapPoint45Degree=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f=this._model.timeScale(),m=f.indexToCoordinate(e.index),g=f.indexToCoordinate(t.index)-m,v=this.m_priceScale,y=e.price,b=t.price,S=this.ownerSource().firstValue();v.isPercent()&&(y=v.priceRange().convertToPercent(y,S)),o=v.priceToCoordinate(y),n=v.priceToCoordinate(b)-o,r=Math.round(Math.atan2(g,n)/Math.PI*4),2===Math.abs(r)?i||(t.price=y):0===Math.abs(r)||4===Math.abs(r)?i||(t.index=e.index):0===Math.abs(r)||4===Math.abs(r)?i||(t.index=e.index):(s=Math.sqrt(g*g+n*n),a=g<0?-1:1,l=n<0?-1:1,c=Math.max(Math.abs(n),Math.abs(g)),h=c*Math.sqrt(2),u=h/s,c/=u,d=Math.round(f.coordinateToIndex(m+c*a)),p=Math.abs(f.indexToCoordinate(d)-m),_=v.coordinateToPrice(o+p*l),t.index=d,t.price=_)},n.prototype.createPriceAxisView=function(t){return new s(this,{pointIndex:t})},n.prototype.version=1,n.isLineTool=function(t){var e=TradingView[t];return!!e&&TradingView.isInherited(e,n)},n.prototype.alertId=function(){return this._alertId},n.prototype.setAlert=function(t,e){},n.prototype.flushAlert=function(){delete this._alertId,delete this._alert,this.hasAlert.setValue(!1),window.saver&&window.saver.saveChartSilently(null,!1)},n.prototype._processAlertHanders=function(t){var e,i,o,n=this;("unsubscribe"!==(t="subscribe"===t?"subscribe":"unsubscribe")||n._alertCallbacks)&&(i="subscribe"===t?"on":"off",e=n.properties(),o=n._alertCallbacks||{flush:n.flushAlert.bind(n),hovered:function(t,e){e?n._model.setHoveredSource(n):n._model.hoveredSource()===n&&n._model.setHoveredSource(null)},selected:function(t,e){
e&&n._model.setSelectedSource(n)},synchronizeSilently:function(t){n.synchronizeAlert(!1)}},n._alertCallbacks||(n._alertCallbacks=o),n.getAlert().done(function(r){r&&(r[i]("destroy",o.flush),r[i]("change:hovered",o.hovered),r[i]("change:selected",o.selected),e.extendLeft&&e.extendLeft[t](n,o.synchronizeSilently),e.extendRight&&e.extendRight[t](n,o.synchronizeSilently))}))},n.prototype.editAlert=function(){},n.prototype.getAlert=function(t){var e,i=this;return t=t||{},e=$.Deferred(),TradingView.alertsDispatcher?TradingView.alertsDispatcher.requestAlert(i._alertId,{success:e.resolve.bind(e),error:e.reject.bind(e),fromCache:t.fromCache}):f.logError("[Alerts] Can't get alert without alerts dispatcher"),e.promise()},n.prototype.synchronizeAlert=function(t){var e=this;e.hasAlert.value()&&setTimeout(function(){function i(){e._alertUndoMode=!0,s.undoToCheckpoint(e._undoCheckpointAlert),setTimeout(function(){e._alertUndoMode=!1,e.localAndServerAlersMismatch=!1},0)}function o(t){var i=t.get("description")!==t.defaultDescription(),o=t.get("extra"),n=o.alertSeries(),r=e._model.mainSeries().stateForAlert();"MainSeries"===n.type&&r.actualSymbol===n.actualSymbol&&(o.mainSeries(r),o.alertSeries(r)),t.set("resolution",e.stateForAlert().interval),o.drawing(e),i||t.setDefaultDescription(),e.localAndServerAlersMismatch=!0}function n(t){TradingView.alertsDispatcher.restartAlert(t,{success:function(){e.localAndServerAlersMismatch=!1},error:i,complete:function(){delete e._undoCheckpointAlert}})}var r,s=e._getUndoHistory();e._undoCheckpointAlert||e._alertUndoMode||(r=s.undoStack().pop(),e._undoCheckpointAlert=s.createUndoCheckpoint(),r&&s.undoStack().push(r)),e.getAlert().done(function(e){o(e),t&&n(e)}).fail(i)},0)},n.prototype._getUndoHistory=function(){return this._model._undoModel.undoHistory},n.prototype.stateForAlert=function(){var t,e;if(this.canHasAlert())return t=this.state(),t.id=this.idForAlert(),t.uniqueId=this.idForAlert(),t.title=this.title(),t.interval=this._model.mainSeries().interval(),e=this._getAlertPlots(),e&&(t.plots=e),t},n.prototype._getAlertPlots=function(){return null},n.prototype._linePointsToAlertPlot=function(t,e,i,o){if(2!==t.length)return f.logError("[Drawing Alert] Wrong points"),null;var n=this._model.timeScale();return!n||n.isEmpty()?null:{type:"LinePlot",title:e||this.title(),timestamp:n.indexToTimePoint(0),offset1:t[0].index,offset2:t[1].index,price1:t[0].price,price2:t[1].price,extendBackward:i||!1,extendForward:o||!1}},n.prototype.getAlertIsActive=function(t){this.getAlert({fromCache:!0}).done(function(e){t(!!e&&e.get("active"))}).fail(function(){t(!1)})},n.prototype.geometry=function(){var t=this,e=function(e){var i=e.x/t._model.timeScale().width(),o=e.y/t.priceScale().height();return new r(i,o)};return this.points().map(function(i){var o=t.pointToScreenPoint(i)[0];return e(o)})},n.prototype.onlyYMoving=function(){return!1},n.prototype.model=function(){return this._model},n.prototype.isForcedDrawPriceAxisLabel=function(){return this.customization.forcePriceAxisLabel},
n.prototype.getInputsPropertyPage=function(){return g.LineToolInputsPropertyPage},n.prototype.getVisibilitiesPropertyPage=function(){return g.LineToolVisibilitiesPropertyPage},n.prototype.getSourceIcon=function(){var t=v[this.getType()];return void 0===t?null:{type:"svg",svgCode:t.icon}},n.prototype.destroy=function(){this.stop()},e.LineToolPriceAxisView=s,e.LineDataSource=n}).call(e,i(25))},,function(t,e,i){"use strict";var o,n,r=i(7).getLogger("Chart.DataSourcePropertyPages");e.propertyPages={},o=e.propertyPages,n=null,e.loadPropertyPages=function(){return null!==n?n:(r.logNormal("Start loading property pages"),n=new Promise(function(t){i.e(3).then(function(e){o.ChartStylesPropertyPage=i(1083),o.LineToolABCDPatternStylesPropertyPage=i(1084),o.LineToolArcStylesPropertyPage=i(1085),o.LineToolArrowMarkStylesPropertyPage=i(1086),o.LineToolBalloonStylesPropertyPage=i(1087),o.LineToolBarsPatternStylesPropertyPage=i(1088).LineToolBarsPatternStylesPropertyPage,o.LineToolBezierStylesPropertyPage=i(1089),o.LineToolBrushStylesPropertyPage=i(1090),o.LineToolCalloutStylesPropertyPage=i(1091),o.LineToolCircleLinesStylesPropertyPage=i(1092),o.LineToolDateAndPriceRangeStylesPropertyPage=i(1093),o.LineToolDateRangeStylesPropertyPage=i(1094),o.LineToolDisjointAngleStylesPropertyPage=i(1095),o.LineToolElliottStylesPropertyPage=i(1096),o.LineToolEllipseStylesPropertyPage=i(1097),o.LineToolFibChannelStylesPropertyPage=i(1098),o.LineToolFibCirclesStylesPropertyPage=i(1099),o.LineToolFibRetracementStylesPropertyPage=i(1078),o.LineToolFibSpeedResistanceArcsStylesPropertyPage=i(1100),o.LineToolFibSpeedResistanceFanStylesPropertyPage=i(1101),o.LineToolFibSpiralStylesPropertyPage=i(1102),o.LineToolFibTimeZoneStylesPropertyPage=i(1103),o.LineToolFibWedgeStylesPropertyPage=i(1104),o.LineToolFlatBottomStylesPropertyPage=i(1105),o.LineToolGannComplexStylesPropertyPage=i(1106).LineToolGannComplexStylesPropertyPage,o.LineToolGannFixedStylesPropertyPage=i(1107).LineToolGannFixedStylesPropertyPage,o.LineToolGannFanStylesPropertyPage=i(1108),o.LineToolGannSquareStylesPropertyPage=i(1109),o.LineToolGhostFeedInputsPropertyPage=i(400).LineToolGhostFeedInputsPropertyPage,o.LineToolGhostFeedStylesPropertyPage=i(400).LineToolGhostFeedStylesPropertyPage,o.LineToolHorzLineInputsPropertyPage=i(401).LineToolHorzLineInputsPropertyPage,o.LineToolHorzLineStylesPropertyPage=i(401).LineToolHorzLineStylesPropertyPage,o.LineToolIconStylesPropertyPage=i(1110),o.LineToolInputsPropertyPage=i(1076),o.LineToolLineTool5PointsPatternStylesPropertyPage=i(1111),o.LineToolNotePropertyPage=i(1112),o.LineToolParallelChannelStylesPropertyPage=i(1113),o.LineToolPitchfanStylesPropertyPage=i(1114),o.LineToolPitchforkStylesPropertyPage=i(1115),o.LineToolPolylineStylesPropertyPage=i(1116),o.LineToolPredictionStylesPropertyPage=i(1117),o.LineToolPriceLabelStylesPropertyPage=i(1118),o.LineToolProjectionStylesPropertyPage=i(1119),o.LineToolRectangleStylesPropertyPage=i(1120),o.LineToolRiskRewardInputsPropertyPage=i(402).LineToolRiskRewardInputsPropertyPage,
o.LineToolRiskRewardStylesPropertyPage=i(402).LineToolRiskRewardStylesPropertyPage,o.LineToolTextStylesPropertyPage=i(1121),o.LineToolTimeCyclesPropertyPage=i(1122),o.LineToolTrendAngleInputsPropertyPage=i(403).LineToolTrendAngleInputsPropertyPage,o.LineToolTrendAngleStylesPropertyPage=i(403).LineToolTrendAngleStylesPropertyPage,o.LineToolTrendBasedFibExtensionStylesPropertyPage=i(1123),o.LineToolTrendBasedFibTimeStylesPropertyPage=i(1124),o.LineToolTrendLineStylesPropertyPage=i(1125),o.LineToolTrianglePatternStylesPropertyPage=i(1126),o.LineToolTriangleStylesPropertyPage=i(1127),o.LineToolVertLineInputsPropertyPage=i(404).LineToolVertLineInputsPropertyPage,o.LineToolVertLineStylesPropertyPage=i(404).LineToolVertLineStylesPropertyPage,o.LineToolVisibilitiesPropertyPage=i(1128),o.StudyCompareInputsPropertyPage=i(1129),o.StudyDisplayPropertyPage=i(378).StudyDisplayPropertyPage,o.StudyInputsPropertyPage=i(246).StudyInputsPropertyPage,o.StudyLineDataSourcePropertyPage=i(1130),o.StudyOverlayStylesPropertyPage=i(1131),o.StudyPivotPointsStandardStylesPropertyPage=i(1132),o.StudyStrategyPropertyPage=i(1133),o.StudyStylesPropertyPage=i(378).StudyStylesPropertyPage,o.VolumePropertyPage=i(1134),r.logNormal("Property pages loaded"),t()}.bind(null,i)).catch(i.oe)}))}},,function(t,e,i){var o=i(569),n={},r={},s={},a={init:function(){var t,e,i,l;Object.keys(o).forEach(function(i){t=o[i],e=t.subsets,Array.isArray(e)?e.forEach(function(t){n[t]=1}):e&&Object.keys(e).forEach(function(t){n[t]=1}),n[i]=1}),i=Object.keys(n),i.forEach(function(t){i.forEach(function(i){if(void 0!==(l=o[i])){if(!(e=l.subsets))return;r.hasOwnProperty(t)||(r[t]=[]),Array.isArray(e)&&~e.indexOf(t)?r[t].push(i):t in e&&r[t].push(i)}})}),"undefined"!=typeof __initialDisabledFeaturesets&&__initialDisabledFeaturesets&&__initialDisabledFeaturesets.forEach(function(t){a.disable(t)}),"undefined"!=typeof __initialEnabledFeaturesets&&__initialEnabledFeaturesets&&__initialEnabledFeaturesets.forEach(function(t){a.enable(t)}),"undefined"!=typeof window&&(window.Featuresets=a),this.meta={_uniqueSetsNames:n,_setsReverseDependencies:r,_setsStates:s}},enabled:function(t){var e=function(t){var i,o,n=r.hasOwnProperty(t)?r[t]:[];if(!1===s[t])return!1;for(i=s[t],o=0;o<n.length;++o)i|=e(n[o]);return i};return!!e(t)},enable:function(t){s[t]=!0},disable:function(t){s[t]=!1},setEnabled:function(t,e){s[t]=!!e},_uniqueSets:function(){return Object.keys(n)}};a.init(),t.exports=a},function(t,e,i){"use strict";function o(t,e,i){this._defaultName=t;var n;i?n=e:(n=TradingView.clone(defaults(t)),e&&TradingView.merge(n,e)),r.call(this,n),this._defaultName=t,this.listeners().subscribe(this,o.prototype.onPropertyChanged),this._exclusions=[]}function n(t){o._saveDefaults=t}var r=i(25);inherit(o,r),o._saveDefaults=!1,o.prototype.addExclusion=function(t){this._exclusions.push(t)},o.prototype.restoreFactoryDefaults=function(){var t,e={};this._defaultName.startsWith("study_")&&(e=TradingView.clone(TradingView.factoryDefaults("study"))),
this._defaultName.startsWith("linetool")&&(e=TradingView.clone(TradingView.factoryDefaults("linetoolvisibilities"))),t=TradingView.clone(TradingView.factoryDefaults(this._defaultName)),this._defaultName.startsWith("study_")&&t.inputs&&delete t.inputs.symbol,"linetoolicon"===this._defaultName&&(t.icon=defaults(this._defaultName).icon),~["linetooltext","linetooltextabsolute","linetoolnote","linetoolnoteabsolute","linetoolcallout","linetoolballoon","linetoolarrowmark","linetoolarrowmarkleft","linetoolarrowmarkup","linetoolarrowmarkright","linetoolarrowmarkdown","linetoolhorzline","linetoolhorzray"].indexOf(this._defaultName)&&delete t.text,this._exclusions.forEach(function(e){delete t[e]}),TradingView.merge(e,t),this.merge(e),this._defaultName.startsWith("study_")||TradingView.saveDefaults(this._defaultName,this.state(this._exclusions)),this.listeners().fire(this)},o.prototype.cleanupFactoryDefaults=function(){var t={};TradingView.saveDefaults(this._defaultName,t),this.listeners().fire(this)},o.prototype.onPropertyChanged=function(){o._saveDefaults&&!this._defaultName.startsWith("study_")&&this.saveDefaults()},o.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions))},o.prototype.restoreDefaults=function(){var t=TradingView.clone(defaults(this._defaultName));this.merge(t),this.listeners().fire(this)},o.prototype.clone=function(t){return new o(this._defaultName,this.state(),t&&t.replaceByState)},e.DefaultProperty=o,e.saveDefaultProperties=n},function(t,e,i){"use strict";(function(t){function i(){return x}function o(){return P}function n(t){t=Math.max(f.ERROR,Math.min(f.DEBUG,t)),x=t,u()}function r(t,e){var i,o=0,n=0;for(i=t.length-1;i>=1&&(o+=8*(1+encodeURIComponent(t[i]).length),!(i-1>0&&(n=8*(1+encodeURIComponent(t[i-1]).length),o+n>e)));i--);return t.slice(i)}function s(t,e,i,o,n){var r={id:m,message:e,subSystemId:o,timestamp:+t};m+=1,i.unshift(r),void 0!==n&&i.length>n&&(i.length=n)}function a(t){var e,i=b.reduce(function(t,e){return t.concat(e)},[]);return i.sort(function(t,e){return t.id-e.id}),"number"==typeof t&&(i=i.slice(-t)),e=i.map(function(t){return new Date(t.timestamp).toISOString()+":"+t.subSystemId+":"+t.message.replace(/"/g,"'")}),r(e,g)}function l(t,e,i,n){var r,a;if((e!==w||n.id!==T)&&(r=new Date,t<=f.NORMAL&&s(r,e,i,n.id,n.maxCount),t<=x&&(!n.highRate||o())&&(!S||n.id.match(S)))){switch(a=r.toISOString()+":"+n.id+":"+e,t){case f.DEBUG:console.debug(a);break;case f.INFO:case f.NORMAL:n.color?console.log("%c"+a,"color: "+n.color):console.log(a);break;case f.WARNING:console.warn(a);break;case f.ERROR:console.error(a)}w=e,T=n.id,C&&clearTimeout(C),C=setTimeout(function(){w=null,T=null,C=NaN},1e3)}}function c(t,e){function i(t){return function(e){return l(t,e,o,n)}}var o,n;return void 0===e&&(e={}),o=[],b.push(o),n=Object.assign(e,{id:t}),{logDebug:i(f.DEBUG),logError:i(f.ERROR),logInfo:i(f.INFO),logNormal:i(f.NORMAL),logWarn:i(f.WARNING)}}function h(){P=!!p&&"true"===localStorage.getItem(y);var t=parseInt(p?localStorage.getItem(v)||"":"")
;Number.isNaN(t)&&(t=f.WARNING),n(t),L.logNormal("Init with settings - level: "+x+", high-rate: "+P)}function u(){try{p&&(localStorage.setItem(y,P+""),localStorage.setItem(v,x+""))}catch(t){L.logWarn("Cannot save logger state (level: "+x+", high-rate: "+P+") to localStorage: "+t.message)}}var d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L;Object.defineProperty(e,"__esModule",{value:!0}),d="undefined"!=typeof window?window:t,p=!1;try{localStorage.getItem(""),p=!0}catch(t){}_="undefined"!=typeof TradingView?TradingView:{},function(t){t[t.ERROR=1]="ERROR",t[t.WARNING=2]="WARNING",t[t.INFO=3]="INFO",t[t.NORMAL=4]="NORMAL",t[t.DEBUG=5]="DEBUG"}(f=e.LOGLEVEL||(e.LOGLEVEL={})),m=0,g=75497472,v="tv.logger.loglevel",y="tv.logger.logHighRate",b=[],S=null,w=null,T=null,C=NaN,x=f.WARNING,P=!1,e.getLogLevel=i,e.isHighRateEnabled=o,e.setLogLevel=n,e.getLogHistory=a,e.getLogger=c,L=c("logger"),e.loggingOn=d.lon=_.loggingOn=function(t,e){n(f.DEBUG),L.logNormal("Debug logging enabled"),P=!!t,S=e||null,u()},e.loggingNormal=_.loggingNormal=function(){n(f.NORMAL),L.logNormal("Logging set to normal level")},e.loggingOff=d.loff=function(){n(f.INFO),L.logInfo("Debug logging disabled")},h()}).call(e,i(78))},function(t,e,i){"use strict";function o(t,e){return new h(t,e)}function n(t,e){return t.x===e.x&&t.y===e.y}function r(t,e,i){if(0===t&&0===e)throw Error("A and B can not be both equal to zero.");return{A:t,B:e,C:i}}function s(t,e){var i,o,s;if(n(t,e))throw Error("Points should be distinct");return i=t.y-e.y,o=e.x-t.x,s=t.x*e.y-e.x*t.y,r(i,o,s)}function a(t,e){if(n(t,e))throw Error("Points of a segment should be distinct");return[t,e]}function l(t,e){return{edge:t,isPositive:e}}function c(t,e){return l(t,t.A*e.x+t.B*e.y+t.C>0)}Object.defineProperty(e,"__esModule",{value:!0});var h=function(){function t(t,e){this.x=t,this.y=e}return t.prototype.add=function(e){return new t(this.x+e.x,this.y+e.y)},t.prototype.addScaled=function(e,i){return new t(this.x+i*e.x,this.y+i*e.y)},t.prototype.subtract=function(e){return new t(this.x-e.x,this.y-e.y)},t.prototype.dotProduct=function(t){return this.x*t.x+this.y*t.y},t.prototype.length=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.scaled=function(e){return new t(this.x*e,this.y*e)},t.prototype.normalized=function(){return this.scaled(1/this.length())},t.prototype.transposed=function(){return new t(-this.y,this.x)},t.prototype.clone=function(){return new t(this.x,this.y)},t}();e.Point=h,e.point=o,e.equalPoints=n,e.line=r,e.lineThroughPoints=s,e.lineSegment=a,e.halfplane=l,e.halfplaneThroughPoint=c},function(t,e,i){"use strict";function o(t,e){if(!t)throw Error("Assertion failed"+(e?": "+e:""))}function n(t){if(void 0===t)throw Error("Value is undefined");return t}function r(t){if(null===t)throw Error("Value is null");return t}function s(t){return r(n(t))}Object.defineProperty(e,"__esModule",{value:!0}),e.assert=o,e.ensureDefined=n,e.ensureNotNull=r,e.ensure=s},function(t,e,i){"use strict";(function(t){function e(){this._listeners=[]}i(7).getLogger("Common.Delegate")
;e.prototype.subscribe=function(t,e,i){var o={object:t,member:e,singleshot:!!i};this._listeners.push(o)},e.prototype.unsubscribe=function(t,e){var i,o;for(i=0;i<this._listeners.length;++i)if(o=this._listeners[i],o.object===t&&o.member.prototype===e.prototype){this._listeners.splice(i,1);break}},e.prototype.unsubscribeAll=function(t){var e,i;for(e=this._listeners.length-1;e>=0;--e)i=this._listeners[e],i.object===t&&this._listeners.splice(e,1)},e.prototype.destroy=function(){delete this._listeners},e.prototype.fire=function(){var t,e,i=this._listeners.slice();for(t=0;t<i.length;++t)e=i[t],e.member.apply(e.object||null,arguments);for(t=this._listeners.length-1;t>=0;t--)this._listeners[t].singleshot&&this._listeners.splice(t,1)},"undefined"!=typeof window&&(window.Delegate=e),void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(42)(t))},function(t,e,i){"use strict";var o=function(){function t(t,e,i){this._result=t,this._data=e,this._eraseMarker=i}return t.prototype.result=function(){return this._result},t.prototype.data=function(){return this._data},t.prototype.eraseMarker=function(){return this._eraseMarker},t.MOVEPOINT_BACKGROUND=1,t.REGULAR=2,t.MOVEPOINT=3,t.CHANGEPOINT=4,t.CUSTOM=5,t.CUSTOM_MOVE=6,t}();t.exports=o},function(t,e,i){"use strict";function o(t){return t?(window._tv_languages||{})[t]||null:null}function n(){document.body&&document.body.dispatchEvent(new a.CustomEvent("tradingview-i18next-initialized"))}var r,s,a,l,c,h,u,d;i(571),r=i(293),s=i(285),a=i(572),l={translate:r.translationFunction},window.__tradingviewI18nextInited||(c=window.language||null,h=o(c),c&&h||(console.error("No translation data"),c="en",h=o("en")),c&&h?(u={interpolation:{prefix:"__",suffix:"__"},keySeparator:":::",lng:c,nsSeparator:":::",resources:(d={},d[c]={translation:h},d)},s.init(u,n),l.translate=s.t.bind(s),r.addTranslationFunctionToWindow(l.translate),r.addTranslationFunctionToJQuery(l.translate)):n(),window.__tradingviewI18nextInited=!0),t.exports=l},,,function(t,e,i){(function(t){function e(t){return"number"==typeof t&&isFinite(t)}function i(t){return"string"==typeof t?JSON.parse(t):t}function o(t){return null!==t&&void 0!==t&&t.constructor===Function}function n(t){return h(t)&&t.then}function r(t,e){t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),t.prototype.superclass=e}function s(t,e){for(var i in t.prototype)"function"==typeof t.prototype[i]&&t.prototype.hasOwnProperty(i)&&(t.prototype[i]=function(){throw Error(e+"::"+i+" is an interface member declaration and must be overloaded in order to be called")})}function a(t,e,i,o){for(var n in i.prototype)if("function"==typeof i.prototype[n]&&!t.prototype[n])throw Error("Interface implementation assertion failed: "+e+" does not implement "+o+"::"+n+" function")}var l,c=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},h=function(t){return"object"==typeof t&&null!==t},u=function(t){return h(t)&&-1!==(""+t.constructor).indexOf("function Object")}
;"undefined"!=typeof window?(l=window.TradingView=window.TradingView||{},window.isNumber=e,window.isFunction=o,window.inherit=r,window.isArray=c):l=this.TradingView=this.TradingView||{},l.isNaN=function(t){return!(t<=0||t>0)},l.isAbsent=function(t){return null===t||void 0===t},l.isExistent=function(t){return null!==t&&void 0!==t},Number.isNaN=Number.isNaN||function(t){return t!=t},l.isSameType=function(t,e){return Number.isNaN(t)||Number.isNaN(e)?Number.isNaN(t)===Number.isNaN(e):{}.toString.call(t)==={}.toString.call(e)},l.isInteger=function(t){return"number"==typeof t&&t%1==0},l.parseBool=function(t){return!0===t||"true"===t},l.isBoolean=function(t){return!0===t||!1===t},l.isString=function(t){return null!==t&&void 0!==t&&t.constructor===String},l.isInherited=function(t,e){return t===e||!(!t||!t.prototype)&&(void 0!==t.prototype.superclass&&null!==t.prototype.superclass&&(t.prototype.superclass===e||l.isInherited(t.prototype.superclass,e)))},l.TypeValidator=function(t){this.m_type=t},l.TypeValidator.prototype.check=function(t){return t.constructor===this.m_type||l.isInherited(t.constructor,this.m_type)},l.PredicateValidator=function(t){this.m_predicate=t},l.PredicateValidator.prototype.check=function(t){return this.m_predicate(t)},l.clone=function(t){var e,i,o;if(!t||"object"!=typeof t)return t;e="function"==typeof t.pop?[]:{};for(i in t)t.hasOwnProperty(i)&&(o=t[i],e[i]=o&&"object"==typeof o?l.clone(o):o);return e},l.deepEquals=function(t,e,i){var n,r,s,a,h;if(i||(i=""),t===e)return[!0,i];if(o(t)&&(t=void 0),o(e)&&(e=void 0),void 0===t&&void 0!==e)return[!1,i];if(void 0===e&&void 0!==t)return[!1,i];if(null===t&&null!==e)return[!1,i];if(null===e&&null!==t)return[!1,i];if("object"!=typeof t&&"object"!=typeof e)return[t===e,i];if(Array.isArray(t)&&Array.isArray(e)){if(n=t.length,r=e.length,n!==r)return[!1,i];for(s=0;s<n;s++)if(a=l.deepEquals(t[s],e[s],i+"["+s+"]"),!a[0])return a;return[!0,i]}if(c(t)||c(e))return[!1,i];for(h in t)if(a=l.deepEquals(t[h],e[h],i+"["+h+"]"),!a[0])return a;return[!0,i]},l.merge=function(t,e){for(var i in e)"object"==typeof e[i]&&t.hasOwnProperty(i)?l.merge(t[i],e[i]):t[i]=e[i];return t},l.mergeObj=function(t,e){for(var i in e)e[i].constructor===Object&&t.hasOwnProperty(i)?l.mergeObj(t[i],e[i]):t[i]=e[i];return t},l.mergeWithRules=function(t,e,i,o){var n,r;for(n in e)r=o?o+"."+n:n,i&&r in i?t[n]=i[r](t[n],e[n]):"object"==typeof e[n]&&t.hasOwnProperty(n)?l.merge(t[n],e[n],i,r):t[n]=e[n]},l.sortMultipleFunction=function(){var t=[].slice.call(arguments),e=t.length;return function(i,o){var n,r,s,a,l,c,h;for(h=0;h<e&&(c=0,s=t[h],a="string"==typeof s?s:s.name,n=i[a],r=o[a],"function"==typeof s.fn&&(n=s.fn(n),r=s.fn(r)),l=s.reverse?-1:1,n<r&&(c=-1*l),n>r&&(c=1*l),0===c);h++);return c}},void 0!==t&&t&&t.exports&&(t.exports={inherit:r,clone:l.clone,merge:l.merge,isNumber:e,isInteger:l.isInteger,isBoolean:l.isBoolean,isString:l.isString,isObject:h,isHashObject:u,isPromise:n,isNaN:l.isNaN,isAbsent:l.isAbsent,isExistent:l.isExistent,isSameType:l.isSameType,isArray:c,parseBool:l.parseBool,
parseJSONorNot:i,deepEquals:l.deepEquals,declareClassAsPureInterface:s,requireFullInterfaceImplementation:a})}).call(e,i(42)(t))},,function(t,e,i){"use strict";(function(t){function e(){}function i(t){if(!(this instanceof i))return new i(t);arguments.length>0&&(this._value=t),this._listeners=[]}i.prototype.value=function(){return this._owner?this._owner._value:this._value},i.prototype.setValue=function(t,e){var i,o,n,r=this._owner?this._owner:this;if("function"==typeof r.hook&&(t=r.hook(t)),r.writeLock)return r._value;if(!e&&r._value===t&&r.hasOwnProperty("_value"))return t;for(r._value=t,i=r._listeners.slice(),o=0,n=0;n<i.length;n++)i[n].once&&(r._listeners.splice(n-o,1),o++),i[n].cb(t);return t},i.prototype.deleteValue=function(){var t,e,i,o=this._owner?this._owner:this;if(o.hasOwnProperty("_value")){if(o.writeLock)return o._value;for(delete o._value,t=o._listeners.slice(),e=0,i=0;i<t.length;i++)t[i].once&&(o._listeners.splice(i-e,1),e++),t[i].cb()}},i.prototype.subscribe=function(t,e){var i,o,n;if("function"!=typeof t)throw new TypeError("callback must be a function");i=!!e&&!!e.once,o=!!e&&!!e.callWithLast,n=this._owner?this._owner:this,o&&n.hasOwnProperty("_value")&&(t(n._value),i)||n._listeners.push({cb:t,owner:this,once:!!e&&!!e.once})},i.prototype.unsubscribe=function(t){var e,i,o=this._owner?this._owner:this;for(void 0===t&&(t=null),e=o._listeners,i=e.length;i--;)e[i].owner!==this&&o!==this||e[i].cb!==t&&null!==t||e.splice(i,1)},i.prototype.listeners=function(){return(this._owner?this._owner:this)._listeners},i.prototype.readonly=function(){if(this._readonlyInstance)return this._readonlyInstance;var t=this._readonlyInstance=new e;return t.subscribe=this.subscribe.bind(this),t.unsubscribe=this.unsubscribe.bind(this),t.value=this.value.bind(this),t.when=this.when.bind(this),t.spawn=function(){return this.spawn().readonly()}.bind(this),t},i.prototype.spawn=function(){var t=new i;return delete t._listeners,t._owner=this._owner||this,t.destroy=function(){this.unsubscribe(),delete this._owner},t},i.prototype.when=function(t){var e,i=this;if(this.value())return void t();e=function(o){o&&(i.unsubscribe(e),t())},i.subscribe(e)},i.prototype.opposite=function(){var t,e;return this._opposite||(t=this,e=new i(!this.value()),this.subscribe(function(t){e.setValue(!t)}),e.subscribe(function(e){t.setValue(!e)}),this._opposite=e),this._opposite},"undefined"!=typeof window&&(window.WatchedValue=i),void 0!==t&&t&&t.exports&&(t.exports=i)}).call(e,i(42)(t))},,function(t,e,i){"use strict";function o(t,e){var i,o;return null===t?e:null===e?t:(i=Math.min(t.min,e.min),o=Math.max(t.max,e.max),{min:i,max:o})}var n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),n=i(9),r=i(86),s=i(7),a=s.getLogger("Chart.PlotList"),function(t){t[t.NearestLeft=-1]="NearestLeft",t[t.Exact=0]="Exact",t[t.NearestRight=1]="NearestRight"}(l=e.PlotRowSearchMode||(e.PlotRowSearchMode={})),c=30,h=-2e6,u=function(){function t(t){void 0===t&&(t=[]),this._items=[],this._plotNames=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache={},
this._rowSearchCache={},this._plotNames=t}return t.prototype.clear=function(){this._items=[],this._start=0,this._end=0,this._shareRead=!1,this._minMaxCache={},this._rowSearchCache={}},t.prototype.plotNames=function(){return this._plotNames},t.prototype.first=function(){return this.size()>0?this._items[this._start]:null},t.prototype.last=function(){return this.size()>0?this._items[this._end-1]:null},t.prototype.firstIndex=function(){return this.size()>0?this._indexAt(this._start):null},t.prototype.lastIndex=function(){return this.size()>0?this._indexAt(this._end-1):null},t.prototype.size=function(){return this._end-this._start},t.prototype.isEmpty=function(){return 0===this.size()},t.prototype.contains=function(t){return null!==this._search(t)},t.prototype.valueAt=function(t){var e=this.search(t);return null!==e?e.value:null},t.prototype.add=function(t,e){var i,o;return this._shareRead?(a.logDebug("add: readonly collection modification attempt"),!1):(i={index:t,value:e},o=this._search(t),this._rowSearchCache={},null===o?(this._items.splice(this._lowerbound(t),0,i),this._start=0,this._end=this._items.length,!0):(this._items[o]=i,!1))},t.prototype.search=function(t,e){var i,o;return void 0===e&&(e=l.Exact),this._rowSearchCache[t]&&this._rowSearchCache[t][e]?this._rowSearchCache[t][e]:null===(i=this._search(t,e))?null:(o={index:this._indexAt(i),value:this._valueAt(i)},this._rowSearchCache[t]=this._rowSearchCache[t]||{},this._rowSearchCache[t][e]=o,o)},t.prototype.fold=function(t,e){var i,o,n,r=e;for(i=this._start;i<this._end;++i)o=this._indexAt(i),n=this._valueAt(i),r=t(o,n,r);return r},t.prototype.findFirst=function(t,e){var i,o,n,r=void 0!==e&&Math.min(this._start+e,this._end)||this._end;for(i=this._start;i<r;++i)if(o=this._indexAt(i),n=this._valueAt(i),t(o,n))return{index:o,value:n};return null},t.prototype.findLast=function(t,e){var i,o,n,r=void 0!==e&&Math.max(this._end-e,this._start)||this._start;for(i=this._end-1;i>=r;--i)if(o=this._indexAt(i),n=this._valueAt(i),t(o,n))return{index:o,value:n};return null},t.prototype.each=function(t){var e,i,o;for(e=this._start;e<this._end&&(i=this._indexAt(e),o=this._valueAt(e),!t(i,o));++e);},t.prototype.reduce=function(t,e){var i,o,n,r=e;for(i=this._start;i<this._end;++i)o=this._indexAt(i),n=this._valueAt(i),r=t(r,o,n);return r},t.prototype.range=function(e,i){var o=new t;return o._items=this._items,o._start=this._lowerbound(e),o._end=Math.min(this._lowerbound(i)+1,o._items.length),o._shareRead=!0,o},t.prototype.minMaxOnRange2=function(t,e,i){var r,s,a,l,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C;if(this.isEmpty())return null;for(r=null,s=n.ensureNotNull(this.firstIndex()),a=n.ensureNotNull(this.lastIndex()),l=0,h=i;l<h.length;l++){for(u=h[l],d=t-u.offset,p=e-u.offset,d=Math.max(d,s),p=Math.min(p,a),_=Math.ceil(d/c)*c,f=Math.max(_,Math.floor(p/c)*c),m=this._lowerbound(d),g=this._upperbound(Math.min(p,_,e)),v=this._plotMinMax(m,g,u),r=o(r,v),this._minMaxCache[u.index]||(this._minMaxCache[u.index]={}),y=this._minMaxCache[u.index],b=Math.max(_+1,d);b<f;b+=c)S=Math.floor(b/c),w=y[S],
void 0===w&&(T=S*c,C=(S+1)*c-1,w=this.minMaxOnRange(T,C,[u]),y[S]=w),r=o(r,w);m=this._lowerbound(f),g=this._upperbound(p),v=this._plotMinMax(m,g,u),r=o(r,v),void 0!==u.baseValue&&null!==r&&(r.min=r.min?Math.min(u.baseValue,r.min):r.min,r.max=r.min?Math.max(u.baseValue,r.max):r.max)}return r},t.prototype.minMaxOnRange=function(t,e,i){var n,r,s,a,l,c,h=null;for(n=0,r=i;n<r.length;n++)s=r[n],a=this._lowerbound(t-s.offset),l=Math.min(this._lowerbound(e-s.offset)+1,this._items.length),this._items[this._end-1]&&this._items[l-1].index>e-s.offset&&(l=a),c=this._plotMinMax(a,l,s),h=o(h,c),void 0!==s.baseValue&&null!==h&&(h.min=h.min?Math.min(s.baseValue,h.min):h.min,h.max=h.max?Math.max(s.baseValue,h.max):h.max);return h},t.prototype.merge=function(t){var e,i,o,n;if(this._shareRead)return a.logDebug("merge: readonly collection modification attempt"),[];for(e=[],e.earliestRow=null,i=0,o=t;i<o.length;i++)n=o[i],this._invalidateCacheForRow(n),(null===e.earliestRow||e.earliestRow.index>n.index)&&(e.earliestRow=n),this.add(n.index,n.value)?e.push({insert:n}):e.push({update:n});return e},t.prototype.addTail=function(t,e){var i,o,n,r;for(void 0===e&&(e=!1),i=0,e&&this._end-this._start>0&&(i=1,this._items[this._end-this._start-1].value=t[0].value),o=i;o<t.length;++o){if(n=t[o],null===(r=this.lastIndex())){a.logError("Can't add tail to the empty plotlist");break}this.add(r+1,n.value)}this._rowSearchCache={}},t.prototype.move=function(t){var e,i,o,n,r,s,l,c;if(this._shareRead)return a.logDebug("move: readonly collection modification attempt"),[];for(e=[],e.earliestRow=null,i=0,o=t;i<o.length;i++)n=o[i],null!==(r=this._search(n.old))&&(s=this._items[r].value,l={index:n.old,value:s},this._items.splice(r,1),this._end=this._items.length,e.push({remove:l}),this._invalidateCacheForRow(l),n.new!==h&&(c={index:n.new,value:s},(null===e.earliestRow||e.earliestRow.index>c.index)&&(e.earliestRow=c),this.add(c.index,c.value)?e.push({insert:c}):e.push({update:c}),this._invalidateCacheForRow(c)));return this._rowSearchCache={},e},t.prototype.remove=function(t){var e,i,o,n,r,s;if(this._shareRead)return a.logDebug("remove: readonly collection modification attempt"),[];if(null===(e=this._search(t,l.NearestRight)))return[];if(i=[],o=this._items.splice(e),o.length>0)for(i.earliestRow=o[0],n=0,r=o;n<r.length;n++)s=r[n],i.push({remove:s});return this._end=this._items.length,this._minMaxCache={},this._rowSearchCache={},i},t.prototype.state=function(){return{columns:this._plotNames,start:this._start,end:this._end,data:this._items,shareread:this._shareRead}},t.prototype.restoreState=function(t){if(!t)return void this.clear();this._plotNames=t.columns,this._start=t.start,this._end=t.end,this._shareRead=t.shareread,this._items=t.data,this._minMaxCache={},this._rowSearchCache={}},t.prototype._indexAt=function(t){return this._items[t].index},t.prototype._valueAt=function(t){return this._items[t].value},t.prototype._length=function(){return this._items.length},t.prototype._search=function(t,e){var i,o=this._bsearch(t);return null===o&&e?e<0?(i=this._lowerbound(t),
i>this._start&&(i-=1),i!==this._end&&this._indexAt(i)<t?i:null):(i=this._upperbound(t),i!==this._end&&t<this._indexAt(i)?i:null):o},t.prototype._bsearch=function(t){var e=this._lowerbound(t);return e===this._end||t<this._items[e].index?null:e},t.prototype._lowerbound=function(t){return r.lowerbound(this._items,t,function(t,e){return t.index<e},this._start,this._end)},t.prototype._upperbound=function(t){return r.upperbound(this._items,t,function(t,e){return e.index>t},this._start,this._end)},t.prototype._plotMinMax=function(t,e,i){var o,n,r,s=null;for(o=t;o<e;o++)n=this._items[o].value,void 0===(r=n[i.index])||null===r||Number.isNaN(r)||(null===s?s={min:r,max:r}:(r<s.min&&(s.min=r),r>s.max&&(s.max=r)));return s},t.prototype._invalidateCacheForRow=function(t){var e,i=Math.floor(t.index/c);for(e=0;e<this._plotNames.length;e++)this._minMaxCache[e]&&delete this._minMaxCache[e][i]},t}(),e.PlotList=u,e.mergeMinMax=o},,function(t,e,i){"use strict";(function(e){function o(t,e,i,o){this._map=$.extend({},this._map,o),e&&(e=this.unpackLevels(e)),r.call(this,t,e,i),this.updateCollectibleProperty()}var n=i(15).isSameType,r=i(6).DefaultProperty,s=i(809);inherit(o,r),o.prototype.state=function(t,i){t=t||[],t.push("__collectibleLines");var o=e.prototype.state.call(this,t);return i?o:this.packLevels(o)},o.prototype.clone=function(){var t=this.state();return this.__collectibleLines&&(t.__collectibleLines=this.__collectibleLines.state()),new o(this._defaultName,t)},o.prototype.merge=function(t){e.prototype.merge.call(this,this.unpackLevels(t)),this.updateCollectibleProperty()},o.prototype._map={prefixes:[""],range:[0,0],names:["coeff","color","visible","linestyle","linewidth"],typecheck:{pack:Object,unpack:Array}},o.prototype._packLvlTpl=function(){return[]},o.prototype._unpackLvlTpl=function(){return{}},o.prototype._packLvlFill=function(t,e,i,o){return o.push(i[e]),o},o.prototype._unpackLvlFill=function(t,e,i,o){return o[e]=i[t],o},o.prototype._iterateLevels=function(t,e){var i,o,r,s,a;for(i in this._map.prefixes)for(o=(this._map.prefixes[i]||"")+"level",r=this._map.range[0];r<=this._map.range[1];r++)if(t[o+r]&&n(t[o+r],e.typecheck())){s=e.tpl();for(a in this._map.names)s=e.fill(a,this._map.names[a],t[o+r],s);t[o+r]=s}return t},o.prototype.packLevels=function(t){return this._iterateLevels(t,{tpl:this._packLvlTpl,fill:this._packLvlFill,typecheck:this._map.typecheck.pack})},o.prototype.unpackLevels=function(t){return this._iterateLevels(t,{tpl:this._unpackLvlTpl,fill:this._unpackLvlFill,typecheck:this._map.typecheck.unpack})},o.prototype.saveDefaults=function(){TradingView.saveDefaults(this._defaultName,this.state(this._exclusions,!0))},o.prototype.updateCollectibleProperty=function(){var t,e;this.__collectibleLines&&(t=this,e=[],this.__collectibleLines._childs.forEach(function(i){var o,n=t.__collectibleLines[i].value(),r=n.split("."),s=t[r[0]];for(o=1;o<r.length&&s;++o)s=s[r[o]];s&&e.push({property:s.color,defaultValue:s.color.value()})}),this.collectibleColors?this.collectibleColors.reloadProperties(e):this.collectibleColors=new s(e))
},t.exports=o}).call(e,i(25))},function(t,e,i){"use strict";function o(t){this._invalidationLevel=t||o.UPDATE_CURSOR_ONLY,this._invalidatedPanes={}}o.UPDATE_CURSOR_ONLY=1,o.LIGHT_UPDATE=2,o.FULL_UPDATE=3,o.prototype.invalidatePane=function(t,e){this._invalidatedPanes[t]?this._invalidatedPanes[t]=Math.max(this._invalidatedPanes[t],e):this._invalidatedPanes[t]=e},o.prototype.invalidateAll=function(t){this._invalidationLevel=Math.max(this._invalidationLevel,t)},o.prototype.fullInvalidation=function(){return this._invalidationLevel},o.prototype.invalidateForPane=function(t){return this._invalidatedPanes[t]?Math.max(this._invalidatedPanes[t],this._invalidationLevel):this._invalidationLevel},o.prototype.merge=function(t){this.force=this.force||t.force,this._invalidationLevel=Math.max(this._invalidationLevel,t._invalidationLevel);for(var e in t._invalidatedPanes)this._invalidatedPanes[e]?this._invalidatedPanes[e]=Math.max(this._invalidatedPanes[e],t._invalidatedPanes[e]):this._invalidatedPanes[e]=t._invalidatedPanes[e]},o.prototype.exclude=function(t){this._invalidationLevel<=t&&(this._invalidationLevel=0);for(var e in this._invalidatedPanes)this._invalidatedPanes[e]<=t&&(this._invalidatedPanes[e]=0)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){h[t].unsubscribe(i,e)}function n(t,e,i){r(t,e,i)}function r(t,e,i,o){if(h.hasOwnProperty(t)||(h[t]=new c),d[t])return void e.call(i);h[t].subscribe(i,e,o)}function s(t){u.push(t)}function a(t){var e,i,o=[];for(e=1;e<arguments.length;e++)o[e-1]=arguments[e];i=[t].concat(o),u.forEach(function(t){t.apply(null,i)}),h.hasOwnProperty(t)&&h[t].fire.apply(h[t],o)}function l(t){d[t]&&console.warn("Something went wrong: emitOnce called multiple times with same event ("+t+")"),d[t]=!0,a.apply(null,arguments)}var c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),c=i(10),h={},u=[],d={},e.unsubscribe=o,e.on=n,e.subscribe=r,e.subscribeToAll=s,e.emit=a,e.emitOnce=l},function(t,e,i){"use strict";(function(t,e,o){var n,r,s,a,l;i(64),n=i(200).regExpEscape,r=i(93).TVXWindowEvents,s=i(199).TVLocalStorage,a=["s.tradingview.com","betacdn.tradingview.com"],l=window.TVSettings=function(){function i(t){return D+"."+t}function o(t,e){var i;return i=V[t],window.is_authenticated&&!W||null!=i||(i=V[t]),null==i?e:i}function c(t,e){var i=o(t,void 0);if(null==i)return e;try{return JSON.parse(i)}catch(i){return f(t),e}}function h(t,e){var i=o(t);return null==i?e:!(!i||"false"===i||0==+i)}function u(t,e,i){var n,r=o(t,void 0,i);if(null==r)return e;if(n=parseFloat(r),!isFinite(n))throw new TypeError('"'+r+'" is not float (key: "'+t+'")');return n}function d(t,e,i){var n,r=o(t,void 0,i);if(null==r)return e;if(n=parseInt(r,10),!isFinite(n))throw new TypeError('"'+r+'" is not int (key: "'+t+'")');return n}function p(t,e,i){i=i||{};var o=""+e;return V[t]!==o&&(V[t]=o,g(t)),i.forceFlush&&!B&&(B=setTimeout(function(){B=void 0,v()},E)),l}function _(t,e,i){return p(t,JSON.stringify(e),i),l}function f(t,e){return e=e||{},null!=V[t]&&(delete V[t],g(t)),e.forceFlush&&v(),l}function m(){R=void 0,
O.length&&v()}function g(t){if(H)null==V[t]?H.removeValue(i(t)):H.setValue(i(t),V[t]);else if(!window.is_authenticated||W)try{null==V[t]?s.removeItem(i(t)):s.setItem(i(t),V[t])}catch(t){}else O.push(t),R||(R=setTimeout(m,M));r.emit("settings",JSON.stringify({key:t,value:V[t]}))}function v(e){var i,o,n,r,s;if(!t.enabled("widget")&&window.is_authenticated&&!W&&0!==O.length){for(i=O,O=[],o={},n=i.length;n--;)r=i[n],s=V[r],void 0===s&&(s=null),o[r]=s;$.ajax({url:"/savesettings/",type:"POST",data:{delta:JSON.stringify(o)},async:!e})}}function y(){var t,e,i;for(t=0;t<s.length;t++)e=s.key(t),i=D.length,e.substring(0,i+1)===D+"."&&(O=[],s.removeItem(e));$.post("/restoredefaults/",{},function(t){TVDialogs.showNotice("Success","Defaults has been successfully restored")}).error(function(t){})}function b(){return Object.keys(V)}function S(t,e){var i,o=b(e),r=[];for(t=RegExp("^"+n(t).replace(/\\\*\\\*/gi,".+").replace(/\\\*/gi,"[^.]+")+"$","gi"),i=o.length-1;i>=0;i--)t.test(o[i])&&r.push(o[i]),t.lastIndex=0;return r}function w(t){for(var e=0;e<z.length;++e)if(z[e].exec(t))return!0;return!1}function T(){var e,i,o,n,r;for(V={},e=D+".",i=!t.enabled("save_chart_properties_to_local_storage"),o=s.length;o--;)(n=s.key(o))&&n.substring(0,e.length)===e&&(r=n.substring(e.length),i&&!w(r)||(V[r]=s.getItem(n)))}function C(t){var e,i,o,n,r;for(V={},e=0===Object.keys(t).length,i=D+".",o=s.length;o--;)(n=s.key(o))&&n.substring(0,i.length)===i&&(e&&(r=n.substring(i.length),p(r,s.getItem(n))),s.removeItem(n));Object.keys(t).forEach(function(e){V[e]=t[e]+""})}function x(){var t,e,i,o;if(TradingView.onWidget()&&a.includes(window.location.host))for(t="tradingview.",e=s.length;e--;)i=s.key(e),0===i.indexOf(t)&&(o=i.replace(t,D+"."),s.setItem(o,s.getItem(i)),s.removeItem(i))}function P(t){H?C(H.initialSettings||{}):window.is_authenticated&&!W?C(t||{}):(x(),T()),F.fire()}function L(t){H=t}var I,k,A,M,E,D,V,O,R,B,z,F,N=!1,W=t.enabled("cqg_terminal"),H=null;try{N=!TradingView.onWidget()&&parent&&parent!==window&&!!parent.IS_DEMO_PAGE}catch(t){}return N?(I={"widgetbar.layout-settings":{widgets:{},settings:{minimized:!0}},notShowMainWizard:!0},k=function(t,e,i){var o=I[t];return null==o?e:o},A=function(){},{loaded:!1,loadedModel:!1,getValue:k,getJSON:k,getBool:k,getFloat:k,getInt:k,setValue:A,setJSON:A,remove:A,restoreDefaults:A,keys:function(){return Object.keys(I)},keysMask:function(){return[]},sync:A,onSync:{subscribe:function(){}}}):(M=12e4,E=10,"local"===window.environment&&(M=5e3),D=TradingView.onWidget()?"tradingview-widget":"tradingview",V={},O=[],z=[/^widgetbar\.widget\.watchlist.+/,/.+quicks$/,/^widgetbar\.layout-settings$/,/^ChartSideToolbarWidget\.visible$/,/^onwidget\.watchlist$/,/^domepanel.visible$/,/^chart\.favoriteDrawings$/,/^chart\.favoriteDrawingsPosition$/,/^ChartFavoriteDrawingToolbarWidget\.visible/,/^trading\.chart\.proterty$/,/^trading_floating_toolbar\.position$/],r.on("settings",function(t){var e=JSON.parse(t);null==e.value?delete V[e.key]:V[e.key]=e.value}),F=new e,document.addEventListener("visibilitychange",function(){
"hidden"!==document.visibiltyState&&!0!==document.hidden||v()}),window.addEventListener("unload",function(){v(!0)}),{loaded:!1,loadedModel:!1,getValue:o,getJSON:c,getBool:h,getFloat:u,getInt:d,setValue:p,setJSON:_,remove:f,restoreDefaults:y,keys:b,keysMask:S,sync:P,onSync:F,setSettingsAdapter:L})}(),void 0!==o&&o&&o.exports&&(o.exports=l)}).call(e,i(5),i(10),i(42)(t))},function(t,e,i){"use strict";(function(e){function i(t){if(this._listeners=new e,this._childs=[],void 0!==t&&null!==t)if(this.isPrimitiveType(t))this._value=t;else for(var i in t)this.addProperty(i,t[i])}i.prototype.merge=function(t){var e,i;if(null!=t)if(this.isPrimitiveType(t))this._value=t;else if(Array.isArray(t))for(e=0;e<t.length;e++)this[e]?this[e].merge(t[e]):this.addProperty(e,t[e]);else for(i in t)this[i]?this[i].merge(t[i]):this.addProperty(i,t[i])},i.prototype.state=function(t){var e,i,o,n,r,s=this._value;for(void 0===s&&(s={}),e=0;e<this._childs.length;e++)if(i=this._childs[e],!t||-1===t.indexOf(i))if(t){for(o=[],n=0;n<t.length;n++)r=t[n],r.startsWith(i+".")&&o.push(r.substr(i.length+1));s[i]=this[i].state(o)}else s[i]=this[i].state();return s},i.prototype.clone=function(t){return new i(this.state())},i.prototype.isPrimitiveType=function(t){return!!isNumber(t)||(!!new TradingView.TypeValidator(String).check(t)||TradingView.isBoolean(t))},i.prototype.value=function(){return this._value},i.prototype.listeners=function(){return this._listeners},i.prototype.childCount=function(){return this._childs.length},i.prototype.setValue=function(t,e){(this._value!==t||e)&&(this._value=t,this._listeners.fire(this))},i.prototype.setValueSilently=function(t){this._value=t},i.prototype.addProperty=function(t,e){var o=new i(e);this[t]=o,this._childs.push(t),o.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.removeProperty=function(t){this[t].listeners().unsubscribe(this,i.prototype.childChanged),delete this[t],this._childs=this._childs.filter(function(e){return e!==t})},i.prototype.addChild=function(t,e){this[t]=e,-1===$.inArray(t,this._childs)&&this._childs.push(t),e.listeners().subscribe(this,i.prototype.childChanged)},i.prototype.childChanged=function(t,e){this.listeners().fire(this)},i.prototype.subscribe=function(t,e){this.listeners().subscribe(t,e)},i.prototype.unsubscribe=function(t,e){this.listeners().unsubscribe(t,e)},i.prototype.unsubscribeAll=function(t){this.listeners().unsubscribeAll(t)},t.exports=i}).call(e,i(10))},function(t,e,i){"use strict";(function(e,o,n){function r(t){return"cursor"===t||"arrow"===t||"dot"===t}function s(t){!t&&u&&u.stayInDrawingMode.value()||this.tool.setValue(this.cursorTool.value())}function a(t,e){return function(e){t.inFire||(t.inFire=!0,t.fire(e),t.inFire=!1)}}function l(){K||(g.setValue(TVSettings.getValue("chart.cursorPreference","cursor")),g.subscribe(function(t){r(t)&&v.setValue(t)},{callWithLast:!0}),v.subscribe(function(t){t&&TVSettings.setValue("chart.cursorPreference",t)}),u=new c("drawings"),d=new n,p=new n,_=new n,f=new n,d.setValue(!1),p.setValue(!1),_.setValue(!1),f.setValue(!1),
g.subscribe(function(){h.emit("onSelectedLineToolChanged")}),K=!0)}var c=i(6).DefaultProperty,h=i(23),u=null,d=null,p=null,_=null,f=null,m=new e,g=new e,v=new e,y=new o,b=new o,S=new o,w=new o,T=new o,C=new o,x=new o,P=new o,L=new o,I=new o,k=new o,A=new o,M=new o,E=new o,D=new o,V=a(y),O=a(b),R=a(S),B=a(w),z=a(T),F=a(C),N=a(x),W=a(P),$=a(L),H=a(I),U=a(k),j=a(A),q=a(M),G=a(E),Y=a(D),K=!1;t.exports={tool:g,cursorTool:v,toolIsCursor:r,resetToCursor:s,init:l,createdLineTool:y,continuedLineTool:b,cancelledLineTool:S,createLineTool:V,continueLineTool:O,cancelLineTool:R,startedMovingLineTool:w,movedLineTool:T,finishedMovingLineTool:C,startMovingLineTool:B,moveLineTool:z,finishMovingLineTool:F,startedChangingLineTool:x,changedLineTool:P,finishedChangingLineTool:L,startChangingLineTool:N,changeLineTool:W,finishChangingLineTool:$,removedLineTool:I,removeLineTool:H,restoredLineTool:E,restoreLineTool:G,restoredLineToolState:D,restoreLineToolState:Y,finishedLineTool:k,finishLineTool:U,changedLineStyle:A,changeLineStyle:j,copiedLineTool:M,copyLineTool:q,properties:function(){return u},hideAllDrawings:function(){return d},hideMarksOnBars:function(){return _},lockDrawings:function(){return p},drawOnAllCharts:function(){return u.drawOnAllCharts},lockTimeAxis:function(){return f},lockTimeAxisTime:m}}).call(e,i(17),i(10),i(25))},,function(t,e,i){"use strict";function o(t,e){if(!n.isNumber(t))return"n/a";if(!n.isInteger(e))throw new TypeError("invalid length");if(e<0||e>16)throw new TypeError("invalid length");return 0===e?""+t:("0000000000000000"+t).slice(-e)}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(12),n=i(15),r=i(7),s=r.getLogger("Chart.PriceFormatter"),e.customFormatters={dateFormatter:null,timeFormatter:null},e.formatterOptions={decimalSign:".",decimalSignFractional:"'"},a={custom:$.t("Price format is invalid."),fraction:$.t("Fraction part is invalid."),secondFraction:$.t("Second fraction part is invalid.")},e.numberToStringWithLeadingZero=o,l=function(){function t(t,e,i,o){if(this.type="price",e||(e=1),n.isNumber(t)&&n.isInteger(t)||(t=100),t<0)throw new TypeError("invalid base");if(this._priceScale=t,this._minMove=e,this._minMove2=o,i&&void 0!==o&&o>0&&2!==o&&4!==o&&8!==o)return void s.logDebug("invalid minmove2");this._fractional=i,this.calculateDecimal()}return t.prototype.isFractional=function(){return!!this._fractional},t.prototype.state=function(){return{fractional:this._fractional,fractionalLength:this._fractionalLength,minMove:this._minMove,minMove2:this._minMove2,priceScale:this._priceScale}},t.prototype.calculateDecimal=function(){if(this._fractionalLength=0,this._priceScale>0&&this._minMove>0){var t=this._priceScale;for(this._fractional&&this._minMove2&&(t/=this._minMove2);t>1;)t/=10,this._fractionalLength++}},t.prototype.format=function(t,e,i,o){void 0===o&&(o=!0);var n="";return t<0?(n=!0===e?"−":!1===o?"":"-",t=-t):t&&!0===e&&(n="+"),this._fractional?n+this._formatAsFractional(t,i):n+this._formatAsDecimal(t,i)},t.prototype.parse=function(t){
return this._fractional?this._minMove2?this._parseAsDoubleFractional(t):this._parseAsSingleFractional(t):this._parseAsDecimal(t)},t.prototype.hasForexAdditionalPrecision=function(){return!this._fractional&&10===this._minMove2},t.serialize=function(t){return t.state()},t.deserialize=function(e){return new t(e.priceScale,e.minMove,e.fractional,e.minMove2)},t.prototype._formatAsDecimal=function(t,i){var n,r,s,a,l;return i=i||0,n=this._fractional?Math.pow(10,this._fractionalLength||0):Math.pow(10,i)*this._priceScale/this._minMove,r=Math.floor(t),s=+(Math.round(t*n)-r*n).toFixed(this._fractionalLength),s>=n&&(s-=n,r+=1),a="",1!==n&&(l=void 0!==this._fractionalLength?this._fractionalLength:NaN,a=e.formatterOptions.decimalSign+o(+s.toFixed(this._fractionalLength)*this._minMove,l+i),a=this._removeEndingZeros(a,i)),""+r+a},t.prototype._formatAsFractional=function(t,i){var n,r,s,a,l,c,h,u,d,p=this._priceScale/this._minMove,_=Math.floor(t),f=i?Math.floor(t*p)-_*p:Math.round(t*p)-_*p;if(f===p&&(f=0,_+=1),n="",i&&(r=(t-_-f/p)*p,r=Math.round(r*Math.pow(10,i)),n=o(r,i),n=this._removeEndingZeros(n,i)),!this._fractionalLength)throw Error("_fractionalLength is not calculated");return s="",this._minMove2?(a=["0","5"],l=["0","2","5","7"],c=["0","1","2","3","4","5","6","7"],h=f%this._minMove2,f=(f-h)/this._minMove2,u=o(f,this._fractionalLength),d=2===this._minMove2?a[h]:8===this._minMove2?c[h]:l[h],s=u+e.formatterOptions.decimalSignFractional+d):s=o(f*this._minMove,this._fractionalLength),""+_+e.formatterOptions.decimalSignFractional+s+n},t.prototype._removeEndingZeros=function(t,e){for(var i=0;i<e&&"0"===t[t.length-1];i++)t=t.substr(0,t.length-1);return t},t.prototype._parseAsDecimal=function(t){var i,o,n=RegExp(/^(\-?)[0-9]+$/),r=n.exec(t);return r?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^(-?)[0-9]+\\"+e.formatterOptions.decimalSign+"[0-9]*$"),r=o.exec(t),r?(i=parseFloat(t.replace(e.formatterOptions.decimalSign,".")),{price:i,res:!0,suggest:this.format(i)}):{error:a.custom,res:!1})},t.prototype._patchFractPart=function(t,e){var i={0:0,5:1},o={0:0,2:1,5:2,7:3};return 2===e?void 0===i[t]?-1:i[t]:4===e?void 0===o[t]?-1:o[t]:t},t.prototype._parseAsSingleFractional=function(t){var i,o,n,r,s,l,c=RegExp(/^(\-?)[0-9]+$/),h=c.exec(t);return h?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^(-?)([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),h=o.exec(t),h?(n=!!h[1],r=parseInt(h[2]),s=this._priceScale,(l=this._patchFractPart(parseInt(h[3]),s))>=s||l<0?{error:a.fraction,res:!1}:(i=r+l/s,n&&(i=-i),{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t.prototype._parseAsDoubleFractional=function(t){var i,o,n,r,s,l,c,h,u,d=RegExp(/^(\-?)[0-9]+$/),p=d.exec(t);return p?(i=parseFloat(t),{price:i,res:!0,suggest:this.format(i)}):(o=RegExp("^(-?)([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)\\"+e.formatterOptions.decimalSignFractional+"([0-9]+)$"),p=o.exec(t),p?(n=!!p[1],r=parseInt(p[2]),s=void 0!==this._minMove2?this._minMove2:NaN,l=this._priceScale/s,
c=this._minMove2,h=this._patchFractPart(parseInt(p[3]),l),u=this._patchFractPart(parseInt(p[4]),c),h>=l||h<0?{error:a.fraction,res:!1}:void 0!==c&&u>=c||u<0?{error:a.secondFraction,res:!1}:(i=void 0!==c?r+h/l+u/(l*c):NaN,n&&(i=-i),{price:i,res:!0,suggest:this.format(i)})):{error:a.custom,res:!1})},t}(),e.PriceFormatter=l},,function(t,e,i){"use strict";function o(t,e,i){var o,n,r,s,c;if(e=e||0,!a(t))return i?l.rgbaToString(l.rgba(l.parseRgb(t),l.normalizeAlphaComponent(1-e/100))):t;if(e<0&&e>100)throw Error("invalid transparency");return o=l.parseRgb(t),n=o[0],r=o[1],s=o[2],c=l.normalizeAlphaComponent(1-e/100),l.rgbaToString([n,r,s,c])}function n(t){return a(t)?t:l.rgbaToString(l.rgba(l.parseRgb(t),l.normalizeAlphaComponent(1)))}function r(t){var e=l.parseRgb(t).map(function(t){return t/=255,t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)});return+(.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3)}function s(t,e){return l.rgbaToString(l.blendRgba(l.parseRgba(t),l.parseRgba(e)))}function a(t){return 0===t.indexOf("#")}Object.defineProperty(e,"__esModule",{value:!0});var l=i(32);e.generateColor=o,e.resetTransparency=n,e.getLuminance=r,e.blendColors=s,e.isHexColor=a},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dur=350,e.easingFunc={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return t*(2-t)},easeInOutQuad:function(t){return t<.5?2*t*t:(4-2*t)*t-1},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return--t*t*t+1},easeInOutCubic:function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return 1- --t*t*t*t},easeInOutQuart:function(t){return t<.5?8*t*t*t*t:1-8*--t*t*t*t},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return 1+--t*t*t*t*t},easeInOutQuint:function(t){return t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t}},e.color={black0:"#000",black20:"#2b2d36",black25:"#2b2e37",black30:"#212121",black70:"#4A4A4A",black80:"#535353",black100:"#646464",black110:"#757575",black140:"#8A8A8A",black170:"#ADAEB0",black180:"#b4b4b4",black200:"#C8C8C8",black220:"#DADDE0",black230:"#ECECEC",black240:"#F2F2F2",black248:"#F8F8F8",black255:"#FFF",brand:"#3BB3E4",brandHover:"#3BABD8",brandActive:"#3898C2",brandDown:"#049DDC",brand220:"#3BB3E0",brand255:"#3BB3FF",brandNew:"#37A6EF",spinner:"#00A2E2",brandMedium80:"#3C4650",brandMedium90:"#465a6e",brandMedium100:"#627384",brandMedium120:"#758696",brandMedium150:"#94959C",brandMedium190:"#9DB2BD",brandMedium220:"#E9EFF2",brandMedium230:"#EAECEF",brandMedium240:"#F1F3F6",brandDark:"#2A2C39",brandDark50:"#252733",brandDark45:"#20222D",brandDarkText:"#6A6B74",danger:"#FF4A68",dangerHover:"#F24965",dangerDown:"#FF173E",success:"#3CBC98",success55:"#37BC9B",success250:"#00FFC0",successHover:"#38B395",successDown:"#00A97F",attention:"#FFC84A",attention50:"#F89E30",growing:"#37bc9b",falling:"#ff4a68"}},,function(t,e,i){"use strict";(function(t,e){function o(t){TradingView.merge(this,{palettes:{},inputs:[],plots:[],graphics:{},defaults:{}}),
TradingView.merge(this,t);var e=t.fullId||t.id;TradingView.merge(this,o.parseIdString(e)),this.name=this.id}var n=i(9).assert,r=i(7).getLogger("Chart.Study.MetaInfo"),s=i(206).applyOverridesToStudyDefaults,a=null;o.VERSION_STUDY_ARG_SOURCE=41,o.METAINFO_FORMAT_VERSION_SOS_V2=42,o.VERSION_PINE_PROTECT_TV_4164=43,o.CURRENT_METAINFO_FORMAT_VERSION=45,o.CHILD_STUDY_ALLOWED_PLOT_TYPES=["line"],o.CHILD_STUDY_EXCLUDE_IDS=["CorrelationCoefficient@tv-basicstudies"],o.CHILD_STUDY_PARENT_EXCLUDE_IDS=[],o.FilledArea={},o.FilledArea.TYPE_PLOTS="plot_plot",o.FilledArea.TYPE_HLINES="hline_hline",o.versionOf=function(t){var e="_metainfoVersion"in t&&isNumber(t._metainfoVersion)?t._metainfoVersion:0;return e<0&&r.logError("Metainfo format version cannot be negative: "+e),e>o.CURRENT_METAINFO_FORMAT_VERSION&&r.logWarn("Client doesn't support this version of metainfo format: "+e),e},o.parseIdString=function(t){var e,i,o,n,r={};if(-1===t.indexOf("@"))r.shortId=t,r.packageId="tv-basicstudies",r.id=t+"@"+r.packageId,r.version=1;else if(e=t.split("@"),r.shortId=e[0],i=e[1].split("-"),3===i.length)r.packageId=i.slice(0,2).join("-"),r.id=r.shortId+"@"+r.packageId,r.version=i[2];else if(1===i.length&&"decisionbar"===i[0])r.packageId="les-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1;else{if(1!==i.length)throw Error("unexpected study id:"+t);r.packageId="tv-"+i[0],r.id=r.shortId+"@"+r.packageId,r.version=1}return r.fullId=r.id+"-"+r.version,"tv-scripting"===r.packageId?(o=r.shortId,0===o.indexOf("Script$")||0===o.indexOf("StrategyScript$")?(n=o.indexOf("_"),r.productId=n>=0?o.substring(0,n):r.packageId):r.productId=r.packageId):r.productId=r.packageId,r},o.getPackageName=function(t){return(/^[^@]+@([^-]+-[^-]+)/.exec(t||"")||[0,"tv-basicstudies"])[1]},o.cutFullId=function(t){return t.replace(/(@[^-]+-[^-]+).*$/,"$1")},o.cutDollarHash=function(t){var e,i,o=t.indexOf("$"),n=t.indexOf("@");return-1===o?t:(e=t.substr(0,o),i=n>=0?t.substr(n):"",e+i)},o.cutScriptIdPart=function(t){var e=t.indexOf("$"),i=t.indexOf("@");return e<0&&i>=0?"":t.substring(Math.max(e+1,0),i>=0?i:t.length)},o.hasUserIdSuffix=function(t){return/^USER;[\d\w]+;\d+$/.test(t)},o.getSourceIdByInputs=function(t,e){var i,n,r;if(!Array.isArray(t)||!e)return null;for(i=0;i<t.length;++i)if(n=t[i],o.isSourceInput(n)&&"string"==typeof e[n.id])return r=e[n.id],~r.indexOf("$")&&(r=r.split("$")[0]),r;return null},o.getSourceInputIds=function(t){var e,i,n=[],r=t.inputs;for(e=0;e<r.length;++e)i=r[e],o.isSourceInput(i)&&n.push(i.id);return n},o.setChildStudyMetaInfoPropertiesSourceId=function(e,i,n){var r,s,a,l;for(r=0;r<e.inputs.length;++r)s=e.inputs[r],o.isSourceInput(s)&&n instanceof t&&n.inputs&&n.inputs[s.id]&&(a=n.inputs[s.id].value(),a.indexOf("$")>0&&(l=a.replace(/^[^\$]+/,i),n.inputs[s.id].setValue(l)))},o.patchChildStudyMetaInfoState=function(t){function e(t){if("object"==typeof t)for(var i in t)"string"==typeof t[i]&&/^[^\$]+\$\d+$/.test(t[i])?t[i]=t[i].replace(/^[^\$]+/,"{pid}"):e(t[i])}t.state&&e(t.state.inputs),t.state.isChildStudy=!0},o.prototype.parseValue=function(t,e){
return"bool"===t?TradingView.parseBool(e):e},o.prototype.defaultInputs=function(){var t,e=[];for(t=0;t<this.inputs.length;t++)e.push(this.inputs[t].defval);return e},o.prototype.state=function(t){var e,i={};for(e in this)this.hasOwnProperty(e)&&(i[e]=this[e],!0!==t&&"id"===e&&(i[e]+="-"+this.version));return i},o.prototype.symbolInputId=function(){var t=this.inputs.filter(function(t){return"symbol"===t.type});return t.length>0?t[0].id:null},o.findStudyMetaInfoByDescription=function(t,e){if(t){for(var i=0;i<t.length;++i)if(t[i].description.toLowerCase()===e.toLowerCase())return t[i];throw Error("unexpected study id:"+e)}throw Error("There is no studies metainfo")},o._findStudyMetaInfo=function(t,e){for(var i=0;i<t.length;i+=1)if(t[i].id===e)return[i,t[i]];return[]},o.findStudyMetaInfo=function(t,e){if(!t)throw new ReferenceError("There is no studies metainfo");var i=o._findStudyMetaInfo(t,e)[1];if(!i)throw new ReferenceError("unexpected study id:"+e);return i},o.isParentSourceId=function(t){return"string"==typeof t&&/^[^\$]+\$\d+$/.test(t)},o.isSourceInput=function(t){return t.id&&(("source"===t.id||"src"===t.id)&&("text"===t.type||"source"===t.type)||"source"===t.type)},o.getChildSourceInputTitles=function(t,e,i){var n,r,s,a,l={};if(e.plots&&e.plots.length&&t.options&&t.options.length)for(n=0;n<t.options.length;++n)r=t.options[n],s=r&&+r.split("$")[1],(a=isFinite(s)&&e.plots[s])&&~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(a.type)&&(l[r]=e.styles&&e.styles[a.id]&&e.styles[a.id].title||a.id,i&&(l[r]=i+":"+l[r]));return l},o.removeStudyMetaInfo=function(t,e,i){var n=function(i){return void 0!==(i=void 0!==i?i:o._findStudyMetaInfo(t,e.id)[0])&&(t.splice(i,1),defaults.remove(o.getStudyPropertyRootName(e)),!0)};if(t)return n(i);throw Error("There are no studies metainfo")},o.getStudyPropertyRootName=function(t){var e="study_"+t.id;return t.pine&&t.pine.version&&(e+="_"+t.pine.version.replace(".","_")),e},o.addOrReplaceStudyMetaInfo=function(t,e){var i,n,s,a,l=new o(e),c=o._findStudyMetaInfo(t,l.id),h=c[0],u=c[1];if(u){if(i=u.pine&&u.pine.version,!(null==(n=l.pine&&l.pine.version)||null==i||n>=i))return l;o.removeStudyMetaInfo(t,l,h)}else o.removeStudyMetaInfo(t,l,h)&&r.logDebug("Study with id="+l.id+" already exists in the model!");return t.push(l),l.defaults&&(s=TradingView.clone(l.defaults),s.precision="default",a=o.getStudyPropertyRootName(l),defaults.create(a,s)),l},o.overrideDefaults=function(t){null!==a&&0!==t.length&&s(a,t,function(t){return TradingView.defaultProperties["study_"+t]||null})},o.setDefaultsOverrides=function(t){a=t},o.createMetaInfoStub=function(t,e){var i,o,r;return n(TradingView.isExistent(t.scriptIdPart),"scriptIdPart is missing, study: "+JSON.stringify(t)),i=t.extra&&"strategy"===t.extra.kind||!0===t.isTVScriptStrategy,o=TVScript.createScriptStudyId(t.scriptIdPart,e,i),r={isTVScriptStubToCompile:!0,id:o,scriptIdPart:t.scriptIdPart,description:t.scriptName,TVScriptSourceCode:t.scriptSource,is_hidden_study:t.extra&&t.extra.is_hidden_study,extra:t.extra,version:e},r.pine={},
r.pine.version=TradingView.isExistent(t.version)?t.version:-1,r.pine.access=TVScript.Access.MAP_ID_TO_NAME[t.access],r.pine.userHaveAccess=t.userHaveAccess,!0===i&&(r.isTVScriptStrategy=!0),r},o.isScriptStrategy=function(t){if(t.extra&&t.extra.kind)return t.extra.kind===TVScript.Kinds.STRATEGY;if(!0===t.isTVScriptStrategy)return!0;var e=t.TVScriptSourceCode||t.scriptSource;return!!e&&TVScript.isStrategy(e)},o.replaceWithFullStudyMetaInfoAsync=function(t,e){var i=$.Deferred();return e.isTVScriptStubToCompile||i.resolve(e),i.promise()},o.getOrderedInputIds=function(t){var e,i,o=[],n=t.inputs;for(e=0;e<n.length;++e)i=n[e],o.push(i.id);return o},o.canBeChild=function(t){var e,i,n;if(t&&"string"==typeof t)return!0;if(!t||t.extra&&!o.isAllowedSourceInputsCount(t.extra.sourceInputsCount)||!0===t.canNotBeChild||!1===t.canBeChild||~o.CHILD_STUDY_EXCLUDE_IDS.indexOf(t.id)||t.isTVScriptStrategy||t.TVScriptSourceCode&&TVScript.isStrategy(t.TVScriptSourceCode))return!1;if(t.isTVScriptStubToCompile)return!0;for(e=t.inputs,i=0,n=0;n<e.length;++n)o.isSourceInput(e[n])&&++i;return o.isAllowedSourceInputsCount(i)},o.isAllowedSourceInputsCount=function(t){return 1===t},o.canHaveChildren=function(t){if(t){if(t.isTVScriptStrategy||t.TVScriptSourceCode&&TVScript.isStrategy(t.TVScriptSourceCode))return!1;if(t.id&&!~o.CHILD_STUDY_PARENT_EXCLUDE_IDS.indexOf(t.id)&&Array.isArray(t.plots))for(var e=0;e<t.plots.length;++e)if(~o.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(t.plots[e].type))return!0}return!1},TradingView.StudyMetaInfo=o,void 0!==e&&e&&e.exports&&(e.exports=o)}).call(e,i(25),i(42)(t))},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o={},n=RegExp("^([0-9]*)$"),r=RegExp("^(\\d*)([DWMS])$"),s=function(){function t(e,i){if(void 0===i&&e!==t.INVALID)return t.parse(e);var o=e;o!==t.SECONDS&&o!==t.MINUTES&&o!==t.HOURS&&o!==t.DAYS&&o!==t.WEEKS&&o!==t.MONTHS&&o!==t.INVALID&&(o="invalid"),this._kind=o,this._multiplier=i}return t.prototype.kind=function(){return this._kind},t.prototype.multiplier=function(){return this._multiplier},t.prototype.isValid=function(){return this.kind()!==t.INVALID},t.prototype.isDWM=function(){return this.isValid()&&!this.isIntraday()},t.prototype.isIntraday=function(){return-1!==[t.SECONDS,t.MINUTES,t.HOURS].indexOf(this.kind())},t.prototype.letter=function(){return this.isValid()&&this.kind()!==t.MINUTES?this.kind()[0].toUpperCase():""},t.prototype.value=function(){return this.isValid()?this.kind()===t.MINUTES?this.multiplier()+"":this.multiplier()+this.letter():""},t.prototype.isEqualTo=function(e){if(!(e instanceof t))throw Error("Argument is not an Interval");return this.kind()!==t.INVALID&&e.kind()!==t.INVALID&&(this.kind()===e.kind()&&this.multiplier()===e.multiplier())},t.prototype.inMilliseconds=function(e){var i,n;if(!this.isValid())return NaN;if(this.kind()===t.MONTHS){if(void 0===e)throw Error("unixDateTimeFrom should be provided");return i=new Date(e),i.setUTCMonth(i.getUTCMonth()+(this.multiplier()||1)),+i-e}return n=this.multiplier(),
void 0===n?NaN:o[this.kind()]*n},t.isEqual=function(e,i){return t.parse(e).isEqualTo(t.parse(i))},t.parse=function(e){var i,o;return e=(e+"").toUpperCase().split(",")[0],i={D:t.DAYS,W:t.WEEKS,M:t.MONTHS,H:t.HOURS,S:t.SECONDS},(o=n.exec(e))?new t(t.MINUTES,parseInt(e,10)):(o=r.exec(e),o?new t(i[o[2]],parseInt(o[1],10)?parseInt(o[1],10):1):new t(t.INVALID))},t.isDWM=function(e){return t.parse(e).isDWM()},t.kind=function(e){return t.parse(e).kind()},t.isValid=function(e){return t.parse(e).isValid()},t.normalize=function(e){var i=new t(e);return i.isValid()?i.value():null},t.SECONDS="seconds",t.MINUTES="minutes",t.HOURS="hours",t.DAYS="days",t.WEEKS="weeks",t.MONTHS="months",t.INVALID="invalid",t}(),e.Interval=s,o[s.SECONDS]=1e3,o[s.MINUTES]=60*o[s.SECONDS],o[s.HOURS]=60*o[s.MINUTES],o[s.DAYS]=24*o[s.HOURS],o[s.WEEKS]=7*o[s.DAYS]},function(t,e,i){"use strict";(function(e,o,n,r){function s(t,e,i,o){this._study=t,this.m_series=e,this.m_model=i,this._plotName=o,this._visible=!1,this._points=[new Z(0,0)],this._invalidated=!0,this._lineRenderer=new C}function a(){return{visible:!0,color:"#0496FF",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:2,plottype:at.PlotType.Line,histogramBase:0,transparency:50,trackPrice:!1,joinPoints:!1}}function l(t,e,i,o){var n,r;return o.isTVScriptStrategy?n="StudyStrategy":(r="study_"+(o.classId||o.shortId),n=r in TradingView?r:"Study"),new TradingView[n](t,e,i,o)}function c(t,e,i,o,n){return h(t,e,i,o,st.getStudyPropertyRootName(t),n)}function h(t,e,i,o,n,r){var s,a,l,c,h,u=p(t,e,i,o);for(r instanceof v&&(s=st.getSourceInputIds(t),s.length>0&&(a=s[0],u.inputs[a]="{pid}$0")),l=new J(n,u,!0),l.addExclusion("visible"),l.addExclusion("precision"),l.addExclusion("minTick"),c=0;c<t.inputs.length;++c)h=t.inputs[c],h.isHidden&&(l.addExclusion("inputs."+c),l.addExclusion("inputs."+h.id));return l}function u(t,e,i,o,n,r){return d(t,e,i,o,n,st.getStudyPropertyRootName(t),r)}function d(t,e,i,o,n,r,s){var a,l,c,h=_(t,e,i,o,n),u=new J(r,h,!0);for(u.addExclusion("visible"),u.addExclusion("precision"),u.addExclusion("minTick"),a=e||t,l=0;l<a.inputs.length;++l)c=a.inputs[l],c.isHidden&&(u.addExclusion("inputs."+l),u.addExclusion("inputs."+c.id));return u}function p(t,o,n,r){var s,a,l,c,h,u,d,p,_=i(84);if(st.versionOf(t)<1)throw Error("This function cannot work with metainfo of the old format version. Required format version >= 1");return s=TradingView.clone(defaults("study")),f(s,t),a=st.getStudyPropertyRootName(t),l=TradingView.clone(defaults(a,r)),t.isTVScript&&t.TVScriptSourceCode!==l.TVScriptSourceCode&&(l=TradingView.clone(TradingView.factoryDefaults(a,r))),TradingView.merge(s,l),o&&(S(!(o instanceof e),"propsState should not be an instance of Property"),TradingView.merge(s,o)),c=TradingView.clone(t),h={},_.mergeInputsObjPart(h,c.defaults.inputs),_.mergeInputsObjPart(h,s.inputs),s.inputs=h,delete c.inputs,delete c.defaults.inputs,u={},TradingView.merge(u,c.defaults),TradingView.merge(u,TradingView.factoryDefaults("study_"+c.id)),TradingView.merge(u,s),TradingView.merge(u,c),delete u.defaults,s=u,
d=null!==n?n.model().getStudyShiftColorStartOffset():void 0,p=m(n,t),TradingView.merge(s,g(s,p,d)),o&&TradingView.merge(s.styles,o.styles),s}function _(t,e,o,n,r){var s,a,l,c,h,u,d=i(84);return t.version&&o.version&&t.version!==o.version&&ct.logWarn("Serialized metaInfo version "+t.version+" is not equal to the saved state version "+o.version),s=TradingView.clone(defaults("study")),TradingView.merge(s,TradingView.factoryDefaults("study_"+t.id)),f(s,t),TradingView.merge(s,o),s=r.updateStudyState(s,t,e),a=TradingView.clone(e||t),a&&st.versionOf(a)>=1&&(l={},d.mergeInputsObjPart(l,a.defaults.inputs),d.mergeInputsObjPart(l,s.inputs),s.inputs=l,delete a.inputs,delete a.defaults.inputs,c={},TradingView.merge(c,a.defaults),TradingView.merge(c,TradingView.factoryDefaults("study_"+a.id)),TradingView.merge(c,s),delete a.defaults,TradingView.merge(c,a),s=c),h=null!==n?n.model().getStudyShiftColorStartOffset():void 0,u=m(n,a),TradingView.merge(s,g(s,u,h)),s}function f(t,e){var i,o,n,r;if(e.plots)for(i=0;i<e.plots.length;i++)o=e.plots[i].id,(n=e.plots[i].type)!==at.PlotTypes.COLORER&&(r=a(),n===at.PlotTypes.COLORER&&(r.transparency=0),r.plottype=n,r.title=o,t.styles&&o in t.styles&&TradingView.merge(r,t.styles[o]),t.styles[o]=r)}function m(t,e){var i,o,n,r,s=0;if(t)for(i=0;i<t.dataSources().length;i++)o=t.dataSources()[i],o.metaInfo&&o.metaInfo()&&(n=o.metaInfo().id===e.id,r=(o.metaInfo().pine&&o.metaInfo().pine.version)===(e.pine&&e.pine.version),n&&r&&s++);return s}function g(t,e,i){var o,n;if(!e)return t;for(o in t.styles)(n=t.styles[o].color)&&(t.styles[o].color=X(n,e,i));return t}function v(t,e,r,s){var a,l,c,h,u,d,p,_,f,m,g=i(158);for(this._titleCache={},this._resolvedSymbols={},this._priceAxisViewsBase=[],this._paneViews=[],this._hlinesPriceAsisViews=[],this._horizlinesPriceAsisViews=[],W.call(this,t),this.m_data=new ot,this._graphics=new q(s),this._plotOffsets={},this._plotOffsetsMetaInfoOverride={},this._model=t,this._chartApi=t._chartApi,this._series=r instanceof TradingView.Series?r:this._model.mainSeries(),r instanceof v&&(this._source=r,this._isChildStudy=!0,this._source.setChild(this)),this._numericFormatter=new et,this._metaInfo=s,this._properties=e,this._properties.listeners().subscribe(this,this.changeStyles),this._properties.visible.listeners().subscribe(this,this.visibleChanged),this._properties.visible.listeners().subscribe(this,this.processHibernate),a=0;a<this._metaInfo.plots.length;a++)l=this._metaInfo.plots[a].id,null!=(c=this.properties().styles[l])&&null!=c.visible&&c.visible.listeners().subscribe(this,this.processHibernate);for(h in this._metaInfo.graphics)for(u in this._metaInfo.graphics[h])d=this._properties.graphics[h][u],d.visible&&d.visible.listeners().subscribe(this,this.processHibernate);if(this._showStudyArgumentsProperty=this.model().properties().paneProperties.legendProperties.showStudyArguments,this._turnaroundCounter=1,this._turnaround="st"+this._turnaroundCounter,this._status="",this._plotFields=[],p=this.metaInfo().plots)for(a=0,_=p.length;a<_;a++)u=p[a].id,this._plotFields.push(u)
;this.clearData(),this._studyModified=!1,this._tagsChanged=new o,this.createViews(),f=this,this._handler=function(t){f.onData(t)},this._handler.isTVScriptStrategy=this._metaInfo.isTVScriptStrategy,this._createFormatter(),f=this,this._properties.precision.listeners().subscribe(null,function(){f._createFormatter(),f._model.invalidate(new G(G.FULL_UPDATE))}),this._showStudyArgumentsProperty.listeners().subscribe(this,this.invalidateTitleCache),this._properties.description.listeners().subscribe(this,this.invalidateTitleCache),this._properties.shortDescription&&this._properties.shortDescription.listeners().subscribe(this,this.invalidateTitleCache),n.enabled("update_study_formatter_on_symbol_resolve")&&t.mainSeries().onSymbolResolved().subscribe(this,v.prototype._createFormatter),f=this,m={},this._simplePlotsCount=s.plots.filter(function(t,e){if(f.isLinePlot(e))return!0;if(f.isOHLCSeriesPlot(e)){var i=f.metaInfo().plots[e].target;return!m[i]&&(m[i]=i,!0)}return!1}).length,this._properties.showInDataWindow.listeners().subscribe(t,g.prototype.fullUpdate),this.hasBarColorer()&&this._properties.visible.listeners().subscribe(t.mainSeries(),TradingView.Series.prototype.invalidateBarStylesCache),this.onStart=new o,this._childStudyByRebind=new o}function y(t,e){return t&&t[e]&&t[e].hasOwnProperty("showLast")?t[e].showLast.value():null}var b=i(9),S=b.assert,w=b.ensureNotNull,T=i(217).StudyBarColorer,C=i(94).HorizontalLineRenderer,x=i(787),P=x.BandPaneView,L=x.BandBackgroundPaneView,I=x.HlineFillPaneView,k=i(324).StudyPriceAxisView,A=i(87),M=A.StudyPaneView,E=A.StudyBackgroundPaneView,D=A.StudyPlotShapesPaneView,V=A.StudyPlotCharsPaneView,O=A.StudyPlotArrowsPaneView,R=A.StudyPlotBarsPaneView,B=A.StudyPlotCandlesPaneView,z=i(805),F=z.PlotFillPaneView,N=z.AreaBackgroundPaneView,W=i(46).PriceDataSource,H=i(124),U=i(125).StudyDataWindowView,j=i(126),q=i(219),G=i(22),Y=i(15).parseJSONorNot,K=i(330).ChartApiInterface,Z=i(8).Point,X=i(32).shiftColor,J=i(6).DefaultProperty,Q=i(28).PriceFormatter,tt=i(331).VolumeFormatter,et=i(89).NumericFormatter,it=i(19),ot=it.PlotList,nt=it.PlotRowSearchMode,rt=it.mergeMinMax,st=i(33),at=i(111),lt=i(3).propertyPages,ct=i(7).getLogger("Chart.Study");s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){this._visible=!1;var t=this._study.lastValueData(this._plotName,!0);t.noData||(this._visible=!0,this._points=[new Z(0,t.coordinate)],this._color=t.color)},s.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.width=this.m_model.timeScale().width(),t.height=this._study.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=this._study.properties().styles[this._plotName].linewidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},inherit(v,W),TradingView.Study=v,i(918),v.prototype.lastValueData=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x={noData:!0}
;if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return x;if(null===(o=this._model.timeScale().visibleBars()))return x;if(!this.properties().visible.value())return x;if(n=this.properties().styles,r=this.properties().ohlcPlots,n&&n[t]&&(s=n[t]),r&&r[t]&&(s=r[t]),!s||!s.visible.value())return x;if(a=this.offset(t),null==(l=this.nearestIndex(o.lastBar()-a,nt.NearestLeft))||void 0===l)return x;for(h=this.metaInfo().plots,c=0;c<h.length&&!(h[c].id===t||this.isOHLCClosePlot(c)&&h[c].target===t);c++);if(u=this._lastNonEmptyPlotRow(c),d=null!==u&&o.contains(u.index),p=null!==u?u.value:null,!(_=e||d?p:this.data().valueAt(l))||!isNumber(_[c+1]))return x;for(f={noData:!1},m=null,g=null,y=0;y<h.length;y++)h[y].target===t&&(this.isSelfColorerPlot(y)||this.isOHLCColorerPlot(y))&&(m=y,g=this.metaInfo().palettes[h[y].palette],v=this.properties().palettes[h[y].palette]);if(b=_[c+1],i&&(f.price=b),this.priceScale().properties().percentage.value()){if(!(S=this.firstValue(!0)))return x;b=this.priceScale().priceRange().convertToPercent(b,S)}return f.text=this.priceScale().formatter().format(b),w=s.color.value(),m&&_.length>m+1?(T=_[m+1],void 0!==T&&null!==T?(C=g.valToIndex?g.valToIndex[T]:T,f.color=v.colors[C].color.value()):f.color=w):f.color=w,f.floatCoordinate=this.priceScale().priceToCoordinate(b,!0),f.coordinate=Math.round(f.floatCoordinate),f.item=_,f},v.prototype.series=function(){return this._series},v.prototype.model=function(){return this._model},v.prototype._invalidateLastNonEmptyPlotRowCache=function(){this._lastNonEmptyPlotRowCache={}},v.prototype.clearData=function(){this._invalidateLastNonEmptyPlotRowCache(),this.m_data=new ot(this._plotFields),this._graphics=new q(this._metaInfo),this._plotOffsets={}},v.prototype.onTagsChanged=function(){return this._tagsChanged},v.prototype.properties=function(){return this._properties},v.prototype.state=function(t){var e,i,o,n,r=TradingView.className(this.constructor),s={type:r,id:this.id(),state:this.properties().state(),zorder:this.zorder()};for(this.metaInfo()instanceof st?s.metaInfo=TradingView.clone(this.metaInfo().state()):(s.metaInfo=TradingView.clone(this.metaInfo()),s.metaInfo.id=st.parseIdString(s.metaInfo.id+(s.metaInfo.version?"-"+s.metaInfo.version:"")).fullId),t&&(s.data=this.m_data.state(),s.data.symbols=this._resolvedSymbols,s.data.graphics=this._graphics.graphics(),s.data.plotOffsets=this._plotOffsets),this.ownerSource()&&(s.ownerSource=this.ownerSource().id()),e=0;e<this._metaInfo.inputs.length;e++)"bar_time"===this._metaInfo.inputs[e].type&&(i=this._metaInfo.inputs[e].id,(o=s.state.inputs[i])<0&&(n=this._rightOffsetToUnixTime(-o),s.state.inputs[i]=n&&n>=0?n:0));return this._isChildStudy&&st.patchChildStudyMetaInfoState(s),s},v.prototype._plotsForAlert=function(){var t=this,e=this._metaInfo,i=[at.PlotTypes.LINE,at.PlotTypes.SHAPES,at.PlotTypes.CHARS,at.PlotTypes.ARROWS,at.PlotTypes.OHLC_OPEN,at.PlotTypes.OHLC_HIGH,at.PlotTypes.OHLC_LOW,at.PlotTypes.OHLC_CLOSE];return e.plots.map(function(t,e){
return t.pinePlotIndex=e,t}).filter(function(t){return-1!==i.indexOf(t.type)}).map(function(i){var o={id:i.id,type:i.type,pinePlotIndex:i.pinePlotIndex,offset:t.offset(i.id)};return e.styles&&void 0!==e.styles[i.id]&&(o.title=e.styles[i.id].title||""),i.target&&e.ohlcPlots&&e.ohlcPlots[i.target]&&(o.ohlcTitle=e.ohlcPlots[i.target].title),o})},v.prototype.isSavedInStudyTemplates=function(){for(var t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type)return!1;return!0},v.prototype.restoreData=function(t){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.restoreState(t),this._resolvedSymbols=t.symbols,this._graphics.setGraphics(t.graphics),this._postProcessGraphics(),this._plotOffsets=t.plotOffsets},v.prototype.restart=function(){this._restarting=!0,this.clearData(),n.enabled("stop_study_on_restart")&&this.stop(),setTimeout(this.start.bind(this),0)},v.prototype.stop=function(t){if(!0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].stop(!0);this._chartApi&&this._chartApi.connected()&&this._studyId&&this._chartApi.removeStudy(this._studyId,this._handler,this._isChildStudy),n.enabled("update_study_formatter_on_symbol_resolve")&&this._model.mainSeries().onSymbolResolved().unsubscribe(this,v.prototype._createFormatter),this._studyId=null,this.clearData(),this._unsubscribeExtendedHours(),this.recalculate()},v.prototype._resolveSymbol=function(t){var e=function e(i,o){this._chartApi.resolveSymbol(this._makeNextSymbolId(),i,function(i){switch(i.method){case"symbol_resolved":this._resolvedSymbols[t]=i.params[1],this.invalidateTitleCache(!0),o.resolve(t);break;case"symbol_error":if("permission denied"===i.params[1]&&i.params[2])switch(i.params[2]){case TradingView.Series.PD_REASON_EXTENDED_HOURS:break;case TradingView.Series.PD_REASON_SYMBOL:if(i.params[3])return void e(i.params[3],o);break;default:return void e(i.params[2],o)}o.reject(t)}}.bind(this))}.bind(this),i=$.Deferred();return e(t,i),i.promise()},v.prototype._allSymbolsAreResolved=function(){var t,e,i,o,n=$.Deferred(),r=[];for(t=0;t<this._metaInfo.inputs.length;t++)"symbol"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,i=this._properties.inputs[e].value(),this._resolvedSymbols[i]||(o=this._resolveSymbol(i),r.push(o)));return r.length>0?$.when.apply($,r).done(function(){0!==this._studyId&&this.stop(!0),this.start(!0),n.resolve("All symbols are resolved now")}.bind(this)).fail(function(t){this._status=$.t("Invalid Symbol"),this.stop(!0),this._model.updateSource(this),n.reject("Invalid symbol, "+t)}.bind(this)):n.resolve("There are no symbols to resolve"),n.promise()},v.prototype._allInputsAreValid=function(){var t,e,i;for(t=0;t<this._metaInfo.inputs.length;t++)if("bar_time"===this._metaInfo.inputs[t].type&&(e=this._metaInfo.inputs[t].id,void 0===(i=this._properties.inputs[e].value())||null==i))return!1;return!0},v.prototype.sourceId=function(){return this._studyId},v.prototype.source=function(){return this._source||this._series},v.prototype.ownerSource=function(){
return this._isChildStudy?this._source:W.prototype.ownerSource.call(this)},v.prototype.getAllOwnerSources=function(){for(var t=[],e=this.ownerSource();null!=e;)t.push(e),e=e.ownerSource();return t},v.prototype.isChildStudy=function(){return!!this._isChildStudy},v.prototype.setChild=function(t){t instanceof v&&t.source()===this&&(this._children||(this._children=[]),-1===this._children.indexOf(t)&&this._children.push(t))},v.prototype.unsetChild=function(t){if(t instanceof v&&t.source()===this&&this._children){var e=this._children.indexOf(t);~e&&this._children.splice(e,1)}},v.prototype.hasChildren=function(){return!(!this._children||!this._children.length)},v.prototype.getAllChildren=function(){var t,e,i,o;if(!Array.isArray(this._children))return[];for(t=this._children.slice(),e=0;e<t.length;++e)for(i=t[e].getAllChildren(),o=0;o<i.length;++o)~t.indexOf(i[o])||t.push(i[o]);return t},v.prototype._debugId=function(){var t=[];return this._studyId&&t.push(this._studyId),t.push(this._metaInfo.fullId),t.push(this._metaInfo.description),JSON.stringify({study:t})},v.prototype.isStarted=function(){return!!this._studyId},v.prototype.isRestarting=function(){return!!this._restarting},v.prototype.isVisible=function(){var t,e,i;if(!this.properties().visible.value())return!1;if(this._metaInfo.plots.length>0)return!0;for(t in this._metaInfo.graphics)for(e in this._metaInfo.graphics[t])if(i=this.properties().graphics[t][e],!i.visible||i.visible.value())return!0;return!!this._metaInfo.isTVScriptStrategy},v.prototype.start=function(t,e){var i,o=this._model.mainSeries();if(!o.isStarted())return void o.onCompleted().subscribe(this,function(){this.start(t,e)},!0);this._isChildStudy&&this._source.isHibernated()&&this._source.start(),i=!this._isChildStudy&&!this.hasChildren()&&!this.isVisible(),!this._chartApi||!this._chartApi.connected()||i&&!0!==e||this._allSymbolsAreResolved().done(function(i){this._startAfterSymbolsResolved(t,e)}.bind(this)).fail(function(t){ct.logError("ERROR: "+this._debugId()+" start failed, "+t),delete this._restarting}.bind(this))},v.prototype._getStudyIdWithLatestVersion=function(){var t=st.cutDollarHash(this._metaInfo.id),e=t;return["Script@tv-scripting","StrategyScript@tv-scripting","ESD@tv-scripting"].indexOf(t)>=0?e+="-72!":e+="-"+this._metaInfo.version,e},v.prototype._startAfterSymbolsResolved=function(t,e){var i,o;if(!this.isStarted()||this._restarting){if(this._isChildStudy){if(!this._source.isStarted()||this._source.isRestarting())return void this._source.onStart.subscribe(this,this._startAfterSymbolsResolved,!0);st.setChildStudyMetaInfoPropertiesSourceId(this._metaInfo,this._source.sourceId(),this._properties)}if(this._studyId=v.makeNextStudyId(),delete this._restarting,this._allInputsAreValid()&&(this._inputs=this.inputs(),i=this._getStudyIdWithLatestVersion(),this._chartApi.createStudy(this._studyId,this._turnaround,this._isChildStudy?this._source.sourceId():this._series._seriesId,i,this._inputs,this._handler,this._isChildStudy),this._studyName=i,this._subscribeExtendedHours(),
this.onStart.fire(this._studyId),!0===t&&this._children))for(o=0;o<this._children.length;++o)this._children[o].start(!0,e)}},v._nextSymbolId=0,v.prototype._makeNextSymbolId=function(){return"ss_"+ ++v._nextSymbolId},v._nextStudyId=0,v.makeNextStudyId=function(){return"st"+ ++v._nextStudyId},v.prototype._rightOffsetToUnixTime=function(t){var e;return this._series.bars().size()>=t&&(e=w(this._series.bars().lastIndex())-t,w(this._series.bars().valueAt(e))[TradingView.TIME_PLOT]),null},v.prototype.getSymbolString=function(t){return this._series&&this._series.extendedHours.value()?"="+JSON.stringify({symbol:t,session:"extended"}):t},v.prototype.inputsForGUI=function(){return this.inputs({symbolsForDisplay:!0,skipHiddenInputs:!0,skipFakeInputs:!1,fakeInputsForDisplay:!0,asObject:!1})},v.prototype.inputsForAlert=function(){var t=this.offset(),e=this.inputs();return t&&e.push(t),e},v.prototype.inputs=function(t){var e={symbolsForDisplay:!1,symbolsForChartApi:!0,skipHiddenInputs:!1,skipFakeInputs:!1,asObject:!0};return TradingView.merge(e,t),this._buildInputs(e)},v.prototype._buildInputs=function(t){var e,i;S(!!t,"options not set"),e={};try{e=this._prepareInputs(t)}catch(t){ct.logWarn("Failed to prepare study inputs: "+t)}return t.asObject?(i={},Object.keys(e).forEach(function(t){null!=e[t]&&(i[t]=e[t])}),i):(i=[],Object.keys(e).forEach(function(t){null!=e[t]&&i.push(e[t])}),i)},v.prototype._prepareInputs=function(t){var e,i,o,r;for(S(!!t,"options not set"),e={},i=0;i<this._metaInfo.inputs.length;i++)o=this._metaInfo.inputs[i],o.isFake&&t.skipFakeInputs||o.isHidden&&t.skipHiddenInputs||"bool"===o.type&&t.skipHiddenInputs&&n.enabled("dont_show_boolean_study_arguments")||(r=this._prepareInput(o,t),e[o.id]=TradingView.clone(r));return e},v.prototype._prepareInput=function(t,e){var i=this._prepareInputValue(t,e);return!t.isFake||e.fakeInputsForDisplay?i:e.onlyAtomValues?i:{v:i,f:!0,t:t.type}},v.prototype._prepareInputValue=function(t,e){var i,o,n,r,s=t.id;return"symbol"===t.type?(i=this._properties.inputs[s].value(),e&&e.symbolsForDisplay?this._resolvedSymbols&&this._resolvedSymbols[i]&&(i=this._resolvedSymbols[i].exchange?this._resolvedSymbols[i].name+", "+this._resolvedSymbols[i].exchange:this._resolvedSymbols[i].name):(this._resolvedSymbols&&this._resolvedSymbols[i]&&(o=this._resolvedSymbols[i],i=o.ticker||o.full_name),e&&e.symbolsForChartApi&&(i=this.getSymbolString(i))),i):"bar_time"===t.type?(n=this._properties.inputs[s].value(),n<0&&(r=this._rightOffsetToUnixTime(-n),n=r&&r>=0?r:n),n):this._metaInfo.isTVScript||this._metaInfo.pine?"text"===s?this._metaInfo.defaults.inputs.text:"pineId"===s?this._metaInfo.scriptIdPart:"pineVersion"===s?this._metaInfo.pine?this._metaInfo.pine.version:"-1":this._properties.inputs[s].value():this._properties.inputs[s].value()},v.prototype._rebindToSource=function(t,e){var i,o,n,r,s,a,l,c,h,u,d;if(this._isChildStudy){if(this._source.unsetChild(this),delete this._nonPriceParent,o=null,t===this._model.mainSeries()){for(n=this._model.studiesMetaData(),
s=0;s<n.length;++s)if(this._metaInfo.id===n[s].id){r=n[s];break}if(!r)return void ct.logError("Can not find "+this._metaInfo.id+" meta info");delete this._source,delete this._isChildStudy,delete this._ownerSource,this._metaInfo=r.state(!0),i=this._series._seriesId,o=K.REBIND_STUDY_CHILD_TO_STANDALONE}else{if(!(t instanceof v))return ct.logError("Unable to rebind study to source of this type"),!1;this._ownerSource=t,this._source=t,i=this._source.sourceId(),this._source.setChild(this),this._source.isHibernated()&&this._source.start()}this._chartApi.rebindStudy(this._studyId,this._turnaround,i,this._studyName,e,this._handler,o)}else{if(!(t instanceof v))return ct.logError("Unable to rebind study to source of this type"),!1;if(a=t.isHibernated(),a&&t.start(),l=!1,this._canCreateStudyWithRebindType(K.REBIND_STUDY_STANDALONE_TO_CHILD)&&(l=this._chartApi.rebindStudy(this._studyId,this._turnaround,t.sourceId(),this._studyName,e,this._handler,K.REBIND_STUDY_STANDALONE_TO_CHILD)),!l)return a&&t.stop(),!1;this._metaInfo=TradingView.clone(this._metaInfo),this._isChildStudy=!0,this._ownerSource=t,this._source=t,this._source.setChild(this),this._childStudyByRebind.fire()}return c=this.m_priceScale,h=t.priceScale(),c!==h&&(u=this._model.paneForSource(this),d=this._model.paneForSource(t),u===d&&(~c.dataSources().indexOf(this)&&c.removeDataSource(this),h.addDataSource(this),this.setPriceScale(h))),!0},v.prototype.childStudyByRebind=function(){return this._childStudyByRebind},v.prototype._changeInputsImpl=function(t,e){var i,o,n,r,s=this.source(),a=this._properties.inputs&&this._properties.inputs.state(),l=st.getSourceIdByInputs(this._metaInfo.inputs,a),c=!0;if(l)if("high"===l||"open"===l||"low"===l||"close"===l||"hl2"===l||"ohl3"===l||"ohlc4"===l)s=this._model.mainSeries();else for(i=this._model.dataSources(),o=0;o<i.length;++o)if(i[o]instanceof v&&i[o].sourceId()===l){s=i[o];break}if(s!==this.source()){if(!this._rebindToSource(s,t)&&a){for(n=null,r=null,o=0;o<e.length;++o)if(e[o]!==t[o]&&0===t[o].indexOf(l)){n=this._properties.inputs[a[o].id],r=e[o],c=!1;break}n&&n.setValue(r)}}else this._chartApi.modifyStudy(this._studyId,this._turnaround,t,this._handler);c&&(this._studyModified=c)},v.prototype._changeInputs=function(t){var e=TradingView.clone(this._inputs);this._studyId&&this._chartApi.connected()?(this._turnaround="st"+ ++this._turnaroundCounter,this._allInputsAreValid()?this._allSymbolsAreResolved().done(this._changeInputsImpl.bind(this,t,e)).fail(function(t){ct.logError("ERROR: "+this._debugId()+" _changeInputs: cannot modify study, "+t)}.bind(this)):this.stop()):(this.stop(!0),this.start(!0)),this._inputs=t,this._tagsChanged.fire(),this._titleCache={}},v.prototype.testInputValue=function(t,e){var i,o;return!st.canBeChild(this._metaInfo)||!st.isSourceInput(t)||(!(i=this._properties.inputs&&this._properties.inputs[t.id])||(o=v.getInputRebindType(t,i.value(),e),!!this._canCreateStudyWithRebindType(o)))},v.prototype._canCreateStudyWithRebindType=function(t){
return t!==K.REBIND_STUDY_STANDALONE_TO_CHILD||this._chartApi.isCanCreateStudy(!0)},v.prototype.changeStyles=function(){var t,e=null!=this._metaInfo.inputs.filter(function(t){return"symbol"===t.type})[0];!this.isStarted()&&!e||this._restarting||(this._inputs?(t=this.inputs(),JSON.stringify(t)!==JSON.stringify(this._inputs)&&this._changeInputs(t)):this._chartApi&&this._chartApi.connected()&&this.restart(),this.hasBarColorer()&&this._model.mainSeries().invalidateBarStylesCache(),e&&this.invalidateBarStylesCache(),this.createViews(),this.recalculate(!0),this.updateAllViews())},v.prototype._isModifiedStudyInputs=function(t){if(void 0===this._oldStudyInputs)return this._oldStudyInputs=t,!0;var e=Object.keys(this._oldStudyInputs);return S(e.length===Object.keys(t).length,"keys quantity should be equal"),e.forEach(function(e){S(t.hasOwnProperty(e),"key '"+e+"' should existing in studyInputs"),this._oldStudyInputs[e]!==t[e]&&(this._oldStudyInputs=t)},this),this._oldStudyInputs===t},v.prototype.visibleChanged=function(){this._series instanceof TradingView.Series&&this._series.invalidateBarColorerCache()},v.prototype.invalidateBarStylesCache=function(){this.m_data.each(function(t,e){e[TradingView.STYLE_PLOT]=null})},v.prototype.processHibernate=function(){this.isHibernateAllowed()&&(!this._studyId&&this.isVisible()&&this.start(),this._studyId&&!this.isVisible()&&this.stop())},v.prototype.isHibernated=function(){return!this.isVisible()&&!this._studyId},v.prototype.isHibernateAllowed=function(){return!this._isChildStudy&&!this.hasChildren()},v.prototype.lastPriceLabelFixedCoordinate=function(t){return this._priceAxisViewsCache[t]._fixedCoordinate},v.prototype.priceLabelText=function(t){var e,i,o,n;return 1===this._simplePlotsCount?this._metaInfo.shortDescription:(e=this._metaInfo.styles,i=this._metaInfo.ohlcPlots,e&&e[t]&&(o=e[t]),i&&i[t]&&(o=i[t]),n=o.title,this._metaInfo.is_price_study?this._metaInfo.shortDescription+":"+n:n)},v.prototype.createPlotLabels=function(t){for(var e=0;e<t.length;e++)this._paneViews.push(new H(this._model,this,t[e],"priceLabelText","showStudyPlotLabels"))},v.prototype.createViews=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p;if(this._priceAxisViewsBase=[],this._paneViews=[],t={},this._priceAxisViewsCache={},e=[],this.metaInfo().plots)for(i=0;i<this.metaInfo().plots.length;i++)if(!(this.isSelfColorerPlot(i)||this.isTextColorerPlot(i)||this.isBarColorerPlot(i)||this.isOHLCColorerPlot(i)))if(o=this.metaInfo().plots[i].id,this.isBgColorerPlot(i))this._paneViews.push(new E(this,this._series,this._model,o));else if(this.isPlotShapesPlot(i))this._paneViews.push(new D(this,this._series,this._model,o));else if(this.isPlotCharsPlot(i))this._paneViews.push(new V(this,this._series,this._model,o));else if(this.isPlotArrowsPlot(i))this._paneViews.push(new O(this,this._series,this._model,o));else if(this.isOHLCSeriesPlot(i)){if(n=this.metaInfo().plots[i].target,t[n])continue;t[n]=n,
this.isOHLCBarsPlot(i)?this._paneViews.push(new R(this,this._series,this._model,n)):this.isOHLCCandlesPlot(i)&&this._paneViews.push(new B(this,this._series,this._model,n)),r=new k(this,{plotIndex:n}),this._priceAxisViewsCache[n]=r,this._priceAxisViewsBase.push(r),e.push(n)}else r=new k(this,{plotIndex:o}),this._priceAxisViewsCache[o]=r,this._priceAxisViewsBase.push(r),this._paneViews.push(new M(this,this._series,this._model,o)),this.properties().styles[o].trackPrice.value()&&this._paneViews.push(new s(this,this._series,this._model,o)),e.push(o);if(this._properties.bands)for(i=0;i<this._properties.bands.childCount();i++)this._properties.bands[i].visible.value()&&this._paneViews.push(new P(this._properties.bands[i],this));this._properties.bandsBackground&&this._paneViews.push(new L(this)),a=[],this.metaInfo().graphics&&(a=Object.keys(this.metaInfo().graphics),a.sort(function(t,e){return v.graphicsZOrderPriority(t)-v.graphicsZOrderPriority(e)}));for(l in a)c=a[l],h="_paneView"+c,u="StudyPaneView_"+c,TradingView.Study[u]&&(this[h]=new TradingView.Study[u](this,this._model),this._paneViews.push(this[h])),this._dataWindowView||"hhists"!==c||(this._dataWindowView=new TradingView.StudyHHistsDataWindowView(this,this._model));if(this._properties.areaBackground&&this._paneViews.push(new N(this)),this._properties.filledAreas&&this._metaInfo.filledAreas)for(i=0;i<this._metaInfo.filledAreas.length;++i)d=this._metaInfo.filledAreas[i],p=this._properties.filledAreasStyle[d.id],d.type===st.FilledArea.TYPE_PLOTS||d.palette?this._paneViews.push(new F(this,d,p)):d.type===st.FilledArea.TYPE_HLINES?this._paneViews.push(new I(this,d,p)):ct.logWarn("Unsupported filledArea type: "+d.type);this.createPlotLabels(e),this._dataWindowView||(this._dataWindowView=new U(this,this._model)),this._statusView||(this._statusView=new j(this,this._model.properties())),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},v.prototype.recalculate=function(t){var e=this._model.paneForSource(this);this._model.recalculatePane(e,t),this._model.updateSource(this)},v.prototype.data=function(){return this.m_data},v.prototype.metaInfo=function(){return this._metaInfo},v.prototype.status=function(){return this._status},v.prototype.title=function(t,e,i){var o,n=JSON.stringify([t,e,i]);return this._titleCache[n]?this._titleCache[n]:(o=this._title(t,e,i||!this._showStudyArgumentsProperty.value()),this._titleCache[n]=o,o)},v.prototype._title=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f;if(o=t?this._metaInfo.shortDescription||this._properties.shortDescription&&this._properties.shortDescription.value()||"Study":this._metaInfo.description||this._properties.description&&this._properties.description.value()||"Study",e=e||{},o=$.t(o),!i&&(n=this.inputsForGUI()||[],n.length>0)){if(r={},this._isChildStudy)for(s=0;s<this._metaInfo.inputs.length;++s)if(a=this._metaInfo.inputs[s],st.isSourceInput(a)){l=a.id,c=this._properties.inputs[l].value(),c.indexOf("$")>=0&&this._source&&(h=this._source.metaInfo(),
u=this._source.title(t,null,!0),1===h.plots.length?r[c]=u:(d=c.split("$")[1],p=h.plots[d].id,_=h.styles&&h.styles[p]&&h.styles[p].title||p,r[c]=u+":"+_));break}f=this,n=n.map(function(t){var i=isNumber(t)?f._numericFormatter.format(t):r&&r[t]||t;return e[i]&&(i=e[i]),i}),o+=" ("+n.join(", ")+")"}return o},v.prototype.invalidateTitleCache=function(t){if(this._titleCache={},!0===t&&this._children)for(var e=0;e<this._children.length;++e)this._children[e].invalidateTitleCache(t)},v.prototype.graphics=function(){return this._graphics.graphics()},v.prototype.turnaround=function(t){return!0===t?this.source().turnaround(!0)+"_"+this._turnaround:this._turnaround},v.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries().turnaround()||t===this.turnaround(!0)},v.prototype._makeJSONForNSData=function(t,e){var i=""!==t.params.nonseries.d?Y(t.params.nonseries.d):e||"";return Promise.resolve(i)},v.prototype.onData=function(t){var e,i,o,n,r=this;switch(t.method){case"study_loading":this._status=$.t("loading..."),this._failed=!1,this._statusView.update(),this._model.updateSource(this),-1===["Plot splits","Plot earnings","Plot dividends"].indexOf(r._metaInfo.description)&&(r._loadingStartTime=(new Date).getTime());break;case"study_error":delete this._loadingStartTime,this._failed=!0,this.clearData(),"string"==typeof t.params[2]?this._status=$.t(t.params[2].split(":",2)[0]):this._status="",this._statusView.update(),this._model.updateSource(this);break;case"study_completed":if(!this._checkTurnaround(t.params[1]))return Promise.resolve();e="chartSession:"+r._chartApi._sessionid,i=(new Date).getTime()-this._loadingStartTime,ct.logDebug(e+", Study "+this._metaInfo.description+" loading took "+i+" ms"),delete this._loadingStartTime,this._status="",this._statusView.update(),o=this._model.paneForSource(this),this._model.recalculatePane(o),this._updateSources(),this._model.invalidate(new G(G.FULL_UPDATE));break;case"study_deleted":break;case"data_update":return this._checkTurnaround(t.params.turnaround)?(this._studyModified&&(this.clearData(),this._studyModified=!1),n=0===this.m_data.size()&&this._metaInfo.plots.length>0,S(!!t.params.nonseries,"data.params.nonseries is missing"),new Promise(function(e){r._makeJSONForNSData(t).then(function(i){var o,s;t.params.nonseries.d=i,r._processPlotOffsets(t.params),r.transformData(t.params.plots),o=r._mergeData(t.params.plots).earliestRow,r.hasBarColorer()&&(null!==o?r._model.mainSeries().invalidateBarStylesCache(o.index):ct.logNormal("ERROR: No earliestRow in studies plots, "+r._debugId())),r._graphics.process(t.params.nonseries),r._postProcessGraphics(),s=r._model.paneForSource(r),r._model.recalculatePane(s,n),r._updateSources(),e()})})):Promise.resolve()}return Promise.resolve()},v.prototype.transformData=function(t){},v.prototype.moveData=function(t){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.move(t)},v.prototype.replaceData=function(t,e,i){this._invalidateLastNonEmptyPlotRowCache(),this.m_data.remove(t+1),this.m_data.addTail(i,e)},
v.prototype._updateSources=function(){this._model.updateSource(this),this.hasBarColorer()&&this._model.updateSource(this._model.mainSeries())},v.processPlotOffsets=function(t,e){if(!e.nonseries||"nochange"!==e.nonseries.indexes){var i=e.nonseries.d;if(!i||!i.indexes_replace)return i&&i.offsets?void(t._plotOffsets=i.offsets):void(t._plotOffsets={})}},v.prototype._processPlotOffsets=function(t){v.processPlotOffsets(this,t)},v.prototype._mergeData=function(t){return this._invalidateLastNonEmptyPlotRowCache(),this.m_data.merge(t)},v.prototype._postProcessGraphics=function(){var t=this,e=function(e){var i,o,n,r,s=t._graphics.graphics(),a=[];if(s&&s[e])for(n=s[e],i=0;i<n.length;i+=1)if(n[i].data)for(o=0;o<n[i].data.length;o+=1)r={line:n[i].data[o],styleId:n[i].styleId,lineType:e},a.push(new v.StudyPriceAxisView_hlines(t,r));return a};this._hlinesPriceAsisViews=e("hlines"),this._horizlinesPriceAsisViews=e("horizlines"),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},v.prototype._getNonPriceParent=function(){var t,e;if(this._nonPriceParent)return this._nonPriceParent;for(t=this.source();t instanceof v;){if(e=t.metaInfo(),!e.is_price_study||"Compare@tv-basicstudies"===e.id)return this._nonPriceParent=t,t;t=t.source()}},v.prototype.firstValue=function(t){var e,i,o,n,r,s;return!this._isChildStudy&&"Compare@tv-basicstudies"===this._metaInfo.id||!this._metaInfo.is_price_study?null===(e=this._model.timeScale().visibleBars())?null:(i=e.firstBar(),o=e.lastBar(),0===this.m_data.size()?null:(r=this,this.m_data.range(i,o).each(function(e,i){var o,s,a;for(o=1;o<i.length;++o)if(void 0!==i[o-1]&&null!==i[o-1]&&!r.isSelfColorerPlot(o-1)&&(s=r._metaInfo.plots[o-1].id,a=r.properties().styles[s],a.visible&&a.visible.value()&&!(t&&Math.abs(i[o])<1e-10||void 0===i[o]||null===i[o]||n)))return n=i[o],!0}),this._nonPriceFirstValue=n,n)):this._isChildStudy&&(s=this._getNonPriceParent())&&this.priceScale()===s.priceScale()?void 0!==s._nonPriceFirstValue?s._nonPriceFirstValue:s.firstValue():this._series.firstValue()},v.offset=function(t,e){var i=0;return t._plotOffsets&&void 0!==t._plotOffsets[e]&&(i+=t._plotOffsets[e]),void 0!==t._plotOffsetsMetaInfoOverride[e]?i+=t._plotOffsetsMetaInfoOverride[e]:t.properties().offsets&&void 0!==t.properties().offsets[e]&&(i+=t.properties().offsets[e].val.value()),t.properties().offset&&(i+=t.properties().offset.val.value()),i},v.prototype.offset=function(t){return v.offset(this,t)},v.prototype.priceRange=function(t,e){var i,o,n,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;if(!TradingView.isInteger(t))return void ct.logDebug("priceRange: incorrect startBar");if(!TradingView.isInteger(e))return void ct.logDebug("priceRange: incorrect endBar");if(0===this.m_data.size())return null;if(i=null,o=this,n=o._metaInfo,0===n.plots.length)return null;for(a=[],c=0;c<n.plots.length;++c)if(!(o.isSelfColorerPlot(c)||o.isTextColorerPlot(c)||o.isBarColorerPlot(c)||o.isBgColorerPlot(c)||o.isOHLCColorerPlot(c))&&(h=n.plots[c].id,o.isOHLCSeriesPlot(c)?(d=n.plots[c].target,
u=o.properties().ohlcPlots[d]):u=o.properties().styles[h],u.visible.value()&&(l=null,u.location&&(l=u.location.value()),s||(p=[CanvasEx.MARKLOC_ABSOLUTE,CanvasEx.MARKLOC_TOP,CanvasEx.MARKLOC_BOTTOM].indexOf(l)<0,_=o.isPlotShapesPlot(c)||o.isPlotCharsPlot(c),s=_&&p||o.isPlotArrowsPlot(c)),o.isLinePlot(c)||(o.isPlotShapesPlot(c)||o.isPlotCharsPlot(c))&&u.location.value()===CanvasEx.MARKLOC_ABSOLUTE||o.isOHLCSeriesPlot(c)))){if(f={index:c+1,offset:o.offset(h)},m=o.properties().styles[h].plottype.value(),!o.properties().skipHistogramBaseOnAutoScale&&[at.PlotType.Histogram,at.PlotType.Columns,at.PlotType.Area].indexOf(m)>=0){if(g=o.properties().styles[h].histogramBase.value(),!isNumber(g))continue;f.baseValue=g}a.push(f)}if(v=o.m_data.minMaxOnRange2(t,e,a),s&&(a=[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}],y=o.series().data().bars().minMaxOnRange2(t,e,a),v=rt(v,y)),null!==v&&(i=new r(v.min,v.max)),n.bands)for(c=0;c<n.bands.length;c++)if(o.properties().bands[c].visible.value()){if(g=o.properties().bands[c].value.value(),!isNumber(g))continue;i?i.apply(g,g):i=new r(g,g)}return i&&i.minValue()===i.maxValue()&&(b=.005*i.minValue(),i=new r(i.minValue()-b,i.maxValue()+b)),S=this.priceScale(),S&&S.properties().percentage.value()&&i?(w=this.firstValue(),w?i.convertToPercents(w):null):S&&S.isLog()&&i?new r(o.priceScale().priceToLogical(i.minValue()),o.priceScale().priceToLogical(i.maxValue())):i},v.prototype.paneViews=function(t){return this.properties().visible.value()?this._paneViews:null},v.prototype.dataWindowView=function(){return this._dataWindowView},v.prototype.statusView=function(){return this._statusView},v.prototype.priceAxisViews=function(t,e){return this._model.paneForSource(this)===t&&e===this.priceScale()&&(this._showLastValueOnPriceScale()||this.properties().oldShowLastValue&&this.properties().oldShowLastValue.value())?this._priceAxisViews:null},v.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showStudyLastValue.value()},v.prototype.isLinePlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.LINE},v.isSelfColorerPlot=function(t,e){return t._metaInfo.plots[e].type===at.PlotTypes.COLORER},v.prototype.isSelfColorerPlot=function(t){return v.isSelfColorerPlot(this,t)},v.prototype.isTextColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.TEXT_COLORER},v.prototype.isBarColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.BAR_COLORER},v.prototype.isBgColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.BG_COLORER},v.prototype.isPlotShapesPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.SHAPES},v.prototype.isPlotCharsPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.CHARS},v.prototype.isPlotArrowsPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.ARROWS},v.prototype.isOHLCBarsPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e]
;return i&&this.isOHLCSeriesPlot(t)&&i.plottype===at.OHLCType.BARS},v.prototype.isOHLCCandlesPlot=function(t){var e=this._metaInfo.plots[t].target,i=this.metaInfo().defaults.ohlcPlots[e];return i&&this.isOHLCSeriesPlot(t)&&i.plottype===at.OHLCType.CANDLES},v.prototype.isOHLCSeriesPlot=function(t){var e=this._metaInfo.plots[t].type;return e===at.PlotTypes.OHLC_OPEN||e===at.PlotTypes.OHLC_HIGH||e===at.PlotTypes.OHLC_LOW||e===at.PlotTypes.OHLC_CLOSE},v.prototype.isOHLCOpenPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_OPEN},v.prototype.isOHLCHighPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_HIGH},v.prototype.isOHLCLowPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_LOW},v.prototype.isOHLCClosePlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_CLOSE},v.prototype.isOHLCColorerPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.OHLC_COLORER},v.prototype.isDataOffsetPlot=function(t){return this._metaInfo.plots[t].type===at.PlotTypes.DATAOFFSET},v.prototype.hasBarColorer=function(){for(var t=0;t<this._metaInfo.plots.length;++t)if(this.isBarColorerPlot(t))return!0;return!1},v.prototype.barColorer=function(){var t,e,i=null;for(t=0;t<this._metaInfo.plots.length;++t)this.isBarColorerPlot(t)&&(e=new T(this,t),null==i?i=e:i.pushBackBarColorer(e));if(null==i)throw Error("Cannot create BarColorer: study doesn't have a bar_colorer plot!");return i},v.prototype.base=function(){return"Volume"===this._metaInfo.id?1:0},v.prototype._createFormatter=function(){var t,e,i;"default"===this.properties().precision.value()?this.metaInfo().defaults&&(t=parseInt(this.metaInfo().defaults.precision)):t=parseInt(this.properties().precision.value()),isFinite(t)||(t=-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(this._metaInfo.id)?0:1e4),e=this.series().symbolInfo(),0===t?(i=0,e&&e.volume_precision&&(i=e.volume_precision),this._formatter=new tt(i)):this._formatter=new Q(Math.pow(10,t)),this.priceScale()&&this.priceScale().updateFormatter()},v.prototype.formatter=function(){return this._formatter},v.prototype.nearestIndex=function(t,e){if(!TradingView.isInteger(t))return void ct.logDebug("nearestIndex: incorrect logicalPoint");var i=this._series.data().bars().search(t,e);return null!==i?i.index:void 0},v.prototype._lastNonEmptyPlotRow=function(t){var e,i;return TradingView.isInteger(t)?void 0!==this._lastNonEmptyPlotRowCache[t]?this._lastNonEmptyPlotRowCache[t]:(e=1e3,null===(i=this.data().findLast(function(e,i){return void 0!==i[t]},e))?null:(this._lastNonEmptyPlotRowCache[t]=i,this._lastNonEmptyPlotRowCache[t])):(ct.logDebug("_lastNonEmptyPlotRow: incorrect plotIndex"),null)},v.prototype.updateAllViews=function(){var t;for(t=0;t<this._paneViews.length;t++)this._paneViews[t].update();for(this._dataWindowView.update(),this._statusView.update(),t=0;t<this._priceAxisViews.length;t++)this._priceAxisViews[t].update()},v.prototype.tags=function(){
return!this._metaInfo||!this._metaInfo.description||this._metaInfo.isTVScriptStub||this._metaInfo.is_hidden_study||this._metaInfo.isTVScript&&"tv-scripting"===this._metaInfo.productId?[]:[this._metaInfo.description]},v.isPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":case"mtp_tsanalysis@mtp-mtpredictor":case"mtp_riskreward@mtp-mtpredictor":case"mtp_decisionpoint@mtp-mtpredictor":case"mtp_ew_main@mtp-mtpredictor":case"mtp_ew_major@mtp-mtpredictor":case"mtp_ew_minor@mtp-mtpredictor":case"mtp_wpt_down1ora@mtp-mtpredictor":case"mtp_wpt_down2orb@mtp-mtpredictor":case"mtp_wpt_down3@mtp-mtpredictor":case"mtp_wpt_down4@mtp-mtpredictor":case"mtp_wpt_down5@mtp-mtpredictor":case"mtp_wpt_downc@mtp-mtpredictor":case"mtp_wpt_up1ora@mtp-mtpredictor":case"mtp_wpt_up2orb@mtp-mtpredictor":case"mtp_wpt_up3@mtp-mtpredictor":case"mtp_wpt_up4@mtp-mtpredictor":case"mtp_wpt_up5@mtp-mtpredictor":case"mtp_wpt_upc@mtp-mtpredictor":return!0;default:return!1}},v.lineToolNameForPointsBasedStudy=function(t){switch(t){case"VbPFixed@tv-volumebyprice":return"LineToolVbPFixed";case"RegressionTrend@tv-basicstudies":return"LineToolRegressionTrend";case"mtp_tsanalysis@mtp-mtpredictor":return"LineStudyMtpAnalysis";case"mtp_riskreward@mtp-mtpredictor":return"LineStudyMtpRiskReward";case"mtp_decisionpoint@mtp-mtpredictor":return"LineStudyMtpDecisionPoint";case"mtp_ew_main@mtp-mtpredictor":return"LineStudyMtpElliotWaveMain";case"mtp_ew_major@mtp-mtpredictor":return"LineStudyMtpElliotWaveMajor";case"mtp_ew_minor@mtp-mtpredictor":return"LineStudyMtpElliotWaveMinor";case"mtp_wpt_down1ora@mtp-mtpredictor":return"LineStudyMtpDownWave1OrA";case"mtp_wpt_down2orb@mtp-mtpredictor":return"LineStudyMtpDownWave2OrB";case"mtp_wpt_down3@mtp-mtpredictor":return"LineStudyMtpDownWave3";case"mtp_wpt_down4@mtp-mtpredictor":return"LineStudyMtpDownWave4";case"mtp_wpt_down5@mtp-mtpredictor":return"LineStudyMtpDownWave5";case"mtp_wpt_downc@mtp-mtpredictor":return"LineStudyMtpDownWaveC";case"mtp_wpt_up1ora@mtp-mtpredictor":return"LineStudyMtpUpWave1OrA";case"mtp_wpt_up2orb@mtp-mtpredictor":return"LineStudyMtpUpWave2OrB";case"mtp_wpt_up3@mtp-mtpredictor":return"LineStudyMtpUpWave3";case"mtp_wpt_up4@mtp-mtpredictor":return"LineStudyMtpUpWave4";case"mtp_wpt_up5@mtp-mtpredictor":return"LineStudyMtpUpWave5";case"mtp_wpt_upc@mtp-mtpredictor":return"LineStudyMtpUpWaveC";default:throw Error("There is no line tool name, associated with study id "+t)}},v.isStudyLineTool=function(t){var e=i(128).StudyLineDataSource,o=TradingView[t];return"function"==typeof o&&o.prototype instanceof e},v.prototype.onExtendedHoursChanged=function(){this.restart()},v.prototype.hasSymbolInputs=function(){for(var t=this._metaInfo.inputs.length;t--;)if("symbol"===this._metaInfo.inputs[t].type)return!0;return!1},v.prototype._subscribeExtendedHours=function(){!this._isSubscribedToExtendedHours&&this.hasSymbolInputs()&&(this._series.extendedHours.listeners().subscribe(this,this.onExtendedHoursChanged),this._isSubscribedToExtendedHours=!0)},v.prototype._unsubscribeExtendedHours=function(){
this._isSubscribedToExtendedHours&&(this._series.extendedHours.listeners().unsubscribe(this,this.onExtendedHoursChanged),delete this._isSubscribedToExtendedHours)},v.prototype.removeByRemoveAllStudies=function(){return!0},v.prototype.canHaveChildren=function(){return void 0===this._canHaveChildren&&(this._canHaveChildren=!!st.canHaveChildren(this._metaInfo)),this._canHaveChildren},v.getInputRebindType=function(t,e,i){var o=st.isSourceInput(t);return o&&!~e.indexOf("$")&&~i.indexOf("$")?K.REBIND_STUDY_STANDALONE_TO_CHILD:o&&~e.indexOf("$")&&!~i.indexOf("$")?K.REBIND_STUDY_CHILD_TO_STANDALONE:0},v.prototype.getPlotFields=function(){return this._plotFields},v.prototype.getMinFirstBarIndexForPlot=function(t){var e,i=y(this._properties.styles,t)||y(this._properties.ohlcPlots,t)||y(this._properties.filledAreasStyle,t);return null===i?-1/0:(e=this.data().lastIndex(),null===e?-1/0:e-i+1)},v.prototype.getInputsPropertyPage=function(){return lt.StudyInputsPropertyPage},v.prototype.getStylesPropertyPage=function(){return lt.StudyStylesPropertyPage},v.prototype.getDisplayPropertyPage=function(){return lt.StudyDisplayPropertyPage},t.exports={Study:v,createStudy:l,prepareStudyProperties:c,prepareStudyPropertiesForLoadChart:u,prepareStudyPropsStateForLoadChart:_}}).call(e,i(25),i(10),i(5),i(73))},,,,,function(t,e,i){"use strict";function o(t,e,i){var o,n,s;for(e=e||t||i||"",o="",n=0;n<c.length;n++)if((s=e.match(c[n]))&&3===s.length){e=s[1],o=s[2];break}r.emit(e.toLowerCase().replace(" ","_"),{category:t,label:i,value:o})}function n(t,e,i){var n,r,a;if(s.enabled("charting_library_base"))return void o(t,e,i);n=(t?t+":":"")+e,i&&(n+=" "+i),l.logNormal(n),s.enabled("widget")||(r=window._gaq,window._UNIT_TESTS||void 0===r||(a=["_trackEvent",t,e],void 0!==i&&a.push(i),r.push(a)))}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),r=i(23),s=i(5),a=i(7),l=a.getLogger("Common.TrackEvent"),c=[/Study_(Drawing)_(.*)/,/(Study)_(.*)@tv-basicstudies/,/(Study)_(.*)/,/(Chart Style) (.*)/],e.trackEvent=n,window.TradingView=window.TradingView||{},window.TradingView.trackEvent=n},,,,function(t,e,i){"use strict";function o(t,e,i){var o=e.subtract(t),n=i.subtract(t),r=n.dotProduct(o)/o.dotProduct(o);return{coeff:r,distance:t.addScaled(o,r).subtract(i).length()}}function n(t,e,i){var n,r,s=o(t,e,i);return 0<=s.coeff&&s.coeff<=1?s:(n=t.subtract(i).length(),r=e.subtract(i).length(),n<r?{coeff:0,distance:n}:{coeff:1,distance:r})}Object.defineProperty(e,"__esModule",{value:!0}),e.distanceToLine=o,e.distanceToSegment=n},function(t,e,i){"use strict";function o(t,e,i,o,n,r){var s,a,h,u;return l.equalPoints(t,e)?null:(s=new l.Point(0,0),a=new l.Point(i,o),n?r?(h=c.intersectLineAndRectangle(l.lineThroughPoints(t,e),s,a),Array.isArray(h)?h:null):(u=c.intersectRayAndRectangle(e,t,s,a),null===u||l.equalPoints(e,u)?null:l.lineSegment(e,u)):r?(u=c.intersectRayAndRectangle(t,e,s,a),null===u||l.equalPoints(t,u)?null:l.lineSegment(t,u)):(h=c.intersectLineSegmentAndRectangle(l.lineSegment(t,e),s,a),Array.isArray(h)?h:null))}function n(t){return.3*t}
function r(t){return 2+.5*t}function s(t){return null!==t&&void 0!==t&&!h.isNaN(t)}function a(t,e){void 0!==e&&u.setLineStyle(t,e)}var l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),l=i(8),c=i(132),h=i(15),u=i(90),e.extendAndClipLineSegment=o,e.optimalBarWidth=n,e.selectionTolerance=r,e.coordinateIsValid=s,e.setValidLineStyle=a},function(t,e,i){"use strict";(function(t){function o(){this._zorder=0,this.m_priceScale=null,this._id=s.randomHashN(6),this._ownerSource=null,this._userEditEnabled=!0,this.hasAlert=new t(!1)}function n(t){o.call(this),this._isOverlay=null,this._model=t}var r=i(6).DefaultProperty,s=i(61);o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i)},o.prototype.id=function(){return this._id},o.prototype.idForAlert=function(){return this._id},o.prototype.setId=function(t){this._id=t},o.prototype.zorder=function(){return this._zorder},o.prototype.setZorder=function(t){"number"==typeof t&&this._zorder!==t&&(this._zorder=t)},o.prototype.title=function(){throw Error("Implement this fun in a subclass")},o.prototype.priceScale=function(){return this.m_priceScale},o.prototype.setPriceScale=function(t){this.m_priceScale=t},o.prototype.ownerSource=function(){return this._ownerSource},o.prototype.setOwnerSource=function(t){this._ownerSource=t,t&&this.setPriceScale(t.priceScale())},o.prototype.isSavedInChart=function(t){return!0},o.prototype.isSavedInStudyTemplates=function(){return!0},o.prototype.isRemovedByStudyTemplates=function(){return!0},o.prototype.hasContextMenu=function(){return!0},o.prototype.showInObjectTree=function(){return!0},o.prototype.setUserEditEnabled=function(t){this._userEditEnabled=t},o.prototype.userEditEnabled=function(){return this._userEditEnabled},o.prototype.canBeHidden=function(){return this.userEditEnabled()},o.prototype.isUserDeletable=function(){return this.userEditEnabled()},o.prototype.canHasAlert=function(){return!1},o.prototype.properties=function(){throw Error("Implement this fun in a subclass")},o.prototype.statusView=function(){return null},o.prototype.dataWindowView=function(){return null},o.prototype.priceAxisViews=function(t,e){return null},o.prototype.updateAllViews=function(){},o.prototype.paneViews=function(t){return null},o.prototype.isChildStudy=function(){return!1},o.prototype.hasChildren=function(){return!1},o.prototype.canHaveChildren=function(){return!1},o.prototype.onClickOutside=function(){},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return null},o.prototype.getDisplayPropertyPage=function(){return null},o.prototype.getVisibilitiesPropertyPage=function(){return null},o.prototype.getStrategyPropertyPage=function(){return null},o.prototype.getSourceIcon=function(){return null},inherit(n,o),n.prototype.isNoScale=function(){return!!this._isOverlay},n.prototype.base=function(){return 0},n.prototype.formatter=function(){return null},n.prototype.model=function(){return this._model},n.prototype.priceRange=function(t,e){return null},n.prototype.isDraggable=function(){
return!this._metaInfo||!this._metaInfo.linkedToSeries},n.prototype.priceLineColor=function(t){return t},e.DataSource=o,e.PriceDataSource=n}).call(e,i(17))},function(t,e,i){"use strict";function o(t,e,i,o,n){this._wptStudyId=o,this._pointsCount=n,m.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i,"mtp_wpt_down1ora",2)}function r(t,e,i){o.call(this,t,e,i,"mtp_wpt_down2orb",2)}function s(t,e,i){o.call(this,t,e,i,"mtp_wpt_down3",3)}function a(t,e,i){o.call(this,t,e,i,"mtp_wpt_down4",2)}function l(t,e,i){o.call(this,t,e,i,"mtp_wpt_down5",5)}function c(t,e,i){o.call(this,t,e,i,"mtp_wpt_downc",3)}function h(t,e,i){o.call(this,t,e,i,"mtp_wpt_up1ora",2)}function u(t,e,i){o.call(this,t,e,i,"mtp_wpt_up2orb",2)}function d(t,e,i){o.call(this,t,e,i,"mtp_wpt_up3",3)}function p(t,e,i){o.call(this,t,e,i,"mtp_wpt_up4",2)}function _(t,e,i){o.call(this,t,e,i,"mtp_wpt_up5",5)}function f(t,e,i){o.call(this,t,e,i,"mtp_wpt_upc",3)}var m=i(105).LineStudyMtp;inherit(o,m),o.prototype._studyInputs=function(){var t,e,i,o,n=this.points();if(n.length<this.pointsCount())return null;for(t=[this.properties().inputs.displayZoneLabels.value()],e=0;e<this.pointsCount();++e){if(i=n[e].index,null===(o=this._model.mainSeries().bars().valueAt(i)))return null;t.push(1e3*o[TradingView.TIME_PLOT])}return t},o.prototype._mtpStudyId=function(){return this._wptStudyId},o.prototype.pointsCount=function(){return this._pointsCount},inherit(n,o),n.getTooltipText=function(t){return"Down Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(r,o),r.getTooltipText=function(t){return"Down Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(s,o),s.getTooltipText=function(t){return"Down Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(a,o),a.getTooltipText=function(t){return"Down Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(l,o),l.getTooltipText=function(t){return"Down Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(c,o),c.getTooltipText=function(t){return"Down Wave C: Select Point "+((t?t._points.length:0)+1)},inherit(h,o),h.getTooltipText=function(t){return"Up Wave 1 or A: Select Point "+((t?t._points.length:0)+1)},inherit(u,o),u.getTooltipText=function(t){return"Up Wave 2 or B: Select Point "+((t?t._points.length:0)+1)},inherit(d,o),d.getTooltipText=function(t){return"Up Wave 3: Select Point "+((t?t._points.length:0)+1)},inherit(p,o),p.getTooltipText=function(t){return"Up Wave 4: Select Point "+((t?t._points.length:0)+1)},inherit(_,o),_.getTooltipText=function(t){return"Up Wave 5: Select Point "+((t?t._points.length:0)+1)},inherit(f,o),f.getTooltipText=function(t){return"Up Wave C: Select Point "+((t?t._points.length:0)+1)},e.LineStudyMtpDownWave1OrA=n,e.LineStudyMtpDownWave2OrB=r,e.LineStudyMtpDownWave3=s,e.LineStudyMtpDownWave4=a,e.LineStudyMtpDownWave5=l,e.LineStudyMtpDownWaveC=c,e.LineStudyMtpUpWave1OrA=h,e.LineStudyMtpUpWave2OrB=u,e.LineStudyMtpUpWave3=d,e.LineStudyMtpUpWave4=p,e.LineStudyMtpUpWave5=_,e.LineStudyMtpUpWaveC=f},function(t,e,i){"use strict";(function(e){var o=i(86),n=1e-10,r=function(){
function t(t,e,i,o,n){var r,s=n,a=0;if(isNaN(t.get(e-1)))return{index:NaN,value:NaN};for(r=0;r<e;++r)o(t.get(r),s)&&(a=r,s=t.get(r));return{index:a,value:s}}function r(t,e){return 100*t/e}function s(t,e,i,o,n){var r,s,a;this._areaRight=t,this._areaLeft=e,this._pivotType=i,this._series=o,this._currentIndex=n.new_var(0),this._currentValue=n.new_var(NaN),this._pivotIndex=n.new_var(-1),this._index=w.n(n),this._isNewBar=n.symbol.isNewBar,r=this._currentIndex.get(1),s=this._currentValue.get(1),a=this._pivotIndex.get(1),this._index>1&&(this._currentIndex.set(r),this._currentValue.set(s),this._pivotIndex.set(a))}function a(t,e,i){var o,n,r,a,l;this._deviation=t,o=i.new_var(w.high(i)),n=i.new_var(w.low(i)),o.get(2*e+1),n.get(2*e+1),this._pivotHigh=new s(e,e,s.HIGH,o,i),this._pivotLow=new s(e,e,s.LOW,n,i),this._lastVal=i.new_var(NaN),this._lastIndex=i.new_var(-1),this._lastType=i.new_var(),this._index=w.n(i),this._isNewBar=i.symbol.isNewBar,this._isBarClosed=i.symbol.isBarClosed,r=this._lastIndex.get(1),a=this._lastVal.get(1),l=this._lastType.get(1),this._index>1&&this.addPivot(r,a,l),this.processPivot(this._pivotHigh),this.processPivot(this._pivotLow)}function l(t){this.symbol=t,this.vars=[],this.vars_index=0,this.ctx=[],this.ctx_index=0}function c(t){this.mindepth=0,this.original=NaN,this.modified=!1,this.symbol=t}function h(t,e){this.timezone=t||"America/New_York",this.session=e||"0000-0000"}function u(t,e,i,o,n,r){this.periodBase=i,this.tickerid=t,this.period=e,this.index=-1,this.time=NaN,this.open=NaN,this.high=NaN,this.low=NaN,this.close=NaN,this.volume=NaN,this.updatetime=NaN,this.isNewBar=!1,this.isBarClosed=!1,this.session=new S.Session,this.other_sessions={},this.script=o,this.ticker=u.parseTicker(t);var s=u.parsePeriod(e);this.resolution=s.resolution,this.interval=s.interval,this.bb_cache={},this.minTick=n,this.periodForInitialRange=r}function d(t,e,i,o,n,r,s,a,c){this.body=n,this.symbols=[],this.runner=o,this.inputCallback=s,this.out=r,this.nonseriesOut=c,this.ctx=new l(this.add_sym(t,e,i,a)),this.init()}function p(t){this.symbols=[],this.barsets=[],this.subscription=[],this.host=t,this.isRecalculated=!1,this.start()}function _(t){p.feed=t}function f(t){this.runner=new p(t)}function m(t,e){this.info=t,this.bars=e||[],this.isBarClosed=!0}function g(t,e){this.period=t,this.generateEmptyBars=!!e}function v(){}var y="undefined"!=typeof window?window:e,b=y.PineJsCalendar?y.PineJsCalendar:i(50),S=i(58),w={};return w.max_series_size=10001,w.n=function(t){return t.symbol.index+1},w.nz=function(t,e){return e=e||0,isFinite(t)?t:e},w.na=function(t){return 0===arguments.length?NaN:isNaN(t)?1:0},w.isZero=function(t){return Math.abs(t)<=1e-10},w.toBool=function(t){return isFinite(t)&&!w.isZero(t)},w.eq=function(t,e){return w.isZero(t-e)},w.neq=function(t,e){return!w.eq(t,e)},w.ge=function(t,e){return w.isZero(t-e)||t>e},w.gt=function(t,e){return!w.isZero(t-e)&&t>e},w.lt=function(t,e){return!w.isZero(t-e)&&t<e},w.le=function(t,e){return w.isZero(t-e)||t<e},w.and=function(t,e){
return isNaN(t)||isNaN(e)?NaN:w.isZero(t)||w.isZero(e)?0:1},w.or=function(t,e){return isNaN(t)||isNaN(e)?NaN:w.isZero(t)&&w.isZero(e)?0:1},w.not=function(t){return isNaN(t)?NaN:w.isZero(t)?1:0},w.greaterOrEqual=function(t,e){return e-t<n},w.lessOrEqual=function(t,e){return t-e<n},w.equal=function(t,e){return Math.abs(t-e)<n},w.greater=function(t,e){return t-e>n},w.less=function(t,e){return e-t>n},w.max=Math.max,w.min=Math.min,w.pow=Math.pow,w.abs=Math.abs,w.log=Math.log,w.log10=function(t){return Math.log(t)/Math.LN10},w.sqrt=Math.sqrt,w.sign=function(t){return isNaN(t)?NaN:w.isZero(t)?0:t>0?1:-1},w.exp=Math.exp,w.sin=Math.sin,w.cos=Math.cos,w.tan=Math.tan,w.asin=Math.asin,w.acos=Math.acos,w.atan=Math.atan,w.floor=Math.floor,w.ceil=Math.ceil,w.round=Math.round,w.avg=function(t,e,i,o,n,r){var s,a;if(2===arguments.length)return(t+e)/2;for(s=0,a=0;a<arguments.length;a++)s+=arguments[a];return s/arguments.length},w.open=function(t){return t.symbol.open},w.high=function(t){return t.symbol.high},w.low=function(t){return t.symbol.low},w.close=function(t){return t.symbol.close},w.hl2=function(t){return(t.symbol.high+t.symbol.low)/2},w.hlc3=function(t){return(t.symbol.high+t.symbol.low+t.symbol.close)/3},w.ohlc4=function(t){return(t.symbol.open+t.symbol.high+t.symbol.low+t.symbol.close)/4},w.volume=function(t){return t.symbol.volume},w.updatetime=function(t){return t.symbol.updatetime},w.time=function(t,e,i){return t.symbol.bartime(e,i)},w.period=function(t){return t.symbol.period},w.tickerid=function(t){return t.symbol.tickerid},w.ticker=function(t){return t.symbol.ticker},w.interval=function(t){return t.symbol.interval},w.isdwm=function(t){return t.symbol.isdwm()},w.isintraday=function(t){return!t.symbol.isdwm()},w.isdaily=function(t){return"D"===t.symbol.resolution},w.isweekly=function(t){return"W"===t.symbol.resolution},w.ismonthly=function(t){return"M"===t.symbol.resolution},w.year=function(t){return w.timepart(t.symbol,b.YEAR,arguments[1])},w.month=function(t){return w.timepart(t.symbol,b.MONTH,arguments[1])},w.weekofyear=function(t){return w.timepart(t.symbol,b.WEEK_OF_YEAR,arguments[1])},w.dayofmonth=function(t){return w.timepart(t.symbol,b.DAY_OF_MONTH,arguments[1])},w.dayofweek=function(t){return w.timepart(t.symbol,b.DAY_OF_WEEK,arguments[1])},w.hour=function(t){return w.timepart(t.symbol,b.HOUR_OF_DAY,arguments[1])},w.minute=function(t){return w.timepart(t.symbol,b.MINUTE,arguments[1])},w.second=function(t){return w.timepart(t.symbol,b.SECOND,arguments[1])},w.add_days_considering_dst=function(t,e,i){return b.add_days_considering_dst(b.get_timezone(t),e,i)},w.selectSessionBreaks=function(t,e){var i,o,n,r,s,a;if(w.isdwm(t)||void 0===t.symbol.session.timezone)return[];if(i=u.newBarBuilder(t.symbol.period,t.symbol.session),o=[],n=e.length,i.moveTo(e[n-1]),1===n&&i.sessionStart===e[0])o.push(e[0]);else{for(r=n-2;r>=0;--r)(s=e[r])>=i.sessionStart||(i.moveTo(s),a=e[r+1],o.push(a));o.reverse()}return o},w.iff=function(t,e,i){return w.not(t)?i:e},w.rising=function(t,e){for(var i=1;i<e+1;++i)if(t.get(i)>t.get(0))return 0
;return 1},w.falling=function(t,e){for(var i=1;i<e+1;++i)if(t.get(i)<t.get(0))return 0;return 1},w.timepart=function(t,e,i){var o=b.utc_to_cal(t.timezone,i||t.bartime());return b.get_part(o,e)},w.rsi=function(t,e){return w.isZero(e)?100:w.isZero(t)?0:100-100/(1+t/e)},w.sum=function(t,e,i){var o=i.new_var(),n=w.nz(t.get())+w.nz(o.get(1))-w.nz(t.get(e));return o.set(n),n},w.sma=function(t,e,i){var o=w.sum(t,e,i);return w.na(t.get(e-1))?NaN:o/e},w.rma=function(t,e,i){var o=w.sum(t,e,i),n=e-1,r=t.get(n),s=i.new_var(),a=s.get(1),l=t.get(),c=w.na(r)?NaN:w.na(a)?o/e:(l+a*n)/e;return s.set(c),c},w.fixnan=function(t,e){var i=e.new_var();return isNaN(t)?i.get(1):(i.set(t),t)},w.tr=function(t,e){var i,o,n;return 1===arguments.length&&(e=t,t=void 0),i=void 0!==t&&!!t,o=e.new_var(w.close(e)),n=o.get(1),i&&isNaN(n)&&(n=w.close(e)),w.max(w.max(w.high(e)-w.low(e),w.abs(w.high(e)-n)),w.abs(w.low(e)-n))},w.atr=function(t,e){var i=e.new_var(w.tr(e));return w.sma(i,t,e)},w.ema=function(t,e,i){var o=w.sum(t,e,i),n=i.new_var(),r=t.get(0),s=t.get(e-1),a=n.get(1),l=w.na(s)?NaN:w.na(a)?o/e:2*(r-a)/(e+1)+a;return n.set(l),l},w.wma=function(t,e,i){var o,n,r=0;for(e=Math.round(e),o=e;o>=0;o--)n=e-o,r+=n*t.get(o);return 2*r/(e*(e+1))},w.vwma=function(t,e,i){var o=i.new_var(w.volume(i)),n=i.new_var(t.get(0)*w.volume(i));return w.sma(n,e,i)/w.sma(o,e,i)},w.swma=function(t,e){return(t.get(0)+2*t.get(1)+2*t.get(2)+t.get(3))/6},w.lowestbars=function(e,i,o){return-t(e,i,o,function(t,e){return w.lt(t,e)},Number.MAX_VALUE).index},w.lowest=function(e,i,o){return t(e,i,o,function(t,e){return w.lt(t,e)},Number.MAX_VALUE).value},w.highestbars=function(e,i,o){return-t(e,i,o,function(t,e){return w.gt(t,e)},Number.MIN_VALUE).index},w.highest=function(e,i,o){return t(e,i,o,function(t,e){return w.gt(t,e)},Number.MIN_VALUE).value},w.cum=function(t,e){var i=e.new_var(),o=w.nz(i.get(1))+t;return i.set(o),o},w.accdist=function(t){var e=w.high(t),i=w.low(t),o=w.close(t),n=w.volume(t);return w.cum(o===e&&o===i||e===i?0:n*(2*o-i-e)/(e-i),t)},w.correlation=function(t,e,i,o){var n=w.sma(t,i,o),r=w.sma(e,i,o),s=o.new_var(t.get()*e.get());return(w.sma(s,i,o)-n*r)/Math.sqrt(w.variance2(t,n,i)*w.variance2(e,r,i))},w.stoch=function(t,e,i,o,n){var s=w.highest(e,o),a=w.lowest(i,o);return w.fixnan(r(t.get()-a,s-a),n)},w.tsi=function(t,e,i,o){var n=o.new_var(w.change(t)),r=o.new_var(w.abs(w.change(t))),s=o.new_var(w.ema(n,i,o)),a=o.new_var(w.ema(r,i,o));return w.ema(s,e,o)/w.ema(a,e,o)},w.cross=function(t,e,i){function o(t){return t<0?-1:0===t?0:1}if(isNaN(t)||isNaN(e))return!1;var n=i.new_var(o(t-e));return!isNaN(n.get(1))&&n.get(1)!==n.get()},w.linreg=function(t,e,i){var o,n,r,s,a,l,c=0,h=0,u=0,d=0;for(o=0;o<e;++o)n=t.get(o),r=e-1-o,s=r+1,c+=s,h+=n,u+=s*s,d+=n*s;return a=(e*d-c*h)/(e*u-c*c),l=h/e,l-a*c/e+a+a*(e-1-i)},w.sar=function(t,e,i,o){function n(e,i){var o=m.get();return g.set(e),m.set(i),v.set(1e3*t),y.set(o),o}
var r,s,a=w.high(o),l=w.low(o),c=w.close(o),h=o.new_var(a),u=o.new_var(l),d=o.new_var(c),p=d.get(1),_=u.get(1),f=h.get(1),m=o.new_var(),g=o.new_var(),v=o.new_var(),y=o.new_var(),b=y.get(1);if(isNaN(p))return NaN;if(r=1e-7,isNaN(b)&&(w.ge(c,p)?(g.set(1),m.set(Math.max(a,f)),b=Math.min(l,_)):(g.set(-1),b=Math.max(a,f),m.set(Math.min(l,_))),v.set(1e3*t)),1===g.get()){if(w.gt(a,m.get())&&(m.set(a),v.set(Math.min(v.get()+1e3*e,1e3*i))),w.le(l,b))return n(-1,l)}else if(w.lt(l,m.get())&&(m.set(l),v.set(Math.min(v.get()+1e3*e,1e3*i))),w.ge(a,b))return n(1,a);return s=b+v.get()*(m.get()-b)/1e3,1===g.get()?w.ge(s,l)&&(s=l-r):w.le(s,a)&&(s=a+r),y.set(s),s},w.alma=function(t,e,i,o){var n,r,s,a=Math.floor(i*(e-1)),l=e/o*(e/o),c=[],h=0;for(n=0;n<e;++n)r=Math.exp(-1*Math.pow(n-a,2)/(2*l)),h+=r,c.push(r);for(n=0;n<e;++n)c[n]/=h;for(s=0,n=0;n<e;++n)s+=c[n]*t.get(e-n-1);return s},w.wvap=function(t,e){return t.get()-t.get(1)},w.change=function(t){return t.get()-t.get(1)},w.roc=function(t,e){var i=t.get(e);return 100*(t.get()-i)/i},w.dev=function(t,e,i){var o=w.sma(t,e,i);return w.dev2(t,e,o)},w.dev2=function(t,e,i){var o,n,r,s=0;for(o=0;o<e;o++)n=t.get(o),r=w.abs(n-i),s+=r;return s/e},w.stdev=function(t,e,i){var o=w.variance(t,e,i);return w.sqrt(o)},w.variance=function(t,e,i){var o=w.sma(t,e,i);return w.variance2(t,o,e)},w.variance2=function(t,e,i){var o,n,r,s=0;for(o=0;o<i;o++)n=t.get(o),r=w.abs(n-e),s+=r*r;return s/i},w.percentrank=function(t,e){var i,o,n,r;if(w.na(t.get(e-1)))return NaN;for(i=0,o=t.get(),n=1;n<e;n++)r=t.get(n),w.ge(o,r)&&i++;return 100*i/e},w.createNewSessionCheck=function(t){var e=u.newBarBuilder(t.symbol.period,t.symbol.session);return function(t){return e.indexOfBar(t)===S.POST_SESSION&&(e.moveTo(t),!0)}},s.LOW=0,s.HIGH=1,s.prototype.isPivotFound=function(){return-1!==this._pivotIndex.get()},s.prototype.pivotIndex=function(){return this._pivotIndex.get()},s.prototype.currentValue=function(){return this._currentValue.get()},s.prototype.pivotType=function(){return this._pivotType},s.prototype.reset=function(){this._currentValue.set(NaN),this._currentIndex.set(0),this._pivotIndex.set(-1)},s.prototype.isRightSideOk=function(t){return t-this._currentIndex.get()===this._areaRight},s.prototype.isViolate=function(t,e){if(t<1||isNaN(this._currentValue.get()))return!0;var i=this._series.get(this._index-t);return!!isNaN(i)||(i===this._currentValue.get()?e:this._pivotType===s.HIGH?i>this._currentValue.get():i<this._currentValue.get())},s.prototype.processPoint=function(t){this.isViolate(t,!1)&&(this._currentValue.set(this._series.get()),this._currentIndex.set(t))},s.prototype.isRestartNeeded=function(t){return t-this._currentIndex.get()>this._areaRight},s.prototype.update=function(){var t,e;if(this._isNewBar&&this.isPivotFound()&&this.reset(),this.processPoint(this._index),this.isRightSideOk(this._index)){if(-1===this._pivotIndex.get()){for(t=!0,e=0;e<this._areaLeft;++e)if(this.isViolate(this._currentIndex.get()-1-e,!0)){t=!1;break}t&&this._pivotIndex.set(this._currentIndex.get())}
}else-1!==this._pivotIndex.get()&&this._pivotIndex.set(-1);if(this.isRestartNeeded(this._index))for(this.reset(),e=0;e<=this._areaRight;++e)this.processPoint(this._index-this._areaRight+e)},a.prototype.addPivot=function(t,e,i){this._lastIndex.set(t),this._lastVal.set(e),this._lastType.set(i)},a.prototype.updatePivot=function(t,e){this._lastIndex.set(t),this._lastVal.set(e)},a.prototype.lastPrice=function(){return this._lastVal.get()},a.prototype.lastIndex=function(){return this._lastIndex.get()},a.prototype.addPoint=function(t,e,i){var o;return isNaN(this._lastVal.get())?void this.addPivot(t,e,i):(o=this._lastVal.get(),this._lastType.get()===i?void((i===s.HIGH?e>o:e<o)&&this.updatePivot(t,e)):void(Math.abs(o-e)/e>this._deviation&&this.addPivot(t,e,i)))},a.prototype.processPivot=function(t){t.update(),this._isBarClosed&&t.isPivotFound()&&this.addPoint(t.pivotIndex(),t.currentValue(),t.pivotType())},w.zigzag=function(t,e,i){return new a(t,e,i).lastPrice()},w.zigzagbars=function(t,e,i){var o=new a(t,e,i);return-1===o.lastIndex()?NaN:o.lastIndex()-w.n(i)},l.prototype.new_sym=function(t,e,i,o){return this.symbol.script.add_sym(t,e,i,void 0,o)},l.prototype.select_sym=function(t){this.symbol=this.symbol.script.get_sym(t)},l.prototype.new_var=function(t){var e,i=this.vars;return i.length<=this.vars_index&&i.push(new c(this.symbol)),e=i[this.vars_index++],arguments.length>0&&e.set(t),e},l.prototype.new_ctx=function(){return this.ctx.length<=this.ctx_index&&this.ctx.push(new l(this.symbol)),this.ctx[this.ctx_index++]},l.prototype.prepare=function(t){var e,i;for(this.ctx_index=0,this.vars_index=0,e=0;e<this.vars.length;e++)this.vars[e].prepare(t);for(i=0;i<this.ctx.length;i++)this.ctx[i].prepare(t)},l.prototype.stop=function(){this.symbol=null,this.vars=null},c.prototype.valueOf=function(){return this.get(0)},c.prototype.get=function(t){return isNaN(t)&&(t=0),t=t||0,this.hist?t>=this.hist.length?(console.error("not enough depth: "+this),NaN):this._get(t):(this.mindepth=w.max(this.mindepth,t),NaN)},c.prototype._get=function(t){var e=this.hist_pos-t;return e<0&&(e+=this.hist.length),this.hist[e]},c.prototype.set=function(t){this.hist&&(this.hist[this.hist_pos]=t,this.modified=!0)},c.prototype.prepare=function(t){t===this.symbol&&(t.isNewBar?(this.original=this.get(0),!this.modified&&this.hist||this.add_hist()):this.set(this.original),this.modified=!1)},c.prototype.add_hist=function(){var t,e,i;if(!this.hist){for(t=w.na(this.mindepth)?w.max_series_size:w.min(this.mindepth+1,w.max_series_size),t=Math.round(t),e=Array(t),i=0;i<t;i++)e[i]=NaN;this.hist=e,this.hist_pos=-1}this.hist_pos=Math.min(this.hist_pos+1,this.hist.length),this.hist_pos===this.hist.length&&(this.hist_pos=this.hist.length-1,this.hist.shift(),this.hist.push(NaN)),this.hist[this.hist_pos]=this.original},c.prototype.adopt=function(t,e,i){var o,n,r,s;return this.hist||(this.mindepth=NaN),o=e.get(),n=t.indexOf(o),0!==i&&(r=e.get(1),w.na(r)||(s=t.indexOf(r),n=n===s?-1:n)),n<0?NaN:this._get(n)},c.prototype.indexOf=function(t){var e,i,n,r
;return this.hist?w.na(t)?-1:(e=this.hist.length,i=this.symbol.index+1,n=Math.min(e,i),r=o.upperbound_int(this.hist,t,0,n),0===r?-1:n-r):(this.mindepth=NaN,-1)},u.parseTicker=function(t){var e=t.indexOf(":");return-1===e?t:t.substr(e+1)},u.parsePeriod=function(t){var e,i,o,n,r,s,a,l;return t+="",e=t.slice(0),i=e.indexOf(",")>=0,i&&(n=e.split(","),o=u.parsePeriod(n[1]),e=n[0]),r=!1,s=!1,a=e[e.length-1],-1==="DWM".indexOf(a)&&("S"===a?s=!0:(r=!0,a="")),l=parseInt(r?e:e.length>1?e.slice(0,e.length-1):1),{resolution:a,interval:l,pureResolution:""+l+a,isIntraday:r,isSeconds:s,range:o}},u.newBarBuilder=function(t,e,i){var o=u.parsePeriod(t);return S.newBarBuilder(o.resolution,o.interval,e,i)},u.newSession=function(t,e){var i=b.get_timezone(t);return(new S.Session).init(i,e)},u.prototype.set_symbolinfo=function(t){t||console.error("WARN: symbolinfo isn't defined for "+this.tickerid),this.info=t,this.timezone=b.get_timezone(t.timezone),this.session.init(this.timezone,t.session);for(var e in this.other_sessions)this.other_sessions.hasOwnProperty(e)&&this.other_sessions[e].init(this.timezone,e)},u.prototype.get_session=function(t){if(!t)return this.session;var e=this.other_sessions[t];return e||(e=new S.Session,this.other_sessions[t]=e),e},u.prototype.isdwm=function(){return""!==this.resolution&&"S"!==this.resolution},u.prototype.enable_dwm_aligning=function(t,e){this.dwm_aligner=u.newBarBuilder(this.period,t,e)},u.prototype.bartime=function(t,e){var i,o,n,r,s=this.time;return t&&(i=t,e&&(i+=e),o=this.bb_cache[i],o||(n=this.get_session(e),o=u.newBarBuilder(t,n),this.bb_cache[i]=o),s=o.alignTime(s)),!this.isdwm()||isNaN(s)?s:(r=b.utc_to_cal(this.timezone,s),this.session.spec.correctTradingDay(r,this.timezone),b.cal_to_utc(this.timezone,r))},u.prototype.lastbar=function(t){var e,i;isNaN(t.time)||(e=t.time,this.dwm_aligner&&(this.dwm_aligner.moveTo(e),e=this.dwm_aligner.startOfBar(0)),i=this.time!==e,i&&this.index>=0&&!this.isBarClosed&&(this.isNewBar=!1,this.isBarClosed=!0,this.script.calc(this)),this.time=e,this.open=t.open,this.high=t.high,this.low=t.low,this.close=t.close,this.volume=t.volume,this.updatetime=t.updatetime,this.isNewBar=i,this.isBarClosed=t.isBarClosed,this.isLastBar=t.isLastBar,this.isNewBar&&this.index++,this.script.calc(this))},d.prototype.calc=function(t){var e,i,o=this.ctx,n=this.body;o.prepare(t),e=n.main(o,this.inputCallback),i=this,this.out&&e&&(!isNaN(o.symbol.time)||e.nonseries)&&(e.nonseries?("projection"===e.type&&(e.projectionTime=o.symbol.time),this.nonseriesOut(o.symbol,e)):e.bars?e.bars.forEach(function(t){i.out(o.symbol,t)}):this.out(o.symbol,e))},d.prototype.init=function(){var t=this.ctx,e=this.body;e.init&&e.init(t,this.inputCallback),e.main(t,this.inputCallback)},d.prototype.add_sym=function(t,e,i,o,n){var r=this.runner.add_sym(t,e,i,this,o,n);return this.symbols.push(r),r.isdwm()&&this.symbols.length>1&&r.enable_dwm_aligning(this.symbols[0].session,r.session),r},d.prototype.stop=function(){this.symbols=null,this.ctx.stop(),this.ctx=null},d.prototype.get_sym=function(t){
return this.symbols[t]},p.prototype.add_sym=function(t,e,i,o,n,r){var s=new u(t,e,i,o,n,r);return this.symbols.push(s),s},p.prototype.get_sym=function(t){return this.symbols[t]},p.prototype.out=function(t,e){if(this.nonseriesUpdate){var i=$.extend({},this.nonseriesUpdate);e.splice(0,0,t.time),i.lastBar=e,this.host.nonseriesOut(t,i)}else this.host.out(t,e)},p.prototype.start=function(){function t(t,o){var n=p.feed.subscribe(t.tickerid,t.period,t.periodBase,t.periodForInitialRange,function(i){"series"==(i.nonseries?"nonseries":"series")?e.update(o,i):i.lastBar?(e.nonseriesUpdate=i,i.lastBar.isLastBar=!0,e.symbols[0].lastbar(i.lastBar),e.nonseriesUpdate=null):r.nonseriesOut(t,i)},r.onErrorCallback,r.symbolInfo,r.sessionId,r.rangeExtension);i.push(n)}var e,i,o,n,r=this.host;for(this._script=new d(r.tickerid,r.period,r.periodBase||r.period,this,r.body,this.out.bind(this),r.input,r.symbolInfo.minmov/r.symbolInfo.pricescale,r.nonseriesOut),e=this,i=[],o=this.symbols,n=0;n<o.length;n++)t(o[n],n);this.subscription=i},p.prototype.stop=function(){var t,e=this.subscription;if(!e&&!this._script)return void console.warn("Recurring script engine stop happened.");for(t=0;t<e.length;t++)p.feed.unsubscribe(e[t]);this.subscription=null,this._script.stop(),this._script=null,this.symbols=null},p.prototype.update=function(t,e){var i,o;if(!e)return void console.error("Unexpected barset = null");i=this.symbols[t],this.isRecalculated?(o=e.bar(e.count()-1),o.isBarClosed=e.isLastBarClosed(),o.isLastBar=!0,i.lastbar(o)):this.barsets[t]||(this.barsets[t]=e,i.set_symbolinfo(e.symbolinfo()),this.recalc())},p.prototype.recalc=function(){var t,e,i,o,n,r,s,a=this.symbols;for(t=0;t<a.length;t++)if(!this.barsets[t])return;for(e=a.length-1;e>=0;e--)for(i=a[e],o=this.barsets[e],n=o.count(),r=0;r<n;r++)s=o.bar(r),s.isLastBar=r===n-1,s.isBarClosed=!s.isLastBar||o.isLastBarClosed(),i.lastbar(s);this.isRecalculated=!0,this.barsets[0]&&this.barsets[0].endOfData&&this.host.setNoMoreData(),this.host.recalc(this,{endOfData:this.barsets[0].endOfData,nextTime:this.barsets[0].nextTime})},p.feed={subscribe:function(t,e,i,o){console.error("must be initialized with setupFeed")},unsubscribe:function(t){console.error("must be initialized with setupFeed")}},f.prototype.stop=function(){this.runner.stop()},m.prototype.symbolinfo=function(){return this.info},m.prototype.isLastBarClosed=function(){return this.isBarClosed},m.prototype.setLastBarClosed=function(t){this.isBarClosed=t},m.prototype.bar=function(t){return this.bars[t]},m.prototype.count=function(){return this.bars.length},m.prototype.add=function(t,e){var i=t,o=this.bars,n=o.length,r=i.time,s=0===n?NaN:o[n-1].time;0===n||s<r?o.push(i):s===r?o[n-1]=i:console.error("time order violation, prev: "+new Date(s).toUTCString()+", cur: "+new Date(r).toUTCString()),this.isBarClosed=!!e},g.prototype.init=function(t){this.bb=u.newBarBuilder(this.period,t.symbol.session),this.bbEmptyBars=this.generateEmptyBars?u.newBarBuilder(this.period,t.symbol.session):void 0},g.prototype.extrapolate=function(t,e){
return isNaN(t)||isNaN(e)?void 0:S.extrapolateBarsFrontToTime(this.bbEmptyBars,t,e)},g.prototype.main=function(t){var e=t.symbol.time,i=this.bb.alignTime(e),o=t.new_var(i),n=w.na(i),r=o.get(1),s=w.na(r)?1:w.neq(i,r),a=t.new_var(),l=t.new_var(),c=t.new_var(),h=t.new_var(),u=a.get(1),d=l.get(1),p=c.get(1),_=h.get(1),f=n?NaN:s?w.open(t):u,m=n?NaN:s?w.high(t):w.max(w.high(t),d),g=n?NaN:s?w.low(t):w.min(w.low(t),p),v=n?NaN:w.close(t),y=n?NaN:s?w.volume(t):w.volume(t)+_,b=n?NaN:e,S=t.symbol.isBarClosed&&this.bb.isLastBar(0,e),T=this.generateEmptyBars&&s?this.extrapolate(r,i):void 0,C=t.new_var(w.close(t)),x=C.get(1),P=T instanceof Array?x:NaN;return a.set(f),l.set(m),c.set(g),h.set(y),[i,f,m,g,v,y,b,S,T,P]},v.prototype.main=function(t){return[w.open(t),w.high(t),w.low(t),w.close(t),w.volume(t),w.updatetime(t)]},{Std:w,Series:c,Symbol:u,SymbolInfo:h,StudyEngine:f,BarSet:m,OHLCV:v,BarBuilder:g,setupFeed:_}}();t.exports=r}).call(e,i(78))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.STATUS_OFFLINE=0,e.STATUS_RESOLVING=1,e.STATUS_LOADING=2,e.STATUS_READY=3,e.STATUS_INVALID_SYMBOL=4,e.STATUS_SNAPSHOT=5,e.STATUS_EOD=6,e.STATUS_PULSE=7,e.STATUS_DELAYED=8,e.STATUS_DELAYED_STREAMING=9,e.STATUS_NO_BARS=10,e.STATUS_REPLAY=11,e.STYLE_BARS=0,e.STYLE_CANDLES=1,e.STYLE_LINE=2,e.STYLE_LINE_TYPE_MARKERS=0,e.STYLE_LINE_TYPE_STEP=1,e.STYLE_LINE_TYPE_SIMPLE=2,e.STYLE_AREA=3,e.STYLE_RENKO=4,e.STYLE_KAGI=5,e.STYLE_PNF=6,e.STYLE_PB=7,e.STYLE_HEIKEN_ASHI=8,e.STYLE_HOLLOW_CANDLES=9,e.STYLE_BASELINE=10,e.STYLE_SHORT_NAMES={},e.STYLE_SHORT_NAMES[e.STYLE_BARS]="bar",e.STYLE_SHORT_NAMES[e.STYLE_CANDLES]="candle",e.STYLE_SHORT_NAMES[e.STYLE_HOLLOW_CANDLES]="hollowCandle",e.STYLE_SHORT_NAMES[e.STYLE_LINE]="line",e.STYLE_SHORT_NAMES[e.STYLE_AREA]="area",e.STYLE_SHORT_NAMES[e.STYLE_RENKO]="renko",e.STYLE_SHORT_NAMES[e.STYLE_PB]="pb",e.STYLE_SHORT_NAMES[e.STYLE_KAGI]="kagi",e.STYLE_SHORT_NAMES[e.STYLE_PNF]="pnf",e.STYLE_SHORT_NAMES[e.STYLE_HEIKEN_ASHI]="ha",e.STYLE_SHORT_NAMES[e.STYLE_BASELINE]="baseline",e.SYMBOL_STRING_DATA={},e.SYMBOL_STRING_DATA[e.STYLE_RENKO]={type:"BarSetRenko@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_PB]={type:"BarSetPriceBreak@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_KAGI]={type:"BarSetKagi@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_PNF]={type:"BarSetPnF@tv-prostudies"},e.SYMBOL_STRING_DATA[e.STYLE_HEIKEN_ASHI]={type:"BarSetHeikenAshi@tv-basicstudies"}},function(t,e,i){"use strict";function o(t){var e,i,o,n,r,s;if("Asia/Bahrain"===t&&(t="Asia/Kuwait"),this._name=t,e=u[t],e||(e={time:[],offset:[]},this._invalid=!0),e.time.length!==e.offset.length&&(e={time:[],offset:[]},this._invalid=!0),!e.time_utc){for(i=e.time,o=e.offset,n=i.length,r=Array(n),s=0;s<n;s++)i[s]*=1e3,o[s]*=1e3,r[s]=i[s]-o[s];e.time_utc=r}this.tz=e}function n(t,e){var i,o,n,s=t.length;if(0===s)return-1;if(isNaN(e))throw Error("Key is NaN");for(i=0,o=s-1,n=r((i+o)/2);;){if(t[n]>e){if((o=n-1)<i)return n}else if(i=n+1,o<i)return n<s-1?n+1:-1;n=r((i+o)/2)}}var r,s,a,l,c,h,u=i(806).tzData;o.prototype.offset_utc=function(t){
return o._offset(this.tz.time_utc,this.tz.offset,t)},o.prototype.offset_loc=function(t){return o._offset(this.tz.time,this.tz.offset,t)},o.prototype.is_valid=function(){return!this._invalid},o._offset=function(t,e,i){var o=n(t,i);return-1===o?0:e[o]},r=function(t){return 0|t},s=function(t){return 60*t*1e3},a=function(t){return 1e3*t},l=function(t,e){return r((r(t/1e3)-r(e/1e3))/60)},c=function(t,e){return r(r(t/1e3)-r(e/1e3))},h={SUNDAY:1,MONDAY:2,TUESDAY:3,WEDNESDAY:4,THURSDAY:5,FRIDAY:6,SATURDAY:7,JANUARY:0,DECEMBER:11,YEAR:1,MONTH:2,WEEK_OF_YEAR:3,DAY_OF_MONTH:5,DAY_OF_YEAR:6,DAY_OF_WEEK:7,HOUR_OF_DAY:11,MINUTE:12,SECOND:13,minutesPerDay:1440,secondsPerDay:s(1440),get_minutes_from_hhmm:function(t){return-1!==t.indexOf(":")&&(t=t.split(":").join("")),t%100+60*r(t/100)},get_year:function(t){return t.getUTCFullYear()},get_month:function(t){return t.getUTCMonth()},get_hours:function(t){return t.getUTCHours()},get_minutes:function(t){return t.getUTCMinutes()},get_seconds:function(t){return t.getUTCSeconds()},get_day_of_month:function(t){return t.getUTCDate()},get_day_of_week:function(t){return t.getUTCDay()+1},get_day_of_year:function(t){var e=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0);return r((t.getTime()-e)/h.secondsPerDay)+1},get_week_of_year:function(t){var e=Date.UTC(t.getUTCFullYear(),0,1,0,0,0,0),i=h.clone(t);return h.set_hms(i,0,0,0,0),i.setUTCDate(i.getUTCDate()+4-(i.getUTCDay()||7)),r(((i.getTime()-e)/h.secondsPerDay+1)/7)},get_minutes_from_midnight:function(t){return 60*h.get_hours(t)+h.get_minutes(t)},set_hms:function(t,e,i,o,n){t.setUTCHours(e),t.setUTCMinutes(i),t.setUTCSeconds(o),t.setUTCMilliseconds(n)},add_days_considering_dst:function(t,e,i){var o,n=t.offset_utc(e),r=this.clone(e);return this.add_date(r,i),o=t.offset_utc(r),r.setTime(r.getTime()+n-o),r},add_date:function(t,e){t.setTime(t.getTime()+e*h.secondsPerDay)},clone:function(t){return new Date(t.getTime())},get_days_per_year:function(t){var e=t.getUTCFullYear();return this.days_per_year(e)},days_per_year:function(t){return t%4!=0||t%100==0&&t%400!=0?365:366},get_part:function(t,e){switch(e){case h.YEAR:return h.get_year(t);case h.MONTH:return h.get_month(t);case h.DAY_OF_MONTH:return h.get_day_of_month(t);case h.WEEK_OF_YEAR:return h.get_week_of_year(t);case h.DAY_OF_WEEK:return h.get_day_of_week(t);case h.HOUR_OF_DAY:return h.get_hours(t);case h.MINUTE:return h.get_minutes(t);case h.DAY_OF_YEAR:return h.get_day_of_year(t);case h.SECOND:return h.get_seconds(t);default:return t.getTime()}},time_minutes:s,time_seconds:a,time_minutes_diff:l,time_seconds_diff:c,utc_to_cal:function(t,e){var i=t.offset_utc(e);return new Date(e+i)},get_cal:function(t,e,i,o){var n=new Date(Date.UTC(e,i,o)),r=t.offset_utc(+n);return new Date(n.valueOf()-r)},get_cal_utc:function(t,e,i){return new Date(Date.UTC(t,e,i))},cal_to_utc:function(t,e){var i=e.getTime();return i-t.offset_loc(i)},get_timezone:function(t){return new o(t)},shift_day:function(t,e){var i=t-1;return i+=e,i>6?i%=7:i<0&&(i=(7+i%7)%7),i+1}},t.exports=h},,function(t,e,i){"use strict";(function(t){
function o(e){e||(e={}),this.checkable=e.checkable||!1,this.checked=e.checked||null,this.enabled=void 0===e.enabled||e.enabled,this.visible=e.visible||!0,this.active=!0,this.font=e.font||"Arial",this.icon=e.icon||null,this.iconText=e.iconText||null,this.iconVisibleInMenu=e.iconVisibleMenu||!0,this.deleteButton=e.deleteButton||null,this.shortcut=null,this.setShortCut(e.shortcut,e.doNotBindShortcut),this.statusTip=e.statusTip||null,this.text=e.text||null,this.toolTip=e.toolTip||null,this.htmlclass=e.htmlclass||null,this.statName=e.statName||null,this._callbackContext=e.callbackContext||this,this._callbacks=new t,this.subActions=e.subActions||[]}function n(){o.call(this),this.font=null,this.subActions=null,this.htmlclass="action-separator"}function r(t){o.call(this),this.deferred=t}var s=i(147);o.prototype.callbacks=function(){return this._callbacks},o.prototype.callbackContext=function(){return this._callbackContext},o.prototype.setCallbackContext=function(t){this._callbackContext=t},o.prototype.hasSubActions=function(){return this.subActions&&this.subActions.length},o.prototype.setChecked=function(t){this.checked=t},o.prototype._toggleChecked=function(){this.checked=!this.checked},o.prototype.setVisible=function(t){this.visible=t},o.prototype.setEnabled=function(t){this.enabled=t},o.prototype.disable=function(){this.setEnabled(!1)},o.prototype.enable=function(){this.setEnabled(!0)},o.prototype.setActive=function(t){this.active!==t&&(this.active=t,this.shortcut&&!this.doNotBindShortcut&&(t?this._bindShortCut():this._unbindShortCut()))},o.prototype.setShortCut=function(t,e){t&&(this.shortcut=t,!0!==e&&this._bindShortCut())},o.prototype._bindShortCut=function(){s.bind(this.shortcut,function(t){if(t.preventDefault(),this.enabled)return this.executeCallback(),!1}.bind(this))},o.prototype._unbindShortCut=function(){s.unbind(this.shortcut)},o.prototype.setIconVisible=function(t){this.iconVisibleInMenu=t},o.prototype.executeCallback=function(t){this._lastEvent=t,this._toggleChecked(),this._callbacks.fire(this)},inherit(n,o),inherit(r,o),e.Action=o,e.ActionSeparator=n,e.ActionPlaceholder=r}).call(e,i(10))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(){this._renderers=[],this._globalAlpha=1}return t.prototype.setGlobalAlpha=function(t){this._globalAlpha=t},t.prototype.append=function(t){this._renderers.push(t)},t.prototype.insert=function(t,e){this._renderers.splice(e,0,t)},t.prototype.draw=function(t){for(var e=0;e<this._renderers.length;e++)t.save(),t.globalAlpha=this._globalAlpha,this._renderers[e].draw(t),t.restore()},t.prototype.drawBackground=function(t){var e,i;for(t.save(),t.globalAlpha=this._globalAlpha,e=0;e<this._renderers.length;e++)i=this._renderers[e],i.drawBackground&&i.drawBackground(t);t.restore()},t.prototype.hitTest=function(t){var e,i,o=null;for(e=this._renderers.length-1;e>=0;e--)null!==(i=this._renderers[e].hitTest(t))&&(null===o||i.result()>o.result())&&(o=i);return o},t}();e.CompositeRenderer=o},function(t,e,i){"use strict";function o(t,e){
return t<=e}function n(t,e){return t>=e}function r(t,e,i){return Math.min(Math.max(t,e),i)}function s(t){return t<0?-1:t>0?1:0}function a(t){if(t<0)return f.logDebug("MathEx.isBaseDecimal: argument less zero"),!1;for(var e=t;e>1;e/=10)if(e%10!=0)return!1;return!0}function l(t,e,i){return e-t<=i}function c(t,e,i){return Math.abs(t-e)<i}function h(t){return t<=0?(f.logDebug("MathEx.log10: argument less or equal zero"),NaN):Math.log(t)/Math.log(10)}function u(t,e){return t<e?-1:t>e?1:0}function d(t,e){var i,o;if(void 0===e&&(e=u),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)<0&&(i=t[o]);return i}function p(t,e){var i,o;if(void 0===e&&(e=u),t.length<1)throw Error("array is empty");for(i=t[0],o=0;o<t.length;++o)e(t[o],i)>0&&(i=t[o]);return i}var _,f;Object.defineProperty(e,"__esModule",{value:!0}),_=i(7),f=_.getLogger("Common.MathEx"),e.lessThan=o,e.greaterThan=n,e.clamp=r,e.sign=s,e.isBaseDecimal=a,e.greaterOrEqual=l,e.equal=c,e.log10=h,e.defComparator=u,e.min=d,e.max=p},,function(t,e,i){"use strict";function o(t){this.items=t.items,this.height=t.height||t.width,this.width=t.width||t.height,this._color=t.color,this._borderColor=t.borderColor,this._vertOffset=t.vertOffset||0,t.textCache&&(this._textCache=t.textCache,this._textColor=t.textColor,this._textVertOffset=this._vertOffset>0?this.height:-this.height,this._textImageWidth=this._textCache.textImageWidth,this._textImageHeight=this._textCache.textImageHeight)}var n=i(8).Point,r=i(11);o.prototype.draw=function(t){this.drawShape(t),this.drawText(t)},o.prototype.drawShape=function(t){throw Error("Not implemented")},o.prototype.drawText=function(t){var e,i,o,n,r,s;if(this._textCache)for(e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.x,r=o.y+this._vertOffset+this._textVertOffset,s=o.style&&null!=o.style.textColor?o.style.textColor:this._textColor,this._textCache.paintTo(t,s,n,r,"center",this._vertOffset>0?"top":"bottom")},o.prototype.hitTest=function(t,e){var i,o,s,a,l,c,h,u,d,p,_,f,m,g=Math.max(this.height,this.width),v=this._vertOffset,y=this._textVertOffset;for(e=e||r.REGULAR,o=0;o<this.items.length;++o)if(s=this.items[o]){if(i=new n(s.x,s.y+v),i.subtract(t).length()<=g)return new r(e,{});if(this._textCache&&(a=this._textImageWidth/2,l=s.y+v+y,c=v>0?0:-this._textImageHeight,h=v>0?this._textImageHeight:0,u=t.x,d=t.y,p=s.x-a,_=l+c,f=s.x+a,m=l+h,u>p&&u<f&&d>_&&d<m))return new r(e,{})}return null},e.PaneRendererAbstractShape=TradingView.PaneRendererAbstractShape=o},function(t,e,i){"use strict";for(var o={LineToolFibRetracement:i(808).LineToolFibRetracement,LineToolFibChannel:i(811).LineToolFibChannel,LineToolFibSpeedResistanceArcs:i(812).LineToolFibSpeedResistanceArcs,LineToolProjection:i(813).LineToolProjection,LineToolTrendBasedFibExtension:i(814).LineToolTrendBasedFibExtension,LineToolElliott:i(104).LineToolElliott,LineToolFibCircles:i(815).LineToolFibCircles,LineToolTrading:i(224),LineStudyMtp:i(105).LineStudyMtp,LineToolVertLine:i(816).LineToolVertLine,LineToolBarsPattern:i(818).LineToolBarsPattern,
LineToolTrendBasedFibTime:i(819).LineToolTrendBasedFibTime,LineToolFibTimeZone:i(820).LineToolFibTimeZone,LineToolCircleLines:i(821).LineToolCircleLines,LineToolDateRange:i(822).LineToolDateRange,LineToolPriceRange:i(823).LineToolPriceRange,LineToolDateAndPriceRange:i(824).LineToolDateAndPriceRange,LineToolParallelChannel:i(825).LineToolParallelChannel,LineToolTrendAngle:i(826).LineToolTrendAngle,LineToolTrendLine:i(159).LineToolTrendLine,LineToolArrowMark:i(129).LineToolArrowMark,LineToolExecution:i(334).LineToolExecution,LineToolPitchfan:i(827).LineToolPitchfan,LineToolGannSquare:i(828).LineToolGannSquare,LineToolFibSpeedResistanceFan:i(829).LineToolFibSpeedResistanceFan,LineToolGannComplex:i(830).LineToolGannComplex,LineToolGannFixed:i(831).LineToolGannFixed,LineToolGannFan:i(832).LineToolGannFan,LineToolFibWedge:i(333).LineToolFibWedge,LineToolPitchfork:i(161).LineToolPitchfork,LineToolDisjointAngle:i(833).LineToolDisjointAngle,LineToolFlatBottom:i(834).LineToolFlatBottom,LineToolIcon:i(835).LineToolIcon,LineToolRotatedRectangle:i(836).LineToolRotatedRectangle,LineToolFibSpiral:i(837).LineToolFibSpiral,LineToolHeadAndShoulders:i(838).LineToolHeadAndShoulders,LineToolTriangle:i(839).LineToolTriangle,LineToolTrianglePattern:i(840).LineToolTrianglePattern,LineTool5PointsPattern:i(336).LineTool5PointsPattern,LineToolThreeDrivers:i(841).LineToolThreeDrivers,LineToolABCD:i(842).LineToolABCD,LineToolRiskReward:i(225).LineToolRiskReward,LineToolPolyline:i(844).LineToolPolyline,LineToolPrediction:i(845).LineToolPrediction,LineToolPriceLabel:i(846).LineToolPriceLabel,LineToolNote:i(337).LineToolNote,LineToolNoteAbsolute:i(337).LineToolNoteAbsolute,LineToolBrush:i(847).LineToolBrush,LineToolArc:i(848).LineToolArc,LineToolCallout:i(849).LineToolCallout,LineToolBalloon:i(850).LineToolBalloon,LineToolText:i(338).LineToolText,LineToolHorzLine:i(851).LineToolHorzLine,LineToolHorzRay:i(852).LineToolHorzRay,LineToolRectangle:i(853).LineToolRectangle,LineToolEllipse:i(854).LineToolEllipse,LineToolTimeCycles:i(855).LineToolTimeCycles,LineToolSineLine:i(856).LineToolSineLine,LineToolGhostFeed:i(857).LineToolGhostFeed,LineToolBezierQuadro:i(858).LineToolBezierQuadro,LineToolBezierCubic:i(859).LineToolBezierCubic,LineToolArrow:i(860).LineToolArrow,LineToolRay:i(861).LineToolRay,LineToolExtended:i(862).LineToolExtended,LineToolSchiffPitchfork:i(863).LineToolSchiffPitchfork,LineToolSchiffPitchfork2:i(864).LineToolSchiffPitchfork2,LineToolInsidePitchfork:i(865).LineToolInsidePitchfork,LineToolTextAbsolute:i(338).LineToolTextAbsolute,LineToolArrowMarkLeft:i(129).LineToolArrowMarkLeft,LineToolArrowMarkRight:i(129).LineToolArrowMarkRight,LineToolArrowMarkUp:i(129).LineToolArrowMarkUp,LineToolArrowMarkDown:i(129).LineToolArrowMarkDown,LineToolFlagMark:i(866).LineToolFlagMark,LineToolCypherPattern:i(867).LineToolCypherPattern,LineToolElliottImpulse:i(104).LineToolElliottImpulse,LineToolElliottTriangle:i(104).LineToolElliottTriangle,LineToolElliottTripleCombo:i(104).LineToolElliottTripleCombo,
LineToolElliottCorrection:i(104).LineToolElliottCorrection,LineToolElliottDoubleCombo:i(104).LineToolElliottDoubleCombo,LineToolRiskRewardLong:i(225).LineToolRiskRewardLong,LineToolRiskRewardShort:i(225).LineToolRiskRewardShort,LineToolPosition:i(868).LineToolPosition,LineToolOrder:i(869).LineToolOrder},n=Object.keys(o),r=n.length;r--;)TradingView[n[r]]=o[n[r]];t.exports=o},function(t,e,i){"use strict";(function(e){var o=i(411).ExchangeSession,n=function(){function t(t,e,i,o){return""===t?new h(60*e,i):"S"===t?new h(e,i):new u(i,o,e,n(t,i))}function n(t,e){switch(t){case"D":return new S(e);case"W":return new w(e);case"M":return new T(e)}return console.error("unknown dwm resolution: "+t),null}function r(t,e,i,o,n){var r,s,a,l,c,h,u,d=(new x).init("Etc/UTC",t),p=""!==e;return p?(s=i*E[e],r=E.D):(s=60*i*1e3,r=60*d.spec.findSessionEntry(0,0).length()*1e3),a=r/s,l=p?7:7-d.spec.weekEndsCount(),c=l*a,o<c?(h=o/a,n-h*E.D):(u=o/c,n-u*E.W)}function s(t,e,i,o){if("number"!=typeof i||"number"!=typeof e||isNaN(i)||isNaN(e))throw Error("Cannot extrapolate from "+e+" to "+i);return l(t,e,function(t,e){return e>i||o&&t.length>o})}function a(t,e,i){return l(t,e,function(t,e){return t.length>=i})}function l(t,e,i){var o,n,r,s,a,l=e;for(t.moveTo(l),o=[],n=0,r=0;!i(o,l);){if(n>5)throw console.trace(["0x10",new Date(e),"->",new Date(l)]),Error("Internal error 0x10 while extrapolating.");if((s=t.indexOfBar(l))===I)l=t.startOfBar(0);else if(s===k)l=t.startOfBar(k);else{if((a=t.startOfBar(s))!==e){if(r&&r===a)throw console.trace(["0x11",new Date(e),"->",new Date(a)]),Error("Internal error 0x11 while extrapolating.");r=a,n=0,o.push(a)}l=t.startOfBar(s+1)}t.moveTo(l),n++}return o}function c(t){if(isNaN(t))return NaN;var e=this.indexOfBar(t);return e===k&&(this.moveTo(t),e=this.indexOfBar(t)),e<0?NaN:this.startOfBar(e)}function h(t,e){this.period=t,this.session=e,this.sessionStart=Number.MIN_VALUE,this.sessionEnd=Number.MIN_VALUE}function u(t,e,i,o){this.period=i,this.sessionTgt=t,this.sessionSrc=e||t,this.builder=o,this.periodStart=-Number.MAX_VALUE,this.periodEnd=-Number.MAX_VALUE,this.periodLastBarStart=-Number.MAX_VALUE}function d(t,e,i){var o=M.clone(i);return e.alignToSessionStart(o,t),M.cal_to_utc(t,o)}function p(t,e){var i=M.get_day_of_week(e)-t.firstDayOfWeek();return i<0?i+7:i}function _(t,e){var i=e+t.firstDayOfWeek();return i>M.SATURDAY?i-M.SATURDAY:i}function f(t,e){var i=M.get_day_of_year(e)-1,o=p(t,e)-i%7;return 0===o?C(i/7):(o>=0&&(o-=7),C((o+i)/7))}function m(t,e,i){var o,n=0;for(o=e;o<i;++o)n+=t.isWeekEnd(_(t,o))?1:0;return n}function g(t,e){var i=new Date(Date.UTC(e,11,31,23,59)),o=M.days_per_year(e)-v(t,i);return t.isWeekEnd(M.get_day_of_week(i))&&o--,o}function v(t,e){var i,o,n=M.get_day_of_year(e)-1,r=p(t,e),s=r-n%7;return s<0&&(s+=7),i=0,n<7-s?i+=m(t,s,r):(o=0===s?0:m(t,s,7),i+=m(t,0,r)+o),i+f(t,e)*t.weekEndsCount()}function y(){}function b(t){this.sessionsSpec=t}function S(t){this.session=t}function w(t){this.session=t}function T(t){this.session=t}function C(t){return 0|t}function x(){}function P(t,e,i){
var o,n,r,s,a=t.length;if(0===a)return-1;for(o=0,n=a-1,r=C((o+n)/2);;){if(0===(s=i(t[r],e))||s>0){if((n=r-1)<o)return r}else if(o=r+1,n<o)return r<a-1?r+1:-1;r=C((o+n)/2)}}function L(t,e){var i=M.utc_to_cal(e.timezone,+t),o=M.get_day_of_week(i),n=M.get_minutes_from_midnight(i),r=e.spec.findSessionEntry(o,n);return r.isOvernight()&&n>r.start()+r.length()&&o===r.dayOfWeek()-1&&(o++,n-=1440),o===r.dayOfWeek()&&n>=r.start()&&n<r.start()+r.length()}var I=-1,k=-2,A="undefined"!=typeof window?window:e,M=A.PineJsCalendar?A.PineJsCalendar:i(50),E={S:1e3,D:864e5,W:6048e5,M:2592e6};return h.prototype.alignTime=c,h.prototype.alignTimeIfPossible=function(t){var e=this.alignTime(t);return isNaN(e)?t:e},h.prototype.indexOfBar=function(t){return t<this.sessionStart?I:t>=this.sessionEnd?k:C(M.time_seconds_diff(t,this.sessionStart)/this.period)},h.prototype.startOfBar=function(t){if(t===k)return this.sessionEnd;if(t<0)throw Error("Negative offset is not supported");return this.sessionStart+M.time_seconds(this.period*t)},h.prototype.isLastBar=function(t,e){return e>=this.sessionStart+M.time_seconds(this.period*(t+1)-1)},h.prototype.moveTo=function(t){var e=this.session.timezone,i=M.utc_to_cal(e,t),o=this.session.spec,n=o.alignToSessionStart(i,this.session.timezone);this.sessionStart=M.cal_to_utc(e,i),this.sessionEnd=this.sessionStart+M.time_minutes(n)},u.prototype.alignTime=c,u.prototype.alignTimeIfPossible=function(t){return this.tradingDayToSessionStart(t)},u.prototype.tradingDayToSessionStart=function(t){return this.moveTo(t),this.startOfBar(0)},u.prototype.indexOfBar=function(t){return t<this.periodStart?I:t>=this.periodEnd?k:0},u.prototype.startOfBar=function(t){if(t===k||t>0)return this.periodEnd;if(t===I)throw Error("PRE_SESSION is not supported");return this.periodStart},u.prototype.isLastBar=function(t,e){return e>=this.periodLastBarStart},u.prototype.moveTo=function(t){var e,i,o,n,r,s,a,l,c=M.utc_to_cal(this.sessionSrc.timezone,t);c=this.sessionSrc.spec.correctTradingDay(c,this.sessionSrc.timezone),e=this.sessionTgt.timezone,i=this.builder.indexOfPeriod(c,e),o=C(i/this.period)*this.period,n=M.get_year(c),r=this.sessionTgt.spec,s=this.builder.startOfPeriod(e,o,n),this.periodStart=d(e,r,s),a=o+this.period,l=this.builder.startOfPeriod(e,a,n),this.periodEnd=d(e,r,l),M.add_date(l,-1),this.moveToPrevWorkDay(r,l),this.periodLastBarStart=d(e,r,l),(this.periodLastBarStart<this.periodStart||this.periodLastBarStart===this.periodEnd)&&(this.periodLastBarStart=this.periodStart)},u.prototype.moveToPrevWorkDay=function(t,e){for(;t.isWeekEnd(M.get_day_of_week(e));)M.add_date(e,-1)},y.prototype.indexOfPeriod=function(t){return M.get_day_of_year(t)-1},y.prototype.startOfPeriod=function(t,e,i){var o=M.get_cal(t,i,M.JANUARY,1),n=M.add_days_considering_dst(t,o,e);return M.utc_to_cal(t,+n)},b.prototype.uber=new y,b.prototype.indexOfPeriod=function(t){return this.uber.indexOfPeriod(t)-v(this.sessionsSpec,t)},b.prototype.startOfPeriod=function(t,e,i){function o(t,e){this.weekEnds=m(t,e,7),this.calendarDays=7-e,
this.businessDays=this.calendarDays-this.weekEnds}function n(t,e){var i,o=0;for(i=t;i<7&&(s.sessionsSpec.isWeekEnd(_(s.sessionsSpec,i))||!(--e<0));++i)o++;return o}function r(t,e,i){var o,n,r,a,l,c,h=0,u=i%(7-s.sessionsSpec.weekEndsCount());for(o=0,n=u-(0===t?0:e.businessDays);o<7&&n>0;++o)r=s.sessionsSpec.isWeekEnd(_(s.sessionsSpec,o)),h+=r?1:0,n-=r?0:1;return a=e.weekEnds+h,l=C((i-e.businessDays)/(7-s.sessionsSpec.weekEndsCount())),c=a+s.sessionsSpec.weekEndsCount()*l,i+c}var s,a,l,c,h;return e>=g(this.sessionsSpec,i)&&(i++,e=0),s=this,a=new Date(Date.UTC(i,M.JANUARY,1)),l=p(this.sessionsSpec,a),c=new o(this.sessionsSpec,l),h=e<c.businessDays?n(l,e):r(l,c,e),this.uber.startOfPeriod(t,h,i)},S.prototype.indexOfPeriod=function(t){return this.builder().indexOfPeriod(t)},S.prototype.startOfPeriod=function(t,e,i){return this.builder().startOfPeriod(t,e,i)},S.prototype.builder=function(){return this._builder||(this._builder=this.session.spec.hasWeekEnds()?new b(this.session.spec):new y),this._builder},w.prototype.indexOfPeriod=function(t,e){var i=f(this.session.spec,t);return 0===i&&t<this.startOfPeriod(e,0,M.get_year(t))&&(i=-1),i},w.prototype.startOfPeriod=function(t,e,i){var o,n,r=new Date(Date.UTC(i,M.JANUARY,1)),s=p(this.session.spec,r),a=0===s?7*e:7*(e+1)-s,l=M.get_days_per_year(r);return a>l?this.startOfPeriod(t,0,i+C(a/l)):(o=M.get_cal(t,i,M.JANUARY,1),n=M.add_days_considering_dst(t,o,a),M.utc_to_cal(t,+n))},T.prototype.indexOfPeriod=function(t){return M.get_month(t)},T.prototype.startOfPeriod=function(t,e,i){var o,n,r,s;return e<0?(o=C((11-e)/12),i-=o,e+=12*o):e>M.DECEMBER&&(i++,e=M.JANUARY),n=M.get_cal_utc(i,e,1),r=p(this.session.spec,n),r>4&&(s=7-r,M.add_date(n,s)),n},x.prototype.init=function(t,e){return this.timezone="string"==typeof t?M.get_timezone(t):t,this.spec=new o(e),this},{PRE_SESSION:I,POST_SESSION:k,LASTBAR_SESSION:-3,newBarBuilder:t,Session:x,alignPeriodsBack:r,extrapolateBarsFrontByCount:a,extrapolateBarsFrontToTime:s,lower_bound:P,isTradingNow:L,numberOfFullWeeks:f,numberOfWeekEndsSinceYearStart:v,BusinessDaysBuilder:b,alignExchangeTimeToSessionStartAndReturnUTC:d}}();t.exports=n}).call(e,i(78))},function(t,e,i){"use strict";function o(t){var e=t.className,i=t.icon,o=void 0===i?"":i,r=t.onClick,s=t.title;return n.createElement("span",{title:s,className:e,dangerouslySetInnerHTML:{__html:o},onClick:r})}Object.defineProperty(e,"__esModule",{value:!0});var n=i(2);e.Icon=o},function(t,e,i){"use strict";function o(t,e){var i=e.edge;return i.A*t.x+i.B*t.y+i.C>0===e.isPositive}function n(t,e,i,o){var n=e.add(i).scaled(.5),r=n.add(o).scaled(.5),s=l.intersectLineSegments(e,i,r,t);return null===s&&(null===(s=l.intersectLineSegments(i,o,r,t))&&null===(s=l.intersectLineSegments(o,e,r,t)))}function r(t,e,i){return t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y}function s(t,e){var i,o,n,r=e.length-1,s=!1,a=t.x,l=t.y;for(i=0;i<e.length;i++)o=e[i],n=e[r],(o.y<l&&n.y>=l||n.y<l&&o.y>=l)&&o.x+(l-o.y)/(n.y-o.y)*(n.x-o.x)<a&&(s=!s),r=i;return s}function a(t,e,i){return(t.x-e.x)*(t.x-e.x)+(t.y-e.y)*(t.y-e.y)<=i*i}
Object.defineProperty(e,"__esModule",{value:!0});var l=i(132);e.pointInHalfplane=o,e.pointInTriangle=n,e.pointInRectangle=r,e.pointInPolygon=s,e.pointInCircle=a},function(t,e,i){"use strict";function o(){return s.replace(/[xy]/g,function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}function n(){return r(12)}function r(t){var e,i,o="";for(e=0;e<t;++e)i=Math.round(Math.random()*(a.length-1)),o+=a[i];return o}var s,a;Object.defineProperty(e,"__esModule",{value:!0}),s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx",a="0123456789abcdefghijklmopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",e.guid=o,e.randomHash=n,e.randomHashN=r},,,function(t,e,i){"use strict";(function(e){function i(){return/on-features-page=1/i.test(window.location.search)}var o=window.TradingView=window.TradingView||{};o.className=function(t){for(var e in this)if(o[e]===t)return e;return null},o.isOnFeaturePage=i(),o.wrapUrl=function(t){return e.enabled("charting_library_base")&&(t=t.replace("/static/","")),t},o.isMobile=function(){var t=/Android/i.test(navigator.userAgent),e=/BlackBerry/i.test(navigator.userAgent),i=/iPhone|iPad|iPod/i.test(navigator.userAgent),o=/Opera Mini/i.test(navigator.userAgent),n=t||e||i||o;return{Android:function(){return t},BlackBerry:function(){return e},iOS:function(){return i},Opera:function(){return o},any:function(){return n}}}(),o.supportTouch=function(){return Modernizr.touch||o.isMobile.any()},o.onWidget=function(){var t,e,i=["^widgetembed/?$","^cmewidgetembed/?$","^([0-9a-zA-Z-]+)/widgetembed/?$","^([0-9a-zA-Z-]+)/widgetstatic/?$","^([0-9a-zA-Z-]+)?/?miniwidgetembed/?$","^([0-9a-zA-Z-]+)?/?mediumwidgetembed/?$","^embed(-static)?/([0-9a-zA-Z]{8})/?$","^widgetpopup/?$","^extension/?$","^chatwidgetembed/?$","^ideaswidgetembed/?$","^ideas-widget/?$","^view-idea-widget/([0-9a-zA-Z]{8})/?$","^user-info-widget/?$","^user-info-widget-get/(.+?)?/?$","^embed-quotes-provider/?$","^idea-popup/?$","^hotlistswidgetembed/?$","^marketoverviewwidgetembed/?$","^([0-9a-zA-Z-]+)/marketoverviewwidgetembed/?$","^eventswidgetembed/?$","^tickerswidgetembed/?$","^forexcrossrateswidgetembed/?$","^forexheatmapwidgetembed/?$","^marketquoteswidgetembed/?$","^screenerwidget/?$","^cryptomktscreenerwidget/?$","^([0-9a-zA-Z-]+)/cryptomktscreenerwidget/?$","^([0-9a-zA-Z-]+)/marketquoteswidgetembed/?$"],o=window.location.pathname.replace(/^\//,"");for(e=i.length-1;e>=0;e--)if(t=RegExp(i[e]),t.test(o))return!0;return!1},o.onOrder=function(){return"/order/"===window.location.pathname},t.exports.CheckMobile=o.isMobile,t.exports.isOnFeaturePage=i,t.exports.onWidget=o.onWidget,t.exports.supportTouch=o.supportTouch}).call(e,i(5))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(584);e.createDialog=o.createDialog},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(13),i(12),e.lineToolsInfo={LineTool5PointsPattern:{icon:i(622),localizedName:$.t("XABCD Pattern")},LineToolABCD:{icon:i(623),localizedName:$.t("ABCD Pattern")},LineToolArc:{icon:i(624),localizedName:$.t("Arc")},LineToolArrow:{
icon:i(625),localizedName:$.t("Arrow")},LineToolArrowMarkDown:{icon:i(626),localizedName:$.t("Arrow Mark Down")},LineToolArrowMarkLeft:{icon:i(627),localizedName:$.t("Arrow Mark Left")},LineToolArrowMarkRight:{icon:i(628),localizedName:$.t("Arrow Mark Right")},LineToolArrowMarkUp:{icon:i(629),localizedName:$.t("Arrow Mark Up")},LineToolBalloon:{icon:i(630),localizedName:$.t("Balloon")},LineToolBarsPattern:{icon:i(631),localizedName:$.t("Bars Pattern")},LineToolBezierCubic:{icon:i(632),localizedName:$.t("Double Curve")},LineToolBezierQuadro:{icon:i(633),localizedName:$.t("Curve")},LineToolBrush:{icon:i(634),localizedName:$.t("Brush")},LineToolCallout:{icon:i(635),localizedName:$.t("Callout")},LineToolCircleLines:{icon:i(636),localizedName:$.t("Cyclic Lines")},LineToolCypherPattern:{icon:i(637),localizedName:$.t("Cypher Pattern")},LineToolDateAndPriceRange:{icon:i(638),localizedName:$.t("Date and Price Range")},LineToolDateRange:{icon:i(639),localizedName:$.t("Date Range")},LineToolDisjointAngle:{icon:i(640),localizedName:$.t("Disjoint Angle")},LineToolElliottCorrection:{icon:i(641),localizedName:$.t("Elliott Correction Wave (ABC)")},LineToolElliottDoubleCombo:{icon:i(642),localizedName:$.t("Elliott Double Combo Wave (WXY)")},LineToolElliottImpulse:{icon:i(643),localizedName:$.t("Elliott Impulse Wave (12345)")},LineToolElliottTriangle:{icon:i(644),localizedName:$.t("Elliott Triangle Wave (ABCDE)")},LineToolElliottTripleCombo:{icon:i(645),localizedName:$.t("Elliott Triple Combo Wave (WXYXZ)")},LineToolEllipse:{icon:i(646),localizedName:$.t("Ellipse")},LineToolExtended:{icon:i(647),localizedName:$.t("Extended")},LineToolFibChannel:{icon:i(648),localizedName:$.t("Fib Channel")},LineToolFibCircles:{icon:i(649),localizedName:$.t("Fib Circles")},LineToolFibRetracement:{icon:i(650),localizedName:$.t("Fib Retracement")},LineToolFibSpeedResistanceArcs:{icon:i(651),localizedName:$.t("Fib Speed Resistance Arcs")},LineToolFibSpeedResistanceFan:{icon:i(652),localizedName:$.t("Fib Speed Resistance Fan")},LineToolFibSpiral:{icon:i(653),localizedName:$.t("Fib Spiral")},LineToolFibTimeZone:{icon:i(654),localizedName:$.t("Fib Time Zone")},LineToolFibWedge:{icon:i(655),localizedName:$.t("Fib Wedge")},LineToolFlagMark:{icon:i(656),localizedName:$.t("Flag Mark")},LineToolFlatBottom:{icon:i(657),localizedName:$.t("Flat Top/Bottom")},LineToolGannComplex:{icon:i(305),localizedName:$.t("Gann Square")},LineToolGannFixed:{icon:i(305),localizedName:$.t("Gann Square Fixed")},LineToolGannFan:{icon:i(658),localizedName:$.t("Gann Fan")},LineToolGannSquare:{icon:i(659),localizedName:$.t("Gann Box")},LineToolGhostFeed:{icon:i(660),localizedName:$.t("Ghost Feed")},LineToolHeadAndShoulders:{icon:i(661),localizedName:$.t("Head and Shoulders")},LineToolHorzLine:{icon:i(662),localizedName:$.t("Horizontal Line")},LineToolHorzRay:{icon:i(663),localizedName:$.t("Horizontal Ray")},LineToolIcon:{icon:"icon",localizedName:$.t("Font Icons")},LineToolInsidePitchfork:{icon:i(664),localizedName:$.t("Inside Pitchfork")},LineToolNote:{icon:i(665),
localizedName:$.t("Note")},LineToolNoteAbsolute:{icon:i(666),localizedName:$.t("Anchored Note")},LineToolParallelChannel:{icon:i(667),localizedName:$.t("Parallel Channel")},LineToolPitchfan:{icon:i(668),localizedName:$.t("Pitchfan")},LineToolPitchfork:{icon:i(669),localizedName:$.t("Pitchfork")},LineToolPolyline:{icon:i(670),localizedName:$.t("Polyline")},LineToolPrediction:{icon:i(671),localizedName:$.t("Forecast")},LineToolPriceLabel:{icon:i(672),localizedName:$.t("Price Label")},LineToolPriceRange:{icon:i(673),localizedName:$.t("Price Range")},LineToolProjection:{icon:i(674),localizedName:$.t("Projection")},LineToolRay:{icon:i(675),localizedName:$.t("Ray")},LineToolRectangle:{icon:i(676),localizedName:$.t("Rectangle")},LineToolRegressionTrend:{icon:i(677),localizedName:$.t("Regression Trend")},LineToolRiskRewardLong:{icon:i(678),localizedName:$.t("Long Position")},LineToolRiskRewardShort:{icon:i(679),localizedName:$.t("Short Position")},LineToolRotatedRectangle:{icon:i(680),localizedName:$.t("Rotated Rectangle")},LineToolSchiffPitchfork:{icon:i(681),localizedName:$.t("Modified Schiff Pitchfork")},LineToolSchiffPitchfork2:{icon:i(682),localizedName:$.t("Schiff Pitchfork")},LineToolSineLine:{icon:i(683),localizedName:$.t("Sine Line")},LineToolText:{icon:i(684),localizedName:$.t("Text")},LineToolTextAbsolute:{icon:i(685),localizedName:$.t("Anchored Text")},LineToolThreeDrivers:{icon:i(686),localizedName:$.t("Three Drives Pattern")},LineToolTimeCycles:{icon:i(687),localizedName:$.t("Time Cycles")},LineToolTrendAngle:{icon:i(688),localizedName:$.t("Trend Angle")},LineToolTrendBasedFibExtension:{icon:i(689),localizedName:$.t("Trend-Based Fib Extension")},LineToolTrendBasedFibTime:{icon:i(690),localizedName:$.t("Trend-Based Fib Time")},LineToolTrendLine:{icon:i(691),localizedName:$.t("Trend Line")},LineToolTriangle:{icon:i(692),localizedName:$.t("Triangle")},LineToolTrianglePattern:{icon:i(693),localizedName:$.t("Triangle Pattern")},LineToolVertLine:{icon:i(694),localizedName:$.t("Vertical Line")},SyncDrawing:{icon:i(695),iconActive:i(696),localizedName:$.t("Sync drawings to all charts")},arrow:{icon:i(697),localizedName:$.t("Arrow")},cursor:{icon:i(698),localizedName:$.t("Cross")},dot:{icon:i(699),localizedName:$.t("Dot")},drawginmode:{icon:i(700),iconActive:i(701),localizedName:$.t("Stay in Drawing Mode")},eraser:{icon:i(702),localizedName:$.t("Eraser")},group:{icon:i(703),localizedName:$.t("Show Hidden Tools")},hideAllDrawings:{icon:i(302),iconActive:i(704),localizedName:$.t("Hide All Drawing Tools")},lockAllDrawings:{icon:i(705),iconActive:i(706),localizedName:$.t("Lock All Drawing Tools")},magnet:{icon:i(707),localizedName:$.t("Magnet Mode pulls the points of drawings to symbol values")},measure:{icon:i(708),localizedName:$.t("Measure (Shift + Click on the chart)")},removeAllDrawingTools:{icon:i(709),localizedName:$.t("Remove All Drawing Tools")},showObjectsTree:{icon:i(710),localizedName:$.t("Show Objects Tree")},zoom:{icon:i(711),localizedName:$.t("Zoom In")},"zoom-out":{icon:i(712),localizedName:$.t("Zoom Out")}}
},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(32),n=i(788),r=function(){function t(){this._rendererData={text:"",coordinate:0,fixedCoordinate:0,color:"#FFF",background:"#000",visible:!1},this._renderer=new n.PriceAxisViewRenderer(this._rendererData),this._invalidated=!0}return t.prototype.text=function(){return this._rendererData.text},t.prototype.background=function(){return this._rendererData.background},t.prototype.color=function(){return this.generateTextColor(this.background())},t.prototype.generateTextColor=function(t){return"black"===o.rgbToBlackWhiteString(o.parseRgb(t),160)?"white":"black"},t.prototype.coordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.coordinate},t.prototype.floatCoordinate=function(){return this._updateRendererDataIfNeeded(),this._rendererData.floatCoordinate||this._rendererData.coordinate},t.prototype.update=function(){this._invalidated=!0},t.prototype.height=function(t,e){return void 0===e&&(e=!1),this._renderer.height(t,e)},t.prototype.getFixedCoordinate=function(){return this._rendererData.fixedCoordinate||0},t.prototype.setFixedCoordinate=function(t){this._rendererData.fixedCoordinate=t},t.prototype.isVisible=function(){return this._rendererData.visible},t.prototype.renderer=function(){return this._updateRendererDataIfNeeded(),this._renderer.setData(this._rendererData),this._renderer},t.prototype._updateRendererDataIfNeeded=function(){this._invalidated&&(this._updateRendererData(this._rendererData),this._invalidated=!1)},t}(),e.PriceAxisView=r},,,function(t,e,i){"use strict";function o(t){return s.createElement(t.href?"a":"div",t)}function n(t){t.stopPropagation()}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=i(0),s=i(2),a=i(14),l=i(85),c=i(731),h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){var i=e.props,o=i.dontClosePopup,n=i.isDisabled,r=i.onClick,s=i.onClickArg;n||(r&&r(s,t),o||l.globalClosePopupMenu())},e}return r.__extends(e,t),e.prototype.render=function(){var t,e,i=this.props,r=i.className,l=i.forceShowHint,h=i.hint,u=i.icon,d=i.isActive,p=i.isDisabled,_=i.isHovered,f=i.appearAsDisabled,m=i.label,g=i.link,v=i.showToolboxOnHover,y=i.target,b=i.toolbox,S=i.theme,w=void 0===S?c:S;return s.createElement(o,{className:a(r,w.item,u&&w.withIcon,(t={},t[w.isActive]=d,t[w.isDisabled]=p||f,t[w.hovered]=_,t)),href:g,target:y,onClick:this._handleClick},void 0!==u&&s.createElement("div",{className:w.icon,dangerouslySetInnerHTML:{__html:u}}),s.createElement("div",{className:w.labelRow},s.createElement("div",{className:w.label},m)),(void 0!==h||l)&&s.createElement("div",{className:w.hint},h),void 0!==b&&s.createElement("div",{onClick:n,className:a(w.toolbox,(e={},e[w.showOnHover]=v,e))},b))},e}(s.PureComponent),e.PopupMenuItem=h},function(t,e,i){"use strict";(function(e){function o(){if("undefined"==typeof tradingService)return null;var t=tradingService();return t&&t.connectStatus()===CONNECTSTATUSES.CONNECTED?t.activeBroker():null}
function n(){var t=o();if(t&&t.metainfo().configFlags.supportSymbolSearch)return t.metainfo().symbolSearchId||t.metainfo().id.toLowerCase()}var r=i(122).isIntervalAvailable,s=i(76),a=i(764),l=i(121),c=i(172).unifiedSpinner,h=i(144),u=i(200).regExpEscape,d=i(765),p=i(148).isFeatureEnabled,_=i(123),f=function(){function t(i){var o,n,r,s;if(!(this instanceof t))throw new TypeError("SymbolSearch is a constructor");if(i=i||{},o=!i.dontUseInputParser&&e.enabled("symbol_search_parser_mixin")&&t.canShowSpreadActions(),this._inputParserMixin=o?new SymbolSearchInputParserMixin(this):void 0,this._inputElement=$(i.input).get(0),!this._inputElement)throw new TypeError("options.input must be a DOM element, jQuery object or selector");if(this.$list=$(i.list).eq(0),0===this.$list.size()&&delete this.$list,void 0!==i.callback){if("function"!=typeof i.callback)throw new TypeError("options.callback must be function");this._callback=i.callback}if(void 0!==i.onValueChanged){if("function"!=typeof i.onValueChanged)throw new TypeError("options.onValueChanged must be function");this._onValueChanged=i.onValueChanged}if(void 0!==i.onEmptyApply){if("function"!=typeof i.onEmptyApply)throw new TypeError("options.onEmptyApply must be function");this._onEmptyApply=i.onEmptyApply}if(i.ignoreInterval&&(this._ignoreInterval=!0),t.resetStoredInterval(),i.hidePro&&(this._hidePro=!0),i.allowMultipleSymbols&&(this._allowMultipleSymbols=!0),void 0!==i.onParse){if("function"!=typeof i.onParse)throw new TypeError("options.onParse must be function");this._onParse=i.onParse}for(this._state={},this._resolveViaSymbolSearchId=null,this.acceptEmpty=!!i.acceptEmpty,$(this._inputElement).data("symbol-search-instance",this),n=this._boundListener=this._eventListener.bind(this),r=this.boundTimeoutListener=function(t){setTimeout(function(){n(t)},0)},s=0;s<w.length;s++)w[s].immediate?$(this._inputElement).on(w[s].name,n):$(this._inputElement).on(w[s].name,r);this._boundOnKeyDown=this._onKeyDown.bind(this),this._boundOnKeyPress=this._onKeyPress.bind(this),$(this._inputElement).on("keydown",this._boundOnKeyDown).on("keypress",this._boundOnKeyPress),this._eventListener(),i.autoFocus&&t.registerAutoFocus(this)}function o(t,e){var i,o=ChartApiInstance.supportedSymbolsTypes();return n()&&(o=o.filter(function(t){return"quandl"!==t.value&&"economic"!==t.value})),i=TVSettings.getValue("symboledit.filter"),!o.some(function(t){return t.value===i})&&o.length>0&&(i=o[0].value),0!==o.length&&(o.forEach(function(o){var n=o.value,r=$('<a class="type-filter">').attr("href","#"+n).text($.t(o.name));n===i&&r.addClass("active"),r.on("click",function(i){i.preventDefault(),e.find(".type-filter").removeClass("active"),$(this).addClass("active"),t.typeFilter(n),TVSettings.setValue("symboledit.filter",n)}),r.appendTo(e)}),t.typeFilter(i),!0)}function f(t,i){var o,n,r,s=ChartApiInstance.supportedExchangesList();if(s=a.displayedExchangesFilter(s),s=a.sortExchangesListByFlagIfNeeded(s),o=TVSettings.getValue("symboledit.exchangefilter"),
"bovespa"!==TradingView.widgetCustomer)return!s.some(function(t){return t.value===o})&&s.length>0&&(o=s[0].value),0!==s.length&&(n=$('<div id="exchange-filter" class="exchange-filter">').appendTo(i),r=$("<select>").appendTo(n),s.forEach(function(t){var e=t.value,i=t.name||e,n=t.desc||i,s=$("<option>").addClass("filter-item").attr("value",e).text($.t(i)).data("custom-option-text",$.t(n)).appendTo(r);t.value===o&&s.attr("selected",!0)}),r.change(function(){var e=$(this).val()||"";TVSettings.setValue("symboledit.exchangefilter",e),t.setExchangeFilter(e)}),r.selectbox({speed:0,useCustomPrependWithSelector:"after",customPrependSelectorClass:"exchange-with-flag",classHolder:"tv-unstyled-select-container tv-symbol-select",classOptions:e.enabled("symbol_search_three_columns_exchanges")?"sbOptions three-column-filter":"sbOptions"}),t.setExchangeFilter(o),!0)}function m(t){var e=f(t,t.$filterContainer);return t.selectExchangeFilter(),e}function g(t){var e,i,n,r,s,a,l,c,h,u,d=$('<div class="symbol-edit-popup">').appendTo(document.body),p=$('<div class="filter">').appendTo(d);return t.$filterContainer=p,o(t,p),m(t,p),e=$('<div class="table-wrapper">').appendTo(d),i=$(t._inputElement),n=i.offset(),r=0,s=Math.max(0,Math.min(n.left+r,$(window).width()-d.outerWidth())),d.css("left",s+"px"),d.css("top",n.top+i.outerHeight()+1),a=p.outerHeight(),l=$(window).scrollTop(),c=i.height(),h=TradingView.isMobile.any()?parseInt(window.screen.height,10):parseInt($(window).height(),10),u=h-(n.top-l)-c/2,e.css("maxHeight",u-c-a+"px"),{popup:d,listWrapper:e}}function v(t){return!t.ctrlKey&&(!t.metaKey&&(!!t.charCode&&(!(!t.which||t.which<=32)&&(!/^(input|textarea)$/i.test(t.target.tagName)&&!TVDialogs.modalDialog))))}function y(t,e,i){this._container=t,this._tickerRegExp=e,this._translationCache=i,this._roots={},this._itemsByTicker={}}var b,S,w=[{name:"input",immediate:!0},{name:"sync",immediate:!0},{name:"keypress"},{name:"keydown"},{name:"keyup"},{name:"mousedown"},{name:"mouseup"},{name:"cut"},{name:"paste"}],T=p("symbol_search_server_highlight");return T=!1,b=[/^e\-m/i],S=/<\/?[^>]+(>|$)/g,t.registerAutoFocus=function(e){if(e instanceof jQuery&&(e=e.data("symbol-search-instance")),!(e instanceof t))throw new TypeError("arg must be an SymbolSearch instance of jQuery input with bound SymbolSearch object");l.registerListener("symbolEdit",function(t){if(v(t)){t.preventDefault(),this.resetState(),this._skipAutoFocus=!0,this._inputElement.focus();var e=String.fromCharCode(t.charCode);"function"==typeof this._setInputValue?this._setInputValue(e):this._inputElement.value=e,this._eventListener()}}.bind(e))},t.prototype.searchRequestDelay=0,t.setSearchRequestDelay=function(e){t.prototype.searchRequestDelay=e},t.prototype.resetState=function(){this._state={}},t.prototype.typeFilter=function(t){if(!(arguments.length>0))return this._state.typeFilter;t!==this._state.typeFilter&&(null==t?delete this._state.typeFilter:this._state.typeFilter=t+"",delete this._state.keepListFor,this._onSelectionChanged(),this.selectExchangeFilter())},
t.prototype.setExchangeFilter=function(t){t!==this._state.exchangeFilter&&(null==t?delete this._state.exchangeFilter:this._state.exchangeFilter=t+"",delete this._state.keepListFor,this._onSelectionChanged())},t.prototype.setTradableFilter=function(t){t!==this._state.tradableFilter&&(this._state.tradableFilter=t,this._onSelectionChanged())},t.prototype.getExchangeFilter=function(){return this._state.exchangeFilter},t.prototype.destroy=function(){$(this._inputElement).off(),$(this._inputElement).removeData("symbol-search-instance")},t.prototype._moveSelection=function(t,e){var i,o,n,r,s,a,l,c,h;this.$list&&(i=this.$list.find("table.symbol-edit-popup"),o=i.find("tr:not(.hidden)"),n=i.find("tr.symbol-edit-popup-active").removeClass("symbol-edit-popup-active"),r=0!==n.length?o.index(n):-1,s=1===t?n.get(0)===o.get(-1)?0:r+t:Math.max(-1,r+t),r!==s&&(a=o.get(s))&&(l=this._getItemByElement(a),c=y.isRoot(l),c?(h=a.getAttribute("data-root"),a.classList.add("symbol-edit-popup-active"),this._scrollHighlightIntoView(),h?(this._state.highlightedItem=null,this._selectedGroupRoot=h):(this._state.highlightedItem=l,this._replaceCurrentSymbol(e))):(delete this._selectedGroupRoot,this._highlightItem(l,!0,e))))},t.prototype._groupToggleCollapsed=function(t,e){this._groupListHandler&&this._groupListHandler.toggleCollapsed(t,e)},t.prototype._onKeyDown=function(t){t.keyCode!==_.DOWN_ARROW&&t.keyCode!==_.UP_ARROW||(this._moveSelection(t.keyCode===_.DOWN_ARROW?1:-1,!0),t.preventDefault()),!this._selectedGroupRoot||t.keyCode!==_.LEFT_ARROW&&t.keyCode!==_.RIGHT_ARROW||(this._groupToggleCollapsed(this._selectedGroupRoot,t.keyCode===_.LEFT_ARROW),t.preventDefault())},t.prototype._onKeyPress=function(t){if(t.keyCode===_.DOWN_ARROW||t.keyCode===_.UP_ARROW){if(t.charCode)return;if(this._boundOnKeyDown)return $(this._inputElement).off("keydown",this._boundOnKeyDown),delete this._boundOnKeyDown,void t.preventDefault();this._moveSelection(t.keyCode===_.DOWN_ARROW?1:-1),t.preventDefault()}t.keyCode===_.ENTER&&(this._selectedGroupRoot?(this._groupToggleCollapsed(this._selectedGroupRoot,!1),t.preventDefault()):this.acceptTypeIn())},t.prototype._eventListener=function(t,i){var o,n,r,s,a,l=this._inputElement,c=this._getInputValue();e.enabled("uppercase_instrument_names")&&(c=c.toUpperCase()),o=!1,n=!1,this._state.value!==c&&(this._state.hasOwnProperty("value")&&this._onValueChanged&&this._onValueChanged(c),this._state.value=c,o=!0,this._inputParserMixin&&this._inputParserMixin.parse()),this._fixIntervalCase(),r=this._limitInputSelectionValue("selectionStart"),this._state.selectionStart!==r&&(this._state.selectionStart=r,n=!0),s=this._limitInputSelectionValue("selectionEnd"),this._state.selectionEnd!==s&&(this._state.selectionEnd=s,n=!0),this._state.selectionDirection!==l.selectionDirection&&(this._state.selectionDirection=l.selectionDirection,n=!0),(o||n&&this._inputParserMixin)&&(this._onSelectionChanged(void 0,i),a=!1,this._getInputValue()!==this._state.value&&(this._setInputValue(this._state.value),a=!0),
(a||this._state.selectionStart!==this._limitInputSelectionValue("selectionStart")||this._state.selectionEnd!==this._limitInputSelectionValue("selectionEnd"))&&l.setSelectionRange&&l.setSelectionRange(this._state.selectionStart,this._state.selectionEnd,this._state.selectionDirection))},t.prototype._fixIntervalCase=function(){if(this._selectionInsideInterval()){var e=t.detachInterval(this._inputElement.value);/[a-z]/.test(e.detached)&&(this._inputElement.value=e.rest+e.detached.toUpperCase())}},t.prototype._selectionInsideInterval=function(e){if(this._ignoreInterval)return!1;var i=t.detachInterval(this._inputElement.value);return!!i&&("string"==typeof e?this._inputElement[e]>i.rest.length:this._inputElement.selectionStart>i.rest.length&&this._inputElement.selectionEnd>i.rest.length)},t.prototype._limitInputSelectionValue=function(e){return this._selectionInsideInterval(e)?t.detachInterval(this._inputElement.value).rest.length:e in this._inputElement?this._inputElement[e]:this._inputElement.value.length},t.prototype._getInputValue=function(){if(this._ignoreInterval)return this._inputElement.value;var e=t.detachStoreInterval(this._inputElement.value);return $(this._inputElement).toggleClass("interval-error",t.intervalError()),e},t.prototype._setInputValue=function(e){this._ignoreInterval?this._inputElement.value=e:this._inputElement.value=t.recallAttachInterval(e)},t.prototype._onSelectionChanged=function(t,e){function i(t,e,i,o,r){n._state.contextTicker=t,n._state.contextExchange=e,n._state.contextType=i,n._state.contextTradable=r,n._state.keepListFor&&n._state.keepListFor===o||(n._getSuggestList(),delete n._state.keepListFor)}var o,n=this;!b.some(function(t){return t.test(n._state.value)})&&(this._isSpreadInInput()||this._inputParserMixin&&!0!==e)?this._inputParserMixin.onSelectionChanged(i):this.$list&&(this._state._selectedTicker=null,o=this._state.value,this._isSpreadInInput()&&this._state.contextToken&&(o=this._state.contextToken.value),i(o,this.getExchangeFilter(),this._state.typeFilter,o,this._state.tradableFilter))},t.prototype._clearSelectionState=function(){delete this._state.contextTicker,delete this._state.contextExchange,delete this._state.contextType,delete this._state.contextToken,delete this._state.keepListFor},t.prototype._clearSearchTimeout=function(){this._searchTimeout&&(clearTimeout(this._searchTimeout),this._searchTimeout=null)},t.prototype._doGetSuggestList=function(){var t,e,i,o,r,s,a;this._clearSearchTimeout(),t=n(),e=this._state.contextTicker||"",i=this._state.contextExchange||this.getExchangeFilter()||"",o=this._state.typeFilter||"",r=t&&this._state.tradableFilter,t&&tradingService().trackEvent("Symbol Search Tradable checkbox",r?"on":"off"),s=window.language||"",this._showLoading(),a=this,ChartApiInstance.searchSymbols(e,i,o,s,T,!1,t,r,function(t){e!==(a._state.contextTicker||"")||i!==(a._state.contextExchange||a.getExchangeFilter()||"")||o!==(a._state.typeFilter||"")||(o===d.types.QUANDL&&(t=a._processQuandlResponse(t)),a._renderSuggestList(t),a._onResponse(t))})},
t.prototype._getSuggestList=function(){this._clearSearchTimeout(),this._searchTimeout=setTimeout(this._doGetSuggestList.bind(this),t.prototype.searchRequestDelay)},t.prototype._showLoading=function(){if(this.$list&&!this._spinner){this._clearSuggestList();var t=$('<div class="symbol-search-loading">').appendTo(this.$list);this._spinner=c("medium").spin(t.get(0))}},t.prototype._groupContracts=function(t){var e,i,o,n,r,s=ChartApiInstance.futuresRegex(),a={},l=[];for(e=0;e<t.length;++e){if(i=t[e],i.prefix||Array.isArray(i.contracts))return t;"futures"===i.type?(o=s.exec(i.symbol),o?(n=o[1],n in a?r=a[n]:(r=l.length,a[n]=r,l.push({type:i.type,symbol:n,exchange:i.exchange,description:i.description,full_name:i.exchange+":"+n,contracts:[]})),l[r].contracts.push(i)):l.push(i)):l.push(i)}return l},t.prototype._renderSuggestList=function(i){var o,n,r,s,a,l,c,h,d,p;if(this.$list){if(i=this._groupContracts(i),o=this,n=this._state,this._clearSuggestList(),r=u(n.contextTicker).trim(),s=RegExp(r.replace(" ","|"),"i"+(r.length>1?"g":"")),delete n.highlightedItem,this._hidePro&&(i=i.filter(function(t){return!t.params||-1===t.params.indexOf("pro")})),0===i.length)return void this.$list.html('<div style="text-align: center; padding: 7px 0; font-style: italic;">'+$.t("No symbols matched your criteria")+"</div>");for(a=document.createElement("table"),a.setAttribute("class","symbol-edit-popup"),l={},c=new t.GroupListHandler(a,s,l),h=null,this._renderedResponse=[],d=0;d<i.length;d++)p=i[d],c.append(p),h||p.ticker!==n.contextTicker||p.exchange!==n.contextExchange||(h=p),this._renderedResponse.push(p);e.enabled("expand_symbolsearch_items")||c.collapse(),this._groupListHandler=c,h&&this._highlightItem(p),$(a).on("click","tr",function(t){if(!t.isDefaultPrevented()){t.preventDefault();var e=o._getItemByElement(this);e&&e.full_name&&(o._isSpreadInInput()?o._highlightItem(e,!0,!1):o.accept(e.full_name,e.ticker))}}).appendTo(this.$list)}},t.prototype._isSpreadInInput=function(){return this._inputParserMixin&&this._state.parsed.length>1},t.prototype._getItemByElement=function(t){return this._renderedResponse&&this._groupListHandler?this._groupListHandler.getItemByTicker(t.getAttribute("data-item-ticker")):null},t.prototype._getElementByItem=function(t){return this._renderedResponse&&this.$list?this.$list.get(0).querySelector('tr[data-item-ticker="'+(t.ticker||t.full_name)+'"]'):null},t.prototype._highlightItem=function(t,e,i){var o,n,r=this._state;r.highlightedItem&&(o=this._getElementByItem(r.highlightedItem))&&$(o).removeClass("symbol-edit-popup-active"),r.highlightedItem=t,n=this._getElementByItem(r.highlightedItem),n&&($(n).addClass("symbol-edit-popup-active"),this._scrollHighlightIntoView()),e&&this._replaceCurrentSymbol(i)},t.prototype._scrollHighlightIntoView=function(){var t=this.$list.find("tr.symbol-edit-popup-active")
;t.length&&(t.offset().top<this.$list.offset().top?this.$list.scrollTop(this.$list.scrollTop()-(this.$list.offset().top-t.offset().top)):t.offset().top+t.outerHeight()>this.$list.offset().top+this.$list.outerHeight()&&this.$list.scrollTop(this.$list.scrollTop()+(t.offset().top+t.outerHeight()-(this.$list.offset().top+this.$list.outerHeight()))))},t.prototype._clearSuggestList=function(){this._renderedResponse=null,this._spinner&&(this._spinner.stop(),delete this._spinner),this.$list&&this.$list.empty()},t.prototype._showErrorNotice=function(){this.$list&&(this._clearSuggestList(),this.$list.text("Invalid expression"))},t.prototype._replaceCurrentSymbol=function(t){var e,i,o,n,r=this._state;if(r.highlightedItem){if(e=r.highlightedItem,i="",o=0,this._isSpreadInInput()||this._inputParserMixin&&!0!==t){if(n=this._inputParserMixin.replaceCurrentSymbol(e),!n.ok)return;i=n.newValue,o=n.newCaretPos,r.keepListFor=n.keepListFor}else this._state._selectedTicker=e.ticker||e.symbol,r.keepListFor=this._state._selectedTicker,i=!0===t&&e.full_name&&this._inputParserMixin?e.full_name:e.symbol,o=i.length;this._setInputValue(T?i.replace(S,""):i),this._inputElement.setSelectionRange?this._inputElement.setSelectionRange(o,o):this._inputElement.select(),this._eventListener(void 0,t)}},t.prototype.splitAndAcceptUserInput=function(){var t,e=this._getInputValue().split(",");for(t=0;t<e.length;t++)this.acceptSymbolIn(e[t])},t.prototype.acceptSymbolIn=function(t){var e,i;this._inputParserMixin?e=this._inputParserMixin.parseSymbol(t):(e=t,i=this._state._selectedTicker||t),this.accept(e,i)},t.prototype.acceptTypeIn=function(){this._allowMultipleSymbols?this.splitAndAcceptUserInput():this.acceptSymbolIn(this._getInputValue())},t.prototype.accept=function(e,i){var o=this;!function(){if((i=i||e)||""===i&&o.acceptEmpty){delete o._state.keepListFor;var n=o._ignoreInterval?void 0:t.getInterval(!0);o._inputElement.value=e,o._eventListener(),o._callback&&o._callback(i,n),$(o._inputElement).trigger("accept-symbol",[i])}}()},t.prototype.bindListWrapper=function(t){if(t=$(t).eq(0),0===t.size())throw new TypeError("element must be a DOM element, jQuery object or selector");this.$list=t,this._clearSelectionState(),this._eventListener()},t.prototype.removeListWrapper=function(){delete this.$list,this._clearSuggestList(),this._clearSelectionState(),this._eventListener()},t.prototype.selectExchangeFilter=function(){this.$filterContainer.find(".exchange-filter").hide(),this._state.typeFilter===d.types.QUANDL?this.$filterContainer.find("#quandl-filter").show():this._state.typeFilter!==d.types.ECONOMIC&&this.$filterContainer.find("#exchange-filter").show()},t.prototype._onResponse=function(t){if(t.length>0){this._state.typeFilter===d.types.QUANDL&&this._showNotification()}},t.prototype._showNotification=function(){var t,e,i
;TVSettings.getBool("symboledit.show_quandl_notification",!0)&&(t=$.t("Quandl is a huge financial database that we have connected to TradingView. Most of its data is EOD and is not updated in real-time, however the information may be extremely useful for fundamental analysis.")+' <a target="_blank" href="'+("ru"===window.locale?"http://blog.tradingview.com/?p=1530&lang=ru":"http://blog.tradingview.com/?p=1530")+'">'+$.t("Read our blog for more info!")+"</a>",e=$('<div class="symbol-edit-notification">').prependTo(this.$list),e.html(t),e.find("a").click(function(t){t.preventDefault();var e=$(this).attr("href");window.open(e,"_blank")}),i=$('<a class="close">').appendTo(e),i.click(function(){TVSettings.setValue("symboledit.show_quandl_notification",!1),e.remove()}))},t.prototype._processQuandlResponse=function(t){return t.datasets.filter(function(t){return!t.premium}).map(function(t){return{description:t.name,exchange:t.database_code,full_name:"QUANDL:"+t.database_code+"/"+t.dataset_code,params:["eod"],symbol:t.dataset_code,type:"quandl"}})},t.prototype.forceFocus=function(){this._inputElement.focus()},t.createSuggestListRow=function(e,i,o,n){var r,s,a,l,c,h,u,d,p,_,f;return n||(n={}),r=document.createElement("tr"),s="symbol-edit-popup",n.addClass&&(s+=" "+n.addClass),r.setAttribute("class",s),a=!T||"quandl"===e.type,l=document.createElement("td"),l.setAttribute("class","symbol-edit-popup-td name apply-overflow-tooltip"),c=a?e.symbol.replace(i,"<strong>$&</strong>"):e.symbol,h=n.nameContent||c,e.broker_symbol&&(h=h+" ("+(a?e.broker_symbol.replace(i,"<strong>$&</strong>"):e.broker_symbol)+")"),l.innerHTML=h,u=document.createElement("td"),u.setAttribute("class","symbol-edit-popup-td desc apply-overflow-tooltip"),u.innerHTML=!a||i.test(e.symbol)?e.description:e.description.replace(i,"<strong>$&</strong>"),d=document.createElement("td"),d.setAttribute("class","symbol-edit-popup-td type apply-overflow-tooltip"),p="",n.typeContent?p=n.typeContent:(e.params&&~e.params.indexOf("eod")&&(p='<i class="eod">eod</i>&nbsp;'),e.type in o||(o[e.type]="bitcoin"===e.type?$.t("crypto"):$.t(e.type)),e.exchange?e.exchange.startsWith("CHXEUR_")?p+=o[e.type]+" - "+e.exchange.split("_")[0]:p+=o[e.type]+" - "+e.exchange:p+=o[e.type]),d.innerHTML=p,_=document.createElement("td"),_.setAttribute("class","symbol-edit-popup-td flag apply-overflow-tooltip"),_.innerHTML=t.getItemFlag(e),f=_.getElementsByTagName("svg")[0],f&&f.setAttribute("class","flag"),r.appendChild(l),r.appendChild(u),r.appendChild(d),r.appendChild(_),r},t.getItemFlag=function(t){return""},t.showDialog=function(e){var n,r,s,a,l,c,h,u,d,p,_,f,g=i(205);if(e=e||{},n="Symbol Search",!TVDialogs.get(n))return r=TVDialogs.createDialog(n,{hideTitle:!0,hideCloseCross:!0,dragHandle:".filter",width:"750px",dragOptions:{cancel:".sbOptions"},content:g.dialogs.symbolSearch}),TVDialogs.positionDialog(r),s=r.find("._tv-dialog-content").addClass("symbol-search-dialog"),a=s.find(".results"),a.mousewheel(function(t,e){var i=$(this);e>0?i.scrollTop(i.scrollTop()-15):i.scrollTop(i.scrollTop()+15)}),
l=s.find("input").get(0),e.initialValue&&(l.value=e.initialValue),"selectionStart"in l&&(l.selectionStart=l.selectionEnd=l.value.length),l.focus(),this.canShowSpreadActions()&&(e.ignoreInterval||(h=t.getInputValueGetter(l),u=t.getInputValueSetter(l)),c=SymbolSearchInputParserMixin.addSpreadActions(s.find(".spread-actions"),l,h,u)),d=new t({input:l,list:s.find(".results").get(0),callback:function(t,i){e.callback&&e.callback(t,i),TVDialogs.destroy(n)},onParse:c,ignoreInterval:e.ignoreInterval}),p=s.find(".filter"),d.$filterContainer=p,_=o(d,p),f=m(d,p),_||f||p.attr("style","display: none"),TVDialogs.resizeContent(r.height(),a),TVDialogs.applyHandlers(r),TVDialogs.positionDialog(r),r.on("destroy",function(){TVSettings.setValue("symboledit.dialog_last_entry",l.value)}),r},t.bindToInput=function(i,o){function n(){v&&(T.removeListWrapper(),v.off(),v.remove(),v=null,h.hide(),"function"==typeof o.onPopupClose&&o.onPopupClose())}function r(t){t.preventDefault()}function a(){var t,i,n,s;if(v||(t=g(T),v=t.popup,T.bindListWrapper(t.listWrapper),v.on("focus",r),v.on("click",r),v.on("mousedown",r),v.on("focus","*",r),v.on("click","*",r),v.on("mousedown","*",r),"function"==typeof o.onPopupOpen&&o.onPopupOpen(t.popup)),e.enabled("charting_library_base")&&(i=this._state,i.keepListFor)){if(!i.highlightedItem)return void delete this._state.keepListFor;n=i.highlightedItem,s=this._getInputValue(),e.enabled("uppercase_instrument_names")&&(s=s.toUpperCase()),n.symbol!==s&&delete this._state.keepListFor}}function l(t,e){var i;return e?(RegExp("^"+d.types.QUANDL,"i").test(t)?(i=t.split(/\//),i.length&&(t=i[i.length-1])):t=s.seriesShortSymbol.value()||t,t):t}function c(t){var e=s.symbol.value()||"";e=l(e,t),i.val(e),T.resetState()}var u,p,f,m,v,y,b,S,w,T,C,x,P;return o=o||{},i=$(i).eq(0),u=o.callback,p=null,f=null,m=!1,v=null,b=o.spreadActions&&$(o.spreadActions).eq(0),b&&b.size()&&this.canShowSpreadActions()&&(o.ignoreInterval||(S=t.getInputValueGetter(i.get(0)),w=t.getInputValueSetter(i.get(0))),y=SymbolSearchInputParserMixin.addSpreadActions(b,i.get(0),S,w)),T=new t({input:i,onValueChanged:a,callback:function(t,e){n(),"function"==typeof f&&f(t,e)||("function"==typeof u&&u(t,e),"function"==typeof p&&p(t,e)),o.clearAfterAccept&&i.val(""),o.keepFocus?i.get(0).focus():i.get(0).blur(),T.resetState()},hidePro:o.hidePro,autoFocus:o.autoFocus,onEmptyApply:o.onEmptyApply,onParse:y,acceptEmpty:o.acceptEmpty,dontUseInputParser:o.dontUseInputParser,allowMultipleSymbols:o.allowMultipleSymbols,ignoreInterval:o.ignoreInterval}),C=!1,x=!0,TradingView.isMobile.iOS()&&$("body").css("cursor","pointer"),i.on("focus",function(t,e){C=!0,m=!0,T._skipAutoFocus?delete T._skipAutoFocus:setTimeout(function(){C&&i.get(0).select()},0)}),i.on("blur",function(t){var e,o,r,s,a=this;if(v&&(e=document.activeElement,o=v.is(e),r=v.has(e).length>0,(-1!==navigator.userAgent.indexOf("Trident")||-1!==navigator.userAgent.indexOf("MSIE"))&&(o||r)))return t.preventDefault(),t.stopImmediatePropagation(),void setTimeout(function(){i.focus()},0);TradingView.isMobile.iOS()&&x&&(x=!1,
C=!0),TradingView.isMobile.iOS()&&C&&null===t.relatedTarget?(s=function(t){$(a).is($(t.target))||(C=!1,setTimeout(function(){n()},0),$(document).off("click","body",s))},$(document).on("click","body",s)):C=!1,setTimeout(function(){C||n()},0)}),o.syncWithChartWidget&&(c(!0),s.seriesShortSymbol.subscribe(function(){c(!0)}),p=function(t,e){m=!(t||e),t&&s.symbol.setValue(t),e&&s.interval.setValue(e)},f=function(t,e){return!e&&(t===s.symbol.value()||(t===s.seriesShortSymbol.value()||void 0))},o.syncOnBlur&&i.on("blur",function(){m&&(c(!0),m=!1)}),P=function(){i.get(0).blur(),c(!1)},i.on("keypress",function(t){t.keyCode===_.ESC&&P()}),i.on("keydown",function(t){t.keyCode===_.ESC&&P()})),T},y.isRoot=function(t){return!(!t||!Array.isArray(t.contracts))},y.prototype.addRoot=function(t,e){var i,o;this._currentTbody=null,i=document.createElement("tbody"),this._container.appendChild(i),o=this,e.addEventListener("click",function(i){i.preventDefault(),e.classList.contains("collapsed")?o.expand(t):o.collapse(t)}),e.setAttribute("data-root",t),i.appendChild(e),this._roots[t]={titleRow:e,tbody:i}},y.prototype.append=function(e){var i,o,n,r,s,a=null,l=null;if(y.isRoot(e))for(i=e.symbol,o=(e.exchange||"unknown")+"_"+i,this._translationCache[e.type]||(this._translationCache[e.type]="bitcoin"===e.type?$.t("crypto"):$.t(e.type)),a=t.createSuggestListRow(e,this._tickerRegExp,this._translationCache,{nameContent:"<div>"+(T?i:i.replace(this._tickerRegExp,"<strong>$&</strong>"))+"</div>",typeContent:this._translationCache[e.type]+(e.exchange&&" - "+e.exchange||""),addClass:"group-title"}),this._roots[o]||this.addRoot(o,a),n=0;n<e.contracts.length;++n)r=e.contracts[n],s=t.createSuggestListRow(r,this._tickerRegExp,this._translationCache),l=r.ticker||r.full_name,this._itemsByTicker[l]=r,s.setAttribute("data-item-ticker",l),this._roots[o].tbody.appendChild(s);else this._currentTbody||(this._currentTbody=document.createElement("tbody"),this._container.appendChild(this._currentTbody)),a=t.createSuggestListRow(e,this._tickerRegExp,this._translationCache),this._currentTbody.appendChild(a);l=e.ticker||e.full_name,this._itemsByTicker[l]=e,a.setAttribute("data-item-ticker",l)},y.prototype.toggleCollapsed=function(t,e){var i;if(t)(i=this._roots[t])&&($(i.titleRow).toggleClass("collapsed",!!e),$(i.tbody).find("tr:not(.group-title)").toggleClass("hidden",!!e));else for(t in this._roots)this.toggleCollapsed(t,e)},y.prototype.collapse=function(t){this.toggleCollapsed(t,!0)},y.prototype.expand=function(t){this.toggleCollapsed(t,!1)},y.prototype.getItemByTicker=function(t){return this._itemsByTicker[t]||null},t.GroupListHandler=y,t.isIntervalInit=function(t){return/[\d,]/.test(t)&&e.enabled("show_interval_dialog_on_key_press")},t.isIntervalChar=function(t){return e.enabled("seconds_resolution")?/[\dhdwms]/i.test(t):/[\dhdwm]/i.test(t)},t.parseIntervalValue=function(t){var e=/^[,\s]*(\d*)\s*([hdwms]?)\s*$/i.exec(t)||[],i=~~e[1],o=e[2]&&e[2].toUpperCase(),n={qty:!i&&o?1:i,unit:o||null};return n.error=!i&&!o,n.intraday=!(n.error||n.unit&&"H"!==n.unit),n},
t.sanitizeIntervalValue=function(e){var i=t.parseIntervalValue(e),o=i.qty,n=i.unit;return i.error?null:("H"===n&&(o*=60,n=null),o&&!n?o+"":n&&(!o||1===o&&"S"!==n)?n:o+n)},t.detachInterval=function(t){var e=/,[^,]*$/i.exec(t)||[];if(e[0])return{rest:t.substr(0,t.length-e[0].length),detached:e[0]}},t.intervalIsSupported=function(i){var o,n,a;return e.enabled("allow_supported_resolutions_set_only")?null!==(o=this.sanitizeIntervalValue(i))&&r(o):(n=t.parseIntervalValue(i),!n.error&&(n.intraday?s.intraday.value():!(a=s.supportedResolutions.value())||!!~a.indexOf(n.unit)))},function(){var e="",i=null;t.resetStoredInterval=function(){e="",i=null},t.detachStoreInterval=function(o){var n=t.detachInterval(o);return n?(e=n.detached,i=t.sanitizeIntervalValue(e),n.rest):(t.resetStoredInterval(),o)},t.recallAttachInterval=function(t){return t+e},t.getInterval=function(e){var o=i;return!0===e&&t.resetStoredInterval(),o},t.getInputValueGetter=function(e){return function(){return t.detachStoreInterval(e.value)}},t.getInputValueSetter=function(e){return function(i){e.value=t.recallAttachInterval(i)}},t.intervalError=function(){return!(!e||/^,\s*$/.test(e))&&!i}}(),t.activateKeyPressHandler=function(){l.pushBackListener("symbolEdit",this._keyPressHandler)},t._keyPressHandler=function(o){var n,r=i(317);if(v(o))if(o.preventDefault(),n=String.fromCharCode(o.charCode),t.isIntervalInit(n))new r({callback:function(t){s.interval.setValue(t)}}).show(n);else{if(!e.enabled("symbol_search_hot_key"))return;t.showDialog({initialValue:n,callback:function(t,e){s.symbol.setValue(t),e&&s.interval.setValue(e)}})}},t.canShowSpreadActions=function(){return"undefined"!=typeof SymbolSearchInputParserMixin&&"cme"!==TradingView.widgetCustomer&&"bovespa"!==TradingView.widgetCustomer},t}();t.exports=f}).call(e,i(5))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t,e){void 0===e&&(e=!0),this._customFlags={},this._text=t,this._executeOnPush=e}return t.prototype.text=function(){return this._text},t.prototype.executeOnPush=function(){return this._executeOnPush},t.prototype.customFlag=function(t){return this._customFlags[t]},t.prototype.setCustomFlag=function(t,e){this._customFlags[t]=e},t}();e.UndoCommand=o},function(t,e,i){"use strict";var o=i(15),n=i(7),r=n.getLogger("Chart.PriceRange"),s=function(){function t(t,e){var i,o;null!==t&&"object"==typeof t?(i=t,this._minValue=i.m_minValue,this._maxValue=i.m_maxValue):(o=t,this._minValue=o,void 0!==e&&(this._maxValue=e))}return t.prototype.equals=function(t){return this._minValue===t._minValue&&this._maxValue===t._maxValue},t.prototype.clone=function(){return new t(this._minValue,this._maxValue)},t.prototype.minValue=function(){return this._minValue},t.prototype.setMinValue=function(t){this._minValue=t},t.prototype.maxValue=function(){return this._maxValue},t.prototype.setMaxValue=function(t){this._maxValue=t},t.prototype.length=function(){return this._maxValue-this._minValue},t.prototype.isEmpty=function(){
return this._maxValue===this._minValue||this._maxValue!==this._maxValue||this._minValue!==this._minValue},t.prototype.serialize=function(){return{m_maxValue:this._maxValue,m_minValue:this._minValue}},t.prototype.state=function(){return{max:this._maxValue,min:this._minValue}},t.prototype.merge=function(e){return new t(Math.min(this.minValue(),e.minValue()),Math.max(this.maxValue(),e.maxValue()))},t.prototype.apply=function(t,e){this._minValue=Math.min(this._minValue,t),this._maxValue=Math.max(this._maxValue,e)},t.prototype.set=function(t,e){this._minValue=t,this._maxValue=e},t.prototype.scaleAroundCenter=function(t){var e,i,n,s;if(!o.isNumber(t))return void r.logDebug("PriceRange.scaleAroundCenter: invalid coeff");0!==(e=this._maxValue-this._minValue)&&(i=.5*(this._maxValue+this._minValue),n=this._maxValue-i,s=this._minValue-i,n*=t,s*=t,this._maxValue=i+n,this._minValue=i+s)},t.prototype.shift=function(t){if(!o.isNumber(t))return void r.logDebug("PriceRange.shift: invalid coeff");this._maxValue+=t,this._minValue+=t},t.prototype.containsStrictly=function(t){return t.minValue()>this._minValue&&t.maxValue()<this._maxValue},t.prototype.convertToPercent=function(t,e){return 100*(t-e)/e},t.prototype.convertFromPercent=function(t,e){return t/100*e+e},t.prototype.convertToPercents=function(e){return new t(100*(this._minValue-e)/e,100*(this._maxValue-e)/e)},t.prototype.convertFromPercents=function(e){return new t(this._minValue/100*e+e,this._maxValue/100*e+e)},t}();t.exports=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Normal=0]="Normal",t[t.Arrow=1]="Arrow",t[t.Circle=2]="Circle"}(e.LineEnd||(e.LineEnd={}))},,function(t,e,i){"use strict";var o,n,r=i(17),s=i(5);!function(t){t[t.NotBound=0]="NotBound",t[t.BoundToWidget=1]="BoundToWidget",t[t.BoundToModel=2]="BoundToModel"}(o||(o={})),n=function(){function t(){this._watchedSymbol=new r,this._seriesShortSymbol=new r,this._proSymbol=new r,this._watchedInterval=new r,this._watchedIntraday=new r,this._watchedSupportedResolutions=new r,this._symbolNamesList=new r,this._chartWidgetBindingState=o.NotBound,this._activeChartWidget=null,this._watchedSymbolListenerBound=this._watchedSymbolListener.bind(this),this._watchedIntervalListenerBound=this._watchedIntervalListener.bind(this),this._onSymbolLinkBound=this._onSymbolLink.bind(this),this._searchCharts=null,this._selfEmit=!1,this._preventFeedBySymbol=!1}return Object.defineProperty(t.prototype,"symbol",{get:function(){return this._watchedSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"proSymbol",{get:function(){return this._proSymbol},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolNamesList",{get:function(){return this._symbolNamesList},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"seriesShortSymbol",{get:function(){return this._seriesShortSymbol.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"interval",{get:function(){return this._watchedInterval},enumerable:!0,configurable:!0}),
Object.defineProperty(t.prototype,"intraday",{get:function(){return this._watchedIntraday.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"supportedResolutions",{get:function(){return this._watchedSupportedResolutions.readonly()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"preventFeedBySymbol",{get:function(){return this._preventFeedBySymbol},enumerable:!0,configurable:!0}),t.prototype.bindToChartWidget=function(t){var e,i;if(this.unbindFromChartWidget(),this._activeChartWidget=t,e=t.model())return void this._onChartModelCreated(e);t.modelCreated().subscribe(this,this._onChartModelCreated),this._chartWidgetBindingState=o.BoundToWidget,i=t.properties().mainSeriesProperties,this._watchedSymbol.setValue(i.symbol.value()),this._watchedInterval.setValue(i.interval.value())},t.prototype.unbindFromChartWidget=function(){switch(this._chartWidgetBindingState){case o.BoundToWidget:if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated);break;case o.BoundToModel:this._symbolProperty().unsubscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.unsubscribe(this._watchedSymbolListenerBound),this._mainSeries().onSymbolResolved().unsubscribe(this,this._updateSeriesSymbolInfo),this._mainSeries().onSymbolError().unsubscribe(this,this._updateSeriesSymbolInfo),this._intervalProperty().unsubscribe(this,this._onIntervalPropertyChange),this._watchedInterval.unsubscribe(this._watchedIntervalListenerBound),delete this._watchedSymbol.hook,delete this._watchedSymbol.writeLock}this._activeChartWidget=null,this._chartWidgetBindingState=o.NotBound},t.prototype.getChartWidget=function(){return this._activeChartWidget},t.prototype.bindToChartWidgetCollection=function(t){var e=this;this._chartWidgetCollection=t,this.unbindFromChartWidget(),t.activeChartWidget.subscribe(function(t){e.unbindFromChartWidget(),e.bindToChartWidget(t)},{callWithLast:!0})},t.prototype.bindToSearchCharts=function(t){this.unbindFromSearchCharts(),this._searchCharts=t,t.onSearchBySymbol.subscribe(this,this._onSearchBySymbol),this._watchedSymbol.subscribe(this._onSymbolLinkBound)},t.prototype.unbindFromSearchCharts=function(){this._searchCharts&&(this._searchCharts.onSearchBySymbol.unsubscribe(this,this._onSearchBySymbol),this._watchedSymbol.unsubscribe(this._onSymbolLinkBound),this._searchCharts=null)},t.prototype.setPreventFeedBySymbol=function(t){this._preventFeedBySymbol=t},t.prototype._onSearchBySymbol=function(t){if(!t.resolved_symbol)throw Error("no resolved_symbol");this._selfEmit=!0,this._watchedSymbol.setValue(t.resolved_symbol),this._selfEmit=!1},t.prototype._onSymbolLink=function(t){if(!this._selfEmit){if(!this._searchCharts)throw Error("No search charts defined");this._preventFeedBySymbol||this._searchCharts.feedBySymbol(t)}},t.prototype._mainSeries=function(){if(!this._activeChartWidget)throw Error("ChartWidget is undefined");return this._activeChartWidget.model().mainSeries()},
t.prototype._properties=function(){return this._mainSeries().properties()},t.prototype._symbolProperty=function(){return this._properties().symbol},t.prototype._intervalProperty=function(){return this._properties().interval},t.prototype._watchedSymbolListener=function(t){(s.enabled("same_data_requery")||this._symbolProperty().value()!==t)&&this._chartWidgetCollection.setSymbol(t)},t.prototype._onSymbolPropertyChange=function(){this._watchedSymbol.setValue(this._symbolProperty().value())},t.prototype._onSymbolResolved=function(t){this._proSymbol.setValue(t.pro_name||s.enabled("trading_terminal")&&(t.full_name||t.name)||""),t.aliases&&this._symbolNamesList.setValue(t.aliases)},t.prototype._updateSeriesSymbolInfo=function(){this._seriesShortSymbol.setValue(this._properties().shortName.value());var t=this._mainSeries().symbolInfo();t?(this._onSymbolResolved(t),t.hasOwnProperty("supported_resolutions")?this._watchedSupportedResolutions.setValue(t.supported_resolutions):this._watchedSupportedResolutions.setValue(void 0),this._watchedIntraday.setValue(!!t.has_intraday)):(this._watchedIntraday.deleteValue(),this._proSymbol.deleteValue())},t.prototype._watchedIntervalListener=function(t){(s.enabled("same_data_requery")||this._intervalProperty().value()!==t)&&this._chartWidgetCollection.setResolution(t)},t.prototype._onIntervalPropertyChange=function(){this._watchedInterval.setValue(this._intervalProperty().value())},t.prototype._onChartModelCreated=function(t){var e,i,n;if(!this._activeChartWidget)throw Error("ChartWidget is undefined");this._chartWidgetBindingState=o.BoundToModel,this._activeChartWidget.modelCreated().unsubscribe(this,this._onChartModelCreated),e=this._symbolProperty(),e.subscribe(this,this._onSymbolPropertyChange),this._watchedSymbol.setValue(e.value()),this._watchedSymbol.subscribe(this._watchedSymbolListenerBound),i=this._mainSeries(),i.onSymbolResolved().subscribe(this,this._onSymbolResolved),this._watchedSymbol.hook=function(t){return i.symbolSameAsCurrent(t)&&(t=i.symbol()),t},i.onSymbolResolved().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolError().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.onSymbolGroupNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),i.onExtendedHoursNotPermitted().subscribe(this,this._updateSeriesSymbolInfo),this._updateSeriesSymbolInfo(),n=this._intervalProperty(),n.subscribe(this,this._onIntervalPropertyChange),this._watchedInterval.setValue(n.value()),this._watchedInterval.subscribe(this._watchedIntervalListenerBound),this._activeChartWidget.readOnly()&&(this._watchedSymbol.writeLock=!0)},t}(),window.TradingView=window.TradingView||{},window.TradingView.Linking=new n,t.exports=window.TradingView.Linking},function(t,e,i){"use strict";(function(e,o,n,r){function s(t){this._series=t,this._model=t.m_model,this._points=[new O(0,0)],this._invalidated=!0,this._lineRenderer=new L}function a(){return{count:TradingView.DEFAULT_BAR_COUNT}}function l(t,n,r){var c,_=i(158);k.call(this,t),
this._boxSizeChanged=new e,this._tagsChanged=new e,this._symbolIntervalChanged=new e,this._symbolResolved=new e,this._symbolError=new e,this._symbolNotPermitted=new e,this._symbolGroupNotPermitted=new e,this._intervalChanged=new e,this._extendedHoursChanged=new e,this._extendedHoursNotPermitted=new e,this.chartTypeNotPermitted=new e,this.intradaySpreadNotPermitted=new e,this.intradayExchangeNotPermitted=new e,this.customIntervalNotPermitted=new e,this.chartWidgetInitialized=new e,this._startLoading=new e,this._dataLoaded=new e,this._tickmarksRangeChanged=new e,this._barReceived=new e,this._onStyleChanged=new e,this._onCompleted=new e,this._onStatusChanged=new e,this._onRestarted=new e,this._onSessionsStudyCreated=new e,this.requestingIntradayWhenNotSupported=new e,this.requestingResolutionWhenNotSupported=new e,this.priceScaleChanged=new e,this._onInReplayStateChanged=new e,this._requestOptions=r||a(),this.m_model=t,this._chartApi=t._chartApi,this.m_data=new D(["time","open","high","low","close","adt","style"]),this.setProperties(n),this._prevChartStyle=n.style.value(),this.createPaneView(),this._dataWindowView=new p(this,t),this._statusView=new h(this,t.properties()),this._priceAxisViews=[new d(this,{model:t}),new u(this,{model:t})],this._symbolInfo=null,this._status=l.STATUS_OFFLINE,this._syncModel=null,this._replaySubscriber=null,c=this,this._turnaroundCounter=1,this._turnaround="s"+this._turnaroundCounter,this._handler=function(t){c.onData(t)},this._haStyle={studyId:"BarSetHeikenAshi@tv-basicstudies-60"},this._renkoStyle={studyId:"BarSetRenko@tv-prostudies-15"},this._pbStyle={studyId:"BarSetPriceBreak@tv-prostudies-15"},this._kagiStyle={studyId:"BarSetKagi@tv-prostudies-15"},this._pnfStyle={studyId:"BarSetPnF@tv-prostudies-15"},this._properties.addExclusion&&this._properties.addExclusion("visible"),this._base=100,this._formatter=new B(this._base),this._predictBars=0,this._futureBarsPaneView=null,this._properties.showInDataWindow.listeners().subscribe(t,_.prototype.fullUpdate),this.marketStatus=new o,this._seriesLoaded=!1,this.properties().minTick.listeners().subscribe(this,l.prototype._recreateFormatter),c=this,this.properties().minTick.listeners().subscribe(null,function(){c.m_model.invalidate(new V(V.FULL_UPDATE))}),this._priceLineView=new s(this),this._gotoDateView=new I(this),this.bindStyleChange(),this.bindJapChartsInputs(),this._createIsPrevClosePriceAvailableProperty(),this.createExtendedHoursProperty(),this.extendedHours.listeners().subscribe(this,function(){this._extendedHoursChanged.fire()}),this._extendedHoursNotPermitted.subscribe(this,function(){this._properties.extendedHours.setValue(!1)}),this._extendedHoursChanged.subscribe(this,function(){this._status!==l.STATUS_SNAPSHOT&&this.restart()}),this._symbolIntervalChanged.subscribe(this,this.checkInterval),this.properties().showCountdown.listeners().subscribe(this,l.prototype._onChangeShowCountdown),this._onChangeShowCountdown(this.properties().showCountdown),this._recreateFormatter(),this._isDWMCached=null,
this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W,$,H,U,j,q,G,Y,K,Z,X,J,Q;TradingView.DEFAULT_BAR_COUNT=300,TradingView.TIME_PLOT=0,TradingView.OPEN_PLOT=1,TradingView.HIGH_PLOT=2,TradingView.LOW_PLOT=3,TradingView.CLOSE_PLOT=4,TradingView.ADT_PLOT=6,TradingView.STYLE_PLOT=7,c=i(9).ensureNotNull,h=i(877),u=i(880).ProjectionSeriesPriceAxisView,d=i(341).SeriesPriceAxisView,p=i(881),_=i(342),f=_.SeriesAreaPaneView,m=_.SeriesLinePaneView,g=_.SeriesHollowCandlesPaneView,v=_.SeriesCandlesPaneView,y=_.SeriesBarsPaneView,b=_.SeriesHeikenAshiPaneView,S=_.SeriesBaselinePaneView,w=_.SeriesBaselineLinePaneView,T=i(5),C=i(3).propertyPages,x=i(344).BarsRange,P=i(217).SeriesBarColorer,L=i(94).HorizontalLineRenderer,I=i(883),k=i(46).PriceDataSource,A=i(124),M=i(884).FutureBarsPaneView,E=i(34).Interval,D=i(212).SeriesData,V=i(22),O=i(8).Point,R=i(346),B=i(28).PriceFormatter,z=i(19),F=z.PlotList,N=z.PlotRowSearchMode,W=z.mergeMinMax,$=i(33),H=i(347).SyncModel,U=i(40).trackEvent,j=i(162).translatedIntervalString,q=i(61),G=i(7),Y=G.getLogger("Chart.Series"),K=G.getLogger("Chart.Series.Updates",{highRate:!0}),Z=i(49),X=i(348),J=i(349),Q=!T.enabled("hide_series_legend_item"),s.prototype.update=function(){this._invalidated=!0},s.prototype.updateImpl=function(){if(this._visible=!1,this._series.properties().showPriceLine.value()){var t=this._series.lastValueData(void 0,!0);t.noData||(this._visible=!0,this._points=[new O(0,t.coordinate)],this._color=this._series.priceLineColor(t.color))}},s.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.width=this._model.timeScale().width(),t.height=this._series.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=this._series.properties().priceLineWidth.value(),t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},inherit(l,k),l.prototype.styleStudyInfos=function(){return{haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle}},l.prototype.styleStudyInfo=function(t){return this.styleStudyInfos()[t]},l.prototype.priceLineColor=function(t){return this.properties().priceLineColor.value()||t},l.prototype.endOfData=function(){return this._endOfData},l.prototype.serverTimeOffset=function(){return this._chartApi.serverTimeOffset()},l.prototype._onChangeShowCountdown=function(t){var e=this;t.value()?this._countdownUpdateTimer=this.m_model.setInterval(function(){e.isDWM()||(e._priceAxisViews[0].update(),e.m_model.invalidate(new V(V.LIGHT_UPDATE)))},500):(this.m_model.clearInterval(this._countdownUpdateTimer),delete this._countdownUpdateTimer)},l.prototype.lastValueData=function(t,e,i){
var o,n,r,s,a,l,c,h,u,d,p={noData:!0};if(this.m_model.timeScale().isEmpty()||this.priceScale().isEmpty()||this.data().isEmpty())return p;if(null===(o=this.m_model.timeScale().visibleBars()))return p;if(e){if(null===(s=this.data().bars().last()))return p;n=s.value,r=s.index}else{if(null===(a=this.data().bars().search(o.lastBar(),N.NearestLeft)))return p;n=this.data().bars().valueAt(a.index),r=a.index}return l={noData:!1},c=void 0!==t?n[t]:this._barFunction(n),i&&(l.price=c),this.priceScale().properties().percentage.value()&&(h=this.firstValue(),c=this.priceScale().priceRange().convertToPercent(c,h)),l.text=this.priceScale().formatter().format(c),u=this.barColorer(),d=u.barStyle(r,!1),l.color=d.barColor,l.floatCoordinate=this.priceScale().priceToCoordinate(c,!0),l.coordinate=Math.round(l.floatCoordinate),l.index=r,l},l.prototype.prevClose=function(){var t,e;return this.priceScale().isEmpty()||this.data().isEmpty()||!this.quoteData?null:null==(t=this.quoteData.prev_close_price)?null:(this.priceScale().properties().percentage.value()&&(e=this.firstValue(),t=this.priceScale().priceRange().convertToPercent(t,e)),{coordinate:this.priceScale().priceToCoordinate(t),floatCoordinate:this.priceScale().priceToCoordinate(t,!0),text:this.priceScale().formatter().format(t)})},l.prototype._createIsPrevClosePriceAvailableProperty=function(){this._isPrevClosePriceAvailable=new n(!this.isDWM()),this._onRestarted.subscribe(this,function(){this._isPrevClosePriceAvailable.setValue(!this.isDWM())})},l.prototype.isPrevClosePriceAvailable=function(){return this._isPrevClosePriceAvailable},l.prototype._prepareChartApiParams=function(){return this._requestOptions.startDate?!this._requestOptions.startDate||this._requestOptions.endDate||this._requestOptions.count?this._requestOptions.startDate&&this._requestOptions.endDate?["from_to",this._requestOptions.startDate,this._requestOptions.endDate]:["from_to",this._requestOptions.startDate,this._requestOptions.count]:["from_to",this._requestOptions.startDate]:this._requestOptions.count||TradingView.DEFAULT_BAR_COUNT},l.prototype._nextSymbolId=1,l.prototype._nextSeriesId=1,Object.assign(l,Z),l.PERMISSION_DENIED="permission denied",l.PD_REASON_SYMBOL="symbol",l.PD_REASON_EXTENDED_HOURS="extended_hours",l.PD_REASON_GROUP_PERMISSION="group",l.STUDY_NOT_AUTH="study_not_auth",l.prototype.model=function(){return this.m_model},l.prototype.fixLastBar=function(t){this._futureBarsPaneView||(this._futureBarsPaneView=new M(this,this.data().bars().lastIndex(),t))},l.prototype.clearData=function(){this.data().clear()},l.prototype.data=function(){return this.m_data},l.prototype.symbolId=function(){return this._symbolId},l.prototype.isPulse=function(){return this._symbolInfo&&this._symbolInfo.resolutions.length>0},l.prototype.onTagsChanged=function(){return this._tagsChanged},l.prototype.onSymbolIntervalChanged=function(){return this._symbolIntervalChanged},l.prototype.onSymbolResolved=function(){return this._symbolResolved},l.prototype.onSymbolError=function(){return this._symbolError},
l.prototype.onSymbolNotPermitted=function(){return this._symbolNotPermitted},l.prototype.onSymbolGroupNotPermitted=function(){return this._symbolGroupNotPermitted},l.prototype.onIntervalChanged=function(){return this._intervalChanged},l.prototype.onExtendedHoursNotPermitted=function(){return this._extendedHoursNotPermitted},l.prototype.onStartLoading=function(){return this._startLoading},l.prototype.onDataLoaded=function(){return this._dataLoaded},l.prototype.onStatusChanged=function(){return this._onStatusChanged},l.prototype.onTickmarksRangeChanged=function(){return this._tickmarksRangeChanged},l.prototype.onBarReceived=function(){return this._barReceived},l.prototype.onStyleChanged=function(){return this._onStyleChanged},l.prototype.onCompleted=function(){return this._onCompleted},l.prototype.onRestarted=function(){return this._onRestarted},l.prototype.onBoxSizeChanged=function(){return this._boxSizeChanged},l.prototype.status=function(){return this._status},l.prototype.isDWM=function(){var t,e;return null!==this._isDWMCached?this._isDWMCached:(t=new E(this._properties.interval.value()),t.isDWM()?this._isDWMCached=!0:(e=t.kind()===E.SECONDS?t.multiplier():60*t.multiplier(),this._isDWMCached=!(e<216e3)),this._isDWMCached)},l.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},l.prototype.createPaneView=function(){this._paneView=null,this._projectionBarsPaneView=null,this._baseLineView=null,this._symbolLabelView=new A(this.m_model,this,void 0,"firstShortName","showSymbolLabels");var t=this._properties.style.value();switch(t){case l.STYLE_BARS:this._paneView=new y(this,this.m_model);break;case l.STYLE_CANDLES:this._paneView=new v(this,this.m_model);break;case l.STYLE_LINE:this._paneView=new m(this,this.m_model);break;case l.STYLE_AREA:this._paneView=new f(this,this.m_model);break;case l.STYLE_HEIKEN_ASHI:this._paneView=new b(this,this.m_model);break;case l.STYLE_HOLLOW_CANDLES:this._paneView=new g(this,this.m_model);break;case l.STYLE_BASELINE:this._paneView=new S(this,this.m_model),this._baseLineView=new w(this,this.m_model);break;default:throw Error("Unknown chart style assigned: "+t)}},l.prototype._clearStylePlot=function(t,e){var i,o;0!==t.size()&&(i=e||c(t.firstIndex()),o=c(t.lastIndex())+1,t.range(i,o).each(function(t,e){e[TradingView.STYLE_PLOT]=null}))},l.prototype.invalidateBarStylesCache=function(t){Y.logDebug("Invalidate style cache starting from "+t),this._clearStylePlot(this.m_data.m_bars,t),this._clearStylePlot(this.m_data.m_nsBars)},l.prototype.invalidateBarColorerCache=function(){delete this._barColorerCache,this.invalidateBarStylesCache()},l.prototype.barColorer=function(){var t,e,i,o;if(this._barColorerCache)return this._barColorerCache;for(t=null,e=this.m_model.dataSources().length-1;e>=0;e--)i=this.m_model.dataSources()[e],i.metaInfo&&TradingView.isInherited(i.constructor,TradingView.Study)&&i.hasBarColorer()&&i.properties().visible.value()&&(o=i.barColorer(),null===t?t=o:t.pushBackBarColorer(o))
;return null===t?t=new P(this):t.pushBackBarColorer(new P(this)),this._barColorerCache=t,this._barColorerCache},l.prototype.properties=function(){return this._properties},l.prototype._barsState=function(t){var e=t.state();return e.columns=e.columns.filter(function(t){return"style"!==t}),e.data.forEach(function(t){t.value.splice(7,1)}),e},l.prototype.state=function(t){var e=this===this.m_model.mainSeries()?"MainSeries":TradingView.className(this.constructor),i={type:e,id:this.id(),state:this.properties().state(),zorder:this.zorder(),haStyle:this._haStyle,renkoStyle:this._renkoStyle,pbStyle:this._pbStyle,kagiStyle:this._kagiStyle,pnfStyle:this._pnfStyle};return this._symbolInfo&&this._symbolInfo.ticker&&(i.state.symbol=this._symbolInfo.ticker),t&&(i.bars=this._barsState(this.m_data.m_bars),i.nsBars=this._barsState(this.m_data.m_nsBars),i.symbolInfo=this._symbolInfo,i.rtPrice=this.data().lastProjectionPrice),i.boxSize=this.data().boxSize,i.reversalAmount=this.data().reversalAmount,i},l.prototype.restoreData=function(t,e,i,o,n,r){this._status=l.STATUS_SNAPSHOT,this.m_data.m_bars.restoreState(t),this.m_data.m_nsBars.restoreState(e),this.updateSymbolInfo(i),this.m_data.lastProjectionPrice=o,this.m_data.boxSize=n,n||(this.properties().style.value()===l.STYLE_PNF?this.m_data.boxSize=this.properties().pnfStyle.inputs.boxSize.value():this.properties().style.value()===l.STYLE_RENKO&&(this.m_data.boxSize=this.properties().renkoStyle.inputs.boxSize.value())),this.m_data.reversalAmount=r,r||this.properties().style.value()===l.STYLE_KAGI&&(this.m_data.reversalAmount=this.properties().kagiStyle.inputs.reversalAmount.value())},l.prototype.setProperties=function(t){t.timeframe||t.merge({timeframe:""}),t.shortName||t.merge({shortName:""}),this._properties=t,this._properties.symbol.listeners().subscribe(this,l.prototype.changeSymbol),this._properties.interval.listeners().subscribe(this,l.prototype.changeInterval),this._properties.timeframe.listeners().subscribe(this,l.prototype.changeTimeFrame),this._properties.listeners().subscribe(this,l.prototype.changeProperties)},l.prototype.changeSymbol=function(){this.setSymbolIntervalDelayed(),this.m_model.checkLineToolSelection()},l.prototype.changeInterval=function(){this.setSymbolIntervalDelayed()},l.prototype.changeTimeFrame=function(){U("GUI","Change timeframe")},l.prototype.title=function(){return this.properties().symbol.value()+", "+j(this.properties().interval.value())},l.prototype.changeProperties=function(t){t!==this._properties.symbol&&t!==this._properties.interval&&t!==this._properties.timeframe&&(this._tagsChanged.fire(),this.createPaneView(),this.updateAllViews(),this.m_model.updateSource(this))},l.prototype._makeNextSymbolId=function(){return"symbol_"+this._nextSymbolId++},l.prototype._makeNextSeriesId=function(){return"s"+this._nextSeriesId++},l.prototype.onData=function(t){var e,i,o,n,r,s,a,h,u,d,p,_,f,m,g,v,y,b=this;switch(t.method){case"symbol_resolved":if(t.params[0]!==this._symbolId){Y.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0])
;break}this.updateSymbolInfo(t.params[1]),this.m_model.updateSource(this),this._symbolResolved.fire(this._symbolInfo),this.m_model.realignLineTools(),TradingView.onWidget()||U("Symbol",t.params[1].listed_exchange,t.params[1].name),e=this.symbolInfo().minmov/this.symbolInfo().pricescale,i=this.properties(),i.style.value()===l.STYLE_RENKO&&i.renkoStyle.inputs.boxSize.value()<e?i.renkoStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_PNF&&i.pnfStyle.inputs.boxSize.value()<e?i.pnfStyle.inputs.merge({boxSize:e}):i.style.value()===l.STYLE_KAGI&&i.kagiStyle.inputs.reversalAmount.value()<e&&i.kagiStyle.inputs.merge({reversalAmount:e});break;case"symbol_error":if(t.params[0]!==this._symbolId){Y.logNormal("command for old symbol. Expected:"+this._symbolId+", actual"+t.params[0]);break}if(this._setStatus(l.STATUS_INVALID_SYMBOL),this._properties.shortName.setValue(this._properties.symbol.value()),this.m_model.clearAllStudies(),this.updateAllViews(),this.m_model.updateSource(this),t.params[1]===l.PERMISSION_DENIED)switch(t.params[2]){case l.PD_REASON_EXTENDED_HOURS:this._extendedHoursNotPermitted.fire();break;case l.PD_REASON_SYMBOL:this._symbolNotPermitted.fire(t.params[3]);break;case l.PD_REASON_GROUP_PERMISSION:this._symbolGroupNotPermitted.fire(t.params[3]);break;default:this._symbolNotPermitted.fire(t.params[2])}else this.m_model.resetTimeScale(),this._symbolError.fire();this.m_model.realignLineTools();break;case"series_timeframe":if(t.params[1]!==this._turnaround)break;o=t.params[2],n=t.params[3],r=t.params[4],s=void 0!==r&&r?n:n+10,this.m_model.setTimeViewport(o,s);break;case"series_error":a=t.params[2],delete this._loadingStartTime,T.enabled("charting_library_debug_mode")&&Y.logNormal("Error reason: "+a),this._setStatus(T.enabled("no_bars_status")&&this._symbolInfo?l.STATUS_NO_BARS:l.STATUS_INVALID_SYMBOL),"string"==typeof a&&(a.startsWith("study_not_auth:")?(h=a.split(":",2)[1].split("@",2)[0],h in{BarSetRenko:!0,BarSetPriceBreak:!0,BarSetKagi:!0,BarSetPnF:!0}?this.chartTypeNotPermitted.fire(h):"BarSetSpread"===h&&this.intradaySpreadNotPermitted.fire()):"resolution_not_entitled"===a?this.intradayExchangeNotPermitted.fire():"custom_resolution"===a&&this.customIntervalNotPermitted.fire()),this._seriesLoaded=!0;break;case"series_loading":if(t.params[1]!==this._turnaround)break;if(t.params[0]!==this._seriesId){Y.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}this._setStatus(l.STATUS_LOADING),b._loadingStartTime=(new Date).getTime();break;case"series_completed":if(t.params[2]!==this._turnaround)break;if(t.params[0]!==this._seriesId){Y.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}switch(u="chartSession:"+b._chartApi._sessionid,d=(new Date).getTime()-this._loadingStartTime,Y.logDebug(u+", Series loading took "+d+" ms, eod:"+this._endOfData),delete this._loadingStartTime,p=t.params[1],"pulsed"===p&&(p="delayed"),p){case"streaming":this._setStatus(l.STATUS_READY);break;case"endofday":this._setStatus(l.STATUS_EOD);break
;case"delayed":this._setStatus(l.STATUS_DELAYED);break;case"pulsed":this._setStatus(l.STATUS_PULSE);break;case"replay":this._setStatus(l.STATUS_REPLAY)}p.match(/delayed_streaming/)&&this._setStatus(l.STATUS_DELAYED_STREAMING),_=this.m_model.paneForSource(this),_.recalculatePriceScale(this.priceScale()),this.m_model.invalidate(new V(V.FULL_UPDATE)),this.m_data.size()&&this._tickmarksRangeChanged.fire({start:c(this.data().first()).value[TradingView.TIME_PLOT],end:c(this.data().last()).value[TradingView.TIME_PLOT]}),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0),this.model().recalcStudyBasedLineTools(),!this.m_priceScale.isLockScale()||this.model().timeScale().isEmpty()||this._seriesLoaded||(this.model().timeScale()._correctOffset(),this.model().timeScale().correctBarSpacing(),f=this.model().timeScale().visibleBars(),this.priceScale().setPriceRange(this.priceRange(f.firstBar(),f.lastBar()))),this._seriesLoaded=!0,this._onCompleted.fire(this._endOfData),this.requestMoreData();break;case"series_deleted":break;case"data_update":if(t.params.customId!==this._seriesId){Y.logNormal("command for old series. Expected:"+this._seriesId+", actual"+t.params.customId);break}if(t.params.turnaround!==this._turnaround){Y.logNormal("command for old series turnaround. Expected:"+this._turnaround+", actual"+t.params.turnaround);break}if(this._setSymbolIntervalDelay){if(this._willSymbolIntervalChanged())return void Y.logNormal("command comes during symbol/interval changing");Y.logNormal("data_update comes when symbol interval delay present but symbol/interval should not be changed")}if(this.status()===l.STATUS_INVALID_SYMBOL)break;t.params.plots.length?(m=this.m_data.bars().size(),g=this.m_data.bars().firstIndex(),v=this.m_data.bars().merge(t.params.plots),(null===g||v.earliestRow.index<g)&&(this._endOfData=!1),y="Merge bars. Changes:{length:"+v.length+", earliestRow:"+v.earliestRow.index+"} ",y+="bars state:{firstBar:"+c(this.m_data.bars().firstIndex())+",lastBar:"+c(this.m_data.bars().lastIndex())+",size:"+this.m_data.bars().size()+"}",K.logDebug(y),m!==this.bars().size()&&(this._barReceived.fire(v),this.model().recalcVisibleRangeStudy(this.model().dataSources(),!0))):(this.m_data.clear(),this._startLoading.fire()),new Promise(function(e){var i=b.properties().style.value();t.params.nonseries&&J.isJapaneseStyle(i)?b.parseJapProjBars(t.params.nonseries).then(function(t){b.m_data.m_nsBars=t.nsBars,b.m_data.lastProjectionPrice=t.lastPrice;var i=b.m_data.boxSize!==t.boxSize;b.m_data.boxSize=t.boxSize,b.m_data.reversalAmount=t.reversalAmount,i&&b._boxSizeChanged.fire(b.m_data.boxSize),e()}):(t.params.nonseries||(b.m_data.m_nsBars.clear(),b.m_data.lastProjectionPrice=void 0),e(),e())}).then(function(){b._statusView.invalidate();var t=b.m_model.paneForSource(b);b.m_model.updateAllVolumeStudies(),b.m_model.recalculatePane(t),b.m_model.updateSource(b),b.m_model.updateLineTools(),b.m_model.updateCrossHair()})}this._dataLoaded.fire(t)},l.prototype.parseJapProjBars=function(t){
var e,i,o,n=new F(["time","open","high","low","close","adt","style"]),r=this.model().timeScale(),s=this.properties().style.value(),a=this;return new Promise(function(c){t.d&&""!==t.d?TradingView.Study.prototype._makeJSONForNSData.call(a,{params:{nonseries:t}}).then(function(a){var h,u,d,p,_=a.data;for(e=_.price,i=_.boxSize,o=_.reversalAmount,h=_.bars,u=0;h&&u<h.length;u++)d=[],p=t.indexes[h[u].time],d.push(r.points().valueAt(p)),d.push(h[u].open),d.push(h[u].high),d.push(h[u].low),d.push(h[u].close),d.push(h[u].volume),s===l.STYLE_KAGI?d.push(h[u].additionalPrice):s===l.STYLE_PNF&&d.push(h[u].factor),n.add(p,d);c({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})}):c({nsBars:n,lastPrice:e,boxSize:i,reversalAmount:o})})},l.prototype.disconnect=function(){this._seriesId&&this._chartApi.removeSeries(this._seriesId),this._symbolId=null,this._seriesId=null,this._predictBars=0,this._status=l.STATUS_OFFLINE},l.prototype.isStarted=function(){return!!this._symbolId},l.prototype.restart=function(){var t,e=i(158);this._onRestarted.fire(),this._setStatus(l.STATUS_RESOLVING),this.m_data=new D(["time","open","high","low","close","adt","style"]),this.updateSymbolInfo(null),this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),t=this._properties.interval.value(),this._pendingTimeRange&&(t=this._generateTimeframe(t,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),t),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,t,this._handler,this._prevSymbolId)):(this._seriesId=this._makeNextSeriesId(),!1===this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,t,this._prepareChartApiParams(),this._handler)&&(this._seriesId=void 0)),this._properties.showInDataWindow.listeners().subscribe(this.m_model,e.prototype.fullUpdate),this.m_symbol=this._properties.symbol.value(),this.m_interval=this._properties.interval.value()},l.prototype._generateTimeframe=function(t,e){var i,o=e.right(1),n=t;return"ytd"===e?n+=",YTD":"d"===o?(i=e.left(e.length-1),n+=","+i,T.enabled("daily_timeframe_suffix")&&(n+="D")):"m"===o?(i=e.left(e.length-1),n+=","+i+"M"):"all"===e&&(n+=",ALL"),n},l.prototype.hasDelayedSymbolIntervalChange=function(){return!!this._setSymbolIntervalDelay},l.prototype.setSymbolIntervalDelayed=function(){this._isDWMCached=null,this._willSymbolIntervalChanged()&&(this._setSymbolIntervalDelay&&(Y.logNormal("Clear timeout to change symbol/interval #"+this._setSymbolIntervalDelay),clearTimeout(this._setSymbolIntervalDelay)),this._setSymbolIntervalDelay=setTimeout(function(){Y.logNormal("Timeout #"+this._setSymbolIntervalDelay+' fired, new symbol will be "'+this._properties.symbol.value()+'"'),delete this._setSymbolIntervalDelay,this._setSymbolInterval(this._properties.symbol.value(),this._properties.interval.value())}.bind(this),30),
Y.logNormal("Started timeout #"+this._setSymbolIntervalDelay+' to change symbol/interval from "'+this.m_symbol+'" to "'+this._properties.symbol.value()+'"'))},l.prototype._willSymbolIntervalChanged=function(){var t=this._checkIntervalWillChanged(this._parseInterval(this._properties.interval.value()).interval);return this._checkSymbolWillChanged(this._properties.symbol.value())||t},l.prototype._checkSymbolWillChanged=function(t){return!this.symbolSameAsCurrent(t)||T.enabled("same_data_requery")},l.prototype._checkIntervalWillChanged=function(t){return this.m_interval!==t||T.enabled("same_data_requery")},l.prototype._parseInterval=function(t){var e=(t+"").split(",");return{interval:2===e.length?e[0]:t,timeframe:2===e.length?e[1]:0}},l.prototype.rerequestData=function(){this._setSymbolInterval(this.m_symbol,this.m_interval,!0)},l.prototype._setSymbolInterval=function(t,e,i){var o,n,r,s,a,c;delete this._gotoDateResult,o=this._parseInterval(e),n=o.interval,r=o.timeframe,s=this._checkSymbolWillChanged(t),a=this._checkIntervalWillChanged(n),(s||a||i)&&(this._syncModel=null,this.m_symbol=t,this.m_interval=n,this.m_timeframe=r,this._symbolId&&!s||this.updateSymbolInfo(null),this.m_model.realignLineTools(),this._status!==l.STATUS_SNAPSHOT&&(this._setStatus(l.STATUS_RESOLVING),this._symbolIntervalChanged.fire(),a&&(c={timeframe:this._pendingTimeRange},this._intervalChanged.fire(this.m_interval,c),this._pendingTimeRange=c.timeframe&&c.timeframe.toLowerCase()),this._onRestarted.fire(),this._seriesLoaded=!1,this._chartApi&&this._chartApi.connected()&&(this._symbolId&&!s||(this._prevSymbolId=this._symbolId,this._symbolId=this._makeNextSymbolId(),this._chartApi.resolveSymbol(this._symbolId,this._getResolvingSymbolString(),this._handler)),this._seriesId?(this._turnaround="s"+ ++this._turnaroundCounter,this._pendingTimeRange&&(e=this._generateTimeframe(e,this._pendingTimeRange),delete this._pendingTimeRange),this._onBeforeModifySeries(this.getSymbolString(),e),this._predictBars=0,this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler,this._prevSymbolId)):(this._onBeforeModifySeries(this.getSymbolString(),e),this._seriesId=this._makeNextSeriesId(),this._chartApi.createSeries(this._seriesId,this._turnaround,this._symbolId,e,this._prepareChartApiParams(),this._handler)))))},l.prototype.setDefaultTimeframe=function(t){this._pendingTimeRange=t},l.prototype.actualSymbol=function(){return this.symbolInfo()?this.symbolInfo().full_name:this.symbol()},l.prototype.proSymbol=function(){return this.symbolInfo()?this.symbolInfo().pro_name:this.symbol()},l.prototype.symbol=function(){return this.properties().symbol.value()},l.prototype.interval=function(){return this.properties().interval.value()},l.prototype.isIntradayInterval=function(){return!!/^\d*$/.test(this.interval())&&this.interval()<=1440},l.prototype.bars=function(){return this.m_data.m_bars},l.prototype.nsBars=function(){return this.m_data.m_nsBars},l.prototype.open=function(t){return this.m_data.valueAt(t)[TradingView.OPEN_PLOT]},
l.prototype.high=function(t){return this.m_data.valueAt(t)[TradingView.HIGH_PLOT]},l.prototype.low=function(t){return this.m_data.valueAt(t)[TradingView.LOW_PLOT]},l.prototype.close=function(t){return this.m_data.valueAt(t)[TradingView.CLOSE_PLOT]},l.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},l.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},l.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},l.prototype.priceRange=function(t,e){var i,o,n,s,a,l,c,h;return TradingView.isInteger(t)?TradingView.isInteger(e)?this.data().isEmpty()?null:this.m_priceScale.isLockScale()&&null!==(i=this._model.mainSeriesScaleRatio())?(o=this.priceScale().internalHeight()/(this.model().timeScale().barSpacing()/i),n=this.data().search(e,N.NearestLeft),s=(n.value[TradingView.HIGH_PLOT]+n.value[TradingView.LOW_PLOT])/2,a=new r(s-.5*o,s+.5*o),l=this.data().search(t,N.NearestRight),this.priceScale().isPercentage()?a.convertToPercents(l.value[TradingView.CLOSE_PLOT]):a):(c=this.data().bars().minMaxOnRange2(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),h=this.data().nsBars().minMaxOnRange(t,e,[{index:TradingView.LOW_PLOT,offset:0},{index:TradingView.HIGH_PLOT,offset:0}]),c=W(c,h),a=null!==c?c.min===c.max?new r(c.min-.5,c.max+.5):new r(c.min,c.max):new r(-.5,.5),this.priceScale().isPercent()?(l=this.data().search(t,N.NearestRight),null===l?null:a.convertToPercents(l.value[TradingView.CLOSE_PLOT])):this.priceScale().isLog()?new r(this.priceScale().priceToLogical(a.minValue()),this.priceScale().priceToLogical(a.maxValue())):a):(Y.logDebug("Series.priceRange: incorrect endBar"),null):(Y.logDebug("Series.priceRange: incorrect startBar"),null)},l.prototype.nearestData=function(t,e){if(!TradingView.isInteger(t))return void Y.logDebug("Series.nearestData: incorrect logicalPoint");var i=this.data().search(t,e);return null!==i?i:void 0},l.prototype.nearestIndex=function(t,e){var i=this.nearestData(t,e);return i?i.index:void 0},l.prototype.paneViews=function(t){if(!this.properties().visible.value())return null;var e=[this._paneView];return this._futureBarsPaneView&&e.push(this._futureBarsPaneView),this._projectionBarsPaneView&&e.push(this._projectionBarsPaneView),null!==this._baseLineView&&e.push(this._baseLineView),e.push(this._priceLineView),e.push(this._symbolLabelView),e.push(this._gotoDateView),e},l.prototype.dataWindowView=function(){return this._dataWindowView},l.prototype.statusView=function(){return Q?this._statusView:null},l.prototype.priceAxisViews=function(t,e){return this.m_model.paneForSource(this)===t&&e===this.priceScale()&&(this.m_model.properties().scalesProperties.showSeriesLastValue.value()||this.properties().showCountdown.value())?this._priceAxisViews:null},l.prototype.base=function(){return this._base},l.prototype.formatter=function(){return this._formatter},l.prototype.purgeSymbolInfo=function(){this._symbolInfo=null},l.prototype.symbolInfo=function(){return this._symbolInfo},
l.prototype._recreateFormatter=function(){var t,e,i,o;"default"===this.properties().minTick.value()?this._formatter=new B(this._symbolInfo?this._symbolInfo.pricescale:100,this._symbolInfo?this._symbolInfo.minmov:1,!!this._symbolInfo&&this._symbolInfo.fractional,this._symbolInfo?this._symbolInfo.minmove2:void 0):(t=this.properties().minTick.value().split(","),e=parseInt(t[0]),i=parseInt(t[1]),o="true"===t[2],this._formatter=new B(e,i,o)),this.priceScale()&&this.priceScale().updateFormatter()},l.prototype.updateSymbolInfo=function(t){var e,i,o=this,n=t&&(t.pro_name||t.full_name||t.name);T.enabled("charting_library_single_symbol_request")&&this.m_symbol&&(n=this.m_symbol),this._symbolInfo=t,t&&(this._properties.shortName.setValue(t.name),e=this._properties.symbol.value(),i=n,T.enabled("uppercase_instrument_names")&&(e=e.toUpperCase(),i=i.toUpperCase()),n&&e!==i&&this._properties.symbol.setValue(n)),this._base=t?t.pricescale/t.minmov:100,this._recreateFormatter(),this._statusView.update(),this.priceScale().updateFormatter(),"undefined"!=typeof quoteSessionMultiplexerInstance&&this._quoteSessionSymbol!==n&&(this._quoteSessionClientId||(this._quoteSessionClientId="series-"+q.guid()),this._unsubscribeQuoteSession(),n&&(this._quoteSessionSymbol=n,quoteSessionMultiplexerInstance.full.subscribe(this._quoteSessionClientId,this._quoteSessionSymbol,function(t,e){o.quoteData=t&&t.values||null,e&&e.values&&e.values.current_session&&o.marketStatus.setValue(e.values.current_session)}))),this.checkInterval()},l.prototype._unsubscribeQuoteSession=function(){this._quoteSessionSymbol&&(quoteSessionMultiplexerInstance.full.unsubscribe(this._quoteSessionClientId,this._quoteSessionSymbol),this._quoteSessionSymbol=void 0)},l.prototype.symbolSameAsCurrent=function(t){if(this.m_symbol===t)return!0;var e=this._symbolInfo;if(e){if(e.full_name===t||e.pro_name===t)return!0;if(e.ticker===t)return!0;if(e.aliases&&-1!==e.aliases.indexOf(t))return!0;if(e.alternatives&&-1!==e.alternatives.indexOf(t))return!0;if(0===t.indexOf("FRA:")&&e.pro_name===t.replace("FRA:","FWB:"))return!0}return!1},l.prototype.updateAllViews=function(){var t,e;for(this._paneView.update(),this._dataWindowView.update(),this._statusView.update(),t=this._priceAxisViews.length,e=0;e<t;e++)this._priceAxisViews[e].update();this._futureBarsPaneView&&this._futureBarsPaneView.update(),this._projectionBarsPaneView&&this._projectionBarsPaneView.update(),null!==this._baseLineView&&this._baseLineView.update(),this._priceLineView.update(),this._gotoDateView.update(),this._symbolInfo&&this._symbolLabelView.update()},l.prototype._setStatus=function(t){this._status=t,this._statusView.update(),this.m_model.updateSource(this),this._onStatusChanged.fire()},l.prototype.requestMoreData=function(t){var e,i,o,n
;this._status!==l.STATUS_READY&&this._status!==l.STATUS_PULSE&&this._status!==l.STATUS_DELAYED&&this._status!==l.STATUS_DELAYED_STREAMING&&this._status!==l.STATUS_EOD&&this._status!==l.STATUS_REPLAY||this.m_model.timeScale().isEmpty()||null!==(e=this.m_model.timeScale().visibleBars())&&0!==this.bars().size()&&(i=t||e.lastBar()-c(this.data().last()).index,this._predictBars<i&&(this._predictBars=i,this._chartApi&&this._chartApi.connected()&&this._chartApi.requestMoreTickmarks(this._seriesId,i,this._handler)),this._endOfData||(o=c(this.bars().firstIndex()),(n=t||o-e.firstBar())<=0||(this._endOfData=!0,this._chartApi&&this._chartApi.connected()&&(this._chartApi.requestMoreData(this._seriesId,n,this._handler),T.enabled("charting_library_base")&&(this._predictBars=0)),this._setStatus(l.STATUS_LOADING))))},l.prototype.bindStyleChange=function(){var t=this;["candleStyle","hollowCandleStyle","haStyle","barStyle","lineStyle","areaStyle","renkoStyle","pbStyle","kagiStyle","pnfStyle"].forEach(function(e){t._properties[e].listeners().subscribe(t,l.prototype.invalidateBarStylesCache)})},l.prototype.bindJapChartsInputs=function(){this._properties.style.listeners().subscribe(this,this.onChartStyleChanged),this._properties.renkoStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.renkoStyle.inputs.wicks.listeners().subscribe(this,this.onInputChanged),this._properties.pbStyle.inputs.lb.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.kagiStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.boxSize.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.reversalAmount.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.sources.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.style.listeners().subscribe(this,this.onInputChanged),this._properties.pnfStyle.inputs.atrLength.listeners().subscribe(this,this.onInputChanged)},l.prototype.createExtendedHoursProperty=function(){function t(){var t="undefined"!=typeof ProductFeatures&&T.enabled(ProductFeatures.EXTENDED_SESSION),i=e.model().readOnly(),o=e._properties.extendedHours.value(),n=T.enabled("widget");!o||n||i||t||(e._extendedHoursNotPermitted.fire(),o=!1),o&&!e.isIntradayInterval()&&(o=!1),e.extendedHours.setValue(o)}var e=this;e.extendedHours=new n,e._properties.extendedHours.listeners().subscribe(null,t),e._properties.interval.listeners().subscribe(null,t),e.chartWidgetInitialized.subscribe(null,t),t()},l.prototype.isNeedRestart=function(t){if(void 0===t&&(t=this.properties().style.value()),this._prevChartStyle!==t){
var e=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_HOLLOW_CANDLES,l.STYLE_LINE,l.STYLE_AREA,l.STYLE_BASELINE];if(!(e.indexOf(this._prevChartStyle)>-1&&e.indexOf(t)>-1))return!0}return!1},l.prototype.onChartStyleChanged=function(){this._updateBarFunction(),this.isNeedRestart()&&(this.data().clear(),this.model().timeScale().scrollToRealtime(!1),this.restart()),this._prevChartStyle=this.properties().style.value(),this._onStyleChanged.fire(this.properties().style.value()),this.invalidateBarStylesCache()},l.prototype.barFunction=function(){return this._barFunction},l.prototype._updateBarFunction=function(){var t="close";switch(this._properties.style.value()){case l.STYLE_LINE:t=this._properties.lineStyle.priceSource.value();break;case l.STYLE_AREA:t=this._properties.areaStyle.priceSource.value();break;case l.STYLE_BASELINE:t=this._properties.baselineStyle.priceSource.value()}this._barFunction=J.barFunction(t)},l.prototype.style=function(){return this.properties().style.value()},l.prototype.isJapaneseStyle=function(){return J.isJapaneseStyle(this.style())},l.prototype.onInputChanged=function(){this.restart()},l.prototype.onExtendedHoursChanged=function(){return this._extendedHoursChanged},l.prototype.getSymbolString=function(){var t,e,i;return t=T.enabled("pay_attention_to_ticker_not_symbol")&&this._symbolInfo?this._symbolInfo.ticker:this.actualSymbol(),this.extendedHours.value()&&(t={symbol:t,session:"extended"}),l.SYMBOL_STRING_DATA.hasOwnProperty(this._properties.style.value())&&(e=this.styleStudyInfo(this.getStyleShortName()+"Style").studyId,i=this.getInputsProperties(),t={symbol:t,type:e+"!",inputs:i.state()}),"string"!=typeof t&&(t="="+JSON.stringify(t)),t},l.prototype._getResolvingSymbolString=function(){return this.getSymbolString()},l.prototype.getStyleShortName=function(){var t=this._properties.style.value();if(l.STYLE_SHORT_NAMES.hasOwnProperty(t))return l.STYLE_SHORT_NAMES[t];throw Error("Missed short name for style "+t)},l.prototype.getStyleProperties=function(){return this._properties[this.getStyleShortName()+"Style"]},l.prototype.getInputsProperties=function(){return this.getStyleProperties().inputs||new n},l.prototype.getRealVisibleRange=function(){var t,e,i=this.model().timeScale().visibleBars();return null===i?null:(t=this.data().search(i.firstBar(),N.NearestRight),e=this.data().search(i.lastBar(),N.NearestLeft),null===t||null===e?null:new x(t.index,e.index))},l.prototype.firstValue=function(){var t=this.firstBar();return null===t?null:this._barFunction(t)},l.prototype.firstBar=function(){var t,e,i=this.model().timeScale().visibleBars();return null===i?null:(t=i.firstBar(),e=this.data().search(t,N.NearestRight),null!==e?e.value:null)},l.prototype.sessionsStudy=function(){var t,e,i,o;if(this._sessionsStudy)return this._sessionsStudy;for(t=this.model().paneForSource(this),e=t.dataSources(),i=0;i<e.length;i++)if((o=e[i])instanceof TradingView.Study&&"Sessions"===o.metaInfo().shortId)return this._sessionsStudy=o,this._sessionsStudy;return!1},l.prototype.clearSessionStudy=function(){this._sessionsStudy=null},
l.prototype.createSessStudy=function(){if(!this.sessionsStudy()){var t=$.findStudyMetaInfo(this.model().studiesMetaData(),"Sessions@tv-basicstudies");this.model().insertStudy(t,!1,!0),this._onSessionsStudyCreated.fire()}},l.prototype.checkSessStudy=function(){T.enabled("charting_library_base")||(this.sessionsStudy()||this.createSessStudy(),this.sessionsStudy().start())},l.prototype.isSpread=function(){return"spread"===this._symbolInfo.type},l.prototype.firstSymbol=function(){return this._symbolInfo?this._symbolInfo.legs[0]:""},l.prototype.firstShortName=function(){return R.ticker(this.firstSymbol())},l.prototype.onSessionsStudyCreated=function(){return this._onSessionsStudyCreated},l.prototype.loadDataTo=function(t){this._turnaround="s"+ ++this._turnaroundCounter;var e=this._properties.interval.value();e=this._generateTimeframe(e,t),this._chartApi.modifySeries(this._seriesId,this._turnaround,this._symbolId,e,this._handler)},l.prototype.checkInterval=function(){if(this._symbolInfo&&(E.kind(this.interval())!==E.MINUTES||this._symbolInfo.has_intraday||this.requestingIntradayWhenNotSupported.fire(),this._symbolInfo.hasOwnProperty("supported_resolutions"))){var t=E.normalize(this._properties.interval.value());-1===this._symbolInfo.supported_resolutions.indexOf(t)&&this.requestingResolutionWhenNotSupported.fire(this._symbolInfo.supported_resolutions[0])}},l.prototype.priceScale=function(){return this.m_priceScale},l.prototype.setPriceScale=function(t){this.m_priceScale!==t&&(this.m_priceScale=t,this.priceScaleChanged.fire(t))},l.prototype.setGotoDateResult=function(t){this._gotoDateResult=t},l.prototype.gotoDateResult=function(){return this._gotoDateResult},l.prototype.syncModel=function(){var t,e;if(!this._syncModel){if(t=this.symbolInfo(),e=this.interval(),!t||!e)return null;this._syncModel=new H(t,e)}return this._syncModel};l.prototype.turnaround=function(){return this._turnaround},l.prototype.getStylesPropertyPage=function(){return T.enabled("show_chart_property_page")?C.ChartStylesPropertyPage:null},l.prototype.getSourceIcon=function(){return{type:"svg",svgCode:X[this.properties().style.value()]}},l.prototype.isStyleSupported=function(t){return!0},l.prototype._onBeforeModifySeries=function(t,e){},l.prototype._isExtendedHoursAllowed=function(){return this._symbolInfo&&-1!==["stock","index","futures"].indexOf(this._symbolInfo.type)},l.prototype.destroy=function(){this._unsubscribeQuoteSession()},TradingView.Series=l,t.exports=l}).call(e,i(10),i(17),i(25),i(73))},,,,,,,function(t,e,i){"use strict";function o(t,e){var o,n,r,a,l,c,h,u,d;if(!t)throw Error("No studies metainfo");if(o=i(301),this._studiesMetainfo=t,!e)throw Error("No studies migrations");for(this._studiesMigrations=e,this._migrations={},n=0;n<this._studiesMigrations.length;n++)for(r=this._studiesMigrations[n],a=r.versFrom,l=r.versTo,c=0;c<r.studyMigrations.length;c++)h=r.studyMigrations[c],u=h.studyId,0!==h.rules.length?(d=u in this._migrations?this._migrations[u]:new o(u),d.addMigration(a,l,h.rules),
this._migrations[u]=d):s.logError("Study Migration should have at least one convertion rule");this._clientMigrations=[function(t,e){var i,o,n,r,s;if(0===this._studiesMetainfo.length||!t.isTVScript||t.version>=22)return e;for(i={},o=0,n=0;void 0!==(r=e[n]);)s=e[r.id],r.isFake&&(r.id="in_"+o++),i[n]=r,i[r.id]=s,n++;return i}]}var n=i(9).assert,r=i(300).Version,s=i(7).getLogger("Chart.Study.Versioning"),a=i(600),l=i(33);o.prototype.updateMetaInfo=function(t){var e,i,o;if(!t)return t;for(n(!t.isTVScript,"This method should update only built-in java indicators metaInfo. For Pine indicators use updateMetaInfoAsync"),e=null,i=this._studiesMetainfo,o=0;o<i.length;o++)if(i[o].id===t.id){e=i[o];break}return TradingView.clone(e)},o.prototype.updateMetaInfoAsync=function(t,e){var i,o,n,r,s,a=$.Deferred(),c=a.promise();if(!t)return a.reject("No old metaInfo was given"),c;if(e)return a.resolve(null),c;if(i=t.isTVScript&&t.scriptIdPart&&TVScript.pineType(t.scriptIdPart)===TVScript.PineType.Addon,o=l.versionOf(t),t.isTVScript&&!t.pine&&!i&&o<l.VERSION_PINE_PROTECT_TV_4164);else if((t.isTVScript||t.isTVScriptStubToCompile)&&t.pine&&!i);else{for(n=null,r=this._studiesMetainfo,s=0;s<r.length;s++)if(r[s].id===t.id){n=r[s];break}n?a.resolve(TradingView.clone(n)):a.resolve(null)}return c},o.prototype.updateStudyInputs=function(t,e,i,o,n){var a,l,c,h,u,d,p=TradingView.clone(o);if(t in this._migrations&&(a=r.parse(e),l=r.parse(i),c=this._migrations[t],h=c.updateInputs(a,l,p),p=h),null==n)return p;for(u in n)u in p||(p[u]=n[u]);for(u in p)u in n||(d=p[u],s.logWarn("Extra input detected, studyId="+t+", versionFrom="+e+", inputId="+u+", inputValue="+d+", removing it and continue..."),delete p[u]);return p},o.prototype.updateStudyState=function(t,e,i){var o,n,r,a,c,h,u,d,p,_,f,m,g,v;if(null==t||null==e||null==i)return t;for(t=TradingView.clone(t),o=e.isTVScript||!!e.pine,o||e.version===i.version||(n=i&&i.defaults.inputs,r=this.updateStudyInputs(e.id,e.version,i.version,t.inputs,n),t.inputs=r),a=0;a<this._clientMigrations.length;++a)r=this._clientMigrations[a].call(this,e,t.inputs),Object.keys(r).length===Object.keys(t.inputs).length?t.inputs=r:s.logWarn("StudyVersioning._clientMigrations application returned bad result. Skipping it...");if(c=l.versionOf(e),e.isTVScript&&e.TVScriptSourceCode&&c>=12&&c<=26){for(h={},a=0;a<e.plots.length;++a)u=e.plots[a],d=i.plots[a],h[u.id]=d.id;for(p=Object.keys(t.styles),a=0;a<p.length;++a)_=p[a],f=t.styles[_],delete t.styles[_],m=h[_],t.styles[m]=f;for(g=Object.keys(t.plots),a=0;a<g.length;++a)v=g[a],_=t.plots[v].id,t.plots[v].id=h[_]}return t},o.prototype.patchPointsBasedStudyState=function(t){return o._fixInputsMaxValue(t.state,t.metaInfo),t},o.prototype.patchPointsBasedStudyData=function(t,e){if(!a.isProd())return e;if(!t||!e)return e;var i=TradingView.clone(e);return"VbPFixed@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,i),i},o.prototype.patchStudyData=function(t,e,i,n){var r,s,c,h,u,d,p;if(!a.isProd())return{data:e,nsData:i,indexes:n};if(r=TradingView.clone(e),
s=TradingView.clone(i),c=TradingView.clone(n),"VbPVisible@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,r.graphics),"VbPSessions@tv-volumebyprice"===t.id&&t.version&&t.version<=4&&o._patchOldVolumeProfiles(0,r.graphics),h=l.versionOf(t),t.isTVScript&&t.TVScriptSourceCode&&h>=12&&h<=26)for(u=r.columns,r.columns=[],d=0;d<u.length;++d)p="plot_"+d,r.columns.push(p);return{data:r,nsData:s,indexes:c}},o._patchOldVolumeProfiles=function(t,e){var i,o=e.hhists[t].data,n=[];for(i in o)n=n.concat(o[i]);e.hhists[0].data=n},o._fixInputsOrder=function(t,e){var i,n,r,s,a=l.getOrderedInputIds(e),c=o.splitInputs(t.inputs),h=c.arr,u=c.obj,d=TradingView.merge({},u);for(i=0;i<a.length;++i)n=a[i],null!==(r=o.findInputKeyById(h,n))&&(s=h[r],d[i]=s);t.inputs=d},o.INPUT_MAX_VALUE=1e12,o._verifyInputsMaxValue=function(t){var e,i,n=o.INPUT_MAX_VALUE;if(t.inputs)for(e=0;e<t.inputs.length;e++)i=t.inputs[e],"integer"===i.type&&i.max&&i.max>n&&s.logWarn("Bad integer input max value in metaInfo id="+t.id+" title="+t.description)},o._fixInputsMaxValue=function(t,e){var i,n,r,s,a,l;if(!TradingView.isAbsent(e)){if(i=o.INPUT_MAX_VALUE,e.inputs)for(n=0;n<e.inputs.length;n++)r=e.inputs[n],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);if(t&&t.inputs){s=o.splitInputs(t.inputs),a=s.arr;for(l in a)r=a[l],"integer"===r.type&&r.max&&r.max>i&&(r.max=i);t.inputs=TradingView.merge(s.obj,s.arr)}}},o.prototype.patchPropsStateAndMetaInfo=function(t,e,i){var n,r,s,a,c,h,u,d,p,_,f,m,g,v,y,b,S,w;if("Script$BOOKER"!==e.productId||e.alerts||delete t.alerts,o._fixInputsOrder(t,e),o._fixInputsMaxValue(t,e),n=o.splitInputs(t.inputs),t.inputs=n.obj,l.versionOf(e)<l.METAINFO_FORMAT_VERSION_SOS_V2&&e.isChildStudy&&(t.isChildStudy=e.isChildStudy),r=60,e.isTVScript&&e.version<r&&("Script$TV_EARNINGS@tv-scripting"!==e.id&&"Script$TV_DIVIDENDS@tv-scripting"!==e.id&&"Script$TV_SPLITS@tv-scripting"!==e.id||delete e.TVScriptSourceCode),"Volume"!==e.id&&"Volume@tv-basicstudies"!==e.id||0!==e.inputs.length||(e.inputs=[{id:"length",type:"integer",defval:20,min:1,max:1e3}],e.plots.push({id:"vol_ma",type:"line"})),"Volume@tv-basicstudies"===e.id&&e.version&&e.version<=46&&(t.styles.vol.transparency=t.transparency||87),"PivotPointsStandard@tv-basicstudies"===e.id&&(0===e.inputs.length?(t.inputs={kind:"Traditional",showHistoricalPivots:!0},e.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]):1===e.inputs.length&&(t.inputs={kind:"Traditional"},e.inputs=[{defval:"Traditional",id:"kind",type:"text",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"]},{id:"showHistoricalPivots",type:"bool",defval:!0}]),void 0===t._hardCodedDefaultsVersion&&(t._hardCodedDefaultsVersion=1,s=t.color,delete t.color,t.levelsStyle={colors:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}})),"CMF"===e.shortId&&2===e.inputs.length&&(t.inputs={length:t.inputs["length fast"]},e.inputs=e.inputs.splice(0,1),e.inputs[0].id="length"),
e.defaults&&void 0===e.defaults.precision&&(-1!==["Volume@tv-basicstudies","VbPVisible@tv-volumebyprice","VbPSessions@tv-volumebyprice"].indexOf(e.id)?e.defaults.precision=0:e.defaults.precision=4),a=60,e.version<a)for(c=["TV_DIVIDENDS","TV_SPLITS","TV_EARNINGS"],h=6,u=0;u<c.length;u++)e.id.startsWith("Script$"+c[u]+"@tv-scripting")&&(e.fullId="ESD"+e.fullId.substring(h),e.id="ESD"+e.id.substring(h),e.name="ESD"+e.name.substring(h),e.shortId="ESD"+e.shortId.substring(h),e.productId="ESD"+e.productId.substring(h));if(l.versionOf(e)<l.VERSION_PINE_PROTECT_TV_4164&&(d={"StrategyScript$STD;Consecutive%1Ups/Downs%1Strategy":{pineId:"STD;Consecutive%1Ups%1Downs%1Strategy",className:"StrategyScript"},Script$EDGR_NET_INCOME_FROM_CONTINUING_OPERATIONS_APPLICABLE_TO_COMMON_V2:{pineId:"Script$EDGR_NET_INCOME_FROM_CONTINUING_OPS_APPLICABLE_TO_COMMON_V2",className:"Script"}},e.shortId in d&&(p=d[e.shortId].className+"$"+d[e.shortId].pineId,_={scriptIdPart:d[e.shortId].pineId,fullId:e.fullId.replace(e.shortId,p),id:e.id.replace(e.shortId,p),name:e.name.replace(e.shortId,p),shortId:p},TradingView.merge(e,_),TradingView.merge(t,_)),f=TradingView.StudyMetaInfo.cutScriptIdPart(e.fullId),(m=f.match(/^(USER)(_\d+)(;)(.*)$/))&&(g=m[0],v=m[1]+m[3]+m[2]+m[4],_={scriptIdPart:v,fullId:e.fullId.replace(g,v),id:e.id.replace(g,v),name:e.name.replace(g,v),shortId:e.shortId.replace(g,v)},TradingView.merge(e,_),TradingView.merge(t,_))),"MA"===e.id){switch(y=new l({id:"MAExp",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgExp",type:"line"}],palettes:{}}),b=new l({id:"MASimple",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgSimple",type:"line"}],palettes:{}}),S=new l({id:"MAVolumeWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgVolumeWeighted",type:"line"}],palettes:{}}),w=new l({id:"MAWeighted",properties:[{id:"is_price_study",type:"bool",value:"true"}],inputs:[{id:"length",type:"integer",defval:20,min:1,max:500},{id:"source",type:"text",defval:"close",options:["open","high","low","close"]}],plots:[{id:"MovAvgWeighted",type:"line"}],palettes:{}}),t.inputs.type){case"exp":e=y;break;case"simple":e=b;break;case"weighted":e=w;break;case"volume weighted":e=S}t.styles[e.plots[0].id]=t.styles.MovAvg,delete t.styles.MovAvg,delete t.inputs.type}return i.oldShowStudyLastValueProperty&&(t.oldShowLastValue=t.showLastValue),delete t.showLastValue,delete t.showStudyArguments,{propsState:t,metaInfo:e}},o.isVersionTesting=function(t){var e;return!!t&&(t=""+t,e=RegExp("\\d+.\\d+"),e.exec(t)===t)},o.isVersionHead=function(t){var e;return!!t&&(t=""+t,
e=RegExp("\\d+"),e.exec(t)===t)},o.mergeInputs=function(t,e){o.mergeInputsArrPart(t,e),o.mergeInputsObjPart(t,e)},o.mergeInputsArrPart=function(t,e){var i,n,r=o.splitInputs(e);for(i in r.arr)n=o.findInputKeyById(t,r.arr[i].id),n?TradingView.merge(t[n],r.arr[i]):o.appendInputInfoToArr(t,r.arr[i])},o.mergeInputsObjPart=function(t,e){var i=o.splitInputs(e);TradingView.merge(t,i.obj)},o.appendInputInfoToArr=function(t,e){var i,o,n=-1;for(i in t)o=parseInt(i,10),isNumber(o)&&o>n&&(n=o);t[n+1]=e},o.splitInputs=function(t){var e,i={},o={};for(e in t)isNumber(parseInt(e,10))?i[e]=t[e]:o[e]=t[e];return{arr:i,obj:o}},o.findInputKeyById=function(t,e){var i,o=null;for(i in t)if(isNumber(parseInt(i,10))&&t[i].id===e){o=i;break}return o},o.getInputKeyById=function(t,e){var i=o.findInputKeyById(t,e);if(!i)throw Error("Cannot find input with id: "+e);return i},t.exports=o},function(t,e,i){"use strict";function o(){v.fire()}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),i(43),r=i(2),s=i(39),a=i(83),l=i(14),c=i(10),h=i(374),u=i(718),d=i(719),function(t){t[t.ToLeft=0]="ToLeft",t[t.ToRight=1]="ToRight",t[t.None=2]="None"}(p=e.DirectionHorz||(e.DirectionHorz={})),function(t){t[t.ToTop=0]="ToTop",t[t.ToBottom=1]="ToBottom",t[t.None=2]="None"}(_=e.DirectionVert||(e.DirectionVert={})),f=p.ToRight,m=_.ToBottom,g=5,v=new c,e.globalClosePopupMenu=o,y=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClose=function(){i.props.onClose()},i._handleClickOutside=function(t){var e=i.props,o=e.closeOnClickOutside,n=e.onClickOutside,r=e.doNotCloseOn;n&&n(t),!o||void 0!==r&&s.findDOMNode(r).contains(t.target)||i._handleClose()},i._handleMeasure=function(t){var e,o,n=t.height,r=t.width,s=i.props,a=s.directionHorz,l=void 0===a?f:a,c=s.directionVert,h=void 0===c?m:c,u=s.position,d=s.positionType,v=window.innerHeight,y=window.innerWidth,b=v-2*g,S="function"==typeof u?u(r,n):u;"fixed"===d?(e=Math.max(g,S.x-Math.max(0,r-(l===p.ToLeft?0:y-S.x-g))),o=Math.max(g,S.y-Math.max(0,n-(h===_.ToTop?0:v-S.y-g)))):(e=S.x-(l===p.ToLeft?r:0),o=S.y-(h===_.ToTop?n:0)),i.setState({appearingContentHeight:n,appearingDirectionHorz:l,appearingDirectionVert:n>b?_.None:h,appearingMenuHeight:n>=b?b:void 0,appearingMenuWidth:S.overrideWidth,appearingPosition:{x:e,y:o},isMeasureValid:!0})},i.state={appearingContentHeight:0},i}return n.__extends(e,t),e.prototype.componentWillReceiveProps=function(t){this.props.isOpened&&!t.isOpened&&this.setState({isMeasureValid:void 0})},e.prototype.componentDidUpdate=function(t,e){t.isOpened&&!this.props.isOpened&&v.unsubscribe(this,this._handleClose),!t.isOpened&&this.props.isOpened&&v.subscribe(this,this._handleClose)},e.prototype.componentWillUnmount=function(){v.unsubscribe(this,this._handleClose)},e.prototype.render=function(){var t,e=this.props,i=e.children,o=e.isOpened,n=e.minWidth,s=e.positionType,c=e.theme,u=void 0===c?d:c,p=e.className,_=this.state,f=_.appearingMenuHeight,m=_.appearingMenuWidth,g=_.appearingPosition,v=_.isMeasureValid
;return o?this._wrapOrNot(r.createElement(h.OutsideEvent,{handler:this._handleClickOutside,mouseDown:!0,touchStart:!0,ctor:"div"},r.createElement("div",{className:l(p,u.menuWrap,(t={},t[u.isMeasuring]=!v,t)),style:{height:f,left:g&&g.x,minWidth:n,position:s,top:g&&g.y,width:m}},r.createElement("div",{className:u.scrollWrap},r.createElement(a,{onMeasure:this._handleMeasure,shouldMeasure:!v,whitelist:["height","width"]},r.createElement("div",{className:u.menuBox},i)))))):null},e.prototype._wrapOrNot=function(t){return"fixed"===this.props.positionType?r.createElement(u.OutsideRenderWrap,null,t):t},e.defaultProps={closeOnClickOutside:!0,directionHorz:f,directionVert:m,positionType:"fixed"},e}(r.PureComponent),e.PopupMenu=y},function(t,e,i){"use strict";function o(t,e){return t<e}function n(t,e,i,o,n){var r,s,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),r=n-o;0<r;)s=r>>1,a=o+s,i(t[a],e)?(o=a+1,r-=s+1):r=s;return o}function r(t,e,i,r){return void 0===i&&(i=0),void 0===r&&(r=t.length),n(t,e,o,i,r)}function s(t,e,i,o,n){var r,s,a;for(void 0===o&&(o=0),void 0===n&&(n=t.length),r=n-o;0<r;)s=r>>1,a=o+s,i(e,t[a])?r=s:(o=a+1,r-=s+1);return o}function a(t,e,i,n){return void 0===i&&(i=0),void 0===n&&(n=t.length),s(t,e,o,i,n)}function l(t,e,i,o,n){var r,s;for(void 0===o&&(o=0),void 0===n&&(n=t.length-1);o<=n;)if(r=o+n>>>1,(s=i(t[r],e))>0)o=r+1;else{if(!(s<0))return r;n=r-1}return-1}Object.defineProperty(e,"__esModule",{value:!0}),e.lowerbound=n,e.lowerbound_int=r,e.upperbound=s,e.upperbound_int=a,e.bSearch=l},function(t,e,i){"use strict";function o(t,e,i,o){var n,r;for(this.m_study=t,this.m_series=e,this.m_model=i,this._plotName=o,this.m_items=[],this._invalidated=!0,this._isMarkersEnabled=j.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._plotIndex=0,r=0;r<n.length;r++)n[r].id===this._plotName&&(this._plotIndex=r),this.m_study.isSelfColorerPlot(r)&&n[r].target===this._plotName&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[n[r].palette],this._paletterProps=this.m_study.properties().palettes[n[r].palette])}function n(t,e,i,o){var n,r;for(this._study=t,this._series=e,this._model=i,this._plotName=o,this._items=[],this._invalidated=!0,this._isMarkersEnabled=j.enabled("source_selection_markers"),n=this._study.metaInfo().plots,r=0;r<n.length;r++)n[r].id===this._plotName&&(this._plotIndex=r,d(this._study.isBgColorerPlot(r),"Plot '"+this._plotName+"' is not a background colorer!"))}function r(t,e,i,o){var n,r;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_items=[],this.m_invalidated=!0,this._isMarkersEnabled=j.enabled("source_selection_markers"),this.m_selectionData=null,this.m_plotIndex=null,n=this.m_study.metaInfo().plots,r=0;r<n.length;r++)if(n[r].id===this.m_plotName){this.m_plotIndex=r;break}for(n=this.m_study.metaInfo().plots,this._colorer=null,this._textColorer=null,this._palette=null,this._textPalette=null,this._paletterProps=null,this._textPaletterProps=null,this._plotIndex=0,
r=0;r<n.length;r++)n[r].id===this.m_plotName&&(this._plotIndex=r),this.m_study.isSelfColorerPlot(r)&&n[r].target===this.m_plotName&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[n[r].palette],this._paletterProps=this.m_study.properties().palettes[n[r].palette]),this.m_study.isTextColorerPlot(r)&&n[r].target===this.m_plotName&&(this._textColorer=r,this._textPalette=this.m_study.metaInfo().palettes[n[r].palette],this._textPaletterProps=this.m_study.properties().palettes[n[r].palette])}function s(t,e,i,o){r.call(this,t,e,i,o)}function a(t,e,i,o){s.call(this,t,e,i,o)}function l(t,e,i,o){r.call(this,t,e,i,o),this._maxAbsValue=0}function c(t,e,i,o){var n,r;for(this.m_study=t,this.m_series=e,this.m_model=i,this.m_plotName=o,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=j.enabled("source_selection_markers"),n=this.m_study.metaInfo().plots,this._colorer=null,this._palette=null,this._paletterProps=null,this._ohlcPlotIndexes={},r=0;r<n.length;r++)n[r].target===this.m_plotName&&(this.m_study.isOHLCOpenPlot(r)&&(this._ohlcPlotIndexes[TradingView.OPEN_PLOT]=r),this.m_study.isOHLCHighPlot(r)&&(this._ohlcPlotIndexes[TradingView.HIGH_PLOT]=r),this.m_study.isOHLCLowPlot(r)&&(this._ohlcPlotIndexes[TradingView.LOW_PLOT]=r),this.m_study.isOHLCClosePlot(r)&&(this._ohlcPlotIndexes[TradingView.CLOSE_PLOT]=r),this.m_study.isOHLCColorerPlot(r)&&(this._colorer=r,this._palette=this.m_study.metaInfo().palettes[n[r].palette],this._paletterProps=this.m_study.properties().palettes[n[r].palette]))}function h(t,e,i,o){c.call(this,t,e,i,o)}function u(t,e,i,o){c.call(this,t,e,i,o)}var d=i(9).assert,p=i(8).Point,_=i(32),f=_.rgbToHsl,m=_.hslToRgb,g=_.rgbToHexString,v=_.parseRgb,y=_.parseRgba,b=i(11),S=i(131),w=S.SelectionRenderer,T=S.SelectionRendererArrowsUpDown,C=i(325).PaneRendererBars,x=i(789).PaneRendererHistogram,P=i(790).PaneRendererColumns,L=i(176).PaneRendererLine,I=i(326).PaneRendererArea,k=i(247).PaneRendererCandles,A=i(791).PaneRendererCross,M=i(792).PaneRendererCircles,E=i(218).PaneRendererArrowsUpDownItem,D=i(218).PaneRendererArrowsUpDown,V=i(399).PaneRendererUnicodeChar,O=i(793).PaneRendererBackground,R=i(794).PaneRendererStepLine,B=i(327),z=i(53).CompositeRenderer,F=i(328),N=i(54).clamp,W=i(111),$=i(795),H=i(30),U=i(19).PlotRowSearchMode,j=i(5);i(796),i(797),i(798),i(799),i(800),i(801),i(802),i(803),i(804),o.isIndexValid=function(t,e){return null!==t&&t>=0&&t<e._length()},o.prototype.items=function(){return this.m_items},o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,n,r,s,a,l,c,h,u,d,_,f,m,g,v,y,S,w,T,C,x,P,L,I,k;if(this._histogramBase=null,this.m_items=[],!(this.m_model.timeScale().isEmpty()||this.m_study.priceScale().isEmpty()||null===(t=this.m_model.timeScale().visibleBars())||(e=this.m_series.nearestIndex(t.firstBar(),U.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),U.NearestLeft),n=this.m_study.offset(this._plotName),n>0?(e-=n,i+=n):(e+=n,i-=n),(r=this.m_study.getMinFirstBarIndexForPlot(this._plotName))>i))){if(e=Math.max(r,e),
s=this.m_study.properties().styles[this._plotName],a=s.plottype.value(),l=[W.PlotType.Line,W.PlotType.Area,W.PlotType.Circles,W.PlotType.Cross].indexOf(a)>=0,c=this.m_study.data(),h=this.m_study.firstValue(),l&&c._length()>0){for(u=c._bsearch(e);o.isIndexValid(u,c)&&void 0===c._valueAt(u)[this._plotIndex+1];)u-=1;for(e=o.isIndexValid(u,c)?c._indexAt(u):e,d=c._bsearch(i);o.isIndexValid(d,c)&&void 0===c._valueAt(d)[this._plotIndex+1];)d+=1;i=o.isIndexValid(d,c)?c._indexAt(d):i}if(_=c.range(e,i),f=this.m_study.priceScale(),m=f.properties().percentage.value(),g=N(this._getTranspValue(),0,100),v={},y=function(t,e){var i=t+"@"+e;return v[i]||(this._plotName&&"vol"===this._plotName?v[i]=H.generateColor(t,e):v[i]=H.generateColor(t,e,!0)),v[i]}.bind(this),_.each(function(t,e){var i,o,r,a,c,u,d,_,f;return t+=n,t=Math.floor(t),i=e[this._plotIndex+1],o=void 0===i||null===i,i=o?NaN:i,m&&!o&&(i=100*(i-h)/h),(!l||!o)&&(r=new p(t,i),a=void 0!==e[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&a&&(i=e[this._colorer+1],r.style={},null!=i?(c=this._palette.valToIndex?this._palette.valToIndex[i]:i,u=this._paletterProps.colors[c],d=u.color.value(),r.style.color=H.isHexColor(d)?y(d,g):d):(d=s.color.value(),r.style.color=y(d,100)),_=void 0!==c?u.width.value():s.linewidth.value(),f=void 0!==c?u.style.value():s.linestyle.value(),r.style.width=_,r.style.style=f),this.m_items.push(r),!1)}.bind(this)),f.pricesToCoordinates(this.m_items),this.m_model.timeScale().indexesToCoordinates(this.m_items),s.histogramBase&&(this._histogramBase=this.m_study.priceScale().priceToCoordinate(s.histogramBase.value())),this.m_study===this.m_model.selectedSource())for(S=F(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=b.REGULAR,w=0;w<S.length;w++)T=S[w],C=this.m_study.data().valueAt(T),T+=n,null!==C&&(x=C[this._plotIndex+1],f.isPercentage()&&(x=100*(x-h)/h),P=this.m_model.timeScale().indexToCoordinate(Math.floor(T)),L=this.m_study.priceScale().priceToCoordinate(x),this._selectionData.points.push(new p(P,L)));I=s,this._lineColor=H.generateColor(I.color.value(),g),this._lineWidth=I.linewidth.value(),k=I.color.value(),this._colorer&&null!=(x=this._paletterProps.colors[0])&&(k=x.color.value(),this._lineWidth=x.width.value(),this._lineColor=H.generateColor(x.color.value(),g)),this._color2=H.generateColor(k,g),this._color1=H.generateColor(o.addHueForColor(k),g)}},o.addHueForColor=$(function(t){var e=f(v(t)),i=e[0]+.05;return e[0]=i-Math.floor(i),g(m(e))}),o.prototype._getTranspValue=function(){var t=this.m_study.properties(),e=t.styles[this._plotName],i=0,o=0,n=this.m_study.metaInfo();return"Volume@tv-basicstudies"===n.id&&n.version<=46&&"transparency"in t?(i=t.transparency.value(),i=isNumber(i)?i:o):(e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:o),i)},o.prototype.renderer=function(){var t,e,i,o,n,r=this.m_study.properties().styles[this._plotName];if(r.visible.value()&&this.m_study.priceScale()){switch(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},
t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.histogramBase=this._histogramBase?this._histogramBase:this.m_study.priceScale().height(),t.lineIndex=0,t.lineStyle=r.linestyle.value(),t.lineColor=this._lineColor,t.lineWidth=this._lineWidth,t.lineWidth=isNumber(t.lineWidth)?t.lineWidth:1,t.color1=this._color1,t.color2=this._color2,t.bottom=t.histogramBase,this._colorer||(t.simpleMode=!0),e=new z,i=!!r.joinPoints&&r.joinPoints.value(),r.plottype.value()){case W.PlotType.Line:case W.PlotType.LineWithBreaks:e.append(new L(t));break;case W.PlotType.Area:case W.PlotType.AreaWithBreaks:e.append(new I(t));break;case W.PlotType.Histogram:e.append(new x(t));break;case W.PlotType.Columns:e.append(new P(t));break;case W.PlotType.Cross:e.append(new A(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.forceLineWidth=!0,e.append(new L(o)));break;case W.PlotType.Circles:e.append(new M(t)),i&&(o=TradingView.merge({},t),o.lineWidth=1,o.ignorePaletteLineWidth=!0,e.append(new L(o)));break;case W.PlotType.StepLine:n=new R,n.setData(t),e.append(n);break;default:e.append(new L(t))}return this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new w(this._selectionData)),e}},n.prototype.items=function(){return this._items},n.prototype.update=function(){this._invalidated=!0},n.prototype._scalesReady=function(){var t=this._model.timeScale(),e=this._study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},n.prototype._getTranspValue=function(){var t=this._study.properties(),e=t.styles[this._plotName],i=0;return e.transparency&&(i=e.transparency.value(),i=isNumber(i)?i:40),i},n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,_;this._items=[],d(this._scalesReady(),"Scales must be ready!"),null!==(t=this._model.timeScale().visibleBars())&&(e=this._study.metaInfo().plots,i=e[this._plotIndex].palette,o=this._study.properties().palettes[i],n=o.colors,r=this._study.metaInfo().palettes[i],s=this._getTranspValue(),a=this._series.nearestIndex(t.firstBar(),U.NearestRight),l=this._series.nearestIndex(t.lastBar(),U.NearestLeft),c=this._study.offset(this._plotName),c>0?(a-=c,l+=c):(a+=c,l-=c),(h=this._study.getMinFirstBarIndexForPlot(this._plotName))>l||(a=Math.max(h,a),u=this._study.data(),_=u.range(a,l),_.each(function(t,e){var i,o,a,l;return t+=c,i=e[this._plotIndex+1],o=new p(Math.floor(t)-.5),a=isNumber(s)?s:50,a=Math.min(a,100),a=Math.max(a,0),null!=i?(l=r.valToIndex?r.valToIndex[i]:i,o.color=H.generateColor(n[l].color.value(),a)):o.color=null,this._items.push(o),!1}.bind(this)),this._model.timeScale().indexesToCoordinates(this._items)))},n.prototype.renderer=function(){var t,e;if(this._study.properties().styles[this._plotName].visible&&this._study.properties().styles[this._plotName].visible.value()&&this._scalesReady())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={items:this._items,y:0,h:this._study.priceScale().height(),w:Math.ceil(this._model.timeScale().barSpacing())},e=new z,e.append(new O(t)),e},r.prototype.items=function(){return this.m_items},
r.prototype.update=function(){this.m_invalidated=!0},r.prototype._scalesReady=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();return t&&e&&!t.isEmpty()&&!e.isEmpty()},r.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g;this.m_items=[],this._scalesReady()&&(t=this.m_model.timeScale(),e=this.m_study.priceScale(),null!==(i=t.visibleBars())&&(o=this.m_series.nearestIndex(i.firstBar(),U.NearestRight),n=this.m_series.nearestIndex(i.lastBar(),U.NearestLeft),r=this.m_study.offset(this.m_plotName),r>0?(o-=r,n+=r):(o+=r,n-=r),(s=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>n||(o=Math.max(s,o),a=this.m_study.data(),l=this.m_study.firstValue(),c=a.range(o,n),h=e.properties().percentage.value(),u=this._getTranspValue(),d=F(o,n),p=this.m_study===this.m_model.selectedSource(),this.m_selectionData=p?{points:[],hittestResult:b.REGULAR,vertOffset:0}:null,_=this.m_series.properties().style.value(),f=_===TradingView.Series.STYLE_LINE?"lineStyle":_===TradingView.Series.STYLE_AREA?"areaStyle":null,f?(m=this.m_series.properties()[f].priceSource.value(),g=m):(m="high",g="low"),this._topCoord=e.coordinateToPrice(e.height()*e.topMargin()),this._bottomCoord=e.coordinateToPrice(e.height()*(1-e.bottomMargin())),c.each(function(t,e){var i,o,n,s,a,c,_,f=Math.floor(t+r),v=e[this.m_plotIndex+1];return null!==v&&void 0!==v&&(i=this._createItem(f,v,m,g,h,l),void 0!==i&&null!==i?(o=void 0!==e[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&o&&(v=e[this._colorer+1],i.style={},null!=v?(s=this._palette.valToIndex?this._palette.valToIndex[v]:v,n=this._paletterProps.colors[s].color.value(),i.style.color=H.generateColor(n,u)):(n=this.m_study.properties().styles[this.m_plotName].color.value(),i.style.color=H.generateColor(n,100)),a=u>9?u-10:0,i.style.borderColor=H.generateColor(n,a)),c=void 0!==e[this._textColorer+1]||this._textPalette&&this._textPalette.addDefaultColor,this._textColorer&&c&&(v=e[this._textColorer+1],i.style||(i.style={}),null!=v?(s=this._textPalette.valToIndex?this._textPalette.valToIndex[v]:v,_=this._textPaletterProps.colors[s].color.value(),i.style.textColor=H.generateColor(_,u)):(_=this.m_study.properties().styles[this.m_plotName].textColor.value(),i.style.textColor=H.generateColor(_,100))),p&&-1!==d.indexOf(t)&&this.m_selectionData.points.push(i),this.m_items.push(i),!1):void 0)}.bind(this)),this._convertItemsToCoordinates())))},r.prototype._getSeriesVal=function(t,e){var i;t=t||"close",i=null;try{i=this.m_series[t](e)}catch(t){}return i},r.prototype._getTranspValue=function(){var t,e=0;return this.m_study.properties().transparency&&(e=this.m_study.properties().transparency.value(),e=isNumber(e)?e:50),t=this.m_study.properties().styles[this.m_plotName],t.transparency&&(e=t.transparency.value(),e=isNumber(e)?e:50),N(e,0,100)},r.prototype._createItem=function(t,e,i,o,n,r){var s,a,l,c=this.m_study.properties().styles[this.m_plotName].location.value();if(!e&&c!==CanvasEx.MARKLOC_ABSOLUTE)return null;switch(c){case CanvasEx.MARKLOC_ABOVEBAR:
if(void 0===(s=this._getSeriesVal(i,t))||null==s)return null;a=s;break;case CanvasEx.MARKLOC_BELOWBAR:if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l;break;case CanvasEx.MARKLOC_TOP:a=this._topCoord;break;case CanvasEx.MARKLOC_BOTTOM:a=this._bottomCoord;break;case CanvasEx.MARKLOC_ABSOLUTE:a=e;break;default:throw Error("Bad value: "+c)}return n&&c!==CanvasEx.MARKLOC_TOP&&c!==CanvasEx.MARKLOC_BOTTOM&&(a=100*(a-r)/r),new p(t,a)},r.prototype._convertItemsToCoordinates=function(){var t=this.m_model.timeScale(),e=this.m_study.priceScale();t.indexesToCoordinates(this.m_items),e.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e})},r.prototype._calculateVerticalOffset=function(t,e){var i=0;switch(t){case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BOTTOM:i=-e;break;case CanvasEx.MARKLOC_BELOWBAR:case CanvasEx.MARKLOC_TOP:i=e}return i},r.prototype._calculateShapeHeight=function(t,e){var i=t;switch(e){case CanvasEx.SIZE_TINY:i=.3*t;break;case CanvasEx.SIZE_SMALL:i=.6*t;break;case CanvasEx.SIZE_NORMAL:i=t;break;case CanvasEx.SIZE_LARGE:i=1.5*t;break;case CanvasEx.SIZE_HUGE:i=2*t}return i},r.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l,c;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),n=this._calculateShapeHeight(o),r=this.m_study.properties().styles[this.m_plotName].location.value(),s=this._calculateVerticalOffset(r,n+n/2),e.barSpacing=o,e.items=this.m_items,e.color=H.generateColor(this.m_study.properties().styles[this.m_plotName].color.value(),i),e.height=n,e.vertOffset=s,a=this.m_study.properties().styles[this.m_plotName].plottype.value(),l=W.plotShapesData[a],c=new z,l&&c.append(new TradingView[l.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=s,c.append(new w(this.m_selectionData))),c},inherit(s,r),s.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b=this.m_study.properties().styles[this.m_plotName];if(b.visible&&b.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),b.size?(r=b.size.value(),n=this._calculateShapeHeight(25,r)):n=Math.round(o/2),s=b.location.value(),a=H.generateColor(b.color.value(),i),l=i>19?i-10:0,c=this._calculateVerticalOffset(s,Math.round(1.5*n)),e.barSpacing=o,e.items=this.items(),e.color=a,e.borderColor=H.generateColor(b.color.value(),l),e.height=n,e.vertOffset=c,h=b.plottype.value(),u=W.plotShapesData[h],d=new z,p=b.text?b.text.value():void 0,void 0!==p&&""!==p.trim()&&(_=p.trim().replace(/\\n/gm,"\n"),_=TradingView.cleanButAmpersand(_,!0),f=!1,m=!1,g="Arial",v=12,e.textCache=new B(_,f,m,g,v),y=b.textColor?b.textColor.value():void 0,
e.textColor=y?H.generateColor(y,i):a),null!=u&&d.append(new TradingView[u.paneRendererClass](e)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=c,d.append(new w(this.m_selectionData))),d},inherit(a,s),a.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g=this.m_study.properties().styles[this.m_plotName];if(g.visible&&g.visible.value()&&this._scalesReady())return t=this.m_model.timeScale(),this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),e={},i=this._getTranspValue(),o=t.barSpacing(),g.size?(r=g.size.value(),n=this._calculateShapeHeight(50,r)):n=Math.round(o),s=g.location.value(),a=H.generateColor(g.color.value(),i),l=this._calculateVerticalOffset(s,n),e.items=this.items(),e.char=g.char.value(),e.height=n,e.vertOffset=l,e.color=a,c=new z,h=g.text?g.text.value():void 0,void 0!==h&&""!==h.trim()&&(u=h.trim().replace(/\\n/gm,"\n"),u=TradingView.cleanButAmpersand(u,!0),d=!1,p=!1,_="Arial",f=12,e.textCache=new B(u,d,p,_,f),m=g.textColor?g.textColor.value():void 0,e.textColor=m?H.generateColor(m,i):a),c.append(new V(e)),this.m_study===this.m_model.selectedSource()&&this._isMarkersEnabled&&null!==this.m_selectionData&&(this.m_selectionData.vertOffset=l,c.append(new w(this.m_selectionData))),c},inherit(l,r),l.prototype.renderer=function(){var t,e,i,o,n,r,s,a,l;if(this.m_study.properties().styles[this.m_plotName].visible&&this.m_study.properties().styles[this.m_plotName].visible.value()&&this._scalesReady())return this.m_invalidated&&(this._updateImpl(),this.m_invalidated=!1),t={},e=N(this._getTranspValue(),0,100),i=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.barSpacing=i,t.colorup=H.generateColor(this.m_study.properties().styles[this.m_plotName].colorup.value(),e),t.colordown=H.generateColor(this.m_study.properties().styles[this.m_plotName].colordown.value(),e),o=y(t.colorup),n=o?100*(1-o[3]):0,r=y(t.colordown),s=r?100*(1-r[3]):0,t.colorBorderUp=H.generateColor("#000000",n),t.colorBorderDown=H.generateColor("#000000",s),t.minHeight=this.m_study.properties().styles[this.m_plotName].minHeight.value(),t.maxHeight=this.m_study.properties().styles[this.m_plotName].maxHeight.value(),a=new z,a.append(new D(t)),this.m_study===this.m_model.selectedSource()&&null!==this.m_selectionData&&(l=this.m_selectionData,l.barSpacing=i,a.append(new T(l))),a},l.prototype._createItem=function(t,e,i,o,n,r){var s,a,l,c;if(0!==e){if(Math.abs(e)>this._maxAbsValue&&(this._maxAbsValue=Math.abs(e)),s=e>0){if(void 0===(l=this._getSeriesVal(o,t))||null==l)return null;a=l}else{if(void 0===(c=this._getSeriesVal(i,t))||null==c)return null;a=c}return n&&(a=100*(a-r)/r),new E(t,a,e,s)}},l.prototype._convertItemsToCoordinates=function(){var t,e,i,o,n,r,s,a,l,c=this.m_model.timeScale(),h=this.m_study.priceScale();for(c.indexesToCoordinates(this.m_items),h.pricesToCoordinatesEx(this.m_items,function(t){return t.y},function(t,e){t.y=e}),t=Math.abs(this.m_study.properties().styles[this.m_plotName].minHeight.value()),
e=Math.abs(this.m_study.properties().styles[this.m_plotName].maxHeight.value()),t>e&&(i=t,t=e,e=i),o=e-t,n=o/this._maxAbsValue,r=this.m_items,s=0;s<r.length;s++)a=r[s],l=Math.abs(a.height),a.height=l*n+t},c.prototype.update=function(){this._invalidated=!0},c.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,y,S,w,T,C,x;if(this.m_bars.length=0,!(this.m_model.timeScale().isEmpty()||this.m_study.priceScale().isEmpty()||null===(t=this.m_model.timeScale().visibleBars())||(e=this.m_series.nearestIndex(t.firstBar(),U.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),U.NearestLeft),(o=this.m_study.getMinFirstBarIndexForPlot(this.m_plotName))>i||(e=Math.max(o,e),n=this.m_study.data(),r=this.m_study.firstValue(),s=n.range(e,i),a=this.m_study.priceScale(),l=a.properties().percentage.value(),c=0,h=this.m_study.properties().ohlcPlots[this.m_plotName],u={},d=function(t,e){var i=t+"@"+e;return u[i]||(u[i]=H.generateColor(t,e)),u[i]},s.each(function(t,e){var i,o,n,s,a,u,p,_,y,b,S,w,T,C,x,P;for(t=Math.floor(t),i=!0,o={},n=TradingView.OPEN_PLOT;n<=TradingView.CLOSE_PLOT;++n){if(void 0===(s=e[this._ohlcPlotIndexes[n]+1])||null===s){i=!1;break}o[n]=s}return!!i&&(a=o[TradingView.OPEN_PLOT],u=o[TradingView.CLOSE_PLOT],p=Math.max(a,o[TradingView.HIGH_PLOT],o[TradingView.LOW_PLOT],u),_=Math.min(a,o[TradingView.HIGH_PLOT],o[TradingView.LOW_PLOT],u),y={},y.time=Math.round(t),l?(y.open=100*(a-r)/r,y.high=100*(p-r)/r,y.low=100*(_-r)/r,y.close=100*(u-r)/r):(y.open=a,y.high=p,y.low=_,y.close=u),b=h.color.value(),S=void 0!==e[this._colorer+1]||this._palette&&this._palette.addDefaultColor,this._colorer&&S&&null!=(s=e[this._colorer+1])&&(w=this._palette.valToIndex?this._palette.valToIndex[s]:s,T=this._paletterProps.colors[w],b=T.color.value()),y.color=d(b,c),C=f(v(b)),x=C[2]>.25?C[2]-.26:C[2]+.75,P=m(C[0],C[1],x),y.borderColor=d(g(P),c),y.hollow=null,this.m_bars.push(y),!1)}.bind(this)),a.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),this.m_study!==this.m_model.selectedSource()))))for(_=F(e,i),this._selectionData={points:[],hittestResult:b.REGULAR},y=0;y<_.length;y++)S=_[y],null!==(w=this.m_study.data().valueAt(S))&&(T=w[this._plotIndex+1],a.properties().percentage.value()&&(T=100*(T-r)/r),C=this.m_model.timeScale().indexToCoordinate(Math.floor(S)),x=this.m_study.priceScale().priceToCoordinate(T),this._selectionData.points.push(new p(C,x)))},c.prototype.items=function(){return this.m_bars},inherit(h,c),h.prototype.renderer=function(){var t,e;if(this.m_study.properties().ohlcPlots[this.m_plotName].visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new z,e.append(new C(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new w(this._selectionData)),e},inherit(u,c),u.prototype.renderer=function(){var t,e,i,o=this.m_study.properties().ohlcPlots[this.m_plotName]
;if(o.visible.value())return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=o.drawWick.value(),t.drawBorder=o.drawBorder.value(),e=o.wickColor.value(),t.borderColor=e,t.wickColor=e,i=new z,i.append(new k(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new w(this._selectionData)),i},e.StudyPaneView=o,e.StudyBackgroundPaneView=n,e.StudyPlotShapesPaneView=s,e.StudyPlotCharsPaneView=a,e.StudyPlotArrowsPaneView=l,e.StudyPlotCandlesPaneView=u,e.StudyPlotBarsPaneView=h},function(t,e,i){"use strict";function o(){this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=1,this._numericFormatter=new r,this._percentageFormatter=new n}var n=i(167).PercentageFormatter,r=i(89).NumericFormatter;o.prototype.levelsCount=function(){return 0},o.prototype.topByRow=function(t){return t*o.ROW_HEIGHT},o.prototype.rowHeight=function(t){return o.ROW_HEIGHT},o.prototype.canvas=function(){if(!this._canvas){this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._canvas.prop("width",100).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0);this._canvas.get(0).getContext("2d").font="12px Verdana"}return this._canvas},o.ROW_HEIGHT=14,o.prototype.points=function(t){return[t.points()[0],t.points()[1]]},o.prototype.startPoint=function(t,e){return e?t.points()[0]:t.points()[1]},o.prototype.priceRange=function(t,e){var i=this.points(t),o=i[0],n=i[1];return e?n.price-o.price:o.price-n.price},o.prototype.sourceIsReady=function(t){return t.points().length>=2},o.prototype._calculateWidth=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T;if(!this.sourceIsReady(t))return null;if(e=this.canvas().get(0).getContext("2d"),e.font="12px Verdana",i=!!t.properties().showPrices&&t.properties().showPrices.value(),o=!!t.properties().coeffsAsPercents&&t.properties().coeffsAsPercents.value(),n=t.properties().showCoeffs.value(),r=t.priceScale().formatter(),s=this.points(t),a=s[0],l=s[1],!a||!l)return null;if(c=!1,h=t.properties(),h.reverse&&h.reverse.value()&&(c=h.reverse.value()),u=this.priceRange(t,c),d=this.startPoint(t,c).price,t.priceScale().isPercent()&&null===(p=t.ownerSource().firstValue()))return 0;for(_=0,f=[],m=1;m<=this.levelsCount();m++)g="level"+m,v=h[g],y=v.coeff.value(),b=d+y*u,t.priceScale().isPercent()&&(b=t.priceScale().priceRange().convertToPercent(b,p)),S="",n&&(S+=o?this._percentageFormatter.format(Math.round(1e4*y)/100):this._numericFormatter.format(y)),i&&(S+="("+r.format(b)+")"),w=e.measureText(S).width,T={text:S,left:_,width:w+4},f.push(T),_+=T.width;return{totalWidth:_,cells:f}},o.prototype._effectiveState=function(t){var e,i,o,n,r,s,a={},l=t.properties();for(l.showPrices&&(a.showPrices=l.showPrices.value()),l.coeffsAsPercents&&(a.coeffsAsPercents=l.coeffsAsPercents.value()),a.showCoeffs=l.showCoeffs.value(),
t.priceScale()&&t.priceScale().formatter().state&&(a.formatter=t.priceScale().formatter().state()),l.reverse&&(a.reverse=l.reverse.value()),a.p1=t.points()[0],a.p2=t.points()[1],3===t.points().length&&(a.p3=t.points()[2]),a.items=[],e=1;e<=this.levelsCount();e++)i="level"+e,o=l[i],n=o.coeff.value(),r=o.color.value(),s={coeff:n,color:r},a.items.push(s);return a},o.prototype._findEmptyRow=function(t){for(var e,i=0;this._rowsToSources[i];)i++;return this._rowsToSources[i]=t,i>=this._actualCapacity&&(this._actualCapacity++,e=this.canvas(),TradingView.resizeCanvas(e,this._actualWidth,o.ROW_HEIGHT*this._actualCapacity)),i},o.prototype._repaintSource=function(t,e,i){var n,r,s=o.ROW_HEIGHT*i.row,a=this.canvas().get(0).getContext("2d");for(a.clearRect(0,s,this._actualWidth,o.ROW_HEIGHT),a.textBaseline="bottom",a.font="12px Verdana",s+=o.ROW_HEIGHT,n=0;n<t.cells.length;n++)r=t.cells[n],a.fillStyle=e.items[n].color,a.fillText(r.text,r.left,s)},o.prototype.removeSource=function(t){var e,i;this._sourcesToRow[t]&&(e=this._sourcesToRow[t].row,i=this.canvas().get(0).getContext("2d"),i.save(),i.clearRect(0,this.topByRow(e),this._actualWidth,o.ROW_HEIGHT),i.restore(),delete this._sourcesToRow[t],delete this._rowsToSources[e])},o.prototype._effectiveStatesEquals=function(t,e){var i,o=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.minMove!==e.minMove||(t.minMove2!==e.minMove2||(t.fractional!==e.fractional||t.fractionalLength!==e.fractionalLength)))))},n=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.index!==e.index||t.price!==e.price)))},r=function(t,e){return t.coeff!==e.coeff||t.color!==e.color};if(t&&!e)return!1;if(!t&&e)return!1;if(t.showPrices!==e.showPrices)return!1;if(t.coeffsAsPercents!==e.coeffsAsPercents)return!1;if(t.showCoeffs!==e.showCoeffs)return!1;if(t.reverse!==e.reverse)return!1;if(o(t.formatter,e.formatter))return!1;if(n(t.p1,e.p1))return!1;if(n(t.p2,e.p2))return!1;if(n(t.p3,e.p3))return!1;if(t.items.length!==e.items.length)return!1;for(i=0;i<t.items.length;i++)if(r(t.items[i],e.items[i]))return!1;return!0},o.prototype.updateSource=function(t){var e,i,n,r,s=t.properties().symbol.value();return this._currentSymbol!==s&&(this._currentSymbol=s,this._sourcesToRow={},this._rowsToSources={}),this._sourcesToRow[t.id()]||(e=this._findEmptyRow(t.id()),this._sourcesToRow[t.id()]={effectiveState:null,row:e}),i=this._sourcesToRow[t.id()].effectiveState,n=this._effectiveState(t),this._effectiveStatesEquals(i,n)||(r=this._calculateWidth(t),r?(this._sourcesToRow[t.id()].effectiveState=n,r.totalWidth>this._actualWidth&&(TradingView.resizeCanvas(this.canvas(),r.totalWidth,o.ROW_HEIGHT*this._actualCapacity),this._actualWidth=r.totalWidth),e=this._sourcesToRow[t.id()],this._repaintSource(r,n,e),this._sourcesToRow[t.id()].effectiveState=n,this._sourcesToRow[t.id()].preparedCells=r):this._sourcesToRow[t.id()].effectiveState=null),this._sourcesToRow[t.id()]},t.exports=o},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(28),n=function(){function t(t){this._precision=t}
return t.prototype.format=function(e){return(void 0!==this._precision?e.toFixed(this._precision):t.formatNoE(e)).replace(".",o.formatterOptions.decimalSign)},t.prototype.parse=function(t){var e=t.replace(o.formatterOptions.decimalSign,"."),i=parseFloat(e);return this._precision&&(i=+i.toFixed(this._precision)),i},t.formatNoE=function(t){return t>=1e-15&&t<1?t.toFixed(15).replace(/\.?0+$/,""):t+""},t}(),e.NumericFormatter=n},function(t,e,i){"use strict";var o,n,r,s;i(294),o=i(54),n=o.greaterThan,r=o.lessThan,s=window.CanvasEx=i(240),TradingView.resizeCanvas=function(t,e,i){var o,n,r,s,a,l=t.prop("height"),c=t.prop("width");l&&c&&(l/=window.hidpiCanvasRatio||1,c/=window.hidpiCanvasRatio||1,l<1&&(l=1),c<1&&(c=1),o=$("<canvas>").prop("width",c).prop("height",l),n=o.get(0).getContext("2d"),r=Math.min(c,e),s=Math.min(l,i),r&&s&&n.drawImage(t.get(0),0,0,r,s,0,0,r,s),t.prop("height",i).prop("width",e),a=t.get(0).getContext("2d"),r&&s&&a.drawImage(o.get(0),0,0,r,s,0,0,r,s),o.remove())},s.computeDashPattern=function(t){return[[t.lineWidth,2*t.lineWidth],[5*t.lineWidth,6*t.lineWidth],[6*t.lineWidth,6*t.lineWidth],[t.lineWidth,4*t.lineWidth]][t.lineStyle-1]},s.drawLine=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.lineStyle===s.LINESTYLE_DASHED||t.lineStyle===s.LINESTYLE_DOTTED||t.lineStyle===s.LINESTYLE_SPARSE_DOTTED?t.drawDashedLine(t,e,i,o,n):s.drawSolidLine(t,e,i,o,n))},s.drawArrow=function(t,e,i,o,n){isFinite(e)&&isFinite(o)&&isFinite(i)&&isFinite(n)&&(t.beginPath(),t.moveTo(o,n),t.lineTo(e,i),t.moveTo(e+2,i+2),t.lineTo(e-2,i+2),t.moveTo(e-1,i+1),t.lineTo(e+1,i+1),t.stroke())},s.drawSolidLine=function(t,e,i,o,n){t.beginPath(),t.moveTo(e,i),t.lineTo(o,n),t.stroke()},s.setLineStyle=function(t,e){t.lineStyle=e;var i=[];e!==s.LINESTYLE_SOLID&&(i=s.computeDashPattern(t)),"function"==typeof t.setLineDash?t.setLineDash(i):void 0!==t.mozDash?t.mozDash=i:void 0!==t.webkitLineDash&&(t.webkitLineDash=i)},s.drawPoly=function(t,e,i){var o,n;for(t.beginPath(),t.moveTo(e[0].x,e[0].y),o=0;o<e.length;o++)n=e[o],t.lineTo(n.x,n.y);t.closePath(),t.stroke(),i&&t.fill()},s.lineStyles=[],"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.setFont=function(t){if(this.font!==t)try{this.font=t}catch(t){}},CanvasRenderingContext2D.prototype.lineStyle=s.LINESTYLE_SOLID,s.originalSave=CanvasRenderingContext2D.prototype.save,s.originalRestore=CanvasRenderingContext2D.prototype.restore,CanvasRenderingContext2D.prototype.save=function(){s.lineStyles.push(this.lineStyle),s.originalSave.call(this)},CanvasRenderingContext2D.prototype.restore=function(){s.lineStyles.length>0&&(this.lineStyle=s.lineStyles.pop(),s.originalRestore.call(this))},CanvasRenderingContext2D.prototype.drawDashedLine=function(t,e,i,o,n){t.save();var r=s.computeDashPattern(t);if(t.beginPath(),"function"==typeof t.setLineDash)t.setLineDash(r);else if(void 0!==t.mozDash)t.mozDash=r;else{if(void 0===t.webkitLineDash)return t.dashedLineTo(e,i,o,n,r),t.stroke(),void t.restore();t.webkitLineDash=r}t.moveTo(e,i),t.lineTo(o,n),
t.stroke(),t.restore()},CanvasRenderingContext2D.prototype.dashedLineTo=function(t,e,i,o,s){var a,l,c,h,u,d,p={thereYet:n,cap:Math.min},_={thereYet:n,cap:Math.min};for(e-o>0&&(_.thereYet=r,_.cap=Math.max),t-i>0&&(p.thereYet=r,p.cap=Math.max),this.moveTo(t,e),a=t,l=e,c=0,h=!0;!p.thereYet(a,i)||!_.thereYet(l,o);)u=Math.atan2(o-e,i-t),d=s[c],a=p.cap(i,a+Math.cos(u)*d),l=_.cap(o,l+Math.sin(u)*d),h?this.lineTo(a,l):this.moveTo(a,l),c=(c+1)%s.length,h=!h},CanvasRenderingContext2D.prototype.roundRect=function(t,e,i,o,n){this.beginPath(),this.moveTo(t+n,e),this.lineTo(t+i-n,e),this.arcTo(t+i,e,t+i,e+n,n),this.lineTo(t+i,e+o-n),this.arcTo(t+i,e+o,t+i-n,e+o,n),this.lineTo(t+n,e+o),this.arcTo(t,e+o,t,e+o-n,n),this.lineTo(t,e+n),this.arcTo(t,e,t+n,e,n)}),t.exports=s},function(t,e,i){var o;!function(e){"use strict";function n(){}function r(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function s(t){return function(){return this[t].apply(this,arguments)}}function a(t){return"function"==typeof t||t instanceof RegExp||!(!t||"object"!=typeof t)&&a(t.listener)}var l=n.prototype,c=e.EventEmitter;l.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},l.flattenListeners=function(t){var e,i=[];for(e=0;e<t.length;e+=1)i.push(t[e].listener);return i},l.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},l.addListener=function(t,e){var i,o,n;if(!a(e))throw new TypeError("listener must be a function");i=this.getListenersAsObject(t),o="object"==typeof e;for(n in i)i.hasOwnProperty(n)&&-1===r(i[n],e)&&i[n].push(o?e:{listener:e,once:!1});return this},l.on=s("addListener"),l.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},l.once=s("addOnceListener"),l.defineEvent=function(t){return this.getListeners(t),this},l.defineEvents=function(t){for(var e=0;e<t.length;e+=1)this.defineEvent(t[e]);return this},l.removeListener=function(t,e){var i,o,n=this.getListenersAsObject(t);for(o in n)n.hasOwnProperty(o)&&-1!==(i=r(n[o],e))&&n[o].splice(i,1);return this},l.off=s("removeListener"),l.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},l.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},l.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},l.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},l.removeAllListeners=s("removeEvent"),l.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].slice(0),
n=0;n<i.length;n++)o=i[n],!0===o.once&&this.removeListener(t,o.listener),o.listener.apply(this,e||[])===this._getOnceReturnValue()&&this.removeListener(t,o.listener);return this},l.trigger=s("emitEvent"),l.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},l.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},l._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},l._getEvents=function(){return this._events||(this._events={})},n.noConflict=function(){return e.EventEmitter=c,n},void 0!==(o=function(){return n}.call(e,i,e,t))&&(t.exports=o)}(this||{})},function(t,e,i){"use strict";t.exports=i(311)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(102);!function(t){function e(t,e){s[t]||(s[t]=[]),s[t].push(e)}function i(t,e){if(s[t]){var i=s[t].indexOf(e);-1!==i&&(1===s[t].length?delete s[t]:s[t].splice(i,1))}}function o(t){return TVLocalStorage.getItem(r+t)}function n(t,e){void 0===e&&(e=(new Date).valueOf()),e!==TVLocalStorage.getItem(r+t)&&TVLocalStorage.setItem(r+t,e)}var r="tvxwevents.",s={};window.addEventListener("storage",function(t){if(null!==t.newValue){var e=t.key;e&&e.startsWith(r)&&(e=e.substr(r.length),s[e]&&s[e].forEach(function(e){e.call(t.newValue,t.newValue)}))}}),t.on=e,t.off=i,t.current=o,t.emit=n}(e.TVXWindowEvents||(e.TVXWindowEvents={}))},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(11),n=i(90),r=function(){function t(){this._data=null,this._hitTest=new o(o.REGULAR)}return t.prototype.setData=function(t){this._data=t},t.prototype.setHitTest=function(t){this._hitTest=t},t.prototype.draw=function(t){var e,i;null!==this._data&&0!==this._data.points.length&&!1!==this._data.visible&&((e=this._data.points[0].y)<0||e>this._data.height||(i=this._data.width,t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&n.setLineStyle(t,this._data.linestyle),n.drawLine(t,0,e,i,e)))},t.prototype.hitTest=function(t){return null===this._data||!1===this._data.visible?null:0===this._data.points.length?null:Math.abs(t.y-this._data.points[0].y)<=5?this._hitTest:null},t}(),e.HorizontalLineRenderer=r},,,,,,,,function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(15),String.prototype.left=function(t){if(!o.isInteger(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(0,t)},String.prototype.right=function(t){if(!o.isInteger(t))throw Error("invalid length");if(t>this.length)throw Error("invalid length");return this.substring(this.length-t,this.length)},String.prototype.trimmed=function(){return this.replace(/^\s*/,"").replace(/\s*$/,"")},String.prototype.startsWith=function(t){return!(t.length>this.length)&&this.left(t.length)===t},n=/{(\w+)}/g,r=/{(\d+)}/g,String.prototype.format=function(){var t,e,i,s,a=[];for(t=0;t<arguments.length;t++)a[t]=arguments[t];return e=o.isObject(a[0]),i=e?n:r,
s=e?function(t,e){var i=a[0];return void 0!==i[e]?i[e]:t}:function(t,e){var i=parseInt(e,10),o=a[i];return void 0!==o?o:t},this.replace(i,s)}},function(t,e,i){"use strict";function o(t){var e,i=t.icon,o=t.isActive,c=t.isOpened,h=t.isDisabled,u=t.onClick,d=t.text,p=t.textBeforeIcon,_=t.title,f=t.theme,m=void 0===f?l:f,g=t.className,v=t.forceInteractive,y=n.__rest(t,["icon","isActive","isOpened","isDisabled","onClick","text","textBeforeIcon","title","theme","className","forceInteractive"]),b=s(g,m.button,"apply-common-tooltip",(e={},e[m.isActive]=o,e[m.isOpened]=c,e[m.isInteractive]=(v||!!u)&&!h,e[m.isDisabled]=h,e)),S=i&&("string"==typeof i?r.createElement(a.Icon,{className:m.icon,icon:i}):r.cloneElement(i,{className:m.icon}));return r.createElement("div",n.__assign({},y,{className:b,onClick:h?void 0:u,title:_}),p&&d&&r.createElement("div",{className:s("js-button-text",m.text)},d),S,!p&&d&&r.createElement("div",{className:s("js-button-text",m.text)},d))}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),s=i(14),a=i(59),l=i(149),e.ToolWidgetButton=o},function(t,e,i){"use strict";function o(t,e){var o=e||new p("linetoolelliott");u.call(this,t,o),i.e(1).then(function(t){var e=i(249).ElliottLabelsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function n(t,e){var o=e||new p("linetoolelliott");u.call(this,t,o),this.version=n.version,i.e(1).then(function(t){var e=i(249).ElliottLabelsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function r(t,e){this._constructor="LineToolElliottImpulse";var i=e||new p("linetoolelliottimpulse");n.call(this,t,i)}function s(t,e){this._constructor="LineToolElliottTriangle";var i=e||new p("linetoolelliotttriangle");n.call(this,t,i)}function a(t,e){this._constructor="LineToolElliottTripleCombo";var i=e||new p("linetoolelliotttriplecombo");n.call(this,t,i)}function l(t,e){var o=e||new p("linetoolelliott");u.call(this,t,o),this.version=l.version,i.e(1).then(function(t){var e=i(249).ElliottLabelsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function c(t,e){this._constructor="LineToolElliottCorrection";var i=e||new p("linetoolelliottcorrection");l.call(this,t,i)}function h(t,e){this._constructor="LineToolElliottLineToolElliottDoubleCombo";var i=e||new p("linetoolelliottdoublecombo");l.call(this,t,i)}var u=i(1).LineDataSource,d=i(52).Action,p=i(6).DefaultProperty,_=i(3).propertyPages;inherit(o,u),o.migrateState=function(t){var e={0:11,1:10,2:9,3:8,4:7,5:6,6:5,7:4,8:3},i={0:11,1:8};"LineToolElliottSubminuette"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinor"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottCircle"===t.type&&(t.type="LineToolElliottImpulse",t.state.degree=e[t.state.wavesize]),"LineToolElliottMinorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize]),
"LineToolElliottMajorRetr"===t.type&&(t.type="LineToolElliottCorrection",t.state.degree=i[t.state.wavesize])},o.prototype.title=function(){return"Elliott Labels"},o.degrees=[$.t("Supermillennium"),$.t("Millennium"),$.t("Submillennium"),$.t("Grand Supercycle"),$.t("Supercycle"),$.t("Cycle"),$.t("Primary"),$.t("Intermediate"),$.t("Minor",{context:"wave"}),$.t("Minute"),$.t("Minuette"),$.t("Subminuette"),$.t("Micro"),$.t("Submicro"),$.t("Miniscule")],o.prototype.additionalActions=function(t){var e=new d({text:$.t("Degree")}),i=this;return e.subActions=o.degrees.map(function(e,o){var n=new d({text:e,checkable:!0,checked:i.properties().degree.value()===o});return n.callbacks().subscribe(null,function(){t.setProperty(i.properties().degree,o,"Change Elliott Degree")}),n}),[e]},o.prototype.label=function(t){var e=o.degrees.length-this.properties().degree.value()-1,i=Math.floor(e/3),n=e%3;return{fontIncrease:4*Math.floor(i),bold:!!(i%2),decoration:["","brackets","circle"][n],label:this.labelsGroup()[i][t]}},o.prototype.getStylesPropertyPage=function(){return _.LineToolElliottStylesPropertyPage},o.prototype.getDegrees=function(){return o.degrees},inherit(n,o),n.version=3,n.prototype.pointsCount=function(){return 6},n.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.unshift(o),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.unshift(o))}},inherit(r,n),r._labelsGroups=[["0","1","2","3","4","5"],["0","i","ii","iii","iv","v"],["0","1","2","3","4","5"],["0","I","II","III","IV","V"],["0","1","2","3","4","5"]],r.prototype.labelsGroup=function(){return r._labelsGroups},inherit(s,n),s._labelsGroups=[["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"],["0","a","b","c","d","e"],["0","A","B","C","D","E"]],s.prototype.labelsGroup=function(){return s._labelsGroups},inherit(a,n),a._labelsGroups=[["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"],["0","w","x","y","x","z"],["0","W","X","Y","X","Z"]],a.prototype.labelsGroup=function(){return a._labelsGroups},inherit(l,o),l.version=3,l.prototype.pointsCount=function(){return 4},l.prototype.migrateVersion=function(t,e,i){if(1===t){var o=$.extend({},this._timePoint[0]);this._timePoint.insert(o,0),this._points.length>0&&(o=$.extend({},this._points[0]),this._points.insert(o,0))}},inherit(c,l),c._labelsGroups=[["0","A","B","C"],["0","a","b","c"],["0","A","B","C"],["0","a","b","c"],["0","A","B","C"]],c.prototype.labelsGroup=function(){return c._labelsGroups},inherit(h,l),h._labelsGroups=[["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"],["0","w","x","y"],["0","W","X","Y"]],h.prototype.labelsGroup=function(){return h._labelsGroups},e.LineToolElliott=o,e.LineToolElliottImpulse=r,e.LineToolElliottTriangle=s,e.LineToolElliottTripleCombo=a,e.LineToolElliottCorrection=c,e.LineToolElliottDoubleCombo=h},function(t,e,i){"use strict";function o(t,e,i){
var o=this._mtpStudyId()+"@mtp-mtpredictor",n=i||d.findStudyMetaInfo(t.studiesMetaData(),o),s=e||a(n,null,null,t.studyVersioning()),c=l.lineToolNameForPointsBasedStudy(o);r.call(this,t,s,c),this._setPaneViews(this.createPaneViews(t)),this._turnaroundCounter=0,this._nextTurnaround(),this._metaInfo=n,this._graphics=new h(n),this._formatter=new u}var n=i(128),r=n.StudyLineDataSource,s=i(35),a=s.prepareStudyProperties,l=s.Study,c=i(1).LineDataSource,h=i(219),u=i(331).VolumeFormatter,d=i(33);inherit(o,r),o.prototype.series=function(){return TradingView.isInherited(this._ownerSource.constructor,TradingView.Series)?this._ownerSource:this._ownerSource.series()},o.prototype.calcIsActualSymbol=function(){return c.prototype.calcIsActualSymbol.call(this)},o.prototype._nextTurnaround=function(){this._turnaround=this._mtpStudyId()+"_"+ ++this._turnaroundCounter},o.prototype.createPaneViews=function(t){return[new l.StudyPaneView_textmarks(this,t),new l.StudyPaneView_polygons(this,t),new l.StudyPaneView_lines(this,t)]},o.prototype.onData=function(t){var e=this;if("data_update"===t.method&&t.params.customId==="pointset_"+this._currentPointsetId)c.prototype.onData.call(this,t),this._points.length===this.pointsCount()&&this._requestStudy();else if("data_update"===t.method&&t.params.customId===this._studyId){if(!this._checkTurnaround(t.params.turnaround))return;l.prototype._makeJSONForNSData.call(this,t).then(function(i){t.params.nonseries.d=i,""!==t.params.nonseries.d&&e._graphics.process(t.params.nonseries),t.params.nonseries.indexes.length>0&&(e._indexes=t.params.nonseries.indexes),e.updateAllViews(),e._model.updateSource(e)})}},o.prototype._requestStudy=function(){var t=this,e=function(e){t.onData(e)},i=this._studyInputs();i&&(this._studyId?(this._nextTurnaround(),this._model.chartApi().modifyStudy(this._studyId,this._turnaround,i,e)):(this._studyId=l.makeNextStudyId(),this._model.chartApi().createStudy(this._studyId,this._turnaround,this._model.mainSeries()._seriesId,this._metaInfo.fullId+"!",i,e)))},e.LineStudyMtp=o},function(t,e,i){"use strict";(function(t,o,n){function r(e,i){var r,a=e._undoModel._chartWidget,l=a.onWidget(),c=!1;c=l?a._options&&!a._options.hideIdeas:!!t.enabled("bars_marks")&&TVSettings.getBool("BarsMarksContainer.visibile",!1),i?i.merge({visible:c,frozen:!1}):i=new o({visible:c,frozen:!1}),r=this,i.visible.listeners().subscribe(null,function(e){l||a._containsData||!t.enabled("bars_marks")||TVSettings.setValue("BarsMarksContainer.visibile",!!e.value()),r._tooltip&&r._tooltip.removeAll()}),s.call(this,e,i),this.onNeedRepaint=new n,this._requests=[],this._marks={},this._loadedRange=null,this._getDataTimeout=null,this._collectedRange=null,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.clearMarks),this._model.mainSeries().onSymbolResolved().subscribe(this,this.clearMarks),this._model.mainSeries().onTickmarksRangeChanged().subscribe(this,this.getData),this._initialize(),this.pinnedTooltips={},this._tooltip=new h(this._createTooltip.bind(this),this)}
var s=i(1).LineDataSource,a=i(15).isNumber,l=i(230).BarsMarksContainerPaneView,c=i(230).BarsMarksContainerRenderer,h=i(913).TooltipRenderer,u=i(7).getLogger("Chart.BarsMarksContainer");inherit(r,s),r.prototype._constructor="Child class must override this member",r.prototype._initialize=function(t){throw Error("Child class must override this member")},r.prototype.onClicked=function(){throw Error("Child class must override this member")},r.prototype._getData=function(t){throw Error("Child class must override this member")},r.prototype._createTooltip=function(){throw Error("Child class must override this member")},r.prototype.updateDotData=function(t,e){return e},r.prototype.updatePlateData=function(t,e){},r.prototype._plateViewData=function(t){return{}},r.prototype.pinTooltip=function(t,e){this.pinnedTooltips[t]=e},r.prototype.timeScale=function(){return this._model.timeScale()},r.prototype.getIntervalInTicks=function(){function t(t){if((t=parseInt(t))!=t)throw new TypeError("Unexpected interval");return 60*t}var e=t(1440),i=7*e,o=31*e,n=this._model.mainSeries().properties().interval.value();switch(n){case"M":return o;case"W":return i;case"D":return e;default:return t(n)}},r.prototype._maxDate=Math.round(new Date(2037,0,1).getTime()/1e3),r.prototype.getVisibleTickmarksRange=function(){var t,e;return this.timeScale().isEmpty()?{start:0,end:0}:(t=this.timeScale().visibleBars(),t.lastBar()>this.timeScale().points().firstIndex()&&t.firstBar()<this.timeScale().points().lastIndex()?(e=t.lastBar()<this.timeScale().points().lastIndex()?this.timeScale().indexToTimePoint(t.lastBar()):this._maxDate,t={start:this.timeScale().indexToTimePoint(Math.max(t.firstBar(),this.timeScale().points().firstIndex())),end:e},{start:t.start?t.start:void 0,end:t.end?t.end:void 0}):{start:0,end:0})},r.prototype.getVisibleRangePlates=function(){var t=[],e=this.getVisibleTickmarksRange(),i=this.getIntervalInTicks();return $.each(this._marks,function(o,n){var r=n.tickmark;r>=e.start&&r<=e.end+i&&t.push(n)}),t},r.prototype.getPublishedPlates=function(){var t={},e=this;return is_authenticated?($.each(this.getVisibleRangePlates(),function(i,o){o.is_public&&(e.pinnedTooltips[o.id]||o.user__id===user.id)&&(t[o.id]=o)}),t):t},r.prototype._maxPlatesPerBar=10,r.prototype.filterDisplayedPlates=function(t){return t=t.reduce(function(t,e){var i=this._getIndex(e.tickmark);return t[i]=t[i]||[],t[i].push(e),t}.bind(this),{}),t=Object.keys(t).reduce(function(e,i){var o=t[i];return o=o.sort(function(t,e){return e.views_count-t.views_count}),o=o.slice(0,this._maxPlatesPerBar),e.concat(o)}.bind(this),[])},r.prototype._layout=function(t){switch(t){default:case 0:return"up";case 1:return"down";case 2:return"up";case 3:case 4:case 5:case 6:return"up"}},r.prototype._theme=function(t){switch(t){default:case 0:return"neutral";case 1:return"green";case 2:return"red";case 3:return"yellow";case 4:return"blue";case 5:return"green";case 6:return"red"}},r.prototype._offset=function(t,e){var i;switch(t){default:case"up":i=e[TradingView.HIGH_PLOT];break;case"down":
i=e[TradingView.LOW_PLOT]}return this.priceScale().isPercent()&&(i=this.priceScale().priceRange().convertToPercent(i,this.ownerSource().firstValue())),this.priceScale().priceToCoordinate(i)},r.prototype._getIndex=function(t){return this.timeScale().timePointToIndex(t)},r.prototype.getViewData=function(){return{barWidth:this.barWidth(),plates:this.getPlatesViewData(),tooltip:this._tooltip}},r.prototype.barWidth=function(){return this.timeScale().barSpacing()},r.prototype.getPlatesViewData=function(){var t,e,i,o,n,r;if(this._model.mainSeries().data().isEmpty())return[];t=this.filterDisplayedPlates(this.getVisibleRangePlates()),e=this,i={},o=this._model.lastHittestData(),t=t.map(function(t){var n,r,s,a,l,c,h=this._getIndex(t.tickmark),u=this._getBar(h);return null!==u&&(n=this._layout(t.direction),r=this._theme(t.direction),s=o&&o.id===t.id,a=this.timeScale().indexToCoordinate(h),l=this._offset(n,u),c=0,h in i||(i[h]={up:0,down:0}),c=i[h][n]++,TradingView.merge({id:t.id,x:a,y:l,order:c,direction:n,theme:r,hovered:s,pinned:!0===e.pinnedTooltips[t.id],user__id:t.user__id,label:t.label,labelFontColor:t.labelFontColor||"#444",minSize:t.minSize||5},this._plateViewData(t)))}.bind(this)),t=t.filter(function(t){return!!t}),n=t.filter(function(t){return!0===t.hovered});for(r=0;r<t.length;r++)null!=n[0]&&t[r].user__id===n[0].user__id&&(t[r].highlightByAuthor=!0);return t.sort(function(t,e){return t.hovered&&!e.hovered?1:0}),t},r.prototype._getBar=function(t){return this._model.mainSeries().data().valueAt(t)},r.prototype.paneViews=function(t){var e=this;return this._properties.visible.value()?[new l(this,t,function(t){return new c(t.getViewData(),e)})]:[]},r.prototype.dataWindowView=function(){return null},r.prototype.priceAxisViews=function(){return null},r.prototype.statusView=function(){return null},r.prototype.updateAllViews=function(){},r.prototype.pointsCount=function(){return 0},r.prototype.properties=function(){return this._properties},r.prototype._rangeDifference=function(t){return t=$.extend({},t),this._loadedRange&&(t.start<this._loadedRange.start?t.end=this._loadedRange.start:t.end>this._loadedRange.end&&(t.start=this._loadedRange.end)),t},r.prototype._rangeUnion=function(t,e){return t=$.extend({},t),e&&(t.start=Math.min(e.start,t.start),t.end=Math.max(e.end,t.end)),t},r.prototype._pushGetDataStack=function(t){if(!a(t.start)||!a(t.end))return void u.logError("Wrong tickmark range");this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._collectedRange=this._rangeUnion(t,this._collectedRange),this._getDataTimeout=setTimeout(function(){this._getData(this._collectedRange),this._getDataTimeout=this._collectedRange=null}.bind(this),300)},r.prototype.roundRange=function(t){return{start:Math.round(t.start),end:Math.round(t.end)}},r.prototype.refreshData=function(){this.getData(this._lastRange)},r.prototype.getData=function(t){if(!a(t.start)||!a(t.end))return void u.logError("Wrong range");this._lastRange=t;var t=$.extend({},t);t.end=this._maxDate,this._pushGetDataStack(t)},r.prototype._abortAllRequests=function(){
this._requests.forEach(function(t){t.abort()}),this._requests=[],this._getDataTimeout&&clearTimeout(this._getDataTimeout),this._getDataTimeout=this._collectedRange=null},r.prototype.clearMarks=function(){this._abortAllRequests(),this._marks={},this._loadedRange=null},e.BarsMarksContainer=r}).call(e,i(5),i(25),i(10))},function(t,e,i){"use strict";function o(t,e){var i=t.offset();e.localX=e.pageX-i.left,e.localY=e.pageY-i.top}function n(t,e,i,o){new c(t,e,i,o)}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),i(13),i(43),r=i(351),s=i(9),a=2,l=!1,c=function(){function t(t,e,i,o){this._clickCount=0,this._clickTimeoutId=null,this._touchContextMenuTimeout=null,this._lastTouchPosition={x:0,y:0},this._mouseMoveStartPosition=null,this._cancelClick=!1,this._$target=t,this._handler=e,this._originalPreventDefault=i,this._preventDefault=!o&&i,this._verticalTouchScroll=o,this._init()}return t.prototype._mouseEnterHandler=function(t){this._$target.off("mousemove.chartgui"),this._$target.on("mousemove.chartgui",this._mouseMoveHandler.bind(this)),Modernizr.touch&&this._mouseMoveHandler(t),this._processEvent(t,this._handler.mouseEnterEvent),this._preventDefaultIfNeeded(t)},t.prototype._resetClickTimeout=function(){null!==this._clickTimeoutId&&clearTimeout(this._clickTimeoutId),this._clickCount=0,this._clickTimeoutId=null},t.prototype._mouseMoveHandler=function(t){l&&!Modernizr.touch||(this._processEvent(t,this._handler.mouseMoveEvent),this._preventDefaultIfNeeded(t))},t.prototype._mouseMoveWithDownHandler=function(t){var e,i,o,n,r,l,c;void 0===t.button&&(t.button=0),e=!1,i=Modernizr.touch||t.originalEvent.touches,i&&(this._fixMouseTouchEvent(t,t.originalEvent),t.clientX=t.pageX,t.clientY=t.pageY,this._verticalTouchScroll&&(o=Math.abs(.5*(t.pageX-this._lastTouchPosition.x)),n=Math.abs(t.pageY-this._lastTouchPosition.y),o<=n?(e=!0,this._preventDefault=!1):this._preventDefault=this._originalPreventDefault),this._lastTouchPosition.x=t.pageX,this._lastTouchPosition.y=t.pageY),r=s.ensure(this._mouseMoveStartPosition),l=Math.abs(r.x-t.pageX),c=Math.abs(r.y-t.pageY),l+c>5&&(this._cancelClick=!0,i&&this._clearContextMenuTimeout()),t.button===a||e||this._processEvent(t,this._handler.pressedMouseMoveEvent),this._preventDefaultIfNeeded(t)},t.prototype._mouseUpHandler=function(t){void 0===t.button&&(t.button=0),(Modernizr.touch||t.originalEvent.touches)&&(t.pageX=this._lastTouchPosition.x,t.pageY=this._lastTouchPosition.y,t.localX=this._lastTouchPosition.x,t.localY=this._lastTouchPosition.y,this._clearContextMenuTimeout()),this._mouseMoveStartPosition=null,l=!1,$(document.body).off("mousemove.chartgui"),$(document.body).off("mouseup.chartgui"),Modernizr.touch||t.originalEvent.touches?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),this._mouseLeaveHandler(t)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui")),t.button!==a&&(this._processEvent(t,this._handler.mouseUpEvent),++this._clickCount,
this._clickTimeoutId&&this._clickCount>1?(this._processEvent(t,this._handler.mouseDoubleClickEvent),this._resetClickTimeout()):this._cancelClick||this._processEvent(t,this._handler.mouseClickEvent)),this._preventDefaultIfNeeded(t),Modernizr.touch&&this._mouseLeaveHandler(t)},t.prototype._clearContextMenuTimeout=function(){null!==this._touchContextMenuTimeout&&(clearTimeout(this._touchContextMenuTimeout),this._touchContextMenuTimeout=null)},t.prototype._mouseDownHandler=function(t){if(void 0===t.button&&(t.button=0),this._cancelClick=!1,(Modernizr.touch||t.originalEvent.touches)&&(this._fixMouseTouchEvent(t,t.originalEvent),this._lastTouchPosition.x=t.pageX,this._lastTouchPosition.y=t.pageY,this._mouseEnterHandler(t)),this._mouseMoveStartPosition={x:t.pageX,y:t.pageY},Modernizr.touch?($(document.body).off("touchmove.chartgui"),$(document.body).off("touchend.chartgui"),$(document.body).on("touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(document.body).on("touchend.chartgui",this._mouseUpHandler.bind(this)),this._clearContextMenuTimeout(),this._touchContextMenuTimeout=setTimeout(this._contextMenuHandler.bind(this,t),500)):($(document.body).off("mousemove.chartgui touchmove.chartgui"),$(document.body).off("mouseup.chartgui touchend.chartgui"),$(document.body).on("mousemove.chartgui touchmove.chartgui",this._mouseMoveWithDownHandler.bind(this)),$(document.body).on("mouseup.chartgui touchend.chartgui",this._mouseUpHandler.bind(this))),l=!0,t.button!==a&&(this._processEvent(t,this._handler.mouseDownEvent),this._clickTimeoutId||(this._clickCount=0,this._clickTimeoutId=setTimeout(this._resetClickTimeout.bind(this),500))),this._preventDefaultIfNeeded(t),this._preventDefault)try{window.focus()}catch(t){}},t.prototype._init=function(){var t=this;this._$target.mouseenter(this._mouseEnterHandler.bind(this)),this._$target.on("touchcancel",this._clearContextMenuTimeout.bind(this)),this._$target.on("touchstartoutside mousedownoutside",function(e){t._handler.mouseDownOutsideEvent&&t._handler.mouseDownOutsideEvent(e,t._$target)}),this._$target.mouseleave(this._mouseLeaveHandler.bind(this)),this._$target.contextMenu&&this._$target.contextMenu(this._contextMenuHandler.bind(this)),Modernizr.touch?(this._$target.on("touchstart.chartgui",this._mouseDownHandler.bind(this)),this._initGestureEvents()):this._$target.on("mousedown.chartgui touchstart.chartgui",this._mouseDownHandler.bind(this))},t.prototype._mouseLeaveHandler=function(t){this._$target.off("mousemove.chartgui touchmove.chartgui"),this._processEvent(t,this._handler.mouseLeaveEvent),this._preventDefaultIfNeeded(t)},t.prototype._contextMenuHandler=function(t){this._processEvent(t,this._handler.contextMenuEvent),this._preventDefaultIfNeeded(t),this._cancelClick=!0},t.prototype._processEvent=function(t,e){e&&(o(this._$target,t),e.call(this._handler,t,this._$target))},t.prototype._preventDefaultIfNeeded=function(t){this._preventDefault&&t.preventDefault()},t.prototype._initGestureEvents=function(){var t=this,e=new r(this._$target.get(0));e.get("pinch").set({enable:!0
}),e.on("pinchstart",function(e){t._handler.gestureStartEvent&&t._handler.gestureStartEvent(e,t._$target),t._clearContextMenuTimeout()}),e.on("pinchmove",function(e){t._handler.gestureChangeEvent&&t._handler.gestureChangeEvent(e,t._$target)}),e.on("pinchend pinchcancel",function(e){t._handler.gestureEndEvent&&t._handler.gestureEndEvent(e,t._$target)})},t.prototype._fixMouseTouchEvent=function(t,e){var i=e.touches[0].pageX,o=e.touches[0].pageY;t.pageX=i,t.pageY=o,t.localX=i,t.localY=o},t}(),e.setMouseEventHandler=n},function(t,e,i){"use strict";var o=i(353),n={instances:[],createMenu:function(t,e,i){var n=new o(t,e,i);return this.instances.push(n),n},hideAll:function(){for(var t in this.instances)this.instances[t].hide()}};t.exports=n},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(14),s=i(1026),a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.render=function(){var t=this.props,e=t.children,i=t.className,a=o.__rest(t,["children","className"]);return n.createElement("div",o.__assign({className:r(i,s.wrap)},a),e)},e}(n.PureComponent),e.ToolWidgetRowWrap=a},function(t,e,i){function o(){this._data=null,this._hittest=new n(n.MOVEPOINT)}var n,r,s,a;i(64),n=i(11),r=i(74).LineEnd,s=i(44).distanceToSegment,a=i(45).extendAndClipLineSegment,o.prototype.setData=function(t){this._data=t},o.prototype.setHitTest=function(t){this._hittest=t},o.prototype.drawArrow=function(t,e,i,o){var n,r,s,a,l,c,h,u,d;e.subtract(t).length()<1||(n=e.subtract(t).normalized(),r=5*o,s=n.scaled(r),a=e.subtract(s),l=n.transposed(),c=3*o,h=l.scaled(c),u=a.add(h),d=a.subtract(h),CanvasEx.drawLine(i,Math.round(u.x),Math.round(u.y),e.x,e.y),CanvasEx.drawLine(i,Math.round(d.x),Math.round(d.y),e.x,e.y))},o.prototype.extendAndClipLineSegment=function(t,e){return a(t,e,this._data.width,this._data.height,this._data.extendleft,this._data.extendright)},o.prototype.drawCircle=function(t,e,i,o){o=$.extend({fillStyle:"#000000"},o),e.save(),e.fillStyle=o.fillStyle,e.beginPath(),e.arc(t.x,t.y,i,0,2*Math.PI,!1),e.fill(),o.strokeWidth&&(e.lineWidth=o.strokeWidth,e.stroke()),e.restore()},o.prototype.draw=function(t){var e,i,o,n,r;null===this._data||this._data.points&&this._data.points.length<2||this._data.floatPoints&&this._data.floatPoints.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._data.floatPoints||this._data.points,i=e[0],o=e[1],this._data.overlayLineEndings?n=[$.extend(!0,{},i),$.extend(!0,{},o)]:this.drawEnds(t,[i,o]),r=this.extendAndClipLineSegment(i,o),null!==r&&this._data.linewidth>0&&CanvasEx.drawLine(t,r[0].x,r[0].y,r[1].x,r[1].y),this._data.overlayLineEndings&&this.drawEnds(t,n))},o.prototype.drawEnds=function(t,e){var i=e[0],o=e[1];switch(this._data.leftend){case r.Arrow:this.drawArrow(o,i,t,t.lineWidth);break;case r.Circle:this.drawCircle(i,t,t.lineWidth,this._data.endstyle)}switch(this._data.rightend){case r.Arrow:this.drawArrow(i,o,t,t.lineWidth)
;break;case r.Circle:this.drawCircle(o,t,t.lineWidth,this._data.endstyle)}},o.prototype.hitTest=function(t){var e,i,o,n,r,a;return null===this._data||this._data.points&&this._data.points.length<2?null:this._data.floatPoints&&this._data.floatPoints.length<2?null:(e=TradingView.isMobile.any()?24:3,i=this._data.floatPoints||this._data.points,o=i[0],n=i[1],r=this.extendAndClipLineSegment(o,n),null!==r&&(a=s(r[0],r[1],t),a.distance<=e)?this._hittest:null)},e.TrendLineRenderer=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(12),function(t){t.LINE="line",t.COLORER="colorer",t.BAR_COLORER="bar_colorer",t.BG_COLORER="bg_colorer",t.TEXT_COLORER="text_colorer",t.OHLC_COLORER="ohlc_colorer",t.SHAPES="shapes",t.CHARS="chars",t.ARROWS="arrows",t.DATAOFFSET="dataoffset",t.OHLC_OPEN="ohlc_open",t.OHLC_HIGH="ohlc_high",t.OHLC_LOW="ohlc_low",t.OHLC_CLOSE="ohlc_close"}(e.PlotTypes||(e.PlotTypes={})),function(t){t.BARS="ohlc_bars",t.CANDLES="ohlc_candles"}(e.OHLCType||(e.OHLCType={})),function(t){t[t.Line=0]="Line",t[t.Histogram=1]="Histogram",t[t.Cross=3]="Cross",t[t.Area=4]="Area",t[t.Columns=5]="Columns",t[t.Circles=6]="Circles",t[t.LineWithBreaks=7]="LineWithBreaks",t[t.AreaWithBreaks=8]="AreaWithBreaks",t[t.StepLine=9]="StepLine"}(e.PlotType||(e.PlotType={})),function(t){t[t.Right=0]="Right",t[t.Left=1]="Left",t[t.None=2]="None"}(e.ScaleType||(e.ScaleType={})),e.plotShapesData={shape_arrow_down:{guiName:$.t("Arrow Down"),id:"shape_arrow_down",paneRendererClass:"PaneRendererArrowDown",pineName:"shape.arrowdown"},shape_arrow_up:{guiName:$.t("Arrow Up"),id:"shape_arrow_up",paneRendererClass:"PaneRendererArrowUp",pineName:"shape.arrowup"},shape_circle:{guiName:$.t("Circle"),id:"shape_circle",paneRendererClass:"PaneRendererCircleShape",pineName:"shape.circle"},shape_cross:{guiName:$.t("Cross"),id:"shape_cross",paneRendererClass:"PaneRendererCrossShape",pineName:"shape.cross"},shape_diamond:{guiName:$.t("Diamond"),id:"shape_diamond",paneRendererClass:"PaneRendererDiamond",pineName:"shape.diamond"},shape_flag:{guiName:$.t("Flag"),id:"shape_flag",paneRendererClass:"PaneRendererFlagShape",pineName:"shape.flag"},shape_label_down:{guiName:$.t("Label Down"),id:"shape_label_down",paneRendererClass:"PaneRendererLabelDown",pineName:"shape.labeldown"},shape_label_up:{guiName:$.t("Label Up"),id:"shape_label_up",paneRendererClass:"PaneRendererLabelUp",pineName:"shape.labelup"},shape_square:{guiName:$.t("Square"),id:"shape_square",paneRendererClass:"PaneRendererSquare",pineName:"shape.square"},shape_triangle_down:{guiName:$.t("Triangle Down"),id:"shape_triangle_down",paneRendererClass:"PaneRendererTriangleApexDown",pineName:"shape.triangledown"},shape_triangle_up:{guiName:$.t("Triangle Up"),id:"shape_triangle_up",paneRendererClass:"PaneRendererTriangleApexUp",pineName:"shape.triangleup"},shape_xcross:{guiName:$.t("X Cross"),id:"shape_xcross",paneRendererClass:"PaneRendererXCross",pineName:"shape.xcross"}}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(211)
;e.createConfirmDialog=o.createConfirmDialog},,,,,,,,,function(t,e,i){"use strict";function o(t){for(var e=0;e<c.length;e++)if(c[e].name===t)return e;return-1}function n(t,e){var i={name:t,func:e},n=o(i.name);n>-1?c[n]=i:c.push(i)}function r(t){c.forEach(function(e,i){e.name===t&&c.splice(i,1)})}function s(t,e){var i={name:t,func:e},n=o(i.name);n>-1&&c.splice(n,1),c.unshift(i)}function a(){h=!0}function l(){h=!1}var c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(13),c=[],h=!1,$(window).on("keypress",function(t){if(!h)for(var e=c.length-1;e>=0&&!0!==c[e].func(t);e--);}),e.registerListener=n,e.removeListener=r,e.pushBackListener=s,e.disable=a,e.enable=l},function(t,e,i){"use strict";function o(t){return f.Interval.parse(t).value()}function n(t){var e,i,n,r;return t=o(t),e=m.supportedResolutions.value(),i=!1,void 0!==e?(n=e.map(o),i=-1!==n.indexOf(t)):i=!0,r=m.intraday.value(),r?i:f.Interval.isDWM(t)&&i}function r(t){return void 0===t&&(t=[]),t.concat(_.enabled("star_some_intervals_by_default")?["1","30","60"]:[]).filter(function(t,e,i){return i.indexOf(t)===e})}function s(t){var e={};return t.forEach(function(t){return e[t]=1}),e}function a(t){var e=new f.Interval(t);return e.kind()!==f.Interval.MINUTES?g[e.letter()]*(e.multiplier()||1):e.multiplier()||0}function l(t){return t.sort(function(t,e){return a(t)-a(e)})}function c(t){return void 0===t&&(t=[]),l(t)}function h(t,e){if(e){var i=" ";switch(t){case f.Interval.DAYS:i+=window.t("day",{plural:"days",count:e});break;case f.Interval.WEEKS:i+=window.t("week",{plural:"weeks",count:e});break;case f.Interval.MONTHS:i+=window.t("month",{plural:"months",count:e});break;case f.Interval.SECONDS:i+=window.t("second",{plural:"seconds",count:e});break;case f.Interval.MINUTES:i+=window.t("minute",{plural:"minutes",count:e});break;case f.Interval.HOURS:i+=window.t("hour",{plural:"hours",count:e});break;default:i+=t}return i}switch(t){case f.Interval.MINUTES:return window.t("m",{context:"interval_short"});case f.Interval.HOURS:return window.t("h",{context:"interval_short"});case f.Interval.DAYS:return window.t("D",{context:"interval_short"});case f.Interval.WEEKS:return window.t("W",{context:"interval_short"});case f.Interval.MONTHS:return window.t("Mo",{context:"interval_short"});default:return""}}function u(t){return t>=60&&!(t%60)}function d(t){var e=f.Interval.parse(t),i=e.multiplier(),o=e.kind();if(!e.isValid()||void 0===i)throw new TypeError("Can't translate invalid interval");return o===f.Interval.MINUTES&&u(i)&&(i=~~(i/60),o=f.Interval.HOURS),{multiplier:""+i,shortKind:h(o),hint:i+" "+h(o,i),mayOmitMultiplier:e.isDWM()&&1===i}}function p(t){var e=d(t);return""+e.multiplier+e.shortKind}var _,f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),i(12),_=i(5),f=i(34),m=i(76),e.normalizeIntervalString=o,e.isIntervalAvailable=n,e.groupTranslations=(v={},v[f.Interval.SECONDS]=window.t("Second",{context:"interval_group_name"}),v[f.Interval.MINUTES]=window.t("Minute",{context:"interval_group_name"}),v[f.Interval.HOURS]=window.t("Hour",{context:"interval_group_name"}),
v[f.Interval.DAYS]=window.t("Day",{context:"interval_group_name"}),v[f.Interval.WEEKS]=window.t("Week",{context:"interval_group_name"}),v[f.Interval.MONTHS]=window.t("Month",{context:"interval_group_name"}),v),e.getDefaultFavoriteIntervals=r,e.convertIntervalsToObject=s,g={S:1/60,D:1440,W:10080,M:43200},e.sortIntervals=l,e.getIntervals=c,e.isHour=u,e.getTranslatedModel=d,e.getTranslated=p},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LEFT_ARROW=37,e.UP_ARROW=38,e.RIGHT_ARROW=39,e.DOWN_ARROW=40,e.ENTER=13,e.ESC=27,e.SPACE=32,e.SLASH=47},function(t,e,i){"use strict";(function(e){function o(t){this._data=t,this._textWidthCache=new l}function n(t,e,i,o,n){this._model=t,this._source=e,this._plotIndex=i,this._getterName=o||"symbol",this._propertyName=n,this._cache={},this._invalidated=!0,this._rendererData={}}var r=i(32),s=r.parseRgb,a=r.rgbToBlackWhiteString,l=i(155),c=i(53).CompositeRenderer,h=i(156).makeFont,u=i(30);o.prototype.hitTest=function(t){return null},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h;this._data.visible&&(this._textWidthCache.font!==this._data.font&&(this._textWidthCache.reset(),this._textWidthCache.font=this._data.font),t.font=this._data.font,e=this._data.fontSize,i=Math.floor(e/4.5),o=Math.ceil(e/4.5),n=Math.ceil(e/3),r=Math.ceil(this._textWidthCache.measureText(t,this._data.text)),s=Math.round(e/10),a=e+i+o,l=r+2*n,c=this._data.x-.5,"right"===this._data.align&&(c-=l),h=this._data.y-Math.floor(e/2)-i-.5,t.fillStyle=u.resetTransparency(this._data.backColor),t.fillRect(c,h,l,a),t.fillStyle=this._data.color,t.textAlign="left",t.fillText(this._data.text,c+n,h+i+e-s))},n.prototype.isPropertyEnabled=function(){return this._model.properties().scalesProperties[this._propertyName].value()},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,i,o,n,r,l,u,d,p=this._rendererData;if(p.visible=!1,p.text="",this.isPropertyEnabled()&&this._source.properties().visible.value()&&(t=this._source.lastValueData(this._plotIndex,e.enabled("price_scale_always_last_bar_value")),!t.noData)){if(i=this._model.paneForSource(this._source),o="right",i.leftPriceScale()===this._source.priceScale()&&(o="left"),n=this._model.properties(),r=!i.leftPriceScale().mainSource()||!i.rightPriceScale().mainSource(),r&&n.scalesProperties.showLeftScale.value()&&!n.scalesProperties.showRightScale.value()&&(o="left"),!r){if("left"===o&&!n.scalesProperties.showLeftScale.value())return new c;if("right"===o&&!n.scalesProperties.showRightScale.value())return new c}l=t.coordinate,u=this._source.m_data.m_series&&this._source.m_data.m_series.properties().style.value()===TradingView.Series.STYLE_HEIKEN_ASHI,this._source.lastPriceLabelFixedCoordinate&&!u&&"showSymbolLabels"===!this._propertyName&&(l=this._source.lastPriceLabelFixedCoordinate(this._plotIndex)||l),t.color!==p.backColor&&(p.backColor=this._source.priceLineColor(t.color),d=a(s(p.backColor),160),p.color="black"===d?"white":"black"),p.text=this._source[this._getterName](this._plotIndex),p.visible=""!==p.text,
p.align=o,p.x="right"===o?this._model.timeScale().width():0,p.y=l,p.fontSize=this._model.properties().scalesProperties.fontSize.value(),p.font=h(p.fontSize,"Arial","")}},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._renderer||(this._renderer=new o(this._rendererData)),this._renderer},t.exports=n}).call(e,i(5))},function(t,e,i){"use strict";(function(t){function o(t,e){var i,o,n,r,l;if(s.call(this),this._study=t,this._model=e,i=t.metaInfo().plots){for(o=0;o<i.length;++o)if(!(this._study.isSelfColorerPlot(o)||this._study.isBarColorerPlot(o)||this._study.isBgColorerPlot(o)||this._study.isDataOffsetPlot(o)||this._study.isOHLCColorerPlot(o))){if(n=i[o].id,"Compare@tv-basicstudies"===this._study.metaInfo().id)r=new a(this._study.inputsForGUI()[1],"");else{l=this._study.title();try{l=this._study.properties().styles[n].title.value()}catch(t){}r=new a(l,"")}r.plotId=n,r.plotIndex=o,this._items.push(r)}this.update(),this._invalidated=!0}}function n(t,e){o.call(this,t,e)}var r=i(157),s=r.DataWindowView,a=r.DataWindowItem,l=i(19).PlotRowSearchMode;inherit(o,s),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var e,i,o,n,r,s,a,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C=!0;for(this._header=this._study.title(C),this._title=this._study.title(),e=this._study.isVisible()?$.t("n/a"):"",i=0;i<this._items.length;++i)this._items[i].setValue(e);if(t.enabled("hide_last_na_study_output")&&this._items.length&&this._items[this._items.length-1].setValue(""),!this._model.timeScale().isEmpty()){if(o=this._study.metaInfo().plots,n=null,r={},o)for(i=0;i<o.length;i++)(this._study.isSelfColorerPlot(i)||this._study.isOHLCColorerPlot(i))&&(r[o[i].target]={index:i},r[o[i].target].palette=this._study.metaInfo().palettes[o[i].palette],r[o[i].target].paletterProps=this._study.properties().palettes[o[i].palette]);for(s=this._study.data().size()-1,a=this._model.crossHairSource().appliedIndex(),c=this._study.formatter(),h={},i=0;i<this._items.length;++i)u=this._items[i],d=u.plotId,p=u.plotIndex,_=this._study.offset(d),void 0!==(f=isNumber(a)?this._study.nearestIndex(a-_,l.NearestLeft):s)&&(m=h[d],void 0===m&&(m=this._study.getMinFirstBarIndexForPlot(d),h[d]=m),m>f||(g=this._study.data().last(),null!==(v=this._study.data().valueAt(f)||(null!==g?g.value:null))&&(y=v[p+1],isNumber(y)&&(u.setValue(c.format(y)),b=this._study.properties().styles[d].color.value(),this._study.isOHLCSeriesPlot(p)&&(d=o[p].target,b=this._study.properties().ohlcPlots[d].color.value()),r[d]&&v.length>r[d].index+1?(S=v[r[d].index+1],void 0!==S&&null!==S?(n=r[d].palette,w=r[d].paletterProps,T=n.valToIndex?n.valToIndex[S]:S,this._items[i].setColor(w.colors[T].color.value())):this._items[i].setColor(b)):this._items[i].setColor(b)))))}},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},inherit(n,o),e.StudyDataWindowView=o,e.DataVendorStudyDataWindowView=n}).call(e,i(5))},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._study=t,
this._inputValueReplacements={NONE:"Default"}}var n=i(329);inherit(o,n),o.prototype.color=function(){return this._study._failed||this._study.metaInfo&&this._study.metaInfo().isTVScriptStub?"#ff0000":n.prototype.color.call(this)},o.prototype.update=function(){this._study._failed?this._text=this._study.title(!0,this._inputValueReplacements)+": "+this._study.status():this._text=this._study.title(!0,this._inputValueReplacements)+" "+this._study.status()},t.exports=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(135),n=i(177),r=function(){function t(t){void 0===t&&(t=!1),this._dwm=t}return t.prototype.format=function(t){var e=(new n.DateFormatter).format(t);return this._dwm||(e+=" "+(new o.TimeFormatter).format(t)),e},t.prototype.formatLocal=function(t){var e=(new n.DateFormatter).formatLocal(t);return this._dwm||(e+=" "+(new o.TimeFormatter).formatLocal(t)),e},t}(),e.DateTimeFormatter=r},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e),this.properties().listeners().subscribe(this,o.prototype.changeStyles),this._beingCreatedPaneView=new n(this,t),this._anchorsPaneView=new r(this,t),this._constructor=i,this._studyId=null,this._nonseriesdata=null,this._indexes=null,this._metaInfo=null,this._graphics=null,this._inputs=null}function n(t,e){l.call(this,t,e),this._lineRenderer1=new c,this._lineRenderer2=new c,this._medianRenderer=new h}function r(t,e){l.call(this,t,e)}var s=i(9).ensureNotNull,a=i(1).LineDataSource,l=i(371).LineSourcePaneView,c=i(376).VerticalLineRenderer,h=i(110).TrendLineRenderer,u=i(131).SelectionRenderer,d=i(53).CompositeRenderer,p=i(219),_=i(19).PlotList,f=i(33),m=i(3).propertyPages,g=i(74).LineEnd;inherit(o,a),o.prototype.pointsCount=function(){throw Error("Reimplement this in a child class")},o.prototype.title=function(){return this._metaInfo.description},o.prototype.studyId=function(){return this._metaInfo.id},o.prototype._requestStudy=function(){throw Error("Reimplement this in a child class")},o.prototype.changeStyles=function(){var t,e,o,n=i(84);if(this._inputs){t=n.splitInputs(this.properties().inputs.state()),e=t.obj;for(o in e)if(e[o]!==this._inputs[o]){this._inputs=e,this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf());break}}else t=n.splitInputs(this.properties().inputs.state()),this._inputs=TradingView.clone(t.obj),this._requestStudy(),this._properties.lastUpdateTime.setValue((new Date).valueOf())},o.prototype._checkTurnaround=function(t){return t===this._turnaround||t===this._model.mainSeries()._turnaround||t===this._model.mainSeries()._turnaround+"_"+this._turnaround},o.prototype.stop=function(){a.prototype.stop.call(this),this._studyId&&(this._model.chartApi().removeStudy(this._studyId),this.disconnect())},o.prototype.onData=function(t){throw Error("Reimplement this in a child class")},o.prototype._correctedPoint=function(t){var e=s(this._model.mainSeries().bars().firstIndex()),i=s(this._model.mainSeries().bars().lastIndex());return t.index=Math.max(t.index,e),t.index=Math.min(t.index,i),t},
o.prototype.addPoint=function(t){return a.prototype.addPoint.call(this,this._correctedPoint(t))},o.prototype.setLastPoint=function(t){return a.prototype.setLastPoint.call(this,this._correctedPoint(t))},o.prototype.move=function(t){},o.prototype.clearData=function(){void 0!==this.m_data&&(this.m_data=new _(this._plotFields)),this._nonseriesdata=null,this._indexes=null,this._graphics=new p(this._metaInfo),this.updateAllViews()},o.prototype.state=function(t){var e=a.prototype.state.call(this,t);return t&&(void 0!==this.m_data&&(e.data=this.m_data.state()),e.nonseriesdata=this._nonseriesdata,e.nonseriesindexes=this._indexes,e.graphics=this._graphics.graphics()),this.metaInfo()instanceof f?e.metaInfo=this.metaInfo().state():(e.metaInfo=$.extend({},this.metaInfo()),e.metaInfo.id=f.parseIdString(e.metaInfo.id+(e.metaInfo.version?"-"+e.metaInfo.version:"")).fullId),e},o.prototype.restoreData=function(t){void 0!==this.m_data&&void 0!==t.data&&this.m_data.restoreState(t.data),this._nonseriesdata=t.nonseriesdata?t.nonseriesdata:null,this._indexes=t.nonseriesindexes?t.nonseriesindexes:null,this._graphics.setGraphics(t.graphics?t.graphics:p.emptyGraphics())},o.prototype.setPoint=function(t,e){this._nonseriesdata=null,this._indexes=null,a.prototype.setPoint.call(this,t,this._correctedPoint(e))},o.prototype.disconnect=function(){this._studyId=0},o.prototype.graphics=function(){return this._graphics.graphics()},o.prototype.firstValue=function(){return this._model.mainSeries().firstValue()},o.prototype.metaInfo=function(){return this._metaInfo},o.prototype.getMinFirstBarIndexForPlot=function(){return-1/0},o.prototype.getInputsPropertyPage=function(){return m.StudyLineDataSourcePropertyPage},o.prototype.getStylesPropertyPage=function(){return m.StudyStylesPropertyPage},o.prototype.paneViews=function(t){var e,i=[];return this._isReady()?null!==(e=a.prototype.paneViews.call(this,t))&&(i=i.concat(e)):i.push(this._beingCreatedPaneView),i.push(this._anchorsPaneView),i},o.prototype._isReady=function(){return!0},inherit(n,l),n.prototype.renderer=function(){var t,e,i,o,n,r,s,a;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._points.length<2?null:(t=new d,e=this._points[0],i=this._points[1],o=this._model.timeScale().width(),n=this._source.priceScale().height(),r={},r.width=o,r.height=n,r.points=[e],r.color="#808080",r.linewidth=1,r.linestyle=CanvasEx.LINESTYLE_SOLID,this._lineRenderer1.setData(r),t.append(this._lineRenderer1),s={},s.width=o,s.height=n,s.points=[i],s.color="#808080",s.linewidth=1,s.linestyle=CanvasEx.LINESTYLE_SOLID,this._lineRenderer2.setData(s),t.append(this._lineRenderer2),a={points:[e,i],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:"#808080",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:g.Normal,rightend:g.Normal},this._medianRenderer.setData(a),t.append(this._medianRenderer),t)},inherit(r,l),r.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t=new d
;return this.isAnchorsRequired()&&(t.append(new u({points:this._points})),t.append(this.createLineAnchor({points:this._points}))),t},e.StudyLineDataSource=o},function(t,e,i){"use strict";function o(t,e){var o=e||new c("linetoolarrowmark");l.call(this,t,o),i.e(1).then(function(e){var o=i(406).TextPaneView,n=i(407).MarkPaneView,r=[new n(this,t,this.image,this.width,this.height,this.offsetX,this.offsetY)],s=this._createTextPaneView(o);null!==s&&r.push(s),this._setPaneViews(r)}.bind(this).bind(null,i)).catch(i.oe)}function n(t,e){this._constructor="LineToolArrowMarkLeft",o.call(this,t,e)}function r(t,e){this._constructor="LineToolArrowMarkUp",o.call(this,t,e)}function s(t,e){this._constructor="LineToolArrowMarkRight",o.call(this,t,e)}function a(t,e){this._constructor="LineToolArrowMarkDown",o.call(this,t,e)}var l=i(1).LineDataSource,c=i(6).DefaultProperty,h=i(3).propertyPages;inherit(o,l),o.prototype.width=21,o.prototype.height=21,o.prototype.offsetX=0,o.prototype.offsetY=0,o.prototype.paneViews=function(t){var e=l.prototype.paneViews.call(this,t);return null!==e&&this._textPaneView&&e.push(this._textPaneView),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Arrow Mark"},o.prototype.getStylesPropertyPage=function(){return h.LineToolArrowMarkStylesPropertyPage},o.prototype._createTextPaneView=function(t){return null},inherit(n,o),n.prototype.image=new Image,n.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB50lEQVR4AWMgETAKKAgIAGkQ5mCgAmCWdtTWV4yxvgFkWwKxOKUGssr5Gccrx9t+Vk6w+w/kxwKxIrmGMTKIivIohFvONKsI+e/cl/ofamgGECuTYyCTqJ2mqlK01Vnr+uj/HjNy/1v1J8AMzSTHUBYZP6MgpTjb97bNsf9dpmf9N++J/W/UEQEztAiIbUEGo2EpIObE8C4oVuVDzLuBmv869aT8t5+c+t+0K/q/YXs4GGsWeIAMRscwy/yhBiO8K2ijJKcYZXXYuj7qv/u0nP/W/Yn/jTsjQYYRwliDhUXKy8BVKdbmuW1T7H+3Gdn/LXrjQN4FaSDLUBa5MItyoOAvp67k/45T0pC9S56hSrHWhY4tif9D5pUDXZjz36w7Blkx+S5VDLNoBUWMY3fKfwdExMAw+WEq7Wvkoxhn+waUhFwRSYhcQxGxL26jpqQYbX3CBpjY3aeDYj+BothHpFNxcW75cIvJpmXB/516Uv/bT0r5b9IVRUY6xQSssr6GkcAc9dGuNe6/y7RMMnMUJmCWcNTSBgbHZeuG6P+eM/P+W/VRlPcRwSGoJMgvH265yKIq/L9LfzqKoZSXp0Em6cDy9BvU0Dhyy1PM4PAwMFWKs7kFZFsBsQQDlQAjr4a0MJAWxFdHAQAcI3sGHsO1dgAAAABJRU5ErkJggg==",n.prototype.offsetX=1,n.prototype.offsetY=-10,n.prototype.title=function(){return"Arrow Mark Left"},n.prototype._createTextPaneView=function(t){var e=new t(this,this._model,22,-3,"middle","left");return e.disableSelection(),e},inherit(r,o),r.prototype.image=new Image,
r.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACBklEQVR4AWMgErAoxVoXgmgGKgEWxTCLVseWxP9yYRbl1DCYSdrXyEc5we5vyLzy/0D6l5SXgStInFwDGcVt1JQU42zfOHan/HebkfPfqSv5v1KszXNBGyU5kDzpRoqLcytGW5+wbY797zA59b9Zd8x/xylp/22bYv8rRlkdBqrgINVIVvlwi8k29dH/Xadn/Tftiv5v2B4Opt1mZP+3ro/6Lx9i3k1K+DLL+hpGmpYF/3efnvPfvCcWZCAcW/TG/XeflvMfFM4yfkZBxIQvo4SjlrZSnO1Hp57U/9b9Cf+NOiKQDQXxgeKJ/516Uv4D1b0XtdNUxRu+gkqC/MBwvGzXGvffflLKf+POSISBCAwWtweGMyi8laKtzjKIivLgCUfLRdYN0f9dpmX+N+mKghiCieHh6wIMb2tguCuEW84E6ccIR7kgk3SLqvD/njPzYOFICIPVeczI/W9WEfJfzs84HmQOIhw9DEyV422/ufSn/7fqg4cjIQxWZwUMd+e+1P9A/Z+lHbX1weHLqyEtrBRncwsYm/+RsWaBBz4DwfLoehRjrG8IKAgIgOMHiK2AOA6IM6G4CKgIr6EgeZA6qPoMII4FYksgFmCA5gwJIFYEYmUotiXSUFuYHqh+cXw5TZlIQ5WxaR4mhuLBZBkqBcT+oJjFg/3B6kgAnFANyniwFEQdJgAAOuN7Bp7MBuYAAAAASUVORK5CYII=",r.prototype.offsetX=-9,r.prototype.offsetY=0,r.prototype.title=function(){return"Arrow Mark Up"},r.prototype._createTextPaneView=function(t){var e=new t(this,this._model,0,18,"top","center");return e.disableSelection(),e},inherit(s,o),s.prototype.image=new Image,s.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB60lEQVR4AWPAAziAWJBXQ1oYSDMyUAlIALGVUpzNLQkPA1Mgm5kahioCcZxygt1/5Xjbb3JBJulAPiulhioDcSbIUJf+9P8WVeH/5cMtFwkqCfKDgoNiQ636Ev57zsz7b90Q/V8x2vqyhKOWNqHg4ARiKZAhaNgWiItAhhp1RPw374n97zIt879da9x/pTjbj7K+hpE4gwNqoD9IMzasWeDx37A9HIxNuqL+209K+e/Uk/rftCwYGBwWkxnExbkRwYHpTZBGgti4M/K/dX/Cf/fpOf9t6sHBcULcRk0JaAYT6YYiMDw4XKdn/bdtjv2vGGf7RtrXyAdoDguZhiKwaVf0f4fJqf8du1NAQfVXMcyiFWQwmYYisFl3zH+3GTn/Q+aV/3dsSfyvFGtdSLFLHaek/XfqSga59JdcmEU5yKVkh6lFbxzQhdn/bZtiga6zeS7lZeAKMpCC2E/87z4t5791fdR/xSirw4I2SnKg2CcxnSK8aw+MGKceSMTIh5h3Q0szRvJzFCQJgXLUexk/oyCQd8nP+8DE7jEjF+jd6P9K0VZnRe00VWHeJcfQDJChzn2p/80qQv4rhFvOZBAV5QF5l5LyNBZann6W8zOOp0Z5Kg7Eloox1jekHbX1qVLyQ2NVQEBBQIBU7wIAOFZ7BmG7RzYAAAAASUVORK5CYII=",s.prototype.offsetX=-19,s.prototype.offsetY=-10,s.prototype.title=function(){return"Arrow Mark Right"},s.prototype._createTextPaneView=function(t){var e=new t(this,this._model,-22,-3,"middle","right");return e.disableSelection(),e},inherit(a,o),a.prototype.image=new Image,a.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAB/UlEQVR4AWPAATj3Wij8J4RB6hhIAFIgTS9a8nBhmKFSpBiqDNJ0P80PF4YZqkyyobfD7HDh4WJolaKY+G5zhXvoMXva2xifoWB5dD07zeTvFKvxioDMFY6RFUgEGvzzQVk8OGafVib9v5fkhc9QkDxIHVj9vaKY/7vM5b+HS/JFA80TAhnKA8TGZSoiS057GYFiFqzhTpQTPkNB8iB1YPUnPQz+5ykKzQGaYwjE3CBDmUCuBWKHabqSZ0656oI0EY1B6idoSx4F6reDupIJFrTMQCwtxsYcvNZY5uU5T0OiDDwLdOFKI9knvMzM/kD9kmBz0AAbEKs6iHAX7zSX/3nF3xyvgZd8Tf9vM5P/ZiXAmQdNBazYEgIjEHOBwiVHXmjWcSctnAbeDLH5f8xR83+SjNBEoHo9sD4owGWwIBDb9mtJHMIVviDxDg3x3UB11kDMD9ZHADCDwkeAmdlvhZHMI2C4oRh4xl3//1IDmbvszAxeQHXiUPWEATR8lE0EubJB4QYMP7CBF31M/m82k/usy8uRCpRXAKsjEXCCwiteVqD/qIPG/+tBVv/3WCj8C5Pi7wCKawMxBwMZgBEaXlbtGuI7T7ro/G9QFdsI5JsDMR/+cCQcvuLsLAzubRoSa4FsJyAWBSdwsgEifKVBXoYmcBYGagCoQZzEGggAoyq6zKXuV5gAAAAASUVORK5CYII=",a.prototype.offsetX=-9,a.prototype.offsetY=-18,a.prototype.title=function(){return"Arrow Mark Down"},
a.prototype._createTextPaneView=function(t){var e=new t(this,this._model,0,-23,"bottom","center");return e.disableSelection(),e},s.prototype.version=n.prototype.version=a.prototype.version=r.prototype.version=2,e.LineToolArrowMark=o,e.LineToolArrowMarkLeft=n,e.LineToolArrowMarkRight=s,e.LineToolArrowMarkUp=r,e.LineToolArrowMarkDown=a},function(t,e,i){"use strict";function o(t,e){t.width=e.w,t.height=e.h;var i=t.getContext("2d");i&&i.translate(.5,.5)}function n(t,e){t.width=0,o(t,e)}function r(t,e,i,o,n,r){t.save(),t.translate(-.5,-.5),t.fillStyle=r,t.fillRect(e,i,o,n),t.restore()}function s(t,e){var i=document.createElement("canvas");return t.append(i),o(i,e),i}Object.defineProperty(e,"__esModule",{value:!0}),i(13);var a=function(){function t(t,e){this.w=t,this.h=e}return t.prototype.equals=function(t){return this.w===t.w&&this.h===t.h},t}();e.Size=a,e.resizeCanvas=o,e.hardResizeCanvas=n,e.clearRect=r,e.addCanvasTo=s},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e){this._data=t,this._model=e,this.radius=this._data.radius||n.OUTER_RADIUS}function r(t){o.call(this,t)}var s=i(11),a=i(218).PaneRendererArrowsUpDown;i(64),o.RADIUS=3.5,o.prototype.tolerance=2,o.prototype.draw=function(t){function e(t){return void 0===t.x||TradingView.isNaN(t.x)||null===t.x||void 0===t.y||TradingView.isNaN(t.y)||null===t.y}var i,o,n;if(this._data)for(t.strokeStyle="#6B6B6B",t.fillStyle="#D6D6D6",i=this._data.vertOffset||0,o=0;o<this._data.points.length;o++)n=this._data.points[o],e(n)||this._drawMarker(t,n,i)},o.prototype._drawMarker=function(t,e,i){t.beginPath(),t.arc(e.x+.5,e.y+.5+i,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},o.prototype.hitTest=function(t){var e,i;if(!this._data)return null;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],i.subtract(t).length()<=o.RADIUS+this.tolerance)return new s(this._data.hittestResult,i.data);return null},n.OUTER_RADIUS=TradingView.isMobile.any()?16:8,n.prototype.tolerance=2,n.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h=this._data.currentPoint,u=this._data.outerStrokeWidth||1;for(e=0;e<this._data.points.length;e++)i=this._data.points[e],o=i.subtract(h).length(),n=TradingView.isInteger(i.data)&&this._data.linePointBeingEdited===i.data,r=this.radius,s=this._data.strokeWidth||2,a=o<=r+this.tolerance,l=a?1:0,r+=l,s+=l,n||(i.square?(t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-r,i.y-r,2*r,2*r),t.fillStyle=this._data.color,c=r-u,t.fillRect(i.x-c,i.y-c,2*c,2*c),c=r-u-s,t.fillStyle=this._data.backgroundColor,t.fillRect(i.x-c,i.y-c,2*c,2*c)):(t.beginPath(),t.arc(i.x,i.y,r,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill(),t.beginPath(),t.arc(i.x,i.y,r-u,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.color,t.fill(),t.beginPath(),t.arc(i.x,i.y,r-u-s,0,2*Math.PI,!0),t.closePath(),t.fillStyle=this._data.backgroundColor,t.fill()))},n.prototype.hitTest=function(t){var e,i,o;for(e=0;e<this._data.points.length;e++)if(i=this._data.points[e],o=i.subtract(t).length(),
o<=this.radius+this.tolerance)return new s(this._data.hittestResult,i.data);return null},inherit(r,o),r.prototype._drawMarker=function(t,e,i){var n=e.isUp?1:-1,r=a.prototype._calculateVerticalOffset(this._data.barSpacing),s=a.prototype._calculateMinHeight(this._data.barSpacing),l=i+n*r+n*s;t.beginPath(),t.arc(e.x+.5,e.y+.5+l,o.RADIUS,0,2*Math.PI,!0),t.closePath(),t.fill(),t.stroke()},e.SelectionRenderer=o,e.LineAnchor=n,e.SelectionRendererArrowsUpDown=r},function(t,e,i){"use strict";function o(t,e,i){function o(t,e,i,o,n,r){var s=0;return t<i?s|=1:t>n&&(s|=2),e<o?s|=4:e>r&&(s|=8),s}for(var n,r,s,a=t[0].x,l=t[0].y,c=t[1].x,h=t[1].y,u=e.x,d=e.y,p=i.x,_=i.y,f=o(a,l,u,d,p,_),g=o(c,h,u,d,p,_),v=!1,y=0;;){if(y>1e3)throw Error("Cohen - Sutherland algorithm: infinity loop");if(y++,!(f|g)){v=!0;break}if(f&g)break;n=f||g,r=void 0,s=void 0,8&n?(r=a+(c-a)*(_-l)/(h-l),s=_):4&n?(r=a+(c-a)*(d-l)/(h-l),s=d):2&n?(s=l+(h-l)*(p-a)/(c-a),r=p):(s=l+(h-l)*(u-a)/(c-a),r=u),n===f?(a=r,l=s,f=o(a,l,u,d,p,_)):(c=r,h=s,g=o(c,h,u,d,p,_))}return v?m.equalPoints(m.point(a,l),m.point(c,h))?m.point(a,l):m.lineSegment(m.point(a,l),m.point(c,h)):null}function n(t,e){var i,o,n=t.A,r=e.A,s=t.B,a=e.B,l=t.C,c=e.C,h=n*a-r*s;return Math.abs(h)<1e-6?null:(i=(s*c-a*l)/h,o=(r*l-n*c)/h,new m.Point(i,o))}function r(t,e,i,o){var n,r=e.subtract(t),s=o.subtract(i),a=r.x*s.y-r.y*s.x;return Math.abs(a)<1e-6?null:(n=t.subtract(i),(n.y*s.x-n.x*s.y)/a)}function s(t,e,i,o){var n,s,a,l=r(t,e,i,o);return null===l?null:(n=e.subtract(t),s=n.scaled(l).add(t),a=g.distanceToSegment(i,o,s),Math.abs(a.distance)<1e-6?l:null)}function a(t,e){return-(t.C+t.B*e)/t.A}function l(t,e){return-(t.C+t.A*e)/t.B}function c(t,e){var i,o,n;for(i=0,o=t;i<o.length;i++)if(n=o[i],m.equalPoints(n,e))return!1;return t.push(e),!0}function h(t,e,i){var o,n,r,s,h,u=e.x,d=e.y,p=i.x,_=i.y;if(0===t.A)return o=-t.C/t.B,d<=o&&o<=_?m.lineSegment(m.point(u,o),m.point(p,o)):null;if(0===t.B)return n=-t.C/t.A,u<=n&&n<=p?m.lineSegment(m.point(n,d),m.point(n,_)):null;switch(r=[],s=function(e){var i=l(t,e);d<=i&&i<=_&&c(r,new m.Point(e,i))},h=function(e){var i=a(t,e);u<=i&&i<=p&&c(r,new m.Point(i,e))},s(u),h(d),s(p),h(_),r.length){case 0:return null;case 1:return r[0];case 2:return m.equalPoints(r[0],r[1])?r[0]:m.lineSegment(r[0],r[1])}return f.assert(!1,"We should have at most two intersection points"),null}function u(t,e,i,o){var n,r=s(t,e,i,new m.Point(o.x,i.y)),a=s(t,e,new m.Point(o.x,i.y),o),l=s(t,e,o,new m.Point(i.x,o.y)),c=s(t,e,new m.Point(i.x,o.y),i),h=[];return null!==r&&r>=0&&h.push(r),null!==a&&a>=0&&h.push(a),null!==l&&l>=0&&h.push(l),null!==c&&c>=0&&h.push(c),0===h.length?null:(h.sort(function(t,e){return t-e}),n=v.pointInRectangle(t,i,o)?h[0]:h[h.length-1],t.addScaled(e.subtract(t),n))}function d(t,e){return!(t.length>0&&m.equalPoints(t[t.length-1],e))&&(t.push(e),!0)}function p(t,e){var i,o,r,s,a,l=[];for(i=0;i<t.length;++i)o=t[i],r=t[(i+1)%t.length],s=m.lineThroughPoints(o,r),v.pointInHalfplane(o,e)?(d(l,o),
v.pointInHalfplane(r,e)||null!==(a=n(s,e.edge))&&d(l,a)):v.pointInHalfplane(r,e)&&null!==(a=n(s,e.edge))&&d(l,a);return l.length>=3?l:null}function _(t,e){var i,o,n,r,s,a=t;for(i=0;i<e.length&&null!==a;++i)o=e[i],n=e[(i+1)%e.length],r=e[(i+2)%e.length],s=m.lineThroughPoints(o,n),a=p(a,m.halfplaneThroughPoint(s,r));return a}var f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),f=i(9),m=i(8),g=i(44),v=i(60),e.intersectLineSegmentAndRectangle=o,e.intersectLines=n,e.intersectLineSegments=s,e.intersectLineAndRectangle=h,e.intersectRayAndRectangle=u,e.intersectPolygonAndHalfplane=p,e.intersectPolygons=_},function(t,e,i){"use strict";var o,n=function(t,e,o){var r,s,a,l,c,h;t=$(t),o=o||{},o.activeClass=o.activeClass||"",r=(o.event||"click")+".popup-menu",o.hideEvent&&(s=o.hideEvent+".popup-menu"),a=function(){},l=a,c={},h=function(r,s,h){function u(e){var i=$(e.target).parents().andSelf();i.is(f)||i.is(t)||i.is(".charts-popup-tab-headers, .charts-popup-itemheader")||l()}function d(t){var e=$(t.target).parents().andSelf();e.is(".charts-popup-tab-headers, .charts-popup-itemheader")||o.notCloseOnButtons&&e.is(".icon-delete")||l()}function p(e,r,s){var a,l,c,h,u,d,_,m,g,v,y,b,S,w,T,C;if(e instanceof n.TabGroup){if(!e.tabs||!e.tabs.length)return;return 1!==e.tabs.length||e.tabs[0].title?(a=$('<div class="charts-popup-tab-group"></div>').appendTo(s),l=$('<div class="charts-popup-tab-headers"></div>').appendTo(a),c=null,void $.each(e.tabs||[],function(t,i){var o,n;i.items&&i.items.length&&(o=$('<div class="charts-popup-tab"></div>').hide().appendTo(a),$.each(i.items,function(){p(this,void 0,o)}),n=$('<span class="charts-popup-tab-header">').append($('<a href="javascript://" class="charts-popup-tab-header-label">').text(i.name)).appendTo(l),n.on("click",function(t){n.is(".active")||(l.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),a.find(".charts-popup-tab").hide(),o.show(),t&&t.preventDefault(),"function"==typeof e.onChange&&e.onChange.call(e,i.name))}),c&&!i.active||(c=n,l.find(".charts-popup-tab-header.active").removeClass("active"),n.addClass("active"),a.find(".charts-popup-tab").hide(),o.show()))})):void $.each(e.tabs[0].items,function(){p(this,void 0,s)})}return e instanceof n.Group?(h=$('<div class="charts-popup-group"></div>').appendTo(s),e.title&&(u=$('<div class="charts-popup-itemheader"></div>').text(e.title).prepend($('<span class="charts-popup-itemheader-icon"></span>')),e.collapsible&&(h.addClass("charts-popup-group-collapsible"),h.toggleClass("collapsed",e.collapsed),u.on("click",function(){h.toggleClass("collapsed"),"function"==typeof e.onChange&&e.onChange(h.hasClass("collapsed")),f.height()===parseInt(f.css("max-height"))?f.addClass("popup-menu-scroll-y"):f.height()<parseInt(f.css("max-height"))&&f.removeClass("popup-menu-scroll-y")})),h.append(u)),void $.each(e.items,function(t){p(this,1,h)})):e instanceof n.Header?void s.append($('<div class="charts-popup-itemheader"></div>').text(e.title)):e.separator?(d=$('<span class="separator"></span>'),
void s.append(d)):(d=$('<a class="item" href="#">'),e.url&&d.attr("href",e.url),e.target&&d.attr("target",e.target),r||d.addClass("first"),"function"==typeof e.active?e.active(e)&&d.addClass("active"):e.active&&d.addClass("active"),e.addClass&&d.addClass(e.addClass),e.addData&&d.data(e.addData),e.disabled&&d.addClass("disabled"),"function"==typeof e.action&&(_=e.action,m=function(t){$(t.target).parents().andSelf().is(w)||(_.apply(d,arguments),!e.url&&t&&"function"==typeof t.preventDefault&&t.preventDefault())},o.upAction?d.bind("mouseup",m):d.bind("click",m)),e.date?(g=$('<span class="title"></span>').appendTo(d),$('<span class="date"></span>').text(e.date||"").appendTo(d)):e.icon&&!o.svg?(v=$('<span class="icon"></span>').appendTo(d),v.css("background-image",e.icon.image||""),e.icon.offset&&v.css("background-position","string"==typeof e.icon.offset?e.icon.offset:e.icon.offset.x+"px "+e.icon.offset.y+"px"),g=$('<span class="title"></span>').appendTo(d)):!0===o.svg&&e.svg?(o.wrapIcon?d.append($('<span class="icon-wrap">').addClass(e.iconClass).append(e.svg)):d.append(e.svg),g=$('<span class="title"></span>').appendTo(d)):e.iconClass?(d.append($('<span class="icon"></span>').addClass(e.iconClass)),g=$('<span class="title"></span>').appendTo(d)):g=$('<span class="title-expanded"></span>').appendTo(d),e.html?g.html(e.html):g.text(TradingView.clean(e.title,!0)||""),y=$('<span class="shortcut"></span>').appendTo(d),e.shortcut&&y.text(e.shortcut.keys),"function"==typeof e.deleteAction&&(b=e.deleteAction,S=e.deleteAction.title||$.t("Delete"),w=$('<span class="icon-delete">'),w.html(i(169)),w.attr("title",S),w.on("click",function(t){b.apply(d,arguments),t.preventDefault()}),d.append(w)),e.buttons instanceof Array&&e.buttons.length&&e.buttons.forEach(function(t){t.el instanceof $||(t.el=$(t.el)),t.el.appendTo(d),t.handler&&t.el.on("click",function(e){t.handler.apply(d,arguments)})}),void 0!==e.counter&&("function"==typeof e.counter?(T=$('<span class="counter"></span>').html(e.counter()),T.appendTo(d)):(C=e.counterBlue?"blue":"",$('<span class="counter"></span>').text(e.counter+"").addClass(C).appendTo(d))),s.append(d),void t.data("popup-menu",s))}var _,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N=s||e;if("function"==typeof N&&(N=N()),$(this).hasClass("open")||$(this).hasClass("active"))return r.preventDefault(),l(),void(_=c.scrollTop);switch(l=function(){c.scrollTop=f.scrollTop(),f.remove(),t.removeClass("active open "+o.activeClass),t.data("popup-menu",null),$(document).off("click",d),$(document).off("mousedown",u),Modernizr.touch&&$(document).off("touchstart.chartgui",u),$(document).off("selectstart.popup-menu"),l=a,o.onRemove&&o.onRemove()},t.addClass("active open "+o.activeClass),f=$('<div class="charts-popup-list">'),o.addClass&&f.addClass(o.addClass),o.zIndex&&f.css("z-index",o.zIndex),m=f,o.listInner&&(m=$('<div class="list-inner">').appendTo(m)),o.listTable&&(m=$('<div class="list-table">').appendTo(m)),$.each(N,function(t){p(this,t,m)}),setTimeout(function(){$(document).on("click",d),
$(document).on("mousedown",u),Modernizr.touch&&$(document).on("touchstart.chartgui",u)},0),o.upAction&&$(document).on("selectstart.popup-menu",function(){return!1}),f.appendTo(document.body),g=$(window).width(),v=Math.min($(window).height(),$("body").height()),y=t.outerWidth(),b=t.outerHeight(),S=t.offset(),_=$(window).scrollTop()||0,S.top-=_,S.top=Math.round(S.top),S.left=Math.round(S.left),w=f.outerWidth(),T=f.outerHeight(),C=void 0!==o.viewportSpacing?o.viewportSpacing:10,x=o.popupSpacing?~~o.popupSpacing:1,P=o.popupDrift?~~o.popupDrift:0,L=T-f.height(),I="down",o.direction&&(I="function"==typeof o.direction?o.direction():o.direction),k=!!o.reverse,"down"===I?(A=v-S.top-b-x-C-L,M=S.top-x-C-L,A<Math.max(T||0,100)&&M>A&&(I="up")):"right"===I&&(E=g-S.left-y-x-C-L,D=S.left-x-C-L,E<Math.max(w||0,100)&&D>E&&(I="left")),I){case"down":case"up":"down"===I?f.css("top",S.top+b+x+"px"):f.css("bottom",v-S.top+x+"px").css("top","auto"),k?f.css("left",Math.max(S.left+P+y-w,C)+"px").css("right","auto"):f.css("left",S.left+P+"px").css("right","auto");break;case"right":case"left":x=Math.max(x,4),"right"===I?f.css("left",Math.floor(S.left+y+x)+"px").css("right","auto"):f.css("left",Math.floor(Math.max(S.left-w-x,C))+"px").css("right","auto"),k?f.css("top",Math.floor(Math.max(S.top+P+b-T,C))+"px"):f.css("top",Math.floor(S.top+P)+"px")}for(f.show(),V=S.top,"up"===I||{left:1,right:1}[I]&&k?"up"!==I?V+=b:V-=b+x+L+C:V=v-V-b-2*x-L,f.height()>V&&f.addClass("popup-menu-scroll-y"),f.css("max-height",V+"px"),o.careRightBorder&&(O=g+$(window).scrollLeft(),parseInt(f.css("left"))+f.width()+C>O&&f.css("left",O-f.width()-C+"px").css("right","auto")),o.careBottomBorder&&parseInt(f.css("top"))+f.height()+C>v+_&&f.css("top",v-f.height()-C+_+"px"),B=t.parents().andSelf(),z=B.size();z--;)if("fixed"===B.eq(z).css("position")){R=B.eq(z);break}R&&(F=f.offset(),f.css({position:"fixed",left:F.left-$(document).scrollLeft(),right:"auto"})),f[0].scrollHeight>f.height()&&f.addClass("popup-with-scroll"),r&&r.preventDefault()},r&&t.bind(r,h),s&&t.bind(s,function(){l()}),o.runOpened&&h()};n.TabGroup=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.tabs=[],"function"==typeof e.onChange&&(this.onChange=e.onChange)},n.TabGroup.prototype.appendTab=function(t,e,i){if(null==t?t="":t+="",e||(e=[]),i||(i={}),!Array.isArray(e))throw new TypeError("items must be an array");return this.tabs.push({name:t,items:e,active:!!i.active}),e},n.Header=function t(e){if(!(this instanceof t))return new t(e);this.title=e},n.Group=function t(e){if(!(this instanceof t))return new t(e);e=e||{},this.items=[],this.title=null==e.title?"":e.title+"",this.collapsible=!!e.collapsible,this.collapsed=!!e.collapsed,"function"==typeof e.onChange&&(this.onChange=e.onChange)},n.Group.prototype.push=function(){this.items.push.apply(this.items,arguments)},e.bindPopupMenu=n,o=function(t){t=$(t),t.unbind(".popup-menu"),t.removeData("popup-menu")},e.unbindPopupMenu=o},function(t,e,i){"use strict";function o(t){return t in $.fn?Promise.resolve():(r||(r=new Promise(function(t){
i.e(7).then(function(e){i(390),t()}.bind(null,i)).catch(i.oe)})),r)}function n(t){return new s(t)}var r,s;Object.defineProperty(e,"__esModule",{value:!0}),i(13),s=function(){function t(t){this._$elem=t}return t.prototype.draggable=function(){var t=arguments,e=this._$elem;return o("draggable").then(function(){return e.draggable.apply(e,t)})},t.prototype.resizable=function(){var t=arguments,e=this._$elem;return o("resizable").then(function(){return e.resizable.apply(e,t)})},t.prototype.sortable=function(){var t=arguments,e=this._$elem;return o("sortable").then(function(){return e.sortable.apply(e,t)})},t.prototype.datepicker=function(){var t=arguments,e=this._$elem;return o("datepicker").then(function(){return e.datepicker.apply(e,t)})},t}(),e.LazyJqueryUI=s,e.lazyJqueryUI=n},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(28),n=function(){function t(t){this._formatStr=t||"%h:%m:%s"}return t.prototype.format=function(t){return o.customFormatters.timeFormatter?o.customFormatters.timeFormatter.format(t):this._formatStr.replace("%h",o.numberToStringWithLeadingZero(t.getUTCHours(),2)).replace("%m",o.numberToStringWithLeadingZero(t.getUTCMinutes(),2)).replace("%s",o.numberToStringWithLeadingZero(t.getUTCSeconds(),2))},t.prototype.formatLocal=function(t){return o.customFormatters.timeFormatter?o.customFormatters.timeFormatter.formatLocal?o.customFormatters.timeFormatter.formatLocal(t):o.customFormatters.timeFormatter.format(t):this._formatStr.replace("%h",o.numberToStringWithLeadingZero(t.getHours(),2)).replace("%m",o.numberToStringWithLeadingZero(t.getMinutes(),2)).replace("%s",o.numberToStringWithLeadingZero(t.getSeconds(),2))},t}(),e.TimeFormatter=n},function(t,e,i){"use strict";function o(t,e,o,r){var s=n.loadPropertyPages();return new Promise(function(n){i.e(8).then(function(a){s.then(function(){var s=i(412),a=new s(t,e,r);a.show(o),n(a)})}.bind(null,i)).catch(i.oe)})}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3);e.showEditObjectDialog=o},,,,,,,,function(t,e,i){"use strict";function o(t,e){var i,o,n;return void 0===e&&(e=!1),i=t.data("commonTooltipText")||"",o=t.attr("title"),i||o||e?(i=s(t),n={h:t.outerHeight(),w:t.outerWidth(),x:t.offset().left-$(window).scrollLeft(),y:t.offset().top-$(window).scrollTop()},{above:t.hasClass("common-tooltip-above"),below:t.hasClass("common-tooltip-below"),html:t.hasClass("common-tooltip-html"),otl:t.hasClass("common-tooltip-otl"),otr:t.hasClass("common-tooltip-otr"),fixed:t.hasClass("common-tooltip-fixed"),rect:n,text:i,vertical:t.hasClass("common-tooltip-vertical"),tooltipDelay:parseInt(t.attr("data-tooltip-delay")),colorTheme:t.data("color-theme")||""}):null}function n(t){var e=-1!==g.indexOf(t)?m[t]:"";d.removeClass(g.filter(function(t){return!!t}).map(function(t){return m[t]}).join(" ")),e&&!d.hasClass(e)&&d.addClass(e)}function r(t){var e,i,o,n,r=t.rect;r&&(d.attr("class","common-tooltip-wrapper").css({bottom:"auto",left:"auto",right:"auto",top:"auto"}),Modernizr.pointerevents||d.addClass("no-pointer-events"),
d.toggleClass("pointer-events-auto",!!t.pointerEventsAuto),p.css({left:"0",width:"auto"}),p.width(p.width()+2),e=$(window).width(),i=$(window).height(),o=t.vertical,(o&&r.w<20||!o&&r.h<20)&&d.addClass("farther"),n="",o?(d.addClass("vertical").css({left:r.x+r.w,top:r.y-(d.outerHeight()-r.h)/2}),n=t.otr?"otr":t.otl||p.offset().left+p.outerWidth()+u>e?"otl":"otr","otl"===n?d.addClass("otl").css({left:"auto",right:e-r.x}):d.addClass("otr")):(d.css({bottom:i-r.y,left:r.x-(d.outerWidth()-r.w)/2}),n=t.above?"above":t.below||p.offset().top-$(window).scrollTop()<u?"below":"above","below"===n?d.addClass("below").css({bottom:"auto",top:r.y+r.h}):d.addClass("above"),p.offset().left-u<0?p.css("left",Math.abs(p.offset().left)+u):p.offset().left+p.outerWidth()+u>e&&(t.fixed||p.css("left",e-(p.offset().left+p.outerWidth()+u)))))}function s(t){var e=t.data("commonTooltipText")||"",i=t.attr("title");return void 0!==i&&(e=i,t.data("commonTooltipText",e),t.removeAttr("title")),e}function a(){clearTimeout(_),clearTimeout(f),document.body.contains(d[0])&&(d.css("opacity","0"),f=setTimeout(d.detach.bind(d),h/2))}function l(t,e){var i,n;void 0===e&&(e={}),i=$(t),0!==i.length&&(n=!(!e.text&&!e.$inner),e=$.extend({},o(i,n),e),$.isEmptyObject(e)||""===e.text&&!e.$inner||c(e))}function c(t){var e=document.body.contains(d[0]);if(clearTimeout(_),clearTimeout(f),!e)return void(_=setTimeout(function(){d.appendTo(document.body),c(t)},"number"!=typeof t.tooltipDelay||isNaN(t.tooltipDelay)?h:t.tooltipDelay));p.toggleClass("common-tooltip-body--width_wide",!!t.wide),t.$inner?p.empty().append(t.$inner):t.html?p.html(t.text||""):p.text(t.text||""),r(t),n(t.colorTheme||"default"),d.addClass(t.addClass||""),d.css("opacity","1"),t.forceHideOnMove&&$(document).on("mousemove.common-tooltip-force-hide",function(){$(document).off("mousemove.common-tooltip-force-hide"),a()})}var h,u,d,p,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),i(582),i(13),i(43),h=500,u=10,d=$("<div>").css("opacity","0"),p=$('<div class="common-tooltip-body">').appendTo(d),_=0,f=0,m={default:"",white:"theme-white","round-shadow":"theme-round-shadow"},g=Object.keys(m),e.updateTooltipText=s,e.hide=a,e.showOnElement=l,e.show=c,Modernizr.touch||$(document).on("mouseenter",".apply-common-tooltip",function(t){var e,i,o,n=t.originalEvent;if("buttons"in n){if(1&n.buttons)return}else if(1===t.which)return;e=$(this),i=function(){l(e)},i(),o=function(){e.off("common-tooltip-update",i),e.off("mouseleave mousedown",o),$(document).off("scroll",o),a()},e.on("common-tooltip-update",i),e.on("mouseleave mousedown",o),$(document).on("scroll",o)})},function(t,e,i){"use strict";function o(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.createDialog)(n({},s,t))}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},e.createNoticeDialog=o,r=i(65),s={width:400,destroyOnClose:!0,title:$.t("Notification"),
content:$.t("You are notified"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',actions:[{name:"ok",type:"primary",text:$.t("Ok"),method:"close",key:[13,32]}]}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 9" width="11px" height="9px"><path fill="none" fill-rule="evenodd" stroke-width="2" d="M1 3.22l3.415 3.496L10 1"/></svg>'},function(t,e,i){"use strict";function o(t){return"."+t.replace(/\+/g,"")}function n(t,e){var i=o(t);c.unbind("keydown"+i).bind("keydown"+i,t,function(t){$(t.target).is("input[type=password]")||h||e.apply(null,Array.prototype.slice.call(arguments))}),l[t]=e}function r(t){c.unbind("keydown"+o(t)),delete l[t]}function s(){h=!0}function a(){h=!1}var l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(13),l={},c=$(document),h=!1,e.bind=n,e.unbind=r,e.disable=s,e.enable=a},function(t,e,i){"use strict";var o=i(199).TVLocalStorage;i(64),TradingView.FeatureToggle={force_prefix:"forcefeaturetoggle.",enableFeature:function(t){o.setItem(this.force_prefix+t,"true")},disableFeature:function(t){o.setItem(this.force_prefix+t,"false")},resetFeature:function(t){o.removeItem(this.force_prefix+t)}},TradingView.isFeatureEnabled=function(t){function e(e){var i=Math.random()<=t[e];return o.setItem(n+e,i),i}function i(t){return-1===["address-autocomplete-google-key","black_friday","black_friday_popup","black_friday_mainpage","coinbase_payments","ios_app_info","symbol_search_server_highlight","text_notes","multiple-sos","datawindow"].indexOf(t)&&-1===t.indexOf("-maintenance")}var n="featuretoggle.";return function(r){var s,a;return!(!s&&"local"!==window.environment||!i(r))||(!t[r]||-1!==t[r])&&(!!("true"===o.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"true"===user.settings[TradingView.FeatureToggle.force_prefix+r])||!("false"===o.getItem(TradingView.FeatureToggle.force_prefix+r)||window.is_authenticated&&"undefined"!=typeof user&&user.settings&&"false"===user.settings[TradingView.FeatureToggle.force_prefix+r])&&(!!t[r]&&(1===t[r]||(a=o.getItem(n+r),void 0===a||null===a?e(r):"true"===a))))}}(window.featureToggleState||{}),e.FeatureToggle=TradingView.FeatureToggle,e.isFeatureEnabled=TradingView.isFeatureEnabled},function(t,e){t.exports={button:"button-2ioYhFEY-",isInteractive:"isInteractive-20uLObIc-",hovered:"hovered-3perbaxJ-",isActive:"isActive-22S-lGpa-",isOpened:"isOpened-p-Ume5l9-",isDisabled:"isDisabled-1_tmrLfP-",text:"text-1sK7vbvh-",icon:"icon-beK_KS0k-"}},function(t,e,i){"use strict";function o(t,e,i){return t*(1-i)+e*i}function n(t,e,i,r){var s,a,l,c,h;if(r=!r||r<1e12?Date.now():r,s=r-t,a=s>=i.duration,l=o(i.from,i.to,i.easing(s/i.duration)),c=a?i.to:l,h=c-e,i.onStep(h,c),a)return void(i.onComplete&&i.onComplete());requestAnimationFrame(n.bind(null,t,c,i))}function r(t){t.from=t.from||0,
t.duration=t.duration||250,t.easing=t.easing||s.easingFunc.easeOutCubic,requestAnimationFrame(n.bind(null,Date.now(),t.from,t))}Object.defineProperty(e,"__esModule",{value:!0});var s=i(31);e.doAnimate=r},function(t,e,i){"use strict";function o(t){var e,i=t.activeClass,o=t.children,l=t.className,c=t.icon,h=t.isActive,u=t.isBgFull,d=t.isGrayed,p=t.isHidden,_=t.isTransparent,f=t.onClick,m=t.title;return n.createElement("div",{className:r(a.button,l,h?i:"","apply-common-tooltip common-tooltip-vertical",(e={},e[a.isActive]=h,e[a.isBgFull]=u,e[a.isGrayed]=d,e[a.isHidden]=p,e[a.isTransparent]=_,e)),onClick:f,title:m},n.createElement("div",{className:a.bg},c&&("string"==typeof c?n.createElement(s.Icon,{className:a.icon,icon:c}):n.createElement("span",{className:a.icon},c)),o))}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(14),s=i(59),a=i(720),e.ToolButton=o},function(t,e,i){"use strict";function o(){return n.createElement("div",{className:r.separator})}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(723),e.PopupMenuSeparator=o},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(14),s=i(730),a=i(209),l=i(210),c={add:window.t("Add to favorites"),remove:window.t("Remove from favorites")},h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){var i=e.props,o=i.onClick,n=i.onClickArg;o&&o(n,t)},e}return o.__extends(e,t),e.prototype.render=function(){var t,e=this.props.isFilled;return n.createElement("span",{className:r(s.star,"apply-common-tooltip",(t={},t[s.checked]=e,t)),dangerouslySetInnerHTML:{__html:e?a:l},onClick:this._handleClick,title:e?c.remove:c.add})},e}(n.PureComponent),e.FavoriteButton=h},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(746),Object.defineProperty(e,"AutocompleteField",{enumerable:!0,get:function(){return o.AutocompleteField}}),n=i(756),Object.defineProperty(e,"CheckboxField",{enumerable:!0,get:function(){return n.CheckboxField}}),r=i(395),Object.defineProperty(e,"InputField",{enumerable:!0,get:function(){return r.InputField}}),s=i(757),Object.defineProperty(e,"InputFieldRegExp",{enumerable:!0,get:function(){return s.InputFieldRegExp}}),a=i(396),Object.defineProperty(e,"SaveRenameDialog",{enumerable:!0,get:function(){return a.SaveRenameDialog}})},function(t,e,i){"use strict";function o(t){this._maxSize=t||50,this.reset()}var n=/[2-9]/g;o.prototype.measureText=function(t,e,i){var o,r,s=i||n,a=(e+"").replace(s,"0");return this._cache[a]?this._cache[a].width:(this._actualSize===this._maxSize&&(o=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[o],this._oldestTick++,this._actualSize--),0===(r=t.measureText(a).width)&&e.length?0:(this._cache[a]={width:r,tick:this._usageTick},this._tick2Labels[this._usageTick]=a,this._actualSize++,this._usageTick++,r))},o.prototype.reset=function(){this._actualSize=0,this._cache={},this._usageTick=1,
this._oldestTick=1,this._tick2Labels={}},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){return i&&(i+=" "),(i||"")+t+"px "+e}Object.defineProperty(e,"__esModule",{value:!0}),e.makeFont=o},function(t,e,i){"use strict";function o(t,e){this.m_title=t,this.m_value=e,this._visible=!0,this._color=void 0}function n(){this._header="",this._title="",this._items=[]}o.prototype.title=function(){return this.m_title},o.prototype.text=function(){return this.m_value},o.prototype.visible=function(){return this._visible},o.prototype.color=function(){return this._color},o.prototype.setVisible=function(t){this._visible=t},o.prototype.setValue=function(t){this.m_value=t},o.prototype.setColor=function(t){this._color=t},o.prototype.value=function(){return this.m_value},n.prototype.header=function(){return this._header},n.prototype.title=function(){return this._title},n.prototype.items=function(){return this._items},n.prototype.update=function(){},e.DataWindowItem=o,e.DataWindowView=n},function(t,e,i){"use strict";var o,n=i(9).assert,r=i(32),s=r.rgba,a=r.rgbaToString,l=r.parseRgb,c=i(807),h=i(229),u=i(163),d=i(220),p=i(1).LineDataSource,_=i(128).StudyLineDataSource,f=i(57).LineToolBarsPattern,m=i(57).LineToolCallout,g=i(917),v=i(35),y=v.Study,b=v.prepareStudyPropsStateForLoadChart,S=v.prepareStudyPropertiesForLoadChart,w=v.createStudy,T=i(77),C=i(49),x=i(6).DefaultProperty,P=i(33),L=i(5),I=i(7).getLogger("Chart.Serialization"),k=i(57).LineToolParallelChannel,A=i(57).LineToolTrendAngle,M=i(57).LineToolGhostFeed,E=i(57).LineToolElliott,D=i(46).PriceDataSource,V=i(228),O=i(22),R=i(30);c.version=2,c.prototype.state=function(t,e){var i,o,n,r={};for(r.panes=[],i=0;i<this.panes().length;i++)r.panes.push(this.panes()[i].state(!0,t,!1,e));return r.timeScale=this.m_timeScale.state(t),o=null,n=this.properties(),r.chartProperties={paneProperties:n.paneProperties.state(),scalesProperties:n.scalesProperties.state(),publishedChartsTimelineProperties:o?o.state(t):void 0,chartEventsSourceProperties:n.chartEventsSourceProperties.state()},n.chartEventsSourceProperties&&(r.chartProperties.chartEventsSourceProperties=n.chartEventsSourceProperties.state()),r.version=c.version,r.timezone=this.timezone(),r},c.prototype.chartPropertiesTransparencyMigrate=function(t){var e,i,o;t.chartProperties.paneProperties.crossHairProperties&&(o=t.chartProperties.paneProperties.crossHairProperties,R.isHexColor(o.color)&&(i=o.transparency/100,e=l(o.color),o.color=a(s(e,i)))),t.chartProperties.paneProperties.dataWindowProperties&&(o=t.chartProperties.paneProperties.dataWindowProperties,R.isHexColor(o.color)&&(i=o.transparency/100,e=l(o.color),o.color=a(s(e,i))))},c.prototype.resetDeferredStudies=function(){new o(this).reset()},c.prototype._getExceedingChildStudies=function(t){var e,i,o,n,r,s,a,l,c=[];for(e=0;e<t.length;++e)c=c.concat(t[e].sources||[]);for(i=0,o=1,n=[],r={},s=0,a=1e6;c.length&&--a;)l=c[s],(l.ownerSource&&r[l.ownerSource]||!l.ownerSource)&&(r[l.id]=l,c.splice(c.indexOf(l),1),
l.ownerSource&&"Study"===l.type&&l.state&&l.state.isChildStudy&&++i>o&&n.push(l)),s=(s+1)%c.length;return n},c.prototype.restoreState=function(t,e){var i,n,r,s,a,l,c,h,u,d,_,f;if(new o(this).reset(),i={},!t.panes)return void I.logDebug("ChartModel.restoreState: invalid state");if(!Array.isArray(t.panes))return void I.logDebug("ChartModel.restoreState: invalid state");if(t.panes.length<1)return void I.logDebug("ChartModel.restoreState: invalid state");if(t.chartProperties&&!t.chartProperties.timezone&&(t.chartProperties.timezone=t.timezone),t.chartProperties&&(n=TradingView.factoryDefaults("chartproperties").scalesProperties,TradingView.merge(n,t.chartProperties.scalesProperties),!("showLastValue"in n)||"showSeriesLastValue"in n||"showStudyLastValue"in n||(n.showSeriesLastValueProperty=n.showLastValue,n.showStudyLastValueProperty=n.showLastValue),"showSeriesLastValue"in n&&(i.showSeriesLastValueProperty=!0),"showStudyLastValue"in n&&(i.showStudyLastValueProperty=!0),t.chartProperties.paneProperties.vertGridProperties=t.chartProperties.paneProperties.vertGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),t.chartProperties.paneProperties.horzGridProperties=t.chartProperties.paneProperties.horzGridProperties||TradingView.clone(t.chartProperties.paneProperties.gridProperties),this._properties.paneProperties.merge(t.chartProperties.paneProperties),this._properties.scalesProperties.merge(n),t.chartProperties.timezone&&this._properties.timezone.setValue(t.chartProperties.timezone),t.chartProperties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties&&this._properties.chartEventsSourceProperties.merge(t.chartProperties.chartEventsSourceProperties),this.m_timeScale.restoreState(t.timeScale,e)),t.timeScale&&this.m_timeScale.restoreState(t.timeScale,e),!this.readOnly()&&(r=this._getExceedingChildStudies(t.panes),r.length))for(s=t.panes.length-1;s>=0;--s){for(a=t.panes[s],l=a.sources.length-1;l>=0;--l)c=a.sources[l],~r.indexOf(c)&&a.sources.splice(l,1);a.sources.length||t.panes.splice(s,1)}for(h=t.panes,this.panes()[0].restoreState(h[0],e,t.version,i),s=1;s<t.panes.length;s++)a=this.panes()[s]||this.createPane(),a.restoreState(t.panes[s],e,t.version,i);for(this._invalidateBarColorerCaches(),u=this.dataSources(),d=0,s=0;s<u.length;s++)_=u[s],TradingView.isInherited(_.constructor,p)&&(d++,_.calcIsActualSymbol());return this._version=t.version,this.updateTimeScaleBaseIndex(),this.recalculateAllPanes(),this.invalidate(new O(O.FULL_UPDATE)),f=TVLocalStorage.getItem("linetools_limit")||1e3,window.is_authenticated&&window.user&&window.user.settings&&(f=window.user.settings.linetools_limit||f),d>f?{lines_limit_exceeded:!0,line_tools_count:d}:{}},V.prototype.state=function(t,e,i,o){function n(t){return i&&!t.isSavedInStudyTemplates()||!t.state||!t.state()||!t.isSavedInChart(e)||o&&t.isActualSymbol&&!t.isActualSymbol()}var r,s,a={};if(t)for(a.sources=[],r=0;r<this.m_dataSources.length;r++)n(this.m_dataSources[r])||a.sources.push(this.m_dataSources[r].state(e))
;for(a.leftAxisState=this.m_leftPriceScale.state(),a.leftAxisState.m_isLockScale&&null!==this._lastLeftPriceScaleRatio&&(a.leftPriceScaleRatio=this._lastLeftPriceScaleRatio),a.leftAxisSources=[],r=0;r<this.m_leftPriceScale.dataSources().length;r++)n(this.m_leftPriceScale.dataSources()[r])||a.leftAxisSources.push(this.m_leftPriceScale.dataSources()[r].id());for(a.rightAxisState=this.m_rightPriceScale.state(),a.rightAxisState.m_isLockScale&&null!==this._lastRightPriceScaleRatio&&(a.rightPriceScaleRatio=this._lastRightPriceScaleRatio),a.rightAxisSources=[],r=0;r<this.m_rightPriceScale.dataSources().length;r++)n(this.m_rightPriceScale.dataSources()[r])||a.rightAxisSources.push(this.m_rightPriceScale.dataSources()[r].id());for(a.overlayPriceScales={},r=0;r<this.m_dataSources.length;r++)s=this.m_dataSources[r],this.isOverlay(s)&&s.isSavedInChart(e)&&(a.overlayPriceScales[s.id()]=s.priceScale().state());return a.stretchFactor=this._stretchFactor,this.m_mainDataSource&&(a.mainSourceId=this.m_mainDataSource.id()),a},V.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},V.prototype.isESDStudy=function(t){return"Script$TV_EARNINGS@tv-scripting"===t.id||"Script$TV_DIVIDENDS@tv-scripting"===t.id||"Script$TV_SPLITS@tv-scripting"===t.id||"ESD$TV_EARNINGS@tv-scripting"===t.id||"ESD$TV_DIVIDENDS@tv-scripting"===t.id||"ESD$TV_SPLITS@tv-scripting"===t.id},V.prototype.isStudyToSkip=function(t){return!!this.isESDStudy(t)},V.prototype.restoreState=function(t,e,i,o){var n,r,s,a,l,c,u,d,_,f,m,g,v,b,S;if(o=o||{},!t.leftAxisState||!t.rightAxisState)throw Error("invalid state");if(!t.leftAxisSources||!t.rightAxisSources)throw Error("invalid state");if(t.stretchFactor&&(this._stretchFactor=t.stretchFactor),n={},t.sources)for(r=-1!==this.m_dataSources.indexOf(this._model.mainSeries()),this.clearSeries(),this.m_mainDataSource=null,r&&this.m_dataSources.push(this._model.mainSeries()),s=this.getZOrderMinMax(),a=s.minZOrder,l=s.maxZOrder,c=0;c<t.sources.length;c++)u=t.sources[c],d=u.type,Math.abs(u.zorder)>1e200?(_=a-1,I.logWarn("Datasource zorder has bad value: "+u.zorder+" Resetting it to "+_),u.zorder=_):this.isZOrderAvailable(u.zorder)||r&&"MainSeries"===d&&this._model.mainSeries().zorder()===u.zorder||(u.zorder=l+1),f=u.id,n[f]=u.ownerSource,d&&("MainSeries"===d?this._restoreMainSeries(u,e,r,o):d.toLowerCase().startsWith("study")?this._restoreStudy(u,e,o):TradingView.isInherited(TradingView[d],p)?this._restoreLineTool(u,e):TradingView[d]&&TradingView[d].createFromState&&this._restoreSpecialSource(u,e)),a=Math.min(a,u.zorder),l=Math.max(l,u.zorder);for(this.m_leftPriceScale.dataSources().splice(0,1/0),this.m_leftPriceScale._hasSeries=!1,m=defaults("chartproperties").paneProperties.leftAxisProperties,TradingView.merge(m,t.leftAxisState),this.m_leftPriceScale.restoreState(m),void 0!==t.leftPriceScaleRatio&&(this._lastLeftPriceScaleRatio=t.leftPriceScaleRatio),
c=0;c<t.leftAxisSources.length;c++)(g=this.dataSourceForId(t.leftAxisSources[c]))&&(void 0!==m.m_showSymbolLabels&&g instanceof T&&this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels),g.setPriceScale(this.m_leftPriceScale),this.m_leftPriceScale.addDataSource(g));for(this.m_rightPriceScale.dataSources().splice(0,1/0),this.m_rightPriceScale._hasSeries=!1,m=defaults("chartproperties").paneProperties.rightAxisProperties,TradingView.merge(m,t.rightAxisState),this.m_rightPriceScale.restoreState(m),void 0!==t.rightPriceScaleRatio&&(this._lastRightPriceScaleRatio=t.rightPriceScaleRatio),c=0;c<t.rightAxisSources.length;c++)(g=this.dataSourceForId(t.rightAxisSources[c]))&&(void 0!==m.m_showSymbolLabels&&g instanceof T&&this.model().properties().scalesProperties.showSymbolLabels.setValue(m.m_showSymbolLabels),g.setPriceScale(this.m_rightPriceScale),this.m_rightPriceScale.addDataSource(g));for(c=0;c<this.m_dataSources.length;c++)g=this.m_dataSources[c],-1===this.m_rightPriceScale.dataSources().indexOf(g)&&-1===this.m_leftPriceScale.dataSources().indexOf(g)?(g._isOverlay=!0,v=new h(this._model.properties().scalesProperties),v.setHeight(this.m_height),v.setTopMargin(this.m_rightPriceScale.topMargin()),v.setBottomMargin(this.m_rightPriceScale.bottomMargin()),v.addDataSource(g),t.overlayPriceScales&&t.overlayPriceScales[g.id()]&&(m=t.overlayPriceScales[g.id()],m.m_isAutoScale=!0,m.m_isLog=!1,m.m_isPercentage=!1,m.m_isLockScale=!1,v.restoreState(m)),g.setPriceScale(v)):g._isOverlay=!1;for(f in n)(b=n[f])&&(g=this.sourceById(f))&&this.sourceById(f).setOwnerSource(this.sourceById(b));if(t.mainSourceId&&!this.m_mainDataSource&&(this.m_mainDataSource=this.dataSourceForId(t.mainSourceId)),!this.m_mainDataSource)for(c=0;c<this.m_dataSources.length;c++)if(g=this.m_dataSources[c],TradingView.isInherited(g.constructor,D)){this.m_mainDataSource=g;break}for(c=0;c<this.m_dataSources.length;c++)g=this.m_dataSources[c],TradingView.isInherited(g.constructor,p)?(g.ownerSource()||g.setOwnerSource(this.mainDataSource()),g.isFixed()&&g.restoreFixedPoints(),1===i&&g.priceScale().isPercent()&&!g.isFixed()&&g.correctPricesToPercents(),g.fixAfterRestorePriceAxis&&g.fixAfterRestorePriceAxis()):TradingView.isInherited(g.constructor,y)&&(S=g.properties(),S.linkedToSeries&&S.linkedToSeries.value()&&(g.ownerSource()||g.setOwnerSource(this.model().mainSeries())));this._updateMargins(),this._cachedOrderedSoruces=null,this._cachedHitTestSources=null},V.prototype._restoreMainSeries=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y=t.id,b=t.state,S=t.zorder;if(b&&["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){b[t]&&(b[t].wickUpColor=b[t].wickUpColor||b[t].wickColor,b[t].wickDownColor=b[t].wickDownColor||b[t].wickColor)}),i||(n=this._model.paneForSource(this._model.mainSeries()),n.removeDataSource(this._model.mainSeries()),this.m_dataSources.push(this._model.mainSeries())),this.m_mainDataSource=this._model.mainSeries(),r=b&&b.style?b.style:void 0,
r===T.STYLE_PNF&&"ATR"===this._model.mainSeries().properties().pnfStyle.inputs.style.value()?this._model.mainSeries().properties().pnfStyle.inputs.style._value="Traditional":r===T.STYLE_RENKO&&"ATR"===this._model.mainSeries().properties().renkoStyle.inputs.style.value()&&(this._model.mainSeries().properties().renkoStyle.inputs.style._value="Traditional"),b&&!b.hasOwnProperty("showSessions")&&(b.showSessions=!1),b&&!b.extendedHours&&(b.extendedHours=!1),b&&e&&(b.showCountdown=!1),b&&(e&&!("showSeriesLastValueProperty"in o)&&"showLastValue"in b&&this._model.properties().scalesProperties.showSeriesLastValue.setValue(b.showLastValue),delete b.showLastValue),b)for(s={haStyle:"BarSetHeikenAshi@tv-basicstudies-60",renkoStyle:"BarSetRenko@tv-prostudies-15",pbStyle:"BarSetPriceBreak@tv-prostudies-15",kagiStyle:"BarSetKagi@tv-prostudies-15",pnfStyle:"BarSetPnF@tv-prostudies-15"},a=this._model.studyVersioning(),l=this._model.mainSeries().styleStudyInfos(),c=Object.keys(C.SYMBOL_STRING_DATA),h=0;h<c.length;h++)r=c[h],u=C.STYLE_SHORT_NAMES[r]+"Style",d=u in t?t[u].studyId:s[u],null!=(r=b[u])&&(p=r.inputs,_=P.parseIdString(d),f=l[u].studyId,m=P.parseIdString(f),g=a.updateStudyInputs(_.id,_.version,m.version,p,null),r.inputs=g);this._model.mainSeries().clearSessionStudy(),this._model.mainSeries().properties().merge(b),this._model.mainSeries()._prevChartStyle=this._model.mainSeries().properties().style.value(),this._model.mainSeries().createPaneView(),this._model.mainSeries().setId(y),e&&this._model.mainSeries().restoreData(t.bars,t.nsBars,t.symbolInfo,t.rtPrice,t.boxSize,t.reversalAmount),void 0!==S&&this._model.mainSeries().setZorder(S),this._model.mainSeries().properties().extendedHours.listeners().fire(this._model.mainSeries().properties().extendedHours),(v=this._model.mainSeries().symbolInfo())&&this._model.mainSeries().onSymbolResolved().fire(this._model.mainSeries().symbolInfo())},V.prototype._restoreStudy=function(t,e,i){var n,r,s,a,l,c,h,d,p,_;return e&&void 0===t.data&&void 0===t.nonSeriesData&&void 0===t.indexes?void I.logError("Cannot restore (skipping) study without data "+t.id+", "+t.metaInfo.id):(n=t.id,r=t.state,s=t.zorder,a=t.ownerSource,l=TradingView.clone(t.metaInfo),$.extend(l,P.parseIdString(l.id)),this.isStudyToSkip(l)&&!e?void I.logNormal("Skipping study "+l.id):(c=r,h=this._model.studyVersioning(),d=h.patchPropsStateAndMetaInfo(c,l,{oldShowStudyLastValueProperty:e&&!i.showStudyLastValueProperty}),c=d.propsState,l=d.metaInfo,p=new u(this._model,t,l.shortDescription),p.setId(n),_=this,h.updateMetaInfoAsync(l,e).done(function(i){function r(o){var r,a=S(l,i,c,null,h,o),d=w(_._model,a,o||_._model.mainSeries(),s);d.setId(n),e&&(r=h.patchStudyData(l,t.data,t.nonSeriesData,t.indexes),d.restoreData(r.data,r.nsData,r.indexes)),_._model.replaceStudyStub(p,d)||(p=d),u.add(n,d)}var s,u,d;p.setStatus(""),s=i||l,u=new o(_._model),d=a&&t.state.isChildStudy,d?u.get(a).done(r):r()}).fail(function(t){p.setStatus("error: "+t),p.setFailed(!0)}),p&&this.m_dataSources.push(p),delete this._cachedOrderedSoruces,
delete this._cachedHitTestSources,p&&void 0!==s&&p.setZorder(s),p))},V.prototype._restoreLineTool=function(t,e,i){var o,r,s,a,l,c,h,v,y,S,w,T,C,I,D,V,O,R,B,z,F,N,W;for(i=void 0===i||i,E.migrateState(t),g.migrateState(t),o=t.type,r=t.id,s=t.state,a=i?t.zorder:this._newZOrderForLineTool(),l=TradingView[o],n(TradingView.isInherited(l,p),"invalid data source type:"+o+" (expected to be a Line Tool)"),c=t.points,h=!1,v=0;v<c.length;v++)if(Math.abs(c[v].offset)>1e4){h=!0;break}if(!h){if(y=null,S=TradingView.factoryDefaults("linetool"),TradingView.isInherited(l,_)){if(y=this._model.studyVersioning(),t=y.patchPointsBasedStudyState(t),TradingView.merge(S,s),C=t.metaInfo,$.extend(C,P.parseIdString(C.fullId)),!e&&(I=C.productId,!pro.hasPackage(I)))return D=new u(this._model,t,C.shortDescription),D.setId(r),this.m_dataSources.push(D),void 0!==a&&D.setZorder(a),D.setStatus($.t("not authorized")),void D.setFailed(!0);V=y.updateMetaInfo(C),O=V||C,S=b(O,C,S,null,y),e?TradingView.merge(S,{fixedSize:!1}):TradingView.merge(S,{fixedSize:!0}),T=new x("study_"+O.id,S,!0),w=d.create(o,this._model,T,O,this.mainDataSource())}else R=o.toLowerCase(),TradingView.merge(S,TradingView.factoryDefaults(R)),T=TradingView[o].prototype.createPropertiesObject(R,S),T.merge(s),e?T.merge({fixedSize:!1}):T.merge({fixedSize:!0}),w=new TradingView[o](this._model,T,!0);return w.setId(r),w.linkKey=t.linkKey,B=t.alertId,B&&"function"==typeof w.setAlert&&L.enabled("alerts")&&!this._model.readOnly()&&!this._model.isJustClonedChart()&&w.setAlert(B,{noChartSave:!0}),z=t.indexes?t.indexes:[],z=z.slice(0,t.points.length),w.isFixed()?w.restorePositionPercents(t.positionPercents):w.restorePoints(t.points,z,e),w instanceof f||w instanceof m||w instanceof A||w instanceof M||w instanceof k?w.restoreData(t):e&&w.restoreData&&(F=t,y&&(F.graphics=y.patchPointsBasedStudyData(F.metaInfo,F.graphics)),w.restoreData(F)),N=null==t.version?1:t.version,W=null==w.version?1:w.version,N!==W&&"function"==typeof w.migrateVersion&&w.migrateVersion(N,W,{pane:this,model:this._model,properties:T}),this.m_dataSources.push(w),delete this._cachedOrderedSoruces,delete this._cachedHitTestSources,void 0!==a&&w.setZorder(a),w}},V.prototype._restoreSpecialSource=function(t,e){var i,o=TradingView[t.type];o&&o.createFromState&&(i=o.createFromState(t,e,this._model))&&(i.setId(t.id),this.m_dataSources.push(i),i.zorder&&i.setZorder(i.zorder))},c.prototype.studyTemplate=function(t){var e,i,o,n,r={};for(r.panes=[],e=0;e<this.panes().length;e++)i=!0,o=!1,n=!0,r.panes.push(this.panes()[e].state(i,o,n));return t&&(r.interval=this.mainSeries().interval()),r.version=c.version,r},c.prototype.restoreStudyTemplate=function(t,e){this._undoModel.studyLoadTemplate(this._undoModel,this.studyTemplate(),t,e)},c.prototype.theme=function(){var t={};return t.chartProperties={paneProperties:this.properties().paneProperties.state(),scalesProperties:this.properties().scalesProperties.state(),symbolWatermarkProperties:this.properties().symbolWatermarkProperties.state()},t.mainSourceProperties=this.mainSeries().state().state,
delete t.mainSourceProperties.symbol,delete t.mainSourceProperties.interval,delete t.chartProperties.paneProperties.topMargin,delete t.chartProperties.paneProperties.bottomMargin,t.version=c.version,t},c.prototype.restoreTheme=function(t){var e,i,o={hollowCandle:{related:"candle"}};for(e in o)t.mainSourceProperties[e+"Style"]||(i=t.mainSourceProperties[o[e].related+"Style"],t.mainSourceProperties[e+"Style"]=TradingView.clone(i));this._undoModel.chartLoadTheme(this,t)},o=function(){function t(o){var n=e.indexOf(o);return~n?i[n]:this instanceof t?(this._source=o,this._studies={},this._deferreds={},e.push(o),void i.push(this)):new t(o)}var e=[],i=[];return t.prototype.add=function(t,e){this._deferreds[t]&&(this._deferreds[t].resolve(e),delete this._deferreds[t]),this._studies[t]=e},t.prototype.get=function(t){return this._studies[t]?$.Deferred().resolve(this._studies[t]):(this._deferreds[t]||(this._deferreds[t]=$.Deferred()),this._deferreds[t].promise())},t.prototype.reset=function(){var t=e.indexOf(this._source);~t&&(e.splice(t,1),i.splice(t,1))},t}(),t.exports=c},function(t,e,i){"use strict";function o(){var t,e,i,o;this._registeredSources={},this._sourcesToRow={},this._rowsToSources={},this._currentSymbol="",this._actualCapacity=0,this._actualWidth=0,this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this._currentWidth=400,this._canvas.prop("width",this._currentWidth).prop("height",1).css("position","absolute").css("top",0).css("z-index",1e3).css("left",0),this._ctx=this._canvas.get(0).getContext("2d"),this._ctx.font=u.fontSize+"px"+u.font,t=u.fontSize,e=u.lineSpacing,i=t+e,o=3,this._padding=8,this._rowHeight=i*o-e+2*this._padding+2}function n(t,e){this._constructor="LineToolTrendLine";var n=e||new a("linetooltrendline");s.call(this,t,n),t._trendLineStatsCache||(t._trendLineStatsCache=new o),i.e(1).then(function(t){var e=i(1151).TrendLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(8).Point,s=i(1).LineDataSource,a=i(6).DefaultProperty,l=i(3).propertyPages,c=i(7).getLogger("Chart.LineToolTrendLine"),h=i(405).TrendLineStatsRenderer,u=i(386).LabelSettings;o.prototype.canvas=function(){return this._canvas},o.prototype.topByRow=function(t){return t*this._rowHeight},o.prototype.rowHeight=function(t){return this._rowHeight},o.prototype.rowWidth=function(t){var e=this._rowsToSources[t];return this._sourcesToRow[e].width},o.prototype.currentWidth=function(){return this._currentWidth},o.prototype._findEmptyRow=function(t){for(var e=0;this._rowsToSources[e];)e++;return this._rowsToSources[e]=t,e>=this._actualCapacity&&(this._actualCapacity++,TradingView.resizeCanvas(this._canvas,this._currentWidth,this._rowHeight*this._actualCapacity),this._ctx=this._canvas.get(0).getContext("2d"),c.logDebug("TrendLineCache. Expanging cache to "+this._actualCapacity+" items")),e},o.prototype._effectiveState=function(t){var e,i={};return i.p1=$.extend({},t.points()[0]),i.p2=$.extend({},t.points()[1]),e=t.properties(),i.showBars=e.showBarsRange.value(),
i.showTimeRange=e.showDateTimeRange.value(),i.showDistance=e.showDistance.value(),i.showPriceRange=e.showPriceRange.value(),i.showAngle=e.showAngle.value(),i.color=e.textcolor.value(),i.showAngle&&(i.priceRange=t.priceScale().priceRange().state(),i.barSpacing=t._model.timeScale().barSpacing()),i},o.prototype._effectiveStatesEquals=function(t,e){var i=function(t,e){return!(!t&&!e)&&(!(!t||e)||(!(t||!e)||(t.index!==e.index||t.price!==e.price)))};if(t&&!e)return!1;if(!t&&e)return!1;if(i(t.p1,e.p1))return!1;if(i(t.p2,e.p2))return!1;if(t.color!==e.color)return!1;if(t.showBars!==e.showBars)return!1;if(t.showTimeRange!==e.showTimeRange)return!1;if(t.showDistance!==e.showDistance)return!1;if(t.showPriceRange!==e.showPriceRange)return!1;if(t.showAngle!==e.showAngle)return!1;if(t.showAngle){if(t.priceRange.min!==e.priceRange.min)return!1;if(t.priceRange.max!==e.priceRange.max)return!1;if(t.barSpacing!==e.barSpacing)return!1}return!0},o.prototype.removeSource=function(t){if(this._sourcesToRow[t]){var e=this._sourcesToRow[t].row;this._ctx.save(),this._ctx.clearRect(0,this.topByRow(e),this._currentWidth,this.rowHeight(e)),this._ctx.restore(),delete this._sourcesToRow[t],delete this._rowsToSources[e]}},o.prototype._repaintSource=function(t,e,i){var o,n;this._ctx.save(),this._ctx.translate(0,this.topByRow(e)+.5),i.points[0]=new r(0,0),i.offsetX=0,i.offsetY=0,delete i.horzAlign,delete i.vertAlign,this._ctx.clearRect(0,0,this._currentWidth,this.rowHeight(e)),o=new h(i,{}),n=o.draw(this._ctx),this._sourcesToRow[t].width=n.width,this._ctx.restore()},o.prototype.updateSource=function(t,e){var i,o,n,r,s,a=t.properties().symbol.value();return this._currentSymbol!==a&&(c.logDebug("TrendLineCache. Clearing canvas because of changing symbol from "+this._currentSymbol+" to "+a),this._currentSymbol=a,this._sourcesToRow={},this._rowsToSources={}),i=t.id(),this._sourcesToRow[i]||(o=this._findEmptyRow(i),this._sourcesToRow[i]={effectiveState:null,row:o}),n=this._sourcesToRow[t.id()].effectiveState,r=this._effectiveState(t),this._effectiveStatesEquals(n,r)||(o=this._sourcesToRow[t.id()],s=e(),this._repaintSource(i,o.row,s),this._sourcesToRow[i].effectiveState=r),this._sourcesToRow[i]},inherit(n,s),n.prototype.stop=function(){s.prototype.stop.call(this),this._model._trendLineStatsCache.removeSource(this.id())},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Trend Line"},n.prototype.canHasAlert=function(){return!0},n.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},n.prototype.getStylesPropertyPage=function(){return l.LineToolTrendLineStylesPropertyPage},e.LineToolTrendLine=n},function(t,e,i){"use strict";function o(t,e){var i,o;return e.isPercentage()?null===(i=e.mainSource())?null:(o=i.firstValue(),null===o||void 0===o?null:t.convertFromPercents(o).length()):t.length()}function n(t){var e,i;return t.isEmpty()?null:null===(e=t.priceRange())?null:(i=o(e,t),null===i?null:t.internalHeight()/i)}
function r(t,e){var i,o,r;return t.isEmpty()||e.isEmpty()?null:null===(i=n(e))?null:(o=t.getValidBarSpacing(),r=Math.max(c,i),o/r)}function s(t,e,i){var n,r,s,a;return null===i||t.isEmpty()?null:null===(n=t.priceRange())||n.isEmpty()?null:(r=t.internalHeight()/(e/i),null===(s=o(n,t))?null:r===s?n:(a=(r-s)/2,new l(n.minValue()-a,n.maxValue()+a)))}function a(t,e){var i,n;return null===e||t.isEmpty()?null:null===(i=t.priceRange())?null:(n=o(i,t),null===n?null:t.internalHeight()/n*e)}var l,c;Object.defineProperty(e,"__esModule",{value:!0}),l=i(73),c=1e-10,e.scaleRatio=r,e.priceRangeByScaleRatio=s,e.barSpacingByScaleRatio=a},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPitchfork";var i=e||this.createPropertiesObject("linetoolpitchfork");n.call(this,t,i),this._properties.style.listeners().subscribe(this,o.prototype._recreatePaneView),this._recreatePaneView()}var n=i(1).LineDataSource,r=i(21),s=i(52).Action,a=i(3).propertyPages,l=i(299).LineToolPitchforkStyle,c=null;inherit(o,n),o.prototype.additionalActions=function(){var t,e,i=[],o=["Original","Modified Schiff","Inside","Schiff"];for(t=0;t<4;t++)e=new s({checked:this.properties().style.value()===t,checkable:!0,text:$.t(o[t]),callbackContext:{target:this,value:t}}),e.callbacks().subscribe(null,function(t){var e=t.callbackContext(),i=e.target,o=e.value;i.properties().style.setValue(o),i.updateAllViews(),i._model.updateSource(i)}),i.push(e);return[i[0],i[3],i[1],i[2]]},o.prototype._recreatePaneView=function(){if(null===c)return void i.e(1).then(function(t){null===c&&(c=i(1159)),this._recreatePaneView()}.bind(this).bind(null,i)).catch(i.oe);var t=[];this._properties.style.value()===l.Original?t=[new c.PitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff?t=[new c.SchiffPitchforkLinePaneView(this,this._model)]:this._properties.style.value()===l.Schiff2?t=[new c.SchiffPitchfork2LinePaneView(this,this._model)]:this._properties.style.value()===l.Inside&&(t=[new c.InsidePitchforkLinePaneView(this,this._model)]),this._setPaneViews(t)},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return $.t("Pitchfork")},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return a.LineToolPitchforkStylesPropertyPage},e.LineToolPitchfork=o},function(t,e,i){"use strict";function o(t){var e=(""+t).match(/(.*)([DWM])/);return e?e[1]+$.t(e[2],{context:"interval_short"}):t}Object.defineProperty(e,"__esModule",{value:!0}),i(12),e.translatedIntervalString=o},function(t,e,i){"use strict";(function(e){function o(t,i,o){r.call(this,t),this._origState=i,this._title=o;var a={visible:!0};this._properties=new e(a),this._statusView=new n(this,t.properties()),this._status=$.t("compiling..."),this._statusView.setText(this._title+" "+this._status),this._formatter=new s(Math.pow(10,2)),this._failed=!1}
var n=i(126),r=i(46).PriceDataSource,s=i(28).PriceFormatter;inherit(o,r),o.prototype.properties=function(){return this._properties},o.prototype.statusView=function(){return this._statusView},o.prototype.state=function(t){return this._origState},o.prototype.setStatus=function(t){this._status=t,this._statusView.setText(this._title+" "+this._status)},o.prototype.formatter=function(){return this._formatter},o.prototype.title=function(){return this._title},o.prototype.setFailed=function(t){this._failed=t},o.prototype.start=function(t){},o.prototype.firstValue=function(t){return null},t.exports=o}).call(e,i(25))},function(t,e,i){"use strict";(function(e){function o(t,e,i){this.pane=t,this._isLeft=o.isLeft(e),this._properties=t.chart().properties().scalesProperties,this._disableContextMenu=!!i,this.jqCell=$(document.createElement("td")),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("price-axis"),this.jqCell.width(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=g(this._dv,new v(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=g(this._dv,new v(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._textWidthCache=new s,this.restoreDefaultCursor(),this.update(),y(this.jqCell,this,!0),this.dialog=this.pane.chart().dialog,this.contextMenu=null,this.actions={},this._isVisible=!0,this.priceScale().onMarksChanged.subscribe(this,this.onMarksChanged)}function n(t){var e=new C(t);return function(t,i){return isNumber(i)&&!t.isLog()?e.format(i):""}}var r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x;i(927),r=i(1).LineDataSource,s=i(155),a=i(52),l=a.Action,c=a.ActionSeparator,h=i(108),u=i(930),d=i(22),p=i(130),_=p.resizeCanvas,f=p.hardResizeCanvas,m=p.clearRect,g=p.addCanvasTo,v=p.Size,y=i(107).setMouseEventHandler,b=i(40).trackEvent,S=i(156).makeFont,w=i(232).ActionBinder,T=i(7).getLogger("Chart.PriceAxisWidget"),C=i(213).LimitedPrecisionNumericFormatter,o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.LHS=1,o.RHS=2,o.isLeft=function(t){return t===o.LHS||t!==o.RHS&&(T.logDebug("PriceAxisWidget.isLeft: wrong side"),!1)},o.prototype.destroy=function(){this.actions.reset&&this.actions.reset.setActive(!1)},o.prototype.backgroundColor=function(){return this.pane.chart().properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return S(this.fontSize(),"Arial","")},o.prototype.rendererOptions=function(){var t,e,i
;return this._rendererOptions||(this._rendererOptions={isLeft:this._isLeft,width:0,height:0,borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s,_tickmarksCache:new u(11,"Arial","","#000"),color:""}),t=this._rendererOptions,e=!1,t.color!==this.textColor()&&(t.color=this.textColor(),e=!0),t.fontSize!==this.fontSize()&&(i=this.fontSize(),t.fontSize=i,t.font=this.baseFont(),t.paddingTop=Math.floor(i/4.5),t.paddingBottom=Math.ceil(i/4.5),t.paddingInner=Math.max(Math.ceil(i/3-t.tickLength/2),0),t.paddingOuter=Math.ceil(i/3),t.baselineOffset=Math.round(i/10),t.widthCache.reset(),e=!0),e&&t._tickmarksCache.reset(t.fontSize,"Arial","",t.color),this.size&&(t.width=this.size.w,t.height=this.size.h),this._rendererOptions},o.prototype.mouseDownEvent=function(t){var i,o;!this.priceScale().isEmpty()&&e.enabled("chart_zoom")&&(i=this.pane.chart().model(),o=this.pane.state(),this._mousedown=!0,this.setCursor("ns-resize"),i.startScalePrice(o,this.priceScale(),t.localY))},o.prototype.pressedMouseMoveEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();e.scalePriceTo(i,o,t.localY)},o.prototype.mouseDownOutsideEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();this._mousedown&&(this._mousedown=!1,e.endScalePrice(i,o),this.restoreDefaultCursor())},o.prototype.mouseUpEvent=function(t){var e=this.pane.chart().model(),i=this.pane.state(),o=this.priceScale();this._mousedown=!1,e.endScalePrice(i,o),this.restoreDefaultCursor()},o.prototype._initActions=function(t){var e,i,n,r,s;this.pane.state()&&(e=this,this.actions.reset=new l({text:$.t("Reset Scale"),shortcut:"Alt+R",statName:"ResetScale"}),this.actions.reset.callbacks().subscribe(this,o.prototype.reset),this.priceScale().mainSource()instanceof TradingView.Series&&(i=function(t){this._undoModel.setLockScaleProperty(this._property,t.checked,e.priceScale().mainSource(),this._undoText)},n=x(this.priceScale(),this.pane.chart().model().model().mainSeriesScaleRatio()),this.actions.setLockScale=new l({text:$.t("Lock Scale")+" "+n,checkable:!0,checked:this.priceScale().isLockScale(),statName:"ToggleLockScale"}),this._lockScaleBinding=new w(this.actions.setLockScale,this.priceScale().properties().lockScale,this.pane.chart().model(),"Lock Scale",i),this._lockScaleBinding.setValue(this.priceScale().isLockScale())),r=function(){this._undoModel.setAutoScaleProperty(this._property,this.value(),e.priceScale(),this._undoText)},this.actions.setAutoScale=new l({text:$.t("Auto Scale"),checkable:!0,checked:!0,statName:"ToggleAutoScale"}),this._autoScaleBinding=new w(this.actions.setAutoScale,this.priceScale().properties().autoScale,this.pane.chart().model(),"Undo AutoScale",r),this._autoScaleBinding.setValue(this._autoScaleBinding.property().value()),this.actions.setPercentage=new l({text:$.t("Percentage",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePercantage"}),s=function(){
this._undoModel.setPercentProperty(this._property,this.value(),e.priceScale(),this._undoText)},this.actions.setPercentage.binding=new w(this.actions.setPercentage,this.priceScale().properties().percentage,this.pane.chart().model(),"Undo Percentage",s),this.actions.setLog=new l({text:$.t("Log Scale",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"ToggleLogScale"}),this.actions.setLog.binding=new w(this.actions.setLog,this.priceScale().properties().log,this.pane.chart().model(),"Undo Log Scale"),this.actions.alignLabels=new l({text:$.t("No Overlapping Labels",{context:"scale_menu"}),checkable:!0,checked:!1,statName:"TogglePreciseLabels"}),this.actions.alignLabels.binding=new w(this.actions.alignLabels,this.priceScale().properties().alignLabels,this.pane.chart().model(),"No Overlapping Labels"),this._updateScalesActions())},o.prototype._updateScalesActions=function(){var t=this.priceScale(),e=t.mainSource()instanceof TradingView.Series,i=t.mainSource().properties();this.actions.setPercentage.setEnabled(!(t.isLog()||e&&t.isLockScale()||e&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setLog.setEnabled(!(t.isPercent()||e&&t.isLockScale()||e&&i.style.value()===TradingView.Series.STYLE_PNF)),this.actions.setAutoScale.setChecked(t.properties().autoScale.value()),this.actions.setAutoScale.setEnabled(!t.properties().autoScaleDisabled.value())},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){this.reset(),b("GUI","Double click price scale")},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return h.createMenu(this.getContextMenuActions(),{statName:"PriceScaleContextMenu"})},o.prototype.getContextMenuActions=function(){var t,i;return this._initActions(),t=this.pane.chart().actions(),i=[],i.push(this.actions.reset,new c,t.showLeftAxis,t.showRightAxis,new c,this.actions.setAutoScale),this.actions.setLockScale&&i.push(this.actions.setLockScale),i.push(t.scaleSeriesOnly,new c,this.actions.setPercentage,this.actions.setLog,new c),e.enabled("fundamental_widget")||i.push(t.showSymbolLabelsAction,t.showSeriesLastValue),i.push(t.showStudyPlotNamesAction,t.showStudyLastValue),e.enabled("countdown")&&i.push(t.showCountdown),i.push(this.actions.alignLabels),!TradingView.onWidget()&&e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_scales")&&t.scalesProperties&&i.push(new c,t.scalesProperties),i},o.prototype.backLabels=function(t){var e,i,o,n,r,s=[],a=this.priceScale().orderedSources().slice(),l=this.pane,c=l.chart().model(),h=l.state(),u=[],d=c.sourceBeingMoved()||c.lineBeingEdited()||c.lineBeingCreated();if(d&&u.push(d),c.selectedSource()&&u.push(c.selectedSource()),c.hoveredSource()&&u.push(c.hoveredSource()),this.priceScale()===h.defaultPriceScale())for(e=this.pane.state().dataSources(),i=0;i<e.length;i++)h.isOverlay(e[i])&&a.push(e[i]);for(i=0;i<a.length;++i)if(o=a[i],
(t||-1===u.indexOf(o))&&(n=o.priceAxisViews(h,o.priceScale())))for(r=0;r<n.length;r++)s.push(n[r]);return s},o.prototype.optimalWidth=function(){var t,e,i,o,n,r,s;if(!this.isVisible())return 0;if(t=0,e=this.rendererOptions(),this.pane.state())for(i=this.ctx,o=this.priceScale().marks(),i.setFont(this.baseFont()),o.length>0&&(t=Math.max(e.widthCache.measureText(i,o[0].label),e.widthCache.measureText(i,o[o.length-1].label))),n=this.backLabels(!0),r=n.length;r--;)(s=e.widthCache.measureText(i,n[r].text()))>t&&(t=s);return Math.ceil(e.offsetSize+e.borderSize+e.tickLength+e.paddingInner+e.paddingOuter+t)},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,_(this.canvas,t),_(this.top_canvas,t),this.jqCell.css({width:t.w,"min-width":t.w,height:t.h}))},o.prototype.update=function(){},o.prototype._hightlightBackground=function(t,e,i){var o,n,r,s,a,l,c=e[0].price,h=e[0].price;for(o=1;o<e.length;o++)c=Math.min(c,e[o].price),h=Math.max(h,e[o].price);n=this.priceScale(),n.isPercent()&&i&&(r=i.firstValue(),c=n.priceRange().convertToPercent(c,r),h=n.priceRange().convertToPercent(h,r)),s=this.priceScale().priceToCoordinate(c),a=this.priceScale().priceToCoordinate(h),l="rgba(109, 158, 235, 0.3)",m(t,1,s,this.size.w-1,a-s,l)},o.prototype.drawBackground=function(t){var e,i,o,n;if(m(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.pane.chart().model(),(i=e.model().selectedSource())&&i.priceScale()===this.priceScale()&&i instanceof r){if(o=i.axisPoints(),0===o.length)return;this._hightlightBackground(t,o,i.ownerSource())}n=e.model().crossHairSource(),n.startMeasurePoint()&&this._hightlightBackground(t,n.measurePoints(),this.pane.state().mainDataSource())},o.prototype.drawBorder=function(t){var e,i,o;t.save(),t.fillStyle=this.lineColor(),e=this.size.h,this._isLeft?(t.translate(-.5,-.5),i=this.size.w-this._BORDER_SIZE-1,o=this.size.w-1):(t.translate(.5,-.5),i=0,o=i+this._BORDER_SIZE),t.fillRect(i,0,o-i,e),t.restore()},o.prototype.drawTickMarks=function(t){var e,i,o,n,r,s;if(t.save(),t.strokeStyle=this.lineColor(),e=this.priceScale().marks(),t.fillStyle=this.textColor(),t.setFont(this.baseFont()),i=this,t.translate(-.5,-.5),o=this.rendererOptions(),i._isLeft){for(t.fillStyle=i.lineColor(),t.beginPath(),n=this.size.w-i._OFFSET_SIZE-i._BORDER_SIZE-i._TICK_LENGTH,r=e.length;r--;)t.rect(n,e[r].coord,i._TICK_LENGTH,1);for(t.fill(),r=e.length;r--;)o._tickmarksCache.paintTo(t,e[r].label,n-o.paddingInner,e[r].coord,"right")}else{for(t.fillStyle=i.lineColor(),t.beginPath(),s=i._BORDER_SIZE+i._OFFSET_SIZE,r=e.length;r--;)t.rect(s,e[r].coord,i._TICK_LENGTH,1);for(t.fill(),r=e.length;r--;)o._tickmarksCache.paintTo(t,e[r].label,s+i._TICK_LENGTH+o.paddingInner,e[r].coord,"left")}t.restore()},o.prototype._alignLabels=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f=this.size.h/2,m=[],g=this.priceScale().orderedSources().slice(),v=this.pane,y=v.state(),b=this.rendererOptions();if(this.priceScale()===y.defaultPriceScale())for(t=this.pane.state().dataSources(),e=0;e<t.length;e++)y.isOverlay(t[e])&&g.push(t[e])
;for(i=this.priceScale().mainSource(),e=0;e<g.length;++e)if(o=g[e],n=o.priceAxisViews(y,o.priceScale())){for(r=0;r<n.length;r++)s=n[r],s.isVisible()&&m.push(s);i===o&&n.length>0&&(f=n[0].floatCoordinate())}for(a=m.filter(function(t){return t.floatCoordinate()<=f}),l=m.filter(function(t){return t.floatCoordinate()>f}),a.sort(function(t,e){return e.floatCoordinate()-t.floatCoordinate()}),a.length&&l.length&&l.push(a[0]),l.sort(function(t,e){return t.floatCoordinate()-e.floatCoordinate()}),c=m.length,e=0;e<c;e++)s=m[e],s.setFixedCoordinate(s.coordinate());if(h=this.priceScale().properties(),h.alignLabels&&h.alignLabels.value()){for(e=1;e<a.length;e++)s=a[e],u=a[e-1],d=u.height(b,!1),p=s.coordinate(),_=u.getFixedCoordinate(),(p||_)&&p>_-d&&s.setFixedCoordinate(_-d);for(r=1;r<l.length;r++)s=l[r],u=l[r-1],d=u.height(b,!0),p=s.coordinate(),_=u.getFixedCoordinate(),(p||_)&&p<_+d&&s.setFixedCoordinate(_+d)}},o.prototype.drawBackLabels=function(t){var e,i,o,n;for(t.save(),e=this.backLabels(),i=this.rendererOptions(),o=0;o<e.length;o++)n=e[o],n.renderer().draw(t,i);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,r,s,a=this.pane.chart().model().model(),l=[],c=a.sourceBeingMoved()||a.lineBeingEdited()||a.lineBeingCreated();for(c&&l.push({source:c,scale:c.priceScale()}),a.selectedSource()&&l.push({source:a.selectedSource(),scale:a.selectedSource().priceScale()}),a.hoveredSource()&&l.push({source:a.hoveredSource(),scale:a.hoveredSource().priceScale()}),l.push({source:a.crossHairSource(),scale:this.priceScale()}),e=this.pane.state(),i=0;i<l.length;i++)if(o=l[i],n=o.source.priceAxisViews(e,o.scale))for(r=0;r<n.length;r++)s=n[r],t.save(),s.renderer().draw(t,this.rendererOptions()),t.restore()},o.prototype.priceScale=function(){var t=this.pane.state(),e=[];return e=this._isLeft?[t.leftPriceScale(),t.rightPriceScale()]:[t.rightPriceScale(),t.leftPriceScale()],null===e[0].mainSource()?null===e[1].mainSource()?e[0]:e[1]:e[0]},o.prototype.isVisible=function(){return this._isVisible},o.prototype.setVisible=function(t){(t=!!t)!==this._isVisible&&(t?this.jqCell.css("display","table-cell"):this.jqCell.css("display","none"),this._isVisible=t)},o.prototype.setAutoScale=function(t){var e=this.pane.state,i=this.priceScale();this.pane.chart().model().setPriceAutoScale(e,i,t)},o.prototype.reset=function(){var t=this.pane.state(),e=this.priceScale();this.pane.chart().model().resetPriceScale(t,e)},o.prototype.hardResetCanvas=function(){this.size&&(f(this.canvas,this.size),f(this.top_canvas,this.size))},o.prototype.paint=function(t){this._isVisible&&t&&(t===d.UPDATE_CURSOR_ONLY?(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx)):(this._alignLabels(),this.drawBackground(this.ctx),this.drawBorder(this.ctx),this.pane.state()&&(this.drawTickMarks(this.ctx),this.drawBackLabels(this.ctx),this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHairLabel(this.top_ctx))))},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e=""
;"grabbing"!==t&&"ns-resize"!==t||(e="price-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype.onMarksChanged=function(){var t,e=this.optimalWidth();this._prevOptimalWidth<e&&(t=this,this.updateTimeout||(this.updateTimeout=setTimeout(function(){t.pane&&t.pane.chart&&t.pane.chart()&&t.pane.chart().model().model().fullUpdate(),t.updateTimeout=null},100))),this._prevOptimalWidth=e},x=n(7),t.exports={PriceAxisWidget:o,scaleRatioForContextMenuTransformer:n}}).call(e,i(5))},function(t,e,i){"use strict";function o(t){var e=t.text,i=t.className,o=t.displayMode,c=t.collapseWhen,h=void 0===c?["medium","small"]:c,u=n.__rest(t,["text","className","displayMode","collapseWhen"]),d=!h.includes(o);return r.createElement(a.ToolWidgetButton,n.__assign({},u,{text:d?e:void 0,className:s(i,l.button,d?l.withText:l.withoutText)}))}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),s=i(14),a=i(103),l=i(1030),e.ToolWidgetCollapsibleButton=o},function(t,e,i){function o(t,e){this._linesMaxWidth=null,this._hittest=e||new n(n.MOVEPOINT),this._data={},this._fontSize=0,this.setData(t)}var n=i(11);o.prototype.setData=function(t){var e,i,o,n=this._data,r=this.fontStyle();this._data=t,this._fontSize=t.fontsize||t.fontSize||30,e=t.text===n.text,i=t.wordWrapWidth===n.wordWrapWidth,o=r===this.fontStyle(),e&&i&&o?(this._data.lines=n.lines,this._lines=n.lines):(this._linesMaxWidth=null,t.lines=this.wordWrap(t.text,t.wordWrapWidth),this._lines=t.lines)},function(){function t(){var t=document.createElement("canvas");t.width=0,t.height=0,e=t.getContext("2d"),t=null}var e;o.prototype.setPoints=function(t,e){this._data.points=t,this._hittest=e||new n(n.MOVEPOINT)},o.prototype._getLinesMaxWidth=function(){var i,o;if(null!==this._linesMaxWidth)return this._linesMaxWidth;if(e||t(),e.textBaseline="alphabetic",e.font=this.fontStyle(),this._data.wordWrapWidth)return this._data.wordWrapWidth;for(i=0,o=0;o<this._lines.length;o++)i=Math.max(i,e.measureText(this._lines[o]).width);return this._linesMaxWidth=i,i},o.prototype.measure=function(){var t=this._fontSize,e=this._getLinesMaxWidth(),i=t*this._lines.length,o=~~(t/6);return this._data.backgroundHorzInflate&&(e+=2*this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(i+=2*this._data.backgroundVertInflate),e=Math.ceil(e+2*o),i=Math.ceil(i+2*o),e%2!=0&&e++,this._data.padding&&(i+=this._data.padding),{width:e,height:i,textBgPadding:o}},o.prototype.wordWrap=function(i,o,n){var r,s,a,l,c,h,u,d,p;if(e||t(),o=+o,i+="",r=i.split(/[^\S\r\n]*(?:\r\n|\r|\n|$)/),r[r.length-1]||r.pop(),!isFinite(o)||o<=0)return r;for(e.font=n||this.fontStyle(),s=[],a=0;a<r.length;a++)if(l=r[a],(c=e.measureText(l).width)<=o)s.push(l);else for(h=l.split(/([-\)\]\},.!?:;])|(\s+)/);h.length;){
if((u=~~(o/c*(h.length+2)/3))<=0||e.measureText(h.slice(0,3*u-1).join("")).width<=o)for(;e.measureText(h.slice(0,3*(u+1)-1).join("")).width<=o;)u++;else for(;u>0&&e.measureText(h.slice(0,3*--u-1).join("")).width>o;);if(u>0)s.push(h.slice(0,3*u-1).join("")),h.splice(0,3*u);else{if(d=h[0]+(h[1]||""),p=1===p?1:~~(o/e.measureText(d)*d.length),e.measureText(d.substr(0,p)).width<=o)for(;e.measureText(d.substr(0,p+1)).width<=o;)p++;else for(;p>1&&e.measureText(d.substr(0,--p)).width>o;);p<1&&(p=1),s.push(d.substr(0,p)),h[0]=d.substr(p),h[1]=""}if((c=e.measureText(h.join("")).width)<=o){s.push(h.join(""));break}}return s}}(),o.prototype._x=function(){return this._data.points[0].x+this._data.offsetX},o.prototype._y=function(){var t,e=this._fontSize*this._lines.length;switch(this._data.scaleY&&(e*=this._data.scaleY),t=this._data.points[0].y+this._data.offsetY+e,this._data.vertAlign){case"top":break;case"bottom":t-=e;break;case"middle":t-=e/2}return t},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f;if(0!==this._data.points.length){switch(e=this._x(),i=this._y(),o=this._fontSize,this._data.scaleY&&(o*=this._data.scaleY),i-=o*(this._lines.length-1),t.textBaseline="alphabetic",t.font=this.fontStyle(),this._data.horzAlign){case"left":t.textAlign="start";break;case"right":t.textAlign="end";break;case"center":t.textAlign="center"}if(t.translate(e+.5,i+.5),e=0,i=0,o=this._fontSize,this._data.scaleX&&this._data.scaleY&&(n=Math.min(this._data.scaleX,this._data.scaleY),t.scale(n,n)),r=this._getLinesMaxWidth(),s=0,this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){switch(a=e,this._data.horzAlign){case"left":break;case"right":a-=r;break;case"center":a-=r/2}l=o*this._lines.length,c=~~(o/6),this._data.backgroundHorzInflate&&(r+=2*this._data.backgroundHorzInflate,a-=this._data.backgroundHorzInflate),this._data.backgroundVertInflate&&(l+=2*this._data.backgroundVertInflate,i+=this._data.backgroundVertInflate),h={x:Math.floor(a-c),y:Math.floor(i-o),w:Math.ceil(r+2*c),h:Math.ceil(l+2*c)},h.w%2!=0&&h.w++,this._data.padding&&(h.h+=this._data.padding,s=this._data.padding),this._data.backgroundVertInflate&&(i+=this._data.backgroundVertInflate),this._data.backgroundRoundRect?(t.roundRect(h.x,h.y,h.w,h.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fill()),this._data.borderColor&&(u=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=u,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.fillRect(h.x,h.y,h.w,h.h)),this._data.borderColor?(u=~~Math.max(o/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=u,t.strokeRect(h.x-u/2,h.y-u/2,h.w+u,h.h+u)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),_=[3,1],t.dashedLineTo(h.x-.5,p=h.y-.5,d=h.x+h.w+.5,p,_),t.dashedLineTo(d,p,d,p=h.y+h.h+.5,_),
t.dashedLineTo(d=h.x-.5,p,h.x+h.w+.5,p,_),t.dashedLineTo(d,h.y-.5,d,p,_),t.stroke()))}for(this._data.backgroundVertInflate&&!this._data.backgroundColor&&(i+=2*this._data.backgroundVertInflate),t.fillStyle=this._data.color,f=0;f<this._lines.length;f++)t.fillText(this._lines[f],e,i),i+=o+s}},o.prototype.hitTest=function(t){var e,i,o,n,r,s;return 0===this._data.points.length?null:(e=this._fontSize,this._data.scaleY&&(e*=this._data.scaleY),i=this._getLinesMaxWidth(),this._data.scaleX&&(i*=this._data.scaleX),o=this._data.points[0].x+this._data.offsetX,n=this._data.points[0].y+this._data.offsetY,"bottom"===this._data.vertAlign&&(n-=this._lines.length*this._fontSize),"middle"===this._data.vertAlign&&(n-=this._lines.length*this._fontSize/2),"right"===this._data.horzAlign?o-=i:"center"===this._data.horzAlign&&(o-=i/2),r=this._data.backgroundColor||this._data.borderColor?~~(e/6):0,s=this._data.borderColor?~~Math.max(e/12,1):0,t.x>=o-r-s&&t.x<=o+i+r+s&&t.y>=n-s&&t.y<=n+this._lines.length*this._fontSize+2*r+s?this._hittest:null)},e.TextRenderer=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(28),r=function(t){function e(e){void 0===e&&(e=100);var i=t.call(this,e)||this;return i.type="percentage",i}return o.__extends(e,t),e.prototype.state=function(){var t=n.PriceFormatter.prototype.state.call(this);return t.percent=!0,t},e.prototype.format=function(e,i,o,n){return t.prototype.format.call(this,e,i,o,n)+"%"},e.serialize=function(t){return t.state()},e.deserialize=function(t){return new e(t.priceScale)},e}(n.PriceFormatter),e.PercentageFormatter=r},,function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M5.182 6.596l-3.889-3.889-.707-.707 1.414-1.414.707.707 3.889 3.889 3.889-3.889.707-.707 1.414 1.414-.707.707-3.889 3.889 3.889 3.889.707.707-1.414 1.414-.707-.707-3.889-3.889-3.889 3.889-.707.707-1.414-1.414.707-.707 3.889-3.889z"/></svg>'},function(t,e,i){"use strict";var o=i(22),n={_fontHeightCache:{},_parsedColorCache:{}};n._parseColor=function(t){var e,i,o;return this._parsedColorCache[t]?this._parsedColorCache[t]:(e=document.createElement("div"),e.style.color=t,i=e.style.color.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i)||e.style.color.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\,\s*(\d*\.?\d+)\s*\)$/i),o={r:i[1],g:i[2],b:i[3],a:i[4]||"1"},this._parsedColorCache[t]=o,o)},n.getColorFromProperties=function(t,e){var i=1-e.value()/100,o=this._parseColor(t.value());return"rgba("+o.r+","+o.g+","+o.b+","+i+")"},n.setColorToProperties=function(t,e,i){var o,n=this._parseColor(t);e.setValue("rgb("+n.r+","+n.g+","+n.b+")"),o=100*(1-n.a),i.setValue(Math.max(0,Math.min(o,100)))},n._parseFont=function(t){var e,i,o=document.createElement("div");return o.style.font=t,e=o.style.fontSize.match(/(\d+)pt/),i=e&&e[0]===o.style.fontSize,{family:o.style.fontFamily,size:i?e[1]:"",bold:"bold"===o.style.fontWeight,italic:"italic"===o.style.fontStyle}},n.getFontFromProperties=function(t,e,i,o){
return[i.value()?"bold":"",o.value()?"italic":"",e.value()+"pt",t.value()].join(" ")},n.setFontToProperties=function(t,e,i,o,n){var r=this._parseFont(t);r.family.length>0&&e.setValue(r.family),r.size.length>0&&i.setValue(r.size),o.setValue(r.bold),n.setValue(r.italic)},n.fontHeight=function(t){var e,i;return this._fontHeightCache[t]||(e=document.createElement("span"),e.appendChild(document.createTextNode("height")),document.body.appendChild(e),e.style.cssText="font: "+t+"; white-space: nowrap; display: inline;",i=e.offsetHeight,document.body.removeChild(e),this._fontHeightCache[t]=Math.ceil(i)),this._fontHeightCache[t]},n.drawPolyHoverOrPress=function(t,e,i,o){o?(t.save(),t.fillStyle="rgba(0, 0, 0, 0.15)",CanvasEx.drawPoly(t,e,!0),t.restore()):i&&(t.save(),t.fillStyle="rgba(0, 0, 0, 0.1)",CanvasEx.drawPoly(t,e,!0),t.restore())},n.repaint=function(t){var e=new o(o.LIGHT_UPDATE);e.force=!0,t.invalidate(e)},n.roundToMinTick=function(t,e){var i=t.mainSource().base(),o=1/i;return o*Math.round(e/o)},t.exports=n},function(t,e,i){"use strict";function o(t){for(var i=0;i<e.availableTimezones.length;i++)if(t===e.availableTimezones[i].id)return!0;return!1}var n,r,s,a,l,c,h;for(Object.defineProperty(e,"__esModule",{value:!0}),i(12),n=i(332),r=[{id:"Etc/UTC",title:$.t("UTC")},{id:"exchange",title:$.t("Exchange")}],s=[{id:"Pacific/Honolulu",title:$.t("Honolulu"),offset:0},{id:"America/Vancouver",title:$.t("Vancouver"),offset:0},{id:"America/Los_Angeles",title:$.t("Los Angeles"),offset:0},{id:"America/Phoenix",title:$.t("Phoenix"),offset:0},{id:"America/El_Salvador",title:$.t("San Salvador"),offset:0},{id:"America/Mexico_City",title:$.t("Mexico City"),offset:0},{id:"America/Chicago",title:$.t("Chicago"),offset:0},{id:"America/Bogota",title:$.t("Bogota"),offset:0},{id:"America/Toronto",title:$.t("Toronto"),offset:0},{id:"America/New_York",title:$.t("New York"),offset:0},{id:"America/Caracas",title:$.t("Caracas"),offset:0},{id:"America/Argentina/Buenos_Aires",title:$.t("Buenos Aires"),offset:0},{id:"America/Sao_Paulo",title:$.t("Sao Paulo"),offset:0},{id:"Europe/London",title:$.t("London"),offset:0},{id:"Europe/Madrid",title:$.t("Madrid"),offset:0},{id:"Europe/Paris",title:$.t("Paris"),offset:0},{id:"Europe/Rome",title:$.t("Rome"),offset:0},{id:"Europe/Belgrade",title:$.t("Belgrade"),offset:0},{id:"Europe/Berlin",title:$.t("Berlin"),offset:0},{id:"Africa/Cairo",title:$.t("Cairo"),offset:0},{id:"Europe/Luxembourg",title:$.t("Luxembourg"),offset:0},{id:"Europe/Warsaw",title:$.t("Warsaw"),offset:0},{id:"Europe/Zurich",title:$.t("Zurich"),offset:0},{id:"Europe/Athens",title:$.t("Athens"),offset:0},{id:"Europe/Istanbul",title:$.t("Istanbul"),offset:0},{id:"Asia/Jerusalem",title:$.t("Jerusalem"),offset:0},{id:"Asia/Kuwait",title:$.t("Kuwait"),offset:0},{id:"Europe/Moscow",title:$.t("Moscow"),offset:0},{id:"Asia/Riyadh",title:$.t("Riyadh"),offset:0},{id:"Asia/Qatar",title:$.t("Qatar"),offset:0},{id:"Asia/Tehran",title:$.t("Tehran"),offset:0},{id:"Asia/Dubai",title:$.t("Dubai"),offset:0},{id:"Asia/Muscat",title:$.t("Muscat"),offset:0},{
id:"Asia/Ashkhabad",title:$.t("Ashkhabad"),offset:0},{id:"Asia/Kolkata",title:$.t("Kolkata"),offset:0},{id:"Asia/Almaty",title:$.t("Almaty"),offset:0},{id:"Asia/Bangkok",title:$.t("Bangkok"),offset:0},{id:"Asia/Taipei",title:$.t("Taipei"),offset:0},{id:"Asia/Singapore",title:$.t("Singapore"),offset:0},{id:"Asia/Shanghai",title:$.t("Shanghai"),offset:0},{id:"Asia/Chongqing",title:$.t("Chongqing"),offset:0},{id:"Asia/Hong_Kong",title:$.t("Hong Kong"),offset:0},{id:"Asia/Seoul",title:$.t("Seoul"),offset:0},{id:"Asia/Tokyo",title:$.t("Tokyo"),offset:0},{id:"Australia/Brisbane",title:$.t("Brisbane"),offset:0},{id:"Australia/Adelaide",title:$.t("Adelaide"),offset:0},{id:"Australia/Sydney",title:$.t("Sydney"),offset:0},{id:"Pacific/Auckland",title:$.t("New Zealand"),offset:0},{id:"Pacific/Fakaofo",title:$.t("Tokelau"),offset:0},{id:"Pacific/Chatham",title:$.t("Chatham Islands"),offset:0}],a=0,l=s;a<l.length;a++)c=l[a],h=n.parseTzOffset(c.id),c.title="("+h.string+") "+c.title,c.offset=h.offset;s.sort(function(t,e){var i=t.offset-e.offset;return 0!==i?i:t.title.localeCompare(e.title)}),e.availableTimezones=r.concat(s),e.timezoneIsAvailable=o,e.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e.futuresRoots=[{d:"E-Mini S&P 500",t:"ES"},{d:"E-Mini Nasdaq 100",t:"NQ"},{d:"Gold",t:"GC"},{d:"Silver",t:"SI"},{d:"Crude Oil WTI",t:"CL"},{d:"Natural Gas",t:"NG"},{d:"Australian Dollar",t:"6A"},{d:"Australian Dollar (Floor)",t:"AD"},{d:"Euro FX",t:"6E"},{d:"Euro FX (Floor)",t:"EC"},{d:"Corn",t:"ZC"},{d:"Corn (Floor)",t:"C"},{d:"Eurodollar",t:"GE"},{d:"Eurodollar (Floor)",t:"ED"}]},function(t,e,i){"use strict";function o(t,e){var i,o={className:"spinner",color:r.color.spinner,corners:1,direction:1,fps:20,hwaccel:!1,left:"50%",length:0,lines:17,opacity:0,radius:20,rotate:0,scale:1,shadow:!1,speed:1.5,top:"50%",trail:60,width:3,zIndex:2e9},a=t?s[t]:null;return a&&(o=$.extend(o,a)),i=$.extend({},o,e),new n(i)}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),i(13),n=i(244),r=i(31),s={medium:{lines:14,scale:.8},micro:{lines:12,scale:.2},mini:{lines:14,scale:.4},xlarge:{lines:16,scale:1.6}},e.unifiedSpinner=o},function(t,e,i){"use strict";(function(t){function o(e,i,o){var n,r,s,a,l,c,h=this;if(this._options=$.extend({},this._defaultOptions,o||{}),this._$wrapper=e,this._$content=i,this._scroll_speed=40,this._shadow_offset=10,this._header_height=this._options.headerHeight,this._scroll_margin_top=this._options.scrollMarginTop,this.scrolled=new t,this.scrolltoend=new t,this.scrolltostart=new t,this.visibilityCallbacks=[],n=navigator.platform.toLowerCase(),r=navigator.userAgent.toLowerCase(),s=r.indexOf("firefox")>-1,a=n.indexOf("android")>-1||r.indexOf("android")>-1,this._touch=Modernizr.touch||navigator.msMaxTouchPoints||s&&a,this._touch)return this._$content.css("position","relative"),void this._$wrapper.css({"overflow-y":"auto","-webkit-overflow-scrolling":"touch","-ms-overflow-style":"-ms-autohiding-scrollbar"}).scroll(this._onScroll.bind(this));this._$wrapper.css("overflow","hidden"),
this._$wrapper.on("mouseenter.sidebar-scroll",function(){h._bottomFixed||h._dragging||(h._options.alwaysVisible||h._$scrollBar.addClass("active"),h._onScroll())}).on("mouseleave.sidebar-scroll",function(){h._bottomFixed||h._dragging||(h._options.alwaysVisible||h._$scrollBar.removeClass("active"),h._onScroll())}).on("mousewheel.sidebar-scroll",function(t,e){if(!t.isDefaultPrevented())return h.scroll(e,"MozMousePixelScroll"===t.originalEvent.type?2:null)}),!1!==this._options.showTopShadow&&(this._$shadowTop=$('<div class="sb-inner-shadow top i-invisible">').appendTo(this._$wrapper)),!1!==this._options.showBottomShadow&&(this._$shadowBottom=$('<div class="sb-inner-shadow">').appendTo(this._$wrapper)),this._$shadowTop&&this._header_height&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),l=this._options.additionalClass?" "+this._options.additionalClass:"",c=this._options.alwaysVisible?" active-always":"",this._$scrollBarWrapper=$('<div class="sb-scrollbar-wrap">').appendTo(this._$wrapper),this._$scrollBar=$('<div class="sb-scrollbar sb-scrollbar-body'+l+c+'"></div>').appendTo(this._$scrollBarWrapper),this._onScroll()}var n=i(134).lazyJqueryUI;o.prototype.isTouch=function(){return this._touch},o.prototype.getScrollBar=function(){return this._$scrollBar},o.prototype._defaultOptions={headerHeight:0,additionalClass:"",alwaysVisible:!1,showBottomShadow:!0,scrollMarginTop:1,bubbleScrollEvent:!1},o.prototype.initDraggable=function(){if(this._dragInitialized)return this;var t=this;return n(this._$scrollBar).draggable({axis:"y",containment:this._$scrollBarWrapper,start:function(){t._dragging=!0},stop:function(){t._dragging=!1},drag:function(e,i){t.updateScroll()}}),this._dragInitialized=!0,this},o.prototype.updateScroll=function(){var t,e,i,o,n;return this._touch?this:(t=1,e=Math.ceil(this._$scrollBar.position().top-this._scroll_margin_top-this._header_height),i=this.getContainerHeightWithoutHeader(),o=this._$content.outerHeight(),n=o-i-t,i<=0?this:(this._scroll_target_top=n<=0?this._header_height:Math.min(-e*o/i+this._header_height,this._header_height),e+this._$scrollBar.height()+2>=i?this.scrollToEnd():(this._$content.css("top",this._scroll_target_top+"px"),this._onScroll()),this))},o.prototype.getContainerHeightWithoutHeader=function(){return this._$wrapper[0].getBoundingClientRect().height-this._header_height},o.prototype.getContainerHeight=function(){return this._$wrapper[0].getBoundingClientRect().height},o.prototype.getContentHeight=function(){return this._$content[0].getBoundingClientRect().height},o.prototype.updateScrollBar=function(){var t,e,i,o,n,r,s,a,l;return this._touch?this:(t=1,e=this._$content.position().top,i=this.getContentHeight(),o=this.getContainerHeight(),n=this.getContainerHeightWithoutHeader(),r=t+this._header_height,s=n-2*t,a=(Math.abs(e)-this._header_height)*s/i,l=o*o/i,this.isContentShort()?(this._$scrollBar.addClass("js-hidden"),this._$wrapper.removeClass("sb-scroll-active")):(this._$scrollBar.removeClass("js-hidden").height(l).css("top",r+a),
this._$wrapper.addClass("sb-scroll-active"),this.initDraggable()),this)},o.prototype.scroll=function(t,e){var i,o,n,r,s;return this._touch?this:(i=this._$content.position().top,o=this._$content.outerHeight(),n=this.getContainerHeightWithoutHeader(),r=o-n-1,s=e||this._scroll_speed,r<=0||(this._scroll_target_top=Math.max(-r+this._header_height,Math.min(this._header_height,i+t*s)),this.setContentTop(this._scroll_target_top),this._onScroll()))},o.prototype.animateTo=function(t){var e,i,o;return this._touch?this:(e=this._$content.outerHeight(),i=this.getContainerHeightWithoutHeader(),(o=e-i-1)<=0||(this._scroll_target_top=Math.max(-o+this._header_height,Math.min(this._header_height,-t)),void this._$content.animate({top:this._scroll_target_top},500,function(){this._onScroll()}.bind(this))))},o.prototype.resize=function(){var t,e;if(!this._bottomFixed){if(t=this._$content.outerHeight(),e=this._$wrapper.outerHeight(),!this._options.vAlignBottom&&t<e)return void(this.atStart()||this.scrollToStart());this.atEnd()?this.scrollToEnd():"number"==typeof this._stickyBottom&&this.setContentTop(Math.min(0,this._stickyBottom+this._$wrapper.outerHeight()-this._$content.outerHeight()))}},o.prototype.resizeHeader=function(t){var e=t-this._header_height;this._header_height=t,this._scroll_target_top+=e,this._$shadowTop&&this._$shadowTop.css("top",this._header_height-this._shadow_offset),this.resize()},o.prototype.scrollTo=function(t,e){var i,o,n,r,s,a;if(e=$.extend({position:"visible",areaHeight:t instanceof $?t.height():0},e),t instanceof $&&(t=e.offsetTop||t.position().top),i=this._$content.position().top,o=this._$content.outerHeight(),n=this.getContainerHeightWithoutHeader(),o-n-1<=0)return!0;if(r=-1*(i-this._header_height),s=r+n,a=0,"visible"===e.position){if(t>r&&t+e.areaHeight<s)return!1;a=t+e.areaHeight>s?s-t-e.areaHeight:r-t}else"top"===e.position&&(a=r-t);return this.scroll(a,1),this._onScroll(),!1},o.prototype.scrollToEnd=function(){var t=this._$content.position().top,e=this._$content.outerHeight(),i=this._$wrapper.outerHeight(),o=e+t;return this.setContentTop(t+(i-o)+1),this._onScroll(),this},o.prototype.scrollToStart=function(){return this.setContentTop(this._header_height),this._onScroll(),this},o.prototype.currentPosition=function(){return Math.round(this._$content.position().top)},o.prototype.atStart=function(){return Math.round(this._$content.position().top)>=this._header_height},o.prototype.atEnd=function(t){var e,i,o,n;return"number"==typeof t&&isFinite(t)||(t=0),e=1,i=Math.round(this._$content.position().top),o=this._$content.outerHeight(),n=this._$wrapper.outerHeight(),o-Math.abs(i)-e<=n+t},o.prototype._onScroll=function(t){var e,i;return this._touch||this._$content.css("bottom","auto"),this.scrolled.fire(),this._dragging&&!0!==t||this.updateScrollBar(),e=this.atStart(),i=this.atEnd(),this._$shadowTop&&this._$shadowTop.toggleClass("i-invisible",!!e),this._$shadowBottom&&this._$shadowBottom.toggleClass("i-invisible",!!i),this._onContentVisible(),!this._atStart&&e?(this._atStart=!0,
this.scrolltostart.fire()):this._atStart&&!e&&delete this._atStart,!this._atEnd&&i?(this._atEnd=!0,this.scrolltoend.fire()):this._atEnd&&!i&&delete this._atEnd,this._options.vAlignBottom&&(this._stickyBottom=this._$content.outerHeight()-Math.abs(this._$content.position().top)-this._$wrapper.outerHeight()),!(!this._atStart&&!this._atEnd||("function"==typeof this._options.bubbleScrollEvent?!this._options.bubbleScrollEvent():!this._options.bubbleScrollEvent))},o.prototype.checkContentVisibility=function(){this._onContentVisible()},o.prototype.subscribeToContentVisible=function(t,e,i){this.visibilityCallbacks.push({id:t,$el:e,callback:i})},o.prototype.triggerVisibilityCallbacks=function(t){this._onContentVisible(t)},o.prototype._contentIsVisible=function(t){return t.$el.position().top>-1*this.currentPosition()},o.prototype._onContentVisible=function(t){var e,i,o;this.visibilityCallbacks.length&&(e=t||this._contentIsVisible.bind(this),i=[],o=this.visibilityCallbacks.filter(function(t,o){if(!$.contains(this._$content,t.$el[0]))return!1;var n=e(t);return n&&i.push(o),!n},this),i.forEach(function(e){this.visibilityCallbacks[e].callback(!!t)},this),delete this.visibilityCallbacks,this.visibilityCallbacks=o)},o.prototype.save=function(){return this._saved={top:this._$content.position().top,height:this._$content.outerHeight()},this},o.prototype.restore=function(){if(this._saved){if(this._saved.top===this._$content.position().top&&this._saved.height===this._$content.outerHeight())return delete this._saved,this;this._options.vAlignBottom&&(this._saved.top-=this._$content.outerHeight()-this._saved.height,this._saved.top>this._header_height&&(this._saved.top=this._header_height)),this.setContentTop(this._saved.top),delete this._saved,this._onScroll(!0)}return this},o.prototype.fixBottom=function(){var t,e;return this._bottomFixed?this:(this._touch?(t=this._$content.outerHeight(),e=this._$wrapper.scrollTop(),this._tempIntervalID=setInterval(function(){this._$wrapper.scrollTop(e+(this._$content.outerHeight()-t))}.bind(this),0)):this._$content.css({top:"auto",bottom:this._$wrapper.outerHeight()-this._$content.position().top-this._$content.outerHeight()}),this._bottomFixed=!0,this)},o.prototype.releaseBottom=function(){return this._bottomFixed?(this._touch?clearInterval(this._tempIntervalID):this._$content.css({top:this._$content.position().top,bottom:"auto"}),delete this._bottomFixed,this._onScroll(),this):this},o.prototype.setContentTop=function(t){return this._touch?this._options.vAlignBottom&&this._$content.outerHeight()<this._$wrapper.outerHeight()?(this._$wrapper.css("overflow-y","visible"),this._$content.css({position:"absolute",bottom:0})):(this._$content.css({position:"relative",bottom:"auto"}),this._$wrapper.css("overflow-y","auto"),this._$wrapper.scrollTop(-t)):this._$content.css("top",t),this},o.prototype.isContentShort=function(){return this.getContentHeight()<=this.getContainerHeightWithoutHeader()},o.prototype.destroy=function(){this._$scrollBarWrapper.remove(),this._$shadowBottom&&this._$shadowBottom.remove(),
this._$shadowTop&&this._$shadowTop.remove(),this._$wrapper.attr("style","").off("mouseenter.sidebar-scroll").off("mouseleave.sidebar-scroll").off("mousewheel.sidebar-scroll"),this._$content.attr("style","")},e.SidebarCustomScroll=o}).call(e,i(10))},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(10),r=function(){function t(t,e,i,o,r){var s=this;this._onChange=new n,this._handleChange=function(){s._onChange.fire(s.get())},this._crossTabEvents=t,this._jsonKeyValueStore=e,this.CROSSTAB_EVENT_NAME=i,this.JSON_STORE_KEY=o,this.defaultStoreValue=this._serialize(r),this._subscribe()}return t.prototype.get=function(){var t=this._jsonKeyValueStore.getJSON(this.JSON_STORE_KEY,this.defaultStoreValue);return this._deserialize(t)},t.prototype.set=function(t){var e=this._serialize(t);this._jsonKeyValueStore.setJSON(this.JSON_STORE_KEY,e),this._crossTabEvents.emit(this.CROSSTAB_EVENT_NAME),this._onChange.fire(t)},t.prototype.getOnChange=function(){return this._onChange},t.prototype.destroy=function(){this._unsubscribe(),this._onChange.destroy()},t.prototype._subscribe=function(){this._crossTabEvents.on(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.subscribe(this,this._handleChange)},t.prototype._unsubscribe=function(){this._crossTabEvents.off(this.CROSSTAB_EVENT_NAME,this._handleChange),this._jsonKeyValueStore.onSync.unsubscribe(this,this._handleChange)},t}(),e.AbstractJsonStoreService=r,s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype._serialize=function(t){return t},e.prototype._deserialize=function(t){return t},e}(r),e.CommonJsonStoreService=s},function(t,e){},function(t,e,i){"use strict";function o(t){this.items=t.items,this._simpleMode=t.simpleMode,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth,this.lineStyle=t.lineStyle,this.withMarkers=t.withMarkers,this.withSteps=t.withSteps,this.hittest=t.hittest,this.ignorePaletteLineWidth=t.ignorePaletteLineWidth,this.forceLineColor=!!t.forceLineColor}var n=i(8).Point,r=i(44).distanceToSegment,s=i(45),a=i(11);o.prototype.draw=function(t){t.lineCap="square",t.lineJoin=this.withMarkers?"round":"miter",t.strokeStyle=this.lineColor,t.fillStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,s.setValidLineStyle(t,this.lineStyle),this._simpleMode?this._drawSimpleMode(t):this._drawLines(t)},o.prototype._drawSimpleMode=function(t){var e,i,o,n;if(t.beginPath(),this.walkLine(t,this.items),t.stroke(),this.withMarkers){for(e=this.lineWidth+2,i=2*Math.PI,t.beginPath(),n=this.items.length;n--;)(o=this.items[n])&&(t.moveTo(o.x,o.y),t.arc(o.x,o.y,e,0,i));t.fill()}},o.prototype.walkLine=function(t,e,i,o){var n,r,a,l,c,h,u,d,p,_,f;if(e){for(n=.25*this.barSpacing,u=s.coordinateIsValid,d=0,p=e.length;d<p;d++)if(_=e[d],u(_.y)){a=_,r=d;break}if(void 0!==r&&a)for(f=this.withSteps&&this.lineWidth&&this.lineWidth%2==0?.5:0,d=r,p=e.length;d<p;d++){if(c=e[d],h=e[d+1]||{},
u(c.y))if(l&&u(l.y))this.withSteps&&t.lineTo(l.x+f,c.y+f),t.lineTo(c.x+f,c.y+f),i&&!u(h.y)&&t.lineTo(c.x+f,o);else if(h&&u(h.y))i?(d!==r&&t.lineTo(c.x+f,o),t.lineTo(c.x+f,c.y+f)):t.moveTo(c.x+f,c.y+f);else if(i){if(0===d)continue;d!==r&&t.lineTo(c.x-n+f,o),t.lineTo(c.x-n+f,c.y+f),t.lineTo(c.x+n+f,c.y+f),t.lineTo(c.x+n+f,o)}else t.moveTo(c.x-n+f,c.y+f),t.lineTo(c.x+n+f,c.y+f);l=c}}},o.prototype._drawLines=function(t){function e(e,i,o){a(i.y)&&(a(e.y)?t.lineTo(i.x,i.y):o&&a(o.y)?t.moveTo(i.x,i.y):(t.moveTo(i.x-r,i.y),t.lineTo(i.x+r,i.y)))}var i,o,n,r,a,l,c,h,u,d,p,_,f,m;if(this.items.length){for(r=.25*this.barSpacing,a=s.coordinateIsValid,t.beginPath(),l=this.items[0],l&&t.moveTo(l.x,l.y),c=t.strokeStyle,h=t.lineWidth,u=t.lineStyle,d=1;d<this.items.length;++d)i=this.items[d-1],o=this.items[d],n=this.items[d+1],o.style&&!this.forceLineColor?(p=o.style.color,_=o.style.width,f=o.style.style):(p=this.lineColor,_=this.lineWidth,f=this.lineStyle),this.ignorePaletteLineWidth&&(_=this.lineWidth),m=p!==c||_!==h||f!==u,m&&(c=p,h=_,u=f,t.stroke(),t.beginPath(),t.strokeStyle=p,t.lineWidth=_,s.setValidLineStyle(t,f),t.moveTo(i.x,i.y)),e(i,o,n);t.stroke()}},o.prototype.hitTest=function(t){for(var e,i,o,l,c,h,u,d,p=s.selectionTolerance(this.lineWidth),_=0,f=this.items.length-1;f-_>2;)h=Math.round((f+_)/2),u=this.items[h],u.x<=t.x?_=h:f=h;for(_=Math.max(1,_-1),f=Math.min(this.items.length-1,f+1),d=_;d<=f;++d)if(e=this.items[d-1],i=this.items[d],o=e.x,l=i.x,c=r(new n(o,e.y),new n(l,i.y),new n(t.x,t.y)),c.distance<=p)return this.hittest?this.hittest:new a(a.REGULAR);return null},e.PaneRendererLine=TradingView.PaneRendererLine=o},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(28),n=function(){function t(){}return t.prototype.format=function(t){return o.customFormatters&&o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.format(t):o.numberToStringWithLeadingZero(t.getUTCFullYear(),4)+"-"+o.numberToStringWithLeadingZero(t.getUTCMonth()+1,2)+"-"+o.numberToStringWithLeadingZero(t.getUTCDate(),2)},t.prototype.formatLocal=function(t){return o.customFormatters.dateFormatter?o.customFormatters.dateFormatter.formatLocal?o.customFormatters.dateFormatter.formatLocal(t):o.customFormatters.dateFormatter.format(t):o.numberToStringWithLeadingZero(t.getFullYear(),4)+"-"+o.numberToStringWithLeadingZero(t.getMonth()+1,2)+"-"+o.numberToStringWithLeadingZero(t.getDate(),2)},t}(),e.DateFormatter=n},,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";var o,n=function(){try{this.isAvailable=!0,this.localStorage=window.localStorage,this.localStorage.setItem("tvlocalstorage.available","true")}catch(t){delete this.isAvailable,delete this.localStorage}this._updateLength()};n.prototype.length=0,n.prototype.isAvailable=!1,n.prototype.localStorage={"tvlocalstorage.available":"false"},n.prototype._updateLength=function(){var t,e;if(this.isAvailable)this.length=this.localStorage.length;else{t=0;for(e in this.localStorage)this.localStorage.hasOwnProperty(e)&&t++;this.length=t}},n.prototype.key=function(t){
return this.isAvailable?this.localStorage.key(t):Object.keys(this.localStorage)[t]},n.prototype.getItem=function(t){return this.isAvailable?this.localStorage.getItem(t):this.localStorage[t]},n.prototype.setItem=function(t,e){this.isAvailable?this.localStorage.setItem(t,e):this.localStorage[t]=e,this._updateLength()},n.prototype.removeItem=function(t){this.isAvailable?this.localStorage.removeItem(t):delete this.localStorage[t],this._updateLength()},n.prototype.clear=function(){this.isAvailable?this.localStorage.clear():this.localStorage={},this._updateLength()},o=function(t){this.storage=t},o.prototype.getItem=function(t){return Promise.resolve(this.storage.getItem(t))},o.prototype.setItem=function(t,e){return Promise.resolve(this.storage.setItem(t,e))},window.TVLocalStorage=new n,window.TVLocalStorageAsync=new o(window.TVLocalStorage),t.exports={TVLocalStorage:window.TVLocalStorage,TVLocalStorageAsync:window.TVLocalStorageAsync}},function(t,e,i){"use strict";function o(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}Object.defineProperty(e,"__esModule",{value:!0}),e.regExpEscape=o},function(t,e,i){"use strict";(function(o){function n(t){return t&&t.__esModule?t:{default:t}}function r(){var t,e,i=h.width();for(d.width=i,d.height=h.height(),t=0;t<p.length;t++)if(i<=d.breakpoints[p[t]]){d.device!==p[t]&&(e=d.device,d.device=p[t],d.trigger("changeDevice",[p[t],e]));break}return d}var s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),s=i(91),a=n(s),l=i(587),c=$("body"),h=$(window),u=0,d={width:null,height:null,device:null,checkDevice:r,isMobileSafari:!!navigator.userAgent.match(/Version\/[\d\.]+.*Safari/)||!!navigator.userAgent.match("CriOS"),getScrollbarWidth:function(){var t=void 0;return function(){var e,i,o,n;return void 0===t&&(e=document.createElement("div"),e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e),i=e.offsetWidth,e.style.overflow="scroll",o=document.createElement("div"),o.style.width="100%",e.appendChild(o),n=o.offsetWidth,e.parentNode.removeChild(e),t=i-n),t}}(),hasScroll:function(t){return t.get(0).scrollHeight>t.height()},breakpoints:l.breakpoints,widgetbarBreakpoint:1064,setFixedBodyState:function(t){var e,i,o;t&&1==++u?("hidden"!==$(document.body).css("overflow").toLowerCase()&&document.body.scrollHeight>document.body.offsetHeight&&($(".widgetbar-wrap").css("right",d.getScrollbarWidth()),c.css("padding-right",parseInt(c.css("padding-right").replace("px",""))+d.getScrollbarWidth()+"px").data("wasScroll",!0)),!TradingView.isMobile.any()&&d.isMobileSafari?c.addClass("i-no-scroll-safari"):c.css("top",-h.scrollTop()).addClass("i-no-scroll")):!t&&u>0&&0==--u&&(!TradingView.isMobile.any()&&d.isMobileSafari?c.removeClass("i-no-scroll-safari"):(e=-parseInt(c.css("top").replace("px","")),c.removeClass("i-no-scroll").css("top",""),h.scrollTop(e)),c.data("wasScroll")&&(i=c.get(0),$(".widgetbar-wrap").css("right",0),o=$(".widgetbar-wrap").width()||0,i.scrollHeight<=i.clientHeight&&(o-=d.getScrollbarWidth()),
c.css("padding-right",(o<0?0:o)+"px").data("wasScroll",void 0)))}},p=Object.keys(d.breakpoints).sort(function(t,e){return d.breakpoints[t]-d.breakpoints[e]}),o.extend(d,a.default.prototype),r(),$(r),h.on("resize",r),e.default=d,t.exports=e.default}).call(e,i(118))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(588);e.TVDialogAbstract=o.TVDialogAbstract,e.closeAllDialogs=o.closeAllDialogs},function(t,e,i){"use strict";function o(t){if(t)return function(e,i,o){function n(e,i){return i?t[e](a,i):t[e](a)}var r,s,a=$(this);return"get"===e?(r=i,"function"==typeof t[r]?n(r,o):t[r]):t[e]?a.each(function(){return n(e,s)}):a}}function n(t,e){function i(t,e,i){return void 0===i?t[e]():t[e](i)}if(t&&e)return t=""+t,function(o,n,a){var l,c,h;return"get"===o?l=n:(c=n,"object"===(void 0===o?"undefined":r(o))&&void 0===n?(c=o,o="init"):"string"!=typeof o&&(o="init")),"getInstance"===o?$(this).eq(0).data(t):"destroy"===o?(h=$(this).eq(0).data(t))?void("function"==typeof h.destroy?(i(h,"destroy",c),$(this).eq(0).removeData(t)):s.logError("[Block Plugin] "+t+" does not support destroy command")):void console.warn("[Block Plugin] Trying to execute destroy method of "+t+" but it has not been inited"):"get"===o?(h=$(this).eq(0).data(t),h?"function"==typeof h[l]?i(h,l,a):h[l]:void console.warn("[Block Plugin] Trying to get prop or execute method of "+t+" but it has not been inited")):$(this).each(function(){var n=$(this),r=n.data(t);void 0===r&&(r=void 0===c?e(n):e(n,c),n.data(t,r)),"init"!==o&&("function"==typeof r[o]?i(r,o,c):s.logError("[Block Plugin] "+t+" does not support command "+o))})}}var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=i(7).getLogger("CommonUI.CreateTVBlockPlugin");t.exports.createTvBlockPlugin=o,t.exports.createTvBlockWithInstance=n},function(t,e,i){"use strict";(function(o){function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(203),i(296),a=i(7).getLogger("Ui.TvControlCheckbox"),l={labelWrapper:'{{#hasLabel}}<label>{{#labelLeft}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelLeft}}</span>{{/labelLeft}}{{> inputWrapper }}{{#labelRight}}<span class="tv-control-checkbox__label {{#labelAddClass}}{{labelAddClass}}{{/labelAddClass}}">{{labelRight}}</span>{{/labelRight}}</label>{{/hasLabel}}{{^hasLabel}}{{> inputWrapper }}{{/hasLabel}}',inputWrapper:'<{{ tag }} class="{{ customClass }}{{#disabled}} i-disabled{{/disabled}}">{{^hasCheckbox}}{{> checkbox }}{{/hasCheckbox}}{{> box }}{{> ripple }}</{{ tag }}>',
checkbox:'<input{{#id}} id="{{ id }}"{{/id}} class="{{> checkboxClass }}" type="checkbox"{{#name}} name="{{ name }}"{{/name}}{{#checked}} checked{{/checked}}{{#disabled}} disabled{{/disabled}}>',checkboxClass:"{{ customClass }}__input",box:'<span class="{{ customClass }}__box {{#boxAddClass}}{{boxAddClass}}{{/boxAddClass}}">'+i(146)+"</span>",ripple:'<span class="{{ customClass }}__ripple js-ripple"></span>'},c="i-inited",h=function(){function t(e){var i,o=e.customClass,r=void 0===o?"tv-control-checkbox":o,s=e.$checkbox,l=e.tag,h=e.id,u=e.name,d=e.checked,p=e.disabled,_=e.labelLeft,f=e.labelRight,m=e.labelAddClass,g=e.boxAddClass;if(n(this,t),this.$el=null,void 0===l&&(l=_||f?"span":"label"),i=s instanceof $&&!!s.length){if(!s.is("input[type=checkbox]"))return void a.logError("`$checkbox` need to be input[type=checkbox]");if(s.hasClass(c))return;this._setInputId(s,h),this._setInputClass(s,r),this._setInputName(s,u),this._setInputChecked(s,d),this._setInputDisabled(s,p),d=!!s.prop("checked"),p=!!s.attr("disabled")}this.$el=this.render({$checkbox:s,hasCheckbox:i,customClass:r,tag:l,id:h,name:u,checked:d,disabled:p,labelLeft:_,labelRight:f,hasLabel:_||f,labelAddClass:m,boxAddClass:g}),this.$checkbox=i?s:this.$el.find("input[type=checkbox]")}return r(t,[{key:"_setInputId",value:function(t,e){void 0!==e&&t.attr("id",e)}},{key:"_setInputClass",value:function(t,e){var i=o.render(l.checkboxClass,{customClass:e});t.addClass(i)}},{key:"_setInputName",value:function(t,e){void 0!==e&&t.attr("name",e)}},{key:"_setInputChecked",value:function(t,e){void 0!==e&&t.prop("checked",!!e)}},{key:"_setInputDisabled",value:function(t,e){void 0!==e&&(e?t.setAttribute("disabled","disabled"):t.removeAttr("disabled"))}},{key:"render",value:function(t){var e,i=t.$checkbox,n=$(o.render(l.labelWrapper,t,l));return t.hasCheckbox&&(n.insertBefore(i),e=n.find("."+t.customClass).andSelf().filter("."+t.customClass).eq(0),e.prepend(i.detach()),i.addClass(c)),n}},{key:"checked",set:function(t){this._setInputChecked(this.$checkbox,!!t)},get:function(){return!!this.$checkbox.prop("checked")}}]),t}(),$.fn.tvControlCheckbox=(0,s.createTvBlockWithInstance)("tv-control-checkbox",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new h(TradingView.mergeObj(e,{$checkbox:t}))}),e.default=h,t.exports=e.default}).call(e,i(41))},function(t,e,i){"use strict";i(102);t.exports=TradingView.templates={dialogs:{},lists:{},onChartMessage:'<div class="onchart-message"><span class="onchart-message-close"></span><div class="onchart-message-top"><div class="onchart-message-copy"></div></div><div class="onchart-message-bottom"><div class="onchart-message-ear"></div></div></div>',
miniWidgetWizardAddSymbol:'<tr class="tv-external-tools__symbol-item"><td class="tv-external-tools__symbol-item-cell">{{symbol}}</td><td class="tv-external-tools__symbol-item-cell{{#descriptionShortening}} apply-common-tooltip" title="{{description}}"{{/descriptionShortening}}">{{#descriptionShortening}}{{descriptionShortening}}{{/descriptionShortening}}{{^descriptionShortening}}{{description}}{{/descriptionShortening}}</td>{{#timeframeSelectAllow}}<td class="tv-external-tools__symbol-item-cell">{{timeframe}}</td>{{/timeframeSelectAllow}}<td class="tv-external-tools__remove-cell"><div class="tv-external-tools__remove-symbol"></div></td></tr>',textNotesWidgetLayout:'<div class="notes-block"><div class="textnotes-search-header"><div class="search-input-block">'+i(595)+'<div class="search-clean"></div><input type="text" class="search-input" placeholder="'+$.t("Search Note")+'" maxlength="1000" autocomplete="off"></div><div class="new-note-btn">'+i(596)+$.t("NEW")+'</div></div><div class="notes-wrapper"><div class="notes"></div></div></div><div class="notes-desc-block"><div class="notes-desc-wrapper"><div class="notes-desc-inner"><div class="remove-note-btn" title="'+$.t("Delete Text Note")+'">'+i(597)+'</div><div class="title-wrap"><input type="text" maxlength="100" value="" class="title"></div><div class="date"><span class="created">'+$.t("Created ")+'<span class="created-val"></span>. </span><span class="modified">'+$.t("Last edited ")+'<span class="modified-val"></span></span></div><textarea></textarea></div></div></div>',textNotesWidgetItem:'<div class="note"><div class="note-header"><div {{#symbol}}title="'+$.t("Open {{symbol}} Text Note")+'"{{/symbol}} class="title {{#symbol}}title_with-badge{{/symbol}}">{{title}}</div>{{#symbol}}<div class="symbol-badge">'+i(598)+'<span class="symbol">{{symbol}}</span></div>{{/symbol}}</div><div class="note-desc">{{description}}</div><span class="favorite"></span></div>',tvDataTable:'<table class="tv-data-table {{className}}"><thead class="tv-data-table__thead"><tr class="tv-data-table__stroke">{{#columns}}<th class="tv-data-table__cell tv-data-table__cell--bold {{className}}"><span class="tv-data-table__cell-text{{^notSortable}} tv-data-table__sortable{{/notSortable}}{{#help}} apply-common-tooltip{{/help}}{{#htmlHelp}} common-tooltip-html{{/htmlHelp}}" {{#help}}title="{{help}}"{{/help}}>{{{label}}}</span></th>{{/columns}}</tr></thead>{{#bodies}}<tbody class="tv-data-table__tbody {{className}}">{{#strokes}}<tr class="tv-data-table__stroke">{{#cells}}<td class="tv-data-table__cell {{className}}"{{#colspan}}colspan="{{colspan}}"{{/colspan}}>{{#contain}}{{{contain}}}{{/contain}}</td>{{/cells}}</tr>{{/strokes}}</tbody>{{/bodies}}</table>',tvDataTableRow:'<tr class="tv-data-table__stroke {{rowClassName}}">{{#columns}}<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>{{/columns}}</tr>',tvDataTableCell:'<td class="tv-data-table__cell {{className}}">{{#contain}}{{{contain}}}{{/contain}}</td>'}},function(t,e,i){"use strict";function o(t){
var e=t.split(":");return{name:e[0],type:2===e.length?e[1]:null}}function n(t,e,i,n){var r,s,a,l,c,p,_,f,m,g,v,y,b,S,w,T=i.split(".");if(0!==T.length&&0!==T[0].length){if(r=o(T[0]),s=r.name,a=r.type,l=null!==a,c=!l||"plot"===a,p=!l||"band"===a,_=!l||"area"===a,f=!l||"input"===a,m=c?d.getPlotIdByTitle(t,s):null,g=p?d.getBandIndexByName(t,s):null,v=_?d.getFilledAreaIdByTitle(t,s):null,y=f?d.getInputByName(t,s):null,b=e.hasOwnProperty(s),(null!==m?1:0)+(null!==g?1:0)+(null!==v?1:0)+(null!==y?1:0)+(b?1:0)>1)return void h.logWarn("Study '"+t.description+"' has ambiguous identifier '"+s+"'");if(S=T[1],null!==m){if(1===T.length)return void h.logWarn("Path of sub-property of '"+s+"' plot for study '"+t.description+"' must be not empty");w=T.slice(1),u.applyPlotProperty(t,e,m,w,n)}else if(null!==y)u.applyInputValue(e,y,n);else if(null!==g){if(void 0===S)return void h.logWarn("Property name of '"+s+"' band for study '"+t.description+"' must be set");u.applyBandProperty(e,g,S,n)}else if(null!==v){if(void 0===S)return void h.logWarn("Property name of '"+s+"' area for study '"+t.description+"' must be set");u.applyFilledAreaProperty(e,v,S,n)}else b?u.setRootProperty(e,T,n):h.logWarn("Study '"+t.description+"' has no plot or input '"+s+"'")}}function r(t,e){var i,o,r=t.properties(),s=r.state();for(i in e)e.hasOwnProperty(i)&&n(t.metaInfo(),s,i,e[i]);r.merge(s),o=r.precision,void 0!==o?o.listeners().fire(o):r.listeners().fire(r)}function s(t,e,i){var o,r,s,a,l;for(o in t)t.hasOwnProperty(o)&&-1!==(r=o.indexOf("."))&&(s=o.substr(0,r),a=d.getMetaInfoByDescription(e,s),null!==a?(l=i(a.id),null!==l?n(a,l,o.substr(r+1),t[o]):h.logWarn("Cannot apply overrides for study "+s)):h.logWarn("There is no such study "+s))}var a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),a=i(111),l=i(9),c=i(7),h=c.getLogger("Chart.Model.StudyPropertiesOverrider"),function(t){function e(t){return"colorer"===t.type}function i(t,i,o){var n,r,s,a;if(void 0===t.plots)return null;for(n=0,r=t.plots;n<r.length;n++)if(s=r[n],e(s)&&void 0!==i.palettes&&(a=i.palettes[s.palette],s.target===o&&void 0!==a))return a;return null}function o(t,e,i,o,n){return void 0===t.styles?void h.logWarn("Study does not have styles"):null===e&&!isNaN(o)&&o>0?void h.logWarn("Study plot does not have color #"+o):((0===o||isNaN(o))&&(l.ensureDefined(t.styles[i]).color=n+"",o=0),void(null!==e&&(l.ensureDefined(e.colors[o]).color=n+"")))}function n(t,e,n,r,s){var a,l,c,u,p;if(void 0===e.styles)return void h.logWarn("Study does not have styles");if("color"===(a=r[0]))return l=i(t,e,n),c=r.length>1?parseInt(r[1]):NaN,void o(e,l,n,c,s);if(void 0===(u=e.styles[n])||!u.hasOwnProperty(a))return void h.logWarn("Study plot does not have property '"+a+"'");if("plottype"===a){if(void 0===(p=d[s+""]))return void h.logWarn("Unsupported plot type for plot: "+s);s=p}u[a]=s}function r(t,e,i,o){var n,r;if(void 0===t.bands)return void h.logWarn("Study does not have bands");if(void 0===(n=t.bands[e])||!n.hasOwnProperty(i))return void h.logWarn("Study band does not have property '"+i+"'")
;if("plottype"===i){if(void 0===(r=d[o+""]))return void h.logWarn("Unsupported plot type for band: "+o);o=r}n[i]=o}function s(t,e,i,o){if(void 0===t.filledAreasStyle)return void h.logWarn("Study does not have areas");var n=t.filledAreasStyle[e];if(void 0===n||!n.hasOwnProperty(i))return void h.logWarn("Study area does not have property '"+i+"'");n[i]=o}function c(t,e,i){if(void 0===t.inputs||!t.inputs.hasOwnProperty(e))return void h.logWarn("Study does not have input '"+e+"'");t.inputs[e]=i}function u(t,e,i){var o,n,r,s,a;if(0!==e.length){for(o=t,n=0,r=e.slice(0,-1);n<r.length&&(s=r[n],null!=o&&t.hasOwnProperty(s));n++)o=t[s];if(a=e[e.length-1],null==o||!o.hasOwnProperty(a))return void h.logWarn("Study does not have property "+e.join("."));o[a]=i}}var d={line:a.PlotType.Line,histogram:a.PlotType.Histogram,cross:a.PlotType.Cross,area:a.PlotType.Area,columns:a.PlotType.Columns,circles:a.PlotType.Circles,line_with_breaks:a.PlotType.LineWithBreaks,area_with_breaks:a.PlotType.AreaWithBreaks};t.applyPlotProperty=n,t.applyBandProperty=r,t.applyFilledAreaProperty=s,t.applyInputValue=c,t.setRootProperty=u}(u||(u={})),function(t){function e(t,e){var i,o,n;if(void 0===t.inputs)return null;for(e=e.toLowerCase(),i=0,o=t.inputs;i<o.length;i++)if(n=o[i],n.name.toLowerCase()===e)return n.id;return null}function i(t,e){var i,o,n;if(void 0===t.styles)return null;e=e.toLowerCase();for(i in t.styles)if(o=t.styles[i],n=void 0!==o&&void 0!==o.title?o.title:i,n.toLowerCase()===e)return i;return null}function o(t,e){var i,o,n;if(void 0===t.filledAreas)return null;for(e=e.toLowerCase(),i=0,o=t.filledAreas;i<o.length;i++)if(n=o[i],n.title.toLowerCase()===e)return n.id;return null}function n(t,e){if(void 0===t.bands)return null;e=e.toLowerCase();for(var i=0;i<t.bands.length;++i)if(t.bands[i].name.toLowerCase()===e)return i;return null}function r(t,e){var i,o,n;for(e=e.toLowerCase(),i=0,o=t;i<o.length;i++)if(n=o[i],n.description.toLowerCase()===e||n.shortDescription.toLowerCase()===e)return n;return null}t.getInputByName=e,t.getPlotIdByTitle=i,t.getFilledAreaIdByTitle=o,t.getBandIndexByName=n,t.getMetaInfoByDescription=r}(d||(d={})),e.applyOverridesToStudy=r,e.applyOverridesToStudyDefaults=s},function(t,e,i){"use strict";function o(t,e,i){var o,n,r,s,a=null,l=0;return i=i||{},s=function(){l=!1===i.leading?0:Date.now(),a=null,r=t.apply(o,n),a||(o=n=null)},function(){var c,h=Date.now();return l||!1!==i.leading||(l=h),c=e-(h-l),o=this,n=arguments,c<=0||c>e?(a&&(clearTimeout(a),a=null),l=h,r=t.apply(o,n),a||(o=n=null)):a||!1===i.trailing||(a=setTimeout(s,c)),r}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,t.exports=e.default},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(43),n=i(2),r=i(14),s=i(59),a=i(85),l=i(151),c=i(722),h=i(392),u=function(t){function e(e){var i=t.call(this,e)||this;return i._toggleDropdown=function(t){i.setState({isOpened:void 0!==t?t:!i.state.isOpened})},i._handleClose=function(){i._toggleDropdown(!1)},i._getDropdownPosition=function(){
if(!i._control)return{x:0,y:0};var t=i._control.getBoundingClientRect();return{x:t.left+t.width+1,y:t.top-6}},i._handleClickArrow=function(){i._toggleDropdown()},i._handleTouchStart=function(){i.props.onClickButton(),i._toggleDropdown()},i._handlePressStart=function(){if(Modernizr.touch)i._longPressDelay||i.props.onClickButton();else{if(i._doubleClickDelay)return clearTimeout(i._doubleClickDelay),delete i._doubleClickDelay,void i._toggleDropdown(!0);i._doubleClickDelay=setTimeout(function(){delete i._doubleClickDelay,i._longPressDelay||i.props.onClickButton()},175)}i._longPressDelay=setTimeout(function(){delete i._longPressDelay,i._toggleDropdown(!0)},300)},i._handlePressEnd=function(){i._longPressDelay&&(clearTimeout(i._longPressDelay),delete i._longPressDelay,i.state.isOpened?i._toggleDropdown(!1):i.state.isOpened||!i.props.isActive||Modernizr.touch||i._toggleDropdown(!0))},i.state={isOpened:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t,e=this,i=this.props,o=i.buttonActiveClass,u=i.buttonClass,d=i.buttonIcon,p=i.buttonTitle,_=i.children,f=i.isActive,m=i.isGrayed,g=i.onClickWhenGrayed,v=this.state.isOpened;return n.createElement("div",{className:r(c.dropdown,"apply-common-tooltip common-tooltip-vertical",(t={},t[c.isGrayed]=m,t[c.isActive]=f,t[c.isOpened]=v,t)),onClick:m?g:void 0,title:p,"data-tooltip-delay":1500},n.createElement("div",{ref:function(t){return e._control=t},className:c.control},n.createElement("div",{className:c.buttonWrap,onMouseDown:m||Modernizr.touch?void 0:this._handlePressStart,onMouseUp:m||Modernizr.touch?void 0:this._handlePressEnd,onClick:!m&&Modernizr.touch?this._handleTouchStart:void 0},n.createElement(l.ToolButton,{activeClass:o,className:u,icon:d,isActive:f,isGrayed:m,isTransparent:!0})),!m&&!Modernizr.touch&&n.createElement("div",{className:c.arrow,onClick:this._handleClickArrow},n.createElement(s.Icon,{className:c.arrowIcon,icon:h}))),!m&&n.createElement(a.PopupMenu,{doNotCloseOn:this,isOpened:v,onClose:this._handleClose,position:this._getDropdownPosition},_))},e}(n.PureComponent),e.ToolDropdown=u},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path fill-rule="evenodd" d="M10.893 9.512l.458 3.624c.014.105-.006.16-.02.176-.028.03-.109.005-.182-.03L7.812 11.73a1.973 1.973 0 0 0-.811-.16c-.302 0-.59.057-.81.16l-3.338 1.552c-.118.056-.164.051-.182.03-.014-.016-.034-.07-.02-.178L3.11 9.51c.06-.503-.162-1.18-.505-1.54L.087 5.302c-.085-.091-.09-.148-.086-.158.003-.01.04-.053.16-.077l3.621-.689c.491-.09 1.069-.506 1.315-.948L7.004 0l1.902 3.43c.246.442.824.859 1.312.947l3.617.69c.123.024.162.068.164.077.003.01-.003.066-.089.157L11.4 7.97c-.348.367-.57 1.045-.506 1.543z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M9.901 9.639c-.102-.797.218-1.775.77-2.356l1.438-1.527-2.07-.395c-.784-.142-1.615-.742-2.008-1.446L7.003 2.06 5.97 3.917c-.391.702-1.222 1.301-2 1.443l-2.08.396 1.44 1.526c.547.577.866 1.549.77 2.353l-.262 2.086 1.93-.897a2.95 2.95 0 0 1 1.233-.254c.44 0 .87.085 1.233.254l1.93.897-.263-2.082zm.992-.127l.458 3.624c.014.105-.006.16-.02.176-.028.03-.109.005-.182-.03L7.812 11.73a1.973 1.973 0 0 0-.811-.16c-.302 0-.59.057-.81.16l-3.338 1.552c-.118.056-.164.051-.182.03-.014-.016-.034-.07-.02-.178L3.11 9.51c.06-.503-.162-1.18-.505-1.54L.087 5.302c-.085-.091-.09-.148-.086-.158.003-.01.04-.053.16-.077l3.621-.689c.491-.09 1.069-.506 1.315-.948L7.004 0l1.902 3.43c.246.442.824.859 1.312.947l3.617.69c.123.024.162.068.164.077.003.01-.003.066-.089.157L11.4 7.97c-.348.367-.57 1.045-.506 1.543z"/></svg>'},function(t,e,i){"use strict";function o(t){return n.createDialog(Object.assign({},a,t))}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),i(12),n=i(65),r={key:13,name:"yes",text:$.t("Yes"),type:"success"},s={method:"close",name:"no",text:$.t("No"),type:"default"},a={actions:[r,s],actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',content:$.t("Are you sure?"),contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text"><p></p></div></div>',destroyOnClose:!0,title:$.t("Confirmation"),width:400},e.createConfirmDialog=o},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=i(19),function(t){t[t.FromLeft=-1]="FromLeft",t[t.FromRight=1]="FromRight"}(r=e.TimePointIndexSearchMode||(e.TimePointIndexSearchMode={})),s=function(){function t(t){this.m_bars=new n.PlotList(t),this.m_nsBars=new n.PlotList(t)}return t.prototype.bars=function(){return this.m_bars},t.prototype.nsBars=function(){return this.m_nsBars},t.prototype.size=function(){return this.m_bars.size()+this.m_nsBars.size()},t.prototype.each=function(t){this.m_bars.each(t),this.m_nsBars.each(t)},t.prototype.clear=function(){this.m_bars.clear(),this.m_nsBars.clear(),this.lastProjectionPrice=void 0},t.prototype.isEmpty=function(){return this.m_bars.isEmpty()&&this.m_nsBars.isEmpty()},t.prototype.first=function(){return this.m_bars.isEmpty()?this.m_nsBars.first():this.m_bars.first()},t.prototype.last=function(){return this.m_nsBars.isEmpty()?this.m_bars.last():this.m_nsBars.last()},t.prototype.search=function(t,e){return this.nsBars().isEmpty()?this.bars().search(t,e):this.bars().isEmpty()?this.nsBars().search(t,e):o.ensureNotNull(this.nsBars().firstIndex())<=t?this.nsBars().search(t,e):this.bars().search(t,e)},t.prototype.valueAt=function(t){var e=this.search(t);return null!==e?e.value:null},t.prototype.plotValueToTimePointIndex=function(t,e,i){var o,n,s,a;if(i===r.FromRight)return o=function(i,o){var n=o[e];return void 0!==n&&null!==n&&t>=n},null!==(n=this.m_bars.findLast(o))?n.index:(s=this.m_nsBars.findLast(o),
null!==s?s.index:this.m_bars.firstIndex());if(i===r.FromLeft)return a=function(i,o){var n=o[e];return void 0!==n&&null!==n&&t<=n},null!==(n=this.m_bars.findFirst(a))?n.index:(s=this.m_nsBars.findFirst(a),null!==s?s.index:this.m_bars.lastIndex());throw Error("plotValueToTimePointIndex: unsupported search mode")},t}(),e.SeriesData=s},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(15),n=function(){function t(t){void 0===t&&(t=1),this._precision=t}return t.prototype.format=function(t){var e,i;return o.isNumber(t)||(t=parseFloat(t)),e=t.toFixed(this._precision),i=Math.pow(10,-this._precision),Math.max(parseFloat(e),i)+""},t}(),e.LimitedPrecisionNumericFormatter=n},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-80 -25 140 140" width="16" height="16"><path d="M10 12L-.7.7-41 43.2l.1.1-.1.1L-.7 85.9l10-10.6-29.7-31.2z"/></svg>'},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=i(17),i(13),r=function(){function t(t){var e=this;this._alive=new n,this._body=new n,this._width=new n,this._height=new n,this._fullscreen=new n,this._detachable=new n,this._visible=new n,this._availWidth=new n,this._availHeight=new n,this._owner=new n,this._ownersStack=[],this.owner=this._owner.readonly(),this._bridge={alive:this._alive.readonly(),body:this._body.readonly(),width:this._width.readonly(),height:this._height.readonly(),fullscreen:this._fullscreen.readonly(),detachable:this._detachable.readonly(),visible:this._visible.readonly(),availWidth:this._availWidth.readonly(),availHeight:this._availHeight.readonly(),remove:function(){var t=e._owner.value();t&&t.remove&&t.remove()},negotiateWidth:function(t){var i=e._owner.value();i&&i.negotiateWidth&&i.negotiateWidth(t)},negotiateHeight:function(t){var i=e._owner.value();i&&i.negotiateHeight&&i.negotiateHeight(t)},requestFullscreen:function(){var t=e._owner.value();t&&t.requestFullscreen&&t.requestFullscreen()},exitFullscreen:function(){var t=e._owner.value();t&&t.exitFullscreen&&t.exitFullscreen()},detach:function(t){var i=e._owner.value();i&&i.detach&&i.detach(t)},attach:function(){var t=e._owner.value();t&&t.attach&&t.attach()}},t&&this.pushOwner(t)}return t.prototype.bridge=function(){return this._bridge},t.prototype.pushOwner=function(t){var e,i,o,n;if(t.alive.value()){for(e=0,i=this._ownersStack;e<i.length;e++)o=i[e],this._unsubscribeOwner(o);n={owner:t},this._ownersStack.push(n),this._subscribeOwner(n)}},t.prototype._subscribeOwner=function(t){var e,i,o=this,n=t.owner;t.deathWatcher||(this._alive.setValue(!0),t.deathWatcher=n.alive.spawn(),t.deathWatcher.subscribe(function(e){e||o._deadHandler(t)})),t.subscriptions||(e=t.subscriptions=[],this._visible.setValue(!1),i=function(t,i){if(t){var o=t.spawn();e.push(o),o.subscribe(function(t){i.setValue(t)},{callWithLast:!0})}else i.deleteValue()},i(n.body,this._body),i(n.width,this._width),i(n.height,this._height),i(n.fullscreen,this._fullscreen),i(n.detachable,this._detachable),i(n.availWidth,this._availWidth),
i(n.availHeight,this._availHeight),i(n.visible,this._visible)),this._owner.setValue(n)},t.prototype._unsubscribeOwner=function(t,e){var i,o,n;if(t.subscriptions){for(i=0,o=t.subscriptions;i<o.length;i++)n=o[i],n.unsubscribe();t.subscriptions=null}e&&t.deathWatcher&&(t.deathWatcher.unsubscribe(),t.deathWatcher=null)},t.prototype._deadHandler=function(t){var e,i=this._ownersStack.indexOf(t);for(o.assert(-1!==i,"sanitized owner should be in stack"),e=this._ownersStack.length-1;e>=i;e--)this._unsubscribeOwner(this._ownersStack[e],!0);this._ownersStack.length=i,i>0?this._subscribeOwner(this._ownersStack[i-1]):(this._alive.setValue(!1),this._owner.deleteValue())},t}(),e.ResizerDetacherState=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.layouts={s:{title:"1 chart",count:1,sizer:function(t,e,i,o){return{width:e.width-o-o,height:e.height-o-o,top:o,left:o}}}}},function(t,e,i){"use strict";function o(){this.backColorers=[]}function n(t){o.call(this),this._series=t}function r(t,e){o.call(this),this._study=t,this._plotIndex=e}var s=i(19).PlotRowSearchMode;o.prototype.barStyle=function(t,e,i){var o,n={};for(o=this.backColorers.length-1;o>=0;o--)this.backColorers[o].applyBarStyle(t,e,n,i);return this.applyBarStyle(t,e,n,i),n},o.prototype.pushBackBarColorer=function(t){this.backColorers.push(t)},o.prototype.applyBarStyle=function(t,e,i){throw Error("This function is supposed to be reimplemented in a subclass")},inherit(n,o),n.prototype.applyBarStyle=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;switch(i||(i={}),i.barColor=null,i.barBorderColor=null,i.barWickColor=null,i.isBarHollow=null,i.isBarUp=null,i.upColor=null,i.downColor=null,i.isTwoColorBar=null,n=this._series.properties(),n.style.value()){case TradingView.Series.STYLE_LINE:i.barColor=n.lineStyle.color.value();break;case TradingView.Series.STYLE_AREA:i.barColor=n.areaStyle.linecolor.value();break;case TradingView.Series.STYLE_BARS:r=n.barStyle.upColor.value(),s=n.barStyle.downColor.value(),a=r,l=s,c=this.findBar(t,!1,o),n.barStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,!1,o),i.barColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l):(i.barColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?r:s,i.barBorderColor=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?a:l);break;case TradingView.Series.STYLE_CANDLES:r=n.candleStyle.upColor.value(),s=n.candleStyle.downColor.value(),a=n.candleStyle.borderUpColor?n.candleStyle.borderUpColor.value():n.candleStyle.borderColor.value(),l=n.candleStyle.borderDownColor?n.candleStyle.borderDownColor.value():n.candleStyle.borderColor.value(),u=n.candleStyle.wickUpColor?n.candleStyle.wickUpColor.value():n.candleStyle.wickColor.value(),d=n.candleStyle.wickDownColor?n.candleStyle.wickDownColor.value():n.candleStyle.wickColor.value(),c=this.findBar(t,!1,o),n.candleStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,!1,o),
p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_HOLLOW_CANDLES:r=n.hollowCandleStyle.upColor.value(),s=n.hollowCandleStyle.downColor.value(),a=n.hollowCandleStyle.borderUpColor?n.hollowCandleStyle.borderUpColor.value():n.hollowCandleStyle.borderColor.value(),l=n.hollowCandleStyle.borderDownColor?n.hollowCandleStyle.borderDownColor.value():n.hollowCandleStyle.borderColor.value(),u=n.hollowCandleStyle.wickUpColor?n.hollowCandleStyle.wickUpColor.value():n.hollowCandleStyle.wickColor.value(),d=n.hollowCandleStyle.wickDownColor?n.hollowCandleStyle.wickDownColor.value():n.hollowCandleStyle.wickColor.value(),c=this.findBar(t,!1,o),h=this.findPrevBar(t,!1,o),h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]?(i.barColor=r,i.barBorderColor=a,i.barWickColor=u):(i.barColor=s,i.barBorderColor=l,i.barWickColor=d),c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?i.isBarHollow=!0:i.isBarHollow=!1;break;case TradingView.Series.STYLE_HEIKEN_ASHI:r=n.haStyle.upColor.value(),s=n.haStyle.downColor.value(),a=n.haStyle.borderUpColor.value(),l=n.haStyle.borderDownColor.value(),u=n.haStyle.wickUpColor.value(),d=n.haStyle.wickDownColor.value(),c=this.findBar(t,e,o),n.haStyle.barColorsOnPrevClose.value()?(h=this.findPrevBar(t,e,o),p=h[TradingView.CLOSE_PLOT]<=c[TradingView.CLOSE_PLOT]):p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d;break;case TradingView.Series.STYLE_RENKO:c=this.findBar(t,e,o),p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],r=e?n.renkoStyle.upColorProjection.value():n.renkoStyle.upColor.value(),s=e?n.renkoStyle.downColorProjection.value():n.renkoStyle.downColor.value(),a=e?n.renkoStyle.borderUpColorProjection.value():n.renkoStyle.borderUpColor.value(),l=e?n.renkoStyle.borderDownColorProjection.value():n.renkoStyle.borderDownColor.value(),u=n.renkoStyle.wickUpColor.value(),d=n.renkoStyle.wickDownColor.value(),i.barColor=p?r:s,i.barBorderColor=p?a:l,i.barWickColor=p?u:d,i.isBarUp=p;break;case TradingView.Series.STYLE_PB:c=this.findBar(t,e,o),p=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],r=e?n.pbStyle.upColorProjection.value():n.pbStyle.upColor.value(),s=e?n.pbStyle.downColorProjection.value():n.pbStyle.downColor.value(),a=e?n.pbStyle.borderUpColorProjection.value():n.pbStyle.borderUpColor.value(),l=e?n.pbStyle.borderDownColorProjection.value():n.pbStyle.borderDownColor.value(),i.barColor=p?r:s,i.barBorderColor=p?a:l,i.isBarUp=p;break;case TradingView.Series.STYLE_KAGI:i.upColor=e?n.kagiStyle.upColorProjection.value():n.kagiStyle.upColor.value(),i.downColor=e?n.kagiStyle.downColorProjection.value():n.kagiStyle.downColor.value(),_=null,c=this.findBar(t,e,o),c[TradingView.LOW_PLOT]<c[TradingView.ADT_PLOT]&&c[TradingView.ADT_PLOT]<c[TradingView.HIGH_PLOT]?(_=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT],
i.isTwoColorBar=!0):(_=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?c[TradingView.OPEN_PLOT]===c[TradingView.ADT_PLOT]:c[TradingView.OPEN_PLOT]!==c[TradingView.ADT_PLOT],i.isTwoColorBar=!1),i.barColor=_?i.upColor:i.downColor,i.isBarUp=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT];break;case TradingView.Series.STYLE_PNF:c=this.findBar(t,e,o),p=c[TradingView.ADT_PLOT]>0,r=e?n.pnfStyle.upColorProjection.value():n.pnfStyle.upColor.value(),s=e?n.pnfStyle.downColorProjection.value():n.pnfStyle.downColor.value(),i.isBarUp=p,i.barColor=p?r:s;break;case TradingView.Series.STYLE_BASELINE:c=this.findBar(t,e,o),f=n.baselineStyle,m=this._series.priceScale(),g=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),v=m.coordinateToPrice(g),c[TradingView.CLOSE_PLOT]>v?i.barColor=n.baselineStyle.topLineColor.value():i.barColor=n.baselineStyle.bottomLineColor.value()}return i},n.prototype.getSeriesBars=function(t){return t?this._series.nsBars():this._series.bars()},n.prototype._findBarFieldValue=function(t,e,i){var o=this.getSeriesBars(i).valueAt(t);if(null!==o)return o[e]},n.prototype.findBar=function(t,e,i){return i?i.value:this.getSeriesBars(e).valueAt(t)||[]},n.prototype.findPrevBar=function(t,e,i){var o,n;return i&&i.previousValue?i.previousValue:(o=this._series.bars(),n=o._search(t,s.Exact),null!==n&&n>0?this._series.bars()._valueAt(n-1):[])},inherit(r,o),r.prototype.applyBarStyle=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_,f;return i||(i={}),e?i:(o=this._study.properties(),o.visible.value()?(n=this._study.metaInfo(),(r=this._study.data())&&0!==r.size()?(s=n.plots[this._plotIndex],this._study.getMinFirstBarIndexForPlot(s.id)>t?i:(a=o.styles[s.id],a.visible&&!a.visible.value()?i:(l=this._study.offset(s.id),null===(c=r.valueAt(t-l))?i:null==(h=c[this._plotIndex+1])?i:(h=Math.round(h),u=n.plots[this._plotIndex].palette,d=o.palettes,p=d[u],_=n.palettes[u].valToIndex?n.palettes[u].valToIndex[h]:h,f=p.colors[_].color.value(),i.barColor=f,i.upColor=f.color,i.downColor=f.color,i)))):i):i)},e.SeriesBarColorer=n,e.StudyBarColorer=r},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.colorUp=t.colorup,this.colorDn=t.colordown,this.colorBorderUp=t.colorBorderUp,this.colorBorderDown=t.colorBorderDown,this.width=this._calculateWidth(t.barSpacing),this.minHeight=t.minHeight,this.vertOffset=this._calculateVerticalOffset(t.barSpacing)}function n(t,e,i,o){this.x=t,this.y=e,this.height=i,this.isUp=o}var r=i(8).Point,s=i(11);o.prototype._calculateVerticalOffset=function(t){return Math.round((t||0)/4)},o.prototype._calculateMinHeight=function(t){return this.width||this._calculateWidth(t)},o.prototype._calculateWidth=function(t){var t=t||this.barSpacing;return Math.round(t/2)},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l=this.width,c=l<4,h=Math.max(parseInt(l/2),1),u=Math.round(this.width/2),d=Math.round(this.width);for(t.translate(1,1),e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.isUp?-1:1,r=Math.abs(o.height),s=o.y-n*this.vertOffset,t.beginPath(),
t.translate(o.x,s),c?(t.moveTo(0,0),t.lineTo(-u,-u*n),t.moveTo(0,0),t.lineTo(u,-u*n),t.moveTo(0,0),t.lineTo(0,-r*n),t.moveTo(-u,-r*n),t.lineTo(u,-r*n),t.lineWidth=h,t.strokeStyle=o.isUp?this.colorUp:this.colorDn,t.stroke()):(t.moveTo(0,0),r<d?(t.lineTo(l,-r*n),t.lineTo(-l,-r*n)):(t.lineTo(l,-d*n),t.lineTo(u,-d*n),t.lineTo(u,-r*n),t.lineTo(-u,-r*n),t.lineTo(-u,-d*n),t.lineTo(-l,-d*n)),t.lineTo(0,0),a=o.isUp?this.colorBorderUp:this.colorBorderDown,t.strokeStyle=a,t.stroke(),t.fillStyle=o.isUp?this.colorUp:this.colorDn,t.fill()),t.translate(-o.x,-s);t.translate(-1,-1)},o.prototype.hitTest=function(t){var e,i,o,n,r,a,l,c,h,u=Math.round(this.width/2),d=Math.round(this.width);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&void 0!==i.x&&null!==i.x&&!TradingView.isNaN(i.x)&&void 0!==i.y&&null!==i.y&&!TradingView.isNaN(i.y)&&(o=Math.abs(i.height),n=i.isUp?-1:1,r=o+d,a=i.y-n*this.vertOffset,l=a-n*r,c=i.x-u,h=i.x+u,c<t.x&&t.x<h&&(i.isUp?a<t.y&&t.y<l:l<t.y&&t.y<a)))return new s(s.REGULAR);return null},inherit(n,r),e.PaneRendererArrowsUpDown=TradingView.PaneRendererArrowsUpDown=o,e.PaneRendererArrowsUpDownItem=TradingView.PaneRendererArrowsUpDownItem=n},function(t,e,i){"use strict";function o(t){this._graphics=o.emptyGraphics(),n(!!t,"Study metaInfo is absent!"),this._metaInfo=t}var n=i(9).assert,r=i(7).getLogger("Chart.StudyGraphics");o.emptyGraphics=function(){return{indexes:[]}},o.prototype.isEmpty=function(){var t=Object.keys(this._graphics).length>1;return 0===this._graphics.indexes.length&&!t},o.prototype.graphics=function(){return this._graphics},o.prototype.setGraphics=function(t){this._graphics=t,this._postProcessGraphicsData()},o.prototype.process=function(t){if(""!==t.d)return t.d.indexes_replace?void this.replaceIndexes(t):void(t.d.graphicsCmds&&(this.processEraseCmds(t.d.graphicsCmds.erase),this.processCreateCmds(t.d.graphicsCmds.create,t.indexes)))},o.prototype.replaceIndexes=function(t){""!==t.d&&(n(!!t.d.indexes_replace),this._graphics.indexes=t.indexes)},o.prototype.processEraseCmds=function(t){var e,i,r,s,a;if(t)for(n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!"),e=0;e<t.length;++e)if(i=t[e],"all"===i.action)this._graphics=o.emptyGraphics();else{if("one"!==i.action)throw Error("Unknown graphics command "+i.action);for(r in this._graphics[i.type])s=this._graphics[i.type][r],(a=o._findGraphicsObjIndexById(s.data,i.id))>=0&&s.data.splice(a,1)}},o._findGraphicsObjIndexById=function(t,e){for(var i=0;i<t.length;++i)if(t[i].id===e)return i;return-1},o.prototype.processCreateCmds=function(t,e){var i,o,r,s,a,l;if(t){n(!!e,"indexes are missing in the study nonseries response!"),n(!!this._graphics,"_graphics object doesn't exist in the study!"),n(!!this._graphics.indexes,"_graphics.indexes array doesn't exist in the study!");for(i in t){n(i in this._metaInfo.graphics,"There is a '"+i+"' in study response, but it doesn't present in metaInfo!");for(o=0;o<t[i].length;++o){r=t[i][o],s=r.styleId,
n(s in this._metaInfo.graphics[i]),this._graphics[i]||(this._graphics[i]=[]),a=null;for(l=0;l<this._graphics[i].length;++l)if(this._graphics[i][l].styleId===s){a=this._graphics[i][l];break}null===a&&(a={styleId:s,data:[]},this._graphics[i].push(a)),a.data=a.data.concat(r.data)}}"nochange"===e||(n(Array.isArray(e)),this._graphics.indexes=e),this._postProcessGraphicsData()}},o.prototype._postProcessGraphicsData=function(){this._graphics&&this._splitHHistItems()},o.prototype._splitHHistItems=function(){var t,e,i,n,r,s,a,l,c,h,u,d;if(void 0!==this._graphics.hhists){for(t in this._graphics.hhists)e=this._graphics.hhists[t],o._sortHHistItemsByPrice(e.data),i=this._graphics.indexes,e.dataObj=o._splitHHistItemsBySession(e.data,i);if(n=this._graphics.hhists[0],r=this._graphics.hhists[1],n&&r&&n.dataObj&&r.dataObj)for(s in n.dataObj)if(a=n.dataObj[s],l=r.dataObj[s],a&&l){for(c=l[0],h=l[l.length-1],u=0;u<a.length;u++)d=a[u],(d.priceHigh>=c.priceHigh||d.priceLow>=c.priceLow)&&(d.priceHigh<=h.priceHigh||d.priceLow<=h.priceLow)&&(d.va=!0);n.shortDataObj||(n.shortDataObj={}),n.shortDataObj[s]=a.slice()}}},o._sortHHistItemsByPrice=function(t){t.sort(function(t,e){return t.priceLow-e.priceLow})},o._splitHHistItemsBySession=function(t,e){var i,o,n,s={};for(i=0;i<t.length;++i)o=t[i],n=e[o.firstBarTime],void 0!==n?(n in s||(s[n]=[]),s[n].push(o)):r.logError("Cannot find index "+o.firstBarTime+" in study timescale indexes");return s},t.exports=o},function(t,e,i){"use strict";function o(){}var n=i(9).assert,r=i(57),s=i(870);o.isValid=function(t){return!(!r[t]&&!s[t])},o.create=function(t,e,i,a,l){var c;return n(o.isValid(t),"Unknown line tool: "+t),c=r[t]||s[t],"LineToolVbPFixed"===t?new c(e,i,a,l):"LineToolRegressionTrend"===t?new c(e,i,a):["LineStudyMtpAnalysis","LineStudyMtpDecisionPoint","LineStudyMtpRiskReward","LineStudyMtpElliotWaveMain","LineStudyMtpElliotWaveMajor","LineStudyMtpElliotWaveMinor","LineStudyMtpDownWave1OrA","LineStudyMtpDownWave2OrB","LineStudyMtpDownWave3","LineStudyMtpDownWave4","LineStudyMtpDownWave5","LineStudyMtpDownWaveC","LineStudyMtpUpWave1OrA","LineStudyMtpUpWave2OrB","LineStudyMtpUpWave3","LineStudyMtpUpWave4","LineStudyMtpUpWave5","LineStudyMtpUpWaveC"].indexOf(t)>=0?new c(e,i,a):new c(e,i)},t.exports=o},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(67),s=i(15),a=function(t){function e(e,i){var o=t.call(this)||this;return o._activeBackground="#0F6DBF",o._background="#5592C9",o._active=!1,o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype.setActive=function(t){this._active=t},e.prototype.setBackground=function(t){this._background=t},e.prototype._updateRendererData=function(t){var e,i,o,r,a,l,c,h;if(t.visible=!1,e=this._source.model(),e.timeScale()&&!e.timeScale().isEmpty()&&null!==(i=this._source.priceScale())&&!i.isEmpty()&&(e.selectedSource()===this._source||this._source.isForcedDrawPriceAxisLabel())&&null!==e.timeScale().visibleBars()&&(o=this._source.axisPoints(),r=this._data.pointIndex,!(o.length<=r)&&(a=o[r],
isFinite(a.price)))){if(i.isPercent()){if(!(l=this._source.ownerSource()))return;if(c=l.firstValue(),!s.isNumber(c))return;a.price=n.ensureNotNull(i.priceRange()).convertToPercent(a.price,c)}h=this._active?this._activeBackground:this._background,this._data.backgroundProperty&&(h=this._data.backgroundProperty.value()),t.background=h,t.borderColor="#2E84A6",t.color=this.generateTextColor(h),t.coordinate=i.priceToCoordinate(a.price),t.text=i.formatter().format(a.price),t.visible=!0}},e}(r.PriceAxisView),e.LineToolPriceAxisView=a},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(32),n=function(){function t(){this._text="",this._background="#585858",this._coordinate=0}return t.prototype.text=function(){return this._text},t.prototype.background=function(){return this._background},t.prototype.color=function(){return"black"===o.rgbToBlackWhiteString(o.parseRgb(this._background),150)?"white":"black"},t.prototype.coordinate=function(){return this._coordinate},t}(),e.TimeAxisView=n},function(t,e,i){"use strict";function o(){this._data=null}var n=/[1-9]/g;o.prototype.setData=function(t){this._data=t},o.prototype.draw=function(t,e){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;null!=this._data&&!1!==this._data.visible&&0!==this._data.text.length&&(t.font=e.font,(i=Math.round(e.widthCache.measureText(t,this._data.text,n)))<=0||(o=e.paddingHorizontal,r=i+2*o,s=r/2,a=this._data.width,l=this._data.coordinate,c=Math.floor(l-s)+.5,c<0?(l+=Math.abs(0-c),c=Math.floor(l-s)+.5):c+r>a&&(l-=Math.abs(a-(c+r)),c=Math.floor(l-s)+.5),h=c,u=h+r,d=u,p=Math.round(this._data.coordinate+1),_=p,f=.5,m=f+e.borderSize+e.tickLength+e.paddingTop+e.fontSize+e.paddingBottom,g=m,v=f,y=v,b=y+e.borderSize+e.tickLength,S=m-e.baselineOffset-e.paddingBottom,t.fillStyle=this._data.background,t.lineWidth=1,t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(c,f),t.lineTo(h,m),t.lineTo(u,g),t.lineTo(d,v),t.fill(),t.beginPath(),t.moveTo(p,y),t.lineTo(_,b),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,c+o,S)))},t.exports=o},function(t,e,i){"use strict";function o(t,e){this.customization={forcePriceAxisLabel:!0,disableSelection:!0,disableErasing:!0},n.call(this,t,e)}var n=i(1).LineDataSource;inherit(o,n),o.POINTS_COUNT=1,o.prototype.pointsCount=function(){return o.POINTS_COUNT},o.prototype.hasContextMenu=function(){return!1},o.prototype.state=function(){return null},o.prototype.startMoving=function(){n.prototype.startMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.endMoving=function(){n.prototype.endMoving.apply(this,arguments),this._cursorMoved=!1},o.prototype.correctPoints=function(t){var e,i,o,n,r;for(this._currentMovingPoint&&this._startMovingPoint?this._currentMovingPoint.price-this._startMovingPoint.price&&(this._cursorMoved=!0):this._cursorMoved=!1,e=this.priceScale(),i=e.mainSource().base(),o=1/i,n=0;n<t.length;n++)r=t[n],this._cursorMoved&&(r.price=this._currentMovingPoint.price),r.price=o*Math.round(r.price/o),t[n]=r},o.prototype.userEditEnabled=function(){return!0},
o.prototype.canBeHidden=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.showInObjectTree=function(){return!1},o.prototype.getInputsPropertyPage=function(){return null},t.exports=o},function(t,e,i){"use strict";(function(t){function o(e,n){var r,s,c,d,p,_,f,m,g,v,y=n||new h("linetoolriskreward");a.call(this,e,y),this._properties.addExclusion&&(this._properties.addExclusion("stopLevel"),this._properties.addExclusion("profitLevel")),n.stopLevel||n.profitLevel||(r=e.timeScale().visibleBars(),s=r.firstBar(),c=r.lastBar(),d=e.mainSeries().priceRange(s,c),p=e.mainSeries().priceScale(),p.isLog()&&(_=p.logicalToPrice(d.minValue()),f=p.logicalToPrice(d.maxValue()),d=new t(_,f)),p.isPercent()&&(m=e.mainSeries().firstValue(),_=p.priceRange().convertFromPercent(d.minValue(),m),f=p.priceRange().convertFromPercent(d.maxValue(),m),d=new t(_,f)),d&&!d.isEmpty()&&(g=Math.round(.2*d.length()*e.mainSeries().base()),y.merge({stopLevel:g,profitLevel:g}))),v=this,y.stopLevel.listeners().subscribe(this,this.recalculate),y.stopLevel.listeners().subscribe(null,function(){v.properties().stopPrice._listeners.fire(v.properties().stopPrice)}),y.profitLevel.listeners().subscribe(this,this.recalculate),y.profitLevel.listeners().subscribe(null,function(){v.properties().targetPrice._listeners.fire(v.properties().targetPrice)}),y.addChild("entryPrice",new o.PriceProperty(this,0)),y.addChild("stopPrice",new o.StopPriceProperty(this)),y.addChild("targetPrice",new o.TargetPriceProperty(this)),y.addProperty("riskSize",250),y.addProperty("qty",0),y.addProperty("amountTarget",y.accountSize.value()),y.addProperty("amountStop",y.accountSize.value()),this._riskInPercentsFormatter=new u(2),this._riskInMoneyFormatter=new u,y.risk.subscribe(this,this._recalculateRiskSize),y.accountSize.subscribe(this,this._recalculateRiskSize),y.riskDisplayMode.subscribe(this,this._recalculateRisk),y.riskDisplayMode.subscribe(this,this._recalculateRiskSize),y.entryPrice.subscribe(this,this._recalculateRiskSize),y.stopPrice.subscribe(this,this._recalculateRiskSize),y.profitLevel.subscribe(this,this._recalculateRiskSize),y.stopLevel.subscribe(this,this._recalculateRiskSize),y.qty.subscribe(this,this._recalculateRiskSize),"percents"===y.riskDisplayMode.value()&&y.risk.value()>100&&y.riskDisplayMode.setValueSilently("money"),this._syncStateExclusions=["entryPrice","stopPrice","targetPrice","riskSize","qty","amountTarget","amountStop","risk","accountSize"],this.version=o.version,this._entryPriceAxisView=new l(this,{colorProperty:y.linecolor,priceProperty:y.entryPrice}),this._stopPriceAxisView=new l(this,{colorProperty:y.stopBackground,priceProperty:y.stopPrice}),this._profitPriceAxisView=new l(this,{colorProperty:y.profitBackground,priceProperty:y.targetPrice}),i.e(1).then(function(t){var e=i(1170).RiskRewardPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function n(t,e){var i,n;this._constructor="LineToolRiskRewardShort",i=e||new h("linetoolriskrewardshort"),o.call(this,t,i),n=this.properties(),
n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}function r(t,e){var i,n;this._constructor="LineToolRiskRewardLong",i=e||new h("linetoolriskrewardlong"),o.call(this,t,i),n=this.properties(),n.entryPrice.subscribe(this,this._recalculateQty),n.stopPrice.subscribe(this,this._recalculateQty),n.riskSize.subscribe(this,this._recalculateQty),n.entryPrice.subscribe(this,this._recalculateAmount),n.profitLevel.subscribe(this,this._recalculateAmount),n.stopLevel.subscribe(this,this._recalculateAmount),n.accountSize.subscribe(this,this._recalculateAmount),n.riskSize.subscribe(this,this._recalculateAmount),n.qty.subscribe(this,this._recalculateAmount)}var s=i(9).ensureNotNull,a=i(1).LineDataSource,l=i(843).LineToolRiskRewardPriceAxisView,c=i(26),h=i(6).DefaultProperty,u=i(89).NumericFormatter,d=i(3).propertyPages,p=i(408).RiskRewardPointIndex;inherit(o,a),o.prototype.riskFormatter=function(t){return"percents"===t?this._riskInPercentsFormatter:this._riskInMoneyFormatter},o.prototype.getRiskStep=function(t){return"percents"===t?.01:1},o.prototype._roundValue=function(t){return parseFloat(t.toFixed(2))},o.prototype._recalculateRisk=function(){var t=this.properties(),e=t.riskDisplayMode.value(),i=t.riskSize.value(),o=t.accountSize.value(),n=t.risk.value();n="percents"===e?this._roundValue(i/o*100):this._roundValue(o/100*n),this._riskInChange=!0,t.risk.setValue(this.riskFormatter(e).format(n)),this._riskInChange=!1},o.prototype._recalculateRiskSize=function(){var t,e,i,o;this._riskInChange||(t=this.properties(),e=t.risk.value(),i=t.riskDisplayMode.value(),o=t.accountSize.value(),"percents"===i?t.riskSize.setValue(e/100*o):e>o?(t.risk.setValue(o),t.riskSize.setValue(o)):t.riskSize.setValue(e))},o.version=2,o.prototype.i18nCache={title:$.t("Risk/Reward")},o.prototype.lastBarData=function(){var t,e,i,o,n,r=this._model.mainSeries().bars().firstIndex(),a=this._model.mainSeries().bars().lastIndex();return null===r||null===a||isNaN(r)||isNaN(a)?null:(t=this.points(),4===t.length?(e=t[p.ActualClose],e.index<r?null:{closePrice:e.price,index:Math.min(a,e.index)}):(i=t[p.Close],i.index<r?null:(o=Math.min(a,i.index),n=s(this._model.mainSeries().bars().valueAt(o)),{closePrice:n[TradingView.CLOSE_PLOT],index:o})))},o.prototype.migrateVersion=function(t,e,i){var o,n,r,s;1===t&&this._points.length>=1&&(o=[],o.push(this._points[0]),n=this._points[0],n={price:n.price,index:n.index+50},o.push(n),this._points[1]&&o.push(this._points[1]),this._points[2]&&o.push(this._points[2]),this._points=o,this._timePoint.length>=1&&(r=[],n=this._timePoint[0],r.push(n),s={price:n.price,time_t:n.time_t,offset:n.offset+50},r.push(s),
this._timePoint[1]&&o.push(this._points[1]),this._timePoint[2]&&o.push(this._points[2]),this._timePoint=r))},o.prototype.checkAlert=function(){this.recalculate()},o.prototype.priceAxisViews=function(t,e){return this.isSourceHidden()?null:e!==this.priceScale()||this._model.paneForSource(this)!==t?null:[this._entryPriceAxisView,this._stopPriceAxisView,this._profitPriceAxisView]},o.prototype.updateAllViews=function(){this.isActualSymbol()&&this._properties.visible.value()&&(c.hideAllDrawings().value()&&this.userEditEnabled()||(a.prototype.updateAllViews.call(this),this._entryPriceAxisView.update(),this._stopPriceAxisView.update(),this._profitPriceAxisView.update()))},o.prototype.setPoint=function(t,e){var i,o=this.priceScale();switch(o.isPercent()&&(i=this.ownerSource().firstValue(),e.price=o.priceRange().convertFromPercent(e.price,i)),t){case 0:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),a.prototype.setPoint.call(this,t,e),this.recalculate();break;case 1:this.isActualSymbol()&&this.properties().stopPrice.setValue(this.preparseStopPrice(e.price));break;case 2:this.isActualSymbol()&&this.properties().targetPrice.setValue(this.preparseProfitPrice(e.price));break;case 3:e.price=this._roundPrice(e.price),o.isPercent()&&(e.price=o.priceRange().convertToPercent(e.price,i)),a.prototype.setPoint.call(this,1,e),this.recalculate()}},o.PriceProperty=function(t,e){a.PointPriceProperty.call(this,t,e)},inherit(o.PriceProperty,a.PointPriceProperty),o.PriceProperty.prototype.setValue=function(t){var e=this._lineSource.points()[this._pointIndex];e.price=parseFloat(t),this._lineSource.setPoint(this._pointIndex,e),this._lineSource.recalculate(),this._lineSource._model.updateSource(this._lineSource),this._listeners.fire(this),this._lineSource.endChanging(),this._lineSource._syncMultichartState()},o.StopPriceProperty=function(t){o.PriceProperty.call(this,t,1)},inherit(o.StopPriceProperty,o.PriceProperty),o.StopPriceProperty.prototype.value=function(){var t=this._lineSource.stopPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},o.StopPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().stopLevel.setValue(e),this._lineSource.properties().stopLevel.listeners().fire(this._lineSource.properties().stopLevel)},o.TargetPriceProperty=function(t){o.PriceProperty.call(this,t,2)},inherit(o.TargetPriceProperty,o.PriceProperty),o.TargetPriceProperty.prototype.value=function(){var t=this._lineSource.profitPrice(),e=this._lineSource.ownerSource().formatter(),i=e.parse(e.format(t));return i.price?i.price:i.value},o.TargetPriceProperty.prototype.setValue=function(t){var e=Math.round(Math.abs(t-this._lineSource.entryPrice())*this._lineSource._model.mainSeries().base());this._lineSource.properties().profitLevel.setValue(e),this._lineSource.properties().profitLevel.listeners().fire(this._lineSource.properties().profitLevel)
},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return this.i18nCache.title},o.prototype.addPoint=function(t){var e,i;return t.price=this._roundPrice(t.price),a.prototype.addPoint.call(this,t,null,!0),e={price:t.price,index:t.index+50},a.prototype._addPointIntenal.call(this,e,null,!0),i=this.calculateActualEntry(t,e),i&&(a.prototype._addPointIntenal.call(this,i,null,!0),(e=this.findClosePoint(i,e))&&a.prototype._addPointIntenal.call(this,e,null,!0)),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},o.prototype._roundPrice=function(t){var e=this._model.mainSeries().base();return Math.round(t*e)/e},o.prototype.recalculate=function(){var t,e,i,o,n;this.properties().interval.value()===this._model.mainSeries().interval()&&0!==this.points().length&&(t=this.properties().targetPrice.value(),e=this.properties().stopPrice.value(),i=[this._points[0],this._points[1]],o=this.calculateActualEntry(this.points()[0],this.points()[1]),o&&(i.push(o),(n=this.findClosePoint(o,this.points()[1]))&&i.push(n)),this._points=i,t!==this.properties().targetPrice.value()&&this.properties().targetPrice._listeners.fire(this.properties().targetPrice),e!==this.properties().stopPrice.value()&&this.properties().stopPrice._listeners.fire(this.properties().stopPrice))},o.prototype.start=function(){a.prototype.start.call(this),this.recalculate()},o.prototype.startMoving=function(t){t.price=this._roundPrice(t.price),a.prototype.startMoving.call(this,t)},o.prototype.move=function(t){t.price=this._roundPrice(t.price),a.prototype.move.call(this,t),this.recalculate(),this._entryPriceAxisView.update()},o.prototype.correctPoints=function(t){return!!this.isActualSymbol()&&a.prototype.correctPoints.call(this,[t[0],t[1]])},o.prototype.entryPrice=function(){return this.points()[0].price},o.prototype.findClosePoint=function(t,e){var i,o,n,r=this._model.mainSeries().bars(),a=s(r.firstIndex()),l=Math.max(t.index,a),c=s(r.lastIndex());for(i=l;i<=Math.min(c,e.index);i++)if(o=s(r.valueAt(i)),null!=(n=this.checkStopPrice(o)))return{index:i,price:n};return null},o.prototype.calculateActualEntry=function(t,e){var i,o,n=this._model.mainSeries().bars(),r=s(n.firstIndex()),a=Math.max(t.index,r),l=t.price,c=s(n.lastIndex());for(i=a;i<=Math.min(c,e.index);i++)if(o=s(n.valueAt(i)),o[TradingView.HIGH_PLOT]>=l&&o[TradingView.LOW_PLOT]<=l)return{index:i,price:l};return null},o.prototype.axisPoints=function(){var t,e,i;if(!this._points[p.ActualEntry])return[];if(t=this._points[p.ActualEntry],e=null,4===this._points.length)e=this._points[p.ActualClose];else{if(!(i=this.lastBarData()))return[];e={index:i.index,price:i.closePrice}}return[t,e]},o.prototype.getInputsPropertyPage=function(){return d.LineToolRiskRewardInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return d.LineToolRiskRewardStylesPropertyPage},inherit(n,o),n.prototype.i18nCache={title:$.t("Risk/Reward short")},n.prototype._recalculateQty=function(){var t,e,i,o,n;0!==this.points().length&&(t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),
o=t.riskSize.value(),n=Math.floor(o/Math.abs(i-e)),t.qty.setValue(n))},n.prototype._recalculateAmount=function(){var t,e,i,o,n,r,s,a;0!==this.points().length&&(t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),r=t.targetPrice.value(),s=this._roundValue(e+(i-r)*o),a=this._roundValue(e-(n-i)*o),t.amountTarget.setValue(s),t.amountStop.setValue(a))},n.prototype.title=function(){return this.i18nCache.title},n.prototype.stopPrice=function(){return this.entryPrice()+this.properties().stopLevel.value()/this._model.mainSeries().base()},n.prototype.profitPrice=function(){return this.entryPrice()-this.properties().profitLevel.value()/this._model.mainSeries().base()},n.prototype.calculatePL=function(t){return this.entryPrice()-t},n.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},n.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},n.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.HIGH_PLOT]>=e?this.stopPrice():t[TradingView.LOW_PLOT]<=i?this.profitPrice():null},r.prototype.i18nCache={title:$.t("Risk/Reward long")},inherit(r,o),r.prototype._recalculateQty=function(){var t,e,i,o,n;0!==this.points().length&&(t=this.properties(),e=t.entryPrice.value(),i=t.stopPrice.value(),o=t.riskSize.value(),n=Math.floor(o/Math.abs(e-i)),t.qty.setValue(n))},r.prototype._recalculateAmount=function(){var t,e,i,o,n,r,s,a;0!==this.points().length&&(t=this.properties(),e=t.accountSize.value(),i=t.entryPrice.value(),o=t.qty.value(),n=t.stopPrice.value(),r=t.targetPrice.value(),s=this._roundValue(e+(r-i)*o),a=this._roundValue(e-(i-n)*o),t.amountTarget.setValue(s),t.amountStop.setValue(a))},r.prototype.stopPrice=function(){return this.entryPrice()-this.properties().stopLevel.value()/this._model.mainSeries().base()},r.prototype.profitPrice=function(){return this.entryPrice()+this.properties().profitLevel.value()/this._model.mainSeries().base()},r.prototype.calculatePL=function(t){return t-this.entryPrice()},r.prototype.preparseStopPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()-1/this._model.mainSeries().base();return Math.min(t,e)},r.prototype.preparseProfitPrice=function(t){t=this._roundPrice(t);var e=this.entryPrice()+1/this._model.mainSeries().base();return Math.max(t,e)},r.prototype.checkStopPrice=function(t){var e=this.stopPrice(),i=this.profitPrice();return t[TradingView.LOW_PLOT]<=e?this.stopPrice():t[TradingView.HIGH_PLOT]>=i?this.profitPrice():null},r.prototype.title=function(){return this.i18nCache.title},e.LineToolRiskReward=o,e.LineToolRiskRewardLong=r,e.LineToolRiskRewardShort=n}).call(e,i(73))},function(t,e,i){"use strict";function o(t,e){this._formatter=t,this._maxSize=e||50,this._actualSize=0,this._cache={},this._usageTick=1,this._oldestTick=1,this._tick2Labels={}}o.prototype.format=function(t){var e,i
;return this._cache[t]?this._cache[t].string:(this._actualSize===this._maxSize&&(e=this._tick2Labels[this._oldestTick],delete this._tick2Labels[this._oldestTick],delete this._cache[e],this._oldestTick++,this._actualSize--),i=this._formatter(t),this._cache[t]={string:i,tick:this._usageTick},this._tick2Labels[this._usageTick]=t,this._actualSize++,this._usageTick++,i)},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){a.call(this,t,e,i)}function n(t,e,i){o.call(this,t,e,i)}function r(t,e,i){o.call(this,t,e,i)}function s(t,e,i){o.call(this,t,e,i)}var a=i(105).LineStudyMtp;inherit(o,a),o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),null===e?null:[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT]])},inherit(n,o),n.prototype._mtpStudyId=function(){return"mtp_ew_main"},inherit(r,o),r.prototype._mtpStudyId=function(){return"mtp_ew_major"},inherit(s,o),s.prototype._mtpStudyId=function(){return"mtp_ew_minor"},e.LineStudyMtpElliotWaveMinor=s,e.LineStudyMtpElliotWaveMajor=r,e.LineStudyMtpElliotWaveMain=n,e.LineStudyMtpElliotWave=o},function(t,e,i){"use strict";(function(e){function o(t,i,n){var r,s;this.m_timeScale=t,r=i.rightAxisProperties.state(),r.autoScale=!0,this.m_rightPriceScale=new c(n.properties().scalesProperties,r),s=i.leftAxisProperties.state(),s.autoScale=!0,this.m_leftPriceScale=new c(n.properties().scalesProperties,s),this.m_dataSources=[],this.m_height=0,this.m_width=0,this.m_mainDataSource=null,this._properties=i,this._model=n,this._tagsChanged=new e,this._leftPriceScaleRatioChanged=new e,this._rightPriceScaleRatioChanged=new e,this._leftPriceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),this._rightPriceScaleRatioChanged.subscribe(this,this._mainSeriesPaneScaleRatioOnChange),this.m_timeScale.barSpacingChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_rightPriceScale.internalHeightChanged().subscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByLeftScaleRatio),this.m_rightPriceScale.priceRangeChanged().subscribe(this,this._recalculateTimeScaleByRightScaleRatio),this.m_leftPriceScale.priceRangeChanged().subscribe(this,this._onLeftPriceScaleSetMinMaxPriceRange),this.m_rightPriceScale.priceRangeChanged().subscribe(this,this._onRightPriceScaleSetMinMaxPriceRange),this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale),this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale),i.topMargin.listeners().subscribe(this,o.prototype._updateMargins),i.bottomMargin.listeners().subscribe(this,o.prototype._updateMargins),this._updateMargins(),this._stretchFactor=o.DEFAULT_STRETCH_FACTOR,this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null,
this._maximized=!1,this._isMainPane=!1}var n=i(334).ExecutionsPositionController,r=i(1).LineDataSource,s=i(73),a=i(46).PriceDataSource,l=i(7).getLogger("Chart.Pane"),c=i(229),h=i(160).scaleRatio,u=i(160).priceRangeByScaleRatio,d=i(160).barSpacingByScaleRatio;o.DEFAULT_STRETCH_FACTOR=1e3,o.PANE_ANIMATION_DURATION=500,o.sortSourcesPreOrdered={"Volume@tv-basicstudies":0,ChartEventsSource:1,"ESD$TV_DIVIDENDS@tv-scripting":2,"ESD$TV_SPLITS@tv-scripting":3,"ESD$TV_EARNINGS@tv-scripting":4,LineToolOrder:5,LineToolPosition:6,LineToolExecution:7},o.prototype.destroy=function(){var t,e;for(this._leftPriceScaleRatioChanged.unsubscribe(this,this._mainSeriesPaneScaleRatioOnChange),this._rightPriceScaleRatioChanged.unsubscribe(this,this._mainSeriesPaneScaleRatioOnChange),this.m_rightPriceScale.priceRangeChanged().unsubscribe(this,this._recalculateTimeScaleByRightScaleRatio),this.m_leftPriceScale.priceRangeChanged().unsubscribe(this,this._recalculateTimeScaleByLeftScaleRatio),this.m_timeScale.barSpacingChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.internalHeightChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_rightPriceScale.internalHeightChanged().unsubscribe(this,this._recalculatePriceScaleByScaleRatio),this.m_leftPriceScale.priceRangeChanged().unsubscribe(this,this._onLeftPriceScaleSetMinMaxPriceRange),this.m_rightPriceScale.priceRangeChanged().unsubscribe(this,this._onRightPriceScaleSetMinMaxPriceRange),this._properties.topMargin.listeners().unsubscribe(this,o.prototype._updateMargins),this._properties.bottomMargin.listeners().unsubscribe(this,o.prototype._updateMargins),t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],e.destroy&&e.destroy()},o.prototype.setPaneSize=function(t){var e={large:1,medium:.6,small:.3,tiny:.15};if(!e[t])throw Error("Unknown size enum value: "+t);this._stretchFactor=e[t]*o.DEFAULT_STRETCH_FACTOR},o.sortSources=function(t){return t.map(function(t){var e,i,n=t._constructor;return isFunction(t.metaInfo)&&(n=t.metaInfo().id),i=o.sortSourcesPreOrdered[n]||0,e=i>0?1/0:i<0?-1/0:t.zorder(),[t,i,e]}).sort(function(t,e){return t[1]-e[1]||t[2]-e[2]}).map(function(t){return t[0]})},o.prototype._updateMargins=function(){var t,e,i=.01*this._properties.topMargin.value(),o=.01*this._properties.bottomMargin.value();for(this.m_leftPriceScale.setTopMargin(i),this.m_leftPriceScale.setBottomMargin(o),this.m_rightPriceScale.setTopMargin(i),this.m_rightPriceScale.setBottomMargin(o),t=0;t<this.m_dataSources.length;t++)(e=this.m_dataSources[t])instanceof TradingView.Study&&this.isOverlay(e)&&"Volume"!==e.metaInfo().shortId&&e.priceScale()&&e.priceScale()!==this.m_leftPriceScale&&e.priceScale()===this.m_rightPriceScale&&(e.priceScale().setTopMargin(i),e.priceScale().setBottomMargin(o),this.recalculatePriceScale(e.priceScale()));this.recalculatePriceScale(this.m_leftPriceScale),this.recalculatePriceScale(this.m_rightPriceScale),this.updateAllViews()},o.prototype.model=function(){return this._model},o.prototype.width=function(){return this.m_width},
o.prototype.height=function(){return this.m_height},o.prototype.setWidth=function(t){this.m_width=t,this.updateAllViews()},o.prototype.setHeight=function(t){var e,i;for(this.m_height=t,this.m_leftPriceScale.setHeight(t),this.m_rightPriceScale.setHeight(t),e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],this.isOverlay(i)&&i.priceScale()&&i.priceScale().setHeight(t);this.updateAllViews()},o.prototype.leftPriceScale=function(){return this.m_leftPriceScale},o.prototype.rightPriceScale=function(){return this.m_rightPriceScale},o.prototype.timeScale=function(){return this.m_timeScale},o.prototype.dataSources=function(){return this.m_dataSources},o.prototype.isOverlay=function(t){return t._isOverlay},o.prototype._processMainSourceChange=function(){var t,e,i,n,s,l,c;if(null===this.m_mainDataSource)for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&!this.isOverlay(i)&&(!i.properties().linkedToSeries||!i.properties().linkedToSeries.value())){this.m_mainDataSource=i,t=!0;break}if(this.m_mainDataSource&&t){for(n=[],e=0;e<this.m_dataSources.length;e++)i=this.m_dataSources[e],TradingView.isInherited(i.constructor,r)&&n.push(i);for(n=o.sortSources(n),e=0;e<n.length;e++)this.move(n[e],this.m_mainDataSource.priceScale(),!0)}else if(!this.m_mainDataSource||this.isOverlay(this.m_mainDataSource)&&0===this.nonOverlayPricesSourcesCount())for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],TradingView.isInherited(i.constructor,a)&&this.isOverlay(i)&&i.showInObjectTree()){for(this.m_mainDataSource=i,this.m_rightPriceScale.addDataSource(i),i.setPriceScale(this.m_rightPriceScale),s=this._model.children(i),c=0;c<s.length;c++)l=s[c],this.m_rightPriceScale.addDataSource(l),l.setPriceScale(this.m_rightPriceScale),l._isOverlay=!1;this.recalculatePriceScale(this.m_rightPriceScale),i._isOverlay=!1;break}},o.prototype._newZOrderForLineTool=function(){var t,e,i,o=null;for(t=0;t<this.m_dataSources.length;++t)(e=this.m_dataSources[t])instanceof r&&(i=e.zorder(),(null===o||i>o)&&(o=i));return null===o&&(o=this.getZOrderMinMax().minZOrder-1),this.m_dataSources.forEach(function(t){t.zorder()>o&&t.setZorder(t.zorder()+1)}),o+1},o.prototype.beginInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!0,this._lastLineDataSourceZOrder=null},o.prototype.endInsertManyLineDataSources=function(){this._isInInsertManyDataSourcesState=!1,this._lastLineDataSourceZOrder=null},o.prototype.addDataSource=function(t,e,i){var o;t instanceof r&&!i?(o=null!==this._lastLineDataSourceZOrder?this._lastLineDataSourceZOrder:this._newZOrderForLineTool(),this._isInInsertManyDataSourcesState&&(this._lastLineDataSourceZOrder=o)):o=this.getZOrderMinMax().minZOrder-1,this.insertDataSource(t,e,o)},o.prototype.insertDataSource=function(t,e,i){var n,r,s;this.m_dataSources.push(t),n=!1,t===this._model.mainSeries()?(this.m_mainDataSource=t,n=!0):null===this.m_mainDataSource&&(this.m_mainDataSource=t,n=!0),t._isOverlay=!1,
null!==e||this.canHaveMoreNoScaleSources()||(e=this.rightPriceScale()),null===e&&(r=this.m_rightPriceScale.topMargin(),s=this.m_rightPriceScale.bottomMargin(),t.metaInfo&&"Volume@tv-basicstudies"===t.metaInfo().id&&(r=.75,s=0),e=new c(this._model.properties().scalesProperties),e.setHeight(this.m_height),e.setTopMargin(r),e.setBottomMargin(s),t._isOverlay=!0),e.addDataSource(t,this._isInInsertManyDataSourcesState),t.setPriceScale(e),t.onTagsChanged&&t.onTagsChanged().subscribe(this,o.prototype.onSourceTagsChanged),t.setZorder(i),n&&this._processMainSourceChange(),this._tagsChanged.fire(),TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(e),this.invalidateSourcesCache()},o.prototype.removeDataSource=function(t,e){var i,n=this.m_dataSources.indexOf(t);if(-1===n)return void l.logDebug("removeDataSource: invalid data source");t._isOverlay=!1,this.m_dataSources.splice(n,1),t!==this.m_mainDataSource||e||(this.m_mainDataSource=null),i=null,-1!==this.m_leftPriceScale.dataSources().indexOf(t)?(this.m_leftPriceScale.removeDataSource(t),i=this.m_leftPriceScale):-1!==this.m_rightPriceScale.dataSources().indexOf(t)&&(this.m_rightPriceScale.removeDataSource(t),i=this.m_rightPriceScale),t.onTagsChanged&&t.onTagsChanged().unsubscribe(this,o.prototype.onSourceTagsChanged),TradingView.isInherited(t.constructor,a)&&this._processMainSourceChange(),this._tagsChanged.fire(),i&&TradingView.isInherited(t.constructor,a)&&this.recalculatePriceScale(i),this.invalidateSourcesCache()},o.prototype.startScalePrice=function(t,e){t.startScale(e)},o.prototype.scalePriceTo=function(t,e){t.scaleTo(e),this.updateAllViews()},o.prototype.endScalePrice=function(t){t.endScale()},o.prototype.startScrollPrice=function(t,e){t.startScroll(e)},o.prototype.scrollPriceTo=function(t,e){t.scrollTo(e),this.updateAllViews()},o.prototype.endScrollPrice=function(t){t.endScroll()},o.prototype.setPriceAutoScale=function(t,e){if(t.setAutoScale(e),this.timeScale().isEmpty())return void t.setPriceRange(null);this.recalculatePriceScale(t)},o.prototype.restorePriceScaleState=function(t,e){t.restoreState(e),this.updateAllViews()},o.prototype.updateAllViews=function(){for(var t=0;t<this.m_dataSources.length;t++)this.m_dataSources[t].updateAllViews()},o.prototype.defaultPriceScale=function(){var t=this.m_mainDataSource?this.m_mainDataSource.priceScale():this.rightPriceScale();return void 0===t&&(t=new c(this._model.properties().scalesProperties)),t},o.prototype._priceScaleIsPrice=function(t){var e=t.mainSource();return!!e&&(!!TradingView.isInherited(e.constructor,TradingView.Series)||!!TradingView.isInherited(e.constructor,TradingView.Study)&&e.metaInfo().is_price_study)},o.prototype.findSuitableScale=function(t){if(TradingView.isInherited(t.constructor,TradingView.Study)&&"Volume@tv-basicstudies"===t.metaInfo().id)return this.m_rightPriceScale.mainSource()||this.m_leftPriceScale.mainSource()?null:this.m_rightPriceScale;var e=!1
;if(TradingView.isInherited(t.constructor,TradingView.Study)?e=t.metaInfo().is_price_study:TradingView.isInherited(t.constructor,TradingView.Series)&&(e=!0),e){if(this._priceScaleIsPrice(this.m_rightPriceScale))return this.m_rightPriceScale;if(this._priceScaleIsPrice(this.m_leftPriceScale))return this.m_leftPriceScale}return this.m_rightPriceScale.mainSource()?this.m_leftPriceScale.mainSource()?null:this.m_leftPriceScale:this.m_rightPriceScale},o.prototype.mainDataSource=function(){return this.m_mainDataSource},o.prototype.recalculatePriceScale=function(t){var e,i;t&&(e=t.sourcesForAutoscale(),t.isAutoScale()&&e&&e.length>0&&!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),t.recalculatePriceRange(i)),t.updatePaneViews())},o.prototype.resetPriceScale=function(t){var e=this.timeScale().visibleBars();t.isLockScale()||t.setAutoScale(!0),t.recalculatePriceRange(e),this.updateAllViews()},o.prototype.recalculate=function(){var t,e;for(this.recalculatePriceScale(this.m_rightPriceScale),this.recalculatePriceScale(this.m_leftPriceScale),t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],!this.isOverlay(e)||e instanceof r||this.recalculatePriceScale(e.priceScale());this.updateAllViews(),this._model.updatePane(this)},o.prototype.isEmpty=function(){return null===this.m_mainDataSource},o.prototype.move=function(t,e,i){var o=this.m_dataSources.slice(),n=null!==e;this.removeDataSource(t,n),this.addDataSource(t,e,i),this.m_dataSources=o,this.invalidateSourcesCache()},o.prototype.dataSourceForId=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},o.prototype.priceScaleForSource=function(t){return-1!==this.rightPriceScale().dataSources().indexOf(t)?this.rightPriceScale():-1!==this.leftPriceScale().dataSources().indexOf(t)?this.leftPriceScale():null},o.prototype.sourceById=function(t){for(var e=0;e<this.m_dataSources.length;e++)if(this.m_dataSources[e].id()===t)return this.m_dataSources[e];return null},o.prototype.containsMainSeries=function(){return-1!==this.m_dataSources.indexOf(this._model.mainSeries())},o.prototype.priceScaleByName=function(t){return"left"===t?this.m_leftPriceScale:"right"===t?this.m_rightPriceScale:null},o.prototype.priceScaleName=function(t){return t===this.m_leftPriceScale?"left":t===this.m_rightPriceScale?"right":""},o.prototype.hitTestSources=function(){var t,e,i,o,n;if(this._cachedHitTestSources)return this._cachedHitTestSources;for(t=this.orderedSources(),e=[],i=[this._model.crossHairSource()],o=0;o<t.length;o++)n=t[o],TradingView.isInherited(n.constructor,r)?e.push(n):i.push(n);return this._cachedHitTestSources=i.concat(e),this._cachedHitTestSources},o.prototype.orderedSources=function(){var t,e,i,n;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0,i=this.m_dataSources.length;e<i;e++)n=this.m_dataSources[e],TradingView.isInherited(n.constructor,r)&&!n.isActualSymbol()||t.push(n);return t=o.sortSources(t),this._cachedOrderedSoruces=t,t},o.prototype.createDrawingsCaches=function(){
n.recreateOrderedByBarsSourcesCache(this)},o.prototype.clearDrawingCaches=function(){n.clearOrderedByBarsSourcesCache()},o.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null,this._cachedHitTestSources=null,this.m_leftPriceScale.invalidateSourcesCache(),this.m_rightPriceScale.invalidateSourcesCache()},o.prototype.getZOrderMinMax=function(){var t,e,i,o,n=this.orderedSources();if(0===n.length)return{minZOrder:0,maxZOrder:0};for(t=n[0].zorder(),e=n[0].zorder(),i=1;i<n.length;i++)o=n[i],o.zorder()<t&&(t=o.zorder()),o.zorder()>e&&(e=o.zorder());return{minZOrder:t,maxZOrder:e}},o.prototype.isZOrderAvailable=function(t){var e,i;for(e=0;e<this.m_dataSources.length;e++)if(i=this.m_dataSources[e],i.zorder()===t)return!1;return!0},o.prototype.sendToBack=function(t){var e,i=this.getZOrderMinMax().minZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,-1)},o.prototype.bringToFront=function(t){var e,i=this.getZOrderMinMax().maxZOrder,o=Math.abs(t.zorder()-i);for(e=0;e<o;e++)this.changeZOrder(t,1)},o.prototype.changeZOrder=function(t,e){var i,o,n,r,s,a=this.orderedSources().filter(function(t){return t.showInObjectTree()}),l=0;for(i=0,o=a.length;i<o;i++)if(a[i]===t){l=i;break}l>0&&e<0?(n=a[l-1].zorder(),r=t.zorder(),a[l-1].setZorder(r),t.setZorder(n)):l<a.length-1&&e>0&&(s=a[l+1].zorder(),r=t.zorder(),a[l+1].setZorder(r),t.setZorder(s)),this.invalidateSourcesCache()},o.prototype.onSourceTagsChanged=function(){this._tagsChanged.fire()},o.prototype.onTagsChanged=function(){return this._tagsChanged},o.prototype.dumpPriceScale=function(t){var e,i,o,n=t.dataSources(),r=[];for(e=0;e<n.length;e++)if(i=n[e].priceAxisViews(this,t))for(o=0;o<i.length;o++)r.push(i[o].dump());return r},o.prototype.dumpViews=function(){var t,e,i,o,n,r={};for(r.paneViews={},t=this.orderedSources(),e=0;e<t.length;e++)if(i=t[e],r.paneViews[e]=[],o=i.paneViews())for(n=0;n<o.size();n++)r.paneViews[e].push(o.item(e).dump());return r.leftAxis=this.dumpPriceScale(this.m_leftPriceScale),r.rightAxis=this.dumpPriceScale(this.m_rightPriceScale),r},o.prototype.clearSeries=function(){for(var t=this.m_dataSources.length-1;t>=0;t--)TradingView.isInherited(this.m_dataSources[t].constructor,TradingView.Series)&&this.m_dataSources.splice(t,1)},o.prototype.nonOverlayPricesSourcesCount=function(){return this.m_dataSources.filter(function(t){return(!t.properties().linkedToSeries||!t.properties().linkedToSeries.value())&&(TradingView.isInherited(t.constructor,a)&&t.showInObjectTree()&&!t.isNoScale())}).length},o.prototype.canHaveMoreNoScaleSources=function(){return this.nonOverlayPricesSourcesCount()>1},o.prototype.actionNoScaleIsEnabled=function(t){return!(!this.isOverlay(t)&&TradingView.isInherited(t.constructor,a))||this.canHaveMoreNoScaleSources()},o.prototype.executionsPositionController=function(){return this._executionsPositionController||(this._executionsPositionController=new n(this,this._model.timeScale())),this._executionsPositionController},o.prototype.isLast=function(){var t=this._model.panes();return t[t.length-1]===this},
o.prototype.setMaximized=function(t){this._maximized=t},o.prototype.isMaximized=function(){return this._maximized},o.prototype.isMainPane=function(){var t=this._model.mainSeries(),e=!1;return this.m_dataSources.forEach(function(i){e||(e=i===t)}),this._isMainPane=e,e},o.prototype.properties=function(){return this._properties},o.prototype._mainSourceVisiblePriceRange=function(t){var e=this.m_timeScale.visibleBars();return null!==e?t.mainSource().priceRange(e.firstBar(),e.lastBar()):new s(-.5,.5)},o.prototype.applyLeftPriceScaleRatio=function(t){this._lastLeftPriceScaleRatio!==t&&(this._setNewPriceRangeByScaleRatio(this.m_leftPriceScale,t,this._mainSourceVisiblePriceRange(this.m_leftPriceScale),!0,!0),this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale)))},o.prototype.applyRightPriceScaleRatio=function(t){this._lastRightPriceScaleRatio!==t&&(this._setNewPriceRangeByScaleRatio(this.m_rightPriceScale,t,this._mainSourceVisiblePriceRange(this.m_rightPriceScale),!0,!0),this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale)))},o.prototype.isLeftPriceScaleLocked=function(){return!this.m_leftPriceScale.isLog()&&this.m_leftPriceScale.isLockScale()},o.prototype.isRightPriceScaleLocked=function(){return!this.m_rightPriceScale.isLog()&&this.m_rightPriceScale.isLockScale()},o.prototype.leftPriceScaleRatio=function(){return null===this._lastLeftPriceScaleRatio&&(this._lastLeftPriceScaleRatio=h(this.m_timeScale,this.m_leftPriceScale)),this._lastLeftPriceScaleRatio},o.prototype.rightPriceScaleRatio=function(){return null===this._lastRightPriceScaleRatio&&(this._lastRightPriceScaleRatio=h(this.m_timeScale,this.m_rightPriceScale)),this._lastRightPriceScaleRatio},o.prototype._mainSeriesPaneScaleRatioOnChange=function(){this.isMainPane()&&(this._lastLeftPriceScaleRatio=null,this._lastRightPriceScaleRatio=null,this._model.mainSeriesScaleRatioPropertyOnChanged())},o.prototype._applyOldScaleRatioToPriceScale=function(t,e){if(this._isRecalculatingScales||null===e||void 0===e)return!1;this._isRecalculatingScales=!0,this._setNewPriceRangeByScaleRatio(t,e,this._mainSourceVisiblePriceRange(t)),this._isRecalculatingScales=!1},o.prototype._applyOldScaleRatioToTimeScale=function(t,e){if(this._isRecalculatingScales||null===e||void 0===e)return!1;this._isRecalculatingScales=!0,this._setNewBarSpacingByScaleRatio(t,e),this._isRecalculatingScales=!1},o.prototype._tryToApplyNewLeftPriceScaleRatio=function(t){if(this._lastLeftPriceScaleRatio===t)return!1;this._leftPriceScaleRatioChanged.fire(this._lastLeftPriceScaleRatio,t),this._lastLeftPriceScaleRatio=t},o.prototype._tryToApplyNewRightPriceScaleRatio=function(t){if(this._lastRightPriceScaleRatio===t)return!1;this._rightPriceScaleRatioChanged.fire(this._lastRightPriceScaleRatio,t),this._lastRightPriceScaleRatio=t},o.prototype._recalculatePriceScaleByScaleRatio=function(){
this.isMainPane()&&(this.m_leftPriceScale.mainSource()&&(this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToPriceScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))),this.m_rightPriceScale.mainSource()&&(this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToPriceScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))))},o.prototype._recalculateTimeScaleByLeftScaleRatio=function(){this.isLeftPriceScaleLocked()&&null!==this._lastLeftPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_leftPriceScale,this._lastLeftPriceScaleRatio):this._tryToApplyNewLeftPriceScaleRatio(h(this.m_timeScale,this.m_leftPriceScale))},o.prototype._recalculateTimeScaleByRightScaleRatio=function(){this.isRightPriceScaleLocked()&&null!==this._lastRightPriceScaleRatio?this._applyOldScaleRatioToTimeScale(this.m_rightPriceScale,this._lastRightPriceScaleRatio):this._tryToApplyNewRightPriceScaleRatio(h(this.m_timeScale,this.m_rightPriceScale))},o.prototype._setNewPriceRangeByScaleRatio=function(t,e,i,o,n){var r=u(t,this.m_timeScale.barSpacing(),e);t.setPriceRange(null!==r?r:i,o,n)},o.prototype._setMinMaxPriceRange=function(t,e){var i=u(t,this.m_timeScale.maxBarSpacing(),e),o=u(t,this.m_timeScale.minBarSpacing(),e);null!==i&&t.setMaxPriceRange(i),null!==o&&t.setMinPriceRange(o)},o.prototype._onLeftPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_leftPriceScale,this._lastLeftPriceScaleRatio)},o.prototype._onRightPriceScaleSetMinMaxPriceRange=function(){this._setMinMaxPriceRange(this.m_rightPriceScale,this._lastRightPriceScaleRatio)},o.prototype._setNewBarSpacingByScaleRatio=function(t,e){var i=this.m_timeScale.getValidBarSpacing(d(t,e));this.m_timeScale.isValidBarSpacing(i)&&this.m_timeScale.setBarSpacing(i)},t.exports=o}).call(e,i(10))},function(t,e,i){"use strict";(function(e,o){function n(t,e){if(this.m_base=t,this.m_integralDividers=e,this.m_fractionalDividers=[],c.isBaseDecimal(this.m_base))this.m_fractionalDividers=[2,2.5,2];else for(var i=this.m_base;1!==i;){if(i%2==0)this.m_fractionalDividers.push(2),i/=2;else{if(i%5!=0)throw new RangeError("unexpected base");this.m_fractionalDividers.push(2),this.m_fractionalDividers.push(2.5),i/=5}if(this.m_fractionalDividers.length>100)throw Error("something wrong with base")}}function r(t,e,i){this.m_marks=[],this.m_base=e,this.m_priceScale=t,this._formatter=i,i&&(this._cache=new h(function(t){return i.format(t)})),this._currentFormatBase=0}function s(t){for(var e=1;t*e!==Math.round(t*e);)e*=10;return e}function a(t,i){function n(){var t,e,i=s.m_dataSources;for(t=0;t<i.length;t++)e=i[t],e.priceScaleChanged&&e.priceScaleChanged.fire(s)}this._properties=new e(i||l),this._scalesProperties=t,this.m_height=0,this._internalHeightCache=null,this._internalHeightChanged=new o,this.m_priceRange=null,
this._priceRangeChanged=new o,this.m_dataSources=[],this.m_topMargin=0,this.m_bottomMargin=0,this._studyTopMargin=0,this._studyBottomMargin=0,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this.m_maxPriceRange=null,this.m_minPriceRange=null,this.m_priceRangeSnapshot=null,this._invalidatedForRange={isValid:!0},this.onMarksChanged=new o,this.m_markBuilder=new r(this,100,new f(100)),this._properties.percentage.listeners().subscribe(this,a.prototype.updateFormatter);var s=this;this._properties.log.listeners().subscribe(null,function(t){var e,i,o,n;s.m_priceRange&&(e=s.m_priceRange,t.value()?(i=new g(s._toLog(e.minValue()),s._toLog(e.maxValue())),s.setPriceRange(i)):(o=s._fromLog(e.minValue()),n=s._fromLog(e.maxValue()),isFinite(o)&&isFinite(n)?(i=new g(o,n),s.setPriceRange(i)):s.properties().autoScale.setValue(!0)))}),this._properties.percentage.listeners().subscribe(null,function(){s._properties.autoScale.setValue(!0)}),this._properties.percentage.listeners().subscribe(null,function(){var t,e,i;s._properties.autoScaleDisabled.setValue(s._properties.percentage.value()),t=s.priceRange(),s.mainSource()&&!s.mainSource().model().timeScale().isEmpty()&&!s.mainSource().data().isEmpty()&&s.isLockScale()&&t&&(e=s.mainSource().model().timeScale().visibleBars(),i=s.mainSource().data().search(e.firstBar(),_.NearestRight).value[TradingView.CLOSE_PLOT],null!=t&&void 0!==i&&(s._properties.percentage.value()?s.setPriceRange(t.convertToPercents(i)):s.setPriceRange(t.convertFromPercents(i))))}),this._properties.lockScale.listeners().subscribe(null,function(t){var e=t.value();e&&(s._properties.autoScale.setValue(!1),s._properties.percentage.setValue(!1),s._properties.log.setValue(!1)),s._properties.percentageDisabled.setValue(e),s._properties.logDisabled.setValue(e)}),this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this._hasSeries=!1,this._properties.percentage.listeners().subscribe(null,n),this._properties.log.listeners().subscribe(null,n),this._properties.listeners().subscribe(null,function(){s.mainSource()&&s.mainSource().model()&&s.mainSource().model().fullUpdate()})}var l,c=i(54),h=i(226),u=i(1).LineDataSource,d=i(46).PriceDataSource,p=i(77),_=i(19).PlotRowSearchMode,f=i(28).PriceFormatter,m=i(167).PercentageFormatter,g=i(73);n.prototype.TICK_SPAN_EPSILON=1e-9,n.prototype.tickSpan=function(t,e,i){var o,n=0===this.m_base?0:1/this.m_base,r=this.TICK_SPAN_EPSILON,s=Math.pow(10,Math.max(0,Math.ceil(c.log10(t-e)))),a=0;for(a=0,o=this.m_integralDividers[0];s>n+r&&c.greaterOrEqual(s,n,r)&&c.greaterOrEqual(s,i*o,r)&&c.greaterOrEqual(s,1,r);++a,o=this.m_integralDividers[a%this.m_integralDividers.length])s/=o;if(s<=n+r&&(s=n),s=Math.max(1,s),this.m_fractionalDividers.length>0&&c.equal(s,1,r))for(a=0,o=this.m_fractionalDividers[0];s>n+r&&c.greaterOrEqual(s,i*o,r);++a,o=this.m_fractionalDividers[a%this.m_fractionalDividers.length])s/=o;return s},r.prototype.TICK_DENSITY=2.5,r.prototype.base=function(){return this.m_base},r.prototype.setBase=function(t){if(t<0)throw new RangeError("base < 0");this.m_base=t},
r.prototype.fontHeight=function(){return this.m_priceScale.fontSize()},r.prototype.tickSpan=function(t,e){var i,o,r,s,a,l,h;if(t<e)throw new RangeError("high < low");return i=this.m_priceScale.height(),o=this.tickMarkHeight(),r=(t-e)*o/i,s=new n(this.m_base,[2,2.5,2]),a=new n(this.m_base,[2,2,2.5]),l=new n(this.m_base,[2.5,2,2]),h=[],h.push(s.tickSpan(t,e,r)),h.push(a.tickSpan(t,e,r)),h.push(l.tickSpan(t,e,r)),c.min(h)},r.prototype.tickMarkHeight=function(){return Math.ceil(this.fontHeight()*this.TICK_DENSITY)},r.prototype.rebuildTickMarks=function(){var t,e,i,o,n,r,a,l,c,u,d,p,_;if(null===this.m_priceScale)throw new TypeError("scale is null");if(this.m_priceScale.isEmpty())return void(this.m_marks=[]);if(t=this.m_priceScale.height(),e=this.m_priceScale.coordinateToPrice(t-1),i=this.m_priceScale.coordinateToPrice(0),o=i>=e?1:-1,n=Math.max(i,e),r=Math.min(i,e),i=n,e=r,i!==e)for(a=this.tickSpan(i,e),l=i%a,l+=l<0?a:0,this.m_marks=[],this._formatter||(c=s(a),this._cache&&this._currentFormatBase===c||(u=new f(c),this._cache=new h(function(t){return u.format(t)}))),d=null,p=i-l;p>e;p-=a)_=this.m_priceScale.priceToCoordinate(p),null!==d&&Math.abs(_-d)<this.tickMarkHeight()||(this.m_marks.push({coord:_,label:this._cache.format(p)}),d=_,this.m_priceScale.isLog()&&(a=this.tickSpan(p*o,e)))},r.prototype.marks=function(){return this.m_marks},l={autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},a.prototype.isLog=function(){return this._properties.log.value()},a.prototype.isPercent=function(){return this._properties.percentage.value()},a.prototype.isPercentage=function(){return this._properties.percentage.value()},a.prototype.properties=function(){return this._properties},a.prototype.fontSize=function(){return this._scalesProperties.fontSize.value()},a.prototype.height=function(){return this.m_height},a.prototype.setHeight=function(t){this.m_height!==t&&(this.m_height=t,this._invalidateInternalHeightCache(),this._marksCache=null)},a.prototype.topMargin=function(){return Math.max(this.m_topMargin,this._studyTopMargin)},a.prototype.setTopMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_topMargin!==t&&(this.m_topMargin=t,this._invalidateInternalHeightCache(),this._marksCache=null)},a.prototype.bottomMargin=function(){return Math.max(this.m_bottomMargin,this._studyBottomMargin)},a.prototype.setBottomMargin=function(t){if(!isNumber(t))throw new TypeError("invalid margin");if(t<0||t>30)throw new RangeError("invalid margin");this.m_bottomMargin!==t&&(this.m_bottomMargin=t,this._invalidateInternalHeightCache(),this._marksCache=null)},a.prototype.internalHeight=function(){if(this._internalHeightCache)return this._internalHeightCache;var t=this.height()*(1-this.topMargin()-this.bottomMargin());return this._internalHeightCache=t,t},a.prototype._invalidateInternalHeightCache=function(){this._internalHeightCache=null,this._internalHeightChanged.fire()},
a.prototype.internalHeightChanged=function(){return this._internalHeightChanged},a.prototype.priceRange=function(){return this.makeSureItIsValid(),this.m_priceRange},a.prototype.priceRangeChanged=function(){return this._priceRangeChanged},a.prototype.setPriceRange=function(t,e,i){var o,n,r;if(!(t instanceof g))throw new TypeError("incorrect price range");return o=this.m_priceRange,!!(e||null===o&&null!==t||null!==o&&!o.equals(t))&&(n=null!==this.m_maxPriceRange&&this.m_maxPriceRange.containsStrictly(t),r=null!==this.m_minPriceRange&&t.containsStrictly(this.m_minPriceRange),!(this.isLockScale()&&!e&&(n||r))&&(this._marksCache=null,this.m_priceRange=t,void(i||this._priceRangeChanged.fire(o,t))))},a.prototype.isEmpty=function(){return this.makeSureItIsValid(),0===this.m_height||!this.m_priceRange||this.m_priceRange.isEmpty()},a.prototype.invertedCoordinate=function(t){return this.height()-1-t},a._logicalOffset=4,a._coordOffset=1e-4,a.prototype.log10=function(t){return Math.log(t)/Math.log(10)},a.prototype._toLog=function(t){var e,i=Math.abs(t);return i<1e-8?0:(e=this.log10(i+a._coordOffset)+a._logicalOffset,t<0?-e:e)},a.prototype.priceToLogical=function(t){return this.isLog()&&t?this._toLog(t):t},a.prototype._fromLog=function(t){var e,i=Math.abs(t);return i<1e-8?0:(e=Math.pow(10,i-a._logicalOffset)-a._coordOffset,t<0?-e:e)},a.prototype.logicalToPrice=function(t){return this.isLog()?this._fromLog(t):t},a.prototype.priceToCoordinate=function(t,e){var i,o;return this.makeSureItIsValid(),this.isEmpty()?0:(t=this.priceToLogical(t),i=this.bottomMargin()*this.height()+(this.internalHeight()-1)*(t-this.priceRange().minValue())/(this.priceRange().maxValue()-this.priceRange().minValue()),o=this.invertedCoordinate(i),e?o:Math.round(o))},a.prototype.pricesToCoordinates=function(t){this.pricesToCoordinatesEx(t,function(t){return t.y},function(t,e){t.y=e})},a.prototype.pricesToCoordinatesEx=function(t,e,i){var o,n,r,s,a,l,c,h,u;if(this.makeSureItIsValid(),o=this.bottomMargin()*this.height(),n=this.priceRange().minValue(),r=this.priceRange().maxValue(),s=this.internalHeight()-1,a=s/(r-n),this.isLog())for(l=0;l<t.length;l++)c=e(t[l]),i(t[l],this.priceToLogical(c));for(l=0;l<t.length;l++)c=e(t[l]),TradingView.isNaN(c)||void 0===c||null===c||(h=o+a*(c-n),u=this.m_height-1-h,i(t[l],Math.round(u)))},a.prototype.pointsArrayToCoordinates=function(t){var e,i,o,n,r,s,a,l,c;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,r=n/(o-i),this.isLog())for(s=0;s<t.length;s++)t[s].y=this.priceToLogical(t[s].y);for(s=0;s<t.length;s++)a=t[s].y,TradingView.isNaN(a)||void 0===a||null===a||(l=e+r*(a-i),c=this.m_height-1-l,t[s].y=Math.round(c))},a.prototype.pricesArrayToCoordinates=function(t){var e,i,o,n,r,s,a,l,c;if(this.makeSureItIsValid(),e=this.bottomMargin()*this.height(),i=this.priceRange().minValue(),o=this.priceRange().maxValue(),n=this.internalHeight()-1,r=n/(o-i),this.isLog())for(s=0;s<t.length;s++)t[s]=this.priceToLogical(t[s])
;for(s=0;s<t.length;s++)void 0!==(a=t[s])&&null!==a&&(l=e+r*(a-i),c=this.m_height-1-l,t[s]=Math.round(c))},a.prototype.barPricesToCoordinates=function(t){var e,i,o,n,r,s,a,l,c,h,u;if(this.makeSureItIsValid(),e=t,i=this.bottomMargin()*this.height(),o=this.priceRange().minValue(),n=this.priceRange().maxValue(),r=this.internalHeight()-1,s=r/(n-o),this.isLog())for(a=0;a<e.length;a++)e[a]&&(e[a].open=this.priceToLogical(e[a].open),e[a].high=this.priceToLogical(e[a].high),e[a].low=this.priceToLogical(e[a].low),e[a].close=this.priceToLogical(e[a].close),e[a].additionalPrice&&(e[a].additionalPrice=this.priceToLogical(e[a].additionalPrice)));for(a=0;a<e.length;a++)(l=e[a])&&(c=l.open,h=i+s*(c-o),u=this.m_height-1-h,l.open=Math.round(u),c=l.high,h=i+s*(c-o),u=this.m_height-1-h,l.high=Math.round(u),c=l.low,h=i+s*(c-o),u=this.m_height-1-h,l.low=Math.round(u),c=l.close,h=i+s*(c-o),u=this.m_height-1-h,l.close=Math.round(u),l.additionalPrice&&(c=l.additionalPrice,h=i+s*(c-o),u=this.m_height-1-h,l.additionalPrice=Math.round(u)))},a.prototype.coordinateToPrice=function(t){var e,i;return this.makeSureItIsValid(),this.isEmpty()?0:(e=this.invertedCoordinate(t),i=this.priceRange().minValue()+(this.priceRange().maxValue()-this.priceRange().minValue())*((e-this.bottomMargin()*this.height())/(this.internalHeight()-1)),this.logicalToPrice(i))},a.prototype.dataSources=function(){return this.m_dataSources},a.prototype.orderedSources=function(){var t,e,o,n;if(this._cachedOrderedSoruces)return this._cachedOrderedSoruces;for(t=[],e=0;e<this.m_dataSources.length;e++)o=this.m_dataSources[e],null==o.zorder()&&o.setZorder(e+1),t.push(o);return n=i(228),t=n.sortSources(t),this._cachedOrderedSoruces=t,this._cachedOrderedSoruces},a.prototype.invalidateSourcesCache=function(){this._cachedOrderedSoruces=null},a.prototype.hasSeries=function(){return this._hasSeries},a.prototype.addDataSource=function(t,e){var i,o;(e||-1===this.m_dataSources.indexOf(t))&&(TradingView.isInherited(t.constructor,p)&&(i=t.properties(),!0!==this._hasSeries&&(i.lockScale&&(this._properties.lockScale.setValue(i.lockScale.value()),i.removeProperty("lockScale")),i.pnfStyle.lockScale&&i.pnfStyle.removeProperty("lockScale")),this._hasSeries=!0),o=this,t.properties().visible.listeners().subscribe(null,function(){o._sourcesForAutoscale=null}),this.m_dataSources.push(t),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.initScaleProperties(),this.invalidateSourcesCache())},a.prototype.initScaleProperties=function(){var t=this.isLockScale();t&&(this.properties().percentage.setValue(!1),this.properties().log.setValue(!1),this.properties().autoScale.setValue(!1)),this.properties().percentageDisabled.setValue(t),this.properties().logDisabled.setValue(t),this.properties().autoScaleDisabled.setValue(this.properties().percentage.value()),this.properties().percentage.value()&&this.properties().log.setValue(!1)},a.prototype.removeDataSource=function(t){var e=this.m_dataSources.indexOf(t)
;if(-1===e)throw Error("source is not attached to scale");this.m_dataSources.splice(e,1),TradingView.isInherited(t.constructor,p)&&(this._hasSeries=!1),this.mainSource()||this.setAutoScale(!0),this._mainSource=void 0,this._sourcesForAutoscale=null,this._sourcesToUpdateViews=null,this.updateFormatter(),this.invalidateSourcesCache()},a.prototype.isAutoScale=function(){return this._properties.autoScale.value()&&!this.isLockScale()},a.prototype.isLockScale=function(){return this._properties.lockScale.value()},a.prototype.setAutoScale=function(t){this._properties.autoScale.setValue(t)},a.prototype.isScaled=function(){return"number"==typeof this.m_scaleStartPoint},a.prototype.startScale=function(t){this.isPercentage()||null===this.m_scaleStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scaleStartPoint=this.m_height-t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.marks=function(){return this._marksCache?this._marksCache:(this.m_markBuilder.rebuildTickMarks(),this._marksCache=this.m_markBuilder.marks(),this.onMarksChanged.fire(),this._marksCache)},a.prototype.setMaxPriceRange=function(t){this.m_maxPriceRange=t},a.prototype.setMinPriceRange=function(t){this.m_minPriceRange=t},a.prototype.scaleTo=function(t){var e,i;this.isPercentage()||null!==this.m_scaleStartPoint&&(this.setAutoScale(!1),t=this.m_height-t,t<0&&(t=0),e=(this.m_scaleStartPoint+.2*(this.m_height-1))/(t+.2*(this.m_height-1)),i=this.m_priceRangeSnapshot.clone(),e=Math.max(e,.1),i.scaleAroundCenter(e),this.setPriceRange(i))},a.prototype.endScale=function(){this.isPercentage()||null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.startScroll=function(t){this.isAutoScale()||null===this.m_scrollStartPoint&&null===this.m_priceRangeSnapshot&&(this.isEmpty()||(this.m_scrollStartPoint=t,this.m_priceRangeSnapshot=this.priceRange().clone()))},a.prototype.scrollTo=function(t){var e,i,o,n;this.isAutoScale()||null!==this.m_scrollStartPoint&&(e=this.priceRange().length()/(this.height()-1),i=t-this.m_scrollStartPoint,o=i*e,n=this.m_priceRangeSnapshot.clone(),n.shift(o),this.setPriceRange(n,!0),this._marksCache=null)},a.prototype.endScroll=function(){this.isAutoScale()||null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this.m_priceRangeSnapshot=null)},a.prototype.state=function(){var t={};return t.m_priceRange=this.priceRange()?this.priceRange().serialize():null,t.m_isAutoScale=this.isAutoScale(),t.m_isPercentage=this._properties.percentage.value(),t.m_isLog=this._properties.log.value(),t.m_isLockScale=this.isLockScale(),t.m_height=this.m_height,t.m_topMargin=this.m_topMargin,t.m_bottomMargin=this.m_bottomMargin,t},a.prototype.restoreState=function(t){var e=t.m_priceRange;if(void 0===e)throw new TypeError("invalid state");if(void 0===t.m_isAutoScale)throw new TypeError("invalid state");void 0!==t.m_isPercentage&&this._properties.percentage.setValue(t.m_isPercentage),void 0!==t.m_isLog&&this._properties.log.setValue(t.m_isLog),
void 0!==t.m_isLockScale&&this._properties.lockScale.setValue(t.m_isLockScale),e?this.setPriceRange(new g(e),!0):this.m_priceRange=null,void 0!==t.m_height&&(this.m_height=Math.max(0,t.m_height)),this.setAutoScale(t.m_isAutoScale),void 0!==t.m_topMargin&&(this.m_topMargin=t.m_topMargin),void 0!==t.m_bottomMargin&&(this.m_bottomMargin=t.m_bottomMargin),this._mainSource=void 0,this._scaleSeriesOnly=!1},a.prototype.mainSource=function(){var t,e;if(void 0!==this._mainSource)return this._mainSource;for(t=void 0,e=0;e<this.m_dataSources.length;e++){if(TradingView.isInherited(this.m_dataSources[e].constructor,p)){t=this.m_dataSources[e];break}!t&&TradingView.isInherited(this.m_dataSources[e].constructor,d)&&(t=this.m_dataSources[e])}return this._mainSource=t,this._mainSource||null},a.prototype.formatter=function(){return this._formatter||this.updateFormatter(),this._formatter},a.prototype.updateFormatter=function(){var t,e;this._marksCache=null,t=this.mainSource(),e=100,t&&(e=t.base()),this._formatter=null,this.properties().percentage.value()?this._formatter=new m:this._formatter=t?t.formatter():new f(100,1),this.m_markBuilder=new r(this,e,this._formatter),this.m_markBuilder.rebuildTickMarks()},a.prototype._recalculateSourcesForAutoscale=function(){var t,e;this._mainSource&&(this._scaleSeriesOnly=this._scalesProperties.scaleSeriesOnly.value()),t=this._scaleSeriesOnly&&this._hasSeries,e=function(e){return!!(e.properties().visible.value()||e instanceof p)&&(t?TradingView.isInherited(e.constructor,p):TradingView.isInherited(e.constructor,d))},this._sourcesForAutoscale=this.m_dataSources.filter(e)},a.prototype.sourcesForAutoscale=function(){return this._mainSource&&this._scaleSeriesOnly!==this._scalesProperties.scaleSeriesOnly.value()&&(this._sourcesForAutoscale=null),this._sourcesForAutoscale||this._recalculateSourcesForAutoscale(),this._sourcesForAutoscale},a.prototype.recalculatePriceRange=function(t){this._invalidatedForRange={visibleBars:t,isValid:!1}},a.prototype.makeSureItIsValid=function(){this._invalidatedForRange.isValid||(this._invalidatedForRange.isValid=!0,this.recalculatePriceRangeImpl())},a.prototype.recalculatePriceRangeImpl=function(){var t,e,i,o,n,r,s,a,l,c,h=this._invalidatedForRange.visibleBars;if(null!==h){for(t=null,e=this.sourcesForAutoscale(),i=0,o=0,n=0;n<e.length;n++)r=e[n],r.properties().visible.value()&&(s=h.firstBar(),a=h.lastBar(),l=r.priceRange(s,a),null===t&&l?t=l:l&&(t=t.merge(l)),r.margins&&(c=r.margins(),i=Math.max(c[0],i),o=Math.max(c[1],o)));(Math.abs(o-this._studyBottomMargin)>.01||Math.abs(i-this._studyTopMargin)>.01)&&(this._studyBottomMargin=o,this._studyTopMargin=i,this._marksCache=null,this._invalidateInternalHeightCache()),t?(t.minValue()===t.maxValue()&&(t=new g(t.minValue()-.5,t.maxValue()+.5)),this.setPriceRange(t)):this.m_priceRange||this.setPriceRange(new g(-.5,.5)),this._invalidatedForRange.isValid=!0}},a.prototype.sourcesToUpdateViews=function(){var t,e;if(!this._sourcesToUpdateViews)for(this._sourcesToUpdateViews=[],t=0;t<this.m_dataSources.length;t++)e=this.m_dataSources[t],
TradingView.isInherited(e.constructor,u)&&!e.isActualSymbol()||this._sourcesToUpdateViews.push(e);return this._sourcesToUpdateViews},a.prototype.updatePaneViews=function(){var t,e=this.sourcesToUpdateViews();for(t=0;t<e.length;t++)e[t].updateAllViews()},a.prototype.priceRangeInPrice=function(){var t,e,i,o,n,r;return this.isEmpty()?null:this.isPercent()?(t=this.mainSource().model().timeScale().visibleBars(),e=this.mainSource().data().search(t.firstBar(),_.NearestRight).value[TradingView.CLOSE_PLOT],i=this.priceRange().convertFromPercents(e),{from:i.minValue(),to:i.maxValue()}):(o=this.height(),n=this.coordinateToPrice(o-1),r=this.coordinateToPrice(0),{from:n,to:r})},t.exports=a}).call(e,i(25),i(10))},function(t,e,i){"use strict";function o(t,e,i){this.source=t,this.pane=e,this._rendererFactory=i}function n(t,e){this._barWidth=t.barWidth,this._plates=t.plates,this._tooltip=t.tooltip,this._model=e}function r(){this._layout=[],this._currentId=void 0,this.tooltipHovered=!1}var s=i(8).Point,a=i(60).pointInCircle,l=i(11);o.prototype.update=function(){},o.prototype.renderer=function(){return this._rendererFactory(this.source)},n.prototype.draw=function(t){t.save();for(var e=0;e<this._plates.length;e++)if(this._plates[e].highlightByAuthor){this._highlightByAuthor=!0;break}this._plates.forEach(this._drawItem.bind(this,t)),this._tooltip.draw(this._plates.map(function(t){return this._plateTransform(t)}.bind(this)),t),this._tooltip.endDraw(),t.restore()},n.prototype._drawItem=function(t,e){t.save(),this._highlightByAuthor&&!e.highlightByAuthor&&(t.globalAlpha=.4);var i=this._dotTransform(e);i.mine?this._drawTriangle(t,i):this._drawDot(t,i),t.restore()},n.prototype._commonTransform=function(t){var e=Math.max(1.4*t.minSize,this._barWidth+4),i=t.y+{up:-1,down:1}[t.direction]*(e*(t.order+.6)+.25*e),o=TradingView.clone(t.overridedTheme||this.themes[t.theme]);return o.dotBorderWidth=t.hovered||t.highlightByAuthor?4:2,{id:t.id,theme:o,themeName:t.theme,x:Math.round(t.x+1),y:Math.round(i),pinned:t.pinned,hovered:t.hovered}},n.prototype._dotTransform=function(t){var e=this._commonTransform(t);return e.radius=Math.max(t.minSize/2,.4*this._barWidth),e.label=t.label,e.labelFontColor=t.labelFontColor,e.labelFontSize=Math.ceil(Math.max(10,Math.min(e.radius,20))),this._model.updateDotData(t,e)},n.prototype._plateTransform=function(t){var e=this._commonTransform(t);return this._model.updatePlateData(t,e)},n.THEMES=["green","red","neutral","yellow","blue"],n.prototype.themes={green:{border:"#78C143",background:"#8DDD54"},red:{border:"#CC4545",background:"#ED5A5A"},neutral:{border:"#EAC300",background:"#FFD400"},yellow:{border:"#EAC300",background:"#FFD400"},blue:{border:"#047ACE",background:"#0496FF"}},n.prototype._drawTriangle=function(t,e){var i,o,n,r;t.strokeStyle=e.theme.border,t.fillStyle=e.theme.background,t.lineWidth=e.theme.dotBorderWidth,i=e,o=e.radius,n=Math.cos(Math.PI/6)*o,r=Math.sin(Math.PI/6)*o,t.translate(i.x,i.y),"up"===e.direction&&t.rotate(Math.PI),e.public||(t.lineWidth/=2),t.beginPath(),t.moveTo(0,-o),t.lineTo(n,r),
t.lineTo(-n,r),t.lineTo(0,-o),t.closePath(),t.stroke(),e.public&&t.fill()},n.prototype._drawDot=function(t,e){t.strokeStyle=e.theme.border,t.fillStyle=e.theme.background,t.lineWidth=e.theme.dotBorderWidth,t.beginPath(),t.arc(e.x,e.y,e.radius,0,2*Math.PI,!0),t.closePath(),t.stroke(),t.fill(),e.label&&e.radius>6&&(t.textAlign="center",t.textBaseline="middle",t.font="bold "+e.labelFontSize+"px Arial",t.fillStyle=e.labelFontColor,t.fillText(e.label,e.x,e.y))},n.prototype.hitTest=function(t){var e,i;for(i=this._plates.length-1;i>=0;--i)if(e=this._hitTestDot(this._plates[i],t))return e;return null},n.prototype._hitTestDot=function(t,e){var i=this._dotTransform(t),o=new s(i.x,i.y);return a(e,o,Math.max(i.radius,8))?new l(l.REGULAR,t):null},r.prototype._createLayout=function(){throw Error("Child class must override this member")},r.prototype._updatePlate=function(t){throw Error("Child class must override this member")},r.prototype._getContainer=function(t){return this._container&&this._context===t||(this._context=t,this._container=$(t.canvas).parent()),this._container},r.prototype._plateArrowSize=14,r.prototype.showPlate=function(t,e){var i,o,n,r,s,a,l,c;this._currentId===t.id&&this._layout&&0!==this._layout.length&&null!=this._layout[0].parentNode||(this._currentId=t.id,this._createLayout(),this._getContainer(e).append(this._layout),i=this,this._layout.hover(function(){i.tooltipHovered=!0,$(this).stop(!0).fadeTo(0,1)},function(){i.tooltipHovered=!1})),o=Math.round(t.barWidth/2),o>15&&(o=15),o<10&&(o=10),this._updatePlate(t),n=e.canvas.getBoundingClientRect(),r=t.x-this._layout.outerWidth()<this._plateArrowSize,s=n.width-t.x+Math.round(t.barWidth/2+o),r&&(s-=this._layout.outerWidth()+2*this._plateArrowSize),a=n.height,l=20,c=10,this._layout.toggleClass("right",r),this._layout.css({top:Math.min(Math.max(t.y,l),a-this._layout.outerHeight()-c),right:s,fontSize:o+"px",display:"block"})},r.prototype._removeLayout=function(){this.tooltipHovered||(this._layout.stop(!0),this._layout.remove())},r.prototype._toggleLayout=function(t){this._layout.toggle(t)},r.prototype.hide=function(t){this.tooltipHovered?this._layout.stop(!0).fadeTo(0,1):this._layout.fadeOut(400,function(){$(this).remove(),t()})},r.prototype.setSource=function(t){this.source=t},e.BarsMarksContainerPaneView=o,e.BarsMarksContainerRenderer=n,e.BarMarkTooltip=r},function(t,e,i){"use strict";var o={};o.renderAttributes=function(t){var e,i="";for(e in t)t[e]&&(i+=" "+e+'="'+t[e]+'"');return i},o.create=function(t,e){var i=$(document.createElement(t));return e&&(e.html&&(i.html(e.html),delete e.html),i.attr(e)),i},
o.validAttributes=["abbr","accept-charset","accept","accesskey","action","align","alink","alt","archive","axis","background","bgcolor","border","cellpadding","cellspacing","char","charoff","charset","checked","cite","class","classid","clear","code","codebase","codetype","color","cols","colspan","compact","content","coords","data","datetime","declare","defer","dir","disabled","enctype","face","for","frame","frameborder","headers","height","href","hreflang","hspace","http-equiv","id","ismap","label","lang","language","link","longdesc","marginheight","marginwidth","maxlength","media","method","multiple","name","nohref","noresize","noshade","nowrap","object","onblur","onchange","onclick","ondblclick","onfocus","onkeydown","onkeypress","onkeyup","onload","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onreset","onselect","onsubmit","onunload","profile","prompt","readonly","rel","rev","rows","rowspan","rules","scheme","scope","scrolling","selected","shape","size","span","src","standby","start","style","summary","tabindex","target","text","title","type","usemap","valign","value","valuetype","version","vlink","vspace","width"],o.validAttribute=function(t){return-1!==jQuery.inArray(t,o.validAttributes)},o.cleanAttributes=function(t){return jQuery.each(t,function(e,i){o.validAttribute(e)||delete t[e]}),t},t.exports=o},function(t,e,i){function o(t,e,i,s,a){if(!i)return void r.logDebug("Missed undo model");n.call(this,t,e,!0,i,s),a?t.callbacks().subscribe(this,a):t.callbacks().subscribe(this,o.prototype.onActionCallback)}var n=i(320).Binding,r=i(7).getLogger("Chart.PropertyPage.ActionBinder");inherit(o,n),o.prototype.onActionCallback=function(t){this._undoModel.setProperty(this._property,this.value(),this._undoText)},o.prototype.value=function(){return this.control().checked},o.prototype.setValue=function(t){return this.control().checked=!!t},e.ActionBinder=o},function(t,e,i){"use strict";var o=function(){function t(t){switch(t){case"c67":case"m67":case"c45":return"copy";case"c86":case"m86":case"s45":return"paste";case"c88":case"m88":case"s46":return"cut"}}function e(t){var e=[];return t.shiftKey&&e.push("s"),t.ctrlKey&&e.push("c"),t.metaKey&&e.push("m"),t.altKey&&e.push("a"),e.push(t.keyCode),e.join("")}function i(t){var e=$.Event(u+":"+t);return $(window).trigger(e,{AppClipboard:_}),e}function o(o){var n,r,s;if((document.activeElement===document.body||document.activeElement===document.documentElement)&&(n=e(o),r=t(n))){if("keydown"===o.type)d[n]=!0;else if(d[n])return;if(document.getSelection){if(!document.getSelection().isCollapsed)return}else if(document.selection&&"None"!==document.selection.type)return;o.isDefaultPrevented()||(s=i(r),s.isDefaultPrevented()&&o.preventDefault())}}function n(t){t=t.originalEvent||t,t.key===h&&i("change")}function r(){p||($(document).on("keypress keydown",o),$(window).on("storage",n),p=!0)}function s(){$(document).off("keypress keydown",o),$(window).off("storage",n),$(window).off(u+":copy"),$(window).off(u+":paste"),$(window).off(u+":cut"),$(window).off(u+":change"),p=!1}
function a(){try{return JSON.parse(TVLocalStorage.getItem(h))}catch(t){return null}}function l(t){if(null==t)return c();var e=JSON.stringify(t);e!==TVLocalStorage.getItem(h)&&(TVLocalStorage.setItem(h,e),i("change"))}function c(){TVLocalStorage.getItem(h)&&(TVLocalStorage.removeItem(h),i("change"))}var h="application-clipboard",u="appclip",d={},p=!1,_={init:r,set:l,get:a,clear:c,destroy:s};return _}();t.exports=o},function(t,e,i){"use strict";var o=i(48);JSServer.studyLibrary=[{name:"Accumulation/Distribution",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Accumulation/Distribution",shortDescription:"Accum/Dist",is_price_study:!1,inputs:[],id:"Accumulation/Distribution@tv-basicstudies-1",scriptIdPart:"",name:"Accumulation/Distribution"},constructor:function(){this.f_0=function(t,e,i,n){return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.main=function(t,e){var i,n,r;return this._context=t,this._input=e,i=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),n=o.Std.cum(i,this._context),r=n,[r]}}},{name:"Accumulative Swing Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#3C78D8"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ASI",histogramBase:0,joinPoints:!1}},description:"Accumulative Swing Index",shortDescription:"ASI",is_price_study:!1,inputs:[{id:"in_0",name:"Limit Move Value",defval:10,type:"float",min:.1,max:1e5}],id:"Accumulative Swing Index@tv-basicstudies-1",scriptIdPart:"",name:"Accumulative Swing Index"},constructor:function(){this.f_0=function(t,e){var i=e.new_var(o.Std.open(e)),n=e.new_var(o.Std.high(e)),r=e.new_var(o.Std.low(e)),s=e.new_var(o.Std.close(e)),a=o.Std.abs(n-s.get(1)),l=o.Std.abs(r-s.get(1)),c=o.Std.abs(n-r),h=o.Std.abs(s.get(1)-i.get(1)),u=o.Std.max(a,l),d=o.Std.iff(a>=o.Std.max(l,c),a-.5*l+.25*h,o.Std.iff(l>=o.Std.max(a,c),l-.5*a+.25*h,c+.25*h));return o.Std.iff(0===d,0,(s-s.get(1)+.5*(s-i)+.25*(s.get(1)-i.get(1)))/d*u/t*50)},this.f_1=function(t,e){var i=this.f_0(t,e);return o.Std.cum(i,e)},this.main=function(t,e){var i,o;return this._context=t,this._input=e,i=this._input(0),o=this.f_1(i,this._context),[o]}}},{name:"Advance/Decline",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Advance/Decline",shortDescription:"AD",
is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Advance/Decline@tv-basicstudies-1",scriptIdPart:"",name:"Advance/Decline"},constructor:function(){this.f_0=function(t,e){return o.Std.gt(t,e)},this.f_1=function(t,e){return o.Std.lt(t,e)},this.f_2=function(t,e){return 0===e?t:t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=this.f_1(o.Std.close(this._context),o.Std.open(this._context)),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_2(s,c),u=h,[u]}}},{name:"Arnaud Legoux Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:.85,in_2:6}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Arnaud Legoux Moving Average",shortDescription:"ALMA",is_price_study:!0,inputs:[{id:"in_0",name:"Window Size",defval:9,type:"integer",min:0,max:5e3},{id:"in_1",name:"Offset",defval:.85,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"Sigma",defval:6,type:"float",min:-1e12,max:1e12}],id:"Arnaud Legoux Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Arnaud Legoux Moving Average"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.alma(a,n,r,s),[l]}}},{name:"Aroon",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF6A00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0094FF"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Aroon",shortDescription:"Aroon",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Aroon@tv-basicstudies-1",scriptIdPart:"",name:"Aroon"},constructor:function(){this.f_0=function(t,e){return 100*(t+e)/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),r=i+1,s=this._context.new_var(n),a=o.Std.highestbars(s,r,this._context),l=this.f_0(a,i),c=o.Std.low(this._context),h=this._context.new_var(c),u=o.Std.lowestbars(h,r,this._context),d=this.f_0(u,i),p=l,_=d,[p,_]}}},{name:"Average Directional Index",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,
color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ADX",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Average Directional Index",shortDescription:"ADX",is_price_study:!1,inputs:[{id:"in_0",name:"ADX Smoothing",defval:14,type:"integer",min:-1e12,max:1e12},{id:"in_1",name:"DI Length",defval:14,type:"integer",min:-1e12,max:1e12}],id:"average_directional_Index@tv-basicstudies-1",scriptIdPart:"",name:"Average Directional Index"},constructor:function(){this.f_0=function(t){var e=this._context.new_var(o.Std.high(this._context)),i=o.Std.change(e),n=this._context.new_var(o.Std.low(this._context)),r=-o.Std.change(n),s=this._context.new_var(o.Std.tr(void 0,this._context)),a=o.Std.rma(s,t,this._context),l=this._context.new_var(o.Std.and(o.Std.gt(i,r),o.Std.gt(i,0))?i:0),c=o.Std.fixnan(100*o.Std.rma(l,t,this._context)/a,this._context),h=this._context.new_var(o.Std.and(o.Std.gt(r,i),o.Std.gt(r,0))?r:0);return[c,o.Std.fixnan(100*o.Std.rma(h,t,this._context)/a,this._context)]},this.f_1=function(t,e){var i=this.f_0(t),n=i[0],r=i[1],s=n+r,a=this._context.new_var(o.Std.abs(n-r)/(o.Std.eq(s,0)?1:s));return[100*o.Std.rma(a,e,this._context)]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1(this._input(0),this._input(1))}}},{name:"Average True Range",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Average True Range",shortDescription:"ATR",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Average True Range@tv-basicstudies-1",scriptIdPart:"",name:"Average True Range"},constructor:function(){this.main=function(t,e){var i,n,r,s;return this._context=t,this._input=e,i=this._input(0),n=o.Std.tr(this._context),r=this._context.new_var(n),s=o.Std.rma(r,i,this._context),[s]}}},{name:"Awesome Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#FF0000",width:1,style:0},1:{color:"#008000",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Awesome Oscillator",shortDescription:"AO",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[],id:"Awesome Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Awesome Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t){return o.Std.le(t,0)?0:1},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,
i=o.Std.hl2(this._context),n=this._context.new_var(i),r=o.Std.sma(n,5,this._context),s=this._context.new_var(i),a=o.Std.sma(s,34,this._context),l=this.f_0(r,a),c=l,h=this._context.new_var(l),u=o.Std.change(h),d=this.f_1(u),[c,d]}}},{name:"Balance of Power",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Balance of Power",shortDescription:"Balance of Power",is_price_study:!1,inputs:[],id:"Balance of Power@tv-basicstudies-1",scriptIdPart:"",name:"Balance of Power"},constructor:function(){this.f_0=function(t,e,i,o){return(t-e)/(i-o)},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0(o.Std.close(this._context),o.Std.open(this._context),o.Std.high(this._context),o.Std.low(this._context))]}}},{name:"Bollinger Bands",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands",shortDescription:"BB",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=a,_=u,f=d,[p,_,f]}}},{name:"Bollinger Bands %B",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:1},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],filledAreasStyle:{fill_0:{color:"#008080",
transparency:90,visible:!0}},inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands %B",shortDescription:"BB %B",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands %B@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands %B"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/(i-e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(i,d,u),_=p,[_]}}},{name:"Bollinger Bands Width",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20,in_1:2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Bollinger Bands Width",shortDescription:"BBW",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"mult",defval:2,type:"float",min:.001,max:50}],id:"Bollinger Bands Width@tv-basicstudies-1",scriptIdPart:"",name:"Bollinger Bands Width"},constructor:function(){this.f_0=function(t,e){return t*e},this.f_1=function(t,e){return t+e},this.f_2=function(t,e){return t-e},this.f_3=function(t,e,i){return(t-e)/i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.stdev(l,n,this._context),h=this.f_0(r,c),u=this.f_1(a,h),d=this.f_2(a,h),p=this.f_3(u,d,a),_=p,[_]}}},{name:"Chaikin Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Money Flow",shortDescription:"CMF",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Chaikin Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Money Flow"},constructor:function(){this.f_0=function(t,e,i,n){
return o.Std.or(o.Std.and(o.Std.eq(t,e),o.Std.eq(t,i)),o.Std.eq(e,i))?0:(2*t-i-e)/(e-i)*n},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=o.Std.volume(this._context),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_1(s,c),u=h,[u]}}},{name:"Chaikin Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:3,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chaikin Oscillator",shortDescription:"Chaikin Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"short",defval:3,type:"integer",min:1,max:2e3},{id:"in_1",name:"long",defval:10,type:"integer",min:1,max:2e3}],id:"Chaikin Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chaikin Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.accdist(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Chande Kroll Stop",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10,in_1:1,in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Long",histogramBase:0,joinPoints:!1},plot_1:{title:"Short",histogramBase:0,joinPoints:!1}},description:"Chande Kroll Stop",shortDescription:"Chande Kroll Stop",is_price_study:!0,inputs:[{id:"in_0",name:"p",defval:10,type:"integer",min:1,max:4999},{id:"in_1",name:"x",defval:1,type:"integer",min:1,max:1e12},{id:"in_2",name:"q",defval:9,type:"integer",min:1,max:1e12}],id:"Chande Kroll Stop@tv-basicstudies-1",scriptIdPart:"",name:"Chande Kroll Stop"},constructor:function(){this.f_0=function(t,e,i){return t-e*i},this.f_1=function(t,e,i){return t+e*i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.high(this._context),a=this._context.new_var(s),l=o.Std.highest(a,i,this._context),c=o.Std.atr(i,this._context),h=this.f_0(l,n,c),u=this._context.new_var(s),d=o.Std.lowest(u,i,this._context),p=this.f_1(d,n,c),_=this._context.new_var(h),f=o.Std.highest(_,r,this._context),
m=this._context.new_var(p),g=o.Std.lowest(m,r,this._context),v=g,y=f,[v,y]}}},{name:"Chande Momentum Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Chande Momentum Oscillator",shortDescription:"ChandeMO",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:2e3}],id:"Chande Momentum Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Chande Momentum Oscillator"},constructor:function(){this.f_0=function(t){return o.Std.ge(t,0)?t:0},this.f_1=function(t){return o.Std.ge(t,0)?0:-t},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return this.f_2(t-e,t+e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(s),l=this.f_1(s),c=this._context.new_var(a),h=o.Std.sum(c,i,this._context),u=this._context.new_var(l),d=o.Std.sum(u,i,this._context),p=this.f_3(h,d),_=p,[_]}}},{name:"Chop Zone",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#34dddd",width:1,style:0},1:{color:"#006400",width:1,style:0},2:{color:"#98fb98",width:1,style:0},3:{color:"#00FF00",width:1,style:0},4:{color:"#8B0000",width:1,style:0},5:{color:"#FF0000",width:1,style:0},6:{color:"#FF7F00",width:1,style:0},7:{color:"#ffc04c",width:1,style:0},8:{color:"#FFFF00",width:1,style:0}}}},inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Chop Zone",shortDescription:"Chop Zone",is_price_study:!1,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"},2:{name:"Color 2"},3:{name:"Color 3"},4:{name:"Color 4"},5:{name:"Color 5"},6:{name:"Color 6"},7:{name:"Color 7"},8:{name:"Color 8"}},valToIndex:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8}}},inputs:[],id:"chop_zone@tv-basicstudies-1",scriptIdPart:"",name:"Chop Zone"},constructor:function(){this.f_0=function(){
var t=o.Std.close(this._context),e=o.Std.hlc3(this._context),i=this._context.new_var(o.Std.high(this._context)),n=o.Std.highest(i,30,this._context),r=o.Std.lowest(i,30,this._context),s=25/(n-r)*r,a=this._context.new_var(t),l=this._context.new_var(o.Std.ema(a,34,this._context)),c=(l.get(1)-l.get(0))/e*s,h=o.Std.sqrt(1+c*c),u=o.Std.round(180*o.Std.acos(1/h)/3.141592653589793),d=o.Std.iff(o.Std.gt(c,0),-u,u),p=o.Std.and(o.Std.gt(d,-2.14),o.Std.le(d,-.71))?7:8,_=o.Std.and(o.Std.gt(d,-3.57),o.Std.le(d,-2.14))?6:p,f=o.Std.and(o.Std.gt(d,-5),o.Std.le(d,-3.57))?5:_,m=o.Std.le(d,-5)?4:f,g=o.Std.and(o.Std.lt(d,2.14),o.Std.ge(d,.71))?3:m,v=o.Std.and(o.Std.lt(d,3.57),o.Std.ge(d,2.14))?2:g,y=o.Std.and(o.Std.lt(d,5),o.Std.ge(d,3.57))?1:v;return[1,o.Std.ge(d,5)?0:y]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Choppiness Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:61.8},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:38.2}],filledAreasStyle:{fill_0:{color:"#008000",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Choppiness Index",shortDescription:"CHOP",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Choppiness Index@tv-basicstudies-1",scriptIdPart:"",name:"Choppiness Index"},constructor:function(){this.f_0=function(t,e,i,n){return 100*o.Std.log10(t/(e-i))/n},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=this._input(0),n=o.Std.atr(1,this._context),r=this._context.new_var(n),s=o.Std.sum(r,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),c=o.Std.highest(l,i,this._context),h=o.Std.low(this._context),u=this._context.new_var(h),d=o.Std.lowest(u,i,this._context),p=o.Std.log10(i),_=this.f_0(s,c,d,p),f=_,[f]}}},{name:"Commodity Channel Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:100},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-100}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Commodity Channel Index",shortDescription:"CCI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",
objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Commodity Channel Index@tv-basicstudies-1",scriptIdPart:"",name:"Commodity Channel Index"},constructor:function(){this.f_0=function(t,e,i){return(t-e)/(.015*i)},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.sma(r,n,this._context),a=this._context.new_var(i),l=o.Std.dev(a,n,this._context),c=this.f_0(i,s,l),h=c,[h]}}},{name:"Connors RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:3,in_1:2,in_2:100}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"CRSI",histogramBase:0,joinPoints:!1}},description:"Connors RSI",shortDescription:"CRSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"RSI Length",defval:3,type:"integer",min:1},{id:"in_1",name:"UpDown Length",defval:2,type:"integer",min:1},{id:"in_2",name:"ROC Length",defval:100,type:"integer",min:1}],id:"Connors RSI@tv-basicstudies-1",scriptIdPart:"",name:"Connors RSI"},constructor:function(){this.f_1=function(t,e,i){var n=i.new_var(o.Std.max(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_2=function(t,e,i){var n=i.new_var(-o.Std.min(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_3=function(){var t=0;return function(e){var i=e.get(0),n=e.get(1);return t=i===n?0:i>n?o.Std.nz(t)<=0?1:o.Std.nz(t)+1:o.Std.nz(t)>=0?-1:o.Std.nz(t)-1,this._context.new_var(t)}}(),this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=this._input(0),s=this._input(1),a=this._input(2),l=o.Std.rsi(this.f_1(n,r,this._context),this.f_2(n,r,this._context)),c=this.f_3(n),h=o.Std.rsi(this.f_1(c,s,this._context),this.f_2(c,s,this._context)),u=this._context.new_var(o.Std.roc(n,1)),d=o.Std.percentrank(u,a),p=o.Std.avg(l,h,d),[p]}}},{name:"Coppock Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:14,in_2:11}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Coppock Curve",shortDescription:"Coppock Curve",is_price_study:!1,inputs:[{id:"in_0",name:"WMA Length",defval:10,type:"integer",min:-1e12,max:5e3},{id:"in_1",name:"Long RoC Length",defval:14,
type:"integer",min:1,max:4999},{id:"in_2",name:"Short RoC Length",defval:11,type:"integer",min:1,max:4999}],id:"Coppock Curve@tv-basicstudies-1",scriptIdPart:"",name:"Coppock Curve"},constructor:function(){this.f_0=function(t,e){return t+e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.roc(a,n),c=this._context.new_var(s),h=o.Std.roc(c,r),u=this.f_0(l,h),d=this._context.new_var(u),p=o.Std.wma(d,i,this._context),_=p,[_]}}},{name:"Correlation Coeff",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:40,visible:!0,color:"#800080"}},precision:4,inputs:{in_0:"AAPL",in_1:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Correlation Coefficient",shortDescription:"CC",is_price_study:!1,inputs:[{id:"in_0",name:"sym",defval:"AAPL",type:"symbol"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Correlation Coeff@tv-basicstudies-1",scriptIdPart:"",name:"Correlation Coeff"},constructor:function(){this.init=function(t,e){this._context=t,this._input=e,this._context.new_sym(this._input(0),o.Std.period(this._context),o.Std.period(this._context))},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._context.new_var(this._context.symbol.time),this._input(0),o.Std.period(this._context),n=o.Std.close(this._context),r=this._input(1),this._context.select_sym(1),s=this._context.new_var(this._context.symbol.time),a=o.Std.close(this._context),l=this._context.new_var(a),this._context.select_sym(0),c=l.adopt(s,i,0),h=this._context.new_var(n),u=this._context.new_var(c),d=o.Std.correlation(h,u,r,this._context),[d]}}},{name:"Detrended Price Oscillator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:21,in_1:!1}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"DPO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Detrended Price Oscillator",shortDescription:"DPO",is_price_study:!1,is_hidden_study:!1,id:"detrended_price_oscillator@tv-basicstudies-1",bands:[{id:"hline_0",name:"Zero",isHidden:!1}],inputs:[{id:"in_0",name:"Period",defval:21,type:"integer",min:1,max:1e12},{id:"in_1",name:"isCentered",defval:!1,type:"bool"}],scriptIdPart:"",name:"Detrended Price Oscillator"},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._input(1),i=Math.floor(t/2+1),n=this._context.new_var(o.Std.close(this._context)),r=this._context.new_var(o.Std.sma(n,t,this._context)),s=this._context.new_var(o.Std.close(this._context)),a=s.get(i)-r,l=o.Std.close(this._context)-r.get(i),c=e?a:l,h=-i;return[c,e?h:0]},
this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:i[1]}]}}},{name:"Directional Movement Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14,in_1:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"+DI",histogramBase:0,joinPoints:!1},plot_1:{title:"-DI",histogramBase:0,joinPoints:!1},plot_2:{title:"ADX",histogramBase:0,joinPoints:!1}},description:"Directional Movement",shortDescription:"DMI",is_price_study:!1,inputs:[{id:"in_0",name:"DI Length",defval:14,type:"integer",min:1,max:2e3},{id:"in_1",name:"ADX Smoothing",defval:14,type:"integer",min:1,max:50}],id:"Directional Movement Index@tv-basicstudies-1",scriptIdPart:"",name:"Directional Movement Index"},constructor:function(){this.f_0=function(t){return-t},this.f_1=function(t,e){return o.Std.and(o.Std.gt(t,e),o.Std.gt(t,0))?t:0},this.f_2=function(t,e){return 100*t/e},this.f_3=function(t,e){return t+e},this.f_4=function(t,e,i){return o.Std.abs(t-e)/(o.Std.eq(i,0)?1:i)},this.f_5=function(t){return 100*t},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.high(this._context),s=this._context.new_var(r),a=o.Std.change(s),l=o.Std.low(this._context),c=this._context.new_var(l),h=o.Std.change(c),u=this.f_0(h),d=o.Std.tr(this._context),p=this._context.new_var(d),_=o.Std.rma(p,i,this._context),f=this.f_1(a,u),m=this._context.new_var(f),g=o.Std.rma(m,i,this._context),v=this.f_2(g,_),y=o.Std.fixnan(v,this._context),b=this.f_1(u,a),S=this._context.new_var(b),w=o.Std.rma(S,i,this._context),T=this.f_2(w,_),C=o.Std.fixnan(T,this._context),x=this.f_3(y,C),P=this.f_4(y,C,x),L=this._context.new_var(P),I=o.Std.rma(L,n,this._context),k=this.f_5(I),A=y,M=C,E=k,[A,M,E]}}},{name:"Donchian Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Lower",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Basis",histogramBase:0,joinPoints:!1}},description:"Donchian Channels",
shortDescription:"DC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_0",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"length",defval:20,type:"integer",min:1,max:2e3}],id:"Donchian Channels@tv-basicstudies-1",scriptIdPart:"",name:"Donchian Channels"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=o.Std.low(this._context),r=this._context.new_var(n),s=o.Std.lowest(r,i,this._context),a=o.Std.high(this._context),l=this._context.new_var(a),c=o.Std.highest(l,i,this._context),h=o.Std.avg(c,s),u=s,d=c,p=h,[u,d,p]}}},{name:"Double Exponential Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Double EMA",shortDescription:"DEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Double Exponential Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Double Exponential Moving Average"},constructor:function(){this.f_0=function(t,e){return 2*t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this.f_0(s,l),h=c,[h]}}},{name:"Ease of Movement",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:1e4,in_1:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Ease Of Movement",shortDescription:"EOM",is_price_study:!1,inputs:[{id:"in_0",name:"Divisor",defval:1e4,type:"integer",min:1,max:1e9},{id:"in_1",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Ease of Movement@tv-basicstudies-1",scriptIdPart:"",name:"Ease of Movement"},constructor:function(){this.f_0=function(t,e,i,o,n){return t*e*(i-o)/n},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.hl2(this._context),s=this._context.new_var(r),a=o.Std.change(s),l=this.f_0(i,a,o.Std.high(this._context),o.Std.low(this._context),o.Std.volume(this._context)),c=this._context.new_var(l),h=o.Std.sma(c,n,this._context),u=h,[u]}}},{name:"Elders Force Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:13}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",
histogramBase:0,joinPoints:!1}},description:"Elder's Force Index",shortDescription:"EFI",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:13,type:"integer",min:1,max:2e3}],id:"Elders Force Index@tv-basicstudies-1",scriptIdPart:"",name:"Elders Force Index"},constructor:function(){this.f_0=function(t,e){return t*e},this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(s,o.Std.volume(this._context)),l=this._context.new_var(a),c=o.Std.ema(l,i,this._context),h=c,[h]}}},{name:"EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"EMA Cross",shortDescription:"EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"EMA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=a,u=c,d=o.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Envelope",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:20,in_1:10,in_2:!1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Median",histogramBase:0,joinPoints:!1},plot_1:{title:"Upper",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Envelope",shortDescription:"Env",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_1",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{
id:"in_1",name:"percent",defval:10,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"exponential",defval:!1,type:"bool"}],id:"Envelope@tv-basicstudies-1",scriptIdPart:"",name:"Envelope"},constructor:function(){this.f_0=function(t,e,i){return t?e:i},this.f_1=function(t,e){return t*(1+e)},this.f_2=function(t,e){return t*(1-e)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),c=this._context.new_var(i),h=o.Std.sma(c,n,this._context),u=this.f_0(s,l,h),d=r/100,p=this.f_1(u,d),_=this.f_2(u,d),f=u,m=p,g=_,[f,m,g]}}},{name:"Fisher Transform",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"}},precision:4,bands:[{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:1.5},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:0},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-.75},{color:"#FF7F00",linestyle:2,linewidth:1,visible:!0,value:-1.5}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Fisher",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Trigger",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Fisher Transform",shortDescription:"Fisher",is_price_study:!1,bands:[{id:"hline_0",name:"Level",isHidden:!1},{id:"hline_1",name:"Level",isHidden:!1},{id:"hline_2",name:"Level",isHidden:!1},{id:"hline_3",name:"Level",isHidden:!1},{id:"hline_4",name:"Level",isHidden:!1}],inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e12}],id:"fisher_transform@tv-basicstudies-1",scriptIdPart:"",name:"Fisher Transform"},constructor:function(){this.f_0=function(t){var e=o.Std.lt(t,-.99)?-.999:t;return[o.Std.gt(t,.99)?.999:e]},this.f_1=function(){var t,e,i,n=this._input(0),r=this._context.new_var(o.Std.hl2(this._context)),s=o.Std.highest(r,n,this._context),a=this._context.new_var(o.Std.hl2(this._context)),l=o.Std.lowest(a,n,this._context),c=this._context.new_var(),h=this.f_0(.66*((o.Std.hl2(this._context)-l)/o.Std.max(s-l,.001)-.5)+.67*o.Std.nz(c.get(1)));return c.set(h[0]),t=this._context.new_var(),t.set(.5*o.Std.log((1+c.get(0))/o.Std.max(1-c.get(0),.001))+.5*o.Std.nz(t.get(1))),e=t.get(1),i=t.get(0),[i,e]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1()}}},{name:"Historical Volatility",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},
description:"Historical Volatility",shortDescription:"HV",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:1e12}],id:"historical_volatility@tv-basicstudies-1",scriptIdPart:"",name:"Historical Volatility"},constructor:function(){this.f_0=function(){var t=this._input(0),e=o.Std.or(o.Std.isintraday(this._context),o.Std.and(o.Std.isdaily(this._context),o.Std.eq(o.Std.interval(this._context),1)))?1:7,i=this._context.new_var(o.Std.close(this._context)),n=this._context.new_var(o.Std.log(o.Std.close(this._context)/i.get(1)));return[100*o.Std.stdev(n,t,this._context)*o.Std.sqrt(365/e)]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Hull MA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Hull Moving Average",shortDescription:"HMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Hull MA@tv-basicstudies-1",scriptIdPart:"",name:"Hull MA"},constructor:function(){this.f_0=function(t,e){return 2*t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=n/2,s=this._context.new_var(i),a=o.Std.wma(s,r,this._context),l=this._context.new_var(i),c=o.Std.wma(l,n,this._context),h=this.f_0(a,c),u=o.Std.sqrt(n),d=o.Std.round(u),p=this._context.new_var(h),_=o.Std.wma(p,d,this._context),f=_,[f]}}},{name:"Ichimoku Cloud",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496ff"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#991515"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"},plot_3:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_4:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:1,style:0},1:{color:"#FF0000",width:1,style:0}}}},filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:9,in_1:26,in_2:52,in_3:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"},{id:"plot_3",type:"line"},{id:"plot_4",type:"line"},{id:"plot_5",palette:"palette_0",target:"fill_0",type:"colorer"}],styles:{plot_0:{title:"Conversion Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"Base Line",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Lagging Span",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Lead 1",histogramBase:0,joinPoints:!1,isHidden:!1},plot_4:{title:"Lead 2",histogramBase:0,joinPoints:!1,
isHidden:!1}},description:"Ichimoku Cloud",shortDescription:"Ichimoku",is_price_study:!0,is_hidden_study:!1,id:"Ichimoku Cloud@tv-basicstudies-1",palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},filledAreas:[{id:"fill_0",objAId:"plot_3",objBId:"plot_4",type:"plot_plot",title:"Plots Background",isHidden:!1,palette:"palette_0"}],inputs:[{id:"in_0",name:"Conversion Line Periods",defval:9,type:"integer",min:1,max:1e12},{id:"in_1",name:"Base Line Periods",defval:26,type:"integer",min:1,max:1e12},{id:"in_2",name:"Lagging Span 2 Periods",defval:52,type:"integer",min:1,max:1e12},{id:"in_3",name:"Displacement",defval:26,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"Ichimoku Cloud"},constructor:function(){this.donchian=function(t){var e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.high(this._context));return o.Std.avg(o.Std.lowest(e,t,this._context),o.Std.highest(i,t,this._context))},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._input(3),r=this.donchian(t),s=this.donchian(e),a=o.Std.avg(r,s),l=this.donchian(i);return[r,s,o.Std.close(this._context),a,l,-n,n,n,o.Std.gt(a,l)?0:1]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_1();return[i[0],i[1],{value:i[2],offset:i[5]},{value:i[3],offset:i[6]},{value:i[4],offset:i[7]},i[8]]}}},{name:"Keltner Channels",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,filledAreasStyle:{fill_0:{color:"#0000FF",transparency:90,visible:!0}},inputs:{in_0:!0,in_1:20,in_2:1}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Middle",histogramBase:0,joinPoints:!1},plot_2:{title:"Lower",histogramBase:0,joinPoints:!1}},description:"Keltner Channels",shortDescription:"KC",is_price_study:!0,filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_2",type:"plot_plot",title:"Plots Background"}],inputs:[{id:"in_0",name:"useTrueRange",defval:!0,type:"bool"},{id:"in_1",name:"length",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"mult",defval:1,type:"float",min:-1e12,max:1e12}],id:"Keltner Channels@tv-basicstudies-1",scriptIdPart:"",name:"Keltner Channels"},constructor:function(){this.f_0=function(t,e,i,o){return t?e:i-o},this.f_1=function(t,e,i){return t+e*i},this.f_2=function(t,e,i){return t-e*i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._context.new_var(i),l=o.Std.ema(a,r,this._context),
c=this.f_0(n,o.Std.tr(this._context),o.Std.high(this._context),o.Std.low(this._context)),h=this._context.new_var(c),u=o.Std.ema(h,r,this._context),d=this.f_1(l,u,s),p=this.f_2(l,u,s),_=d,f=l,m=p,[_,f,m]}}},{name:"Klinger Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Klinger Oscillator",shortDescription:"Klinger Oscillator",is_price_study:!1,inputs:[],id:"Klinger Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Klinger Oscillator"},constructor:function(){this.f_0=function(t,e){return o.Std.ge(t,0)?e:-e},this.f_1=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=o.Std.hlc3(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context)),a=this._context.new_var(s),l=o.Std.ema(a,34,this._context),c=this._context.new_var(s),h=o.Std.ema(c,55,this._context),u=this.f_1(l,h),d=this._context.new_var(u),p=o.Std.ema(d,13,this._context),_=u,f=p,[_,f]}}},{name:"Know Sure Thing",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:10,in_1:15,in_2:20,in_3:30,in_4:10,in_5:10,in_6:10,in_7:15,in_8:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"KST",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Know Sure Thing",shortDescription:"KST",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"roclen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"roclen2",defval:15,type:"integer",min:1,max:2e3},{id:"in_2",name:"roclen3",defval:20,type:"integer",min:1,max:2e3},{id:"in_3",name:"roclen4",defval:30,type:"integer",min:1,max:2e3},{id:"in_4",name:"smalen1",defval:10,type:"integer",min:1,max:2e3},{id:"in_5",name:"smalen2",defval:10,type:"integer",min:1,max:2e3},{id:"in_6",name:"smalen3",defval:10,type:"integer",min:1,max:2e3},{id:"in_7",name:"smalen4",defval:15,type:"integer",min:1,max:2e3},{id:"in_8",name:"siglen",defval:9,type:"integer",min:1,max:2e3}],id:"Know Sure Thing@tv-basicstudies-1",scriptIdPart:"",name:"Know Sure Thing"},constructor:function(){this.f_0=function(t,e,i,o){return t+2*e+3*i+4*o},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W
;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=this._input(3),a=this._input(4),l=this._input(5),c=this._input(6),h=this._input(7),u=this._input(8),d=o.Std.close(this._context),p=i,_=this._context.new_var(d),f=o.Std.roc(_,p),m=a,g=this._context.new_var(f),v=o.Std.sma(g,m,this._context),y=n,b=this._context.new_var(d),S=o.Std.roc(b,y),w=l,T=this._context.new_var(S),C=o.Std.sma(T,w,this._context),x=r,P=this._context.new_var(d),L=o.Std.roc(P,x),I=c,k=this._context.new_var(L),A=o.Std.sma(k,I,this._context),M=s,E=this._context.new_var(d),D=o.Std.roc(E,M),V=h,O=this._context.new_var(D),R=o.Std.sma(O,V,this._context),B=this.f_0(v,C,A,R),z=this._context.new_var(B),F=o.Std.sma(z,u,this._context),N=B,W=F,[N,W]}}},{name:"Least Squares Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:25,in_1:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Least Squares Moving Average",shortDescription:"LSMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:25,type:"integer",min:1,max:1e12},{id:"in_1",name:"Offset",defval:0,type:"integer",min:-1e12,max:1e12}],id:"Least Squares Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Least Squares Moving Average"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.linreg(s,i,n),l=a,[l]}}},{name:"Linear Regression Curve",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Linear Regression Curve",shortDescription:"LRC",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3}],id:"Linear Regression Curve@tv-basicstudies-1",scriptIdPart:"",name:"Linear Regression Curve"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.linreg(r,n,0),a=s,[a]}}},{name:"MA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:9,in_1:26}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Short",
histogramBase:0,joinPoints:!1},plot_1:{title:"Long",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA Cross",shortDescription:"MA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Short",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Long",defval:26,type:"integer",min:1,max:2e3}],id:"MA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.sma(s,i,this._context),l=this._context.new_var(r),c=o.Std.sma(l,n,this._context),h=a,u=c,d=o.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"MA with EMA Cross",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_2:{linestyle:0,linewidth:4,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"MA",histogramBase:0,joinPoints:!1},plot_1:{title:"EMA",histogramBase:0,joinPoints:!1},plot_2:{title:"Crosses",histogramBase:0,joinPoints:!1}},description:"MA with EMA Cross",shortDescription:"MA/EMA Cross",is_price_study:!0,inputs:[{id:"in_0",name:"Length MA",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Length EMA",defval:10,type:"integer",min:1,max:2e3}],id:"MA with EMA Cross@tv-basicstudies-1",scriptIdPart:"",name:"MA with EMA Cross"},constructor:function(){this.f_0=function(t,e){return t?e:o.Std.na()},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.close(this._context),s=this._context.new_var(r),a=o.Std.sma(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=a,u=c,d=o.Std.cross(a,c,this._context),p=this.f_0(d,a),[h,u,p]}}},{name:"Mass Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Mass Index",shortDescription:"Mass Index",is_price_study:!1,inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Mass Index@tv-basicstudies-1",scriptIdPart:"",name:"Mass Index"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),
r=this._context.new_var(n),s=o.Std.ema(r,9,this._context),a=this._context.new_var(s),l=o.Std.ema(a,9,this._context),c=this.f_1(s,l),h=this._context.new_var(c),u=o.Std.sum(h,i,this._context),d=u,[d]}}},{name:"McGinley Dynamic",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"McGinley Dynamic",shortDescription:"McGinley Dynamic",is_price_study:!0,is_hidden_study:!1,id:"mcginley_dynamic@tv-basicstudies-1",inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e12}],scriptIdPart:"",name:"McGinley Dynamic"},constructor:function(){this.f_0=function(){var t,e=this._input(0),i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.ema(n,e,this._context),s=this._context.new_var(),a=s.get(1)+(i-s.get(1))/(e*o.Std.pow(i/s.get(1),4));return s.set(o.Std.na(s.get(1))?r:a),t=s.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Momentum",metainfo:{_metainfoVersion:30,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#808000"}},precision:4,inputs:{in_0:10,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Mom",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Momentum",shortDescription:"Mom",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"Momentum@tv-basicstudies-1",scriptIdPart:"",name:"Momentum"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=this._input(0),n=o.Std[this._input(1)](this._context),r=this._context.new_var(n),s=r.get(i),a=s?n-s:null,[a]}}},{name:"Money Flow",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#459915"}},precision:4,bands:[{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#c0c0c0",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#9915ff",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Money Flow",shortDescription:"MFI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Money Flow@tv-basicstudies-1",scriptIdPart:"",name:"Money Flow"},constructor:function(){this.f_0=function(t,e,i){
return t*(o.Std.le(e,0)?0:i)},this.f_1=function(t,e,i){return t*(o.Std.ge(e,0)?0:i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=o.Std.hlc3(this._context),r=this._context.new_var(n),s=o.Std.change(r),a=this.f_0(o.Std.volume(this._context),s,n),l=this._context.new_var(a),c=o.Std.sum(l,i,this._context),h=this.f_1(o.Std.volume(this._context),s,n),u=this._context.new_var(h),d=o.Std.sum(u,i,this._context),p=o.Std.rsi(c,d),_=p,[_]}}},{name:"Moving Average",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average",shortDescription:"MA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#CC0000"}},precision:4,filledAreasStyle:{fill_0:{color:"#A2C4C9",transparency:90,visible:!0}},inputs:{in_0:20,in_1:20,in_2:0,in_3:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Upper",histogramBase:0,joinPoints:!1},plot_1:{title:"Lower",histogramBase:0,joinPoints:!1}},filledAreas:[{id:"fill_0",objAId:"plot_0",objBId:"plot_1",type:"plot_plot",title:"Plots Background"}],description:"Moving Average Channel",shortDescription:"MAC",is_price_study:!0,inputs:[{id:"in_0",name:"Upper Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_1",name:"Lower Length",defval:20,type:"integer",min:1,max:1e4},{id:"in_2",name:"Upper Offset",defval:0,type:"integer",min:-1e4,max:1e4},{id:"in_3",name:"Lower Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Channel@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Channel"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=o.Std.high(this._context),n=o.Std.low(this._context),r=this._input(0),s=this._input(1),a=this._input(2),l=this._input(3),c=this._context.new_var(i),h=this._context.new_var(n),u=o.Std.sma(c,r,this._context),d=o.Std.sma(h,s,this._context),
[{value:u,offset:a},{value:d,offset:l}]}}},{name:"Moving Average Convergence/Divergence",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:12,in_1:26,in_3:"close",in_2:9}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Histogram",histogramBase:0,joinPoints:!1},plot_1:{title:"MACD",histogramBase:0,joinPoints:!1},plot_2:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"MACD",shortDescription:"MACD",is_price_study:!1,inputs:[{id:"in_0",name:"fastLength",defval:12,type:"integer",min:1,max:2e3},{id:"in_1",name:"slowLength",defval:26,type:"integer",min:1,max:2e3},{id:"in_3",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"signalLength",defval:9,type:"integer",min:1,max:50}],id:"Moving Average Convergence/Divergence@tv-basicstudies-1",scriptIdPart:"",name:"MACD"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g;return this._context=t,this._input=e,i=o.Std[this._input(2)](this._context),n=this._input(0),r=this._input(1),s=this._input(3),a=this._context.new_var(i),l=o.Std.ema(a,n,this._context),c=this._context.new_var(i),h=o.Std.ema(c,r,this._context),u=this.f_0(l,h),d=this._context.new_var(u),p=o.Std.ema(d,s,this._context),_=this.f_0(u,p),f=_,m=u,g=p,[f,m,g]}}},{name:"Moving Average Exponential",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Exponential",shortDescription:"EMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:1e4},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Exponential@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Exponential"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.ema(s,n,this._context),l=a,[{value:l,offset:r}]}}},{name:"Moving Average Weighted",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},
precision:4,inputs:{in_0:9,in_1:"close",in_2:0}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Moving Average Weighted",shortDescription:"WMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:9,type:"integer",min:1,max:2e3},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]},{id:"in_2",name:"Offset",defval:0,type:"integer",min:-1e4,max:1e4}],id:"Moving Average Weighted@tv-basicstudies-1",scriptIdPart:"",name:"Moving Average Weighted"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std[this._input(1)](this._context),n=this._input(0),r=this._input(2),s=this._context.new_var(i),a=o.Std.wma(s,n,this._context),l=a,[{value:l,offset:r}]}}},{name:"Net Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Net Volume",shortDescription:"Net Volume",is_price_study:!1,inputs:[],id:"Net Volume@tv-basicstudies-1",scriptIdPart:"",name:"Net Volume"},constructor:function(){this.f_0=function(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context),r),a=s,[a]}}},{name:"On Balance Volume",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"On Balance Volume",shortDescription:"OBV",is_price_study:!1,inputs:[],id:"On Balance Volume@tv-basicstudies-1",scriptIdPart:"",name:"On Balance Volume"},constructor:function(){this.f_0=function(t,e,i){return o.Std.gt(t,0)?e:o.Std.lt(i,0)?-e:0*e},this.main=function(t,e){var i,n,r,s,a,l;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._context.new_var(i),r=o.Std.change(n),s=this.f_0(r,o.Std.volume(this._context),r),a=o.Std.cum(s,this._context),l=a,[l]}}},{name:"Parabolic SAR",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:3,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:.02,in_1:.02,in_2:.2}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Parabolic SAR",shortDescription:"SAR",is_price_study:!0,inputs:[{id:"in_0",name:"start",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_1",name:"increment",defval:.02,type:"float",min:-1e12,max:1e12},{id:"in_2",name:"maximum",
defval:.2,type:"float",min:-1e12,max:1e12}],id:"Parabolic SAR@tv-basicstudies-1",scriptIdPart:"",name:"Parabolic SAR"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.sar(i,n,r,this._context),a=s,[a]}}},{name:"Price Channel",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0080"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0496FF"}},precision:4,inputs:{in_0:20,in_1:0}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Highprice Line",histogramBase:0,joinPoints:!1},plot_1:{title:"Lowprice Line",histogramBase:0,joinPoints:!1},plot_2:{title:"Centerprice Line",histogramBase:0,joinPoints:!1}},description:"Price Channel",shortDescription:"PC",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:20,type:"integer",min:1,max:2e3},{id:"in_1",name:"Offset Length",defval:0,type:"integer",min:1,max:2e3}],id:"Price Channel@tv-basicstudies-1",scriptIdPart:"",name:"Price Channel"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=o.Std.high(this._context),n=this._context.new_var(i),r=o.Std.low(this._context),s=this._context.new_var(r),a=this._input(0),l=this._input(1),c=o.Std.highest(n,a,this._context),h=o.Std.lowest(s,a,this._context),u=o.Std.avg(c,h),[{value:c,offset:l},{value:h,offset:l},{value:u,offset:l}]}}},{name:"Price Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:10,in_1:21}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Price Oscillator",shortDescription:"PPO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:10,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:21,type:"integer",min:1,max:2e3}],id:"Price Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Price Oscillator"},constructor:function(){this.f_0=function(t,e){return(t-e)/e*100},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._context.new_var(i),a=o.Std.sma(s,n,this._context),l=this._context.new_var(i),c=o.Std.sma(l,r,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Price Volume Trend",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"PVT",histogramBase:0,
joinPoints:!1,isHidden:!1}},description:"Price Volume Trend",shortDescription:"PVT",is_price_study:!1,is_hidden_study:!1,id:"price_volume_trend@tv-basicstudies-1",inputs:[],scriptIdPart:"",name:"Price Volume Trend"},constructor:function(){this.f_0=function(){var t=this._context.new_var(o.Std.close(this._context));return[o.Std.cum(o.Std.change(t)/t.get(1)*o.Std.volume(this._context),this._context)]},this.main=function(t,e){return this._context=t,this._input=e,[this.f_0()[0]]}}},{name:"Rate Of Change",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"ROC",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Rate Of Change",shortDescription:"ROC",is_price_study:!1,bands:[{id:"hline_0",name:"Zero Line",isHidden:!1}],inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e12}],id:"rate_of_change@tv-basicstudies-1",scriptIdPart:"",name:"Rate Of Change"},constructor:function(){this.main=function(t,e){var i,n,r;return this._context=t,this._input=e,i=this._context.new_var(o.Std.close(this._context)),n=this._input(0),r=100*(i.get(0)-i.get(n))/i.get(n),[r]}}},{name:"Relative Strength Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:70},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:30}],filledAreasStyle:{fill_0:{color:"#800080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Strength Index",shortDescription:"RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"Length",defval:14,type:"integer",min:1,max:2e3}],id:"Relative Strength Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Strength Index"},constructor:function(){this.f_0=function(t){return o.Std.max(t,0)},this.f_1=function(t){return-o.Std.min(t,0)},this.f_2=function(t,e){return o.Std.eq(t,0)?100:o.Std.eq(e,0)?0:100-100/(1+e/t)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.change(r),a=this.f_0(s),l=this._context.new_var(a),c=o.Std.rma(l,n,this._context),h=this.f_1(s),u=this._context.new_var(h),d=o.Std.rma(u,n,this._context),p=this.f_2(d,c),_=p,[_]}}},{name:"Relative Vigor Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,
linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"RVGI",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1}},description:"Relative Vigor Index",shortDescription:"RVGI",is_price_study:!1,inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Vigor Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Vigor Index"},constructor:function(){this.f_0=function(t,e){return t-e},this.f_1=function(t,e){return t/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context),o.Std.open(this._context)),r=this._context.new_var(n),s=o.Std.swma(r,this._context),a=this._context.new_var(s),l=o.Std.sum(a,i,this._context),c=this.f_0(o.Std.high(this._context),o.Std.low(this._context)),h=this._context.new_var(c),u=o.Std.swma(h,this._context),d=this._context.new_var(u),p=o.Std.sum(d,i,this._context),_=this.f_1(l,p),f=this._context.new_var(_),m=o.Std.swma(f,this._context),g=_,v=m,[g,v]}}},{name:"Relative Volatility Index",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#808000",transparency:90,visible:!0}},inputs:{in_0:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Relative Volatility Index",shortDescription:"RVI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:10,type:"integer",min:1,max:2e3}],id:"Relative Volatility Index@tv-basicstudies-1",scriptIdPart:"",name:"Relative Volatility Index"},constructor:function(){this.f_0=function(t,e){return o.Std.le(t,0)?0:e},this.f_1=function(t,e){return o.Std.gt(t,0)?0:e},this.f_2=function(t,e){return t/(t+e)*100},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.stdev(r,i,this._context),a=this._context.new_var(n),l=o.Std.change(a),c=this.f_0(l,s),h=this._context.new_var(c),u=o.Std.ema(h,14,this._context),d=this.f_1(l,s),p=this._context.new_var(d),_=o.Std.ema(p,14,this._context),f=this.f_2(u,_),m=f,[m]}}},{name:"SMI Ergodic Indicator/Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,
transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF7F00"},plot_2:{linestyle:0,linewidth:1,plottype:1,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:5,in_1:20,in_2:5}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Indicator",histogramBase:0,joinPoints:!1},plot_1:{title:"Signal",histogramBase:0,joinPoints:!1},plot_2:{title:"Oscillator",histogramBase:0,joinPoints:!1}},description:"SMI Ergodic Indicator/Oscillator",shortDescription:"SMIIO",is_price_study:!1,inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:2e3},{id:"in_1",name:"longlen",defval:20,type:"integer",min:1,max:2e3},{id:"in_2",name:"siglen",defval:5,type:"integer",min:1,max:2e3}],id:"SMI Ergodic Indicator/Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"SMI Ergodic Indicator/Oscillator"},constructor:function(){this.f_0=function(t,e){return t-e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.tsi(a,i,n,this._context),c=this._context.new_var(l),h=o.Std.ema(c,r,this._context),u=this.f_0(l,h),d=l,p=h,_=u,[d,p,_]}}},{name:"Smoothed Moving Average",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:"close"}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Smoothed Moving Average",shortDescription:"SMMA",is_price_study:!0,inputs:[{id:"in_0",name:"Length",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"Source",defval:"close",type:"source",options:["open","high","low","close","hl2","hlc3","ohlc4"]}],id:"smoothed_moving_average@tv-basicstudies-1",scriptIdPart:"",name:"Smoothed Moving Average"},constructor:function(){this.f_0=function(){var t,e=this._input(0),i=o.Std[this._input(1)](this._context),n=this._context.new_var(i),r=o.Std.sma(n,e,this._context),s=this._context.new_var(),a=(s.get(1)*(e-1)+i)/e;return s.set(o.Std.na(s.get(1))?r:a),t=s.get(0),[t]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{name:"Stochastic",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:75,visible:!0}},inputs:{in_0:14,in_1:1,in_2:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{
plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic",shortDescription:"Stoch",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"smoothK",defval:1,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=o.Std.high(this._context),l=o.Std.low(this._context),c=this._context.new_var(s),h=this._context.new_var(a),u=this._context.new_var(l),d=o.Std.stoch(c,h,u,i,this._context),p=this._context.new_var(d),_=o.Std.sma(p,n,this._context),f=this._context.new_var(_),m=o.Std.sma(f,r,this._context),g=_,v=m,[g,v]}}},{name:"Stochastic RSI",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:80},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:20}],filledAreasStyle:{fill_0:{color:"#800080",transparency:80,visible:!0}},inputs:{in_0:14,in_1:14,in_2:3,in_3:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"%K",histogramBase:0,joinPoints:!1},plot_1:{title:"%D",histogramBase:0,joinPoints:!1}},description:"Stochastic RSI",shortDescription:"Stoch RSI",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"lengthRSI",defval:14,type:"integer",min:1,max:1e4},{id:"in_1",name:"lengthStoch",defval:14,type:"integer",min:1,max:1e4},{id:"in_2",name:"smoothK",defval:3,type:"integer",min:1,max:1e4},{id:"in_3",name:"smoothD",defval:3,type:"integer",min:1,max:1e4}],id:"Stochastic RSI@tv-basicstudies-1",scriptIdPart:"",name:"Stochastic RSI"},constructor:function(){this.f_1=function(t,e,i){var n=i.new_var(o.Std.max(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.f_2=function(t,e,i){var n=i.new_var(-o.Std.min(o.Std.change(t),0));return o.Std.rma(n,e,i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._input(1),s=this._input(2),a=this._input(3),l=this._context.new_var(i),c=o.Std.rsi(this.f_1(l,n,this._context),this.f_2(l,n,this._context)),h=this._context.new_var(c),u=this._context.new_var(c),
d=this._context.new_var(c),p=o.Std.stoch(h,u,d,r,this._context),_=this._context.new_var(p),f=o.Std.sma(_,s,this._context),m=this._context.new_var(f),g=o.Std.sma(m,a,this._context),v=f,y=g,[v,y]}}},{name:"TRIX",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:18}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"TRIX",histogramBase:0,joinPoints:!1}},description:"TRIX",shortDescription:"TRIX",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"length",defval:18,type:"integer",min:1,max:2e3}],id:"TRIX@tv-basicstudies-1",scriptIdPart:"",name:"TRIX"},constructor:function(){this.f_0=function(t){return o.Std.log(t)},this.f_1=function(t){return 1e4*t},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_;return this._context=t,this._input=e,i=this._input(0),n=this.f_0(o.Std.close(this._context)),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(l),h=o.Std.ema(c,i,this._context),u=this._context.new_var(h),d=o.Std.change(u),p=this.f_1(d),_=p,[_]}}},{name:"Triple EMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:9}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Triple EMA",shortDescription:"TEMA",is_price_study:!0,inputs:[{id:"in_0",name:"length",defval:9,type:"integer",min:1,max:1e4}],id:"Triple EMA@tv-basicstudies-1",scriptIdPart:"",name:"Triple EMA"},constructor:function(){this.f_0=function(t,e,i){return 3*(t-e)+i},this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d;return this._context=t,this._input=e,i=this._input(0),n=o.Std.close(this._context),r=this._context.new_var(n),s=o.Std.ema(r,i,this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(l),h=o.Std.ema(c,i,this._context),u=this.f_0(s,l,h),d=u,[d]}}},{name:"True Strength Indicator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:25,in_1:13,in_2:13}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1},plot_1:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"True Strength Indicator",shortDescription:"True Strength Indicator",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"long",defval:25,
type:"integer",min:1,max:4999},{id:"in_1",name:"short",defval:13,type:"integer",min:1,max:4999},{id:"in_2",name:"siglen",defval:13,type:"integer",min:1,max:4999}],id:"True Strength Indicator@tv-basicstudies-1",scriptIdPart:"",name:"True Strength Indicator"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.close(this._context),a=this._context.new_var(s),l=o.Std.tsi(a,n,i,this._context),c=l,h=this._context.new_var(c),[c,o.Std.ema(h,r,this._context)]}}},{name:"Ultimate Oscillator",metainfo:{_metainfoVersion:41,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:7,in_1:14,in_2:28}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"UO",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Ultimate Oscillator",shortDescription:"UO",is_price_study:!1,inputs:[{id:"in_0",name:"length7",defval:7,type:"integer",min:1,max:1e12},{id:"in_1",name:"length14",defval:14,type:"integer",min:1,max:1e12},{id:"in_2",name:"length28",defval:28,type:"integer",min:1,max:1e12}],id:"ultimate_oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Ultimate Oscillator"},constructor:function(){this.f_0=function(t,e,i){var n=this._context.new_var(t),r=this._context.new_var(e);return[o.Std.sum(n,i,this._context)/o.Std.sum(r,i,this._context)]},this.f_1=function(){var t=this._input(0),e=this._input(1),i=this._input(2),n=this._context.new_var(o.Std.close(this._context)),r=o.Std.max(o.Std.high(this._context),n.get(1)),s=this._context.new_var(o.Std.close(this._context)),a=o.Std.min(o.Std.low(this._context),s.get(1)),l=o.Std.close(this._context)-a,c=r-a,h=this.f_0(l,c,t),u=this.f_0(l,c,e),d=this.f_0(l,c,i);return[100*(4*h[0]+2*u[0]+d[0])/7]},this.main=function(t,e){return this._context=t,this._input=e,this.f_1()}}},{name:"VWAP",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:0,transparency:0,visible:!0,color:"#3A6CA8"}},precision:4},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"VWAP",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"VWAP",shortDescription:"VWAP",is_price_study:!0,inputs:[],id:"VWAP@tv-basicstudies-1",scriptIdPart:"",name:"VWAP"},constructor:function(){this.f_1=function(t){t.hist=null,t.add_hist()},this.init=function(t,e){this._isNewSession=o.Std.createNewSessionCheck(t)},this.main=function(t,e){var i,n,r,s;return this._context=t,this._input=e,i=t.new_var(),n=t.new_var(),this._context.symbol.time&&(r=this._context.symbol.time,this._isNewSession(r)&&(this.f_1(i),this.f_1(n))),i.set(o.Std.nz(i.get(1))+o.Std.hlc3(this._context)*o.Std.volume(this._context)),n.set(o.Std.nz(n.get(1))+o.Std.volume(this._context)),s=i.get(0)/n.get(0),[s]}}},{name:"VWMA",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{
linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"}},precision:4,inputs:{in_0:20}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"VWMA",shortDescription:"VWMA",is_price_study:!0,inputs:[{id:"in_0",name:"len",defval:20,type:"integer",min:1,max:1e4}],id:"VWMA@tv-basicstudies-1",scriptIdPart:"",name:"VWMA"},constructor:function(){this.main=function(t,e){var i,n,r,s,a;return this._context=t,this._input=e,i=o.Std.close(this._context),n=this._input(0),r=this._context.new_var(i),s=o.Std.vwma(r,n,this._context),a=s,[a]}}},{name:"Volume Oscillator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:0}],inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Volume Oscillator",shortDescription:"Volume Osc",is_price_study:!1,bands:[{id:"hline_0",name:"Zero"}],inputs:[{id:"in_0",name:"shortlen",defval:5,type:"integer",min:1,max:4999},{id:"in_1",name:"longlen",defval:10,type:"integer",min:1,max:4999}],id:"Volume Oscillator@tv-basicstudies-1",scriptIdPart:"",name:"Volume Oscillator"},constructor:function(){this.f_0=function(t,e){return 100*(t-e)/e},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=o.Std.volume(this._context),s=this._context.new_var(r),a=o.Std.ema(s,i,this._context),l=this._context.new_var(r),c=o.Std.ema(l,n,this._context),h=this.f_0(a,c),u=h,[u]}}},{name:"Vortex Indicator",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"}},precision:4,inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"}],styles:{plot_0:{title:"VI +",histogramBase:0,joinPoints:!1,isHidden:!1},plot_1:{title:"VI -",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"Vortex Indicator",shortDescription:"VI",is_price_study:!1,is_hidden_study:!1,id:"vortex_indicator@tv-basicstudies-1",inputs:[{id:"in_0",name:"Period",defval:14,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Vortex Indicator"},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._context.new_var(o.Std.low(this._context)),i=this._context.new_var(o.Std.abs(o.Std.high(this._context)-e.get(1))),n=o.Std.sum(i,t,this._context),r=this._context.new_var(o.Std.high(this._context)),s=this._context.new_var(o.Std.abs(o.Std.low(this._context)-r.get(1))),a=o.Std.sum(s,t,this._context),l=this._context.new_var(o.Std.atr(1,this._context)),c=o.Std.sum(l,t,this._context);return[n/c,a/c]},this.main=function(t,e){return this._context=t,this._input=e,this.f_0()}}},{
name:"Willams %R",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"}},precision:4,bands:[{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-20},{color:"#808080",linestyle:2,linewidth:1,visible:!0,value:-80}],filledAreasStyle:{fill_0:{color:"#000080",transparency:90,visible:!0}},inputs:{in_0:14}},plots:[{id:"plot_0",type:"line"}],styles:{plot_0:{title:"Plot",histogramBase:0,joinPoints:!1}},description:"Williams %R",shortDescription:"%R",is_price_study:!1,bands:[{id:"hline_0",name:"UpperLimit"},{id:"hline_1",name:"LowerLimit"}],filledAreas:[{id:"fill_0",objAId:"hline_0",objBId:"hline_1",type:"hline_hline",title:"Hlines Background"}],inputs:[{id:"in_0",name:"length",defval:14,type:"integer",min:1,max:2e3}],id:"Willams %R@tv-basicstudies-1",scriptIdPart:"",name:"Willams %R"},constructor:function(){this.f_0=function(t,e,i){return 100*(t-e)/(e-i)},this.main=function(t,e){var i,n,r,s,a,l,c,h,u;return this._context=t,this._input=e,i=this._input(0),n=o.Std.high(this._context),r=this._context.new_var(n),s=o.Std.highest(r,i,this._context),a=o.Std.low(this._context),l=this._context.new_var(a),c=o.Std.lowest(l,i,this._context),h=this.f_0(o.Std.close(this._context),s,c),u=h,[u]}}},{name:"Williams Alligator",metainfo:{_metainfoVersion:27,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#0000FF"},plot_1:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#FF0000"},plot_2:{linestyle:0,linewidth:1,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:21,in_1:13,in_2:8}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",type:"line"},{id:"plot_2",type:"line"}],styles:{plot_0:{title:"Jaw",histogramBase:0,joinPoints:!1},plot_1:{title:"Teeth",histogramBase:0,joinPoints:!1},plot_2:{title:"Lips",histogramBase:0,joinPoints:!1}},description:"Williams Alligator",shortDescription:"Alligator",is_price_study:!0,inputs:[{id:"in_0",name:"jawLength",defval:21,type:"integer",min:1,max:2e3},{id:"in_1",name:"teethLength",defval:13,type:"integer",min:1,max:2e3},{id:"in_2",name:"lipsLength",defval:8,type:"integer",min:1,max:2e3}],id:"Williams Alligator@tv-basicstudies-1",scriptIdPart:"",name:"Williams Alligator"},constructor:function(){this.main=function(t,e){var i,n,r,s,a,l,c,h,u,d,p,_,f;return this._context=t,this._input=e,i=this._input(0),n=this._input(1),r=this._input(2),s=o.Std.hl2(this._context),a=this._context.new_var(s),l=o.Std.ema(a,i,this._context),c=this._context.new_var(s),h=o.Std.ema(c,n,this._context),u=this._context.new_var(s),d=o.Std.ema(u,r,this._context),p=l,_=h,f=d,[{value:p,offset:8},{value:_,offset:5},{value:f,offset:3}]}}},{name:"Williams Fractals",metainfo:{_metainfoVersion:42,isTVScript:!1,isTVScriptStub:!1,defaults:{styles:{plot_0:{plottype:"shape_triangle_down",visible:!0,location:"BelowBar",
transparency:0,color:"#800000"},plot_1:{plottype:"shape_triangle_up",visible:!0,location:"AboveBar",transparency:0,color:"#808000"}},precision:4,inputs:{in_0:2}},plots:[{id:"plot_0",type:"shapes"},{id:"plot_1",type:"shapes"}],styles:{plot_0:{title:"Down fractals",isHidden:!1},plot_1:{title:"Up fractals",isHidden:!1}},description:"Williams Fractal",shortDescription:"Fractals",is_price_study:!0,is_hidden_study:!1,id:"Williams Fractals@tv-basicstudies-1",inputs:[{id:"in_0",name:"Periods",defval:2,type:"integer",min:2,max:1e12}],scriptIdPart:"",name:"Williams Fractals",isCustomIndicator:!0},constructor:function(){this.f_0=function(){var t=this._input(0),e=this._context.new_var(o.Std.high(this._context)),i=o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.lt(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.lt(e.get(t+3),e.get(t)),o.Std.and(o.Std.and(o.Std.lt(e.get(t+2),e.get(t)),o.Std.eq(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.lt(e.get(t+3),e.get(t))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.lt(e.get(t+5),e.get(t)),o.Std.and(o.Std.lt(e.get(t+4),e.get(t)),o.Std.eq(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.lt(e.get(t+6),e.get(t)),o.Std.lt(e.get(t+5),e.get(t))),o.Std.and(o.Std.eq(e.get(t+4),e.get(t)),o.Std.le(e.get(t+3),e.get(t)))),o.Std.and(o.Std.and(o.Std.eq(e.get(t+2),e.get(t)),o.Std.le(e.get(t+1),e.get(t))),o.Std.and(o.Std.lt(e.get(t-1),e.get(t)),o.Std.lt(e.get(t-2),e.get(t)))))))),n=this._context.new_var(o.Std.low(this._context))
;return[o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.gt(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))),o.Std.or(o.Std.or(o.Std.and(o.Std.gt(n.get(t+3),n.get(t)),o.Std.and(o.Std.and(o.Std.gt(n.get(t+2),n.get(t)),o.Std.eq(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.gt(n.get(t+3),n.get(t))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))),o.Std.or(o.Std.and(o.Std.and(o.Std.gt(n.get(t+5),n.get(t)),o.Std.and(o.Std.gt(n.get(t+4),n.get(t)),o.Std.eq(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t))))),o.Std.and(o.Std.and(o.Std.and(o.Std.gt(n.get(t+6),n.get(t)),o.Std.gt(n.get(t+5),n.get(t))),o.Std.and(o.Std.eq(n.get(t+4),n.get(t)),o.Std.ge(n.get(t+3),n.get(t)))),o.Std.and(o.Std.and(o.Std.eq(n.get(t+2),n.get(t)),o.Std.ge(n.get(t+1),n.get(t))),o.Std.and(o.Std.gt(n.get(t-1),n.get(t)),o.Std.gt(n.get(t-2),n.get(t)))))))),i]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[{value:i[0],offset:-2},{value:i[1],offset:-2}]}}}]},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(39),s=i(14),a=i(85),l=i(368),c=i(1025),h=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){i._handleToggleDropdown()},i._handleToggleDropdown=function(t){var e=i.state.isOpened,o="boolean"==typeof t?t:!e;i.setState({isOpened:o})},i._handleClose=function(){i._handleToggleDropdown(!1)},i._getDropdownPosition=function(){var t=r.findDOMNode(i).getBoundingClientRect();return{x:t.left+(i.props.directionHorz===a.DirectionHorz.ToLeft?t.width:0),y:t.bottom+2}},i.state={isOpened:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t,e=this.props,i=e.id,o=e.arrow,r=e.children,h=e.content,u=e.directionHorz,d=e.isDisabled,p=e.minWidth,_=e.title,f=e.className,m=this.state.isOpened,g=s(f,c.button,"apply-common-tooltip",(t={},t[c.isDisabled]=d,t[c.isOpened]=m,t));return n.createElement("div",{id:i,className:g,onClick:d?void 0:this._handleClick,title:_},h,o&&n.createElement("div",{className:c.arrow},n.createElement("div",{className:c.arrowWrap},n.createElement(l.ToolWidgetCaret,{dropped:m}))),n.createElement(a.PopupMenu,{closeOnClickOutside:this.props.closeOnClickOutside,directionHorz:u,doNotCloseOn:this,isOpened:m,minWidth:p,onClose:this._handleClose,position:this._getDropdownPosition},r))},e.defaultProps={arrow:!0,closeOnClickOutside:!0},e}(n.PureComponent),e.ToolWidgetMenu=h},function(t,e,i){"use strict";function o(t){var e=t.className,i=n.__rest(t,["className"]);return r.createElement(a.ToolWidgetButton,n.__assign({},i,{className:s(e,l.button)}))}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),s=i(14),a=i(103),
l=i(1033),e.ToolWidgetIconButton=o},function(t,e,i){"use strict";function o(t,e,i){var o,n,r,s,a;for(void 0===i&&(i={}),o=Object.assign({},e),n=0,r=Object.keys(e);n<r.length;n++)s=r[n],(a=i[s]||s)in t&&(o[s]=[t[a],e[s]].join(" "));return o}Object.defineProperty(e,"__esModule",{value:!0}),e.weakComposeClasses=o},function(t,e,i){"use strict";(function(t){function o(t,e){this._model=e,this._bindings=[],this._property=t,this.supportThemeSwitcher=!1}function n(t){return t.toUpperCase()}function r(t){return function(e){return e<t?t:e}}function s(t){return function(e){return e>t?t:e}}function a(t){return function(e){var i=parseInt(e,10);return M(i)?t:i}}function l(t){var e=new B;return function(i){var o=e.parse(i);return M(o)?t:o}}function c(t){var e=new B;return function(i){var o=e.parse(i);return M(o)?t():o}}function h(t,e){var i=new z(e);return function(e){var o=i.format(e);return M(o)?t:o}}function u(){return function(t){for(var e=t,i=t.replace(/[^\u0000-\u007F]/,"");i.length!==e.length;)e=i,i=e.replace(/[^\u0000-\u007F]/,"");return i}}function d(t){return function(e){return 0===e.length?t:e}}function p(t,e,i,o,n,r,s){W.call(this,t,e,o,n,r),this._transformFunction=i,this._setter=s,this._attachToControl(t,o)}function _(t,e,i,o,n){p.call(this,t,e,l(e.value()),i,o,n),this.addFormatter(function(t){return(new B).format(t)})}function f(t,e,i,o,n,r){this._subControlIds=e,W.call(this,t,i,o,n,r),this._forEachSubControl(function(t){this._attachToControl(t,o)})}function m(t,e,i,o,n,r,s){this._model=o,this._mainSeries=r,this._toIntTransformer=a(s),this._disabled=!1,W.call(this,t,e,i,o,n);var l=this;i&&t.change(function(){l.setValueToProperty(l.value())}),this._mainSeries.onBarReceived().subscribe(this,function(){l.setValue(this.property().value())})}function g(t,e,i,o,n){W.call(this,t,e,i,o,n),i&&t.on("accept-symbol",function(t,e){this.setValueToProperty(e)}.bind(this))}function v(t,e,i,o,n,r,s,a){W.call(this,t,e,o,n,r),this._transformFunction=i,this._propertyChangedHook=a,this._setter=s;var l=this;o&&t.change(function(){l._setter?l._setter.call(l,l.value()):l.setValueToProperty(l.value())})}function y(t,e){W.call(this,t,e)}function b(t,e,i,o,n,r){if(!t.is(":checkbox, :radio"))return new w(t,e,i,o,n);W.call(this,t,e,i,o,n),this._setter=r;var s=this;i&&t.change(function(){s._setter?s._setter.call(s,s.value()):s.setValueToProperty(s.value())})}function S(t,e,i,o,n,r){W.call(this,t,e,i,o,n),this._inverted=!0===r}function w(t,e,i,o,n){W.call(this,t,e,i,o,n);var r=this;i&&t.click(function(){var t=$(this).toggleClass("active").hasClass("active");r.setValueToProperty(t)})}function T(t,e,i,o,n,r){var s,a;s=t.is("input")?t:t.find("input"),W.call(this,s,e,i,o,n),this._transparencyProperty=r,this.applyOldTransparency(),a=this,i&&s.change(function(){a.setValueToProperty(a.value())})}function C(e,i,o,n,r,s){function a(t,e){var i=c.control().slider("option","min"),o=c.control().slider("option","max"),n=c._property.value();(i<=n&&n<=o||i<e.value&&e.value<o)&&c.setValueToProperty(e.value)}function l(t,e){c.setValueToProperty(e.value)}
isNumber(i.value())||(H.logWarn("Property cannot be binded to control, bad value (expect number): "+i.value()),i=new t),W.call(this,e,i,o,n,r);var c=this;o&&(s?(e.bind("slidechange",a),e.bind("slide",a)):(e.bind("slidechange",l),e.bind("slide",l))),e.bind("slidestart",function(t,e){n.beginUndoMacro(r)}),e.bind("slidestop",function(t,e){n.endUndoMacro()})}function x(t,e,i,o,n,r){b.call(this,t,e,o,n,r),this._intervalProperty=i,this._intervalProperty.listeners().subscribe(this,this.onIntervalChanged),this.onIntervalChanged()}function P(t,e,i,o,n){this._control=t,this._wv=e,this._transformFunction=i,this._undoModel=o,this._undoText=n,this._attachToControl(this._control),this._setValueBinded=this.setValue.bind(this)}function L(t,e,i,o,n,r){this._not=!!r,P.apply(this,arguments)}function I(t,e,i,o,n,r,s,a){this._propFrom=e[0],this._propTo=e[1],this._control=t,this._applyOnFly=o,this._undoModel=n,this._undoText=s,this._properties=e,this._inputsText=r,this._transformers=i;var l=this;t.slider({range:!0,min:i[0],max:i[1],values:[l._propFrom.value(),l._propTo.value()]}),this.$rangeHandleFrom=$(t.find(".ui-slider-handle")[0]).addClass("from"),this.$rangeHandleTo=$(t.find(".ui-slider-handle")[1]).addClass("to"),this.setValue(this._propFrom,0),this.setValue(this._propTo,1),a&&($(a).on("change",function(t){$(this).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))}),$(a).is(":checked")?(l._control.slider("enable"),$(l._inputsText[0]).prop("disabled",!1),$(l._inputsText[1]).prop("disabled",!1)):(l._control.slider("disable"),$(l._inputsText[0]).prop("disabled",!0),$(l._inputsText[1]).prop("disabled",!0))),r&&($(r[0]).val(this._control.slider("values",0)),$(r[1]).val(this._control.slider("values",1)),t.slider({slide:function(t,e){$(r[0]).val(e.values[0]),$(r[1]).val(e.values[1])}}),$(r).each(function(){$(this).on("keydown",function(t){parseInt($(r[0]).val())<l._transformers[0]?$(r[0]).val(l._transformers[0]):parseInt($(r[1]).val())>l._transformers[1]&&$(r[1]).val(l._transformers[1]),-1!==$.inArray(t.keyCode,[46,8,9,27,13,110,190])||65===t.keyCode&&!0===t.ctrlKey||67===t.keyCode&&!0===t.ctrlKey||88===t.keyCode&&!0===t.ctrlKey||t.keyCode>=35&&t.keyCode<=39||(t.shiftKey||t.keyCode<48||t.keyCode>57)&&(t.keyCode<96||t.keyCode>105)&&t.preventDefault()})}),$(r[0]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),parseInt($(this).val())>parseInt($(r[1]).val())&&$(this).val(r[1].val()),l._control.slider("values",0,$(this).val()),I.prototype.setValueToProperty.call(l,l._control.slider("values"),"from")}),$(r[1]).on("keyup",function(t){parseInt($(this).val())<l._transformers[0]?$(this).val(l._transformers[0]):parseInt($(this).val())>l._transformers[1]&&$(this).val(l._transformers[1]),
parseInt($(this).val())<$(r[0]).val()&&$(this).val(r[0].val()),l._control.slider("values",1,$(this).val()),I.prototype.setValueToProperty.call(l,l._control.slider("values"),"to")})),this._propFrom.listeners().subscribe(this,I.prototype.propertyChanged),this._propTo.listeners().subscribe(this,I.prototype.propertyChanged),o&&t.on("slide",function(t,e){l.setValueToProperty(l._control.slider("values"),e.handle)}),t.slider({stop:function(t,e){r&&($(r[0]).val(l._control.slider("values",0)),$(r[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)},start:function(t,e){r&&($(r[0]).val(l._control.slider("values",0)),$(r[1]).val(l._control.slider("values",1))),l.setValueToProperty(l._control.slider("values"),e.handle)}})}function k(t,e,i,o,n,r){W.call(this,t,e,i,o,n),this._separator=r||" ";var s=this;i&&t.change(function(){s.setValueToProperty(s.value())})}var A,M,E,D,V,O,R,B,z,F,N,W,H;i(384),A=i(9).ensureNotNull,M=i(198).isNaN,E=i(32),D=E.rgba,V=E.rgbaToString,O=E.parseRgb,R=i(212).TimePointIndexSearchMode,B=i(89).NumericFormatter,z=i(213).LimitedPrecisionNumericFormatter,F=i(30),N=i(372).addColorPicker,W=i(320).Binding,H=i(7).getLogger("Chart.PropertyPage"),o.prototype.model=function(){return this._model},o.prototype.bindControl=function(t){return this._bindings.push(t),t},o.prototype.unbindControl=function(t){var e=this._bindings.indexOf(t);-1!==e&&this._bindings.splice(e,1)},o.prototype.loadData=function(){var t,e,i;for(t=0;t<this._bindings.length;t++)e=this._bindings[t],e.properties?(i=e.properties(),e.setValue(i[0],0),e.setValue(i[1],1)):e.property&&(e.transparencyProperty&&e.transparencyProperty()?e.applyOldTransparency():e.setValue(e.property().value()))},o.prototype.saveData=function(){var t,e;for(this._model.beginUndoMacro(),t=0;t<this._bindings.length;t++)e=this._bindings[t],e.changed()&&this._model.setProperty(e.property(),e.value());this._model.endUndoMacro()},o.prototype.createColorPicker=function(t){return N(null,t)},o.prototype.createTextEditor=function(t,e){var i={};return t&&(i.width=t),e&&(i.height=e),$(document.createElement("textarea")).css(i).addClass("tv-control-input")},o.prototype.createCombo=function(t){var e=$(document.createElement("select")),i=t.reduce(function(t,e){return t.add($(document.createElement("option")).prop({value:e,text:e}))},$());return e.append(i)},o.prototype.createKeyCombo=function(t){var e=$(document.createElement("select"));return $.each(t||[],function(t,i){$(document.createElement("option")).prop({value:t,text:i}).appendTo(e)}),e},o.prototype.createFontEditor=function(t){var e=t||TradingView.factoryDefaults("chartproperties.editorFontsList");return this.createCombo(e)},o.prototype.createFontSizeEditor=function(t){var e=t||[10,11,12,14,16,20,24,28,32,40];return this.createCombo(e).addClass("tv-select-container-fontsize")},o.prototype.createSeriesMinTickEditor=function(){var t,e,i,o,n="<select><option value='default'>"+$.t("Default")+"</option>",r=[{priceScale:1,minMove:1,frac:!1},{priceScale:10,minMove:1,frac:!1},{priceScale:100,
minMove:1,frac:!1},{priceScale:1e3,minMove:1,frac:!1},{priceScale:1e4,minMove:1,frac:!1},{priceScale:1e5,minMove:1,frac:!1},{priceScale:1e6,minMove:1,frac:!1},{priceScale:1e7,minMove:1,frac:!1},{priceScale:1e8,minMove:1,frac:!1},{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}];for(t in r)e=r[t],i=e.priceScale+","+e.minMove+","+e.frac,o=e.minMove+"/"+e.priceScale,n+="<option value='"+i+"'>"+o+"</option>";return n+="</select>",$(n)},o.prototype.createPrecisionEditor=function(){var t,e="<select><option value='default'>"+$.t("Default")+"</option>";for(t=0;t<=8;t++)e+="<option value='"+t+"'>"+t+"</option>";return e+="</select>",$(e)},o.prototype.createLabeledCell=function(t,e,i){var o,n,r,s,a=null;return"number"==typeof t.valueOf()?(a=t,o=e,n=i):(o=t,n=e),o+="",r=this._labelToId(o),s=$("<td>"),$("<label>").html(o.length>0?$.t(o):"").attr("for",r).appendTo(s),a&&s.attr("colspan",a),n&&n.attr("id",r),s},o.prototype.createTableInTable=function(t){var e=$("<tr>").appendTo(t),i=$("<td>").appendTo(e);return $('<table cellpadding="0" cellspacing="0">').appendTo(i)},o.prototype._labelToId=function(t){return"control"+t.replace(/(^| )\w/g,function(t){return"-"+t.trim().toLowerCase()})+Math.floor(1e3*Math.random())},o.prototype.addRow=function(t){return $(document.createElement("tr")).appendTo(t)},o.prototype.addLabeledRow=function(t,e,i,o){var n,r=e&&e.length>0?$.t(e):"",s=$(document.createElement("tr")),a=$(document.createElement("td")).html(r);return o&&a.attr("colspan",2),i&&(n=this._labelToId(e),i.attr("id",n),a.html('<label for="'+n+'">'+r+"</label>")),s.append(a).appendTo(t)},o.prototype.addEditorRow=function(t,e,i,o){var n=$(document.createElement("td"));return i.row=this.addLabeledRow(t,e,i,o),i.appendTo(n.appendTo(i.row)),i},o.prototype.addColorPickerRow=function(t,e){return this.addEditorRow(t,e,this.createColorPicker())},o.prototype.addOffsetEditorRow=function(t,e){var i=$("<input/>");return i.attr("type","text"),i.css("width","100px"),i.addClass("ticker"),this.addEditorRow(t,e,i)},o.prototype.addFontEditorRow=function(t,e){return this.addEditorRow(t,e,this.createFontEditor())},o.prototype.refreshStateControls=function(t,e,i){var o,n,r;for(o=0;o<e.length;o++){n=e[o],r=t[n.id];try{r.toggle(this.parseRule(n.visible,e,i))}catch(t){continue}r.attr("disabled",!this.parseRule(n.visible,e,i))}},o.prototype.parseRule=function(t,e,i){if(!t)return!0;var o=t.split("==");return!(o.length<2)&&i[o[0]].value()===o[1]},o.prototype.destroy=function(){for(var t=this._bindings.length;t--;)this._bindings[t].destroy();this._bindings.length=0},o.prototype.bindInteger=function(t,e,i,o,n){var l=[a(e.value())];void 0!==o&&l.push(r(1)),void 0!==n&&l.push(s(1e3)),this.bindControl(new p(t,e,l,!1,this.model(),i))},o.prototype.bindColor=function(t,e,i){this.bindControl(new T(t,e,!0,this.model(),i))},
o.prototype.bindBoolean=function(t,e,i){this.bindControl(new b(t,e,!0,this.model(),i))},inherit(p,W),p.prototype.value=function(){var t,e=this._control.val();if(this._transformFunction)if(Array.isArray(this._transformFunction))for(t=0;t<this._transformFunction.length;t++)e=this._transformFunction[t](e);else e=this._transformFunction(e);return e},p.prototype.setValue=function(t){var e=this._control.val(),i=this._formatValue(t);e!==i&&this._control.val(i)},p.prototype.setValueToProperty=function(t){this._setter?this._setter.call(this,this.value()):this._undoModel.setProperty(this._property,t,this._undoText),this._changed=!1},inherit(_,p),inherit(f,W),f.prototype._forEachSubControl=function(t){this._subControlIds.forEach(function(e){var i="#"+e,o=this.control().find(i);t.call(this,o)},this)},f.prototype._parseSessions=function(t){var e,i,o=t.split("-",2);return 2!==o.length&&(o=["0","0"]),e=parseInt(o[0]),i=parseInt(o[1]),[Math.floor(e/100),e%100,Math.floor(i/100),i%100]},f.prototype.value=function(){var t,e,i,o=[];return this._forEachSubControl(function(t){o.push(t.val())}),t=function(t,e){return e.forEach(function(e){t=e(t)}),("0"+t).slice(-2)},e=[a(0),r(0),s(23)],i=[a(0),r(0),s(59)],t(o[0],e)+t(o[1],i)+"-"+t(o[2],e)+t(o[3],i)},f.prototype.setValue=function(t){var e=this._parseSessions(t);this._forEachSubControl(function(t){var i=t.val(),o=("0"+e[0]).slice(-2);e.shift(),i!==o&&t.val(o)})},inherit(m,W),m.prototype.value=function(){var t,e,i;return this._disabled?(this._control.attr("disabled",!0),null):(t=this._control.val(),e=this._toIntTransformer(t),e<0&&(e=0),i=this._mainSeries.bars().size(),i<=e&&(e=i-1),1e3*A(this._mainSeries.bars().valueAt(A(this._mainSeries.bars().lastIndex())-e))[TradingView.TIME_PLOT])},m.prototype.setValue=function(t){var e,i,o;return this._disabled||null==t?void this._control.attr("disabled",!0):t<0?(this._control.val(-t),void this._property.setValue(this.value())):null===(e=this._mainSeries.data().plotValueToTimePointIndex(t/1e3,TradingView.TIME_PLOT,R.FromRight))?void(this._disabled=!0):(i=A(this._mainSeries.bars().lastIndex()),o=i-e,void(this._control.val()!==""+o&&this._control.val(o)))},inherit(g,W),g.prototype.value=function(){return this._control.val()},g.prototype.setValue=function(t){var e=this.value();t&&e!==t&&this._control.val(t)},inherit(v,W),v.prototype.value=function(){var t=this._control.val();return this._transformFunction&&(t=this._transformFunction(t)),t},v.prototype.setValue=function(t){var e,i;if(this._control.val(t),this._control.selectbox)try{e=this._control.find("[value='"+t+"']"),e.length>0&&(i=e[0],this._control.selectbox("change",i.value,i.text))}catch(t){}},v.prototype.propertyChanged=function(t){var e=t.value();"function"==typeof this._propertyChangedHook&&(e=this._propertyChangedHook(e)),this.setValue(e)},inherit(y,W),y.prototype.value=function(){return this._property.value()},y.prototype.setValue=function(t){return this._control.html(t)},inherit(b,W),b.prototype.value=function(){return this.control().is(":checked")},b.prototype.setValue=function(t){var e,i,o,n
;return this.control().is(".visibility-checker")&&(t?(this.control().closest("tr").find(".slider-range").slider("enable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!1)})):(this.control().closest("tr").find(".slider-range").slider("disable"),this.control().closest("tr").find('input[type="text"]').each(function(){$(this).prop("disabled",!0)}))),this.control().is(".visibility-switch")&&(e={opacity:t?1:.5},i=t?"enable":"disable",o=this.control().data("hides"),o?o.closest("td").css(e):(n=this.control(),n.parent().parent().data("visible",t).find("td").filter(function(){var t=$(this);return!t.find("label").length&&t.find(":checkbox").attr("id")!==n.attr("id")}).each(function(){var o=$(this);o.children().each(function(){var n=$(this);n.is(".ui-slider")?n.slider(i):n.is("select")?(n.selectbox(i),o.css(e)):n.is(".custom-select")?(n.data(i)(),o.css(e)):n.is(".tvcolorpicker-container")?(n.find("input").prop("disabled",!t),o.css(e)):(n.prop("disabled",!t),o.css(e))})}))),this.control().attr("checked",!!t)},inherit(S,W),S.prototype.value=function(){return this.control().is(":disabled")},S.prototype.setValue=function(t){return t=!!t,this._inverted&&(t=!t),this.control().parents("label").toggleClass("disabled",t),this.control().attr("disabled",t)},inherit(w,W),w.prototype.value=function(){return this.control().hasClass("active")},w.prototype.setValue=function(t){return this.control().toggleClass("active",!!t)},inherit(T,W),T.prototype.applyOldTransparency=function(){var t,e,i;this.transparencyProperty()&&(F.isHexColor(this.property().value())?(t=this.transparencyProperty().value?this.transparencyProperty().value():this.transparencyProperty(),e=O(this.property().value()),i=(100-t)/100,this.control().val(V(D(e,i)))):this.control().val(this.property().value()),this.control().change())},T.prototype.transparencyProperty=function(){return this._transparencyProperty},T.prototype.value=function(){return this._control.val()},T.prototype.setValue=function(t){this._control.val(t),this._control.change(),this._control.color&&this._control.color.fromString(t)},inherit(C,W),C.prototype.value=function(){return this._control.slider("option","value")},C.prototype.setValue=function(t){this._control.slider("option","value",t)},inherit(x,b),x.prototype.onIntervalChanged=function(){+this._intervalProperty.value()<1440?this._control.attr({disabled:!1,checked:!!this._property.value()}):this._control.attr({disabled:!0,checked:!1})},x.prototype.value=function(){return this._control.is(":disabled")?this._property.value():b.prototype.value.call(this)},x.prototype.setValue=function(t){if(!this._control.is(":disabled"))return b.prototype.setValue.call(this,t)},x.prototype.destroy=function(){this._intervalProperty.listeners().unsubscribe(this,this.onIntervalChanged),delete this._intervalProperty,b.prototype.destroy.call(this,arguments)},P.prototype._attachToControl=function(t){var e=this;this._wv.subscribe(this._setValueBinded,{callWithLast:!0}),$(this._control).on("change",function(){
e.setValueToProperty(e.value())})},P.prototype.control=function(){return this._control},P.prototype.value=function(){var t=$(this._control).val();return this._transformFunction&&(t=this._transformFunction(t)),t},P.prototype.setValue=function(t){$(this._control).val(t)},P.prototype.setValueToProperty=function(t){this._undoModel.undoHistory.setWatchedValue(this._wv,t,this._undoText)},P.prototype.watchedValue=function(){return this._wv},P.prototype.destroy=function(){this._wv.unsubscribe(this._setValueBinded)},inherit(L,P),L.prototype._attachToControl=function(t){var e=this;this._wv.subscribe(this.setValue.bind(this),{callWithLast:!0}),$(this._control).on("click",function(){e.setValueToProperty(e.value())})},L.prototype.value=function(){var t=$(this._control).attr("checked");return this._not&&(t=!t),this._transformFunction&&(t=this._transformFunction(t)),t},L.prototype.setValue=function(t){this._not&&(t=!t),$(this._control).attr("checked",!!t)},I.prototype.properties=function(){return this._properties},I.prototype.value=function(t){return this._control.slider("values",t)},I.prototype.setValue=function(t,e){this._control.slider("values",e,t.value()),this._inputsText&&$(this._inputsText[e]).val(t.value())},I.prototype.propertyChanged=function(t){this.setValue(t)},I.prototype.setValueToProperty=function(t,e){($(e).hasClass("from")||"from"===e)&&(this._undoModel.beginUndoMacro(this._undoText[0]),this._undoModel.setProperty(this._propFrom,t[0],this._undoText[0]),this._propFrom.setValue(t[0],0),this._undoModel.endUndoMacro()),($(e).hasClass("to")||"to"===e)&&(this._undoModel.beginUndoMacro(this._undoText[1]),this._undoModel.setProperty(this._propTo,t[1],this._undoText[1]),this._propTo.setValue(t[1],1),this._undoModel.endUndoMacro())},I.prototype.destroy=function(){this._propFrom&&this._propTo&&(this._propFrom.listeners().unsubscribe(this,W.prototype.propertyChanged),this._propTo.listeners().unsubscribe(this,W.prototype.propertyChanged))},inherit(k,W),k.prototype.value=function(){var t=[];return this._control.each(function(){var e=$(this);e.is(":checked")&&t.push(e.attr("value"))}),t.join(this._separator)},k.prototype.setValue=function(t){var e=t.split(this._separator).filter(Boolean);this._control.each(function(){var t=$(this),i=-1!==e.indexOf(t.attr("value"));t.attr("checked",i),t.parents("label").toggleClass("active",i)})},e.PropertyPage=o,e.UppercaseTransformer=n,e.GreateTransformer=r,e.LessTransformer=s,e.ToIntTransformer=a,e.ToFloatTransformer=l,e.ToFloatTransformerWithDynamicDefaultValue=c,e.ToFloatLimitedPrecisionTransformer=h,e.ToAsciiTransformer=u,e.ReplaceEmptyTransformer=d,e.SimpleStringBinder=p,e.FloatBinder=_,e.SessionBinder=f,e.BarTimeBinder=m,e.SymbolBinder=g,e.SimpleComboBinder=v,e.StaticContentBinder=y,e.BooleanBinder=b,e.DisabledBinder=S,e.ColorBinding=T,e.SliderBinder=C,e.CheckboxWVBinding=L,e.RangeBinder=I}).call(e,i(25))},,function(t,e,i){(function(t){var e={};e.LINESTYLE_SOLID=0,e.LINESTYLE_DOTTED=1,e.LINESTYLE_DASHED=2,e.LINESTYLE_LARGE_DASHED=3,e.LINESTYLE_SPARSE_DOTTED=4,e.TEXTPOS_TOPLEFT=0,
e.TEXTPOS_TOPCENTER=1,e.TEXTPOS_TOPRIGHT=2,e.TEXTPOS_MIDDLELEFT=3,e.TEXTPOS_MIDDLECENTER=4,e.TEXTPOS_MIDDLERIGHT=5,e.TEXTPOS_BOTTOMLEFT=6,e.TEXTPOS_BOTTOMCENTER=7,e.TEXTPOS_BOTTOMRIGHT=8,e.SIZE_AUTO="auto",e.SIZE_TINY="tiny",e.SIZE_SMALL="small",e.SIZE_NORMAL="normal",e.SIZE_LARGE="large",e.SIZE_HUGE="huge",e.MARKLOC_ABOVEBAR="AboveBar",e.MARKLOC_BELOWBAR="BelowBar",e.MARKLOC_TOP="Top",e.MARKLOC_BOTTOM="Bottom",e.MARKLOC_RIGHT="Right",e.MARKLOC_LEFT="Left",e.MARKLOC_ABSOLUTE="Absolute",e.MARKLOC_ABSOLUTEUP="AbsoluteUp",e.MARKLOC_ABSOLUTEDOWN="AbsoluteDown",e.HHISTLOC_RELATIVE="relative",e.HHISTLOC_ABSOLUTE="absolute",e.HHISTDIR_LEFTTORIGHT="left_to_right",e.HHISTDIR_RIGHTTOLEFT="right_to_left",void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(42)(t))},function(t,e,i){"use strict";function o(t){var e,i,o=(t+"").match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return null===o?0:(e=o[1]?o[1].length:0,i=o[2]?parseInt(o[2],0):0,Math.max(0,e-i))}function n(t){return t=Math.abs(t),!l.isInteger(t)&&t>1&&(t=parseFloat((""+t).replace(/^.+\./,"0."))),0<t&&t<1?Math.pow(10,o(t)):1}function r(t,e){var i,o,r,s,a,c;t.trigger("tvticker-beforechange"),i=t.data("TVTicker"),o=i&&i.step,r=0,r=i.parser?i.parser(t.val()):l.isInteger(o)?parseInt(t.val(),10):parseFloat(t.val()),isNaN(r)&&(r=0),s=n(o),a=Math.max(s,n(r)),c=e(r,a),i.formatter&&(c=i.formatter(c)),t.val(c),t.change()}function s(t){var e=t.data("TVTicker"),i=e&&e.step,o=e&&e.max;r(t,function(t,e){var n=(Math.round(t*e)+Math.round(i*e))/e;return void 0!==o&&null!==o&&o<n&&(n=t),n})}function a(t){var e=t.data("TVTicker"),i=e&&e.step,o=e&&e.min;r(t,function(t,e){var n=(Math.round(t*e)-Math.round(i*e))/e;return void 0!==o&&null!==o&&n<o&&(n=t),n})}var l,c;Object.defineProperty(e,"__esModule",{value:!0}),i(13),i(283),l=i(15),c=i(297),$.fn.TVTicker=function(t){return void 0===t&&(t={}),this.each(function(){var e,i,o,n=!1,r=$(this),l=r.data("TVTicker");l?n=!0:l={step:+r.data("step")||1},"step"in t&&(l.step=+t.step||l.step),"min"in t&&(l.min=t.min),"max"in t&&(l.max=t.max),"formatter"in t&&(l.formatter=t.formatter),"parser"in t&&(l.parser=t.parser),r.data("TVTicker",l),n||(e=$('<div class="tv-ticker">').appendTo(r.parent()),i=$('<div class="tv-ticker__btn tv-ticker__btn--up">').html(c).appendTo(e),o=$('<div class="tv-ticker__btn tv-ticker__btn--down">').html(c).appendTo(e),e.on("mousedown",function(t){t.preventDefault(),r.focus()}),i.click(function(){r.is(":disabled")||s(r)}),o.click(function(){r.is(":disabled")||a(r)}),r.keydown(function(t){r.is(":disabled")||(38===t.keyCode?i.addClass("i-active"):40===t.keyCode&&o.addClass("i-active"))}),r.keyup(function(t){r.is(":disabled")||(38===t.keyCode?(s(r),i.removeClass("i-active")):40===t.keyCode&&(a(r),o.removeClass("i-active")))}),r.mousewheel(function(t,e){e>0?i.click():o.click()}))})}},,,function(t,e,i){var o,n;!function(r,s){"object"==typeof t&&t.exports?t.exports=s():(o=s,void 0!==(n="function"==typeof o?o.call(e,i,e,t):o)&&(t.exports=n))}(0,function(){"use strict";function t(t,e){var i,o=document.createElement(t||"div");for(i in e)o[i]=e[i]
;return o}function e(t){for(var e=1,i=arguments.length;e<i;e++)t.appendChild(arguments[e]);return t}function i(t,e,i,o){var n=["opacity",e,~~(100*t),i,o].join("-"),r=.01+i/o*100,s=Math.max(1-(1-t)/e*(100-r),t),a=c.substring(0,c.indexOf("Animation")).toLowerCase(),l=a&&"-"+a+"-"||"";return p[n]||(h.insertRule("@"+l+"keyframes "+n+"{0%{opacity:"+s+"}"+r+"%{opacity:"+t+"}"+(r+.01)+"%{opacity:1}"+(r+e)%100+"%{opacity:"+t+"}100%{opacity:"+s+"}}",h.cssRules.length),p[n]=1),n}function o(t,e){var i,o,n=t.style;if(e=e.charAt(0).toUpperCase()+e.slice(1),void 0!==n[e])return e;for(o=0;o<d.length;o++)if(i=d[o]+e,void 0!==n[i])return i}function n(t,e){for(var i in e)t.style[o(t,i)||i]=e[i];return t}function r(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)void 0===t[o]&&(t[o]=i[o])}return t}function s(t,e){return"string"==typeof t?t:t[e%t.length]}function a(t){this.opts=r(t||{},a.defaults,_)}function l(){function i(e,i){return t("<"+e+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',i)}h.addRule(".spin-vml","behavior:url(#default#VML)"),a.prototype.lines=function(t,o){function r(){return n(i("group",{coordsize:h+" "+h,coordorigin:-c+" "+-c}),{width:h,height:h})}function a(t,a,l){e(d,e(n(r(),{rotation:360/o.lines*t+"deg",left:~~a}),e(n(i("roundrect",{arcsize:o.corners}),{width:c,height:o.scale*o.width,left:o.scale*o.radius,top:-o.scale*o.width>>1,filter:l}),i("fill",{color:s(o.color,t),opacity:o.opacity}),i("stroke",{opacity:0}))))}var l,c=o.scale*(o.length+o.width),h=2*o.scale*c,u=-(o.width+o.length)*o.scale*2+"px",d=n(r(),{position:"absolute",top:u,left:u});if(o.shadow)for(l=1;l<=o.lines;l++)a(l,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(l=1;l<=o.lines;l++)a(l);return e(t,d)},a.prototype.opacity=function(t,e,i,o){var n=t.firstChild;o=o.shadow&&o.lines||0,n&&e+o<n.childNodes.length&&(n=n.childNodes[e+o],n=n&&n.firstChild,(n=n&&n.firstChild)&&(n.opacity=i))}}var c,h,u,d=["webkit","Moz","ms","O"],p={},_={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",opacity:.25,rotate:0,direction:1,speed:1,trail:100,fps:20,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:!1,hwaccel:!1,position:"absolute"};return a.defaults={},r(a.prototype,{spin:function(e){var i,o,r,s,a,l,h,u,d,p;return this.stop(),i=this,o=i.opts,r=i.el=t(null,{className:o.className}),n(r,{position:o.position,width:0,zIndex:o.zIndex,left:o.left,top:o.top}),e&&e.insertBefore(r,e.firstChild||null),r.setAttribute("role","progressbar"),i.lines(r,i.opts),c||(s=0,a=(o.lines-1)*(1-o.direction)/2,h=o.fps,u=h/o.speed,d=(1-o.opacity)/(u*o.trail/100),p=u/o.lines,function t(){s++;for(var e=0;e<o.lines;e++)l=Math.max(1-(s+(o.lines-e)*p)%u*d,o.opacity),i.opacity(r,e*o.direction+a,l,o);i.timeout=i.el&&setTimeout(t,~~(1e3/h))}()),i},stop:function(){var t=this.el;return t&&(clearTimeout(this.timeout),t.parentNode&&t.parentNode.removeChild(t),this.el=void 0),this},lines:function(o,r){function a(e,i){return n(t(),{position:"absolute",width:r.scale*(r.length+r.width)+"px",
height:r.scale*r.width+"px",background:e,boxShadow:i,transformOrigin:"left",transform:"rotate("+~~(360/r.lines*h+r.rotate)+"deg) translate("+r.scale*r.radius+"px,0)",borderRadius:(r.corners*r.scale*r.width>>1)+"px"})}for(var l,h=0,u=(r.lines-1)*(1-r.direction)/2;h<r.lines;h++)l=n(t(),{position:"absolute",top:1+~(r.scale*r.width/2)+"px",transform:r.hwaccel?"translate3d(0,0,0)":"",opacity:r.opacity,animation:c&&i(r.opacity,r.trail,u+h*r.direction,r.lines)+" "+1/r.speed+"s linear infinite"}),r.shadow&&e(l,n(a("#000","0 0 4px #000"),{top:"2px"})),e(o,e(l,a(s(r.color,h),"0 0 1px rgba(0,0,0,.1)")));return o},opacity:function(t,e,i){e<t.childNodes.length&&(t.childNodes[e].style.opacity=i)}}),"undefined"!=typeof document&&(h=function(){var i=t("style",{type:"text/css"});return e(document.getElementsByTagName("head")[0],i),i.sheet||i.styleSheet}(),u=n(t("group"),{behavior:"url(#default#VML)"}),!o(u,"transform")&&u.adj?l():c=o(u,"animation")),a})},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Bars=0]="Bars",t[t.Line=1]="Line",t[t.OpenClose=2]="OpenClose",t[t.LineOpen=3]="LineOpen",t[t.LineHigh=4]="LineHigh",t[t.LineLow=5]="LineLow",t[t.LineHL2=6]="LineHL2"}(e.LineToolBarsPatternMode||(e.LineToolBarsPatternMode={}))},function(t,e,i){(function(t){function o(t,e,i,o,n){c.call(this,t,e),this._study=i,this._showOnlyConfirmInputs=o,this._symbolSearchZindex=n,this.prepareLayout(),this._$symbolSearchPopup=null}var n=i(238),r=n.UppercaseTransformer,s=n.SymbolBinder,a=n.BarTimeBinder,l=n.SessionBinder,c=n.PropertyPage,h=n.GreateTransformer,u=n.LessTransformer,d=n.ToIntTransformer,p=n.ToFloatTransformer,_=n.SimpleComboBinder,f=n.BooleanBinder,m=n.SimpleStringBinder,g=i(71),v=i(89).NumericFormatter,y=i(33),b=i(7).getLogger("Chart.Study.PropertyPage.Inputs");inherit(o,c),o.prototype._addSessionEditor=function(t,e,i,o){var n,r,s,a,c,h;if("session"!==i.type)return void b.logError("Session editor adding FAILED: wrong input type.");n=function(t,e){var i,o=$("<td/>");o.appendTo(t),o.css("padding-left","0px"),o.css("padding-right","0px"),i=$("<input>"),i.attr("type","text"),i.addClass("ticker"),i.css("width","40px"),i.attr("id",e),i.appendTo(o)},r=function(t,e,i){var o,n=$("<td/>");n.css("padding-left",i),n.css("padding-right",i),n.appendTo(t),o=$("<div/>"),o.appendTo(n),o.append(e),o.css("font-size","150%")},s=$("<table/>"),s.appendTo(t),a=$("<tr/>"),a.appendTo(s),c=["start_hours","start_minutes","end_hours","end_minutes"],n.call(this,a,c[0]),r.call(this,a,":",0),n.call(this,a,c[1]),r.call(this,a,"-",4),n.call(this,a,c[2]),r.call(this,a,":",0),n.call(this,a,c[3]),h=!1,this.bindControl(new l(a,c,e,h,this.model(),o))},o.prototype.prepareLayoutImpl=function(e,i){function o(t){return(new v).format(t)}function n(t){return function(e){var i,o,n,r=this,s=null;if(0===e.indexOf("#")){if(i=e.slice(1,e.indexOf("$")),null===(o=it._model.model().getStudyById(i)))return void b.logError("Can not get Study by id "+i);if(o.isStarted()||o.start(null,!0),
!(n=o.sourceId()))return void b.logError("Can not get source id for "+o.metaInfo().id);s=e.replace(/^[^\$]+/,n)}!~e.indexOf("$")&&!~e.indexOf("#")||it._study.isStarted()||it._study.start(null,!0),it._study.testInputValue(t,e)?r.setValueToProperty(s||r.value()):r.setValue(it._property.inputs[t.id].value())}}function l(t){return function(e){var i,o,n,r;if(t.hasOwnProperty(e)||0===e.indexOf("#")||!~e.indexOf("$"))return e;for(i=e.slice(0,e.indexOf("$")),o=it._model.model().allStudies(),n=0;n<o.length;++n)if(r=o[n],r.sourceId()===i){e=e.replace(/^[^\$]+/,"#"+r.id());break}return e}}var c,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W,H,U,j,q,G,Y,K,Z,X,J,Q,tt,et,it=this;for(c=0;c<e.inputs.length;c++)if(S=e.inputs[c],"first_visible_bar_time"!==(w=S.id)&&"last_visible_bar_time"!==w&&"time"!==S.type&&!S.isHidden&&(!this._showOnlyConfirmInputs||S.confirm)&&void 0===S.groupId){if(T=S.name||w.toLowerCase().replace(/\b\w/g,function(t){return t.toUpperCase()}),C="Change "+T,x=$("<tr/>"),x.appendTo(i),P=$("<td/>"),P.appendTo(x),P.addClass("propertypage-name-label"),P.text($.t(T,{context:"input"})),L=$("<td/>"),L.appendTo(x),I=null,k=null,A=null,"resolution"===S.type)I=$('<select><option value="1">1</option><option value="3">3</option><option value="5">5</option><option value="15">15</option><option value="30">30</option><option value="45">45</option><option value="60">1'+$.t("h",{context:"interval_short"})+'</option><option value="120">2'+$.t("h",{context:"interval_short"})+'</option><option value="180">3'+$.t("h",{context:"interval_short"})+'</option><option value="D">1'+$.t("D",{context:"interval_short"})+'</option><option value="W">1'+$.t("W",{context:"interval_short"})+"</option></select>");else if("symbol"===S.type)I=$('<input class="symbol-edit single">'),g.bindToInput(I,{onPopupOpen:function(t){this._$symbolSearchPopup=t,this._symbolSearchZindex&&t.css("z-index",this._symbolSearchZindex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this)});else if("session"===S.type)this._addSessionEditor(L,this._property.inputs[w],S,C);else if("source"===S.type){for(M={},E={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(E),V=0;V<D.length;++V)M[D[V]]||(M[D[V]]=D[V]);if(O=this._study&&this._study.isChildStudy()){R=this._study.source(),B=R.title(!0,null,!0),z=y.getChildSourceInputTitles(S,this._study.source().metaInfo(),B);for(F in M)z[F]&&(M[F]=1===Object.keys(z).length?B:z[F])}if(t.enabled("study_on_study")&&this._study&&y.isSourceInput(S)&&(O||y.canBeChild(this._study.metaInfo()))){for(N=[this._study],N=N.concat(this._study.getAllChildren()),W=this._model.model().allStudies(),H=0;H<W.length;++H)if(U=W[H],-1===N.indexOf(U)&&U.canHaveChildren())if(j=U.title(!0,null,!0),q=U.sourceId()||"#"+U.id(),G=U.metaInfo(),Y=G.styles,K=G.plots||[],1===K.length)M[q+"$0"]=j;else for(V=0;V<K.length;++V)Z=K[V],~y.CHILD_STUDY_ALLOWED_PLOT_TYPES.indexOf(Z.type)&&(M[q+"$"+V]=j+":"+(Y&&Y[Z.id]&&Y[Z.id].title||Z.id))
;k=n(S),A=l(M)}I=$(document.createElement("select"));for(X in M)J=E[X]||M[X],$("<option>").attr("value",X).text(J).appendTo(I);L.addClass("js-value-cell")}else if(S.options)for(I=$("<select/>"),H=0;H<S.options.length;H++)X=S.options[H],$("<option value='"+X+"'>"+X+"</option>").appendTo(I);else I=$("<input/>"),"bool"===S.type?I.attr("type","checkbox"):I.attr("type","text");I&&(I.appendTo(L),I.is(":checkbox")||I.css("width","100px")),S.options?this.bindControl(new _(I,this._property.inputs[w],null,!0,this.model(),C,k,A)):"bar_time"===S.type?(Q=10,this.bindControl(new a(I,this._property.inputs[w],!0,this.model(),C,this.model().mainSeries(),Q)),I.addClass("ticker")):"integer"===S.type?(tt=[d(S.defval)],(0===S.min||S.min)&&tt.push(h(S.min)),(0===S.max||S.max)&&tt.push(u(S.max)),this.bindControl(new m(I,this._property.inputs[w],tt,!1,this.model(),C)),I.addClass("ticker"),isFinite(S.step)&&S.step>0&&I.attr("data-step",S.step)):"float"===S.type?(tt=[p(S.defval)],(0===S.min||S.min)&&tt.push(h(S.min)),(0===S.max||S.max)&&tt.push(u(S.max)),et=new m(I,this._property.inputs[w],tt,!1,this.model(),C),et.addFormatter(o),this.bindControl(et),I.addClass("ticker"),isFinite(S.step)&&S.step>0&&I.attr("data-step",S.step)):"text"===S.type?this.bindControl(new m(I,this._property.inputs[w],null,!1,this.model(),C)):"bool"===S.type?this.bindControl(new f(I,this._property.inputs[w],!0,this.model(),C)):"resolution"===S.type?this.bindControl(new _(I,this._property.inputs[w],r,!0,this.model(),"Change Interval")):"symbol"===S.type&&this.bindControl(new s(I,this._property.inputs[w],!0,this.model(),"Change Symbol"))}this._property.offset&&(T=this._property.offset.title?this._property.offset.title.value():$.t("Offset"),I=this.addOffsetEditorRow(i,T),tt=[d(this._property.offset.val)],tt.push(h(this._property.offset.min)),tt.push(u(this._property.offset.max)),this.bindControl(new m(I,this._property.offset.val,tt,!1,this.model(),"Undo "+T))),this._property.offsets&&$.each(e.plots,function(t,e){var o,n,r,s;this._property.offsets[e.id]&&(o=this._property.offsets[e.id],void 0!==o.isHidden&&o.isHidden.value()||(n=o.title.value(),r=this.addOffsetEditorRow(i,n),s=[d(o.val)],s.push(h(o.min)),s.push(u(o.max)),this.bindControl(new m(r,o.val,s,!1,this.model(),"Undo "+n))))}.bind(this))},o.prototype.prepareLayout=function(){this._table=$("<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()},o.prototype.symbolSearchPopup=function(){return this._$symbolSearchPopup},o.prototype.widget=function(){return this._table},e.StudyInputsPropertyPage=o}).call(e,i(5))},function(t,e,i){"use strict";function o(t){this._data=t,this.bars=t.bars,this._barWidth=n.optimalBarWidth(t.barSpacing),this._barBorderWidth=1}var n=i(45),r=i(11);o.prototype.draw=function(t){
var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f=this.bars,m=this._data.barSpacing,g=this._data.drawWick,v=this._data.drawBorder,y=this._data.wickColor,b=this._barBorderWidth,S=this._barWidth;if(t.lineCap="square",t.lineStyle=this._data.lineStyle,m<1){if(g){for(t.strokeStyle=y,t.lineWidth=1,t.beginPath(),h=f.length;h-- >0;)u=f[h],t.moveTo(u.time,u.low),t.lineTo(u.time,u.high);t.stroke()}for(t.lineWidth=1,d="",p=!1,t.beginPath(),h=f.length;h-- >0;)u=f[h],c=u.time,d!==u.color&&(p&&(t.stroke(),t.beginPath(),p=!1),t.strokeStyle=u.color,d=u.color),t.moveTo(u.time,u.open),t.lineTo(u.time,u.close),p=!0;p&&t.stroke()}else{if(f=f.slice().sort(function(t,e){return t.color>e.color?-1:t.color<e.color?1:0}),t.translate(-.5,-.5),t.lineWidth=b,g)for(_=y,t.fillStyle=y,h=f.length;h--;)u=f[h],c=u.time,e=u.open,i=u.high,o=u.low,n=u.close,u.wickColor&&u.wickColor!==_&&(t.fillStyle=u.wickColor,_=u.wickColor),a=Math.min(e,n),l=Math.max(e,n),u.hollow?(t.fillRect(c,i,1,a-i),t.fillRect(c,l,1,o-l)):t.fillRect(c,i,1,o-i);if(v)for(h=f.length;h--;)u=f[h],f[h+1]&&u.borderColor===f[h+1].borderColor||(t.fillStyle=u.borderColor),u.hollow||(c=u.time,e=u.open,n=u.close,r=Math.round(c-S),s=Math.round(c+S),a=Math.min(e,n),l=Math.max(e,n),t.fillRect(r,a,s-r+1,l-a+1));for(h=f.length;h--;)u=f[h],c=u.time,e=u.open,i=u.high,o=u.low,n=u.close,r=Math.round(c-S),s=Math.round(c+S),a=Math.min(e,n),l=Math.max(e,n),f[h+1]&&u.color===f[h+1].color||(t.strokeStyle=u.color),t.fillStyle=u.color,Math.abs(a-l)<=1&&(t.fillStyle=u.borderColor),u.hollow?(t.translate(-.5,-.5),t.strokeRect(r+1,a+1,s-r,l-a),t.translate(.5,.5)):(v&&(r+=1,a+=1,s-=1,l-=1),t.fillRect(r,a,s-r+1,l-a+1))}},o.prototype.hitTest=function(t){var e,i,o,s,a=this.bars,l=.5*this._data.barSpacing;if(0===a.length)return null;if(t.x<a[0].time-l)return null;if(t.x>a[a.length-1].time+l)return null;for(e=null,i=0;i<a.length;++i)if(o=a[i],t.x<=o.time+l){e=o;break}return s=n.selectionTolerance(this._barBorderWidth),e&&e.high-s<=t.y&&t.y<=e.low+s?this._data.hittest||new r(r.REGULAR):null},e.PaneRendererCandles=TradingView.PaneRendererCandles=o},function(t,e,i){"use strict";function o(t){return"alwaysOn"===t||"alwaysOff"===t?t:"visibleOnMouseOver"}function n(){if(!c){var t="NavigationButtons.visibility";c=new a,c.setValue(o(l.getValue(t))),c.subscribe(c,function(e){l.setValue(t,o(e.value()))})}return c}function r(){return[{value:"visibleOnMouseOver",title:window.t("Visible on Mouse Over")},{value:"alwaysOn",title:window.t("Always Visible")},{value:"alwaysOff",title:window.t("Always Invisible")}]}function s(){var t,e;return h||(h=new a,t=n(),e=function(){var e=t.value();"alwaysOn"!==e&&"alwaysOff"!==e&&(e=Modernizr.touch?"alwaysOn":"visibleOnMouseOver"),h&&h.setValue(e)},t.subscribe(h,e),e()),h}var a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),i(12),i(43),a=i(25),l=i(24),e.property=n,e.availableValues=r,e.actualBehavior=s},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";function o(t){window.t=t}function n(t){r.$||(r.$={}),r.$.t=t}var r,s;Object.defineProperty(e,"__esModule",{value:!0}),r=window,
e.addTranslationFunctionToWindow=o,e.addTranslationFunctionToJQuery=n,s=function(t,e){return t},e.translationFunction=s},function(t,e,i){"use strict";!function(t){if(document.createElement("canvas")&&document.createElement("canvas").getContext){var e=function(e){var i=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/i}(document.createElement("canvas").getContext("2d"));e<=1||(t.hidpiCanvasRatio=e,function(t){var i,o=function(t,e){for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},n={fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all",drawImagePatchedSource:[1,2,3,4]};t.drawImagePatchedSource=t.drawImage,i=t.drawImage,t.drawImagePatchedSourceAndDest=function(t){var o,n=Array.prototype.slice.call(arguments);for(o=1;o<n.length;++o)n[o]&&(n[o]*=e);return n.length>5&&("width"in t&&(n[3]=Math.min(t.width,Math.max(1,n[3]))),"height"in t&&(n[4]=Math.min(t.height,Math.max(1,n[4])))),i.apply(this,n)},o(n,function(i,o){var n=t[o];t[o]=function(){var t,o;if("all"===i)for(o=[],t=arguments.length;0<t--;)o[t]=arguments[t]*e;else for(o=Array.prototype.slice.call(arguments),t=i.length;0<t--;)o[i[t]]&&(o[i[t]]=o[i[t]]*e);return n.apply(this,o)}}),t.drawImage=function(t){return function(){return arguments[0]instanceof HTMLCanvasElement?t.drawImagePatchedSourceAndDest.apply(this,arguments):t.drawImagePatchedSource.apply(this,arguments)}}(t),t.fillText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.fillText),t.strokeText=function(t){return function(){var i=Array.prototype.slice.call(arguments);i[1]*=e,i[2]*=e,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i*e+o}),t.apply(this,i),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,i,o){return i/e+o})}}(t.strokeText)}(CanvasRenderingContext2D.prototype),function(t){t.getContext=function(t){return function(i){var o=t.call(this,i);return"2d"===i&&this.width!==Math.floor(parseInt(this.style.width)*e)&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=e,this.height*=e),o}}(t.getContext)}(HTMLCanvasElement.prototype))}}(window)},function(t,e,i){(function(t){TradingView.cleanButAmpersand=function(t,e){var i=e?["&amp;"]:["&"];return TradingView.clean(t,e,i)},TradingView.strip_tags=function(t){return t&&t.replace?t.replace(/(<([^>]+)>)/gi,""):t},TradingView.encodeSpread=function(t){return encodeURIComponent(t)},TradingView.clean=function(t,e,i){var o,n,r,s=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&#039;"],["'","&#39;"]],a=t
;if(!t||!t.replace)return a;for(o=0;o<s.length;o++)n=s[o][0],r=s[o][1],i&&i.indexOf&&-1!==i.indexOf(e?r:n)||(a=e?a.replace(RegExp(r,"g"),n):a.replace(RegExp(n,"g"),r));return a},void 0!==t&&t&&t.exports&&(t.exports={clean:TradingView.clean,cleanButAmpersand:TradingView.cleanButAmpersand,stripTags:TradingView.strip_tags})}).call(e,i(42)(t))},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 8" width="16" height="8"><path d="M0 1.475l7.396 6.04.596.485.593-.49L16 1.39 14.807 0 7.393 6.122 8.58 6.12 1.186.08z"/></svg>'},function(t,e,i){"use strict";function o(t,e,i,o,n){function r(t){return e&&e[t]?e[t]:t}function s(t,e,i,o){var n=r(e[0]);return!!t.hasOwnProperty(n)&&(e.length>1?s(t[n],e.slice(1),i):(t[n]&&t[n].setValue?t[n].setValue(i):t[n]=i,!0))}function a(t){i||f.logWarn("Path `"+t+"` does not exist.")}var l,c,h,u;if(o)for(l in o)c=l.split("."),h=r(c[0]),u=void 0!==n&&n===c[0],0!==c.length&&u&&(c=c.slice(1),h=r(c[0])),0!==c.length&&t.hasOwnProperty(h)?s(t,c,o[l])||a(l):u&&a(l)}function n(t,e,i,n){window.__defaultsOverrides&&o(t,e,i,window.__defaultsOverrides,n)}function r(){var t=/^linetool.+/;Object.keys(TradingView.defaultProperties).forEach(function(e){t.test(e)&&n(TradingView.defaultProperties[e],null,!1,e)})}function s(t,e){return e?l(t,e):a(t)}function a(t){var e,i=m(t);return window._UNIT_TESTS||(e=TradingView.clone(TVSettings.getJSON(t,null)))&&TradingView.merge(i,e),i}function l(t,e){var i,o,n=m(t);return window._UNIT_TESTS||(i=TradingView.clone(TVSettings.getJSON(t,null)),t.startsWith("study_")&&i&&d.isVersionHead(i.version)&&(o=e.updateStudyState(i,i),i=o),TradingView.merge(n,i)),n}var c=i(49),h=i(299).LineToolPitchforkStyle,u=i(245).LineToolBarsPatternMode,d=i(84),p=i(111).PlotType,_=i(74).LineEnd,f=i(7).getLogger("Chart.Defaults"),m=function(t){var e,i,o,s,a,l,d,f,m={a:function(t,e){return{color:t,visible:e}},b:function(t,e,i){return{coeff:t,color:e,visible:i}},c:function(t,e,i,o,n){return{coeff:t,color:e,visible:i,linestyle:void 0===o?CanvasEx.LINESTYLE_SOLID:o,linewidth:void 0===n?1:n}},d:function(t,e,i){return{color:t,width:i,visible:e}},e:function(t,e,i,o,n){return{color:t,visible:e,width:i,x:o,y:n}},f:function(t,e,i,o,n,r){return{coeff1:t,coeff2:e,color:i,visible:o,linestyle:void 0===n?CanvasEx.LINESTYLE_SOLID:n,linewidth:void 0===r?1:r}}};if(void 0===TradingView.defaultProperties){switch(window.locale){case"ar_AE":e="Asia/Dubai";break;case"au":e="Australia/Sydney";break;case"br":e="America/Sao_Paulo";break;case"ca":e="America/Toronto";break;case"de_DE":case"it":e="Europe/Berlin";break;case"es":e="Europe/Madrid";break;case"fa_IR":e="Asia/Tehran";break;case"fr":case"sv_SE":e="Europe/Paris";break;case"he_IL":case"tr":e="Europe/Athens";break;case"hu_HU":case"pl":e="Europe/Warsaw";break;case"id":case"th_TH":case"vi_VN":e="Asia/Bangkok";break;case"in":e="Asia/Kolkata";break;case"ja":case"kr":e="Asia/Tokyo";break;case"ms_MY":e="Asia/Singapore";break;case"ru":e="Europe/Moscow";break;case"uk":e="Europe/London";break;case"zh_CN":case"zh_TW":e="Asia/Shanghai"
;break;default:e="Etc/UTC"}TradingView.defaultProperties={chartproperties:{timezone:e,dataWindowProperties:{background:"rgba( 255, 254, 206, 0.2)",border:"rgba( 96, 96, 144, 1)",font:"Verdana",fontBold:!1,fontItalic:!1,fontSize:10,transparency:80,visible:!0},paneProperties:{background:"#ffffff",gridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},vertGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},horzGridProperties:{color:"#e1ecf2",style:CanvasEx.LINESTYLE_SOLID},crossHairProperties:{color:"rgba( 152, 152, 152, 1)",style:CanvasEx.LINESTYLE_DASHED,transparency:0,width:1},topMargin:5,bottomMargin:5,leftAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},rightAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1,alignLabels:!0},legendProperties:{showStudyArguments:!0,showStudyTitles:!0,showStudyValues:!0,showSeriesTitle:!0,showSeriesOHLC:!0,showLegend:!0}},scalesProperties:{showLeftScale:!1,showRightScale:!0,backgroundColor:"#ffffff",lineColor:"#555",textColor:"#555",fontSize:11,scaleSeriesOnly:!1,showSeriesLastValue:!0,showSeriesPrevCloseValue:!1,showStudyLastValue:!1,showSymbolLabels:!1,showStudyPlotLabels:!1},mainSeriesProperties:{style:c.STYLE_CANDLES,esdShowDividends:!0,esdShowSplits:!0,esdShowEarnings:!0,esdShowBreaks:!1,esdBreaksStyle:{color:"rgba( 235, 77, 92, 1)",style:CanvasEx.LINESTYLE_DASHED,width:1},esdFlagSize:2,showCountdown:!0,showInDataWindow:!0,visible:!0,silentIntervalChange:!1,showPriceLine:!0,priceLineWidth:1,priceLineColor:"",showPrevClosePriceLine:!1,prevClosePriceLineWidth:1,prevClosePriceLineColor:"rgba( 85, 85, 85, 1)",minTick:"default",extendedHours:!1,sessVis:!1,statusViewStyle:{fontSize:17,showExchange:!0,showInterval:!0,showSymbolAsDescription:!1},candleStyle:{upColor:"#53b987",downColor:"#eb4d5c",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#53b987",borderDownColor:"#eb4d5c",wickColor:"#737375",wickUpColor:"#a9cdd3",wickDownColor:"#f5a6ae",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 169, 220, 195, 1)",wickDownColor:"rgba( 245, 166, 174, 1)"},haStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",wickDownColor:"rgba( 255, 77, 92, 1)",showRealLastPrice:!1,barColorsOnPrevClose:!1,inputs:{},inputInfo:{}},barStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 60, 120, 216, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,
priceSource:"close",styleType:c.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},priceAxisProperties:{autoScale:!0,autoScaleDisabled:!1,lockScale:!1,percentage:!1,percentageDisabled:!1,log:!1,logDisabled:!1},renkoStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",wickUpColor:"rgba( 83, 185, 135, 1)",wickDownColor:"rgba( 255, 77, 92, 1)",inputs:{source:"close",boxSize:3,style:"ATR",atrLength:14,wicks:!0},inputInfo:{source:{name:"Source"},boxSize:{name:"Box size"},style:{name:"Style"},atrLength:{name:"ATR Length"},wicks:{name:"Wicks"}}},pbStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",borderUpColor:"rgba( 83, 185, 135, 1)",borderDownColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",borderUpColorProjection:"rgba( 169, 220, 195, 1)",borderDownColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",lb:3},inputInfo:{source:{name:"Source"},lb:{name:"Number of line"}}},kagiStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{source:"close",style:"ATR",atrLength:14,reversalAmount:1},inputInfo:{source:{name:"Source"},style:{name:"Style"},atrLength:{name:"ATR Length"},reversalAmount:{name:"Reversal amount"}}},pnfStyle:{upColor:"rgba( 83, 185, 135, 1)",downColor:"rgba( 255, 77, 92, 1)",upColorProjection:"rgba( 169, 220, 195, 1)",downColorProjection:"rgba( 245, 166, 174, 1)",inputs:{sources:"Close",reversalAmount:3,boxSize:1,style:"ATR",atrLength:14},inputInfo:{sources:{name:"Source"},boxSize:{name:"Box size"},reversalAmount:{name:"Reversal amount"},style:{name:"Style"},atrLength:{name:"ATR Length"}}},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50}},symbolWatermarkProperties:{color:"rgba( 85, 85, 85, 0)",transparency:100},chartEventsSourceProperties:{visible:!0,futureOnly:!0,breaks:{color:"rgba(85, 85, 85, 1)",visible:!1,style:CanvasEx.LINESTYLE_DASHED,width:1}},tradingProperties:{showPositions:!0,showOrders:!0,showExecutions:!0,extendLeft:!0,lineLength:5,lineWidth:1,lineStyle:CanvasEx.LINESTYLE_DASHED},alertsProperties:{labels:{visible:!0,color:"rgba( 215, 84, 66, 1)",highlightColor:"rgba( 255, 255, 51, 1)",
hoverColor:"rgba( 245, 227, 135, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},fakeLabels:{visible:!0,color:"rgba( 119, 119, 119, 1)",line:{visible:!0,style:CanvasEx.LINESTYLE_DASHED,width:1}},drawingIcon:{color:"rgba( 170, 170, 170, 1)"}},editorFontsList:["Verdana","Courier New","Times New Roman","Arial"],volumePaneSize:"large"},drawings:{magnet:!1,stayInDrawingMode:!1,drawOnAllCharts:!0,crossHairColor:"rgba( 183, 183, 183, 1)",crossHairStyle:CanvasEx.LINESTYLE_DASHED,crossHairWidth:1},linetoolorder:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 255, 0, 0, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 255, 0, 0, 0)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 255, 0, 0, 0)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 255, 0, 0, 0)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 255, 0, 0, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,cancelButtonBorderColor:"rgba( 255, 0, 0, 1)",cancelButtonBorderTransparency:0,cancelButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",cancelButtonBackgroundTransparency:25,cancelButtonIconColor:"rgba( 255, 0, 0, 1)",cancelButtonIconTransparency:0,tooltip:""},linetoolposition:{singleChartOnly:!0,extendLeft:"inherit",lineLength:"inherit",lineColor:"rgba( 0, 113, 224, 1)",lineTransparency:0,lineStyle:"inherit",lineWidth:"inherit",bodyBorderColor:"rgba( 0, 113, 224, 1)",bodyBorderTransparency:0,bodyBackgroundColor:"rgba( 255, 255, 255, 0.75)",bodyBackgroundTransparency:25,bodyTextColor:"rgba( 0, 113, 224, 1)",bodyTextTransparency:0,bodyFontFamily:"Verdana",bodyFontSize:7,bodyFontBold:!0,bodyFontItalic:!1,quantityBorderColor:"rgba( 0, 113, 224, 1)",quantityBorderTransparency:0,quantityBackgroundColor:"rgba( 0, 113, 224, 0.75)",quantityBackgroundTransparency:25,quantityTextColor:"rgba( 255, 255, 255, 1)",quantityTextTransparency:0,quantityFontFamily:"Verdana",quantityFontSize:7,quantityFontBold:!0,quantityFontItalic:!1,reverseButtonBorderColor:"rgba( 0, 113, 224, 1)",reverseButtonBorderTransparency:0,reverseButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",reverseButtonBackgroundTransparency:25,reverseButtonIconColor:"rgba( 0, 113, 224, 1)",reverseButtonIconTransparency:0,closeButtonBorderColor:"rgba( 0, 113, 224, 1)",closeButtonBorderTransparency:0,closeButtonBackgroundColor:"rgba( 255, 255, 255, 0.75)",closeButtonBackgroundTransparency:25,closeButtonIconColor:"rgba( 0, 113, 224, 1)",closeButtonIconTransparency:0,tooltip:""},linetoolexecution:{singleChartOnly:!0,direction:"buy",arrowHeight:8,arrowSpacing:1,arrowColor:"rgba( 0, 0, 255, 1)",arrowTransparency:0,text:"",textColor:"rgba( 0, 0, 0, 1)",textTransparency:0,fontFamily:"Verdana",fontSize:8,fontBold:!1,fontItalic:!1,
tooltip:""},linetoolicon:{singleChartOnly:!0,clonable:!0,color:"rgba( 61, 133, 198, 1)",size:40,icon:61536,angle:.5*Math.PI,scale:1},linetoolbezierquadro:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:_.Normal,rightEnd:_.Normal},linetoolbeziercubic:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:_.Normal,rightEnd:_.Normal},linetooltrendline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:_.Normal,rightEnd:_.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,snapTo45Degrees:!0,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetooltimecycles:{clonable:!0,linecolor:"rgba(21, 153, 128, 1)",linewidth:1,fillBackground:!0,backgroundColor:"rgba(106, 168, 79, 0.5)",transparency:50,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolsineline:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooltrendangle:{singleChartOnly:!0,clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,snapTo45Degrees:!0,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!0,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,extendRight:!1,extendLeft:!1},linetooldisjointangle:{clonable:!0,linecolor:"rgba( 18, 159, 92, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 106, 168, 79, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:_.Normal,rightEnd:_.Normal,font:"Verdana",textcolor:"rgba( 18, 159, 92, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolflatbottom:{clonable:!0,linecolor:"rgba( 73, 133, 231, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,extendLeft:!1,extendRight:!1,leftEnd:_.Normal,rightEnd:_.Normal,font:"Verdana",textcolor:"rgba( 73, 133, 231, 1)",fontsize:12,bold:!1,italic:!1,showPrices:!1,showPriceRange:!1,showDateTimeRange:!1,showBarsRange:!1},linetoolfibspiral:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetooldaterange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendTop:!1,extendBottom:!1},linetoolpricerange:{clonable:!0,
linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",extendLeft:!1,extendRight:!1},linetooldateandpricerange:{clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba( 255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 91, 133, 191, 0.9)",labelBackgroundTransparency:30,fillBackground:!0,backgroundColor:"rgba( 186, 218, 255, 0.4)",backgroundTransparency:60,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)"},linetoolriskrewardshort:{isShort:!0,clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolriskrewardlong:{isShort:!1,clonable:!0,linecolor:"rgba( 88, 88, 88, 1)",linewidth:1,font:"Verdana",textcolor:"rgba(255, 255, 255, 1)",fontsize:12,fillLabelBackground:!0,labelBackgroundColor:"rgba( 88, 88, 88, 1)",labelBackgroundTransparency:0,fillBackground:!0,stopBackground:"rgba( 255, 0, 0, 0.2)",profitBackground:"rgba( 0, 160, 0, 0.2)",stopBackgroundTransparency:80,profitBackgroundTransparency:80,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",compact:!1,riskDisplayMode:"percents",accountSize:1e3,risk:25},linetoolarrow:{clonable:!0,linecolor:"rgba( 111, 136, 198, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,leftEnd:_.Normal,rightEnd:_.Arrow,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolray:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!0,leftEnd:_.Normal,rightEnd:_.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolextended:{clonable:!0,linecolor:"rgba( 21, 153, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!0,extendRight:!0,leftEnd:_.Normal,rightEnd:_.Normal,font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,alwaysShowStats:!1,showMiddlePoint:!1,showPriceRange:!1,showBarsRange:!1,showDateTimeRange:!1,showDistance:!1,showAngle:!1},linetoolhorzline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,
showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolhorzray:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showPrice:!0,showLabel:!1,text:"",font:"Verdana",textcolor:"rgba( 21, 119, 96, 1)",fontsize:12,bold:!1,italic:!1,horzLabelsAlign:"center",vertLabelsAlign:"top"},linetoolvertline:{clonable:!0,linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showTime:!0},linetoolcirclelines:{clonable:!0,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},linecolor:"rgba( 128, 204, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},linetoolfibtimezone:{horzLabelsAlign:"right",vertLabelsAlign:"bottom",clonable:!0,baselinecolor:"rgba( 128, 128, 128, 1)",linecolor:"rgba( 0, 85, 219, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,showLabels:!0,font:"Verdana",fillBackground:!1,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m.c(0,"rgba( 128, 128, 128, 1)",!0),level2:m.c(1,"rgba( 0, 85, 219, 1)",!0),level3:m.c(2,"rgba( 0, 85, 219, 1)",!0),level4:m.c(3,"rgba( 0, 85, 219, 1)",!0),level5:m.c(5,"rgba( 0, 85, 219, 1)",!0),level6:m.c(8,"rgba( 0, 85, 219, 1)",!0),level7:m.c(13,"rgba( 0, 85, 219, 1)",!0),level8:m.c(21,"rgba( 0, 85, 219, 1)",!0),level9:m.c(34,"rgba( 0, 85, 219, 1)",!0),level10:m.c(55,"rgba( 0, 85, 219, 1)",!0),level11:m.c(89,"rgba( 0, 85, 219, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltext:{clonable:!0,color:"rgba( 102, 123, 139, 1)",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 91, 133, 191, 0.9)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!1,fixedSize:!0,wordWrap:!1,wordWrapWidth:400},linetooltextabsolute:{singleChartOnly:!0,clonable:!0,color:"rgba( 102, 123, 139, 1)",text:$.t("Text"),font:"Verdana",fontsize:20,fillBackground:!1,backgroundColor:"rgba( 155, 190, 213, 0.3)",backgroundTransparency:70,drawBorder:!1,borderColor:"rgba( 102, 123, 139, 1)",bold:!1,italic:!1,locked:!0,wordWrap:!1,wordWrapWidth:400},linetoolballoon:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 254, 206, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:12,font:"Arial",transparency:30,text:$.t("Comment")},linetoolbrush:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,smooth:5,fillBackground:!1,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,leftEnd:_.Normal,rightEnd:_.Normal},linetoolpolyline:{clonable:!0,linecolor:"rgba( 53, 53, 53, 1)",linewidth:2,linestyle:CanvasEx.LINESTYLE_SOLID,fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",transparency:50,filled:!1},linetoolarrowmark:{clonable:!0,
color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkleft:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkup:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkright:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolarrowmarkdown:{clonable:!0,color:"rgba( 120, 120, 120, 1)",text:"",fontsize:20,font:"Verdana"},linetoolflagmark:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolnote:{clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!1,fixedSize:!0},linetoolnoteabsolute:{singleChartOnly:!0,clonable:!0,markerColor:"rgba( 46, 102, 255, 1)",textColor:"rgba( 0, 0, 0, 1)",backgroundColor:"rgba( 255, 255, 255, 1)",backgroundTransparency:0,text:$.t("Text"),font:"Arial",fontSize:12,bold:!1,italic:!1,locked:!0,fixedSize:!0},linetoolthumbup:{clonable:!0,color:"rgba( 0, 128, 0, 1)"},linetoolthumbdown:{clonable:!0,color:"rgba( 255, 0, 0, 1)"},linetoolpricelabel:{clonable:!0,color:"rgba( 102, 123, 139, 1)",backgroundColor:"rgba( 255, 255, 255, 0.7)",borderColor:"rgba( 140, 140, 140, 1)",fontWeight:"bold",fontsize:11,font:"Arial",transparency:30},linetoolrectangle:{clonable:!0,color:"rgba( 21, 56, 153, 1)",fillBackground:!0,backgroundColor:"rgba( 21, 56, 153, 0.5)",linewidth:1,snapTo45Degrees:!0,transparency:50},linetoolrotatedrectangle:{clonable:!0,color:"rgba( 152, 0, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 142, 124, 195, 0.5)",transparency:50,linewidth:1,snapTo45Degrees:!0},linetoolellipse:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolarc:{clonable:!0,color:"rgba( 153, 153, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 153, 21, 0.5)",transparency:50,linewidth:1},linetoolprediction:{singleChartOnly:!0,linecolor:"rgba( 28, 115, 219, 1)",linewidth:2,sourceBackColor:"rgba( 241, 241, 241, 1)",sourceTextColor:"rgba( 110, 110, 110, 1)",sourceStrokeColor:"rgba( 110, 110, 110, 1)",targetStrokeColor:"rgba( 47, 168, 255, 1)",targetBackColor:"rgba( 11, 111, 222, 1)",targetTextColor:"rgba( 255, 255, 255, 1)",successBackground:"rgba( 54, 160, 42, 0.9)",successTextColor:"rgba( 255, 255, 255, 1)",failureBackground:"rgba( 231, 69, 69, 0.5)",failureTextColor:"rgba( 255, 255, 255, 1)",intermediateBackColor:"rgba( 234, 210, 137, 1)",intermediateTextColor:"rgba( 109, 77, 34, 1)",transparency:10,centersColor:"rgba( 32, 32, 32, 1)"},linetooltriangle:{clonable:!0,color:"rgba( 153, 21, 21, 1)",fillBackground:!0,backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:1},linetoolcallout:{clonable:!0,color:"rgba( 255, 255, 255, 1)",backgroundColor:"rgba( 153, 21, 21, 0.5)",transparency:50,linewidth:2,fontsize:12,font:"Verdana",text:$.t("Text"),bordercolor:"rgba( 153, 21, 21, 1)",bold:!1,italic:!1,wordWrap:!1,
wordWrapWidth:400},linetoolparallelchannel:{clonable:!0,linecolor:"rgba( 119, 52, 153, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,extendLeft:!1,extendRight:!1,fillBackground:!0,backgroundColor:"rgba( 180, 167, 214, 0.5)",transparency:50,showMidline:!1,midlinecolor:"rgba( 119, 52, 153, 1)",midlinewidth:1,midlinestyle:CanvasEx.LINESTYLE_DASHED},linetoolelliottimpulse:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliotttriangle:{degree:7,clonable:!0,showWave:!0,color:"rgba( 255, 152, 0, 1)",linewidth:1},linetoolelliotttriplecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolelliottcorrection:{degree:7,clonable:!0,showWave:!0,color:"rgba( 61, 133, 198, 1)",linewidth:1},linetoolelliottdoublecombo:{degree:7,clonable:!0,showWave:!0,color:"rgba( 106, 168, 79, 1)",linewidth:1},linetoolbarspattern:{singleChartOnly:!0,color:"rgba( 80, 145, 204, 1)",clonable:!0,mode:u.Bars,mirrored:!1,flipped:!1},linetoolghostfeed:{singleChartOnly:!0,clonable:!0,averageHL:20,variance:50,candleStyle:{upColor:"#6ba583",downColor:"#d75442",drawWick:!0,drawBorder:!0,borderColor:"#378658",borderUpColor:"#225437",borderDownColor:"#5b1a13",wickColor:"#737375"},transparency:50},study:{inputs:{},styles:{},palettes:{},bands:{},area:{},graphics:{},showInDataWindow:!0,visible:!0,showStudyArguments:!0,precision:"default"},linetoolpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:h.Original,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:m.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:m.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:m.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:m.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:m.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:m.c(1,"rgba( 0, 0, 153, 1)",!0),level6:m.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:m.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:m.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolpitchfan:{clonable:!0,fillBackground:!0,transparency:80,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:m.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:m.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:m.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:m.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:m.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:m.c(1,"rgba( 0, 0, 153, 1)",!0),level6:m.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:m.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:m.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolgannfan:{clonable:!0,showLabels:!0,font:"Verdana",fillBackground:!0,transparency:80,level1:m.f(1,8,"rgba( 160, 107, 0, 1)",!0),level2:m.f(1,4,"rgba( 105, 158, 0, 1)",!0),level3:m.f(1,3,"rgba( 0, 155, 0, 1)",!0),level4:m.f(1,2,"rgba( 0, 153, 101, 1)",!0),level5:m.f(1,1,"rgba( 128, 128, 128, 1)",!0),level6:m.f(2,1,"rgba( 0, 101, 153, 1)",!0),
level7:m.f(3,1,"rgba( 0, 0, 153, 1)",!0),level8:m.f(4,1,"rgba( 102, 0, 153, 1)",!0),level9:m.f(8,1,"rgba( 165, 0, 0, 1)",!0),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolganncomplex:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,scaleRatio:"",showLabels:!0,labelsStyle:{font:"Verdana",fontSize:12,bold:!1,italic:!1},levels:[m.d("rgba( 128, 128, 128, 1)",!0,1),m.d("rgba( 160, 107, 0, 1)",!0,1),m.d("rgba( 105, 158, 0, 1)",!0,1),m.d("rgba( 0, 155, 0, 1)",!0,1),m.d("rgba( 0, 153, 101, 1)",!0,1),m.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[m.e("rgba( 165, 0, 255, 1)",!1,1,8,1),m.e("rgba( 165, 0, 0, 1)",!1,1,5,1),m.e("rgba( 128, 128, 128, 1)",!1,1,4,1),m.e("rgba( 160, 107, 0, 1)",!1,1,3,1),m.e("rgba( 105, 158, 0, 1)",!0,1,2,1),m.e("rgba( 0, 155, 0, 1)",!0,1,1,1),m.e("rgba( 0, 153, 101, 1)",!0,1,1,2),m.e("rgba( 0, 153, 101, 1)",!1,1,1,3),m.e("rgba( 0, 0, 153, 1)",!1,1,1,4),m.e("rgba( 102, 0, 153, 1)",!1,1,1,5),m.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[m.e("rgba( 160, 107, 0, 1)",!0,1,1,0),m.e("rgba( 160, 107, 0, 1)",!0,1,1,1),m.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),m.e("rgba( 105, 158, 0, 1)",!0,1,2,0),m.e("rgba( 105, 158, 0, 1)",!0,1,2,1),m.e("rgba( 0, 155, 0, 1)",!0,1,3,0),m.e("rgba( 0, 155, 0, 1)",!0,1,3,1),m.e("rgba( 0, 153, 101, 1)",!0,1,4,0),m.e("rgba( 0, 153, 101, 1)",!0,1,4,1),m.e("rgba( 0, 0, 153, 1)",!0,1,5,0),m.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannfixed:{clonable:!0,fillBackground:!1,arcsBackground:{fillBackground:!0,transparency:80},reverse:!1,levels:[m.d("rgba( 128, 128, 128, 1)",!0,1),m.d("rgba( 160, 107, 0, 1)",!0,1),m.d("rgba( 105, 158, 0, 1)",!0,1),m.d("rgba( 0, 155, 0, 1)",!0,1),m.d("rgba( 0, 153, 101, 1)",!0,1),m.d("rgba( 128, 128, 128, 1)",!0,1)],fanlines:[m.e("rgba( 165, 0, 255, 1)",!1,1,8,1),m.e("rgba( 165, 0, 0, 1)",!1,1,5,1),m.e("rgba( 128, 128, 128, 1)",!1,1,4,1),m.e("rgba( 160, 107, 0, 1)",!1,1,3,1),m.e("rgba( 105, 158, 0, 1)",!0,1,2,1),m.e("rgba( 0, 155, 0, 1)",!0,1,1,1),m.e("rgba( 0, 153, 101, 1)",!0,1,1,2),m.e("rgba( 0, 153, 101, 1)",!1,1,1,3),m.e("rgba( 0, 0, 153, 1)",!1,1,1,4),m.e("rgba( 102, 0, 153, 1)",!1,1,1,5),m.e("rgba( 165, 0, 255, 1)",!1,1,1,8)],arcs:[m.e("rgba( 160, 107, 0, 1)",!0,1,1,0),m.e("rgba( 160, 107, 0, 1)",!0,1,1,1),m.e("rgba( 160, 107, 0, 1)",!0,1,1.5,0),m.e("rgba( 105, 158, 0, 1)",!0,1,2,0),m.e("rgba( 105, 158, 0, 1)",!0,1,2,1),m.e("rgba( 0, 155, 0, 1)",!0,1,3,0),m.e("rgba( 0, 155, 0, 1)",!0,1,3,1),m.e("rgba( 0, 153, 101, 1)",!0,1,4,0),m.e("rgba( 0, 153, 101, 1)",!0,1,4,1),m.e("rgba( 0, 0, 153, 1)",!0,1,5,0),m.e("rgba( 0, 0, 153, 1)",!0,1,5,1)],
__collectibleLines:["trendline","levels.0","levels.1","levels.2","levels.3","levels.4","levels.5","fanlines.0","fanlines.1","fanlines.2","fanlines.3","fanlines.4","fanlines.5","fanlines.6","fanlines.7","fanlines.8","fanlines.9","fanlines.10","arcs.0","arcs.1","arcs.2","arcs.3","arcs.4","arcs.5","arcs.6","arcs.7","arcs.8","arcs.9","arcs.10"]},linetoolgannsquare:{clonable:!0,color:"rgba( 21, 56, 153, 0.8)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,fillHorzBackground:!0,horzTransparency:80,fillVertBackground:!0,vertTransparency:80,reverse:!1,fans:m.a("rgba( 128, 128, 128, 1)",!1),hlevel1:m.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:m.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:m.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:m.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:m.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:m.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:m.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:m.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:m.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:m.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:m.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:m.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:m.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:m.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["fans","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibspeedresistancefan:{clonable:!0,fillBackground:!0,transparency:80,grid:{color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,visible:!0},linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,font:"Verdana",showTopLabels:!0,showBottomLabels:!0,showLeftLabels:!0,showRightLabels:!0,snapTo45Degrees:!0,hlevel1:m.b(0,"rgba( 128, 128, 128, 1)",!0),hlevel2:m.b(.25,"rgba( 160, 107, 0, 1)",!0),hlevel3:m.b(.382,"rgba( 105, 158, 0, 1)",!0),hlevel4:m.b(.5,"rgba( 0, 155, 0, 1)",!0),hlevel5:m.b(.618,"rgba( 0, 153, 101, 1)",!0),hlevel6:m.b(.75,"rgba( 0, 101, 153, 1)",!0),hlevel7:m.b(1,"rgba( 128, 128, 128, 1)",!0),vlevel1:m.b(0,"rgba( 128, 128, 128, 1)",!0),vlevel2:m.b(.25,"rgba( 160, 107, 0, 1)",!0),vlevel3:m.b(.382,"rgba( 105, 158, 0, 1)",!0),vlevel4:m.b(.5,"rgba( 0, 155, 0, 1)",!0),vlevel5:m.b(.618,"rgba( 0, 153, 101, 1)",!0),vlevel6:m.b(.75,"rgba( 0, 101, 153, 1)",!0),vlevel7:m.b(1,"rgba( 128, 128, 128, 1)",!0),__collectibleLines:["trendline","hlevel1","hlevel2","hlevel3","hlevel4","hlevel5","hlevel6","hlevel7","vlevel1","vlevel2","vlevel3","vlevel4","vlevel5","vlevel6","vlevel7"]},linetoolfibretracement:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:m.b(0,"rgba( 128, 128, 128, 1)",!0),level2:m.b(.236,"rgba( 204, 40, 40, 1)",!0),
level3:m.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:m.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:m.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:m.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:m.b(1,"rgba( 128, 128, 128, 1)",!0),level8:m.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:m.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:m.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:m.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:m.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:m.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:m.b(2,"rgba( 40, 204, 149, 1)",!1),level14:m.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:m.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:m.b(3,"rgba( 40, 149, 204, 1)",!1),level18:m.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:m.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:m.b(4,"rgba( 204, 40, 40, 1)",!1),level21:m.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:m.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:m.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:m.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolfibchannel:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLeft:!1,extendRight:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",coeffsAsPercents:!1,levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:m.b(0,"rgba( 128, 128, 128, 1)",!0),level2:m.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:m.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:m.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:m.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:m.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:m.b(1,"rgba( 128, 128, 128, 1)",!0),level8:m.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:m.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:m.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:m.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:m.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:m.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:m.b(2,"rgba( 40, 204, 149, 1)",!1),level14:m.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:m.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:m.b(3,"rgba( 40, 149, 204, 1)",!1),level18:m.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:m.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:m.b(4,"rgba( 204, 40, 40, 1)",!1),level21:m.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:m.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:m.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:m.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetoolprojection:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,color1:"rgba( 0, 128, 0, 0.2)",color2:"rgba( 255, 0, 0, 0.2)",linewidth:1,trendline:{visible:!0,
color:"rgba( 128, 128, 128, 1)",linestyle:CanvasEx.LINESTYLE_SOLID},level1:m.c(1,"rgba( 128, 128, 128, 1)",!0)},linetool5pointspattern:{clonable:!0,color:"rgba( 204, 40, 149, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 204, 40, 149, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolcypherpattern:{clonable:!0,color:"#CC2895",textcolor:"#FFFFFF",fillBackground:!0,backgroundColor:"#CC2895",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetooltrianglepattern:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:1},linetoolabcd:{clonable:!0,color:"rgba( 0, 155, 0, 1)",textcolor:"rgba( 255, 255, 255, 1)",font:"Verdana",fontsize:12,bold:!1,italic:!1,linewidth:2},linetoolthreedrivers:{clonable:!0,color:"rgba( 149, 40, 255, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 149, 40, 204, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolheadandshoulders:{clonable:!0,color:"rgba( 69, 104, 47, 1)",textcolor:"rgba( 255, 255, 255, 1)",fillBackground:!0,backgroundColor:"rgba( 69, 168, 47, 0.5)",font:"Verdana",fontsize:12,bold:!1,italic:!1,transparency:50,linewidth:2},linetoolfibwedge:{singleChartOnly:!0,clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:m.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:m.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:m.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:m.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:m.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:m.c(1,"rgba( 128, 128, 128, 1)",!0),level7:m.c(1.618,"rgba( 40, 40, 204, 1)",!1),level8:m.c(2.618,"rgba( 204, 40, 40, 1)",!1),level9:m.c(3.618,"rgba( 149, 40, 204, 1)",!1),level10:m.c(4.236,"rgba( 204, 40, 149, 1)",!1),level11:m.c(4.618,"rgba( 204, 40, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibcircles:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,snapTo45Degrees:!0,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:m.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:m.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:m.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:m.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:m.c(1,"rgba( 128, 128, 128, 1)",!0),level7:m.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:m.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:m.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:m.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:m.c(4.618,"rgba( 204, 40, 149, 1)",!0),
__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolfibspeedresistancearcs:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,fullCircles:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m.c(.236,"rgba( 204, 40, 40, 1)",!0),level2:m.c(.382,"rgba( 149, 204, 40, 1)",!0),level3:m.c(.5,"rgba( 40, 204, 40, 1)",!0),level4:m.c(.618,"rgba( 40, 204, 149, 1)",!0),level5:m.c(.786,"rgba( 40, 149, 204, 1)",!0),level6:m.c(1,"rgba( 128, 128, 128, 1)",!0),level7:m.c(1.618,"rgba( 40, 40, 204, 1)",!0),level8:m.c(2.618,"rgba( 204, 40, 40, 1)",!0),level9:m.c(3.618,"rgba( 149, 40, 204, 1)",!0),level10:m.c(4.236,"rgba( 204, 40, 149, 1)",!0),level11:m.c(4.618,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetooltrendbasedfibextension:{clonable:!0,showCoeffs:!0,showPrices:!0,font:"Verdana",fillBackground:!0,transparency:80,extendLines:!1,horzLabelsAlign:"left",vertLabelsAlign:"middle",reverse:!1,coeffsAsPercents:!1,trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},levelsStyle:{linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level1:m.b(0,"rgba( 128, 128, 128, 1)",!0),level2:m.b(.236,"rgba( 204, 40, 40, 1)",!0),level3:m.b(.382,"rgba( 149, 204, 40, 1)",!0),level4:m.b(.5,"rgba( 40, 204, 40, 1)",!0),level5:m.b(.618,"rgba( 40, 204, 149, 1)",!0),level6:m.b(.786,"rgba( 40, 149, 204, 1)",!0),level7:m.b(1,"rgba( 128, 128, 128, 1)",!0),level8:m.b(1.618,"rgba( 40, 40, 204, 1)",!0),level9:m.b(2.618,"rgba( 204, 40, 40, 1)",!0),level10:m.b(3.618,"rgba( 149, 40, 204, 1)",!0),level11:m.b(4.236,"rgba( 204, 40, 149, 1)",!0),level12:m.b(1.272,"rgba( 149, 204, 40, 1)",!1),level13:m.b(1.414,"rgba( 204, 40, 40, 1)",!1),level16:m.b(2,"rgba( 40, 204, 149, 1)",!1),level14:m.b(2.272,"rgba( 149, 204, 40, 1)",!1),level15:m.b(2.414,"rgba( 40, 204, 40, 1)",!1),level17:m.b(3,"rgba( 40, 149, 204, 1)",!1),level18:m.b(3.272,"rgba( 128, 128, 128, 1)",!1),level19:m.b(3.414,"rgba( 40, 40, 204, 1)",!1),level20:m.b(4,"rgba( 204, 40, 40, 1)",!1),level21:m.b(4.272,"rgba( 149, 40, 204, 1)",!1),level22:m.b(4.414,"rgba( 204, 40, 149, 1)",!1),level23:m.b(4.618,"rgba( 149, 204, 40, 1)",!1),level24:m.b(4.764,"rgba( 40, 204, 149, 1)",!1),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11","level12","level13","level14","level15","level16","level17","level18","level19","level20","level21","level22","level23","level24"]},linetooltrendbasedfibtime:{clonable:!0,showCoeffs:!0,font:"Verdana",fillBackground:!0,transparency:80,horzLabelsAlign:"right",vertLabelsAlign:"bottom",trendline:{visible:!0,color:"rgba( 128, 128, 128, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED},level1:m.c(0,"rgba( 128, 128, 128, 1)",!0),level2:m.c(.382,"rgba( 204, 40, 40, 1)",!0),
level3:m.c(.5,"rgba( 149, 204, 40, 1)",!1),level4:m.c(.618,"rgba( 40, 204, 40, 1)",!0),level5:m.c(1,"rgba( 40, 204, 149, 1)",!0),level6:m.c(1.382,"rgba( 40, 149, 204, 1)",!0),level7:m.c(1.618,"rgba( 128, 128, 128, 1)",!0),level8:m.c(2,"rgba( 40, 40, 204, 1)",!0),level9:m.c(2.382,"rgba( 204, 40, 40, 1)",!0),level10:m.c(2.618,"rgba( 149, 40, 204, 1)",!0),level11:m.c(3,"rgba( 204, 40, 149, 1)",!0),__collectibleLines:["trendline","level1","level2","level3","level4","level5","level6","level7","level8","level9","level10","level11"]},linetoolschiffpitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:h.Schiff,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:m.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:m.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:m.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:m.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:m.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:m.c(1,"rgba( 0, 0, 153, 1)",!0),level6:m.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:m.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:m.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolschiffpitchfork2:{clonable:!0,fillBackground:!0,transparency:80,style:h.Schiff2,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:m.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:m.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:m.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:m.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:m.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:m.c(1,"rgba( 0, 0, 153, 1)",!0),level6:m.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:m.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:m.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetoolinsidepitchfork:{clonable:!0,fillBackground:!0,transparency:80,style:h.Inside,median:{visible:!0,color:"rgba( 165, 0, 0, 1)",linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID},level0:m.c(.25,"rgba( 160, 107, 0, 1)",!1),level1:m.c(.382,"rgba( 105, 158, 0, 1)",!1),level2:m.c(.5,"rgba( 0, 155, 0, 1)",!0),level3:m.c(.618,"rgba( 0, 153, 101, 1)",!1),level4:m.c(.75,"rgba( 0, 101, 153, 1)",!1),level5:m.c(1,"rgba( 0, 0, 153, 1)",!0),level6:m.c(1.5,"rgba( 102, 0, 153, 1)",!1),level7:m.c(1.75,"rgba( 153, 0, 102, 1)",!1),level8:m.c(2,"rgba( 165, 0, 0, 1)",!1),__collectibleLines:["median","level0","level1","level2","level3","level4","level5","level6","level7","level8"]},linetool:{frozen:!1,visible:!0},linetoolvisibilities:{intervalsVisibilities:{seconds:!0,secondsFrom:1,secondsTo:59,minutes:!0,minutesFrom:1,minutesTo:59,hours:!0,hoursFrom:1,hoursTo:24,days:!0,daysFrom:1,daysTo:366,weeks:!0,months:!0}}},n(TradingView.defaultProperties.chartproperties),r()}for(void 0===TradingView.defaultProperties["study_MA@tv-basicstudies"]&&(TradingView.defaultProperties["study_MA@tv-basicstudies"]={description:"Moving Average",shortDescription:"MA",inputs:{length:9,source:"close"},styles:{
MovAvg:{visible:!0,color:"rgba( 4, 150, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0,title:"MA"}}}),void 0===TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnUpdate@tv-basicstudies"]={description:"Error On Update",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnCreate@tv-basicstudies"]={description:"Error On Create",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 0, 255, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]&&(TradingView.defaultProperties["study_ErrorOnNewBar@tv-basicstudies"]={description:"Error On New Bar",styles:{ErrorOnUpdate:{visible:!0,color:"rgba( 0, 0, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0}}}),void 0===TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]&&(TradingView.defaultProperties["study_PivotPointsHighLow@tv-basicstudies"]={font:"Arial",fontsize:10,borderColor:"rgba( 83, 143, 31, 1)",backColor:"rgba( 240, 255, 204, 1)",textColor:"rgba( 0, 0, 0, 1)"}),void 0===TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]&&(i="rgba( 212, 121, 40, 1)",o=!0,s=1,TradingView.defaultProperties["study_PivotPointsStandard@tv-basicstudies"]={_hardCodedDefaultsVersion:1,font:"Arial",fontsize:11,levelsStyle:{showLabels:!0,visibility:{P:o,"S1/R1":o,"S2/R2":o,"S3/R3":o,"S4/R4":o,"S5/R5":o},colors:{P:i,"S1/R1":i,"S2/R2":i,"S3/R3":i,"S4/R4":i,"S5/R5":i},widths:{P:s,"S1/R1":s,"S2/R2":s,"S3/R3":s,"S4/R4":s,"S5/R5":s}}}),void 0===TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]&&(TradingView.defaultProperties["study_ZigZag@tv-basicstudies"]={color:"rgba( 86, 135, 29, 1)",linewidth:2}),void 0===TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]&&(TradingView.defaultProperties["study_ElliottWave@tv-basicstudies"]={inputs:{},level0:m.a("rgba( 255, 0, 0, 1)",!1),level1:m.a("rgba( 0, 128, 0, 1)",!1),level2:m.a("rgba( 0, 0, 255, 1)",!1),level3:m.a("rgba( 255, 0, 255, 1)",!1),level4:m.a("rgba( 0, 128, 255, 1)",!0),level5:m.a("rgba( 255, 0, 0, 1)",!0),level6:m.a("rgba( 0, 128, 0, 1)",!0),level7:m.a("rgba( 0, 0, 255, 1)",!0),level8:m.a("rgba( 255, 0, 255, 1)",!0)}),void 0===TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]&&(TradingView.defaultProperties["study_LinearRegression@tv-basicstudies"]={styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!0,showPearsons:!0,
backgroundColor:"rgba( 153, 21, 21, 0.3)",transparency:70}}),void 0===TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]&&(TradingView.defaultProperties["study_RegressionTrend@tv-basicstudies"]={linewidth:1,linestyle:CanvasEx.LINESTYLE_SOLID,styles:{upLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},downLine:{visible:!0,color:"rgba( 0, 0, 255, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},baseLine:{visible:!0,color:"rgba( 255, 0, 0, 0.3)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1},extendLines:!1,showPearsons:!0,transparency:70}}),void 0===TradingView.defaultProperties["study_Compare@tv-basicstudies"]&&(TradingView.defaultProperties["study_Compare@tv-basicstudies"]={minTick:"default"}),void 0===TradingView.defaultProperties["study_Overlay@tv-basicstudies"]&&(a="study_Overlay@tv-basicstudies",TradingView.defaultProperties[a]={style:c.STYLE_BARS,showPriceLine:!1,minTick:"default",candleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},hollowCandleStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",drawWick:!0,drawBorder:!0,borderColor:"rgba( 55, 134, 88, 1)",borderUpColor:"rgba( 34, 84, 55, 1)",borderDownColor:"rgba( 91, 26, 19, 1)",wickColor:"rgba( 115, 115, 117, 1)",wickUpColor:"rgba( 115, 115, 117, 1)",wickDownColor:"rgba( 115, 115, 117, 1)",barColorsOnPrevClose:!1},barStyle:{upColor:"rgba( 107, 165, 131, 1)",downColor:"rgba( 215, 84, 66, 1)",barColorsOnPrevClose:!1,dontDrawOpen:!1},lineStyle:{color:"rgba( 3, 3, 247, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",styleType:c.STYLE_LINE_TYPE_SIMPLE},areaStyle:{color1:"rgba( 96, 96, 144, 0.5)",color2:"rgba( 1, 246, 245, 0.5)",linecolor:"rgba( 0, 148, 255, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,priceSource:"close",transparency:50},baselineStyle:{baselineColor:"rgba( 117, 134, 150, 1)",topFillColor1:"rgba( 83, 185, 135, 0.1)",topFillColor2:"rgba( 83, 185, 135, 0.1)",bottomFillColor1:"rgba( 235, 77, 92, 0.1)",bottomFillColor2:"rgba( 235, 77, 92, 0.1)",topLineColor:"rgba( 83, 185, 135, 1)",bottomLineColor:"rgba( 235, 77, 92, 1)",topLineWidth:1,bottomLineWidth:1,priceSource:"close",transparency:50,baseLevelPercentage:50},styles:{open:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},high:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},low:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0},close:{visible:!0,color:"rgba( 255, 0, 0, 1)",linestyle:CanvasEx.LINESTYLE_SOLID,linewidth:1,plottype:p.Line,histogramBase:0}}}),l=t.split("."),
d=TradingView.defaultProperties,f=0;f<l.length;f++)d&&(d=d[l[f]]);return d?TradingView.clone(d):{}};s.create=function(t,e){if(e){var i=m(t);TradingView.defaultProperties[t]=$.extend(e,i)}},s.remove=function(t){TradingView.defaultProperties[t]=void 0},TradingView.saveDefaults=function(t,e){TVSettings.setJSON(t,e)},TradingView.factoryDefaults=m,window.applyDefaultOverridesToLinetools=r,window.applyDefaultsOverrides=n,window.applyPropertiesOverrides=o,window.defaults=s,e.applyDefaultOverridesToLinetools=r,e.applyDefaultsOverrides=n,e.applyPropertiesOverrides=o,e.defaults=s,e.factoryDefaults=m,e.saveDefaults=TradingView.saveDefaults},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Original=0]="Original",t[t.Schiff=1]="Schiff",t[t.Inside=2]="Inside",t[t.Schiff2=3]="Schiff2"}(e.LineToolPitchforkStyle||(e.LineToolPitchforkStyle={}))},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=function(){function t(t,e){this._major=t,this._minor=e}return t.prototype.major=function(){return this._major},t.prototype.minor=function(){return this._minor},t.prototype.isZero=function(){return 0===this._major&&0===this._minor},t.prototype.toString=function(){return this._major+"."+this._minor},t.prototype.compareTo=function(t){return this._major<t._major?-1:this._major>t._major?1:this._minor<t._minor?-1:this._minor>t._minor?1:0},t.prototype.isLess=function(t){return this.compareTo(t)<0},t.prototype.isLessOrEqual=function(t){return this.compareTo(t)<=0},t.prototype.isEqual=function(t){return 0===this.compareTo(t)},t.prototype.isGreater=function(t){return this.compareTo(t)>0},t.prototype.isGreaterOrEqual=function(t){return this.compareTo(t)>=0},t.parse=function(e){var i,n,r;if(e instanceof t)return new t(e.major(),e.minor());if("number"==typeof e)return o.assert(Math.floor(e)===e,"Version should not be a float number"),new t(e,0);if("string"==typeof e){if(i=e.split("."),1===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),new t(n,0);if(2===i.length)return n=parseInt(i[0],10),o.assert(!isNaN(n),"Bad version string: "+e),r=parseInt(i[1],10),o.assert(!isNaN(r),"Bad version string: "+e),new t(n,r);throw Error("Bad version string (one dot expected): "+e)}throw Error("Bad version: "+e)},t.ZERO=new t(0,0),t}(),e.Version=n},function(t,e,i){"use strict";function o(t){this._studyId=t,this._maxToVers=n.ZERO,this._maxFromVers=n.ZERO,this._migrs=[]}var n=i(300).Version,r=i(7).getLogger("Chart.StudyMigration");o.prototype.addMigration=function(t,e,i){var o=n.parse(t),r=n.parse(e);o.isGreater(this._maxFromVers)&&(this._maxFromVers=o),r.isGreater(this._maxToVers)&&(this._maxToVers=r),this._migrs.push({fromVers:o,toVers:r,rules:i})},o.prototype.updateInputs=function(t,e,i){var o,n,s;if(!i)return i;for(o=TradingView.clone(i),n=t;n.isLess(e)&&null!=(s=this._findMigration(n));){
if(r.logNormal("Migrating study inputs from "+s.fromVers+" to "+s.toVers+" version, studyId: "+this._studyId+", migration: "+JSON.stringify(s)+", inputs: "+JSON.stringify(i)),o=this._applyMigration(o,s),!n.isLess(s.toVers))throw Error("Problems in study migration process... Possible infinite cycle has been detected and stopped.");n=s.toVers}return n>t&&r.logNormal("Study inputs migration is done, studyId: "+this._studyId+", inputs: "+JSON.stringify(o)),o},o.prototype._findMigration=function(t){var e,i,o=-1,n=this._maxFromVers;for(e=0;e<this._migrs.length;e++)i=this._migrs[e],i.fromVers.isLess(t)||i.fromVers.isLessOrEqual(n)&&(n=i.fromVers,o=e);return o<0?null:this._migrs[o]},o.prototype._applyMigration=function(t,e){var i,o,n,r=t;for(i=0;i<e.rules.length;i++)o=e.rules[i],n=this._getApplyRuleFun(o.type),r=n(r,o);return r},o.prototype._getApplyRuleFun=function(t){if("inputRemoved"===t)return o._applyInputRemovedRule;if("inputChangedType"===t)return o._applyInputChangedTypeRule;if("inputChangedMinMax"===t)return o._applyInputChangedMinMaxRule;if("inputChangedOptions"===t)return o._applyInputChangedOptionsRule;throw Error("Unknown migration rule type: "+t)},o._applyInputRemovedRule=function(t,e){if(!(e.inputId in t))return t;if("removeVal"!==e.action)throw Error("Unexpected rule.action="+e.action+" in rule.type="+e.type);var i=t[e.inputId];return delete t[e.inputId],r.logNormal("Input "+e.inputId+"="+i+" removed"),t},o._applyInputChangedTypeRule=function(t,e){var i=t[e.inputId];if("resetToDefVal"===e.action)return t[e.inputId]=e.defVal,r.logNormal("Input "+e.inputId+"="+i+" reset to default value "+e.defVal),t;if("convertVal"===e.action){if(null==i)return t;if("float"===e.inputTypeFrom&&"integer"===e.inputType)return t[e.inputId]=Math.round(t[e.inputId]),r.logNormal("Input "+e.inputId+"="+i+" converted to value "+t[e.inputId]),t;if("integer"===e.inputTypeFrom&&"float"===e.inputType)return t;if("text"===e.inputTypeFrom&&"source"===e.inputType)return o._isValidSource(i,e.options)?t:(t[e.inputId]=e.defVal,t);throw Error("Cannot convertVal from "+e.inputTypeFrom+" to "+e.inputType)}throw Error("Unknown action "+e.action+" for rule with type "+e.type)},o._isValidSource=function(t,e){return t.indexOf("$")>=0||e.indexOf(t)>=0},o._applyInputChangedMinMaxRule=function(t,e){if("adjustValIfNeeded"!==e.action)throw Error("Unknown action "+e.action+" for rule with type "+e.type);var i=t[e.inputId];return i<e.minVal?t[e.inputId]=e.minVal:i>e.maxVal&&(t[e.inputId]=e.maxVal),r.logNormal("Input "+e.inputId+"="+i+" adjusted to value "+t[e.inputId]),t},o._applyInputChangedOptionsRule=function(t,e){if(!(["text"].indexOf(e.inputType)>=0&&"resetToDefValIfNeeded"===e.action))throw Error("Unexpected rule.inputType="+e.inputType+" in rule.action="+e.action);var i=t[e.inputId];return e.options.indexOf(i)<0&&(t[e.inputId]=e.defVal,r.logNormal("Input "+e.inputId+"="+i+" reset to default value "+e.defVal)),t},t.exports=o},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M4.034 14.18l-.07-.18.07-.18c1.535-3.975 5.645-6.82 9.966-6.82 4.32 0 8.431 2.845 9.966 6.82l.07.18-.07.18c-1.535 3.975-5.646 6.82-9.966 6.82-4.321 0-8.431-2.845-9.966-6.82zm9.966 5.82c3.84 0 7.521-2.503 8.962-6-1.441-3.497-5.122-6-8.962-6-3.841 0-7.521 2.503-8.962 6 1.441 3.497 5.121 6 8.962 6z"/><path d="M11 14.001c0 1.66 1.341 2.999 3.001 2.999s2.999-1.339 2.999-2.999c0-1.66-1.339-3.001-2.999-3.001-1.66 0-3.001 1.341-3.001 3.001z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 10" width="20" height="10"><path fill="none" stroke="currentColor" stroke-width="1.5" d="M2 1l8 8 8-8"/></svg>'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return t.reduce(function(t,e,i){return~t.indexOf(e)||t.push(e),t},[])},t.exports=e.default},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M22.5 4v-1h-19.5v19.5h1v-18.5z"/><path d="M5.493 24v1h19.507v-19.5h-1v18.5z"/><path d="M5.275 23.432l18.213-18.213-.707-.707-18.213 18.213z"/><path d="M5.568 24.383l19.079-5.906-.296-.955-19.079 5.906z" id="Line-Copy-18"/><path d="M4.587 22.68l5.891-19.032-.955-.296-5.891 19.032z"/><path d="M3.5 11h21v-1h-21z"/><path d="M3.5 18h21v-1h-21z"/><path d="M10 3.5v21h1v-21z"/><path d="M17 3.5v21h1v-21z"/><path d="M23.975 23.475l1.025 1.025c0-11.874-9.626-21.5-21.5-21.5l1.025 1.025c10.506.517 18.932 8.944 19.45 19.45z"/><path d="M3.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(24),n=i(5),r=i(17),s=!n.enabled("hide_left_toolbar_by_default"),a=o.getBool("ChartDrawingToolbarWidget.visible",s),e.isDrawingToolbarVisible=new r(a)},function(t,e,i){"use strict";function o(t){var e=t.action,i=t.isActive,o=t.isBgFull,a=t.isHidden,l=t.isTransparent,c=t.toolName;return n.createElement(s.ToolButton,{icon:r.lineToolsInfo[c].icon,isActive:i,isBgFull:o,isHidden:a,isTransparent:l,onClick:e,title:r.lineToolsInfo[c].localizedName})}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(66),s=i(151),e.ToolButtonAction=o},function(t,e,i){"use strict";function o(){var t,e,i=[];for(i=i.concat([61536,61537,61538,61539]),i=i.concat([61725,61726]),i=i.concat([61575,61576,61796,61797]),i=i.concat([61779,61780,61781,61782,61783,61784,61785,61786]),t=i.slice(0),e=61440;e<=61846;e++)-1===i.indexOf(e)&&(e%16==15&&61487!==e||e>=61620&&e<=61630||61718!==e&&61719!==e&&61472!==e&&61619!==e&&t.push(e));return t}Object.defineProperty(e,"__esModule",{value:!0}),
e.availableIcons=o()},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(10),n=i(24),function(t){function e(e){return t.favorites.indexOf(e)}function i(){t.favorites=[],n.getJSON("chart.favoriteDrawings",[]).forEach(function(e){t.favorites.push(e.tool||e)}),t.favoritesSynced.fire()}function r(){n.setJSON("chart.favoriteDrawings",t.favorites)}t.favorites=[],t.favoritesSynced=new o,t.favoriteIndex=e,t.saveFavorites=r,i(),n.onSync.subscribe(null,i)}(r||(r={})),function(t){function e(){return r.favorites.slice()}function i(){return r.favorites.length}function n(t){return t<0||t>=i()?"":r.favorites[t]}function s(e){return!l(e)&&(r.favorites.push(e),r.saveFavorites(),t.favoriteAdded.fire(e),!0)}function a(e){var i=r.favoriteIndex(e);return-1!==i&&(r.favorites.splice(i,1),r.saveFavorites(),t.favoriteRemoved.fire(e),!0)}function l(t){return-1!==r.favoriteIndex(t)}function c(e,o){if(o<0||o>=i())return!1;var n=r.favoriteIndex(e);return-1!==n&&o!==n&&(r.favorites.splice(n,1),r.favorites.splice(o,0,e),r.saveFavorites(),t.favoriteMoved.fire(e,n,o),!0)}t.favoriteAdded=new o,t.favoriteRemoved=new o,t.favoriteMoved=new o,t.favoritesSynced=r.favoritesSynced,t.favorites=e,t.favoritesCount=i,t.favorite=n,t.addFavorite=s,t.removeFavorite=a,t.isFavorite=l,t.moveFavorite=c}(e.LinetoolsFavoritesStore||(e.LinetoolsFavoritesStore={}))},function(t,e,i){"use strict";function o(t,e){var i=P.colorsPalette[t];if(!i)throw Error("No such color "+t);return i}function n(t){return!t.isPrivate}function r(){return e.themes[e.watchedTheme.value()]||e.themes[e.DEFAULT_THEME]}function s(t){return r().getThemedColor(t)}function a(t){e.watchedTheme.setValue(t)}function l(){a(w.getValue(L)||e.DEFAULT_THEME)}function c(){w.setValue(L,r().name,{forceFlush:!0})}function h(t){return T.loadTheme(t)}function u(){return T.loadThemes()}function d(){return C.getStdThemeNames()}function p(t){return C.getStdChartTheme(t).then(function(t){return t||{content:void 0}})}function _(){return C.getStdThemes()}function f(t,e){return T.saveTheme(t,e)}function m(t){return T.removeTheme(t)}function g(t){return T.isThemeExist(t)}function v(t){return C.translateThemeName(t)}function y(t){return C.isStdTheme(t)}function b(t){return{content:{chartProperties:{paneProperties:t.m_model.properties().paneProperties.state(),scalesProperties:t.m_model.properties().scalesProperties.state()},mainSourceProperties:t.m_model.m_mainSeries.properties().state()}}}var S,w,T,C,x,P,L,I;Object.defineProperty(e,"__esModule",{value:!0}),i(737),i(12),S=i(17),w=i(24),T=i(738),C=i(740),x=i(741),P=i(742),e.themes=(I={},I[C.StdTheme.Light]={name:C.StdTheme.Light,label:window.t("Light",{context:"colorThemeName"}),className:"theme-light",order:2,getThemedColor:function(t){return o(t)}},I[C.StdTheme.Dark]={name:C.StdTheme.Dark,label:window.t("Dark",{context:"colorThemeName"}),className:"theme-dark",order:1,getThemedColor:function(t){return o(x[t])}},I),e.DEFAULT_THEME="light",e.watchedTheme=new S,e.watchedTheme.subscribe(function(t){
var i=document.getElementsByTagName("html")[0];Object.keys(e.themes).forEach(function(t){i.classList.remove(e.themes[t].className)}),i.classList.add(e.themes[t].className)}),e.isPublicTheme=n,e.getCurrentTheme=r,e.setThemedColor=s,e.setTheme=a,L="current_theme.name",e.restoreTheme=l,e.syncTheme=c,e.getTheme=h,e.getThemeNames=u,e.getStdThemeNames=d,e.getStdTheme=p,e.getStdThemes=_,e.saveTheme=f,e.removeTheme=m,e.isThemeExist=g,e.translateStdThemeName=v,e.isStdTheme=y,e.extractThemeFromModel=b},function(t,e,i){"use strict";var o=i(23),n=i(15).parseJSONorNot,r=i(7).getLogger("Chart.SaveloadAdapter.Library"),s=function(){var t,e,i,s,a={},l=null;return a.setCustomAdapter=function(t){l=t,r.logNormal("Use custom save-load adapter")},a.initialize=function(o,n,r,a){t=o,e=n,i=r,s=a},a.updateUser=function(t){e=t},a.getCharts=function(o,a){function c(t){t=t.map(function(t){return{id:t.id,name:t.name,image_url:t.id,modified_iso:t.timestamp,short_symbol:t.symbol,interval:t.resolution}}),o(t)}return l?void l.getAllCharts().then(c).catch(a):$.ajax({url:"{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){var e=n(t);if("ok"!==e.status)return r.logWarn("Charts list request failed: "+e.message),void a();c(e.data)}).fail(a)},a.removeChart=function(o,a){if(l)return void l.removeChart(o).then(a);$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&r.logWarn("Chart delete request failed: "+e.message),a()})},a.saveChart=function(o,a,c,h,u,d,p){var _,f=u.id.value(),m={name:o,content:JSON.stringify(h),symbol:a,resolution:c};if(l)return m.id=f,void l.saveChart(m).then(d).catch(p);_="{0}/{1}/charts?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),void 0!==f&&(_+="&chart="+encodeURIComponent(f)),$.ajax({url:_,data:m,type:"POST",crossDomain:!0}).done(function(t){var e=n(t);if("ok"!==e.status)return r.logWarn("Chart save request failed: "+e.message),void p();d(e.id)}).fail(function(){p()})},a.getChartContent=function(o,a,c){function h(t){var e=JSON.parse(t);return e.uid=o.id,e}if(l)return void l.getChartContent(o.id).then(function(t){var e=h(t);a(e)}).catch(c);$.ajax({url:"{0}/{1}/charts?client={2}&user={3}&chart={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o.id)),type:"GET",crossDomain:!0}).done(function(t){var e,i=n(t);if("ok"!==i.status)return void r.logWarn("Chart load request failed: "+i.message);e=h(i.data.content),a(e)}).fail(function(){c&&c()})},a.loadChart=function(t){a.getChartContent(t,function(t){o.emit("chart_load_requested",t)},function(){r.logWarn("Error loading chart")})},a.removeStudyTemplate=function(o,a){if(l)return void l.removeStudyTemplate({name:o}).then(a);$.ajax({
url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"DELETE",crossDomain:!0}).done(function(t){var e=n(t);"ok"!==e.status&&r.logWarn("Chart delete request failed: "+e.message),a()})},a.getStudyTemplateContent=function(o,r){if(l)return void l.getStudyTemplateContent({name:o}).then(function(t){r({content:t})});$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}&template={4}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e),encodeURIComponent(o)),type:"GET",crossDomain:!0}).done(function(t){r(n(t).data)})},a.saveStudyTemplate=function(o,a){var c={name:o.name,content:o.content};if(l)return void l.saveStudyTemplate(c).then(a.bind(null,{error:""})).catch(function(t){a({error:null!=t?""+t:"error"})});$.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"POST",crossDomain:!0,data:c}).done(function(t){var e=n(t);"ok"!==e.status&&r.logWarn("Template save request failed: "+e.message),a({error:"ok"===e.status?"":e.status})})},a._templatesCache=null,a.getStudyTemplatesList=function(o){function c(t){t=t.map(function(t){return{is_default:!1,name:t.name}}),a._templatesCache=t,o(t)}return a._templatesCache?void o(a._templatesCache):(a._templatesCache=[],l?void l.getAllStudyTemplates().then(c):void $.ajax({url:"{0}/{1}/study_templates?client={2}&user={3}".format(i,encodeURIComponent(s),encodeURIComponent(t),encodeURIComponent(e)),type:"GET",crossDomain:!0}).done(function(t){if(null!==a._templatesCache){var e=n(t);if("ok"!==e.status)return void r.logWarn("Templates list request failed: "+e.message);c(e.data)}}))},a.invalidateStudyTemplatesList=function(){a._templatesCache=null},a}();t.exports=s},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={SELECT:"select"};e.events=o},function(t,e,i){"use strict";function o(t){return t.replace(r,s)}function n(t){return void 0===t&&(t=""),t.replace(/(<([^>]+)>)/gi,"")}var r,s;Object.defineProperty(e,"__esModule",{value:!0}),r=/[<"'&>]/g,s=function(t){return"&#"+t.charCodeAt(0)+";"},e.htmlEscape=o,e.removeTags=n},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n;Object.defineProperty(e,"__esModule",{value:!0}),n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.KeyboardListener=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keydown";o(this,t),this._event=e}return n(t,[{key:"regHandlers",value:function(t){this._handlers=t}},{key:"watchOn",value:function(t){this._listener=this._regListener(),this._watchingEl=t,t.addEventListener(this._event,this._listener)}},{key:"stopWatching",value:function(){
this._watchingEl.removeEventListener(this._event,this._listener)}},{key:"_regListener",value:function(){var t=this;return function(e){var i=e.which,o=t._getHandler(i);e.stopPropagation(),o(e)}}},{key:"_getHandler",value:function(t){var e=this._handlers[t],i=function(){},o=function(t){t.preventDefault(),e(t)};return e?o:i}}]),t}()},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o={SELECT:"select",SELECT_CUSTOM:"selectCustom",AFTER_CLOSE_MENU:"afterCloseMenu",BEFORE_OPEN_MENU:"beforeOpenMenu"};e.events=o},function(t,e,i){"use strict";function o(t,e,i){e.toggleClass("i-hidden",""===t.val()),i.fire(t.val())}function n(t){var e,i,n,s=$(l);return t.addClass&&s.addClass(t.addClass),t.withoutControls&&s.addClass("tv-search-row--without-controls"),e=s.find(".js-input-control"),i=s.find(".js-reset-button"),t.placeholder&&e.attr("placeholder",t.placeholder),i[0].addEventListener("click",function(){e.val("").trigger("input").focus()}),n=new r,e.on("input propertychange",o.bind(null,e,i,n)),o(e,i,n),{$control:s,$input:e,inputChangedDelegate:n}}var r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),r=i(10),s=i(383),a=i(762),i(763),l='<div class="tv-search-row"><input class="tv-search-row__input js-input-control" type="text" name="q" value="" autocomplete="off"><span class="tv-search-row__input-reset i-hidden js-reset-button">'+s+'</span><span class="tv-search-row__search-icon">'+a+"</span></div>",e.createSearchControl=n},function(t,e,i){"use strict";function o(t){this._options=t||{},this._setInput(),this._caption=$('<i class="interval-caption">').html("&nbsp;"),this._helpTooltipTrigger=$('<i class="help-tooltip-trigger apply-common-tooltip common-tooltip-below">').text("?").attr("title",$.t("Type the interval number for minute charts (i.e. 5 if it is going to be a five minute chart). Or number plus letter for H (Hourly), D (Daily), W (Weekly), M (Monthly) intervals (i.e. D or 2H)")),this._dialogTitle=$.t("Change Interval")}var n=i(76),r=i(71);o.prototype._setInput=function(){this._input=$('<input type="text" class="change-interval-input" autocomplete="off" maxlength="4">'),this._input.on("keypress",this._handleInput.bind(this)).on("input",function(){this._validate(),this._updateCaption()}.bind(this)).on("blur",function(){setTimeout(this._submit.bind(this),0)}.bind(this))},o.prototype._validate=function(){var t=this._input.val();this._parsed=r.parseIntervalValue(t),this._valid=!this._parsed.error,this._supported=!this._parsed.error&&r.intervalIsSupported(t),!this._supported||this._parsed.unit&&"H"!==this._parsed.unit||this._parsed.qty*("H"===this._parsed.unit?60:1)>1440&&(this._supported=!1)},o.prototype._updateCaption=function(){var t,e,i;this._valid&&this._supported?(e=this._parsed.qty||1,i=this._parsed.unit?{H:"hour",D:"day",W:"week",M:"month",S:"second"}[this._parsed.unit]:"minute",t=e+" "+$.t(i,{count:e}),this._input.add(this._caption).removeClass("error")):(t=this._parsed.error?"&nbsp;":$.t("Not applicable"),this._input.add(this._caption).addClass("error")),this._caption.html(t)},
o.prototype._handleInput=function(t){if(13===t.which)return void this._submit();t.ctrlKey||t.metaKey||!t.charCode||!t.which||t.which<=32||r.isIntervalChar(String.fromCharCode(t.charCode))||t.preventDefault()},o.prototype._submit=function(){var t,e;TVDialogs.isOpen(this._dialogTitle)&&(this._valid&&this._supported&&(t=r.sanitizeIntervalValue(this._input.val()),e=n.interval.value(),t&&e!==t&&"function"==typeof this._options.callback&&this._options.callback(t)),TVDialogs.destroy(this._dialogTitle))},o.prototype._setInitialValue=function(t){var e,i;t=t||this._options.initialValue,e="",i=!1,t&&","!==t?e=r.sanitizeIntervalValue(t)||"":(t=n.interval.value(),e=t,i=!0),this._input.val(e),i&&this._input.select()},o.prototype.isValid=function(){return!!this._valid},o.prototype.show=function(t){var e=TVDialogs.createDialog(this._dialogTitle,{hideCloseCross:!0,addClass:"change-interval-dialog"}),i=e.find("._tv-dialog-content");return e.css("min-width",0),i.css("min-width",0).mousedown(function(t){this._input.is(t.target)||t.preventDefault()}.bind(this)).append(this._input.add(this._caption).add(this._helpTooltipTrigger)),TVDialogs.applyHandlers(e),TVDialogs.positionDialog(e),this._setInitialValue(t),this._validate(),this._updateCaption(),e},t.exports=o},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function s(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolCheckbox=void 0,a=i(204),l=o(a),e.AddSymbolCheckbox=function(t){function e(t){n(this,e),t.checked=TVSettings.getBool("showAddSymbolDialog.checkboxState",!0);var i=r(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return i.$checkbox.change(function(){setTimeout(function(){TVSettings.setValue("showAddSymbolDialog.checkboxState",i.checked)})}),i}return s(e,t),e}(l.default)},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){var i,o,n,r,c,p,_,f,m,g,v,y=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};for(y=$.extend({},{title:$.t("Confirm Inputs"),callback:function(t){}},y),i=null,o=(0,s.createDialog)({title:y.title,contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"></div>',width:u,closeOnClickAtOtherDialogs:!0,destroyOnClose:!0,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',isClickOutFn:function(t){var e=i.symbolSearchPopup()
;if(e)return e[0]!==t.target&&!e[0].contains(t.target)&&void 0},actions:[{name:"apply",type:"primary",text:$.t("Apply"),key:13}]}),d=o,n=(0,l.merge)({},e.defaults.inputs),r=0;r<e.inputs.length;++r)c=e.inputs[r],c.confirm||delete n[c.id];p=new h.default({inputs:n}),_={metaInfo:function(){return e}},f=o.$content,o.open(),i=new a.StudyInputsPropertyPage(p,t.model(),_,!0,o.zIndex),m=i.widget(),f.append(m),Array.prototype.forEach.call(f.find("select"),function(t){var e=$(t),i="tv-select-container dialog";e.hasClass("tv-select-container-fontsize")&&(i+=" tv-select-container-fontsize"),e.selectbox({speed:100,classHolder:i})}),$('input[type="text"]',f).addClass("tv-text-input inset dialog"),$("input.ticker",f).TVTicker(),o.on("action:apply",function(){(0,y.callback)(p.state()),o.close()}),g=o.$content.innerWidth()-o.$content.width(),v=m.width()+g,v>u&&o.$el.css("max-width",v),f.find("input,select").first().focus()}function r(){return d}var s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),e.show=n,e.instance=r,s=i(65),a=i(246),l=i(15),c=i(25),h=o(c),i(241),u=450,d=null},function(t,e,i){function o(t,e,i,o,r,s){if(!t)return void n.logDebug("Missing control");this._control=t,this._property=e,this._applyOnFly=i,this._undoModel=o,this._undoText=r,e&&(this._formatters=[],this._changed=!1,this.setValue(e.value()),e.listeners().subscribe(this,this.propertyChanged))}var n=i(7).getLogger("Chart.PropertyPage.Binding");o.prototype.addFormatter=function(t){this._formatters.push(t),this.setValue(this._property.value())},o.prototype._formatValue=function(t){return this._formatters.reduce(function(t,e){return e(t)},t)},o.prototype._setValueToProperty=function(t){this._setter?this._setter.call(this,t):this.setValueToProperty(t)},o.prototype._attachToControl=function(t,e){var i=this;e?t.on("keyup change input",function(t){var e=i.value();i._setValueToProperty(e),i.setValue(e)}):(t.keypress(function(t){if(this._changed=!0,13===t.which){var e=i.value();i._setValueToProperty(e),i.setValue(e)}}),t.focusout(function(t){var e=i.value();i.changed()&&(i._setValueToProperty(e),i.setValue(e))}),t.change(function(t){var e=i.value();$(t.target).is(".ticker")?(void 0!==i._changeTimerId&&clearTimeout(i._changeTimerId),i._changeTimerId=setTimeout(function(){i._setValueToProperty(e)},250)):i._setValueToProperty(e),i.setValue(e)}))},o.prototype.control=function(){return this._control},o.prototype.changed=function(){return this._changed},o.prototype.setValueToProperty=function(t){this._undoModel.setProperty(this._property,t,this._undoText),this._changed=!1},o.prototype.property=function(){return this._property},o.prototype.propertyChanged=function(t){this.setValue(t.value())},o.prototype.destroy=function(){this._property&&this._property.listeners().unsubscribe(this,this.propertyChanged)},e.Binding=o},function(t,e,i){"use strict";function o(t,e){var i;return function(){clearTimeout(i),i=setTimeout(t.bind.apply(t,[this].concat(Array.prototype.slice.call(arguments))),e)}}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,t.exports=e.default
},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),i(13),i(12),o=i(17),n=i(215),r=i(776),s=i(777),a=function(){function t(t){this._window=t,this._fullscreenApi=new r.FullscreenApi(t.document),this._initFullscreen()}return t.prototype.allocate=function(){var t,e,i,r=this;return this.free(),t=this._window.document,e=$("<div>",t).addClass("js-rootresizer__contents").css({position:"relative",width:"100%",height:"100%"}).prependTo(t.body),this._visibilityApi=new s.VisibilityApi(this._window.document),i={alive:new o(!0),body:new o(e),width:new o,height:new o,availWidth:new o,availHeight:new o,visible:this._visibilityApi.isVisible,fullscreen:this._fullscreenApi.isFullscreen,remove:function(){i.alive.setValue(!1)},attach:function(){i.alive.setValue(!1),r._window.close()},requestFullscreen:function(){r._requestFullscreen()},exitFullscreen:function(){r._exitFullscreen()}},i.alive.subscribe(function(t){t||i!==r._area||r.free()}),this._area=i,this._resizeHandler=function(){var t=i.body.value()[0],e=t.clientWidth,o=t.clientHeight;i.availHeight.setValue(o),i.availWidth.setValue(e),i.height.setValue(o),i.width.setValue(e)},this._resizeHandler(),$(this._window).on("resize",this._resizeHandler),new n.ResizerDetacherState(i).bridge()},t.prototype.free=function(){if(this._resizeHandler&&($(this._window).off("resize",this._resizeHandler),this._resizeHandler=void 0),this._visibilityApi&&(this._visibilityApi.destroy(),this._visibilityApi=void 0),this._area){var t=this._area;this._area=void 0,t.alive.setValue(!1),t.body.value().remove()}},t.prototype._requestFullscreen=function(){this._fullscreenApi.enter()},t.prototype._exitFullscreen=function(){this._fullscreenApi.exit()},t.prototype._initFullscreen=function(){var t=this,e=this._window.document;this._fullscreenApi.isFullscreen.subscribe(function(i){i?(t._$exitFullscreenButton=$("<div>",e).addClass("tv-exit-fullscreen-button").text($.t("Exit Full Screen (ESC)")).on("click",function(e){e.preventDefault(),t._exitFullscreen()}).appendTo(e.body),t._onExitFullscreenEsc=function(e){27===e.keyCode&&(e.preventDefault(),t._exitFullscreen())},$(e).on("keyup",t._onExitFullscreenEsc)):(t._$exitFullscreenButton&&(t._$exitFullscreenButton.remove(),t._$exitFullscreenButton=void 0),t._onExitFullscreenEsc&&($(e).off("keyup",t._onExitFullscreenEsc),t._onExitFullscreenEsc=void 0)),t._resizeHandler&&t._resizeHandler()})},t}(),e.Root=a},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(72),r=function(t){function e(e){var i=t.call(this,e,!1)||this;return i._subcommands=[],i}return o.__extends(e,t),e.prototype.addCommand=function(t){this._subcommands.push(t)},e.prototype.isEmpty=function(){return 0===this._subcommands.length},e.prototype.redo=function(){for(var t=0;t<this._subcommands.length;t++)this._subcommands[t].redo()},e.prototype.undo=function(){for(var t=this._subcommands.length-1;t>=0;t--)this._subcommands[t].undo()},e}(n.UndoCommand),e.UndoMacroCommand=r},function(t,e,i){"use strict";var o,n,r
;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(67),r=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){t.visible=!1;var e=this._source.lastValueData(this._data.plotIndex,!1);e.noData||(t.background=e.color,t.color=this.generateTextColor(e.color),t.coordinate=e.coordinate,t.floatCoordinate=e.floatCoordinate,t.text=e.text,t.visible=!0)},e}(n.PriceAxisView),e.StudyPriceAxisView=r},function(t,e,i){"use strict";function o(t){this.bars=t.bars,this.barSpacing=t.barSpacing,this.barWidth=n.optimalBarWidth(t.barSpacing),this.barLineWidth=Math.max(1,Math.round(this.barWidth)),this.dontDrawOpen=t.dontDrawOpen}var n=i(45),r=i(11);o.prototype.draw=function(t){var e,i,o;for(t.save(),t.translate(.5,.5),i=0;i<this.bars.length;++i)o=this.bars[i],e!==o.color&&(t.fillStyle=o.color,e=o.color),t.fillRect(Math.round(o.time-this.barLineWidth/2),Math.round(o.high-this.barWidth/2),Math.round(this.barLineWidth),Math.round(o.low-o.high+this.barWidth)),this.barLineWidth<this.barSpacing-1&&(this.dontDrawOpen||t.fillRect(Math.round(o.time-1.5*this.barWidth),Math.round(o.open-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)),t.fillRect(Math.round(o.time),Math.round(o.close-this.barWidth/2),Math.round(1.5*this.barWidth),Math.round(this.barWidth)));t.restore()},o.prototype.hitTest=function(t){var e,i,o,s,a=this.bars,l=.5*this.barSpacing;if(0===a.length)return null;if(t.x<a[0].time-l)return null;if(t.x>a[a.length-1].time+l)return null;for(e=null,i=0;i<a.length;++i)if(o=a[i],t.x<=o.time+l){e=o;break}return s=n.selectionTolerance(this.barLineWidth),e&&e.high-s<=t.y&&t.y<=e.low+s?new r(r.REGULAR):null},e.PaneRendererBars=TradingView.PaneRendererBars=o},function(t,e,i){"use strict";function o(t){t.forceLineColor=!1,r.call(this,t),this.color1=t.color1,this.color2=t.color2,this.bottom=t.bottom,this.isSeries=!!t.isSeries,this._simpleMode=t.simpleMode}var n=i(45).coordinateIsValid,r=i(176).PaneRendererLine;inherit(o,r),o.prototype.draw=function(t){var e,i,o,s,a,l,c,h,u,d,p,_;if(0!==this.items.length){for(t.lineCap="square",t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,t.lineStyle=this.lineStyle,t.lineWidth=1,e=0;e<this.items.length&&!n(this.items[e].y);)e++;for(i=this.items.length-1;i>=0&&!n(this.items[i].y);)i--;if(!(e>=i)){for(t.translate(.5,.5),o={},s=this.items,a=e;a<=i;a++)l=s[a],c=l.style?l.style.color:this.lineColor,a<i&&s[a+1].style&&(h=s[a+1].style.color,c!==h&&(u=o[h]||[],u.push(l),o[h]=u)),d=o[c]||[],d.push(l),o[c]=d;for(c in o){for(d=o[c],t.beginPath(),p=0,a=0;a<d.length;a++)d[a].style&&d[a].style.color!==c&&(t.moveTo(d[p].x,this.bottom),this.walkLine(t,d.slice(p,a),!0,this.bottom),p=a);t.moveTo(d[p].x,this.bottom),this.walkLine(t,d.slice(p,d.length),!0,this.bottom),t.closePath(),this.isSeries?(_=t.createLinearGradient(0,0,0,this.bottom),_.addColorStop(0,this.color1),_.addColorStop(1,this.color2),t.fillStyle=_,this._simpleMode=!0):t.fillStyle=c,t.fill()}t.lineWidth=this.lineWidth,
r.prototype.draw.call(this,t)}}},e.PaneRendererArea=TradingView.PaneRendererArea=o},function(t,e,i){"use strict";function o(t,e,i,o,n){var r,s,a,l,c;for(this._canvasesMap={},this._lines=t.split(/[^\S\r\n]*(?:\r\n|\r|\n)/),this._font=this._fontStyle(e,i,o,n),this._fontSize=n,r=$("<canvas>"),s=r.get(0).getContext("2d"),s.font=this._font,a=0,l=0;l<this._lines.length;l++)c=s.measureText(this._lines[l]).width,a=Math.max(a,c);this.textImageWidth=a+1,this.textImageHeight=this._lines.length*n}o.prototype.paintTo=function(t,e,i,o,n,r){var s=this._getTextImage(e),a=this._x(i,n,this.textImageWidth),l=this._y(o,r,this.textImageHeight);t.drawImage(s,a-.5,l-.5)},o.prototype._getTextImage=function(t){var e,i,o,n,r;if(this._canvasesMap[t])return this._canvasesMap[t].get(0);for(e=$("<canvas>").attr("width",this.textImageWidth).attr("height",this.textImageHeight),i=e.get(0).getContext("2d"),i.textBaseline="top",i.font=this._font,i.textAlign="center",i.fillStyle=t,o=Math.round(this.textImageWidth/2),n=0,r=0;r<this._lines.length;r++)i.fillText(this._lines[r],o,n),n+=this._fontSize;return this._canvasesMap[t]=e,e.get(0)},o.prototype._x=function(t,e,i){var o=t;switch(e){case"left":break;case"right":o-=i;break;case"center":o-=i/2}return Math.round(o)},o.prototype._y=function(t,e,i){var o=t;switch(e){case"top":break;case"bottom":o-=i;break;case"middle":o-=i/2}return Math.round(o)},o.prototype._fontStyle=function(t,e,i,o){return(t?"bold ":"")+(e?"italic ":"")+o+"px "+i},t.exports=o},function(t,e,i){"use strict";t.exports=function(t,e){var i,o=10,n=t%o;for(n&&(t=t-n+o),i=[];t<=e;t+=o)i.push(t);return i}},function(t,e,i){"use strict";function o(t){this._props=t,this._text="",this._size="12px",this._bold=!1}o.prototype.text=function(){return this._text},o.prototype.setText=function(t){this._text=t},o.prototype.color=function(){return this._props?this._props.scalesProperties.textColor.value():"#4a4a4a"},o.prototype.bold=function(){return this._bold},o.prototype.size=function(){return this._size},t.exports=o},function(t,e,i){"use strict";function o(t,e){this.handler=t,this.customId=e}function n(){}var r=i(15).declareClassAsPureInterface;TradingView.WEB_SOCKET_WAS_CONNECTED=!1,n.REBIND_STUDY_STANDALONE_TO_CHILD=1,n.REBIND_STUDY_CHILD_TO_STANDALONE=2,n.prototype.defaultWatchlistSymbols=function(){},n.prototype.availableTimeFrames=function(t,e){},n.prototype.defaultResolutions=function(){},n.prototype.supportedSymbolsTypes=function(){},n.prototype.supportedExchangesList=function(){},n.prototype.futuresRegex=function(){},n.prototype.quoteCreateSession=function(t){},n.prototype.quoteDeleteSession=function(t){},n.prototype.quoteSetFields=function(t,e){},n.prototype.quoteAddSymbols=function(t,e){},n.prototype.quoteRemoveSymbols=function(t,e){},n.prototype.quoteFastSymbols=function(t,e){},n.prototype.depthCreateSession=function(t,e,i){},n.prototype.depthDeleteSession=function(t){},n.prototype.depthSetSymbol=function(t,e){},n.prototype.depthClearSymbol=function(t){},n.prototype.depthSetScale=function(t,e){},n.prototype.chartCreateSession=function(t,e){},
n.prototype.chartDeleteSession=function(t){},n.prototype.createSession=function(t,e){},n.prototype.removeSession=function(t){},n.prototype.connected=function(){},n.prototype.connect=function(){},n.prototype.disconnect=function(){},n.prototype.switchTimezone=function(t,e){},n.prototype.resolveSymbol=function(t,e,i,o,n){},n.prototype.createSeries=function(t,e,i,o,n,r,s){},n.prototype.removeSeries=function(t,e,i){},n.prototype.modifySeries=function(t,e,i,o,n,r){},n.prototype.requestMoreData=function(t,e,i,o){},n.prototype.requestMetadata=function(t,e,i){},n.prototype.isCanCreateStudy=function(t,e){},n.prototype.createStudy=function(t,e,i,o,n,r,s){},n.prototype.rebindStudy=function(t,e,i,o,n,r,s,a){},n.prototype.removeStudy=function(t,e,i){},n.prototype.modifyStudy=function(t,e,i,o,n){},n.prototype.createPointset=function(t,e,i,o,n,r,s){},n.prototype.modifyPointset=function(t,e,i,o,n){},n.prototype.removePointset=function(t,e,i){},n.prototype.requestMoreTickmarks=function(t,e,i,o){},n.prototype.requestFirstBarTime=function(t,e,i,o){},n.prototype._invokeHandler=function(t,e){},n.prototype._sendRequest=function(t,e){},n.prototype._onMessage=function(t){},n.prototype._convertTimescaleResponse=function(t){},n.prototype._dispathNotification=function(t){},n.prototype._invokeNotificationHandler=function(t,e,i){},n.prototype._notifySessions=function(t){},n.prototype.unpack=function(t){},n.prototype.searchSymbols=function(t,e,i,o,n,r,s,a,l){},n.prototype.serverTimeOffset=function(){},n.prototype.getMarks=function(t,e,i,o,n){},n.prototype.getTimescaleMarks=function(t,e,i,o,n){},r(n,"ChartApiInterface"),t.exports.HandlerInfo=o,t.exports.ChartApiInterface=n},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(89),n=i(15),r=i(198),i(12),e.PLACE_HOLDER="---",s=function(){function t(t){this.type="volume",this._numericFormatter=new o.NumericFormatter,this._fractionalValues=void 0!==t&&t>0,this._precision=t}return t.prototype.state=function(){return{precision:this._precision}},t.prototype.format=function(t){if(!n.isNumber(t))return e.PLACE_HOLDER;var i="";return t<0&&(i="-",t=-t),t>=1e100?window.t("N/A"):(!this._fractionalValues||t>=995?t=Math.round(t):this._fractionalValues&&(t=+t.toFixed(this._precision)),t<995?i+this._formatNumber(t):t<999995?i+this._formatNumber(t/1e3)+"K":t<999999995?(t=1e3*Math.round(t/1e3),i+this._formatNumber(t/1e6)+"M"):(t=1e6*Math.round(t/1e6),i+this._formatNumber(t/1e9)+"B"))},t.prototype.parse=function(t){var e,i,o;return"---"===t?{error:"not a number",res:!1,value:NaN}:(e={K:1e3,M:1e6,B:1e9},i=t.slice(-1),e.hasOwnProperty(i)?(o=this._numericFormatter.parse(t.slice(0,-1)),n.isNumber(o)?{res:!0,value:o*e[i]}:{error:"not a number",res:!1,value:NaN}):(o=this._numericFormatter.parse(t),n.isNumber(o)?{res:!0,value:o}:{error:"not a number",res:!1,value:NaN}))},t.serialize=function(t){return t.state()},t.deserialize=function(e){return new t(e.precision)},t.prototype._formatNumber=function(t){return this._fractionalValues&&(t=r.fixComputationError(t)),
this._numericFormatter.format(t).replace(/(\.[1-9]*)0+$/,function(t,e){return e})},t}(),e.VolumeFormatter=s},function(t,e,i){"use strict";function o(t){var e,i=n.get_timezone(t).offset_utc(Date.now()),o="",r=i/1e3/60/60;return r%1&&(o=":"+r%1*60),e="",e=r>0?"+"+(r-r%1)+o:0===r?"":r-r%1+o+"",{offset:i,string:"UTC"+e}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(50);e.parseTzOffset=o},function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibSpeedResistanceArcs";var n=e||this.createPropertiesObject("linetoolfibwedge");r.call(this,t,n),t._fibWedgeLabelsCache||(t._fibWedgeLabelsCache=new o),i.e(1).then(function(t){var e=i(1079).FibWedgePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(1).LineDataSource,s=i(21),a=i(88),l=i(3).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=11,n.prototype.getCache=function(){return this._model._fibWedgeLabelsCache||(this._model._fibWedgeLabelsCache=new o),this._model._fibWedgeLabelsCache},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Fib Wedge"},n.prototype.setPoint=function(t,e){var i,o,n,s,a,l,c;r.prototype.setPoint.call(this,t,e),this._recursiveGuard||(this._recursiveGuard=!0,2===t?(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],s=n.subtract(i).length(),a=o.subtract(i).normalized(),o=i.add(a.scaled(s)),l=this.screenPointToPoint(o),this._properties.points[1].price.setValue(l.price),this._properties.points[1].bar.setValue(l.index)):(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],c=o.subtract(i).length(),a=n.subtract(i).normalized(),n=i.add(a.scaled(c)),l=this.screenPointToPoint(n),this._properties.points[2].price.setValue(l.price),this._properties.points[2].bar.setValue(l.index)),this._recursiveGuard=!1)},n.prototype.addPoint=function(t){var e,i,o,n,s,a,l,c;return 2===this._points.length&&(e=this.pointToScreenPoint(this._points[0])[0],i=this.pointToScreenPoint(this._points[1])[0],this.priceScale().isPercent()&&(o=this.ownerSource().firstValue(),t.price=this.priceScale().priceRange().convertFromPercent(t.price,o)),n=this.pointToScreenPoint(t)[0],s=i.subtract(e).length(),a=n.subtract(e).normalized(),n=e.add(a.scaled(s)),l=this.priceScale().coordinateToPrice(n.y),c=Math.round(this._model.timeScale().coordinateToIndex(n.x)),t={index:c,price:l}),r.prototype.addPoint.call(this,t)},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,11]})},n.prototype.getInputsPropertyPage=function(){return null},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibWedgeStylesPropertyPage},e.LineToolFibWedge=n},function(t,e,i){"use strict";(function(t){function o(t,e){
this._pane=t,this._timeScale=e}function n(t){this._line=t}function r(t,e){this._adapter=new n(this),this._constructor="LineToolExecution";var o=e||new l("linetoolexecution");this.customization={forcePriceAxisLabel:!1,disableSelection:!0,disableErasing:!0},s.call(this,t,o),i.e(1).then(function(t){var e=i(1152).ExecutionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var s=i(1).LineDataSource,a=i(170),l=i(6).DefaultProperty,c=i(19).PlotRowSearchMode;o.prototype._cachedByBarIndexOrderedExecutions={},o.recreateOrderedByBarsSourcesCache=function(t){var e,i,n,r,s;for(o.clearOrderedByBarsSourcesCache(),e=o.prototype,i=t.orderedSources(),n=0;n<i.length;++n)r=i[n],r._adapter&&void 0!==r._adapter._index&&(s=e._cachedByBarIndexOrderedExecutions[r._adapter._index],e._cachedByBarIndexOrderedExecutions[r._adapter._index]=s||[],e._cachedByBarIndexOrderedExecutions[r._adapter._index].push(r))},o.clearOrderedByBarsSourcesCache=function(){o.prototype._cachedByBarIndexOrderedExecutions={}},o.prototype.getXYCoordinate=function(t,e,i){var o,n,s,a,l,h,u,d,p,_,f=0,m=t.getDirection(),g="buy"===m,v=this._pane.model().mainSeries();if(v.bars&&(o=g?10:-10,null!==(n=v.bars().search(i,c.NearestLeft))&&(i=n.index,s=g?n.value[TradingView.LOW_PLOT]:n.value[TradingView.HIGH_PLOT],a=v.priceScale(),a.isPercent()&&(l=v.firstValue(),s=a.priceRange().convertToPercent(s,l)),f=a.priceToCoordinate(s)+o)),t._index=i,h=e.visibleBars(),!isFinite(i)||null===h||i>h.lastBar()||i<h.firstBar())return{x:-1,y:-1};for(u=this._cachedByBarIndexOrderedExecutions[i]||this._pane.orderedSources(),d=u.length-1;d>=0;--d)if((p=u[d])instanceof r&&p._adapter._index===i&&p._adapter.getDirection()===m){if(p===t._line)break;_=p._adapter._height(),f=g?f+_:f-_}return{x:e.indexToCoordinate(i),y:f}},n.prototype._height=function(){var t,e=this.getArrowHeight(),i=this.getArrowSpacing();return this.getText()&&a.fontHeight(this.getFont()),t=10,e+i+0+t},n.prototype.getIndex=function(){return this._line._model.timeScale().baseIndex()-this._line.points()[0].index},n.prototype.setIndex=function(t){var e,i=this._line._model.timeScale(),o=i.baseIndex(),n=o-Math.abs(t);return this._line.startMoving(this._line.points()[0]),e=TradingView.merge({},this._line.points()[0]),e.index=n,this._line.move(e),this._line.endMoving(),this},n.prototype.getTime=function(){return this._unixtime},n.prototype.setTime=function(t){var e=this._line._model.mainSeries();return this._unixtime=ChartApiInstance.alignTimePoint?ChartApiInstance.alignTimePoint(t,e.interval(),e.symbolInfo()):t,this._line.restorePoints([{offset:0,price:this.getPrice(),time_t:this._unixtime}],[]),this._line.createServerPoints(),this},n.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},n.prototype.setPrice=function(t){return this._line.points().length>0&&(this._line.points()[0].price=t),this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},n.prototype.getText=function(){
return this._line.properties().text.value()},n.prototype.setText=function(t){return this._line.properties().text.setValue(t||""),this._line.updateAllViewsAndRedraw(),this},n.prototype.getArrowHeight=function(){return this._line.properties().arrowHeight.value()},n.prototype.setArrowHeight=function(t){return this._line.properties().arrowHeight.setValue(t||5),this},n.prototype.getArrowSpacing=function(){return this._line.properties().arrowSpacing.value()},n.prototype.setArrowSpacing=function(t){return this._line.properties().arrowSpacing.setValue(t||1),this},n.prototype.getDirection=function(){return this._line.properties().direction.value()},n.prototype.setDirection=function(t){return this._line.properties().direction.setValue(t||"buy"),this},n.prototype.getArrowColor=function(){return a.getColorFromProperties(this._line.properties().arrowColor,this._line.properties().arrowTransparency)},n.prototype.setArrowColor=function(t){return a.setColorToProperties(t,this._line.properties().arrowColor,this._line.properties().arrowTransparency),this},n.prototype.getTextColor=function(){return a.getColorFromProperties(this._line.properties().textColor,this._line.properties().textTransparency)},n.prototype.setTextColor=function(t){return a.setColorToProperties(t,this._line.properties().textColor,this._line.properties().textTransparency),this},n.prototype.getFont=function(){return a.getFontFromProperties(this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic)},n.prototype.setFont=function(t){return a.setFontToProperties(t,this._line.properties().fontFamily,this._line.properties().fontSize,this._line.properties().fontBold,this._line.properties().fontItalic),this},n.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},n.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},n.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(r,s),r.POINTS_COUNT=1,r.skipMagnetting=!0,r.prototype.pointsCount=function(){return r.POINTS_COUNT},r.prototype.title=function(){return"Execution"},r.prototype.hasContextMenu=function(){return!1},r.prototype.state=function(){return null},r.prototype.updateAllViews=function(){return this._isVisible()?s.prototype.updateAllViews.call(this):null},r.prototype.priceAxisViews=function(t,e){return this._isVisible()?s.prototype.priceAxisViews.call(this,t,e):null},r.prototype._isVisible=function(){return this._model.properties().tradingProperties.showExecutions.value()},r.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showExecutions.value()?s.prototype.paneViews.call(this,e):null},r.prototype.userEditEnabled=function(){return!1},r.prototype.showInObjectTree=function(){return!1},r.prototype.getInputsPropertyPage=function(){return null},e.ExecutionsPositionController=o,e.LineToolExecution=r}).call(e,i(5))
},function(t,e,i){"use strict";function o(t,e,i){return new a(t,e,i)}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(15),s=i(21),a=function(t){function e(e,i,o){return t.call(this,e,i,o,{names:["width","color","visible"]})||this}return n.__extends(e,t),e.prototype._iterateLevels=function(t,e){var i,o,n;for(i in t.levels)if(t.levels[i]&&r.isSameType(t.levels[i],e.typecheck())){o=e.tpl();for(n in this._map.names)this._map.names.hasOwnProperty(n)&&(o=e.fill(n,this._map.names[n],t.levels[i],o));t.levels[i]=o}return t},e}(s),e.LineToolGannComplexProperty=a,e.createPropertiesObject=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineTool5PointsPattern";var o=e||new r("linetool5pointspattern");n.call(this,t,o),i.e(1).then(function(t){var e=i(1080).Pattern5PaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(127).DateTimeFormatter,a=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 5},o.prototype.title=function(){return"XABCD Pattern"},o.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null},time4:{title:"Date 5",value:null},price4:{title:"Price 5",value:null}},o.prototype._updateTooltip=function(){var t,e,i,o,n,r=this._tooltipFieldsHash,a=this.points().m_values;a[0]&&(e=this._model.timeScale().indexToUserTime(a[0].index),r.time0.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,r.price0.value=this._model.mainSeries()._formatter.format(a[0].price)),a[1]&&(t=this._model.timeScale().indexToUserTime(a[1].index),r.time1.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,r.price1.value=this._model.mainSeries()._formatter.format(a[1].price)),a[2]&&(i=this._model.timeScale().indexToUserTime(a[2].index),r.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,r.price2.value=this._model.mainSeries()._formatter.format(a[2].price)),a[3]&&(o=this._model.timeScale().indexToUserTime(a[3].index),r.time3.value=o?new s(this._model.mainSeries().isDWM()).format(o):0,r.price3.value=this._model.mainSeries()._formatter.format(a[3].price)),a[4]&&(n=this._model.timeScale().indexToUserTime(a[4].index),r.time4.value=t?new s(this._model.mainSeries().isDWM()).format(n):0,r.price4.value=this._model.mainSeries()._formatter.format(a[4].price))},o.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},o.prototype.getStylesPropertyPage=function(){return a.LineToolLineTool5PointsPatternStylesPropertyPage},e.LineTool5PointsPattern=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolNote";var n=e||new s("linetoolnote");r.call(this,t,n),this.version=o.version,i.e(1).then(function(t){var e=i(1174).NotePaneView;this._setPaneViews([new e(this,this._model)])
}.bind(this).bind(null,i)).catch(i.oe)}function n(t,e){var i=e||new s("linetoolnoteabsolute");i.locked.value()||i.locked.setValue(!0),o.call(this,t,i)}var r=i(1).LineDataSource,s=i(6).DefaultProperty,a=i(3).propertyPages;inherit(o,r),o.TOOLTIP_WIDTH=300,o.TOOLTIP_PADDING=10,o.TOOLTIP_LINESPACING=5,o.version=1,o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return $.t("Note")},o.prototype.applyTemplate=function(t){delete t.locked,delete t.text,r.prototype.applyTemplate.call(this,t)},o.prototype.getTooltipWidth=function(){return o.TOOLTIP_WIDTH},o.prototype.getTooltipPadding=function(){return o.TOOLTIP_PADDING},o.prototype.getTooltipLineSpacing=function(){return o.TOOLTIP_LINESPACING},inherit(n,o),n.prototype.title=function(){return $.t("Anchored Note")},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return t&&(e.state.fixedSize=!1),e},o.prototype.getStylesPropertyPage=function(){return a.LineToolNotePropertyPage},e.LineToolNote=o,e.LineToolNoteAbsolute=n},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolText";var o=e||new a("linetooltext");r.call(this,t,o),this._timeScale=t.timeScale(),this._barSpacing=t.timeScale().barSpacing(),i.e(1).then(function(t){var e=i(406).TextPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}function n(t,e){var i=e||new a("linetooltextabsolute");i.locked.value()||i.locked.setValue(!0),o.call(this,t,i)}var r=i(1).LineDataSource,s=i(46).DataSource,a=i(6).DefaultProperty,l=i(3).propertyPages;inherit(o,r),o.MIN_WIDTH=100,o.prototype.setPoint=function(t,e){var i,n,r=this.properties();if(0===t&&r.wordWrapWidth&&r.wordWrapWidth.value()){if(i=r.locked&&r.locked.value()?this.fixedPoints()[0].x:this._timeScale.indexToCoordinate(this.points()[0].index),n=this._timeScale.indexToCoordinate(e.index)-i-~~(r.fontsize.value()/6),!isFinite(n))return;r.wordWrapWidth.setValue(Math.max(o.MIN_WIDTH,n))}},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return $.t("Text")},o.prototype.setPriceScale=function(t){s.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&(this._priceDencity=t.height()/t.priceRange().length(),this._isPriceDencityLog=t.isLog())},o.prototype.restoreSize=function(){this._barSpacing=this._model.timeScale().barSpacing(),this._priceDencity=this.priceScale().height()/this.priceScale().priceRange().length(),this.updateAllViews(),this._model.updateSource(this)},o.prototype.applyTemplate=function(t){delete t.locked,delete t.text,r.prototype.applyTemplate.call(this,t)},inherit(n,o),n.prototype.title=function(){return $.t("Anchored Text")},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return t&&(e.state.fixedSize=!1),e},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolTextStylesPropertyPage},e.LineToolText=o,e.LineToolTextAbsolute=n},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(67),s=i(15),a=function(t){
function e(e){var i=t.call(this)||this;return i._source=e,i}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,r,a,l;if(t.visible=!1,e=this._source.points(),i=this._source.priceScale(),0!==e.length&&null!==i&&!i.isEmpty()&&(o=e[0],isFinite(o.price))){if(i.isPercent()){if(!(r=this._source.ownerSource()))return;if(a=r.firstValue(),!s.isNumber(a))return;o.price=n.ensureNotNull(i.priceRange()).convertToPercent(o.price,a)}l=this._source.properties().linecolor.value(),t.background=l,t.color=this.generateTextColor(l),t.coordinate=i.priceToCoordinate(o.price),t.text=i.formatter().format(o.price),t.visible=!0}},e}(r.PriceAxisView),e.LineToolHorzLinePriceAxisView=a},function(t,e,i){"use strict";function o(t,e,i){this._study=t,this._series=e,this._model=i,this._invalidated=!0,this._orderArrow={vMargin:o.DEFAULT_ORDER_ARROW_VMARGIN,width:o.DEFAULT_ORDER_ARROW_WIDTH,height:o.DEFAULT_ORDER_ARROW_HEIGHT},this._exitLineWidth=o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH,this._priceArrow={width:o.DEFAULT_PRICE_ARROW_WIDTH,height:o.DEFAULT_PRICE_ARROW_HEIGHT},this._text={vMargin:o.DEFAULT_TEXT_VMARGIN,font:o.DEFAULT_FONT,fontSize:o.DEFAULT_FONT_SIZE},this._checkHideTextIfBarSpacingLT=o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT,this._textIsVisible=!0,this._colors={entryBuy:o.DEFAULT_ENTRY_BUY_COLOR,entrySell:o.DEFAULT_ENTRY_SELL_COLOR,exit:o.DEFAULT_EXIT_COLOR},this._items={entryBuy:[],entrySell:[],exit:[]},this._textWidths={},this._study.properties().strategy.orders.subscribe(this,this.update)}var n=i(8).Point,r=i(872).PaneRendererStudyStrategyOrders,s=i(53).CompositeRenderer,a=i(19).PlotRowSearchMode;o.DEFAULT_ORDER_ARROW_VMARGIN=7,o.DEFAULT_ORDER_ARROW_WIDTH=9,o.DEFAULT_ORDER_ARROW_HEIGHT=11,o.DEFAULT_ORDER_ARROW_EXIT_LINE_WIDTH=2,o.DEFAULT_PRICE_ARROW_WIDTH=5,o.DEFAULT_PRICE_ARROW_HEIGHT=9,o.DEFAULT_TEXT_VMARGIN=2,o.DEFAULT_FONT="Arial",o.DEFAULT_FONT_SIZE=10,o.DEFAULT_CHECK_HIDE_TEXT_IF_BARSPACING_LT=10,o.DEFAULT_ENTRY_BUY_COLOR="#008fff",o.DEFAULT_ENTRY_SELL_COLOR="#f00",o.DEFAULT_EXIT_COLOR="#cc47ed",o.prototype._updateImpl=function(){var t,e,i,o,r,s,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L;if(this.clearItems(),(t=this._study.ordersData())&&t.length&&(e=this._model.timeScale(),i=this._series.priceScale(),!(!e||!i||e&&e.isEmpty()||i&&i.isEmpty())&&null!==(o=e.visibleBars()))){for(r=this._study.barsIndexes(),s=this._series.nearestIndex(o.firstBar(),a.NearestRight),l=this._series.nearestIndex(o.lastBar(),a.NearestLeft),c=s,h=[],u=[];c<=l;c++)for(d=-1;-1!==(d=r.indexOf(c,d+1));)(p=t[d])&&(h.push(p),u.push(c));for(_=this._study.properties(),f=_.strategy.orders.showLabels.value(),m=_.strategy.orders.showQty.value(),g=f||m,g&&e.barSpacing()<this._checkHideTextIfBarSpacingLT&&this._orderArrow.width*h.length*2>e.width()&&(g=!1),v=g&&this._text.fontSize+this._text.vMargin||0,y=v&&v*(f+m),b=0,S={upper:[],lower:[]};b<h.length;b++)p=h[b],d=u[b],w=e.indexToCoordinate(d,!0),T=i.priceToCoordinate(this._series[p.b?"low":"high"](d),!0),C=p.b?"lower":"upper",x="number"==typeof S[C][d]&&S[C][d]||0,T+=p.b?x:-x,
"number"!=typeof S[C][d]&&(S[C][d]=0),S[C][d]+=(p.e?0:this._exitLineWidth)+this._orderArrow.vMargin+this._orderArrow.height+y,P=i.priceToCoordinate(p.p,!0),L=p.e?!p.b&&p.e?"entrySell":"entryBuy":"exit",this._items[L].push({orderPoint:new n(w,T),pricePoint:new n(w,P),label:f&&(p.c||p.id||"Untitled")||null,qty:m&&(p.b?"+":"-")+~~p.q||null,pos:C});this._textLabelIsVisible=f,this._textQtyIsVisible=m,this._textIsVisible=g}},o.prototype.update=function(){this._invalidated=!0},o.prototype.clearItems=function(){this._items.entryBuy.length=this._items.entrySell.length=this._items.exit.length=0},o.prototype.renderer=function(){var t,e,i,o=this._study.properties();if(o.visible.value()&&o.strategy.orders.visible.value()&&(t=this._series.priceScale(),(this._invalidated||t&&t.isScaled())&&(this._updateImpl(),this._invalidated=!1),this._items.entryBuy.length||this._items.entrySell.length||this._items.exit.length)){e=new s;for(i in this._items)this._items[i].length&&e.append(new r({items:this._items[i],color:this._colors[i],orderArrow:this._orderArrow,exitLineWidth:"exit"===i&&this._exitLineWidth||0,priceArrow:this._priceArrow,text:this._textIsVisible&&this._text||null},this._textWidths));return e}},t.exports=o},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(34),s=i(67),a=i(5),l=i(49),c=a.enabled("countdown"),h=a.enabled("price_scale_always_last_bar_value"),u=[l.STYLE_BARS,l.STYLE_CANDLES,l.STYLE_LINE,l.STYLE_AREA,l.STYLE_HOLLOW_CANDLES,l.STYLE_HEIKEN_ASHI],d=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._getSource=function(){return this._source},e.prototype._getData=function(){return this._data},e.prototype._isCountdownEnabled=function(){return c},e.prototype._countdownText=function(){var t,e,i,o,s,a,l,c,h,u,d;return this._source.isDWM()?"":(t=1e3*n.ensure(n.ensureNotNull(this._source.data().bars().last()).value[0]),e=1e3*this._source.serverTimeOffset(),i=r.Interval.parse(this._source.interval()),o=i.multiplier()||0,s=i.kind()===r.Interval.SECONDS?o:60*o,a=t.valueOf()+1e3*s,l=(new Date).valueOf()+e,(c=Math.round((a-l)/1e3))<=0?"":(c=Math.min(c,s),h=null,c>=3600&&(h=this._addLeadingZero(Math.floor(c/3600))),c%=3600,u=this._addLeadingZero(Math.floor(c/60)),c%=60,d=this._addLeadingZero(Math.floor(c)),null!==h?h+":"+u+":"+d:u+":"+d))},e.prototype._updateRendererData=function(t){var e,i,o,n,r;t.visible=!1,this._data.model.properties().scalesProperties.showSeriesLastValue.value()&&(e=this._source.lastValueData(void 0,h),e.noData||(i=this._source.properties(),i.style.value()===l.STYLE_HEIKEN_ASHI&&i.haStyle.showRealLastPrice.value()&&(o=this._source.lastValueData(void 0,!1),n=this._source.lastValueData(void 0,!0),!o.noData&&!n.noData&&o.index===n.index)||(r="",c&&i.showCountdown.value()&&-1!==u.indexOf(i.style.value())&&(r=this._countdownText()),t.secondLine=r,t.background=this._source.priceLineColor(e.color),t.color=this.generateTextColor(t.background),t.coordinate=e.coordinate,
t.floatCoordinate=e.floatCoordinate,t.text=e.text,t.visible=!0)))},e.prototype._addLeadingZero=function(t){return("0"+t).slice(-2)},e}(s.PriceAxisView),e.SeriesPriceAxisView=d},function(t,e,i){"use strict";function o(t,e){this.m_series=t,this.m_model=e,this.m_bars=[],this._invalidated=!0,this._isMarkersEnabled=P.enabled("source_selection_markers")}function n(t,e){o.call(this,t,e)}function r(t,e){o.call(this,t,e)}function s(t,e){o.call(this,t,e)}function a(t,e){o.call(this,t,e)}function l(t,e){this.m_series=t,this.m_model=e,this.m_items=[]}function c(t,e){l.call(this,t,e),this._invaidated=!0}function h(t,e){l.call(this,t,e),this._invaidated=!0}function u(t,e){l.call(this,t,e),this._invaidated=!0,this._renderer=new b}function d(t,e){this._source=t,this._model=e,this._points=[new p(0,0)],this._invalidated=!0,this._renderer=new S;var i={cursorType:L.VerticalResize,pressedMouseMoveHandler:function(t){var e,i,o,n,r=this._source.priceScale();null!==r&&(e=this._source.properties().baselineStyle,i=r.height(),o=100-t.y/i*100,n=o<0?0:Math.round(10*o)/10,e.baseLevelPercentage.setValue(Math.max(Math.min(n,100),0)))}.bind(this)};this._renderer.setHitTest(new f(f.CUSTOM_MOVE,i))}var p=i(8).Point,_=i(131).SelectionRenderer,f=i(11),m=i(325).PaneRendererBars,g=i(176).PaneRendererLine,v=i(326).PaneRendererArea,y=i(247).PaneRendererCandles,b=i(882).PaneRendererBaseline,S=i(94).HorizontalLineRenderer,w=i(53).CompositeRenderer,T=i(328),C=i(30),x=i(19).PlotRowSearchMode,P=i(5),L=i(343).PaneCursorType;o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,m,g=this;if(this.m_bars=[],!this.m_model.timeScale().isEmpty()&&!this.m_series.priceScale().isEmpty()&&null!==(t=this.m_model.timeScale().visibleBars())&&0!==this.m_series.bars().size()){for(e=this.m_series.nearestIndex(t.firstBar(),x.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),x.NearestLeft);e<=i&&null===this.m_series.bars().valueAt(e);e++);if(!(e>i)&&(t=this.m_series.bars().range(e,i),n=this.m_series.priceScale(),r=n.properties().percentage.value(),s=this.m_series.barColorer(),a={},t.each(function(t,e){var i,n;void 0!==e[TradingView.OPEN_PLOT]&&void 0!==e[TradingView.HIGH_PLOT]&&void 0!==e[TradingView.LOW_PLOT]&&void 0!==e[TradingView.CLOSE_PLOT]&&(void 0===o&&(o=e[TradingView.CLOSE_PLOT]),i={},i.time=Math.round(t),r?(i.open=100*(e[TradingView.OPEN_PLOT]-o)/o,i.high=100*(e[TradingView.HIGH_PLOT]-o)/o,i.low=100*(e[TradingView.LOW_PLOT]-o)/o,i.close=100*(e[TradingView.CLOSE_PLOT]-o)/o):(i.open=e[TradingView.OPEN_PLOT],i.high=e[TradingView.HIGH_PLOT],i.low=e[TradingView.LOW_PLOT],i.close=e[TradingView.CLOSE_PLOT]),a.value=e,n=e[TradingView.STYLE_PLOT]?e[TradingView.STYLE_PLOT]:s.barStyle(t,!1,a),e[TradingView.STYLE_PLOT]=n,a.previousValue=e,i.color=n.barColor,i.borderColor=n.barBorderColor,i.wickColor=n.barWickColor,i.hollow=n.isBarHollow,g.m_bars.push(i))},this),n.barPricesToCoordinates(this.m_bars),this.m_model.timeScale().barIndexesToCoordinates(this.m_bars),
this.m_series===this.m_model.selectedSource()))for(l=T(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=f.REGULAR,c=0;c<l.length;c++)h=l[c],null!==(u=this.m_series.bars().valueAt(h))&&(d=.5*(u[TradingView.OPEN_PLOT]+u[TradingView.CLOSE_PLOT]),n.isPercentage()&&(d=100*(d-o)/o),_=this.m_model.timeScale().indexToCoordinate(h),m=this.m_series.priceScale().priceToCoordinate(d),this._selectionData.points.push(new p(_,m)))}},o.prototype.items=function(){return this.m_bars},o.prototype.dump=function(){var t={};return t.bars=this.m_bars,t},inherit(n,o),n.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.dontDrawOpen=this.m_series.properties().barStyle.dontDrawOpen.value(),e=new w,e.append(new m(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},inherit(r,o),r.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().candleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().candleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().candleStyle.borderColor.value(),t.wickColor=this.m_series.properties().candleStyle.wickColor.value(),e=new w,e.append(new y(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},inherit(s,o),s.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().haStyle.drawWick.value(),t.drawBorder=this.m_series.properties().haStyle.drawBorder.value(),t.borderColor=this.m_series.properties().haStyle.borderColor.value(),t.wickColor=this.m_series.properties().haStyle.wickColor.value(),e=new w,e.append(new y(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},inherit(a,o),a.prototype.renderer=function(){var t,e;return this._invalidated&&(this._updateImpl(),this._invalidated=!1),t={},t.bars=this.m_bars,t.barSpacing=this.m_model.timeScale().barSpacing(),t.drawWick=this.m_series.properties().hollowCandleStyle.drawWick.value(),t.drawBorder=this.m_series.properties().hollowCandleStyle.drawBorder.value(),t.borderColor=this.m_series.properties().hollowCandleStyle.borderColor.value(),t.wickColor=this.m_series.properties().hollowCandleStyle.wickColor.value(),e=new w,e.append(new y(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&e.append(new _(this._selectionData)),e},l.prototype.update=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,m;if(this.m_items=[],
!this.m_model.timeScale().isEmpty()&&this.m_series.priceScale()&&!this.m_series.priceScale().isEmpty()&&null!==(t=this.m_model.timeScale().visibleBars())&&0!==this.m_series.bars().size()&&(e=this.m_series.nearestIndex(t.firstBar(),x.NearestRight),i=this.m_series.nearestIndex(t.lastBar(),x.NearestLeft),t=this.m_series.bars().range(e,i),n=this.m_series.priceScale(),r={color:this.m_series.properties().lineStyle.color.value()},s=this.m_series.barFunction(),a=n.properties().percentage.value(),t.each(function(t,e){var i,n=s(e);return void 0!==n&&null!==n&&(void 0===o&&(o=n),a&&(n=100*(n-o)/o),i=new p(t,n),i.style=r,this.m_items.push(i),!1)}.bind(this)),n.pointsArrayToCoordinates(this.m_items),this.m_model.timeScale().indexesToCoordinates(this.m_items),this.m_series===this.m_model.selectedSource()))for(l=T(e,i),this._selectionData={points:[]},this._selectionData.hittestResult=f.REGULAR,c=0;c<l.length;c++)h=l[c],u=this.m_series.data().valueAt(h),d=s(u),n.isPercentage()&&(d=100*(d-o)/o),_=this.m_model.timeScale().indexToCoordinate(h),m=this.m_series.priceScale().priceToCoordinate(d),this._selectionData.points.push(new p(_,m))},inherit(c,l),c.prototype.update=function(){this._invalidated=!0},c.prototype.renderer=function(){var t,e,i,o;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t=this.m_series.properties().lineStyle,e={barSpacing:this.m_model.timeScale().barSpacing(),items:this.m_items,lineColor:t.color.value(),lineStyle:t.linestyle.value(),withMarkers:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_MARKERS,withSteps:t.styleType.value()===TradingView.Series.STYLE_LINE_TYPE_STEP,lineWidth:t.linewidth.value(),simpleMode:!0},i=new g(e),this.m_series===this.m_model.selectedSource()?(o=new w,o.append(i),this._isMarkersEnabled&&o.append(new _(this._selectionData))):o=i,o},inherit(h,l),h.prototype.update=function(){this._invalidated=!0},h.prototype.renderer=function(){var t,e,i;return this._invalidated&&(l.prototype.update.call(this),this._invalidated=!1),t={},t.simpleMode=!1,t.barSpacing=this.m_model.timeScale().barSpacing(),t.items=this.m_items,t.lineColor=this.m_series.properties().areaStyle.linecolor.value(),t.lineStyle=this.m_series.properties().areaStyle.linestyle.value(),t.lineWidth=this.m_series.properties().areaStyle.linewidth.value(),e=this.m_series.properties().areaStyle.transparency.value(),t.isSeries=!0,t.color1=C.generateColor(this.m_series.properties().areaStyle.color1.value(),e),t.color2=C.generateColor(this.m_series.properties().areaStyle.color2.value(),e),t.bottom=this.m_series.priceScale().height(),i=new w,i.append(new v(t)),this.m_series===this.m_model.selectedSource()&&this._isMarkersEnabled&&i.append(new _(this._selectionData)),i},inherit(u,l),u.prototype.update=function(){this._invalidated=!0},u.prototype._updateImpl=function(){var t,e;l.prototype.update.call(this),t=this.m_series.properties().baselineStyle,e=t.transparency.value(),this._topFillColor1=C.generateColor(t.topFillColor1.value(),e),this._topFillColor2=C.generateColor(t.topFillColor2.value(),e),
this._bottomFillColor1=C.generateColor(t.bottomFillColor1.value(),e),this._bottomFillColor2=C.generateColor(t.bottomFillColor2.value(),e),this._topLineColor=t.topLineColor.value(),this._bottomLineColor=t.bottomLineColor.value(),this._topLineWidth=t.topLineWidth.value(),this._bottomLineWidth=t.bottomLineWidth.value(),this._barSpacing=this.m_model.timeScale().barSpacing(),this._bottom=this.m_series.priceScale().height(),this._baseLevelCoordinate=Math.round(this._bottom*(Math.abs(100-t.baseLevelPercentage.value())/100))},u.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData({items:this.m_items,topFillColor1:this._topFillColor1,topFillColor2:this._topFillColor2,bottomFillColor1:this._bottomFillColor1,bottomFillColor2:this._bottomFillColor2,topLineColor:this._topLineColor,bottomLineColor:this._bottomLineColor,topLineWidth:this._topLineWidth,bottomLineWidth:this._bottomLineWidth,lineStyle:CanvasEx.LINESTYLE_SOLID,barSpacing:this._barSpacing,baseLevelCoordinate:this._baseLevelCoordinate,bottom:this._bottom});var t=new w;return t.append(this._renderer),this.m_series===this.m_model.selectedSource()&&t.append(new _(this._selectionData)),t},d.prototype.update=function(){this._invalidated=!0},d.prototype._updateImpl=function(t){var e=this._source.properties().baselineStyle,i=Math.abs(100-e.baseLevelPercentage.value());this._visible=!0,this._points=[new p(0,Math.round(t*(i/100)))],this._color=e.baselineColor.value()},d.prototype.renderer=function(t){return this._invalidated&&(this._updateImpl(t),this._invalidated=!1),this._renderer.setData({visible:this._visible,width:this._model.timeScale().width(),height:t,points:this._points,color:this._color,linewidth:1,linestyle:CanvasEx.LINESTYLE_SPARSE_DOTTED}),this._renderer},e.SeriesBarsPaneView=n,e.SeriesCandlesPaneView=r,e.SeriesHollowCandlesPaneView=a,e.SeriesLinePaneView=c,e.SeriesAreaPaneView=h,e.SeriesHeikenAshiPaneView=s,e.SeriesBaselinePaneView=u,e.SeriesBaselineLinePaneView=d},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Default=0]="Default",t[t.Pointer=1]="Pointer",t[t.Eraser=2]="Eraser",t[t.Dot=3]="Dot",t[t.Grabbing=4]="Grabbing",t[t.ZoomIn=5]="ZoomIn",t[t.VerticalResize=6]="VerticalResize"}(e.PaneCursorType||(e.PaneCursorType={}))},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=function(){function t(t,e){o.assert(t<=e,"The last bar in the bars range should be greater than or equal to the first bar"),this._firstBar=t,this._lastBar=e}return t.prototype.firstBar=function(){return this._firstBar},t.prototype.lastBar=function(){return this._lastBar},t.prototype.count=function(){return this._lastBar-this._firstBar+1},t.prototype.contains=function(t){return this._firstBar<=t&&t<=this._lastBar},t.prototype.equals=function(t){return this._firstBar===t.firstBar()&&this._lastBar===t.lastBar()},t}(),e.BarsRange=n},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(10),r=i(885),
s=function(t){function e(e,i){void 0===i&&(i=!1);var o=t.call(this,e,"cs",!1)||this;return o._sessionDisabled=!1,o._handler=null,o._criticalError=new n,o._disableStatistics=i,o}return o.__extends(e,t),e.prototype.destroy=function(){this._criticalError.destroy(),this._handler=null,t.prototype.destroy.call(this)},e.prototype.serverTimeOffset=function(){return this._getChartApi().serverTimeOffset()},e.prototype.switchTimezone=function(t){return this._getChartApi().switchTimezone(this.sessionId(),t)},e.prototype.resolveSymbol=function(t,e,i){return this._getChartApi().resolveSymbol(this.sessionId(),t,e,i)},e.prototype.requestFirstBarTime=function(t,e,i){return this._getChartApi().requestFirstBarTime(this.sessionId(),t,e,i)},e.prototype.createSeries=function(t,e,i,o,n,r){return this._getChartApi().createSeries(this.sessionId(),t,e,i,o,n,r)},e.prototype.modifySeries=function(t,e,i,o,n){return this._getChartApi().modifySeries(this.sessionId(),t,e,i,o,n)},e.prototype.removeSeries=function(t,e){return!!this.isConnected().value()&&this._getChartApi().removeSeries(this.sessionId(),t,e)},e.prototype.requestMoreData=function(t,e,i){return this._getChartApi().requestMoreData(this.sessionId(),t,e,i)},e.prototype.requestMoreTickmarks=function(t,e,i){return this._getChartApi().requestMoreTickmarks(this.sessionId(),t,e,i)},e.prototype.requestMetadata=function(t,e){this._getChartApi().requestMetadata(this.sessionId(),t,e)},e.prototype.isCanCreateStudy=function(t){return this._getChartApi().isCanCreateStudy(t)},e.prototype.createStudy=function(t,e,i,o,n,r,s){return this._getChartApi().createStudy(this.sessionId(),t,e,i,o,n,r,s)},e.prototype.rebindStudy=function(t,e,i,o,n,r,s){return this._getChartApi().rebindStudy(this.sessionId(),t,e,i,o,n,r,s)},e.prototype.modifyStudy=function(t,e,i,o){return this._getChartApi().modifyStudy(this.sessionId(),t,e,i,o)},e.prototype.removeStudy=function(t,e,i){return this._getChartApi().removeStudy(this.sessionId(),t,e,i)},e.prototype.createPointset=function(t,e,i,o,n,r){return this._getChartApi().createPointset(this.sessionId(),t,e,i,o,n,r)},e.prototype.modifyPointset=function(t,e,i,o){return this._getChartApi().modifyPointset(this.sessionId(),t,e,i,o)},e.prototype.removePointset=function(t){return this._getChartApi().removePointset(this.sessionId(),t)},e.prototype.setVisibleTimeRange=function(t,e,i,o){this._getChartApi().setVisibleTimeRange(t,this.sessionId(),e,i,o)},e.prototype.criticalError=function(){return this._criticalError},e.prototype.connect=function(e){void 0===e&&(e=null),null!==e&&(this._handler=e),t.prototype.connect.call(this)},e.prototype.setHandler=function(t){this._handler=t},e.prototype.connected=function(){return this.isConnected().value()&&!this._sessionDisabled},e.prototype.disable=function(){this._sessionDisabled=!0},e.prototype.chartApi=function(){return this._getChartApi()},e.prototype._sendCreateSession=function(){var t=this;Object.keys(this).forEach(function(e){/^(s|st|symbol_)\d+$/.test(e)&&delete t[e]}),
this._getChartApi().chartCreateSession(this.sessionId(),this._disableStatistics)},e.prototype._sendRemoveSession=function(){this._getChartApi().chartDeleteSession(this.sessionId())},e.prototype._onMessage=function(t){this._handler&&this._handler(t)},e.prototype._onCriticalError=function(e,i){this._criticalError.fire(e,i),t.prototype._onCriticalError.call(this,e,i)},e}(r.Session),e.ChartSession=s},function(t,e,i){"use strict";(function(e){var o=i(171).futuresRoots,n=function(){function t(t,e){var i=function(){};return i.prototype=e.prototype,t.prototype=new i,t}function i(t){return t.replace(/[\^\$\(\)\[\]\{\}\*\+\?\|\\]/g,"\\$&")}function n(){}function r(t){this.value=t}function s(){}function a(){}function l(){}function c(){}function h(){}function u(){}function d(){}function p(){}function _(t){this.value=t}function f(t){this.value=t}function m(t){this.value=t}function g(){_.apply(this,arguments)}function v(){f.apply(this,arguments)}function y(t,e){var i,o,n,s,a,l,c,h,u=[];t:for(;i=W.exec(t);){for(o=$.length;o--;)if(i[o+1]){$[o].ctor&&(n=new $[o].ctor(i[o+1]),n._offset=i.index,u.push(n));continue t}s=new m(i[0]),s._offset=i.index,u.push(s)}if(e&&e.recover)for(o=u.length;o--;)l=u[o],l instanceof f||l instanceof _?(void 0!==a&&(c=new _(""),h=u.splice(o,a-o+1,c),c.value=h.map(function(t){return t.value}).join("")),a=o):l instanceof r||(a=void 0);return u}function b(t){var i,o,n,c,h,u,d,p,g,v;if(e.enabled("charting_library_base"))return{currentState:"var"};for(i="init",o="var",n="operator",c=i,h={warnings:[],errors:[],isEmpty:!0},u=[],d=0;d<t.length;d++)if(!((p=t[d])instanceof r))if(delete h.isEmpty,p.isIncomplete&&(g={status:"incomplete",reason:"incomplete_token",offset:p._offset,token:p},p.incompleteSuggest&&(g.recover={append:p.incompleteSuggest()}),h.warnings.push(g),d!==t.length-1))g.status="error";else if(p instanceof _||p instanceof f){if(c===o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=o}else if(p instanceof l){if(c!==o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}c=n}else if(p instanceof s){if(c===o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}u.push(p),c=i}else if(p instanceof a){if(c!==o){h.errors.push({status:"error",reason:"unexpected_token",offset:p._offset,token:p});continue}v=u.pop(),v||h.errors.push({status:"error",reason:"unbalanced_brace",offset:p._offset,token:p,recover:{prepend:new s}}),c=o}else p instanceof m&&h.errors.push({status:"error",reason:"unparsed_entity",offset:p._offset,token:p});for(h.braceBalance=u.length,c!==o&&h.warnings.push({status:"incomplete"}),v=null;u.length;)p=u.pop(),g={status:"incomplete",reason:"unbalanced_brace",offset:p._offset,token:p},c===o&&(g.recover={append:new a}),h.warnings.push(g);return h.currentState=c,0===h.warnings.length&&delete h.warnings,0===h.errors.length&&delete h.errors,h}function S(t){var e,i=[];for(e=0;e<t.length;e++)t[e]instanceof r||i.push(t[e]);return i}function w(t){var e,i,o,n,r,c,h;for(t=S(t),e=[],
i=[],n=0;n<t.length;n++)r=t[n],r instanceof l?i.length&&i[i.length-1].minPrecedence>r.precedence&&(i[i.length-1].minPrecedence=r.precedence):r instanceof s?i.push(o={minPrecedence:1/0,openBraceIndex:n}):r instanceof a&&(o=i.pop(),c=t[o.openBraceIndex-1],(h=t[n+1])instanceof l&&!(h.precedence<=o.minPrecedence)||!(!(c instanceof l)||c.precedence<o.minPrecedence||c.precedence===o.minPrecedence&&c.commutative)||(e.unshift(o.openBraceIndex),e.push(n),i.length&&i[i.length-1].minPrecedence>o.minPrecedence&&(i[i.length-1].minPrecedence=o.minPrecedence)));for(n=e.length;n--;)t.splice(e[n],1);return t}function T(t){for(var e=0;e<t.length;e++)t[e].parse&&t[e].parse();return t}function C(t){var e=x(t);return w(e?e:[new f("1"),new d,new s].concat(t).concat(new a))}function x(t){var e,i,o,n=0,c=1,h=2,u=3,p=n,_=0;for(i=0;i<t.length;i++)if(!((o=t[i])instanceof r))switch(p){case n:if(!(o instanceof f&&1==+o.value))return!1;p=c;break;case c:if(!(p===c&&o instanceof d))return!1;p=h,e=i+1;break;case h:if(o instanceof s)p=u,_=1;else if(o instanceof l)return!1;break;case u:o instanceof s?_++:o instanceof a&&--_<=0&&(p=h)}return t.slice(e)}function P(t){return new _(t).ticker()}function L(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return t=y(t),t.filter(function(t){return t instanceof _}).map(function(t){return t.exchange()}).filter(function(t){return t})}function I(t){return t=L(t),1!==t.length?null:t[0]}function k(t,e){return t=L(t),t.some(function(t){return!!~e.indexOf((t||"").toUpperCase())})}function A(t){return k(t,["BATS"])}function M(t){return(t=I(t))&&-1!==t.toUpperCase().indexOf("_EOD")}function E(t){return k(t,["CHXEUR"])}function D(t){return k(t,["CHXJPY"])}function V(t){return k(t,pro.getProductsByType(pro.PRODUCT_TYPES.exchange).map(function(t){return t.exchange.toUpperCase()+"_DLY"}))}function O(t,e){return!!(t=I(t))&&t.substr(0,e.length)===e}function R(t){if("string"!=typeof t)throw new TypeError("expression must be a string");var e=w(S(y(t)));return e.forEach(function(t){t instanceof _&&t.exchange(null)}),z(e)}function B(t){if("string"!=typeof t)throw new TypeError("expression must be a string");return z(w(S(y(t))))}function z(t){return t.join("")}var F,N,W,$=[{pattern:"(",ctor:s},{pattern:")",ctor:a},{pattern:"+",ctor:c},{pattern:"-",ctor:h},{pattern:"*",ctor:u},{pattern:"/",ctor:d},{pattern:"^",ctor:p},{pattern:/\d+(?:\.\d*|(?![a-zA-Z0-9_!:\.&]))|\.\d+/,ctor:f},{pattern:/\./,ctor:v},{pattern:e.enabled("charting_library_base")?/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF^][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!:\.&]*|'.+?'/:/[a-zA-Z0-9_\u0370-\u1FFF_\u2E80-\uFFFF][a-zA-Z0-9_\u0020\u0370-\u1FFF_\u2E80-\uFFFF_!|:\.&]*|'.+?'/,ctor:_},{pattern:/'[^']*/,ctor:g},{pattern:/[\0-\x20\s]+/,ctor:r}];return n.prototype.toString=function(){return this.value},t(r,n),t(s,n),s.prototype.value="(",t(a,n),a.prototype.value=")",t(l,n),t(c,l),c.prototype.value="+",c.prototype.precedence=0,c.prototype.commutative=!0,t(h,l),h.prototype.value="-",h.prototype.precedence=0,h.prototype.commutative=!1,t(u,l),
u.prototype.value="*",u.prototype.precedence=1,u.prototype.commutative=!0,t(d,l),d.prototype.value="/",d.prototype.precedence=1,d.prototype.commutative=!1,t(p,l),p.prototype.value="^",p.prototype.precedence=2,p.prototype.commutative=!1,F=/^'?(?:([A-Z0-9_]+):)?(.*?)'?$/i,N=/[\+\-\/\*]/,t(_,n),_.prototype.toString=function(){if(this.hasOwnProperty("_ticker")){var t=N.test(this._ticker)?"'":"";return t+(this._exchange?this._exchange+":":"")+this._ticker+t}return this.value},_.prototype.parse=function(){var t=F.exec(this.value);t[1]&&(this._exchange=t[1]),this._ticker=t[2]},_.prototype.parseAsFutures=function(){var t,e,i;if(o)for(this.hasOwnProperty("_ticker")||this.parse(),t=function(t){return o.some(function(e){return e.t===t})},e=2;e>=1;--e)if(i=this._ticker.slice(0,e),t(i)){this._root=i,this._contract=this._ticker.slice(e);break}},_.prototype.exchange=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._exchange;null===t||void 0===t?delete this._exchange:this._exchange=t+""},_.prototype.ticker=function(t){if(this.hasOwnProperty("_ticker")||this.parse(),!(arguments.length>0))return this._ticker;null===t||void 0===t?delete this._ticker:this._ticker=t+"",delete this._root,delete this._contract},_.prototype.root=function(t){if(this.hasOwnProperty("_root")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._root:(this._root=t+"",this._root&&(this._ticker=this._root+(this._contract||"")))},_.prototype.contract=function(t){if(this.hasOwnProperty("_contract")||this.parseAsFutures(),!(arguments.length>0))return this._root;null===t||void 0===t?delete this._contract:(this._contract=t+"",this._root&&(this._ticker=this._root+this._contract))},t(f,n),f.prototype.toString=function(){return this.hasOwnProperty("_normalizedValue")?this._normalizedValue:this.value},f.prototype.parse=function(){this._normalizedValue=this.value.replace(/^0+|\.0*$/g,"").replace(/(\.\d*?)0+$/,"$1").replace(/^(\.|$)/,"0$1")},m.prototype.toString=function(){return this.value},t(g,_),g.prototype.isIncomplete=!0,g.prototype.incompleteSuggest=function(){if("'"!==this.value)return"'"},t(v,f),v.prototype.isIncomplete=!0,W=RegExp($.map(function(t){return"("+("string"==typeof t.pattern?i(t.pattern):t.pattern.source)+")"}).concat(".").join("|"),"g"),{tokenize:y,validate:b,factorOutBraces:w,normalizeTokens:T,flip:C,hasBatsSymbols:A,hasEodSymbols:M,hasChxeurSymbols:E,hasChxjpySymbols:D,hasFreeDelaySymbols:V,getExchange:I,isExchange:O,SymbolToken:_,IncompleteSymbolToken:g,NumberToken:f,BinaryOperatorToken:l,OpenBraceToken:s,CloseBraceToken:a,ticker:P,shortName:R,normalize:B}}();t.exports=n}).call(e,i(5))},function(t,e,i){"use strict";function o(t){return t+"("+new Date(1e3*t).toUTCString()+")"}function n(t){var e,i,o,n;return t+="",e=t.slice(0),i=!1,o=e[e.length-1],-1==="DWM".indexOf(o)&&"S"!==o&&(i=!0,o=""),n=parseInt(i?e:e.length>1?e.slice(0,e.length-1):1),{resolution:o,interval:n}}var r,s=i(58),a=i(50),l=i(34).Interval,c=!1,h=null,u=0,d=function(t,e){this._session=new s.Session,
this._session.init(t.timezone,t.session),this._symbolInfo=t,this._resolution=e,this._extrapolatedData=[],this._modelId=u++,this._valid=!!t.timezone&&!!t.session,c&&console.log('Created model "{0}", interval "{1}", session "{2}", tz "{3}"'.format(this._modelId,this._resolution,t.session,t.timezone))};d.prototype.uniqueId=function(){return this._modelId},d.prototype.isValid=function(){return this._valid},d.prototype._barBuilder=function(){if(!this._builderCache){var t=n(this._resolution);this._builderCache=s.newBarBuilder(t.resolution,t.interval,this._session,this._session)}return this._builderCache},d.prototype.distance=function(t,e){var i,n,r,a,l;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||1e3*e>n)&&(r=500,a=s.extrapolateBarsFrontToTime(this._barBuilder(),n||1e3*t,1e3*e,r),this._extrapolatedData=this._extrapolatedData.concat(a)),(n=this._extrapolatedData[this._extrapolatedData.length-1])<1e3*e?{success:!1}:(l=this._extrapolatedData.indexOf(1e3*e),-1!==l?(c&&console.log('Model "{0}" "{1}", distance between "{2}" and "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),o(e),l)),{success:!0,result:l}):{success:!1})):{success:!1}},d.prototype.projectTime=function(t,e){var i,n,r,a;return isNumber(t)&&isNumber(e)&&this.isValid()?(i=this._extrapolatedData.length>0?this._extrapolatedData[0]:null,n=i&&this._extrapolatedData[this._extrapolatedData.length-1],1e3*t!==i&&(this._extrapolatedData=[1e3*t],i=null,n=null),(null===i||e>=this._extrapolatedData.length)&&(r=s.extrapolateBarsFrontByCount(this._barBuilder(),n||1e3*t,e-this._extrapolatedData.length+1),this._extrapolatedData=this._extrapolatedData.concat(r)),e<this._extrapolatedData.length?(a=this._extrapolatedData[e]/1e3,c&&console.log('Model "{0}" "{1}", proj.time from "{2}" offset "{3}" is "{4}"'.format(this._modelId,this._resolution,o(t),e,o(a))),a):t):t},r=function(t,e){this._source=t,this._target=e,this._isSessionTheSame=t._symbolInfo.timezone===e._symbolInfo.timezone&&t._symbolInfo.session===e._symbolInfo.session,this._isResolutionTheSame=t._resolution===e._resolution,this._shouldCorrectTradingDay=l.isDWM(t._resolution)&&!this._isSessionTheSame,this._cache={},null===h&&(h=new s.Session,h.init("Etc/UTC","24x7"))},r.prototype._sourceTargetBuilder=function(){var t,e;return this._sourceTargetBuilderCache||(t=n(this._target._resolution),e=this._isSessionTheSame?this._target._session:h,this._sourceTargetBuilderCache=s.newBarBuilder(t.resolution,t.interval,this._target._session,e)),this._sourceTargetBuilderCache},r.prototype.sourceTimeToTargetTime=function(t){var e,i,n,r,s,l;return this._isSessionTheSame&&this._isResolutionTheSame?t:isNumber(t)&&this._source.isValid()&&this._target.isValid()?(e=this._cache[t],e||(i=1e3*t,this._shouldCorrectTradingDay&&(n=a.utc_to_cal(this._source._session.timezone,i),
n=this._source._session.spec.correctTradingDay(n,this._source._session.timezone),r=new Date(n),a.set_hms(r,0,0,0,0),i=r.valueOf()),s=this._sourceTargetBuilder(),s.moveTo(i),l=s.indexOfBar(i),e=s.startOfBar(Math.max(0,l))/1e3,this._cache[t]=e),c&&console.log('Model "{0}" "{1}" sourceTime "{2}" => model "{3}" "{4}" targetTime "{5}"'.format(this._source.uniqueId(),this._source._resolution,o(t),this._target.uniqueId(),this._target._resolution,o(e))),e):t},t.exports.SyncPoint=r,t.exports.SyncModel=d},function(t,e,i){"use strict";var o,n=i(49),r=i(886),s=i(887),a=i(888),l=i(889),c=i(890),h=i(891),u=i(892),d=(o={},o[n.STYLE_AREA]=r,o[n.STYLE_BARS]=s,o[n.STYLE_CANDLES]=a,o[n.STYLE_HEIKEN_ASHI]=l,o[n.STYLE_HOLLOW_CANDLES]=c,o[n.STYLE_LINE]=h,o[n.STYLE_BASELINE]=u,o);t.exports=d},function(t,e,i){"use strict";function o(t){return-1!==a.indexOf(t)}function n(t){return-1!==l.indexOf(t)}function r(t){return c[t]}var s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),s=i(49),a=[s.STYLE_RENKO,s.STYLE_KAGI,s.STYLE_PNF,s.STYLE_PB,s.STYLE_HEIKEN_ASHI],e.isJapaneseStyle=o,l=[s.STYLE_RENKO,s.STYLE_PB,s.STYLE_KAGI,s.STYLE_PNF],e.hasProjection=n,c={open:function(t){return t[1]},high:function(t){return t[2]},low:function(t){return t[3]},close:function(t){return t[4]},hl2:function(t){return(t[2]+t[3])/2},hlc3:function(t){return(t[2]+t[3]+t[4])/3},ohlc4:function(t){return(t[1]+t[2]+t[3]+t[4])/4}},e.barFunction=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MINUTE_SPAN=20,e.HOUR_SPAN=30,e.DAY_SPAN=40,e.WEEK_SPAN=50,e.MONTH_SPAN=60,e.YEAR_SPAN=70},function(t,e,i){var o;!function(n,r,s,a){"use strict";function l(t,e,i){return setTimeout(p(t,i),e)}function c(t,e,i){return!!Array.isArray(t)&&(h(t,i[e],i),!0)}function h(t,e,i){var o;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(o=0;o<t.length;)e.call(i,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(i,t[o],o,t)}function u(t,e,i){var o="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=n.console&&(n.console.warn||n.console.log);return r&&r.call(n.console,o,i),t.apply(this,arguments)}}function d(t,e,i){var o,n=e.prototype;o=t.prototype=Object.create(n),o.constructor=t,o._super=n,i&&ft(o,i)}function p(t,e){return function(){return t.apply(e,arguments)}}function _(t,e){return typeof t==Te?t.apply(e?e[0]||a:a,e):t}function f(t,e){return t===a?e:t}function m(t,e,i){h(b(e),function(e){t.addEventListener(e,i,!1)})}function g(t,e,i){h(b(e),function(e){t.removeEventListener(e,i,!1)})}function v(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function y(t,e){return t.indexOf(e)>-1}function b(t){return t.trim().split(/\s+/g)}function S(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var o=0;o<t.length;){if(i&&t[o][i]==e||!i&&t[o]===e)return o;o++}return-1}function w(t){return Array.prototype.slice.call(t,0)}function T(t,e,i){
for(var o,n=[],r=[],s=0;s<t.length;)o=e?t[s][e]:t[s],S(r,o)<0&&n.push(t[s]),r[s]=o,s++;return i&&(n=e?n.sort(function(t,i){return t[e]>i[e]}):n.sort()),n}function C(t,e){for(var i,o,n=e[0].toUpperCase()+e.slice(1),r=0;r<Se.length;){if(i=Se[r],(o=i?i+n:e)in t)return o;r++}return a}function x(){return vt++}function P(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||n}function L(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){_(t.options.enable,[t])&&i.handler(e)},this.init()}function I(t){var e=t.options.inputClass;return new(e||(St?$:wt?j:bt?G:W))(t,k)}function k(t,e,i){var o=i.pointers.length,n=i.changedPointers.length,r=e&It&&o-n==0,s=e&(At|Mt)&&o-n==0;i.isFirst=!!r,i.isFinal=!!s,r&&(t.session={}),i.eventType=e,A(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function A(t,e){var i,o,n,r,s,a,l=t.session,c=e.pointers,h=c.length;l.firstInput||(l.firstInput=D(e)),h>1&&!l.firstMultiple?l.firstMultiple=D(e):1===h&&(l.firstMultiple=!1),i=l.firstInput,o=l.firstMultiple,n=o?o.center:i.center,r=e.center=V(c),e.timeStamp=Pe(),e.deltaTime=e.timeStamp-i.timeStamp,e.angle=z(n,r),e.distance=B(n,r),M(l,e),e.offsetDirection=R(e.deltaX,e.deltaY),s=O(e.deltaTime,e.deltaX,e.deltaY),e.overallVelocityX=s.x,e.overallVelocityY=s.y,e.overallVelocity=xe(s.x)>xe(s.y)?s.x:s.y,e.scale=o?N(o.pointers,c):1,e.rotation=o?F(o.pointers,c):0,e.maxPointers=l.prevInput?e.pointers.length>l.prevInput.maxPointers?e.pointers.length:l.prevInput.maxPointers:e.pointers.length,E(l,e),a=t.element,v(e.srcEvent.target,a)&&(a=e.srcEvent.target),e.target=a}function M(t,e){var i=e.center,o=t.offsetDelta||{},n=t.prevDelta||{},r=t.prevInput||{};e.eventType!==It&&r.eventType!==At||(n=t.prevDelta={x:r.deltaX||0,y:r.deltaY||0},o=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=n.x+(i.x-o.x),e.deltaY=n.y+(i.y-o.y)}function E(t,e){var i,o,n,r,s,l,c,h=t.lastInterval||e,u=e.timeStamp-h.timeStamp;e.eventType!=Mt&&(u>Lt||h.velocity===a)?(s=e.deltaX-h.deltaX,l=e.deltaY-h.deltaY,c=O(u,s,l),o=c.x,n=c.y,i=xe(c.x)>xe(c.y)?c.x:c.y,r=R(s,l),t.lastInterval=e):(i=h.velocity,o=h.velocityX,n=h.velocityY,r=h.direction),e.velocity=i,e.velocityX=o,e.velocityY=n,e.direction=r}function D(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:Ce(t.pointers[i].clientX),clientY:Ce(t.pointers[i].clientY)},i++;return{timeStamp:Pe(),pointers:e,center:V(e),deltaX:t.deltaX,deltaY:t.deltaY}}function V(t){var e,i,o,n=t.length;if(1===n)return{x:Ce(t[0].clientX),y:Ce(t[0].clientY)};for(e=0,i=0,o=0;o<n;)e+=t[o].clientX,i+=t[o].clientY,o++;return{x:Ce(e/n),y:Ce(i/n)}}function O(t,e,i){return{x:e/t||0,y:i/t||0}}function R(t,e){return t===e?Et:xe(t)>=xe(e)?t<0?Dt:Vt:e<0?Ot:Rt}function B(t,e,i){i||(i=Nt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return Math.sqrt(o*o+n*n)}function z(t,e,i){i||(i=Nt);var o=e[i[0]]-t[i[0]],n=e[i[1]]-t[i[1]];return 180*Math.atan2(n,o)/Math.PI}function F(t,e){return z(e[1],e[0],Wt)+z(t[1],t[0],Wt)}function N(t,e){return B(e[0],e[1],Wt)/B(t[0],t[1],Wt)}function W(){
this.evEl=Ht,this.evWin=Ut,this.pressed=!1,L.apply(this,arguments)}function $(){this.evEl=Gt,this.evWin=Yt,L.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function H(){this.evTarget=Zt,this.evWin=Xt,this.started=!1,L.apply(this,arguments)}function U(t,e){var i=w(t.touches),o=w(t.changedTouches);return e&(At|Mt)&&(i=T(i.concat(o),"identifier",!0)),[i,o]}function j(){this.evTarget=Qt,this.targetIds={},L.apply(this,arguments)}function q(t,e){var i,o,n,r,s,l=w(t.touches),c=this.targetIds;if(e&(It|kt)&&1===l.length)return c[l[0].identifier]=!0,[l,l];if(n=w(t.changedTouches),r=[],s=this.target,o=l.filter(function(t){return v(t.target,s)}),e===It)for(i=0;i<o.length;)c[o[i].identifier]=!0,i++;for(i=0;i<n.length;)c[n[i].identifier]&&r.push(n[i]),e&(At|Mt)&&delete c[n[i].identifier],i++;return r.length?[T(o.concat(r),"identifier",!0),r]:a}function G(){L.apply(this,arguments);var t=p(this.handler,this);this.touch=new j(this.manager,t),this.mouse=new W(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function Y(t,e){t&It?(this.primaryTouch=e.changedPointers[0].identifier,K.call(this,e)):t&(At|Mt)&&K.call(this,e)}function K(t){var e,i,o,n=t.changedPointers[0];n.identifier===this.primaryTouch&&(e={x:n.clientX,y:n.clientY},this.lastTouches.push(e),i=this.lastTouches,o=function(){var t=i.indexOf(e);t>-1&&i.splice(t,1)},setTimeout(o,te))}function Z(t){var e,i,o,n,r=t.srcEvent.clientX,s=t.srcEvent.clientY;for(e=0;e<this.lastTouches.length;e++)if(i=this.lastTouches[e],o=Math.abs(r-i.x),n=Math.abs(s-i.y),o<=ee&&n<=ee)return!0;return!1}function X(t,e){this.manager=t,this.set(e)}function J(t){var e,i;return y(t,ae)?ae:(e=y(t,le),i=y(t,ce),e&&i?ae:e||i?e?le:ce:y(t,se)?se:re)}function Q(){var t,e;return!!oe&&(t={},e=n.CSS&&n.CSS.supports,["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(i){t[i]=!e||n.CSS.supports("touch-action",i)}),t)}function tt(t){this.options=ft({},this.defaults,t||{}),this.id=x(),this.manager=null,this.options.enable=f(this.options.enable,!0),this.state=ue,this.simultaneous={},this.requireFail=[]}function et(t){return t&me?"cancel":t&_e?"end":t&pe?"move":t&de?"start":""}function it(t){return t==Rt?"down":t==Ot?"up":t==Dt?"left":t==Vt?"right":""}function ot(t,e){var i=e.manager;return i?i.get(t):t}function nt(){tt.apply(this,arguments)}function rt(){nt.apply(this,arguments),this.pX=null,this.pY=null}function st(){nt.apply(this,arguments)}function at(){tt.apply(this,arguments),this._timer=null,this._input=null}function lt(){nt.apply(this,arguments)}function ct(){nt.apply(this,arguments)}function ht(){tt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function ut(t,e){return e=e||{},e.recognizers=f(e.recognizers,ut.defaults.preset),new dt(t,e)}function dt(t,e){this.options=ft({},ut.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=I(this),this.touchAction=new X(this,this.options.touchAction),
pt(this,!0),h(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function pt(t,e){var i,o=t.element;o.style&&(h(t.options.cssProps,function(n,r){i=C(o.style,r),e?(t.oldCssProps[i]=o.style[i],o.style[i]=n):o.style[i]=t.oldCssProps[i]||""}),e||(t.oldCssProps={}))}function _t(t,e){var i=r.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}var ft,mt,gt,vt,yt,bt,St,wt,Tt,Ct,xt,Pt,Lt,It,kt,At,Mt,Et,Dt,Vt,Ot,Rt,Bt,zt,Ft,Nt,Wt,$t,Ht,Ut,jt,qt,Gt,Yt,Kt,Zt,Xt,Jt,Qt,te,ee,ie,oe,ne,re,se,ae,le,ce,he,ue,de,pe,_e,fe,me,ge,ve,ye,be,Se=["","webkit","Moz","MS","ms","o"],we=r.createElement("div"),Te="function",Ce=Math.round,xe=Math.abs,Pe=Date.now;ft="function"!=typeof Object.assign?function(t){var e,i,o,n;if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(e=Object(t),i=1;i<arguments.length;i++)if((o=arguments[i])!==a&&null!==o)for(n in o)o.hasOwnProperty(n)&&(e[n]=o[n]);return e}:Object.assign,mt=u(function(t,e,i){for(var o=Object.keys(e),n=0;n<o.length;)(!i||i&&t[o[n]]===a)&&(t[o[n]]=e[o[n]]),n++;return t},"extend","Use `assign`."),gt=u(function(t,e){return mt(t,e,!0)},"merge","Use `assign`."),vt=1,yt=/mobile|tablet|ip(ad|hone|od)|android/i,bt="ontouchstart"in n,St=C(n,"PointerEvent")!==a,wt=bt&&yt.test(navigator.userAgent),Tt="touch",Ct="pen",xt="mouse",Pt="kinect",Lt=25,It=1,kt=2,At=4,Mt=8,Et=1,Dt=2,Vt=4,Ot=8,Rt=16,Bt=Dt|Vt,zt=Ot|Rt,Ft=Bt|zt,Nt=["x","y"],Wt=["clientX","clientY"],L.prototype={handler:function(){},init:function(){this.evEl&&m(this.element,this.evEl,this.domHandler),this.evTarget&&m(this.target,this.evTarget,this.domHandler),this.evWin&&m(P(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(P(this.element),this.evWin,this.domHandler)}},$t={mousedown:It,mousemove:kt,mouseup:At},Ht="mousedown",Ut="mousemove mouseup",d(W,L,{handler:function(t){var e=$t[t.type];e&It&&0===t.button&&(this.pressed=!0),e&kt&&1!==t.which&&(e=At),this.pressed&&(e&At&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:xt,srcEvent:t}))}}),jt={pointerdown:It,pointermove:kt,pointerup:At,pointercancel:Mt,pointerout:Mt},qt={2:Tt,3:Ct,4:xt,5:Pt},Gt="pointerdown",Yt="pointermove pointerup pointercancel",n.MSPointerEvent&&!n.PointerEvent&&(Gt="MSPointerDown",Yt="MSPointerMove MSPointerUp MSPointerCancel"),d($,L,{handler:function(t){var e=this.store,i=!1,o=t.type.toLowerCase().replace("ms",""),n=jt[o],r=qt[t.pointerType]||t.pointerType,s=r==Tt,a=S(e,t.pointerId,"pointerId");n&It&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):n&(At|Mt)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,n,{pointers:e,changedPointers:[t],pointerType:r,srcEvent:t}),i&&e.splice(a,1))}}),Kt={touchstart:It,touchmove:kt,touchend:At,touchcancel:Mt},Zt="touchstart",Xt="touchstart touchmove touchend touchcancel",d(H,L,{handler:function(t){var e,i=Kt[t.type]
;i===It&&(this.started=!0),this.started&&(e=U.call(this,t,i),i&(At|Mt)&&e[0].length-e[1].length==0&&(this.started=!1),this.callback(this.manager,i,{pointers:e[0],changedPointers:e[1],pointerType:Tt,srcEvent:t}))}}),Jt={touchstart:It,touchmove:kt,touchend:At,touchcancel:Mt},Qt="touchstart touchmove touchend touchcancel",d(j,L,{handler:function(t){var e=Jt[t.type],i=q.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Tt,srcEvent:t})}}),te=2500,ee=25,d(G,L,{handler:function(t,e,i){var o=i.pointerType==Tt,n=i.pointerType==xt;if(!(n&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)Y.call(this,e,i);else if(n&&Z.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}}),ie=C(we.style,"touchAction"),oe=ie!==a,ne="compute",re="auto",se="manipulation",ae="none",le="pan-x",ce="pan-y",he=Q(),X.prototype={set:function(t){t==ne&&(t=this.compute()),oe&&this.manager.element.style&&he[t]&&(this.manager.element.style[ie]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return h(this.manager.recognizers,function(e){_(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),J(t.join(" "))},preventDefaults:function(t){var e,i,o,n,r,s,l,c=t.srcEvent,h=t.offsetDirection;return this.manager.session.prevented?void c.preventDefault():(e=this.actions,i=y(e,ae)&&!he[ae],o=y(e,ce)&&!he[ce],n=y(e,le)&&!he[le],i&&(r=1===t.pointers.length,s=t.distance<2,l=t.deltaTime<250,r&&s&&l)||n&&o?a:i||o&&h&Bt||n&&h&zt?this.preventSrc(c):a)},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}},ue=1,de=2,pe=4,_e=8,fe=_e,me=16,ge=32,tt.prototype={defaults:{},set:function(t){return ft(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(c(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=ot(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return c(t,"dropRecognizeWith",this)?this:(t=ot(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(c(t,"requireFailure",this))return this;var e=this.requireFail;return t=ot(t,this),-1===S(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(c(t,"dropRequireFailure",this))return this;t=ot(t,this);var e=S(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){i.manager.emit(e,t)}var i=this,o=this.state;o<_e&&e(i.options.event+et(o)),e(i.options.event),t.additionalEvent&&e(t.additionalEvent),o>=_e&&e(i.options.event+et(o))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=ge},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(ge|ue)))return!1;t++}return!0},recognize:function(t){var e=ft({},t)
;if(!_(this.options.enable,[this,e]))return this.reset(),void(this.state=ge);this.state&(fe|me|ge)&&(this.state=ue),this.state=this.process(e),this.state&(de|pe|_e|me)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},d(nt,tt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,o=e&(de|pe),n=this.attrTest(t);return o&&(i&Mt||!n)?e|me:o||n?i&At?e|_e:e&de?e|pe:de:ge}}),d(rt,nt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Ft},getTouchAction:function(){var t=this.options.direction,e=[];return t&Bt&&e.push(ce),t&zt&&e.push(le),e},directionTest:function(t){var e=this.options,i=!0,o=t.distance,n=t.direction,r=t.deltaX,s=t.deltaY;return n&e.direction||(e.direction&Bt?(n=0===r?Et:r<0?Dt:Vt,i=r!=this.pX,o=Math.abs(t.deltaX)):(n=0===s?Et:s<0?Ot:Rt,i=s!=this.pY,o=Math.abs(t.deltaY))),t.direction=n,i&&o>e.threshold&&n&e.direction},attrTest:function(t){return nt.prototype.attrTest.call(this,t)&&(this.state&de||!(this.state&de)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=it(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),d(st,nt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&de)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),d(at,tt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[re]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,o=t.distance<e.threshold,n=t.deltaTime>e.time;if(this._input=t,!o||!i||t.eventType&(At|Mt)&&!n)this.reset();else if(t.eventType&It)this.reset(),this._timer=l(function(){this.state=fe,this.tryEmit()},e.time,this);else if(t.eventType&At)return fe;return ge},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===fe&&(t&&t.eventType&At?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=Pe(),this.manager.emit(this.options.event,this._input)))}}),d(lt,nt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[ae]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&de)}}),d(ct,nt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Bt|zt,pointers:1},getTouchAction:function(){return rt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(Bt|zt)?e=t.overallVelocity:i&Bt?e=t.overallVelocityX:i&zt&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&xe(e)>this.options.velocity&&t.eventType&At},emit:function(t){var e=it(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),
this.manager.emit(this.options.event,t)}}),d(ht,tt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[se]},process:function(t){var e,i,o=this.options,n=t.pointers.length===o.pointers,r=t.distance<o.threshold,s=t.deltaTime<o.time;if(this.reset(),t.eventType&It&&0===this.count)return this.failTimeout();if(r&&s&&n){if(t.eventType!=At)return this.failTimeout();if(e=!this.pTime||t.timeStamp-this.pTime<o.interval,i=!this.pCenter||B(this.pCenter,t.center)<o.posThreshold,this.pTime=t.timeStamp,this.pCenter=t.center,i&&e?this.count+=1:this.count=1,this._input=t,0===this.count%o.taps)return this.hasRequireFailures()?(this._timer=l(function(){this.state=fe,this.tryEmit()},o.interval,this),de):fe}return ge},failTimeout:function(){return this._timer=l(function(){this.state=ge},this.options.interval,this),ge},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==fe&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),ut.VERSION="2.0.7",ut.defaults={domEvents:!1,touchAction:ne,enable:!0,inputTarget:null,inputClass:null,preset:[[lt,{enable:!1}],[st,{enable:!1},["rotate"]],[ct,{direction:Bt}],[rt,{direction:Bt},["swipe"]],[ht],[ht,{event:"doubletap",taps:2},["tap"]],[at]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},ve=1,ye=2,dt.prototype={set:function(t){return ft(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?ye:ve},recognize:function(t){var e,i,o,n,r=this.session;if(!r.stopped)for(this.touchAction.preventDefaults(t),i=this.recognizers,o=r.curRecognizer,(!o||o&&o.state&fe)&&(o=r.curRecognizer=null),n=0;n<i.length;)e=i[n],r.stopped===ye||o&&e!=o&&!e.canRecognizeWith(o)?e.reset():e.recognize(t),!o&&e.state&(de|pe|_e)&&(o=r.curRecognizer=e),n++},get:function(t){var e,i;if(t instanceof tt)return t;for(e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(c(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){var e,i;return c(t,"remove",this)?this:(t=this.get(t),t&&(e=this.recognizers,-1!==(i=S(e,t))&&(e.splice(i,1),this.touchAction.update())),this)},on:function(t,e){if(t!==a&&e!==a){var i=this.handlers;return h(b(t),function(t){i[t]=i[t]||[],i[t].push(e)}),this}},off:function(t,e){if(t!==a){var i=this.handlers;return h(b(t),function(t){e?i[t]&&i[t].splice(S(i[t],e),1):delete i[t]}),this}},emit:function(t,e){var i,o;if(this.options.domEvents&&_t(t,e),(i=this.handlers[t]&&this.handlers[t].slice())&&i.length)for(e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()},o=0;o<i.length;)i[o](e),o++},destroy:function(){this.element&&pt(this,!1),this.handlers={},this.session={},this.input.destroy(),
this.element=null}},ft(ut,{INPUT_START:It,INPUT_MOVE:kt,INPUT_END:At,INPUT_CANCEL:Mt,STATE_POSSIBLE:ue,STATE_BEGAN:de,STATE_CHANGED:pe,STATE_ENDED:_e,STATE_RECOGNIZED:fe,STATE_CANCELLED:me,STATE_FAILED:ge,DIRECTION_NONE:Et,DIRECTION_LEFT:Dt,DIRECTION_RIGHT:Vt,DIRECTION_UP:Ot,DIRECTION_DOWN:Rt,DIRECTION_HORIZONTAL:Bt,DIRECTION_VERTICAL:zt,DIRECTION_ALL:Ft,Manager:dt,Input:L,TouchAction:X,TouchInput:j,MouseInput:W,PointerEventInput:$,TouchMouseInput:G,SingleTouchInput:H,Recognizer:tt,AttrRecognizer:nt,Tap:ht,Pan:rt,Swipe:ct,Pinch:st,Rotate:lt,Press:at,on:m,off:g,each:h,merge:gt,extend:mt,assign:ft,inherit:d,bindFn:p,prefixed:C}),be=a!==n?n:"undefined"!=typeof self?self:{},be.Hammer=ut,(o=function(){return ut}.call(e,i,e,t))!==a&&(t.exports=o)}(window,document)},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm3.34 2.123l3.66 3.66 3.66-3.66 1.217 1.22-3.66 3.658 3.66 3.66-1.22 1.22-3.658-3.66-3.66 3.66-1.22-1.22 3.66-3.66-3.66-3.66z"/></svg>'},function(t,e,i){"use strict";function o(t){var e,i=[],n=t.m_items;for(e=0;e<n.length;e++)n[e]._menu&&(i.push(n[e]._menu),i=i.concat(o(n[e]._menu)));return i}function n(t,e,i){var o,n;this.options={},this._parentMenuItem=i,$.extend(this.options,e),this.options.class&&(this.options.attributes.class=this.options.class),this.jqMenu=null,this.m_wrapper=null,this.m_items=[];for(o in t)n=t[o],this.addItem(n)}var r=i(354),s=i(52).ActionPlaceholder,a=i(928),l=a.Item,c=a.ItemPlaceholder,h=i(929),u=i(231);n.prototype.addItem=function(t){var e;return e=t instanceof s?new c(t,this):new l(t,this),this.m_items.push(e),e},n.renderItem=function(t,e){t.append(e.render(t))},n.prototype.closeOtherSubmenus=function(t){for(var e=0;e<this.m_items.length;++e)this.m_items[e].highlight(!1),this.m_items[e]._menu&&(this.m_items[e]._menu.destroy(),this.m_items[e]._menu=null)},n.prototype.isShown=function(){return null!==this.jqMenu},n.prototype.render=function(){var t,e,i,o=this.getAttributes();if(this._parentMenuItem){t=$("<table>"),this.jqMenu=t,t.attr("cellspacing","0"),t.attr("cellpadding","0"),t.addClass("context-menu"),t.addClass("submenu");for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}else{t=u.create(r.MENU_TAG,o),this.jqMenu=t;for(e in this.m_items)i=this.m_items[e],n.renderItem(t,i)}return this.jqMenu},n.prototype.getAttributes=function(){var t={},e=["context-menu"];return this.options.attributes&&this.options.attributes.class&&e.push(this.options.attributes.class),t.cellspacing=0,t.cellpadding=0,t.class=e.join(),t},n.prototype.deploy=function(t,e){var i=this.wrapper();return this.jqMenu=i.append(this.render()),e?($(e).data("submenu",this.jqMenu),$(document.body).append(this.jqMenu),this.jqMenu.data("parent-menu",e),this.jqMenu.data("parent-item",t.currentTarget)):$(document.body).append(this.jqMenu),h.unbindContextMenu(this.jqMenu),this._setCoords(t),this.jqMenu},n.prototype.show=function(t,e){this.deploy(t,e).show()},n.prototype.hide=function(){
this.isShown()&&this.destroy()},n.prototype.destroy=function(){$.each(this.m_items,function(t,e){e._menu&&e._menu.destroy()}),this.jqMenu&&(this.jqMenu.remove(),this.jqMenu=null),this.m_wrapper.empty()},n.prototype._setCoords=function(t){var e,i,o,n,r,s,a,l=5,c=this.jqMenu,h=$(this.jqMenu.data("parent-item")),u={width:$(window).width(),height:Math.min($(window).height(),$("body").height())},d={top:$(document).scrollTop(),left:$(document).scrollLeft()};for(this.jqMenu.css({maxWidth:u.width-2*l,maxHeight:u.height-2*l}),e={width:c.outerWidth(),height:c.outerHeight()},h.size()?(o=h.offset(),i={top:o.top-1,left:o.left+h.outerWidth()}):i={top:t.pageY,left:t.pageX},this.jqMenu.offset(i),n=!1,r={},r.top=Math.min(i.top,u.height+d.top-e.height-l),i.left+e.width+l>u.width+d.left||this.options.reverse?(n=!0,r.left=i.left-e.width):r.left=i.left,s=t.target;s&&s!==document;s=s.parentNode)if("fixed"===$(s).css("position")){this.jqMenu.css("position","fixed");break}this.jqMenu.offset(r),n&&(a=e.width-this.jqMenu.outerWidth())&&(r.left+=a,this.jqMenu.offset(r))},n.prototype._wrapper=function(){var t=this,e=r.WRAPPER_ATTRIBUTES;return this._parentMenuItem?this.m_wrapper=u.create(r.WRAPPER_TAG,e):(this.m_wrapper=h.createPopup(e,void 0,{mouseDownOutsideEvent:function(e){var i=$();$.each(o(t),function(){i=i.add(this.m_wrapper)}),$(e.target).parents().andSelf().is(i)||t.hide()}}),this.m_wrapper.addClass("topmenu")),this.m_wrapper},n.prototype.wrapper=function(t){return this.m_wrapper||this._wrapper()},t.exports=n},function(t,e,i){"use strict";t.exports={INSERT_AT_END:0,INSERT_AT_START:1,INSERT_AT_POS:2,WRAPPER_TAG:"div",WRAPPER_ATTRIBUTES:{class:"context-menu-wrapper"},MENU_TAG:"table",ITEM_ROW_TAG:"tr",ICON_CELL_TAG:"td",TEXT_CELL_TAG:"td",RIGHT_CELL_TAG:"td",SUBMENU_CELL_TAG:"td"}},function(t,e,i){"use strict";function o(t){return"number"!=typeof t&&(t=TradingView.STUDY_COUNT_LIMIT),(0,n.createNoticeDialog)({title:$.t("Warning"),content:$.t("Studies limit exceeded: {0} studies per layout.<br>\nPlease, remove some studies.").format(t)})}Object.defineProperty(e,"__esModule",{value:!0}),e.createTooManyStudiesNotice=o;var n=i(145)},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(72),n=i(10),r=i(7),s=r.getLogger("Common.UndoStack"),a=function(){function t(){this._commands=[],this._onChange=new n}return t.prototype.onChange=function(){return this._onChange},t.prototype.isEmpty=function(){return 0===this._commands.length},t.prototype.clear=function(){this._commands.length=0,this._onChange.fire()},t.prototype.push=function(t){if(!(t instanceof o.UndoCommand))throw new TypeError("argument must be an instance of UndoCommand");this._commands.push(t),this._onChange.fire()},t.prototype.pop=function(){if(this.isEmpty())return void s.logDebug("pop: undo stack is empty");var t=this._commands.pop();return this._onChange.fire(),t},t.prototype.head=function(){if(!this.isEmpty())return this._commands[this._commands.length-1]},t}(),e.UndoStack=a},function(t,e,i){"use strict";var o,n,r,s,a
;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(72),r=function(t){function e(e,i,o){var n=t.call(this,o)||this;return n._chartModel=e,n._defaultProperty=i,n._state=i.state(),n}return o.__extends(e,t),e.prototype.undo=function(){this._defaultProperty.merge(this._state),this._defaultProperty.listeners().fire(this._defaultProperty),this._chartModel.mainSeries().onChartStyleChanged()},e}(n.UndoCommand),e.RestoreDefaultsUndoCommand=r,s=function(t){function e(e,i,o){return void 0===o&&(o="Restore User Defaults"),t.call(this,e,i,o)||this}return o.__extends(e,t),e.prototype.redo=function(){this._chartModel.restoreDefaults(this._defaultProperty)},e}(r),e.RestoreUserDefaultsUndoCommand=s,a=function(t){function e(e,i,o){return void 0===o&&(o="Restore Defaults"),t.call(this,e,i,o)||this}return o.__extends(e,t),e.prototype.redo=function(){this._chartModel.restoreFactoryDefaults(this._defaultProperty)},e}(r),e.RestoreFactoryDefaultsUndoCommand=a},function(t,e,i){"use strict";function o(t){i.e(4).then(function(e){i(413).showGoToDateDialog(t)}.bind(null,i)).catch(i.oe)}Object.defineProperty(e,"__esModule",{value:!0}),e.showGoToDateDialog=o},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-90 -55 140 140" width="16" height="16"><path d="M10 12l-40.3-42.5-10 10.6 29.7 31.2L-41 43.4l10.7 11.3L10 12.2l-.1-.1z"/></svg>'},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.AddCompareDialog=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(951),s=i(953),a=i(415),i(959),l=null,e.AddCompareDialog=function(){function t(e){o(this,t),this._chartWidgetCollection=e,this._$symbolSearchPopup=null,this._dialog=null,this._compareTab=new r.CompareTab(this._chartWidgetCollection,this),this._addSymbolTab=new s.AddSymbolTab(this._chartWidgetCollection,this)}return n(t,[{key:"show",value:function(){var t,e=this,i=[];return i.push({name:$.t("Compare"),page:this._compareTab.$tab.addClass("tv-compare-dialog__tab-page")}),i.push({name:$.t("Add Symbol",{context:"compare_or_add_symbol_dialog"}),page:this._addSymbolTab.$tab.addClass("tv-compare-dialog__tab-page")}),t=(0,a.createTabbedDialog)({tabs:i,width:400,tabStateSaveKey:"CompareAddDialog.tab",destroyOnClose:!0,withScroll:!1,addClass:"tv-compare-dialog",tabsScrollBoxAddClass:"tv-compare-dialog__scroll-box",tabAddClass:"tv-compare-dialog__tab",isClickOutFn:function(t){if(e._compareTab.isClickOnTab(t)||e._addSymbolTab.isClickOnTab(t))return!1}}),l&&l.close(),this._dialog=t.dialog,this._dialog.open(),l=this._dialog,this._dialog}},{key:"getZIndex",value:function(){return this._dialog.zIndex}}]),t}()},function(t,e){},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(7),n=i(61),
r=o.getLogger("GUI.Blocks.AbstractIndicator"),i(144),s=function(){function t(){this._classSuffix="",this._quoteSessionPrefix="abstract-indicator",this._shortMode=!1,this._showTooltip=!0,this._subscribed=!1}return t.prototype.getValue=function(){return this._value},t.prototype.getTooltipText=function(){return this.getLabel()},t.prototype.getLabel=function(){return this._labelMap[this._value]||""},t.prototype.getElement=function(){return this._el},t.prototype.update=function(t,e){this._updateValue(t,e),this._render()},t.prototype.setTooltipEnabled=function(t){void 0===t&&(t=!1),this._showTooltip!==t&&(this._showTooltip=t,this._renderTooltip())},t.prototype.enableShortMode=function(){!0!==this._shortMode&&(this._shortMode=!0,this._render())},t.prototype.disableShortMode=function(){!1!==this._shortMode&&(this._shortMode=!1,this._render())},t.prototype.isShortModeEnabled=function(){return this._shortMode},t.prototype.start=function(){!this._subscribed&&t._quoteSession&&this._symbolName&&(t._quoteSession.subscribe(this._getQuoteSessionId(),this._symbolName,this.update.bind(this)),this._subscribed=!0)},t.prototype.stop=function(){this._subscribed&&t._quoteSession&&this._symbolName&&(t._quoteSession.unsubscribe(this._getQuoteSessionId(),this._symbolName),this._subscribed=!1)},t.assignQuoteSession=function(e){t._quoteSession=e},t.prototype._init=function(e){this._el=e.el?e.el:document.createElement("span"),this._el.innerHTML="",this._classMap=e.classMap,this._labelMap=e.labelMap,this._showTooltip=e.showTooltip,this._classSuffix=e.classSuffix,this._symbolName=e.symbol,this._quoteSessionGUID=n.guid(),!0===e.short&&this.enableShortMode(),e.data&&this._updateValue(e.data),e.quoteSession&&t.assignQuoteSession(e.quoteSession)},t.prototype._clearClasses=function(){var t=this;Object.values(this._classMap).map(function(e){t._el.classList.remove(""+e),t._el.classList.remove(""+e+t._classSuffix)})},t.prototype._render=function(){this._renderClasses(),this._renderTooltip(),this._renderLabel()},t.prototype._renderLabel=function(){this._el.textContent=this.getLabel()},t.prototype._updateValue=function(t,e){var i=this._getValueFromData(t);(e||i!==this._value)&&(this._value=i)},t.prototype._renderClasses=function(){var t,e,i,o=this._el.classList;o.add(this._componentClass,this._componentClass+this._classSuffix),t=this._classMap[this._value];for(e in this._classMap)(i=this._classMap[e])&&(i===t?o.add(i,i+this._classSuffix):o.remove(i,i+this._classSuffix));!t&&this._value&&r.logWarn("no className for status "+this._value)},t.prototype._renderTooltip=function(){this._el.setAttribute("title",this._showTooltip?this.getTooltipText():""),this._el.classList.toggle("apply-common-tooltip",this._showTooltip)},t.prototype._getQuoteSessionId=function(){return this._quoteSessionPrefix+"."+this._quoteSessionGUID},t}(),e.AbstractIndicator=s,window.AbstractIndicator=s},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){
var i=new Date(t+e),o=Math.round(Math.abs(e)/6e4),n="UTC";return 0!==o&&(n+=e>0?"+":"-",n+=Math.floor(o/60),o%60&&(n+=":"+o%60)),i.getUTCFullYear()+"-"+("0"+(i.getUTCMonth()+1)).slice(-2)+"-"+("0"+i.getUTCDate()).slice(-2)+" "+("0"+i.getUTCHours()).slice(-2)+":"+("0"+i.getUTCMinutes()).slice(-2)+" ("+n+")"}function r(t){return"string"==typeof t&&0!==t.trim().length}function s(t){var e,i,o,n,s;if(!t||0===t.length)return!0;for(e=0;e<t.length;e++){if(r(t[e])||t[e].id||r(t[e].title))return!1;if(t[e].lines)for(i=t[e].lines,o=i.length,n=0;n<o;n++)if(s=i[n],r(s)||r(s.line))return!1}return!0}function a(t,e){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return t.hasOwnProperty("text")?t.hasOwnProperty("color")&&i?e.append($("<span>",{style:"color: "+t.color}).text(t.text)):e.text(t.text):e.text(t)}function l(t,e){if(Array.isArray(t)&&2===t.length)$("<dl>").append(a(t[0],$("<dt>")),a(t[1],$("<dd>"),!0)).appendTo(e);else if(t.hasOwnProperty("br")&&t.br)$("<br>").appendTo(e);else{var i=$("<dl>").append(a(t,$("<dt>"))).appendTo(e);t.hasOwnProperty("listItem")&&i.addClass("list-item")}}function c(t,e){$("<a>").attr("href",t.href).text(t.text).addClass(t.class).appendTo(e)}function h(t,e){var i,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if("string"==typeof t)$("<h2>").text(t).appendTo(e);else if(t.hasOwnProperty("lines"))for(i=0;i<t.lines.length;i++)t.lines[i].hasOwnProperty("line")?0===i?t.lines[i].line.isEmpty||$("<h2>").text(t.lines[i].line).appendTo(e):l(t.lines[i].line,e):t.lines[i].hasOwnProperty("link")&&c(t.lines[i].link,e);else t.hasOwnProperty("title")&&$("<h2>").text(t.title).appendTo(e),t.hasOwnProperty("actual")&&$("<dl>").append($("<dt>").text($.t("Actual")+": "),$("<dd>").text(t.actual||"—")).appendTo(e),t.hasOwnProperty("forecast")&&$("<dl>").append($("<dt>").text($.t("Forecast")+": "),$("<dd>").text(t.forecast||"—")).appendTo(e),t.hasOwnProperty("previous")&&$("<dl>").append($("<dt>").text($.t("Previous")+": "),$("<dd>").text(t.previous||"—")).appendTo(e),t.hasOwnProperty("timestamp")&&$("<dl>").append($("<dt>").text($.t("Date")+": "),$("<dd>").text(n(t.timestamp,o)||"—")).appendTo(e)}var u;Object.defineProperty(e,"__esModule",{value:!0}),e.Tooltip=void 0,u=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(972),e.Tooltip=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.direction,n=void 0===i?"top":i,r=e.clickable,s=void 0!==r&&r,a=e.wide,l=void 0!==a&&a;o(this,t),this._direction=n,this._tooltipShown=!1,this._tooltipX=void 0,this._tooltipY=void 0,this._tooltipItems=null,this._width=l?250:200,this._$tooltip=$("<div>").addClass("tv-chart-events-source__tooltip").css({position:"absolute",width:this._width+"px"}),this._$tooltipContent=$("<div>").addClass("tv-chart-events-source__tooltip__content").appendTo(this._$tooltip),
s&&this._$tooltip.addClass("tv-chart-events-source__tooltip--clickable")}return u(t,[{key:"show",value:function(){var t,e,i,o,n,r,a,l,c,u,d,p,_,f,m,g,v,y,b,S=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},w=S.items,T=void 0===w?[]:w,C=S.x,x=void 0===C?0:C,P=S.y,L=void 0===P?0:P,I=S.wrapElement,k=void 0===I?null:I,A=S.timeOffset,M=void 0===A?"":A,E=S.leftBorderColor,D=void 0===E?null:E;if(k&&!s(T)){if(t=$(k).width(),e=$(k).height(),i=!1,o=!1,this._tooltipShown||(this._$tooltip.appendTo(k),this._tooltipShown=!0,i=!0,o=!0),x===this._tooltipX&&L===this._tooltipY||(i=!0),i&&(n=Math.max(Math.min(x-this._width/2,t-this._width-10),0),this._$tooltip.css({left:Math.round(n),bottom:Math.round(e-L+10)})),this._tooltipItems||(o=!0),!o)for(r=T.length;r--;)if(this._tooltipItems[r]!==T[r]){o=!0;break}if(o){if(a=void 0,T.length<=1)a=T;else{for(l={},c=T.length;c--;)u=T[c].importance,null==u&&(u=-1),l[u]||(l[u]=[]),l[u].push(T[c]);if(d=Object.keys(l).sort(function(t,e){return t-e}),d.length<=1)a=l[d[0]];else for(a=[],p=d.length;p--;)for(_=l[d[p]],f=_.length;f--;)a.push(_[f])}for(this._$tooltipContent.empty(),m=a.length;m--;)g=a[m],v="",g.hasOwnProperty("importance")?("string"==typeof g.importance&&("earnings"===g.importance?v="--importance-earnings":"splits"===g.importance?v="--importance-splits":"dividends"===g.importance?v="--importance-dividends":"list"===g.importance&&(v="--importance-list")),0===g.importance?v="--importance-normal":g.importance>0&&(v="--importance-high")):D||(v="--importance-none"),y="tv-chart-events-source__tooltip__item",v&&(y+=" "+y+v),b=$("<div>").attr("class",y),D&&b.css("border-left-color",D),h(g,b,M),b.appendTo(this._$tooltipContent);this._tooltipItems=T}"bottom"===this._direction&&this._$tooltip.css({bottom:Math.round(e-L-this._$tooltipContent.height()+10)})}}},{key:"hide",value:function(){this._tooltipShown&&(this._$tooltip.detach(),this._tooltipShown=!1)}},{key:"isOpened",value:function(){return this._tooltipShown}}]),t}()},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),o=i(13),i(43),n=i(351),r=i(31),s=i(24),a=i(10),l=i(17),c=i(134),h=i(416),u='<div class="tv-floating-toolbar i-closed i-hidden">'+(Modernizr.touch?'<div class="tv-floating-toolbar__drag-ext js-drag"></div>':"")+'<div class="tv-floating-toolbar__widget-wrapper"><div class="tv-floating-toolbar__drag js-drag">'+h+'</div><div class="tv-floating-toolbar__content js-content"></div></div></div>',i(974),d=function(){function t(e){this._widget=document.createElement("div"),this._isVertical=!1,this._hiddingTimeoutId=null,this._visibility=new l(!1),this._windowResizeListener=this._onWindowResize.bind(this),this._reorderedDelegate=new a,t._toolbars.push(this),this._options=e,this._widget=o(u).get(0),this._content=this._widget.getElementsByClassName("js-content").item(0),this._setZIndex(t._startZIndex+t._toolbars.length-1),this._options.addClass&&(this._widget.className+=" "+this._options.addClass),
this._options.layout&&"auto"!==this._options.layout&&(this._isVertical="vertical"===this._options.layout,this._updateLayoutType())}return t.prototype.destroy=function(){this.hide(!0),t._toolbars.splice(t._toolbars.indexOf(this),1),document.body.contains(this._widget)&&document.body.removeChild(this._widget),this._widget.innerHTML=""},t.prototype.isVisible=function(){return this._visibility.value()},t.prototype.visibility=function(){return this._visibility.readonly()},t.prototype.isVertical=function(){return this._isVertical},t.prototype.show=function(){var t=this;this.isVisible()||(document.body.contains(this._widget)||(this._init(),document.body.appendChild(this._widget)),this._setHiddingTimeout(null),window.addEventListener("resize",this._windowResizeListener),this.raise(),this._visibility.setValue(!0),this._widget.classList.contains("i-hidden")?(this._widget.classList.remove("i-hidden"),setTimeout(function(){t.isVisible()&&t._widget.classList.remove("i-closed")})):this._widget.classList.remove("i-closed"),this._onWindowResize())},t.prototype.hide=function(t){var e,i,o=this;void 0===t&&(t=!1),this.isVisible()&&(e=this._widget.classList.contains("i-closed"),this._widget.classList.add("i-closed"),this._visibility.setValue(!1),t||e?(this._setHiddingTimeout(null),this._widget.classList.add("i-hidden")):(i=setTimeout(function(){o._setHiddingTimeout(null),o._widget.classList.add("i-hidden")},this.hideDuration()),this._setHiddingTimeout(i)),window.removeEventListener("resize",this._windowResizeListener))},t.prototype.raise=function(){t._toolbars.length+t._startZIndex!==this._zIndex()&&(t._toolbars.splice(t._toolbars.indexOf(this),1),t._toolbars.push(this),t._updateAllZIndexes())},t.prototype.hideDuration=function(){return.75*r.dur},t.prototype.addWidget=function(t,e){var i,o,n;if(void 0===e&&(e={}),i=this.widgetsCount(),void 0===e.index&&(e.index=i),e.index<0||e.index>i)throw Error("Index must be in [0, "+i+"]");o=document.createElement("div"),o.className="tv-floating-toolbar__widget js-widget",o.appendChild(t),n=e.index===i?null:this._content.childNodes.item(e.index),this._content.insertBefore(o,n),this._onWindowResize()},t.prototype.removeWidget=function(t){var e=this._findWrapperForWidget(t);e&&(this._content.removeChild(e),this._onWindowResize())},t.prototype.widgetsCount=function(){return this._content.childNodes.length},t.prototype.showWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.remove("i-hidden")},t.prototype.hideWidget=function(t){var e=this._findWrapperForWidget(t);e&&e.classList.add("i-hidden")},t.prototype.removeWidgets=function(){for(;this._content.firstChild;)this._content.removeChild(this._content.firstChild);this._onWindowResize()},t.prototype.onWidgetsReordered=function(){return this._reorderedDelegate},t.prototype.onContextMenu=function(t){var e,i=this;Modernizr.touch?(e=new n(this._widget),e.get("press").set({time:500}),e.on("press",function(e){i._preventWidgetTouchEndEvent(),t(e.srcEvent)})):this._widget.addEventListener("contextmenu",t)},
t.prototype._determineCurrentLayoutVertical=function(t){var e=this._isVertical?t.height:t.width;return window.innerWidth<e},t.prototype._getWidget=function(){return this._widget},t.prototype._findWrapperForWidget=function(t){var e,i,o=this._content.getElementsByClassName("js-widget");for(e=0;e<o.length;++e)if(i=o.item(e),i.contains(t))return i;return null},t.prototype._onVerticalChanged=function(t,e){},t.prototype._setHiddingTimeout=function(t){null!==this._hiddingTimeoutId&&clearTimeout(this._hiddingTimeoutId),this._hiddingTimeoutId=t},t.prototype._preventWidgetTouchEndEvent=function(){var t=this,e=function(i){i.preventDefault(),t._widget.removeEventListener("touchend",e)};this._widget.addEventListener("touchend",e)},t.prototype._updateLayoutType=function(){this._widget.classList.toggle("i-vertical",this._isVertical)},t.prototype._onWindowResize=function(){var t,e;"auto"===(this._options.layout||"auto")&&(t=this._isVertical,e=this._getCorrectedWidgetRect(),this._isVertical=this._determineCurrentLayoutVertical(e),this._updateLayoutType(),t!==this._isVertical&&this._onVerticalChanged(this._isVertical,t)),this._checkPosition()},t.prototype._checkPosition=function(){var t=this._getCorrectedWidgetRect(),e={left:t.left,top:t.top};this._correctPosition(e),t.left===e.left&&t.top===e.top||(this._widget.style.left=e.left+"px",this._widget.style.top=e.top+"px")},t.prototype._correctPosition=function(t){var e=this._getCorrectedWidgetRect();t.left+e.width>window.innerWidth&&(t.left=Math.max(0,window.innerWidth-e.width)),t.top+e.height>window.innerHeight&&(t.top=Math.max(0,window.innerHeight-e.height)),t.left=Math.max(0,t.left),t.top=Math.max(0,t.top)},t.prototype._setZIndex=function(t){this._widget.style.zIndex=t+""},t.prototype._zIndex=function(){return+this._widget.style.zIndex},t.prototype._loadPosition=function(){var t=s.getJSON(this._options.positionSettingsKey,this._options.defaultPosition);this._widget.style.left=Math.round(t.left)+"px",this._widget.style.top=Math.round(t.top)+"px",this._onWindowResize()},t.prototype._savePosition=function(){var t=this._widget.getBoundingClientRect();s.setJSON(this._options.positionSettingsKey,{left:t.left,top:t.top})},t.prototype._init=function(){this._loadPosition(),c.lazyJqueryUI(o(this._widget)).draggable({containment:"window",drag:this._onDragEvent.bind(this),handle:".js-drag",stop:this._savePosition.bind(this)}),this._options.allowSortable&&this._initSortable(),this._widget.addEventListener(Modernizr.touch?"touchstart":"mousedown",this.raise.bind(this))},t.prototype._onDragEvent=function(t,e){this._correctPosition(e.position)},t.prototype._initSortable=function(){var t=this,e=-1;c.lazyJqueryUI(o(this._content)).sortable({start:function(t,i){e=i.item.index()},stop:function(i,o){var n=o.item.index();e!==n&&t._reorderedDelegate.fire(e,n)},tolerance:"point"})},t.prototype._getCorrectedWidgetRect=function(){var t,e,i,o,n=this._widget.getBoundingClientRect();return this._widget.classList.contains("i-closed")?(t=.925,e=1/t-1,i=n.width*e,o=n.height*e,{bottom:n.bottom+o/2,height:n.height+o,
left:n.left-i/2,right:n.right+i/2,top:n.top-o/2,width:n.width+i}):n},t._updateAllZIndexes=function(){t._toolbars.forEach(function(e,i){e._setZIndex(t._startZIndex+i)})},t._startZIndex=20,t._toolbars=[],t}(),e.FloatingToolbar=d},function(t,e,i){"use strict";(function(e){var o=i(58),n=i(34).Interval,r=i(10),s=i(5),a=function(t,e){this._server=t,this._session=e,this._timezone=null,this._timezoneId="",this._isDWM=!1,this._resolution=null,this.seriesCompleted=new r,this._lastBarTimes={}};a.prototype.lastBarTime=function(t){return this._lastBarTimes[t]},a.prototype._userTimezone=function(){return this._timezone},a.prototype.setTimezone=function(t){this._timezone="exchange"===t?"exchange":e.get_timezone(t),this._timezoneId=t},a.prototype.timezone=function(){return this._timezoneId},a.prototype.setResolution=function(t){this._isDWM=n.isDWM(t),this._resolution=t},a.prototype.onRequestMetadata=function(t,e){this._server.receiveLocalResponse({method:"studies_metadata",params:[this._session,t,e]})},a.prototype.onSymbolResolved=function(t,e){this._server.receiveLocalResponse({method:"symbol_resolved",params:[this._session,t,e]})},a.prototype.onSymbolError=function(t,e){this._server.receiveLocalResponse({method:"symbol_error",params:[this._session,t,e]})},a.prototype.onStudyError=function(t,e){this._server.receiveLocalResponse({method:"study_error",params:[this._session,t,e]})},a.prototype.onSeriesLoading=function(t,e){this._server.receiveLocalResponse({method:"series_loading",params:[this._session,t,e]})},a.prototype.onSeriesCompleted=function(t,e,i){this._server.receiveLocalResponse({method:"series_completed",params:[this._session,t,i,e]}),this.seriesCompleted.fire(t)},a.prototype.onSeriesError=function(t,e){this._server.receiveLocalResponse({method:"series_error",params:[this._session,t,e]})},a.prototype.onSeriesClearData=function(t,e){var i={};i[t]={series:[],turnaround:e},this._server.receiveLocalResponse({method:"timescale_update",params:[this._session,i,{index:0,zoffset:0,changes:[],marks:[],index_diff:[]}]})},a.prototype.onStudyCompleted=function(t,e){this._server.receiveLocalResponse({method:"study_completed",params:[this._session,t,e]})},a.prototype.onStudyLoading=function(t,e){this._server.receiveLocalResponse({method:"study_loading",params:[this._session,t,e]})},a.prototype._calcMarksTime=function(t,i,n,r,a){var l,c,h,u,d,p=e.get_timezone(i),_=this;if(this._isDWM&&!s.enabled("disable_resolution_rebuild"))for(d=new o.Session,d.init(p,n),u=0;u<t.length;u++)h=t[u],l=r(h),c=e.utc_to_cal(p,1e3*l),c=d.spec.correctTradingDay(c,p),e.set_hms(c,0,0,0,0),t[u]=a(h,parseInt(c.valueOf()/1e3));else for(u=0;u<t.length;u++)t[u]=a(t[u],_.timeInTimezone(r(t[u]),p))},a.prototype.onTickmarksUpdated=function(t,e,i,o){var r,s,a,l,c,h,u;if(n.isEqual(o,this._resolution)){for(r=e.slice(0),this._calcMarksTime(r,i.timezone,i.session,function(t){return t},function(t,e){return e}),s=[],a=[],c=0;c<r.length;++c)h=r[c],s.push([this._spanByTime(h,l),h,t+c]),a.push(h),l=h;u={method:"tickmark_update",params:[this._session,{index:t,zoffset:0,changes:a,
marks:s,index_diff:[]}]},this._server.receiveLocalResponse(u)}},a.prototype.onTimescaleUpdate=function(t,e,i,o,n,r){var s,a,l,c,h,u,d,p,_=r&&r.slice(0);for(this._lastBarTimes[t]=_?_&&_[_.length-1]:i&&i[i.length-1].value[0],this._calcMarksTime(i,o.timezone,o.session,function(t){return t.value[0]},function(t,e){return t.exTime=e,t}),_&&this._calcMarksTime(_,o.timezone,o.session,function(t){return t},function(t,e){return{markTime:e,time:t}}),s={},s[t]={series:i,turnaround:e},a=[],l=[],h=i.map(function(t){return{markTime:t.exTime,time:t.value[0]}}),_&&(h=h.concat(_)),u=0;u<h.length;++u)d=h[u].markTime,a.push([this._spanByTime(d,c),d,n+u]),l.push(h[u].time),c=d;p={method:"timescale_update",params:[this._session,s,{index:n,zoffset:0,changes:l,marks:a,index_diff:[]}]},this._server.receiveLocalResponse(p)},a.prototype.onSeriesTimeframeUpdate=function(t,e,i,o,n){var r={method:"series_timeframe",params:[this._session,t,e,i,o,n]};this._server.receiveLocalResponse(r)},a.prototype.onPointsetDataUpdate=function(t,e,i,o){this._onDataUpdate(t,e,i,null,o,1)},a.prototype.onDataUpdate=function(t,e,i,o,n){this._onDataUpdate(t,e,i,o,n,0)},a.prototype._onDataUpdate=function(t,e,i,o,n,r){var s,a={},l="",c=[];null!==o&&(l=JSON.stringify(o.data),c=o.indexes||[]),a[t]={s:i,ns:{d:l,indexes:c},turnaround:e},s={method:"data_update",params:[this._session,a]},this._server.receiveLocalResponse(s)},a.prototype.onQuotesData=function(t){this._server.receiveLocalResponse({method:"quote_symbol_data",params:t})},a.prototype.onDepthData=function(t){this._server.receiveLocalResponse({method:"dd",params:t})},a.prototype.onDepthUpdate=function(t){this._server.receiveLocalResponse({method:"dpu",params:t})},a.prototype.onProjectionUpdate=function(t,e,i,o){var n,r=i.data,s=r[r.length-1],a={data:{reversalAmount:i.reversalAmount,boxSize:i.boxSize,price:s?s[4]:i.price,bars:r.map(function(t,e){return{time:e,open:t[1],high:t[2],low:t[3],close:t[4],volume:t[5],factor:t[6],additionalPrice:t[6]}})}},l={};l[t]={s:o||[],ns:{d:JSON.stringify(a),indexes:r.map(function(t,e){return i.barsetSize+(t[0]||0)})},turnaround:e},n={method:"data_update",params:[this._session,l]},this._server.receiveLocalResponse(n)},a.prototype.timeInTimezone=function(t,i){return"exchange"===this._userTimezone()?parseInt(e.utc_to_cal(i,1e3*t).valueOf()/1e3):parseInt(e.utc_to_cal(this._userTimezone(),1e3*t).valueOf()/1e3)},a.prototype._spanByTime=function(t,e){function i(t){return 60*t*60*1e3}function o(t){return 60*t*1e3}function n(t){return 1e3*t}var r,s,a,l=[{divisor:1,span:20},{divisor:n(1),span:19},{divisor:o(5),span:21},{divisor:o(30),span:22},{divisor:i(1),span:30},{divisor:i(3),span:31},{divisor:i(6),span:32},{divisor:i(12),span:33}];if(!e)return 20;if(r=new Date(1e3*e),s=new Date(1e3*t),s.getYear()!==r.getYear())return 70;if(s.getUTCMonth()!==r.getUTCMonth())return 60;if(s.getUTCDate()!==r.getUTCDate())return 50;for(a=l.length-1;a>=0;--a)if(Math.floor(r/l[a].divisor)!==Math.floor(s/l[a].divisor))return l[a].span},TradingView.ChartapiMessagerInstances=[],t.exports=a}).call(e,i(50))
},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.supportedLineTools={cursor:{name:"cursor",onlySelectable:!0},dot:{name:"dot",onlySelectable:!0},arrow_cursor:{name:"arrow",onlySelectable:!0},eraser:{name:"eraser",onlySelectable:!0},measure:{name:"measure",onlySelectable:!0},zoom:{name:"zoom",onlySelectable:!0},brush:{name:"LineToolBrush",onlySelectable:!0},text:{name:"LineToolText",supportsText:!0},anchored_text:{name:"LineToolTextAbsolute",supportsText:!0},note:{name:"LineToolNote",supportsText:!0},anchored_note:{name:"LineToolNoteAbsolute",supportsText:!0},callout:{name:"LineToolCallout",supportsText:!0},balloon:{name:"LineToolBalloon",supportsText:!0},arrow_up:{name:"LineToolArrowMarkUp",supportsText:!0},arrow_down:{name:"LineToolArrowMarkDown",supportsText:!0},arrow_left:{name:"LineToolArrowMarkLeft",supportsText:!0},arrow_right:{name:"LineToolArrowMarkRight",supportsText:!0},price_label:{name:"LineToolPriceLabel"},flag:{name:"LineToolFlagMark"},vertical_line:{name:"LineToolVertLine"},horizontal_line:{name:"LineToolHorzLine"},horizontal_ray:{name:"LineToolHorzRay"},trend_line:{name:"LineToolTrendLine"},trend_angle:{name:"LineToolTrendAngle"},arrow:{name:"LineToolArrow"},ray:{name:"LineToolRay"},extended:{name:"LineToolExtended"},parallel_channel:{name:"LineToolParallelChannel"},disjoint_angle:{name:"LineToolDisjointAngle"},flat_bottom:{name:"LineToolFlatBottom"},pitchfork:{name:"LineToolPitchfork"},schiff_pitchfork_modified:{name:"LineToolSchiffPitchfork"},schiff_pitchfork:{name:"LineToolSchiffPitchfork2"},inside_pitchfork:{name:"LineToolInsidePitchfork"},pitchfan:{name:"LineToolPitchfan"},gannbox:{name:"LineToolGannSquare"},gannbox_square:{name:"LineToolGannComplex"},gannbox_fixed:{name:"LineToolGannFixed"},gannbox_fan:{name:"LineToolGannFan"},fib_retracement:{name:"LineToolFibRetracement"},fib_trend_ext:{name:"LineToolTrendBasedFibExtension"},fib_speed_resist_fan:{name:"LineToolFibSpeedResistanceFan"},fib_timezone:{name:"LineToolFibTimeZone"},fib_trend_time:{name:"LineToolTrendBasedFibTime"},fib_circles:{name:"LineToolFibCircles"},fib_spiral:{name:"LineToolFibSpiral"},fib_speed_resist_arcs:{name:"LineToolFibSpeedResistanceArcs"},fib_wedge:{name:"LineToolFibWedge"},fib_channel:{name:"LineToolFibChannel"},xabcd_pattern:{name:"LineTool5PointsPattern"},cypher_pattern:{name:"LineToolCypherPattern"},abcd_pattern:{name:"LineToolABCD"},triangle_pattern:{name:"LineToolTrianglePattern"},"3divers_pattern":{name:"LineToolThreeDrivers"},head_and_shoulders:{name:"LineToolHeadAndShoulders"},elliott_impulse_wave:{name:"LineToolElliottImpulse"},elliott_triangle_wave:{name:"LineToolElliottTriangle"},elliott_triple_combo:{name:"LineToolElliottTripleCombo"},elliott_correction:{name:"LineToolElliottCorrection"},elliott_double_combo:{name:"LineToolElliottDoubleCombo"},cyclic_lines:{name:"LineToolCircleLines"},time_cycles:{name:"LineToolTimeCycles"},sine_line:{name:"LineToolSineLine"},long_position:{name:"LineToolRiskRewardLong"},short_position:{name:"LineToolRiskRewardShort"},forecast:{
name:"LineToolPrediction"},date_range:{name:"LineToolDateRange"},price_range:{name:"LineToolPriceRange"},date_and_price_range:{name:"LineToolDateAndPriceRange"},bars_pattern:{name:"LineToolBarsPattern"},ghost_feed:{name:"LineToolGhostFeed"},projection:{name:"LineToolProjection"},rectangle:{name:"LineToolRectangle"},rotated_rectangle:{name:"LineToolRotatedRectangle"},ellipse:{name:"LineToolEllipse"},triangle:{name:"LineToolTriangle"},polyline:{name:"LineToolPolyline"},curve:{name:"LineToolBezierQuadro"},double_curve:{name:"LineToolBezierCubic"},arc:{name:"LineToolArc"},icon:{name:"LineToolIcon"}}},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(48),n=function(){function t(){}return t.prototype.init=function(t,e){t.new_sym(e(1),o.Std.period(t),o.Std.period(t)),this._source=e(0),this._scaleFactor1=1,this._scaleFactor2=1},t.prototype.main=function(t,e){var i,n,r,s,a,l,c=t.symbol.time,h=o.Std[this._source](t);return t.select_sym(1),i=o.Std[this._source](t),n=t.new_var(i),r=t.new_var(t.symbol.time),isNaN(t.symbol.time)&&(n.indexOf(0),r.indexOf(0)),t.select_sym(0),isNaN(c)?null:(s=r.indexOf(c),-1!==s&&r.get(s)!==c&&(s=-1),a=s<0?NaN:n.get(s),l=this._doCalculation(this._scaleFactor1,h,this._scaleFactor2,a),[l])},t}(),e.SpreadRatioBase=n,e.spreadRatioDefaults={styles:{plot1:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:2,inputs:{source:"close",symbol2:""}},e.spreadRatioInputs=[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol2",name:"Symbol",type:"symbol",confirm:!0}],e.spreadRatioPlots=[{id:"plot1",type:"line"}],e.spreadRatioStyles={plot1:{title:"Plot",histogramBase:0}}},function(t,e,i){"use strict";function o(t){var e,i=t.dropped,o=t.className;return n.createElement(s.Icon,{className:r(o,a.icon,(e={},e[a.dropped]=i,e)),icon:l})}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(14),s=i(59),a=i(1024),l=i(297),e.ToolWidgetCaret=o},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(14),s=i(103),a=i(1027),l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(){var t=e.props,i=t.onClick,o=t.onClickArg;i&&i(o)},e}return o.__extends(e,t),e.prototype.render=function(){var t,e=this.props,i=e.isFirst,o=e.isLast,l=e.hint,c=e.text,h=e.icon,u=e.isActive,d=e.isDisabled,p=e.className;return n.createElement(s.ToolWidgetButton,{icon:h,text:c,title:l,isDisabled:d,isActive:u,onClick:this._handleClick,className:r(p,a.button,(t={},t[a.first]=i,t[a.last]=o,t))})},e}(n.PureComponent),e.ToolWidgetQuickButton=l},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(14),s=i(1043),a=i(1044),l={remove:window.t("Remove")},c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){var i=e.props,o=i.onClick,n=i.onClickArg;o&&o(n,t)},e}
return o.__extends(e,t),e.prototype.render=function(){return n.createElement("span",{className:r(s.button,"apply-common-tooltip",this.props.hidden&&s.hidden),dangerouslySetInnerHTML:{__html:a},onClick:this._handleClick,title:l.remove})},e}(n.PureComponent),e.RemoveButton=c},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(8),r=i(64),s=i(11),a=i(131),l=function(){function t(t,e){this._invalidated=!0,this._middlePoint=null,this._points=[],this._floatPoints=[],this._source=t,this._model=e}return t.prototype.priceToCoordinate=function(t){var e,i,o,n=this._source.priceScale();return null===n?null:null===(e=n.priceRange())?null:(n.isPercent()&&null!==(i=this._source.ownerSource())&&null!==(o=i.firstValue())&&void 0!==o&&(t=e.convertToPercent(t,o)),n.priceToCoordinate(t))},t.prototype.currentPoint=function(){var t=this._model.crossHairSource();return new n.Point(t.x,t.y)},t.prototype.anchorColor=function(){return this._source.isBeingEdited()?"#D61AD3":this._model.isDark()?"#FFFFFF":"#606060"},t.prototype.isHoveredSource=function(){return this._source===this._model.hoveredSource()},t.prototype.isSelectedSource=function(){return this._source===this._model.selectedSource()},t.prototype.isAnchorsRequired=function(){return(this.isHoveredSource()||this.isSelectedSource())&&!this._model.isSnapshot()},t.prototype.update=function(){this._invalidated=!0},t.prototype.addAnchors=function(t){if(this.isAnchorsRequired()){var e=this._points;this._model.lineBeingCreated()===this._source&&(e=e.slice(0,-1)),t.append(this.createLineAnchor({points:e}))}},t.prototype.createLineAnchor=function(t){var e=r.CheckMobile.any();return new a.LineAnchor(o.__assign({},t,{color:this.anchorColor(),backgroundColor:this._model.backgroundColor(),currentPoint:this.currentPoint(),linePointBeingEdited:this._model.linePointBeingEdited(),hittestResult:s.CHANGEPOINT,radius:(e?15:7)+(this.isSelectedSource()?1:0),strokeWidth:(e?3:1)+(this.isSelectedSource()?1:0)}))},t.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a;if(this._points=[],this._floatPoints=[],t=this._source.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&!e.isEmpty()){for(i=this._source.points(),o=0;o<i.length;o++){if(n=i[o],!(r=this._source.pointToScreenPoint(n)))return;s=r[0],s.data=o,a=r[1],a.data=o,this._floatPoints.push(s),this._points.push(a)}2===this._points.length&&(this._middlePoint=this._source.calcMiddlePoint(this._points[0],this._points[1]))}},t.prototype._getSource=function(){return this._source},t.prototype._getPoints=function(){return this._points},t.prototype._getModel=function(){return this._model},t}(),e.LineSourcePaneView=l},function(t,e,i){"use strict";function o(t){var e=s.parseRgb(t),i=e.map(function(t){return t>50?t-50:0});return s.rgbToString(i)}function n(t){var e,i,o,n=[];for(e=0,i=t;e<i.length;e++)o=i[e],null!==s.tryParseRgb(o)&&n.push(o);return n}function r(t,e){void 0===e&&(e={});var i=$('<span class="tvcolorpicker-container">');return null!==t&&i.appendTo(t),void 0!==e.addClass&&i.addClass(e.addClass),
$('<div class="tvcolorpicker-transparency">').appendTo(i),$('<input class="colorpicker-widget">').tvcolorpicker({customColors:n(a.getJSON("pickerCustomColors",[])),direction:e.direction,hideTransparency:!!e.hideTransparency}).on("change",function(){$(this).css("border-color",o($(this).val()||l))}).bind("customcolorchange",function(t,e){a.setJSON("pickerCustomColors",e)}).appendTo(i),i}var s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(13),i(284),s=i(32),a=i(24),l="#727272",e.addColorPicker=r},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(11),n=i(44),r=i(60),s=i(8),a=i(30),l=i(9),c=i(90),h=function(){function t(t,e,i){this._data=null,this._hitTestResult=t||new o(o.MOVEPOINT),this._backHitTestResult=e||new o(o.MOVEPOINT_BACKGROUND),this._forceOverrideTransparency=!!i}return t.prototype.setData=function(t){this._data=t},t.prototype.draw=function(t){var e,i,o,n;null===this._data||this._data.points.length<2||(t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&c.setLineStyle(t,this._data.linestyle),e=this._data.points,i=e[0],o=e[1],n=o.subtract(i),t.beginPath(),t.rect(i.x,i.y,n.x,n.y),this._data.linewidth>0&&t.stroke(),this._data.fillBackground&&(t.fillStyle=this.getColor(),t.fill()))},t.prototype.hitTest=function(t){var e,i,o,a,l,c,h,u,d,p;return null===this._data||this._data.points.length<2||this._data.nohittest?null:(e=this._data.points,i=e[0],o=e[1],a=new s.Point(o.x,i.y),l=new s.Point(i.x,o.y),c=n.distanceToSegment(i,a,t),c.distance<=3?this._hitTestResult:(c=n.distanceToSegment(a,o,t),c.distance<=3?this._hitTestResult:(c=n.distanceToSegment(o,l,t),c.distance<=3?this._hitTestResult:(c=n.distanceToSegment(l,i,t),c.distance<=3?this._hitTestResult:this._data.fillBackground&&(h=Math.min(i.x,o.x),u=Math.max(i.x,o.x),d=Math.min(i.y,o.y),p=Math.max(i.y,o.y),i=new s.Point(h,d),o=new s.Point(u,p),r.pointInRectangle(t,i,o))?this._backHitTestResult:null))))},t.prototype.getColor=function(){var t=l.ensure(this._data);return a.generateColor(t.backcolor,t.transparency,this._forceOverrideTransparency)},t}(),e.RectangleRenderer=h},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(39),s=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleOutsideEvent=function(t){e.props.handler&&!r.findDOMNode(e).contains(t.target)&&e.props.handler(t)},e}return o.__extends(e,t),e.prototype.componentDidMount=function(){this.props.click&&document.addEventListener("click",this._handleOutsideEvent,!1),this.props.mouseDown&&document.addEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.addEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.addEventListener("touchstart",this._handleOutsideEvent,!1)},e.prototype.componentWillUnmount=function(){this.props.click&&document.removeEventListener("click",this._handleOutsideEvent,!1),
this.props.mouseDown&&document.removeEventListener("mousedown",this._handleOutsideEvent,!1),this.props.touchEnd&&document.removeEventListener("touchend",this._handleOutsideEvent,!1),this.props.touchStart&&document.removeEventListener("touchstart",this._handleOutsideEvent,!1)},e.prototype.render=function(){var t=this.props,e=(t.click,t.handler,t.mouseDown,t.touchEnd,t.touchStart,t.ctor),i=void 0===e?"span":e,r=o.__rest(t,["click","handler","mouseDown","touchEnd","touchStart","ctor"]);return n.createElement(i,o.__assign({},r))},e}(n.Component),e.OutsideEvent=s},function(t,e,i){"use strict";function o(t,e,i){this._cache=t,this._cacheRect=e,this._targetRect=i}var n=i(8).Point,r=i(60).pointInRectangle,s=i(11);o.prototype.draw=function(t){t.translate(.5,.5),t.drawImage(this._cache,this._cacheRect.left,this._cacheRect.top,this._cacheRect.width,this._cacheRect.height,this._targetRect.left,this._targetRect.top,this._targetRect.width,this._targetRect.height),t.translate(-.5,-.5)},o.prototype.hitTest=function(t){var e=new n(this._targetRect.left,this._targetRect.top),i=e.add(new n(this._targetRect.width,this._targetRect.height));return r(t,e,i)?new s(s.REGULAR):null},t.exports=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(11),n=i(90),r=function(){function t(){this._data=null,this._hitTest=null}return t.prototype.setData=function(t){this._data=t},t.prototype.setHitTest=function(t){this._hitTest=t},t.prototype.draw=function(t){if(null!==this._data&&0!==this._data.points.length&&!(this._data.linewidth<=0)){var e=this._data.points[0].x;e<0||e>this._data.width||(t.translate(1,0),t.lineCap="square",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,void 0!==this._data.linestyle&&n.setLineStyle(t,this._data.linestyle),n.drawLine(t,e,0,e,this._data.height))}},t.prototype.hitTest=function(t){if(null===this._data||0===this._data.points.length)return null;var e=this._hitTest||new o(o.MOVEPOINT);return Math.abs(t.x-this._data.points[0].x)<=3?e:null},t}(),e.VerticalLineRenderer=r},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(28),r=function(t){function e(e,i,o,n){var r=this;return i||(i=1),"forex"!==o&&"cfd"!==o||!n?(r=t.call(this,1)||this,r._isForex=!1):(r=t.call(this,n)||this,r._isForex=!0),r._pipPriceScale=e,r._pipMinMove=i,r._pipMinMove2=n,r}return o.__extends(e,t),e.prototype.format=function(e,i,o){var n=this._isForex?this._pipMinMove2:this._pipMinMove;return void 0===n&&(n=NaN),t.prototype.format.call(this,e*this._pipPriceScale/n,i,o)},e}(n.PriceFormatter),e.PipFormatter=r},,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),i(12);var o=function(){function t(){}return t.prototype.format=function(t){var e,i,o,n,r=t<0;return t=Math.abs(t),e=Math.floor(t/86400),t-=86400*e,i=Math.floor(t/3600),t-=3600*i,o=Math.floor(t/60),t-=60*o,n="",e&&(n+=e+$.t("d",{context:"dates"})+" "),i&&(n+=i+$.t("h",{context:"dates"})+" "),o&&(n+=o+$.t("m",{context:"dates"})+" "),t&&(n+=t+$.t("s",{context:"dates"})+" "),
r&&(n="-"+n),n.trim()},t}();e.TimeSpanFormatter=o},function(t,e,i){"use strict";function o(t){this._data=null,this._hittest=t||new a(a.MOVEPOINT),this._backHittest=new a(a.MOVEPOINT_BACKGROUND),this._points=[]}var n=i(60).pointInPolygon,r=i(44).distanceToSegment,s=i(110).TrendLineRenderer,a=i(11),l=i(30),c=i(74).LineEnd;o.prototype.setData=function(t){this._data=t,this._points=t.points},o.prototype.draw=function(t){var e,i,o;if(null!==this._data&&0!==this._points.length){for(t.beginPath(),t.lineCap="butt",t.strokeStyle=this._data.color,t.lineWidth=this._data.linewidth,t.lineStyle=this._data.linestyle,e=this._points[0],t.moveTo(e.x,e.y),i=0;i<this._points.length;i++)o=this._points[i],t.lineTo(o.x,o.y);this._data.filled&&this._data.fillBackground&&(t.fillStyle=l.generateColor(this._data.backcolor,this._data.transparency),t.fill()),this._data.filled&&!this._data.skipClosePath&&t.closePath(),this._data.linewidth>0&&t.stroke(),this._points.length>1&&(this._data.leftend===c.Arrow&&s.prototype.drawArrow(this._points[1],this._points[0],t,t.lineWidth),this._data.rightend===c.Arrow&&s.prototype.drawArrow(this._points[this._points.length-2],this._points[this._points.length-1],t,t.lineWidth))}},o.prototype.hitTest=function(t){var e,i,o,s,a;if(null===this._data||void 0!==this._data.mouseTouchable&&!this._data.mouseTouchable)return null;for(e=TradingView.isMobile.any()?24:3,i=1;i<this._points.length;i++)if(o=this._points[i-1],s=this._points[i],a=r(o,s,t),a.distance<=e)return this._hittest;return this._data.filled&&this._data.fillBackground&&this._points.length>0&&(o=this._points[0],s=this._points[this._points.length-1],a=r(o,s,t),a.distance<=e)?this._hittest:this._data.filled&&this._data.fillBackground&&n(t,this._data.points)?this._backHittest:null},t.exports=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleKeyDown=function(t){t.keyCode===e.props.keyCode&&e.props.handler(t)},e}return o.__extends(e,t),e.prototype.componentDidMount=function(){document.addEventListener("keydown",this._handleKeyDown,!1)},e.prototype.componentWillUnmount=function(){document.removeEventListener("keydown",this._handleKeyDown,!1)},e.prototype.render=function(){return null},e}(n.PureComponent),e.KeyboardDocumentListener=r},function(t,e,i){"use strict";function o(){return[[1,0,0],[0,1,0],[0,0,1]]}function n(t,e){var i,o,n,r=[[0,0,0],[0,0,0],[0,0,0]];for(i=0;i<3;i++)for(o=0;o<3;o++)for(n=0;n<3;n++)r[i][o]+=t[i][n]*e[n][o];return r}function r(t){var e=Math.cos(t),i=Math.sin(t);return[[e,-i,0],[i,e,0],[0,0,1]]}function s(t,e){return[[t,0,0],[0,e,0],[0,0,1]]}function a(t,e){return[[1,0,t],[0,1,e],[0,0,1]]}function l(t,e){var i,o,n=[e.x,e.y,1],r=[0,0,0];for(i=0;i<3;i++)for(o=0;o<3;o++)r[i]+=n[o]*t[i][o];return new c.Point(r[0],r[1])}Object.defineProperty(e,"__esModule",{value:!0});var c=i(8);e.identityMatrix=o,e.multiplyMatrices=n,e.rotationMatrix=r,e.scalingMatrix=s,e.translationMatrix=a,e.transformPoint=l
},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 95.939 95.939" width="95.939" height="95.939"><path d="M62.82 47.97l32.53-32.534a2 2 0 0 0 0-2.828L83.332.586a2 2 0 0 0-2.827 0L47.97 33.12 15.435.587c-.75-.75-2.078-.75-2.828 0L.587 12.607a2 2 0 0 0 0 2.83L33.12 47.97.588 80.504a2 2 0 0 0 0 2.828l12.02 12.02a1.997 1.997 0 0 0 2.83 0L47.97 62.818l32.535 32.535a2 2 0 0 0 2.827 0l12.02-12.02c.78-.783.78-2.05 0-2.83L62.82 47.97z"/></svg>'},function(t,e,i){var o,n,r;!function(s){n=[i(13),i(242),i(391),i(75),i(168)],o=s,void 0!==(r="function"==typeof o?o.apply(e,n):o)&&(t.exports=r)}(function(t){return t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,o=this.options,n=this.element.find(".ui-slider-handle"),r=[];for(i=o.values&&o.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;e<i;e++)r.push("<span tabindex='0'></span>");this.handles=n.add(t(r.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==e.range&&"max"!==e.range||this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,o,n,r,s,a,l,c=this,h=this.options;return!h.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},o=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,
this.handles.each(function(e){var i=Math.abs(o-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===h.min))&&(n=i,r=t(this),s=e)}),!1!==this._start(e,s)&&(this._mouseSliding=!0,this._handleIndex=s,this._addClass(r,null,"ui-state-active"),r.trigger("focus"),a=r.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-a.left-r.width()/2,top:e.pageY-a.top-r.height()/2-(parseInt(r.css("borderTopWidth"),10)||0)-(parseInt(r.css("borderBottomWidth"),10)||0)+(parseInt(r.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,s,o),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,o,n,r;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),o=i/e,o>1&&(o=1),o<0&&(o=0),"vertical"===this.orientation&&(o=1-o),n=this._valueMax()-this._valueMin(),r=this._valueMin()+o*n,this._trimAlignValue(r)},_uiHash:function(t,e,i){var o={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(o.value=void 0!==e?e:this.values(t),o.values=i||this.values()),o},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var o,n=this.value(),r=this.values();this._hasMultipleValues()&&(o=this.values(e?0:1),n=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(o,i):Math.max(o,i)),r[e]=i),i!==n&&!1!==this._trigger("slide",t,this._uiHash(e,i,r))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var o,n,r;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(o=this.options.values,n=arguments[0],r=0;r<o.length;r+=1)o[r]=this._trimAlignValue(n[r]),this._change(null,r);this._refreshValue()},
_setOption:function(e,i){var o,n=0;switch("range"===e&&!0===this.options.range&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),o=n-1;o>=0;o--)this._change(null,o);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,o;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),o=0;o<i.length;o+=1)i[o]=this._trimAlignValue(i[o]);return i}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,o=t-i;return 2*Math.abs(i)>=e&&(o+=i>0?e:-e),parseFloat(o.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;t=Math.round((t-e)/i)*i+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,o,n,r,s=this.options.range,a=this.options,l=this,c=!this._animateOff&&a.animate,h={};this._hasMultipleValues()?this.handles.each(function(o){i=(l.values(o)-l._valueMin())/(l._valueMax()-l._valueMin())*100,h["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[c?"animate":"css"](h,a.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===o&&l.range.stop(1,1)[c?"animate":"css"]({left:i+"%"},a.animate),1===o&&l.range[c?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===o&&l.range.stop(1,1)[c?"animate":"css"]({bottom:i+"%"},a.animate),1===o&&l.range[c?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(o=this.value(),
n=this._valueMin(),r=this._valueMax(),i=r!==n?(o-n)/(r-n)*100:0,h["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[c?"animate":"css"](h,a.animate),"min"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:i+"%"},a.animate),"max"===s&&"horizontal"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({width:100-i+"%"},a.animate),"min"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:i+"%"},a.animate),"max"===s&&"vertical"===this.orientation&&this.range.stop(1,1)[c?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(e){var i,o,n,r=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),!1===this._start(e,r)))return}switch(n=this.options.step,i=o=this._hasMultipleValues()?this.values(r):this.value(),e.keyCode){case t.ui.keyCode.HOME:o=this._valueMin();break;case t.ui.keyCode.END:o=this._valueMax();break;case t.ui.keyCode.PAGE_UP:o=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:o=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax())return;o=this._trimAlignValue(i+n);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin())return;o=this._trimAlignValue(i-n)}this._slide(e,r,o)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}})})},function(t,e,i){"use strict";(function(e){function o(t,i,o){var n={saveAsText:$.t("Save As..."),applyDefaultText:$.t("Apply Defaults")};this._toolName=t,this._applyTemplate=i,this._options=$.extend(n,o||{}),this._list=[],e.enabled("charting_library_base")||(this.templatesDeferred=this.loadData())}var n=i(133).bindPopupMenu,r=i(154),s=r.SaveRenameDialog,a=r.InputField,l=i(112).createConfirmDialog,c=i(7).getLogger("Chart.LineToolTemplatesList");o._cache={},o.prototype.getData=function(){return this._list},o.prototype.loadData=function(){var t=this;return this._toolName in o._cache?(this._list=o._cache[this._toolName],$.Deferred().resolve()):$.get("/drawing-templates/"+this._toolName+"/",function(e){t._list=e,o._cache[t._toolName]=e}).error(function(){c.logWarn("Failed to load drawing template: "+t._toolName)})},o.prototype.templatesLoaded=function(){return this.templatesDeferred},o.prototype.invalidateToolCache=function(){delete o._cache[this._toolName]},o.prototype.createButton=function(t){var e,i=this;return t=$.extend({},t,i._options),
e=$("<a></span></a>").addClass(t.buttonClass?t.buttonClass:"_tv-button").html(t.buttonInner?t.buttonInner:$.t("Template")+'<span class="icon-dropdown">'),n(e,null,{event:"button-popup",zIndex:t.popupZIndex,activeClass:t.popupActiveClass,direction:t.popupDirection}),e.bind("click",function(e){var o,n,r;e.stopPropagation(),$(this).is("active")||(o=[],"function"==typeof t.getDataForSaveAs&&(n=function(e){var o=JSON.stringify(t.getDataForSaveAs());i.saveTemplate(e,o)},o.push({title:t.saveAsText,action:i.showSaveDialog.bind(i,n),addClass:"special"})),"function"==typeof t.defaultsCallback&&o.push({title:t.applyDefaultText,action:t.defaultsCallback,addClass:"special"}),r=[],$.each(i._list,function(e,o){r.push({title:o,action:function(){i.loadTemplate.call(i,o,t.loadTemplateCallback)},deleteAction:function(){runOrSignIn(function(){var t=$.t("Do you really want to delete Drawing Template '{0}' ?").format(o),e=l({type:"modal",content:t});e.on("action:yes",function(t){i.removeTemplate.call(i,o),t.close()}),e.open()},{source:"Delete line tool template"})}})}),r.length&&(r.sort(function(t,e){return t=t.title.toUpperCase(),e=e.title.toUpperCase(),t===e?0:t>e?1:-1}),o.push({separator:!0}),o=o.concat(r)),$(this).trigger("button-popup",[o]))}),e},o.prototype.loadTemplate=function(t,e){var i=this;return $.get("/drawing-template/"+this._toolName+"/?templateName="+encodeURIComponent(t),function(t){i._applyTemplate(JSON.parse(t.content)),e&&e()}).error(function(t){c.logWarn(t.responseText)})},o.prototype.removeTemplate=function(t){if(t){var e=this;$.post("/remove-drawing-template/",{name:t,tool:e._toolName}).error(function(t){c.logWarn(t.responseText)}),e.invalidateToolCache(),e._list=$.grep(e._list,function(e){return e!==t})}},o.prototype.saveTemplate=function(t,e){var i,o,n,r,s=this;t&&e&&(t=TradingView.clean(t),i=-1!==$.inArray(t,s._list),o=function(){var o={name:t,tool:s._toolName,content:e},n=function(){i||s._list.push(t)};$.post("/save-drawing-template/",o,n).error(function(t){c.logWarn(t.responseText)}),s.invalidateToolCache()},i?(n=$.t("Drawing Template '{0}' already exists. Do you really want to replace it?").format(t),r=l({type:"modal",content:n}),r.on("action:yes",function(t){o(),t.close()}),r.open()):o())},o.prototype.deleteAction=function(t){var e=t,i=this;runOrSignIn(function(){var t=$.t(" Do you really want to delete Drawing Template '{0}' ?").format(e),o=l({type:"modal",content:t});o.on("action:yes",function(t){i.removeTemplate.call(i,e),t.close()}),o.open()},{source:"Delete line tool template"})},o.prototype.showSaveDialog=function(t){var e="text",i=new s({fields:[new a({name:e,label:$.t("Template name")+":",maxLength:64,error:$.t("Please enter template name")})],title:$.t("Save Drawing Template As")});runOrSignIn(function(){i.show().then(function(i){t(i[e])})},{source:"Save line tool template",sourceMeta:"Chart"})},t.exports=o}).call(e,i(5))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t.offset=8,t.font="Arial",t.fontSize=12,t.lineSpacing=10,
t.bgColor="rgba(255,255,255,.8)",t.borderColor="#e3e3e3",t.padding=8}(e.LabelSettings||(e.LabelSettings={}))},,,function(t,e,i){"use strict";!function(t){t.fn.selectable=function(e){return this.each(function(){var i=t(this);i.css("user-select",e?"text":"none"),i.css("-moz-user-select",e?"text":"-moz-none"),i.css("-webkit-user-select",e?"auto":"none"),(t.browser.msie||t.browser.opera)&&i.attr("unselectable",e?"off":"on")})}}(jQuery)},,function(t,e,i){var o,n,r;!function(s){n=[i(13),i(75)],o=s,void 0!==(r="function"==typeof o?o.apply(e,n):o)&&(t.exports=r)}(function(t){return t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}})},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 16" width="10" height="16"><path d="M.6 1.4l1.4-1.4 8 8-8 8-1.4-1.4 6.389-6.532-6.389-6.668z"/></svg>'},function(t,e,i){"use strict";(function(t,o,n){function r(e){this._chartWidgetCollection=e,this._chartAboutToBeSavedDelegate=new t,this._chartSavedDelegate=new t,this._chartSizeLimitExceededDelegate=new t}function s(t,e,i,o){var r,s,a;o=o||{},r={wl:o.wl,images:JSON.stringify(t.images()),previews:o.previews,onWidget:o.onWidget},s=t.activeChartWidget.value().widgetCustomer(),s&&(r.customer=s),r.timezone=t.activeChartWidget.value()._properties.timezone.value(),window.urlParams&&window.urlParams.locale&&(r.language=urlParams.locale),a=n.enabled("charting_library_base")?o.snapshotUrl||"https://www.tradingview.com/snapshot/":"/snapshot/",$.post(a,r,function(t){t?e(t):i()}).fail(function(){i()})}var a=i(92);r.prototype.chartAboutToBeSaved=function(){return this._chartAboutToBeSavedDelegate},r.prototype.chartSaved=function(){return this._chartSavedDelegate},r.prototype.chartSizeLimitExceeded=function(){return this._chartSizeLimitExceededDelegate},r.prototype.whenReadyToSave=function(t){var e,i,o=this._chartWidgetCollection,n=o.activeChartWidget.value(),r=n.model().mainSeries();r.symbolInfo()&&!r.hasDelayedSymbolIntervalChange()?t():(e=null,i=null,e=function(){r.onSymbolError().unsubscribe(null,i,!0),t()},i=function(){r.onSymbolResolved().unsubscribe(null,e,!0)},r.onSymbolResolved().subscribe(null,e,!0),r.onSymbolError().subscribe(null,i,!0))},r.prototype.saveToJSON=function(){return this._fillSavingInfo(!1,!0)},r.prototype._fillAsyncInfo=function(t,e,i){function o(e){t.content=JSON.stringify($.extend(!0,r,e)),n.resolve(t)}var n,r=JSON.parse(t.content),s=this._chartWidgetCollection;return e||(i=!0),n=$.Deferred(),i?s.asyncState(!!e).then(o):s.activeChartWidget.value().asyncState(!!e).then(o),n.promise()},r.prototype._fillSavingInfo=function(t,e,i){var o,n,r,s,a,l,c,h,u,d,p,_;if(t||(e=!0),o={publish_request_id:Math.random().toString(36).substring(2)},n=this._chartWidgetCollection,r=n.activeChartWidget.value(),s=n.metaInfo,a=r.model().mainSeries(),l=a.properties(),c=a.symbolInfo(),s.id.value()&&(o.id=s.id.value()),o.name=s.name.value()||"",o.description=s.description.value()||"",
o.resolution=a.properties().interval.value(),o.symbol_type=null!==c&&c.type||"",o.exchange=null!==c&&c.exchange||"",o.listed_exchange=null!==c&&c.listed_exchange||"",null!==c&&a.isSpread()?(h=c.legs[0],u=c.base_name[0],u=u.split(":")[1],o.symbol=h,o.short_name=u,o.expression=c.full_name):(o.symbol=null!==c&&c.ticker||l.symbol.value(),o.short_name=l.shortName.value()),null!==c){for(d=[],p=0,_=c.legs.length;p<_;p++)d.push({symbol:c.legs[p],pro_symbol:c.base_name[p]});o.legs=JSON.stringify(d)}else o.legs=JSON.stringify([]);return o.content=e?JSON.stringify(n.state(!!t,i)):JSON.stringify(r.state(!!t,i)),t&&(o.image=JSON.stringify(n.images({onlyActiveChart:!e}))),o.is_realtime=t?"0":"1",o},r.prototype.publishChart=function(t){},r.prototype.publishScript=function(t,e,i){var o,n,r,s,a=this;a._scriptPublisher?a._scriptPublisher.openPublication(t,e):(o=i.ScriptPublisher,n=i.ScriptsProvider,r=i.CategoriesProvider,s=new n({publish:function(t){return new Promise(function(e,i){var o={closeForm:function(){if(t&&t.scriptPublication&&t.scriptPublication.updateScriptIdPart){var i=t.scriptPublication.updateScriptIdPart;publishedScripts.invalidateCache([i]),window.studyMarket&&(window.studyMarket.resetAllPages(),window.studyMarket.updateFavorites())}e()},showError:function(t){i(t)}};a.onPublish(t,o)})}}),a._scriptPublisher=new o({scriptsProvider:s,categoriesProvider:new r}),a._scriptPublisher.openPublication(t,e))},r.prototype.onPublish=function(t,e){function i(i){var n,r,s,l,c,h;a.publishInProgress=!1,n=i.responseText||i,"ok:"===n.substr(0,3)?(r=!1,e.savePrivacySetting&&(r=!t.is_public,TVSettings.setValue("publishchart.private",r)),kmRecord("Chart","{0} Published".format(void 0===t.script_type?"Chart":"Script"),{is_private:r}),s=n.substr(3),l=JSON.parse(s),a._chartWidgetCollection.metaInfo.id.value()||a._chartWidgetCollection.metaInfo.id.setValue(l.id),e.closeForm&&e.closeForm(),a._lastPublishUrl=l.publishUrl,a.hWnd&&(c=l.publishUrl,e.ideaUrl&&(c=o.render(e.ideaUrl,{idea:l.idea})),a.hWnd.location=c)):(e.showError&&((413===i.status||/^[\d\s]*request.+large/i.test(n.trim()))&&(n=window.t("This chart layout has a lot of objects and can't be published! Please remove some drawings and/or studies from this chart layout and try to publish it again.")),h={html:!0},e.showError(n||$.t("Error occured while publishing"),h)),a.hWnd&&(a.hWnd.close(),a.hWnd=null))}var n,r,s,a=this;a.publishInProgress||(n=a._fillSavingInfo(!0,e&&e.publishAllLayout,!0),a._fillAsyncInfo(n,!0,e&&e.publishAllLayout).then(function(e){var o=t.scriptPublication,n=!(!o||!o.updateScriptIdPart),r=new Promise(function(t,e){if(o){var i;i=n?ScriptLib.publishNext(o.scriptSource,o.updateScriptIdPart):ScriptLib.publishNew(o.scriptSource,o.scriptProtection),i.done(function(e){n||o.scriptProtection!==TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH||PinePerm.add(window.user.username,e.pineId),t(e.publishedstudyscript_id)}).fail(e)}else t()});n?r.then(function(o){var n={publishedstudyscript_id:o,description:t.description,tags:t.tags};$.ajax({url:"/script-update/",type:"post",dataType:"text",
data:$.extend({},e,n),complete:i})},i):r.then(function(o){o&&(t.publishedstudyscript_id=o),$.ajax({url:"/publishchart/",type:"post",dataType:"text",data:$.extend({},e,t),complete:i})},i)}),a.publishInProgress=!0,e.onWidget&&!e.ideaUrl||""!==t.name&&""!==t.description&&t.description.length<=4e3&&t.name.length<=64&&($.cookie("publish_request_id",n.publish_request_id,{path:"/"}),r="/loading/",e.ideaUrl&&(s=urlParams.createUrlParams({ideaUrl:e.ideaUrl}),r="/loading?"+s),a.hWnd=window.open(r,"_blank")))},r.prototype._saveChart=function(t,e,i,o,n){var r=i,s=o;return r=function(t){e.id.value()||(e.id.setValue(t),e.uid.setValue(t)),"function"==typeof i&&i()},a.saveChart(t.name,t.short_name,t.resolution,t,e,r,s.bind(this))},r.prototype.saveChartSilently=function(t,e,i,o){var n=this._chartWidgetCollection.metaInfo,r=this._fillSavingInfo(e);if(o=o||{},o.chartName&&(r.name=o.chartName),r.name&&0!==r.name.length||!o.defaultChartName||(r.name=o.defaultChartName),!r.name)return void console.warn("Saving chart with empty name is not allowed");$(window).on("beforeunload.savechart",function(){return $.t("Your chart is being saved, please wait a moment before you leave this page.")}),this._chartAboutToBeSavedDelegate.fire(),this._saveChart(r,n,function(){this._chartWidgetCollection.metaInfo.name.setValue(r.name),this._chartSavedDelegate.fire(!0),t&&t(n)}.bind(this),function(){this._chartSavedDelegate.fire(!1),i&&i.apply(null,arguments)}.bind(this),o),$(window).off("beforeunload.savechart")},e.ChartSaver=r,e.takeSnapshot=s}).call(e,i(10),i(41),i(5))},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),e.DropdownView=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(750),s=i(203),a=i(31),l=o(a),c=i(173),h=i(123),u=o(h),d=e.DropdownView=function(){function t(e){var i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};n(this,t),this.$el=e,this.$wrap=o.$wrap||e.find(".tv-dropdown-behavior__button"),this.$body=o.$body||e.find(".tv-dropdown-behavior__body"),this.notCloseWithCtrl=!!o.notCloseWithCtrl&&o.notCloseWithCtrl,this.closeWithEsc=void 0===o.closeWithEsc||o.closeWithEsc,this.animationDisabled=!0===o.noAnimation,this.closeWithEsc&&this.$el.attr("tabIndex",0),this.animationDisabled||this.$body.addClass("tv-dropdown-behavior__body--animated"),(e.data("scroll")||o.scroll)&&(this.$scroll=this.$body.find(".tv-dropdown-behavior__scroll"),this.$inScroll=this.$scroll.find(".tv-dropdown-behavior__inscroll"),this.scroll=new c.SidebarCustomScroll(this.$scroll,this.$inScroll,{showTopShadow:!1,showBottomShadow:!1}),
this.$scrollBar=this.scroll.getScrollBar(),this.$scrollBar&&this.$scrollBar.on("mousedown.tv-dropdown-view-scroll",function(){i.offClickOutside(),$(document).on("mouseup.tv-dropdown-view-scroll",function(){i.onClickOutside(),$(document).off("mouseup.tv-dropdown-view-scroll")})})),(e.data("adaptBody")||o.adaptBody)&&(this._adaptBody=!0),this._fitScreen=e.data("fitScreen")||o.fitScreen,this.$wrap.add(e.find(".js-dropdown-toggle")).on("click",function(t){$(t.currentTarget).hasClass("js-prevent-dropdown")||i.toggle()})}return r(t,[{key:"toggle",value:function(){this.opened?this.close(!0):this.open()}},{key:"open",value:function(){var t=this;this.animating||this.opened||this.disabled||(this.$el.trigger("beforeOpenMenu"),this.$body.removeClass("i-hidden"),this.$wrap.addClass("i-dropped"),this.$el.addClass("i-opened"),"horz"===this._fitScreen&&this.fitHorizontally(),this._adaptBody&&this.adaptBody(),this.updateDelays(),this.onClickOutside(),this._doOpenAnimation().then(function(){t.$body.addClass("i-opened"),t.$el.trigger("updateScroll"),t.$el.trigger("afterOpenMenu"),t.opened=!0}),this.closeWithEsc&&this.$el.on("keypress keyup",function(e){e.keyCode===u.ESC&&t.close(!0)}))}},{key:"onClickOutside",value:function(){var t=this;setTimeout(function(){t.$body.on("clickoutside",function(){t.close(!0)})},0)}},{key:"offClickOutside",value:function(){this.$body.off("clickoutside")}},{key:"close",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.animating||!this.opened||this.disabled||!e&&this.notCloseWithCtrl&&(window.event.ctrlKey||window.event.metaKey)||(this.offClickOutside(),this.$wrap.removeClass("i-dropped"),this.$el.trigger("beforeCloseMenu"),this._doCloseAnimation().then(function(){t.$body.removeClass("i-opened").addClass("i-hidden"),t.$el.removeClass("i-opened").trigger("afterCloseMenu"),t.opened=!1}),this.closeWithEsc&&this.$el.off("keypress keyup"))}},{key:"isOpened",value:function(){return this.opened}},{key:"updateScroll",value:function(){this.scroll&&(this.scroll.updateScrollBar(),this.scroll.scrollToStart())}},{key:"updateDelays",value:function(){var t,e,i,o,n;this.animationDisabled||(t=this.$scroll||this.$body,e=t.offset().top,i=t.outerHeight(),o=this.$body.find(".tv-dropdown-behavior__item").filter(function(t,o){var n=$(o),r=n.offset().top;return r+n.outerHeight()>=e&&r<e+i}),n=this.$el.data("item-coeff")?parseFloat(this.$el.data("item-coeff")):1,o.each(function(t,e){var i=l.easingFunc.easeInQuad(t/o.length)*(.045*l.dur*n*o.length)+.375*l.dur+"ms";$(e).css({"transition-delay":i,"-o-transition-delay":i,"-ms-transition-delay":i,"-moz-transition-delay":i,"-webkit-transition-delay":i})}))}},{key:"enable",value:function(){this.$wrap.removeClass("i-disabled"),this.disabled=!1}},{key:"disable",value:function(){this.$wrap.addClass("i-disabled"),this.disabled=!0}},{key:"adaptBody",value:function(){function t(){a.height("auto")}function e(t){
var e="tv-dropdown-behavior__body--from_top",i="tv-dropdown-behavior__body--from_top-right",o="tv-dropdown-behavior__body--from_bottom",n="tv-dropdown-behavior__body--from_bottom-right",r=void 0,s=void 0;a.hasClass(e)&&"bottom"===t?(r=e,s=o):a.hasClass(i)&&"bottom"===t?(r=i,s=n):a.hasClass(o)&&"top"===t?(r=o,s=e):a.hasClass(n)&&"top"===t&&(r=n,s=i),r!==s&&a.removeClass(r).addClass(s)}var i,o,n,r,s=15,a=this.$body,l=this.$wrap.get(0).getBoundingClientRect(),c=window.innerHeight,h=this.$inScroll.outerHeight(!0),u=parseFloat(a.css("padding-top"));h+=u,i=parseFloat(a.css("padding-bottom")),h+=i,o=l.top+h+s<=c,n=h+s<=l.bottom,r=void 0,o?(r=0-u,t(),e("top")):n?(r=-h+i,t(),e("bottom")):(r=-l.top+s,c<=h&&a.height(c-2*s)),a.css("top",r)}},{key:"_doOpenAnimation",value:function(){var t=this;return new Promise(function(e){t.animationDisabled?e():(t.animating=!0,setTimeout(function(){t.animating=!1,e()},20))})}},{key:"_doCloseAnimation",value:function(){var t=this;return new Promise(function(e){t.animationDisabled?e():(t.animating=!0,t.$body.addClass("i-closing"),t.$el.addClass("i-closing"),setTimeout(function(){t.$body.removeClass("i-closing"),t.$el.removeClass("i-closing"),t.animating=!1,e()},l.dur))})}},{key:"fitHorizontally",value:function(){var t,e,i,o;this.$body.css("marginLeft",0),t=document.body.getBoundingClientRect(),e=parseFloat($(document.body).css("paddingRight")),i=this.$body.offset(),i.right=i.left+this.$body.outerWidth(),(o=Math.max(Math.min(0,t.right-e-i.right),t.left-i.left))&&this.$body.css("marginLeft",o)}},{key:"destroy",value:function(){this.scroll&&this.scroll.destroy(),this.offClickOutside(),this.$el.find(".js-dropdown-toggle").off("click"),this.$wrap.off("click")}}]),t}(),$.fn.tvDropdown=(0,s.createTvBlockWithInstance)("tv-dropdown",function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return new d(t,e)})},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n;Object.defineProperty(e,"__esModule",{value:!0}),n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.InputField=function(){function t(e){var i=e.label,n=e.name,r=e.maxLength,s=e.error,a=void 0===s?"":s;o(this,t),this._name=n,this._$field=$('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">'+i+'</span>\n\t\t\t\t<input class="tv-control-input" type="text" name="'+n+'" maxlength="'+r+'"/>\n\t\t\t</label>'),this._$input=this._$field.find("input"),this._error=a}return n(t,[{key:"appendTo",value:function(t){t.append(this._$field)}},{key:"focus",value:function(){return this._$input.focus()}},{key:"select",value:function(){return this.focus().select()}},{key:"value",set:function(t){this._$input.val(t)},get:function(){return this._$input.val()}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){
return!!this._$input.val().trim()}},{key:"error",set:function(t){this._error=t},get:function(){return this._error}}]),t}()},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.SaveRenameDialog=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(758),r=i(65),e.SaveRenameDialog=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.fields,n=e.title,r=void 0===n?"":n,s=e.destroyOnClose,a=void 0===s||s,l=e.modal,c=void 0!==l&&l;o(this,t),this._$form=$("<div></div>"),this._fields=i,this._appendFieldsToForm(),this._title=r,this._destroyOnClose=a,this._modal=c}return n(t,[{key:"setField",value:function(t,e){this._fields.find(function(e){return e.name===t}).value=e}},{key:"show",value:function(){var t=this,e=this._createDialog(),i=new Promise(function(i){e.on("action:submit",function(e){return t._onSubmit(e,i)})});return e.open(),this._fields[0].select(),i}},{key:"_appendFieldsToForm",value:function(){var t=this;this._fields.forEach(function(e){e.appendTo(t._$form)})}},{key:"_createDialog",value:function(){return(0,r.createDialog)({type:this._modal?"modal":"popup",title:this._title,content:this._$form,actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions i-align_right tv-dialog__section--no-border">',width:470,destroyOnClose:this._destroyOnClose,actions:[{name:"submit",type:"primary",text:$.t("Save"),key:13,addClass:"js-submit-button"},{name:"cancel",type:"default",text:$.t("Cancel"),method:"close",addClass:"js-cancel-button"}]})}},{key:"_onSubmit",value:function(t,e){var i=this._validate();i?(t.error(i.error),i.focus()):(e(this._collectValues(),t),t.close())}},{key:"_validate",value:function(){return this._fields.find(function(t){return!t.valid})}},{key:"_collectValues",value:function(){return this._fields.reduce(function(t,e){return t[e.name]=e.value,t},{})}}]),t}()},function(t,e,i){"use strict";(function(e,o,n){function r(){this.title=$.t("Load Chart Layout"),this._removeDialogShown=!1,this.options={},this.matchedItems=[],this.itemsData=[],this.qs=new r.QuickSearch(this.fieldsExtractor,this.searchResult.bind(this)),this.sortObj=new r.SortObject(this.modifiedCompare),this.nameSort=new r.SortObject(this.nameCompare),this.symbolSort=new r.SortObject(this.symbolCompare),this.toolsSort=new r.SortObject(this.toolsCompare),this.offset=0,h.on("chart_loaded",r.onChartLoaded,this)}function s(t){return t.getAttribute("data-id")}var a,l,c,h=i(23),u=i(65).createDialog,d=i(316).createSearchControl,p=i(200).regExpEscape
;a='<div class="js-table-row tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--item {{^withFavs}}tv-load-chart-dialog-table__row--item-without-favs{{/withFavs}} {{#isActive}}i-active{{/isActive}}" data-id="{{id}}">{{#withFavs}}<div class="tv-load-chart-dialog-table__favorite-icon-container {{#starred}}i-starred{{/starred}}" ><span data-id="{{id}}" class="js-empty-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--empty" title="'+$.t("Add to favorites")+'">'+i(210)+'</span><span data-id="{{id}}" class="js-filled-star tv-load-chart-dialog-table__star-icon tv-load-chart-dialog-table__star-icon--filled" title="'+$.t("Remove from favorites")+'">'+i(209)+'</span></div>{{/withFavs}}<div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-name">{{title}}</div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-modified">{{modifiedDate}}</div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--item tv-load-chart-dialog-table__column-symbol">{{chartSymbol}}</div><div data-id="{{id}}" class="js-remove-button tv-load-chart-dialog-table__column-name-action tv-load-chart-dialog-table__remove-icon" title="'+$.t("Delete chart layout")+'">'+i(169)+"</div></div>",l='<div class="tv-load-chart-dialog-table__row tv-load-chart-dialog-table__row--header"><div class="js-column-name tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-name">'+$.t("Chart Layout Name")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-modified tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-modified">'+$.t("Last Modified")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div><div class="js-column-symbol tv-load-chart-dialog-table__column tv-load-chart-dialog-table__column--header tv-load-chart-dialog-table__column-symbol">'+$.t("Active Symbol")+'<span class="tv-caret tv-load-chart-dialog-table__caret"></span></div></div>',c=50,r.onChartLoaded=function(){this.itemsData&&this.itemsData.length>0&&this._refreshChartsList()},r.QuickSearch=function(t,e){this.fieldsExtractor=t,this.callback=e,this.regExps=[]},r.QuickSearch.prototype.onInput=function(t){this.query=t,this.createRegexps(t),this.search()},r.QuickSearch.prototype.createRegexps=function(t){this.regExps=[],t&&this.regExps.push(RegExp("("+t.split("").map(function(t){return p(t)}).join(")(.*?)(")+")","i"))},r.QuickSearch.prototype.match=function(t){var e,i,o,n;for(e=0;e<this.regExps.length;e++)for(i=this.regExps[e],i.lastIndex=0,o=this.fieldsExtractor(t),n=0;n<o.length;n++)if(i.test(o[n]))return!0;return 0===this.regExps.length},r.QuickSearch.prototype.search=function(){var t,e,i=[];for(t=0;t<this.items.length;t++)e=this.items[t],this.match(e)&&i.push(e)
;this.callback(i,this.regExps)},r.QuickSearch.prototype.setItems=function(t){this.items=t},r.SortObject=function(t,e){this.isAscending=!1,this.sortingFunc=t,this.getPredicate=function(){return function(t,e){var i=this.sortingFunc(t,e);return this.isAscending&&(i*=-1),i}.bind(this)},this.inverse=function(){this.isAscending=!this.isAscending},this.setIsAscending=function(t){return"boolean"==typeof t&&(this.isAscending=t),this.isAscending},this.reset=function(){this.isAscending=!1}},r.prototype.fieldsExtractor=function(t){var e=r.symbolWrap(t);return[t.title,e]},r.prototype.saveFavorite=function(t,e){e?this.favorites[t]=e:delete this.favorites[t]},r.prototype.filterFavorites=function(){var t={};this.itemsData.map(function(e){this.favorites.hasOwnProperty(e.id)&&(t[e.id]=!0)}.bind(this)),this.favorites=t},r.prototype.getFavorite=function(t){return this.favorites.hasOwnProperty(t)},r.prototype._onFavoriteClicked=function(t,e,i){this.saveFavorite(t.id,e),this.filterFavorites(),this.fillList(),t.favoriteAction(this.favorites),i.preventDefault()},r.prototype._onItemClicked=function(t,e){e.defaultPrevented||(e.preventDefault(),t.openAction())},r.prototype._onRemoveButtonClicked=function(t,e){var i=this,o=$.Deferred();this._removeDialogShown=!0,o.done(function(){i.removeItem(t)}).always(function(){setTimeout(function(){i._removeDialogShown=!1})}),t.deleteAction(o,t.title),e.preventDefault()},r.prototype._createListItem=function(t){return e.render(a,{id:t.id,isActive:t.active(),title:t.title,url:t.url,withFavs:o.enabled("items_favoriting"),starred:this.getFavorite(t.id),modifiedDate:n.unix(t.modified).format("L LT"),chartSymbol:""===t.symbol?"multiple charts":t.symbol+", "+t.interval})},r.prototype.removeItem=function(t){var e=this.itemsData.indexOf(t);e>-1&&this.itemsData.splice(e,1),this.setChartsData(this.itemsData)},r.prototype.modifiedCompare=function(t,e){var i=t.modified,o=e.modified;return n(o).diff(n(i))},r.prototype.nameCompare=function(t,e){return t.title.localeCompare(e.title)},r.symbolWrap=function(t){return""===t.symbol?"multiple charts":t.symbol+" "+t.interval},r.prototype.symbolCompare=function(t,e){return r.symbolWrap(t).localeCompare(r.symbolWrap(e))},r.prototype.toolsCompare=function(t,e){var i=t.toolsCount,o=e.toolsCount;return i<o?-1:i===o?0:1},r.prototype.sortClick=function(t){this.setSort($(t.target).data("sort"),!0),this.fillList()},r.prototype.setSort=function(t,e){var i,o,n={field:TVSettings.getValue("loadChartDialog.sort.field")||"modified",isAscending:TVSettings.getValue("loadChartDialog.sort.asc")||"0"},r=t||n.field,s=e?"0"===n.isAscending?"1":"0":n.isAscending;this.currentSortObj&&!(i=r!==n.field)||(this.currentSortObj="name"===r?this.nameSort:"symbol"===r?this.symbolSort:"tools"===r?this.toolsSort:this.sortObj,i&&TVSettings.setValue("loadChartDialog.sort.field",r)),this.currentSortObj.setIsAscending("1"===s),s!==n.isAscending&&TVSettings.setValue("loadChartDialog.sort.asc",s),o=this,$.each(this.header.children(".tv-load-chart-dialog-table__column--header"),function(){
var t=$(this),e=t.data("sort")===r;t.removeClass("i-active i-dropped"),e&&t.addClass("i-active "+(o.currentSortObj.isAscending?"":"i-dropped"))})},r.prototype.sortList=function(){var t,e=[],i=[];this.matchedItems.map(function(t){this.favorites.hasOwnProperty(t.id)?e.push(t):i.push(t)}.bind(this)),void 0!==this.currentSortObj&&(t=this.currentSortObj.getPredicate(),i.sort(t),e.sort(t)),this.matchedItems=e.concat(i)},r.prototype.showMoreData=function(){var t,e,i;if(!(this.offset>=this.matchedItems.length)){for(t=Math.min(this.offset+c,this.matchedItems.length),e="",i=this.offset;i<t;++i)e+=this._createListItem(this.matchedItems[i]);this.itemsList[0].insertAdjacentHTML("beforeend",e),this.offset+=c}},r.prototype.fillList=function(){this.sortList(),this.offset=0,this.itemsList[0].innerHTML="",this.showMoreData(),this.itemsListContainer.toggleClass("i-empty",0===this.itemsData.length),this.highlightOccurrences(this.qs.regExps),this._dialog&&(this.itemsListContainer[0].scrollTop=0)},r.prototype.searchResult=function(t,e){this.matchedItems=t,this.fillList()},r.prototype.updateChartsData=function(t){this.setChartsData(t)},r.prototype.updateFavoritesData=function(t){this.favorites=t,this.itemsList&&this.qs.search()},r.prototype.updateChartsAndFavoritesData=function(t,e){this.favorites=e,this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},r.prototype._refreshChartsList=function(){this.qs.setItems(this.itemsData),this.qs.search()},r.prototype.setChartsData=function(t){this.itemsList&&(this.itemsData=t,this.qs.setItems(t),this.qs.search())},r.prototype.layoutHeader=function(){var t=$(l);return t.find(".js-column-name").data("sort","name"),t.find(".js-column-modified").data("sort","modified"),t.find(".js-column-symbol").data("sort","symbol"),t.appendTo(this.content),t},r.prototype.resetSort=function(){this.sortObj.reset(),this.nameSort.reset(),this.symbolSort.reset(),this.toolsSort.reset(),this.currentSortObj=this.sortObj},r.prototype._findItemById=function(t){var e=+t;return this.itemsData.find(function(i){return i.id===e||i.id===t})},r.prototype.show=function(t,e){var i=this,n=d({placeholder:$.t("Search")}),r=$("<div>");r.append(n.$control),r.append('<div class="tv-load-chart-dialog-table">'),this.content=$("<div>").appendTo(r.find(".tv-load-chart-dialog-table")),this.header=this.layoutHeader(),this.setSort(),this.itemsListContainer=$('<div class="tv-load-chart-dialog-table__items-list-container">').data({localScroll:!0}).appendTo(this.content),this.itemsList=$('<div class="tv-load-chart-dialog-table__items-list">').appendTo(this.itemsListContainer),$('<div class="tv-load-chart-dialog-table__empty-list-placeholder">').text($.t("There are no saved charts")).appendTo(this.itemsListContainer),this.itemsListContainer.on("click",".js-remove-button",function(t){var e=i._findItemById(s(t.currentTarget));i._onRemoveButtonClicked(e,t),t.stopPropagation()}).on("click",".js-table-row",function(t){var e=i._findItemById(s(t.currentTarget));i._onItemClicked(e,t),t.preventDefault()}).on("scrolltoend",function(){
i.showMoreData()}),o.enabled("items_favoriting")&&this.itemsListContainer.on("click",".js-empty-star",function(t){var e=i._findItemById(s(t.currentTarget));i._onFavoriteClicked(e,!0,t),t.stopPropagation()}).on("click",".js-filled-star",function(t){var e=i._findItemById(s(t.currentTarget));i._onFavoriteClicked(e,!1,t),t.stopPropagation()}),this.header.children(".tv-load-chart-dialog-table__column--header").click($.proxy(this,"sortClick")),n.inputChangedDelegate.subscribe(this.qs,this.qs.onInput),this.favorites=e,this.setChartsData(t),this.qs.onInput(""),this._dialog&&this._dialog.close(),this._dialog=u({title:this.title,width:600,height:550,content:r,contentWrapTemplate:"<div>",destroyOnClose:!0,withScroll:!1,isClickOutFn:function(){return!this._removeDialogShown&&void 0}.bind(this)}),this._dialog.open()},r.prototype.highlightOccurrences=function(t){0!==t.length&&this.itemsList.children(".js-table-row").each(function(){var e,i=$(this).find(".js-column-name"),o=i.text();o=r.highlightText(o,t),i.html(o),e=$(this).find(".js-column-symbol"),o=e.text(),o=r.highlightText(o,t),e.html(o)})},r.highlightText=function(t,e){var i,o,n,r,s,a;if(t=$("<div>").text(t).html(),0===e.length)return t;for(i=0;i<e.length;i++){if(o=e[i],o.lastIndex=0,n="",r="",(s=o.exec(t))&&s.length)for(a=1;a<s.length;a++)n+=a%2?'<span class="i-match">$'+a+"</span>":"$"+a;if((r=t.replace(o,n))&&r!==t)return r}},t.exports=r}).call(e,i(41),i(5),i(38))},function(t,e,i){"use strict";function o(t,e,i,o){var s=(0,n.createConfirmDialog)({type:"modal",content:document.createTextNode($.t("Do you really want to delete Chart Layout '{0}' ?").format(t)),addClass:"delete-chart-dialog"}),a=function(){var t=o;o=null,t&&t()};s.on("action:yes",function(){o=null,r.removeChart(e,i),s.close()}),s.on("action:no",a),s.on("afterClose",a),s.open()}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.deleteChart=o,n=i(112),r=i(92)},function(t,e,i){"use strict";function o(t){l.call(this,t),this.ch=t.char[0]||" ",this.fontFamily=t.fontFamily||"Arial",this._charCache=new a(this.ch,!1,!1,this.fontFamily,this.height)}var n=i(8).Point,r=i(45).selectionTolerance,s=i(11),a=i(327),l=i(56).PaneRendererAbstractShape;inherit(o,l),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a=this._vertOffset>0?1:-1;for(e=0,i=this.items.length;e<i;e++)o=this.items[e],n=o.x,r=o.y+this._vertOffset-a*Math.round(this.height/2),s=o.style&&null!=o.style.color?o.style.color:this._color,this._charCache.paintTo(t,s,n,r,"center",this._vertOffset>0?"middle":"bottom")},o.prototype.hitTest=function(t){var e,i,o,a=this._vertOffset,l=r(this.height);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&(o=new n(i.x,i.y+a),o.subtract(t).length()<=l))return new s(s.REGULAR);return null},e.PaneRendererUnicodeChar=TradingView.PaneRendererUnicodeChar=o},,,,,,function(t,e,i){"use strict";function o(t,e,i){this._textSizeCache=e,this._data=t,this._fontSize=t.fontsize?t.fontsize:t.fontSize?t.fontSize:12,this._lineSpacing="number"==typeof this._data.lineSpacing&&this._data.lineSpacing?this._data.lineSpacing:0,
t.lines=this._lines=l.prototype.wordWrap.call(this,t.text,t.wordWrapWidth),this._hittest=i||new c(c.MOVEPOINT)}function n(){var t=document.createElement("canvas");t.width=0,t.height=0,r=t.getContext("2d"),t=null}var r,s=i(8).Point,a=i(60).pointInRectangle,l=i(166).TextRenderer,c=i(11),h={priceRange:{width:15,height:14,data:[134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]},barsRange:{width:16,height:15,
data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,136,136,136,56,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,136,136,136,56,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,137,137,137,74,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]},angle:{width:14,height:12,
data:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,130,130,134,76,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255,134,134,138,255]}};o.prototype._preRender=function(){var t,e,i,o,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x;if(!this._preRendered){if(r||n(),t=this._data.points[0].x+(this._data.offsetX||0),e=t,i=this._data.points[0].y+(this._data.offsetY||0),o=i,a=this._fontSize,l=this._lineSpacing,c=a+l,h=c*this._lines.length-l,r.textBaseline="top",r.font=this.fontStyle(),u=[],this._data.wordWrapWidth)for(d=this._data.wordWrapWidth,p=0;p<this._lines.length;p++)u.push(this._data.wordWrapWidth);else for(d=0,p=0;p<this._lines.length;p++)_=r.measureText(this._lines[p]).width,u.push(_),d=Math.max(d,_);if(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth){f={top:this._data.paddingTop||0,right:this._data.paddingRight||0,bottom:this._data.paddingBottom||0,left:this._data.paddingLeft||0},m={x:0,y:0},this._data.backgroundHorzInflate&&(g=this._data.backgroundHorzInflate/2,f.left+=g,f.right+=g,m.x=-g),this._data.backgroundVertInflate&&(v=this._data.backgroundVertInflate/2,f.top+=v,f.bottom+=v,m.y=-v),y="number"==typeof this._data.padding?this._data.padding:~~(a/6);for(p in f)f[p]||(f[p]=y);b={x:Math.floor(t+m.x),y:Math.floor(i+m.y),w:Math.ceil(d+f.left+f.right),h:Math.ceil(h+f.top+f.bottom)},e+=f.left+m.x,o+=f.top+m.y,"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(S="middle"===this._data.vertAlign?i-b.h/2:i-b.h-(b.y-i),w=S-b.y,o+=w,b.y=S),
"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(T="center"===this._data.horzAlign?t-b.w/2:t-b.w-(b.x-t),C=T-b.x,e+=C,b.x=T,!0!==this._data.doNotAlignText&&("right"===this._data.horzAlign?(r.textAlign="end",e+=d):(r.textAlign="center",e+=d/2))),b.w%2!=0&&b.w++,b.x+=.5,b.y+=.5,this._boundingRect=[new s(b.x,b.y),new s(b.x+b.w,b.y+b.h)],this._rect=b,this._padding=f,this._defaultPadding=y}else"bottom"!==this._data.vertAlign&&"middle"!==this._data.vertAlign||(o-=Math.round(h*("middle"===this._data.vertAlign?.5:1))),x=e,"right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||(x-=Math.round(d*("center"===this._data.horzAlign?.5:1))),this._boundingRect=[new s(x,o),new s(x+d,o+h)];this._textPoint={x:e,y:o},this._textSizeCache&&(this._textSizeCache.widths=u),this._preRendered=!0,this._maxWidth=d}},o.prototype._drawIcon=function(t,e,i,o){var n,r,s,a;if(h.hasOwnProperty(o)){if(n=h[o],!n.src){for(n.src=document.createElement("canvas"),n.src.width=n.width,n.src.height=n.height,r=n.src.getContext("2d"),s=r.createImageData(n.width,n.height),a=0;a<n.data.length;a++)s.data[a]=n.data[a];r.putImageData(s,0,0)}t.drawImage(n.src,e,i)}},o.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._fontSize+"px "+this._data.font},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u;if(0!==this._data.points.length){for(this._preRender(),e=this._fontSize,i=this._lineSpacing,o=e+i,t.textBaseline="top",t.font=this.fontStyle(),n=this._rect,(this._data.backgroundColor||this._data.borderColor||this._data.highlightBorder&&this._data.wordWrapWidth)&&this._rect?("right"!==this._data.horzAlign&&"center"!==this._data.horzAlign||!0!==this._data.doNotAlignText&&(t.textAlign="right"===this._data.horzAlign?"end":"center"),this._data.backgroundRoundRect?(t.roundRect(n.x,n.y,n.w,n.h,this._data.backgroundRoundRect),this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.globalAlpha=this._data.backgroundTransparency,t.fill(),t.globalAlpha=1),this._data.borderColor&&(r="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(e/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=r,t.stroke())):(this._data.backgroundColor&&(t.fillStyle=this._data.backgroundColor,t.globalAlpha=this._data.backgroundTransparency,t.fillRect(n.x,n.y,n.w,n.h),t.globalAlpha=1),this._data.borderColor?(r="number"==typeof this._data.borderWidth?this._data.borderWidth:~~Math.max(e/12,1),t.strokeStyle=this._data.borderColor,t.lineWidth=r,t.strokeRect(n.x-r/2,n.y-r/2,n.w+r,n.h+r)):this._data.highlightBorder&&(t.strokeStyle=this._data.color,t.lineWidth=1,t.beginPath(),l=[3,1],t.dashedLineTo(n.x-.5,a=n.y-.5,s=n.x+n.w+.5,a,l),t.dashedLineTo(s,a,s,a=n.y+n.h+.5,l),t.dashedLineTo(s=n.x-.5,a,n.x+n.w+.5,a,l),t.dashedLineTo(s,n.y-.5,s,a,l),t.globalAlpha=.5,t.stroke(),t.globalAlpha=1)),this._data.icons&&this._data.icons.forEach(function(e,i){var r=n.x+this._defaultPadding,s=n.y+this._padding.top+o*i;this._drawIcon(t,r,s,e)
},this)):"right"===this._data.horzAlign?t.textAlign="end":"center"===this._data.horzAlign&&(t.textAlign="center"),c=this._textPoint.x,h=this._textPoint.y,t.fillStyle=this._data.color,u=0;u<this._lines.length;u++)t.fillText(this._lines[u],c,h),h+=o;return{width:n.w+2}}},o.prototype.hitTest=function(t){return 0===this._data.points.length?null:(this._preRender(),this._boundingRect&&a(t,this._boundingRect[0],this._boundingRect[1])?this._hittest:null)},e.TrendLineStatsRenderer=o},,,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.Entry=0]="Entry",t[t.Close=1]="Close",t[t.ActualEntry=2]="ActualEntry",t[t.ActualClose=3]="ActualClose"}(e.RiskRewardPointIndex||(e.RiskRewardPointIndex={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.Waiting=0]="Waiting",t[t.Success=1]="Success",t[t.Failure=2]="Failure"}(e.AlertStatus||(e.AlertStatus={})),function(t){t[t.Up=1]="Up",t[t.Down=2]="Down"}(e.Direction||(e.Direction={}))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){t[t.RoundRadius=8]="RoundRadius",t[t.TextMargins=2]="TextMargins",t[t.MinWidth=100]="MinWidth"}(e.CalloutConsts||(e.CalloutConsts={}))},function(t,e,i){"use strict";function o(t,e){return t.compareTo(e)}function n(t){return Array.from(t).reduce(function(t,e){var i=+e;return-1===t.indexOf(i)&&t.push(i),t},[])}function r(t,e,i){var o=6e4,n=new Date(e.valueOf()+t*o);return t+(i.offset_loc(e)/o-i.offset_loc(n)/o)}var s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),s=i(50),a=i(86),l=i(7),c=l.getLogger("Chart.Model.ExchangeSession"),h=[s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY],u=[s.SUNDAY,s.MONDAY,s.TUESDAY,s.WEDNESDAY,s.THURSDAY,s.FRIDAY,s.SATURDAY],d=function(){function t(t,e,i){this._dayOfWeek=t,this._start=e,this._length=i}return t.prototype.start=function(){return this._start},t.prototype.alignedStart=function(){return this._start<0?this._start+s.minutesPerDay:this._start},t.prototype.isOvernight=function(){return this._start<0},t.prototype.dayOfWeek=function(){return this._dayOfWeek},t.prototype.length=function(){return this._length},t.prototype.weight=function(){return this._dayOfWeek*s.minutesPerDay+this._start},t.prototype.compareTo=function(t){var e=this.weight(),i=e+this._length,o=t.weight();return e<=o&&o<i?0:e>o?1:-1},t}(),e.SessionEntry=d,p=function(){function t(t){void 0===t&&(t="0000-0000");var e=this;this._entries=[],this._firstDayOfWeek=s.MONDAY,this._weekEndsCount=null,"24x7"===t.toLowerCase()?u.forEach(function(t){e.addSessionEntry(t,0,0)}):this._parseSpec(t),this._entries.sort(o)}return t.prototype.entries=function(){return this._entries},t.prototype.firstDayOfWeek=function(){return this._firstDayOfWeek},t.prototype.addSessionEntry=function(t,e,i){i<=e&&0!==e&&(e-=s.minutesPerDay);var o=i===e?s.minutesPerDay:i-e;this._entries.push(new d(t,e,o))},t.prototype.isWeekEnd=function(t){var e=a.lowerbound(this._entries,new d(t,0,0),function(t,e){return t.dayOfWeek()<e.dayOfWeek()})
;return e>this._entries.length-1||this._entries[e].dayOfWeek()!==t},t.prototype.weekEndsCount=function(){if(null===this._weekEndsCount){var t={};this._entries.forEach(function(e){t[e.dayOfWeek()]=1}),this._weekEndsCount=7-Object.keys(t).reduce(function(e,i){return e+(t[+i]||0)},0)}return this._weekEndsCount},t.prototype.hasWeekEnds=function(){return this.weekEndsCount()>0},t.prototype.indexOfSessionEntry=function(t,e){var i=a.lowerbound(this._entries,new d(t,e,0),function(t,e){return t.compareTo(e)<0});return i>this._entries.length-1?0:i},t.prototype.findSessionEntry=function(t,e){return this._entries[this.indexOfSessionEntry(t,e)]},t.prototype.correctTradingDay=function(t,e){var i=s.get_day_of_week(t),o=60*s.get_hours(t)+s.get_minutes(t),n=this.findSessionEntry(i,o),r=n.dayOfWeek(),a=(r-i+7)%7;return 0!==a?s.add_days_considering_dst(e,t,a):t},t.prototype.alignToSessionStart=function(t,e){var i=s.get_day_of_week(t),o=s.get_minutes_from_midnight(t),n=this.findSessionEntry(i,o),a=n.alignedStart(),l=n.dayOfWeek(),c=n.isOvernight(),h=(l-i+7)%7-(c?1:0);return 0!==h&&s.add_date(t,h),s.set_hms(t,a/60|0,a%60,0,0),r(n.length(),t,e)},t.prototype._parseSpec=function(t){var e=this,i={},o=!1;t=this._parseFirstDayOfWeek(t),t.split("|").forEach(function(t){var e,r,s=t.split(":");if(1!==s.length&&2!==s.length)return void c.logError("Bad session section: "+t);if(e=1===s.length){if(o)return void c.logError("Duplicated default section: "+t);o=!0}r=e?h:n(s[1]),r.forEach(function(t){e&&i[t]||(i[t]=s[0])})}),u.forEach(function(o){var n=i[o];void 0!==n&&n.split(",").forEach(function(i){var n,r,a=i.split("-");2!==a.length&&(c.logError("Bad sessions spec: "+t),a=["0000","0000"]),n=a[0],r=a[1],e.addSessionEntry(o,s.get_minutes_from_hhmm(n),s.get_minutes_from_hhmm(r))})})},t.prototype._parseFirstDayOfWeek=function(t){var e,i,o,n=t.split(";");return n.length>2?(c.logError("Only one `first day` specification expected @ session "+t),t):1===n.length?t:(e=n[0].indexOf("-")>=0,i=e?NaN:parseInt(n[0]),o=1,isNaN(i)&&(o=0,i=parseInt(n[1])),i<s.SUNDAY||i>s.SATURDAY?(c.logError("Unexpected day index @ session: "+t+"; day index "+i),t):(this._firstDayOfWeek=i,n[o]))},t}(),e.ExchangeSession=p},,,,function(t,e,i){"use strict";(function(t){function o(e){var i,o,c,h,u,d,p,_,f,m,g;if(e=$.extend({},l,e),i=$(t.render(s,{tabs:e.tabs,customControls:e.customControls,customControlsAddClass:e.customControlsContainerAddClass},{additionalHeaderContent:e.additionalHeaderContent})),o=$(a),c=o,e.contentAddClass&&o.addClass(e.contentAddClass),!1!==e.withScroll&&(o=$('<div class="js-dialog__scroll-wrap tv-dialog__scroll-wrap">').append(c.addClass("tv-dialog__scroll-wrap-inner"))),h=$('<div class="tv-tabbed-dialog">').append(i).append(o),e.customControls&&i.find(".js-custom-controls").append(e.customControls),!0!==e.doNotCreatePages)for(u=0;u<e.tabs.length;++u)c.append($('<div class="tv-tabbed-dialog__tab-page">').append(e.tabs[u].page));return d=e.tabStateSaveKey,p=e.activeTab,_=e.tabsScrollBoxAddClass,f=e.tabAddClass,delete e.tabs,delete e.activeTab,delete e.customControls,
delete e.tabStateSaveKey,delete e.customControlsContainerAddClass,delete e.tabsScrollBoxAddClass,delete e.tabAddClass,e.closeButtonAddClass="tv-tabbed-dialog__close",e.contentWrapTemplate=h,m=(0,r.createDialog)(e),g=new n.Tabs(i.find(".tv-tabs").get(0),c.get(0),{addLeftArrowsClass:"tv-tabbed-dialog__tabs-arrow-left",addRightArrowsClass:"tv-tabbed-dialog__tabs-arrow-right",addScrollBoxClass:_,tabClass:f,saveTab:d,activeTab:p}),m.on("afterOpen",function(){g.setActivePage(g.index(),!0,!0)}),{dialog:m,tabs:g}}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),e.createTabbedDialog=o,n=i(955),r=i(65),i(958),s='<div class="tv-dialog__section tv-dialog__section--title tv-tabbed-dialog__header js-dialog__drag js-close-button-place"><div class="tv-tabs tv-tabbed-dialog__tabs js-dialog__drag">{{#tabs}}<div class="tv-tabs__tab">{{name}}</div>{{/tabs}}</div>{{#customControls}}<div class="js-custom-controls tv-tabbed-dialog__custom-controls {{#customControlsAddClass}}{{customControlsAddClass}}{{/customControlsAddClass}}"></div>{{/customControls}}<div class="tv-tabbed-dialog__bottom-border"></div></div>{{>additionalHeaderContent}}',a='<div class="tv-tabbed-dialog__pages-container"></div>',l={tabs:[]}}).call(e,i(41))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 6 12"><path fill-rule="evenodd" d="M0 0h2v2H0V0zm4 0h2v2H4V0zM0 5h2v2H0V5zm4 0h2v2H4V5zm-4 5h2v2H0v-2zm4 0h2v2H4v-2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 16"><path fill-rule="evenodd" d="M10.5 5.333h-.75V3.81C9.75 1.707 8.07 0 6 0 3.93 0 2.25 1.707 2.25 3.81v1.523H1.5c-.825 0-1.5.686-1.5 1.524v7.62C0 15.313.675 16 1.5 16h9c.825 0 1.5-.686 1.5-1.524V6.857c0-.838-.675-1.524-1.5-1.524zM6 12c-.825 0-1.5-.675-1.5-1.5S5.175 9 6 9s1.5.675 1.5 1.5S6.825 12 6 12zm2.325-6.75h-4.65v-1.5A2.326 2.326 0 0 1 6 1.425 2.326 2.326 0 0 1 8.325 3.75v1.5z"/></svg>'},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,i){"use strict";(function(t){function e(){var t,e,i=$.Deferred();return urlParams.theme?(t=urlParams.theme.toLowerCase(),e=d.themes[t],e?(d.setTheme(e.name),d.getStdTheme(e.name).then(function(t){i.resolve(t.content)}).catch(function(t){console.warn("Cannot load theme {0}, reason: {1}".format(e.name,t)),i.resolve()})):i.resolve()):i.resolve(),i.promise()}function o(){JSON.parse(urlParams.disabledFeatures).forEach(function(e){t.setEnabled(e,!1)}),JSON.parse(urlParams.enabledFeatures).forEach(function(e){t.setEnabled(e,!0)})}function n(){t.enabled("saveload_storage_customization")&&(window.parent[urlParams.uid].saveLoadAdapter?p.setCustomAdapter(window.parent[urlParams.uid].saveLoadAdapter):void 0!==urlParams.chartsStorageUrl&&urlParams.chartsStorageUrl&&void 0!==urlParams.clientId&&urlParams.clientId?p.initialize(urlParams.clientId,urlParams.userId,urlParams.chartsStorageUrl,urlParams.chartsStorageVer||"1.0"):(t.setEnabled("saveload_storage_customization",!1),
t.setEnabled("header_saveload",!1)))}function r(){j.resolve()}var s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W,H,U,j,q;i(570),i(12),s=i(573),i(574),i(298),i(601),o(),a=i(2),l=i(39),c=i(602).HeaderToolbar,h=i(621).DrawingToolbar,u=i(306).isDrawingToolbarVisible,d=i(310),p=i(311),_=i(52).Action,f=i(393).ChartSaver,m=i(744).StudyTemplates,g=i(759).FavoriteStudyTemplateService,v=i(76),y=i(23),b=i(28),S=b.formatterOptions,w=b.customFormatters,T=i(760),C=i(761),x=i(769).SaveLoadWidget,P=i(93).TVXWindowEvents,L=i(774),I=i(207),k=i(322).Root,A=i(779).ChartPage,M=new k(window),E=new A(M.allocate()),i(782),D=i(783),V=i(973).FavoriteDrawingToolbar,O=i(976),R=i(1001),B=i(33),z=i(1010),i(234),i(1018),F=i(71),N=window.parent[urlParams.uid].customIndicatorsUrl,W=$.Deferred(),H=$.Deferred(),$.when(W,H).done(function(){ChartApiInstance.start()}),N?$.getScript(N).done(function(){void 0!==window.__customIndicators&&window.isArray(window.__customIndicators)&&(window.PineJS=i(48),JSServer.studyLibrary=JSServer.studyLibrary.concat(window.__customIndicators),console.log("{0} custom indicators loaded.".format(window.__customIndicators.length)),W.resolve())}).fail(function(t){console.warn("Error loading custom indicators @ `{0}`: {1} ({2}) ".format(N,t.statusText,t.status)),W.resolve()}):W.resolve(),window.widgetReady=function(t){y.subscribe("onChartReady",t)},window.customizeUI=function(t){null!=t.studiesOverrides&&B.setDefaultsOverrides(t.studiesOverrides),window.__defaultsOverrides=t.defaultsOverrides},window.applyStudiesOverrides=function(t){t&&window.chartWidgetCollection.applyStudiesOverrides(t)},window.applyOverrides=function(t){$.extend(!0,window.__defaultsOverrides,t),window.applyDefaultsOverrides(TradingView.defaultProperties.chartproperties),window.applyDefaultOverridesToLinetools(),window.chartWidgetCollection.applyOverrides(t)},window.changeTheme=function(t){var e=d.themes[t.toLowerCase()];e&&window.tradingViewApi.themes().setStdTheme(e.name).then(function(){window.applyOverrides(window.__defaultsOverrides)})},window.is_authenticated=!1,window.parent[urlParams.uid].brokerFactory,window.t("charts by TradingView"),window.t("powered by TradingView"),U=function(e){var o,n,r,s,d,p,_,b,k,A,M,B,N,W,U;if(!Modernizr.canvas||!Modernizr.canvastext)throw Error("Charting library cannot be running under this browser");t.setEnabled("charting_library_debug_mode","true"===urlParams.debug),t.setEnabled("chart_property_page_trading",!1),t.setEnabled("chart_property_page_template_button",!1),o=window.headerChartPanel=$(".header-chart-panel"),n=$("#library-container"),t.enabled("remove_library_container_border")&&(n.css("border","0px"),n.css("padding","1px")),window.customizeUI({studiesOverrides:urlParams.studiesOverrides?JSON.parse(urlParams.studiesOverrides):void 0,defaultsOverrides:JSON.parse(urlParams.overrides)}),urlParams.numeric_formatting=urlParams.numeric_formatting&&JSON.parse(urlParams.numeric_formatting),
urlParams.numeric_formatting&&"string"==typeof urlParams.numeric_formatting.decimal_sign&&(S.decimalSign=urlParams.numeric_formatting.decimal_sign[0]),window.ChartApiInstance=new R(window.parent[urlParams.uid].datafeed),window.parent[urlParams.uid].customFormatters&&(window.parent[urlParams.uid].customFormatters.timeFormatter&&(w.timeFormatter=window.parent[urlParams.uid].customFormatters.timeFormatter),window.parent[urlParams.uid].customFormatters.dateFormatter&&(w.dateFormatter=window.parent[urlParams.uid].customFormatters.dateFormatter)),ChartApiInstance.setTimeFramesList(JSON.parse(urlParams.timeFrames)),ChartApiInstance.setStudiesAccessController(ChartApiInstance.createStudiesAccessController(urlParams.studiesAccess)),r=window.parent[window.urlParams.uid].settingsAdapter,null!=r?(TVSettings.setSettingsAdapter(r),TVSettings.sync()):t.enabled("use_localstorage_for_settings")&&TVSettings.sync(),s=urlParams.chartContent?JSON.parse(urlParams.chartContent).json:void 0,d=urlParams.interval||"D",p={resizerBridge:E.allocate({areaName:"center"}),padding:t.enabled("border_around_the_chart")?5:0,edge:t.enabled("border_around_the_chart")?6:0,content:s,widgetOptions:{hideIdeas:!0,addVolume:!0,handleSessionErrors:!0,muteSessionErrors:!0,timezone:urlParams.timezone,defSymbol:urlParams.symbol,defInterval:d,defTimeframe:urlParams.timeframe&&urlParams.timeframe.toLowerCase()},globalEvents:!0,snapshotUrl:urlParams.snapshotUrl},_=t.enabled("left_toolbar"),_&&(b=new V({left:window.innerWidth/2,top:window.headerChartPanel.outerHeight()+61}),p.widgetOptions.favoriteDrawingToolbar=b,p.widgetOptions.isDrawingToolbarVisible=u),s&&void 0!==s.extendedData&&(k=s.extendedData,p.metaInfo={id:k.uid,name:k.name,description:k.description,uid:k.uid,username:"",tags:""}),A=window.chartWidgetCollection=new D(p),window.studyMarket=new C(A,window.user),"undefined"!=typeof serviceLocator&&serviceLocator.registerService(CHART_WIDGET_COLLECTION_SERVICE,A),A.activeChartWidget.subscribe(function(t){y.emit("activeChartChanged",A.getAll().indexOf(t))}),window.saver=new f(A),window.chartWidget=A.activeChartWidget.value(),window.pro=new TradingView.Pro,M=JSON.parse(urlParams.favorites),M.intervals=M.intervals.map(function(t){var e=""+t;return e.match(/1[DWMYdwmy]/)&&(e=e.slice(1)),e}),t.enabled("study_templates")&&(B=new g(P,TVSettings),window.studyTemplates=new m({chartWidgetCollection:A,favoriteStudyTemplatesService:B})),t.enabled("header_widget")&&(N=E.allocate({areaName:"top"}),window.headerWidget=l.render(a.createElement(c,{tools:i(1022).getRestrictedToolSet(),chartSaver:window.saver,chartApiInstance:ChartApiInstance,chartWidgetCollection:A,defaultIntervals:Object.keys(ChartApiInstance.defaultResolutions()),defaultFavoriteStyles:M.chartTypes,defaultFavoriteIntervals:M.intervals,headerChartPanel:o,hideStudyTemplates:!0,resizerBridge:N,studyMarket:window.studyMarket,studyTemplates:window.studyTemplates,favoriteStudyTemplatesService:B,allowedModes:t.enabled("caption_buttons_text_if_possible")?void 0:["medium"]}),N.body.value()[0])),
window.tradingViewApi=new z(A,window.saver,ChartApiInstance,t.enabled("header_saveload")?new x(null,A):null),v.bindToChartWidgetCollection(A),W=urlParams.toolbarbg&&/^[0-9a-f]+$/i.test(urlParams.toolbarbg)?urlParams.toolbarbg+"":void 0,W&&$("<style>").text("body,.chart-controls-bar,#footer-chart-panel{background-color:#"+W+" !important}").appendTo($("head")),TradingView.isNaN(urlParams.studyCountLimit)||(TradingView.STUDY_COUNT_LIMIT=Math.max(2,+urlParams.studyCountLimit)),TradingView.isNaN(urlParams.ssreqdelay)||F.setSearchRequestDelay(Math.max(0,+urlParams.ssreqdelay)),_&&(U=E.allocate({areaName:"left"}),l.render(a.createElement(h,{bgColor:W,chartWidgetCollection:A,drawingsAccess:urlParams.drawingsAccess?JSON.parse(urlParams.drawingsAccess):void 0,resizerBridge:U}),U.body.value()[0])),window.quoteSessionMultiplexerInstance={},window.quoteSessionMultiplexerInstance.simple=new L("simple"),window.quoteSessionMultiplexerInstance.full=new L,window.lineToolPropertiesToolbar=new O(A),chartWidget.onDisconnected().subscribe(null,function(t){t&&T.showCriticalErrorMessage(function(){ChartApiInstance.disconnect(),setTimeout(function(){ChartApiInstance.connect(),chartWidget.reconnect()},500)})}),$(".tv-content").bind("contextmenu",function(t){var e=$(t.originalEvent.target);if(!e.is("input")&&!e.is("textarea"))return!1}),H.resolve(),A.undoHistory.undoStack().onChange().subscribe(null,I(function(){y.emit("onAutoSaveNeeded")},1e3*(urlParams.autoSaveDelay||5),{leading:!0,trailing:!0})),chartWidget.withModel(null,function(){ChartApiInstance.on("realtime_tick",function(t){y.emit("onTick",t)}),e&&(A.applyTheme(e),window.applyOverrides(window.__defaultsOverrides)),t.enabled("charting_library_debug_mode")&&y.subscribeToAll(function(){var t=Array.prototype.slice.call(arguments);console.log('Event "{0}", arguments: {1}'.format(t[0],JSON.stringify(t.slice(1))))})}),y.subscribe("chart_load_requested",function(t){window.tradingViewApi.loadChart({json:JSON.parse(t.content),extendedData:t})})},window.destroyChart=function(){window.chartWidgetCollection&&(window.chartWidgetCollection.destroy(),window.chartWidgetCollection=null),window.quoteSessionMultiplexerInstance&&(window.quoteSessionMultiplexerInstance.simple&&window.quoteSessionMultiplexerInstance.simple.destroy(),window.quoteSessionMultiplexerInstance.full&&window.quoteSessionMultiplexerInstance.full.destroy(),window.quoteSessionMultiplexerInstance=null),ChartApiInstance&&(ChartApiInstance.destroy(),ChartApiInstance=null)},n(),j=$.Deferred(),window.parent[urlParams.uid].loadLastChart&&t.enabled("saveload_storage_customization")?p.getCharts(function(t){if(0===t.length)return void r();var e=t.sort(function(t,e){return e.modified_iso-t.modified_iso})[0];p.getChartContent(e,function(t){var e=JSON.parse(t.content);e.extendedData=t,urlParams.chartContent=JSON.stringify({json:e}),r()},r)},r):r(),q=$.Deferred(),$.when(e(),s,q,j).done(function(e){if($(window).resize(),$(".loading-indicator").hide(),setTimeout(U.bind(null,e),0),
t.enabled("14851")&&(Math.random()<=.02||t.enabled("cqg_terminal")||t.enabled("amp_terminal"))){!function(t,e,i,o,n,r,s){t.GoogleAnalyticsObject=n,t[n]=t[n]||function(){(t[n].q=t[n].q||[]).push(arguments)},t[n].l=1*new Date,r=e.createElement(i),s=e.getElementsByTagName(i)[0],r.async=1,r.src=o,s.parentNode.insertBefore(r,s)}(window,document,"script","//www.google-analytics.com/analytics.js","ga");var i=document.URL.match(RegExp("(:?.*://)([^/]+)/.*"))[2];ga("create","UA-112911840-1","auto"),ga("set","anonymizeIp",!0),ga("set",{hostname:i,page:i,referrer:i}),ga("send","pageview")}}),function(){var t=!0;window.parent[urlParams.uid].datafeed.onReady(function(e){t&&console.warn("`onReady` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),window.configurationData=e,q.resolve()}),t=!1}(),window.getFunctionFromArguments=function(t){return window.parent[urlParams.uid][t]},window.createShortcutAction=function(){var t={};return function(e,i){void 0===t[e]&&(t[e]=new _({shortcut:e})),t[e].callbacks().subscribe(null,i)}}(),window.initializationFinished=function(){window.chartWidgetCollection.undoHistory.clearStack()},window.resizeWindow=function(){$(window).resize()},window.createButton=function(t){t=t||{};var e=t.align||"left";return window.headerWidget.addButton(e)}}).call(e,i(5))},function(t,e){t.exports={14851:{},custom_items_in_context_menu:{},websocket_connection:{},countdown:{},symbol_search_parser_mixin:{},show_pro_features:{},daily_timeframe_suffix:{},symbollist_context_menu:{},pay_attention_to_ticker_not_symbol:{},graying_disabled_tools_enabled:{},update_study_formatter_on_symbol_resolve:{},constraint_dialogs_movement:{},same_data_requery:{},phone_verification:{},show_trading_notifications_history:{},show_interval_dialog_on_key_press:{},header_interval_dialog_button:{subsets:["show_interval_dialog_on_key_press"]},header_fullscreen_button:{},header_symbol_search:{},symbol_search_hot_key:{},header_resolutions:{subsets:["header_interval_dialog_button"]},header_chart_type:{},header_settings:{},header_indicators:{},header_compare:{},header_undo_redo:{},header_screenshot:{},header_saveload:{},study_on_study:{},header_widget:{subsets:["header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_settings","header_indicators","header_compare","header_undo_redo","header_fullscreen_button","compare_symbol"]},compare_symbol:{subsets:["header_compare"]},property_pages:{subsets:["show_chart_property_page","chart_property_page"]},show_chart_property_page:{},chart_property_page:{subsets:["chart_property_page_style","chart_property_page_scales","chart_property_page_background","chart_property_page_timezone_sessions","chart_property_page_events_alerts","chart_property_page_trading","chart_property_page_template_button"]},disable_userlink_popup:{},left_toolbar:{},keep_left_toolbar_visible_on_small_screens:{},hide_left_toolbar_by_default:{},control_bar:{},widget_logo:{},timeframes_toolbar:{},edit_buttons_in_legend:{
subsets:["show_hide_button_in_legend","format_button_in_legend","study_buttons_in_legend","delete_button_in_legend"]},hide_legend_by_default:{},show_hide_button_in_legend:{},format_button_in_legend:{},study_buttons_in_legend:{},delete_button_in_legend:{},pane_context_menu:{},scales_context_menu:{},legend_context_menu:{},context_menus:{subsets:["pane_context_menu","scales_context_menu","legend_context_menu","objects_tree_context_menu"]},items_favoriting:{},save_chart_properties_to_local_storage:{},use_localstorage_for_settings:{subsets:["items_favoriting","save_chart_properties_to_local_storage"]},plain_studymarket:{},trading_watch_positions:{},disable_resolution_rebuild:{},border_around_the_chart:{},charting_library_debug_mode:{},cl_feed_return_all_data:{},log_data_request_time:{},saveload_requires_authentication:{},saveload_storage_customization:{},new_chart_creation_available:{},volume_force_overlay:{},create_volume_indicator_by_default:{},create_volume_indicator_by_default_once:{},saved_charts_count_restriction:{},lean_chart_load:{},stop_study_on_restart:{},star_some_intervals_by_default:{},predefined_items_only_may_be_starred:{},move_logo_to_main_pane:{},show_logo_on_all_charts:{},link_to_tradingview:{},logo_without_link:{},right_bar_stays_on_scroll:{},chart_content_overrides_by_defaults:{},show_dialog_on_snapshot_ready:{},snapshot_trading_drawings:{},allow_supported_resolutions_set_only:{},study_market_minimized:{},widgetbar_tabs:{},collapsible_header:{},show_extension_popup:{},study_templates:{},side_toolbar_in_fullscreen_mode:{},remove_library_container_border:{},whotrades_auth_only:{},support_multicharts:{},display_market_status:{},display_data_mode:{},show_chart_warn_message:{},datasource_copypaste:{},line_tool_templates:{},expand_symbolsearch_items:{},symbol_search_three_columns_exchanges:{},symbol_search_flags:{},symbol_search_limited_exchanges:{},footer_share_buttons:{},footer_bugreport_button:{},footer_publish_idea_button:{},footer_screenshot:{},footer_showdom_button:{},text_notes:{},symbol_info:{},no_bars_status:{},clear_bars_on_series_error:{},hide_loading_screen_on_series_error:{},seconds_resolution:{},dont_show_boolean_study_arguments:{},hide_last_na_study_output:{},price_scale_always_last_bar_value:{},study_dialog_search_control:{},study_dialog_fundamentals_economy_addons:{},uppercase_instrument_names:{},cqg_trading_confirm_risks:{},trading_notifications:{},chart_crosshair_menu:{},japanese_chart_styles:{},hide_series_legend_item:{},hide_study_overlay_legend_item:{},hide_study_compare_legend_item:{},linetoolpropertieswidget_template_button:{},use_overrides_for_overlay:{},timezone_menu:{},main_series_scale_menu:{},show_login_dialog:{},remove_img_from_rss:{},bars_marks:{},chart_scroll:{},chart_zoom:{},source_selection_markers:{},high_density_bars:{},open_account_manager:{},multiple_watchlists:{},onchart_messages:{},custom_resolutions_box:{},referral_program_for_widget_owners:{},referral_program_policy_aggressive:{subsets:["referral_program_policy_passive","referral_program_policy_normal"]},
referral_program_policy_normal:{subsets:["referral_program_policy_passive","header_fake_features_buttons","custom_resolutions_box"]},tv_production:{subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","header_fullscreen_button","header_widget","dont_show_boolean_study_arguments","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","uppercase_instrument_names","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","new_chart_creation_available","saved_charts_count_restriction","create_volume_indicator_by_default","create_volume_indicator_by_default_once","charts_auto_save","right_bar_stays_on_scroll","save_old_chart_before_save_as","chart_content_overrides_by_defaults","alerts","show_dialog_on_snapshot_ready","show_extension_popup","header_saveload","header_layouttoggle","datasource_copypaste","show_saved_watchlists","watchlists_from_to_file","add_to_watchlist","property_pages","support_multicharts","display_market_status","display_data_mode","show_chart_warn_message","support_manage_drawings","widgetbar_tabs","study_templates","collapsible_header","line_tool_templates","caption_buttons_text_if_possible","footer_share_buttons","footer_screenshot","footer_publish_idea_button","text_notes","trading_watch_positions","symbol_info","linetoolpropertieswidget_template_button","cqg_trading_confirm_risks","trading_notifications","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","phone_verification","chart_events","onchart_messages","custom_resolutions_box","compare_symbol","timezone_menu","main_series_scale_menu","chart_crosshair_menu","study_on_study","japanese_chart_styles","show_login_dialog","dome_widget","bars_marks","chart_scroll","chart_zoom","screener_alerts","show_trading_notifications_history","source_selection_markers","go_to_date","study_dialog_fundamentals_economy_addons","multiple_watchlists"]},browser_extension:{subsets:["disable_userlink_popup","show_pro_features","show_saved_watchlists","display_market_status","display_data_mode","show_chart_warn_message","widgetbar_tabs","show_login_dialog"]},widget:{
subsets:["show_pro_features","countdown","symbol_search_parser_mixin","symbollist_context_menu","websocket_connection","uppercase_instrument_names","left_toolbar","control_bar","timeframes_toolbar","symbol_search_hot_key","context_menus","edit_buttons_in_legend","use_localstorage_for_settings","saveload_requires_authentication","volume_force_overlay","create_volume_indicator_by_default","create_volume_indicator_by_default_once","right_bar_stays_on_scroll","show_dialog_on_snapshot_ready","dont_show_boolean_study_arguments","header_widget_dom_node","header_symbol_search","header_resolutions","header_chart_type","header_compare","header_indicators","star_some_intervals_by_default","display_market_status","display_data_mode","show_chart_warn_message","symbol_info","linetoolpropertieswidget_template_button","symbol_search_three_columns_exchanges","symbol_search_flags","symbol_search_limited_exchanges","widgetbar_tabs","compare_symbol","timezone_menu","main_series_scale_menu","show_login_dialog","plain_studymarket","japanese_chart_styles","bars_marks","chart_scroll","chart_zoom","source_selection_markers","property_pages"]},bovespa_widget:{subsets:["widget","header_settings","chart_property_page_timezone_sessions","linetoolpropertieswidget_template_button"]},charting_library_base:{subsets:["14851","allow_supported_resolutions_set_only","border_around_the_chart","collapsible_header","constraint_dialogs_movement","context_menus","control_bar","create_volume_indicator_by_default","custom_items_in_context_menu","datasource_copypaste","daily_timeframe_suffix","uppercase_instrument_names","display_market_status","edit_buttons_in_legend","graying_disabled_tools_enabled","header_widget","header_saveload","dont_show_boolean_study_arguments","lean_chart_load","left_toolbar","trading_watch_positions","link_to_tradingview","pay_attention_to_ticker_not_symbol","plain_studymarket","predefined_items_only_may_be_starred","refresh_saved_charts_list_on_dialog_show","right_bar_stays_on_scroll","saveload_storage_customization","show_dialog_on_snapshot_ready","stop_study_on_restart","study_market_minimized","timeframes_toolbar","symbol_search_hot_key","update_study_formatter_on_symbol_resolve","update_timeframes_set_on_symbol_resolve","use_localstorage_for_settings","volume_force_overlay","widget_logo","countdown","use_overrides_for_overlay","trading_notifications","compare_symbol","symbol_info","timezone_menu","main_series_scale_menu","study_dialog_search_control","chart_crosshair_menu","create_volume_indicator_by_default_once","bars_marks","chart_scroll","chart_zoom","source_selection_markers","property_pages","go_to_date","adaptive_logo","caption_buttons_text_if_possible"]},charting_library:{subsets:["charting_library_base","header_screenshot"]},static_charts_service:{subsets:["charting_library","disable_resolution_rebuild","log_data_request_time","same_data_requery"]},trading_terminal:{
subsets:["charting_library_base","footer_showdom_button","support_multicharts","header_layouttoggle","japanese_chart_styles","chart_property_page_trading","footer_screenshot","add_to_watchlist","open_account_manager","show_dom_first_time","multiple_watchlists","show_trading_notifications_history"]},cqg_terminal:{subsets:["charting_library_base","chart_property_page_trading","expand_symbolsearch_items","clear_bars_on_series_error","no_bars_status","hide_loading_screen_on_series_error","support_multicharts","header_layouttoggle","same_data_requery","footer_bugreport_button","footer_showdom_button","dome_widget","show_dom_first_time","japanese_chart_styles","remove_img_from_rss","footer_screenshot","add_to_watchlist","show_trading_notifications_history"]},amp_terminal:{subsets:["cqg_terminal"]}}},function(t,e){},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(293);o.addTranslationFunctionToWindow(o.translationFunction),o.addTranslationFunctionToJQuery(o.translationFunction)},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.CustomEvent=function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.bubbles,n=void 0!==o&&o,r=i.cancelable,s=void 0!==r&&r,a=i.detail,l=void 0===a?null:a;try{return new window.CustomEvent(t,{bubbles:n,cancelable:s,detail:l})}catch(i){return e=document.createEvent("CustomEvent"),e.initCustomEvent(t,n,s,l),e}}},function(t,e,i){"use strict";var o,n;i(13),o=$.Deferred(),n=function(){o.resolve(),document.body.removeEventListener("tradingview-i18next-initialized",n)},window.__tradingviewI18nextInited?n():document.body.addEventListener("tradingview-i18next-initialized",n),t.exports=o},function(t,e,i){"use strict";function o(t){return t.keys().map(t)}window.TradingView=window.TradingView||{},window.requireAll=o,i(575),i(576),i(389),i(64),i(577),i(15),i(90),i(102),i(578),i(199),i(295),i(580),i(24),i(583),i(148),i(294),i(244)},function(t,e,i){"use strict";var o=i(38);window.language&&(o.locale(window.language,{months:[$.t("January"),$.t("February"),$.t("March"),$.t("April"),$.t("May"),$.t("June"),$.t("July"),$.t("August"),$.t("September"),$.t("October"),$.t("November"),$.t("December")],monthsShort:[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")],weekdays:[$.t("Sunday"),$.t("Monday"),$.t("Tuesday"),$.t("Wednesday"),$.t("Thursday"),$.t("Friday"),$.t("Saturday")],weekdaysShort:[$.t("Sun"),$.t("Mon"),$.t("Tue"),$.t("Wed"),$.t("Thu"),$.t("Fri"),$.t("Sat")],weekdaysMin:[$.t("Su",{context:"day_of_week"}),$.t("Mo",{context:"day_of_week"}),$.t("Tu",{context:"day_of_week"}),$.t("We",{context:"day_of_week"}),$.t("Th",{context:"day_of_week"}),$.t("Fr",{context:"day_of_week"}),$.t("Sa",{context:"day_of_week"})],longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MMM D",l:"M/D/YYYY",LL:"MMM D, YYYY",ll:"MMM D LT",LLL:"LT - LL",lll:"MMM D, YYYY LT",LLLL:"ddd D MMMM YYYY LT",llll:"ddd D MMM YYYY LT"},calendar:{
sameDay:$.t("__specialSymbolOpen__Today at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextDay:$.t("__specialSymbolOpen__Tomorrow at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),nextWeek:$.t("__dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),lastDay:$.t("__specialSymbolOpen__Yesterday at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT"}),lastWeek:$.t("__specialSymbolOpen__Last__specialSymbolClose__ __dayName__ __specialSymbolOpen__at__specialSymbolClose__ __dayTime__",{specialSymbolOpen:"[",specialSymbolClose:"]",dayTime:"LT",dayName:"dddd"}),sameElse:"L"},relativeTime:{future:function(t){return t===$.t("just now")?t:$.t("in %s",{context:"time_range"}).replace("%s",t)},past:function(t){return t===$.t("just now")?t:$.t("%s ago",{context:"time_range"}).replace("%s",t)},s:$.t("just now"),m:function(t){return $.t("%d minute",{plural:"%d minutes",count:t}).replace("%d",t)},mm:function(t){return $.t("%d minute",{plural:"%d minutes",count:t}).replace("%d",t)},h:$.t("an hour"),hh:function(t){return $.t("%d hour",{plural:"%d hours",count:t}).replace("%d",t)},d:$.t("a day"),dd:function(t){return $.t("%d day",{plural:"%d days",count:t}).replace("%d",t)},M:$.t("a month"),MM:function(t){return $.t("%d month",{plural:"%d months",count:t}).replace("%d",t)},y:$.t("a year"),yy:function(t){return $.t("%d year",{plural:"%d years",count:t}).replace("%d",t)}},week:{dow:1,doy:4}}),o.locale(window.language))},function(t,e,i){"use strict";!function(t){t.fn.contextMenu=function(e){t(this).bind("contextmenu",function(t){return e(t),!1})}}(jQuery)},function(t,e,i){"use strict";!function(t,e,i){"$:nomunge";function o(o,n){function r(e){t(s).each(function(){var i=t(this);this===e.target||i.has(e.target).length||i.triggerHandler(n,[e.target])})}n=n||o+i;var s=t(),a=o+"."+n+"-special-event";t.event.special[n]={setup:function(){s=s.add(this),delete s.prevObject,1===s.length&&t(e).bind(a,r)},teardown:function(){s=s.not(this),delete s.prevObject,0===s.length&&t(e).unbind(a)},add:function(t){var e=t.handler;t.handler=function(t,i){t.target=i,e.apply(this,arguments)}}}}t.map("click dblclick mousemove mousedown mouseup mouseover mouseout change select submit keydown keypress keyup".split(" "),function(t){o(t)}),o("focusin","focus"+i),o("focusout","blur"+i),Modernizr.touch&&(o("touchstart","mousedown"+i),o("touchmove","mousemove"+i),o("touchend","mouseup"+i)),t.addOutsideEvent=o}(jQuery,document,"outside")},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(579);$.fn.lastCharSup=function(){for(var t=0;t<this.size();t++)o.lastCharSup(this.get(t));return this}},function(t,e,i){"use strict";function o(t){var e,i;if(3===t.nodeType&&t.data.trim())return t;if(t.childNodes)for(e=t.childNodes.length;e--;)if(i=o(t.childNodes[e]))return i;return null}function n(t,e){var i,o=e.parentNode
;o&&(i=e.nextSibling,i?o.insertBefore(t,i):o.appendChild(t))}function r(t){var e,i,r,s=o(t);if(s){if(e=s.data,s.parentNode&&s.parentNode.tagName&&"sup"===s.parentNode.tagName.toLowerCase())return;i=/^([^]*)(\S)(\s*)$/.exec(e),i&&(s.data=i[1],r=document.createElement("sup"),r.textContent=i[2],n(r,s),i[3]&&n(document.createTextNode(i[3]),r))}}Object.defineProperty(e,"__esModule",{value:!0}),e.lastCharSup=r},function(module,exports,__webpack_require__){"use strict";(function(Delegate,_,Featuresets){function loginUser(t,e){window.TVDialogs&&window.TVDialogs.signModal&&window.TVDialogs.signModal.close(),user=$.extend(!0,{},t),TradingView.changeLoginState(!0),"function"==typeof e&&window.TVDialogs&&window.TVDialogs.signModal?window.TVDialogs.signModal.on("signinSuccess",function(){e()}):"function"==typeof e&&e()}function onLoginStateChange(is_initial){window.iframeAuthWidget&&user.is_first_login&&(window.iframeAuthWidget.preventClose=!0);var available_offers=user.available_offers;$("html").toggleClass("is-authenticated",is_authenticated).toggleClass("is-not-authenticated",!is_authenticated).toggleClass("is-pro",is_authenticated&&user&&!!user.is_pro).toggleClass("is-not-pro",!(is_authenticated&&user&&user.is_pro)).toggleClass("is-trial",is_authenticated&&user&&!!user.is_trial).toggleClass("is-not-trial",!(is_authenticated&&user&&user.is_trial)).toggleClass("is-not-trial-available",void 0===available_offers[OFFERS.trial]).toggleClass("is-trial-available",void 0!==available_offers[OFFERS.trial]).toggleClass("is-upsale-available",is_authenticated&&void 0!==available_offers[OFFERS.upsale]),TVSettings.sync(user.settings),$(".js-header__gopro-button").attr("href",is_authenticated?"/gopro/":""),is_authenticated?($(".saved_charts_count").html(user.saved_charts),$(".treated_charts_count").html(user.treated_charts_count),$(".js-trial-days-left").html(user.trial_days_left_text||""),$(".js-header-gopro-button").attr("href","/gopro/"),user.fastpass_script&&eval(user.fastpass_script),user.is_first_login&&($(function(){}),trackEvent("Conversion","First login"),user.prort_trial_started&&delete user.prort_trial_started,delete user.is_first_login),TradingView.setTrialAvailiable(void 0!==user.available_offers[OFFERS.trial])):(Object.keys(available_offers).forEach(function(t){available_offers[t].available_for_anons||delete available_offers[t]}),user={username:"Guest",following:"0",followers:"0",ignore_list:{},available_offers:available_offers},$(".user-info-username").html(user.username),TVLocalStorage.removeItem("trial_availiable"))}var loginStateChange,djangoLogoutFinished,TVXWindowEvents=__webpack_require__(93).TVXWindowEvents,trackEvent=__webpack_require__(40).trackEvent,OFFERS={};__webpack_require__(581),$(document).ajaxSend(function(t,e,i){"POST"!==i.type||i.crossDomain||e.setRequestHeader("X-CSRFToken",$.cookie("csrftoken")),i.crossDomain&&!i.forceLanguageHeader||(window.locale?e.setRequestHeader("X-Language",window.locale):console.warn("window.locale is not defined"))}),
loginStateChange=window.loginStateChange?window.loginStateChange:window.loginStateChange=new Delegate,djangoLogoutFinished=window.djangoLogoutFinished?window.djangoLogoutFinished:window.djangoLogoutFinished=new Delegate,loginStateChange.subscribe(null,onLoginStateChange),TVXWindowEvents.on("loginStateChange",function(){var t=JSON.parse(this);window.user=t.user,window.is_authenticated=!!t.is_authenticated,loginStateChange.fire()}),function(){var t="user-obj-changed",e={};window.crossTabSyncUserAttr=function(e){var i={};e instanceof Array?e.forEach(function(t){i[t]=window.user[t]}):i[e]=window.user[e],TVXWindowEvents.emit(t,JSON.stringify(i))},window.onChangeUserAttrInAnotherTab=function(t){var i=new Delegate;return e[t]||(e[t]=[]),e[t].push(i),i},TVXWindowEvents.on(t,function(t){var i,o;t=JSON.parse(t);for(i in t)if(window.user[i]=t[i],e[i])for(o=0;o<e[i].length;o++)e[i][o].fire(t[i])})}(),TradingView.changeLoginState=function(t){window.is_authenticated=!!t,TVXWindowEvents.emit("loginStateChange",JSON.stringify({is_authenticated:is_authenticated,user:user})),loginStateChange.fire()},window.loginUser=loginUser,TradingView.signOut=function(){var t=_.clone(window.user);TradingView.changeLoginState(!1),$.ajax({type:"POST",url:"/accounts/logout/",dataType:"html"}).done(function(){TVXWindowEvents.emit("djangoLogoutFinished"),djangoLogoutFinished.fire()}).fail(function(){window.user=t,TradingView.changeLoginState(!0)})},window.loginRequiredDelegate=new Delegate,window.runOrSignIn=function(t,e){e||(e={}),e.verifiedPhoneRequired,(is_authenticated||Featuresets.enabled("charting_library_base"))&&t()},TradingView.runOrGoPro=function(t,e,i){Featuresets.enabled(e)&&t()},window.onLoginStateChange=onLoginStateChange,TradingView.isPro=function(){return is_authenticated&&user.is_pro},TradingView.setTrialAvailiable=function(t){TVLocalStorage.setItem("trial_availiable",t?1:0)},$.fn.reverse=[].reverse,$(window).load(function(){window.loaded=!0}),TradingView.notificationsChanged=new Delegate}).call(exports,__webpack_require__(10),__webpack_require__(118),__webpack_require__(5))},function(t,e,i){"use strict";function o(t){$(t).attr("title")||t.offsetWidth+r>=t.scrollWidth||$(t).attr("title",$(t).text())}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),i(13),n=i(144),r=$.browser.msie||/\btrident\b/i.test(navigator.userAgent)?1:0,$(function(){$(document).on("mouseenter",".apply-overflow-title",function(){o(this)}),$(document).on("mouseenter",".apply-overflow-tooltip",function(){function t(){n.hide(),i.off("mouseleave mousedown",t)}var e,i=$(this);i[0].offsetWidth+r>=i[0].scrollWidth||(e="",e=i.is(".apply-overflow-tooltip--allow-text")?i.text():i.clone().children().remove().end().text().trim(),n.showOnElement(i[0],{text:e}),i.on("mouseleave mousedown",t))})})},function(t,e){},function(t,e,i){"use strict";(function(t,e,o){var n,r,s,a=i(54).max,l=i(145).createNoticeDialog,c=i(134).lazyJqueryUI;i(241),n=null,r=function(t){n||(n=l({type:"modal",title:t.title,content:t.content}).open(),n.on("beforeClose",function(){n=null}))},
s=window.TVDialogs={modalDialog:null,dialogs:[],messageInterval:null,messageDelay:4e3,NOTIFICATION_ANIMATION_START_OFFSET:"-33px",_constrainDraggableOptionsIfNeeded:function(e){return t.enabled("constraint_dialogs_movement")&&(e.containment=".chart-page"),e},validateHelpers:{isErrorListening:function(t){t.on("keyup.error-checker",s.validateHelpers.isError(t.val(),t))},isError:function(t,e){return function(){e.val()!==t&&(e.removeClass("error"),e.off("keyup.error-checker"))}},makeValidator:function(t,e,i,o,n){return function(r){var a,l,c;if(t.removeClass("error"),$("._tv-dialog-field-error").hide(),""!==r.errors)if("object"==typeof r.errors){for(a in r.errors)l=t.filter("input[name^="+a+"]"),l.addClass("error").data("error",r.errors[a][0]),s.validateHelpers.isErrorListening(l);c=t.filter(".error").first().focus(),s.showError(c.data("error"),n)}else s.showError($.t("Error:")+r.errors,n);else"function"==typeof o&&o(r,i);e.removeClass("process")}}},applyMQMatcher:function(t){var e,i;t||(t=s.modalDialog),e=function(){s.positionDialog()},window.matchMedia&&(i=["(max-height: 645px)","(max-width: 460px)"].map(function(t){var i=matchMedia(t);return i.addListener(e),i}),t.on("destroy",function(){i.forEach(function(t){t.removeListener(e)})}))},showBrowserExtensionDialog:function(t){var o,n;if(t)return o={chrome:{logo:"/static/images/svg/google-chrome-logo.svg",name:"Google Chrome",href:"https://chrome.google.com/webstore/detail/tradingview-free-quotes-a/ommjfbdmijjlbhlhnnnfkmbnkpnjpipj"}},n=i(205),s.createModalDialog("Browser Extension",{noHeader:!0,width:"730px",content:e.render(n.dialogs.browserExtension,{browser:o[t]})}),s.modalDialog.find(".install-extension, ._tv-dialog-title-close").click(function(t){s.destroy()}),s.positionDialog(),s.modalDialog},showIntervalMismatchDialog:function(t){var e,i,o,n,r=$.t("Interval is not applicable"),s=$("<div></div>"),a=$.t("<p>Only <b>D, W, M</b> intervals are supported for this symbol/exchange. You will be automatically switched to a D interval. Intraday intervals are not available because of exchange policies.</p>");s.append(a),t&&(e=$.t("Do not show this message again"),i='<label class="dialog-trail-checkbox"><input type="checkbox" style="margin: 0; vertical-align: middle;"/> '+e+"</label>",s.append(i),o=s.find("input"),o.attr("checked",t.silentIntervalChange.value()),o.bind("click",function(){t.silentIntervalChange.setValue(this.checked)})),n=l({title:r,content:s}),n.open()},showGoProDialog:function(){},showSignInDialog:function(t,e){},goRegistrate:function(t){},showAlertTextNotesDialog:function(){r({title:$.t("Oops!"),content:'<div class="tv-text">'+$.t('Text Notes are available only on chart page. Please <a href="/chart/">open a chart</a> and then try again.')+"</div>"})},showNotice:function(t,i,o){var n,r,a,l,c,h;return"object"==typeof i&&(o=i,i=""),o=o||{},n=o.doNotCloseOnBgClick||!1,r=o.html||"",a=o.width||"400px",l={},l.noClose=o.noClose||null,l.addClass=o.modalDialogClass||null,s.createModalDialog(t,l),c=o.centerCaption?"caption-big-center":"caption-big",
s.modalDialog.find("._tv-dialog").css("width",a),h=o.customButtonCaption?o.customButtonCaption:$.t("OK"),s.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="{{captionClassName}} {{classSuffix}}">{{text}}'+r+'</div>{{^removeOkButton}}<div class="buttons"><input type="button" class="_tv-button ok" value="'+h+'"/></div>{{/removeOkButton}}</div>',{captionClassName:c,classSuffix:o.classSuffix||"",text:i,removeOkButton:o&&o.removeOkButton})),s.modalDialog.find("._tv-button.ok").on("click",function(){s.destroy(),o.onOkButtonClick&&o.onOkButtonClick()}),s.positionDialog(),s.applyHandlers(!1,{doNotCloseOnBgClickIfShadowbox:n,beforeDestroy:o.onClose}),s.modalDialog},showConfirm:function(t,i,o,n,r){var a,l;return r=r||{},r.dontAskSetting&&TVSettings.getBool(r.dontAskSetting)?void o():(a=s.createModalDialog(t,r),s.modalDialog.find("._tv-dialog").css("width",r.customWidth?r.customWidth:"400px"),s.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><div class="caption-big">{{{text}}}</div>{{#dontAskSetting}}<input type="checkbox" id="confirm-dialog-checkbox" style="margin: 0; vertical-align: middle;"> <label for="confirm-dialog-checkbox" style="font-size: 11px;">'+$.t("Do not ask again")+'</label>{{/dontAskSetting}}</div><div class="_tv-dialogs-bottom _tv-dialog-center"><input class="_tv-button wide ok" type="button" value="'+$.t("YES")+'" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="'+$.t("NO")+'"/></div>',{text:i,dontAskSetting:!!r.dontAskSetting})),r.okButtonText&&s.modalDialog.find(".ok").val(r.okButtonText),r.cancelButtonText&&s.modalDialog.find(".cancel").val(r.cancelButtonText),l=s.modalDialog.find(".ok"),l.click(function(){r.dontAskSetting&&$("#confirm-dialog-checkbox").is(":checked")&&TVSettings.setValue(r.dontAskSetting,!0),o(),r.manualClose||s.destroy()}),s.modalDialog.find(".cancel").click(function(){n&&n(),r.manualCloseOnCancel||s.destroy()}),s.positionDialog(),s.applyHandlers(a,{processEnterButton:l}),a)},showPrompt:function(t,i,o,n,r){function a(){var t,e=h.val();if(c&&(t=c(e)))return!0===t&&(t=$.t("Wrong value")),void s.showError(t,s.modalDialog);s.destroy(),o&&o(e)}var l,c,h;r=r||{},l=r&&r.defaultValue,c=r&&r.validate,s.createModalDialog(t,r),s.modalDialog.find("._tv-dialog").css("width","400px"),s.modalDialog.find("._tv-dialog-content").html(e.render('<div class="main"><form><div class="caption-big-center slim">{{text}}: <input type="text" name="prompt-value" class="prompt-value"/></div></form></div><div class="_tv-dialogs-bottom _tv-dialog-{{bottomAlign}}"><input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/><input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/></div>',{text:i,bottomAlign:r.bottomAlign?r.bottomAlign:"center"})),h=s.modalDialog.find('[name="prompt-value"]'),l&&h.val(l),s.modalDialog.find("form").submit(function(t){a(),t.preventDefault()}),s.modalDialog.find(".ok").click(function(t){a(),t.preventDefault()}),
s.modalDialog.find(".cancel").click(function(){s.destroy(),n&&n()}),s.positionDialog(),s.applyHandlers(),setTimeout(function(){h.focus().select()},0)},showCustomDialog:function(t){function e(e){var i=t.action(s.modalDialog),o=i&&!i.error,n=void 0===i,r=i&&i.notClose;!o&&!n||r?i.error&&s.showError(i.error):s.destroy(),e.preventDefault()}function i(e){"function"==typeof t.onCancel?t.onCancel():s.destroy()}return s.createModalDialog(t.title||$.t("Dialog"),{addClass:t.addClass||""}),s.modalDialog.find("._tv-dialog").css("width",t.width||"400px"),s.modalDialog.find("._tv-dialog-content").html('<div class="main">'+(t.html||$.t("Content"))+"</div>"+(t.noButtons?"":'<div class="_tv-dialogs-bottom _tv-dialog-center">'+(t.noButtonOk?"":'<input class="_tv-button wide ok" type="button" value="'+$.t("OK")+'" style="margin-right: 10px;"/>')+(t.noButtonCancel?"":'<input class="_tv-button wide cancel" type="button" value="'+$.t("Cancel")+'"/>')+"</div>")),t.okButtonText&&s.modalDialog.find(".ok").val(t.okButtonText),t.cancelButtonText&&s.modalDialog.find(".cancel").val(t.cancelButtonText),s.modalDialog.find(".ok").click(e),s.modalDialog.find("form").submit(e),s.modalDialog.find(".cancel").click(i),s.modalDialog.find("._tv-dialog-title-close").click(i),s.positionDialog(),s.applyHandlers(),s.modalDialog},createModalDialog:function(t,e){var i,o;return e=e||{},null!==s.modalDialog&&s.destroy(),s.modalDialog=$('<div class="_tv-dialog-shadowbox"><div class="_tv-dialog _tv-dialog-modal'+(e.addClass?" "+e.addClass:"")+'">'+(e.noHeader?"":'<div class="_tv-dialog-title">'+(e.noClose?"":'<a class="_tv-dialog-title-close"></a>')+'<span class="_tv-dialog-title-text">'+t+"</span></div>")+'<div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div></div>').appendTo($("body")).data("title",t),s._addMessageCloseButton(s.modalDialog.find("._tv-dialog-error")),s._addMessageCloseButton(s.modalDialog.find("._tv-dialog-message")),e.noShadowBox&&s.modalDialog.addClass("transparent"),e.addClass&&s.modalDialog.addClass(e.addClass),e.width&&s.modalDialog.find("._tv-dialog").css({width:e.width}),e.content&&s.modalDialog.find("._tv-dialog-content").html(e.content),i=$(".fancybox-overlay"),i.length&&(o=i.css("z-index"),$("._tv-dialog-shadowbox").css("z-index",o+1)),e.draggable&&c(s.modalDialog).draggable(s._constrainDraggableOptionsIfNeeded({handle:s.modalDialog.find("._tv-dialog-title")})),e.zIndex&&s.modalDialog.css("z-index",e.zIndex),s.modalDialog},_addMessageCloseButton:function(t){var e=$(i(599)).attr({class:"close",title:$.t("Close message")});t.append(e),$(e).on("click",function(){t.animate({marginTop:s.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){t.hide()})})},createDialog:function(t,i){var o,n,r;return s.isOpen(t)?(o=s.get(t),o.find("._tv-dialog-content").html(""),o.data("new",!1),o):(i=i||{},
o=$(e.render('<div class="_tv-dialog _tv-dialog-nonmodal {{&addClass}}"><div class="_tv-dialog-title{{#hideTitle}} _tv-dialog-title-hidden{{/hideTitle}}{{#hideCloseCross}} _tv-dialog-title-no-close{{/hideCloseCross}}">{{^hideTitle}} {{&title}}{{/hideTitle}}{{^hideCloseCross}}<a class="_tv-dialog-title-close"></a>{{/hideCloseCross}}</div><div class="_tv-dialog-error"><span class="message"></span></div><div class="_tv-dialog-message"><span class="message"></span></div><div class="_tv-dialog-content"></div></div>',{addClass:i.addClass||"",hideTitle:i.hideTitle,hideCloseCross:i.hideCloseCross,title:t})).appendTo($("body")),s._addMessageCloseButton(o.find("._tv-dialog-error")),s._addMessageCloseButton(o.find("._tv-dialog-message")),i.width&&o.css({width:i.width}),i.content&&o.find("._tv-dialog-content").html(i.content),n=0,n=i.zIndex?i.zIndex:s.dialogs&&s.dialogs.length?a($.map(s.dialogs,function(t){return parseInt((t.dialog||t).css("z-index"),10)}))+1:110,o.css("z-index",n),o.data("new",!0),o.data("title",t),o.data("id",s.dialogs.length+1),s.dialogs.push({title:t,dialog:o,id:s.dialogs.length+1}),r={start:function(t,e){var i,o,n=e.helper.css("z-index"),r=0,a=null;for(i=0;i<s.dialogs.length;i++)(o=s.dialogs[i].dialog.css("z-index"))>r&&(r=o,a=s.dialogs[i].dialog);e.helper.css("z-index",r),a.css("z-index",n)}},i.dragHandle?r.handle=i.dragHandle:i.hideTitle||(r.handle="._tv-dialog-title"),i.dragOptions&&$.extend(r,i.dragOptions),c(o).draggable(s._constrainDraggableOptionsIfNeeded(r)),o)},positionDialog:function(t,e,i){function o(){n.css("margin-left",-Math.round(n.outerWidth()/2)+"px"),n.css("margin-top",-Math.round(n.outerHeight()/2)+"px")}var n,r,a,l,c,h,u,d;i=i||{},e=e||i.position,t?(r=t.width(),a=t.height(),l=$(window).width(),c=$(window).height(),e&&e.top&&e.left?(u=i.forcePosition?e.left:Math.max(2,Math.min(l-r-4,e.left))+"px",h=i.forcePosition?e.top:Math.max(2,Math.min(c-a-4,e.top))+"px"):e&&e.considerScroll?(d=$(document),u=Math.round((l-r)/2+d.scrollLeft())+"px",h=Math.round((c-a)/2+d.scrollTop())+"px"):(u=Math.round((l-r)/2)+"px",h=Math.round((c-a)/2)+"px"),i.fadeIn?t.css({left:u,top:h}).hide().fadeIn("fast"):i.smooth?t.animate({left:u,top:h}):t.css({left:u,top:h})):(t=s.modalDialog,n=t.find("._tv-dialog"),o(),n.resize(o))},applyHandlers:function(t,e){var i,o,n=!t||t===this.modalDialog;e=e||{},i=n?function(){s.destroy()}:function(){s.destroy(t.data("title"))},t=t||s.modalDialog.find("._tv-dialog"),e.beforeDestroy&&t.on("destroy",e.beforeDestroy),t.find("._tv-dialog-title ._tv-dialog-title-close, .js-dialog-close").on("click",function(t){e.closeHandler&&"function"==typeof e.closeHandler?e.closeHandler(t):i()}),e.doNotCloseOnBgClick||setTimeout(function(){t.on("mousedownoutside",function(o){var n=$(o.target).parents().andSelf();e.doNotCloseOnBgClickIfShadowbox&&n.is("._tv-dialog-shadowbox, .tv-dialog__modal-wrap")||n.is(".colorpicker, .charts-popup-list, ._tv-dialog, .tvcolorpicker-popup, .symbol-edit-popup, .ui-datepicker, .clockpicker-popover, .pac-container")||(t.unbind("mousedownoutside"),i())})},0),
t.find('input[type="checkbox"]').change(function(){var t=$(this);t.next("._tv-dialog-checkbox-mask").toggleClass("disabled",t.prop("disabled")).toggleClass("_tv-dialog-checkbox-mask-active",t.is(":checked"))}),o=t.find('input[type="text"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}).first(),Modernizr.touch||e.notFocusFirst||o.focus(),t.find('input[type="password"]').focus(function(){$(this).addClass("_tv-dialog-content-textactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textactive")}),t.find("textarea").focus(function(){$(this).addClass("_tv-dialog-content-textareaactive")}).blur(function(){$(this).removeClass("_tv-dialog-content-textareaactive")}),t.find("._tv-dialog-checkbox-mask").click(function(){var t=$(this).prev();t.prop("disabled")||(t.prop("checked",!t[0].checked),t.change())}),e.doNotCloseOnEsc||$(window).bind("keyup.hideDialog",function(e){if(27===e.keyCode)return t?s.destroy(t.data("title")):s.destroy(),!1}),e.processEnterButton&&$(window).bind("keyup.confirmAndCloseDialog",function(t){13===t.keyCode&&"textarea"!==t.target.tagName.toLowerCase()&&(e.processEnterButton.click(),$(window).unbind("keyup.confirmAndCloseDialog"))})},showError:function(t,e,i){s.showMessage(t,e,$.extend(i||{},{isError:!0}))},showMessage:function(t,e,i){var o,n,r;e||(e=$("._tv-dialog")),i=i||{},o=i.isError&&"_tv-dialog-error"||"_tv-dialog-message",n=e.find("."+o),r=n.find(".message"),i.html?r.html("string"==typeof i.html?i.html:t):r.text(t),r.css("width",e.width()).toggleClass("selectable",!!i.selectable),n.toggleClass("with-close",!!i.withClose).css({marginTop:s.NOTIFICATION_ANIMATION_START_OFFSET,opacity:"0"}).show().animate({marginTop:0,opacity:1},"fast"),i.withClose||(i.hideWithoutAnimation?n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.hide(),n.off("touchstartoutside mousedownoutside keydownoutside",t)}):n.on("touchstartoutside mousedownoutside keydownoutside",function t(){n.animate({marginTop:s.NOTIFICATION_ANIMATION_START_OFFSET,opacity:0},"fast",function(){n.hide()}),n.off("touchstartoutside mousedownoutside keydownoutside",t)}))},isOpen:function(t){for(var e=0;e<s.dialogs.length;e++)if(s.dialogs[e].title===t)return!0;return!1},get:function(t){for(var e=0;e<s.dialogs.length;e++)if(s.dialogs[e].title===t)return s.dialogs[e].dialog},submit:function(t,e){var i=e?$(e):$("._tv-dialog form").first(),o=i.serialize(),n=i.attr("action");$.post(n,o,function(e){void 0!==t&&t(e)},"json")},destroy:function(t,e){if(void 0!==s.chart&&(s.chart.destroy(),delete s.chart),$(window).unbind("keyup.hideDialog"),$(window).unbind("keyup.confirmAndCloseDialog"),t&&"string"==typeof t)for(var i=0;i<s.dialogs.length;i++)s.dialogs[i].title===t&&(s.dialogs[i].dialog.find(".apply-common-tooltip").mouseout(),s.dialogs[i].dialog.trigger("destroy",e),$(document).unbind("mouseup.hideDialog"+s.dialogs[i].id),$("input",s.dialogs[i].dialog).blur(),s.dialogs[i].dialog.remove(),
s.dialogs.splice(i,1));else s.modalDialog&&(s.modalDialog.find(".apply-common-tooltip").mouseout(),s.modalDialog.find("._tv-dialog").trigger("destroy"),s.modalDialog.remove(),s.modalDialog=null)},changeTitle:function(t,e){t&&s.dialogs.forEach(function(i){var o,n;if(i.title===t)return o=i.dialog,n=o.find("._tv-dialog-title"),i.title=e,o.data("title",e),n.html(n.html().replace(t,e)),n.find("a").on("click",function(){s.destroy(e)}),!0})},toggleTitleEl:function(t,e){s.dialogs.filter(function(e){return e.title===t}).map(function(t){return t.dialog}).forEach(function(t){var i=t.find("._tv-dialog-title");"boolean"!=typeof e&&(e=i.hasClass("_tv-dialog-title-hidden")),i.toggleClass("_tv-dialog-title-hidden",!e)})},calcHeight:function(t,e,i){null==i&&(i=20),t+=i;var o=parseInt($("body").height(),10);return t>o&&(e-=t-o,e=Math.max(0,e)),e},resizeContent:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($("body").height(),10),n=e.height(),t>o&&(n-=t-o,n=Math.max(0,n),e.height(n))},resizeContentWidth:function(t,e,i){var o,n;null==i&&(i=20),t+=i,o=parseInt($(window).width(),10),n=e.width(),t>o&&(n-=t-o,n=Math.max(0,n),e.width(n))}},s.ideaDialogs={dialogs:[],add:function(t){s.ideaDialogs.dialogs.push(t)},remove:function(t){s.ideaDialogs.dialogs=$.grep(s.ideaDialogs.dialogs,function(e){return""+e!=""+t})},clear:function(){s.ideaDialogs.dialogs.forEach(function(t){s.destroy(t)})},getDraggableEmptyTitle:function(){return $(document.createElement("div")).css({height:"30px","margin-bottom":"-10px",position:"relative"})}},void 0!==o&&o&&o.exports&&(o.exports=s)}).call(e,i(5),i(41),i(42)(t))},function(t,e,i){"use strict";function o(t){var e=t.type||"popup";return delete t.type,"modal"===e?new n.TVModal(t):new r.TVPopup(t)}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),n=i(585),r=i(592),e.createDialog=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(586);e.TVModal=o.TVModal,e.isOpenedModals=o.isOpenedModals},function(t,e,i){"use strict";(function(t){function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function l(){return 0!==S.length}var c,h,u,d,p,_,f,m,g,v,y,b,S,w;Object.defineProperty(e,"__esModule",{value:!0}),e.TVModal=void 0,c=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e]
;for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},h=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.isOpenedModals=l,u=i(31),d=n(u),p=i(201),_=o(p),f=i(202),m=i(172),g=i(147),v=n(g),y=i(121),b=n(y),S=[],w={ajax:{},closingDuration:d.dur/2,overlayTemplate:'<div class="tv-dialog__overlay"></div>',containerTemplate:'<div class="tv-dialog__modal-wrap"><div class="tv-dialog__modal-container"><div class="tv-dialog__modal-body"></div></div></div>',ajaxErrorTemplate:'<div class="tv-dialog__error js-dialog__close">'+$.t("Error")+"</div>"},e.TVModal=function(e){function i(){var t,e,o,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(this,i),t=s(this,(i.__proto__||Object.getPrototypeOf(i)).call(this,c({},w,a))),t.$overlay=$(t.options.overlayTemplate),t.$modalWrap=$(t.options.containerTemplate),t.$body=t.$modalWrap.find(".tv-dialog__modal-body").append(t.$el),t.options.closeOnOutsideClick&&t.$overlay.add(t.$modalWrap).click(function(e){t.isEventOut(e)&&t.close()}),t.on("change:zIndex",function(){t.$overlay.css("z-index",t.zIndex),t.$modalWrap.css("z-index",t.zIndex)}),t.on("destroy",function(){var e=function(){t.$overlay.remove(),t.$modalWrap.remove()};t.opened?(t.close(),setTimeout(e,t.options.closingDuration)):e()}),t.on("beforeOpen",function(){S.push(t)}),t.options.ajax.url&&(e=t.options.ajax.beforeSend||$.noop,o=t.options.ajax.success||!1,n=t.options.ajax.error||$.noop,$.extend(t.options.ajax,{beforeSend:function(){t.trigger("beforeLoading",[t]),t.startSpinner(),e(t)},success:function(e){t.trigger("afterLoading",[t]),t.renderContent(o?o(t,e):e).showContent(),t.trigger("afterLoadingShow",[t])},error:function(){t.renderContent(t.options.ajaxErrorTemplate),n(t),t.trigger("errorLoading",[t])}})),t.on("error",function(e,i){t.$modalWrap[0].getBoundingClientRect().height<t.$content[0].getBoundingClientRect().height&&i.addClass("i-fixed").css({width:t.$el.width()})}),t}return a(i,e),h(i,[{key:"open",value:function(){var t,e=this;if(!this.opened)return this.opened=!0,v.disable(),b.disable(),_.default.setFixedBodyState(!0),t=function(){e.focus(),e.toTop(),$("body").append(e.$overlay.addClass("i-hidden i-closed").css("z-index",e.zIndex)).append(e.$modalWrap.addClass("i-hidden i-closed").css("z-index",e.zIndex)),e.trigger("beforeOpen",[e]),e.$overlay.removeClass("i-hidden"),setTimeout(function(){e.$overlay.removeClass("i-closed")},20),e.options.ajax.url?e.ajaxRequest=$.ajax(e.options.ajax):e.showContent()},_.default.isMobileSafari?setTimeout(function(){return t()},50):t(),this}},{key:"close",value:function(){var e=this;if(this.opened)return this.opened=!1,v.enable(),b.enable(),this.trigger("beforeClose",[this]),this.ajaxRequest&&(this.ajaxRequest.abort(),delete this.ajaxRequest),this.hideContent(),this.$overlay.addClass("i-closed"),setTimeout(function(){e.$modalWrap.addClass("i-hidden").detach(),
e.$overlay.addClass("i-hidden").detach(),S=t.without(S,e),_.default.setFixedBodyState(!1),e.trigger("afterClose",[e]),e.unfocus(),S.length>0&&S[S.length-1].focus(),e.options.destroyOnClose&&e.destroy()},this.options.closingDuration),this}},{key:"showContent",value:function(){var t=this;return this.$modalWrap.removeClass("i-hidden"),setTimeout(function(){t.$modalWrap.removeClass("i-closed")},20),setTimeout(function(){t.trigger("afterOpen",[t]),t.spinner&&t.stopSpinner()},.75*d.dur+20),this}},{key:"hideContent",value:function(){if(this.$el)return this.$modalWrap.addClass("i-closed"),this.unfocus(),this}},{key:"startSpinner",value:function(){return this.spinner=(0,m.unifiedSpinner)("xlarge",{color:d.color.black255,zIndex:!1}),this.spinner.spin(this.$overlay[0]),this}},{key:"stopSpinner",value:function(){if(this.spinner)return this.spinner.stop(),delete this.spinner,this}}]),i}(f.TVDialogAbstract)}).call(e,i(118))},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.breakpoints={desktop:1/0,desktopHd:1919,phone:767,"phone-vertical":479,tablet:1019}},function(t,e,i){"use strict";(function(t,o){function n(t){return t&&t.__esModule?t:{default:t}}function r(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function l(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function c(){y.forEach(function(t){return t.close()})}var h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P;Object.defineProperty(e,"__esModule",{value:!0}),e.TVDialogAbstract=void 0,h=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},u=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),e.closeAllDialogs=c,d=i(31),p=r(d),i(589),_=i(204),f=n(_),i(590),i(591),m=i(91),g=n(m),v=0,y=[],b=void 0,S=110,w=$(document),T={closeOnEsc:!0,closeButton:!0,focusFirstControl:!0,closeOnOutsideClick:!0,closeButtonAddClass:"",focusClass:"i-focused",template:'<div class="tv-dialog">',errorTemplate:'<div class="tv-dialog__error i-slided{{# errorMod }} tv-dialog__error--{{ errorMod }}{{/ errorMod }}">{{{ error }}}</div>',titleTemplate:'<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag"><div class="js-title-text tv-dialog__title">{{{ title }}}</div></div>',
contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border">',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--no-border">',closeButtonTemplate:'<div class="tv-dialog__close js-dialog__close">'+i(169)+"</div>",helpButtonTemplate:'<a href="{{{ link }}}" target="_blank" class="tv-dialog__help apply-common-tooltip" title="{{{ title }}}"></a>',helpActionsMod:"tv-dialog__section--actions_with-help"},C={default:"tv-button tv-button--default",primary:"tv-button tv-button--primary",success:"tv-button tv-button--success",danger:"tv-button tv-button--danger",warning:"tv-button tv-button--warning",link:"tv-button tv-button--link",checkbox:"tv-control-checkbox tv-control-checkbox--in-actions","default-ghost":"tv-button tv-button--default_ghost","primary-ghost":"tv-button tv-button--primary_ghost","success-ghost":"tv-button tv-button--success_ghost","danger-ghost":"tv-button tv-button--danger_ghost","warning-ghost":"tv-button tv-button--warning_ghost"},x={_default:'<div data-name="{{ name }}" class="js-dialog__action-click js-dialog__no-drag {{ class }}">{{ text }}</div>',"submit-success":'<button type="submit" class="tv-button tv-button--success">{{ text }}</button>'},$(function(){T.$wrap=$(document.all&&!document.querySelector?"html":"body")}),P=function(e){function i(){var e,o,n,r,l,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(s(this,i),e=a(this,(i.__proto__||Object.getPrototypeOf(i)).call(this)),e._id=v++,e.loadingActions=[],e.disabledActions=[],e.firstFocusControl=null,e.options=h({},T,c),e.$el=$(t.render(e.options.template,{title:e.options.title,closeButton:e.options.closeButton})),e.$el.addClass("js-dialog"),e.el=e.$el[0],e.options.addClass&&e.$el.addClass(e.options.addClass),e.options.width&&e.$el.css({width:"100%","max-width":e.options.width}),e.options.title&&(e.$title=$(t.render(e.options.titleTemplate,{title:e.options.title})).appendTo(e.$el)),e.$content=$(e.options.contentWrapTemplate).appendTo(e.$el),e.$contentIn=e.$content;e.$contentIn.length;)e.$contentIn=e.$contentIn.children();if(e.$contentIn=e.$contentIn.end(),e.options.content&&e.renderContent(e.options.content),(e.options.actions||e.options.help)&&(e.$content.hasClass("tv-dialog__section")&&e.$content.addClass("tv-dialog__section--no-padding_bottom"),e.$actions=$(e.options.actionsWrapTemplate).appendTo(e.$el)),e.options.actions)for(e.actions={},e.$el.on("click touchend",".js-dialog__action-click",function(t){t.preventDefault(),e.actionDispatcher($(t.currentTarget).data("name"))}),o=function(i){var o,n,r,s,a,l,c=e.options.actions[i];c.type||(c.type="default"),c.class||(c.class=C[c.type]?C[c.type]:C.default),"checkbox"===c.type?(o=new f.default({labelRight:c.text,name:c.name,checked:c.checked}),e.actions[c.name]=o.$el.appendTo(e.$actions),e.actions[c.name].on("change",function(t){setTimeout(function(){return TVSettings.setValue("publish.showIntroText",!o.checked)},0)})):e.actions[c.name]=$(t.render(c.template?c.template:x[c.type]||x._default,c,c)).appendTo(e.$actions),
c.method&&"function"==typeof e[c.method]&&e.on("action:"+c.name,e[c.method].bind(e)),c.addClass&&e.actions[c.name].addClass(c.addClass),c.key&&(n=void 0,"string"==typeof c.key&&c.key.split("+").length>1?(r=[],s=c.key.split("+"),n=function(t){r=[]},a=function(t){var i=""+t.keyCode;-1!==s.indexOf(i)&&r.indexOf(i)&&r.push(i),e._focused&&r.length===s.length&&(r=[],e.actionDispatcher(c.name))},e.on("afterOpen",function(){w.on("keydown",a),w.on("keyup",n)}),e.on("beforeClose",function(){w.off("keydown",a),w.off("keyup",n)})):(l=$.isArray(c.key)?c.key:[c.key],n=function(t){e._focused&&-1!==l.indexOf(t.keyCode)&&e.actionDispatcher(c.name)},e.on("afterOpen",function(){return w.on("keyup",n)}),e.on("beforeClose",function(){return w.off("keyup",n)})))},n=e.options.actions.length-1;n>=0;n--)o(n);return e.options.help&&$(t.render(e.options.helpButtonTemplate,e.options.help)).prependTo(e.$actions.addClass(e.options.helpActionsMod)),e.options.closeButton&&(r=$(e.options.closeButtonTemplate),r.addClass(e.options.closeButtonAddClass||""),l=e.$el,1===e.$el.find(".js-close-button-place").length&&(l=e.$el.find(".js-close-button-place")),r.appendTo(l)),e.setZIndex(S+y.length),c.errorMod&&(e.errorMod=c.errorMod),e.on("afterOpen",function(){e.options.focusFirstControl&&!Modernizr.touch&&(e.firstFocusControl||e.$el.find('input:not([type="hidden"]), textarea').first()).focus()}),e.$el.on("click touchend",".js-dialog__close",e.close.bind(e)),e.$el.on("mousedown touchstart",e.focus.bind(e)),y.push(e),e}return l(i,e),u(i,[{key:"renderContent",value:function(t){return this.$contentIn.html("function"==typeof t?t(this):t),this}},{key:"setDestroyOnClose",value:function(t){this.options.destroyOnClose=t}},{key:"setZIndex",value:function(t){return this.zIndex=t,this.trigger("change:zIndex",[this]),this}},{key:"toTop",value:function(){for(var t=y.length-1;t>=0;t--)y[t].zIndex>this.zIndex&&y[t].setZIndex(y[t].zIndex-1);return this.setZIndex(S+y.length),this}},{key:"isEventOut",value:function(t){var e,i,o;return this.options.isClickOutFn&&void 0!==(e=this.options.isClickOutFn(t))?e:(i=!0,o=$(t.target),o.get(0)!==this.$el.get(0)&&($(">*",this.$el).each(function(){o.get(0)===$(this).get(0)&&(i=!1),0===o.closest("HTML",$(this).get(0)).length&&(i=!1)}),i))}},{key:"focus",value:function(){var t=this;b&&b!==this&&b.unfocus(),this._setFocused(),this._focused=!0,this.$el.addClass(this.options.focusClass),this.trigger("focus",[this]),setTimeout(function(){w.on("mousedown.tv-dialog-unfocus-"+t._id,function(e){t.isEventOut(e)&&(t.unfocus(),w.off("mousedown.tv-dialog-unfocus-"+t._id))})},20)}},{key:"_setFocused",value:function(){b!==this&&(b=this)}},{key:"_setUnfocused",value:function(){b===this&&(b=void 0)}},{key:"unfocus",value:function(){b===this&&(this._setUnfocused(),this._focused=!1,this.$el.removeClass(this.options.focusClass).find(":focus").blur(),this.trigger("unfocus",[this]))}},{key:"isFocused",value:function(){return this._focused}},{key:"setTitle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1]
;return this.$title.toggleClass("tv-dialog__section--one-line apply-overflow-tooltip",e),this.$title.html(t),this}},{key:"setTitleText",value:function(t){this.$title.find(".js-title-text").text(t)}},{key:"actionDispatcher",value:function(t){this.disabledActions.includes(t)||this.loadingActions.includes(t)||this.trigger("action:"+t,[this])}},{key:"toggleAction",value:function(t,e){return!e&&this.disabledActions.includes(t)?this.disabledActions.push(t):e&&this.disabledActions.includes(t)&&(this.disabledActions=o.without(this.disabledActions,t)),this.actions[t].toggleClass("i-disabled",!e),this}},{key:"actionLoader",value:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"init";return this.actions[t].tvButtonLoader(i),"init"===i&&(this.actions[t].off("tv-button-loader:start.dialog-action").on("tv-button-loader:start.dialog-action",function(){e.loadingActions.push(t)}),this.actions[t].off("tv-button-loader:stop.dialog-action").on("tv-button-loader:stop.dialog-action",function(){e.loadingActions=o.without(e.loadingActions,t)})),this}},{key:"error",value:function(e){var i=$(t.render(this.options.errorTemplate,{error:e,errorMod:this.errorMod})).appendTo(this.$el),o=function(){i.addClass("i-slided"),setTimeout(function(){return i.remove()},.75*p.dur)};return setTimeout(function(){return i.removeClass("i-slided")},20),w.one("touchstart mousedown keydown",o),this.trigger("error",[this,i]),this}},{key:"destroy",value:function(){y=o.without(y,this);for(var t=0;t<y.length;t++)y[t].setZIndex(S+t);this.trigger("destroy",[this])}},{key:"isOpened",value:function(){return!!this.opened}}]),i}(g.default),e.TVDialogAbstract=P,w.on("keyup.tv-dialog-esc",function(t){b&&b.options.closeOnEsc&&!$(".tv-dropdown__body.i-opened").length&&!$(t.target).closest(".js-dialog-skip-escape").length&&27===t.keyCode&&b.close()})}).call(e,i(41),i(118))},function(t,e,i){"use strict";function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),e.ButtonLoader=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(203),a=i(31),l=o(a),$.fn.tvButtonLoader=(0,s.createTvBlockWithInstance)("tv-button-loader",function(t,e){return new c(t,e)}),c=e.ButtonLoader=function(){function t(e,i){n(this,t),this.$btn=$(e).addClass("tv-button--loader"),0===this.$btn.find(".tv-button__loader").length&&this.$btn.html('<span class="tv-button__text">'+this.$btn.html()+'</span><span class="tv-button__loader"><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span><span class="tv-button__loader-item"></span></span>'),this.loading=this.$btn.hasClass("i-loading")}return r(t,[{
key:"_start",value:function(){var t=this;this.starting=!0,this.$btn.addClass("i-start-load"),this.$btn.trigger("tv-button-loader:start"),setTimeout(function(){t.loading=!0,t.starting=!1,t._startPromise=!1,t.$btn.addClass("i-loading"),t.$btn.removeClass("i-start-load"),t._stopPromise&&t._stop()},2*l.dur)}},{key:"start",value:function(){this.starting||(this.stopping?this._startPromise=!0:this._start())}},{key:"_stop",value:function(){var t=this;this.stopping=!0,this.$btn.addClass("i-stop-load"),this.$btn.trigger("tv-button-loader:stop"),setTimeout(function(){t.loading=!1,t.stopping=!1,t._stopPromise=!1,t.$btn.removeClass("i-loading i-start-load i-stop-load"),t._startPromise&&t._start()},l.dur)}},{key:"stop",value:function(){this.stopping||(this.starting?this._stopPromise=!0:this._stop())}},{key:"toggle",value:function(){this.loading?this.stop():this.start()}},{key:"contentHtml",value:function(t){return t?(this.$btn.find(".tv-button__text").html(t),t):this.$btn.find(".tv-button__text").html()}},{key:"contentNojQuery",value:function(){return this.$btn.get(0)}},{key:"disable",value:function(){this.stop(),this.$btn.addClass("i-disabled")}},{key:"enable",value:function(){this.$btn.removeClass("i-disabled")}}]),t}()},function(t,e){},function(t,e){},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=i(593);e.TVPopup=o.TVPopup},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var l,c,h,u,d,p,_,f,m,g,v,y,b;Object.defineProperty(e,"__esModule",{value:!0}),e.TVPopup=void 0,l=Object.assign||function(t){var e,i,o;for(e=1;e<arguments.length;e++){i=arguments[e];for(o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},c=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(31),u=n(h),d=i(201),p=o(d),_=i(202),f=i(173),m=i(134),g=$("body"),v=$(window),y={closeOnClickAtOtherDialogs:!0,draggable:!0,scrollWrap:'<div class="tv-dialog__scroll-wrap">',scrollWrapInner:'<div class="tv-dialog__scroll-wrap-inner">',withScroll:!0},b="js-dialog__scroll-wrap",e.TVPopup=function(t){function e(){var t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}
;return r(this,e),t=s(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,l({},y,i))),t.$scrollWrap=t.$content.hasClass(b)?t.$content:t.$content.find("."+b),t.$scrollWrap.length?t.$scrollWrapInner=t.$scrollWrap.children().first():(t.$scrollWrap=t.$content.wrap($(t.options.scrollWrap)).parent(),t.$scrollWrapInner=t.$content.wrap($(t.options.scrollWrapInner)).parent()),t.$actions&&t.$scrollWrap.addClass("i-with-actions"),t.options.withScroll&&(t.scroll=new f.SidebarCustomScroll(t.$scrollWrap,t.$scrollWrapInner),t.scroll.scrolled.subscribe(null,function(){return t.trigger("scroll")})),t.$scrollWrap.css("overflow",""),t.$el.addClass("tv-dialog--popup i-closed i-hidden"),t.options.width&&t.$el.css({width:"calc(100% - 20px)","max-width":t.options.width}),t.$el.on("mousedown touchstart",t.toTop.bind(t)),t.options.closeOnOutsideClick&&(t.on("beforeOpen",function(){setTimeout(function(){t.opened&&$(document).on("click.tv-popup-"+t.id,function(e){var i=$(e.target).closest(".js-dialog");(t.options.closeOnClickAtOtherDialogs||0===i.length)&&t.isEventOut(e)&&t.close()})},0)}),t.on("beforeClose",function(){return $(document).off("click.tv-popup-"+t.id)})),t.on("change:zIndex",function(){t.$el.css("z-index",t.zIndex)}),t.on("destroy",function(){var e=function(){t.$el.remove()};t.opened?(t.close(),setTimeout(e,u.dur/2)):e()}),t}return a(e,t),c(e,[{key:"open",value:function(){var t=this;return this.opened?this:(this.opened=!0,this.trigger("beforeOpen",[this]),this.$el.appendTo(this.options.$wrap).removeClass("i-hidden").css(function(){var e,i,o,n,r;return t.calcHeight(),e=v.height(),i=v.width(),o=t.$el.height(),n=t.$el.width(),r=t.options.position,r||(r={top:e/2-o/2,left:i/2-n/2}),r.top>e-o&&(r.top=e-o),r.left>i-n&&(r.left=i-n),r}()),this.focus(),this.toTop(),this._doOpenAnimation().then(function(){t.opened&&(t.$el.removeClass("i-closed"),t.options.draggable&&((0,m.lazyJqueryUI)(t.$el).draggable({handle:".js-dialog__drag",cancel:"input, textarea, button, select, option, .js-dialog__no-drag, .js-dialog__close",containment:"window",cursor:"-webkit-grabbing"}),t.$el.find(".js-dialog__drag").addClass("tv-dialog__grab")),t.trigger("afterOpen",[t]))}),v.on("resize.tv-popup-"+this.id,function(){t.calcHeight(),t.fixPos()}),this)}},{key:"close",value:function(){var t=this;if(this.opened)return this.trigger("beforeClose",[this]),this.$el.addClass("i-closed"),this.opened=!1,this._doCloseAnimation().then(function(){t.opened||((0,m.lazyJqueryUI)(t.$el).draggable("instance").then(function(t){t&&t.destroy()}),t.$el.addClass("i-hidden").detach(),g.css("cursor","auto"),t.trigger("afterClose",[t]),t.options.destroyOnClose&&t.destroy())}),v.off("resize.tv-popup-"+this.id),this}},{key:"hide",value:function(){this.$el.addClass("i-hidden")}},{key:"show",value:function(){this.$el.removeClass("i-hidden")}},{key:"fixPos",value:function(){var t=this.$el[0].getBoundingClientRect(),e={};t.bottom>p.default.height-10&&(e.top=p.default.height-10-t.height,e.top<10&&(e.top=10)),t.right>p.default.width-10&&(e.left=p.default.width-10-t.width,
e.left<10&&(e.left=10)),(e.top||e.left)&&this.$el.css(e)}},{key:"calcHeight",value:function(){var t,e,i=this.$el[0].getBoundingClientRect(),o=this.$scrollWrapInner[0].getBoundingClientRect(),n=this.$scrollWrap[0].getBoundingClientRect(),r=this.options.height&&this.options.height<p.default.height-20?this.options.height:p.default.height-20;this.$scrollWrap.css({height:""}).removeClass("i-scrollable"),t=this.$el[0].getBoundingClientRect(),(this.options.height||t.height>r)&&(r-=i.height-n.height,r<60&&(r=60),this.$scrollWrap.css({height:r})),this.options.withScroll&&this.scroll.resize(),e=r<o.height,e||this.$scrollWrapInner.css("top",0),this.$scrollWrap.toggleClass("i-scrollable",e),this.$actions&&this.$actions.toggleClass("tv-dialog__section--actions_with-border",e)}},{key:"updateScroll",value:function(){this.scroll&&(this.scroll.updateScroll(),this.scroll.updateScrollBar())}},{key:"scrollToStart",value:function(){this.scroll&&this.scroll.scrollToStart()}},{key:"_doOpenAnimation",value:function(){return Promise.resolve()}},{key:"_doCloseAnimation",value:function(){return Promise.resolve()}}]),e}(_.TVDialogAbstract)},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 973.125"><path d="M960 832L710.875 582.875C746.438 524.812 768 457.155 768 384 768 171.97 596 0 384 0 171.97 0 0 171.97 0 384c0 212 171.97 384 384 384 73.156 0 140.812-21.562 198.875-57L832 960c17.5 17.5 46.5 17.375 64 0l64-64c17.5-17.5 17.5-46.5 0-64zM384 640c-141.375 0-256-114.625-256-256s114.625-256 256-256 256 114.625 256 256-114.625 256-256 256z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28"><path fill="#ffffff" d="M18 10V0h-8v10H0v8h10v10h8V18h10v-8"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg"><line x2="100%" y2="100%"/><line x2="100%" y1="100%"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30 14" width="25" height="14" style="position:relative;top:3px"><path d="M10.43 8.683L9.345 8.68c-.943-.005-1.712-.774-1.716-1.717-.003-.452.172-.877.49-1.195.32-.32.744-.493 1.196-.492l4.002.016c.83.004 2.22.18 2.225 1.316.002.522.427.943.95.942.52-.002.942-.427.94-.95-.007-1.932-1.62-3.188-4.107-3.198l-4.003-.016c-.96-.003-1.862.368-2.54 1.045-.677.68-1.048 1.58-1.044 2.54.003.99.41 1.887 1.06 2.54.652.65 1.55 1.056 2.54 1.06l1.086.004c.522.002.947-.42.948-.942.002-.52-.42-.946-.942-.947zm13.832-1.655c-.008-2.076-1.41-3.59-3.33-3.597l-1.357-.003c-.522-.002-.947.42-.948.942-.002.52.42.946.94.947l1.356.006c.996.003 1.445.863 1.448 1.714.004.453-.17.878-.49 1.196-.317.32-.742.493-1.195.492l-4.27-.017c-1.952-.008-1.955-.924-1.957-1.315-.002-.522-.426-.943-.948-.942-.523.003-.945.428-.943.95.004.896.296 1.63.834 2.17.66.66 1.69 1.023 3.01 1.028l4.27.017c.96.003 1.86-.368 2.54-1.046.675-.678 1.046-1.58 1.043-2.54z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 9 9" width="9px" height="9px"><path d="M2 1L1 2l2.5 2.5L1 7l1 1 2.5-2.5L7 8l1-1-2.5-2.5L8 2 7 1 4.5 3.5z"/></svg>'},function(t,e,i){"use strict";function o(){return"www.tradingview.com"===location.host||"wwwcn.tradingview.com"===location.host||"dwq4do82y8xi7.cloudfront.net"===location.host||"s.tradingview.com"===location.host||"i18n.tradingview.com"===location.host||"partial.tradingview.com"===location.host||location.host.match(/^[a-z]{2}\.tradingview\.com/)||location.host.match(/prod-[^.]+.tradingview.com/)?"battle":-1!==location.href.indexOf("tradingview.com")?"staging":location.host.match(/webcharts/)?"staging_local":(location.host.match(/^localhost(:\d+)?$/),"local")}function n(){return"local"===o()}function r(){return"battle"===o()}function s(){return!r()}Object.defineProperty(e,"__esModule",{value:!0}),e.environment=o,e.isLocal=n,e.isProd=r,e.isDebug=s},function(t,e,i){"use strict";TradingView.PublishedChartsTimeline=function(){},TradingView.LinearRegressionPaneView=function(){},TradingView.study_PivotPointsStandard=function(){},TradingView.study_PivotPointsHighLow=function(){},TradingView.study_ZigZag=function(){},TradingView.study_LinearRegression=function(){},TradingView.study_ElliottWave=function(){},TradingView.ESDStudyBase=function(){},TradingView.Pro=function(){this.hasPackage=function(){return!1}},window.user={is_pro:!1,settings:{}},TradingView.Pro.prototype.getStudies=function(){return[]},TradingView.Pro.prototype.getProduct=function(){return{}},TradingView.Pro.prototype.getStudiesOrder=function(){return[]},TradingView.templates=i(205),TradingView.templates.dialogs={symbolSearch:'<div class="symbol-block"><div class="spread-actions"></div><div class="symbol-block-inputspacer"><input maxlength="'+TradingView.SYMBOL_SEARCH_MAX_LENGTH+'" /><div class="search-icon"></div></div></div><div class="filter"></div><div class="results"></div>'},TradingView.AlertLabel=function(){},TradingView.getDataVendorString=function(){},window.Telemetry={sendReport:function(){}},TradingView.study_VbPVisible=function(){},TradingView.study_VbPSessions=function(){},TradingView.study_ESD$TV_DIVIDENDS=function(){},TradingView.study_ESD$TV_SPLITS=function(){},TradingView.study_ESD$TV_EARNINGS=function(){},TradingView.MockupRequestedCache=function(t){t&&t([])},TradingView.MockupRequestedCache.invalidate=function(){},TradingView.StudyStrategy=function(){},TradingView.LinetoolTemplatesList=function(){},window.PublishedScript={suggest:function(){var t=$.Deferred();return t.resolve(null),t}}},function(t,e,i){"use strict";function o(t){void 0===t&&(t=[]);var e=t.map(function(t){return x[t]})||[d.STYLE_CANDLES,d.STYLE_RENKO,d.STYLE_KAGI,d.STYLE_PNF];return p.isOnFeaturePage()&&!h.enabled("charting_library_base")&&(e=[]),h.enabled("widget")&&(e=[d.STYLE_BARS,d.STYLE_CANDLES,d.STYLE_AREA]),e}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),i(13),r=i(2),s=i(27),a=i(83),l=i(14),c=i(91),h=i(5),u=i(23),d=i(49),p=i(64),
_=i(207),f=i(603),m=i(17),g=i(616),v=i(617),y=i(122),b=i(618),S=i(93),w=i(24),T=i(619),C=i(620),e.HEADER_TOOLBAR_HEIGHT_EXPANDED=parseInt(C["css-value-header-toolbar-height"]),e.HEADER_TOOLBAR_HEIGHT_COLLAPSED=3,x={Area:d.STYLE_AREA,Bars:d.STYLE_BARS,Candles:d.STYLE_CANDLES,"Heiken Ashi":d.STYLE_HEIKEN_ASHI,"Hollow Candles":d.STYLE_HOLLOW_CANDLES,Line:d.STYLE_LINE},P=[],L=["full","medium"],I=function(t){function i(e){var i,n,r,s,a=t.call(this,e)||this;return a._templateSyncEmitter=new c,a._saveLoadSyncEmitter=new c,a._handleFullWidthChange=function(t){a._fullWidth=t,a.setState({measureValid:!1})},a._handleFavoritesWidthChange=function(t){a._favoritesWidth=t,a.setState({measureValid:!1})},a._handleCollapseWidthChange=function(t){a._collapseWidth=t,a.setState({measureValid:!1})},a._handleMeasure=function(t){var e=t.width;a.setState({availableWidth:e,measureValid:!1})},a._showScrollbarWhen=e.allowedModes.slice(-1),i=e.chartWidgetCollection,n=e.chartSaver,a._chartChangesWatcher=new b.ChartChangesWatcher(i.undoHistory,n,u),r=o(a.props.defaultFavoriteStyles),a._favoriteChartStylesService=new g.FavoriteChartStylesService(S.TVXWindowEvents,w,r),s=y.getDefaultFavoriteIntervals(a.props.defaultFavoriteIntervals),a._favoriteIntervalsService=new v.FavoriteIntervalsService(S.TVXWindowEvents,w,s),a.state={isVisible:!0,availableWidth:0,displayMode:"full",measureValid:!1,leftCustomButtons:[],rightCustomButtons:[]},a._readOnly=i.readOnly(),a._features={accentScreenshotButton:!!a.props.accentScreenshot,allowFavoriting:h.enabled("items_favoriting"),showIdeasButton:!!a.props.ideas,showLaunchInPopupButton:!!a.props.popupButton,allowSymbolSearchSpread:h.enabled("header_symbol_search")&&!h.enabled("charting_library_base"),allowToolbarHiding:h.enabled("collapsible_header")},a._setDisplayMode=_(a._setDisplayMode,100),a._negotiateResizer(),a}return n.__extends(i,t),i.prototype.getChildContext=function(){var t=this.props,e=t.tools,i=t.windowMessageService,o=t.chartWidgetCollection,n=t.chartApiInstance;return{tools:e,isFundamental:t.isFundamental,chartWidgetCollection:o,windowMessageService:i,chartApiInstance:n,favoriteStudyTemplatesService:t.favoriteStudyTemplatesService,studyTemplates:t.studyTemplates,favoriteChartStylesService:this._favoriteChartStylesService,favoriteIntervalsService:this._favoriteIntervalsService,customIntervalsService:this._customIntervalsService,chartChangesWatcher:this._chartChangesWatcher}},i.prototype.componentDidUpdate=function(t,e){var i=this.state,o=i.isVisible,n=i.measureValid;o!==e.isVisible&&(u.emit("toggle_header",o),this._negotiateResizer()),n||this._setDisplayMode()},i.prototype.render=function(){var t,e=this.props,i=(e.resizerBridge,e.allowedModes),o=n.__rest(e,["resizerBridge","allowedModes"]),s=this.state,c=s.displayMode,h=s.availableWidth,u=s.isVisible,d=s.leftCustomButtons,p=s.rightCustomButtons,_=n.__assign({features:this._features,readOnly:this._readOnly,isFake:!1,templateSyncEmitter:this._templateSyncEmitter,saveLoadSyncEmitter:this._saveLoadSyncEmitter,width:h,leftCustomButtons:d,rightCustomButtons:p
},o),m=n.__assign({},_,{isFake:!0,showScrollbarWhen:P});return r.createElement("div",{className:l(T.toolbar,(t={},t[T.isHidden]=!u,t))},r.createElement("div",{className:T.overflowWrap},r.createElement(a,{onMeasure:this._handleMeasure,whitelist:["width"]},r.createElement(f.ToolbarInner,n.__assign({showScrollbarWhen:this._showScrollbarWhen,displayMode:c},_))),i.includes("full")&&r.createElement(f.ToolbarInner,n.__assign({displayMode:"full",onWidthChange:this._handleFullWidthChange},m)),i.includes("medium")&&r.createElement(f.ToolbarInner,n.__assign({displayMode:"medium",onWidthChange:this._handleFavoritesWidthChange},m)),i.includes("small")&&r.createElement(f.ToolbarInner,n.__assign({displayMode:"small",onWidthChange:this._handleCollapseWidthChange},m))))},i.prototype.addButton=function(t){var e,i,o,n,r,s;return void 0===t&&(t="left"),e=new m(0),i=$('<div class="apply-common-tooltip '+T.customButton+'">'),o={key:+new Date,jquery:i,width:e},n=this.state,r=n.leftCustomButtons,s=n.rightCustomButtons,"left"===t?this.setState({leftCustomButtons:r.concat([o])}):this.setState({rightCustomButtons:s.concat([o])}),i},i.prototype._negotiateResizer=function(){this.props.resizerBridge.negotiateHeight(this.state.isVisible?e.HEADER_TOOLBAR_HEIGHT_EXPANDED:e.HEADER_TOOLBAR_HEIGHT_COLLAPSED)},i.prototype._setDisplayMode=function(){var t,e,i=this.state.availableWidth,o=this.props.allowedModes,n=(e={},e.full=this._fullWidth,e.medium=this._favoritesWidth,e.small=this._collapseWidth,e),r=o.map(function(t){return n[t]}),s=r.findIndex(function(t){return i>=t});-1===s&&(s=o.length-1),t=o[s],this.setState({measureValid:!0,displayMode:t})},i.childContextTypes={tools:s.object.isRequired,isFundamental:s.bool,chartApiInstance:s.object,chartWidgetCollection:s.object,windowMessageService:s.object,favoriteChartStylesService:s.object,favoriteIntervalsService:s.object,customIntervalsService:s.object,favoriteStudyTemplatesService:s.object,studyTemplates:s.object,chartChangesWatcher:s.object},i.defaultProps={allowedModes:L},i}(r.PureComponent),e.HeaderToolbar=I},function(t,e,i){"use strict";function o(t){return[t.findIndex(function(t){return r.isValidElement(t)&&!!t.key&&-1!==(""+t.key).indexOf("view-only-badge")}),t.findIndex(function(t){return r.isValidElement(t)&&!!t.key&&-1!==(""+t.key).indexOf("blue-screenshot")}),t.findIndex(function(t){return r.isValidElement(t)&&!!t.key&&-1!==(""+t.key).indexOf("popup")})].filter(function(t){return t>=0}).forEach(function(e){t=r.Children.map(t,function(t,i){var o,n,s;if(r.isValidElement(t))switch([e-1,e,e+1].indexOf(i)){case 0:o={noRightDecoration:!0},t=r.cloneElement(t,o);break;case 1:n={noLeftDecoration:!0,noRightDecoration:!0},t=r.cloneElement(t,n);break;case 2:s={noLeftDecoration:!0},t=r.cloneElement(t,s)}return t})}),t}var n,r,s,a,l,c,h,u,d,p,_,f,m;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),s=i(27),a=i(14),i(43),l=i(5),c=i(604),h=i(606),u=i(608),d=i(610),p=i(612),_=i(614),f=i(615),m=function(t){function e(e){var i=t.call(this,e)||this;return i._activateSymbolSearchMode=function(){
i._setMode(2)},i._activateNormalMode=function(){i._setMode(1)},i._handleInnerMeasure=function(t){var e=i.props.onWidthChange;e&&e(t)},i._processCustoms=function(t){var e=i.props.isFake,o=i.state.mode,s=i.context.tools;return t.map(function(t){return r.createElement(c.ToolWidgetGroupWrap,{className:a(1!==o&&_.hidden)},r.createElement(s.Custom,n.__assign({},t,{isFake:e})))})},i.state={mode:1},i}return n.__extends(e,t),e.prototype.render=function(){var t,e=this.context.tools,i=this.props,n=i.features,s=i.displayMode,m=i.chartSaver,g=i.studyMarket,v=i.readOnly,y=i.templateSyncEmitter,b=i.saveLoadSyncEmitter,S=i.leftCustomButtons,w=i.rightCustomButtons,T=i.showScrollbarWhen,C=i.width,x=void 0===C?0:C,P=i.isFake,L=void 0!==P&&P,I=this.state.mode,k=this._processCustoms(S),A=this._processCustoms(w),M=T.includes(s);return r.createElement("div",{className:a(_.inner,(t={},t[_.fake]=L,t))},r.createElement(p.HorizontalScroll,{isVisibleFade:Modernizr.touch&&M,isVisibleButtons:!Modernizr.touch&&M,isVisibleScrollbar:!1,shouldMeasure:M&&!L},r.createElement(h.ToolWidgetResizeDetector,{onWidthChange:this._handleInnerMeasure},!v&&r.Children.toArray([e.SymbolSearch&&r.createElement(c.ToolWidgetGroupWrap,{key:"symbol",className:2===I&&_.symbolSearch},r.createElement(e.SymbolSearch,{id:L?void 0:f.HeaderToolbarComponentIds.SymbolSearch,isActionsVisible:n.allowSymbolSearchSpread,isExpanded:2===I,onFocus:this._activateSymbolSearchMode,onBlur:this._activateNormalMode,maxWidth:x})),e.DateRange&&r.createElement(c.ToolWidgetGroupWrap,{key:"range"},r.createElement(e.DateRange,null)),e.Intervals&&1===I&&r.createElement(c.ToolWidgetGroupWrap,{key:"intervals"},r.createElement(e.Intervals,{id:L?void 0:f.HeaderToolbarComponentIds.Intervals,isShownQuicks:n.allowFavoriting,isFavoritingAllowed:n.allowFavoriting,displayMode:s,isFake:L})),e.Bars&&1===I&&r.createElement(c.ToolWidgetGroupWrap,{key:"styles"},r.createElement(e.Bars,{id:L?void 0:f.HeaderToolbarComponentIds.ChartStyles,isShownQuicks:n.allowFavoriting,isFavoritingAllowed:n.allowFavoriting,displayMode:s,isFake:L})),e.Compare&&1===I&&r.createElement(c.ToolWidgetGroupWrap,{key:"compare"},r.createElement(e.Compare,{id:L?void 0:f.HeaderToolbarComponentIds.Compare,className:_.button,displayMode:s})),1===I&&(e.Compare||e.Indicators)&&r.createElement(c.ToolWidgetGroupWrap,{key:"study"},r.createElement("div",{className:_.subGroup},e.Indicators&&r.createElement(e.Indicators,{id:L?void 0:f.HeaderToolbarComponentIds.Indicators,className:_.button,studyMarket:g,displayMode:s}),e.Templates&&r.createElement(e.Templates,{id:L?void 0:f.HeaderToolbarComponentIds.StudyTemplates,isShownQuicks:n.allowFavoriting,isFavoritingAllowed:n.allowFavoriting,displayMode:s,stateSyncEmitter:y,isFake:L}))),1===I&&e.Alert&&r.createElement(c.ToolWidgetGroupWrap,{key:"alert"},r.createElement(e.Alert,{id:L?void 0:f.HeaderToolbarComponentIds.Alerts,className:_.button,displayMode:s})),1===I&&e.AlertReferral&&r.createElement(c.ToolWidgetGroupWrap,{key:"alert-referral"},r.createElement(e.AlertReferral,{className:_.button,displayMode:s
})),1===I&&n.showIdeasButton&&e.Ideas&&r.createElement(c.ToolWidgetGroupWrap,{key:"charts"},r.createElement(e.Ideas,{isShownSettings:!l.enabled("widget")&&!!window.user,displayMode:s})),e.Replay&&1===I&&r.createElement(c.ToolWidgetGroupWrap,{key:"replay"},r.createElement(e.Replay,{className:_.button,displayMode:s})),e.UndoRedo&&1===I&&r.createElement(c.ToolWidgetGroupWrap,{key:"undo-redo"},r.createElement(e.UndoRedo,{id:L?void 0:f.HeaderToolbarComponentIds.UndoRedo})),e.ScalePercentage&&r.createElement(c.ToolWidgetGroupWrap,{key:"percentage"},r.createElement(e.ScalePercentage,null)),e.ScaleLogarithm&&r.createElement(c.ToolWidgetGroupWrap,{key:"logarithm"},r.createElement(e.ScaleLogarithm,null))].concat(k)),1===I?o(r.Children.toArray([v&&r.createElement(c.ToolWidgetGroupWrap,{key:"view-only-badge"},r.createElement(d.ToolWidgetViewOnlyBadge,null)),r.createElement(c.ToolWidgetGroupWrap,{key:"gap",className:a(_.fill)}),!v&&e.Layout&&r.createElement(c.ToolWidgetGroupWrap,{key:"layout"},r.createElement(e.Layout,{id:L?void 0:f.HeaderToolbarComponentIds.Layouts})),e.Screenshot&&!n.accentScreenshotButton&&r.createElement(c.ToolWidgetGroupWrap,{key:"screenshot"},r.createElement(e.Screenshot,{className:_.iconButton})),e.SaveLoad&&r.createElement(c.ToolWidgetGroupWrap,{key:"save-load-right"},r.createElement(e.SaveLoad,{id:L?void 0:f.HeaderToolbarComponentIds.SaveLoad,chartSaver:m,isReadOnly:v,displayMode:s,isFake:L,stateSyncEmitter:b})),e.SaveLoadReferral&&r.createElement(c.ToolWidgetGroupWrap,{key:"save-load-referral"},r.createElement(e.SaveLoadReferral,{isReadOnly:v,displayMode:s})),n.showLaunchInPopupButton&&e.OpenPopup&&r.createElement(c.ToolWidgetGroupWrap,{key:"popup"},r.createElement(e.OpenPopup,{className:a(_.iconButton,_.popupButton)})),e.Screenshot&&n.accentScreenshotButton&&r.createElement(c.ToolWidgetGroupWrap,{key:"blue-screenshot"},r.createElement(e.Screenshot,{color:"blue",className:_.iconButton})),!v&&e.Properties&&r.createElement(c.ToolWidgetGroupWrap,{key:"properties"},r.createElement(e.Properties,{id:L?void 0:f.HeaderToolbarComponentIds.Properties,className:_.iconButton})),!v&&e.Fullscreen&&r.createElement(c.ToolWidgetGroupWrap,{key:"fullscreen"},r.createElement(e.Fullscreen,null))].concat(A))):[r.createElement(c.ToolWidgetGroupWrap,{key:"gap",className:a(_.fill,2===I&&_.minimalPriority)}),r.createElement(c.ToolWidgetGroupWrap,{key:"symbol-search-close"},r.createElement(u.ToolWidgetSymbolSearchCloseButton,{className:_.iconButton}))])))},e.prototype._setMode=function(t){this.setState({mode:t})},e.contextTypes={tools:s.object.isRequired},e}(r.PureComponent),e.ToolbarInner=m},function(t,e,i){"use strict";function o(t){var e,i=t.children,o=t.className,a=t.noLeftDecoration,l=t.noRightDecoration,c=t.noMinimalWidth;return n.createElement("div",{className:r(o,s.group,(e={},e[s.noMinimalWidth]=c,e[s.noLeftDecoration]=a,e[s.noRightDecoration]=l,e))},i)}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(14),s=i(605),e.ToolWidgetGroupWrap=o},function(t,e){t.exports={group:"group-wWM3zP_M-",
noLeftDecoration:"noLeftDecoration-15F5a1TB-",noRightDecoration:"noRightDecoration-2GcAAgVb-",noMinimalWidth:"noMinimalWidth-1sbl_ff5-"}},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(83),s=i(607),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleMeasure=function(t){var i=t.width;e.props.onWidthChange(i)},e}return o.__extends(e,t),e.prototype.render=function(){var t=this.props.children;return n.createElement(r,{onMeasure:this._handleMeasure,whitelist:["width"]},n.createElement("div",{className:s.wrap},t))},e}(n.PureComponent),e.ToolWidgetResizeDetector=a},function(t,e){t.exports={"css-value-header-toolbar-height":"38px",wrap:"wrap-3tiHesTk-"}},function(t,e,i){"use strict";function o(t){return r.createElement(s.ToolWidgetButton,n.__assign({},t,{forceInteractive:!0,icon:a}))}var n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),s=i(103),a=i(609),e.ToolWidgetSymbolSearchCloseButton=o},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 17" width="17" height="17"><path fill="none" stroke="currentColor" d="M1 1l15 15M1 16L16 1"/></svg>'},function(t,e,i){"use strict";function o(){return n.createElement("div",{className:s.wrap},n.createElement(r.Icon,{className:s.icon,icon:a}),l.text)}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),i(12),n=i(2),r=i(59),s=i(611),a=i(302),l={text:window.t("View Only Mode")},e.ToolWidgetViewOnlyBadge=o},function(t,e){t.exports={wrap:"wrap-3K4w_7te-",icon:"icon-1dNdRXKB-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(39),s=i(14),a=i(83),l=i(59),c=i(150),h=i(613),u=i(31),d=i(303),p=function(t){function e(e){var i=t.call(this,e)||this;return i._wrapMeasureRef=null,i._contentMeasureRef=null,i._handleScrollLeft=function(){i.animateTo(Math.max(0,i.currentPosition()-(i.state.widthWrap-50)))},i._handleScrollRight=function(){i.animateTo(Math.min((i.state.widthContent||0)-(i.state.widthWrap||0),i.currentPosition()+(i.state.widthWrap-50)))},i._handleResizeWrap=function(t){var e=t.width;i.setState({widthWrap:e}),i._checkButtonsVisibility()},i._handleResizeContent=function(t){var e=t.width;i.setState({widthContent:e})},i._handleScroll=function(){var t=i.props.onScroll;t&&t(i.currentPosition(),i.isAtLeft(),i.isAtRight()),i._checkButtonsVisibility()},i._checkButtonsVisibility=function(){var t,e,o,n,r;(i.props.isVisibleButtons||i.props.isVisibleFade)&&(t=i.state,e=t.isVisibleLeftButton,o=t.isVisibleRightButton,n=i.isAtLeft(),r=i.isAtRight(),n||e?n&&e&&i.setState({isVisibleLeftButton:!1}):i.setState({isVisibleLeftButton:!0}),r||o?r&&o&&i.setState({isVisibleRightButton:!1}):i.setState({isVisibleRightButton:!0}))},i._setWrapMeasureRef=function(t){i._wrapMeasureRef=t},i._setContentMeasureRef=function(t){i._contentMeasureRef=t},i.state={widthContent:0,widthWrap:0,isVisibleRightButton:!1,isVisibleLeftButton:!1},i}return o.__extends(e,t),
e.prototype.componentDidMount=function(){this._checkButtonsVisibility()},e.prototype.componentDidUpdate=function(t,e){e.widthWrap===this.state.widthWrap&&e.widthContent===this.state.widthContent||this._handleScroll(),this.props.shouldMeasure&&this._wrapMeasureRef&&this._contentMeasureRef&&(this._wrapMeasureRef.measure(),this._contentMeasureRef.measure())},e.prototype.currentPosition=function(){return this._scroll?this._scroll.scrollLeft:0},e.prototype.isAtLeft=function(){return this.currentPosition()<=1},e.prototype.isAtRight=function(){return this.currentPosition()+this.state.widthWrap>=this.state.widthContent-1},e.prototype.animateTo=function(t,e){if(void 0===e&&(e=u.dur),this._scroll){var i=r.findDOMNode(this._scroll);c.doAnimate({onStep:function(t,e){i.scrollLeft=Math.round(e)},from:i.scrollLeft,to:Math.round(t),easing:u.easingFunc.easeInOutCubic,duration:e})}},e.prototype.render=function(){var t,e,i,o,r,c=this,u=this.props,p=u.children,_=u.isVisibleScrollbar,f=u.isVisibleFade,m=u.isVisibleButtons,g=u.shouldMeasure,v=this.state,y=v.widthContent,b=v.widthWrap,S=v.isVisibleRightButton,w=v.isVisibleLeftButton;return n.createElement(a,{whitelist:["width"],onMeasure:this._handleResizeWrap,shouldMeasure:g,ref:this._setWrapMeasureRef},n.createElement("div",{className:h.wrap},n.createElement("div",{className:s(h.scrollWrap,(t={},t[h.noScrollBar]=!_,t)),onScroll:this._handleScroll,ref:function(t){return c._scroll=t}},n.createElement(a,{onMeasure:this._handleResizeContent,whitelist:["width"],shouldMeasure:g,ref:this._setContentMeasureRef},n.createElement("div",{className:h.content},p))),f&&n.createElement("div",{className:s(h.fadeLeft,(e={},e[h.isVisible]=w&&y>b,e))}),f&&n.createElement("div",{className:s(h.fadeRight,(i={},i[h.isVisible]=S&&y>b,i))}),m&&n.createElement("div",{className:s(h.scrollLeft,(o={},o[h.isVisible]=w&&y>b,o)),onClick:this._handleScrollLeft},n.createElement("div",{className:h.iconWrap},n.createElement(l.Icon,{icon:d,className:h.icon}))),m&&n.createElement("div",{className:s(h.scrollRight,(r={},r[h.isVisible]=S&&y>b,r)),onClick:this._handleScrollRight},n.createElement("div",{className:h.iconWrap},n.createElement(l.Icon,{icon:d,className:h.icon})))))},e.defaultProps={isVisibleScrollbar:!0,shouldMeasure:!0},e}(n.PureComponent),e.HorizontalScroll=p},function(t,e){t.exports={wrap:"wrap-1GG7GnNO-",scrollWrap:"scrollWrap-1icOiezT-",noScrollBar:"noScrollBar-2zw2auFK-",content:"content-3_f7yH29-",icon:"icon-2fZsO52g-",scrollLeft:"scrollLeft-3OUcqYWy-",scrollRight:"scrollRight-UDsPWprP-",isVisible:"isVisible-zZk7F7wr-",iconWrap:"iconWrap-1U8J-Qkw-",fadeLeft:"fadeLeft-31arUEZY-",fadeRight:"fadeRight-36gcjOQb-"}},function(t,e){t.exports={fake:"fake-37paHC6T-",inner:"inner-v8eiKwdM-",subGroup:"subGroup-1JpgB9zD-",fill:"fill-2axUON87-",minimalPriority:"minimalPriority-1MGEuVHu-",button:"button-3xrjDzA4-",iconButton:"iconButton-3vyD3BPg-",hidden:"hidden-2kSvETGo-",symbolSearch:"symbolSearch-3I4QF1U_-"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});!function(t){
t.SymbolSearch="header-toolbar-symbol-search",t.Intervals="header-toolbar-intervals",t.ChartStyles="header-toolbar-chart-styles",t.Compare="header-toolbar-compare",t.Indicators="header-toolbar-indicators",t.StudyTemplates="header-toolbar-study-templates",t.Alerts="header-toolbar-alerts",t.Layouts="header-toolbar-layouts",t.SaveLoad="header-toolbar-save-load",t.UndoRedo="header-toolbar-undo-redo",t.Properties="header-toolbar-properties"}(e.HeaderToolbarComponentIds||(e.HeaderToolbarComponentIds={}))},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(174),r=function(t){function e(e,i,o){return void 0===o&&(o=[]),t.call(this,e,i,"FAVORITE_CHART_STYLES_CHANGED","StyleWidget.quicks",o)||this}return o.__extends(e,t),e}(n.CommonJsonStoreService),e.FavoriteChartStylesService=r},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(122),r=i(174),s=i(304),a=function(t){function e(e,i,o){return t.call(this,e,i,"FAVORITE_INTERVALS_CHANGED","IntervalWidget.quicks",o)||this}return o.__extends(e,t),e.prototype._serialize=function(t){return n.convertIntervalsToObject(t.map(n.normalizeIntervalString))},e.prototype._deserialize=function(t){return s(Object.keys(t).map(n.normalizeIntervalString))},e}(r.AbstractJsonStoreService),e.FavoriteIntervalsService=a},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(10),n=function(){function t(t,e,i){this._hasChanges=!1,this._undoHistory=t,this._chartSaver=e,this._globalEvents=i,this._onValueChanged=new o,this._subscribe()}return t.prototype.destroy=function(){this._unsubscribe(),this._onValueChanged.destroy()},t.prototype.hasChanges=function(){return this._hasChanges},t.prototype.getOnChange=function(){return this._onValueChanged},t.prototype._subscribe=function(){this._globalEvents.subscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().subscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().subscribe(this,this._handleChartSaved)},t.prototype._unsubscribe=function(){this._globalEvents.unsubscribe("chart_loaded",this._handleChartLoaded,this),this._undoHistory.undoStack().onChange().unsubscribe(this,this._handleChangeUndoStack),this._chartSaver.chartSaved().unsubscribe(this,this._handleChartSaved)},t.prototype._setChanges=function(t){this._hasChanges=t,this._onValueChanged.fire(t)},t.prototype._handleChartLoaded=function(){this._setChanges(!1)},t.prototype._handleChangeUndoStack=function(){var t=this._undoHistory.undoStack().head();t&&t.customFlag("doesnt_affect_save")||this._setChanges(!0)},t.prototype._handleChartSaved=function(t){t&&this._setChanges(!1)},t}(),e.ChartChangesWatcher=n},function(t,e){t.exports={"css-value-header-toolbar-height":"38px",toolbar:"toolbar-2n2cwgp5-",isHidden:"isHidden-GTob3P_C-",overflowWrap:"overflowWrap-PWdgT-U_-",customButton:"customButton--jqJTfH5-",hovered:"hovered-1mGRUp3y-"}},function(t,e){t.exports={"css-value-header-toolbar-height":"38px"}},function(t,e,i){
"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),i(43),n=i(2),r=i(39),s=i(14),a=i(24),l=i(5),c=i(26),h=i(23),u=i(64),d=i(66),p=i(713),_=i(714),f=i(306),m=i(715),g=i(381),v=i(717),y=i(85),b=i(307),S=i(721),w=i(725),T=i(726),C=i(727),x=i(729),P=i(733),L=i(734),I=i(736),k={hide:window.t("Hide Drawings Toolbar"),show:window.t("Show Drawings Toolbar")},A=u.onWidget(),M=52,E=3,D=function(t){function e(e){var i=t.call(this,e)||this;return i._grayedTools={},i._handleChangeVisibility=function(t){i.setState({isVisible:t})},i._toggleVisibility=function(){f.isDrawingToolbarVisible.setValue(!f.isDrawingToolbarVisible.value())},i._handleEsc=function(){c.resetToCursor(!0)},c.init(),i._toolsFilter=new p.ToolsFilter(i.props.drawingsAccess),i._filteredLineTools=_.lineTools.map(function(t){return t.filter(function(t){return i._toolsFilter.isToolEnabled(d.lineToolsInfo[t.name].localizedName)})}).filter(function(t){return 0!==t.length}),i._filteredLineTools.forEach(function(t){return t.forEach(function(t){i._grayedTools[t.name]=i._toolsFilter.isToolGrayed(d.lineToolsInfo[t.name].localizedName)})}),i.state={isVisible:f.isDrawingToolbarVisible.value()},i._features={favoriting:!A&&l.enabled("items_favoriting"),multicharts:l.enabled("support_multicharts"),tools:!A||l.enabled("charting_library_base")},i._negotiateResizer(),i}return o.__extends(e,t),e.prototype.componentDidMount=function(){f.isDrawingToolbarVisible.subscribe(this._handleChangeVisibility),r.findDOMNode(this).addEventListener("contextmenu",function(t){return t.preventDefault()})},e.prototype.componentWillUnmount=function(){f.isDrawingToolbarVisible.unsubscribe(this._handleChangeVisibility)},e.prototype.componentDidUpdate=function(t,e){var i=this.state.isVisible;i!==e.isVisible&&(h.emit("toggle_sidebar",!i),a.setValue("ChartDrawingToolbarWidget.visible",i),this._negotiateResizer())},e.prototype.render=function(){var t,e=this,i=this.props,o=i.bgColor,r=i.chartWidgetCollection,a=i.readOnly,l=this.state.isVisible,h={backgroundColor:o&&"#"+o};return n.createElement("div",{className:s(I.drawingToolbar,(t={},t[I.isHidden]=!l,t)),style:h},n.createElement(m.VerticalScroll,{onScroll:y.globalClosePopupMenu,isVisibleFade:Modernizr.touch,isVisibleButtons:!Modernizr.touch,isVisibleScrollbar:!1},n.createElement("div",{className:I.inner},!a&&n.createElement("div",{className:I.group,style:h},this._filteredLineTools.map(function(t,i){return n.createElement(x.ToolDropdownDrawings,{chartWidgetCollection:r,favoriting:e._features.favoriting,grayedTools:e._grayedTools,key:i,lineTools:t})}),this._toolsFilter.isToolEnabled("Font Icons")&&n.createElement(S.ToolButtonFontIcons,{isGrayed:this._grayedTools["Font Icons"],toolName:"LineToolIcon"})),!a&&n.createElement("div",{className:I.group,style:h},n.createElement(T.ToolButtonTool,{toolName:"measure"}),n.createElement(T.ToolButtonTool,{toolName:"zoom"}),n.createElement(C.ToolButtonZoomOut,{chartWidgetCollection:r})),!a&&n.createElement("div",{className:I.group,
style:h},n.createElement(w.ToolButtonProperty,{property:c.properties().magnet,saveDefaultOnChange:!0,toolName:"magnet"}),this._features.tools&&n.createElement(w.ToolButtonProperty,{property:c.properties().stayInDrawingMode,saveDefaultOnChange:!0,toolName:"drawginmode"}),this._features.tools&&n.createElement(w.ToolButtonProperty,{property:c.lockDrawings(),toolName:"lockAllDrawings"}),this._features.tools&&n.createElement(w.ToolButtonProperty,{property:c.hideAllDrawings(),toolName:"hideAllDrawings"}),this._features.tools&&this._features.multicharts&&n.createElement(w.ToolButtonProperty,{property:c.drawOnAllCharts(),saveDefaultOnChange:!0,toolName:"SyncDrawing"})),!a&&this._features.tools&&n.createElement("div",{className:I.group,style:h},n.createElement(b.ToolButtonAction,{action:function(){return e._activeChartWidget().showSourceProperties()},toolName:"showObjectsTree"}),n.createElement(P.ToolDropdownRemove,{chartWidgetCollection:r,toolName:"removeAllDrawingTools"})))),n.createElement("div",{className:s(I.toggleButton,"apply-common-tooltip common-tooltip-vertical",!l&&I.collapsed),onClick:this._toggleVisibility,title:l?k.hide:k.show},n.createElement(L.VerticalToolbarHider,{direction:l?"left":"right"})),n.createElement(g.KeyboardDocumentListener,{keyCode:v.KeyCode.Escape,handler:this._handleEsc}))},e.prototype._activeChartWidget=function(){return this.props.chartWidgetCollection.activeChartWidget.value()},e.prototype._negotiateResizer=function(){this.props.resizerBridge.negotiateWidth(this.state.isVisible?M:E)},e}(n.PureComponent),e.DrawingToolbar=D},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20.449 8.505l2.103 9.112.974-.225-2.103-9.112zM13.943 14.011l7.631 4.856.537-.844-7.631-4.856zM14.379 11.716l4.812-3.609-.6-.8-4.812 3.609zM10.96 13.828l-4.721 6.744.819.573 4.721-6.744zM6.331 20.67l2.31-13.088-.985-.174-2.31 13.088zM9.041 7.454l1.995 3.492.868-.496-1.995-3.492z"/><path d="M8.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM12.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M21.487 5.248l-12.019 1.502.124.992 12.019-1.502zM6.619 9.355l-2.217 11.083.981.196 2.217-11.083zM6.534 22.75l12.071-1.509-.124-.992-12.071 1.509zM21.387 18.612l2.21-11.048-.981-.196-2.21 11.048zM8.507 9.214l10.255 10.255.707-.707-10.255-10.255z"/><path d="M7.5 9c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 22c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.013 23.846c4.923 2.247 9.792 2.626 13.448-.517l-.652-.758c-3.277 2.817-7.775 2.467-12.381.365l-.415.91z"/><path d="M24.035 20.056c2.262-4.176 1.814-8.73-.13-12.98l-.909.416c1.826 3.993 2.244 8.24.16 12.088l.879.476z"/><path d="M8.221 21.401l13.249-14.077-.728-.685-13.249 14.077z"/><path d="M6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M7.354 21.354l14-14-.707-.707-14 14z"/><path d="M21 7l-8 3 5 5z"/><path fill-rule="nonzero" d="M22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M17 12v-6h-6v6h-4.865l7.865 9.438 7.865-9.438h-4.865zm-7-7h8v6h6l-10 12-10-12h6v-6z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M16 17h6v-6h-6v-4.865l-9.438 7.865 9.438 7.865v-4.865zm7 1h-6v6l-12-10 12-10v6h6v8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M12 11h-6v6h6v4.865l9.438-7.865-9.438-7.865v4.865zm-7 7v-8h6v-6l12 10-12 10v-6h-6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M11 16v6h6v-6h4.865l-7.865-9.438-7.865 9.438h4.865zm7 7h-8v-6h-6l10-12 10 12h-6v6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M9.586 18h7.414c3.309 0 6-2.689 6-6 0-3.309-2.687-6-5.994-6h-5.012c-3.306 0-5.994 2.686-5.994 5.994v9.592l3.586-3.586zm-4.586 6v-12.006c0-3.863 3.137-6.994 6.994-6.994h5.012c3.863 0 6.994 3.142 6.994 7 0 3.866-3.142 7-7 7h-7l-5 5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6 6v6.5h1v-6.5zM7 22v-2.5h-1v2.5zM11 11v2.5h1v-2.5zM12 24v-7.5h-1v7.5zM16 5v5.5h1v-5.5zM17 21v-2.5h-1v2.5zM21 7v4.5h1v-4.5zM22 19v-2.5h-1v2.5z"/><path d="M6 13v6h1v-6h-1zm-1-1h3v8h-3v-8z"/><path d="M11 16h1v-2h-1v2zm-1-3h3v4h-3v-4z"/><path d="M16 18h1v-7h-1v7zm-1-8h3v9h-3v-9z"/><path d="M21 16h1v-4h-1v4zm-1-5h3v6h-3v-6z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M17.605 19.584c.295-2.304-.584-3.586-3.274-5.959-2.462-2.172-3.191-3.241-2.94-5.111l-.991-.133c-.312 2.322.567 3.61 3.269 5.994 2.452 2.163 3.181 3.227 2.943 5.083l.992.127z"/><path d="M6.053 24.868c3.772 1.644 7.307 1.643 9.712-1.249l-.769-.64c-2.045 2.458-5.133 2.459-8.544.972l-.4.917z"/><path d="M12.949 5.087c2.044-2.525 5.157-2.54 8.602-1.036l.4-.917c-3.81-1.663-7.376-1.646-9.779 1.324l.777.629z"/><path d="M4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6.256 20.652c.548-3.024 1.607-5.962 3.329-8.312l-.807-.591c-1.825 2.493-2.933 5.565-3.506 8.725l.984.178z"/><path d="M12.243 9.657c2.365-1.764 5.345-2.846 8.416-3.402l-.178-.984c-3.21.581-6.326 1.712-8.836 3.584l.598.802z"/><path d="M10.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M1.789 23l.859-.854.221-.228c.18-.19.38-.409.597-.655.619-.704 1.238-1.478 1.815-2.298.982-1.396 1.738-2.776 2.177-4.081 1.234-3.667 5.957-4.716 8.923-1.263 3.251 3.785-.037 9.38-5.379 9.38h-9.211zm9.211-1c4.544 0 7.272-4.642 4.621-7.728-2.45-2.853-6.225-2.015-7.216.931-.474 1.408-1.273 2.869-2.307 4.337-.599.852-1.241 1.653-1.882 2.383l-.068.078h6.853z"/><path d="M18.182 6.002l-1.419 1.286c-1.031.935-1.075 2.501-.096 3.48l1.877 1.877c.976.976 2.553.954 3.513-.045l5.65-5.874-.721-.693-5.65 5.874c-.574.596-1.507.609-2.086.031l-1.877-1.877c-.574-.574-.548-1.48.061-2.032l1.419-1.286-.672-.741z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M6 21.586l3.586-3.586h13.407c.004 0 .007-11.993.007-11.993 0-.007-17-.007-17-.007v15.586zm-1 2.414v-18.005c0-.549.451-.995.995-.995h17.01c.549 0 .995.45.995 1.007v11.986c0 .556-.45 1.007-1.007 1.007h-12.993l-5 5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M23 4v21h1v-21z"/><path d="M17 4v21h1v-21z"/><path d="M5 16.5v8.5h1v-8.5z"/><path d="M5 4v8.5h1v-8.5z"/><path d="M5.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M11 16.5v8.5h1v-8.5z"/><path d="M11 4v8.5h1v-8.5z"/><path d="M11.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M15.246 21.895l1.121.355c-.172.625-.458 1.089-.857 1.393-.4.303-.907.455-1.521.455-.76 0-1.385-.26-1.875-.779-.49-.52-.734-1.23-.734-2.131 0-.953.246-1.693.738-2.221.492-.527 1.139-.791 1.941-.791.701 0 1.27.207 1.707.621.26.245.456.596.586 1.055l-1.145.273c-.068-.297-.209-.531-.424-.703-.215-.172-.476-.258-.783-.258-.424 0-.769.152-1.033.457-.264.305-.396.798-.396 1.48 0 .724.13 1.24.391 1.547.26.307.599.461 1.016.461.307 0 .572-.098.793-.293.221-.195.38-.503.477-.922z"/><path fill-rule="nonzero" d="M20.449 8.505l2.103 9.112.974-.225-2.103-9.112zM13.943 14.011l7.631 4.856.537-.844-7.631-4.856zM14.379 11.716l4.812-3.609-.6-.8-4.812 3.609zM10.96 13.828l-4.721 6.744.819.573 4.721-6.744zM6.331 20.67l2.31-13.088-.985-.174-2.31 13.088zM9.041 7.454l1.995 3.492.868-.496-1.995-3.492z"/><path fill-rule="nonzero" d="M8.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM12.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M6.5 23v1h17.5v-17.5h-1v16.5z"/><path fill-rule="nonzero" d="M21.5 5v-1h-17.5v17.5h1v-16.5z"/><path fill-rule="nonzero" d="M4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path fill-rule="nonzero" d="M13 9v13h1v-13z" id="Line"/><path d="M13.5 6l2.5 3h-5z"/><path fill-rule="nonzero" d="M19 14h-13v1h13z"/><path d="M19 17v-5l3 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M20 14h-14v1h14z" id="Line"/><path d="M20 17v-5l3 2.5z"/><path fill-rule="nonzero" d="M24 8.5v16.5h1v-16.5zM4 4v16.5h1v-16.5z"/><path fill-rule="nonzero" d="M4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20.534 4.664l-13.318 4.701.333.943 13.318-4.701zM20.802 22.371l-13.285-4.689-.333.943 13.285 4.689z"/><path d="M5.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 19c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M13.746 7h-1.258l-.5-1.301h-2.289l-.473 1.301h-1.227l2.23-5.727h1.223l2.293 5.727zm-2.129-2.266l-.789-2.125-.773 2.125h1.563z"/><path d="M26.246 4.895l1.121.355c-.172.625-.458 1.089-.857 1.393-.4.303-.907.455-1.521.455-.76 0-1.385-.26-1.875-.779-.49-.52-.734-1.23-.734-2.131 0-.953.246-1.693.738-2.221.492-.527 1.139-.791 1.941-.791.701 0 1.27.207 1.707.621.26.245.456.596.586 1.055l-1.145.273c-.068-.297-.209-.531-.424-.703-.215-.172-.476-.258-.783-.258-.424 0-.769.152-1.033.457-.264.305-.396.798-.396 1.48 0 .724.13 1.24.391 1.547.26.307.599.461 1.016.461.307 0 .572-.098.793-.293.221-.195.38-.503.477-.922z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M8.395 7l-1.367-5.727h1.184l.863 3.934 1.047-3.934h1.375l1.004 4 .879-4h1.164l-1.391 5.727h-1.227l-1.141-4.281-1.137 4.281z"/><path d="M24.086 7v-2.41l-2.098-3.316h1.355l1.348 2.266 1.32-2.266h1.332l-2.105 3.324v2.402z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M11.148 7h-1.098v-4.137c-.401.375-.874.652-1.418.832v-.996c.286-.094.598-.271.934-.533.336-.262.566-.567.691-.916h.891v5.75z"/><path d="M23.355 5.527l1.094-.113c.031.247.124.443.277.588.154.145.331.217.531.217.229 0 .423-.093.582-.279.159-.186.238-.467.238-.842 0-.352-.079-.615-.236-.791-.158-.176-.363-.264-.615-.264-.315 0-.598.139-.848.418l-.891-.129.563-2.98h2.902v1.027h-2.07l-.172.973c.245-.122.495-.184.75-.184.487 0 .9.177 1.238.531.339.354.508.814.508 1.379 0 .471-.137.892-.41 1.262-.372.505-.889.758-1.551.758-.529 0-.96-.142-1.293-.426-.333-.284-.533-.665-.598-1.145z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M13.746 7h-1.258l-.5-1.301h-2.289l-.473 1.301h-1.227l2.23-5.727h1.223l2.293 5.727zm-2.129-2.266l-.789-2.125-.773 2.125h1.563z"/><path d="M22.582 7v-5.727h4.246v.969h-3.09v1.27h2.875v.965h-2.875v1.559h3.199v.965z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M5.238 18.469l4.17-4.17-.707-.707-4.17 4.17zM16.47 17.763l-.707.707-4.265-4.265.707-.707zM22.747 13.546l-4.192 4.192.707.707 4.192-4.192z"/><path fill-rule="nonzero" d="M10.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path d="M8.395 7l-1.367-5.727h1.184l.863 3.934 1.047-3.934h1.375l1.004 4 .879-4h1.164l-1.391 5.727h-1.227l-1.141-4.281-1.137 4.281z"/><path d="M22.086 7v-1.043l3.008-3.715h-2.668v-.969h4.191v.898l-3.137 3.863h3.258v.965z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M12.435 6.136c-4.411.589-7.983 3.039-9.085 6.27l.946.323c.967-2.836 4.209-5.059 8.271-5.602l-.132-.991zM3.347 16.584c1.101 3.243 4.689 5.701 9.117 6.283l.13-.991c-4.079-.537-7.335-2.767-8.301-5.613l-.947.321zM16.554 22.865c4.381-.582 7.94-3 9.071-6.2l-.943-.333c-.994 2.811-4.224 5.006-8.26 5.542l.132.991zM25.646 12.394c-1.107-3.225-4.675-5.668-9.078-6.257l-.133.991c4.056.542 7.293 2.76 8.265 5.591l.946-.325z"/><path d="M14.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4.354 25.354l5-5-.707-.707-5 5z"/><path d="M12.354 17.354l5-5-.707-.707-5 5z"/><path d="M20.354 9.354l5-5-.707-.707-5 5z"/><path d="M18.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.463 12.026l13.537-7.167-.468-.884-13.537 7.167z"/><path d="M22.708 16.824l-17.884 9.468.468.884 17.884-9.468z"/><path d="M22.708 9.824l-15.839 8.386.468.884 15.839-8.386z"/><path d="M5.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M23.868 7.825c2.791 3.916 2.918 9.33-.065 13.435-3.733 5.138-10.925 6.277-16.063 2.544l.721-.714c4.682 3.294 11.157 2.229 14.534-2.418 2.641-3.635 2.657-8.502.153-12.133l.721-.714z"/><path d="M8.477 5.899c3.584-2.509 8.298-2.514 11.865-.127l.718-.721c-3.845-2.669-9.099-2.813-13.157.028-5.203 3.643-6.467 10.814-2.824 16.016l.718-.721c-3.201-4.737-2.022-11.185 2.68-14.476z"/><path d="M14.5 22c4.142 0 7.5-3.358 7.5-7.5 0-4.142-3.358-7.5-7.5-7.5-4.142 0-7.5 3.358-7.5 7.5 0 4.142 3.358 7.5 7.5 7.5zm0 1c-4.694 0-8.5-3.806-8.5-8.5s3.806-8.5 8.5-8.5 8.5 3.806 8.5 8.5-3.806 8.5-8.5 8.5z"/><path d="M14.5 19c2.485 0 4.5-2.015 4.5-4.5s-2.015-4.5-4.5-4.5-4.5 2.015-4.5 4.5 2.015 4.5 4.5 4.5zm0 1c-3.038 0-5.5-2.462-5.5-5.5s2.462-5.5 5.5-5.5 5.5 2.462 5.5 5.5-2.462 5.5-5.5 5.5z"/><path d="M22.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M3 5h22v-1h-22z"/><path d="M3 17h22v-1h-22z"/><path d="M3 11h19.5v-1h-19.5z"/><path d="M5.5 23h19.5v-1h-19.5z"/><path d="M3.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8 9.5c0 3.038 2.462 5.5 5.5 5.5s5.5-2.462 5.5-5.5v-.5h-1v.5c0 2.485-2.015 4.5-4.5 4.5s-4.5-2.015-4.5-4.5v-.5h-1v.5z"/><path d="M0 9.5c0 7.456 6.044 13.5 13.5 13.5s13.5-6.044 13.5-13.5v-.5h-1v.5c0 6.904-5.596 12.5-12.5 12.5s-12.5-5.596-12.5-12.5v-.5h-1v.5z"/><path d="M4 9.5c0 4.259 2.828 7.964 6.86 9.128l.48.139.277-.961-.48-.139c-3.607-1.041-6.137-4.356-6.137-8.167v-.5h-1v.5z"/><path d="M16.141 18.628c4.032-1.165 6.859-4.869 6.859-9.128v-.5h-1v.5c0 3.811-2.53 7.125-6.136 8.167l-.48.139.278.961.48-.139z"/><path d="M13.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM13.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4 2v19.5h1v-19.5zM15.5 10h-11v1h11zM17 12.5v11h1v-11zM6.29 22.417l10.162-10.162-.707-.707-10.162 10.162z" id="Line"/><path d="M19.264 9.443l6.589-6.589-.707-.707-6.589 6.589z"/><path d="M6.577 23.381l19.071-5.903-.296-.955-19.071 5.903z"/><path d="M5.573 21.724l5.905-19.076-.955-.296-5.905 19.076z"/><path d="M6.5 24h19.5v-1h-19.5z"/><path d="M4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4.395 10.18c3.432-4.412 10.065-4.998 13.675-.973l.745-.668c-4.044-4.509-11.409-3.858-15.209 1.027l.789.614z"/><path d="M19.991 12.494c.877 2.718.231 5.487-1.897 7.543-2.646 2.556-6.752 2.83-9.188.477-1.992-1.924-2.027-5.38-.059-7.281 1.582-1.528 3.78-1.587 5.305-.115 1.024.99 1.386 2.424.876 3.491l.902.431c.709-1.482.232-3.37-1.084-4.641-1.921-1.855-4.734-1.78-6.695.115-2.378 2.297-2.337 6.405.059 8.719 2.846 2.749 7.563 2.435 10.577-.477 2.407-2.325 3.147-5.493 2.154-8.569l-.952.307z"/><path d="M21.01 9.697l3.197-3.197-.707-.707-3.197 3.197z"/><path d="M14.989 15.719l3.674-3.674-.707-.707-3.674 3.674z"/><path d="M13.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM19.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M17 4v21h1v-21z"/><path d="M23 4v21h1v-21z"/><path d="M5 16.5v8.5h1v-8.5z"/><path d="M5 4v8.5h1v-8.5z"/><path d="M11 16.5v8.5h1v-8.5z"/><path d="M11 4v8.5h1v-8.5z"/><path d="M5.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M21.5 23h-14v1h14zM5 7.5v14h1v-14z"/><path d="M12 23c0-3.314-2.686-6-6-6h-.5v1h.5c2.761 0 5 2.239 5 5v.5h1v-.5z"/><path d="M20 23c0-7.732-6.268-14-14-14h-.5v1h.5c7.18 0 13 5.82 13 13v.5h1v-.5z"/><path d="M16 23c0-5.523-4.477-10-10-10h-.5v1h.5c4.971 0 9 4.029 9 9v.5h1v-.5z"/><path d="M5.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M7.382 16h14.483l-4.167-5 4.167-5h-15.865v12.764l1.382-2.764zm-2.382 7v-18h19l-5 6 5 6h-16l-3 6z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.5 23h13v-1h-13z"/><path d="M7.55 13.088l13.29-6.254-.426-.905-13.29 6.254z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 15c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.354 21.354l7.097-7.097-.707-.707-7.097 7.097z"/><path d="M17.249 11.458l7.105-7.105-.707-.707-7.105 7.105z"/><path d="M7.542 22.683l17.296-2.739-.156-.988-17.296 2.739z" id="Line"/><path d="M7.538 22.062l15.708-7.661-.438-.899-15.708 7.661z"/><path d="M6.802 20.97l7.695-15.777-.899-.438-7.695 15.777z"/><path d="M6.285 20.741l2.76-17.423-.988-.156-2.76 17.423z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM15.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M3.5 11h21v-1h-21z"/><path d="M3.5 18h21v-1h-21z"/><path d="M10 3.5v21h1v-21z"/><path d="M17 3.5v21h1v-21z"/><path d="M22.5 4v-1h-19.5v19.5h1v-18.5z"/><path d="M24 24h-18.507v1h19.507v-19.5h-1z"/><path d="M3.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M4.529 18.21l3.157-1.292-.379-.926-3.157 1.292z"/><path fill-rule="nonzero" d="M9.734 16.081l2.97-1.215-.379-.926-2.97 1.215z"/><path fill-rule="nonzero" d="M14.725 14.039l2.957-1.21-.379-.926-2.957 1.21z"/><path fill-rule="nonzero" d="M19.708 12.001l3.114-1.274-.379-.926-3.114 1.274z"/><path d="M8 18h1v3h-1z" id="Path"/><path d="M8 9h1v5h-1z"/><path fill-rule="nonzero" d="M8 18h1v-4h-1v4zm-1-5h3v6h-3v-6z" id="Rectangle-44"/><path d="M18 16h1v3h-1z" id="Path"/><path d="M18 3h1v6h-1z"/><path fill-rule="nonzero" d="M18 16h1v-7h-1v7zm-1-8h3v9h-3v-9z" id="Rectangle-44"/><path d="M13 6h1v5h-1z"/><path d="M13 15h1v5h-1z"/><path fill-rule="nonzero" d="M13 15h1v-4h-1v4zm-1-5h3v6h-3v-6z"/><path fill-rule="nonzero" d="M2.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4.436 21.667l2.083-9.027-.974-.225-2.083 9.027zM10.046 16.474l-2.231-4.463-.894.447 2.231 4.463zM13.461 6.318l-2.88 10.079.962.275 2.88-10.079zM18.434 16.451l-2.921-10.224-.962.275 2.921 10.224zM21.147 12.089l-2.203 4.405.894.447 2.203-4.405zM25.524 21.383l-2.09-9.055-.974.225 2.09 9.055z"/><path d="M1 19h7.5v-1h-7.5z"/><path d="M12.5 19h4v-1h-4z"/><path d="M20.5 19h6.5v-1h-6.5z"/><path d="M6.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 12c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4 15h8.5v-1h-8.5zM16.5 15h8.5v-1h-8.5z"/><path d="M14.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.5 15h16.5v-1h-16.5z"/><path d="M6.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6.5 23h12v-1h-12z" id="Line"/><path d="M21.596 20.715l3.091-9.66-.952-.305-3.091 9.66z"/><path d="M8.413 22.664l1.95-6.094-.952-.305-1.95 6.094z"/><path d="M11.602 12.695l3.085-9.641-.952-.305-3.085 9.641z"/><path d="M11.783 16.167l6.817 5.454.625-.781-6.817-5.454z"/><path d="M15.976 18.652l3.711-11.598-.952-.305-3.711 11.598z"/><path d="M4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM20.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M20 11c0-3.314-2.686-6-6-6s-6 2.686-6 6c0 2.913 2.872 8.112 6 11.551 3.128-3.438 6-8.638 6-11.551zm-6 13c-3-3-7-9.134-7-13 0-3.866 3.134-7 7-7s7 3.134 7 7-4 10-7 13z"/><ellipse cx="14" cy="11" rx="2" ry="2"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M16 11c0-3.314-2.686-6-6-6s-6 2.686-6 6c0 2.913 2.872 8.112 6 11.551 3.128-3.438 6-8.638 6-11.551zm-6 13c-3-3-7-9.134-7-13 0-3.866 3.134-7 7-7s7 3.134 7 7-4 10-7 13z"/><ellipse cx="10" cy="11" rx="2" ry="2"/><path fill-rule="nonzero" d="M25 20c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3h1zm-1 0h1c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3z"/><path fill-rule="nonzero" d="M18 19h5v-1h-5zM20 15.5v8h1v-8z"/><ellipse cx="20.5" cy="14.5" rx="1.5" ry="1.5"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.354 18.354l10-10-.707-.707-10 10zM12.354 25.354l5-5-.707-.707-5 5z"/><path d="M20.354 17.354l5-5-.707-.707-5 5z"/><path d="M19.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 21c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20.349 20.654l4.489-.711-.156-.988-4.489.711z"/><path d="M7.254 22.728l9.627-1.525-.156-.988-9.627 1.525z"/><path d="M7.284 22.118l15.669-8.331-.469-.883-15.669 8.331z"/><path d="M6.732 21.248l8.364-15.731-.883-.469-8.364 15.731z"/><path d="M17.465 18.758l-8.188-8.188-.707.707 8.188 8.188z"/><path d="M6.273 20.818l1.499-9.467-.988-.156-1.499 9.467z"/><path d="M8.329 7.834l.715-4.516-.988-.156-.715 4.516z"/><path d="M7.354 21.354l17-17-.707-.707-17 17z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM7.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 22c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.275 21.432l12.579-12.579-.707-.707-12.579 12.579z"/><path d="M6.69 13.397l7.913 7.913.707-.707-7.913-7.913zM7.149 10.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M18.149 21.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M16.5 6h4v-1h-4z" id="Line"/><path d="M16.5 15h4v-1h-4z"/><path d="M8.5 23h4v-1h-4z"/><path d="M8.298 11.591l5.097-4.46-.659-.753-5.097 4.46zM22 7.5v5h1v-5z"/><path d="M14 16.5v4h1v-4z"/><path d="M6 14.5v6h1v-6z"/><path d="M6.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM14.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M19 11h5l-2.5 3z"/><circle cx="21.5" cy="16.5" r="1.5"/><path fill-rule="nonzero" d="M22 11v-6h-1v6z"/><path d="M14 18h1v3h-1z" id="Path"/><path d="M14 5h1v6h-1z"/><path d="M7 19h1v3h-1z"/><path d="M7 6h1v7h-1z"/><path fill-rule="nonzero" d="M7 13v6h1v-6h-1zm-1-1h3v8h-3v-8zM14 18h1v-7h-1v7zm-1-8h3v9h-3v-9z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M6.995 5c.008 0 .005 15.5.005 15.5h-1v-15.493c0-.556.451-1.007.995-1.007h17.01c.549 0 .995.45.995 1.007v11.986c0 .556-.45 1.007-1.007 1.007h-12.993l-3.104 3.104-.707-.707 3.397-3.397h13.407c.004 0 .007-11.993.007-11.993 0-.007-17.005-.007-17.005-.007z"/><path d="M6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M4 5h16.5v-1h-16.5zM25 24h-16.5v1h16.5z" id="Line"/><path fill-rule="nonzero" d="M6.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/><path fill-rule="nonzero" d="M14 9v14h1v-14z"/><path d="M14.5 6l2.5 3h-5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M23.886 21.431c-.953-8.558-7.742-15.354-16.299-16.315l-.112.994c8.093.909 14.516 7.338 15.417 15.432l.994-.111z"/><path d="M5 7.5v14h1v-14zM21.5 23h-14v1h14z"/><path d="M5.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM23.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.354 20.354l5-5-.707-.707-5 5z"/><path d="M16.354 12.354l8-8-.707-.707-8 8z"/><path d="M14.5 15c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.5 6h13v-1h-13z" id="Line"/><path d="M7.5 23h13v-1h-13z"/><path d="M5 7.5v13h1v-13z"/><path d="M22 7.5v13h1v-13z"/><path d="M5.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.551 17.98l13.284-7.033-.468-.884-13.284 7.033z"/><path d="M6 11.801l16-8.471v4.17h1v-5.83l-18 9.529v5.301h1z"/><path d="M6 24.67v-4.17h-1v5.83l18-9.529v-5.301h-1v4.699z"/><path d="M5.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM22.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M6 6h19v-1h-19z" id="Line"/><path fill-rule="nonzero" d="M6 24h19v-1h-19z"/><path fill-rule="nonzero" d="M6 17h17v-1h-17z"/><path d="M14.5 7l2.5 3h-5z"/><path d="M14.5 22l2.5-3h-5z"/><path fill-rule="nonzero" d="M14 10v10h1v-10z"/><path fill-rule="nonzero" d="M4.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M6 6h19v-1h-19z" id="Line"/><path fill-rule="nonzero" d="M6 24h19v-1h-19z"/><path fill-rule="nonzero" d="M6 13h17v-1h-17z"/><path d="M14.5 7l2.5 3h-5z"/><path d="M14.5 22l2.5-3h-5z"/><path fill-rule="nonzero" d="M14 10v10h1v-10z"/><path fill-rule="nonzero" d="M4.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM24.5 14c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M14.743 3.55l-4.208 4.208.707.707 4.208-4.208zM7.71 10.583l-4.187 4.187.707.707 4.187-4.187zM3.536 18.244l6.171 6.171.707-.707-6.171-6.171zM13.232 24.475l4.22-4.22-.707-.707-4.22 4.22zM20.214 17.494l4.217-4.217-.707-.707-4.217 4.217zM24.423 9.716l-6.218-6.218-.707.707 6.218 6.218z"/><path d="M2.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM9.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 4c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 27c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.854 22.854l14-14-.707-.707-14 14z"/><path d="M8.336 13.043l8.621 8.621.707-.707-8.621-8.621zM9.149 10.558l7.058-7.058-.707-.707-7.058 7.058z" id="Line"/><path d="M20.149 21.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M5.5 23h11v-1h-11z"/><path d="M7.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M10.275 20.432l11.579-11.579-.707-.707-11.579 11.579z"/><path d="M8.336 13.043l8.621 8.621.707-.707-8.621-8.621zM9.149 10.558l7.058-7.058-.707-.707-7.058 7.058z" id="Line"/><path d="M20.149 21.558l7.058-7.058-.707-.707-7.058 7.058z"/><path d="M6.5 23h10v-1h-10z"/><path d="M4.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM7.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M5.205 14.111l-.013-.172c-.054-.906.022-1.966.327-2.961.395-1.289 1.111-2.215 2.221-2.666l-.377-.926c-1.42.578-2.324 1.746-2.8 3.3-.346 1.128-.429 2.299-.369 3.313l.017.219.994-.106z"/><path d="M11.051 8.554c1.12.893 1.766 2.343 2.973 6.099 1.274 3.963 1.947 5.48 3.28 6.557l.629-.778c-1.112-.899-1.754-2.345-2.956-6.085-1.28-3.982-1.957-5.503-3.302-6.575l-.623.782z"/><path d="M21.722 21.558c1.439-.634 2.428-1.886 3.046-3.551.311-.836.509-1.726.618-2.616.066-.539.088-.967.088-1.227l-1 .002-.01.304c-.012.241-.035.51-.071.798-.101.818-.282 1.634-.563 2.39-.533 1.434-1.354 2.474-2.512 2.985l.403.915z"/><path d="M9.5 9c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM19.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M14 5.5v17h1v-17z" id="Line"/><path d="M9 8.5v-2.001c0-.272.229-.499.502-.499h9.995c.28 0 .502.221.502.499v2.001h1v-2.001c0-.832-.672-1.499-1.502-1.499h-9.995c-.824 0-1.502.673-1.502 1.499v2.001h1z"/><path d="M12 23h5v-1h-5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M25 19c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3h1zm-1 0h1c0 2.485-2.015 4-4.5 4s-4.5-1.515-4.5-4h1c0 1.797 1.421 3 3.5 3 2.079 0 3.5-1.203 3.5-3z"/><path fill-rule="nonzero" d="M18 18h5v-1h-5zM20 14.5v8h1v-8z" id="Line"/><ellipse cx="20.5" cy="13.5" rx="1.5" ry="1.5"/><path fill-rule="nonzero" d="M11 5.5v17h1v-17z" id="Line"/><path fill-rule="nonzero" d="M6 8.5v-2.001c0-.272.229-.499.502-.499h9.995c.28 0 .502.221.502.499v2.001h1v-2.001c0-.832-.672-1.499-1.502-1.499h-9.995c-.824 0-1.502.673-1.502 1.499v2.001h1z"/><path fill-rule="nonzero" d="M9 23h5v-1h-5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M.303 17.674l1.104.473.394-.919-1.104-.473z"/><path d="M5.133 19.744l3.335 1.429.394-.919-3.335-1.429z"/><path d="M12.134 22.744l3.352 1.436.394-.919-3.352-1.436z"/><path d="M19.203 25.774l1.6.686.394-.919-1.6-.686z"/><path d="M.3 4.673l1.13.484.394-.919-1.13-.484-.394.919zm.394-.919l1.13.484-.394.919-1.13-.484.394-.919z"/><path d="M5.141 6.747l3.325 1.425.394-.919-3.325-1.425z"/><path d="M12.133 9.744l3.353 1.437.394-.919-3.353-1.437z"/><path d="M19.221 12.782l5.838 2.502.394-.919-5.838-2.502z"/><path d="M3 7.473v8.969h1v-8.969zM8.93 9.871l-4.616 6.594.819.573 4.616-6.594zM11 19.5v-9h-1v9zM15.898 12.916l-4.616 6.594.819.573 4.616-6.594zM18 22.5v-9h-1v9zM24.313 5.212l-6.57 17.247.934.356 6.57-17.247z"/><path d="M3.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM3.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 23c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 13c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM25.5 5c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM17.5 26c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM10.5 10c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M27.186 9.411c-.691-.27-1.429-.411-2.186-.411-3.314 0-6 2.686-6 6h1c0-2.761 2.239-5 5-5 .632 0 1.246.117 1.821.342l.364-.931z"/><path fill-rule="nonzero" d="M9 15c0-3.314-2.686-6-6-6-.754 0-1.489.139-2.177.407l.363.932c.573-.223 1.185-.339 1.814-.339 2.761 0 5 2.239 5 5h1z"/><path d="M8 15h1v1h-1v-1zm11 0h1v1h-1v-1zm1 0h-1c0-2.761-2.239-5-5-5s-5 2.239-5 5h-1c0-3.314 2.686-6 6-6s6 2.686 6 6z"/><path fill-rule="nonzero" d="M8.5 19c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM19.5 19c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M15.5 22.5c0-2.697-1.073-5.225-2.947-7.089l-.705.709c1.687 1.679 2.652 3.952 2.652 6.38h1z"/><path d="M7.354 21.354l14-14-.707-.707-14 14z"/><path d="M7.5 23h16.5v-1h-16.5z"/><path d="M22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M4 25h22v-1h-22z" id="Line"/><path d="M4 21h22v-1h-22z"/><path d="M6.5 17h19.5v-1h-19.5z"/><path d="M5 14.5v-3h-1v3zM6.617 9.275l10.158-3.628-.336-.942-10.158 3.628z"/><path d="M18.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM4.5 18c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M20 2v22h1v-22z"/><path d="M24 2v22h1v-22z"/><path d="M4.673 11.471l3.69 10.333.942-.336-3.69-10.333z"/><path d="M17 21.535v-19.535h-1v19.535z"/><path d="M11.5 24h3v-1h-3z"/><path d="M4.5 11c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM9.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM16.5 25c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M7.354 21.354l14-14-.707-.707-14 14z"/><path d="M22.5 7c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM5.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M8.5 23h11v-1h-11zM6 8.5v12h1v-12zM7.483 8.28l12.293 13.112.73-.684-12.293-13.112z"/><path d="M6.5 8c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM6.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM21.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M9.457 18.844l-5.371 2.4.408.913 5.371-2.4z"/><path d="M13.13 17.203l.408.913 13.688-6.116-6.736-3.01-.408.913 4.692 2.097z"/><path d="M11.077 5.88l5.34 2.386.408-.913-5.34-2.386z"/><path d="M7.401 4.237l.408-.913-5.809-2.595v19.771h1v-18.229z"/><path d="M3.708 20.772l5.51-14.169-.932-.362-5.51 14.169zM9.265 6.39l1.46 10.218.99-.141-1.46-10.218zM13.059 17.145l4.743-6.775-.819-.573-4.743 6.775z"/><path d="M9.5 6c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM11.5 20c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM18.5 10c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5zM2.5 24c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="nonzero"><path d="M15 12.5v-8.5h-1v8.5zM14 16.5v8.5h1v-8.5z"/><path d="M14.5 16c.828 0 1.5-.672 1.5-1.5s-.672-1.5-1.5-1.5-1.5.672-1.5 1.5.672 1.5 1.5 1.5zm0 1c-1.381 0-2.5-1.119-2.5-2.5s1.119-2.5 2.5-2.5 2.5 1.119 2.5 2.5-1.119 2.5-2.5 2.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M15.039 5.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM5.97 15.038l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"/><path d="M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M14.039 6.969l-.019-.019-2.828 2.828.707.707 2.474-2.474c1.367-1.367 3.582-1.367 4.949 0s1.367 3.582 0 4.949l-2.474 2.474.707.707 2.828-2.828-.019-.019c1.415-1.767 1.304-4.352-.334-5.99-1.638-1.638-4.224-1.749-5.99-.334zM6.968 14.039l-.019-.019 2.828-2.828.707.707-2.475 2.475c-1.367 1.367-1.367 3.582 0 4.949s3.582 1.367 4.949 0l2.474-2.474.707.707-2.828 2.828-.019-.019c-1.767 1.415-4.352 1.304-5.99-.334-1.638-1.638-1.749-4.224-.334-5.99z"/><path d="M10.485 16.141l5.656-5.656.707.707-5.656 5.656z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M11.682 16.09l3.504 6.068 1.732-1-3.497-6.057 3.595-2.1L8 7.74v10.512l3.682-2.163zm-.362 1.372L7 20V6l12 7-4.216 2.462 3.5 6.062-3.464 2-3.5-6.062z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path d="M18 15h8v-1h-8z"/><path d="M14 18v8h1v-8zM14 3v8h1v-8zM3 15h8v-1h-8z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><circle cx="14" cy="14" r="3"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M23.002 23C23 23 23 18.003 23 18.003L15.998 18C16 18 16 22.997 16 22.997l7.002.003zM15 18.003A1 1 0 0 1 15.998 17h7.004c.551 0 .998.438.998 1.003v4.994A1 1 0 0 1 23.002 24h-7.004A.993.993 0 0 1 15 22.997v-4.994z"/><path d="M19 20h1v2h-1z"/><path fill-rule="nonzero" d="M22 14.5a2.5 2.5 0 0 0-5 0v3h1v-3a1.5 1.5 0 0 1 3 0v.5h1v-.5z"/><g fill-rule="nonzero"><path d="M3 14.707A1 1 0 0 1 3.293 14L14.439 2.854a1.5 1.5 0 0 1 2.122 0l2.585 2.585a1.5 1.5 0 0 1 0 2.122L8 18.707a1 1 0 0 1-.707.293H4a1 1 0 0 1-1-1v-3.293zm1 0V18h3.293L18.439 6.854a.5.5 0 0 0 0-.708l-2.585-2.585a.5.5 0 0 0-.708 0L4 14.707z"/><path d="M13.146 4.854l4 4 .708-.708-4-4zm-9 9l4 4 .708-.708-4-4z"/><path d="M15.146 6.146l-9 9 .708.708 9-9z"/></g></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M23.002 23C23 23 23 18.003 23 18.003L15.998 18C16 18 16 22.997 16 22.997l7.002.003zM15 18.003A1 1 0 0 1 15.998 17h7.004c.551 0 .998.438.998 1.003v4.994A1 1 0 0 1 23.002 24h-7.004A.993.993 0 0 1 15 22.997v-4.994z"/><path d="M19 20h1v2h-1z"/><path fill-rule="nonzero" d="M22 17.5v-2a2.5 2.5 0 0 0-5 0v2h1v-2a1.5 1.5 0 0 1 3 0v2h1z"/><g fill-rule="nonzero"><path d="M3 14.707A1 1 0 0 1 3.293 14L14.439 2.854a1.5 1.5 0 0 1 2.122 0l2.585 2.585a1.5 1.5 0 0 1 0 2.122L8 18.707a1 1 0 0 1-.707.293H4a1 1 0 0 1-1-1v-3.293zm1 0V18h3.293L18.439 6.854a.5.5 0 0 0 0-.708l-2.585-2.585a.5.5 0 0 0-.708 0L4 14.707z"/><path d="M13.146 4.854l4 4 .708-.708-4-4zm-9 9l4 4 .708-.708-4-4z"/><path d="M15.146 6.146l-9 9 .708.708 9-9z"/></g></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 29 31" width="29" height="31"><g fill-rule="nonzero"><path d="M15.3 22l8.187-8.187c.394-.394.395-1.028.004-1.418l-4.243-4.243c-.394-.394-1.019-.395-1.407-.006l-11.325 11.325c-.383.383-.383 1.018.007 1.407l1.121 1.121h7.656zm-9.484-.414c-.781-.781-.779-2.049-.007-2.821l11.325-11.325c.777-.777 2.035-.78 2.821.006l4.243 4.243c.781.781.78 2.048-.004 2.832l-8.48 8.48h-8.484l-1.414-1.414z"/><path d="M13.011 22.999h7.999v-1h-7.999zM13.501 11.294l6.717 6.717.707-.707-6.717-6.717z"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 30.000001 29.999999" width="30" height="30" enable-background="new 0 0 595.3 841.9"><path d="M5.5 13A2.5 2.5 0 0 0 3 15.5 2.5 2.5 0 0 0 5.5 18 2.5 2.5 0 0 0 8 15.5 2.5 2.5 0 0 0 5.5 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5A2.5 2.5 0 0 0 15 18a2.5 2.5 0 0 0 2.5-2.5A2.5 2.5 0 0 0 15 13zm9.5 0a2.5 2.5 0 0 0-2.5 2.5 2.5 2.5 0 0 0 2.5 2.5 2.5 2.5 0 0 0 2.5-2.5 2.5 2.5 0 0 0-2.5-2.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill-rule="nonzero" d="M17.537 7.635l-.789.789c-.886-.275-1.812-.424-2.748-.424-3.841 0-7.521 2.503-8.962 6 .562 1.364 1.465 2.577 2.585 3.549l-.709.709c-1.265-1.112-2.274-2.506-2.881-4.077l-.07-.18.07-.18c1.535-3.975 5.645-6.82 9.966-6.82 1.213 0 2.409.224 3.537.635zm3.549 2.108c1.265 1.112 2.274 2.506 2.881 4.077l.07.18-.07.18c-1.535 3.975-5.646 6.82-9.966 6.82-1.213 0-2.409-.224-3.537-.635l.789-.789c.886.275 1.812.424 2.748.424 3.84 0 7.521-2.503 8.962-6-.562-1.364-1.465-2.577-2.585-3.549l.709-.709zm-6.049.392l-4.902 4.902c-.088-.33-.135-.677-.135-1.036 0-2.213 1.788-4.001 4.001-4.001.358 0 .705.047 1.036.135zm2.828 2.829c.088.331.135.679.135 1.038 0 2.213-1.786 3.999-3.999 3.999-.359 0-.707-.047-1.038-.135l4.901-4.901zm-12.365 10.243l-.707-.707 17.707-17.707.707.707-17.707 17.707z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M7 13.003v8.994c0 .557.445 1.003.994 1.003h12.012c.547 0 .994-.449.994-1.003v-8.994c0-.557-.445-1.003-.994-1.003h-12.012c-.547 0-.994.449-.994 1.003zm-1 0c0-1.106.895-2.003 1.994-2.003h12.012c1.101 0 1.994.894 1.994 2.003v8.994c0 1.106-.895 2.003-1.994 2.003h-12.012c-1.101 0-1.994-.894-1.994-2.003v-8.994z"/><path fill-rule="nonzero" d="M11 11v-4h-1v4z"/><path fill-rule="nonzero" d="M10 7c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3h-1zm1 0h-1c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3z"/><rect width="2" height="4" rx="1" x="13" y="17"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M7 13.003v8.994c0 .557.445 1.003.994 1.003h12.012c.547 0 .994-.449.994-1.003v-8.994c0-.557-.445-1.003-.994-1.003h-12.012c-.547 0-.994.449-.994 1.003zm-1 0c0-1.106.895-2.003 1.994-2.003h12.012c1.101 0 1.994.894 1.994 2.003v8.994c0 1.106-.895 2.003-1.994 2.003h-12.012c-1.101 0-1.994-.894-1.994-2.003v-8.994z"/><path fill-rule="nonzero" d="M11 11v-3h-1v3z"/><path fill-rule="nonzero" d="M18 11v-3h-1v3z"/><path fill-rule="nonzero" d="M10 8c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3h-1zm1 0h-1c0-2.209 1.791-4 4-4s4 1.791 4 4h-1c0-1.657-1.343-3-3-3s-3 1.343-3 3z"/><rect width="2" height="4" rx="1" x="13" y="17"/></g></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill-rule="evenodd"><path fill-rule="nonzero" d="M14 10a2 2 0 0 0-2 2v11H6V12c0-4.416 3.584-8 8-8s8 3.584 8 8v11h-6V12a2 2 0 0 0-2-2zm-3 2a3 3 0 0 1 6 0v10h4V12c0-3.864-3.136-7-7-7s-7 3.136-7 7v10h4V12z"/><path d="M6.5 18h5v1h-5zm10 0h5v1h-5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28"><path fill="none" stroke="currentColor" d="M3.207 19.793L19.793 3.207a1 1 0 0 1 1.414 0l3.586 3.586a1 1 0 0 1 0 1.414L8.207 24.793a1 1 0 0 1-1.414 0l-3.586-3.586a1 1 0 0 1 0-1.414zM5.5 17.5l2 2m1-5l3 3m0-6l2 2m1-5l3 3m0-6l2 2"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M8 21c0 1.1.825 2 1.833 2h7.333c1.008 0 1.833-.9 1.833-2v-12h-11v12zm-1 0v-13h13v13c0 1.634-1.252 3-2.833 3h-7.333c-1.581 0-2.833-1.366-2.833-3z"/><path d="M17 6l-1-1h-5l-1 1h-3v1h13v-1z"/><path fill-rule="nonzero" d="M10 11v9.062h1v-9.062z"/><path fill-rule="nonzero" d="M13 11v9.062h1v-9.062z"/><path fill-rule="nonzero" d="M16 11v9.062h1v-9.062z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g><path fill-rule="nonzero" d="M14 18.634l-.307-.239-7.37-5.73-2.137-1.665 9.814-7.633 9.816 7.634-.509.394-1.639 1.269-7.667 5.969zm7.054-6.759l1.131-.876-8.184-6.366-8.186 6.367 1.123.875 7.063 5.491 7.054-5.492z"/><path d="M7 14.5l-1 .57 8 6.43 8-6.5-1-.5-7 5.5z"/><path d="M7 17.5l-1 .57 8 6.43 8-6.5-1-.5-7 5.5z"/></g></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M17.646 18.354l4 4 .708-.708-4-4z"/><path d="M12.5 21a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17zm0-1a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15z"/><path d="M9 13h7v-1H9z"/><path d="M13 16V9h-1v7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M17.646 18.354l4 4 .708-.708-4-4z"/><path d="M12.5 21a8.5 8.5 0 1 1 0-17 8.5 8.5 0 0 1 0 17zm0-1a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15z"/><path d="M9 13h7v-1H9z"/></svg>'},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this._drawingsAccess=t||{tools:[],type:"black"}}return t.prototype.isToolEnabled=function(t){var e=this._findTool(t);return!(!e||!e.grayed)||("black"===this._drawingsAccess.type?!e:!!e)},t.prototype.isToolGrayed=function(t){var e=this._findTool(t);return!(!e||!e.grayed)},t.prototype._findTool=function(t){return this._drawingsAccess.tools.find(function(e){return e.name===t})},t}();e.ToolsFilter=o},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.lineTools=[[{name:"cursor"},{name:"dot"},{name:"arrow"},{name:"eraser"}],[{name:"LineToolTrendLine"},{name:"LineToolTrendAngle"},{name:"LineToolHorzLine",shortcut:{keys:"Alt+H",immediately:!0}},{name:"LineToolHorzRay"},{name:"LineToolVertLine",shortcut:{
keys:"Alt+V",immediately:!0}},{name:"LineToolArrow"},{name:"LineToolRay"},{name:"LineToolExtended"},{name:"LineToolParallelChannel"},{name:"LineToolDisjointAngle"},{name:"LineToolFlatBottom"}],[{name:"LineToolPitchfork"},{name:"LineToolSchiffPitchfork2"},{name:"LineToolSchiffPitchfork"},{name:"LineToolInsidePitchfork"},{name:"LineToolPitchfan"},{name:"LineToolGannSquare"},{name:"LineToolGannComplex"},{name:"LineToolGannFixed"},{name:"LineToolGannFan"},{name:"LineToolFibRetracement"},{name:"LineToolTrendBasedFibExtension"},{name:"LineToolFibSpeedResistanceFan"},{name:"LineToolFibTimeZone"},{name:"LineToolTrendBasedFibTime"},{name:"LineToolFibCircles"},{name:"LineToolFibSpiral"},{name:"LineToolFibSpeedResistanceArcs"},{name:"LineToolFibWedge"},{name:"LineToolFibChannel"}],[{name:"LineToolBrush"},{name:"LineToolRectangle"},{name:"LineToolRotatedRectangle"},{name:"LineToolEllipse"},{name:"LineToolTriangle"},{name:"LineToolPolyline"},{name:"LineToolBezierQuadro"},{name:"LineToolBezierCubic"},{name:"LineToolArc"}],[{name:"LineToolText"},{name:"LineToolTextAbsolute"},{name:"LineToolNote"},{name:"LineToolNoteAbsolute"},{name:"LineToolCallout"},{name:"LineToolBalloon"},{name:"LineToolPriceLabel"},{name:"LineToolArrowMarkLeft"},{name:"LineToolArrowMarkRight"},{name:"LineToolArrowMarkUp"},{name:"LineToolArrowMarkDown"},{name:"LineToolFlagMark"}],[{name:"LineTool5PointsPattern"},{name:"LineToolCypherPattern"},{name:"LineToolABCD"},{name:"LineToolTrianglePattern"},{name:"LineToolThreeDrivers"},{name:"LineToolHeadAndShoulders"},{name:"LineToolElliottImpulse"},{name:"LineToolElliottTriangle"},{name:"LineToolElliottTripleCombo"},{name:"LineToolElliottCorrection"},{name:"LineToolElliottDoubleCombo"},{name:"LineToolCircleLines"},{name:"LineToolTimeCycles"},{name:"LineToolSineLine"}],[{name:"LineToolRiskRewardLong"},{name:"LineToolRiskRewardShort"},{name:"LineToolPrediction"},{name:"LineToolDateRange"},{name:"LineToolPriceRange"},{name:"LineToolDateAndPriceRange"},{name:"LineToolBarsPattern"},{name:"LineToolGhostFeed"},{name:"LineToolProjection"}]]},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(39),s=i(14),a=i(83),l=i(59),c=i(150),h=i(716),u=i(31),d=i(303),p=function(t){function e(e){var i=t.call(this,e)||this;return i._scroll=null,i._handleScrollTop=function(){i.animateTo(Math.max(0,i.currentPosition()-(i.state.heightWrap-50)))},i._handleScrollBot=function(){i.animateTo(Math.min((i.state.heightContent||0)-(i.state.heightWrap||0),i.currentPosition()+(i.state.heightWrap-50)))},i._handleResizeWrap=function(t){var e=t.height;i.setState({heightWrap:e})},i._handleResizeContent=function(t){var e=t.height;i.setState({heightContent:e})},i._handleScroll=function(){var t=i.props.onScroll;t&&t(i.currentPosition(),i.isAtTop(),i.isAtBot()),i._checkButtonsVisibility()},i._checkButtonsVisibility=function(){var t,e,o,n,r;(i.props.isVisibleButtons||i.props.isVisibleFade)&&(t=i.state,e=t.isVisibleTopButton,o=t.isVisibleBotButton,n=i.isAtTop(),r=i.isAtBot(),
n||e?n&&e&&i.setState({isVisibleTopButton:!1}):i.setState({isVisibleTopButton:!0}),r||o?r&&o&&i.setState({isVisibleBotButton:!1}):i.setState({isVisibleBotButton:!0}))},i.state={heightContent:0,heightWrap:0,isVisibleBotButton:!1,isVisibleTopButton:!1},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){this._checkButtonsVisibility()},e.prototype.componentDidUpdate=function(t,e){e.heightWrap===this.state.heightWrap&&e.heightContent===this.state.heightContent||this._handleScroll()},e.prototype.currentPosition=function(){return this._scroll?this._scroll.scrollTop:0},e.prototype.isAtTop=function(){return this.currentPosition()<=1},e.prototype.isAtBot=function(){return this.currentPosition()+this.state.heightWrap>=this.state.heightContent-1},e.prototype.animateTo=function(t,e){if(void 0===e&&(e=u.dur),this._scroll){var i=r.findDOMNode(this._scroll);c.doAnimate({onStep:function(t,e){i.scrollTop=e},from:i.scrollTop,to:Math.round(t),easing:u.easingFunc.easeInOutCubic,duration:e})}},e.prototype.render=function(){var t,e,i,o,r,c=this,u=this.props,p=u.children,_=u.isVisibleScrollbar,f=u.isVisibleFade,m=u.isVisibleButtons,g=this.state,v=g.heightContent,y=g.heightWrap,b=g.isVisibleBotButton,S=g.isVisibleTopButton;return n.createElement(a,{whitelist:["height"],onMeasure:this._handleResizeWrap},n.createElement("div",{className:h.wrap},n.createElement("div",{className:s(h.scrollWrap,(t={},t[h.noScrollBar]=!_,t)),onScroll:this._handleScroll,ref:function(t){return c._scroll=t}},n.createElement(a,{onMeasure:this._handleResizeContent,whitelist:["height"]},n.createElement("div",{className:h.content},p))),f&&n.createElement("div",{className:s(h.fadeTop,(e={},e[h.isVisible]=S&&v>y,e))}),f&&n.createElement("div",{className:s(h.fadeBot,(i={},i[h.isVisible]=b&&v>y,i))}),m&&n.createElement("div",{className:s(h.scrollTop,(o={},o[h.isVisible]=S&&v>y,o)),onClick:this._handleScrollTop},n.createElement("div",{className:h.iconWrap},n.createElement(l.Icon,{icon:d,className:h.icon}))),m&&n.createElement("div",{className:s(h.scrollBot,(r={},r[h.isVisible]=b&&v>y,r)),onClick:this._handleScrollBot},n.createElement("div",{className:h.iconWrap},n.createElement(l.Icon,{icon:d,className:h.icon})))))},e.defaultProps={isVisibleScrollbar:!0},e}(n.PureComponent),e.VerticalScroll=p},function(t,e){t.exports={wrap:"wrap-1h7U5nKd-",scrollWrap:"scrollWrap-3gtPS0Fe-",noScrollBar:"noScrollBar-ieMwbfur-",content:"content-YhoA_L2m-",icon:"icon-2xObs8DI-",scrollBot:"scrollBot-2HHpZNuf-",scrollTop:"scrollTop-1eXi8ltS-",isVisible:"isVisible-3zZOL3TO-",iconWrap:"iconWrap-2Q69rfEO-",fadeBot:"fadeBot-3JstnoWq-",fadeTop:"fadeTop-3oJzNyTq-"}},function(t,e,i){"use strict";function o(t){return function(e){function i(t){var i=e.call(this,t)||this;return i._keyboardListener=new s,i._listener=i._keyboardListener.listen.bind(i._keyboardListener),i}return n.__extends(i,e),i.prototype.componentDidMount=function(){this._registerHandlers(this.props.keyboardEventHandlers)},i.prototype.componentWillReceiveProps=function(t){
Object.is(this.props.keyboardEventHandlers,t.keyboardEventHandlers)||this._registerHandlers(t.keyboardEventHandlers)},i.prototype.render=function(){return r.createElement(t,n.__assign({},this.props,{onKeyDown:this._listener}))},i.prototype._registerHandlers=function(t){t&&(this._keyboardListener.deleteAllHandlers(),this._keyboardListener.registerHandlers(t))},i}(r.PureComponent)}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),r=i(2),function(t){t[t.Enter=13]="Enter",t[t.Space=32]="Space",t[t.Backspace=8]="Backspace",t[t.DownArrow=40]="DownArrow",t[t.UpArrow=38]="UpArrow",t[t.RightArrow=39]="RightArrow",t[t.LeftArrow=37]="LeftArrow",t[t.Escape=27]="Escape",t[t.Tab=9]="Tab"}(e.KeyCode||(e.KeyCode={})),s=function(){function t(){this._handlers=new Map}return t.prototype.registerHandlers=function(t){var e=this;Object.keys(t).forEach(function(i){var o,n=parseInt(i),r=t[n];Array.isArray(r)||(r=[r]),e._handlers.has(n)?(o=e._handlers.get(n))&&r.forEach(function(t){return o.add(t)}):e._handlers.set(n,new Set(r))})},t.prototype.unregisterHandlers=function(t){var e=this;Object.keys(t).forEach(function(i){var o,n=parseInt(i),r=t[n];Array.isArray(r)||(r=[r]),e._handlers.has(n)&&(o=e._handlers.get(n))&&r.forEach(function(t){return o.delete(t)})})},t.prototype.deleteAllHandlers=function(){this._handlers=new Map},t.prototype.registerHandler=function(t,e){if(this._handlers.has(t)){var i=this._handlers.get(t);i&&i.add(e)}else this._handlers.set(t,new Set([e]))},t.prototype.unregisterHandler=function(t,e){if(this._handlers.has(t)){var i=this._handlers.get(t);i&&i.delete(e)}},t.prototype.listen=function(t){if(this._handlers.has(t.keyCode)){var e=this._handlers.get(t.keyCode);e&&e.forEach(function(e){return e(t)})}},t}(),e.KeyboardListener=s,e.makeKeyboardListener=o},function(t,e,i){"use strict";function o(t){var i=e.formatLayerId(t),o=document.getElementById(i);return o||(o=document.createElement("div"),o.id=i,document.body.appendChild(o)),c[t]=(c[t]||0)+1,o}function n(t){var i=e.formatLayerId(t),o=document.getElementById(i);c[t]&&(c[t]-=1),o&&0===c[t]&&document.body.removeChild(o)}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=i(0),s=i(2),a=i(39),l=0,c={},e.formatLayerId=function(t){return"__outside-render-"+t},h=function(t){function e(e){return t.call(this,e)||this}return r.__extends(e,t),e.prototype.componentDidMount=function(){this._rememberLayer(),this._renderLayer()},e.prototype.componentDidUpdate=function(t){this.props.layerId!==t.layerId&&(n(this._layerId),this._rememberLayer()),this._renderLayer()},e.prototype.componentWillUnmount=function(){a.unmountComponentAtNode(this._layer),n(this._layerId)},e.prototype.render=function(){return null},e.prototype._rememberLayer=function(){var t=this.props.layerId,e=void 0===t?l+++"":t;this._layerId=e,this._layer=o(e)},e.prototype._renderLayer=function(){a.render(s.createElement("div",null,this.props.children),this._layer)},e}(s.Component),e.OutsideRenderWrap=h},function(t,e){t.exports={menuWrap:"menuWrap-23ejLU7n-",isMeasuring:"isMeasuring-26jTjsBf-",
scrollWrap:"scrollWrap-2ReEQpR0-",menuBox:"menuBox-3CsColoQ-",isHidden:"isHidden-1CunrsTV-"}},function(t,e){t.exports={button:"button-263WXsg--",bg:"bg-1kRv1Pf2-",isBgFull:"isBgFull-CmoDGRQP-",icon:"icon-1Y-3MM9F-",hovered:"hovered--MYZioUu-",isActive:"isActive-2mI1-NUL-",isGrayed:"isGrayed-1kWObWVr-",isTransparent:"isTransparent-sRmateFl-",isHidden:"isHidden-2VzaskeU-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(23),s=i(24),a=i(298),l=i(26),c=i(308),h=i(66),u=i(208),d=i(85),p=i(152),_=i(724),f={icon:window.t("Icon")},m=10,g=function(t){function e(e){var i=t.call(this,e)||this;return i._renderItem=function(t){return n.createElement("div",{className:_.item,key:t,onClick:function(){i._handleSelect(t),d.globalClosePopupMenu()}},String.fromCharCode(t))},i._onChangeDrawingState=function(){i.setState({isActive:i._isActive()})},i._handleSelect=function(t){var e,n;a.saveDefaults("linetoolicon",o.__assign({},a.defaults("linetoolicon"),{icon:t})),l.tool.setValue("LineToolIcon"),e=i.state.recents,n=e.indexOf(t),-1!==n&&e.splice(n,1),e=[t].concat(e.slice(0,m-1)),s.setJSON("linetoolicon.recenticons",e),i.setState({current:t,recents:e})},i.state={current:a.defaults("linetoolicon").icon,recents:s.getJSON("linetoolicon.recenticons")||[]},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){l.tool.subscribe(this._onChangeDrawingState),s.onSync.subscribe(this,this._onSyncSettings)},e.prototype.componentWillUnmount=function(){l.tool.unsubscribe(this._onChangeDrawingState),s.onSync.unsubscribe(this,this._onSyncSettings)},e.prototype.render=function(){var t=this,e=this.props,i=e.isGrayed,o=e.toolName,s=this.state,a=s.current,l=s.isActive,d=s.recents;return n.createElement(u.ToolDropdown,{buttonClass:_.button,buttonIcon:n.createElement("div",{className:_.buttonIcon},String.fromCharCode(a||c.availableIcons[0])),buttonTitle:f.icon,isActive:l,isGrayed:i,onClickButton:function(){return t._handleSelect(a||c.availableIcons[0])},onClickWhenGrayed:function(){return r.emit("onGrayedObjectClicked",{type:"drawing",name:h.lineToolsInfo[o].localizedName})}},d&&[n.createElement("div",{key:"recent",className:_.wrap},d.map(this._renderItem)),n.createElement(p.PopupMenuSeparator,{key:"separator"})],n.createElement("div",{key:"all",className:_.wrap},c.availableIcons.map(this._renderItem)))},e.prototype._isActive=function(){return l.tool.value()===this.props.toolName},e.prototype._onSyncSettings=function(){this.setState({recents:s.getJSON("linetoolicon.recenticons")})},e}(n.Component),e.ToolButtonFontIcons=g},function(t,e){t.exports={dropdown:"dropdown-3_ASLzSj-",buttonWrap:"buttonWrap-3fZWypJl-",control:"control-1TyEfSIx-",arrow:"arrow-1cFKS5Ok-",arrowIcon:"arrowIcon-2wA7q8om-",isOpened:"isOpened-22vLOY9o-",isGrayed:"isGrayed-xr-mULNo-"}},function(t,e){t.exports={separator:"separator-25lkUpN--"}},function(t,e){t.exports={wrap:"wrap-2I6DAtXG-",buttonIcon:"buttonIcon-2rBwJ1QM-",item:"item-31XunD5q-",hovered:"hovered-2A1Cpat5-",button:"button-21ihqWJ8-"
}},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(66),s=i(6),a=i(151),l=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){i.props.saveDefaultOnChange&&s.saveDefaultProperties(!0),i.props.property.setValue(!i.props.property.value()),i.props.saveDefaultOnChange&&s.saveDefaultProperties(!1)},i.state={isActive:i.props.property.value()},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){this.props.property.subscribe(this,this._onChange)},e.prototype.componentWillUnmount=function(){this.props.property.unsubscribe(this,this._onChange)},e.prototype.render=function(){var t=this.props.toolName,e=this.state.isActive,i=r.lineToolsInfo[t];return n.createElement(a.ToolButton,{icon:e&&i.iconActive?i.iconActive:i.icon,isActive:e,onClick:this._handleClick,title:i.localizedName})},e.prototype._onChange=function(t){this.setState({isActive:t.value()})},e}(n.PureComponent),e.ToolButtonProperty=l},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(26),s=i(66),a=i(151),l=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){r.tool.setValue(i.props.toolName)},i._onChange=function(){i.setState({isActive:r.tool.value()===i.props.toolName})},i.state={isActive:r.tool.value()===i.props.toolName},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){r.tool.subscribe(this._onChange)},e.prototype.componentWillUnmount=function(){r.tool.unsubscribe(this._onChange)},e.prototype.render=function(){var t=this.props.toolName,e=this.state.isActive;return n.createElement(a.ToolButton,{icon:s.lineToolsInfo[t].icon,isActive:e,isTransparent:!0,onClick:this._handleClick,title:s.lineToolsInfo[t].localizedName})},e}(n.PureComponent),e.ToolButtonTool=l},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(239),s=i(307),a=i(728),l=i(31),c=function(t){function e(e){var i=t.call(this,e)||this;return i._boundUndoModel=null,i._handleClick=function(){var t=i._activeChartWidget().model();t&&t.zoomFromViewport()},i._syncUnzoomButton=function(){var t=i._activeChartWidget(),e=t.model(),o=!1;e?(i._boundUndoModel!==e&&(i._boundUndoModel&&i._boundUndoModel.zoomStack().onChange().unsubscribe(null,i._syncUnzoomButton),e.zoomStack().onChange().subscribe(null,i._syncUnzoomButton),i._boundUndoModel=e),o=!e.zoomStack().isEmpty()):t.withModel(null,i._syncUnzoomButton),i.setState({isVisible:o})},i.state={isVisible:!1},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){this.props.chartWidgetCollection.activeChartWidget.subscribe(this._syncUnzoomButton,{callWithLast:!0})},e.prototype.componentWillUnmount=function(){this.props.chartWidgetCollection.activeChartWidget.unsubscribe(this._syncUnzoomButton)},e.prototype.render=function(){return n.createElement(r.CSSTransitionGroup,{transitionName:{enter:a.enter,enterActive:a.enterActive,leave:a.leave},transitionEnter:!0,
transitionEnterTimeout:l.dur/2,transitionLeave:!0,transitionLeaveTimeout:.75*l.dur},this.state.isVisible&&n.createElement("div",{key:"button",className:a.item},n.createElement(s.ToolButtonAction,{action:this._handleClick,isTransparent:!0,toolName:"zoom-out"})))},e.prototype._activeChartWidget=function(){return this.props.chartWidgetCollection.activeChartWidget.value()},e}(n.PureComponent),e.ToolButtonZoomOut=c},function(t,e){t.exports={item:"item--pyC03Z7-",enter:"enter-q8JpeMGW-",enterActive:"enterActive-2R8N33Bn-",leave:"leave-3723J30--"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(26),s=i(23),a=i(66),l=i(309),c=i(208),h=i(153),u=i(70),d=i(732),p=function(t){function e(e){var i,n=t.call(this,e)||this;return n._onChangeDrawingState=function(){var t=n._getActiveToolIndex();n.setState({current:-1!==t?t:n.state.current,isActive:-1!==t})},n._handleClickButton=function(){var t=n._getCurrentToolName();n._selectTool(t)},n._handleClickItem=function(t){n._selectTool(t)},n._handleGrayedClick=function(t){s.emit("onGrayedObjectClicked",{type:"drawing",name:a.lineToolsInfo[t].localizedName})},n._handleShortcut=function(t){var e=n.props.lineTools.find(function(e){return e.name===t}),i=e&&e.shortcut;i&&i.immediately?n._drawLinetoolImmediately(t):n._selectTool(t)},n._drawLinetoolImmediately=function(t){var e=n.props.chartWidgetCollection.activeChartWidget.value();e.activePaneWidget&&e.activePaneWidget.drawRightThere(t)},n._handleClickFavorite=function(t){n.state.favState&&n.state.favState[t]?l.LinetoolsFavoritesStore.removeFavorite(t):l.LinetoolsFavoritesStore.addFavorite(t)},n._onAddFavorite=function(t){n.setState({favState:o.__assign({},n.state.favState,(e={},e[t]=!0,e))});var e},n._onRemoveFavorite=function(t){n.setState({favState:o.__assign({},n.state.favState,(e={},e[t]=!1,e))});var e},n._onSyncFavorites=function(){n.setState({favState:n._composeFavState()})},i=n._getActiveToolIndex(),n.state={current:-1===i?n._firstNonGrayedTool():i,favState:n._composeFavState(),isActive:-1!==i},n}return o.__extends(e,t),e.prototype.componentDidMount=function(){r.tool.subscribe(this._onChangeDrawingState),l.LinetoolsFavoritesStore.favoriteAdded.subscribe(null,this._onAddFavorite),l.LinetoolsFavoritesStore.favoriteRemoved.subscribe(null,this._onRemoveFavorite),l.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,this._onSyncFavorites)},e.prototype.componentWillUnmount=function(){r.tool.unsubscribe(this._onChangeDrawingState),l.LinetoolsFavoritesStore.favoriteAdded.unsubscribe(null,this._onAddFavorite),l.LinetoolsFavoritesStore.favoriteRemoved.unsubscribe(null,this._onRemoveFavorite),l.LinetoolsFavoritesStore.favoritesSynced.unsubscribe(null,this._onSyncFavorites)},e.prototype.componentDidUpdate=function(t,e){t.lineTools!==this.props.lineTools&&this.setState({favState:this._composeFavState()})},e.prototype.render=function(){
var t=this,e=this.props,i=e.favoriting,o=e.grayedTools,r=e.lineTools,s=this.state,l=s.current,p=s.favState,_=s.isActive,f=this._getCurrentToolName(),m=a.lineToolsInfo[f],g=this._showHint();return n.createElement("span",null,n.createElement(c.ToolDropdown,{buttonIcon:m.icon,buttonTitle:m.localizedName,isActive:_,onClickButton:this._handleClickButton},r.map(function(e,r){var s=e.name,c=a.lineToolsInfo[s],d=o[s];return n.createElement(u.PopupMenuItem,{key:s,dontClosePopup:d,forceShowHint:g,hint:e.shortcut&&e.shortcut.keys,icon:c.icon,isActive:_&&l===r,appearAsDisabled:d,label:c.localizedName,onClick:d?t._handleGrayedClick:t._handleClickItem,onClickArg:s,showToolboxOnHover:!p[s],toolbox:i&&!d?n.createElement(h.FavoriteButton,{isFilled:p[s],onClick:t._handleClickFavorite,onClickArg:s}):void 0})})),r.map(function(e,i){var o=e.name,r=e.shortcut;return r&&n.createElement(d.Shortcut,{handler:function(e){e.preventDefault(),t._handleShortcut(o)},key:o,keys:r.keys})}))},e.prototype._getCurrentToolName=function(){var t=this.state.current;return this.props.lineTools[t||0].name},e.prototype._firstNonGrayedTool=function(){var t=this.props,e=t.grayedTools;return t.lineTools.findIndex(function(t){return!e[t.name]})},e.prototype._getActiveToolIndex=function(){return this.props.lineTools.findIndex(function(t){return t.name===r.tool.value()})},e.prototype._showHint=function(){return this.props.lineTools.some(function(t){return"shortcut"in t})},e.prototype._selectTool=function(t){r.tool.setValue(t)},e.prototype._composeFavState=function(){var t={};return this.props.lineTools.forEach(function(e){t[e.name]=l.LinetoolsFavoritesStore.isFavorite(e.name)}),t},e}(n.PureComponent),e.ToolDropdownDrawings=p},function(t,e){t.exports={star:"star-uhAI7sV4-",checked:"checked-2bhy04CF-"}},function(t,e){t.exports={item:"item-2xPVYue0-",hovered:"hovered-1uf45E05-",isDisabled:"isDisabled-1wLqKupj-",isActive:"isActive-2j-GhQs_-",icon:"icon-2Qm7YIcz-",hint:"hint-1IhIvLPB-",toolbox:"toolbox-3ulPxfe--",withIcon:"withIcon-1xBjf-oB-",labelRow:"labelRow-3Q0rdE8--",label:"label-3Xqxy756-",showOnHover:"showOnHover-1q6ySzZc-"}},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(147),s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.componentDidMount=function(){r.bind(this.props.keys,this.props.handler)},e.prototype.componentDidUpdate=function(t){this.props.keys===t.keys&&this.props.handler===t.handler||(r.unbind(t.keys),r.bind(this.props.keys,this.props.handler))},e.prototype.componentWillUnmount=function(){r.unbind(this.props.keys)},e.prototype.render=function(){return null},e}(n.PureComponent),e.Shortcut=s},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(66),s=i(208),a=i(70),l={all:window.t("Remove Drawing Tools & Indicators"),drawings:window.t("Remove Drawing Tools"),studies:window.t("Remove Indicators")},c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this
;return e._handleRemoveDrawings=function(){e.props.chartWidgetCollection.activeChartWidget.value().removeAllDrawingTools()},e._handleRemoveStudies=function(){e.props.chartWidgetCollection.activeChartWidget.value().removeAllStudies()},e._handleRemoveAll=function(){e.props.chartWidgetCollection.activeChartWidget.value().removeAllStudiesDrawingTools()},e}return o.__extends(e,t),e.prototype.render=function(){return n.createElement(s.ToolDropdown,{buttonIcon:r.lineToolsInfo[this.props.toolName].icon,buttonTitle:l.drawings,onClickButton:this._handleRemoveDrawings},n.createElement(a.PopupMenuItem,{label:l.drawings,onClick:this._handleRemoveDrawings}),n.createElement(a.PopupMenuItem,{label:l.studies,onClick:this._handleRemoveStudies}),n.createElement(a.PopupMenuItem,{label:l.all,onClick:this._handleRemoveAll}))},e}(n.PureComponent),e.ToolDropdownRemove=c},function(t,e,i){"use strict";function o(t){return r.createElement("svg",{xmlns:l,width:"9",height:"27",viewBox:"0 0 9 27",className:s(a.container,"right"===t.direction?a.mirror:null)},r.createElement("g",{fill:"none",fillRule:"evenodd"},r.createElement("path",{className:a.background,d:"M4.5.5a4 4 0 0 1 4 4v18a4 4 0 1 1-8 0v-18a4 4 0 0 1 4-4z"}),r.createElement("path",{className:a.arrow,d:"M5.5 10l-2 3.5 2 3.5"})))}function n(t){return r.createElement("svg",{xmlns:l,width:"28",height:"9",viewBox:"0 0 28 9",className:s(a.container,"bottom"===t.direction?a.mirror:null)},r.createElement("g",{fill:"none",fillRule:"evenodd"},r.createElement("path",{className:a.background,d:"M4.5.5h19a4 4 0 1 1 0 8h-19a4 4 0 1 1 0-8z"}),r.createElement("path",{className:a.arrow,d:"M10.5 5.5l3.5-2 3.5 2"})))}var r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),r=i(2),s=i(14),a=i(735),l="http://www.w3.org/2000/svg",e.VerticalToolbarHider=o,e.HorizontalToolbarHider=n},function(t,e){t.exports={container:"container-3_8ayT2Q-",mirror:"mirror-crJbq8d0-",background:"background-Q1Fcmxly-",arrow:"arrow-WcYWFXUn-"}},function(t,e){t.exports={drawingToolbar:"drawingToolbar-U3_QXRof-",isHidden:"isHidden-2d-PYkzV-",inner:"inner-1xuW-gY4-",toggleButton:"toggleButton-13QgefpG-",collapsed:"collapsed-2trH0gCi-",group:"group-2JyOhh7Z-",separator:"separator-1BAqp1-l-"}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0})},function(t,e,i){"use strict";function o(t){return l.fetch("/theme/?themeName="+encodeURIComponent(t),{credentials:"include",method:"GET"}).then(function(t){return t.json()}).then(function(t){var e={};return t.content&&(e.content=JSON.parse(t.content)),e})}function n(){return u||l.fetch("/themes/",{credentials:"include",method:"GET"}).then(function(t){return u=t.json()})}function r(t,e){var i=new FormData;return i.append("content",JSON.stringify(e)),i.append("name",t),u=null,l.fetch("/save-theme/",{credentials:"include",method:"POST",body:i}).then(function(t){return t.json()},function(t){return h.logError(t)})}function s(t){var e=new FormData;return e.append("name",t),u=null,l.fetch("/remove-theme/",{credentials:"include",method:"POST",body:e}).then(function(t){
return t.json()},function(t){return h.logError(t)})}function a(t){return o(t).then(function(t){return!!t.content})}var l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),l=i(739),c=i(7),h=c.getLogger("Themes.Provider"),u=null,e.loadTheme=o,e.loadThemes=n,e.saveTheme=r,e.removeTheme=s,e.isThemeExist=a},function(t,e,i){"use strict";function o(t,e){return window.fetch(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=o},function(t,e,i){"use strict";function o(){return m||(m=new Promise(function(t){i.e(9).then(function(e){var o,n=i(1081),r=i(1082);t((o={},o[f.Light]=r,o[f.Dark]=n,o))}.bind(null,i)).catch(i.oe)})),m}function n(){return[f.Light,f.Dark]}function r(){return o().then(function(t){return e={},e[f.Light]=JSON.parse(t[f.Light]),e[f.Dark]=JSON.parse(t[f.Dark]),e;var e})}function s(t){return r().then(function(e){return e[t]})}function a(t){return g[t]||t}function l(t){return r().then(function(e){return n().some(function(i){return c(e[i],t)})})}function c(t,e){var i=t.content===e.content;return u(t.content,function(t,o){var n=p(t,e.content);return!(i=h(o,n))}),i}function h(t,e){if("string"==typeof t&&"string"==typeof e)try{return _.areEqualRgb(_.parseRgb(t),_.parseRgb(e))}catch(i){return t===e}return t===e}function u(t,e){void 0===t&&(t={});try{d(t,[],e)}catch(t){return}}function d(t,e,i){var o,n;for(o in t)if(t.hasOwnProperty(o))if(n=e.concat(o),"object"==typeof t[o])d(t[o],n,i);else if(i(n,t[o]))throw Error("exit")}function p(t,e){void 0===e&&(e={});var i=Function("obj","return obj."+t.join(".")+";");try{return i(e)}catch(t){return}}var _,f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),i(12),_=i(32),function(t){t.Light="light",t.Dark="dark"}(f=e.StdTheme||(e.StdTheme={})),m=null,v={},v[f.Light]=window.t("Light",{context:"colorThemeName"}),v[f.Dark]=window.t("Dark",{context:"colorThemeName"}),v.Black=window.t("Black",{context:"colorThemeName"}),v.Blue=window.t("Blue",{context:"colorThemeName"}),v.Grey=window.t("Grey",{context:"colorThemeName"}),v.White=window.t("White",{context:"colorThemeName"}),g=v,e.loadStdThemes=o,e.getStdThemeNames=n,e.getStdThemes=r,e.getStdChartTheme=s,e.translateThemeName=a,e.isStdTheme=l},function(t,e){t.exports={"color-active-hover-text":"color-gull-gray","color-alert-bg":"color-mirage-1","color-alert-text":"color-loblolly","color-border":"color-bright-gray","color-border-chat-fields":"color-bright-gray","color-border-hover":"color-trout-1","color-border-table":"color-bright-gray","color-brand":"color-picton-blue-1","color-brand-active":"color-curious-blue","color-brand-hover":"color-scooter","color-button-hover-bg":"color-mirage-3","color-chart-page-bg":"color-charade","color-depthrenderer-fill-style":"color-catskill-white","color-depthrenderer-stroke-style":"color-trout-1","color-disabled-border-and-color":"color-ebony-clay","color-disabled-input":"color-bright-gray","color-empty-container-message":"color-slate-gray","color-footer-chart-panel-bg":"color-mirage-3","color-highlight-new":"color-dark-slate-blue","color-icons":"color-slate-gray",
"color-input-bg":"color-charade","color-input-textarea-readonly":"color-trout-1","color-input-publish-bg":"color-mirage-1","color-item-active-blue":"color-blue-dianne","color-item-hover-active-bg":"color-charade","color-item-hover-bg":"color-ebony-clay","color-item-hover-blue":"color-blue-dianne","color-item-selected-blue":"color-blue-dianne","color-link":"color-curious-blue","color-list-item":"color-slate-gray","color-list-nth-child-bg":"color-mirage-3","color-news-highlight":"color-charade","color-pane-bg":"color-mirage-1","color-placeholder":"color-trout-2","color-popup-bg":"color-mirage-3","color-popup-menu-separator":"color-bright-gray","color-row-hover-active-bg":"color-ebony-clay","color-sb-scrollbar-body-bg":"color-trout-2","color-screener-header-bg":"color-mirage-3","color-screener-header-bg-hover":"color-ebony-clay","color-section-separator-border":"color-bright-gray","color-separator-table-chat":"color-bright-gray","color-tag-active-bg":"color-bright-gray","color-tag-hover-bg":"color-charade","color-text-regular":"color-loblolly","color-text-secondary":"color-trout-1","color-toolbar-button-text-active":"color-picton-blue-1","color-toolbar-interactive-element-text-normal":"color-slate-gray","color-toolbar-interactive-element-text-hover":"color-gull-gray","color-toolbar-opened-element-bg":"color-mirage-3","color-tooltip-bg":"color-bright-gray","color-tv-button-checked":"color-slate-gray","color-tv-dialog-caption":"color-athens-gray-2","color-tv-dropdown-item-hover-bg":"color-charade","color-underlined-text":"color-gull-gray","color-widget-pages-bg":"color-mirage-2"}},function(t,e,i){"use strict";function o(t,e){var i,r;return void 0===e&&(e=[]),(i=n[t])?l.test(i)?i:(r=i,e.push(t),-1!==e.indexOf(r)?(console.warn("Colors definitions cycled"),i):e.length>a?(console.warn("Too many variables-link in HEX-color search: "+e[0]),null):o(r,e)):null}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(743),r=i(9),s={},a=Object.keys(n).length,l=/^#[0-9A-F]{6}$/i,Object.keys(n).forEach(function(t){var e=o(t);s[t]=r.ensureNotNull(e)}),e.colorsPalette=s},function(t,e){t.exports={"color-aqua-spring":"#ebf9f5","color-army-green":"#3d2c12","color-army-green-2":"#31230d","color-athens-gray-1":"#f2f3f5","color-athens-gray-2":"#f7f8fa","color-athens-gray-3":"#eceff2","color-black":"#000000","color-blue-dianne":"#21384d","color-bright-gray":"#363c4e","color-carnation":"#f04561","color-catskill-white":"#e1ecf2","color-charade":"#2f3241","color-charcoal-grey":"#323337","color-curious-blue":"#299dcd","color-dark-blue-grey":"#123440","color-dark-grey":"#292a2d","color-dark-grey-blue":"#28415a","color-dark-sky-blue":"#37a6ef","color-dark-slate-blue":"#194453","color-deep-sea-blue":"#016087","color-ebony-clay":"#262b3e","color-foam":"#d7f0fb","color-gull-gray":"#9db2bd","color-humming-bird":"#d3eef9","color-keppel-1":"#37bc9b","color-keppel-2":"#34b293","color-lavender-blush":"#ffedf0","color-loblolly":"#c5cbce","color-manatee":"#878ca8","color-mandy":"#eb4d5c","color-milk-chocolate":"#6f2626","color-mirage-1":"#131722",
"color-mirage-2":"#171b29","color-mirage-3":"#1c2030","color-mischka":"#d6d8e0","color-morning-glory":"#9addcc","color-oslo-gray":"#8b8e95","color-pale":"#fff2cf","color-pale-sky":"#6b7988","color-picton-blue-1":"#3bb3e4","color-picton-blue-2":"#41bef1","color-puerto-rico":"#3bc2a1","color-purple-brown":"#4e2934","color-purple-brown-2":"#3d2028","color-radical-red":"#ff4a68","color-regent-gray":"#8797a5","color-scooter":"#38acdb","color-silver-tree":"#53b987","color-slate-gray":"#758696","color-sundown":"#ffa4b3","color-sunglow":"#ffca3b","color-tan-hide":"#ff9850","color-trout-1":"#4c525e","color-trout-2":"#4f5966","color-violet-1":"#332738","color-violet-2":"#271d2b","color-water-blue":"#1592e6","color-white":"#ffffff","color-white-ice":"#ebf7fc","color-wild-watermelon":"#ff5773","color-active-hover-text":"color-black","color-alert-bg":"color-white","color-alert-text":"color-black","color-border-table":"color-athens-gray-3","color-brand":"color-picton-blue-1","color-brand-active":"color-curious-blue","color-brand-hover":"color-scooter","color-brand-light":"color-picton-blue-2","color-chart-page-bg":"color-athens-gray-3","color-danger":"color-radical-red","color-depthrenderer-stroke-style":"color-athens-gray-1","color-highlight-new":"color-pale","color-input-bg":"color-white","color-input-publish-bg":"color-white","color-link":"color-brand","color-list-nth-child-bg":"color-athens-gray-2","color-pane-bg":"color-white","color-popup-bg":"color-white","color-popup-menu-separator":"color-catskill-white","color-replay-data-mode":"color-radical-red","color-screener-header-bg":"color-athens-gray-2","color-success":"color-keppel-1","color-toolbar-button-text-active":"color-water-blue","color-toolbar-interactive-element-text-normal":"color-trout-1","color-toolbar-interactive-element-text-hover":"color-mirage-1","color-toolbar-opened-element-bg":"color-athens-gray-2","color-tooltip-bg":"color-ebony-clay","color-tv-dialog-caption":"color-trout-2","color-tv-dropdown-item-hover-bg":"color-athens-gray-1","color-underlined-text":"color-slate-gray","color-widget-pages-bg":"color-white","color-growing":"color-keppel-1","color-falling":"color-radical-red","color-label-long":"color-success","color-label-short":"color-danger","color-label-education":"color-sunglow","color-label-neutral":"color-gull-gray","color-collapse-tabs-border":"color-athens-gray-3","color-border":"#dadde0","color-border-chat-fields":"#c9cbcd","color-border-hover":"#c8c8c8","color-button-hover-bg":"#f2f2f2","color-depthrenderer-fill-style":"#555555","color-disabled-border-and-color":"#ececec","color-disabled-input":"#ececec","color-empty-container-message":"#8a8a8a","color-footer-chart-panel-bg":"#f1f3f6","color-icons":"#7d7d7d","color-input-textarea-readonly":"#555555","color-item-active-blue":"#eff9ff","color-item-hover-active-bg":"#f1f3f6","color-item-hover-bg":"#edf1f2","color-item-hover-blue":"#c6e9f8","color-item-selected-blue":"#eafafe","color-list-item":"#888989","color-news-highlight":"#f2f5f8","color-placeholder":"#adaeb0",
"color-row-hover-active-bg":"#f1f3f6","color-sb-scrollbar-body-bg":"#d8d8d8","color-screener-header-bg-hover":"#f1f3f6","color-section-separator-border":"#b5b7b9","color-separator-table-chat":"#eaecef","color-tag-active-bg":"#cfdce3","color-tag-hover-bg":"#dce6ea","color-text-regular":"#4a4a4a","color-text-secondary":"#b4b4b4","color-tv-button-checked":"#757575","color-seeking-alpha-brand":"#ff7200"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(745),n=i(92),r=i(40),s=i(10),a=i(17),l=i(211),c=i(24),h={confirmDelete:window.t("Do you really want to delete Study Template '{0}' ?")},u=function(){function t(t){var e=this;this._chartWidgetCollection=t.chartWidgetCollection,this._favoriteStudyTemplatesService=t.favoriteStudyTemplatesService,window.loginStateChange.subscribe(null,n.invalidateStudyTemplatesList),this._list=new a([]),this._onChange=new s,this._list.subscribe(function(){return e._onChange.fire()})}return t.prototype.showSaveAsDialog=function(){var t=this,e=this._chartWidgetCollection.activeChartWidget.value();new o.StudyTemplateSaver({chartWidget:e,onSave:function(e){t._list.setValue(e)}}).show()},t.prototype.applyTemplate=function(t){var e=this._chartWidgetCollection.activeChartWidget.value();c.setValue("defaultStudyTemplate",t),n.getStudyTemplateContent(t,function(i){r.trackEvent("GUI","Load Study Template"),e.model().model().restoreStudyTemplate(JSON.parse(i.content),t),e.updateSeriesControlUI()})},t.prototype.deleteStudyTemplate=function(t){var e=this;window.runOrSignIn(function(){var i=l.createConfirmDialog({type:"modal",content:h.confirmDelete.format(t)});i.on("action:yes",function(i){i.actionLoader("yes","start"),n.invalidateStudyTemplatesList(),n.removeStudyTemplate(t,function(){var o,n=e.list();e._list.setValue(n.filter(function(e){return e.name!==t})),e._favoriteStudyTemplatesService&&(o=e._favoriteStudyTemplatesService.get(),e._favoriteStudyTemplatesService.set(o.filter(function(e){return e!==t}))),setTimeout(function(){i.actionLoader("yes","stop"),i.close()},0)})}),i.open()},{source:"Study templates delete"})},t.prototype.list=function(){return this._list.value()},t.prototype.plainList=function(t){var e,i=this.list();return e="default"===t?i.filter(function(t){return!!t.is_default}):i.filter(function(t){return!t.is_default}),e.map(function(t){return t.name})},t.prototype.getOnChange=function(){return this._onChange},t.prototype.refreshStudyTemplateList=function(t){var e=this;n.getStudyTemplatesList(function(i){e._list.setValue(i),void 0!==t&&t()})},t}(),e.StudyTemplates=u},function(t,e,i){"use strict";function o(t,e){return new h.SaveRenameDialog({fields:[new h.AutocompleteField({name:d,label:_.saveRenameDialog.titleFieldLabel+":",error:_.saveRenameDialog.titleFieldError,source:t,valueField:"name",textField:"name",maxLength:64}),new h.CheckboxField({name:p,label:_.saveRenameDialog.intervalFieldLabel,hint:_.saveRenameDialog.intervalFieldHint.format(e)})],title:_.saveRenameDialog.dialogTitle}).show().then(function(t){return{title:t[d],
saveInterval:!!t[p]}})}function n(t){return new Promise(function(e){var i=c.createConfirmDialog({type:"modal",content:_.confirmDialog.title.format(t)});i.on("action:yes",function(t){e(),t.close()}),i.open()})}function r(t,e){u.saveStudyTemplate(t,function(i){i.error||(a.setValue("defaultStudyTemplate",t.name),u.invalidateStudyTemplatesList(),u.getStudyTemplatesList(e))})}var s,a,l,c,h,u,d,p,_,f;Object.defineProperty(e,"__esModule",{value:!0}),s=i(0),a=i(24),l=i(295),c=i(211),h=i(154),u=i(92),d="text",p="bool",_={saveRenameDialog:{dialogTitle:window.t("Save Indicator Template As"),titleFieldLabel:window.t("Template name"),titleFieldError:window.t("Please enter template name"),intervalFieldLabel:window.t("Save Interval"),intervalFieldHint:window.t("When selecting this checkbox the study template will set {0} interval on a chart")},confirmDialog:{title:window.t("Study Template '{0}' already exists. Do you really want to replace it?")}},f=function(){function t(t){var e=this;this._showSaveDialog=function(){return s.__awaiter(e,void 0,void 0,function(){var t,e,i;return s.__generator(this,function(n){switch(n.label){case 0:return t=this._chartWidget.model().model().mainSeries().interval(),[4,this._getActualTemplateList()];case 1:return e=n.sent(),[4,o(e,t)];case 2:return i=n.sent(),this._doSave(i.title,i.saveInterval,e),[2]}})})},this._chartWidget=t.chartWidget,t.onSave&&(this._onSave=t.onSave)}return t.prototype.show=function(){window.runOrSignIn(this._showSaveDialog,{source:"Study templates save as",sourceMeta:"Chart"})},t.prototype._doSave=function(t,e,i){return s.__awaiter(this,void 0,void 0,function(){var o,a,c,h;return s.__generator(this,function(s){switch(s.label){case 0:return t=l.clean(t),o=this._chartWidget.model().model().studyTemplate(e),a=JSON.stringify(o),c={name:t,content:a},h=i.map(function(t){return t.name}).includes(t),h?[4,n(t)]:[3,2];case 1:s.sent(),s.label=2;case 2:return r(c,this._onSave),[2]}})})},t.prototype._getActualTemplateList=function(){return u.invalidateStudyTemplatesList(),new Promise(function(t){u.getStudyTemplatesList(t)})},t}(),e.StudyTemplateSaver=f},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n,r;Object.defineProperty(e,"__esModule",{value:!0}),e.AutocompleteField=void 0,n=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),r=i(747),e.AutocompleteField=function(){function t(e){var i=e.label,n=e.name,s=e.maxLength,a=e.error,l=void 0===a?"":a,c=e.source,h=e.valueField,u=e.textField;o(this,t),this._name=n,this._valueField=h,this._textField=u,this._error=l,this._$field=$('<label class="tv-rename-chart-dialog__field">\n\t\t\t\t<span class="tv-rename-chart-dialog__label">'+i+'</span>\n\t\t\t\t<tv-autocomplete name="'+n+'"><tv-autocomplete>\n\t\t\t</label>'),this._autocomplete=new r.Autocomplete({
el:this._$field.find("tv-autocomplete").get(0),source:new r.ArraySource(c),textField:this._textField,maxLength:s}),this._preventDialogEvents()}return n(t,[{key:"appendTo",value:function(t){t.append(this._$field)}},{key:"focus",value:function(){this._autocomplete.input.focus()}},{key:"select",value:function(){this._autocomplete.input.focus(),this._autocomplete.input.select()}},{key:"_preventDialogEvents",value:function(){var t=this,e=function(t){return t.stopPropagation()};this._autocomplete.stream.addListener(r.events.BEFORE_OPEN_MENU,function(){t._$field.on("keypress keyup",e)}),this._autocomplete.stream.addListener(r.events.AFTER_CLOSE_MENU,function(){t._$field.off("keypress keyup",e)})}},{key:"value",get:function(){return this._autocomplete.value[this._valueField]}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!!this._autocomplete.input.value}},{key:"error",get:function(){return this._error}}]),t}()},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(748),e.Autocomplete=o.Autocomplete,e.ArraySource=o.ArraySource,n=i(315),e.events=n.events},function(t,e,i){"use strict";(function(t){function o(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var a,l,c,h,u,d,p,_,f,m;Object.defineProperty(e,"__esModule",{value:!0}),e.ArraySource=e.Autocomplete=void 0,a=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(749),l=i(91),c=n(l),h=i(394),u=i(751),d=i(754),p=i(123),_=o(p),f=i(315),m=i(755),e.Autocomplete=function(){function e(i){var o=i.el,n=i.source,r=i.textField,a=void 0===r?"text":r,l=i.userpicField,c=void 0===l?"userpic":l,h=i.maxLength;s(this,e),this._el=o,this._$el=$(o),this._source=n,this._tmpl=t.render(m,{maxLength:h}),this._textField=a,this._userpicField=c,this._init()}return a(e,[{key:"_init",value:function(){this.stream=new c.default;var t=this._el.querySelector("input");this._el.innerHTML=this._tmpl,this.input=this._el.querySelector("input"),t&&(this.input.parentNode.replaceChild(t,this.input),this.input=t),this.input.addEventListener("input",this._onInput.bind(this)),this.input.addEventListener("focus",this._onInput.bind(this)),this.input.addEventListener("blur",this._onBlur.bind(this)),this._$el.on("beforeOpenMenu",this._onBeforeOpenMenu.bind(this)),this._$el.on("afterCloseMenu",this._onAfterCloseMenu.bind(this)),this._dropdown=new h.DropdownView(this._$el),this._initMenu(),this._regHandlers()}},{key:"_initMenu",value:function(t){var e=this;this._menu=new u.Menu({
el:this._el.querySelector("tv-menu"),itemClass:"tv-autocomplete__dropdown-item tv-dropdown__item",textField:this._textField,userpicClass:"tv-autocomplete__userpic",userpicField:this._userpicField}),this._menu.stream.addListener(u.events.SELECT,function(t){if(!t[e._textField])return void e.stream.emitEvent(f.events.SELECT_CUSTOM,[t]);e.input.value=t[e._textField],e._dropdown.close(),e.stream.emitEvent(f.events.SELECT,[t])})}},{key:"_regHandlers",value:function(){var t,e,i=this;this._closeStateKeyboardListener=new d.KeyboardListener,this._closeStateKeyboardListener.regHandlers((t={},r(t,_.UP_ARROW,function(){i._dropdown.open()}),r(t,_.DOWN_ARROW,function(){i._dropdown.open()}),r(t,_.ENTER,function(){i._menu.select()}),t)),this._openStateKeyboardListener=new d.KeyboardListener,this._openStateKeyboardListener.regHandlers((e={},r(e,_.UP_ARROW,function(){i._menu.prev()}),r(e,_.DOWN_ARROW,function(){i._menu.next()}),r(e,_.ENTER,function(){i._menu.select()}),r(e,_.ESC,function(){i._dropdown.close()}),e)),this._closeStateKeyboardListener.watchOn(this.input)}},{key:"_onBlur",value:function(){this._dropdown.close()}},{key:"_onInput",value:function(){var t=this;this._menu.highlight(this.input.value),this._source.find(this.input.value,this._textField).then(function(e){t._menu.updateItems(e),e.length?t._dropdown.open():t._dropdown.close()})}},{key:"_onAfterCloseMenu",value:function(){this._openStateKeyboardListener.stopWatching(),this._closeStateKeyboardListener.watchOn(this.input),this._menu.reset(),this.stream.emitEvent(f.events.AFTER_CLOSE_MENU)}},{key:"_onBeforeOpenMenu",value:function(){this._closeStateKeyboardListener.stopWatching(),this._openStateKeyboardListener.watchOn(this.input),this.stream.emitEvent(f.events.BEFORE_OPEN_MENU)}},{key:"value",get:function(){return this.input.value!==this._menu.value[this._textField]?r({},this._textField,this.input.value):this._menu.value}}]),e}(),e.ArraySource=function(){function t(e){s(this,t),this._array=e}return a(t,[{key:"find",value:function(t,e){var i=this._array.filter(function(i){return i[e].toLowerCase().includes(t.toLowerCase())});return Promise.resolve(i)}},{key:"getItems",value:function(){return Promise.resolve(this._array)}}]),t}()}).call(e,i(41))},function(t,e){},function(t,e){},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(752),Object.defineProperty(e,"Menu",{enumerable:!0,get:function(){return o.Menu}}),n=i(312),Object.defineProperty(e,"events",{enumerable:!0,get:function(){return n.events}})},function(t,e,i){"use strict";(function(t){function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c,h,u,d,p,_;Object.defineProperty(e,"__esModule",{value:!0}),e.Menu=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),i(753),s=i(91),a=o(s),
l=i(312),c=i(313),h="tv-menu-item",u='<tv-menu-item class="{{itemClass}} {{activeClass}}" data-item="{{item}}">{{#userpic}}<img class="{{userpicClass}}" src="{{userpic}}">{{/userpic}}{{{html}}}</tv-menu-item>',d="prev",p="next",_=function(t,e){var i=Math.min(t.length,e.length),o=void 0;for(o=0;o<i&&t.charAt(o).toLowerCase()===e.charAt(o).toLowerCase();o++);return o>0?"<strong>"+(0,c.htmlEscape)(t.slice(0,o))+"</strong>"+(0,c.htmlEscape)(t.slice(o)):(0,c.htmlEscape)(t)},e.Menu=function(){function e(t){var i=t.el,o=t.items,r=t.itemClass,s=t.textField,a=void 0===s?"text":s,l=t.userpicField,c=void 0===l?"userpic":l,h=t.userpicClass;n(this,e),this._el=i,this._items=o,this._itemClass=r,this._textField=a,this._userpicField=c,this._userpicClass=h,this._hightlighted="",this._init()}return r(e,[{key:"_init",value:function(){this._el.setAttribute("tabindex","1"),this.stream=new a.default,this.updateItems(this._items),this._el.addEventListener("mousedown",function(t){t.preventDefault()}),this._el.addEventListener("click",this._onClick.bind(this))}},{key:"updateItems",value:function(t){this._items=t,t&&this._renderItems(t),this._menuItems=this._el.querySelectorAll(h),this._selectedItem=this._el.querySelector(h+".i-active"),this._setFocusOnItem(this._selectedItem)}},{key:"next",value:function(){this._moveFocusTo(p)}},{key:"prev",value:function(){this._moveFocusTo(d)}},{key:"reset",value:function(){return this._selectedItem?void this._setFocusOnItem(this._selectedItem):this._focusedItem?void this._blur():void 0}},{key:"select",value:function(){this._selectedItem=this._focusedItem,this.stream.emitEvent(l.events.SELECT,[this.value])}},{key:"highlight",value:function(t){null==t?t="":t+="",this._hightlighted!==t&&(this._hightlighted=t,this.updateItems(this._items))}},{key:"_moveFocusTo",value:function(t){var e=this._getFocusedItemIdx(),i=this._menuItems.length-1,o=void 0;switch(t){case p:o=this._findActiveItem(t,++e)||this._findActiveItem(t,0);break;case d:o=this._findActiveItem(t,--e)||this._findActiveItem(t,i)}this._setFocusOnItem(o)}},{key:"_getFocusedItemIdx",value:function(){var t=this;return Array.prototype.findIndex.call(this._menuItems,function(e){return Object.is(e,t._focusedItem)})}},{key:"_findActiveItem",value:function(t,e){for(var i=this._menuItems[e];i&&i.classList.contains("i-disabled");)switch(t){case"next":i=this._menuItems[e++];break;case"prev":i=this._menuItems[e--]}return i}},{key:"_setFocusOnItem",value:function(t){t&&!t.classList.contains("i-disabled")?(this._blur(),this._focusedItem=t,this._focus()):this._focusedItem=null}},{key:"_focus",value:function(){this._focusedItem&&this._focusedItem.classList.add("i-active")}},{key:"_blur",value:function(){this._focusedItem&&this._focusedItem.classList.remove("i-active")}},{key:"_onClick",value:function(t){var e=!t.target.classList.contains("i-disabled");t.target.tagName===h.toUpperCase()&&e&&(this._setFocusOnItem(t.target),this.select())}},{key:"_renderItems",value:function(e){var i=this,o={items:e,itemClass:this._itemClass,userpicClass:this._userpicClass,
activeClass:function(){var t=i._hightlighted,e=this[i._textField];if(t&&e&&t.toLowerCase()===e.toLowerCase())return"i-active"},text:function(){return this[i._textField]},html:function(){return _(this[i._textField],i._hightlighted)},userpic:function(){return this[i._userpicField]},item:function(){return JSON.stringify(this)}},n="{{#items}}"+u+"{{/items}}";this._el.innerHTML=t.render(n,o)}},{key:"value",get:function(){var t=void 0;try{t=JSON.parse(this._selectedItem.dataset.item)}catch(e){t={}}return t}}]),e}()}).call(e,i(41))},function(t,e){},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(123),Object.keys(o).forEach(function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return o[t]}})}),n=i(314),Object.defineProperty(e,"KeyboardListener",{enumerable:!0,get:function(){return n.KeyboardListener}})},function(t,e){t.exports='<div class="tv-dropdown-behavior tv-autocomplete__wrapper">\n\t<input class="tv-control-input tv-dropdown-behavior__button" type="text" {{#maxLength}}maxlength="{{ maxLength }}"{{/maxLength}}>\n\t<tv-menu class="tv-dropdown-behavior__body tv-dropdown__body tv-dropdown__body--under-trigger tv-autocomplete__dropdown i-hidden">\n\t</tv-menu>\n</div>\n'},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),e.CheckboxField=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(204),a=o(s),e.CheckboxField=function(){function t(e){var i=e.label,o=e.name,r=e.error,s=void 0===r?"":r,l=e.hint;n(this,t),this._name=o,this._error=s,this._checkboxView=new a.default({labelRight:i,name:o}),this._checkboxView.$el.addClass("tv-rename-chart-dialog__field"),l&&this._checkboxView.$el.append('<span class="tv-rename-chart-dialog__hint apply-common-tooltip" title=\''+l+"'></span>")}return r(t,[{key:"appendTo",value:function(t){t.append(this._checkboxView.$el)}},{key:"focus",value:function(){}},{key:"select",value:function(){}},{key:"value",set:function(t){this._checkboxView.checked=t},get:function(){return this._checkboxView.checked}},{key:"name",get:function(){return this._name}},{key:"valid",get:function(){return!0}},{key:"error",get:function(){return this._error}}]),t}()},function(t,e,i){"use strict";function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,
enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var s,a;Object.defineProperty(e,"__esModule",{value:!0}),e.InputFieldRegExp=void 0,s=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(154),e.InputFieldRegExp=function(t){function e(t){var i,r;return o(this,e),i=t.regExp,delete t.regExp,r=n(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t)),r._regExp=i,r}return r(e,t),s(e,[{key:"valid",get:function(){return this._regExp.test(this._$input.val())}}]),e}(a.InputField)},function(t,e){},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(174),r=function(t){function e(e,i){return t.call(this,e,i,"FAVORITE_STUDY_TEMPLATES_CHANGED","StudyTemplates.quicks",[])||this}return o.__extends(e,t),e}(n.CommonJsonStoreService),e.FavoriteStudyTemplateService=r},function(t,e,i){"use strict";function o(t,e,i,o){null===a&&(a=(0,r.createDialog)({width:i||600,closeOnOutsideClick:!1,destroyOnClose:!0,type:"modal",contentWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--no-border"><div class="tv-text tv-text--position-outside"></div></div>',actionsWrapTemplate:'<div class="tv-dialog__section tv-dialog__section--actions tv-dialog__section--actions-adaptive tv-dialog__section--no-border">',title:t,content:e,actions:[{name:"reconnect",type:"primary",text:$.t("Reconnect")},{name:"report",type:"primary",text:$.t("Report a data issue")}]}).on("action:reconnect",function(t){t.close(),o()}).on("action:report",function(t){t.setDestroyOnClose(!1),t.close(),runOrSignIn(function(){},{source:"Report data issue from disconnect dialog"})}).on("destroy",function(){a=null}).open())}function n(t){(0,s.trackEvent)("System","Critical Error"),o($.t("Oops, something went wrong"),$.t("Please report the issue or click Reconnect."),500,t)}var r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),e.showCriticalErrorMessage=n,r=i(65),s=i(40),a=null},function(t,e,i){"use strict";(function(e,o,n){function r(t,i,n){this.HIGHLIGHT_STUDY_NUM_FLICKS=2,this.SCROLL_TOLERANCE=10,this._BASIC_STUDIES_PACKAGE_NAME="tv-basicstudies",this._CUSTOM_STUDIES_PACKAGE_NAME="Script$USER",this._PUBLISHED_STUDIES_PACKAGE_NAME="Script$PUB",this._STANDARD_STUDIES_PACKAGE_NAME="Script$STD",this._SCRIPTING_PACKAGE_NAME="tv-scripting",this._FUNDAMENTAL_PACKAGE_NAME="Script$EDGR",this._BASIC_STUDIES_PAGE_NAME=e.enabled("plain_studymarket")?$.t("Technical Analysis"):$.t("Built-ins"),this._FUNDAMENTALS_PAGE_NAME=$.t("Fundamentals"),this._dialog=null,this._selectedStudy=null,this._keyDownListener=null,this.visibilityChanged=new o,this._chartWidgetCollection=t,this._chart=t.activeChartWidget.value(),this._options=$.extend({},this.DEFAULT_OPTIONS,n||{}),this.concretizeOptions(),this._user=i,this.setup(),this.favsModel=T.getInstance(),
this.favsModel.favoritesChanged().subscribe(this,this.updateFavorites)}var s,a,l,c=i(9).assert,h=i(23),u=i(173).SidebarCustomScroll,d=i(33),p=i(65).createDialog,_=(i(112).createConfirmDialog,i(145).createNoticeDialog),f=i(316).createSearchControl,m=i(31),g=i(24),v=i(201),y=i(71),b=i(318).AddSymbolCheckbox,S=i(121),w=i(123),T=i(766).FavoriteScriptsModel,C=i(314).KeyboardListener,x=i(319),P=i(7).getLogger("Chart.StudyMarket");i(767),i(768),i(175),s='<div class="tv-insert-indicator-dialog__body js-dialog__scroll-wrap"><div class="tv-insert-indicator-dialog__left-panel">{{^minimized}}<div id="js-search-placeholder"></div>{{/minimized}}<div class="tv-insert-indicator-dialog__left-panel-content-wrapper js-left-panel-wrapper"><div class="tv-insert-indicator-dialog__tabs-viewport js-tabs-viewport"><div class="tv-insert-indicator-dialog__tabs-container js-tabs-container"></div></div></div></div><div class="tv-insert-indicator-dialog__right-panel js-right-panel">{{#minimized}}{{#withSearch}}<div id="js-search-placeholder"></div>{{/withSearch}}{{/minimized}}<div class="tv-insert-indicator-dialog__pages js-pages"></div></div></div>',a='<div class="tv-insert-indicator-dialog__tabs-group"><div class="tv-insert-indicator-dialog__tab tv-insert-indicator-dialog__tab--group-head js-tab js-tab-head">{{title}}<span class="tv-caret"></span></div><div class="tv-insert-indicator-dialog__tabs"></div></div>',l='<div class="js-study-item tv-insert-study-item {{^withFavorites}}i-without-stars{{/withFavorites}}">{{#withFavorites}}<div class="tv-insert-study-item__favorite-icon js-favorite-icon"><span class="tv-insert-study-item__star tv-insert-study-item__star--filled">'+i(209)+'</span><span class="tv-insert-study-item__star tv-insert-study-item__star--empty">'+i(210)+'</span></div>{{/withFavorites}}<div class="tv-insert-study-item__title"><div class="tv-insert-study-item__title-text" title="{{titleTooltip}}">{{{title}}}</div></div></div>',r.prototype.destroy=function(){},r.prototype.setup=function(){this._initialized=!1,this._loadMore=null,this._$economyTabInput=null,this._$symbolSearchPopup=null,this._market=null,this._studies=null,this._packagesWithTabNames={},this._pages={},this._tabs={},this._subProductIds={},this.favsChanged=new o,this._previousInviteOnlyStudiesIds=[],this.studiesReady=new $.Deferred,this.marketPagesReady=new $.Deferred,this._pubSearchCount=[0,0,0],this._pubSearchCanLoad=[!0,!0,!0],this._pubSearchEntries=[],this._pubSearchCache=[],this._pubSearchDfd=null,this._pubSearchPageShown=!1,this._w_market_tabs=null,this._w_technical_tabs=null},r.prototype.init=function(){if(this._initialized)return void this.getStudyInfo();this.setupMarketInfo(),this.getStudyInfo(),this.setUser(this._user),this.prepareLayout(),this.attachHandlers(),this._initialized=!0},r.prototype.DEFAULT_OPTIONS={onWidget:!1,hideMarketPages:!1,selectBasicPage:!0,minimized:!1,searchKeywords:{earning:RegExp("EPS"),earnings:RegExp("EPS"),"trailing twelve months":RegExp("TTM")}},r.prototype._PAGE_KEY="studyMarket.page",
r.prototype._ECONOMY_TAB=$.t("Economy & Symbols"),r.prototype._PUB_SEARCH_ENTRIES_ON_PAGE=20,r.prototype.loadFavorites=function(){this.favsModel.loadFavs()},r.prototype.concretizeOptions=function(){e.enabled("study_market_minimized")&&(this._options.hideMarketPages=!0,this._options.selectBasicPage=!0,this._options.minimized=!0),this._options.onWidget&&(this._options.hideMarketPages=!0)},r.prototype.setupMarketInfo=function(){},r.prototype.getStudyInfo=function(){this._chart.withModel(this,function(){this.setupStudyInfo()})},r.prototype.setupStudyInfo=function(){var t=this._chartWidgetCollection.activeChartWidget.value().model().studiesMetaData();t.length;this._studies={},t=t.filter(function(t){return!this.isHidedStudy(t)},this),t.forEach(function(t){var e,i=this.getStudyPackageName(t.id);!(this._options.minimized&&i!==this._BASIC_STUDIES_PACKAGE_NAME||this._options.onWidget&&d.isScriptStrategy(t))&&(e=this.resolvePackageName(i),c(void 0!==e,"Cannot resolve packageName "+i),this._studies[e]=this._studies[e]||[],this._studies[e].push(t))}.bind(this),this),this.studiesReady.resolve()},r.prototype.setupAddonsInfo=function(){var t,e,i,o,n,r=[],s={};for(t in this._market.products)e=this._market.products[t],pro.hasPackage(t)&&e.subproduct_ids&&e.subproduct_ids[0]&&!e.disabled&&(i=e.subproduct_ids[0],o=i.split("$")[1],s[o]=t,r.push(ScriptLib.requestPineAddons(o)));return n=this,Promise.all(r).then(function(t){return t.reduce(function(t,e){var i,o;return i=e[0].scriptIdPart.split("_")[0],o=[],n._fillScriptsMetainfo(e,o),t[s[i]]=o,t},{})})},r.prototype.resolvePackageName=function(t){return t in this._subProductIds?this._subProductIds[t]:t},r.prototype.setUser=function(t){window.is_authenticated?this.setupUserData(t):this.setAnonymous()},r.prototype.setupUserData=function(t){this._user=t,this.loadFavorites(),this.updateMarketPages()},r.prototype.setAnonymous=function(){this.setupUserData(null),this.favsChanged.fire()},r.prototype.isHidedStudy=function(t){var e;return this._options.onWidget&&(e="IchimokuCloud@tv-basicstudies"===t.id),!!t.is_hidden_study&&!e},r._breakpointDevice="phone-vertical",r.prototype._switchPagesContainer=function(t,e){this._options.minimized||(t===r._breakpointDevice?this._w_pages.detach().appendTo(this._widget.find(".js-left-panel-wrapper")):e===r._breakpointDevice&&this._w_pages.detach().appendTo(this._widget.find(".js-right-panel")))},r.prototype.prepareLayout=function(){this._widget=$(n.render(s,{withSearch:e.enabled("study_dialog_search_control"),minimized:this._options.minimized})),this._w_tabs=this._widget.find(".js-tabs-container"),this._w_pages=this._widget.find(".js-pages"),this._loadMore=null,this.preparePages(),!this._options.selectBasicPage||this._options.fundamentalsOnly||v.device===r._breakpointDevice&&!this._options.minimized?this._options.fundamentalsOnly&&(v.device!==r._breakpointDevice||this._options.minimized)?this.selectPage(this._FUNDAMENTALS_PAGE_NAME):v.device===r._breakpointDevice&&this.selectPage(""):this.selectPage(this._BASIC_STUDIES_PAGE_NAME),
this._scroll=new u(this._widget.find(".js-tabs-viewport"),this._w_tabs,{showBottomShadow:!1});var t='<div class="tv-dialog__section tv-dialog__section--title js-dialog__drag tv-insert-indicator-dialog__title-container js-title-container"><div class="tv-insert-indicator-dialog__back-button js-back-button js-dialog__no-drag">'+i(214)+'</div><div class="js-title-text tv-dialog__title tv-insert-indicator-dialog__title-text">{{{ title }}}</div></div>';this._dialog=p({title:" ",titleTemplate:t,contentWrapTemplate:this._widget,addClass:"tv-insert-indicator-dialog "+(this._options.minimized?"i-minimized":""),width:this._options.minimized?490:842,height:580,withScroll:!1,focusFirstControl:!1,closeOnClickAtOtherDialogs:!1,isClickOutFn:function(t){var e=x.instance();if(e)return e.isEventOut(t);if(this._$symbolSearchPopup)return this._$symbolSearchPopup[0]!==t.target&&!this._$symbolSearchPopup[0].contains(t.target)&&void 0}.bind(this)}),this._dialog.on("afterClose",this._onDialogClosed.bind(this)),this._dialog.$title.find(".js-back-button").on(Modernizr.touch?"touchend":"click",this.selectPage.bind(this,"")),v.on("changeDevice",function(t,e){t===r._breakpointDevice&&this.currentPage()&&this.currentPage().hasClass("js-marketplace-page")&&this.selectPage(""),t===r._breakpointDevice&&(this._scroll.scrollToStart(),this._updateDialogTitleText()),this._switchPagesContainer(t,e)}.bind(this)),this._switchPagesContainer(v.device,""),this._showHideBackButton(),this.hide()},r.prototype.scrollHandler=function(){var t,e;if(!this._loadMore)return void this._w_pages.off("scroll.loadMoreOnEnd");t=$.map(this._w_pages.children(":visible"),function(t){return $(t).outerHeight(!0)}).reduce(function(t,e){return t+e},0),e=this._widget.find(".js-right-panel").height(),this._w_pages.scrollTop()>t-e-this.SCROLL_TOLERANCE&&(this._w_pages.off("scroll.loadMoreOnEnd"),this._loadMore())},r.prototype._updateDialogTitleText=function(){var t,e,i;if(this._dialog){if(t=""!==this._currentPageTitle,e=v.device!==r._breakpointDevice,!t||e||this._options.minimized)return void this._dialog.setTitleText(this._dialogTitleText);i=this.currentPage(),this._dialog.setTitleText(i.data("fullTitle"))}},r.prototype.currentPage=function(){return this._pages[this._currentPageTitle]},r.prototype.preparePages=function(){this.addSearchPage(),e.enabled("items_favoriting")&&this.addFavoritesPage(),this._options.fundamentalsOnly||this.prepareBasicPage(),this._options.fundamentalsOnly||this.addEconomyPage()},r.prototype.addEconomyPage=function(){var t,e,i=this.addPage(this._ECONOMY_TAB,{withoutTopPadding:!0,noFlex:!0}),o=f({withoutControls:!0,placeholder:$.t("Symbol"),addClass:"tv-insert-indicator-dialog__economy"});this._$economyTabInput=o.$input,t=new b({labelRight:$.t("Overlay the main chart")}),this._symbolSearch=y.bindToInput(this._$economyTabInput,{keepFocus:!0,clearAfterAccept:!0,callback:function(e){var i=this._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t.checked)}.bind(this),onPopupOpen:function(t){this._$symbolSearchPopup=t,
this._$symbolSearchPopup.css("z-index",this._dialog.zIndex)}.bind(this),onPopupClose:function(){this._$symbolSearchPopup=null}.bind(this)}),i.append(o.$control),e=$('<div class="tv-insert-indicator-dialog__economy-content">'),e.append(t.$el),i.append(e)},r.prototype.addFavoritesPage=function(){this.addPage("Favorites",{localizedTitle:$.t("Favorites")}),this.loadFavorites(),this.updateFavorites()},r.prototype.addInvitesOnlyPage=function(){this.addPage("invitesOnly",{localizedTitle:$.t("Invite-Only Scripts")})},r.prototype.prepareBasicPage=function(){var t=this.addPage(this._BASIC_STUDIES_PAGE_NAME,{packageName:this._BASIC_STUDIES_PACKAGE_NAME,technical:!e.enabled("plain_studymarket")});this._basicPage=t,this.studiesReady.done(function(){this.resetBasicPage()}.bind(this))},r.prototype._applyGlobalFilter=function(t){return this._parentSource&&(t=t.filter(d.canBeChild)),t},r.prototype._applyStrategiesFilter=function(t){var e=this._parentSource?"not_strategies":"none";return"not_strategies"!==e&&"only_strategies"!==e||(t=t.filter(function(t){var i=d.isScriptStrategy(t);return"not_strategies"===e?!i:i})),t},r.prototype.resetBasicPage=function(){var t,e,i=this.getPage(this._BASIC_STUDIES_PAGE_NAME);this._studies&&(t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME]||[],e=this._studies[this._STANDARD_STUDIES_PACKAGE_NAME]||[],t=t.concat(e),t=this._applyStrategiesFilter(t),t=this._applyGlobalFilter(t),this.preparePageStudies(i,t))},r.prototype.resetAllPages=function(){this.resetBasicPage(),this.resetCustomScriptPage(),this.resetPublishedScriptPage(),this.resetInvitesOnlyPage()},r.prototype._fillScriptsMetainfo=function(t,e){var i,o,n;for(i=0;i<t.length;i++)o=t[i],n=d.createMetaInfoStub(o,"1"),TradingView.merge(n,d.parseIdString(n.id)),e.push(n)},r.prototype.resetCustomScriptPage=function(){},r.prototype.resetPublishedScriptPage=function(){},r.prototype._createItemsList=function(){return $('<div class="tv-insert-indicator-dialog__items-list">')},r.prototype._createSubGroupItem=function(t){return $('<div class="tv-insert-study-item tv-insert-study-item--subgroup-header">').text(t)},r.prototype._createItemsGroup=function(t,e,i){var o,n=this._createItemsList();return this.fillStudies(n,t,i),o=$('<div class="tv-insert-indicator-dialog__subgroup">'),e.length&&o.append(this._createSubGroupItem(e)),o.append(n),o},r.prototype.addSearchPage=function(){var t,e,i,o=f({addClass:"tv-insert-indicator-dialog__search-control"});this._tabs.search=o.$control.data("title","search"),this._pages.search=$('<div class="tv-insert-indicator-dialog__page tv-insert-indicator-dialog__page--search">').data("title","search"),this._pages.search.data("fullTitle",$.t("Search")),t=null,this._search_value=null,this._search_input=o.$input,o.inputChangedDelegate.subscribe(null,function(){t&&clearTimeout(t),t=setTimeout(function(){t=null,this.search(this._search_input.val()),this._w_pages.scrollTop(0)}.bind(this),200)}.bind(this)),this._search_input.focus(function(){this.search(this._search_input.val())}.bind(this)),e=this._widget.find("#js-search-placeholder"),
e.length&&e.parent()[0].replaceChild(this._tabs.search[0],e[0]),this._w_pages.prepend(this._pages.search),i={},i[w.ENTER]=this._onEnterKeyHandler.bind(this),i[w.UP_ARROW]=this._onUpKeyHandler.bind(this),i[w.DOWN_ARROW]=this._onDownKeyHandler.bind(this),this._keyDownListener=new C("keydown"),this._keyDownListener.regHandlers(i),this._keyDownListener.watchOn(this._search_input[0])},r.prototype._onEnterKeyHandler=function(){null!==this._selectedStudy&&this.insertThisStudy(this._selectedStudy)},r.prototype._onUpKeyHandler=function(){if(null!==this._selectedStudy){var t=this._selectedStudy.prev(".js-study-item");t&&t.length&&(this._selectedStudy.removeClass("tv-insert-study-item--selected"),t.addClass("tv-insert-study-item--selected"),this._selectedStudy=t,this._ensureSelectedItemIsVisible())}},r.prototype._onDownKeyHandler=function(){if(null===this._selectedStudy)this._selectedStudy=this.currentPage().find(".js-study-item").first(),this._selectedStudy.addClass("tv-insert-study-item--selected");else{var t=this._selectedStudy.next(".js-study-item");t&&t.length&&(this._selectedStudy.removeClass("tv-insert-study-item--selected"),t.addClass("tv-insert-study-item--selected"),this._selectedStudy=t,this._ensureSelectedItemIsVisible())}},r.prototype._ensureSelectedItemIsVisible=function(){var t,e,i,o,n,r;null!==this._selectedStudy&&(t=this._w_pages,e=this._selectedStudy[0].getBoundingClientRect(),i=t[0].getBoundingClientRect(),o=this.currentPage()[0].getBoundingClientRect().top,n=e.top-o,r=3,e.top-i.top<0?t.scrollTop(n-r):e.bottom-i.bottom>0&&t.scrollTop(n-i.height+e.height+r))},r.prototype.search=function(t,i,o){function n(t,e,i,o,n,r){t.push(e),t[t.length-1].matchPriority=o,n&&(t[t.length-1].matchIndex=i.match(r).index)}var r,s,a,l,c,h=this;(this._search_value!==t||i)&&(r=this._pages.search,s=[],a=function(t){return t.replace(/[!-\/[-^{-}]/g,"\\$&")},""!==t&&(l=t.split("").map(function(t,e){var i=a(t);return 0!==e&&(i="[/\\s-]"+i),"("+i+")"}).join("(.*?)")+"(.*)",s.push({fullMatch:RegExp("("+a(t)+")","i"),re:RegExp("^"+l,"i"),reserveRe:RegExp(l,"i"),fuzzyHighlight:!0}),t.toLowerCase()in this.DEFAULT_OPTIONS.searchKeywords&&s.push({fullMatch:this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()],re:this.DEFAULT_OPTIONS.searchKeywords[t.toLowerCase()],fuzzyHighlight:!1})),this._search_value=t,c=$.Deferred(),h._currentAsyncSearchDfd=c,e.enabled("plain_studymarket")?c.resolve([]):PublishedScript.suggest(t).done(function(t){var e=[];t&&t.results;c.resolve(e)}).fail(function(){c.resolve([])}),c.done(function(e){var i,o,a,l,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x;if(h._currentAsyncSearchDfd===c){for(i=Object.keys(h._studies),i.indexOf(h._PUBLISHED_STUDIES_PACKAGE_NAME)<0&&i.push(h._PUBLISHED_STUDIES_PACKAGE_NAME),i.sort(),o=[h._BASIC_STUDIES_PACKAGE_NAME,h._STANDARD_STUDIES_PACKAGE_NAME,h._PUBLISHED_STUDIES_PACKAGE_NAME,h._CUSTOM_STUDIES_PACKAGE_NAME],a=o.length;a--;)l=o[a],-1!==(u=i.indexOf(l))&&(i.splice(u,1),i.unshift(l));for(d={},p=0,_=0;_<i.length;_++){for(f=i[_],m=[],g=h._studies[f],f===h._PUBLISHED_STUDIES_PACKAGE_NAME&&(g=e),
a=0;a<g.length;a++)if(v=g[a],s.length)for(y=0;y<s.length;y++)b=s[y].re,b.lastIndex=0,S=s[y].fullMatch,w=v.shortDescription,w&&w.toLowerCase()===t.toLowerCase()?n(m,v,w,3,!0,S):w&&S.test(w)?n(m,v,w,2,!0,S):(w=v.description_localized||v.description||v.scriptName,S.test(w)?n(m,v,w,1,!0,S):b.test(w)&&n(m,v,w,0,!0,b));else m.push(v);if(m=h._applyGlobalFilter(m),m.length){switch(T=f,f){case h._BASIC_STUDIES_PACKAGE_NAME:case h._STANDARD_STUDIES_PACKAGE_NAME:T=h._BASIC_STUDIES_PAGE_NAME;break;case h._CUSTOM_STUDIES_PACKAGE_NAME:T=$.t("My Scripts");break;case h._PUBLISHED_STUDIES_PACKAGE_NAME:T=$.t("Public Library");break;default:f in h._packagesWithTabNames&&(T=h._packagesWithTabNames[T])}T in d||(d[T]=[]),d[T]=d[T].concat(m),p+=m.length}}for(r.html(""),C=Object.keys(d),a=0;a<C.length;++a)T=C[a],m=d[T],s.length&&Array.prototype.sort.call(m,function(t,e){if(t.matchPriority<e.matchPriority)return 1;if(t.matchPriority>e.matchPriority)return-1;if(t.matchPriority===e.matchPriority)switch(t.matchIndex){case void 0:return 0;default:return t.matchIndex>e.matchIndex?1:t.matchIndex<e.matchIndex?-1:0}}),x=this._createItemsGroup(m,this._options.minimized?"":$.t(T),s),r.append(x),this._selectedStudy=null;0===p&&r.append('<p class="tv-insert-indicator-dialog__not-found-message">'+$.t("No indicators matched your criteria.")+"</p>")}}.bind(this))),o||this.selectPage("search")},r.prototype.updateSearchPage=function(){var t=this._search_input.val();this.search(t,!0,!0)},r.prototype.updateMarketPages=function(){},r.prototype.preparePageStudies=function(t,e,i,o){if(t){o||(e=this.sortStudies(e)),t.empty();var n=this._createItemsList();this.fillStudies(n,e,null),t.append(n)}},r.prototype.addPage=function(t,e){var i,o,n,r,s,a;return e=$.extend({},e),i=e.localizedTitle||$.t(t),o=t.toLowerCase(),n=$('<div class="tv-insert-indicator-dialog__page">').data("title",o),r=$('<div class="tv-insert-indicator-dialog__tab js-tab"></div>').text(i).data("title",o).attr("title",i),s=e.technical?$.t("Technical Analysis")+": ":"",n.data("fullTitle",s+i),r.toggleClass("tv-insert-indicator-dialog__tab--beta",!!e.beta),e.packageName&&(this._packagesWithTabNames[e.packageName]=t),this._pages[o]=n,this._tabs[o]=r,e.withoutTopPadding&&n.addClass("tv-insert-indicator-dialog__page--without-top-padding"),e.noFlex&&n.addClass("tv-insert-indicator-dialog__page--no-flex"),e.technical||e.market?(a=e.technical?this._getOrCreateTechnicalTab():this._getOrCreateMarketTab(),a.find(".tv-insert-indicator-dialog__tabs").append(r),e.market&&n.addClass("js-marketplace-page")):this._w_market_tabs?r.insertBefore(this._w_market_tabs):this._w_tabs.append(r),this._w_pages.append(n),n.toggleClass("i-hidden",o!==this._currentPageTitle),n},r.prototype._createGroupTab=function(t,e){var i=$(n.render(a,{title:t}));return i.find(".js-tab-head").on("click",function(){this._expandCollapseTabs(i,e)}.bind(this)),this._expandCollapseTabs(i,e,g.getBool(e,!0),!0),i.data("settings-open-key",e),this._w_tabs.append(i),i},r.prototype._getOrCreateMarketTab=function(){
return this._w_market_tabs||(this._w_market_tabs=this._createGroupTab($.t("Marketplace Add-ons"),"studyMarket.marketTabIsOpen"),this._w_market_tabs.addClass("tv-insert-indicator-dialog__tabs-group--marketplace")),this._w_market_tabs},r.prototype._getOrCreateTechnicalTab=function(){return this._w_technical_tabs||(this._w_technical_tabs=this._createGroupTab($.t("Technical Analysis"),"studyMarket.technicalTabIsOpen")),this._w_technical_tabs},r.prototype._onDialogClosed=function(){null!==this._selectedStudy&&this._selectedStudy.removeClass("tv-insert-study-item--selected"),this._selectedStudy=null,this.visibilityChanged.fire(!1),S.removeListener("StudyMarket")},r.prototype.hide=function(){this._dialog.close()},r.prototype.show=function(t){var i,o;this.init(),i=!1,o=t instanceof TradingView.Study&&t||null,o!==this._parentSource&&(this._parentSource=o,this._dialogTitleText=this._parentSource?$.t("Apply Indicator on {0}").format(this._parentSource.title(!0)):$.t("Indicators"),i=!0),this._updateDialogTitleText(),this._widget.on("keyup.hideDialogStudy",function(t){t.which===w.ESC&&(this._widget.unbind("keyup.hideDialogStudy"),this.hide())}.bind(this)),this._clearInput(),this.loadFavorites(),i&&this.resetAllPages(),this._scroll.scrollTo(0),this.visibilityChanged.fire(!0),this.focusAddSymbolInput(this._currentPageTitle),S.registerListener("StudyMarket",function(t){return!t.ctrlKey&&(47!==t.which&&(t.which&&t.which===w.ENTER?(t.target===this._search_input.get(0)&&this._insertStudyByShortDescription(),!0):!!t.charCode&&(!(!t.which||t.which<=32)&&(!/^(input|textarea)$/i.test(t.target.tagName)&&(t.preventDefault(),!!(TradingView.onWidget()||this._options.minimized&&!e.enabled("study_dialog_search_control"))||(this._search_input.focus(),this._search_input[0].value=String.fromCharCode(t.charCode),!0))))))}.bind(this)),this._dialog.open(),h.emit("indicators_dialog")},r.prototype.isVisible=function(){return!!this._initialized&&this._widget.is(":visible")},r.prototype.getPage=function(t){return t=t.toLowerCase(),this._pages[t]},r.prototype.focusAddSymbolInput=function(t){t===this._ECONOMY_TAB.toLowerCase()&&this._$economyTabInput&&this._$economyTabInput.focus()},r.prototype._showHideBackButton=function(){if(this._dialog&&!this._options.minimized){var t=""!==this._currentPageTitle;this._dialog.$el.find(".js-title-container").toggleClass("i-with-back-button",t)}},r.prototype.selectPage=function(t){var e,i,o,n,r,s;if(t=t.toLowerCase(),this.focusAddSymbolInput(t),this._currentPageTitle!==t)if(""===t||t in this._pages&&t in this._tabs&&("favorites"!==t||this.hasVisibleFavorites())){for(e in this._pages)if(i=t===e,o=this._pages[e],o.toggleClass("i-hidden",!i),this._tabs[e].toggleClass("i-active",i),i){if(o.trigger("show-page"),n=this._tabs[e].parents(".tv-insert-indicator-dialog__tabs-group"),0===n.length)continue;r=n.find(".js-tab-head"),this._expandCollapseTabs(n,r.data("settings-open-key"),!0,!0)}this._currentPageTitle=t,this._w_pages.scrollTop(0),g.setValue(this._PAGE_KEY,t),this._selectedStudy=null,s=""!==this._currentPageTitle,
this._widget.find(".js-tabs-viewport").toggleClass("i-active",!s),this._w_pages.toggleClass("i-active",s),this._showHideBackButton(),s||this._search_input.blur(),this._updateDialogTitleText()}else this.selectPage(this._BASIC_STUDIES_PAGE_NAME)},r.prototype.attachHandlers=function(){var t=Modernizr.touch?"touchend":"click",i=this;Modernizr.touch&&this._w_pages.on("touchstart",".js-study-item",function(t){i._touchStart=$.extend({},t.originalEvent.touches[0])}),this._w_tabs.on("click",".js-tab",this._onTabClicked.bind(this)),e.enabled("items_favoriting")&&this._w_pages.on(t,".js-favorite-icon",this.toggleItem.bind(this)),this._w_pages.on(t,".js-study-item",function(t){var e;i._touchStart&&(e=i._w_pages.find(".tv-insert-study-item")[0].clientHeight,Math.abs(i._touchStart.screenY-t.originalEvent.changedTouches[0].screenY)>e)||i.insertThisStudy($(t.target).closest(".js-study-item"))})},r.prototype._onTabClicked=function(t){var e=$(t.currentTarget).data("title");e&&"search"!==e&&this.selectPage(e),t.stopPropagation()},r.prototype._expandCollapseTabs=function(t,e,i,o){var n,r=t.hasClass("i-dropped");if(void 0===i)i=!t.hasClass("i-dropped");else if(r===i&&!o)return;if(n=t.find(".tv-insert-indicator-dialog__tabs"),t.toggleClass("i-dropped",!!i),o)return void n.toggleClass("i-hidden",!i);n.removeClass("i-hidden"),n.velocity(i?"slideDown":"slideUp",{duration:m.dur/2,complete:function(){g.setValue(e,i),this._scroll.updateScroll()}.bind(this)})},r.prototype.toggleItem=function(t){var e=$(t.target).closest(".js-study-item").data("study");return this.toggleFavorite(e.id),this.toggleEverywhere(e.id),!1},r.prototype.toggleEverywhere=function(t){var e=this,i=this.isFavorite(t);this._w_pages.find(".js-study-item").filter(function(i,o){var n=$(o).data("study");return!!n&&e.favsModel.favId(n.id)===e.favsModel.favId(t)}).find(".js-favorite-icon").toggleClass("i-starred",i).attr("title",this.favTitle(i))},r.prototype.toggleFavorite=function(t){this.favsModel.favorite(t)},r.prototype.isFavorite=function(t){return this.favsModel.isFav(t)},r.prototype._getInviteOnlyStudies=function(){return new Promise(function(t,e){t([])})},r.prototype.resetInvitesOnlyPage=function(){var t=this;t._tabs.invitesonly&&(t._previousInviteOnlyStudiesIds&&0!==t._previousInviteOnlyStudiesIds.length?t._tabs.invitesonly.show():t._tabs.invitesonly.hide()),t._getInviteOnlyStudies().then(function(e){t._previousInviteOnlyStudies=e,t.preparePageStudies(t._pages.invitesonly,e),t._tabs.invitesonly&&(e&&0!==e.length?t._tabs.invitesonly.show():t._tabs.invitesonly.hide())},function(){t.preparePageStudies(t._pages.invitesonly,[]),t._tabs.invitesonly&&t._tabs.invitesonly.hide()})},r.prototype.updateFavorites=function(){var t,e,i,o,n,s,a,l,c,h,u,p,_;if(this._w_pages){if(t=this,e=this.getVisibleFavorites(),i=function(){"favorites"===t._currentPageTitle&&t.selectPage(v.device===r._breakpointDevice?"":t._BASIC_STUDIES_PAGE_NAME),t._w_pages.find(".js-favorite-icon").removeClass("i-starred"),t._tabs&&t._tabs.favorites&&t._tabs.favorites.hide()},
t._tabs.favorites&&0===e.length)return void i();for(o=$.Deferred(),n=[],s=[],a=0;a<e.length;a++)if(l=e[a],(c=this.getStudyPackageName(l))!==t._PUBLISHED_STUDIES_PACKAGE_NAME){for(h=this._studies[c]||[],u=0;u<h.length;u++)if(p=t.favsModel.favId(d.cutFullId(h[u].id)),_=t.favsModel.favId(l),p===_){n.push(h[u]);break}}else s.push(l);s.length&&!this._options.minimized||o.resolve(n),o.done(function(t){0===t.length?i():this._tabs.favorites.show(),t=this._applyStrategiesFilter(t),this.preparePageStudies(this._pages.favorites,t),this._w_pages.find(".js-study-item").find(".js-favorite-icon").removeClass("i-starred"),e.forEach(this.toggleEverywhere,this)}.bind(this)),n&&0!==n.length&&this._tabs.favorites.show()}},r.prototype.hasVisibleFavorites=function(){return!!this.getVisibleFavorites().length},r.prototype.getVisibleFavorites=function(){return this.checkExcludePackageStudies(this.favsModel.favorites())},r.prototype.checkExcludePackageStudies=function(t){return t.filter(function(t){var e=this.getStudyPackageName(t);return e===this._PUBLISHED_STUDIES_PACKAGE_NAME||!!(this._studies&&this._studies[e]&&$.grep(this._studies[e],function(e){return e.id.indexOf(t)>=0}).length>0)&&(e===this._BASIC_STUDIES_PACKAGE_NAME||e===this._STANDARD_STUDIES_PACKAGE_NAME||e===this._CUSTOM_STUDIES_PACKAGE_NAME||e===this._SCRIPTING_PACKAGE_NAME||e===this._FUNDAMENTAL_PACKAGE_NAME||pro.hasPackage(e)&&e in this._studies)},this)},r.prototype.sortStudies=function(t){return t.sort(function(t,e){return t=t.scriptName||t.description_localized||t.description,e=e.scriptName||e.description_localized||e.description,t>e?1:t<e?-1:0})},r.prototype.fillStudies=function(t,e,i){var o;t.empty(),e.forEach(function(e){e?o=this.createStudyListItem(e,i):(o=document.createElement("div"),o.className="placeholder"),t.append(o)},this)},r.prototype.createStudyListItem=function(t,i){var o,r,s,a,c,h,u,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D=t.description_localized||$.t(t.scriptName||t.description||" ",{context:"study"}),V=this.isFavorite(t.id),O=[];if(i&&D)for(o=[],i instanceof RegExp?o.push({re:i,fuzzyHighlight:!1}):$.isArray(i)&&(o=i),r=0;r<o.length;r++)if(s=o[r].fullMatch,a=o[r].reserveRe,c=o[r].re,s.lastIndex=0,c.lastIndex=0,h=s.exec(D),h?o[r].fuzzyHighlight=!1:(h=c.exec(D),!h&&a&&(h=a.exec(D)),o[r].fuzzyHighlight=!0),h)if(o[r].fuzzyHighlight)for(u=h.index,p=1;p<h.length;p++)_=h[p].length,p%2&&(O[u]=!0),u+=_;else for(f=0;f<h[0].length;f++)O[h.index+f]=!0;return m=TradingView.clean(D,!0),g=m.replace(/./g,function(t,e){if("<"===t?t="&lt;":"&"===t?t="&amp;":'"'===t&&(t="&quot;"),O[e]){if(" "===t||"-"===t||"/"===t)return O[e+1]=!0,t;t='<span class="i-match">'+t+"</span>"}return t}),v=!!t.pine,y=this.getStudyPackageName(t.id),b=v&&y===this._PUBLISHED_STUDIES_PACKAGE_NAME,S=v&&y===this._CUSTOM_STUDIES_PACKAGE_NAME,w=v&&(y===this._STANDARD_STUDIES_PACKAGE_NAME||y===this._FUNDAMENTAL_PACKAGE_NAME),T=v&&[TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH,TVScript.Access.ACCESS_CLOSED_NO_AUTH].indexOf(t.pine.access)>=0,C=v&&TVScript.Access.ACCESS_CLOSED_NEEDS_AUTH===t.pine.access,
x=v&&C&&void 0!==t.pine.userHaveAccess,P=v&&t.pine.userHaveAccess,L=!!t.TVScriptSourceCode,I=!1,k=v&&!w&&!T&&(S||b||L||V&&!I),A={closed:$.t("Invite-only script. Contact the author for more information."),open:$.t("Invite-only script. You have been granted access.")},M=$(n.render(l,{publishedOrUserScript:S||b,title:g,titleTooltip:TradingView.strip_tags(m),isStrategy:d.isScriptStrategy(t),isInviteOnly:C,showAccessIcon:x,accessIconClass:P?"tv-insert-study-item__green-lock-icon":"tv-insert-study-item__red-lock-icon",accessTooltip:P?A.open:A.closed,author:t.author&&t.author.username,likes:t.agreeCount?t.agreeCount+" "+$.t("like",{plural:"likes",count:t.agreeCount}):"",showMoreButton:!!t.imageUrl,deleteButton:!t.imageUrl&&S,withFavorites:e.enabled("items_favoriting")&&!this._options.minimized})),k||M.find(".js-show-source-btn").removeClass("js-show-source-btn").addClass("i-empty"),M.data("study",t),void 0!==t.isCustomIndicator&&M.addClass("custom-indicator"),e.enabled("items_favoriting")&&(E=M.find(".js-favorite-icon"),E.toggleClass("i-starred",!!V),E.attr("title",this.favTitle(!!V))),e.enabled("graying_disabled_tools_enabled")&&ChartApiInstance.studiesAccessController.isToolGrayed(t.description)&&M.addClass("i-grayed"),M},r.prototype.favTitle=function(t){return t?$.t("Remove from favorites"):$.t("Add to favorites")},r.prototype.insertThisStudy=function(t){if(!t.hasClass("placeholder")){var i=t.data("study");return e.enabled("graying_disabled_tools_enabled")&&ChartApiInstance.studiesAccessController.isToolGrayed(i.description)?void h.emit("onGrayedObjectClicked",{type:"study",name:i.description}):(t.highlight(this.HIGHLIGHT_STUDY_NUM_FLICKS),this.insertStudy(i),!1)}},r.prototype.insertStudy=function(t){var e,i,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.insertStudyStub(t.description),i=d.replaceWithFullStudyMetaInfoAsync(o.model().studiesMetaData(),t),i.done(function(t){var i;if(o.removeStudyStub(e.id())){if(this._parentSource&&!d.canBeChild(t))return i=_({type:"modal",title:$.t("Oops!"),content:$.t("This indicator cannot be applied to another indicator")}),void i.open();o.insertStudyOrShowDialog(t,this._parentSource),this._is_on_chart=!0}}.bind(this)),i.fail(function(t){P.logError("Error: "+t),e.setStatus(t)}))},r.prototype.onLoginStateChange=function(t){t||this.setUser(window.user),PublishedScript.cleanCache(),this.resetAllPages(),this.setup(),this.init()},r.prototype.getStudyList=function(t){function e(t){i.push(t)}var i,o;if(!this.studiesReady.isResolved())return[];i=[];for(o in this._studies)(o===this._BASIC_STUDIES_PACKAGE_NAME||pro.hasPackage(o))&&(this._studies[o].forEach(e),t&&i.push({separator:!0}));return t&&i.splice(i.length-1,1),i},r.prototype.getStudyPackageName=function(t){var e,i,o,n,r,s;if(t)return e=t.split("@"),(i=1===e.length)||(o=d.getPackageName(t))===this._SCRIPTING_PACKAGE_NAME?(n=e[0],i||/^(Strategy)?Script\$/.test(n)?(r=n.indexOf("_"),-1!==r?(o=n.substring(0,r),s=o.indexOf("Script$")>=0?o:"Script$"+o,
pro.getSuperProduct(s)||s):/USER;/.test(n)?this._CUSTOM_STUDIES_PACKAGE_NAME:/PUB;/.test(n)?this._PUBLISHED_STUDIES_PACKAGE_NAME:/STD;/.test(n)?this._STANDARD_STUDIES_PACKAGE_NAME:n):o):o},r.prototype.selectSearchPage=function(){this.selectPage("search"),this._clearInput()},r.prototype._insertStudyByShortDescription=function(){var t,e,i,o=this._search_value;for(o=o.trim(),t=this._studies[this._BASIC_STUDIES_PACKAGE_NAME],e=0;e<t.length;e++)if(i=t[e],i.shortDescription&&i.shortDescription.toUpperCase()===o.toUpperCase()){this.insertStudy(i);break}},r.prototype._clearInput=function(){this._search_input.val(""),"search"===this._currentPageTitle&&this._search_input.val("").trigger("input").focus()},r.prototype._getScriptType=function(){return 0},r.prototype._pubSearchEntryAlreadyLoaded=function(t){var e=t.scriptIdPart.split(";")[1];return!(this._pubSearchCache.indexOf(e)<0)||(this._pubSearchCache.push(e),!1)},r.prototype._addPubSearchResult=function(t,e){t.length&&(t.forEach(function(t){this._pubSearchEntryAlreadyLoaded(t)||(this._pubSearchEntries.push(t),this._pubSearchCount[t.scriptType]++)},this),0===e&&(this._pubSearchCount[0]+=t.length),this._pubSearchEntries.sort(function(t,e){return e.agreeCount-t.agreeCount}))},r.prototype._getPublicLibraryRequestParams=function(t){var e=this._pubSearchCount[t],i=this._PUB_SEARCH_ENTRIES_ON_PAGE;return e<this._PUB_SEARCH_ENTRIES_ON_PAGE&&(i=this._PUB_SEARCH_ENTRIES_ON_PAGE-e),{offset:e,count:i,type:t}},t.exports=r}).call(e,i(5),i(10),i(41))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" width="18px" height="18px"><path fill-rule="evenodd" d="M12.5 11h-.79l-.28-.27A6.47 6.47 0 0 0 13 6.5 6.5 6.5 0 1 0 6.5 13c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L17.49 16l-4.99-5zm-6 0C4.01 11 2 8.99 2 6.5S4.01 2 6.5 2 11 4.01 11 6.5 8.99 11 6.5 11z"/></svg>'},function(t,e){},function(t,e,i){"use strict";var o=i(5);t.exports.displayedExchangesFilter=function(t){return o.enabled("symbol_search_limited_exchanges")&&(t=t.filter(function(t){return!("bitcoin"===t.flag||t.hideInSymbolSearch)})),t},t.exports.sortExchangesListByFlagIfNeeded=function(t){return t}},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.types={ECONOMIC:"economic",QUANDL:"quandl"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(24),n=i(93),r=i(33),s=i(10),a=i(15),l={FAV_KEY:"studyMarket.favorites",FAV_EXTRA_KEY:"studyMarket.favorites.extra"},c=null,h=function(){function t(){var t=this;this._previousFavorites=[],this._favorites=[],this._favoritesExtra={},this._favoritesChanged=new s,this.loadFavs(),n.TVXWindowEvents.on("StudyFavoritesChanged",function(e){var i=JSON.parse(e);t._updateFavorites(i.favorites||[]),t._updateFavoritesExtra(i.favoritesExtra||{})}),window.loginStateChange.subscribe(null,function(){t.loadFavs()})}return t.prototype.loadFavs=function(){var t=o.getJSON(l.FAV_KEY,[]),e=o.getJSON(l.FAV_EXTRA_KEY,{}),i=this._migrate(t,e);this._updateFavorites(i.favs),
this._updateFavoritesExtra(i.favsExtra)},t.prototype.isFav=function(t){0===this._favorites.length&&this.loadFavs();var e=this.favId(t);return-1!==this._favorites.indexOf(e)},t.prototype.favorite=function(t,e){var i,o,r,s;0!==this._favorites.length&&0!==Object.keys(this._favoritesExtra).length||this.loadFavs(),i=this.favId(t),o=this.favorites(),r=this.favoritesExtra(),s=o.indexOf(i),-1!==s?(o.splice(s,1),delete r[i]):(o.push(i),void 0!==e&&(r[i]=e)),this._updateFavorites(o),this._updateFavoritesExtra(r),this._saveFavs(o,r),n.TVXWindowEvents.emit("StudyFavoritesChanged",JSON.stringify({favorites:o,favoritesExtra:r}))},t.prototype.favId=function(t){return r.cutScriptIdPart(t)||r.cutFullId(t)},t.prototype.previousFavorites=function(){return this._previousFavorites.slice()},t.prototype.favorites=function(){return this._favorites.slice()},t.prototype.favoritesExtra=function(){return Object.assign({},this._favoritesExtra)},t.prototype.favoritesChanged=function(){return this._favoritesChanged},t.getInstance=function(){return null===c&&(c=new t),c},t.prototype._saveFavs=function(t,e){o.setJSON(l.FAV_KEY,t),o.setJSON(l.FAV_EXTRA_KEY,e)},t.prototype._migrate=function(t,e){var i,o,n=[],r={};for(i=0;i<t.length;i++)o=this.favId(t[i]),-1===n.indexOf(o)&&(n.push(o),r[o]=e[t[i]]);return{favs:n,favsExtra:r}},t.prototype._updateFavorites=function(t){a.deepEquals(this._favorites,t)[0]||(this._previousFavorites=this.favorites(),this._favorites=t,this._favoritesChanged.fire(this.favorites()))},t.prototype._updateFavoritesExtra=function(t){this._favoritesExtra=t},t}(),e.FavoriteScriptsModel=h},function(t,e){},function(t,e){},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(13),i(12),n=i(23),r=i(154),s=i(133),a=i(40),l=i(10),c=i(770),h=i(771),u=i(313),d=i(5),p=i(121),_=i(772),f=function(t){function e(e,i,o){var r,a,u,d,_=t.call(this)||this;return _.onTitleSizeChanged=new l,_._autosaveInterval=6e4,_._editEnabled=!0,_._titleValue="",_._saving=!1,_._haveChanges=!1,_._autosaveTimer=0,_._options=o=Object.assign({popupDirection:"up"},o||{}),_._chartWidgetCollection=i,_._readOnly=i.readOnly(),r="\n"+window.t("Dot",{context:"hotkey"})+" (.)",_._load=$('<span class="load button first apply-common-tooltip"></span>').html(c).attr("title",window.t("Load Chart Layout")+r).click(_.signInOrLoadChart.bind(_)).appendTo(e),_._title=$('<span class="title apply-common-tooltip"></span>'),o.hideChartTitle&&_._title.hide(),a=$("<span>").addClass("separator"),_._optionsMenu=$('<span class="button options last">').append($('<div class="tv-caret"></div>')),s.bindPopupMenu(_._optionsMenu,_._getSavedCharts.bind(_),{direction:o.popupDirection,reverse:o.popupReverse,notCloseOnButtons:!0,popupSpacing:o.popupSpacing}),_._readOnly?(_._save=$(),_._copy=$('<span class="copy">'+window.t("Copy")+"</span>").appendTo(e).click(_.cloneChart.bind(_)),_._title.addClass("read-only"),_._titleReadOnly=$("<span>").addClass("read-only").appendTo(_._title),a.appendTo(_._copy),
_._optionsMenu.hide()):(u=window.t("Save Chart Layout saves not just some particular chart, it saves all charts for all symbols and intervals which you are modifying while working with this Layout"),_._save=$('<span class="save button apply-common-tooltip"></span>').attr("title",u).html(h).appendTo(e).click(_.signInOrSaveChart.bind(_,null,null,null)),_._copy=$(),_._titleInput=$('<span type="text" maxlength="80">').appendTo(_._title),_._title.bind("click",_._renameChart.bind(_)),_._title.attr("title",window.t("Rename Chart Layout")),_._titleSize=$('<span class="sizer">').appendTo(_._title),_._titleReadOnly=$(),a.appendTo(_._save)),_._title.appendTo(e),_._optionsMenu.appendTo(e),_._savecopy=$().add(_._save).add(_._copy).mousedown(function(t){if(t.button)return void t.preventDefault();_._save.addClass("active")}).mouseup(function(t){_._save.removeClass("active")}),d=function(){i.metaInfo.name.value()||_._readOnly?_.setTitle(i.metaInfo.name.value()):_.hideTitle()},i.metaInfo.name.subscribe(d),d(),_._setChanges(!1),n.subscribe("chart_loaded",function(){_._setChanges(!1)},void 0),i.undoHistory.undoStack().onChange().subscribe(_,function(){var t=i.undoHistory.undoStack().head();t&&t.customFlag("doesnt_affect_save")||(_._setChanges(!0),_.autosave())}),p.registerListener("LoadChartDialogHotkey",function(t){return!t.ctrlKey&&(!(46!==t.which||!$(t.target).is("body"))&&(_.loadMenu(),t.preventDefault(),t.stopPropagation(),!0))}),window.saver.chartSaved().subscribe(_,_._onChartSaved),window.saver.chartAboutToBeSaved().subscribe(_,_._onChartAboutToBeSaved),_}return o.__extends(e,t),e.prototype.setTitle=function(t){var e,i;this._readOnly?(e=this._chartWidgetCollection.metaInfo.username.value(),i='<a href="/u/'+encodeURIComponent(e)+'">'+u.htmlEscape(e)+"</a>",t=(t?u.htmlEscape(t)+": ":"")+window.t("view-only chart by {user}").replace("{user}",i),this._setReadOnlyTitle(t)):this._setTitle(t)},e.prototype.hideTitle=function(){this._title.hide(),this._optionsMenu.hide(),this._titleInput.text(""),this._savecopy.removeClass("titled").addClass("last")},e.prototype.getTitle=function(){return this._titleValue},e.prototype.cloneChart=function(){var t,e,i,o=this;d.enabled("save_old_chart_before_save_as")&&this._chartWidgetCollection.metaInfo.id.value()&&this._saveChart(),t="text",e=new r.SaveRenameDialog({fields:[new r.InputField({name:t,label:window.t("Enter a new chart layout name")+":",error:window.t("Please enter chart layout name"),maxLength:64})],title:window.t("Copy Chart Layout")}),i=this._chartWidgetCollection.metaInfo.name.value(),e.setField(t,i?window.t("{0} copy").format(i):""),e.show().then(function(e){d.enabled("saved_charts_count_restriction")&&!window.user.is_pro&&o._savedCharts.length>=5||(d.enabled("saveload_storage_customization")?(o._chartWidgetCollection.metaInfo.uid.deleteValue(),o._chartWidgetCollection.metaInfo.id.deleteValue(),o.setTitle(e[t]),o.saveChart()):window.open("/chart/?clone="+o._chartWidgetCollection.metaInfo.uid.value()+"&name="+encodeURIComponent(e[t]),"_blank"))})},e.prototype.autosave=function(){
var t=this;d.enabled("charts_auto_save")&&(this._chartWidgetCollection.onfeatures||(this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0),this._autosaveTimer=setTimeout(function(){t._chartWidgetCollection.metaInfo.id.value()&&t._saveChart()},this._autosaveInterval)))},e.prototype.saveChart=function(t,e,i){var o,n,s,l=this;if(this._chartWidgetCollection.onfeatures)return void(e&&e());o=this.getTitle(),o?(this._chartWidgetCollection.metaInfo.name.setValue(o),t&&t(),this._saveChart(function(){a.trackEvent("GUI","Save Chart Layout"),l._goChartPage(l._chartWidgetCollection.metaInfo.uid.value()),e&&e(),l._refreshSavedChartsList()},i)):(n="text",s=new r.SaveRenameDialog({fields:[new r.InputField({name:n,label:window.t("Chart layout name")+":",maxLength:64,error:window.t("Please enter chart layout name")})],title:window.t("Save New Chart Layout")}),s.show().then(function(o){l.setTitle(o[n]),l.saveChart(t,e,i)}))},e.prototype.signInOrSaveChart=function(t,e,i){d.enabled("saveload_requires_authentication")?runOrSignIn(this.saveChart.bind(this,t,e,i),{source:"Save chart",sourceMeta:"Chart"}):this.saveChart(t,e,i)},e.prototype.signInOrRenameChart=function(){d.enabled("saveload_requires_authentication")?runOrSignIn(this._renameChart.bind(this),{source:"Rename chart"}):this._renameChart()},e.prototype.signInOrSaveAs=function(){d.enabled("saveload_requires_authentication")?runOrSignIn(this.cloneChart.bind(this),{source:"Clone chart"}):this.cloneChart()},e.prototype.saveChartByEnter=function(t){13===t.keyCode&&(this._titleInput.blur(),this.signInOrSaveChart())},e.prototype.isSaved=function(){return!!this.getTitle()},e.prototype.loadMenu=function(){var e=this;return this._load.addClass("process"),t.prototype.loadMenu.call(this).catch(function(){}).then(function(){e._load.removeClass("process")})},e.prototype._fastDelete=function(e,i){t.prototype._fastDelete.call(this,e,i),this._chartIsActive(e)&&(d.enabled("saveload_storage_customization")?(this._chartWidgetCollection.clearChartMetaInfo(),this.setTitle("")):location.href="/chart/"+window.location.search)},e.prototype._chartIsActive=function(t){return t===this._chartWidgetCollection.metaInfo.id.value()},e.prototype._renameChart=function(){var t=this,e="text",i=new r.SaveRenameDialog({fields:[new r.InputField({name:e,label:window.t("Enter a new chart layout name")+":",error:window.t("Please enter chart layout name"),maxLength:64})],title:window.t("Rename Chart Layout")});this._editEnabled&&(i.setField(e,this.getTitle()),i.show().then(function(i){t.setTitle(i[e]),t.saveChart()}))},e.prototype._setTitle=function(t){this._titleInput.text(t),this._titleValue=t,this._savecopy.removeClass("last").addClass("titled"),t?this._options.hideChartTitle||(this._optionsMenu.show(),this._title.show()):(this._optionsMenu.hide(),this._title.hide(),this._savecopy.addClass("last").removeClass("titled")),this._setInputSize(),this._setChanges(!0)},e.prototype._setReadOnlyTitle=function(t){this._titleReadOnly.html(t).attr("title",t.replace(/<[^>]+>/g,"")),
this._savecopy.removeClass("last").addClass("titled"),this._title.addClass("last"),this._options.hideChartTitle||this._title.show()},e.prototype._setInputSize=function(){this._titleSize.text(this._titleInput.text()),this._titleInput.width(this._titleSize.width()),this.onTitleSizeChanged.fire()},e.prototype._setChanges=function(t){t=!!t,this._haveChanges=t,!t&&this.getTitle()?this._save.addClass("no-change"):this._save.removeClass("no-change")},e.prototype._process=function(t){t?this._save.addClass("process"):this._save.removeClass("process")},e.prototype._onChartAboutToBeSaved=function(){this._saving=!0,this._process(!0),this._editEnabled=!1},e.prototype._onChartSaved=function(t){this._stopProcess(),t&&this._setChanges(!1)},e.prototype._stopProcess=function(){this._saving=!1,this._process(!1),this._editEnabled=!0},e.prototype._saveChart=function(t,e){return this._readOnly||this._saving?void(e&&e()):this._haveChanges?void window.saver.saveChartSilently(function(){t&&t()},!1,function(){e&&e()}):void(t&&t())},e.prototype._goChartPage=function(t){"/chart/"===location.pathname&&(location.href="/chart/"+t)},e.prototype._getSavedCharts=function(){var t=[];return this.isSaved()&&t.push({title:this.getTitle(),disabled:!0,addClass:"save-load-chart-title"}),this._readOnly||(t.push({title:window.t("Save Chart Layout"),action:this.signInOrSaveChart.bind(this,null,null,null)}),this.isSaved()&&(t.push({title:window.t("Save As..."),action:this.signInOrSaveAs.bind(this)}),t.push({title:window.t("Rename..."),action:this.signInOrRenameChart.bind(this)}))),t},e}(_.LoadChartWidget),e.SaveLoadWidget=f},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 18" width="26" height="18"><path d="M12 0C8.4 0 5.4 2.8 5.1 6.3 2 6.1.1 9 0 11.1 0 13.9 2.2 16 4.7 16h4.9l-1-1H4.7C2.8 15 1 13.3 1 11.2 1 9 3 6.7 6 7.4 6 3 9 1 12 1s3.7 1.2 5.1 2.9c1.5.1 3.3.6 4.2 1.7 1 1.5 1.2 2.6 1.2 4.2 1.4.4 2.5 1.5 2.5 2.7-.2 1.6-1.3 2.5-2.6 2.5h-5l-1 1h5.9c2.8 0 3.7-1.9 3.7-3.5s-1-3-2.5-3.4c0-1.6-.5-2.9-1.4-4.1-.9-1.2-2.7-2-4.5-2.1C16.3 1.2 14.3 0 12 0zm-2 7v5H7l6 6 6-6h-3V7h-6zm1 1h4v5h1.6L13 16.6 9.4 13H11V8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path fill="currentColor" d="M10 16l4-4 4 4z"/><g fill="none" stroke="currentColor"><path d="M21.5 21.5h-14a5 5 0 1 1 .42-9.983 7.5 7.5 0 0 1 14.57 2.106 4.002 4.002 0 0 1-.99 7.877z"/><path stroke-linecap="square" stroke-width="2" d="M14 16v5"/></g></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),i(13),o=i(92),n=i(397),r=i(398),s=i(93),a=i(24),l=i(5),c=function(){function t(){var e=this;this._savedCharts=[],window.loginStateChange.subscribe(this,function(){e._refreshSavedChartsList()}),s.TVXWindowEvents.on("saved-charts-change",this._otherTabUpdated.bind(this)),s.TVXWindowEvents.on("saved-charts-change-favorites",this._favoritesUpdated.bind(this)),this._favorites=a.getJSON(t._favoritesKey,{})}return t.prototype.signInOrLoadChart=function(){
l.enabled("saveload_requires_authentication")?runOrSignIn(this.loadMenu.bind(this),{source:"Load chart",sourceMeta:"Chart"}):this.loadMenu()},t.prototype.loadMenu=function(){var t,e=this;return this._loadChartDialog||(this._loadChartDialog=new n),t=this._loadChartDialog,t.show(this._getLoadMenuCharts(),this._favorites),this._refreshSavedChartsList().then(function(){t.updateChartsAndFavoritesData(e._getLoadMenuCharts(),e._favorites)})},t.prototype._refreshSavedChartsList=function(){var t,e=this;return t=l.enabled("saveload_requires_authentication")&&!window.is_authenticated?Promise.resolve([]):new Promise(function(t,e){o.getCharts(t,e)}),t.then(function(t){e._savedCharts=t,s.TVXWindowEvents.emit("saved-charts-change",JSON.stringify(t))})},t.prototype._fastDelete=function(t,e){this._savedCharts.splice(e,1)},t.prototype._chartIsActive=function(t){return!1},t.prototype._getLoadMenuCharts=function(){var e=this;return this._savedCharts.map(function(i,n){return{id:i.id,url:i.url,title:i.name,symbol:i.short_symbol,interval:i.interval,toolsCount:0,modified:i.modified_iso,active:e._chartIsActive.bind(e,i.id),openAction:function(){return o.loadChart(i)},deleteAction:function(t,o){r.deleteChart(o,i.image_url,function(){e._fastDelete(i.id,n),s.TVXWindowEvents.emit("saved-charts-change",JSON.stringify(e._savedCharts)),t.resolve()},t.reject.bind(t))},favoriteAction:function(i){e._favorites=i,a.setJSON(t._favoritesKey,i),s.TVXWindowEvents.emit("saved-charts-change-favorites",JSON.stringify(i))}}})},t.prototype._favoritesUpdated=function(t){this._favorites=JSON.parse(t),this._loadChartDialog&&this._loadChartDialog.updateFavoritesData(this._favorites)},t.prototype._otherTabUpdated=function(t){this._savedCharts=JSON.parse(t),this._loadChartDialog&&this._loadChartDialog.updateChartsData(this._getLoadMenuCharts())},t._favoritesKey="loadChartDialog.favorites",t}(),e.LoadChartWidget=c},function(t,e){},function(t,e,i){"use strict";(function(t,e){function o(e,i){this.options=$.extend({throttleTimeout:125},i),this._connected=!1,this._symbol_data={},this._subscriptions={},this._delayed_subscriptions=[],this.fieldsSent=new $.Deferred,this.onConnect=new t,this.onDisconnect=new t,this._quoteApi=new n(ChartApiInstance),this._type=e||"full",this.fieldsSent=new $.Deferred,this._delayUpdateFastSymbols=s(this._updateFastSymbols,250),this._throttledSymbolData={},this._formatterValuesCache={},this._waitingForFormatters={},this._snapshotValuesCache={},this._waitingForSnapshot={},this.connect()}var n,r=i(28).PriceFormatter,s=i(321),a=i(207),l=i(304),c=i(61);n=i(775),o.prototype.destroy=function(){this._quoteApi.destroy(),this._quoteApi=null,this._connected=!1,this.onDisconnect.fire()},o.prototype.typeFields={},o.prototype.typeFields.simple=["ch","chp","current_session","description","local_description","language","exchange","fractional","is_tradable","lp","minmov","minmove2","original_name","pricescale","pro_name","short_name","type","update_mode","volume"],
o.prototype.typeFields.simpleDetailed=[].concat(o.prototype.typeFields.simple,["ask","bid","fundamentals","high_price","is_tradable","low_price","open_price","prev_close_price","rch","rchp","rtc","status","basic_eps_net_income","beta_1_year","earnings_per_share_basic_ttm","industry","market_cap_basic","price_earnings_ttm","sector","volume","dividends_yield"]),o.prototype.typeFields.full=[],o.prototype.connect=function(t){this._quoteApi.connect(this.quoteHandler.bind(this))},o.prototype.quoteHandler=function(t){var e=t.method,i=t.params;switch(e){case"connected":this._connected||(this._connected=!0,this.onConnected());break;case"quote_list_fields":break;case"quote_symbol_data":this._connected&&this.onSymbolData(i[0]);break;case"disconnected":this._connected&&(this._connected=!1,this.onDisconnect.fire())}},o.prototype.onConnected=function(){this.setFields();var t=Object.keys(this._symbol_data);t.length&&this._quoteApi.quoteAddSymbols(t,{forcePermission:!0}),this._delayed_subscriptions.forEach(function(t){this.subscribe.apply(this,t)},this),this._delayed_subscriptions=[],this.onConnect.fire()},o.prototype.setFields=function(){var t=o.prototype.typeFields[this._type];t&&t.length&&this._quoteApi.quoteSetFields(t),this.fieldsSent.resolve()},o.prototype.onSymbolData=function(t){var e=t.symbolname,i=this._throttledSymbolData[e];i||(i=this._throttledSymbolData[e]={fnDispatch:a(this.dipatchSymbolData.bind(this),this.options.throttleTimeout)}),i.cache?$.extend(!0,i.cache,t):i.cache=t,i.fnDispatch(e)},o.prototype._parseUpdateMode=function(t){var e=t.update_mode;e&&(e=e.match(/(delayed_streaming){1}(?:_([\d]+))?/))&&e[1]&&(e[2]&&(t.update_mode_seconds=+e[2]),t.update_mode=e[1])},o.prototype.dipatchSymbolData=function(t){var e,i,o=this._symbol_data[t],n=this._throttledSymbolData[t].cache;if(delete this._throttledSymbolData[t].cache,this._symbol_data[t]){$.extend(!0,o,n),o.values&&this._parseUpdateMode(o.values);for(e in this._subscriptions)i=this._subscriptions[e],i[t]&&i[t].forEach(function(t){t(o,n)})}},o.prototype.subscribe=function(t,e,i){var o,n;if(!this._connected)return void this._delayed_subscriptions.push(arguments);this._subscriptions[t]=this._subscriptions[t]||{},o=this._subscriptions[t],e=[].concat(e),n=[],e.forEach(function(t){this._symbol_data[t]?o&&o[t]||this._symbol_data[t].subscribers_count++:(this._symbol_data[t]={subscribers_count:1},n.push(t)),o[t]=o[t]||[],o[t].push(i),o[t].fast=!0,this._symbol_data[t]&&this._symbol_data[t].values&&i(this._symbol_data[t],this._symbol_data[t])},this),n.length&&(this._quoteApi.quoteAddSymbols(n,{forcePermission:!0}),this._delayUpdateFastSymbols())},o.prototype.unsubscribe=function(t,e,i){var o,n=this._subscriptions[t];n&&(n[e]&&i?(o=n[e].indexOf(i),~o&&n[e].splice(o,1),n[e].length||delete n[e]):delete n[e]),n&&0===Object.keys(n).length&&delete this._subscriptions[t],this._symbol_data.hasOwnProperty(e)&&(n&&!n[e]&&this._symbol_data[e].subscribers_count--,this._symbol_data[e].subscribers_count||(delete this._symbol_data[e],this._quoteApi.quoteRemoveSymbols([e]),
this._delayUpdateFastSymbols()))},o.prototype.setFastSymbols=function(t,e){var i,o;if(this._subscriptions[t]){i=this._subscriptions[t];for(o in i)i[o].fast=-1!==e.indexOf(o)}this._delayUpdateFastSymbols()},o.prototype._updateFastSymbols=function(){if(this._connected){var t=this._fastSymbols();0===t.length?this._quoteApi.quoteHibernateAll():this._quoteApi.quoteFastSymbols(t)}},o.prototype._delayUpdateFastSymbols=o.prototype._updateFastSymbols,o.prototype._fastSymbols=function(){var t,e,i,o=[];for(t in this._subscriptions){e=this._subscriptions[t];for(i in e)e[i].fast&&o.push(i)}return o=l(o)},o.prototype.formatter=function(t){function e(t){return new r(t.pricescale,t.minmov,t.fractional,t.minmove2)}function i(t){return t&&null!=t.pricescale&&null!=t.minmov}var o,n=this;return this._waitingForFormatters[t]?this._waitingForFormatters[t]:(o=new Promise(function(o,r){if(n._formatterValuesCache[t])o(e(n._formatterValuesCache[t]));else{var s=c.guid();n.subscribe(s,[t],function(a){a.error&&(n._waitingForFormatters[t]=null,r(a.error)),i(a.values)&&(n._waitingForFormatters[t]=null,n._formatterValuesCache[t]=a.values,o(e(a.values)),n.unsubscribe(s,t))})}}),this._waitingForFormatters[t]=o,o)},o.prototype.snapshot=function(t){var e,i=this;return this._waitingForSnapshot[t]?this._waitingForSnapshot[t]:(e=new Promise(function(e,o){if(i._snapshotValuesCache[t])e(i._snapshotValuesCache[t]);else{var n=c.guid();i.subscribe(n,[t],function(r){r.error&&(i._waitingForSnapshot[t]=null,o(r.error));var s=r.values;s&&s.minmov&&s.pricescale&&s.description&&(i._waitingForSnapshot[t]=null,i._snapshotValuesCache[t]=s,e(s),i.unsubscribe(n,t))})}}),this._waitingForSnapshot[t]=e,e)},TradingView.QuoteSessionMultiplexer=o,void 0!==e&&e&&e.exports&&(e.exports=o)}).call(e,i(10),i(42)(t))},function(t,e,i){"use strict";(function(t){function e(t){this._chartApi=t,this._sessionid="qs_"+o(),this._sessionstarted=!1}var o=i(61).randomHash;e.prototype.destroy=function(){this._sessionstarted&&(this._chartApi.quoteDeleteSession(this._sessionid),this._sessionid=null,this._sessionstarted=!1)},e.prototype.connected=function(){return this._chartApi.connected()},e.prototype.connect=function(t){this._globalHandler=t,this._chartApi.createSession(this._sessionid,this),this._chartApi.connect()},e.prototype.disconnect=function(){this._chartApi.disconnect()},e.prototype.quoteAddSymbols=function(t,e){t=[].concat(t),e&&e.forcePermission&&(t=t.concat({flags:["force_permission"]})),this._chartApi.quoteAddSymbols(this._sessionid,t)},e.prototype.quoteRemoveSymbols=function(t){this._chartApi.quoteRemoveSymbols(this._sessionid,t)},e.prototype.quoteFastSymbols=function(t){this._chartApi.quoteFastSymbols(this._sessionid,t)},e.prototype.quoteSetFields=function(t){this._chartApi.quoteSetFields(this._sessionid,t)},e.prototype.onMessage=function(t){switch(t.method){case"connected":this._sessionstarted||(this._chartApi.quoteCreateSession(this._sessionid),this._sessionstarted=!0);break;case"disconnected":this._sessionstarted=!1}this._globalHandler(t)},
e.prototype.quoteHibernateAll=function(t){this._chartApi.quoteHibernateAll(this._sessionid)},TradingView.QuoteSession=e,void 0!==t&&t&&t.exports&&(t.exports=e)}).call(e,i(42)(t))},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(17),n=function(){function t(t){var e,i,n,r,s=this;this._document=t,this.isFullscreen=new o,(e=function(){var t,e,i=["fullscreenElement","webkitFullscreenElement","mozFullscreenElement","mozFullScreenElement","msFullscreenElement"];for(t=0;t<i.length;t++)if((e=i[t])in s._document){s.isFullscreen.setValue(!!s._document[e]);break}})();for(i=0,n=["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"];i<n.length;i++)r=n[i],t.addEventListener(r,e,!1)}return t.prototype.enter=function(){var t,e,i,o=this._document.documentElement;for(t=0,e=["requestFullscreen","mozRequestFullScreen","webkitRequestFullscreen","msRequestFullscreen"];t<e.length;t++)if(i=e[t],"function"==typeof o[i]){o[i]();break}this.isFullscreen.setValue(!0)},t.prototype.exit=function(){var t,e,i,o=this._document;for(t=0,e=["exitFullscreen","mozCancelFullScreen","mozExitFullscreen","webkitExitFullscreen","msExitFullscreen"];t<e.length;t++)if(i=e[t],"function"==typeof o[i]){o[i]();break}this.isFullscreen.setValue(!1)},t}(),e.FullscreenApi=n},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(17),n=function(){function t(t){var e,i,n,r,s,a,l=this;this.isVisible=new o(!0),i=null,n=function(o){var n=o?o+"Hidden":"hidden";if(n in t)return e=o+"visibilitychange",i=function(){l.isVisible.setValue(!t[n])},i(),t.addEventListener(e,i,!1),"break"};for(r=0,s=["","moz","ms","webkit"];r<s.length&&(a=s[r],"break"!==n(a));r++);this.destroy=function(){i&&(t.removeEventListener(e,i,!1),i=null)}}return t}(),e.VisibilityApi=n},function(t,e){},function(t,e,i){"use strict";function o(t){var e=l.enabled("side_toolbar_in_fullscreen_mode");return"center"===t||"left"===t&&e}var n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),i(13),n=i(17),r=i(215),s=i(780),a=i(781),l=i(5),c=function(){function t(t){var e=this;if(this._$body=$(t.body.value()),0===this._$body.size())throw Error("bridge.body.value() must be an element or not empty jQuery object");this._availableAreas=["left","dompanel","right","top","footer","bottom","center"],this._areas={},this._bridge=t,this._width=t.width,this._height=t.height,this._width.subscribe(function(){return e.recalculate()}),this._height.subscribe(function(){return e.recalculate()}),this._bridge.visible.subscribe(function(){return e._updateVisibility()}),this._bridge.fullscreen.subscribe(function(){return e._onParentFullscreenChange()}),this.recalculate()}return t.prototype.allocate=function(t){var e,i,o=this,l=t&&t.areaName;if(-1===this._availableAreas.indexOf(l))throw Error("unknown options.areaName");return this.free(l),e=this._createDOM(l),i={canNegotiate:{width:"left"===l||"right"===l||"dompanel"===l,height:"top"===l||"bottom"===l||"footer"===l},negotiations:{width:[],height:[]},remove:function(){
for(var t in o._areas)o._areas[t]===i&&o.free(t)},negotiateWidth:function(t){if(i.canNegotiate.width){var e=s.processNegotiation(t);s.negotiationsAreEqual(i.negotiations.width,e)||(i.negotiations.width=e,o.recalculate())}},negotiateHeight:function(t){if(i.canNegotiate.height){var e=s.processNegotiation(t);s.negotiationsAreEqual(i.negotiations.height,e)||(i.negotiations.height=e,o.recalculate())}},requestFullscreen:function(){o._fullscreenArea||("right"!==l&&"center"!==l||(o._fullscreenArea=l),"center"===l&&o._bridge.requestFullscreen(),o._updateFullscreen())},exitFullscreen:function(){l===o._fullscreenArea&&(o._fullscreenArea=void 0,"center"===l&&o._bridge.exitFullscreen(),o._updateFullscreen())},detach:function(t){a.detachToPopup(i.rdState,Object.assign({},t,a.screenBox(i.body.value())))},width:new n,height:new n,availWidth:new n,availHeight:new n,alive:new n(!0),body:new n(e),detachable:new n(!0),visible:new n(!0),fullscreen:new n(!0),rdState:new r.ResizerDetacherState},i.rdState.pushOwner(i),this._areas[l]=i,i.rdState.owner.subscribe(function(t){var e,n,r,s=i.body.value();if(t!==i)s.empty().detach();else{for(e=null,n=o._availableAreas.indexOf(l);n--;)if(r=o._availableAreas[n],o._affectsLayout(r)){e=o._areas[r].body.value();break}e?s.insertAfter(e):s.appendTo(o._$body)}o.recalculate()},{callWithLast:!0}),i.rdState.bridge()},t.prototype.free=function(t){var e=this._areas[t];e&&(this._areas[t]=void 0,$(e.body.value()).remove(),e.alive.setValue(!1))},t.prototype.recalculate=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_={};for(this._recalcSingleRunToken=_,t={width:this._width.value(),height:this._height.value()},e=0;e<this._availableAreas.length;e++)if(i=this._availableAreas[e],(o=this._areas[i])&&this._affectsLayout(i)){for("center"===i?(n=0,this._affectsLayout("left")&&(n+=this._areas.left.width.value()),r=0,this._affectsLayout("top")&&(r+=this._areas.top.height.value()),o.body.value().css({left:n,top:r})):"top"!==i&&"bottom"!==i&&"footer"!==i||(n=0,this._affectsLayout("left")&&(n+=this._areas.left.width.value()),o.body.value().css({left:n})),a=void 0,a=o.canNegotiate.width&&!o.canNegotiate.height?["height","width"]:["width","height"],l=0;l<2;l++){if(c=a[l],h=void 0,u=t[c],this._fullscreenArea===i)h=u;else{if("bottom"===i&&"height"===c&&(u-=5),"right"!==i&&"dompanel"!==i||"width"!==c||(u-=300),"width"===c?o.availWidth.setValue(u):"height"===c&&o.availHeight.setValue(u),_!==this._recalcSingleRunToken)return;o.canNegotiate[c]?(h=s.determineSize(u,o.negotiations[c]),t[c]-=h):h=u}if(o.body.value().css(c,h),o[c].setValue(h),_!==this._recalcSingleRunToken)return}o.body.value().toggleClass("js-hidden",!1)}else o&&o.body.value().toggleClass("js-hidden",!0);this._affectsLayout("footer")&&(o=this._areas.footer,d=this._height.value()-o.height.value(),this._affectsLayout("bottom")&&(d-=this._areas.bottom.height.value()),o.body.value().css({top:d})),this._affectsLayout("dompanel")&&(o=this._areas.dompanel,p=0,this._affectsLayout("right")&&(p+=this._areas.right.width.value()),o.body.value().css({right:p}))},
t.prototype._affectsLayout=function(t){var e,i=this._areas[t];return!!i&&(i.rdState.owner.value()===i&&(this._fullscreenArea&&this._fullscreenArea!==t?o(t):!((this._width.value()<=567||this._height.value()<=450)&&(e=["center","top"],l.enabled("keep_left_toolbar_visible_on_small_screens")&&e.push("left"),!e.includes(t)))))},t.prototype._updateVisibility=function(){var t,e,i,o=this._bridge.visible.value();for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],(i=this._areas[e])&&(o&&this._affectsLayout(e)?i.visible.setValue(!0):i.visible.setValue(!1))},t.prototype._onParentFullscreenChange=function(){this._bridge.fullscreen.value()||(this._fullscreenArea=void 0,this._updateFullscreen())},t.prototype._updateFullscreen=function(){var t,e,i,n=void 0!==this._fullscreenArea;for(t=0;t<this._availableAreas.length;t++)e=this._availableAreas[t],(i=this._areas[e])&&(e!==this._fullscreenArea?i.body.value().toggleClass("js-hidden",n&&!o(e)):i.fullscreen.setValue(!0));this._updateVisibility(),this.recalculate()},t.prototype._createDOM=function(t){var e=$("<div>").addClass("layout__area--"+t).css("position","absolute");return"bottom"===t?e.css("bottom",0):e.css("top",0),"right"===t||"dompanel"===t?e.css("right",0):e.css("left",0),e},t}(),e.ChartPage=c},function(t,e,i){"use strict";function o(t,e){var i,o,n,r,s,a,l=0;for(i=0,o=e;i<o.length&&(n=o[i],r=n.min,s=n.max,t<r||s<r||(a=Math.min(t,s),l=Math.max(l,a),t!==l));i++);return l}function n(t){var e,i,o,n,r,s=[];if(void 0===t)return[];for(Array.isArray(t)||(t=[t]),e=0,i=t;e<i.length;e++)o=i[e],n=void 0,r=void 0,isFinite(o)?n=r=+o:(n=+o.min,r=+o.max),(n<0||isNaN(n))&&(n=0),isNaN(r)&&(r=1/0),n<=r&&r>0&&s.push({min:n,max:r});return s.sort(function(t,e){return t.min-e.min||t.max-e.max}),s}function r(t,e){if(t.length!==e.length)return!1;for(var i=t.length;i--;){if(t[i].min!==e[i].min)return!1;if(t[i].max!==e[i].max)return!1}return!0}Object.defineProperty(e,"__esModule",{value:!0}),e.determineSize=o,e.processNegotiation=n,e.negotiationsAreEqual=r},function(t,e,i){"use strict";function o(t,e){var i,o=Object.assign({},e),n=t.bridge().body.value();return n&&(o.useStylesFrom=n.prop("ownerDocument")),!!(i=l(o))&&(t.pushOwner(i.allocate()),!0)}function n(t){var e,i,o=$(t),n=o.offset(),r={left:+n.left,top:+n.top,width:o.width(),height:o.height()},s=o.prop("ownerDocument");return s&&(e=s.defaultView)?(i=e.innerWidth/$(s.documentElement).width(),isFinite(i)&&(r.left*=i,r.top*=i,r.width*=i,r.height*=i),r.left+=e.screenLeft||e.screenX||0,r.top+=e.screenTop||e.screenY||0,r):r}var r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),r=i(322),e.detachToPopup=o,e.screenBox=n,s=function(t,e){var i,o,n,r,s,a,l=t.querySelectorAll('style, link[rel~="stylesheet"]'),c=e.createDocumentFragment();for(i=0;i<l.length;i++){for(o=l[i],n=e.createElement(o.tagName),r=0;r<o.attributes.length;r++)s=o.attributes[r],n.setAttribute(s.nodeName,s.nodeValue||"");a=o.textContent,a&&(n.textContent=a),c.appendChild(n)}return c},a=function(t,e,i){var o=function(){t&&t.removeEventListener("unload",o,!1),
e&&(e.removeEventListener("unload",o,!1),e.close()),i&&i.free()};t.addEventListener("unload",o,!1),e.addEventListener("unload",o,!1)},l=function(t){var e,i,o,n,l,c,h,u,d;for(void 0===t&&(t={}),e="menubar=no,toolbar=no,location=no,personalbar=no,status=no",i=0,o=["top","left","width","height"];i<o.length;i++)n=o[i],l=+t[n],isFinite(l)&&l>=0&&(e+=","+n+"="+l);if(!(c=window.open("",t.name||"_blank",e))||c.closed)return null;h=null;try{h=c.document,h.close()}catch(t){return null}return h.open(),h.write('<!DOCTYPE html><html><head><meta http-equiv="X-UA-Compatible" content="IE=Edge" /></head><body></body></html>'),h.close(),null!=t.title&&(h.title=t.title+""),t.useStylesFrom&&(h.head.appendChild(s(t.useStylesFrom,h)),u=h.createElement("style"),u.textContent="html, body {min-width: 0 !important; max-width: none !important}",h.head.appendChild(u)),d=new r.Root(c),a(window,c,d),d}},function(t,e,i){"use strict";var o=i(5);window.onload=function(){function t(){var t=0;return JSON.parse(urlParams.logo).image&&(t="C",o.enabled("link_to_tradingview")||(t="D")),t}function e(){try{return/^(192|172|10)\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]\.[0-9][0-9][0-9]/.test(location.hostname)||/^.*((?:\.local)|localhost)$/.test(location.hostname)}catch(t){return!1}}location.hostname.indexOf(".")>=0&&!e()&&setTimeout(function(){try{var e=t();window.ga&&0!==e&&window.ga("send","event","s",e)}catch(t){}},3e4)}},function(t,e,i){"use strict";(function(e){function o(t){function i(t,e){var i,o,r=[],s=n[Kt].count;for(i=0;i<s;i++)r.push(Ut[i].chartWidget.state(t,e));return o={layout:Kt,charts:r},Jt.value()&&(o.symbolLock=1),Qt.value()&&(o.intervalLock=1),te.value()&&(o.trackTimeLock=1),l.hideAllDrawings().value()&&(o.hideAllDrawings=!0),o}function o(t){var e,i=$.Deferred(),o=[],r=n[Kt].count;for(e=0;e<r;e++)o.push(Ut[e].chartWidget.asyncState(t));return $.when.apply($,o).then(function(){var t,e={charts:[]};for(t=0;t<arguments.length;t++)e.charts.push(arguments[t]);i.resolve(e)}),i}function S(){if(Yt&&!St)for(var t=0;t<Yt.count;t++)w(t);else w(Gt);Lt.trigger("chart-rect-update",Lt[0].getBoundingClientRect())}function w(t){var e,i,o=Ut[t];o&&(e=St?n.s.sizer(0,{width:yt.value(),height:bt.value()},Ft,Nt):Yt.sizer(t,{width:yt.value(),height:bt.value()},Ft,Nt),i={width:Math.max(Math.round(e.width||0)-2*Wt,0),height:Math.max(Math.round(e.height||0)-2*Wt,0),top:Math.max(Math.round(e.top||0),0),left:Math.max(Math.round(e.left||0),0)},o.metrics=i,o.body.value().css(i),o.width.setValue(i.width),o.height.setValue(i.height))}function T(){for(var t=0;t<Ut.length;t++)Ut[t].chartWidget.resizeSeriesControlUI()}function C(){for(var t=0;t<Ut.length;t++)Ut[t].chartWidget.tickSeriesControlClock()}function x(){for(var t=0;t<Ut.length;t++)if(!Ut[t].chartWidget||!Ut[t].chartWidget.model())return!1;return!0}function P(e){function i(){a.visible.setValue(!a.hiddenInLayout.value()&&t.resizerBridge.visible.value())}var o,n,s,a;return e=Object.assign({chartWidgetCollection:zt,isActive:0===Ut.length,barsMarksContainersFactory:L,undoHistory:Pt},e||{}),
n=$(document.createElement("div")).addClass("chart-container").appendTo(Lt).css({position:"absolute",overflow:"hidden"}),n.on("mousedown touchstart",function(){x()&&$t.setValue(o)}),s=Ut.length,a={alive:new _(!0),body:new _(n),width:new _,height:new _,hiddenInLayout:new _(!1),visible:new _,rdState:new f},a.rdState.pushOwner(a),Ut.push(a),w(s),a.hiddenInLayout.subscribe(i),t.resizerBridge.visible.subscribe(i),i(),Object.assign(e,a.rdState.bridge()),a.chartWidget=o=new r.ChartWidget(e),zt.firstWidgetInitialized||o.chartWidgetInitialized.subscribe(null,function(){zt.firstWidgetInitialized=!0,T()},!0),(1===Ut.length||d.enabled("show_logo_on_all_charts"))&&o.createBranding(),e.containsData?o.finishInitWithoutConnect():o.connect(),k(),A(),kt.fire(o),o}function L(t){var e,i,o=[];return d.enabled("charting_library_base")&&(e=new v(t),o.push(e),i=new y(t),o.push(i)),o}function I(t,e){var i,o,r,s;t in n||(t="s"),i=n[t].count,h.emit("layout_about_to_be_changed",t),Kt=t,St=e,wt.setValue(St),Yt=n[t];for(o=0;o<i||o<Ut.length;o++)r=e?Gt===o:o<i,r?(Ut[o]?(Lt.append(Ut[o].body.value()),Ut[o].hiddenInLayout.setValue(!1),(s=Zt.shift())&&(Xt=!0,Ut[o].chartWidget.loadContent(s.content),Xt=!1)):P($.extend({},Tt,Zt.shift()||($t.value()?{content:$t.value().state()}:null)||{},0===o||Jt.value()?{}:{defSymbol:null})),Ut[o].body.value().toggleClass("multiple",i>1),w(o)):Ut[o]&&(Ut[o].hiddenInLayout.setValue(!0),Ut[o].body.value().detach());return k(),h.emit("layout_changed"),!0}function k(){var t,e=Math.min(Yt.count,Ut.length)-1;if(e<0)return void $t.deleteValue();t=Gt,t<0&&(t=0),t>e&&(t=e),$t.setValue(Ut[t].chartWidget)}function A(){var t,e;for(t=Ut.length;t--;)e=t===Gt,Ut[t].body.value().toggleClass("active",e).toggleClass("inactive",!e)}function M(){return Ut.filter(function(t){return!t.hiddenInLayout.value()}).sort(function(t,e){return t.metrics.top-e.metrics.top||t.metrics.left-e.metrics.left})}function E(){var t,e,i,o=vt.value();"s"!==o&&(t=n[o].count,wt.value()||(jt=M()),e=qt+1,i=jt[e],!i||e>t?(i=jt[0],qt=0):qt=e,$t.setValue(i.chartWidget),wt.value()&&I(o,!0))}function D(t){var e=$t.value();return!!e&&e.trySetChartStyle(t)}function V(t){var e,i,o,n;Et!==t&&(Et&&(Et.modelCreated().unsubscribe(null,O),(e=Et.model())&&(i=e.mainSeries().properties(),i.style.unsubscribe(null,R),o=e.model(),o.onSelectedSourceChanged().unsubscribe(null,B),Et=null)),t&&(n=t.model(),n?O(n):t.modelCreated().subscribe(null,O),Et=t))}function O(t){var e,i=t.mainSeries().properties();i.style.subscribe(null,R),R(i.style),e=t.model(),e.onSelectedSourceChanged().subscribe(null,B),B(t.selectedSource())}function R(t){At.setValue(t.value())}function B(t){Mt.setValue(t)}function z(t){var e,i,o,n;if(t!==Jt.value()){if(Pt.beginUndoMacro("Symbol Lock"),t)for(e=$t.value(),i=e.getSymbol(),o=0;o<Ut.length;o++)(n=Ut[o].chartWidget)!==e&&n.getSymbol()!==i&&n.setSymbol(i);Pt.setWatchedValue(Jt,t,"Symbol Lock"),Pt.endUndoMacro()}}function F(t){var e,i,o,n;if(t!==Qt.value()){if(Pt.beginUndoMacro("Interval Lock"),t)for(e=$t.value(),i=e.getResolution(),
o=0;o<Ut.length;o++)(n=Ut[o].chartWidget)!==e&&n.getResolution()!==i&&n.setResolution(i);Pt.setWatchedValue(Qt,t,"Resolution Lock"),Pt.endUndoMacro()}}function N(t){te.value()!==t&&Pt.setWatchedValue(te,t,"Track Time")}function W(t){return vt.value()!==t&&(Pt.pushUndoCommand(new p(zt,t)),!0)}function H(t){Jt.value()?U(t):$t.value().setSymbol(t)}function U(t){var e,i,o=!1;for(e=0;e<Ut.length;e++)i=Ut[e].chartWidget,(i.model().mainSeries().properties().symbol.value()!==t||d.enabled("same_data_requery"))&&(o||(Pt.beginUndoMacro("Change Symbol"),o=!0),i.setSymbol(t));o&&Pt.endUndoMacro()}function j(t){var e,i,o;if(!Xt)if(Qt.value()){for(e=!1,i=0;i<Ut.length;i++)o=Ut[i].chartWidget,o.model().mainSeries().properties().interval.value()!==t&&(e||(Pt.beginUndoMacro("Change Resolution"),e=!0),o.setResolution(t));e&&Pt.endUndoMacro()}else $t.value().setResolution(t)}function q(t){var e,i,o;if(t&&t.onlyActiveChart||St)return{layout:"s",hidpiRatio:window.hidpiCanvasRatio||1,charts:[$t.value().images()]};for(e=[],i=Yt.count,o=0;o<Ut.length&&o<i;o++)e.push(Ut[o].chartWidget.images());return{layout:Kt,hidpiRatio:window.hidpiCanvasRatio||1,charts:e}}function G(){var t,e=[];for(t=0;t<Ut.length&&t<Yt.count;t++)e=e.concat(Ut[t].chartWidget.tags());return e=$.unique(e),e=$.map(e,function(t){return t.toLowerCase().replace(/\W+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")})}function Y(t,e,i,o){var n,r,s,a;if(i||oe&&!St)for(n=Yt.count,r=0;r<Ut.length&&r<n;r++)(s=Ut[r].chartWidget)!==e&&(a=s.model())&&a.model().setExternalPosition(t,o)}function K(t,e){var i,o,n,r;if(te.value()){for(i=Yt.count,Pt.beginUndoMacro("Sync Time"),o=0;o<Ut.length&&o<i;o++)if(n=Ut[o].chartWidget,r=n.model()){if(r.model()===e)continue;r.gotoTime(t,{centerIfVisible:!1,model:e})}Pt.endUndoMacro()}}function Z(){dt(!1),Ut.forEach(function(t){void 0!==t.timingsMeter&&t.timingsMeter.destroy(),t.chartWidget.destroy()}),t.resizerBridge.remove(),Ot&&clearInterval(Ot),$(window).off("resize",S),$(document).off("onUpdate",S),It.resolve()}function X(){return It.promise()}function J(){return kt}function Q(){xt.id.setValue(void 0),xt.uid.setValue(void 0),xt.name.setValue(void 0)}function tt(){var e={snapshotUrl:t.snapshotUrl};(d.enabled("show_dialog_on_snapshot_ready")?u.getImageOfChart:u.getImageOfChartSilently)(zt,e,function(t){h.emit("onScreenshotReady",t)})}function et(){for(var t=n[Kt].count;t<Ut.length;t++)Ut[t].chartWidget.destroy();Ut.splice(n[Kt].count)}function it(t){for(var e=0;e<Ut.length;e++)Ut[e].chartWidget.applyOverrides(t)}function ot(t){for(var e=0;e<Ut.length;e++)Ut[e].chartWidget.applyStudiesOverrides(t)}function nt(){t.resizerBridge.requestFullscreen()}function rt(){t.resizerBridge.exitFullscreen()}function st(){return Lt}function at(t,e){(e?[{chartWidget:$t.value()}]:Ut).forEach(function(e){var i=e.chartWidget.model().mainSeries().properties(),o=e.chartWidget.model().model().properties().paneProperties,n=i.extendedHours.value(),r=o.background.value();e.chartWidget._model.model().restoreTheme(t),
i.extendedHours.value()!==n&&i.extendedHours.listeners().fire(i.extendedHours),o.background.value()!==r&&o.background.listeners().fire(o.background)})}function lt(t,e){g.bind(t,function(t){t.preventDefault(),e()})}function ct(){for(var t in Vt)lt(t,Vt[t])}function ht(){for(var t in Vt)g.unbind(t)}function ut(t){Dt!==t&&(Dt=t,t?ct():ht())}function dt(t){if(Tt.onWidget||ut(t),0!==Ut.length){for(var e=Ut.length;e--;)Ut[e].chartWidget.setActive(!1);Ut[Gt].chartWidget.setActive(t)}}function pt(t){return d.enabled("charting_library_base")?t:"s"===t||d.enabled(ProductFeatures.MULTIPLE_CHARTS)&&d.getConfig(ProductFeatures.MULTIPLE_CHARTS).layout.indexOf(t)>=0||Tt.containsData||Ht?t:"s"}function _t(t){if(Zt=[],t){t.charts||(t={layout:"s",charts:[t]}),Kt=pt(t.layout||"s");for(var e=0;e<t.charts.length;e++)Zt.push({content:t.charts[e]});t.symbolLock&&Jt.setValue(!0),t.intervalLock&&Qt.setValue(!0),t.trackTimeLock&&te.setValue(!0),t.hideAllDrawings&&ee.setValue(!0)}vt.setValue(Kt),I(Kt,St)&&(l.init(),l.hideAllDrawings().setValue(ee.value()),Zt.splice(0,Zt.length))}function ft(){0===--Rt&&h.emitOnce("onChartReady")}function mt(){return Promise.all(Ut.map(function(t){return m(t.chartWidget.modelCreated())}))}function gt(){return Promise.all(Ut.map(function(t){return m(t.chartWidget.model().mainSeries().onSymbolResolved())}))}var vt,yt,bt,St,wt,Tt,Ct,xt,Pt,Lt,It,kt,At,Mt,Et,Dt,Vt,Ot,Rt,Bt,zt=this,Ft=2,Nt=0,Wt=1,$t=new _,Ht=!1,Ut=[],jt=[],qt=0,Gt=0,Yt=null,Kt="s",Zt=[],Xt=!1,Jt=new _(!1),Qt=new _(!1),te=new _(!1),ee=new _(!1),ie=new _(TVSettings.getBool("chart.syncCrosshair",!0)),oe=ie.value();ie.subscribe(function(t){t=!!t,oe=t,TVSettings.setValue("chart.syncCrosshair",t)}),vt=new _(Kt),yt=t.resizerBridge.width,bt=t.resizerBridge.height,St=!1,wt=new _(St),"padding"in t&&(Ft=t.padding),"edge"in t&&(Nt=t.edge),Tt=t.widgetOptions||{},Tt.readOnly&&(Ht=!0),Ct=t.metaInfo||{},xt={id:new _(Ct.id),name:new _(Ct.name),description:new _(Ct.description),username:new _(Ct.username),uid:new _(Ct.uid)},Pt=a(),Lt=$(t.resizerBridge.body.value()).eq(0),It=$.Deferred(),kt=new e,yt.subscribe(S),bt.subscribe(S),this.updateLayout=S,At=new _,Mt=new _,Et=null,$t.subscribe(function(t){var e,i;if(t){for(i=Ut.length;i--;)if(Ut[i].chartWidget===t){e=i;break}if(!isFinite(e))throw Error("Cannot make detached ChartWidget active");if(Gt!==e){for(Gt=e,A(),jt.length&&(qt=jt.indexOf(Ut[Gt])),i=Ut.length;i--;)Ut[i].chartWidget.setActive(!1);t.setActive(!0)}V(t)}},{callWithLast:!0}),Dt=!1,Vt={"Alt+s":tt,Tab:E},ut(!0),Object.assign(this,{createChartWidget:P,getAll:function(){return Ut.map(function(t){return t.chartWidget})},destroy:Z,layout:vt,maximizeCurrentChart:wt,activeChartWidget:$t,activeChartStyle:At.readonly(),trySetChartStyleToActiveWidget:D,selectedSource:Mt.readonly(),metaInfo:xt,state:i,asyncState:o,readOnly:function(){return Ht},lock:{symbol:Jt,setSymbolLockWithUndo:z,interval:Qt,setIntervalLockWithUndo:F,crosshair:ie,trackTime:te,setTrackTimeWithUndo:N},setSymbol:H,setResolution:j,updateLayout:S,setChartLayoutWithUndo:W,resizeWidgetsUI:T,images:q,tags:G,
syncCrosshair:Y,syncScroll:K,setSymbolAll:U,clearChartMetaInfo:Q,onfeatures:t.onfeatures,takeScreenshot:tt,loadContent:_t,purgeUnusedWidgets:et,applyOverrides:it,applyStudiesOverrides:ot,switchChart:E,startFullscreen:nt,exitFullscreen:rt,destroyPromise:X,chartWidgetCreated:J,getContainer:st,onWidget:Tt.onWidget,applyTheme:at,setActive:dt,undoHistory:Pt}),_t(t.onfeatures?void 0:t.content),vt.subscribe(function(t){A(),I(t,!1)&&(jt=M(),qt=jt.indexOf(Ut[Gt]))}),vt.hook=function(t){return t===this.value()?t:pt(t)},Ht&&(vt.writeLock=!0),wt.subscribe(function(t){t!==St&&(jt=M(),I(Kt,t))}),Ot=setInterval(C,1e3),$(window).on("resize",S),$(document).on("onUpdate",S),d.enabled("datasource_copypaste")&&(c.init(),t.globalEvents&&($(window).on("appclip:paste",function(t){$t.value().onAppClipboardPaste(),t.preventDefault()}),$(window).on("appclip:copy",function(t){$t.value().onAppClipboardCopy(),t.preventDefault()}),$(window).on("appclip:cut",function(t){$t.value().onAppClipboardCut(),t.preventDefault()}))),Rt=0,Ut.forEach(function(t){if(t){Rt++;var e=t.chartWidget;e.withModel(null,function(){if(e.model().mainSeries().bars().size()>0)ft();else{var t=function(){ft(),e.model().mainSeries().onBarReceived().unsubscribe(null,t),e.model().mainSeries().onCompleted().unsubscribe(null,t)};e.model().mainSeries().onBarReceived().subscribe(null,t),e.model().mainSeries().onCompleted().subscribe(null,t)}})}}),s()&&(Bt=l.tool.setValue,l.tool.setValue=function(){zt.selectedSource.value()&&zt.activeChartWidget.value().model().lineBeingCreated()&&zt.activeChartWidget.value().model().cancelCreatingLine(),Bt.apply(l.tool,arguments)}),mt().then(gt).then(function(){window.saver&&window.is_authenticated&&t.widgetOptions.justCloned&&window.saver.saveChartSilently()}).catch(b.logError.bind(b))}var n=i(216).layouts,r=i(784),s=i(64).supportTouch,a=i(964).createUndoHistory,l=i(26),c=i(233),h=i(23),u=i(966),d=i(5),p=i(967).SetChartLayoutCommand,_=i(17),f=i(215).ResizerDetacherState,m=i(968).delegateToPromise,g=i(147),v=i(969),y=i(970),b=i(7).getLogger("Chart.ChartWidgetCollection");t.exports=o}).call(e,i(10))},function(t,e,i){"use strict";(function(e){function o(t){var i,o,n,r,s,a,l,c,h,u,d,f,m,g,v,y,b,w=this;this._guid=j(),this._startSpinner(t.body.value()),this._options=t=t||{},i=t.content,o=t.readOnly,o||(x.init(),x.tool.subscribe(function(t){var e,i,o,n;w._model&&(e=t,w._model.model().setCurrentTool(e),TradingView.isMobile.any()&&(i=w._paneWidgets[0],S.isLineTool(e)&&"LineToolBrush"!==e&&!w.selectBarMode().value()?(o=.5*w._model.model().timeScale().width(),n=.5*i._state.defaultPriceScale().height(),w._model.model().setAndSaveCurrentPosition(o,n,i._state),i._updateTooltip(o,n)):i._hideTooltip()),w._model&&TradingView.isMobile.any()&&w._model.model().crossHairSource().updateAllViews())}),n=function(t,e,i){var o,n=e.mainSeries().syncModel(),r=t.mainSeries().syncModel(),s=i;return n&&r&&(o=t._createSyncPoint(n,r),s=o.sourceTimeToTargetTime(i)),t.timeScale().points().roughIndex(s,r&&r.distance.bind(r))},x.createdLineTool.subscribe(null,function(t){var e,i,o
;w._model&&(e=w._model.model(),t.model!==e&&(i=e.paneForSource(w._model.model().mainSeries()),o={index:n(e,t.model,t.point.timeStamp),price:t.point.price},w._model.createLineTool(i,o,t.linetool,t.properties,t.linkKey)))}),x.continuedLineTool.subscribe(null,function(t){var e,i,o;w._model&&(e=w._model.model(),t.model!==e&&(i={index:n(e,t.model,t.point.timeStamp),price:t.point.price},(o=w._model.lineBeingCreated())&&w._model.model().coninueCreatingLine(i,t.envState,!!t.finalState)&&t.finalState&&o.restoreExternalPoints(t.finalState)))}),x.cancelledLineTool.subscribe(null,function(t){if(w._model){var e=w._model.model();t.model!==e&&w._model.model().cancelCreatingLine()}}),x.startedMovingLineTool.subscribe(null,function(t){var e,i,o;w._model&&(e=w._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(o={index:n(e,t.model,t.point.timeStamp),price:t.point.price},w._model.model().startMovingSource(i,o)))}),x.movedLineTool.subscribe(null,function(t){var e,i;w._model&&(e=w._model.model(),t.model!==e&&e.sourceBeingMoved()&&e.sourceBeingMoved().linkKey===t.linkKey&&(i={index:n(e,t.model,t.point.timeStamp),price:t.point.price},w._model.model().moveSource(i)))}),x.finishedMovingLineTool.subscribe(null,function(t){var e,i;w._model&&(e=w._model.model(),t.model!==e&&(i=e.sourceBeingMoved())&&(w._model.model().endMovingSource(!!t.finalState),t.finalState&&i.restoreExternalPoints(t.finalState)))}),x.startedChangingLineTool.subscribe(null,function(t){var e,i,o;w._model&&(e=w._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(o={index:n(e,t.model,t.point.timeStamp),price:t.point.price},w._model.model().startChangingLinetool(i,o,t.pointIndex,t.envState)))}),x.changedLineTool.subscribe(null,function(t){var e,i;w._model&&(e=w._model.model(),t.model!==e&&e.lineBeingEdited()&&e.lineBeingEdited().linkKey===t.linkKey&&(i={index:n(e,t.model,t.point.timeStamp),price:t.point.price},w._model.model().changeLinePoint(i,t.envState)))}),x.finishedChangingLineTool.subscribe(null,function(t){var e,i;w._model&&(e=w._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0],e.lineBeingEdited()&&w._model.model().endChangingLinetool(!!t.finalState),i&&t.finalState&&i.restoreExternalPoints(t.finalState)))}),x.removedLineTool.subscribe(null,function(t){var e,i;w._model&&(e=w._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&w._model.model().removeSource(i))}),x.finishedLineTool.subscribe(null,function(t){var e;w._model&&(e=w._model.model(),t.model!==e&&e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0]&&w._model.model().finishLineTool())}),x.changedLineStyle.subscribe(null,function(t){var e,i;w._model&&(e=w._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(i.properties().merge(t.state),i.propertiesChanged()))}),x.restoredLineToolState.subscribe(null,function(t){var e,i,o
;w._model&&(e=w._model.model(),t.model!==e&&(i=e.dataSources().filter(function(e){return e.linkKey===t.linkKey})[0])&&(o=$.extend({},t.state),o.indexes=o.points.map(function(i){return{index:n(e,t.model,i.time_t),price:i.price}}),e.restoreLineToolState(i,o)))}),x.restoredLineTool.subscribe(null,function(t){if(w._model){var e=w._model.model();t.model!==e&&e.restoreSource(t.state.restorePane,t.state.paneIndex,t.state.paneState,t.state.sourceState,t.state.priceScaleName)}}),x.copiedLineTool.subscribe(null,function(t){var e,i,o,r,s,a;if(w._model&&(e=w._model.model(),t.model!==e)){if(i=e.paneForSource(e.mainSeries()),o=t.points.map(function(i){return{index:n(e,t.model,i.timeStamp),price:i.price}}),r=o[0],s=e.createLineTool(i,r,t.linetool,null,t.linkKey),e.lineBeingCreated())for(a=1;a<o.length;a++)a!==o.length-1||"LineToolBrush"!==t.linetool&&"LineToolGhostFeed"!==t.linetool||e.finishLineTool(!0),e.coninueCreatingLine(o[a],{},a<o.length-1,!0);s.properties().interval.setValue(t.state.interval),s.properties().merge(t.state),s.restoreData&&s.restoreData(t),s.propertiesChanged(),s&&t.finalState&&(s.calcIsActualSymbol(),s.restoreExternalPoints(t.finalState))}})),r=t.containsData,s=t.onWidget,a=t.onCmeWidget,a&&X.logWarn("[ChartWidget] 'onCmeWidget' option is depricated"),l=t.widgetCustomer,c=t.timezone,h=t.withDateRanges,u=t.hideSymbolSearch,d=t.defSymbol,f=t.defInterval,m=t.defExtendedHours,g=t.defTimeframe,v=-1!==$.inArray(t.defStyle,$.map($.grep(Object.keys(p),function(t){return/^STYLE_\w+/.test(t)}),function(t){return p[t]})),y=v?t.defStyle:void 0,this._chartWidgetCollection=t.chartWidgetCollection||null,this._withDateRanges=(void 0===h?!o:!!h)&&_.enabled("timeframes_toolbar"),this._jqParent=t.body.value(),this._setContent(i),this._readOnly=o,this._containsData=r,this._defSymbol=d,this._defInterval=f,this._defTimeframe=g,this._defStyle=y,this._onWidget=!!s,this._onWidget&&(a?this._widgetCustomer="cme":l&&(this._widgetCustomer=l)),this.controlBarHeight=22,this._hideSymbolSearch=u,this._jqMainDiv=null,this._jqMainTable=null,this._paneWidgets=[],this._paneSeparators=[],this._timeAxisWidget=null,this._frameTime=30,this._model=null,this._metaInfo={},this._drawRafId=0,b=this._contentSeriesProperties(),b&&(d=b.symbol,f=b.interval),void 0===P||P.isValid(f)||(f=void 0),this._properties=new O("chartproperties"),this._properties.mainSeriesProperties.merge(defaults("chartproperties.mainSeriesProperties")),this._properties.mainSeriesProperties.merge({visible:!0,symbol:d||DEFAULT_SYMBOL,shortName:"",timeframe:"",onWidget:this._onWidget,interval:f||"D",style:y,extendedHours:m,lineStyle:{styleType:TradingView.factoryDefaults("chartproperties.mainSeriesProperties.lineStyle.styleType")}}),this._containsData&&this._properties.mainSeriesProperties.merge({showCountdown:!1}),c&&z(c)&&this._properties.timezone.setValue(c),this._tagsChanged=new e,this._modelCreated=new e,this._disconnected=new e,this._reconnectBailout=new e,this._connected=new e,this._redrawPanes=new e,this._onScroll=new e,this.chartWidgetInitialized=new e,this._studiesMetaData=[],
this._studiesMigrations=[],this._chartSession=new N(ChartApiInstance),this.lhsPriceAxisWidthChanged=new e,this.rhsPriceAxisWidthChanged=new e,this._timingsMeter=null,this._isActive=t.isActive,this._width=t.width,this._height=t.height,t.width.subscribe(function(){w.resize()}),t.height.subscribe(function(){w.resize()}),t.visible.subscribe(this._updateTimingsMeterState.bind(this))}function n(t){return{UTC:"Etc/UTC",EST:"America/New_York",CST:"America/Chicago",PST:"America/Los_Angeles"}[t]||"exchange"}function r(t){return t.description_localized=window.t(t.description,{context:"study"}),t}var s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W,H,U,j,q,G,Y,K,Z,X;i(12),s=i(9).assert,a=i(785),l=i(936),c=i(938),h=i(164).PriceAxisWidget,u=i(942),i(84),d=i(106).BarsMarksContainer,p=i(77),_=i(5),f=i(148).isFeatureEnabled,m=i(232).ActionBinder,g=i(136).showEditObjectDialog,v=i(358).showGoToDateDialog,y=i(35).Study,b=i(163),S=i(1).LineDataSource,w=i(52),T=w.Action,C=w.ActionSeparator,x=i(26),P=i(34).Interval,L=i(944),I=i(949),k=i(950).showSymbolInfoDialog,A=i(22),M=i(360).AddCompareDialog,E=i(76),D=i(317),V=i(71),i(346),O=i(6).DefaultProperty,R=i(171),B=R.availableTimezones,z=R.timezoneIsAvailable,F=i(65).createDialog,N=i(345).ChartSession,W=i(33),H=i(172).unifiedSpinner,U=i(40).trackEvent,j=i(61).guid,q=i(130).Size,G=i(319),Y=i(112).createConfirmDialog,K=i(960).MarketStatusIndicator,Z=i(962).DataModeIndicator,X=i(7).getLogger("ChartWidget",{color:"#606"}),o.prototype.setTimezone=function(t){t&&z(t)?this._properties.timezone.setValue(t):console.warn("Incorrect timezone: "+JSON.stringify(t))},o.prototype.refreshMarks=function(){this.model().barsMarksSources().forEach(function(t){t.refreshData()})},o.prototype.clearMarks=function(){this.model().barsMarksSources().forEach(function(t){t.clearMarks()})},o._nextMetadataId=1,o._filterAuthorizedMetaInfo=function(t){var e,i,o,n,r=[];for(e=0;t&&e<t.length;++e)i=t[e],o=W.parseIdString(i.id),n=o.productId,pro.hasPackage(n)&&r.push(i);return r},o.prototype.privateMetaInfo=function(t){if(t){return new t(W.CURRENT_METAINFO_FORMAT_VERSION).generateMetaInfo()}return[]},o.prototype._onScriptSources=function(t,e){var i,o,n,r,s,a,l,c;for(X.logDebug("ChartWidget _onScriptSources called"),i=null,o=0;o<e.length;++o)if(n=e[o],n.id.startsWith("Script@tv-scripting-")){i=W.parseIdString(n.id).version;break}if(null!=i){for(this.studyScriptingPkgVers=i,r=0,s=0,o=0;o<t.length;++o){a=t[o],l=a&&a.scriptName,r++;try{c=W.createMetaInfoStub(a,i),e.push(c)}catch(t){X.logError("Could not process script (skipped): "+l+" ("+t.message+")"),s++}}X.logDebug("User's Pine Scripts loaded "+r+", skipped "+s)}else X.logError("Could not find tv-scripting package in metadata response");for(o=0;o<e.length;o++)W.addOrReplaceStudyMetaInfo(this._studiesMetaData,e[o]);this._applyStudiesOverrides(),this._inited?this.model().model().setStudiesMetaData(this._studiesMetaData,this._studiesMigrations):(this._init(),this.chartWidgetInitialized.fire(),X.logDebug("ChartWidget _onScriptSources done"))},
o.prototype._init=function(){var t,e,i=this;this.model()&&this.model().mainSeries().clearData(),this.initColors(),this._makeDefaultGui(),t=function(){i._checkObsoleteTimezone(),i._chartSession&&i._chartSession.connected()&&i._restartModel(),this._content&&(this.initColors(),this._updateGui(),this.update());var t=i._model.mainSeries();t.marketStatus.subscribe(function(e){i.indicatorImage&&i._updateDataAndMarketStatus(e,t.status(),t.quoteData.update_mode_seconds)},{callWithLast:!0}),this._resizeHandler=function(){this._adjustSize(),this._model&&this._model.mainSeries().requestMoreData(),this.paint(),this.resizeSeriesControlUI(),this.checkCompactMode(),this.resizeIndicator()}.bind(this),this._resizeHandler(),this._jqMainDiv.appendTo(this._jqParent),this._spinner&&(this._spinner.stop(),delete this._spinner),f("chrome_canvas_fix")&&navigator.userAgent.match(/windows.+chrome/i)&&$(window).on("visibilitychange:chart_"+this._guid,function(t,e){if(e){for(var o=0;o<i._paneWidgets.length;o++)i._paneWidgets[o].hardResetCanvas();i._timeaxiswidget&&i._timeaxiswidget.hardResetCanvas(),i.paint(new A(A.LIGHT_UPDATE))}}),$(window).on("keydown:chart_"+this._guid,function(t){27===t.which&&t.preventDefault()}),this._containsData||this._jqMainDiv.mousewheel(function(t,e,i,o){var n,r,s,a,l;if((TradingView.onWidget()||!parent||parent===window||!parent.IS_DEMO_PAGE)&&this.model()&&!this.noScroll&&!this.model().timeScale().isEmpty())return n=t.pageX-5,r=this._paneWidgets[0].lhsPriceAxisWidget.size.w,s=this._timeAxisWidget.size.w,r&&(n=Math.max(0,n-r)),n=Math.min(n,s),a=_.enabled("right_bar_stays_on_scroll")?1:2*(n/s-.5),l=Math.min(1,Math.abs(o)),o>0?this.model().zoomIn(a,l):o<0&&this.model().zoomOut(a,l),i&&this.model().scrollChart(-80*i),!1}.bind(this)),this._initBarsMarksSources(),this.setAutoScaleOnSymbolChange(),this._activateSymbolSearchHotkeys(),this.model().timeScale().onScroll().subscribe(this,function(){this._onScroll.fire()}),this._inited=!0}.bind(this),e=this._makeDefaultModel(),void 0===e?t():e.then(t)},o.prototype._activateSymbolSearchHotkeys=function(){this.readOnly()||this._hideSymbolSearch||V.activateKeyPressHandler()},o.prototype._checkObsoleteTimezone=function(){var t=this._properties.timezone.value();z(t)||this._properties.timezone.setValue(n(t))},o.prototype._initBarsMarksSources=function(){var t=this;this.withModel(this,function(){this.model().barsMarksSources().forEach(function(e){e.onNeedRepaint.subscribe(t,t.paint)})})},o.prototype.initESDTimelineWidget=function(){new ESDTimelineWidget(this)},o.prototype.applyAutoScaleOnNewSymbol=function(){(!this.model().mainSeries()instanceof p||!this.model().mainSeries().priceScale().isLockScale())&&this.model().mainSeries().priceScale().setAutoScale(!0)},o.prototype.setAutoScaleOnSymbolChange=function(){this.withModel(this,function(){this.model().mainSeries().properties().symbol.listeners().subscribe(this,function(){this.applyAutoScaleOnNewSymbol()})})},o.prototype.initColors=function(){
this._properties.paneProperties.background.listeners().subscribe(this,o.prototype.setBackgroundColor),this._properties.paneProperties.vertGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.paneProperties.horzGridProperties.color.listeners().subscribe(this,o.prototype.redrawPanes),this._properties.scalesProperties.lineColor.listeners().subscribe(this,o.prototype.setScaleLineColor),this._properties.scalesProperties.textColor.listeners().subscribe(this,o.prototype.setScaleTextColor)},o.prototype.paneWidgets=function(){return this._paneWidgets},o.prototype.paneByCanvas=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e].canvas===t||this._paneWidgets[e].top_canvas===t)return this._paneWidgets[e];return null},o.prototype.paneByState=function(t){for(var e=0;e<this._paneWidgets.length;e++)if(this._paneWidgets[e]._state===t)return this._paneWidgets[e];return null},o.prototype.priceAxisByCanvas=function(t){var e,i,o;for(e=0;e<this._paneWidgets.length;e++)if(i=this._paneWidgets[e],o=i.priceAxisByCanvas(t))return o;return null},o.prototype.timeAxisByCanvas=function(t){return t===this._timeAxisWidget.canvas||t===this._timeAxisWidget.top_canvas?this._timeAxisWidget:null},o.prototype.properties=function(){return this._properties},o.prototype.emulateCriticalError=function(){this._chartSession.removeSeries(-1,null)},o.prototype.readOnly=function(){return this._readOnly},o.prototype.onDisconnected=function(){return this._disconnected},o.prototype.onReconnectBailout=function(){return this._reconnectBailout},o.prototype.onConnected=function(){return this._connected},o.prototype.onRedrawPanes=function(){return this._redrawPanes},o.prototype.onScroll=function(){return this._onScroll},o.prototype.modelCreated=function(){return this._modelCreated},o.prototype.setResolution=function(t){if(!this._model)return void this._properties.mainSeriesProperties.merge({interval:t});var e=this._model.mainSeries().properties().interval;this._model.setScreenChartProperty(e,t,this,window.t("Change Resolution"))},o.prototype.getResolution=function(){return this._model?this._model.mainSeries().properties().interval.value():this._properties.mainSeriesProperties.interval.value()},o.prototype._addSymbol=function(t,e){var i=this.model(),o=i.studiesMetaData(),n="study_Overlay@tv-basicstudies",r=_.enabled("use_overrides_for_overlay")&&TradingView.defaultProperties[n]&&TradingView.defaultProperties[n].style,s=r||(i.mainSeries().properties().style.value()===p.STYLE_CANDLES?p.STYLE_BARS:p.STYLE_CANDLES),a={inputs:{symbol:t},style:s},l=o.filter(function(t){return"Overlay@tv-basicstudies"===t.id})[0];i.insertStudy(l,a,e)},o.prototype.addSymbol=function(t,e){var i=Array.prototype.slice.call(arguments);(function(){this._addSymbol.apply(this,i)}).bind(this)()},o.prototype.updateActions=function(){function t(){var t,e,i=studyTemplates.plainList("custom"),o=studyTemplates.plainList("default");l.applyStudyTemplate.subActions||(l.applyStudyTemplate.subActions=[]),t=l.applyStudyTemplate.subActions,
t.splice(0,t.length),e=new T({text:$.t("Save Indicator Template As..."),statName:"Save"}),e.callbacks().subscribe(studyTemplates,studyTemplates.showSaveAsDialog),t.push(e,new C),i.length||o.length?(i.length&&($.each(i,function(e,i){function o(t){return function(){return studyTemplates.deleteStudyTemplate(t),this._parentMenu._parentMenuItem._parentMenu.destroy(),!1}}var n=new T({text:i,statName:"SetStudyTemplate"});n.callbacks().subscribe(studyTemplates,function(){this.applyTemplate(i)}),n.deleteButton={action:o(n.text)},t.push(n)}),o.length&&t.push(new C)),$.each(o,function(e,i){var o=new T({text:i,statName:"SetStudyTemplateFromDefaults"});o.callbacks().subscribe(studyTemplates,function(){this.applyTemplate(i)}),t.push(o)})):t.push(new T({text:window.t("No study templates saved"),enabled:!1}))}var e,i,o,n,r,s,a,l=this.actions(),c=this._model.dataSources(),h=!1,u=!1;for(e=0,i=c.length;e<i;e++)o=c[e],TradingView.isInherited(o.constructor,S)&&o.isUserDeletable()&&(h=!0),TradingView.isInherited(o.constructor,y)&&o.removeByRemoveAllStudies()&&(u=!0),TradingView.isInherited(o.constructor,b)&&(u=!0);this._readOnly||(l.paneRemoveAllStudies&&l.paneRemoveAllStudies.setEnabled(u),l.paneRemoveAllDrawingTools&&l.paneRemoveAllDrawingTools.setEnabled(h),l.paneRemoveAllStudiesDrawingTools&&l.paneRemoveAllStudiesDrawingTools.setEnabled(u||h)),window.studyTemplates&&(t(),studyTemplates.refreshStudyTemplateList(t)),n=this,r=[],s=B,a=function(t){return t.id===n.model().model().properties().timezone.value()},s.forEach(function(t){if(!t.separator){var e=new T({text:t.title,checkable:!0,checked:a(t),statName:"SetTimeZone"});e.callbacks().subscribe(this,function(){n.model().setProperty(n.model().model().properties().timezone,t.id,"Changed Time Zone")}),r.push(e)}},this),l.applyTimeZone.subActions=r,l.addToWatchlist&&(l.addToWatchlist.text=window.t("Add {0} To Watchlist").format(this.getSymbol(!0))),l.addToTextNotes&&(l.addToTextNotes.text=window.t("Add Text Note For {0}").format(this.getSymbol(!0))),this.updateActionForIntradayOnly(l.sessionBreaks)},o.prototype.actions=function(){return this._actions||this._setActions(),this._actions},o.prototype._setActions=function(){var t,e,i,n,r,s,a,l,c,h,u,d,p,g,y,b,S,w,P,L,I,M,O,R,B,z,F,N,W,$,H,j,q,G,Y,K,Z,X,J,Q,tt,et,it,ot,nt,rt,st,at,lt,ct,ht,ut,dt,pt,_t,ft,mt,gt=this,vt=[];if(!this._readOnly){for(vt=[new T({text:window.t("Eraser"),callbackContext:"eraser",statName:"Eraser"}),new C,new T({text:window.t("Trend Line"),callbackContext:"LineToolTrendLine",statName:"LineToolTrendLine"}),new T({text:window.t("Horizontal Line"),callbackContext:"LineToolHorzLine",statName:"LineToolHorzLine"}),new T({text:window.t("Vertical Line"),callbackContext:"LineToolVertLine",statName:"LineToolVertLine"}),new T({text:window.t("Arrow"),callbackContext:"LineToolArrow",statName:"LineToolArrow"}),new T({text:window.t("Ray"),callbackContext:"LineToolRay",statName:"LineToolRay"}),new T({text:window.t("Extended"),callbackContext:"LineToolExtended",statName:"LineToolExtended"}),new T({text:window.t("Parallel Channel"),
callbackContext:"LineToolParallelChannel",statName:"LineToolParallelChannel"}),new C,new T({text:window.t("Pitchfork"),callbackContext:"LineToolPitchfork",statName:"LineToolPitchfork"}),new T({text:window.t("Schiff Pitchfork"),callbackContext:"LineToolSchiffPitchfork",statName:"LineToolSchiffPitchfork"}),new T({text:window.t("Pitchfan"),callbackContext:"LineToolPitchfan",statName:"LineToolPitchfan"}),new T({text:window.t("Gann Square"),callbackContext:"LineToolGannSquare",statName:"LineToolGannSquare"}),new T({text:window.t("Gann Fan"),callbackContext:"LineToolGannFan",statName:"LineToolGannFan"}),new T({text:window.t("Fib Retracement"),callbackContext:"LineToolFibRetracement",statName:"LineToolFibRetracement"}),new T({text:window.t("Trend-Based Fib Extension"),callbackContext:"LineToolTrendBasedFibExtension",statName:"LineToolTrendBasedFibExtension"}),new T({text:window.t("Fib Speed Resistance Fan"),callbackContext:"LineToolFibSpeedResistanceFan",statName:"LineToolFibSpeedResistanceFan"}),new T({text:window.t("Fib Time Zone"),callbackContext:"LineToolFibTimeZone",statName:"LineToolFibTimeZone"}),new T({text:window.t("Circle Lines"),callbackContext:"LineToolCircleLines",statName:"LineToolCircleLines"}),new T({text:window.t("Fib Circles"),callbackContext:"LineToolFibCircles",statName:"LineToolFibCircles"}),new T({text:window.t("Fib Speed Resistance Arcs"),callbackContext:"LineToolFibSpeedResistanceArcs",statName:"LineToolFibSpeedResistanceArcs"}),new C,new T({text:window.t("Rectangle"),callbackContext:"LineToolRectangle",statName:"LineToolRectangle"}),new T({text:window.t("Ellipse"),callbackContext:"LineToolEllipse",statName:"LineToolEllipse"}),new T({text:window.t("Triangle"),callbackContext:"LineToolTriangle",statName:"LineToolTriangle"}),new T({text:window.t("Polyline"),callbackContext:"LineToolPolyline",statName:"LineToolPolyline"}),new T({text:window.t("Arc"),callbackContext:"LineToolArc",statName:"LineToolArc"}),new C,new T({text:window.t("Text"),callbackContext:"LineToolText",statName:"LineToolText"}),new T({text:window.t("Anchored Text"),callbackContext:"LineToolTextAbsolute",statName:"LineToolTextAbsolute"}),new T({text:window.t("Balloon"),callbackContext:"LineToolBalloon",statName:"LineToolBalloon"}),new T({text:window.t("Price Label"),callbackContext:"LineToolPriceLabel",statName:"LineToolPriceLabel"}),new C,new T({text:window.t("Elliott Wave Subminuette"),callbackContext:"LineToolElliottSubminuette",statName:"LineToolElliottSubminuette"}),new T({text:window.t("Elliott Wave Minor"),callbackContext:"LineToolElliottMinor",statName:"LineToolElliottMinor"}),new T({text:window.t("Elliott Wave Circle"),callbackContext:"LineToolElliottCircle",statName:"LineToolElliottCircle"}),new T({text:window.t("Elliott Minor Retracement"),callbackContext:"LineToolElliottMinorRetr",statName:"LineToolElliottMinorRetr"}),new T({text:window.t("Elliott Major Retracement"),callbackContext:"LineToolElliottMajorRetr",statName:"LineToolElliottMajorRetr"}),new C,new T({text:window.t("Brush"),callbackContext:"LineToolBrush",
statName:"LineToolBrush"}),new C,new T({text:window.t("Forecast"),callbackContext:"LineToolPrediction",statName:"LineToolPrediction"})],gt=this,i=function(t){x.tool.setValue(t.callbackContext())},n=0;n<vt.length;n++)vt[n].callbacks().subscribe(null,i);t=new T({text:window.t("Scales Properties..."),statName:"ScalesProperties"}),e=new T({text:window.t("Timezone/Sessions Properties..."),statName:"TimezoneSessionsProperties"})}r=new T({text:window.t("Reset Chart"),shortcut:"Alt+R",statName:"ResetChart"}),r.callbacks().subscribe(this,this.GUIResetScales),s=new T({text:window.t("Undo"),shortcut:"ctrl+z"}),s.callbacks().subscribe(null,function(){U("GUI","Undo"),gt._model.undoHistory.undo()}),s.disable(),a=new T({text:window.t("Redo"),shortcut:"ctrl+y"}),a.callbacks().subscribe(null,function(){U("GUI","Redo"),gt._model.undoHistory.redo()}),a.disable(),gt.withModel(null,function(){gt._model.undoHistory.undoStack().onChange().subscribe(gt,gt.updateUndoRedo),gt._model.undoHistory.redoStack().onChange().subscribe(gt,gt.updateUndoRedo)}),l=new T({text:window.t("Loading")}),c=[l],h=new T({text:window.t("Color Theme"),subActions:c,statName:"ColorTheme"}),u=new T({text:window.t("TimeZone"),statName:"TimeZone"}),d=new T({text:window.t("Change Symbol..."),shortcut:window.t("Any Symbol"),doNotBindShortcut:!0,statName:"ChangeSymbol"}),TVSettings.setValue("symboledit.dialog_last_entry",""),d.callbacks().subscribe(this,function(){V.showDialog({callback:this.setSymbol.bind(this)})}),p=new T({text:window.t("Change Interval..."),shortcut:window.t("Any Number"),doNotBindShortcut:!0,statName:"ChangeInterval"}),p.callbacks().subscribe(this,function(){new D({callback:function(t){E.interval.setValue(t)}}).show()}),TradingView.onWidget()||(_.enabled("add_to_watchlist")&&(g=new T({text:window.t("Add To Watchlist"),shortcut:"Alt+W",statName:"AddToWatchlist"}),g.callbacks().subscribe(this,function(){var t,e,i=widgetbar.setPage("base");for(e=0;e<i.widgets.length;e++)if("watchlist"===i.widgets[e].type){t=i.widgets[e].widgetObject;break}t&&t.addHighlight(this.getSymbol())})),f("text_notes")&&(y=new T({text:window.t("Add To Text Notes"),shortcut:"Alt+N",statName:"AddToTextNotes"}),y.callbacks().subscribe(this,function(){var t=this;runOrSignIn(function(){TradingView.bottomWidgetBar.toggleWidget("text_notes",!0),TradingView.bottomWidgetBar._widgets.text_notes.addNote(null,t.getSymbol(!0),t.getSymbol())},{source:"Add text note in chart context menu"})}))),b=new T({text:window.t("Insert Study Template"),statName:"InserStudyTemplate"}),S=new T({shortcut:"Ctrl+Alt+Q",text:window.t("Reset Scale"),statName:"ResetScale"}),S.callbacks().subscribe(null,function(t){gt.model().resetTimeScale()}),w=new T({text:window.t("Insert Drawing Tool"),subActions:vt,statName:"InsertDravingTool"}),P=new T({text:window.t("Remove All Indicators"),statName:"RemoveAllIndicators"}),L=new T({text:window.t("Remove All Drawing Tools"),statName:"RemoveAllDrawingTools"}),I=new T({text:window.t("All Indicators And Drawing Tools"),statName:"RemoveAllIndicatorsAndDrawingTools"}),M=new T({
text:window.t("Insert Indicator..."),shortcut:"/",statName:"InsertIndicator"}),O=new T({text:window.t("Script Editor..."),statName:"ScriptEditor"}),R=new T({text:window.t("Compare or Add Symbol..."),statName:"CompareOrAddSymbol"}),B=new T({text:window.t("Compare..."),statName:"Compare"}),z=new T({text:window.t("Objects Tree..."),statName:"ObjectsTree"}),F=new T({text:window.t("Properties..."),statName:"ChartProperties",callback:function(t,e){gt.showChartProperties()}}),N=new T({text:window.t("Lock/Unlock"),statName:"ToggleLockSelectedObject"}),N.callbacks().subscribe(this,o.prototype.toggleLockSelectedObject),W=new T({text:window.t("Hide"),statName:"HideSelectedObject"}),W.callbacks().subscribe(this,o.prototype.hideSelectedObject),_.enabled("property_pages")&&($=new T({text:window.t("Format..."),statName:"EditSelectedObject"}),$.callbacks().subscribe(this,o.prototype.editSelectedObject)),H=new T({text:window.t("Source Code..."),statName:"OpenSelectedObjectSource"}),H.callbacks().subscribe(this,this.openSelectedObjectSource),j=new T({text:window.t("Left Axis"),checkable:!0,statName:"ToggleLeftAxis"}),j.binder=new m(j,this._properties.scalesProperties.showLeftScale,this.model(),window.t("Show Left Scale")),q=new T({text:window.t("Right Axis"),checkable:!0,statName:"ToggleRightAxis"}),q.binder=new m(q,this._properties.scalesProperties.showRightScale,this.model(),window.t("Show Right Scale")),this._properties.scalesProperties.showLeftScale.listeners().subscribe(this,o.prototype._updateScalesActions),this._properties.scalesProperties.showRightScale.listeners().subscribe(this,o.prototype._updateScalesActions),G=new T({text:window.t("Scale Price Chart Only"),checkable:!0,statName:"ScalePriceChartOnly"}),G.binder=new m(G,this._properties.scalesProperties.scaleSeriesOnly,this.model(),window.t("Scale Price Chart Only")),Y=this.model().model(),this._properties.scalesProperties.scaleSeriesOnly.listeners().subscribe(null,function(){Y.recalculateAllPanes(),Y.invalidate(new A(A.FULL_UPDATE))}),K=new T({text:window.t("Drawings Toolbar"),checkable:!0,statName:"ToggleDrawingToolbar"}),Z=this._options.isDrawingToolbarVisible,Z&&(Z.subscribe(function(t){K.setChecked(t)},{callWithLast:!0}),K.callbacks().subscribe(null,function(){Z.setValue(!Z.value())})),X=new T({text:window.t("Favorite Drawings Toolbar"),checkable:!0,statName:"ToggleFavoriteDrawingsToolbar"}),J=this._options.favoriteDrawingToolbar,J&&(J.canBeShown().subscribe(function(t){X.setEnabled(t)},{callWithLast:!0}),J.visibility().subscribe(function(t){X.setChecked(t)},{callWithLast:!0}),X.callbacks().subscribe(null,function(){J.isVisible()?J.hide():J.show()})),Q=new T({text:window.t("Magnet Mode"),checkable:!0,statName:"ToggleMagnetMode"}),Q.binder=new m(Q,x.properties().magnet,this.model(),"Magnet"),tt=new T({text:window.t("Stay In Drawing Mode"),checkable:!0,statName:"ToggleStayInDrawingMode"}),tt.binder=new m(tt,x.properties().stayInDrawingMode,this.model(),window.t("Stay In Drawing Mode")),et=new T({text:window.t("Sync drawings to all charts"),checkable:!0,
statName:"ToggleSyncDrawings"}),et.binder=new m(et,x.properties().drawOnAllCharts,this.model(),"SyncDrawings"),it=new T({text:window.t("Lock All Drawing Tools"),checkable:!0,statName:"ToggleLockDrawings"}),it.binder=new m(it,x.lockDrawings(),this.model(),window.t("Lock drawings"),function(t){t||this.binder.setValue(!this.binder.value()),x.lockDrawings().setValue(this.binder.value())}.bind(it)),ot=new T({text:window.t("Hide All Drawing Tools"),checkable:!0,statName:"ToggleHideAllDrawingTools"}),ot.binder=new m(ot,x.hideAllDrawings(),this.model(),window.t("Hide All Drawing Tools"),function(t){t||this.binder.setValue(!this.binder.value()),x.hideAllDrawings().setValue(this.binder.value())}.bind(ot)),nt=new T({text:window.t("Hide Marks On Bars"),checkable:!0,statName:"ToggleHideMarksOnBars"}),nt.binder=new m(nt,x.hideMarksOnBars(),this.model(),window.t("Hide Marks On Bars"),function(t){t||this.binder.setValue(!this.binder.value()),x.hideMarksOnBars().setValue(this.binder.value())}.bind(nt)),rt=new T({text:window.t("Extended Hours"),checkable:!0,statName:"ToggleExtendedHours"}),rt.binder=new m(rt,this.model().mainSeries().properties().extendedHours,this.model(),window.t("Change Extended Hours")),st=new T({text:window.t("Symbol Last Value"),checkable:!0,checked:!1,statName:"ToggleSymbolLastValue"}),st.binder=new m(st,this.properties().scalesProperties.showSeriesLastValue,this.model(),window.t("Show Symbol Last Value")),at=new T({text:window.t("Symbol Labels"),checkable:!0,checked:!1,statName:"ToggleSymbolLabels"}),at.binding=new m(at,this.properties().scalesProperties.showSymbolLabels,this.model(),"Undo Show Symbol Labels"),lt=new T({text:window.t("Indicator Last Value"),checkable:!0,checked:!1,statName:"ToggleStudyLastValue"}),lt.binder=new m(lt,this.properties().scalesProperties.showStudyLastValue,this.model(),window.t("Show Indicator Last Value")),ct=new T({text:window.t("Indicator Labels"),checkable:!0,checked:!1,statName:"ToggleIndicatorsLabels"}),ct.binding=new m(ct,this.properties().scalesProperties.showStudyPlotLabels,this.model(),"Undo Show Indicator Labels"),ht=new T({text:window.t("Countdown"),checkable:!0,checked:!1,statName:"ToggleCountdown"}),ht.binder=new m(ht,this.model().mainSeries().properties().showCountdown,this.model(),window.t("Show Countdown")),dt=_.enabled("go_to_date"),!TradingView.onWidget()&&dt&&(ut=new T({text:window.t("Go to Date..."),shortcut:"Alt+G",statName:"GoToDate"}),ut.callbacks().subscribe(null,function(){var t=gt._chartWidgetCollection.activeChartWidget.value();v(t.model())})),pt=new T({text:window.t("Symbol Info..."),checkable:!1,statName:"SymbolInfo"}),pt.callbacks().subscribe(null,function(){var t=gt.model().mainSeries().symbol(),e=gt.model().mainSeries().symbolInfo();k(t,{symbolInfo:e})}),this._actions={chartProperties:F,timeScaleReset:S,chartReset:r,compareOrAdd:R,compare:B,paneObjectTree:z,insertIndicator:M,insertDrawingTool:w,applyColorTheme:h,applyStudyTemplate:b,symbolSearch:d,showSymbolInfoDialog:pt,changeInterval:p,seriesHide:W,studyHide:W,lineToggleLock:N,lineHide:W,
showLeftAxis:j,showRightAxis:q,scaleSeriesOnly:G,drawingToolbarAction:K,favoriteDrawingToolbar:X,magnetAction:Q,stayInDrawingModeAction:tt,syncModeAction:et,lockDrawingsAction:it,hideAllDrawingsAction:ot,hideAllMarks:nt,applyTimeZone:u,extendedHours:rt,showCountdown:ht,showSeriesLastValue:st,showSymbolLabelsAction:at,showStudyLastValue:lt,showStudyPlotNamesAction:ct,undo:s,redo:a,viewSourceCode:H},t&&(this._actions.scalesProperties=t),e&&(this._actions.tmzProperties=e),g&&(this._actions.addToWatchlist=g),!TradingView.onWidget()&&_.enabled("text_notes")&&f("text_notes")&&(this._actions.addToTextNotes=y),!TradingView.onWidget()&&dt&&(this._actions.gotoDate=ut),_.enabled("charting_library_base")||(this._actions.scriptEditor=O),this.createSessionBreaksActions(),this.readOnly()||(_t=new T({text:window.t("Remove"),shortcut:"Del",statName:"RemoveSelectedObject"}),_t.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.removeSelectedSource()}),ft=new T({text:window.t("Stop syncing drawing"),statName:"StopSyncingDrawing"}),ft.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.unlinkSelectedLine()}),mt=new T({text:window.t("Sync drawing to all charts"),statName:"SyncDrawingToAllCharts"}),mt.callbacks().subscribe(this,function(){var t;this._chartWidgetCollection&&(t=this._chartWidgetCollection.activeChartWidget.value()),t||(t=this),t.copyLineToOtherCharts()}),this._actions.insertDrawingTool=w,this._actions.paneRemoveAllStudies=P,this._actions.paneRemoveAllDrawingTools=L,this._actions.paneRemoveAllStudiesDrawingTools=I,this._actions.seriesRemove=_t,this._actions.studyRemove=_t,this._actions.lineRemove=_t,this._actions.lineUnlink=ft,this._actions.lineCopyToCharts=mt,_.enabled("property_pages")&&(this._actions.format=$),this._actions.lockDrawingsAction=it,this._actions.hideAllDrawingsAction=ot,this._actions.hideAllMarks=nt,this._actions.paneRemoveAllStudies.callbacks().subscribe(this,o.prototype.removeAllStudies),this._actions.paneRemoveAllDrawingTools.callbacks().subscribe(this,o.prototype.removeAllDrawingTools),this._actions.paneRemoveAllStudiesDrawingTools.callbacks().subscribe(this,o.prototype.removeAllStudiesDrawingTools)),this._actions.paneObjectTree.callbacks().subscribe(this,o.prototype.showSourceProperties),this._actions.chartProperties.callbacks().subscribe(this,o.prototype.showChartProperties),this._actions.insertIndicator.callbacks().subscribe(this,o.prototype.showIndicators),this._actions.scriptEditor&&this._actions.scriptEditor.callbacks().subscribe(this,o.prototype.showScriptEditor),this._actions.compareOrAdd.callbacks().subscribe(this,o.prototype.showCompareOrAdd),this._actions.compare.callbacks().subscribe(this,o.prototype.showCompareOrAdd),this._actions.scalesProperties&&this._actions.scalesProperties.callbacks().subscribe(this,o.prototype.showScalesProperties),
this._actions.tmzProperties&&this._actions.tmzProperties.callbacks().subscribe(this,o.prototype.showTimezoneProperties),this._updateScalesActions()},o.prototype.executeActionById=function(t){if("takeScreenshot"===t)return console.warn('Action "takeScreenshot" is deprecated. Use method "takeScreenshot" instead'),void this._chartWidgetCollection.takeScreenshot();if("lockDrawingsAction"===t&&console.warn('Action "lockDrawingsAction" is deprecated. Use method "lockAllDrawingTools" instead'),t in this._actions){var e=this._actions[t];e.checkable&&e.setChecked(!e.checked),this._actions[t].callbacks().fire(e)}else console.warn("Unknown action id: "+t)},o.prototype.getCheckableActionState=function(t){if("lockDrawingsAction"===t)return console.warn('Action "lockDrawingsAction" is deprecated. Use method "lockAllDrawingTools" instead'),null;if(t in this._actions){var e=this._actions[t];if(e.checkable)return e.checked;console.warn("Action "+t+" has no state")}else console.warn("Unknown action id: "+t);return null},o.prototype._updateScalesActions=function(){if(this._actions){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].updateScalesVisibility();this._timeAxisWidget.updatePriceScalesVisibility()}},o.prototype.removeAllStudies=function(){this._model.removeAllStudies()},o.prototype.removeAllDrawingTools=function(){this._model.removeAllDrawingTools()},o.prototype.removeAllStudiesDrawingTools=function(){this._model.removeAllStudies(),this._model.removeAllDrawingTools()},o.prototype.model=function(){return this._model},o.prototype.defaultSymbol=function(){return this._defSymbol},o.prototype.connect=function(){this._handler=function(t){this._onData(t)}.bind(this),this._boundOnChartSessionIsConnectedChanged=this._onChartSessionIsConnectedChanged.bind(this),this._chartSession.isConnected().subscribe(this._boundOnChartSessionIsConnectedChanged),this._chartSession.criticalError().subscribe(this,this._onChartSessionCriticalError),this._chartSession.connect(this._handler)},o.prototype.finishInitWithoutConnect=function(){this._chartSession.disable(),this._init(),this.chartWidgetInitialized.fire()},o.prototype.reconnect=function(){this._chartSession.disconnect(),this._chartSession.connect()},o.prototype.update=function(){if(this._model){for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].update();this._timeAxisWidget.update()}},o.prototype.paint=function(t){t||(t=new A(A.FULL_UPDATE));for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint(t.invalidateForPane(e),!1);this._timeAxisWidget&&this._timeAxisWidget.paint(t.fullInvalidation()),this._redrawPanes.fire()},o.prototype._makeDefaultGui=function(){this._makeChartWidget(),this._makeLoadingScreen(),this._makeMasterTable(),this._makeTimeAxisWidget(),this._adjustSize(),this._updateScalesActions(),$("*",this._jqMainTable).selectable(!1),this.update(),this.paint()},o.prototype.widget=function(){return this._jqMainDiv},o.prototype.restoreState=function(t,e){this._adjustSize(),this._model.restoreState(this._content,e),this._setActions()},
o.prototype.redrawPanes=function(t){for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint();this._redrawPanes.fire()},o.prototype.setBackgroundColor=function(t){this.scaleBackgroundColor=t.value();for(var e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].paint(),this._paneWidgets[e].setCursorForTool();this.update(),this.paint()},o.prototype.setScaleLineColor=function(t){this.scaleLineColor=t.value(),$.each(this._paneSeparators,function(){this.update()}),this.update(),this.paint()},o.prototype.setScaleTextColor=function(t){this.scaleTextColor=t.value(),this.update(),this.paint()},o.prototype.setTimingsMeter=function(t){this._timingsMeter=t,this._updateTimingsMeterState()},o.prototype._updateTimingsMeterState=function(){var t=this._options.visible.value();null!==this._timingsMeter&&(t?this._timingsMeter.startCollect():this._timingsMeter.stopCollect())},o.prototype._update=function(t){var e,i=t?t.fullInvalidation():A.FULL_UPDATE;if(null!==this._timingsMeter&&this._timingsMeter.startDraw(i),i===A.FULL_UPDATE){for(this._model?this._updateGui():this._adjustSize(),this._timeAxisWidget.update(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e]._state=this._model.panes()[e],this._paneWidgets[e].statusWidget().updateLayout();this._dataWindowWidget&&this._dataWindowWidget.fullUpdate()}else if(i===A.LIGHT_UPDATE){for(this._timeAxisWidget.update(),e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}else if(i===A.UPDATE_CURSOR_ONLY){for(e=0;e<this._paneWidgets.length;e++)this._paneWidgets[e].statusWidget().update();this._dataWindowWidget&&this._dataWindowWidget.update()}this.paint(t),null!==this._timingsMeter&&this._timingsMeter.stopDraw()},o.prototype._createVolumeIfNeeded=function(){var t=_.enabled("create_volume_indicator_by_default")&&this._options.addVolume,e=!this._content,i=_.enabled("charting_library_base"),o=_.enabled("create_volume_indicator_by_default_once"),n=this._content&&!this._content.loading;t&&(e||i&&n&&!o)&&this._model.mainSeries().onSymbolResolved().subscribe(this,function(){var t=this;setTimeout(function(){var e,i,o,n,r=t._model.model().mainSeries().symbolInfo();r&&(e=!r.has_no_volume,!t.containsVolume()&&e?(i=TradingView.factoryDefaults("chartproperties.volumePaneSize"),o={paneSize:i},_.enabled("hide_volume_ma")&&(o.styles={vol_ma:{visible:!1}}),t.insertStudy("Volume@tv-basicstudies",!1,_.enabled("volume_force_overlay"),void 0,o)):!e&&t.containsVolume()&&(n=t.model().dataSources().filter(function(t){return t instanceof y&&"Volume"===t.metaInfo().shortId})[0],t._model.model().removeSource(n)))},0)},o)},o.prototype._restartModel=function(){(function(){this._model.restart()}).bind(this)()},o.prototype._makeDefaultModel=function(){function t(){return c(l._chartSession,function(t){if(!(t instanceof A))throw Error("Invalid mask");l._invalidateMask?l._invalidateMask.merge(t):l._invalidateMask=t,l._draw_planned||(l._draw_planned=!0,l._options.visible.when(function(){
var t=!document.hidden,i=l.screen&&l.screen.isShown();null!==l._timingsMeter&&t&&!i&&l._timingsMeter.startWaitingDraw(),l._drawRafId=requestAnimationFrame(e)}))},l._properties,l.readOnly(),n,l._studiesMetaData,l._studiesMigrations,l,l._options.undoHistory,l._options.barsMarksContainersFactory)}function e(){l._draw_planned=!1,l._drawRafId=0,l._inLoadingState||l._invalidateMask&&(l._invalidateMask=l._update(l._invalidateMask))}var i,n,r,s,a,l=this;if(this._content&&this._content.timeScale.points&&(i=this._content.timeScale.points.items[0],n={startDate:i}),!this._studiesMetaData)throw Error("Cannot create chart model: studies metainfo is absent");if(_.enabled("lean_chart_load")?this._model=this._model||t():this._model=t(),this._createVolumeIfNeeded(),r=function(){var t,e;this._model.onTagsChanged().subscribe(this,o.prototype.onModelTagsChanged),this._updateGui(),this._modelCreated.fire(this._model),this._tagsChanged.fire(),t=this._model.mainSeries(),this._defTimeframe&&t.setDefaultTimeframe(this._defTimeframe),this._model.lineCancelled().subscribe(this,this.onLineCancelled),t.onSymbolNotPermitted().subscribe(null,function(e){t.properties().symbol.setValue(e)}),t.properties().style.unsubscribe(this,this._onChartStyleChanged),t.properties().style.subscribe(this,this._onChartStyleChanged),e=this._options,e.handleSessionErrors&&(t.chartTypeNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),t.intradaySpreadNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),t.customIntervalNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),t.intradayExchangeNotPermitted.subscribe(null,function(){t.properties().interval.setValue("D")}),l._options.muteSessionErrors||t.onExtendedHoursNotPermitted().subscribe(null,function(){})),this._options.handleSessionErrors&&(t.requestingIntradayWhenNotSupported.subscribe(null,function(){t.properties().interval.setValue("D"),l._options.muteSessionErrors||TVDialogs.showIntervalMismatchDialog()}),t.requestingResolutionWhenNotSupported.subscribe(null,function(e){t.properties().interval.setValue(e)}))}.bind(this),this._content){if(this.restoreState(this._content,this._containsData),_.enabled("chart_content_overrides_by_defaults"))return this._defSymbol&&(s=this.setSymbol(this._defSymbol),this.applyAutoScaleOnNewSymbol()),a=function(){return this._defInterval&&this.setResolution(this._defInterval),void 0!==this._defStyle&&this.setSeriesStyle(this._model.mainSeries(),this._defStyle),r()}.bind(this),void 0===s?a():s.then(a)}else this._setActions();return r()},o.prototype._onChartStyleChanged=function(){U("Chart","Chart Style "+this._model.mainSeries().getStyleShortName().toUpperCase())},o.prototype._updateGui=function(){this._model&&(this._makePaneWidgetsAndSeparators(),this._makeTimeAxisWidget(),$("*",this._jqMainTable).selectable(!1),this._adjustSize())},o.prototype.setVisibleTimeRange=function(t,e,i){this._chartSession.setVisibleTimeRange(this._model.mainSeries(),t,e,i)},o.prototype._dateRangeResolutions=function(){
return ChartApiInstance.availableTimeFrames(this._model.mainSeries().symbolInfo(),this._model.mainSeries().status())||[]},o.prototype._makeChartWidget=function(){this._jqMainDiv=$(document.createElement("div")),this._jqMainDiv.addClass("chart-widget"),this._tooltipDiv=$(document.createElement("div")).appendTo(this._jqMainDiv),this._tooltipDiv.addClass("tooltip-wrapper"),this._withDateRanges&&(!_.enabled("lean_chart_load")||!this._chartControlsBar)&&(this._chartControlsBar=$(document.createElement("div")).attr("class","chart-controls-bar").appendTo(this._jqParent),this._seriesControlWidget=new I({parent:this._chartControlsBar,chartWidget:this})),(this._options.controlBar||_.enabled("control_bar"))&&(this._controlBarNavigation=new L(this,this._jqMainDiv,!0)),this._containsData||this.createIndicatorImage()},o.prototype._makeLoadingScreen=function(){if(_.enabled("lean_chart_load")){if(this.screen)return;this.screen=new o.LoadingScreen(this,this._jqParent)}else this.screen=new o.LoadingScreen(this,this._jqMainDiv)},o.prototype._setSymbol=function(t,e){if(this._model){var i=this._model.mainSeries();if(!e&&i.symbolSameAsCurrent(t)&&!_.enabled("same_data_requery"))return;this._model.setSelectedSource(null),this._model.setScreenChartProperty(i.properties().symbol,t,this,"Change Symbol",_.enabled("same_data_requery"))}else this._properties.mainSeriesProperties.merge({symbol:t})},o.prototype.setSymbol=function(t,e){return this._setSymbol.apply(this,arguments)},o.prototype.getSymbol=function(t){var e;return e=this._model?this._model.mainSeries().properties():this._properties.mainSeriesProperties,e?t&&e.shortName&&e.shortName.value()?e.shortName.value():e.symbol.value():""},o.LoadingScreen=function(t,e){this._cw=t,this.$element=$('<div class="chart-loading-screen">'),this.$shield=$('<div class="chart-loading-screen-shield">').appendTo(this.$element),this.$element.appendTo(e),this._showed=!1,this._cw.withModel(this,this._connectToModel)},o.LoadingScreen.prototype._connectToModel=function(){this._cw.model().mainSeries().onDataLoaded().subscribe(this,function(t){switch(t.method){case"symbol_error":t.params[1]!==p.PERMISSION_DENIED&&this.hide();break;case"series_error":_.enabled("hide_loading_screen_on_series_error")&&this.hide();break;case"series_completed":this.hide()}})},o.LoadingScreen.prototype.show=function(){return this._cw._inLoadingState=!0,this._showed||(this._showed=!0,this._show()),$.Deferred().resolve()},o.LoadingScreen.prototype._show=function(){var t=this._cw.properties().paneProperties.background.value();this.$shield.css("background",t),this.$element.addClass("fade")},o.LoadingScreen.prototype.hide=function(){delete this._cw._inLoadingState,this._showed&&this._hide()},o.LoadingScreen.prototype._hide=function(){this._showed=!1,this.$element.removeClass("fade")},o.LoadingScreen.prototype.$canvas=null,o.LoadingScreen.prototype.context=null,o.LoadingScreen.prototype.isShown=function(){return this._showed},o.prototype._makeMasterTable=function(){this._jqMainTable=$(document.createElement("table")),
this._jqMainTable.appendTo(this._jqMainDiv),this._jqMainTable.addClass("chart-markup-table"),this._jqMainTable.attr("cellpading","0"),this._jqMainTable.attr("cellspacing","0")},o.prototype.unsetActivePaneWidget=function(){this.activePaneWidget=!1},o.prototype.setActivePaneWidget=function(t){this.activePaneWidget=t},o.prototype.isMaximizedPane=function(){return!!this._maximizedPaneWidget},o.prototype.toggleMaximizePane=function(t){if(!(this._paneWidgets.length<2)){this._maximizedPaneWidget?(this._maximizedPaneWidget.state().setMaximized(!1),this._maximizedPaneWidget=null,this._paneSeparators.forEach(function(t){t.show()})):(this._maximizedPaneWidget=t,this._maximizedPaneWidget.state().setMaximized(!0),this._paneSeparators.forEach(function(t){t.hide()}));for(var e=this._paneWidgets.length;e--;)this._paneWidgets[e].updateControls();this._adjustSize(),this.updateIndicatorImagePosition()}},o.prototype._makePaneWidgetsAndSeparators=function(){var t,e,i,o,n=this._model.panes(),r=n.length,s=this._paneWidgets.length;for(t=r;t<s;t++)e=this._paneWidgets.pop(),e.jqRow.remove(),e.jqRow.find("*").remove(),e.destroy(),(i=this._paneSeparators.pop())&&i.jqRow.remove();for(t=s;t<r;t++)e=new a(this,n[t],this._onWidget,this._options.verticalTouchScroll),e.onMouseLeave=this.unsetActivePaneWidget.bind(this),e.onMouseEnter=this.setActivePaneWidget.bind(this),this._paneWidgets.push(e),t>0&&(i=new l(this,t-1,t),this._paneSeparators.push(i),this._timeAxisWidget?i.jqRow.insertBefore(this._timeAxisWidget.jqRow):i.jqRow.appendTo(this._jqMainTable)),this._timeAxisWidget?e.jqRow.insertBefore(this._timeAxisWidget.jqRow):e.jqRow.appendTo(this._jqMainTable);for(t=0;t<r;t++)o=n[t],e=this._paneWidgets[t],e.state()!==o&&e.setState(o);for(t=r;t--;)this._paneWidgets[t].updateControls()},o.prototype._makeTimeAxisWidget=function(){this._timeAxisWidget||(this._timeAxisWidget=new u(this,this._onWidget),this._timeAxisWidget.jqRow.appendTo(this._jqMainTable))},o.prototype.insertStudyOrShowDialog=function(t,e){var i,o,n,r,s,a,l,c;this.isSymbolicStudy(t)?(i=defaults("study_"+t.id).description,o=$('<input type="text" class="symbol-edit single" placeholder="'+window.t("Symbol")+'" maxlength="30" style="text-transform: none; font-weight: normal;" autocomplete="off">'),o.css({float:"none","box-sizing":"border-box",width:"100%"}),n=null,r=F({title:i||window.t("Add Symbol"),width:400,actions:[{name:"apply",text:window.t("Apply"),type:"primary"}],content:o,isClickOutFn:function(t){if(n&&(t.target===n[0]||n[0].contains(t.target)))return!1}}),s=function(i){var o={inputs:{}};o.inputs[t.symbolInputId()]=i,this.model().insertStudy(t,o,!1,e),r.close()},a=V.bindToInput(o,{callback:s.bind(this),onPopupOpen:function(t){t.css("z-index",r.zIndex),n=t},onPopupClose:function(){n=null}}),r.on("action:apply",function(){a.acceptTypeIn()}),r.open()):this.hasConfirmInputs(t)?(i=defaults("study_"+t.id).description,G.show(this,t,{title:i,callback:function(i){this.model().insertStudy(t,i,!1,e)}.bind(this)})):y.isPointsBasedStudy(t.id)?(l=y.lineToolNameForPointsBasedStudy(t.id),
x.tool.setValue(l)):(c="Volume@tv-basicstudies"===t.id,this.insertStudy(t.id,!0,c,null,null,e))},o.prototype.hasConfirmInputs=function(t){var e,i,o=t.inputs;if(void 0===o)return!1;for(e=0;e<o.length;++e)if(i=o[e],void 0!==i.confirm&&i.confirm)return!0;return!1},o.prototype.isSymbolicStudy=function(t){switch(t.id){case"Overlay@tv-basicstudies":case"CorrelationCoefficient@tv-basicstudies":case"Correlation Coeff@tv-basicstudies":return!0;default:return!1}},o.prototype.isPointsBasedStudy=function(t){return y.isPointsBasedStudy(t.id)},o.prototype.insertStudy=function(t,e,i,o,n,r){var a,l=W.findStudyMetaInfo(this._studiesMetaData,t);l=TradingView.clone(l),s(!l.isTVScriptStubToCompile,"MetaInfo stub is unexpected here!"),a=o?{inputs:o}:{},n&&(a=$.extend(a,n)),e?this._model.insertStudy(l,a,i,r):this._model.model().insertStudy(l,a,i,r)},o.prototype.insertStudyStub=function(t){return this.model().insertStudyStub(t)},o.prototype.removeStudyStub=function(t){return this.model().removeStudyStub(t)},o.prototype._adjustSize=function(){var t,e,i,o,n,r,s,a,c=this,u=0,d=0,p=0;$.each(this._paneWidgets,function(){c._maximizedPaneWidget&&c._maximizedPaneWidget!==this||(u=Math.max(this.lhsPriceAxisWidget.optimalWidth(),u),d=Math.max(this.rhsPriceAxisWidget.optimalWidth(),d),p+=this.stretchFactor())}),t=this._width.value(),e=this._height.value(),this._chartControlsBar&&(e=Math.max(e-this.controlBarHeight,0)),i=t-u-d,o=this._paneSeparators.length,n=l.HEIGHT,r=this._timeAxisWidget.optimalHeight(),s=e-n*o-r,a=s/p,this._jqMainTable.width(t),this._jqMainTable.height(e),this._jqMainDiv.width(t),this._jqMainDiv.height(e),$.each(this._paneWidgets,function(t){c._model&&(this._state=c._model.panes()[t]);var e=c._maximizedPaneWidget?c._maximizedPaneWidget===this?s:0:Math.max(Math.round(this.stretchFactor()*a),2);this.setPriceAxisSize(h.LHS,new q(u,e)),this.setPriceAxisSize(h.RHS,new q(d,e)),this.setSize(new q(i,e)),c._model&&this.state()&&c._model.setPaneHeight(this.state(),e)}),this._timeAxisWidget.setSize(new q(i,r),new q(u,r),new q(d,r)),this._model&&this._model.setWidth(i),this.maxLhsPriceAxisWidth!==u&&(this.maxLhsPriceAxisWidth=u,this.lhsPriceAxisWidthChanged.fire(u)),this.maxRhsPriceAxisWidth!==d&&(this.maxRhsPriceAxisWidth=d,this.rhsPriceAxisWidthChanged.fire(d))},o.prototype._onChartSessionIsConnectedChanged=function(t){t?this._onConnection():this._onDisconnect()},o.prototype._onChartSessionCriticalError=function(t,e){this._disconnected.fire(!0)},o.prototype._onData=function(t){switch(t.method){case"reconnect_bailout":this._reconnectBailout.fire();break;default:this._model.onData(t)}},o.prototype._nextMetadataId=1,o.prototype._onConnection=function(){this._online=!0,this._model?(this._restartModel(),this._updateGui(),this.update(),this.paint(),this._connected.fire()):this.requestMetadata()},o.prototype._onDisconnect=function(){this._model&&this._model.disconnect(),this._online=!1,this.update(),this.paint(),this._disconnected.fire()},o.prototype._applyStudiesOverrides=function(){W.overrideDefaults(this._studiesMetaData)},
o.prototype.requestMetadata=function(){_.enabled("charting_library_base")&&this._chartSession.requestMetadata("metadata_"+o._nextMetadataId,function(t){var e,i=t.params[1];for(e=0;e<i.length;++e)W.addOrReplaceStudyMetaInfo(this._studiesMetaData,r(i[e]));this._studiesMetaData=this._studiesMetaData.sort(function(t,e){var i=t.description_localized||t.description,o=e.description_localized||e.description;return i>o?1:i<o?-1:0}),this._applyStudiesOverrides(),this._inited||(this._init(),this.chartWidgetInitialized.fire())}.bind(this)),o._nextMetadataId++},o.prototype.studiesMetaData=function(){return this._model.studiesMetaData()},o.prototype.getTimeScale=function(){return this._timeAxisWidget},o.prototype.setSeriesStyle=function(t,e){this._model.setProperty(t.properties().style,e)},o.prototype.showSourceProperties=function(t){var e=this;i.e(6).then(function(t){new(0,i(1192).ObjectTreeDialog)({chartWidget:e},e._model).show()}.bind(null,i)).catch(i.oe)},o.prototype.showChartProperties=function(t){if(!_.enabled("show_chart_property_page"))return Promise.resolve();t&&t.text===window.t("Properties...")&&TVSettings.setValue("properties_dialog.active_tab.chart",window.t("Style"));var e=this;return new Promise(function(t){g(e._model.mainSeries(),e._model,{doNotCloseOnBgClick:!0}).then(function(e){t(e.isVisible()?e._dialog:null)})})},o.prototype.showScriptEditor=function(){TradingView.bottomWidgetBar&&TradingView.bottomWidgetBar.activateScriptEditorTab()},o.prototype.showCompareOrAdd=function(){new M(this._chartWidgetCollection).show()},o.prototype.showIndicators=function(t){if(window.studyMarket)return window.studyMarket.isVisible()?void window.studyMarket.hide():(window.studyMarket.show(t),window.studyMarket)},o.prototype.showScalesProperties=function(t){g(this._model.mainSeries(),this._model,{selectScales:!0})},o.prototype.showTimezoneProperties=function(){g(this._model.mainSeries(),this._model,{selectTmz:!0})},o.prototype.removeSelectedSource=function(){var t,e=this,i=e._model.selectedSource();!i||i===e._model.mainSeries()||i===e._model.lineBeingCreated()||i instanceof d||(i.hasAlert.value()&&i.isUserDeletable()?(t=Y({type:"modal",content:window.t("This drawing is used in alert. If you remove the drawing, the alert will be also removed. Do you want to remove the drawing anyway?")}),t.on("action:yes",function(t){e._model.removeSelectedSource(),t.close()}),t.open()):i instanceof y&&i.hasChildren()?showDeleteStudyTreeConfirm(e._model.removeSelectedSource.bind(e._model)).open():e._model.removeSelectedSource())},o.prototype.unlinkSelectedLine=function(){var t=this._model.selectedSource();t instanceof S&&this._model.unlinkLine(t)},o.prototype.copyLineToOtherCharts=function(){var t=this._model.selectedSource();t instanceof S&&this._model.copyToOtherCharts(t)},o.prototype.hideSelectedObject=function(){var t=this._model.selectedSource();t&&this._model.setProperty(t.properties().visible,!1,"Hide "+t.title())},o.prototype.toggleLockSelectedObject=function(){var t,e=this._model.selectedSource();e&&(t=e.properties().frozen.value(),
this._model.setProperty(e.properties().frozen,!t,(t?window.t("Unlock"):window.t("Lock"))+" "+e.title()))},o.prototype.editSelectedObject=function(t){var e=this._model.selectedSource();e&&g(e,this._model)},o.prototype.openSelectedObjectSource=function(t){},o.prototype.resetPriceAxisOptimalWidth=function(t){$.each(this._paneWidgets,function(){this.resetPriceAxisOptimalWidth(t)}),this._redrawPanes.fire()},o.prototype.adjustPriceAxisWidth=function(t){this.resetPriceAxisOptimalWidth(t),this._adjustSize()},o.prototype.setPriceAxisVisible=function(t,e){$.each(this._paneWidgets,function(){this.setPriceAxisVisible(t,e)}),this._timeAxisWidget.setStubVisible(t,e),this._adjustSize(),this._redrawPanes.fire()},o.prototype.setTimeAxisVisible=function(t){this._timeAxisWidget.setVisible(t),this._adjustSize()},o.prototype.isTextTool=function(t){switch(t){case"LineToolBalloon":case"LineToolText":case"LineToolTextAbsolute":case"LineToolCallout":case"LineToolNote":case"LineToolNoteAbsolute":return!0}return!1},o.prototype.tags=function(){return this._model?this._model.calculateDefaultTags():[]},o.prototype.state=function(t,e){return this._model.state(t,e)},o.prototype.asyncState=function(t){return this._model.asyncState(t)},o.prototype.metaInfo=function(){var t=this._metaInfo;return this._model&&(t.systemTags=this._model.calculateDefaultTags()),t},o.prototype.image=function(){var t,e,i,o,n,r,s,a,l=document.createElement("canvas"),c=l.getContext("2d"),h=0,u=this._timeAxisWidget.size.h,d=this.properties().scalesProperties.lineColor.value();for(e=0;e<this._paneWidgets.length;e++)(t=this._paneWidgets[e])&&t.state()&&(t.state().recalculate(!0),0===e&&(h=t.lhsPriceAxisWidget.size.w+t.size.w+t.rhsPriceAxisWidget.size.w),u+=t.size.h);for(u+=this._paneWidgets.length-1,this._update(),i=25,o=5,l.width=h+2*o,l.height=u+i+2*o,c.fillStyle="#F2F5F8",c.fillRect(0,0,l.width,l.height),n=i+o,r=o,s=this.mainSeriesQuotesAndMetainfo(),s.ohlc&&(a="{0} O:{1} H:{2} L:{3} C:{4}".format(s.meta.symbol,s.ohlc[0],s.ohlc[1],s.ohlc[2],s.ohlc[3]),c.fillStyle="#000",c.font="12px Verdana, Arial",c.fillText(a,r,o+15)),e=0;e<this._paneWidgets.length;e++)t=this._paneWidgets[e],c.drawImage(t.lhsPriceAxisWidget.canvas,r,n),c.drawImage(t.canvas,r+t.lhsPriceAxisWidget.size.w,n),t.statusWidget().renderTo(c,r+5,n+5),c.drawImage(t.rhsPriceAxisWidget.canvas,r+t.lhsPriceAxisWidget.size.w+t.size.w,n),n+=t.size.h,e<this._paneWidgets.length-1&&(c.fillStyle=d,c.fillRect(r,n,h,1),n++);return c.drawImage(this._timeAxisWidget.lhsCanvas,r,n),c.drawImage(this._timeAxisWidget.canvas,r+t.lhsPriceAxisWidget.size.w,n),c.drawImage(this._timeAxisWidget.rhsCanvas,r+t.lhsPriceAxisWidget.size.w+t.size.w,n),c.lineWidth=1,c.strokeStyle="#000",c.strokeRect(o+.5,i+o+.5,h-1,u-1),l},o.prototype.images=function(){function t(t){var e,o,n,r,s,a;for(t.paint(A.LIGHT_UPDATE,i._onWidget),e=t.image(i._onWidget),e.containsMainSeries=t.containsMainSeries(),e.studies=[],o=t.state().dataSources(),n=0;n<o.length;n++)r=o[n],s=i.properties().paneProperties.legendProperties,a=r.statusView(),
r instanceof y?r.properties().visible.value()&&a&&s.showStudyTitles.value()&&s.showLegend.value()&&e.studies.push(r.statusView().text()):r instanceof p&&a&&s.showLegend.value()&&s.showSeriesTitle.value()&&(e.mainSeriesText=r.statusView().text());return e}var e,i,o,n,r,s,a;if(TradingView.printing=!0,e=this._model.selectedSource(),this._model.setSelectedSource(null),i=this,o=[],this.isMaximizedPane())o.push(t(this._maximizedPaneWidget));else for(n=0;n<this._paneWidgets.length;n++)r=this._paneWidgets[n],o.push(t(r)),n<this._paneWidgets.length-1&&o.push(this._paneSeparators[n].image());return this._timeAxisWidget.paint(A.LIGHT_UPDATE),s=this._timeAxisWidget.image(),TradingView.printing=!1,this._model.setSelectedSource(e),this._model.invalidate(new A(A.LIGHT_UPDATE)),a=this.mainSeriesQuotesAndMetainfo(),{panes:o,timeAxis:s,colors:{text:this.properties().scalesProperties.textColor.value(),bg:this.properties().paneProperties.background.value(),scales:this.properties().scalesProperties.lineColor.value()},meta:a.meta,ohlc:a.ohlc,quotes:a.quotes}},o.prototype.mainSeriesQuotesAndMetainfo=function(){var t,e,i,o,n,r,s,a=this._model.mainSeries();return a&&(o=function(t){return null==t?"":a.formatter().format(t)+""},n=function(t){return null==t?"":t+""},t={resolution:a.interval(),symbol:a.symbol()},r=a.symbolInfo(),r&&(t.symbol=r.full_name,t.description=r.description,t.exchange=r.exchange),s=a.bars().last(),null!==s&&(e=s.value.slice(1,5).map(o)),a.quoteData&&(i={change:o(a.quoteData.change),changePercent:n(a.quoteData.change_percent),last:o(a.quoteData.last_price)})),{meta:t,ohlc:e,quotes:i}},o.prototype.onTagsChanged=function(){return this._tagsChanged},o.prototype.onModelTagsChanged=function(){this._tagsChanged.fire()},o.prototype.destroy=function(){var t,e,i;for(0!==this._drawRafId&&cancelAnimationFrame(this._drawRafId),this._model.model().destroy(),null!==this._timingsMeter&&(this._timingsMeter.stopCollect(),this._timingsMeter=null),this._chartSession.criticalError().unsubscribe(this,this._onChartSessionCriticalError),this._chartSession.isConnected().unsubscribe(this._boundOnChartSessionIsConnectedChanged),this._chartSession.destroy(),t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].destroy();this._paneWidgets.length=0,this._controlBarNavigation&&(this._controlBarNavigation.destroy(),this._controlBarNavigation=void 0),$(window).off("visibilitychange:chart_"+this._guid),$(window).off("keydown:chart_"+this._guid);for(e in this._actions)i=this._actions[e],i.setActive(!1),i.binder&&i.binder.destroy()},o.prototype.title=function(){return window.t("Chart Properties")},o.prototype.symbolProperty=function(){return this._model.mainSeries().properties().shortName?this._model.mainSeries().properties().shortName:this._model.mainSeries().properties().symbol},o.prototype.loadContent=function(t,e){var i,o,n,r,s,a;for(this.screen.show(),i=this,this.isMaximizedPane()&&this.toggleMaximizePane(),o=i._model.model().dataSources(),n=0;n<o.length;n++)(r=o[n])!==i._model.mainSeries()&&i._model.model().removeSource(r,!0)
;for(this._model.disconnect(),i._jqMainDiv&&(i._jqMainDiv.remove(),i._jqMainDiv=null),i._timeAxisWidget=null,i._paneWidgets=[],i.activePaneWidget=!1,i._model.mainSeries().purgeSymbolInfo(),t.loading=!0,i._setContent(t),n=0;n<t.panes.length;++n)for(a=0;a<t.panes[n].sources.length;++a)if(t.panes[n].sources[a].state.symbol){s=t.panes[n].sources[a].state;break}if(!s)throw Error("An error occured while determining main series ion the chart");i._properties.mainSeriesProperties.merge({visible:!0,symbol:s.symbol,timeframe:"",onWidget:i._onWidget,interval:s.interval||"D",style:s.style}),i._init(),E.interval.setValue(s.interval),i._model.undoHistory.clearStack(),i.updateSeriesControlUI()},o.prototype._setContent=function(t){t&&t.panes.forEach(function(t){t.sources=t.sources.filter(function(t){return!!t&&("MainSeries"===t.type||(!t.points||!t.points.some(function(t){return null===t.time_t||!isFinite(t.time_t)})||(X.logNormal("Dropped invalid "+t.type+". Reason: non-numeric point time"),!1)))});var e=function(e){return t.sources&&t.sources.some(function(t){return t.id===e})};t.leftAxisSources&&(t.leftAxisSources=t.leftAxisSources.filter(e)),t.rightAxisSources&&(t.rightAxisSources=t.rightAxisSources.filter(e))}),this._content=t},o.prototype._contentSeriesProperties=function(){var t,e,i;if(this._content)for(t=this._content.panes.length;t-- >0;)for(e=this._content.panes[t].sources,i=e.length;i-- >0;)if("MainSeries"===e[i].type)return e[i].state},o.prototype.updateSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.updateUI()},o.prototype.tickSeriesControlClock=function(){this._seriesControlWidget&&this._seriesControlWidget.tickClock()},o.prototype.resizeSeriesControlUI=function(){this._seriesControlWidget&&this._seriesControlWidget.resizeUI()},o.prototype.updateUndoRedo=function(){this._model&&(this.actions().undo.setEnabled(!this._model.undoHistory.undoStack().isEmpty()),this.actions().redo.setEnabled(!this._model.undoHistory.redoStack().isEmpty()))},o.prototype.createSessionBreaksActions=function(t){var e,i=this,o=function(){e=new T({text:window.t("Session Breaks"),checkable:!0,statName:"ToggleSessionBreaks"}),e.binder=new m(e,i.model().mainSeries().sessionsStudy().properties().graphics.vertlines.sessBreaks.visible,i.model(),"Session Breaks"),i._actions.sessionBreaks=e};i.model().mainSeries().sessionsStudy()?o():i.model().mainSeries().onSessionsStudyCreated().subscribe(i,function(){o()})},o.prototype.updateActionForIntradayOnly=function(t){!t||!t instanceof T||t.setEnabled(!!this.model().mainSeries().isIntradayInterval())},o.prototype.withModel=function(t,e){this.model()?e.call(t):this.modelCreated().subscribe(t,e,!0)},o.prototype.containsVolume=function(){return this.model().dataSources().some(function(t){return t instanceof y&&"Volume"===t.metaInfo().shortId})},o.prototype.containsStudyByPredicate=function(t){return!!this._model&&this._model.dataSources().some(function(e){if(!(e instanceof y))return!1;var i=e.metaInfo();return t(i)})},o.prototype.containsStudy=function(t){
return this.containsStudyByPredicate(function(e){return e.id===t||e.fullId===t})},o.prototype.containsSessions=function(){return this.model().dataSources().some(function(t){return t instanceof y&&"Sessions"===t.metaInfo().shortId})},o.prototype.isSmall=function(){return this._width.value()<550||this._height.value()<300};o.prototype.onWidget=function(){return this._onWidget},o.prototype.onCmeWidget=function(){return"cme"===this.widgetCustomer()},o.prototype.widgetCustomer=function(){return this._widgetCustomer},o.prototype.resize=function(){this._resizeHandler&&this._jqMainDiv&&this._resizeHandler()},o.prototype.chartSession=function(){return this._chartSession},o.prototype.maxLhsPriceAxisWidth=0,o.prototype.maxRhsPriceAxisWidth=0,o.prototype.GUIResetScales=function(){U("GUI","Reset Scales");var t=this.model();t&&t.resetScales()},o.prototype.onLineCancelled=function(){x.resetToCursor()},o.prototype.createIndicatorImage=function(){var t=this;this.indicatorImage=this._jqParent.find(".chart-status-picture"),0===this.indicatorImage.length?this.indicatorImage=$('<span class="chart-status-picture"></span>').appendTo(this._jqParent):this.indicatorImage.html(""),_.enabled("display_market_status")&&(this.indicatorText=$('<span class="series-status-text apply-common-tooltip"><span class="js-market-status tv-market-status--series-status"></span></span>'),this.indicatorText.appendTo(this.indicatorImage),this.indicatorDot&&this.indicatorDot.stop(),this.indicatorDot=new K({el:this.indicatorText.find(".js-market-status")[0],classSuffix:"--for-chart"}),this.indicatorDot.start(),_.enabled("display_data_mode")&&($('<span class="js-data-mode tv-data-mode--series-status"></span>').appendTo(this.indicatorText),this.dataModeIndicator&&this.dataModeIndicator.stop(),this.dataModeIndicator=new Z({el:this.indicatorText.find(".js-data-mode")[0],classSuffix:"--for-chart"}),this.dataModeIndicator.start())),t.withModel(null,function(){var e=t._model.mainSeries();e.onStatusChanged().subscribe(null,t.updateIndicatorImage.bind(t)),e.marketStatus.subscribe(t.updateIndicatorImage.bind(t)),t.updateIndicatorImage(),t.checkCompactMode(),t._model.onRearrangePanes().subscribe(null,function(){t.resetIndicatorSize(),t.resizeIndicator()})}),t.rhsPriceAxisWidthChanged.subscribe(t,t.updateIndicatorImagePosition),t.updateIndicatorImagePosition()},o.prototype.updateIndicatorImage=function(){var t,e,i,o=this,n=this._model;n&&(t=n.mainSeries(),e=t.status(),i=t.quoteData?t.quoteData.update_mode_seconds:null,o._updateDataAndMarketStatus(t.marketStatus.value(),e,i))},o.prototype.checkCompactMode=function(){this._jqMainDiv&&this._jqMainDiv.toggleClass("i-compact",this._jqMainDiv.width()<=400),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.outerWidth())},o.prototype._updateDataAndMarketStatus=function(t,e){var i,o;if(void 0!==this.indicatorText){switch(e){case p.STATUS_LOADING:case p.STATUS_RESOLVING:i="loading",this.indicatorDot.setStatus("loading");break;case p.STATUS_INVALID_SYMBOL:i="invalid",this.indicatorDot.reset();break;case p.STATUS_NO_BARS:
i="forbidden";break;case p.STATUS_DELAYED:i="delayed";break;case p.STATUS_DELAYED_STREAMING:i="delayed_streaming";break;case p.STATUS_EOD:case p.STATUS_PULSE:i="endofday";break;case p.STATUS_OFFLINE:i="connecting";break;case p.STATUS_SNAPSHOT:i="snapshot";break;case p.STATUS_READY:i="realtime";break;case p.STATUS_REPLAY:i="replay";break;default:i=e,X.logWarn("unhandled data mode "+i)}_.enabled("display_data_mode")&&this.dataModeIndicator.setMode(i),o=["loading","invalid","replay"],!o.includes(i)&&t?this.indicatorDot.setStatus(t,!0):"invalid"===i?this.indicatorDot.setStatus("invalid",!0):"replay"===i&&this.indicatorDot.setStatus("replay"),this.resizeIndicator()}},o.prototype.resetIndicatorSize=function(){if(this._paneWidgets[0]&&this._paneWidgets[0].legendWidget)for(var t=0;t<this._paneWidgets.length;t++)this._paneWidgets[t].legendWidget.firstTitle().css("padding-right","")},o.prototype.resizeIndicator=function(){var t,e,i;this._paneWidgets[0]&&this._paneWidgets[0].legendWidget&&this._indicatorWidth&&this._paneWidgets[0].legendWidget.firstTitle().css("padding-right",this._indicatorWidth+10),_.enabled("display_market_status")&&_.enabled("display_data_mode")&&this.indicatorDot&&this.dataModeIndicator&&(this.indicatorDot.isShortModeEnabled()&&this.dataModeIndicator.isShortModeEnabled()?(t=[this.indicatorDot.getTooltipText(),this.dataModeIndicator.getTooltipText()],t=t.filter(function(t){return t}),e=t.join(", "),this.indicatorText.attr("title",e)):this.indicatorText.attr("title",""),this.indicatorText.trigger("common-tooltip-update")),this.indicatorImage&&(this._indicatorWidth=this.indicatorImage.outerWidth()),i=this._width.value(),_.enabled("display_market_status")&&this.indicatorDot&&(i>650?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):i>550?(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.disableShortMode()):(this.indicatorDot.setTooltipEnabled(!1),this.indicatorDot.enableShortMode())),_.enabled("display_data_mode")&&this.dataModeIndicator&&(i>650?(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.disableShortMode()):i>550?(this.dataModeIndicator.setTooltipEnabled(!0),this.dataModeIndicator.enableShortMode()):(this.dataModeIndicator.setTooltipEnabled(!1),this.dataModeIndicator.enableShortMode()))},o.prototype.updateIndicatorImagePosition=function(){var t=this.indicatorImage;this.indicatorImage&&t.css("marginRight",this.maxRhsPriceAxisWidth)},o.prototype._startSpinner=function(t){if(!this._spinner){var e=$(t).get(0);e&&(this._spinner=H("",{zIndex:"auto"}).spin(e))}},o.prototype.isJustClonedChart=function(){return!!(this._options||{}).justCloned},o.prototype.getLastPaneLeftBottom=function(){var t=this._paneWidgets[this._paneWidgets.length-1].jqPane,e=t.offset();return{left:e.left,bottom:$(document.body).height()-e.top-t.height()}},o.prototype.setDataWindowWidget=function(t){this._dataWindowWidget=t},o.prototype.removeDataWindowWidget=function(){this._dataWindowWidget=null},_.enabled("datasource_copypaste")&&(o.prototype.onAppClipboardPaste=function(t,e){
X.logDebug("[[paste]]"),this._model&&this._model.pasteSourceFromClip(t,e)},o.prototype.onAppClipboardCopy=function(t){if(t||(t=this._model.selectedSource()),t instanceof y&&t.isChildStudy())return void X.logDebug("Can not copy child study");X.logDebug("[[copy]]"),this._model&&this._model.copySourceToClip(t)},o.prototype.onAppClipboardCut=function(t){X.logDebug("[[cut]]"),this._model&&this._model.cutSourceToClip(t||this._model.selectedSource())}),o.prototype.applyOverrides=function(t){applyPropertiesOverrides(this.properties(),null,!1,t),this._model&&(applyPropertiesOverrides(this._model.model().properties(),null,!1,t),applyPropertiesOverrides(this._model.mainSeries().properties(),null,!1,t,"mainSeriesProperties"))},o.prototype.applyStudiesOverrides=function(t){W.setDefaultsOverrides(t),this._applyStudiesOverrides()},o.prototype._setActionsActive=function(t){var e,i=this.actions();for(e in i)i.hasOwnProperty(e)&&this.actions()[e].setActive(t)},o.prototype.setActive=function(t){this._setActionsActive(t),this._isActive=t,this._paneWidgets.forEach(function(t){t.update()})},o.prototype.isActive=function(){return this._isActive},o.prototype.trackTime=function(){return this._chartWidgetCollection.lock.trackTime},o.prototype.id=function(){return this._guid},o.prototype.createBranding=function(){this._modelCreated.subscribe(this,function(){this._model.model().createBrandingSource()},!0)},o.prototype.selectBarMode=function(){return this._model.model().selectBarMode()},o.prototype.toggleSelectBarMode=function(){this._model.model().toggleSelectBarMode()},o.prototype.onBarSelected=function(){return this._model.model().onBarSelected()},o.prototype.trySetChartStyle=function(t){var e=this.model();return!!e&&(e.mainSeries().properties().style.value()===t||!!_.enabled("charting_library_base")&&(this._setChartStyle(t),!0))},o.prototype._setChartStyle=function(t){var e=this.model(),i=e.mainSeries().properties().style;e.setChartStyleProperty(i,t,"Change Series Style")},t.exports.ChartWidget=o}).call(e,i(10))},function(t,e,i){"use strict";(function(e){function o(t,e,i,o){this._chart=t,this.dialog=t.dialog,this._state=e,this.verticalTouchScroll=o,this._disableContextMenu=!!i,this.lhsPriceAxisWidget=new l(this,l.LHS),this.rhsPriceAxisWidget=new l(this,l.RHS),this.jqPane=$(document.createElement("td")),this.jqPane.addClass("chart-markup-table"),this.jqPane.addClass("pane"),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqPane),this.canvas=V(this._dv,new O(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=V(this._dv,new O(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this._zoomSelector=$("<div>"),
this._zoomSelector.addClass("zoom-selector"),this._zoomSelector.css("display","none"),this._zoomSelector.appendTo(this._dv),this._tooltipSelector=$("<div>"),this._tooltipSelector.addClass("tooltip tooltip-selector tooltip-selector-hidden"),this._tooltipSelector.appendTo(this._dv),this.legendWidget=new a(this,this._chart.model(),this._chart._jqMainDiv),this.jqRow=$(document.createElement("tr")),this.lhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.jqPane.appendTo(this.jqRow),this.legendWidget.$el.appendTo(this._dv),this.rhsPriceAxisWidget.jqCell.appendTo(this.jqRow),this.setCursorForTool(),R($(this.top_canvas),this,!0,o),e&&!this._chart.readOnly()&&(this.paneControls=new L(this,this._chart.model(),this._dv)),this.updateScalesVisibility(),this.actions=[],this.readonlyActions=[],this._onKeyUpListener=this._onKeyUpListener.bind(this),this._lineCancelledCallback=this._lineCancelledCallback.bind(this),$(window).on("keyup.panewidget",this._onKeyUpListener),this._chart.withModel(this,this._lineCancelledCallback),this._overlays={},this._contextMenuX=0,this._contextMenuY=0,this._lockDrawingsProperty=x.lockDrawings(),this._chart.withModel(this,function(){var t=this._chart.model();t.onSimpleZoomIn().subscribe(this,this._updateCrosshairOnZoom),t.onSimpleZoomOut().subscribe(this,this._updateCrosshairOnZoom)})}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N;i(786),i(12),n=i(8).Point,r=i(323).UndoMacroCommand,s=i(35).Study,a=i(922),l=i(164).PriceAxisWidget,c=i(164).scaleRatioForContextMenuTransformer(7),h=i(57).LineToolOrder,u=i(57).LineToolPosition,d=i(1).LineDataSource,p=i(57).LineToolBrush,_=i(106).BarsMarksContainer,f=i(40).trackEvent,m=i(148).isFeatureEnabled,g=i(136).showEditObjectDialog,v=i(232).ActionBinder,y=i(46).PriceDataSource,b=i(52),S=b.Action,w=b.ActionPlaceholder,T=b.ActionSeparator,C=i(108),x=i(26),P=i(11),L=i(931),I=i(22),k=i(23),A=i(130),M=A.resizeCanvas,E=A.hardResizeCanvas,D=A.clearRect,V=A.addCanvasTo,O=A.Size,R=i(107).setMouseEventHandler,B=i(233),z=i(144),F=i(343).PaneCursorType,N=i(7).getLogger("Chart.PaneWidget"),o.prototype.destroy=function(){$(window).off("keyup.panewidget",this._onKeyUpListener),this.legendWidget&&(this.legendWidget.destroy(),this.legendWidget.$el.remove(),delete this.legendWidget),this.paneControls&&(this.paneControls.destroy(),delete this.paneControls),this.lhsPriceAxisWidget.destroy(),this.rhsPriceAxisWidget.destroy(),this._chart.withModel({chart:this._chart,instance:this,callback:this._hideTooltip},function(){this.chart.model().lineCancelled().unsubscribe(this.instance,this.callback)});for(var t in this)delete this[t]},o.prototype.cancelZoom=function(){this._zoomSelector.css("display","none"),delete this._firstZoomPoint},o.prototype._onKeyUpListener=function(t){if(27===t.keyCode){this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine(),this._firstZoomPoint&&this.cancelZoom();this._chart.model().model().crossHairSource().clearMeasure(),this.setCursorForTool(),this._hideTooltip()}},o.prototype._lineCancelledCallback=function(){
try{this._chart.model().lineCancelled().subscribe(this,this._hideTooltip)}catch(t){}},o.prototype.backgroundColor=function(){return this._chart.properties().paneProperties.background.value()},o.prototype.priceAxisByCanvas=function(t){return t===this.lhsPriceAxisWidget.canvas||t===this.lhsPriceAxisWidget.top_canvas?this.lhsPriceAxisWidget:t===this.rhsPriceAxisWidget.canvas||t===this.rhsPriceAxisWidget.top_canvas?this.rhsPriceAxisWidget:null},o.prototype.updateScalesVisibility=function(){this.lhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showLeftScale.value()),this.rhsPriceAxisWidget.setVisible(this._chart.properties().scalesProperties.showRightScale.value())},o.prototype.chart=function(){return this._chart},o.prototype._chartModel=function(){return this._chart.model().model()},o.prototype.state=function(){return this._state},o.prototype.setState=function(t){this._state=t},o.prototype.stretchFactor=function(){return this._state?this._state._stretchFactor:Pane.DEFAULT_STRETCH_FACTOR},o.prototype.setStretchFactor=function(t){this._state&&(this._state._stretchFactor=t)},o.prototype.mouseEnterEvent=function(t){var e=this._chart.model();e&&(e.crossHairSource().visible=!0,"function"==typeof this.onMouseEnter&&this.onMouseEnter(this))},o.prototype.isLineTool=function(t){var e=TradingView[t];return"function"==typeof e&&e.prototype instanceof d},o.prototype.hideInplaceEditor=function(){return!!this._inplaceEditor&&(this._inplaceEditor.remove(),this._inplaceEditor=void 0,!0)},o.prototype._processMouseMoveWhileZoom=function(t){var e=Math.floor(this._chart.model().timeScale().coordinateToIndex(t.localX)),i=this._chart.model().timeScale().indexToCoordinate(e)-.5*this._chart.model().timeScale().barSpacing(),o=t.localY,n=Math.abs(i-this._firstZoomPoint.x),r=Math.abs(o-this._firstZoomPoint.y);i<this._firstZoomPoint.x?this._zoomSelector.css("left",i):this._zoomSelector.css("left",this._firstZoomPoint.x),t.localY<this._firstZoomPoint.y?this._zoomSelector.css("top",t.localY):this._zoomSelector.css("top",this._firstZoomPoint.y),this._zoomSelector.width(n),this._zoomSelector.height(r)},o.prototype._finishZoom=function(t){var e=this._state.defaultPriceScale(),i=e.coordinateToPrice(t.localY),o=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX));o!==this._firstZoomPoint.index&&this._chart.model().zoomToViewport(this._firstZoomPoint.index,o,this._firstZoomPoint.price,i,this.state()),this._zoomSelector.css("display","none"),this._firstZoomPoint=null,x.resetToCursor()},o.EvironmentState=function(t){t.shiftKey&&(this.shift=!0),t.ctrlKey&&(this.control=!0)},o.prototype.checkMovepoint=function(t){return t===P.MOVEPOINT||t===P.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any()},o.prototype.mouseDownEvent=function(t){var i,r,a,l,c,h,u,p,_,f,m,g,v,b
;if(document.activeElement!==document.body&&document.activeElement!==document.documentElement?document.activeElement&&document.activeElement.blur?document.activeElement.blur():document.body.focus():document.getSelection?document.getSelection().removeAllRanges():document.selection&&document.selection.clear(),k.emit("mouse_down",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),this._updateCommonTooltip(null),i=this._chart.model(),r=new o.EvironmentState(t),i.mainSeries().setGotoDateResult(),this.hideInplaceEditor(),TradingView.supportTouch()&&(this._skipFirstMove=!0),a=this._state.defaultPriceScale(),!a.isEmpty()&&!i.timeScale().isEmpty()){if(l=i.crossHairSource(),TradingView.supportTouch()&&"LineToolBrush"!==x.tool.value()||i.setAndSaveCurrentPosition(t.localX,t.localY,this._state),c=l.price,h=l.index,l.startMeasurePoint()&&l.endMeasurePoint()&&l.clearMeasure(),r.shift&&x.toolIsCursor(x.tool.value())&&x.tool.setValue("measure"),"measure"===x.tool.value()&&!l.startMeasurePoint())return void l.startMeasuring({price:c,index:h,x:t.localX,y:t.localY},this._state);if(l.startMeasurePoint()&&!l.endMeasurePoint())return l.finishMeasure({price:c,index:h,x:t.localX,y:t.localY}),void x.resetToCursor();if(this._firstZoomPoint)return void this._finishZoom(t);if("zoom"===x.tool.value()&&e.enabled("chart_zoom"))return u=i.timeScale().indexToCoordinate(h)-.5*i.timeScale().barSpacing(),this._firstZoomPoint={price:c,index:h,x:u,y:t.localY},this._zoomSelector.css("display","block"),this._zoomSelector.css("left",u),this._zoomSelector.css("top",t.localY),this._zoomSelector.width(0),void this._zoomSelector.height(0);if(!this._isSelectBarModeEnabled()&&(this.isLineTool(x.tool.value())||i.lineBeingCreated()))return void((!e.enabled("charting_library_base")||h>=0)&&this._mouseDownEventForLineTool(t,r,h,c));if(p=this.dataSourceAtPoint(t.localX,t.localY),_=p&&p.source&&p.source.customization?p.source.customization:{},p.hittest&&p.hittest.result()===P.CUSTOM&&(f=p.hittest.data().mouseDownHandler)&&f(t),!this._chart.readOnly()){if(p&&p.hittest&&p.hittest.result()===P.CUSTOM_MOVE&&(f=p.hittest.data().pressedMouseMoveHandler))return void i.startCustomMoving(p.source,new n(t.localX,t.localY),f);if(p&&!_.disableSelection&&(m=p.hittest&&p.hittest.result()>P.MOVEPOINT_BACKGROUND,m=m||p.hittest&&p.hittest.result()===P.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),m?i.setSelectedSource(p.source,p.hittest&&p.hittest.data()):i.setSelectedSource(null)),p.source&&"eraser"===x.tool.value()&&!_.disableErasing&&(TradingView.isInherited(p.source.constructor,d)||TradingView.isInherited(p.source.constructor,s)))return g=p.hittest.eraseMarker(),void(t.ctrlKey&&void 0!==g&&p.source.processErase?p.source.processErase(i,g):i.removeSource(p.source));if(v=p.source&&TradingView.isInherited(p.source.constructor,d)&&p.source.isLocked(),!(this._lockDrawingsProperty.value()||v)){if(p.source&&p.source.userEditEnabled&&!p.source.userEditEnabled())return
;if(p.hittest&&p.hittest.result()===P.CHANGEPOINT)return a=p.source.priceScale(),c=a.coordinateToPrice(t.localY),i.startChangingLinetool(p.source,{index:h,price:c},p.hittest.data(),r),void this._updateTooltip(t.localX,t.localY);if(p.hittest&&this.checkMovepoint(p.hittest.result()))return b=p.source.properties(),r.control&&b.clonable&&b.clonable.value()?void(this._clonningAtMoveLineTool=p.source):void(p.source.isFixed&&p.source.isFixed()?i.startMovingSource(p.source,new n(t.localX,t.localY),p.hittest.data()):(a=p.source.priceScale(),c=a.coordinateToPrice(t.localY),i.startMovingSource(p.source,{index:h,price:c},p.hittest.data())))}if(p.source&&TradingView.isInherited(p.source.constructor,y)&&p.source.isDraggable())return void(this._chart.draggingSource=p.source)}p.hittest&&p.hittest.result()===P.REGULAR||(this._processing=!0)}},o.prototype.drawRightThere=function(t){var e,i;this.isLineTool(t)&&(e=this._chart.model(),i=e.crossHairSource(),e.createLineTool(this._state,{index:i.index,price:i.price},t))},o.prototype._finishTool=function(t){var e,i=this._chart.model(),o=x.tool.value();x.resetToCursor(),this._hideTooltip(),i.setSelectedSource(t),this._chart.isTextTool(o)&&(e=i.createUndoCheckpoint(),g(t,i,null,e).then(function(t){t.focusOnText()}))},o.prototype._mouseDownEventForLineTool=function(t,e,i,o){var r,s,a,l,c,h,u,d,_,f,m=this._chart.model(),g=!1,v=null,y=t.localX,b=t.localY,S=this._chart.model().model().crossHairSource(),w=x.tool.value();if(x.hideAllDrawings().setValue(!1),x.lockDrawings().setValue(!1),TradingView.supportTouch()&&this.isLineTool(w)&&"LineToolBrush"!==w&&!m.lineBeingCreated()&&(this._startTouchPoint=new n(y,b),this._initCrossHairPosition=S.currentPoint(),this._skipFirstMove=!0),!m.lineBeingCreated()||m.lineBeingCreated()instanceof p)TradingView.supportTouch()&&"LineToolBrush"!==w||(f={index:i,price:o},v=m.createLineTool(this._state,f,w),m.lineBeingCreated()||(g=!0));else if(TradingView.supportTouch()){if(this._skipFirstMove=!0,!this._startTouchPoint)return this._startTouchPoint=new n(y,b),r=m.lineBeingCreated().points(),s=r[r.length-1],a=m.timeScale().indexToCoordinate(s.index),o=s.price,l=m.lineBeingCreated().priceScale(),l.isPercent()&&(c=m.lineBeingCreated().ownerSource().firstValue(),o=l.priceRange().convertToPercent(o,c)),h=l.priceToCoordinate(o),void(this._lastDrawingPoint=new n(a,h))}else v=m.lineBeingCreated(),u=m.paneForSource(v),u!==this._state?(d=this._dv.offset(),y=t.localX+d.left,b=t.localY+d.top,_=this._chart.paneByState(u),d=_._dv.offset(),y-=d.left,b-=d.top,o=v.priceScale().coordinateToPrice(b),i=Math.round(m.timeScale().coordinateToIndex(y)),g=m.coninueCreatingLine({index:i,price:o},e)):g=m.coninueCreatingLine({index:i,price:o},e);m.setSelectedSource(v),g?this._finishTool(v):TradingView.supportTouch()&&"LineToolBrush"!==w||this._updateTooltip(t.localX,t.localY)},o.prototype._equalsCursorCache=function(t,e){return x.toolIsCursor(t.tool)?t.tool===e.tool&&t.theme===e.theme&&t.crosshair===e.crosshair:t.tool===e.tool&&t.theme===e.theme},o.prototype._setCursorClassName=function(t){
var e="";t&&(e="pane--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqPane.removeClass(this._currentCursorClassName),e&&this.jqPane.addClass(e),this._currentCursorClassName=e,this.jqPane.css("cursor"))},o.prototype.setCursorForTool=function(t,e){var i,o=x.tool.value();if(x.toolIsCursor(o)){if(this._chart.draggingSource||this._isScrolling||this._chart.model()&&this._chart.model().sourceBeingMoved())return void this._setCursorClassName("grabbing");if(t)return void this._setCursorClassName("pointer")}return"eraser"===o?void this._setCursorClassName("eraser"):"zoom"===o?void this._setCursorClassName("zoom-in"):"dot"===(i=x.cursorTool.value())?void this._setCursorClassName("dot"):"arrow"===i?void this._setCursorClassName("default"):void this._setCursorClassName("")},o.prototype.setDragToAnotherPaneCursor=function(){this._setCursorClassName("grabbing")},o.prototype.gestureStartEvent=function(t){this._prev_pinch_scale=1,this._pinching=!0},o.prototype.gestureChangeEvent=function(t){var e,i,o=t.center.x-5,n=this._chart.paneWidgets()[0].lhsPriceAxisWidget.size.w,r=this._chart.model().timeScale().width();n&&(o=Math.max(0,o-n)),o=Math.min(o,r),e=2*(o/r-.5),i=5*(t.scale-this._prev_pinch_scale),i>0?this._chart.model().zoomIn(e,i):i<0&&this._chart.model().zoomOut(e,-i),this._prev_pinch_scale=t.scale},o.prototype.gestureEndEvent=function(t){this._pinching=!1},o.prototype._updateCommonTooltip=function(t){var e,i,o,n=this._lastCommonTooltipData,r=null;if(t&&t.hittest&&t.hittest.result()===P.CUSTOM&&(e=t.hittest.data())&&(r=e.tooltip||null),null!=n||null!=r)return null==r?(this._lastCommonTooltipData=null,void z.hide()):void(n&&r.text===n.text&&r.rect.x===n.rect.x&&r.rect.y===n.rect.y&&r.rect.w===n.rect.w&&r.rect.h===n.rect.h||(this._lastCommonTooltipData=r,i=TradingView.clone(r),o=this.jqPane.offset(),i.rect.x+=o.left,i.rect.y+=o.top,z.show(i)))},o.prototype._processMouseMoveForCustomHandler=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY);i.hittest&&i.hittest.result()===P.CUSTOM&&(e=i.hittest.data().mouseMoveHandler)&&e(t)},o.prototype.mouseMoveEvent=function(t){var e,i,n,r,s,a,l,c,h,u,d,p,_,f,m;if(this._processMouseMoveForCustomHandler(t),e=this._chart.model()){if(i=t.localX,n=t.localY,r=new o.EvironmentState(t),this._firstZoomPoint)return void this._processMouseMoveWhileZoom(t);if(!(this._chart.readOnly()||this._editDialog&&this._editDialog.isVisible())&&(s=x.tool.value(),a=null,l=null,c=null,this._processing||!x.toolIsCursor(s)&&"eraser"!==s||(a=this.dataSourceAtPoint(t.localX,t.localY),h=a&&a.source,u=this._chart.model().crossHairSource(),h&&("LineToolOrder"===h.toolname||"LineToolPosition"===h.toolname||"AlertLabel"===h.toolname)?u.visibleTrap=!1:u.visibleTrap=!0,a.hittest&&a.hittest.result()>P.MOVEPOINT_BACKGROUND?(l=a.source,c=a.hittest.result(),!a.source||"eraser"===s&&a.source.constructor===TradingView.Series?e.setHoveredSource(null):e.setHoveredSource(a.source,a.hittest.data())):e.setHoveredSource(null)),
this._isSelectBarModeEnabled()?this._setCursorClassName("pointer"):this.setCursorForTool(l,c),this._updateCommonTooltip(a),null!==a&&null!==a.hittest&&a.hittest.result()===P.CUSTOM_MOVE))switch(d=a.hittest.data()||{},d.cursorType){case F.VerticalResize:this._setCursorClassName("ns-resize")}if(this._chart.readOnly()&&(a=this.dataSourceAtPoint(t.localX,t.localY),null!==a.source?e.setHoveredSource(a.source,a.hittest.data()):e.setHoveredSource(null,null)),this._chart.model().lineBeingCreated()&&(p=this._chart.model().lineBeingCreated(),(_=this._chart.model().paneForSource(p))!==this._state))return f=this._dv.offset(),i+=f.left,n+=f.top,m=this._chart.paneByState(_),f=m._dv.offset(),i-=f.left,n-=f.top,void e.setAndSaveCurrentPosition(i,n,_);s=x.tool.value(),TradingView.supportTouch()&&this.isLineTool(s)||(e.setAndSaveCurrentPosition(i,n,this._state,r),this._updateTooltip(i,n))}},o.prototype.pressedMouseMoveEvent=function(t){var i,r,s,a,l,c,h,u,_,f,m,g,v,y,b,S,w,T,C,P,L,I,k,A,M,E,D,V;if(!this._pinching){if(this._skipFirstMove?(delete this._skipFirstMove,delete this._touchMove):this._touchMove=!0,i=new o.EvironmentState(t),r=this._chart.model(),s=t.localX,a=t.localY,this._firstZoomPoint)return this._processMouseMoveWhileZoom(t),void(this._firstZoomPoint.draggingMode=!0);if(l=x.tool.value(),TradingView.supportTouch()&&this._startTouchPoint&&this.isLineTool(l)&&"LineToolBrush"!==l&&!r.lineBeingCreated()&&!this._isSelectBarModeEnabled())return c=this._initCrossHairPosition,h=new n(s,a),u=h.subtract(this._startTouchPoint),_=c.add(u),this._chart.model().setAndSaveCurrentPosition(_.x,_.y,this._state),void this._updateTooltip(_.x,_.y);if(TradingView.supportTouch()&&r.lineBeingCreated()&&!(r.lineBeingCreated()instanceof p))return void(this._startTouchPoint&&(f=r.lineBeingCreated(),m=t.localX-this._startTouchPoint.x,g=t.localY-this._startTouchPoint.y,v=this._lastDrawingPoint.x+m,y=this._lastDrawingPoint.y+g,b=this._chart.model().paneForSource(f),r.setAndSaveCurrentPosition(v,y,b),this._updateTooltip(v,y)));if(r.setAndSaveCurrentPosition(s,a,this._state,i),this._updateTooltip(s,a),S=x.tool.value(),w=this._isSelectBarModeEnabled(),(!this.isLineTool(S)||"LineToolBrush"===l||w)&&(0===t.button||Modernizr.touch)){if("LineToolBrush"===S&&!w){if(T=this._state.defaultPriceScale(),T.isEmpty())return;if(!this._chart.model().lineBeingCreated())return;return C=T.coordinateToPrice(t.localY),P=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)),void((!e.enabled("charting_library_base")||P>=0)&&this._chart.model().coninueCreatingLine({index:P,price:C}))}if(this._chart.draggingSource&&(L=t.target,I=this._chart.paneByCanvas(L),I&&(I!==this?I.setDragToAnotherPaneCursor():I.setCursorForTool()),k=this._chart.priceAxisByCanvas(L),k&&k.setCursor("grabbing"),(A=this._chart.timeAxisByCanvas(L))&&A.setCursor("grabbing")),r.timeScale().isEmpty())return;if(r.customMoveBeingProcessed())return void r.processCustomMove(new n(s,a));if(r.lineBeingEdited())return P=Math.round(this._chart.model().timeScale().coordinateToIndex(s)),
(!e.enabled("charting_library_base")||P>=0)&&r.changeLinePoint({x:s,y:a},i),this._updateTooltip(s,a),void this.setCursorForTool();if(r.sourceBeingMoved()){if(T=r.sourceBeingMoved().priceScale(),T.isEmpty())return;if(P=this._chart.model().timeScale().coordinateToIndex(t.localX),C=T.coordinateToPrice(t.localY),M=r.sourceBeingMoved(),this.setCursorForTool(),e.enabled("charting_library_base")&&!r.sourceBeingMoved().onlyYMoving()&&(E=M.points(),0!==E.length&&E.reduce(function(t,e){return e.index<t.index?e:t}).index-((M._currentMovingPoint||M._startMovingPoint).index-P)<0))return;return TradingView.isInherited(M.constructor,d)&&M.isFixed()?void r.moveSource(new n(s,a)):void r.moveSource({index:P,price:C},i)}if(i.control&&this._clonningAtMoveLineTool)return f=this._clonningAtMoveLineTool,D=this.cloneLineTool(f,!0),V=this._chart.model().model().dataSourceForId(D),this._chart.model().setSelectedSource(V),r.startMovingSource(V,{index:this._chart.model().timeScale().coordinateToIndex(t.localX),price:f.priceScale().coordinateToPrice(t.localY)}),void(this._clonningAtMoveLineTool=null);T=this._state.defaultPriceScale(),!this._startScrollingPos&&e.enabled("chart_scroll")&&(this._startScrollingPos={x:t.clientX,y:t.clientY}),this._startScrollingPos&&(this._startScrollingPos.x===t.clientX&&this._startScrollingPos.y===t.clientY||this._isScrolling||(r.beginUndoMacro("scroll").setCustomFlag("doesnt_affect_save",!0),T.isEmpty()||r.startScrollPrice(this._state,T,t.localY),r.startScrollTime(t.localX),this._isScrolling=!0,this.setCursorForTool())),this._isScrolling&&(T.isEmpty()||r.scrollPriceTo(this._state,T,t.localY),r.scrollTimeTo(t.localX))}}},o.prototype._processMouseUpForCustomHandler=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY);i.hittest&&i.hittest.result()===P.CUSTOM&&(e=i.hittest.data().mouseUpHandler)&&e(t)},o.prototype.mouseUpEvent=function(t){var e,i,o,n,s,a,l,c,h,u,d,_,f,m,g,v,y,b,S,w,T,C,P,L,A,M,E,D,V,O,R,B,z;if(this._processMouseUpForCustomHandler(t),this._clonningAtMoveLineTool=null,e=this,k.emit("mouse_up",{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY}),i=this._chart.model(),o=this._touchMove,delete this._touchMove,n=x.tool.value(),TradingView.supportTouch()&&!o&&"LineToolBrush"!==n&&this.isLineTool(n)&&!i.lineBeingCreated())return s=i.crossHairSource().currentPoint(),a=this._state.defaultPriceScale(),l=a.coordinateToPrice(s.y),c=Math.round(i.timeScale().coordinateToIndex(s.x)),h={index:c,price:l},u=i.createLineTool(this._state,h,n),i.setSelectedSource(u),i.lineBeingCreated()||this._finishTool(u),this._updateTooltip(s.x,s.y),void delete this._startTouchPoint;if(i.lineBeingCreated()&&!(i.lineBeingCreated()instanceof p)&&this._startTouchPoint)return d=!1,delete this._startTouchPoint,o||(u=i.lineBeingCreated(),_=u.points()[u.points().length-1],l=_.price,f=u.priceScale(),f.isPercent()&&(m=i.lineBeingCreated().ownerSource().firstValue(),l=f.priceRange().convertToPercent(l,m)),d=i.coninueCreatingLine({index:_.index,price:l},{}),delete this._lastDrawingPoint),
void(d&&this._finishTool(u));if(this._firstZoomPoint&&this._firstZoomPoint.draggingMode)return void this._finishZoom(t);if(0===t.button||TradingView.supportTouch()){if(this._processing=!1,i=this._chart.model(),i.customMoveBeingProcessed()&&i.endCustomMoving(),i.lineBeingEdited())return i.endChangingLinetool(),void this._hideTooltip();if("LineToolBrush"===n&&!this._isSelectBarModeEnabled()){if(i.finishLineTool(),a=this._state.defaultPriceScale(),a.isEmpty())return;if(!this._chart.model().lineBeingCreated())return;return l=a.coordinateToPrice(t.localY),c=Math.round(this._chart.model().timeScale().coordinateToIndex(t.localX)),void this._chart.model().coninueCreatingLine({index:c,price:l})}if(g=i.sourceBeingMoved())return i.endMovingSource(),this._hideTooltip(),this.setCursorForTool(g),void i.invalidate(new I(I.UPDATE_CURSOR_ONLY));if(this._chart.readOnly()||(v=this.dataSourceAtPoint(t.localX,t.localY),y=this._chart.model().crossHairSource(),b=t.localX>=0&&t.localX<this.size.w,v&&v.source===y||!b||(S=e._chart.model().timeScale().coordinateToIndex(t.localX),e._chart.model().model().onSyncScrollNeeded(S))),w=this._isScrolling&&this._chart.model().undoHistory.undoStack().head()instanceof r,this._isScrolling&&(a=this._state.defaultPriceScale(),i.endScrollPrice(this._state,a),e=this,T=function(){i.endScrollTime(),i.endUndoMacro(),e._startScrollingPos=void 0,e._isScrolling=!1,e.setCursorForTool()},TradingView.supportTouch()?(C=i.timeScale().m_scrollStartPoint,P=.05*(t.localX-C),L=null,A=function(e){var o,n;null===L&&(L=e),o=.01*Math.min(100,3*(e-L)),o=Math.sqrt(o),n=t.localX+P*o,i.scrollTimeTo(n),o>=1?T():requestAnimationFrame(A)},requestAnimationFrame(A)):T()),this._chart.draggingSource)for(M=t.target,E=this._chart.paneByCanvas(M),E&&E!==this&&(D=E._state.findSuitableScale(this._chart.draggingSource),w&&(w=!1,this._chart.model().undoHistory.undo()),this._chart.model().move(this._chart.draggingSource,E._state,D)),V=this._chart.timeAxisByCanvas(M),V&&(w&&(w=!1,this._chart.model().undoHistory.undo()),this._chart.model().move(this._chart.draggingSource,null,null)),this._chart.draggingSource=null,O=this._chart.getTimeScale(),O&&O.restoreDefaultCursor(),v=this.dataSourceAtPoint(t.localX,t.localY),R=this._chart.paneWidgets(),B=0;B<R.length;B++)z=R[B],z===this&&v?z.setCursorForTool(v.source,v.hittest||null):z.setCursorForTool(),z.lhsPriceAxisWidget.restoreDefaultCursor(),z.rhsPriceAxisWidget.restoreDefaultCursor()}delete this._touchMove},o.prototype.mouseLeaveEvent=function(t){var e=this._chart.model();e&&(TradingView.isMobile.any()||e.model().clearCurrentPosition(),e.setHoveredSource(null),this._updateCommonTooltip(null),"function"==typeof this.onMouseLeave&&this.onMouseLeave(this))},o.prototype.mouseClickEvent=function(t){var e,i=this.dataSourceAtPoint(t.localX,t.localY),o=this._chart.model(),n=i.source;this._lastClickedSource!==n&&(this._lastClickedSource&&(this._lastClickedSource.onClickOutside(t),o.chartModel().updateSource(this._lastClickedSource)),this._lastClickedSource=n),
i.hittest&&i.hittest.result()===P.CUSTOM&&(e=i.hittest.data().mouseClickHandler)&&(e(t),o.chartModel().updateSource(n)),o.hoveredSource()instanceof _&&o.hoveredSource().onClicked()},o.prototype.showEditDialogForSource=function(t){if(!(this.chart().onWidget()||t.userEditEnabled&&!t.userEditEnabled())){var e=this;g(t,this._chart.model()).then(function(t){e._editDialog=t})}},o.prototype.mouseDoubleClickEvent=function(t){var e,i=!this._chart.readOnly()&&!this.isLineTool(x.tool.value())&&this.dataSourceAtPoint(t.localX,t.localY),o=i&&i.hittest&&i.source;o&&i.hittest.result()<=P.MOVEPOINT_BACKGROUND&&!TradingView.isMobile.any()&&(o=null),o&&o.customization&&o.customization.disableSelection&&(o=null),o&&o._metaInfo&&"Sessions@tv-basicstudies"===o._metaInfo.id&&(o=this._chart.model().mainSeries()),o?(e=!1,e?TradingView.alertsDispatcher.openEditDialog(i.source.alert()):this.showEditDialogForSource(o)):this._chart.readOnly()||this.isLineTool(x.tool.value())||this._chart.model().lineBeingCreated()||this._chart.model().selectedSource()||this._chart.toggleMaximizePane(this)},o.prototype.showContextMenuForSource=function(t,e){t.hasContextMenu()&&(this._chart.model().setSelectedSource(t),t.constructor===TradingView.Series?this._seriesContextMenu(t).show(e):TradingView.isInherited(t.constructor,s)?this._studyContextMenu(t).show(e):TradingView.isInherited(t.constructor,h)||TradingView.isInherited(t.constructor,u)?this._tradingDrawingsContextMenu(t).show(e):TradingView.isInherited(t.constructor,d)?this._lineContextMenu(t).then(function(t){t.show(e)}):t===this._chart.model().crossHairSource()&&t.handleContextMenuEvent(e))},o.prototype.contextMenuEvent=function(t,i){var o,n,r,s;if(e.enabled("pane_context_menu")){if(this._chart.model().crossHairSource().startMeasurePoint())return void this._chart.model().crossHairSource().clearMeasure();if(!this._pinching&&(this._firstZoomPoint&&this.cancelZoom(),!this.hideInplaceEditor())){if(!x.toolIsCursor(x.tool.value())&&!this._isSelectBarModeEnabled()){if(TradingView.isMobile.any())return;return x.resetToCursor(!0),this.setCursorForTool(),this._hideTooltip(),void(this._chart.model().lineBeingCreated()&&this._chart.model().cancelCreatingLine())}this.chart().readOnly()||this._disableContextMenu||(this._chart.model().mainSeries().createSessStudy(),this._contextMenuX=t.localX,this._contextMenuY=t.localY,o=this.dataSourceAtPoint(t.localX,t.localY),n=o?o.source:null,r=o&&o.hittest?o.hittest.result():0,s=r>=P.REGULAR||r>=P.MOVEPOINT_BACKGROUND&&TradingView.isMobile.any(),this._chart.updateActions(),null!==n&&s?this.showContextMenuForSource(n,t):(this._contextMenu(t).then(function(e){return e.show(t)}),this._chart.model().setSelectedSource(null)),this.paint())}}},o.prototype._contextMenu=function(t){function e(t){return null===t.text}var i=this;return Promise.all(this._initActions(t)).then(function(t){var o,n,r=i._customActions();for(t=t.filter(function(t){return null!==t}),r.remove.forEach(function(e){for(var i=0;i<t.length;i++)if(t[i].text===e){t.splice(i,1);break}}),o=r.top.concat(t).concat(r.bottom),
n=o.length-1;n>0;n--)e(o[n])&&e(o[n-1])&&o.splice(n,1);return o.length&&e(o[0])&&o.splice(0,1),o.length&&e(o[o.length-1])&&o.splice(o.length-1,1),C.createMenu(o,{statName:"ChartContextMenu"})})},o.prototype.createRemoveMenu=function(){var t,e=this._chart.actions(),i=new S({text:window.t("Remove"),statName:"Remove"});return i.subActions||(i.subActions=[]),t=i.subActions,t.push(e.paneRemoveAllStudies,e.paneRemoveAllDrawingTools,e.paneRemoveAllStudiesDrawingTools),i},o.prototype.createDrawingMenu=function(){var t,i=this._chart.actions(),o=new S({text:window.t("Drawing Tools"),statName:"DrawingTools"});return o.subActions||(o.subActions=[]),t=o.subActions,e.enabled("left_toolbar")&&t.push(i.drawingToolbarAction),e.enabled("items_favoriting")&&t.push(i.favoriteDrawingToolbar),0!==o.subActions.length&&t.push(new T),t.push(i.magnetAction,i.stayInDrawingModeAction),e.enabled("support_multicharts")&&t.push(i.syncModeAction),t.push(new T,i.lockDrawingsAction,i.hideAllDrawingsAction,i.paneRemoveAllDrawingTools),o},o.prototype._initActions=function(t){var i,o,n,r,s,a=this,l=this._chart.actions(),c=[];return e.enabled("datasource_copypaste")&&(!(i=B.get())||"study"!==i.type&&"drawing"!==i.type||(o=new S({text:window.t("Paste %s").replace("%s",window.t(i.title||i.type)),shortcut:"Ctrl-V",statName:"Paste"}),o.callbacks().subscribe(null,function(){a._chart.onAppClipboardPaste(a.state())}),c.push(o))),l.gotoDate&&c.push(l.gotoDate),c.length&&c.push(new T),c.push(l.chartReset,l.symbolSearch,l.changeInterval),n=window.widgetbar&&(!window.widgetbar._customization||window.widgetbar._customization.watchlist),n&&l.addToWatchlist&&c.push(l.addToWatchlist),e.enabled("text_notes")&&m("text_notes")&&c.push(l.addToTextNotes),e.enabled("symbol_info")&&c.push(l.showSymbolInfoDialog),c.push(new T,this._createLockTimeAxisAction(t),new T,l.paneObjectTree,l.insertIndicator),e.enabled("charting_library_base")||c.push(l.applyStudyTemplate),e.enabled("compare_symbol")&&c.push(l.compareOrAdd),c.push(this.createDrawingMenu()),e.enabled("charting_library_base")&&c.push(l.hideAllMarks),c.push(this.createRemoveMenu(),new T),r=this._priceAxisMenu(),r&&c.push(r),s=this._timeAxisMenu(),s&&c.push(s),e.enabled("charting_library_base")||c.push(l.applyColorTheme),e.enabled("show_chart_property_page")&&c.push(l.chartProperties),pro.hasPackage("mtp-mtpredictor")&&this.state().containsMainSeries()&&c.push(new T,this._createMTPredictorActions()),c},o.prototype._customActions=function(){var t,i={top:[],bottom:[],remove:[]},o=this._chart.model(),n=o.timeScale(),r=this._state.defaultPriceScale();return e.enabled("custom_items_in_context_menu")?(t=n.isEmpty()?void 0:n.indexToUserTime(n.coordinateToIndex(this._contextMenuX)),k.emit("onContextMenu",{unixtime:t?t/1e3:void 0,price:r.isEmpty()?void 0:r.coordinateToPrice(this._contextMenuY),callback:function(t){[].concat(t).forEach(function(t){if(t.text)if(t.text.length>1&&"-"===t.text[0])i.remove.push(t.text.slice(1));else{var e;"-"===t.text?e=new T:(e=new S({text:t.text}),e.callbacks().subscribe(null,t.click)),
t.position&&"top"===t.position?i.top.push(e):i.bottom.push(e)}})}}),i):i},o.prototype._timeAxisMenu=function(){if(this._chart.model().timeScale().isEmpty())return null;var t=this._chart.getTimeScale();return new S({text:window.t("Time Scale"),subActions:t.getContextMenuActions(),statName:"TimeScale"})},o.prototype.getDefaultPriceAxisWidget=function(){var t=this._state.defaultPriceScale();return t.isEmpty()?null:t===this._state.leftPriceScale?this.leftPriceAxisWidget():this.rightPriceAxisWidget()},o.prototype._priceAxisMenu=function(){var t=this.getDefaultPriceAxisWidget();return t?new S({text:window.t("Price Scale"),subActions:t.getContextMenuActions(),statName:"PriceScale"}):null},o.prototype._seriesContextMenu=function(t){var i,o,n,r,s,a=this._chart.actions(),l=t.properties().visible.value(),c=null;if(this._chart.readOnly())i=[l?a.seriesHide:this.createActionShow(t),new T,this.createActionShowCountdown(t),new T,this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)],e.enabled("countdown")||i.splice(3,1),c=C.createMenu(i);else{if(o=this._mergeContentMenuItems(t),n=[a.showSymbolInfoDialog,a.compare,l?a.seriesHide:this.createActionShow(t),this.createVisualOrderAction(t),new T,this.createActionShowCountdown(t),new T],e.enabled("countdown")||n.splice(5,2),e.enabled("compare_symbol")||n.splice(1,1),e.enabled("symbol_info")||n.splice(0,1),!this.chart().onWidget()&&e.enabled("show_chart_property_page")&&n.unshift(a.format),r=this.createActionLockScale(t),r&&n.push(r,new T),o.length>0){for(s=0;s<o.length;s++)n.push(o[s]);n.push(new T)}n.push(this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)),pro.hasPackage("mtp-mtpredictor")&&n.push(new T,this._createMTPredictorActions()),c=C.createMenu(n)}return c},o.prototype.toggleLockTimeAxis=function(t,e){var i,o,n;"boolean"!=typeof e&&(e=!x.lockTimeAxis().value()),e&&(i=this._chart.model().timeScale(),o=i.coordinateToIndex(t),n=i.points().roughTime(o),x.lockTimeAxisTime.setValue(n)),x.lockTimeAxis().setValue(e)},o.prototype._createLockTimeAxisAction=function(t){var e=new S({text:window.t("Lock Cursor In Time"),checkable:!0,statName:"ToggleLockCursorInTime"}),i=x.lockTimeAxis().value();return e.setChecked(i),e.callbacks().subscribe(null,this.toggleLockTimeAxis.bind(this,t.localX,!i)),e},o.prototype._createHVLineAction=function(t,e){e="vertical"===e&&"vertical"||"horizontal";var i=new S({text:"vertical"===e?window.t("Create Vertical Line"):window.t("Create Horizontal Line"),statName:"vertical"===e?"CreateVerticalLine":"CreateHorizontalLine"});return i.callbacks().subscribe(this,function(){var i=this._chart.model().timeScale().coordinateToIndex(t.localX),o=this._state.defaultPriceScale().coordinateToPrice(t.localY),n=this._chart.model().createLineTool(this._state,{index:i,price:o},"vertical"===e&&"LineToolVertLine"||"LineToolHorzLine");this._finishTool(n)}),i},o.prototype._createMTPredictorActions=function(){var t=this,e=function(e,i,o){var n=new S({text:e});return n.callbacks().subscribe(t,function(){
var t,e,n=this._chart.model(),r=n.timeScale(),s=this._state.defaultPriceScale();r.isEmpty()||s.isEmpty()||(o?(t=s.coordinateToPrice(this._contextMenuY),e=Math.round(r.coordinateToIndex(this._contextMenuX)),n.createLineTool(this._state,{index:e,price:t},i)):x.tool.setValue(i))}),n};return new S({text:window.t("MTPredictor"),subActions:[e(window.t("Apply Manual Risk/Reward"),"LineStudyMtpRiskReward",!1),e(window.t("Apply Manual Decision Point"),"LineStudyMtpDecisionPoint",!0),e(window.t("Analyze Trade Setup"),"LineStudyMtpAnalysis",!0),new S({text:window.t("Apply Elliot Wave"),subActions:[e(window.t("Apply Elliot Wave Intermediate"),"LineStudyMtpElliotWaveMain",!0),e(window.t("Apply Elliot Wave Major"),"LineStudyMtpElliotWaveMajor",!0),e(window.t("Apply Elliot Wave Minor"),"LineStudyMtpElliotWaveMinor",!0)]}),new S({text:window.t("Apply WPT Up Wave"),subActions:[e(window.t("Up Wave 1 or A"),"LineStudyMtpUpWave1OrA",!1),e(window.t("Up Wave 2 or B"),"LineStudyMtpUpWave2OrB",!1),e(window.t("Up Wave C"),"LineStudyMtpUpWaveC",!1),e(window.t("Up Wave 3"),"LineStudyMtpUpWave3",!1),e(window.t("Up Wave 4"),"LineStudyMtpUpWave4",!1),e(window.t("Up Wave 5"),"LineStudyMtpUpWave5",!1)]}),new S({text:window.t("Apply WPT Down Wave"),subActions:[e(window.t("Down Wave 1 or A"),"LineStudyMtpDownWave1OrA",!1),e(window.t("Down Wave 2 or B"),"LineStudyMtpDownWave2OrB",!1),e(window.t("Down Wave C"),"LineStudyMtpDownWaveC",!1),e(window.t("Down Wave 3"),"LineStudyMtpDownWave3",!1),e(window.t("Down Wave 4"),"LineStudyMtpDownWave4",!1),e(window.t("Down Wave 5"),"LineStudyMtpDownWave5",!1)]})]})},o.prototype.createEarningsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowEarnings,i=new S({checkable:!0,text:window.t("Show Earnings"),enabled:!0,checked:e.value(),statName:"ToggleShowEarnings"});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Earnings")}),i},o.prototype.createDividendsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowDividends,i=new S({checkable:!0,text:window.t("Show Dividends"),enabled:!0,checked:e.value(),statName:"ToggleShowDividends"});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Dividends")}),i},o.prototype.createSplitsShow=function(t){var e=this._chart.model().mainSeries().properties().esdShowSplits,i=new S({checkable:!0,text:window.t("Show Splits"),enabled:!0,checked:e.value(),statName:"ToggleShowSplits"});return i.callbacks().subscribe(this,function(t){this._chart.model().setProperty(e,t.checked,"Show Splits")}),i},o.prototype._studyEsdContextMenu=function(t){var e=[];return this._chart.readOnly()||e.push(this.createDividendsShow(t),this.createSplitsShow(t),this.createEarningsShow(t)),C.createMenu(e)},o.prototype._studyContextMenu=function(t){var i,o,n,r,s,a=this._chart.actions(),l=t.properties().visible.value(),c=[];return t.userEditEnabled()?(i=this._chart,
this._chart.readOnly()?c=[l?a.studyHide:this.createActionShow(t),new T,this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t)]:(o=[],n=t.metaInfo(),n.pine&&(o=[a.viewSourceCode],a.viewSourceCode.setEnabled(!0),ScriptLib.isAuthToGetPineSourceCode(n.scriptIdPart,n.pine.version).done(function(t){t||a.viewSourceCode.setEnabled(!1)}).fail(function(t){N.logError("Failed isAuthToGetPineSourceCode, reason: "+t)})),c=[],e.enabled("study_on_study")&&t.canHaveChildren()&&c.push(this.createActionAddChildStudy(t)),e.enabled("property_pages")&&c.push(a.format),c=c.concat(o),c=c.concat([l?a.studyHide:this.createActionShow(t),this.createVisualOrderAction(t),new T]),r=this._mergeContentMenuItems(t),!r.length||t.properties().linkedToSeries&&t.properties().linkedToSeries.value()||(r.push(new T),c=c.concat(r)),c.push(this.createActionScaleLeft(t),this.createActionScaleRight(t),this.createActionNoScale(t),new T),e.enabled("datasource_copypaste")&&!t.isChildStudy()&&(s=new S({text:window.t("Copy"),shortcut:"Ctrl-C",statName:"Copy"}),s.callbacks().subscribe(null,function(){i.onAppClipboardCopy(t)}),c.push(s)),c.push(a.studyRemove)),C.createMenu(c)):C.createMenu(c)},o.prototype.createLineToolTemplateAction=function(t){var e,i,o,n,r,s=window.lineToolPropertiesToolbar.templatesList(),a=new S({text:window.t("Templates"),statName:"Templates"});return a.subActions||(a.subActions=[]),e=a.subActions,i=new S({text:window.t("Save As..."),statName:"SaveAs"}),i.callbacks().subscribe(this,function(){s.showSaveDialog(function(e){var i=JSON.stringify(t.template());s.saveTemplate(e,i)})}),e.push(i),o=new S({text:window.t("Apply Default"),statName:"ApplyDefault"}),o.callbacks().subscribe(this,function(){this._chart.model().restoreLineToolFactoryDefaults(t,"Load default drawing template"),window.lineToolPropertiesToolbar.onSourceChanged(t)}),e.push(o),n=$.Deferred(),s.templatesLoaded().then(function(){var t=s.getData(),e=[];0!==t.length&&e.push(new T),$.each(t,function(t,i){function o(t){return function(){var e=this.getTopLevelMenu();return e&&e.hide(),s.deleteAction(t),!0}}var n=new S({text:i,statName:"ApplyTemplate"});n.callbacks().subscribe(this,function(){s.loadTemplate(i)}),n.deleteButton={action:o(n.text)},e.push(n)}),n.resolve(e)}),r=new w(n),e.push(r),a},o.prototype._lineContextMenu=function(t){var n=[],r=this._chart,s=r.actions(),a=this;return new Promise(function(l){i.e(12).then(function(c){var h,u,d,p,_,f=i(1077).hasStylesPropertyPage;if(r.readOnly())n.push(s.lineHide);else if(t.userEditEnabled()&&(e.enabled("alerts")&&!a.chart().onWidget()&&t.hasAlert.value()&&n.push(a._createEditAlertDrawingAction(t)),e.enabled("property_pages")&&f(t,r.model())&&n.push(s.format),n.push(s.paneObjectTree),e.enabled("charting_library_base")||n.push(a.createLineToolTemplateAction(t)),n.push(a.createVisualOrderAction(t),new T,s.lineHide,s.lineToggleLock),t.properties().clonable&&t.properties().clonable.value()&&(h=new S({text:window.t("Clone"),callbackContext:{target:t},shortcut:"Ctrl+Drag",doNotBindShortcut:!0,statName:"Clone"}),
h.callbacks().subscribe(a,o.prototype.cloneLineTool.bind(a,t,!1)),n.push(h)),e.enabled("datasource_copypaste")&&!t.properties().blockCopying&&(u=new S({text:window.t("Copy"),shortcut:"Ctrl-C",statName:"Copy"}),u.callbacks().subscribe(null,function(){r.onAppClipboardCopy(t)}),n.push(u)),e.enabled("support_multicharts")&&(t.linkKey?n.push(s.lineUnlink):n.push(s.lineCopyToCharts)),n.push(s.lineRemove),t.additionalActions))for(n.push(new T),d=t.additionalActions(r.model()),p=0;p<d.length;p++)n.push(d[p]);_=C.createMenu(n),l(_)}.bind(null,i)).catch(i.oe)})},o.prototype._tradingDrawingsContextMenu=function(t){return C.createMenu(t.contextMenuItems())},o.prototype._chartEventsContextMenu=function(t){var i,o,n,r=[];return e.enabled("property_pages")&&(i=this._chart,o=new S({text:window.t("Format..."),enabled:!0,statName:"Format"}),o.callbacks().subscribe(this,function(t){TVSettings.setValue("properties_dialog.active_tab.chart",window.t("Events & Alerts")),i.showChartProperties()}),r.push(o)),n=new S({text:window.t("Hide Events on Chart"),enabled:!0,statName:"HideEvents"}),n.callbacks().subscribe(this,function(e){t.properties().visible.setValue(!1)}),r.push(n),C.createMenu(r)},o.prototype._createAlertToggleHorzLineLabelAction=function(t){var e=t.properties().line.visible,i=new S({checkable:!0,text:window.t("Extend Alert Line"),enabled:!0,checked:e.value(),statName:"ToggleExtendAlertLine"});return i.callbacks().subscribe(this,function(t){var i=t.checked,o=i?window.t("Show alert label line"):window.t("Hide alert label line");this._chart.model().setProperty(e,i,o)}),i.setEnabled(t.globalProperties().line.visible.value()),i},o.prototype._createShowGlobalAlertPropertiesLabelAction=function(t){var e=this.chart(),i=new S({text:window.t("Visual settings..."),statName:"VisualSettings"});return i.callbacks().subscribe(this,function(t){e.showChartProperties({selectAlertEvent:!0})}),i},o.prototype._createEditAlertDrawingAction=function(t){if(t.hasAlert.value()){var e=new S({text:window.t("Edit {0} Alert...").format(t.title()),statName:"EditAlert"});return e.callbacks().subscribe(null,function(){runOrSignIn(function(){t.editAlert()},{source:"Alert edit from pane context menu"})}),e}},o.prototype.cloneLineTool=function(t,e){return this._chart.model().cloneLineTool(t,e)},o.prototype.setPriceAxisSize=function(t,e){this._priceAxisWidget(t).setSize(e)},o.prototype.setPriceAxisVisible=function(t,e){this._priceAxisWidget(t).setVisible(e),this._cachedStatus=null},o.prototype.resetPriceAxisOptimalWidth=function(t){this._priceAxisWidget(t).resetOptimalWidth(),this._cachedStatus=null},o.prototype.setSize=function(t){this.size&&this.size.equals(t)||(this.size=t,M(this.canvas,t),M(this.top_canvas,t),this.ctx=this.canvas.getContext("2d"),this.jqPane.width(t.w),this.jqPane.height(t.h),this._cachedStatus=null,this.jqRow.toggleClass("js-hidden",0===t.h))},o.prototype.dataSourceAtPoint=function(t,e){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,g,v=null,y=null;if(!this._state)return null;for(i=this._state.hitTestSources(),o=i.length;0<o--;)if(r=i[o],
s=r.paneViews(this._state))for(a=s.length;0<a--;)(l=s[a].renderer(e))&&l.hitTest&&(c=l.hitTest(new n(t,e)))&&(h=y?y.result():0,c.result()>h&&(y=c,v=r));if(this.containsMainSeries()){for(u=this._chart.model().barsMarksSources(),o=0;o<u.length;++o)for(r=u[o],s=r.paneViews(),a=0;a<s.length;a++)if(l=s[a].renderer(e),d=l.hitTest(new n(t,e))){y=d,v=r;break}p=this._chart.model().activeStrategySource().value(),_=p&&p._strategyOrdersPaneView,_&&(f=_.renderer())&&(m=f.hitTest(new n(t,e)))&&(y=m,v=p)}return null===v&&(v=this.legendWidget.dataSourceAtPoint(t,e)),g=this._chart.model().brandingSource(),g&&(m=g.hitTest(new n(t,e)))&&(y=m,v=g),{source:v,hittest:y}},o.prototype.update=function(){this.lhsPriceAxisWidget.update(),this.rhsPriceAxisWidget.update(),this.legendWidget.update(),this.paneControls&&this.paneControls.update()},o.prototype.updateControls=function(){this.paneControls&&this.paneControls.update()},o.prototype.drawBackground=function(t,e){D(t,0,0,this.size.w,this.size.h,e)},o.prototype.drawGrid=function(t){var e,i,o=this._chart.model().gridSource(),n=o.paneViews(this._state),r=this._state.height(),s=this._state.width();for(e=0;e<n.length;e++)t.save(),i=n[e].renderer(r,s),i&&i.draw(t),t.restore()},o.prototype.drawWatermark=function(t){var e,i,o=this._chart.model().watermarkSource(),n=o.paneViews(this._state),r=this._state.height(),s=this._state.width();for(e=0;e<n.length;e++)t.save(),i=n[e].renderer(r,s),i&&i.draw(t),t.restore()},o.prototype.drawBranding=function(t){var e,i,o,n,r,s=this._chart.model().brandingSource();if(s)for(e=s.paneViews(this._state),i=this._state.height(),o=this._state.width(),n=0;n<e.length;n++)(r=e[n].renderer(i,o))&&(t.save(),r.draw(t),t.restore())},o.prototype.drawCrossHair=function(t){var e=this._chart.model().crossHairSource();e.visibleTrap&&(!e.visible&&x.lockTimeAxis().value()&&(e.setLockedPosition(this._state),e.updateAllViews()),this._drawSource(e,t))},o.prototype._drawSource=function(t,e){var i,o,n,r,s=t.paneViews(this._state);if(s)for(i=this._state.height(),o=this._state.width(),n=0;n<s.length;n++)(r=s[n].renderer(i,o))&&(e.save(),r.draw(e),e.restore())},o.prototype._drawSourceStrategyOrders=function(t,e){var i,o=t._strategyOrdersPaneView;o&&(i=o.renderer())&&(e.save(),i.draw(e),e.restore())},o.prototype._drawSourceBackground=function(t,e){var i,o,n,r,s=t.paneViews(this._state);if(s)for(i=this._state.height(),o=this._state.width(),n=0;n<s.length;n++)(r=s[n].renderer(i,o))&&r.drawBackground&&(e.save(),r.drawBackground(e),e.restore())},o.prototype.drawActiveLineTool=function(t){var e,i,o=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(e=0;e<o.length;e++)(i=o[e])&&this._chart.model().paneForSource(i)===this._state&&this._drawSource(i,t)},o.prototype.disableDrawOnTop=function(t){return t&&t.hasOwnProperty("_metaInfo")&&"Volume@tv-basicstudies"===t._metaInfo.id},o.prototype.drawSources=function(t){
var e,i,o,n,r,s=this._state.orderedSources(),a=this._state.model(),l=this._chart.model().selectedSource(),c=this._chart.model().hoveredSource(),h=a.crossHairSource(),u=[this._chart.model().lineBeingCreated(),this._chart.model().sourceBeingMoved(),this._chart.model().lineBeingEdited()];for(this.disableDrawOnTop(l)&&(l=void 0),this.disableDrawOnTop(c)&&(c=void 0),e=this._chart.model().model().panes(),i=e.length-1;i>=0;i--)e[i].createDrawingsCaches();for(i=0;i<s.length;i++)this._drawSourceBackground(s[i],t);for(i=0;i<s.length;i++)(o=s[i])!==h&&o!==l&&o!==c&&-1===u.indexOf(o)&&this._drawSource(o,t);for(n=null,l&&-1===u.indexOf(l)&&-1!==s.indexOf(l)&&(n=l,this._drawSource(l,t)),c&&c!==n&&-1===u.indexOf(c)&&-1!==s.indexOf(c)&&this._drawSource(c,t),r=this._chart.model().activeStrategySource().value(),r&&this.containsMainSeries()&&this._drawSourceStrategyOrders(r,t),i=e.length-1;i>=0;i--)e[i].clearDrawingCaches()},o.prototype.recalculatePriceScale=function(){var t,e,i,o=this._state;for(o.recalculatePriceScale(o.m_rightPriceScale),o.recalculatePriceScale(o.m_leftPriceScale),t=o.dataSources(),e=0;e<t.length;++e)i=t[e],o.isOverlay(i)&&(i instanceof d||o.recalculatePriceScale(i.priceScale()),i.updateAllViews())},o.prototype.containsMainSeries=function(){return this._state.containsMainSeries()},o.prototype.drawBarsMarks=function(t,e){var i,o;this.containsMainSeries()&&!e&&(i=this._chart.model().barsMarksSources(),o=this,i.forEach(function(e){o._drawSource(e,t)}))},o.prototype._syncOverlays=function(){var t,e,i=this._state.orderedSources(),o={},n=this;$.each(i,function(){var t,e,i=this.paneViews(n._state);if(i)for(t=0;t<i.length;t++)e=i[t],e.uid&&(o[e.uid()]=e)});for(t in this._overlays)o[t]||(this._dv.remove(this._overlays[t]),this._overlays[t]=void 0);for(t in o)this._overlays[t]||(e=o[t].overlay(),this._dv.append(e),this._overlays[t]=e)},o.prototype.hardResetCanvas=function(){this.size&&(E(this.canvas,this.size),E(this.top_canvas,this.size),this.lhsPriceAxisWidget.hardResetCanvas(),this.rhsPriceAxisWidget.hardResetCanvas())},o.prototype.paint=function(t,e){if(t&&this._chart.model())if(this.lhsPriceAxisWidget.paint(t),this.rhsPriceAxisWidget.paint(t),t===I.FULL_UPDATE&&(this._cachedStatus=null),t===I.UPDATE_CURSOR_ONLY)this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx);else{var i=this.ctx;this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),this.drawBackground(i,this.backgroundColor()),this._state&&(this.recalculatePriceScale(),this.drawGrid(i),this.drawWatermark(i),this.drawSources(i),this.drawBarsMarks(i,e),this.drawCrossHair(this.top_ctx),this.drawActiveLineTool(this.top_ctx),this.drawBranding(i))}},o.prototype.leftPriceAxisWidget=function(){return this.lhsPriceAxisWidget},o.prototype.rightPriceAxisWidget=function(){return this.rhsPriceAxisWidget},o.prototype._priceAxisWidget=function(t){return l.isLeft(t)?this.lhsPriceAxisWidget:this.rhsPriceAxisWidget},o.prototype.statusWidget=function(){return this.legendWidget},
o.prototype.onScaleLeft=function(t){var e=t.callbackContext();-1===this._state.leftPriceScale().dataSources().indexOf(e)&&this.chart().model().move(e,this._state,this._state.leftPriceScale())},o.prototype.onScaleRight=function(t){var e=t.callbackContext();-1===this._state.rightPriceScale().dataSources().indexOf(e)&&this.chart().model().move(e,this._state,this._state.rightPriceScale())},o.prototype.onNoScale=function(t){var e=t.callbackContext();this._state.isOverlay(e)||this.chart().model().move(e,this._state,null)},o.prototype.onRiskReward=function(t){},o.prototype.createActionRiskReward=function(t){var e=new S({checkable:!1,text:window.t("Risk/Reward"),enabled:!0,statName:"RiskReward"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onRiskReward),e},o.prototype.createActionScaleLeft=function(t){var e=new S({checkable:!0,text:window.t("Scale Left"),enabled:!0,statName:"ToggleScaleLeft"});return e.setCallbackContext(t),e.setChecked(-1!==this._state.leftPriceScale().dataSources().indexOf(t)),e.callbacks().subscribe(this,o.prototype.onScaleLeft),e},o.prototype.createActionScaleRight=function(t){var e=new S({checkable:!0,text:window.t("Scale Right"),enabled:!0,statName:"ToggleScaleRight"});return e.setCallbackContext(t),e.setChecked(-1!==this._state.rightPriceScale().dataSources().indexOf(t)),e.callbacks().subscribe(this,o.prototype.onScaleRight),e},o.prototype.createActionNoScale=function(t){var e=this._chart.model().paneForSource(t),i=e.actionNoScaleIsEnabled(t),n=new S({checkable:!0,text:window.t("Screen (No Scale)"),enabled:i,statName:"ToggleNoScale"});return n.setCallbackContext(t),n.setChecked(this._state.isOverlay(t)),n.callbacks().subscribe(this,o.prototype.onNoScale),n},o.prototype.createActionShowCountdown=function(t){var e=new S({checkable:!0,text:window.t("Show Countdown"),enabled:!0,statName:"ToggleShowCountdown"}),i=this._chart.model().mainSeries().properties();return e._binding=new v(e,i.showCountdown,this._chart.model(),e.text),e._binding.setValue(i.showCountdown.value()),e},o.prototype.createActionLockScale=function(t){var e,i,o;return t instanceof TradingView.Series?(e=c(t.priceScale(),this._chart.model().model().mainSeriesScaleRatio()),i=new S({checkable:t.priceScale().isLockScale(),text:window.t("Lock Scale")+" "+e,enabled:!0,statName:"LockScale"}),o=function(e){this._undoModel.setLockScaleProperty(this._property,e.checked,t,this._undoText)},i._binding=new v(i,t.priceScale().properties().lockScale,this._chart.model(),"Lock Scale",o),i):null},o.prototype.createActionMergeUp=function(t){if(!this._chart.model().model().isMergeUpAvailableForSource(t))return null;var e=new S({checkable:!1,text:window.t("Merge Up"),enabled:!0,statName:"MergeUp"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onMergeUp),e},o.prototype.onMergeUp=function(t){var e=t.callbackContext();this._chart.model().mergeSourceUp(e)},o.prototype.createActionUnmergeUp=function(t){if(!this._chart.model().model().isUnmergeAvailableForSource(t))return null;var e=new S({checkable:!1,
text:window.t("Unmerge Up"),enabled:!0,statName:"UnmergeUp"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onUnmergeUp),e},o.prototype.onUnmergeUp=function(t){var e=t.callbackContext();this._chart.model().unmergeSourceUp(e)},o.prototype.createActionMergeDown=function(t){if(!this._chart.model().model().isMergeDownAvailableForSource(t))return null;var e=new S({checkable:!1,text:window.t("Merge Down"),enabled:!0,statName:"MergeDown"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onMergeDown),e},o.prototype.onMergeDown=function(t){var e=t.callbackContext();this._chart.model().mergeSourceDown(e)},o.prototype.createActionUnmergeDown=function(t){if(!this._chart.model().model().isUnmergeAvailableForSource(t))return null;var e=new S({checkable:!1,text:window.t("Unmerge Down"),enabled:!0,statName:"UnmergeDown"});return e.setCallbackContext(t),e.callbacks().subscribe(this,o.prototype.onUnmergeDown),e},o.prototype.onUnmergeDown=function(t){var e=t.callbackContext();this._chart.model().unmergeSourceDown(e)},o.prototype._mergeContentMenuItems=function(t){var e=[],i=this.createActionMergeUp(t);return i&&e.push(i),i=this.createActionUnmergeUp(t),i&&e.push(i),i=this.createActionMergeDown(t),i&&e.push(i),i=this.createActionUnmergeDown(t),i&&e.push(i),e},o.prototype.createActionShow=function(t){var e=new S({checkable:!0,text:window.t("Show"),enabled:!0,statName:"ToggleShow"});return e._binding=new v(e,t.properties().visible,this._chart.model(),e.text),e._binding.setValue(t.properties().visible.value()),e},o.prototype.createActionAddChildStudy=function(t){var e=new S({text:window.t("Apply Indicator on {0} ...").format(t.title(!0)),enabled:!0,statName:"ApplyIndicator"});return e.callbacks().subscribe(this,function(){var e,i,o=this._chart.showIndicators(t);o&&(e=function(){f("SOS","Apply SOS","Apply by RC menu")},i=this._chart.model().model().studyInserted(),i.subscribe(this,e),o.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))}),e},o.prototype.bringObjectForward=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().changeZOrder(e,1)},o.prototype.sendObjectToBack=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().sendToBack(e)},o.prototype.bringObjectToFront=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().bringToFront(e)},o.prototype.sendObjectBackward=function(t){var e=this._chart.model().selectedSource();e&&this._chart.model().changeZOrder(e,-1)},o.prototype.createVisualOrderAction=function(t){var e,i,n,r,s,a,l=new S({text:window.t("Visual Order"),statName:"VisualOrder"});return l.subActions||(l.subActions=[]),e=new S({text:window.t("Bring to Front"),statName:"BringToFront"}),e.callbacks().subscribe(this,o.prototype.bringObjectToFront),l.subActions.push(e),i=new S({text:window.t("Send to Back"),statName:"SendToBack"}),i.callbacks().subscribe(this,o.prototype.sendObjectToBack),l.subActions.push(i),n=new S({text:window.t("Bring Forward"),statName:"BringForward"}),
n.callbacks().subscribe(this,o.prototype.bringObjectForward),l.subActions.push(n),r=new S({text:window.t("Send Backward"),statName:"SendBackward"}),r.callbacks().subscribe(this,o.prototype.sendObjectBackward),l.subActions.push(r),s=this._chart.model().paneForSource(t),a=s.getZOrderMinMax(),i.setEnabled(!0),n.setEnabled(!0),r.setEnabled(!0),e.setEnabled(!0),t.zorder()===a.minZOrder&&(i.setEnabled(!1),r.setEnabled(!1)),t.zorder()===a.maxZOrder&&(n.setEnabled(!1),e.setEnabled(!1)),l},o.prototype.image=function(){var t={};return t.leftAxis=this.leftPriceAxisWidget().image(),t.rightAxis=this.rightPriceAxisWidget().image(),t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t},o.prototype._updateTooltip=function(t,e){if(!this._rafSet){var i=this;requestAnimationFrame(function(){i._updateTooltipImpl(t,e),i._rafSet=!1}),this._rafSet=!0}},o.prototype._updateTooltipImpl=function(t,e){function i(i){function n(){return TradingView.isMobile.any()?{left:t-o._tooltipSelector.outerWidth()-16,top:e-o._tooltipSelector.outerHeight()-16}:{left:t+16,top:e+16}}TradingView[r].getTooltipText&&(i=TradingView[r].getTooltipText(l)||i),o._tooltipSelector.html(i).removeClass("tooltip-selector-hidden").css(n())}var o,n,r,a,l,c;if(this._chart){for(o=this,n=this._chart.paneWidgets(),r=x.tool.value(),a=this._state.model(),l=a.lineBeingCreated(),c=n.length-1;c>=0;c--)n[c]._hideTooltip();this._isSelectBarModeEnabled()||(s.isStudyLineTool(r)&&!TradingView.isMobile.any()?i(window.t("Click to set a point")):TradingView.isMobile.any()&&"LineToolBrush"!==r&&o.isLineTool(r)&&!o._chart.model().lineBeingCreated()?i(window.t("1. Slide your finger to select location for first anchor<br>2. Tap anywhere to place the first anchor")):TradingView.isMobile.any()&&"LineToolBrush"!==r&&o.isLineTool(r)&&i(window.t("1. Slide your finger to select location for next anchor<br>2. Tap anywhere to place the next anchor")))}},o.prototype._hideTooltip=function(){this._tooltipSelector.addClass("tooltip-selector-hidden")},o.prototype._updateCrosshairOnZoom=function(){var t,e;x.lockTimeAxis().value()&&(t=this._chart.model(),e=t.crossHairSource(),e.setPosition(e.index,e.price,this._state))},o.prototype._isSelectBarModeEnabled=function(){return this._chart.model().crossHairSource().selectBarMode().value()},t.exports=o}).call(e,i(5))},function(t,e){},function(t,e,i){"use strict";function o(t,e){this._source=e,this._properties=t,this._points=[new l(-1,-1)],this._invalidated=!0,this._lineRenderer=new h}function n(){this._data=null}function r(t){this._source=t,this._points=[],this._bandBgRenderer=new n}function s(t,e,i){this._source=t,this._points=[],a(e.type===u.FilledArea.TYPE_HLINES,"Wrong filledArea type: "+e.type),this._initBandIndexes(e.objAId,e.objBId),this._fillStyleProps=i,this._bandBgRenderer=new n}var a=i(9).assert,l=i(8).Point,c=i(54).clamp,h=i(94).HorizontalLineRenderer,u=i(33),d=i(30);o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e=this._source.priceScale()
;if(!e||e.isEmpty())return void(this._points[0]=new l(-1,-1));t=this._properties.value.value(),isNumber(t)?this._points[0]=new l(-1,e.priceToCoordinate(t)):this._points[0]=new l(-1,NaN)},o.prototype.renderer=function(){this._invalidated&&(this.updateImpl(),this._invalidated=!1);var t={};return t.width=this._source.model().timeScale().width(),t.height=this._source.priceScale().height(),t.points=this._points,t.color=this._properties.color.value(),t.linewidth=this._properties.linewidth.value(),t.linestyle=this._properties.linestyle.value(),this._lineRenderer.setData(t),this._lineRenderer},n.prototype.setData=function(t){this._data=t},n.prototype.draw=function(t){var e,i,o;null!==this._data&&0!==this._data.points.length&&(e=t.canvas.width,t.fillStyle=d.generateColor(this._data.backcolor,this._data.transparency),i=Math.min(this._data.points[0],this._data.points[1]),o=Math.max(this._data.points[0],this._data.points[1]),t.fillRect(0,i,e,o-i))},n.prototype.hitTest=function(t){return null},r.prototype.update=function(){var t,e,i,o;this._points=[],t=this._source.properties().bandsBackground,t.fillBackground.value()&&(e=this._source.properties().bands[0],i=this._source.properties().bands[1],(o=this._source.priceScale())&&!o.isEmpty()&&(this._points.push(o.priceToCoordinate(e.value.value())),this._points.push(o.priceToCoordinate(i.value.value()))))},r.prototype.renderer=function(){var t={};return t.points=this._points,t.backcolor=this._source.properties().bandsBackground.backgroundColor.value(),t.transparency=this._source.properties().bandsBackground.transparency.value(),this._bandBgRenderer.setData(t),this._bandBgRenderer},s.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},s.prototype.update=function(){var t,e,i;this._points=[],this._fillStyleProps.visible.value()&&(t=this._source.properties().bands[this._bandAKey],e=this._source.properties().bands[this._bandBKey],(i=this._source.priceScale())&&!i.isEmpty()&&(this._points.push(i.priceToCoordinate(t.value.value())),this._points.push(i.priceToCoordinate(e.value.value()))))},s.prototype.renderer=function(){var t,e=this._fillStyleProps.transparency.value();return e=c(e,0,100),t={},t.points=this._points,t.backcolor=d.generateColor(this._fillStyleProps.color.value(),e),t.transparency=this._fillStyleProps.transparency.value(),this._bandBgRenderer.setData(t),this._bandBgRenderer},e.BandPaneView=o,e.BandBackgroundPaneView=r,e.HlineFillPaneView=s},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(30),r=function(){function t(t){this.setData(t)}return t.prototype.setData=function(t){this._data=o.__assign({},t)},t.prototype.draw=function(t,e){var i,o,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;this._data.visible&&(i=e.fontSize,t.font=e.font,o=e.tickLength,r=e.borderSize,s=e.paddingTop,a=e.paddingBottom,l=e.paddingInner,
c=e.paddingOuter,h=Math.ceil(e.widthCache.measureText(t,this._data.text)),u=e.baselineOffset,d=e.fontSize+s+a,p=r+h+l+c+o,_=this._data.coordinate,this._data.fixedCoordinate&&(_=this._data.fixedCoordinate),f=_-Math.floor(i/2)-s-.5,m=f+d,g=e.isLeft?e.width-r-.5:.5,v=g,t.fillStyle=n.resetTransparency(this._data.background),t.lineWidth=1,this._data.text&&(e.isLeft?(v=g-p,y=g-o,b=v+c):(v=g+p,y=g+o,b=g+r+o+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.beginPath(),t.strokeStyle=this._data.color,t.moveTo(g,_),t.lineTo(y,_),t.stroke(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.text,b,m-a-u)),this._data.secondLine&&(S=Math.ceil(e.widthCache.measureText(t,this._data.secondLine)),w=S+l+c,t.fillStyle=n.resetTransparency(this._data.background),this._data.text&&(f+=d+1,m+=d+1),e.isLeft?(v=Math.min(v,e.width-o),g=v+w,b=v+c):(g=Math.max(v-w,r),v=g+w,b=g+l),t.beginPath(),t.moveTo(g,f),t.lineTo(v,f),t.lineTo(v,m),t.lineTo(g,m),t.fill(),t.textAlign="left",t.fillStyle=this._data.color,t.fillText(this._data.secondLine,b,m-a-u)))},t.prototype.height=function(t,e){var i=t.fontSize+t.paddingTop+t.paddingBottom;return this._data.secondLine&&e?2*i+1:i},t}(),e.PriceAxisViewRenderer=r},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.histogramBase=t.histogramBase,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth}var n=i(8).Point,r=i(44).distanceToSegment,s=i(45).selectionTolerance,a=i(11);o.prototype.draw=function(t){var e,i,o,n,r;for(t.translate(.5,.5),t.fillStyle=this.lineColor,e=this.lineWidth,i=0;i<this.items.length;++i)o=this.items[i],n=o.x,r=o.y,o.style&&(t.fillStyle=o.style.color,e=o.style.width),t.fillRect(Math.round(n-.5*e),r,e,this.histogramBase-r)},o.prototype.hitTest=function(t){var e,i,o,l,c,h=s(this.lineWidth);for(c=0;c<this.items.length;++c)if(e=this.items[c],i=e.x,o=e.y,l=r(new n(i,o),new n(i,this.histogramBase),new n(t.x,t.y)),l.distance<=h)return new a(a.REGULAR);return null},e.PaneRendererHistogram=TradingView.PaneRendererHistogram=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.histogramBase=t.histogramBase,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth}var n=i(11);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p;if(0!==this.items.length){for(e=this.barSpacing,i=this.lineColor,o=this.histogramBase,t.translate(.5,.5),n={},r=this.items,s=0;s<r.length;++s)a=r[s],l=0===s?null:r[s-1],c=a.style?a.style.color:i,h=n[c]||[],h.push({item:a,prev:l}),n[c]=h;for(c in n){for(h=n[c],t.fillStyle=c,t.strokeStyle=c,t.lineWidth=1,t.beginPath(),s=0;s<h.length;s++)a=h[s].item,u=Math.ceil(a.x-.5*e),d=Math.ceil(u+e),p=a.y,t.rect(u,p,d-u,o-p);for(t.fill(),t.beginPath(),s=0;s<h.length;s++)a=h[s].item,u=Math.ceil(a.x-.5*e),d=Math.ceil(u+e),p=a.y,l=h[s].prev,t.moveTo(d-.5,o),t.lineTo(d-.5,p+.5),t.lineTo(u+.5,p+.5),l&&l.y>p&&t.lineTo(u+.5,l.y);t.stroke()}}},o.prototype.hitTest=function(t){var e,i,o,r=.5*this.barSpacing+this.lineWidth,s=t.x-r,a=t.x+r,l=this.items
;for(e=l.length;e--;)if((i=l[e].x)>=s&&i<=a&&(o=l[e].y,t.y>=Math.min(o,this.histogramBase)&&t.y<=Math.max(o,this.histogramBase)))return new n(n.REGULAR);return null},e.PaneRendererColumns=TradingView.PaneRendererColumns=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor,this.lineWidth=t.lineWidth,this.lineStyle=t.lineStyle}var n=i(8).Point,r=i(44).distanceToSegment,s=i(45).selectionTolerance,a=i(11);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c=!1;for(o=0;o<this.items.length;++o)n=this.items[o],r=n.x,s=n.y,TradingView.isNaN(r)||TradingView.isNaN(s)||(null!=n.style?(a=n.style.color,e=n.style.width):(a=this.lineColor,e=this.lineWidth),a!==i&&(i=a,c&&t.fill(),t.beginPath(),t.fillStyle=a),l=3*e,t.rect(r-l/2,s-e/2,l,e),t.rect(r-e/2,s-l/2,e,l),c=!0);c&&t.fill()},o.prototype.hitTest=function(t){var e,i,o,l,c,h,u=s(this.lineWidth);for(h=1;h<this.items.length;++h)if(e=this.items[h-1],i=this.items[h],o=e.x,l=i.x,c=r(new n(o,e.y),new n(l,i.y),new n(t.x,t.y)),c.distance<=u)return new a(a.REGULAR);return null},e.PaneRendererCross=TradingView.PaneRendererCross=o},function(t,e,i){"use strict";function o(t){this.items=t.items,this.barSpacing=t.barSpacing,this.lineColor=t.lineColor||t.color,this.radius=t.lineWidth||t.height/2,this.vertOffset=t.vertOffset||0}var n=i(8).Point,r=i(45).selectionTolerance,s=i(11);o.prototype.draw=function(t){var e,i,o,n,r,s,a,l=2*Math.PI,c=!1;for(o=0;o<this.items.length;++o)n=this.items[o],r=n.x,s=n.y+this.vertOffset,TradingView.isNaN(r)||TradingView.isNaN(s)||(null!=n.style?(a=n.style.color,e=n.style.width):(a=this.lineColor,e=this.radius),a!==i&&(i=a,c&&t.fill(),t.beginPath(),t.fillStyle=a),t.moveTo(r+e,s),t.arc(r,s,e,0,l,!1),c=!0);c&&t.fill()},o.prototype.hitTest=function(t){var e,i,o,a=2*this.radius,l=this.vertOffset,c=r(a);for(e=0;e<this.items.length;++e)if((i=this.items[e])&&(o=new n(i.x,i.y+l),o.subtract(t).length()+this.radius<=c))return new s(s.REGULAR);return null},e.PaneRendererCircles=TradingView.PaneRendererCircles=o},function(t,e,i){"use strict";function o(t){this._items=t.items,this._y=t.y,this._h=t.h,this._w=t.w}o.prototype.draw=function(t){},o.prototype.drawBackground=function(t){var e,i,o;for(t.save(),t.translate(-.5,-.5),e=0;e<this._items.length;++e)i=this._items[e],null!=i.color&&(t.fillStyle=i.color,o=e===this._items.length-1?this._w:this._items[e+1].x-i.x,t.fillRect(i.x,this._y,o,this._h));t.restore()},o.prototype.hitTest=function(t){return null},e.PaneRendererBackground=TradingView.PaneRendererBackground=o},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(11),n=i(8),r=i(90),s=i(86),a=i(44),l=i(45),c=function(){function t(){this._data=null}return t.prototype.setData=function(t){this._data=t},t.prototype.draw=function(t){var e,i,o,n,s,a,l,c,h,u;if(null!==this._data&&0!==this._data.items.length){for(e=this._data,i=e.lineWidth,o=e.lineStyle,n=e.lineColor,s=e.items,t.save(),t.lineCap="square",t.strokeStyle=n,t.lineWidth=i,i%2==0&&t.translate(-.5,-.5),
void 0!==o&&r.setLineStyle(t,o),t.beginPath(),t.moveTo(s[0].x,s[0].y),a=s.length,l=0;l<a;l++)c=s[l],t.lineTo(c.x,c.y),(h=s[l+1])&&(u=Math.round((c.x+h.x)/2),t.lineTo(u,c.y),t.lineTo(u,h.y));t.stroke(),t.restore()}},t.prototype.hitTest=function(t){var e,i,r,c,h,u,d,p,_,f,m,g,v;if(null===this._data||0===this._data.items.length)return null;for(e=this._data,i=e.items,r=e.lineWidth,c=l.selectionTolerance(r),h=s.lowerbound(i,t,function(t,e){return t.x<=e.x}),u=Math.max(0,h-1),d=Math.min(i.length-1,h+1),p=u;p<d;p++)if(_=i[p],(f=i[p+1])&&(m=Math.round((_.x+f.x)/2),g=new n.Point(m,_.y),v=new n.Point(m,f.y),Math.min(a.distanceToSegment(_,g,t).distance,a.distanceToSegment(g,v,t).distance,a.distanceToSegment(v,f,t).distance)<=c))return new o(o.REGULAR);return null},t}(),e.PaneRendererStepLine=c},function(t,e,i){"use strict";function o(t,e){var i=function i(o){var n=i.cache,r=""+(e?e.apply(this,arguments):o);return n.hasOwnProperty(r)||(n[r]=t.apply(this,arguments)),n[r]};return i.cache={},i}Object.defineProperty(e,"__esModule",{value:!0}),e.default=o,t.exports=e.default},function(t,e,i){"use strict";function o(t){s.call(this,t),this.width=this._calculateWidth(t.barSpacing),this._isUp=!1}function n(t){o.call(this,t),this._isUp=!0}function r(t){o.call(this,t),this._isUp=!1}var s=i(56).PaneRendererAbstractShape;inherit(o,s),o.prototype._calculateWidth=function(t){return t=t||this.barSpacing,Math.round(t/4)},o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=this.width,u=Math.abs(this.height),d=h<4,p=Math.max(parseInt(h/2),1),_=Math.round(this.width/2),f=Math.round(this.width),m=this._isUp?-1:1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],r=n.x,s=n.y+this._vertOffset+m*Math.round(u/2),n.style&&null!=n.style.color?(a=n.style.color,l=n.style.borderColor):(a=this._color,l=this._borderColor),a!==e&&(e=a,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=a,t.strokeStyle=l),t.translate(r,s),d?(t.moveTo(0,0),t.lineTo(-_,-_*m),t.moveTo(0,0),t.lineTo(_,-_*m),t.moveTo(0,0),t.lineTo(0,-u*m),t.moveTo(-_,-u*m),t.lineTo(_,-u*m),t.lineWidth=p):(t.moveTo(0,0),u<f?(t.lineTo(h,-u*m),t.lineTo(-h,-u*m)):(t.lineTo(h,-f*m),t.lineTo(_,-f*m),t.lineTo(_,-u*m),t.lineTo(-_,-u*m),t.lineTo(-_,-f*m),t.lineTo(-h,-f*m)),t.lineTo(0,0)),t.translate(-r,-s),c=!0;c&&(t.fill(),t.stroke())},inherit(n,o),inherit(r,o),e.PaneRendererArrowBase=TradingView.PaneRendererArrowBase=o,e.PaneRendererArrowUp=TradingView.PaneRendererArrowUp=n,e.PaneRendererArrowDown=TradingView.PaneRendererArrowDown=r},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(56).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=Math.max(this.width,this.height)/2,h=this._vertOffset,u=2*Math.PI,d=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,d&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x,l=n.y+h,t.moveTo(a+c,l),t.arc(a,l,c,0,u,!1),d=!0;d&&(t.fill(),t.stroke())},
e.PaneRendererCircleShape=TradingView.PaneRendererCircleShape=o},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(56).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c,h,u;for(t.lineWidth=2,e=this.width,i=this.height,o=this._vertOffset,r=!1,s=0,a=this.items.length;s<a;s++)l=this.items[s],c=l.style&&null!=l.style.color?l.style.color:this._color,c!==n&&(n=c,r&&t.stroke(),t.beginPath(),t.strokeStyle=c),h=l.x-e/2,u=l.y-i/2+o,t.moveTo(h+e/2,u),t.lineTo(h+e/2,u+i),t.moveTo(h,u+i/2),t.lineTo(h+e,u+i/2),r=!0;r&&t.stroke()},e.PaneRendererCrossShape=TradingView.PaneRendererCrossShape=o},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(56).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=Math.round(this.height/2);for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x,l=n.y+this._vertOffset,t.moveTo(a,l-h),t.lineTo(a+h,l),t.lineTo(a,l+h),t.lineTo(a-h,l),t.lineTo(a,l-h),c=!0;c&&(t.fill(),t.stroke())},e.PaneRendererDiamond=TradingView.PaneRendererDiamond=o},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(56).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=this.width,h=this.height,u=h/2,d=this._vertOffset,p=3,_=(c-p)/3,f=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,f&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x-c/2,l=n.y-u+d,t.moveTo(a,l),t.lineTo(a+p,l),t.bezierCurveTo(a+_,l-_,a+2*_,l+_,a+c,l),t.lineTo(a+c,l+u),t.bezierCurveTo(a+c-_,l+u+_,a+c-2*_,l+u-_,a+p,l+u),t.lineTo(a+p,l+h),t.lineTo(a,l+h),t.lineTo(a,l),f=!0;f&&(t.fill(),t.stroke())},e.PaneRendererFlagShape=TradingView.PaneRendererFlagShape=o},function(t,e,i){"use strict";function o(t,e){l.call(this,t),this._isUp=e,this._stepX=Math.round(this.height/2*.65)+.5,this._stepY=Math.round(this.height/2)+.5,this._textCache?(this._padding=this._stepX/2,this._shapeWidth=this._textImageWidth+2*this._stepX,this._shapeHeight=this._textImageHeight+2*this._padding+this._stepY,0===this._vertOffset?this._isUp?this._textVertOffset=this._stepY+this._padding+this._textImageHeight:this._textVertOffset=-this._stepY-this._padding:this._textVertOffset=this._vertOffset>0?this._stepY+this._padding:-this._stepY-this._padding):(this._padding=0,this._shapeWidth=2*this._stepX,this._shapeHeight=2.5*this._stepY)}function n(t){o.call(this,t,!0)}function r(t){o.call(this,t,!1)}var s=i(8).Point,a=i(11),l=i(56).PaneRendererAbstractShape;inherit(o,l),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=this._isUp?1:-1,u=Math.round(this._shapeWidth/2)-.5,d=Math.round(this._shapeHeight)-.5,p=0
;for(0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(p=-h*Math.round(d+this._stepY)),i=0,o=this.items.length;i<o;i++)n=this.items[i],r=n.x+.5,s=n.y+this._vertOffset+p+.5,n.style&&null!=n.style.color?(a=n.style.color,l=n.style.borderColor):(a=this._color,l=this._borderColor),a!==e&&(e=a,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=a,t.strokeStyle=l),t.translate(r,s),t.moveTo(0,0),t.lineTo(this._stepX,this._stepY*h),t.lineTo(u,this._stepY*h),t.lineTo(u,d*h),t.lineTo(-u,d*h),t.lineTo(-u,this._stepY*h),t.lineTo(-this._stepX,this._stepY*h),t.lineTo(0,0),t.translate(-r,-s),c=!0;c&&(t.fill(),t.stroke())},o.prototype.hitTest=function(t,e){var i,o,n,r,l,c,h,u,d,p,_,f,m,g,v=this._stepY/2,y=this._vertOffset,b=this._isUp?1:-1;for(o=0;o<this.items.length;++o)if(n=this.items[o]){if(r=b*v,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(r=-b*(this._shapeHeight+v)),i=new s(n.x,n.y+y+r),i.subtract(t).length()<=v)return new a(a.REGULAR);if(l=this._shapeWidth/2,r=0,0!==this._vertOffset&&this._vertOffset<0===this._isUp&&(r=-b*(this._shapeHeight+this._stepY)),c=n.y+y+r,h=this._isUp?this._stepY:-this._shapeHeight,u=this._isUp?this._shapeHeight:-this._stepY,d=t.x,p=t.y,_=n.x-l,f=c+h,m=n.x+l,g=c+u,d>_&&d<m&&p>f&&p<g)return new a(a.REGULAR)}return null},inherit(n,o),inherit(r,o),e.PaneRendererLabelBase=TradingView.PaneRendererLabelBase=o,e.PaneRendererLabelUp=TradingView.PaneRendererLabelUp=n,e.PaneRendererLabelDown=TradingView.PaneRendererLabelDown=r},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(56).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=!1,h=Math.round(this.height/2);for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,c&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x-h,l=n.y+this._vertOffset-h,t.rect(a,l,this.height,this.height),c=!0;c&&(t.fill(),t.stroke())},e.PaneRendererSquare=TradingView.PaneRendererSquare=o},function(t,e,i){"use strict";function o(t){s.call(this,t)}function n(t){s.call(this,t)}function r(t){s.call(this,t)}var s=i(56).PaneRendererAbstractShape;inherit(o,s),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=this.width,h=this.height,u=Math.round(h/3),d=this._vertOffset-2*u,p=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,p&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,t.strokeStyle=s),a=n.x,l=n.y+d,t.moveTo(a,l),t.lineTo(a+c/2,l+h),t.lineTo(a-c/2,l+h),t.lineTo(a,l),p=!0;p&&(t.fill(),t.stroke())},inherit(n,s),n.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c=this.width,h=this.height,u=Math.round(h/3),d=this._vertOffset-u,p=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],n.style&&null!=n.style.color?(r=n.style.color,s=n.style.borderColor):(r=this._color,s=this._borderColor),r!==e&&(e=r,p&&(t.fill(),t.stroke()),t.beginPath(),t.fillStyle=r,
t.strokeStyle=s),a=n.x-c/2,l=n.y+d,t.moveTo(a,l),t.lineTo(a+c,l),t.lineTo(a+c/2,l+h),t.lineTo(a,l),p=!0;p&&(t.fill(),t.stroke())},inherit(r,s),r.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l=this.width,c=this.height,h=this._vertOffset,u=!1;for(i=0,o=this.items.length;i<o;i++)n=this.items[i],r=n.style&&null!=n.style.color?n.style.color:this._color,r!==e&&(e=r,u&&t.fill(),t.beginPath(),t.fillStyle=r),s=n.x+l/2,a=n.y-c/2+h,t.moveTo(s,a),t.lineTo(s,a+c),t.lineTo(s-l,a+c/2),t.lineTo(s,a),u=!0;u&&t.fill()},e.PaneRendererTriangleApexUp=TradingView.PaneRendererTriangleApexUp=o,e.PaneRendererTriangleApexDown=TradingView.PaneRendererTriangleApexDown=n,e.PaneRendererTriangleApexLeft=TradingView.PaneRendererTriangleApexLeft=r},function(t,e,i){"use strict";function o(t){n.call(this,t)}var n=i(56).PaneRendererAbstractShape;inherit(o,n),o.prototype.drawShape=function(t){var e,i,o,n,r,s,a,l,c,h,u;for(t.lineWidth=2,e=this.width,i=this.height,o=this._vertOffset,r=!1,s=0,a=this.items.length;s<a;s++)l=this.items[s],c=l.style&&null!=l.style.color?l.style.color:this._color,c!==n&&(n=c,r&&t.stroke(),t.beginPath(),t.strokeStyle=c),h=l.x-e/2,u=l.y-i/2+o,t.moveTo(h,u),t.lineTo(h+e,u+i),t.moveTo(h,u+i),t.lineTo(h+e,u),r=!0;r&&t.stroke()},e.PaneRendererXCross=TradingView.PaneRendererXCross=o},function(t,e,i){"use strict";function o(){this._data=null}function n(t){this._source=t,this._points1=[],this._points2=[],this._timePoints=[],this._getBarSpacing=t.model().timeScale().barSpacing.bind(t.model().timeScale()),this._invalidated=!0,this._areaRenderer=new o}function r(t){n.call(this,t)}function s(t,e,i){var o,r;if(n.call(this,t),this._isHlineFill=e.type===h.FilledArea.TYPE_HLINES,a(this._isHlineFill||e.type===h.FilledArea.TYPE_PLOTS,"Wrong filledArea type: "+e.type),this._isHlineFill&&this._initBandIndexes(e.objAId,e.objBId),this._fillMetaInfo=e,this._fillStyleProps=i,o=t._metaInfo,e.palette)for(r in o.plots)if(o.plots[r].palette===e.palette){this._colorPlotOffset=parseInt(r),this._colorsMap=o.palettes[e.palette].valToIndex,this._colorValues=t.properties().palettes[e.palette].colors;break}}var a=i(9).assert,l=i(11),c=i(45).coordinateIsValid,h=i(33),u=i(30),d=i(54).clamp,p=i(19).PlotRowSearchMode;o.prototype.setData=function(t){this._data=t},o.prototype.hitTest=function(t){var e,i,o;if(null===this._data)return null;for(o=1;o<this._data.points1.length;++o)if(e=this._data.points1[o],i=this._data.points2[o],this._data.timePoints[o]===t.x&&(t.y>=e&&t.y<=i||t.y<=e&&t.y>=i))return new l(l.REGULAR);return null},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,h,d,p,_,f,m,g,v,y,b;if(null!==this._data&&((e=this._data.isHlineFill)||0!==this._data.points1.length&&0!==this._data.points2.length)){for(i=this._data.timePoints,o=this._data.points1,n=this._data.points2,r=this._data.colors,s=isNumber(this._data.transparency)?this._data.transparency:50,s=Math.min(s,100),s=Math.max(s,0),a={},l=[],d=0;d<this._data.timePoints.length;d++)p={point1:e?this._data.level1:o[d],point2:e?this._data.level2:n[d],timePoint:i[d]},_=c(p.point1)&&c(p.point2),
_&&(h=r&&r[d]?r[d]:this._data.backcolor,l.push(p)),(d===this._data.timePoints.length-1||r&&h!==r[d+1]||!_)&&(l.length>0&&(f=a[h]||[],f.push(l),a[h]=f),l=_?[p]:[]);for(m in a){for(g=a[m],t.beginPath(),v=0;v<g.length;v++){for(y=g[v],t.moveTo(y[0].timePoint,y[0].point1),b=1;b<y.length;b++)t.lineTo(y[b].timePoint,y[b].point1);for(b=y.length-1;b>=0;b--)t.lineTo(y[b].timePoint,y[b].point2)}t.closePath(),t.fillStyle=u.generateColor(m,s),t.fill()}}},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I;if(this._points1=[],this._points2=[],this._colorsMap&&(this._colors=[]),this._timePoints=[],this._visible()&&(t=this._source.priceScale(),e=this._source._model.timeScale(),t&&!t.isEmpty()&&!this._source._model.timeScale().isEmpty()&&!(this._source._series.bars().isEmpty()||(this._isHlineFill&&(i=this._source.properties().bands[this._bandAKey],o=this._source.properties().bands[this._bandBKey],this._level1=t.priceToCoordinate(i.value.value()),this._level2=t.priceToCoordinate(o.value.value())),n=this._source.data().plotNames().indexOf(this._plotAId())+1,r=this._source.data().plotNames().indexOf(this._plotBId())+1,null===(s=this._source._model.timeScale().visibleBars())||(a=this._source._series.nearestIndex(s.firstBar(),p.NearestRight),l=this._source._series.nearestIndex(s.lastBar(),p.NearestLeft),(a=this._correctStartBarIndex(a))>l))))){if(c=this._source.data().range(a,l),c.size()>0)for(h=this._source.firstValue(),u=c.firstIndex(),d=c.lastIndex(),_=this._source.offset(this._plotAId()),f=this._source.offset(this._plotBId()),m=Math.max(_,f),g=Math.min(_,f),v=u+m,y=this._source.data().firstIndex(),u>y&&(v=u<m+y?m+y:u),b=d+g,S=this._source.data().lastIndex(),d>S+g&&d<S&&(b=S+g),g<0&&d<=S+g&&(b=d),w=v<u?u+m:v>d?u+m:v,T=v;T<=b;++T)this._timePoints.push(e.indexToCoordinate(w++)),this._colors&&null!=(C=this._source.data().valueAt(T-g)[this._colorPlotOffset+1])&&this._colors.push(this._colorValues[this._colorsMap[C]].color.value()),this._isHlineFill||(x=this._source.data().valueAt(T-_),P=this._source.data().valueAt(T-f),L=x[n],I=P[r],t.isPercentage()&&(L=100*(L-h)/h,I=100*(I-h)/h),this._points1.push(L),this._points2.push(I));t.pricesArrayToCoordinates(this._points1),t.pricesArrayToCoordinates(this._points2)}},n.prototype.renderer=function(){this._invalidated&&(this._updateImpl(),this._invalidated=!1);var t={};return t.points1=this._points1,t.points2=this._points2,t.timePoints=this._timePoints,t.getBarSpacing=this._getBarSpacing,t.backcolor=this._color(),t.transparency=this._transparency(),t.isHlineFill=this._isHlineFill,t.level1=this._level1,t.level2=this._level2,this._colors&&(t.colors=this._colors),this._areaRenderer.setData(t),this._areaRenderer},n.prototype._plotAId=function(){a(!1,"Pure virtual call!")},n.prototype._plotBId=function(){a(!1,"Pure virtual call!")},n.prototype._color=function(){a(!1,"Pure virtual call!")},n.prototype._transparency=function(){a(!1,"Pure virtual call!")},n.prototype._visible=function(){a(!1,"Pure virtual call!")},
n.prototype._correctStartBarIndex=function(t){return t},inherit(r,n),r.prototype._plotAId=function(){return this._source.properties().area[0].name.value()},r.prototype._plotBId=function(){return this._source.properties().area[1].name.value()},r.prototype._color=function(){return this._source.properties().areaBackground.backgroundColor.value()},r.prototype._transparency=function(){var t=this._source.properties().areaBackground.transparency.value();return d(t,0,100)},r.prototype._visible=function(){return this._source.properties().areaBackground.fillBackground.value()},inherit(s,n),s.prototype._initBandIndexes=function(t,e){var i,o;for(this._bandAKey=null,this._bandBKey=null,i=0;i<this._source.metaInfo().bands.length;++i)o=this._source.metaInfo().bands[i],null!==this._bandAKey||o.id!==t?null!==this._bandBKey||o.id!==e||(this._bandBKey=i):this._bandAKey=i},s.prototype._plotAId=function(){return this._fillMetaInfo.objAId},s.prototype._plotBId=function(){return this._fillMetaInfo.objBId},s.prototype._color=function(){return this._fillStyleProps.color.value()},s.prototype._transparency=function(){return this._fillStyleProps.transparency.value()},s.prototype._visible=function(){return this._fillStyleProps.visible.value()},s.prototype._correctStartBarIndex=function(t){var e=this._source.getMinFirstBarIndexForPlot(this._fillMetaInfo.id);return Math.max(e,t)},e.PlotFillPaneView=s,e.AreaBackgroundPaneView=r},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tzData={"America/New_York":{
time:[-2717668562,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1536530400,-1523224800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-76941e4,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-17762,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Los_Angeles":{
time:[-2717668378,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-769420800,-765410400,-687995940,-662680800,-620866800,-608162400,-589417200,-576108e3,-557967600,-544658400,-526518e3,-513208800,-495068400,-481759200,-463618800,-450309600,-431564400,-418255200,-400114800,-386805600,-368665200,-355356e3,-337215600,-323906400,-305766e3,-292456800,-273711600,-261007200,-242262e3,-226533600,-210812400,-195084e3,-179362800,-163634400,-147913200,-13158e4,-116463600,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],offset:[-28378,-28800,-25200,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Chicago":{
time:[-2717668236,-1633298400,-1615154400,-1601848800,-1583704800,-1563746400,-1551650400,-1538949600,-1520200800,-1504476e3,-1491775200,-1473026400,-1459720800,-1441576800,-1428271200,-1410127200,-1396821600,-1378677600,-1365372e3,-1347228e3,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1189375200,-1176069600,-1157320800,-114462e4,-1125871200,-1112565600,-1094421600,-1081116e3,-1067810400,-1045432800,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-905119200,-891813600,-880236e3,-769413600,-765410400,-747266400,-733960800,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-447285600,-431560800,-415836e3,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-21036,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"America/Phoenix":{time:[-2717670498,-1633298400,-1615154400,-1601848800,-1583704800,-880236e3,-820540740,-812678340,-796867140,-84405600,-68680800,1924966800],offset:[-26898,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]},"America/Toronto":{
time:[-2366755200,-1632088800,-1615154400,-1601771400,-1583712e3,-1567375200,-1554681600,-1534716e3,-1524088800,-1503266400,-149238e4,-1471816800,-1460930400,-1440972e3,-1428876e3,-1409522400,-1397426400,-1378072800,-1365976800,-1346623200,-1333922400,-1315173600,-1301868e3,-1283724e3,-1270418400,-1252274400,-1238968800,-1220824800,-1207519200,-1188770400,-1176069600,-1157320800,-1144015200,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-880232400,-76941e4,-765410400,-747266400,-733960800,-715824e3,-702518400,-684374400,-671068800,-652924800,-634176e3,-620863200,-602719200,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-384386400,-368661600,-352936800,-337212e3,-321487200,-305762400,-289432800,-273708e3,-257983200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-19052,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-14400,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3,-14400,-18e3]},"America/Vancouver":{
time:[-2713910400,-1632088800,-1615154400,-880236e3,-769420800,-765410400,-747266400,-732751200,-715816800,-702511200,-684367200,-671061600,-652917600,-639612e3,-620863200,-608162400,-589413600,-576108e3,-557964e3,-544658400,-526514400,-513208800,-495064800,-481759200,-463615200,-450309600,-431560800,-418255200,-400111200,-386805600,-368661600,-355356e3,-337212e3,-323906400,-305762400,-292456800,-273708e3,-261007200,-242258400,-226533600,-210808800,-195084e3,-179359200,-163634400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,136346400,152071200,167796e3,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-29548,-28800,-25200,-28800,-25200,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800,-25200,-28800]},"America/Argentina/Buenos_Aires":{time:[-2372112e3,-1567468800,-1233446400,-1222992e3,-1205971200,-1194048e3,-117288e4,-1162512e3,-1141344e3,-1130976e3,-1109808e3,-109944e4,-1078272e3,-1067817600,-1046649600,-1036281600,-1015113600,-1004745600,-983577600,-973209600,-952041600,-941587200,-931046400,-900892800,-890352e3,-83376e4,-82728e4,-752284800,-733795200,-197337600,-190857600,-184204800,-164505600,-152668800,-132969600,-121132800,-101433600,-86832e3,-71107200,-54777600,-39052800,-23328e3,-7603200,128131200,136598400,596937600,605059200,624412800,636508800,656467200,667958400,687916800,699408e3,719366400,731462400,938908800,952041600,1198972800,1205625600,1224374400,1237075200,1924981200],offset:[-14028,-15408,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-14400,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-10800,-10800,-7200,-10800,-7200,-10800]},"America/El_Salvador":{time:[-1546300800,546998400,559699200,578448e3,591148800,1924970400],offset:[-21408,-21600,-18e3,-21600,-18e3,-21600]},"America/Sao_Paulo":{
time:[-1767225600,-1206968400,-1191369600,-1175385600,-1159833600,-633830400,-622076400,-602294400,-59184e4,-570758400,-560217600,-539136e3,-53136e4,-195436800,-184204800,-155174400,-150076800,-128908800,-121132800,-99964800,-89596800,-68428800,-57974400,499737600,511228800,530582400,540259200,562118400,571190400,592963200,602035200,624412800,634694400,656467200,666748800,687916800,697593600,719971200,728438400,750816e3,761702400,782265600,793152e3,813715200,823996800,84456e4,856051200,876096e3,888710400,908064e3,919555200,938908800,951609600,970963200,982454400,1003017600,1013904e3,1036281600,1045353600,1066521600,1076803200,1099353600,1108857600,1129420800,1140307200,1162684800,1172361600,119232e4,1203206400,1224374400,1234656e3,1255824e3,1266710400,1287273600,129816e4,1318723200,1330214400,1350777600,1361059200,1382227200,1392508800,1413676800,1424563200,1445126400,1456012800,1476576e3,1487462400,1508025600,1518912e3,154008e4,1550361600,1571529600,1581811200,1602979200,1613865600,1634428800,1645315200,1665878400,1677369600,1697328e3,1708214400,1729382400,1739664e3,1760832e3,1771718400,1792281600,1803168e3,1823731200,1834617600,1855180800,1866067200,1887235200,1897516800,1918684800,1928966400],offset:[-11188,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200,-10800,-7200]},"America/Bogota":{time:[-2707689600,-1739059200,704851200,733881600,1924974e3],offset:[-17776,-17776,-18e3,-14400,-18e3]},"America/Caracas":{time:[-2524521600,-1826755200,-157766400,1197169200,1462069800,1924977600],offset:[-16064,-16060,-16200,-14400,-16200,-14400]},"Europe/Moscow":{
time:[-2840140800,-1688256e3,-165681e4,-1641340800,-1627956e3,-1618700400,-1596416400,-1593804521,-1589846400,-1542416400,-1539478800,-1525305600,-1522713600,-1491177600,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1414288800,1925002800],offset:[9017,9017,9079,12679,9079,16279,12679,16279,14400,10800,14400,18e3,14400,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800]},"Europe/Athens":{time:[-2344636800,-1686095940,-1182988800,-1178150400,-906854400,-904867200,-85725e4,-844473600,-828230400,-812419200,-552355200,-541641600,166492800,186195600,198036e3,213764400,228880800,244090800,260330400,275457600,291805200,307418400,323395200,338947200,354682800,370411200,386132400,401860800,417582e3,433310400,449031600,465364800,481086e3,496814400,512535600,528264e3,543985200,559713600,575434800,591163200,606884400,622612800,638334e3,654667200,670388400,686116800,701838e3,717566400,733287600,749016e3,764737200,780465600,796186800,811915200,828241200,846388800,859690800,877838400,891140400,909288e3,92259e4,941342400,954039600,972792e3,985489200,1004241600,1017543600,1035691200,1048993200,1067140800,1080442800,1099195200,1111892400,1130644800,1143342e3,1162094400,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301194800,1319947200,1332644400,1351396800,1364698800,1382846400,1396148400,1414296e3,1427598e3,1445745600,1459047600,14778e5,1490497200,1509249600,1521946800,1540699200,1554001200,1572148800,1585450800,1603598400,1616900400,1635652800,164835e4,1667102400,1679799600,1698552e3,1711854e3,1730001600,1743303600,1761451200,1774753200,1792900800,1806202800,1824955200,1837652400,1856404800,1869102e3,1887854400,1901156400,1919304e3,1932606e3],
offset:[5692,5692,7200,10800,7200,10800,7200,3600,7200,3600,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Europe/Belgrade":{time:[-2713910400,-905821200,-85725e4,-844552800,-828219600,-812498400,-79677e4,-777938400,-766616400,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[4920,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Berlin":{
time:[-2422051200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-938901600,-85725e4,-844552800,-828219600,-812498400,-79677e4,-781048800,-776556e3,-765925200,-761173200,-748476e3,-733266e3,-717627600,-714603600,-71037e4,-701902800,-684972e3,-670453200,-654127200,-639003600,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[3208,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/London":{
time:[-3852662400,-1691964e3,-1680469200,-1664143200,-1650142800,-1633903200,-1617483600,-1601848800,-1586034e3,-1570399200,-1552165200,-1538344800,-152253e4,-15075e5,-1490562e3,-1473631200,-1460926800,-1442786400,-1428872400,-1410732e3,-1396213200,-1379282400,-1364763600,-1348437600,-1333314e3,-1315778400,-1301259600,-1284328800,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-118998e4,-1175461200,-1159135200,-1143406800,-1126476e3,-1111957200,-1095631200,-1080507600,-1063576800,-1049058e3,-1032127200,-1017608400,-1001282400,-986158800,-969228e3,-950475600,-942012e3,-904514400,-896043600,-875484e3,-864594e3,-844034400,-832539600,-812584800,-798066e3,-781048800,-772059600,-764802e3,-748476e3,-733352400,-719445600,-717026400,-706741200,-699483600,-687996e3,-668034e3,-654732e3,-636584400,-622072800,-605739600,-590623200,-57429e4,-558568800,-542235600,-527119200,-512600400,-496274400,-481150800,-46422e4,-449701200,-432165600,-417646800,-401320800,-386197200,-369266400,-354747600,-337816800,-323298e3,-306972e3,-291848400,-276732e3,-257979600,-245282400,-22653e4,-213228e3,-195080400,-182383200,-163630800,-150933600,-132181200,-119484e3,-100731600,-88034400,-68677200,-59004e3,-37238400,57726e3,69818400,89175600,101268e3,120625200,132717600,152074800,164167200,183524400,196221600,214974e3,227671200,246423600,259120800,278478e3,290570400,309927600,32202e4,341377200,354675600,372823200,386125200,404272800,417574800,435722400,449024400,467776800,481078800,499226400,512528400,530676e3,543978e3,562125600,575427600,593575200,606877200,625629600,638326800,657079200,670381200,688528800,701830800,719978400,733280400,751428e3,76473e4,782877600,796179600,814327200,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174784400,1193536800,1206838800,1224986400,1238288400,1256436e3,1269738e3,1288490400,1301187600,131994e4,1332637200,1351389600,1364691600,1382839200,1396141200,1414288800,1427590800,1445738400,1459040400,1477792800,149049e4,1509242400,1521939600,1540692e3,1553994e3,1572141600,1585443600,1603591200,1616893200,1635645600,1648342800,1667095200,1679792400,1698544800,1711846800,1729994400,1743296400,1761444e3,1774746e3,1792893600,1806195600,1824948e3,1837645200,1856397600,1869094800,1887847200,1901149200,1919296800,1932598800],
offset:[-75,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0]},"Europe/Luxembourg":{time:[-2069712e3,-1692493200,-1680476400,-1662339600,-165015e4,-1632002400,-1618693200,-1612656e3,-1604278800,-1585515600,-1574038800,-1552255200,-1539997200,-1520546400,-1507510800,-1490569200,-1473642e3,-1459116e3,-1444006800,-142767e4,-1411866e3,-1396220400,-1379293200,-1364770800,-1348448400,-1333321200,-1316394e3,-1301266800,-1284339600,-126981e4,-1253484e3,-1238360400,-1221429600,-1206910800,-1191189600,-1175461200,-1160344800,-1143406800,-1127685600,-1111957200,-1096840800,-1080507600,-1063576800,-1049058e3,-1033336800,-1017608400,-1002492e3,-986158800,-969228e3,-950475600,-942012e3,-935182800,-85725e4,-844552800,-828219600,-812498400,-797979600,-781048800,-766616400,-745452e3,-733266e3,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[1476,3600,7200,3600,7200,3600,7200,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Madrid":{time:[-2177453684,-1631926800,-1616972400,-1601168400,-1585436400,-1442451600,-1427756400,-1379293200,-1364857200,-1348448400,-1333407600,-1316390400,-1301353200,-1284339600,-1269903600,-1026954e3,-1017702e3,-1001898e3,-999478800,-986083200,-951519600,-940208400,-873075600,-862614e3,-842835600,-828313200,-811386e3,-796863600,-779936400,-765414e3,-748486800,-733964400,-652323600,-639010800,135126e3,150253200,166575600,181702800,196815600,212547600,22887e4,243997200,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[-884,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,0,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Paris":{time:[-2486678340,-1855958340,-1689814800,-1680393600,-1665363600,-1648339200,-1635123600,-1616889600,-1604278800,-158544e4,-1574038800,-1552262400,-1539997200,-1520553600,-1507510800,-1490572800,-1470618e3,-1459123200,-1444006800,-1427673600,-1411952400,-1396224e3,-1379293200,-1364774400,-1348448400,-1333324800,-1316394e3,-1301270400,-1284339600,-1269820800,-1253494800,-1238371200,-1221440400,-1206921600,-1191200400,-1175472e3,-1160355600,-1143417600,-1127696400,-1111968e3,-1096851600,-1080518400,-1063587600,-1049068800,-1033347600,-1017619200,-1002502800,-986169600,-969238800,-950486400,-942012e3,-932432400,-85725e4,-844552800,-828219600,-812498400,-800064e3,-796258800,-781048800,-766616400,196822800,212547600,228880800,244004400,260330400,276058800,29178e4,307508400,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[561,561,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,0,3600,7200,3600,7200,3600,7200,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Rome":{time:[-3259094400,-2403562204,-1690761600,-168048e4,-1664755200,-1648944e3,-163512e4,-1616889600,-1604275200,-1585526400,-1571011200,-1555286400,-932428800,-85725e4,-844552800,-828219600,-812498400,-798066e3,-781048800,-76671e4,-750895200,-733352400,-719452800,-70191e4,-689205600,-670453200,-114048e3,-103161600,-81993600,-71708400,-50544e3,-40258800,-18489600,-8204400,1296e4,23245200,43804800,54694800,75859200,86749200,107913600,118198800,138758400,149648400,170812800,181098e3,202262400,212547600,233107200,243997200,265161600,276051600,296611200,307501200,323834400,338958e3,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[2996,2996,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Warsaw":{time:[-2840140800,-1717027200,-1693702800,-1680476400,-1663452e3,-1650142800,-1632002400,-1618693200,-1600466400,-1587157200,-1501718400,-931730400,-85725e4,-844552800,-828219600,-812498400,-796600800,-778723200,-762652800,-748483200,-733266e3,-715212e3,-701902800,-684972e3,-670453200,-654127200,-639003600,-397090800,-386805600,-371084400,-355356e3,-334191600,-323301600,-307580400,-291852e3,-271292400,-260402400,-239842800,-228952800,-208393200,-197503200,-176338800,-166053600,228877200,244000800,260326800,276055200,291776400,307504800,323830800,338954400,354675600,370404e3,386125200,401853600,417574800,433303200,449024400,465357600,481078800,496807200,512528400,528256800,543978e3,559706400,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],
offset:[5040,5040,3600,7200,3600,7200,3600,7200,7200,10800,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Europe/Istanbul":{time:[-2840140800,-1869868800,-1693699200,-168048e4,-1570406400,-1552176e3,-1538352e3,-1522540800,-1507507200,-1490572800,-1440201600,-1428019200,-1409702400,-1396483200,-931132800,-922752e3,-917827200,-892425600,-875836800,-857347200,-781056e3,-764726400,-744336e3,-733795200,-716428800,-701913600,-684979200,-670464e3,-654134400,-639014400,-621820800,-60696e4,-590025600,-575424e3,-235612800,-228268800,-177724800,-165715200,10540800,23846400,41990400,55296e3,74044800,87350400,107917200,12123e4,133927200,152686800,165369600,183513600,202435200,215568e3,228873600,245808e3,260323200,277257600,308793600,323838e3,340243200,354682800,371692800,386132400,403142400,428457600,433900800,482803200,496713600,512528400,528256800,543978e3,559706400,575427600,591156e3,606877200,622605600,638326800,65466e4,670381200,686109600,701830800,717559200,733280400,749008800,764125200,780458400,796179600,811908e3,828234e3,846381600,859683600,877831200,891133200,909280800,922582800,941335200,954032400,972784800,985482e3,1004234400,1017536400,1035684e3,1048986e3,1067133600,1080435600,1099188e3,1111885200,1130637600,1143334800,1162087200,1174791600,1193544e3,1206846e3,1224993600,1238295600,1256443200,1269745200,1288497600,1301281200,1319947200,1332644400,1351396800,1364698800,1382846400,1396234800,1414296e3,1427598e3,1446955200,1459047600,1473206400,1925002800],offset:[6952,7016,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,14400,10800,14400,10800,14400,10800,14400,10800,14400,10800,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,10800]},"Europe/Zurich":{
time:[-3675196800,-2385244800,-904431600,-891122400,-872982e3,-859672800,354679200,370407600,386128800,401857200,417578400,433306800,449028e3,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1111888800,1130641200,1143338400,1162090800,1174788e3,1193540400,1206842400,122499e4,1238292e3,1256439600,1269741600,1288494e3,1301191200,1319943600,1332640800,1351393200,1364695200,1382842800,1396144800,1414292400,1427594400,1445742e3,1459044e3,1477796400,1490493600,1509246e3,1521943200,1540695600,1553997600,1572145200,1585447200,1603594800,1616896800,1635649200,1648346400,1667098800,1679796e3,1698548400,1711850400,1729998e3,17433e5,1761447600,1774749600,1792897200,1806199200,1824951600,1837648800,1856401200,1869098400,1887850800,1901152800,1919300400,1932602400],offset:[2048,1786,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600,7200,3600]},"Australia/Sydney":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Australia/Brisbane":{time:[-2366755200,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,625629600,636519600,657079200,667969200,688528800,699418800,1925028e3],offset:[36728,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3]},"Australia/Adelaide":{time:[-2364076800,-2230156800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,637729200,657079200,667969200,688528800,701233200,719978400,731473200,752032800,764132400,783482400,796186800,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,972784800,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],
offset:[33260,32400,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800,34200,37800]},"Australia/ACT":{time:[-2364076800,-1672531140,-1665352800,-883605600,-876088800,-860364e3,-844639200,-828309600,-813189600,57722400,68007600,89172e3,100062e3,120621600,131511600,152071200,162961200,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,386737200,404877600,415767600,436327200,447217200,467776800,478666800,499226400,511326e3,530071200,542775600,562125600,57483e4,59418e4,606279600,625629600,636519600,657079200,667969200,688528800,699418800,719978400,731473200,752032800,762922800,783482400,794372400,814932e3,828241200,846381600,859690800,877831200,891140400,909280800,92259e4,941335200,954039600,967341600,985489200,1004234400,1017543600,1035684e3,1048993200,1067133600,1080442800,1099188e3,1111892400,1130637600,1143946800,1162087200,1174791600,1193536800,1207450800,1223172e3,1238900400,1254621600,127035e4,1286071200,1301799600,1317520800,1333249200,1349575200,1365303600,1381024800,1396753200,1412474400,1428202800,1443924e3,1459652400,1475373600,1491102e3,1506823200,1522551600,1538877600,1554606e3,1570327200,1586055600,1601776800,1617505200,1633226400,1648954800,1664676e3,1680404400,1696125600,1712458800,172818e4,1743908400,1759629600,1775358e3,1791079200,1806807600,1822528800,1838257200,1853978400,1869706800,1886032800,1901761200,1917482400,1933210800],offset:[36292,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600,36e3,39600]},"Asia/Almaty":{
time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,701834400,717562800,733284e3,749012400,764733600,780462e3,796183200,811911600,828237600,846385200,859687200,877834800,891136800,909284400,922586400,941338800,954036e3,972788400,985485600,1004238e3,101754e4,1035687600,1048989600,1067137200,1080439200,1099191600,1925013600],offset:[18468,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,21600,18e3,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600,25200,21600]},"Asia/Ashkhabad":{time:[-1441152e3,-1247529600,354931200,370742400,386467200,402278400,418003200,433814400,449625600,465361200,481082400,496810800,512532e3,528260400,543981600,55971e4,575431200,591159600,606880800,622609200,638330400,654663600,670384800,686113200,695786400,192501e4],offset:[14012,14400,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,21600,18e3,18e3,14400,18e3]},"Asia/Tokyo":{time:[-2587678861,-683762400,-672357600,-654732e3,-640908e3,-620258400,-609458400,-588808800,-578008800,1925024400],offset:[33539,32400,36e3,32400,36e3,32400,36e3,32400,36e3,32400]},"Asia/Taipei":{time:[-2335219200,-1017792e3,-766191600,-745804800,-733795200,-716860800,-699580800,-683856e3,-670636800,-65232e4,-639100800,-620784e3,-607564800,-589248e3,-576028800,-562896e3,-541728e3,-528681600,-510192e3,-497145600,-478656e3,-465609600,-449798400,-433987200,-418176e3,-402451200,-38664e4,-370915200,-355104e3,-339379200,-323568e3,-302486400,-291945600,-270950400,-260409600,134006400,149817600,165542400,181353600,299635200,307584e3,1925020800],offset:[29160,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Singapore":{time:[-2177452800,-2038176e3,-1167609600,-1073001600,-894153600,-879638400,-766972800,378691200,1925020800],offset:[24925,24925,25200,26400,26400,27e3,32400,27e3,28800]},"Asia/Shanghai":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,515548800,52704e4,545184e3,558489600,576633600,589939200,608688e3,621993600,640137600,653443200,671587200,684892800,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Seoul":{time:[-1948752e3,-1830384e3,-767318400,-498096e3,-462672e3,-451699200,-429753600,-418262400,-399513600,-387417600,-368064e3,-355968e3,-336614400,-324518400,-305164800,-293068800,-264902400,547610400,560919600,57906e4,592369200,1925024400],
offset:[30472,30600,32400,32400,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,34200,30600,32400,36e3,32400,36e3,32400]},"Asia/Tehran":{time:[-1704153600,-757382400,247190400,259286400,277776e3,283996800,290822400,306547200,322444800,338515200,673228800,685497600,701222400,71712e4,732758400,748656e3,764294400,780192e3,795830400,811728e3,827366400,843264e3,858988800,874886400,890524800,906422400,922060800,937958400,953596800,969494400,985219200,1001116800,1016755200,1032652800,1048291200,1064188800,1079827200,1095724800,1111449600,1127347200,1206057600,1221955200,123768e4,1253577600,1269216e3,1285113600,1300752e3,1316649600,1332288e3,1348185600,1363910400,1379808e3,1395446400,1411344e3,1426982400,144288e4,1458518400,1474416e3,1490140800,1506038400,1521676800,1537574400,1553212800,1569110400,1584748800,1600646400,1616371200,1632268800,1647907200,1663804800,1679443200,1695340800,1710979200,1726876800,1742601600,1758499200,1774137600,1790035200,1805673600,1821571200,1837209600,1853107200,1868745600,1884643200,1900368e3,1916265600,1931904e3],offset:[12344,12344,12600,14400,18e3,14400,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600,16200,12600]},"Asia/Dubai":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Kolkata":{time:[-2840140800,-891561600,-872035200,-862617600,-764121600,1925011800],offset:[21208,21200,23400,19800,23400,19800]},"Asia/Hong_Kong":{time:[-2056665600,-907360200,-891635400,-884217600,-766713600,-747952200,-728512200,-717021e3,-694470600,-683757e3,-668032200,-654726600,-636582600,-623277e3,-605133e3,-591827400,-573683400,-559773e3,-542320200,-528323400,-510179400,-498083400,-478729800,-466633800,-446675400,-435184200,-415225800,-403129800,-383776200,-371680200,-352326600,-340230600,-320877e3,-308781e3,-288822600,-277331400,-257373e3,-245881800,-225923400,-213827400,-194473800,-182377800,-163024200,-148509e3,-132784200,-117059400,-101334600,-85609800,-69280200,-53555400,-37830600,-22105800,-6381e3,9343800,25068600,40793400,56518200,72243e3,88572600,104297400,120022200,126070200,151471800,167196600,182921400,198646200,214371e3,295414200,309324600,1925020800],offset:[27402,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Bangkok":{time:[-2840140800,-1570060800,1925017200],
offset:[24124,24124,25200]},"Asia/Chongqing":{time:[-2177452800,-933465600,-923097600,-908755200,-891561600,515548800,52704e4,545184e3,558489600,576633600,589939200,608688e3,621993600,640137600,653443200,671587200,684892800,1925020800],offset:[29143,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800,32400,28800]},"Asia/Jerusalem":{time:[-2840140800,-1640995200,-933638400,-857347200,-844293600,-825811200,-812678400,-794188800,-779846400,-762645600,-748303200,-731116800,-681955200,-673228800,-667951200,-65232e4,-636415200,-62208e4,-608936400,-59184e4,-572475600,-558568800,-542840400,-527724e3,-514414800,-490838400,-482976e3,-459468e3,-451526400,-428544e3,-418251600,-400024800,-387417600,142387200,150854400,167184e3,178675200,482284800,495590400,516758400,526435200,545443200,558489600,576633600,589334400,609897600,620784e3,638323200,651628800,669772800,683683200,701827200,715737600,733708800,747187200,765158400,778032e3,796608e3,810086400,826848e3,842832e3,858902400,874195200,890352e3,90504e4,923018400,936324e3,955677600,970794e3,986778e3,1001293200,1017363600,1033952400,1048813200,1065142800,1081299600,1095814800,1112320800,1128823200,1143770400,1159668e3,117522e4,1189908e3,1206669600,1223172e3,1238119200,1254016800,1269568800,1284256800,1301623200,1317520800,1333072800,1348365600,1364522400,1382839200,1395972e3,1414288800,1427421600,1445738400,1458871200,1477792800,1490320800,1509242400,1521770400,1540692e3,1553824800,1572141600,1585274400,1603591200,1616724e3,1635645600,1648173600,1667095200,1679623200,1698544800,1711677600,1729994400,1743127200,1761444e3,1774576800,1792893600,1806026400,1824948e3,1837476e3,1856397600,1868925600,1887847200,190098e4,1919296800,1932429600],offset:[8454,8440,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,14400,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Asia/Kuwait":{time:[-719625600,1925002800],offset:[11212,10800]},"Asia/Muscat":{time:[-1577923200,1925006400],offset:[13272,14400]},"Asia/Qatar":{time:[-1577923200,76204800,1925002800],offset:[12368,14400,10800]},"Asia/Riyadh":{time:[-719625600,1925002800],offset:[11212,10800]},"Pacific/Auckland":{
time:[-3192393600,-1330293600,-1320012e3,-1300658400,-1287352800,-1269208800,-1255903200,-1237759200,-1224453600,-1206309600,-1192399200,-117486e4,-1160949600,-1143410400,-1125871200,-1112565600,-1094421600,-1081116e3,-1062972e3,-1049666400,-1031522400,-1018216800,-1000072800,-986767200,-968018400,-955317600,-936568800,-923263200,-757382400,152676e3,162356400,183520800,195015600,215575200,226465200,247024800,257914800,278474400,289364400,309924e3,320814e3,341373600,352263600,372823200,384318e3,404877600,415767600,436327200,447217200,467776800,478666800,499226400,510116400,530676e3,541566e3,562125600,573620400,59418e4,60507e4,623815200,637729200,655264800,669178800,686714400,700628400,718164e3,732682800,749613600,764132400,781063200,795582e3,812512800,827031600,844567200,858481200,876016800,889930800,907466400,921985200,938916e3,953434800,970365600,984884400,100242e4,1016334e3,1033869600,1047783600,1065319200,1079838e3,1096768800,1111287600,1128218400,1142737200,1159668e3,1174186800,1191117600,1207450800,1222567200,1238900400,1254016800,127035e4,1285466400,1301799600,1316916e3,1333249200,1348970400,1365303600,138042e4,1396753200,1411869600,1428202800,1443319200,1459652400,1474768800,1491102e3,1506218400,1522551600,1538272800,1554606e3,1569722400,1586055600,1601172e3,1617505200,1632621600,1648954800,1664071200,1680404400,1695520800,1712458800,1727575200,1743908400,1759024800,1775358e3,1790474400,1806807600,1821924e3,1838257200,1853373600,1869706800,1885428e3,1901761200,1916877600,1933210800],offset:[41944,41400,45e3,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,41400,43200,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800,43200,46800]},"Pacific/Chatham":{
time:[-3192393600,-757382400,152678700,162359100,183523500,195018300,215577900,226467900,247027500,257917500,278477100,289367100,309926700,320816700,341376300,352266300,372825900,384320700,404880300,415770300,436329900,447219900,467779500,478669500,499229100,510119100,530678700,541568700,562128300,573623100,594182700,605072700,623817900,637731900,655267500,669181500,686717100,700631100,718166700,732685500,749616300,764135100,781065900,795584700,812515500,827034300,844569900,858483900,876019500,889933500,907469100,921987900,938918700,953437500,970368300,984887100,1002422700,1016336700,1033872300,1047786300,1065321900,1079840700,1096771500,1111290300,1128221100,1142739900,1159670700,1174189500,1191120300,1207453500,1222569900,1238903100,1254019500,1270352700,1285469100,1301802300,1316918700,1333251900,1348973100,1365306300,1380422700,1396755900,1411872300,1428205500,1443321900,1459655100,1474771500,1491104700,1506221100,1522554300,1538275500,1554608700,1569725100,1586058300,1601174700,1617507900,1632624300,1648957500,1664073900,1680407100,1695523500,1712461500,1727577900,1743911100,1759027500,1775360700,1790477100,1806810300,1821926700,1838259900,1853376300,1869709500,1885430700,1901763900,1916880300,1933213500],offset:[44028,44100,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500,45900,49500]},"Pacific/Fakaofo":{time:[-2177452800,1325203200,1925038800],offset:[-41096,-39600,46800]},"Pacific/Honolulu":{time:[-2334139200,-1157320800,-1155470400,-880236e3,-765410400,-712188e3,1924956e3],offset:[-37886,-37800,-34200,-37800,-34200,-37800,-36e3]},"America/Mexico_City":{
time:[-1514763396,-1343091600,-1234828800,-1220317200,-1207180800,-1191369600,-975283200,-963187200,-917136e3,-907372800,-821923200,-810086400,-627523200,-613008e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,989114400,1001815200,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1175392800,1193536800,1207447200,1224986400,1238896800,1256436e3,1270346400,1288490400,1301796e3,131994e4,1333245600,1351389600,13653e5,1382839200,1396749600,1414288800,1428199200,1445738400,1459648800,1477792800,1491098400,1509242400,1522548e3,1540692e3,1554602400,1572141600,1586052e3,1603591200,1617501600,1635645600,1648951200,1667095200,1680400800,1698544800,1712455200,1729994400,1743904800,1761444e3,1775354400,1792893600,1806804e3,1824948e3,1838253600,1856397600,1869703200,1887847200,1901757600,1919296800,1933207200],offset:[-23796,-25200,-21600,-25200,-21600,-25200,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600,-18e3,-21600]},"Africa/Cairo":{time:[-2185401600,-929836800,-923097600,-906163200,-892857600,-875836800,-857779200,-844300800,-825811200,-812678400,-794188800,-779846400,-762652800,-399081600,-38664e4,-368323200,-355104e3,-336783600,-323643600,-305161200,-292021200,-273625200,-260485200,-242089200,-228949200,-210553200,-197413200,-178930800,-165790800,-147394800,-134254800,-115858800,-102632400,-84322800,-71096400,-52700400,-39474e3,-21164400,-7938e3,10371600,23598e3,41907600,55134e3,7353e4,86756400,105066e3,118292400,136602e3,149828400,168138e3,181364400,199760400,212986800,231296400,244522800,262832400,276058800,294368400,307594800,325990800,339217200,357526800,370753200,396406800,402289200,426819600,433825200,452221200,465447600,483757200,496983600,515293200,528519600,546829200,560055600,578451600,591678e3,610419600,623214e3,641523600,65475e4,673059600,686286e3,704682e3,717908400,736218e3,749444400,767754e3,780980400,799027200,812332800,830476800,843782400,861926400,875232e3,893376e3,906681600,925430400,938736e3,95688e4,970185600,988329600,1001635200,1019779200,1033084800,1051228800,1064534400,1083283200,1096588800,1114732800,1128038400,1146182400,1158883200,1177632e3,1189123200,1209081600,1219968e3,1240531200,1250812800,1272585600,1281484800,1284076800,1285891200,1400198400,1403827200,1406851200,1411689600,1924999200],
offset:[7509,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200,10800,7200]},"Africa/Johannesburg":{time:[-2458166400,-2109283200,-860968800,-845244e3,-829519200,-813794400,1924999200],offset:[6720,5400,7200,10800,7200,10800,7200]},"Asia/Kathmandu":{time:[-1577923200,504921600,1925012700],offset:[20476,19800,20700]},"US/Mountain":{time:[-2717668796,-1633298400,-1615154400,-1601848800,-1583704800,-1570399200,-1551650400,-1538949600,-1534111200,-880236e3,-769417200,-765410400,-147909600,-13158e4,-11646e4,-100130400,-84405600,-68680800,-52956e3,-37231200,-21506400,-5781600,9943200,25668e3,41392800,57722400,73447200,89172e3,104896800,120621600,126669600,152071200,162352800,183520800,199245600,215575200,230695200,247024800,262749600,278474400,294199200,309924e3,325648800,341373600,357098400,372823200,388548e3,404877600,419997600,436327200,452052e3,467776800,483501600,499226400,514951200,530676e3,544586400,562125600,576036e3,59418e4,607485600,625629600,638935200,657079200,670989600,688528800,702439200,719978400,733888800,752032800,765338400,783482400,796788e3,814932e3,828842400,846381600,860292e3,877831200,891741600,909280800,923191200,941335200,954640800,972784800,986090400,1004234400,1018144800,1035684e3,1049594400,1067133600,1081044e3,1099188e3,1112493600,1130637600,1143943200,1162087200,1173578400,1194141600,1205028e3,1225591200,1236477600,1257040800,1268532e3,1289095200,1299981600,1320544800,1331431200,1351994400,1362880800,1383444e3,1394330400,1414893600,142578e4,1446343200,1457834400,1478397600,1489284e3,1509847200,1520733600,1541296800,1552183200,1572746400,1583632800,1604196e3,1615687200,1636250400,1647136800,16677e5,1678586400,1699149600,1710036e3,1730599200,1741485600,1762048800,1772935200,1793498400,1804989600,1825552800,1836439200,1857002400,1867888800,1888452e3,1899338400,1919901600,1930788e3],
offset:[-25196,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200,-21600,-25200]}}},function(t,e,i){"use strict";(function(e,o,n,r){function s(t){return t instanceof A}function a(t){return TradingView.isInherited(t.constructor,g)}function l(t){return t.isNoScale()?null:t.priceScale()}function c(t,e,i,o,n){if(void 0!==n)switch(n){case"right":return t.rightPriceScale();case"left":return t.leftPriceScale();case"no-scale":return null;case"as-series":if(!t.isMainPane()){j.logWarn('BEWARE: Attempt to set "as-series" price scale to study, but series and study are on different panes');break}return l(e);default:j.logWarn("Unknown override for priceScale type - "+n+", default will be used")}var r=i.priceScale;return o?null:(s(e)||t.isMainPane()&&void 0===r)&&i.is_price_study?l(e):r===R.None?i.is_price_study?null:(j.logWarn("Cannot add study "+i.id+" with 'No Scale' setting, because study is not a price study. Using right price scale."),t.rightPriceScale()):r===R.Left?t.leftPriceScale():t.rightPriceScale()}function h(t,i,n,r,s,a,l,c,u,d){var p,_,f;for(this._version=h.version,this._readOnly=r,this._undoModel=c,this._properties=n,this._modelIntervals=[],this._isSnapshot=u,this.setStudiesMetaData(a,l),this.m_timeScale=new T(this),F.init(),p=this,this.m_panes=[],this.m_gridSource=new S,this.m_crossHairSource=new v(this,F.properties()),this.m_crossHairSource.selectBarMode().subscribe(function(t){if(t&&p.lineBeingCreated()){var e=F.tool.value();p.cancelCreatingLine(),F.tool.setValue(e)}}),this.m_width=0,this._tagsChanged=new e,this._lineCancelled=new e,this._magnet=new w(F.properties().magnet,this.m_timeScale,n.paneProperties.magnetSensivity),_=new N("chartproperties.mainSeriesProperties"),_.addExclusion("minTick"),_.addExclusion("priceAxisProperties.lockScale"),_.addExclusion("priceAxisProperties.percentage"),_.addExclusion("priceAxisProperties.log"),this.createPane(void 0,{rightAxisProperties:_.priceAxisProperties.state(["autoScale"])}),this.m_panes[0]._stretchFactor=2*y.DEFAULT_STRETCH_FACTOR,this.m_panes[0]._isMainPane=!0,this.m_selectedSource=null,this._selectedSourceChanged=new e,this._chartApi=t,
this._invalidateHandler=i,this.m_hoveredSource=null,this._properties.listeners().subscribe(this,h.prototype.propertyChangeHandler),this._properties.timezone.listeners().subscribe(null,function(){p._chartApi&&p._chartApi.connected()&&p._chartApi.switchTimezone(p.timezone())}),this.m_timeScale.defaultRightOffsetProperty().listeners().subscribe(null,function(){p.recalculateAllPanes()}),_.merge(n.mainSeriesProperties.state()),this.m_mainSeries=new z(this,_,s),this.m_panes[0].addDataSource(this.m_mainSeries,this.m_panes[0].rightPriceScale()),this._mainSeriesScaleRatioProperty=new q(this),this.m_mainSeries.onCompleted().subscribe(this,function(){p.clearCurrentPosition(),p._scrollingState&&p.gotoTime()}),this.m_mainSeries.onIntervalChanged().subscribe(this,function(){this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1}),this.m_mainSeries.onBarReceived().subscribe(this,h.prototype.updateTimeScaleBaseIndex),r||(_.addChild("priceAxisProperties",this.m_mainSeries.m_priceScale.properties()),this._properties.paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,function(t){t.value()||p._properties.paneProperties.legendProperties.showStudyArguments.setValue(!1)})),this._barsMarksSources=d(this),f=0;f<this._barsMarksSources.length;f++)this._barsMarksSources[f].setOwnerSource(this.m_mainSeries);this._syncPointCache={},this.m_watermarkSource=new b(this.m_mainSeries),this._brandingSource=null,this.strategySources=[],this.strategySources.change=new e,this._activeStrategySource=new o(null),this._oldStartVisibleIndex=-1,this._oldEndVisibleIndex=-1,this._currentTool="",F.hideAllDrawings().subscribe(this,this.visibilityChangeHandler),this._properties.scalesProperties.listeners().subscribe(this,h.prototype.fullUpdate),this._id=U.guid(),this._studyInserted=new e,this._chartThemeLoaded=new e,this._resetScales=new e,this._studyShiftColorStartOffset=void 0}var u=i(9).ensureNotNull,d=i(8).Point,p=i(32),_=p.parseRgb,f=p.rgbToBlackWhiteString,m=i(220),g=i(1).LineDataSource,v=i(901),y=i(228),b=i(907),S=i(908),w=i(909),T=i(910),C=i(229),x=i(106).BarsMarksContainer,P=i(914).Branding,L=i(46).PriceDataSource,I=i(22),k=i(35),A=k.Study,M=k.createStudy,E=k.prepareStudyProperties,D=i(84),V=i(163),O=i(128).StudyLineDataSource,R=i(111).ScaleType,B=i(19).PlotRowSearchMode,z=i(77),F=i(26),N=i(6).DefaultProperty,W=i(347).SyncPoint,H=i(40).trackEvent,U=i(61),j=i(7).getLogger("Chart.ChartModel"),q=i(916).MainSeriesScaleRatioProperty;h.prototype.setStudiesMetaData=function(t,e){this._studiesMetaData=t,this._studyVersioning=new D(this._studiesMetaData,e)},h.prototype.isSnapshot=function(){return this._isSnapshot},h.prototype.currentTool=function(){return this._currentTool},h.prototype.setCurrentTool=function(t){this._currentTool=t},h.prototype.timezone=function(){return this._properties.timezone.value()},h.prototype.version=function(){return this._version},h.prototype.initConnection=function(){this._chartApi.switchTimezone(this.timezone())},h.prototype.dumpViews=function(){var t,e,i,o,n={};for(n.panes=[],
t=0;t<this.m_panes.length;t++)n.panes.push(this.m_panes[t].dumpViews());for(n.dataWindow=[],e=this.dataSources(),t=0;t<e.length;t++)i=e[t],(o=i.dataWindowView())&&n.dataWindow.push(o.dump());return n},h.prototype._paneInvalidationMask=function(t,e){var i=new I,o=this.m_panes.indexOf(t);return void 0===e&&(e=I.LIGHT_UPDATE),i.invalidatePane(o,e),i},h.prototype.updatePane=function(t){var e=this._paneInvalidationMask(t);this.invalidate(e)},h.prototype.fullUpdate=function(){this.invalidate(new I(I.FULL_UPDATE))},h.prototype.updateSource=function(t){var e=this.paneForSource(t),i=this._paneInvalidationMask(e);this.invalidate(i)},h.prototype.studiesMetaData=function(){return this._studiesMetaData},h.prototype.studyVersioning=function(){return this._studyVersioning},h.prototype.disconnect=function(){var t,e,i=this.dataSources();for(e=0;e<i.length;e++)t=i[e],t.disconnect&&t.disconnect()},h.prototype.restart=function(){var t,e,i;for(this.initConnection(),this.m_timeScale.reset(),this.m_mainSeries.restart(),t=this.dataSources(),e=0;e<t.length;e++)i=t[e],i.restart&&i!==this.m_mainSeries&&i.restart()},h.prototype.startNotStartedStudies=function(){var t,e;if(!this.m_mainSeries.isStarted())throw Error("Cannot start studies: main series is not started");for(t=this.dataSources(),e=0;e<t.length;e++)s(t[e])&&!t[e].isStarted()&&t[e].restart&&t[e]!==this.m_mainSeries&&t[e].restart()},h.prototype.updateLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)a(i[t])&&(e=i[t],e.tryCreateServerPoints(),e.checkAlert&&e.checkAlert())},h.prototype.realignLineTools=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;t++)a(i[t])&&(e=i[t],e.calcIsActualSymbol());for(t=0;t<this.m_panes.length;t++)this.m_panes[t].invalidateSourcesCache()},h.prototype.readOnly=function(){return this._readOnly},h.prototype.properties=function(){return this._properties},h.prototype.lineCancelled=function(){return this._lineCancelled},h.prototype.crossHairMoved=function(){return this.m_crossHairSource.moved()},h.prototype.chartApi=function(){return this._chartApi},h.prototype.propertyChangeHandler=function(){this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.visibilityChangeHandler=function(){this.setSelectedSource(),this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.updateAllPaneViews=function(){var t,e;for(t=0;t<this.m_panes.length;t++)e=this.m_panes[t],e.updateAllViews()},h.prototype.mainSeries=function(){return this.m_mainSeries},h.prototype.timeScale=function(){return this.m_timeScale},h.prototype.panes=function(){return this.m_panes},h.prototype.gridSource=function(){return this.m_gridSource},h.prototype.watermarkSource=function(){return this.m_watermarkSource},h.prototype.brandingSource=function(){return this._brandingSource},h.prototype.crossHairSource=function(){return this.m_crossHairSource},h.prototype.barsMarksSources=function(){return this._barsMarksSources},h.prototype.width=function(){return this.m_width},h.prototype.setPaneHeight=function(t,e){t.setHeight(e),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},
h.prototype.setWidth=function(t){var e,i;for(this.m_width=t,this.m_timeScale.setWidth(this.m_width),e=0;e<this.m_panes.length;++e)i=this.m_panes[e],i.setWidth(t);this.recalculateAllPanes(),this.recalcVisibleRangeStudy(this.dataSources())},h.prototype.createPane=function(t,e){var i,o;if(this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),i=this._properties.paneProperties,e&&i.merge(e),o=new y(this.m_timeScale,i,this),"number"==typeof t&&isFinite(t)){if(t<0||t>this.m_panes.length)return void j.logDebug("ChartModel.createPane: invalid index: "+t);this.m_panes.splice(t,0,o)}else this.m_panes.push(o);return o.onTagsChanged().subscribe(this,h.prototype.onPaneTagsChanged),o},h.prototype.removePane=function(t){this._undoModel._chartWidget.isMaximizedPane()&&this._undoModel._chartWidget.toggleMaximizePane(),t.destroy();var e=this.m_panes.indexOf(t);-1!==e&&this.m_panes.splice(e,1),this.invalidate(new I(I.FULL_UPDATE))},h.prototype.startScalePrice=function(t,e,i){t.startScalePrice(e,i)},h.prototype.scalePriceTo=function(t,e,i){t.scalePriceTo(e,i),this.mainSeries().priceScale().isLockScale()?this.invalidate(new I(I.LIGHT_UPDATE)):this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.endScalePrice=function(t,e){t.endScalePrice(e),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.startScrollPrice=function(t,e,i){t.startScrollPrice(e,i)},h.prototype.scrollPriceTo=function(t,e,i){t.scrollPriceTo(e,i),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.endScrollPrice=function(t,e){t.endScrollPrice(e),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.setPriceAutoScale=function(t,e,i){t.setPriceAutoScale(e,i),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.restorePriceScaleState=function(t,e,i){t.restorePriceScaleState(e,i),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.resetPriceScale=function(t,e){t.resetPriceScale(e),this.invalidate(this._paneInvalidationMask(t,I.LIGHT_UPDATE))},h.prototype.updateScales=function(t,e){this._undoModel._chartWidget._updateScalesActions()},h.prototype.startScaleTime=function(t){this.m_timeScale.startScale(t)},h.prototype.mainSeriesScaleRatioProperty=function(){return this._mainSeriesScaleRatioProperty},h.prototype.mainSeriesScaleRatioPropertyOnChanged=function(){this._mainSeriesScaleRatioProperty.listeners().fire(this._mainSeriesScaleRatioProperty)},h.prototype._mainSeriesPriceScaleName=function(){var t=this.paneForSource(this.m_mainSeries);return t.priceScaleName(t.priceScaleForSource(this.m_mainSeries))},h.prototype.mainSeriesScaleRatio=function(){var t=this.paneForSource(this.m_mainSeries);return"left"===this._mainSeriesPriceScaleName()?t.leftPriceScaleRatio():t.rightPriceScaleRatio()},h.prototype.setMainSeriesScaleRatio=function(t){var e=this.paneForSource(this.m_mainSeries);"left"===this._mainSeriesPriceScaleName()?e.applyLeftPriceScaleRatio(t):e.applyRightPriceScaleRatio(t)},
h.prototype.scaleTimeTo=function(t){this.m_timeScale.scaleTo(t),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.endScaleTime=function(){this.m_timeScale.endScale(),this.invalidate(new I(I.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources())},h.prototype.startScrollTime=function(t){this.m_timeScale.startScroll(t),this._isTimeScrolling=!0},h.prototype.scrollTimeTo=function(t){this.m_timeScale.scrollTo(t),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.endScrollTime=function(){this.m_timeScale.endScroll(),this.invalidate(new I(I.LIGHT_UPDATE)),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this._isTimeScrolling=!1},h.prototype.recalcStudyBasedLineTools=function(){this.dataSources().forEach(function(t){t instanceof O&&t.recalcStudyIfNeeded&&t.recalcStudyIfNeeded()})},h.prototype.recalcVisibleRangeStudy=function(t,e){void 0!==this._recalcVRTimerId&&clearTimeout(this._recalcVRTimerId);var i=this;this._recalcVRTimerId=setTimeout(function(){i._recalcVisibleRangeStudy(t,e)},1e3)},h.prototype._recalcVisibleRangeStudy=function(t,e){var i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v;if(!this.timeScale().isEmpty()&&(i=this.timeScale().visibleBars(),o=this.mainSeries().nearestData(i.firstBar(),B.NearestRight),n=this.mainSeries().nearestData(i.lastBar(),B.NearestLeft),r=this.mainSeries().bars().lastIndex(),a=o?o.index:void 0,l=n?n.index:void 0,c=a===this._oldStartVisibleIndex,h=l===this._oldEndVisibleIndex,!c||!h||e))for(this._oldStartVisibleIndex=a,this._oldEndVisibleIndex=l,u={first_visible_bar_time:1e3*Math.floor(o&&o.value?o.value[TradingView.TIME_PLOT]:0),last_visible_bar_time:1e3*Math.floor(n&&n.value?n.value[TradingView.TIME_PLOT]:0),subscribeRealtime:n&&n.index===r},d=0;d<t.length;d++)if(s(t[d])){for(p=t[d],_=p.metaInfo().inputs,f=[],m=0;m<_.length;m++)u.hasOwnProperty(_[m].id)&&f.push(_[m].id);for(g=p.properties().inputs,m=0;m<f.length;m++)v=f[m],g[v].setValueSilently(u[v]);f.length>0&&g.listeners().fire(g)}},h.prototype.onResetScales=function(){return this._resetScales},h.prototype.resetTimeScale=function(){this.m_timeScale.restoreDefault(),this.recalculateAllPanes(),this.mainSeries().requestMoreData(),this.recalcVisibleRangeStudy(this.dataSources()),this.updateCrossHair(),this.invalidate(new I(I.LIGHT_UPDATE)),this._resetScales.fire()},h.prototype.restoreTimeScaleState=function(t){this.m_timeScale.restoreState(t),this.recalculateAllPanes(),this.updateCrossHair(),this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.restoreFactoryDefaults=function(t){t.restoreFactoryDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},h.prototype.restoreDefaults=function(t){t.restoreDefaults(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this.mainSeries().onChartStyleChanged()},h.prototype.setSelectedSource=function(t,e){
if(!(this.m_selectedSource===t&&this._lastHittestData===e||t&&t.customization&&t.customization.disableSelection)){this._lastHittestData=e;var i=new I;this.m_selectedSource&&(this.m_selectedSource.updateAllViews(),TradingView.alertsDispatcher&&this.m_selectedSource.hasAlert.value()&&this.m_selectedSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!1)})),this.m_selectedSource=t,this._selectedSourceChanged.fire(t),t&&(t.updateAllViews(),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("selected",!0)})),i.force=!0,this.invalidate(new I(I.LIGHT_UPDATE)),this.setHoveredSource(t,e)}},h.prototype.checkLineToolSelection=function(){this.m_selectedSource&&this.m_selectedSource instanceof g&&(this.m_selectedSource.calcIsActualSymbol(),this.m_selectedSource.isActualSymbol()||this.setSelectedSource(null))},h.prototype.onSelectedSourceChanged=function(){return this._selectedSourceChanged},h.prototype.setHoveredSource=function(t,e){if(this.m_hoveredSource!==t||this._lastHittestData!==e){this._lastHittestData=e;var i=null;this.m_hoveredSource&&(this.m_hoveredSource.updateAllViews(),i||(i=new I),TradingView.alertsDispatcher&&this.m_hoveredSource.hasAlert.value()&&this.m_hoveredSource.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!1)}),i.merge(this._paneInvalidationMask(this.paneForSource(this.m_hoveredSource),I.LIGHT_UPDATE))),this.m_hoveredSource=t,t&&(t.updateAllViews(),i||(i=new I),i.merge(this._paneInvalidationMask(this.paneForSource(t),I.LIGHT_UPDATE)),TradingView.alertsDispatcher&&t.hasAlert.value()&&t.getAlert({fromCache:!0}).done(function(t){t&&t.set("hovered",!0)})),i&&this.invalidate(i)}},h.prototype.selectedSource=function(){return this.m_selectedSource},h.prototype.hoveredSource=function(){return this.m_hoveredSource},h.prototype.lastHittestData=function(){return this._lastHittestData},h.prototype.invalidate=function(t){this._invalidateHandler&&this._invalidateHandler(t)},h.prototype.dataSources=function(){var t,e,i,o=[];for(o.push(this.m_crossHairSource),t=0;t<this.m_panes.length;++t)for(e=this.m_panes[t].dataSources(),i=0;i<e.length;i++)o.push(e[i]);return o},h.prototype.orderedDataSources=function(t){var e,i,o=[];for(o.push(this.m_crossHairSource),e=0;e<this.m_panes.length;e++)i=this.m_panes[e].orderedSources().slice(),t&&i.reverse(),o=o.concat(i);return o},h.prototype.dataSourceForId=function(t){var e,i;for(i=0;i<this.m_panes.length;++i)if(e=this.m_panes[i].dataSourceForId(t))return e;return null},h.prototype.children=function(t,e){return this.dataSources().filter(function(i){return(!0!==e||!s(i)||!i.isChildStudy())&&i.ownerSource()===t})},h.prototype.setAndSaveCurrentPosition=function(t,e,i,o){this.m_crossHairSource.saveOriginCoord(t,e),this.setCurrentPosition(t,e,i,o)},h.prototype.setCurrentPosition=function(t,e,i,o){var n,r,s,a,l,c,h,u,d,p,_,f,m,v=NaN,y=Math.round(this.m_timeScale.coordinateToIndex(t));if(i&&(n=i.defaultPriceScale(),n.isEmpty()||(v=n.coordinateToPrice(e))),
(this._lineBeingCreated||g.isLineTool(this.currentTool()))&&(v=this._magnet.align(v,y,i)),this._isTimeScrolling)return void this.m_crossHairSource.setPosition(this.m_crossHairSource.index,v,i);for(this.m_crossHairSource.setOnHoveredChartWidget(!0),this.m_crossHairSource.setPosition(y,v,i),this.m_crossHairSource.dataWindowView().update(),r=this.m_panes,s=r.length;s--;)for(a=r[s].dataSources(),l=a.length;l--;)(c=a[l].dataWindowView())&&c.update();this._lineBeingCreated?(this._lineBeingCreated.setLastPoint({index:y,price:v},o),this._lineBeingCreated.updateAllViews(),this.invalidate(new I(I.LIGHT_UPDATE))):this.crossHairSource().startMeasurePoint()?this.invalidate(new I(I.LIGHT_UPDATE)):this.invalidate(new I(I.UPDATE_CURSOR_ONLY)),this._isSettingsExternalPosition||(h=this._undoModel._chartWidget,h._chartWidgetCollection&&(u=this.mainSeries(),(d=u.syncModel())&&(p=this.m_timeScale.points().roughTime(y,d.projectTime.bind(d)),_={timeStamp:p},f=i.mainDataSource(),f instanceof z&&(_.price=v,_.symbol=f.symbol()),_.syncModel=d,m=this._lineBeingCreated||this._linePointBeingEdited||this._sourceBeingMoved,m=m&&F.drawOnAllCharts().value(),h._chartWidgetCollection.syncCrosshair(_,h,m,o))))},h.prototype.clearCurrentPosition=function(){var t,e,i,o,n,r,s=this.crossHairSource();for(s.clearPosition(),s.dataWindowView().update(),t=this.m_panes,e=t.length;e--;)for(i=t[e].dataSources(),o=i.length;o--;)(n=i[o].dataWindowView())&&n.update();this.invalidate(new I(I.UPDATE_CURSOR_ONLY)),r=this._undoModel._chartWidget,r._chartWidgetCollection&&r._chartWidgetCollection.syncCrosshair(NaN,r)},h.prototype.onSyncScrollNeeded=function(t){var e,i,o,n=this._undoModel._chartWidget;n._chartWidgetCollection&&(e=this.mainSeries(),(i=e.syncModel())&&(o=1e3*this.m_timeScale.points().roughTime(t,i.projectTime.bind(i)),n._chartWidgetCollection.syncScroll(o,this)))},h.prototype.gotoTime=function(t,e){function i(){return p.tickMarks().indexToTime(p.tickMarks().minIndex).valueOf()-t}function o(e){var o,n,r,s,a;if(i()<0){for(o=p.tickMarks().nearestIndex(t),n=u(_.bars().lastIndex()),o=Math.min(o,n),r=p.tickMarks().indexToTime(o).valueOf();r<t&&o<n;)o++,r=p.tickMarks().indexToTime(o).valueOf();return s=p.visibleBars(),a=s.lastBar()-s.firstBar(),!e&&s.contains(o)||(p.zoomToBarsRange(o-a/2,o+a/2),_.requestMoreData()),{timestamp:p.indexToTimePoint(o)}}}var n,r,s,a,l,c,h,d,p=this.timeScale(),_=this.mainSeries();if(e&&e.model&&(n=_.syncModel())&&(r=this._createSyncPoint(e.model.mainSeries().syncModel(),n),t=1e3*r.sourceTimeToTargetTime(t/1e3)),e=e||{centerIfVisible:!0},t)this._scrollingState&&this._scrollingState.deferred.reject(),s=$.Deferred(),this._scrollingState={targetDate:t,deferred:s,centerIfVisible:e.centerIfVisible};else{if(!this._scrollingState)return j.logError("scrollTo called without an argument"),$.Deferred().reject().promise();t=this._scrollingState.targetDate,s=this._scrollingState.deferred}return a=o(this._scrollingState.centerIfVisible),a||(l=p.tickMarks().minIndex,c=p.visibleBars(),h=c.lastBar()-c.firstBar(),
_.endOfData()?(p.zoomToBarsRange(l-h/2,l+h/2),a={timestamp:p.indexToTimePoint(l),eod:!0}):(d=this.timeScale().tickMarks().estimateLeft(t),_.requestMoreData(Math.ceil(d+h/2)))),a&&(this.fullUpdate(),this._scrollingState=null,s.resolve(a)),s.promise()},h.prototype._createSyncPoint=function(t,e){var i,o,n=this._syncPointCache[t.uniqueId()];if(n){if(i=n[e.uniqueId()])return i}else this._syncPointCache[t.uniqueId()]={};return o=new W(t,e),this._syncPointCache[t.uniqueId()][e.uniqueId()]=o,o},h.prototype.setExternalPosition=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p=this.crossHairSource();if(p.setOnHoveredChartWidget(!1),!Number.isNaN(t)&&isNumber(t.timeStamp)&&(o=this.mainSeries(),(n=o.syncModel())&&(r=this._createSyncPoint(t.syncModel,n),s=r.sourceTimeToTargetTime(t.timeStamp),i=this.m_timeScale.points().roughIndex(s,n.distance.bind(n)))),this.mainSeries().symbol()===t.symbol)return this._isSettingsExternalPosition=!0,a=this.paneForSource(this.mainSeries()),l=this.m_timeScale.indexToCoordinate(i),c=this.mainSeries().priceScale().priceToCoordinate(t.price,!0),this.setCurrentPosition(l,c,a,e||{}),p.setOnHoveredChartWidget(!1),void delete this._isSettingsExternalPosition;for(isFinite(i)?p.setPosition(i,NaN,null):(p.clearPosition(),p.dataWindowView().update()),h=this.dataSources(),u=h.length;u--;)(d=h[u].dataWindowView())&&d.update();this.invalidate(new I(I.UPDATE_CURSOR_ONLY))},h.prototype.updateCrossHair=function(){this.m_crossHairSource.update()},h.prototype.updateTimeScale=function(t,e,i,o,n,r){var s,a,l;if(r)for(this.m_timeScale.reset(),s=this.dataSources(),a=0;a<s.length;a++)s[a].clearData&&s[a].clearData();if(o.length>0)for(s=this.dataSources(),a=0;a<s.length;a++)s[a].moveData&&s[a].moveData(o);this.m_timeScale.update(t,e,i,n),l="ChartModel.prototype.updateTimeScale("+t+","+e+","+i.length+","+o.length+","+n.length+","+r+")",l+="TimeScale: {first:"+this.m_timeScale.m_points.firstIndex()+",last:"+this.m_timeScale.m_points.lastIndex()+"}",j.logDebug(l),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.updateTimeScaleBaseIndex=function(t){var e,i,o,n,r,s,a=this.mainSeries().bars();a.isEmpty()||(e=this.timeScale(),i=e.baseIndex(),o=u(a.lastIndex()),n=e.visibleBars(),null!==n&&(r=n.contains(i),t&&t.earliestRow.index>0&&!r&&(s=o-i,e.setRightOffset(e.rightOffset()-s))),e.setBaseIndex(o))},h.prototype.recalculatePane=function(t){t&&t.recalculate()},h.prototype.paneForSource=function(t){for(var e=this.m_panes.length-1;e>=0;e--)if(-1!==this.m_panes[e].dataSources().indexOf(t))return this.m_panes[e];return t instanceof x?this.paneForSource(this.m_mainSeries):null},h.prototype.recalculateAllPanes=function(){for(var t=0;t<this.m_panes.length;++t)this.m_panes[t].recalculate();this.updateAllPaneViews()},h.prototype._invalidateBarColorerCaches=function(){var t,e,i=this.dataSources();for(t=0;t<i.length;++t)(e=i[t])instanceof z&&e.invalidateBarColorerCache()},h.prototype.addStrategySource=function(t){~this.strategySources.indexOf(t)||(this.strategySources.push(t),this.strategySources.change.fire())},
h.prototype.removeStrategySource=function(t){var e=this.strategySources.indexOf(t);~e&&(this.strategySources.splice(e,1),this.strategySources.change.fire())},h.prototype.setActiveStrategySource=function(t){~this.strategySources.indexOf(t)&&this._activeStrategySource.setValue(t)},h.prototype.unsetActiveStrategySource=function(){this._activeStrategySource.setValue(null)},h.prototype.activeStrategySource=function(){return this._activeStrategySource},h.prototype.insertStudy=function(t,e,i,o,n){var r,s,a,l;return null!==o&&void 0!==o||(o=this.mainSeries()),r=["Study_ESD$TV_SPLITS@tv-scripting","Study_ESD$TV_DIVIDENDS@tv-scripting","Study_ESD$TV_SPLITS@tv-scripting","Volume@tv-basicstudies","Sessions@tv-basicstudies"],-1===r.indexOf(t.id)&&H("studies","Study_"+t.id),s=null,i||t.is_price_study?s=this.paneForSource(o):(s=this.createPane(),e&&e.paneSize&&s.setPaneSize(e.paneSize)),"Compare@tv-basicstudies"===t.id&&(H("compare","symbol:"+e.inputs.symbol),this.m_mainSeries.priceScale().properties().log.setValue(!1),this.m_mainSeries.priceScale().properties().percentage.setValue(!0)),a=E(t,e,s,this.studyVersioning(),o),l=M(this,a,o,t),this._recalcVisibleRangeStudy([l],!0),l.start(),l.childStudyByRebind().subscribe(null,function(){H("SOS","Apply SOS","Rebind SOS")}),s.addDataSource(l,c(s,o,l.metaInfo(),i,n)),l.properties().linkedToSeries&&l.properties().linkedToSeries.value()&&l.setOwnerSource(this.mainSeries()),this.recalculatePane(s),this.invalidate(new I(I.FULL_UPDATE)),this._invalidateBarColorerCaches(),this.recalcVisibleRangeStudy(this.dataSources(),!0),this._studyInserted.fire(l),l},h.prototype.studyInserted=function(){return this._studyInserted},h.prototype.replaceStudyStub=function(t,e){var i,o,n,r=this.paneForSource(t);return null!==r&&(i=t.isNoScale()?null:t.priceScale(),o=t.zorder(),n=t.ownerSource(),r.insertDataSource(e,i,o),e.setOwnerSource(n),this.panes().forEach(function(i){i.dataSources().forEach(function(i){i._ownerSource===t&&i.setOwnerSource(e)})}),this.removeSource(t),e.start(),this.recalculatePane(r),this.invalidate(new I(I.FULL_UPDATE)),!0)},h.prototype.insertStudyStub=function(t){var e=this.mainSeries(),i=this.paneForSource(e),o=new V(this,null,t);return i.addDataSource(o,null),this.recalculatePane(i),this.invalidate(new I(I.FULL_UPDATE)),o},h.prototype.removeStudyStub=function(t){var e=this.dataSourceForId(t);return void 0===e?(j.logNormal("StudyStub id="+t+" is not found in chart model"),!1):(this.removeSource(e),!0)},h.prototype.detachSource=function(t,e){var i=this.paneForSource(t);if(i)return i.removeDataSource(t),i.isEmpty()?(this._lineBeingCreated&&i===this._paneBeingCreatedLineOn&&this.cancelCreatingLine(),this.removePane(i,e),!0):(this.invalidate(new I(I.FULL_UPDATE)),this._alertsList&&this._alertsList.trigger("reset"),!1)},h.prototype.removeSource=function(t,e){var i,o,n,r;if(t===this.m_selectedSource&&this.setSelectedSource(null),t===this._sourceBeingMoved&&(this._sourceBeingMoved=null,this._linePointBeingMoved=null),t.stop&&t.stop(),i=this.detachSource(t,e),
t.metaInfo&&t.metaInfo()&&"Compare@tv-basicstudies"===t.metaInfo().id){for(o=this.paneForSource(this.m_mainSeries),n=o.dataSources(),r=0;r<n.length;r++)if(n[r].metaInfo&&"Compare@tv-basicstudies"===n[r].metaInfo().id)return;this.m_mainSeries.priceScale().properties().percentage.setValue(!1)}return this.invalidate(new I(I.FULL_UPDATE)),this._invalidateBarColorerCaches(),t.linkKey&&F.removeLineTool({model:this,linkKey:t.linkKey}),s(t)&&t.isChildStudy()&&t.source().unsetChild(t),t.destroy&&t.destroy(),i},h.prototype._isStudyOrMainSeries=function(t){return TradingView.isInherited(t.constructor,A)||t===this.m_mainSeries},h.prototype.isMergeUpAvailableForSource=function(t){return!!this._isStudyOrMainSeries(t)&&this.paneForSource(t)!==this.panes()[0]},h.prototype.mergeSourceUp=function(t){var e,i,o,n;this.isMergeUpAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.panes()[i-1],n=o.findSuitableScale(t),this.move(t,o,n))},h.prototype.isMergeDownAvailableForSource=function(t){var e,i;return!!this._isStudyOrMainSeries(t)&&(e=this.paneForSource(t),i=this.panes(),e!==i[i.length-1])},h.prototype.mergeSourceDown=function(t){var e,i,o,n;this.isMergeDownAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.panes()[i+1],n=o.findSuitableScale(t),this.move(t,o,n))},h.prototype.isUnmergeAvailableForSource=function(t){var e,i;return!!this._isStudyOrMainSeries(t)&&(e=this.paneForSource(t),i=e.dataSources().filter(function(t){return TradingView.isInherited(t.constructor,L)&&t.showInObjectTree()}),i.length>1)},h.prototype.unmergeSourceUp=function(t){var e,i,o,n;this.isUnmergeAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.createPane(i),n=o.findSuitableScale(t),this.move(t,o,n))},h.prototype.unmergeSourceDown=function(t){var e,i,o,n;this.isUnmergeAvailableForSource(t)&&(e=this.paneForSource(t),i=this.panes().indexOf(e),o=this.createPane(i+1),n=o.findSuitableScale(t),this.move(t,o,n))},h.prototype.isLeftPriceScaleVisible=function(){return this._properties.scalesProperties.showLeftScale.value()},h.prototype.isRightPriceScaleVisible=function(){return this._properties.scalesProperties.showRightScale.value()},h.prototype.setLeftPriceScaleVisible=function(t){this._properties.scalesProperties.showLeftScale.value()!==t&&this._properties.scalesProperties.showLeftScale.setValue(t)},h.prototype.setRightPriceScaleVisible=function(t){this._properties.scalesProperties.showRightScale.value()!==t&&this._properties.scalesProperties.showRightScale.setValue(t)},h.prototype.setPriceScaleVisibility=function(t,e){"left"===t&&this.setLeftPriceScaleVisible(e),"right"===t&&this.setRightPriceScaleVisible(e)},h.prototype.move=function(t,e,i){var o,n,r,s,a=this.children(t,!0),l=this.paneForSource(t),c=e?e.priceScaleName(i):"right";if(l===e){for(o=e.priceScaleByName(c),n=0;n<a.length;n++)e.move(a[n],o);e.move(t,o)}else{for(r=e||this.createPane(),s=r.priceScaleByName(c),n=0;n<a.length;n++)this.detachSource(a[n]);for(n=0;n<a.length;n++)r.addDataSource(a[n],s);this.detachSource(t),
r.addDataSource(t,s)}this._alertsList&&this._alertsList.trigger("reset"),this.invalidate(new I(I.FULL_UPDATE))},h.prototype.isSingleInstanceLineTool=function(t){return"LineStudyMtpRiskReward"===t||"LineStudyMtpAnalysis"===t},h.prototype._externalTimeStamp=function(t){var e=this.mainSeries().syncModel();return this.m_timeScale.points().roughTime(t,e&&e.projectTime.bind(e))},h.prototype.createLineTool=function(t,e,i,o,n){var r,s,a,l,c,h,u,p,_,f,g;return m.isValid(i)?(this.isSingleInstanceLineTool(i)&&this._undoModel.removeAllDrawingTools(i),"LineToolExecution"!==i&&H("drawings","Study_Drawing_"+i),o&&(r=o.state(),s=TradingView.factoryDefaults("linetool"),a=i.toLowerCase(),TradingView.merge(s,TradingView.factoryDefaults(a)),o=TradingView[i].prototype.createPropertiesObject(a,s),o.merge(r)),l=m.create(i,this,o,null,t.mainDataSource()),o||(o=l.properties()),c=!l.linkKey&&!n,F.drawOnAllCharts().value()?l.linkKey=n||U.randomHash():l.linkKey=n,l.toolname=i,l.setOwnerSource(t.mainDataSource()),h=t.defaultPriceScale(),t.addDataSource(l,h),p=this.m_timeScale.indexToCoordinate(e.index),_=h.priceToCoordinate(e.price),l.isFixed()?u=l.addFixedPoint(new d(p,_)):(f=l.constructor,f.skipMagnetting||(e.price=this._magnet.align(e.price,e.index,t)),u=l.addPoint(e)),u||(this._lineBeingCreated=l,this._paneBeingCreatedLineOn=t),c&&l.enableCurrentIntervalVisibility(),this.invalidate(new I(I.FULL_UPDATE)),n||!F.drawOnAllCharts().value()||l.properties().singleChartOnly||(g=this._externalTimeStamp(e.index),F.createLineTool({point:{price:e.price,timeStamp:g},linetool:i,properties:o,symbol:this.mainSeries().symbol(),model:this,linkKey:l.linkKey})),l):null},h.prototype.lineBeingCreated=function(){return this._lineBeingCreated},h.prototype.paneBeingCreatedLineOn=function(){return this._paneBeingCreatedLineOn},h.prototype.coninueCreatingLine=function(t,e,i,o){var n,r,s,a,l,c=this.paneForSource(this._lineBeingCreated);return t.price=this._magnet.align(t.price,t.index,c),n=this._lineBeingCreated.addPoint(t,e,i),r=this._lineBeingCreated,this._lineBeingCreated.updateAllViews(),s=new I(I.LIGHT_UPDATE),a=null,n&&(a={points:this._lineBeingCreated._timePoint,interval:this.mainSeries().interval()},this._paneBeingCreatedLineOn=null,this._lineBeingCreated=null,s.force=!0),this.invalidate(s),o||!F.drawOnAllCharts().value()||r.properties().singleChartOnly||(l=this._externalTimeStamp(t.index),F.continueLineTool({point:{price:t.price,timeStamp:l},envState:e,finalState:a,model:this})),n},h.prototype.cancelCreatingLine=function(){if(this._lineBeingCreated){var t=this._lineBeingCreated;this.removeSource(this._lineBeingCreated),this._lineBeingCreated=null,this._lineCancelled.fire(),F.drawOnAllCharts().value()&&!t.properties().singleChartOnly&&F.cancelLineTool({model:this})}},h.prototype.startChangingLinetool=function(t,e,i,o){var n,r,s;this._lineBeingEdited=t,this._linePointBeingEdited=i,this._lineBeingEdited.startChanging(i,e),n=this.paneForSource(t),e.price=this._magnet.align(e.price,e.index,n),
this._lineBeingEdited.startDragPoint&&this._lineBeingEdited.startDragPoint(i,e),this._lineBeingEdited.setPoint(i,e,o),this._lineBeingEdited.updateAllViews(),r=this._paneInvalidationMask(n,I.LIGHT_UPDATE),r.force=!0,this.invalidate(r),t.linkKey&&!t.properties().singleChartOnly&&(s=this._externalTimeStamp(e.index),F.startChangingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:s},pointIndex:i,envState:o}))},h.prototype.lineBeingEdited=function(){return this._lineBeingEdited},h.prototype.linePointBeingEdited=function(){return this._linePointBeingEdited},h.prototype.changeLinePoint=function(t,e){var i,o,n,r,s=this.paneForSource(this._lineBeingEdited);void 0!==t.x&&void 0!==t.y?(n=this._lineBeingEdited.priceScale(),i=n.coordinateToPrice(t.y),o=Math.round(this.timeScale().coordinateToIndex(t.x)),i=this._magnet.align(i,o,s),this._lineBeingEdited.setPoint(this._linePointBeingEdited,{price:i,index:o},e)):this._lineBeingEdited.setPoint(this._linePointBeingEdited,t,e),this._lineBeingEdited.updateAllViews(),this.invalidate(new I(I.LIGHT_UPDATE)),this._lineBeingEdited.linkKey&&!this._lineBeingEdited.properties().singleChartOnly&&(r=this._externalTimeStamp(o),F.changeLineTool({linkKey:this._lineBeingEdited.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:i,timeStamp:r},envState:e}))},h.prototype.endChangingLinetool=function(t){var e,i,o=this._lineBeingEdited;this._lineBeingEdited.endChanging(!1,t),this._lineBeingEdited=null,this._linePointBeingEdited=null,e=new I(I.LIGHT_UPDATE),e.force=!0,this.invalidate(e),i={points:o._timePoint,interval:this.mainSeries().interval()},o.linkKey&&!o.properties().singleChartOnly&&F.finishChangingLineTool({model:this,linkKey:o.linkKey,symbol:this.mainSeries().symbol(),finalState:i})},h.prototype.startMovingSource=function(t,e,i){var o,n,r;this._sourceBeingMoved=t,this._linePointBeingMoved=i,this._sourceBeingMoved.startMoving(e,i),o=this.paneForSource(this._sourceBeingMoved),n=this._paneInvalidationMask(o,I.LIGHT_UPDATE),n.force=!0,this.invalidate(n),t.linkKey&&!t.properties().singleChartOnly&&(r=this._externalTimeStamp(e.index),F.startMovingLineTool({linkKey:t.linkKey,model:this,symbol:this.mainSeries().symbol(),point:{price:e.price,timeStamp:r}}))},h.prototype.sourceBeingMoved=function(){return this._sourceBeingMoved},h.prototype.moveSource=function(t){if(this._sourceBeingMoved.move(t,this._linePointBeingMoved),this.invalidate(new I(I.LIGHT_UPDATE)),this._sourceBeingMoved.linkKey&&!this._sourceBeingMoved.properties().singleChartOnly){var e=this._externalTimeStamp(t.index);F.moveLineTool({linkKey:this._sourceBeingMoved.linkKey,model:this,point:{price:t.price,timeStamp:e}})}},h.prototype.endMovingSource=function(t){var e,i,o=this._sourceBeingMoved,n=this.paneForSource(this._sourceBeingMoved);this._sourceBeingMoved.endMoving(t),this._sourceBeingMoved=null,this._linePointBeingMoved=null,e=this._paneInvalidationMask(n,I.LIGHT_UPDATE),e.invalidateAll(I.LIGHT_UPDATE),e.force=!0,this.invalidate(e),o instanceof g&&(i={
points:o._timePoint,interval:this.mainSeries().interval()},o.linkKey&&!o.properties().singleChartOnly&&F.finishMovingLineTool({linkKey:o.linkKey,model:this,finalState:i}))},h.prototype.finishLineTool=function(t){var e=this.lineBeingCreated();e&&(e.finish&&e.finish(),!t&&F.drawOnAllCharts().value()&&e.linkKey&&!e.properties().singleChartOnly&&F.finishLineTool({linkKey:e.linkKey,model:this}))},h.prototype.calculateDefaultTags=function(){var t,e,i=[],o=this.dataSources();for(t=0;t<o.length;t++)e=o[t],e.tags&&(i=i.concat(e.tags()));return i},h.prototype.changeZOrder=function(t,e){this.paneForSource(t).changeZOrder(t,e),this.invalidate(new I(I.FULL_UPDATE))},h.prototype.sendToBack=function(t){this.paneForSource(t).sendToBack(t),this.invalidate(new I(I.FULL_UPDATE))},h.prototype.bringToFront=function(t){this.paneForSource(t).bringToFront(t),this.invalidate(new I(I.FULL_UPDATE))},h.prototype.onTagsChanged=function(){return this._tagsChanged},h.prototype.onPaneTagsChanged=function(){this._tagsChanged.fire()},h.prototype.setTimeViewport=function(t,e){this.timeScale().zoomToBarsRange(t,e),this.recalculateAllPanes(),this.invalidate(new I(I.LIGHT_UPDATE))},h.prototype.zoomToViewport=function(t,e,i,o,r){var s,a,l;this.setTimeViewport(t,e),s=Math.min(i,o),a=Math.max(i,o),l=r.defaultPriceScale(),l.setAutoScale(!1),l.isLog()&&(s=l.priceToLogical(s),a=l.priceToLogical(a)),l.setPriceRange(new n(s,a)),this.recalculateAllPanes(),this.invalidate(this._paneInvalidationMask(r,I.LIGHT_UPDATE))},h.prototype.clearAllStudies=function(){var t,e=this.dataSources();for(t=0;t<e.length;t++)e[t].clearData&&e[t].clearData()},h.prototype.allStudies=function(){return this._getAllSources(s)},h.prototype.allLineTools=function(){return this._getAllSources(a)},h.prototype.getStudyById=function(t){var e=this.dataSourceForId(t);return null!==e&&s(e)?e:null},h.prototype.getLineToolById=function(t){var e=this.dataSourceForId(t);return null!==e&&a(e)?e:null},h.prototype._getAllSources=function(t){var e,i,o,n,r,s,a=[],l=this.m_panes,c=l.length;for(e=0;e<c;++e)for(i=l[e],o=i.dataSources(),n=o.length,r=0;r<n;++r)s=o[r],t(s)&&a.push(s);return a},h.prototype.getStudyById=function(t){var e=this.dataSourceForId(t);return e instanceof A?e:null},h.prototype.backgroundColor=function(){return this._properties.paneProperties.background._value},h.prototype.backgroundCounterColor=function(){return"black"===f(_(this.backgroundColor()),150)?"white":"black"},h.prototype.isDark=function(){return"white"===this.backgroundCounterColor()},h.prototype.canZoomIn=function(){return this.m_timeScale.canZoomIn()&&r.enabled("chart_zoom")},h.prototype.canZoomOut=function(){return this.m_timeScale.canZoomOut()&&r.enabled("chart_zoom")},h.prototype.updateAllVolumeStudies=function(){var t,e,i,o,n,r,a=this.m_panes;for(t=a.length;t--;)for(e=!1,i=a[t],o=i.dataSources(),n=o.length;n--;)r=o[n],s(r)&&"Volume"===r.metaInfo().shortId&&(r.updateAllViews(),e||(this.updatePane(i),e=!0))},h.prototype.alertsList=function(){return this._alertsList},h.prototype.setAlertsStudiesList=function(t){
this._alertsStudiesList=$.map($.grep(t,function(t){var e,i=t.plots||[];for(e=0;e<i.length;e++)if("line"===i[e].type)return!0;return!1}),function(t){return t.id})},h.prototype.canCreateAlertForDataSource=function(t){if(!r.enabled("alerts"))return!1},h.prototype.setInterval=function(t,e){var i=setInterval(t,e);return this._modelIntervals.push(i),i},h.prototype.clearInterval=function(t){clearInterval(t);var e=this._modelIntervals.indexOf(t);e>-1&&this._modelIntervals.splice(e,1)},h.prototype.clearIntervals=function(){for(var t=0;t<this._modelIntervals.length;t++)clearInterval(this._modelIntervals[t]);this._modelIntervals=[]},h.prototype.destroy=function(){var t;for(t=0;t<this._barsMarksSources.length;t++)this._barsMarksSources[t].destroy();for(this.clearIntervals(),F.hideAllDrawings().unsubscribe(this,this.visibilityChangeHandler),this.resetDeferredStudies(),this._brandingSource&&this._brandingSource.destroy(),t=0;t<this._barsMarksSources.length;t++)this._barsMarksSources[t].destroy();for(t=0;t<this.m_panes.length;t++)this.m_panes[t].destroy();this.m_panes.length=0},h.prototype.countUserStudies=function(t){var e,i,o,n,r,a,l=0;for(t=t||{},e=0;e<this.m_panes.length;e++)for(i=this.m_panes[e].dataSources(),o=0;o<i.length;o++)if(n=i[o],s(n)&&n.showInObjectTree()){if(r=n.metaInfo&&n.metaInfo()){if(a=r.id,t.dontCountVolume&&"Volume@tv-basicstudies"===a)continue;if(t.dontCountCompare&&"Compare@tv-basicstudies"===a)continue;if(t.dontCountOverlay&&"Overlay@tv-basicstudies"===a)continue}l++}return l},h.prototype.isJustClonedChart=function(){return this._undoModel.isJustClonedChart()},h.prototype.copyToOtherCharts=function(t){var e,i,o,n;t.linkKey=t.linkKey||U.randomHash(),e=this,i=t.state(),o=this.mainSeries(),(n=o.syncModel())&&(i.points=t._timePoint.map(function(t){var i=e.timeScale().timePointToIndex(t.time_t)+t.offset;return{price:t.price,timeStamp:e._externalTimeStamp(i)}}),i.linetool=t.getType(),i.model=this,i.symbol=this.mainSeries().symbol(),i.finalState={points:t._timePoint,interval:this.mainSeries().interval()},F.copyLineTool(i))},h.prototype.restoreSource=function(t,e,i,o,n){var r,s,a,l,c,h,u,d;return r=t?this.createPane(e):this.panes()[e],a=o.type,s=a.toLowerCase().startsWith("study")?r._restoreStudy(o):r._restoreLineTool(o),l=s.ownerSource()?s.ownerSource().priceScale():r.priceScaleByName(n),l?(s.setPriceScale(l),l.addDataSource(s)):(l=new C(this.properties().scalesProperties),l.setHeight(r.m_height),c=s.metaInfo&&"Volume@tv-basicstudies"===s.metaInfo().id,h=c?.75:r.m_rightPriceScale.topMargin(),u=c?0:r.m_rightPriceScale.bottomMargin(),l.setTopMargin(h),l.setBottomMargin(u),l.addDataSource(s),s.setPriceScale(l),s._isOverlay=!0),d=null,o.ownerSource&&(d=r.dataSourceForId(o.ownerSource)),s.setOwnerSource(d),s.setPriceScale(l),s.start(),s.restore&&s.restore(),t&&r.restoreState(i),this.recalculateAllPanes(),this.mainSeries().invalidateBarColorerCache(),this.invalidate(new I(I.FULL_UPDATE,!0)),s.linkKey&&F.restoreLineTool({model:this,linkKey:s.linkKey,state:{restorePane:t,paneIndex:e,paneState:i,sourceState:o,
priceScaleName:n}}),s},h.prototype.restoreLineToolState=function(t,e){t.restorePoints(e.points,e.indexes||[]),t.properties().merge(e.state),t.restoreData&&t.restoreData(e),t.createServerPoints(),this.invalidate(new I(I.FULL_UPDATE)),t.linkKey&&F.restoreLineToolState({model:this,linkKey:t.linkKey,state:e})},h.prototype.createBrandingSource=function(){this._brandingSource=new P(this)},h.prototype.onChartThemeLoaded=function(){return this._chartThemeLoaded},h.prototype.chartThemeLoaded=function(){this._chartThemeLoaded.fire()},h.prototype.selectBarMode=function(){return this.m_crossHairSource.selectBarMode()},h.prototype.toggleSelectBarMode=function(){this.m_crossHairSource.toggleSelectBarMode()},h.prototype.onBarSelected=function(){return this.m_crossHairSource.onBarSelected()},h.prototype.isSeriesStyleSupported=function(t){return this.m_mainSeries.isStyleSupported(t)},h.prototype.getStudyShiftColorStartOffset=function(){return this._studyShiftColorStartOffset},h.prototype.setStudyShiftColorStartOffset=function(t){this._studyShiftColorStartOffset=t},t.exports=h}).call(e,i(10),i(17),i(73),i(5))},function(t,e,i){"use strict";function o(){s.call(this)}function n(t,e){this._constructor="LineToolFibRetracement";var r=e||this.createPropertiesObject("linetoolfibretracement");a.call(this,t,r),this.version=n.version,this._properties._stateVersion=1,t._fibRetracementLabelsCache||(t._fibRetracementLabelsCache=new o),i.e(1).then(function(t){var e=i(1135).FibRetracementPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(21),s=i(88),a=i(1).LineDataSource,l=i(3).propertyPages;inherit(o,s),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,a),n.version=2,n.LevelsCount=24,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.stop=function(){a.prototype.stop.call(this),this._model._fibRetracementLabelsCache.removeSource(this.id())},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Retracement"},n.prototype.migrateVersion=function(t,e,i){1===t&&this.properties().extendLines.setValue(!0)},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,24],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibRetracementStylesPropertyPage},e.LineToolFibRetracement=n},function(t,e,i){"use strict";(function(e){function i(t){e.call(this,""),this.subscribe(this,i.prototype.checkSelfColor),this.reloadProperties(t)}inherit(i,e),i.prototype.reloadProperties=function(t){for(;this._childs.length>0;)this.removeProperty(this._childs[0]);this._initValues=[];for(var e=0;e<t.length;++e)this._initValues.push(t[e].defaultValue),this.addChild(e,t[e].property);this.checkSelfColor()},i.prototype.setValue=function(t,i){if(this._value!==t||i){var o=this;this._childs.forEach(function(e){o[e].setValue(t||o._initValues[e])}),e.prototype.setValue.call(this,t,i)}},
i.prototype.checkSelfColor=function(){var t,i=!0;for(t=0;t<this._initValues.length;++t)if(this[t].value()!==this[0].value()){i=!1;break}e.prototype.setValue.call(this,i?this[0].value():"")},t.exports=i}).call(e,i(25))},function(t,e,i){"use strict";function o(t,e){this.array=[];for(var i in t)t[i].key=i,this.array.push(t[i]);this.rearrange(e)}o.prototype.rearrange=function(t){if("function"!=typeof t)throw Error("sort param is not a function");return this.array.sort(t)},o.byValue=function(t){return function(t,e){return t-e}},o.byField=function(t){return function(e,i){return e[t]>i[t]?1:e[t]<i[t]?-1:e[t]===i[t]?0:void 0}},o.byOrder=function(t){return function(e,i){return t.indexOf(e.key)-t.indexOf(i.key)}},t.exports=o},function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibChannel";var s=e||this.createPropertiesObject("linetoolfibchannel");r.call(this,t,s),this.version=n.version,t._fibChannelLabelsCache||(t._fibChannelLabelsCache=new o),i.e(1).then(function(t){var e=i(1136).FibChannelPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(1).LineDataSource,s=i(21),a=i(88),l=i(3).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=24,n.version=2,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.migrateVersion=function(t,e,i){i.properties.removeProperty("reverse")},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Fib Channel"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,24],names:["coeff","color","visible"]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibChannelStylesPropertyPage},e.LineToolFibChannel=n},function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibSpeedResistanceArcs";var n=e||this.createPropertiesObject("linetoolfibspeedresistancearcs");r.call(this,t,n),t._fibSpeedResistanceArcsLabelsCache||(t._fibSpeedResistanceArcsLabelsCache=new o),i.e(1).then(function(t){var e=i(1137).FibSpeedResistanceArcsPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(1).LineDataSource,s=i(21),a=i(88),l=i(3).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},inherit(n,r),n.LevelsCount=11,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Speed Resistance Arcs"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibSpeedResistanceArcsStylesPropertyPage},e.LineToolFibSpeedResistanceArcs=n},function(t,e,i){"use strict"
;function o(){a.call(this)}function n(t,e){this._constructor="LineToolProjection";var o=e||this.createPropertiesObject("linetoolprojection");l.call(this,t,o),i.e(1).then(function(t){var e=i(1138).ProjectionLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(21),s=i(333).LineToolFibWedge,a=i(88),l=i(1).LineDataSource,c=i(3).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return 1},inherit(n,s),n.prototype.title=function(){return"Projection"},n.prototype.getCache=function(){return this._model._projectionLabelsCache||(this._model._projectionLabelsCache=new o),this._model._projectionLabelsCache},n.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,1]})},n.prototype.getStylesPropertyPage=function(){return c.LineToolProjectionStylesPropertyPage},e.LineToolProjection=n},function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolTrendBasedFibExtension";var s=e||new this.createPropertiesObject("linetooltrendbasedfibextension");r.call(this,t,s),this.version=n.version,t._trendBasedFibExtensionLabelsCache||(t._trendBasedFibExtensionLabelsCache=new o),i.e(1).then(function(t){var e=i(1139).TrendBasedFibExtensionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(1).LineDataSource,s=i(21),a=i(88),l=i(3).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){return n.LevelsCount},o.prototype.points=function(t){return[t.points()[0],t.points()[1]]},o.prototype.startPoint=function(t,e){return t.points()[2]},o.prototype.priceRange=function(t,e){var i=this.points(t),o=i[0],n=i[1];return e?o.price-n.price:n.price-o.price},o.prototype.sourceIsReady=function(t){return t.points().length>=3},inherit(n,r),n.version=2,n.LevelsCount=24,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.stop=function(){r.prototype.stop.call(this),this._model._trendBasedFibExtensionLabelsCache.removeSource(this.id())},n.prototype.pointsCount=function(){return 3},n.prototype.title=function(){return"Trend-Based Fib Extension"},n.prototype.migrateVersion=function(t,e,i){1===t&&this.properties().extendLines.setValue(!0)},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[0,8]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolTrendBasedFibExtensionStylesPropertyPage},e.LineToolTrendBasedFibExtension=n},function(t,e,i){"use strict";function o(){a.call(this)}function n(t,e){this._constructor="LineToolFibCircles";var n=e||this.createPropertiesObject("linetoolfibcircles");r.call(this,t,n),t._fibCirclesLabelsCache||(t._fibCirclesLabelsCache=new o),i.e(1).then(function(t){var e=i(1140).FibCirclesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(1).LineDataSource,s=i(21),a=i(88),l=i(3).propertyPages;inherit(o,a),o.prototype.levelsCount=function(){
return n.LevelsCount},inherit(n,r),n.LevelsCount=11,n.prototype.levelsCount=function(){return n.LevelsCount},n.prototype.pointsCount=function(){return 2},n.prototype.title=function(){return"Fib Circles"},n.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},n.prototype.createPropertiesObject=function(t,e,i){return new s(t,e,i,{range:[1,11]})},n.prototype.getStylesPropertyPage=function(){return l.LineToolFibCirclesStylesPropertyPage},e.LineToolFibCircles=n},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolVertLine";var o=e||new r("linetoolvertline");this._timeAxisView=new a(this,t),n.call(this,t,o),i.e(1).then(function(t){var e=i(1141).VertLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages,a=i(817).LineToolVertLineTimeAxisView;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Vertical Line"},o.prototype.timeAxisViews=function(){return this.isSourceHidden()?null:this.properties().showTime.value()?[this._timeAxisView]:null},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._timeAxisView.update()},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t=this._points[0],e={index:t.index,price:t.price+1};return[this._linePointsToAlertPlot([t,e],null,!0,!0)]},o.prototype.getInputsPropertyPage=function(){return s.LineToolVertLineInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return s.LineToolVertLineStylesPropertyPage},e.LineToolVertLine=o},function(t,e,i){"use strict";function o(t,e){n.call(this),this._source=t,this._model=e,this._invalidated=!0,this._renderer=new r}var n=i(222).TimeAxisView,r=i(223),s=i(127).DateTimeFormatter;inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e;this._model.timeScale().isEmpty()||0!==this._source.points().length&&(this._text="",this._background=this._source.properties().linecolor.value(),t=this._source.points()[0].index,this._coordinate=this._model.timeScale().indexToCoordinate(t),e=this._model.timeScale().indexToUserTime(t),e&&(this._text=new s(this._model.mainSeries().isDWM()).format(e)),this._invalidated=!1)},o.prototype.renderer=function(){this._invalidated&&this.updateImpl();var t={text:this._text,coordinate:this._coordinate,color:this.color(),background:this._background};return this._renderer.setData(t),this._renderer},e.LineToolVertLineTimeAxisView=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBarsPattern";var r=e||new s("linetoolbarspattern");n.call(this,t,r),r.mirrored.listeners().subscribe(this,o.prototype.mirror),r.flipped.listeners().subscribe(this,o.prototype.flip),r.addExclusion("mirrored"),r.addExclusion("flipped"),this._scaleCoeff=1,this.version=o.version,this._pattern=[],this._properties.mode.listeners().subscribe(this,o.prototype.onModeChanged),
i.e(1).then(function(t){var e=i(1142).BarsPatternPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(52).Action,s=i(6).DefaultProperty,a=i(19).PlotRowSearchMode,l=i(3).propertyPages,c=i(245).LineToolBarsPatternMode;inherit(o,n),o.version=2,o.prototype.onModeChanged=function(){var t=this.patternPriceDiff();t*=this._pressCoeff,this._points[1].price=this._timePoint[1].price=this._points[0].price+t},o.prototype.additionalActions=function(t){var e,i,o=new r({checked:this.properties().mirrored.value(),checkable:!0,text:$.t("Mirrored"),callbackContext:{target:this}}),n=new r({checked:this.properties().flipped.value(),checkable:!0,text:$.t("Flipped"),callbackContext:{target:this}});return o.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().mirrored,!o.properties().mirrored.value(),"Bats Pattern Mirroring"),o.updateAllViews(),o._model.updateSource(o)}),n.callbacks().subscribe(null,function(e){var i=e.callbackContext(),o=i.target;t.setProperty(o.properties().flipped,!o.properties().flipped.value(),"Bats Pattern Flipping"),o.updateAllViews(),o._model.updateSource(o)}),e=new r({checkable:!0,text:$.t("Restore Size")}),i=this,e.callbacks().subscribe(null,function(e){var o=i.points()[0],n=i.patternPriceDiff(),r=o.price+n,s=o.index+i._pattern.length-1;t.startChangingLinetool(i,{price:r,index:s},1,{}),t.changeLinePoint({price:r,index:s},{}),t.endChangingLinetool()}),[o,n,e]},o.prototype.pointsCount=function(){return 2},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.pattern=this._pattern,e},o.prototype.restoreData=function(t){t.pattern&&(this._pattern=t.pattern)},o.prototype.title=function(){return"Bars Pattern"},o.prototype.cloneData=function(t){this._pattern=TradingView.clone(t._pattern)},o.prototype.mirror=function(){var t,e,i,o,n,r=this._pattern,s=r[0][TradingView.HIGH_PLOT],a=Math.min(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]),l=Math.max(r[0][TradingView.LOW_PLOT],r[0][TradingView.HIGH_PLOT]);for(t=1;t<r.length;t++)a=Math.min(a,r[t][TradingView.LOW_PLOT]),l=Math.max(l,r[t][TradingView.HIGH_PLOT]);if(a<l)for(e=(a+l)/2,i=function(t){return e-(t-e)},t=0;t<r.length;t++)r[t][TradingView.HIGH_PLOT]=i(r[t][TradingView.HIGH_PLOT]),r[t][TradingView.LOW_PLOT]=i(r[t][TradingView.LOW_PLOT]),r[t][TradingView.OPEN_PLOT]=i(r[t][TradingView.OPEN_PLOT]),r[t][TradingView.CLOSE_PLOT]=i(r[t][TradingView.CLOSE_PLOT]);o=r[0][TradingView.HIGH_PLOT]-s,n=r[r.length-1][TradingView.LOW_PLOT]-r[0][TradingView.HIGH_PLOT],this._points[0].price+=o,this._points[1].price=this._points[0].price+n,this.updateAllViews()},o.prototype.flip=function(){var t,e,i;for(this._points[0].price=this._points[1].price,t=0;t<this._pattern.length/2;t++)e=this._pattern[t],this._pattern[t]=this._pattern[this._pattern.length-t-1],this._pattern[this._pattern.length-t-1]=e;i=this._pattern[this._pattern.length-1][TradingView.LOW_PLOT]-this._pattern[0][TradingView.HIGH_PLOT],this._points[1].price=this._points[0].price+i,
this.updateAllViews()},o.prototype.firstPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[0][TradingView.HIGH_PLOT]+this._pattern[0][TradingView.LOW_PLOT])/2:(t={0:TradingView.HIGH_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.OPEN_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[0][e])},o.prototype.lastPatternPrice=function(){var t,e,i=parseInt(this.properties().mode.value(),10);return i===c.LineHL2?(this._pattern[this._pattern.length-1][TradingView.HIGH_PLOT]+this._pattern[this._pattern.length-1][TradingView.LOW_PLOT])/2:(t={0:TradingView.LOW_PLOT,1:TradingView.CLOSE_PLOT,2:TradingView.CLOSE_PLOT,3:TradingView.OPEN_PLOT,4:TradingView.HIGH_PLOT,5:TradingView.LOW_PLOT},e=t[i],this._pattern[this._pattern.length-1][e])},o.prototype.patternPriceDiff=function(){return this.lastPatternPrice()-this.firstPatternPrice()},o.prototype.pressCoeff=function(){var t=this.patternPriceDiff(),e=this.points()[0].price,i=this.points()[1].price,o=i-e,n=o/t;return this._pressCoeff=n,n},o.prototype.addPoint=function(t,e){var i,o,r,s,l,h,u,d,p,_,f=this._model.mainSeries(),m=f.nearestIndex(t.index,a.NearestRight);if(this.properties().mode.value()===c.Bars?t.price=f.bars().valueAt(m)[TradingView.HIGH_PLOT]:t.price=f.bars().valueAt(m)[TradingView.CLOSE_PLOT],i=this.priceScale().priceRange().length(),t.price+=.05*i,o=f.priceScale(),o.isPercent()&&(r=f.firstValue(),t.price=o.priceRange().convertToPercent(t.price,r)),s=n.prototype.addPoint.call(this,t,e,!0)){for(l=Math.min(this.points()[0].index,this.points()[1].index),h=Math.max(this.points()[0].index,this.points()[1].index),m=this._model.mainSeries().nearestIndex(l,a.NearestRight),u=this._model.mainSeries().nearestIndex(h,a.NearestLeft),this.points()[0].index>this.points()[1].index&&(this._points[0].price=this._points[1].price),this._pattern=[],d=m;d<=u;d++)p=this._model.mainSeries().data().valueAt(d),this._pattern.push(TradingView.clone(p));this._pattern.length>0&&(_=this.patternPriceDiff(),this._points[1].price=this._points[0].price+_,this._points[1].index=this._points[0].index+(u-m),this.normalizePoints(),this.createServerPoints())}return s},o.prototype.setPoint=function(t,e,i){1===t&&e.index<=this._points[0].index&&(e.index=this._points[0].index+1),0===t&&e.index>=this._points[1].index&&(e.index=this._points[1].index-1),n.prototype.setPoint.call(this,t,e,i)},o.prototype.migrateVersion=function(t,e,i){if(1===t&&this._pattern.length>0){var o=this.patternPriceDiff();2===this._timePoint.length&&(this._timePoint[1].price=this._timePoint[0].price+o),2===this._points.length&&(this._points[1].price=this._points[0].price+o)}},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolBarsPatternStylesPropertyPage},e.LineToolBarsPattern=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTrendBasedFibTime";var r=e||new this.createPropertiesObject("linetooltrendbasedfibtime");n.call(this,t,r),
this.version=o.version,i.e(1).then(function(t){var e=i(1143).TrendBasedFibTimePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(21),s=i(3).propertyPages;inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Trend-Based Fib Time"},o.prototype.migrateVersion=function(t,e,i){},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolTrendBasedFibTimeStylesPropertyPage},e.LineToolTrendBasedFibTime=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFibTimeZone";var r=e||this.createPropertiesObject("linetoolfibtimezone");n.call(this,t,r),this.version=o.version,i.e(1).then(function(t){var e=i(1144).FibTimeZonePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(21),s=i(3).propertyPages;inherit(o,n),o.version=2,o.prototype.migrateVersion=function(t,e,i){var o;if(1===t){for(i.properties.level1.color.setValue(i.properties.baselinecolor.value()),o=2;o<=11;o++)i.properties["level"+o].color.setValue(i.properties.linecolor.value());for(o=1;o<=11;o++)i.properties["level"+o].linewidth.setValue(i.properties.linewidth.value()),i.properties["level"+o].linestyle.setValue(i.properties.linestyle.value())}},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Time Zone"},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,11]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolFibTimeZoneStylesPropertyPage},e.LineToolFibTimeZone=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolCircleLines";var o=e||new r("linetoolcirclelines");n.call(this,t,o),i.e(1).then(function(t){var e=i(1145).LineToolCircleLinesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Cyclic Lines"},o.prototype.getStylesPropertyPage=function(){return s.LineToolCircleLinesStylesPropertyPage},e.LineToolCircleLines=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolDateRange";var o=e||new r("linetooldaterange");n.call(this,t,o),i.e(1).then(function(t){var e=i(1146).DateRangePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Date Range"},o.prototype.getStylesPropertyPage=function(){
return s.LineToolDateRangeStylesPropertyPage},e.LineToolDateRange=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPriceRange";var o=e||new r("linetoolpricerange");n.call(this,t,o),i.e(1).then(function(t){var e=i(1147).PriceRangePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Price Range"},o.prototype.getStylesPropertyPage=function(){return s.LineToolDateRangeStylesPropertyPage},e.LineToolPriceRange=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolDateAndPriceRange";var o=e||new r("linetooldateandpricerange");n.call(this,t,o),i.e(1).then(function(t){var e=i(1148).DateAndPriceRangePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Date and Price Range"},o.prototype.getStylesPropertyPage=function(){return s.LineToolDateAndPriceRangeStylesPropertyPage},e.LineToolDateAndPriceRange=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolParallelChannel";var o=e||new r("linetoolparallelchannel");n.call(this,t,o),i.e(1).then(function(t){var e=i(1149).ParallelChannelPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.addPoint=function(t){var e,i=n.prototype.addPoint.call(this,t);return i&&(e=this.points()[0],this._points[2].index=e.index,this._points[2].price=e.price+this._priceOffset),i},o.prototype.calculatePriceDiff=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;if(3===this.points().length){if(t=this.points()[0],e=this.points()[1],i=this.points()[2],t.index===e.index)return;if(null===(o=this.priceScale()))return;if(o.isLog()){if(n=this._model.timeScale(),n.isEmpty())return;r=n.indexToCoordinate(t.index),s=n.indexToCoordinate(e.index),a=o.priceToCoordinate(t.price),l=o.priceToCoordinate(e.price),c=n.indexToCoordinate(i.index),h=(l-a)/(s-r),u=a+h*(c-r),d=o.priceToCoordinate(i.price),p=d-u,_=.5*(a+l),f=o.coordinateToPrice(_),m=_+p,g=o.coordinateToPrice(m),this._priceOffset=g-f}else h=(e.price-t.price)/(e.index-t.index),v=t.price+h*(i.index-t.index),this._priceOffset=i.price-v}},o.prototype.setLastPoint=function(t,e){e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),n.prototype.setLastPoint.call(this,t),this.calculatePriceDiff()},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),t&&t.length>=3&&(this._priceOffset=t[2].price-t[0].price)},o.prototype.setPoint=function(t,e,i){i&&i.shift&&t<2&&this._snapPoint45Degree(e,this.points()[1-t]),n.prototype.setPoint.call(this,t,e,i),2===t&&this.calculatePriceDiff();var o=this.points()[0]
;this._points[2].index=o.index,this._points[2].price=o.price+this._priceOffset},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Parallel Channel"},o.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[0]),n.prototype.addPoint.call(this,t,e)},o.prototype.fixAfterRestorePriceAxis=function(){this.priceScale().isLog()||delete this._priceOffset},o.prototype.cloneData=function(t){this._priceOffset=t._priceOffset},o.prototype.restoreData=function(t){t.priceOffset&&(this._priceOffset=t.priceOffset)},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.priceOffset=this._priceOffset,e},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){function t(t,e){return t.index<=e.index?[t,e]:[e,t]}var e,i,o,n,r,s,a,l,c=[].concat(this._points).splice(0,2);return c=c.concat([{price:c[0].price+this._priceOffset,time:c[0].time,index:c[0].index},{price:c[1].price+this._priceOffset,time:c[1].time,index:c[1].index}]),e=t(c[0],c[1]),i=t(c[2],c[3]),this._priceOffset<0?(n=i,o=e):(n=e,o=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c[0].index<=c[1].index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(o,"Upper",r,s),this._linePointsToAlertPlot(n,"Lower",r,s)]},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolParallelChannelStylesPropertyPage},e.LineToolParallelChannel=o},function(t,e,i){"use strict";(function(t){function o(t,e){this._constructor="LineToolTrendAngleLine";var n=e||new s("linetooltrendangle");r.call(this,t,n),this._properties.addProperty("angle"),this._properties.angle=new o.AngleProperty(this),i.e(1).then(function(t){var e=i(1150).TrendAnglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(8).Point,r=i(1).LineDataSource,s=i(6).DefaultProperty,a=i(3).propertyPages;inherit(o,r),o.AngleProperty=function(e){t.call(this),this._lineSource=e},inherit(o.AngleProperty,t),o.AngleProperty.prototype.value=function(){var t=this._lineSource._angle,e=180*t/Math.PI;return Math.round(e)},o.AngleProperty.prototype.setValue=function(t){var e,i,o,r,s,a,l=t*Math.PI/180;this._lineSource._angle=l,e=this._lineSource.pointToScreenPoint(this._lineSource.points()[0])[0],i=Math.cos(this._lineSource._angle),o=-Math.sin(this._lineSource._angle),r=new n(i,o),s=e.addScaled(r,this._lineSource._distance),a=this._lineSource.screenPointToPoint(s),this._lineSource._points[1]=a,this._lineSource._model.updateSource(this._lineSource),this._lineSource.updateAllViews(),this._lineSource._model.updateSource(this._lineSource)},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Trend Angle"},o.prototype._calculateAngle=function(){var t,e=this.pointToScreenPoint(this.points()[0])[0],i=this.pointToScreenPoint(this.points()[1])[0],o=i.subtract(e);o.length()>0?(o=o.normalized(),this._angle=Math.acos(o.x),o.y>0&&(this._angle=-this._angle),
this._distance=i.subtract(e).length()):delete this._angle,t=this.properties(),t.hasOwnProperty("angle")&&this.properties().angle.listeners().fire(this.properties().angle)},o.prototype.addPoint=function(t,e){var i=r.prototype.addPoint.call(this,t,e);return i&&this._calculateAngle(),i},o.prototype.setLastPoint=function(t,e){r.prototype.setLastPoint.call(this,t,e),this.points().length>1&&this._calculateAngle()},o.prototype.axisPoints=function(){var t,e,i,o,r,s;return this.points().length<2?[]:(t=[this.points()[0]],e=this.pointToScreenPoint(this.points()[0])[1],i=Math.cos(this._angle)*this._distance,o=-Math.sin(this._angle)*this._distance,r=e.add(new n(i,o)),s=this.screenPointToPoint(r),t.push(s),t)},o.prototype.setPoint=function(t,e,i){r.prototype.setPoint.call(this,t,e,i),this.points().length>1&&1===t&&this._calculateAngle()},o.prototype.restoreData=function(t){this._angle=t.angle,this._distance=t.distance},o.prototype.state=function(t){var e=r.prototype.state.call(this,t);return e.angle=this._angle,e.distance=this._distance,e},o.prototype.cloneData=function(t){this._angle=t._angle,this._distance=t._distance},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){return[this._linePointsToAlertPlot(this._points,null,this.properties().extendLeft.value(),this.properties().extendRight.value())]},o.prototype.getInputsPropertyPage=function(){return a.LineToolTrendAngleInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return a.LineToolTrendAngleStylesPropertyPage},e.LineToolTrendAngle=o}).call(e,i(25))},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPitchfan";var o=e||this.createPropertiesObject("linetoolpitchfan");n.call(this,t,o),i.e(1).then(function(t){var e=i(1153).PitchfanLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(21),s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Pitchfan"},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[0,8]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolPitchfanStylesPropertyPage},e.LineToolPitchfan=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolGannSquare";var o=e||this.createPropertiesObject("linetoolgannsquare");s.call(this,t,o),i.e(1).then(function(t){var e=i(1154).GannSquarePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n,r,s=i(1).LineDataSource,a=i(21),l=i(3).propertyPages;inherit(o,s),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Gann Box"},n=[4.5,9,11.25,18,22.5,36,45],r=function(){for(var t=[],e=1e10,i=n.length-1,o=1,r=0,s=0;s<e;)s=n[r]*o,t.push(Math.round(s)),t.push(Math.ceil(-s)),r===i-1&&(o*=10),r=(r+1)%i;return t.sort(function(t,e){return t<e?-1:t>e?1:0}),t}(),
o.prototype._alignPriceOnPattern=function(t,e){var i,o,r,s,a,l,c=Math.round(1e6*(t.price-e.price))/1e6;if(0===c)return e.price;for(i=n[0],o=n[n.length-1],r=1,s=Math.abs(c);s<i*r||o*r<s;)s<i*r?r*=.1:o*r<s&&(r*=10);for(a=o*r,l=n.length-2;l>=0&&!(n[l]*r<s);--l)a=n[l]*r;return t.price=e.price+(c>=0?a:-a),t},o.prototype._alignTimeOnPattern=function(t,e){var i,o=t.index-e.index;if(0===o)return 0;for(i=r.length-2;i>=0&&!(r[i]<o);--i);return i+=o>0?1:0,t.index=e.index+r[i],t},o.prototype._alignPointsFixedIncrement=function(t,e){return this._alignTimeOnPattern(t,e),this._alignPriceOnPattern(t,e),t},o.prototype._preparePoint=function(t,e){return e&&e.shift&&0!==this._points.length&&this._alignPointsFixedIncrement(t,this._points[0]),s.prototype._preparePoint.call(this,t,e)},o.prototype.setPoint=function(t,e,i){if(i&&i.shift){var o=0===t?this._points[1]:this._points[0];this._alignPointsFixedIncrement(e,o)}s.prototype.setPoint.call(this,t,e,i)},o.prototype.createPropertiesObject=function(t,e,i){return new a(t,e,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return l.LineToolGannSquareStylesPropertyPage},e.LineToolGannSquare=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFibSpeedResistanceFan";var o=e||this.createPropertiesObject("linetoolfibspeedresistancefan");n.call(this,t,o),i.e(1).then(function(t){var e=i(1155).FibSpeedResistanceFanPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(21),s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Speed Resistance Fan"},o.prototype.processErase=function(t,e){var i="h"===e.type?"hlevel"+e.index:"vlevel"+e.index,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,7],prefixes:["h","v"],names:["coeff","color","visible"]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpeedResistanceFanStylesPropertyPage},e.LineToolFibSpeedResistanceFan=o},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(8),r=i(9),s=i(213),a=i(1),l=i(160),c=i(3),h=i(335),u=function(t){function e(e,o){var n,r=t.call(this,e,null==o?h.createPropertiesObject("linetoolganncomplex"):o)||this;return r.version=2,r._constructor="LineToolGannComplex",r._scaleRatioFormatter=new s.LimitedPrecisionNumericFormatter(7),i.e(1).then(function(t){var e=i(1156).GannComplexPaneView;r._setPaneViews([new e(r,r.model())])}.bind(null,i)).catch(i.oe),n=r.properties(),r._adjustScaleRatio(n),n.subscribe(r,r._adjustScaleRatio),n.scaleRatio.subscribe(r,r._correctFirstPoint),r._syncStateExclusions=["scaleRatio"],n.addExclusion("scaleRatio"),r._onRestoringFactoryDefaults.subscribe(r,r._handleRestoringFactoryDefaults),r._onTemplateApplying.subscribe(r,r._handleTemplateApplying),r._onTemplateApplied.subscribe(r,r._correctFirstPoint),r}
return o.__extends(e,t),e.prototype.migrateVersion=function(t,e,i){var o=this;1===t&&(this._points.length>=this.pointsCount()?setTimeout(function(){return o._migratePoint()}):this._timePoint.length>=this.pointsCount()&&this._pointAdded.subscribe(this,this._migratePoint))},e.prototype.destroy=function(){var t=this.properties();t.unsubscribe(this,this._adjustScaleRatio),t.scaleRatio.unsubscribe(this,this._correctFirstPoint),this._onRestoringFactoryDefaults.unsubscribe(this,this._handleRestoringFactoryDefaults),this._onTemplateApplying.unsubscribe(this,this._handleTemplateApplying),this._onTemplateApplied.unsubscribe(this,this._correctFirstPoint)},e.prototype.pointsCount=function(){return 2},e.prototype.title=function(){return"Gann Square"},e.prototype.addPoint=function(e,i,o){var n,s,a;return this._points.length>1&&this._points.pop(),n=t.prototype.addPoint.call(this,e,i,o),s=this.priceScale(),a=r.ensureNotNull(s).isLog(),!a&&n&&this._correctFirstPoint(),n},e.prototype.setPoint=function(e,i,o){t.prototype.setPoint.call(this,e,i,o),void 0!==o&&o.shift?this._correctPoint(e):this._correctScaleRatio()},e.prototype.setLastPoint=function(e,i){var o=this.priceScale();r.ensureNotNull(o).isLog()||(this._convertPriceFromPercentIfNeeded(e),this._points[1]=e,this._correctPoint(1),this._convertPriceToPercentIfNeeded(e)),t.prototype.setLastPoint.call(this,e,i)},e.prototype.createPropertiesObject=function(t,e,i){return h.createPropertiesObject(t,e,i)},e.prototype.getStylesPropertyPage=function(){return c.propertyPages.LineToolGannComplexStylesPropertyPage},e.prototype.isReversed=function(){return this.properties().reverse.value()},e.prototype.levelsCount=function(){return this.properties().levels.childCount()},e.prototype.levels=function(){var t,e,i=[],o=this.properties(),n=o.levels.childCount();for(t=0;t<n;t++)e=o.levels[t],i.push({index:t,visible:e.visible.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},e.prototype.fanLines=function(){var t,e,i=[],o=this.properties(),n=o.fanlines.childCount();for(t=0;t<n;t++)e=o.fanlines[t],i.push({index:t,visible:e.visible.value(),x:e.x.value(),y:e.y.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.arcsCount=function(){return this.properties().arcs.childCount()},e.prototype.arcs=function(){var t,e,i=[],o=this.properties(),n=o.arcs.childCount();for(t=0;t<n;t++)e=o.arcs[t],i.push({index:t,visible:e.visible.value(),x:e.x.value(),y:e.y.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},e.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},e.prototype.isLabelsVisible=function(){return this.properties().showLabels.value()},e.prototype.getLabelsStyle=function(){var t=this.properties(),e=t.labelsStyle,i=e.font,o=e.fontSize,n=e.bold,r=e.italic,s=t.levels.childCount();return{
textColor:t.levels[s-1].color.value(),font:i.value(),fontSize:o.value(),bold:n.value(),italic:r.value()}},e.prototype.getScaleRatioStep=function(){return 1e-7},e.prototype.getScaleRatioFormatter=function(){return this._scaleRatioFormatter},e.prototype.getPriceDiff=function(){var t,e,i=this.points();return i.length<2?null:(t=i[0],e=i[1],e.price-t.price)},e.prototype.getPercantageDiff=function(){var t,e,i,o,n,r,s,a=this.points();return a.length<2?null:(t=a[0],e=a[1],i=this.model(),o=i.mainSeries(),n=o.priceScale(),r=n.priceRange(),s=o.firstValue(),null===r||null==s?null:r.convertToPercent(e.price,s)-r.convertToPercent(t.price,s))},e.prototype.getIndexDiff=function(){var t,e,i=this.points();return i.length<2?null:(t=i[0],e=i[1],e.index-t.index)},e.prototype.getScaleRatio=function(){var t=this.getPriceDiff(),e=this.getIndexDiff();return null!==t&&null!==e&&0!==e?Math.abs(t/e):null},e.prototype._correctScaleRatio=function(){var t=this.properties(),e=this.getScaleRatio();t.scaleRatio.setValue(e)},e.prototype._getAdjustedScaleRatio=function(){var t=this.model().mainSeries().priceScale(),e=this.model().timeScale();return l.scaleRatio(e,t)},e.prototype._adjustScaleRatio=function(t){var e=t.scaleRatio.value();""!==e&&null!==e||t.scaleRatio.setValue(this._getAdjustedScaleRatio())},e.prototype._correctPoint=function(t){var e,i,o,n,r,s,a,l;this._points.length<2||null!==(e=this.getIndexDiff())&&(i=this.properties(),o=i.scaleRatio.value(),null!==o&&(n=this._points[t],r=0===t?this._points[1]:this._points[0],s=n.price-r.price>0,a=n.index-r.index>0,l=s&&!a||!s&&a?-1:1,0===t&&(l=-l),n.price=r.price+l*e*o,this._pointChanged.fire(t)),this.normalizePoints())},e.prototype._correctFirstPoint=function(){this._correctPoint(this.isReversed()?0:1)},e.prototype._handleRestoringFactoryDefaults=function(){this.properties().scaleRatio.setValue(this._getAdjustedScaleRatio())},e.prototype._handleTemplateApplying=function(t){""===t.scaleRatio&&(t.scaleRatio=this._getAdjustedScaleRatio())},e.prototype._migratePoint=function(){var t,e;this.points().length<this.pointsCount()||null!==(t=this._getScreenPoints())&&(e=this.screenPointToPoint(t[1]),this.setPoint(1,e),this._pointAdded.unsubscribe(this,this._migratePoint))},e.prototype._getScreenPoints=function(){var t,e,i,o,r,s,a,l,c,h,u,d=this._calcAngle();return null===d?null:(t=this.points(),e=t[0],i=t[1],this.isReversed()&&(u=[i,e],e=u[0],i=u[1]),o=this.pointToScreenPoint(e)[0],r=this.pointToScreenPoint(i)[0],s=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),a=new n.Point(Math.cos(d),-Math.sin(d)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1,[o.addScaled(a,s),o.add(new n.Point(5*s*c,5*s*h))])},e.prototype._calcAngle=function(){var t,e=this.points(),i=e[0],o=e[1],n=this.pointToScreenPoint(i)[0],r=this.pointToScreenPoint(o)[0],s=r.subtract(n);return s.length()>0?(s=s.normalized(),t=Math.acos(s.x),s.y>0&&(t=-t),t):null},e}(a.LineDataSource),e.LineToolGannComplex=u,u.prototype.superclass=a.LineDataSource},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),
n=i(8),r=i(1),s=i(335),a=i(3),l=function(t){function e(e,o){var n=t.call(this,e,null==o?s.createPropertiesObject("linetoolgannfixed"):o)||this;return n._constructor="LineToolGannFixed",i.e(1).then(function(t){var e=i(1157).GannFixedPaneView;n._setPaneViews([new e(n,n.model())])}.bind(null,i)).catch(i.oe),n.properties().reverse.subscribe(n,n._reversePoints),n}return o.__extends(e,t),e.prototype.pointsCount=function(){return 2},e.prototype.title=function(){return"Gann Square Fixed"},e.prototype.createPropertiesObject=function(t,e,i){return s.createPropertiesObject(t,e,i)},e.prototype.getStylesPropertyPage=function(){return a.propertyPages.LineToolGannFixedStylesPropertyPage},e.prototype.axisPoints=function(){var t=this.points(),e=this.getScreenPoints();return t.length<2||e.length<2?[]:[t[0],this.screenPointToPoint(e[1])]},e.prototype.getScreenPoints=function(){var t,e,i,o,r,s,a,l,c,h,u=this.points();return u.length<2?[]:null===(t=this._calcAngle())?[]:(e=u[0],i=u[1],o=this.pointToScreenPoint(e)[0],r=this.pointToScreenPoint(i)[0],s=Math.sqrt(Math.pow(o.x-r.x,2)+Math.pow(o.y-r.y,2)),a=new n.Point(Math.cos(t),-Math.sin(t)),l=a.normalized(),c=l.x<0?-1:1,h=l.y<0?-1:1,[o.addScaled(a,s),o.add(new n.Point(5*s*c,5*s*h))])},e.prototype.levelsCount=function(){return this.properties().levels.childCount()},e.prototype.levels=function(){var t,e,i=[],o=this.properties(),n=o.levels.childCount();for(t=0;t<n;t++)e=o.levels[t],i.push({index:t,visible:e.visible.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.fanLinesCount=function(){return this.properties().fanlines.childCount()},e.prototype.fanLines=function(){var t,e,i=[],o=this.properties(),n=o.fanlines.childCount();for(t=0;t<n;t++)e=o.fanlines[t],i.push({index:t,visible:e.visible.value(),x:e.x.value(),y:e.y.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.arcsCount=function(){return this.properties().arcs.childCount()},e.prototype.arcs=function(){var t,e,i=[],o=this.properties(),n=o.arcs.childCount();for(t=0;t<n;t++)e=o.arcs[t],i.push({index:t,visible:e.visible.value(),x:e.x.value(),y:e.y.value(),color:e.color.value(),width:e.width.value()});return i},e.prototype.arcsBackgroundTransparency=function(){return this.properties().arcsBackground.transparency.value()},e.prototype.isArcsBackgroundFilled=function(){return this.properties().arcsBackground.fillBackground.value()},e.prototype._calcAngle=function(){var t,e,i,o,n,r,s=this.points();return s.length<2?null:(t=s[0],e=s[1],i=this.pointToScreenPoint(t)[0],o=this.pointToScreenPoint(e)[0],n=o.subtract(i),n.length()<=0?null:(n=n.normalized(),r=Math.acos(n.x),n.y>0&&(r=-r),r))},e.prototype._reversePoints=function(){var t=this._points,e=t[0],i=t[1];this._points[0]=i,this._points[1]=e,this.normalizePoints(),this.restart()},e}(r.LineDataSource),e.LineToolGannFixed=l,l.prototype.superclass=r.LineDataSource},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolGannFan";var o=e||this.createPropertiesObject("linetoolgannfan");n.call(this,t,o),i.e(1).then(function(t){
var e=i(1158).GannFanPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(21),s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Gann Fan"},o.prototype.processErase=function(t,e){var i="level"+e,o=this.properties()[i].visible;t.setProperty(o,!1,"Erase level line")},o.prototype.createPropertiesObject=function(t,e,i){return new r(t,e,i,{range:[1,9]})},o.prototype.getStylesPropertyPage=function(){return s.LineToolGannFanStylesPropertyPage},e.LineToolGannFan=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolDisjointAngle";var s=e||new r("linetooldisjointangle");n.call(this,t,s),this.version=o.version,i.e(1).then(function(t){var e=i(1160).DisjointAnglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Disjoint Angle"},o.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.addPoint.call(this,t)},o.prototype.setLastPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.setLastPoint.call(this,t)},o.prototype.setPoint=function(t,e,i){var o,r,s,a,l,c=.5*(this._points[1].price+this._points[2].price);i&&i.shift&&1===t&&(o=0,this._snapPoint45Degree(e,this.points()[o])),t<3&&n.prototype.setPoint.call(this,t,e),0!==t&&2!==t&&(1===t?(r=this._points[1].price-c,this._points[2].price=this._points[1].price-2*r):3===t&&(s=this.priceScale(),a=e.price,s.isPercent()&&(l=this.ownerSource().firstValue(),a=s.priceRange().convertFromPercent(a,l)),r=a-this._points[2].price,this._points[0].price=this._points[1].price-r,this._points[0].index=e.index))},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t,e,i,o,n,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),t=this._points[2],t.time=h.time,t.index=h.index,e={price:t.price+(h.price-c.price),time:c.time,index:c.index},i=[],t.index<=e.index?(i.push(t),i.push(e)):(i.push(e),i.push(t)),u[0].price>i[0].price?(o=u,n=i):i[0].price>u[0].price?(o=i,n=u):i[1].price>u[1].price?(o=i,n=u):(o=u,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(o,"Upper",r,s),this._linePointsToAlertPlot(n,"Lower",r,s)]},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolDisjointAngleStylesPropertyPage},e.LineToolDisjointAngle=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFlatBottom";var s=e||new r("linetoolflatbottom");n.call(this,t,s),this.version=o.version,
i.e(1).then(function(t){var e=i(1161).FlatBottomPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.version=1,o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Flat Bottom"},o.prototype.addPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.addPoint.call(this,t)},o.prototype.setLastPoint=function(t,e){return e&&e.shift&&2===this.points().length&&this._snapPoint45Degree(t,this.points()[this.points().length-2]),n.prototype.setLastPoint.call(this,t)},o.prototype.setPoint=function(t,e,i){if(i&&i.shift&&1===t){this._snapPoint45Degree(e,this.points()[0])}t<3?n.prototype.setPoint.call(this,t,e):this._points[0].index=e.index},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t,e,i,o,n,r,s,a,l,c=this._points[0],h=this._points[1],u=[];return c.index<=h.index?(u.push(c),u.push(h)):(u.push(h),u.push(c)),t=this._points[2],t.time=h.time,t.index=h.index,e={price:t.price,time:c.time,index:c.index},i=[],t.index<=e.index?(i.push(t),i.push(e)):(i.push(e),i.push(t)),u[0].price>i[0].price?(o=u,n=i):i[0].price>u[0].price?(o=i,n=u):i[1].price>u[1].price?(o=i,n=u):(o=u,n=i),a=this.properties().extendLeft.value(),l=this.properties().extendRight.value(),c.index<=h.index?(r=a,s=l):(r=l,s=a),[this._linePointsToAlertPlot(o,"Upper",r,s),this._linePointsToAlertPlot(n,"Lower",a,s)]},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolFlatBottomStylesPropertyPage},e.LineToolFlatBottom=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolIcon";var s=e||new r("linetoolicon");s.addExclusion("angle"),s.addExclusion("scale"),n.call(this,t,s),this.version=o.version,i.e(1).then(function(t){var e=i(1162).IconPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.version=1,o.anchorLimit=80,o.prototype.getAnchorLimit=function(){return o.anchorLimit},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Icon"},o.prototype.startChanging=function(t,e){var i,r;n.prototype.startChanging.call(this,t,e),i=this.properties(),r=65536*i.icon.value()+i.size.value(),this._startChangeWidth=this._paneViews[0]._cache[r],i.size.value()<o.anchorLimit?this._sizeScale=i.size.value()/o.anchorLimit:this._sizeScale=1,this._origScale=i.scale.value(),this._startChangeWidth*this._origScale<o.anchorLimit?this._resizeRatio=this._startChangeWidth/o.anchorLimit:this._resizeRatio=1},o.prototype.endChanging=function(){n.prototype.endChanging.call(this),delete this._startChangeWidth,delete this._sizeScale,delete this._resizeRatio},o.prototype.setPoint=function(t,e,i){var n,r,s,a,l,c,h,u,d,p,_=$.extend({},e),f=this.priceScale();f.isPercent()&&(n=this.ownerSource().firstValue(),
_.price=f.priceRange().convertFromPercent(_.price,n)),i&&i.shift&&this._properties.snapTo45Degrees&&this._snapPoint45Degree(_,this.points()[0]),r=this.pointToScreenPoint(this.points()[0])[1],s=this.pointToScreenPoint(_)[1],0===t||1===t?(a=s.subtract(r).normalized(),l=2*s.subtract(r).length(),l*=this._sizeScale,this._properties.size.setValue(l),c=-a.x,h=Math.acos(c),Math.asin(a.y)>0&&(h=2*Math.PI-h),0===t&&(h+=Math.PI),this._properties.angle.setValue(h)):(u=this._startChangeWidth,d=s.subtract(r).length(),this._origScale*u<o.anchorLimit?(p=o.anchorLimit/2,this._properties.scale.setValue(this._origScale*d/p)):(p=u/2,this._properties.scale.setValue(d/p)))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolIconStylesPropertyPage},o.prototype.getSourceIcon=function(){return{type:"text",text:String.fromCharCode(this.properties().icon.value())}},e.LineToolIcon=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRotatedRectangle";var o=e||new a("linetoolrotatedrectangle");s.call(this,t,o),i.e(1).then(function(t){var e=i(1163).RotatedRectanglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(8).Point,r=i(44).distanceToLine,s=i(1).LineDataSource,a=i(6).DefaultProperty,l=i(3).propertyPages;inherit(o,s),o.prototype.startChanging=function(t,e){var i,o,n,a;s.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this._paneViews[0],o=i._points[0],n=i._points[1],a=i._points[2],this._distance=r(o,n,a).distance)},o.prototype.setPoint=function(t,e,i){var o,r,a,l,c,h,u;s.prototype.setPoint.call(this,t,e,i),0!==t&&1!==t||(o=this._paneViews[0],o.update(),r=o._points[0],a=o._points[1],l=a.subtract(r),c=new n(l.y,-l.x).normalized().scaled(this._distance),h=r.add(c),u=this.screenPointToPoint(h),this._points[2]=u)},o.prototype.endChanging=function(){delete this._distance},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Rotated Rectangle"},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolRectangleStylesPropertyPage},e.LineToolRotatedRectangle=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFibSpiral";var o=e||new r("linetoolfibspiral");n.call(this,t,o),i.e(1).then(function(t){var e=i(1164).FibSpiralPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Fib Spiral"},o.prototype.getStylesPropertyPage=function(){return s.LineToolFibSpiralStylesPropertyPage},e.LineToolFibSpiral=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolHeadAndShoulders";var o=e||new r("linetoolheadandshoulders");n.call(this,t,o),i.e(1).then(function(t){var e=i(1165).LineToolHeadAndShouldersPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)
}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 7},o.prototype.title=function(){return"Head and Shoulders"},o.prototype.getStylesPropertyPage=function(){return s.LineToolLineTool5PointsPatternStylesPropertyPage},e.LineToolHeadAndShoulders=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTriangle";var o=e||new r("linetooltriangle");n.call(this,t,o),i.e(1).then(function(t){var e=i(1166).TrianglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Triangle"},o.prototype.getStylesPropertyPage=function(){return s.LineToolTriangleStylesPropertyPage},e.LineToolTriangle=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTrianglePattern";var o=e||new r("linetooltrianglepattern");n.call(this,t,o),i.e(1).then(function(t){var e=i(1167).LineToolTrianglePatternPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 4},o.prototype.title=function(){return"Triangle Pattern"},o.prototype.getStylesPropertyPage=function(){return s.LineToolTrianglePatternStylesPropertyPage},e.LineToolTrianglePattern=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolThreeDrivers";var o=e||new r("linetoolthreedrivers");n.call(this,t,o),i.e(1).then(function(t){var e=i(1168).LineToolThreeDrivesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 7},o.prototype.title=function(){return"Three Drives Pattern"},o.prototype.getStylesPropertyPage=function(){return s.LineToolABCDPatternStylesPropertyPage},e.LineToolThreeDrivers=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolABCD";var o=e||new r("linetoolabcd");n.call(this,t,o),i.e(1).then(function(t){var e=i(1169).ABCDPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(127).DateTimeFormatter,a=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 4},o.prototype.title=function(){return"ABCD Pattern"},o.prototype._tooltipFieldsHash={time0:{title:"Date 1",value:null},price0:{title:"Price 1",value:null},time1:{title:"Date 2",value:null},price1:{title:"Price 2",value:null},time2:{title:"Date 3",value:null},price2:{title:"Price 3",value:null},time3:{title:"Date 4",value:null},price3:{title:"Price 4",value:null}},o.prototype._updateTooltip=function(){var t,e,i,o,n=this._tooltipFieldsHash,r=this.points().m_values;r[0]&&(t=this._model.timeScale().indexToUserTime(r[0].index),
n.time0.value=t?new s(this._model.mainSeries().isDWM()).format(t):0,n.price0.value=this._model.mainSeries()._formatter.format(r[0].price)),r[1]&&(e=this._model.timeScale().indexToUserTime(r[1].index),n.time1.value=e?new s(this._model.mainSeries().isDWM()).format(e):0,n.price1.value=this._model.mainSeries()._formatter.format(r[1].price)),r[2]&&(i=this._model.timeScale().indexToUserTime(r[2].index),n.time2.value=i?new s(this._model.mainSeries().isDWM()).format(i):0,n.price2.value=this._model.mainSeries()._formatter.format(r[2].price)),r[3]&&(o=this._model.timeScale().indexToUserTime(r[3].index),n.time3.value=o?new s(this._model.mainSeries().isDWM()).format(o):0,n.price3.value=this._model.mainSeries()._formatter.format(r[3].price))},o.prototype.tooltip=function(){return this._updateTooltip(),this._formatTooltip()},o.prototype.getStylesPropertyPage=function(){return a.LineToolABCDPatternStylesPropertyPage},e.LineToolABCD=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(67),r=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o;t.visible=!1,e=this._source.priceScale(),0===this._source.points().length||null===e||e.isEmpty()||(i=this._data.priceProperty.value(),o=this._data.colorProperty.value(),t.background=o,t.color=this.generateTextColor(o),t.coordinate=e.priceToCoordinate(i),t.text=e.formatter().format(i),t.visible=!0)},e}(n.PriceAxisView),e.LineToolRiskRewardPriceAxisView=r},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPolyline";var o;e?o=e:(o=new s("linetoolpolyline"),o.filled.setValue(!1)),r.call(this,t,o),o.addExclusion("filled"),i.e(1).then(function(t){var e=i(1171).PolylinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(8).Point,r=i(1).LineDataSource,s=i(6).DefaultProperty,a=i(3).propertyPages;inherit(o,r),o.prototype.pointsCount=function(){return-1},o.prototype.title=function(){return"Polyline"},o.prototype.addPoint=function(t){var e,i,o,s,a,l,c,h,u,d,p=this._model.timeScale().indexToCoordinate(t.index),_=t.price,f=null;if(this.priceScale().isPercent()&&(f=this.ownerSource().firstValue()),e=this.priceScale().priceToCoordinate(_),i=5,this._points.length>0){if(o=this._points[this._points.length-1],s=this._model.timeScale().indexToCoordinate(o.index),a=o.price,this.priceScale().isPercent()&&(a=this.priceScale().priceRange().convertToPercent(a,f)),l=this.priceScale().priceToCoordinate(a),new n(p,e).subtract(new n(s,l)).length()<i)return this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0;if(c=this._points[0],h=this._model.timeScale().indexToCoordinate(c.index),u=c.price,this.priceScale().isPercent()&&(u=this.priceScale().priceRange().convertToPercent(u,f)),d=this.priceScale().priceToCoordinate(u),new n(p,e).subtract(new n(h,d)).length()<i)return this._properties.filled.setValue(!0),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0}
return r.prototype.addPoint.call(this,t)},o.prototype.setPoint=function(t,e){var i,o,s,a,l,c;r.prototype.setPoint.call(this,t,e),this._model.timeScale().isEmpty()||this.priceScale().isEmpty()||t!==this._points.length-1&&0!==t||(i=5,o=this._model.timeScale().indexToCoordinate(e.index),s=this.priceScale().priceToCoordinate(e.price),a=t===this._points.length-1?this._points[0]:this._points[this._points.length-1],l=this._model.timeScale().indexToCoordinate(a.index),c=this.priceScale().priceToCoordinate(a.price),new n(o,s).subtract(new n(l,c)).length()<i&&this._properties.filled.setValue(!0))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return a.LineToolPolylineStylesPropertyPage},e.LineToolPolyline=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPrediction";var o=e||new s("linetoolprediction");o.merge({status:l.AlertStatus.Waiting}),r.call(this,t,o),i.e(1).then(function(t){var e=i(1172).PredictionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(9).ensureNotNull,r=i(1).LineDataSource,s=i(6).DefaultProperty,a=i(3).propertyPages,l=i(409);inherit(o,r),o.prototype.status=function(){return this._properties.status.value()},o.prototype.setStatus=function(t){return this._properties.status.setValue(t)},o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Forecast"},o.prototype.restorePoints=function(t,e,i){r.prototype.restorePoints.call(this,t,e,i),this.checkAlert()},o.prototype.checkAlert=function(){var t,e,i,o;if(!(this._points.length<2||this._model.mainSeries().bars().isEmpty())){if(t=this._points[1],this.status())return void(t.index>this._model.timeScale().baseIndex()&&this.setStatus(l.AlertStatus.Waiting));e=this._model.mainSeries().bars().valueAt(t.index),null!==e&&(i=this.direction(),i===l.Direction.Up&&e[TradingView.HIGH_PLOT]>=t.price?this.setStatus(l.AlertStatus.Success):i===l.Direction.Down&&e[TradingView.LOW_PLOT]<=t.price?this.setStatus(l.AlertStatus.Success):(o=n(this._model.mainSeries().bars().lastIndex()),t.index!==o&&this.setStatus(l.AlertStatus.Failure)))}},o.prototype.addPoint=function(t){var e=r.prototype.addPoint.call(this,t);return e&&this.checkAlert(),e},o.prototype.endChanging=function(){r.prototype.endChanging.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},o.prototype.onData=function(t){r.prototype.onData.call(this,t),this.checkAlert()},o.prototype.endMoving=function(){r.prototype.endMoving.call(this),this.setStatus(l.AlertStatus.Waiting),this.checkAlert()},o.prototype.direction=function(){var t,e;return this.points().length<2?l.Direction.Up:(t=this.points()[0],e=this.points()[1],e.price>t.price?l.Direction.Up:l.Direction.Down)},o.prototype.getStylesPropertyPage=function(){return a.LineToolPredictionStylesPropertyPage},e.LineToolPrediction=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolPriceLabel";var o=e||new r("linetoolpricelabel");n.call(this,t,o),i.e(1).then(function(t){
var e=i(1173).PriceLabelPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Price Label"},o.prototype.getStylesPropertyPage=function(){return s.LineToolPriceLabelStylesPropertyPage},e.LineToolPriceLabel=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBrush";var o=e||new r("linetoolbrush");n.call(this,t,o),this._finished=!1,i.e(1).then(function(t){var e=i(1175).BrushPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return-1},o.prototype.finished=function(){return this._finished},o.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},o.prototype.title=function(){return"Brush"},o.prototype.percentDistance=function(t,e){return Math.abs((e-t)/t)},o.prototype.addPoint=function(t){var e,i,o;return!!this._finished||(this._lastPoint=null,this._points.length>0&&(e=this._points[this._points.length-1],i=this.pointToScreenPoint(e)[1],o=this.pointToScreenPoint(t)[1],o.subtract(i).length()<2)?this._finished:(n.prototype.addPoint.call(this,t),this._finished))},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),this._finished=!0},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return s.LineToolBrushStylesPropertyPage},e.LineToolBrush=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolArc";var n=e||new d("linetoolarc");u.call(this,t,n),this.version=o.version,i.e(1).then(function(t){var e=i(1176).ArcPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(8).Point,r=i(44).distanceToLine,s=i(382),a=s.rotationMatrix,l=s.scalingMatrix,c=s.translationMatrix,h=s.transformPoint,u=i(1).LineDataSource,d=i(6).DefaultProperty,p=i(3).propertyPages;inherit(o,u),o.prototype.startChanging=function(t,e){var i,o,s,a,l,c,h;u.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],s=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,o,s).distance,a=o.subtract(i),l=new n(-a.y,a.x),c=i.add(o).scaled(.5),h=s.subtract(c),h.dotProduct(l)<0&&(this._dist=-this._dist))},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Arc"},o.prototype.setPoint=function(t,e){var i,o,s,u,d,p,_,f,m,g,v,y,b,S=$.extend({},e),w=this.pointToScreenPoint(this._points[0])[0],T=this.pointToScreenPoint(this._points[1])[0],C=this.pointToScreenPoint(this._points[2])[0],x=this.priceScale();switch(x.isPercent()&&(i=this.ownerSource().firstValue(),S.price=x.priceRange().convertFromPercent(S.price,i)),t){case 0:w=this.pointToScreenPoint(S)[0],o=T.subtract(w),
s=w.add(T).scaled(.5),u=new n(-o.y,o.x),u=u.normalized(),C=s.add(u.scaled(this._dist)),C=this.screenPointToPoint(C),this._points[0]=S,this._points[2]=C;break;case 1:d=r(w,T,C).distance,T=this.pointToScreenPoint(S)[0],o=T.subtract(w),s=w.add(T).scaled(.5),u=new n(-o.y,o.x),u=u.normalized(),C=s.add(u.scaled(this._dist)),C=this.screenPointToPoint(C),this._points[1]=S,this._points[2]=C;break;case 2:S=this.pointToScreenPoint(S)[0],d=r(w,T,S).distance,o=T.subtract(w),s=w.add(T).scaled(.5),u=new n(-o.y,o.x),u=u.normalized(),C=s.add(u.scaled(d)),p=s.add(u.scaled(-d)),_=o.length(),f=o.x/_,m=o.y/_,g=Math.acos(f),m<0&&(g=-g),v=c(-s.x,-s.y),S=h(v,S),y=h(v,C),v=a(-g),S=h(v,S),y=h(v,y),v=l(1,_/(2*d)),S=h(v,S),y=h(v,y),b=S.y*y.y>=0?new n(C.x,C.y):new n(p.x,p.y),b=this.screenPointToPoint(b),this._points[2]=b}this.normalizePoints()},o.version=2,o.prototype.migrateVersion=function(t,e,i){var o,n;1===t&&2===this._points.length&&(o=(2*this._points[0].price+3*this._points[1].price)/5,this._points.append({price:o,index:this._points[1].index})),1===t&&2===this._timePoint.length&&(o=(2*this._timePoint[0].price+3*this._timePoint[1].price)/5,n={price:o,offset:this._timePoint[1].offset,time_t:this._timePoint[1].time_t},this._timePoint.append(n))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return p.LineToolArcStylesPropertyPage},e.LineToolArc=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolCallout";var o=e||new s("linetoolcallout");n.call(this,t,o),this._barOffset=0,this._timeScale=t.timeScale(),i.e(1).then(function(t){var e=i(1177).CalloutPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(46).DataSource,s=i(6).DefaultProperty,a=i(3).propertyPages,l=i(410).CalloutConsts;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Callout"},o.prototype.correctPoints=function(t){var e=this._currentMovingPoint.index-this._startMovingPoint.index,i=this._currentMovingPoint.price-this._startMovingPoint.price,o=t[1];o.index+=e,o.price+=i,t[1]=o},o.prototype.addPoint=function(t){var e=n.prototype.addPoint.call(this,t);return e&&this._calculateBarOffset(),e},o.prototype._calculateBarOffset=function(){this.points().length>1&&(this._barOffset=this.points()[1].index-this.points()[0].index)},o.prototype.setLastPoint=function(t){n.prototype.setLastPoint.call(this,t),2===this.points().length&&this._calculateBarOffset()},o.prototype.setPoint=function(t,e){var i,o,r,s,a;switch(t){case 0:n.prototype.setPoint.call(this,t,e),this._calculateBarOffset();break;case 1:if(i=this.properties(),!i.wordWrapWidth)return;if(o=this._points,r=this._dragStartLeftEdgeIndex,s=Math.round((e.index-r)/2),isFinite(r)&&isFinite(s)){if(o[1]={index:r+s,price:o[1].price},this._calculateBarOffset(),this.normalizePoints(),a=this._timeScale.indexToCoordinate(r+2*s)-this._timeScale.indexToCoordinate(r)-l.RoundRadius-l.TextMargins,!isFinite(a))return;i.wordWrapWidth.setValue(Math.max(l.MinWidth,a));break
}o[1]=e,this._calculateBarOffset(),this.normalizePoints()}},o.prototype.startDragPoint=function(t,e){var i=this.properties();1===t&&i.wordWrap&&i.wordWrap.value()&&(this._dragStartLeftEdgeIndex=2*this.points()[1].index-e.index)},o.prototype.move=function(t){n.prototype.move.call(this,t),this._calculateBarOffset()},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.barOffset=this._barOffset,e},o.prototype.restoreData=function(t){t.barOffset?this._barOffset=t.barOffset:this._calculateBarOffset(),this._calculatePoint2()},o.prototype.setPriceScale=function(t){r.prototype.setPriceScale.call(this,t),t&&t.priceRange()&&this._calculatePoint2()},o.prototype._calculatePoint2=function(){var t,e;this._model.lineBeingEdited()!==this&&this._model.sourceBeingMoved()!==this&&(this._points.length<2||(t=this.points()[0],e=this.points()[1],this._points[1]={price:e.price,index:t.index+this._barOffset}))},o.prototype.getStylesPropertyPage=function(){return a.LineToolCalloutStylesPropertyPage},e.LineToolCallout=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBalloon";var o=e||new r("linetoolballoon");n.call(this,t,o),i.e(1).then(function(t){var e=i(1178).BalloonPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Balloon"},o.prototype.getStylesPropertyPage=function(){return s.LineToolBalloonStylesPropertyPage},e.LineToolBalloon=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolHorzLine";var o=e||new s("linetoolhorzline");this._priceAxisView=new r(this),n.call(this,t,o),i.e(1).then(function(t){var e=i(1179).HorzLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(339).LineToolHorzLinePriceAxisView,s=i(6).DefaultProperty,a=i(3).propertyPages;inherit(o,n),o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return e.points&&0!==e.points.length&&(e.points[0].offset=0),e},o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Horizontal Line"},o.prototype.priceAxisViews=function(t,e){return this.isSourceHidden()?null:e===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===t?[this._priceAxisView]:null},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._priceAxisView.update()},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){return[this.points()[0].price]},o.prototype.getInputsPropertyPage=function(){return a.LineToolHorzLineInputsPropertyPage},o.prototype.getStylesPropertyPage=function(){return a.LineToolHorzLineStylesPropertyPage},e.LineToolHorzLine=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolHorzRay";var o=e||new s("linetoolhorzray");this._priceAxisView=new r(this),n.call(this,t,o),i.e(1).then(function(t){
var e=i(1180).HorzRayPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(339).LineToolHorzLinePriceAxisView,s=i(6).DefaultProperty,a=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Horizontal Ray"},o.prototype.priceAxisViews=function(t,e){return this.isSourceHidden()?null:e===this.priceScale()&&this.properties().showPrice.value()&&this._model.paneForSource(this)===t?[this._priceAxisView]:null},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._priceAxisView.update()},o.prototype.canHasAlert=function(){return!0},o.prototype._getAlertPlots=function(){var t=this._points[0],e={index:t.index+1,price:t.price};return[this._linePointsToAlertPlot([t,e],null,!1,!0)]},o.prototype.getStylesPropertyPage=function(){return a.LineToolHorzLineStylesPropertyPage},e.LineToolHorzRay=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRectangle";var o=e||new r("linetoolrectangle");n.call(this,t,o),i.e(1).then(function(t){var e=i(1181).RectanglePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Rectangle"},o.prototype.setPoint=function(t,e,i){var o,r,s;if(t<2)return void n.prototype.setPoint.call(this,t,e,i);i&&i.shift&&this._properties.snapTo45Degrees&&(o=this.points()[0],r=this.points()[1],s={price:2===t?o.price:r.price,index:2===t?r.index:o.index},this._snapPoint45Degree(e,s)),this._convertPriceFromPercentIfNeeded(e),3===t?(this._points[0].price=e.price,this._points[1].index=e.index):(this._points[1].price=e.price,this._points[0].index=e.index),this.normalizePoints()},o.prototype.getStylesPropertyPage=function(){return s.LineToolRectangleStylesPropertyPage},e.LineToolRectangle=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolEllipse";var n=e||new a("linetoolellipse");s.call(this,t,n),this.version=o.version,i.e(1).then(function(t){var e=i(1182).EllipsePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(8).Point,r=i(44).distanceToLine,s=i(1).LineDataSource,a=i(6).DefaultProperty,l=i(3).propertyPages;inherit(o,s),o.prototype.startChanging=function(t,e){var i,o,n;s.prototype.startChanging.call(this,t,e),0!==t&&1!==t||(i=this.pointToScreenPoint(this._points[0])[0],o=this.pointToScreenPoint(this._points[1])[0],n=this.pointToScreenPoint(this._points[2])[0],this._dist=r(i,o,n).distance||0)},o.prototype._preparePoint=function(t,e){var i=this._preparePointInternal(t,e,!1);return e&&e.shift&&this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],i),i},o.prototype._preparePointInternal=function(t,e,i){var o,r,a,l,c,h,u,d,p,_,f;if(this._convertPriceFromPercentIfNeeded(t),o=$.extend({},t),e&&e.shift){if(r=this.points().length,
!this._fakePointAdded&&3===r&&!i)return o;(this._fakePointAdded||2===r||i)&&(this._snapPoint45Degree(t,this._points[0]),this._fakePointAdded?this._points[1]=t:i||(this._fakePointAdded=!0,s.prototype._addPointIntenal.call(this,t)),a=this.pointToScreenPoint(this._points[0])[0],l=this.pointToScreenPoint(this._points[1])[0],c=l.x-a.x,h=l.y-a.y,u=Math.sqrt(c*c+h*h)/2,d=l.subtract(a),p=a.add(l).scaled(.5),_=new n(-d.y,d.x),_=_.normalized(),f=p.add(_.scaled(u)),o=this.screenPointToPoint(f),(TradingView.isNaN(o.price)||TradingView.isNaN(o.index))&&(o=this.screenPointToPoint(p)))}else this._fakePointAdded&&(this._points.splice(1,1),this._fakePointAdded=!1);return o},o.prototype._fixVerticalDiameterPoints=function(t,e,i){var o=this.pointToScreenPoint(t)[0],n=this.pointToScreenPoint(e)[0],r=this._model.timeScale(),s=r.indexToCoordinate(t.index),a=r.indexToCoordinate(i.index),l=2*Math.abs(s-a);l*=e.price>t.price?1:-1,t.price=this.screenPointToPoint({x:o.x,y:n.y+l}).price},o.prototype.addPoint=function(t,e,i){var o=s.prototype.addPoint.call(this,t,e,i);return o&&(this._fakePointAdded=!1),o},o.prototype.setPoint=function(t,e,i){var o,s,a,l,c=$.extend({},e),h=this.pointToScreenPoint(this._points[0])[0],u=this.pointToScreenPoint(this._points[1])[0],d=this.pointToScreenPoint(this._points[2])[0];switch(this._convertPriceFromPercentIfNeeded(c),t){case 0:if(i&&i.shift){this._snapPoint45Degree(c,this._points[1]),this._points[0]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[0],this._points[1],this._points[2]);break}h=this.pointToScreenPoint(c)[0],o=u.subtract(h),s=h.add(u).scaled(.5),a=new n(-o.y,o.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[0]=c,this._points[2]=d;break;case 1:if(i&&i.shift){this._snapPoint45Degree(c,this._points[0]),this._points[1]=c,this._points[2]=this._preparePointInternal(this._points[2],i,!0),this._points[0].index===this._points[1].index&&this._fixVerticalDiameterPoints(this._points[1],this._points[0],this._points[2]);break}u=this.pointToScreenPoint(c)[0],o=u.subtract(h),s=h.add(u).scaled(.5),a=new n(-o.y,o.x),a=a.normalized(),d=s.add(a.scaled(this._dist)),d=this.screenPointToPoint(d),this._points[1]=c,this._points[2]=d;break;case 2:case 3:c=this.pointToScreenPoint(c)[0],l=r(h,u,c).distance,o=u.subtract(h),s=h.add(u).scaled(.5),a=new n(-o.y,o.x),a=a.normalized(),d=s.add(a.scaled(l)),d=this.screenPointToPoint(d),this._points[2]=d}this.normalizePoints()},o.prototype.pointsCount=function(){return 3},o.prototype.title=function(){return"Ellipse"},o.version=2,o.prototype.migrateVersion=function(t,e,i){var o,n,r;1===t&&2===this._points.length&&(o=this._points[0].price,n=.5*(this._points[0].price+this._points[1].price),this._points[0]={price:n,index:this._points[0].index},this._points[1]={price:n,index:this._points[1].index},this._points.push({price:o,index:this._points[0].index})),1===t&&2===this._timePoint.length&&(o=this._timePoint[0].price,
n=.5*(this._timePoint[0].price+this._timePoint[1].price),this._timePoint[0].price=n,this._timePoint[1].price=n,r={price:o,offset:this._timePoint[0].offset,time_t:this._timePoint[0].time_t},this._timePoint.push(r))},o.prototype.getInputsPropertyPage=function(){return null},o.prototype.getStylesPropertyPage=function(){return l.LineToolEllipseStylesPropertyPage},e.LineToolEllipse=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolTimeCycles";var o;o=e||new r("linetooltimecycles"),n.call(this,t,o),i.e(1).then(function(t){var e=i(1183).TimeCyclesPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Time Cycles"},o.prototype.setPoint=function(t,e,i){var o,n=$.extend({},e),r=this._points[0],s=this._points[1],a=this.priceScale();a.isPercent()&&(o=this.ownerSource().firstValue(),n.price=a.priceRange().convertFromPercent(n.price,o)),r.price=n.price,s.price=n.price,this._points[t]=n,this.normalizePoints()},o.prototype.addPoint=function(t,e,i){var o,r,s=n.prototype.addPoint.call(this,t,e,!0);return s&&(o=this._points[0],r=this._points[1],r.price=o.price,i||(this.normalizePoints(),this.createServerPoints())),s},o.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},e.LineToolTimeCycles=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolSineLine";var o;o=e||new r("linetoolsineline"),n.call(this,t,o),i.e(1).then(function(t){var e=i(1184).SineLinePaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Sine Line"},o.prototype.getStylesPropertyPage=function(){return s.LineToolTimeCyclesPropertyPage},e.LineToolSineLine=o},function(t,e,i){"use strict";function o(t,e,i){this._source=t,this._index=e,this._bars=i||[]}function n(t,e,i){this._source=t,l.call(this,"linetoolghostfeed",e,i)}function r(t,e,o){var s,l;this._constructor="LineToolGhostFeed",e?(s=e,s._source=this):s=new n(this),o||(l=Math.round(this.calculateATR(t)),s.averageHL.setValue(l)),a.call(this,t,s),this._segments=[],s.averageHL.listeners().subscribe(this,r.prototype.regenerate),s.variance.listeners().subscribe(this,r.prototype.regenerate),s.points||s.addProperty("points"),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._currentInterval=t.mainSeries().interval(),i.e(1).then(function(t){var e=i(1185).GhostFeedPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var s=i(54).sign,a=i(1).LineDataSource,l=i(6).DefaultProperty,c=i(3).propertyPages;o.prototype.setBars=function(t){this._bars=t||[]},o.prototype.clone=function(t){return new o(t,this._index,TradingView.clone(this._bars))},
o.prototype.createBar=function(){var t,e,i,o,n,r=this._source.properties().averageHL.value(),s=this._source.properties().variance.value()/100,a=this._source._model.mainSeries().base(),l=Math.random(),c=r*(1-2*l)*s;return l=Math.random(),t=r*(1+(.5-l)*s),e=c-t/2,i=e+t,o=e+Math.random()*t,n=e+Math.random()*t,{o:o/a,h:i/a,l:e/a,c:n/a}},o.prototype.generate=function(){var t,e,i,o,n,r;if(this._bars=[],t=this._source.points(),e=t[this._index],i=t[this._index+1],e&&i&&e.index!==i.index)for(this._avgHL=this._source.properties().averageHL.value(),this._variance=this._source.properties().variance.value()/100,o=this._index?e.index+1:e.index,n=s(i.index-e.index),r=o;r!==i.index;r+=n)this._bars.push(this.createBar())},o.prototype.bars=function(){return this._bars},o.prototype.setSize=function(t){if(t<this._bars.length)this._bars.splice(t,this._bars.length-t);else for(;this._bars.length<t;)this._bars.push(this.createBar())},inherit(n,l),n.prototype.restoreFactoryDefaults=function(){l.prototype.restoreFactoryDefaults.call(this);var t=Math.round(this._source.calculateATR());this.averageHL.setValue(t)},inherit(r,a),r.prototype.createPropertiesObject=function(t,e,i){return new n(null,e,i)},r.prototype.regenerate=function(){this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value(),this._segments.forEach(function(t){t.generate()}),this.updateAllViews(),this._model.updateSource(this)},r.prototype.propertiesChanged=function(){a.prototype.propertiesChanged.call(this),this._currentAverageHL===this._properties.averageHL.value()&&this._currentVariance===this._properties.variance.value()||this.regenerate()},r.prototype.pointsCount=function(){return-1},r.prototype.title=function(){return"Ghost Feed"},r.prototype.segmentBars=function(t){return this._segments[t].bars()},r.prototype.segments=function(){return this._segments},r.prototype.generateBars=function(t){this._segments.length<=t&&this._segments.push(new o(this,t)),this._segments[t].generate()},r.prototype.addPoint=function(t){var e,i,o;if(this._points.length>0&&(e=this._points[this._points.length-1],e.index===t.index)){for(this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),i=0;i<this._points.length;i++)this._createPointProperty(i);return!0}return o=a.prototype.addPoint.call(this,t),this._finished&&(this._lastPoint=null),this._points.length>1&&this.generateBars(this._points.length-2),o||this._finished},r.prototype.finish=function(){this._finished=!0,this._lastPoint=null,this.normalizePoints(),this.createServerPoints()},r.prototype.setPoint=function(t,e,i){var o,n,r;a.prototype.setPoint.call(this,t,e,i),t>0&&(o=this.points()[t-1],n=e.index-o.index,this._segments[t-1].setSize(Math.abs(n))),t<this.points().length-1&&(r=this.points()[t+1],n=r.index-e.index,this._segments[t].setSize(Math.abs(n)))},r.prototype.state=function(t){var e=a.prototype.state.call(this,t);return e.segments=this._segments.map(function(t){return{bars:t.bars()}}),e},r.prototype.restoreData=function(t){var e=this
;t.segments&&(this._segments=t.segments.map(function(t,i){return new o(e,i,[].concat(t.bars))})),this._currentAverageHL=this._properties.averageHL.value(),this._currentVariance=this._properties.variance.value()},r.prototype.onData=function(t){if(a.prototype.onData.call(this,t),0===this.properties().points._childs.length)for(var e=0;e<this._points.length;e++)this._createPointProperty(e);this._currentInterval!==this._model.mainSeries().interval()&&(this.regenerate(),this._currentInterval=this._model.mainSeries().interval())},r.prototype.cloneData=function(t){var e=this;this._segments=t._segments.map(function(t){return t.clone(e)})},r.prototype.calculateATR=function(t){var e,i=(void 0!==t?t:this._model).mainSeries(),o=[];return i.bars().each(function(t,e){o.push(e[TradingView.HIGH_PLOT]-e[TradingView.LOW_PLOT])}),e=0===o.length?0:o.reduce(function(t,e){return t+e},0)/o.length,e*=i.base()},r.prototype.getInputsPropertyPage=function(){return c.LineToolGhostFeedInputsPropertyPage},r.prototype.getStylesPropertyPage=function(){return c.LineToolGhostFeedStylesPropertyPage},e.LineToolGhostFeed=r},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBezierQuadro";var o;o=e||new r("linetoolbezierquadro"),n.call(this,t,o),i.e(1).then(function(t){var e=i(1186).BezierQuadroPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Curve"},o.prototype.controlPoint=function(){var t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[1])[0],i=e.subtract(t).scaled(.5),o=i.transposed().scaled(.3),n=t.add(e).scaled(.5),r=n.add(o);return this.screenPointToPoint(r)},o.prototype.setLastPoint=function(t,e){n.prototype.setLastPoint.call(this,t,e),this._controlPoint=this.controlPoint()},o.prototype.addPoint=function(t,e,i){var o,r=n.prototype.addPoint.call(this,t,e,!0);return r&&(o=this.controlPoint(),this._points.push(o),delete this._controlPoint,i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2)),r},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),this._createPointProperty(2)},o.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},e.LineToolBezierQuadro=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolBezierCubic";var o;o=e||new r("linetoolbeziercubic"),n.call(this,t,o),i.e(1).then(function(t){var e=i(1187).BezierCubicPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(3).propertyPages;inherit(o,n),o.prototype.pointsCount=function(){return 2},o.prototype.title=function(){return"Double Curve"},o.prototype.controlPoints=function(){
var t=this.pointToScreenPoint(this.points()[0])[0],e=this.pointToScreenPoint(this.points()[1])[0],i=e.subtract(t).scaled(.5),o=i.transposed().scaled(.3),n=t.add(e).scaled(.33),r=t.add(e).scaled(.67),s=n.add(o),a=r.subtract(o);return[this.screenPointToPoint(s),this.screenPointToPoint(a)]},o.prototype.setLastPoint=function(t,e){n.prototype.setLastPoint.call(this,t,e),this._controlPoints=this.controlPoints()},o.prototype.addPoint=function(t,e,i){var o,r=n.prototype.addPoint.call(this,t,e,!0);return r&&(o=this.controlPoints(),delete this._controlPoints,this._points.push(o[0]),this._points.push(o[1]),i||(this.normalizePoints(),this.createServerPoints()),this._createPointProperty(2),this._createPointProperty(3)),r},o.prototype.restorePoints=function(t,e,i){n.prototype.restorePoints.call(this,t,e,i),this._createPointProperty(2),this._createPointProperty(3)},o.prototype.getStylesPropertyPage=function(){return s.LineToolBezierStylesPropertyPage},e.LineToolBezierCubic=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolArrow";var i=e||new r("linetoolarrow");n.call(this,t,i)}var n=i(159).LineToolTrendLine,r=i(6).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Arrow"},e.LineToolArrow=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolRay";var i=e||new r("linetoolray");n.call(this,t,i)}var n=i(159).LineToolTrendLine,r=i(6).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Ray"},e.LineToolRay=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolExtended";var i=e||new r("linetoolextended");n.call(this,t,i)}var n=i(159).LineToolTrendLine,r=i(6).DefaultProperty;inherit(o,n),o.prototype.title=function(){return"Extended Line"},e.LineToolExtended=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork");r.call(this,t,i),this._constructor="LineToolSchiffPitchfork"}var n=i(21),r=i(161).LineToolPitchfork;inherit(o,r),o.prototype.title=function(){return $.t("Modified Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},e.LineToolSchiffPitchfork=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolschiffpitchfork2");r.call(this,t,i),this._constructor="LineToolSchiffPitchfork2"}var n=i(21),r=i(161).LineToolPitchfork;inherit(o,r),o.prototype.title=function(){return $.t("Schiff Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},e.LineToolSchiffPitchfork2=o},function(t,e,i){"use strict";function o(t,e){var i=e||this.createPropertiesObject("linetoolinsidepitchfork");r.call(this,t,i),this._constructor="LineToolInsidePitchfork"}var n=i(21),r=i(161).LineToolPitchfork;inherit(o,r),o.prototype.title=function(){return $.t("Inside Pitchfork")},o.prototype.createPropertiesObject=function(t,e,i){return new n(t,e,i,{range:[0,8]})},e.LineToolInsidePitchfork=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolFlagMark"
;var o=e||new s("linetoolflagmark");r.call(this,t,o),i.e(1).then(function(e){var o=i(407).MarkPaneView,r=new o(this,t,this.image,25,25,-8,-21);r.setAnchors(new n(0,0)),this._setPaneViews([r])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(8).Point,r=i(1).LineDataSource,s=i(6).DefaultProperty;inherit(o,r),o.prototype.image=new Image,o.prototype.image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAsElEQVR4AWMYWcDExOS/YUd4hWF7+H90bNAePpO2liDwJTxyi2htyVXLvlBOWlry2bAtVIumwWXQERFF4zgJ20iPiP8JDCpLeqSuJ6ZdoRJ0SMIRx7QbQtmItgSXnGFbRCzMEnIzK8ISWgL6WzJqibGxsYaFhYUC7SxBWMQPNMjazMxMjebBZWhoKAq00NHc3FyL5nFiaWkpDTTYz8jISI/mEW9qaqoExGFgS+gFRgEAaE0hWxrw50oAAAAASUVORK5CYII=",o.prototype.pointsCount=function(){return 1},o.prototype.title=function(){return"Flag Mark"},o.prototype.version=2,e.LineToolFlagMark=o},function(t,e,i){"use strict";function o(t,e){this._constructor="LineToolCypherPattern";var o=e||new r("linetoolcypherpattern");n.call(this,t,o),i.e(1).then(function(t){var e=i(1188).CypherPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var n=i(1).LineDataSource,r=i(6).DefaultProperty,s=i(336).LineTool5PointsPattern;inherit(o,s),e.LineToolCypherPattern=o},function(t,e,i){"use strict";(function(t){function o(t){this._line=t,this._data={bodyText:"position",quantityText:"0"},this._closeEnabled=!0}function n(t,e){this._adapter=new o(this),this._constructor="LineToolPosition";var n=e||new c("linetoolposition");r.call(this,t,n),i.e(1).then(function(t){var e=i(1189).PositionPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(224),s=i(1).LineDataSource,a=i(221).LineToolPriceAxisView,l=i(170),c=i(6).DefaultProperty;o.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},o.prototype.setPrice=function(t){if(this._line.points().length>0){var e=this._line.points()[0];e.price=t,this._line._points[0]=e,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},o.prototype.getText=function(){return this._data.bodyText},o.prototype.setText=function(t){return this._data.bodyText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.getQuantity=function(){return this._data.quantityText},o.prototype.setQuantity=function(t){return this._data.quantityText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.getExtendLeft=function(){var t=this._line.properties().extendLeft.value();return"inherit"===t?this._line._model.properties().tradingProperties.extendLeft.value():t},o.prototype.setExtendLeft=function(t){return this._line.properties().extendLeft.setValue(t),this},o.prototype.getLineLength=function(){
var t=this._line.properties().lineLength.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineLength.value():t},o.prototype.setLineLength=function(t){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(t,100))),this},o.prototype.getLineColor=function(){return l.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},o.prototype.setLineColor=function(t){return l.setColorToProperties(t,this._line.properties().lineColor,this._line.properties().lineTransparency),this},o.prototype.getLineStyle=function(){var t=this._line.properties().lineStyle.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineStyle.value():t},o.prototype.setLineStyle=function(t){return this._line.properties().lineStyle.setValue(t),this},o.prototype.getLineWidth=function(){var t=this._line.properties().lineWidth.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineWidth.value():t},o.prototype.setLineWidth=function(t){return this._line.properties().lineWidth.setValue(t),this},o.prototype.getBodyBorderColor=function(){return l.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},o.prototype.setBodyBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},o.prototype.getBodyBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},o.prototype.setBodyBackgroundColor=function(t){return l.setColorToProperties(t,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},o.prototype.getBodyTextColor=function(){return l.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},o.prototype.setBodyTextColor=function(t){return l.setColorToProperties(t,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},o.prototype.getBodyFont=function(){return l.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},o.prototype.setBodyFont=function(t){return l.setFontToProperties(t,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},o.prototype.getQuantityBorderColor=function(){return l.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},o.prototype.setQuantityBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},o.prototype.getQuantityBackgroundColor=function(){
return l.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},o.prototype.setQuantityBackgroundColor=function(t){return l.setColorToProperties(t,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},o.prototype.getQuantityTextColor=function(){return l.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},o.prototype.setQuantityTextColor=function(t){return l.setColorToProperties(t,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},o.prototype.getQuantityFont=function(){return l.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},o.prototype.setQuantityFont=function(t){return l.setFontToProperties(t,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},o.prototype.getReverseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency)},o.prototype.setReverseButtonBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().reverseButtonBorderColor,this._line.properties().reverseButtonBorderTransparency),this},o.prototype.getReverseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency)},o.prototype.setReverseButtonBackgroundColor=function(t){return l.setColorToProperties(t,this._line.properties().reverseButtonBackgroundColor,this._line.properties().reverseButtonBackgroundTransparency),this},o.prototype.getReverseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency)},o.prototype.setReverseButtonIconColor=function(t){return l.setColorToProperties(t,this._line.properties().reverseButtonIconColor,this._line.properties().reverseButtonIconTransparency),this},o.prototype.getCloseButtonBorderColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency)},o.prototype.setCloseButtonBorderColor=function(t){return l.setColorToProperties(t,this._line.properties().closeButtonBorderColor,this._line.properties().closeButtonBorderTransparency),this},o.prototype.getCloseButtonBackgroundColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency)},o.prototype.setCloseButtonBackgroundColor=function(t){
return l.setColorToProperties(t,this._line.properties().closeButtonBackgroundColor,this._line.properties().closeButtonBackgroundTransparency),this},o.prototype.getCloseButtonIconColor=function(){return l.getColorFromProperties(this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency)},o.prototype.setCloseButtonIconColor=function(t){return l.setColorToProperties(t,this._line.properties().closeButtonIconColor,this._line.properties().closeButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onReverse=function(t,e){return e?this.isFunction(e)&&(this._onReverseData=t,this._onReverseCallback=e):this.isFunction(t)&&(this._onReverseCallback=t),this},o.prototype.callOnReverse=function(){this.isFunction(this._onReverseCallback)&&this._onReverseCallback.call(this,this._onReverseData)},o.prototype.isOnReverseCallbackPresent=function(){return this.isFunction(this._onReverseCallback)},o.prototype.onClose=function(t,e){return e?this.isFunction(e)&&(this._onCloseData=t,this._onCloseCallback=e):this.isFunction(t)&&(this._onCloseCallback=t),this},o.prototype.setCloseEnabled=function(t){return this._closeEnabled===t?this:(this._closeEnabled=t,this._onCloseCallback&&this._line.updateAllViewsAndRedraw(),this)},o.prototype.isCloseEnabled=function(){return this._closeEnabled},o.prototype.callOnClose=function(){this.isFunction(this._onCloseCallback)&&this._closeEnabled&&this._onCloseCallback.call(this,this._onCloseData)},o.prototype.isOnCloseCallbackPresent=function(){return this._closeEnabled&&this.isFunction(this._onCloseCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},inherit(n,r),n.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},n.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},n.skipMagnetting=!0,n.prototype.title=function(){return"Position"},n.prototype.createPriceAxisView=function(t){return this._priceAxisView=new a(this,{pointIndex:t,backgroundProperty:this.properties().lineColor}),this._priceAxisView},n.prototype.paneViews=function(e){
return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.paneViews.call(this,e):null},n.prototype.priceAxisViews=function(e,i){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showPositions.value()?s.prototype.priceAxisViews.call(this,e,i):null},n.prototype.hasContextMenu=function(){return!0},n.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},e.LineToolPosition=n}).call(e,i(5))},function(t,e,i){"use strict";(function(t){function o(t){this._line=t,this._data={bodyText:"order",quantityText:"0"},this._editable=!0}function n(t,e){this._adapter=new o(this),this._constructor="LineToolOrder";var n=e||new c("linetoolorder");r.call(this,t,n),i.e(1).then(function(t){var e=i(1190).OrderPaneView;this._setPaneViews([new e(this,this._model)])}.bind(this).bind(null,i)).catch(i.oe)}var r=i(224),s=i(221).LineToolPriceAxisView,a=i(170),l=i(1).LineDataSource,c=i(6).DefaultProperty;o.prototype.setEditable=function(t){return this._editable=t,this},o.prototype.getPrice=function(){return this._line.points().length>0?this._line.points()[0].price:this._line._timePoint.length>0?this._line._timePoint[0].price:void 0},o.prototype.setPrice=function(t){if(this._line.points().length>0){var e=this._line.points()[0];e.price=t,this._line._points[0]=e,this._line.normalizePoints(),this._line.updateAllViewsAndRedraw()}return this._line._timePoint.length>0&&(this._line._timePoint[0].price=t),this},o.prototype.getText=function(){return this._data.bodyText},o.prototype.setText=function(t){return this._data.bodyText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.setTooltip=function(t){return null==t?t="":t+="",this._line.properties().tooltip.setValue(t),this},o.prototype.getTooltip=function(){return this._line.properties().tooltip.value()},o.prototype.getQuantity=function(){return this._data.quantityText},o.prototype.setQuantity=function(t){return this._data.quantityText=t||"",this._line.updateAllViewsAndRedraw(),this},o.prototype.getExtendLeft=function(){var t=this._line.properties().extendLeft.value();return"inherit"===t?this._line._model.properties().tradingProperties.extendLeft.value():t},o.prototype.setExtendLeft=function(t){return this._line.properties().extendLeft.setValue(t),this},o.prototype.getLineLength=function(){var t=this._line.properties().lineLength.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineLength.value():t},o.prototype.setLineLength=function(t){return this._line.properties().lineLength.setValue(Math.max(0,Math.min(t,100))),this},o.prototype.getLineColor=function(){return a.getColorFromProperties(this._line.properties().lineColor,this._line.properties().lineTransparency)},o.prototype.setLineColor=function(t){return a.setColorToProperties(t,this._line.properties().lineColor,this._line.properties().lineTransparency),this},o.prototype.getLineStyle=function(){
var t=this._line.properties().lineStyle.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineStyle.value():t},o.prototype.setLineStyle=function(t){return this._line.properties().lineStyle.setValue(t),this},o.prototype.getLineWidth=function(){var t=this._line.properties().lineWidth.value();return"inherit"===t?this._line._model.properties().tradingProperties.lineWidth.value():t},o.prototype.setLineWidth=function(t){return this._line.properties().lineWidth.setValue(t),this},o.prototype.getBodyBorderColor=function(){return a.getColorFromProperties(this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency)},o.prototype.setBodyBorderColor=function(t){return a.setColorToProperties(t,this._line.properties().bodyBorderColor,this._line.properties().bodyBorderTransparency),this},o.prototype.getBodyBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency)},o.prototype.setBodyBackgroundColor=function(t){return a.setColorToProperties(t,this._line.properties().bodyBackgroundColor,this._line.properties().bodyBackgroundTransparency),this},o.prototype.getBodyTextColor=function(){return a.getColorFromProperties(this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency)},o.prototype.setBodyTextColor=function(t){return a.setColorToProperties(t,this._line.properties().bodyTextColor,this._line.properties().bodyTextTransparency),this},o.prototype.getBodyFont=function(){return a.getFontFromProperties(this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic)},o.prototype.setBodyFont=function(t){return a.setFontToProperties(t,this._line.properties().bodyFontFamily,this._line.properties().bodyFontSize,this._line.properties().bodyFontBold,this._line.properties().bodyFontItalic),this},o.prototype.getQuantityBorderColor=function(){return a.getColorFromProperties(this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency)},o.prototype.setQuantityBorderColor=function(t){return a.setColorToProperties(t,this._line.properties().quantityBorderColor,this._line.properties().quantityBorderTransparency),this},o.prototype.getQuantityBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency)},o.prototype.setQuantityBackgroundColor=function(t){return a.setColorToProperties(t,this._line.properties().quantityBackgroundColor,this._line.properties().quantityBackgroundTransparency),this},o.prototype.getQuantityTextColor=function(){return a.getColorFromProperties(this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency)},o.prototype.setQuantityTextColor=function(t){return a.setColorToProperties(t,this._line.properties().quantityTextColor,this._line.properties().quantityTextTransparency),this},
o.prototype.getQuantityFont=function(){return a.getFontFromProperties(this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic)},o.prototype.setQuantityFont=function(t){return a.setFontToProperties(t,this._line.properties().quantityFontFamily,this._line.properties().quantityFontSize,this._line.properties().quantityFontBold,this._line.properties().quantityFontItalic),this},o.prototype.getCancelButtonBorderColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency)},o.prototype.setCancelButtonBorderColor=function(t){return a.setColorToProperties(t,this._line.properties().cancelButtonBorderColor,this._line.properties().cancelButtonBorderTransparency),this},o.prototype.getCancelButtonBackgroundColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency)},o.prototype.setCancelButtonBackgroundColor=function(t){return a.setColorToProperties(t,this._line.properties().cancelButtonBackgroundColor,this._line.properties().cancelButtonBackgroundTransparency),this},o.prototype.getCancelButtonIconColor=function(){return a.getColorFromProperties(this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency)},o.prototype.setCancelButtonIconColor=function(t){return a.setColorToProperties(t,this._line.properties().cancelButtonIconColor,this._line.properties().cancelButtonIconTransparency),this},o.prototype.block=function(){this._blocked=!0,this._line.updateAllViewsAndRedraw()},o.prototype.unblock=function(){this._blocked=!1,this._line.updateAllViewsAndRedraw()},o.prototype.isFunction=function(t){return"function"==typeof t},o.prototype.onCancel=function(t,e){return e?this.isFunction(e)&&(this._onCancelData=t,this._onCancelCallback=e):this.isFunction(t)&&(this._onCancelCallback=t),this},o.prototype.callOnCancel=function(){this.isFunction(this._onCancelCallback)&&this._onCancelCallback.call(this,this._onCancelData)},o.prototype.isOnCancelCallbackPresent=function(){return this.isFunction(this._onCancelCallback)},o.prototype.onModify=function(t,e){return e?this.isFunction(e)&&(this._onModifyData=t,this._onModifyCallback=e):this.isFunction(t)&&(this._onModifyCallback=t),this},o.prototype.callOnModify=function(){this.isFunction(this._onModifyCallback)&&this._onModifyCallback.call(this,this._onModifyData)},o.prototype.onMove=function(t,e){return e?this.isFunction(e)&&(this._onMoveData=t,this._onMoveCallback=e):this.isFunction(t)&&(this._onMoveCallback=t),this},o.prototype.callOnMove=function(){this.isFunction(this._onMoveCallback)&&this._onMoveCallback.call(this,this._onMoveData)},o.prototype.onContextMenu=function(t,e){return e?this.isFunction(e)&&(this._onContextMenuData=t,this._onContextMenuCallback=e):this.isFunction(t)&&(this._onContextMenuCallback=t),this},o.prototype.callOnContextMenu=function(){
if(this.isFunction(this._onContextMenuCallback))return this._onContextMenuCallback.call(this,this._onContextMenuData)},o.prototype.remove=function(){this._line._model.removeSource(this._line),delete this._line},o.prototype.shouldShowModifyOrder=function(){return!!this._onModifyCallback},inherit(n,r),n.skipMagnetting=!0,n.prototype.setPoint=function(t,e,i){this._points[t]=e,this.normalizePoints()},n.prototype.addPoint=function(t,e){return this._points.push(t),this._lastPoint=null,this.normalizePoints(),this.createServerPoints(),!0},n.prototype.title=function(){return"Order"},n.prototype.endMoving=function(t){var e=this._startMovingPoint&&this._currentMovingPoint&&this._startMovingPoint.price!==this._currentMovingPoint.price;r.prototype.endMoving.call(this),!t&&e&&this._adapter.callOnMove()},n.prototype.createPriceAxisView=function(t){return this._priceAxisView=new s(this,{pointIndex:t,backgroundProperty:this.properties().lineColor}),this._priceAxisView},n.prototype.paneViews=function(e){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.paneViews.call(this,e):null},n.prototype.priceAxisViews=function(e,i){return TradingView.printing&&!t.enabled("snapshot_trading_drawings")?null:this._model.properties().tradingProperties.showOrders.value()?l.prototype.priceAxisViews.call(this,e,i):null},n.prototype.hasContextMenu=function(){return!0},n.prototype.contextMenuItems=function(){return this._adapter.callOnContextMenu()},n.prototype.onlyYMoving=function(){return!0},n.prototype.userEditEnabled=function(){return this._adapter.shouldShowModifyOrder()},e.LineToolOrder=n}).call(e,i(5))},function(t,e,i){"use strict";for(var o={StudyStrategy:i(871),StatusView:i(126),StudyLineDataSource:i(128).StudyLineDataSource,StudyVersioning:i(84),StudyMigration:i(301),study_PivotPointsStandard:i(873),study_Overlay:i(876).study_Overlay,study_Compare:i(894),study_Sessions:i(895),study_Volume:i(896).study_Volume,study_ScriptWithDataOffset:i(897),StudyPaneView:i(87).StudyPaneView,StudyBackgroundPaneView:i(87).StudyBackgroundPaneView,StudyPlotShapesPaneView:i(87).StudyPlotShapesPaneView,StudyPlotCharsPaneView:i(87).StudyPlotCharsPaneView,StudyPlotArrowsPaneView:i(87).StudyPlotArrowsPaneView,StudyPlotCandlesPaneView:i(87).StudyPlotCandlesPaneView,StudyStrategyOrdersPaneView:i(340),StudyPriceAxisView:i(324).StudyPriceAxisView,StudyDataWindowView:i(125).StudyDataWindowView,DataVendorStudyDataWindowView:i(125).DataVendorStudyDataWindowView,LineStudyMtpAnalysis:i(898),LineStudyMtpDecisionPoint:i(899),LineStudyMtpRiskReward:i(900),LineStudyMtpElliotWaveMain:i(227).LineStudyMtpElliotWaveMain,LineStudyMtpElliotWaveMajor:i(227).LineStudyMtpElliotWaveMajor,LineStudyMtpElliotWaveMinor:i(227).LineStudyMtpElliotWaveMinor,LineStudyMtpDownWave1OrA:i(47).LineStudyMtpDownWave1OrA,LineStudyMtpDownWave2OrB:i(47).LineStudyMtpDownWave2OrB,LineStudyMtpDownWave3:i(47).LineStudyMtpDownWave3,LineStudyMtpDownWave4:i(47).LineStudyMtpDownWave4,
LineStudyMtpDownWave5:i(47).LineStudyMtpDownWave5,LineStudyMtpDownWaveC:i(47).LineStudyMtpDownWaveC,LineStudyMtpUpWave1OrA:i(47).LineStudyMtpUpWave1OrA,LineStudyMtpUpWave2OrB:i(47).LineStudyMtpUpWave2OrB,LineStudyMtpUpWave3:i(47).LineStudyMtpUpWave3,LineStudyMtpUpWave4:i(47).LineStudyMtpUpWave4,LineStudyMtpUpWave5:i(47).LineStudyMtpUpWave5,LineStudyMtpUpWaveC:i(47).LineStudyMtpUpWaveC},n=Object.keys(o),r=n.length;r--;)TradingView[n[r]]=o[n[r]];t.exports=o},function(t,e,i){"use strict";(function(e){function o(t,i,o,r){n.call(this,t,i,o,r),this._barsIndexes=[],this._reportDataBuffer=null,this._reportData=null,this.watchedData=new e,this.model().addStrategySource(this)}var n=i(35).Study,r=i(340),s=i(3).propertyPages;inherit(o,n),o.prototype.stop=function(){if(n.prototype.stop.call(this),this._avoidRemoveStrategySource)return void delete this._avoidRemoveStrategySource;this.model().removeStrategySource(this)},o.prototype.start=function(){this.model().addStrategySource(this),n.prototype.start.call(this)},o.prototype.processHibernate=function(){this._studyId&&!this.isVisible()&&(this._avoidRemoveStrategySource=!0),n.prototype.processHibernate.call(this)},o.prototype.onData=function(t){var e=this;n.prototype.onData.call(this,t).then(function(){var i,o,n,r;t.method&&"data_update"===t.method&&(i=t.params&&t.params.nonseries&&t.params.nonseries.d,o=i&&i.data&&i.data.report,o?(i.isUpdate&&e._reportDataBuffer&&(o=$.extend(e._reportDataBuffer,o)),e._reportDataBuffer=e._reportData=$.extend(e._reportDataBuffer||{},o)):(n=$.extend({},t),n.params.nonseries.d.data={report:e._reportDataBuffer},t=n),"nochange"!==(r=t.params&&t.params.nonseries&&t.params.nonseries.indexes)&&r instanceof Array&&r.length&&e._collateBarsIndexes(r)),e.watchedData.setValue(t)})},o.prototype._collateBarsIndexes=function(t){var e,i;if(Array.isArray(t)&&(e=this._reportData&&this._reportData.filledOrders)&&e.length)for(this._barsIndexes.length=0,i=0;i<e.length;i++)this._barsIndexes[i]=t[e[i].tm]},o.prototype.reportData=function(){return this._reportData},o.prototype.ordersData=function(){return this._reportData&&this._reportData.filledOrders},o.prototype.barsIndexes=function(){return this._barsIndexes},o.prototype.clearData=function(){n.prototype.clearData.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.clearItems()},o.prototype.restoreData=function(t){n.prototype.restoreData.apply(this,arguments),this.model().addStrategySource(this),t.reportData&&t.barsIndexes&&(this._reportData=t.reportData,this._barsIndexes=t.barsIndexes,this.watchedData.setValue({method:"data_update",params:{nonseries:{d:{data:{report:this._reportData}}}}})),t.activeState&&(this._activeState=!0)},o.prototype.activeState=function(){return this._activeState},o.prototype.updateAllViews=function(){n.prototype.updateAllViews.call(this),this._strategyOrdersPaneView&&this._strategyOrdersPaneView.update()},o.prototype.createViews=function(){n.prototype.createViews.call(this),this._strategyOrdersPaneView=new r(this,this._series,this._model)},o.prototype.state=function(t){
var e=n.prototype.state.apply(this,arguments);return t&&this._reportData&&this._barsIndexes&&(e.data||(e.data={}),e.data.reportData=this._reportData,e.data.barsIndexes=this._barsIndexes,e.data.activeState=this.model().activeStrategySource().value()===this),e},o.prototype.getStrategyPropertyPage=function(){return s.StudyStrategyPropertyPage},t.exports=o}).call(e,i(17))},function(t,e,i){"use strict";function o(t,e){this._items=t.items,this._color=t.color,this._orderArrow=t.orderArrow,this._exitLineWidth=t.exitLineWidth,this._priceArrow=t.priceArrow,this._text=t.text,this._textWidths=e}var n=i(11);o.prototype._drawOrderArrow=function(t,e,i,o){var n,r=e.x,s=e.y;o?(t.rotate(Math.PI),r=-r-this._orderArrow.width/2,s=-s-this._orderArrow.height):(r-=this._orderArrow.width/2,s-=this._orderArrow.height),i&&(s-=i),n=o?"floor":"ceil",r=Math[n](r)+(o?-.5:.5),s=Math[n](s)+.5,t.translate(r,s),t.moveTo(.25*this._orderArrow.width,0),t.lineTo(.75*this._orderArrow.width,0),t.lineTo(.75*this._orderArrow.width,.45*this._orderArrow.height),t.lineTo(this._orderArrow.width,.45*this._orderArrow.height),t.lineTo(.5*this._orderArrow.width,this._orderArrow.height),i&&(t.lineTo(this._orderArrow.width,this._orderArrow.height),t.lineTo(this._orderArrow.width,this._orderArrow.height+i),t.lineTo(0,this._orderArrow.height+i),t.lineTo(0,this._orderArrow.height),t.lineTo(.5*this._orderArrow.width,this._orderArrow.height)),t.lineTo(0,.45*this._orderArrow.height),t.lineTo(.25*this._orderArrow.width,.45*this._orderArrow.height)},o.prototype._drawPriceArrow=function(t,e,i){var o=e.x,n=e.y;i?(t.rotate(Math.PI),o=-o-this._priceArrow.width,n=-n-this._priceArrow.height/2):(o-=this._priceArrow.width,n-=this._priceArrow.height/2),o=Math.round(o)+(i?-1.5:.5),n=Math.floor(n)+.5,t.translate(o,n),t.moveTo(0,0),t.lineTo(this._priceArrow.width,.5*this._priceArrow.height),t.lineTo(0,this._priceArrow.height)},o.prototype.draw=function(t){t.beginPath();for(var e,i,o=0;o<this._items.length;o++)e=this._items[o],i="lower"===e.pos,t.save(),t.translate(0,i?this._orderArrow.vMargin:-this._orderArrow.vMargin),this._drawOrderArrow(t,e.orderPoint,this._exitLineWidth,i),t.restore(),t.save(),this._drawPriceArrow(t,e.pricePoint,!i),t.restore();if(t.closePath(),t.fillStyle=this._color,t.fill(),this._text)for(t.font=this._text.fontSize+"px "+this._text.font,t.textAlign="center",t.textBaseline="top",o=0;o<this._items.length;o++)e=this._items[o],i="lower"===e.pos,t.save(),t.translate(0,i?this._orderArrow.vMargin:-this._orderArrow.height-this._orderArrow.vMargin),e.label&&(t.translate(0,i?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),t.fillText(e.label,Math.ceil(e.orderPoint.x),e.orderPoint.y),"number"!=typeof this._textWidths[e.label]&&(this._textWidths[e.label]=t.measureText(e.label).width)),e.qty&&(t.translate(0,i?this._text.fontSize+this._text.vMargin+this._exitLineWidth:-this._text.fontSize-this._text.vMargin-this._exitLineWidth),t.fillText(e.qty,Math.ceil(e.orderPoint.x),e.orderPoint.y),
"number"!=typeof this._textWidths[e.qty]&&(this._textWidths[e.qty]=t.measureText(e.qty).width)),t.restore()},o.prototype._testOrderArrows=function(t){for(var e,i,o,n,r,s,a,l=0,c=this._orderArrow.width/2;l<this._items.length;l++)if(e=this._items[l].orderPoint,!(t.x<e.x-c||t.x>e.x+c||(i=this._items[l],o="lower"===i.pos,n=this._orderArrow.height+this._exitLineWidth,o||(n=-n),r=e.y+(o?this._orderArrow.vMargin:-this._orderArrow.vMargin),s=Math.min(r,r+n),a=Math.max(r,r+n),t.y<s||t.y>a)))return!0;return!1},o.prototype._testText=function(t){for(var e,i,o,n,r,s,a,l,c,h,u,d=0;d<this._items.length;d++)if(e=this._items[d],i=e.orderPoint,o="lower"===e.pos,n=this._orderArrow.vMargin+this._orderArrow.height+this._exitLineWidth,o||(n=-n),r=i.y+n,s=this._text.vMargin+this._text.fontSize*(!!e.label+!!e.qty),o||(s=-s),a=Math.min(r,r+s),l=Math.max(r,r+s),!(t.y<a||t.y>l||(c=e.label&&e.qty?o&&t.y<r+this._text.fontSize||!o&&t.y>r-this._text.fontSize?e.label:e.qty:e.label||e.qty,h=this._textWidths[c],u=h&&h/2,!h||t.x<i.x-u||t.x>i.x+u)))return!0;return!1},o.prototype.hitTest=function(t){var e=this._testOrderArrows(t),i=!e&&this._text&&this._testText(t);return e||i?new n(n.REGULAR):null},e.PaneRendererStudyStrategyOrders=TradingView.PaneRendererStudyStrategyOrders=o},function(t,e,i){"use strict";(function(e){function o(t,e,i,o){this._prices=[],this._canvas=$("<canvas>"),this._cache=this._canvas.get(0).getContext("2d"),this.reset({font:t,fontSize:e,backColors:i,colors:o}),this._priceAxisFontSize=11}function n(t,e){this._model=t,this._source=e,this._pivots=[],this._textCache={}}function r(t,e){this._source=t,this._model=t._model,this._prices=[],this._invidated=!0,this._cache=e;var i=this;t.priceScale()&&(this._cachedFormatter=t.priceScale().formatter(),this._formatterCache=new p(function(t){return i._cachedFormatter.format(t)}))}function s(t,e,i,o){var r,s,a;for(_.call(this,t,e,i,o,new n(t,this)),r=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],s=this.properties().levelsStyle.visibility,a=0;a<r.length;a++)s[r[a]].listeners().subscribe(this,TradingView.Study.prototype.processHibernate)}var a=i(8).Point,l=i(32),c=l.parseRgb,h=l.rgbToBlackWhiteString,u=i(126),d=i(125).StudyDataWindowView,p=i(226),_=i(874),f=i(875).StandardPivotPointsPriceAxisView,m=i(110).TrendLineRenderer,g=i(124),v=i(375),y=i(11),b=i(53).CompositeRenderer,S=i(19).PlotRowSearchMode,w=i(3).propertyPages,T=i(74).LineEnd;o.prototype.remove=function(){this._canvas.remove()},o.prototype.reset=function(t){this._prices=[],this._params=t,this._cache.setFont(t.fontSize+"px "+t.font);var e=this;this._labelWidth=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5","/"].reduce(function(t,i){var o=e._cache.measureText(i).width;return Math.max(o,t)},0)},o.prototype.rowHeight=function(){return this._priceAxisFontSize+4},o.prototype._labelRectByIndex=function(t){return{left:0,top:Math.round(this._topByIndex(t)),width:Math.round(this._labelWidth+4),height:this._params.fontSize+8}},o.prototype.params=function(){return this._params},o.prototype._centerByIndex=function(t){
return Math.round((t+.5)*(this._params.fontSize+8))},o.prototype._topByIndex=function(t){return Math.round(t*(this._params.fontSize+8))},o.prototype.setPrices=function(t){var e,i,o,n,r,s,a=8,l=!1,c=function(t,e){return void 0===t&&void 0===e||t.formatted===e.formatted};if(t.length!==this._prices.length)l=!0;else for(e=0;e<this._prices.length;e++)if(!c(this._prices[e],t[e])){l=!0;break}if(l){for(i=this,i._cache.save(),i._cache.font=this._priceAxisFontSize+"px Arial",i._cache.restore(),o=this._labelWidth+6,n=window.hidpiCanvasRatio||1,o*=n,this._canvas.prop("width",o),r=Math.max(t.length,22)*(this._params.fontSize+a),r*=n,this._canvas.prop("height",r),this._canvas.css("width",o).css("height",r),this._prices=t,this._cache.clearRect(0,0,o,r),this._cache.save(),this._cache.translate(.5,.5),this._cache.font=this._params.fontSize+"px "+this._params.font,this._cache.textBaseline="middle",e=0;e<this._prices.length;e++)this._prices[e]&&(s=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"][e],this._cache.fillStyle=this._params.backColors[e],this._cache.fillText(s,0,this._centerByIndex(e)),this._cache.fillText("/",0,this._centerByIndex(e+11)));this._prices=t,this._cache.restore()}},n.prototype.setCache=function(t){this._cache=t},n.prototype.priceAxisViews=function(t,e){return this._priceAxisViews},n.prototype.mergeLabel=function(t,e,i){var o=""+e;void 0===t[o]?(t[o]={},t[o].text=i,t[o].ids=[this.complete(i)]):(t[o].text+="/"+i,t[o].ids.push(this.complete(i)))},n.prototype.complete=function(t){return"P"===t?t:"S"+t[1]+"/R"+t[1]},n.prototype.update=function(){this._invalidated=!0},n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g;if(this._source.pricesView().prices(),this._pivots=[],this._source._nonseriesdata&&this._source._nonseriesdata.pivots&&this._source.properties().visible.value()&&(t=this._source._nonseriesdata.pivots,e=this._source._indexes,i=this._model.timeScale(),(o=this._source.priceScale())&&!o.isEmpty()&&!i.isEmpty()&&t)){if(n=i.visibleBars(),r=n.firstBar(),s=n.lastBar(),a=null,o.isPercent()){if(!this._source.ownerSource())return;a=this._source.ownerSource().firstValue()}for(l=0;l<t.length;l++)if(t[l]&&(c=e[t[l].startIndex],!((h=e[t[l].endIndex])<r||c>s))){u={},d=this._source.properties().levelsStyle.visibility,d.P.value()&&this.mergeLabel(u,t[l].p,"P"),d["S1/R1"].value()&&(this.mergeLabel(u,t[l].s1,"S1"),this.mergeLabel(u,t[l].r1,"R1")),d["S2/R2"].value()&&(this.mergeLabel(u,t[l].s2,"S2"),this.mergeLabel(u,t[l].r2,"R2")),d["S3/R3"].value()&&(this.mergeLabel(u,t[l].s3,"S3"),this.mergeLabel(u,t[l].r3,"R3")),d["S4/R4"].value()&&(this.mergeLabel(u,t[l].s4,"S4"),this.mergeLabel(u,t[l].r4,"R4")),d["S5/R5"].value()&&(this.mergeLabel(u,t[l].s5,"S5"),this.mergeLabel(u,t[l].r5,"R5")),p=i.indexToCoordinate(c),_=i.indexToCoordinate(h);for(f in u)m=parseFloat(f),o.isPercent()&&(m=o.priceRange().convertToPercent(m,a)),g=o.priceToCoordinate(m),this._pivots.push({x1:p,x2:_,y:g,label:u[f].text,labelIds:u[f].ids})}}},n.prototype.renderer=function(){var t,e,i,o,n,r,s,l,c,h,u,d,p,_,f,g,S
;for(this._invalidated&&(this._updateImpl(),this._invalidated=!1),t=new b,e=this._source.properties().levelsStyle.colors,i=this._source.properties().levelsStyle.widths,o=0;o<this._pivots.length;o++)if(n=this._pivots[o],r=new a(n.x1,n.y),s=new a(n.x2,n.y),l={points:[r,s],width:this._model.timeScale().width(),height:this._source.priceScale().height(),color:e[n.labelIds[0]].value(),linewidth:i[n.labelIds[0]].value(),linestyle:CanvasEx.LINESTYLE_SOLID,extendleft:!1,extendright:!1,leftend:T.Normal,rightend:T.Normal},c=new m,c.setData(l),c.setHitTest(new y(y.REGULAR)),t.append(c),this._source.properties().levelsStyle.showLabels.value())for(h=n.label.split("/"),u=0,d=0;d<h.length;d++)p=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(h[d]),d>0&&(_=this._cache._labelRectByIndex(p+11),f={left:r.x-_.width+u,top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width/2,g=this._cache._canvas.get(0),S=new v(g,_,f),t.append(S)),_=this._cache._labelRectByIndex(p),f={left:r.x-_.width+u,top:Math.round(r.y-_.height/2),width:_.width,height:_.height},u+=_.width,g=this._cache._canvas.get(0),S=new v(g,_,f),t.append(S);return t},r.prototype._updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,_,f,m,g,v,y,b,w;if(!this._model.timeScale().isEmpty()&&!this._source.priceScale().isEmpty()&&null!==(t=this._model.timeScale().visibleBars())&&this._source._nonseriesdata&&this._source._nonseriesdata.pivots&&(this._cachedFormatter!==this._source.priceScale().formatter()&&(this._cachedFormatter=this._source.priceScale().formatter(),e=this,this._formatterCache=new p(function(t){return e._cachedFormatter.format(t)})),e=this,i=this._model.mainSeries(),o=this._source.priceScale(),null!==(n=i.bars().search(t.lastBar(),S.NearestLeft)))){for(r=n.index,s=this._source._nonseriesdata.pivots,a=this._source._indexes,l=this._source.properties(),c=0;c<s.length;c++)if(s[c]&&(h=a[s[c].startIndex],u=a[s[c].endIndex],d=l.inputs.showHistoricalPivots.value(),u>=r&&h<=r||!d))for(o.properties().percentage.value()&&(_=e._source.firstValue()),f=["p","s1","r1","s2","r2","s3","r3","s4","r4","s5","r5"],this._prices=[],m=0;m<f.length;m++)g=f[m],void 0!==(v=s[c][g])&&(o.properties().percentage.value()&&(v=100*(v-_)/_),y=o.priceToCoordinate(v),b={P:"P",S1:"S1/R1",S2:"S2/R2",S3:"S3/R3",S4:"S4/R4",S5:"S5/R5",R1:"S1/R1",R2:"S2/R2",R3:"S3/R3",R4:"S4/R4",R5:"S5/R5"},w=l.levelsStyle.colors[b[g.toUpperCase()]].value(),this._prices.push({formatted:e._formatterCache.format(v),price:v,coordinate:y,color:w}));this._cache.setPrices(this._prices)}},r.prototype.update=function(){this._invidated=!0},r.prototype.prices=function(){return this._invidated&&(this._updateImpl(),this._invidated=!1),this._prices},inherit(s,_),s.prototype.lastValueData=function(t,e,i){var o=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(t.toUpperCase()),n={noData:!0},r=this._pricesView.prices()[o];return null!==r&&void 0!==r?r:n},s.prototype.lastPriceLabelFixedCoordinate=function(t){var e=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"].indexOf(t.toUpperCase())
;return this._priceAxisViews[e]._fixedCoordinate},s.prototype.priceLabelText=function(t){return this._metaInfo.shortDescription+":"+t.toUpperCase()},s.prototype.pricesView=function(){return this._pricesView},s.prototype._getActualCacheParams=function(){var t={};return t.font=this.properties().font.value(),t.fontSize=this.properties().fontsize.value(),t.backColors=[this.properties().levelsStyle.colors.P.value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S1/R1"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S2/R2"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S3/R3"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S4/R4"].value(),this.properties().levelsStyle.colors["S5/R5"].value(),this.properties().levelsStyle.colors["S5/R5"].value()],t.colors=t.backColors.map(function(t){return"black"===h(c(t),150)?"white":"black"}),t},s.prototype.updateAllViews=function(){var t;for(_.prototype.updateAllViews.call(this),this._pricesView.update(),t=0;t<this._priceAxisViews.length;t++)this._priceAxisViews[t].update();for(t=0;t<this._paneViews.length;t++)this._paneViews[t].update()},s.prototype.paneViews=function(t){var e=_.prototype.paneViews.call(this,t);return e?e.concat(this._paneViews):this._paneViews},s.prototype.createViews=function(){var t,e,i,n,s=this._getActualCacheParams();for(this._cache&&this._cache.remove(),this._cache=new o(s.font,s.fontSize,s.backColors,s.colors),this._priceAxisViews=[],t=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],this._paneViews.length=0,e=this.properties().levelsStyle.visibility,i=0;i<t.length;i++)this._priceAxisViews.push(new f(this,{name:t[i],cache:this._cache})),n="P"===t[i].toUpperCase()?"P":"S"+t[i][1]+"/R"+t[i][1],e[n]&&e[n].value()&&this._paneViews.push(new g(this._model,this,t[i],"priceLabelText","showStudyPlotLabels"));this._dataWindowView||(this._dataWindowView=new d(this,this._model)),this._statusView||(this._statusView=new u(this,this._model.properties())),this._paneView.setCache(this._cache),this._pricesView=new r(this,this._cache)},s.prototype._postProcessGraphics=function(){},s.prototype.isVisible=function(){var t,e,i;if(!this.properties().visible.value())return!1;for(t=["P","S1/R1","S2/R2","S3/R3","S4/R4","S5/R5"],e=this.properties().levelsStyle.visibility,i=0;i<t.length;i++)if(e[t[i]].value())return!0;return!1},s.prototype.stop=function(){TradingView.Study.prototype.stop.call(this),this._cache&&this._cache.remove()},s.prototype.priceRange=function(t,i){var o,n,r,s,a,l,c,h,u;if(!this._nonseriesdata||!this._nonseriesdata.pivots||!this._indexes)return null;if(!this.priceScale())return null;for(o=this._nonseriesdata.pivots,n=this._indexes,r=null,s=0;s<o.length;s++)if(o[s]&&(a=n[o[s].startIndex],!(n[o[s].endIndex]<t||a>i)))for(l=[],c=this._properties.levelsStyle.visibility,c.P.value()&&l.push(o[s].p),c["S1/R1"].value()&&l.push(o[s].s1,o[s].r1),
c["S2/R2"].value()&&l.push(o[s].s2,o[s].r2),c["S3/R3"].value()&&l.push(o[s].s3,o[s].r3),c["S4/R4"].value()&&l.push(o[s].s4,o[s].r4),c["S5/R5"].value()&&l.push(o[s].s5,o[s].r5),h=0;h<l.length;h++)l[h]&&(null===r?r=new e(l[h],l[h]):r.apply(l[h],l[h]));return this.priceScale().isLog()&&r?new e(this.priceScale().priceToLogical(r.minValue()),this.priceScale().priceToLogical(r.maxValue())):this.priceScale().properties().percentage.value()&&r?(u=this.ownerSource().firstValue(),u?r.convertToPercents(u):null):r},s.prototype.getStylesPropertyPage=function(){return w.StudyPivotPointsStandardStylesPropertyPage},t.exports=s}).call(e,i(73))},function(t,e,i){"use strict";function o(t,e,i,o,r){this._paneView=r,n.call(this,t,e,i,o)}var n=i(35).Study;inherit(o,n),o.prototype.onData=function(t){var e=this;switch(t.method){case"data_update":n.prototype._makeJSONForNSData.call(this,t,{}).then(function(i){i.indexes_replace?e._indexes=t.params.nonseries.indexes:(e._nonseriesdata=i.data,e._indexes=t.params.nonseries.indexes);var o=e._model.paneForSource(e);e._model.recalculatePane(o),e._model.updateSource(e)});break;default:return n.prototype.onData.call(this,t)}},o.prototype.updateAllViews=function(){this._paneView.update(),this._dataWindowView.update(),this._statusView.update()},o.prototype.paneViews=function(t){return[this._paneView]},o.prototype.state=function(t){var e=n.prototype.state.call(this,t);return t&&(e.nonSeriesData=this._nonseriesdata,e.indexes=this._indexes),e},o.prototype.restoreData=function(t,e,i){n.prototype.restoreData.call(this,t),this._nonseriesdata=e,this._indexes=i},o.prototype.clearData=function(){this._nonseriesdata=null,this._indexes=null},o.prototype.nonSeriesData=function(){return this._nonseriesdata},t.exports=o},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(67),r=["P","S1","R1","S2","R2","S3","R3","S4","R4","S5","R5"],s=function(t){function e(e,i){var o,n=t.call(this)||this;return n._source=e,n._data=i,o=i.name,n._completeName="P"===o.toUpperCase()?"P":"S"+o[1]+"/R"+o[1],n}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,n,s,a,l,c,h,u;t.visible=!1,e=this._source.properties(),e.visible.value()&&(i=this._completeName,o=e.levelsStyle.visibility,o[i]&&o[i].value()&&(n=this._source.model(),s=n.timeScale(),a=this._source.priceScale(),s.isEmpty()||null===s.visibleBars()||null!==a&&a.isEmpty()||(l=this._source.nonSeriesData())&&l.pivots&&(c=this._source.pricesView().prices(),h=r.indexOf(this._data.name.toUpperCase()),(u=c[h])&&(t.background=u.color,t.color=this.generateTextColor(u.color),t.coordinate=u.coordinate,t.floatCoordinate=u.floatCoordinate,t.text=u.formatted,t.visible=!0))))},e}(n.PriceAxisView),e.StandardPivotPointsPriceAxisView=s},function(t,e,i){"use strict";function o(t,e){this._source=t,this._model=e,this._points=[new s(0,0)],this._lineRenderer=new x}function n(t,e){w.call(this),this._additional=void 0,this._study=t,this._model=e,this._items.push(new T("Open","")),this._items.push(new T("High","")),
this._items.push(new T("Low","")),this._items.push(new T("Close","")),this._invalidated=!0,this.update()}function r(t,e,i,o){this._symbolLabelView=new P(t,this,void 0,"symbol","showSymbolLabels"),this._baseLineView=null,l.call(this,t,e,i,o),this._formatter=null,this._paneView=null;var n=this;this.properties().minTick.listeners().subscribe(null,function(){n._createFormatter(),n.updateAllViews(),n._model.invalidate(new L(L.FULL_UPDATE))}),this.properties().style.listeners().subscribe(this,this._updateBarFunction),this.properties().lineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().areaStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this.properties().baselineStyle.priceSource.listeners().subscribe(this,this._updateBarFunction),this._updateBarFunction()}var s=i(8).Point,a=i(77),l=i(35).Study,c=i(349),h=i(19).PlotRowSearchMode,u=i(893).OverlayPriceAxisView,d=i(342),p=d.SeriesAreaPaneView,_=d.SeriesLinePaneView,f=d.SeriesHollowCandlesPaneView,m=d.SeriesCandlesPaneView,g=d.SeriesBarsPaneView,v=d.SeriesBaselinePaneView,y=d.SeriesBaselineLinePaneView,b=i(126),S=i(157),w=S.DataWindowView,T=S.DataWindowItem,C=i(217).SeriesBarColorer,x=i(94).HorizontalLineRenderer,P=i(124),L=i(22),I=i(28).PriceFormatter,k=i(3).propertyPages,A=i(5),M=!A.enabled("hide_study_overlay_legend_item");o.prototype.update=function(){if(this._visible=!1,this._source.properties().showPriceLine.value()){var t=this._source.lastValueData(void 0,!0);t.noData||(this._visible=!0,this._points=[new s(0,t.coordinate)],this._color=t.color)}},o.prototype.renderer=function(){var t={};return t.width=this._model.timeScale().width(),t.height=this._source.priceScale().height(),t.points=this._points,t.color=this._color,t.linewidth=1,t.linestyle=CanvasEx.LINESTYLE_DOTTED,t.visible=this._visible,this._lineRenderer.setData(t),this._lineRenderer},inherit(n,w),n.prototype._updateImpl=function(){var t,e,i,o,n,r,s,l,c,u,d,p,_,f;if(this._header=this._study.title(),!this._model.timeScale().isEmpty()&&0!==this._study.data().length&&(i=!1,o=this._study.properties().style.value(),o===a.STYLE_BARS?(t=this._study.properties().barStyle.upColor.value(),e=this._study.properties().barStyle.downColor.value(),i=this._study.properties().barStyle.barColorsOnPrevClose.value()):o===a.STYLE_CANDLES?(t=this._study.properties().candleStyle.upColor.value(),e=this._study.properties().candleStyle.downColor.value(),i=this._study.properties().candleStyle.barColorsOnPrevClose.value()):o===a.STYLE_HOLLOW_CANDLES?(t=this._study.properties().hollowCandleStyle.upColor.value(),e=this._study.properties().hollowCandleStyle.downColor.value(),i=!0):o===a.STYLE_LINE?t=e=this._study.properties().lineStyle.color.value():o===a.STYLE_AREA&&(t=e=this._study.properties().areaStyle.linecolor.value()),n=this._study.series(),r=this._model.crossHairSource().appliedIndex(),void 0!==(s=n.nearestIndex(r,h.NearestLeft)))){
if(!(null!==(l=this._study.data().valueAt(s))&&l[TradingView.OPEN_PLOT]&&l[TradingView.HIGH_PLOT]&&l[TradingView.LOW_PLOT]&&l[TradingView.CLOSE_PLOT]))return;for(c=this._study.formatter(),this._items[0].setValue(c.format(l[TradingView.OPEN_PLOT])),this._items[1].setValue(c.format(l[TradingView.HIGH_PLOT])),this._items[2].setValue(c.format(l[TradingView.LOW_PLOT])),this._items[3].setValue(c.format(l[TradingView.CLOSE_PLOT])),o===a.STYLE_BASELINE?(d=this._study.barColorer(),p=d.barStyle(s,!1),u=null!=p.barBorderColor?p.barBorderColor:p.barColor):i&&s>=1?(_=this._study.data().valueAt(s-1),u=_[TradingView.CLOSE_PLOT]<=l[TradingView.CLOSE_PLOT]?t:e):u=l[TradingView.OPEN_PLOT]<=l[TradingView.CLOSE_PLOT]?t:e,f=0;f<4;f++)this._items[f].setColor(u)}},n.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},n.prototype.update=function(){this._invalidated=!0},n.prototype.additional=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._additional},inherit(r,l),r.prototype.createPlotLabels=function(t){},r.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},r.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},r.prototype.lastValueData=function(t,e,i){var o,n,r,s,l,c,u,d,p,_,f,m,g,v={noData:!0};if(this._model.timeScale().isEmpty()||null==this.priceScale()||this.priceScale().isEmpty()||this.data().isEmpty())return v;if(null===(o=this._model.timeScale().visibleBars()))return v;if(!this.properties().visible.value())return v;if(null==(n=this.nearestIndex(o.lastBar(),h.NearestLeft)))return v;if(r=this._lastNonEmptyPlotRow(TradingView.CLOSE_PLOT),s=null!==r&&o.contains(r.index),l=null!==r?r.value:null,c=e||s?l:this.data().valueAt(n),u=this._barFunction(c),!c||!isNumber(u))return v;if(d={noData:!1},i&&(d.price=u),this.priceScale().properties().percentage.value()){if(!(p=this.firstValue(!0)))return v;u=this.priceScale().priceRange().convertToPercent(u,p)}switch(d.text=this.priceScale().formatter().format(u),d.floatCoordinate=this.priceScale().priceToCoordinate(u,!0),d.coordinate=Math.round(d.floatCoordinate),d.item=c,_=this.properties(),_.style.value()){case a.STYLE_BARS:d.color=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?_.barStyle.upColor.value():_.barStyle.downColor.value();break;case a.STYLE_CANDLES:case a.STYLE_HOLLOW_CANDLES:d.color=c[TradingView.OPEN_PLOT]<=c[TradingView.CLOSE_PLOT]?_.candleStyle.upColor.value():_.candleStyle.downColor.value();break;case a.STYLE_LINE:d.color=_.lineStyle.color.value();break;case a.STYLE_AREA:d.color=_.areaStyle.color1.value();break;case a.STYLE_BASELINE:f=_.baselineStyle,m=this.priceScale(),g=Math.round(m.height()*(Math.abs(100-f.baseLevelPercentage.value())/100)),d.color=d.coordinate<g?_.baselineStyle.topLineColor.value():_.baselineStyle.bottomLineColor.value()}return d},r.prototype.firstValue=function(t){
var e,i,o=this._model.timeScale().visibleBars();return null===o?null:(e=o.firstBar(),0===this.data().size()?null:(i=this.data().search(e,h.NearestRight),null!==i?this._barFunction(i.value):null))},r.prototype.barFunction=function(){return this._barFunction},r.prototype._updateBarFunction=function(){this._barFunction=c.barFunction(this._currentPriceSource())},r.prototype._currentPriceSource=function(){switch(this._properties.style.value()){case a.STYLE_LINE:return this._properties.lineStyle.priceSource.value();case a.STYLE_AREA:return this._properties.areaStyle.priceSource.value();case a.STYLE_BASELINE:return this._properties.baselineStyle.priceSource.value()}return"close"},r.prototype.createViews=function(){this._priceAxisViews=[],this._priceAxisViewsBase=[new u(this)],this._paneViews=[];var t=null;switch(this._properties.style.value()){case a.STYLE_BARS:t=new g(this,this._model);break;case a.STYLE_CANDLES:t=new m(this,this._model);break;case a.STYLE_HOLLOW_CANDLES:t=new f(this,this._model);break;case a.STYLE_LINE:t=new _(this,this._model);break;case a.STYLE_AREA:t=new p(this,this._model);break;case a.STYLE_BASELINE:t=new v(this,this._model),this._baseLineView=new y(this,this._model)}t&&this._paneViews.push(t),null!==this._baseLineView&&this._paneViews.push(this._baseLineView),this._paneViews.push(new o(this,this._model)),this._paneViews.push(this._symbolLabelView),this._dataWindowView||(this._dataWindowView=new n(this,this._model)),this._statusView||(this._statusView=new b(this)),this._priceAxisViews=[].concat(this._priceAxisViewsBase,this._hlinesPriceAsisViews,this._horizlinesPriceAsisViews)},r.prototype.barColorer=function(){return new C(this)},r.prototype.start=function(t){this._formatter=null,l.prototype.start.apply(this,arguments),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype._createFormatter=function(){var t,e,i,o,n,r,s;"default"===this.properties().minTick.value()?(t=this.properties().inputs.symbol.value(),e=this._resolvedSymbols[t],this._formatter=new I(e?e.pricescale:100,e?e.minmov:1,!!e&&e.fractional)):(i=this.properties().minTick.value(),o=isNumber(i)?["100","1","false"]:i.split(","),n=parseInt(o[0]),r=parseInt(o[1]),s="true"===o[2],this._formatter=new I(n,r,s)),this.priceScale()&&this.priceScale().updateFormatter()},r.prototype.formatter=function(){return this._formatter||this._createFormatter(),this._formatter},r.prototype._changeInputs=function(){l.prototype._changeInputs.call(this,this.inputs()),this.m_formatter=null,this.priceScale().updateFormatter()},r.prototype.title=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols[e];return i?(t=i.name,i.exchange&&0!==i.exchange.length&&(t+=", "+i.exchange)):t=e,t.toUpperCase()},r.prototype.bars=function(){return this.m_data},r.prototype.open=function(t){return this.bars().valueAt(t)[TradingView.OPEN_PLOT]},r.prototype.high=function(t){return this.bars().valueAt(t)[TradingView.HIGH_PLOT]},r.prototype.low=function(t){return this.bars().valueAt(t)[TradingView.LOW_PLOT]},r.prototype.close=function(t){
return this.bars().valueAt(t)[TradingView.CLOSE_PLOT]},r.prototype.hl2=function(t){return(this.high(t)+this.low(t))/2},r.prototype.hlc3=function(t){return(this.high(t)+this.low(t)+this.close(t))/3},r.prototype.ohlc4=function(t){return(this.open(t)+this.high(t)+this.low(t)+this.close(t))/4},r.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},r.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},r.prototype.tags=function(){var t=[],e=this.symbolInfo();return e?t.push(e.name):this._properties.inputs.symbol.value()&&t.push(this._properties.inputs.symbol.value()),t},r.prototype.statusView=function(){return M?l.prototype.statusView.call(this):null},r.prototype.getStylesPropertyPage=function(){return k.StudyOverlayStylesPropertyPage},e.OverlayDataWindowView=n,e.study_Overlay=r},function(t,e,i){"use strict";function o(t,e){n.call(this,e),this._series=t,this._series.onRestarted().subscribe(this,o.prototype.invalidate),this._series.onSymbolResolved().subscribe(this,o.prototype.invalidate),this._series.onCompleted().subscribe(this,o.prototype.invalidate),this._series.onBoxSizeChanged().subscribe(this,o.prototype.invalidate)}var n=i(329),r=i(878).getTranslatedSymbolDescription,s=i(879).generateTitleForGui;inherit(o,n),o.prototype.invalidate=function(){delete this._text,this.update()},o.prototype.getSeriesPrecision=function(){var t=4;return this._series._symbolInfo&&this._series._symbolInfo.pricescale&&(t=Math.round(Math.log(this._series._symbolInfo.pricescale)/Math.log(10))),t},o.prototype.round=function(t){var e=this.getSeriesPrecision(),i=Math.round(t*Math.pow(10,e))/Math.pow(10,e);return i||""},o.prototype.update=function(){if(!("_text"in this)){var t=this._series.symbolInfo()||{};this._bold=!1,this._size=this._props.mainSeriesProperties.statusViewStyle.fontSize.value()+"px",this._text=s({description:this._props.mainSeriesProperties.statusViewStyle.showSymbolAsDescription.value()?t.name:r({pro_name:t.pro_name,description:t.description,local_description:t.local_description,language:t.language}),exchange:this._props.mainSeriesProperties.statusViewStyle.showExchange.value()?t.exchange:null,symbol:this._series.symbol(),interval:this._props.mainSeriesProperties.statusViewStyle.showInterval.value()?this._series.interval():null,style:this._series._properties.style.value(),inputs:this._series.getInputsProperties().state(),boxSize:this._series.data().boxSize,reversalAmount:this._series.data().reversalAmount,precision:this.getSeriesPrecision()})}},t.exports=o},function(t,e,i){"use strict";function o(t){return t.description||""}Object.defineProperty(e,"__esModule",{value:!0}),e.getTranslatedSymbolDescription=o},function(t,e,i){"use strict";function o(t){function e(t,e){return Math.round(t*Math.pow(10,e))/Math.pow(10,e)||""}var i,o,s,a=t||{},l="QUANDL"===a.exchange,c="",h={symbolDescription:"",interval:"",exchange:"",chartStyle:"",extended:""}
;switch(a.description&&l?2===a.description.split("/").length?h.symbolDescription=a.description.split("/")[1]:(i=a.description.split("'").filter(function(t){return t.length}),i.forEach(function(t){t=t&&("/"===t[0]||/\d+\/\(?/.test(t))?[t]:t.split("/").filter(function(t){return t.length}),h.symbolDescription+=t[2===t.length?1:0]})):a.description?h.symbolDescription=a.description:h.symbolDescription=a.symbol,a.interval&&(h.interval=n(a.interval)),l&&a.description&&(o=/[\w_]+\/[\w_]+/.exec(a.description),o&&o[0]?h.provider=o[0].split("/")[0]:h.provider=a.description.split("/")[0]),a.exchange&&(h.exchange=a.exchange),a.style){case r.STYLE_RENKO:s=a.inputs.style+("ATR"===a.inputs.style?"("+a.inputs.atrLength+")":""),h.chartStyle=$.t("Renko")+" ["+s+", "+e(a.boxSize,4)+"]";break;case r.STYLE_PB:h.chartStyle=$.t("Line Break")+" ["+a.inputs.lb+"]";break;case r.STYLE_KAGI:s=a.inputs.style+("ATR"===a.inputs.style?"("+a.inputs.atrLength+")":""),h.chartStyle=$.t("Kagi")+" ["+s+(void 0!==a.reversalAmount?", "+e(a.reversalAmount,8):"")+"]";break;case r.STYLE_PNF:s=a.inputs.style+("ATR"===a.inputs.style?"("+a.inputs.atrLength+")":""),h.chartStyle=$.t("PnF")+" ["+s+", "+e(a.boxSize,8)+", "+a.inputs.reversalAmount+"]";break;case r.STYLE_HEIKEN_ASHI:h.chartStyle=$.t("Heikin Ashi")}return a.extended&&(h.extended=window.t("ext",{context:"shorthand_for_extended_session"})),c=h.symbolDescription+(h.interval?", "+h.interval:"")+(h.provider?", "+h.provider:"")+(h.exchange?", "+h.exchange:"")+(h.chartStyle?", "+h.chartStyle:"")+(h.extended?", "+h.extended:""),c=c.replace(/\'/g,"")}var n=i(162).translatedIntervalString,r=i(49);t.exports={generateTitleForGui:o}},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(19),s=i(341),a=i(49),l=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype.lastPrice=function(){return this._getSource().data().lastProjectionPrice},e.prototype._updateRendererData=function(t){var e,i,o,s,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x;t.visible=!1,e=this._getData().model,e.properties().scalesProperties.showSeriesLastValue.value()&&(i=this._getSource(),o=i.priceScale(),s=e.timeScale(),l=this.lastPrice(),s.isEmpty()||o.isEmpty()||void 0===l||null!==(c=s.visibleBars())&&(h=c.firstBar(),u=c.lastBar(),d=i.data(),null!==(p=d.search(u,r.PlotRowSearchMode.NearestLeft))&&void 0!==(_=i.nearestIndex(h,r.PlotRowSearchMode.NearestRight))&&(f=n.ensureNotNull(d.valueAt(_))[TradingView.CLOSE_PLOT],m=l,o.properties().percentage.value()&&(m=100*(m-f)/f),g=t.background,v="",y=!1,b=i.properties(),S=b.style.value()===a.STYLE_HEIKEN_ASHI,S&&b.haStyle.showRealLastPrice.value()?(this._isCountdownEnabled()&&b.showCountdown.value()&&(v=this._countdownText()),w=i.lastValueData(TradingView.CLOSE_PLOT,!0),w.noData||w.color===t.background||(g=w.color),T=i.lastValueData(TradingView.CLOSE_PLOT,!1),w.noData||T.noData||(y=w.index===T.index)):(C=i.barColorer(),x=C.barStyle(p.index,!0),g=x.barColor,y=!0),t.background=g,t.secondLine=v,t.visible=y,
t.color=this.generateTextColor(g),t.coordinate=o.priceToCoordinate(m),t.text=o.formatter().format(m))))},e}(s.SeriesPriceAxisView),e.ProjectionSeriesPriceAxisView=l},function(t,e,i){"use strict";function o(t,e){h.call(this),this._series=t,this._model=e,this._items.push(new u($.t("O",{context:"in_legend"}),"")),this._items.push(new u($.t("H",{context:"in_legend"}),"")),this._items.push(new u($.t("L",{context:"in_legend"}),"")),this._items.push(new u($.t("C",{context:"in_legend"}),"")),this._invalidated=!0,this.update()}var n=i(32),r=n.parseRgb,s=n.distanceRgb,a=n.invertRgb,l=n.rgbToHexString,c=i(157),h=c.DataWindowView,u=c.DataWindowItem,d=i(162).translatedIntervalString,p=i(19).PlotRowSearchMode;inherit(o,h),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i,o,n,c,h,u,_,f,m,g,v;if(this._series.symbolInfo()?(this._header=[this._series.symbolInfo().name,d(this._series.interval()),this._series.symbolInfo().exchange].join(", "),this._title=this._series.symbolInfo().description):this._header=this._series.symbol(),this._items[0].setValue($.t("n/a")),this._items[1].setValue($.t("n/a")),this._items[2].setValue($.t("n/a")),this._items[3].setValue($.t("n/a")),!this._model.timeScale().isEmpty()&&0!==this._series.bars().size()&&(t=this._series.data().size()-1,e=this._model.crossHairSource().appliedIndex(),void 0!==(i=isNumber(e)?this._series.nearestIndex(e,p.NearestLeft):this._series.nearestIndex(t,p.NearestLeft))))for(o=this._series.data().valueAt(i),n=this._series.formatter(),this._items[0].setValue(n.format(o[TradingView.OPEN_PLOT])),this._items[1].setValue(n.format(o[TradingView.HIGH_PLOT])),this._items[2].setValue(n.format(o[TradingView.LOW_PLOT])),this._items[3].setValue(n.format(o[TradingView.CLOSE_PLOT])),c=this._series.barColorer(),h=c.barStyle(i,!1),u=null!=h.barBorderColor?h.barBorderColor:h.barColor,_=this._series.model().paneForSource(this._series),f=_._properties.background.value(),m=r(u),g=r(f),s(m,g)<70&&(u=l(a(m))),v=0;v<4;v++)this._items[v].setColor(u)},o.prototype.items=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._items},o.prototype.dump=function(){return{header:this._header,items:this._items}},t.exports=o},function(t,e,i){"use strict";function o(t){var e,i;if(0===t.length)return!1;if(-1===(e=t.findIndex(function(t){return l.coordinateIsValid(t.y)})))return!1;for(i=t.length-1;i>e&&!l.coordinateIsValid(t[i].y);)i--;return!(e>=i)}function n(t,e){var i,o,n,a,c,h=[],u=[],d=null;for(i=0;i<t.length;i++){if(o=t[i],n=t[i+1]||{},l.coordinateIsValid(o.y))o.y<=e&&h.push(o),o.y>=e&&u.push(o),d=o;else{if(null===d)continue;o=d}l.coordinateIsValid(n.y)&&((o.y>e&&n.y<e||o.y<e&&n.y>e)&&(Math.abs(o.x-n.x)<1?(a=new r.Point(o.x,e),h.push(a),u.push(a)):null!==(c=s.intersectLineSegments(o,n,new r.Point(o.x,e),new r.Point(n.x,e)))&&(a=o.add(n.subtract(o).scaled(c)),h.push(a),u.push(a))))}return{topItems:h,bottomItems:u}}var r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),r=i(8),s=i(132),a=i(44),l=i(45),c=i(86),h=i(11),
e.itemsRangeIsValid=o,e.splitItems=n,u=function(){function t(){this._data=null}return t.prototype.setData=function(t){this._data=t},t.prototype.draw=function(t){var e,i,r,s,a,l,c,h,u,d,p,_,f,m,g;null!==this._data&&(e=this._data,i=e.items,r=e.baseLevelCoordinate,s=e.bottom,a=e.bottomFillColor1,l=e.bottomFillColor2,c=e.topFillColor1,h=e.topFillColor2,u=e.topLineColor,d=e.bottomLineColor,p=e.topLineWidth,_=e.bottomLineWidth,o(i)&&(f=n(i,r),m=f.topItems,g=f.bottomItems,t.lineCap="round",t.lineJoin="round",t.translate(.5,.5),0!==m.length&&(t.beginPath(),t.moveTo(m[0].x,r),this._makeLine(t,m,!0,0),t.closePath(),t.fillStyle=this._makeLinearGradient(t,c,h,r-s,r),t.fill(),t.beginPath(),this._makeLine(t,m,!1,0),t.lineWidth=p,t.strokeStyle=u,t.stroke()),0!==g.length&&(t.beginPath(),t.moveTo(g[0].x,r),this._makeLine(t,g,!0,1),t.closePath(),t.fillStyle=this._makeLinearGradient(t,a,l,r,r+s),t.fill(),t.beginPath(),this._makeLine(t,g,!1,1),t.lineWidth=_,t.strokeStyle=d,t.stroke())))},t.prototype.hitTest=function(t){var e,i,o,n,s,u,d,p,_,f,m;if(null===this._data)return null;for(e=this._data,i=e.items,o=e.topLineWidth,n=e.bottomLineWidth,s=l.selectionTolerance((o+n)/2),u=c.lowerbound(i,t,function(t,e){return t.x<=e.x}),d=Math.max(1,u-1),p=Math.min(i.length-1,u+1),_=d;_<=p;++_)if(f=i[_-1],m=i[_],a.distanceToSegment(new r.Point(f.x,f.y),new r.Point(m.x,m.y),new r.Point(t.x,t.y)).distance<=s)return new h(h.REGULAR);return null},t.prototype._makeLine=function(t,e,i,o){var n,r,s,a,c,h,u,d,p,_;if(null!==this._data&&-1!==(n=e.findIndex(function(t){return l.coordinateIsValid(t.y)})))for(r=this._data,s=r.barSpacing,a=r.baseLevelCoordinate,c=.25*s,u=e.length,d=n;d<u;d++)if(p=e[d],_=e[d+1]||{},l.coordinateIsValid(p.y)){if(0===o){if(h&&h.y>=a&&p.y>=a){t.moveTo(p.x,p.y);continue}}else if(h&&h.y<=a&&p.y<=a){t.moveTo(p.x,p.y);continue}if(h&&l.coordinateIsValid(h.y))t.lineTo(p.x,p.y),i&&!l.coordinateIsValid(_.y)&&t.lineTo(p.x,a);else if(_&&l.coordinateIsValid(_.y))i?(d!==n&&t.lineTo(p.x,a),t.lineTo(p.x,p.y)):t.moveTo(p.x,p.y);else if(i){if(0===d)continue;d!==n&&t.lineTo(p.x-c,a),t.lineTo(p.x-c,p.y),t.lineTo(p.x+c,p.y),t.lineTo(p.x+c,a)}else t.moveTo(p.x-c,p.y),t.lineTo(p.x+c,p.y);h=p}},t.prototype._makeLinearGradient=function(t,e,i,o,n){var r=t.createLinearGradient(0,o,0,n);return r.addColorStop(0,e),r.addColorStop(1,i),r},t}(),e.PaneRendererBaseline=u},function(t,e,i){"use strict";function o(){this._data=null}function n(t){this._series=t,this._invalidated=!0,this._renderer=new o}var r=i(8).Point,s=i(53).CompositeRenderer,a=i(177).DateFormatter,l=i(135).TimeFormatter;o.prototype.setData=function(t){this._data=t},o.prototype.hitTest=function(){return null},o.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m;null!==this._data&&(e=5,i=12,o=5,n=8,r=13,s=0,t.save(),t.setFont(r+"px Arial"),c=$.t("Last available bar"),this._data.eod?s=t.measureText(c).width:(a=t.measureText(this._data.dateString||"").width,l=t.measureText(this._data.timeString||"").width,s=Math.max(a,l)),h=this._data.timeString?2:1,
t.fillStyle=this._data.eod?"#FF4040":"#58A3CD",t.translate(this._data.point.x+.5,this._data.point.y+.5),u=Math.round(-s/2)-n,d=-(r+e)*h-e-i-o,p=Math.round(u+s+2*n),_=-i-o,t.beginPath(),t.moveTo(u,d),t.lineTo(p,d),t.lineTo(p,_),t.lineTo(i,_),t.lineTo(0,_+i),t.lineTo(-i,_),t.lineTo(u,_),t.fill(),t.fillStyle="#FFFFFF",t.textBaseline="top",this._data.eod?t.fillText(c,u+n,d+e):(f=u+n+(s-a)/2,t.fillText(this._data.dateString,f,d+e),this._data.timeString&&(m=u+n+(s-l)/2,t.fillText(this._data.timeString,m,d+2*e+r))),t.restore())},n.prototype.update=function(){this._invalidated=!0},n.prototype.updateImpl=function(){var t,e,i,o,n,s,c;delete this._point,delete this._dateString,delete this._timeString,delete this._eod,void 0!==(t=this._series.gotoDateResult())&&(e=this._series.model().timeScale().timePointToIndex(t.timestamp),i=this._series.bars(),o=null,e<i.firstIndex()&&null!==i.first()?(e=i.firstIndex(),o=i.first().value):e>i.lastIndex()&&null!==i.last()?(e=i.lastIndex(),o=i.last().value):o=i.valueAt(e),null!==o&&(n=this._series.priceScale().priceToCoordinate(o[TradingView.HIGH_PLOT]),s=this._series.model().timeScale().indexToCoordinate(e),this._point=new r(s,n),t.eod?this._eod=!0:(c=this._series.model().timeScale().indexToUserTime(e),this._dateString=(new a).format(c),this._series.isDWM()||(this._timeString=(new l).format(c)))))},n.prototype.renderer=function(){return this._invalidated&&(this.updateImpl(),this._invalidated=!1),this._point?(this._renderer.setData({point:this._point,dateString:this._dateString,timeString:this._timeString,eod:this._eod}),this._renderer):new s},t.exports=n},function(t,e,i){"use strict";function o(){this._data=null,this._colors=null}function n(t,e,i){this._series=t,this._lastBar=e,this._direction=i,this._renderer=new o}var r=i(9).ensureNotNull;i(345).ChartSession,i(7).getLogger("Chart.Snapshot");o.prototype.setData=function(t){this._data=t},o.prototype.setPredictCode=function(t){this._colors=this.getBackgroundColor(t)},o.prototype.hitTest=function(){return null},o.prototype.getBackgroundColor=function(t){return[{background:"rgba(255, 158, 171, 0.3)",line:"#7E202F"},{background:"rgba(244, 255, 158, 0.3)",line:"#EBFF3F"},{background:"rgba(195, 255, 160, 0.3)",line:"#308020"}][t+1]},o.prototype.draw=function(t){if(null!==this._data&&null!==this._colors){t.fillStyle=this._colors.background,t.fillRect(Math.max(0,this._data.x),0,this._data.width,this._data.height),t.strokeStyle=this._colors.line,t.beginPath(),t.lineWidth=1;var e=Math.round(this._data.x);t.moveTo(e,0),t.lineTo(e,this._data.height),t.stroke()}},n.prototype.update=function(){this._x=this._series.m_model.timeScale().indexToCoordinate(this._lastBar)+.5*this._series.m_model.timeScale().barSpacing()+1},n.prototype.renderer=function(){var t={x:this._x,height:this._series.priceScale().height(),width:this._series.m_model.timeScale().width()},e=this._series.data().bars(),i=r(e.last()).value[TradingView.CLOSE_PLOT]>r(e.valueAt(this._lastBar))[TradingView.CLOSE_PLOT]?1:-1,o=0;return 1===this._direction?o=i:2===this._direction&&(o=-1*i),
this._renderer.setData(t),this._renderer.setPredictCode(o),this._renderer},e.FutureBarsPaneView=n},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(9),n=i(17),r=i(10),s=i(61),a=i(7),l=a.getLogger("ChartApi.AbstractSession"),c="",h=function(){function t(t,e,i){this._isConnected=new n(!1),this._state=0,this._isConnectForbidden=!1,this._sessionId=c,this._sessionIdChanged=new r,this._chartApi=t,this._sessionPrefix=e,this._shouldReconnectAfterCriticalError=i}return t.prototype.destroy=function(){this._logNormal("Destroying session"),this._isConnected.unsubscribe(),this.disconnect(),this._sessionIdChanged.destroy(),delete this._chartApi,this._logNormal("Session has been destroyed")},t.prototype.isConnected=function(){return this._isConnected},t.prototype.sessionId=function(){return this._sessionId},t.prototype.onSessionIdChanged=function(){return this._sessionIdChanged},t.prototype.connect=function(){0===this._state&&(o.assert(!this._isConnectForbidden,"Cannot call connect because it is forbidden at this moment"),this._setSessionId(this._sessionPrefix+"_"+s.randomHash()),this._logNormal("Connecting session - wait until transport stay connected"),this._state=1,this._chartApi.createSession(this._sessionId,this))},t.prototype.disconnect=function(){var t=this;0!==this._state&&(o.assert(this._sessionId!==c,"sessionId must not be invalid"),this._logNormal("Disconnecting session..."),this._forbidConnectWhile(function(){t._chartApi.connected()&&t._sendRemoveSession(),t._processDestroyingOnServer()}))},t.prototype.onMessage=function(t){var e,i;switch(t.method){case"connected":return void this._onChartApiConnected();case"disconnected":return void this._onChartApiDisconnected();case"critical_error":return e=t.params[0]+"",i=t.params[1]+"",void this._onCriticalError(e,i)}this._onMessage(t)},t.prototype._getChartApi=function(){return this._chartApi},t.prototype._generateLogMessage=function(t){return"["+this._sessionId+"] "+t},t.prototype._onCriticalError=function(t,e){var i=this;this._logError("Critical error. Reason="+t+", info="+e+"."),this._forbidConnectWhile(function(){i._processDestroyingOnServer()}),this._shouldReconnectAfterCriticalError?(this._logNormal("Reconnecting after critical error..."),this.connect()):this._logNormal("Reconnecting after critical error skipped")},t.prototype._onChartApiConnected=function(){o.assert(1===this._state,"Session is not registered"),this._logNormal("Transport is connected. Creating session on the server"),this._sendCreateSession(),this._state=2,this._isConnected.setValue(!0)},t.prototype._onChartApiDisconnected=function(){var t=this;this._logNormal("Transport is disconnected. Reconnecting..."),this._forbidConnectWhile(function(){t._processDestroyingOnServer()}),this.connect()},t.prototype._setSessionId=function(t){var e=this._sessionId;this._logNormal("Changing sessionId: old="+e+", new="+t),this._sessionId=t,this._sessionIdChanged.fire(t,e)},t.prototype._logNormal=function(t){l.logNormal(this._generateLogMessage(t))},
t.prototype._logError=function(t){l.logError(this._generateLogMessage(t))},t.prototype._processDestroyingOnServer=function(){this._state=0,this._isConnected.setValue(!1),this._chartApi.removeSession(this._sessionId),this._setSessionId(c)},t.prototype._forbidConnectWhile=function(t){this._isConnectForbidden=!0,t(),this._isConnectForbidden=!1},t}(),e.Session=h},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M12.5 17.207L18.707 11h2l3.647-3.646-.708-.708L20.293 10h-2L12.5 15.793l-3-3-4.854 4.853.708.708L9.5 14.207z"/><path d="M9 16h1v1H9zm1 1h1v1h-1zm-1 1h1v1H9zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1H9zm2 0h1v1h-1zm-3-3h1v1H8zm-1 1h1v1H7zm-1 1h1v1H6zm2 0h1v1H8zm-1 1h1v1H7zm-2 0h1v1H5zm17-9h1v1h-1zm1-1h1v1h-1zm0 2h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-5-7h1v1h-1zm2 0h1v1h-1zm1-1h1v1h-1zm-2 2h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-2-6h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-3-3h1v1h-1zm-1 1h1v1h-1zm-1 1h1v1h-1zm2 0h1v1h-1zm-1 1h1v1h-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M18 6h1v16h-1z"/><path d="M18.5 18H22v1h-3.5zM15 13h3.5v1H15zm-5-6h1v16h-1z"/><path d="M10.5 9H14v1h-3.5zM7 20h3.5v1H7z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M17 11v6h3v-6h-3zm-.5-1h4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-7a.5.5 0 0 1 .5-.5z"/><path d="M18 7h1v3.5h-1zm0 10.5h1V21h-1z"/><path d="M9 8v12h3V8H9zm-.5-1h4a.5.5 0 0 1 .5.5v13a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-13a.5.5 0 0 1 .5-.5z"/><path d="M10 4h1v3.5h-1zm0 16.5h1V24h-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M9 8v12h3V8H9zm-1-.502C8 7.223 8.215 7 8.498 7h4.004c.275 0 .498.22.498.498v13.004a.493.493 0 0 1-.498.498H8.498A.496.496 0 0 1 8 20.502V7.498z"/><path d="M10 4h1v3.5h-1z"/><path d="M17 6v6h3V6h-3zm-1-.5c0-.276.215-.5.498-.5h4.004c.275 0 .498.23.498.5v7c0 .276-.215.5-.498.5h-4.004a.503.503 0 0 1-.498-.5v-7z"/><path d="M18 2h1v3.5h-1z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M17 11v6h3v-6h-3zm-.5-1h4a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-7a.5.5 0 0 1 .5-.5z"/><path d="M18 7h1v3.5h-1zm0 10.5h1V21h-1z"/><path d="M9 8v11h3V8H9zm-.5-1h4a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5v-12a.5.5 0 0 1 .5-.5z"/><path d="M10 4h1v5h-1zm0 14h1v5h-1zM8.5 9H10v1H8.5zM11 9h1.5v1H11zm-1 1h1v1h-1zm-1.5 1H10v1H8.5zm2.5 0h1.5v1H11zm-1 1h1v1h-1zm-1.5 1H10v1H8.5zm2.5 0h1.5v1H11zm-1 1h1v1h-1zm-1.5 1H10v1H8.5zm2.5 0h1.5v1H11zm-1 1h1v1h-1zm-1.5 1H10v1H8.5zm2.5 0h1.5v1H11z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M11.982 16.689L17.192 12h3.033l4.149-4.668-.748-.664L19.776 11h-2.968l-4.79 4.311L9 12.293l-4.354 4.353.708.708L9 13.707z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill="none" stroke="currentColor"><path stroke-dasharray="1,1" d="M4 14.5h22"/><path stroke-linecap="round" stroke-linejoin="round" d="M7.5 12.5l2-4 1 2 2-4 3 6"/><path stroke-linecap="round" d="M5.5 16.5l-1 2"/><path stroke-linecap="round" stroke-linejoin="round" d="M17.5 16.5l2 4 2-4m2-4l1-2-1 2z"/></g></svg>'},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(67),r=function(t){function e(e){var i=t.call(this)||this;return i._source=e,i}return o.__extends(e,t),e.prototype._updateRendererData=function(t){t.visible=!1;var e=this._source.lastValueData("close",!1);e.noData||(t.background=e.color,t.color=this.generateTextColor(e.color),t.coordinate=e.coordinate,t.floatCoordinate=e.floatCoordinate,t.text=e.text,t.visible=!0)},e}(n.PriceAxisView),e.OverlayPriceAxisView=r},function(t,e,i){"use strict";function o(t,e,i,o){this._symbolLabelView=new s(t,this,"compare","symbol","showSymbolLabels"),n.call(this,t,e,i,o);var r=this;this._properties.minTick.listeners().subscribe(null,function(){r._createFormatter()}),this.properties().minTick.listeners().subscribe(null,function(){r._model.invalidate(new a(a.FULL_UPDATE))}),this._properties.merge({skipHistogramBaseOnAutoScale:!0})}var n=i(35).Study,r=i(125).DataVendorStudyDataWindowView,s=i(124),a=i(22),l=i(28).PriceFormatter,c=i(3).propertyPages,h=i(5),u=!h.enabled("hide_study_compare_legend_item");inherit(o,n),o.prototype.createPlotLabels=function(t){},o.prototype._showLastValueOnPriceScale=function(){return this._model.properties().scalesProperties.showSeriesLastValue.value()},o.prototype.createViews=function(){this._dataWindowView||(this._dataWindowView=new r(this,this._model)),n.prototype.createViews.call(this),this._paneViews.push(this._symbolLabelView)},o.prototype._createFormatter=function(){var t,e,i,o,n,r=this.properties().inputs.symbol.value(),s=this._resolvedSymbols?this._resolvedSymbols[r]:null;"default"===this.properties().minTick.value()?this._formatter=new l(s?s.pricescale:100,s?s.minmov:1,!!s&&s.fractional):(t=this.properties().minTick.value(),
e=isNumber(t)?["100","1","false"]:t.split(","),i=parseInt(e[0]),o=parseInt(e[1]),n="true"===e[2],this._formatter=new l(i,o,n)),this.priceScale()&&this.priceScale().updateFormatter()},o.prototype.symbol=function(){var t,e=this.properties().inputs.symbol.value(),i=this._resolvedSymbols?this._resolvedSymbols[e]:null;return t=i?i.name:e,t.toUpperCase()},o.prototype.title=function(t){var e,i=this.properties().inputs.symbol.value(),o=this._resolvedSymbols?this._resolvedSymbols[i]:null;return o?(e=o.name,o.exchange&&0!==o.exchange.length&&(e+=", "+o.exchange)):e=i,e.toUpperCase()},o.prototype.symbolInfo=function(){if(!this._resolvedSymbols)return null;var t=this._properties.inputs.symbol.value();return t?this._resolvedSymbols[t]:null},o.prototype.lastPriceLabelFixedCoordinate=function(){return this._priceAxisViews[0]._fixedCoordinate},o.prototype.tags=function(){var t=this.symbol();return t?[t]:[]},o.prototype.statusView=function(){return u?n.prototype.statusView.call(this):null},o.prototype.getInputsPropertyPage=function(){return c.StudyCompareInputsPropertyPage},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,o){n.call(this,t,e,i,o)}var n=i(35).Study;inherit(o,n),o.prototype.hasContextMenu=function(){return!1},o.prototype.showInObjectTree=function(){return!1},o.prototype.isSavedInStudyTemplates=function(){return!1},o.prototype.isRemovedByStudyTemplates=function(){return!1},o.prototype.removeByRemoveAllStudies=function(){return!1},o.prototype.isUserDeletable=function(){return!1},o.prototype.statusView=function(){return!1},o.prototype.isDraggable=function(){return!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i,o){n.call(this,t,e,i,o)}var n=i(35).Study,r=i(3).propertyPages;inherit(o,n),o.prototype.getStylesPropertyPage=function(){return r.VolumePropertyPage},e.study_Volume=o},function(t,e,i){"use strict";function o(t,e,i,o){s.call(this,t,e,i,o)}var n=i(9).assert,r=i(15).clone,s=i(35).Study,a=i(19).PlotList;inherit(o,s),o.prototype.clearData=function(){s.prototype.clearData.call(this),this._underlyingData=new a(this._plotFields)},o.prototype._mergeData=function(t){var e,i;return this._invalidateLastNonEmptyPlotRowCache(),e=this._underlyingData.firstIndex(),this._underlyingData.merge(t),e!==this._underlyingData.firstIndex()&&(this.m_data=new a(this._underlyingData.plotNames())),i=this.m_data.lastIndex(),this._underlyingData.range(i,this._underlyingData.lastIndex()).each(function(t,e){return this.m_data.add(t,r(e)),!1}.bind(this)),this._plotsForStrategyProcessing().forEach(function(t){this._createStrategy(t.strategy,t.strategyIndex,t.targetIndex,i).rebuildData(this.m_data)},this),this.m_data},o.prototype._plotsForStrategyProcessing=function(){var t=["dataoffset"],e=[];return this._metaInfo.plots.forEach(function(i,o){var r,s;t.indexOf(i.type)>-1&&(r=null,this._metaInfo.plots.forEach(function(t,e){t.id===i.target&&(r=e)}),n(r>=0,"target plot not found for strategy plot "+i.id),s={strategy:i.type,strategyIndex:o,targetIndex:r},e.push(s))},this),e},o.prototype._createStrategy=function(t,e,i,n){
return new o["Strategy_"+t](e,i,n)},o.Strategy_dataoffset=function(t,e,i){this._strategyPlotIndex=t,this._targetPlotIndex=e,this._startIndex=i},o.Strategy_dataoffset.prototype.rebuildData=function(t){var e=this._targetPlotIndex+1,i=this._strategyPlotIndex+1,o=null,n=null;t.range(this._startIndex||t.firstIndex(),t.lastIndex()).each(function(r,s){var a,l,c,h=s[e],u=s[i]?Math.round(s[i]):null;return s[e]=null,s[i]=null,!(!u||u>0)&&(a=r+u,l={pointIndex:a,value:h},n?n.pointIndex!==l.pointIndex&&(a>=0&&(t.valueAt(a)[e]=h),c=!1,o&&(c=o.value<=n.value&&n.value<=h||o.value>=n.value&&n.value>=h),c?n.pointIndex>=0&&(t.valueAt(n.pointIndex)[e]=null):o=n,n=l):n=l,!1)})},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(105).LineStudyMtp;inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_tsanalysis"},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),null===e?null:[this.properties().inputs.displayZoneLabels.value(),1e3*e[TradingView.TIME_PLOT],this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value(),this.properties().inputs.minRRRatio.value(),this.properties().inputs.shouldFilterWPTZones.value(),this.properties().inputs.shouldFilterSTFTrends.value()])},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i),this._symbolIntervalChanged=!1,this._model.mainSeries().onSymbolIntervalChanged().subscribe(this,this.onSymbolIntervalChanged)}var n=i(105).LineStudyMtp;inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_decisionpoint"},o.prototype.onSymbolIntervalChanged=function(){this._symbolIntervalChanged=!0},o.prototype.pointsCount=function(){return 1},o.prototype._studyInputs=function(){var t,e,i=this.points();return i.length<this.pointsCount()?null:(t=i[0].index,e=this._model.mainSeries().bars().valueAt(t),null===e?null:[this.properties().inputs.displayZoneLabels.value(),this._symbolIntervalChanged,1e3*e[TradingView.TIME_PLOT]])},o.prototype.onData=function(t){n.prototype.onData.call(this,t),this._symbolIntervalChanged=!1},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){n.call(this,t,e,i)}var n=i(105).LineStudyMtp;inherit(o,n),o.prototype._mtpStudyId=function(){return"mtp_riskreward"},o.prototype.pointsCount=function(){return 3},o.getTooltipText=function(t){return t&&0!==t._points.length?1===t._points.length?"Select Stop Bar":2===t._points.length?"Select Target Point":null:"Select Entry Setup Bar"},o.prototype._studyInputs=function(){var t,e,i,o,n,r,s=this.points();return s.length<this.pointsCount()?null:(t=s[0].index,e=s[1].index,i=s[2].index,o=this._model.mainSeries().bars().valueAt(t),n=this._model.mainSeries().bars().valueAt(e),r=this._model.mainSeries().bars().valueAt(i),
null===o||null===n||null===r?null:[1e3*o[TradingView.TIME_PLOT],1e3*n[TradingView.TIME_PLOT],1e3*r[TradingView.TIME_PLOT],s[2].price,this.properties().inputs.account_size.value(),this.properties().inputs.percent_risk.value(),this.properties().inputs.tickEntryOffset.value(),this.properties().inputs.tickStopOffset.value()])},t.exports=o},function(t,e,i){"use strict";(function(e){function o(t,i){var o=this;f.call(this),this._properties=i,this._model=t,this._dataWindowView=new h(this,t),this._priceAxisView=new c(this),this._startMeasurePriceAxisView=new c(this),this._endMeasurePriceAxisView=new c(this),this._timeAxisView=new u(this,t),this._startMeasureTimeAxisView=new u(this,t,"measureStartX"),this._endMeasureTimeAxisView=new u(this,t,"measureEndX"),this.visible=!0,t.readOnly()?this.areLinesVisible=!0:m.cursorTool.subscribe(function(t){o.areLinesVisible="arrow"!==t},{callWithLast:!0}),this._movedDelegate=new e,this._subscribed=!1,this._model.readOnly()&&(this.visibleTrap=!0),this._selectBarMode=new L(!1),this._barSelectedDelegate=new e,this._mouseClickBoundedHandler=this._mouseClickHandler.bind(this),this._isOnHoveredChartWidget=!1}function n(t,e){this._source=t,this._pane=e,this._pipFormatter=null,this._lastSymbolInfo=null,this._horzTrenRenderer=new d,this._vertTrenRenderer=new d,this._bgRenderer=new _,this._labelRenderer=new p({})}function r(t,e,i,o){this.source=t,this.pane=e,this._horzVisible=i,this._mouseClickHandler=o}function s(t,e,i){this.source=t,this.pane=e,this._axis=i||"x"}var a=i(8).Point,l=i(1).LineDataSource,c=i(902).CrossHairPriceAxisView,h=i(903),u=i(904),d=i(110).TrendLineRenderer,p=i(166).TextRenderer,_=i(373).RectangleRenderer,f=i(46).DataSource,m=i(26),g=i(905).PaneRendererCrossHair,v=i(906).PaneRendererCrossHairLock,y=i(53).CompositeRenderer,b=i(22),S=i(167).PercentageFormatter,w=i(379).TimeSpanFormatter,T=i(377).PipFormatter,C=i(30),x=i(74).LineEnd,P=i(240),L=i(17);inherit(o,f),o.prototype.index=0,o.prototype.price=NaN,o.prototype.pane=null,o.prototype.color="white",o.prototype.style="",o.prototype.customization={disableSelection:!0},o.prototype.properties=function(){return this._properties},o.prototype.moved=function(){return this._movedDelegate},o.prototype.saveOriginCoord=function(t,e){this._originX=t,this._originY=e},o.prototype.clearOriginCoord=function(){this._originX=NaN,this._originY=NaN},o.prototype.setPosition=function(t,e,i){this._subscribed||(this._model.mainSeries().onRestarted().subscribe(this,o.prototype.clearMeasure),this._subscribed=!0),this.setLockedPosition(i),this.visible=!0,this._tryToUpdateViews(t,e,i)},o.prototype.update=function(){var t,e,i,o,n;this.visible&&(t=this._priceScaleByPane(this.pane),e=this._originX||this.x,i=this._originY||this.y,o=this._model.timeScale().coordinateToIndex(e),n=NaN,null!==t&&(n=t.coordinateToPrice(i)),this._tryToUpdateViews(o,n,this.pane))},o.prototype._priceScaleByPane=function(t){return t&&!t.defaultPriceScale().isEmpty()?t.defaultPriceScale():null},o.prototype._tryToUpdateViews=function(t,e,i){
this._tryToUpdateData(t,e,i)&&(this.updateAllViews(),this._movedDelegate.fire({time:this._model.timeScale().points().roughTime(this.index),price:this.price}))},o.prototype._tryToUpdateData=function(t,e,i){var o=this.x,n=this.y,r=this.price,s=this.index,a=this.pane,l=this._priceScaleByPane(i);return this.index=t,this.x=this._model.timeScale().indexToCoordinate(t),null!==l?(this.pane=i,this.price=e,this.y=l.priceToCoordinate(e)):(this.pane=null,this.price=NaN,this.y=NaN),o!==this.x||n!==this.y||s!==this.index||r!==this.price||a!==this.pane},o.prototype.setLockedPosition=function(t){delete this.lockedIndex,delete this.lockedX,t!==this._measurePane&&m.lockTimeAxis().value()&&(this.lockedIndex=this._model.timeScale().points().roughIndex(m.lockTimeAxisTime.value()),this.lockedX=this._model.timeScale().indexToCoordinate(this.lockedIndex))},o.prototype.clearPosition=function(){this.visible=!1;var t=this._model.mainSeries().bars().lastIndex();this.index=null!==t?t:NaN,this.price=NaN,this.x=NaN,this.y=NaN,this.clearOriginCoord()},o.prototype.measureStartY=function(){var t,e=this._startMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureStartX=function(){return this._model.timeScale().indexToCoordinate(this._startMeasurePoint.index)},o.prototype.measureEndY=function(){var t,e=this._endMeasurePoint.price,i=this._measurePane;return i.defaultPriceScale().isPercent()&&(t=i.mainDataSource().firstValue(),e=i.defaultPriceScale().priceRange().convertToPercent(e,t)),i.defaultPriceScale().priceToCoordinate(e)},o.prototype.measureEndX=function(){return this._model.timeScale().indexToCoordinate(this._endMeasurePoint.index)},o.prototype.paneViews=function(t){var e=this._selectBarMode.value()&&this._isOnHoveredChartWidget,i=t===this.pane&&!e,o=[new r(this,t,i,this._mouseClickBoundedHandler)];return t===this._measurePane&&(this._measurePaneView||(this._measurePaneView=new n(this,t)),this._measurePaneView.update(),o.push(this._measurePaneView)),m.lockTimeAxis().value()&&o.push(this._timeLockPaneView=this._timeLockPaneView||new s(this,t)),o},o.prototype.dataWindowView=function(){return this._dataWindowView},o.prototype.priceAxisViews=function(t,e){var i,o;return this.visibleTrap&&this.visible&&this.pane===t&&e===t.defaultPriceScale()?(i=[],o=this._selectBarMode.value()&&this._isOnHoveredChartWidget,o||i.push(this._priceAxisView),this._startMeasurePoint&&i.push(this._startMeasurePriceAxisView),this._endMeasurePoint&&i.push(this._endMeasurePriceAxisView),i):null},o.prototype.timeAxisView=function(){if(!this.visibleTrap||!this.visible&&!m.lockTimeAxis().value())return null;var t=[this._timeAxisView];return this._startMeasurePoint&&t.push(this._startMeasureTimeAxisView),this._endMeasurePoint&&t.push(this._endMeasureTimeAxisView),t},o.prototype.updateAllViews=function(){this._priceAxisView.update(),this._startMeasurePoint&&(this._startMeasurePriceAxisView.update(),
this._startMeasureTimeAxisView.update()),this._endMeasurePoint&&(this._endMeasurePriceAxisView.update(),this._endMeasureTimeAxisView.update()),this._timeAxisView.update()},o.prototype.startMeasurePoint=function(){return this._startMeasurePoint},o.prototype.startMeasuring=function(t,e){if(e.defaultPriceScale().isPercent()){var i=e.mainDataSource().firstValue();t.price=e.defaultPriceScale().priceRange().convertFromPercent(t.price,i)}this._startMeasurePoint=t,this._measurePane=e},o.prototype.finishMeasure=function(t){var e,i=this._measurePane;i.defaultPriceScale().isPercent()&&(e=i.mainDataSource().firstValue(),t.price=i.defaultPriceScale().priceRange().convertFromPercent(t.price,e)),this._endMeasurePoint=t},o.prototype.endMeasurePoint=function(){return this._endMeasurePoint},o.prototype.clearMeasure=function(t){delete this._measurePane,delete this._startMeasurePoint,delete this._endMeasurePoint,delete this._lastValidMeasurePoint,this._model.invalidate(new b(b.LIGHT_UPDATE))},o.prototype.measurePoints=function(){var t,e,i,o,n;return this.updateAllViews(),t=[this._startMeasurePoint],this._endMeasurePoint?t.push(this._endMeasurePoint):(this._measurePane===this.pane&&(this._lastValidMeasurePoint={x:this.x,y:this.y,rawPrice:this.price,price:this.price,index:this.index}),e=this._lastValidMeasurePoint.rawPrice,i=this._measurePane,o=i.defaultPriceScale(),o.isPercent()&&!o.isEmpty()&&(n=i.mainDataSource().firstValue(),this._lastValidMeasurePoint.price=o.priceRange().convertFromPercent(e,n)),t.push(this._lastValidMeasurePoint)),t},o.prototype.currentPoint=function(){return new a(this.x,this.y)},o.prototype.appliedIndex=function(){return isFinite(this.lockedIndex)&&this.lockedIndex||this.index},o.prototype.appliedX=function(){return isFinite(this.lockedX)&&this.lockedX||this.x},o.prototype.selectBarMode=function(){return this._selectBarMode},o.prototype.toggleSelectBarMode=function(){this._setSelectBarModeState(!this._selectBarMode.value())},o.prototype.onBarSelected=function(){return this._barSelectedDelegate},o.prototype._setSelectBarModeState=function(t){this._selectBarMode.setValue(t),this._model.invalidate(new b(b.LIGHT_UPDATE))},o.prototype._mouseClickHandler=function(){var t;this._model.mainSeries().bars().contains(this.index)&&null!==(t=this._model.timeScale().indexToTimePoint(this.index))&&(this._setSelectBarModeState(!1),this._barSelectedDelegate.fire(t))},o.prototype.handleContextMenuEvent=function(){this._selectBarMode.value()&&this._setSelectBarModeState(!1)},o.prototype.setOnHoveredChartWidget=function(t){this._isOnHoveredChartWidget=t},o.prototype.isOnHoveredChartWidget=function(){return this._isOnHoveredChartWidget},n.prototype.update=function(){var t,e,i,o,n,r,s,l,c,h,u,d,p,_,f,m,g,v;if(this._source._endMeasurePoint)t=this._source._endMeasurePoint.price,e=this._source._endMeasurePoint.index;else if(this._source._measurePane===this._source.pane)t=this._source.price,e=this._source.index;else{if(!this._source._lastValidMeasurePoint)return;t=this._source._lastValidMeasurePoint.rawPrice,
e=this._source._lastValidMeasurePoint.index}i=t-this._source._startMeasurePoint.price,o=e-this._source._startMeasurePoint.index,n=this._source._startMeasurePoint.price,r=this._source._measurePane,r.defaultPriceScale().isPercent()&&(s=r.mainDataSource().firstValue(),this._source._endMeasurePoint&&(t=r.defaultPriceScale().priceRange().convertToPercent(t,s)),n=r.defaultPriceScale().priceRange().convertToPercent(n,s)),l=this._source._measurePane.defaultPriceScale().formatter().format(i),this._source._startMeasurePoint.price&&(c=i/this._source._startMeasurePoint.price,l+=" ("+(new S).format(100*c)+")"),this._label=l+"\n"+$.t("{0} bars").format(o),n=this._source._model._magnet.align(n,this._source._startMeasurePoint.index,this._source._measurePane),t=this._source._model._magnet.align(t,e,this._source._measurePane),h=this._source._model.timeScale().indexToCoordinate(this._source._startMeasurePoint.index),u=this._source._model.timeScale().indexToCoordinate(e),d=this._source._measurePane.defaultPriceScale().priceToCoordinate(n),p=this._source._measurePane.defaultPriceScale().priceToCoordinate(t),this._p1=new a(h,d),this._p2=new a(u,p),_=this._source._model.timeScale().indexToUserTime(this._source._startMeasurePoint.index),f=this._source._model.timeScale().indexToUserTime(e),m=this._pane.model().mainSeries().symbolInfo(),m&&m!==this._lastSymbolInfo&&(this._pipFormatter=new T(m.pricescale,m.minmov,m.type,m.minmove2),this._lastSymbolInfo=m),_&&f&&(g=(f.valueOf()-_.valueOf())/1e3,v=this._pipFormatter?" , "+this._pipFormatter.format(i):"",this._label=""+l+v+"\n"+$.t("{0} bars").format(o)+", "+(new w).format(g))},n.prototype.renderer=function(){var t,e,i,o,n,r,s,l,c,h,u,d,p=new y,_={};return _.points=[this._p1,this._p2],_.width=this._source._model.timeScale().width(),_.height=this._source._measurePane.defaultPriceScale().height(),_.color="#D3E7FF",_.linewidth=0,_.fillBackground=!0,_.transparency=60,_.backcolor="#BADAFF",this._bgRenderer.setData(_),p.append(this._bgRenderer),t=this._p1.add(this._p2).scaled(.5),e=new a(this._p1.x,t.y),i=new a(this._p2.x,t.y),o={points:[e,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._horzTrenRenderer.setData(o),p.append(this._horzTrenRenderer),e=new a(t.x,this._p1.y),i=new a(t.x,this._p2.y),o={points:[e,i],width:_.width,height:_.height,color:"#363c4e",linewidth:1,linestyle:CanvasEx.LINESTYLE_DASHED,extendleft:!1,extendright:!1,leftend:x.Normal,rightend:x.Arrow},this._vertTrenRenderer.setData(o),p.append(this._vertTrenRenderer),n={x:0,y:10},r=function(t,e){return{points:[e],text:t,color:"#FFFFFF",horzAlign:"left",vertAlign:"middle",font:"Arial",offsetX:n.x,offsetY:n.y,bold:!1,italic:!1,fontsize:12,padding:5,highlightBorder:!1,backgroundColor:C.generateColor("#5b85bf",10),backgroundTransparency:10,backgroundVertInflate:5,backgroundHorzInflate:5,backgroundRoundRect:4}},s=.5*(this._p1.x+this._p2.x),l=this._p2.y,c=new a(s,l),h=r(this._label,c),this._labelRenderer.setData(h),
u=this._labelRenderer.measure(),d={x:s+h.backgroundHorzInflate+u.textBgPadding-u.width/u.textBgPadding,y:this._p1.y>this._p2.y?c.y-u.height-2*u.textBgPadding-n.y>0?l-u.height-n.y+u.textBgPadding:n.y-2*u.textBgPadding:c.y+u.height+u.textBgPadding+n.y>_.height?_.height-u.height-n.y:l+u.textBgPadding},this._labelRenderer.setPoints([new a(d.x,d.y)]),p.append(this._labelRenderer),p},r.prototype.update=function(){},r.prototype.renderer=function(){var t,e,i,o,n,r,s={},a=this.source.visible&&this.source.areLinesVisible,c=m.lockTimeAxis().value();return s.horzLinesVisible=a&&this._horzVisible,s.vertLinesVisible=a||c,t=this.pane._model.readOnly(),e=t?defaults("chartproperties.paneProperties.crossHairProperties"):null,i=this.source.selectBarMode().value()&&this.source.isOnHoveredChartWidget(),o=TradingView.isMobile.any()&&l.isLineTool(this.source._model.currentTool())&&!i,n=o?"#a000a0":t?e.color:this.pane._model.properties().paneProperties.crossHairProperties.color.value(),r=t?e.transparency:this.pane._model.properties().paneProperties.crossHairProperties.transparency.value(),!o&&r>0&&(n=C.generateColor(n,r)),s.color=n,s.lineWidth=t?e.width:this.pane._model.properties().paneProperties.crossHairProperties.width.value(),s.lineStyle=t?e.style:this.pane._model.properties().paneProperties.crossHairProperties.style.value(),s.drawCenter=o&&this.pane===this.source.pane,s.w=this.pane.width(),s.h=this.pane.height(),s.x=isFinite(this.source.lockedX)&&this.source.lockedX||this.source.x,s.y=this.source.y,i&&(s.x=Math.max(0,this.source.x-1),s.vertLinesVisible=!0,s.lineStyle=P.LINESTYLE_SOLID,s.mouseClickHandler=this._mouseClickHandler,s.lineWidth=2,s.color="#ff0000"),new g(s)},s.prototype.update=function(){},s.prototype.renderer=function(){var t,e,i,o,n=this.source.visible&&this.source.areLinesVisible,r=m.lockTimeAxis().value(),s=n&&this._horzVisible,a=n||r;if(("y"!==this._axis||s)&&a)return t=9,e=11,i="y"===this._axis?this.pane.width()-t/2:this.source.lockedX+1,o="y"===this._axis?this.source.y:this.pane.height()-e/2-1,new v({x:i,y:o,width:t,height:e,bodyHeight:7})},t.exports=o}).call(e,i(10))},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(67),r=i(28),s=function(t){function e(e){var i=t.call(this)||this;return i._defaultFormatter=new r.PriceFormatter(100),i._background="#585858",i._source=e,i}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,n;t.visible=!1,null!==(e=this._source.pane)&&(i=e.defaultPriceScale(),this._source.visible&&!i.isEmpty()&&(n=i.mainSource(),o=n?n.formatter():this._defaultFormatter,t.background=this._background,t.color=this.generateTextColor(this._background),t.coordinate=this._source.y,t.text=o.format(this._source.price),t.visible=!0))},e}(n.PriceAxisView),e.CrossHairPriceAxisView=s},function(t,e,i){"use strict";function o(t,e){r.call(this),this._header=null,this._crossHair=t,this._model=e,this._items.push(new s("Date","")),this._items.push(new s("Time","")),this._items.push(new s("Price","")),this._defaultFormatter=new a(100)}
var n=i(157),r=n.DataWindowView,s=n.DataWindowItem,a=i(28).PriceFormatter,l=i(177).DateFormatter,c=i(135).TimeFormatter;inherit(o,r),o.prototype.update=function(){var t,e,i,o,n,r,s=this._model.mainSeries().isDWM();this._items[1].setVisible(!s),this._items[0].setValue("n/a"),this._items[1].setValue("n/a"),this._items[2].setValue("n/a"),this._model.timeScale().isEmpty()||(t=this._crossHair.appliedIndex(),e=this._model.timeScale().indexToUserTime(t),null===e?(this._items[0].setValue("n/a"),s||this._items[1].setValue("n/a")):(this._items[0].setValue((new l).format(e)),s||this._items[1].setValue((new c).format(e))),(i=this._crossHair.pane)&&(o=i.defaultPriceScale(),o.isEmpty()||(n=o.mainSource(),r=n?n.formatter():this._defaultFormatter,this._items[2].setValue(r.format(this._crossHair.price)))))},t.exports=o},function(t,e,i){"use strict";function o(t,e){n.call(this),this._invalidated=!0,this._crosshair=t,this._model=e,this._renderer=new r,this._rendererData={visible:!1,background:"#585858",color:"white",text:"",width:0}}var n=i(222).TimeAxisView,r=i(223),s=i(127).DateTimeFormatter;inherit(o,n),o.prototype.update=function(){this._invalidated=!0},o.prototype._updateImpl=function(){var t,e,i=this._rendererData;i.visible=!1,t=this._model.timeScale(),t.isEmpty()||(i.width=t.width(),i.coordinate=this._crosshair.appliedX(),(e=t.indexToUserTime(this._crosshair.appliedIndex()))&&(i.text=new s(this._model.mainSeries().isDWM()).format(e),i.visible=!0))},o.prototype.renderer=function(){return this._invalidated&&(this._updateImpl(),this._invalidated=!1),this._renderer.setData(this._rendererData),this._renderer},t.exports=o},function(t,e,i){"use strict";function o(t){this.data=t}var n=i(11);o.prototype.draw=function(t){var e,i,o,n,r,s=this.data.vertLinesVisible,a=this.data.horzLinesVisible;(s||a)&&this.data&&(t.lineStyle=this.data.lineStyle,t.lineWidth=this.data.lineWidth,t.strokeStyle=this.data.color,e=this.data.lineWidth%2==0?.5:0,i=this.data.x+1+e,o=this.data.y+e,n=this.data.w,r=this.data.h,s&&i>=0&&CanvasEx.drawLine(t,i,0,i,r),a&&o>=0&&CanvasEx.drawLine(t,0,o,n,o),this.data.drawCenter&&(t.beginPath(),t.arc(i,o,3,0,2*Math.PI,!0),t.fillStyle=this.data.color,t.fill()))},o.prototype.hitTest=function(t){return this.data.mouseClickHandler?new n(n.CUSTOM,{mouseClickHandler:this.data.mouseClickHandler}):null},e.PaneRendererCrossHair=TradingView.PaneRendererCrossHair=o},function(t,e,i){"use strict";function o(t){this._data=t}o.prototype._drawShackle=function(t){var e=this._data.width-3,i=e/2,o=this._data.height-this._data.bodyHeight;t.moveTo(1.5,i),t.arc(this._data.width/2,i,i,Math.PI,2*Math.PI),o>i&&(t.moveTo(1.5,i),t.lineTo(1.5,o),t.moveTo(this._data.width-1.5,i),t.lineTo(this._data.width-1.5,o))},o.prototype.draw=function(t){var e,i,o,n;t.translate(this._data.x-this._data.width/2,this._data.y-this._data.height/2),e="rgba(153,153,153,.3)",i="rgba(153,153,153,.7)",o="#777",n="rgba(255,255,255,.7)",t.strokeStyle=e,t.lineWidth=2,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.strokeStyle=i,t.lineWidth=1,t.beginPath(),
t.rect(0,this._data.height-this._data.bodyHeight+.5,this._data.width,this._data.bodyHeight),t.closePath(),t.stroke(),t.translate(0,-1),t.strokeStyle=o,t.beginPath(),this._drawShackle(t),t.stroke(),t.closePath(),t.fillStyle=n,t.beginPath(),t.rect(1,this._data.height-this._data.bodyHeight+1.5,this._data.width-2,this._data.bodyHeight-2),t.fill(),t.beginPath(),t.rect(.5,this._data.height-this._data.bodyHeight+1,this._data.width-1,this._data.bodyHeight-1),t.stroke(),t.closePath(),t.fillStyle=o,t.fillRect(this._data.width/2-.5,this._data.height-this._data.bodyHeight/2,1,2)},e.PaneRendererCrossHairLock=TradingView.PaneRendererCrossHairLock=o},function(t,e,i){"use strict";(function(e){function o(t){function i(t,e){var i=t.font;return a.hasOwnProperty(i)||(a[i]={}),a[i].hasOwnProperty(e)||(a[i][e]=t.measureText(e).width),a[i][e]}function o(){var o=s.width(),a=s.height();return{draw:function(s){var c,h,u,d,p,_,f,m=t.symbolInfo();if(m&&!e.enabled("fundamental_widget")){for(s.fillStyle=n.generateColor(l.color.value(),l.transparency.value()),c=m.name,/QUANDL/.test(m.exchange)&&(h=c.split(/\//),h.length&&(c=h[h.length-1])),u=[{text:c?c+", "+r(t.interval()):"",font:"96px Verdana, Arial, sans-serif",lineHeight:114,baselineOffset:87},{text:m.description||"",font:"48px Verdana, Arial, sans-serif",lineHeight:57,baselineOffset:43.5}],d=0,p=0;p<u.length;p++)_=u[p],_.text&&(s.font=_.font,f=i(s,_.text),f>o?(_.zoom=o/f,f=o):_.zoom=1,_.offsetLeft=(o-f)/2,d+=_.lineHeight*_.zoom);for(d=Math.max((a-d)/2,0),p=0;p<u.length;p++)_=u[p],_.text&&(s.save(),s.font=_.font,s.translate(_.offsetLeft,d),s.scale(_.zoom,_.zoom),s.fillText(_.text,0,_.baselineOffset),s.restore(),d+=_.lineHeight*_.zoom)}}}}var s=null,a={},l=t.model().properties().symbolWatermarkProperties,c={renderer:o,update:function(){}};this.paneViews=function(t){return t.containsMainSeries()?(s=t,[c]):[]}}var n=i(30),r=i(162).translatedIntervalString;t.exports=o}).call(e,i(5))},function(t,e,i){"use strict";function o(){this.visible=!0,this.horzLinesVisible=!0,this.horzLinesColor="white",this.horzLinesStyle="",this.vertLinesVisible=!0,this.vertLinesColor="white",this.vertLinesStyle=""}function n(t,e){this.source=t,this.pane=e,this._renderer=new r}function r(){this.data=null}o.prototype.paneViews=function(t){return[new n(this,t)]},n.prototype.update=function(){},n.prototype.renderer=function(){var t={};return this.pane.defaultPriceScale().isEmpty()||this.pane.timeScale().isEmpty()?null:(t.horzLinesVisible=!0,t.vertLinesVisible=!0,t.horzLinesColor=this.pane._model.properties().paneProperties.horzGridProperties.color.value(),t.vertLinesColor=this.pane._model.properties().paneProperties.vertGridProperties.color.value(),t.horzLineStyle=this.pane._model.properties().paneProperties.horzGridProperties.style.value(),t.vertLineStyle=this.pane._model.properties().paneProperties.vertGridProperties.style.value(),t.priceMarks=this.pane.defaultPriceScale().marks(),t.timeMarks=this.pane.timeScale().marks(),t.w=this.pane.width(),t.h=this.pane.height(),this._renderer.setData(t),this._renderer)},
r.prototype.setData=function(t){this.data=t},r.prototype.draw=function(t){var e;if(null!==this.data){if(t.lineWidth=1,this.data.vertLinesVisible){for(t.strokeStyle=this.data.vertLinesColor,CanvasEx.setLineStyle(t,this.data.vertLineStyle),t.beginPath(),e=0;e<this.data.timeMarks.length;e++)t.moveTo(this.data.timeMarks[e].coord+1,0),t.lineTo(this.data.timeMarks[e].coord+1,this.data.h);t.stroke()}if(this.data.horzLinesVisible){for(t.strokeStyle=this.data.horzLinesColor,CanvasEx.setLineStyle(t,this.data.horzLineStyle),t.beginPath(),e=0;e<this.data.priceMarks.length;e++)t.moveTo(0,this.data.priceMarks[e].coord),t.lineTo(this.data.w,this.data.priceMarks[e].coord);t.stroke()}}},t.exports=o},function(t,e,i){"use strict";function o(t,e,i){this._magnetProperty=t,this._timeScale=e}var n=i(77);o.prototype.align=function(t,e,i){var o,r,s,a,l,c,h,u,d,p=50,_=i.defaultPriceScale(),f=_.priceToCoordinate(t),m=t;if(!this._magnetProperty.value())return m;for(o=_.dataSources(),r=null,s=0;s<o.length;s++)if(o[s]instanceof n){r=o[s];break}if(r&&(a=r.bars(),a.contains(e)&&(l=a.valueAt(e),c=[l[TradingView.OPEN_PLOT],l[TradingView.HIGH_PLOT],l[TradingView.LOW_PLOT],l[TradingView.CLOSE_PLOT]],_=r.priceScale(),!_.isEmpty()))){if(h=[],_.isPercent())for(u=r.firstValue(),s=0;s<c.length;s++)c[s]=_.priceRange().convertToPercent(c[s],u);for(s=0;s<c.length;s++)h.push({y:_.priceToCoordinate(c[s]),price:c[s]});h.sort(function(t,e){return Math.abs(t.y-f)-Math.abs(e.y-f)}),d=h[0],Math.abs(d.y-f)<p&&(m=d.price)}return m},t.exports=o},function(t,e,i){"use strict";(function(e){function o(){return[$.t("Jan"),$.t("Feb"),$.t("Mar"),$.t("Apr"),$.t("May"),$.t("Jun"),$.t("Jul"),$.t("Aug"),$.t("Sep"),$.t("Oct"),$.t("Nov"),$.t("Dec")]}function n(t){this._model=t,this._scalesProperties=t.properties().scalesProperties,this.m_width=0,this._baseIndex=null,this._defaultRightOffsetProperty=new f(S),this.m_rightOffset=S,this._defaultRightOffsetProperty.listeners().subscribe(this,function(t){this.setRightOffset(t.value())}),this.m_points=new u,this._barSpacingChanged=new e,this.m_barSpacing=b,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._commonTransitionStartState=null,this.m_tickmarks=new l,this._locked=!1,this._formattedBySpan={},this._onScroll=new e,this._visibleBars=null,this._visibleBarsInvalidated=!0,this._visibleBarsChanged=new e}var r=i(54).clamp,s=i(344).BarsRange,a=i(226),l=i(911),c=i(22),h=i(28).numberToStringWithLeadingZero,u=i(912).TimePoints,d=i(350),p=i(7).getLogger("Chart.TimeScale"),_=i(5),f=i(25),m=null,g=50,v=_.enabled("high_density_bars")?.025:.5,y=5,b=6,S=5;n.prototype.tickMarks=function(){return this.m_tickmarks},n.prototype.reset=function(){this._visibleBarsInvalidated=!0,this.m_points=new u,this.m_scrollStartPoint=null,this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState(),this.m_tickmarks.reset()},n.prototype.restoreDefault=function(){this._visibleBarsInvalidated=!0,this.setBarSpacing(b),this.resetRightOffset()},n.prototype.restoreRightOffsetPropertyToDefault=function(){this._defaultRightOffsetProperty.setValue(S)},
n.prototype.baseIndex=function(){return this._baseIndex||0},n.prototype.rightOffset=function(){return this.m_rightOffset},n.prototype.defaultRightOffsetProperty=function(){return this._defaultRightOffsetProperty},n.prototype.rightOffsetForTimePoint=function(t){var e=this.timeToCoordinate(t);return null===e?null:this._rightOffsetForCoordinate(e)},n.prototype._rightOffsetForCoordinate=function(t){return(this.m_width+1-t)/this.m_barSpacing},n.prototype.scrollToRealtime=function(t,e){var i,o,n,r,s=this._defaultRightOffsetProperty.value();if(s<0&&(s=S),t)return i=this,o=this.m_rightOffset,n=this.maxRightOffset(),n>0&&s>n&&(s=n),r=this._model,void $({offset:o}).animate({offset:s},{duration:1e3,easing:"easeInOutQuint",complete:e,step:function(t){i._visibleBarsInvalidated=!0,i.m_rightOffset=t,r.recalculateAllPanes(),r.invalidate(new c(c.LIGHT_UPDATE)),r.recalcVisibleRangeStudy(r.dataSources())}});this._visibleBarsInvalidated=!0,this.m_rightOffset=s,this._correctOffset(),void 0!==e&&e()},n.prototype.points=function(){return this.m_points},n.prototype.width=function(){return this.m_width},n.prototype.setWidth=function(t){if(isFinite(t)&&!(t<=0)&&this.m_width!==t){if(this._visibleBarsInvalidated=!0,this._locked&&this.m_width){var e=this.m_barSpacing*t/this.m_width;this._tryToUpdateBarSpacing(this.m_barSpacing,e)}this.m_width=t,this._correctOffset()}},n.prototype.barSpacing=function(){return this.m_barSpacing},n.prototype.setBarSpacing=function(t){if(void 0===t)return void p.logDebug("setBarSpacing: invalid argument");this._tryToUpdateBarSpacing(this.m_barSpacing,t)&&this._correctOffset()},n.prototype._tryToUpdateBarSpacing=function(t,e){return t!==e&&(this._visibleBarsInvalidated=!0,this.m_barSpacing=e,this._barSpacingChanged.fire(t,e),!0)},n.prototype.barSpacingChanged=function(){return this._barSpacingChanged},n.prototype.correctBarSpacing=function(){this.isEmpty()||this.points().size()<this.width()/this.barSpacing()&&(this.setRightOffset(S),this.setBarSpacing(Math.min(this.width()/(this.points().size()+this.rightOffset()),g)))},n.prototype.visibleBars=function(){return this._visibleBarsInvalidated&&(this._visibleBarsInvalidated=!1,this._updateVisibleBars()),this._visibleBars},n.prototype._updateVisibleBars=function(){var t,e,i,o,n;if(this.isEmpty())return void(null!==this._visibleBars&&(this._visibleBars=null,this._visibleBarsChanged.fire()));t=this.baseIndex(),e=Math.ceil(this.m_width/this.m_barSpacing)-1,i=Math.round(this.m_rightOffset+t),o=i-e,n=this._visibleBars,this._visibleBars=new s(o,i),null!==n&&this._visibleBars.equals(n)||this._visibleBarsChanged.fire()},n.prototype.isEmpty=function(){return 0===this.m_width||0===this.m_points.size()},n.prototype.indexToCoordinate=function(t,e){var i,o,n;return this.isEmpty()?0:TradingView.isInteger(t)?(i=this.baseIndex(),o=i+this.m_rightOffset-t,n=this.m_width-(o+.5)*this.m_barSpacing,e?n:Math.round(n)):0},n.prototype.barIndexesToCoordinates=function(t){var e,i,o,n,r=this.baseIndex();for(e=0;e<t.length;e++)i=t[e].time,o=r+this.m_rightOffset-i,
n=this.m_width-(o+.5)*this.m_barSpacing,t[e].time=Math.round(n),t[e].exactTime=n},n.prototype.indexesToCoordinates=function(t){var e,i,o,n=this.baseIndex(),r=n+this.m_rightOffset,s=this.m_width-r*this.m_barSpacing-.5*this.m_barSpacing;for(e=0;e<t.length;e++)i=t[e].x,o=s+i*this.m_barSpacing,t[e].x=Math.round(o)},n.prototype.coordinateToIndex=function(t){var e=this._rightOffsetForCoordinate(t),i=this.baseIndex(),o=i+this.m_rightOffset-e,n=Math.round(1e6*o)/1e6;return Math.ceil(n)},n.prototype.timeToCoordinate=function(t){function e(t){return t<=0||t>=l.m_width}var i,o,n,r=this.m_points.closestIndexLeft(t),s=this.m_points.valueAt(r),a=this.indexToCoordinate(r,!0),l=this;return e(a)?null:(i=this.barSpacing(),o=function(){var t=this.baseIndex();return this.m_points.valueAt(t)-this.m_points.valueAt(t-1)}.bind(this)(),n=Math.round(a+(t-s)/o*i)+1,e(n)?null:n)},n.prototype.alignCoordinate=function(t){if(this.isEmpty())return t;var e=this.coordinateToIndex(t);return this.indexToCoordinate(e)},n.prototype.timePointToIndex=function(t){return this.m_points.indexOf(t,!0)},n.prototype.indexToTimePoint=function(t){return this.m_points.valueAt(t)},n.prototype.indexToUserTime=function(t){return this.m_tickmarks.indexToTime(t)},n.prototype.marks=function(){var t,e,i,o,n,r,s,a,l,c,h,u;if(this.isEmpty())return null;for(t=this.m_barSpacing,e=this._scalesProperties.fontSize.value()||0,i=5*(e+4),o=Math.round(i/t),n=this.visibleBars(),r=Math.max(n.firstBar(),n.firstBar()-o),s=Math.max(n.lastBar(),n.lastBar()-o),a=this.m_tickmarks.build(t,i),l=[],c=0;c<a.length;++c)h=a[c],r<=h.index&&h.index<=s&&null!==(u=this.m_tickmarks.indexToTime(h.index))&&l.push({coord:this.indexToCoordinate(h.index),label:this.formatLabel(u,h.span),span:h.span,major:h.label>=d.DAY_SPAN?1:0});return l},n.prototype.state=function(t){var e={};return e.m_barSpacing=this.barSpacing(),e.m_rightOffset=t?this.m_rightOffset:this._defaultRightOffsetProperty.value(),t&&(e.points=this.m_points.state(),e.tickmarks=this.m_tickmarks.state(),e.width=this.m_width),e},n.prototype.restoreState=function(t,e){var i,o,n;return void 0===t.m_barSpacing?void p.logDebug("restoreState: invalid state"):void 0===t.m_rightOffset?void p.logDebug("restoreState: invalid state"):(i=t.m_barSpacing,o=t.m_rightOffset<0&&!e?S:t.m_rightOffset,n=o<0?S:Math.round(o),this._defaultRightOffsetProperty.setValue(n),this.m_rightOffset=o,e&&(this.m_points.restoreState(t.points),this.m_tickmarks.restoreState(t.tickmarks),t.width&&(this._locked=!0,this.m_width>0&&(i*=this.m_width/t.width))),this._tryToUpdateBarSpacing(this.m_barSpacing,i),void this._correctOffset())},n.prototype.setBaseIndex=function(t){if("number"!=typeof t)return void p.logDebug("setBaseIndex: invalid argument");this._visibleBarsInvalidated=!0,this._baseIndex=t,this._correctOffset()},n.prototype.setRightOffset=function(t){if(void 0===t)return void p.logDebug("setRightOffset: invalid argument");this._visibleBarsInvalidated=!0,this.m_rightOffset=t,this._correctOffset()},n.prototype.resetRightOffset=function(){
this.setRightOffset(this._defaultRightOffsetProperty.value())},n.prototype._correctOffset=function(){var t,e=this.maxRightOffset();this.m_rightOffset>e&&(this.m_rightOffset=e,this._visibleBarsInvalidated=!0),null!==(t=this.minRightOffset())&&this.m_rightOffset<t&&(this.m_rightOffset=t,this._visibleBarsInvalidated=!0)},n.prototype.minRightOffset=function(){var t=this.m_points.firstIndex(),e=this._baseIndex;return null===t||null===e?null:t-e-1+y},n.prototype.maxRightOffset=function(){return this.m_width/this.m_barSpacing-y},n.prototype.startScale=function(t){this.m_scrollStartPoint&&this.endScroll(),null===this.m_scaleStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scaleStartPoint=t,this._saveCommonTransitionsStartState()))},n.prototype._saveCommonTransitionsStartState=function(){this._commonTransitionStartState={barSpacing:this.barSpacing(),rightOffset:this.rightOffset()}},n.prototype._clearCommonTransitionsStartState=function(){this._commonTransitionStartState=null},n.prototype.scaleTo=function(t){var e,i;null!==this._commonTransitionStartState&&(e=r(this.m_width-t,0,this.m_width),i=r(this.m_width-this.m_scaleStartPoint,0,this.m_width),0!==e&&0!==i&&this.setBarSpacing(this.getValidBarSpacing(this._commonTransitionStartState.barSpacing*e/i)))},n.prototype.getValidBarSpacing=function(t){return void 0===t&&(t=this.barSpacing()),t<v?v:t>g?g:t},n.prototype.isValidBarSpacing=function(t){return t>=v&&t<=g},n.prototype.endScale=function(){null!==this.m_scaleStartPoint&&(this.m_scaleStartPoint=null,this._clearCommonTransitionsStartState())},n.prototype.startScroll=function(t){null===this.m_scrollStartPoint&&null===this._commonTransitionStartState&&(this.isEmpty()||(this.m_scrollStartPoint=t,this._saveCommonTransitionsStartState()))},n.prototype.scrollTo=function(t){if(this._visibleBarsInvalidated=!0,null!==this.m_scrollStartPoint){var e=(this.m_scrollStartPoint-t)/this.barSpacing();this.m_rightOffset=this._commonTransitionStartState.rightOffset+e,this._correctOffset(),this._onScroll.fire()}},n.prototype.scrollToOffsetAnimated=function(t,e){var i,o,n,r;if(!isFinite(t))throw new RangeError("offset is required and must be finite number");if(void 0===e&&(e=400),!isFinite(e)||e<=0)throw new RangeError("animationDuration (optional) must be finite positive number");i=this,o=this.m_rightOffset,n=+new Date,r=this._model,function s(){i._visibleBarsInvalidated=!0;var a=(new Date-n)/e;if(a>=1)return i.m_rightOffset=t,i._visibleBarsInvalidated=!0,r.recalculateAllPanes(),void r.invalidate(new c(c.LIGHT_UPDATE));i.m_rightOffset=o+(t-o)*a,r.recalculateAllPanes(),setTimeout(s,20)}()},n.prototype.endScroll=function(){null!==this.m_scrollStartPoint&&(this.m_scrollStartPoint=null,this._clearCommonTransitionsStartState())},n.prototype.update=function(t,e,i,o){this._visibleBarsInvalidated=!0,i.length>0&&this.m_points.merge(t,e,i),this.m_tickmarks.merge(o),this._correctOffset()},n.prototype.addTail=function(t,e,i){var o,n,r;for(this.m_tickmarks.removeTail(e),o=t.params,n=this.m_tickmarks.maxIndex+(i?0:1),
r=0;r<o.marks.length;r++)o.marks[r].index=n+r;this.m_tickmarks.addTail(o.marks),this.m_points.addTail(o.changes,i),this.m_rightOffset-=o.changes.length},n.prototype.formatLabel=function(t,e){if(this._formattedBySpan[e])return this._formattedBySpan[e].format(t.valueOf());var i=this;return this._formattedBySpan[e]=new a(function(t){return i.formatLabelImpl(new Date(t),e)}),this._formattedBySpan[e].format(t)},n.prototype.formatLabelImpl=function(t,e){if(!(t&&t instanceof Date))return"incorrect time";var i=this._model.mainSeries().isDWM();return e<d.MINUTE_SPAN&&!i?h(t.getUTCHours(),2)+":"+h(t.getUTCMinutes(),2)+":"+h(t.getUTCSeconds(),2):e<d.DAY_SPAN&&!i?h(t.getUTCHours(),2)+":"+h(t.getUTCMinutes(),2):e<d.WEEK_SPAN?t.getUTCDate():e<d.MONTH_SPAN?t.getUTCDate():e<d.YEAR_SPAN?(m||(m=o()),m[t.getUTCMonth()]):t.getUTCFullYear()},n.prototype.normalizeBarIndex=function(t){var e=0,i=0,o=this.baseIndex();return t<this.m_points.firstIndex()?(e=this.m_points.valueAt(this.m_points.firstIndex()),i=t-this.m_points.firstIndex()):t>o?(e=this.m_points.valueAt(o),i=t-o):(e=this.m_points.valueAt(t),i=0),{time_t:e,offset:i}},n.prototype.denormalizeTimePoint=function(t){var e=this.m_points.indexOf(t.time_t);if(null!==e)return e+t.offset},n.prototype.zoomToBarsRange=function(t,e){if(!(e<=t)){var i=this.baseIndex();this.m_rightOffset=e-i,this.setBarSpacing(this.width()/(e-t+1)),this._visibleBarsInvalidated=!0}},n.prototype.canZoomIn=function(){return this.m_barSpacing<g},n.prototype.canZoomOut=function(){return this.m_barSpacing>v},n.prototype.minBarSpacing=function(){return v},n.prototype.maxBarSpacing=function(){return g},n.prototype.onScroll=function(){return this._onScroll},n.prototype.visibleBarsChanged=function(){return this._visibleBarsChanged},t.exports=n}).call(e,i(10))},function(t,e,i){"use strict";(function(e){function i(){this._marksByIndex={},this._marksBySpan=[],this.changed=new e}i.prototype.reset=function(){this._marksByIndex={},this._marksBySpan=[],delete this.minIndex,delete this.maxIndex,delete this._cache,this.changed.fire()},i.prototype.minIndex=void 0,i.prototype.maxIndex=void 0,i.prototype.merge=function(t){var e,i,o,n,r,s=this._marksBySpan,a={};for(e=0;e<t.length;e++){if(i=t[e],o=i.index,n=i.span,r=this._marksByIndex[i.index]){if(r.index===i.index&&r.span===i.span){r.time=i.time;continue}this._removeTickmark(r)}this._marksByIndex[o]=i,this.minIndex<=o||(this.minIndex=o),this.maxIndex>=o||(this.maxIndex=o),s[n]||(s[n]=[]),s[n].push(i),a[n]=!0}for(n=s.length;n--;)s[n]&&(s[n].length||delete s[n],a[n]&&s[n].sort(this._sortByIndexAsc));delete this._cache,this.changed.fire()},i.prototype._removeTickmark=function(t){var e,i,o=t.index;this._marksByIndex[o]===t&&(delete this._marksByIndex[o],o<=this.minIndex&&this.minIndex++,o>=this.maxIndex&&this.maxIndex--,this.maxIndex<this.minIndex&&(delete this.minIndex,delete this.maxIndex),e=this._marksBySpan[t.span],-1!==(i=e.indexOf(t))&&e.splice(i,1))},i.prototype._sortByIndexAsc=function(t,e){return t.index-e.index},i.prototype.removeTail=function(t){var e,i={};this.maxIndex=0
;for(e in this._marksByIndex)this._marksByIndex[e].time<t&&(i[e]=this._marksByIndex[e],this.maxIndex=Math.max(this.maxIndex,e));this._marksByIndex=i},i.prototype.addTail=function(t){for(var e=0;e<t.length;e++)t[e].index=this.maxIndex+e+1;this.merge(t)},i.prototype.indexToTime=function(t){var e=this._marksByIndex[t];return e?new Date(1e3*e.time):null},i.prototype.density=function(){var t,e=this.maxIndex-this.minIndex;if(0!==e)return t=this._marksByIndex[this.maxIndex].time-this._marksByIndex[this.minIndex].time,1e3*t/e},i.prototype.estimateLeft=function(t){var e,i=this.density();if(i)return e=1e3*this._marksByIndex[this.minIndex].time-t,e/i},i.prototype.nearestIndex=function(t){for(var e,i=this.minIndex,o=this.maxIndex;o-i>2;){if(1e3*this._marksByIndex[i].time===t)return i;if(1e3*this._marksByIndex[o].time===t)return o;e=Math.round((i+o)/2),1e3*this._marksByIndex[e].time>t?o=e:i=e}return i},i.prototype.build=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p,_,f,m=Math.ceil(e/t);if(this._maxbar===m&&this._cache)return this._cache;for(this._maxbar=m,i=[],o=this._marksBySpan.length;o--;)if(this._marksBySpan[o]){for(n=i,i=[],r=n.length,s=0,a=this._marksBySpan[o],l=a.length,c=1/0,h=-1/0,u=0;u<l;u++){for(d=a[u],p=d.index;s<r;){if(_=n[s],!((f=_.index)<p)){c=f;break}s++,i.push(_),h=f,c=1/0}c-p>=m&&p-h>=m&&(i.push(d),h=p)}for(;s<r;s++)i.push(n[s])}return this._cache=i,this._cache},i.prototype.state=function(){var t,e=[];for(t=this._marksBySpan.length;t--;)this._marksBySpan[t]&&(e=e.concat(this._marksBySpan[t]));return e=e.map(function(t){return[t.span,t.time,t.index]}),{marks:e,version:2}},i.prototype.restoreState=function(t){if(this._marksByIndex={},this._marksBySpan=[],delete this.maxIndex,delete this.minIndex,t&&t.marks&&t.marks.length)if(2===t.version){var e=t.marks.map(function(t){return{span:t[0],time:t[1],index:t[2]}});this.merge(e)}else this.merge(t.marks)},t.exports=i}).call(e,i(10))},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(7),n=o.getLogger("Chart.TimePoints"),r=function(){function t(){this._zoffset=0,this._items=[]}return t.prototype.clear=function(){this._zoffset=0,this._items=[]},t.prototype.size=function(){return this._items.length},t.prototype.firstIndex=function(){return this._offsetToIndex(0)},t.prototype.lastIndex=function(){return this._offsetToIndex(this._items.length-1)},t.prototype.merge=function(t,e,i){var o,r,s,a,l,c,h,u;if(0===i.length)return n.logError("merge: 'values' does not contain any time points"),[];if(e>this._zoffset&&t+e>0)return n.logError("merge: when the first time point index is updated, we should fill the time points starting from the first one"),[];if(0===this._items.length)return this._items=i,this._zoffset=e,[{change:"rebuild",index:this._validOffsetToIndex(0)}];if((o=t+this._zoffset)<0){if(r=Math.abs(o),i.length<r)return n.logError("merge: 'values' does not contain enough time points to fill in the new items. 'index': "+t+", previous 'zoffset': "+this._zoffset+", new 'zoffset': "+e+", 'values.length': "+i.length),[]
;for(this._items=Array(r).concat(this._items),this._zoffset=e,s=0;s<i.length;++s)this._items[t+s+e]=i[s];return[{change:"rebuild",index:this._validOffsetToIndex(0)}]}for(a=[],l=o;l<this._items.length&&l-o<i.length;++l)this._items[l]=i[l-o],a.push({change:"update",index:this._validOffsetToIndex(l),value:i[l-o]});if((c=o+i.length)>this._items.length)for(r=c-this._items.length,h=l;h<l+r;++h)u=this._items.length,this._items.push(i[h-o]),a.push({change:"append",index:this._validOffsetToIndex(u),value:i[h-o]});return this._zoffset=e,a},t.prototype.addTail=function(t,e){for(var i=e?1:0;i<t.length;i++)this._items.push(t[i])},t.prototype.remove=function(t){var e,i,o,n=this._indexToOffset(t);if(null===n)return[];for(e=this._items.splice(n),i=[],o=0;o<e.length;o++)i.push({change:"remove",index:t+o,value:e[o]});return i},t.prototype.valueAt=function(t){var e=this._indexToOffset(t);return null!==e?this._items[e]:null},t.prototype.indexOf=function(t,e){if(this._items.length<1)return null;if(t>this._items[this._items.length-1])return e?this._validOffsetToIndex(this._items.length-1):null;for(var i=0;i<this._items.length;++i){if(t===this._items[i])return this._validOffsetToIndex(i);if(t<this._items[i])return e?this._validOffsetToIndex(i):null}return null},t.prototype.state=function(){return{items:this._items,zoffset:this._zoffset}},t.prototype.restoreState=function(t){null!==t&&(this._items=t.items,this._zoffset=t.zoffset)},t.prototype.roughTime=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p;return void 0===e&&(e=null),null!==(i=this.valueAt(t))?i:(o=this._items,!o.length||o.length<2?null:(n=0,r=o.length-1,s=this._validOffsetToIndex(n),a=this._validOffsetToIndex(r),l=o[n],c=o[r],h=(c-l)/(a-s),t<s?(u=s-t,d=u*h,l-d):(p=500,t>a?(u=t-a)<p&&null!=e?e(c,u):(d=u*h,c+d):null)))},t.prototype.roughIndex=function(t,e){var i,o,n,r,s,a,l,c,h,u,d,p;return void 0===e&&(e=null),i=this._items,!i.length||i.length<2?null:(o=0,n=i.length-1,r=this._validOffsetToIndex(o),s=this._validOffsetToIndex(n),a=i[o],l=i[n],t>=a&&t<=l?this.closestIndexLeft(t):(c=(l-a)/(s-r),t<a?(h=a-t,u=Math.round(h/c),r-u):(d=500,t>l?(h=t-l,u=Math.trunc(h/c),u<d&&null!==e&&(p=e(l,t),p.success&&(u=p.result)),s+u):null)))},t.prototype.closestIndexLeft=function(t){var e,i,o,n,r,s,a=this._items;if(!a.length)return null;if(t!==t)return null;if(e=a.length-1,i=a[e],t>=i)return this._validOffsetToIndex(e);if(o=0,n=a[o],t<n)return null;if(t===n)return this._validOffsetToIndex(o);for(;e>o+1;)if(r=o+e>>1,(s=a[r])>t)e=r;else{if(!(s<t))return s===t?this._validOffsetToIndex(r):null;o=r}return this._validOffsetToIndex(o)},t.prototype._validOffsetToIndex=function(t){return t-this._zoffset},t.prototype._offsetToIndex=function(t){return 0<=t&&t<this.size()?this._validOffsetToIndex(t):null},t.prototype._indexToOffset=function(t){var e=t+this._zoffset;return 0<=e&&e<this.size()?e:null},t}(),e.TimePoints=r},function(t,e,i){"use strict";function o(t,e){this.tooltips={},this.tooltipFactory=t,this.source=e}function n(t,e){this.renderer=t,this._tooltip=e,this.visible=!1}
o.prototype.findOrCreateTooltip=function(t){var e=this.tooltips[t.id];return null==e&&(t.hovered||t.pinned)&&(e=this._createTooltip(),this.tooltips[t.id]=e),e},o.prototype.showPlate=function(t,e){var i=this.findOrCreateTooltip(t);null!=i&&(i._drawPlate(t,e),i.plateData=t)},o.prototype.draw=function(t,e){this.hoveredId=null;for(var i=0;i<t.length;i++)t[i].hovered&&(this.hoveredId=t[i].id);t.forEach(function(t){this.showPlate(t,e)}.bind(this))},o.prototype.endDraw=function(){var t,e,i=this;for(t in this.tooltips)this.tooltips.hasOwnProperty(t)&&(e=this.tooltips[t],e.toggleVisibility(),i.hoveredId&&e.plateData.id!==i.hoveredId&&!e.plateData.pinned&&(e.remove(),delete this.tooltips[t]))},o.prototype.removeAll=function(){var t,e;for(t in this.tooltips)this.tooltips.hasOwnProperty(t)&&(e=this.tooltips[t],e.remove());this.tooltips={}},o.prototype.removeTooltip=function(t){delete this.tooltips[t]},o.prototype._createTooltip=function(){return new n(this,this.tooltipFactory())},n.prototype._drawPlate=function(t,e){var i=this;this.visible=!0,this._tooltip.setSource(this.renderer.source),this._tooltip.showPlate(t,e),t.hovered||t.pinned||this._tooltip.hide(function(){i.renderer.removeTooltip(t.id)})},n.prototype.remove=function(){this._tooltip._removeLayout()},n.prototype.toggleVisibility=function(){this._tooltip._toggleLayout(this.visible),this.visible=!1},e.TooltipRenderer=o},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t){var e,i;if(t&&t.__esModule)return t;if(e={},null!=t)for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e.default=t,e}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s(t,e,i){var o,n=2*U,r=document.createElement("canvas");return r.width=e*n,r.height=i*n,r.style.width=e+"px",r.style.height=i+"px",o=r.getContext("2d"),o.setTransform(n,0,0,n,0,0),o.drawImage(t,0,0,e,i),r}function a(t,e){return function(){i.e(11).then(function(){j=i(1191),t.call(e)}.bind(null,i)).catch(i.oe)}}function l(t){return!S||t>w}var c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E,D,V,O,R,B,z,F,N,W,H,U,j,q,G;Object.defineProperty(e,"__esModule",{value:!0}),e.Branding=void 0,c=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),h=i(8),u=i(60),d=i(5),p=n(d),_=i(11),f=o(_),m=i(321),g=o(m),v=i(31),y=i(30),b=i(915),S=p.enabled("adaptive_logo"),w=500,T="TradingView",C="Ch{0}ar{1}t{2}by{3}{4}".format("",""," "," ",T),x="po{0}wer{1}ed{2}by{3}{4}".format("",""," "," ",T),P="site_branding",L="widget_branding",I="widget_referral_branding",k="widget_custom_branding",A="widget_custom_no_powered_branding",M="fundamental_branding",E="fundamental_custom_branding",D="fundamental_custom_no_powered_branding",V="library_branding",O="library_custom_branding",R="library_custom_no_powered_branding",B=.2,
z=navigator.userAgent.toLowerCase().indexOf("firefox")>-1,F=z&&navigator.userAgent.toLowerCase().indexOf("windows")>-1,N=navigator.userAgent.toLowerCase().indexOf("chrome")>-1&&-1===navigator.userAgent.toLowerCase().indexOf("edge"),W=function(){var t,e=window.navigator.userAgent,i=e.indexOf("MSIE ");return i>0?parseInt(e.substring(i+5,e.indexOf(".",i)),10):e.indexOf("Trident/")>0&&(t=e.indexOf("rv:"),parseInt(e.substring(t+3,e.indexOf(".",t)),10))}(),H=window.urlParams||{},window.initData,U=window.hidpiCanvasRatio||1,j=null,q=function(){function t(e){var i=e.layout,o=void 0===i?P:i,n=e.symbol,s=void 0===n?"":n,l=e.model,c=e.onReadyCallback;r(this,t),this._model=l,this._image=null,this._imageReady=!1,this._needDisplay=!1,this._imageWidth=22,this._imageHeight=13,this.show=!0,this.width=100,this.height=14,this._bottomShift=0,this._brandCircleSize=32,this._layout=o,this._symbol=s,this._fillColor=v.color.brandNew,this._colorOldBlue=v.color.brandDown,this._colorOldGray=v.color.black30,this._strokeColor=v.color.black255,this._brandCircleColor=v.color.black255,this._brandCircleShadowColor=v.color.black0,this._strokeWidth=4,this._fontSize=14,this._font='px "Trebuchet MS", Tahoma, Arial, sans-serif',this._txt="TradingView",this._onReadyCallback=c,this._upscaleRatio=N?1:2,this._strokeCanv=null,this._fillCanv=null,W&&(this._init=a(this._init,this)),this._init()}return c(t,[{key:"_init",value:function(){this._checkLayout(),this.show&&(this._loadImage(b,"tvLogo"),this._updateStrokeColor(),this._model.properties().paneProperties.background.subscribe(this,this._updateStrokeColor),this._model.onChartThemeLoaded().subscribe(this,this._updateStrokeColor))}},{key:"_updateStrokeColor",value:function(){var t=(0,y.getLuminance)(this._model.properties().paneProperties.background.value());this._strokeCanv=null,this._fillCanv=null,t>B?(this._brandCircleShadowopacity=.09,this._strokeOpacity=.8,this._circleOpacity=1):(this._brandCircleShadowopacity=.16,this._strokeOpacity=.1,this._circleOpacity=.1)}},{key:"_loadImage",value:function(t,e){var i=this;this._needDisplay&&(this._image=new Image,this._image.src=W?j.fallbackImages[e]:"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(t),this._image.addEventListener("load",function(){F&&(i._image=s(i._image,i._imageWidth,i._imageHeight)),i._imageReady=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()}))}},{key:"_checkLayout",value:function(){switch(this._layout){case L:case I:case k:case M:case E:case O:case V:this.show=!0;break;case P:case A:case D:case R:this.show=!1}switch(this._layout){case V:this._needDisplay=!0,this._txt=$.t(C);break;case O:this._txt=$.t(x)}}},{key:"_drawTextStroke",value:function(t){var e,i;this._strokeCanv||(this._strokeCanv=document.createElement("canvas"),e=this._strokeCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),e.font=this._fontSize*this._upscaleRatio+this._font,this._textWidth=e.measureText(this._txt).width,this._strokeCanv.width=(this._textWidth+2*i)*U,this._strokeCanv.height=(this._fontSize+2*i)*this._upscaleRatio*U,
this._strokeCanv.width%2==0&&(this._strokeCanv.width+=1,this._strokeCanv.height+=1),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.strokeStyle=this._strokeColor,e.lineWidth=this._strokeWidth*this._upscaleRatio*U,e.lineJoin="round",e.strokeText(this._txt,i,z?4:0)),t.save(),t.globalAlpha=this._strokeOpacity,t.drawImage(this._strokeCanv,0,0,this._strokeCanv.width,this._strokeCanv.height,0,0,this._strokeCanv.width/this._upscaleRatio/U,this._strokeCanv.height/this._upscaleRatio/U),t.restore()}},{key:"_drawTextFill",value:function(t){var e,i;this._fillCanv||(this._fillCanv=document.createElement("canvas"),e=this._fillCanv.getContext("2d"),i=Math.round(this._strokeWidth*this._upscaleRatio),this._fillCanv.width=(this._textWidth+2*i)*U,this._fillCanv.height=(this._fontSize+2*i)*this._upscaleRatio*U,this._fillCanv.width%2==0&&(this._fillCanv.width+=1,this._fillCanv.height+=1),e.textBaseline="top",e.textAlign="start",e.font=this._fontSize*this._upscaleRatio+this._font,e.fillStyle=this._fillColor,e.fillText(this._txt,i,z?4:0)),t.save(),t.drawImage(this._fillCanv,0,0,this._fillCanv.width,this._fillCanv.height,0,0,this._fillCanv.width/this._upscaleRatio/U,this._fillCanv.height/this._upscaleRatio/U),t.restore()}},{key:"_drawBgCircle",value:function(t){t.save(),t.beginPath(),t.fillStyle=this._brandCircleShadowColor,t.globalAlpha=this._brandCircleShadowopacity,t.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2+1,0,2*Math.PI),t.fill(),t.closePath(),t.restore(),t.save(),t.beginPath(),t.globalAlpha=this._circleOpacity,t.fillStyle=this._brandCircleColor,t.arc(this._imageWidth/2,this._imageHeight/2,this._brandCircleSize/2,0,2*Math.PI,!1),t.fill(),t.closePath(),t.restore()}},{key:"bottomShift",value:function(){return this._bottomShift}},{key:"draw",value:function(t,e){var i,o,n,r,s,a;this._layout===k||this._layout===E?(i='12px "Trebuchet MS", Tahoma, Arial, sans-serif',t.font=i,o=t.measureText(this._txt).width,this.width=o+t.measureText("TradingView").width,t.save(),t.globalAlpha=.7,t.fillStyle=this._colorOldGray,t.fillText(this._txt,0,12),t.fillStyle=this._colorOldBlue,t.fillText("TradingView",o,12),t.restore()):this._needDisplay&&this._imageReady?(t.save(),n=(this._brandCircleSize-this._imageWidth)/2,t.translate(n,0),this._drawBgCircle(t),t.drawImage(this._image,0,-.5,this._imageWidth,this._imageHeight),r=12+(N?-.5:0),t.translate(this._imageWidth+r,-.5),s=l(e),s&&(this._drawTextStroke(t),this._drawTextFill(t)),t.restore(),this.width=this._imageWidth+n,this.width+=s?r+this._strokeCanv.width/this._upscaleRatio/U:n,this.height=this._brandCircleSize,this._bottomShift=this._brandCircleSize-this._imageHeight):(t.save(),t.translate(0,0),a=l(e),a&&(this._drawTextStroke(t),this._drawTextFill(t)),t.restore(),a&&(this.width=this._strokeCanv.width/this._upscaleRatio/U))}}]),t}(),G=function(){function t(e){var i=e.layout,o=void 0===i?P:i,n=e.src,s=e.onReadyCallback;r(this,t),this._img=new Image,this._ready=!1,this.show=!1,this.width=0,this.height=0,this._layout=o,this._src=n,
this._onReadyCallback=s,W&&(this._init=a(this._init,this)),this._init()}return c(t,[{key:"_init",value:function(){var t,e,i=this;this._checkLayout(),this.show&&(t=this._src.match(/(\w+)\.svg/),W&&t&&2===t.length?(e=t[1],this._img.src=j.fallbackImages[e],this._img.addEventListener("load",function(){var t=j.logoSizes;e in t?(i.width=t[e].width,i.height=t[e].height):(i.width=135,i.height=25),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})):(this._img.src=this._src,this._img.addEventListener("load",function(){i.width=Math.round(i._img.width),i.height=Math.round(i._img.height),F&&(i._img=s(i._img,i.width,i.height)),i._ready=!0,"function"==typeof i._onReadyCallback&&i._onReadyCallback()})))}},{key:"_checkLayout",value:function(){switch(this._layout){case k:case A:case E:case D:case O:case R:this.show=!0;break;case P:case L:case I:case M:case V:this.show=!1}}},{key:"draw",value:function(t){this._ready&&t.drawImage(this._img,0,0,this.width,this.height)}}]),t}(),e.Branding=function(){function t(e){var i,o=this;r(this,t),this._model=e,this._mainSeries=this._model.mainSeries(),this._canvasWidth=0,this._paneHeight=0,this._left=13,this._bottom=24,this._layout=P,this._needToShow=!0,this._customLogoSrc="",this._customLogoLink="",this._checkLayout(),this._layout!==k&&this._layout!==E||(this._left=8,this._bottom=5),i=function(){o._needToShow?o._layout===P?o._showBranding=window.innerWidth>=768:o._showBranding=!0:o._showBranding=!1},this._resizeHandlerDelayed=(0,g.default)(i,200),i(),window.addEventListener("resize",this._resizeHandlerDelayed),this._model.isSnapshot()?this._init():this._mainSeries.onSymbolResolved().subscribe(this,this._init)}return c(t,[{key:"destroy",value:function(){window.removeEventListener("resize",this._resizeHandlerDelayed)}},{key:"_init",value:function(){var t=this,e=this._mainSeries.symbolInfo()||{};this._powBy=new q({layout:this._layout,symbol:e.name,model:this._model,onReadyCallback:function(){return t._model.fullUpdate()}}),this._custom=new G({layout:this._layout,src:this._customLogoSrc,onReadyCallback:function(){return t._model.fullUpdate()}})}},{key:"_checkLayout",value:function(){if(p.enabled("widget"));else if(p.enabled("charting_library")||p.enabled("amp_terminal")||p.enabled("cqg_terminal")||p.enabled("trading_terminal")){var t=JSON.parse(H.logo)||{};t.image?(this._customLogoSrc=t.image,this._customLogoLink=t.link,this._needToShow=p.enabled("widget_logo"),p.enabled("link_to_tradingview")?this._layout=O:this._layout=R):(this._layout=V,this._needToShow=p.enabled("widget_logo"))}else this._layout=P}},{key:"updateAllViews",value:function(){}},{key:"priceScale",value:function(){}},{key:"priceAxisViews",value:function(){}},{key:"onClickOutside",value:function(){}},{key:"hasContextMenu",value:function(){return!1}},{key:"hitTest",value:function(t){var e=this;return!this._showBranding||p.enabled("logo_without_link")?null:this._powBy&&this._layout!==P&&this._layout!==A&&this._layout!==D&&(0,
u.pointInRectangle)(t,new h.Point(this._left,this._paneHeight-this._bottom+this._powBy.bottomShift()/2-Math.max(this._powBy.height,void 0!==this._custom?this._custom.height:0)),new h.Point(this._left+Math.max(this._powBy.width,void 0!==this._custom?this._custom.width:0),this._paneHeight-this._bottom+this._powBy.bottomShift()/2))?new f.default(f.default.CUSTOM,{mouseUpHandler:function(){window.open(e.tvUrl(),"_blank").opener=null}}):null}},{key:"tvUrl",value:function(){var t,e="https://www.tradingview.com/";if(this._customLogoLink)return this._customLogoLink;if(this._layout===V||this._layout===O){switch(t=void 0,!0){case p.enabled("charting_library"):t="library";break;case p.enabled("trading_terminal"):case p.enabled("amp_terminal"):case p.enabled("cqg_terminal"):t="trading-terminal"}return e+="/"===e[e.length-1]?"?":"&",e+="utm_source="+window.location.origin+"&utm_medium=library"+(t?"&utm_campaign="+t:"")}return e}},{key:"draw",value:function(t){if(this._showBranding){var e=0;this._powBy&&this._powBy.show&&(e=this._powBy.height-this._powBy.bottomShift(),t.save(),t.translate(this._left,this._paneHeight-this._bottom-e),this._powBy.draw(t,this._canvasWidth),t.restore()),this._custom&&this._custom.show&&(t.save(),t.translate(this._left,this._paneHeight-this._bottom-e-this._custom.height),this._custom.draw(t),t.restore())}}},{key:"renderer",value:function(t,e){return this._paneHeight=this._pane.height(),this._canvasWidth=e,{draw:this.draw.bind(this)}}},{key:"paneViews",value:function(t){var e=p.enabled("move_logo_to_main_pane");return e&&t.isMainPane()||!e&&t.isLast()||t.isMaximized()?(this._pane=t,[{renderer:this.renderer.bind(this)}]):[]}}]),t}()},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 13" width="22" height="13"><path fill="#37A6EF" fill-rule="nonzero" d="M19.354 4.932c.379.55.611 1.207.642 1.918A3.007 3.007 0 0 1 22 9.686a3.003 3.003 0 0 1-3 3.006H4a3.983 3.983 0 0 1-2.814-1.16l6.363-5.048a1.657 1.657 0 0 0 1.495.037l3.034 2.66a1.672 1.672 0 0 0 1.589 2.175 1.668 1.668 0 0 0 1.552-2.28l4.135-4.144zm-.942-.945L14.276 8.13a1.66 1.66 0 0 0-1.32.044l-3.034-2.66A1.672 1.672 0 0 0 8.333 3.34a1.668 1.668 0 0 0-1.611 2.097l-6.316 5.01A3.999 3.999 0 0 1 0 8.683a4.004 4.004 0 0 1 4.041-4.008A5.338 5.338 0 0 1 9.333 0a5.337 5.337 0 0 1 5.124 3.857 3.644 3.644 0 0 1 1.876-.517c.772 0 1.488.239 2.079.647z"/></svg>'},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(10),n=function(){function t(t){this._changed=new o,this._model=t}return t.prototype.getStepChangeValue=function(){return.1},t.prototype.getMinValue=function(){return 1e-7},t.prototype.getMaxValue=function(){return 9999},t.prototype.value=function(){return this._model.mainSeriesScaleRatio()},t.prototype.setValue=function(t,e){(t!==this.value()||e)&&(this._model.setMainSeriesScaleRatio(t),this._onChanged())},t.prototype.state=function(){return null},t.prototype.clone=function(){return new t(this._model)},t.prototype.listeners=function(){return this._changed},
t.prototype.subscribe=function(t,e){this._changed.subscribe(t,e)},t.prototype.unsubscribe=function(t,e){this._changed.unsubscribe(t,e)},t.prototype.unsubscribeAll=function(t){this._changed.unsubscribeAll(t)},t.prototype._onChanged=function(){this._changed.fire(this)},t}(),e.MainSeriesScaleRatioProperty=n},function(t,e,i){"use strict";function o(t){"LineToolGannComplex"!==t.type||void 0!==t.version&&1!==t.version||(t.type="LineToolGannFixed")}Object.defineProperty(e,"__esModule",{value:!0}),e.migrateState=o},function(t,e,i){"use strict";function o(t){this._data=t}function n(t,e,i){if(i===CanvasEx.HHISTDIR_LEFTTORIGHT)return t+e;if(i===CanvasEx.HHISTDIR_RIGHTTOLEFT)return e+t;throw Error("Unknown direction value: "+i)}var r=i(8),s=r.Point,a=r.equalPoints,l=i(60),c=l.pointInRectangle,h=l.pointInTriangle,u=i(132).intersectRayAndRectangle,d=i(166).TextRenderer,p=i(94).HorizontalLineRenderer,_=i(110).TrendLineRenderer,f=i(919).HorizHistogramRenderer,m=i(920).HLinesPriceAxisView,g=i(380),v=TradingView.Study,y=i(921),b=i(11),S=i(53).CompositeRenderer,w=i(130).clearRect,T=i(30),C=i(32).shiftColor,x=i(7).getLogger("Chart.StudyGraphicsPaneViews");v.graphicsZOrderPriority=function(t){switch(t){case"polygons":return-100;case"trendchannels":return-90;default:return 0}},v.StudyPaneView_horizlines=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_horizlines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_horizlines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new _,i.setData(this._data[e]),i.setHitTest(new b(b.REGULAR)),t.append(i);return t},v.StudyPaneView_horizlines.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w;if(this._data=[],(t=this._study.graphics().horizlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.horizlines[c.styleId],h.visible.value()))for(u=0;u<c.data.length;u++)d=c.data[u],p=o[d.startIndex],_=o[d.endIndex],!d.extendRight&&Math.max(p,_)<r||!d.extendLeft&&Math.min(p,_)>a||(f={},m=i.indexToCoordinate(p),g=i.indexToCoordinate(_),v=d.level,e.isPercent()&&(y=this._study.firstValue(),v=e.priceRange().convertToPercent(v,y)),b=e.priceToCoordinate(v),S=new s(m,b),w=new s(g,b),f.points=[S,w],f.extendleft=d.extendLeft,f.extendright=d.extendRight,f.width=i.width(),f.height=e.height(),f.color=h.color.value(),f.linewidth=h.width.value(),f.linestyle=h.style.value(),this._data.push(f))},v.StudyPaneView_vertlines=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_vertlines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_vertlines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,
e=0;e<this._data.length;e++)i=new _,i.setData(this._data[e]),i.setHitTest(new b(b.REGULAR)),t.append(i);return t},v.StudyPaneView_vertlines.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;if(this._data=[],(t=this._study.graphics().vertlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.vertlines[c.styleId],h.visible.value()))for(u=0;u<c.data.length;u++)d=c.data[u],p={},o[d.index]<r||o[d.index]>a||(_=i.indexToCoordinate(o[d.index])+1,f=null,d.extendBottom?m=e.height():(v=d.startPrice,e.isPercent()&&(f=f||this._study.firstValue(),v=e.priceRange().convertToPercent(v,f)),m=e.priceToCoordinate(v)),d.extendTop?g=0:(y=d.endPrice,e.isPercent()&&(f=f||this._study.firstValue(),y=e.priceRange().convertToPercent(y,f)),g=e.priceToCoordinate(y)),b=new s(_,m),S=new s(_,g),p.points=[b,S],p.extendleft=d.extendBottom,p.extendright=d.extendTop,p.width=i.width(),p.height=e.height(),p.color=h.color.value(),p.linewidth=h.width.value(),p.linestyle=h.style.value(),this._data.push(p))},v.StudyPaneView_lines=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_lines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_lines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new _,i.setData(this._data[e]),i.setHitTest(new b(b.REGULAR)),t.append(i);return t},v.StudyPaneView_lines.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P;if(this._data=[],(t=this._study.graphics().lines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=this._study.priceScale().height(),c=i.width(),h=0;h<t.length;h++)if(u=t[h],u.data&&(d=this._study.properties().graphics.lines[u.styleId],d.visible.value()))for(p=0;p<u.data.length;p++)_=u.data[p],f=o[_.startIndex]+(_.startOffset||0),m=o[_.endIndex]+(_.endOffset||0),!_.extendRight&&Math.max(f,m)<r||!_.extendLeft&&Math.min(f,m)>a||(g={},v=i.indexToCoordinate(f),y=i.indexToCoordinate(m),b=_.startPrice,S=_.endPrice,e.isPercent()&&(w=this._study.firstValue(),b=e.priceRange().convertToPercent(b,w),S=e.priceRange().convertToPercent(S,w)),T=e.priceToCoordinate(b),C=e.priceToCoordinate(S),x=new s(v,T),P=new s(y,C),g.points=[x,P],g.width=c,g.height=l,g.color=d.color.value(),g.linewidth=d.width.value(),g.linestyle=d.style.value(),this._data.push(g))},v.StudyPaneView_hlines=function(t,e){this._study=t,this._model=e,this._data=[],this._textData=[]},v.StudyPaneView_hlines.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_hlines.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),
this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new p,i.setData(this._data[e]),t.append(i);for(e=0;e<this._textData.length;e++)t.append(new d(this._textData[e],new b(b.REGULAR)));return t},v.StudyPaneView_hlines.prototype._updateViewInternal=function(){this._calcHorzLinesData(),this._calcTextData()},v.StudyPaneView_hlines.prototype._calcTextData=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f;if(this._textData=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=0;o<t.length;o++)if(n=t[o],n.data&&(r=this._study.properties().graphics.hlines[n.styleId],r.enableText.value()&&r.showText.value()))for(a=0;a<n.data.length;a++)l=n.data[a],c={},c.text=void 0===l.text?"":l.text,c.color=r.color.value(),c.font="arial",c.fontsize=r.fontSize.value(),h=l.level,e.isPercent()&&(u=this._study.firstValue(),h=e.priceRange().convertToPercent(h,u)),d=e.priceToCoordinate(h),p=r.textPos.value(),p===CanvasEx.TEXTPOS_TOPLEFT||p===CanvasEx.TEXTPOS_MIDDLELEFT||p===CanvasEx.TEXTPOS_BOTTOMLEFT?(_=4,c.horzAlign="left"):p===CanvasEx.TEXTPOS_TOPCENTER||p===CanvasEx.TEXTPOS_MIDDLECENTER||p===CanvasEx.TEXTPOS_BOTTOMCENTER?(_=i.width()/2,c.horzAlign="center"):p!==CanvasEx.TEXTPOS_TOPRIGHT&&p!==CanvasEx.TEXTPOS_MIDDLERIGHT&&p!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(_=i.width(),c.horzAlign="right"),p===CanvasEx.TEXTPOS_TOPLEFT||p===CanvasEx.TEXTPOS_TOPCENTER||p===CanvasEx.TEXTPOS_TOPRIGHT?(c.vertAlign="bottom",d-=4):p===CanvasEx.TEXTPOS_MIDDLELEFT||p===CanvasEx.TEXTPOS_MIDDLECENTER||p===CanvasEx.TEXTPOS_MIDDLERIGHT?(c.vertAlign="middle",d-=2):p!==CanvasEx.TEXTPOS_BOTTOMLEFT&&p!==CanvasEx.TEXTPOS_BOTTOMCENTER&&p!==CanvasEx.TEXTPOS_BOTTOMRIGHT||(c.vertAlign="top"),f=new s(_,d),c.points=[f],c.offsetX=0,c.offsetY=0,this._textData.push(c)},v.StudyPaneView_hlines.prototype._calcHorzLinesData=function(){var t,e,i,o,n,r,a,l,c,h,u,d;if(this._data=[],(t=this._study.graphics().hlines)&&(e=this._study.priceScale())&&!e.isEmpty())for(i=0;i<t.length;i++)if(o=t[i],o.data&&(n=this._study.properties().graphics.hlines[o.styleId],n.visible.value()))for(r=0;r<o.data.length;r++)a=o.data[r],l={},c=0,h=a.level,e.isPercent()&&(u=this._study.firstValue(),h=e.priceRange().convertToPercent(h,u)),d=e.priceToCoordinate(h),l.points=[new s(c,d)],l.color=n.color.value(),l.linewidth=n.width.value(),l.linestyle=n.style.value(),l.hitTestResult=b.REGULAR,this._data.push(l)},v.StudyPriceAxisView_hlines=m,TradingView.TriangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.TriangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.TriangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,r,s,a;if(this._data){switch(e="up"===this._data.direction?1:-1,i=this._data.point.x,"left"===this._data.halign?i-=this._data.size:"right"===this._data.halign&&(i+=this._data.size),o=this._data.point.y,t.font=this.fontStyle(),n=t.measureText(this._data.text).width,
this._textCache.textWidth=n,r=this._data.fontSize,s=.65*r,a=1*r,t.save(),t.translate(i+.5,o+.5),t.beginPath(),t.moveTo(0,0),this._data.direction){case"up":case"down":t.lineTo(s,a*e),t.lineTo(.5*n+s,a*e),t.lineTo(.5*n+s,(a+1.75*r)*e),t.lineTo(.5*-n-s,(a+1.75*r)*e),t.lineTo(.5*-n-s,a*e),t.lineTo(-s,a*e),t.lineTo(0,0),t.strokeStyle=this._data.borderColor,t.stroke(),t.fillStyle=this._data.color,t.fill(),t.fillStyle=this._data.fontColor,t.fillText(this._data.text,.5*-n,e<0?e*a-.5*r:a+1.25*r);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}t.restore()}},TradingView.TriangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,r,a,l,h,u,d,p,_=this._textCache.textWidth,f=this._data.fontSize;switch(this._data.direction){case"up":case"down":if(e="up"===this._data.direction?1:-1,i=.65*f,o=1*f,n=this._data.point.x,"left"===this._data.halign?n-=this._data.size:"right"===this._data.halign&&(n+=this._data.size),r=this._data.point.y,a=n-.5*_-i,l=n+.5*_+i,h=r+o*e,u=r+(o+1.75*f)*e,u<h&&(r=h,h=u,u=r),c(t,new s(a,h),new s(l,u)))return new b(b.REGULAR);if(d=[],d[0]={},d[0].x=this._data.point.x,d[0].y=this._data.point.y,d[1]={},d[1].x=this._data.point.x+.65*f,d[1].y=this._data.point.y+f*e,d[2]={},d[2].x=this._data.point.x-.65*f,d[2].y=this._data.point.y+f*e,p=(t.x-d[0].x)*(d[1].y-d[0].y)-(t.y-d[0].y)*(d[1].x-d[0].x),((t.x-d[1].x)*(d[2].y-d[1].y)-(t.y-d[1].y)*(d[2].x-d[1].x))*p>0&&((t.x-d[2].x)*(d[0].y-d[2].y)-(t.y-d[2].y)*(d[0].x-d[2].x))*p>0)return new b(b.REGULAR);break;default:throw Error(this._data.direction+" doesn't supported by TradingView.TriangleTextMarkRenderer")}return null},TradingView.RectangleTextMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.RectangleTextMarkRenderer.prototype.fontStyle=function(){return(this._data.bold?"bold ":"")+(this._data.italic?"italic ":"")+this._data.fontSize+"px "+this._data.font},TradingView.RectangleTextMarkRenderer.prototype.draw=function(t){var e,i,o,n,r;if(this._data){switch(e=this._data.point.x,i=this._data.point.y,t.font=this.fontStyle(),o=t.measureText(this._data.text).width,this._textCache.textWidth=o,t.save(),t.translate(e+.5,i+.5),t.beginPath(),t.moveTo(0,0),n=this._data.halign,r=this._data.valign,t.textAlign=n,r){case"middle":t.textBaseline="middle";break;case"top":t.textBaseline="bottom";break;case"bottom":t.textBaseline="hanging"}t.fillStyle=this._data.fontColor,t.fillText(this._data.text,0,0),t.restore()}},TradingView.RectangleTextMarkRenderer.prototype.hitTest=function(t){var e,i,o=this._data.point.x+.5,n=this._data.point.y+.5,r=this._textCache.textWidth,a=this._data.fontSize,l=this._data.halign;switch(this._data.valign){case"middle":n-=a/2;break;case"bottom":n-=a}switch(l){case"right":o-=r;break;case"center":o-=r/2}return e=new s(o,n),i=new s(o+r,n+a),c(t,e,i)?new b(b.REGULAR):null},TradingView.CircleShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.CircleShapeMarkRenderer.prototype.draw=function(t){var e,i,o
;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=this._data.point.x,o=this._data.point.y,t.save(),t.fillStyle=this._data.color,t.beginPath(),t.arc(i+1,o+2*this._data.size*e+.5,this._data.size,0,2*Math.PI),t.closePath(),t.fill(),t.stroke(),t.restore())},TradingView.CircleShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0;return Math.pow(this._data.point.x+.5-t.x,2)+Math.pow(this._data.point.y+.5+2*this._data.size*e-t.y,2)<=Math.pow(this._data.size,2)?new b(b.REGULAR):null},TradingView.SquareShapeMarkRenderer=function(t,e){this._data=t,this._textCache=e},TradingView.SquareShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,r;this._data&&(e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new s(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new s(this._data.point.x+i/2,this._data.point.y+i/2+e*i),r=n.subtract(o),t.beginPath(),t.fillStyle=this._data.color,t.rect(o.x,o.y,r.x,r.y),t.stroke(),t.fill())},TradingView.SquareShapeMarkRenderer.prototype.hitTest=function(t){var e="down"===this._data.direction?1:"up"===this._data.direction?-1:0,i=parseInt(this._data.size),o=new s(this._data.point.x-i/2,this._data.point.y-i/2+e*i),n=new s(this._data.point.x+i/2,this._data.point.y+i/2+e*i),r=new s(Math.min(o.x,n.x),Math.min(o.y,n.y)),a=new s(Math.max(o.x,n.x),Math.max(o.y,n.y));return c(t,r,a)?new b(b.REGULAR):null},TradingView.ArrowShapeMarkRenderer=function(t,e,i){this._data=t,this._textCache=e,this._arrowDirection=i},TradingView.ArrowShapeMarkRenderer.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u;if(this._data){switch(e=this._arrowDirection,i=1*this._data.size,o=this._data.color,n=this._data.point.x+1,r=this._data.point.y,s=1.1*i,e){case"up":r-=s;break;case"down":r+=s}switch(a=i/6,l=i/4,c=i/3,h=i/2,u=.6666666*i,t.save(),t.fillStyle=o,t.beginPath(),e){case"up":t.moveTo(n,r),t.lineTo(n-h,r+u),t.lineTo(n-l,r+u),t.lineTo(n,r+c),t.lineTo(n+l,r+u),t.lineTo(n+h,r+u),t.lineTo(n,r);break;case"down":t.moveTo(n,r+i),t.lineTo(n-h,r+c),t.lineTo(n-l,r+c),t.lineTo(n,r+u),t.lineTo(n+l,r+c),t.lineTo(n+h,r+c),t.lineTo(n,r+i);break;case"right":t.moveTo(n+a,r),t.lineTo(n-a,r-l),t.lineTo(n-a,r+l),t.lineTo(n+a,r);break;case"left":t.moveTo(n-a,r),t.lineTo(n+a,r-l),t.lineTo(n+a,r+l),t.lineTo(n-a,r)}t.closePath(),t.fill(),t.stroke(),t.restore()}},TradingView.ArrowShapeMarkRenderer.prototype.hitTest=function(t){var e,i,o,n,r,a,l,c=this._data.point.x,u=this._data.point.y,d=this._arrowDirection,p=1*this._data.size,_=p/2,f=1.1*p;switch(d){case"up":u-=f;break;case"down":u+=f}switch(e=p/6,i=p/4,o=p/3,_=p/2,n=.6666666*p,d){case"up":r=new s(c,u),a=new s(c+_,u+n),l=new s(c-_,u+n);break;case"down":r=new s(c,u+p),a=new s(c+_,u+o),l=new s(c-_,u+o);break;case"right":r=new s(c+e,u),a=new s(c-e,u-i),l=new s(c-e,u+i);break;case"left":r=new s(c-e,u),a=new s(c+e,u-i),l=new s(c+e,u+i)}return h(t,r,a,l)?new b(b.REGULAR):null},v.StudyPaneView_textmarks=function(t,e){this._study=t,this._model=e,this._data=[],
this._textCache=[]},inherit(v.StudyPaneView_textmarks,y),v.StudyPaneView_textmarks.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_textmarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"triangle":t.append(new TradingView.TriangleTextMarkRenderer(this._data[e],this._textCache[e]));break;case"rectangle":t.append(new TradingView.RectangleTextMarkRenderer(this._data[e],this._textCache[e]))}return t},v.StudyPaneView_textmarks.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;if(this._data=[],(t=this._study.graphics().textmarks)&&(e=this._study.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.textmarks[c.styleId],h.visible.value()))for(u=c.data,d=0;d<u.length;d++)if(p=u[d],_={},f=h.location.value(),m=h.shape.value(),!((g=o[p.time])<r||g>a)&&null!==this._study.series().bars().valueAt(g)){switch(g=o[p.time]+(p.offset||0),_.font=h.fontFamily.value(),_.color=T.generateColor(h.color.value(),h.transparency.value()),_.bold=h.fontBold.value(),_.fontColor=T.generateColor(h.fontColor.value(),h.transparency.value()),_.italic=h.fontItalic.value(),_.fontSize=h.fontSize.value(),_.text=p.text?p.text:"",_.halign=h.halign.value(),_.valign=void 0!==h.valign?h.valign.value():"middle",_.shape=h.shape.value(),_.size=.5*i.barSpacing(),_.borderColor="rgb(0, 0, 0)",v=50,m){case"triangle":S=this._calcCoordsForTriangleShape(f,g,v,p.price,e),_.direction=S.direction,y=Math.round(i.indexToCoordinate(g)),b=S.y;break;case"rectangle":S=this._calcCoordsForRectangleShape(f,g,p.price,e,i),y=S.x,b=S.y}_.point=new s(y,b),this._data.push(_),this._textCache.push({})}},v.StudyPaneView_textmarks.prototype._calcCoordsForTriangleShape=function(t,e,i,o,n){var r,s,a;switch(t){case CanvasEx.MARKLOC_TOP:r=n.height()-i,s="down";break;case CanvasEx.MARKLOC_BOTTOM:r=i,s="up";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),r=n.priceToCoordinate(o),s="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:n.isPercent()&&(a=this._study.firstValue(),o=n.priceRange().convertToPercent(o,a)),r=n.priceToCoordinate(o),s="up";break;case CanvasEx.MARKLOC_ABOVEBAR:r=this._locationToY(t,e),s="down";break;case CanvasEx.MARKLOC_BELOWBAR:default:r=this._locationToY(t,e),s="up"}return{y:r,direction:s}},v.StudyPaneView_textmarks.prototype._calcCoordsForRectangleShape=function(t,e,i,o,n){var r,s,a=Math.round(n.indexToCoordinate(e));switch(t){case CanvasEx.MARKLOC_ABSOLUTEDOWN:case CanvasEx.MARKLOC_ABSOLUTEUP:case CanvasEx.MARKLOC_ABSOLUTE:o.isPercent()&&(s=this._study.firstValue(),i=o.priceRange().convertToPercent(i,s)),r=o.priceToCoordinate(i);break;case CanvasEx.MARKLOC_ABOVEBAR:case CanvasEx.MARKLOC_BELOWBAR:r=this._locationToY(t,e)
;break;case CanvasEx.MARKLOC_RIGHT:case CanvasEx.MARKLOC_LEFT:a=n.width(),o.isPercent()&&(s=this._study.firstValue(),i=o.priceRange().convertToPercent(i,s)),r=o.priceToCoordinate(i);break;default:r=this._locationToY(t,e)}return{x:a,y:r}},v.StudyPaneView_shapemarks=function(t,e){this._study=t,this._model=e,this._data=[],this._textCache=[]},inherit(v.StudyPaneView_shapemarks,y),v.StudyPaneView_shapemarks.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_shapemarks.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)switch(this._data[e].shape){case"circle":t.append(new TradingView.CircleShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"square":t.append(new TradingView.SquareShapeMarkRenderer(this._data[e],this._textCache[e]));break;case"arrowUp":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"up"));break;case"arrowDown":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"down"));break;case"arrowRight":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"right"));break;case"arrowLeft":t.append(new TradingView.ArrowShapeMarkRenderer(this._data[e],this._textCache[e],"left"))}return t},v.StudyPaneView_shapemarks.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S;if(this._data=[],(t=this._study.graphics().shapemarks)&&(e=this._study.priceScale(),i=this._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.shapemarks[c.styleId],h.visible.value()))for(u=c.data,d=0;d<u.length;d++)if(p=u[d],!((_=o[p.time])<r||_>a)&&(f={},null!=p.time&&null!==this._study.series().bars().valueAt(_))){switch(f.color=T.generateColor(h.color.value(),h.transparency.value()),m=0,"left"===h.halign.value()?m-=i.barSpacing()/2+1:"right"===h.halign.value()&&(m+=i.barSpacing()/2+1),f.size=h.size.value(),f.shape=h.shape.value(),g=Math.round(i.indexToCoordinate(_))+m,v=p.price,e.isPercent()&&(y=this._study.firstValue(),v=e.priceRange().convertToPercent(v,y)),b=e.priceToCoordinate(v),S=h.location.value()){case CanvasEx.MARKLOC_ABSOLUTE:f.direction="";break;case CanvasEx.MARKLOC_ABSOLUTEDOWN:f.direction="down";break;case CanvasEx.MARKLOC_ABSOLUTEUP:f.direction="up";break;case CanvasEx.MARKLOC_ABOVEBAR:b=this._locationToY(S,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="up";break;case CanvasEx.MARKLOC_BELOWBAR:b=this._locationToY(S,_,Math.floor(2*f.size/i.barSpacing())+1),f.direction="down";break;default:x.logWarn("Bad location value: "+S),b=this._locationToY(CanvasEx.MARKLOC_ABSOLUTEUP,_),f.direction="up"}f.point=new s(g,b),this._data.push(f),this._textCache.push({})}},o.prototype.draw=function(t){},o.prototype.drawBackground=function(t){var e=this._data
;w(t,e.x1,e.y1,e.x2-e.x1,e.y2-e.y1,T.generateColor(this._data.color,this._data.transparency))},o.prototype.hitTest=function(t){return null},v.StudyPaneView_backgrounds=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_backgrounds.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_backgrounds.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)t.append(new o(this._data[e]));return t},v.StudyPaneView_backgrounds.prototype._hideExtendedHours=function(t){return("inSession"===t||"outOfSession"===t)&&!this._study._series.properties().extendedHours.value()},v.StudyPaneView_backgrounds.prototype._updateViewInternal=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b;if(this._data=[],(t=this._study.graphics().backgrounds)&&(e=this._model.timeScale(),(i=this._study.priceScale())&&!i.isEmpty()&&e&&!e.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),s=n.lastBar(),a=0;a<t.length;a++)if(l=t[a],c=l.styleId,h=l.data,u=this._study.properties().graphics.backgrounds[c],!this._hideExtendedHours(c)&&u.visible.value())for(_=0;_<h.length;_++)f=h[_],m={},g=o[f.start],(v=o[f.stop])<r||g>s||null!=f.start&&null!=f.stop&&(y=Math.ceil(e.indexToCoordinate(g,!0)-.5*e.barSpacing()),b=Math.ceil(e.indexToCoordinate(v,!0)+.5*e.barSpacing()),p===g-1&&(y=d),d=b,p=v,y<0&&b<0||y>e.width()&&b>e.width()||(m.x1=y,m.x2=b,m.y1=0,m.y2=i.height(),m.color=u.color.value(),m.transparency=u.transparency.value(),this._data.push(m)))},v.StudyPaneView_polygons=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_polygons.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_polygons.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new g(new b(b.REGULAR)),i.setData(this._data[e]),t.append(i);return t},v.StudyPaneView_polygons.prototype._updateViewInternal=function(){var t,e,i,o,n,r,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T;if(this._data=[],(t=this._study.graphics().polygons)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),a=n.lastBar(),l=0;l<t.length;l++)if(c=t[l],c.data&&(h=this._study.properties().graphics.polygons[c.styleId],100!==h.transparency.value()))for(u=0;u<c.data.length;u++){for(d=c.data[u],p=1/0,_=-1/0,f=0;d.points&&f<d.points.length;f++)m=o[d.points[f].index]+(d.points[f].offset||0),p=Math.min(p,m),_=Math.max(_,m);if(!(_<r||p>a)){for(g={},g.points=[],f=0;d.points&&f<d.points.length;f++)v=d.points[f],y=i.indexToCoordinate(o[v.index]+(v.offset||0)),b=v.level,e.isPercent()&&(S=this._study.firstValue(),b=e.priceRange().convertToPercent(b,S)),w=e.priceToCoordinate(b),T=new s(y,w),T.data=f,g.points.push(T);g.color=h.color.value(),g.backcolor=h.color.value(),
g.linewidth=void 0!==h.showBorder&&h.showBorder.value()?1:0,g.linestyle=CanvasEx.LINESTYLE_SOLID,g.filled=!0,g.fillBackground=!0,g.transparency=h.transparency.value(),g.mouseTouchable=h.mouseTouchable.value(),this._data.push(g)}}},v.StudyPaneView_trendchannels=function(t,e){this._study=t,this._model=e,this._data=[]},v.StudyPaneView_trendchannels.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_trendchannels.prototype.renderer=function(){var t,e,i;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,e=0;e<this._data.length;e++)i=new g(new b(b.REGULAR)),i.setData(this._data[e]),t.append(i);return t},v.StudyPaneView_trendchannels.prototype._convertToYCoord=function(t){var e=this._study.priceScale(),i=this._study.firstValue();return e.isPercent()&&(t=e.priceRange().convertToPercent(t,i)),e.priceToCoordinate(t)},v.StudyPaneView_trendchannels.prototype._updateViewInternal=function(){var t,e,i,o,n,r,l,c,h,d,p,_,f,m,g,v,y,b,S,w,T,C,x,P,L,I,k,A,M,E;if(this._data=[],(t=this._study.graphics().trendchannels)&&(e=this._study.priceScale(),i=this._study._model.timeScale(),e&&!e.isEmpty()&&i&&!i.isEmpty()))for(o=function(t,e,i,o,n,r){var l,c,h,d;return a(t,e)?[t,e]:(l=new s(0,0),c=new s(i,o),n&&(h=t.subtract(e),d=u(t,t.add(h),l,c),d?t=d:e.x=i),r&&(h=e.subtract(t),d=u(e,e.add(h),l,c),d?e=d:e.x=i),[t,e])},n=this._study.graphics().indexes,r=this._model.timeScale().visibleBars(),l=r.firstBar(),c=r.lastBar(),h=0;h<t.length;h++)if(d=t[h],d.data)for(p=this._study.properties().graphics.trendchannels[d.styleId],_=0;_<d.data.length;_++)f=d.data[_],m=n[f.startIndex],g=n[f.endIndex],Math.max(m,g)<l&&!f.extendRight||Math.min(m,g)>c&&!f.extendLeft||(v=this._convertToYCoord(f.startHighPrice),y=this._convertToYCoord(f.startLowPrice),b=this._convertToYCoord(f.endHighPrice),S=v-y,w=b-S,T=i.indexToCoordinate(m),C=i.indexToCoordinate(g),x=new s(T,v),P=new s(T,y),L=new s(C,b),I=new s(C,w),k=o(x,L,i.width(),e.height(),f.extendLeft,f.extendRight),A=o(P,I,i.width(),e.height(),f.extendLeft,f.extendRight),x=k[0],L=k[1],P=A[0],I=A[1],M={},M.points=[x,P,I,L],M.color=p.color.value(),M.backcolor=p.color.value(),M.linewidth=void 0!==p.borderWidth?p.borderWidth.value():0,M.linestyle=CanvasEx.LINESTYLE_SOLID,M.filled=!0,M.fillBackground=!0,f.transparency?(E=f.transparency+p.transparency.value(),M.transparency=Math.min(E,100)):M.transparency=p.transparency.value(),M.mouseTouchable=!0,this._data.push(M))},v.StudyPaneView_hhists=function(t,e){this._study=t,this._model=e,this._rendererData={histsByLineWidth:{},histsBySession:{}},this._textData=[],this._textRendererCache={},this._horizHistogramRenderer=new f(this._rendererData)},v.StudyPaneView_hhists.prototype.update=function(){this._invalidated=!0},v.StudyPaneView_hhists.prototype.renderer=function(){var t,e;for(this._invalidated&&(this._updateViewInternal(),this._invalidated=!1),t=new S,t.append(this._horizHistogramRenderer),e=0;e<this._textData.length;e++)t.append(new d(this._textData[e],new b(b.REGULAR)));return t},
v.StudyPaneView_hhists.prototype._resetRenderersData=function(){this._rendererData.histsByLineWidth={},this._rendererData.histsBySession={},this._textData=[],this._maxHistWidth=null},v.StudyPaneView_hhists.prototype._updateColors=function(){var t=this._study.properties().graphics.hhists.histBars,e=this._study.properties().graphics.hhists.vaBars,i=T.generateColor(t.colors[0].value(),t.transparencies[0].value()),o=T.generateColor(t.colors[1].value(),t.transparencies[1].value()),n=e?T.generateColor(e.colors[0].value(),e.transparencies[0].value()):"rgba(255, 0, 0, 1)",r=e&&e.colors[1]?T.generateColor(e.colors[1].value(),e.transparencies[1].value()):n;this._colors={histBars:[i,o],vaBars:[T.blendColors(i,n),T.blendColors(o,r)]}},v.StudyPaneView_hhists.prototype._updateViewInternal=function(){var t,e,i,o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;if(this._resetRenderersData(),t=this._study.priceScale(),e=this._model.timeScale(),t&&!t.isEmpty()&&e&&!e.isEmpty()&&(i=this._study.graphics().hhists)&&(o=this._study.graphics().indexes,n=this._model.timeScale().visibleBars(),r=n.firstBar(),s=n.lastBar(),a=i[0],l=this._study.properties().graphics.hhists[a.styleId],l.visible.value())){this._updateColors(),c=a.shortDataObj,h=a.dataObj,u=c||h;for(d in u){for(p=u[d],_=1/0,f=-1/0,m=p.length;m--;)g=p[m],_=Math.min(_,o[g.firstBarTime]),f=Math.max(f,o[g.lastBarTime]);f<r||_>s||(v=this._findMaxRate(p),this._updateDataForRenderers(p,l,t,e,o,v,d))}}},v.StudyPaneView_hhists.prototype._updateDataForRenderers=function(t,e,i,o,r,a,l){var c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,x,P,L,I,k,A,M,E=null,D=null,V={},O={},R={},B={},z=i.height(),F=i.isPercent(),N=e.percentWidth.value(),W=e.showValues.value(),$=e.location.value(),H=e.direction.value(),U=$===CanvasEx.HHISTLOC_ABSOLUTE,j=$===CanvasEx.HHISTLOC_RELATIVE,q=H===CanvasEx.HHISTDIR_LEFTTORIGHT,G=H===CanvasEx.HHISTDIR_RIGHTTOLEFT,Y=this._rendererData.histsByLineWidth,K=this._rendererData.histsBySession,Z={};for(K[l]=Z,_=0;_<t.length;_++){if(f=t[_],null==E&&(E=this._findActualRateLength(f.rate)),null==this._maxHistWidth&&(m=Math.abs(o.indexToCoordinate(r[f.firstBarTime])-o.indexToCoordinate(r[f.lastBarTime])),this._maxHistWidth=Math.max(N*m/100-E,0)),U&&q)d=o.indexToCoordinate(r[f.firstBarTime]),u=1,p="left";else if(U&&G)d=o.indexToCoordinate(r[f.lastBarTime]),u=-1,p="right";else if(j&&q)d=0,u=1,p="left";else{if(!j||!G)throw Error("Unknown location/direction values: "+$+"/"+H);d=o.width(),u=-1,p="right"}for(F?(g=this._study.firstValue(),c=i.priceRange().convertToPercent(f.priceHigh,g),h=i.priceRange().convertToPercent(f.priceLow,g)):(c=f.priceHigh,h=f.priceLow),y=0;y<E;y++)if(b={},b.y1=i.priceToCoordinate(c)+1,!(b.y1<0||(b.y2=i.priceToCoordinate(h)-1,b.y2>z))){if(D||(D=.6*(b.y2-b.y1)),W&&(void 0===V[y]?V[y]=f.rate[y]:V[y]+=f.rate[y]),W&&y===E-1&&D>=7.5){for(S={},w=this._study.formatter(),S.text="",T=0;T<E;T++)S.text=n(S.text,w.format(f.rate[T]),H),T!==E-1&&(S.text=n(S.text,"x",H));if(S.color=e.valuesColor.value(),S.font="arial",S.fontsize=D,S.horzAlign=p,S.vertAlign="middle",x=new s(d+3*u,b.y2-.61*(b.y2-b.y1)),
S.points=[x],S.offsetX=0,S.offsetY=0,this._textData.push(S),0===_&&(v=b.y2),_===t.length-1){for(P=d+3*u,L=v+.39*(b.y2-b.y1),I={text:"",color:C(e.valuesColor.value(),1.5),font:"arial",fontsize:D,horzAlign:p,vertAlign:"middle",points:[new s(P,L)],offsetX:0,offsetY:0},T=0;T<E;T++)I.text=n(I.text,w.format(V[T]),H),T!==E-1&&(I.text=n(I.text,"x",H));this._textData.push(I)}}b.x1=0===y?d:d+u*(this._maxHistWidth*f.rate[y-1]/a),b.x2=b.x1+u*(this._maxHistWidth*f.rate[y]/a),Math.abs(b.y1-O[y])<1?(R[y]?R[y].push(b.x1):R[y]=[b.x1],B[y]?B[y].push(b.x2):B[y]=[b.x2]):((R[y]||B[y])&&(R[y].push(b.x1),B[y].push(b.x2),b.x1=Math.max.apply(null,R[y]),b.x2=Math.max.apply(null,B[y]),delete R[y],delete B[y]),O[y]=b.y1,Math.abs(b.x2-b.x1)<.5||(b.x0=d,k=f.va?this._colors.vaBars[y]:this._colors.histBars[y],A=Math.round(b.y2-b.y1),Y[A]||(Y[A]={}),M=Y[A],M[k]?M[k].push(b):M[k]=[b],Z[_]?Z[_].x2<b.x2&&(Z[_].x2=b.x2):Z[_]={x1:d,x2:b.x2,y1:b.y1,y2:b.y2}))}}},v.StudyPaneView_hhists.prototype._findMaxRate=function(t){var e,i,o=0,n=0;for(e=0;e<t.length;e++){for(n=0,i=0;i<t[e].rate.length;i++)n+=t[e].rate[i];o=Math.max(o,n)}return o},v.StudyPaneView_hhists.prototype._findActualRateLength=function(t){var e,i,o=0;for(e=0;e<t.length&&(null!==(i=t[e])&&void 0!==i);++e)o++;return o},t.exports=v},function(t,e,i){"use strict";function o(t,e){return t.y1-1>e?1:t.y2+1<e?-1:0}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(86),r=i(11),s=function(){function t(t){this._data=null,this._data=t}return t.prototype.hitTest=function(t){var e,i,s,a,l,c,h,u,d,p=this._data;if(null===p)return null;if(e=Object.keys(p.histsBySession),0===e.length)return null;for(i=e.length-1;i>=0;i--){s=p.histsBySession[parseInt(e[i],10)],a=[];for(l in s)s.hasOwnProperty(l)&&a.push(s[l]);if(-1!==(c=n.bSearch(a,t.y,o))&&(h=a[c],u=Math.min(h.x1,h.x2),d=Math.max(h.x1,h.x2),t.x>=u&&t.x<=d))return new r(r.REGULAR)}return null},t.prototype.draw=function(t){var e,i,o,n,r,s,a,l,c,h,u=this._data;if(null!==u){t.save();for(e in u.histsByLineWidth)if(u.histsByLineWidth.hasOwnProperty(e)){i=parseInt(e,10),o=u.histsByLineWidth[e],n=i%2==0?.5:0,r=Math.round(i/2);for(s in o)if(o.hasOwnProperty(s)){for(t.strokeStyle=s,t.lineWidth=i*(window.hidpiCanvasRatio||1),t.beginPath(),a=o[s],l=0,c=a;l<c.length;l++)h=c[l],t.moveTo(h.x1+n,h.y1+r+n),t.lineTo(h.x2+n,h.y1+r+n);t.stroke()}}t.restore()}},t}(),e.HorizHistogramRenderer=s},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(67),s=i(15),a=function(t){function e(e,i){var o=t.call(this)||this;return o._source=e,o._data=i,o}return o.__extends(e,t),e.prototype._updateRendererData=function(t){var e,i,o,r,a,l;if(t.visible=!1,e=this._source.priceScale(),i=this._source.properties().visible.value(),e&&!e.isEmpty()&&i&&(o=this._source.properties().graphics[this._data.lineType][this._data.styleId],o.visible&&o.visible.value()&&o.showPrice&&o.showPrice.value())){if(r=this._data.line.level,e.isPercent()){if(a=this._source.firstValue(),!s.isNumber(a))return
;r=n.ensureNotNull(e.priceRange()).convertToPercent(r,a)}l=o.color.value(),t.background=l,t.color=this.generateTextColor(l),t.coordinate=e.priceToCoordinate(r),t.text=e.formatter().format(r),t.visible=!0}},e}(r.PriceAxisView),e.HLinesPriceAxisView=a},function(t,e,i){"use strict";function o(){}var n=i(54),r=n.min,s=n.max;o.prototype._locationToY=function(t,e,i){var o,n,a,l,c,h,u;switch(i||(i=0),o=[],n=this._study.priceScale(),t){case CanvasEx.MARKLOC_ABOVEBAR:a=TradingView.HIGH_PLOT;break;case CanvasEx.MARKLOC_BELOWBAR:a=TradingView.LOW_PLOT}for(l=this._study.firstValue(),i>=1&&(i-=1),c=-i;c<=i;c++)null!==(h=this._study.series().bars().valueAt(e+c))&&(u=h[a],n.isPercent()&&(u=n.priceRange().convertToPercent(u,l)),o.push(n.priceToCoordinate(u)));switch(t){case CanvasEx.MARKLOC_ABOVEBAR:return r(o)-15;case CanvasEx.MARKLOC_BELOWBAR:return s(o)+15}},t.exports=o},function(t,e,i){"use strict";(function(e){function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.$el=$(document.createElement("div")).addClass("pane-legend"),this._itemsBinding=[],this._chart.properties().paneProperties.legendProperties.showStudyTitles.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesTitle.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.listeners().subscribe(this,this.updateLayout),this._chart.properties().paneProperties.legendProperties.showStudyValues.listeners().subscribe(this,this.updateLayout);var o=this._chart.properties().scalesProperties.textColor;o.listeners().subscribe(this,function(t){this.$el.css("color",t.value())}),this.$el.css("color",o.value()),this.updateLayout()}var n=(i(35).Study,i(40).trackEvent),r=(i(7).getLogger("Chart.LegendWidget"),i(30)),s=i(136).showEditObjectDialog,a=i(107).setMouseEventHandler;o.prototype.destroy=function(){},o.prototype.contextMenuEvent=function(t,i){if(!this._model.chartModel().readOnly()&&e.enabled("legend_context_menu")){var o=i.source;this._paneWidget.showContextMenuForSource(o,t)}},o.prototype.updateLayout=function(){var t,o,n,r,s,l,c,h,u,d,p;if(this._itemsBinding.length=0,this.$el.find(".apply-common-tooltip").trigger("mouseleave"),this.$el.empty(),(t=this._paneWidget.state())&&this._model){for(o={showStudyTitles:this._model.model().properties().paneProperties.legendProperties.showStudyTitles.value(),showSeriesTitle:this._chart.properties().paneProperties.legendProperties.showSeriesTitle.value(),showSeriesOHLC:this._chart.properties().paneProperties.legendProperties.showSeriesOHLC.value(),showStudyValues:this._chart.properties().paneProperties.legendProperties.showStudyValues.value(),showLegend:this._model.model().properties().paneProperties.legendProperties.showLegend.value()},n=this._model.mainSeries(),r=t.orderedSources().slice(),s=r.indexOf(n),s>-1&&(r.splice(s,1),r.push(n)),l=r.length-1;l>=0;l--)c=r[l],
(h=c.statusView())&&(!(u=c===n)||o.showSeriesTitle||o.showSeriesOHLC||o.showStudyTitles||o.showStudyValues)&&(u&&e.enabled("fundamental_widget")||(o.showLegend||!u?(u||o.showStudyTitles||o.showStudyValues)&&o.showLegend&&(d=$("<div>").addClass("pane-legend-line pane-legend-wrap").appendTo(this.$el),d.source=c,u?(p=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Hide")+'"></a>').append($(i(924)).attr({class:"expand"})),d.addClass("main").append(p.on("click touchend",this.toggleTitles.bind(this)))):d.addClass("study"),c.properties().visible.value()||d.addClass("disabled"),this._generateItemsForRow(d,h,o),a(d,this,!0)):this.$el.find(".expand-line").length||(d=$("<div>").addClass("pane-legend-line pane-legend-wrap main expand-line").appendTo(this.$el),p=$('<a class="pane-legend-minbtn apply-common-tooltip apply" title="'+$.t("Show")+'"></a>').append($(i(923)).attr({class:"expand closed"})),d.append(p.on("click touchend",this.toggleTitles.bind(this))),d.source=c,o={showStudyTitles:!1,showSeriesTitle:!1,showSeriesOHLC:o.showSeriesOHLC,showStudyValues:!1},this._generateItemsForRow(d,h,o),a(d,this,!0),this.update())));this.update()}},o.prototype._generateItemsForRow=function(t,o,n){var r,s,a,l,c,h,u,d,p,_,f,m=t.source,g=this,v=m===this._model.mainSeries();if((v&&n.showSeriesTitle||!v&&n.showStudyTitles)&&(r=$("<span>"),r.addClass("pane-legend-line apply-overflow-tooltip"),e.enabled("legend_context_menu")&&!this._chart.readOnly()||r.addClass("no-context-menu"),v&&r.addClass("main"),m.properties().visible.value()||r.addClass("disabled"),r.css({"font-weight":o.bold()?"bold":"normal","font-size":o.size()}),r.click(function(e){g.contextMenuEvent(e,t)}),r.appendTo(t),this._itemsBinding.push({value:o,cell:r,source:t.source}),!this._chart.readOnly()&&m.userEditEnabled()&&e.enabled("edit_buttons_in_legend")&&(s=$('<span class="pane-legend-icon-container">').appendTo(t),e.enabled("show_hide_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip icon-hide" title="'+$.t("Show/Hide")+'">').append($(i(925)).attr({width:14,height:14})).appendTo(s).on("click touchend",this._generateItemsForRow._onShowhideClick.bind(this,m)),e.enabled("property_pages")&&(!v||e.enabled("show_chart_property_page")&&!this._chart.onWidget())&&e.enabled("format_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip format" title="'+$.t("Format")+'">').append($(i(926)).attr({width:14,height:14})).appendTo(s).on("click touchend",this._generateItemsForRow._onFormatClick.bind(this,m)),!v&&e.enabled("delete_button_in_legend")&&$('<a class="pane-legend-icon apply-common-tooltip delete" title="'+$.t("Delete")+'">').append($(i(352)).attr({width:14,height:14})).appendTo(s).on("click touchend",this._generateItemsForRow._onDeleteClick.bind(this,m)))),a=m.dataWindowView(),this.isDataWindowValuesVisible(a)&&(v&&n.showSeriesOHLC||!v&&n.showStudyValues)){for(l=[],c=[],h=$('<div class="pane-legend-item-value-container">'),e.enabled("legend_context_menu")||h.addClass("no-context-menu"),
u=0;u<a.items().length;u++)d=$("<span class='pane-legend-item-value-wrap'>").appendTo(h),p=v?$("<span class='pane-legend-item-value-title pane-legend-line'>").appendTo(d):null,_=$("<span class='pane-legend-item-value pane-legend-line'>").appendTo(d),v&&(p.addClass("pane-legend-item-value-title__main"),_.addClass("pane-legend-item-value__main")),m.properties().visible.value()||(_.addClass("disabled"),p&&p.addClass("disabled")),l.push(_),p&&c.push(p);f=$("<span class='pane-legend-item-additional pane-legend-line'>").appendTo(h.appendTo(t)),this._itemsBinding.push({value:a,cell:l,titleCells:c.length?c:null,source:m,additional:f})}},o.prototype.isDataWindowValuesVisible=function(t){return this._chart.onWidget()?!!t&&!this._chart.isSmall():!!t},o.prototype._generateItemsForRow._onShowhideClick=function(t){this._model.setProperty(t.properties().visible,!t.properties().visible.value(),"Show/Hide "+t.title())},o.prototype._generateItemsForRow._onFormatClick=function(t,e){t.userEditEnabled()&&(TVSettings.setValue("properties_dialog.active_tab.chart",$.t("Style")),s(t,this._model))},o.prototype._generateItemsForRow._onDeleteClick=function(t){t.isUserDeletable()&&(t.hasChildren()?showDeleteStudyTreeConfirm(this._model.removeSource.bind(this._model,t)).open():this._model.removeSource(t))},o.prototype._generateItemsForRow._onAddChildSourceClick=function(t){var e,i,o=this._chart.showIndicators(t);o&&(e=function(){n("SOS","Apply SOS","Apply by Plus SOS")},i=this._model.model().studyInserted(),i.subscribe(this,e),o.visibilityChanged.subscribe(this,function(t){t||i.unsubscribe(this,e)},!0))},o.prototype._generateItemsForRow._onViewSorceClick=function(t){var e=t.metaInfo();this._getPineSourceCode(e).done(function(t){TradingView.bottomWidgetBar&&TradingView.bottomWidgetBar.activateScriptEditorTab(t)})},o.prototype._getPineSourceCode=function(t){return $.Deferred()},o.prototype.setItemEnabled=function(t,e){var i=!t.hasClass("disabled"),o=t.closest(".pane-legend-wrap");e&&!i?(t.removeClass("disabled"),o.removeClass("disabled")):!e&&i&&(t.addClass("disabled"),o.addClass("disabled"))},o.prototype.valueChanged=function(t,e,i){return t[e]!==i&&(t[e]=i,!0)},o.prototype.firstTitle=function(){return this.$el.find(".pane-legend-line.pane-legend-wrap:first-child")},o.prototype.updateTitle=function(){var t,i,o,n,r,s,a,l,c,h;for(o=this._itemsBinding.length;o--;)i=this._itemsBinding[o],Array.isArray(i.cell)||(i.last||(i.last={}),n=i.last,r=i.source,t=r.properties().visible.value(),this.valueChanged(n,"sourceVisible",t)&&this.setItemEnabled(i.cell,t),s=i.value.color(),a=r!==this._model.mainSeries()&&r===this._model.selectedSource()?"bold":"normal",l=i.value.text(),e.enabled("fundamental_widget")&&(c=this._model.mainSeries(),h=c.symbolInfo(),l=(h?h.name:c.actualSymbol())+" "+l),(this.valueChanged(n,"color",s)||this.valueChanged(n,"fontWeight",a)||this.valueChanged(n,"text",l))&&i.cell.text(TradingView.clean(l,!0)).css({color:s,"border-color":s,"font-weight":a}));this._chart.resizeIndicator()},o.prototype.update=function(t){var e,i,o,n,s,a,l,c,h,u
;for(this.updateTitle(),c=this._itemsBinding.length;c--;)if(n=this._itemsBinding[c],e=n.cell,i=n.titleCells,o=n.source.properties().visible.value(),Array.isArray(e)){for(n.last||(n.last={},n.last.dwView||(n.last.dwView={})),h=n.last,s=n.value.items(),u=this.valueChanged(h,"sourceVisible",o),a=0;a<e.length;a++)l=s[a],h[a]||(h[a]={}),u&&this.setItemEnabled(e[a],o),this.valueChanged(h[a],"text",l.text())&&(e[a][0].textContent=l.text()),l.color()&&this.valueChanged(h[a],"color",l.color())&&e[a].css("color",r.resetTransparency(l.color())),i&&(this.valueChanged(h,"sourceVisible",o)&&this.setItemEnabled(i[a],o),this.valueChanged(h[a],"title",l.title())&&(i[a][0].textContent=l.title()));n.additional&&n.value.additional&&this.valueChanged(h,"additional",n.value.additional())&&n.additional.text(n.value.additional()||"")}this._chart.resizeIndicator()},o.prototype.dataSourceAtPoint=function(t,e){return null},o.prototype.renderTo=function(t,e,i){var o,n,r,s,a,l,c;for(t.save(),t.fillStyle=this._chart.properties().scalesProperties.textColor.value(),t.textBaseline="middle",o=0,n=0;n<this._itemsBinding.length;++n)r=this._itemsBinding[n],s=r.value,a=r.source===this._model.mainSeries(),l=a?12:8,c=a?25:17,Array.isArray(r.cell)||(t.font=s.size()+" Verdana, Arial",t.fillText(s.text(),e,i+o+l),o+=c);t.restore()},o.prototype.toggleTitles=function(t){this._model.model().properties().paneProperties.legendProperties.showLegend.setValue(!this._chart.properties().paneProperties.legendProperties.showLegend.value());for(var e=this._chart._paneWidgets.length-1;e>=0;e--)this._chart._paneWidgets[e].legendWidget.updateLayout()},t.exports=o}).call(e,i(5))},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zM6 2v4H2v1h4v4h1V7h4V6H7V2H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 13" width="13" height="13"><path d="M1 0v1h11V0H1zm11 1v11h1V1h-1zm0 11H1v1h11v-1zM1 12V1H0v11h1zm1-6v1h9V6H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2.69c3.018 0 5.172 3.232 5.172 4.31 0 1.077-2.154 4.31-5.172 4.31S1.828 8.08 1.828 7c0-1.077 2.154-4.31 5.172-4.31zm0 1.508C5.49 4.198 4.198 5.49 4.198 7S5.49 9.802 7 9.802 9.802 8.51 9.802 7 8.51 4.198 7 4.198zm0 1.68c.646 0 1.12.476 1.12 1.122 0 .646-.473 1.12-1.12 1.12-.646 0-1.12-.473-1.12-1.12 0-.646.473-1.12 1.12-1.12z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-2.4 120.9 14 14" width="14" height="14" enable-background="new -2.4 120.9 600 600"><path d="M-2.4 120.9v14h14v-14zm6.086 1.803H5.52v1.332c.416.1.805.258 1.166.48l.944-.935 1.297 1.297-.943.943c.215.35.38.748.48 1.164H9.8v1.837H8.463c-.1.417-.257.806-.48 1.167l.935.944-1.296 1.298-.944-.943c-.35.215-.747.38-1.164.48v1.332H3.677v-1.33c-.415-.102-.804-.258-1.165-.482l-.943.936-1.298-1.296.94-.945c-.216-.35-.38-.748-.482-1.165H-.597v-1.835H.737c.1-.416.257-.805.48-1.166l-.935-.944 1.296-1.297.944.943c.35-.215.747-.38 1.164-.48zm.912 3.053c-1.188 0-2.143.963-2.143 2.143 0 1.187.963 2.143 2.143 2.143 1.18 0 2.14-.963 2.145-2.145 0-1.188-.966-2.144-2.145-2.144z"/></svg>'},function(t,e){},function(t,e,i){"use strict";function o(t){return null==t._parentMenu?null:n(t._parentMenu)}function n(t){return null==t._parentMenuItem?t:o(t._parentMenuItem)}function r(t,e){this.action=t,this._parentMenu=e}function s(t,e){this.action=t,this._parentMenu=e}var a=i(354),l=i(231);r.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},r.prototype._createDeleteButton=function(){var t,e,i;if(!this.action.deleteButton)return null;t=this,e=this.action.deleteButton.action,i=l.create("span",{class:"context-menu-delete-button"}),e&&i.click(function(){return e.call(t),!1}),this.jqSubmenu.addClass("delete-spacer"),this.jqSubmenu.append(i)},r.prototype._createTextTag=function(){var t=this._textTagAttributes();return this.jqText=l.create(a.TEXT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqText},r.prototype._createRightTag=function(){var t=this._rightTagAttributes();return this.jqRight=l.create(a.RIGHT_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqRight},r.prototype._createSubmenuTag=function(){var t=this._submenuTagAttributes();return this.jqSubmenu=l.create(a.SUBMENU_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqSubmenu},r.prototype._iconTagAttributes=function(){var t={},e=[];return this.action&&(this.action.icon?(e.push("icon"),e.push(this.action.icon.replace(/\./,"_"))):this.action.checkable?(e.push("icon"),this.action.checked?(e.push("checked-icon"),t.html=i(146)):e.push("unchecked-icon")):e.push("spacer")),t.class=e.join(" "),t},r.prototype._textTagAttributes=function(){return{class:"text",html:this.action?this.action.text:""}},r.prototype.highlight=function(t){t?(this.jqRow.addClass("context-menu-hover"),this.jqIcon.addClass("context-menu-hover")):(this.jqRow.removeClass("context-menu-hover"),this.jqIcon.removeClass("context-menu-hover")),this.action&&this.action.hasSubActions()&&(t?this.jqSubmenu.addClass("expanded"):this.jqSubmenu.removeClass("expanded"))},r.prototype._rightTagAttributes=function(){var t={},e=["right"];return this.action&&this.action.shortcut&&(e.push("shortcut"),t.class=e.join(" "),t.html=this.action.shortcut),t},r.prototype._submenuTagAttributes=function(){var t={}
;return this.action&&this.action.hasSubActions()?t.class="submenu-arrow":t.class="context-menu spacer",t},r.prototype.render=function(){this._createRow(),this.jqRow.append(this._createIconTag()),this.jqRow.append(this._createTextTag()),this.jqRow.append(this._createRightTag()),this.jqRow.append(this._createSubmenuTag()),this._createDeleteButton(),this.appendCallback();var t=this;return this.jqRow.mouseenter(function(e){t.showSubmenu(e),t.highlight(!0),t._parentMenu&&t._parentMenu._parentMenuItem&&t._parentMenu._parentMenuItem.highlight(!0)}),this.jqRow.mouseleave(function(){t.highlight(!1)}),this.jqRow},r.prototype._createRow=function(){var t,e,i=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,i),this.jqRow.addClass("context-menu"),t=this,this.action&&!this.action.hasSubActions()&&(e=function(t){t.destroy(),t._parentMenuItem&&e(t._parentMenuItem._parentMenu)},this.jqRow.click(function(i){e(t._parentMenu)}))},r.prototype.showSubmenu=function(t){var e,o;this._parentMenu.closeOtherSubmenus(this),this.action&&!this.action.hasSubActions()||(this._menu||(e=i(108),o={},this._menu=e.createMenu(this.action.subActions,o,this)),t.pageX=this._parentMenu.jqMenu.width()-2,t.pageY=this.jqSubmenu.offset().top-this._parentMenu.jqMenu.offset().top-1,this._menu.show(t,this._parentMenu.jqMenu))},r.prototype._rowTagAttributes=function(){var t=[];return this.action&&(!1===this.action.enabled&&t.push("disabled"),!1===this.action.visible&&t.push("hidden"),this.action.font&&t.push("font_"+this.action.font),this.action.hasSubActions()&&t.push("has_submenu"),this.action.htmlclass&&t.push(this.action.htmlclass)),{class:t.join(" ")}},r.prototype.appendCallback=function(){var t=this;this.jqRow.click(function(e){t.action.enabled&&t.action.executeCallback(e)})},r.prototype.getTopLevelMenu=function(){return o(this)},s.prototype.render=function(t){this._createRow();var e=this;return this.action.deferred.then(function(o){var n,r,s,a=i(353);for(n in o)r=o[n],s=e._parentMenu.addItem(r),a.renderItem(t,s)}).always(function(){e.jqRow.hide()}),this.jqRow},s.prototype._createIconTag=function(){var t=this._iconTagAttributes();return this.jqIcon=l.create(a.ICON_CELL_TAG,t),this.jqIcon.addClass("context-menu"),this.jqIcon},s.prototype._createRow=function(){var t=this._rowTagAttributes();this.jqRow=l.create(a.ITEM_ROW_TAG,t),this.jqRow.append(this._createIconTag()),this.jqRow.addClass("context-menu")},s.prototype._rowTagAttributes=function(){var t=[];return this.action&&t.push("spinner"),{class:t.join(" ")}},s.prototype.highlight=function(t){},s.prototype._iconTagAttributes=function(){var t={},e=[];return e.push("spacer"),t.class=e.join(" "),t.colspan="10",t},e.Item=r,e.ItemPlaceholder=s},function(t,e,i){"use strict";var o=i(231),n=i(107).setMouseEventHandler,r={};r.createLabel=function(t,e,i){return o.create("label",$.extend(i,{html:e,for:t}))},r.unbindContextMenu=function(t){t.contextMenu(function(t){return!1})},r.offsetX=function(t,e){return t.width()+e.pageX},r.offsetY=function(t,e){return t.height()+e.pageY},r.isElementInViewport=function(t){
"function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]);var e=t.getBoundingClientRect();return e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth)},r.isVisible=function(t,e,i){var o,n,r;for("function"==typeof jQuery&&t instanceof jQuery&&(t=t[0]),o=.01,e||(e=1),i||(i=1),n=t.getBoundingClientRect(),r=[];t.parentElement;)r.push(t.parentElement.getBoundingClientRect()),t=t.parentElement;return r.every(function(t){var r=Math.min(n.right,t.right)-Math.max(n.left,t.left),s=Math.min(n.bottom,t.bottom)-Math.max(n.top,t.top),a=r/n.width*100,l=s/n.height*100;return a+o>e&&l+o>i})},r.checkObjIsOutOfWindowX=function(t,e){var i,o=$(window).width()-r.offsetX(t,e);return o<0?(i=e.pageX+o,i>0?i:0):e.pageX},r.checkObjIsOutOfWindowY=function(t,e){var i,o=$(window).height()-r.offsetY(t,e);return o<0?(i=e.pageY+o,i>0?i:0):e.pageY},r.checkObjIsOutOfWindow=function(t,e){return{left:r.checkObjIsOutOfWindowX(t,e),top:r.checkObjIsOutOfWindowY(t,e)}},r.setAttr=function(t,e,i){return t.attr?t.attr(e,i):t[e]=i,t},r.removeAttr=function(t,e){return t.removeAttr?t.removeAttr(e):t.removeAttribute(e),t},r.notNull=function(t){return-1===$.inArray(t,[null,void 0,"false","null","undefined",0])},r.hideControl=function(t){return t.css({position:"absolute",top:-1e3,left:-1e3})},r.createPopup=function(t,e,i){return new r.Popup(t,e,i).render()},r.Popup=function(t,e,i){if(void 0!==t.selector?this.jqDiv=t:t.nodeType?this.jqDiv=$(t):this.jqDiv=o.create("div",t),i){var r=this;$.each(i,function(t,e){r[t]=e})}n(this.jqDiv,this),this._callback=e},r.Popup.prototype.render=function(){return this.jqDiv},r.Popup.prototype.show=function(){this.jqDiv.show()},r.Popup.prototype.hide=function(){this.jqDiv.hide()},r.Popup.prototype.setVisible=function(t){t?this.show():this.hide()},r.Popup.prototype.isVisible=function(){return this.jqDiv.is(":visible")},r.Popup.prototype.contextMenuEvent=function(t){return!1},r.Popup.prototype.mouseDownOutsideEvent=function(t){if(this.isVisible()){if(this._callback&&!this._callback())return;this.hide()}},t.exports=r},function(t,e,i){"use strict";(function(e){function o(t,e,i,o){this.reset(t,e,i,o)}var n=i(156).makeFont,r=i(155),s=e.enabled("charting_library_debug_mode");o.prototype.maxCount=200,o.prototype.reset=function(t,e,i,o){this._textWidthCache=new r(this.maxCount),this._fontSize=t,this._color=o,this._font=n(t,e,i),this._keys=[],this._hash={}},o.prototype.paintTo=function(t,e,i,o,n){var r=this.getLabelImage(t,e);"left"!==n&&(i-=r.textWidth),o-=Math.floor(r.height/2),t.drawImage(r.canvas,i,o)},o.prototype.getLabelImage=function(t,e){var i,o,n,r,a;return Object.prototype.hasOwnProperty.call(this._hash,e)?i=this._hash[e]:(this._keys.length>=this.maxCount&&(o=this._keys.shift(),delete this._hash[o]),i={text:e,textWidth:0,width:0,height:0,canvas:document.createElement("canvas")},n=Math.ceil(this._fontSize/4.5),r=Math.round(this._fontSize/10),a=Math.ceil(this._textWidthCache.measureText(t,e)),i.textWidth=Math.round(Math.max(1,a)),
i.width=Math.round(a+2*n),i.height=this._fontSize+2*n,0!==a?(this._keys.push(i.text),this._hash[i.text]=i):s&&console.log('Canvas 2d context measureText return zero width for "'+e+'" text'),i.canvas.width=i.width,i.canvas.height=i.height,t=i.canvas.getContext("2d"),t.font=this._font,t.fillStyle=this._color,t.fillText(e,0,i.height-n-r)),i},t.exports=o}).call(e,i(5))},function(t,e,i){"use strict";function o(t,e,i){this._model=e,this._paneWidget=t,this._chart=t._chart,this._mainDiv=i,this.jqDiv=$('<div class="pane-controls">'),this._initVisibility(),this.update(),this.jqDiv.appendTo(i)}var n=i(248);o.prototype.update=function(){var t,e,o,n,r,s,a,l;if(!this._visible||!this._chart.isActive())return void this.jqDiv[0].classList.add("pane-controls--hidden");if(this.jqDiv[0].classList.remove("pane-controls--hidden"),t=this,e=t._model,o=t._paneWidget.state(),n=e.panes().indexOf(o),this.jqDiv.toggleClass("toppane",0===n||this._chart.isMaximizedPane()),r=!1,!o.containsMainSeries()&&!this._chart.isMaximizedPane()){for(s=0,a=o.dataSources(),l=a.length;l--;)if(a[l]instanceof TradingView.Study&&++s>1){r=!0;break}a=null}n>0&&!this._chart.isMaximizedPane()?(this._$upButton||(this._$upButton=$(document.createElement("a")).addClass("pane-legend-icon up").append($(i(932)).attr({width:14,height:14})).attr("title",$.t("Move Up")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"up")})),this._$upButton.appendTo(this.jqDiv)):this._$upButton&&this._$upButton.detach(),n<this._model.panes().length-1&&!this._chart.isMaximizedPane()?(this._$downButton||(this._$downButton=$(document.createElement("a")).addClass("pane-legend-icon down").append($(i(933)).attr({width:14,height:14})).attr("title",$.t("Move Down")).on("click",function(){t._model.rearrangePanes(t._chart,t._model.panes().indexOf(t._paneWidget.state()),"down")})),this._$downButton.appendTo(this.jqDiv)):this._$downButton&&this._$downButton.detach(),r?(this._$closeButton||(this._$closeButton=$(document.createElement("a")).addClass("pane-legend-icon delete").append($(i(352)).attr({width:14,height:14})).attr("title",$.t("Delete")).on("click",function(){t._model.removePane(t._chart,t._model.panes().indexOf(t._paneWidget.state()))})),this._$closeButton.appendTo(this.jqDiv)):this._$closeButton&&this._$closeButton.detach(),this._model.panes().length>1&&!this._chart.isMaximizedPane()?(this._$maximizeButton||(this._$maximizeButton=$(document.createElement("a")).addClass("pane-legend-icon maximize").append($(i(934)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){t._chart.toggleMaximizePane(t._paneWidget)})),this._$maximizeButton.appendTo(this.jqDiv)):this._$maximizeButton&&this._$maximizeButton.detach(),this._model.panes().length>1&&this._chart.isMaximizedPane()?(this._$restoreButton||(this._$restoreButton=$(document.createElement("a")).addClass("pane-legend-icon restore").append($(i(935)).attr({width:14,height:14})).attr("title",$.t("Toggle Maximize Pane")).on("click",function(){
t._chart.toggleMaximizePane(t._paneWidget)})),this._$restoreButton.appendTo(this.jqDiv)):this._$restoreButton&&this._$restoreButton.detach()},o.prototype.destroy=function(){this._visibilityProperty&&(this._visibilityProperty.unsubscribe(this,this._onVisibilityPropertyChange),this._visibilityProperty=null),this._boundMouseHandler&&(this._mainDiv[0].removeEventListener("mouseenter",this._boundMouseHandler,!1),this._mainDiv[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),this.jqDiv.remove()},o.prototype._initVisibility=function(){this._visible=!0,this._visibilityProperty=n.actualBehavior(),this._visibilityProperty.subscribe(this,this._onVisibilityPropertyChange),this._onVisibilityPropertyChange()},o.prototype._onVisibilityPropertyChange=function(){var t=this._visibilityProperty.value();"alwaysOn"===t||"alwaysOff"===t?(this._visible="alwaysOn"===t,this._boundMouseHandler&&(this._mainDiv[0].removeEventListener("mouseenter",this._boundMouseHandler),this._mainDiv[0].removeEventListener("mouseleave",this._boundMouseHandler),this._boundMouseHandler=null)):(this._boundMouseHandler||(this._boundMouseHandler=this._visibilityMouseHandler.bind(this),this._mainDiv[0].addEventListener("mouseenter",this._boundMouseHandler),this._mainDiv[0].addEventListener("mouseleave",this._boundMouseHandler)),this._visible=!1),this.update()},o.prototype._visibilityMouseHandler=function(t){this._visible="mouseenter"===t.type,this.update()},t.exports=o},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 2l2.8 3H8v6H6V5H4.2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M14 14V0H0v14zm-7-2L4.2 9H6V3h2v6h1.8z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0zm7 1l2.8 3H8v2.5H6V4H4.2zM6 7.5h2V10h1.8L7 13l-2.8-3H6z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14" width="14" height="14"><path d="M0 0v14h14V0H0zm6 1.5h2V4h1.8L7 7l2.8 3H8v2.5H6V10H4.2L7 7 4.2 4H6V1.5z"/></svg>'},function(t,e,i){"use strict";function o(t,e,i){this.chart=t,this.paneA=t.paneWidgets()[e],this.paneB=t.paneWidgets()[i],this.jqRow=$(document.createElement("tr")),this.jqRow.height(o.HEIGHT),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("pane-separator"),this.jqCell.attr("colspan","3"),this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value()),this.jqCell.click(function(){}),this.handle=$('<div class="handle">').appendTo(this.jqCell),r(this.handle,this)}var n,r;i(937),n=i(54).clamp,r=i(107).setMouseEventHandler,o.HEIGHT=1,o.prototype.hide=function(){this.jqRow.addClass("js-hidden")},o.prototype.show=function(){this.jqRow.removeClass("js-hidden")},o.prototype.mouseDownEvent=function(t){(0===t.button||Modernizr.touch)&&(this.startY=t.pageY,this.deltaY=0,
this.totalHeight=this.paneA.size.h+this.paneB.size.h,this.totalStretch=this.paneA.stretchFactor()+this.paneB.stretchFactor(),this.prevStretchA=this.paneA.stretchFactor(),this.minPaneHeight=30,this.maxPaneHeight=this.totalHeight-this.minPaneHeight,this.pixelStretchFactor=this.totalStretch/this.totalHeight)},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o,r;(0===t.button||Modernizr.touch)&&(t.preventDefault(),this.deltaY=t.pageY-this.startY,e=this.paneA.size.h,i=n(e+this.deltaY,this.minPaneHeight,this.maxPaneHeight),o=i*this.pixelStretchFactor,r=this.totalStretch-o,this.paneA.setStretchFactor(o),this.paneB.setStretchFactor(r),this.chart._adjustSize(),this.paneA.size.h!==e&&(this.startY=t.pageY),this.chart.paint())},o.prototype.mouseUpEvent=function(t){(0===t.button||Modernizr.touch)&&(this.chart._model.addPaneStretchFactorUndoCommand(this.paneA._state,this.paneB._state,this.prevStretchA,this.paneA.stretchFactor()),this.startY=0,this.deltaY=0,this.totalHeight=0,this.totalStretch=0,this.minPaneHeight=0,this.maxPaneHeight=0,this.pixelStretchFactor=0)},o.prototype.update=function(){this.jqCell.css("background",this.chart.properties().scalesProperties.lineColor.value())},o.prototype.paint=function(){},o.prototype.image=function(){var t={},e=o.HEIGHT,i=this.paneA.lhsPriceAxisWidget.size.w,n=this.paneA.size.w,r=this.paneA.rhsPriceAxisWidget.size.w,s=$('<canvas width="'+i+'" height="'+e+'">')[0],a=s.getContext("2d");return a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,i,e),t.leftAxis={content:s.toDataURL(),contentWidth:i,contentHeight:e},s=$('<canvas width="'+n+'" height="'+e+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,n,e),t.content=s.toDataURL(),t.contentWidth=n,t.contentHeight=e,s=$('<canvas width="'+r+'" height="'+e+'">')[0],a=s.getContext("2d"),a.fillStyle=this.chart.properties().scalesProperties.lineColor.value(),a.fillRect(0,0,r,e),t.rightAxis={content:s.toDataURL(),contentWidth:r,contentHeight:e},t},t.exports=o},function(t,e){},function(t,e,i){"use strict";function o(t,e,o,r,s,a,l,c,h,u){var d=i(939).ChartUndoModel,p=new d(t,e,o,r,s,a,l,c,h,u);return p.model().invalidate(new n(n.FULL_UPDATE)),p}var n=i(22),r=i(33);TradingView.MAMetaInfo=function(){return new r({id:"MASimple",inputs:[{id:"length",type:"integer",defval:10},{id:"source",type:"text",defval:"close"}],plots:[{id:"MovAvg",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"true"}],palettes:{}})},TradingView.VolumeMetaInfo=function(){var t={id:"Volume",inputs:[],plots:[{id:"Volume",type:"histogram"},{id:"Color",type:"colorer",palette:"volumePalette",target:"Volume"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{volumePalette:{colors:{0:{color:"#007F0E",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Up Volume"},1:{color:"#872323",width:1,style:CanvasEx.LINESTYLE_SOLID,name:"Down Volume"}}}}};return new r(t)},TradingView.DMMetaInfo=function(){return new r({id:"DM",inputs:[{id:"ADX smoothing",max:50,min:1,
type:"integer",defval:14},{id:"DI Length",max:500,min:1,type:"integer",defval:14}],plots:[{id:"ADX",type:"line"},{id:"DI_P",type:"line"},{id:"DI_N",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},TradingView.RSIMetaInfo=function(){return new r({id:"RSI",inputs:[{id:"length",type:"integer",defval:14}],plots:[{id:"RelativeStrengthIndex",type:"line"}],properties:[{id:"is_price_study",type:"bool",value:"false"}],palettes:{}})},t.exports=o},function(t,e,i){"use strict";(function(t){function o(e,i,o,n,r,s,a,l,c,h){this._chartWidget=l,this.m_model=new q(e,i,o,n,r,s,a,this,!!l._containsData,h),this.m_zoomStack=new st,this.undoHistory=c,this._onRearrangePanes=new t,this._onSimpleZoomIn=new t,this._onSimpleZoomOut=new t,this._currentCustomMoveSource=null,this.beginUndoMacro=c.beginUndoMacro.bind(c),this.endUndoMacro=c.endUndoMacro.bind(c),this.createUndoCheckpoint=c.createUndoCheckpoint.bind(c),this.undoToCheckpoint=c.undoToCheckpoint.bind(c)}function n(t,e,i,o){at.call(this,i),this._targetObj=t,this._newValue=e,this._model=o}function r(t,e,i,o,n){at.call(this,o),this._property=t,this._priceScale=i,this._newValue=e,this._model=n}function s(t,e,i,o,n){at.call(this,o),this._percentage=t,this._priceScale=i,this._newValue=e,this._model=n}function a(t,e,i,o,n){at.call(this,o),this._log=t,this._priceScale=i,this._newValue=e,this._model=n}function l(t,e,i,o,n,r){at.call(this,o),this._style=t,this._mainSeries=i,this._priceAxisProperties=i.properties().priceAxisProperties,this._newValue=e,this._model=n,this._chartWidget=r}function c(t,e,i,o,n,r){at.call(this,o),this._property=t,this._mainSeries=i,this._priceScale=i.priceScale(),this._newValue=e,this._model=n,this._invalidateType=r}function h(t,e,i,o){at.call(this,"scale price",!1),this.m_model=t,this.m_pane=e,this.m_priceScale=i,this.m_state=o,this.m_newPriceScaleState=null}function u(t,e,i){at.call(this,i,!1),this.setCustomFlag("doesnt_affect_save",!0),this.m_model=t,this.m_state=e,this.m_newTimeScaleState=null}function d(t,e,i,o){this._model=t,this._series=e,this._oldSymbol=e.symbol(),this._oldInterval=e.interval(),this._symbol=i,this._interval=o}function p(t,e,i,o,n){at.call(this,"Insert "+e.id),this._model=t,this._studyMetaInfo=e,this._props=i,this._isOverlay=o,this._parentSource=n,this._oldShowLeftScale=t.isLeftPriceScaleVisible(),this._oldShowRightScale=t.isRightPriceScaleVisible()}function _(t,e){at.call(this,"Remove Source"),this._model=t,this._sourceId=e.id()}function f(t,e){at.call(this,"Remove Drawing(s)"),this._model=t,this._linetools=e,this._statesByPaneIndexes={}}function m(t,e,i,o){this._model=t,this._oldPane=this._model.paneForSource(e),at.call(this,this._oldPane===i?"Change Price Scale":"Move Source"),this._sourceId=e.id(),this._oldPaneIndex=t.panes().indexOf(this._oldPane),this._oldScaleName=this._oldPane.priceScaleName(e.priceScale()),this._oldShowLeftScale=t.isLeftPriceScaleVisible(),this._oldShowRightScale=t.isRightPriceScaleVisible(),this._pane=i,this._paneIndex=t.panes().indexOf(i),
this._pane?this._scaleName=this._pane.priceScaleName(o):this._paneIndex=t.panes().length}function g(t,e,i){this._model=t,this._sourceId=e.id(),this._oldShowLeftScale=t.isLeftPriceScaleVisible(),this._oldShowRightScale=t.isRightPriceScaleVisible(),at.call(this,i)}function v(t,e){g.call(this,t,e,"Merge Up"),this._mergeRedoFn=this._model.mergeSourceUp,this._mergeUndoFn=this._model.unmergeSourceDown}function y(t,e){g.call(this,t,e,"Merge Down"),this._mergeRedoFn=this._model.mergeSourceDown,this._mergeUndoFn=this._model.unmergeSourceUp}function b(t,e){g.call(this,t,e,"Unmerge Up"),this._mergeRedoFn=this._model.unmergeSourceUp,this._mergeUndoFn=this._model.mergeSourceDown}function S(t,e){g.call(this,t,e,"Unmerge Down"),this._mergeRedoFn=this._model.unmergeSourceDown,this._mergeUndoFn=this._model.mergeSourceUp}function w(t,e,i){at.call(this,"Create line "+i,!1),this._model=t,this._paneIndex=t.panes().indexOf(e),this._lineTool=i}function T(t,e,i,o){at.call(this,"Move Drawing",!1),this._model=t,this._sourceId=e.id(),this._origPoint=i instanceof W?i.clone():TradingView.clone(i),this._pointIndex=o}function C(t,e,i){at.call(this,"Change %1 Z order (%2)".format(e.title(),i>0?"Forward":"Backward")),this._model=t,this._sourceId=e.id(),this._shift=i}function x(t,e){at.call(this,"Send "+e.title()+" to back"),this._model=t,this._sourceId=e.id()}function P(t,e){at.call(this,"Bring "+e.title()+" to front"),this._model=t,this._sourceId=e.id()}function L(t,e,i){at.call(this,"Remove pane"),this._model=t,this._index=e,this._pane=this._model.panes()[e],this._chart=i}function I(t,e,i,o){at.call(this,"Rearrange panes"),this._model=t,this._index=e,this._direction=i,this._chart=o}function k(t,e,i,o,n,r){at.call(this,"Zoom"),this._model=t,this._startBar=e,this._endBar=i,this._startPrice=o,this._endPrice=n,this._pane=r}function A(t,e,i){at.call(this,"Zoom"),this._baseCmd=t,this._zoomStack=e,this._inOut=i}function M(t,e,i,o,n){at.call(this,"",!1),this._model=t,this._paneA=e,this._paneB=i,this._prevStretchA=o,this._currStretchA=n}function E(t,e){at.call(this,"Apply Chart Theme"),this._model=t,this._newChartProps=TradingView.factoryDefaults("chartproperties"),this._newSeriesProps=TradingView.factoryDefaults("chartproperties.mainSeriesProperties"),["candleStyle","hollowCandleStyle","haStyle"].forEach(function(t){e.mainSourceProperties[t].wickUpColor=e.mainSourceProperties[t].wickUpColor||e.mainSourceProperties[t].wickColor,e.mainSourceProperties[t].wickDownColor=e.mainSourceProperties[t].wickDownColor||e.mainSourceProperties[t].wickColor}),e.chartProperties.paneProperties.vertGridProperties=e.chartProperties.paneProperties.vertGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.horzGridProperties=e.chartProperties.paneProperties.horzGridProperties||e.chartProperties.paneProperties.gridProperties,e.chartProperties.paneProperties.legendProperties=this._model.properties().state().paneProperties.legendProperties,this._newChartProps=$.extend(!0,{},this._newChartProps,e.chartProperties),
delete this._newChartProps.scalesProperties.showLeftScale,delete this._newChartProps.scalesProperties.showRightScale,delete this._newChartProps.scalesProperties.scaleSeriesOnly,delete this._newChartProps.scalesProperties.showSeriesLastValue,delete this._newChartProps.scalesProperties.showStudyLastValue,delete this._newChartProps.scalesProperties.showSymbolLabels,delete this._newChartProps.scalesProperties.showStudyPlotLabels,this._newSeriesProps=$.extend(!0,{},this._newSeriesProps,e.mainSourceProperties),this._newChartProps.symbolWatermarkProperties||(this._newChartProps.symbolWatermarkProperties=defaults("chartproperties.symbolWatermarkProperties"),this._newChartProps.symbolWatermarkProperties.color=this._newChartProps.scalesProperties.textColor),this._oldChartProps=t.properties().state(),delete this._oldChartProps.paneProperties.topMargin,delete this._oldChartProps.paneProperties.bottomMargin,this._oldSeriesProps=t.properties().state().mainSeriesProperties}function D(t,e,i,o){var n;o=o||"",n=o+" Study template",at.call(this,n),this._model=t,this._oldProps=e,this._newProps=i,this._oldShowLeftScale=t.model().isLeftPriceScaleVisible(),this._oldShowRightScale=t.model().isRightPriceScaleVisible(),this._newSourcesPriceScalesNames=[]}function V(t,e,i,o,n){at.call(this,t),this._property=e,this._value=i,this._forceSetProperty=n,this._prevValue=e.value(),this._cw=o}function O(t,e){var i,o,n,r,s,a=e.priceScale(),l=[];for(a.isPercent()&&(i=e.firstValue()),o=0;o<t.length;o++)n={offset:t[o].offset,time_t:t[o].time_t},r=t[o].price,a.isPercent()&&(r=a.priceRange().convertToPercent(r,i)),s=a.priceToCoordinate(r),s-=40,r=a.coordinateToPrice(s),a.isPercent()&&(r=a.priceRange().convertFromPercent(r,i)),n.price=r,l.push(n);return l}function R(t,e,i){at.call(this,"clone "+e.title()),this._model=t,this._originalSource=e,this._withoutShift=i}function B(t,e){at.call(this,"Stop Sincing Drawing"),this._model=t,this._sourceId=e.id(),this._linkKey=e.linkKey}function z(t,e,i){at.call(this,"Paste Drawing"),this._model=t,this._clipboardData=e,this._paneIndex=this._model.panes().indexOf(i||this._model.paneForSource(this._model.mainSeries()))}function F(t,e){at.call(this,"Paste Indicator"),this._model=t,this._clipboardData=e}function N(t,e){at.call(this,"Move",!1),this._origPoint=t.clone(),this._point=null,this._handler=e}var W=i(8).Point,H=i(220),U=i(1).LineDataSource,j=i(5),q=i(158),G=i(26),Y=i(22),K=i(150).doAnimate,Z=i(91),X=i(6),J=X.saveDefaultProperties,Q=i(233),tt=i(77),et=i(35),it=et.Study,ot=i(163),nt=i(61),rt=i(355).createTooManyStudiesNotice,st=i(356).UndoStack,at=i(72).UndoCommand,lt=i(940).SaveLineToolStateUndoCommand,ct=i(941).ApplyLineToolTemplateUndoCommand,ht=i(357).RestoreFactoryDefaultsUndoCommand,ut=i(357).RestoreUserDefaultsUndoCommand,dt=i(7).getLogger("Chart.ChartUndoModel");inherit(o,Z),o.prototype.version=function(){return this.m_model._version},o.prototype.onData=function(t){switch(t.method){case"timescale_update":var e=t.params;this.m_model.updateTimeScale(e.index,e.zoffset,e.changes,e.index_diff,e.marks,e.clear)}},
o.prototype.paneForSource=function(t){return this.m_model.paneForSource(t)},o.prototype.createPane=function(t){return this.m_model.createPane(t)},o.prototype.dumpViews=function(){return this.m_model.dumpViews()},o.prototype.readOnly=function(){return this.m_model.readOnly()},o.prototype.restart=function(){this.m_model.restart()},o.prototype.disconnect=function(){this.m_model.disconnect()},o.prototype.studiesMetaData=function(){return this.m_model.studiesMetaData()},o.prototype.studyVersioning=function(){return this.m_model.studyVersioning()},o.prototype.chartModel=function(){return this.m_model},o.prototype.pushUndoCommand=function(t){this.undoHistory.pushUndoCommand(t)},o.prototype.startScalePrice=function(t,e,i){this.pushUndoCommand(new h(this.m_model,t,e,e.state())),this.chartModel().startScalePrice(t,e,i)},o.prototype.scalePriceTo=function(t,e,i){this.chartModel().scalePriceTo(t,e,i)},o.prototype.endScalePrice=function(t,e){this.chartModel().endScalePrice(t,e)},o.prototype.startScrollPrice=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollState=e.state(),this._initialPriceScrollPos=i,this.chartModel().startScrollPrice(t,e,i))},o.prototype.scrollPriceTo=function(t,e,i){e.isAutoScale()||(this._initialPriceScrollPos&&Math.abs(this._initialPriceScrollPos-i)>20&&(this.pushUndoCommand(new h(this.m_model,t,e,this._initialPriceScrollState)),delete this._initialPriceScrollState,delete this._initialPriceScrollPos),this.chartModel().scrollPriceTo(t,e,i))},o.prototype.endScrollPrice=function(t,e){e.isAutoScale()||(delete this._initialPriceScrollState,delete this._initialPriceScrollPos,this.chartModel().endScrollPrice(t,e))},o.prototype.setPriceAutoScale=function(t,e,i){this.pushUndoCommand(new h(this.m_model,t,e,e.state())),this.chartModel().setPriceAutoScale(t,e,i)},o.prototype.resetPriceScale=function(t,e){this.pushUndoCommand(new h(this.m_model,t,e,e.state())),this.chartModel().resetPriceScale(t,e)},o.prototype.startScaleTime=function(t){this.pushUndoCommand(new u(this.m_model,this.m_model.timeScale().state(),"scale time")),this.chartModel().startScaleTime(t)},o.prototype.scaleTimeTo=function(t){this.chartModel().scaleTimeTo(t)},o.prototype.endScaleTime=function(){this.chartModel().endScaleTime()},o.prototype.startScrollTime=function(t){this._initialTimeScrollState=this.m_model.timeScale().state(),this._initialTimeScrollPos=t,this.chartModel().startScrollTime(t)},o.prototype.scrollTimeTo=function(t){this._initialTimeScrollPos&&Math.abs(t-this._initialTimeScrollPos)>20&&(this.pushUndoCommand(new u(this.m_model,this._initialTimeScrollState,"scroll time")),delete this._initialTimeScrollPos,delete this._initialTimeScrollState),this.chartModel().scrollTimeTo(t)},o.prototype.gotoTime=function(t,e){var i,o,n=this.timeScale().visibleBars();if(null===n)return $.Deferred().reject().promise();i=n.firstBar(),o=this.m_model.timeScale().state(),this.chartModel().gotoTime(t,e),i!==this.timeScale().visibleBars().firstBar()&&this.pushUndoCommand(new u(this.m_model,o,"scroll time"))},o.prototype.endScrollTime=function(){
this.chartModel().endScrollTime(),delete this._initialTimeScrollPos,delete this._initialTimeScrollState},o.prototype.resetTimeScale=function(){this.pushUndoCommand(new u(this.m_model,this.m_model.timeScale().state())),this.chartModel().resetTimeScale()},o.prototype.canZoomIn=function(){return this.chartModel().canZoomIn()},o.prototype.canZoomOut=function(){return this.chartModel().canZoomOut()},o.prototype.setWidth=function(t){this.m_model.setWidth(t)},o.prototype.setPaneHeight=function(t,e){this.m_model.setPaneHeight(t,e)},o.prototype.gridSource=function(){return this.m_model.gridSource()},o.prototype.watermarkSource=function(){return this.m_model.watermarkSource()},o.prototype.brandingSource=function(){return this.m_model.brandingSource()},o.prototype.addAlertsSource=function(t){return this.m_model.addAlertsSource(t)},o.prototype.alertsSources=function(){return this.m_model.alertsSources()},o.prototype.barsMarksSources=function(){return this.m_model.barsMarksSources()},o.prototype.crossHairSource=function(){return this.m_model.crossHairSource()},o.prototype.model=function(){return this.m_model},o.prototype.mainSeries=function(){return this.m_model.m_mainSeries},o.prototype.mainSeriesScaleRatioProperty=function(){return this.m_model.mainSeriesScaleRatioProperty()},o.prototype.panes=function(){return this.m_model.m_panes},o.prototype.timeScale=function(){return this.m_model.timeScale()},o.prototype.setSelectedSource=function(t,e){this.m_model.setSelectedSource(t,e)},o.prototype.setHoveredSource=function(t,e){this.m_model.setHoveredSource(t,e)},o.prototype.selectedSource=function(){return this.m_model.selectedSource()},o.prototype.onSelectedSourceChanged=function(){return this.m_model.onSelectedSourceChanged()},o.prototype.hoveredSource=function(){return this.m_model.hoveredSource()},o.prototype.activeStrategySource=function(){return this.m_model.activeStrategySource()},o.prototype.invalidate=function(t){this.m_model.invalidate(t)},o.prototype.setCurrentPosition=function(t,e,i,o){this.m_model.setCurrentPosition(t,e,i,o)},o.prototype.setAndSaveCurrentPosition=function(t,e,i,o){this.m_model.setAndSaveCurrentPosition(t,e,i,o)},o.prototype.modifySeries=function(t,e,i){var o=new d(this.m_model,t,e,i);this.pushUndoCommand(o)},o.prototype.canCreateStudy=function(t){return this.model().chartApi().chartApi().isCanCreateStudy(t)},o.prototype.checkIfFeatureAvailable=function(t,e){var i=this.canCreateStudy(),o=e&&e instanceof it;return!this.readOnly()&&o&&(i=this.canCreateStudy(!0)),!!i||void(o||rt().open())},o.prototype._insertStudy=function(t,e,i,o){var n=new p(this.m_model,t,e,i,o);return this.pushUndoCommand(n),n.insertedStudy()},o.prototype.insertStudyWithoutCheck=function(){return this._insertStudy.apply(this,arguments)},o.prototype.insertStudy=function(t,e,i,o){if(this.checkIfFeatureAvailable(t,o))return this._insertStudy(t,e,i,o)},o.prototype.setProperty=function(t,e,i){if(t&&t.value()!==e){var o=new n(t,e,i,this.m_model);this.pushUndoCommand(o),this.emitEvent("setProperty")}},
o.prototype.setPercentProperty=function(t,e,i,o){if(t.value()!==e){var n=new s(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setLogProperty=function(t,e,i,o){if(t.value()!==e){var n=new a(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setAutoScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new r(t,e,i,o,this.m_model);this.pushUndoCommand(n)}},o.prototype.setChartStyleProperty=function(t,e,i){if(t.value()!==e){var o=new l(t,e,this.mainSeries(),i,this.m_model,this._chartWidget);this.pushUndoCommand(o),this.emitEvent("setChartStyleProperty")}},o.prototype.setLockScaleProperty=function(t,e,i,o){if(t.value()!==e){var n=new c(t,e,i,o,this.m_model,Y.LIGHT_UPDATE);this.pushUndoCommand(n)}},o.prototype.setScaleRatioProperty=function(t,e,i,o){if(t.value()!==e){var n=new c(t,e,i,o,this.m_model,Y.FULL_UPDATE);this.pushUndoCommand(n)}},o.prototype.setScreenChartProperty=function(t,e,i,o,n){if(n||t.value()!==e){var r=new V(o,t,e,i,n);this.pushUndoCommand(r)}},o.prototype._getSourcesTree=function(t){var e,i=[],o=this.m_model.children(t);for(e=0;e<o.length;e++)i=i.concat(this._getSourcesTree(o[e]));return i.push(t),i},o.prototype.removeSource=function(t,e){var i,o,n;if(t.isUserDeletable()){if(i=this._getSourcesTree(t),this.lineBeingCreated()===t)this.cancelCreatingLine();else{for(this.beginUndoMacro("Remove source"),o=0;o<i.length;++o)n=new _(this.m_model,i[o]),this.pushUndoCommand(n);this.endUndoMacro()}e||(1===i.length?this.emitEvent("removeSource",[i[0]]):this.emitEvent("removeSources",[i]))}},o.prototype.removeSelectedSource=function(){var t,e=this.m_model.selectedSource();e&&e.isUserDeletable()&&(this.setSelectedSource(null),t=new _(this.m_model,e),this.pushUndoCommand(t),this.emitEvent("removeSource",[e]))},o.prototype.removeLineTools=function(t){var e,i,o=this.lineBeingCreated();o&&-1!==(e=t.indexOf(o))&&(this.cancelCreatingLine(),t.splice(e,1)),i=new f(this.m_model,t),this.pushUndoCommand(i),this.emitEvent("removeSources",[t])},o.prototype.move=function(t,e,i){var o=new m(this.m_model,t,e,i);this.pushUndoCommand(o),this.emitEvent("moveSource",[t])},o.prototype.mergeSourceUp=function(t){var e=new v(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("mergeSourceUp",[t])},o.prototype.mergeSourceDown=function(t){var e=new y(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("mergeSourceDown",[t])},o.prototype.unmergeSourceUp=function(t){var e=new b(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("unmergeSourceUp",[t])},o.prototype.unmergeSourceDown=function(t){var e=new S(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("unmergeSourceDown",[t])},o.prototype.createLineTool=function(t,e,i,o,n){var r,s;return"LineToolRegressionTrend"!==i||this.canCreateStudy()?(this._createLineCommand=new w(this.m_model,t,i),r=this._createLineCommand.startCreatingLine(e,o,n),s=this._createLineCommand.line(),r&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),s):void rt().open()},o.prototype.lineBeingCreated=function(){return this.m_model.lineBeingCreated()},
o.prototype.paneBeingCreatedLineOn=function(){return this.m_model.paneBeingCreatedLineOn()},o.prototype.coninueCreatingLine=function(t,e,i){var o=this._createLineCommand.continueCreatingLine(t,e,i);return o&&(this.pushUndoCommand(this._createLineCommand),delete this._createLineCommand),o},o.prototype.finishLineTool=function(t){this.m_model.finishLineTool(t)},o.prototype.cancelCreatingLine=function(){this.m_model.cancelCreatingLine()},o.prototype.lineCancelled=function(){return this.m_model.lineCancelled()},o.prototype.startChangingLinetool=function(t,e,i,o){this._currentLineChangeCommand=new lt(this.m_model,t,"Change "+i+"point",!1),this.m_model.startChangingLinetool(t,e,i,o)},o.prototype.lineBeingEdited=function(){return this.m_model.lineBeingEdited()},o.prototype.changeLinePoint=function(t,e){this.m_model.changeLinePoint(t,e)},o.prototype.endChangingLinetool=function(t){this.m_model.endChangingLinetool(t),this.pushUndoCommand(this._currentLineChangeCommand),this._currentLineChangeCommand=null},o.prototype.startMovingSource=function(t,e,i){this._currentLineMoveCommand=new T(this.m_model,t,e,i),this.m_model.startMovingSource(t,e,i)},o.prototype.sourceBeingMoved=function(){return this.m_model.sourceBeingMoved()},o.prototype.moveSource=function(t){this._currentLineMoveCommand.setPoint(t),this.m_model.moveSource(t)},o.prototype.endMovingSource=function(t){this.m_model.endMovingSource(t),this._currentLineMoveCommand._point&&(this.pushUndoCommand(this._currentLineMoveCommand),this._currentLineChangeCommand=null)},o.prototype.dataSources=function(){return this.m_model.dataSources()},o.prototype.orderedDataSources=function(t){return this.m_model.orderedDataSources(t)},o.prototype.dataSourceForId=function(t){return this.m_model.dataSourceForId(t)},o.prototype.state=function(t,e){return this.m_model.state(t,e)},o.prototype.asyncState=function(t){return this.m_model.asyncState(t)},o.prototype.restoreState=function(t,e){return this.m_model.restoreState(t,e)},o.prototype.calculateDefaultTags=function(){return this.m_model.calculateDefaultTags()},o.prototype.onTagsChanged=function(){return this.m_model.onTagsChanged()},o.prototype.changeZOrder=function(t,e){var i=new C(this.m_model,t,e);this.pushUndoCommand(i),this.emitEvent("changeZOrder",[t,e])},o.prototype.sendToBack=function(t){var e=new x(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("changeZOrder",[t])},o.prototype.bringToFront=function(t){var e=new P(this.m_model,t);this.pushUndoCommand(e),this.emitEvent("changeZOrder",[t])},o.prototype.removeAllStudies=function(){var t,e,i;for(this.beginUndoMacro("remove all studies"),t=this.m_model.dataSources(),e=0;e<t.length;e++)i=t[e],(TradingView.isInherited(i.constructor,it)&&!i.isChildStudy()&&i.removeByRemoveAllStudies()||TradingView.isInherited(i.constructor,ot))&&this.removeSource(i);this.endUndoMacro()},o.prototype.removeAllDrawingTools=function(t){var e,i,o;for(this.beginUndoMacro("remove all drawing tools"),this.lineBeingCreated()&&this.cancelCreatingLine(),e=this.m_model.dataSources(),i=0;i<e.length;i++)o=e[i],
TradingView.isInherited(o.constructor,U)&&o.isActualSymbol()&&o.isUserDeletable()&&(t&&t!==o._constructor||this.removeSource(o));this.endUndoMacro()},o.prototype.unlinkLine=function(t){var e=new B(this.m_model,t);this.pushUndoCommand(e)},o.prototype.copyToOtherCharts=function(t){this.m_model.copyToOtherCharts(t)},o.prototype.moveDown=function(){var t,e,i,o,n;try{this.beginUndoMacro("Move Down")}catch(t){return}t=this,e=this.m_model.mainSeries(),i=this.m_model.paneForSource(e),o=i.priceScaleForSource(e),o.setAutoScale(!1),n=o.height(),K({to:n/5,onStep:function(e){t.startScrollPrice(i,o,0),t.scrollPriceTo(i,o,e),t.endScrollPrice(i,o)},onComplete:function(){t.endUndoMacro()}})},o.prototype.moveUp=function(){var t,e,i,o,n;try{this.beginUndoMacro("Move Up")}catch(t){return}t=this,e=this.m_model.mainSeries(),i=this.m_model.paneForSource(e),o=i.priceScaleForSource(e),o.setAutoScale(!1),n=o.height(),K({to:n/5,onStep:function(e){t.startScrollPrice(i,o,e),t.scrollPriceTo(i,o,0),t.endScrollPrice(i,o)},onComplete:function(){t.endUndoMacro()}})},o.prototype.moveLeft=function(){var t,e;try{this.beginUndoMacro("Move Left")}catch(t){return}t=this.m_model.timeScale().width(),e=this,K({to:t/5,onStep:function(t){e.startScrollTime(t),e.scrollTimeTo(0),e.endScrollTime()},onComplete:function(){e.endUndoMacro()}})},o.prototype.moveRight=function(){var t,e;try{this.beginUndoMacro("Move Right")}catch(t){return}t=this.m_model.timeScale().width(),e=this,K({to:t/5,onStep:function(t){e.startScrollTime(0),e.scrollTimeTo(t),e.endScrollTime()},onComplete:function(){e.endUndoMacro()}})},o.prototype.scrollChart=function(t){j.enabled("chart_scroll")&&(this.startScrollTime(0),this.scrollTimeTo(t),this.endScrollTime())},o.prototype.scrollChartByBar=function(t){if(j.enabled("chart_scroll")){var e=t*this.m_model.timeScale().barSpacing();this.startScrollTime(0),this.scrollTimeTo(e),this.endScrollTime()}},o.prototype.zoomIn=function(t,e){var i,o,n=this.m_model.timeScale().width(),r=this;if(e=e||1,this.canZoomIn())if(t)i=e*n/10,o=i*((t+1)/2),this.startScaleTime(i),this.scaleTimeTo(0),this.endScaleTime(),this.startScrollTime(0),this.scrollTimeTo(i-o),this.endScrollTime(),this._onSimpleZoomIn.fire();else{try{this.beginUndoMacro("Zoom In")}catch(t){return}K({to:n/5,onStep:function(t){r.startScaleTime(t),r.scaleTimeTo(0),r.endScaleTime()},onComplete:function(){r.endUndoMacro(),r._onSimpleZoomIn.fire()}})}},o.prototype.zoomOut=function(t,e){var i=this.m_model.timeScale().width(),o=this;if(e=e||1,this.canZoomOut())if(t)this.startScaleTime(0),this.scaleTimeTo(e*i/10),this.endScaleTime(),this.startScrollTime(e*(i/20-i/20*t)),this.scrollTimeTo(0),this.endScrollTime(),this._onSimpleZoomOut.fire();else{try{this.beginUndoMacro("Zoom Out")}catch(t){return}K({to:i/5,onStep:function(t){o.startScaleTime(0),o.scaleTimeTo(t),o.endScaleTime()},onComplete:function(){o.endUndoMacro(),o._onSimpleZoomOut.fire()}})}},o.prototype.resetScales=function(){var t,e;for(this.beginUndoMacro("Reset scales"),this.resetTimeScale(),t=0;t<this.panes().length;t++)e=this.panes()[t],
this.resetPriceScale(e,e.leftPriceScale()),this.resetPriceScale(e,e.rightPriceScale());this.endUndoMacro(),this.m_model.recalculateAllPanes()},o.prototype.zoomToViewport=function(t,e,i,o,n){var r=new k(this.m_model,t,e,i,o,n),s=new A(r,this.m_zoomStack,!0);this.pushUndoCommand(s)},o.prototype.zoomFromViewport=function(){var t=new A(this.m_zoomStack.head(),this.m_zoomStack,!1);this.pushUndoCommand(t)},o.prototype.zoomStack=function(){return this.m_zoomStack},o.prototype.addPaneStretchFactorUndoCommand=function(t,e,i,o){var n=new M(this.m_model,t,e,i,o);this.pushUndoCommand(n)},o.prototype.restoreFactoryDefaults=function(t){var e=new ht(this.m_model,t);this.pushUndoCommand(e)},o.prototype.restoreDefaults=function(t){var e=new ut(this.m_model,t);this.pushUndoCommand(e)},o.prototype.chartLoadTheme=function(t,e){var i=new E(t,e);this.pushUndoCommand(i)},o.prototype.applyLineToolTemplate=function(t,e,i){this.beginUndoMacro(i),this.saveLineToolState(t,i);var o=new ct(t,e,i);this.pushUndoCommand(o),this.saveLineToolState(t,i),this.endUndoMacro(),this.model().updateSource(t)},o.prototype.restoreLineToolFactoryDefaults=function(t,e){this.beginUndoMacro(e),this.saveLineToolState(t,e),t.restoreFactoryDefaults(),this.saveLineToolState(t,e),this.endUndoMacro()},o.prototype.studyLoadTemplate=function(t,e,i,o){var n=new D(t,e,i,o);this.pushUndoCommand(n)},o.prototype.onRearrangePanes=function(){return this._onRearrangePanes},o.prototype.onSimpleZoomIn=function(){return this._onSimpleZoomIn},o.prototype.onSimpleZoomOut=function(){return this._onSimpleZoomOut},o.prototype.loadRange=function(t){t.res!==this.m_model.mainSeries().properties().interval.value()?(this.m_model.mainSeries().setDefaultTimeframe(t.val),this.setProperty(this.m_model.mainSeries().properties().interval,t.res,"Change date range")):this.m_model.mainSeries().loadDataTo(t.val)},o.prototype.cloneLineTool=function(t,e){var i=new R(this.m_model,t,e);return this.pushUndoCommand(i),this.emitEvent("cloneLineTool"),i.clonedLineToolId()},o.prototype._preparePriceAxisProperties=function(t,e){var i=e.lockScale.value(),o=t.style.value()===tt.STYLE_PNF;(o||i)&&(e.log.setValue(!1),e.percentage.setValue(!1)),e.logDisabled.setValue(!(!o&&!i)),e.percentageDisabled.setValue(!(!o&&!i))},o.prototype.alertsList=function(){return this.m_model.alertsList()},o.prototype.alertsListChanged=function(){return this.m_model.alertsListChanged()},o.prototype.insertStudyStub=function(t){return this.m_model.insertStudyStub(t)},o.prototype.removeStudyStub=function(t){return this.m_model.removeStudyStub(t)},o.prototype.isJustClonedChart=function(){return this._chartWidget.isJustClonedChart()},o.prototype.copySourceToClip=function(t){if(t&&!t.properties().blockCopying){var e={};if(t instanceof U)e.type="drawing",e.geometry=t.geometry();else{if(!(t instanceof it))return!1;e.type="study"}return e.source=t.state&&t.state(),(delete e.source.alertId,delete e.source.linkKey,e.source)?(e.title=t.title&&t.title(),e.modelId=this.m_model._id,Q.set(e),!0):!1}},o.prototype.cutSourceToClip=function(t){
if(!this.copySourceToClip(t))return!1;this.removeSource(t)},o.prototype.pasteLineTool=function(t,e){var i=new z(this.m_model,e,t);this.pushUndoCommand(i)},o.prototype.pasteStudy=function(t){var e=new F(this.m_model,t);this.pushUndoCommand(e)},o.prototype.pasteSourceFromClip=function(t,e){var i=Q.get();if(!i)return!1;"drawing"===i.type&&this.pasteLineTool(t,i),"study"===i.type&&this.checkIfFeatureAvailable(i.state)&&this.pasteStudy(i)},o.prototype.trackTime=function(){return this._chartWidget.trackTime()},o.prototype.startCustomMoving=function(t,e,i){this._currentCustomMoveCommand=new N(e,i),this._currentCustomMoveSource=t},o.prototype.customMoveBeingProcessed=function(){return null!==this._currentCustomMoveSource},o.prototype.processCustomMove=function(t){this._currentCustomMoveCommand.setPoint(t)},o.prototype.endCustomMoving=function(){null!==this._currentCustomMoveCommand.point()&&(this.pushUndoCommand(this._currentCustomMoveCommand),this._currentCustomMoveCommand=null,this._currentCustomMoveSource=null)},o.prototype.saveLineToolState=function(t,e){this.pushUndoCommand(new lt(this.m_model,t,e))},inherit(n,at),n.prototype.redo=function(){this._oldValue=this._targetObj.value(),J(!0),this._targetObj.setValue(this._newValue),J(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},n.prototype.undo=function(){J(!0),this._targetObj.setValue(this._oldValue),J(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},inherit(r,at),r.prototype.redo=function(){this._oldValue=this._property.value(),this._oldLockScaleValue=this._priceScale.mainSource()instanceof tt?this._priceScale.isLockScale():void 0,J(!0),this._property.setValue(this._newValue),this._oldLockScaleValue&&this._newValue&&this._priceScale.properties().lockScale.setValue(!1),J(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},r.prototype.undo=function(){J(!0),this._property.setValue(this._oldValue),this._oldLockScaleValue&&this._newValue&&this._priceScale.properties().lockScale.setValue(this._oldLockScaleValue),J(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},inherit(s,at),s.prototype.redo=function(){this._oldValue=this._percentage.value(),this._oldAutoScaleValue=this._priceScale.properties().autoScale.value(),this._oldLogValue=this._priceScale.properties().log.value(),this._oldLogDisabled=this._priceScale.properties().logDisabled.value(),J(!0),this._percentage.setValue(this._newValue),this._priceScale.properties().autoScaleDisabled.setValue(this._newValue),this._priceScale.properties().log.setValue(!1),J(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},s.prototype.undo=function(){if(J(!0),this._percentage.setValue(this._oldValue),this._priceScale.properties().autoScale.setValue(this._oldAutoScaleValue),this._priceScale.properties().autoScaleDisabled.setValue(this._oldValue),
this._priceScale.properties().log.setValue(this._oldLogValue),!this._oldAutoScaleValue&&!this._priceScale.isLockScale()){var t=this._model.timeScale().visibleBars();this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(t.firstBar())))}J(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},inherit(a,at),a.prototype.redo=function(){this._oldValue=this._log.value(),this._oldPercValue=this._priceScale.properties().percentage.value(),this._oldPercDisabled=this._priceScale.properties().percentageDisabled.value(),J(!0),this._log.setValue(this._newValue),this._priceScale.properties().percentage.setValue(!1),this._priceScale.properties().autoScaleDisabled.setValue(this._priceScale.properties().percentage.value()),J(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},a.prototype.undo=function(){J(!0),this._log.setValue(this._oldValue),this._priceScale.properties().percentage.setValue(this._oldPercValue),J(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))},inherit(l,at),l.prototype.redo=function(){var t=$.Deferred().resolve();this._mainSeries._properties.style===this._style&&this._model.mainSeries().isNeedRestart(this._newValue)&&(t=this._chartWidget.screen.show()),t.done(function(){this._oldValue=this._style.value(),this._oldAutoScale=this._priceAxisProperties.autoScale.value(),this._oldLogValue=this._priceAxisProperties.log.value(),this._oldLogDisabled=this._priceAxisProperties.logDisabled.value(),this._oldPercentageValue=this._priceAxisProperties.percentage.value(),this._oldPercentageDisabled=this._priceAxisProperties.percentageDisabled.value(),J(!0),this._style.setValue(this._newValue),this._chartWidget.model()._preparePriceAxisProperties(this._mainSeries.properties(),this._priceAxisProperties),J(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))}.bind(this))},l.prototype.undo=function(){var t=$.Deferred().resolve();this._mainSeries._properties.style===this._style&&this._model.mainSeries().isNeedRestart(this._newValue)&&(t=this._chartWidget.screen.show()),t.done(function(){J(!0),this._style.setValue(this._oldValue),this._priceAxisProperties.log.setValue(this._oldLogValue),this._priceAxisProperties.logDisabled.setValue(this._oldLogDisabled),this._priceAxisProperties.percentage.setValue(this._oldPercentageValue),this._priceAxisProperties.percentageDisabled.setValue(this._oldPercentageDisabled),this._priceAxisProperties.autoScale.setValue(this._oldAutoScale),J(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE)))}.bind(this))},inherit(c,at),c.prototype.redo=function(){if(this._oldValue=this._property.value(),this._oldAutoScale=this._priceScale.properties().autoScale.value(),this._oldPercentage=this._priceScale.properties().percentage.value(),
this._oldLog=this._priceScale.properties().log.value(),J(!0),this._newValue&&(this._priceScale.properties().percentage.setValue(!1),this._priceScale.properties().log.setValue(!1),this._priceScale.properties().autoScale.setValue(!1),this._oldPercentage)){var t=this._model.timeScale().visibleBars();this._priceScale.setPriceRange(this._priceScale.priceRange().convertFromPercents(this._priceScale.mainSource().close(t.firstBar())))}this._property.setValue(this._newValue),J(!1),this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(this._invalidateType)))},c.prototype.undo=function(){J(!0),this._priceScale.properties().percentage.setValue(this._oldPercentage),this._priceScale.properties().log.setValue(this._oldLog),this._priceScale.properties().autoScale.setValue(this._oldAutoScale),this._property.setValue(this._oldValue),J(!1),this._oldValue=null,this._model&&(this._model.recalculateAllPanes(),this._model.invalidate(new Y(this._invalidateType)))},inherit(h,at),h.prototype.undo=function(){if(null!==this.m_newPriceScaleState)return void dt.logDebug("PriceScaleChangeUndoCommand.undo: Command is already undone");this.m_newPriceScaleState=this.m_priceScale.state(),this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_state)},h.prototype.redo=function(){if(null===this.m_newPriceScaleState)return void dt.logDebug("PriceScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restorePriceScaleState(this.m_pane,this.m_priceScale,this.m_newPriceScaleState),this.m_newPriceScaleState=null},inherit(u,at),u.prototype.undo=function(){if(null!==this.m_newTimeScaleState)return void dt.logDebug("TimeScaleChangeUndoCommand.undo: Command is already undone");this.m_newTimeScaleState=this.m_model.timeScale().state(),this.m_model.restoreTimeScaleState(this.m_state)},u.prototype.redo=function(){if(null===this.m_newTimeScaleState)return void dt.logDebug("TimeScaleChangeUndoCommand.redo: Command is not undone");this.m_model.restoreTimeScaleState(this.m_newTimeScaleState),this.m_newTimeScaleState=null},inherit(d,at),d.prototype.redo=function(){this._model.modifySeries(this._series,this._symbol,this._interval)},d.prototype.undo=function(){this._model.modifySeries(this._series,this._oldSymbol,this._oldInterval)},inherit(p,at),p.prototype.redo=function(){var t,e,i=null;return this._studyState?(i=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._studyState,this._priceScaleName),this._studyId!==i.id()&&dt.logError("Study was restored improperly - study ids does not match"),delete this._studyState):(i=this._model.insertStudy(this._studyMetaInfo,this._props,this._isOverlay,this._parentSource),this._studyId=i.id()),t=this._model.paneForSource(i),e=t.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(e,!0),i},p.prototype.insertedStudy=function(){return this._model.dataSourceForId(this._studyId)},p.prototype.undo=function(){var t,e=this.insertedStudy();this._studyState=e.state(),t=this._model.paneForSource(e),this._paneIndex=this._model.panes().indexOf(t),
this._paneState=t.state(),this._restorePane=this._model.removeSource(e),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(_,at),_.prototype.redo=function(){var t,e=this._model.dataSourceForId(this._sourceId);this._sourceState=e.state(),t=this._model.paneForSource(e),this._paneIndex=this._model.panes().indexOf(t),this._priceScaleName=t.priceScaleName(e.priceScale()),this._paneState=t.state(),this._restorePane=this._model.removeSource(e)},_.prototype.undo=function(){var t=this._model.restoreSource(this._restorePane,this._paneIndex,this._paneState,this._sourceState,this._priceScaleName);this._sourceId!==t.id()&&dt.logError("Source was restored improperly - source ids does not match")},inherit(f,at),f.prototype.redo=function(){var t,e,i;for(t=0;t<this._linetools.length;t++)e=this._model.paneForSource(this._linetools[t]),i=this._model.panes().indexOf(e),this._statesByPaneIndexes[i]=this._statesByPaneIndexes[i]||[],this._statesByPaneIndexes[i].push({state:this._linetools[t].state(),owner:this._linetools[t].ownerSource().id()}),e.removeDataSource(this._linetools[t]);delete this._linetools},f.prototype.undo=function(){var t,e,i,o,n,r,s;this._linetools=[];for(t in this._statesByPaneIndexes)for(e=this._model.panes()[t],i=this._statesByPaneIndexes[t],o=0;o<i.length;o++)n=i[o],r=this._model.dataSourceForId(n.owner),s=e._restoreLineTool(n.state),s.setOwnerSource(r),s.updateAllViews(),this._linetools.push(s);this._model.invalidate(new Y(Y.LIGHT_UPDATE))},inherit(m,at),m.prototype.redo=function(){var t,e;-1===this._model.panes().indexOf(this._pane)&&(this._pane=this._model.createPane(this._paneIndex)),t=this._model.dataSourceForId(this._sourceId),this._model.move(t,this._pane,this._pane.priceScaleByName(this._scaleName)),e=this._pane.priceScaleName(t.priceScale()),this._model.setPriceScaleVisibility(e,!0)},m.prototype.undo=function(){-1===this._model.panes().indexOf(this._oldPane)&&(this._oldPane=this._model.createPane(this._oldPaneIndex)),this._model.move(this._model.dataSourceForId(this._sourceId),this._oldPane,this._oldPane.priceScaleByName(this._oldScaleName)),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(g,at),g.prototype.redo=function(){var t,e,i=this._model.dataSourceForId(this._sourceId);this._mergeRedoFn.call(this._model,i),t=this._model.paneForSource(i),e=t.priceScaleName(i.priceScale()),this._model.setPriceScaleVisibility(e,!0)},g.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._mergeUndoFn.call(this._model,t),this._model.setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.setRightPriceScaleVisible(this._oldShowRightScale)},inherit(v,g),inherit(y,g),inherit(b,g),inherit(S,g),inherit(w,at),w.prototype.startCreatingLine=function(t,e,i){var o,n;return this._points=[{point:t}],o=this._model.panes()[this._paneIndex],n=this._model.createLineTool(o,t,this._lineTool,e,i),this._lineId=n.id(),
!this._model.lineBeingCreated()},w.prototype.continueCreatingLine=function(t,e,i){return this._points||dt.logError("continueCreatingLine is called before startCreatingLine"),this._points.push({point:t,envState:e}),this._model.coninueCreatingLine(t,e,i)},w.prototype.line=function(){return this._lineId?this._model.dataSourceForId(this._lineId):null},w.prototype.undo=function(){var t=this.line();t&&(this._lineState=t.state(),this._model.removeSource(t),delete this._lineId)};w.prototype.redo=function(){this._lineState||dt.logError("This command was never undone - nothing to redo");var t=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);this._lineId=t.id(),delete this._lineState},inherit(T,at),T.prototype.setPoint=function(t){this._point=t instanceof W?t.clone():TradingView.clone(t)},T.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(t,this._point,this._pointIndex),this._model.moveSource(this._origPoint),this._model.endMovingSource()},T.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.startMovingSource(t,this._origPoint,this._pointIndex),this._model.moveSource(this._point),this._model.endMovingSource()},inherit(C,at),C.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(t,-this._shift)},C.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.changeZOrder(t,this._shift)},inherit(x,at),x.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(t)},x.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(t)},inherit(P,at),P.prototype.undo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.sendToBack(t)},P.prototype.redo=function(){var t=this._model.dataSourceForId(this._sourceId);this._model.bringToFront(t)},o.prototype.removePane=function(t,e){var i=new L(this,e,t);this.pushUndoCommand(i)},inherit(L,at),L.prototype.redo=function(){this._model.panes().splice(this._index,1),this._chart._updateGui()},L.prototype.undo=function(){this._model.panes().splice(this._index,0,this._pane),this._chart._updateGui()},o.prototype.rearrangePanes=function(t,e,i){var o=new I(this,e,i,t);this.pushUndoCommand(o),this._onRearrangePanes.fire()},inherit(I,at),I.prototype.redo=function(){var t=this._model.panes()[this._index];"up"===this._direction&&this._index>0&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index-1,0,t)),"down"===this._direction&&this._index<this._model.panes().length-1&&(this._model.panes().splice(this._index,1),this._model.panes().splice(this._index+1,0,t)),this._model.invalidate(new Y(Y.FULL_UPDATE))},I.prototype.undo=function(){var t;"up"===this._direction&&(t=this._model.panes()[this._index-1],this._model.panes().splice(this._index-1,1),this._model.panes().splice(this._index,0,t)),"down"===this._direction&&(t=this._model.panes()[this._index+1],this._model.panes().splice(this._index+1,1),
this._model.panes().splice(this._index,0,t)),this._model.invalidate(new Y(Y.FULL_UPDATE))},inherit(k,at),k.prototype.redo=function(){this._timeScaleState=this._model.timeScale().state(),this._priceScaleState=this._pane.defaultPriceScale().state(),this._model.zoomToViewport(this._startBar,this._endBar,this._startPrice,this._endPrice,this._pane)},k.prototype.undo=function(){this._model.timeScale().restoreState(this._timeScaleState),this._pane.defaultPriceScale().restoreState(this._priceScaleState),this._model.recalculateAllPanes(),this._model.invalidate(new Y(Y.LIGHT_UPDATE))},inherit(A,at),A.prototype.undo=function(){if(this._inOut){if(this._baseCmd!==this._zoomStack.head())return void dt.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}else this._baseCmd.redo(),this._zoomStack.push(this._baseCmd)},A.prototype.redo=function(){if(this._inOut)this._baseCmd.redo(),this._zoomStack.push(this._baseCmd);else{if(this._baseCmd!==this._zoomStack.head())return void dt.logDebug("zoom stack inconsistency");this._baseCmd.undo(),this._zoomStack.pop()}},inherit(M,at),M.prototype.redo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._currStretchA,this._paneB._stretchFactor=t-this._currStretchA,this._model.invalidate(new Y(Y.FULL_UPDATE))},M.prototype.undo=function(){var t=this._paneA._stretchFactor+this._paneB._stretchFactor;this._paneA._stretchFactor=this._prevStretchA,this._paneB._stretchFactor=t-this._prevStretchA,this._model.invalidate(new Y(Y.FULL_UPDATE))},inherit(E,at),E.prototype._merge=function(t,e){var i=this._model;J(!0),t&&(i.properties().paneProperties.merge(t.paneProperties),i.properties().scalesProperties.merge(t.scalesProperties),i.properties().symbolWatermarkProperties.merge(t.symbolWatermarkProperties)),i.mainSeries().properties().merge(e),i.mainSeries().properties().saveDefaults(),i.mainSeries().createPaneView(),i.mainSeries().invalidateBarStylesCache(),i._version=e.version,i.recalculateAllPanes(),i.invalidate(new Y(Y.FULL_UPDATE)),i.properties().saveDefaults(),i.properties().listeners().fire(this._properties),i.properties().scalesProperties.textColor.listeners().fire(i.properties().scalesProperties.textColor),i.properties().paneProperties.background.listeners().fire(i.properties().paneProperties.background),J(!1)},E.prototype.undo=function(){this._merge(this._oldChartProps,this._oldSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},E.prototype.redo=function(){this._merge(this._newChartProps,this._newSeriesProps),this._model.mainSeries().onChartStyleChanged(),this._model.updateScales(),this._model.chartThemeLoaded()},inherit(D,at),D.prototype._merge=function(t){var e,i,o,n,r,s,a,l,c,h,u,d,p=this._model.model(),_=p.mainSeries();for(_.priceScale().properties().lockScale.setValue(!1),t.interval&&_.properties().interval.setValue(t.interval),e=[],i=p.panes(),o=i.length;o--;)for(n=i[o],r=n.containsMainSeries(),s=n.dataSources(),a=s.length;a--;)l=s[a],
(!r||l instanceof it)&&(l.isRemovedByStudyTemplates()||e.push(l),p.removeSource(l));for(c=t.panes,function(t,e){return t.dataSources().some(function(t){return t.alert&&t.alert().id===e.alert.id})},o=0;o<c.length;o++){for(h=!1,u=c[o],a=0;a<u.sources.length;a++)l=u.sources[a],"MainSeries"===l.type&&(delete l.state,h=!0),-1!==u.leftAxisSources.indexOf(l.id)&&-1===this._newSourcesPriceScalesNames.indexOf("left")&&this._newSourcesPriceScalesNames.push("left"),-1!==u.rightAxisSources.indexOf(l.id)&&-1===this._newSourcesPriceScalesNames.indexOf("right")&&this._newSourcesPriceScalesNames.push("right");if(n=null,n=h?i[o]:p.createPane(o),n.restoreState(c[o],!1,t.version),h)for(d=0;d<e.length;d++)e[d].restore&&e[d].restore()}_.priceScale().setAutoScale(!0),p._version=t.version,p.startNotStartedStudies(),p.recalculateAllPanes(),p.invalidate(new Y(Y.FULL_UPDATE))},D.prototype.redo=function(){var t,e,i,o;for(this._merge(this._newProps),t=this._model.model(),t.mainSeries().onChartStyleChanged(),e=this._model.model().mainSeries().properties(),i=this._model.model().mainSeries().properties().priceAxisProperties,this._model._preparePriceAxisProperties(e,i),t._recalcVisibleRangeStudy(t.dataSources(),!0),o=0;o<this._newSourcesPriceScalesNames.length;o++)t.setPriceScaleVisibility(this._newSourcesPriceScalesNames[o],!0)},D.prototype.undo=function(){this._merge(this._oldProps),this._model.model().mainSeries().onChartStyleChanged(),this._model.model().setLeftPriceScaleVisible(this._oldShowLeftScale),this._model.model().setRightPriceScaleVisible(this._oldShowRightScale)},inherit(V,at),V.prototype.redo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._value,this._forceSetProperty)}.bind(this))},V.prototype.undo=function(){this._cw.screen.show().done(function(){this._property.setValue(this._prevValue,this._forceSetProperty)}.bind(this))},inherit(R,at),R.prototype.redo=function(){var t,e,i,o,n,r,s,a,l,c,h;if(this._lineState)r=this._model.restoreSource(!1,this._paneIndex,null,this._lineState,null);else{for(t=this._originalSource,e=t.priceScale(),i=this._model.paneForSource(t),o=TradingView.className(t.constructor),n=t.properties().clone(),r=H.create(o,this._model,n,null,t.ownerSource()),r.setOwnerSource(t.ownerSource()),r.properties().visible._value=!0,r._fixedPoints=r._fixedPoints.concat(t._fixedPoints),s=0;s<r._fixedPoints.length;s++)r._fixedPoints[s]=r._fixedPoints[s].add(new W(20,20));a=t._timePoint,l=this._withoutShift?TradingView.clone(a):O(a,t.ownerSource()),c=t._points,h=c,r.restorePoints(l,h),r.cloneData&&r.cloneData(t),i.addDataSource(r,e),this._model.updateSource(r),r.checkAlert&&r.checkAlert(),this._paneIndex=this._model.panes().indexOf(i),G.drawOnAllCharts().value()&&this._model.copyToOtherCharts(r),this._lineState=r.state()}},R.prototype.undo=function(){this._lineState||dt.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._lineState.id);this._model.removeSource(t)},R.prototype.clonedLineToolId=function(){return this._lineState.id},inherit(B,at),
B.prototype.redo=function(){delete this._model.dataSourceForId(this._sourceId).linkKey},B.prototype.undo=function(){this._model.dataSourceForId(this._sourceId).linkKey=this._linkKey},inherit(z,at),z.prototype.redo=function(){var t,e,i,o,n,r,s,a,l,c=this._model.panes()[this._paneIndex],h=c.dataSourceForId(this._clipboardData.source.ownerSource)||c.mainDataSource();this._sourceState||(t=!0,e=this._clipboardData.source.state.symbol,i=c.mainDataSource(),o=i.symbol?i.symbol():"",n=e===o,n&&(h instanceof tt&&(t=!1),h instanceof it&&(t=!h.metaInfo().is_price_study)),r=TradingView.clone(this._clipboardData.source),delete r.state.symbol,t?(s=this._model,a=function(t){var e=t.x*s.timeScale().width(),i=t.y*h.priceScale().height();return new W(e,i)},r.points=this._clipboardData.geometry.map(function(t){var e,i=a(t),o=s.timeScale().coordinateToIndex(i.x),n=s.timeScale().normalizeBarIndex(o);return n.price=h.priceScale().coordinateToPrice(i.y),h.priceScale().isPercent()&&(e=h.firstValue(),n.price=h.priceScale().priceRange().convertFromPercent(n.price,e)),n})):this._model._id===this._clipboardData.modelId&&h.id()===this._clipboardData.source.ownerSource&&(r.points=O(this._clipboardData.source.points,h)),r.id=nt.guid(),this._sourceState=r),l=c._restoreLineTool(this._sourceState,null,!1),l.calcIsActualSymbol(),l.setOwnerSource(h),l.setPriceScale(h.priceScale()),h.priceScale().addDataSource(l),l.createServerPoints(),this._model.invalidate(new Y(Y.LIGHT_UPDATE,!0))},z.prototype.undo=function(){var t,e;this._sourceState||dt.logError("This command was never executed - nothing to undo"),t=this._model.panes()[this._paneIndex],e=t.dataSourceForId(this._sourceState.id),this._model.removeSource(e)},inherit(F,at),F.prototype.redo=function(){var t,e,i,o;this._sourceState||(t=TradingView.clone(this._clipboardData.source),t.id=nt.guid(),this._sourceState=t),e=null,i=null,this._sourceState.metaInfo.is_price_study?(e=this._model.paneForSource(this._model.mainSeries()),i=this._model.mainSeries().priceScale()):(e=this._model.createPane(),i=e.defaultPriceScale()),o=e._restoreStudy(this._sourceState),o.start(),o.setPriceScale(i),e.move(o,i)},F.prototype.undo=function(){this._sourceState||dt.logError("This command was never executed - nothing to undo");var t=this._model.dataSourceForId(this._sourceState.id);this._model.removeSource(t)},inherit(N,at),N.prototype.setPoint=function(t){this._point=t.clone(),this._handler(t)},N.prototype.point=function(){return this._point},N.prototype.undo=function(){this._handler(this._origPoint)},N.prototype.redo=function(){this._handler(this._point)},e.ChartUndoModel=o}).call(e,i(10))},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(72),s=function(t){function e(e,i,o,n){void 0===n&&(n=!0);var r=t.call(this,o,n)||this;return r._model=e,r._savedState=i.state(!0),r}return o.__extends(e,t),e.prototype.redo=function(){this._toggleState()},e.prototype.undo=function(){this._toggleState()},e.prototype._getSource=function(){
return n.ensureNotNull(this._model.dataSourceForId(this._savedState.id))},e.prototype._toggleState=function(){var t=this._getSource(),e=this._savedState;this._savedState=t.state(!0),this._model.restoreLineToolState(t,e)},e}(r.UndoCommand),e.SaveLineToolStateUndoCommand=s},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(72),r=function(t){function e(e,i,o){var n=t.call(this,o)||this;return n._source=e,n._newState=i,n._oldState=e.properties().state(),n}return o.__extends(e,t),e.prototype.redo=function(){this._source.applyTemplate(this._newState)},e.prototype.undo=function(){this._source.applyTemplate(this._oldState)},e}(n.UndoCommand),e.ApplyLineToolTemplateUndoCommand=r},function(t,e,i){"use strict";(function(e){function o(t,e){this.chart=t,this._properties=t.properties().scalesProperties,this.contextMenu=null,this._disableContextMenu=!!e,this.jqRow=$(document.createElement("tr")),this.jqLhsTimeAxisStub=$(document.createElement("td")),this.jqLhsTimeAxisStub.addClass("chart-markup-table"),this.jqLhsTimeAxisStub.appendTo(this.jqRow),this.jqLhsStub=$("<div>"),this.jqLhsStub.css("width","100%"),this.jqLhsStub.css("height","100%"),this.jqLhsStub.css("position","relative"),this.jqLhsStub.css("overflow","hidden"),this.jqLhsStub.appendTo(this.jqLhsTimeAxisStub),this.lhsCanvas=f(this.jqLhsStub,new m(16,16)),$(this.lhsCanvas).css("position","absolute"),$(this.lhsCanvas).css("z-order","2"),$(this.lhsCanvas).css("left",0),$(this.lhsCanvas).css("top",0),this.lhsCtx=this.lhsCanvas.getContext("2d"),this.jqCell=$(document.createElement("td")),this.jqCell.appendTo(this.jqRow),this.jqCell.addClass("chart-markup-table"),this.jqCell.addClass("time-axis"),this.jqCell.height(25),this._dv=$("<div>"),this._dv.css("width","100%"),this._dv.css("height","100%"),this._dv.css("position","relative"),this._dv.css("overflow","hidden"),this._dv.appendTo(this.jqCell),this.canvas=f(this._dv,new m(16,16)),$(this.canvas).css("position","absolute"),$(this.canvas).css("z-order","2"),$(this.canvas).css("left",0),$(this.canvas).css("top",0),this.ctx=this.canvas.getContext("2d"),this.top_canvas=f(this._dv,new m(16,16)),$(this.top_canvas).css("position","absolute"),$(this.top_canvas).css("z-order","1"),$(this.top_canvas).css("left",0),$(this.top_canvas).css("top",0),this.top_ctx=this.top_canvas.getContext("2d"),this.jqRhsTimeAxisStub=$(document.createElement("td")),this.jqRhsTimeAxisStub.addClass("chart-markup-table"),this.jqRhsTimeAxisStub.appendTo(this.jqRow),this.jqRhsStub=$("<div>"),this.jqRhsStub.css("width","100%"),this.jqRhsStub.css("height","100%"),this.jqRhsStub.css("position","relative"),this.jqRhsStub.css("overflow","hidden"),this.jqRhsStub.appendTo(this.jqRhsTimeAxisStub),this.rhsCanvas=f(this.jqRhsStub,new m(16,16)),$(this.rhsCanvas).css("position","absolute"),$(this.rhsCanvas).css("z-order","2"),$(this.rhsCanvas).css("left",0),$(this.rhsCanvas).css("top",0),this.rhsCtx=this.rhsCanvas.getContext("2d"),this.restoreDefaultCursor(),this.update(),this._minVisibleSpan=b.MINUTE_SPAN,
g(this.jqCell,this,!0),this.updatePriceScalesVisibility()}var n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b;i(943),n=i(164).PriceAxisWidget,r=i(1).LineDataSource,s=i(155),a=i(52),l=a.ActionSeparator,c=i(108),h=i(22),u=i(130),d=u.resizeCanvas,p=u.hardResizeCanvas,_=u.clearRect,f=u.addCanvasTo,m=u.Size,g=i(107).setMouseEventHandler,v=i(40).trackEvent,y=i(156).makeFont,b=i(350),o.prototype._BORDER_SIZE=1,o.prototype._OFFSET_SIZE=1,o.prototype._TICK_LENGTH=3,o.prototype.backgroundColor=function(){return this.chart.properties().paneProperties.background.value()},o.prototype.lineColor=function(){return this._properties.lineColor.value()},o.prototype.textColor=function(){return this._properties.textColor.value()},o.prototype.fontSize=function(){return this._properties.fontSize.value()},o.prototype.baseFont=function(){return y(this.fontSize(),"Arial","")},o.prototype.baseBoldFont=function(){return y(this.fontSize(),"Arial","bold")},o.prototype.rendererOptions=function(){var t,e;return this._rendererOptions||(this._rendererOptions={borderSize:this._BORDER_SIZE,offsetSize:this._OFFSET_SIZE,tickLength:this._TICK_LENGTH,fontSize:NaN,font:"",widthCache:new s}),t=this._rendererOptions,t.fontSize!==this.fontSize()&&(e=this.fontSize(),t.fontSize=e,t.font=this.baseFont(),t.paddingTop=Math.ceil(Math.max(e/4.5-t.tickLength/2,0)),t.paddingBottom=Math.ceil(e/4.5),t.paddingHorizontal=Math.ceil(e/3),t.baselineOffset=Math.round(this.fontSize()/10),t.widthCache.reset()),this._rendererOptions},o.prototype.updatePriceScalesVisibility=function(){var t=this.chart.properties().scalesProperties;t.showLeftScale.value()?this.jqLhsTimeAxisStub.css("display","table-cell"):this.jqLhsTimeAxisStub.css("display","none"),t.showRightScale.value()?this.jqRhsTimeAxisStub.css("display","table-cell"):this.jqRhsTimeAxisStub.css("display","none")},o.prototype.mouseDownEvent=function(t){if(this._mousedown||!e.enabled("chart_zoom"))return!0;this._mousedown=!0;var i=this.chart.model();i.timeScale().isEmpty()||(this.setCursor("ew-resize"),i.startScaleTime(t.localX))},o.prototype.mouseDownOutsideEvent=function(t){var e=this.chart.model();!e.timeScale().isEmpty()&&this._mousedown&&(this._mousedown=!1,e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.pressedMouseMoveEvent=function(t){var e,i,o=this.chart.model();o.timeScale().isEmpty()||(e=!1,i=(new Date).valueOf(),this._lastScrollScaleTime&&i-this._lastScrollScaleTime<100&&(e=!0),e||(o.scaleTimeTo(t.localX),this._lastScrollScaleTime=i))},o.prototype.mouseUpEvent=function(t){this._mousedown=!1;var e=this.chart.model();e.timeScale().isEmpty()||(e.endScaleTime(),this.restoreDefaultCursor())},o.prototype.contextMenuEvent=function(t,i){!this._disableContextMenu&&e.enabled("scales_context_menu")&&this._createContextMenu().show(t)},o.prototype._createContextMenu=function(){return c.createMenu(this.getContextMenuActions(),{statName:"TimeScaleContextMenu"})},o.prototype.getContextMenuActions=function(){var t,i,o=this.chart;return o.model().mainSeries().createSessStudy(),o.updateActions(),t=o.actions(),
i=e.enabled("charting_library_base")?[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks]:[t.timeScaleReset,new l,t.applyTimeZone,t.sessionBreaks,t.extendedHours],e.enabled("timezone_menu")||i.splice(2,1),e.enabled("show_chart_property_page")&&e.enabled("chart_property_page_timezone_sessions")&&t.tmzProperties&&i.push(new l,t.tmzProperties),i},o.prototype.mouseClickEvent=function(t){},o.prototype.mouseDoubleClickEvent=function(t){v("GUI","Double click time scale"),this.chart.model().resetTimeScale()},o.prototype.optimalHeight=function(){var t=this.rendererOptions();return Math.ceil(t.offsetSize+t.borderSize+t.tickLength+t.fontSize+t.paddingTop+t.paddingBottom)},o.prototype.setSize=function(t,e,i){this.size&&this.size.equals(t)||(this.lhsStubSize=e,d(this.lhsCanvas,e),this.jqLhsTimeAxisStub.width(e.w),this.jqLhsTimeAxisStub.height(e.h),this.rhsStubSize=i,d(this.rhsCanvas,i),this.jqRhsTimeAxisStub.width(i.w),this.jqRhsTimeAxisStub.height(i.h),this.size=t,d(this.canvas,t),d(this.top_canvas,t),this.lhsCanvas.getContext("2d"),this.rhsCanvas.getContext("2d"),this.canvas.getContext("2d"),this.top_canvas.getContext("2d"),this.jqCell.width(t.w),this.jqCell.height(t.h))},o.prototype._spanIndex=function(t){for(var e=[b.MINUTE_SPAN,b.HOUR_SPAN,b.DAY_SPAN,b.MONTH_SPAN,b.YEAR_SPAN],i=e.length-1;i>0;){if(e[i]<=t)return i;i--}return i},o.prototype._spanOffset=function(t,e){if(e<t)throw Error("actual span cuold not be less then base");return this._spanIndex(e)-this._spanIndex(t)},o.prototype.update=function(){var t,e;this.chart.model()&&(t=this.chart.model().timeScale().marks())&&(e=this,this._minVisibleSpan=b.YEAR_SPAN,$.each(t,function(){e._minVisibleSpan=Math.min(this.span,e._minVisibleSpan)}))},o.prototype._hightlightBackground=function(t,e){var i,o,n,r,s=this.chart.model(),a=s.timeScale(),l=e[0].index,c=e[0].index;for(i=1;i<e.length;i++)l=Math.min(l,e[i].index),c=Math.max(c,e[i].index);o=a.indexToCoordinate(l),n=a.indexToCoordinate(c),r="rgba(109, 158, 235, 0.3)",_(t,o,1,n-o,this.size.h-1,r)},o.prototype.drawBackground=function(t){var e,i,o,n,s;if(_(t,0,0,this.size.w,this.size.h,this.backgroundColor()),e=this.chart.model()){if(i=e.timeScale(),(o=e.model().selectedSource())&&o instanceof r&&!i.isEmpty()){if(n=o.axisPoints(),0===n.length)return;this._hightlightBackground(t,n)}s=e.model().crossHairSource(),s.startMeasurePoint()&&this._hightlightBackground(t,s.measurePoints())}},o.prototype.drawBorder=function(t){t.save(),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,this.size.w+.5,this._BORDER_SIZE),t.restore()},o.prototype.drawStubs=function(){var t,e=this._BORDER_SIZE,i=2*this._BORDER_SIZE,o=this.lhsCtx;_(o,0,0,this.lhsStubSize.w,this.lhsStubSize.h,this.backgroundColor()),o.fillStyle=this.lineColor(),o.fillRect(this.lhsStubSize.w-i-.5,.5,i,e),o.fillRect(this.lhsStubSize.w-i-.5,-.5,e,e),t=this.rhsCtx,_(t,0,0,this.rhsStubSize.w,this.rhsStubSize.h,this.backgroundColor()),t.fillStyle=this.lineColor(),t.fillRect(-.5,.5,i,e),t.fillRect(.5,-.5,e,e)},o.prototype.drawTickMarks=function(t){
var e,i,o,n,r,s,a,l,c,h,u,d=this.chart.model().timeScale().marks();if(d&&0!==d.length){for(e=d.reduce(function(t,e){return t.span>e.span?t:e},d[0]).span,e>30&&e<40&&(e=30),t.save(),t.strokeStyle=this.lineColor(),i=this.rendererOptions(),o=i.borderSize+i.tickLength+i.paddingTop+i.fontSize-i.baselineOffset,t.textAlign="center",t.translate(.5,.5),t.fillStyle=this.lineColor(),t.beginPath(),n=d.length;n--;)t.rect(d[n].coord,i.borderSize,1,i.tickLength);for(t.fill(),t.fillStyle=this.textColor(),r={},s=this.baseFont(),a=this.baseBoldFont(),n=0;n<d.length;n++)l=d[n].span>=e?a:s,c=r[l]||[],c.push(d[n]),r[l]=c;for(h in r)for(t.setFont(h),u=r[h],n=0;n<u.length;n++)t.fillText(u[n].label,u[n].coord,o);t.restore()}},o.prototype.drawBackLabels=function(t){var e,i,o,n,r,s,a,l;for(t.save(),e=this.chart.model().dataSources(),i=this.chart.model(),o=i.sourceBeingMoved()||i.lineBeingEdited()||i.lineBeingCreated(),n=this.rendererOptions(),r=0;r<e.length;r++)if((s=e[r])!==this.chart.model().crossHairSource()&&s!==o&&s.timeAxisViews&&(a=s.timeAxisViews()))for(l=0;l<a.length;l++)a[l].renderer().draw(t,n);t.restore()},o.prototype.drawCrossHairLabel=function(t){var e,i,o,n,r;if(this.top_ctx.clearRect(-.5,-.5,this.size.w,this.size.h),e=this.chart.model(),i=e.sourceBeingMoved()||e.lineBeingEdited()||e.lineBeingCreated(),o=this.rendererOptions(),i){if(t.save(),i.timeAxisViews&&(n=i.timeAxisViews()))for(r=0;r<n.length;r++)n[r].renderer().draw(t,o);return void t.restore()}if(t.save(),n=this.chart.model().crossHairSource().timeAxisView())for(r=0;r<n.length;r++)n[r].renderer().draw(t,o);t.restore()},n.prototype.hardResetCanvas=function(){this.size&&(p(this.canvas,this.size),p(this.top_canvas,this.size))},o.prototype.paint=function(t){if(0!==t)if(t===h.UPDATE_CURSOR_ONLY)this.drawCrossHairLabel(this.top_ctx);else{var e=this.ctx;this.drawBackground(e),this.drawBorder(e),this.drawStubs(),this.chart.model()&&(this.drawTickMarks(e),this.drawBackLabels(e),this.drawCrossHairLabel(this.top_ctx))}},o.prototype.setStubVisible=function(t,e){var i=n.isLeft(t)?this.jqLhsTimeAxisStub:this.jqRhsTimeAxisStub;e?i.css("display","table-cell"):i.css("display","none")},o.prototype.restoreDefaultCursor=function(){this.setCursor("")},o.prototype.setCursor=function(t){var e="";"grabbing"!==t&&"ew-resize"!==t||(e="time-axis--cursor-"+t),this._currentCursorClassName!==e&&(this._currentCursorClassName&&this.jqCell.removeClass(this._currentCursorClassName),e&&this.jqCell.addClass(e),this._currentCursorClassName=e,this.jqCell.css("cursor"))},o.prototype.image=function(){var t={};return t.content=this.canvas.toDataURL(),t.contentWidth=this.size.w,t.contentHeight=this.size.h,t.lhsStub={},t.lhsStub.content=this.lhsCanvas.toDataURL(),t.lhsStub.contentWidth=this.lhsStubSize.w,t.lhsStub.contentHeight=this.lhsStubSize.h,t.rhsStub={},t.rhsStub.content=this.rhsCanvas.toDataURL(),t.rhsStub.contentWidth=this.rhsStubSize.w,t.rhsStub.contentHeight=this.rhsStubSize.h,t},t.exports=o}).call(e,i(5))},function(t,e){},function(t,e,i){"use strict";function o(t,e,i){this._chart=t,this._parent=e,
this.zoom_active=!1,this._real=i,this._state="stop",this._controlBarVisible=!1,this._boundMouseHandler=null,this._pressedKey={},this._checkIntId=0,this.init(),i&&this.initToRealChart(),this.initHandlers()}var n=i(22),r=i(248);o.prototype.init=function(){this._widget=$('<div class="control-bar-wrapper">'),this._controlBar=$('<div class="control-bar control-bar--hidden">').append($(i(214)).attr("class","move-left-button-control-bar")).append($(i(945)).attr("class","zoom-out-right-button-control-bar")).append($(i(946)).attr("class","turn-button-control-bar")).append($(i(947)).attr("class","zoom-in-button-control-bar")).append($(i(359)).attr("class","move-right-button-control-bar")).appendTo(this._widget),this._buttons={zoomIn:this._widget.find(".zoom-in-button-control-bar"),zoomOut:this._widget.find(".zoom-out-right-button-control-bar"),moveLeft:this._widget.find(".move-left-button-control-bar"),moveRight:this._widget.find(".move-right-button-control-bar"),turn:this._widget.find(".turn-button-control-bar")},this._initVisibility(),this._widget.appendTo(this._parent)},o.prototype.destroy=function(){this._visibilityTypeProperty&&(this._visibilityTypeProperty.unsubscribe(this,this._onVisibilityTypeChange),this._visibilityTypeProperty=null),this._boundMouseHandler&&(this._parent[0].removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null),this._boundKeydownHandler&&(this._parent[0].ownerDocument.removeEventListener("keydown",this._boundKeydownHandler),this._boundKeydownHandler=null),this._boundKeyupHandler&&(this._parent[0].ownerDocument.removeEventListener("keyup",this._boundKeyupHandler),this._boundKeyupHandler=null),clearTimeout(this._movingTimeout),this._onRHSPriceAxisWidth&&(this._chart.rhsPriceAxisWidthChanged.unsubscribe(this,this._onRHSPriceAxisWidth),this._onRHSPriceAxisWidth=null),this._chart&&this._chart.model()&&this._chart.model().model().clearInterval(this._checkIntId),this._chart=null},o.prototype._initVisibility=function(){this._visibilityTypeProperty=r.actualBehavior(),this._visibilityTypeProperty.subscribe(this,this._onVisibilityTypeChange),this._onVisibilityTypeChange()},o.prototype._onVisibilityTypeChange=function(){var t=this._visibilityTypeProperty.value();"alwaysOn"===t||"alwaysOff"===t?(this._controlBarVisible="alwaysOn"===t,this._boundMouseHandler&&(this._parent[0].removeEventListener("mousemove",this._boundMouseHandler,!1),this._parent[0].removeEventListener("mouseleave",this._boundMouseHandler,!1),this._boundMouseHandler=null)):(this._controlBarVisible=!1,this._boundMouseHandler||(this._boundMouseHandler=this._visibilityMouseHandler.bind(this),this._parent[0].addEventListener("mousemove",this._boundMouseHandler,!1),this._parent[0].addEventListener("mouseleave",this._boundMouseHandler,!1))),this._updateControlBarVisibility()},o.prototype._visibilityMouseHandler=function(t){var e,i,o,n;t.buttons||(e=this._chart.model())&&e.lineBeingCreated()||(i=!1,o=100,
"mousemove"===t.type&&(n=this._widget[0].getBoundingClientRect(),i=t.clientX>=n.left-o&&t.clientX<=n.right+o&&t.clientY>=n.top-o&&t.clientY<=n.bottom+o),this._controlBarVisible!==i&&(this._controlBarVisible=i,this._rafId||(this._rafId=this._controlBar[0].ownerDocument.defaultView.requestAnimationFrame(this._updateControlBarVisibility.bind(this)))))},o.prototype._updateControlBarVisibility=function(){this._rafId=void 0,this._controlBar[0].classList.toggle("control-bar--hidden",!this._controlBarVisible)},o.prototype.initToRealChart=function(){var t=this;this._back=$(i(948)).attr({class:"back-to-present js-hidden"}).appendTo(this._parent),this._backButtonVisible=!1,this._back.on("click",function(){t._chart.model().timeScale().scrollToRealtime(!0),t._chart.model().model()._invalidateHandler(new n(n.FULL_UPDATE))}),this._onRHSPriceAxisWidth=function(){var e=t._chart.maxRhsPriceAxisWidth+4;e&&t._back.css("marginRight",e)},this._chart.rhsPriceAxisWidthChanged.subscribe(this,this._onRHSPriceAxisWidth),this._onRHSPriceAxisWidth(),this._chart.withModel(this,function(){this._chart&&(this._checkIntId=this._chart.model().model().setInterval(function(){t.check()},1e3))})},o.prototype.check=function(){var t=this._chart.model(),e=!!t&&t.timeScale().rightOffset()<0;e!==this._backButtonVisible&&(this._backButtonVisible=e,this._backButtonVisible?this._back.attr("class","back-to-present"):this._back.attr("class","back-to-present js-hidden"))},o.prototype._move=function(t){var e,i;"stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),this._state="moving",this._moveType="animated",this._deferredFinishTimeout&&(clearTimeout(this._deferredFinishTimeout),this._deferredFinishTimeout=0),this._finishingTimeout&&(clearTimeout(this._finishingTimeout),this._finishingTimeout=0),this._startTime=+new Date,this._movingTimeout||(e=this._startTime,i=10,this._movingTimeout=setTimeout(function o(){this._moveStep.call(this,e,0,50*t,1e3),this._movingTimeout=setTimeout(o.bind(this),i)}.bind(this),i))},o.prototype._moveStep=function(t,e,i,o){var n,r,s;if(!this._chart.model().timeScale().isEmpty())return n=Date.now(),n<t&&(t=n),r=(n-t)/o,(r>1||!isFinite(r))&&(r=1),s=1-Math.pow(1-r,3),this.currentDistance=(i-e)*s+e,this._chart.model().scrollChart(this.currentDistance),r},o.prototype._finishMove=function(t){var e,i;clearTimeout(this._movingTimeout),this._movingTimeout=0,this._deferredFinishTimeout=0,e=this.currentDistance,i=+new Date,this._finishingTimeout=setTimeout(function t(){this._moveStep.call(this,i,e,0,700)<1?this._finishingTimeout=setTimeout(t.bind(this),10):(this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())}.bind(this),10)},o.prototype._stopMove=function(t){"moving"===this._state&&(this._state="wait_finishing",(new Date).getTime()-this._startTime<200?this._deferredFinishTimeout=setTimeout(this._finishMove.bind(this),200-((new Date).getTime()-this._startTime)):this._finishMove())},o.prototype._moveByBar=function(t){
var e,i,o,n,r=this._chart.model().timeScale();r.isEmpty()||("stop"===this._state&&this._chart.model().beginUndoMacro(1===t?"Move Left":"Move Right"),e=r.indexToCoordinate(r.visibleBars().lastBar())+r.barSpacing()/2,Math.abs(r.width()-e)>r.barSpacing()/6&&this._chart.model().scrollChart(r.width()-e),this._state="moving",this._moveType="by_bar",this._startTime=+new Date,this._movingTimeout||(i=400,o=150,n=0,this._movingTimeout=setTimeout(function e(){this._moveByBarStep(t),n++,o>100&&(o-=n/5*20),this._movingTimeout=setTimeout(e.bind(this),o)}.bind(this),i),this._moveByBarStep(t)))},o.prototype._moveByBarStep=function(t){this._chart.model().timeScale().isEmpty()||this._chart.model().scrollChartByBar(t)},o.prototype._stopMoveByBar=function(t){"moving"===this._state&&(clearTimeout(this._movingTimeout),this._movingTimeout=0,this._state="stop",this._moveType="",this._movingTimeout=0,this.currentDistance=0,this._chart.model().endUndoMacro())},o.prototype._keydownHandler=function(t){if(!t.metaKey&&!(37!==t.which&&39!==t.which||this._pressedKey[t.which]||(this._pressedKey[t.which]=!0,$(t.target).closest("input, textarea").length))){var e=37===t.which?1:-1;t.ctrlKey||t.altKey?this._move(e):this._moveByBar(e),t.preventDefault()}},o.prototype._keyupHandler=function(t){37!==t.which&&39!==t.which||$(t.target).closest("input, textarea").length||(this._pressedKey[t.which]=!1,"by_bar"===this._moveType?this._stopMoveByBar():this._stopMove())},o.prototype.initHandlers=function(){var t=this._chart,e=Modernizr.touch?"touchstart":"mousedown",i=Modernizr.touch?"touchend":"mouseup mouseout";this._buttons.moveLeft.on(e,this._moveByBar.bind(this,1)),this._buttons.moveLeft.on(i,this._stopMoveByBar.bind(this,1)),this._buttons.moveRight.on(e,this._moveByBar.bind(this,-1)),this._buttons.moveRight.on(i,this._stopMoveByBar.bind(this,-1)),this._buttons.moveLeft.on("click",function(t){t.preventDefault()}),this._buttons.moveRight.on("click",function(t){t.preventDefault()}),this._buttons.turn.on("click",function(e){e.preventDefault(),t.GUIResetScales()}),this._buttons.zoomOut.on("click",function(e){e.preventDefault(),t.model()&&t.model().zoomOut()}),this._buttons.zoomIn.on("click",function(e){e.preventDefault(),t.model()&&t.model().zoomIn()}),this._boundKeydownHandler=this._keydownHandler.bind(this),this._parent[0].ownerDocument.addEventListener("keydown",this._boundKeydownHandler),this._boundKeyupHandler=this._keyupHandler.bind(this),this._parent[0].ownerDocument.addEventListener("keyup",this._boundKeyupHandler)},t.exports=o},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="16" height="16"><path d="M28 50h65v17H28z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="-58 -18 120 120" width="16" height="16"><path d="M31 13C23.4 5.3 12.8.5 1.1.5c-23.3 0-42.3 19-42.3 42.5s18.9 42.5 42.3 42.5c13.8 0 26-6.6 33.7-16.9l-16.5-1.8C13.5 70.4 7.5 72.5 1 72.5c-16.2 0-29.3-13.2-29.3-29.4S-15.2 13.7 1 13.7c8.1 0 15.4 3.3 20.7 8.6l-10.9 11h32.5V.5L31 13z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="16" height="16"><path d="M112 60H78V26H61v34H27v17h34v34h17V77h34z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14.8 13.4" enable-background="new 0 0 14.8 13.4"><path d="M8 6.7L1.7 0 .1 1.7l4.7 4.9-4.8 5 1.7 1.8L8 6.7zm6.8 0L8.4 0 6.8 1.7l4.7 4.9-4.8 5 1.7 1.8 6.4-6.7z"/></svg>'},function(t,e,i){"use strict";(function(e){function o(t){var i,o,n,a,l,h=this,d=this._chartWidget=t.chartWidget;this.$parent=t.parent,this._dateRangesPopupList=[],this._goToPopupBtn=[],this._iterativeHide=[],this._timeFormatter=new r,this._currentRange=window.urlParams&&window.urlParams.range||"",this._$seriesControls=$(document.createElement("div")).attr("class","chart-controls-bar-buttons chart-series-controls").appendTo(t.parent),this._$timezoneButton=$('<a class="apply-common-tooltip" title="'+$.t("Timezone")+'"><span class="chart-controls-clock"></span><span class="chart-controls-tz"></span></a>'),e.enabled("fundamental_widget")||this._$timezoneButton.appendTo(this._$seriesControls),!d.onWidget()&&e.enabled("timezone_menu")?c(h._$timezoneButton,function(){var t,e,i,o,n;if(d.updateActions(),t=[],!(e=d.actions())||!e.applyTimeZone||!e.applyTimeZone.subActions)return t;for(i=e.applyTimeZone.subActions,o=0;o<i.length;++o)n=i[o],t.push({action:n.enabled?n.executeCallback.bind(n):null,addClass:n.enabled?"":"special",disabled:!n.enabled,iconClass:n.checkable&&n.checked?"icon checked-icon":"unchecked-icon",svg:n.checkable&&n.checked?u:"",title:n.text});return t},{direction:"up",addClass:"context-menu",svg:!0,wrapIcon:!0}):this._$timezoneButton.addClass("disabled"),this._$timezoneClock=this._$timezoneButton.find(".chart-controls-clock"),this._$timezoneName=this._$timezoneButton.find(".chart-controls-tz"),d.onWidget()||e.enabled("charting_library_base")?this._$extendedHoursButton=null:(this._$extendedHoursButton=$(document.createElement("a")).text($.t("ext")).attr("title",$.t("The Extended Trading Hours feature is available only for intraday charts")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),this._iterativeHide.push(this._$extendedHoursButton)),this._$percButton=$(document.createElement("a")).text("%").attr("title",$.t("Toggle Percentage")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),e.enabled("fundamental_widget")&&(this._$percButton.css("display","inline-block"),urlParams.percentage&&this._$percButton.addClass("active")),this._iterativeHide.push(this._$percButton),this._$logButton=$(document.createElement("a")).text($.t("log")).attr("title",$.t("Toggle Log Scale")).addClass("apply-common-tooltip"),e.enabled("fundamental_widget")||this._$logButton.appendTo(this._$seriesControls),this._iterativeHide.push(this._$logButton),this._$autoScaleButton=$(document.createElement("a")).text($.t("auto",{context:"scale"})).attr("title",$.t("Toggle Auto Scale")).addClass("apply-common-tooltip"),e.enabled("fundamental_widget")||this._$autoScaleButton.appendTo(this._$seriesControls),
this._iterativeHide.push(this._$autoScaleButton),i=null,e.enabled("main_series_scale_menu")&&!e.enabled("fundamental_widget")&&(i=$(document.createElement("a")).attr("title",$.t("Scales Properties")).addClass("apply-common-tooltip").appendTo(this._$seriesControls)),this._$fullscreenChartButton=$(document.createElement("a")).attr("title",$.t("Toggle Maximize Chart")).addClass("apply-common-tooltip").appendTo(this._$seriesControls),this._iterativeHide.push(this._$timezoneButton),o="http://www.w3.org/2000/svg",n=$(document.createElementNS(o,"svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"}),$(document.createElementNS(o,"desc")).text("SP").appendTo(n),$(document.createElementNS(o,"path")).attr({d:"M 11.896733,5.4401 C 11.201602,5.2497118 10.287185,5.3844905 9.8529668,4.6739798 9.3680407,3.9899631 9.7713075,3.1150758 10.335646,2.6255445 10.81759,2.1397596 10.086625,1.2464141 9.5348331,1.5679918 9.0096065,2.0197899 8.3586515,2.5915907 7.6081884,2.2860159 6.8487054,2.0572252 6.6657258,1.2214292 6.6611579,0.52971682 6.6904416,-0.14270317 5.5547878,-0.19920111 5.3509206,0.33932112 5.3495604,1.0614071 5.216111,1.980668 4.4411277,2.2733721 3.718985,2.58432 3.0421913,2.0835985 2.5447076,1.6132218 2.019086,1.2075468 1.1733117,2.0525503 1.6258135,2.5522279 2.1291674,3.0522349 2.6067846,3.7947509 2.23627,4.5142319 1.9382627,5.2487851 1.0997484,5.3013165 0.42629601,5.3591295 -0.18586111,5.4121559 -0.1726988,6.614951 0.4382476,6.6606553 1.1701866,6.6354301 2.0901088,6.8653212 2.3114865,7.6677973 2.5690397,8.4182506 1.9757702,9.0009969 1.5707544,9.5375753 1.260194,10.111116 2.1887088,10.863746 2.6392394,10.30714 3.1282414,9.7691412 3.9518015,9.3917137 4.6315605,9.8249999 5.3287279,10.186762 5.2619381,11.018963 5.3869987,11.672161 5.5440075,12.215504 6.7794125,12.12358 6.6535582,11.446999 6.6654072,10.746236 6.9028479,9.8947057 7.6677558,9.6885901 8.4182253,9.4312024 9.000933,10.024446 9.5375381,10.429439 10.111007,10.739871 10.863873,9.8114259 10.307197,9.360908 9.7691358,8.8719351 9.3913098,8.0483184 9.8250144,7.3685614 10.18688,6.6714752 11.018948,6.7380091 11.672226,6.6131264 12.162952,6.4957229 11.998177,5.7860369 11.896733,5.4401 z M 5.999918,8.8061 C 4.4052236,8.8574703 3.0094365,7.3092614 3.2012542,5.7303585 3.3197775,4.2414555 4.7798203,3.0282413 6.2655218,3.2004993 7.7296227,3.3187202 8.9364572,4.7279379 8.805387,6.1941362 8.7186344,7.6148699 7.4347334,8.84471 5.999918,8.8061 z"}).appendTo(n),i&&i.append(n),a=$(document.createElementNS(o,"svg")).attr({width:12,height:12}).css({fill:"currentColor",stroke:"none",margin:"1px"}),a.get(0).setAttribute("viewBox","0 0 24 24"),$(document.createElementNS(o,"desc")).text("FS").appendTo(a),$(document.createElementNS(o,"path")).attr({d:"M0 0v9l3.5-3.5 4.5 4.5h2v-2l-4.5-4.5 3.5-3.5h-9zm15 0l3.5 3.5-4.5 4.5v2h2l4.5-4.5 3.5 3.5v-9h-9zm-7 14l-4.5 4.5-3.5-3.5v9h9l-3.5-3.5 4.5-4.5v-2h-2zm6 0v2l4.5 4.5-3.5 3.5h9v-9l-3.5 3.5-4.5-4.5h-2z"}).appendTo(a),this._$fullscreenChartButton.append(a),this._$percButton.on("click",function(t){var e,i,o,n
;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),i.priceScale().isLockScale()||(e.beginUndoMacro($.t("Toggle Percentage")),n.log.value()&&e.setLogProperty(n.log,!1,o,$.t("Toggle Log Scale")),e.setPercentProperty(n.percentage,!n.percentage.value(),o,$.t("Toggle Percentage")),e.endUndoMacro())}),this._$logButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),i.priceScale().isLockScale()||(e.beginUndoMacro($.t("Toggle Log Scale")),n.percentage.value()&&e.setPercentProperty(n.percentage,!1,o,$.t("Toggle Percentage")),e.setLogProperty(n.log,!n.log.value(),o,$.t("Toggle Log Scale")),e.endUndoMacro())}),this._$autoScaleButton.on("click",function(t){var e,i,o,n;t.preventDefault(),e=d.model(),i=e.mainSeries(),o=i.priceScale(),n=o.properties(),e.beginUndoMacro($.t("Toggle Auto Scale")),n.autoScale.value()&&n.percentage.value()&&e.setPercentProperty(n.percentage,!1,o,$.t("Toggle Percentage")),e.setAutoScaleProperty(n.autoScale,!n.autoScale.value(),o,$.t("Toggle Auto Scale")),e.endUndoMacro()}),i&&c(i,function(){var t,e,i,o,n,r,a,l=d.paneWidgets();for(t=0;t<l.length;++t)if(e=l[t],e.containsMainSeries()){if(i=[],!(o=e.getDefaultPriceAxisWidget()))return i;for(n=o.getContextMenuActions(),r=0;r<n.length;++r)a=n[r],a instanceof s?i.push({separator:!0}):i.push({action:a.enabled?a.executeCallback.bind(a):null,addClass:a.enabled?"":"special",disabled:!a.enabled,iconClass:a.checkable&&a.checked?"icon checked-icon":"unchecked-icon",svg:a.checkable&&a.checked?u:"",title:a.text});return i}return[]},{direction:"up",addClass:"context-menu",reverse:!0,svg:!0,wrapIcon:!0}),this._$extendedHoursButton&&this._$extendedHoursButton.on("click",function(t){var e,i;t.preventDefault(),e=d.model(),i=e.mainSeries().properties().extendedHours,e.setProperty(i,!i.value(),"Extended Hours")}),this._$dateRangesWrap=$(document.createElement("div")).addClass("chart-controls-bar-buttons date-range-wrapper").appendTo(t.parent),this._$dateRangesBtn=$(document.createElement("a")).addClass("date-range-btn").text($.t("Date Range")).appendTo(this._$dateRangesWrap),this._$dateRanges=$(document.createElement("div")).addClass("date-range-list").appendTo(this._$dateRangesWrap),d.withModel(null,function(){var t=d.model(),i=t.mainSeries(),o=i.priceScale();this.updateScaleButtons(),i.priceScaleChanged.subscribe(this,this.updateScaleButtons),o.properties().autoScale.subscribe(this,this.updateScaleButtons),this.updateDateRangeButtons(),i.onStatusChanged().subscribe(this,this.updateDateRangeButtons),e.enabled("update_timeframes_set_on_symbol_resolve")&&i.onSymbolResolved().subscribe(this,this.updateDateRangeButtons),i.priceScale().properties().lockScale.subscribe(this,this.updateDateRangeButtons),!TradingView.onWidget()&&e.enabled("go_to_date")&&(this.gotoDateButton(),i.onStatusChanged().subscribe(this,this.gotoDateButton)),this.updateExtendedHoursButton(),i.properties().extendedHours.subscribe(this,this.updateExtendedHoursButton),
i.properties().interval.subscribe(this,this.updateExtendedHoursButton),t.model().mainSeries().onSymbolResolved().subscribe(null,this.updateTimezonesButton.bind(this)),t.model().properties().timezone.subscribe(null,this.updateTimezonesButton.bind(this))}.bind(this)),this.updateFullscreenChartButton(),l=this._chartWidget._chartWidgetCollection,l&&(l.layout.subscribe(this.updateFullscreenChartButton.bind(this)),l.maximizeCurrentChart.subscribe(this.updateFullscreenChartButton.bind(this)),this._$fullscreenChartButton.on("click",function(){l.activeChartWidget.setValue(d),l.maximizeCurrentChart.setValue(!l.maximizeCurrentChart.value())}),this.checkTimezonesButton(l.activeChartWidget.value()),l.activeChartWidget.subscribe(this.checkTimezonesButton.bind(this))),d.onScroll().subscribe(this,this._resetCurrentRange),d.withModel(null,function(){d.model().model().onResetScales().subscribe(h,h._resetCurrentRange),d.model().mainSeries().onSymbolResolved().subscribe(h,h._resetCurrentRange),d.model().mainSeries().properties().extendedHours.subscribe(h,h._resetCurrentRange),d.model().mainSeries().onIntervalChanged().subscribe(null,function(t,e){e&&h._currentRange===e.timeframe||h._resetCurrentRange()})})}var n=i(358).showGoToDateDialog,r=i(135).TimeFormatter,s=i(52).ActionSeparator,a=i(332).parseTzOffset,l=i(133),c=l.bindPopupMenu,h=l.unbindPopupMenu,u=i(146);o.prototype._resetCurrentRange=function(){this._currentRange&&(this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),this._currentRange=null)},o.prototype.updateScaleButtons=function(){var t=this._chartWidget.model().mainSeries(),e=t.priceScale().properties(),i=e.log.value(),o=e.percentage.value(),n=e.autoScale.value();this._$logButton.toggleClass("active",i),this._$percButton.toggleClass("active",o),this._$autoScaleButton.toggleClass("active",n)},o.prototype.updateDateRangeButtons=function(){var t,e,i,o,n,r,s=this._chartWidget,a=s.model().mainSeries().status();if(a!==TradingView.Series.STATUS_LOADING&&a!==TradingView.Series.STATUS_RESOLVING){if(t=s._dateRangeResolutions(),e=function(t,e){this._$dateRanges.find(".date-range-preset-btn").removeClass("active"),e.addClass("active"),this._currentRange=e.data("value"),s.model().loadRange(t)},this._dateRangesPopupList=[],t.length)for(this._$dateRanges.empty(),i=0;i<t.length;i++)o=t[i],n=$(document.createElement("a")).text(o.text).attr("title",o.description||o.text).addClass("date-range-preset-btn apply-common-tooltip").data("value",o.value),o.value===this._currentRange&&n.addClass("active"),r=e.bind(this,{val:o.value,res:o.targetResolution},n),n.appendTo(this._$dateRanges).click(r),this._dateRangesPopupList.push({title:o.description||o.text,action:r});this.updateTimeframePopupMenu()}},o.prototype.gotoDateButton=function(){var t,e;this._goToPopupBtn=[],this._chartWidget._dateRangeResolutions().length>0&&(t=$.t("Go to..."),e=function(){n(this._chartWidget.model())}.bind(this),
$(document.createElement("a")).text(t).addClass("js-goto-date-btn apply-common-tooltip").attr("title","Alt+G").appendTo(this._$dateRanges).click(e),this._goToPopupBtn.push({title:t,action:e})),this.updateTimeframePopupMenu()},o.prototype.updateTimeframePopupMenu=function(){this._$dateRangesBtn.toggleClass("i-hidden",!(this._dateRangesPopupList.length||this._goToPopupBtn.length)),h(this._$dateRangesBtn),c(this._$dateRangesBtn,this._dateRangesPopupList.concat(this._goToPopupBtn),{direction:"up",addClass:"date-range-popupmenu"}),this.resizeUI()},o.prototype.updateTimezonesButton=function(){var t,e,i;null!==this._chartWidget.model().mainSeries().symbolInfo()&&(t=this._chartWidget.model().model().timezone(),"exchange"===t&&(e=this._chartWidget.model().mainSeries().symbolInfo().timezone)&&(t=e),i=a(t),this.tzOffset=i.offset,this._$timezoneName.text("("+i.string+")"),this.tickClock(),this.resizeUI())},o.prototype.checkTimezonesButton=function(t){this._$timezoneButton.toggleClass("i-invisible",t!==this._chartWidget),this.resizeUI()},o.prototype.tickClock=function(){void 0!==this.tzOffset&&this._$timezoneClock.text(this._timeFormatter.format(new Date(Date.now()+this.tzOffset+1e3*ChartApiInstance.serverTimeOffset())))},o.prototype.updateExtendedHoursButton=function(){if(this._$extendedHoursButton){this._chartWidget.model().mainSeries().properties().extendedHours.value()?this._$extendedHoursButton.addClass("active"):this._$extendedHoursButton.removeClass("active"),this.resizeUI()}},o.prototype.updateFullscreenChartButton=function(){var t=this._chartWidget._chartWidgetCollection;if(!t||"s"===t.layout.value())return void this._$fullscreenChartButton.addClass("i-hidden");this._$fullscreenChartButton.removeClass("i-hidden"),this._$fullscreenChartButton.toggleClass("active",t.maximizeCurrentChart.value()),this.resizeUI()},o.prototype.updateUI=function(){this.updateScaleButtons(),this.resizeUI()},o.prototype.resizeUI=function(){var t,e,i,o,n,r,s;if(this._$seriesControls&&this._$dateRanges){for(this.$parent.addClass("i-measure"),t=this.$parent.width(),e=this._$dateRanges.width(),i=this._$dateRangesBtn.outerWidth(),o=0,this._$seriesControls.find("a").each(function(){var t=$(this);t.hasClass("i-hidden")||(o+=t.outerWidth())}),n=o,r=0;r<this._iterativeHide.length;r++)this._iterativeHide[r].hasClass("i-hidden")||(s=this._iterativeHide[r].outerWidth(),this._iterativeHide[r].toggleClass("i-compact",t-i<n),n-=s);this._$dateRangesWrap.toggleClass("i-compact",e>t-o),this.$parent.removeClass("i-measure")}},t.exports=o}).call(e,i(5))},function(t,e,i){"use strict";function o(t,e){i.e(5).then(function(o){i(414).showSymbolInfoDialog(t,e)}.bind(null,i)).catch(i.oe)}Object.defineProperty(e,"__esModule",{value:!0}),e.showSymbolInfoDialog=o},function(t,e,i){"use strict";(function(t,o){function n(t){return t&&t.__esModule?t:{default:t}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s,a,l,c,h,u,d;Object.defineProperty(e,"__esModule",{value:!0}),e.CompareTab=void 0,s=function(){function t(t,e){var i,o
;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),a=i(71),l=n(a),c=i(40),i(361),i(296),i(952),h='\n\t<div class="tv-compare-tab">\n\t\t<input type="text" class="tv-control-input js-compare-tab-input" placeholder="'+$.t("Company Comparison")+'" autocomplete="off">\n\t</div>',u='<div class="tv-compare-tab__predefines js-compare-tab-predefines"></div>',d='\n\t<div class="tv-compare-tab__predefine-cell">\n\t\t<label for="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox">\n\t\t\t\t<input class="tv-control-checkbox__input js-predefine-checkbox" type="checkbox" id="{{symbolId}}">\n\t\t\t<span class="tv-control-checkbox__box tv-compare-tab__checkbox-box">'+i(146)+'</span>\n\t\t\t<span class="tv-control-checkbox__ripple js-ripple"></span>\n\t\t\t</span>\n\t\t\t<span class="tv-control-checkbox__label tv-compare-tab__checkbox-label">{{label}}</span>\n\t\t</label>\n\t</div>',e.CompareTab=function(){function e(t,i){r(this,e),this._chartWidgetCollection=t,this._dialog=i,this._$popup=null,this._predefines={},this._symbolAlias={},this.init()}return s(e,[{key:"addCompareSymbol",value:function(t,e,i){var o,n,r,s,a,l,h=this._chartWidgetCollection.activeChartWidget.value();if(h&&(o=h.model())){for(n=o.mainSeries().interval(),r=o.studiesMetaData(),s=void 0,a=0;a<r.length;a++)"Compare@tv-basicstudies"===r[a].id&&(s=r[a]);return l={exchange:i,inputs:{symbol:t,resolution:n}},(0,c.trackEvent)("GUI","Add Compare"),o.insertStudy(s,l)}}},{key:"removeCompareSymbol",value:function(t){var e,i=this,o=this._chartWidgetCollection.activeChartWidget.value();o&&(e=o.model())&&e.dataSources().forEach(function(o){if(o._metaInfo&&"Compare@tv-basicstudies"===o._metaInfo.id){var n=o.properties().inputs.symbol.value();(n===t||i._symbolAlias[n]&&i._symbolAlias[n]===t)&&e.removeSource(o)}})}},{key:"init",value:function(){var e,i,o,n=this,r=this._chartWidgetCollection.activeChartWidget.value();r&&(e=r.model())&&(i=e.dataSources(),this.$tab=$(h),this._initSymbolSearch(),t.enabled("charting_library_base")||(this._createPredefinesList(),o=this.$tab.find(".js-compare-tab-predefines"),o.find(".js-predefine-checkbox").attr("checked",!1),Object.keys(this._predefines).forEach(function(t){var e=n._symbolToId(t),r=o.find("#"+e);i.forEach(function(e){if(e._metaInfo&&"Compare@tv-basicstudies"===e._metaInfo.id){var i=e.properties().inputs.symbol.value();(i===t||n._symbolAlias[i]&&n._symbolAlias[i]===t)&&r.attr("checked",!0)}})})))}},{key:"_initSymbolSearch",value:function(){var t=this;this._$input=this.$tab.find(".js-compare-tab-input"),l.default.bindToInput(this._$input,{callback:function(e){return t.addCompareSymbol(e)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"_createPredefinesList",value:function(){function t(t){var e=this;setTimeout(function(){if($(e).is(":checked")){
i.addCompareSymbol(t.data.symbol)||$(e).attr("checked",!1)}else i.removeCompareSymbol(t.data.symbol)})}var e=this,i=this,n=$(u);Object.keys(this._predefines).forEach(function(i){var r=$(o.render(d,{symbolId:e._symbolToId(i),label:e._predefines[i]}));r.find(".js-predefine-checkbox").change({symbol:i},t),r.appendTo(n)}),n.appendTo(this.$tab)}},{key:"_symbolToId",value:function(t){return t.replace(/[^a-z0-9]/gi,"_")}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),e}()}).call(e,i(5),i(41))},function(t,e){},function(t,e,i){"use strict";function o(t){return t&&t.__esModule?t:{default:t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),e.AddSymbolTab=void 0,r=function(){function t(t,e){var i,o;for(i=0;i<e.length;i++)o=e[i],o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}return function(e,i,o){return i&&t(e.prototype,i),o&&t(e,o),e}}(),s=i(71),a=o(s),l=i(318),i(361),i(954),c='\n\t<div class="tv-add-symbol-tab">\n\t\t<input type="text" class="tv-control-input js-add-symbol-tab-input" placeholder="'+$.t("Symbol")+'" autocomplete="off">\n\t\t<div class="tv-add-symbol-tab__add-symbol-overlay js-add-symbol-tab-checkbox"></div>\n\t</div>',e.AddSymbolTab=function(){function t(e,i){n(this,t),this._chartWidgetCollection=e,this._dialog=i,this._$popup=null,this.init()}return r(t,[{key:"init",value:function(){var t=this;this.$tab=$(c),this._$input=this.$tab.find(".js-add-symbol-tab-input"),this._checkbox=new l.AddSymbolCheckbox({labelRight:$.t("Overlay the main chart"),labelAddClass:"tv-add-symbol-tab__checkbox-label",boxAddClass:"tv-add-symbol-tab__checkbox-box"}),this.$tab.find(".js-add-symbol-tab-checkbox").append(this._checkbox.$el),a.default.bindToInput(this._$input,{callback:function(e){var i=t._chartWidgetCollection.activeChartWidget.value();i&&i.addSymbol(e,t._checkbox.checked)},onPopupOpen:function(e){e.css("z-index",t._dialog.getZIndex()),t._$popup=e},onPopupClose:function(){t._$popup=null},keepFocus:!0,clearAfterAccept:!0})}},{key:"focus",value:function(){Modernizr.touch||this._$input.focus()}},{key:"isClickOnTab",value:function(t){return!!this._$popup&&!(this._$popup[0]!==t.target&&!this._$popup[0].contains(t.target))}}]),t}()},function(t,e){},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),i(956),o=i(243),i(43),n=i(31),r=i(957),s=i(10),a=i(214),l=i(359),c=i(24),function(t){t[t.Left=0]="Left",t[t.Right=1]="Right"}(h||(h={})),u={saveTab:"",noSlider:!1,onTabClick:!1,loadedClass:"i-loaded",tabsContainerClass:"tv-tabs",tabClass:"tv-tabs__tab",tabDisabledClass:"disabled",activeTabClass:"i-active",activePageClass:"active",sliderClass:"tv-tabs__slider",scrollBoxClass:"tv-tabs__scroll-box",scrollWrapClass:"tv-tabs__scroll-wrap",
lArrowClass:"tv-tabs__left-arrow",rArrowClass:"tv-tabs__right-arrow"},d={leftArrow:a,rightArrow:l},p=function(){function t(t,e,i){void 0===i&&(i={}),this._animating=!1,this._prevWidth=-1,this._bindings=[],this._options=r.deepExtend({},u,i),this.tabChanged=new s,this._elTabs=t,this._elPages=e,this._elScrollWrap=this._findOrCreateElement(this._options.scrollWrapClass||"",this._elTabs,"wrapInner"),this._elScrollBox=this._findOrCreateElement(this._options.scrollBoxClass||"",this._elScrollWrap,"wrapInner"),this._elArrowLeft=this._findOrCreateElement(this._options.lArrowClass||"",this._elTabs,"append",'<div class="'+(this._options.lArrowClass||"")+' i-slided">'+d.leftArrow+"</div>"),this._elArrowRight=this._findOrCreateElement(this._options.rArrowClass||"",this._elTabs,"append",'<div class="'+(this._options.rArrowClass||"")+' i-slided">'+d.rightArrow+"</div>"),this._options.noSlider||(this._elSlider=this._findOrCreateElement(this._options.sliderClass||"",this._elScrollBox,"append")),this._addClass(this._elArrowLeft,this._options.addLeftArrowsClass),this._addClass(this._elArrowRight,this._options.addRightArrowsClass),this._addClass(this._elScrollBox,this._options.addScrollBoxClass),this._addClass(this._elTabs,this._options.tabsContainerClass),this._addClass(this.getTabsArray(),this._options.tabClass),this._addClass(this._elTabs,this._options.loadedClass),"string"==typeof this._options.sliderMod&&this._addClass(this._elSlider,this._options.sliderClass+"--"+this._options.sliderMod),this.checkScrollArrows(!0),this._initActivePage(),this._bindEvents()}return t.prototype.getTabsArray=function(){var t,e,i,o=this._elScrollBox.children;if(!this._options.sliderClass)return Array.prototype.slice.call(o);for(t=[],e=0;e<o.length;e++)i=o[e],i.classList.contains(this._options.sliderClass)||t.push(i);return t},t.prototype.getPagesArray=function(){return this._elPages?Array.prototype.slice.call(this._elPages.children):[]},t.prototype.getElTabs=function(){return this._elTabs},t.prototype.getElPages=function(){return this._elPages},t.prototype.checkScrollArrows=function(t){function e(t){t.classList.remove("i-slided"),$.Velocity&&$.Velocity.animate(t,{translateX:"0%"},{duration:n.dur/2,easing:"easeOutCubic",queue:!1})}function i(e,i){if(t)return e.classList.add("i-slided"),void e.setAttribute("style","");var r=i===h.Left?"-100%":"100%";o.lazyVelocity().then(function(){$.Velocity.animate(e,{translateX:r},{complete:function(){return e.classList.add("i-slided")},duration:n.dur/2,easing:"easeOutCubic",queue:!1})})}var r,s,a,l;void 0===t&&(t=!1),r=Math.ceil(this._elScrollWrap.scrollLeft),s=this._getElWidth(this._elScrollWrap),a=10,l=this._elScrollWrap.scrollWidth-s,r>=a?e(this._elArrowLeft):(r<=a||this._elScrollWrap.scrollWidth<=s)&&i(this._elArrowLeft,h.Left),l-r>1?e(this._elArrowRight):(r>=l||this._elScrollWrap.scrollWidth<=s)&&i(this._elArrowRight,h.Right)},t.prototype.index=function(){var t=this.getElActiveTab();return t?this.getTabsArray().indexOf(t):-1},t.prototype.getElActiveTab=function(){
return this._getActiveElement(this.getTabsArray(),this._options.activeTabClass||"",this._options.inactiveTabClass)},t.prototype.getElActivePage=function(){return this._getActiveElement(this.getPagesArray(),this._options.activePageClass||"",this._options.inactivePageClass)},t.prototype.setActivePage=function(t,e,i){function o(e,i,o){e.forEach(function(e,n){var r=t===n,s=e.classList;i&&s.toggle(i,r),o&&s.toggle(o,!r)})}if(-1!==t&&(t!==this.index()||i)){var n=this.index();o(this.getTabsArray(),this._options.activeTabClass,this._options.inactiveTabClass),o(this.getPagesArray(),this._options.activePageClass,this._options.inactivePageClass),this._options.noSlider||this.updateSlider(n,t,e),this._options.saveTab&&c.setValue(this._options.saveTab,t),this.tabChanged.fire(t)}},t.prototype.updateSlider=function(t,e,i){var r,s,a,l,c,h,u=this;this._options.noSlider||(r=this.getTabsArray()[e],0===r.clientWidth||0===r.clientHeight||"none"===window.getComputedStyle(r).getPropertyValue("display")||(s=window.getComputedStyle(r),a=r.offsetLeft+parseInt(s.getPropertyValue("padding-left")),l=this._getElWidth(r),c=r.querySelector(".js-tabs__slider-pos"),c&&(h=window.getComputedStyle(c),a+=parseInt(h.getPropertyValue("padding-left"))+c.offsetLeft,l-=l-this._getElWidth(c)),i=i||-1===t||document.all&&!window.atob,i?(this._elSlider.style.left=a+"px",this._elSlider.style.width=l+"px"):(this._animating=!0,o.lazyVelocity().then(function(){$.Velocity.animate(u._elSlider,{left:a},{duration:n.dur,easing:"easeOutCubic",queue:!1}),$.Velocity.animate(u._elSlider,{width:l},{complete:function(){u._animating=!1},duration:n.dur,easing:"easeOutCubic",queue:!1})}))))},t.prototype.onTabClick=function(t){var e=t.currentTarget||t.target,i=this.getTabsArray().indexOf(e);-1===i||this._isTabDisabled(e)||this.setActivePage(i),document.activeElement.blur(),t.preventDefault()},t.prototype.resizeSlider=function(){var t,e;this._options.noSlider||(t=this._elTabs.offsetWidth)!==this._prevWidth&&(this._prevWidth=t,e=this.index(),this.updateSlider(e,e,!0))},t.prototype.count=function(){return this.getTabsArray().length},t.prototype.add=function(t,e){this._elScrollBox.appendChild(t),this._elPages&&e&&this._elPages.appendChild(e),this._bindTabEvents(t),this.checkScrollArrows(!0)},t.prototype.remove=function(t){function e(t){t.parentElement&&t.parentElement.removeChild(t)}var i,o,n=this.tabAt(t);n&&(this._unbindTabEvents(n),e(n)),i=this.pageAt(t),i&&e(i),o=t-1>=0?t-1:0,this.setActivePage(o),this.checkScrollArrows(!0)},t.prototype.indexOfTab=function(t){return this.getTabsArray().indexOf(t)},t.prototype.indexOfPage=function(t){return this.getPagesArray().indexOf(t)},t.prototype.pageAt=function(t){return this.getPagesArray()[t]||null},t.prototype.tabAt=function(t){return this.getTabsArray()[t]||null},t.prototype.deselect=function(t){var e,i=this.getElActiveTab();return this._options.activeTabClass&&i&&i.classList.remove(this._options.activeTabClass),e=this.getElActivePage(),this._options.activePageClass&&e&&e.classList.remove(this._options.activePageClass),
this._elSlider&&(this._elSlider.style.left="",this._elSlider.style.width=""),this},t.prototype.stop=function(){this._unbindEvents({})},t.prototype._getElWidth=function(t){if(0===t.offsetWidth)return 0;var e=window.getComputedStyle(t);return t.offsetWidth-parseFloat(e.getPropertyValue("padding-left"))-parseFloat(e.getPropertyValue("padding-right"))-parseFloat(e.getPropertyValue("border-left-width"))-parseFloat(e.getPropertyValue("border-right-width"))},t.prototype._findOrCreateElement=function(t,e,i,o){var n,r,s,a=e.querySelector("."+t);if(!a)if(n=document.createElement("div"),n.innerHTML=o||'<div class="'+t+'"></div>',a=n.firstElementChild,"append"===i)e.appendChild(a);else{if("wrapInner"!==i)throw Error("Unknown insertMethod");for(r=Array.prototype.slice.call(e.childNodes),s=0;s<r.length;s++)a.appendChild(r[s]);e.appendChild(a)}return a},t.prototype._addClass=function(t,e){if("string"==typeof e){Array.isArray(t)||(t=[t]);var i=e.split(/\s+/);t.forEach(function(t){i.forEach(function(e){t.classList.add(e)})})}},t.prototype._initActivePage=function(){var t,e=0;this._options.saveTab&&(e=c.getInt(this._options.saveTab,0)),t=this.index(),-1!==t&&(e=t),void 0!==this._options.activeTab&&(e=this._options.activeTab),this.setActivePage(e,!0,!0)},t.prototype._bindEvents=function(){var t,e=this;this.getTabsArray().forEach(this._bindTabEvents.bind(this)),this._bindOneEvent({eventName:"scroll",listener:this.checkScrollArrows.bind(this,!1),target:this._elScrollWrap}),this._bindOneEvent({eventName:"touchstart",listener:function(t){var i=e._elScrollWrap.scrollLeft,o=t.touches[0].clientX,n=function(t){var n=o-t.touches[0].clientX;e._elScrollWrap.scrollLeft=i+n},r=function(t){e._elScrollWrap.removeEventListener("touchmove",n),e._elScrollWrap.removeEventListener("touchend",r)};e._elScrollWrap.addEventListener("touchmove",n),e._elScrollWrap.addEventListener("touchend",r)},target:this._elScrollWrap}),this._bindOneEvent({eventName:"click",listener:function(t){var i=e.getTabsArray(),r=0,s=!1,a=e._elScrollWrap.scrollLeft;i.forEach(function(t){if(!s){var e=t.offsetLeft+t.offsetWidth;e>a?s=!0:r=e}}),o.lazyVelocity().then(function(){$.Velocity.animate(e._elScrollWrap,"scroll",{axis:"x",container:$(e._elScrollWrap),duration:n.dur/2,easing:"easeInOutCubic",offset:Math.floor(r-a-e._getElWidth(e._elArrowLeft)),queue:!1})})},target:this._elArrowLeft}),this._bindOneEvent({eventName:"click",listener:function(t){var i=e.getTabsArray(),r=0,s=e._elScrollWrap.scrollLeft+e._getElWidth(e._elScrollWrap);i.forEach(function(t){if(0===r){var e=t.offsetLeft+t.offsetWidth;e>s&&(r=e)}}),o.lazyVelocity().then(function(){$.Velocity.animate(e._elScrollWrap,"scroll",{axis:"x",container:$(e._elScrollWrap),duration:n.dur/2,easing:"easeInOutCubic",offset:Math.ceil(r-s+e._getElWidth(e._elArrowRight)),queue:!1})})},target:this._elArrowRight}),t=Array.prototype.slice.call(this._elTabs.querySelectorAll(".js-tabs__slider-hover")||[]),t.length&&t.forEach(function(t){return e._bindOneEvent({eventName:"mouseenter",listener:function(t){if(!e._animating){var i=t.currentTarget
;i&&e._options.activeTabClass&&i.classList&&i.classList.contains(e._options.activeTabClass)&&e._hoverSlider(i)}},target:t})}),this._bindOneEvent({eventName:"resize",listener:function(){e.checkScrollArrows(!0),e._options.noSlider||e.resizeSlider()},target:window})},t.prototype._bindTabEvents=function(t){var e=this;this._bindOneEvent({eventName:Modernizr.touch?"touchend":"click",listener:function(t){"function"==typeof e._options.onTabClick?e._options.onTabClick(t):e.onTabClick(t)},target:t})},t.prototype._unbindTabEvents=function(t){this._unbindEvents({target:t})},t.prototype._bindOneEvent=function(t){t.target.addEventListener(t.eventName,t.listener),this._bindings.push(t)},t.prototype._unbindEvents=function(t){var e=function(e){return!(void 0!==e.eventName&&e.eventName!==t.eventName||void 0!==e.target&&e.target!==t.target||void 0!==e.listener&&e.listener!==t.listener)};this._bindings.filter(e).forEach(function(t){return t.target.removeEventListener(t.eventName,t.listener)}),this._bindings=this._bindings.filter(function(t){return!e(t)})},t.prototype._getActiveElement=function(t,e,i){var o=function(t,o,n){return e?t.classList.contains(e):!!i&&!t.classList.contains(i)};return t.filter(o)[0]||null},t.prototype._isTabDisabled=function(t){return t.classList.contains("i-disabled")||this._options.tabDisabledClass&&t.classList.contains(this._options.tabDisabledClass)||t.hasAttribute("disabled")},t.prototype._hoverSlider=function(t){var e,i=this,r=this._getElWidth(t),s=window.getComputedStyle(t),a=t.offsetLeft+parseInt(s.getPropertyValue("padding-left"))+parseInt(s.getPropertyValue("margin-left")),l={duration:n.dur/4,easing:"easeOutCubic",queue:!1};o.lazyVelocity().then(function(){$.Velocity.animate(i._elSlider,{left:a},l),$.Velocity.animate(i._elSlider,{width:r},l)}),e=function(){i.getElActiveTab()===t&&i._unhoverSlider(t),t.removeEventListener("mousleave",e)},t.addEventListener("mouseleave",e)},t.prototype._unhoverSlider=function(t){var e=this,i=window.getComputedStyle(t),r=t.querySelector(".js-tabs__slider-pos"),s=window.getComputedStyle(r),a=t.offsetLeft+parseInt(i.getPropertyValue("padding-left"))+parseInt(i.getPropertyValue("margin-left"))+parseInt(s.getPropertyValue("padding-left"))+r.offsetLeft,l=this._getElWidth(t),c=l-(l-this._getElWidth(r)),h={duration:n.dur/2,easing:"easeInSine",queue:!1};o.lazyVelocity().then(function(){$.Velocity.animate(e._elSlider,{left:a},h),$.Velocity.animate(e._elSlider,{width:c},h)})},t}(),e.Tabs=p},function(t,e){},function(t,e,i){"use strict";function o(t){var e,i=[];for(e=1;e<arguments.length;e++)i[e-1]=arguments[e];return t&&"object"==typeof t?0===i.length?t:(i.forEach(function(e){void 0!==e&&null!==e&&"object"==typeof e&&Object.keys(e).forEach(function(i){var r,s,a=t[i],l=e[i];l===t||(r=Array.isArray(l),l&&(n(l)||r)?(s=void 0,s=r?a&&Array.isArray(a)?a:[]:a&&n(a)?a:{},t[i]=o(s,l)):void 0!==l&&(t[i]=l))})}),t):t}function n(t){var e,i,o;return!(!t||"[object Object]"!==Object.prototype.toString.call(t))&&(!(e=Object.getPrototypeOf(t))||(i=Object.hasOwnProperty.toString,
"function"==typeof(o=e.hasOwnProperty("constructor")&&e.constructor)&&i.call(o)===i.call(Object)))}Object.defineProperty(e,"__esModule",{value:!0}),e.deepExtend=o},function(t,e){},function(t,e){},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),i(961),n=i(362),r={invalid:"tv-market-status--invalid",market:"tv-market-status--market",out_of_session:"tv-market-status--out-of-session",post_market:"tv-market-status--post-market",pre_market:"tv-market-status--pre-market",loading:"tv-market-status--loading",replay:"tv-market-status--replay"},s={invalid:$.t("Invalid Symbol"),market:$.t("Market Open"),out_of_session:$.t("Market Closed"),post_market:$.t("Post Market"),pre_market:$.t("Pre Market"),loading:$.t("Loading"),replay:""},a={classMap:r,classSuffix:"",data:{},extraTitle:"",labelMap:s,short:!1,showTooltip:!0},l=function(t){function e(e){var i=t.call(this)||this;return i._quoteSessionPrefix="market-status-indicator",i._componentClass="tv-market-status",i._extraTitle="",i._init(e),i}return o.__extends(e,t),e.prototype.setStatus=function(t,e){var i={values:{current_session:t}};this.update(i,e)},e.prototype.getTooltipText=function(){var e=t.prototype.getTooltipText.call(this);return""===e?e:(""!==this._extraTitle&&(e=e+", "+this._extraTitle),e)},e.prototype.setExtraTitle=function(t){this._extraTitle=t},e.prototype.reset=function(){this._clearClasses(),this._labelEl.textContent="",this._extraTitle="",this._el.setAttribute("title",""),this._value=""},e.prototype.enableShortMode=function(e){void 0===e&&(e=!0),void 0!==this._labelEl&&this._labelEl.classList.add("i-hidden"),t.prototype.enableShortMode.call(this)},e.prototype.disableShortMode=function(){void 0!==this._labelEl&&this._labelEl.classList.remove("i-hidden"),t.prototype.disableShortMode.call(this)},e.prototype._renderLabel=function(){this._labelEl.textContent=this.getLabel()},e.prototype._getValueFromData=function(t){return void 0!==t.values&&void 0!==t.values.current_session?t.values.current_session:this.getValue()},e.prototype._render=function(){this._renderLabelElement(),this._renderDotElement(),t.prototype._render.call(this)},e.prototype._init=function(e){var i=Object.assign({},a,e);t.prototype._init.call(this,i),this.setExtraTitle(i.extraTitle),this._render()},e.prototype._renderLabelElement=function(){void 0===this._labelEl&&(this._labelEl=document.createElement("span"),this._labelEl.classList.add(this._componentClass+"__label"),this._labelEl.classList.add(this._componentClass+"__label"+this._classSuffix),this._el.appendChild(this._labelEl))},e.prototype._renderDotElement=function(){void 0===this._dotEl&&(this._dotEl=document.createElement("span"),this._dotEl.classList.add(this._componentClass+"__dot"),this._dotEl.classList.add(this._componentClass+"__dot"+this._classSuffix),this._el.appendChild(this._dotEl))},e}(n.AbstractIndicator),e.MarketStatusIndicator=l},function(t,e){},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),i(102),i(963),
n=i(362),r={connecting:"tv-data-mode--connecting",delayed:"tv-data-mode--delayed",delayed_streaming:"tv-data-mode--delayed",endofday:"tv-data-mode--endofday",forbidden:"tv-data-mode--forbidden",realtime:"tv-data-mode--realtime",snapshot:"tv-data-mode--snapshot",loading:"tv-data-mode--loading",replay:"tv-data-mode--replay"},s={connecting:$.t("Connecting"),delayed:$.t("Delayed"),delayed_streaming:$.t("Delayed"),endofday:$.t("End of Day"),forbidden:$.t("Instrument is not allowed"),realtime:$.t("Realtime"),snapshot:$.t("Snapshot"),loading:"",replay:$.t("Replay Mode")},a={connecting:$.t("C",{context:"data_mode_connecting_letter"}),delayed:$.t("D",{context:"data_mode_delayed_letter"}),delayed_streaming:$.t("D",{context:"data_mode_delayed_streaming_letter"}),endofday:$.t("E",{context:"data_mode_end_of_day_letter"}),forbidden:$.t("F",{context:"data_mode_forbidden_letter"}),realtime:$.t("R",{context:"data_mode_realtime_letter"}),snapshot:$.t("S",{context:"data_mode_snapshot_letter"}),loading:"",replay:$.t("R",{context:"data_mode_replay_letter"})},l=600,c={streaming:"realtime"},h={classMap:r,classSuffix:"",data:{values:{update_mode:"connecting"}},labelMap:s,modeInterval:l,short:!1,shortLabelMap:a,showTooltip:!0},u=function(t){function e(e){var i=t.call(this)||this;return i._quoteSessionPrefix="data-mode-indicator",i._componentClass="tv-data-mode",i._init(e),i}return o.__extends(e,t),e.prototype.getLabel=function(){return!0===this._shortMode?this._shortLabelMap[this._value]||"":t.prototype.getLabel.call(this)},e.prototype.setMode=function(t,e){this.update({values:{update_mode:t,update_mode_seconds:e}})},e.prototype.hide=function(){this._el.classList.add("i-hidden")},e.prototype.show=function(){this._el.classList.remove("i-hidden")},e.prototype.getTooltipText=function(){var t="",e=this.getValue();if(""===e)return t;switch(e){case"delayed":t=$.t("Quotes are delayed by {0} min and updated every 30 seconds");break;case"delayed_streaming":t=$.t("Quotes are delayed by {0} min");break;default:t=this._labelMap[e]||t}return["delayed","delayed_streaming"].includes(e)&&(t=t.format(Math.round(this._modeInterval/60))),t},e.prototype._init=function(e){void 0===e&&(e={});var i=Object.assign({},h,e);this._modeInterval=i.modeInterval||l,this._shortLabelMap=i.shortLabelMap||a,t.prototype._init.call(this,i),this._render()},e.prototype._getValueFromData=function(t){var e;return e=void 0!==t.values&&void 0!==t.values.update_mode?t.values.update_mode:this.getValue(),c[e]||e},e.prototype._updateValue=function(e,i){void 0!==e.values&&void 0!==e.values.update_mode_seconds&&(this._modeInterval=e.values.update_mode_seconds),t.prototype._updateValue.call(this,e,i)},e}(n.AbstractIndicator),e.DataModeIndicator=u},function(t,e){},function(t,e,i){"use strict";function o(){function t(t){return f&&e(),f=new r.UndoMacroCommand(t)}function e(){if(f){var t=f;f=null,t.isEmpty()||a(t)}}function i(){if(m.isEmpty())return!1;var t=m.pop();return!!t&&(t.undo(),g.push(t),l.logNormal("UNDO: "+t.text()),!0)}function o(){if(g.isEmpty())return!1;var t=g.pop()
;return!!t&&(t.redo(),m.push(t),l.logNormal("REDO: "+t.text()),!0)}function a(t){var e,i,o;f?f.addCommand(t):(g.clear(),e=m.head(),i=e&&e.text(),m.push(t),""!==(o=t.text())&&o!==i&&l.logNormal("DO: "+o)),t.executeOnPush()&&t.redo()}function c(){return{lastActualCommand:m.isEmpty()?null:m.head()}}function h(t){for(;!m.isEmpty()&&t.lastActualCommand!==m.head();)m.pop().undo();g.clear()}function u(){return m}function d(){return g}function p(){m.clear(),g.clear()}function _(t,e,i){if(t.value()!==e){var o=new s.SetWatchedValueCommand(t,e,i);a(o),o.redo()}}var f=null,m=new n.UndoStack,g=new n.UndoStack;return{beginUndoMacro:t,clearStack:p,createUndoCheckpoint:c,endUndoMacro:e,pushUndoCommand:a,redo:o,redoStack:d,setWatchedValue:_,undo:i,undoStack:u,undoToCheckpoint:h}}var n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),n=i(356),r=i(323),s=i(965),a=i(7),l=a.getLogger("Common.UndoHistory"),e.createUndoHistory=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(72),r=function(t){function e(e,i,o){var n=t.call(this,o)||this;return n._wv=e,n._newValue=i,n._oldValue=e.value(),n}return o.__extends(e,t),e.prototype.redo=function(){this._wv.setValue(this._newValue)},e.prototype.undo=function(){this._wv.setValue(this._oldValue)},e}(n.UndoCommand),e.SetWatchedValueCommand=r},function(t,e,i){"use strict";function o(t,e,o){void 0===e&&(e={}),i.e(2).then(function(n){i(178).getImageOfChart(t,e,o)}.bind(null,i)).catch(i.oe)}function n(t,e,o){void 0===e&&(e={}),i.e(2).then(function(n){i(178).getImageOfChartSilently(t,e,o)}.bind(null,i)).catch(i.oe)}Object.defineProperty(e,"__esModule",{value:!0}),e.getImageOfChart=o,e.getImageOfChartSilently=n},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(72),r=i(216),s=function(t){function e(e,i){var o=this,n="Change Chart Layout to "+r.layouts[i].title;return o=t.call(this,n)||this,o._chartWidgetCollection=e,o._newLayoutType=i,o._oldLayoutType=e.layout.value(),o}return o.__extends(e,t),e.prototype.redo=function(){this._chartWidgetCollection.layout.setValue(this._newLayoutType)},e.prototype.undo=function(){this._chartWidgetCollection.layout.setValue(this._oldLayoutType)},e}(n.UndoCommand),e.SetChartLayoutCommand=s},function(t,e,i){"use strict";function o(t){return new Promise(function(e,i){t.subscribe(null,e,!0)})}Object.defineProperty(e,"__esModule",{value:!0}),e.delegateToPromise=o},function(t,e,i){"use strict";function o(t){r.call(this,t);var e=this;a.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!a.hideMarksOnBars().value())})}function n(t){s.call(this)}var r=i(106).BarsMarksContainer,s=i(230).BarMarkTooltip,a=i(26);inherit(o,r),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedBarsMarks",o.prototype._plateViewData=function(t){var e={text:t.text};return"object"==typeof t.color&&(e.theme="user_defined_theme",e.overridedTheme={},
e.overridedTheme.border=t.color.border,e.overridedTheme.background=t.color.background),e},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;this._marks[t].onClicked()},o.prototype.clearMarks=function(){r.prototype.clearMarks.call(this),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype._createTooltip=function(){return new n},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},inherit(n,s),n.prototype._createLayout=function(){this._layout=$('<div class="bar-mark-tooltip"></div>'),this._layout_text=$('<div class="text"></div>').appendTo(this._layout)},n.prototype._updatePlate=function(t){this._currentId=t.id,this._layout.css("border-color",t.theme.border),this._layout.css("margin-top",t.tooltipMargin+"px"),this._layout_text.html(t.text),this._layout.append(this._layout_text)},t.exports=o},function(t,e,i){"use strict";function o(t){a.call(this,t);var e=this;l.hideMarksOnBars().subscribe(this,function(){e._properties.visible.setValue(!l.hideMarksOnBars().value())}),this._paneView=new n(this)}function n(t,e){this.source=t,this._rendererFactory=e,this.stylesCache={},this.templatesCache={},this._lollipops={},this._createLollipops()}var r=i(8).Point,s=i(971).ESDPaneView,a=i(106).BarsMarksContainer,l=i(26),c=i(23),h=i(363).Tooltip;inherit(o,a),o.prototype._initialize=function(t){this._properties.visible.setValue(!0)},o.prototype.userEditEnabled=function(){return!1},o.prototype._constructor="UserDefinedTimescaleMarks",o.prototype._plateViewData=function(t){return{text:t.text}},o.prototype.onClicked=function(){var t=this._model.lastHittestData().id;c.emit("onTimescaleMarkClick",t)},o.prototype.clearMarks=function(){a.prototype.clearMarks.call(this),this._paneView.clearCaches(),this.onNeedRepaint.fire()},o.prototype._getData=function(t){var e,i,o,n=this._model.mainSeries().symbolInfo();n&&(e=this.roundRange(this._rangeDifference(t)),i=this,o=this._model.mainSeries().properties().interval.value(),ChartApiInstance.getTimescaleMarks(n,e.start,e.end,function(e){e.forEach(function(t){i._marks[t.id]=t},i),i._loadedRange=i._rangeUnion(t,i._loadedRange),i.onNeedRepaint.fire()},o))},o.prototype.updatePlateData=function(t,e){return e.barWidth=this.barWidth(),e.text=t.text,e.tooltipMargin=-1*Math.max(t.minSize/2,.4*this.barWidth()),e},o.prototype.hasContextMenu=function(){return!1},o.prototype.paneViews=function(t){return this._properties.visible.value()?[this._paneView]:[]},o.prototype.onClickOutside=function(t){this._paneView.onClickOutside(t)},inherit(n,s),n.prototype._createLollipops=function(){
var t=this.source._model.timeScale(),e=s.prototype._getY.call(this.source),i=this.source._model.lastHittestData(),o=this;$.each(this.source._marks,function(n,s){var a=s.id;o._lollipops[a]={id:a,basePoint:new r(t.indexToCoordinate(t.timePointToIndex(s.tickmark))+1,e),hovered:i&&i.id===a||a===o.getLastClickedLollipopId(),barY:null,label:s.label,color:s.color,items:s.tooltip,tooltip:o._lollipops.hasOwnProperty(a)?o._lollipops[a].tooltip:new h,visible:!0}})},n.prototype.clearCaches=function(){this._lollipops={}},n.prototype.update=function(){this._createLollipops()},n.prototype.renderer=function(){return this.update(),s.prototype.renderer.call(this)},n.prototype._generateTemplateStyle=function(t,e,i){var o,n,r=t+e+i;return r in this.stylesCache||(o={strokeStyle:e,lineWidth:1,fillStyle:"white",barLine:{lineStyle:CanvasEx.LINESTYLE_DASHED},lollipop:{width:32,height:96,circleHeight:16,radius:12,lineWidth:1.5,fillStyle:"white",strokeStyle:"#E2745B",text:{label:i,strokeStyle:e,font:"normal 12px Verdana, Arial, sans-serif"}}},n={strokeStyle:e,lollipop:{fillStyle:e,fillCircle:!0,text:{strokeStyle:"white"}}},this.stylesCache[r]="default"===t?o:$.extend(!0,{},o,n)),this.stylesCache[r]},n.prototype.getTemplate=function(t,e){var i=t+e.color+e.label;return i in this.templatesCache||(this.templatesCache[i]=this.createTemplate(this._generateTemplateStyle(t,e.color,e.label))),this.templatesCache[i]},n.prototype.getStyle=function(t,e){return this._generateTemplateStyle(t,e.color,e.label)},n.prototype.createText=function(t,e){"string"==typeof t.items?e.addTextLine(t.items):Array.isArray(t.items)&&t.items.forEach(function(t){e.addTextLine(t)})},n.prototype.hasTooltip=function(t){return!!t.tooltip&&t.tooltip.length},t.exports=o},function(t,e,i){"use strict";function o(t,e){this._lastClickedId=null,this._model=t,this._study=e,this._metaInfo=e.metaInfo(),this._lollipops={},this._textCache={},this.templatesCache={},this._invalidated=!0,this.templatesCache.hovered=this.createTemplate(this.hoveredStyle),this.templatesCache.default=this.createTemplate(this.defaultStyle),t.properties().paneProperties.background.subscribe(this,this.onPaneBgChange)}function n(t){this.data=t}function r(t){this.data=t,this._hittest=new c(c.CUSTOM,t)}function s(t,e){this._data=t,this._paneView=e,this.textRenderer=new s.TextRenderer(t.style.lollipop.importance)}var a=i(8).Point,l=i(60).pointInCircle,c=i(11),h=i(53).CompositeRenderer,u=i(363).Tooltip;o.prototype.onPaneBgChange=function(){this.defaultStyle.lollipop.fillStyle=this._model.properties().paneProperties.background.value(),this._stylesCache=null,Object.keys(this.templatesCache).forEach(function(t){0===t.indexOf("default")&&(this.templatesCache[t]=null)},this)},o.prototype.onClickOutside=function(){this._lastClickedId=null},o.prototype.closeTooltips=function(){var t,e;for(t in this._lollipops)this._lollipops.hasOwnProperty(t)&&(e=this._lollipops[t],e.visible&&(e.tooltip.isOpened()&&e.tooltip.hide(),e.visible=!1))},o.prototype.getLastClickedLollipopId=function(){return this._lastClickedId},
o.prototype._setStackStudies=function(){this._stackStudies=[]},o.prototype._getY=function(){var t,e,i=0,o=this._model.panes();for(t=o.length;t--;)e=o[t],e.containsMainSeries()&&(i+=e.height());return i},o.prototype.update=function(){this._invalidated=!0},o.prototype.updateImpl=function(){var t,e,i,o,n,r,s,a,l,c,h,u;this._setStackStudies(),t=this,e=this._study.data(),i=this._model.timeScale(),o=i.visibleBars(),n=this._model.mainSeries().bars(),r=this._study.priceScale(),s=this._model.mainSeries(),a=s.firstBar(),r&&!r.isEmpty()&&!i.isEmpty()&&a&&e&&(this.closeTooltips(),l=this._getY(),c=o.firstBar(),h=o.lastBar(),u=e.range(c,h),u.each(function(e,o){var s,a=0;for(s=0;s<t._stackStudies.length;++s)t._stackStudies[s].data().contains(e)&&++a;e>c&&e<h&&t.addLollipop(l,n,i,r,e,o,a)}),this.afterUpdate(l,n,i,r))},o.prototype.addLollipop=function(t,e,i,o,n,r,s){var l,c,h,d,p,_,f,m,g=r[0],v=this._model.mainSeries().symbolInfo();v&&(l=v.name,c=null,h=this._study.metaInfo().id+"_"+g+"_"+l,d=this._model.lastHittestData(),p=d&&d.id===h,p&&null!==(_=e.valueAt(n))&&(f=_[TradingView.LOW_PLOT],o.isPercent()&&(m=this._model.mainSeries().firstValue(),f=o.priceRange().convertToPercent(f,m)),c=o.priceToCoordinate(f)),this._lollipops[h]=$.extend({id:h,visible:!0,basePoint:new a(i.indexToCoordinate(n)+1,t),hovered:p||h===this.getLastClickedLollipopId(),barY:c,stack:s,tooltip:this._lollipops.hasOwnProperty(h)?this._lollipops[h].tooltip:new u},this.extraData(r)))},o.prototype.afterUpdate=function(t,e,i){},o.prototype.extraData=function(t){throw Error("Not Implemented")},o.prototype.createText=function(t,e){throw Error("Not Implemented")},o.prototype.showBarLine=function(){return!0},o.prototype.getStyle=function(t,e){var i,o=t;return e.stack&&(o+="_stack:"+e.stack),"hovered"===o?this.hoveredStyle:"default"===o?this.defaultStyle:(this._stylesCache||(this._stylesCache={}),this._stylesCache[o]||(i=TradingView.clone("hovered"===t?this.hoveredStyle:this.defaultStyle),e.stack&&(i.lollipop.incHeight=24*e.stack),this._stylesCache[o]=i),this._stylesCache[o])},o.prototype.hasTooltip=function(t){return!0},o.prototype.renderer=function(){var t,e,i,o,l,c,u,d,p;this._invalidated&&(this.updateImpl(),this._invalidated=!1),t=new h;for(e in this._lollipops)this._lollipops.hasOwnProperty(e)&&(i=this._lollipops[e],o=15,l=this.getStyle(i.hovered?"hovered":"default",i),i.visible&&(c=$.extend({tooltipPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-o-(l.lollipop.incHeight||0)),style:l,createText:this.createText.bind(this)},i),u=this.getTemplate(i.hovered?"hovered":"default",i),d={circlePoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight-(l.lollipop.incHeight||0)),style:l,template:u,basePoint:i.basePoint,id:i.id,mouseClickHandler:this._lollipopMouseClickHandler.bind(this,i.id)},t.append(new r(d)),i.hovered&&this.hasTooltip(i)&&i.barY&&this.showBarLine()&&(p={style:{lineStyle:l.barLine.lineStyle,strokeStyle:l.strokeStyle,lineWidth:l.lineWidth},startPoint:new a(i.basePoint.x,i.basePoint.y-l.lollipop.circleHeight),
endPoint:new a(i.basePoint.x,i.barY)},t.append(new n(p))),t.append(new s(c,this))));return t},o.prototype.getTemplate=function(t,e){var i=t;return e.stack&&(i+="_stack:"+e.stack),this.templatesCache[i]||(this.templatesCache[i]=this.createTemplate(this.getStyle(t,e))),this.templatesCache[i]},o.prototype.createTemplate=function(t){var e=document.createElement("canvas"),i=e.getContext("2d"),o=new a(t.lollipop.width/2,t.lollipop.height-t.lollipop.circleHeight-(t.lollipop.incHeight||0));return this.drawCircle(i,t,o),this.drawLabel(i,t,o),e},o.prototype.drawCircle=function(t,e,i){t.strokeStyle=e.strokeStyle,t.fillStyle=e.lollipop.fillStyle,t.lineWidth=e.lollipop.lineWidth,CanvasEx.setLineStyle(t,CanvasEx.LINESTYLE_SOLID),t.beginPath(),t.arc(i.x,i.y,e.lollipop.radius,0,2*Math.PI,!1),t.closePath(),t.stroke(),e.lollipop.fillCircle&&t.fill()},o.prototype.drawLabel=function(t,e,i){t.textAlign="center",t.textBaseline="middle",t.fillStyle=e.lollipop.text.strokeStyle,t.font=e.lollipop.text.font,t.fillText(e.lollipop.text.label,i.x,i.y)},o.prototype._lollipopMouseClickHandler=function(t){this._lastClickedId=this._lastClickedId===t?null:t},n.prototype.draw=function(t){t.strokeStyle=this.data.style.strokeStyle,t.lineWidth=this.data.style.lineWidth,CanvasEx.setLineStyle(t,this.data.style.lineStyle),CanvasEx.drawLine(t,this.data.startPoint.x,this.data.startPoint.y,this.data.endPoint.x,this.data.endPoint.y)},n.prototype.hitTest=function(t){return null},r.prototype.hitTest=function(t){return l(t,this.data.circlePoint,this.data.style.lollipop.radius)?this._hittest:null},r.prototype.draw=function(t){var e=this.data.template;t.drawImage(e,this.data.basePoint.x-(.5+this.data.style.lollipop.width/2<<0)+.5,this.data.basePoint.y-this.data.style.lollipop.height+.5)},s.prototype.draw=function(t){this._data.createText(this._data,this.textRenderer),this._paneView.getLastClickedLollipopId()===this._data.id?this._data.tooltip.show({items:[this.textRenderer],x:this._data.basePoint.x,y:this._data.basePoint.y-this._data.style.lollipop.circleHeight-10-2*this._data.style.lollipop.radius*(this._data.stack?this._data.stack:0),wrapElement:t.canvas.parentNode,leftBorderColor:this._data.color}):this._data.tooltip.hide()},s.prototype.hitTest=function(t){return null},s.TextRenderer=function(t){this.lines=[],this.fontHeight=12,this.font=this.fontHeight+"px Arial, sans-serif",this.lineSpacing=8,this.fillStyle="black",t&&(this.importance=t)},s.TextRenderer.prototype.draw=function(t,e){var i,o,n=e.y;for(i=0;i<this.lines.length;i++)o=this.lines[i],t.font=this.font,o.options.fontWeight&&(t.font=o.options.fontWeight+" "+this.font),t.fillStyle=this.fillStyle,o.renderer(t,o.line,{x:e.x,y:n}),n+=this.lineSpacing+this.fontHeight},s.TextRenderer.prototype.measure=function(){return this.lines.length*(this.fontHeight+this.lineSpacing)-this.lineSpacing},s.TextRenderer.prototype.basicRenderer=function(t,e,i){t.fillText(e,i.x,i.y)},s.TextRenderer.prototype.addMulticolorTextLine=function(t,e){this.addTextLine(t,e,this.multicolorRenderer)},
s.TextRenderer.prototype.addTextLine=function(t,e,i){i||(i=this.basicRenderer),e||(e={}),this.lines.push({line:t,renderer:i,options:e})},s.TextRenderer.prototype.multicolorRenderer=function(t,e,i){var o,n,r=i.x;for(o=0;o<e.length;++o)n=e[o],t.fillStyle=n.color,t.fillText(n.text,r,i.y),r+=t.measureText(n.text).width},e.ESDPaneView=o},function(t,e){},function(t,e,i){"use strict";(function(t){var o,n,r,s,a,l,c,h,u,d,p;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(13),i(41),i(43),i(12),n=i(364),r=i(309),s=i(52),a=i(108),l=i(26),c=i(66),h=i(24),u=i(17),i(975),d='<span class="tv-favorited-drawings-toolbar__widget {{#isActive}}i-active{{/isActive}} apply-common-tooltip" title="{{title}}">{{{icon}}}</span>',p=function(e){function i(t){var i=e.call(this,{allowSortable:!Modernizr.touch,defaultPosition:t,positionSettingsKey:"chart.favoriteDrawingsPosition"})||this;return i._linetoolsWidgets={},i._canBeShownValue=new u(!1),i._attachHandlers(),i._loadVisibilityState(),i}return o.__extends(i,e),i.prototype.show=function(){this._canBeShownValue.value()&&(h.setValue(i._visibilitySettingsKey,!0),this.isVisible()||this._renderAllLinetools(),e.prototype.show.call(this))},i.prototype.hide=function(){h.setValue(i._visibilitySettingsKey,!1),e.prototype.hide.call(this)},i.prototype.canBeShown=function(){return this._canBeShownValue.readonly()},i.prototype._onFavoriteAdded=function(t){this._canBeShownValue.setValue(!0),this.addWidget(this._createLinetoolWidget(t)),this.show()},i.prototype._onFavoriteRemoved=function(t){this.removeWidget(this._linetoolsWidgets[t]),delete this._linetoolsWidgets[t],0===r.LinetoolsFavoritesStore.favoritesCount()&&(this._canBeShownValue.setValue(!1),this.hide())},i.prototype._onFavoriteMoved=function(){this._renderAllLinetools()},i.prototype._onSelectedLinetoolChanged=function(t){var e=this;Object.keys(this._linetoolsWidgets).forEach(function(i){e._linetoolsWidgets[i].classList.toggle("i-active",t===i)})},i.prototype._createLinetoolWidget=function(e){var i=$(t.render(d,{icon:c.lineToolsInfo[e].icon,isActive:e===l.tool.value(),title:c.lineToolsInfo[e].localizedName}))[0];return i.addEventListener("click",function(t){t.preventDefault(),l.tool.value()===e?l.resetToCursor():l.tool.setValue(e)}),this._linetoolsWidgets[e]=i,i},i.prototype._renderAllLinetools=function(){var t=this;this._linetoolsWidgets={},this.removeWidgets(),r.LinetoolsFavoritesStore.favorites().forEach(function(e){t.addWidget(t._createLinetoolWidget(e))})},i.prototype._attachHandlers=function(){var t=this;r.LinetoolsFavoritesStore.favoriteAdded.subscribe(this,this._onFavoriteAdded),r.LinetoolsFavoritesStore.favoriteRemoved.subscribe(this,this._onFavoriteRemoved),r.LinetoolsFavoritesStore.favoriteMoved.subscribe(this,this._onFavoriteMoved),r.LinetoolsFavoritesStore.favoritesSynced.subscribe(null,function(){t._loadVisibilityState(),t._renderAllLinetools()}),this.onWidgetsReordered().subscribe(this,function(e,i){if(r.LinetoolsFavoritesStore.favoriteMoved.unsubscribe(t,t._onFavoriteMoved),
!r.LinetoolsFavoritesStore.moveFavorite(r.LinetoolsFavoritesStore.favorite(e),i))throw Error("Something went wrong");r.LinetoolsFavoritesStore.favoriteMoved.subscribe(t,t._onFavoriteMoved)}),this.onContextMenu(function(e){e.preventDefault();var i=new s.Action({text:$.t("Hide Favorite Drawings Toolbar")});i.callbacks().subscribe(null,function(){t.hide()}),a.createMenu([i]).show(e)}),l.tool.subscribe(this._onSelectedLinetoolChanged.bind(this))},i.prototype._loadVisibilityState=function(){var t,e=r.LinetoolsFavoritesStore.favoritesCount()>0;this._canBeShownValue.setValue(e),t=h.getBool(i._visibilitySettingsKey,!0),t&&e?this.show():this.hide()},i._visibilitySettingsKey="ChartFavoriteDrawingToolbarWidget.visible",i}(n.FloatingToolbar),e.FavoriteDrawingToolbar=p}).call(e,i(41))},function(t,e){},function(t,e){},function(t,e,i){"use strict";(function(e,o){function n(t){this._chartWidgetCollection=t,this._bindings=[],this._hasAlertWathcedValue=null,this._$templatesButton=null,this._currentProperties=null,this._toolbarWidgets=[],this._clearProeprtiesOnHideTimeoutId=null,this._init(),this.attachHandlers()}function r(t,e){t.push({id:e,widget:$('<div class="tv-linetool-properties-toolbar__text">'+e+"</div>")[0]})}function s(t,e){t.push({id:e.value,widget:$(e.iconSvgCode)[0]})}function a(t,e){return $("<div>").addClass("tv-linetool-properties-toolbar__icon").addClass(e).append(t)[0]}function l(t){return a(t,"tv-linetool-properties-toolbar__icon--line-props")}var c,h,u,d,p,_,f,m,g,v,y,b,S,w,T,C=i(238),x=C.PropertyPage,P=C.ColorBinding,L=i(106).BarsMarksContainer,I=i(1).LineDataSource,k=i(26),A=i(385),M=i(133).bindPopupMenu,E=i(6).DefaultProperty,D=i(977).GroupButtonFloatingToolbar,V=i(136).showEditObjectDialog,O=i(74).LineEnd;i(175),i(979),n.prototype.activeChartWidget=function(){return this._chartWidgetCollection.activeChartWidget.value()},n.prototype.selectedSource=function(){return this._chartWidgetCollection.selectedSource.value()},n.prototype._init=function(){this._floatingToolbar=new D({addClass:"tv-linetool-properties-toolbar",defaultPosition:{top:window.headerChartPanel.outerHeight()+15,left:window.innerWidth/2},positionSettingsKey:"properties_toolbar.position"}),this._floatingToolbar.onWidgetStateChanged().subscribe(this,this._onPropertyChangedInToolbar),this._sourceActions=this._createSourceActions(),this._sourceActions.forEach(function(t){this._floatingToolbar.addWidget(t.button)},this)},n.prototype._bindPopupMenuDirection=function(){return this._floatingToolbar.isVertical()?"right":"down"},n.prototype._onPropertyChangedInToolbar=function(t,e){this._currentProperties&&this.activeChartWidget().model().setProperty(this._currentProperties[t],e)},n.prototype._onPropertyChanged=function(t,e){this._floatingToolbar.setGroupedWidgetState(t,e.value())},n.prototype._hideAllSourceActions=function(){this._sourceActions.forEach(function(t){this._floatingToolbar.hideWidget(t.button)},this),this._sourceActionsVisible=!1},n.prototype._updateSourceActionsVisibility=function(t){this._sourceActionsVisible=!1,
this._sourceActions.forEach(function(e){!e.isVisibleForSource||e.isVisibleForSource(t)?(this._floatingToolbar.showWidget(e.button),this._sourceActionsVisible=!0):this._floatingToolbar.hideWidget(e.button)},this)},n.prototype.attachHandlers=function(){k.tool.subscribe(this.onToolChanged.bind(this),{callWithLast:!0}),this._chartWidgetCollection.selectedSource.subscribe(this.onSourceChanged.bind(this))},n.prototype.onToolChanged=function(t,e){if(t&&-1!==t.toLowerCase().indexOf("linetool")){var e=e instanceof E?e:new E(t.toLowerCase());this._hideAllSourceActions(),this.showPropertiesOf(t,e),this.showTemplatesOf({tool:t,properties:e}),this._updateVisibility()}else this.selectedSource()?this.onSourceChanged(this.selectedSource()):this.hide()},n.prototype.findSourceOnWidget=function(t){var e,i,o,n;for(e=0;e<this.activeChartWidget().model().panes().length;e++)for(i=this.activeChartWidget().model().panes()[e],o=i.orderedSources(),n=0;n<o.length;n++)if(o[n]===t)return o[n]},n.prototype.onSourceChanged=function(t){if(this._hasAlertWathcedValue&&(this._hasAlertWathcedValue.destroy(),this._hasAlertWathcedValue=null),!t)return void this.hide();t instanceof I&&!(t instanceof L)&&this.findSourceOnWidget(t)?(!t.userEditEnabled()||"LineToolBrush"!==t.toolname&&this.activeChartWidget().model().lineBeingCreated()?this._hideAllSourceActions():(this._updateSourceActionsVisibility(t),t.canHasAlert()&&(this._hasAlertWathcedValue=t.hasAlert.spawn(),this._hasAlertWathcedValue.subscribe(this._updateSourceActionsVisibility.bind(this,t)))),this.showPropertiesOf(t.getConstructor(),t.properties()),this.showTemplatesOf({source:t}),this._setupToggleLockButton(t),this._updateVisibility()):this.hide()},n.prototype.showTemplatesOf=function(t){var o,n,r,s,a;e.enabled("line_tool_templates")&&(o=t.source,o?(n=o.getConstructor(),r=o.properties()):(n=t.tool,r=t.properties),this._$templatesButton&&(this._floatingToolbar.removeWidget(this._$templatesButton[0]),this._$templatesButton=null),s=this,a=function(t){if(o){s.activeChartWidget().model().applyLineToolTemplate(o,t,"Apply Drawing Template"),s.onSourceChanged(o)}else r.merge(t),r.listeners().fire(this),r.saveDefaults(),s.onToolChanged(n,r)},TradingView.onWidget()&&!window.is_authenticated||!e.enabled("linetoolpropertieswidget_template_button")||(this._templatesList=new A(n,a,{buttonInner:'<div class="tv-linetool-properties-toolbar__icon">'+i(980)+'</div><span class="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret"></span>',buttonClass:"tv-linetool-properties-toolbar__button apply-common-tooltip",defaultsCallback:function(){if(void 0!==o){s.activeChartWidget().model().restoreLineToolFactoryDefaults(o,"Load default drawing template")}else r.restoreFactoryDefaults();s.showPropertiesOf(n,r)},saveAsText:$.t("Save Drawing Template As..."),applyDefaultText:$.t("Apply Default Drawing Template"),getDataForSaveAs:o?function(){return o.template()}:null,popupActiveClass:"i-dropped",popupDirection:this._bindPopupMenuDirection.bind(this)}),
this._$templatesButton=this._templatesList.createButton().attr("title",$.t("Templates")),this._floatingToolbar.addWidget(this._$templatesButton[0],{index:0})),this._templatesVisible=!0)},n.prototype.templatesList=function(){return this._templatesList},n.prototype._createButton=function(t){var e,i,o;return t=t||{},e=document.createElement("div"),e.setAttribute("title",t.title),e.className+="tv-linetool-properties-toolbar__button apply-common-tooltip",e.addEventListener("click",t.callback),t.svgIcon&&(i=document.createElement("div"),i.classList.add("tv-linetool-properties-toolbar__icon"),i.appendChild(t.svgIcon),e.appendChild(i)),t.addCaret&&(o=document.createElement("div"),o.className="tv-caret tv-caret--small tv-caret--colored tv-linetool-properties-toolbar__caret",e.appendChild(o)),e},n.prototype._createSettingsButton=function(){var t=this;return this._createButton({title:$.t("Settings"),callback:function(){V(t.selectedSource(),t.activeChartWidget().model(),{onWidget:t.activeChartWidget()._options.onWidget})},svgIcon:$(i(981))[0]})},n.prototype._createZOrderButton=function(){var t=this._createButton({title:$.t("Visual Order"),callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getZOrderActions()])}.bind(this),svgIcon:$(i(982))[0],addCaret:!0});return M($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createCloneButton=function(){var t,o=$.t("Clone");return e.enabled("datasource_copypaste")&&(o+=", "+$.t("Copy")),e.enabled("support_multicharts")&&(o+=", "+$.t("Sync")),t=this._createButton({title:o,callback:function(){t.classList.contains("i-dropped")||$(t).trigger("button-popup",[this._getCloneActions()])}.bind(this),svgIcon:$(i(983))[0],addCaret:!0}),M($(t),null,{direction:this._bindPopupMenuDirection.bind(this),event:"button-popup",reverse:!1,notCloseOnButtons:!0,activeClass:"i-dropped"}),t},n.prototype._createLockButton=function(){var t=this._createButton({title:$.t("Lock"),callback:function(){this.activeChartWidget().toggleLockSelectedObject()}.bind(this),svgIcon:$(i(417))[0]});return this._lockChangeListener=function(e){t.classList.toggle("i-active",!!e.value())},t},n.prototype._createHideButton=function(){return this._createButton({title:$.t("Hide"),callback:function(){this.activeChartWidget().hideSelectedObject()}.bind(this),svgIcon:$(i(984))[0]})},n.prototype._createRemoveButton=function(){return this._createButton({title:$.t("Remove"),callback:function(){this.activeChartWidget().removeSelectedSource()}.bind(this),svgIcon:$(i(985))[0]})},n.prototype._createSourceActions=function(){var t=[];return e.enabled("property_pages")&&t.push({button:this._createSettingsButton()}),t.push({button:this._createZOrderButton()},{button:this._createCloneButton(),isVisibleForSource:function(t){var e=TradingView.className(t.constructor);return!this.activeChartWidget().model().model().isSingleInstanceLineTool(e)}.bind(this)},{button:this._createLockButton()},{
button:this._createHideButton()},{button:this._createRemoveButton()}),t},n.prototype._getCloneActions=function(){var t=this.activeChartWidget().model(),i=this.selectedSource(),o=[];return i.properties().clonable.value()&&o.push({title:$.t("Clone"),action:function(){t.cloneLineTool(i)}}),e.enabled("datasource_copypaste")?(o.push({title:$.t("Copy"),shortcut:"Ctrl-C",action:function(){t.copySourceToClip(i)}}),e.enabled("support_multicharts")?(i.linkKey?o.push({title:$.t("Stop syncing"),action:function(){t.unlinkLine(i)}}):o.push({title:$.t("Sync to all charts"),action:function(){t.copyToOtherCharts(i)}}),o):o):o},n.prototype._getZOrderActions=function(){var t=[],e=this.selectedSource(),i=this.activeChartWidget().model(),o={title:$.t("Bring to Front"),action:function(){i.bringToFront(e)}},n={title:$.t("Send to Back"),action:function(){i.sendToBack(e)}},r={title:$.t("Bring Forward"),action:function(){i.changeZOrder(e,1)}},s={title:$.t("Send Backward"),action:function(){i.changeZOrder(e,-1)}},a=i.paneForSource(this.selectedSource()),l=a.getZOrderMinMax();return e.zorder()===l.minZOrder&&(n.disabled=!0,s.disabled=!0),e.zorder()===l.maxZOrder&&(r.disabled=!0,o.disabled=!0),t.push(o,n,r,s),t},n.prototype._getPossibleProperty=function(t){var e,i,o=[],r=this._defaultToolProperties();for(e=0;e<r.length;e++)i=r[e],i.name in t&&o.push(i);return t.extendLeft||(o=o.map(function(t){return"leftEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),t.extendRight||(o=o.map(function(t){return"rightEnd"===t.name&&(t.comboboxOptions=t.comboboxOptions.filter(function(t){return t.value!==n.LINE_EXTEND})),t})),o},n.prototype.showPropertiesOf=function(t,e){var i,o,n,a,l,c,h,u;if(this._toolExceptionCases||(this._toolExceptionCases=this._createToolExceptionCases()),i=this._toolExceptionCases[t]||this._getPossibleProperty(e),this._clearProperties(),this._propertiesVisible=!1,i.length){for(o={},n=i.length-1;n>=0;--n)if(a=i[n],l=e[a.name],"function"!=typeof(c=a.showIf)||c(l,e)){if(!l)continue;if(this._propertiesVisible=!0,h=[],"combobox"!==a.inputType){u=this.colorPropertyControl(l,a,e),this._floatingToolbar.addWidget(u[0],{index:this._$templatesButton?1:0}),this._toolbarWidgets.push(u[0]);continue}a.simple?a.comboboxOptions.forEach(r.bind(null,h)):a.comboboxOptions.forEach(s.bind(null,h)),a.propertyProxy&&(l=a.propertyProxy(e,this.activeChartWidget().model())),o[a.name]=l,l.subscribe(this,this._onPropertyChanged.bind(this,a.name,l)),this._floatingToolbar.addGroupedWidget({id:a.name,currentStateId:l.value(),stateWidgetAddClass:"tv-linetool-properties-toolbar__sub-widget",states:h,widgetAddClass:"tv-linetool-properties-toolbar__grouped-button",tooltip:a.title},{index:this._$templatesButton?1:0})}this._currentProperties=o}},n.prototype._updateVisibility=function(){this._propertiesVisible||this._sourceActionsVisible||this._templatesVisible?this._show():this.hide()},n.prototype._clearProperties=function(){
this._currentProperties&&(this._clearProeprtiesOnHideTimeoutId&&(clearTimeout(this._clearProeprtiesOnHideTimeoutId),this._clearProeprtiesOnHideTimeoutId=null),Object.keys(this._currentProperties).forEach(function(t){this._currentProperties[t].unsubscribeAll(this),this._floatingToolbar.removeGroupedWidget(t)},this),this._currentProperties=null,this._toolbarWidgets.forEach(function(t){this._floatingToolbar.removeWidget(t)},this),this._toolbarWidgets=[],this.clearBindings())},n.prototype.hide=function(){this._floatingToolbar.hide(),this._clearProeprtiesOnHideTimeoutId=setTimeout(this._clearProperties.bind(this),this._floatingToolbar.hideDuration())},n.prototype._show=function(){this._floatingToolbar.show()},n.prototype.refresh=function(){this.onSourceChanged(this.selectedSource())},n.prototype._setupToggleLockButton=function(t){t!==this._selectedSourceBk&&(this._selectedSourceBk&&this._selectedSourceBk.properties().frozen&&this._selectedSourceBk.properties().frozen.unsubscribe(this,this._lockChangeListener),t&&t.properties().frozen&&(t.properties().frozen.subscribe(this,this._lockChangeListener),this._lockChangeListener(t.properties().frozen)),this._selectedSourceBk=t)},n.prototype.bindControl=function(t){this._bindings.push(t)},n.prototype.clearBindings=function(t){for(var e=this._bindings.length;e--;)this._bindings[e].destroy();this._bindings.length=0},n.prototype.colorPropertyControl=function(t,e,i){var o,r,s=x.prototype.createColorPicker({addClass:"tv-linetool-properties-toolbar__color-picker apply-common-tooltip",direction:this._bindPopupMenuDirection.bind(this)});return s.attr("title",e.title),o=s.find("input"),r=$(e.iconSvgCode),r.on("click",function(t){o.data("tvcolorpicker")||o.focus()}),$(document).on("click",function(t){o.data("tvcolorpicker")?o.addClass("i-active"):o.removeClass("i-active")}),o.after(r),this.bindControl(new P(s,t,!0,this.activeChartWidget().model(),null,n.getTransparency(e,i))),"string"==typeof e.addClass&&s.addClass(e.addClass),s},n.getTransparency=function(t,e){if(t.transparency)return t.transparencyField?e[t.transparencyField].value():e.transparency.value()},n.prototype.createLineEndPropertyProxy=function(t,e){return function(i,r){var s,a;return s=i[e]&&i[e].value()?n.LINE_EXTEND:i[t].value(),a=new o(s),a.subscribe(this,function(o){var n=o.value();n<2?(r.beginUndoMacro(""),i[t].setValue(n),i[e]&&i[e].setValue(!1),r.endUndoMacro()):(r.beginUndoMacro(""),i[t].setValue(O.Normal),i[e]&&i[e].setValue(!0),r.endUndoMacro())}),a}},n.LINE_EXTEND=42,c=l(i(986)),h=l(i(987)),u=l(i(988)),d=l(i(989)),p=l(i(990)),_=l(i(991)),f=l(i(992)),m=l(i(993)),g=l(i(994)),v=l(i(995)),y=l(i(996)),b=l(i(997)),S=i(998),w=i(999),T=i(1e3),n.prototype._defaultToolProperties=function(){return[{name:"color",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"linecolor",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Background Color"),transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c
},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}],title:$.t("Width")},{name:"linestyle",title:$.t("Style"),inputType:"combobox",comboboxOptions:[{value:0,iconSvgCode:c},{value:1,iconSvgCode:p},{value:2,iconSvgCode:_}]},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:f},{value:O.Arrow,iconSvgCode:m},{value:n.LINE_EXTEND,iconSvgCode:g}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:v},{value:O.Arrow,iconSvgCode:y},{value:n.LINE_EXTEND,iconSvgCode:b}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},n.prototype._riskPropertiesExceptionCases=function(){return[{name:"textcolor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T},{name:"profitBackground",title:$.t("Profit Background Color"),inputType:"colorPicker",iconSvgCode:w,transparency:!0,transparencyField:"profitBackgroundTransparency"},{name:"stopBackground",title:$.t("Stop Background Color"),inputType:"colorPicker",iconSvgCode:w,transparency:!0,transparencyField:"stopBackgroundTransparency"},{name:"linecolor",title:$.t("Border color"),inputType:"colorPicker",iconSvgCode:S}]},n.prototype._elliottPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:S}]},n.prototype._rangeExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"backgroundColor",inputType:"colorPicker",iconSvgCode:w,title:$.t("Background Color"),transparency:!0,transparencyField:"backgroundTransparency"},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}],title:"Width"}]},n.prototype._textPropertiesExceptionCases=function(){return[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T},{name:"backgroundColor",title:$.t("Background Color"),inputType:"colorPicker",iconSvgCode:w,showIf:function(t,e){return!e||!e.fillBackground||!!e.fillBackground.value()}},{name:"borderColor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:S},{name:"bordercolor",title:$.t("Border Color"),inputType:"colorPicker",iconSvgCode:S},{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]}]},n.prototype._notePropertiesExceptionCases=function(){return[{name:"markerColor",title:$.t("Marker Color"),inputType:"colorPicker",iconSvgCode:S},{name:"textColor",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:T},{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]}]},n.prototype._brushPropertiesExceptionCases=function(){return[{name:"linecolor",inputType:"colorPicker",iconSvgCode:S,title:$.t("Color")},{name:"backgroundColor",
inputType:"colorPicker",iconSvgCode:w,transparency:!0,showIf:function(t,e){return e.fillBackground.value()},title:$.t("Background Color")},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,iconSvgCode:u},{value:4,iconSvgCode:d}],title:$.t("Line Width")},{name:"leftEnd",title:$.t("Left End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:f},{value:O.Arrow,iconSvgCode:m}],propertyProxy:this.createLineEndPropertyProxy("leftEnd","extendLeft")},{name:"rightEnd",title:$.t("Right End"),inputType:"combobox",comboboxOptions:[{value:O.Normal,iconSvgCode:v},{value:O.Arrow,iconSvgCode:y}],propertyProxy:this.createLineEndPropertyProxy("rightEnd","extendRight")}]},n.prototype._oneColorForAllLines=function(){return[{name:"collectibleColors",inputType:"colorPicker",iconSvgCode:S,title:$.t("One color for all lines")}]},n.prototype._createToolExceptionCases=function(){return{LineToolRegressionTrend:[],LineToolGannSquare:n.prototype._oneColorForAllLines(),LineToolFibTimeZone:n.prototype._oneColorForAllLines(),LineToolBrush:n.prototype._brushPropertiesExceptionCases(),LineToolPolyline:n.prototype._brushPropertiesExceptionCases(),LineToolText:n.prototype._textPropertiesExceptionCases(),LineToolTextAbsolute:n.prototype._textPropertiesExceptionCases(),LineToolBalloon:n.prototype._textPropertiesExceptionCases(),LineToolCallout:n.prototype._textPropertiesExceptionCases(),LineToolPriceLabel:n.prototype._textPropertiesExceptionCases(),LineToolArrowMarkLeft:[],LineToolArrowMarkRight:[],LineToolArrowMarkUp:[],LineToolArrowMarkDown:[],LineToolFlagMark:[],LineToolThumbUp:[],LineToolThumbDown:[],LineToolElliottCircle:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottSubminuette:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinor:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMinorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolElliottMajorRetr:n.prototype._elliottPropertiesExceptionCases(),LineToolDateRange:n.prototype._rangeExceptionCases(),LineToolPriceRange:n.prototype._rangeExceptionCases(),LineToolDateAndPriceRange:n.prototype._rangeExceptionCases(),LineToolIcon:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:w}],LineToolNote:n.prototype._notePropertiesExceptionCases(),LineToolNoteAbsolute:n.prototype._notePropertiesExceptionCases(),LineToolThreeDrivers:[{name:"color",title:$.t("Text color"),inputType:"colorPicker",iconSvgCode:S}],LineToolRiskRewardLong:n.prototype._riskPropertiesExceptionCases(),LineToolRiskRewardShort:n.prototype._riskPropertiesExceptionCases(),LineToolBarsPattern:[{name:"color",title:$.t("Color"),inputType:"colorPicker",iconSvgCode:w}],LineToolProjection:[{name:"color1",title:$.t("Background color 1"),inputType:"colorPicker",iconSvgCode:w,transparency:!0},{name:"color2",title:$.t("Background color 2"),inputType:"colorPicker",iconSvgCode:w,transparency:!0},{name:"linewidth",inputType:"combobox",comboboxOptions:[{value:1,iconSvgCode:c},{value:2,iconSvgCode:h},{value:3,
iconSvgCode:u},{value:4,iconSvgCode:d}]}],LineToolFibCircles:n.prototype._oneColorForAllLines(),LineToolFibChannel:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceArcs:n.prototype._oneColorForAllLines(),LineToolFibRetracement:n.prototype._oneColorForAllLines(),LineToolFibSpeedResistanceFan:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibTime:n.prototype._oneColorForAllLines(),LineToolFibWedge:n.prototype._oneColorForAllLines(),LineToolGannComplex:n.prototype._oneColorForAllLines(),LineToolGannFixed:n.prototype._oneColorForAllLines(),LineToolGannFan:n.prototype._oneColorForAllLines(),LineToolPitchfan:n.prototype._oneColorForAllLines(),LineToolPitchfork:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork2:n.prototype._oneColorForAllLines(),LineToolSchiffPitchfork:n.prototype._oneColorForAllLines(),LineToolInsidePitchfork:n.prototype._oneColorForAllLines(),LineToolTrendBasedFibExtension:n.prototype._oneColorForAllLines()}},t.exports=n}).call(e,i(5),i(25))},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(9),r=i(364),s=i(10),i(175),i(978),a=function(t){function e(i){var o=t.call(this,e._prepareOptions(i))||this;return o._onWidgetStateChangedDelegate=new s,o._statedWidgets=[],o._currentPopup=null,o._onWindowClickedListener=o._onWindowClicked.bind(o),o}return o.__extends(e,t),e.prototype.show=function(){t.prototype.show.call(this),document.addEventListener("mousedown",this._onWindowClickedListener)},e.prototype.hide=function(){t.prototype.hide.call(this),document.removeEventListener("mousedown",this._onWindowClickedListener)},e.prototype.destroy=function(){this._closePopup(),t.prototype.destroy.call(this)},e.prototype.addGroupedWidget=function(t,i){var o,r,s;void 0===i&&(i={}),n.assert(t.states.length>0&&-1!==e._getStateIndexById(t,t.currentStateId),"Argument is invalid (count: "+t.states.length+", state: "+t.currentStateId+")"),o=document.createElement("div"),o.className="tv-grouped-floating-toolbar__widget-wrapper apply-common-tooltip",t.widgetAddClass&&o.classList.add(t.widgetAddClass),o.setAttribute("title",t.tooltip),r={isEnabled:!0,statedWidget:t,toolbarWidget:o},s=this._onWidgetClicked.bind(this,r),r.clickListener=s,o.addEventListener("click",s),this._updateWidgetPreview(r),this.addWidget(o,i),this._statedWidgets.push(r)},e.prototype.removeGroupedWidget=function(t){var e,i,o=this._statedWidgets.length;for(e=0;e<o;++e)if(i=this._statedWidgets[e],i.statedWidget.id===t)return this._isPopupCreatedForWidget(t)&&this._closePopup(),void 0!==i.clickListener&&i.toolbarWidget.removeEventListener("click",i.clickListener),this.removeWidget(i.toolbarWidget),this._statedWidgets.splice(e,1),void this._updatePopupPosition();n.assert(!1,"Unknown groupId("+t+")")},e.prototype.updateGroupedWidget=function(t,e){this._closePopup();var i=this._ensuredGetWidgetDataForId(t);i.statedWidget.currentStateId=e.currentStateId,i.statedWidget.states=e.states,this._updateWidgetPreview(i)},e.prototype.setGroupedWidgetEnabled=function(t,e){
var i=this._ensuredGetWidgetDataForId(t);i.isEnabled=e,i.toolbarWidget.classList.toggle("i-disabled",!e)},e.prototype.setGroupedWidgetState=function(t,i){var o=this._ensuredGetWidgetDataForId(t);n.assert(-1!==e._getStateIndexById(o.statedWidget,i),"Unknown stateId ("+i+")"),o.statedWidget.currentStateId=i,this._updateSubWidgetsState(o.statedWidget),this._updateWidgetPreview(o)},e.prototype.onWidgetStateChanged=function(){return this._onWidgetStateChangedDelegate},e.prototype._onVerticalChanged=function(t,e){this._updatePopupPosition()},e.prototype._ensuredGetWidgetDataForId=function(t){var e,i,o;for(e=0,i=this._statedWidgets;e<i.length;e++)if(o=i[e],o.statedWidget.id===t)return o;throw Error("Unknown groupId("+t+")")},e.prototype._onWidgetClicked=function(t,e){var i=this._currentPopup&&this._isPopupCreatedForWidget(t.statedWidget.id);this._closePopup(),!i&&t.isEnabled&&this._createPopup(t)},e.prototype._createPopup=function(t){var e,i=this,o={createdFor:t.toolbarWidget,element:document.createElement("div"),stateWidgetId:t.statedWidget.id,widgets:[]};o.element.className+="tv-grouped-floating-toolbar__popup js-popup",e=t.statedWidget.states.length,t.statedWidget.states.forEach(function(n,r){var s=i._createSubWidget(t,n),a=i._onSubWidgetClicked.bind(i,t,n.id);s.addEventListener("click",a),o.widgets.push({clickListener:a,stateWidget:n,widget:s}),s.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-right-"+r),s.classList.add("tv-grouped-floating-toolbar__sub-widget--slide-left-"+(e-r+1)),o.element.appendChild(s)}),this._currentPopup=o,this._updateSubWidgetsState(t.statedWidget),t.toolbarWidget.classList.add("i-dropped"),this._getWidget().appendChild(this._currentPopup.element),Promise.resolve().then(function(){i._currentPopup&&i._currentPopup.element.classList.add("i-opened")}),this._updatePopupPosition()},e.prototype._closePopup=function(){var t,e,i=this;this._statedWidgets.forEach(function(t){t.toolbarWidget.classList.remove("i-dropped")}),this._currentPopup&&(t=this._currentPopup.widgets,e=this._currentPopup.element,this._currentPopup=null,t.forEach(function(t){t.widget.removeEventListener("click",t.clickListener)}),e.classList.remove("i-opened"),e.addEventListener("transitionend",function(t){t.target===e&&i._getWidget().removeChild(e)}))},e.prototype._updateWidgetPreview=function(t){var i,o=e._getStateIndexById(t.statedWidget,t.statedWidget.currentStateId);n.assert(-1!==o,"Unknown state id: "+t.statedWidget.currentStateId),i=t.statedWidget.states[o].widget.cloneNode(!0),t.toolbarWidget.firstChild?t.toolbarWidget.replaceChild(i,t.toolbarWidget.firstChild):(t.toolbarWidget.appendChild(i),t.toolbarWidget.appendChild(e._createCaret()))},e.prototype._updateSubWidgetsState=function(t){this._currentPopup&&this._isPopupCreatedForWidget(t.id)&&this._currentPopup.widgets.forEach(function(i){i.widget.classList.toggle(e._activeSubWidgetClass,i.stateWidget.id===t.currentStateId)})},e.prototype._updatePopupPosition=function(){var t,e,i,o,n,r,s,a;if(this._currentPopup){if(t=this._currentPopup.createdFor,
e=this._getWidget().getBoundingClientRect(),!(i=this._findWrapperForWidget(t))||!this._currentPopup)throw Error("Toolbar has no wrapper for preview's widget or there is no popup");o=i.getBoundingClientRect(),n=this._currentPopup.element.getBoundingClientRect(),r=this._currentPopup.element,this.isVertical()?(r.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),r.style.top=o.top-e.top+1+"px",r.style.left="",e.left>window.innerWidth-e.right?r.classList.add("tv-grouped-floating-toolbar__popup--at-left"):r.classList.remove("tv-grouped-floating-toolbar__popup--at-left")):(r.classList.remove("tv-grouped-floating-toolbar__popup--at-left"),s=o.left+n.width,a=0,s>window.innerWidth?e.left+n.width>window.innerWidth&&(a=e.width-n.width):a=o.left-e.left+1,r.style.left=a+"px",e.bottom+n.height>window.innerHeight?r.classList.add("tv-grouped-floating-toolbar__popup--at-top"):(r.classList.remove("tv-grouped-floating-toolbar__popup--at-top"),r.style.top=""))}},e.prototype._isPopupCreatedForWidget=function(t){return!(!this._currentPopup||this._currentPopup.stateWidgetId!==t)},e.prototype._createSubWidget=function(t,e){var i=document.createElement("div");return i.className+="tv-grouped-floating-toolbar__sub-widget",t.statedWidget.stateWidgetAddClass&&i.classList.add(t.statedWidget.stateWidgetAddClass),i.appendChild(e.widget),i},e.prototype._onSubWidgetClicked=function(t,e){this._closePopup(),t.statedWidget.currentStateId!==e&&(this.setGroupedWidgetState(t.statedWidget.id,e),this._onWidgetStateChangedDelegate.fire(t.statedWidget.id,e))},e.prototype._onWindowClicked=function(t){if(this.isVisible()&&this._currentPopup&&!e._isEventInElement(t,this._currentPopup.element)){for(var i=0;i<this._statedWidgets.length;++i)if(e._isEventInElement(t,this._statedWidgets[i].toolbarWidget))return;this._closePopup()}},e._getStateIndexById=function(t,e){for(var i=0;i<t.states.length;++i)if(t.states[i].id===e)return i;return-1},e._createCaret=function(){var t=document.createElement("div");return t.className="tv-caret tv-caret--small tv-caret--colored tv-grouped-floating-toolbar__caret",t},e._prepareOptions=function(t){var e=" tv-grouped-floating-toolbar";return t.addClass?t.addClass+=e:t.addClass=e,t},e._isEventInElement=function(t,e){return t.target===e||e.contains(t.target)},e._activeSubWidgetClass="tv-grouped-floating-toolbar__sub-widget--current",e}(r.FloatingToolbar),e.GroupButtonFloatingToolbar=a},function(t,e){},function(t,e){},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M2 0a2 2 0 0 0-2 2v14h14a2 2 0 0 0 2-2H2zm2 0v2h3V0zm5 0v2h3V0zm5 0v2h2a2 2 0 0 0-2-2zm0 4v3h2V4zm0 5v3h2V9z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 16"><path d="M15.09 6.857s-.571 0-.724-.533c-.114-.457-.305-.876-.533-1.295-.229-.495.152-.876.152-.876l.571-.571c.229-.229.229-.61 0-.876l-.762-.762c-.229-.229-.61-.229-.876 0l-.571.571s-.381.381-.876.152c-.419-.229-.838-.419-1.295-.533-.533-.152-.533-.724-.533-.724v-.8a.602.602 0 0 0-.61-.61H7.966a.602.602 0 0 0-.61.61v.8s0 .571-.533.724c-.457.114-.876.305-1.295.533-.495.229-.876-.152-.876-.152l-.571-.571c-.229-.229-.61-.229-.876 0l-.762.762c-.229.229-.229.61 0 .876l.571.571s.381.381.152.876c-.229.419-.419.838-.533 1.295-.152.495-.724.533-.724.533h-.8a.602.602 0 0 0-.61.61v1.067c0 .343.267.61.61.61h.8s.571 0 .724.533c.114.457.305.876.533 1.295.229.495-.152.876-.152.876l-.571.571c-.229.229-.229.61 0 .876l.762.762c.229.229.61.229.876 0l.571-.571s.381-.381.876-.152c.419.229.838.419 1.295.533.495.152.533.724.533.724v.8c0 .343.267.61.61.61h1.067c.343 0 .61-.267.61-.61v-.8s0-.571.533-.724c.457-.114.876-.305 1.295-.533.495-.229.876.152.876.152l.571.571c.229.229.61.229.876 0l.762-.762c.229-.229.229-.61 0-.876l-.571-.571s-.381-.381-.152-.876c.229-.419.419-.838.533-1.295.152-.495.724-.533.724-.533h.8c.343 0 .61-.267.61-.61V7.467a.602.602 0 0 0-.61-.61h-.8zM8.5 11.555a3.541 3.541 0 0 1-3.556-3.556A3.541 3.541 0 0 1 8.5 4.443a3.541 3.541 0 0 1 3.556 3.556A3.561 3.561 0 0 1 8.5 11.555z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M1.5 2H0v12c0 .825.675 1.5 1.5 1.5h12V14h-12V2zm13.056-2H4.445c-.794 0-1.444.65-1.444 1.444v10.111c0 .794.65 1.444 1.444 1.444h10.111c.794 0 1.444-.65 1.444-1.444V1.444C16 .65 15.35 0 14.556 0z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 13 15"><path d="M1 0C.45 0 0 .45 0 1v11h1V1h9V0H1zm2.467 2C2.66 2 2 2.65 2 3.444v10.111c0 .794.66 1.444 1.467 1.444h8.067c.807 0 1.467-.65 1.467-1.444V3.444c0-.794-.66-1.444-1.467-1.444H3.467zM3 3h9v11H3V3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 12"><path d="M8.25 0C4.5 0 1.297 2.332 0 5.625c1.297 3.292 4.5 5.625 8.25 5.625s6.953-2.333 8.25-5.625C15.203 2.332 12 0 8.25 0zm0 9.375c-2.07 0-3.75-1.68-3.75-3.75 0-2.07 1.68-3.75 3.75-3.75 2.07 0 3.75 1.68 3.75 3.75 0 2.07-1.68 3.75-3.75 3.75zm0-6C7.005 3.375 6 4.38 6 5.625s1.005 2.25 2.25 2.25 2.25-1.005 2.25-2.25-1.005-2.25-2.25-2.25z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 13"><path d="M1 11.571C1 12.357 1.6 13 2.333 13h5.333c.733 0 1.333-.643 1.333-1.429V3h-8v8.571zM8.5 1L6.786 0H3.215L1.501 1h-1.5v1h10V1h-1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1h19a.5.5 0 0 0 0-1h-19z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 2a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2H2z"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 1a1.5 1.5 0 0 0 0 3h18a1.5 1.5 0 0 0 0-3H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 1a2 2 0 0 0 0 4h18a2 2 0 0 0 0-4H2z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1H3V2H1.5zM4 2v1h2V2H4zm3 0v1h2V2H7zm3 0v1h2V2h-2zm3 0v1h2V2h-2zm3 0v1h2V2h-2zm3 0v1h1.5a.5.5 0 0 0 0-1H19z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M1.5 2a.5.5 0 0 0 0 1H5V2zM7 2v1h3V2zm5 0v1h3V2zm5 0v1h3.5a.5.5 0 0 0 0-1z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M20 2.5a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0zm-19 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0z"/><path d="M20.5 3H3V2h17.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M0 2.5L8 0v5zm20 0a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0z"/><path d="M20.5 3H7V2h13.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M0 2.5a.5.5 0 1 1 1 0 .5.5 0 1 1-1 0zm18 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0zm-9 0a2 2 0 1 1 4 0 2 2 0 1 1-4 0z"/><path d="M19 3H.5V2H19z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M2 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zM21 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0z"/><path d="M1.5 2H19v1H1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M22 2.5L14 5V0zM2 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0z"/><path d="M1.5 2H15v1H1.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 6" width="22" height="6"><path d="M22 2.5a.5.5 0 1 1-1 0 .5.5 0 1 1 1 0zM4 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0zM13 2.5a2 2 0 1 1-4 0 2 2 0 1 1 4 0z"/><path d="M3 2h18.5v1H3z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M24.748 16l-3.75-3.748-9.998 10V26h3.75l9.998-10zm2.96-2.96a.996.996 0 0 0 0-1.408l-2.34-2.34a.996.996 0 0 0-1.41 0l-1.96 1.96 3.75 3.75 1.96-1.96z" class="icon"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M24.06 17.94L15.123 9l-1.41 1.41 2.38 2.38-5.15 5.15a1.49 1.49 0 0 0 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.58.59-1.53 0-2.12zM12.713 19l4.79-4.79L22.29 19h-9.58zM26.5 20.5s-2 2.17-2 3.5c0 1.1.9 2 2 2s2-.9 2-2c0-1.33-2-3.5-2-3.5z" class="icon"/></svg>'},function(t,e){
t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 38"><path d="M0 0v38h38V0H0zm7 29h24v4H7v-4z" class="bg"/><path d="M23.094 25.5L22 22.17h-5.904l-1.17 3.33H12.5l6.446-16h.574l5.98 16h-2.405zM19.13 13.637l-2.46 6.95h4.712l-2.252-6.95z" class="icon"/></svg>'},function(t,e,i){"use strict";var o=i(212).TimePointIndexSearchMode,n=i(58),r=i(48),s=i(1002),a=i(365),l=i(330),c=l.ChartApiInterface,h=l.HandlerInfo,u=i(15).requireFullInterfaceImplementation,d=i(7).getLogger("Chart.ChartApiLocal"),p=i(49),_=i(34).Interval;TradingView.STUDY_COUNT_LIMIT=120,JSServer.ChartApi=function(t){this._notificationHandlers={},this._sessions={},this.studyCounter=0,this._connected=!1,this._enabled=!1,this._studyEngine=new s(t),this._callbacks={},this._symbolIdCache={},this._seriesIdCache={},this._recentSeriesId={},this._enableLogging=!1,this._enabledMoreBarsRequest=!0,this._serverTimeOffset=0;var e=this;this._studyEngine.on("configuration_received",function(){e._fireEvent("configuration_received")}),this._studyEngine.on("realtime_tick",function(t){var i={time:t.value[0]/1e3,open:t.value[1],high:t.value[2],low:t.value[3],close:t.value[4],volume:t.value[5]};e._fireEvent("realtime_tick",i,!0)})},JSServer.ChartApi.prototype._makeSymbolKey=function(t,e){if(!t||!e)throw Error("incorrect identifiers");return t+"_"+e},JSServer.ChartApi.prototype._makeSeriesKey=function(t,e){if(!t||!e)throw Error("incorrect identifiers");return t+"_"+e},JSServer.ChartApi.prototype.destroy=function(){this._studyEngine.destroy(),this._studyEngine=null},JSServer.ChartApi.prototype.purgeCache=function(t){this._symbolIdCache={},this._studyEngine.purgeCache(),this._studyEngine.purgeRangeExtensionData(),this._studyEngine.purgeDataCache()},JSServer.ChartApi.prototype.setAdditionalBarsRequestEnabled=function(t){this._enabledMoreBarsRequest=t},JSServer.ChartApi.prototype.setTimeFramesList=function(t){var e,i,o,n,s,a,l,c;for(this._timeframes=[],e=/(\d+)(\w+)/,i=0;i<t.length;++i)o=t[i],n=e.exec(o.text),s=n[2].toLowerCase(),a=parseInt(n[1]),l="y"===s?12*a+"m":a+s,c=r.Symbol.parsePeriod(o.resolution),this._timeframes.push({text:$.t(o.title)||a+$.t(s,{context:"dates",count:a}),description:o.description||"",value:l,targetResolution:o.resolution,requiresIntraday:c.isIntraday})},JSServer.ChartApi.prototype.defaultWatchlistSymbols=function(){return this._watchlistSettings.default_symbols},JSServer.ChartApi.prototype.availableTimeFrames=function(t,e){return t?e!==p.STATUS_DELAYED&&e!==p.STATUS_DELAYED_STREAMING&&e!==p.STATUS_READY?[]:this._timeframes.filter(function(e){return!(e.requiresIntraday&&!t.has_intraday)&&!(t.supported_resolutions&&t.supported_resolutions.indexOf(_.normalize(e.targetResolution))<0)}):[]},JSServer.ChartApi.prototype.defaultResolutions=function(){return this._studyEngine.supportedResolutions()||{1:1,3:1,5:1,15:1,30:1,45:1,60:1,120:1,180:1,240:1,D:1,W:1,M:1}},JSServer.ChartApi.prototype.supportedSymbolsTypes=function(){return this._studyEngine.supportedSymbolsTypes()},JSServer.ChartApi.prototype.supportedExchangesList=function(){
return this._studyEngine.supportedExchangesList()},JSServer.ChartApi.prototype.futuresRegex=function(){return this._studyEngine.futuresRegex()},JSServer.ChartApi.prototype.start=function(){this._enabled=!0,this._fireEvent("start_enabled")},JSServer.ChartApi.prototype._logMessage=function(t){this._enableLogging&&console.log(t)},JSServer.ChartApi.prototype.unsubscribe=function(t,e){var i=this._callbacks[t];i&&i.splice(i.indexOf(e),1)},JSServer.ChartApi.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},JSServer.ChartApi.prototype._fireEvent=function(t,e,i){var o,n;if(this._callbacks.hasOwnProperty(t))for(o=this._callbacks[t].slice(0),i||(this._callbacks[t]=[]),n=0;n<o.length;++n)o[n](e)},JSServer.ChartApi.prototype.chartCreateSession=function(t,e){},JSServer.ChartApi.prototype.chartDeleteSession=function(t){},JSServer.ChartApi.prototype.createSession=function(t,e){TradingView.ChartapiMessagerInstances[t]=new a(this,t),this._sessions[t]=e,this._notificationHandlers[t]={},this.connected()&&e.onMessage({method:"connected",params:[]})},JSServer.ChartApi.prototype.removeSession=function(t){delete this._sessions[t],delete this._notificationHandlers[t],this._studyEngine.stopSources(t)},JSServer.ChartApi.prototype.connected=function(){return this._connected},JSServer.ChartApi.prototype.connect=function(){if(!this._enabled){var t=this;return void this.on("start_enabled",function(){t.connect()})}this.connected()||(this._connected=!0,this.sessionid="dummy session id",this._notifySessions({method:"connected",params:[]}))},JSServer.ChartApi.prototype.disconnect=function(){this._connected=!1,this._notifySessions({method:"disconnected",params:[]})},JSServer.ChartApi.prototype.switchTimezone=function(t,e){if(TradingView.ChartapiMessagerInstances[t].timezone()!==e&&(TradingView.ChartapiMessagerInstances[t].setTimezone(e),this._recentSeriesId[t])){var i=this;this._doWhenSeriesSymbolIdIsReady(t,this._recentSeriesId[t],function(e){var o=i._seriesIdCache[i._makeSeriesKey(t,i._recentSeriesId[t])].resolution;i._studyEngine.recreateSources(e.name,o,t,!0),i._doWhenSeriesDataReceived(t,function(){var o=i._seriesIdCache[i._makeSeriesKey(t,i._recentSeriesId[t])].resolution,n=TradingView.ChartapiMessagerInstances[t].lastBarTime(i._recentSeriesId[t]);n&&i._studyEngine.rebuildExtrapolatedData(t,e.name,o,e.info,1e3*n)})})}},JSServer.ChartApi.prototype.receiveLocalResponse=function(t){this._logMessage("< "+t.method),this._dispathNotification(t),this._fireEvent("message_"+t.method,void 0,!0)},JSServer.ChartApi.prototype.getMarks=function(t,e,i,o,n){this._studyEngine.getMarks(t,e,i,o,n)},JSServer.ChartApi.prototype.getTimescaleMarks=function(t,e,i,o,n){this._studyEngine.getTimescaleMarks(t,e,i,o,n)},JSServer.ChartApi.prototype.resolveSymbol=function(t,e,i,o,n){function r(e,o){TradingView.ChartapiMessagerInstances[t].onSymbolError(e,o),s._symbolIdCache[s._makeSymbolKey(t,e)]={name:i,status:"invalid_symbol"},s._fireEvent("resolve_fail",{session:t,symbolId:e},!0),
s._fireEvent(s._makeSymbolKey(t,e)+"_resolve_fail")}this._notificationHandlers[t][e]=new h(o,e),this._symbolIdCache[this._makeSymbolKey(t,e)]=null;var s=this;this._studyEngine.resolveSymbol(i,function(o){if(o.errmsg)return void r(e,o.errmsg);s._symbolIdCache[s._makeSymbolKey(t,e)]={name:i,info:o,status:"ok"},s._fireEvent("symbol_resolved",{symbolInfo:o,symbolId:e,session:t},!0),s._fireEvent(s._makeSymbolKey(t,e)+"_resolved",o),TradingView.ChartapiMessagerInstances[t].onSymbolResolved(e,o)},function(t){r(e,t)})},JSServer.ChartApi.prototype._doWhenSymbolIdIsReady=function(t,e,i){function o(){return{name:r._symbolIdCache[r._makeSymbolKey(t,e)].name,info:r._symbolIdCache[r._makeSymbolKey(t,e)].info}}function n(){s&&(i(o()),s=!1,r.unsubscribe(r._makeSymbolKey(t,e)+"_resolved",n),r.unsubscribe(r._makeSymbolKey(t,e)+"_resolve_fail",n))}var r=this,s=!0;this._symbolIdCache[this._makeSymbolKey(t,e)]?n():(this.on(this._makeSymbolKey(t,e)+"_resolved",n),this.on(this._makeSymbolKey(t,e)+"_resolve_fail",n))},JSServer.ChartApi.prototype._doWhenSeriesDataReceived=function(t,e){TradingView.ChartapiMessagerInstances[t].seriesCompleted.subscribe(null,e,!0)},JSServer.ChartApi.prototype._doWhenSeriesSymbolIdIsReady=function(t,e,i,o){function n(){var e=c._symbolIdCache[c._makeSymbolKey(t,h)];return{name:e.name,info:e.info}}function r(){i(n())}function s(){c.unsubscribe("symbol_resolved",l),c.unsubscribe("resolve_fail",a)}function a(e){e.symbolId===h&&e.session===t&&(s(),o&&o())}function l(e){e.symbolId===h&&e.session===t&&(s(),r())}var c=this,h=this._seriesIdCache[t+"_"+e].symbolId;this._symbolIdCache[this._makeSymbolKey(t,h)]?r():(this.on("symbol_resolved",l),this.on("resolve_fail",a))},JSServer.ChartApi.prototype.createSeries=function(t,e,i,o,n,s,a){i=i||"";var l=this;this._notificationHandlers[t][e]=new h(function(s){if("series_completed"===s.method){var c=r.Symbol.parsePeriod(n);c.range&&l._applyRange(t,o,e,i,c.range)}a(s)},e),this._recentSeriesId[t]=e,TradingView.ChartapiMessagerInstances[t].setResolution(r.Symbol.parsePeriod(n).pureResolution),this._seriesIdCache[t+"_"+e]={symbolId:o,resolution:n,turnaround:i},this._studyEngine.updateSeriesTurnaround(t,e,i),this._doWhenSeriesSymbolIdIsReady(t,e,function(o){l._studyEngine.seriesTurnaround(t,e)===i&&l._studyEngine.createSeries(o.name,n,t,e,i)})},JSServer.ChartApi.prototype.removeSeries=function(t,e,i){this._notificationHandlers[t][e]=new h(i,e),this._studyEngine.removeSeries(t,e)},JSServer.ChartApi.prototype.setVisibleTimeRange=function(t,e,i,n,r){function s(){var s,l;a=t.data(),s=[a.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,o.FromLeft),a.plotValueToTimePointIndex(n,TradingView.TIME_PLOT,o.FromRight)],a.valueAt(s[1])[0]<n&&t.syncModel()&&(l=t.syncModel().distance(a.valueAt(s[1])[0],n),l.success&&(s[1]+=l.result)),TradingView.ChartapiMessagerInstances[e].onSeriesTimeframeUpdate(c,h._seriesIdCache[e+"_"+c].turnaround,s[0],s[1],!0),t.requestMoreData(),r&&r()}var a=t.data(),l=!!a.plotValueToTimePointIndex(i,TradingView.TIME_PLOT,o.FromLeft),c=this._recentSeriesId[e],h=this
;l?s():(this._studyEngine.ensureExtendedTo(c,e,i),this._doWhenSeriesDataReceived(e,s))},JSServer.ChartApi.prototype._exactBarsCountOfTimeFrame=function(t,e){var i,o=chartWidget.model().mainSeries().bars(),r=chartWidget.model().mainSeries().symbolInfo().session,s=o._valueAt(o.size()-1)[0],a=n.alignPeriodsBack(r,t.resolution,t.interval,1,1e3*s),l=o.size();for(a/=1e3,i=0,i=0;i<l&&!(o._valueAt(i)[0]>a);++i);return l-i},JSServer.ChartApi.prototype._applyRange=function(t,e,i,o,n){var r,s,a,l=chartWidget.model().mainSeries().bars().size();0!==l&&(r=this._exactBarsCountOfTimeFrame(n,this._symbolIdCache[this._makeSymbolKey(t,e)].info),s=Math.max(0,l-1-r),a=Math.max(s,l-1),TradingView.ChartapiMessagerInstances[t].onSeriesTimeframeUpdate(i,o,s,a))},JSServer.ChartApi.prototype.modifySeries=function(t,e,i,o,n,s,a){var l,c;i=i||"",l=this._seriesIdCache[t+"_"+e]?this._seriesIdCache[t+"_"+e].resolution:void 0,TradingView.ChartapiMessagerInstances[t].setResolution(r.Symbol.parsePeriod(n).pureResolution),c=this,this._notificationHandlers[t][e]=new h(function(a){var h,u;"series_completed"===a.method&&(h=r.Symbol.parsePeriod(l),u=r.Symbol.parsePeriod(n),u.range&&h.range!==u.range&&c._applyRange(t,o,e,i,u.range)),s(a)},e),this._recentSeriesId[t]=e,this._studyEngine.updateSeriesTurnaround(t,e,i),a&&(this._seriesIdCache[this._makeSeriesKey(t,a)]=null),this._seriesIdCache[this._makeSymbolKey(t,e)]={symbolId:o,resolution:n,turnaround:i},this._doWhenSeriesSymbolIdIsReady(t,e,function(e){c._studyEngine.purgeRangeExtensionData(t),c._studyEngine.recreateSources(e.name,n,t,!0)})},JSServer.ChartApi.prototype.requestMoreData=function(t,e,i,o){if(this._enabledMoreBarsRequest){var n=this;setTimeout(function(){n._notificationHandlers[t][e]=new h(o,e),n._studyEngine.extendSeriesRange(e,t,i)})}},JSServer.ChartApi.prototype.setStudiesAccessController=function(t){this.studiesAccessController=t},JSServer.ChartApi.prototype.setWatchlistSettings=function(t){this._watchlistSettings=t},JSServer.ChartApi.prototype.allStudiesMetadata=function(){return this._studyEngine.studiesMetadata()},JSServer.ChartApi.prototype.requestMetadata=function(t,e,i){this._notificationHandlers[t][e]=new h(i,e);var o=this.studiesAccessController.getEnabledTools();TradingView.ChartapiMessagerInstances[t].onRequestMetadata(e,o)},JSServer.ChartApi.prototype.isCanCreateStudy=function(){return this.studyCounter<TradingView.STUDY_COUNT_LIMIT},JSServer.ChartApi.prototype.createStudy=function(t,e,i,o,n,r,s){var a,l,c;if(!this.isCanCreateStudy())throw Error("Exceeded the limit of studies");a=this,i=i||"",this._notificationHandlers[t][e]=new h(s,e),l=this._seriesIdCache[this._makeSeriesKey(t,o)].symbolId,c=this._seriesIdCache[this._makeSeriesKey(t,o)].resolution,this._doWhenSymbolIdIsReady(t,l,function(o){a._studyEngine.createStudy(o.name,c,t,e,i,n,r),a.studyCounter++})},JSServer.ChartApi.prototype.rebindStudy=function(t,e,i,o,n,r,s,a){throw Error("Not implemented")},JSServer.ChartApi.prototype.removeStudy=function(t,e){this._notificationHandlers[t][e]=null,this._studyEngine.removeStudy(t,e),
this.studyCounter--},JSServer.ChartApi.prototype.modifyStudy=function(t,e,i,o,n){var r=this;setTimeout(function(){i=i||"",r._notificationHandlers[t][e]=new h(n,e),r._studyEngine.recomputeStudy(e,o,t,i)},0)},JSServer.ChartApi.prototype.createPointset=function(t,e,i,o,n,r,s){i=i||"",this._notificationHandlers[t][e]=new h(s,e);var a=this;this._doWhenSymbolIdIsReady(t,o,function(i){a._studyEngine.createPointset(t,e,i.info.full_name,i.info,n,r)})},JSServer.ChartApi.prototype.modifyPointset=function(t,e,i,o,n){throw Error("This call is not implemented")},JSServer.ChartApi.prototype.removePointset=function(t,e,i){this._notificationHandlers[t][e]=null,this._studyEngine.removePointset(e)},JSServer.ChartApi.prototype.requestMoreTickmarks=function(t,e,i,o){this._notificationHandlers[t][e]=new h(o,e);var n=this;this._doWhenSeriesSymbolIdIsReady(t,e,function(o){var r=n._seriesIdCache[n._makeSeriesKey(t,e)].resolution;n._studyEngine.onMoreTickmarksRequested(t,o.name,o.info,r,i)})},JSServer.ChartApi.prototype.requestFirstBarTime=function(t,e,i,o){this._notificationHandlers[t][e]=new h(o,e)},JSServer.ChartApi.prototype._invokeHandler=function(t,e){t&&t(e)},JSServer.ChartApi.prototype._sendRequest=function(t,e){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._onMessage=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype._convertTimescaleResponse=function(t){var e,i=t.marks;for(e=0;e<i.length;++e)i[e]={span:i[e][0],time:i[e][1],index:i[e][2]};return t},JSServer.ChartApi.prototype._dispathNotification=function(t){var e,i,o,n,r,s,a,l,c,h,u=t.params.shift();if(this._notificationHandlers[u])switch(t.method){case"timescale_update":e=t.params[0],i=t.params[1],o=this._convertTimescaleResponse(i),o.clear=0===i.changes.length&&0===i.marks.length,this._sessions[u].onMessage({method:"timescale_update",params:o});for(n in e)r={},r.customId=n,r.plots=e[n].series,e[n].ns&&(r.nonseries=e[n].ns),r.turnaround=e[n].turnaround,s={method:"data_update",params:r},this._invokeNotificationHandler(u,n,s);break;case"tickmark_update":o=this._convertTimescaleResponse(t.params[0]),o.changes=[],this._sessions[u].onMessage({method:"timescale_update",params:o});break;case"data_update":for(n in t.params[0]){a=t.params[0][n],r={},r.customId=n,r.plots=a.series?a.series:a.plots,r.turnaround=a.turnaround,"s"in a&&"ns"in a&&(r.plots=a.s,r.nonseries=a.ns);for(l=0;l<r.plots.length;l++)for(c in r.plots[l].value)1e100===r.plots[l].value[c]&&(r.plots[l].value[c]=void 0);s={method:"data_update",params:r},this._invokeNotificationHandler(u,n,s)}break;case"index_update":for(n in t.params[0])s={method:"index_update",params:t.params[0][n]},this._invokeNotificationHandler(u,n,s);break;case"critical_error":d.logNormal(new Date+" critical_error session:"+this.sessionid+" reason:"+t.params[0]),this._sessions[u].onMessage({method:"critical_error",params:t.params});break;case"quote_symbol_data":case"quote_list_fields":case"depth_symbol_error":case"depth_symbol_success":case"dd":case"dpu":case"depth_bar_last_value":
this._sessions[u].onMessage({method:t.method,params:t.params});break;default:h=t.params[0],this._invokeNotificationHandler(u,h,t)}},JSServer.ChartApi.prototype._invokeNotificationHandler=function(t,e,i){if(void 0!==e){var o=this._notificationHandlers[t][e];void 0!==o&&o&&this._invokeHandler(o.handler,i),"series_deleted"!==i.method&&"study_deleted"!==i.method||delete this._notificationHandlers[t][e]}},JSServer.ChartApi.prototype.searchSymbols=function(t,e,i,o,n,r,s,a,l){0===t.length&&0===e.length&&0===i.length&&l([]),this._studyEngine.searchSymbols(t,e,i,l)},JSServer.ChartApi.prototype._notifySessions=function(t){var e,i;for(e in this._sessions){if(!this._sessions.hasOwnProperty(e))return;i=this._sessions[e],"function"==typeof i.onMessage&&i.onMessage(t)}},JSServer.ChartApi.prototype.unpack=function(t){throw Error("This method is not implemented")},JSServer.ChartApi.prototype.quoteCreateSession=function(t){return this._studyEngine.quoteCreateSession(t)},JSServer.ChartApi.prototype.quoteDeleteSession=function(t){return this._studyEngine.quoteDeleteSession(t)},JSServer.ChartApi.prototype.quoteSetFields=function(t,e){return this._studyEngine.quoteSetFields(t,e)},JSServer.ChartApi.prototype.quoteAddSymbols=function(t,e){return-1!==e.indexOf(void 0)&&(console.warn("Got undefined in quoteAddSymbols"),e=e.filter(function(t){return!!t})),this._studyEngine.quoteAddSymbols(t,e)},JSServer.ChartApi.prototype.quoteRemoveSymbols=function(t,e){return this._studyEngine.quoteRemoveSymbols(t,e)},JSServer.ChartApi.prototype.quoteFastSymbols=function(t,e){return this._studyEngine.quoteFastSymbols(t,e)},JSServer.ChartApi.prototype.quoteHibernateAll=function(t){return this._studyEngine.quoteHibernateAll(t)},JSServer.ChartApi.prototype.depthCreateSession=function(t){return this._studyEngine.depthCreateSession(t)},JSServer.ChartApi.prototype.depthDeleteSession=function(t){return this._studyEngine.depthDeleteSession(t)},JSServer.ChartApi.prototype.depthSetSymbol=function(t,e){return this._studyEngine.depthSetSymbol(t,e)},JSServer.ChartApi.prototype.depthClearSymbol=function(t){},JSServer.ChartApi.prototype.depthSetScale=function(t,e){},JSServer.ChartApi.prototype.createStudiesAccessController=function(t,e,i){return new this.StudiesAccessController(this._studyEngine,t&&JSON.parse(t)||{type:"black",tools:[]})},JSServer.ChartApi.prototype.StudiesAccessController=function(t,e){this._studyEngine=t,this._studiesAccess=e},JSServer.ChartApi.prototype.StudiesAccessController.prototype._findTool=function(t){var e,i,o=null;for(e=0;e<this._studiesAccess.tools.length;++e)if(i=this._studiesAccess.tools[e],i.name===t||i===t){o=i;break}return o},JSServer.ChartApi.prototype.StudiesAccessController.prototype.getEnabledTools=function(){return this._studyEngine.studiesMetadata().filter(function(t){var e=this._findTool(t.description);return"black"===this._studiesAccess.type?!e||e.grayed:!!e},this)},JSServer.ChartApi.prototype.StudiesAccessController.prototype.isToolGrayed=function(t){var e=this._findTool(t);return e&&e.grayed},
JSServer.ChartApi.prototype.serverTimeOffset=function(){return this._studyEngine.serverTimeOffset()},JSServer.ChartApi.prototype.alignTimePoint=function(t,e,i){return this._studyEngine.alignTimePoint(t,e,i)},JSServer.ChartApi.prototype.disconnectCount=function(){return 0},u(JSServer.ChartApi,"JSServer.ChartApi",c,"ChartApiInterface"),t.exports=JSServer.ChartApi},function(t,e,i){"use strict";(function(e,o){function n(t,i){var o=e.get_timezone(i.timezone),n=new y.Session;return n.init(o,i.session),f.Symbol.newBarBuilder(t,n,n)}function r(t){function e(t){console.warn("SymbolInfo validation: "+t)}var i,o;if((void 0===t.minmov||t.minmov<=0)&&e("minmov must be positive"),(void 0===t.pricescale||t.pricescale<=0)&&e("pricescale must be positive"),void 0!==t.name&&0!==t.name.length||e("name must be non-empty string"),void 0!==t.session&&0!==t.session.length||e("session must be non-empty string"),void 0===t.timezone||0===t.timezone.length?e("timezone must be non-empty string"):"exchange"!==t.timezone&&d(t.timezone)||"UTC"!==t.timezone&&e('unsupported timezone "{0}"'.format(t.timezone)),void 0!==t.intraday_multipliers)if(i=t.intraday_multipliers,Array.isArray(i))for(o=0;o<i.length;++o)"string"!=typeof i[o]&&e('intraday_multipliers[{0}] = "{1}" must be string (now: {2})'.format(o+1,i[o],typeof i[o]));else e("intraday_multipliers must be array");(t.supported_resolutions||[]).filter(function(t){return!b.isValid(t)}).forEach(function(t){e("supported_resolutions field contains invalid value: "+t)})}function s(t){var e,i;if(t.base_name||(t.base_name=[t.name]),t.legs||(t.legs=[t.name]),t.exchange||(t.exchange=t["exchange-listed"]),t.full_name||(t.full_name=t.symbol||(t.exchange?t.exchange+":"+t.name:t.name)),t.pro_name||(t.pro_name=t.full_name),t.data_status||(t.data_status="streaming"),t.ticker||(t.ticker=t.symbol||t.name),!t.session&&t["session-regular"]&&(t.session=t["session-regular"]),!t.minmov&&t.minmovement&&(t.minmov=t.minmovement),t.supported_resolutions)for(e=0;e<t.supported_resolutions.length;e++)i=b.parse(t.supported_resolutions[e]),i.isValid()&&(t.supported_resolutions[e]=i.value())}function a(t,e){null!=t.graphicsCmds&&null!=t.graphicsCmds.create&&null!=t.graphicsCmds.create.vertlines&&t.graphicsCmds.create.vertlines.forEach(function(t){t.data.forEach(e)})}function l(t,e){var i,o,n=t.length,r=e.length,s=0;for(i=0;i<n;++i){for(o=t[i];s<r&&e[s].value[0]<o;)++s;s>=r?t[i]=e[r-1].index:t[i]=e[s].index}}function c(t,e){var i,o;null!==e&&0!==e.length&&(i={},w(t,function(t){T(t)&&Object.keys(t).forEach(function(e){e.endsWith("__t")&&(i[t[e]]=!0)})},{visitInstances:!0}),o=Object.keys(i).map(Number).sort(function(t,e){return t-e}),o.forEach(function(t,e){i[t]=e}),Object.assign(t,w(t,function(t){return T(t)&&Object.keys(t).forEach(function(e){e.endsWith("__t")&&(t[e.slice(0,-3)]=i[t[e]])}),t},{visitInstances:!0})),l(o,e),t.indexes=o)}function h(t,e){var i,o;null!==e&&0!==e.length&&(i={},a(t.data,function(t){i[t.time]=!0}),o=Object.keys(i).map(Number).sort(function(t,e){return t-e}),o.forEach(function(t,e){i[t]=e}),
a(t.data,function(t){t.index=i[t.time]}),l(o,e),t.indexes=o)}var u,d,p,_=i(1003),f=i(48),m=i(1004),g=i(1006),v=i(1007),y=i(58),b=i(34).Interval,S=i(23),w=i(1008).visitObject,T=i(15).isObject;i(234),i(365),u=i(1009).DatafeedRequestsCachedProcessor,d=i(171).timezoneIsAvailable,p=function(t){function e(t,e,i){return function(o){var r,a;o&&o.count()&&(r=n(e,t),a=1e3*s.getCurrentUTCTime(),r.moveTo(a),r.indexOfBar(a)>=0&&o.setLastBarClosed(!1)),i(o)}}function i(t,i,o,n,r){return s._cachedDatafeed.subscribe(t,i,o,e(t,i,n),r)}function o(t){return s._cachedDatafeed.unsubscribe(t)}function r(t,e,i){s.resolveSymbol(t,e,i)}var s=this;this._studiesCache={},this._sessionsLastDataCache={},this._metainfoCache=[],this._barsCoefficientsCache={},this._extrapolationManager=g,this._externalDatafeed=t,this._datafeedConfiguration=null,this._marketStatusWatchers={},this._resolveRequests={},this._callbacks={},this._serverTimeOffset=0,s._logMessage("Datafeed settings received: {0}".format(JSON.stringify(window.configurationData))),s._datafeedConfiguration=s._adoptConfigurationData(window.configurationData),s._fireEvent("configuration_received"),s._externalDatafeed.getServerTime&&s._externalDatafeed.getServerTime(function(t){s._serverTimeOffset=t-(new Date).valueOf()/1e3}),this._pointsetsManager=v,this._rangeExtensionData={},this._quotesInfo=[],this._depthInfo=[],this._fullNameSymbolInfoMap={},this._endOfData={},this._computeStudyCounter=0,this._cachedDatafeed=new u(t,p.createDWMAligner),this._extendedRange=function(t){return s._rangeExtensionData[t]&&s._rangeExtensionData[t].summary},this._extendedTime=function(t){return s._rangeExtensionData[t]&&s._rangeExtensionData[t].time},m.setupFeed({resolve:r,subscribe:i,unsubscribe:o,calculateHistoryDepth:this._externalDatafeed.calculateHistoryDepth?this._externalDatafeed.calculateHistoryDepth.bind(this._externalDatafeed):void 0})},p.createDWMAligner=function(t,i,n){var r,s,a;return o.enabled("disable_resolution_rebuild")||!b.isDWM(t)?null:(r=new y.Session,r.init("Etc/UTC","0000-0000:1234567"),s=e.get_timezone(i),a=new y.Session,a.init(s,n),f.Symbol.newBarBuilder(t,a,r))},p.prototype._barsCoefficients=function(t,e){if(0!==t.indexOf("="))return{};var i=t+e;return this._barsCoefficientsCache[i]||(this._barsCoefficientsCache[i]={}),this._barsCoefficientsCache[i]},p.prototype.destroy=function(){this._cachedDatafeed.destroy(),this._externalDatafeed=null},p.prototype.purgeCache=function(){this._endOfData={},this._resolveRequests={}},p.prototype.purgeDataCache=function(){this._cachedDatafeed.purgeCache()},p.prototype._logMessage=function(t){o.enabled("charting_library_debug_mode")&&console.log(t)},p.prototype._extendRange=function(t,e){this._rangeExtensionData[t]||(this._rangeExtensionData[t]={}),void 0===this._rangeExtensionData[t].summary&&(this._rangeExtensionData[t].summary=0),this._rangeExtensionData[t].summary+=e},p.prototype.on=function(t,e){return this._callbacks.hasOwnProperty(t)||(this._callbacks[t]=[]),this._callbacks[t].push(e),this},p.prototype._fireEvent=function(t,e,i){var o,n
;if(this._callbacks.hasOwnProperty(t)){for(o=this._callbacks[t],n=0;n<o.length;++n)o[n](e);i||(this._callbacks[t]=[])}},p.prototype._adoptConfigurationData=function(t){var e,i,o,n,r,s=TradingView.merge({},t),a=s.supported_resolutions;if(!a||0===a.length)return s.supported_resolutions=void 0,s;for(e={},i=0;i<a.length;i++)o=a[i],n=b.parse(o),r=n.value(),n.isValid()?e.hasOwnProperty(r)?console.warn("Duplicating resolution in the configuration data: `"+o+"`"):e[r]=1:console.warn("Invalid resolution in the configuration data: `"+o+"`");return s.supported_resolutions=e,s},p.prototype.supportedResolutions=function(){return this._datafeedConfiguration.supported_resolutions},p.prototype.supportedSymbolsTypes=function(){return this._datafeedConfiguration.symbols_types||[]},p.prototype.supportedExchangesList=function(){return this._datafeedConfiguration.exchanges||[]},p.prototype.futuresRegex=function(){return this._datafeedConfiguration.futures_regex||/$a/},p.prototype._findStudyObject=function(t){var e=t.split("@")[0],i=JSServer.studyLibrary.filter(function(i){return i.metainfo.id===t||i.metainfo.shortDescription===e});if(0===i.length)throw Error("Study `"+t+"` not found");return i[0]},p.prototype.getMarks=function(t,e,i,o,n){var r,s={red:6,green:5,blue:4,yellow:3};this._externalDatafeed.getMarks&&this._datafeedConfiguration.supports_marks&&(this._logMessage("Requesting bars marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString())),r=this,this._externalDatafeed.getMarks(t,e,i,function(e){var i,a,l=e.map(function(t){return t.time=parseInt(t.time),t});r._logMessage("Received bars marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(l))),i=p.createDWMAligner(n,t.timezone,t.session),a=l.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t.direction=s[t.color],t.onClicked=function(){S.emit("onMarkClick",t.id)},t.label=!!t.label&&t.label[0],t}),o(a)},n))},p.prototype.getTimescaleMarks=function(t,e,i,o,n){if(this._externalDatafeed.getTimescaleMarks&&this._datafeedConfiguration.supports_timescale_marks){this._logMessage("Requesting timescale marks: symbol {0}, resolution {1}, range [{2} ... {3}]".format(t.full_name,n,new Date(1e3*e).toUTCString(),new Date(1e3*i).toUTCString()));var r=this;this._externalDatafeed.getTimescaleMarks(t,e,i,function(e){var i,s;r._logMessage("Received timescale marks: symbol {0}, resolution {1}, marks {2}".format(t.full_name,n,JSON.stringify(e))),i=p.createDWMAligner(n,t.timezone,t.session),s=e.map(function(t){return t.tickmark=null!==i?i.tradingDayToSessionStart(1e3*t.time)/1e3:t.time,t}),o(s)},n)}},p.prototype._computeStudy=function(t,e,i,o,n,r,s,a,l,c){function h(t,e,i){var o,n,r,s,l=t.time,c="number"==typeof e?[e]:e;for(o=0;o<c.length;++o)n=c[o],n&&"object"==typeof n&&(_["plot_"+o]=n.offset,n=n.value,m++),"number"==typeof n&&isNaN(n)&&(n=void 0),c[o]=n;r=p.length-1,s=r<0||l>p[r].value[0],s?p.push({index:p.length,value:[l].concat(c)
}):p[r].value=[l].concat(c),u||a([p[p.length-1]],s,p.length,_,i)}var u=!0,d=this._computeStudyCounter++,p=[],_={},m=0,g=!1,v=!1,y=this,b=function(a){var d;if(f.Symbol.parsePeriod(o).isIntraday&&!a.has_intraday)return void l("Unsupported resolution. Did you forget to set has_intraday to true?");if(d=new f.StudyEngine({tickerid:i,symbolInfo:a,period:o,body:e,sessionId:t,onErrorCallback:l,rangeExtension:{getRangeExtensionCount:y._extendedRange.bind(this,t),getRangeExtensionTime:y._extendedTime.bind(this,t)},input:function(t){return r[t]},out:function(t,e){h(t,e,a)},nonseriesOut:function(t,e){v=!0,c(e,a)},setNoMoreData:function(){g=!0},recalc:function(t,e){u=!1,p.endOfData=g,(!v||p.length>0)&&s(p,m>0?_:void 0,a,e)}}),!y._studiesCache[t]||!y._studiesCache[t][n])throw Error("This should never happen");y._studiesCache[t][n].engine=d},S=function(t){l(t)},w=function(){return y._studiesCache[t]&&y._studiesCache[t][n]&&y._studiesCache[t][n].activeResolve===d};y._studiesCache[t][n].activeResolve=d,this.resolveSymbol(i,function(){w()&&b.apply(y,arguments)},function(){w()&&S.apply(y,arguments)})},p.prototype._createStudy=function(t,e,i,o,n,r,s){function a(t){var e,i,r;if(Array.isArray(t))return t;for(e=[],i=u._studiesCache[o][n].metainfo.inputs,r=0;r<i.length;r++)e[r]=t[i[r].id];return e}function l(i,s,a){TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,r,u._convertBarsTimeToUnix(i),s,a,u._extendedRange(t,e)),TradingView.ChartapiMessagerInstances[o].onStudyCompleted(n,r)}var u=this;s=a(s),TradingView.ChartapiMessagerInstances[o].onStudyLoading(n,r),u._computeStudy(o,i,t,e,n,s,function(t,e,i){l(t,e?{data:{offsets:e}}:null,i)},function(i,s,a,l,c){var h=l?{data:{offsets:l}}:null;TradingView.ChartapiMessagerInstances[o].onDataUpdate(n,r,u._convertBarsTimeToUnix(i),h,c,u._extendedRange(t,e))},function(t){TradingView.ChartapiMessagerInstances[o].onStudyError(n,t)},function(t,e){var i;switch(t.type){case"projection":this._updateProjectionData(o,n,r,t);break;case"study_graphics":i={data:t.data,indexes:[]},h(i,u._sessionsLastDataCache[o]),l([],i,e);break;case"non_series_data":i={data:t.data,indexes:[]},c(i,u._sessionsLastDataCache[o]),l([],i,e);break;default:console.warn("unsupported non-series data type for study "+t.type)}}.bind(this))},p.prototype.stopSources=function(t){var e,i;for(e in this._studiesCache[t])(i=this._studiesCache[t][e])&&(i.engine&&i.engine.stop(),i.activeResolve=-1);m.unsubscribeUnused()},p.prototype.recreateSources=function(t,e,i,o){var n,r;this.stopSources(i);for(n in this._studiesCache[i])(r=this._studiesCache[i][n])&&(r.symbol=t,r.resolution=e,"series"===r.type&&this.createSeries(t,e,i,n,r.turnaround,o));for(n in this._studiesCache[i])(r=this._studiesCache[i][n])&&"study"===r.type&&this._createStudy(t,e,r.studyObject,i,n,r.turnaround,r.inputs)},p.prototype.removeStudy=function(t,e){this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].engine&&(this._studiesCache[t][e].engine.stop(),m.unsubscribeUnused()),this._studiesCache[t][e]=null},p.prototype.removeSeries=function(t,e){
this.removeStudy(t,e)},p.prototype.recomputeStudy=function(t,e,i,o){var n=this._studiesCache[i][t];if(!n)throw Error("This should never happen");n.inputs=e,n.turnaround=o,n.engine&&n.engine.stop(),this._createStudy(n.symbol,n.resolution,n.studyObject,i,t,o,e)},p.prototype._convertBarsTimeToUnix=function(t){var e,i,o=[];for(e=0;e<t.length;++e)i={index:t[e].index,value:[].concat(t[e].value)},i.value[0]/=1e3,o.push(i);return o.endOfData=t.endOfData,o},p.prototype.createStudy=function(t,e,i,o,n,r,s){var a=this._findStudyObject(r),l=new a.constructor;this._studiesCache[i]=this._studiesCache[i]||{},this._studiesCache[i][o]={studyObject:l,symbol:t,resolution:e,guid:o,type:"study",inputs:s,metainfo:a.metainfo,turnaround:n},this._createStudy(t,e,l,i,o,n,s)},p.prototype.purgeRangeExtensionData=function(t){t?this._rangeExtensionData[t]={summary:0}:this._rangeExtensionData={}},p.prototype.ensureExtendedTo=function(t,e,i){var o,n=this._studiesCache[e][t];if(!n)throw Error("This should never happen");this.purgeRangeExtensionData(e),this._rangeExtensionData[e]||(this._rangeExtensionData[e]={}),this._rangeExtensionData[e].time=i,o=this,setTimeout(function(){o.recreateSources(n.symbol,n.resolution,e,!0)},0)},p.prototype.extendSeriesRange=function(t,e,i){var o,n,r,s,a=this._studiesCache[e][t];if(!a)throw Error("This should never happen");if(this._isEndOfData(e,t,a.turnaround))return o=a.engine.runner.host.symbolInfo.data_status,void setTimeout(function(){TradingView.ChartapiMessagerInstances[e].onSeriesCompleted(t,a.turnaround,o)},0);i+=10,n=this._barsCoefficients(a.symbol,a.resolution),r=n.barsCoefficient||1,this._extendRange(e,i*r),n.barsCoefficient||(n.expectedBarsCount=this._extendedRange(e)),s=this,setTimeout(function(){s.recreateSources(a.symbol,a.resolution,e,!0)},0)},p.prototype._updateProjectionData=function(t,e,i,o){var n=o.barsetSize?this._convertBarsTimeToUnix([{index:o.barsetSize-1,exTime:o.lastBar?o.lastBar[0]/1e3:0,value:o.lastBar}]):null;TradingView.ChartapiMessagerInstances[t].onProjectionUpdate(e,i,o,n)},p.prototype.updateSeriesTurnaround=function(t,e,i){this._studiesCache[t]||(this._studiesCache[t]={}),this._studiesCache[t][e]||(this._studiesCache[t][e]={}),this._studiesCache[t][e].type="series",this._studiesCache[t][e].turnaround=i},p.prototype.seriesTurnaround=function(t,e){return this._studiesCache[t]&&this._studiesCache[t][e]&&this._studiesCache[t][e].turnaround},p.prototype.createSeries=function(t,e,i,n,r,s){function a(t,o,n){l._extrapolationManager.storage(i,t.full_name,e).setLastBarTime(o,n)}var l,c=t,h=new f.OHLCV;this._studiesCache[i]=this._studiesCache[i]||{},this._sessionsLastDataCache[i]=null,this._studiesCache[i][n]={symbol:t,resolution:e,studyObject:h,guid:n,type:"series",turnaround:r},TradingView.ChartapiMessagerInstances[i].onSeriesLoading(n,r),l=this,this._computeStudy(i,h,c,e,n,[],function(o,c,h,u){var d,p,_,f,m,g;if(!l._studiesCache[i][n])throw Error("This should never happen");if(l._sessionsLastDataCache[i]=o,d=l._convertBarsTimeToUnix(o),p=d.length>0?1e3*d[0].value[0]:void 0,
u.nextTime&&(!p||u.nextTime<p/1e3))return void l.ensureExtendedTo(n,i,u.nextTime);0!==d.length&&(_=l._barsCoefficients(t,e),_.expectedBarsCount&&_.barsCount&&(_.barsCoefficient=Math.min(Math.max(_.barsCoefficient||1,parseInt(_.expectedBarsCount/(d.length-_.barsCount)+.5)),100)),_.barsCount=d.length,f=d[d.length-1],a(h,d.length-1,1e3*f.value[0]),l.rebuildExtrapolatedData(i,t.name,e,h,1e3*f.value[0]),s&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,r),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,r,d,h,0),m=l._extrapolationManager.storage(i,h.full_name,e),Promise.resolve().then(function(){l._pointsetsManager.broadcastPointsetsUpdates(h.full_name,e,o,m,h,function(t,e){TradingView.ChartapiMessagerInstances[i].onPointsetDataUpdate(t,r,e,h)})})),g=0===d.length||u&&u.endOfData,g&&(l._logMessage("Series has no more data on server: {0}".format(h.full_name)),l._setEndOfData(i,n,r),0===d.length&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,r)),TradingView.ChartapiMessagerInstances[i].onSeriesCompleted(n,r,h.data_status)},function(t,o,s,c,h){var u,d=l._convertBarsTimeToUnix(t),p=d[d.length-1];if(o){if(!l._studiesCache[i][n])throw Error("This should never happen");u=s-1,l._logMessage("New bar arrived: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,r,[p],h,u),a(h,u,1e3*p.value[0]),l.rebuildExtrapolatedData(i,h.full_name,e,h,1e3*p.value[0])}else l._logMessage("Last bar update: symbol {0}, bar {1}".format(h.full_name,JSON.stringify(p))),TradingView.ChartapiMessagerInstances[i].onDataUpdate(n,r,d,null,h);l._fireEvent("realtime_tick",t[t.length-1],!0)},function(t){l._logMessage("Series error: {0}".format(t)),TradingView.ChartapiMessagerInstances[i].onSeriesError(n,t),o.enabled("clear_bars_on_series_error")&&TradingView.ChartapiMessagerInstances[i].onSeriesClearData(n,r)},function(t,o){var s,c,h,u,d,p,_,f;if("projection"!==t.type)throw Error("unexpected non-series data type for series "+t.type);if(s=t.projectionTime/1e3,c=-1,(t.data||[]).forEach(function(t){c=Math.max(c,t[0]||0)}),c=Math.min(c,100),h=t.barsetSize,s&&c>=0&&h&&t.lastBar){for(u=[],d=0;d<=c;d++)u.push(s+.001*d);p=t.lastBar.slice(0),p[0]=p[0]/1e3,TradingView.ChartapiMessagerInstances[i].onTimescaleUpdate(n,r,[{index:h-1,value:p}],o,h-1,u),_=h+c,f=1e3*Math.trunc(u[c]),a(o,_,f),l.rebuildExtrapolatedData(i,o.full_name,e,o,f)}l._updateProjectionData(i,n,r,t)})},p.prototype.onMoreTickmarksRequested=function(t,e,i,o,n){this._extrapolationManager.storage(t,i.full_name,o).onTickmarksNeeded(i,n)},p.prototype.removePointset=function(t){this._pointsetsManager.removePointset(t)},p.prototype.rebuildExtrapolatedData=function(t,e,i,o,n){this._extrapolationManager.storage(t,o.full_name,i).rebuild(n,o)},p.prototype.createPointset=function(t,e,i,o,n,r){var s=this._extrapolationManager.storage(t,o.full_name,n);this._pointsetsManager.createPointset(e,i,n,r,s,o)},p.prototype.studiesMetadata=function(){
return 0===this._metainfoCache.length&&(this._metainfoCache=JSServer.studyLibrary.map(function(t){return t.metainfo})),this._metainfoCache},p.prototype.searchSymbols=function(t,e,i,o){function n(t){r._logMessage("Symbol search response: {0}".format(JSON.stringify(t))),o(t)}this._logMessage("Symbol search requested: search string `{0}`, exchange: `{1}`, type `{2}`".format(t,e,i));var r=this;this._externalDatafeed.searchSymbols(t,e,i,n)},p.prototype.resolveSymbol=function(t,e,i){var o,n=m.parseSymbol(t).symbol;this._resolveRequests[n]?o=this._resolveRequests[n]:(o=this.resolveSymbolInternal(n),this._resolveRequests[n]=o),o.done(e).fail(i)},p.prototype.resolveSymbolInternal=function(t){var e,i=this,o=$.Deferred();return this._logMessage("Symbol resolve requested: `{0}` ".format(t)),e=!0,this._externalDatafeed.resolveSymbol(t,function(n){e&&console.warn("`resolveSymbol` should return result asynchronously. Use `setTimeout` with 0 interval to execute the callback function."),i._logMessage("Symbol resolved: `{0}`, SymbolInfo in server response {1}".format(t,JSON.stringify(n))),s(n),r(n),i._logMessage("Symbol info after post-processing: `{0}`, SymbolInfo {1}".format(t,JSON.stringify(n))),i._fullNameSymbolInfoMap[n.full_name]=n,o.resolve(n)},function(e){i._logMessage("Symbol resolve failed: `{0}`, reason: `{1}`".format(t,e)),o.reject(e)}),e=!1,o.promise()},p.prototype._createMarketStatusWatchers=function(t,e){void 0===this._marketStatusWatchers[t]&&(this._marketStatusWatchers[t]={});var i=this;e.forEach(function(e){void 0===i._marketStatusWatchers[t][e]&&(i._marketStatusWatchers[t][e]=new _(i,t,e))})},p.prototype._removeMarketStatusWatchers=function(t){var e=this;Object.keys(this._marketStatusWatchers[t]||{}).forEach(function(i){e._marketStatusWatchers[t][i].stop()}),this._marketStatusWatchers[t]={}},p.prototype._stopQuotesSubscription=function(t){this._quotesInfo[t].listenerGUID&&(this._externalDatafeed.unsubscribeQuotes(this._quotesInfo[t].listenerGUID),this._quotesInfo[t].listenerGUID=void 0),this._removeMarketStatusWatchers(t)},p.prototype._startQuotesSubscription=function(t){function e(e,i){var o=r._marketStatusWatchers[t][e.n];e.symbolname=e.n,e.status=e.s,e.values=e.v,e.values.change=e.v.ch,e.values.last_price=e.v.lp,e.values.change_percent=e.v.chp,e.values.current_session=e.v.cs||o&&o.marketStatus(),e.values.pricescale=i.pricescale,e.values.minmov=i.minmov,e.values.minmove2=i.minmove2||0,e.values.fractional=i.fractional||!1,o&&e.v.cs&&o.stop(),TradingView.ChartapiMessagerInstances[t].onQuotesData([t].concat([e]))}function i(t){t.forEach(function(t){void 0!==n[t.n]?null!==n[t.n]&&e(t,n[t.n]):r.resolveSymbol(t.n,function(i){n[t.n]=i,e(t,i)},function(){n[t.n]=null})})}var n={},r=this,s=this._quotesInfo[t].symbols;0!==s.length&&(this._externalDatafeed.getQuotes&&!o.enabled("charting_library")?this._externalDatafeed.getQuotes(s,function(e){r._quotesInfo[t]&&(i(e),r._quotesInfo[t].listenerGUID=t,r._externalDatafeed.subscribeQuotes(s,r._quotesInfo[t].fastSymbols,i,r._quotesInfo[t].listenerGUID))
},function(t){}):!this._externalDatafeed.getQuotes&&o.enabled("trading_terminal")&&setTimeout(function(){i(s.map(function(t){return{n:t,s:"ok",v:{}}}))}),this._createMarketStatusWatchers(t,s))},p.prototype._restartQuotesSubscription=function(t){this._stopQuotesSubscription(t),this._startQuotesSubscription(t)},p.prototype.quoteCreateSession=function(t){this._quotesInfo[t]={symbols:[],fastSymbols:[],listenerGUID:void 0}},p.prototype.quoteDeleteSession=function(t){this._stopQuotesSubscription(t),this._quotesInfo[t]=null},p.prototype.quoteSetFields=function(t,e){},p.prototype.quoteAddSymbols=function(t,e){this._quotesInfo[t].symbols=this._filteredSymbols(this._quotesInfo[t].symbols.concat(e)),this._restartQuotesSubscription(t)},p.prototype.quoteRemoveSymbols=function(t,e){this._quotesInfo[t].symbols=this._quotesInfo[t].symbols.filter(function(t){return e.indexOf(t)<0}),this._restartQuotesSubscription(t)},p.prototype.quoteFastSymbols=function(t,e){this._quotesInfo[t].fastSymbols=this._filteredSymbols(e),this._restartQuotesSubscription(t)},p.prototype.quoteHibernateAll=function(t){},p.prototype._stopDepthSubscription=function(t){this._depthInfo[t].listenerGUID&&(this._externalDatafeed.unsubscribeDepth(this._depthInfo[t].listenerGUID),this._depthInfo[t].listenerGUID=void 0)},p.prototype._startDepthSubscription=function(t){function e(t){return t.map(function(t){return{p:t.price,v:t.volume}})}function i(t){var i={};return i.s=r,i.bids=e(t.bids),i.asks=e(t.asks),i}function o(e){e.snapshot?TradingView.ChartapiMessagerInstances[t].onDepthData([t].concat([i(e)])):TradingView.ChartapiMessagerInstances[t].onDepthUpdate([t].concat([i(e)]))}var n=this,r=this._depthInfo[t].symbol;r&&this._fullNameSymbolInfoMap[r]&&this._externalDatafeed.subscribeDepth&&(n._depthInfo[t].listenerGUID=this._externalDatafeed.subscribeDepth(r,function(e){n._depthInfo[t]&&o(e)}))},p.prototype._restartDepthSubscription=function(t){this._stopDepthSubscription(t),this._startDepthSubscription(t)},p.prototype.depthCreateSession=function(t){this._depthInfo[t]={symbol:null,listenerGUID:void 0}},p.prototype.depthDeleteSession=function(t){this._depthInfo[t].symbol=null,this._stopDepthSubscription(t),delete this._depthInfo[t]},p.prototype.depthSetSymbol=function(t,e){this._depthInfo[t].symbol=e,this._restartDepthSubscription(t)},p.prototype._filteredSymbols=function(t){var e=[];return t.forEach(function(t){t instanceof Object||e.indexOf(t)<0&&e.push(t)}),e},p.prototype._isEndOfData=function(t,e,i){var o=t+"!"+e+"@"+i;return!!this._endOfData[o]},p.prototype._setEndOfData=function(t,e,i){var o=t+"!"+e+"@"+i;this._endOfData[o]=!0},p.prototype.alignTimePoint=function(t,e,i){return o.enabled("disable_resolution_rebuild")?t:n(e,i).alignTimeIfPossible(1e3*t)/1e3},p.prototype.serverTimeOffset=function(){return this._serverTimeOffset},p.prototype.getCurrentUTCTime=function(){return(new Date).valueOf()/1e3+this._serverTimeOffset},t.exports=p}).call(e,i(50),i(5))},function(t,e,i){"use strict";(function(e){var o=i(58),n={},r=function(t,i,r){function s(){var t={};t.symbolname=_,
t.status="ok",t.values={},t.values.current_session=d,n[_]=d,TradingView.ChartapiMessagerInstances[f].onQuotesData([f].concat([t]))}function a(t,i,n){var r=e.get_timezone(i);c=(new o.Session).init(r,t),h=n,m=setTimeout(l,6e4),l(),s()}function l(){var t,e;if(c){if(h)return void(d="out_of_session");t=o.isTradingNow(new Date,c),e=t?"market":"out_of_session",e!==d&&(d=e,s())}}var c,h,u={},d=n[r]||"out_of_session",p=!1,_=r,f=i,m=null;return t.resolveSymbol(r,function(t){p||a(t.session,t.timezone,t.expired)},function(){}),u.stop=function(){p=!0,m&&clearTimeout(m)},u.marketStatus=function(){return d},u};t.exports=r}).call(e,i(50))},function(t,e,i){"use strict";(function(e){var o=i(1005).HeikenAshi,n=i(34).Interval,r=function(){function t(t){this.host=t,this.cache={}}function r(t){var e=t.indexOf(",");return-1===e?t:t.slice(0,e)}function s(t,e,i,o,n,r){return n+t+e+i+(a(o)?"_":"")+r}function a(t){return t.has_empty_bars||t.force_session_rebuild}function l(t){if(0!==t.indexOf("="))return{symbol:t};var e;try{e=JSON.parse(t.slice(1))}catch(e){return{symbol:t}}return e.type&&(0===e.type.indexOf("BarSetHeikenAshi@tv-basicstudies-")?e.builder=new o:console.error("unknown builder type: "+e.type)),"string"!=typeof e.symbol&&(e.session=e.symbol.session||e.session,e.symbol=e.symbol.symbol),e}function c(e){t.instance=new t(e),p.setupFeed(t.instance)}var h,u,d,p=i(48),_=i(58),f=p.Symbol,m=p.StudyEngine,g=p.BarBuilder,v=p.BarSet;return t.prototype.getCache=function(t){return this.cache[t]},t.prototype.putCache=function(t,e){this.cache[t]=e},t.prototype.subscribe=function(t,e,i,o,n,r,a,l,c){var h=s(t,e,i,a,l,o),u=this.getCache(h);return u||(u=this.createItem(t,e,i,a,c,l,o),this.putCache(h,u)),u.listeners.addListener(n,r),{key:h,listener:n}},t.prototype.unsubscribe=function(t){var e=this.getCache(t.key);e&&e.listeners.removeListener(t.listener)},t.prototype.removeUnused=function(){var t,e,i,o,n,r=[];for(t in this.cache)this.cache[t]&&(e=this.cache[t],0===e.listeners.listenersCount()&&r.push(t));if(0!==r.length){for(i=0;i<r.length;i++)o=r[i],n=this.cache[o],this.cache[o]=null,n.stop();this.removeUnused()}},t.prototype.rebuildFrom=function(t,e,i){var o,n,r,s,a=f.parsePeriod(t),l=f.parsePeriod(e);if(""!==a.resolution&&!a.isSeconds){if(i.has_weekly_and_monthly)return a.resolution;if(void 0===i.has_daily||i.has_daily)return"D";""!==l.resolution&&(l.resolution="",l.interval=i.intraday_multipliers?i.intraday_multipliers[0]:1)}if(a.isIntraday&&void 0!==i.has_intraday&&!i.has_intraday)return"";if(a.isSeconds&&!i.has_seconds)return"";if(o=""!==a.resolution?l.interval:""===l.resolution?Math.min(a.interval,l.interval):a.interval,(n=a.isIntraday?i.intraday_multipliers:i.seconds_multipliers)&&-1===n.indexOf(o)){for(r=n.length-1;r>=0;r--)if(s=+n[r],o%s==0)return s+(a.isSeconds?"S":"");return""}return o+(a.isSeconds?"S":"")},t.prototype.createItem=function(t,e,i,o,s,c,p){var _,f,m,v,y,b,S=new d,w=l(t);return w.builder?new u(S,w.symbol,e,i,w.builder,o,s,c):(_=r(e),f=this.rebuildFrom(_,r(i),o),m=a(o),!n.isEqual(_,f)||m?(v=o.has_empty_bars,y=$.extend({},o),
m&&(y.has_empty_bars=!1,y.force_session_rebuild=!1),new u(S,w.symbol,e,f,new g(e,v),y,s,c,p)):(b=w.session&&"extended"!==w.session,new h(S,w.symbol,e,i,b,this.host,o,s,p)))},h=function(t,e,i,o,n,s,a,l,c){this.listeners=t,this.host=s;var h=this;this.host.resolve(e,function(t){n&&t.regular_session&&(t.session=t.regular_session);var s=h.calculateFromTo(t,c||o||i,e,l);h.subs=h.host.subscribe(t,r(i),s,function(t){h.listeners.fire(t)},function(t){h.listeners.onError(t)})},function(t){h.listeners.onError(t)})},h.prototype._createDWMAligner=function(t,i){var o=e.get_timezone(i.timezone),n=new _.Session;return n.init(o,i.session),f.newBarBuilder(t,n,n)},h.prototype.stop=function(){this.subs&&this.host.unsubscribe(this.subs)},h.prototype.calculateFromTo=function(t,i,o,n){var r,s,a,l,c,h,u,d,p=f.parsePeriod(i),m=(new Date).valueOf(),g=t.expired?e.cal_to_utc(e.get_timezone(t.timezone),new Date(1e3*t.expiration_date))||m:m;return""===p.resolution?(s=p.interval,a="D"):"S"===p.resolution?(s=10*p.interval,a=""):(l="D"===p.resolution?1:"W"===p.resolution?5:30,s=12*l*p.interval,a="M"),p.range?(s=p.range.interval,a=p.range.resolution):this.host.calculateHistoryDepth&&(c=this.host.calculateHistoryDepth(i,a,s))&&(s=c.intervalBack||s,a=void 0===c.resolutionBack?a:c.resolutionBack),h=t.sessionString||t.session,r=_.alignPeriodsBack(h,a,s,1,g),n&&n.getRangeExtensionTime&&(u=n.getRangeExtensionTime())&&(r=Math.min(1e3*u,r)),n&&n.getRangeExtensionCount&&(d=n.getRangeExtensionCount())>0&&(r=_.alignPeriodsBack(h,p.resolution,p.interval,d,r)),{from:r,to:g+6e4}},u=function(t,e,i,o,n,r,s,a,l){if(this.listeners=t,this.isRecalculated=!1,""===o)return console.error("unsupported resolution for rebuild: "+i),void this.listeners.onError("unsupported resolution for rebuild: "+i);this.symbolInfo=r;var c=this;this.engine=new m({tickerid:e,period:o,periodBase:i,body:n,sessionId:a,symbolInfo:r,rangeExtension:s,periodForInitialRange:l,recalc:function(t,e){c._recalc(e)},out:function(t,e){c._out(t,e)},nonseriesOut:function(t,e){c._nonseriesOut(t,e)},setNoMoreData:function(){c.barset&&(c.barset.endOfData=!0)},onErrorCallback:function(t){c.listeners.onError(t)}})},u.prototype.stop=function(){this.engine?this.engine.stop():console.error("Internal library error 0x1")},u.prototype._recalc=function(t){this.isRecalculated&&console.error("recalc called twice!"),this.barset||(this.barset=new v(this.symbolInfo)),t&&(this.barset.nextTime=t.nextTime,this.barset.endOfData=t.endOfData),this.listeners.fire(this.barset),this.isRecalculated=!0},u.prototype._nonseriesOut=function(t,e){var i=Object.assign({},e);i.nonseries=!0,i.data=e.bars,delete i.bars,i.barsetSize=this.barset?this.barset.count():0,i.lastBar=this.barset?this.barset.bar(this.barset.count()-1):null,this.listeners.fire(i,!0)},u.prototype._out=function(t,e){var i,o,n,r,s,a,l,c=e[0];if(!isNaN(c)){if(i={time:c,open:e[1],high:e[2],low:e[3],close:e[4],volume:e[5],updatetime:e[6]},o=e[7],this.barset||(this.barset=new v(t.info)),(n=e[8])instanceof Array)for(r=0;r<n.length;r++)s=e[9],a=n[r],l={time:a,open:s,high:s,low:s,
close:s,volume:0,updatetime:a},this.barset.add(l,!0),this.isRecalculated&&this.listeners.fire(this.barset);this.barset.add(i,o),this.barset.isBarClosed=o,this.isRecalculated&&this.listeners.fire(this.barset)}},d=function(){this.listeners=[]},d.prototype.listenersCount=function(){return this.listeners.reduce(function(t,e){return t+(e?1:0)},0)},d.prototype.addListener=function(t,e){this.listeners.push({dataListener:t,onErrorCallback:e}),this.barset&&t(this.barset),this.errorMsg&&e(this.errorMsg)},d.prototype.removeListener=function(t){var e,i=this.listeners.filter(function(e){return e.dataListener===t});0!==i.length&&(e=this.listeners.indexOf(i[0]),delete this.listeners[e])},d.prototype.onError=function(t){var e,i,o,n;for(this.errorMsg=t||"unspecified error",e=this.listeners,i=e.length,o=0;o<i;o++)(n=e[o])&&n.onErrorCallback&&n.onErrorCallback(t)},d.prototype.fire=function(t,e){var i,o,n,r;for(e||(this.barset=t),i=this.listeners,o=i.length,n=0;n<o;n++)(r=i[n])&&r.dataListener(t)},{setupFeed:c,parseSymbol:l,unsubscribeUnused:function(){t.instance.removeUnused()}}}();t.exports=r}).call(e,i(50))},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(48),n=function(){function t(){}return t.prototype.main=function(t){var e,i,n,r,s=t.new_var(o.Std.open(t)),a=t.new_var(o.Std.close(t)),l=s.get(1),c=a.get(1),h=o.Std.ohlc4(t),u=o.Std.na(s.get(1))?(o.Std.open(t)+o.Std.close(t))/2:(l+c)/2;return s.set(u),a.set(h),e=o.Std.max(o.Std.high(t),o.Std.max(u,h)),i=o.Std.min(o.Std.low(t),o.Std.min(u,h)),n=o.Std.volume(t),r=t.symbol,[r.time,u,e,i,h,n,r.updatetime,r.isBarClosed]},t}(),e.HeikenAshi=n},function(t,e,i){"use strict";var o=function(){function t(t,e,i){return t+","+e+","+i}function e(e,i,o){delete n[t(e,i,o)]}function o(e,i,o){function s(t){return"undefined"!=typeof TradingView&&TradingView.ChartapiMessagerInstances?n[t]=new a(TradingView.ChartapiMessagerInstances[e],l.pureResolution):n[t]=new a(null,l.pureResolution),n[t]}var l=r.Symbol.parsePeriod(o),c=t(e,i,l.pureResolution);return n[c]?n[c]:s(c)}var n={},r=i(48),s=i(58),a=function(t,e,i){this._chartApiMessager=t,this._lastRealBarTime=null,this._lastRealBarIndex=null,this._resolution=e,this._extrapolatedBarsCache=[],this._onReadyCallbacks=[],this._requestedAmountOfBars=0,this._maxDepth=i||100};return a.prototype.ready=function(){return null!==this._lastRealBarIndex},a.prototype.rebuild=function(t,e){this._lastRealBarTime=t;var i=Math.max(this._extrapolatedBarsCache.length,this._requestedAmountOfBars);this._extrapolatedBarsCache=[],this.ensureExtrapolatedToBar(e,i)},a.prototype.historyExtrapolator=function(){return void 0===this._historyExtrapolator&&(this._historyExtrapolator=new a(null,this._resolution,Math.max(this._maxDepth,1500))),this._historyExtrapolator},a.prototype.getPointTimeUTC=function(t,e,i){var o,n;return 0===e?t:!this.ready()||t<this._lastRealBarTime/1e3?(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().getPointTimeUTC(t,e,i)):(o=0===this._extrapolatedBarsCache.length||t===this._lastRealBarTime/1e3,
n=o?-1:this.indexOfBar(t,i)-this._lastRealBarIndex-1,this.ensureExtrapolatedToBar(i,n+e+1),this._extrapolatedBarsCache[n+e])},a.prototype.findDistanceInBars=function(t,e,i){return t===e?0:(this.historyExtrapolator().setLastBarTime(0,1e3*t),this.historyExtrapolator().indexOfBar(e,i))},a.prototype.indexOfBar=function(t,e){this._ensureExtrapolatedToTime(e,1e3*t);var i=s.lower_bound(this._extrapolatedBarsCache,t,function(t,e){return t>e?1:t<e?-1:0});return-1===i?i:this._lastRealBarIndex+i+1},a.prototype._extrapolateData=function(t,e){var i,o,n;if(!this._lastRealBarTime)throw Error("No real bars known, so cannot extrapolate anything");if(!(i=e(this._lastRealBarTime))||0===i.length)return void(null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,this._extrapolatedBarsCache,t,this._resolution));for(o=0;o<i.length;++o)i[o]=i[o]/1e3;for(i[0]===this._lastRealBarTime/1e3&&(i=i.slice(1)),this._extrapolatedBarsCache=i,n=i.slice(0),n.sort(),o=0;o<n.length-1;++o)n[o]===n[o+1]&&console.error("Duplicating extrapolated bars: duplicated "+new Date(1e3*n[o]));null!==this._lastRealBarIndex&&null!==this._chartApiMessager&&this._chartApiMessager.onTickmarksUpdated(this._lastRealBarIndex+1,i,t,this._resolution)},a.prototype.onTickmarksNeeded=function(t,e){if(this.ready())this.ensureExtrapolatedToBar(t,e);else{var i=this;this._onReadyCallbacks.push(function(){i.ensureExtrapolatedToBar(t,e)})}},a.prototype.ensureExtrapolatedToBar=function(t,e){var i=this;return this._requestedAmountOfBars=e,this._extrapolateData(t,function(o){return i._extrapolatedBarsCache.length>=e||!i._shouldExtrapolateMore()?null:s.extrapolateBarsFrontByCount(i.newBarBuilder(t),o,e)})},a.prototype._ensureExtrapolatedToTime=function(t,e){var i=this;return this._extrapolateData(t,function(o){var n,r;return o>=e||!i._shouldExtrapolateMore()?null:(n=2e3,r=s.extrapolateBarsFrontToTime(i.newBarBuilder(t),o,e,n),r[r.length-1]<e&&console.warn("Extrapolation error: not enough data created"),r)})},a.prototype.newBarBuilder=function(t){var e=r.Symbol.newSession(t.timezone,t.session);return r.Symbol.newBarBuilder(this._resolution,e)},a.prototype._shouldExtrapolateMore=function(){return this._extrapolatedBarsCache.length<this._maxDepth},a.prototype.setLastBarTime=function(t,e){(null===this._lastRealBarIndex||this._lastRealBarIndex===t&&this._lastRealBarTime!==e)&&(this._extrapolatedBarsCache=[]),this._extrapolatedBarsCache&&this._extrapolatedBarsCache.length&&this._lastRealBarIndex!==t&&(this._lastRealBarIndex>t?this._extrapolatedBarsCache=[]:this._lastRealBarTime!==e&&this._extrapolatedBarsCache.shift(t-this._lastRealBarIndex)),this._lastRealBarIndex=t,this._lastRealBarTime=e;for(var i=0;i<this._onReadyCallbacks.length;++i)this._onReadyCallbacks[i]();this._onReadyCallbacks=[]},{remove:e,storage:o}}();t.exports=o},function(t,e,i){"use strict";(function(e){var o=i(58),n=i(34).Interval,r=function(){function t(t,e){return t}function r(t,e){var i=m.get_timezone(t.timezone),n=new o.Session
;return n.init(i,t.session),f.Symbol.newBarBuilder(e,n,n)}function s(e,i,o,n,r,s){var a,l,c,h,u=t(i,o);for(p.hasOwnProperty(u)||(p[u]=[]),a=[],l=0;l<n.length;++l)n[l][1]<0&&(n[l][1]=0),0!==n[l][1]?(c=r.getPointTimeUTC(n[l][0],n[l][1],s),a.push(c)):n[l][0]&&a.push(n[l][0]);h={guid:e,points:a},p[u].push(h)}function a(t){var e,i,o;for(e in p)for(i=p[e],o=0;o<i.length;++o)if(i[o].guid===t)return void i.splice(o,1)}function l(t,e,i,o,n){var r,s,a,l=[];for(r=0;r<t.points.length;++r){if(null==(s=t.points[r]))return null;if(null===(a=h(e,s,i,o,n)))return null;l.push({index:r,value:[a,s]})}return l}function c(e,i,o,n,r,s){var a,c,h,u,d=t(e,i);if(p.hasOwnProperty(d))for(a=p[d].length,c=0;c<a;++c)h=p[d][c],null!==(u=l(h,o,n,r,i))&&s(h.guid,u)}function h(t,e,i,n,s){var a,l;return 1e3*(e=r(n,s).alignTimeIfPossible(1e3*e)/1e3)<t[0].value[0]?-d(n,s,e,t[0].value[0]/1e3,i):(a=o.lower_bound(t,1e3*e,function(t,e){return t.value[0]>e?1:t.value[0]<e?-1:0}))>=0&&e<t[t.length-1].value[0]?(t[a].value[0]/1e3!==e&&0!==a&&a--,t[a].index):(l=i.indexOfBar(e,n),-1===l?null:l)}function u(t,e,i,o,r){function s(t,e){var i=new Date(1e3*t),o=new Date(1e3*e),n=12*(o.getFullYear()-i.getFullYear());return n-=i.getMonth()+1,n+=o.getMonth(),n<=0?0:n}var a,l,c,h,u,d,p,_,f,g,v,y,b,S,w;if(e.kind()===n.MONTHS)a=s(o,r)/e.multiplier();else if(e.kind()===n.WEEKS)l=Math.ceil((r-o)/604800),a=Math.ceil(l/e.multiplier());else{if(c=m.utc_to_cal(i.timezone,+new Date(1e3*o)),h=m.utc_to_cal(i.timezone,+new Date(1e3*r)),(u=(r-o)/86400)>4*(7-i.spec.weekEndsCount()))p=u/7,d=p*(7-i.spec.weekEndsCount());else{for(_=0,f={},g=c;g.valueOf()<=h.valueOf();g=m.add_days_considering_dst(i.timezone,g,1))v=m.get_day_of_week(g),void 0===f[v]&&(f[v]=i.spec.isWeekEnd(v)),f[v]&&_++;d=u-_}if(e.kind()===n.DAYS)a=Math.ceil(d/e.multiplier());else{if(y=e.kind()===n.HOURS?60*e.multiplier()*60:e.kind()===n.SECONDS?e.multiplier():60*e.multiplier(),u<1&&(b=i.spec.findSessionEntry(m.get_day_of_week(c),m.get_minutes_from_midnight(c)),S=i.spec.findSessionEntry(m.get_day_of_week(h),m.get_minutes_from_midnight(h)),b===S))return Math.ceil((r-o)/y);v=i.spec.entries()[0].dayOfWeek(),w=60*i.spec.entries().reduce(function(t,e){return t+(e.dayOfWeek()===v?e.length():0)},0),a=Math.ceil(d*w/y)}}return a}function d(t,e,i,s,a){var l,c,h=new n(e),d=m.get_timezone(t.timezone),p=new o.Session;return p.init(d,t.session),l=r(t,e),i=l.alignTimeIfPossible(1e3*i)/1e3,s=l.alignTimeIfPossible(1e3*s)/1e3,i>=s?0:(c=u(t,h,p,i,s),c>=1e3?c:a.findDistanceInBars(i,s,t))}var p={},_="undefined"!=typeof window?window:e,f=i(48),m=_.PineJsCalendar?_.PineJsCalendar:i(50);return{createPointset:s,removePointset:a,broadcastPointsetsUpdates:c,tests:{approxBarsInterval:u,indexOfTime:h}}}();t.exports=r}).call(e,i(78))},function(t,e,i){"use strict";function o(t,e,i){return a.isArray(t)?n(t,e,i):a.isObject(t)&&(a.isHashObject(t)||i&&i.visitInstances)?r(t,e,i):t}function n(t,e,i){return t.map(function(t){var n=o(t,e,i),r=e(n);return void 0!==r?r:n})}function r(t,e,i){var n={};return Object.keys(t).forEach(function(r){var s=o(t[r],e,i),a=e(s)
;n[r]=void 0!==a?a:s}),n}function s(t,e,i){var n=o(t,e,i),r=e(n);return void 0!==r?r:n}Object.defineProperty(e,"__esModule",{value:!0});var a=i(15);e.visitObject=s},function(t,e,i){"use strict";function o(t,e){return t.ticker+"_"+e}function n(t){return new Date(t).toISOString()}var r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),r=i(34),s=i(86),a=i(48),l=i(5),i(102),c=function(){function t(t,e,i,o){this._cache={bars:[]},this._nextSubscriptionId=0,this._pendingSubscribers=[],this._subscribers=[],this._requesting=!1,this._leftDate=null,this._gaps=[],this._needPurgeCache=!1,this._realtimeOn=!1,this._endOfData=!1,this._resetCacheTimeout=null,this._errorMessage=null,this._datafeed=t,this._symbolInfo=e,this._resolution=i,this._dwmAligner=o}return t.prototype.destroy=function(){0!==this._subscribers.length&&console.warn("Destroying with not-empty state"),this._clearResetCacheTimeout(),this._unsubscribeRealtime(),this._purgeCache(),delete this._datafeed},t.prototype.addSubscription=function(t,e,i){var o=this,n=this._getNextSubscriptionId(),r=Math.floor(t.from/1e3),s=Math.floor(t.to/1e3);return this._pendingSubscribers.push({key:n,range:{from:r,to:s},onHistoryCallback:e,onErrorCallback:i}),this._clearResetCacheTimeout(),setTimeout(function(){return o._processNextPendingSubscriber()},0),n},t.prototype.removeSubscription=function(t){var e,i=this,o=this._pendingSubscribers.find(function(e){return e.key===t});return o?void this._pendingSubscribers.splice(this._pendingSubscribers.indexOf(o),1):(e=this._subscribers.find(function(e){return e.key===t}))?(this._subscribers.splice(this._subscribers.indexOf(e),1),void(this._subscribers.length||(this._symbolInfo.expired||this._symbolInfo.expiration_date?this._unsubscribeRealtime():this._resetCacheTimeout=setTimeout(function(){i._purgeCacheDelayed(),i._unsubscribeRealtime()})))):void console.warn("Unknown subscription symbol={0}, resolution={1}, key={2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype._purgeCacheDelayed=function(){this._logMessage("Reset cache"),this._needPurgeCache=!0,this._clearResetCacheTimeout()},t.prototype._logMessage=function(t,e){(l.enabled("charting_library_debug_mode")||e)&&console.log("FEED [{0}|{1}]: {2}".format(this._symbolInfo.name,this._resolution,t))},t.prototype._clearResetCacheTimeout=function(){null!==this._resetCacheTimeout&&(clearTimeout(this._resetCacheTimeout),this._resetCacheTimeout=null)},t.prototype._purgeCache=function(){this._cache={bars:[]},this._gaps=[],this._errorMessage=null,this._needPurgeCache=!1,this._leftDate=null,this._endOfData=!1},t.prototype._processNextPendingSubscriber=function(){var t,e,i,o,s,a;if(this._pendingSubscribers.length&&!this._requesting){if(this._needPurgeCache&&this._purgeCache(),t=this._pendingSubscribers.pop(),this._logMessage("Processing bars request {0} from {1} to {2} ".format(t.key,n(1e3*t.range.from),n(1e3*t.range.to))),this._errorMessage)return this._logMessage("Return error:"+this._errorMessage),t.onErrorCallback(this._errorMessage),void this._processNextPendingSubscriber()
;if((!this._leftDate||t.range.from<this._leftDate)&&(e=new r.Interval(this._resolution),i=(e.inMilliseconds(Date.now())||0)/1e3,o=!this._leftDate,s=!o&&!!this._cache.bars.length&&this._cache.bars[0].time/1e3-t.range.from<i,(o||!s)&&!this._endOfData))return this._pendingSubscribers.push(t),void this._ensureRequestedTo(t.range.from);a=this._moveSubscriberToRealtime(t),this._returnHistoryDataToSubscriber(t,a),this._subscribeRealtimeIfNeeded(),this._processNextPendingSubscriber()}},t.prototype._moveSubscriberToRealtime=function(t){var e={key:t.key,onHistoryCallback:t.onHistoryCallback,barset:null};return this._subscribers.push(e),e},t.prototype._subscribeRealtimeIfNeeded=function(){!this._subscribers.length||this._realtimeOn||this._symbolInfo.expired||this._symbolInfo.expiration_date||this._subscribeRealtime()},t.prototype._subscribeRealtime=function(){var t,e,i=this;this._symbolInfo.expired||this._realtimeOn||(t=function(t){i._dwmAligner&&(t.time=i._dwmAligner.tradingDayToSessionStart(t.time)),i._putToCacheNewBar(t),i._subscribers.forEach(function(e){var i=e.barset;if(null===i)throw Error("subscirber.barset is null");i.add(t),e.onHistoryCallback(i)})},e=function(){i._unsubscribeRealtime();var t=i._leftDate;i._purgeCache(),t&&i._ensureRequestedTo(t)},this._realtimeOn=!0,this._datafeed.subscribeBars(this._symbolInfo,this._resolution,t,o(this._symbolInfo,this._resolution),e),this._logMessage("Subscribed to realtime"))},t.prototype._unsubscribeRealtime=function(){!this._symbolInfo.expired&&this._realtimeOn&&(this._datafeed.unsubscribeBars(o(this._symbolInfo,this._resolution)),this._logMessage("Unsubscribed from realtime"),this._realtimeOn=!1)},t.prototype._returnHistoryDataToSubscriber=function(t,e){var i,o,r=t.range,s=l.enabled("cl_feed_return_all_data")?this._createBarset(this._leftDate||r.from):this._createBarset(r.from);s.count()>0?this._logMessage("Bars to return for request {0}: total {1} bars in [{2} ... {3}] ".format(t.key,s.count(),n(s.bars[0].time),n(s.bars[s.count()-1].time))):this._logMessage("Request {0}. Nothing to return.".format(t.key)),e.barset=s,i=this._inGapNextTime(r.from),i?(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,n(1e3*i))),s.nextTime=i):0===s.count()&&(o=this._cache.bars.length&&this._cache.bars[this._cache.bars.length-1].time/1e3)&&r.from>o&&(this._logMessage("Request {0} is in gap, nextTime = {1}".format(t.key,n(1e3*o))),s.nextTime=o||void 0),this._endOfData&&null!==this._leftDate&&t.range.from<=this._leftDate&&(s.endOfData=!0),t.onHistoryCallback(s)},t.prototype._createBarset=function(t){var e=s.lowerbound(this._cache.bars,1e3*t,function(t,e){return t.time<e});return new a.BarSet(this._symbolInfo,this._cache.bars.slice(e))},t.prototype._ensureRequestedTo=function(e){var i,o,r,s=this;if(this._leftDate&&this._leftDate<e)return void this._processNextPendingSubscriber();i=!this._leftDate,this._requesting=!0,o=e,r=this._leftDate?this._leftDate-1:this._symbolInfo.expiration_date||Math.floor(t._now()/1e3),this._leftDate=e,
this._logMessage("Requesting data: [{0} ... {1}] ".format(n(1e3*o),n(1e3*r))),this._datafeed.getBars(this._symbolInfo,this._resolution,o,r,function(t,e){s._requesting=!1,s._processBars(t,e)},function(t){s._requesting=!1,s._errorMessage=t||null,s._processNextPendingSubscriber()},i)},t.prototype._processBars=function(t,e){this._checkBars(t),this._alignBarsTime(t),t.length>0?this._processFullBarset(t,e):this._processEmptyBarset(e),this._processNextPendingSubscriber()},t.prototype._processEmptyBarset=function(e){this._logMessage("Receiving bars: barset is empty"),e&&e.nextTime?(this._logMessage("Next time received: `{0}`".format(n(1e3*e.nextTime))),this._addGap(e.nextTime),this._leftDate=Math.min(this._leftDate||t._now()/1e3,e.nextTime+1)):e&&e.noData?(this._logMessage("EOD received"),this._endOfData=!0,this._cache.bars.length&&(this._leftDate=this._cache.bars[0].time/1e3)):this._logMessage("nextTime or noData should present in metainfo when empty barset is returned")},t.prototype._processFullBarset=function(t,e){var i=t[0].time,o=t[t.length-1].time;this._logMessage("Receiving bars: total {0} bars in [{1} ... {2}] ".format(t.length,n(i),n(o))),null!==this._leftDate&&i<1e3*this._leftDate&&!l.enabled("cl_feed_return_all_data")&&this._logMessage("Returned more data than needed"),this._putToCache(t)?null!==this._leftDate&&this._cache.bars.length&&this._leftDate>this._cache.bars[0].time/1e3&&(this._leftDate=this._cache.bars[0].time/1e3):this._logMessage("Incremental update failed. Starting full update. Returned data should be in the requested range.",!0),e&&e.nextTime?console.warn("nextTime should be set when there is no data in the requested period only"):e&&e.noData&&console.warn("noData should be set when there is no data in the requested period and earlier only")},t.prototype._addGap=function(e){var i;this._gaps.find(function(t){return t.from===e})||(i=(this._cache.bars.length?this._cache.bars[0].time:t._now())/1e3,this._gaps.push({from:e,to:i}))},t.prototype._inGapNextTime=function(t){var e=this._gaps.find(function(e){return e.from<t&&e.to>t});return e?e.from:null},t.prototype._getNextSubscriptionId=function(){return this._nextSubscriptionId++},t.prototype._checkBars=function(t,e){var i,o;if(void 0===e&&(e=!1),l.enabled("charting_library_debug_mode"))for(i=1;i<t.length;i++)t[i].time<=t[i-1].time&&(o="Wrong bars time: time {0} of bar {1} should be more than time {2} of bar {3}".format(t[i].time,i,t[i-1].time,i-1),e&&this._dwmAligner&&(o+="\nCheck that you provide DWM bars without time part, i.e. 00:00 GMT"),console.error(o))},t.prototype._putToCache=function(t){if(0===t.length)return!0;if(this._cache.bars.length===t.length&&this._cache.bars[0].time===t[0].time&&this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time)return this._logMessage("Time range of received data is the same as cached one. Skip the update."),!0;if(0!==this._cache.bars.length&&t[t.length-1].time===this._cache.bars[0].time&&this._cache.bars.splice(0,1),0!==this._cache.bars.length&&t[t.length-1].time>=this._cache.bars[0].time){
var e=this._cache.bars[this._cache.bars.length-1].time===t[t.length-1].time;if(this._cache.bars=[],!e)return this._leftDate=null,!1;this._logMessage("Received history up to now instead of incremental update. Return exactly what is requested.")}return this._cache.bars=t.concat(this._cache.bars),this._checkBars(this._cache.bars,!0),!0},t.prototype._putToCacheNewBar=function(t){var e=this._cache.bars.length,i=t.time,o=0===e?NaN:this._cache.bars[e-1].time;0===e||o<i?this._cache.bars.push(t):o===i?this._cache.bars[e-1]=t:console.error("putToCacheNewBar: time violation, previous bar time: "+n(o)+" should be less or equal to new time: "+n(i))},t.prototype._alignBarsTime=function(t){if(this._dwmAligner)for(var e=0;e<t.length;e++)t[e].time=this._dwmAligner.tradingDayToSessionStart(t[e].time)},t._now=function(){return Date.now()+6e4},t}(),h=function(){function t(t,e){this._threads={},this._datafeed=t,this._dwmAlignerCreator=e}return t.prototype.destroy=function(){this._forEachThread(function(t,e){return e.destroy()}),this._threads={},delete this._datafeed},t.prototype.purgeCache=function(){this._forEachThread(function(t,e){return e.destroy()}),this._threads={}},t.prototype.subscribe=function(t,e,i,n,r){var s,a=o(t,e);return this._threads[a]||(this._threads[a]=this._createThread(t,e)),s=this._threads[a].addSubscription(i,n,r),a+'"'+s},t.prototype.unsubscribe=function(t){var e,i,o=t.split('"');if(2!==o.length)return void console.warn("Wrong guid format");e=o[0],i=parseInt(o[1]),this._threads.hasOwnProperty(e)?this._threads[e].removeSubscription(i):console.warn("Data thread doesnt exist: "+t)},t.prototype._createThread=function(t,e){return new c(this._datafeed,t,e,this._dwmAlignerCreator(e,t.timezone,t.session))},t.prototype._forEachThread=function(t){var e=this;Object.keys(this._threads).forEach(function(i){return t(i,e._threads[i])})},t}(),e.DatafeedRequestsCachedProcessor=h},function(t,e,i){"use strict";(function(e,o){function n(t,i,o,n){this._chartWidgetCollection=t,this._chartSaverInstance=i,this._chartApiInstance=o,this._saveLoad=n,this._proxyWatchListChangedDelegate=null,this._lockDrawingsWatchedValue=null,this._activeChangedChangedDelegate=new e,this._chartWidgetCollection.activeChartWidget.subscribe(function(){this._activeChangedChangedDelegate.fire()}.bind(this)),this._chartWidgets=new WeakMap}var r=i(76),s=i(1011),a=i(216).layouts,l=i(23),c=i(108),h=i(202).closeAllDialogs,u=i(26),d=i(122),p=i(92),_=i(7),f=i(145).createNoticeDialog,m=i(112).createConfirmDialog,g=i(366),v=i(1017).ThemesApi;n.prototype.subscribe=function(t,e){l.subscribe(t,e)},n.prototype.unsubscribe=function(t,e){l.unsubscribe(t,e)},n.prototype.onContextMenu=function(t){l.subscribe("onContextMenu",function(e){e.callback(t(e.unixtime,e.price))})},n.prototype.onGrayedObjectClicked=function(t){l.subscribe("onGrayedObjectClicked",t)},n.prototype.activeChart=function(){return this._getChartWidgetApi(this._chartWidgetCollection.activeChartWidget.value())},n.prototype._getChartWidgetApi=function(t){var e=this._chartWidgets.get(t);return void 0===e&&(e=new s(t),
this._chartWidgets.set(t,e)),e},n.prototype.onActiveChartChanged=function(){return this._activeChangedChangedDelegate},n.prototype.changeSymbol=function(t,e,i){r.interval.setValue(e),r.symbol.setValue(t),i&&this.activeChart().onDataLoaded().subscribe(null,i,!0)},n.prototype.setLayout=function(t){this._chartWidgetCollection.layout.setValue(t)},n.prototype.layout=function(){return this._chartWidgetCollection.layout.value()},n.prototype.chartsCount=function(){return a[this.layout()].count},n.prototype.chart=function(t){if(void 0===t&&(t=0),t<0||t>this.chartsCount())throw Error("Incorrect index: "+t);return this._getChartWidgetApi(this._chartWidgetCollection.getAll()[t])},n.prototype.getSymbolInterval=function(t){var e={symbol:r.symbol.value(),interval:r.interval.value()};return t&&t(e),e},n.prototype.saveChart=function(t){var e=this;this._chartSaverInstance.whenReadyToSave(function(){var i=e._chartSaverInstance.saveToJSON();return t&&t(JSON.parse(i.content))})},n.prototype.loadChart=function(t){this._chartApiInstance.purgeCache(),this._chartApiInstance._studyEngine.stopSources(),this._chartWidgetCollection.loadContent(t.json),this._chartWidgetCollection.purgeUnusedWidgets(),t.extendedData&&(this._chartWidgetCollection.metaInfo.id.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.uid.setValue(t.extendedData.uid),this._chartWidgetCollection.metaInfo.name.setValue(t.extendedData.name)),r.symbol.setValue(this.activeChart().symbol()),l.emit("chart_loaded")},n.prototype.getStudiesList=function(){return this._chartApiInstance.allStudiesMetadata().filter(function(t){return!t.is_hidden_study}).map(function(t){return t.name||t.description})},n.prototype.getSavedCharts=function(t){p.getCharts(t)},n.prototype.loadChartFromServer=function(t){p.loadChart(t)},n.prototype.saveChartToServer=function(t,e,i,o){this._chartSaverInstance.saveChartSilently(t,i,e,o)},n.prototype.removeChartFromServer=function(t,e){p.removeChart(t,e)},n.prototype.getIntervals=function(){var t;return null!==this._chartApiInstance&&(t=Object.keys(this._chartApiInstance.defaultResolutions())),d.getIntervals(t)},n.prototype.closePopupsAndDialogs=function(){var t,e=document.querySelectorAll("._tv-dialog-title-close");for(t=0;t<e.length;t++)e[t].click();h(),c.hideAll()},n.prototype.selectLineTool=function(t){g.supportedLineTools[t]&&(t=g.supportedLineTools[t].name,u.tool.value()!==t&&u.tool.setValue(t))},n.prototype.selectedLineTool=function(){var t,e=Object.keys(g.supportedLineTools),i=u.tool.value();for(t=0;t<e.length;++t)if(g.supportedLineTools[e[t]].name===i)return e[t];return""},n.prototype.lockAllDrawingTools=function(){return null===this._lockDrawingsWatchedValue&&(this._lockDrawingsWatchedValue=new o(u.lockDrawings().value()),this._lockDrawingsWatchedValue.subscribe(function(t){u.lockDrawings().setValue(t)}),u.lockDrawings().subscribe(this,function(){this._lockDrawingsWatchedValue.setValue(u.lockDrawings().value())})),this._lockDrawingsWatchedValue},n.prototype.mainSeriesPriceFormatter=function(){
return this._chartWidgetCollection.activeChartWidget.value().model().mainSeries().priceScale().formatter()},n.prototype.showNoticeDialog=function(t){function e(){i&&(i(),i=null)}var i,o;t=t||{},i=t.callback,o=f({title:t.title,content:t.body||""}),o.on("action:ok",e),o.on("afterClose",e),o.open()},n.prototype.showConfirmDialog=function(t){function e(t){i&&(i(t),i=null)}var i,o;if(t=t||{},!t.callback)throw Error("callback must be exist");i=t.callback,o=m({title:t.title,content:t.body||""}),o.on("action:yes",e.bind(null,!0)),o.on("action:no",e.bind(null,!1)),o.on("afterClose",e.bind(null,!1)),o.open()},n.prototype.logs=function(){return{getLogHistory:_.getLogHistory,enable:_.loggingOn,disable:_.loggingOff}},n.prototype.showLoadChartDialog=function(){this._saveLoad&&this._saveLoad.signInOrLoadChart()},n.prototype.showSaveAsChartDialog=function(){this._saveLoad&&this._saveLoad.signInOrSaveAs()},n.prototype.themes=function(){return new v({chartWidgetCollection:this._chartWidgetCollection})},n.prototype.takeScreenshot=function(){this._chartWidgetCollection.takeScreenshot()},t.exports=n}).call(e,i(10),i(17))},function(t,e,i){"use strict";(function(e){function o(t){var e,i,o=Object.keys(g),n=o.length;for(e=0;e<n;++e)if(i=o[e],g[i].name===t)return i;return null}function n(t){return"LineToolRiskRewardLong"===t||"LineToolRiskRewardShort"===t}var r=i(9).ensureNotNull,s=i(1012),a=i(206).applyOverridesToStudy,l=i(33),c=i(1013).LineDataSourceApi,h=i(1014).StudyApi,u=i(1015).PaneApi,d=i(6).DefaultProperty,p=i(308).availableIcons,_=i(58),f=i(34).Interval,m=i(50),g=i(366).supportedLineTools,v=i(355).createTooManyStudiesNotice,y=function(t){this._chartWidget=t,this._panes=new WeakMap,this._studies=new WeakMap,this._lineDataSources=new WeakMap};y.prototype._getPaneApi=function(t){var e=this._panes.get(t);return void 0===e&&(e=new u(t),this._panes.set(t,e)),e},y.prototype._getStudyApi=function(t){var e=this._studies.get(t);return void 0===e&&(e=new h(t,this._chartWidget.model().model()),this._studies.set(t,e)),e},y.prototype._getLineDataSourceApi=function(t){var e=this._lineDataSources.get(t);return void 0===e&&(e=new c(t,this._chartWidget.model().model(),{apiPointsToDataSource:this._convertUserPointsToDataSource.bind(this),dataSourcePointsToPriced:function(t){var e=this._chartWidget.model().mainSeries().syncModel(),i=this._chartWidget.model().timeScale();return t.map(function(t){var o=i.normalizeBarIndex(t.index);return{price:t.price,time:e.projectTime(o.time_t,o.offset)}})}.bind(this)}),this._lineDataSources.set(t,e)),e},y.prototype._makeSubscriptionFromDelegate=function(t){var e=$.extend({},t);return delete e.fire,e},y.prototype.executeActionById=function(t){this._chartWidget.executeActionById(t)},y.prototype.getCheckableActionState=function(t){return this._chartWidget.getCheckableActionState(t)},y.prototype.refreshMarks=function(){this._chartWidget.refreshMarks()},y.prototype.clearMarks=function(){this._chartWidget.clearMarks()},y.prototype.symbol=function(){return this._chartWidget.getSymbol()},y.prototype.symbolExt=function(){
var t=this._chartWidget.model().mainSeries().symbolInfo();return t?{symbol:t.name,full_name:t.full_name,exchange:t.exchange,description:t.description,type:t.type}:null},y.prototype.resolution=function(){return this._chartWidget.model().mainSeries().properties().interval.value()},y.prototype.setSymbol=function(t,i){function o(){n._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,o),i&&i()}if(t!==this.symbol()||e.enabled("same_data_requery")){var n=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,o),this._chartWidget.setSymbol(t)}},y.prototype.resetData=function(){this._chartWidget.model().mainSeries().rerequestData()},y.prototype.setResolution=function(t,e){function i(){o._chartWidget.model().mainSeries().onDataLoaded().unsubscribe(null,i),e&&e()}if((t=t.toUpperCase())!==this.resolution()){var o=this;return this._chartWidget.model().mainSeries().onDataLoaded().subscribe(null,i),this._chartWidget.setResolution(t)}},y.prototype.setEntityVisibility=function(t,e){var i,o;console.warn("`setEntityVisibility` is deprecated. Use shape/study API instead"),(i=this._chartWidget.model().model().dataSourceForId(t))&&(o=i.properties())&&o.visible&&o.visible.setValue(e)},y.prototype.getAllStudies=function(){return this._chartWidget.model().model().allStudies().map(function(t){return{id:t.id(),name:t._metaInfo.description}})},y.prototype.getAllShapes=function(){return this._chartWidget.model().model().allLineTools().map(function(t){return{id:t.id(),name:o(t.toolname)}}).filter(function(t){return null!==t.name})},y.prototype.removeAllShapes=function(){this._chartWidget.removeAllDrawingTools()},y.prototype.removeAllStudies=function(){this._chartWidget.removeAllStudies()},y.prototype.removeEntity=function(t){var e=this._chartWidget.model().chartModel().dataSourceForId(t);if(!e)return void console.warn("Can't find a source with id: "+t);this._chartWidget.model().chartModel().removeSource(e,!0)},y.prototype.createStudyTemplate=function(t){return this._chartWidget.model().model().studyTemplate(t.saveInterval)},y.prototype.applyStudyTemplate=function(t){this._chartWidget.model().model().restoreStudyTemplate(t,""+1e3*Math.random())},y.prototype.setVisibleRange=function(t,i){var o,n,r,s;if(void 0===t||!t.from||!t.to||isNaN(t.from)||isNaN(t.to))return void console.warn("Wrong time range: "+JSON.stringify(t)+'. Expected an object with "from" and "to" numeric values.');o=this._chartWidget.model().model(),n=o.mainSeries(),r=[parseInt(t.from),parseInt(t.to)],s=f.isDWM(n.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(r):r,t.from=s[0],t.to=s[1],this._chartWidget.setVisibleTimeRange(t.from,t.to,i)},y.prototype.getVisibleRange=function(){var t,e=this._chartWidget.model().timeScale(),i=e.visibleBars();return null===i?{from:0,to:0}:(t={from:e.indexToUserTime(i.firstBar()<0?0:i.firstBar()),to:e.indexToUserTime(i.lastBar())},{from:(+t.from||0)/1e3,to:(+t.to||0)/1e3})},y.prototype.getVisiblePriceRange=function(){
return this._chartWidget.model().mainSeries()?this._chartWidget.model().mainSeries().priceScale().priceRangeInPrice():null},y.prototype._createTradingPrimitive=function(t,e){function i(){var t=TradingView.CLOSE_PLOT,e=r(o._chartWidget.model().mainSeries().bars().last());return{index:e.index,price:e.value[t]}}var o=this,n=this._chartWidget.model().model(),s=n.paneForSource(n.mainSeries());return(e?n:this._chartWidget.model()).createLineTool(s,i(),t)._adapter},y.prototype.createOrderLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolOrder",t.disableUndo)},y.prototype.createPositionLine=function(t){var t=t||{};return this._createTradingPrimitive("LineToolPosition",t.disableUndo)},y.prototype.createExecutionShape=function(t){var t=t||{};return this._createTradingPrimitive("LineToolExecution",t.disableUndo)},y.prototype.createShape=function(t,e){return this.createMultipointShape([t],e)},y.prototype._alignPoints=function(t){var e,i=this._chartWidget.model().model(),o=i.mainSeries(),n=o.symbolInfo(),r=m.get_timezone(n.timezone);return i.timeScale().isEmpty()?t:(e=(new _.Session).init(r,n.session),t.map(function(t){return t?_.alignExchangeTimeToSessionStartAndReturnUTC(e.timezone,e.spec,new Date(1e3*t))/1e3:t}))},y.prototype._convertUserPointsToDataSource=function(t){function i(t,e,i){var o,n,r,s=h.closestIndexLeft(t)||0,a={index:s},l=h.valueAt(s);return t>l&&(o=c.syncModel().distance(l,t),o.success&&(a.index=a.index+o.result)),e?a.price=e:(n=["open","high","low","close"],r=i?n.indexOf(i)+1:1,r<=0&&(r=1),a.price=u.valueAt(s)[r]),a}var o,n,r,s,a,l=this._chartWidget.model().model(),c=l.mainSeries(),h=l.timeScale().points(),u=c.data();if(l.timeScale().isEmpty())return null;for(o=t.map(function(t){return t.time}),n=f.isDWM(c.interval())&&!e.enabled("disable_resolution_rebuild")?this._alignPoints(o):o,r=[],s=0;s<t.length;s++)a=t[s],r.push(i(n[s],a.price,a.channel));return r},y.prototype.createMultipointShape=function(t,e,i){var o,r,s,a,l,c,h,u=e.disableUndo?this._chartWidget.model().model():this._chartWidget.model(),_=this._chartWidget.model().model(),f=_.mainSeries();if(!_.timeScale().isEmpty()){if(o=_.paneForSource(f),r=this._convertUserPointsToDataSource(t),s=g[e.shape]||g.flag,s.onlySelectable)throw Error('Cannot create "'+e.shape+'" shape');if("LineToolPolyline"===s.name)r[0].price===r[r.length-1].price&&r[0].index===r[r.length-1].index||r.push(r[0]);else if("LineToolIcon"===s.name){if(e.icon=e.icon||e.overrides&&e.overrides.icon,!e.hasOwnProperty("icon"))throw Error("icon must be specified in options");if(-1===p.indexOf(e.icon))throw Error("icon value must be valid");e.overrides=e.overrides||{},e.overrides.icon=e.icon}if(a=new d(s.name.toLowerCase()),e.overrides)for(l in e.overrides)a[l]?a[l].setValue(e.overrides[l]):n(s.name)&&-1!==["profitLevel","stopLevel"].indexOf(l)&&a.addProperty(l,e.overrides[l]);if(s.supportsText&&e.text&&a.text.setValue(e.text),c=u.createLineTool(o,r[0],s.name,a),
c.pointsCount()!==r.length&&-1!==c.pointsCount())throw Error("Wrong points count for "+e.shape+". Required "+c.pointsCount());for(h=1;h<r.length&&this._chartWidget.model().lineBeingCreated();h++)u.coninueCreatingLine(r[h],{},h<r.length-1);return e.lock&&c.setUserEditEnabled(!1),e.disableSelection&&(c.customization.disableSelection=!0),e.disableSave&&(c.customization.disableSave=!0),e.hasOwnProperty("showInObjectsTree")&&(c.customization.showInObjectsTree=e.showInObjectsTree),e.zOrder&&("top"===e.zOrder?u.bringToFront(c):"bottom"===e.zOrder&&u.sendToBack(c)),c.id()}},y.prototype.getShapeById=function(t){var e=this._chartWidget.model().model().getLineToolById(t);if(null===e)throw Error("There is no such shape");return this._getLineDataSourceApi(e)},y.prototype.createStudy=function(t,e,i,o,n,c,h){var u,d,p,_,f,m;return h=h||{},h.checkLimit&&!this._chartWidget.model().canCreateStudy()?(v().open(),null):(t=t.toLowerCase(),u=this._chartWidget.model().chartModel(),d=l.findStudyMetaInfoByDescription(u.studiesMetaData(),t),d=$.extend({},d),delete d.state,d?(p={},o&&(p.inputs=s.getStudyRecordFromArray([t].concat(o),this._chartWidget).inputs),_=u.insertStudy(d,p,e,null,h.priceScale),c&&a(_,c),f=r(u.paneForSource(_)),m=f.priceScaleName(_.priceScale()),u.setPriceScaleVisibility(m,!0),i&&_.setUserEditEnabled(!1),n&&n(_.id()),_.id()):(console.warn("Study `"+t+"` not found."),null))},y.prototype.getStudyById=function(t){var e=this._chartWidget.model().model().getStudyById(t);if(null===e)throw Error("There is no such study");return this._getStudyApi(e)},y.prototype.chartType=function(){return this._chartWidget.model().mainSeries().properties().style.value()},y.prototype.setChartType=function(t){this._chartWidget.model().mainSeries().properties().style.setValue(t)},y.prototype.priceFormatter=function(){return this._chartWidget.model().mainSeries().priceScale().formatter()},y.prototype.onDataLoaded=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onCompleted())},y.prototype.onSymbolChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onSymbolResolved())},y.prototype.onIntervalChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().mainSeries().onIntervalChanged())},y.prototype.onVisibleRangeChanged=function(){return this._makeSubscriptionFromDelegate(this._chartWidget.model().timeScale().visibleBarsChanged())},y.prototype.dataReady=function(t){var e=!this._chartWidget.model()||!this._chartWidget.model().mainSeries()||this._chartWidget.model().mainSeries().data().isEmpty();return t&&(e?this.onDataLoaded().subscribe(null,t,!0):t()),!e},y.prototype.crossHairMoved=function(t){this._makeSubscriptionFromDelegate(this._chartWidget.model().chartModel().crossHairMoved()).subscribe(null,t)},y.prototype.setTimezone=function(t){this._chartWidget.setTimezone(t)},y.prototype.getPanes=function(){return this._chartWidget.model().chartModel().panes().map(function(t){return this._getPaneApi(t)},this)},t.exports=y}).call(e,i(5))
},function(t,e,i){"use strict";var o=function(){function t(t){return t.is_price_study}function e(t,e){var i,o=e.slice(0).toLowerCase();if(t){for(i=0;i<t.length;++i)if(t[i].description.toLowerCase()===o||t[i].shortDescription.toLowerCase()===o)return t[i];throw Error("Can't find metainfo for `"+e+"`")}throw Error("There is no studies metainfo at all")}function i(t){return t.inputs.map(function(t){return{id:t.id,type:t.type,name:t.name}})}function o(o,n){var r,a,l,c,h,u,d,p,_;if(!Array.isArray(o))return r=e(n.model().studiesMetaData(),o),{id:r.id,overlay:t(r)};for(a=o.slice(0),l=a[0],r=e(n.model().studiesMetaData(),l),c=t(r),h=i(r),d=a.splice(1),p=0;p<d.length;++p)u||(u={}),_=s[h[p].type]||s.string,u[h[p].id]=_(d[p]);return{id:r.id,name:l,overlay:c,inputs:u}}function n(t,o,n){function r(t){return t.name.toLowerCase()===a}var s,a,l,c=e(n.model().studiesMetaData(),t),h=i(c),u={};for(s in o)a=s.toLowerCase(),l=h.filter(r),0!==l.length?(l=l[0],u[l.id]=o[s]):console.warn("Uknown input `"+s+"` of `"+t+"`");return{id:c.id,name:t,inputs:u}}var r={},s={bool:function(t){return!!t},integer:function(t){return parseInt(t)},float:function(t){return parseFloat(t)},string:function(t){return t}};return r.getStudyRecordFromArray=function(t,e){return e=e||chartWidget,o(t,e)},r.getStudyRecordFromObject=function(t,e,i){return i=i||chartWidget,n(t,e,i)},r}();t.exports=o},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(15),n=["alwaysShowStats","clonable","entryPrice","interval","lastUpdateTime","points","singleChartOnly","snapTo45Degrees","stopPrice","symbol","targetPrice"],r=function(){function t(t,e,i){this._source=t,this._model=e,this._pointsConverter=i}return t.prototype.isSelectionEnabled=function(){return this._source.isSelectionEnabled()},t.prototype.setSelectionEnabled=function(t){this._source.setSelectionEnabled(t)},t.prototype.isSavingEnabled=function(){return this._source.isSavedInChart()},t.prototype.setSavingEnabled=function(t){this._source.setSavingInChartEnabled(t)},t.prototype.isShowInObjectsTreeEnabled=function(){return this._source.showInObjectTree()},t.prototype.setShowInObjectsTreeEnabled=function(t){this._source.setShowInObjectsTreeEnabled(t)},t.prototype.isUserEditEnabled=function(){return this._source.userEditEnabled()},t.prototype.setUserEditEnabled=function(t){this._source.setUserEditEnabled(t)},t.prototype.bringToFront=function(){this._model.bringToFront(this._source)},t.prototype.sendToBack=function(){this._model.sendToBack(this._source)},t.prototype.getProperties=function(){return this._source.properties().state(n,!0)},t.prototype.setProperties=function(t){this._setProps(this._source.properties(),t,"")},t.prototype.getPoints=function(){return this._pointsConverter.dataSourcePointsToPriced(this._source.points())},t.prototype.setPoints=function(t){var e,i,o=this._source.pointsCount(),n=-1===o?this._source.points().length:o;if(n!==t.length)throw Error("Wrong points count. Required="+n);for(e=this._pointsConverter.apiPointsToDataSource(t),
i=0;i<e.length;++i)this._source.setPoint(i,e[i])},t.prototype._setProps=function(t,e,i){var n,r,s;for(n in e)e.hasOwnProperty(n)&&(r=0===i.length?n:i+"."+n,t.hasOwnProperty(n)?(s=e[n],o.isHashObject(s)?this._setProps(t[n],s,r):t[n].setValue(s)):console.warn('Unknown property "'+r+'"'))},t}(),e.LineDataSourceApi=r},function(t,e,i){"use strict";var o,n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(9),r=i(206),s=function(){function t(t,e){this._study=t,this._model=e}return t.prototype.isUserEditEnabled=function(){return this._study.userEditEnabled()},t.prototype.setUserEditEnabled=function(t){this._study.setUserEditEnabled(t)},t.prototype.getInputsInfo=function(){return this._study.metaInfo().inputs.map(function(t){return o.__assign({},t,{localizedName:void 0!==t.name?window.t(t.name,{context:"input"}):""})})},t.prototype.getInputValues=function(){var t=this._study.inputs();return Object.keys(t).map(function(e){return{id:e,value:t[e]}})},t.prototype.setInputValues=function(t){var e,i,o,n=this.getInputValues(),r=function(t){void 0!==n.find(function(e){return e.id===t.id})?s._study.properties().inputs[t.id].setValue(t.value):console.warn('There is no such input: "'+t.id+'"')},s=this;for(e=0,i=t;e<i.length;e++)o=i[e],r(o)},t.prototype.mergeUp=function(){this._model.mergeSourceUp(this._study),this._showStudyPriceScale()},t.prototype.mergeDown=function(){this._model.mergeSourceDown(this._study),this._showStudyPriceScale()},t.prototype.unmergeUp=function(){this._model.unmergeSourceUp(this._study),this._showStudyPriceScale()},t.prototype.unmergeDown=function(){this._model.unmergeSourceDown(this._study),this._showStudyPriceScale()},t.prototype.changePriceScale=function(t){var e,i,o,r=n.ensureNotNull(this._model.paneForSource(this._study)),s=null;switch(t){case"left":s=r.priceScaleByName("left");break;case"right":s=r.priceScaleByName("right");break;case"no-scale":s=r.priceScaleByName("");break;case"as-series":if(e=this._model.mainSeries(),(i=n.ensureNotNull(this._model.paneForSource(e)))!==r)return void console.warn('BEWARE: Attempt to change price scale to "as-series", but series and study are on different panes');o=i.priceScaleName(i.priceScaleForSource(e)),s=r.priceScaleByName(o);break;default:throw Error("Cannot change study's price scale to unknown price scale (\""+t+'")')}this._model.move(this._study,r,s),this._showStudyPriceScale()},t.prototype.isVisible=function(){return this._study.properties().visible.value()},t.prototype.setVisible=function(t){this._study.properties().visible.setValue(t)},t.prototype.bringToFront=function(){this._model.bringToFront(this._study)},t.prototype.sendToBack=function(){this._model.sendToBack(this._study)},t.prototype.applyOverrides=function(t){r.applyOverridesToStudy(this._study,t)},t.prototype._showStudyPriceScale=function(){var t=n.ensureNotNull(this._model.paneForSource(this._study)),e=t.priceScaleName(this._study.priceScale());this._model.setPriceScaleVisibility(e,!0)},t}(),e.StudyApi=s},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{
value:!0}),o=i(1016),n=function(){function t(t){this._priceScales=new WeakMap,this._pane=t}return t.prototype.hasMainSeries=function(){return this._pane.containsMainSeries()},t.prototype.getLeftPriceScale=function(){return this._getPriceScaleApi(this._pane.leftPriceScale())},t.prototype.getRightPriceScale=function(){return this._getPriceScaleApi(this._pane.rightPriceScale())},t.prototype.getMainSourcePriceScale=function(){var t,e=this._pane.mainDataSource();return null===e?null:(t=this._pane.priceScaleForSource(e),null===t?null:this._getPriceScaleApi(t))},t.prototype._getPriceScaleApi=function(t){var e=this._priceScales.get(t);return void 0===e&&(e=new o.PriceScaleApi(t),this._priceScales.set(t,e)),e},t}(),e.PaneApi=n},function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(){function t(t){this._priceScale=t}return t.prototype.getMode=function(){var t=this._priceScale.properties();return t.percentage.value()?2:t.log.value()?1:0},t.prototype.setMode=function(t){var e=this._priceScale.properties();e.percentage.setValue(2===t),e.log.setValue(1===t)},t}();e.PriceScaleApi=o},function(t,e,i){"use strict";var o,n;Object.defineProperty(e,"__esModule",{value:!0}),o=i(310),n=function(){function t(t){this._opts=t}return t.prototype.isStdTheme=function(){return o.isStdTheme(o.extractThemeFromModel(this._getActiveChartModel()))},t.prototype.setStdTheme=function(t){var e=this;return o.getStdTheme(t).then(function(i){e._opts.chartWidgetCollection.applyTheme(i.content),o.setTheme(t),o.syncTheme()})},t.prototype.setStdThemeForLayout=function(t){o.setTheme(t),o.syncTheme()},t.prototype.getCurrentThemeName=function(){return o.getCurrentTheme().name},t.prototype._getActiveChartModel=function(){return this._getActiveChartWidget().model()},t.prototype._getActiveChartWidget=function(){return this._opts.chartWidgetCollection.activeChartWidget.value()},t}(),e.ThemesApi=n},function(t,e,i){"use strict";var o,n,r,s=i(48);i(234),o=i(1019).pivotPointsStandardStudyItem,n=i(1020).spreadStudyItem,r=i(1021).ratioStudyItem,JSServer.studyLibrary=JSServer.studyLibrary.concat([{name:"Compare",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{compare:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#800080"}},precision:4,inputs:{source:"close",symbol:""}},plots:[{id:"compare",type:"line"}],styles:{compare:{title:"Plot",histogramBase:0}},description:"Compare",shortDescription:"Compare",is_price_study:!0,inputs:[{defval:"close",id:"source",name:"Source",options:["open","high","low","close","hl2","hlc3","ohlc4"],type:"text"},{id:"symbol",name:"Symbol",type:"symbol"}],id:"Compare@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(1),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(t,e){var i,o,n,r,a;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),o=this._context.new_var(this._context.symbol.time),
n=s.Std[e(0)](this._context),r=this._context.new_var(n),this._context.select_sym(0),a=r.adopt(o,i,0),[a]}}},{name:"Overlay",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!0,defaults:{styles:{},precision:4,inputs:{symbol:""}},plots:[{id:"open",type:"line"},{id:"high",type:"line"},{id:"low",type:"line"},{id:"close",type:"line"}],styles:{open:{title:"open"},high:{title:"high"},low:{title:"low"},close:{title:"close"}},description:"Overlay",shortDescription:"Overlay",is_price_study:!1,inputs:[{id:"symbol",name:"symbol",defval:"",type:"symbol",isHidden:!0}],id:"Overlay@tv-basicstudies-1"},constructor:function(){this.init=function(t,e){this._context=t,this._context.new_sym(e(0),s.Std.period(this._context),s.Std.period(this._context))},this.main=function(t,e){var i,o,n,r,a,l;return this._context=t,i=this._context.new_var(this._context.symbol.time),this._context.select_sym(1),o=this._context.new_var(this._context.symbol.time),n=this._context.new_var(s.Std.open(this._context)),r=this._context.new_var(s.Std.high(this._context)),a=this._context.new_var(s.Std.low(this._context)),l=this._context.new_var(s.Std.close(this._context)),this._context.select_sym(0),[n.adopt(o,i,1),r.adopt(o,i,1),a.adopt(o,i,1),l.adopt(o,i,1)]}}},{name:"Volume",metainfo:{_metainfoVersion:15,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,transparency:65,defaults:{styles:{vol:{linestyle:0,linewidth:1,plottype:5,trackPrice:!1,transparency:65,visible:!0,color:"#000080"},vol_ma:{linestyle:0,linewidth:1,plottype:4,trackPrice:!1,transparency:65,visible:!0,color:"#0496FF"}},precision:0,palettes:{volumePalette:{colors:{0:{color:"#eb4d5c",width:1,style:0},1:{color:"#53b987",width:1,style:0}}}},inputs:{showMA:!1,maLength:20}},plots:[{id:"vol",type:"line"},{id:"volumePalette",palette:"volumePalette",target:"vol",type:"colorer"},{id:"vol_ma",type:"line"}],styles:{vol:{title:"Volume",histogramBase:0},vol_ma:{title:"Volume MA",histogramBase:0}},description:"Volume",shortDescription:"Volume",is_price_study:!1,palettes:{volumePalette:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}}}},inputs:[{id:"showMA",name:"show MA",defval:!1,type:"bool"},{id:"maLength",name:"MA Length",defval:20,type:"integer",min:1,max:2e3}],id:"Volume@tv-basicstudies-1"},constructor:function(){this.f_0=function(t,e){return s.Std.gt(t,e)?0:1},this.f_1=function(t,e){return t?e:s.Std.na()},this.main=function(t,e){var i,o,n,r,a,l,c;return this._context=t,this._input=e,i=this._input(0),o=s.Std.volume(this._context),n=this.f_0(s.Std.open(this._context),s.Std.close(this._context)),r=s.Std.volume(this._context),a=this._context.new_var(r),l=s.Std.sma(a,this._input(1),this._context),c=this.f_1(i,l),[o,n,c]}}},{name:"ZigZag",metainfo:{_metainfoVersion:23,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:2,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#008000"}},precision:4,inputs:{in_0:5,in_1:10}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",target:"plot_0",type:"dataoffset"}],styles:{plot_0:{title:"Plot",
histogramBase:0,joinPoints:!1}},description:"Zig Zag",shortDescription:"ZigZag",is_price_study:!0,classId:"ScriptWithDataOffset",inputs:[{id:"in_0",name:"deviation",defval:5,type:"integer",min:1,max:100},{id:"in_1",name:"depth",defval:10,type:"integer",min:2,max:1e3}],id:"ZigZag@tv-basicstudies-1"},constructor:function(){this.main=function(t,e){var i,o,n,r,a,l,c,h;return this._context=t,this._input=e,i=this._input(0),o=this._input(1),n=i/100,r=o/2,a=s.Std.zigzag(n,r,this._context),l=s.Std.zigzagbars(n,r,this._context),c=a,h=l,[c,h]}}},{name:"Sessions",metainfo:{_metainfoVersion:44,defaults:{graphics:{vertlines:{sessBreaks:{color:"#4985e7",style:2,visible:!1,width:1}}},linkedToSeries:!0,precision:4},description:"Sessions",graphics:{vertlines:{sessBreaks:{name:"Session Break"}}},id:"Sessions@tv-basicstudies-1",inputs:[],is_hidden_study:!0,is_price_study:!0,name:"Sessions@tv-basicstudies",palettes:{},plots:[],shortDescription:"Sessions"},constructor:function(){function t(t,e){return{id:t,time:t,extendBottom:!0,extendTop:!0}}this.init=function(){this._times=[]},this._getVerticalLineData=function(e){return s.Std.selectSessionBreaks(e,this._times).map(t)},this.main=function(t,e){var i,o,n;return s.Std.isdwm(t)?null:(i=s.Std.time(t),isNaN(i)?null:(o=this._times.length,0!==o&&this._times[o-1]===i||this._times.push(i),t.symbol.isLastBar&&t.symbol.isNewBar?(n=this._getVerticalLineData(t),0===n.length?null:{nonseries:!0,type:"study_graphics",data:{graphicsCmds:{create:{vertlines:[{styleId:"sessBreaks",data:n}]},erase:[{action:"all"}]}}}):null))}}},{name:"SuperTrend",metainfo:{_metainfoVersion:39,isTVScript:!1,isTVScriptStub:!1,is_hidden_study:!1,defaults:{styles:{plot_0:{linestyle:0,linewidth:3,plottype:0,trackPrice:!1,transparency:35,visible:!0,color:"#000080"},plot_2:{linestyle:0,linewidth:3,plottype:"shape_arrow_up",trackPrice:!1,location:"BelowBar",transparency:35,visible:!0,color:"#00FF00"},plot_3:{linestyle:0,linewidth:3,plottype:"shape_arrow_down",trackPrice:!1,location:"AboveBar",transparency:35,visible:!0,color:"#FF0000"}},precision:4,palettes:{palette_0:{colors:{0:{color:"#008000",width:3,style:0},1:{color:"#800000",width:3,style:0}}}},inputs:{in_0:10,in_1:3}},plots:[{id:"plot_0",type:"line"},{id:"plot_1",palette:"palette_0",target:"plot_0",type:"colorer"},{id:"plot_2",type:"shapes"},{id:"plot_3",type:"shapes"}],styles:{plot_0:{title:"SuperTrend",histogramBase:0,joinPoints:!1,isHidden:!1},plot_2:{title:"Up Arrow",histogramBase:0,joinPoints:!1,isHidden:!1},plot_3:{title:"Down Arrow",histogramBase:0,joinPoints:!1,isHidden:!1}},description:"SuperTrend",shortDescription:"SuperTrend",is_price_study:!0,palettes:{palette_0:{colors:{0:{name:"Color 0"},1:{name:"Color 1"}},valToIndex:{0:0,1:1}}},inputs:[{id:"in_0",name:"Length",defval:10,type:"integer",min:1,max:100},{id:"in_1",name:"Factor",defval:3,type:"float",min:1,max:100}],id:"SuperTrend@tv-basicstudies-1",scriptIdPart:"",name:"SuperTrend",isCustomIndicator:!0},constructor:function(){this.f_0=function(){
var t,e,i,o,n,r=this._input(0),a=this._input(1),l=s.Std.atr(r,this._context);return r=s.Std.hl2(this._context)+l*a,l=s.Std.hl2(this._context)-l*a,t=this._context.new_var(s.Std.close(this._context)),a=this._context.new_var(),e=s.Std.max(l,a.get(1)),a.set(s.Std.gt(t.get(1),a.get(1))?e:l),l=this._context.new_var(),e=s.Std.min(r,l.get(1)),l.set(s.Std.lt(t.get(1),l.get(1))?e:r),r=this._context.new_var(),t=s.Std.nz(r.get(1),1),t=s.Std.lt(s.Std.close(this._context),a.get(1))?-1:t,r.set(s.Std.gt(s.Std.close(this._context),l.get(1))?1:t),a=s.Std.eq(r.get(0),1)?a.get(0):l.get(0),i=s.Std.eq(r.get(0),1)?0:1,o=1===r.get(0)&&-1===r.get(1),n=-1===r.get(0)&&1===r.get(1),[a,i,o,n]},this.main=function(t,e){this._context=t,this._input=e;var i=this.f_0();return[i[0],i[1],i[2],i[3]]}}},o,n,r])},function(t,e,i){"use strict";function o(t){switch(t){case"Traditional":return 0;case"Fibonacci":return 1;case"Woodie":return 2;case"Classic":return 3;case"DeMark":return 4;case"Camarilla":return 5;default:throw Error("Unknown kind "+t)}}function n(t,e){t.setUTCMonth(t.getUTCMonth()+e)}function r(t,e){return new Date(e,t,0).getDate()}function s(t,e){var i,o,s;return u.Std.ismonthly(t)?(i=new Date(e),o=i.getUTCDay(),s=r(i.getUTCMonth(),i.getUTCFullYear()),o<s?(n(i,u.Std.interval(t)),i=u.Std.add_days_considering_dst("Etc/UTC",i,1-i.getUTCDay())):(i=u.Std.add_days_considering_dst("Etc/UTC",i,1),n(i,u.Std.interval(t))),i.valueOf()):e+d.Interval.parse(t.symbol.resolution).inMilliseconds(e)}function a(t,e,i,o,n,r,s,a){var l,c=new p,h=NaN,d=i-o;switch(a){case 0:h=(i+o+n)/3,c.p=h,c.r1=2*h-o,c.s1=2*h-i,c.r2=h+(i-o),c.s2=h-(i-o),c.r3=2*h+(i-2*o),c.s3=2*h-(2*i-o),c.r4=3*h+(i-3*o),c.s4=3*h-(3*i-o),c.r5=4*h+(i-4*o),c.s5=4*h-(4*i-o);break;case 1:h=(i+o+n)/3,c.p=h,c.r1=h+.382*d,c.s1=h-.382*d,c.r2=h+.618*d,c.s2=h-.618*d,c.r3=h+d,c.s3=h-d;break;case 2:h=(i+o+2*t)/4,c.p=h,c.r1=2*h-o,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=i+2*(h-o),c.s3=o-2*(i-h),c.r4=c.r3+d,c.s4=c.s3-d;break;case 3:h=(i+o+n)/3,c.p=h,c.r1=2*h-o,c.s1=2*h-i,c.r2=h+d,c.s2=h-d,c.r3=h+2*d,c.s3=h-2*d,c.r4=h+3*d,c.s4=h-3*d;break;case 4:l=NaN,l=u.Std.equal(e,n)?i+o+2*n:u.Std.greater(n,e)?2*i+o+n:2*o+i+n,h=l/4,c.p=h,c.r1=l/2-o,c.s1=l/2-i;break;case 5:h=(i+o+n)/3,c.p=h,c.r1=n+1.1*d/12,c.s1=n-1.1*d/12,c.r2=n+1.1*d/6,c.s2=n-1.1*d/6,c.r3=n+1.1*d/4,c.s3=n-1.1*d/4,c.r4=n+1.1*d/2,c.s4=n-1.1*d/2;break;default:throw Error("Unknown kind")}return c.startIndex__t=r,c.endIndex__t=s,c}function l(t,e){return(!u.Std.isdaily(t)||"Daily"!==e)&&((!u.Std.isweekly(t)||"Daily"!==e&&"Weekly"!==e)&&(!u.Std.ismonthly(t)||"Daily"!==e&&"Weekly"!==e&&"Monthly"!==e))}function c(t){if(u.Std.isweekly(t)||u.Std.ismonthly(t))return"12M";if(u.Std.isdaily(t))return"1M";if(u.Std.isintraday(t)){var e=u.Std.interval(t);return e>=1&&e<=15?"1D":"1W"}throw Error("Unexpected resolution type: "+t.symbol.resolution)}function h(t,e){switch(e){case"Auto":return c(t);case"Daily":return"1D";case"Weekly":return"1W";case"Monthly":return"1M";case"Yearly":return"12M";default:throw Error("No such pivTimeFrame: "+e)}}var u,d,p,_,f
;Object.defineProperty(e,"__esModule",{value:!0}),u=i(48),d=i(34),p=function(){function t(){this.p=NaN,this.r1=NaN,this.s1=NaN,this.r2=NaN,this.s2=NaN,this.r3=NaN,this.s3=NaN,this.r4=NaN,this.s4=NaN,this.r5=NaN,this.s5=NaN,this.startIndex__t=NaN,this.endIndex__t=NaN}return t}(),_=function(){function t(){this.pivots=[]}return t}(),f=function(){function t(){this._secondaryRes="1D",this._firstMainSeriesBarTime=NaN}return t.prototype.init=function(t,e){var i,n=e(0),r=e(1),s=e(2),a=e(3);this._data=new _,this._firstMainSeriesBarTime=NaN,this._kindPP=o(n),this._showHistoricalPivots=r,this._historicalPivotsToKeep=a,this._pivTimeFrame=s,this._isValidResolution=l(t,this._pivTimeFrame),this._isValidResolution&&(this._secondaryRes=h(t,this._pivTimeFrame)),i=""===t.symbol.resolution?Math.max(30,2*parseInt(t.symbol.interval))+"":t.symbol.period,t.new_sym(t.symbol.tickerid,this._secondaryRes,this._secondaryRes,i)},t.prototype.main=function(t){var e,i,o,n,r,l,c,h,d,p,_,f,m,g,v;return this._isValidResolution?t.symbol.time?(isNaN(this._firstMainSeriesBarTime)&&(this._firstMainSeriesBarTime=t.symbol.time,this._removeUnusedPivots()),t.symbol.isLastBar&&t.symbol.isNewBar?this._createResponse():null):(t.select_sym(1),e=t.new_var(u.Std.open(t)),i=t.new_var(u.Std.high(t)),o=t.new_var(u.Std.low(t)),n=t.new_var(u.Std.close(t)),r=t.new_var(u.Std.time(t)),l=this._data,c=e.get(0),h=r.get(0),d=e.get(1),p=i.get(1),_=o.get(1),f=n.get(1),m=t.symbol.isLastBar,0!==l.pivots.length&&t.symbol.isNewBar&&(g=l.pivots[l.pivots.length-1],g.endIndex__t!==h&&(g.endIndex__t=h)),0!==t.symbol.index&&t.symbol.isNewBar?(v=a(c,d,p,_,f,h,s(t,h),this._kindPP),t.select_sym(0),this._showHistoricalPivots||(l.pivots=[]),l.pivots.push(v),l.pivots.length>this._historicalPivotsToKeep&&l.pivots.shift(),m?this._createResponse():null):(t.select_sym(0),null)):null},t.prototype._createResponse=function(){return 0===this._data.pivots.length?null:{nonseries:!0,type:"non_series_data",data:{data:this._data}}},t.prototype._removeUnusedPivots=function(){var t=this,e=Math.max(this._data.pivots.findIndex(function(e){return e.startIndex__t>t._firstMainSeriesBarTime})-1,0);e>0&&this._data.pivots.splice(0,e)},t}(),e.pivotPointsStandardStudyItem={name:"Pivot Points Standard",metainfo:{_metainfoVersion:44,defaults:{inputs:{kind:"Traditional",lookBack:15,pivTimeFrame:"Auto",showHistoricalPivots:!0},precision:"4"},description:"Pivot Points Standard",id:"PivotPointsStandard@tv-basicstudies-80",inputs:[{defval:"Traditional",id:"kind",name:"Type",options:["Traditional","Fibonacci","Woodie","Classic","DeMark","Camarilla"],type:"text"},{defval:!0,id:"showHistoricalPivots",name:"Show historical pivots",type:"bool"},{defval:"Auto",id:"pivTimeFrame",name:"Pivots Timeframe",options:["Auto","Daily","Weekly","Monthly","Yearly"],type:"text"},{defval:15,id:"lookBack",max:5e3,min:2,name:"Number of Pivots Back",type:"integer"}],is_price_study:!0,linkedToSeries:!0,shortDescription:"Pivots"},constructor:f}},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(367),
r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype._doCalculation=function(t,e,i,o){return t*e-i*o},e}(n.SpreadRatioBase),e.spreadStudyItem={name:"Spread",metainfo:{_metainfoVersion:15,defaults:n.spreadRatioDefaults,plots:n.spreadRatioPlots,styles:n.spreadRatioStyles,description:"Spread",shortDescription:"Spread",is_price_study:!1,inputs:n.spreadRatioInputs,id:"Spread@tv-basicstudies-1"},constructor:r}},function(t,e,i){"use strict";var o,n,r;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(367),r=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o.__extends(e,t),e.prototype._doCalculation=function(t,e,i,o){return t*e/(i*o)},e}(n.SpreadRatioBase),e.ratioStudyItem={name:"Ratio",metainfo:{_metainfoVersion:15,defaults:n.spreadRatioDefaults,plots:n.spreadRatioPlots,styles:n.spreadRatioStyles,description:"Ratio",shortDescription:"Ratio",is_price_study:!1,inputs:n.spreadRatioInputs,id:"Ratio@tv-basicstudies-1"},constructor:r}},function(t,e,i){"use strict";function o(){return{Bars:n.enabled("header_chart_type")?r.ToolWidgetChartStyles:void 0,Compare:n.enabled("header_compare")?s.ToolWidgetCompare:void 0,Custom:g.ToolWidgetCustom,Fullscreen:n.enabled("header_fullscreen_button")?a.ToolWidgetFullscreen:void 0,Indicators:n.enabled("header_indicators")?l.ToolWidgetIndicators:void 0,Intervals:n.enabled("header_resolutions")?c.ToolWidgetIntervals:void 0,OpenPopup:h.ToolWidgetOpenPopup,Properties:n.enabled("header_settings")&&n.enabled("show_chart_property_page")?u.ToolWidgetProperties:void 0,SaveLoad:n.enabled("header_saveload")?d.ToolWidgetSaveLoad:void 0,Screenshot:n.enabled("header_screenshot")?p.ToolWidgetScreenshot:void 0,SymbolSearch:n.enabled("header_symbol_search")?_.ToolWidgetSymbolSearch:void 0,Templates:n.enabled("study_templates")?f.ToolWidgetTemplates:void 0,UndoRedo:n.enabled("header_undo_redo")?m.ToolWidgetUndoRedo:void 0}}var n,r,s,a,l,c,h,u,d,p,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),n=i(5),r=i(1023),s=i(1029),a=i(1032),l=i(1035),c=i(1037),h=i(1046),u=i(1049),d=i(1051),p=i(1057),_=i(1060),f=i(1062),m=i(1071),g=i(1075),e.getRestrictedToolSet=o},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(27),s=i(49),a=i(348),l=i(153),c=i(59),h=i(70),u=i(235),d=i(109),p=i(369),_=i(1028),v={},v[s.STYLE_BARS]=window.t("Bars"),v[s.STYLE_CANDLES]=window.t("Candles"),v[s.STYLE_HOLLOW_CANDLES]=window.t("Hollow Candles"),v[s.STYLE_HEIKEN_ASHI]=window.t("Heikin Ashi"),v[s.STYLE_LINE]=window.t("Line"),v[s.STYLE_AREA]=window.t("Area"),v[s.STYLE_BASELINE]=window.t("Baseline"),f=v,m={barsStyle:window.t("Bar's Style"),labels:f},g=function(t){function e(e,i){var o,n,r,a,l=t.call(this,e,i)||this;return l._handleChangeStyle=function(t){var e=l.state,i=e.favorites,o=e.lastSelectedNotFavorite,n=e.activeStyle;l.setState({activeStyle:t,lastSelectedNotFavorite:i.includes(n)?o:n})},l._handleSelectStyle=function(t){var e=l.context.chartWidgetCollection
;t!==e.activeChartStyle.value()&&e.trySetChartStyleToActiveWidget(t)},l._handleClickFavorite=function(t){l._isStyleFavorited(t)?l._handleRemoveFavorite(t):l._handleAddFavorite(t)},o=i.chartWidgetCollection,n=i.favoriteChartStylesService,r=o.activeChartStyle.value(),a=n.get(),l.state={activeStyle:r,favorites:a,styles:[s.STYLE_BARS,s.STYLE_CANDLES,s.STYLE_HOLLOW_CANDLES,s.STYLE_HEIKEN_ASHI,s.STYLE_LINE,s.STYLE_AREA,s.STYLE_BASELINE]},l}return o.__extends(e,t),e.prototype.componentDidMount=function(){var t=this.context,e=t.chartWidgetCollection,i=t.favoriteChartStylesService;e.activeChartStyle.subscribe(this._handleChangeStyle),i.getOnChange().subscribe(this,this._handleChangeSettings)},e.prototype.componentWillUnmount=function(){var t=this.context,e=t.chartWidgetCollection,i=t.favoriteChartStylesService;e.activeChartStyle.unsubscribe(this._handleChangeStyle),i.getOnChange().unsubscribe(this,this._handleChangeSettings)},e.prototype.render=function(){var t,e,i=this,o=this.props,r=o.isShownQuicks,s=o.displayMode,l=void 0===s?"full":s,h=o.id,f=this.state,g=f.activeStyle,v=f.favorites,y=f.styles,b=f.lastSelectedNotFavorite,S="small"!==l&&r&&0!==v.length,w=v.slice();return w.includes(g)?void 0!==b&&w.push(b):w.push(g),t=S&&w.length>1,e=y.map(function(t){return i._renderPopupMenuItem(t,t===g)}),n.createElement(d.ToolWidgetRowWrap,{id:h},t&&w.map(function(t,e){return n.createElement(p.ToolWidgetQuickButton,{icon:a[t],isActive:S&&g===t,key:e,hint:m.labels[t],isFirst:0===e,isLast:e===w.length-1,onClick:S?i._handleSelectStyle:void 0,onClickArg:t})}),n.createElement(u.ToolWidgetMenu,{arrow:!!t,content:t?void 0:n.createElement(d.ToolWidgetRowWrap,null,n.createElement(c.Icon,{icon:a[g]})),title:t?m.barsStyle:m.labels[g],className:_.menu},e))},e.prototype._renderPopupMenuItem=function(t,e){var i=this.props.isFavoritingAllowed,o=this._isStyleFavorited(t);return n.createElement(h.PopupMenuItem,{key:t,icon:a[t],isActive:e,label:m.labels[t]||"",onClick:this._handleSelectStyle,onClickArg:t,showToolboxOnHover:!o,toolbox:i&&n.createElement(l.FavoriteButton,{isFilled:o,onClick:this._handleClickFavorite,onClickArg:t})})},e.prototype._handleChangeSettings=function(t){this.setState({lastSelectedNotFavorite:void 0,favorites:t})},e.prototype._isStyleFavorited=function(t){return-1!==this.state.favorites.indexOf(t)},e.prototype._handleAddFavorite=function(t){var e=this.state.favorites;this.context.favoriteChartStylesService.set(e.concat([t]))},e.prototype._handleRemoveFavorite=function(t){var e=this.state.favorites;this.context.favoriteChartStylesService.set(e.filter(function(e){return e!==t}))},e.contextTypes={chartWidgetCollection:r.object.isRequired,favoriteChartStylesService:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetChartStyles=g},function(t,e){t.exports={icon:"icon-16JOogW_-",dropped:"dropped-1WSGLaYJ-"}},function(t,e){t.exports={button:"button-13wlLwhJ-",hovered:"hovered-FUo4RNOC-",arrow:"arrow-2pXEy7ej-",arrowWrap:"arrowWrap-r5l5nQXU-",isOpened:"isOpened-1939ai3F-"}},function(t,e){t.exports={wrap:"wrap-18oKCBRc-"}},function(t,e){
t.exports={button:"button-1IIz2ju4-",first:"first-bfrNico9-",last:"last-3h-LFsOr-"}},function(t,e){t.exports={menu:"menu-16FRUKka-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(27),s=i(360),a=i(165),l=i(1031),c={compare:window.t("Compare"),compareOrAddSymbol:window.t("Compare or Add Symbol")},h=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o._handleClick=function(){var t=o.context.chartWidgetCollection,e=new s.AddCompareDialog(t),i=e.show();o.setState({isActive:!0}),i.on("afterOpen",function(){return o.setState({isActive:!0})}),i.on("beforeClose",function(){return o.setState({isActive:!1})})},o.state={isActive:!1},o}return o.__extends(e,t),e.prototype.render=function(){var t=this.state.isActive;return n.createElement(a.ToolWidgetCollapsibleButton,o.__assign({},this.props,{icon:l,isOpened:t,onClick:this._handleClick,text:c.compare,title:c.compareOrAddSymbol}))},e.contextTypes={chartWidgetCollection:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetCompare=h},function(t,e){t.exports={button:"button-YsN2vRuA-",withText:"withText-JhQdRoPu-",withoutText:"withoutText-f6SoijeW-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill="none" stroke="currentColor" transform="translate(2 4)"><path d="M16.5 14.5c0 1.657 0 4 3 4s3-2.343 3-4"/><path stroke-linejoin="round" d="M19.5 9.5l-3 5h6z"/><path d="M.5 14.5c0 1.657 0 4 3 4s3-2.343 3-4"/><path stroke-linejoin="round" d="M3.5 9.5l-3 5h6z"/><path d="M3.5 9.5h6m10 0h-6"/><circle cx="11.5" cy="9.5" r="2"/><path d="M11.5 4.5v3"/><rect width="2" height="4" rx="1" x="10.5" y=".5"/></g></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(27),s=i(14),a=i(236),l=i(1034),c={hint:window.t("Fullscreen mode")},h=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(){e.context.chartWidgetCollection.startFullscreen()},e}return o.__extends(e,t),e.prototype.render=function(){var t=this.props.className;return n.createElement(a.ToolWidgetIconButton,{icon:l,onClick:this._handleClick,title:c.hint,className:s(t)})},e.contextTypes={chartWidgetCollection:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetFullscreen=h},function(t,e){t.exports={button:"button-2-lC3gh4-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill="currentColor"><path d="M21 7v4h1V6h-5v1z"/><path d="M16.854 11.854l5-5-.708-.708-5 5zM7 7v4H6V6h5v1z"/><path d="M11.146 11.854l-5-5 .708-.708 5 5zM21 21v-4h1v5h-5v-1z"/><path d="M16.854 16.146l5 5-.708.708-5-5z"/><g><path d="M7 21v-4H6v5h5v-1z"/><path d="M11.146 16.146l-5 5 .708.708 5-5z"/></g></g></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(5),s=i(165),a=i(1036),l={text:window.t("Indicators"),
hint:r.enabled("study_dialog_fundamentals_economy_addons")?window.t("Indicators, Fundamentals, Economy and Add-ons"):window.t("Indicators")},c=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){var t=i.props.studyMarket;i.setState({isActive:!0},function(){t.isVisible()?t.hide():t.show()})},i.state={isActive:!1},i}return o.__extends(e,t),e.prototype.componentDidMount=function(){this.props.studyMarket.visibilityChanged.subscribe(this,this._setActiveState)},e.prototype.componentWillUnmount=function(){this.props.studyMarket.visibilityChanged.unsubscribe(this,this._setActiveState)},e.prototype.render=function(){var t=this.state.isActive,e=this.props,i=e.className,o=e.displayMode,r=e.id;return n.createElement(s.ToolWidgetCollapsibleButton,{id:r,displayMode:o,className:i,icon:a,isOpened:t,onClick:this._handleClick,text:l.text,title:l.hint})},e.prototype._setActiveState=function(t){this.setState({isActive:t})},e}(n.PureComponent),e.ToolWidgetIndicators=c},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M5.5 18.207l4.65-4.65a1.906 1.906 0 0 1 2.7 0l2.593 2.593a2.906 2.906 0 0 0 4.114 0l4.65-4.65-.707-.707-4.65 4.65a1.906 1.906 0 0 1-2.7 0l-2.593-2.593a2.906 2.906 0 0 0-4.114 0l-4.65 4.65.707.707z"/></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b,S,w,T;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(27),s=i(14),a=i(5),l=i(76),c=i(122),h=i(34),u=i(369),d=i(235),p=i(109),_=i(1038),f=i(152),m=i(1040),g=i(1042),v=i(9),y=i(1045),b={openDialog:window.t("Open Interval Dialog"),timeInterval:window.t("Time Interval")},S=function(t){var e,i={name:c.groupTranslations[h.Interval.SECONDS],items:[]},o={name:c.groupTranslations[h.Interval.MINUTES],items:[]},n={name:c.groupTranslations[h.Interval.HOURS],items:[]},r={name:c.groupTranslations[h.Interval.DAYS],items:[],mayOmitSeparator:!0},s={name:c.groupTranslations[h.Interval.WEEKS],items:[],mayOmitSeparator:!0},a={name:c.groupTranslations[h.Interval.MONTHS],items:[],mayOmitSeparator:!0};return t.forEach(function(t){var e=new h.Interval(t);e.kind()===h.Interval.HOURS?n.items.push(t):e.kind()===h.Interval.MINUTES?c.isHour(+e.multiplier())?n.items.push(t):o.items.push(t):e.kind()===h.Interval.SECONDS?i.items.push(t):e.kind()===h.Interval.DAYS?r.items.push(t):e.kind()===h.Interval.WEEKS?s.items.push(t):e.kind()===h.Interval.MONTHS&&a.items.push(t)}),e=[i,o,n,r,s,a],e.filter(function(t){return 0!==t.items.length})},w=function(t){var e=!1;return t.filter(function(t,i,o){var n=!0;return t.type===f.PopupMenuSeparator&&(0!==i&&i!==o.length-1||(n=!1),e&&(n=!1)),e=t.type===f.PopupMenuSeparator,n})},T=function(t){function e(e,i){var o,r,s,h,u,d,p,_=t.call(this,e,i)||this;return _._renderIntervalGroup=function(t){var e=t.items.map(function(t){return _._renderPopupMenuItem(t)});return(!t.mayOmitSeparator||t.items.length>1)&&(e.unshift(n.createElement(f.PopupMenuSeparator,{key:"begin-"+t.name})),e.push(n.createElement(f.PopupMenuSeparator,{
key:"end-"+t.name}))),e},_._handleChangeInterval=function(t){var e=_.state,i=e.activeInterval,o=e.lastNotQuicked,n=_._getQuicks();_.setState({activeInterval:c.normalizeIntervalString(t),lastNotQuicked:void 0===i||n.includes(i)?o:i})},_._handleCloseMenu=function(){_.setState({isOpenedFormMenu:!1})},_._handleOpenMenu=function(){_.setState({isOpenedFormMenu:!0})},_._bindedForceUpdate=function(){_.forceUpdate()},_._handleSelectInterval=function(t){t!==l.interval.value()&&l.interval.setValue(t)},_._handleClickFavorite=function(t){t=v.ensureDefined(t),_._isIntervalFavorite(t)?_._handleRemoveFavorite(t):_._handleAddFavorite(t)},_._handleAddFavorite=function(t){var e=_.state.favorites;_.context.favoriteIntervalsService.set(e.concat([t]))},_._handleRemoveFavorite=function(t){var e=_.state.favorites;_.context.favoriteIntervalsService.set(e.filter(function(e){return e!==t}))},_._handleAddInterval=function(t){},_._handleRemoveInterval=function(t){},o=i.chartApiInstance,r=i.favoriteIntervalsService,s=i.customIntervalsService,_._customIntervals=a.enabled("custom_resolutions_box"),h=l.interval.value(),u=h&&c.normalizeIntervalString(h),d=r.get(),p=void 0!==s?s.get():[],_._defaultsIntervals=Object.keys(o.defaultResolutions()).map(c.normalizeIntervalString),_.state={isOpenedFormMenu:!1,activeInterval:u,favorites:d,customs:p},_}return o.__extends(e,t),e.prototype.componentDidMount=function(){var t=this.context,e=t.favoriteIntervalsService,i=t.customIntervalsService;e.getOnChange().subscribe(this,this._handleChangeFavorites),void 0!==i&&i.getOnChange().subscribe(this,this._handleChangeCustoms),l.interval.subscribe(this._handleChangeInterval),l.intraday.subscribe(this._bindedForceUpdate),l.supportedResolutions.subscribe(this._bindedForceUpdate)},e.prototype.componentWillUnmount=function(){var t=this.context,e=t.favoriteIntervalsService,i=t.customIntervalsService;e.getOnChange().unsubscribe(this,this._handleChangeFavorites),i&&i.getOnChange().unsubscribe(this,this._handleChangeCustoms),l.interval.unsubscribe(this._handleChangeInterval),l.intraday.unsubscribe(this._bindedForceUpdate),l.supportedResolutions.unsubscribe(this._bindedForceUpdate)},e.prototype.componentDidUpdate=function(t,e){var i=this;this.state.lastAddedInterval&&setTimeout(function(){return i.setState({lastAddedInterval:void 0})},400)},e.prototype.render=function(){var t,e,i,o,r,a,l=this,h=this.props,f=h.isShownQuicks,m=h.id,g=this.state,v=g.activeInterval,S=g.customs,w=g.isOpenedFormMenu,T=g.lastNotQuicked,C=this._defaultsIntervals,x=this._getQuicks(),P=c.sortIntervals(x.slice());return void 0!==v&&P.includes(v)?void 0!==T&&P.push(T):void 0!==v&&P.push(v),t=!(!f||0===x.length)||void 0,e=t&&P.length>1,i={},o=c.sortIntervals(C.concat(S).filter(function(t,e,i){return i.indexOf(t)===e})),(void 0!==v?o.concat(v):o).filter(function(t){return c.isIntervalAvailable(t)}).forEach(function(t){return i[t]=!0}),r=this._createMenuItems(o).concat(this._createIntervalForm()),a=void 0!==v?c.getTranslatedModel(v):null,n.createElement(p.ToolWidgetRowWrap,{id:m},e&&P.map(function(t,e){
var o,r=c.getTranslatedModel(t);return n.createElement(u.ToolWidgetQuickButton,{key:e,className:s(y.button,(o={},o[y.first]=0===e,o[y.last]=e===P.length-1,o)),text:n.createElement(_.IntervalLabel,{value:r.mayOmitMultiplier?void 0:r.multiplier,metric:r.shortKind}),hint:r.hint,isActive:v===t,isDisabled:!i[t],onClick:l._handleSelectInterval,onClickArg:t})}),n.createElement(d.ToolWidgetMenu,{arrow:!!e,closeOnClickOutside:!w,content:e||null===a?void 0:n.createElement(p.ToolWidgetRowWrap,{className:y.menuContent},n.createElement(_.IntervalLabel,{value:a.mayOmitMultiplier?void 0:a.multiplier,metric:a.shortKind})),title:e||null===a?b.timeInterval:a.hint,className:y.menu},n.createElement("div",{className:y.dropdown},r)))},e.prototype._createMenuItems=function(t){var e,i=S(t).map(this._renderIntervalGroup),o=(e=[]).concat.apply(e,i);return w(o)},e.prototype._createIntervalForm=function(){return this._customIntervals?[n.createElement(f.PopupMenuSeparator,{key:"custom-interval-separator"}),n.createElement(m.ToolWidgetIntervalsAddForm,{key:"add-form",onAdd:this._handleAddInterval,onCloseMenu:this._handleCloseMenu,onOpenMenu:this._handleOpenMenu})]:[]},e.prototype._handleChangeFavorites=function(t){this.setState({lastNotQuicked:void 0,favorites:t})},e.prototype._handleChangeCustoms=function(t){this.setState({customs:t})},e.prototype._renderPopupMenuItem=function(t){var e=this.props.isFavoritingAllowed,i=this.state,o=i.activeInterval,r=i.lastAddedInterval,s=t===o,a=c.isIntervalAvailable(t),l=this._isIntervalFavorite(t),h=this._isIntervalDefault(t),u=c.getTranslatedModel(t);return n.createElement(g.IntervalMenuItem,{key:t,interval:t,hint:u.hint,isSignaling:r===t,isFavoritingAllowed:e,isDisabled:!a,isFavorite:l,isRemovable:!h,isActive:s,onClick:this._handleSelectInterval,onClickRemove:this._handleRemoveInterval,onClickFavorite:this._handleClickFavorite})},e.prototype._isIntervalDefault=function(t){return this._defaultsIntervals.includes(t)},e.prototype._isIntervalFavorite=function(t){return this.state.favorites.includes(t)},e.prototype._getQuicks=function(t){var e,i=this;return this.props.isShownQuicks&&"small"!==this.props.displayMode?(e=void 0===t?this.state.favorites:t,e.filter(function(t){return i._isIntervalDefault(t)})):[]},e.contextTypes={chartApiInstance:r.object.isRequired,favoriteIntervalsService:r.object.isRequired,customIntervalsService:r.object},e}(n.PureComponent),e.ToolWidgetIntervals=T},function(t,e,i){"use strict";function o(t){var e,i=t.metric.charAt(0),o=i.toUpperCase()===i;return n.createElement("div",{className:r(s.value,(e={},e[s.selected]=t.isSelected,e))},t.value,n.createElement("span",{className:r(s.metric,o&&s.capitalized)},t.metric))}var n,r,s;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(14),s=i(1039),e.IntervalLabel=o},function(t,e){t.exports={value:"value-DWZXOdoK-",selected:"selected-2V87KUXm-",metric:"metric-uxyW5qk0-",capitalized:"capitalized-OlFzHeUi-"}},function(t,e,i){"use strict";function o(t,e){return Math.max(1,Math.min(t,_[e]))}var n,r,s,a,l,c,h,u,d,p,_,f
;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),i(12),r=i(2),s=i(14),a=i(9),l=i(85),c=i(70),h=i(368),u=i(1041),d={add:window.t("Add")},p=[{name:"1",label:window.t("minutes",{context:"interval"})},{name:"60",label:window.t("hours",{context:"interval"})},{name:"D",label:window.t("days",{context:"interval"})},{name:"W",label:window.t("weeks",{context:"interval"})},{name:"M",label:window.t("months",{context:"interval"})}],_={1:1440,60:24,D:364,W:52,M:12},f=function(t){function e(e){var i=t.call(this,e)||this;return i._timeMenu=null,i._setMenuRef=function(t){i._timeMenu=t},i._handleChangeInput=function(t){var e=t.currentTarget.value;/^[0-9]*$/.test(e)&&i.setState({inputValue:e})},i._handleSelectTime=function(t){i.setState({selectedTime:t}),i._closeMenu()},i._handleClickAdd=function(){var t=i.state,e=t.inputValue,n=t.selectedTime,r=parseInt(e);r===o(r,n)&&i.props.onAdd(isNaN(parseInt(n))?r+""+n:r*+n+"")},i._toggleMenu=function(){i.state.isOpenedMenu?i._closeMenu():i._openMenu()},i._closeMenu=function(){i.props.onCloseMenu(),i.setState({isOpenedMenu:!1})},i._openMenu=function(){i.props.onOpenMenu(),i.setState({isOpenedMenu:!0})},i._getMenuPosition=function(){var t=a.ensureNotNull(i._timeMenu),e=t.getBoundingClientRect();return{overrideWidth:e.width,x:e.left,y:e.bottom+1}},i.state={inputValue:"1",isOpenedMenu:!1,selectedTime:p[0].name},i}return n.__extends(e,t),e.prototype.render=function(){var t,e=this,i=this.state,o=i.inputValue,n=i.isOpenedMenu,a=i.menuWidth,_=i.selectedTime;return r.createElement("div",{className:s(u.form,(t={},t[u.interacting]=n,t))},r.createElement("input",{className:u.input,maxLength:4,onChange:this._handleChangeInput,value:o}),r.createElement("div",{className:u.menu,onClick:this._toggleMenu,ref:this._setMenuRef},p.find(function(t){return t.name===_}).label,r.createElement(h.ToolWidgetCaret,{dropped:n})),r.createElement("div",{className:u.add,onClick:this._handleClickAdd},d.add),r.createElement(l.PopupMenu,{directionHorz:l.DirectionHorz.None,doNotCloseOn:this,isOpened:n,minWidth:a,onClose:this._closeMenu,position:this._getMenuPosition},p.map(function(t){return r.createElement(c.PopupMenuItem,{dontClosePopup:!0,key:t.name,label:t.label,onClick:e._handleSelectTime,onClickArg:t.name})})))},e}(r.PureComponent),e.ToolWidgetIntervalsAddForm=f},function(t,e){t.exports={form:"form-2itceCqS-",interacting:"interacting-3joY26dg-",input:"input-z46tLQgj-",menu:"menu-35lWsSKr-",add:"add-1NrfSAvb-",hovered:"hovered-1nwOcWv8-",wrap:"wrap-1oB2WI2R-"}},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(43),n=i(2),r=i(70),s=i(370),a=i(153),l=function(t){function e(e){var i=t.call(this,e)||this;return i._handleMouseEnter=function(){i.setState({isHovered:!0})},i._handleMouseLeave=function(){i.setState({isHovered:!1})},i.state={isHovered:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t=this.props,e=t.interval,i=t.hint,o=t.isActive,s=t.isDisabled,a=t.isFavorite,l=t.isSignaling,c=t.onClick;return n.createElement("div",{
onMouseEnter:this._handleMouseEnter,onMouseLeave:this._handleMouseLeave},n.createElement(r.PopupMenuItem,{isActive:o,isDisabled:s,isHovered:l,onClick:c,onClickArg:e,toolbox:this._toolbox(),showToolboxOnHover:!a,label:i}))},e.prototype._toolbox=function(){var t=this.props,e=t.interval,i=t.isDisabled,o=t.isFavorite,r=t.isRemovable,l=t.isFavoritingAllowed,c=t.onClickFavorite,h=t.onClickRemove,u=this.state.isHovered,d=n.createElement(s.RemoveButton,{key:"remove",hidden:!Modernizr.touch&&!u,onClick:h,onClickArg:e}),p=n.createElement(a.FavoriteButton,{key:"favorite",isFilled:o,onClick:c,onClickArg:e});return[r&&d,!i&&l&&p]},e}(n.PureComponent),e.IntervalMenuItem=l},function(t,e){t.exports={button:"button-1scLo53s-",hidden:"hidden-2GRQzIQ1-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 11 11" width="11" height="11"><path fill="none" stroke="currentColor" d="M1 1l9 9m0-9l-9 9"/></svg>'},function(t,e){t.exports={interval:"interval-1GDsfL5i-",showGroup:"showGroup-1N6m7h-N-",button:"button-1XkSWU32-",first:"first-2UbSFGzF-",last:"last-1rdUnwE6-",menu:"menu-1fA401bY-",dropdown:"dropdown-1zOBoqnG-",menuContent:"menuContent-1vyIDg3J-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(27),s=i(14),a=i(236),l=i(1047),c=i(1048),h={hint:window.t("Open chart in popup")},u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(){var t=e.context,i=t.chartWidgetCollection,o=t.windowMessageService,n=t.isFundamental,r=i.activeChartWidget.value();r.withModel(null,function(){o.post(parent,"openChartInPopup",{symbol:r.model().mainSeries().actualSymbol(),interval:r.model().mainSeries().interval(),fundamental:n})})},e}return o.__extends(e,t),e.prototype.render=function(){var t=this.props.className;return n.createElement(a.ToolWidgetIconButton,{className:s(t,l.button),icon:c,onClick:this._handleClick,title:h.hint})},e.contextTypes={isFundamental:r.bool,chartWidgetCollection:r.object.isRequired,windowMessageService:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetOpenPopup=u},function(t,e){t.exports={button:"button-3wAyKO3i-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 21" width="21" height="21"><g fill="none" stroke="currentColor"><path d="M18.5 11v5.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2v-13a2 2 0 0 1 2-2H9"/><path stroke-linecap="square" d="M18 2l-8.5 8.5m4-9h5v5"/></g></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(27),s=i(236),a=i(1050),l={hint:window.t("Chart Properties")},c=function(t){function e(e){var i=t.call(this,e)||this;return i._handleClick=function(){var t=i.context.chartWidgetCollection;i.setState({isActive:!0}),setTimeout(function(){return t.activeChartWidget.value().showChartProperties().then(i._resolveDialogState)},0)},i._resolveDialogState=function(t){null!==t?(i.setState({isActive:!0}),t.on("destroy",function(){return i.setState({isActive:!1})})):i.setState({
isActive:!1})},i.state={isActive:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t=this.state.isActive;return n.createElement(s.ToolWidgetIconButton,o.__assign({},this.props,{icon:a,title:l.hint,onClick:this._handleClick,isOpened:t}))},e.contextTypes={chartWidgetCollection:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetProperties=c},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><g fill="currentColor" fill-rule="evenodd"><path fill-rule="nonzero" d="M14 17a3 3 0 1 1 0-6 3 3 0 0 1 0 6zm0-1a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/><path d="M5.005 16A1.003 1.003 0 0 1 4 14.992v-1.984A.998.998 0 0 1 5 12h1.252a7.87 7.87 0 0 1 .853-2.06l-.919-.925c-.356-.397-.348-1 .03-1.379l1.42-1.42a1 1 0 0 1 1.416.007l.889.882A7.96 7.96 0 0 1 12 6.253V5c0-.514.46-1 1-1h2c.557 0 1 .44 1 1v1.253a7.96 7.96 0 0 1 2.06.852l.888-.882a1 1 0 0 1 1.416-.006l1.42 1.42a.999.999 0 0 1 .029 1.377s-.4.406-.918.926a7.87 7.87 0 0 1 .853 2.06H23c.557 0 1 .447 1 1.008v1.984A.998.998 0 0 1 23 16h-1.252a7.87 7.87 0 0 1-.853 2.06l.882.888a1 1 0 0 1 .006 1.416l-1.42 1.42a1 1 0 0 1-1.415-.007l-.889-.882a7.96 7.96 0 0 1-2.059.852v1.248c0 .56-.45 1.005-1.008 1.005h-1.984A1.004 1.004 0 0 1 12 22.995v-1.248a7.96 7.96 0 0 1-2.06-.852l-.888.882a1 1 0 0 1-1.416.006l-1.42-1.42a1 1 0 0 1 .007-1.415l.882-.888A7.87 7.87 0 0 1 6.252 16H5.005zm3.378-6.193l-.227.34A6.884 6.884 0 0 0 7.14 12.6l-.082.4H5.005C5.002 13 5 13.664 5 14.992c0 .005.686.008 2.058.008l.082.4c.18.883.52 1.71 1.016 2.453l.227.34-1.45 1.46c-.004.003.466.477 1.41 1.422l1.464-1.458.34.227a6.959 6.959 0 0 0 2.454 1.016l.399.083v2.052c0 .003.664.005 1.992.005.005 0 .008-.686.008-2.057l.399-.083a6.959 6.959 0 0 0 2.454-1.016l.34-.227 1.46 1.45c.003.004.477-.466 1.422-1.41l-1.458-1.464.227-.34A6.884 6.884 0 0 0 20.86 15.4l.082-.4h2.053c.003 0 .005-.664.005-1.992 0-.005-.686-.008-2.058-.008l-.082-.4a6.884 6.884 0 0 0-1.016-2.453l-.227-.34 1.376-1.384.081-.082-1.416-1.416-1.465 1.458-.34-.227a6.959 6.959 0 0 0-2.454-1.016L15 7.057V5c0-.003-.664-.003-1.992 0-.005 0-.008.686-.008 2.057l-.399.083a6.959 6.959 0 0 0-2.454 1.016l-.34.227-1.46-1.45c-.003-.004-.477.466-1.421 1.408l1.457 1.466z"/></g></svg>'},function(t,e,i){"use strict";function o(t,e){a.enabled("saveload_requires_authentication")?window.runOrSignIn(t,e):t()}var n,r,s,a,l,c,h,u;Object.defineProperty(e,"__esModule",{value:!0}),n=i(0),i(13),r=i(2),s=i(27),a=i(5),l=i(121),c=i(1052),h=6e4,u=function(e){function u(r,s){var a,l,c=e.call(this,r,s)||this;return c._syncState=function(t){c.setState(t)},c._onChangeHasChanges=function(t){c.setState({wasChanges:t}),t?c._restartAutosave():c._stopAutosave()},c._onChangeTitle=function(t){c.setState({title:t})},c._onChangeId=function(t){c.setState({id:t})},c._onChartAboutToBeSaved=function(){c.setState({isProcessing:!0})},c._onChartSaved=function(){c.setState({isProcessing:!1})},c._handleClickSave=function(){var t=c.state,e=t.wasChanges,i=t.isProcessing,n=t.isAuthenticated,r=t.id;n&&(i||!e&&r)||o(r?c._saveExistentChart:c._saveNewChart,{
source:"Save chart",sourceMeta:"Chart"})},c._handleClickClone=function(){c._cloneChart()},c._handleClickSaveAs=function(){o(c._cloneChart,{source:"Clone chart"})},c._handleClickLoad=function(){o(c._loadChart,{source:"Load chart",sourceMeta:"Chart"})},c._loadChart=function(){i.e(10).then(function(e){(function(t){new(i(1193).LoadChartService)(c.context.chartWidgetCollection).showLoadDialog()}).call(this,i(42)(t))}.bind(null,i)).catch(i.oe)},c._handleHotkey=function(t){return!t.ctrlKey&&(!(46!==t.which||!$(t.target).is("body"))&&(c._loadChart(),t.preventDefault(),t.stopPropagation(),!0))},c._handleClickRename=function(){o(c._renameChart,{source:"Rename chart"})},c._renameChart=function(){return n.__awaiter(c,void 0,void 0,function(){var t;return n.__generator(this,function(e){switch(e.label){case 0:return[4,this._createSaveService()];case 1:return t=e.sent(),t.tryRenameChart(),[2]}})})},c._cloneChart=function(){return n.__awaiter(c,void 0,void 0,function(){var t;return n.__generator(this,function(e){switch(e.label){case 0:return[4,this._createSaveService()];case 1:return t=e.sent(),t.tryCloneChart(),[2]}})})},c._saveExistentChart=function(){return n.__awaiter(c,void 0,void 0,function(){var t;return n.__generator(this,function(e){switch(e.label){case 0:return[4,this._createSaveService()];case 1:return t=e.sent(),t.trySaveExistentChart(),[2]}})})},c._saveNewChart=function(){return n.__awaiter(c,void 0,void 0,function(){var t;return n.__generator(this,function(e){switch(e.label){case 0:return[4,this._createSaveService()];case 1:return t=e.sent(),t.trySaveNewChart(),[2]}})})},a=s.chartWidgetCollection,l=s.chartChangesWatcher,c.state={isAuthenticated:window.is_authenticated,isProcessing:!1,id:a.metaInfo.id.value(),title:a.metaInfo.name.value(),wasChanges:l.hasChanges(),iconHovered:!1},c}return n.__extends(u,e),u.prototype.componentDidMount=function(){var t=this.props,e=t.chartSaver,i=t.isFake,o=t.stateSyncEmitter,n=this.context,r=n.chartWidgetCollection,s=n.chartChangesWatcher;i?o.on("change",this._syncState):(s.getOnChange().subscribe(this,this._onChangeHasChanges),r.metaInfo.name.subscribe(this._onChangeTitle),r.metaInfo.id.subscribe(this._onChangeId),l.registerListener("LoadChartDialogHotkey",this._handleHotkey),e.chartSaved().subscribe(this,this._onChartSaved),e.chartAboutToBeSaved().subscribe(this,this._onChartAboutToBeSaved),window.loginStateChange.subscribe(this,this._onLoginStateChange))},u.prototype.componentDidUpdate=function(t,e){this.props.isFake||e!==this.state&&this.props.stateSyncEmitter.emit("change",this.state)},u.prototype.componentWillUnmount=function(){var t=this.props,e=t.chartSaver,i=t.isFake,o=t.stateSyncEmitter,n=this.context,r=n.chartWidgetCollection,s=n.chartChangesWatcher;i?o.off("change",this._syncState):(s.getOnChange().unsubscribe(this,this._onChangeHasChanges),r.metaInfo.name.unsubscribe(this._onChangeTitle),r.metaInfo.id.unsubscribe(this._onChangeId),l.removeListener("LoadChartDialogHotkey"),e.chartSaved().unsubscribe(this,this._onChartSaved),
e.chartAboutToBeSaved().unsubscribe(this,this._onChartAboutToBeSaved),window.loginStateChange.unsubscribe(this,this._onLoginStateChange))},u.prototype.render=function(){var t=this.props,e=t.isReadOnly,i=t.displayMode,o=t.id,s=this.state,a=s.isProcessing,l=s.isAuthenticated,h=s.title,u=s.id,d=s.wasChanges,p={onCloneChart:this._handleClickClone,onSaveChart:this._handleClickSave,onRenameChart:this._handleClickRename,onSaveAsChart:this._handleClickSaveAs,onLoadChart:this._handleClickLoad};return r.createElement(c.ToolWidgetSaveLoadView,n.__assign({displayMode:i,isReadOnly:e,isAuthenticated:l,isProcessing:a,wasChanges:d,title:h,id:o,chartId:u},p))},u.prototype._onLoginStateChange=function(){this.setState({isAuthenticated:window.is_authenticated})},u.prototype._stopAutosave=function(){this._autosaveTimer&&(clearTimeout(this._autosaveTimer),this._autosaveTimer=0)},u.prototype._restartAutosave=function(){var t,e=this;a.enabled("charts_auto_save")&&(this._stopAutosave(),t=this.context.chartWidgetCollection,this._autosaveTimer=setTimeout(function(){t.metaInfo.id.value()&&e._saveExistentChart()},h))},u.prototype._createSaveService=function(){var e=this;return new Promise(function(o){i.e(13).then(function(n){(function(t){var t=i(1194);o(new t.SaveAsService(e.context.chartWidgetCollection,e.props.chartSaver))}).call(this,i(42)(t))}.bind(null,i)).catch(i.oe)})},u.contextTypes={chartWidgetCollection:s.object.isRequired,chartChangesWatcher:s.object.isRequired},u}(r.PureComponent),e.ToolWidgetSaveLoad=u},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v,y,b;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),r=i(14),s=i(70),a=i(152),l=i(109),c=i(235),h=i(165),u=i(1053),d=i(1055),p=i(149),_=i(1056),f=i(237),m=f.weakComposeClasses(p,_),g=o.__assign({},p,m),v={copy:window.t("Copy"),makeCopy:window.t("Make a Copy"),newChartLayout:window.t("New Chart Layout"),loadChartLayout:window.t("Load Chart Layout..."),rename:window.t("Rename..."),renameChartLayout:window.t("Rename Chart Layout"),saveAs:window.t("Make a Copy..."),saveChartLayout:window.t("Save"),saveChartLayoutLong:window.t("Save Chart Layout saves not just some particular chart, it saves all charts for all symbols and intervals which you are modifying while working with this Layout")},y=[],b=function(t){function e(e){var i=t.call(this,e)||this;return i._handleSaveHoverBegin=function(){i.setState({iconHovered:!0})},i._handleSaveHoverEnd=function(){i.setState({iconHovered:!1})},i.state={iconHovered:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t=this.props,e=t.id,i=t.isReadOnly,o=t.displayMode,s=t.isProcessing,a=t.title,p=t.chartId,_=t.wasChanges,f=t.onCloneChart,m=t.onSaveChart,b=t.hideMenu,S=this.state.iconHovered,w=!i&&!b,T="saved";return!_&&a||(T="unsaved"),s&&(T="saving"),n.createElement(l.ToolWidgetRowWrap,null,i?n.createElement(l.ToolWidgetRowWrap,null,n.createElement(h.ToolWidgetCollapsibleButton,{id:e,displayMode:o,icon:n.createElement(u.CloudSpinner,{size:28,state:"unsaved",isHovered:S}),isDisabled:s,onClick:f,text:v.copy,
title:v.makeCopy,onMouseEnter:this._handleSaveHoverBegin,onMouseLeave:this._handleSaveHoverEnd,collapseWhen:y})):n.createElement(l.ToolWidgetRowWrap,null,n.createElement(h.ToolWidgetCollapsibleButton,{id:e,displayMode:o,icon:n.createElement(u.CloudSpinner,{size:28,state:T,isHovered:S}),isDisabled:p&&!_||s,onClick:m,text:a||v.saveChartLayout,title:v.saveChartLayoutLong,onMouseEnter:this._handleSaveHoverBegin,onMouseLeave:this._handleSaveHoverEnd,theme:g,collapseWhen:y}),w&&n.createElement(c.ToolWidgetMenu,{className:r(d.menu,"js-save-load-menu-open-button"),arrow:!0},this._renderMenuItems())))},e.prototype._renderMenuItems=function(){var t=this.props,e=t.wasChanges,i=t.isProcessing,o=t.chartId,r=t.onSaveChart,l=t.onRenameChart,c=t.onSaveAsChart,h=t.onLoadChart,u=[n.createElement(s.PopupMenuItem,{key:"save",isDisabled:!!(i||!e&&o),label:v.saveChartLayout,onClick:r})];return o&&u.push.apply(u,[n.createElement(a.PopupMenuSeparator,{key:"existing-chart-section-begin"}),n.createElement(s.PopupMenuItem,{key:"rename",label:v.rename,onClick:l}),n.createElement(s.PopupMenuItem,{key:"save-as",label:v.saveAs,onClick:c})]),u.push.apply(u,[n.createElement(a.PopupMenuSeparator,{key:"platform-section-begin"}),n.createElement(s.PopupMenuItem,{key:"load-chart",className:"js-save-load-menu-item-load-chart",label:v.loadChartLayout,onClick:h})]),u},e}(n.PureComponent),e.ToolWidgetSaveLoadView=b},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(150),s=i(31),a=i(14),l=i(1054),c="M21.5 21.5h-14a5 5 0 1 1 .42-9.983 7.5 7.5 0 0 1 14.57 2.106 4.002 4.002 0 0 1-.99 7.877z",h=62.332908630371094,u=.8*h,d=.21*h,p=.79*h,_={strokeDashOffset:p,strokeDash:u,strokeGap:d,strokeDashCheck:0},f={strokeDashOffset:d+u,strokeGap:0,strokeDash:u+d,strokeDashCheck:200},m=function(t){function e(e){var i=t.call(this,e)||this;return i.state=_,i}return o.__extends(e,t),e.prototype.componentDidMount=function(){"saved"===this.props.state?this.setState(f):this._goToNextState(this.props.state)},e.prototype.componentWillReceiveProps=function(t){this.props.state!==t.state&&this._goToNextState(t.state)},e.prototype.render=function(){var t,e=this.state,i=e.strokeDashOffset,o=e.strokeDash,r=e.strokeGap,s=e.strokeDashCheck,h=this.props,u=h.className,d=h.size,p=h.onClick,_=h.state,f=h.isHovered,m=void 0!==f&&f,g=a(l.container,u,m&&l.hovered,(t={},t[l.unsaved]="unsaved"===_,t[l.saving]="saving"===_,t[l.saved]="saved"===_,t));return n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",className:g,version:"1.1",width:d,height:d,viewBox:"0 0 28 28",onClick:p},n.createElement("g",{fill:"none"},n.createElement("path",{className:l.dottedCloud,stroke:"currentColor",strokeDasharray:"3.5,2.5",d:c}),n.createElement("path",{className:l.spinningCloud,stroke:"currentColor",strokeDasharray:o+" "+r,strokeDashoffset:i,d:c}),n.createElement("path",{className:l.arrowGap,d:"M11 20h6v5h-6z"}),n.createElement("g",{className:l.arrow,stroke:"currentColor"},n.createElement("path",{strokeLinecap:"square",
d:"M14.5 14.5v10"}),n.createElement("path",{d:"M11 17l3.5-3.5L18 17"})),n.createElement("g",{className:l.check,stroke:"currentColor"},n.createElement("path",{strokeDasharray:s+"% "+(200-s)+"%",d:"M10 15l2.5 2.5L18 12"}))))},e.prototype._goToNextState=function(t){var e=this;switch(t){case"unsaved":this.setState(_);break;case"saving":"unsaved"!==this.props.state&&this.setState(_),this._currentAnimation=Promise.resolve(this._currentAnimation).then(function(){return e._createSpinAnimationWhile(function(){return"saving"===e.props.state})});break;case"saved":this._currentAnimation=Promise.resolve(this._currentAnimation).then(this._createFillGapAnimation.bind(this)).then(this._createCheckAnimation.bind(this))}},e.prototype._createSpinAnimationWhile=function(t){var e=this;return this._createSpinAnimation().then(function(){return t()?e._createSpinAnimationWhile(t):Promise.resolve()})},e.prototype._createSpinAnimation=function(){var t=this;return new Promise(function(e){r.doAnimate({onStep:function(e,i){t.setState({strokeDashOffset:i})},onComplete:function(){return e()},from:p,to:p+h,easing:s.easingFunc.linear,duration:1e3})})},e.prototype._createCheckAnimation=function(){var t=this;return new Promise(function(e){r.doAnimate({onStep:function(e,i){t.setState({strokeDashCheck:Math.round(i)})},onComplete:function(){return e()},from:0,to:200,easing:s.easingFunc.linear,duration:1e3})})},e.prototype._createFillGapAnimation=function(){var t=this;return new Promise(function(e){r.doAnimate({onStep:function(e,i){t.setState({strokeDashOffset:d+u-i,strokeGap:i,strokeDash:u+d-i})},onComplete:function(){return e()},from:d,to:0,easing:s.easingFunc.linear,duration:200})})},e}(n.PureComponent),e.CloudSpinner=m},function(t,e){t.exports={dottedCloud:"dottedCloud-1Vw3lVny-",check:"check-3V48_rMp-",spinningCloud:"spinningCloud-2fkbB-rw-",arrow:"arrow-1zkKEROH-",arrowGap:"arrowGap-gjAe6jEn-",container:"container-riYIb01a-",unsaved:"unsaved-2Kg_w3Vw-",hovered:"hovered-18DzoW0E-",saving:"saving-31YVVfHU-",saved:"saved-2kLd4nmd-"}},function(t,e){t.exports={menu:"menu-92vrwS4x-",opened:"opened-GQFVkrpV-"}},function(t,e){t.exports={button:"button-1EU5-JL7-",isDisabled:"isDisabled-1RjJSnJ7-",text:"text-1HWeUAzA-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(27),s=i(14),a=i(5),l=i(23),c=i(103),h=i(149),u=i(1058),d=i(1059),p=i(237),_=p.weakComposeClasses(h,u),f=o.__assign({},h,_),m={takeSnapshot:window.t("Take instant snapshot of your chart. No more Paint or other editors to save screenshots – simply click the button and copy the link of the picture.")},g=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o._handleClick=function(){if(!a.enabled("show_dialog_on_snapshot_ready")){if(o.state.isProcessing)return;o.setState({isProcessing:!0}),l.subscribe("onScreenshotReady",function(){return o.setState({isProcessing:!1})},null,!0)}o.context.chartWidgetCollection.takeScreenshot()},o.state={isProcessing:!1},o}return o.__extends(e,t),e.prototype.render=function(){
var t=this.props,e=t.className,i=t.color;return n.createElement(c.ToolWidgetButton,{icon:d,isDisabled:this.state.isProcessing,onClick:this._handleClick,title:m.takeSnapshot,theme:f,className:s(e,i&&f[i])})},e.contextTypes={chartWidgetCollection:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetScreenshot=g},function(t,e){t.exports={button:"button-3zsRYmii-",blue:"blue-pwiZpV6t-",green:"green-3Nv9iVIZ-",isInteractive:"isInteractive-12fBlRGf-",hovered:"hovered-Kk1N76Nt-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 21 17" width="21" height="17"><g fill="none" stroke="currentColor"><path d="M2.5 2.5h3.691a.5.5 0 0 0 .447-.276l.586-1.171A1 1 0 0 1 8.118.5h4.764a1 1 0 0 1 .894.553l.586 1.17a.5.5 0 0 0 .447.277H18.5a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-16a2 2 0 0 1-2-2v-10a2 2 0 0 1 2-2z"/><circle cx="10.5" cy="9.5" r="4"/></g></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(14),s=i(71),a=i(9),l=i(1061),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._actions=null,e._input=null,e._preventDefault=function(t){t.preventDefault()},e}return o.__extends(e,t),e.prototype.componentDidMount=function(){var t=a.ensureNotNull(this._input);s.bindToInput(t,{spreadActions:this._actions||void 0,syncWithChartWidget:!0,syncOnBlur:!0}),null!==this._actions&&Array.from(this._actions.querySelectorAll("button")).forEach(function(t){return t.tabIndex=-1})},e.prototype.render=function(){var t,e=this,i=this.props,o=i.isActionsVisible,a=i.isExpanded,c=i.onFocus,h=i.onBlur,u=i.id;return n.createElement("div",{id:u,className:l.wrap},n.createElement("div",{className:r(l.inner,(t={},t[l.isExpanded]=a,t))},n.createElement("input",{className:l.input,maxLength:1e3,onBlur:h,onFocus:c,ref:function(t){return e._input=t},type:"text",tabIndex:-1}),s.canShowSpreadActions()&&o&&n.createElement("div",{className:l.actions,onMouseDown:this._preventDefault,ref:function(t){return e._actions=t}})))},e}(n.PureComponent),e.ToolWidgetSymbolSearch=c},function(t,e){t.exports={wrap:"wrap-CUt4Mg1V-",inner:"inner-32OP7ejC-",actions:"actions-1cGPn1dW-",input:"input-3lfOzLDc-",isExpanded:"isExpanded-1pdStI5Z-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(27),s=i(39),a=i(14),l=i(85),c=i(152),h=i(1063),u=i(1066),d=i(1067),p=i(109),_=i(165),f=i(1069),m=i(1070),g={title:window.t("Templates"),tooltip:window.t("Study Templates")},v=function(t){function e(e,i){var o,n,r,a,l=t.call(this,e)||this;return l._handleFavorTemplate=function(t){if(l.props.isShownQuicks){var e=t.name;l._isTemplateFavorite(e)?l._removeFavoriteTemplate(e):l._addFavoriteTemplate(e)}},l._handleSaveTemplate=function(){l.context.studyTemplates.showSaveAsDialog()},l._handleApplyTemplate=function(t){l._handleClose(),l.context.studyTemplates.applyTemplate(t.name)},l._handleRemoveTemplate=function(t){l._handleClose(),l.context.studyTemplates.deleteStudyTemplate(t.name)},
l._handleClose=function(){l._handleToggleDropdown(!1)},l._handleClick=function(t){t.stopPropagation(),l._handleToggleDropdown()},l._handleToggleDropdown=function(t){var e=l.state.isActive,i="boolean"==typeof t?t:!e;l.setState({isActive:i})},l._getDropdownPosition=function(){var t=s.findDOMNode(l._wrapControl).getBoundingClientRect();return{x:t.left,y:t.bottom+2}},l._getWrapRef=function(t){return l._wrapControl=t},l._syncStateChange=function(t){l.setState(t)},o=i.favoriteStudyTemplatesService,n=i.studyTemplates,r=void 0!==o?o.get():[],a=n.list(),l.state={isActive:!1,studyTemplatesList:a,favorites:r},l}return o.__extends(e,t),e.prototype.componentDidMount=function(){if(this.props.isFake)this.props.stateSyncEmitter.on("change",this._syncStateChange);else{var t=this.context,e=t.favoriteStudyTemplatesService,i=t.studyTemplates;i.getOnChange().subscribe(this,this._handleTemplatesChange),i.refreshStudyTemplateList(),void 0!==e&&e.getOnChange().subscribe(this,this._handleFavoritesChange)}},e.prototype.componentWillUnmount=function(){if(this.props.isFake)this.props.stateSyncEmitter.off("change",this._syncStateChange);else{var t=this.context,e=t.favoriteStudyTemplatesService;t.studyTemplates.getOnChange().unsubscribe(this,this._handleTemplatesChange),void 0!==e&&e.getOnChange().unsubscribe(this,this._handleFavoritesChange)}},e.prototype.componentDidUpdate=function(t,e){this.props.isFake||e===this.state||this.props.stateSyncEmitter.emit("change",{favorites:this.state.favorites,studyTemplatesList:this.state.studyTemplatesList})},e.prototype.render=function(){var t,e=this.state,i=e.isActive,o=e.studyTemplatesList,r=e.favorites,s=this.props,u=s.isShownQuicks,d=s.className,v=s.displayMode,y=s.id,b=o.filter(function(t){return r.includes(t.name)}),S="small"!==v&&u&&b.length>0,w=a(d,m.wrap,i&&m.opened,(t={},t[m.full]="full"===v,t[m.medium]="medium"===v,t));return n.createElement(p.ToolWidgetRowWrap,{id:y,className:w,onClick:this._handleClick,ref:this._getWrapRef},n.createElement(_.ToolWidgetCollapsibleButton,{displayMode:v,icon:f,text:g.title,title:g.tooltip,onClick:this._handleClick}),S&&this._renderQuicks(b),n.createElement(l.PopupMenu,{closeOnClickOutside:!0,doNotCloseOn:this,isOpened:i,onClose:this._handleClose,position:this._getDropdownPosition},n.createElement(h.SaveIndicatorMenuItem,{onClick:this._handleSaveTemplate}),o.length>0&&n.createElement(c.PopupMenuSeparator,null),this._renderMenuItems()))},e.prototype._renderQuicks=function(t){var e=this;return t.map(function(t,i,o){return n.createElement(d.FavoriteStudyTemplateItem,{key:t.name,item:t,onApply:e._handleApplyTemplate,className:a((r={},r[m.first]=0===i,r[m.last]=i===o.length-1,r))});var r})},e.prototype._renderMenuItems=function(){var t=this,e=this.state.studyTemplatesList,i=this.props.isFavoritingAllowed;return e.map(function(e){return n.createElement(u.StudyTemplateListItem,{key:e.name,item:e,isFavoritingAllowed:i,favorite:t._isTemplateFavorite(e.name),onApply:t._handleApplyTemplate,onFavor:t._handleFavorTemplate,onRemove:t._handleRemoveTemplate})})},
e.prototype._handleTemplatesChange=function(){this.setState({studyTemplatesList:this.context.studyTemplates.list()})},e.prototype._handleFavoritesChange=function(t){this.props.isShownQuicks&&this.setState({favorites:t})},e.prototype._removeFavoriteTemplate=function(t){var e,i=this.context.favoriteStudyTemplatesService;void 0!==i&&(e=this.state.favorites,i.set(e.filter(function(e){return e!==t})))},e.prototype._addFavoriteTemplate=function(t){var e,i=this.context.favoriteStudyTemplatesService;void 0!==i&&(e=this.state.favorites,i.set(e.concat([t])))},e.prototype._isTemplateFavorite=function(t){return this.state.favorites.includes(t)},e.contextTypes={favoriteStudyTemplatesService:r.object,studyTemplates:r.object.isRequired},e}(n.PureComponent),e.ToolWidgetTemplates=v},function(t,e,i){"use strict";function o(t){return n.createElement(r.PopupMenuItem,{label:n.createElement("div",{className:a.label},n.createElement(s.Icon,{className:a.icon,icon:l}),n.createElement("div",{className:a.text},c.text)),onClick:t.onClick})}var n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),n=i(2),r=i(70),s=i(59),a=i(1064),l=i(1065),c={text:window.t("Save Indicator Template...")},e.SaveIndicatorMenuItem=o},function(t,e){t.exports={label:"label-1LxfyrID-",icon:"icon-3bTRbX0U-",text:"text-2BJe_3ce-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 17 14" width="17" height="14"><path d="M1 9v1.5A2.5 2.5 0 0 0 3.5 13h10a2.5 2.5 0 0 0 2.5-2.5V9h-1v1.5a1.5 1.5 0 0 1-1.5 1.5h-10A1.5 1.5 0 0 1 2 10.5V9H1z"/><path fill-rule="evenodd" d="M8 1h1v8H8z"/><path d="M5.354 5.646l-.708.708L8.5 10.207l3.854-3.853-.708-.708L8.5 8.793z"/></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(43),n=i(2),r=i(153),s=i(370),a=i(70),l=function(t){function e(e){var i=t.call(this,e)||this;return i._handleMouseEnter=function(){i.setState({isHovered:!0})},i._handleMouseLeave=function(){i.setState({isHovered:!1})},i._handleApply=function(){var t=i.props,e=t.item;(0,t.onApply)(e)},i._handleRemove=function(){var t=i.props,e=t.item;(0,t.onRemove)(e)},i._handleFavor=function(){var t=i.props,e=t.item,o=t.onFavor;o&&o(e)},i.state={isHovered:!1},i}return o.__extends(e,t),e.prototype.render=function(){var t=this.props,e=t.item,i=t.onFavor,o=t.favorite,l=t.isFavoritingAllowed,c=this.state.isHovered;return n.createElement("div",{onMouseEnter:this._handleMouseEnter,onMouseLeave:this._handleMouseLeave},n.createElement(a.PopupMenuItem,{label:e.name,showToolboxOnHover:!o,onClick:this._handleApply,toolbox:[n.createElement(s.RemoveButton,{key:"remove",hidden:!Modernizr.touch&&!c,onClick:this._handleRemove}),!!i&&l&&n.createElement(r.FavoriteButton,{key:"favorite",isFilled:!!o,onClick:this._handleFavor})]}))},e}(n.PureComponent),e.StudyTemplateListItem=l},function(t,e,i){"use strict";var o,n,r,s,a;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),n=i(2),r=i(14),s=i(1068),a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._handleClick=function(t){
t.stopPropagation();var i=e.props;(0,i.onApply)(i.item)},e}return o.__extends(e,t),e.prototype.render=function(){var t=this.props,e=t.className,i=t.item;return n.createElement("div",{className:r(e,s.item,"apply-common-tooltip"),onClick:this._handleClick,title:i.name},i.name.length>0?i.name[0].toUpperCase():" ")},e}(n.PureComponent),e.FavoriteStudyTemplateItem=a},function(t,e){t.exports={item:"item-b8AKccvl-",hovered:"hovered-2SpHqnXp-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M12 22v-6h-1v6zm3 0v-4h-1v4zm3 0v-2h-1v2zm3 0v-4h-1v4zm3 0v-7h-1v7zM9 22v-4H8v4zm-3 0v-1H5v1z"/><path d="M5.5 17.207l4.65-4.65a1.906 1.906 0 0 1 2.7 0l2.593 2.593a2.906 2.906 0 0 0 4.114 0l4.65-4.65-.707-.707-4.65 4.65a1.906 1.906 0 0 1-2.7 0l-2.593-2.593a2.906 2.906 0 0 0-4.114 0l-4.65 4.65.707.707z"/><path d="M5.5 12.207l4.65-4.65a1.906 1.906 0 0 1 2.7 0l2.593 2.593a2.906 2.906 0 0 0 4.114 0l4.65-4.65-.707-.707-4.65 4.65a1.906 1.906 0 0 1-2.7 0L13.557 6.85a2.906 2.906 0 0 0-4.114 0l-4.65 4.65.707.707z"/></svg>'},function(t,e){t.exports={wrap:"wrap-15BhAobm-",opened:"opened-1yAGeGGi-",full:"full-2VMT2UlC-",first:"first-1vAzGgSq-",last:"last-xMjAcadb-",medium:"medium-1BEsHMFf-",loader:"loader-1uURoPBh-"}},function(t,e,i){"use strict";var o,n,r,s,a,l,c,h,u,d,p,_,f,m,g,v;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(12),n=i(2),i(102),r=i(40),s=i(103),a=i(109),l=i(1072),c=i(149),h=i(1073),u=i(1074),d=i(237),p=i(27),_={undoHint:window.t("Undo {0}"),redoHint:window.t("Redo {0}")},f=d.weakComposeClasses(c,l,{buttonUndo:"button",buttonRedo:"button"}),m=o.__assign({},c,{button:f.buttonUndo}),g=o.__assign({},c,{button:f.buttonRedo}),v=function(t){function e(e,i){var o=t.call(this,e,i)||this;return o._handleClickUndo=function(){r.trackEvent("GUI","Undo"),o.context.chartWidgetCollection.undoHistory.undo()},o._handleClickRedo=function(){r.trackEvent("GUI","Redo"),o.context.chartWidgetCollection.undoHistory.redo()},o.state=o._getStateFromUndoHistory(),o}return o.__extends(e,t),e.prototype.componentDidMount=function(){var t=this.context.chartWidgetCollection;t.undoHistory.redoStack().onChange().subscribe(this,this._onChangeStack),t.undoHistory.undoStack().onChange().subscribe(this,this._onChangeStack)},e.prototype.componentWillUnmount=function(){var t=this.context.chartWidgetCollection;t.undoHistory.redoStack().onChange().unsubscribe(this,this._onChangeStack),t.undoHistory.undoStack().onChange().unsubscribe(this,this._onChangeStack)},e.prototype.render=function(){var t=this.props.id,e=this.state,i=e.isEnabledRedo,o=e.isEnabledUndo,r=e.redoStack,l=e.undoStack;return n.createElement(a.ToolWidgetRowWrap,{id:t},n.createElement(s.ToolWidgetButton,{icon:h,isDisabled:!o,onClick:this._handleClickUndo,title:o?_.undoHint.format(l):void 0,theme:m}),n.createElement(s.ToolWidgetButton,{icon:u,isDisabled:!i,onClick:this._handleClickRedo,title:i?_.redoHint.format(r):void 0,theme:g}))},e.prototype._onChangeStack=function(){var t=this._getStateFromUndoHistory();this.setState(t)},
e.prototype._getStateFromUndoHistory=function(){var t=this.context.chartWidgetCollection,e=t.undoHistory.undoStack(),i=t.undoHistory.redoStack(),o=i.head(),n=e.head();return{isEnabledRedo:!i.isEmpty(),isEnabledUndo:!e.isEmpty(),redoStack:o?o.text():"",undoStack:n?n.text():""}},e.contextTypes={chartWidgetCollection:p.object.isRequired},e}(n.PureComponent),e.ToolWidgetUndoRedo=v},function(t,e){t.exports={buttonUndo:"buttonUndo-342XpPC1-",buttonRedo:"buttonRedo-3o_XdU_J-"}},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M20 19v-1.5a5.5 5.5 0 0 0-5.5-5.5h-6v1h6a4.5 4.5 0 0 1 4.5 4.5V19h1z"/><path d="M12.354 8.854l-.708-.708L7.293 12.5l4.353 4.354.708-.708L8.707 12.5z"/></svg>'},function(t,e){t.exports='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 28 28" width="28" height="28"><path d="M9 19v-1.5a4.5 4.5 0 0 1 4.5-4.5h6v-1h-6A5.5 5.5 0 0 0 8 17.5V19h1z"/><path d="M15.646 16.146l.708.708 4.353-4.354-4.353-4.354-.708.708 3.647 3.646z"/></svg>'},function(t,e,i){"use strict";var o,n,r,s,a,l,c;Object.defineProperty(e,"__esModule",{value:!0}),o=i(0),i(13),n=i(2),r=i(39),s=i(83),a=i(9),l=i(109),c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._ref=null,e._update=function(){e.forceUpdate()},e._setRef=function(t){e._ref=t},e._handleMeasure=function(t){var i=t.width;e.props.width.setValue(i)},e}return o.__extends(e,t),e.prototype.componentDidMount=function(){var t,e=this.props,i=e.jquery,o=e.isFake,n=e.width;o?n.subscribe(this._update):(t=a.ensureNotNull(this._ref),$(r.findDOMNode(t)).append(i))},e.prototype.componentWillUnmount=function(){var t=this.props,e=t.width;t.isFake&&e.unsubscribe(this._update)},e.prototype.render=function(){var t=this.props,e=t.isFake,i=void 0!==e&&e,o=t.width;return n.createElement(s,{shouldMeasure:!i,whitelist:["width"],onMeasure:this._handleMeasure},n.createElement(l.ToolWidgetRowWrap,{ref:this._setRef,style:i?{width:o.value()}:void 0}))},e}(n.PureComponent),e.ToolWidgetCustom=c}],[568]);