/**
 * Highstock JS v11.2.0 (2023-10-30)
 *
 * HeikinAshi series type for Highcharts Stock
 *
 * (c) 2010-2021 Karol Kolodziej
 *
 * License: www.highcharts.com/license
 */!function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/modules/heikinashi",["highcharts","highcharts/modules/stock"],function(i){return t(i),t.Highcharts=i,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var i=t?t._modules:{};function e(t,i,e,o){t.hasOwnProperty(i)||(t[i]=o.apply(null,e),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:i,module:t[i]}})))}e(i,"Series/HeikinAshi/HeikinAshiPoint.js",[i["Core/Series/SeriesRegistry.js"]],function(t){var i,e=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),o=t.seriesTypes,s=o.candlestick.prototype.pointClass,n=o.hlc.prototype.pointClass;return function(t){function i(){var i=null!==t&&t.apply(this,arguments)||this;return i.resolveColor=n.prototype.resolveColor,i}return e(i,t),i}(s)}),e(i,"Series/HeikinAshi/HeikinAshiSeriesDefaults.js",[],function(){return{dataGrouping:{groupAll:!0}}}),e(i,"Series/HeikinAshi/HeikinAshiSeries.js",[i["Series/HeikinAshi/HeikinAshiPoint.js"],i["Series/HeikinAshi/HeikinAshiSeriesDefaults.js"],i["Core/Series/SeriesRegistry.js"],i["Core/Utilities.js"]],function(t,i,e,o){var s,n=this&&this.__extends||(s=function(t,i){return(s=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(t[e]=i[e])})(t,i)},function(t,i){if("function"!=typeof i&&null!==i)throw TypeError("Class extends value "+String(i)+" is not a constructor or null");function e(){this.constructor=t}s(t,i),t.prototype=null===i?Object.create(i):(e.prototype=i.prototype,new e)}),r=e.seriesTypes.candlestick,a=o.addEvent,h=o.merge,p=[];function u(){this.series.forEach(function(t){t.is("heikinashi")&&(t.heikiashiData.length=0,t.getHeikinashiData())})}function c(){var t=this.points,i=this.heikiashiData,e=this.cropStart||0;this.processedYData.length=0;for(var o=0;o<t.length;o++){var s=t[o],n=i[o+e];s.open=n[0],s.high=n[1],s.low=n[2],s.close=n[3],this.processedYData.push([s.open,s.high,s.low,s.close])}}function l(){this.heikiashiData.length&&(this.heikiashiData.length=0)}var f=function(t){function e(){var i=null!==t&&t.apply(this,arguments)||this;return i.data=void 0,i.heikiashiData=[],i.options=void 0,i.points=void 0,i.yData=void 0,i.processedYData=void 0,i}return n(e,t),e.compose=function(t,i){for(var s=[],n=2;n<arguments.length;n++)s[n-2]=arguments[n];r.compose(t),o.pushUnique(p,i)&&a(i,"postProcessData",u),o.pushUnique(p,e)&&(a(e,"afterTranslate",c),a(e,"updatedData",l))},e.prototype.getHeikinashiData=function(){var t=this.allGroupedData||this.yData,i=this.heikiashiData;if(!i.length&&t&&t.length){var e=t[0];this.modifyFirstPointValue(e);for(var o=1;o<t.length;o++){var s=t[o],n=i[o-1];this.modifyDataPoint(s,n)}}this.heikiashiData=i},e.prototype.init=function(){t.prototype.init.apply(this,arguments),this.heikiashiData=[]},e.prototype.modifyFirstPointValue=function(t){var i=(t[0]+t[1]+t[2]+t[3])/4,e=(t[0]+t[3])/2;this.heikiashiData.push([i,t[1],t[2],e])},e.prototype.modifyDataPoint=function(t,i){var e=(i[0]+i[3])/2,o=(t[0]+t[1]+t[2]+t[3])/4,s=Math.max(t[1],o,e),n=Math.min(t[2],o,e);this.heikiashiData.push([e,s,n,o])},e.defaultOptions=h(r.defaultOptions,i),e}(r);return f.prototype.pointClass=t,e.registerSeriesType("heikinashi",f),f}),e(i,"masters/modules/heikinashi.src.js",[i["Core/Globals.js"],i["Series/HeikinAshi/HeikinAshiSeries.js"]],function(t,i){i.compose(t.Series,t.Axis)})});//# sourceMappingURL=heikinashi.js.map